diff --git a/commands.json b/commands.json index 52ed098..42670ee 100644 --- a/commands.json +++ b/commands.json @@ -14,7 +14,8 @@ "/ratz gituserinfo + GitHub Username", "/ratz gitrepoinfo + {GitHubUsername}/{RepositoryName}", "/ratz showactiveevent", - "/ratz joinactiveevent" + "/ratz joinactiveevent", + "/ratz getremovedmessages [DM-Channel Command]" ], "definitions": [ "Shows all commands for ratzBot", @@ -31,6 +32,7 @@ "Shows information for provided GitHub user", "Show information for provided GitHub repository (which is owned by the provided GitHub username)", "Shows active server event", - "Join active server event" + "Join active server event", + "Gets all removed messages that were created by the user; given by ratzBot in a DM-Channel" ] } \ No newline at end of file diff --git a/main.js b/main.js index 3f2e606..2451616 100644 --- a/main.js +++ b/main.js @@ -1,6 +1,42 @@ // COPYRIGHT (C) GAVIN ISGAR 2017-2018 +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; var Discord = require("discord.js"); var DiscordRPC = require("discord-rpc"); +var tf = require('@tensorflow/tfjs'); var opus = require("opusscript"); var ffmpeg = require("ffmpeg-binaries"); var ytdl = require("ytdl-core"); @@ -12,12 +48,15 @@ var url = require("url"); var path = require("path"); var request = require("request"); var commands = require("./commands.json"); -var tokens = require("./exclude/tokens.json"); +//var tokens = require("./exclude/tokens.json"); +var tokens = require("C:/Users/Gavin/Desktop/tokens.json"); var fs = require("fs"); var readline = require("readline"); -var package = require("./package.json"); +var packagefile = require("./package.json"); var _a = require('electron'), app = _a.app, BrowserWindow = _a.BrowserWindow; var date = new Date(); +var messagedata = require("./exclude/removedauthmessages.json"); +var advertdata = require("./exclude/adverts.json"); //-----SERVER EVENTS----- var activeevent = ""; // --------- @@ -25,409 +64,440 @@ var activeevent = ""; var logChannel = "423939166401855518"; var newcomerChannel = "423937750937501697"; var mainChannel = "443227379712917505"; +var liveChannel = "423938014801166346"; +var selfPromoChannel = "438003121755783199"; // ---------- bot.on('message', function (message) { try { - if (fs.readFileSync("./exclude/bannedusers.ratz").includes(message.author.id.toString()) == true) { - message.channel.send(message.author + ", you are banned from communicating in the server."); - message["delete"](); - } - else { - if (fs.readFileSync("./exclude/users.ratz").includes(message.author.id.toString()) == false) { - if (message.author.username == "GitHub" && message.author.bot == 1) { - // Do nothing - } - else { - if (message.content.toString() == "/ratz slimedog") { - fs.appendFileSync("./exclude/users.ratz", "\r\n" + message.author.id.toString()); - message["delete"](); - message.channel.send(message.author + ", you now have access to type in the server!"); + if (message.channel.type == "dm") { + if (message.author.id == "434154972834299904") { + // Do nothing + } + else { + if (message.content.toString() == "/ratz getremovedmessages") { + if (!messagedata.users[0][message.author.id]) { + message.channel.send("No message data exists for your UserID."); + console.log("Private data requested and failed from " + message.author.username); } else { - fs.appendFileSync("./exclude/removedauthmessages.ratz", "\r\n(" + message.author.username + " [" + message.author.id + "], " + message.createdTimestamp + ") " + message.content.toString()); - message["delete"](); - message.channel.send(message.author + ", you have not completely read the rules in order to have access to chat. To get access, re-read the rules and type the secret response message specified."); + message.channel.send(messagedata.users[0][message.author.id]); + console.log("Private data requested and given to " + message.author.username); } } } + } + else { + if (fs.readFileSync("./exclude/bannedusers.ratz").includes(message.author.id.toString()) == true) { + message.channel.send(message.author + ", you are banned from communicating in the server."); + message["delete"](); + } else { - // ---COMMANDS--- - if (message.content.toString().startsWith("/ratz discorduserinfo ")) { - var result = message.content.slice(22); - try { - var user = bot.users.find("id", result); - var embed = new Discord.RichEmbed() - .setTitle("Discord User Information for " + user.username) - .setColor(0xcb00ff) - .setThumbnail(user.avatarURL) - .addField("Username", user.username) - .addField("ID", user.id) - .addField("Tag", user.tag) - .addField("Account Created", user.createdTimestamp) - .addField("Last Message ID", user.lastMessageID); - message.channel.send(embed); - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000008)); - appendError(TYPE.BACKEND, ERROR.RATZx0000008, message.author.id); + if (fs.readFileSync("./exclude/users.ratz").includes(message.author.id.toString()) == false) { + if (message.author.username == "GitHub" && message.author.bot == 1) { + // Do nothing } - } - if (message.content.toString() == "/ratz slimedog") { - message.channel.send(message.author + ", you are already authorized to type in the server!"); - } - if (message.content.toString() == "/ratz showcommands") { - var i; - var embed_1 = new Discord.RichEmbed() - .setTitle("Commands for ratzBot") - .setColor(0xcb00ff) - .setThumbnail(bot.user.avatarURL.toString()); - for (i = 0; commands.names[i]; i++) { - for (i = 0; commands.definitions[i]; i++) { - embed_1.addField(commands.names[i], commands.definitions[i]); + else { + if (message.content.toString() == "/ratz slimedog") { + fs.appendFileSync("./exclude/users.ratz", "\r\n" + message.author.id.toString()); + message["delete"](); + message.channel.send(message.author + ", you now have access to type in the server!"); + } + else { + removeMessage(message.content.toString(), message.author.id); + message["delete"](); + message.channel.send(message.author + ", hello and welcome to the server! You have to read the rules and enter the specified password to access the server (for the sake of spammers \u2661)."); + // Old method + //fs.appendFileSync("./exclude/removedauthmessages.ratz", "\r\n(" + message.author.username + " [" + message.author.id + "], " + message.createdTimestamp + ") " + message.content.toString()); + //message["delete"](); + //message.channel.send(message.author + ", hello and welcome to the server! You have to read the rules and enter the specified password to access the server (for the sake of spammers \u2661)."); } } - message.channel.send({ embed: embed_1 }); } - if (message.content.toString() == "/ratz botinfo") { - var embed = new Discord.RichEmbed() - .setTitle("ratzBot Information") - .setThumbnail(bot.user.avatarURL.toString()) - .setColor(0xcb00ff) - .addField("Developer", "Gavin Isgar (https://www.github.com/gisgar3/)") - .addField("Version Number", package.version) - .addField("Source Languages", "JavaScript\nTypeScript") - .addField("GitHub Repository", "https://www.github.com/gisgar3/ratzbot/"); - message.channel.send(embed); - } - if (message.content.startsWith("/ratz steamuserinfo ")) { - var result = message.content.slice(20); - var getSteamProfile = { - method: "GET", - url: "https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=" + tokens.steamtoken + "&steamids=" + result - }; - request(getSteamProfile, function (error, response, body) { + else { + // ---COMMANDS--- + if (message.content.toString().startsWith("/ratz discorduserinfo ")) { + var result = message.content.slice(22); try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - var embed_2 = new Discord.RichEmbed() - .setTitle("Steam User Information for " + stats.response.players[0].steamid) - .setURL(stats.response.players[0].profileurl) - .setColor(0xcb00ff) - .setThumbnail(stats.response.players[0].avatarfull) - .addField("Username", stats.response.players[0].personaname) - .addField("Profile State", stats.response.players[0].profilestate) - .addField("Primary Clan", stats.response.players[0].primaryclanid) - .addField("Last Logoff", stats.response.players[0].lastlogoff) - .addField("Account Created", stats.response.players[0].timecreated); - message.channel.send({ embed: embed_2 }); - } - else { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000007)); - appendError(TYPE.BACKEND, ERROR.RATZx0000007, message.author.id); - } + var user = bot.users.find("id", result); + var embed = new Discord.RichEmbed() + .setTitle("Discord User Information for " + user.username) + .setColor(0xcb00ff) + .setThumbnail(user.avatarURL) + .addField("Username", user.username) + .addField("ID", user.id) + .addField("Tag", user.tag) + .addField("Account Created", user.createdTimestamp) + .addField("Last Message ID", user.lastMessageID); + message.channel.send(embed); } catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000007)); - appendError(TYPE.BACKEND, ERROR.RATZx0000007, message.author.id); + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000008)); + appendError(TYPE.BACKEND, ERROR.RATZx0000008, message.author.id, err); } - }); - } - if (message.content.toString() == "/ratz releaseinfo") { - var getReleaseInfo = { - method: "GET", - url: "https://api.github.com/repos/Gisgar3/ratzBot/releases", - headers: { - "User-Agent": "Gisgar3" + } + if (message.content.toString() == "/ratz slimedog") { + message.channel.send(message.author + ", you are already authorized to type in the server!"); + } + if (message.content.toString() == "/ratz showcommands") { + var i; + var embed_1 = new Discord.RichEmbed() + .setTitle("Commands for ratzBot") + .setColor(0xcb00ff) + .setThumbnail(bot.user.avatarURL.toString()); + for (i = 0; commands.names[i]; i++) { + for (i = 0; commands.definitions[i]; i++) { + embed_1.addField(commands.names[i], commands.definitions[i]); + } } - }; - request(getReleaseInfo, function (error, response, body) { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - var embed = new Discord.RichEmbed() - .setTitle("ratzBot GitHub Release Information") - .setThumbnail(bot.user.avatarURL) - .setColor(0xcb00ff) - .setURL(stats[0].html_url) - .addField("Latest Release", "" + stats[0].name) - .addField("Release Branch", "" + stats[0].target_commitish) - .addField("Tag", stats[0].tag_name) - .addField("Changelog", stats[0].body) - .addField("Pre-Release Status", "" + stats[0].prerelease) - .addField("Author", stats[0].author.login); - if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-RC")) { - embed.setFooter("BUILD STAGE: Release Candidate"); + message.channel.send({ embed: embed_1 }); + } + if (message.content.toString() == "/ratz botinfo") { + var embed = new Discord.RichEmbed() + .setTitle("ratzBot Information") + .setThumbnail(bot.user.avatarURL.toString()) + .setColor(0xcb00ff) + .addField("Developer", "Gavin Isgar (https://www.github.com/gisgar3/)") + .addField("Version Number", packagefile.version) + .addField("Source Languages", "JavaScript\nTypeScript") + .addField("GitHub Repository", "https://www.github.com/gisgar3/ratzbot/"); + message.channel.send(embed); + } + if (message.content.startsWith("/ratz steamuserinfo ")) { + var result = message.content.slice(20); + var getSteamProfile = { + method: "GET", + url: "https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=" + tokens.steamtoken + "&steamids=" + result + }; + request(getSteamProfile, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_2 = new Discord.RichEmbed() + .setTitle("Steam User Information for " + stats.response.players[0].steamid) + .setURL(stats.response.players[0].profileurl) + .setColor(0xcb00ff) + .setThumbnail(stats.response.players[0].avatarfull) + .addField("Username", stats.response.players[0].personaname) + .addField("Profile State", stats.response.players[0].profilestate) + .addField("Primary Clan", stats.response.players[0].primaryclanid) + .addField("Last Logoff", stats.response.players[0].lastlogoff) + .addField("Account Created", stats.response.players[0].timecreated); + message.channel.send({ embed: embed_2 }); } - else if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-Beta")) { - embed.setFooter("BUILD STAGE: Beta"); + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000007)); + appendError(TYPE.BACKEND, ERROR.RATZx0000007, message.author.id, error); } - else if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-Alpha")) { - embed.setFooter("BUILD STAGE: Alpha"); + } + catch (err) { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000007)); + appendError(TYPE.BACKEND, ERROR.RATZx0000007, message.author.id, err); + } + }); + } + if (message.content.toString() == "/ratz releaseinfo") { + var getReleaseInfo = { + method: "GET", + url: "https://api.github.com/repos/Gisgar3/ratzBot/releases", + headers: { + "User-Agent": "Gisgar3" + } + }; + request(getReleaseInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed = new Discord.RichEmbed() + .setTitle("ratzBot GitHub Release Information") + .setThumbnail(bot.user.avatarURL) + .setColor(0xcb00ff) + .setURL(stats[0].html_url) + .addField("Latest Release", "" + stats[0].name) + .addField("Release Branch", "" + stats[0].target_commitish) + .addField("Tag", stats[0].tag_name) + .addField("Changelog", stats[0].body) + .addField("Pre-Release Status", "" + stats[0].prerelease) + .addField("Author", stats[0].author.login); + if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-RC")) { + embed.setFooter("BUILD STAGE: Release Candidate"); + } + else if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-Beta")) { + embed.setFooter("BUILD STAGE: Beta"); + } + else if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-Alpha")) { + embed.setFooter("BUILD STAGE: Alpha"); + } + else if ("" + stats[0].prerelease == "false") { + embed.setFooter("BUILD STAGE: General Availability"); + } + message.channel.send(embed); } - else if ("" + stats[0].prerelease == "false") { - embed.setFooter("BUILD STAGE: General Availability"); + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, error); } - message.channel.send(embed); } - else { + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, err); } - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); - } - }); - } - if (message.content.startsWith("/ratz gituserinfo ")) { - var result = message.content.slice(18); - var getGitUserInfo = { - method: "GET", - url: "https://api.github.com/users/" + result, - headers: { - "User-Agent": "Gisgar3" - } - }; - request(getGitUserInfo, function (error, response, body) { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - var embed_3 = new Discord.RichEmbed() - .setTitle("GitHub User Information for " + result) - .setURL(stats.html_url) - .setColor(0xcb00ff) - .setThumbnail(stats.avatar_url) - .addField("Name", stats.name) - .addField("Company", "" + stats.company) - .addField("Bio", "" + stats.bio) - .addField("Location", "" + stats.location) - .addField("Email", "" + stats.email) - .addField("Hireable", "" + stats.hireable) - .addField("Public Repositories", stats.public_repos); - message.channel.send(embed_3); + }); + } + if (message.content.startsWith("/ratz gituserinfo ")) { + var result = message.content.slice(18); + var getGitUserInfo = { + method: "GET", + url: "https://api.github.com/users/" + result, + headers: { + "User-Agent": "Gisgar3" + } + }; + request(getGitUserInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_3 = new Discord.RichEmbed() + .setTitle("GitHub User Information for " + result) + .setURL(stats.html_url) + .setColor(0xcb00ff) + .setThumbnail(stats.avatar_url) + .addField("Name", stats.name) + .addField("Company", "" + stats.company) + .addField("Bio", "" + stats.bio) + .addField("Location", "" + stats.location) + .addField("Email", "" + stats.email) + .addField("Hireable", "" + stats.hireable) + .addField("Public Repositories", stats.public_repos); + message.channel.send(embed_3); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, error); + } } - else { + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, err); } - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); - } - }); - } - if (message.content.startsWith("/ratz gitrepoinfo ")) { - var result = message.content.slice(18); - var getGitRepoInfo = { - method: "GET", - url: "https://api.github.com/repos/" + result, - headers: { - 'User-Agent': 'Gisgar3' - } - }; - request(getGitRepoInfo, function (error, response, body) { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - var embed_4 = new Discord.RichEmbed() - .setTitle("GitHub Repository for " + result) - .setURL(stats.html_url) - .setColor(0xcb00ff) - .setThumbnail(stats.owner.avatar_url) - .addField("Name", stats.name) - .addField("Description", stats.description) - .addField("Owner", stats.owner.login) - .addField("Language", stats.language) - .addField("Archive Status", stats.archived); - message.channel.send(embed_4); + }); + } + if (message.content.startsWith("/ratz gitrepoinfo ")) { + var result = message.content.slice(18); + var getGitRepoInfo = { + method: "GET", + url: "https://api.github.com/repos/" + result, + headers: { + 'User-Agent': 'Gisgar3' + } + }; + request(getGitRepoInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_4 = new Discord.RichEmbed() + .setTitle("GitHub Repository for " + result) + .setURL(stats.html_url) + .setColor(0xcb00ff) + .setThumbnail(stats.owner.avatar_url) + .addField("Name", stats.name) + .addField("Description", stats.description) + .addField("Owner", stats.owner.login) + .addField("Language", stats.language) + .addField("Archive Status", stats.archived); + message.channel.send(embed_4); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, error); + } } - else { + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, err); } - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); - } - }); - } - if (message.content.toString() == "/ratz btcinfo") { - var getBTCInfo = { - method: "GET", - url: "https://api.blockchain.info/stats" - }; - request(getBTCInfo, function (error, response, body) { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - var embed_5 = new Discord.RichEmbed() - .setTitle("BTC Information") - .setColor(0xcb00ff) - .setThumbnail(bot.user.avatarURL) - .addField("Market Price (USD)", "$" + stats.market_price_usd) - .addField("BTC Mined", stats.n_btc_mined) - .addField("Blocks Mined", stats.n_blocks_mined) - .addField("Total Blocks", stats.n_blocks_total) - .addField("Total BTC Sent", stats.total_btc_sent); - message.channel.send(embed_5); + }); + } + if (message.content.toString() == "/ratz btcinfo") { + var getBTCInfo = { + method: "GET", + url: "https://api.blockchain.info/stats" + }; + request(getBTCInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_5 = new Discord.RichEmbed() + .setTitle("BTC Information") + .setColor(0xcb00ff) + .setThumbnail(bot.user.avatarURL) + .addField("Market Price (USD)", "$" + stats.market_price_usd) + .addField("BTC Mined", stats.n_btc_mined) + .addField("Blocks Mined", stats.n_blocks_mined) + .addField("Total Blocks", stats.n_blocks_total) + .addField("Total BTC Sent", stats.total_btc_sent); + message.channel.send(embed_5); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000005)); + appendError(TYPE.BACKEND, ERROR.RATZx0000005, message.author.id, error); + } } - else { + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000005)); - appendError(TYPE.BACKEND, ERROR.RATZx0000005, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000005, message.author.id, err); } + }); + } + // -----SERVER EVENTS----- + if (message.content.toString() == "/ratz joinactiveevent") { + if (activeevent == "") { + message.channel.send(message.author + ", there is no active event on the server."); } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000005)); - appendError(TYPE.BACKEND, ERROR.RATZx0000005, message.author.id); + else { + try { + fs.appendFileSync("./exclude/eventuserlist.ratz", "\r\n" + message.author.id); + message.channel.send(message.author + ", you are now joined into the " + activeevent + "!"); + } + catch (err) { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000004)); + appendError(TYPE.BACKEND, ERROR.RATZx0000004, message.author.id, err); + } } - }); - } - // -----SERVER EVENTS----- - if (message.content.toString() == "/ratz joinactiveevent") { - if (activeevent == "") { - message.channel.send(message.author + ", there is no active event on the server."); } - else { - try { - fs.appendFileSync("./exclude/eventuserlist.ratz", "\r\n" + message.author.id); - message.channel.send(message.author + ", you are now joined into the " + activeevent + "!"); + if (message.content.toString() == "/ratz showactiveevent") { + if (activeevent == "") { + message.channel.send(message.author + ", there is no active event on the server."); } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000004)); - appendError(TYPE.BACKEND, ERROR.RATZx0000004, message.author.id); + else { + message.channel.send(message.author + ", the active event on the server is the " + activeevent + "."); } } - } - if (message.content.toString() == "/ratz showactiveevent") { - if (activeevent == "") { - message.channel.send(message.author + ", there is no active event on the server."); - } - else { - message.channel.send(message.author + ", the active event on the server is the " + activeevent + "."); - } - } - // -----STREAMLABS INTEGRATION----- - if (message.content.startsWith("/ratz ratcoininfo ")) { - var result = message.content.slice(18); - var getRTCInfo = { - method: "GET", - url: "https://streamlabs.com/api/v1.0/points?access_token=" + tokens.streamlabstoken + "&username=" + result + "&channel=ratzdoll" - }; - request(getRTCInfo, function (error, response, body) { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - message.channel.send(message.author + ", " + result + " has " + stats.points + " RTC!"); + // -----STREAMLABS INTEGRATION----- + if (message.content.startsWith("/ratz ratcoininfo ")) { + var result = message.content.slice(18); + var getRTCInfo = { + method: "GET", + url: "https://streamlabs.com/api/v1.0/points?access_token=" + tokens.streamlabstoken + "&username=" + result + "&channel=ratzdoll" + }; + request(getRTCInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + message.channel.send(message.author + ", " + result + " has " + stats.points + " RTC!"); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000003)); + appendError(TYPE.BACKEND, ERROR.RATZx0000003, message.author.id, error); + } } - else { + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000003)); - appendError(TYPE.BACKEND, ERROR.RATZx0000003, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000003, message.author.id, err); } - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000003)); - appendError(TYPE.BACKEND, ERROR.RATZx0000003, message.author.id); - } - }); - } - // -----TWITCH NEW API----- - if (message.content.toString() == "/ratz laststream") { - var getStreamVOD = { - method: 'GET', - url: "https://api.twitch.tv/helix/videos?user_id=157901049&first=1", - headers: { - "Client-ID": "" + tokens.twitchapiclientid - } - }; - request(getStreamVOD, function (error, response, body) { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - var embed_6 = new Discord.RichEmbed() - .setTitle("Last Stream VOD from ratzDoll") - .setThumbnail(bot.user.avatarURL) - .setColor(0xcb00ff) - .setURL(stats.data[0].url) - .addField("Title", "" + stats.data[0].title) - .addField("Published At", "" + stats.data[0].published_at) - .addField("Duration", "" + stats.data[0].duration) - .addField("View Count", stats.data[0].view_count); - message.channel.send(embed_6); + }); + } + // -----TWITCH NEW API----- + if (message.content.toString() == "/ratz laststream") { + var getStreamVOD = { + method: 'GET', + url: "https://api.twitch.tv/helix/videos?user_id=157901049&first=1", + headers: { + "Client-ID": "" + tokens.twitchapiclientid } - else { + }; + request(getStreamVOD, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_6 = new Discord.RichEmbed() + .setTitle("Last Stream VOD from ratzDoll") + .setThumbnail(bot.user.avatarURL) + .setColor(0xcb00ff) + .setURL(stats.data[0].url) + .addField("Title", "" + stats.data[0].title) + .addField("Published At", "" + stats.data[0].published_at) + .addField("Duration", "" + stats.data[0].duration) + .addField("View Count", stats.data[0].view_count); + message.channel.send(embed_6); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000002)); + appendError(TYPE.BACKEND, ERROR.RATZx0000002, message.author.id, error); + } + } + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000002)); - appendError(TYPE.BACKEND, ERROR.RATZx0000002, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000002, message.author.id, err); } + }); + } + // -----VOICE CHANNELS----- + if (message.content.startsWith("/ratz play ")) { + var result = message.content.slice(11); + if (message.member.voiceChannel) { + message.member.voiceChannel.join().then(function (connection) { + try { + var stream = ytdl(result, { filter: "audioonly" }); + var dispatcher = connection.playStream(stream); + message.channel.send(message.author + ", your music is now playing."); + dispatcher.on("end", function (end) { + message.channel.send(message.author + ", your music has ended."); + message.member.voiceChannel.leave(); + }); + } + catch (err) { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000001)); + appendError(TYPE.BACKEND, ERROR.RATZx0000001, message.author.id, err); + } + }); } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000002)); - appendError(TYPE.BACKEND, ERROR.RATZx0000002, message.author.id); + else { + message.channel.send(message.author + ", you are not in a voice channel. Join a voice channel to play music!"); } - }); - } - // -----VOICE CHANNELS----- - if (message.content.startsWith("/ratz play ")) { - var result = message.content.slice(11); - if (message.member.voiceChannel) { - message.member.voiceChannel.join().then(function (connection) { + } + if (message.content.toString() == "/ratz stop") { + if (message.member.voiceChannel) { try { - var stream = ytdl(result, { filter: "audioonly" }); - var dispatcher = connection.playStream(stream); - message.channel.send(message.author + ", your music is now playing."); - dispatcher.on("end", function (end) { - message.channel.send(message.author + ", your music has ended."); - message.member.voiceChannel.leave(); - }); + message.member.voiceChannel.connection.disconnect(); + message.member.voiceChannel.leave(); } catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000001)); - appendError(TYPE.BACKEND, ERROR.RATZx0000001, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000001, message.author.id, err); } - }); - } - else { - message.channel.send(message.author + ", you are not in a voice channel. Join a voice channel to play music!"); - } - } - if (message.content.toString() == "/ratz stop") { - if (message.member.voiceChannel) { - try { - message.member.voiceChannel.connection.disconnect(); - message.member.voiceChannel.leave(); } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000001)); - appendError(TYPE.BACKEND, ERROR.RATZx0000001, message.author.id); + else { + message.channel.send(message.author + ", you are not in a voice channel."); } } - else { - message.channel.send(message.author + ", you are not in a voice channel."); - } - } - // -----TOPIC DETECTION AND REVIEW----- - if ((message.content.includes("XXXTentacion") || message.content.includes("xxxtentacion")) && (message.content.includes("death") || message.content.includes("died"))) { - if (fs.readFileSync("./exclude/approvedmessages.ratz").includes(message.content.toString())) { - // Do nothing + // -----TOPIC DETECTION AND REVIEW----- + if ((message.content.includes("XXXTentacion") || message.content.includes("xxxtentacion")) && (message.content.includes("death") || message.content.includes("died"))) { + if (fs.readFileSync("./exclude/approvedmessages.ratz").includes(message.content.toString())) { + // Do nothing + } + else { + fs.appendFileSync("./exclude/bannedmessages.ratz", "\r\n(" + message.author.username + " [" + message.author.id + "], " + message.createdTimestamp + ") " + message.content.toString()); + message["delete"](); + removeMessage(message.content.toString(), message.author.id); + message.channel.send(message.author + ", your message was deleted because it possibly relates to a blocked topic. To appeal the deletion of your message, contact an administrator."); + } } - else { + if (message.content.includes("NIGGER") || message.content.includes("nigger") || message.content.includes("NIGGA") || message.content.includes("nigga")) { fs.appendFileSync("./exclude/bannedmessages.ratz", "\r\n(" + message.author.username + " [" + message.author.id + "], " + message.createdTimestamp + ") " + message.content.toString()); message["delete"](); + removeMessage(message.content.toString(), message.author.id); message.channel.send(message.author + ", your message was deleted because it possibly relates to a blocked topic. To appeal the deletion of your message, contact an administrator."); } - } - if (message.content.includes("NIGGER") || message.content.includes("nigger") || message.content.includes("NIGGA") || message.content.includes("nigga")) { - fs.appendFileSync("./exclude/bannedmessages.ratz", "\r\n(" + message.author.username + " [" + message.author.id + "], " + message.createdTimestamp + ") " + message.content.toString()); - message["delete"](); - message.channel.send(message.author + ", your message was deleted because it possibly relates to a blocked topic. To appeal the deletion of your message, contact an administrator."); + // -------------------------------- + if (message.content.startsWith("/ratz testdetermine")) { + message.channel.send(teachAI()); + } } } } } catch (err) { - appendError(TYPE.BACKEND, ERROR.RATZx0000009, "SYSTEM"); + appendError(TYPE.BACKEND, ERROR.RATZx0000009, "SYSTEM", err); } }); bot.on("guildMemberAdd", function (member) { @@ -437,7 +507,7 @@ bot.on("guildMemberRemove", function (member) { bot.channels.get(newcomerChannel).send("**| GOODBYE |** " + member + " has left the server!"); }); bot.on("error", function (error) { - fs.appendFileSync("./exclude/errors.ratz", "\r\nERROR at " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds() + " " + date.getMonth() + "/" + date.getDate() + "/" + date.getFullYear() + ": " + error.name + " | " + error.message + "\n"); + appendError(TYPE.BACKEND, ERROR.RATZx0000009, "SYSTEM", error); }); bot.on("disconnect", function (userconnection) { try { @@ -447,6 +517,9 @@ bot.on("disconnect", function (userconnection) { console.log("**RECON. ERROR**: " + err); } }); +bot.on("ready", function (ready) { + //setInterval(rollAdvert, 7200000); +}); // -----READLINE----- var rl = readline.createInterface({ input: process.stdin, @@ -517,8 +590,81 @@ var TYPE; function sendError(TYPE, ERROR) { this.type = TYPE; this.error = ERROR; - return "An error occured during the process: **| " + TYPE + " | " + ERROR + " |**"; + return "An error occured during the process: **| TYPE: " + TYPE + " | CODE: " + ERROR + " |**"; } -function appendError(TYPE, ERROR, USER) { - fs.appendFileSync("./exclude/errors.ratz", "ERROR CODE: " + ERROR + "\r\nERROR TYPE: " + TYPE + "\r\nUSER: " + USER + "\r\nRECEIVED: " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds() + " " + (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear() + "\r\n\r\n"); +function appendError(TYPE, ERROR, USER, ERRORDES) { + fs.appendFileSync("./exclude/errors.ratz", "ERROR CODE: " + ERROR + "\r\nERROR TYPE: " + TYPE + "\r\nUSER: " + USER + "\r\nRECEIVED: " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds() + " " + (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear() + "\r\nERROR DESCRIPTION: " + ERRORDES + "\r\n\r\n"); +} +function removeMessage(content, authorid) { + if (!messagedata.users[0][authorid]) { + messagedata.users[0][authorid] = []; + } + var data = messagedata.users[0][authorid]; + data.push(content); + var txt = JSON.stringify(messagedata); + fs.writeFileSync("./exclude/removedauthmessages.json", txt); +} +//-----ADVERT FUNCTIONS----- +function rollAdvert() { + // Uses the part of a GitHub repo URL to run into the API + var integer; + var random = Math.floor(Math.random() * 2); + var result = advertdata.adverts[random]; + var getAdvertInfo = { + method: "GET", + url: "https://api.github.com/repos/" + result, + headers: { + "User-Agent": "Gisgar3" + } + }; + request(getAdvertInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed = new Discord.RichEmbed() + .setTitle("ADVERTISEMENT") + .setDescription("**" + stats.name + "**") + .setURL(stats.html_url) + .setThumbnail(bot.user.avatarURL) + .setColor(0xcb00ff) + .addField("Owner", "" + stats.owner.login) + .addField("Program Name", "" + stats.name) + .addField("Program Description", "" + stats.description) + .addField("License", "" + stats.license.name); + bot.channels.get(selfPromoChannel).send(embed); + } + else { + appendError(TYPE.BACKEND, ERROR.RATZx0000006, "SYSTEM", error); + } + } + catch (err) { + appendError(TYPE.BACKEND, ERROR.RATZx0000006, "SYSTEM", error); + } + }); +} +// ---------- +function teachAI() { + return __awaiter(this, void 0, void 0, function () { + var model, xs, ys, result; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + model = tf.sequential(); + model.add(tf.layers.dense({ units: 1, inputShape: [1] })); + model.compile({ + loss: 'meanSquaredError', + optimizer: 'sgd' + }); + xs = tf.tensor2d([-1, 0, 1, 2, 3, 4], [6, 1]); + ys = tf.tensor2d([0.10, 1.20, 2.30, 3.40, 4.50, 5.60], [6, 1]); + // Train the model + return [4 /*yield*/, model.fit(xs, ys, { epochs: 500 })]; + case 1: + // Train the model + _b.sent(); + result = model.predict(tf.tensor2d([7], [1, 1])).print(); + return [2 /*return*/]; + } + }); + }); } diff --git a/main.ts b/main.ts index 69f53da..862cb19 100644 --- a/main.ts +++ b/main.ts @@ -1,531 +1,627 @@ // COPYRIGHT (C) GAVIN ISGAR 2017-2018 -const Discord = require("discord.js"); -const DiscordRPC = require("discord-rpc"); -const opus = require("opusscript"); -const ffmpeg = require("ffmpeg-binaries"); -const ytdl = require("ytdl-core"); -const bot = new Discord.Client(); -const msg = new Discord.Message(); +var Discord = require("discord.js"); +var DiscordRPC = require("discord-rpc"); +const tf = require('@tensorflow/tfjs'); +var opus = require("opusscript"); +var ffmpeg = require("ffmpeg-binaries"); +var ytdl = require("ytdl-core"); +var bot = new Discord.Client(); +var msg = new Discord.Message(); var net = require('net'); var http = require("http"); var url = require("url"); var path = require("path"); var request = require("request"); var commands = require("./commands.json"); -var tokens = require("./exclude/tokens.json"); +//var tokens = require("./exclude/tokens.json"); +var tokens = require("C:/Users/Gavin/Desktop/tokens.json"); var fs = require("fs"); -const readline = require("readline"); -const package = require("./package.json"); -const { app, BrowserWindow } = require('electron'); +var readline = require("readline"); +var packagefile = require("./package.json"); +var _a = require('electron'), app = _a.app, BrowserWindow = _a.BrowserWindow; var date = new Date(); - +var messagedata = require("./exclude/removedauthmessages.json"); +var advertdata = require("./exclude/adverts.json"); //-----SERVER EVENTS----- var activeevent = ""; // --------- - // -----CHANNELS----- var logChannel = "423939166401855518"; var newcomerChannel = "423937750937501697"; var mainChannel = "443227379712917505"; +var liveChannel = "423938014801166346"; +var selfPromoChannel = "438003121755783199"; // ---------- - -bot.on('message', (message) => { +bot.on('message', function (message) { try { - if (fs.readFileSync("./exclude/bannedusers.ratz").includes(message.author.id.toString()) == true) { - message.channel.send(`${message.author}, you are banned from communicating in the server.`); - message.delete(); - } - else { - if (fs.readFileSync("./exclude/users.ratz").includes(message.author.id.toString()) == false) { - if (message.author.username == "GitHub" && message.author.bot == 1) { - // Do nothing - } - else { - if (message.content.toString() == "/ratz slimedog") { - fs.appendFileSync("./exclude/users.ratz", `\r\n${message.author.id.toString()}`); - message.delete(); - message.channel.send(`${message.author}, you now have access to type in the server!`); + if (message.channel.type == "dm") { + if (message.author.id == "434154972834299904") { + // Do nothing + } + else { + if (message.content.toString() == "/ratz getremovedmessages") { + if (!messagedata.users[0][message.author.id]) { + message.channel.send("No message data exists for your UserID."); + console.log(`Private data requested and failed from ${message.author.username}`); } else { - fs.appendFileSync("./exclude/removedauthmessages.ratz", `\r\n(${message.author.username} [${message.author.id}], ${message.createdTimestamp}) ${message.content.toString()}`); - message.delete(); - message.channel.send(`${message.author}, you have not completely read the rules in order to have access to chat. To get access, re-read the rules and type the secret response message specified.`) + message.channel.send(messagedata.users[0][message.author.id]); + console.log(`Private data requested and given to ${message.author.username}`); } } } + } + else { + if (fs.readFileSync("./exclude/bannedusers.ratz").includes(message.author.id.toString()) == true) { + message.channel.send(message.author + ", you are banned from communicating in the server."); + message["delete"](); + } else { - // ---COMMANDS--- - if (message.content.toString().startsWith("/ratz discorduserinfo ")) { - var result = message.content.slice(22); - try { - var user = bot.users.find("id", result); - var embed = new Discord.RichEmbed() - .setTitle(`Discord User Information for ${user.username}`) - .setColor(0xcb00ff) - .setThumbnail(user.avatarURL) - .addField(`Username`, user.username) - .addField(`ID`, user.id) - .addField(`Tag`, user.tag) - .addField(`Account Created`, user.createdTimestamp) - .addField(`Last Message ID`, user.lastMessageID) - message.channel.send(embed); - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000008)); - appendError(TYPE.BACKEND, ERROR.RATZx0000008, message.author.id); + if (fs.readFileSync("./exclude/users.ratz").includes(message.author.id.toString()) == false) { + if (message.author.username == "GitHub" && message.author.bot == 1) { + // Do nothing } - } - if (message.content.toString() == "/ratz slimedog") { - message.channel.send(`${message.author}, you are already authorized to type in the server!`); - } - if (message.content.toString() == "/ratz showcommands") { - var i; - const embed = new Discord.RichEmbed() - .setTitle(`Commands for ratzBot`) - .setColor(0xcb00ff) - .setThumbnail(bot.user.avatarURL.toString()) - for (i = 0; commands.names[i]; i++) { - for (i = 0; commands.definitions[i]; i++) { - embed.addField(commands.names[i], commands.definitions[i]); + else { + if (message.content.toString() == "/ratz slimedog") { + fs.appendFileSync("./exclude/users.ratz", "\r\n" + message.author.id.toString()); + message["delete"](); + message.channel.send(message.author + ", you now have access to type in the server!"); + } + else { + removeMessage(message.content.toString(), message.author.id); + message["delete"](); + message.channel.send(message.author + ", hello and welcome to the server! You have to read the rules and enter the specified password to access the server (for the sake of spammers \u2661)."); + // Old method + //fs.appendFileSync("./exclude/removedauthmessages.ratz", "\r\n(" + message.author.username + " [" + message.author.id + "], " + message.createdTimestamp + ") " + message.content.toString()); + //message["delete"](); + //message.channel.send(message.author + ", hello and welcome to the server! You have to read the rules and enter the specified password to access the server (for the sake of spammers \u2661)."); } } - message.channel.send({ embed }); } - if (message.content.toString() == "/ratz botinfo") { - var embed = new Discord.RichEmbed() - .setTitle("ratzBot Information") - .setThumbnail(bot.user.avatarURL.toString()) - .setColor(0xcb00ff) - .addField("Developer", "Gavin Isgar (https://www.github.com/gisgar3/)") - .addField("Version Number", package.version) - .addField("Source Languages", "JavaScript\nTypeScript") - .addField("GitHub Repository", "https://www.github.com/gisgar3/ratzbot/") - message.channel.send(embed); - } - if (message.content.startsWith("/ratz steamuserinfo ")) { - var result = message.content.slice(20); - var getSteamProfile = { - method: "GET", - url: `https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=${tokens.steamtoken}&steamids=${result}`, - } - request(getSteamProfile, (error, response, body) => { + else { + // ---COMMANDS--- + if (message.content.toString().startsWith("/ratz discorduserinfo ")) { + var result = message.content.slice(22); try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - const embed = new Discord.RichEmbed() - .setTitle(`Steam User Information for ${stats.response.players[0].steamid}`) - .setURL(stats.response.players[0].profileurl) - .setColor(0xcb00ff) - .setThumbnail(stats.response.players[0].avatarfull) - .addField("Username", stats.response.players[0].personaname) - .addField("Profile State", stats.response.players[0].profilestate) - .addField("Primary Clan", stats.response.players[0].primaryclanid) - .addField("Last Logoff", stats.response.players[0].lastlogoff) - .addField("Account Created", stats.response.players[0].timecreated); - message.channel.send({ embed }); - } - else { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000007)); - appendError(TYPE.BACKEND, ERROR.RATZx0000007, message.author.id); - } + var user = bot.users.find("id", result); + var embed = new Discord.RichEmbed() + .setTitle("Discord User Information for " + user.username) + .setColor(0xcb00ff) + .setThumbnail(user.avatarURL) + .addField("Username", user.username) + .addField("ID", user.id) + .addField("Tag", user.tag) + .addField("Account Created", user.createdTimestamp) + .addField("Last Message ID", user.lastMessageID); + message.channel.send(embed); } catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000007)); - appendError(TYPE.BACKEND, ERROR.RATZx0000007, message.author.id); + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000008)); + appendError(TYPE.BACKEND, ERROR.RATZx0000008, message.author.id, err); } - }) - } - if (message.content.toString() == "/ratz releaseinfo") { - var getReleaseInfo = { - method: "GET", - url: `https://api.github.com/repos/Gisgar3/ratzBot/releases`, - headers: { - "User-Agent": "Gisgar3" + } + if (message.content.toString() == "/ratz slimedog") { + message.channel.send(message.author + ", you are already authorized to type in the server!"); + } + if (message.content.toString() == "/ratz showcommands") { + var i; + var embed_1 = new Discord.RichEmbed() + .setTitle("Commands for ratzBot") + .setColor(0xcb00ff) + .setThumbnail(bot.user.avatarURL.toString()); + for (i = 0; commands.names[i]; i++) { + for (i = 0; commands.definitions[i]; i++) { + embed_1.addField(commands.names[i], commands.definitions[i]); + } } + message.channel.send({ embed: embed_1 }); } - request(getReleaseInfo, (error, response, body) => { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - var embed = new Discord.RichEmbed() - .setTitle("ratzBot GitHub Release Information") - .setThumbnail(bot.user.avatarURL) - .setColor(0xcb00ff) - .setURL(stats[0].html_url) - .addField(`Latest Release`, "" + stats[0].name) - .addField(`Release Branch`, "" + stats[0].target_commitish) - .addField(`Tag`, stats[0].tag_name) - .addField(`Changelog`, stats[0].body) - .addField(`Pre-Release Status`, "" + stats[0].prerelease) - .addField(`Author`, stats[0].author.login) - if (`${stats[0].prerelease}` == "true" && `${stats[0].tag_name}`.endsWith("-RC")) { - embed.setFooter("BUILD STAGE: Release Candidate"); + if (message.content.toString() == "/ratz botinfo") { + var embed = new Discord.RichEmbed() + .setTitle("ratzBot Information") + .setThumbnail(bot.user.avatarURL.toString()) + .setColor(0xcb00ff) + .addField("Developer", "Gavin Isgar (https://www.github.com/gisgar3/)") + .addField("Version Number", packagefile.version) + .addField("Source Languages", "JavaScript\nTypeScript") + .addField("GitHub Repository", "https://www.github.com/gisgar3/ratzbot/"); + message.channel.send(embed); + } + if (message.content.startsWith("/ratz steamuserinfo ")) { + var result = message.content.slice(20); + var getSteamProfile = { + method: "GET", + url: "https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=" + tokens.steamtoken + "&steamids=" + result + }; + request(getSteamProfile, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_2 = new Discord.RichEmbed() + .setTitle("Steam User Information for " + stats.response.players[0].steamid) + .setURL(stats.response.players[0].profileurl) + .setColor(0xcb00ff) + .setThumbnail(stats.response.players[0].avatarfull) + .addField("Username", stats.response.players[0].personaname) + .addField("Profile State", stats.response.players[0].profilestate) + .addField("Primary Clan", stats.response.players[0].primaryclanid) + .addField("Last Logoff", stats.response.players[0].lastlogoff) + .addField("Account Created", stats.response.players[0].timecreated); + message.channel.send({ embed: embed_2 }); } - else if (`${stats[0].prerelease}` == "true" && `${stats[0].tag_name}`.endsWith("-Beta")) { - embed.setFooter("BUILD STAGE: Beta"); + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000007)); + appendError(TYPE.BACKEND, ERROR.RATZx0000007, message.author.id, error); } - else if (`${stats[0].prerelease}` == "true" && `${stats[0].tag_name}`.endsWith("-Alpha")) { - embed.setFooter("BUILD STAGE: Alpha"); + } + catch (err) { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000007)); + appendError(TYPE.BACKEND, ERROR.RATZx0000007, message.author.id, err); + } + }); + } + if (message.content.toString() == "/ratz releaseinfo") { + var getReleaseInfo = { + method: "GET", + url: "https://api.github.com/repos/Gisgar3/ratzBot/releases", + headers: { + "User-Agent": "Gisgar3" + } + }; + request(getReleaseInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed = new Discord.RichEmbed() + .setTitle("ratzBot GitHub Release Information") + .setThumbnail(bot.user.avatarURL) + .setColor(0xcb00ff) + .setURL(stats[0].html_url) + .addField("Latest Release", "" + stats[0].name) + .addField("Release Branch", "" + stats[0].target_commitish) + .addField("Tag", stats[0].tag_name) + .addField("Changelog", stats[0].body) + .addField("Pre-Release Status", "" + stats[0].prerelease) + .addField("Author", stats[0].author.login); + if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-RC")) { + embed.setFooter("BUILD STAGE: Release Candidate"); + } + else if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-Beta")) { + embed.setFooter("BUILD STAGE: Beta"); + } + else if ("" + stats[0].prerelease == "true" && ("" + stats[0].tag_name).endsWith("-Alpha")) { + embed.setFooter("BUILD STAGE: Alpha"); + } + else if ("" + stats[0].prerelease == "false") { + embed.setFooter("BUILD STAGE: General Availability"); + } + message.channel.send(embed); } - else if (`${stats[0].prerelease}` == "false") { - embed.setFooter("BUILD STAGE: General Availability"); + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, error); } - message.channel.send(embed); } - else { + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, err); } - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); - } - }) - } - if (message.content.startsWith("/ratz gituserinfo ")) { - var result = message.content.slice(18); - var getGitUserInfo = { - method: "GET", - url: `https://api.github.com/users/${result}`, - headers: { - "User-Agent": "Gisgar3" - } + }); } - request(getGitUserInfo, (error, response, body) => { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - const embed = new Discord.RichEmbed() - .setTitle(`GitHub User Information for ${result}`) - .setURL(stats.html_url) - .setColor(0xcb00ff) - .setThumbnail(stats.avatar_url) - .addField("Name", stats.name) - .addField("Company", "" + stats.company) - .addField("Bio", "" + stats.bio) - .addField("Location", "" + stats.location) - .addField("Email", "" + stats.email) - .addField("Hireable", "" + stats.hireable) - .addField("Public Repositories", stats.public_repos) - message.channel.send(embed); + if (message.content.startsWith("/ratz gituserinfo ")) { + var result = message.content.slice(18); + var getGitUserInfo = { + method: "GET", + url: "https://api.github.com/users/" + result, + headers: { + "User-Agent": "Gisgar3" + } + }; + request(getGitUserInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_3 = new Discord.RichEmbed() + .setTitle("GitHub User Information for " + result) + .setURL(stats.html_url) + .setColor(0xcb00ff) + .setThumbnail(stats.avatar_url) + .addField("Name", stats.name) + .addField("Company", "" + stats.company) + .addField("Bio", "" + stats.bio) + .addField("Location", "" + stats.location) + .addField("Email", "" + stats.email) + .addField("Hireable", "" + stats.hireable) + .addField("Public Repositories", stats.public_repos); + message.channel.send(embed_3); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, error); + } } - else { + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, err); } - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); - } - }) - } - if (message.content.startsWith("/ratz gitrepoinfo ")) { - var result = message.content.slice(18); - var getGitRepoInfo = { - method: "GET", - url: `https://api.github.com/repos/${result}`, - headers: { - 'User-Agent': 'Gisgar3' - } + }); } - request(getGitRepoInfo, (error, response, body) => { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - const embed = new Discord.RichEmbed() - .setTitle(`GitHub Repository for ${result}`) - .setURL(stats.html_url) - .setColor(0xcb00ff) - .setThumbnail(stats.owner.avatar_url) - .addField("Name", stats.name) - .addField("Description", stats.description) - .addField("Owner", stats.owner.login) - .addField("Language", stats.language) - .addField("Archive Status", stats.archived) - message.channel.send(embed); + if (message.content.startsWith("/ratz gitrepoinfo ")) { + var result = message.content.slice(18); + var getGitRepoInfo = { + method: "GET", + url: "https://api.github.com/repos/" + result, + headers: { + 'User-Agent': 'Gisgar3' } - else { + }; + request(getGitRepoInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_4 = new Discord.RichEmbed() + .setTitle("GitHub Repository for " + result) + .setURL(stats.html_url) + .setColor(0xcb00ff) + .setThumbnail(stats.owner.avatar_url) + .addField("Name", stats.name) + .addField("Description", stats.description) + .addField("Owner", stats.owner.login) + .addField("Language", stats.language) + .addField("Archive Status", stats.archived); + message.channel.send(embed_4); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, error); + } + } + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id, err); } - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000006)); - appendError(TYPE.BACKEND, ERROR.RATZx0000006, message.author.id); - } - }) - } - if (message.content.toString() == "/ratz btcinfo") { - var getBTCInfo = { - method: "GET", - url: "https://api.blockchain.info/stats" + }); } - request(getBTCInfo, (error, response, body) => { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - const embed = new Discord.RichEmbed() - .setTitle("BTC Information") - .setColor(0xcb00ff) - .setThumbnail(bot.user.avatarURL) - .addField("Market Price (USD)", `$${stats.market_price_usd}`) - .addField("BTC Mined", stats.n_btc_mined) - .addField("Blocks Mined", stats.n_blocks_mined) - .addField("Total Blocks", stats.n_blocks_total) - .addField("Total BTC Sent", stats.total_btc_sent) - message.channel.send(embed); + if (message.content.toString() == "/ratz btcinfo") { + var getBTCInfo = { + method: "GET", + url: "https://api.blockchain.info/stats" + }; + request(getBTCInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_5 = new Discord.RichEmbed() + .setTitle("BTC Information") + .setColor(0xcb00ff) + .setThumbnail(bot.user.avatarURL) + .addField("Market Price (USD)", "$" + stats.market_price_usd) + .addField("BTC Mined", stats.n_btc_mined) + .addField("Blocks Mined", stats.n_blocks_mined) + .addField("Total Blocks", stats.n_blocks_total) + .addField("Total BTC Sent", stats.total_btc_sent); + message.channel.send(embed_5); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000005)); + appendError(TYPE.BACKEND, ERROR.RATZx0000005, message.author.id, error); + } } - else { + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000005)); - appendError(TYPE.BACKEND, ERROR.RATZx0000005, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000005, message.author.id, err); } + }); + } + // -----SERVER EVENTS----- + if (message.content.toString() == "/ratz joinactiveevent") { + if (activeevent == "") { + message.channel.send(message.author + ", there is no active event on the server."); } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000005)); - appendError(TYPE.BACKEND, ERROR.RATZx0000005, message.author.id); + else { + try { + fs.appendFileSync("./exclude/eventuserlist.ratz", "\r\n" + message.author.id); + message.channel.send(message.author + ", you are now joined into the " + activeevent + "!"); + } + catch (err) { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000004)); + appendError(TYPE.BACKEND, ERROR.RATZx0000004, message.author.id, err); + } } - }) - } - // -----SERVER EVENTS----- - if (message.content.toString() == "/ratz joinactiveevent") { - if (activeevent == "") { - message.channel.send(`${message.author}, there is no active event on the server.`); } - else { - try { - fs.appendFileSync("./exclude/eventuserlist.ratz", `\r\n${message.author.id}`); - message.channel.send(`${message.author}, you are now joined into the ${activeevent}!`); + if (message.content.toString() == "/ratz showactiveevent") { + if (activeevent == "") { + message.channel.send(message.author + ", there is no active event on the server."); } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000004)); - appendError(TYPE.BACKEND, ERROR.RATZx0000004, message.author.id); + else { + message.channel.send(message.author + ", the active event on the server is the " + activeevent + "."); } } - } - if (message.content.toString() == "/ratz showactiveevent") { - if (activeevent == "") { - message.channel.send(`${message.author}, there is no active event on the server.`); - } - else { - message.channel.send(`${message.author}, the active event on the server is the ${activeevent}.`); - } - } - // -----STREAMLABS INTEGRATION----- - if (message.content.startsWith("/ratz ratcoininfo ")) { - var result = message.content.slice(18); - var getRTCInfo = { - method: "GET", - url: `https://streamlabs.com/api/v1.0/points?access_token=${tokens.streamlabstoken}&username=${result}&channel=ratzdoll` - } - request(getRTCInfo, (error, response, body) => { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - message.channel.send(`${message.author}, ${result} has ${stats.points} RTC!`); + // -----STREAMLABS INTEGRATION----- + if (message.content.startsWith("/ratz ratcoininfo ")) { + var result = message.content.slice(18); + var getRTCInfo = { + method: "GET", + url: "https://streamlabs.com/api/v1.0/points?access_token=" + tokens.streamlabstoken + "&username=" + result + "&channel=ratzdoll" + }; + request(getRTCInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + message.channel.send(message.author + ", " + result + " has " + stats.points + " RTC!"); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000003)); + appendError(TYPE.BACKEND, ERROR.RATZx0000003, message.author.id, error); + } } - else { + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000003)); - appendError(TYPE.BACKEND, ERROR.RATZx0000003, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000003, message.author.id, err); } - } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000003)); - appendError(TYPE.BACKEND, ERROR.RATZx0000003, message.author.id); - } - }) - } - // -----TWITCH NEW API----- - if (message.content.toString() == "/ratz laststream") { - var getStreamVOD = { - method: 'GET', - url: `https://api.twitch.tv/helix/videos?user_id=157901049&first=1`, - headers: { - "Client-ID": `${tokens.twitchapiclientid}` - } + }); } - request(getStreamVOD, (error, response, body) => { - try { - if (!error && response.statusCode == 200) { - var stats = JSON.parse(body); - const embed = new Discord.RichEmbed() - .setTitle("Last Stream VOD from ratzDoll") - .setThumbnail(bot.user.avatarURL) - .setColor(0xcb00ff) - .setURL(stats.data[0].url) - .addField("Title", "" + stats.data[0].title) - .addField("Published At", "" + stats.data[0].published_at) - .addField("Duration", "" + stats.data[0].duration) - .addField("View Count", stats.data[0].view_count) - message.channel.send(embed); + // -----TWITCH NEW API----- + if (message.content.toString() == "/ratz laststream") { + var getStreamVOD = { + method: 'GET', + url: "https://api.twitch.tv/helix/videos?user_id=157901049&first=1", + headers: { + "Client-ID": "" + tokens.twitchapiclientid } - else { + }; + request(getStreamVOD, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed_6 = new Discord.RichEmbed() + .setTitle("Last Stream VOD from ratzDoll") + .setThumbnail(bot.user.avatarURL) + .setColor(0xcb00ff) + .setURL(stats.data[0].url) + .addField("Title", "" + stats.data[0].title) + .addField("Published At", "" + stats.data[0].published_at) + .addField("Duration", "" + stats.data[0].duration) + .addField("View Count", stats.data[0].view_count); + message.channel.send(embed_6); + } + else { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000002)); + appendError(TYPE.BACKEND, ERROR.RATZx0000002, message.author.id, error); + } + } + catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000002)); - appendError(TYPE.BACKEND, ERROR.RATZx0000002, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000002, message.author.id, err); } + }); + } + // -----VOICE CHANNELS----- + if (message.content.startsWith("/ratz play ")) { + var result = message.content.slice(11); + if (message.member.voiceChannel) { + message.member.voiceChannel.join().then(function (connection) { + try { + var stream = ytdl(result, { filter: "audioonly" }); + var dispatcher = connection.playStream(stream); + message.channel.send(message.author + ", your music is now playing."); + dispatcher.on("end", function (end) { + message.channel.send(message.author + ", your music has ended."); + message.member.voiceChannel.leave(); + }); + } + catch (err) { + message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000001)); + appendError(TYPE.BACKEND, ERROR.RATZx0000001, message.author.id, err); + } + }); } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000002)); - appendError(TYPE.BACKEND, ERROR.RATZx0000002, message.author.id); + else { + message.channel.send(message.author + ", you are not in a voice channel. Join a voice channel to play music!"); } - }) - } - // -----VOICE CHANNELS----- - if (message.content.startsWith("/ratz play ")) { - var result = message.content.slice(11); - if (message.member.voiceChannel) { - message.member.voiceChannel.join().then(connection => { + } + if (message.content.toString() == "/ratz stop") { + if (message.member.voiceChannel) { try { - const stream = ytdl(result, { filter: `audioonly` }); - const dispatcher = connection.playStream(stream); - message.channel.send(`${message.author}, your music is now playing.`); - dispatcher.on("end", end => { - message.channel.send(`${message.author}, your music has ended.`); - message.member.voiceChannel.leave(); - }) + message.member.voiceChannel.connection.disconnect(); + message.member.voiceChannel.leave(); } catch (err) { message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000001)); - appendError(TYPE.BACKEND, ERROR.RATZx0000001, message.author.id); + appendError(TYPE.BACKEND, ERROR.RATZx0000001, message.author.id, err); } - }) - } - else { - message.channel.send(`${message.author}, you are not in a voice channel. Join a voice channel to play music!`); - } - } - if (message.content.toString() == "/ratz stop") { - if (message.member.voiceChannel) { - try { - message.member.voiceChannel.connection.disconnect() - message.member.voiceChannel.leave(); } - catch (err) { - message.channel.send(sendError(TYPE.BACKEND, ERROR.RATZx0000001)); - appendError(TYPE.BACKEND, ERROR.RATZx0000001, message.author.id); + else { + message.channel.send(message.author + ", you are not in a voice channel."); } } - else { - message.channel.send(`${message.author}, you are not in a voice channel.`); + // -----TOPIC DETECTION AND REVIEW----- + if ((message.content.includes("XXXTentacion") || message.content.includes("xxxtentacion")) && (message.content.includes("death") || message.content.includes("died"))) { + if (fs.readFileSync("./exclude/approvedmessages.ratz").includes(message.content.toString())) { + // Do nothing + } + else { + fs.appendFileSync("./exclude/bannedmessages.ratz", "\r\n(" + message.author.username + " [" + message.author.id + "], " + message.createdTimestamp + ") " + message.content.toString()); + message["delete"](); + removeMessage(message.content.toString(), message.author.id); + message.channel.send(message.author + ", your message was deleted because it possibly relates to a blocked topic. To appeal the deletion of your message, contact an administrator."); + } } - } - // -----TOPIC DETECTION AND REVIEW----- - if ((message.content.includes("XXXTentacion") || message.content.includes("xxxtentacion")) && (message.content.includes("death") || message.content.includes("died"))) { - if (fs.readFileSync("./exclude/approvedmessages.ratz").includes(message.content.toString())) { - // Do nothing + if (message.content.includes("NIGGER") || message.content.includes("nigger") || message.content.includes("NIGGA") || message.content.includes("nigga")) { + fs.appendFileSync("./exclude/bannedmessages.ratz", "\r\n(" + message.author.username + " [" + message.author.id + "], " + message.createdTimestamp + ") " + message.content.toString()); + message["delete"](); + removeMessage(message.content.toString(), message.author.id); + message.channel.send(message.author + ", your message was deleted because it possibly relates to a blocked topic. To appeal the deletion of your message, contact an administrator."); } - else { - fs.appendFileSync("./exclude/bannedmessages.ratz", `\r\n(${message.author.username} [${message.author.id}], ${message.createdTimestamp}) ${message.content.toString()}`); - message.delete(); - message.channel.send(`${message.author}, your message was deleted because it possibly relates to a blocked topic. To appeal the deletion of your message, contact an administrator.`); + // -------------------------------- + if (message.content.startsWith("/ratz testdetermine")) { + message.channel.send(teachAI()); } } - if (message.content.includes("NIGGER") || message.content.includes("nigger") || message.content.includes("NIGGA") || message.content.includes("nigga")) { - fs.appendFileSync("./exclude/bannedmessages.ratz", `\r\n(${message.author.username} [${message.author.id}], ${message.createdTimestamp}) ${message.content.toString()}`); - message.delete(); - message.channel.send(`${message.author}, your message was deleted because it possibly relates to a blocked topic. To appeal the deletion of your message, contact an administrator.`); - } } } } catch (err) { - appendError(TYPE.BACKEND, ERROR.RATZx0000009, "SYSTEM"); + appendError(TYPE.BACKEND, ERROR.RATZx0000009, "SYSTEM", err); } -}) - -bot.on("guildMemberAdd", (member) => { - bot.channels.get(newcomerChannel).send(`**| WELCOME |** ${member} has joined the server!`); -}) - -bot.on("guildMemberRemove", (member) => { - bot.channels.get(newcomerChannel).send(`**| GOODBYE |** ${member} has left the server!`); -}) - -bot.on("error", (error) => { - fs.appendFileSync("./exclude/errors.ratz", `\r\nERROR at ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()} ${date.getMonth()}/${date.getDate()}/${date.getFullYear()}: ${error.name} | ${error.message}\n`); -}) - -bot.on("disconnect", (userconnection) => { +}); +bot.on("guildMemberAdd", function (member) { + bot.channels.get(newcomerChannel).send("**| WELCOME |** " + member + " has joined the server!"); +}); +bot.on("guildMemberRemove", function (member) { + bot.channels.get(newcomerChannel).send("**| GOODBYE |** " + member + " has left the server!"); +}); +bot.on("error", function (error) { + appendError(TYPE.BACKEND, ERROR.RATZx0000009, "SYSTEM", error); +}); +bot.on("disconnect", function (userconnection) { try { bot.login(tokens.bottoken); } catch (err) { - console.log(`**RECON. ERROR**: ${err}`); + console.log("**RECON. ERROR**: " + err); } -}) - +}); +bot.on("ready", function (ready) { + //setInterval(rollAdvert, 7200000); +}); // -----READLINE----- -const rl = readline.createInterface({ +var rl = readline.createInterface({ input: process.stdin, output: process.stdout }); - -rl.on("line", (input) => { +rl.on("line", function (input) { if (input.toString().startsWith("/ratz userban ")) { var result = input.slice(14); try { bot.guilds.forEach(function (getGuilds) { if (getGuilds.name == "ratzcord") { getGuilds.members.forEach(function (getMembers) { - if (getMembers.id == `${result}`) { + if (getMembers.id == "" + result) { getMembers.ban("Banned by ratzBot system."); - console.log(`**BAN**: User ${result} was successfully banned.`); + console.log("**BAN**: User " + result + " was successfully banned."); } else { // Do nothing } - }) + }); } else { // Do nothing } - }) + }); } catch (err) { - console.log(`**ERROR**: ${err}`); + console.log("**ERROR**: " + err); } } if (input.toString().startsWith("/ratz writemain ")) { var result = input.slice(16); try { - bot.channels.get(mainChannel).send(`${result}`); + bot.channels.get(mainChannel).send("" + result); } catch (err) { - console.log(`**ERROR**: ${err}`); + console.log("**ERROR**: " + err); } } // -----SERVER EVENTS----- if (input.toString().startsWith("/ratz setevent ")) { var result = input.slice(15); activeevent = result; - console.log(`**EVENT**: Event has been set.`); + console.log("**EVENT**: Event has been set."); } -}) - +}); bot.login(tokens.bottoken); // -----ERROR REPORTING----- -enum ERROR { - RATZx0000001 = "RATZx0000001", - RATZx0000002 = "RATZx0000002", - RATZx0000003 = "RATZx0000003", - RATZx0000004 = "RATZx0000004", - RATZx0000005 = "RATZx0000005", - RATZx0000006 = "RATZx0000006", - RATZx0000007 = "RATZx0000007", - RATZx0000008 = "RATZx0000008", - RATZx0000009 = "RATZx0000009" -}; -enum TYPE { - FRONTEND = "FRONTEND", - BACKEND = "BACKEND" -}; -function sendError(TYPE: TYPE, ERROR: ERROR) { +var ERROR; +(function (ERROR) { + ERROR["RATZx0000001"] = "RATZx0000001"; + ERROR["RATZx0000002"] = "RATZx0000002"; + ERROR["RATZx0000003"] = "RATZx0000003"; + ERROR["RATZx0000004"] = "RATZx0000004"; + ERROR["RATZx0000005"] = "RATZx0000005"; + ERROR["RATZx0000006"] = "RATZx0000006"; + ERROR["RATZx0000007"] = "RATZx0000007"; + ERROR["RATZx0000008"] = "RATZx0000008"; + ERROR["RATZx0000009"] = "RATZx0000009"; +})(ERROR || (ERROR = {})); +; +var TYPE; +(function (TYPE) { + TYPE["FRONTEND"] = "FRONTEND"; + TYPE["BACKEND"] = "BACKEND"; +})(TYPE || (TYPE = {})); +; +function sendError(TYPE, ERROR) { this.type = TYPE; this.error = ERROR; - return `An error occured during the process: **| ${TYPE} | ${ERROR} |**` + return "An error occured during the process: **| TYPE: " + TYPE + " | CODE: " + ERROR + " |**"; +} +function appendError(TYPE, ERROR, USER, ERRORDES) { + fs.appendFileSync("./exclude/errors.ratz", "ERROR CODE: " + ERROR + "\r\nERROR TYPE: " + TYPE + "\r\nUSER: " + USER + "\r\nRECEIVED: " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds() + " " + (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear() + "\r\nERROR DESCRIPTION: " + ERRORDES + "\r\n\r\n"); +} +function removeMessage(content, authorid) { + if (!messagedata.users[0][authorid]) { + messagedata.users[0][authorid] = []; + } + var data = messagedata.users[0][authorid]; + data.push(content); + var txt = JSON.stringify(messagedata); + fs.writeFileSync("./exclude/removedauthmessages.json", txt); +} + +//-----ADVERT FUNCTIONS----- +function rollAdvert() { + // Uses the part of a GitHub repo URL to run into the API + var integer; + var random = Math.floor(Math.random() * 2); + var result = advertdata.adverts[random]; + var getAdvertInfo = { + method: "GET", + url: `https://api.github.com/repos/${result}`, + headers: { + "User-Agent": "Gisgar3" + } + } + request(getAdvertInfo, function (error, response, body) { + try { + if (!error && response.statusCode == 200) { + var stats = JSON.parse(body); + var embed = new Discord.RichEmbed() + .setTitle("ADVERTISEMENT") + .setDescription(`**${stats.name}**`) + .setURL(stats.html_url) + .setThumbnail(bot.user.avatarURL) + .setColor(0xcb00ff) + .addField("Owner", `` + stats.owner.login) + .addField("Program Name", `` + stats.name) + .addField("Program Description", `` + stats.description) + .addField("License", `` + stats.license.name) + bot.channels.get(selfPromoChannel).send(embed); + } + else { + appendError(TYPE.BACKEND, ERROR.RATZx0000006, "SYSTEM", error); + } + } + catch (err) { + appendError(TYPE.BACKEND, ERROR.RATZx0000006, "SYSTEM", error); + } + }) +} +// ---------- +async function teachAI() { + const model = tf.sequential(); + model.add(tf.layers.dense({units: 1, inputShape: [1]})); + model.compile({ + loss: 'meanSquaredError', + optimizer: 'sgd' + }); + // Shape the output + const xs = tf.tensor2d([-1, 0, 1, 2, 3, 4], [6,1]); + const ys = tf.tensor2d([0.10, 1.20, 2.30, 3.40, 4.50, 5.60], [6,1]); + // Train the model + await model.fit(xs, ys, {epochs: 500}); + // Predict the number + var result = model.predict(tf.tensor2d([7], [1,1])).print(); } -function appendError(TYPE: TYPE, ERROR: ERROR, USER: String) { - fs.appendFileSync("./exclude/errors.ratz", `ERROR CODE: ${ERROR}\r\nERROR TYPE: ${TYPE}\r\nUSER: ${USER}\r\nRECEIVED: ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()} ${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}\r\n\r\n`) -} \ No newline at end of file diff --git a/node_modules/.bin/cake b/node_modules/.bin/cake new file mode 100644 index 0000000..8051e8c --- /dev/null +++ b/node_modules/.bin/cake @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../coffeescript/bin/cake" "$@" + ret=$? +else + node "$basedir/../coffeescript/bin/cake" "$@" + ret=$? +fi +exit $ret diff --git a/node_modules/.bin/cake.cmd b/node_modules/.bin/cake.cmd new file mode 100644 index 0000000..9d857b6 --- /dev/null +++ b/node_modules/.bin/cake.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\coffeescript\bin\cake" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\coffeescript\bin\cake" %* +) \ No newline at end of file diff --git a/node_modules/.bin/coffee b/node_modules/.bin/coffee new file mode 100644 index 0000000..57082f8 --- /dev/null +++ b/node_modules/.bin/coffee @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../coffeescript/bin/coffee" "$@" + ret=$? +else + node "$basedir/../coffeescript/bin/coffee" "$@" + ret=$? +fi +exit $ret diff --git a/node_modules/.bin/coffee.cmd b/node_modules/.bin/coffee.cmd new file mode 100644 index 0000000..744913a --- /dev/null +++ b/node_modules/.bin/coffee.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\coffeescript\bin\coffee" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\coffeescript\bin\coffee" %* +) \ No newline at end of file diff --git a/node_modules/.bin/pbjs b/node_modules/.bin/pbjs new file mode 100644 index 0000000..a786ae9 --- /dev/null +++ b/node_modules/.bin/pbjs @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../protobufjs/bin/pbjs" "$@" + ret=$? +else + node "$basedir/../protobufjs/bin/pbjs" "$@" + ret=$? +fi +exit $ret diff --git a/node_modules/.bin/pbjs.cmd b/node_modules/.bin/pbjs.cmd new file mode 100644 index 0000000..6a94ef9 --- /dev/null +++ b/node_modules/.bin/pbjs.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\protobufjs\bin\pbjs" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\protobufjs\bin\pbjs" %* +) \ No newline at end of file diff --git a/node_modules/.bin/pbts b/node_modules/.bin/pbts new file mode 100644 index 0000000..8dd2c44 --- /dev/null +++ b/node_modules/.bin/pbts @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../protobufjs/bin/pbts" "$@" + ret=$? +else + node "$basedir/../protobufjs/bin/pbts" "$@" + ret=$? +fi +exit $ret diff --git a/node_modules/.bin/pbts.cmd b/node_modules/.bin/pbts.cmd new file mode 100644 index 0000000..d9381f9 --- /dev/null +++ b/node_modules/.bin/pbts.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\protobufjs\bin\pbts" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\protobufjs\bin\pbts" %* +) \ No newline at end of file diff --git a/node_modules/@protobufjs/aspromise/LICENSE b/node_modules/@protobufjs/aspromise/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/aspromise/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/aspromise/README.md b/node_modules/@protobufjs/aspromise/README.md new file mode 100644 index 0000000..c7ae36f --- /dev/null +++ b/node_modules/@protobufjs/aspromise/README.md @@ -0,0 +1,13 @@ +@protobufjs/aspromise +===================== +[![npm](https://img.shields.io/npm/v/@protobufjs/aspromise.svg)](https://www.npmjs.com/package/@protobufjs/aspromise) + +Returns a promise from a node-style callback function. + +API +--- + +* **asPromise(fn: `function`, ctx: `Object`, ...params: `*`): `Promise<*>`**
+ Returns a promise from a node-style callback function. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/aspromise/index.d.ts b/node_modules/@protobufjs/aspromise/index.d.ts new file mode 100644 index 0000000..3db03db --- /dev/null +++ b/node_modules/@protobufjs/aspromise/index.d.ts @@ -0,0 +1,13 @@ +export = asPromise; + +type asPromiseCallback = (error: Error | null, ...params: any[]) => {}; + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +declare function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise; diff --git a/node_modules/@protobufjs/aspromise/index.js b/node_modules/@protobufjs/aspromise/index.js new file mode 100644 index 0000000..d6f642c --- /dev/null +++ b/node_modules/@protobufjs/aspromise/index.js @@ -0,0 +1,52 @@ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} diff --git a/node_modules/@protobufjs/aspromise/package.json b/node_modules/@protobufjs/aspromise/package.json new file mode 100644 index 0000000..911c6ec --- /dev/null +++ b/node_modules/@protobufjs/aspromise/package.json @@ -0,0 +1,55 @@ +{ + "_from": "@protobufjs/aspromise@^1.1.2", + "_id": "@protobufjs/aspromise@1.1.2", + "_inBundle": false, + "_integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=", + "_location": "/@protobufjs/aspromise", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/aspromise@^1.1.2", + "name": "@protobufjs/aspromise", + "escapedName": "@protobufjs%2faspromise", + "scope": "@protobufjs", + "rawSpec": "^1.1.2", + "saveSpec": null, + "fetchSpec": "^1.1.2" + }, + "_requiredBy": [ + "/@protobufjs/fetch", + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "_shasum": "9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf", + "_spec": "@protobufjs/aspromise@^1.1.2", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns a promise from a node-style callback function.", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/aspromise", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "test": "tape tests/*.js" + }, + "types": "index.d.ts", + "version": "1.1.2" +} diff --git a/node_modules/@protobufjs/aspromise/tests/index.js b/node_modules/@protobufjs/aspromise/tests/index.js new file mode 100644 index 0000000..cfdb258 --- /dev/null +++ b/node_modules/@protobufjs/aspromise/tests/index.js @@ -0,0 +1,130 @@ +var tape = require("tape"); + +var asPromise = require(".."); + +tape.test("aspromise", function(test) { + + test.test(this.name + " - resolve", function(test) { + + function fn(arg1, arg2, callback) { + test.equal(this, ctx, "function should be called with this = ctx"); + test.equal(arg1, 1, "function should be called with arg1 = 1"); + test.equal(arg2, 2, "function should be called with arg2 = 2"); + callback(null, arg2); + } + + var ctx = {}; + + var promise = asPromise(fn, ctx, 1, 2); + promise.then(function(arg2) { + test.equal(arg2, 2, "promise should be resolved with arg2 = 2"); + test.end(); + }).catch(function(err) { + test.fail("promise should not be rejected (" + err + ")"); + }); + }); + + test.test(this.name + " - reject", function(test) { + + function fn(arg1, arg2, callback) { + test.equal(this, ctx, "function should be called with this = ctx"); + test.equal(arg1, 1, "function should be called with arg1 = 1"); + test.equal(arg2, 2, "function should be called with arg2 = 2"); + callback(arg1); + } + + var ctx = {}; + + var promise = asPromise(fn, ctx, 1, 2); + promise.then(function() { + test.fail("promise should not be resolved"); + }).catch(function(err) { + test.equal(err, 1, "promise should be rejected with err = 1"); + test.end(); + }); + }); + + test.test(this.name + " - resolve twice", function(test) { + + function fn(arg1, arg2, callback) { + test.equal(this, ctx, "function should be called with this = ctx"); + test.equal(arg1, 1, "function should be called with arg1 = 1"); + test.equal(arg2, 2, "function should be called with arg2 = 2"); + callback(null, arg2); + callback(null, arg1); + } + + var ctx = {}; + var count = 0; + + var promise = asPromise(fn, ctx, 1, 2); + promise.then(function(arg2) { + test.equal(arg2, 2, "promise should be resolved with arg2 = 2"); + if (++count > 1) + test.fail("promise should not be resolved twice"); + test.end(); + }).catch(function(err) { + test.fail("promise should not be rejected (" + err + ")"); + }); + }); + + test.test(this.name + " - reject twice", function(test) { + + function fn(arg1, arg2, callback) { + test.equal(this, ctx, "function should be called with this = ctx"); + test.equal(arg1, 1, "function should be called with arg1 = 1"); + test.equal(arg2, 2, "function should be called with arg2 = 2"); + callback(arg1); + callback(arg2); + } + + var ctx = {}; + var count = 0; + + var promise = asPromise(fn, ctx, 1, 2); + promise.then(function() { + test.fail("promise should not be resolved"); + }).catch(function(err) { + test.equal(err, 1, "promise should be rejected with err = 1"); + if (++count > 1) + test.fail("promise should not be rejected twice"); + test.end(); + }); + }); + + test.test(this.name + " - reject error", function(test) { + + function fn(callback) { + test.ok(arguments.length === 1 && typeof callback === "function", "function should be called with just a callback"); + throw 3; + } + + var promise = asPromise(fn, null); + promise.then(function() { + test.fail("promise should not be resolved"); + }).catch(function(err) { + test.equal(err, 3, "promise should be rejected with err = 3"); + test.end(); + }); + }); + + test.test(this.name + " - reject and error", function(test) { + + function fn(callback) { + callback(3); + throw 4; + } + + var count = 0; + + var promise = asPromise(fn, null); + promise.then(function() { + test.fail("promise should not be resolved"); + }).catch(function(err) { + test.equal(err, 3, "promise should be rejected with err = 3"); + if (++count > 1) + test.fail("promise should not be rejected twice"); + test.end(); + }); + }); +}); diff --git a/node_modules/@protobufjs/base64/LICENSE b/node_modules/@protobufjs/base64/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/base64/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/base64/README.md b/node_modules/@protobufjs/base64/README.md new file mode 100644 index 0000000..b06cb0a --- /dev/null +++ b/node_modules/@protobufjs/base64/README.md @@ -0,0 +1,19 @@ +@protobufjs/base64 +================== +[![npm](https://img.shields.io/npm/v/@protobufjs/base64.svg)](https://www.npmjs.com/package/@protobufjs/base64) + +A minimal base64 implementation for number arrays. + +API +--- + +* **base64.length(string: `string`): `number`**
+ Calculates the byte length of a base64 encoded string. + +* **base64.encode(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**
+ Encodes a buffer to a base64 encoded string. + +* **base64.decode(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**
+ Decodes a base64 encoded string to a buffer. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/base64/index.d.ts b/node_modules/@protobufjs/base64/index.d.ts new file mode 100644 index 0000000..085d0a7 --- /dev/null +++ b/node_modules/@protobufjs/base64/index.d.ts @@ -0,0 +1,32 @@ +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +export function length(string: string): number; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +export function encode(buffer: Uint8Array, start: number, end: number): string; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +export function decode(string: string, buffer: Uint8Array, offset: number): number; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if it appears to be base64 encoded, otherwise false + */ +export function test(string: string): boolean; diff --git a/node_modules/@protobufjs/base64/index.js b/node_modules/@protobufjs/base64/index.js new file mode 100644 index 0000000..6146f54 --- /dev/null +++ b/node_modules/@protobufjs/base64/index.js @@ -0,0 +1,139 @@ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; diff --git a/node_modules/@protobufjs/base64/package.json b/node_modules/@protobufjs/base64/package.json new file mode 100644 index 0000000..0024a13 --- /dev/null +++ b/node_modules/@protobufjs/base64/package.json @@ -0,0 +1,54 @@ +{ + "_from": "@protobufjs/base64@^1.1.2", + "_id": "@protobufjs/base64@1.1.2", + "_inBundle": false, + "_integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "_location": "/@protobufjs/base64", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/base64@^1.1.2", + "name": "@protobufjs/base64", + "escapedName": "@protobufjs%2fbase64", + "scope": "@protobufjs", + "rawSpec": "^1.1.2", + "saveSpec": null, + "fetchSpec": "^1.1.2" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "_shasum": "4c85730e59b9a1f1f349047dbf24296034bb2735", + "_spec": "@protobufjs/base64@^1.1.2", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A minimal base64 implementation for number arrays.", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/base64", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "test": "tape tests/*.js" + }, + "types": "index.d.ts", + "version": "1.1.2" +} diff --git a/node_modules/@protobufjs/base64/tests/index.js b/node_modules/@protobufjs/base64/tests/index.js new file mode 100644 index 0000000..6ede32c --- /dev/null +++ b/node_modules/@protobufjs/base64/tests/index.js @@ -0,0 +1,46 @@ +var tape = require("tape"); + +var base64 = require(".."); + +var strings = { + "": "", + "a": "YQ==", + "ab": "YWI=", + "abcdefg": "YWJjZGVmZw==", + "abcdefgh": "YWJjZGVmZ2g=", + "abcdefghi": "YWJjZGVmZ2hp" +}; + +tape.test("base64", function(test) { + + Object.keys(strings).forEach(function(str) { + var enc = strings[str]; + + test.equal(base64.test(enc), true, "should detect '" + enc + "' to be base64 encoded"); + + var len = base64.length(enc); + test.equal(len, str.length, "should calculate '" + enc + "' as " + str.length + " bytes"); + + var buf = new Array(len); + var len2 = base64.decode(enc, buf, 0); + test.equal(len2, len, "should decode '" + enc + "' to " + len + " bytes"); + + test.equal(String.fromCharCode.apply(String, buf), str, "should decode '" + enc + "' to '" + str + "'"); + + var enc2 = base64.encode(buf, 0, buf.length); + test.equal(enc2, enc, "should encode '" + str + "' to '" + enc + "'"); + + }); + + test.throws(function() { + var buf = new Array(10); + base64.decode("YQ!", buf, 0); + }, Error, "should throw if encoding is invalid"); + + test.throws(function() { + var buf = new Array(10); + base64.decode("Y", buf, 0); + }, Error, "should throw if string is truncated"); + + test.end(); +}); diff --git a/node_modules/@protobufjs/codegen/LICENSE b/node_modules/@protobufjs/codegen/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/codegen/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/codegen/README.md b/node_modules/@protobufjs/codegen/README.md new file mode 100644 index 0000000..577c43e --- /dev/null +++ b/node_modules/@protobufjs/codegen/README.md @@ -0,0 +1,49 @@ +@protobufjs/codegen +=================== +[![npm](https://img.shields.io/npm/v/@protobufjs/codegen.svg)](https://www.npmjs.com/package/@protobufjs/codegen) + +A minimalistic code generation utility. + +API +--- + +* **codegen([functionParams: `string[]`], [functionName: string]): `Codegen`**
+ Begins generating a function. + +* **codegen.verbose = `false`**
+ When set to true, codegen will log generated code to console. Useful for debugging. + +Invoking **codegen** returns an appender function that appends code to the function's body and returns itself: + +* **Codegen(formatString: `string`, [...formatParams: `any`]): Codegen**
+ Appends code to the function's body. The format string can contain placeholders specifying the types of inserted format parameters: + + * `%d`: Number (integer or floating point value) + * `%f`: Floating point value + * `%i`: Integer value + * `%j`: JSON.stringify'ed value + * `%s`: String value + * `%%`: Percent sign
+ +* **Codegen([scope: `Object.`]): `Function`**
+ Finishes the function and returns it. + +* **Codegen.toString([functionNameOverride: `string`]): `string`**
+ Returns the function as a string. + +Example +------- + +```js +var codegen = require("@protobufjs/codegen"); + +var add = codegen(["a", "b"], "add") // A function with parameters "a" and "b" named "add" + ("// awesome comment") // adds the line to the function's body + ("return a + b - c + %d", 1) // replaces %d with 1 and adds the line to the body + ({ c: 1 }); // adds "c" with a value of 1 to the function's scope + +console.log(add.toString()); // function add(a, b) { return a + b - c + 1 } +console.log(add(1, 2)); // calculates 1 + 2 - 1 + 1 = 3 +``` + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/codegen/index.d.ts b/node_modules/@protobufjs/codegen/index.d.ts new file mode 100644 index 0000000..f8ed908 --- /dev/null +++ b/node_modules/@protobufjs/codegen/index.d.ts @@ -0,0 +1,31 @@ +export = codegen; + +/** + * Appends code to the function's body. + * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param [formatParams] Format parameters + * @returns Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ +type Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function); + +/** + * Begins generating a function. + * @param functionParams Function parameter names + * @param [functionName] Function name if not anonymous + * @returns Appender that appends code to the function's body + */ +declare function codegen(functionParams: string[], functionName?: string): Codegen; + +/** + * Begins generating a function. + * @param [functionName] Function name if not anonymous + * @returns Appender that appends code to the function's body + */ +declare function codegen(functionName?: string): Codegen; + +declare namespace codegen { + + /** When set to `true`, codegen will log generated code to console. Useful for debugging. */ + let verbose: boolean; +} diff --git a/node_modules/@protobufjs/codegen/index.js b/node_modules/@protobufjs/codegen/index.js new file mode 100644 index 0000000..af005cb --- /dev/null +++ b/node_modules/@protobufjs/codegen/index.js @@ -0,0 +1,99 @@ +"use strict"; +module.exports = codegen; + +/** + * Begins generating a function. + * @memberof util + * @param {string[]} functionParams Function parameter names + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + */ +function codegen(functionParams, functionName) { + + /* istanbul ignore if */ + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = undefined; + } + + var body = []; + + /** + * Appends code to the function's body or finishes generation. + * @typedef Codegen + * @type {function} + * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param {...*} [formatParams] Format parameters + * @returns {Codegen|Function} Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ + + function Codegen(formatStringOrScope) { + // note that explicit array handling below makes this ~50% faster + + // finish the function + if (typeof formatStringOrScope !== "string") { + var source = toString(); + if (codegen.verbose) + console.log("codegen: " + source); // eslint-disable-line no-console + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), + scopeParams = new Array(scopeKeys.length + 1), + scopeValues = new Array(scopeKeys.length), + scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func + } + return Function(source)(); // eslint-disable-line no-new-func + } + + // otherwise append to body + var formatParams = new Array(arguments.length - 1), + formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { + var value = formatParams[formatOffset++]; + switch ($1) { + case "d": case "f": return String(Number(value)); + case "i": return String(Math.floor(value)); + case "j": return JSON.stringify(value); + case "s": return String(value); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + + function toString(functionNameOverride) { + return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + + Codegen.toString = toString; + return Codegen; +} + +/** + * Begins generating a function. + * @memberof util + * @function codegen + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + * @variation 2 + */ + +/** + * When set to `true`, codegen will log generated code to console. Useful for debugging. + * @name util.codegen.verbose + * @type {boolean} + */ +codegen.verbose = false; diff --git a/node_modules/@protobufjs/codegen/package.json b/node_modules/@protobufjs/codegen/package.json new file mode 100644 index 0000000..6c680d1 --- /dev/null +++ b/node_modules/@protobufjs/codegen/package.json @@ -0,0 +1,46 @@ +{ + "_from": "@protobufjs/codegen@^2.0.4", + "_id": "@protobufjs/codegen@2.0.4", + "_inBundle": false, + "_integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "_location": "/@protobufjs/codegen", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/codegen@^2.0.4", + "name": "@protobufjs/codegen", + "escapedName": "@protobufjs%2fcodegen", + "scope": "@protobufjs", + "rawSpec": "^2.0.4", + "saveSpec": null, + "fetchSpec": "^2.0.4" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "_shasum": "7ef37f0d010fb028ad1ad59722e506d9262815cb", + "_spec": "@protobufjs/codegen@^2.0.4", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A minimalistic code generation utility.", + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/codegen", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "types": "index.d.ts", + "version": "2.0.4" +} diff --git a/node_modules/@protobufjs/codegen/tests/index.js b/node_modules/@protobufjs/codegen/tests/index.js new file mode 100644 index 0000000..b189117 --- /dev/null +++ b/node_modules/@protobufjs/codegen/tests/index.js @@ -0,0 +1,13 @@ +var codegen = require(".."); + +// new require("benchmark").Suite().add("add", function() { + +var add = codegen(["a", "b"], "add") + ("// awesome comment") + ("return a + b - c + %d", 1) + ({ c: 1 }); + +if (add(1, 2) !== 3) + throw Error("failed"); + +// }).on("cycle", function(event) { process.stdout.write(String(event.target) + "\n"); }).run(); diff --git a/node_modules/@protobufjs/eventemitter/LICENSE b/node_modules/@protobufjs/eventemitter/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/eventemitter/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/eventemitter/README.md b/node_modules/@protobufjs/eventemitter/README.md new file mode 100644 index 0000000..528e725 --- /dev/null +++ b/node_modules/@protobufjs/eventemitter/README.md @@ -0,0 +1,22 @@ +@protobufjs/eventemitter +======================== +[![npm](https://img.shields.io/npm/v/@protobufjs/eventemitter.svg)](https://www.npmjs.com/package/@protobufjs/eventemitter) + +A minimal event emitter. + +API +--- + +* **new EventEmitter()**
+ Constructs a new event emitter instance. + +* **EventEmitter#on(evt: `string`, fn: `function`, [ctx: `Object`]): `EventEmitter`**
+ Registers an event listener. + +* **EventEmitter#off([evt: `string`], [fn: `function`]): `EventEmitter`**
+ Removes an event listener or any matching listeners if arguments are omitted. + +* **EventEmitter#emit(evt: `string`, ...args: `*`): `EventEmitter`**
+ Emits an event by calling its listeners with the specified arguments. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/eventemitter/index.d.ts b/node_modules/@protobufjs/eventemitter/index.d.ts new file mode 100644 index 0000000..f177823 --- /dev/null +++ b/node_modules/@protobufjs/eventemitter/index.d.ts @@ -0,0 +1,43 @@ +export = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +declare class EventEmitter { + + /** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ + constructor(); + + /** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ + on(evt: string, fn: () => any, ctx?: any): EventEmitter; + + /** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ + off(evt?: string, fn?: () => any): EventEmitter; + + /** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ + emit(evt: string, ...args: any[]): EventEmitter; +} diff --git a/node_modules/@protobufjs/eventemitter/index.js b/node_modules/@protobufjs/eventemitter/index.js new file mode 100644 index 0000000..f766fd0 --- /dev/null +++ b/node_modules/@protobufjs/eventemitter/index.js @@ -0,0 +1,76 @@ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; diff --git a/node_modules/@protobufjs/eventemitter/package.json b/node_modules/@protobufjs/eventemitter/package.json new file mode 100644 index 0000000..98354ed --- /dev/null +++ b/node_modules/@protobufjs/eventemitter/package.json @@ -0,0 +1,54 @@ +{ + "_from": "@protobufjs/eventemitter@^1.1.0", + "_id": "@protobufjs/eventemitter@1.1.0", + "_inBundle": false, + "_integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=", + "_location": "/@protobufjs/eventemitter", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/eventemitter@^1.1.0", + "name": "@protobufjs/eventemitter", + "escapedName": "@protobufjs%2feventemitter", + "scope": "@protobufjs", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "_shasum": "355cbc98bafad5978f9ed095f397621f1d066b70", + "_spec": "@protobufjs/eventemitter@^1.1.0", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A minimal event emitter.", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/eventemitter", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "test": "tape tests/*.js" + }, + "types": "index.d.ts", + "version": "1.1.0" +} diff --git a/node_modules/@protobufjs/eventemitter/tests/index.js b/node_modules/@protobufjs/eventemitter/tests/index.js new file mode 100644 index 0000000..390958f --- /dev/null +++ b/node_modules/@protobufjs/eventemitter/tests/index.js @@ -0,0 +1,47 @@ +var tape = require("tape"); + +var EventEmitter = require(".."); + +tape.test("eventemitter", function(test) { + + var ee = new EventEmitter(); + var fn; + var ctx = {}; + + test.doesNotThrow(function() { + ee.emit("a", 1); + ee.off(); + ee.off("a"); + ee.off("a", function() {}); + }, "should not throw if no listeners are registered"); + + test.equal(ee.on("a", function(arg1) { + test.equal(this, ctx, "should be called with this = ctx"); + test.equal(arg1, 1, "should be called with arg1 = 1"); + }, ctx), ee, "should return itself when registering events"); + ee.emit("a", 1); + + ee.off("a"); + test.same(ee._listeners, { a: [] }, "should remove all listeners of the respective event when calling off(evt)"); + + ee.off(); + test.same(ee._listeners, {}, "should remove all listeners when just calling off()"); + + ee.on("a", fn = function(arg1) { + test.equal(this, ctx, "should be called with this = ctx"); + test.equal(arg1, 1, "should be called with arg1 = 1"); + }, ctx).emit("a", 1); + + ee.off("a", fn); + test.same(ee._listeners, { a: [] }, "should remove the exact listener when calling off(evt, fn)"); + + ee.on("a", function() { + test.equal(this, ee, "should be called with this = ee"); + }).emit("a"); + + test.doesNotThrow(function() { + ee.off("a", fn); + }, "should not throw if no such listener is found"); + + test.end(); +}); diff --git a/node_modules/@protobufjs/fetch/LICENSE b/node_modules/@protobufjs/fetch/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/fetch/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/fetch/README.md b/node_modules/@protobufjs/fetch/README.md new file mode 100644 index 0000000..1ebf4d4 --- /dev/null +++ b/node_modules/@protobufjs/fetch/README.md @@ -0,0 +1,13 @@ +@protobufjs/fetch +================= +[![npm](https://img.shields.io/npm/v/@protobufjs/fetch.svg)](https://www.npmjs.com/package/@protobufjs/fetch) + +Fetches the contents of a file accross node and browsers. + +API +--- + +* **fetch(path: `string`, [options: { binary: boolean } ], [callback: `function(error: ?Error, [contents: string])`]): `Promise|undefined`** + Fetches the contents of a file. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/fetch/index.d.ts b/node_modules/@protobufjs/fetch/index.d.ts new file mode 100644 index 0000000..ab0820c --- /dev/null +++ b/node_modules/@protobufjs/fetch/index.d.ts @@ -0,0 +1,56 @@ +export = fetch; + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ +type FetchCallback = (error: Error, contents?: string) => void; + +/** + * Options as used by {@link util.fetch}. + * @typedef FetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +interface FetchOptions { + binary?: boolean; + xhr?: boolean +} + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {FetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +declare function fetch(filename: string, options: FetchOptions, callback: FetchCallback): void; + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +declare function fetch(path: string, callback: FetchCallback): void; + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ +declare function fetch(path: string, options?: FetchOptions): Promise<(string|Uint8Array)>; diff --git a/node_modules/@protobufjs/fetch/index.js b/node_modules/@protobufjs/fetch/index.js new file mode 100644 index 0000000..d92aa68 --- /dev/null +++ b/node_modules/@protobufjs/fetch/index.js @@ -0,0 +1,115 @@ +"use strict"; +module.exports = fetch; + +var asPromise = require("@protobufjs/aspromise"), + inquire = require("@protobufjs/inquire"); + +var fs = inquire("fs"); + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Options as used by {@link util.fetch}. + * @typedef FetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {FetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +function fetch(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + if (!callback) + return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this + + // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" + ? fetch.xhr(filename, options, callback) + : err + ? callback(err) + : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + + // use the XHR version otherwise. + return fetch.xhr(filename, options, callback); +} + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ + +/**/ +fetch.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { + + if (xhr.readyState !== 4) + return undefined; + + // local cors security errors return status 0 / empty string, too. afaik this cannot be + // reliably distinguished from an actually empty file for security reasons. feel free + // to send a pull request if you are aware of a solution. + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + + // if binary data is expected, make sure that some sort of array is returned, even if + // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. + if (options.binary) { + var buffer = xhr.response; + if (!buffer) { + buffer = []; + for (var i = 0; i < xhr.responseText.length; ++i) + buffer.push(xhr.responseText.charCodeAt(i) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); + } + return callback(null, xhr.responseText); + }; + + if (options.binary) { + // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + + xhr.open("GET", filename); + xhr.send(); +}; diff --git a/node_modules/@protobufjs/fetch/package.json b/node_modules/@protobufjs/fetch/package.json new file mode 100644 index 0000000..781ea6f --- /dev/null +++ b/node_modules/@protobufjs/fetch/package.json @@ -0,0 +1,58 @@ +{ + "_from": "@protobufjs/fetch@^1.1.0", + "_id": "@protobufjs/fetch@1.1.0", + "_inBundle": false, + "_integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "_location": "/@protobufjs/fetch", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/fetch@^1.1.0", + "name": "@protobufjs/fetch", + "escapedName": "@protobufjs%2ffetch", + "scope": "@protobufjs", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "_shasum": "ba99fb598614af65700c1619ff06d454b0d84c45", + "_spec": "@protobufjs/fetch@^1.1.0", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + }, + "deprecated": false, + "description": "Fetches the contents of a file accross node and browsers.", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/fetch", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "test": "tape tests/*.js" + }, + "types": "index.d.ts", + "version": "1.1.0" +} diff --git a/node_modules/@protobufjs/fetch/tests/index.js b/node_modules/@protobufjs/fetch/tests/index.js new file mode 100644 index 0000000..b7fbf81 --- /dev/null +++ b/node_modules/@protobufjs/fetch/tests/index.js @@ -0,0 +1,16 @@ +var tape = require("tape"); + +var fetch = require(".."); + +tape.test("fetch", function(test) { + + if (typeof Promise !== "undefined") { + var promise = fetch("NOTFOUND"); + promise.catch(function() {}); + test.ok(promise instanceof Promise, "should return a promise if callback has been omitted"); + } + + // TODO - some way to test this properly? + + test.end(); +}); diff --git a/node_modules/@protobufjs/float/LICENSE b/node_modules/@protobufjs/float/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/float/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/float/README.md b/node_modules/@protobufjs/float/README.md new file mode 100644 index 0000000..e475fc9 --- /dev/null +++ b/node_modules/@protobufjs/float/README.md @@ -0,0 +1,102 @@ +@protobufjs/float +================= +[![npm](https://img.shields.io/npm/v/@protobufjs/float.svg)](https://www.npmjs.com/package/@protobufjs/float) + +Reads / writes floats / doubles from / to buffers in both modern and ancient browsers. Fast. + +API +--- + +* **writeFloatLE(val: `number`, buf: `Uint8Array`, pos: `number`)**
+ Writes a 32 bit float to a buffer using little endian byte order. + +* **writeFloatBE(val: `number`, buf: `Uint8Array`, pos: `number`)**
+ Writes a 32 bit float to a buffer using big endian byte order. + +* **readFloatLE(buf: `Uint8Array`, pos: `number`): `number`**
+ Reads a 32 bit float from a buffer using little endian byte order. + +* **readFloatBE(buf: `Uint8Array`, pos: `number`): `number`**
+ Reads a 32 bit float from a buffer using big endian byte order. + +* **writeDoubleLE(val: `number`, buf: `Uint8Array`, pos: `number`)**
+ Writes a 64 bit double to a buffer using little endian byte order. + +* **writeDoubleBE(val: `number`, buf: `Uint8Array`, pos: `number`)**
+ Writes a 64 bit double to a buffer using big endian byte order. + +* **readDoubleLE(buf: `Uint8Array`, pos: `number`): `number`**
+ Reads a 64 bit double from a buffer using little endian byte order. + +* **readDoubleBE(buf: `Uint8Array`, pos: `number`): `number`**
+ Reads a 64 bit double from a buffer using big endian byte order. + +Performance +----------- +There is a simple benchmark included comparing raw read/write performance of this library (float), float's fallback for old browsers, the [ieee754](https://www.npmjs.com/package/ieee754) module and node's [buffer](https://nodejs.org/api/buffer.html). On an i7-2600k running node 6.9.1 it yields: + +``` +benchmarking writeFloat performance ... + +float x 42,741,625 ops/sec ±1.75% (81 runs sampled) +float (fallback) x 11,272,532 ops/sec ±1.12% (85 runs sampled) +ieee754 x 8,653,337 ops/sec ±1.18% (84 runs sampled) +buffer x 12,412,414 ops/sec ±1.41% (83 runs sampled) +buffer (noAssert) x 13,471,149 ops/sec ±1.09% (84 runs sampled) + + float was fastest + float (fallback) was 73.5% slower + ieee754 was 79.6% slower + buffer was 70.9% slower + buffer (noAssert) was 68.3% slower + +benchmarking readFloat performance ... + +float x 44,382,729 ops/sec ±1.70% (84 runs sampled) +float (fallback) x 20,925,938 ops/sec ±0.86% (87 runs sampled) +ieee754 x 17,189,009 ops/sec ±1.01% (87 runs sampled) +buffer x 10,518,437 ops/sec ±1.04% (83 runs sampled) +buffer (noAssert) x 11,031,636 ops/sec ±1.15% (87 runs sampled) + + float was fastest + float (fallback) was 52.5% slower + ieee754 was 61.0% slower + buffer was 76.1% slower + buffer (noAssert) was 75.0% slower + +benchmarking writeDouble performance ... + +float x 38,624,906 ops/sec ±0.93% (83 runs sampled) +float (fallback) x 10,457,811 ops/sec ±1.54% (85 runs sampled) +ieee754 x 7,681,130 ops/sec ±1.11% (83 runs sampled) +buffer x 12,657,876 ops/sec ±1.03% (83 runs sampled) +buffer (noAssert) x 13,372,795 ops/sec ±0.84% (85 runs sampled) + + float was fastest + float (fallback) was 73.1% slower + ieee754 was 80.1% slower + buffer was 67.3% slower + buffer (noAssert) was 65.3% slower + +benchmarking readDouble performance ... + +float x 40,527,888 ops/sec ±1.05% (84 runs sampled) +float (fallback) x 18,696,480 ops/sec ±0.84% (86 runs sampled) +ieee754 x 14,074,028 ops/sec ±1.04% (87 runs sampled) +buffer x 10,092,367 ops/sec ±1.15% (84 runs sampled) +buffer (noAssert) x 10,623,793 ops/sec ±0.96% (84 runs sampled) + + float was fastest + float (fallback) was 53.8% slower + ieee754 was 65.3% slower + buffer was 75.1% slower + buffer (noAssert) was 73.8% slower +``` + +To run it yourself: + +``` +$> npm run bench +``` + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/float/bench/index.js b/node_modules/@protobufjs/float/bench/index.js new file mode 100644 index 0000000..911f461 --- /dev/null +++ b/node_modules/@protobufjs/float/bench/index.js @@ -0,0 +1,87 @@ +"use strict"; + +var float = require(".."), + ieee754 = require("ieee754"), + newSuite = require("./suite"); + +var F32 = Float32Array; +var F64 = Float64Array; +delete global.Float32Array; +delete global.Float64Array; +var floatFallback = float({}); +global.Float32Array = F32; +global.Float64Array = F64; + +var buf = new Buffer(8); + +newSuite("writeFloat") +.add("float", function() { + float.writeFloatLE(0.1, buf, 0); +}) +.add("float (fallback)", function() { + floatFallback.writeFloatLE(0.1, buf, 0); +}) +.add("ieee754", function() { + ieee754.write(buf, 0.1, 0, true, 23, 4); +}) +.add("buffer", function() { + buf.writeFloatLE(0.1, 0); +}) +.add("buffer (noAssert)", function() { + buf.writeFloatLE(0.1, 0, true); +}) +.run(); + +newSuite("readFloat") +.add("float", function() { + float.readFloatLE(buf, 0); +}) +.add("float (fallback)", function() { + floatFallback.readFloatLE(buf, 0); +}) +.add("ieee754", function() { + ieee754.read(buf, 0, true, 23, 4); +}) +.add("buffer", function() { + buf.readFloatLE(0); +}) +.add("buffer (noAssert)", function() { + buf.readFloatLE(0, true); +}) +.run(); + +newSuite("writeDouble") +.add("float", function() { + float.writeDoubleLE(0.1, buf, 0); +}) +.add("float (fallback)", function() { + floatFallback.writeDoubleLE(0.1, buf, 0); +}) +.add("ieee754", function() { + ieee754.write(buf, 0.1, 0, true, 52, 8); +}) +.add("buffer", function() { + buf.writeDoubleLE(0.1, 0); +}) +.add("buffer (noAssert)", function() { + buf.writeDoubleLE(0.1, 0, true); +}) +.run(); + +newSuite("readDouble") +.add("float", function() { + float.readDoubleLE(buf, 0); +}) +.add("float (fallback)", function() { + floatFallback.readDoubleLE(buf, 0); +}) +.add("ieee754", function() { + ieee754.read(buf, 0, true, 52, 8); +}) +.add("buffer", function() { + buf.readDoubleLE(0); +}) +.add("buffer (noAssert)", function() { + buf.readDoubleLE(0, true); +}) +.run(); diff --git a/node_modules/@protobufjs/float/bench/suite.js b/node_modules/@protobufjs/float/bench/suite.js new file mode 100644 index 0000000..e8016d2 --- /dev/null +++ b/node_modules/@protobufjs/float/bench/suite.js @@ -0,0 +1,46 @@ +"use strict"; +module.exports = newSuite; + +var benchmark = require("benchmark"), + chalk = require("chalk"); + +var padSize = 27; + +function newSuite(name) { + var benches = []; + return new benchmark.Suite(name) + .on("add", function(event) { + benches.push(event.target); + }) + .on("start", function() { + process.stdout.write("benchmarking " + name + " performance ...\n\n"); + }) + .on("cycle", function(event) { + process.stdout.write(String(event.target) + "\n"); + }) + .on("complete", function() { + if (benches.length > 1) { + var fastest = this.filter("fastest"), // eslint-disable-line no-invalid-this + fastestHz = getHz(fastest[0]); + process.stdout.write("\n" + chalk.white(pad(fastest[0].name, padSize)) + " was " + chalk.green("fastest") + "\n"); + benches.forEach(function(bench) { + if (fastest.indexOf(bench) === 0) + return; + var hz = hz = getHz(bench); + var percent = (1 - hz / fastestHz) * 100; + process.stdout.write(chalk.white(pad(bench.name, padSize)) + " was " + chalk.red(percent.toFixed(1) + "% slower") + "\n"); + }); + } + process.stdout.write("\n"); + }); +} + +function getHz(bench) { + return 1 / (bench.stats.mean + bench.stats.moe); +} + +function pad(str, len, l) { + while (str.length < len) + str = l ? str + " " : " " + str; + return str; +} diff --git a/node_modules/@protobufjs/float/index.d.ts b/node_modules/@protobufjs/float/index.d.ts new file mode 100644 index 0000000..ab05de3 --- /dev/null +++ b/node_modules/@protobufjs/float/index.d.ts @@ -0,0 +1,83 @@ +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ +export function writeFloatLE(val: number, buf: Uint8Array, pos: number): void; + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ +export function writeFloatBE(val: number, buf: Uint8Array, pos: number): void; + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +export function readFloatLE(buf: Uint8Array, pos: number): number; + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +export function readFloatBE(buf: Uint8Array, pos: number): number; + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ +export function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void; + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ +export function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void; + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +export function readDoubleLE(buf: Uint8Array, pos: number): number; + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +export function readDoubleBE(buf: Uint8Array, pos: number): number; diff --git a/node_modules/@protobufjs/float/index.js b/node_modules/@protobufjs/float/index.js new file mode 100644 index 0000000..52ba3aa --- /dev/null +++ b/node_modules/@protobufjs/float/index.js @@ -0,0 +1,335 @@ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} diff --git a/node_modules/@protobufjs/float/package.json b/node_modules/@protobufjs/float/package.json new file mode 100644 index 0000000..4c01526 --- /dev/null +++ b/node_modules/@protobufjs/float/package.json @@ -0,0 +1,59 @@ +{ + "_from": "@protobufjs/float@^1.0.2", + "_id": "@protobufjs/float@1.0.2", + "_inBundle": false, + "_integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=", + "_location": "/@protobufjs/float", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/float@^1.0.2", + "name": "@protobufjs/float", + "escapedName": "@protobufjs%2ffloat", + "scope": "@protobufjs", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "_shasum": "5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1", + "_spec": "@protobufjs/float@^1.0.2", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Reads / writes floats / doubles from / to buffers in both modern and ancient browsers.", + "devDependencies": { + "benchmark": "^2.1.4", + "chalk": "^1.1.3", + "ieee754": "^1.1.8", + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/float", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "bench": "node bench", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "test": "tape tests/*.js" + }, + "types": "index.d.ts", + "version": "1.0.2" +} diff --git a/node_modules/@protobufjs/float/tests/index.js b/node_modules/@protobufjs/float/tests/index.js new file mode 100644 index 0000000..62f0827 --- /dev/null +++ b/node_modules/@protobufjs/float/tests/index.js @@ -0,0 +1,100 @@ +var tape = require("tape"); + +var float = require(".."); + +tape.test("float", function(test) { + + // default + test.test(test.name + " - typed array", function(test) { + runTest(float, test); + }); + + // ieee754 + test.test(test.name + " - fallback", function(test) { + var F32 = global.Float32Array, + F64 = global.Float64Array; + delete global.Float32Array; + delete global.Float64Array; + runTest(float({}), test); + global.Float32Array = F32; + global.Float64Array = F64; + }); +}); + +function runTest(float, test) { + + var common = [ + 0, + -0, + Infinity, + -Infinity, + 0.125, + 1024.5, + -4096.5, + NaN + ]; + + test.test(test.name + " - using 32 bits", function(test) { + common.concat([ + 3.4028234663852886e+38, + 1.1754943508222875e-38, + 1.1754946310819804e-39 + ]) + .forEach(function(value) { + var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString(); + test.ok( + checkValue(value, 4, float.readFloatLE, float.writeFloatLE, Buffer.prototype.writeFloatLE), + "should write and read back " + strval + " (32 bit LE)" + ); + test.ok( + checkValue(value, 4, float.readFloatBE, float.writeFloatBE, Buffer.prototype.writeFloatBE), + "should write and read back " + strval + " (32 bit BE)" + ); + }); + test.end(); + }); + + test.test(test.name + " - using 64 bits", function(test) { + common.concat([ + 1.7976931348623157e+308, + 2.2250738585072014e-308, + 2.2250738585072014e-309 + ]) + .forEach(function(value) { + var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString(); + test.ok( + checkValue(value, 8, float.readDoubleLE, float.writeDoubleLE, Buffer.prototype.writeDoubleLE), + "should write and read back " + strval + " (64 bit LE)" + ); + test.ok( + checkValue(value, 8, float.readDoubleBE, float.writeDoubleBE, Buffer.prototype.writeDoubleBE), + "should write and read back " + strval + " (64 bit BE)" + ); + }); + test.end(); + }); + + test.end(); +} + +function checkValue(value, size, read, write, write_comp) { + var buffer = new Buffer(size); + write(value, buffer, 0); + var value_comp = read(buffer, 0); + var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString(); + if (value !== value) { + if (value_comp === value_comp) + return false; + } else if (value_comp !== value) + return false; + + var buffer_comp = new Buffer(size); + write_comp.call(buffer_comp, value, 0); + for (var i = 0; i < size; ++i) + if (buffer[i] !== buffer_comp[i]) { + console.error(">", buffer, buffer_comp); + return false; + } + + return true; +} \ No newline at end of file diff --git a/node_modules/@protobufjs/inquire/.npmignore b/node_modules/@protobufjs/inquire/.npmignore new file mode 100644 index 0000000..c3fc82e --- /dev/null +++ b/node_modules/@protobufjs/inquire/.npmignore @@ -0,0 +1,3 @@ +npm-debug.* +node_modules/ +coverage/ diff --git a/node_modules/@protobufjs/inquire/LICENSE b/node_modules/@protobufjs/inquire/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/inquire/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/inquire/README.md b/node_modules/@protobufjs/inquire/README.md new file mode 100644 index 0000000..3eabd86 --- /dev/null +++ b/node_modules/@protobufjs/inquire/README.md @@ -0,0 +1,13 @@ +@protobufjs/inquire +=================== +[![npm](https://img.shields.io/npm/v/@protobufjs/inquire.svg)](https://www.npmjs.com/package/@protobufjs/inquire) + +Requires a module only if available and hides the require call from bundlers. + +API +--- + +* **inquire(moduleName: `string`): `?Object`**
+ Requires a module only if available. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/inquire/index.d.ts b/node_modules/@protobufjs/inquire/index.d.ts new file mode 100644 index 0000000..1f5a865 --- /dev/null +++ b/node_modules/@protobufjs/inquire/index.d.ts @@ -0,0 +1,9 @@ +export = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +declare function inquire(moduleName: string): Object; diff --git a/node_modules/@protobufjs/inquire/index.js b/node_modules/@protobufjs/inquire/index.js new file mode 100644 index 0000000..1a1f238 --- /dev/null +++ b/node_modules/@protobufjs/inquire/index.js @@ -0,0 +1,17 @@ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} diff --git a/node_modules/@protobufjs/inquire/package.json b/node_modules/@protobufjs/inquire/package.json new file mode 100644 index 0000000..2dab709 --- /dev/null +++ b/node_modules/@protobufjs/inquire/package.json @@ -0,0 +1,55 @@ +{ + "_from": "@protobufjs/inquire@^1.1.0", + "_id": "@protobufjs/inquire@1.1.0", + "_inBundle": false, + "_integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=", + "_location": "/@protobufjs/inquire", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/inquire@^1.1.0", + "name": "@protobufjs/inquire", + "escapedName": "@protobufjs%2finquire", + "scope": "@protobufjs", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/@protobufjs/fetch", + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "_shasum": "ff200e3e7cf2429e2dcafc1140828e8cc638f089", + "_spec": "@protobufjs/inquire@^1.1.0", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Requires a module only if available and hides the require call from bundlers.", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/inquire", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "test": "tape tests/*.js" + }, + "types": "index.d.ts", + "version": "1.1.0" +} diff --git a/node_modules/@protobufjs/inquire/tests/data/array.js b/node_modules/@protobufjs/inquire/tests/data/array.js new file mode 100644 index 0000000..0847b28 --- /dev/null +++ b/node_modules/@protobufjs/inquire/tests/data/array.js @@ -0,0 +1 @@ +module.exports = [1]; diff --git a/node_modules/@protobufjs/inquire/tests/data/emptyArray.js b/node_modules/@protobufjs/inquire/tests/data/emptyArray.js new file mode 100644 index 0000000..e0a30c5 --- /dev/null +++ b/node_modules/@protobufjs/inquire/tests/data/emptyArray.js @@ -0,0 +1 @@ +module.exports = []; diff --git a/node_modules/@protobufjs/inquire/tests/data/emptyObject.js b/node_modules/@protobufjs/inquire/tests/data/emptyObject.js new file mode 100644 index 0000000..f053ebf --- /dev/null +++ b/node_modules/@protobufjs/inquire/tests/data/emptyObject.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/node_modules/@protobufjs/inquire/tests/data/object.js b/node_modules/@protobufjs/inquire/tests/data/object.js new file mode 100644 index 0000000..3b75bca --- /dev/null +++ b/node_modules/@protobufjs/inquire/tests/data/object.js @@ -0,0 +1 @@ +module.exports = { a: 1 }; diff --git a/node_modules/@protobufjs/inquire/tests/index.js b/node_modules/@protobufjs/inquire/tests/index.js new file mode 100644 index 0000000..4a555ca --- /dev/null +++ b/node_modules/@protobufjs/inquire/tests/index.js @@ -0,0 +1,20 @@ +var tape = require("tape"); + +var inquire = require(".."); + +tape.test("inquire", function(test) { + + test.equal(inquire("buffer").Buffer, Buffer, "should be able to require \"buffer\""); + + test.equal(inquire("%invalid"), null, "should not be able to require \"%invalid\""); + + test.equal(inquire("./tests/data/emptyObject"), null, "should return null when requiring a module exporting an empty object"); + + test.equal(inquire("./tests/data/emptyArray"), null, "should return null when requiring a module exporting an empty array"); + + test.same(inquire("./tests/data/object"), { a: 1 }, "should return the object if a non-empty object"); + + test.same(inquire("./tests/data/array"), [ 1 ], "should return the module if a non-empty array"); + + test.end(); +}); diff --git a/node_modules/@protobufjs/path/LICENSE b/node_modules/@protobufjs/path/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/path/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/path/README.md b/node_modules/@protobufjs/path/README.md new file mode 100644 index 0000000..1c1a2ba --- /dev/null +++ b/node_modules/@protobufjs/path/README.md @@ -0,0 +1,19 @@ +@protobufjs/path +================ +[![npm](https://img.shields.io/npm/v/@protobufjs/path.svg)](https://www.npmjs.com/package/@protobufjs/path) + +A minimal path module to resolve Unix, Windows and URL paths alike. + +API +--- + +* **path.isAbsolute(path: `string`): `boolean`**
+ Tests if the specified path is absolute. + +* **path.normalize(path: `string`): `string`**
+ Normalizes the specified path. + +* **path.resolve(originPath: `string`, includePath: `string`, [alreadyNormalized=false: `boolean`]): `string`**
+ Resolves the specified include path against the specified origin path. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/path/index.d.ts b/node_modules/@protobufjs/path/index.d.ts new file mode 100644 index 0000000..b664d81 --- /dev/null +++ b/node_modules/@protobufjs/path/index.d.ts @@ -0,0 +1,22 @@ +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +export function isAbsolute(path: string): boolean; + +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +export function normalize(path: string): string; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +export function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string; diff --git a/node_modules/@protobufjs/path/index.js b/node_modules/@protobufjs/path/index.js new file mode 100644 index 0000000..7c7fb72 --- /dev/null +++ b/node_modules/@protobufjs/path/index.js @@ -0,0 +1,65 @@ +"use strict"; + +/** + * A minimal path module to resolve Unix, Windows and URL paths alike. + * @memberof util + * @namespace + */ +var path = exports; + +var isAbsolute = +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +path.isAbsolute = function isAbsolute(path) { + return /^(?:\/|\w+:)/.test(path); +}; + +var normalize = +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +path.normalize = function normalize(path) { + path = path.replace(/\\/g, "/") + .replace(/\/{2,}/g, "/"); + var parts = path.split("/"), + absolute = isAbsolute(path), + prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i = 0; i < parts.length;) { + if (parts[i] === "..") { + if (i > 0 && parts[i - 1] !== "..") + parts.splice(--i, 2); + else if (absolute) + parts.splice(i, 1); + else + ++i; + } else if (parts[i] === ".") + parts.splice(i, 1); + else + ++i; + } + return prefix + parts.join("/"); +}; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +path.resolve = function resolve(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize(includePath); + if (isAbsolute(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; +}; diff --git a/node_modules/@protobufjs/path/package.json b/node_modules/@protobufjs/path/package.json new file mode 100644 index 0000000..e2d475f --- /dev/null +++ b/node_modules/@protobufjs/path/package.json @@ -0,0 +1,54 @@ +{ + "_from": "@protobufjs/path@^1.1.2", + "_id": "@protobufjs/path@1.1.2", + "_inBundle": false, + "_integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=", + "_location": "/@protobufjs/path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/path@^1.1.2", + "name": "@protobufjs/path", + "escapedName": "@protobufjs%2fpath", + "scope": "@protobufjs", + "rawSpec": "^1.1.2", + "saveSpec": null, + "fetchSpec": "^1.1.2" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "_shasum": "6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d", + "_spec": "@protobufjs/path@^1.1.2", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A minimal path module to resolve Unix, Windows and URL paths alike.", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/path", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "test": "tape tests/*.js" + }, + "types": "index.d.ts", + "version": "1.1.2" +} diff --git a/node_modules/@protobufjs/path/tests/index.js b/node_modules/@protobufjs/path/tests/index.js new file mode 100644 index 0000000..9c23bc9 --- /dev/null +++ b/node_modules/@protobufjs/path/tests/index.js @@ -0,0 +1,60 @@ +var tape = require("tape"); + +var path = require(".."); + +tape.test("path", function(test) { + + test.ok(path.isAbsolute("X:\\some\\path\\file.js"), "should identify absolute windows paths"); + test.ok(path.isAbsolute("/some/path/file.js"), "should identify absolute unix paths"); + + test.notOk(path.isAbsolute("some\\path\\file.js"), "should identify relative windows paths"); + test.notOk(path.isAbsolute("some/path/file.js"), "should identify relative unix paths"); + + var paths = [ + { + actual: "X:\\some\\..\\.\\path\\\\file.js", + normal: "X:/path/file.js", + resolve: { + origin: "X:/path/origin.js", + expected: "X:/path/file.js" + } + }, { + actual: "some\\..\\.\\path\\\\file.js", + normal: "path/file.js", + resolve: { + origin: "X:/path/origin.js", + expected: "X:/path/path/file.js" + } + }, { + actual: "/some/.././path//file.js", + normal: "/path/file.js", + resolve: { + origin: "/path/origin.js", + expected: "/path/file.js" + } + }, { + actual: "some/.././path//file.js", + normal: "path/file.js", + resolve: { + origin: "", + expected: "path/file.js" + } + }, { + actual: ".././path//file.js", + normal: "../path/file.js" + }, { + actual: "/.././path//file.js", + normal: "/path/file.js" + } + ]; + + paths.forEach(function(p) { + test.equal(path.normalize(p.actual), p.normal, "should normalize " + p.actual); + if (p.resolve) { + test.equal(path.resolve(p.resolve.origin, p.actual), p.resolve.expected, "should resolve " + p.actual); + test.equal(path.resolve(p.resolve.origin, p.normal, true), p.resolve.expected, "should resolve " + p.normal + " (already normalized)"); + } + }); + + test.end(); +}); diff --git a/node_modules/@protobufjs/pool/.npmignore b/node_modules/@protobufjs/pool/.npmignore new file mode 100644 index 0000000..c3fc82e --- /dev/null +++ b/node_modules/@protobufjs/pool/.npmignore @@ -0,0 +1,3 @@ +npm-debug.* +node_modules/ +coverage/ diff --git a/node_modules/@protobufjs/pool/LICENSE b/node_modules/@protobufjs/pool/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/pool/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/pool/README.md b/node_modules/@protobufjs/pool/README.md new file mode 100644 index 0000000..9fb0e97 --- /dev/null +++ b/node_modules/@protobufjs/pool/README.md @@ -0,0 +1,13 @@ +@protobufjs/pool +================ +[![npm](https://img.shields.io/npm/v/@protobufjs/pool.svg)](https://www.npmjs.com/package/@protobufjs/pool) + +A general purpose buffer pool. + +API +--- + +* **pool(alloc: `function(size: number): Uint8Array`, slice: `function(this: Uint8Array, start: number, end: number): Uint8Array`, [size=8192: `number`]): `function(size: number): Uint8Array`**
+ Creates a pooled allocator. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/pool/index.d.ts b/node_modules/@protobufjs/pool/index.d.ts new file mode 100644 index 0000000..23fe38c --- /dev/null +++ b/node_modules/@protobufjs/pool/index.d.ts @@ -0,0 +1,32 @@ +export = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +type PoolAllocator = (size: number) => Uint8Array; + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ +type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array; + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator; diff --git a/node_modules/@protobufjs/pool/index.js b/node_modules/@protobufjs/pool/index.js new file mode 100644 index 0000000..6c666f6 --- /dev/null +++ b/node_modules/@protobufjs/pool/index.js @@ -0,0 +1,48 @@ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} diff --git a/node_modules/@protobufjs/pool/package.json b/node_modules/@protobufjs/pool/package.json new file mode 100644 index 0000000..ca261ea --- /dev/null +++ b/node_modules/@protobufjs/pool/package.json @@ -0,0 +1,54 @@ +{ + "_from": "@protobufjs/pool@^1.1.0", + "_id": "@protobufjs/pool@1.1.0", + "_inBundle": false, + "_integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=", + "_location": "/@protobufjs/pool", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/pool@^1.1.0", + "name": "@protobufjs/pool", + "escapedName": "@protobufjs%2fpool", + "scope": "@protobufjs", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "_shasum": "09fd15f2d6d3abfa9b65bc366506d6ad7846ff54", + "_spec": "@protobufjs/pool@^1.1.0", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A general purpose buffer pool.", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/pool", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "test": "tape tests/*.js" + }, + "types": "index.d.ts", + "version": "1.1.0" +} diff --git a/node_modules/@protobufjs/pool/tests/index.js b/node_modules/@protobufjs/pool/tests/index.js new file mode 100644 index 0000000..5d1a921 --- /dev/null +++ b/node_modules/@protobufjs/pool/tests/index.js @@ -0,0 +1,33 @@ +var tape = require("tape"); + +var pool = require(".."); + +if (typeof Uint8Array !== "undefined") +tape.test("pool", function(test) { + + var alloc = pool(function(size) { return new Uint8Array(size); }, Uint8Array.prototype.subarray); + + var buf1 = alloc(0); + test.equal(buf1.length, 0, "should allocate a buffer of size 0"); + + var buf2 = alloc(1); + test.equal(buf2.length, 1, "should allocate a buffer of size 1 (initializes slab)"); + + test.notEqual(buf2.buffer, buf1.buffer, "should not reference the same backing buffer if previous buffer had size 0"); + test.equal(buf2.byteOffset, 0, "should allocate at byteOffset 0 when using a new slab"); + + buf1 = alloc(1); + test.equal(buf1.buffer, buf2.buffer, "should reference the same backing buffer when allocating a chunk fitting into the slab"); + test.equal(buf1.byteOffset, 8, "should align slices to 32 bit and this allocate at byteOffset 8"); + + var buf3 = alloc(4097); + test.notEqual(buf3.buffer, buf2.buffer, "should not reference the same backing buffer when allocating a buffer larger than half the backing buffer's size"); + + buf2 = alloc(4096); + test.equal(buf2.buffer, buf1.buffer, "should reference the same backing buffer when allocating a buffer smaller or equal than half the backing buffer's size"); + + buf1 = alloc(4096); + test.notEqual(buf1.buffer, buf2.buffer, "should not reference the same backing buffer when the slab is exhausted (initializes new slab)"); + + test.end(); +}); \ No newline at end of file diff --git a/node_modules/@protobufjs/utf8/.npmignore b/node_modules/@protobufjs/utf8/.npmignore new file mode 100644 index 0000000..c3fc82e --- /dev/null +++ b/node_modules/@protobufjs/utf8/.npmignore @@ -0,0 +1,3 @@ +npm-debug.* +node_modules/ +coverage/ diff --git a/node_modules/@protobufjs/utf8/LICENSE b/node_modules/@protobufjs/utf8/LICENSE new file mode 100644 index 0000000..be2b397 --- /dev/null +++ b/node_modules/@protobufjs/utf8/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@protobufjs/utf8/README.md b/node_modules/@protobufjs/utf8/README.md new file mode 100644 index 0000000..c936d9b --- /dev/null +++ b/node_modules/@protobufjs/utf8/README.md @@ -0,0 +1,20 @@ +@protobufjs/utf8 +================ +[![npm](https://img.shields.io/npm/v/@protobufjs/utf8.svg)](https://www.npmjs.com/package/@protobufjs/utf8) + +A minimal UTF8 implementation for number arrays. + +API +--- + +* **utf8.length(string: `string`): `number`**
+ Calculates the UTF8 byte length of a string. + +* **utf8.read(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**
+ Reads UTF8 bytes as a string. + +* **utf8.write(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**
+ Writes a string as UTF8 bytes. + + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/@protobufjs/utf8/index.d.ts b/node_modules/@protobufjs/utf8/index.d.ts new file mode 100644 index 0000000..2f1d0ab --- /dev/null +++ b/node_modules/@protobufjs/utf8/index.d.ts @@ -0,0 +1,24 @@ +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +export function length(string: string): number; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +export function read(buffer: Uint8Array, start: number, end: number): string; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +export function write(string: string, buffer: Uint8Array, offset: number): number; diff --git a/node_modules/@protobufjs/utf8/index.js b/node_modules/@protobufjs/utf8/index.js new file mode 100644 index 0000000..43c5298 --- /dev/null +++ b/node_modules/@protobufjs/utf8/index.js @@ -0,0 +1,105 @@ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; diff --git a/node_modules/@protobufjs/utf8/package.json b/node_modules/@protobufjs/utf8/package.json new file mode 100644 index 0000000..81dc758 --- /dev/null +++ b/node_modules/@protobufjs/utf8/package.json @@ -0,0 +1,54 @@ +{ + "_from": "@protobufjs/utf8@^1.1.0", + "_id": "@protobufjs/utf8@1.1.0", + "_inBundle": false, + "_integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=", + "_location": "/@protobufjs/utf8", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@protobufjs/utf8@^1.1.0", + "name": "@protobufjs/utf8", + "escapedName": "@protobufjs%2futf8", + "scope": "@protobufjs", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "_shasum": "a777360b5b39a1a2e5106f8e858f2fd2d060c570", + "_spec": "@protobufjs/utf8@^1.1.0", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A minimal UTF8 implementation for number arrays.", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/dcodeIO/protobuf.js#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "@protobufjs/utf8", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "test": "tape tests/*.js" + }, + "types": "index.d.ts", + "version": "1.1.0" +} diff --git a/node_modules/@protobufjs/utf8/tests/data/utf8.txt b/node_modules/@protobufjs/utf8/tests/data/utf8.txt new file mode 100644 index 0000000..580b4c4 --- /dev/null +++ b/node_modules/@protobufjs/utf8/tests/data/utf8.txt @@ -0,0 +1,216 @@ +UTF-8 encoded sample plain-text file +‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +Markus Kuhn [ˈmaʳkʊs kuːn] — 2002-07-25 CC BY + + +The ASCII compatible UTF-8 encoding used in this plain-text file +is defined in Unicode, ISO 10646-1, and RFC 2279. + + +Using Unicode/UTF-8, you can write in emails and source code things such as + +Mathematics and sciences: + + ∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ⎧⎡⎛┌─────┐⎞⎤⎫ + ⎪⎢⎜│a²+b³ ⎟⎥⎪ + ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β), ⎪⎢⎜│───── ⎟⎥⎪ + ⎪⎢⎜⎷ c₈ ⎟⎥⎪ + ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⎨⎢⎜ ⎟⎥⎬ + ⎪⎢⎜ ∞ ⎟⎥⎪ + ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫), ⎪⎢⎜ ⎲ ⎟⎥⎪ + ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪ + 2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm ⎩⎣⎝i=1 ⎠⎦⎭ + +Linguistics and dictionaries: + + ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn + Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ] + +APL: + + ((V⍳V)=⍳⍴V)/V←,V ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈ + +Nicer typography in plain text files: + + ╔══════════════════════════════════════════╗ + ║ ║ + ║ • ‘single’ and “double” quotes ║ + ║ ║ + ║ • Curly apostrophes: “We’ve been here” ║ + ║ ║ + ║ • Latin-1 apostrophe and accents: '´` ║ + ║ ║ + ║ • ‚deutsche‘ „Anführungszeichen“ ║ + ║ ║ + ║ • †, ‡, ‰, •, 3–4, —, −5/+5, ™, … ║ + ║ ║ + ║ • ASCII safety test: 1lI|, 0OD, 8B ║ + ║ ╭─────────╮ ║ + ║ • the euro symbol: │ 14.95 € │ ║ + ║ ╰─────────╯ ║ + ╚══════════════════════════════════════════╝ + +Combining characters: + + STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑ + +Greek (in Polytonic): + + The Greek anthem: + + Σὲ γνωρίζω ἀπὸ τὴν κόψη + τοῦ σπαθιοῦ τὴν τρομερή, + σὲ γνωρίζω ἀπὸ τὴν ὄψη + ποὺ μὲ βία μετράει τὴ γῆ. + + ᾿Απ᾿ τὰ κόκκαλα βγαλμένη + τῶν ῾Ελλήνων τὰ ἱερά + καὶ σὰν πρῶτα ἀνδρειωμένη + χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά! + + From a speech of Demosthenes in the 4th century BC: + + Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι, + ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς + λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ + τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿ + εἰς τοῦτο προήκοντα, ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ + πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν + οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι, + οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν + ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον + τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι + γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν + προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους + σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ + τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ + τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς + τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον. + + Δημοσθένους, Γ´ ᾿Ολυνθιακὸς + +Georgian: + + From a Unicode conference invitation: + + გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო + კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს, + ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს + ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი, + ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება + ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში, + ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში. + +Russian: + + From a Unicode conference invitation: + + Зарегистрируйтесь сейчас на Десятую Международную Конференцию по + Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии. + Конференция соберет широкий круг экспертов по вопросам глобального + Интернета и Unicode, локализации и интернационализации, воплощению и + применению Unicode в различных операционных системах и программных + приложениях, шрифтах, верстке и многоязычных компьютерных системах. + +Thai (UCS Level 2): + + Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese + classic 'San Gua'): + + [----------------------------|------------------------] + ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช พระปกเกศกองบู๊กู้ขึ้นใหม่ + สิบสองกษัตริย์ก่อนหน้าแลถัดไป สององค์ไซร้โง่เขลาเบาปัญญา + ทรงนับถือขันทีเป็นที่พึ่ง บ้านเมืองจึงวิปริตเป็นนักหนา + โฮจิ๋นเรียกทัพทั่วหัวเมืองมา หมายจะฆ่ามดชั่วตัวสำคัญ + เหมือนขับไสไล่เสือจากเคหา รับหมาป่าเข้ามาเลยอาสัญ + ฝ่ายอ้องอุ้นยุแยกให้แตกกัน ใช้สาวนั้นเป็นชนวนชื่นชวนใจ + พลันลิฉุยกุยกีกลับก่อเหตุ ช่างอาเพศจริงหนาฟ้าร้องไห้ + ต้องรบราฆ่าฟันจนบรรลัย ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ + + (The above is a two-column text. If combining characters are handled + correctly, the lines of the second column should be aligned with the + | character above.) + +Ethiopian: + + Proverbs in the Amharic language: + + ሰማይ አይታረስ ንጉሥ አይከሰስ። + ብላ ካለኝ እንደአባቴ በቆመጠኝ። + ጌጥ ያለቤቱ ቁምጥና ነው። + ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው። + የአፍ ወለምታ በቅቤ አይታሽም። + አይጥ በበላ ዳዋ ተመታ። + ሲተረጉሙ ይደረግሙ። + ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል። + ድር ቢያብር አንበሳ ያስር። + ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም። + እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም። + የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ። + ሥራ ከመፍታት ልጄን ላፋታት። + ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል። + የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ። + ተንጋሎ ቢተፉ ተመልሶ ባፉ። + ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው። + እግርህን በፍራሽህ ልክ ዘርጋ። + +Runes: + + ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ + + (Old English, which transcribed into Latin reads 'He cwaeth that he + bude thaem lande northweardum with tha Westsae.' and means 'He said + that he lived in the northern land near the Western Sea.') + +Braille: + + ⡌⠁⠧⠑ ⠼⠁⠒ ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌ + + ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞ + ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎ + ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂ + ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙ + ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑ + ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲ + + ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ + + ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹ + ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞ + ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕ + ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹ + ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎ + ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎ + ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳ + ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞ + ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ + + (The first couple of paragraphs of "A Christmas Carol" by Dickens) + +Compact font selection example text: + + ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789 + abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ + –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд + ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა + +Greetings in various languages: + + Hello world, Καλημέρα κόσμε, コンニチハ + +Box drawing alignment tests: █ + ▉ + ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳ + ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳ + ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳ + ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳ + ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎ + ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏ + ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ ▗▄▖▛▀▜ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█ + ▝▀▘▙▄▟ + +Surrogates: + +𠜎 𠜱 𠝹 𠱓 𠱸 𠲖 𠳏 𠳕 𠴕 𠵼 𠵿 𠸎 𠸏 𠹷 𠺝 𠺢 𠻗 𠻹 𠻺 𠼭 𠼮 𠽌 𠾴 𠾼 𠿪 𡁜 𡁯 𡁵 𡁶 𡁻 𡃁 +𡃉 𡇙 𢃇 𢞵 𢫕 𢭃 𢯊 𢱑 𢱕 𢳂 𢴈 𢵌 𢵧 𢺳 𣲷 𤓓 𤶸 𤷪 𥄫 𦉘 𦟌 𦧲 𦧺 𧨾 𨅝 𨈇 𨋢 𨳊 𨳍 𨳒 𩶘 diff --git a/node_modules/@protobufjs/utf8/tests/index.js b/node_modules/@protobufjs/utf8/tests/index.js new file mode 100644 index 0000000..16d169e --- /dev/null +++ b/node_modules/@protobufjs/utf8/tests/index.js @@ -0,0 +1,57 @@ +var tape = require("tape"); + +var utf8 = require(".."); + +var data = require("fs").readFileSync(require.resolve("./data/utf8.txt")), + dataStr = data.toString("utf8"); + +tape.test("utf8", function(test) { + + test.test(test.name + " - length", function(test) { + test.equal(utf8.length(""), 0, "should return a byte length of zero for an empty string"); + + test.equal(utf8.length(dataStr), Buffer.byteLength(dataStr), "should return the same byte length as node buffers"); + + test.end(); + }); + + test.test(test.name + " - read", function(test) { + var comp = utf8.read([], 0, 0); + test.equal(comp, "", "should decode an empty buffer to an empty string"); + + comp = utf8.read(data, 0, data.length); + test.equal(comp, data.toString("utf8"), "should decode to the same byte data as node buffers"); + + var longData = Buffer.concat([data, data, data, data]); + comp = utf8.read(longData, 0, longData.length); + test.equal(comp, longData.toString("utf8"), "should decode to the same byte data as node buffers (long)"); + + var chunkData = new Buffer(data.toString("utf8").substring(0, 8192)); + comp = utf8.read(chunkData, 0, chunkData.length); + test.equal(comp, chunkData.toString("utf8"), "should decode to the same byte data as node buffers (chunk size)"); + + test.end(); + }); + + test.test(test.name + " - write", function(test) { + var buf = new Buffer(0); + test.equal(utf8.write("", buf, 0), 0, "should encode an empty string to an empty buffer"); + + var len = utf8.length(dataStr); + buf = new Buffer(len); + test.equal(utf8.write(dataStr, buf, 0), len, "should encode to exactly " + len + " bytes"); + + test.equal(buf.length, data.length, "should encode to a buffer length equal to that of node buffers"); + + for (var i = 0; i < buf.length; ++i) { + if (buf[i] !== data[i]) { + test.fail("should encode to the same buffer data as node buffers (offset " + i + ")"); + return; + } + } + test.pass("should encode to the same buffer data as node buffers"); + + test.end(); + }); + +}); diff --git a/node_modules/@tensorflow/tfjs-converter/LICENSE b/node_modules/@tensorflow/tfjs-converter/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@tensorflow/tfjs-converter/README.md b/node_modules/@tensorflow/tfjs-converter/README.md new file mode 100644 index 0000000..bef481f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/README.md @@ -0,0 +1,255 @@ +[![Build Status](https://travis-ci.org/tensorflow/tfjs-converter.svg?branch=master)](https://travis-ci.org/tensorflow/tfjs-converter) + +# Getting started + +**TensorFlow.js converter** is an open source library to load a pretrained +TensorFlow [SavedModel](https://www.tensorflow.org/programmers_guide/saved_model#overview_of_saving_and_restoring_models), [Frozen Model](https://www.tensorflow.org/mobile/prepare_models#how_do_you_get_a_model_you_can_use_on_mobile) or [Session Bundle](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/session_bundle/README.md) +into the browser and run inference through [TensorFlow.js](https://js.tensorflow.org). + +(Note: TensorFlow has deprecated session bundle format, please switch to SavedModel.) + +A 2-step process to import your model: + +1. A python pip package to convert a TensorFlow SavedModel/Frozen Model/Session Bundle to a web friendly format. If you already have a converted model, or are using an already hosted model (e.g. MobileNet), skip this step. +2. [Javascript API](./src/executor/tf_model.ts), for loading and running inference. + +## Step 1: Converting a [SavedModel](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md), [Keras h5](https://keras.io/getting-started/faq/#how-can-i-save-a-keras-model), [Session Bundle](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/session_bundle/README.md), [Frozen Model](https://www.tensorflow.org/mobile/prepare_models#how_do_you_get_a_model_you_can_use_on_mobile) or [Tensorflow Hub module](https://www.tensorflow.org/hub/) to a web-friendly format + +1. Install the TensorFlow.js pip package: + +```bash + $ pip install tensorflowjs +``` + +2. Run the converter script provided by the pip package: + +Usage: + +SavedModel example: + +```bash +$ tensorflowjs_converter \ + --input_format=tf_saved_model \ + --output_node_names='MobilenetV1/Predictions/Reshape_1' \ + --saved_model_tags=serve \ + /mobilenet/saved_model \ + /mobilenet/web_model +``` + +Frozen model example: + +```bash +$ tensorflowjs_converter \ + --input_format=tf_frozen_model \ + --output_node_names='MobilenetV1/Predictions/Reshape_1' \ + --saved_model_tags=serve \ + /mobilenet/frozen_model.pb \ + /mobilenet/web_model +``` + +Session bundle model example: + +```bash +$ tensorflowjs_converter \ + --input_format=tf_session_bundle \ + --output_node_names='MobilenetV1/Predictions/Reshape_1' \ + /mobilenet/session_bundle \ + /mobilenet/web_model +``` + +Tensorflow Hub module example: + +```bash +$ tensorflowjs_converter \ + --input_format=tf_hub \ + 'https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/classification/1' \ + /mobilenet/web_model +``` + +Keras h5 model example: + +```bash +$ tensorflowjs_converter \ + --input_format=keras \ + /tmp/my_keras_model.h5 \ + /tmp/my_tfjs_model +``` + + +|Positional Arguments | Description | +|---|---| +|`input_path` | Full path of the saved model directory, session bundle directory, frozen model file or TensorFlow Hub module handle or path.| +|`output_path` | Path for all output artifacts.| + + +| Options | Description +|---|---| +|`--input_format` | The format of input model, use `tf_saved_model` for SavedModel, `tf_frozen_model` for frozen model, `tf_session_bundle` for session bundle, `tf_hub` for TensorFlow Hub module, `tensorflowjs` for TensorFlow.js JSON format, and `keras` for Keras HDF5. | +|`--output_node_names`| The names of the output nodes, separated by commas.| +|`--output_format`| The desired output format. Must be `tensorflowjs` (the default) or `keras`. Not all pairs of input-output formats are supported. Please file a [github issue](https://github.com/tensorflow/tfjs/issues) if your desired input-output pair is not supported.| +|`--saved_model_tags` | Only applicable to SavedModel conversion. Tags of the MetaGraphDef to load, in comma separated format. Defaults to `serve`.| +|`--signature_name` | Only applicable to TensorFlow Hub module conversion, signature to load. Defaults to `default`. See https://www.tensorflow.org/hub/common_signatures/.| +|`--strip_debug_ops` | Strips out TensorFlow debug operations `Print`, `Assert`, `CheckNumerics`. Defaults to `True`.| + + +### Format conversions support table + +| input format | output `tensorflowjs` | output `keras` | +|---|---|---| +|`keras`| :heavy_check_mark: | :x: | +|`tensorflowjs`| :x: | :heavy_check_mark: | +|`tf_frozen_model`| :heavy_check_mark: | :x: | +|`tf_hub`| :heavy_check_mark: | :x: | +|`tf_saved_model`| :heavy_check_mark: | :x: | +|`tf_session_bundle`| :heavy_check_mark: | :x: | + +### Web-friendly format + +The conversion script above produces 3 types of files: + +* `web_model.pb` (the dataflow graph) +* `weights_manifest.json` (weight manifest file) +* `group1-shard\*of\*` (collection of binary weight files) + +For example, here is the MobileNet model converted and served in +following location: + +```html + https://storage.cloud.google.com/tfjs-models/savedmodel/mobilenet_v1_1.0_224/optimized_model.pb + https://storage.cloud.google.com/tfjs-models/savedmodel/mobilenet_v1_1.0_224/weights_manifest.json + https://storage.cloud.google.com/tfjs-models/savedmodel/mobilenet_v1_1.0_224/group1-shard1of5 + ... + https://storage.cloud.google.com/tfjs-models/savedmodel/mobilenet_v1_1.0_224/group1-shard5of5 +``` + +## Step 2: Loading and running in the browser + +1. Install the tfjs-converter npm package + +`yarn add @tensorflow/tfjs-converter` or `npm install @tensorflow/tfjs-converter` + +2. Instantiate the [FrozenModel class](./src/executor/frozen_model.ts) and run inference. + +```typescript +import * as tf from '@tensorflow/tfjs'; +import {loadFrozenModel} from '@tensorflow/tfjs-converter'; + +const MODEL_URL = 'https://.../mobilenet/web_model.pb'; +const WEIGHTS_URL = 'https://.../mobilenet/weights_manifest.json'; + +const model = await loadFrozenModel(MODEL_URL, WEIGHTS_URL); +const cat = document.getElementById('cat'); +model.execute({input: tf.fromPixels(cat)}); +``` + +Check out our working [MobileNet demo](./demo/mobilenet/README.md). + +If your server requests credentials for accessing the model files, you can provide the optional RequestOption param. + +```typescript +const model = await loadFrozenModel(MODEL_URL, WEIGHTS_URL, + {credentials: 'include'}); +``` + +Please see [fetch() documentation](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch) for details. + +## Supported operations + +Currently TensorFlow.js only supports a limited set of TensorFlow Ops. See the +[full list](./docs/supported_ops.md). +If your model uses an unsupported ops, the `tensorflowjs_converter` script will fail and +produce a list of the unsupported ops in your model. Please file issues to let us +know what ops you need support with. + +## Loading the weights only + +If you prefer to load the weights only, you can use follow code snippet. + +```typescript +import * as tf from '@tensorflow/tfjs'; + +const weightManifestUrl = "https://example.org/model/weights_manifest.json"; + +const manifest = await fetch(weightManifestUrl); +this.weightManifest = await manifest.json(); +const weightMap = await tf.io.loadWeights( + this.weightManifest, "https://example.org/model"); +``` + +## FAQ + +1. What TensorFlow models does the converter currently support? + +Image-based models (MobileNet, SqueezeNet, add more if you tested) are the most supported. Models with control flow ops (e.g. RNNs) are not yet supported. The tensorflowjs_converter script will validate the model you have and show a list of unsupported ops in your model. See [this list](./docs/supported_ops.md) for which ops are currently supported. + +2. Will model with large weights work? + +While the browser supports loading 100-500MB models, the page load time, the inference time and the user experience would not be great. We recommend using models that are designed for edge devices (e.g. phones). These models are usually smaller than 30MB. + +3. Will the model and weight files be cached in the browser? + +Yes, we are splitting the weights into files of 4MB chunks, which enable the browser to cache them automatically. If the model architecture is less than 4MB (most models are), it will also be cached. + +4. Will it support model with quantization? + +Not yet. We are planning to add quantization support soon. + +5. Why is the predict() method for inference so much slower on the first call than the subsequent calls? + +The time of first call also includes the compilation time of WebGL shader programs for the model. After the first call the shader programs are cached, which makes the subsequent calls much faster. You can warm up the cache by calling the predict method with an all zero inputs, right after the completion of the model loading. + +## Development + +To build **TensorFlow.js converter** from source, we need to clone the project and prepare +the dev environment: + +```bash +$ git clone https://github.com/tensorflow/tfjs-converter.git +$ cd tfjs-converter +$ yarn # Installs dependencies. +``` + +We recommend using [Visual Studio Code](https://code.visualstudio.com/) for +development. Make sure to install +[TSLint VSCode extension](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) +and the npm [clang-format](https://github.com/angular/clang-format) `1.2.2` or later +with the +[Clang-Format VSCode extension](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format) +for auto-formatting. + +Before submitting a pull request, make sure the code passes all the tests and is clean of lint errors: + +```bash +$ yarn test +$ yarn lint +``` + +To run a subset of tests and/or on a specific browser: + +```bash +$ yarn test --browsers=Chrome --grep='execute' +  +> ... +> Chrome 64.0.3282 (Linux 0.0.0): Executed 39 of 39 SUCCESS (0.129 secs / 0 secs) +``` + +To run the tests once and exit the karma process (helpful on Windows): + +```bash +$ yarn test --single-run +``` + +To generate the static js file for GraphDef proto, run following steps: + +1. Generate static js file with comment first, in order to generate typescript definition. + +```bash +$ node_modules/protobufjs/bin/pbjs -t static-module -w commonjs -o src/data/compiled_api.js --no-create --no-encode --no-verify --no-convert --no-delimited --no-beautify src/data/api.proto + +$ node_modules/protobufjs/bin/pbts -o src/data/compiled_api.d.ts src/data/compiled_api.js +``` + +2. Replace the static js file with the version without comments. +```bash +$ node_modules/protobufjs/bin/pbjs -t static-module -w commonjs -o src/data/compiled_api.js --no-create --no-encode --no-verify --no-convert --no-delimited --no-beautify --no-comments src/data/api.proto +``` diff --git a/node_modules/@tensorflow/tfjs-converter/dist/data/compiled_api.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/data/compiled_api.d.ts new file mode 100644 index 0000000..5455e2f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/data/compiled_api.d.ts @@ -0,0 +1,1617 @@ +import * as $protobuf from "protobufjs"; + +/** Namespace tensorflow. */ +export namespace tensorflow { + + /** Properties of an Any. */ + interface IAny { + + /** Any typeUrl */ + typeUrl?: (string|null); + + /** Any value */ + value?: (Uint8Array|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IAny); + + /** Any typeUrl. */ + public typeUrl: string; + + /** Any value. */ + public value: Uint8Array; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.Any; + } + + /** DataType enum. */ + enum DataType { + DT_INVALID = 0, + DT_FLOAT = 1, + DT_DOUBLE = 2, + DT_INT32 = 3, + DT_UINT8 = 4, + DT_INT16 = 5, + DT_INT8 = 6, + DT_STRING = 7, + DT_COMPLEX64 = 8, + DT_INT64 = 9, + DT_BOOL = 10, + DT_QINT8 = 11, + DT_QUINT8 = 12, + DT_QINT32 = 13, + DT_BFLOAT16 = 14, + DT_FLOAT_REF = 101, + DT_DOUBLE_REF = 102, + DT_INT32_REF = 103, + DT_UINT8_REF = 104, + DT_INT16_REF = 105, + DT_INT8_REF = 106, + DT_STRING_REF = 107, + DT_COMPLEX64_REF = 108, + DT_INT64_REF = 109, + DT_BOOL_REF = 110, + DT_QINT8_REF = 111, + DT_QUINT8_REF = 112, + DT_QINT32_REF = 113, + DT_BFLOAT16_REF = 114 + } + + /** Properties of a TensorShape. */ + interface ITensorShape { + + /** TensorShape dim */ + dim?: (tensorflow.TensorShape.IDim[]|null); + + /** TensorShape unknownRank */ + unknownRank?: (boolean|null); + } + + /** Represents a TensorShape. */ + class TensorShape implements ITensorShape { + + /** + * Constructs a new TensorShape. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.ITensorShape); + + /** TensorShape dim. */ + public dim: tensorflow.TensorShape.IDim[]; + + /** TensorShape unknownRank. */ + public unknownRank: boolean; + + /** + * Decodes a TensorShape message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TensorShape + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.TensorShape; + } + + namespace TensorShape { + + /** Properties of a Dim. */ + interface IDim { + + /** Dim size */ + size?: (number|Long|null); + + /** Dim name */ + name?: (string|null); + } + + /** Represents a Dim. */ + class Dim implements IDim { + + /** + * Constructs a new Dim. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.TensorShape.IDim); + + /** Dim size. */ + public size: (number|Long); + + /** Dim name. */ + public name: string; + + /** + * Decodes a Dim message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Dim + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.TensorShape.Dim; + } + } + + /** Properties of a Tensor. */ + interface ITensor { + + /** Tensor dtype */ + dtype?: (tensorflow.DataType|null); + + /** Tensor tensorShape */ + tensorShape?: (tensorflow.ITensorShape|null); + + /** Tensor versionNumber */ + versionNumber?: (number|null); + + /** Tensor tensorContent */ + tensorContent?: (Uint8Array|null); + + /** Tensor floatVal */ + floatVal?: (number[]|null); + + /** Tensor doubleVal */ + doubleVal?: (number[]|null); + + /** Tensor intVal */ + intVal?: (number[]|null); + + /** Tensor stringVal */ + stringVal?: (Uint8Array[]|null); + + /** Tensor scomplexVal */ + scomplexVal?: (number[]|null); + + /** Tensor int64Val */ + int64Val?: ((number|Long)[]|null); + + /** Tensor boolVal */ + boolVal?: (boolean[]|null); + + /** Tensor uint32Val */ + uint32Val?: (number[]|null); + + /** Tensor uint64Val */ + uint64Val?: ((number|Long)[]|null); + } + + /** Represents a Tensor. */ + class Tensor implements ITensor { + + /** + * Constructs a new Tensor. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.ITensor); + + /** Tensor dtype. */ + public dtype: tensorflow.DataType; + + /** Tensor tensorShape. */ + public tensorShape?: (tensorflow.ITensorShape|null); + + /** Tensor versionNumber. */ + public versionNumber: number; + + /** Tensor tensorContent. */ + public tensorContent: Uint8Array; + + /** Tensor floatVal. */ + public floatVal: number[]; + + /** Tensor doubleVal. */ + public doubleVal: number[]; + + /** Tensor intVal. */ + public intVal: number[]; + + /** Tensor stringVal. */ + public stringVal: Uint8Array[]; + + /** Tensor scomplexVal. */ + public scomplexVal: number[]; + + /** Tensor int64Val. */ + public int64Val: (number|Long)[]; + + /** Tensor boolVal. */ + public boolVal: boolean[]; + + /** Tensor uint32Val. */ + public uint32Val: number[]; + + /** Tensor uint64Val. */ + public uint64Val: (number|Long)[]; + + /** + * Decodes a Tensor message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Tensor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.Tensor; + } + + /** Properties of an AttrValue. */ + interface IAttrValue { + + /** AttrValue list */ + list?: (tensorflow.AttrValue.IListValue|null); + + /** AttrValue s */ + s?: (Uint8Array|null); + + /** AttrValue i */ + i?: (number|Long|null); + + /** AttrValue f */ + f?: (number|null); + + /** AttrValue b */ + b?: (boolean|null); + + /** AttrValue type */ + type?: (tensorflow.DataType|null); + + /** AttrValue shape */ + shape?: (tensorflow.ITensorShape|null); + + /** AttrValue tensor */ + tensor?: (tensorflow.ITensor|null); + + /** AttrValue placeholder */ + placeholder?: (string|null); + + /** AttrValue func */ + func?: (tensorflow.INameAttrList|null); + } + + /** Represents an AttrValue. */ + class AttrValue implements IAttrValue { + + /** + * Constructs a new AttrValue. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IAttrValue); + + /** AttrValue list. */ + public list?: (tensorflow.AttrValue.IListValue|null); + + /** AttrValue s. */ + public s: Uint8Array; + + /** AttrValue i. */ + public i: (number|Long); + + /** AttrValue f. */ + public f: number; + + /** AttrValue b. */ + public b: boolean; + + /** AttrValue type. */ + public type: tensorflow.DataType; + + /** AttrValue shape. */ + public shape?: (tensorflow.ITensorShape|null); + + /** AttrValue tensor. */ + public tensor?: (tensorflow.ITensor|null); + + /** AttrValue placeholder. */ + public placeholder: string; + + /** AttrValue func. */ + public func?: (tensorflow.INameAttrList|null); + + /** AttrValue value. */ + public value?: ("list"|"s"|"i"|"f"|"b"|"type"|"shape"|"tensor"|"placeholder"|"func"); + + /** + * Decodes an AttrValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AttrValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.AttrValue; + } + + namespace AttrValue { + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue s */ + s?: (Uint8Array[]|null); + + /** ListValue i */ + i?: ((number|Long)[]|null); + + /** ListValue f */ + f?: (number[]|null); + + /** ListValue b */ + b?: (boolean[]|null); + + /** ListValue type */ + type?: (tensorflow.DataType[]|null); + + /** ListValue shape */ + shape?: (tensorflow.ITensorShape[]|null); + + /** ListValue tensor */ + tensor?: (tensorflow.ITensor[]|null); + + /** ListValue func */ + func?: (tensorflow.INameAttrList[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.AttrValue.IListValue); + + /** ListValue s. */ + public s: Uint8Array[]; + + /** ListValue i. */ + public i: (number|Long)[]; + + /** ListValue f. */ + public f: number[]; + + /** ListValue b. */ + public b: boolean[]; + + /** ListValue type. */ + public type: tensorflow.DataType[]; + + /** ListValue shape. */ + public shape: tensorflow.ITensorShape[]; + + /** ListValue tensor. */ + public tensor: tensorflow.ITensor[]; + + /** ListValue func. */ + public func: tensorflow.INameAttrList[]; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.AttrValue.ListValue; + } + } + + /** Properties of a NameAttrList. */ + interface INameAttrList { + + /** NameAttrList name */ + name?: (string|null); + + /** NameAttrList attr */ + attr?: ({ [k: string]: tensorflow.IAttrValue }|null); + } + + /** Represents a NameAttrList. */ + class NameAttrList implements INameAttrList { + + /** + * Constructs a new NameAttrList. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.INameAttrList); + + /** NameAttrList name. */ + public name: string; + + /** NameAttrList attr. */ + public attr: { [k: string]: tensorflow.IAttrValue }; + + /** + * Decodes a NameAttrList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NameAttrList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.NameAttrList; + } + + /** Properties of a NodeDef. */ + interface INodeDef { + + /** NodeDef name */ + name?: (string|null); + + /** NodeDef op */ + op?: (string|null); + + /** NodeDef input */ + input?: (string[]|null); + + /** NodeDef device */ + device?: (string|null); + + /** NodeDef attr */ + attr?: ({ [k: string]: tensorflow.IAttrValue }|null); + } + + /** Represents a NodeDef. */ + class NodeDef implements INodeDef { + + /** + * Constructs a new NodeDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.INodeDef); + + /** NodeDef name. */ + public name: string; + + /** NodeDef op. */ + public op: string; + + /** NodeDef input. */ + public input: string[]; + + /** NodeDef device. */ + public device: string; + + /** NodeDef attr. */ + public attr: { [k: string]: tensorflow.IAttrValue }; + + /** + * Decodes a NodeDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.NodeDef; + } + + /** Properties of a VersionDef. */ + interface IVersionDef { + + /** VersionDef producer */ + producer?: (number|null); + + /** VersionDef minConsumer */ + minConsumer?: (number|null); + + /** VersionDef badConsumers */ + badConsumers?: (number[]|null); + } + + /** Represents a VersionDef. */ + class VersionDef implements IVersionDef { + + /** + * Constructs a new VersionDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IVersionDef); + + /** VersionDef producer. */ + public producer: number; + + /** VersionDef minConsumer. */ + public minConsumer: number; + + /** VersionDef badConsumers. */ + public badConsumers: number[]; + + /** + * Decodes a VersionDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns VersionDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.VersionDef; + } + + /** Properties of a GraphDef. */ + interface IGraphDef { + + /** GraphDef node */ + node?: (tensorflow.INodeDef[]|null); + + /** GraphDef versions */ + versions?: (tensorflow.IVersionDef|null); + + /** GraphDef library */ + library?: (tensorflow.IFunctionDefLibrary|null); + } + + /** Represents a GraphDef. */ + class GraphDef implements IGraphDef { + + /** + * Constructs a new GraphDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IGraphDef); + + /** GraphDef node. */ + public node: tensorflow.INodeDef[]; + + /** GraphDef versions. */ + public versions?: (tensorflow.IVersionDef|null); + + /** GraphDef library. */ + public library?: (tensorflow.IFunctionDefLibrary|null); + + /** + * Decodes a GraphDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns GraphDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.GraphDef; + } + + /** Properties of a CollectionDef. */ + interface ICollectionDef { + + /** CollectionDef nodeList */ + nodeList?: (tensorflow.CollectionDef.INodeList|null); + + /** CollectionDef bytesList */ + bytesList?: (tensorflow.CollectionDef.IBytesList|null); + + /** CollectionDef int64List */ + int64List?: (tensorflow.CollectionDef.IInt64List|null); + + /** CollectionDef floatList */ + floatList?: (tensorflow.CollectionDef.IFloatList|null); + + /** CollectionDef anyList */ + anyList?: (tensorflow.CollectionDef.IAnyList|null); + } + + /** Represents a CollectionDef. */ + class CollectionDef implements ICollectionDef { + + /** + * Constructs a new CollectionDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.ICollectionDef); + + /** CollectionDef nodeList. */ + public nodeList?: (tensorflow.CollectionDef.INodeList|null); + + /** CollectionDef bytesList. */ + public bytesList?: (tensorflow.CollectionDef.IBytesList|null); + + /** CollectionDef int64List. */ + public int64List?: (tensorflow.CollectionDef.IInt64List|null); + + /** CollectionDef floatList. */ + public floatList?: (tensorflow.CollectionDef.IFloatList|null); + + /** CollectionDef anyList. */ + public anyList?: (tensorflow.CollectionDef.IAnyList|null); + + /** CollectionDef kind. */ + public kind?: ("nodeList"|"bytesList"|"int64List"|"floatList"|"anyList"); + + /** + * Decodes a CollectionDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CollectionDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.CollectionDef; + } + + namespace CollectionDef { + + /** Properties of a NodeList. */ + interface INodeList { + + /** NodeList value */ + value?: (string[]|null); + } + + /** Represents a NodeList. */ + class NodeList implements INodeList { + + /** + * Constructs a new NodeList. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.CollectionDef.INodeList); + + /** NodeList value. */ + public value: string[]; + + /** + * Decodes a NodeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.CollectionDef.NodeList; + } + + /** Properties of a BytesList. */ + interface IBytesList { + + /** BytesList value */ + value?: (Uint8Array[]|null); + } + + /** Represents a BytesList. */ + class BytesList implements IBytesList { + + /** + * Constructs a new BytesList. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.CollectionDef.IBytesList); + + /** BytesList value. */ + public value: Uint8Array[]; + + /** + * Decodes a BytesList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.CollectionDef.BytesList; + } + + /** Properties of an Int64List. */ + interface IInt64List { + + /** Int64List value */ + value?: ((number|Long)[]|null); + } + + /** Represents an Int64List. */ + class Int64List implements IInt64List { + + /** + * Constructs a new Int64List. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.CollectionDef.IInt64List); + + /** Int64List value. */ + public value: (number|Long)[]; + + /** + * Decodes an Int64List message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64List + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.CollectionDef.Int64List; + } + + /** Properties of a FloatList. */ + interface IFloatList { + + /** FloatList value */ + value?: (number[]|null); + } + + /** Represents a FloatList. */ + class FloatList implements IFloatList { + + /** + * Constructs a new FloatList. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.CollectionDef.IFloatList); + + /** FloatList value. */ + public value: number[]; + + /** + * Decodes a FloatList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.CollectionDef.FloatList; + } + + /** Properties of an AnyList. */ + interface IAnyList { + + /** AnyList value */ + value?: (tensorflow.IAny[]|null); + } + + /** Represents an AnyList. */ + class AnyList implements IAnyList { + + /** + * Constructs a new AnyList. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.CollectionDef.IAnyList); + + /** AnyList value. */ + public value: tensorflow.IAny[]; + + /** + * Decodes an AnyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AnyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.CollectionDef.AnyList; + } + } + + /** Properties of a SaverDef. */ + interface ISaverDef { + + /** SaverDef filenameTensorName */ + filenameTensorName?: (string|null); + + /** SaverDef saveTensorName */ + saveTensorName?: (string|null); + + /** SaverDef restoreOpName */ + restoreOpName?: (string|null); + + /** SaverDef maxToKeep */ + maxToKeep?: (number|null); + + /** SaverDef sharded */ + sharded?: (boolean|null); + + /** SaverDef keepCheckpointEveryNHours */ + keepCheckpointEveryNHours?: (number|null); + + /** SaverDef version */ + version?: (tensorflow.SaverDef.CheckpointFormatVersion|null); + } + + /** Represents a SaverDef. */ + class SaverDef implements ISaverDef { + + /** + * Constructs a new SaverDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.ISaverDef); + + /** SaverDef filenameTensorName. */ + public filenameTensorName: string; + + /** SaverDef saveTensorName. */ + public saveTensorName: string; + + /** SaverDef restoreOpName. */ + public restoreOpName: string; + + /** SaverDef maxToKeep. */ + public maxToKeep: number; + + /** SaverDef sharded. */ + public sharded: boolean; + + /** SaverDef keepCheckpointEveryNHours. */ + public keepCheckpointEveryNHours: number; + + /** SaverDef version. */ + public version: tensorflow.SaverDef.CheckpointFormatVersion; + + /** + * Decodes a SaverDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SaverDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.SaverDef; + } + + namespace SaverDef { + + /** CheckpointFormatVersion enum. */ + enum CheckpointFormatVersion { + LEGACY = 0, + V1 = 1, + V2 = 2 + } + } + + /** Properties of a TensorInfo. */ + interface ITensorInfo { + + /** TensorInfo name */ + name?: (string|null); + + /** TensorInfo cooSparse */ + cooSparse?: (tensorflow.TensorInfo.ICooSparse|null); + + /** TensorInfo dtype */ + dtype?: (tensorflow.DataType|null); + + /** TensorInfo tensorShape */ + tensorShape?: (tensorflow.ITensorShape|null); + } + + /** Represents a TensorInfo. */ + class TensorInfo implements ITensorInfo { + + /** + * Constructs a new TensorInfo. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.ITensorInfo); + + /** TensorInfo name. */ + public name: string; + + /** TensorInfo cooSparse. */ + public cooSparse?: (tensorflow.TensorInfo.ICooSparse|null); + + /** TensorInfo dtype. */ + public dtype: tensorflow.DataType; + + /** TensorInfo tensorShape. */ + public tensorShape?: (tensorflow.ITensorShape|null); + + /** TensorInfo encoding. */ + public encoding?: ("name"|"cooSparse"); + + /** + * Decodes a TensorInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TensorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.TensorInfo; + } + + namespace TensorInfo { + + /** Properties of a CooSparse. */ + interface ICooSparse { + + /** CooSparse valuesTensorName */ + valuesTensorName?: (string|null); + + /** CooSparse indicesTensorName */ + indicesTensorName?: (string|null); + + /** CooSparse denseShapeTensorName */ + denseShapeTensorName?: (string|null); + } + + /** Represents a CooSparse. */ + class CooSparse implements ICooSparse { + + /** + * Constructs a new CooSparse. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.TensorInfo.ICooSparse); + + /** CooSparse valuesTensorName. */ + public valuesTensorName: string; + + /** CooSparse indicesTensorName. */ + public indicesTensorName: string; + + /** CooSparse denseShapeTensorName. */ + public denseShapeTensorName: string; + + /** + * Decodes a CooSparse message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CooSparse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.TensorInfo.CooSparse; + } + } + + /** Properties of a SignatureDef. */ + interface ISignatureDef { + + /** SignatureDef inputs */ + inputs?: ({ [k: string]: tensorflow.ITensorInfo }|null); + + /** SignatureDef outputs */ + outputs?: ({ [k: string]: tensorflow.ITensorInfo }|null); + + /** SignatureDef methodName */ + methodName?: (string|null); + } + + /** Represents a SignatureDef. */ + class SignatureDef implements ISignatureDef { + + /** + * Constructs a new SignatureDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.ISignatureDef); + + /** SignatureDef inputs. */ + public inputs: { [k: string]: tensorflow.ITensorInfo }; + + /** SignatureDef outputs. */ + public outputs: { [k: string]: tensorflow.ITensorInfo }; + + /** SignatureDef methodName. */ + public methodName: string; + + /** + * Decodes a SignatureDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.SignatureDef; + } + + /** Properties of an AssetFileDef. */ + interface IAssetFileDef { + + /** AssetFileDef tensorInfo */ + tensorInfo?: (tensorflow.ITensorInfo|null); + + /** AssetFileDef filename */ + filename?: (string|null); + } + + /** Represents an AssetFileDef. */ + class AssetFileDef implements IAssetFileDef { + + /** + * Constructs a new AssetFileDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IAssetFileDef); + + /** AssetFileDef tensorInfo. */ + public tensorInfo?: (tensorflow.ITensorInfo|null); + + /** AssetFileDef filename. */ + public filename: string; + + /** + * Decodes an AssetFileDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssetFileDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.AssetFileDef; + } + + /** Properties of an OpDef. */ + interface IOpDef { + + /** OpDef name */ + name?: (string|null); + + /** OpDef inputArg */ + inputArg?: (tensorflow.OpDef.IArgDef[]|null); + + /** OpDef outputArg */ + outputArg?: (tensorflow.OpDef.IArgDef[]|null); + + /** OpDef attr */ + attr?: (tensorflow.OpDef.IAttrDef[]|null); + + /** OpDef deprecation */ + deprecation?: (tensorflow.OpDef.IOpDeprecation|null); + + /** OpDef summary */ + summary?: (string|null); + + /** OpDef description */ + description?: (string|null); + + /** OpDef isCommutative */ + isCommutative?: (boolean|null); + + /** OpDef isAggregate */ + isAggregate?: (boolean|null); + + /** OpDef isStateful */ + isStateful?: (boolean|null); + + /** OpDef allowsUninitializedInput */ + allowsUninitializedInput?: (boolean|null); + } + + /** Represents an OpDef. */ + class OpDef implements IOpDef { + + /** + * Constructs a new OpDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IOpDef); + + /** OpDef name. */ + public name: string; + + /** OpDef inputArg. */ + public inputArg: tensorflow.OpDef.IArgDef[]; + + /** OpDef outputArg. */ + public outputArg: tensorflow.OpDef.IArgDef[]; + + /** OpDef attr. */ + public attr: tensorflow.OpDef.IAttrDef[]; + + /** OpDef deprecation. */ + public deprecation?: (tensorflow.OpDef.IOpDeprecation|null); + + /** OpDef summary. */ + public summary: string; + + /** OpDef description. */ + public description: string; + + /** OpDef isCommutative. */ + public isCommutative: boolean; + + /** OpDef isAggregate. */ + public isAggregate: boolean; + + /** OpDef isStateful. */ + public isStateful: boolean; + + /** OpDef allowsUninitializedInput. */ + public allowsUninitializedInput: boolean; + + /** + * Decodes an OpDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns OpDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.OpDef; + } + + namespace OpDef { + + /** Properties of an ArgDef. */ + interface IArgDef { + + /** ArgDef name */ + name?: (string|null); + + /** ArgDef description */ + description?: (string|null); + + /** ArgDef type */ + type?: (tensorflow.DataType|null); + + /** ArgDef typeAttr */ + typeAttr?: (string|null); + + /** ArgDef numberAttr */ + numberAttr?: (string|null); + + /** ArgDef typeListAttr */ + typeListAttr?: (string|null); + + /** ArgDef isRef */ + isRef?: (boolean|null); + } + + /** Represents an ArgDef. */ + class ArgDef implements IArgDef { + + /** + * Constructs a new ArgDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.OpDef.IArgDef); + + /** ArgDef name. */ + public name: string; + + /** ArgDef description. */ + public description: string; + + /** ArgDef type. */ + public type: tensorflow.DataType; + + /** ArgDef typeAttr. */ + public typeAttr: string; + + /** ArgDef numberAttr. */ + public numberAttr: string; + + /** ArgDef typeListAttr. */ + public typeListAttr: string; + + /** ArgDef isRef. */ + public isRef: boolean; + + /** + * Decodes an ArgDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ArgDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.OpDef.ArgDef; + } + + /** Properties of an AttrDef. */ + interface IAttrDef { + + /** AttrDef name */ + name?: (string|null); + + /** AttrDef type */ + type?: (string|null); + + /** AttrDef defaultValue */ + defaultValue?: (tensorflow.IAttrValue|null); + + /** AttrDef description */ + description?: (string|null); + + /** AttrDef hasMinimum */ + hasMinimum?: (boolean|null); + + /** AttrDef minimum */ + minimum?: (number|Long|null); + + /** AttrDef allowedValues */ + allowedValues?: (tensorflow.IAttrValue|null); + } + + /** Represents an AttrDef. */ + class AttrDef implements IAttrDef { + + /** + * Constructs a new AttrDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.OpDef.IAttrDef); + + /** AttrDef name. */ + public name: string; + + /** AttrDef type. */ + public type: string; + + /** AttrDef defaultValue. */ + public defaultValue?: (tensorflow.IAttrValue|null); + + /** AttrDef description. */ + public description: string; + + /** AttrDef hasMinimum. */ + public hasMinimum: boolean; + + /** AttrDef minimum. */ + public minimum: (number|Long); + + /** AttrDef allowedValues. */ + public allowedValues?: (tensorflow.IAttrValue|null); + + /** + * Decodes an AttrDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AttrDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.OpDef.AttrDef; + } + + /** Properties of an OpDeprecation. */ + interface IOpDeprecation { + + /** OpDeprecation version */ + version?: (number|null); + + /** OpDeprecation explanation */ + explanation?: (string|null); + } + + /** Represents an OpDeprecation. */ + class OpDeprecation implements IOpDeprecation { + + /** + * Constructs a new OpDeprecation. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.OpDef.IOpDeprecation); + + /** OpDeprecation version. */ + public version: number; + + /** OpDeprecation explanation. */ + public explanation: string; + + /** + * Decodes an OpDeprecation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns OpDeprecation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.OpDef.OpDeprecation; + } + } + + /** Properties of an OpList. */ + interface IOpList { + + /** OpList op */ + op?: (tensorflow.IOpDef[]|null); + } + + /** Represents an OpList. */ + class OpList implements IOpList { + + /** + * Constructs a new OpList. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IOpList); + + /** OpList op. */ + public op: tensorflow.IOpDef[]; + + /** + * Decodes an OpList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns OpList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.OpList; + } + + /** Properties of a MetaGraphDef. */ + interface IMetaGraphDef { + + /** MetaGraphDef metaInfoDef */ + metaInfoDef?: (tensorflow.MetaGraphDef.IMetaInfoDef|null); + + /** MetaGraphDef graphDef */ + graphDef?: (tensorflow.IGraphDef|null); + + /** MetaGraphDef saverDef */ + saverDef?: (tensorflow.ISaverDef|null); + + /** MetaGraphDef collectionDef */ + collectionDef?: ({ [k: string]: tensorflow.ICollectionDef }|null); + + /** MetaGraphDef signatureDef */ + signatureDef?: ({ [k: string]: tensorflow.ISignatureDef }|null); + + /** MetaGraphDef assetFileDef */ + assetFileDef?: (tensorflow.IAssetFileDef[]|null); + } + + /** Represents a MetaGraphDef. */ + class MetaGraphDef implements IMetaGraphDef { + + /** + * Constructs a new MetaGraphDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IMetaGraphDef); + + /** MetaGraphDef metaInfoDef. */ + public metaInfoDef?: (tensorflow.MetaGraphDef.IMetaInfoDef|null); + + /** MetaGraphDef graphDef. */ + public graphDef?: (tensorflow.IGraphDef|null); + + /** MetaGraphDef saverDef. */ + public saverDef?: (tensorflow.ISaverDef|null); + + /** MetaGraphDef collectionDef. */ + public collectionDef: { [k: string]: tensorflow.ICollectionDef }; + + /** MetaGraphDef signatureDef. */ + public signatureDef: { [k: string]: tensorflow.ISignatureDef }; + + /** MetaGraphDef assetFileDef. */ + public assetFileDef: tensorflow.IAssetFileDef[]; + + /** + * Decodes a MetaGraphDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns MetaGraphDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.MetaGraphDef; + } + + namespace MetaGraphDef { + + /** Properties of a MetaInfoDef. */ + interface IMetaInfoDef { + + /** MetaInfoDef metaGraphVersion */ + metaGraphVersion?: (string|null); + + /** MetaInfoDef strippedOpList */ + strippedOpList?: (tensorflow.IOpList|null); + + /** MetaInfoDef anyInfo */ + anyInfo?: (tensorflow.IAny|null); + + /** MetaInfoDef tags */ + tags?: (string[]|null); + + /** MetaInfoDef tensorflowVersion */ + tensorflowVersion?: (string|null); + + /** MetaInfoDef tensorflowGitVersion */ + tensorflowGitVersion?: (string|null); + } + + /** Represents a MetaInfoDef. */ + class MetaInfoDef implements IMetaInfoDef { + + /** + * Constructs a new MetaInfoDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.MetaGraphDef.IMetaInfoDef); + + /** MetaInfoDef metaGraphVersion. */ + public metaGraphVersion: string; + + /** MetaInfoDef strippedOpList. */ + public strippedOpList?: (tensorflow.IOpList|null); + + /** MetaInfoDef anyInfo. */ + public anyInfo?: (tensorflow.IAny|null); + + /** MetaInfoDef tags. */ + public tags: string[]; + + /** MetaInfoDef tensorflowVersion. */ + public tensorflowVersion: string; + + /** MetaInfoDef tensorflowGitVersion. */ + public tensorflowGitVersion: string; + + /** + * Decodes a MetaInfoDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns MetaInfoDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.MetaGraphDef.MetaInfoDef; + } + } + + /** Properties of a SavedModel. */ + interface ISavedModel { + + /** SavedModel savedModelSchemaVersion */ + savedModelSchemaVersion?: (number|Long|null); + + /** SavedModel metaGraphs */ + metaGraphs?: (tensorflow.IMetaGraphDef[]|null); + } + + /** Represents a SavedModel. */ + class SavedModel implements ISavedModel { + + /** + * Constructs a new SavedModel. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.ISavedModel); + + /** SavedModel savedModelSchemaVersion. */ + public savedModelSchemaVersion: (number|Long); + + /** SavedModel metaGraphs. */ + public metaGraphs: tensorflow.IMetaGraphDef[]; + + /** + * Decodes a SavedModel message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SavedModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.SavedModel; + } + + /** Properties of a FunctionDefLibrary. */ + interface IFunctionDefLibrary { + + /** FunctionDefLibrary function */ + "function"?: (tensorflow.IFunctionDef[]|null); + + /** FunctionDefLibrary gradient */ + gradient?: (tensorflow.IGradientDef[]|null); + } + + /** Represents a FunctionDefLibrary. */ + class FunctionDefLibrary implements IFunctionDefLibrary { + + /** + * Constructs a new FunctionDefLibrary. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IFunctionDefLibrary); + + /** FunctionDefLibrary function. */ + public function: tensorflow.IFunctionDef[]; + + /** FunctionDefLibrary gradient. */ + public gradient: tensorflow.IGradientDef[]; + + /** + * Decodes a FunctionDefLibrary message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FunctionDefLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.FunctionDefLibrary; + } + + /** Properties of a FunctionDef. */ + interface IFunctionDef { + + /** FunctionDef signature */ + signature?: (tensorflow.IOpDef|null); + + /** FunctionDef attr */ + attr?: ({ [k: string]: tensorflow.IAttrValue }|null); + + /** FunctionDef nodeDef */ + nodeDef?: (tensorflow.INodeDef[]|null); + + /** FunctionDef ret */ + ret?: ({ [k: string]: string }|null); + } + + /** Represents a FunctionDef. */ + class FunctionDef implements IFunctionDef { + + /** + * Constructs a new FunctionDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IFunctionDef); + + /** FunctionDef signature. */ + public signature?: (tensorflow.IOpDef|null); + + /** FunctionDef attr. */ + public attr: { [k: string]: tensorflow.IAttrValue }; + + /** FunctionDef nodeDef. */ + public nodeDef: tensorflow.INodeDef[]; + + /** FunctionDef ret. */ + public ret: { [k: string]: string }; + + /** + * Decodes a FunctionDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FunctionDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.FunctionDef; + } + + /** Properties of a GradientDef. */ + interface IGradientDef { + + /** GradientDef functionName */ + functionName?: (string|null); + + /** GradientDef gradientFunc */ + gradientFunc?: (string|null); + } + + /** Represents a GradientDef. */ + class GradientDef implements IGradientDef { + + /** + * Constructs a new GradientDef. + * @param [p] Properties to set + */ + constructor(p?: tensorflow.IGradientDef); + + /** GradientDef functionName. */ + public functionName: string; + + /** GradientDef gradientFunc. */ + public gradientFunc: string; + + /** + * Decodes a GradientDef message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns GradientDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): tensorflow.GradientDef; + } +} diff --git a/node_modules/@tensorflow/tfjs-converter/dist/data/compiled_api.js b/node_modules/@tensorflow/tfjs-converter/dist/data/compiled_api.js new file mode 100644 index 0000000..89e3c9b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/data/compiled_api.js @@ -0,0 +1,1723 @@ +/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/ +"use strict"; + +var $protobuf = require("protobufjs/minimal"); + +var $Reader = $protobuf.Reader, $util = $protobuf.util; + +var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +$root.tensorflow = (function() { + + var tensorflow = {}; + + tensorflow.Any = (function() { + + function Any(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + Any.prototype.typeUrl = ""; + Any.prototype.value = $util.newBuffer([]); + + Any.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.Any(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.typeUrl = r.string(); + break; + case 2: + m.value = r.bytes(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return Any; + })(); + + tensorflow.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DT_INVALID"] = 0; + values[valuesById[1] = "DT_FLOAT"] = 1; + values[valuesById[2] = "DT_DOUBLE"] = 2; + values[valuesById[3] = "DT_INT32"] = 3; + values[valuesById[4] = "DT_UINT8"] = 4; + values[valuesById[5] = "DT_INT16"] = 5; + values[valuesById[6] = "DT_INT8"] = 6; + values[valuesById[7] = "DT_STRING"] = 7; + values[valuesById[8] = "DT_COMPLEX64"] = 8; + values[valuesById[9] = "DT_INT64"] = 9; + values[valuesById[10] = "DT_BOOL"] = 10; + values[valuesById[11] = "DT_QINT8"] = 11; + values[valuesById[12] = "DT_QUINT8"] = 12; + values[valuesById[13] = "DT_QINT32"] = 13; + values[valuesById[14] = "DT_BFLOAT16"] = 14; + values[valuesById[101] = "DT_FLOAT_REF"] = 101; + values[valuesById[102] = "DT_DOUBLE_REF"] = 102; + values[valuesById[103] = "DT_INT32_REF"] = 103; + values[valuesById[104] = "DT_UINT8_REF"] = 104; + values[valuesById[105] = "DT_INT16_REF"] = 105; + values[valuesById[106] = "DT_INT8_REF"] = 106; + values[valuesById[107] = "DT_STRING_REF"] = 107; + values[valuesById[108] = "DT_COMPLEX64_REF"] = 108; + values[valuesById[109] = "DT_INT64_REF"] = 109; + values[valuesById[110] = "DT_BOOL_REF"] = 110; + values[valuesById[111] = "DT_QINT8_REF"] = 111; + values[valuesById[112] = "DT_QUINT8_REF"] = 112; + values[valuesById[113] = "DT_QINT32_REF"] = 113; + values[valuesById[114] = "DT_BFLOAT16_REF"] = 114; + return values; + })(); + + tensorflow.TensorShape = (function() { + + function TensorShape(p) { + this.dim = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + TensorShape.prototype.dim = $util.emptyArray; + TensorShape.prototype.unknownRank = false; + + TensorShape.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.TensorShape(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: + if (!(m.dim && m.dim.length)) + m.dim = []; + m.dim.push($root.tensorflow.TensorShape.Dim.decode(r, r.uint32())); + break; + case 3: + m.unknownRank = r.bool(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + TensorShape.Dim = (function() { + + function Dim(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + Dim.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Dim.prototype.name = ""; + + Dim.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.TensorShape.Dim(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.size = r.int64(); + break; + case 2: + m.name = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return Dim; + })(); + + return TensorShape; + })(); + + tensorflow.Tensor = (function() { + + function Tensor(p) { + this.floatVal = []; + this.doubleVal = []; + this.intVal = []; + this.stringVal = []; + this.scomplexVal = []; + this.int64Val = []; + this.boolVal = []; + this.uint32Val = []; + this.uint64Val = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + Tensor.prototype.dtype = 0; + Tensor.prototype.tensorShape = null; + Tensor.prototype.versionNumber = 0; + Tensor.prototype.tensorContent = $util.newBuffer([]); + Tensor.prototype.floatVal = $util.emptyArray; + Tensor.prototype.doubleVal = $util.emptyArray; + Tensor.prototype.intVal = $util.emptyArray; + Tensor.prototype.stringVal = $util.emptyArray; + Tensor.prototype.scomplexVal = $util.emptyArray; + Tensor.prototype.int64Val = $util.emptyArray; + Tensor.prototype.boolVal = $util.emptyArray; + Tensor.prototype.uint32Val = $util.emptyArray; + Tensor.prototype.uint64Val = $util.emptyArray; + + Tensor.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.Tensor(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.dtype = r.int32(); + break; + case 2: + m.tensorShape = $root.tensorflow.TensorShape.decode(r, r.uint32()); + break; + case 3: + m.versionNumber = r.int32(); + break; + case 4: + m.tensorContent = r.bytes(); + break; + case 5: + if (!(m.floatVal && m.floatVal.length)) + m.floatVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.floatVal.push(r.float()); + } else + m.floatVal.push(r.float()); + break; + case 6: + if (!(m.doubleVal && m.doubleVal.length)) + m.doubleVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.doubleVal.push(r.double()); + } else + m.doubleVal.push(r.double()); + break; + case 7: + if (!(m.intVal && m.intVal.length)) + m.intVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.intVal.push(r.int32()); + } else + m.intVal.push(r.int32()); + break; + case 8: + if (!(m.stringVal && m.stringVal.length)) + m.stringVal = []; + m.stringVal.push(r.bytes()); + break; + case 9: + if (!(m.scomplexVal && m.scomplexVal.length)) + m.scomplexVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.scomplexVal.push(r.float()); + } else + m.scomplexVal.push(r.float()); + break; + case 10: + if (!(m.int64Val && m.int64Val.length)) + m.int64Val = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.int64Val.push(r.int64()); + } else + m.int64Val.push(r.int64()); + break; + case 11: + if (!(m.boolVal && m.boolVal.length)) + m.boolVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.boolVal.push(r.bool()); + } else + m.boolVal.push(r.bool()); + break; + case 16: + if (!(m.uint32Val && m.uint32Val.length)) + m.uint32Val = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.uint32Val.push(r.uint32()); + } else + m.uint32Val.push(r.uint32()); + break; + case 17: + if (!(m.uint64Val && m.uint64Val.length)) + m.uint64Val = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.uint64Val.push(r.uint64()); + } else + m.uint64Val.push(r.uint64()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return Tensor; + })(); + + tensorflow.AttrValue = (function() { + + function AttrValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + AttrValue.prototype.list = null; + AttrValue.prototype.s = $util.newBuffer([]); + AttrValue.prototype.i = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AttrValue.prototype.f = 0; + AttrValue.prototype.b = false; + AttrValue.prototype.type = 0; + AttrValue.prototype.shape = null; + AttrValue.prototype.tensor = null; + AttrValue.prototype.placeholder = ""; + AttrValue.prototype.func = null; + + var $oneOfFields; + + Object.defineProperty(AttrValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["list", "s", "i", "f", "b", "type", "shape", "tensor", "placeholder", "func"]), + set: $util.oneOfSetter($oneOfFields) + }); + + AttrValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.AttrValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.list = $root.tensorflow.AttrValue.ListValue.decode(r, r.uint32()); + break; + case 2: + m.s = r.bytes(); + break; + case 3: + m.i = r.int64(); + break; + case 4: + m.f = r.float(); + break; + case 5: + m.b = r.bool(); + break; + case 6: + m.type = r.int32(); + break; + case 7: + m.shape = $root.tensorflow.TensorShape.decode(r, r.uint32()); + break; + case 8: + m.tensor = $root.tensorflow.Tensor.decode(r, r.uint32()); + break; + case 9: + m.placeholder = r.string(); + break; + case 10: + m.func = $root.tensorflow.NameAttrList.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + AttrValue.ListValue = (function() { + + function ListValue(p) { + this.s = []; + this.i = []; + this.f = []; + this.b = []; + this.type = []; + this.shape = []; + this.tensor = []; + this.func = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + ListValue.prototype.s = $util.emptyArray; + ListValue.prototype.i = $util.emptyArray; + ListValue.prototype.f = $util.emptyArray; + ListValue.prototype.b = $util.emptyArray; + ListValue.prototype.type = $util.emptyArray; + ListValue.prototype.shape = $util.emptyArray; + ListValue.prototype.tensor = $util.emptyArray; + ListValue.prototype.func = $util.emptyArray; + + ListValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.AttrValue.ListValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: + if (!(m.s && m.s.length)) + m.s = []; + m.s.push(r.bytes()); + break; + case 3: + if (!(m.i && m.i.length)) + m.i = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.i.push(r.int64()); + } else + m.i.push(r.int64()); + break; + case 4: + if (!(m.f && m.f.length)) + m.f = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.f.push(r.float()); + } else + m.f.push(r.float()); + break; + case 5: + if (!(m.b && m.b.length)) + m.b = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.b.push(r.bool()); + } else + m.b.push(r.bool()); + break; + case 6: + if (!(m.type && m.type.length)) + m.type = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.type.push(r.int32()); + } else + m.type.push(r.int32()); + break; + case 7: + if (!(m.shape && m.shape.length)) + m.shape = []; + m.shape.push($root.tensorflow.TensorShape.decode(r, r.uint32())); + break; + case 8: + if (!(m.tensor && m.tensor.length)) + m.tensor = []; + m.tensor.push($root.tensorflow.Tensor.decode(r, r.uint32())); + break; + case 9: + if (!(m.func && m.func.length)) + m.func = []; + m.func.push($root.tensorflow.NameAttrList.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return ListValue; + })(); + + return AttrValue; + })(); + + tensorflow.NameAttrList = (function() { + + function NameAttrList(p) { + this.attr = {}; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + NameAttrList.prototype.name = ""; + NameAttrList.prototype.attr = $util.emptyObject; + + NameAttrList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.NameAttrList(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + r.skip().pos++; + if (m.attr === $util.emptyObject) + m.attr = {}; + k = r.string(); + r.pos++; + m.attr[k] = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return NameAttrList; + })(); + + tensorflow.NodeDef = (function() { + + function NodeDef(p) { + this.input = []; + this.attr = {}; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + NodeDef.prototype.name = ""; + NodeDef.prototype.op = ""; + NodeDef.prototype.input = $util.emptyArray; + NodeDef.prototype.device = ""; + NodeDef.prototype.attr = $util.emptyObject; + + NodeDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.NodeDef(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + m.op = r.string(); + break; + case 3: + if (!(m.input && m.input.length)) + m.input = []; + m.input.push(r.string()); + break; + case 4: + m.device = r.string(); + break; + case 5: + r.skip().pos++; + if (m.attr === $util.emptyObject) + m.attr = {}; + k = r.string(); + r.pos++; + m.attr[k] = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return NodeDef; + })(); + + tensorflow.VersionDef = (function() { + + function VersionDef(p) { + this.badConsumers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + VersionDef.prototype.producer = 0; + VersionDef.prototype.minConsumer = 0; + VersionDef.prototype.badConsumers = $util.emptyArray; + + VersionDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.VersionDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.producer = r.int32(); + break; + case 2: + m.minConsumer = r.int32(); + break; + case 3: + if (!(m.badConsumers && m.badConsumers.length)) + m.badConsumers = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.badConsumers.push(r.int32()); + } else + m.badConsumers.push(r.int32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return VersionDef; + })(); + + tensorflow.GraphDef = (function() { + + function GraphDef(p) { + this.node = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + GraphDef.prototype.node = $util.emptyArray; + GraphDef.prototype.versions = null; + GraphDef.prototype.library = null; + + GraphDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.GraphDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.node && m.node.length)) + m.node = []; + m.node.push($root.tensorflow.NodeDef.decode(r, r.uint32())); + break; + case 4: + m.versions = $root.tensorflow.VersionDef.decode(r, r.uint32()); + break; + case 2: + m.library = $root.tensorflow.FunctionDefLibrary.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return GraphDef; + })(); + + tensorflow.CollectionDef = (function() { + + function CollectionDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + CollectionDef.prototype.nodeList = null; + CollectionDef.prototype.bytesList = null; + CollectionDef.prototype.int64List = null; + CollectionDef.prototype.floatList = null; + CollectionDef.prototype.anyList = null; + + var $oneOfFields; + + Object.defineProperty(CollectionDef.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nodeList", "bytesList", "int64List", "floatList", "anyList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + CollectionDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.nodeList = $root.tensorflow.CollectionDef.NodeList.decode(r, r.uint32()); + break; + case 2: + m.bytesList = $root.tensorflow.CollectionDef.BytesList.decode(r, r.uint32()); + break; + case 3: + m.int64List = $root.tensorflow.CollectionDef.Int64List.decode(r, r.uint32()); + break; + case 4: + m.floatList = $root.tensorflow.CollectionDef.FloatList.decode(r, r.uint32()); + break; + case 5: + m.anyList = $root.tensorflow.CollectionDef.AnyList.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + CollectionDef.NodeList = (function() { + + function NodeList(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + NodeList.prototype.value = $util.emptyArray; + + NodeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.NodeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + m.value.push(r.string()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return NodeList; + })(); + + CollectionDef.BytesList = (function() { + + function BytesList(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + BytesList.prototype.value = $util.emptyArray; + + BytesList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.BytesList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + m.value.push(r.bytes()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return BytesList; + })(); + + CollectionDef.Int64List = (function() { + + function Int64List(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + Int64List.prototype.value = $util.emptyArray; + + Int64List.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.Int64List(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.value.push(r.int64()); + } else + m.value.push(r.int64()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return Int64List; + })(); + + CollectionDef.FloatList = (function() { + + function FloatList(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + FloatList.prototype.value = $util.emptyArray; + + FloatList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.FloatList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.value.push(r.float()); + } else + m.value.push(r.float()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return FloatList; + })(); + + CollectionDef.AnyList = (function() { + + function AnyList(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + AnyList.prototype.value = $util.emptyArray; + + AnyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.AnyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + m.value.push($root.tensorflow.Any.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return AnyList; + })(); + + return CollectionDef; + })(); + + tensorflow.SaverDef = (function() { + + function SaverDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + SaverDef.prototype.filenameTensorName = ""; + SaverDef.prototype.saveTensorName = ""; + SaverDef.prototype.restoreOpName = ""; + SaverDef.prototype.maxToKeep = 0; + SaverDef.prototype.sharded = false; + SaverDef.prototype.keepCheckpointEveryNHours = 0; + SaverDef.prototype.version = 0; + + SaverDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.SaverDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.filenameTensorName = r.string(); + break; + case 2: + m.saveTensorName = r.string(); + break; + case 3: + m.restoreOpName = r.string(); + break; + case 4: + m.maxToKeep = r.int32(); + break; + case 5: + m.sharded = r.bool(); + break; + case 6: + m.keepCheckpointEveryNHours = r.float(); + break; + case 7: + m.version = r.int32(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + SaverDef.CheckpointFormatVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LEGACY"] = 0; + values[valuesById[1] = "V1"] = 1; + values[valuesById[2] = "V2"] = 2; + return values; + })(); + + return SaverDef; + })(); + + tensorflow.TensorInfo = (function() { + + function TensorInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + TensorInfo.prototype.name = ""; + TensorInfo.prototype.cooSparse = null; + TensorInfo.prototype.dtype = 0; + TensorInfo.prototype.tensorShape = null; + + var $oneOfFields; + + Object.defineProperty(TensorInfo.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["name", "cooSparse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + TensorInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.TensorInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 4: + m.cooSparse = $root.tensorflow.TensorInfo.CooSparse.decode(r, r.uint32()); + break; + case 2: + m.dtype = r.int32(); + break; + case 3: + m.tensorShape = $root.tensorflow.TensorShape.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + TensorInfo.CooSparse = (function() { + + function CooSparse(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + CooSparse.prototype.valuesTensorName = ""; + CooSparse.prototype.indicesTensorName = ""; + CooSparse.prototype.denseShapeTensorName = ""; + + CooSparse.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.TensorInfo.CooSparse(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.valuesTensorName = r.string(); + break; + case 2: + m.indicesTensorName = r.string(); + break; + case 3: + m.denseShapeTensorName = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return CooSparse; + })(); + + return TensorInfo; + })(); + + tensorflow.SignatureDef = (function() { + + function SignatureDef(p) { + this.inputs = {}; + this.outputs = {}; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + SignatureDef.prototype.inputs = $util.emptyObject; + SignatureDef.prototype.outputs = $util.emptyObject; + SignatureDef.prototype.methodName = ""; + + SignatureDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.SignatureDef(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + r.skip().pos++; + if (m.inputs === $util.emptyObject) + m.inputs = {}; + k = r.string(); + r.pos++; + m.inputs[k] = $root.tensorflow.TensorInfo.decode(r, r.uint32()); + break; + case 2: + r.skip().pos++; + if (m.outputs === $util.emptyObject) + m.outputs = {}; + k = r.string(); + r.pos++; + m.outputs[k] = $root.tensorflow.TensorInfo.decode(r, r.uint32()); + break; + case 3: + m.methodName = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return SignatureDef; + })(); + + tensorflow.AssetFileDef = (function() { + + function AssetFileDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + AssetFileDef.prototype.tensorInfo = null; + AssetFileDef.prototype.filename = ""; + + AssetFileDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.AssetFileDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.tensorInfo = $root.tensorflow.TensorInfo.decode(r, r.uint32()); + break; + case 2: + m.filename = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return AssetFileDef; + })(); + + tensorflow.OpDef = (function() { + + function OpDef(p) { + this.inputArg = []; + this.outputArg = []; + this.attr = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + OpDef.prototype.name = ""; + OpDef.prototype.inputArg = $util.emptyArray; + OpDef.prototype.outputArg = $util.emptyArray; + OpDef.prototype.attr = $util.emptyArray; + OpDef.prototype.deprecation = null; + OpDef.prototype.summary = ""; + OpDef.prototype.description = ""; + OpDef.prototype.isCommutative = false; + OpDef.prototype.isAggregate = false; + OpDef.prototype.isStateful = false; + OpDef.prototype.allowsUninitializedInput = false; + + OpDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + if (!(m.inputArg && m.inputArg.length)) + m.inputArg = []; + m.inputArg.push($root.tensorflow.OpDef.ArgDef.decode(r, r.uint32())); + break; + case 3: + if (!(m.outputArg && m.outputArg.length)) + m.outputArg = []; + m.outputArg.push($root.tensorflow.OpDef.ArgDef.decode(r, r.uint32())); + break; + case 4: + if (!(m.attr && m.attr.length)) + m.attr = []; + m.attr.push($root.tensorflow.OpDef.AttrDef.decode(r, r.uint32())); + break; + case 8: + m.deprecation = $root.tensorflow.OpDef.OpDeprecation.decode(r, r.uint32()); + break; + case 5: + m.summary = r.string(); + break; + case 6: + m.description = r.string(); + break; + case 18: + m.isCommutative = r.bool(); + break; + case 16: + m.isAggregate = r.bool(); + break; + case 17: + m.isStateful = r.bool(); + break; + case 19: + m.allowsUninitializedInput = r.bool(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + OpDef.ArgDef = (function() { + + function ArgDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + ArgDef.prototype.name = ""; + ArgDef.prototype.description = ""; + ArgDef.prototype.type = 0; + ArgDef.prototype.typeAttr = ""; + ArgDef.prototype.numberAttr = ""; + ArgDef.prototype.typeListAttr = ""; + ArgDef.prototype.isRef = false; + + ArgDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpDef.ArgDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + m.description = r.string(); + break; + case 3: + m.type = r.int32(); + break; + case 4: + m.typeAttr = r.string(); + break; + case 5: + m.numberAttr = r.string(); + break; + case 6: + m.typeListAttr = r.string(); + break; + case 16: + m.isRef = r.bool(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return ArgDef; + })(); + + OpDef.AttrDef = (function() { + + function AttrDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + AttrDef.prototype.name = ""; + AttrDef.prototype.type = ""; + AttrDef.prototype.defaultValue = null; + AttrDef.prototype.description = ""; + AttrDef.prototype.hasMinimum = false; + AttrDef.prototype.minimum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AttrDef.prototype.allowedValues = null; + + AttrDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpDef.AttrDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + m.type = r.string(); + break; + case 3: + m.defaultValue = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + case 4: + m.description = r.string(); + break; + case 5: + m.hasMinimum = r.bool(); + break; + case 6: + m.minimum = r.int64(); + break; + case 7: + m.allowedValues = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return AttrDef; + })(); + + OpDef.OpDeprecation = (function() { + + function OpDeprecation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + OpDeprecation.prototype.version = 0; + OpDeprecation.prototype.explanation = ""; + + OpDeprecation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpDef.OpDeprecation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.version = r.int32(); + break; + case 2: + m.explanation = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return OpDeprecation; + })(); + + return OpDef; + })(); + + tensorflow.OpList = (function() { + + function OpList(p) { + this.op = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + OpList.prototype.op = $util.emptyArray; + + OpList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.op && m.op.length)) + m.op = []; + m.op.push($root.tensorflow.OpDef.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return OpList; + })(); + + tensorflow.MetaGraphDef = (function() { + + function MetaGraphDef(p) { + this.collectionDef = {}; + this.signatureDef = {}; + this.assetFileDef = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + MetaGraphDef.prototype.metaInfoDef = null; + MetaGraphDef.prototype.graphDef = null; + MetaGraphDef.prototype.saverDef = null; + MetaGraphDef.prototype.collectionDef = $util.emptyObject; + MetaGraphDef.prototype.signatureDef = $util.emptyObject; + MetaGraphDef.prototype.assetFileDef = $util.emptyArray; + + MetaGraphDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.MetaGraphDef(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.metaInfoDef = $root.tensorflow.MetaGraphDef.MetaInfoDef.decode(r, r.uint32()); + break; + case 2: + m.graphDef = $root.tensorflow.GraphDef.decode(r, r.uint32()); + break; + case 3: + m.saverDef = $root.tensorflow.SaverDef.decode(r, r.uint32()); + break; + case 4: + r.skip().pos++; + if (m.collectionDef === $util.emptyObject) + m.collectionDef = {}; + k = r.string(); + r.pos++; + m.collectionDef[k] = $root.tensorflow.CollectionDef.decode(r, r.uint32()); + break; + case 5: + r.skip().pos++; + if (m.signatureDef === $util.emptyObject) + m.signatureDef = {}; + k = r.string(); + r.pos++; + m.signatureDef[k] = $root.tensorflow.SignatureDef.decode(r, r.uint32()); + break; + case 6: + if (!(m.assetFileDef && m.assetFileDef.length)) + m.assetFileDef = []; + m.assetFileDef.push($root.tensorflow.AssetFileDef.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + MetaGraphDef.MetaInfoDef = (function() { + + function MetaInfoDef(p) { + this.tags = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + MetaInfoDef.prototype.metaGraphVersion = ""; + MetaInfoDef.prototype.strippedOpList = null; + MetaInfoDef.prototype.anyInfo = null; + MetaInfoDef.prototype.tags = $util.emptyArray; + MetaInfoDef.prototype.tensorflowVersion = ""; + MetaInfoDef.prototype.tensorflowGitVersion = ""; + + MetaInfoDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.MetaGraphDef.MetaInfoDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.metaGraphVersion = r.string(); + break; + case 2: + m.strippedOpList = $root.tensorflow.OpList.decode(r, r.uint32()); + break; + case 3: + m.anyInfo = $root.tensorflow.Any.decode(r, r.uint32()); + break; + case 4: + if (!(m.tags && m.tags.length)) + m.tags = []; + m.tags.push(r.string()); + break; + case 5: + m.tensorflowVersion = r.string(); + break; + case 6: + m.tensorflowGitVersion = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return MetaInfoDef; + })(); + + return MetaGraphDef; + })(); + + tensorflow.SavedModel = (function() { + + function SavedModel(p) { + this.metaGraphs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + SavedModel.prototype.savedModelSchemaVersion = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SavedModel.prototype.metaGraphs = $util.emptyArray; + + SavedModel.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.SavedModel(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.savedModelSchemaVersion = r.int64(); + break; + case 2: + if (!(m.metaGraphs && m.metaGraphs.length)) + m.metaGraphs = []; + m.metaGraphs.push($root.tensorflow.MetaGraphDef.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return SavedModel; + })(); + + tensorflow.FunctionDefLibrary = (function() { + + function FunctionDefLibrary(p) { + this["function"] = []; + this.gradient = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + FunctionDefLibrary.prototype["function"] = $util.emptyArray; + FunctionDefLibrary.prototype.gradient = $util.emptyArray; + + FunctionDefLibrary.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.FunctionDefLibrary(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m["function"] && m["function"].length)) + m["function"] = []; + m["function"].push($root.tensorflow.FunctionDef.decode(r, r.uint32())); + break; + case 2: + if (!(m.gradient && m.gradient.length)) + m.gradient = []; + m.gradient.push($root.tensorflow.GradientDef.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return FunctionDefLibrary; + })(); + + tensorflow.FunctionDef = (function() { + + function FunctionDef(p) { + this.attr = {}; + this.nodeDef = []; + this.ret = {}; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + FunctionDef.prototype.signature = null; + FunctionDef.prototype.attr = $util.emptyObject; + FunctionDef.prototype.nodeDef = $util.emptyArray; + FunctionDef.prototype.ret = $util.emptyObject; + + FunctionDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.FunctionDef(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.signature = $root.tensorflow.OpDef.decode(r, r.uint32()); + break; + case 5: + r.skip().pos++; + if (m.attr === $util.emptyObject) + m.attr = {}; + k = r.string(); + r.pos++; + m.attr[k] = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + case 3: + if (!(m.nodeDef && m.nodeDef.length)) + m.nodeDef = []; + m.nodeDef.push($root.tensorflow.NodeDef.decode(r, r.uint32())); + break; + case 4: + r.skip().pos++; + if (m.ret === $util.emptyObject) + m.ret = {}; + k = r.string(); + r.pos++; + m.ret[k] = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return FunctionDef; + })(); + + tensorflow.GradientDef = (function() { + + function GradientDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + GradientDef.prototype.functionName = ""; + GradientDef.prototype.gradientFunc = ""; + + GradientDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.GradientDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.functionName = r.string(); + break; + case 2: + m.gradientFunc = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return GradientDef; + })(); + + return tensorflow; +})(); + +module.exports = $root; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/data/types.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/data/types.d.ts new file mode 100644 index 0000000..5a10e54 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/data/types.d.ts @@ -0,0 +1,16 @@ +import { DataType, Tensor } from '@tensorflow/tfjs-core'; +import { TensorArray } from '../executor/tensor_array'; +export declare type NamedTensorMap = { + [key: string]: Tensor; +}; +export declare type NamedTensorsMap = { + [key: string]: Tensor[]; +}; +export declare type TensorArrayMap = { + [key: number]: TensorArray; +}; +export interface TensorInfo { + name: string; + shape?: number[]; + dtype: DataType; +} diff --git a/node_modules/@tensorflow/tfjs-converter/dist/data/types.js b/node_modules/@tensorflow/tfjs-converter/dist/data/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/data/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/docs/doc_gen.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/docs/doc_gen.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/docs/doc_gen.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/docs/doc_gen.js b/node_modules/@tensorflow/tfjs-converter/dist/docs/doc_gen.js new file mode 100644 index 0000000..322fbc7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/docs/doc_gen.js @@ -0,0 +1,121 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var fs = require("fs"); +var node_fetch_1 = require("node-fetch"); +var arithmetic = require("../operations/op_list/arithmetic.json"); +var basicMath = require("../operations/op_list/basic_math.json"); +var control = require("../operations/op_list/control.json"); +var convolution = require("../operations/op_list/convolution.json"); +var creation = require("../operations/op_list/creation.json"); +var graph = require("../operations/op_list/graph.json"); +var image = require("../operations/op_list/image.json"); +var logical = require("../operations/op_list/logical.json"); +var matrices = require("../operations/op_list/matrices.json"); +var normalization = require("../operations/op_list/normalization.json"); +var reduction = require("../operations/op_list/reduction.json"); +var sliceJoin = require("../operations/op_list/slice_join.json"); +var transformation = require("../operations/op_list/transformation.json"); +var DOC_DIR = './docs/'; +var opMappers = arithmetic.concat(basicMath, control, convolution, creation, logical, image, graph, matrices, normalization, reduction, sliceJoin, transformation); +var GITHUB_URL_PREFIX = 'https://raw.githubusercontent.com/tensorflow/tfjs-website'; +var CORE_API_PREFIX = "/master/source/_data/api/" + tfc.version_core + "/tfjs-core.json"; +function genDoc() { + return __awaiter(this, void 0, void 0, function () { + var response, json, coreApis, output; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4, node_fetch_1.default(GITHUB_URL_PREFIX + CORE_API_PREFIX)]; + case 1: + response = _a.sent(); + return [4, response.json()]; + case 2: + json = _a.sent(); + coreApis = json.docs.headings.reduce(function (list, h) { + return h.subheadings ? list.concat(h.subheadings.reduce(function (sublist, sub) { + return sublist.concat(sub.symbols); + }, [])) : + list; + }, []); + output = []; + output.push('# Supported Tensorflow Ops\n\n'); + generateTable('Operations', 'Arithmetic', arithmetic, output, coreApis); + generateTable('Operations', 'Basic math', basicMath, output, coreApis); + generateTable('Operations', 'Control Flow', control, output, coreApis); + generateTable('Operations', 'Convolution', convolution, output, coreApis); + generateTable('Tensors', 'Creation', creation, output, coreApis); + generateTable('Tensorflow', 'Graph', graph, output, coreApis); + generateTable('Operations', 'Logical', logical, output, coreApis); + generateTable('Operations', 'Matrices', matrices, output, coreApis); + generateTable('Operations', 'Normalization', normalization, output, coreApis); + generateTable('Operations', 'Images', image, output, coreApis); + generateTable('Operations', 'Reduction', reduction, output, coreApis); + generateTable('Tensors', 'Slicing and Joining', sliceJoin, output, coreApis); + generateTable('Tensors', 'Transformations', transformation, output, coreApis); + console.log(process.cwd()); + fs.writeFileSync(DOC_DIR + 'supported_ops.md', output.join('')); + console.log("Supported Ops written to " + (DOC_DIR + 'supported_ops.md') + "\n" + + ("Found " + opMappers.length + " ops\n")); + return [2]; + } + }); + }); +} +function findCoreOps(heading, subHeading, coreApis) { + return coreApis.filter(function (op) { return op.docInfo.heading === heading && + op.docInfo.subheading === subHeading; }); +} +function generateTable(heading, subHeading, ops, output, coreApis) { + var coreOps = findCoreOps(heading, subHeading, coreApis); + output.push("## " + heading + " - " + subHeading + "\n\n"); + output.push('|Tensorflow Op Name|Tensorflow.js Op Name|\n'); + output.push('|---|---|\n'); + ops.sort(function (a, b) { return a.tfOpName.localeCompare(b.tfOpName); }).forEach(function (element) { + output.push("|" + element.tfOpName + "|" + element.dlOpName + "|\n"); + }); + coreOps + .sort(function (a, b) { return a.symbolName.localeCompare(b.symbolName); }) + .forEach(function (element) { + if (!ops.find(function (op) { return op.dlOpName === element.symbolName; })) { + output.push("|Not mapped|" + element.symbolName + "|\n"); + } + }); + output.push('\n\n'); +} +genDoc(); +//# sourceMappingURL=doc_gen.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/executor/execution_context.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/executor/execution_context.d.ts new file mode 100644 index 0000000..5c001e0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/executor/execution_context.d.ts @@ -0,0 +1,29 @@ +import { Tensor } from '@tensorflow/tfjs-core'; +import { NamedTensorsMap, TensorArrayMap } from '../data/types'; +import { TensorArray } from './tensor_array'; +export interface ExecutionContextInfo { + id: number; + frameName: string; + iterationId: number; +} +export declare class ExecutionContext { + readonly weightMap: NamedTensorsMap; + readonly tensorArrayMap: TensorArrayMap; + private rootContext; + private contexts; + private lastId; + private _currentContextIds; + constructor(weightMap: NamedTensorsMap, tensorArrayMap: TensorArrayMap); + private newFrame(id, frameName); + currentContext: ExecutionContextInfo[]; + readonly currentContextId: string; + readonly currentContextIds: string[]; + private generateCurrentContextIds(); + private contextIdforContexts(contexts); + enterFrame(frameId: string): void; + exitFrame(): void; + nextIteration(): void; + getWeight(name: string): Tensor[]; + addTensorArray(tensorArray: TensorArray): void; + getTensorArray(id: number): TensorArray; +} diff --git a/node_modules/@tensorflow/tfjs-converter/dist/executor/execution_context.js b/node_modules/@tensorflow/tfjs-converter/dist/executor/execution_context.js new file mode 100644 index 0000000..5211aa8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/executor/execution_context.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ExecutionContext = (function () { + function ExecutionContext(weightMap, tensorArrayMap) { + this.weightMap = weightMap; + this.tensorArrayMap = tensorArrayMap; + this.rootContext = { id: 0, frameName: '', iterationId: 0 }; + this.contexts = [this.rootContext]; + this.lastId = 0; + this.generateCurrentContextIds(); + } + ExecutionContext.prototype.newFrame = function (id, frameName) { + return { id: id, frameName: frameName, iterationId: 0 }; + }; + Object.defineProperty(ExecutionContext.prototype, "currentContext", { + get: function () { + return this.contexts; + }, + set: function (contexts) { + if (this.contexts !== contexts) { + this.contexts = contexts; + this.generateCurrentContextIds(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ExecutionContext.prototype, "currentContextId", { + get: function () { + return this._currentContextIds[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ExecutionContext.prototype, "currentContextIds", { + get: function () { + return this._currentContextIds; + }, + enumerable: true, + configurable: true + }); + ExecutionContext.prototype.generateCurrentContextIds = function () { + var names = []; + for (var i = 0; i < this.contexts.length - 1; i++) { + var contexts = this.contexts.slice(0, this.contexts.length - i); + names.push(this.contextIdforContexts(contexts)); + } + names.push(''); + this._currentContextIds = names; + }; + ExecutionContext.prototype.contextIdforContexts = function (contexts) { + return contexts ? + contexts + .map(function (context) { return (context.id === 0 && context.iterationId === 0) ? + '' : + context.frameName + "-" + context.iterationId; }) + .join('/') : + ''; + }; + ExecutionContext.prototype.enterFrame = function (frameId) { + if (this.contexts) { + this.lastId++; + this.contexts = this.contexts.slice(); + this.contexts.push(this.newFrame(this.lastId, frameId)); + this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)); + } + }; + ExecutionContext.prototype.exitFrame = function () { + if (this.contexts && this.contexts.length > 1) { + this.contexts = this.contexts.slice(); + this.contexts.splice(-1); + this.currentContextIds.shift(); + } + else { + throw new Error('Cannot exit frame, the context is empty'); + } + }; + ExecutionContext.prototype.nextIteration = function () { + if (this.contexts && this.contexts.length > 0) { + this.contexts = this.contexts.slice(); + this.lastId++; + var context = Object.assign({}, this.contexts[this.contexts.length - 1]); + context.iterationId += 1; + context.id = this.lastId; + this.contexts.splice(-1, 1, context); + this._currentContextIds.splice(0, 1, this.contextIdforContexts(this.contexts)); + } + else { + throw new Error('Cannot increase frame iteration, the context is empty'); + } + }; + ExecutionContext.prototype.getWeight = function (name) { + return this.weightMap[name]; + }; + ExecutionContext.prototype.addTensorArray = function (tensorArray) { + this.tensorArrayMap[tensorArray.id] = tensorArray; + }; + ExecutionContext.prototype.getTensorArray = function (id) { + return this.tensorArrayMap[id]; + }; + return ExecutionContext; +}()); +exports.ExecutionContext = ExecutionContext; +//# sourceMappingURL=execution_context.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/executor/frozen_model.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/executor/frozen_model.d.ts new file mode 100644 index 0000000..b802d01 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/executor/frozen_model.d.ts @@ -0,0 +1,29 @@ +import * as tfc from '@tensorflow/tfjs-core'; +import { NamedTensorsMap, TensorInfo } from '../data/types'; +export declare class FrozenModel implements tfc.InferenceModel { + private modelUrl; + private weightManifestUrl; + private requestOption; + private executor; + private version; + private weightManifest; + private pathPrefix; + readonly modelVersion: string; + readonly inputNodes: string[]; + readonly outputNodes: string[]; + readonly inputs: TensorInfo[]; + readonly outputs: TensorInfo[]; + readonly weights: NamedTensorsMap; + constructor(modelUrl: string, weightManifestUrl: string, requestOption?: RequestInit); + getPathPrefix(): string; + private loadRemoteProtoFile(); + private loadWeightManifest(); + load(): Promise; + predict(inputs: tfc.Tensor | tfc.Tensor[] | tfc.NamedTensorMap, config?: tfc.ModelPredictConfig): tfc.Tensor | tfc.Tensor[] | tfc.NamedTensorMap; + private constructTensorMap(inputs); + execute(inputs: tfc.Tensor | tfc.Tensor[] | tfc.NamedTensorMap, outputs?: string | string[]): tfc.Tensor | tfc.Tensor[]; + executeAsync(inputs: tfc.Tensor | tfc.Tensor[] | tfc.NamedTensorMap, outputs?: string | string[]): Promise; + private convertTensorMapToTensorsMap(map); + dispose(): void; +} +export declare function loadFrozenModel(modelUrl: string, weightsManifestUrl: string, requestOption?: RequestInit): Promise; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/executor/frozen_model.js b/node_modules/@tensorflow/tfjs-converter/dist/executor/frozen_model.js new file mode 100644 index 0000000..6564c4a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/executor/frozen_model.js @@ -0,0 +1,252 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var Url = require("url"); +var compiled_api_1 = require("../data/compiled_api"); +var operation_mapper_1 = require("../operations/operation_mapper"); +var graph_executor_1 = require("./graph_executor"); +var FrozenModel = (function () { + function FrozenModel(modelUrl, weightManifestUrl, requestOption) { + this.modelUrl = modelUrl; + this.weightManifestUrl = weightManifestUrl; + this.requestOption = requestOption; + this.version = 'n/a'; + this.pathPrefix = this.getPathPrefix(); + } + Object.defineProperty(FrozenModel.prototype, "modelVersion", { + get: function () { + return this.version; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "inputNodes", { + get: function () { + return this.executor.inputNodes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "outputNodes", { + get: function () { + return this.executor.outputNodes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "inputs", { + get: function () { + return this.executor.inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "outputs", { + get: function () { + return this.executor.outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "weights", { + get: function () { + return this.executor.weightMap; + }, + enumerable: true, + configurable: true + }); + FrozenModel.prototype.getPathPrefix = function () { + var url = Url.parse(this.weightManifestUrl); + var segments = url.pathname.split('/'); + segments.splice(-1); + url.pathname = segments.join('/'); + return Url.format(url) + '/'; + }; + FrozenModel.prototype.loadRemoteProtoFile = function () { + return __awaiter(this, void 0, void 0, function () { + var response, _a, _b, _c, error_1; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + _d.trys.push([0, 3, , 4]); + return [4, fetch(this.modelUrl, this.requestOption)]; + case 1: + response = _d.sent(); + _b = (_a = compiled_api_1.tensorflow.GraphDef).decode; + _c = Uint8Array.bind; + return [4, response.arrayBuffer()]; + case 2: return [2, _b.apply(_a, [new (_c.apply(Uint8Array, [void 0, _d.sent()]))()])]; + case 3: + error_1 = _d.sent(); + throw new Error(this.modelUrl + " not found. " + error_1); + case 4: return [2]; + } + }); + }); + }; + FrozenModel.prototype.loadWeightManifest = function () { + return __awaiter(this, void 0, void 0, function () { + var manifest, _a, error_2; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 3, , 4]); + return [4, fetch(this.weightManifestUrl, this.requestOption)]; + case 1: + manifest = _b.sent(); + _a = this; + return [4, manifest.clone().json()]; + case 2: + _a.weightManifest = _b.sent(); + return [3, 4]; + case 3: + error_2 = _b.sent(); + throw new Error(this.weightManifestUrl + " not found. " + error_2); + case 4: return [2]; + } + }); + }); + }; + FrozenModel.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var graphPromise, manifestPromise, graph, weightMap; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + graphPromise = this.loadRemoteProtoFile(); + manifestPromise = this.loadWeightManifest(); + return [4, Promise.all([graphPromise, manifestPromise])]; + case 1: + graph = (_a.sent())[0]; + this.version = graph.versions.producer + "." + graph.versions.minConsumer; + return [4, tfc.io.loadWeights(this.weightManifest, this.pathPrefix, undefined, this.requestOption)]; + case 2: + weightMap = _a.sent(); + this.executor = + new graph_executor_1.GraphExecutor(operation_mapper_1.OperationMapper.Instance.transformGraph(graph)); + this.executor.weightMap = this.convertTensorMapToTensorsMap(weightMap); + return [2, true]; + } + }); + }); + }; + FrozenModel.prototype.predict = function (inputs, config) { + return this.execute(inputs, this.outputNodes); + }; + FrozenModel.prototype.constructTensorMap = function (inputs) { + var inputArray = inputs instanceof tfc.Tensor ? [inputs] : inputs; + if (inputArray.length !== this.inputNodes.length) { + throw new Error('Input tensor count mismatch,' + + ("the frozen model has " + this.inputNodes.length + " placeholders, ") + + ("while there are " + inputArray.length + " input tensors.")); + } + return this.inputNodes.reduce(function (map, inputName, i) { + map[inputName] = inputArray[i]; + return map; + }, {}); + }; + FrozenModel.prototype.execute = function (inputs, outputs) { + outputs = outputs || this.outputNodes; + if (inputs instanceof tfc.Tensor || Array.isArray(inputs)) { + inputs = this.constructTensorMap(inputs); + } + if (this.executor.isControlFlowModel || this.executor.isDynamicShapeModel) { + throw new Error('The model contains control flow or dynamic shape ops, ' + + 'please use executeAsync method'); + } + var result = this.executor.execute(this.convertTensorMapToTensorsMap(inputs), outputs); + var keys = Object.keys(result); + return (Array.isArray(outputs) && outputs.length > 1) ? + outputs.map(function (node) { return result[node]; }) : + result[keys[0]]; + }; + FrozenModel.prototype.executeAsync = function (inputs, outputs) { + return __awaiter(this, void 0, void 0, function () { + var result, keys; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.executor.isControlFlowModel && + this.executor.isDynamicShapeModel)) { + throw new Error('The model does not contain control flow or dynamic shape ops, ' + + 'please use execute method for better performance.'); + } + outputs = outputs || this.outputNodes; + if (inputs instanceof tfc.Tensor || Array.isArray(inputs)) { + inputs = this.constructTensorMap(inputs); + } + return [4, this.executor.executeAsync(this.convertTensorMapToTensorsMap(inputs), outputs)]; + case 1: + result = _a.sent(); + keys = Object.keys(result); + return [2, Array.isArray(outputs) && outputs.length > 1 ? + outputs.map(function (node) { return result[node]; }) : + result[keys[0]]]; + } + }); + }); + }; + FrozenModel.prototype.convertTensorMapToTensorsMap = function (map) { + return Object.keys(map).reduce(function (newMap, key) { + newMap[key] = [map[key]]; + return newMap; + }, {}); + }; + FrozenModel.prototype.dispose = function () { + this.executor.dispose(); + }; + return FrozenModel; +}()); +exports.FrozenModel = FrozenModel; +function loadFrozenModel(modelUrl, weightsManifestUrl, requestOption) { + return __awaiter(this, void 0, void 0, function () { + var model; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + model = new FrozenModel(modelUrl, weightsManifestUrl, requestOption); + return [4, model.load()]; + case 1: + _a.sent(); + return [2, model]; + } + }); + }); +} +exports.loadFrozenModel = loadFrozenModel; +//# sourceMappingURL=frozen_model.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/executor/graph_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/executor/graph_executor.d.ts new file mode 100644 index 0000000..a6fe4b0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/executor/graph_executor.d.ts @@ -0,0 +1,26 @@ +import { NamedTensorMap, NamedTensorsMap, TensorInfo } from '../data/types'; +import { Graph } from '../operations/types'; +export declare class GraphExecutor { + private graph; + private compiledOrder; + private _weightMap; + private weightIds; + private placeholders; + private _outputs; + weightMap: NamedTensorsMap; + readonly inputs: TensorInfo[]; + readonly outputs: TensorInfo[]; + readonly inputNodes: string[]; + readonly outputNodes: string[]; + constructor(graph: Graph); + readonly isControlFlowModel: boolean; + readonly isDynamicShapeModel: boolean; + private compile(); + execute(inputs: NamedTensorsMap, outputs?: string | string[]): NamedTensorMap; + executeAsync(inputs: NamedTensorsMap, outputs?: string | string[]): Promise; + private executeWithControlFlow(inputs, context); + private findOutputs(tensorMap, context, outputs?); + dispose(): void; + private checkInputShapeAndType(inputs); + private checkInput(inputs); +} diff --git a/node_modules/@tensorflow/tfjs-converter/dist/executor/graph_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/executor/graph_executor.js new file mode 100644 index 0000000..da7faa2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/executor/graph_executor.js @@ -0,0 +1,307 @@ +"use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var utils_1 = require("../operations/executors/utils"); +var operation_executor_1 = require("../operations/operation_executor"); +var execution_context_1 = require("./execution_context"); +var GraphExecutor = (function () { + function GraphExecutor(graph) { + this.graph = graph; + this.compiledOrder = []; + this._weightMap = {}; + this.placeholders = graph.placeholders; + this._outputs = graph.outputs; + this.compile(); + } + Object.defineProperty(GraphExecutor.prototype, "weightMap", { + get: function () { + return this._weightMap; + }, + set: function (weightMap) { + var weightIds = Object.keys(weightMap).map(function (key) { return weightMap[key].map(function (tensor) { return tensor.id; }); }); + this.weightIds = [].concat.apply([], weightIds); + this._weightMap = weightMap; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "inputs", { + get: function () { + return this.placeholders.map(function (node) { + return { + name: node.name, + shape: node.params['shape'] ? node.params['shape'].value : + undefined, + dtype: node.params['dtype'] ? node.params['dtype'].value : + undefined + }; + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "outputs", { + get: function () { + return this._outputs.map(function (node) { + return { + name: node.name, + shape: node.params['shape'] ? node.params['shape'].value : + undefined, + dtype: node.params['dtype'] ? node.params['dtype'].value : + undefined + }; + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "inputNodes", { + get: function () { + return this.placeholders.map(function (node) { return node.name; }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "outputNodes", { + get: function () { + return this.outputs.map(function (node) { return node.name; }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "isControlFlowModel", { + get: function () { + return this.graph.withControlFlow; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "isDynamicShapeModel", { + get: function () { + return this.graph.withDynamicShape; + }, + enumerable: true, + configurable: true + }); + GraphExecutor.prototype.compile = function () { + if (this.graph.withControlFlow || this.graph.withDynamicShape) { + return; + } + var stack = this.graph.inputs.slice(); + var visited = {}; + while (stack.length > 0) { + var node = stack.pop(); + visited[node.name] = true; + this.compiledOrder.push(node); + node.children.forEach(function (childNode) { + if (!visited[childNode.name] && childNode.inputNames.every(function (name) { + var nodeName = utils_1.getNodeNameAndIndex(name)[0]; + return visited[nodeName]; + })) { + stack.push(childNode); + } + }); + } + }; + GraphExecutor.prototype.execute = function (inputs, outputs) { + var _this = this; + this.checkInput(inputs); + this.checkInputShapeAndType(inputs); + var tensorArrayMap = {}; + var result = tfjs_core_1.tidy(function () { + var context = new execution_context_1.ExecutionContext(_this._weightMap, tensorArrayMap); + var tensors = _this.compiledOrder.reduce(function (map, node) { + map[node.name] = operation_executor_1.executeOp(node, map, context); + return map; + }, __assign({}, _this.weightMap, inputs)); + return _this.findOutputs(tensors, context, outputs); + }); + return result; + }; + GraphExecutor.prototype.executeAsync = function (inputs, outputs) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var tensorArrayMap, context, tensors, results, outputIds, inputIdArray, inputIds; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.checkInput(inputs); + this.checkInputShapeAndType(inputs); + tensorArrayMap = {}; + context = new execution_context_1.ExecutionContext(this._weightMap, tensorArrayMap); + return [4, this.executeWithControlFlow(inputs, context)]; + case 1: + tensors = _a.sent(); + results = this.findOutputs(tensors, context, outputs); + outputIds = Object.keys(results).map(function (key) { return results[key].id; }); + inputIdArray = Object.keys(inputs).map(function (key) { return inputs[key].map(function (input) { return input.id; }); }); + inputIds = [].concat.apply([], inputIdArray); + Object.keys(tensors).forEach(function (key) { + var tensorArray = tensors[key]; + tensorArray.forEach(function (tensor) { + if (tensor && outputIds.indexOf(tensor.id) === -1 && + inputIds.indexOf(tensor.id) === -1 && + _this.weightIds.indexOf(tensor.id) === -1) { + tensor.dispose(); + } + }); + }); + return [2, results]; + } + }); + }); + }; + GraphExecutor.prototype.executeWithControlFlow = function (inputs, context) { + return __awaiter(this, void 0, void 0, function () { + var stack, tensorMap, added, item, nodeName, tensors, _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + stack = this.graph.inputs.map(function (node) { + return { node: node, contexts: context.currentContext }; + }); + tensorMap = __assign({}, this.weightMap, inputs); + added = {}; + _c.label = 1; + case 1: + if (!(stack.length > 0)) return [3, 3]; + item = stack.pop(); + context.currentContext = item.contexts; + nodeName = ''; + if (item.node.op === 'enter' && + utils_1.getParamValue('isConstant', item.node, tensorMap, context)) { + nodeName = utils_1.getNodeNameAndIndex(item.node.name, context)[0]; + } + tensors = operation_executor_1.executeOp(item.node, tensorMap, context); + if (!nodeName) { + nodeName = utils_1.getNodeNameAndIndex(item.node.name, context)[0]; + } + _a = tensorMap; + _b = nodeName; + return [4, tensors]; + case 2: + _a[_b] = _c.sent(); + item.node.children.forEach(function (childNode) { + var nodeName = utils_1.getNodeNameAndIndex(childNode.name, context)[0]; + if (!added[nodeName]) { + if (childNode.op === 'merge') { + if (childNode.inputNames.some(function (name) { + return !!utils_1.getTensor(name, tensorMap, context); + })) { + added[nodeName] = true; + stack.push({ contexts: context.currentContext, node: childNode }); + } + } + else if (childNode.inputNames.every(function (name) { + return !!utils_1.getTensor(name, tensorMap, context); + })) { + added[nodeName] = true; + stack.push({ contexts: context.currentContext, node: childNode }); + } + } + }); + return [3, 1]; + case 3: return [2, tensorMap]; + } + }); + }); + }; + GraphExecutor.prototype.findOutputs = function (tensorMap, context, outputs) { + if (outputs && !(outputs instanceof Array)) { + outputs = [outputs]; + } + var requestedOutputs = (outputs || this.graph.outputs.map(function (node) { return node.name; })); + return requestedOutputs.reduce(function (map, name) { + map[name] = utils_1.getTensor(name, tensorMap, context); + return map; + }, {}); + }; + GraphExecutor.prototype.dispose = function () { + var _this = this; + Object.keys(this.weightMap) + .forEach(function (key) { return _this.weightMap[key].forEach(function (tensor) { return tensor.dispose(); }); }); + }; + GraphExecutor.prototype.checkInputShapeAndType = function (inputs) { + this.placeholders.forEach(function (node) { + var input = inputs[node.name][0]; + if (node.params['shape'] && node.params['shape'].value) { + var shape_1 = node.params['shape'].value; + var match = shape_1.length === input.shape.length && + input.shape.every(function (dim, index) { return shape_1[index] === -1 || shape_1[index] === dim; }); + tfjs_core_1.util.assert(match, "The shape of dict['" + node.name + "'] provided in model.execute(dict) must be [" + shape_1 + "], but was [" + input.shape + "]"); + } + if (node.params['dtype'] && node.params['dtype'].value) { + tfjs_core_1.util.assert(input.dtype === node.params['dtype'].value, "The dtype of dict['" + node.name + "'] provided in model.execute(dict) must be " + node.params['dtype'].value + ", but was " + input.dtype); + } + }); + }; + GraphExecutor.prototype.checkInput = function (inputs) { + var _this = this; + var inputKeys = Object.keys(inputs); + var missing = []; + var extra = []; + this.inputNodes.forEach(function (name) { + if (inputKeys.indexOf(name) === -1) + missing.push(name); + }); + inputKeys.forEach(function (name) { + if (_this.inputNodes.indexOf(name) === -1) + extra.push(name); + }); + if (missing.length > 0) { + throw new Error("The dict provided in model.execute(dict) has the keys " + + ("[" + inputKeys + "], but is missing the required keys: [" + missing + "].")); + } + if (extra.length > 0) { + throw new Error("The dict provided in model.execute(dict) has " + + ("unused keys: [" + extra + "]. Please provide only the following keys: ") + + ("[" + this.inputNodes + "].")); + } + }; + return GraphExecutor; +}()); +exports.GraphExecutor = GraphExecutor; +//# sourceMappingURL=graph_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/executor/tensor_array.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/executor/tensor_array.d.ts new file mode 100644 index 0000000..a1542a2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/executor/tensor_array.d.ts @@ -0,0 +1,32 @@ +import { DataType, Tensor } from '@tensorflow/tfjs-core'; +export interface TensorWithState { + tensor?: Tensor; + written?: boolean; + read?: boolean; + cleared?: boolean; +} +export declare class TensorArray { + readonly name: string; + readonly dtype: DataType; + private maxSize; + private elementShape; + readonly identicalElementShapes: boolean; + readonly dynamicSize: boolean; + readonly clearAfterRead: boolean; + private static nextId; + private tensors; + private closed_; + readonly id: number; + constructor(name: string, dtype: DataType, maxSize: number, elementShape: number[], identicalElementShapes: boolean, dynamicSize: boolean, clearAfterRead: boolean); + readonly closed: boolean; + clearAndClose(): void; + size(): number; + read(index: number): Tensor; + readMany(indices: number[]): Tensor[]; + write(index: number, tensor: Tensor): void; + writeMany(indices: number[], tensors: Tensor[]): void; + gather(indices?: number[], dtype?: DataType): Tensor; + concat(dtype?: DataType): Tensor; + scatter(indices: number[], tensor: Tensor): void; + split(length: number[], tensor: Tensor): void; +} diff --git a/node_modules/@tensorflow/tfjs-converter/dist/executor/tensor_array.js b/node_modules/@tensorflow/tfjs-converter/dist/executor/tensor_array.js new file mode 100644 index 0000000..8c77d1b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/executor/tensor_array.js @@ -0,0 +1,171 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var TensorArray = (function () { + function TensorArray(name, dtype, maxSize, elementShape, identicalElementShapes, dynamicSize, clearAfterRead) { + this.name = name; + this.dtype = dtype; + this.maxSize = maxSize; + this.elementShape = elementShape; + this.identicalElementShapes = identicalElementShapes; + this.dynamicSize = dynamicSize; + this.clearAfterRead = clearAfterRead; + this.tensors = []; + this.closed_ = false; + this.id = TensorArray.nextId++; + } + Object.defineProperty(TensorArray.prototype, "closed", { + get: function () { + return this.closed_; + }, + enumerable: true, + configurable: true + }); + TensorArray.prototype.clearAndClose = function () { + this.tensors.forEach(function (tensor) { return tensor.tensor.dispose(); }); + this.tensors = []; + this.closed_ = true; + }; + TensorArray.prototype.size = function () { + return this.tensors.length; + }; + TensorArray.prototype.read = function (index) { + if (this.closed_) { + throw new Error("TensorArray " + this.name + " has already been closed."); + } + if (index < 0 || index >= this.tensors.length) { + throw new Error("Tried to read from index " + index + ", but array size is: " + this.tensors.length); + } + var tensorWithState = this.tensors[index]; + if (tensorWithState.cleared) { + throw new Error("TensorArray " + this.name + ": Could not read index " + index + " twice because it was cleared after a previous read " + + "(perhaps try setting clear_after_read = false?)."); + } + if (this.clearAfterRead) { + tensorWithState.cleared = true; + } + tensorWithState.read = true; + return tensorWithState.tensor; + }; + TensorArray.prototype.readMany = function (indices) { + var _this = this; + return indices.map(function (index) { return _this.read(index); }); + }; + TensorArray.prototype.write = function (index, tensor) { + if (this.closed_) { + throw new Error("TensorArray " + this.name + " has already been closed."); + } + if (index < 0 || !this.dynamicSize && index >= this.maxSize) { + throw new Error("Tried to write to index " + index + ", but array is not resizeable and size is: " + this.maxSize); + } + var t = this.tensors[index] || {}; + if (tensor.dtype !== this.dtype) { + throw new Error("TensorArray " + this.name + ": Could not write to TensorArray index " + index + ",\n because the value dtype is " + tensor.dtype + ", but TensorArray dtype is " + this.dtype + "."); + } + if (this.size() === 0 && this.elementShape.length === 0) { + this.elementShape = tensor.shape; + } + tfjs_core_1.util.assertShapesMatch(this.elementShape, tensor.shape, "TensorArray " + this.name + ": Could not write to TensorArray index " + index + "."); + if (t && t.read) { + throw new Error("TensorArray " + this.name + ": Could not write to TensorArray index " + index + ", because it has already been read."); + } + if (t && t.written) { + throw new Error("TensorArray " + this.name + ": Could not write to TensorArray index " + index + ", because it has already been written."); + } + t.tensor = tensor; + t.written = true; + this.tensors[index] = t; + }; + TensorArray.prototype.writeMany = function (indices, tensors) { + var _this = this; + if (indices.length !== tensors.length) { + throw new Error("TensorArray " + this.name + ": could not write multiple tensors," + + ("because the index size: " + indices.length + " is not the same as tensors size: " + tensors.length + ".")); + } + indices.map(function (i, index) { return _this.write(i, tensors[index]); }); + }; + TensorArray.prototype.gather = function (indices, dtype) { + if (!!dtype && dtype !== this.dtype) { + throw new Error("TensorArray dtype is " + this.dtype + " but gather requested dtype " + dtype); + } + if (!indices) { + indices = []; + for (var i = 0; i < this.size(); i++) { + indices.push(i); + } + } + if (indices.length === 0) { + return tfjs_core_1.tensor([], [0].concat(this.elementShape)); + } + var tensors = this.readMany(indices); + tfjs_core_1.util.assertShapesMatch(this.elementShape, tensors[0].shape, 'TensorArray shape mismatch: '); + return tfjs_core_1.stack(tensors, 0); + }; + TensorArray.prototype.concat = function (dtype) { + if (!!dtype && dtype !== this.dtype) { + throw new Error("TensorArray dtype is " + this.dtype + " but concat requested dtype " + dtype); + } + if (this.size() === 0) { + return tfjs_core_1.tensor([], [0].concat(this.elementShape)); + } + var indices = []; + for (var i = 0; i < this.size(); i++) { + indices.push(i); + } + var tensors = this.readMany(indices); + tfjs_core_1.util.assertShapesMatch(this.elementShape, tensors[0].shape, "TensorArray shape mismatch: tensor array shape (" + this.elementShape + ") vs first tensor shape (" + tensors[0].shape + ")"); + return tfjs_core_1.concat(tensors, 0); + }; + TensorArray.prototype.scatter = function (indices, tensor) { + if (tensor.dtype !== this.dtype) { + throw new Error("TensorArray dtype is " + this.dtype + " but tensor has dtype " + tensor.dtype); + } + if (indices.length !== tensor.shape[0]) { + throw new Error("Expected len(indices) == tensor.shape[0], but saw: " + indices.length + " vs. " + tensor.shape[0]); + } + var maxIndex = Math.max.apply(Math, indices); + if (!this.dynamicSize && maxIndex >= this.maxSize) { + throw new Error("Max index must be < array size (" + maxIndex + " vs. " + this.maxSize + ")"); + } + this.writeMany(indices, tfjs_core_1.unstack(tensor, 0)); + }; + TensorArray.prototype.split = function (length, tensor) { + var _this = this; + if (tensor.dtype !== this.dtype) { + throw new Error("TensorArray dtype is " + this.dtype + " but tensor has dtype " + tensor.dtype); + } + var totalLength = 0; + var cumulativeLengths = length.map(function (len) { + totalLength += len; + return totalLength; + }); + if (totalLength !== tensor.shape[0]) { + throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n " + totalLength + ", and tensor's shape is: " + tensor.shape); + } + if (!this.dynamicSize && length.length !== this.maxSize) { + throw new Error("TensorArray's size is not equal to the size of lengths (" + this.maxSize + " vs. " + length.length + "), " + + 'and the TensorArray is not marked as dynamically resizeable'); + } + var elementPerRow = totalLength === 0 ? 0 : tensor.size / totalLength; + var tensors = []; + tfjs_core_1.tidy(function () { + tensor = tensor.reshape([1, totalLength, elementPerRow]); + for (var i = 0; i < length.length; ++i) { + var previousLength = (i === 0) ? 0 : cumulativeLengths[i - 1]; + var indices_1 = [0, previousLength, 0]; + var sizes = [1, length[i], elementPerRow]; + tensors[i] = tfjs_core_1.slice(tensor, indices_1, sizes).reshape(_this.elementShape); + } + return tensors; + }); + var indices = []; + for (var i = 0; i < length.length; i++) { + indices[i] = i; + } + this.writeMany(indices, tensors); + }; + TensorArray.nextId = 0; + return TensorArray; +}()); +exports.TensorArray = TensorArray; +//# sourceMappingURL=tensor_array.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/index.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/index.d.ts new file mode 100644 index 0000000..c61fe79 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/index.d.ts @@ -0,0 +1,2 @@ +export { FrozenModel, loadFrozenModel } from './executor/frozen_model'; +export { version as version_converter } from './version'; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/index.js b/node_modules/@tensorflow/tfjs-converter/dist/index.js new file mode 100644 index 0000000..b450d77 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var frozen_model_1 = require("./executor/frozen_model"); +exports.FrozenModel = frozen_model_1.FrozenModel; +exports.loadFrozenModel = frozen_model_1.loadFrozenModel; +var version_1 = require("./version"); +exports.version_converter = version_1.version; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/arithmetic_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/arithmetic_executor.d.ts new file mode 100644 index 0000000..ac6fe1d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/arithmetic_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "arithmetic"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/arithmetic_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/arithmetic_executor.js new file mode 100644 index 0000000..ac6c113 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/arithmetic_executor.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'add': { + return [tfc.add(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'mod': + return [tfc.mod(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + case 'mul': + return [tfc.mul(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + case 'div': { + return [tfc.div(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'floorDiv': { + return [tfc.floorDiv(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'sub': { + return [tfc.sub(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'minimum': { + return [tfc.minimum(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'maximum': { + return [tfc.maximum(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'pow': { + return [tfc.pow(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'squaredDifference': { + return [tfc.squaredDifference(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'arithmetic'; +//# sourceMappingURL=arithmetic_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/basic_math_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/basic_math_executor.d.ts new file mode 100644 index 0000000..60a5196 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/basic_math_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "basic_math"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/basic_math_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/basic_math_executor.js new file mode 100644 index 0000000..e4a5511 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/basic_math_executor.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'abs': + return [tfc.abs(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'acos': + return [tfc.acos(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'acosh': + return [tfc.acosh(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'asin': + return [tfc.asin(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'asinh': + return [tfc.asinh(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'atan': + return [tfc.atan(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'atanh': + return [tfc.atanh(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'ceil': + return [tfc.ceil(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'cos': + return [tfc.cos(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'cosh': + return [tfc.cosh(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'elu': + return [tfc.elu(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'erf': + return [tfc.erf(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'exp': + return [tfc.exp(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'expm1': { + return [tfc.expm1(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'floor': + return [tfc.floor(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'log': + return [tfc.log(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'log1p': { + return [tfc.log1p(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'neg': + return [tfc.neg(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'reciprocal': { + return [tfc.reciprocal(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'relu': + return [tfc.relu(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'round': { + return [tfc.round(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'selu': + return [tfc.selu(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'sigmoid': + return [tfc.sigmoid(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'sin': + return [tfc.sin(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'sign': { + return [tfc.sign(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'sinh': { + return [tfc.sinh(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'softplus': { + return [tfc.softplus(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'sqrt': { + return [tfc.sqrt(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'square': { + return [tfc.square(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'tanh': { + return [tfc.tanh(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'tan': + return [tfc.tan(utils_1.getParamValue('x', node, tensorMap, context))]; + case 'clipByValue': + return [tfc.clipByValue(utils_1.getParamValue('x', node, tensorMap, context), utils_1.getParamValue('clipValueMin', node, tensorMap, context), utils_1.getParamValue('clipValueMax', node, tensorMap, context))]; + case 'rsqrt': + return [tfc.div(tfc.scalar(1.0, 'float32'), tfc.sqrt(utils_1.getTensor(node.inputNames[0], tensorMap, context)))]; + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'basic_math'; +//# sourceMappingURL=basic_math_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/control_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/control_executor.d.ts new file mode 100644 index 0000000..a8187a7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/control_executor.d.ts @@ -0,0 +1,6 @@ +import * as tfc from '@tensorflow/tfjs-core'; +import { NamedTensorsMap } from '../../data/types'; +import { ExecutionContext } from '../../executor/execution_context'; +import { Node } from '../types'; +export declare function executeOp(node: Node, tensorMap: NamedTensorsMap, context: ExecutionContext): Promise; +export declare const CATEGORY = "control"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/control_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/control_executor.js new file mode 100644 index 0000000..5f98652 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/control_executor.js @@ -0,0 +1,152 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var tensor_array_1 = require("../../executor/tensor_array"); +var utils_1 = require("./utils"); +function executeOp(node, tensorMap, context) { + return __awaiter(this, void 0, void 0, function () { + var _a, pred, data_1, inputName, frameId, data, tensor, input, size, dtype, elementShape, dynamicSize, clearAfterRead, identicalElementShapes, name_1, tensorArray, id, index, writeTensor, writeTensorArray, readId, readIndex, readTensorArray, gatherId, gatherIndices, gatherDtype, gatherTensorArray, scatterId, scatterIndices, scatterTensor, scatterTensorArray, concatId, concatTensorArray, concatDtype, splitId, splitTensor, lengths, splitTensorArray, sizeId, sizeTensorArray, closeId, closeTensorArray; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = node.op; + switch (_a) { + case 'loopCond': return [3, 1]; + case 'switch': return [3, 2]; + case 'merge': return [3, 4]; + case 'enter': return [3, 5]; + case 'exit': return [3, 6]; + case 'nextIteration': return [3, 7]; + case 'tensorArray': return [3, 8]; + case 'tensorArrayWrite': return [3, 9]; + case 'tensorArrayRead': return [3, 10]; + case 'tensorArrayGather': return [3, 11]; + case 'tensorArrayScatter': return [3, 12]; + case 'tensorArrayConcat': return [3, 13]; + case 'tensorArraySplit': return [3, 14]; + case 'tensorArraySize': return [3, 15]; + case 'tensorArrayClose': return [3, 16]; + } + return [3, 17]; + case 1: return [2, [utils_1.getParamValue('pred', node, tensorMap, context)]]; + case 2: + pred = utils_1.getParamValue('pred', node, tensorMap, context); + data_1 = utils_1.getParamValue('data', node, tensorMap, context); + return [4, pred.data()]; + case 3: return [2, (_b.sent())[0] ? [undefined, data_1] : [data_1, undefined]]; + case 4: + inputName = node.inputNames.find(function (name) { return utils_1.getTensor(name, tensorMap, context) !== undefined; }); + return [2, inputName ? [utils_1.getTensor(inputName, tensorMap, context)] : undefined]; + case 5: + frameId = utils_1.getParamValue('frameName', node, tensorMap, context); + data = utils_1.getParamValue('tensor', node, tensorMap, context); + context.enterFrame(frameId); + return [2, [data]]; + case 6: + tensor = utils_1.getParamValue('tensor', node, tensorMap, context); + context.exitFrame(); + return [2, [tensor]]; + case 7: + input = utils_1.getParamValue('tensor', node, tensorMap, context); + context.nextIteration(); + return [2, [input]]; + case 8: + size = utils_1.getParamValue('size', node, tensorMap, context); + dtype = utils_1.getParamValue('dtype', node, tensorMap, context); + elementShape = utils_1.getParamValue('elementShape', node, tensorMap, context); + dynamicSize = utils_1.getParamValue('dynamicSize', node, tensorMap, context); + clearAfterRead = utils_1.getParamValue('clearAfterRead', node, tensorMap, context); + identicalElementShapes = utils_1.getParamValue('identicalElementShapes', node, tensorMap, context); + name_1 = utils_1.getParamValue('name', node, tensorMap, context); + tensorArray = new tensor_array_1.TensorArray(name_1, dtype, size, elementShape, identicalElementShapes, dynamicSize, clearAfterRead); + context.addTensorArray(tensorArray); + return [2, [tfjs_core_1.scalar(tensorArray.id), tfjs_core_1.scalar(1.0)]]; + case 9: + id = utils_1.getParamValue('tensorArrayId', node, tensorMap, context); + index = utils_1.getParamValue('index', node, tensorMap, context); + writeTensor = utils_1.getParamValue('tensor', node, tensorMap, context); + writeTensorArray = context.getTensorArray(id); + writeTensorArray.write(index, writeTensor); + return [2, [tfjs_core_1.scalar(1.0)]]; + case 10: + readId = utils_1.getParamValue('tensorArrayId', node, tensorMap, context); + readIndex = utils_1.getParamValue('index', node, tensorMap, context); + readTensorArray = context.getTensorArray(readId); + return [2, [readTensorArray.read(readIndex)]]; + case 11: + gatherId = utils_1.getParamValue('tensorArrayId', node, tensorMap, context); + gatherIndices = utils_1.getParamValue('indices', node, tensorMap, context); + gatherDtype = utils_1.getParamValue('dtype', node, tensorMap, context); + gatherTensorArray = context.getTensorArray(gatherId); + return [2, [gatherTensorArray.gather(gatherIndices, gatherDtype)]]; + case 12: + scatterId = utils_1.getParamValue('tensorArrayId', node, tensorMap, context); + scatterIndices = utils_1.getParamValue('indices', node, tensorMap, context); + scatterTensor = utils_1.getParamValue('tensor', node, tensorMap, context); + scatterTensorArray = context.getTensorArray(scatterId); + scatterTensorArray.scatter(scatterIndices, scatterTensor); + return [2, [tfjs_core_1.scalar(1.0)]]; + case 13: + concatId = utils_1.getParamValue('tensorArrayId', node, tensorMap, context); + concatTensorArray = context.getTensorArray(concatId); + concatDtype = utils_1.getParamValue('dtype', node, tensorMap, context); + return [2, [concatTensorArray.concat(concatDtype)]]; + case 14: + splitId = utils_1.getParamValue('tensorArrayId', node, tensorMap, context); + splitTensor = utils_1.getParamValue('tensor', node, tensorMap, context); + lengths = utils_1.getParamValue('lengths', node, tensorMap, context); + splitTensorArray = context.getTensorArray(splitId); + splitTensorArray.split(lengths, splitTensor); + return [2, [tfjs_core_1.scalar(1.0)]]; + case 15: + sizeId = utils_1.getParamValue('tensorArrayId', node, tensorMap, context); + sizeTensorArray = context.getTensorArray(sizeId); + return [2, [tfjs_core_1.scalar(sizeTensorArray.size(), 'int32')]]; + case 16: + closeId = utils_1.getParamValue('tensorArrayId', node, tensorMap, context); + closeTensorArray = context.getTensorArray(closeId); + closeTensorArray.clearAndClose(); + return [2, []]; + case 17: throw TypeError("Node type " + node.op + " is not implemented"); + } + }); + }); +} +exports.executeOp = executeOp; +exports.CATEGORY = 'control'; +//# sourceMappingURL=control_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/convolution_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/convolution_executor.d.ts new file mode 100644 index 0000000..da0f066 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/convolution_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "convolution"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/convolution_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/convolution_executor.js new file mode 100644 index 0000000..e53f465 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/convolution_executor.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'conv1d': { + var stride = utils_1.getParamValue('stride', node, tensorMap, context); + var pad = utils_1.getParamValue('pad', node, tensorMap, context); + var dataFormat = utils_1.getParamValue('dataFormat', node, tensorMap, context) + .toUpperCase(); + var dilation = utils_1.getParamValue('dilation', node, tensorMap, context); + return [tfc.conv1d(utils_1.getParamValue('x', node, tensorMap, context), utils_1.getParamValue('filter', node, tensorMap, context), stride, pad, dataFormat, dilation)]; + } + case 'conv2d': { + var stride = utils_1.getParamValue('strides', node, tensorMap, context); + var pad = utils_1.getParamValue('pad', node, tensorMap, context); + var dataFormat = utils_1.getParamValue('dataFormat', node, tensorMap, context) + .toUpperCase(); + var dilations = utils_1.getParamValue('dilations', node, tensorMap, context); + return [tfc.conv2d(utils_1.getParamValue('x', node, tensorMap, context), utils_1.getParamValue('filter', node, tensorMap, context), [stride[1], stride[2]], pad, dataFormat, [dilations[0], dilations[1]])]; + } + case 'conv2dTranspose': { + var shape = utils_1.getParamValue('outputShape', node, tensorMap, context); + var stride = utils_1.getParamValue('strides', node, tensorMap, context); + var pad = utils_1.getParamValue('pad', node, tensorMap, context); + return [tfc.conv2dTranspose(utils_1.getParamValue('x', node, tensorMap, context), utils_1.getParamValue('filter', node, tensorMap, context), shape, [stride[1], stride[2]], pad)]; + } + case 'depthwiseConv2d': { + var stride = utils_1.getParamValue('strides', node, tensorMap, context); + var pad = utils_1.getParamValue('pad', node, tensorMap, context); + var dilations = utils_1.getParamValue('dilations', node, tensorMap, context); + var dataFormat = utils_1.getParamValue('dataFormat', node, tensorMap, context) + .toUpperCase(); + return [tfc.depthwiseConv2d(utils_1.getParamValue('input', node, tensorMap, context), utils_1.getParamValue('filter', node, tensorMap, context), [stride[1], stride[2]], pad, dataFormat, [dilations[0], dilations[1]])]; + } + case 'avgPool': { + var stride = utils_1.getParamValue('strides', node, tensorMap, context); + var pad = utils_1.getParamValue('pad', node, tensorMap, context); + var kernelSize = utils_1.getParamValue('kernelSize', node, tensorMap, context); + return [tfc.avgPool(utils_1.getParamValue('x', node, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad)]; + } + case 'maxPool': { + var stride = utils_1.getParamValue('strides', node, tensorMap, context); + var pad = utils_1.getParamValue('pad', node, tensorMap, context); + var kernelSize = utils_1.getParamValue('kernelSize', node, tensorMap, context); + return [tfc.maxPool(utils_1.getParamValue('x', node, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad)]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'convolution'; +//# sourceMappingURL=convolution_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/creation_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/creation_executor.d.ts new file mode 100644 index 0000000..85d9dc1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/creation_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "creation"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/creation_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/creation_executor.js new file mode 100644 index 0000000..c1b13ad --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/creation_executor.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'fill': { + var shape = utils_1.getParamValue('shape', node, tensorMap, context); + var value = utils_1.getParamValue('value', node, tensorMap, context); + return [tfc.fill(shape, value)]; + } + case 'linspace': { + var start = utils_1.getParamValue('start', node, tensorMap, context); + var stop_1 = utils_1.getParamValue('stop', node, tensorMap, context); + var num = utils_1.getParamValue('num', node, tensorMap, context); + return [tfc.linspace(start, stop_1, num)]; + } + case 'oneHot': { + var indices = utils_1.getParamValue('indices', node, tensorMap, context); + var depth = utils_1.getParamValue('depth', node, tensorMap, context); + var onValue = utils_1.getParamValue('onValue', node, tensorMap, context); + var offValue = utils_1.getParamValue('offValue', node, tensorMap, context); + return [tfc.oneHot(indices, depth, onValue, offValue)]; + } + case 'ones': { + return [tfc.ones(utils_1.getParamValue('shape', node, tensorMap, context), utils_1.getParamValue('dtype', node, tensorMap, context))]; + } + case 'onesLike': { + return [tfc.onesLike(utils_1.getParamValue('x', node, tensorMap, context))]; + } + case 'randomUniform': { + return [tfc.randomUniform(utils_1.getParamValue('shape', node, tensorMap, context), utils_1.getParamValue('minval', node, tensorMap, context), utils_1.getParamValue('maxval', node, tensorMap, context), utils_1.getParamValue('dtype', node, tensorMap, context))]; + } + case 'range': { + var start = utils_1.getParamValue('start', node, tensorMap, context); + var stop_2 = utils_1.getParamValue('stop', node, tensorMap, context); + var step = utils_1.getParamValue('step', node, tensorMap, context); + return [tfc.range(start, stop_2, step, utils_1.getParamValue('dtype', node, tensorMap, context))]; + } + case 'truncatedNormal': { + var shape = utils_1.getParamValue('shape', node, tensorMap, context); + var mean = utils_1.getParamValue('mean', node, tensorMap, context); + var stdDev = utils_1.getParamValue('stdDev', node, tensorMap, context); + var seed = utils_1.getParamValue('seed', node, tensorMap, context); + return [tfc.truncatedNormal(shape, mean, stdDev, utils_1.getParamValue('dtype', node, tensorMap, context), seed)]; + } + case 'zeros': { + return [tfc.zeros(utils_1.getParamValue('shape', node, tensorMap, context), utils_1.getParamValue('dtype', node, tensorMap, context))]; + } + case 'zerosLike': { + return [tfc.zerosLike(utils_1.getParamValue('x', node, tensorMap, context))]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'creation'; +//# sourceMappingURL=creation_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/dynamic_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/dynamic_executor.d.ts new file mode 100644 index 0000000..9df5915 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/dynamic_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "dynamic"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/dynamic_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/dynamic_executor.js new file mode 100644 index 0000000..627ed98 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/dynamic_executor.js @@ -0,0 +1,67 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { return __awaiter(_this, void 0, void 0, function () { + var _a, boxes, scores, maxOutputSize, iouThreshold, scoreThreshold; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = node.op; + switch (_a) { + case 'nonMaxSuppression': return [3, 1]; + case 'whereAsync': return [3, 3]; + } + return [3, 5]; + case 1: + boxes = utils_1.getParamValue('boxes', node, tensorMap, context); + scores = utils_1.getParamValue('scores', node, tensorMap, context); + maxOutputSize = utils_1.getParamValue('maxOutputSize', node, tensorMap, context); + iouThreshold = utils_1.getParamValue('iouThreshold', node, tensorMap, context); + scoreThreshold = utils_1.getParamValue('scoreThreshold', node, tensorMap, context); + return [4, tfc.image.nonMaxSuppressionAsync(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold)]; + case 2: return [2, [_b.sent()]]; + case 3: return [4, tfc.whereAsync(utils_1.getParamValue('condition', node, tensorMap, context))]; + case 4: return [2, [_b.sent()]]; + case 5: throw TypeError("Node type " + node.op + " is not implemented"); + } + }); +}); }; +exports.CATEGORY = 'dynamic'; +//# sourceMappingURL=dynamic_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/evaluation_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/evaluation_executor.d.ts new file mode 100644 index 0000000..673cb68 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/evaluation_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "evaluation"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/evaluation_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/evaluation_executor.js new file mode 100644 index 0000000..f844626 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/evaluation_executor.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'topK': { + var x = utils_1.getParamValue('x', node, tensorMap, context); + var k = utils_1.getParamValue('k', node, tensorMap, context); + var sorted = utils_1.getParamValue('sorted', node, tensorMap, context); + var result = tfc.topk(x, k, sorted); + return [result.values, result.indices]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'evaluation'; +//# sourceMappingURL=evaluation_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/graph_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/graph_executor.d.ts new file mode 100644 index 0000000..0714e2d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/graph_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "graph"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/graph_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/graph_executor.js new file mode 100644 index 0000000..cdd5bd4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/graph_executor.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'const': { + return tensorMap[node.name]; + } + case 'placeholder': + var def = utils_1.getParamValue('default', node, tensorMap, context); + return [utils_1.getTensor(node.name, tensorMap, context) || def]; + case 'identity': + case 'stopGradient': + case 'fakeQuantWithMinMaxVars': + return [utils_1.getParamValue('x', node, tensorMap, context)]; + case 'snapshot': + var snapshot = utils_1.getParamValue('x', node, tensorMap, context); + return [snapshot.clone()]; + case 'shape': + return [tfc.tensor1d(utils_1.getParamValue('x', node, tensorMap, context).shape, 'int32')]; + case 'size': + return [tfc.scalar(utils_1.getParamValue('x', node, tensorMap, context).size, 'int32')]; + case 'rank': + return [tfc.scalar(utils_1.getParamValue('x', node, tensorMap, context).rank, 'int32')]; + case 'noop': + return []; + case 'print': + var input = utils_1.getParamValue('x', node, tensorMap, context); + var data = utils_1.getParamValue('data', node, tensorMap, context); + var message = utils_1.getParamValue('message', node, tensorMap, context); + var summarize = utils_1.getParamValue('summarize', node, tensorMap, context); + console.warn('The graph has a tf.print() operation,' + + 'usually used for debugging, which slows down performance.'); + console.log(message); + for (var i = 0; i < data.length; i++) { + console.log(Array.prototype.slice.call(data[0].dataSync()).slice(0, summarize)); + } + return [input]; + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'graph'; +//# sourceMappingURL=graph_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/image_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/image_executor.d.ts new file mode 100644 index 0000000..1aa381b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/image_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "image"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/image_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/image_executor.js new file mode 100644 index 0000000..edb6249 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/image_executor.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'resizeBilinear': { + var images = utils_1.getParamValue('images', node, tensorMap, context); + var size = utils_1.getParamValue('size', node, tensorMap, context); + var alignCorners = utils_1.getParamValue('alignCorners', node, tensorMap, context); + return [tfc.image.resizeBilinear(images, [size[0], size[1]], alignCorners)]; + } + case 'resizeNearestNeighbor': { + var images = utils_1.getParamValue('images', node, tensorMap, context); + var size = utils_1.getParamValue('size', node, tensorMap, context); + var alignCorners = utils_1.getParamValue('alignCorners', node, tensorMap, context); + return [tfc.image.resizeNearestNeighbor(images, [size[0], size[1]], alignCorners)]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'image'; +//# sourceMappingURL=image_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/logical_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/logical_executor.d.ts new file mode 100644 index 0000000..7f07e57 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/logical_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "logical"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/logical_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/logical_executor.js new file mode 100644 index 0000000..69e4ce0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/logical_executor.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'equal': { + return [tfc.equal(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'notEqual': { + return [tfc.notEqual(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'greater': { + return [tfc.greater(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'greaterEqual': { + return [tfc.greaterEqual(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'less': { + return [tfc.less(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'lessEqual': { + return [tfc.lessEqual(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'logicalAnd': { + return [tfc.logicalAnd(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'logicalNot': { + return [tfc.logicalNot(utils_1.getParamValue('a', node, tensorMap, context))]; + } + case 'logicalOr': { + return [tfc.logicalOr(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + case 'where': { + return [tfc.where(utils_1.getParamValue('condition', node, tensorMap, context), utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context))]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'logical'; +//# sourceMappingURL=logical_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/matrices_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/matrices_executor.d.ts new file mode 100644 index 0000000..993885d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/matrices_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "matrices"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/matrices_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/matrices_executor.js new file mode 100644 index 0000000..e8f2e06 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/matrices_executor.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'matMul': + return [tfc.matMul(utils_1.getParamValue('a', node, tensorMap, context), utils_1.getParamValue('b', node, tensorMap, context), utils_1.getParamValue('transposeA', node, tensorMap, context), utils_1.getParamValue('transposeB', node, tensorMap, context))]; + case 'transpose': + return [tfc.transpose(utils_1.getParamValue('x', node, tensorMap, context), utils_1.getParamValue('perm', node, tensorMap, context))]; + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'matrices'; +//# sourceMappingURL=matrices_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/normalization_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/normalization_executor.d.ts new file mode 100644 index 0000000..eba166f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/normalization_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "normalization"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/normalization_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/normalization_executor.js new file mode 100644 index 0000000..756eee8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/normalization_executor.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'batchNormalization': { + return [tfc.batchNormalization(utils_1.getParamValue('x', node, tensorMap, context), utils_1.getParamValue('mean', node, tensorMap, context), utils_1.getParamValue('variance', node, tensorMap, context), utils_1.getParamValue('epsilon', node, tensorMap, context), utils_1.getParamValue('scale', node, tensorMap, context), utils_1.getParamValue('offset', node, tensorMap, context))]; + } + case 'localResponseNormalization': { + return [tfc.localResponseNormalization(utils_1.getParamValue('x', node, tensorMap, context), utils_1.getParamValue('radius', node, tensorMap, context), utils_1.getParamValue('bias', node, tensorMap, context), utils_1.getParamValue('alpha', node, tensorMap, context), utils_1.getParamValue('beta', node, tensorMap, context))]; + } + case 'softmax': { + return [tfc.softmax(utils_1.getParamValue('x', node, tensorMap, context))]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'normalization'; +//# sourceMappingURL=normalization_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/reduction_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/reduction_executor.d.ts new file mode 100644 index 0000000..b06d437 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/reduction_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "reduction"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/reduction_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/reduction_executor.js new file mode 100644 index 0000000..d9cc321 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/reduction_executor.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'max': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var keepDims = utils_1.getParamValue('keepDims', node, tensorMap, context); + return [tfc.max(utils_1.getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'mean': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var keepDims = utils_1.getParamValue('keepDims', node, tensorMap, context); + return [tfc.mean(utils_1.getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'min': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var keepDims = utils_1.getParamValue('keepDims', node, tensorMap, context); + return [tfc.min(utils_1.getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'sum': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var keepDims = utils_1.getParamValue('keepDims', node, tensorMap, context); + return [tfc.sum(utils_1.getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'all': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var keepDims = utils_1.getParamValue('keepDims', node, tensorMap, context); + return [tfc.all(utils_1.getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'any': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var keepDims = utils_1.getParamValue('keepDims', node, tensorMap, context); + return [tfc.any(utils_1.getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'argMax': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + return [tfc.argMax(utils_1.getParamValue('x', node, tensorMap, context), axis)]; + } + case 'argMin': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + return [tfc.argMin(utils_1.getParamValue('x', node, tensorMap, context), axis)]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'reduction'; +//# sourceMappingURL=reduction_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/slice_join_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/slice_join_executor.d.ts new file mode 100644 index 0000000..be1fe03 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/slice_join_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "slice_join"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/slice_join_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/slice_join_executor.js new file mode 100644 index 0000000..45f57d2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/slice_join_executor.js @@ -0,0 +1,82 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'concat': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var inputs = utils_1.getParamValue('tensors', node, tensorMap, context); + return [tfc.concat(inputs, axis)]; + } + case 'gather': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var input = utils_1.getParamValue('x', node, tensorMap, context); + var indices = utils_1.getParamValue('indices', node, tensorMap, context); + return [tfc.gather(input, indices, axis)]; + } + case 'reverse': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var input = utils_1.getParamValue('x', node, tensorMap, context); + return [tfc.reverse(input, axis)]; + } + case 'slice': { + var begin = utils_1.getParamValue('begin', node, tensorMap, context); + var size = utils_1.getParamValue('size', node, tensorMap, context); + return [tfc.slice(utils_1.getParamValue('x', node, tensorMap, context), begin, size)]; + } + case 'stridedSlice': { + var begin = utils_1.getParamValue('begin', node, tensorMap, context); + var end = utils_1.getParamValue('end', node, tensorMap, context); + var strides = utils_1.getParamValue('strides', node, tensorMap, context); + var beginMask = utils_1.getParamValue('beginMask', node, tensorMap, context); + var endMask = utils_1.getParamValue('endMask', node, tensorMap, context); + var tensor = utils_1.getParamValue('x', node, tensorMap, context); + if (begin.length === 1 && tensor.shape.length > 1) { + for (var i = 1; i < tensor.shape.length; i++) { + begin.push(0); + end.push(tensor.shape[i]); + strides.push(strides[0]); + } + } + return [tfc.stridedSlice(tensor, begin, end, strides, beginMask, endMask)]; + } + case 'stack': { + return tfc.tidy(function () { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var tensors = utils_1.getParamValue('tensors', node, tensorMap, context); + var shape = tensors[0].shape; + var squeezedShape = tensors[0].squeeze().shape; + var mapped = tensors.map(function (tensor) { + var sameShape = tfc.util.arraysEqual(tensor.shape, shape); + if (!sameShape && + !tfc.util.arraysEqual(tensor.squeeze().shape, squeezedShape)) { + throw new Error('the input tensors shape does not match'); + } + return sameShape ? tensor : tensor.reshape(shape); + }); + return [tfc.stack(mapped, axis)]; + }); + } + case 'unstack': { + return tfc.tidy(function () { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var tensor = utils_1.getParamValue('tensor', node, tensorMap, context); + return tfc.unstack(tensor, axis); + }); + } + case 'tile': { + var reps = utils_1.getParamValue('reps', node, tensorMap, context); + return [tfc.tile(utils_1.getParamValue('x', node, tensorMap, context), reps)]; + } + case 'split': { + var axis = utils_1.getParamValue('axis', node, tensorMap, context); + var numOrSizeSplits = utils_1.getParamValue('numOrSizeSplits', node, tensorMap, context); + return tfc.split(utils_1.getParamValue('x', node, tensorMap, context), numOrSizeSplits, axis); + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'slice_join'; +//# sourceMappingURL=slice_join_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/test_helper.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/test_helper.d.ts new file mode 100644 index 0000000..57f2620 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/test_helper.d.ts @@ -0,0 +1,10 @@ +import { ParamValue } from '../types'; +export declare function createNumberAttr(value: number): ParamValue; +export declare function createNumberAttrFromIndex(inputIndex: number): ParamValue; +export declare function createStrAttr(str: string): ParamValue; +export declare function createBoolAttr(value: boolean): ParamValue; +export declare function createNumericArrayAttr(value: number[]): ParamValue; +export declare function createNumericArrayAttrFromIndex(inputIndex: number): ParamValue; +export declare function createTensorAttr(index: number): ParamValue; +export declare function createTensorsAttr(index: number, paramLength: number): ParamValue; +export declare function createDtypeAttr(dtype: string): ParamValue; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/test_helper.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/test_helper.js new file mode 100644 index 0000000..3b7039d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/test_helper.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function createNumberAttr(value) { + return { value: value, type: 'number' }; +} +exports.createNumberAttr = createNumberAttr; +function createNumberAttrFromIndex(inputIndex) { + return { inputIndex: inputIndex, type: 'number' }; +} +exports.createNumberAttrFromIndex = createNumberAttrFromIndex; +function createStrAttr(str) { + return { value: str, type: 'string' }; +} +exports.createStrAttr = createStrAttr; +function createBoolAttr(value) { + return { value: value, type: 'bool' }; +} +exports.createBoolAttr = createBoolAttr; +function createNumericArrayAttr(value) { + return { value: value, type: 'number[]' }; +} +exports.createNumericArrayAttr = createNumericArrayAttr; +function createNumericArrayAttrFromIndex(inputIndex) { + return { inputIndex: inputIndex, type: 'number[]' }; +} +exports.createNumericArrayAttrFromIndex = createNumericArrayAttrFromIndex; +function createTensorAttr(index) { + return { inputIndex: index, type: 'tensor' }; +} +exports.createTensorAttr = createTensorAttr; +function createTensorsAttr(index, paramLength) { + return { inputIndex: index, inputParamLength: paramLength, type: 'tensors' }; +} +exports.createTensorsAttr = createTensorsAttr; +function createDtypeAttr(dtype) { + return { value: dtype, type: 'dtype' }; +} +exports.createDtypeAttr = createDtypeAttr; +//# sourceMappingURL=test_helper.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/transformation_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/transformation_executor.d.ts new file mode 100644 index 0000000..f3a14e1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/transformation_executor.d.ts @@ -0,0 +1,3 @@ +import { OpExecutor } from './types'; +export declare let executeOp: OpExecutor; +export declare const CATEGORY = "transformation"; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/transformation_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/transformation_executor.js new file mode 100644 index 0000000..e436fd8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/transformation_executor.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var utils_1 = require("./utils"); +exports.executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'cast': { + return [tfc.cast(utils_1.getParamValue('x', node, tensorMap, context), utils_1.getParamValue('dtype', node, tensorMap, context))]; + } + case 'expandDims': { + var axis = node.params['axis'].value; + return [tfc.expandDims(utils_1.getParamValue('x', node, tensorMap, context), axis)]; + } + case 'squeeze': { + var axis = node.params['axis'].value; + return [tfc.squeeze(utils_1.getParamValue('x', node, tensorMap, context), axis)]; + } + case 'reshape': { + return [tfc.reshape(utils_1.getParamValue('x', node, tensorMap, context), utils_1.getParamValue('shape', node, tensorMap, context))]; + } + case 'pad': { + return [tfc.pad(utils_1.getParamValue('x', node, tensorMap, context), utils_1.split(utils_1.getParamValue('padding', node, tensorMap, context), 2), utils_1.getParamValue('constantValue', node, tensorMap, context))]; + } + case 'spaceToBatchND': { + var blockShape = utils_1.getParamValue('blockShape', node, tensorMap, context); + var paddings = utils_1.split(utils_1.getParamValue('paddings', node, tensorMap, context), 2); + return [tfc.spaceToBatchND(utils_1.getParamValue('x', node, tensorMap, context), blockShape, paddings)]; + } + case 'batchToSpaceND': { + var blockShape = utils_1.getParamValue('blockShape', node, tensorMap, context); + var crops = utils_1.split(utils_1.getParamValue('crops', node, tensorMap, context), 2); + return [tfc.batchToSpaceND(utils_1.getParamValue('x', node, tensorMap, context), blockShape, crops)]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +}; +exports.CATEGORY = 'transformation'; +//# sourceMappingURL=transformation_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/types.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/types.d.ts new file mode 100644 index 0000000..eeb3e18 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/types.d.ts @@ -0,0 +1,7 @@ +import * as tfc from '@tensorflow/tfjs-core'; +import { NamedTensorsMap } from '../../data/types'; +import { ExecutionContext } from '../../executor/execution_context'; +import { Node } from '../types'; +export interface OpExecutor { + (node: Node, tensorMap: NamedTensorsMap, context: ExecutionContext): tfc.Tensor[] | Promise; +} diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/types.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/utils.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/utils.d.ts new file mode 100644 index 0000000..0d3b3ed --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/utils.d.ts @@ -0,0 +1,9 @@ +import * as tfc from '@tensorflow/tfjs-core'; +import { NamedTensorsMap } from '../../data/types'; +import { ExecutionContext } from '../../executor/execution_context'; +import { Node, ValueType } from '../types'; +export declare function getParamValue(paramName: string, node: Node, tensorMap: NamedTensorsMap, context: ExecutionContext): ValueType; +export declare function getTensor(name: string, tensorsMap: NamedTensorsMap, context: ExecutionContext): tfc.Tensor; +export declare function getNodeNameAndIndex(inputName: string, context?: ExecutionContext): [string, number]; +export declare function parseNodeName(name: string): [string, number]; +export declare function split(arr: number[], size: number): number[][]; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/utils.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/utils.js new file mode 100644 index 0000000..c03fce5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/executors/utils.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function getParamValue(paramName, node, tensorMap, context) { + var param = node.params[paramName]; + if (param && param.inputIndex !== undefined) { + if (param.type === 'tensor') { + return getTensor(node.inputNames[param.inputIndex], tensorMap, context); + } + if (param.type === 'tensors') { + var inputs = param.inputIndex === 0 ? + (param.inputParamLength === 0 ? + node.inputNames : + node.inputNames.slice(param.inputIndex, -param.inputParamLength)) : + node.inputNames.splice(param.inputIndex); + return inputs.map(function (name) { return getTensor(name, tensorMap, context); }); + } + var data = Array.prototype.slice.call(getTensor(node.inputNames.slice(param.inputIndex)[0], tensorMap, context) + .dataSync()); + return param.type === 'number' ? data[0] : data; + } + return param && param.value; +} +exports.getParamValue = getParamValue; +function getTensor(name, tensorsMap, context) { + var _a = parseNodeName(name), nodeName = _a[0], index = _a[1]; + var contextId = context.currentContextIds.find(function (contextId) { + return !!tensorsMap[getNodeNameWithContextId(nodeName, contextId)]; + }); + return contextId !== undefined ? + tensorsMap[getNodeNameWithContextId(nodeName, contextId)][index] : + undefined; +} +exports.getTensor = getTensor; +function getNodeNameAndIndex(inputName, context) { + var _a = parseNodeName(inputName), nodeName = _a[0], index = _a[1]; + return [ + getNodeNameWithContextId(nodeName, context && context.currentContextId), + index + ]; +} +exports.getNodeNameAndIndex = getNodeNameAndIndex; +function getNodeNameWithContextId(name, contextId) { + return !!contextId ? name + "-" + contextId : name; +} +function parseNodeName(name) { + var index = name.lastIndexOf(':'); + if (index === -1) + return [name, 0]; + var nodeName = name.substring(0, index); + return [nodeName, Number(name.substring(index + 1))]; +} +exports.parseNodeName = parseNodeName; +function split(arr, size) { + var res = []; + for (var i = 0; i < arr.length; i += size) { + res.push(arr.slice(i, i + size)); + } + return res; +} +exports.split = split; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/arithmetic.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/arithmetic.json new file mode 100644 index 0000000..a1bde0f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/arithmetic.json @@ -0,0 +1,266 @@ +[ + { + "tfOpName": "Add", + "dlOpName": "add", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "BiasAdd", + "dlOpName": "add", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sub", + "dlOpName": "sub", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "RealDiv", + "dlOpName": "div", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Div", + "dlOpName": "div", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "FloorDiv", + "dlOpName": "floorDiv", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Mul", + "dlOpName": "mul", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Maximum", + "dlOpName": "maximum", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Minimum", + "dlOpName": "minimum", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Pow", + "dlOpName": "pow", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "SquaredDifference", + "dlOpName": "squaredDifference", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Mod", + "dlOpName": "mod", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/basic_math.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/basic_math.json new file mode 100644 index 0000000..8d4c08b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/basic_math.json @@ -0,0 +1,646 @@ +[ + { + "tfOpName": "Abs", + "dlOpName": "abs", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Acos", + "dlOpName": "acos", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Asin", + "dlOpName": "asin", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "atan", + "dlOpName": "atan", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Ceil", + "dlOpName": "ceil", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "ClipByValue", + "dlOpName": "clipByValue", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "clip_value_min", + "dlParamName": "clipValueMin", + "type": "number" + }, + { + "tfParamName": "clip_value_max", + "dlParamName": "clipValueMax", + "type": "number" + } + ] + }, + { + "tfOpName": "Cos", + "dlOpName": "cos", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Cosh", + "dlOpName": "cosh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Elu", + "dlOpName": "elu", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Exp", + "dlOpName": "exp", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Floor", + "dlOpName": "floor", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Log", + "dlOpName": "log", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Neg", + "dlOpName": "neg", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Relu", + "dlOpName": "relu", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Relu6", + "dlOpName": "clipByValue", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + }, + { + "dlParamName": "clipValueMin", + "type": "number", + "defaultValue": 0 + }, + { + "dlParamName": "clipValueMax", + "type": "number", + "defaultValue": 6 + } + ] + }, + { + "tfOpName": "Selu", + "dlOpName": "selu", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sigmoid", + "dlOpName": "sigmoid", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sin", + "dlOpName": "sin", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sinh", + "dlOpName": "sinh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sqrt", + "dlOpName": "sqrt", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Rsqrt", + "dlOpName": "rsqrt", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Square", + "dlOpName": "square", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Tan", + "dlOpName": "tan", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Tanh", + "dlOpName": "tanh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sign", + "dlOpName": "sign", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Round", + "dlOpName": "round", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Expm1", + "dlOpName": "expm1", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Log1p", + "dlOpName": "log1p", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Reciprocal", + "dlOpName": "reciprocal", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Reciprocal", + "dlOpName": "reciprocal", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Softplus", + "dlOpName": "softplus", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Asinh", + "dlOpName": "asinh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Acosh", + "dlOpName": "acosh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Atanh", + "dlOpName": "atanh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Erf", + "dlOpName": "erf", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/control.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/control.json new file mode 100644 index 0000000..db90232 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/control.json @@ -0,0 +1,364 @@ +[ + { + "tfOpName": "LoopCond", + "dlOpName": "loopCond", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "pred", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Switch", + "dlOpName": "switch", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "data", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "pred", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Merge", + "dlOpName": "merge", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "tfInputParamLength": 0, + "dlParamName": "tensors", + "type": "tensors" + } + ] + }, + { + "tfOpName": "Enter", + "dlOpName": "enter", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + }, + { + "tfParamName": "frame_name", + "dlParamName": "frameName", + "type": "string" + }, + { + "tfParamName": "is_constant", + "dlParamName": "isConstant", + "type": "bool" + } + ] + }, + { + "tfOpName": "Exit", + "dlOpName": "exit", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "NextIteration", + "dlOpName": "nextIteration", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "TensorArrayV3", + "dlOpName": "tensorArray", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "size", + "type": "number" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "element_shape", + "dlParamName": "elementShape", + "type": "shape" + }, + { + "tfParamName": "dynamic_size", + "dlParamName": "dynamicSize", + "type": "bool" + }, + { + "tfParamName": "clear_after_read", + "dlParamName": "clearAfterRead", + "type": "bool" + }, + { + "tfParamName": "identical_element_shapes", + "dlParamName": "identicalElementShapes", + "type": "bool" + }, + { + "tfParamName": "tensor_array_name", + "dlParamName": "name", + "type": "string" + } + ] + }, + { + "tfOpName": "TensorArrayWriteV3", + "dlOpName": "tensorArrayWrite", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "index", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfInputIndex": 3, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "TensorArrayReadV3", + "dlOpName": "tensorArrayRead", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "index", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "TensorArrayGatherV3", + "dlOpName": "tensorArrayGather", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "indices", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "element_shape", + "dlParamName": "elementShape", + "type": "shape" + } + ] + }, + { + "tfOpName": "TensorArrayScatterV3", + "dlOpName": "tensorArrayScatter", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "indices", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "tensor", + "type": "number[]" + }, + { + "tfInputIndex": 3, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "TensorArrayConcatV3", + "dlOpName": "tensorArrayConcat", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "element_shape_except0", + "dlParamName": "elementShapeExcept0", + "type": "shape", + "notSupported": true + } + ] + }, + { + "tfOpName": "TensorArraySplitV3", + "dlOpName": "tensorArraySplit", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "lengths", + "type": "number[]" + }, + { + "tfInputIndex": 3, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "TensorArraySizeV3", + "dlOpName": "tensorArraySize", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "flowIn", + "type": "number" + } + ] + }, + { + "tfOpName": "TensorArrayCloseV3", + "dlOpName": "tensorArrayClose", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/convolution.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/convolution.json new file mode 100644 index 0000000..6d84b65 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/convolution.json @@ -0,0 +1,288 @@ +[ + { + "tfOpName": "AvgPool", + "dlOpName": "avgPool", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + }, + { + "tfParamName": "ksize", + "dlParamName": "kernelSize", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "MaxPool", + "dlOpName": "maxPool", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + }, + { + "tfParamName": "ksize", + "dlParamName": "kernelSize", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Conv1D", + "dlOpName": "conv1d", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfParamName": "stride", + "dlParamName": "stride", + "type": "number" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "defaultValue": "NWC" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + }, + { + "tfParamName": "dilation", + "dlParamName": "dilation", + "type": "number", + "defaultValue": 1 + } + ] + }, + { + "tfOpName": "Conv2D", + "dlOpName": "conv2d", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "useCudnnOnGpu", + "dlParamName": "useCudnnOnGpu", + "type": "bool" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfParamName": "dilations", + "dlParamName": "dilations", + "type": "number[]" + } + ] + }, + { + "tfOpName": "Conv2DBackpropInput", + "dlOpName": "conv2dTranspose", + "category": "convolution", + "params": [ + { + "tfInputIndex": 2, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfInputIndex": 0, + "dlParamName": "outputShape", + "type": "number[]" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "DepthwiseConv2d", + "dlOpName": "depthwiseConv2d", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "input", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfParamName": "dilations", + "dlParamName": "dilations", + "type": "number[]" + } + ] + }, + { + "tfOpName": "DepthwiseConv2dNative", + "dlOpName": "depthwiseConv2d", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "input", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfParamName": "dilations", + "dlParamName": "dilations", + "type": "number[]" + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/creation.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/creation.json new file mode 100644 index 0000000..66f1b58 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/creation.json @@ -0,0 +1,285 @@ +[ + { + "tfOpName": "Fill", + "dlOpName": "fill", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfInputIndex": 1, + "dlParamName": "value", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LinSpace", + "dlOpName": "linspace", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "start", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "stop", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "num", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "OneHot", + "dlOpName": "oneHot", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "indices", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "depth", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "onValue", + "type": "number", + "defaultValue": 1 + }, + { + "tfInputIndex": 3, + "dlParamName": "offValue", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "notSupported": true + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Ones", + "dlOpName": "ones", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "OnesLike", + "dlOpName": "onesLike", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "RandomUniform", + "dlOpName": "randomUniform", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfParamName": "minval", + "dlParamName": "minval", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "maxval", + "dlParamName": "maxval", + "type": "number", + "defaultValue": 1 + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "seed", + "dlParamName": "seed", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "seed2", + "dlParamName": "seed2", + "type": "number", + "defaultValue": 0, + "notSupported": true + }, + { + "tfParamName": "T", + "dlParamName": "T", + "type": "number", + "notSupported": true + } + ] + }, + { + "tfOpName": "Range", + "dlOpName": "range", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "start", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "stop", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "step", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "Tidx", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "truncatedNormal", + "dlOpName": "truncatedNormal", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfParamName": "means", + "dlParamName": "mean", + "type": "number", + "defaultValue": 0.0 + }, + { + "tfParamName": "stddev", + "dlParamName": "stdDev", + "type": "number", + "defaultValue": 1.0 + }, + { + "tfParamName": "seed", + "dlParamName": "seed", + "type": "number" + }, + { + "tfParamName": "seed2", + "dlParamName": "seed2", + "type": "number", + "defaultValue": 0, + "notSupported": true + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "T", + "dlParamName": "T", + "type": "number", + "notSupported": true + } + ] + }, + { + "tfOpName": "Zeros", + "dlOpName": "zeros", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "ZerosLike", + "dlOpName": "zerosLike", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/dynamic.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/dynamic.json new file mode 100644 index 0000000..5adb5be --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/dynamic.json @@ -0,0 +1,79 @@ +[ + { + "tfOpName": "NonMaxSuppressionV2", + "dlOpName": "nonMaxSuppression", + "category": "dynamic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "boxes", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scores", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "maxOutputSize", + "type": "number" + }, + { + "tfInputIndex": 3, + "dlParamName": "iouThreshold", + "type": "number" + } + ] + }, + { + "tfOpName": "NonMaxSuppressionV3", + "dlOpName": "nonMaxSuppression", + "category": "dynamic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "boxes", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scores", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "maxOutputSize", + "type": "number" + }, + { + "tfInputIndex": 3, + "dlParamName": "iouThreshold", + "type": "number" + }, + { + "tfInputIndex": 4, + "dlParamName": "scoreThreshold", + "type": "number" + } + ] + }, + { + "tfOpName": "Where", + "dlOpName": "whereAsync", + "category": "dynamic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "condition", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/evaluation.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/evaluation.json new file mode 100644 index 0000000..f72a99d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/evaluation.json @@ -0,0 +1,24 @@ +[ + { + "tfOpName": "TopKV2", + "dlOpName": "topK", + "category": "evaluation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "k", + "type": "number" + }, + { + "tfParamName": "sorted", + "dlParamName": "sorted", + "type": "bool" + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/graph.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/graph.json new file mode 100644 index 0000000..8d0295c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/graph.json @@ -0,0 +1,181 @@ +[ + { + "tfOpName": "PlaceholderWithDefault", + "dlOpName": "placeholder", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "default", + "type": "tensor" + }, + { + "tfParamName": "shape", + "dlParamName": "shape", + "type": "shape" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "Placeholder", + "dlOpName": "placeholder", + "category": "graph", + "params": [ + { + "tfParamName": "shape", + "dlParamName": "shape", + "type": "shape" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "Const", + "dlOpName": "const", + "category": "graph" + }, + { + "tfOpName": "Identity", + "dlOpName": "identity", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Snapshot", + "dlOpName": "snapshot", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Rank", + "dlOpName": "rank", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Size", + "dlOpName": "size", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Shape", + "dlOpName": "shape", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Print", + "dlOpName": "print", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "tfInputParamLength": 1, + "dlParamName": "data", + "type": "tensors" + }, + { + "tfParamName": "message", + "dlParamName": "message", + "type": "string" + }, + { + "tfParamName": "first_n", + "dlParamName": "firstN", + "type": "number", + "notSupprted": true + }, + { + "tfParamName": "summarize", + "dlParamName": "summarize", + "type": "number", + "defaultValue": 3 + } + ] + }, + { + "tfOpName": "NoOp", + "dlOpName": "noop", + "category": "graph", + "params": [] + }, + { + "tfOpName": "StopGradient", + "dlOpName": "stopGradient", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "FakeQuantWithMinMaxVars", + "dlOpName": "fakeQuantWithMinMaxVars", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "min", + "dlParamName": "min", + "type": "number" + }, + { + "tfParamName": "max", + "dlParamName": "max", + "type": "number" + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/image.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/image.json new file mode 100644 index 0000000..f4d2f73 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/image.json @@ -0,0 +1,117 @@ +[ + { + "tfOpName": "ResizeBilinear", + "dlOpName": "resizeBilinear", + "category": "image", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "images", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "size", + "type": "number[]" + }, + { + "tfParamName": "align_corners", + "dlParamName": "alignCorners", + "type": "bool" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "ResizeNearestNeighbor", + "dlOpName": "resizeNearestNeighbor", + "category": "image", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "images", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "size", + "type": "number[]" + }, + { + "tfParamName": "align_corners", + "dlParamName": "alignCorners", + "type": "bool" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "NonMaxSuppressionV2", + "dlOpName": "nonMaxSuppression", + "category": "image", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "boxes", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scores", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "maxOutputSize", + "type": "number" + }, + { + "tfInputIndex": 3, + "dlParamName": "iouThreshold", + "type": "number" + } + ] + }, + { + "tfOpName": "NonMaxSuppressionV3", + "dlOpName": "nonMaxSuppression", + "category": "image", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "boxes", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scores", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "maxOutputSize", + "type": "number" + }, + { + "tfInputIndex": 3, + "dlParamName": "iouThreshold", + "type": "number" + }, + { + "tfInputIndex": 4, + "dlParamName": "scoreThreshold", + "type": "number" + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/logical.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/logical.json new file mode 100644 index 0000000..21d2d9a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/logical.json @@ -0,0 +1,232 @@ +[ + { + "tfOpName": "Equal", + "dlOpName": "equal", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "NotEqual", + "dlOpName": "notEqual", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Greater", + "dlOpName": "greater", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "GreaterEqual", + "dlOpName": "greaterEqual", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Less", + "dlOpName": "less", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LessEqual", + "dlOpName": "lessEqual", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LogicalAnd", + "dlOpName": "logicalAnd", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LogicalNot", + "dlOpName": "logicalNot", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LogicalOr", + "dlOpName": "logicalOr", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Select", + "dlOpName": "where", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "condition", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/matrices.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/matrices.json new file mode 100644 index 0000000..c9662f5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/matrices.json @@ -0,0 +1,60 @@ +[ + { + "tfOpName": "MatMul", + "dlOpName": "matMul", + "category": "matrices", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "transpose_a", + "dlParamName": "transposeA", + "type": "bool", + "defaultValue": false + }, + { + "tfParamName": "transpose_b", + "dlParamName": "transposeB", + "type": "bool", + "defaultValue": false + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Transpose", + "dlOpName": "transpose", + "category": "matrices", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "perm", + "dlParamName": "perm", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/normalization.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/normalization.json new file mode 100644 index 0000000..a5cb485 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/normalization.json @@ -0,0 +1,137 @@ +[ + { + "tfOpName": "FusedBatchNorm", + "dlOpName": "batchNormalization", + "category": "normalization", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scale", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "offset", + "type": "tensor" + }, + { + "tfInputIndex": 3, + "dlParamName": "mean", + "type": "tensor" + }, + { + "tfInputIndex": 4, + "dlParamName": "variance", + "type": "tensor" + }, + { + "tfParamName": "epsilon", + "dlParamName": "epsilon", + "type": "number", + "defaultValue": 0.001 + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "FusedBatchNormV2", + "dlOpName": "batchNormalization", + "category": "normalization", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scale", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "offset", + "type": "tensor" + }, + { + "tfInputIndex": 3, + "dlParamName": "mean", + "type": "tensor" + }, + { + "tfInputIndex": 4, + "dlParamName": "variance", + "type": "tensor" + }, + { + "tfParamName": "epsilon", + "dlParamName": "epsilon", + "type": "number", + "defaultValue": 0.001 + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "LRN", + "dlOpName": "localResponseNormalization", + "category": "normalization", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "depth_radius", + "dlParamName": "radius", + "type": "number", + "defaultValue": 5 + }, + { + "tfParamName": "bias", + "dlParamName": "bias", + "type": "number", + "defaultValue": 1.0 + }, + { + "tfParamName": "alpha", + "dlParamName": "alpha", + "type": "number", + "defaultValue": 1.0 + }, + { + "tfParamName": "beta", + "dlParamName": "beta", + "type": "number", + "defaultValue": 0.5 + } + ] + }, { + "tfOpName": "Softmax", + "dlOpName": "softmax", + "category": "normalization", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/reduction.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/reduction.json new file mode 100644 index 0000000..9d3fd95 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/reduction.json @@ -0,0 +1,168 @@ +[ + { + "tfOpName": "Max", + "dlOpName": "max", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "Mean", + "dlOpName": "mean", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "Min", + "dlOpName": "min", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "Sum", + "dlOpName": "sum", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "All", + "dlOpName": "all", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "Any", + "dlOpName": "any", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "ArgMax", + "dlOpName": "argMax", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "ArgMin", + "dlOpName": "argMin", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number" + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/slice_join.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/slice_join.json new file mode 100644 index 0000000..2e4f783 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/slice_join.json @@ -0,0 +1,263 @@ +[ + { + "tfOpName": "ConcatV2", + "dlOpName": "concat", + "category": "slice_join", + "params": [ + { + "tfInputIndex": 0, + "tfInputParamLength": 1, + "dlParamName": "tensors", + "type": "tensors" + }, + { + "tfInputIndex": -1, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "Concat", + "dlOpName": "concat", + "category": "slice_join", + "params": [ + { + "tfInputIndex": 1, + "tfInputParamLength": 1, + "dlParamName": "tensors", + "type": "tensors" + }, + { + "tfInputIndex": 0, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "GatherV2", + "dlOpName": "gather", + "category": "slice_join", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "indices", + "type": "tensor" + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Gather", + "dlOpName": "gather", + "category": "slice_join", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "indices", + "type": "tensor" + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "validate_indices", + "dlParamName": "validateIndices", + "type": "bool", + "notSupported": true + } + ] + }, + { + "tfOpName": "Reverse", + "dlOpName": "reverse", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "ReverseV2", + "dlOpName": "reverse", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "Slice", + "dlOpName": "slice", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "begin", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "size", + "type": "number[]" + } + ] + }, + { + "tfOpName": "StridedSlice", + "dlOpName": "stridedSlice", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "begin", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "end", + "type": "number[]" + }, + { + "tfInputIndex": 3, + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "begin_mask", + "dlParamName": "beginMask", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "end_mask", + "dlParamName": "endMask", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Pack", + "dlOpName": "stack", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "tfInputParamLength": 0, + "dlParamName": "tensors", + "type": "tensors" + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Unpack", + "dlOpName": "unstack", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "tfInputParamLength": 0, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "num", + "dlParamName": "num", + "type": "number", + "defaultValue": 0, + "notSupported": true + } + ] + }, + { + "tfOpName": "Tile", + "dlOpName": "tile", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "reps", + "type": "number[]" + } + ] + }, + { + "tfOpName": "Split", + "dlOpName": "split", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + }, + { + "tfInputIndex": 1, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "num_split", + "dlParamName": "numOrSizeSplits", + "type": "number", + "defaultValue": 1 + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/transformation.json b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/transformation.json new file mode 100644 index 0000000..65e091d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/op_list/transformation.json @@ -0,0 +1,161 @@ +[ + { + "tfOpName": "Cast", + "dlOpName": "cast", + "category": "transformation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "SrcT", + "dlParamName": "sdtype", + "type": "dtype", + "notSupported": true + }, + { + "tfParamName": "DstT", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "ExpandDims", + "dlOpName": "expandDims", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "tfParamNameDeprecated": "dim", + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "Pad", + "dlOpName": "pad", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "padding", + "type": "number[]" + }, + { + "tfParamName": "constant_value", + "dlParamName": "constantValue", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "PadV2", + "dlOpName": "pad", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "padding", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "constantValue", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Reshape", + "dlOpName": "reshape", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "shape", + "type": "number[]" + } + ] + }, + { + "tfOpName": "Squeeze", + "dlOpName": "squeeze", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "axis", + "tfParamNameDeprecated": "squeeze_dims", + "dlParamName": "axis", + "type": "number[]" + } + ] + }, + { + "tfOpName": "SpaceToBatchND", + "dlOpName": "spaceToBatchND", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "blockShape", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "paddings", + "type": "number[]" + } + ] + }, + { + "tfOpName": "BatchToSpaceND", + "dlOpName": "batchToSpaceND", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "blockShape", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "crops", + "type": "number[]" + } + ] + } +] diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_executor.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_executor.d.ts new file mode 100644 index 0000000..28e0f5e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_executor.d.ts @@ -0,0 +1,5 @@ +import * as tfc from '@tensorflow/tfjs-core'; +import { NamedTensorsMap } from '../data/types'; +import { ExecutionContext } from '../executor/execution_context'; +import { Node } from './types'; +export declare function executeOp(node: Node, tensorMap: NamedTensorsMap, context: ExecutionContext): tfc.Tensor[] | Promise; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_executor.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_executor.js new file mode 100644 index 0000000..bcf91b8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_executor.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var arithmetic = require("./executors/arithmetic_executor"); +var basicMath = require("./executors/basic_math_executor"); +var control = require("./executors/control_executor"); +var convolution = require("./executors/convolution_executor"); +var creation = require("./executors/creation_executor"); +var dynamic = require("./executors/dynamic_executor"); +var evaluation = require("./executors/evaluation_executor"); +var graph = require("./executors/graph_executor"); +var image = require("./executors/image_executor"); +var logical = require("./executors/logical_executor"); +var matrices = require("./executors/matrices_executor"); +var normalization = require("./executors/normalization_executor"); +var reduction = require("./executors/reduction_executor"); +var sliceJoin = require("./executors/slice_join_executor"); +var transformation = require("./executors/transformation_executor"); +function executeOp(node, tensorMap, context) { + switch (node.category) { + case 'arithmetic': + return arithmetic.executeOp(node, tensorMap, context); + case 'basic_math': + return basicMath.executeOp(node, tensorMap, context); + case 'control': + return control.executeOp(node, tensorMap, context); + case 'convolution': + return convolution.executeOp(node, tensorMap, context); + case 'creation': + return creation.executeOp(node, tensorMap, context); + case 'dynamic': + return dynamic.executeOp(node, tensorMap, context); + case 'evaluation': + return evaluation.executeOp(node, tensorMap, context); + case 'image': + return image.executeOp(node, tensorMap, context); + case 'graph': + return graph.executeOp(node, tensorMap, context); + case 'logical': + return logical.executeOp(node, tensorMap, context); + case 'matrices': + return matrices.executeOp(node, tensorMap, context); + case 'normalization': + return normalization.executeOp(node, tensorMap, context); + case 'reduction': + return reduction.executeOp(node, tensorMap, context); + case 'slice_join': + return sliceJoin.executeOp(node, tensorMap, context); + case 'transformation': + return transformation.executeOp(node, tensorMap, context); + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } +} +exports.executeOp = executeOp; +//# sourceMappingURL=operation_executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_mapper.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_mapper.d.ts new file mode 100644 index 0000000..dd8ef3c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_mapper.d.ts @@ -0,0 +1,18 @@ +import { tensorflow } from '../data/compiled_api'; +import { Graph } from './types'; +export declare class OperationMapper { + private static _instance; + private opMappers; + static readonly Instance: OperationMapper; + private constructor(); + private isControlFlow(node); + private isDynamicShape(node); + transformGraph(graph: tensorflow.IGraphDef): Graph; + private mapNode(node); + private getStringParam(attrs, name, def, keepCase?); + private getBoolParam(attrs, name, def); + private getNumberParam(attrs, name, def); + private getDtypeParam(attrs, name, def); + private getTensorShapeParam(attrs, name, def?); + private getNumericArrayParam(attrs, name, def); +} diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_mapper.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_mapper.js new file mode 100644 index 0000000..c8d2752 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/operation_mapper.js @@ -0,0 +1,218 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var compiled_api_1 = require("../data/compiled_api"); +var utils_1 = require("./executors/utils"); +var arithmetic = require("./op_list/arithmetic.json"); +var basicMath = require("./op_list/basic_math.json"); +var control = require("./op_list/control.json"); +var convolution = require("./op_list/convolution.json"); +var creation = require("./op_list/creation.json"); +var dynamic = require("./op_list/dynamic.json"); +var evaluation = require("./op_list/evaluation.json"); +var graph = require("./op_list/graph.json"); +var image = require("./op_list/image.json"); +var logical = require("./op_list/logical.json"); +var matrices = require("./op_list/matrices.json"); +var normalization = require("./op_list/normalization.json"); +var reduction = require("./op_list/reduction.json"); +var sliceJoin = require("./op_list/slice_join.json"); +var transformation = require("./op_list/transformation.json"); +var CONTROL_FLOW_OPS = ['Switch', 'Merge', 'Enter', 'Exit', 'NextIteration']; +var DYNAMIC_SHAPE_OPS = ['NonMaxSuppressionV2', 'NonMaxSuppressionV3', 'Where']; +var OperationMapper = (function () { + function OperationMapper() { + var ops = [ + arithmetic, basicMath, control, convolution, creation, dynamic, + evaluation, logical, image, graph, matrices, normalization, reduction, + sliceJoin, transformation + ]; + var mappersJson = [].concat.apply([], ops.map(function (op) { return op.default ? op.default : op; })); + this.opMappers = mappersJson.reduce(function (map, mapper) { + map[mapper.tfOpName] = mapper; + return map; + }, {}); + } + Object.defineProperty(OperationMapper, "Instance", { + get: function () { + return this._instance || (this._instance = new this()); + }, + enumerable: true, + configurable: true + }); + OperationMapper.prototype.isControlFlow = function (node) { + return CONTROL_FLOW_OPS.some(function (op) { return op === node.op; }); + }; + OperationMapper.prototype.isDynamicShape = function (node) { + return DYNAMIC_SHAPE_OPS.some(function (op) { return op === node.op; }); + }; + OperationMapper.prototype.transformGraph = function (graph) { + var _this = this; + var tfNodes = graph.node; + var withControlFlow = false; + var withDynamicShape = false; + var placeholders = []; + var nodes = tfNodes.reduce(function (map, node) { + map[node.name] = _this.mapNode(node); + if (_this.isControlFlow(node)) + withControlFlow = true; + if (_this.isDynamicShape(node)) + withDynamicShape = true; + if (node.op === 'Placeholder') + placeholders.push(map[node.name]); + return map; + }, {}); + var inputs = []; + var outputs = []; + Object.keys(nodes).forEach(function (key) { + var node = nodes[key]; + node.inputNames.forEach(function (name) { + var nodeName = utils_1.getNodeNameAndIndex(name)[0]; + node.inputs.push(nodes[nodeName]); + nodes[nodeName].children.push(node); + }); + if (node.inputs.length === 0) + inputs.push(node); + }); + Object.keys(nodes).forEach(function (key) { + var node = nodes[key]; + if (node.children.length === 0) + outputs.push(node); + }); + return { + nodes: nodes, + inputs: inputs, + outputs: outputs, + placeholders: placeholders, + withControlFlow: withControlFlow, + withDynamicShape: withDynamicShape + }; + }; + OperationMapper.prototype.mapNode = function (node) { + var _this = this; + var mapper = this.opMappers[node.op]; + if (mapper === undefined) { + throw new Error('Tensorflow Op is not supported: ' + node.op); + } + var newNode = { + name: node.name, + op: mapper.dlOpName, + category: mapper.category, + inputNames: (node.input || + []).map(function (input) { return input.startsWith('^') ? input.substr(1) : input; }), + inputs: [], + children: [], + params: {} + }; + if (!!mapper.params) { + newNode.params = mapper.params.reduce(function (map, param) { + var inputIndex = param.tfInputIndex; + var inputParamLength = param.tfInputParamLength; + var type = param.type; + var value = undefined; + if (inputIndex === undefined) { + switch (param.type) { + case 'string': + value = _this.getStringParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getStringParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'number': + value = _this.getNumberParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getNumberParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'number[]': + value = _this.getNumericArrayParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getNumericArrayParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'bool': + value = _this.getBoolParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getBoolParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'shape': + value = _this.getTensorShapeParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getTensorShapeParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'dtype': + value = _this.getDtypeParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getDtypeParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'tensor': + case 'tensors': + break; + default: + throw new Error("Unsupported param type: " + param.type + " for op: " + node.op); + } + } + map[param.dlParamName] = { value: value, inputIndex: inputIndex, type: type, inputParamLength: inputParamLength }; + return map; + }, {}); + } + return newNode; + }; + OperationMapper.prototype.getStringParam = function (attrs, name, def, keepCase) { + if (keepCase === void 0) { keepCase = false; } + var param = attrs[name]; + if (param !== undefined) { + var value = String.fromCharCode.apply(null, param.s); + return keepCase ? value : value.toLowerCase(); + } + return def; + }; + OperationMapper.prototype.getBoolParam = function (attrs, name, def) { + var param = attrs[name]; + return param ? param.b : def; + }; + OperationMapper.prototype.getNumberParam = function (attrs, name, def) { + var param = attrs[name]; + var value = (param ? ((param.f !== undefined) ? param.f : param.i) : def); + return (typeof value === 'number') ? value : value['toInt'](); + }; + OperationMapper.prototype.getDtypeParam = function (attrs, name, def) { + var param = attrs[name]; + if (param && param.type) { + switch (param.type) { + case compiled_api_1.tensorflow.DataType.DT_FLOAT: + return 'float32'; + case compiled_api_1.tensorflow.DataType.DT_INT32: + return 'int32'; + case compiled_api_1.tensorflow.DataType.DT_BOOL: + return 'bool'; + default: + return def; + } + } + return def; + }; + OperationMapper.prototype.getTensorShapeParam = function (attrs, name, def) { + var param = attrs[name]; + if (param && param.shape) { + return param.shape.dim.map(function (dim) { + return (typeof dim.size === 'number') ? dim.size : dim.size['toInt'](); + }); + } + return def; + }; + OperationMapper.prototype.getNumericArrayParam = function (attrs, name, def) { + var param = attrs[name]; + if (param) { + return ((param.list.f && param.list.f.length ? param.list.f : + param.list.i)) + .map(function (v) { return (typeof v === 'number') ? v : v['toInt'](); }); + } + return def; + }; + return OperationMapper; +}()); +exports.OperationMapper = OperationMapper; +//# sourceMappingURL=operation_mapper.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/types.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/types.d.ts new file mode 100644 index 0000000..c64401d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/types.d.ts @@ -0,0 +1,49 @@ +import { Tensor } from '@tensorflow/tfjs-core'; +export declare type ParamTypes = 'number' | 'string' | 'number[]' | 'bool' | 'shape' | 'tensor' | 'tensors' | 'dtype'; +export declare type Category = 'arithmetic' | 'basic_math' | 'control' | 'convolution' | 'dynamic' | 'evaluation' | 'image' | 'creation' | 'graph' | 'logical' | 'matrices' | 'normalization' | 'reduction' | 'slice_join' | 'transformation'; +export interface ParamMapper { + tfParamName?: string; + tfParamNameDeprecated?: string; + tfInputIndex?: number; + tfInputParamLength?: number; + dlParamName: string; + type: ParamTypes; + converter?: string; + defaultValue?: string | string[] | number | number[] | boolean | boolean[]; + notSupported?: boolean; +} +export interface OpMapper { + tfOpName: string; + dlOpName: string; + category: Category; + params: ParamMapper[]; + unsupportedParams: string[]; +} +export interface Node { + name: string; + op: string; + category: Category; + inputNames: string[]; + inputs: Node[]; + params: { + [key: string]: ParamValue; + }; + children: Node[]; +} +export interface Graph { + nodes: { + [key: string]: Node; + }; + placeholders: Node[]; + inputs: Node[]; + outputs: Node[]; + withControlFlow: boolean; + withDynamicShape: boolean; +} +export declare type ValueType = string | string[] | number | number[] | number[][] | boolean | boolean[] | Tensor | Tensor[]; +export interface ParamValue { + value?: ValueType; + inputIndex?: number; + inputParamLength?: number; + type: ParamTypes; +} diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/types.js b/node_modules/@tensorflow/tfjs-converter/dist/operations/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/dist/operations/typings.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/operations/typings.d.ts new file mode 100644 index 0000000..ef959c2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/operations/typings.d.ts @@ -0,0 +1,21 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +declare module '*.json' { + const value: any; + export default value; +} diff --git a/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.esm.js b/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.esm.js new file mode 100644 index 0000000..8dc7b59 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.esm.js @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +import{concat,slice,stack,tensor,tidy,unstack,util,io,Tensor,add,mod,mul,div,floorDiv,sub,minimum,maximum,pow,squaredDifference,abs,acos,acosh,asin,asinh,atan,atanh,ceil,cos,cosh,elu,erf,exp,expm1,floor,log,log1p,neg,reciprocal,relu,round,selu,sigmoid,sin,sign,sinh,softplus,sqrt,square,tanh,tan,clipByValue,scalar,conv1d,conv2d,conv2dTranspose,depthwiseConv2d,avgPool,maxPool,fill,linspace,oneHot,ones,onesLike,randomUniform,range,truncatedNormal,zeros,zerosLike,image,whereAsync,topk,tensor1d,equal,notEqual,greater,greaterEqual,less,lessEqual,logicalAnd,logicalNot,logicalOr,where,matMul,transpose,batchNormalization,localResponseNormalization,softmax,max,mean,min,sum,all,any,argMax,argMin,gather,reverse,stridedSlice,tile,split,cast,expandDims,squeeze,reshape,pad,spaceToBatchND,batchToSpaceND}from"@tensorflow/tfjs-core";var __assign=Object.assign||function(e){for(var t,a=1,r=arguments.length;a0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=u-m,v=Math.floor,I=String.fromCharCode;function O(e){throw RangeError(b[e])}function w(e,t){for(var a=e.length,r=[];a--;)r[a]=t(e[a]);return r}function V(e,t){var a=e.split("@"),r="";return a.length>1&&(r=a[0]+"@",e=a[1]),r+w((e=e.replace(P,".")).split("."),t).join(".")}function T(e){for(var t,a,r=[],n=0,o=e.length;n=55296&&t<=56319&&n65535&&(t+=I((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=I(e)}).join("")}function $(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,a){var r=0;for(e=a?v(e/c):e>>1,e+=v(e/t);e>x*l>>1;r+=u)e=v(e/x);return v(r+(x+1)*e/(e+d))}function A(e){var t,a,r,n,o,s,i,d,c,g,N,P=[],b=e.length,x=0,I=h,w=f;for((a=e.lastIndexOf(y))<0&&(a=0),r=0;r=128&&O("not-basic"),P.push(e.charCodeAt(r));for(n=a>0?a+1:0;n=b&&O("invalid-input"),((d=(N=e.charCodeAt(n++))-48<10?N-22:N-65<26?N-65:N-97<26?N-97:u)>=u||d>v((p-x)/s))&&O("overflow"),x+=d*s,!(d<(c=i<=w?m:i>=w+l?l:i-w));i+=u)s>v(p/(g=u-c))&&O("overflow"),s*=g;w=_(x-o,t=P.length+1,0==o),v(x/t)>p-I&&O("overflow"),I+=v(x/t),x%=t,P.splice(x++,0,I)}return k(P)}function S(e){var t,a,r,n,o,s,i,d,c,g,N,P,b,x,w,V=[];for(P=(e=T(e)).length,t=h,a=0,o=f,s=0;s=t&&Nv((p-a)/(b=r+1))&&O("overflow"),a+=(i-t)*b,t=i,s=0;sp&&O("overflow"),N==t){for(d=a,c=u;!(d<(g=c<=o?m:c>=o+l?l:c-o));c+=u)w=d-g,x=u-g,V.push(I($(g+w%x,0))),d=v(w/x);V.push(I($(d,0))),o=_(a,b,r==n),a=0,++r}++a,++t}return V.join("")}if(s={version:"1.3.2",ucs2:{decode:T,encode:k},decode:A,encode:S,toASCII:function(e){return V(e,function(e){return N.test(e)?"xn--"+S(e):e})},toUnicode:function(e){return V(e,function(e){return g.test(e)?A(e.slice(4).toLowerCase()):e})}},r&&n)if(e.exports==r)n.exports=s;else for(i in s)s.hasOwnProperty(i)&&(r[i]=s[i]);else a.punycode=s}(commonjsGlobal)}),util$1={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var decode=function(e,t,a,r){t=t||"&",a=a||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var i=e.length;s>0&&i>s&&(i=s);for(var p=0;p=0?(u=c.substr(0,f),m=c.substr(f+1)):(u=c,m=""),l=decodeURIComponent(u),d=decodeURIComponent(m),hasOwnProperty(n,l)?Array.isArray(n[l])?n[l].push(d):n[l]=[n[l],d]:n[l]=d}return n},stringifyPrimitive=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},encode=function(e,t,a,r){return t=t||"&",a=a||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(r){var n=encodeURIComponent(stringifyPrimitive(r))+a;return Array.isArray(e[r])?e[r].map(function(e){return n+encodeURIComponent(stringifyPrimitive(e))}).join(t):n+encodeURIComponent(stringifyPrimitive(e[r]))}).join(t):r?encodeURIComponent(stringifyPrimitive(r))+a+encodeURIComponent(stringifyPrimitive(e)):""},querystring=createCommonjsModule(function(e,t){t.decode=t.parse=decode,t.encode=t.stringify=encode}),querystring_1=querystring.decode,querystring_2=querystring.parse,querystring_3=querystring.encode,querystring_4=querystring.stringify,parse=urlParse,format=urlFormat;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function urlParse(e,t,a){if(e&&util$1.isObject(e)&&e instanceof Url)return e;var r=new Url;return r.parse(e,t,a),r}function urlFormat(e){return util$1.isString(e)&&(e=urlParse(e)),e instanceof Url?e.format():Url.prototype.format.call(e)}Url.prototype.parse=function(e,t,a){if(!util$1.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),n=-1!==r&&r127?b+="x":b+=P[x];if(!b.match(hostnamePartPattern)){var I=g.slice(0,f),O=g.slice(f+1),w=P.match(hostnamePartStart);w&&(I.push(w[1]),O.unshift(w[2])),O.length&&(s="/"+O.join(".")+s),this.hostname=I.join(".");break}}}this.hostname.length>hostnameMaxLen?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=punycode.toASCII(this.hostname));var V=this.port?":"+this.port:"",T=this.hostname||"";this.host=T+V,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!unsafeProtocol[u])for(f=0,N=autoEscape.length;f0)&&a.host.split("@"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift());return a.search=e.search,a.query=e.query,util$1.isNull(a.pathname)&&util$1.isNull(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.href=a.format(),a}if(!P.length)return a.pathname=null,a.search?a.path="/"+a.search:a.path=null,a.href=a.format(),a;for(var x=P.slice(-1)[0],v=(a.host||e.host||P.length>1)&&("."===x||".."===x)||""===x,I=0,O=P.length;O>=0;O--)"."===(x=P[O])?P.splice(O,1):".."===x?(P.splice(O,1),I++):I&&(P.splice(O,1),I--);if(!g&&!N)for(;I--;I)P.unshift("..");!g||""===P[0]||P[0]&&"/"===P[0].charAt(0)||P.unshift(""),v&&"/"!==P.join("/").substr(-1)&&P.push("");var w,V=""===P[0]||P[0]&&"/"===P[0].charAt(0);b&&(a.hostname=a.host=V?"":P.length?P.shift():"",(w=!!(a.host&&a.host.indexOf("@")>0)&&a.host.split("@"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift()));return(g=g||a.host&&P.length)&&!V&&P.unshift(""),P.length?a.pathname=P.join("/"):(a.pathname=null,a.path=null),util$1.isNull(a.pathname)&&util$1.isNull(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.auth=e.auth||a.auth,a.slashes=a.slashes||e.slashes,a.href=a.format(),a},Url.prototype.parseHost=function(){var e=this.host,t=portPattern.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var aspromise=asPromise;function asPromise(e,t){for(var a=new Array(arguments.length-1),r=0,n=2,o=!0;n1&&"="===e.charAt(t);)++a;return Math.ceil(3*e.length)/4-a};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;a.encode=function(e,t,a){for(var n,o=null,s=[],i=0,p=0;t>2],n=(3&u)<<4,p=1;break;case 1:s[i++]=r[n|u>>4],n=(15&u)<<2,p=2;break;case 2:s[i++]=r[n|u>>6],s[i++]=r[63&u],p=0}i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),i=0)}return p&&(s[i++]=r[n],s[i++]=61,1===p&&(s[i++]=61)),o?(i&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join("")):String.fromCharCode.apply(String,s.slice(0,i))};a.decode=function(e,t,a){for(var r,o=a,s=0,i=0;i1)break;if(void 0===(p=n[p]))throw Error("invalid encoding");switch(s){case 0:r=p,s=1;break;case 1:t[a++]=r<<2|(48&p)>>4,r=p,s=2;break;case 2:t[a++]=(15&r)<<4|(60&p)>>2,r=p,s=3;break;case 3:t[a++]=(3&r)<<6|p,s=0}}if(1===s)throw Error("invalid encoding");return a-o},a.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}),eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(e,t,a){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:a||this}),this},EventEmitter.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var a=this._listeners[e],r=0;r0?0:2147483648,a,r);else if(isNaN(t))e(2143289344,a,r);else if(t>3.4028234663852886e38)e((n<<31|2139095040)>>>0,a,r);else if(t<1.1754943508222875e-38)e((n<<31|Math.round(t/1.401298464324817e-45))>>>0,a,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((n<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,a,r)}}function a(e,t,a){var r=e(t,a),n=2*(r>>31)+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:n*(1/0):0===o?1.401298464324817e-45*n*s:n*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,writeUintLE),e.writeFloatBE=t.bind(null,writeUintBE),e.readFloatLE=a.bind(null,readUintLE),e.readFloatBE=a.bind(null,readUintBE)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),a=new Uint8Array(t.buffer),r=128===a[7];function n(e,r,n){t[0]=e,r[n]=a[0],r[n+1]=a[1],r[n+2]=a[2],r[n+3]=a[3],r[n+4]=a[4],r[n+5]=a[5],r[n+6]=a[6],r[n+7]=a[7]}function o(e,r,n){t[0]=e,r[n]=a[7],r[n+1]=a[6],r[n+2]=a[5],r[n+3]=a[4],r[n+4]=a[3],r[n+5]=a[2],r[n+6]=a[1],r[n+7]=a[0]}function s(e,r){return a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],t[0]}function i(e,r){return a[7]=e[r],a[6]=e[r+1],a[5]=e[r+2],a[4]=e[r+3],a[3]=e[r+4],a[2]=e[r+5],a[1]=e[r+6],a[0]=e[r+7],t[0]}e.writeDoubleLE=r?n:o,e.writeDoubleBE=r?o:n,e.readDoubleLE=r?s:i,e.readDoubleBE=r?i:s}():function(){function t(e,t,a,r,n,o){var s=r<0?1:0;if(s&&(r=-r),0===r)e(0,n,o+t),e(1/r>0?0:2147483648,n,o+a);else if(isNaN(r))e(0,n,o+t),e(2146959360,n,o+a);else if(r>1.7976931348623157e308)e(0,n,o+t),e((s<<31|2146435072)>>>0,n,o+a);else{var i;if(r<2.2250738585072014e-308)e((i=r/5e-324)>>>0,n,o+t),e((s<<31|i/4294967296)>>>0,n,o+a);else{var p=Math.floor(Math.log(r)/Math.LN2);1024===p&&(p=1023),e(4503599627370496*(i=r*Math.pow(2,-p))>>>0,n,o+t),e((s<<31|p+1023<<20|1048576*i&1048575)>>>0,n,o+a)}}}function a(e,t,a,r,n){var o=e(r,n+t),s=e(r,n+a),i=2*(s>>31)+1,p=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===p?u?NaN:i*(1/0):0===p?5e-324*i*u:i*Math.pow(2,p-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,writeUintLE,0,4),e.writeDoubleBE=t.bind(null,writeUintBE,4,0),e.readDoubleLE=a.bind(null,readUintLE,0,4),e.readDoubleBE=a.bind(null,readUintBE,4,0)}(),e}function writeUintLE(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}function writeUintBE(e,t,a){t[a]=e>>>24,t[a+1]=e>>>16&255,t[a+2]=e>>>8&255,t[a+3]=255&e}function readUintLE(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function readUintBE(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod$$1=eval("quire".replace(/^/,"re"))(moduleName);if(mod$$1&&(mod$$1.length||Object.keys(mod$$1).length))return mod$$1}catch(e){}return null}var utf8_1=createCommonjsModule(function(e,t){var a=t;a.length=function(e){for(var t=0,a=0,r=0;r191&&r<224?o[s++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(r>>10),o[s++]=56320+(1023&r)):o[s++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join("")):String.fromCharCode.apply(String,o.slice(0,s))},a.write=function(e,t,a){for(var r,n,o=a,s=0;s>6|192,t[a++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&n),++s,t[a++]=r>>18|240,t[a++]=r>>12&63|128,t[a++]=r>>6&63|128,t[a++]=63&r|128):(t[a++]=r>>12|224,t[a++]=r>>6&63|128,t[a++]=63&r|128);return a-o}}),pool_1=pool;function pool(e,t,a){var r=a||8192,n=r>>>1,o=null,s=r;return function(a){if(a<1||a>n)return e(a);s+a>r&&(o=e(r),s=0);var i=t.call(o,s,s+=a);return 7&s&&(s=1+(7|s)),i}}var longbits=LongBits;function LongBits(e,t){this.lo=e>>>0,this.hi=t>>>0}var zero=LongBits.zero=new LongBits(0,0);zero.toNumber=function(){return 0},zero.zzEncode=zero.zzDecode=function(){return this},zero.length=function(){return 1};var zeroHash=LongBits.zeroHash="\0\0\0\0\0\0\0\0";LongBits.fromNumber=function(e){if(0===e)return zero;var t=e<0;t&&(e=-e);var a=e>>>0,r=(e-a)/4294967296>>>0;return t&&(r=~r>>>0,a=~a>>>0,++a>4294967295&&(a=0,++r>4294967295&&(r=0))),new LongBits(a,r)},LongBits.from=function(e){if("number"==typeof e)return LongBits.fromNumber(e);if(minimal.isString(e)){if(!minimal.Long)return LongBits.fromNumber(parseInt(e,10));e=minimal.Long.fromString(e)}return e.low||e.high?new LongBits(e.low>>>0,e.high>>>0):zero},LongBits.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,a=~this.hi>>>0;return t||(a=a+1>>>0),-(t+4294967296*a)}return this.lo+4294967296*this.hi},LongBits.prototype.toLong=function(e){return minimal.Long?new minimal.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var charCodeAt=String.prototype.charCodeAt;LongBits.fromHash=function(e){return e===zeroHash?zero:new LongBits((charCodeAt.call(e,0)|charCodeAt.call(e,1)<<8|charCodeAt.call(e,2)<<16|charCodeAt.call(e,3)<<24)>>>0,(charCodeAt.call(e,4)|charCodeAt.call(e,5)<<8|charCodeAt.call(e,6)<<16|charCodeAt.call(e,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},LongBits.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},LongBits.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,a=this.hi>>>24;return 0===a?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:a<128?9:10};var minimal=createCommonjsModule(function(e,t){var a=t;function r(e,t,a){for(var r=Object.keys(t),n=0;n0)},a.Buffer=function(){try{var e=a.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),a._Buffer_from=null,a._Buffer_allocUnsafe=null,a.newBuffer=function(e){return"number"==typeof e?a.Buffer?a._Buffer_allocUnsafe(e):new a.Array(e):a.Buffer?a._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},a.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,a.Long=commonjsGlobal.dcodeIO&&commonjsGlobal.dcodeIO.Long||a.inquire("long"),a.key2Re=/^true|false|0|1$/,a.key32Re=/^-?(?:0|[1-9][0-9]*)$/,a.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,a.longToHash=function(e){return e?a.LongBits.from(e).toHash():a.LongBits.zeroHash},a.longFromHash=function(e,t){var r=a.LongBits.fromHash(e);return a.Long?a.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},a.merge=r,a.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},a.newError=n,a.ProtocolError=n("ProtocolError"),a.oneOfGetter=function(e){for(var t={},a=0;a-1;--a)if(1===t[e[a]]&&void 0!==this[e[a]]&&null!==this[e[a]])return e[a]}},a.oneOfSetter=function(e){return function(t){for(var a=0;a127;)t[a++]=127&e|128,e>>>=7;t[a]=e}function VarintOp(e,t){this.len=e,this.next=void 0,this.val=t}function writeVarint64(e,t,a){for(;e.hi;)t[a++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[a++]=127&e.lo|128,e.lo=e.lo>>>7;t[a++]=e.lo}function writeFixed32(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}Writer.create=minimal.Buffer?function(){return(Writer.create=function(){return new BufferWriter})()}:function(){return new Writer},Writer.alloc=function(e){return new minimal.Array(e)},minimal.Array!==Array&&(Writer.alloc=minimal.pool(Writer.alloc,minimal.Array.prototype.subarray)),Writer.prototype._push=function(e,t,a){return this.tail=this.tail.next=new Op(e,t,a),this.len+=t,this},VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new VarintOp((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},Writer.prototype.int32=function(e){return e<0?this._push(writeVarint64,10,LongBits$1.fromNumber(e)):this.uint32(e)},Writer.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},Writer.prototype.uint64=function(e){var t=LongBits$1.from(e);return this._push(writeVarint64,t.length(),t)},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(e){var t=LongBits$1.from(e).zzEncode();return this._push(writeVarint64,t.length(),t)},Writer.prototype.bool=function(e){return this._push(writeByte,1,e?1:0)},Writer.prototype.fixed32=function(e){return this._push(writeFixed32,4,e>>>0)},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(e){var t=LongBits$1.from(e);return this._push(writeFixed32,4,t.lo)._push(writeFixed32,4,t.hi)},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(e){return this._push(minimal.float.writeFloatLE,4,e)},Writer.prototype.double=function(e){return this._push(minimal.float.writeDoubleLE,8,e)};var writeBytes=minimal.Array.prototype.set?function(e,t,a){t.set(e,a)}:function(e,t,a){for(var r=0;r>>0;if(!t)return this._push(writeByte,1,0);if(minimal.isString(e)){var a=Writer.alloc(t=base64.length(e));base64.decode(e,a,0),e=a}return this.uint32(t)._push(writeBytes,t,e)},Writer.prototype.string=function(e){var t=utf8.length(e);return t?this.uint32(t)._push(utf8.write,t,e):this._push(writeByte,1,0)},Writer.prototype.fork=function(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this},Writer.prototype.ldelim=function(){var e=this.head,t=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=e.next,this.tail=t,this.len+=a),this},Writer.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),a=0;e;)e.fn(e.val,t,a),a+=e.len,e=e.next;return t},Writer._configure=function(e){BufferWriter=e};var writer_buffer=BufferWriter$1;(BufferWriter$1.prototype=Object.create(writer.prototype)).constructor=BufferWriter$1;var Buffer=minimal.Buffer;function BufferWriter$1(){writer.call(this)}BufferWriter$1.alloc=function(e){return(BufferWriter$1.alloc=minimal._Buffer_allocUnsafe)(e)};var writeBytesBuffer=Buffer&&Buffer.prototype instanceof Uint8Array&&"set"===Buffer.prototype.set.name?function(e,t,a){t.set(e,a)}:function(e,t,a){if(e.copy)e.copy(t,a,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this._push(writeBytesBuffer,t,e),this},BufferWriter$1.prototype.string=function(e){var t=Buffer.byteLength(e);return this.uint32(t),t&&this._push(writeStringBuffer,t,e),this};var reader=Reader,BufferReader,LongBits$2=minimal.LongBits,utf8$1=minimal.utf8;function indexOutOfRange(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function Reader(e){this.buf=e,this.pos=0,this.len=e.length}var create_array="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Reader(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Reader(e);throw Error("illegal buffer")};function readLongVarint(){var e=new LongBits$2(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function readFixed32_end(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits$2(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader.create=minimal.Buffer?function(e){return(Reader.create=function(e){return minimal.Buffer.isBuffer(e)?new BufferReader(e):create_array(e)})(e)}:create_array,Reader.prototype._slice=minimal.Array.prototype.subarray||minimal.Array.prototype.slice,Reader.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return e}}(),Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},Reader.prototype.bool=function(){return 0!==this.uint32()},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},Reader.prototype.bytes=function(){var e=this.uint32(),t=this.pos,a=this.pos+e;if(a>this.len)throw indexOutOfRange(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,a):t===a?new this.buf.constructor(0):this._slice.call(this.buf,t,a)},Reader.prototype.string=function(){var e=this.bytes();return utf8$1.read(e,0,e.length)},Reader.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw indexOutOfRange(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw indexOutOfRange(this)}while(128&this.buf[this.pos++]);return this},Reader.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},Reader._configure=function(e){BufferReader=e;var t=minimal.Long?"toLong":"toNumber";minimal.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader$1;function BufferReader$1(e){reader.call(this,e)}(BufferReader$1.prototype=Object.create(reader.prototype)).constructor=BufferReader$1,minimal.Buffer&&(BufferReader$1.prototype._slice=minimal.Buffer.prototype.slice),BufferReader$1.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))};var service=Service;function Service(e,t,a){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");minimal.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(a)}(Service.prototype=Object.create(minimal.EventEmitter.prototype)).constructor=Service,Service.prototype.rpcCall=function e(t,a,r,n,o){if(!n)throw TypeError("request must be specified");var s=this;if(!o)return minimal.asPromise(e,s,t,a,r,n);if(s.rpcImpl)try{return s.rpcImpl(t,a[s.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,a){if(e)return s.emit("error",e,t),o(e);if(null!==a){if(!(a instanceof r))try{a=r[s.responseDelimited?"decodeDelimited":"decode"](a)}catch(e){return s.emit("error",e,t),o(e)}return s.emit("data",a,t),o(null,a)}s.end(!0)})}catch(e){return s.emit("error",e,t),void setTimeout(function(){o(e)},0)}else setTimeout(function(){o(Error("already ended"))},0)},Service.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};var rpc_1=createCommonjsModule(function(e,t){t.Service=service}),roots={},indexMinimal=createCommonjsModule(function(e,t){var a=t;function r(){a.Reader._configure(a.BufferReader),a.util._configure()}a.build="minimal",a.Writer=writer,a.BufferWriter=writer_buffer,a.Reader=reader,a.BufferReader=reader_buffer,a.util=minimal,a.rpc=rpc_1,a.roots=roots,a.configure=r,a.Writer._configure(a.BufferWriter),r()}),minimal$1=indexMinimal,minimal_1=minimal$1.roots,minimal_2=minimal$1.Reader,minimal_3=minimal$1.util,$Reader=minimal$1.Reader,$util=minimal$1.util,$root=minimal$1.roots.default||(minimal$1.roots.default={});$root.tensorflow=function(){var e,t,a={};return a.Any=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.typeUrl=e.string();break;case 2:r.value=e.bytes();break;default:e.skipType(7&n)}}return r},e}(),a.DataType=(e={},(t=Object.create(e))[e[0]="DT_INVALID"]=0,t[e[1]="DT_FLOAT"]=1,t[e[2]="DT_DOUBLE"]=2,t[e[3]="DT_INT32"]=3,t[e[4]="DT_UINT8"]=4,t[e[5]="DT_INT16"]=5,t[e[6]="DT_INT8"]=6,t[e[7]="DT_STRING"]=7,t[e[8]="DT_COMPLEX64"]=8,t[e[9]="DT_INT64"]=9,t[e[10]="DT_BOOL"]=10,t[e[11]="DT_QINT8"]=11,t[e[12]="DT_QUINT8"]=12,t[e[13]="DT_QINT32"]=13,t[e[14]="DT_BFLOAT16"]=14,t[e[101]="DT_FLOAT_REF"]=101,t[e[102]="DT_DOUBLE_REF"]=102,t[e[103]="DT_INT32_REF"]=103,t[e[104]="DT_UINT8_REF"]=104,t[e[105]="DT_INT16_REF"]=105,t[e[106]="DT_INT8_REF"]=106,t[e[107]="DT_STRING_REF"]=107,t[e[108]="DT_COMPLEX64_REF"]=108,t[e[109]="DT_INT64_REF"]=109,t[e[110]="DT_BOOL_REF"]=110,t[e[111]="DT_QINT8_REF"]=111,t[e[112]="DT_QUINT8_REF"]=112,t[e[113]="DT_QINT32_REF"]=113,t[e[114]="DT_BFLOAT16_REF"]=114,t),a.TensorShape=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.dim&&r.dim.length||(r.dim=[]),r.dim.push($root.tensorflow.TensorShape.Dim.decode(e,e.uint32()));break;case 3:r.unknownRank=e.bool();break;default:e.skipType(7&n)}}return r},e.Dim=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.size=e.int64();break;case 2:r.name=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.Tensor=function(){function e(e){if(this.floatVal=[],this.doubleVal=[],this.intVal=[],this.stringVal=[],this.scomplexVal=[],this.int64Val=[],this.boolVal=[],this.uint32Val=[],this.uint64Val=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.dtype=e.int32();break;case 2:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 3:r.versionNumber=e.int32();break;case 4:r.tensorContent=e.bytes();break;case 5:if(r.floatVal&&r.floatVal.length||(r.floatVal=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.list=$root.tensorflow.AttrValue.ListValue.decode(e,e.uint32());break;case 2:r.s=e.bytes();break;case 3:r.i=e.int64();break;case 4:r.f=e.float();break;case 5:r.b=e.bool();break;case 6:r.type=e.int32();break;case 7:r.shape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 8:r.tensor=$root.tensorflow.Tensor.decode(e,e.uint32());break;case 9:r.placeholder=e.string();break;case 10:r.func=$root.tensorflow.NameAttrList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.ListValue=function(){function e(e){if(this.s=[],this.i=[],this.f=[],this.b=[],this.type=[],this.shape=[],this.tensor=[],this.func=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.s&&r.s.length||(r.s=[]),r.s.push(e.bytes());break;case 3:if(r.i&&r.i.length||(r.i=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.name=e.string();break;case 2:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),a.NodeDef=function(){function e(e){if(this.input=[],this.attr={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.name=e.string();break;case 2:n.op=e.string();break;case 3:n.input&&n.input.length||(n.input=[]),n.input.push(e.string());break;case 4:n.device=e.string();break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),a.VersionDef=function(){function e(e){if(this.badConsumers=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.producer=e.int32();break;case 2:r.minConsumer=e.int32();break;case 3:if(r.badConsumers&&r.badConsumers.length||(r.badConsumers=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:r.versions=$root.tensorflow.VersionDef.decode(e,e.uint32());break;case 2:r.library=$root.tensorflow.FunctionDefLibrary.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),a.CollectionDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.nodeList=$root.tensorflow.CollectionDef.NodeList.decode(e,e.uint32());break;case 2:r.bytesList=$root.tensorflow.CollectionDef.BytesList.decode(e,e.uint32());break;case 3:r.int64List=$root.tensorflow.CollectionDef.Int64List.decode(e,e.uint32());break;case 4:r.floatList=$root.tensorflow.CollectionDef.FloatList.decode(e,e.uint32());break;case 5:r.anyList=$root.tensorflow.CollectionDef.AnyList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.NodeList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.string());break;default:e.skipType(7&n)}}return r},e}(),e.BytesList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.bytes());break;default:e.skipType(7&n)}}return r},e}(),e.Int64List=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push($root.tensorflow.Any.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),e}(),a.SaverDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.filenameTensorName=e.string();break;case 2:r.saveTensorName=e.string();break;case 3:r.restoreOpName=e.string();break;case 4:r.maxToKeep=e.int32();break;case 5:r.sharded=e.bool();break;case 6:r.keepCheckpointEveryNHours=e.float();break;case 7:r.version=e.int32();break;default:e.skipType(7&n)}}return r},e.CheckpointFormatVersion=(t={},(a=Object.create(t))[t[0]="LEGACY"]=0,a[t[1]="V1"]=1,a[t[2]="V2"]=2,a),e}(),a.TensorInfo=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 4:r.cooSparse=$root.tensorflow.TensorInfo.CooSparse.decode(e,e.uint32());break;case 2:r.dtype=e.int32();break;case 3:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.CooSparse=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.valuesTensorName=e.string();break;case 2:r.indicesTensorName=e.string();break;case 3:r.denseShapeTensorName=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.SignatureDef=function(){function e(e){if(this.inputs={},this.outputs={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:e.skip().pos++,n.inputs===$util.emptyObject&&(n.inputs={}),a=e.string(),e.pos++,n.inputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:e.skip().pos++,n.outputs===$util.emptyObject&&(n.outputs={}),a=e.string(),e.pos++,n.outputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 3:n.methodName=e.string();break;default:e.skipType(7&o)}}return n},e}(),a.AssetFileDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.tensorInfo=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:r.filename=e.string();break;default:e.skipType(7&n)}}return r},e}(),a.OpDef=function(){function e(e){if(this.inputArg=[],this.outputArg=[],this.attr=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.inputArg&&r.inputArg.length||(r.inputArg=[]),r.inputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 3:r.outputArg&&r.outputArg.length||(r.outputArg=[]),r.outputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 4:r.attr&&r.attr.length||(r.attr=[]),r.attr.push($root.tensorflow.OpDef.AttrDef.decode(e,e.uint32()));break;case 8:r.deprecation=$root.tensorflow.OpDef.OpDeprecation.decode(e,e.uint32());break;case 5:r.summary=e.string();break;case 6:r.description=e.string();break;case 18:r.isCommutative=e.bool();break;case 16:r.isAggregate=e.bool();break;case 17:r.isStateful=e.bool();break;case 19:r.allowsUninitializedInput=e.bool();break;default:e.skipType(7&n)}}return r},e.ArgDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.description=e.string();break;case 3:r.type=e.int32();break;case 4:r.typeAttr=e.string();break;case 5:r.numberAttr=e.string();break;case 6:r.typeListAttr=e.string();break;case 16:r.isRef=e.bool();break;default:e.skipType(7&n)}}return r},e}(),e.AttrDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.type=e.string();break;case 3:r.defaultValue=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 4:r.description=e.string();break;case 5:r.hasMinimum=e.bool();break;case 6:r.minimum=e.int64();break;case 7:r.allowedValues=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),e.OpDeprecation=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.version=e.int32();break;case 2:r.explanation=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.OpList=function(){function e(e){if(this.op=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.op&&r.op.length||(r.op=[]),r.op.push($root.tensorflow.OpDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),a.MetaGraphDef=function(){function e(e){if(this.collectionDef={},this.signatureDef={},this.assetFileDef=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.metaInfoDef=$root.tensorflow.MetaGraphDef.MetaInfoDef.decode(e,e.uint32());break;case 2:n.graphDef=$root.tensorflow.GraphDef.decode(e,e.uint32());break;case 3:n.saverDef=$root.tensorflow.SaverDef.decode(e,e.uint32());break;case 4:e.skip().pos++,n.collectionDef===$util.emptyObject&&(n.collectionDef={}),a=e.string(),e.pos++,n.collectionDef[a]=$root.tensorflow.CollectionDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.signatureDef===$util.emptyObject&&(n.signatureDef={}),a=e.string(),e.pos++,n.signatureDef[a]=$root.tensorflow.SignatureDef.decode(e,e.uint32());break;case 6:n.assetFileDef&&n.assetFileDef.length||(n.assetFileDef=[]),n.assetFileDef.push($root.tensorflow.AssetFileDef.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.MetaInfoDef=function(){function e(e){if(this.tags=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.metaGraphVersion=e.string();break;case 2:r.strippedOpList=$root.tensorflow.OpList.decode(e,e.uint32());break;case 3:r.anyInfo=$root.tensorflow.Any.decode(e,e.uint32());break;case 4:r.tags&&r.tags.length||(r.tags=[]),r.tags.push(e.string());break;case 5:r.tensorflowVersion=e.string();break;case 6:r.tensorflowGitVersion=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.SavedModel=function(){function e(e){if(this.metaGraphs=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.savedModelSchemaVersion=e.int64();break;case 2:r.metaGraphs&&r.metaGraphs.length||(r.metaGraphs=[]),r.metaGraphs.push($root.tensorflow.MetaGraphDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),a.FunctionDefLibrary=function(){function e(e){if(this.function=[],this.gradient=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.function&&r.function.length||(r.function=[]),r.function.push($root.tensorflow.FunctionDef.decode(e,e.uint32()));break;case 2:r.gradient&&r.gradient.length||(r.gradient=[]),r.gradient.push($root.tensorflow.GradientDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),a.FunctionDef=function(){function e(e){if(this.attr={},this.nodeDef=[],this.ret={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.signature=$root.tensorflow.OpDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 3:n.nodeDef&&n.nodeDef.length||(n.nodeDef=[]),n.nodeDef.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:e.skip().pos++,n.ret===$util.emptyObject&&(n.ret={}),a=e.string(),e.pos++,n.ret[a]=e.string();break;default:e.skipType(7&o)}}return n},e}(),a.GradientDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.functionName=e.string();break;case 2:r.gradientFunc=e.string();break;default:e.skipType(7&n)}}return r},e}(),a}();var compiled_api=$root,compiled_api_1=compiled_api.tensorflow;function getParamValue(e,t,a,r){var n=t.params[e];if(n&&void 0!==n.inputIndex){if("tensor"===n.type)return getTensor(t.inputNames[n.inputIndex],a,r);if("tensors"===n.type)return(0===n.inputIndex?0===n.inputParamLength?t.inputNames:t.inputNames.slice(n.inputIndex,-n.inputParamLength):t.inputNames.splice(n.inputIndex)).map(function(e){return getTensor(e,a,r)});var o=Array.prototype.slice.call(getTensor(t.inputNames.slice(n.inputIndex)[0],a,r).dataSync());return"number"===n.type?o[0]:o}return n&&n.value}function getTensor(e,t,a){var r=parseNodeName(e),n=r[0],o=r[1],s=a.currentContextIds.find(function(e){return!!t[getNodeNameWithContextId(n,e)]});return void 0!==s?t[getNodeNameWithContextId(n,s)][o]:void 0}function getNodeNameAndIndex(e,t){var a=parseNodeName(e),r=a[0],n=a[1];return[getNodeNameWithContextId(r,t&&t.currentContextId),n]}function getNodeNameWithContextId(e,t){return t?e+"-"+t:e}function parseNodeName(e){var t=e.lastIndexOf(":");return-1===t?[e,0]:[e.substring(0,t),Number(e.substring(t+1))]}function split$1(e,t){for(var a=[],r=0;r=this.tensors.length)throw new Error("Tried to read from index "+e+", but array size is: "+this.tensors.length);var t=this.tensors[e];if(t.cleared)throw new Error("TensorArray "+this.name+": Could not read index "+e+" twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).");return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor},e.prototype.readMany=function(e){var t=this;return e.map(function(e){return t.read(e)})},e.prototype.write=function(e,t){if(this.closed_)throw new Error("TensorArray "+this.name+" has already been closed.");if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error("Tried to write to index "+e+", but array is not resizeable and size is: "+this.maxSize);var a=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+",\n because the value dtype is "+t.dtype+", but TensorArray dtype is "+this.dtype+".");if(0===this.size()&&0===this.elementShape.length&&(this.elementShape=t.shape),util.assertShapesMatch(this.elementShape,t.shape,"TensorArray "+this.name+": Could not write to TensorArray index "+e+"."),a&&a.read)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been read.");if(a&&a.written)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been written.");a.tensor=t,a.written=!0,this.tensors[e]=a},e.prototype.writeMany=function(e,t){var a=this;if(e.length!==t.length)throw new Error("TensorArray "+this.name+": could not write multiple tensors,because the index size: "+e.length+" is not the same as tensors size: "+t.length+".");e.map(function(e,r){return a.write(e,t[r])})},e.prototype.gather=function(e,t){if(t&&t!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but gather requested dtype "+t);if(!e){e=[];for(var a=0;a=this.maxSize)throw new Error("Max index must be < array size ("+a+" vs. "+this.maxSize+")");this.writeMany(e,unstack(t,0))},e.prototype.split=function(e,t){var a=this;if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but tensor has dtype "+t.dtype);var r=0,n=e.map(function(e){return r+=e});if(r!==t.shape[0])throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n "+r+", and tensor's shape is: "+t.shape);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error("TensorArray's size is not equal to the size of lengths ("+this.maxSize+" vs. "+e.length+"), and the TensorArray is not marked as dynamically resizeable");var o=0===r?0:t.size/r,s=[];tidy(function(){t=t.reshape([1,r,o]);for(var i=0;i1)for(var f=1;f1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()},e.prototype.nextIteration=function(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");this.contexts=this.contexts.slice(),this.lastId++;var e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))},e.prototype.getWeight=function(e){return this.weightMap[e]},e.prototype.addTensorArray=function(e){this.tensorArrayMap[e.id]=e},e.prototype.getTensorArray=function(e){return this.tensorArrayMap[e]},e}(),GraphExecutor=function(){function e(e){this.graph=e,this.compiledOrder=[],this._weightMap={},this.placeholders=e.placeholders,this._outputs=e.outputs,this.compile()}return Object.defineProperty(e.prototype,"weightMap",{get:function(){return this._weightMap},set:function(e){var t=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})});this.weightIds=[].concat.apply([],t),this._weightMap=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.placeholders.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this._outputs.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.placeholders.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.outputs.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isControlFlowModel",{get:function(){return this.graph.withControlFlow},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDynamicShapeModel",{get:function(){return this.graph.withDynamicShape},enumerable:!0,configurable:!0}),e.prototype.compile=function(){if(!this.graph.withControlFlow&&!this.graph.withDynamicShape)for(var e=this.graph.inputs.slice(),t={};e.length>0;){var a=e.pop();t[a.name]=!0,this.compiledOrder.push(a),a.children.forEach(function(a){!t[a.name]&&a.inputNames.every(function(e){var a=getNodeNameAndIndex(e)[0];return t[a]})&&e.push(a)})}},e.prototype.execute=function(e,t){var a=this;this.checkInput(e),this.checkInputShapeAndType(e);var r={};return tidy(function(){var n=new ExecutionContext(a._weightMap,r),o=a.compiledOrder.reduce(function(e,t){return e[t.name]=executeOp$15(t,e,n),e},__assign({},a.weightMap,e));return a.findOutputs(o,n,t)})},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u=this;return __generator(this,function(m){switch(m.label){case 0:return this.checkInput(e),this.checkInputShapeAndType(e),a={},r=new ExecutionContext(this._weightMap,a),[4,this.executeWithControlFlow(e,r)];case 1:return n=m.sent(),o=this.findOutputs(n,r,t),s=Object.keys(o).map(function(e){return o[e].id}),i=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})}),p=[].concat.apply([],i),Object.keys(n).forEach(function(e){n[e].forEach(function(e){e&&-1===s.indexOf(e.id)&&-1===p.indexOf(e.id)&&-1===u.weightIds.indexOf(e.id)&&e.dispose()})}),[2,o]}})})},e.prototype.executeWithControlFlow=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u;return __generator(this,function(m){switch(m.label){case 0:a=this.graph.inputs.map(function(e){return{node:e,contexts:t.currentContext}}),r=__assign({},this.weightMap,e),n={},m.label=1;case 1:return a.length>0?(o=a.pop(),t.currentContext=o.contexts,s="","enter"===o.node.op&&getParamValue("isConstant",o.node,r,t)&&(s=getNodeNameAndIndex(o.node.name,t)[0]),i=executeOp$15(o.node,r,t),s||(s=getNodeNameAndIndex(o.node.name,t)[0]),p=r,u=s,[4,i]):[3,3];case 2:return p[u]=m.sent(),o.node.children.forEach(function(e){var o=getNodeNameAndIndex(e.name,t)[0];n[o]||("merge"===e.op?e.inputNames.some(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})):e.inputNames.every(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})))}),[3,1];case 3:return[2,r]}})})},e.prototype.findOutputs=function(e,t,a){return!a||a instanceof Array||(a=[a]),(a||this.graph.outputs.map(function(e){return e.name})).reduce(function(a,r){return a[r]=getTensor(r,e,t),a},{})},e.prototype.dispose=function(){var e=this;Object.keys(this.weightMap).forEach(function(t){return e.weightMap[t].forEach(function(e){return e.dispose()})})},e.prototype.checkInputShapeAndType=function(e){this.placeholders.forEach(function(t){var a=e[t.name][0];if(t.params.shape&&t.params.shape.value){var r=t.params.shape.value,n=r.length===a.shape.length&&a.shape.every(function(e,t){return-1===r[t]||r[t]===e});util.assert(n,"The shape of dict['"+t.name+"'] provided in model.execute(dict) must be ["+r+"], but was ["+a.shape+"]")}t.params.dtype&&t.params.dtype.value&&util.assert(a.dtype===t.params.dtype.value,"The dtype of dict['"+t.name+"'] provided in model.execute(dict) must be "+t.params.dtype.value+", but was "+a.dtype)})},e.prototype.checkInput=function(e){var t=this,a=Object.keys(e),r=[],n=[];if(this.inputNodes.forEach(function(e){-1===a.indexOf(e)&&r.push(e)}),a.forEach(function(e){-1===t.inputNodes.indexOf(e)&&n.push(e)}),r.length>0)throw new Error("The dict provided in model.execute(dict) has the keys ["+a+"], but is missing the required keys: ["+r+"].");if(n.length>0)throw new Error("The dict provided in model.execute(dict) has unused keys: ["+n+"]. Please provide only the following keys: ["+this.inputNodes+"].")},e}(),FrozenModel=function(){function e(e,t,a){this.modelUrl=e,this.weightManifestUrl=t,this.requestOption=a,this.version="n/a",this.pathPrefix=this.getPathPrefix()}return Object.defineProperty(e.prototype,"modelVersion",{get:function(){return this.version},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.executor.inputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.executor.outputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.executor.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this.executor.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weights",{get:function(){return this.executor.weightMap},enumerable:!0,configurable:!0}),e.prototype.getPathPrefix=function(){var e=parse(this.weightManifestUrl),t=e.pathname.split("/");return t.splice(-1),e.pathname=t.join("/"),format(e)+"/"},e.prototype.loadRemoteProtoFile=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r,n;return __generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,fetch(this.modelUrl,this.requestOption)];case 1:return e=o.sent(),a=(t=compiled_api_1.GraphDef).decode,r=Uint8Array.bind,[4,e.arrayBuffer()];case 2:return[2,a.apply(t,[new(r.apply(Uint8Array,[void 0,o.sent()]))])];case 3:throw n=o.sent(),new Error(this.modelUrl+" not found. "+n);case 4:return[2]}})})},e.prototype.loadWeightManifest=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,fetch(this.weightManifestUrl,this.requestOption)];case 1:return e=r.sent(),t=this,[4,e.clone().json()];case 2:return t.weightManifest=r.sent(),[3,4];case 3:throw a=r.sent(),new Error(this.weightManifestUrl+" not found. "+a);case 4:return[2]}})})},e.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r;return __generator(this,function(n){switch(n.label){case 0:return e=this.loadRemoteProtoFile(),t=this.loadWeightManifest(),[4,Promise.all([e,t])];case 1:return a=n.sent()[0],this.version=a.versions.producer+"."+a.versions.minConsumer,[4,io.loadWeights(this.weightManifest,this.pathPrefix,void 0,this.requestOption)];case 2:return r=n.sent(),this.executor=new GraphExecutor(OperationMapper.Instance.transformGraph(a)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),[2,!0]}})})},e.prototype.predict=function(e,t){return this.execute(e,this.outputNodes)},e.prototype.constructTensorMap=function(e){var t=e instanceof Tensor?[e]:e;if(t.length!==this.inputNodes.length)throw new Error("Input tensor count mismatch,the frozen model has "+this.inputNodes.length+" placeholders, while there are "+t.length+" input tensors.");return this.inputNodes.reduce(function(e,a,r){return e[a]=t[r],e},{})},e.prototype.execute=function(e,t){if(t=t||this.outputNodes,(e instanceof Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),this.executor.isControlFlowModel||this.executor.isDynamicShapeModel)throw new Error("The model contains control flow or dynamic shape ops, please use executeAsync method");var a=this.executor.execute(this.convertTensorMapToTensorsMap(e),t),r=Object.keys(a);return Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r;return __generator(this,function(n){switch(n.label){case 0:if(!this.executor.isControlFlowModel||!this.executor.isDynamicShapeModel)throw new Error("The model does not contain control flow or dynamic shape ops, please use execute method for better performance.");return t=t||this.outputNodes,(e instanceof Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),[4,this.executor.executeAsync(this.convertTensorMapToTensorsMap(e),t)];case 1:return a=n.sent(),r=Object.keys(a),[2,Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]]}})})},e.prototype.convertTensorMapToTensorsMap=function(e){return Object.keys(e).reduce(function(t,a){return t[a]=[e[a]],t},{})},e.prototype.dispose=function(){this.executor.dispose()},e}();function loadFrozenModel(e,t,a){return __awaiter(this,void 0,void 0,function(){var r;return __generator(this,function(n){switch(n.label){case 0:return[4,(r=new FrozenModel(e,t,a)).load()];case 1:return n.sent(),[2,r]}})})}var version="0.5.5";export{FrozenModel,loadFrozenModel,version as version_converter}; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.js b/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.js new file mode 100644 index 0000000..b68c9b7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.js @@ -0,0 +1,10787 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core')) : + typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core'], factory) : + (factory((global.tf = global.tf || {}),global.tf)); +}(this, (function (exports,tfc) { 'use strict'; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + var __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var punycode = createCommonjsModule(function (module, exports) { + (function(root) { + + /** Detect free variables */ + var freeExports = exports && + !exports.nodeType && exports; + var freeModule = module && + !module.nodeType && module; + var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * http://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.3.2', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof undefined == 'function' && + typeof undefined.amd == 'object' && + undefined.amd + ) { + undefined('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { // in Rhino or a web browser + root.punycode = punycode; + } + + }(commonjsGlobal)); + }); + + var util = { + isString: function(arg) { + return typeof(arg) === 'string'; + }, + isObject: function(arg) { + return typeof(arg) === 'object' && arg !== null; + }, + isNull: function(arg) { + return arg === null; + }, + isNullOrUndefined: function(arg) { + return arg == null; + } + }; + + // Copyright Joyent, Inc. and other Node contributors. + + // If obj.hasOwnProperty has been overridden, then calling + // obj.hasOwnProperty(prop) will break. + // See: https://github.com/joyent/node/issues/1707 + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + var decode = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (Array.isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; + }; + + // Copyright Joyent, Inc. and other Node contributors. + + var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } + }; + + var encode = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return Object.keys(obj).map(function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (Array.isArray(obj[k])) { + return obj[k].map(function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); + }; + + var querystring = createCommonjsModule(function (module, exports) { + + exports.decode = exports.parse = decode; + exports.encode = exports.stringify = encode; + }); + var querystring_1 = querystring.decode; + var querystring_2 = querystring.parse; + var querystring_3 = querystring.encode; + var querystring_4 = querystring.stringify; + + var parse = urlParse; + var format = urlFormat; + + function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; + } + + // Reference: RFC 3986, RFC 1808, RFC 2396 + + // define these here so at least they only have to be + // compiled once on the first module load. + var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }; + + function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && util.isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; + } + + Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!util.isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.path = rest; + this.href = rest; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ''; + this.query = {}; + } + return this; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + this.hostname = punycode.toASCII(this.hostname); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; + }; + + // format a parsed object into a url string + function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (util.isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); + } + + Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + util.isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; + }; + + Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); + }; + + Url.prototype.resolveObject = function(relative) { + if (util.isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; + result[k] = relative[k]; + } + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!util.isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last === '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + }; + + Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; + }; + + var aspromise = asPromise; + + /** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + + /** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ + function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); + } + + var base64_1 = createCommonjsModule(function (module, exports) { + + /** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ + var base64 = exports; + + /** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ + base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; + }; + + // Base64 encoding table + var b64 = new Array(64); + + // Base64 decoding table + var s64 = new Array(123); + + // 65..90, 97..122, 48..57, 43, 47 + for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + + /** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ + base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); + }; + + var invalidEncoding = "invalid encoding"; + + /** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ + base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; + }; + + /** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ + base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); + }; + }); + + var eventemitter = EventEmitter; + + /** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ + function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; + } + + /** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ + EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; + }; + + /** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ + EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; + }; + + /** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ + EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; + }; + + var float_1 = factory(factory); + + /** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + + /** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + + /** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + + /** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + + /** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + + /** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + + /** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + + /** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + + /** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + + // Factory function for the purpose of node-based testing in modified global environments + function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; + } + + // uint helpers + + function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + + function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; + } + + function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; + } + + function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; + } + + var inquire_1 = inquire; + + /** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ + function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; + } + + var utf8_1 = createCommonjsModule(function (module, exports) { + + /** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ + var utf8 = exports; + + /** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ + utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; + }; + + /** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ + utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); + }; + + /** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ + utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; + }; + }); + + var pool_1 = pool; + + /** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + + /** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + + /** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ + function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; + } + + var longbits = LongBits; + + + + /** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ + function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; + } + + /** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ + var zero = LongBits.zero = new LongBits(0, 0); + + zero.toNumber = function() { return 0; }; + zero.zzEncode = zero.zzDecode = function() { return this; }; + zero.length = function() { return 1; }; + + /** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ + var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + + /** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ + LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); + }; + + /** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ + LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (minimal.isString(value)) { + /* istanbul ignore else */ + if (minimal.Long) + value = minimal.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; + }; + + /** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ + LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; + }; + + /** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ + LongBits.prototype.toLong = function toLong(unsigned) { + return minimal.Long + ? new minimal.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; + }; + + var charCodeAt = String.prototype.charCodeAt; + + /** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ + LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); + }; + + /** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ + LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); + }; + + /** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ + LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; + }; + + /** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ + LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; + }; + + /** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ + LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; + }; + + var minimal = createCommonjsModule(function (module, exports) { + var util = exports; + + // used to return a Promise where callback is omitted + util.asPromise = aspromise; + + // converts to / from base64 encoded strings + util.base64 = base64_1; + + // base class of rpc.Service + util.EventEmitter = eventemitter; + + // float handling accross browsers + util.float = float_1; + + // requires modules optionally and hides the call from bundlers + util.inquire = inquire_1; + + // converts to / from utf8 encoded strings + util.utf8 = utf8_1; + + // provides a node-like buffer pool in the browser + util.pool = pool_1; + + // utility to work with the low and high bits of a 64 bit value + util.LongBits = longbits; + + /** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ + util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + + /** + * An immutable empty object. + * @type {Object} + * @const + */ + util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + + /** + * Whether running within node or not. + * @memberof util + * @type {boolean} + * @const + */ + util.isNode = Boolean(commonjsGlobal.process && commonjsGlobal.process.versions && commonjsGlobal.process.versions.node); + + /** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ + util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; + }; + + /** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ + util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; + }; + + /** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ + util.isObject = function isObject(value) { + return value && typeof value === "object"; + }; + + /** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ + util.isset = + + /** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ + util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; + }; + + /** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + + /** + * Node's Buffer class if available. + * @type {Constructor} + */ + util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } + })(); + + // Internal alias of or polyfull for Buffer.from. + util._Buffer_from = null; + + // Internal alias of or polyfill for Buffer.allocUnsafe. + util._Buffer_allocUnsafe = null; + + /** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ + util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); + }; + + /** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ + util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + + /** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ + + /** + * Long.js's Long class if available. + * @type {Constructor} + */ + util.Long = /* istanbul ignore next */ commonjsGlobal.dcodeIO && /* istanbul ignore next */ commonjsGlobal.dcodeIO.Long || util.inquire("long"); + + /** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ + util.key2Re = /^true|false|0|1$/; + + /** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ + util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + + /** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ + util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + + /** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ + util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; + }; + + /** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ + util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); + }; + + /** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ + function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; + } + + util.merge = merge; + + /** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ + util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); + }; + + /** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ + function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; + } + + util.newError = newError; + + /** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ + util.ProtocolError = newError("ProtocolError"); + + /** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + + /** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + + /** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ + util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; + }; + + /** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + + /** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ + util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; + }; + + /** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ + util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true + }; + + util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; + }; + }); + + var writer = Writer; + + + + var BufferWriter; // cyclic + + var LongBits$1 = minimal.LongBits, + base64 = minimal.base64, + utf8 = minimal.utf8; + + /** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ + function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies + } + + /* istanbul ignore next */ + function noop() {} // eslint-disable-line no-empty-function + + /** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ + function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; + } + + /** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ + function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. + } + + /** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ + Writer.create = minimal.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; + + /** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + Writer.alloc = function alloc(size) { + return new minimal.Array(size); + }; + + // Use Uint8Array buffer pool in the browser, just like node does with buffers + /* istanbul ignore else */ + if (minimal.Array !== Array) + Writer.alloc = minimal.pool(Writer.alloc, minimal.Array.prototype.subarray); + + /** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ + Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + }; + + function writeByte(val, buf, pos) { + buf[pos] = val & 255; + } + + function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; + } + + /** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ + function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; + } + + VarintOp.prototype = Object.create(Op.prototype); + VarintOp.prototype.fn = writeVarint32; + + /** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; + }; + + /** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits$1.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); + }; + + /** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); + }; + + function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; + } + + /** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits$1.from(value); + return this._push(writeVarint64, bits.length(), bits); + }; + + /** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.int64 = Writer.prototype.uint64; + + /** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits$1.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); + }; + + /** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); + }; + + function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + + /** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); + }; + + /** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.sfixed32 = Writer.prototype.fixed32; + + /** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits$1.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); + }; + + /** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.sfixed64 = Writer.prototype.fixed64; + + /** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.float = function write_float(value) { + return this._push(minimal.float.writeFloatLE, 4, value); + }; + + /** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.double = function write_double(value) { + return this._push(minimal.float.writeDoubleLE, 8, value); + }; + + var writeBytes = minimal.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + + /** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ + Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (minimal.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); + }; + + /** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); + }; + + /** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ + Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; + }; + + /** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ + Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; + }; + + /** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ + Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; + }; + + /** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ + Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; + }; + + Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + }; + + var writer_buffer = BufferWriter$1; + + // extends Writer + + (BufferWriter$1.prototype = Object.create(writer.prototype)).constructor = BufferWriter$1; + + + + var Buffer = minimal.Buffer; + + /** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ + function BufferWriter$1() { + writer.call(this); + } + + /** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ + BufferWriter$1.alloc = function alloc_buffer(size) { + return (BufferWriter$1.alloc = minimal._Buffer_allocUnsafe)(size); + }; + + var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; + + /** + * @override + */ + BufferWriter$1.prototype.bytes = function write_bytes_buffer(value) { + if (minimal.isString(value)) + value = minimal._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(writeBytesBuffer, len, value); + return this; + }; + + function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + minimal.utf8.write(val, buf, pos); + else + buf.utf8Write(val, pos); + } + + /** + * @override + */ + BufferWriter$1.prototype.string = function write_string_buffer(value) { + var len = Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; + }; + + var reader = Reader; + + + + var BufferReader; // cyclic + + var LongBits$2 = minimal.LongBits, + utf8$1 = minimal.utf8; + + /* istanbul ignore next */ + function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); + } + + /** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ + function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; + } + + var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + + /** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ + Reader.create = minimal.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return minimal.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; + + Reader.prototype._slice = minimal.Array.prototype.subarray || /* istanbul ignore next */ minimal.Array.prototype.slice; + + /** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ + Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; + })(); + + /** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ + Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; + }; + + /** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ + Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; + }; + + /* eslint-disable no-invalid-this */ + + function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits$2(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); + } + + /* eslint-enable no-invalid-this */ + + /** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + + /** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + + /** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + + /** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ + Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; + }; + + function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; + } + + /** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ + Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); + }; + + /** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ + Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; + }; + + /* eslint-disable no-invalid-this */ + + function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits$2(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); + } + + /* eslint-enable no-invalid-this */ + + /** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + + /** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + + /** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ + Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = minimal.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; + }; + + /** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ + Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = minimal.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; + }; + + /** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ + Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); + }; + + /** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ + Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8$1.read(bytes, 0, bytes.length); + }; + + /** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ + Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + }; + + /** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ + Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + do { // eslint-disable-line no-constant-condition + if ((wireType = this.uint32() & 7) === 4) + break; + this.skipType(wireType); + } while (true); + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + }; + + Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + + var fn = minimal.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + minimal.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); + }; + + var reader_buffer = BufferReader$1; + + // extends Reader + + (BufferReader$1.prototype = Object.create(reader.prototype)).constructor = BufferReader$1; + + + + /** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ + function BufferReader$1(buffer) { + reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ + } + + /* istanbul ignore else */ + if (minimal.Buffer) + BufferReader$1.prototype._slice = minimal.Buffer.prototype.slice; + + /** + * @override + */ + BufferReader$1.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); + }; + + var service = Service; + + + + // Extends EventEmitter + (Service.prototype = Object.create(minimal.EventEmitter.prototype)).constructor = Service; + + /** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + + /** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + + /** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + minimal.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); + } + + /** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ + Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return minimal.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } + }; + + /** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ + Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; + }; + + var rpc_1 = createCommonjsModule(function (module, exports) { + + /** + * Streaming RPC helpers. + * @namespace + */ + var rpc = exports; + + /** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + + /** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + + rpc.Service = service; + }); + + var roots = {}; + + var indexMinimal = createCommonjsModule(function (module, exports) { + var protobuf = exports; + + /** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ + protobuf.build = "minimal"; + + // Serialization + protobuf.Writer = writer; + protobuf.BufferWriter = writer_buffer; + protobuf.Reader = reader; + protobuf.BufferReader = reader_buffer; + + // Utility + protobuf.util = minimal; + protobuf.rpc = rpc_1; + protobuf.roots = roots; + protobuf.configure = configure; + + /* istanbul ignore next */ + /** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ + function configure() { + protobuf.Reader._configure(protobuf.BufferReader); + protobuf.util._configure(); + } + + // Configure serialization + protobuf.Writer._configure(protobuf.BufferWriter); + configure(); + }); + + var minimal$1 = indexMinimal; + var minimal_1 = minimal$1.roots; + var minimal_2 = minimal$1.Reader; + var minimal_3 = minimal$1.util; + + var $Reader = minimal$1.Reader, $util = minimal$1.util; + + var $root = minimal$1.roots["default"] || (minimal$1.roots["default"] = {}); + + $root.tensorflow = (function() { + + var tensorflow = {}; + + tensorflow.Any = (function() { + + function Any(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + Any.prototype.typeUrl = ""; + Any.prototype.value = $util.newBuffer([]); + + Any.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.Any(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.typeUrl = r.string(); + break; + case 2: + m.value = r.bytes(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return Any; + })(); + + tensorflow.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DT_INVALID"] = 0; + values[valuesById[1] = "DT_FLOAT"] = 1; + values[valuesById[2] = "DT_DOUBLE"] = 2; + values[valuesById[3] = "DT_INT32"] = 3; + values[valuesById[4] = "DT_UINT8"] = 4; + values[valuesById[5] = "DT_INT16"] = 5; + values[valuesById[6] = "DT_INT8"] = 6; + values[valuesById[7] = "DT_STRING"] = 7; + values[valuesById[8] = "DT_COMPLEX64"] = 8; + values[valuesById[9] = "DT_INT64"] = 9; + values[valuesById[10] = "DT_BOOL"] = 10; + values[valuesById[11] = "DT_QINT8"] = 11; + values[valuesById[12] = "DT_QUINT8"] = 12; + values[valuesById[13] = "DT_QINT32"] = 13; + values[valuesById[14] = "DT_BFLOAT16"] = 14; + values[valuesById[101] = "DT_FLOAT_REF"] = 101; + values[valuesById[102] = "DT_DOUBLE_REF"] = 102; + values[valuesById[103] = "DT_INT32_REF"] = 103; + values[valuesById[104] = "DT_UINT8_REF"] = 104; + values[valuesById[105] = "DT_INT16_REF"] = 105; + values[valuesById[106] = "DT_INT8_REF"] = 106; + values[valuesById[107] = "DT_STRING_REF"] = 107; + values[valuesById[108] = "DT_COMPLEX64_REF"] = 108; + values[valuesById[109] = "DT_INT64_REF"] = 109; + values[valuesById[110] = "DT_BOOL_REF"] = 110; + values[valuesById[111] = "DT_QINT8_REF"] = 111; + values[valuesById[112] = "DT_QUINT8_REF"] = 112; + values[valuesById[113] = "DT_QINT32_REF"] = 113; + values[valuesById[114] = "DT_BFLOAT16_REF"] = 114; + return values; + })(); + + tensorflow.TensorShape = (function() { + + function TensorShape(p) { + this.dim = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + TensorShape.prototype.dim = $util.emptyArray; + TensorShape.prototype.unknownRank = false; + + TensorShape.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.TensorShape(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: + if (!(m.dim && m.dim.length)) + m.dim = []; + m.dim.push($root.tensorflow.TensorShape.Dim.decode(r, r.uint32())); + break; + case 3: + m.unknownRank = r.bool(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + TensorShape.Dim = (function() { + + function Dim(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + Dim.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Dim.prototype.name = ""; + + Dim.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.TensorShape.Dim(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.size = r.int64(); + break; + case 2: + m.name = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return Dim; + })(); + + return TensorShape; + })(); + + tensorflow.Tensor = (function() { + + function Tensor(p) { + this.floatVal = []; + this.doubleVal = []; + this.intVal = []; + this.stringVal = []; + this.scomplexVal = []; + this.int64Val = []; + this.boolVal = []; + this.uint32Val = []; + this.uint64Val = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + Tensor.prototype.dtype = 0; + Tensor.prototype.tensorShape = null; + Tensor.prototype.versionNumber = 0; + Tensor.prototype.tensorContent = $util.newBuffer([]); + Tensor.prototype.floatVal = $util.emptyArray; + Tensor.prototype.doubleVal = $util.emptyArray; + Tensor.prototype.intVal = $util.emptyArray; + Tensor.prototype.stringVal = $util.emptyArray; + Tensor.prototype.scomplexVal = $util.emptyArray; + Tensor.prototype.int64Val = $util.emptyArray; + Tensor.prototype.boolVal = $util.emptyArray; + Tensor.prototype.uint32Val = $util.emptyArray; + Tensor.prototype.uint64Val = $util.emptyArray; + + Tensor.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.Tensor(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.dtype = r.int32(); + break; + case 2: + m.tensorShape = $root.tensorflow.TensorShape.decode(r, r.uint32()); + break; + case 3: + m.versionNumber = r.int32(); + break; + case 4: + m.tensorContent = r.bytes(); + break; + case 5: + if (!(m.floatVal && m.floatVal.length)) + m.floatVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.floatVal.push(r.float()); + } else + m.floatVal.push(r.float()); + break; + case 6: + if (!(m.doubleVal && m.doubleVal.length)) + m.doubleVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.doubleVal.push(r.double()); + } else + m.doubleVal.push(r.double()); + break; + case 7: + if (!(m.intVal && m.intVal.length)) + m.intVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.intVal.push(r.int32()); + } else + m.intVal.push(r.int32()); + break; + case 8: + if (!(m.stringVal && m.stringVal.length)) + m.stringVal = []; + m.stringVal.push(r.bytes()); + break; + case 9: + if (!(m.scomplexVal && m.scomplexVal.length)) + m.scomplexVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.scomplexVal.push(r.float()); + } else + m.scomplexVal.push(r.float()); + break; + case 10: + if (!(m.int64Val && m.int64Val.length)) + m.int64Val = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.int64Val.push(r.int64()); + } else + m.int64Val.push(r.int64()); + break; + case 11: + if (!(m.boolVal && m.boolVal.length)) + m.boolVal = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.boolVal.push(r.bool()); + } else + m.boolVal.push(r.bool()); + break; + case 16: + if (!(m.uint32Val && m.uint32Val.length)) + m.uint32Val = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.uint32Val.push(r.uint32()); + } else + m.uint32Val.push(r.uint32()); + break; + case 17: + if (!(m.uint64Val && m.uint64Val.length)) + m.uint64Val = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.uint64Val.push(r.uint64()); + } else + m.uint64Val.push(r.uint64()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return Tensor; + })(); + + tensorflow.AttrValue = (function() { + + function AttrValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + AttrValue.prototype.list = null; + AttrValue.prototype.s = $util.newBuffer([]); + AttrValue.prototype.i = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AttrValue.prototype.f = 0; + AttrValue.prototype.b = false; + AttrValue.prototype.type = 0; + AttrValue.prototype.shape = null; + AttrValue.prototype.tensor = null; + AttrValue.prototype.placeholder = ""; + AttrValue.prototype.func = null; + + var $oneOfFields; + + Object.defineProperty(AttrValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["list", "s", "i", "f", "b", "type", "shape", "tensor", "placeholder", "func"]), + set: $util.oneOfSetter($oneOfFields) + }); + + AttrValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.AttrValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.list = $root.tensorflow.AttrValue.ListValue.decode(r, r.uint32()); + break; + case 2: + m.s = r.bytes(); + break; + case 3: + m.i = r.int64(); + break; + case 4: + m.f = r.float(); + break; + case 5: + m.b = r.bool(); + break; + case 6: + m.type = r.int32(); + break; + case 7: + m.shape = $root.tensorflow.TensorShape.decode(r, r.uint32()); + break; + case 8: + m.tensor = $root.tensorflow.Tensor.decode(r, r.uint32()); + break; + case 9: + m.placeholder = r.string(); + break; + case 10: + m.func = $root.tensorflow.NameAttrList.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + AttrValue.ListValue = (function() { + + function ListValue(p) { + this.s = []; + this.i = []; + this.f = []; + this.b = []; + this.type = []; + this.shape = []; + this.tensor = []; + this.func = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + ListValue.prototype.s = $util.emptyArray; + ListValue.prototype.i = $util.emptyArray; + ListValue.prototype.f = $util.emptyArray; + ListValue.prototype.b = $util.emptyArray; + ListValue.prototype.type = $util.emptyArray; + ListValue.prototype.shape = $util.emptyArray; + ListValue.prototype.tensor = $util.emptyArray; + ListValue.prototype.func = $util.emptyArray; + + ListValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.AttrValue.ListValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: + if (!(m.s && m.s.length)) + m.s = []; + m.s.push(r.bytes()); + break; + case 3: + if (!(m.i && m.i.length)) + m.i = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.i.push(r.int64()); + } else + m.i.push(r.int64()); + break; + case 4: + if (!(m.f && m.f.length)) + m.f = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.f.push(r.float()); + } else + m.f.push(r.float()); + break; + case 5: + if (!(m.b && m.b.length)) + m.b = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.b.push(r.bool()); + } else + m.b.push(r.bool()); + break; + case 6: + if (!(m.type && m.type.length)) + m.type = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.type.push(r.int32()); + } else + m.type.push(r.int32()); + break; + case 7: + if (!(m.shape && m.shape.length)) + m.shape = []; + m.shape.push($root.tensorflow.TensorShape.decode(r, r.uint32())); + break; + case 8: + if (!(m.tensor && m.tensor.length)) + m.tensor = []; + m.tensor.push($root.tensorflow.Tensor.decode(r, r.uint32())); + break; + case 9: + if (!(m.func && m.func.length)) + m.func = []; + m.func.push($root.tensorflow.NameAttrList.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return ListValue; + })(); + + return AttrValue; + })(); + + tensorflow.NameAttrList = (function() { + + function NameAttrList(p) { + this.attr = {}; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + NameAttrList.prototype.name = ""; + NameAttrList.prototype.attr = $util.emptyObject; + + NameAttrList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.NameAttrList(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + r.skip().pos++; + if (m.attr === $util.emptyObject) + m.attr = {}; + k = r.string(); + r.pos++; + m.attr[k] = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return NameAttrList; + })(); + + tensorflow.NodeDef = (function() { + + function NodeDef(p) { + this.input = []; + this.attr = {}; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + NodeDef.prototype.name = ""; + NodeDef.prototype.op = ""; + NodeDef.prototype.input = $util.emptyArray; + NodeDef.prototype.device = ""; + NodeDef.prototype.attr = $util.emptyObject; + + NodeDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.NodeDef(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + m.op = r.string(); + break; + case 3: + if (!(m.input && m.input.length)) + m.input = []; + m.input.push(r.string()); + break; + case 4: + m.device = r.string(); + break; + case 5: + r.skip().pos++; + if (m.attr === $util.emptyObject) + m.attr = {}; + k = r.string(); + r.pos++; + m.attr[k] = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return NodeDef; + })(); + + tensorflow.VersionDef = (function() { + + function VersionDef(p) { + this.badConsumers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + VersionDef.prototype.producer = 0; + VersionDef.prototype.minConsumer = 0; + VersionDef.prototype.badConsumers = $util.emptyArray; + + VersionDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.VersionDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.producer = r.int32(); + break; + case 2: + m.minConsumer = r.int32(); + break; + case 3: + if (!(m.badConsumers && m.badConsumers.length)) + m.badConsumers = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.badConsumers.push(r.int32()); + } else + m.badConsumers.push(r.int32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return VersionDef; + })(); + + tensorflow.GraphDef = (function() { + + function GraphDef(p) { + this.node = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + GraphDef.prototype.node = $util.emptyArray; + GraphDef.prototype.versions = null; + GraphDef.prototype.library = null; + + GraphDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.GraphDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.node && m.node.length)) + m.node = []; + m.node.push($root.tensorflow.NodeDef.decode(r, r.uint32())); + break; + case 4: + m.versions = $root.tensorflow.VersionDef.decode(r, r.uint32()); + break; + case 2: + m.library = $root.tensorflow.FunctionDefLibrary.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return GraphDef; + })(); + + tensorflow.CollectionDef = (function() { + + function CollectionDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + CollectionDef.prototype.nodeList = null; + CollectionDef.prototype.bytesList = null; + CollectionDef.prototype.int64List = null; + CollectionDef.prototype.floatList = null; + CollectionDef.prototype.anyList = null; + + var $oneOfFields; + + Object.defineProperty(CollectionDef.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nodeList", "bytesList", "int64List", "floatList", "anyList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + CollectionDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.nodeList = $root.tensorflow.CollectionDef.NodeList.decode(r, r.uint32()); + break; + case 2: + m.bytesList = $root.tensorflow.CollectionDef.BytesList.decode(r, r.uint32()); + break; + case 3: + m.int64List = $root.tensorflow.CollectionDef.Int64List.decode(r, r.uint32()); + break; + case 4: + m.floatList = $root.tensorflow.CollectionDef.FloatList.decode(r, r.uint32()); + break; + case 5: + m.anyList = $root.tensorflow.CollectionDef.AnyList.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + CollectionDef.NodeList = (function() { + + function NodeList(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + NodeList.prototype.value = $util.emptyArray; + + NodeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.NodeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + m.value.push(r.string()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return NodeList; + })(); + + CollectionDef.BytesList = (function() { + + function BytesList(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + BytesList.prototype.value = $util.emptyArray; + + BytesList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.BytesList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + m.value.push(r.bytes()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return BytesList; + })(); + + CollectionDef.Int64List = (function() { + + function Int64List(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + Int64List.prototype.value = $util.emptyArray; + + Int64List.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.Int64List(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.value.push(r.int64()); + } else + m.value.push(r.int64()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return Int64List; + })(); + + CollectionDef.FloatList = (function() { + + function FloatList(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + FloatList.prototype.value = $util.emptyArray; + + FloatList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.FloatList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.value.push(r.float()); + } else + m.value.push(r.float()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return FloatList; + })(); + + CollectionDef.AnyList = (function() { + + function AnyList(p) { + this.value = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + AnyList.prototype.value = $util.emptyArray; + + AnyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.CollectionDef.AnyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.value && m.value.length)) + m.value = []; + m.value.push($root.tensorflow.Any.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return AnyList; + })(); + + return CollectionDef; + })(); + + tensorflow.SaverDef = (function() { + + function SaverDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + SaverDef.prototype.filenameTensorName = ""; + SaverDef.prototype.saveTensorName = ""; + SaverDef.prototype.restoreOpName = ""; + SaverDef.prototype.maxToKeep = 0; + SaverDef.prototype.sharded = false; + SaverDef.prototype.keepCheckpointEveryNHours = 0; + SaverDef.prototype.version = 0; + + SaverDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.SaverDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.filenameTensorName = r.string(); + break; + case 2: + m.saveTensorName = r.string(); + break; + case 3: + m.restoreOpName = r.string(); + break; + case 4: + m.maxToKeep = r.int32(); + break; + case 5: + m.sharded = r.bool(); + break; + case 6: + m.keepCheckpointEveryNHours = r.float(); + break; + case 7: + m.version = r.int32(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + SaverDef.CheckpointFormatVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LEGACY"] = 0; + values[valuesById[1] = "V1"] = 1; + values[valuesById[2] = "V2"] = 2; + return values; + })(); + + return SaverDef; + })(); + + tensorflow.TensorInfo = (function() { + + function TensorInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + TensorInfo.prototype.name = ""; + TensorInfo.prototype.cooSparse = null; + TensorInfo.prototype.dtype = 0; + TensorInfo.prototype.tensorShape = null; + + var $oneOfFields; + + Object.defineProperty(TensorInfo.prototype, "encoding", { + get: $util.oneOfGetter($oneOfFields = ["name", "cooSparse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + TensorInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.TensorInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 4: + m.cooSparse = $root.tensorflow.TensorInfo.CooSparse.decode(r, r.uint32()); + break; + case 2: + m.dtype = r.int32(); + break; + case 3: + m.tensorShape = $root.tensorflow.TensorShape.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + TensorInfo.CooSparse = (function() { + + function CooSparse(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + CooSparse.prototype.valuesTensorName = ""; + CooSparse.prototype.indicesTensorName = ""; + CooSparse.prototype.denseShapeTensorName = ""; + + CooSparse.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.TensorInfo.CooSparse(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.valuesTensorName = r.string(); + break; + case 2: + m.indicesTensorName = r.string(); + break; + case 3: + m.denseShapeTensorName = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return CooSparse; + })(); + + return TensorInfo; + })(); + + tensorflow.SignatureDef = (function() { + + function SignatureDef(p) { + this.inputs = {}; + this.outputs = {}; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + SignatureDef.prototype.inputs = $util.emptyObject; + SignatureDef.prototype.outputs = $util.emptyObject; + SignatureDef.prototype.methodName = ""; + + SignatureDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.SignatureDef(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + r.skip().pos++; + if (m.inputs === $util.emptyObject) + m.inputs = {}; + k = r.string(); + r.pos++; + m.inputs[k] = $root.tensorflow.TensorInfo.decode(r, r.uint32()); + break; + case 2: + r.skip().pos++; + if (m.outputs === $util.emptyObject) + m.outputs = {}; + k = r.string(); + r.pos++; + m.outputs[k] = $root.tensorflow.TensorInfo.decode(r, r.uint32()); + break; + case 3: + m.methodName = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return SignatureDef; + })(); + + tensorflow.AssetFileDef = (function() { + + function AssetFileDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + AssetFileDef.prototype.tensorInfo = null; + AssetFileDef.prototype.filename = ""; + + AssetFileDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.AssetFileDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.tensorInfo = $root.tensorflow.TensorInfo.decode(r, r.uint32()); + break; + case 2: + m.filename = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return AssetFileDef; + })(); + + tensorflow.OpDef = (function() { + + function OpDef(p) { + this.inputArg = []; + this.outputArg = []; + this.attr = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + OpDef.prototype.name = ""; + OpDef.prototype.inputArg = $util.emptyArray; + OpDef.prototype.outputArg = $util.emptyArray; + OpDef.prototype.attr = $util.emptyArray; + OpDef.prototype.deprecation = null; + OpDef.prototype.summary = ""; + OpDef.prototype.description = ""; + OpDef.prototype.isCommutative = false; + OpDef.prototype.isAggregate = false; + OpDef.prototype.isStateful = false; + OpDef.prototype.allowsUninitializedInput = false; + + OpDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + if (!(m.inputArg && m.inputArg.length)) + m.inputArg = []; + m.inputArg.push($root.tensorflow.OpDef.ArgDef.decode(r, r.uint32())); + break; + case 3: + if (!(m.outputArg && m.outputArg.length)) + m.outputArg = []; + m.outputArg.push($root.tensorflow.OpDef.ArgDef.decode(r, r.uint32())); + break; + case 4: + if (!(m.attr && m.attr.length)) + m.attr = []; + m.attr.push($root.tensorflow.OpDef.AttrDef.decode(r, r.uint32())); + break; + case 8: + m.deprecation = $root.tensorflow.OpDef.OpDeprecation.decode(r, r.uint32()); + break; + case 5: + m.summary = r.string(); + break; + case 6: + m.description = r.string(); + break; + case 18: + m.isCommutative = r.bool(); + break; + case 16: + m.isAggregate = r.bool(); + break; + case 17: + m.isStateful = r.bool(); + break; + case 19: + m.allowsUninitializedInput = r.bool(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + OpDef.ArgDef = (function() { + + function ArgDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + ArgDef.prototype.name = ""; + ArgDef.prototype.description = ""; + ArgDef.prototype.type = 0; + ArgDef.prototype.typeAttr = ""; + ArgDef.prototype.numberAttr = ""; + ArgDef.prototype.typeListAttr = ""; + ArgDef.prototype.isRef = false; + + ArgDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpDef.ArgDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + m.description = r.string(); + break; + case 3: + m.type = r.int32(); + break; + case 4: + m.typeAttr = r.string(); + break; + case 5: + m.numberAttr = r.string(); + break; + case 6: + m.typeListAttr = r.string(); + break; + case 16: + m.isRef = r.bool(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return ArgDef; + })(); + + OpDef.AttrDef = (function() { + + function AttrDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + AttrDef.prototype.name = ""; + AttrDef.prototype.type = ""; + AttrDef.prototype.defaultValue = null; + AttrDef.prototype.description = ""; + AttrDef.prototype.hasMinimum = false; + AttrDef.prototype.minimum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AttrDef.prototype.allowedValues = null; + + AttrDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpDef.AttrDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.name = r.string(); + break; + case 2: + m.type = r.string(); + break; + case 3: + m.defaultValue = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + case 4: + m.description = r.string(); + break; + case 5: + m.hasMinimum = r.bool(); + break; + case 6: + m.minimum = r.int64(); + break; + case 7: + m.allowedValues = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return AttrDef; + })(); + + OpDef.OpDeprecation = (function() { + + function OpDeprecation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + OpDeprecation.prototype.version = 0; + OpDeprecation.prototype.explanation = ""; + + OpDeprecation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpDef.OpDeprecation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.version = r.int32(); + break; + case 2: + m.explanation = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return OpDeprecation; + })(); + + return OpDef; + })(); + + tensorflow.OpList = (function() { + + function OpList(p) { + this.op = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + OpList.prototype.op = $util.emptyArray; + + OpList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.OpList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m.op && m.op.length)) + m.op = []; + m.op.push($root.tensorflow.OpDef.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return OpList; + })(); + + tensorflow.MetaGraphDef = (function() { + + function MetaGraphDef(p) { + this.collectionDef = {}; + this.signatureDef = {}; + this.assetFileDef = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + MetaGraphDef.prototype.metaInfoDef = null; + MetaGraphDef.prototype.graphDef = null; + MetaGraphDef.prototype.saverDef = null; + MetaGraphDef.prototype.collectionDef = $util.emptyObject; + MetaGraphDef.prototype.signatureDef = $util.emptyObject; + MetaGraphDef.prototype.assetFileDef = $util.emptyArray; + + MetaGraphDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.MetaGraphDef(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.metaInfoDef = $root.tensorflow.MetaGraphDef.MetaInfoDef.decode(r, r.uint32()); + break; + case 2: + m.graphDef = $root.tensorflow.GraphDef.decode(r, r.uint32()); + break; + case 3: + m.saverDef = $root.tensorflow.SaverDef.decode(r, r.uint32()); + break; + case 4: + r.skip().pos++; + if (m.collectionDef === $util.emptyObject) + m.collectionDef = {}; + k = r.string(); + r.pos++; + m.collectionDef[k] = $root.tensorflow.CollectionDef.decode(r, r.uint32()); + break; + case 5: + r.skip().pos++; + if (m.signatureDef === $util.emptyObject) + m.signatureDef = {}; + k = r.string(); + r.pos++; + m.signatureDef[k] = $root.tensorflow.SignatureDef.decode(r, r.uint32()); + break; + case 6: + if (!(m.assetFileDef && m.assetFileDef.length)) + m.assetFileDef = []; + m.assetFileDef.push($root.tensorflow.AssetFileDef.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + MetaGraphDef.MetaInfoDef = (function() { + + function MetaInfoDef(p) { + this.tags = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + MetaInfoDef.prototype.metaGraphVersion = ""; + MetaInfoDef.prototype.strippedOpList = null; + MetaInfoDef.prototype.anyInfo = null; + MetaInfoDef.prototype.tags = $util.emptyArray; + MetaInfoDef.prototype.tensorflowVersion = ""; + MetaInfoDef.prototype.tensorflowGitVersion = ""; + + MetaInfoDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.MetaGraphDef.MetaInfoDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.metaGraphVersion = r.string(); + break; + case 2: + m.strippedOpList = $root.tensorflow.OpList.decode(r, r.uint32()); + break; + case 3: + m.anyInfo = $root.tensorflow.Any.decode(r, r.uint32()); + break; + case 4: + if (!(m.tags && m.tags.length)) + m.tags = []; + m.tags.push(r.string()); + break; + case 5: + m.tensorflowVersion = r.string(); + break; + case 6: + m.tensorflowGitVersion = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return MetaInfoDef; + })(); + + return MetaGraphDef; + })(); + + tensorflow.SavedModel = (function() { + + function SavedModel(p) { + this.metaGraphs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + SavedModel.prototype.savedModelSchemaVersion = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SavedModel.prototype.metaGraphs = $util.emptyArray; + + SavedModel.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.SavedModel(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.savedModelSchemaVersion = r.int64(); + break; + case 2: + if (!(m.metaGraphs && m.metaGraphs.length)) + m.metaGraphs = []; + m.metaGraphs.push($root.tensorflow.MetaGraphDef.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return SavedModel; + })(); + + tensorflow.FunctionDefLibrary = (function() { + + function FunctionDefLibrary(p) { + this["function"] = []; + this.gradient = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + FunctionDefLibrary.prototype["function"] = $util.emptyArray; + FunctionDefLibrary.prototype.gradient = $util.emptyArray; + + FunctionDefLibrary.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.FunctionDefLibrary(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + if (!(m["function"] && m["function"].length)) + m["function"] = []; + m["function"].push($root.tensorflow.FunctionDef.decode(r, r.uint32())); + break; + case 2: + if (!(m.gradient && m.gradient.length)) + m.gradient = []; + m.gradient.push($root.tensorflow.GradientDef.decode(r, r.uint32())); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return FunctionDefLibrary; + })(); + + tensorflow.FunctionDef = (function() { + + function FunctionDef(p) { + this.attr = {}; + this.nodeDef = []; + this.ret = {}; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + FunctionDef.prototype.signature = null; + FunctionDef.prototype.attr = $util.emptyObject; + FunctionDef.prototype.nodeDef = $util.emptyArray; + FunctionDef.prototype.ret = $util.emptyObject; + + FunctionDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.FunctionDef(), k; + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.signature = $root.tensorflow.OpDef.decode(r, r.uint32()); + break; + case 5: + r.skip().pos++; + if (m.attr === $util.emptyObject) + m.attr = {}; + k = r.string(); + r.pos++; + m.attr[k] = $root.tensorflow.AttrValue.decode(r, r.uint32()); + break; + case 3: + if (!(m.nodeDef && m.nodeDef.length)) + m.nodeDef = []; + m.nodeDef.push($root.tensorflow.NodeDef.decode(r, r.uint32())); + break; + case 4: + r.skip().pos++; + if (m.ret === $util.emptyObject) + m.ret = {}; + k = r.string(); + r.pos++; + m.ret[k] = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return FunctionDef; + })(); + + tensorflow.GradientDef = (function() { + + function GradientDef(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + GradientDef.prototype.functionName = ""; + GradientDef.prototype.gradientFunc = ""; + + GradientDef.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.GradientDef(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.functionName = r.string(); + break; + case 2: + m.gradientFunc = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + return GradientDef; + })(); + + return tensorflow; + })(); + + var compiled_api = $root; + var compiled_api_1 = compiled_api.tensorflow; + + function getParamValue(paramName, node, tensorMap, context) { + var param = node.params[paramName]; + if (param && param.inputIndex !== undefined) { + if (param.type === 'tensor') { + return getTensor(node.inputNames[param.inputIndex], tensorMap, context); + } + if (param.type === 'tensors') { + var inputs = param.inputIndex === 0 ? + (param.inputParamLength === 0 ? + node.inputNames : + node.inputNames.slice(param.inputIndex, -param.inputParamLength)) : + node.inputNames.splice(param.inputIndex); + return inputs.map(function (name) { return getTensor(name, tensorMap, context); }); + } + var data = Array.prototype.slice.call(getTensor(node.inputNames.slice(param.inputIndex)[0], tensorMap, context) + .dataSync()); + return param.type === 'number' ? data[0] : data; + } + return param && param.value; + } + function getTensor(name, tensorsMap, context) { + var _a = parseNodeName(name), nodeName = _a[0], index = _a[1]; + var contextId = context.currentContextIds.find(function (contextId) { + return !!tensorsMap[getNodeNameWithContextId(nodeName, contextId)]; + }); + return contextId !== undefined ? + tensorsMap[getNodeNameWithContextId(nodeName, contextId)][index] : + undefined; + } + function getNodeNameAndIndex(inputName, context) { + var _a = parseNodeName(inputName), nodeName = _a[0], index = _a[1]; + return [ + getNodeNameWithContextId(nodeName, context && context.currentContextId), + index + ]; + } + function getNodeNameWithContextId(name, contextId) { + return !!contextId ? name + "-" + contextId : name; + } + function parseNodeName(name) { + var index = name.lastIndexOf(':'); + if (index === -1) + return [name, 0]; + var nodeName = name.substring(0, index); + return [nodeName, Number(name.substring(index + 1))]; + } + function split(arr, size) { + var res = []; + for (var i = 0; i < arr.length; i += size) { + res.push(arr.slice(i, i + size)); + } + return res; + } + + var arithmetic = [ + { + "tfOpName": "Add", + "dlOpName": "add", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "BiasAdd", + "dlOpName": "add", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sub", + "dlOpName": "sub", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "RealDiv", + "dlOpName": "div", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Div", + "dlOpName": "div", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "FloorDiv", + "dlOpName": "floorDiv", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Mul", + "dlOpName": "mul", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Maximum", + "dlOpName": "maximum", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Minimum", + "dlOpName": "minimum", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Pow", + "dlOpName": "pow", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "SquaredDifference", + "dlOpName": "squaredDifference", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Mod", + "dlOpName": "mod", + "category": "arithmetic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } + ] + ; + + var arithmetic$1 = /*#__PURE__*/Object.freeze({ + default: arithmetic + }); + + var basic_math = [ + { + "tfOpName": "Abs", + "dlOpName": "abs", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Acos", + "dlOpName": "acos", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Asin", + "dlOpName": "asin", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "atan", + "dlOpName": "atan", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Ceil", + "dlOpName": "ceil", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "ClipByValue", + "dlOpName": "clipByValue", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "clip_value_min", + "dlParamName": "clipValueMin", + "type": "number" + }, + { + "tfParamName": "clip_value_max", + "dlParamName": "clipValueMax", + "type": "number" + } + ] + }, + { + "tfOpName": "Cos", + "dlOpName": "cos", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Cosh", + "dlOpName": "cosh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Elu", + "dlOpName": "elu", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Exp", + "dlOpName": "exp", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Floor", + "dlOpName": "floor", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Log", + "dlOpName": "log", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Neg", + "dlOpName": "neg", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Relu", + "dlOpName": "relu", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Relu6", + "dlOpName": "clipByValue", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + }, + { + "dlParamName": "clipValueMin", + "type": "number", + "defaultValue": 0 + }, + { + "dlParamName": "clipValueMax", + "type": "number", + "defaultValue": 6 + } + ] + }, + { + "tfOpName": "Selu", + "dlOpName": "selu", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sigmoid", + "dlOpName": "sigmoid", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sin", + "dlOpName": "sin", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sinh", + "dlOpName": "sinh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sqrt", + "dlOpName": "sqrt", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Rsqrt", + "dlOpName": "rsqrt", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Square", + "dlOpName": "square", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Tan", + "dlOpName": "tan", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Tanh", + "dlOpName": "tanh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Sign", + "dlOpName": "sign", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Round", + "dlOpName": "round", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Expm1", + "dlOpName": "expm1", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Log1p", + "dlOpName": "log1p", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Reciprocal", + "dlOpName": "reciprocal", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Reciprocal", + "dlOpName": "reciprocal", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Softplus", + "dlOpName": "softplus", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Asinh", + "dlOpName": "asinh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Acosh", + "dlOpName": "acosh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Atanh", + "dlOpName": "atanh", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Erf", + "dlOpName": "erf", + "category": "basic_math", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } + ] + ; + + var basicMath = /*#__PURE__*/Object.freeze({ + default: basic_math + }); + + var control = [ + { + "tfOpName": "LoopCond", + "dlOpName": "loopCond", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "pred", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Switch", + "dlOpName": "switch", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "data", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "pred", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Merge", + "dlOpName": "merge", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "tfInputParamLength": 0, + "dlParamName": "tensors", + "type": "tensors" + } + ] + }, + { + "tfOpName": "Enter", + "dlOpName": "enter", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + }, + { + "tfParamName": "frame_name", + "dlParamName": "frameName", + "type": "string" + }, + { + "tfParamName": "is_constant", + "dlParamName": "isConstant", + "type": "bool" + } + ] + }, + { + "tfOpName": "Exit", + "dlOpName": "exit", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "NextIteration", + "dlOpName": "nextIteration", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "TensorArrayV3", + "dlOpName": "tensorArray", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "size", + "type": "number" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "element_shape", + "dlParamName": "elementShape", + "type": "shape" + }, + { + "tfParamName": "dynamic_size", + "dlParamName": "dynamicSize", + "type": "bool" + }, + { + "tfParamName": "clear_after_read", + "dlParamName": "clearAfterRead", + "type": "bool" + }, + { + "tfParamName": "identical_element_shapes", + "dlParamName": "identicalElementShapes", + "type": "bool" + }, + { + "tfParamName": "tensor_array_name", + "dlParamName": "name", + "type": "string" + } + ] + }, + { + "tfOpName": "TensorArrayWriteV3", + "dlOpName": "tensorArrayWrite", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "index", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfInputIndex": 3, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "TensorArrayReadV3", + "dlOpName": "tensorArrayRead", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "index", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "TensorArrayGatherV3", + "dlOpName": "tensorArrayGather", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "indices", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "element_shape", + "dlParamName": "elementShape", + "type": "shape" + } + ] + }, + { + "tfOpName": "TensorArrayScatterV3", + "dlOpName": "tensorArrayScatter", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "indices", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "tensor", + "type": "number[]" + }, + { + "tfInputIndex": 3, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "TensorArrayConcatV3", + "dlOpName": "tensorArrayConcat", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "element_shape_except0", + "dlParamName": "elementShapeExcept0", + "type": "shape", + "notSupported": true + } + ] + }, + { + "tfOpName": "TensorArraySplitV3", + "dlOpName": "tensorArraySplit", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "lengths", + "type": "number[]" + }, + { + "tfInputIndex": 3, + "dlParamName": "flowIn", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "TensorArraySizeV3", + "dlOpName": "tensorArraySize", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "flowIn", + "type": "number" + } + ] + }, + { + "tfOpName": "TensorArrayCloseV3", + "dlOpName": "tensorArrayClose", + "category": "control", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "tensorArrayId", + "type": "number" + } + ] + } + ] + ; + + var control$1 = /*#__PURE__*/Object.freeze({ + default: control + }); + + var convolution = [ + { + "tfOpName": "AvgPool", + "dlOpName": "avgPool", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + }, + { + "tfParamName": "ksize", + "dlParamName": "kernelSize", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "MaxPool", + "dlOpName": "maxPool", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + }, + { + "tfParamName": "ksize", + "dlParamName": "kernelSize", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Conv1D", + "dlOpName": "conv1d", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfParamName": "stride", + "dlParamName": "stride", + "type": "number" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "defaultValue": "NWC" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + }, + { + "tfParamName": "dilation", + "dlParamName": "dilation", + "type": "number", + "defaultValue": 1 + } + ] + }, + { + "tfOpName": "Conv2D", + "dlOpName": "conv2d", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "useCudnnOnGpu", + "dlParamName": "useCudnnOnGpu", + "type": "bool" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfParamName": "dilations", + "dlParamName": "dilations", + "type": "number[]" + } + ] + }, + { + "tfOpName": "Conv2DBackpropInput", + "dlOpName": "conv2dTranspose", + "category": "convolution", + "params": [ + { + "tfInputIndex": 2, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfInputIndex": 0, + "dlParamName": "outputShape", + "type": "number[]" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "DepthwiseConv2d", + "dlOpName": "depthwiseConv2d", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "input", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfParamName": "dilations", + "dlParamName": "dilations", + "type": "number[]" + } + ] + }, + { + "tfOpName": "DepthwiseConv2dNative", + "dlOpName": "depthwiseConv2d", + "category": "convolution", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "input", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "filter", + "type": "tensor" + }, + { + "tfParamName": "strides", + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "padding", + "dlParamName": "pad", + "type": "string" + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "defaultValue": "NHWC" + }, + { + "tfParamName": "dilations", + "dlParamName": "dilations", + "type": "number[]" + } + ] + } + ] + ; + + var convolution$1 = /*#__PURE__*/Object.freeze({ + default: convolution + }); + + var creation = [ + { + "tfOpName": "Fill", + "dlOpName": "fill", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfInputIndex": 1, + "dlParamName": "value", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LinSpace", + "dlOpName": "linspace", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "start", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "stop", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "num", + "type": "number" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "OneHot", + "dlOpName": "oneHot", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "indices", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "depth", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "onValue", + "type": "number", + "defaultValue": 1 + }, + { + "tfInputIndex": 3, + "dlParamName": "offValue", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "notSupported": true + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Ones", + "dlOpName": "ones", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "OnesLike", + "dlOpName": "onesLike", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "RandomUniform", + "dlOpName": "randomUniform", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfParamName": "minval", + "dlParamName": "minval", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "maxval", + "dlParamName": "maxval", + "type": "number", + "defaultValue": 1 + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "seed", + "dlParamName": "seed", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "seed2", + "dlParamName": "seed2", + "type": "number", + "defaultValue": 0, + "notSupported": true + }, + { + "tfParamName": "T", + "dlParamName": "T", + "type": "number", + "notSupported": true + } + ] + }, + { + "tfOpName": "Range", + "dlOpName": "range", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "start", + "type": "number" + }, + { + "tfInputIndex": 1, + "dlParamName": "stop", + "type": "number" + }, + { + "tfInputIndex": 2, + "dlParamName": "step", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "Tidx", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "truncatedNormal", + "dlOpName": "truncatedNormal", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfParamName": "means", + "dlParamName": "mean", + "type": "number", + "defaultValue": 0.0 + }, + { + "tfParamName": "stddev", + "dlParamName": "stdDev", + "type": "number", + "defaultValue": 1.0 + }, + { + "tfParamName": "seed", + "dlParamName": "seed", + "type": "number" + }, + { + "tfParamName": "seed2", + "dlParamName": "seed2", + "type": "number", + "defaultValue": 0, + "notSupported": true + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + }, + { + "tfParamName": "T", + "dlParamName": "T", + "type": "number", + "notSupported": true + } + ] + }, + { + "tfOpName": "Zeros", + "dlOpName": "zeros", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "shape", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "ZerosLike", + "dlOpName": "zerosLike", + "category": "creation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype" + } + ] + } + ] + ; + + var creation$1 = /*#__PURE__*/Object.freeze({ + default: creation + }); + + var dynamic = [ + { + "tfOpName": "NonMaxSuppressionV2", + "dlOpName": "nonMaxSuppression", + "category": "dynamic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "boxes", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scores", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "maxOutputSize", + "type": "number" + }, + { + "tfInputIndex": 3, + "dlParamName": "iouThreshold", + "type": "number" + } + ] + }, + { + "tfOpName": "NonMaxSuppressionV3", + "dlOpName": "nonMaxSuppression", + "category": "dynamic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "boxes", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scores", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "maxOutputSize", + "type": "number" + }, + { + "tfInputIndex": 3, + "dlParamName": "iouThreshold", + "type": "number" + }, + { + "tfInputIndex": 4, + "dlParamName": "scoreThreshold", + "type": "number" + } + ] + }, + { + "tfOpName": "Where", + "dlOpName": "whereAsync", + "category": "dynamic", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "condition", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } + ] + ; + + var dynamic$1 = /*#__PURE__*/Object.freeze({ + default: dynamic + }); + + var evaluation = [ + { + "tfOpName": "TopKV2", + "dlOpName": "topK", + "category": "evaluation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "k", + "type": "number" + }, + { + "tfParamName": "sorted", + "dlParamName": "sorted", + "type": "bool" + } + ] + } + ] + ; + + var evaluation$1 = /*#__PURE__*/Object.freeze({ + default: evaluation + }); + + var graph = [ + { + "tfOpName": "PlaceholderWithDefault", + "dlOpName": "placeholder", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "default", + "type": "tensor" + }, + { + "tfParamName": "shape", + "dlParamName": "shape", + "type": "shape" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "Placeholder", + "dlOpName": "placeholder", + "category": "graph", + "params": [ + { + "tfParamName": "shape", + "dlParamName": "shape", + "type": "shape" + }, + { + "tfParamName": "dtype", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "Const", + "dlOpName": "const", + "category": "graph" + }, + { + "tfOpName": "Identity", + "dlOpName": "identity", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Snapshot", + "dlOpName": "snapshot", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Rank", + "dlOpName": "rank", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Size", + "dlOpName": "size", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Shape", + "dlOpName": "shape", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "Print", + "dlOpName": "print", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "tfInputParamLength": 1, + "dlParamName": "data", + "type": "tensors" + }, + { + "tfParamName": "message", + "dlParamName": "message", + "type": "string" + }, + { + "tfParamName": "first_n", + "dlParamName": "firstN", + "type": "number", + "notSupprted": true + }, + { + "tfParamName": "summarize", + "dlParamName": "summarize", + "type": "number", + "defaultValue": 3 + } + ] + }, + { + "tfOpName": "NoOp", + "dlOpName": "noop", + "category": "graph", + "params": [] + }, + { + "tfOpName": "StopGradient", + "dlOpName": "stopGradient", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + }, + { + "tfOpName": "FakeQuantWithMinMaxVars", + "dlOpName": "fakeQuantWithMinMaxVars", + "category": "graph", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "min", + "dlParamName": "min", + "type": "number" + }, + { + "tfParamName": "max", + "dlParamName": "max", + "type": "number" + } + ] + } + ] + ; + + var graph$1 = /*#__PURE__*/Object.freeze({ + default: graph + }); + + var image = [ + { + "tfOpName": "ResizeBilinear", + "dlOpName": "resizeBilinear", + "category": "image", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "images", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "size", + "type": "number[]" + }, + { + "tfParamName": "align_corners", + "dlParamName": "alignCorners", + "type": "bool" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "ResizeNearestNeighbor", + "dlOpName": "resizeNearestNeighbor", + "category": "image", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "images", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "size", + "type": "number[]" + }, + { + "tfParamName": "align_corners", + "dlParamName": "alignCorners", + "type": "bool" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "NonMaxSuppressionV2", + "dlOpName": "nonMaxSuppression", + "category": "image", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "boxes", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scores", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "maxOutputSize", + "type": "number" + }, + { + "tfInputIndex": 3, + "dlParamName": "iouThreshold", + "type": "number" + } + ] + }, + { + "tfOpName": "NonMaxSuppressionV3", + "dlOpName": "nonMaxSuppression", + "category": "image", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "boxes", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scores", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "maxOutputSize", + "type": "number" + }, + { + "tfInputIndex": 3, + "dlParamName": "iouThreshold", + "type": "number" + }, + { + "tfInputIndex": 4, + "dlParamName": "scoreThreshold", + "type": "number" + } + ] + } + ] + ; + + var image$1 = /*#__PURE__*/Object.freeze({ + default: image + }); + + var logical = [ + { + "tfOpName": "Equal", + "dlOpName": "equal", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "NotEqual", + "dlOpName": "notEqual", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Greater", + "dlOpName": "greater", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "GreaterEqual", + "dlOpName": "greaterEqual", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Less", + "dlOpName": "less", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LessEqual", + "dlOpName": "lessEqual", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LogicalAnd", + "dlOpName": "logicalAnd", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LogicalNot", + "dlOpName": "logicalNot", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "LogicalOr", + "dlOpName": "logicalOr", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Select", + "dlOpName": "where", + "category": "logical", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "condition", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } + ] + ; + + var logical$1 = /*#__PURE__*/Object.freeze({ + default: logical + }); + + var matrices = [ + { + "tfOpName": "MatMul", + "dlOpName": "matMul", + "category": "matrices", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "a", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "b", + "type": "tensor" + }, + { + "tfParamName": "transpose_a", + "dlParamName": "transposeA", + "type": "bool", + "defaultValue": false + }, + { + "tfParamName": "transpose_b", + "dlParamName": "transposeB", + "type": "bool", + "defaultValue": false + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + }, + { + "tfOpName": "Transpose", + "dlOpName": "transpose", + "category": "matrices", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "perm", + "dlParamName": "perm", + "type": "number[]" + }, + { + "tfParamName": "T", + "dlParamName": "dtype", + "type": "dtype", + "notSupported": true + } + ] + } + ] + ; + + var matrices$1 = /*#__PURE__*/Object.freeze({ + default: matrices + }); + + var normalization = [ + { + "tfOpName": "FusedBatchNorm", + "dlOpName": "batchNormalization", + "category": "normalization", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scale", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "offset", + "type": "tensor" + }, + { + "tfInputIndex": 3, + "dlParamName": "mean", + "type": "tensor" + }, + { + "tfInputIndex": 4, + "dlParamName": "variance", + "type": "tensor" + }, + { + "tfParamName": "epsilon", + "dlParamName": "epsilon", + "type": "number", + "defaultValue": 0.001 + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "FusedBatchNormV2", + "dlOpName": "batchNormalization", + "category": "normalization", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "scale", + "type": "tensor" + }, + { + "tfInputIndex": 2, + "dlParamName": "offset", + "type": "tensor" + }, + { + "tfInputIndex": 3, + "dlParamName": "mean", + "type": "tensor" + }, + { + "tfInputIndex": 4, + "dlParamName": "variance", + "type": "tensor" + }, + { + "tfParamName": "epsilon", + "dlParamName": "epsilon", + "type": "number", + "defaultValue": 0.001 + }, + { + "tfParamName": "data_format", + "dlParamName": "dataFormat", + "type": "string", + "notSupported": true + } + ] + }, + { + "tfOpName": "LRN", + "dlOpName": "localResponseNormalization", + "category": "normalization", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "depth_radius", + "dlParamName": "radius", + "type": "number", + "defaultValue": 5 + }, + { + "tfParamName": "bias", + "dlParamName": "bias", + "type": "number", + "defaultValue": 1.0 + }, + { + "tfParamName": "alpha", + "dlParamName": "alpha", + "type": "number", + "defaultValue": 1.0 + }, + { + "tfParamName": "beta", + "dlParamName": "beta", + "type": "number", + "defaultValue": 0.5 + } + ] + }, { + "tfOpName": "Softmax", + "dlOpName": "softmax", + "category": "normalization", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + } + ] + } + ] + ; + + var normalization$1 = /*#__PURE__*/Object.freeze({ + default: normalization + }); + + var reduction = [ + { + "tfOpName": "Max", + "dlOpName": "max", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "Mean", + "dlOpName": "mean", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "Min", + "dlOpName": "min", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "Sum", + "dlOpName": "sum", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "All", + "dlOpName": "all", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "Any", + "dlOpName": "any", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number[]" + }, + { + "tfParamName": "keep_dims", + "dlParamName": "keepDims", + "type": "bool" + } + ] + }, + { + "tfOpName": "ArgMax", + "dlOpName": "argMax", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "ArgMin", + "dlOpName": "argMin", + "category": "reduction", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number" + } + ] + } + ] + ; + + var reduction$1 = /*#__PURE__*/Object.freeze({ + default: reduction + }); + + var slice_join = [ + { + "tfOpName": "ConcatV2", + "dlOpName": "concat", + "category": "slice_join", + "params": [ + { + "tfInputIndex": 0, + "tfInputParamLength": 1, + "dlParamName": "tensors", + "type": "tensors" + }, + { + "tfInputIndex": -1, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "Concat", + "dlOpName": "concat", + "category": "slice_join", + "params": [ + { + "tfInputIndex": 1, + "tfInputParamLength": 1, + "dlParamName": "tensors", + "type": "tensors" + }, + { + "tfInputIndex": 0, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "GatherV2", + "dlOpName": "gather", + "category": "slice_join", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "indices", + "type": "tensor" + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Gather", + "dlOpName": "gather", + "category": "slice_join", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "indices", + "type": "tensor" + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "validate_indices", + "dlParamName": "validateIndices", + "type": "bool", + "notSupported": true + } + ] + }, + { + "tfOpName": "Reverse", + "dlOpName": "reverse", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "ReverseV2", + "dlOpName": "reverse", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "Slice", + "dlOpName": "slice", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "begin", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "size", + "type": "number[]" + } + ] + }, + { + "tfOpName": "StridedSlice", + "dlOpName": "stridedSlice", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "begin", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "end", + "type": "number[]" + }, + { + "tfInputIndex": 3, + "dlParamName": "strides", + "type": "number[]" + }, + { + "tfParamName": "begin_mask", + "dlParamName": "beginMask", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "end_mask", + "dlParamName": "endMask", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Pack", + "dlOpName": "stack", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "tfInputParamLength": 0, + "dlParamName": "tensors", + "type": "tensors" + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Unpack", + "dlOpName": "unstack", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "tfInputParamLength": 0, + "dlParamName": "tensor", + "type": "tensor" + }, + { + "tfParamName": "axis", + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + }, + { + "tfParamName": "num", + "dlParamName": "num", + "type": "number", + "defaultValue": 0, + "notSupported": true + } + ] + }, + { + "tfOpName": "Tile", + "dlOpName": "tile", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "reps", + "type": "number[]" + } + ] + }, + { + "tfOpName": "Split", + "dlOpName": "split", + "category": "slice_join", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "axis", + "type": "number", + "defaultValue": 0 + }, + { + "tfInputIndex": 1, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "num_split", + "dlParamName": "numOrSizeSplits", + "type": "number", + "defaultValue": 1 + } + ] + } + ] + ; + + var sliceJoin = /*#__PURE__*/Object.freeze({ + default: slice_join + }); + + var transformation = [ + { + "tfOpName": "Cast", + "dlOpName": "cast", + "category": "transformation", + "params": [ + { + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "SrcT", + "dlParamName": "sdtype", + "type": "dtype", + "notSupported": true + }, + { + "tfParamName": "DstT", + "dlParamName": "dtype", + "type": "dtype" + } + ] + }, + { + "tfOpName": "ExpandDims", + "dlOpName": "expandDims", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "tfParamNameDeprecated": "dim", + "dlParamName": "axis", + "type": "number" + } + ] + }, + { + "tfOpName": "Pad", + "dlOpName": "pad", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "padding", + "type": "number[]" + }, + { + "tfParamName": "constant_value", + "dlParamName": "constantValue", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "PadV2", + "dlOpName": "pad", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "padding", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "constantValue", + "type": "number", + "defaultValue": 0 + } + ] + }, + { + "tfOpName": "Reshape", + "dlOpName": "reshape", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "shape", + "type": "number[]" + } + ] + }, + { + "tfOpName": "Squeeze", + "dlOpName": "squeeze", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfParamName": "axis", + "tfParamNameDeprecated": "squeeze_dims", + "dlParamName": "axis", + "type": "number[]" + } + ] + }, + { + "tfOpName": "SpaceToBatchND", + "dlOpName": "spaceToBatchND", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "blockShape", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "paddings", + "type": "number[]" + } + ] + }, + { + "tfOpName": "BatchToSpaceND", + "dlOpName": "batchToSpaceND", + "category": "transformation", + "params": [{ + "tfInputIndex": 0, + "dlParamName": "x", + "type": "tensor" + }, + { + "tfInputIndex": 1, + "dlParamName": "blockShape", + "type": "number[]" + }, + { + "tfInputIndex": 2, + "dlParamName": "crops", + "type": "number[]" + } + ] + } + ] + ; + + var transformation$1 = /*#__PURE__*/Object.freeze({ + default: transformation + }); + + var CONTROL_FLOW_OPS = ['Switch', 'Merge', 'Enter', 'Exit', 'NextIteration']; + var DYNAMIC_SHAPE_OPS = ['NonMaxSuppressionV2', 'NonMaxSuppressionV3', 'Where']; + var OperationMapper = (function () { + function OperationMapper() { + var ops = [ + arithmetic$1, basicMath, control$1, convolution$1, creation$1, dynamic$1, + evaluation$1, logical$1, image$1, graph$1, matrices$1, normalization$1, reduction$1, + sliceJoin, transformation$1 + ]; + var mappersJson = [].concat.apply([], ops.map(function (op) { return op.default ? op.default : op; })); + this.opMappers = mappersJson.reduce(function (map, mapper) { + map[mapper.tfOpName] = mapper; + return map; + }, {}); + } + Object.defineProperty(OperationMapper, "Instance", { + get: function () { + return this._instance || (this._instance = new this()); + }, + enumerable: true, + configurable: true + }); + OperationMapper.prototype.isControlFlow = function (node) { + return CONTROL_FLOW_OPS.some(function (op) { return op === node.op; }); + }; + OperationMapper.prototype.isDynamicShape = function (node) { + return DYNAMIC_SHAPE_OPS.some(function (op) { return op === node.op; }); + }; + OperationMapper.prototype.transformGraph = function (graph$$1) { + var _this = this; + var tfNodes = graph$$1.node; + var withControlFlow = false; + var withDynamicShape = false; + var placeholders = []; + var nodes = tfNodes.reduce(function (map, node) { + map[node.name] = _this.mapNode(node); + if (_this.isControlFlow(node)) + withControlFlow = true; + if (_this.isDynamicShape(node)) + withDynamicShape = true; + if (node.op === 'Placeholder') + placeholders.push(map[node.name]); + return map; + }, {}); + var inputs = []; + var outputs = []; + Object.keys(nodes).forEach(function (key) { + var node = nodes[key]; + node.inputNames.forEach(function (name) { + var nodeName = getNodeNameAndIndex(name)[0]; + node.inputs.push(nodes[nodeName]); + nodes[nodeName].children.push(node); + }); + if (node.inputs.length === 0) + inputs.push(node); + }); + Object.keys(nodes).forEach(function (key) { + var node = nodes[key]; + if (node.children.length === 0) + outputs.push(node); + }); + return { + nodes: nodes, + inputs: inputs, + outputs: outputs, + placeholders: placeholders, + withControlFlow: withControlFlow, + withDynamicShape: withDynamicShape + }; + }; + OperationMapper.prototype.mapNode = function (node) { + var _this = this; + var mapper = this.opMappers[node.op]; + if (mapper === undefined) { + throw new Error('Tensorflow Op is not supported: ' + node.op); + } + var newNode = { + name: node.name, + op: mapper.dlOpName, + category: mapper.category, + inputNames: (node.input || + []).map(function (input) { return input.startsWith('^') ? input.substr(1) : input; }), + inputs: [], + children: [], + params: {} + }; + if (!!mapper.params) { + newNode.params = mapper.params.reduce(function (map, param) { + var inputIndex = param.tfInputIndex; + var inputParamLength = param.tfInputParamLength; + var type = param.type; + var value = undefined; + if (inputIndex === undefined) { + switch (param.type) { + case 'string': + value = _this.getStringParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getStringParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'number': + value = _this.getNumberParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getNumberParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'number[]': + value = _this.getNumericArrayParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getNumericArrayParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'bool': + value = _this.getBoolParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getBoolParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'shape': + value = _this.getTensorShapeParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getTensorShapeParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'dtype': + value = _this.getDtypeParam(node.attr, param.tfParamName, param.defaultValue); + if (value === undefined && !!param.tfParamNameDeprecated) { + value = _this.getDtypeParam(node.attr, param.tfParamNameDeprecated, param.defaultValue); + } + break; + case 'tensor': + case 'tensors': + break; + default: + throw new Error("Unsupported param type: " + param.type + " for op: " + node.op); + } + } + map[param.dlParamName] = { value: value, inputIndex: inputIndex, type: type, inputParamLength: inputParamLength }; + return map; + }, {}); + } + return newNode; + }; + OperationMapper.prototype.getStringParam = function (attrs, name, def, keepCase) { + if (keepCase === void 0) { keepCase = false; } + var param = attrs[name]; + if (param !== undefined) { + var value = String.fromCharCode.apply(null, param.s); + return keepCase ? value : value.toLowerCase(); + } + return def; + }; + OperationMapper.prototype.getBoolParam = function (attrs, name, def) { + var param = attrs[name]; + return param ? param.b : def; + }; + OperationMapper.prototype.getNumberParam = function (attrs, name, def) { + var param = attrs[name]; + var value = (param ? ((param.f !== undefined) ? param.f : param.i) : def); + return (typeof value === 'number') ? value : value['toInt'](); + }; + OperationMapper.prototype.getDtypeParam = function (attrs, name, def) { + var param = attrs[name]; + if (param && param.type) { + switch (param.type) { + case compiled_api_1.DataType.DT_FLOAT: + return 'float32'; + case compiled_api_1.DataType.DT_INT32: + return 'int32'; + case compiled_api_1.DataType.DT_BOOL: + return 'bool'; + default: + return def; + } + } + return def; + }; + OperationMapper.prototype.getTensorShapeParam = function (attrs, name, def) { + var param = attrs[name]; + if (param && param.shape) { + return param.shape.dim.map(function (dim) { + return (typeof dim.size === 'number') ? dim.size : dim.size['toInt'](); + }); + } + return def; + }; + OperationMapper.prototype.getNumericArrayParam = function (attrs, name, def) { + var param = attrs[name]; + if (param) { + return ((param.list.f && param.list.f.length ? param.list.f : + param.list.i)) + .map(function (v) { return (typeof v === 'number') ? v : v['toInt'](); }); + } + return def; + }; + return OperationMapper; + }()); + + var executeOp = function (node, tensorMap, context) { + switch (node.op) { + case 'add': { + return [tfc.add(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'mod': + return [tfc.mod(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + case 'mul': + return [tfc.mul(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + case 'div': { + return [tfc.div(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'floorDiv': { + return [tfc.floorDiv(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'sub': { + return [tfc.sub(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'minimum': { + return [tfc.minimum(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'maximum': { + return [tfc.maximum(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'pow': { + return [tfc.pow(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'squaredDifference': { + return [tfc.squaredDifference(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$1 = function (node, tensorMap, context) { + switch (node.op) { + case 'abs': + return [tfc.abs(getParamValue('x', node, tensorMap, context))]; + case 'acos': + return [tfc.acos(getParamValue('x', node, tensorMap, context))]; + case 'acosh': + return [tfc.acosh(getParamValue('x', node, tensorMap, context))]; + case 'asin': + return [tfc.asin(getParamValue('x', node, tensorMap, context))]; + case 'asinh': + return [tfc.asinh(getParamValue('x', node, tensorMap, context))]; + case 'atan': + return [tfc.atan(getParamValue('x', node, tensorMap, context))]; + case 'atanh': + return [tfc.atanh(getParamValue('x', node, tensorMap, context))]; + case 'ceil': + return [tfc.ceil(getParamValue('x', node, tensorMap, context))]; + case 'cos': + return [tfc.cos(getParamValue('x', node, tensorMap, context))]; + case 'cosh': + return [tfc.cosh(getParamValue('x', node, tensorMap, context))]; + case 'elu': + return [tfc.elu(getParamValue('x', node, tensorMap, context))]; + case 'erf': + return [tfc.erf(getParamValue('x', node, tensorMap, context))]; + case 'exp': + return [tfc.exp(getParamValue('x', node, tensorMap, context))]; + case 'expm1': { + return [tfc.expm1(getParamValue('x', node, tensorMap, context))]; + } + case 'floor': + return [tfc.floor(getParamValue('x', node, tensorMap, context))]; + case 'log': + return [tfc.log(getParamValue('x', node, tensorMap, context))]; + case 'log1p': { + return [tfc.log1p(getParamValue('x', node, tensorMap, context))]; + } + case 'neg': + return [tfc.neg(getParamValue('x', node, tensorMap, context))]; + case 'reciprocal': { + return [tfc.reciprocal(getParamValue('x', node, tensorMap, context))]; + } + case 'relu': + return [tfc.relu(getParamValue('x', node, tensorMap, context))]; + case 'round': { + return [tfc.round(getParamValue('x', node, tensorMap, context))]; + } + case 'selu': + return [tfc.selu(getParamValue('x', node, tensorMap, context))]; + case 'sigmoid': + return [tfc.sigmoid(getParamValue('x', node, tensorMap, context))]; + case 'sin': + return [tfc.sin(getParamValue('x', node, tensorMap, context))]; + case 'sign': { + return [tfc.sign(getParamValue('x', node, tensorMap, context))]; + } + case 'sinh': { + return [tfc.sinh(getParamValue('x', node, tensorMap, context))]; + } + case 'softplus': { + return [tfc.softplus(getParamValue('x', node, tensorMap, context))]; + } + case 'sqrt': { + return [tfc.sqrt(getParamValue('x', node, tensorMap, context))]; + } + case 'square': { + return [tfc.square(getParamValue('x', node, tensorMap, context))]; + } + case 'tanh': { + return [tfc.tanh(getParamValue('x', node, tensorMap, context))]; + } + case 'tan': + return [tfc.tan(getParamValue('x', node, tensorMap, context))]; + case 'clipByValue': + return [tfc.clipByValue(getParamValue('x', node, tensorMap, context), getParamValue('clipValueMin', node, tensorMap, context), getParamValue('clipValueMax', node, tensorMap, context))]; + case 'rsqrt': + return [tfc.div(tfc.scalar(1.0, 'float32'), tfc.sqrt(getTensor(node.inputNames[0], tensorMap, context)))]; + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var TensorArray = (function () { + function TensorArray(name, dtype, maxSize, elementShape, identicalElementShapes, dynamicSize, clearAfterRead) { + this.name = name; + this.dtype = dtype; + this.maxSize = maxSize; + this.elementShape = elementShape; + this.identicalElementShapes = identicalElementShapes; + this.dynamicSize = dynamicSize; + this.clearAfterRead = clearAfterRead; + this.tensors = []; + this.closed_ = false; + this.id = TensorArray.nextId++; + } + Object.defineProperty(TensorArray.prototype, "closed", { + get: function () { + return this.closed_; + }, + enumerable: true, + configurable: true + }); + TensorArray.prototype.clearAndClose = function () { + this.tensors.forEach(function (tensor) { return tensor.tensor.dispose(); }); + this.tensors = []; + this.closed_ = true; + }; + TensorArray.prototype.size = function () { + return this.tensors.length; + }; + TensorArray.prototype.read = function (index) { + if (this.closed_) { + throw new Error("TensorArray " + this.name + " has already been closed."); + } + if (index < 0 || index >= this.tensors.length) { + throw new Error("Tried to read from index " + index + ", but array size is: " + this.tensors.length); + } + var tensorWithState = this.tensors[index]; + if (tensorWithState.cleared) { + throw new Error("TensorArray " + this.name + ": Could not read index " + index + " twice because it was cleared after a previous read " + + "(perhaps try setting clear_after_read = false?)."); + } + if (this.clearAfterRead) { + tensorWithState.cleared = true; + } + tensorWithState.read = true; + return tensorWithState.tensor; + }; + TensorArray.prototype.readMany = function (indices) { + var _this = this; + return indices.map(function (index) { return _this.read(index); }); + }; + TensorArray.prototype.write = function (index, tensor) { + if (this.closed_) { + throw new Error("TensorArray " + this.name + " has already been closed."); + } + if (index < 0 || !this.dynamicSize && index >= this.maxSize) { + throw new Error("Tried to write to index " + index + ", but array is not resizeable and size is: " + this.maxSize); + } + var t = this.tensors[index] || {}; + if (tensor.dtype !== this.dtype) { + throw new Error("TensorArray " + this.name + ": Could not write to TensorArray index " + index + ",\n because the value dtype is " + tensor.dtype + ", but TensorArray dtype is " + this.dtype + "."); + } + if (this.size() === 0 && this.elementShape.length === 0) { + this.elementShape = tensor.shape; + } + tfc.util.assertShapesMatch(this.elementShape, tensor.shape, "TensorArray " + this.name + ": Could not write to TensorArray index " + index + "."); + if (t && t.read) { + throw new Error("TensorArray " + this.name + ": Could not write to TensorArray index " + index + ", because it has already been read."); + } + if (t && t.written) { + throw new Error("TensorArray " + this.name + ": Could not write to TensorArray index " + index + ", because it has already been written."); + } + t.tensor = tensor; + t.written = true; + this.tensors[index] = t; + }; + TensorArray.prototype.writeMany = function (indices, tensors) { + var _this = this; + if (indices.length !== tensors.length) { + throw new Error("TensorArray " + this.name + ": could not write multiple tensors," + + ("because the index size: " + indices.length + " is not the same as tensors size: " + tensors.length + ".")); + } + indices.map(function (i, index) { return _this.write(i, tensors[index]); }); + }; + TensorArray.prototype.gather = function (indices, dtype) { + if (!!dtype && dtype !== this.dtype) { + throw new Error("TensorArray dtype is " + this.dtype + " but gather requested dtype " + dtype); + } + if (!indices) { + indices = []; + for (var i = 0; i < this.size(); i++) { + indices.push(i); + } + } + if (indices.length === 0) { + return tfc.tensor([], [0].concat(this.elementShape)); + } + var tensors = this.readMany(indices); + tfc.util.assertShapesMatch(this.elementShape, tensors[0].shape, 'TensorArray shape mismatch: '); + return tfc.stack(tensors, 0); + }; + TensorArray.prototype.concat = function (dtype) { + if (!!dtype && dtype !== this.dtype) { + throw new Error("TensorArray dtype is " + this.dtype + " but concat requested dtype " + dtype); + } + if (this.size() === 0) { + return tfc.tensor([], [0].concat(this.elementShape)); + } + var indices = []; + for (var i = 0; i < this.size(); i++) { + indices.push(i); + } + var tensors = this.readMany(indices); + tfc.util.assertShapesMatch(this.elementShape, tensors[0].shape, "TensorArray shape mismatch: tensor array shape (" + this.elementShape + ") vs first tensor shape (" + tensors[0].shape + ")"); + return tfc.concat(tensors, 0); + }; + TensorArray.prototype.scatter = function (indices, tensor) { + if (tensor.dtype !== this.dtype) { + throw new Error("TensorArray dtype is " + this.dtype + " but tensor has dtype " + tensor.dtype); + } + if (indices.length !== tensor.shape[0]) { + throw new Error("Expected len(indices) == tensor.shape[0], but saw: " + indices.length + " vs. " + tensor.shape[0]); + } + var maxIndex = Math.max.apply(Math, indices); + if (!this.dynamicSize && maxIndex >= this.maxSize) { + throw new Error("Max index must be < array size (" + maxIndex + " vs. " + this.maxSize + ")"); + } + this.writeMany(indices, tfc.unstack(tensor, 0)); + }; + TensorArray.prototype.split = function (length, tensor) { + var _this = this; + if (tensor.dtype !== this.dtype) { + throw new Error("TensorArray dtype is " + this.dtype + " but tensor has dtype " + tensor.dtype); + } + var totalLength = 0; + var cumulativeLengths = length.map(function (len) { + totalLength += len; + return totalLength; + }); + if (totalLength !== tensor.shape[0]) { + throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n " + totalLength + ", and tensor's shape is: " + tensor.shape); + } + if (!this.dynamicSize && length.length !== this.maxSize) { + throw new Error("TensorArray's size is not equal to the size of lengths (" + this.maxSize + " vs. " + length.length + "), " + + 'and the TensorArray is not marked as dynamically resizeable'); + } + var elementPerRow = totalLength === 0 ? 0 : tensor.size / totalLength; + var tensors = []; + tfc.tidy(function () { + tensor = tensor.reshape([1, totalLength, elementPerRow]); + for (var i = 0; i < length.length; ++i) { + var previousLength = (i === 0) ? 0 : cumulativeLengths[i - 1]; + var indices_1 = [0, previousLength, 0]; + var sizes = [1, length[i], elementPerRow]; + tensors[i] = tfc.slice(tensor, indices_1, sizes).reshape(_this.elementShape); + } + return tensors; + }); + var indices = []; + for (var i = 0; i < length.length; i++) { + indices[i] = i; + } + this.writeMany(indices, tensors); + }; + TensorArray.nextId = 0; + return TensorArray; + }()); + + function executeOp$2(node, tensorMap, context) { + return __awaiter(this, void 0, void 0, function () { + var _a, pred, data_1, inputName, frameId, data, tensor, input, size, dtype, elementShape, dynamicSize, clearAfterRead, identicalElementShapes, name_1, tensorArray, id, index, writeTensor, writeTensorArray, readId, readIndex, readTensorArray, gatherId, gatherIndices, gatherDtype, gatherTensorArray, scatterId, scatterIndices, scatterTensor, scatterTensorArray, concatId, concatTensorArray, concatDtype, splitId, splitTensor, lengths, splitTensorArray, sizeId, sizeTensorArray, closeId, closeTensorArray; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = node.op; + switch (_a) { + case 'loopCond': return [3, 1]; + case 'switch': return [3, 2]; + case 'merge': return [3, 4]; + case 'enter': return [3, 5]; + case 'exit': return [3, 6]; + case 'nextIteration': return [3, 7]; + case 'tensorArray': return [3, 8]; + case 'tensorArrayWrite': return [3, 9]; + case 'tensorArrayRead': return [3, 10]; + case 'tensorArrayGather': return [3, 11]; + case 'tensorArrayScatter': return [3, 12]; + case 'tensorArrayConcat': return [3, 13]; + case 'tensorArraySplit': return [3, 14]; + case 'tensorArraySize': return [3, 15]; + case 'tensorArrayClose': return [3, 16]; + } + return [3, 17]; + case 1: return [2, [getParamValue('pred', node, tensorMap, context)]]; + case 2: + pred = getParamValue('pred', node, tensorMap, context); + data_1 = getParamValue('data', node, tensorMap, context); + return [4, pred.data()]; + case 3: return [2, (_b.sent())[0] ? [undefined, data_1] : [data_1, undefined]]; + case 4: + inputName = node.inputNames.find(function (name) { return getTensor(name, tensorMap, context) !== undefined; }); + return [2, inputName ? [getTensor(inputName, tensorMap, context)] : undefined]; + case 5: + frameId = getParamValue('frameName', node, tensorMap, context); + data = getParamValue('tensor', node, tensorMap, context); + context.enterFrame(frameId); + return [2, [data]]; + case 6: + tensor = getParamValue('tensor', node, tensorMap, context); + context.exitFrame(); + return [2, [tensor]]; + case 7: + input = getParamValue('tensor', node, tensorMap, context); + context.nextIteration(); + return [2, [input]]; + case 8: + size = getParamValue('size', node, tensorMap, context); + dtype = getParamValue('dtype', node, tensorMap, context); + elementShape = getParamValue('elementShape', node, tensorMap, context); + dynamicSize = getParamValue('dynamicSize', node, tensorMap, context); + clearAfterRead = getParamValue('clearAfterRead', node, tensorMap, context); + identicalElementShapes = getParamValue('identicalElementShapes', node, tensorMap, context); + name_1 = getParamValue('name', node, tensorMap, context); + tensorArray = new TensorArray(name_1, dtype, size, elementShape, identicalElementShapes, dynamicSize, clearAfterRead); + context.addTensorArray(tensorArray); + return [2, [tfc.scalar(tensorArray.id), tfc.scalar(1.0)]]; + case 9: + id = getParamValue('tensorArrayId', node, tensorMap, context); + index = getParamValue('index', node, tensorMap, context); + writeTensor = getParamValue('tensor', node, tensorMap, context); + writeTensorArray = context.getTensorArray(id); + writeTensorArray.write(index, writeTensor); + return [2, [tfc.scalar(1.0)]]; + case 10: + readId = getParamValue('tensorArrayId', node, tensorMap, context); + readIndex = getParamValue('index', node, tensorMap, context); + readTensorArray = context.getTensorArray(readId); + return [2, [readTensorArray.read(readIndex)]]; + case 11: + gatherId = getParamValue('tensorArrayId', node, tensorMap, context); + gatherIndices = getParamValue('indices', node, tensorMap, context); + gatherDtype = getParamValue('dtype', node, tensorMap, context); + gatherTensorArray = context.getTensorArray(gatherId); + return [2, [gatherTensorArray.gather(gatherIndices, gatherDtype)]]; + case 12: + scatterId = getParamValue('tensorArrayId', node, tensorMap, context); + scatterIndices = getParamValue('indices', node, tensorMap, context); + scatterTensor = getParamValue('tensor', node, tensorMap, context); + scatterTensorArray = context.getTensorArray(scatterId); + scatterTensorArray.scatter(scatterIndices, scatterTensor); + return [2, [tfc.scalar(1.0)]]; + case 13: + concatId = getParamValue('tensorArrayId', node, tensorMap, context); + concatTensorArray = context.getTensorArray(concatId); + concatDtype = getParamValue('dtype', node, tensorMap, context); + return [2, [concatTensorArray.concat(concatDtype)]]; + case 14: + splitId = getParamValue('tensorArrayId', node, tensorMap, context); + splitTensor = getParamValue('tensor', node, tensorMap, context); + lengths = getParamValue('lengths', node, tensorMap, context); + splitTensorArray = context.getTensorArray(splitId); + splitTensorArray.split(lengths, splitTensor); + return [2, [tfc.scalar(1.0)]]; + case 15: + sizeId = getParamValue('tensorArrayId', node, tensorMap, context); + sizeTensorArray = context.getTensorArray(sizeId); + return [2, [tfc.scalar(sizeTensorArray.size(), 'int32')]]; + case 16: + closeId = getParamValue('tensorArrayId', node, tensorMap, context); + closeTensorArray = context.getTensorArray(closeId); + closeTensorArray.clearAndClose(); + return [2, []]; + case 17: throw TypeError("Node type " + node.op + " is not implemented"); + } + }); + }); + } + + var executeOp$3 = function (node, tensorMap, context) { + switch (node.op) { + case 'conv1d': { + var stride = getParamValue('stride', node, tensorMap, context); + var pad = getParamValue('pad', node, tensorMap, context); + var dataFormat = getParamValue('dataFormat', node, tensorMap, context) + .toUpperCase(); + var dilation = getParamValue('dilation', node, tensorMap, context); + return [tfc.conv1d(getParamValue('x', node, tensorMap, context), getParamValue('filter', node, tensorMap, context), stride, pad, dataFormat, dilation)]; + } + case 'conv2d': { + var stride = getParamValue('strides', node, tensorMap, context); + var pad = getParamValue('pad', node, tensorMap, context); + var dataFormat = getParamValue('dataFormat', node, tensorMap, context) + .toUpperCase(); + var dilations = getParamValue('dilations', node, tensorMap, context); + return [tfc.conv2d(getParamValue('x', node, tensorMap, context), getParamValue('filter', node, tensorMap, context), [stride[1], stride[2]], pad, dataFormat, [dilations[0], dilations[1]])]; + } + case 'conv2dTranspose': { + var shape = getParamValue('outputShape', node, tensorMap, context); + var stride = getParamValue('strides', node, tensorMap, context); + var pad = getParamValue('pad', node, tensorMap, context); + return [tfc.conv2dTranspose(getParamValue('x', node, tensorMap, context), getParamValue('filter', node, tensorMap, context), shape, [stride[1], stride[2]], pad)]; + } + case 'depthwiseConv2d': { + var stride = getParamValue('strides', node, tensorMap, context); + var pad = getParamValue('pad', node, tensorMap, context); + var dilations = getParamValue('dilations', node, tensorMap, context); + var dataFormat = getParamValue('dataFormat', node, tensorMap, context) + .toUpperCase(); + return [tfc.depthwiseConv2d(getParamValue('input', node, tensorMap, context), getParamValue('filter', node, tensorMap, context), [stride[1], stride[2]], pad, dataFormat, [dilations[0], dilations[1]])]; + } + case 'avgPool': { + var stride = getParamValue('strides', node, tensorMap, context); + var pad = getParamValue('pad', node, tensorMap, context); + var kernelSize = getParamValue('kernelSize', node, tensorMap, context); + return [tfc.avgPool(getParamValue('x', node, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad)]; + } + case 'maxPool': { + var stride = getParamValue('strides', node, tensorMap, context); + var pad = getParamValue('pad', node, tensorMap, context); + var kernelSize = getParamValue('kernelSize', node, tensorMap, context); + return [tfc.maxPool(getParamValue('x', node, tensorMap, context), [kernelSize[1], kernelSize[2]], [stride[1], stride[2]], pad)]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$4 = function (node, tensorMap, context) { + switch (node.op) { + case 'fill': { + var shape = getParamValue('shape', node, tensorMap, context); + var value = getParamValue('value', node, tensorMap, context); + return [tfc.fill(shape, value)]; + } + case 'linspace': { + var start = getParamValue('start', node, tensorMap, context); + var stop_1 = getParamValue('stop', node, tensorMap, context); + var num = getParamValue('num', node, tensorMap, context); + return [tfc.linspace(start, stop_1, num)]; + } + case 'oneHot': { + var indices = getParamValue('indices', node, tensorMap, context); + var depth = getParamValue('depth', node, tensorMap, context); + var onValue = getParamValue('onValue', node, tensorMap, context); + var offValue = getParamValue('offValue', node, tensorMap, context); + return [tfc.oneHot(indices, depth, onValue, offValue)]; + } + case 'ones': { + return [tfc.ones(getParamValue('shape', node, tensorMap, context), getParamValue('dtype', node, tensorMap, context))]; + } + case 'onesLike': { + return [tfc.onesLike(getParamValue('x', node, tensorMap, context))]; + } + case 'randomUniform': { + return [tfc.randomUniform(getParamValue('shape', node, tensorMap, context), getParamValue('minval', node, tensorMap, context), getParamValue('maxval', node, tensorMap, context), getParamValue('dtype', node, tensorMap, context))]; + } + case 'range': { + var start = getParamValue('start', node, tensorMap, context); + var stop_2 = getParamValue('stop', node, tensorMap, context); + var step = getParamValue('step', node, tensorMap, context); + return [tfc.range(start, stop_2, step, getParamValue('dtype', node, tensorMap, context))]; + } + case 'truncatedNormal': { + var shape = getParamValue('shape', node, tensorMap, context); + var mean = getParamValue('mean', node, tensorMap, context); + var stdDev = getParamValue('stdDev', node, tensorMap, context); + var seed = getParamValue('seed', node, tensorMap, context); + return [tfc.truncatedNormal(shape, mean, stdDev, getParamValue('dtype', node, tensorMap, context), seed)]; + } + case 'zeros': { + return [tfc.zeros(getParamValue('shape', node, tensorMap, context), getParamValue('dtype', node, tensorMap, context))]; + } + case 'zerosLike': { + return [tfc.zerosLike(getParamValue('x', node, tensorMap, context))]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var _this = undefined; + var executeOp$5 = function (node, tensorMap, context) { return __awaiter(_this, void 0, void 0, function () { + var _a, boxes, scores, maxOutputSize, iouThreshold, scoreThreshold; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = node.op; + switch (_a) { + case 'nonMaxSuppression': return [3, 1]; + case 'whereAsync': return [3, 3]; + } + return [3, 5]; + case 1: + boxes = getParamValue('boxes', node, tensorMap, context); + scores = getParamValue('scores', node, tensorMap, context); + maxOutputSize = getParamValue('maxOutputSize', node, tensorMap, context); + iouThreshold = getParamValue('iouThreshold', node, tensorMap, context); + scoreThreshold = getParamValue('scoreThreshold', node, tensorMap, context); + return [4, tfc.image.nonMaxSuppressionAsync(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold)]; + case 2: return [2, [_b.sent()]]; + case 3: return [4, tfc.whereAsync(getParamValue('condition', node, tensorMap, context))]; + case 4: return [2, [_b.sent()]]; + case 5: throw TypeError("Node type " + node.op + " is not implemented"); + } + }); + }); }; + + var executeOp$6 = function (node, tensorMap, context) { + switch (node.op) { + case 'topK': { + var x = getParamValue('x', node, tensorMap, context); + var k = getParamValue('k', node, tensorMap, context); + var sorted = getParamValue('sorted', node, tensorMap, context); + var result = tfc.topk(x, k, sorted); + return [result.values, result.indices]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$7 = function (node, tensorMap, context) { + switch (node.op) { + case 'const': { + return tensorMap[node.name]; + } + case 'placeholder': + var def = getParamValue('default', node, tensorMap, context); + return [getTensor(node.name, tensorMap, context) || def]; + case 'identity': + case 'stopGradient': + case 'fakeQuantWithMinMaxVars': + return [getParamValue('x', node, tensorMap, context)]; + case 'snapshot': + var snapshot = getParamValue('x', node, tensorMap, context); + return [snapshot.clone()]; + case 'shape': + return [tfc.tensor1d(getParamValue('x', node, tensorMap, context).shape, 'int32')]; + case 'size': + return [tfc.scalar(getParamValue('x', node, tensorMap, context).size, 'int32')]; + case 'rank': + return [tfc.scalar(getParamValue('x', node, tensorMap, context).rank, 'int32')]; + case 'noop': + return []; + case 'print': + var input = getParamValue('x', node, tensorMap, context); + var data = getParamValue('data', node, tensorMap, context); + var message = getParamValue('message', node, tensorMap, context); + var summarize = getParamValue('summarize', node, tensorMap, context); + console.warn('The graph has a tf.print() operation,' + + 'usually used for debugging, which slows down performance.'); + console.log(message); + for (var i = 0; i < data.length; i++) { + console.log(Array.prototype.slice.call(data[0].dataSync()).slice(0, summarize)); + } + return [input]; + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$8 = function (node, tensorMap, context) { + switch (node.op) { + case 'resizeBilinear': { + var images = getParamValue('images', node, tensorMap, context); + var size = getParamValue('size', node, tensorMap, context); + var alignCorners = getParamValue('alignCorners', node, tensorMap, context); + return [tfc.image.resizeBilinear(images, [size[0], size[1]], alignCorners)]; + } + case 'resizeNearestNeighbor': { + var images = getParamValue('images', node, tensorMap, context); + var size = getParamValue('size', node, tensorMap, context); + var alignCorners = getParamValue('alignCorners', node, tensorMap, context); + return [tfc.image.resizeNearestNeighbor(images, [size[0], size[1]], alignCorners)]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$9 = function (node, tensorMap, context) { + switch (node.op) { + case 'equal': { + return [tfc.equal(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'notEqual': { + return [tfc.notEqual(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'greater': { + return [tfc.greater(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'greaterEqual': { + return [tfc.greaterEqual(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'less': { + return [tfc.less(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'lessEqual': { + return [tfc.lessEqual(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'logicalAnd': { + return [tfc.logicalAnd(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'logicalNot': { + return [tfc.logicalNot(getParamValue('a', node, tensorMap, context))]; + } + case 'logicalOr': { + return [tfc.logicalOr(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + case 'where': { + return [tfc.where(getParamValue('condition', node, tensorMap, context), getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context))]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$10 = function (node, tensorMap, context) { + switch (node.op) { + case 'matMul': + return [tfc.matMul(getParamValue('a', node, tensorMap, context), getParamValue('b', node, tensorMap, context), getParamValue('transposeA', node, tensorMap, context), getParamValue('transposeB', node, tensorMap, context))]; + case 'transpose': + return [tfc.transpose(getParamValue('x', node, tensorMap, context), getParamValue('perm', node, tensorMap, context))]; + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$11 = function (node, tensorMap, context) { + switch (node.op) { + case 'batchNormalization': { + return [tfc.batchNormalization(getParamValue('x', node, tensorMap, context), getParamValue('mean', node, tensorMap, context), getParamValue('variance', node, tensorMap, context), getParamValue('epsilon', node, tensorMap, context), getParamValue('scale', node, tensorMap, context), getParamValue('offset', node, tensorMap, context))]; + } + case 'localResponseNormalization': { + return [tfc.localResponseNormalization(getParamValue('x', node, tensorMap, context), getParamValue('radius', node, tensorMap, context), getParamValue('bias', node, tensorMap, context), getParamValue('alpha', node, tensorMap, context), getParamValue('beta', node, tensorMap, context))]; + } + case 'softmax': { + return [tfc.softmax(getParamValue('x', node, tensorMap, context))]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$12 = function (node, tensorMap, context) { + switch (node.op) { + case 'max': { + var axis = getParamValue('axis', node, tensorMap, context); + var keepDims = getParamValue('keepDims', node, tensorMap, context); + return [tfc.max(getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'mean': { + var axis = getParamValue('axis', node, tensorMap, context); + var keepDims = getParamValue('keepDims', node, tensorMap, context); + return [tfc.mean(getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'min': { + var axis = getParamValue('axis', node, tensorMap, context); + var keepDims = getParamValue('keepDims', node, tensorMap, context); + return [tfc.min(getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'sum': { + var axis = getParamValue('axis', node, tensorMap, context); + var keepDims = getParamValue('keepDims', node, tensorMap, context); + return [tfc.sum(getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'all': { + var axis = getParamValue('axis', node, tensorMap, context); + var keepDims = getParamValue('keepDims', node, tensorMap, context); + return [tfc.all(getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'any': { + var axis = getParamValue('axis', node, tensorMap, context); + var keepDims = getParamValue('keepDims', node, tensorMap, context); + return [tfc.any(getParamValue('x', node, tensorMap, context), axis, keepDims)]; + } + case 'argMax': { + var axis = getParamValue('axis', node, tensorMap, context); + return [tfc.argMax(getParamValue('x', node, tensorMap, context), axis)]; + } + case 'argMin': { + var axis = getParamValue('axis', node, tensorMap, context); + return [tfc.argMin(getParamValue('x', node, tensorMap, context), axis)]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$13 = function (node, tensorMap, context) { + switch (node.op) { + case 'concat': { + var axis = getParamValue('axis', node, tensorMap, context); + var inputs = getParamValue('tensors', node, tensorMap, context); + return [tfc.concat(inputs, axis)]; + } + case 'gather': { + var axis = getParamValue('axis', node, tensorMap, context); + var input = getParamValue('x', node, tensorMap, context); + var indices = getParamValue('indices', node, tensorMap, context); + return [tfc.gather(input, indices, axis)]; + } + case 'reverse': { + var axis = getParamValue('axis', node, tensorMap, context); + var input = getParamValue('x', node, tensorMap, context); + return [tfc.reverse(input, axis)]; + } + case 'slice': { + var begin = getParamValue('begin', node, tensorMap, context); + var size = getParamValue('size', node, tensorMap, context); + return [tfc.slice(getParamValue('x', node, tensorMap, context), begin, size)]; + } + case 'stridedSlice': { + var begin = getParamValue('begin', node, tensorMap, context); + var end = getParamValue('end', node, tensorMap, context); + var strides = getParamValue('strides', node, tensorMap, context); + var beginMask = getParamValue('beginMask', node, tensorMap, context); + var endMask = getParamValue('endMask', node, tensorMap, context); + var tensor = getParamValue('x', node, tensorMap, context); + if (begin.length === 1 && tensor.shape.length > 1) { + for (var i = 1; i < tensor.shape.length; i++) { + begin.push(0); + end.push(tensor.shape[i]); + strides.push(strides[0]); + } + } + return [tfc.stridedSlice(tensor, begin, end, strides, beginMask, endMask)]; + } + case 'stack': { + return tfc.tidy(function () { + var axis = getParamValue('axis', node, tensorMap, context); + var tensors = getParamValue('tensors', node, tensorMap, context); + var shape = tensors[0].shape; + var squeezedShape = tensors[0].squeeze().shape; + var mapped = tensors.map(function (tensor) { + var sameShape = tfc.util.arraysEqual(tensor.shape, shape); + if (!sameShape && + !tfc.util.arraysEqual(tensor.squeeze().shape, squeezedShape)) { + throw new Error('the input tensors shape does not match'); + } + return sameShape ? tensor : tensor.reshape(shape); + }); + return [tfc.stack(mapped, axis)]; + }); + } + case 'unstack': { + return tfc.tidy(function () { + var axis = getParamValue('axis', node, tensorMap, context); + var tensor = getParamValue('tensor', node, tensorMap, context); + return tfc.unstack(tensor, axis); + }); + } + case 'tile': { + var reps = getParamValue('reps', node, tensorMap, context); + return [tfc.tile(getParamValue('x', node, tensorMap, context), reps)]; + } + case 'split': { + var axis = getParamValue('axis', node, tensorMap, context); + var numOrSizeSplits = getParamValue('numOrSizeSplits', node, tensorMap, context); + return tfc.split(getParamValue('x', node, tensorMap, context), numOrSizeSplits, axis); + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + var executeOp$14 = function (node, tensorMap, context) { + switch (node.op) { + case 'cast': { + return [tfc.cast(getParamValue('x', node, tensorMap, context), getParamValue('dtype', node, tensorMap, context))]; + } + case 'expandDims': { + var axis = node.params['axis'].value; + return [tfc.expandDims(getParamValue('x', node, tensorMap, context), axis)]; + } + case 'squeeze': { + var axis = node.params['axis'].value; + return [tfc.squeeze(getParamValue('x', node, tensorMap, context), axis)]; + } + case 'reshape': { + return [tfc.reshape(getParamValue('x', node, tensorMap, context), getParamValue('shape', node, tensorMap, context))]; + } + case 'pad': { + return [tfc.pad(getParamValue('x', node, tensorMap, context), split(getParamValue('padding', node, tensorMap, context), 2), getParamValue('constantValue', node, tensorMap, context))]; + } + case 'spaceToBatchND': { + var blockShape = getParamValue('blockShape', node, tensorMap, context); + var paddings = split(getParamValue('paddings', node, tensorMap, context), 2); + return [tfc.spaceToBatchND(getParamValue('x', node, tensorMap, context), blockShape, paddings)]; + } + case 'batchToSpaceND': { + var blockShape = getParamValue('blockShape', node, tensorMap, context); + var crops = split(getParamValue('crops', node, tensorMap, context), 2); + return [tfc.batchToSpaceND(getParamValue('x', node, tensorMap, context), blockShape, crops)]; + } + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + }; + + function executeOp$15(node, tensorMap, context) { + switch (node.category) { + case 'arithmetic': + return executeOp(node, tensorMap, context); + case 'basic_math': + return executeOp$1(node, tensorMap, context); + case 'control': + return executeOp$2(node, tensorMap, context); + case 'convolution': + return executeOp$3(node, tensorMap, context); + case 'creation': + return executeOp$4(node, tensorMap, context); + case 'dynamic': + return executeOp$5(node, tensorMap, context); + case 'evaluation': + return executeOp$6(node, tensorMap, context); + case 'image': + return executeOp$8(node, tensorMap, context); + case 'graph': + return executeOp$7(node, tensorMap, context); + case 'logical': + return executeOp$9(node, tensorMap, context); + case 'matrices': + return executeOp$10(node, tensorMap, context); + case 'normalization': + return executeOp$11(node, tensorMap, context); + case 'reduction': + return executeOp$12(node, tensorMap, context); + case 'slice_join': + return executeOp$13(node, tensorMap, context); + case 'transformation': + return executeOp$14(node, tensorMap, context); + default: + throw TypeError("Node type " + node.op + " is not implemented"); + } + } + + var ExecutionContext = (function () { + function ExecutionContext(weightMap, tensorArrayMap) { + this.weightMap = weightMap; + this.tensorArrayMap = tensorArrayMap; + this.rootContext = { id: 0, frameName: '', iterationId: 0 }; + this.contexts = [this.rootContext]; + this.lastId = 0; + this.generateCurrentContextIds(); + } + ExecutionContext.prototype.newFrame = function (id, frameName) { + return { id: id, frameName: frameName, iterationId: 0 }; + }; + Object.defineProperty(ExecutionContext.prototype, "currentContext", { + get: function () { + return this.contexts; + }, + set: function (contexts) { + if (this.contexts !== contexts) { + this.contexts = contexts; + this.generateCurrentContextIds(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ExecutionContext.prototype, "currentContextId", { + get: function () { + return this._currentContextIds[0]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ExecutionContext.prototype, "currentContextIds", { + get: function () { + return this._currentContextIds; + }, + enumerable: true, + configurable: true + }); + ExecutionContext.prototype.generateCurrentContextIds = function () { + var names = []; + for (var i = 0; i < this.contexts.length - 1; i++) { + var contexts = this.contexts.slice(0, this.contexts.length - i); + names.push(this.contextIdforContexts(contexts)); + } + names.push(''); + this._currentContextIds = names; + }; + ExecutionContext.prototype.contextIdforContexts = function (contexts) { + return contexts ? + contexts + .map(function (context) { return (context.id === 0 && context.iterationId === 0) ? + '' : + context.frameName + "-" + context.iterationId; }) + .join('/') : + ''; + }; + ExecutionContext.prototype.enterFrame = function (frameId) { + if (this.contexts) { + this.lastId++; + this.contexts = this.contexts.slice(); + this.contexts.push(this.newFrame(this.lastId, frameId)); + this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)); + } + }; + ExecutionContext.prototype.exitFrame = function () { + if (this.contexts && this.contexts.length > 1) { + this.contexts = this.contexts.slice(); + this.contexts.splice(-1); + this.currentContextIds.shift(); + } + else { + throw new Error('Cannot exit frame, the context is empty'); + } + }; + ExecutionContext.prototype.nextIteration = function () { + if (this.contexts && this.contexts.length > 0) { + this.contexts = this.contexts.slice(); + this.lastId++; + var context = Object.assign({}, this.contexts[this.contexts.length - 1]); + context.iterationId += 1; + context.id = this.lastId; + this.contexts.splice(-1, 1, context); + this._currentContextIds.splice(0, 1, this.contextIdforContexts(this.contexts)); + } + else { + throw new Error('Cannot increase frame iteration, the context is empty'); + } + }; + ExecutionContext.prototype.getWeight = function (name) { + return this.weightMap[name]; + }; + ExecutionContext.prototype.addTensorArray = function (tensorArray) { + this.tensorArrayMap[tensorArray.id] = tensorArray; + }; + ExecutionContext.prototype.getTensorArray = function (id) { + return this.tensorArrayMap[id]; + }; + return ExecutionContext; + }()); + + var GraphExecutor = (function () { + function GraphExecutor(graph) { + this.graph = graph; + this.compiledOrder = []; + this._weightMap = {}; + this.placeholders = graph.placeholders; + this._outputs = graph.outputs; + this.compile(); + } + Object.defineProperty(GraphExecutor.prototype, "weightMap", { + get: function () { + return this._weightMap; + }, + set: function (weightMap) { + var weightIds = Object.keys(weightMap).map(function (key) { return weightMap[key].map(function (tensor) { return tensor.id; }); }); + this.weightIds = [].concat.apply([], weightIds); + this._weightMap = weightMap; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "inputs", { + get: function () { + return this.placeholders.map(function (node) { + return { + name: node.name, + shape: node.params['shape'] ? node.params['shape'].value : + undefined, + dtype: node.params['dtype'] ? node.params['dtype'].value : + undefined + }; + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "outputs", { + get: function () { + return this._outputs.map(function (node) { + return { + name: node.name, + shape: node.params['shape'] ? node.params['shape'].value : + undefined, + dtype: node.params['dtype'] ? node.params['dtype'].value : + undefined + }; + }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "inputNodes", { + get: function () { + return this.placeholders.map(function (node) { return node.name; }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "outputNodes", { + get: function () { + return this.outputs.map(function (node) { return node.name; }); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "isControlFlowModel", { + get: function () { + return this.graph.withControlFlow; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GraphExecutor.prototype, "isDynamicShapeModel", { + get: function () { + return this.graph.withDynamicShape; + }, + enumerable: true, + configurable: true + }); + GraphExecutor.prototype.compile = function () { + if (this.graph.withControlFlow || this.graph.withDynamicShape) { + return; + } + var stack = this.graph.inputs.slice(); + var visited = {}; + while (stack.length > 0) { + var node = stack.pop(); + visited[node.name] = true; + this.compiledOrder.push(node); + node.children.forEach(function (childNode) { + if (!visited[childNode.name] && childNode.inputNames.every(function (name) { + var nodeName = getNodeNameAndIndex(name)[0]; + return visited[nodeName]; + })) { + stack.push(childNode); + } + }); + } + }; + GraphExecutor.prototype.execute = function (inputs, outputs) { + var _this = this; + this.checkInput(inputs); + this.checkInputShapeAndType(inputs); + var tensorArrayMap = {}; + var result = tfc.tidy(function () { + var context = new ExecutionContext(_this._weightMap, tensorArrayMap); + var tensors = _this.compiledOrder.reduce(function (map, node) { + map[node.name] = executeOp$15(node, map, context); + return map; + }, __assign({}, _this.weightMap, inputs)); + return _this.findOutputs(tensors, context, outputs); + }); + return result; + }; + GraphExecutor.prototype.executeAsync = function (inputs, outputs) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var tensorArrayMap, context, tensors, results, outputIds, inputIdArray, inputIds; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.checkInput(inputs); + this.checkInputShapeAndType(inputs); + tensorArrayMap = {}; + context = new ExecutionContext(this._weightMap, tensorArrayMap); + return [4, this.executeWithControlFlow(inputs, context)]; + case 1: + tensors = _a.sent(); + results = this.findOutputs(tensors, context, outputs); + outputIds = Object.keys(results).map(function (key) { return results[key].id; }); + inputIdArray = Object.keys(inputs).map(function (key) { return inputs[key].map(function (input) { return input.id; }); }); + inputIds = [].concat.apply([], inputIdArray); + Object.keys(tensors).forEach(function (key) { + var tensorArray = tensors[key]; + tensorArray.forEach(function (tensor) { + if (tensor && outputIds.indexOf(tensor.id) === -1 && + inputIds.indexOf(tensor.id) === -1 && + _this.weightIds.indexOf(tensor.id) === -1) { + tensor.dispose(); + } + }); + }); + return [2, results]; + } + }); + }); + }; + GraphExecutor.prototype.executeWithControlFlow = function (inputs, context) { + return __awaiter(this, void 0, void 0, function () { + var stack, tensorMap, added, item, nodeName, tensors, _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + stack = this.graph.inputs.map(function (node) { + return { node: node, contexts: context.currentContext }; + }); + tensorMap = __assign({}, this.weightMap, inputs); + added = {}; + _c.label = 1; + case 1: + if (!(stack.length > 0)) return [3, 3]; + item = stack.pop(); + context.currentContext = item.contexts; + nodeName = ''; + if (item.node.op === 'enter' && + getParamValue('isConstant', item.node, tensorMap, context)) { + nodeName = getNodeNameAndIndex(item.node.name, context)[0]; + } + tensors = executeOp$15(item.node, tensorMap, context); + if (!nodeName) { + nodeName = getNodeNameAndIndex(item.node.name, context)[0]; + } + _a = tensorMap; + _b = nodeName; + return [4, tensors]; + case 2: + _a[_b] = _c.sent(); + item.node.children.forEach(function (childNode) { + var nodeName = getNodeNameAndIndex(childNode.name, context)[0]; + if (!added[nodeName]) { + if (childNode.op === 'merge') { + if (childNode.inputNames.some(function (name) { + return !!getTensor(name, tensorMap, context); + })) { + added[nodeName] = true; + stack.push({ contexts: context.currentContext, node: childNode }); + } + } + else if (childNode.inputNames.every(function (name) { + return !!getTensor(name, tensorMap, context); + })) { + added[nodeName] = true; + stack.push({ contexts: context.currentContext, node: childNode }); + } + } + }); + return [3, 1]; + case 3: return [2, tensorMap]; + } + }); + }); + }; + GraphExecutor.prototype.findOutputs = function (tensorMap, context, outputs) { + if (outputs && !(outputs instanceof Array)) { + outputs = [outputs]; + } + var requestedOutputs = (outputs || this.graph.outputs.map(function (node) { return node.name; })); + return requestedOutputs.reduce(function (map, name) { + map[name] = getTensor(name, tensorMap, context); + return map; + }, {}); + }; + GraphExecutor.prototype.dispose = function () { + var _this = this; + Object.keys(this.weightMap) + .forEach(function (key) { return _this.weightMap[key].forEach(function (tensor) { return tensor.dispose(); }); }); + }; + GraphExecutor.prototype.checkInputShapeAndType = function (inputs) { + this.placeholders.forEach(function (node) { + var input = inputs[node.name][0]; + if (node.params['shape'] && node.params['shape'].value) { + var shape_1 = node.params['shape'].value; + var match = shape_1.length === input.shape.length && + input.shape.every(function (dim, index) { return shape_1[index] === -1 || shape_1[index] === dim; }); + tfc.util.assert(match, "The shape of dict['" + node.name + "'] provided in model.execute(dict) must be [" + shape_1 + "], but was [" + input.shape + "]"); + } + if (node.params['dtype'] && node.params['dtype'].value) { + tfc.util.assert(input.dtype === node.params['dtype'].value, "The dtype of dict['" + node.name + "'] provided in model.execute(dict) must be " + node.params['dtype'].value + ", but was " + input.dtype); + } + }); + }; + GraphExecutor.prototype.checkInput = function (inputs) { + var _this = this; + var inputKeys = Object.keys(inputs); + var missing = []; + var extra = []; + this.inputNodes.forEach(function (name) { + if (inputKeys.indexOf(name) === -1) + missing.push(name); + }); + inputKeys.forEach(function (name) { + if (_this.inputNodes.indexOf(name) === -1) + extra.push(name); + }); + if (missing.length > 0) { + throw new Error("The dict provided in model.execute(dict) has the keys " + + ("[" + inputKeys + "], but is missing the required keys: [" + missing + "].")); + } + if (extra.length > 0) { + throw new Error("The dict provided in model.execute(dict) has " + + ("unused keys: [" + extra + "]. Please provide only the following keys: ") + + ("[" + this.inputNodes + "].")); + } + }; + return GraphExecutor; + }()); + + var FrozenModel = (function () { + function FrozenModel(modelUrl, weightManifestUrl, requestOption) { + this.modelUrl = modelUrl; + this.weightManifestUrl = weightManifestUrl; + this.requestOption = requestOption; + this.version = 'n/a'; + this.pathPrefix = this.getPathPrefix(); + } + Object.defineProperty(FrozenModel.prototype, "modelVersion", { + get: function () { + return this.version; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "inputNodes", { + get: function () { + return this.executor.inputNodes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "outputNodes", { + get: function () { + return this.executor.outputNodes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "inputs", { + get: function () { + return this.executor.inputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "outputs", { + get: function () { + return this.executor.outputs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FrozenModel.prototype, "weights", { + get: function () { + return this.executor.weightMap; + }, + enumerable: true, + configurable: true + }); + FrozenModel.prototype.getPathPrefix = function () { + var url$$1 = parse(this.weightManifestUrl); + var segments = url$$1.pathname.split('/'); + segments.splice(-1); + url$$1.pathname = segments.join('/'); + return format(url$$1) + '/'; + }; + FrozenModel.prototype.loadRemoteProtoFile = function () { + return __awaiter(this, void 0, void 0, function () { + var response, _a, _b, _c, error_1; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + _d.trys.push([0, 3, , 4]); + return [4, fetch(this.modelUrl, this.requestOption)]; + case 1: + response = _d.sent(); + _b = (_a = compiled_api_1.GraphDef).decode; + _c = Uint8Array.bind; + return [4, response.arrayBuffer()]; + case 2: return [2, _b.apply(_a, [new (_c.apply(Uint8Array, [void 0, _d.sent()]))()])]; + case 3: + error_1 = _d.sent(); + throw new Error(this.modelUrl + " not found. " + error_1); + case 4: return [2]; + } + }); + }); + }; + FrozenModel.prototype.loadWeightManifest = function () { + return __awaiter(this, void 0, void 0, function () { + var manifest, _a, error_2; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 3, , 4]); + return [4, fetch(this.weightManifestUrl, this.requestOption)]; + case 1: + manifest = _b.sent(); + _a = this; + return [4, manifest.clone().json()]; + case 2: + _a.weightManifest = _b.sent(); + return [3, 4]; + case 3: + error_2 = _b.sent(); + throw new Error(this.weightManifestUrl + " not found. " + error_2); + case 4: return [2]; + } + }); + }); + }; + FrozenModel.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var graphPromise, manifestPromise, graph, weightMap; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + graphPromise = this.loadRemoteProtoFile(); + manifestPromise = this.loadWeightManifest(); + return [4, Promise.all([graphPromise, manifestPromise])]; + case 1: + graph = (_a.sent())[0]; + this.version = graph.versions.producer + "." + graph.versions.minConsumer; + return [4, tfc.io.loadWeights(this.weightManifest, this.pathPrefix, undefined, this.requestOption)]; + case 2: + weightMap = _a.sent(); + this.executor = + new GraphExecutor(OperationMapper.Instance.transformGraph(graph)); + this.executor.weightMap = this.convertTensorMapToTensorsMap(weightMap); + return [2, true]; + } + }); + }); + }; + FrozenModel.prototype.predict = function (inputs, config) { + return this.execute(inputs, this.outputNodes); + }; + FrozenModel.prototype.constructTensorMap = function (inputs) { + var inputArray = inputs instanceof tfc.Tensor ? [inputs] : inputs; + if (inputArray.length !== this.inputNodes.length) { + throw new Error('Input tensor count mismatch,' + + ("the frozen model has " + this.inputNodes.length + " placeholders, ") + + ("while there are " + inputArray.length + " input tensors.")); + } + return this.inputNodes.reduce(function (map, inputName, i) { + map[inputName] = inputArray[i]; + return map; + }, {}); + }; + FrozenModel.prototype.execute = function (inputs, outputs) { + outputs = outputs || this.outputNodes; + if (inputs instanceof tfc.Tensor || Array.isArray(inputs)) { + inputs = this.constructTensorMap(inputs); + } + if (this.executor.isControlFlowModel || this.executor.isDynamicShapeModel) { + throw new Error('The model contains control flow or dynamic shape ops, ' + + 'please use executeAsync method'); + } + var result = this.executor.execute(this.convertTensorMapToTensorsMap(inputs), outputs); + var keys = Object.keys(result); + return (Array.isArray(outputs) && outputs.length > 1) ? + outputs.map(function (node) { return result[node]; }) : + result[keys[0]]; + }; + FrozenModel.prototype.executeAsync = function (inputs, outputs) { + return __awaiter(this, void 0, void 0, function () { + var result, keys; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.executor.isControlFlowModel && + this.executor.isDynamicShapeModel)) { + throw new Error('The model does not contain control flow or dynamic shape ops, ' + + 'please use execute method for better performance.'); + } + outputs = outputs || this.outputNodes; + if (inputs instanceof tfc.Tensor || Array.isArray(inputs)) { + inputs = this.constructTensorMap(inputs); + } + return [4, this.executor.executeAsync(this.convertTensorMapToTensorsMap(inputs), outputs)]; + case 1: + result = _a.sent(); + keys = Object.keys(result); + return [2, Array.isArray(outputs) && outputs.length > 1 ? + outputs.map(function (node) { return result[node]; }) : + result[keys[0]]]; + } + }); + }); + }; + FrozenModel.prototype.convertTensorMapToTensorsMap = function (map) { + return Object.keys(map).reduce(function (newMap, key) { + newMap[key] = [map[key]]; + return newMap; + }, {}); + }; + FrozenModel.prototype.dispose = function () { + this.executor.dispose(); + }; + return FrozenModel; + }()); + function loadFrozenModel(modelUrl, weightsManifestUrl, requestOption) { + return __awaiter(this, void 0, void 0, function () { + var model; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + model = new FrozenModel(modelUrl, weightsManifestUrl, requestOption); + return [4, model.load()]; + case 1: + _a.sent(); + return [2, model]; + } + }); + }); + } + + var version = '0.5.5'; + + exports.FrozenModel = FrozenModel; + exports.loadFrozenModel = loadFrozenModel; + exports.version_converter = version; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.min.js b/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.min.js new file mode 100644 index 0000000..41e538f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.min.js @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tensorflow/tfjs-core")):"function"==typeof define&&define.amd?define(["exports","@tensorflow/tfjs-core"],t):t(e.tf=e.tf||{},e.tf)}(this,function(exports,tfc){"use strict";var __assign=Object.assign||function(e){for(var t,a=1,r=arguments.length;a0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=u-l,v=Math.floor,I=String.fromCharCode;function O(e){throw RangeError(b[e])}function w(e,t){for(var a=e.length,r=[];a--;)r[a]=t(e[a]);return r}function V(e,t){var a=e.split("@"),r="";return a.length>1&&(r=a[0]+"@",e=a[1]),r+w((e=e.replace(P,".")).split("."),t).join(".")}function T(e){for(var t,a,r=[],n=0,o=e.length;n=55296&&t<=56319&&n65535&&(t+=I((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=I(e)}).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,a){var r=0;for(e=a?v(e/f):e>>1,e+=v(e/t);e>x*m>>1;r+=u)e=v(e/x);return v(r+(x+1)*e/(e+d))}function $(e){var t,a,r,n,o,s,i,d,f,g,N,P=[],b=e.length,x=0,I=h,w=c;for((a=e.lastIndexOf(y))<0&&(a=0),r=0;r=128&&O("not-basic"),P.push(e.charCodeAt(r));for(n=a>0?a+1:0;n=b&&O("invalid-input"),((d=(N=e.charCodeAt(n++))-48<10?N-22:N-65<26?N-65:N-97<26?N-97:u)>=u||d>v((p-x)/s))&&O("overflow"),x+=d*s,!(d<(f=i<=w?l:i>=w+m?m:i-w));i+=u)s>v(p/(g=u-f))&&O("overflow"),s*=g;w=A(x-o,t=P.length+1,0==o),v(x/t)>p-I&&O("overflow"),I+=v(x/t),x%=t,P.splice(x++,0,I)}return k(P)}function S(e){var t,a,r,n,o,s,i,d,f,g,N,P,b,x,w,V=[];for(P=(e=T(e)).length,t=h,a=0,o=c,s=0;s=t&&Nv((p-a)/(b=r+1))&&O("overflow"),a+=(i-t)*b,t=i,s=0;sp&&O("overflow"),N==t){for(d=a,f=u;!(d<(g=f<=o?l:f>=o+m?m:f-o));f+=u)w=d-g,x=u-g,V.push(I(_(g+w%x,0))),d=v(w/x);V.push(I(_(d,0))),o=A(a,b,r==n),a=0,++r}++a,++t}return V.join("")}if(s={version:"1.3.2",ucs2:{decode:T,encode:k},decode:$,encode:S,toASCII:function(e){return V(e,function(e){return N.test(e)?"xn--"+S(e):e})},toUnicode:function(e){return V(e,function(e){return g.test(e)?$(e.slice(4).toLowerCase()):e})}},r&&n)if(e.exports==r)n.exports=s;else for(i in s)s.hasOwnProperty(i)&&(r[i]=s[i]);else a.punycode=s}(commonjsGlobal)}),util={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var decode=function(e,t,a,r){t=t||"&",a=a||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var i=e.length;s>0&&i>s&&(i=s);for(var p=0;p=0?(u=f.substr(0,c),l=f.substr(c+1)):(u=f,l=""),m=decodeURIComponent(u),d=decodeURIComponent(l),hasOwnProperty(n,m)?Array.isArray(n[m])?n[m].push(d):n[m]=[n[m],d]:n[m]=d}return n},stringifyPrimitive=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},encode=function(e,t,a,r){return t=t||"&",a=a||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(r){var n=encodeURIComponent(stringifyPrimitive(r))+a;return Array.isArray(e[r])?e[r].map(function(e){return n+encodeURIComponent(stringifyPrimitive(e))}).join(t):n+encodeURIComponent(stringifyPrimitive(e[r]))}).join(t):r?encodeURIComponent(stringifyPrimitive(r))+a+encodeURIComponent(stringifyPrimitive(e)):""},querystring=createCommonjsModule(function(e,t){t.decode=t.parse=decode,t.encode=t.stringify=encode}),querystring_1=querystring.decode,querystring_2=querystring.parse,querystring_3=querystring.encode,querystring_4=querystring.stringify,parse=urlParse,format=urlFormat;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function urlParse(e,t,a){if(e&&util.isObject(e)&&e instanceof Url)return e;var r=new Url;return r.parse(e,t,a),r}function urlFormat(e){return util.isString(e)&&(e=urlParse(e)),e instanceof Url?e.format():Url.prototype.format.call(e)}Url.prototype.parse=function(e,t,a){if(!util.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),n=-1!==r&&r127?b+="x":b+=P[x];if(!b.match(hostnamePartPattern)){var I=g.slice(0,c),O=g.slice(c+1),w=P.match(hostnamePartStart);w&&(I.push(w[1]),O.unshift(w[2])),O.length&&(s="/"+O.join(".")+s),this.hostname=I.join(".");break}}}this.hostname.length>hostnameMaxLen?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=punycode.toASCII(this.hostname));var V=this.port?":"+this.port:"",T=this.hostname||"";this.host=T+V,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!unsafeProtocol[u])for(c=0,N=autoEscape.length;c0)&&a.host.split("@"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift());return a.search=e.search,a.query=e.query,util.isNull(a.pathname)&&util.isNull(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.href=a.format(),a}if(!P.length)return a.pathname=null,a.search?a.path="/"+a.search:a.path=null,a.href=a.format(),a;for(var x=P.slice(-1)[0],v=(a.host||e.host||P.length>1)&&("."===x||".."===x)||""===x,I=0,O=P.length;O>=0;O--)"."===(x=P[O])?P.splice(O,1):".."===x?(P.splice(O,1),I++):I&&(P.splice(O,1),I--);if(!g&&!N)for(;I--;I)P.unshift("..");!g||""===P[0]||P[0]&&"/"===P[0].charAt(0)||P.unshift(""),v&&"/"!==P.join("/").substr(-1)&&P.push("");var w,V=""===P[0]||P[0]&&"/"===P[0].charAt(0);b&&(a.hostname=a.host=V?"":P.length?P.shift():"",(w=!!(a.host&&a.host.indexOf("@")>0)&&a.host.split("@"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift()));return(g=g||a.host&&P.length)&&!V&&P.unshift(""),P.length?a.pathname=P.join("/"):(a.pathname=null,a.path=null),util.isNull(a.pathname)&&util.isNull(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.auth=e.auth||a.auth,a.slashes=a.slashes||e.slashes,a.href=a.format(),a},Url.prototype.parseHost=function(){var e=this.host,t=portPattern.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var aspromise=asPromise;function asPromise(e,t){for(var a=new Array(arguments.length-1),r=0,n=2,o=!0;n1&&"="===e.charAt(t);)++a;return Math.ceil(3*e.length)/4-a};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;a.encode=function(e,t,a){for(var n,o=null,s=[],i=0,p=0;t>2],n=(3&u)<<4,p=1;break;case 1:s[i++]=r[n|u>>4],n=(15&u)<<2,p=2;break;case 2:s[i++]=r[n|u>>6],s[i++]=r[63&u],p=0}i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),i=0)}return p&&(s[i++]=r[n],s[i++]=61,1===p&&(s[i++]=61)),o?(i&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join("")):String.fromCharCode.apply(String,s.slice(0,i))};a.decode=function(e,t,a){for(var r,o=a,s=0,i=0;i1)break;if(void 0===(p=n[p]))throw Error("invalid encoding");switch(s){case 0:r=p,s=1;break;case 1:t[a++]=r<<2|(48&p)>>4,r=p,s=2;break;case 2:t[a++]=(15&r)<<4|(60&p)>>2,r=p,s=3;break;case 3:t[a++]=(3&r)<<6|p,s=0}}if(1===s)throw Error("invalid encoding");return a-o},a.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}),eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(e,t,a){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:a||this}),this},EventEmitter.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var a=this._listeners[e],r=0;r0?0:2147483648,a,r);else if(isNaN(t))e(2143289344,a,r);else if(t>3.4028234663852886e38)e((n<<31|2139095040)>>>0,a,r);else if(t<1.1754943508222875e-38)e((n<<31|Math.round(t/1.401298464324817e-45))>>>0,a,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((n<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,a,r)}}function a(e,t,a){var r=e(t,a),n=2*(r>>31)+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:n*(1/0):0===o?1.401298464324817e-45*n*s:n*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,writeUintLE),e.writeFloatBE=t.bind(null,writeUintBE),e.readFloatLE=a.bind(null,readUintLE),e.readFloatBE=a.bind(null,readUintBE)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),a=new Uint8Array(t.buffer),r=128===a[7];function n(e,r,n){t[0]=e,r[n]=a[0],r[n+1]=a[1],r[n+2]=a[2],r[n+3]=a[3],r[n+4]=a[4],r[n+5]=a[5],r[n+6]=a[6],r[n+7]=a[7]}function o(e,r,n){t[0]=e,r[n]=a[7],r[n+1]=a[6],r[n+2]=a[5],r[n+3]=a[4],r[n+4]=a[3],r[n+5]=a[2],r[n+6]=a[1],r[n+7]=a[0]}function s(e,r){return a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],t[0]}function i(e,r){return a[7]=e[r],a[6]=e[r+1],a[5]=e[r+2],a[4]=e[r+3],a[3]=e[r+4],a[2]=e[r+5],a[1]=e[r+6],a[0]=e[r+7],t[0]}e.writeDoubleLE=r?n:o,e.writeDoubleBE=r?o:n,e.readDoubleLE=r?s:i,e.readDoubleBE=r?i:s}():function(){function t(e,t,a,r,n,o){var s=r<0?1:0;if(s&&(r=-r),0===r)e(0,n,o+t),e(1/r>0?0:2147483648,n,o+a);else if(isNaN(r))e(0,n,o+t),e(2146959360,n,o+a);else if(r>1.7976931348623157e308)e(0,n,o+t),e((s<<31|2146435072)>>>0,n,o+a);else{var i;if(r<2.2250738585072014e-308)e((i=r/5e-324)>>>0,n,o+t),e((s<<31|i/4294967296)>>>0,n,o+a);else{var p=Math.floor(Math.log(r)/Math.LN2);1024===p&&(p=1023),e(4503599627370496*(i=r*Math.pow(2,-p))>>>0,n,o+t),e((s<<31|p+1023<<20|1048576*i&1048575)>>>0,n,o+a)}}}function a(e,t,a,r,n){var o=e(r,n+t),s=e(r,n+a),i=2*(s>>31)+1,p=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===p?u?NaN:i*(1/0):0===p?5e-324*i*u:i*Math.pow(2,p-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,writeUintLE,0,4),e.writeDoubleBE=t.bind(null,writeUintBE,4,0),e.readDoubleLE=a.bind(null,readUintLE,0,4),e.readDoubleBE=a.bind(null,readUintBE,4,0)}(),e}function writeUintLE(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}function writeUintBE(e,t,a){t[a]=e>>>24,t[a+1]=e>>>16&255,t[a+2]=e>>>8&255,t[a+3]=255&e}function readUintLE(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function readUintBE(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}var utf8_1=createCommonjsModule(function(e,t){var a=t;a.length=function(e){for(var t=0,a=0,r=0;r191&&r<224?o[s++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(r>>10),o[s++]=56320+(1023&r)):o[s++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join("")):String.fromCharCode.apply(String,o.slice(0,s))},a.write=function(e,t,a){for(var r,n,o=a,s=0;s>6|192,t[a++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&n),++s,t[a++]=r>>18|240,t[a++]=r>>12&63|128,t[a++]=r>>6&63|128,t[a++]=63&r|128):(t[a++]=r>>12|224,t[a++]=r>>6&63|128,t[a++]=63&r|128);return a-o}}),pool_1=pool;function pool(e,t,a){var r=a||8192,n=r>>>1,o=null,s=r;return function(a){if(a<1||a>n)return e(a);s+a>r&&(o=e(r),s=0);var i=t.call(o,s,s+=a);return 7&s&&(s=1+(7|s)),i}}var longbits=LongBits;function LongBits(e,t){this.lo=e>>>0,this.hi=t>>>0}var zero=LongBits.zero=new LongBits(0,0);zero.toNumber=function(){return 0},zero.zzEncode=zero.zzDecode=function(){return this},zero.length=function(){return 1};var zeroHash=LongBits.zeroHash="\0\0\0\0\0\0\0\0";LongBits.fromNumber=function(e){if(0===e)return zero;var t=e<0;t&&(e=-e);var a=e>>>0,r=(e-a)/4294967296>>>0;return t&&(r=~r>>>0,a=~a>>>0,++a>4294967295&&(a=0,++r>4294967295&&(r=0))),new LongBits(a,r)},LongBits.from=function(e){if("number"==typeof e)return LongBits.fromNumber(e);if(minimal.isString(e)){if(!minimal.Long)return LongBits.fromNumber(parseInt(e,10));e=minimal.Long.fromString(e)}return e.low||e.high?new LongBits(e.low>>>0,e.high>>>0):zero},LongBits.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,a=~this.hi>>>0;return t||(a=a+1>>>0),-(t+4294967296*a)}return this.lo+4294967296*this.hi},LongBits.prototype.toLong=function(e){return minimal.Long?new minimal.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var charCodeAt=String.prototype.charCodeAt;LongBits.fromHash=function(e){return e===zeroHash?zero:new LongBits((charCodeAt.call(e,0)|charCodeAt.call(e,1)<<8|charCodeAt.call(e,2)<<16|charCodeAt.call(e,3)<<24)>>>0,(charCodeAt.call(e,4)|charCodeAt.call(e,5)<<8|charCodeAt.call(e,6)<<16|charCodeAt.call(e,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},LongBits.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},LongBits.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,a=this.hi>>>24;return 0===a?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:a<128?9:10};var minimal=createCommonjsModule(function(e,t){var a=t;function r(e,t,a){for(var r=Object.keys(t),n=0;n0)},a.Buffer=function(){try{var e=a.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),a._Buffer_from=null,a._Buffer_allocUnsafe=null,a.newBuffer=function(e){return"number"==typeof e?a.Buffer?a._Buffer_allocUnsafe(e):new a.Array(e):a.Buffer?a._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},a.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,a.Long=commonjsGlobal.dcodeIO&&commonjsGlobal.dcodeIO.Long||a.inquire("long"),a.key2Re=/^true|false|0|1$/,a.key32Re=/^-?(?:0|[1-9][0-9]*)$/,a.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,a.longToHash=function(e){return e?a.LongBits.from(e).toHash():a.LongBits.zeroHash},a.longFromHash=function(e,t){var r=a.LongBits.fromHash(e);return a.Long?a.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},a.merge=r,a.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},a.newError=n,a.ProtocolError=n("ProtocolError"),a.oneOfGetter=function(e){for(var t={},a=0;a-1;--a)if(1===t[e[a]]&&void 0!==this[e[a]]&&null!==this[e[a]])return e[a]}},a.oneOfSetter=function(e){return function(t){for(var a=0;a127;)t[a++]=127&e|128,e>>>=7;t[a]=e}function VarintOp(e,t){this.len=e,this.next=void 0,this.val=t}function writeVarint64(e,t,a){for(;e.hi;)t[a++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[a++]=127&e.lo|128,e.lo=e.lo>>>7;t[a++]=e.lo}function writeFixed32(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}Writer.create=minimal.Buffer?function(){return(Writer.create=function(){return new BufferWriter})()}:function(){return new Writer},Writer.alloc=function(e){return new minimal.Array(e)},minimal.Array!==Array&&(Writer.alloc=minimal.pool(Writer.alloc,minimal.Array.prototype.subarray)),Writer.prototype._push=function(e,t,a){return this.tail=this.tail.next=new Op(e,t,a),this.len+=t,this},VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new VarintOp((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},Writer.prototype.int32=function(e){return e<0?this._push(writeVarint64,10,LongBits$1.fromNumber(e)):this.uint32(e)},Writer.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},Writer.prototype.uint64=function(e){var t=LongBits$1.from(e);return this._push(writeVarint64,t.length(),t)},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(e){var t=LongBits$1.from(e).zzEncode();return this._push(writeVarint64,t.length(),t)},Writer.prototype.bool=function(e){return this._push(writeByte,1,e?1:0)},Writer.prototype.fixed32=function(e){return this._push(writeFixed32,4,e>>>0)},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(e){var t=LongBits$1.from(e);return this._push(writeFixed32,4,t.lo)._push(writeFixed32,4,t.hi)},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(e){return this._push(minimal.float.writeFloatLE,4,e)},Writer.prototype.double=function(e){return this._push(minimal.float.writeDoubleLE,8,e)};var writeBytes=minimal.Array.prototype.set?function(e,t,a){t.set(e,a)}:function(e,t,a){for(var r=0;r>>0;if(!t)return this._push(writeByte,1,0);if(minimal.isString(e)){var a=Writer.alloc(t=base64.length(e));base64.decode(e,a,0),e=a}return this.uint32(t)._push(writeBytes,t,e)},Writer.prototype.string=function(e){var t=utf8.length(e);return t?this.uint32(t)._push(utf8.write,t,e):this._push(writeByte,1,0)},Writer.prototype.fork=function(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this},Writer.prototype.ldelim=function(){var e=this.head,t=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=e.next,this.tail=t,this.len+=a),this},Writer.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),a=0;e;)e.fn(e.val,t,a),a+=e.len,e=e.next;return t},Writer._configure=function(e){BufferWriter=e};var writer_buffer=BufferWriter$1;(BufferWriter$1.prototype=Object.create(writer.prototype)).constructor=BufferWriter$1;var Buffer=minimal.Buffer;function BufferWriter$1(){writer.call(this)}BufferWriter$1.alloc=function(e){return(BufferWriter$1.alloc=minimal._Buffer_allocUnsafe)(e)};var writeBytesBuffer=Buffer&&Buffer.prototype instanceof Uint8Array&&"set"===Buffer.prototype.set.name?function(e,t,a){t.set(e,a)}:function(e,t,a){if(e.copy)e.copy(t,a,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this._push(writeBytesBuffer,t,e),this},BufferWriter$1.prototype.string=function(e){var t=Buffer.byteLength(e);return this.uint32(t),t&&this._push(writeStringBuffer,t,e),this};var reader=Reader,BufferReader,LongBits$2=minimal.LongBits,utf8$1=minimal.utf8;function indexOutOfRange(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function Reader(e){this.buf=e,this.pos=0,this.len=e.length}var create_array="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Reader(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Reader(e);throw Error("illegal buffer")},value;function readLongVarint(){var e=new LongBits$2(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function readFixed32_end(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits$2(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader.create=minimal.Buffer?function(e){return(Reader.create=function(e){return minimal.Buffer.isBuffer(e)?new BufferReader(e):create_array(e)})(e)}:create_array,Reader.prototype._slice=minimal.Array.prototype.subarray||minimal.Array.prototype.slice,Reader.prototype.uint32=(value=4294967295,function(){if(value=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return value;if(value=(value|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return value;if(value=(value|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return value;if(value=(value|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return value;if(value=(value|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return value;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return value}),Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},Reader.prototype.bool=function(){return 0!==this.uint32()},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},Reader.prototype.bytes=function(){var e=this.uint32(),t=this.pos,a=this.pos+e;if(a>this.len)throw indexOutOfRange(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,a):t===a?new this.buf.constructor(0):this._slice.call(this.buf,t,a)},Reader.prototype.string=function(){var e=this.bytes();return utf8$1.read(e,0,e.length)},Reader.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw indexOutOfRange(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw indexOutOfRange(this)}while(128&this.buf[this.pos++]);return this},Reader.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},Reader._configure=function(e){BufferReader=e;var t=minimal.Long?"toLong":"toNumber";minimal.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader$1;function BufferReader$1(e){reader.call(this,e)}(BufferReader$1.prototype=Object.create(reader.prototype)).constructor=BufferReader$1,minimal.Buffer&&(BufferReader$1.prototype._slice=minimal.Buffer.prototype.slice),BufferReader$1.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))};var service=Service;function Service(e,t,a){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");minimal.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(a)}(Service.prototype=Object.create(minimal.EventEmitter.prototype)).constructor=Service,Service.prototype.rpcCall=function e(t,a,r,n,o){if(!n)throw TypeError("request must be specified");var s=this;if(!o)return minimal.asPromise(e,s,t,a,r,n);if(s.rpcImpl)try{return s.rpcImpl(t,a[s.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,a){if(e)return s.emit("error",e,t),o(e);if(null!==a){if(!(a instanceof r))try{a=r[s.responseDelimited?"decodeDelimited":"decode"](a)}catch(e){return s.emit("error",e,t),o(e)}return s.emit("data",a,t),o(null,a)}s.end(!0)})}catch(e){return s.emit("error",e,t),void setTimeout(function(){o(e)},0)}else setTimeout(function(){o(Error("already ended"))},0)},Service.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};var rpc_1=createCommonjsModule(function(e,t){t.Service=service}),roots={},indexMinimal=createCommonjsModule(function(e,t){var a=t;function r(){a.Reader._configure(a.BufferReader),a.util._configure()}a.build="minimal",a.Writer=writer,a.BufferWriter=writer_buffer,a.Reader=reader,a.BufferReader=reader_buffer,a.util=minimal,a.rpc=rpc_1,a.roots=roots,a.configure=r,a.Writer._configure(a.BufferWriter),r()}),minimal$1=indexMinimal,minimal_1=minimal$1.roots,minimal_2=minimal$1.Reader,minimal_3=minimal$1.util,$Reader=minimal$1.Reader,$util=minimal$1.util,$root=minimal$1.roots.default||(minimal$1.roots.default={}),valuesById,values,tensorflow;$root.tensorflow=(tensorflow={},tensorflow.Any=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.typeUrl=e.string();break;case 2:r.value=e.bytes();break;default:e.skipType(7&n)}}return r},e}(),tensorflow.DataType=(valuesById={},(values=Object.create(valuesById))[valuesById[0]="DT_INVALID"]=0,values[valuesById[1]="DT_FLOAT"]=1,values[valuesById[2]="DT_DOUBLE"]=2,values[valuesById[3]="DT_INT32"]=3,values[valuesById[4]="DT_UINT8"]=4,values[valuesById[5]="DT_INT16"]=5,values[valuesById[6]="DT_INT8"]=6,values[valuesById[7]="DT_STRING"]=7,values[valuesById[8]="DT_COMPLEX64"]=8,values[valuesById[9]="DT_INT64"]=9,values[valuesById[10]="DT_BOOL"]=10,values[valuesById[11]="DT_QINT8"]=11,values[valuesById[12]="DT_QUINT8"]=12,values[valuesById[13]="DT_QINT32"]=13,values[valuesById[14]="DT_BFLOAT16"]=14,values[valuesById[101]="DT_FLOAT_REF"]=101,values[valuesById[102]="DT_DOUBLE_REF"]=102,values[valuesById[103]="DT_INT32_REF"]=103,values[valuesById[104]="DT_UINT8_REF"]=104,values[valuesById[105]="DT_INT16_REF"]=105,values[valuesById[106]="DT_INT8_REF"]=106,values[valuesById[107]="DT_STRING_REF"]=107,values[valuesById[108]="DT_COMPLEX64_REF"]=108,values[valuesById[109]="DT_INT64_REF"]=109,values[valuesById[110]="DT_BOOL_REF"]=110,values[valuesById[111]="DT_QINT8_REF"]=111,values[valuesById[112]="DT_QUINT8_REF"]=112,values[valuesById[113]="DT_QINT32_REF"]=113,values[valuesById[114]="DT_BFLOAT16_REF"]=114,values),tensorflow.TensorShape=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.dim&&r.dim.length||(r.dim=[]),r.dim.push($root.tensorflow.TensorShape.Dim.decode(e,e.uint32()));break;case 3:r.unknownRank=e.bool();break;default:e.skipType(7&n)}}return r},e.Dim=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.size=e.int64();break;case 2:r.name=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.Tensor=function(){function e(e){if(this.floatVal=[],this.doubleVal=[],this.intVal=[],this.stringVal=[],this.scomplexVal=[],this.int64Val=[],this.boolVal=[],this.uint32Val=[],this.uint64Val=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.dtype=e.int32();break;case 2:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 3:r.versionNumber=e.int32();break;case 4:r.tensorContent=e.bytes();break;case 5:if(r.floatVal&&r.floatVal.length||(r.floatVal=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.list=$root.tensorflow.AttrValue.ListValue.decode(e,e.uint32());break;case 2:r.s=e.bytes();break;case 3:r.i=e.int64();break;case 4:r.f=e.float();break;case 5:r.b=e.bool();break;case 6:r.type=e.int32();break;case 7:r.shape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 8:r.tensor=$root.tensorflow.Tensor.decode(e,e.uint32());break;case 9:r.placeholder=e.string();break;case 10:r.func=$root.tensorflow.NameAttrList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.ListValue=function(){function e(e){if(this.s=[],this.i=[],this.f=[],this.b=[],this.type=[],this.shape=[],this.tensor=[],this.func=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.s&&r.s.length||(r.s=[]),r.s.push(e.bytes());break;case 3:if(r.i&&r.i.length||(r.i=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.name=e.string();break;case 2:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),tensorflow.NodeDef=function(){function e(e){if(this.input=[],this.attr={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.name=e.string();break;case 2:n.op=e.string();break;case 3:n.input&&n.input.length||(n.input=[]),n.input.push(e.string());break;case 4:n.device=e.string();break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),tensorflow.VersionDef=function(){function e(e){if(this.badConsumers=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.producer=e.int32();break;case 2:r.minConsumer=e.int32();break;case 3:if(r.badConsumers&&r.badConsumers.length||(r.badConsumers=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:r.versions=$root.tensorflow.VersionDef.decode(e,e.uint32());break;case 2:r.library=$root.tensorflow.FunctionDefLibrary.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),tensorflow.CollectionDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.nodeList=$root.tensorflow.CollectionDef.NodeList.decode(e,e.uint32());break;case 2:r.bytesList=$root.tensorflow.CollectionDef.BytesList.decode(e,e.uint32());break;case 3:r.int64List=$root.tensorflow.CollectionDef.Int64List.decode(e,e.uint32());break;case 4:r.floatList=$root.tensorflow.CollectionDef.FloatList.decode(e,e.uint32());break;case 5:r.anyList=$root.tensorflow.CollectionDef.AnyList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.NodeList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.string());break;default:e.skipType(7&n)}}return r},e}(),e.BytesList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.bytes());break;default:e.skipType(7&n)}}return r},e}(),e.Int64List=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push($root.tensorflow.Any.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.SaverDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.filenameTensorName=e.string();break;case 2:r.saveTensorName=e.string();break;case 3:r.restoreOpName=e.string();break;case 4:r.maxToKeep=e.int32();break;case 5:r.sharded=e.bool();break;case 6:r.keepCheckpointEveryNHours=e.float();break;case 7:r.version=e.int32();break;default:e.skipType(7&n)}}return r},e.CheckpointFormatVersion=(t={},(a=Object.create(t))[t[0]="LEGACY"]=0,a[t[1]="V1"]=1,a[t[2]="V2"]=2,a),e}(),tensorflow.TensorInfo=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 4:r.cooSparse=$root.tensorflow.TensorInfo.CooSparse.decode(e,e.uint32());break;case 2:r.dtype=e.int32();break;case 3:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.CooSparse=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.valuesTensorName=e.string();break;case 2:r.indicesTensorName=e.string();break;case 3:r.denseShapeTensorName=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.SignatureDef=function(){function e(e){if(this.inputs={},this.outputs={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:e.skip().pos++,n.inputs===$util.emptyObject&&(n.inputs={}),a=e.string(),e.pos++,n.inputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:e.skip().pos++,n.outputs===$util.emptyObject&&(n.outputs={}),a=e.string(),e.pos++,n.outputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 3:n.methodName=e.string();break;default:e.skipType(7&o)}}return n},e}(),tensorflow.AssetFileDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.tensorInfo=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:r.filename=e.string();break;default:e.skipType(7&n)}}return r},e}(),tensorflow.OpDef=function(){function e(e){if(this.inputArg=[],this.outputArg=[],this.attr=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.inputArg&&r.inputArg.length||(r.inputArg=[]),r.inputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 3:r.outputArg&&r.outputArg.length||(r.outputArg=[]),r.outputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 4:r.attr&&r.attr.length||(r.attr=[]),r.attr.push($root.tensorflow.OpDef.AttrDef.decode(e,e.uint32()));break;case 8:r.deprecation=$root.tensorflow.OpDef.OpDeprecation.decode(e,e.uint32());break;case 5:r.summary=e.string();break;case 6:r.description=e.string();break;case 18:r.isCommutative=e.bool();break;case 16:r.isAggregate=e.bool();break;case 17:r.isStateful=e.bool();break;case 19:r.allowsUninitializedInput=e.bool();break;default:e.skipType(7&n)}}return r},e.ArgDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.description=e.string();break;case 3:r.type=e.int32();break;case 4:r.typeAttr=e.string();break;case 5:r.numberAttr=e.string();break;case 6:r.typeListAttr=e.string();break;case 16:r.isRef=e.bool();break;default:e.skipType(7&n)}}return r},e}(),e.AttrDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.type=e.string();break;case 3:r.defaultValue=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 4:r.description=e.string();break;case 5:r.hasMinimum=e.bool();break;case 6:r.minimum=e.int64();break;case 7:r.allowedValues=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),e.OpDeprecation=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.version=e.int32();break;case 2:r.explanation=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.OpList=function(){function e(e){if(this.op=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.op&&r.op.length||(r.op=[]),r.op.push($root.tensorflow.OpDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),tensorflow.MetaGraphDef=function(){function e(e){if(this.collectionDef={},this.signatureDef={},this.assetFileDef=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.metaInfoDef=$root.tensorflow.MetaGraphDef.MetaInfoDef.decode(e,e.uint32());break;case 2:n.graphDef=$root.tensorflow.GraphDef.decode(e,e.uint32());break;case 3:n.saverDef=$root.tensorflow.SaverDef.decode(e,e.uint32());break;case 4:e.skip().pos++,n.collectionDef===$util.emptyObject&&(n.collectionDef={}),a=e.string(),e.pos++,n.collectionDef[a]=$root.tensorflow.CollectionDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.signatureDef===$util.emptyObject&&(n.signatureDef={}),a=e.string(),e.pos++,n.signatureDef[a]=$root.tensorflow.SignatureDef.decode(e,e.uint32());break;case 6:n.assetFileDef&&n.assetFileDef.length||(n.assetFileDef=[]),n.assetFileDef.push($root.tensorflow.AssetFileDef.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.MetaInfoDef=function(){function e(e){if(this.tags=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.metaGraphVersion=e.string();break;case 2:r.strippedOpList=$root.tensorflow.OpList.decode(e,e.uint32());break;case 3:r.anyInfo=$root.tensorflow.Any.decode(e,e.uint32());break;case 4:r.tags&&r.tags.length||(r.tags=[]),r.tags.push(e.string());break;case 5:r.tensorflowVersion=e.string();break;case 6:r.tensorflowGitVersion=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.SavedModel=function(){function e(e){if(this.metaGraphs=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.savedModelSchemaVersion=e.int64();break;case 2:r.metaGraphs&&r.metaGraphs.length||(r.metaGraphs=[]),r.metaGraphs.push($root.tensorflow.MetaGraphDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),tensorflow.FunctionDefLibrary=function(){function e(e){if(this.function=[],this.gradient=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.function&&r.function.length||(r.function=[]),r.function.push($root.tensorflow.FunctionDef.decode(e,e.uint32()));break;case 2:r.gradient&&r.gradient.length||(r.gradient=[]),r.gradient.push($root.tensorflow.GradientDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),tensorflow.FunctionDef=function(){function e(e){if(this.attr={},this.nodeDef=[],this.ret={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.signature=$root.tensorflow.OpDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 3:n.nodeDef&&n.nodeDef.length||(n.nodeDef=[]),n.nodeDef.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:e.skip().pos++,n.ret===$util.emptyObject&&(n.ret={}),a=e.string(),e.pos++,n.ret[a]=e.string();break;default:e.skipType(7&o)}}return n},e}(),tensorflow.GradientDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.functionName=e.string();break;case 2:r.gradientFunc=e.string();break;default:e.skipType(7&n)}}return r},e}(),tensorflow);var compiled_api=$root,compiled_api_1=compiled_api.tensorflow;function getParamValue(e,t,a,r){var n=t.params[e];if(n&&void 0!==n.inputIndex){if("tensor"===n.type)return getTensor(t.inputNames[n.inputIndex],a,r);if("tensors"===n.type)return(0===n.inputIndex?0===n.inputParamLength?t.inputNames:t.inputNames.slice(n.inputIndex,-n.inputParamLength):t.inputNames.splice(n.inputIndex)).map(function(e){return getTensor(e,a,r)});var o=Array.prototype.slice.call(getTensor(t.inputNames.slice(n.inputIndex)[0],a,r).dataSync());return"number"===n.type?o[0]:o}return n&&n.value}function getTensor(e,t,a){var r=parseNodeName(e),n=r[0],o=r[1],s=a.currentContextIds.find(function(e){return!!t[getNodeNameWithContextId(n,e)]});return void 0!==s?t[getNodeNameWithContextId(n,s)][o]:void 0}function getNodeNameAndIndex(e,t){var a=parseNodeName(e),r=a[0],n=a[1];return[getNodeNameWithContextId(r,t&&t.currentContextId),n]}function getNodeNameWithContextId(e,t){return t?e+"-"+t:e}function parseNodeName(e){var t=e.lastIndexOf(":");return-1===t?[e,0]:[e.substring(0,t),Number(e.substring(t+1))]}function split(e,t){for(var a=[],r=0;r=this.tensors.length)throw new Error("Tried to read from index "+e+", but array size is: "+this.tensors.length);var t=this.tensors[e];if(t.cleared)throw new Error("TensorArray "+this.name+": Could not read index "+e+" twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).");return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor},e.prototype.readMany=function(e){var t=this;return e.map(function(e){return t.read(e)})},e.prototype.write=function(e,t){if(this.closed_)throw new Error("TensorArray "+this.name+" has already been closed.");if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error("Tried to write to index "+e+", but array is not resizeable and size is: "+this.maxSize);var a=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+",\n because the value dtype is "+t.dtype+", but TensorArray dtype is "+this.dtype+".");if(0===this.size()&&0===this.elementShape.length&&(this.elementShape=t.shape),tfc.util.assertShapesMatch(this.elementShape,t.shape,"TensorArray "+this.name+": Could not write to TensorArray index "+e+"."),a&&a.read)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been read.");if(a&&a.written)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been written.");a.tensor=t,a.written=!0,this.tensors[e]=a},e.prototype.writeMany=function(e,t){var a=this;if(e.length!==t.length)throw new Error("TensorArray "+this.name+": could not write multiple tensors,because the index size: "+e.length+" is not the same as tensors size: "+t.length+".");e.map(function(e,r){return a.write(e,t[r])})},e.prototype.gather=function(e,t){if(t&&t!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but gather requested dtype "+t);if(!e){e=[];for(var a=0;a=this.maxSize)throw new Error("Max index must be < array size ("+a+" vs. "+this.maxSize+")");this.writeMany(e,tfc.unstack(t,0))},e.prototype.split=function(e,t){var a=this;if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but tensor has dtype "+t.dtype);var r=0,n=e.map(function(e){return r+=e});if(r!==t.shape[0])throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n "+r+", and tensor's shape is: "+t.shape);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error("TensorArray's size is not equal to the size of lengths ("+this.maxSize+" vs. "+e.length+"), and the TensorArray is not marked as dynamically resizeable");var o=0===r?0:t.size/r,s=[];tfc.tidy(function(){t=t.reshape([1,r,o]);for(var i=0;i1)for(var c=1;c1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()},e.prototype.nextIteration=function(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");this.contexts=this.contexts.slice(),this.lastId++;var e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))},e.prototype.getWeight=function(e){return this.weightMap[e]},e.prototype.addTensorArray=function(e){this.tensorArrayMap[e.id]=e},e.prototype.getTensorArray=function(e){return this.tensorArrayMap[e]},e}(),GraphExecutor=function(){function e(e){this.graph=e,this.compiledOrder=[],this._weightMap={},this.placeholders=e.placeholders,this._outputs=e.outputs,this.compile()}return Object.defineProperty(e.prototype,"weightMap",{get:function(){return this._weightMap},set:function(e){var t=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})});this.weightIds=[].concat.apply([],t),this._weightMap=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.placeholders.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this._outputs.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.placeholders.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.outputs.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isControlFlowModel",{get:function(){return this.graph.withControlFlow},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDynamicShapeModel",{get:function(){return this.graph.withDynamicShape},enumerable:!0,configurable:!0}),e.prototype.compile=function(){if(!this.graph.withControlFlow&&!this.graph.withDynamicShape)for(var e=this.graph.inputs.slice(),t={};e.length>0;){var a=e.pop();t[a.name]=!0,this.compiledOrder.push(a),a.children.forEach(function(a){!t[a.name]&&a.inputNames.every(function(e){var a=getNodeNameAndIndex(e)[0];return t[a]})&&e.push(a)})}},e.prototype.execute=function(e,t){var a=this;this.checkInput(e),this.checkInputShapeAndType(e);var r={};return tfc.tidy(function(){var n=new ExecutionContext(a._weightMap,r),o=a.compiledOrder.reduce(function(e,t){return e[t.name]=executeOp$15(t,e,n),e},__assign({},a.weightMap,e));return a.findOutputs(o,n,t)})},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u=this;return __generator(this,function(l){switch(l.label){case 0:return this.checkInput(e),this.checkInputShapeAndType(e),a={},r=new ExecutionContext(this._weightMap,a),[4,this.executeWithControlFlow(e,r)];case 1:return n=l.sent(),o=this.findOutputs(n,r,t),s=Object.keys(o).map(function(e){return o[e].id}),i=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})}),p=[].concat.apply([],i),Object.keys(n).forEach(function(e){n[e].forEach(function(e){e&&-1===s.indexOf(e.id)&&-1===p.indexOf(e.id)&&-1===u.weightIds.indexOf(e.id)&&e.dispose()})}),[2,o]}})})},e.prototype.executeWithControlFlow=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u;return __generator(this,function(l){switch(l.label){case 0:a=this.graph.inputs.map(function(e){return{node:e,contexts:t.currentContext}}),r=__assign({},this.weightMap,e),n={},l.label=1;case 1:return a.length>0?(o=a.pop(),t.currentContext=o.contexts,s="","enter"===o.node.op&&getParamValue("isConstant",o.node,r,t)&&(s=getNodeNameAndIndex(o.node.name,t)[0]),i=executeOp$15(o.node,r,t),s||(s=getNodeNameAndIndex(o.node.name,t)[0]),p=r,u=s,[4,i]):[3,3];case 2:return p[u]=l.sent(),o.node.children.forEach(function(e){var o=getNodeNameAndIndex(e.name,t)[0];n[o]||("merge"===e.op?e.inputNames.some(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})):e.inputNames.every(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})))}),[3,1];case 3:return[2,r]}})})},e.prototype.findOutputs=function(e,t,a){return!a||a instanceof Array||(a=[a]),(a||this.graph.outputs.map(function(e){return e.name})).reduce(function(a,r){return a[r]=getTensor(r,e,t),a},{})},e.prototype.dispose=function(){var e=this;Object.keys(this.weightMap).forEach(function(t){return e.weightMap[t].forEach(function(e){return e.dispose()})})},e.prototype.checkInputShapeAndType=function(e){this.placeholders.forEach(function(t){var a=e[t.name][0];if(t.params.shape&&t.params.shape.value){var r=t.params.shape.value,n=r.length===a.shape.length&&a.shape.every(function(e,t){return-1===r[t]||r[t]===e});tfc.util.assert(n,"The shape of dict['"+t.name+"'] provided in model.execute(dict) must be ["+r+"], but was ["+a.shape+"]")}t.params.dtype&&t.params.dtype.value&&tfc.util.assert(a.dtype===t.params.dtype.value,"The dtype of dict['"+t.name+"'] provided in model.execute(dict) must be "+t.params.dtype.value+", but was "+a.dtype)})},e.prototype.checkInput=function(e){var t=this,a=Object.keys(e),r=[],n=[];if(this.inputNodes.forEach(function(e){-1===a.indexOf(e)&&r.push(e)}),a.forEach(function(e){-1===t.inputNodes.indexOf(e)&&n.push(e)}),r.length>0)throw new Error("The dict provided in model.execute(dict) has the keys ["+a+"], but is missing the required keys: ["+r+"].");if(n.length>0)throw new Error("The dict provided in model.execute(dict) has unused keys: ["+n+"]. Please provide only the following keys: ["+this.inputNodes+"].")},e}(),FrozenModel=function(){function e(e,t,a){this.modelUrl=e,this.weightManifestUrl=t,this.requestOption=a,this.version="n/a",this.pathPrefix=this.getPathPrefix()}return Object.defineProperty(e.prototype,"modelVersion",{get:function(){return this.version},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.executor.inputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.executor.outputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.executor.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this.executor.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weights",{get:function(){return this.executor.weightMap},enumerable:!0,configurable:!0}),e.prototype.getPathPrefix=function(){var e=parse(this.weightManifestUrl),t=e.pathname.split("/");return t.splice(-1),e.pathname=t.join("/"),format(e)+"/"},e.prototype.loadRemoteProtoFile=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r,n;return __generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,fetch(this.modelUrl,this.requestOption)];case 1:return e=o.sent(),a=(t=compiled_api_1.GraphDef).decode,r=Uint8Array.bind,[4,e.arrayBuffer()];case 2:return[2,a.apply(t,[new(r.apply(Uint8Array,[void 0,o.sent()]))])];case 3:throw n=o.sent(),new Error(this.modelUrl+" not found. "+n);case 4:return[2]}})})},e.prototype.loadWeightManifest=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,fetch(this.weightManifestUrl,this.requestOption)];case 1:return e=r.sent(),t=this,[4,e.clone().json()];case 2:return t.weightManifest=r.sent(),[3,4];case 3:throw a=r.sent(),new Error(this.weightManifestUrl+" not found. "+a);case 4:return[2]}})})},e.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r;return __generator(this,function(n){switch(n.label){case 0:return e=this.loadRemoteProtoFile(),t=this.loadWeightManifest(),[4,Promise.all([e,t])];case 1:return a=n.sent()[0],this.version=a.versions.producer+"."+a.versions.minConsumer,[4,tfc.io.loadWeights(this.weightManifest,this.pathPrefix,void 0,this.requestOption)];case 2:return r=n.sent(),this.executor=new GraphExecutor(OperationMapper.Instance.transformGraph(a)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),[2,!0]}})})},e.prototype.predict=function(e,t){return this.execute(e,this.outputNodes)},e.prototype.constructTensorMap=function(e){var t=e instanceof tfc.Tensor?[e]:e;if(t.length!==this.inputNodes.length)throw new Error("Input tensor count mismatch,the frozen model has "+this.inputNodes.length+" placeholders, while there are "+t.length+" input tensors.");return this.inputNodes.reduce(function(e,a,r){return e[a]=t[r],e},{})},e.prototype.execute=function(e,t){if(t=t||this.outputNodes,(e instanceof tfc.Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),this.executor.isControlFlowModel||this.executor.isDynamicShapeModel)throw new Error("The model contains control flow or dynamic shape ops, please use executeAsync method");var a=this.executor.execute(this.convertTensorMapToTensorsMap(e),t),r=Object.keys(a);return Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r;return __generator(this,function(n){switch(n.label){case 0:if(!this.executor.isControlFlowModel||!this.executor.isDynamicShapeModel)throw new Error("The model does not contain control flow or dynamic shape ops, please use execute method for better performance.");return t=t||this.outputNodes,(e instanceof tfc.Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),[4,this.executor.executeAsync(this.convertTensorMapToTensorsMap(e),t)];case 1:return a=n.sent(),r=Object.keys(a),[2,Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]]}})})},e.prototype.convertTensorMapToTensorsMap=function(e){return Object.keys(e).reduce(function(t,a){return t[a]=[e[a]],t},{})},e.prototype.dispose=function(){this.executor.dispose()},e}();function loadFrozenModel(e,t,a){return __awaiter(this,void 0,void 0,function(){var r;return __generator(this,function(n){switch(n.label){case 0:return[4,(r=new FrozenModel(e,t,a)).load()];case 1:return n.sent(),[2,r]}})})}var version="0.5.5";exports.FrozenModel=FrozenModel,exports.loadFrozenModel=loadFrozenModel,exports.version_converter=version,Object.defineProperty(exports,"__esModule",{value:!0})}); diff --git a/node_modules/@tensorflow/tfjs-converter/dist/version.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/version.d.ts new file mode 100644 index 0000000..097c78d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/version.d.ts @@ -0,0 +1,2 @@ +declare const version = "0.5.5"; +export { version }; diff --git a/node_modules/@tensorflow/tfjs-converter/dist/version.js b/node_modules/@tensorflow/tfjs-converter/dist/version.js new file mode 100644 index 0000000..a5b460f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/dist/version.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var version = '0.5.5'; +exports.version = version; +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-converter/package.json b/node_modules/@tensorflow/tfjs-converter/package.json new file mode 100644 index 0000000..ef48560 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-converter/package.json @@ -0,0 +1,97 @@ +{ + "_from": "@tensorflow/tfjs-converter@0.5.5", + "_id": "@tensorflow/tfjs-converter@0.5.5", + "_inBundle": false, + "_integrity": "sha512-tLIv4u0+BtE61oarjQWJUsL0Ro54YmiDx8XVCbN9QY34V6zZrNFr/VJYZEIZnKcepCQ0MxZ09mggnfBD3EvMrQ==", + "_location": "/@tensorflow/tfjs-converter", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@tensorflow/tfjs-converter@0.5.5", + "name": "@tensorflow/tfjs-converter", + "escapedName": "@tensorflow%2ftfjs-converter", + "scope": "@tensorflow", + "rawSpec": "0.5.5", + "saveSpec": null, + "fetchSpec": "0.5.5" + }, + "_requiredBy": [ + "/@tensorflow/tfjs" + ], + "_resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-0.5.5.tgz", + "_shasum": "0b8ced232d598e70bc52a4a6d95ba69f88af1b8d", + "_spec": "@tensorflow/tfjs-converter@0.5.5", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs", + "bugs": { + "url": "https://github.com/tensorflow/tfjs-converter/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@types/long": "~3.0.32", + "protobufjs": "~6.8.6", + "url": "~0.11.0" + }, + "deprecated": false, + "description": "Tensorflow model converter for javascript", + "devDependencies": { + "@tensorflow/tfjs-core": "~0.12.8", + "@types/jasmine": "~2.8.6", + "@types/node-fetch": "1.6.9", + "ajv": "~6.3.0", + "babel-core": "~6.26.3", + "babel-plugin-external-helpers": "~6.22.0", + "babel-preset-env": "~1.7.0", + "clang-format": "~1.2.2", + "copyfiles": "~1.2.0", + "jasmine-core": "~3.1.0", + "karma": "~2.0.0", + "karma-browserstack-launcher": "~1.3.0", + "karma-chrome-launcher": "~2.2.0", + "karma-firefox-launcher": "~1.0.1", + "karma-jasmine": "~1.1.1", + "karma-typescript": "~3.0.12", + "node-fetch": "~2.1.2", + "opn": "~5.1.0", + "rimraf": "~2.6.2", + "rollup": "~0.58.2", + "rollup-plugin-commonjs": "~9.1.3", + "rollup-plugin-json": "~3.0.0", + "rollup-plugin-node-resolve": "~3.3.0", + "rollup-plugin-typescript2": "~0.13.0", + "rollup-plugin-uglify": "~3.0.0", + "ts-node": "~4.1.0", + "tslint": "~5.8.0", + "tslint-no-circular-imports": "~0.5.0", + "typescript": "~2.7.2", + "yalc": "~1.0.0-pre.21" + }, + "homepage": "https://github.com/tensorflow/tfjs-converter#readme", + "jsdelivr": "dist/tf-converter.min.js", + "jsnext:main": "dist/tf-converter.esm.js", + "license": "Apache-2.0", + "main": "dist/index.js", + "module": "dist/tf-converter.esm.js", + "name": "@tensorflow/tfjs-converter", + "peerDependencies": { + "@tensorflow/tfjs-core": "~0.12.8" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/tensorflow/tfjs-converter.git" + }, + "scripts": { + "build": "tsc && copyfiles -f src/data/compiled_api.* dist/data && copyfiles -f src/operations/op_list/*.json dist/operations/op_list && copyfiles -f src/operations/typings.d.ts dist/operations", + "build-npm": "./scripts/build-npm.sh", + "gen-doc": "ts-node ./src/docs/doc_gen.ts", + "link-local": "yalc link", + "lint": "tslint -p . -t verbose", + "make-version": "sh -c ./scripts/make-version", + "publish-local": "yarn build-npm && yalc push", + "test": "karma start", + "test-travis": "karma start --browsers='bs_firefox_mac,bs_chrome_mac' --singleRun" + }, + "types": "dist/index.d.ts", + "unpkg": "dist/tf-converter.min.js", + "version": "0.5.5" +} diff --git a/node_modules/@tensorflow/tfjs-core/LICENSE b/node_modules/@tensorflow/tfjs-core/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@tensorflow/tfjs-core/README.md b/node_modules/@tensorflow/tfjs-core/README.md new file mode 100644 index 0000000..1010a37 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/README.md @@ -0,0 +1,45 @@ + + + + +# TensorFlow.js Core API + +A part of the TensorFlow.js ecosystem, this repo hosts `@tensorflow/tfjs-core`, +the TensorFlow.js Core API, which provides low-level, hardware-accelerated +linear algebra operations and an eager API for automatic differentiation. + +Check out [js.tensorflow.org](https://js.tensorflow.org) for more +information about the library, tutorials and API docs. + +To keep track of issues we use the [tensorflow/tfjs](https://github.com/tensorflow/tfjs) Github repo. + +## Importing + +You can install TensorFlow.js via yarn or npm. We recommend using the +[@tensorflow/tfjs](https://www.npmjs.com/package/@tensorflow/tfjs) npm package, +which gives you both this Core API and the higher-level +[Layers API](https://github.com/tensorflow/tfjs-layers): + +```js +import * as tf from '@tensorflow/tfjs'; +// You have the Core API: tf.matMul(), tf.softmax(), ... +// You also have Layers API: tf.model(), tf.layers.dense(), ... +``` + +On the other hand, if you care about the bundle size and you do not use the +Layers API, you can import only the Core API: + +```js +import * as tfc from '@tensorflow/tfjs-core'; +// You have the Core API: tfc.matMul(), tfc.softmax(), ... +// No Layers API. +``` + +For info about development, check out [DEVELOPMENT.md](./DEVELOPMENT.md). + +## For more information + +- [TensorFlow.js API documentation](https://js.tensorflow.org/api/latest/) +- [TensorFlow.js Tutorials](https://js.tensorflow.org/tutorials/) + +Thanks BrowserStack for providing testing support. diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts new file mode 100644 index 0000000..2b112a5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts @@ -0,0 +1,2 @@ +declare function nextFrame(): Promise; +export { nextFrame }; diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util.js b/node_modules/@tensorflow/tfjs-core/dist/browser_util.js new file mode 100644 index 0000000..0f3dcb7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var delayCallback = typeof requestAnimationFrame !== 'undefined' ? + requestAnimationFrame : + setImmediate; +function nextFrame() { + return new Promise(function (resolve) { return delayCallback(function () { return resolve(); }); }); +} +exports.nextFrame = nextFrame; +//# sourceMappingURL=browser_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/browser_util.js.map new file mode 100644 index 0000000..b9f4f7f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser_util.js","sourceRoot":"","sources":["../src/browser_util.ts"],"names":[],"mappings":";;AAiBA,IAAM,aAAa,GAAG,OAAO,qBAAqB,KAAK,WAAW,CAAC,CAAC;IAChE,qBAAqB,CAAC,CAAC;IACvB,YAAY,CAAC;AAWjB;IACE,OAAO,IAAI,OAAO,CAAO,UAAA,OAAO,IAAI,OAAA,aAAa,CAAC,cAAM,OAAA,OAAO,EAAE,EAAT,CAAS,CAAC,EAA9B,CAA8B,CAAC,CAAC;AACtE,CAAC;AAEO,8BAAS"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js new file mode 100644 index 0000000..0883abf --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js @@ -0,0 +1,83 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var jasmine_util_1 = require("./jasmine_util"); +var test_util_1 = require("./test_util"); +jasmine_util_1.describeWithFlags('nextFrame', test_util_1.ALL_ENVS, function () { + it('basic usage', function () { return __awaiter(_this, void 0, void 0, function () { + var t0, t1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + t0 = tf.util.now(); + return [4, tf.nextFrame()]; + case 1: + _a.sent(); + t1 = tf.util.now(); + expect(t1 > t0); + return [2]; + } + }); + }); }); + it('does not block timers', function () { return __awaiter(_this, void 0, void 0, function () { + var flag, t0; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + flag = false; + setTimeout(function () { + flag = true; + }, 50); + t0 = tf.util.now(); + expect(flag).toBe(false); + _a.label = 1; + case 1: + if (!(tf.util.now() - t0 < 1000 && !flag)) return [3, 3]; + return [4, tf.nextFrame()]; + case 2: + _a.sent(); + return [3, 1]; + case 3: + expect(flag).toBe(true); + return [2]; + } + }); + }); }); +}); +//# sourceMappingURL=browser_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js.map new file mode 100644 index 0000000..5d035b6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser_util_test.js","sourceRoot":"","sources":["../src/browser_util_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBA0BA;;AA1BA,4BAA8B;AAC9B,+CAAiD;AACjD,yCAAqC;AAErC,gCAAiB,CAAC,WAAW,EAAE,oBAAQ,EAAE;IACvC,EAAE,CAAC,aAAa,EAAE;;;;;oBACV,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;oBACzB,WAAM,EAAE,CAAC,SAAS,EAAE,EAAA;;oBAApB,SAAoB,CAAC;oBACf,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;oBAEzB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;;;;SACjB,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE;;;;;oBACtB,IAAI,GAAG,KAAK,CAAC;oBACjB,UAAU,CAAC;wBACT,IAAI,GAAG,IAAI,CAAC;oBACd,CAAC,EAAE,EAAE,CAAC,CAAC;oBACD,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;oBACzB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;;yBAClB,CAAA,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,IAAI,CAAA;oBACvC,WAAM,EAAE,CAAC,SAAS,EAAE,EAAA;;oBAApB,SAAoB,CAAC;;;oBAEvB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;SACzB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js new file mode 100644 index 0000000..04dd2f4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var jasmine_util_1 = require("./jasmine_util"); +var tensor_util_env_1 = require("./tensor_util_env"); +var test_util_1 = require("./test_util"); +jasmine_util_1.describeWithFlags('debug on', test_util_1.ALL_ENVS, function () { + beforeAll(function () { + tf.ENV.set('DEBUG', true); + }); + afterAll(function () { + tf.ENV.set('DEBUG', false); + }); + it('debug mode does not error when no nans', function () { + var a = tf.tensor1d([2, -1, 0, 3]); + var res = tf.relu(a); + test_util_1.expectArraysClose(res, [2, 0, 0, 3]); + }); + it('debug mode errors when there are nans, float32', function () { + var a = tf.tensor1d([2, NaN]); + var f = function () { return tf.relu(a); }; + expect(f).toThrowError(); + }); + it('debug mode errors when nans in tensor construction, int32', function () { + var a = function () { return tf.tensor1d([2, NaN], 'int32'); }; + expect(a).toThrowError(); + }); + it('debug mode errors when nans in oneHot op (tensorlike), int32', function () { + var f = function () { return tf.oneHot([2, NaN], 3); }; + expect(f).toThrowError(); + }); + it('debug mode errors when nan in convertToTensor, int32', function () { + var a = function () { return tensor_util_env_1.convertToTensor(NaN, 'a', 'test', 'int32'); }; + expect(a).toThrowError(); + }); + it('debug mode errors when nan in convertToTensor array input, int32', function () { + var a = function () { return tensor_util_env_1.convertToTensor([NaN], 'a', 'test', 'int32'); }; + expect(a).toThrowError(); + }); + it('A x B', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = tf.tensor2d([0, 1, -3, 2, 2, 1], [3, 2]); + var c = tf.matMul(a, b); + expect(c.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(c, [0, 8, -3, 20]); + }); +}); +jasmine_util_1.describeWithFlags('debug off', test_util_1.ALL_ENVS, function () { + beforeAll(function () { + tf.ENV.set('DEBUG', false); + }); + it('no errors where there are nans, and debug mode is disabled', function () { + var a = tf.tensor1d([2, NaN]); + var res = tf.relu(a); + test_util_1.expectArraysClose(res, [2, NaN]); + }); +}); +//# sourceMappingURL=debug_mode_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js.map new file mode 100644 index 0000000..b7f084b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"debug_mode_test.js","sourceRoot":"","sources":["../src/debug_mode_test.ts"],"names":[],"mappings":";;AAiBA,4BAA8B;AAC9B,+CAAiD;AACjD,qDAAkD;AAClD,yCAAwD;AAExD,gCAAiB,CAAC,UAAU,EAAE,oBAAQ,EAAE;IACtC,SAAS,CAAC;QACR,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC;QACP,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE;QAC3C,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,IAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,6BAAiB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE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AAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts new file mode 100644 index 0000000..c2a6948 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts @@ -0,0 +1 @@ +export declare function isMobile(): boolean; diff --git a/node_modules/@tensorflow/tfjs-core/dist/device_util.js b/node_modules/@tensorflow/tfjs-core/dist/device_util.js new file mode 100644 index 0000000..6bf155e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/device_util.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function isMobile() { + var a = navigator.userAgent || navigator.vendor || window.opera; + return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i + .test(a) || + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i + .test(a.substr(0, 4)); +} +exports.isMobile = isMobile; +//# sourceMappingURL=device_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/device_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/device_util.js.map new file mode 100644 index 0000000..b6db30c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/device_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"device_util.js","sourceRoot":"","sources":["../src/device_util.ts"],"names":[],"mappings":";;AAiBA;IAEE,IAAM,CAAC,GAAG,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,IAAK,MAAc,CAAC,KAAK,CAAC;IAE3E,OAAO,0TAA0T;SACrT,IAAI,CAAC,CAAC,CAAC;QAEf,ykDAAykD;aACpkD,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC;AATD,4BASC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts b/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts new file mode 100644 index 0000000..f804d07 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts @@ -0,0 +1,73 @@ +import { BackendTimingInfo, KernelBackend } from './kernels/backend'; +import { DataId, Tensor, Tensor3D, Variable } from './tensor'; +import { NamedTensorMap, NamedVariableMap, TensorContainer } from './tensor_types'; +import { TypedArray } from './types'; +export declare type ForwardFunc = (backend: KernelBackend, save?: (tensor: S) => S) => T; +export declare type CustomGradientFunc = (...args: Tensor[]) => { + value: T; + gradFunc: (dy: T) => Tensor | Tensor[]; +}; +export declare type MemoryInfo = { + numTensors: number; + numDataBuffers: number; + numBytes: number; + unreliable?: boolean; +}; +export interface TimingInfo extends BackendTimingInfo { + wallMs: number; +} +export declare type ScopeFn = () => T; +export interface TensorManager { + registerTensor(a: Tensor): void; + registerVariable(v: Variable): void; + disposeTensor(a: Tensor): void; + memory(): { + numDataBuffers: number; + numBytes: number; + }; +} +export declare class Engine implements TensorManager { + private backend; + safeMode: boolean; + private debugMode; + registeredVariables: NamedVariableMap; + private refCounter; + private nextTapeNodeId; + private numBytes; + private numTensors; + private numDataBuffers; + private activeTape; + private gradientScopeCount; + private customGradientDepth; + private activeScope; + private scopeStack; + private keepTensors; + private profiler; + constructor(backend: KernelBackend, safeMode: boolean, debugMode: () => boolean); + tidy(nameOrFn: string | ScopeFn, fn?: ScopeFn, gradMode?: boolean): T; + private scopedRun; + runKernel(forwardFunc: ForwardFunc, inputs: I, backwardsFunc?: (dy: T, saved: Tensor[]) => { + [P in keyof I]: () => I[P]; + }): T; + registerTensor(a: Tensor | Variable): void; + registerVariable(v: Variable): void; + disposeTensor(a: Tensor): void; + disposeVariables(): void; + memory(): MemoryInfo; + private shouldRecord; + private addTapeNode; + keep(result: T): T; + startScope(name?: string, gradientsMode?: boolean): void; + endScope(result?: TensorContainer, gradientsMode?: boolean): void; + gradients(f: () => T, xs: Tensor[], dy?: T, allowNoGradients?: boolean): { + value: T; + grads: Tensor[]; + }; + customGrad(f: CustomGradientFunc): (...args: Tensor[]) => T; + write(dataId: DataId, values: TypedArray): void; + readSync(dataId: DataId): TypedArray; + read(dataId: DataId): Promise; + fromPixels(pixels: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, numChannels: number): Tensor3D; + time(query: () => void): Promise; + private track; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine.js b/node_modules/@tensorflow/tfjs-core/dist/engine.js new file mode 100644 index 0000000..54adb70 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/engine.js @@ -0,0 +1,376 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var profiler_1 = require("./profiler"); +var tape_1 = require("./tape"); +var tensor_1 = require("./tensor"); +var tensor_util_1 = require("./tensor_util"); +var util = require("./util"); +var util_1 = require("./util"); +var Engine = (function () { + function Engine(backend, safeMode, debugMode) { + this.backend = backend; + this.safeMode = safeMode; + this.debugMode = debugMode; + this.registeredVariables = {}; + this.refCounter = new WeakMap(); + this.nextTapeNodeId = 0; + this.numBytes = 0; + this.numTensors = 0; + this.numDataBuffers = 0; + this.gradientScopeCount = 0; + this.customGradientDepth = 0; + this.keepTensors = new Set(); + this.activeScope = { track: [], name: 'default scope' }; + this.scopeStack = [this.activeScope]; + this.profiler = new profiler_1.Profiler(backend); + } + Engine.prototype.tidy = function (nameOrFn, fn, gradMode) { + var _this = this; + if (gradMode === void 0) { gradMode = false; } + var name = null; + if (fn == null) { + if (typeof nameOrFn !== 'function') { + throw new Error('Please provide a function to tidy()'); + } + fn = nameOrFn; + } + else { + if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) { + throw new Error('When calling with two arguments, the first argument ' + + 'to tidy() must be a string'); + } + if (typeof fn !== 'function') { + throw new Error('When calling with two arguments, the 2nd argument ' + + 'to tidy() must be a function'); + } + name = nameOrFn; + } + var result; + return this.scopedRun(function () { return _this.startScope(name, gradMode); }, function () { return _this.endScope(result, gradMode); }, function () { + result = fn(); + if (result instanceof Promise) { + console.error('Cannot return a Promise inside of tidy.'); + } + return result; + }); + }; + Engine.prototype.scopedRun = function (start, end, f) { + start(); + try { + var res = f(); + end(); + return res; + } + catch (ex) { + end(); + throw ex; + } + }; + Engine.prototype.runKernel = function (forwardFunc, inputs, backwardsFunc) { + var _this = this; + var result; + var saved = []; + var saveFunc = function (x) { + saved.push(x); + return x; + }; + var scopeName = this.activeScope.name; + this.scopedRun(function () { return _this.customGradientDepth++; }, function () { return _this.customGradientDepth--; }, function () { + if (!_this.debugMode()) { + result = forwardFunc(_this.backend, saveFunc); + } + else { + result = _this.profiler.profileKernel(scopeName, function () { return forwardFunc(_this.backend, saveFunc); }); + } + }); + if (this.shouldRecord()) { + var tapeNode = { + id: this.nextTapeNodeId++, + name: scopeName, + inputs: inputs, + output: Array.isArray(result) ? result[0] : result + }; + if (backwardsFunc != null) { + tapeNode.gradient = + (function (dy) { return backwardsFunc(dy, saved); }); + } + this.activeTape.push(tapeNode); + } + return result; + }; + Engine.prototype.registerTensor = function (a) { + var refCount = this.refCounter.has(a.dataId) ? this.refCounter.get(a.dataId) : 0; + this.numTensors++; + if (refCount === 0) { + this.numDataBuffers++; + this.numBytes += + util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype); + this.backend.register(a.dataId, a.shape, a.dtype); + } + this.refCounter.set(a.dataId, refCount + 1); + if (!(a instanceof tensor_1.Variable)) { + this.track(a); + } + }; + Engine.prototype.registerVariable = function (v) { + if (this.registeredVariables[v.name] != null) { + throw new Error("Variable with name " + v.name + " was already registered"); + } + this.registeredVariables[v.name] = v; + }; + Engine.prototype.disposeTensor = function (a) { + if (!this.refCounter.has(a.dataId)) { + return; + } + if (this.keepTensors.has(a.id)) { + this.keepTensors.delete(a.id); + } + this.numTensors--; + var refCount = this.refCounter.get(a.dataId); + if (refCount <= 1) { + this.refCounter.delete(a.dataId); + this.backend.disposeData(a.dataId); + this.numDataBuffers--; + this.numBytes -= + util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype); + } + else { + this.refCounter.set(a.dataId, refCount - 1); + } + }; + Engine.prototype.disposeVariables = function () { + for (var varName in this.registeredVariables) { + var v = this.registeredVariables[varName]; + this.disposeTensor(v); + delete this.registeredVariables[varName]; + } + }; + Engine.prototype.memory = function () { + var info = this.backend.memory(); + info.numTensors = this.numTensors; + info.numDataBuffers = this.numDataBuffers; + info.numBytes = this.numBytes; + return info; + }; + Engine.prototype.shouldRecord = function () { + return this.activeTape != null && this.customGradientDepth === 0; + }; + Engine.prototype.addTapeNode = function (inputs, result, gradientsFunc) { + var inputsMap = {}; + inputs.forEach(function (input, idx) { + inputsMap[idx] = input; + }); + var gradient = function (dy) { + var res = gradientsFunc(dy); + var resMap = {}; + res.forEach(function (r, idx) { + resMap[idx] = function () { return r; }; + }); + return resMap; + }; + var tapeNode = { + id: this.nextTapeNodeId++, + name: this.activeScope.name, + inputs: inputsMap, + output: result, + gradient: gradient + }; + this.activeTape.push(tapeNode); + }; + Engine.prototype.keep = function (result) { + if (this.scopeStack.length === 1 && this.safeMode) { + throw new Error('Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' + + 'tf.tidy(() => {...}) to avoid memory leaks.'); + } + this.keepTensors.add(result.id); + return result; + }; + Engine.prototype.startScope = function (name, gradientsMode) { + if (gradientsMode === void 0) { gradientsMode = false; } + if (gradientsMode && this.gradientScopeCount === 0) { + this.activeTape = []; + } + if (gradientsMode) { + this.gradientScopeCount++; + } + var scopeInfo = { track: [], name: 'unnamed scope' }; + if (name) { + scopeInfo.name = name; + } + this.scopeStack.push(scopeInfo); + this.activeScope = scopeInfo; + }; + Engine.prototype.endScope = function (result, gradientsMode) { + var _this = this; + if (gradientsMode === void 0) { gradientsMode = false; } + if (gradientsMode) { + this.gradientScopeCount--; + if (this.gradientScopeCount === 0) { + this.activeTape = null; + } + } + var tensorsToKeep = new Set(this.keepTensors); + var tensorsToTrackInParent = tensor_util_1.getTensorsInContainer(result); + tensorsToTrackInParent.forEach(function (tensor) { return tensorsToKeep.add(tensor.id); }); + for (var i = 0; i < this.activeScope.track.length; i++) { + var tensor = this.activeScope.track[i]; + if (tensorsToKeep.has(tensor.id)) { + continue; + } + if (this.activeTape != null) { + tensorsToTrackInParent.push(tensor); + } + else { + tensor.dispose(); + } + } + var oldScope = this.scopeStack.pop(); + this.activeScope = this.scopeStack.length === 0 ? + { track: [], name: 'default scope' } : + this.scopeStack[this.scopeStack.length - 1]; + tensorsToTrackInParent.forEach(function (tensor) { + if (!_this.keepTensors.has(tensor.id) && + tensor_util_1.isTensorInList(tensor, oldScope.track)) { + _this.track(tensor); + } + }); + }; + Engine.prototype.gradients = function (f, xs, dy, allowNoGradients) { + var _this = this; + if (allowNoGradients === void 0) { allowNoGradients = false; } + util.assert(xs.length > 0, 'gradients() received an empty list of xs.'); + return this.tidy('gradients', function () { + var y = f(); + util.assert(y instanceof tensor_1.Tensor, 'The result y returned by f() must be a tensor.'); + var filteredTape = tape_1.getFilteredNodesXToY(_this.activeTape, xs, y); + if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) { + throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' + + 'that the f you passed encloses all operations that lead from x ' + + 'to y.'); + } + var accumulatedGradientMap = {}; + accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy; + tape_1.backpropagateGradients(accumulatedGradientMap, filteredTape); + var grads = xs.map(function (x) { return accumulatedGradientMap[x.id]; }); + return { value: y, grads: grads }; + }, true); + }; + Engine.prototype.customGrad = function (f) { + var _this = this; + util.assert(util.isFunction(f), 'The f passed in customGrad(f) must be a function.'); + return function () { + var inputs = []; + for (var _i = 0; _i < arguments.length; _i++) { + inputs[_i] = arguments[_i]; + } + util.assert(inputs.every(function (t) { return t instanceof tensor_1.Tensor; }), 'The args passed in customGrad(f)(x1, x2,...) must all be tensors'); + var gradientsFunc; + var result; + _this.scopedRun(function () { return _this.customGradientDepth++; }, function () { return _this.customGradientDepth--; }, function () { + var gradientsMode = true; + result = _this.tidy(f.name, function () { + var _a = f.apply(void 0, inputs), value = _a.value, gradFunc = _a.gradFunc; + util.assert(value instanceof tensor_1.Tensor, 'The function f passed in customGrad(f) must return an ' + + 'object where `obj.value` is a tensor'); + util.assert(util.isFunction(gradFunc), 'The function f passed in customGrad(f) must return an ' + + 'object where `obj.gradFunc` is a function.'); + gradientsFunc = gradFunc; + return value; + }, gradientsMode); + }); + if (_this.shouldRecord()) { + var gradFunc = function (dy) { + var res = gradientsFunc(dy); + var grads = Array.isArray(res) ? res : [res]; + util.assert(grads.length === inputs.length, 'The function f passed in customGrad(f) must return an object ' + + 'where `obj.gradFunc` is a function that returns the same ' + + 'number of tensors as inputs passed to f(...).'); + util.assert(grads.every(function (t) { return t instanceof tensor_1.Tensor; }), 'The function f passed in customGrad(f) must return an object ' + + 'where `obj.gradFunc` is a function that returns a list of ' + + 'only tensors.'); + return grads; + }; + _this.addTapeNode(inputs, result, gradFunc); + } + return result; + }; + }; + Engine.prototype.write = function (dataId, values) { + this.backend.write(dataId, values); + }; + Engine.prototype.readSync = function (dataId) { + return this.backend.readSync(dataId); + }; + Engine.prototype.read = function (dataId) { + return this.backend.read(dataId); + }; + Engine.prototype.fromPixels = function (pixels, numChannels) { + return this.backend.fromPixels(pixels, numChannels); + }; + Engine.prototype.time = function (query) { + return __awaiter(this, void 0, void 0, function () { + var start, timingInfo; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + start = util_1.now(); + return [4, this.backend.time(query)]; + case 1: + timingInfo = _a.sent(); + timingInfo.wallMs = util_1.now() - start; + return [2, timingInfo]; + } + }); + }); + }; + Engine.prototype.track = function (result) { + if (this.scopeStack.length === 1 && this.safeMode) { + throw new Error('Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' + + 'tf.tidy(() => {op();...}); to avoid memory leaks.'); + } + this.activeScope.track.push(result); + return result; + }; + return Engine; +}()); +exports.Engine = Engine; +function ones(shape) { + var values = util_1.makeOnesTypedArray(util_1.sizeFromShape(shape), 'float32'); + return tensor_1.Tensor.make(shape, { values: values }); +} +//# sourceMappingURL=engine.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine.js.map b/node_modules/@tensorflow/tfjs-core/dist/engine.js.map new file mode 100644 index 0000000..f315c3f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/engine.js.map @@ -0,0 +1 @@ +{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,uCAAoC;AACpC,+BAAgG;AAChG,mCAA4D;AAE5D,6CAAoE;AAEpE,6BAA+B;AAC/B,+BAA8D;AAyC9D;IAoBE,gBACY,OAAsB,EAAS,QAAiB,EAChD,SAAwB;QADxB,YAAO,GAAP,OAAO,CAAe;QAAS,aAAQ,GAAR,QAAQ,CAAS;QAChD,cAAS,GAAT,SAAS,CAAe;QApBpC,wBAAmB,GAAqB,EAAE,CAAC;QAEnC,eAAU,GAAG,IAAI,OAAO,EAAkB,CAAC;QAC3C,mBAAc,GAAG,CAAC,CAAC;QACnB,aAAQ,GAAG,CAAC,CAAC;QACb,eAAU,GAAG,CAAC,CAAC;QACf,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C;IACtD,CAAC;IACK,qBAAI,GAAV,UAAW,KAAiB;;;;;;wBACpB,KAAK,GAAG,UAAG,EAAE,CAAC;wBACD,WAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAA;;wBAA3C,UAAU,GAAG,SAA4C;wBAC/D,UAAU,CAAC,MAAM,GAAG,UAAG,EAAE,GAAG,KAAK,CAAC;wBAClC,WAAO,UAAU,EAAC;;;;KACnB;IAQO,sBAAK,GAAb,UAAgC,MAAS;QACvC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjD,MAAM,IAAI,KAAK,CACX,mEAAmE;gBACnE,mDAAmD,CAAC,CAAC;SAC1D;QACD,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC;IAChB,CAAC;IACH,aAAC;AAAD,CAAC,AAtaD,IAsaC;AAtaY,wBAAM;AAwanB,cAAc,KAAe;IAC3B,IAAM,MAAM,GAAG,yBAAkB,CAAC,oBAAa,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IACnE,OAAO,eAAM,CAAC,IAAI,CAAC,KAAK,EAAE,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACtC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/engine_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/engine_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine_test.js b/node_modules/@tensorflow/tfjs-core/dist/engine_test.js new file mode 100644 index 0000000..39f0fcc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/engine_test.js @@ -0,0 +1,275 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var jasmine_util_1 = require("./jasmine_util"); +var test_util_1 = require("./test_util"); +jasmine_util_1.describeWithFlags('fromPixels + regular math op', test_util_1.WEBGL_ENVS, function () { + it('debug mode does not error when no nans', function () { + var pixels = new ImageData(2, 2); + for (var i = 0; i < 8; i++) { + pixels.data[i] = 100; + } + for (var i = 8; i < 16; i++) { + pixels.data[i] = 250; + } + var a = tf.fromPixels(pixels, 4); + var b = tf.scalar(20, 'int32'); + var res = tf.add(a, b); + test_util_1.expectArraysEqual(res, [ + 120, 120, 120, 120, 120, 120, 120, 120, 270, 270, 270, 270, 270, 270, 270, + 270 + ]); + }); +}); +jasmine_util_1.describeWithFlags('gradients', test_util_1.ALL_ENVS, function () { + it('matmul + relu', function () { + var a = tf.tensor2d([-1, 2, -3, 10, -20, 30], [2, 3]); + var b = tf.tensor2d([2, -3, 4, -1, 2, -3], [3, 2]); + var _a = tf.grads(function (a, b) { + var m = tf.matMul(a, b); + var y = tf.relu(m); + return tf.sum(y); + })([a, b]), da = _a[0], db = _a[1]; + var dedm = tf.step(tf.matMul(a, b)); + expect(da.shape).toEqual(a.shape); + var transposeA = false; + var transposeB = true; + test_util_1.expectArraysClose(da, tf.matMul(dedm, b, transposeA, transposeB)); + expect(db.shape).toEqual(b.shape); + transposeA = true; + transposeB = false; + test_util_1.expectArraysClose(db, tf.matMul(a, dedm, transposeA, transposeB)); + }); + it('grad(f)', function () { + var grad = tf.grad(function (x) { return x.square(); }); + var result = grad(tf.tensor1d([.1, .2])); + test_util_1.expectArraysClose(result, [.2, .4]); + }); + it('calling grad(f) twice works', function () { + var grad = tf.grad(function (x) { return x.square(); }); + var result = grad(tf.tensor1d([.1, .2])); + var result2 = grad(tf.tensor1d([.1, .4])); + test_util_1.expectArraysClose(result, [.2, .4]); + test_util_1.expectArraysClose(result2, [.2, .8]); + }); + it('grads(f)', function () { + var grads = tf.grads(function (x) { return x.square(); }); + var result = grads([tf.tensor1d([.1, .2])]); + test_util_1.expectArraysClose(result[0], [.2, .4]); + }); + it('calling grads(f) twice works', function () { + var grads = tf.grads(function (x) { return x.square(); }); + var result = grads([tf.tensor1d([.1, .2])]); + var result2 = grads([tf.tensor1d([.1, .4])]); + test_util_1.expectArraysClose(result[0], [.2, .4]); + test_util_1.expectArraysClose(result2[0], [.2, .8]); + }); + it('works with reshape', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var exponent = tf.tensor1d([2, 2, 2, 2], 'int32'); + var da = tf.grad(function (a) { + var b = a.flatten(); + var m = tf.pow(b, exponent); + return tf.sum(m); + })(a); + expect(da.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(da, [2, 4, 6, 8]); + }); + it('reshape outside tf.grads() throws error', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var b = a.flatten(); + var exponent = tf.tensor1d([2, 2, 2, 2], 'int32'); + var f = function () { + tf.grads(function (a, b) { + var m = tf.pow(b, exponent); + return tf.sum(m); + })([a, b]); + }; + expect(f).toThrowError(); + }); + it('does not error if irrelevant (pruned) ops are missing grads', function () { + var a = tf.tensor1d([true, true], 'bool'); + var b = tf.tensor1d([false, true], 'bool'); + var da = tf.grad(function (a) { + a.logicalAnd(b); + return a.sum(); + })(a); + test_util_1.expectArraysClose(da, [1, 1]); + }); + it('errors if relevant ops are missing grads', function () { + var a = tf.tensor1d([true, true], 'bool'); + var b = tf.tensor1d([false, true], 'bool'); + var dfda = tf.grad(function (a) { + return a.logicalAnd(b); + }); + expect(function () { return dfda(a); }).toThrowError(); + }); + it('works with asType', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'int32'); + var exponent = tf.tensor2d([2, 2, 2, 2], [2, 2], 'int32'); + var da = tf.grad(function (a) { + var b = a.toFloat(); + var m = tf.pow(b, exponent); + return tf.sum(m); + })(a); + expect(da.shape).toEqual([2, 2]); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [2, 4, 6, 8]); + }); + it('asType outside of tf.grads() throws error', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'int32'); + var b = a.toFloat(); + var exponent = tf.tensor2d([2, 2, 2, 2], [2, 2], 'int32'); + var f = function () { + tf.grad(function (a) { + var m = tf.pow(b, exponent); + return tf.sum(m); + })(a); + }; + expect(f).toThrowError(); + }); +}); +jasmine_util_1.describeWithFlags('valueAndGradients', test_util_1.ALL_ENVS, function () { + it('matmul + relu', function () { + var a = tf.tensor2d([-1, 2, -3, 10, -20, 30], [2, 3]); + var b = tf.tensor2d([2, -3, 4, -1, 2, -3], [3, 2]); + var _a = tf.valueAndGrads(function (a, b) { + var m = tf.matMul(a, b); + var y = tf.relu(m); + return tf.sum(y); + })([a, b]), value = _a.value, grads = _a.grads; + test_util_1.expectNumbersClose(value.get(), 10); + var dedm = tf.step(tf.matMul(a, b)); + var da = grads[0], db = grads[1]; + var transposeA = false; + var transposeB = true; + test_util_1.expectArraysClose(da, tf.matMul(dedm, b, transposeA, transposeB)); + transposeA = true; + transposeB = false; + test_util_1.expectArraysClose(db, tf.matMul(a, dedm, transposeA, transposeB)); + }); + it('matmul + relu + inner tidy', function () { + var a = tf.tensor2d([-1, 2, -3, 10, -20, 30], [2, 3]); + var b = tf.tensor2d([2, -3, 4, -1, 2, -3], [3, 2]); + var _a = tf.valueAndGrads(function (a, b) { + var m = tf.matMul(a, b); + return tf.tidy(function () { + var y = tf.relu(m); + return tf.sum(y); + }); + })([a, b]), value = _a.value, grads = _a.grads; + test_util_1.expectNumbersClose(value.get(), 10); + var dedm = tf.step(tf.matMul(a, b)); + var da = grads[0], db = grads[1]; + var transposeA = false; + var transposeB = true; + test_util_1.expectArraysClose(da, tf.matMul(dedm, b, transposeA, transposeB)); + transposeA = true; + transposeB = false; + test_util_1.expectArraysClose(db, tf.matMul(a, dedm, transposeA, transposeB)); + }); +}); +jasmine_util_1.describeWithFlags('higher-order gradients', test_util_1.ALL_ENVS, function () { + it('grad(grad(f))', function () { + var gradgrad = tf.grad(tf.grad(function (x) { return x.mul(x).mul(x); })); + var result = gradgrad(tf.tensor1d([.1, .2])); + test_util_1.expectArraysClose(result, [.6, 1.2]); + }); + it('grads(grads(f))', function () { + var grads = tf.grads(function (x) { return x.mul(x).mul(x); }); + var gradsgrads = tf.grads(function (x) { return grads([x])[0]; }); + var result = gradsgrads([tf.tensor1d([.1, .2])]); + test_util_1.expectArraysClose(result[0], [.6, 1.2]); + }); +}); +jasmine_util_1.describeWithFlags('customGradient', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.scalar(3); + var b = tf.scalar(2, 'int32'); + var dy = tf.scalar(4); + var customPow = tf.customGrad(function (a) { + var value = tf.pow(a, b); + var gradFunc = function (dy) { return dy.mul(tf.scalar(0.1)); }; + return { value: value, gradFunc: gradFunc }; + }); + var _a = tf.valueAndGrad(function (a) { return customPow(a); })(a, dy), value = _a.value, grad = _a.grad; + expect(value.shape).toEqual(a.shape); + test_util_1.expectArraysClose(value, [9]); + expect(grad.shape).toEqual(a.shape); + test_util_1.expectArraysClose(grad, [.4]); + }); + it('second order derivative through customGradient', function () { + var a = tf.scalar(3); + var b = tf.scalar(2, 'int32'); + var dy = tf.scalar(5); + var customPow = tf.customGrad(function (a) { + var value = tf.pow(a, b); + var gradFunc = function (dy) { return dy.mul(a); }; + return { value: value, gradFunc: gradFunc }; + }); + var dda = tf.grad(tf.grad(function (a) { return customPow(a); }))(a, dy); + expect(dda.shape).toEqual(a.shape); + test_util_1.expectArraysClose(dda, dy); + }); + it('calling gradient of custom op twice works', function () { + var customOp = tf.customGrad(function (x) { + return { value: x.square(), gradFunc: function (dy) { return dy.mul(x.abs()); } }; + }); + var x = tf.tensor1d([-1, -2, 3]); + var grad = tf.grad(function (x) { return customOp(x); }); + test_util_1.expectArraysClose(grad(x), [1, 2, 3]); + test_util_1.expectArraysClose(grad(x), [1, 2, 3]); + }); +}); +jasmine_util_1.describeWithFlags('memory', test_util_1.ALL_ENVS, function () { + it('Sum(float)', function () { + expect(tf.memory().numTensors).toBe(0); + expect(tf.memory().numBytes).toBe(0); + var sum = tf.tidy(function () { + var a = tf.tensor1d([1, 2, 3, 4]); + expect(tf.memory().numTensors).toBe(1); + expect(tf.memory().numBytes).toBe(4 * 4); + return a.sum(); + }); + expect(tf.memory().numTensors).toBe(1); + expect(tf.memory().numBytes).toBe(4); + test_util_1.expectArraysClose(sum, [1 + 2 + 3 + 4]); + }); + it('Sum(bool)', function () { + var sum = tf.tidy(function () { + var a = tf.tensor1d([true, true, false, true], 'bool'); + expect(tf.memory().numTensors).toBe(1); + expect(tf.memory().numBytes).toBe(4); + return a.sum(); + }); + expect(tf.memory().numTensors).toBe(1); + expect(tf.memory().numBytes).toBe(4); + expect(sum.dtype).toBe('int32'); + test_util_1.expectArraysClose(sum, [1 + 1 + 0 + 1]); + }); + it('Sum(int32)', function () { + var sum = tf.tidy(function () { + var a = tf.tensor1d([1, 1, 0, 1], 'int32'); + expect(tf.memory().numTensors).toBe(1); + expect(tf.memory().numBytes).toBe(4 * 4); + return a.sum(); + }); + expect(tf.memory().numTensors).toBe(1); + expect(tf.memory().numBytes).toBe(4); + expect(sum.dtype).toBe('int32'); + test_util_1.expectArraysClose(sum, [1 + 1 + 0 + 1]); + }); +}); +jasmine_util_1.describeWithFlags('disposeVariables', test_util_1.ALL_ENVS, function () { + it('reuse same name variable', function () { + tf.tensor1d([1, 2, 3]).variable(true, 'v1'); + tf.tensor1d([1, 2, 3]).variable(true, 'v2'); + expect(function () { + tf.tensor1d([1, 2, 3]).variable(true, 'v1'); + }).toThrowError(); + tf.disposeVariables(); + tf.tensor1d([1, 2, 3]).variable(true, 'v1'); + tf.tensor1d([1, 2, 3]).variable(true, 'v2'); + }); +}); +//# sourceMappingURL=engine_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/engine_test.js.map new file mode 100644 index 0000000..1a2c259 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/engine_test.js.map @@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CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,6BAAiB,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,gCAAiB,CAAC,kBAAkB,EAAE,oBAAQ,EAAE;IAC9C,EAAE,CAAC,0BAA0B,EAAE;QAC7B,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5C,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5C,MAAM,CAAC;YACL,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;QAClB,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACtB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5C,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts b/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts new file mode 100644 index 0000000..b7a032a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts @@ -0,0 +1,35 @@ +import { Engine, MemoryInfo, ScopeFn, TimingInfo } from './engine'; +import { Features } from './environment_util'; +import { KernelBackend } from './kernels/backend'; +import { Tensor, TensorTracker } from './tensor'; +import { TensorContainer } from './tensor_types'; +export declare class Environment { + private features; + private globalEngine; + private registry; + backendName: string; + backend: KernelBackend; + constructor(features?: Features); + static setBackend(backendName: string, safeMode?: boolean): void; + static getBackend(): string; + static disposeVariables(): void; + static memory(): MemoryInfo; + static tidy(nameOrFn: string | ScopeFn, fn?: ScopeFn, gradMode?: boolean): T; + static dispose(container: TensorContainer): void; + static keep(result: T): T; + static time(f: () => void): Promise; + get(feature: K): Features[K]; + getFeatures(): Features; + set(feature: K, value: Features[K]): void; + private getBestBackendName; + private evaluateFeature; + setFeatures(features: Features): void; + reset(): void; + private initBackend; + findBackend(name: string): KernelBackend; + registerBackend(name: string, factory: () => KernelBackend, priority?: number, setTensorTrackerFn?: (f: () => TensorTracker) => void): boolean; + removeBackend(name: string): void; + readonly engine: Engine; + private initDefaultBackend; +} +export declare let ENV: Environment; diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment.js b/node_modules/@tensorflow/tfjs-core/dist/environment.js new file mode 100644 index 0000000..2f60d1c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/environment.js @@ -0,0 +1,233 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var device_util = require("./device_util"); +var engine_1 = require("./engine"); +var environment_util_1 = require("./environment_util"); +var tensor_1 = require("./tensor"); +var tensor_util_1 = require("./tensor_util"); +var TEST_EPSILON_FLOAT32_ENABLED = 1e-3; +var TEST_EPSILON_FLOAT32_DISABLED = 1e-1; +var Environment = (function () { + function Environment(features) { + this.features = {}; + this.registry = {}; + if (features != null) { + this.features = features; + } + if (this.get('DEBUG')) { + console.warn('Debugging mode is ON. The output of every math call will ' + + 'be downloaded to CPU and checked for NaNs. ' + + 'This significantly impacts performance.'); + } + } + Environment.setBackend = function (backendName, safeMode) { + if (safeMode === void 0) { safeMode = false; } + if (!(backendName in exports.ENV.registry)) { + throw new Error("Backend name '" + backendName + "' not found in registry"); + } + exports.ENV.initBackend(backendName, safeMode); + }; + Environment.getBackend = function () { + exports.ENV.initDefaultBackend(); + return exports.ENV.backendName; + }; + Environment.disposeVariables = function () { + exports.ENV.engine.disposeVariables(); + }; + Environment.memory = function () { + return exports.ENV.engine.memory(); + }; + Environment.tidy = function (nameOrFn, fn, gradMode) { + if (gradMode === void 0) { gradMode = false; } + return exports.ENV.engine.tidy(nameOrFn, fn, gradMode); + }; + Environment.dispose = function (container) { + var tensors = tensor_util_1.getTensorsInContainer(container); + tensors.forEach(function (tensor) { return tensor.dispose(); }); + }; + Environment.keep = function (result) { + return exports.ENV.engine.keep(result); + }; + Environment.time = function (f) { + return exports.ENV.engine.time(f); + }; + Environment.prototype.get = function (feature) { + if (feature in this.features) { + return this.features[feature]; + } + this.features[feature] = this.evaluateFeature(feature); + return this.features[feature]; + }; + Environment.prototype.getFeatures = function () { + return this.features; + }; + Environment.prototype.set = function (feature, value) { + this.features[feature] = value; + }; + Environment.prototype.getBestBackendName = function () { + var _this = this; + if (Object.keys(this.registry).length === 0) { + throw new Error('No backend found in registry.'); + } + var sortedBackends = Object.keys(this.registry) + .map(function (name) { + return { name: name, entry: _this.registry[name] }; + }) + .sort(function (a, b) { + return b.entry.priority - a.entry.priority; + }); + return sortedBackends[0].name; + }; + Environment.prototype.evaluateFeature = function (feature) { + if (feature === 'DEBUG') { + return false; + } + else if (feature === 'IS_BROWSER') { + return typeof window !== 'undefined'; + } + else if (feature === 'IS_NODE') { + return (typeof process !== 'undefined') && + (typeof process.versions.node !== 'undefined'); + } + else if (feature === 'IS_CHROME') { + return environment_util_1.isChrome(); + } + else if (feature === 'IS_TEST') { + return false; + } + else if (feature === 'BACKEND') { + return this.getBestBackendName(); + } + else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') { + var webGLVersion = this.get('WEBGL_VERSION'); + if (webGLVersion === 0) { + return 0; + } + if (webGLVersion > 0) { + return 0; + } + return environment_util_1.getWebGLDisjointQueryTimerVersion(webGLVersion, this.get('IS_BROWSER')); + } + else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE') { + return this.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0 && + !device_util.isMobile(); + } + else if (feature === 'HAS_WEBGL') { + return this.get('WEBGL_VERSION') > 0; + } + else if (feature === 'WEBGL_VERSION') { + if (environment_util_1.isWebGLVersionEnabled(2, this.get('IS_BROWSER'))) { + return 2; + } + else if (environment_util_1.isWebGLVersionEnabled(1, this.get('IS_BROWSER'))) { + return 1; + } + return 0; + } + else if (feature === 'WEBGL_RENDER_FLOAT32_ENABLED') { + return environment_util_1.isRenderToFloatTextureEnabled(this.get('WEBGL_VERSION'), this.get('IS_BROWSER')); + } + else if (feature === 'WEBGL_DOWNLOAD_FLOAT_ENABLED') { + return environment_util_1.isDownloadFloatTextureEnabled(this.get('WEBGL_VERSION'), this.get('IS_BROWSER')); + } + else if (feature === 'WEBGL_FENCE_API_ENABLED') { + return environment_util_1.isWebGLFenceEnabled(this.get('WEBGL_VERSION'), this.get('IS_BROWSER')); + } + else if (feature === 'TEST_EPSILON') { + if (this.get('WEBGL_RENDER_FLOAT32_ENABLED')) { + return TEST_EPSILON_FLOAT32_ENABLED; + } + return TEST_EPSILON_FLOAT32_DISABLED; + } + throw new Error("Unknown feature " + feature + "."); + }; + Environment.prototype.setFeatures = function (features) { + this.features = Object.assign({}, features); + }; + Environment.prototype.reset = function () { + this.features = environment_util_1.getFeaturesFromURL(); + if (this.globalEngine != null) { + this.globalEngine = null; + } + }; + Environment.prototype.initBackend = function (backendName, safeMode) { + var _this = this; + if (safeMode === void 0) { safeMode = false; } + this.backendName = backendName; + this.backend = this.findBackend(backendName); + this.globalEngine = + new engine_1.Engine(this.backend, safeMode, function () { return _this.get('DEBUG'); }); + }; + Environment.prototype.findBackend = function (name) { + if (!(name in this.registry)) { + return null; + } + return this.registry[name].backend; + }; + Environment.prototype.registerBackend = function (name, factory, priority, setTensorTrackerFn) { + var _this = this; + if (priority === void 0) { priority = 1; } + if (name in this.registry) { + console.warn(name + " backend was already registered. Reusing existing backend"); + if (setTensorTrackerFn != null) { + setTensorTrackerFn(function () { return _this.engine; }); + } + return false; + } + try { + var backend = factory(); + this.registry[name] = { backend: backend, priority: priority }; + return true; + } + catch (err) { + console.warn("Registration of backend " + name + " failed"); + console.warn(err.stack || err.message); + return false; + } + }; + Environment.prototype.removeBackend = function (name) { + if (!(name in this.registry)) { + throw new Error(name + " backend not found in registry"); + } + this.registry[name].backend.dispose(); + delete this.registry[name]; + }; + Object.defineProperty(Environment.prototype, "engine", { + get: function () { + this.initDefaultBackend(); + return this.globalEngine; + }, + enumerable: true, + configurable: true + }); + Environment.prototype.initDefaultBackend = function () { + if (this.globalEngine == null) { + this.initBackend(this.get('BACKEND'), false); + } + }; + return Environment; +}()); +exports.Environment = Environment; +function getGlobalNamespace() { + var ns; + if (typeof (window) !== 'undefined') { + ns = window; + } + else if (typeof (process) !== 'undefined') { + ns = process; + } + else { + throw new Error('Could not find a global object'); + } + return ns; +} +function getOrMakeEnvironment() { + var ns = getGlobalNamespace(); + if (ns.ENV == null) { + ns.ENV = new Environment(environment_util_1.getFeaturesFromURL()); + tensor_1.setTensorTracker(function () { return ns.ENV.engine; }); + } + return ns.ENV; +} +exports.ENV = getOrMakeEnvironment(); +//# sourceMappingURL=environment.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment.js.map b/node_modules/@tensorflow/tfjs-core/dist/environment.js.map new file mode 100644 index 0000000..6e59cf5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/environment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;AAiBA,2CAA6C;AAC7C,mCAAiE;AACjE,uDAAuN;AAEvN,mCAAiE;AAEjE,6CA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C,EAAE,GAAG,OAAO,CAAC;KACd;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;KACnD;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;IACE,IAAM,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAChC,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI,EAAE;QAClB,EAAE,CAAC,GAAG,GAAG,IAAI,WAAW,CAAC,qCAAkB,EAAE,CAAC,CAAC;QAC/C,yBAAgB,CAAC,cAAM,OAAA,EAAE,CAAC,GAAG,CAAC,MAAM,EAAb,CAAa,CAAC,CAAC;KACvC;IACD,OAAO,EAAE,CAAC,GAAG,CAAC;AAChB,CAAC;AAEU,QAAA,GAAG,GAAG,oBAAoB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/environment_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/environment_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_test.js b/node_modules/@tensorflow/tfjs-core/dist/environment_test.js new file mode 100644 index 0000000..85bdb0f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/environment_test.js @@ -0,0 +1,219 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var device_util = require("./device_util"); +var environment_1 = require("./environment"); +var environment_util_1 = require("./environment_util"); +var jasmine_util_1 = require("./jasmine_util"); +var backend_cpu_1 = require("./kernels/backend_cpu"); +var backend_webgl_1 = require("./kernels/backend_webgl"); +var test_util_1 = require("./test_util"); +jasmine_util_1.describeWithFlags('disjoint query timer enabled', test_util_1.WEBGL_ENVS, function () { + afterEach(function () { + environment_1.ENV.reset(); + }); + it('no webgl', function () { + environment_1.ENV.setFeatures({ 'WEBGL_VERSION': 0 }); + expect(environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')).toBe(0); + }); + it('webgl 1', function () { + var features = { 'WEBGL_VERSION': 1 }; + spyOn(document, 'createElement').and.returnValue({ + getContext: function (context) { + if (context === 'webgl' || context === 'experimental-webgl') { + return { + getExtension: function (extensionName) { + if (extensionName === 'EXT_disjoint_timer_query') { + return {}; + } + else if (extensionName === 'WEBGL_lose_context') { + return { loseContext: function () { } }; + } + return null; + } + }; + } + return null; + } + }); + environment_1.ENV.setFeatures(features); + expect(environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')).toBe(0); + }); + it('webgl 2', function () { + var features = { 'WEBGL_VERSION': 2 }; + spyOn(document, 'createElement').and.returnValue({ + getContext: function (context) { + if (context === 'webgl2') { + return { + getExtension: function (extensionName) { + if (extensionName === 'EXT_disjoint_timer_query_webgl2') { + return {}; + } + else if (extensionName === 'WEBGL_lose_context') { + return { loseContext: function () { } }; + } + return null; + } + }; + } + return null; + } + }); + environment_1.ENV.setFeatures(features); + expect(environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')).toBe(0); + }); +}); +jasmine_util_1.describeWithFlags('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE', test_util_1.WEBGL_ENVS, function () { + afterEach(function () { + environment_1.ENV.reset(); + }); + it('disjoint query timer disabled', function () { + var features = { 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION': 0 }; + var env = new environment_1.Environment(features); + expect(env.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE')) + .toBe(false); + }); + it('disjoint query timer enabled, mobile', function () { + var features = { 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION': 1 }; + spyOn(device_util, 'isMobile').and.returnValue(true); + var env = new environment_1.Environment(features); + expect(env.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE')) + .toBe(false); + }); + it('disjoint query timer enabled, not mobile', function () { + var features = { 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION': 1 }; + spyOn(device_util, 'isMobile').and.returnValue(false); + var env = new environment_1.Environment(features); + expect(env.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE')) + .toBe(true); + }); +}); +jasmine_util_1.describeWithFlags('WEBGL_FENCE_API_ENABLED', test_util_1.WEBGL_ENVS, function () { + afterEach(function () { + environment_1.ENV.reset(); + }); + beforeEach(function () { + spyOn(document, 'createElement').and.returnValue({ + getContext: function (context) { + if (context === 'webgl2') { + return { + getExtension: function (extensionName) { + if (extensionName === 'WEBGL_get_buffer_sub_data_async') { + return {}; + } + else if (extensionName === 'WEBGL_lose_context') { + return { loseContext: function () { } }; + } + return null; + }, + fenceSync: function () { return 1; } + }; + } + return null; + } + }); + }); + it('WebGL 2 enabled', function () { + var features = { 'WEBGL_VERSION': 2 }; + var env = new environment_1.Environment(features); + expect(env.get('WEBGL_FENCE_API_ENABLED')).toBe(true); + }); + it('WebGL 1 disabled', function () { + var features = { 'WEBGL_VERSION': 1 }; + var env = new environment_1.Environment(features); + expect(env.get('WEBGL_FENCE_API_ENABLED')).toBe(false); + }); +}); +jasmine_util_1.describeWithFlags('WebGL version', test_util_1.WEBGL_ENVS, function () { + afterEach(function () { + environment_1.ENV.reset(); + }); + it('webgl 1', function () { + spyOn(document, 'createElement').and.returnValue({ + getContext: function (context) { + if (context === 'webgl') { + return { + getExtension: function (a) { + return { loseContext: function () { } }; + } + }; + } + return null; + } + }); + var env = new environment_1.Environment(); + expect(env.get('WEBGL_VERSION')).toBe(1); + }); + it('webgl 2', function () { + spyOn(document, 'createElement').and.returnValue({ + getContext: function (context) { + if (context === 'webgl2') { + return { + getExtension: function (a) { + return { loseContext: function () { } }; + } + }; + } + return null; + } + }); + var env = new environment_1.Environment(); + expect(env.get('WEBGL_VERSION')).toBe(2); + }); + it('no webgl', function () { + spyOn(document, 'createElement').and.returnValue({ + getContext: function (context) { return null; } + }); + var env = new environment_1.Environment(); + expect(env.get('WEBGL_VERSION')).toBe(0); + }); +}); +describe('Backend', function () { + beforeAll(function () { + spyOn(console, 'warn'); + }); + afterEach(function () { + environment_1.ENV.reset(); + }); + it('custom cpu registration', function () { + var backend; + environment_1.ENV.registerBackend('custom-cpu', function () { + backend = new backend_cpu_1.MathBackendCPU(); + return backend; + }); + expect(environment_1.ENV.findBackend('custom-cpu')).toBe(backend); + environment_1.Environment.setBackend('custom-cpu'); + expect(environment_1.ENV.backend).toBe(backend); + environment_1.ENV.removeBackend('custom-cpu'); + }); + it('webgl not supported, falls back to cpu', function () { + environment_1.ENV.setFeatures({ 'WEBGL_VERSION': 0 }); + var cpuBackend; + environment_1.ENV.registerBackend('custom-cpu', function () { + cpuBackend = new backend_cpu_1.MathBackendCPU(); + return cpuBackend; + }, 103); + var success = environment_1.ENV.registerBackend('custom-webgl', function () { return new backend_webgl_1.MathBackendWebGL(); }, 104); + expect(success).toBe(false); + expect(environment_1.ENV.findBackend('custom-webgl') == null).toBe(true); + expect(environment_1.Environment.getBackend()).toBe('custom-cpu'); + expect(environment_1.ENV.backend).toBe(cpuBackend); + environment_1.ENV.removeBackend('custom-cpu'); + }); + it('default custom background null', function () { + expect(environment_1.ENV.findBackend('custom')).toBeNull(); + }); + it('allow custom backend', function () { + var backend = new backend_cpu_1.MathBackendCPU(); + var success = environment_1.ENV.registerBackend('custom', function () { return backend; }); + expect(success).toBeTruthy(); + expect(environment_1.ENV.findBackend('custom')).toEqual(backend); + environment_1.ENV.removeBackend('custom'); + }); +}); +describe('environment_util.getQueryParams', function () { + it('basic', function () { + expect(environment_util_1.getQueryParams('?a=1&b=hi&f=animal')) + .toEqual({ 'a': '1', 'b': 'hi', 'f': 'animal' }); + }); +}); +//# sourceMappingURL=environment_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/environment_test.js.map new file mode 100644 index 0000000..3f4c815 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/environment_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"environment_test.js","sourceRoot":"","sources":["../src/environment_test.ts"],"names":[],"mappings":";;AAiBA,2CAA6C;AAC7C,6CAA+C;AAC/C,uDAA4D;AAC5D,+CAAiD;AAEjD,qDAAqD;AACrD,yDAAyD;AACzD,yCAAuC;AAEvC,gCAAiB,CAAC,8BAA8B,EAAE,sBAAU,EAAE;IAC5D,SAAS,CAAC;QACR,iBAAG,CAAC,KAAK,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,UAAU,EAAE;QACb,iBAAG,CAAC,WAAW,CAAC,EAAC,eAAe,EAAE,CAAC,EAAC,CAAC,CAAC;QACtC,MAAM,CAAC,iBAAG,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,SAAS,EAAE;QACZ,IAAM,QAAQ,GAAa,EAAC,eAAe,EAAE,CAAC,EAAC,CAAC;QAEhD,KAAK,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC;YAC/C,UAAU,EAAE,UAAC,OAAe;gBAC1B,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,oBAAoB,EAAE;oBAC3D,OAAO;wBACL,YAAY,EAAE,UAAC,aAAqB;4BAClC,IAAI,aAAa,KAAK,0BAA0B,EAAE;gCAChD,OAAO,EAAE,CAAC;6BACX;iCAAM,IAAI,aAAa,KAAK,oBAAoB,EAAE;gCACjD,OAAO,EAAC,WAAW,EAAE,cAAO,CAAC,EAAC,CAAC;6BAChC;4BACD,OAAO,IAAI,CAAC;wBACd,CAAC;qBACF,CAAC;iBACH;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CAAC;QAEH,iBAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAG1B,MAAM,CAAC,iBAA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AAM,CAAC,yBAAW,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACpD,MAAM,CAAC,iBAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAErC,iBAAG,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE;QACnC,MAAM,CAAC,iBAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACzB,IAAM,OAAO,GAAG,IAAI,4BAAc,EAAE,CAAC;QACrC,IAAM,OAAO,GAAG,iBAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAM,OAAA,OAAO,EAAP,CAAO,CAAC,CAAC;QAC7D,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;QAC7B,MAAM,CAAC,iBAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACnD,iBAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,iCAAiC,EAAE;IAC1C,EAAE,CAAC,OAAO,EAAE;QACV,MAAM,CAAC,iCAAc,CAAC,oBAAoB,CAAC,CAAC;aACvC,OAAO,CAAC,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/environment_util.d.ts new file mode 100644 index 0000000..0097622 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/environment_util.d.ts @@ -0,0 +1,36 @@ +export interface Features { + 'DEBUG'?: boolean; + 'IS_BROWSER'?: boolean; + 'IS_NODE'?: boolean; + 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'?: number; + 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE'?: boolean; + 'WEBGL_VERSION'?: number; + 'HAS_WEBGL'?: boolean; + 'WEBGL_RENDER_FLOAT32_ENABLED'?: boolean; + 'WEBGL_DOWNLOAD_FLOAT_ENABLED'?: boolean; + 'WEBGL_FENCE_API_ENABLED'?: boolean; + 'BACKEND'?: string; + 'TEST_EPSILON'?: number; + 'IS_CHROME'?: boolean; + 'IS_TEST'?: boolean; +} +export declare enum Type { + NUMBER = 0, + BOOLEAN = 1, + STRING = 2 +} +export declare const URL_PROPERTIES: URLProperty[]; +export interface URLProperty { + name: keyof Features; + type: Type; +} +export declare function isWebGLVersionEnabled(webGLVersion: 1 | 2, isBrowser: boolean): boolean; +export declare function getWebGLDisjointQueryTimerVersion(webGLVersion: number, isBrowser: boolean): number; +export declare function isRenderToFloatTextureEnabled(webGLVersion: number, isBrowser: boolean): boolean; +export declare function isDownloadFloatTextureEnabled(webGLVersion: number, isBrowser: boolean): boolean; +export declare function isWebGLFenceEnabled(webGLVersion: number, isBrowser: boolean): boolean; +export declare function isChrome(): boolean; +export declare function getFeaturesFromURL(): Features; +export declare function getQueryParams(queryString: string): { + [key: string]: string; +}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_util.js b/node_modules/@tensorflow/tfjs-core/dist/environment_util.js new file mode 100644 index 0000000..73ebb5d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/environment_util.js @@ -0,0 +1,200 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Type; +(function (Type) { + Type[Type["NUMBER"] = 0] = "NUMBER"; + Type[Type["BOOLEAN"] = 1] = "BOOLEAN"; + Type[Type["STRING"] = 2] = "STRING"; +})(Type = exports.Type || (exports.Type = {})); +exports.URL_PROPERTIES = [ + { name: 'DEBUG', type: Type.BOOLEAN }, { name: 'IS_BROWSER', type: Type.BOOLEAN }, + { name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION', type: Type.NUMBER }, + { name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE', type: Type.BOOLEAN }, + { name: 'WEBGL_VERSION', type: Type.NUMBER }, + { name: 'WEBGL_RENDER_FLOAT32_ENABLED', type: Type.BOOLEAN }, + { name: 'WEBGL_DOWNLOAD_FLOAT_ENABLED', type: Type.BOOLEAN }, + { name: 'WEBGL_FENCE_API_ENABLED', type: Type.BOOLEAN }, + { name: 'BACKEND', type: Type.STRING } +]; +function isWebGLVersionEnabled(webGLVersion, isBrowser) { + var gl; + try { + gl = getWebGLRenderingContext(webGLVersion, isBrowser); + } + catch (e) { + return false; + } + if (gl != null) { + loseContext(gl); + return true; + } + return false; +} +exports.isWebGLVersionEnabled = isWebGLVersionEnabled; +function getWebGLDisjointQueryTimerVersion(webGLVersion, isBrowser) { + if (webGLVersion === 0) { + return 0; + } + var queryTimerVersion; + var gl = getWebGLRenderingContext(webGLVersion, isBrowser); + if (hasExtension(gl, 'EXT_disjoint_timer_query_webgl2') && + webGLVersion === 2) { + queryTimerVersion = 2; + } + else if (hasExtension(gl, 'EXT_disjoint_timer_query')) { + queryTimerVersion = 1; + } + else { + queryTimerVersion = 0; + } + if (gl != null) { + loseContext(gl); + } + return queryTimerVersion; +} +exports.getWebGLDisjointQueryTimerVersion = getWebGLDisjointQueryTimerVersion; +function isRenderToFloatTextureEnabled(webGLVersion, isBrowser) { + if (webGLVersion === 0) { + return false; + } + var gl = getWebGLRenderingContext(webGLVersion, isBrowser); + if (webGLVersion === 1) { + if (!hasExtension(gl, 'OES_texture_float')) { + return false; + } + } + else { + if (!hasExtension(gl, 'EXT_color_buffer_float')) { + return false; + } + } + createFloatTextureAndBindToFramebuffer(gl, webGLVersion); + var isFrameBufferComplete = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE; + loseContext(gl); + return isFrameBufferComplete; +} +exports.isRenderToFloatTextureEnabled = isRenderToFloatTextureEnabled; +function isDownloadFloatTextureEnabled(webGLVersion, isBrowser) { + if (webGLVersion === 0) { + return false; + } + var gl = getWebGLRenderingContext(webGLVersion, isBrowser); + if (webGLVersion === 1) { + if (!hasExtension(gl, 'OES_texture_float')) { + return false; + } + } + else { + if (!hasExtension(gl, 'EXT_color_buffer_float')) { + return false; + } + } + createFloatTextureAndBindToFramebuffer(gl, webGLVersion); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, new Float32Array(4)); + var readPixelsNoError = gl.getError() === gl.NO_ERROR; + loseContext(gl); + return readPixelsNoError; +} +exports.isDownloadFloatTextureEnabled = isDownloadFloatTextureEnabled; +function isWebGLFenceEnabled(webGLVersion, isBrowser) { + if (webGLVersion !== 2) { + return false; + } + var gl = getWebGLRenderingContext(webGLVersion, isBrowser); + var isEnabled = gl.fenceSync != null; + loseContext(gl); + return isEnabled; +} +exports.isWebGLFenceEnabled = isWebGLFenceEnabled; +function isChrome() { + return typeof navigator !== 'undefined' && navigator != null && + navigator.userAgent != null && /Chrome/.test(navigator.userAgent) && + /Google Inc/.test(navigator.vendor); +} +exports.isChrome = isChrome; +var TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags'; +function getFeaturesFromURL() { + var features = {}; + if (typeof window === 'undefined' || typeof window.location === 'undefined') { + return features; + } + var urlParams = getQueryParams(window.location.search); + if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) { + var urlFlags_1 = {}; + var keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(','); + keyValues.forEach(function (keyValue) { + var _a = keyValue.split(':'), key = _a[0], value = _a[1]; + urlFlags_1[key] = value; + }); + exports.URL_PROPERTIES.forEach(function (urlProperty) { + if (urlProperty.name in urlFlags_1) { + console.log("Setting feature override from URL " + urlProperty.name + ": " + + ("" + urlFlags_1[urlProperty.name])); + if (urlProperty.type === Type.NUMBER) { + features[urlProperty.name] = +urlFlags_1[urlProperty.name]; + } + else if (urlProperty.type === Type.BOOLEAN) { + features[urlProperty.name] = urlFlags_1[urlProperty.name] === 'true'; + } + else if (urlProperty.type === Type.STRING) { + features[urlProperty.name] = urlFlags_1[urlProperty.name]; + } + else { + console.warn("Unknown URL param: " + urlProperty.name + "."); + } + } + }); + } + return features; +} +exports.getFeaturesFromURL = getFeaturesFromURL; +function hasExtension(gl, extensionName) { + var ext = gl.getExtension(extensionName); + return ext != null; +} +function getWebGLRenderingContext(webGLVersion, isBrowser) { + if (webGLVersion === 0 || !isBrowser) { + throw new Error('Cannot get WebGL rendering context, WebGL is disabled.'); + } + var tempCanvas = document.createElement('canvas'); + if (webGLVersion === 1) { + return (tempCanvas.getContext('webgl') || + tempCanvas.getContext('experimental-webgl')); + } + return tempCanvas.getContext('webgl2'); +} +function loseContext(gl) { + if (gl != null) { + var loseContextExtension = gl.getExtension('WEBGL_lose_context'); + if (loseContextExtension == null) { + throw new Error('Extension WEBGL_lose_context not supported on this browser.'); + } + loseContextExtension.loseContext(); + } +} +function createFloatTextureAndBindToFramebuffer(gl, webGLVersion) { + var frameBuffer = gl.createFramebuffer(); + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + var internalFormat = webGLVersion === 2 ? gl.RGBA32F : gl.RGBA; + gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null); + gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); +} +function getQueryParams(queryString) { + var params = {}; + queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, function (s) { + var t = []; + for (var _i = 1; _i < arguments.length; _i++) { + t[_i - 1] = arguments[_i]; + } + decodeParam(params, t[0], t[1]); + return t.join('='); + }); + return params; +} +exports.getQueryParams = getQueryParams; +function decodeParam(params, name, value) { + params[decodeURIComponent(name)] = decodeURIComponent(value || ''); +} +//# sourceMappingURL=environment_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/environment_util.js.map new file mode 100644 index 0000000..032419f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/environment_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"environment_util.js","sourceRoot":"","sources":["../src/environment_util.ts"],"names":[],"mappings":";;AAuDA,IAAY,IAIX;AAJD,WAAY,IAAI;IACd,mCAAM,CAAA;IACN,qCAAO,CAAA;IACP,mCAAM,CAAA;AACR,CAAC,EAJW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAIf;AAEY,QAAA,cAAc,GAAkB;IAC3C,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC;IAC7E,EAAC,IAAI,EAAE,8CAA8C,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAC;IACzE,EAAC,IAAI,EAAE,+CAA+C,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC;IAC3E,EAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAC;IAC1C,EAAC,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC;IAC1D,EAAC,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC;IAC1D,EAAC,IAAI,EAAE,yBAAyB,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC;IACrD,EAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAC;CACrC,CAAC;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AE,WAAI;aAAJ,UAAI,EAAJ,qBAAI,EAAJ,IAAI;YAAJ,0BAAI;;QACzD,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAPD,wCAOC;AAED,qBACI,MAA+B,EAAE,IAAY,EAAE,KAAc;IAC/D,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,GAAG,kBAAkB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts b/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts new file mode 100644 index 0000000..a603763 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts @@ -0,0 +1,6 @@ +import { Environment } from './environment'; +export { customGrad, grad, grads, valueAndGrad, valueAndGrads, variableGrads } from './gradients'; +export declare const tidy: typeof Environment.tidy; +export declare const keep: typeof Environment.keep; +export declare const dispose: typeof Environment.dispose; +export declare const time: typeof Environment.time; diff --git a/node_modules/@tensorflow/tfjs-core/dist/globals.js b/node_modules/@tensorflow/tfjs-core/dist/globals.js new file mode 100644 index 0000000..578bfa2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/globals.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("./environment"); +var gradients_1 = require("./gradients"); +exports.customGrad = gradients_1.customGrad; +exports.grad = gradients_1.grad; +exports.grads = gradients_1.grads; +exports.valueAndGrad = gradients_1.valueAndGrad; +exports.valueAndGrads = gradients_1.valueAndGrads; +exports.variableGrads = gradients_1.variableGrads; +exports.tidy = environment_1.Environment.tidy; +exports.keep = environment_1.Environment.keep; +exports.dispose = environment_1.Environment.dispose; +exports.time = environment_1.Environment.time; +//# sourceMappingURL=globals.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/globals.js.map b/node_modules/@tensorflow/tfjs-core/dist/globals.js.map new file mode 100644 index 0000000..55dbd3e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/globals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"globals.js","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":";;AAiBA,6CAA0C;AAC1C,yCAAgG;AAAxF,iCAAA,UAAU,CAAA;AAAE,2BAAA,IAAI,CAAA;AAAE,4BAAA,KAAK,CAAA;AAAE,mCAAA,YAAY,CAAA;AAAE,oCAAA,aAAa,CAAA;AAAE,oCAAA,aAAa,CAAA;AAE9D,QAAA,IAAI,GAAG,yBAAW,CAAC,IAAI,CAAC;AACxB,QAAA,IAAI,GAAG,yBAAW,CAAC,IAAI,CAAC;AACxB,QAAA,OAAO,GAAG,yBAAW,CAAC,OAAO,CAAC;AAC9B,QAAA,IAAI,GAAG,yBAAW,CAAC,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts b/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts new file mode 100644 index 0000000..9198615 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts @@ -0,0 +1,20 @@ +import { CustomGradientFunc, ScopeFn } from './engine'; +import { Scalar, Tensor, Variable } from './tensor'; +import { NamedTensorMap, TensorContainer } from './tensor_types'; +declare function gradScope(nameOrScopeFn: string | ScopeFn, scopeFn?: ScopeFn): T; +declare function grad(f: (x: I) => O): (x: I, dy?: O) => I; +declare function grads(f: (...args: Tensor[]) => O): (args: Tensor[], dy?: O) => Tensor[]; +declare function valueAndGrad(f: (x: I) => O): (x: I, dy?: O) => { + value: O; + grad: I; +}; +declare function valueAndGrads(f: (...args: Tensor[]) => O): (args: Tensor[], dy?: O) => { + grads: Tensor[]; + value: O; +}; +declare function variableGrads(f: () => Scalar, varList?: Variable[]): { + value: Scalar; + grads: NamedTensorMap; +}; +declare function customGrad(f: CustomGradientFunc): (...args: Tensor[]) => T; +export { gradScope, customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, }; diff --git a/node_modules/@tensorflow/tfjs-core/dist/gradients.js b/node_modules/@tensorflow/tfjs-core/dist/gradients.js new file mode 100644 index 0000000..d74545a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/gradients.js @@ -0,0 +1,112 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("./environment"); +var tensor_1 = require("./tensor"); +var util = require("./util"); +function gradScope(nameOrScopeFn, scopeFn) { + return environment_1.ENV.engine.tidy(nameOrScopeFn, scopeFn, true); +} +exports.gradScope = gradScope; +function grad(f) { + util.assert(util.isFunction(f), 'The f passed in grad(f) must be a function'); + return function (x, dy) { + util.assert(x instanceof tensor_1.Tensor, 'The x passed in grad(f)(x) must be a tensor'); + util.assert(dy == null || dy instanceof tensor_1.Tensor, 'The dy passed in grad(f)(x, dy) must be a tensor'); + return environment_1.ENV.engine.tidy(function () { + var _a = environment_1.ENV.engine.gradients(function () { return f(x); }, [x], dy), value = _a.value, grads = _a.grads; + if (dy != null) { + util.assertShapesMatch(value.shape, dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' + + 'returned by f(x)'); + } + checkGrads(grads); + return grads[0]; + }); + }; +} +exports.grad = grad; +function grads(f) { + util.assert(util.isFunction(f), 'The f passed in grads(f) must be a function'); + return function (args, dy) { + util.assert(Array.isArray(args) && args.every(function (arg) { return arg instanceof tensor_1.Tensor; }), 'The args passed in grads(f)(args) must be an array of tensors'); + util.assert(dy == null || dy instanceof tensor_1.Tensor, 'The dy passed in grads(f)(args, dy) must be a tensor'); + return environment_1.ENV.engine.tidy(function () { + var _a = environment_1.ENV.engine.gradients(function () { return f.apply(void 0, args); }, args, dy), value = _a.value, grads = _a.grads; + if (dy != null) { + util.assertShapesMatch(value.shape, dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' + + 'match the shape returned by f([x1,...])'); + } + checkGrads(grads); + return grads; + }); + }; +} +exports.grads = grads; +function valueAndGrad(f) { + util.assert(util.isFunction(f), 'The f passed in valueAndGrad(f) must be a function'); + return function (x, dy) { + util.assert(x instanceof tensor_1.Tensor, 'The x passed in valueAndGrad(f)(x) must be a tensor'); + util.assert(dy == null || dy instanceof tensor_1.Tensor, 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor'); + var _a = environment_1.ENV.engine.gradients(function () { return f(x); }, [x], dy), grads = _a.grads, value = _a.value; + checkGrads(grads); + return { grad: grads[0], value: value }; + }; +} +exports.valueAndGrad = valueAndGrad; +function valueAndGrads(f) { + util.assert(util.isFunction(f), 'The f passed in valueAndGrads(f) must be a function'); + return function (args, dy) { + util.assert(Array.isArray(args) && args.every(function (arg) { return arg instanceof tensor_1.Tensor; }), 'The args passed in valueAndGrads(f)(args) must be array of tensors'); + util.assert(dy == null || dy instanceof tensor_1.Tensor, 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor'); + var res = environment_1.ENV.engine.gradients(function () { return f.apply(void 0, args); }, args, dy); + if (dy != null) { + util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' + + 'match the shape returned by f([x1,...])'); + } + checkGrads(res.grads); + return res; + }; +} +exports.valueAndGrads = valueAndGrads; +function variableGrads(f, varList) { + util.assert(util.isFunction(f), 'The f passed in variableGrads(f) must be a function'); + util.assert(varList == null || + Array.isArray(varList) && varList.every(function (v) { return v instanceof tensor_1.Variable; }), 'The varList passed in variableGrads(f, varList) must be an array ' + + 'of variables'); + if (varList == null) { + varList = []; + for (var varName in environment_1.ENV.engine.registeredVariables) { + varList.push(environment_1.ENV.engine.registeredVariables[varName]); + } + } + var originalVarCount = varList.length; + varList = varList.filter(function (variable) { return variable.trainable; }); + util.assert(varList.length > 0, "variableGrads() expects at least one of the input variables to be " + + ("trainable, but none of the " + originalVarCount + " variables is ") + + "trainable."); + var allowNoGradients = true; + var _a = environment_1.ENV.engine.gradients(f, varList, null, allowNoGradients), value = _a.value, grads = _a.grads; + util.assert(grads.some(function (g) { return g != null; }), 'Cannot find a connection between any variable and the result of the ' + + 'loss function y=f(x). Please make sure the operations that use ' + + 'variables are inside the function f passed to minimize().'); + util.assert(value.rank === 0, "The f passed in variableGrads(f) must return a scalar, but it " + + ("returned a rank-" + value.rank + " tensor")); + var namedGrads = {}; + varList.forEach(function (v, i) { + if (grads[i] != null) { + namedGrads[v.name] = grads[i]; + } + }); + return { value: value, grads: namedGrads }; +} +exports.variableGrads = variableGrads; +function customGrad(f) { + return environment_1.ENV.engine.customGrad(f); +} +exports.customGrad = customGrad; +function checkGrads(grads) { + var numNullGradients = grads.filter(function (g) { return g == null; }).length; + if (numNullGradients > 0) { + throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y."); + } +} +//# sourceMappingURL=gradients.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/gradients.js.map b/node_modules/@tensorflow/tfjs-core/dist/gradients.js.map new file mode 100644 index 0000000..6d35893 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/gradients.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gradients.js","sourceRoot":"","sources":["../src/gradients.ts"],"names":[],"mappings":";;AAkBA,6CAAkC;AAClC,mCAAkD;AAElD,6BAA+B;AAa/B,mBACI,aAAgC,EAAE,OAAoB;IACxD,OAAO,iBAAG,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAiB,CAAC;AACvE,CAAC;AAuUC,8BAAS;AApSX,cAAkD,CAAc;IAE9D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,4CAA4C,CAAC,CAAC;IAC9E,OAAO,UAAC,CAAI,EAAE,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Y,CAAC,CAAC;IAEtB,IAAM,gBAAgB,GAAG,IAAI,CAAC;IACxB,IAAA,2EACsD,EADrD,gBAAK,EAAE,gBAAK,CAC0C;IAE7D,IAAI,CAAC,MAAM,CACP,KAAK,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,IAAI,IAAI,EAAT,CAAS,CAAC,EAC1B,sEAAsE;QAClE,iEAAiE;QACjE,2DAA2D,CAAC,CAAC;IACrE,IAAI,CAAC,MAAM,CACP,KAAK,CAAC,IAAI,KAAK,CAAC,EAChB,gEAAgE;SAC5D,qBAAmB,KAAK,CAAC,IAAI,YAAS,CAAA,CAAC,CAAC;IAEhD,IAAM,UAAU,GAAmB,EAAE,CAAC;IACtC,OAAO,CAAC,OAAO,CAAC,UAAC,CAAC,EAAE,CAAC;QACnB,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;YACpB,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;SAC/B;IACH,CAAC,CAAC,CAAC;IACH,OAAO,EAAC,KAAK,OAAA,EAAE,KAAK,EAAE,UAAU,EAAC,CAAC;AACpC,CAAC;AAgDC,sCAAa;AAjBf,oBAAsC,CAAwB;IAE5D,OAAO,iBAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC;AAaC,gCAAU;AAXZ,oBAAoB,KAAe;IACjC,IAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,IAAI,IAAI,EAAT,CAAS,CAAC,CAAC,MAAM,CAAC;IAC7D,IAAI,gBAAgB,GAAG,CAAC,EAAE;QACxB,MAAM,IAAI,KAAK,CACX,0IAC4D,CAAC,CAAC;KACnE;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/index.d.ts b/node_modules/@tensorflow/tfjs-core/dist/index.d.ts new file mode 100644 index 0000000..cb0ca49 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/index.d.ts @@ -0,0 +1,38 @@ +import './kernels/backend_webgl'; +import './kernels/backend_cpu'; +import { nextFrame } from './browser_util'; +import * as environment from './environment'; +import * as io from './io/io'; +import * as serialization from './serialization'; +import * as test_util from './test_util'; +import * as util from './util'; +import { version } from './version'; +import * as webgl from './webgl'; +export { InferenceModel, ModelPredictConfig } from './model_types'; +export { AdadeltaOptimizer } from './optimizers/adadelta_optimizer'; +export { AdagradOptimizer } from './optimizers/adagrad_optimizer'; +export { AdamOptimizer } from './optimizers/adam_optimizer'; +export { AdamaxOptimizer } from './optimizers/adamax_optimizer'; +export { MomentumOptimizer } from './optimizers/momentum_optimizer'; +export { Optimizer } from './optimizers/optimizer'; +export { RMSPropOptimizer } from './optimizers/rmsprop_optimizer'; +export { SGDOptimizer } from './optimizers/sgd_optimizer'; +export { Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorBuffer, variable, Variable } from './tensor'; +export { NamedTensorMap } from './tensor_types'; +export { DataType, Rank, ShapeMap } from './types'; +export * from './ops/ops'; +export { LSTMCellFunc } from './ops/lstm'; +export { Reduction } from './ops/loss_ops'; +export * from './train'; +export * from './globals'; +export { Features } from './environment_util'; +export { TimingInfo } from './engine'; +export { ENV, Environment } from './environment'; +export declare const setBackend: typeof environment.Environment.setBackend; +export declare const getBackend: typeof environment.Environment.getBackend; +export declare const disposeVariables: typeof environment.Environment.disposeVariables; +export declare const memory: typeof environment.Environment.memory; +export { version as version_core }; +export { nextFrame }; +export { environment, io, serialization, test_util, util, webgl }; +export { KernelBackend, BackendTimingInfo } from './kernels/backend'; diff --git a/node_modules/@tensorflow/tfjs-core/dist/index.js b/node_modules/@tensorflow/tfjs-core/dist/index.js new file mode 100644 index 0000000..338637a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/index.js @@ -0,0 +1,63 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +require("./kernels/backend_webgl"); +require("./kernels/backend_cpu"); +var browser_util_1 = require("./browser_util"); +exports.nextFrame = browser_util_1.nextFrame; +var environment = require("./environment"); +exports.environment = environment; +var environment_1 = require("./environment"); +var io = require("./io/io"); +exports.io = io; +var serialization = require("./serialization"); +exports.serialization = serialization; +var tensor_1 = require("./tensor"); +var test_util = require("./test_util"); +exports.test_util = test_util; +var util = require("./util"); +exports.util = util; +var version_1 = require("./version"); +exports.version_core = version_1.version; +var webgl = require("./webgl"); +exports.webgl = webgl; +var adadelta_optimizer_1 = require("./optimizers/adadelta_optimizer"); +exports.AdadeltaOptimizer = adadelta_optimizer_1.AdadeltaOptimizer; +var adagrad_optimizer_1 = require("./optimizers/adagrad_optimizer"); +exports.AdagradOptimizer = adagrad_optimizer_1.AdagradOptimizer; +var adam_optimizer_1 = require("./optimizers/adam_optimizer"); +exports.AdamOptimizer = adam_optimizer_1.AdamOptimizer; +var adamax_optimizer_1 = require("./optimizers/adamax_optimizer"); +exports.AdamaxOptimizer = adamax_optimizer_1.AdamaxOptimizer; +var momentum_optimizer_1 = require("./optimizers/momentum_optimizer"); +exports.MomentumOptimizer = momentum_optimizer_1.MomentumOptimizer; +var optimizer_1 = require("./optimizers/optimizer"); +exports.Optimizer = optimizer_1.Optimizer; +var rmsprop_optimizer_1 = require("./optimizers/rmsprop_optimizer"); +exports.RMSPropOptimizer = rmsprop_optimizer_1.RMSPropOptimizer; +var sgd_optimizer_1 = require("./optimizers/sgd_optimizer"); +exports.SGDOptimizer = sgd_optimizer_1.SGDOptimizer; +var tensor_2 = require("./tensor"); +exports.Tensor = tensor_2.Tensor; +exports.TensorBuffer = tensor_2.TensorBuffer; +exports.variable = tensor_2.variable; +exports.Variable = tensor_2.Variable; +var types_1 = require("./types"); +exports.Rank = types_1.Rank; +__export(require("./ops/ops")); +var loss_ops_1 = require("./ops/loss_ops"); +exports.Reduction = loss_ops_1.Reduction; +__export(require("./train")); +__export(require("./globals")); +var environment_2 = require("./environment"); +exports.ENV = environment_2.ENV; +exports.Environment = environment_2.Environment; +exports.setBackend = environment_1.Environment.setBackend; +exports.getBackend = environment_1.Environment.getBackend; +exports.disposeVariables = environment_1.Environment.disposeVariables; +exports.memory = environment_1.Environment.memory; +var ops = require("./ops/ops"); +tensor_1.setOpHandler(ops); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/index.js.map b/node_modules/@tensorflow/tfjs-core/dist/index.js.map new file mode 100644 index 0000000..489d543 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAoBA,mCAAiC;AACjC,iCAA+B;AAE/B,+CAAyC;AA6CjC,oBA7CA,wBAAS,CA6CA;AA5CjB,2CAA6C;AA+CrC,kCAAW;AA9CnB,6CAA0C;AAG1C,4BAA8B;AA2CT,gBAAE;AA1CvB,+CAAiD;AA0CxB,sCAAa;AAzCtC,mCAAsC;AACtC,uCAAyC;AAwCD,8BAAS;AAvCjD,6BAA+B;AAuCoB,oBAAI;AAtCvD,qCAAkC;AAiCf,uBAjCX,iBAAO,CAiCgB;AAhC/B,+BAAiC;AAqCwB,sBAAK;AAhC9D,sEAAkE;AAA1D,iDAAA,iBAAiB,CAAA;AACzB,oEAAgE;AAAxD,+CAAA,gBAAgB,CAAA;AACxB,8DAA0D;AAAlD,yCAAA,aAAa,CAAA;AACrB,kEAA8D;AAAtD,6CAAA,eAAe,CAAA;AACvB,sEAAkE;AAA1D,iDAAA,iBAAiB,CAAA;AACzB,oDAAiD;AAAzC,gCAAA,SAAS,CAAA;AACjB,oEAAgE;AAAxD,+CAAA,gBAAgB,CAAA;AACxB,4DAAwD;AAAhD,uCAAA,YAAY,CAAA;AACpB,mCAAkH;AAAlG,0BAAA,MAAM,CAAA;AAA0C,gCAAA,YAAY,CAAA;AAAE,4BAAA,QAAQ,CAAA;AAAE,4BAAA,QAAQ,CAAA;AAEhG,iCAAiD;AAA/B,uBAAA,IAAI,CAAA;AAEtB,+BAA0B;AAE1B,2CAAyC;AAAjC,+BAAA,SAAS,CAAA;AAEjB,6BAAwB;AACxB,+BAA0B;AAI1B,6CAA+C;AAAvC,4BAAA,GAAG,CAAA;AAAE,oCAAA,WAAW,CAAA;AAEX,QAAA,UAAU,GAAG,yBAAW,CAAC,UAAU,CAAC;AACpC,QAAA,UAAU,GAAG,yBAAW,CAAC,UAAU,CAAC;AACpC,QAAA,gBAAgB,GAAG,yBAAW,CAAC,gBAAgB,CAAC;AAChD,QAAA,MAAM,GAAG,yBAAW,CAAC,MAAM,CAAC;AAWzC,+BAAiC;AACjC,qBAAY,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts new file mode 100644 index 0000000..384ec0e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts @@ -0,0 +1,14 @@ +import { IORouter } from './router_registry'; +import { IOHandler, ModelArtifacts, SaveResult } from './types'; +export declare class BrowserDownloads implements IOHandler { + private readonly modelTopologyFileName; + private readonly weightDataFileName; + private readonly jsonAnchor; + private readonly weightDataAnchor; + static readonly URL_SCHEME: string; + constructor(fileNamePrefix?: string); + save(modelArtifacts: ModelArtifacts): Promise; +} +export declare const browserDownloadsRouter: IORouter; +export declare function browserDownloads(fileNamePrefix?: string): IOHandler; +export declare function browserFiles(files: File[]): IOHandler; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js new file mode 100644 index 0000000..3345b4f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js @@ -0,0 +1,240 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var io_utils_1 = require("./io_utils"); +var router_registry_1 = require("./router_registry"); +var DEFAULT_FILE_NAME_PREFIX = 'model'; +var DEFAULT_JSON_EXTENSION_NAME = '.json'; +var DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin'; +var BrowserDownloads = (function () { + function BrowserDownloads(fileNamePrefix) { + if (!environment_1.ENV.get('IS_BROWSER')) { + throw new Error('triggerDownloads() cannot proceed because the current environment ' + + 'is not a browser.'); + } + if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) { + fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length); + } + if (fileNamePrefix == null || fileNamePrefix.length === 0) { + fileNamePrefix = DEFAULT_FILE_NAME_PREFIX; + } + this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME; + this.weightDataFileName = + fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME; + } + BrowserDownloads.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + var weightsURL, weightsManifest, modelTopologyAndWeightManifest, modelTopologyAndWeightManifestURL, jsonAnchor, weightDataAnchor; + return __generator(this, function (_a) { + weightsURL = window.URL.createObjectURL(new Blob([modelArtifacts.weightData], { type: 'application/octet-stream' })); + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('DownloadTrigger.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + else { + weightsManifest = [{ + paths: ['./' + this.weightDataFileName], + weights: modelArtifacts.weightSpecs + }]; + modelTopologyAndWeightManifest = { + modelTopology: modelArtifacts.modelTopology, + weightsManifest: weightsManifest + }; + modelTopologyAndWeightManifestURL = window.URL.createObjectURL(new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: 'application/json' })); + jsonAnchor = this.jsonAnchor == null ? document.createElement('a') : + this.jsonAnchor; + jsonAnchor.download = this.modelTopologyFileName; + jsonAnchor.href = modelTopologyAndWeightManifestURL; + jsonAnchor.click(); + if (modelArtifacts.weightData != null) { + weightDataAnchor = this.weightDataAnchor == null ? + document.createElement('a') : + this.weightDataAnchor; + weightDataAnchor.download = this.weightDataFileName; + weightDataAnchor.href = weightsURL; + weightDataAnchor.click(); + } + return [2, { modelArtifactsInfo: io_utils_1.getModelArtifactsInfoForJSON(modelArtifacts) }]; + } + return [2]; + }); + }); + }; + BrowserDownloads.URL_SCHEME = 'downloads://'; + return BrowserDownloads; +}()); +exports.BrowserDownloads = BrowserDownloads; +var BrowserFiles = (function () { + function BrowserFiles(files) { + if (files == null || files.length < 1) { + throw new Error("When calling browserFiles, at least 1 file is required, " + + ("but received " + files)); + } + this.files = files; + } + BrowserFiles.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var jsonFile, weightFiles; + var _this = this; + return __generator(this, function (_a) { + jsonFile = this.files[0]; + weightFiles = this.files.slice(1); + return [2, new Promise(function (resolve, reject) { + var jsonReader = new FileReader(); + jsonReader.onload = function (event) { + var modelJSON = JSON.parse(event.target.result); + var modelTopology = modelJSON.modelTopology; + if (modelTopology == null) { + reject(new Error("modelTopology field is missing from file " + jsonFile.name)); + return; + } + if (weightFiles.length === 0) { + resolve({ modelTopology: modelTopology }); + } + var weightsManifest = modelJSON.weightsManifest; + if (weightsManifest == null) { + reject(new Error("weightManifest field is missing from file " + jsonFile.name)); + return; + } + var pathToFile; + try { + pathToFile = + _this.checkManifestAndWeightFiles(weightsManifest, weightFiles); + } + catch (err) { + reject(err); + return; + } + var weightSpecs = []; + var paths = []; + var perFileBuffers = []; + weightsManifest.forEach(function (weightsGroup) { + weightsGroup.paths.forEach(function (path) { + paths.push(path); + perFileBuffers.push(null); + }); + weightSpecs.push.apply(weightSpecs, weightsGroup.weights); + }); + weightsManifest.forEach(function (weightsGroup) { + weightsGroup.paths.forEach(function (path) { + var weightFileReader = new FileReader(); + weightFileReader.onload = function (event) { + var weightData = event.target.result; + var index = paths.indexOf(path); + perFileBuffers[index] = weightData; + if (perFileBuffers.indexOf(null) === -1) { + resolve({ + modelTopology: modelTopology, + weightSpecs: weightSpecs, + weightData: io_utils_1.concatenateArrayBuffers(perFileBuffers), + }); + } + }; + weightFileReader.onerror = function (error) { + reject("Failed to weights data from file of path '" + path + "'."); + return; + }; + weightFileReader.readAsArrayBuffer(pathToFile[path]); + }); + }); + }; + jsonReader.onerror = function (error) { + reject("Failed to read model topology and weights manifest JSON " + + ("from file '" + jsonFile.name + "'. BrowserFiles supports loading ") + + "Keras-style tf.Model artifacts only."); + return; + }; + jsonReader.readAsText(jsonFile); + })]; + }); + }); + }; + BrowserFiles.prototype.checkManifestAndWeightFiles = function (manifest, files) { + var basenames = []; + var fileNames = files.map(function (file) { return io_utils_1.basename(file.name); }); + var pathToFile = {}; + for (var _i = 0, manifest_1 = manifest; _i < manifest_1.length; _i++) { + var group = manifest_1[_i]; + group.paths.forEach(function (path) { + var pathBasename = io_utils_1.basename(path); + if (basenames.indexOf(pathBasename) !== -1) { + throw new Error("Duplicate file basename found in weights manifest: " + + ("'" + pathBasename + "'")); + } + basenames.push(pathBasename); + if (fileNames.indexOf(pathBasename) === -1) { + throw new Error("Weight file with basename '" + pathBasename + "' is not provided."); + } + else { + pathToFile[path] = files[fileNames.indexOf(pathBasename)]; + } + }); + } + if (basenames.length !== files.length) { + throw new Error("Mismatch in the number of files in weights manifest " + + ("(" + basenames.length + ") and the number of weight files provided ") + + ("(" + files.length + ").")); + } + return pathToFile; + }; + return BrowserFiles; +}()); +exports.browserDownloadsRouter = function (url) { + if (!environment_1.ENV.get('IS_BROWSER')) { + return null; + } + else { + if (url.startsWith(BrowserDownloads.URL_SCHEME)) { + return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length)); + } + else { + return null; + } + } +}; +router_registry_1.IORouterRegistry.registerSaveRouter(exports.browserDownloadsRouter); +function browserDownloads(fileNamePrefix) { + if (fileNamePrefix === void 0) { fileNamePrefix = 'model'; } + return new BrowserDownloads(fileNamePrefix); +} +exports.browserDownloads = browserDownloads; +function browserFiles(files) { + return new BrowserFiles(files); +} +exports.browserFiles = browserFiles; +//# sourceMappingURL=browser_files.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js.map new file mode 100644 index 0000000..a9d4068 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser_files.js","sourceRoot":"","sources":["../../src/io/browser_files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,8CAAmC;AACnC,uCAA2F;AAC3F,qDAA6D;AAG7D,IAAM,wBAAwB,GAAG,OAAO,CAAC;AACzC,IAAM,2BAA2B,GAAG,OAAO,CAAC;AAC5C,IAAM,kCAAkC,GAAG,cAAc,CAAC;AAE1D;IAQE,0BAAY,cAAuB;QACjC,IAAI,CAAC,iBAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YAG1B,MAAM,IAAI,KAAK,CACX,oEAAoE;gBACpE,mBAAmB,CAAC,CAAC;SAC1B;QAED,IAAI,cAAc,CAAC,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE;YAC1D,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SAC3E;QACD,IAAI,cAAc,IAAI,IAAI,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YACzD,cAAc,GAAG,wBAAwB,CAAC;SAC3C;QAED,IAAI,CAAC,qBAAqB,GAAG,cAAc,GAAG,2BAA2B,CAAC;QAC1E,IAAI,CAAC,kBAAkB;YACnB,cAAc,GAAG,kCAAkC,CAAC;IAC1D,CAAC;IAEK,+BAAI,GAAV,UAAW,cAA8B;;;;gBACjC,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,IAAI,CAClD,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,EAAC,IAAI,EAAE,0BAA0B,EAAC,CAAC,CA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AACjC,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js new file mode 100644 index 0000000..d0219ae --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js @@ -0,0 +1,689 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var browser_files_1 = require("./browser_files"); +var modelTopology1 = { + 'class_name': 'Sequential', + 'keras_version': '2.1.4', + 'config': [{ + 'class_name': 'Dense', + 'config': { + 'kernel_initializer': { + 'class_name': 'VarianceScaling', + 'config': { + 'distribution': 'uniform', + 'scale': 1.0, + 'seed': null, + 'mode': 'fan_avg' + } + }, + 'name': 'dense', + 'kernel_constraint': null, + 'bias_regularizer': null, + 'bias_constraint': null, + 'dtype': 'float32', + 'activation': 'linear', + 'trainable': true, + 'kernel_regularizer': null, + 'bias_initializer': { 'class_name': 'Zeros', 'config': {} }, + 'units': 1, + 'batch_input_shape': [null, 3], + 'use_bias': true, + 'activity_regularizer': null + } + }], + 'backend': 'tensorflow' +}; +var weightSpecs1 = [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [1], + dtype: 'float32', + } +]; +var weightData1 = new ArrayBuffer(16); +var artifacts1 = { + modelTopology: modelTopology1, + weightSpecs: weightSpecs1, + weightData: weightData1, +}; +jasmine_util_1.describeWithFlags('browserDownloads', test_util_1.BROWSER_ENVS, function () { + var FakeHTMLAnchorElement = (function () { + function FakeHTMLAnchorElement() { + this.clicked = 0; + } + FakeHTMLAnchorElement.prototype.click = function () { + this.clicked++; + }; + return FakeHTMLAnchorElement; + }()); + var fakeAnchors = []; + var fakeAnchorCount = 0; + beforeEach(function () { + fakeAnchorCount = 0; + fakeAnchors = [new FakeHTMLAnchorElement(), new FakeHTMLAnchorElement()]; + spyOn(document, 'createElement').and.callFake(function (tag) { + return fakeAnchors[fakeAnchorCount++]; + }); + }); + it('Explicit file name prefix, with existing anchors', function (done) { + var testStartDate = new Date(); + var downloadTrigger = tf.io.getSaveHandlers('downloads://test-model')[0]; + downloadTrigger.save(artifacts1) + .then(function (saveResult) { return __awaiter(_this, void 0, void 0, function () { + var artifactsInfo, jsonAnchor, weightDataAnchor, jsonContent, modelTopologyAndWeightsManifest, _a, _b, weightsManifest, weightsContent, fileReader, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + expect(saveResult.errors).toEqual(undefined); + artifactsInfo = saveResult.modelArtifactsInfo; + expect(artifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs1).length); + expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16); + jsonAnchor = fakeAnchors[0]; + weightDataAnchor = fakeAnchors[1]; + expect(jsonAnchor.download).toEqual('test-model.json'); + expect(weightDataAnchor.download).toEqual('test-model.weights.bin'); + return [4, fetch(jsonAnchor.href)]; + case 1: + jsonContent = _e.sent(); + _b = (_a = JSON).parse; + return [4, jsonContent.text()]; + case 2: + modelTopologyAndWeightsManifest = _b.apply(_a, [_e.sent()]); + expect(modelTopologyAndWeightsManifest.modelTopology) + .toEqual(modelTopology1); + weightsManifest = modelTopologyAndWeightsManifest.weightsManifest; + expect(weightsManifest.length).toEqual(1); + expect(weightsManifest[0].paths).toEqual([ + './test-model.weights.bin' + ]); + expect(weightsManifest[0].weights).toEqual(weightSpecs1); + return [4, fetch(weightDataAnchor.href)]; + case 3: + weightsContent = _e.sent(); + fileReader = new FileReader(); + fileReader.onload = function (event) { + var buffer = event.target.result; + expect(buffer).toEqual(weightData1); + done(); + }; + _d = (_c = fileReader).readAsArrayBuffer; + return [4, weightsContent.blob()]; + case 4: + _d.apply(_c, [_e.sent()]); + expect(jsonAnchor.clicked).toEqual(1); + expect(weightDataAnchor.clicked).toEqual(1); + return [2]; + } + }); + }); }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it('URL scheme in explicit name gets stripped', function (done) { + var testStartDate = new Date(); + var downloadTrigger = browser_files_1.browserDownloads('downloads://test-model'); + downloadTrigger.save(artifacts1) + .then(function (saveResult) { return __awaiter(_this, void 0, void 0, function () { + var artifactsInfo, jsonAnchor, weightDataAnchor, jsonContent, modelTopologyAndWeightsManifest, _a, _b, weightsManifest, weightsContent, fileReader, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + expect(saveResult.errors).toEqual(undefined); + artifactsInfo = saveResult.modelArtifactsInfo; + expect(artifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs1).length); + expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16); + jsonAnchor = fakeAnchors[0]; + weightDataAnchor = fakeAnchors[1]; + expect(jsonAnchor.download).toEqual('test-model.json'); + expect(weightDataAnchor.download).toEqual('test-model.weights.bin'); + return [4, fetch(jsonAnchor.href)]; + case 1: + jsonContent = _e.sent(); + _b = (_a = JSON).parse; + return [4, jsonContent.text()]; + case 2: + modelTopologyAndWeightsManifest = _b.apply(_a, [_e.sent()]); + expect(modelTopologyAndWeightsManifest.modelTopology) + .toEqual(modelTopology1); + weightsManifest = modelTopologyAndWeightsManifest.weightsManifest; + expect(weightsManifest.length).toEqual(1); + expect(weightsManifest[0].paths).toEqual([ + './test-model.weights.bin' + ]); + expect(weightsManifest[0].weights).toEqual(weightSpecs1); + return [4, fetch(weightDataAnchor.href)]; + case 3: + weightsContent = _e.sent(); + fileReader = new FileReader(); + fileReader.onload = function (event) { + var buffer = event.target.result; + expect(buffer).toEqual(weightData1); + done(); + }; + _d = (_c = fileReader).readAsArrayBuffer; + return [4, weightsContent.blob()]; + case 4: + _d.apply(_c, [_e.sent()]); + expect(jsonAnchor.clicked).toEqual(1); + expect(weightDataAnchor.clicked).toEqual(1); + return [2]; + } + }); + }); }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it('No file name provided, with existing anchors', function (done) { + var testStartDate = new Date(); + var downloadTrigger = browser_files_1.browserDownloads(); + downloadTrigger.save(artifacts1) + .then(function (saveResult) { return __awaiter(_this, void 0, void 0, function () { + var artifactsInfo, jsonAnchor, weightDataAnchor, jsonContent, modelTopologyAndWeightsManifest, _a, _b, weightsManifest, weightsContent, fileReader, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + expect(saveResult.errors).toEqual(undefined); + artifactsInfo = saveResult.modelArtifactsInfo; + expect(artifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs1).length); + expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16); + jsonAnchor = fakeAnchors[0]; + weightDataAnchor = fakeAnchors[1]; + expect(jsonAnchor.download).toEqual('model.json'); + expect(weightDataAnchor.download).toEqual('model.weights.bin'); + return [4, fetch(jsonAnchor.href)]; + case 1: + jsonContent = _e.sent(); + _b = (_a = JSON).parse; + return [4, jsonContent.text()]; + case 2: + modelTopologyAndWeightsManifest = _b.apply(_a, [_e.sent()]); + expect(modelTopologyAndWeightsManifest.modelTopology) + .toEqual(modelTopology1); + weightsManifest = modelTopologyAndWeightsManifest.weightsManifest; + expect(weightsManifest.length).toEqual(1); + expect(weightsManifest[0].paths).toEqual(['./model.weights.bin']); + expect(weightsManifest[0].weights).toEqual(weightSpecs1); + return [4, fetch(weightDataAnchor.href)]; + case 3: + weightsContent = _e.sent(); + fileReader = new FileReader(); + fileReader.onload = function (event) { + var buffer = event.target.result; + expect(buffer).toEqual(weightData1); + done(); + }; + _d = (_c = fileReader).readAsArrayBuffer; + return [4, weightsContent.blob()]; + case 4: + _d.apply(_c, [_e.sent()]); + return [2]; + } + }); + }); }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it('Download only model topology', function (done) { + var testStartDate = new Date(); + var downloadTrigger = browser_files_1.browserDownloads(); + var modelTopologyOnlyArtifacts = { + modelTopology: modelTopology1, + }; + downloadTrigger.save(modelTopologyOnlyArtifacts) + .then(function (saveResult) { return __awaiter(_this, void 0, void 0, function () { + var artifactsInfo, jsonAnchor, weightDataAnchor, jsonContent, modelTopologyAndWeightsManifest, _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + expect(saveResult.errors).toEqual(undefined); + artifactsInfo = saveResult.modelArtifactsInfo; + expect(artifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes).toEqual(0); + expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(0); + jsonAnchor = fakeAnchors[0]; + weightDataAnchor = fakeAnchors[1]; + expect(jsonAnchor.download).toEqual('model.json'); + expect(jsonAnchor.clicked).toEqual(1); + expect(weightDataAnchor.download).toEqual(undefined); + expect(weightDataAnchor.clicked).toEqual(0); + return [4, fetch(jsonAnchor.href)]; + case 1: + jsonContent = _c.sent(); + _b = (_a = JSON).parse; + return [4, jsonContent.text()]; + case 2: + modelTopologyAndWeightsManifest = _b.apply(_a, [_c.sent()]); + expect(modelTopologyAndWeightsManifest.modelTopology) + .toEqual(modelTopology1); + done(); + return [2]; + } + }); + }); }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it('browserDownloadsRouter', function () { + expect(browser_files_1.browserDownloadsRouter('downloads://foo') instanceof browser_files_1.BrowserDownloads) + .toEqual(true); + expect(browser_files_1.browserDownloadsRouter('invaliddownloads://foo')).toBeNull(); + expect(browser_files_1.browserDownloadsRouter('foo')).toBeNull(); + }); +}); +jasmine_util_1.describeWithFlags('browserFiles', test_util_1.BROWSER_ENVS, function () { + var weightsBlob = new Blob([weightData1], { type: 'application/octet-stream' }); + var weightsFile = new File([weightsBlob], 'model.weights.bin', { type: 'application/octet-stream' }); + it('One group, one path', function (done) { + var weightsManifest = [{ + paths: ['./model.weights.bin'], + weights: weightSpecs1, + }]; + var weightsTopologyAndManifest = { + modelTopology: modelTopology1, + weightsManifest: weightsManifest, + }; + var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' }); + var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' }); + var filesHandler = tf.io.browserFiles([jsonFile, weightsFile]); + filesHandler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs).toEqual(weightSpecs1); + expect(new Uint8Array(modelArtifacts.weightData)) + .toEqual(new Uint8Array(weightData1)); + done(); + }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it("One group, two paths", function (done) { + var weightSpecs = [ + { + name: 'foo', + shape: [1, 1], + dtype: 'float32', + }, + { + name: 'bar', + shape: [1, 1], + dtype: 'float32', + } + ]; + var weightsManifest = [{ + paths: ['./dir1/model.weights.1.bin', './dir2/model.weights.2.bin'], + weights: weightSpecs, + }]; + var weightsTopologyAndManifest = { + modelTopology: modelTopology1, + weightsManifest: weightsManifest, + }; + var weightsBlob1 = new Blob([new Uint8Array([1, 2, 3, 4]).buffer], { type: 'application/octet-stream' }); + var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' }); + var weightsBlob2 = new Blob([new Uint8Array([10, 20, 30, 40]).buffer], { type: 'application/octet-stream' }); + var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' }); + var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' }); + var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' }); + var filesHandler = tf.io.browserFiles([jsonFile, weightsFile1, weightsFile2]); + filesHandler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs).toEqual(weightSpecs); + expect(new Uint8Array(modelArtifacts.weightData)) + .toEqual(new Uint8Array([1, 2, 3, 4, 10, 20, 30, 40])); + done(); + }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it("Two groups, four paths, reverseOrder=false", function (done) { + var weightSpecs1 = [ + { + name: 'foo', + shape: [1, 1], + dtype: 'float32', + }, + { + name: 'bar', + shape: [1, 1], + dtype: 'float32', + } + ]; + var weightSpecs2 = [ + { + name: 'baz', + shape: [1, 1], + dtype: 'float32', + }, + { + name: 'qux', + shape: [1, 1], + dtype: 'float32', + } + ]; + var weightsManifest = [ + { + paths: ['./model.weights.1.bin', './model.weights.2.bin'], + weights: weightSpecs1, + }, + { + paths: ['./model.weights.3.bin', './model.weights.4.bin'], + weights: weightSpecs2, + } + ]; + var weightsTopologyAndManifest = { + modelTopology: modelTopology1, + weightsManifest: weightsManifest, + }; + var weightsBlob1 = new Blob([new Uint8Array([1, 3, 5, 7]).buffer], { type: 'application/octet-stream' }); + var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' }); + var weightsBlob2 = new Blob([new Uint8Array([10, 30, 50, 70]).buffer], { type: 'application/octet-stream' }); + var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' }); + var weightsBlob3 = new Blob([new Uint8Array([2, 4, 6, 8]).buffer], { type: 'application/octet-stream' }); + var weightsFile3 = new File([weightsBlob3], 'model.weights.3.bin', { type: 'application/octet-stream' }); + var weightsBlob4 = new Blob([new Uint8Array([20, 40, 60, 80]).buffer], { type: 'application/octet-stream' }); + var weightsFile4 = new File([weightsBlob4], 'model.weights.4.bin', { type: 'application/octet-stream' }); + var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' }); + var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' }); + var filesHandler = tf.io.browserFiles([jsonFile, weightsFile1, weightsFile2, weightsFile3, weightsFile4]); + filesHandler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs) + .toEqual(weightSpecs1.concat(weightSpecs2)); + expect(new Uint8Array(modelArtifacts.weightData)) + .toEqual(new Uint8Array([1, 3, 5, 7, 10, 30, 50, 70, 2, 4, 6, 8, 20, 40, 60, 80])); + done(); + }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it("Two groups, four paths, reverseOrder=true", function (done) { + var weightSpecs1 = [ + { + name: 'foo', + shape: [1, 1], + dtype: 'float32', + }, + { + name: 'bar', + shape: [1, 1], + dtype: 'float32', + } + ]; + var weightSpecs2 = [ + { + name: 'baz', + shape: [1, 1], + dtype: 'float32', + }, + { + name: 'qux', + shape: [1, 1], + dtype: 'float32', + } + ]; + var weightsManifest = [ + { + paths: ['./model.weights.1.bin', './model.weights.2.bin'], + weights: weightSpecs1, + }, + { + paths: ['./model.weights.3.bin', './model.weights.4.bin'], + weights: weightSpecs2, + } + ]; + var weightsTopologyAndManifest = { + modelTopology: modelTopology1, + weightsManifest: weightsManifest, + }; + var weightsBlob1 = new Blob([new Uint8Array([1, 3, 5, 7]).buffer], { type: 'application/octet-stream' }); + var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' }); + var weightsBlob2 = new Blob([new Uint8Array([10, 30, 50, 70]).buffer], { type: 'application/octet-stream' }); + var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' }); + var weightsBlob3 = new Blob([new Uint8Array([2, 4, 6, 8]).buffer], { type: 'application/octet-stream' }); + var weightsFile3 = new File([weightsBlob3], 'model.weights.3.bin', { type: 'application/octet-stream' }); + var weightsBlob4 = new Blob([new Uint8Array([20, 40, 60, 80]).buffer], { type: 'application/octet-stream' }); + var weightsFile4 = new File([weightsBlob4], 'model.weights.4.bin', { type: 'application/octet-stream' }); + var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' }); + var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' }); + var filesHandler = tf.io.browserFiles([jsonFile, weightsFile4, weightsFile3, weightsFile2, weightsFile1]); + filesHandler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs) + .toEqual(weightSpecs1.concat(weightSpecs2)); + expect(new Uint8Array(modelArtifacts.weightData)) + .toEqual(new Uint8Array([1, 3, 5, 7, 10, 30, 50, 70, 2, 4, 6, 8, 20, 40, 60, 80])); + done(); + }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it('Upload model topology only', function (done) { + var weightsManifest = [{ + paths: ['./model.weights.bin'], + weights: weightSpecs1, + }]; + var weightsTopologyAndManifest = { + modelTopology: modelTopology1, + weightsManifest: weightsManifest, + }; + var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' }); + var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' }); + var filesHandler = tf.io.browserFiles([jsonFile]); + filesHandler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs).toEqual(undefined); + done(); + }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it('Mismatch in number of paths and number of files', function (done) { + var weightsManifest = [{ + paths: ['./model.weights.1.bin'], + weights: weightSpecs1, + }]; + var weightsTopologyAndManifest = { + modelTopology: weightSpecs1, + weightsManifest: weightsManifest, + }; + var weightsBlob1 = new Blob([new Uint8Array([1, 2, 3, 4]).buffer], { type: 'application/octet-stream' }); + var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' }); + var weightsBlob2 = new Blob([new Uint8Array([10, 20, 30, 40]).buffer], { type: 'application/octet-stream' }); + var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' }); + var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' }); + var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' }); + var filesHandler = tf.io.browserFiles([jsonFile, weightsFile2, weightsFile1]); + filesHandler.load() + .then(function (modelArtifacts) { + done.fail('Loading with mismatch in number of paths and number of files ' + + 'succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Mismatch in the number of files in weights manifest (1) ' + + 'and the number of weight files provided (2).'); + done(); + }); + }); + it('Mismatch in manifest paths and file names', function (done) { + var weightSpecs = [ + { + name: 'foo', + shape: [1, 1], + dtype: 'float32', + }, + { + name: 'bar', + shape: [1, 1], + dtype: 'float32', + } + ]; + var weightsManifest = [{ + paths: ['./model.weights.1.bin', './model.weights.2.bin'], + weights: weightSpecs, + }]; + var weightsTopologyAndManifest = { + modelTopology: modelTopology1, + weightsManifest: weightsManifest, + }; + var weightsBlob1 = new Blob([new Uint8Array([1, 2, 3, 4]).buffer], { type: 'application/octet-stream' }); + var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' }); + var weightsBlob2 = new Blob([new Uint8Array([10, 20, 30, 40]).buffer], { type: 'application/octet-stream' }); + var weightsFile2 = new File([weightsBlob2], 'model.weights.3.bin', { type: 'application/octet-stream' }); + var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' }); + var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' }); + var filesHandler = tf.io.browserFiles([jsonFile, weightsFile1, weightsFile2]); + filesHandler.load() + .then(function (modelArtifacts) { + done.fail('Loading with mismatching paths and file names ' + + 'succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Weight file with basename \'model.weights.2.bin\' is not ' + + 'provided.'); + done(); + }); + }); + it('Duplicate basenames in paths fails', function (done) { + var weightSpecs = [ + { + name: 'foo', + shape: [1, 1], + dtype: 'float32', + }, + { + name: 'bar', + shape: [1, 1], + dtype: 'float32', + } + ]; + var weightsManifest = [{ + paths: ['./dir1/model.weights.1.bin', './dir2/model.weights.1.bin'], + weights: weightSpecs, + }]; + var weightsTopologyAndManifest = { + modelTopology: modelTopology1, + weightsManifest: weightsManifest, + }; + var weightsBlob1 = new Blob([new Uint8Array([1, 2, 3, 4]).buffer], { type: 'application/octet-stream' }); + var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' }); + var weightsBlob2 = new Blob([new Uint8Array([10, 20, 30, 40]).buffer], { type: 'application/octet-stream' }); + var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' }); + var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' }); + var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' }); + var filesHandler = tf.io.browserFiles([jsonFile, weightsFile1, weightsFile2]); + filesHandler.load() + .then(function (modelArtifacts) { + done.fail('Loading with duplicate basenames in paths ' + + 'succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Duplicate file basename found in weights manifest: ' + + '\'model.weights.1.bin\''); + done(); + }); + }); + it('Missing modelTopology from JSON leads to Error', function (done) { + var weightsManifest = [{ + paths: ['./model.weights.bin'], + weights: weightSpecs1, + }]; + var weightsTopologyAndManifest = { + weightsManifest: weightsManifest, + }; + var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' }); + var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' }); + var filesHandler = tf.io.browserFiles([jsonFile, weightsFile]); + filesHandler.load() + .then(function (modelArtifacts) { + done.fail('Loading with Files IOHandler with missing modelTopology ' + + 'succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toMatch(/modelTopology field is missing from file model\.json/); + done(); + }); + }); + it('Incorrect number of files leads to Error', function () { + expect(function () { return tf.io.browserFiles(null); }).toThrowError(/at least 1 file/); + expect(function () { return tf.io.browserFiles([]); }).toThrowError(/at least 1 file/); + }); +}); +//# sourceMappingURL=browser_files_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js.map new file mode 100644 index 0000000..8799dee --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser_files_test.js","sourceRoot":"","sources":["../../src/io/browser_files_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,iBA+wBA;;AA/wBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA0C;AAC1C,iDAA2F;AAG3F,IAAM,cAAc,GAAO;IACzB,YAAY,EAAE,YAAY;IAC1B,eAAe,EAAE,OAAO;IACxB,QAAQ,EAAE,CAAC;YACT,YAAY,EAAE,OAAO;YACrB,QAAQ,EAAE;gBACR,oBAAoB,EAAE;oBACpB,YAAY,EAAE,iBAAiB;oBAC/B,QAAQ,EAAE;wBACR,cAAc,EAAE,SAAS;wBACzB,OAAO,EAAE,GAAG;wBACZ,MAAM,EAAE,IAAI;wBACZ,MAAM,EAAE,SAAS;qBAClB;iBACF;gBACD,MAAM,EAAE,OAAO;gBACf,mBAAmB,EAAE,IAAI;gBACzB,kBAAkB,EAAE,IAAI;gBACxB,iBAAiB,EAAE,IAAI;gBACvB,OAAO,EAAE,SAAS;gBAClB,YAAY,EAAE,QAAQ;gBACtB,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C,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAxB,CAAwB,CAAC,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;QACvE,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,EAAtB,CAAsB,CAAC,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.d.ts new file mode 100644 index 0000000..3c32af5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.d.ts @@ -0,0 +1,13 @@ +import { IORouter } from './router_registry'; +import { IOHandler, ModelArtifacts, SaveResult } from './types'; +export declare class BrowserHTTPRequest implements IOHandler { + protected readonly path: string; + protected readonly requestInit: RequestInit; + readonly DEFAULT_METHOD: string; + static readonly URL_SCHEMES: string[]; + constructor(path: string, requestInit?: RequestInit); + save(modelArtifacts: ModelArtifacts): Promise; + load(): Promise; +} +export declare const httpRequestRouter: IORouter; +export declare function browserHTTPRequest(path: string, requestInit?: RequestInit): IOHandler; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js new file mode 100644 index 0000000..c7c449b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js @@ -0,0 +1,166 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = require("../util"); +var io_utils_1 = require("./io_utils"); +var router_registry_1 = require("./router_registry"); +var weights_loader_1 = require("./weights_loader"); +var BrowserHTTPRequest = (function () { + function BrowserHTTPRequest(path, requestInit) { + this.DEFAULT_METHOD = 'POST'; + if (typeof fetch === 'undefined') { + throw new Error('browserHTTPRequest is not supported outside the web browser without a fetch polyfill.'); + } + util_1.assert(path != null && path.length > 0, 'URL path for browserHTTPRequest must not be null, undefined or ' + + 'empty.'); + this.path = path; + if (requestInit != null && requestInit.body != null) { + throw new Error('requestInit is expected to have no pre-existing body, but has one.'); + } + this.requestInit = requestInit || {}; + } + BrowserHTTPRequest.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + var init, weightsManifest, modelTopologyAndWeightManifest, response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserHTTPRequest.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + init = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit); + init.body = new FormData(); + weightsManifest = [{ + paths: ['./model.weights.bin'], + weights: modelArtifacts.weightSpecs, + }]; + modelTopologyAndWeightManifest = { + modelTopology: modelArtifacts.modelTopology, + weightsManifest: weightsManifest + }; + init.body.append('model.json', new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: 'application/json' }), 'model.json'); + if (modelArtifacts.weightData != null) { + init.body.append('model.weights.bin', new Blob([modelArtifacts.weightData], { type: 'application/octet-stream' }), 'model.weights.bin'); + } + return [4, fetch(this.path, init)]; + case 1: + response = _a.sent(); + if (response.status === 200) { + return [2, { + modelArtifactsInfo: io_utils_1.getModelArtifactsInfoForJSON(modelArtifacts), + responses: [response], + }]; + } + else { + throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status " + + (response.status + ".")); + } + return [2]; + } + }); + }); + }; + BrowserHTTPRequest.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var modelConfigRequest, modelConfig, modelTopology, weightsManifest, weightSpecs, weightData, weightsManifest_2, _i, weightsManifest_1, entry, pathPrefix_1, fetchURLs_1, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: return [4, fetch(this.path, this.requestInit)]; + case 1: + modelConfigRequest = _b.sent(); + return [4, modelConfigRequest.json()]; + case 2: + modelConfig = _b.sent(); + modelTopology = modelConfig['modelTopology']; + weightsManifest = modelConfig['weightsManifest']; + if (modelTopology == null && weightsManifest == null) { + throw new Error("The JSON from HTTP path " + this.path + " contains neither model " + + "topology or manifest for weights."); + } + if (!(weightsManifest != null)) return [3, 4]; + weightsManifest_2 = modelConfig['weightsManifest']; + weightSpecs = []; + for (_i = 0, weightsManifest_1 = weightsManifest_2; _i < weightsManifest_1.length; _i++) { + entry = weightsManifest_1[_i]; + weightSpecs.push.apply(weightSpecs, entry.weights); + } + pathPrefix_1 = this.path.substring(0, this.path.lastIndexOf('/')); + if (!pathPrefix_1.endsWith('/')) { + pathPrefix_1 = pathPrefix_1 + '/'; + } + fetchURLs_1 = []; + weightsManifest_2.forEach(function (weightsGroup) { + weightsGroup.paths.forEach(function (path) { + fetchURLs_1.push(pathPrefix_1 + path); + }); + }); + _a = io_utils_1.concatenateArrayBuffers; + return [4, weights_loader_1.loadWeightsAsArrayBuffer(fetchURLs_1, this.requestInit)]; + case 3: + weightData = _a.apply(void 0, [_b.sent()]); + _b.label = 4; + case 4: return [2, { modelTopology: modelTopology, weightSpecs: weightSpecs, weightData: weightData }]; + } + }); + }); + }; + BrowserHTTPRequest.URL_SCHEMES = ['http://', 'https://']; + return BrowserHTTPRequest; +}()); +exports.BrowserHTTPRequest = BrowserHTTPRequest; +exports.httpRequestRouter = function (url) { + if (typeof fetch === 'undefined') { + return null; + } + else { + for (var _i = 0, _a = BrowserHTTPRequest.URL_SCHEMES; _i < _a.length; _i++) { + var scheme = _a[_i]; + if (url.startsWith(scheme)) { + return browserHTTPRequest(url); + } + } + return null; + } +}; +router_registry_1.IORouterRegistry.registerSaveRouter(exports.httpRequestRouter); +router_registry_1.IORouterRegistry.registerLoadRouter(exports.httpRequestRouter); +function browserHTTPRequest(path, requestInit) { + return new BrowserHTTPRequest(path, requestInit); +} +exports.browserHTTPRequest = browserHTTPRequest; +//# sourceMappingURL=browser_http.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js.map new file mode 100644 index 0000000..6a82867 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser_http.js","sourceRoot":"","sources":["../../src/io/browser_http.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,gCAA+B;AAC/B,uCAAiF;AACjF,qDAA6D;AAE7D,mDAA0D;AAE1D;IAQE,4BAAY,IAAY,EAAE,WAAyB;QAJ1C,mBAAc,GAAG,MAAM,CAAC;QAK/B,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;YAChC,MAAM,IAAI,KAAK,CAEX,uFAAuF,CAAC,CAAC;SAC9F;QAED,aAAM,CACF,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAC/B,iEAAiE;YAC7D,QAAQ,CAAC,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,CAAC,IAAI,IAAI,IAAI,EAAE;YACnD,MAAM,IAAI,KAAK,CACX,oEAAoE,CAAC,CAAC;SAC3E;QACD,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,EAAE,CAAC;IACvC,CAAC;IAEK,iCAAI,GAAV,UAAW,cAA8B;;;;;;wBACvC,IAAI,cAAc,CAAC,aAAa,YAAY,WAAW,EAAE;4BACvD,MAAM,IAAI,KAAK,CACX,mEAAmE;gCACnE,wBAAwB,CAAC,CAAC;yBAC/B;wBAEK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;wBAC5E,IAAI,CAAC,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;wBAErB,eAAe,GAA0B,CAAC;gCAC9C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;;;KACjD;IArHe,8BAAW,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAsHxD,yBAAC;CAAA,AA5HD,IA4HC;AA5HY,gDAAkB;AA8HlB,QAAA,iBAAiB,GAAa,UAAC,GAAW;IACrD,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QAGhC,OAAO,IAAI,CAAC;KACb;SAAM;QACL,KAAqB,UAA8B,EAA9B,KAAA,kBAAkB,CAAC,WAAW,EAA9B,cAA8B,EAA9B,IAA8B,EAAE;YAAhD,IAAM,MAAM,SAAA;YACf,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;gBAC1B,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;aAChC;SACF;QACD,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AACF,kCAAgB,CAAC,kBAAkB,CAAC,yBAAiB,CAAC,CAAC;AACvD,kCAAgB,CAAC,kBAAkB,CAAC,yBAAiB,CAAC,CAAC;AAyIvD,4BACI,IAAY,EAAE,WAAyB;IACzC,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC;AAHD,gDAGC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js new file mode 100644 index 0000000..6a60279 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js @@ -0,0 +1,576 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var browser_http_1 = require("./browser_http"); +var modelTopology1 = { + 'class_name': 'Sequential', + 'keras_version': '2.1.4', + 'config': [{ + 'class_name': 'Dense', + 'config': { + 'kernel_initializer': { + 'class_name': 'VarianceScaling', + 'config': { + 'distribution': 'uniform', + 'scale': 1.0, + 'seed': null, + 'mode': 'fan_avg' + } + }, + 'name': 'dense', + 'kernel_constraint': null, + 'bias_regularizer': null, + 'bias_constraint': null, + 'dtype': 'float32', + 'activation': 'linear', + 'trainable': true, + 'kernel_regularizer': null, + 'bias_initializer': { 'class_name': 'Zeros', 'config': {} }, + 'units': 1, + 'batch_input_shape': [null, 3], + 'use_bias': true, + 'activity_regularizer': null + } + }], + 'backend': 'tensorflow' +}; +jasmine_util_1.describeWithFlags('browserHTTPRequest-load fetch-polyfill', test_util_1.NODE_ENVS, function () { + var requestInits; + beforeEach(function () { + global.fetch = function () { }; + requestInits = []; + }); + afterAll(function () { + delete global.fetch; + }); + var fakeResponse = function (body) { return ({ + json: function () { + return Promise.resolve(JSON.parse(body)); + }, + arrayBuffer: function () { + var buf = body.buffer ? + body.buffer : + body; + return Promise.resolve(buf); + } + }); }; + var setupFakeWeightFiles = function (fileBufferMap) { + spyOn(global, 'fetch') + .and.callFake(function (path, init) { + requestInits.push(init); + return fakeResponse(fileBufferMap[path]); + }); + }; + it('1 group, 2 weights, 1 path', function (done) { + var weightManifest1 = [{ + paths: ['weightfile0'], + weights: [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [2], + dtype: 'float32', + } + ] + }]; + var floatData = new Float32Array([1, 3, 3, 7, 4]); + setupFakeWeightFiles({ + './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }), + './weightfile0': floatData, + }); + var handler = tf.io.browserHTTPRequest('./model.json'); + handler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs) + .toEqual(weightManifest1[0].weights); + expect(new Float32Array(modelArtifacts.weightData)) + .toEqual(floatData); + expect(requestInits).toEqual([{}, {}]); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('throw exception if no fetch polyfill', function () { + delete global.fetch; + try { + tf.io.browserHTTPRequest('./model.json'); + } + catch (err) { + expect(err.message) + .toMatch(/not supported outside the web browser without a fetch polyfill/); + } + }); +}); +jasmine_util_1.describeWithFlags('browserHTTPRequest-save', test_util_1.CHROME_ENVS, function () { + var weightSpecs1 = [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [1], + dtype: 'float32', + } + ]; + var weightData1 = new ArrayBuffer(16); + var artifacts1 = { + modelTopology: modelTopology1, + weightSpecs: weightSpecs1, + weightData: weightData1, + }; + var requestInits = []; + beforeEach(function () { + requestInits = []; + spyOn(window, 'fetch').and.callFake(function (path, init) { + if (path === 'model-upload-test' || path === 'http://model-upload-test') { + requestInits.push(init); + return new Response(null, { status: 200 }); + } + else { + return new Response(null, { status: 404 }); + } + }); + }); + it('Save topology and weights, default POST method', function (done) { + var testStartDate = new Date(); + var handler = tf.io.getSaveHandlers('http://model-upload-test')[0]; + handler.save(artifacts1) + .then(function (saveResult) { + expect(saveResult.modelArtifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs1).length); + expect(saveResult.modelArtifactsInfo.weightDataBytes) + .toEqual(weightData1.byteLength); + expect(requestInits.length).toEqual(1); + var init = requestInits[0]; + expect(init.method).toEqual('POST'); + var body = init.body; + var jsonFile = body.get('model.json'); + var jsonFileReader = new FileReader(); + jsonFileReader.onload = function (event) { + var modelJSON = JSON.parse(event.target.result); + expect(modelJSON.modelTopology).toEqual(modelTopology1); + expect(modelJSON.weightsManifest.length).toEqual(1); + expect(modelJSON.weightsManifest[0].weights).toEqual(weightSpecs1); + var weightsFile = body.get('model.weights.bin'); + var weightsFileReader = new FileReader(); + weightsFileReader.onload = function (event) { + var weightData = event.target.result; + expect(new Uint8Array(weightData)) + .toEqual(new Uint8Array(weightData1)); + done(); + }; + weightsFileReader.onerror = function (error) { + done.fail(error.target.error.message); + }; + weightsFileReader.readAsArrayBuffer(weightsFile); + }; + jsonFileReader.onerror = function (error) { + done.fail(error.target.error.message); + }; + jsonFileReader.readAsText(jsonFile); + }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it('Save topology only, default POST method', function (done) { + var testStartDate = new Date(); + var handler = tf.io.getSaveHandlers('http://model-upload-test')[0]; + var topologyOnlyArtifacts = { modelTopology: modelTopology1 }; + handler.save(topologyOnlyArtifacts) + .then(function (saveResult) { + expect(saveResult.modelArtifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes).toEqual(0); + expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(0); + expect(requestInits.length).toEqual(1); + var init = requestInits[0]; + expect(init.method).toEqual('POST'); + var body = init.body; + var jsonFile = body.get('model.json'); + var jsonFileReader = new FileReader(); + jsonFileReader.onload = function (event) { + var modelJSON = JSON.parse(event.target.result); + expect(modelJSON.modelTopology).toEqual(modelTopology1); + expect(body.get('model.weights.bin')).toEqual(null); + done(); + }; + jsonFileReader.onerror = function (error) { + done.fail(error.target.error.message); + }; + jsonFileReader.readAsText(jsonFile); + }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it('Save topology and weights, PUT method, extra headers', function (done) { + var testStartDate = new Date(); + var handler = tf.io.browserHTTPRequest('model-upload-test', { + method: 'PUT', + headers: { + 'header_key_1': 'header_value_1', + 'header_key_2': 'header_value_2' + } + }); + handler.save(artifacts1) + .then(function (saveResult) { + expect(saveResult.modelArtifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs1).length); + expect(saveResult.modelArtifactsInfo.weightDataBytes) + .toEqual(weightData1.byteLength); + expect(requestInits.length).toEqual(1); + var init = requestInits[0]; + expect(init.method).toEqual('PUT'); + expect(init.headers).toEqual({ + 'header_key_1': 'header_value_1', + 'header_key_2': 'header_value_2' + }); + var body = init.body; + var jsonFile = body.get('model.json'); + var jsonFileReader = new FileReader(); + jsonFileReader.onload = function (event) { + var modelJSON = JSON.parse(event.target.result); + expect(modelJSON.modelTopology).toEqual(modelTopology1); + expect(modelJSON.weightsManifest.length).toEqual(1); + expect(modelJSON.weightsManifest[0].weights).toEqual(weightSpecs1); + var weightsFile = body.get('model.weights.bin'); + var weightsFileReader = new FileReader(); + weightsFileReader.onload = function (event) { + var weightData = event.target.result; + expect(new Uint8Array(weightData)) + .toEqual(new Uint8Array(weightData1)); + done(); + }; + weightsFileReader.onerror = function (error) { + done.fail(error.target.error.message); + }; + weightsFileReader.readAsArrayBuffer(weightsFile); + }; + jsonFileReader.onerror = function (error) { + done.fail(error.target.error.message); + }; + jsonFileReader.readAsText(jsonFile); + }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + it('404 response causes Error', function (done) { + var handler = tf.io.getSaveHandlers('http://invalid/path')[0]; + handler.save(artifacts1) + .then(function (saveResult) { + done.fail('Calling browserHTTPRequest at invalid URL succeeded ' + + 'unexpectedly'); + }) + .catch(function (err) { + done(); + }); + }); + it('Existing body leads to Error', function () { + expect(function () { return tf.io.browserHTTPRequest('model-upload-test', { + body: 'existing body' + }); }).toThrowError(/requestInit is expected to have no pre-existing body/); + }); + it('Empty, null or undefined URL paths lead to Error', function () { + expect(function () { return tf.io.browserHTTPRequest(null); }) + .toThrowError(/must not be null, undefined or empty/); + expect(function () { return tf.io.browserHTTPRequest(undefined); }) + .toThrowError(/must not be null, undefined or empty/); + expect(function () { return tf.io.browserHTTPRequest(''); }) + .toThrowError(/must not be null, undefined or empty/); + }); + it('router', function () { + expect(browser_http_1.httpRequestRouter('http://bar/foo') instanceof browser_http_1.BrowserHTTPRequest) + .toEqual(true); + expect(browser_http_1.httpRequestRouter('https://localhost:5000/upload') instanceof + browser_http_1.BrowserHTTPRequest) + .toEqual(true); + expect(browser_http_1.httpRequestRouter('localhost://foo')).toBeNull(); + expect(browser_http_1.httpRequestRouter('foo:5000/bar')).toBeNull(); + }); +}); +jasmine_util_1.describeWithFlags('browserHTTPRequest-load', test_util_1.BROWSER_ENVS, function () { + var requestInits; + var setupFakeWeightFiles = function (fileBufferMap) { + spyOn(window, 'fetch').and.callFake(function (path, init) { + requestInits.push(init); + return new Response(fileBufferMap[path]); + }); + }; + beforeEach(function () { + requestInits = []; + }); + it('1 group, 2 weights, 1 path', function (done) { + var weightManifest1 = [{ + paths: ['weightfile0'], + weights: [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [2], + dtype: 'float32', + } + ] + }]; + var floatData = new Float32Array([1, 3, 3, 7, 4]); + setupFakeWeightFiles({ + './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }), + './weightfile0': floatData, + }); + var handler = tf.io.browserHTTPRequest('./model.json'); + handler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs) + .toEqual(weightManifest1[0].weights); + expect(new Float32Array(modelArtifacts.weightData)) + .toEqual(floatData); + expect(requestInits).toEqual([{}, {}]); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('1 group, 2 weights, 1 path, with requestInit', function (done) { + var weightManifest1 = [{ + paths: ['weightfile0'], + weights: [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [2], + dtype: 'float32', + } + ] + }]; + var floatData = new Float32Array([1, 3, 3, 7, 4]); + setupFakeWeightFiles({ + './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }), + './weightfile0': floatData, + }); + var handler = tf.io.browserHTTPRequest('./model.json', { headers: { 'header_key_1': 'header_value_1' } }); + handler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs) + .toEqual(weightManifest1[0].weights); + expect(new Float32Array(modelArtifacts.weightData)) + .toEqual(floatData); + expect(requestInits).toEqual([ + { headers: { 'header_key_1': 'header_value_1' } }, + { headers: { 'header_key_1': 'header_value_1' } } + ]); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('1 group, 2 weight, 2 paths', function (done) { + var weightManifest1 = [{ + paths: ['weightfile0', 'weightfile1'], + weights: [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [2], + dtype: 'float32', + } + ] + }]; + var floatData1 = new Float32Array([1, 3, 3]); + var floatData2 = new Float32Array([7, 4]); + setupFakeWeightFiles({ + './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }), + './weightfile0': floatData1, + './weightfile1': floatData2, + }); + var handler = tf.io.browserHTTPRequest('./model.json'); + handler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs) + .toEqual(weightManifest1[0].weights); + expect(new Float32Array(modelArtifacts.weightData)) + .toEqual(new Float32Array([1, 3, 3, 7, 4])); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('2 groups, 2 weight, 2 paths', function (done) { + var weightsManifest = [ + { + paths: ['weightfile0'], + weights: [{ + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }] + }, + { + paths: ['weightfile1'], + weights: [{ + name: 'dense/bias', + shape: [2], + dtype: 'float32', + }], + } + ]; + var floatData1 = new Float32Array([1, 3, 3]); + var floatData2 = new Float32Array([7, 4]); + setupFakeWeightFiles({ + './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightsManifest }), + './weightfile0': floatData1, + './weightfile1': floatData2, + }); + var handler = tf.io.browserHTTPRequest('./model.json'); + handler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs) + .toEqual(weightsManifest[0].weights.concat(weightsManifest[1].weights)); + expect(new Float32Array(modelArtifacts.weightData)) + .toEqual(new Float32Array([1, 3, 3, 7, 4])); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('2 groups, 2 weight, 2 paths, Int32 and Uint8 Data', function (done) { + var weightsManifest = [ + { + paths: ['weightfile0'], + weights: [{ + name: 'fooWeight', + shape: [3, 1], + dtype: 'int32', + }] + }, + { + paths: ['weightfile1'], + weights: [{ + name: 'barWeight', + shape: [2], + dtype: 'bool', + }], + } + ]; + var floatData1 = new Int32Array([1, 3, 3]); + var floatData2 = new Uint8Array([7, 4]); + setupFakeWeightFiles({ + 'path1/model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightsManifest }), + 'path1/weightfile0': floatData1, + 'path1/weightfile1': floatData2, + }); + var handler = tf.io.browserHTTPRequest('path1/model.json'); + handler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs) + .toEqual(weightsManifest[0].weights.concat(weightsManifest[1].weights)); + expect(new Int32Array(modelArtifacts.weightData.slice(0, 12))) + .toEqual(new Int32Array([1, 3, 3])); + expect(new Uint8Array(modelArtifacts.weightData.slice(12, 14))) + .toEqual(new Uint8Array([7, 4])); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('topology only', function (done) { + setupFakeWeightFiles({ + './model.json': JSON.stringify({ modelTopology: modelTopology1 }), + }); + var handler = tf.io.browserHTTPRequest('./model.json'); + handler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs).toBeUndefined(); + expect(modelArtifacts.weightData).toBeUndefined(); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('weights only', function (done) { + var weightsManifest = [ + { + paths: ['weightfile0'], + weights: [{ + name: 'fooWeight', + shape: [3, 1], + dtype: 'int32', + }] + }, + { + paths: ['weightfile1'], + weights: [{ + name: 'barWeight', + shape: [2], + dtype: 'float32', + }], + } + ]; + var floatData1 = new Int32Array([1, 3, 3]); + var floatData2 = new Float32Array([-7, -4]); + setupFakeWeightFiles({ + 'path1/model.json': JSON.stringify({ weightsManifest: weightsManifest }), + 'path1/weightfile0': floatData1, + 'path1/weightfile1': floatData2, + }); + var handler = tf.io.browserHTTPRequest('path1/model.json'); + handler.load() + .then(function (modelArtifacts) { + expect(modelArtifacts.modelTopology).toBeUndefined(); + expect(modelArtifacts.weightSpecs) + .toEqual(weightsManifest[0].weights.concat(weightsManifest[1].weights)); + expect(new Int32Array(modelArtifacts.weightData.slice(0, 12))) + .toEqual(new Int32Array([1, 3, 3])); + expect(new Float32Array(modelArtifacts.weightData.slice(12, 20))) + .toEqual(new Float32Array([-7, -4])); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Missing modelTopology and weightsManifest leads to error', function (done) { + setupFakeWeightFiles({ 'path1/model.json': JSON.stringify({}) }); + var handler = tf.io.browserHTTPRequest('path1/model.json'); + handler.load() + .then(function (modelTopology1) { + done.fail('Loading from missing modelTopology and weightsManifest ' + + 'succeeded expectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toMatch(/contains neither model topology or manifest/); + done(); + }); + }); +}); +//# sourceMappingURL=browser_http_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js.map new file mode 100644 index 0000000..2e8d614 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser_http_test.js","sourceRoot":"","sources":["../../src/io/browser_http_test.ts"],"names":[],"mappings":";;AAqBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAkE;AAElE,+CAAqE;AAGrE,IAAM,cAAc,GAAO;IACzB,YAAY,EAAE,YAAY;IAC1B,eAAe,EAAE,OAAO;IACxB,QAAQ,EAAE,CAAC;YACT,YAAY,EAAE,OAAO;YACrB,QAAQ,EAAE;gBACR,oBAAoB,EAAE;oBACpB,YAAY,EAAE,iBAAiB;oBAC/B,QAAQ,EAAE;wBACR,cAAc,EAAE,SAAS;wBACzB,OAAO,EAAE,GAAG;wBACZ,MAAM,EAAE,IAAI;wBACZ,MAAM,EAAE,SAAS;qBAClB;iBACF;gBACD,MAAM,EAAE,OAAO;gBACf,mBAAmB,EAAE,IAAI;gBACzB,kBAAkB,EAAE,IAAI;gBACxB,iBAAiB,EAAE,IAAI;gBACvB,OAAO,EAAE,SAAS;gBAClB,YAAY,EAAE,QAAQ;gBACtB,WAAW,EAAE,IAAI;gBACjB,oBAAoB,EAAE,IAAI;gBAC1B,kBAAkB,EAAE,EAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAC;gBACzD,OAAO,EAAE,CAAC;gBACV,mBAAmB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC9B,UAAU,EAAE,IAAI;gBAChB,sBAAsB,EAAE,IAAI;aAC7B;SACF,CAAC;IACF,SAAS,EAAE,YAAY;CACxB,CAAC;AAEF,gCAAiB,CAAC,wCAAwC,EAAE,qBAAS,EAAE;IACrE,IAAI,YAA2B,CAAC;IAGhC,UAAU,CAAC;QAER,MAAc,CAAC,KAAK,GAAG,cAAO,CAAC,CAAC;QACjC,YAAY,GAAG,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC;QAEP,OAAQ,MA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CAAC;iBACzD,OAAO,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,MAAM,CAAC,IAAI,YAAY,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;iBAC5D,OAAO,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,IAAI,EAAE,CAAC;QACT,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE,UAAA,IAAI;QACjE,oBAAoB,CAAC,EAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;QAC/D,IAAM,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,EAAE;aACT,IAAI,CAAC,UAAA,cAAc;YAClB,IAAI,CAAC,IAAI,CACL,yDAAyD;gBACzD,uBAAuB,CAAC,CAAC;QAC/B,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG;YACR,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;iBACd,OAAO,CAAC,6CAA6C,CAAC,CAAC;YAC5D,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts new file mode 100644 index 0000000..52354fb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts @@ -0,0 +1,22 @@ +import { IORouter } from './router_registry'; +import { IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult } from './types'; +export declare function deleteDatabase(): Promise; +export declare class BrowserIndexedDB implements IOHandler { + protected readonly indexedDB: IDBFactory; + protected readonly modelPath: string; + static readonly URL_SCHEME: string; + constructor(modelPath: string); + save(modelArtifacts: ModelArtifacts): Promise; + load(): Promise; + private databaseAction; +} +export declare const indexedDBRouter: IORouter; +export declare function browserIndexedDB(modelPath: string): IOHandler; +export declare class BrowserIndexedDBManager implements ModelStoreManager { + private indexedDB; + constructor(); + listModels(): Promise<{ + [path: string]: ModelArtifactsInfo; + }>; + removeModel(path: string): Promise; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js new file mode 100644 index 0000000..ac6936a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js @@ -0,0 +1,309 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var io_utils_1 = require("./io_utils"); +var model_management_1 = require("./model_management"); +var router_registry_1 = require("./router_registry"); +var DATABASE_NAME = 'tensorflowjs'; +var DATABASE_VERSION = 1; +var MODEL_STORE_NAME = 'models_store'; +var INFO_STORE_NAME = 'model_info_store'; +function deleteDatabase() { + return __awaiter(this, void 0, void 0, function () { + var idbFactory; + return __generator(this, function (_a) { + idbFactory = getIndexedDBFactory(); + return [2, new Promise(function (resolve, reject) { + var deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME); + deleteRequest.onsuccess = function () { return resolve(); }; + deleteRequest.onerror = function (error) { return reject(error); }; + })]; + }); + }); +} +exports.deleteDatabase = deleteDatabase; +function getIndexedDBFactory() { + if (!environment_1.ENV.get('IS_BROWSER')) { + throw new Error('Failed to obtain IndexedDB factory because the current environment' + + 'is not a web browser.'); + } + var theWindow = window; + var factory = theWindow.indexedDB || theWindow.mozIndexedDB || + theWindow.webkitIndexedDB || theWindow.msIndexedDB || + theWindow.shimIndexedDB; + if (factory == null) { + throw new Error('The current browser does not appear to support IndexedDB.'); + } + return factory; +} +function setUpDatabase(openRequest) { + var db = openRequest.result; + db.createObjectStore(MODEL_STORE_NAME, { keyPath: 'modelPath' }); + db.createObjectStore(INFO_STORE_NAME, { keyPath: 'modelPath' }); +} +var BrowserIndexedDB = (function () { + function BrowserIndexedDB(modelPath) { + this.indexedDB = getIndexedDBFactory(); + if (modelPath == null || !modelPath) { + throw new Error('For IndexedDB, modelPath must not be null, undefined or empty.'); + } + this.modelPath = modelPath; + } + BrowserIndexedDB.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserLocalStorage.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + return [2, this.databaseAction(this.modelPath, modelArtifacts)]; + }); + }); + }; + BrowserIndexedDB.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, this.databaseAction(this.modelPath)]; + }); + }); + }; + BrowserIndexedDB.prototype.databaseAction = function (modelPath, modelArtifacts) { + var _this = this; + return new Promise(function (resolve, reject) { + var openRequest = _this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); + openRequest.onupgradeneeded = function () { return setUpDatabase(openRequest); }; + openRequest.onsuccess = function () { + var db = openRequest.result; + if (modelArtifacts == null) { + var modelTx = db.transaction(MODEL_STORE_NAME, 'readonly'); + var modelStore = modelTx.objectStore(MODEL_STORE_NAME); + var getRequest_1 = modelStore.get(_this.modelPath); + getRequest_1.onsuccess = function () { + if (getRequest_1.result == null) { + db.close(); + return reject(new Error("Cannot find model with path '" + _this.modelPath + "' " + + "in IndexedDB.")); + } + else { + resolve(getRequest_1.result.modelArtifacts); + } + }; + getRequest_1.onerror = function (error) { + db.close(); + return reject(getRequest_1.error); + }; + modelTx.oncomplete = function () { return db.close(); }; + } + else { + var modelArtifactsInfo_1 = io_utils_1.getModelArtifactsInfoForJSON(modelArtifacts); + var infoTx_1 = db.transaction(INFO_STORE_NAME, 'readwrite'); + var infoStore_1 = infoTx_1.objectStore(INFO_STORE_NAME); + var putInfoRequest_1 = infoStore_1.put({ modelPath: _this.modelPath, modelArtifactsInfo: modelArtifactsInfo_1 }); + var modelTx_1; + putInfoRequest_1.onsuccess = function () { + modelTx_1 = db.transaction(MODEL_STORE_NAME, 'readwrite'); + var modelStore = modelTx_1.objectStore(MODEL_STORE_NAME); + var putModelRequest = modelStore.put({ + modelPath: _this.modelPath, + modelArtifacts: modelArtifacts, + modelArtifactsInfo: modelArtifactsInfo_1 + }); + putModelRequest.onsuccess = function () { return resolve({ modelArtifactsInfo: modelArtifactsInfo_1 }); }; + putModelRequest.onerror = function (error) { + infoStore_1 = infoTx_1.objectStore(INFO_STORE_NAME); + var deleteInfoRequest = infoStore_1.delete(_this.modelPath); + deleteInfoRequest.onsuccess = function () { + db.close(); + return reject(putModelRequest.error); + }; + deleteInfoRequest.onerror = function (error) { + db.close(); + return reject(putModelRequest.error); + }; + }; + }; + putInfoRequest_1.onerror = function (error) { + db.close(); + return reject(putInfoRequest_1.error); + }; + infoTx_1.oncomplete = function () { + if (modelTx_1 == null) { + db.close(); + } + else { + modelTx_1.oncomplete = function () { return db.close(); }; + } + }; + } + }; + openRequest.onerror = function (error) { return reject(openRequest.error); }; + }); + }; + BrowserIndexedDB.URL_SCHEME = 'indexeddb://'; + return BrowserIndexedDB; +}()); +exports.BrowserIndexedDB = BrowserIndexedDB; +exports.indexedDBRouter = function (url) { + if (!environment_1.ENV.get('IS_BROWSER')) { + return null; + } + else { + if (url.startsWith(BrowserIndexedDB.URL_SCHEME)) { + return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length)); + } + else { + return null; + } + } +}; +router_registry_1.IORouterRegistry.registerSaveRouter(exports.indexedDBRouter); +router_registry_1.IORouterRegistry.registerLoadRouter(exports.indexedDBRouter); +function browserIndexedDB(modelPath) { + return new BrowserIndexedDB(modelPath); +} +exports.browserIndexedDB = browserIndexedDB; +function maybeStripScheme(key) { + return key.startsWith(BrowserIndexedDB.URL_SCHEME) ? + key.slice(BrowserIndexedDB.URL_SCHEME.length) : + key; +} +var BrowserIndexedDBManager = (function () { + function BrowserIndexedDBManager() { + this.indexedDB = getIndexedDBFactory(); + } + BrowserIndexedDBManager.prototype.listModels = function () { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + return [2, new Promise(function (resolve, reject) { + var openRequest = _this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); + openRequest.onupgradeneeded = function () { return setUpDatabase(openRequest); }; + openRequest.onsuccess = function () { + var db = openRequest.result; + var tx = db.transaction(INFO_STORE_NAME, 'readonly'); + var store = tx.objectStore(INFO_STORE_NAME); + var getAllInfoRequest = store.getAll(); + getAllInfoRequest.onsuccess = function () { + var out = {}; + for (var _i = 0, _a = getAllInfoRequest.result; _i < _a.length; _i++) { + var item = _a[_i]; + out[item.modelPath] = item.modelArtifactsInfo; + } + resolve(out); + }; + getAllInfoRequest.onerror = function (error) { + db.close(); + return reject(getAllInfoRequest.error); + }; + tx.oncomplete = function () { return db.close(); }; + }; + openRequest.onerror = function (error) { return reject(openRequest.error); }; + })]; + }); + }); + }; + BrowserIndexedDBManager.prototype.removeModel = function (path) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + path = maybeStripScheme(path); + return [2, new Promise(function (resolve, reject) { + var openRequest = _this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); + openRequest.onupgradeneeded = function () { return setUpDatabase(openRequest); }; + openRequest.onsuccess = function () { + var db = openRequest.result; + var infoTx = db.transaction(INFO_STORE_NAME, 'readwrite'); + var infoStore = infoTx.objectStore(INFO_STORE_NAME); + var getInfoRequest = infoStore.get(path); + var modelTx; + getInfoRequest.onsuccess = function () { + if (getInfoRequest.result == null) { + db.close(); + return reject(new Error("Cannot find model with path '" + path + "' " + + "in IndexedDB.")); + } + else { + var deleteInfoRequest = infoStore.delete(path); + var deleteModelData_1 = function () { + modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite'); + var modelStore = modelTx.objectStore(MODEL_STORE_NAME); + var deleteModelRequest = modelStore.delete(path); + deleteModelRequest.onsuccess = function () { + return resolve(getInfoRequest.result.modelArtifactsInfo); + }; + deleteModelRequest.onerror = function (error) { + return reject(getInfoRequest.error); + }; + }; + deleteInfoRequest.onsuccess = deleteModelData_1; + deleteInfoRequest.onerror = function (error) { + deleteModelData_1(); + db.close(); + return reject(getInfoRequest.error); + }; + } + }; + getInfoRequest.onerror = function (error) { + db.close(); + return reject(getInfoRequest.error); + }; + infoTx.oncomplete = function () { + if (modelTx == null) { + db.close(); + } + else { + modelTx.oncomplete = function () { return db.close(); }; + } + }; + }; + openRequest.onerror = function (error) { return reject(openRequest.error); }; + })]; + }); + }); + }; + return BrowserIndexedDBManager; +}()); +exports.BrowserIndexedDBManager = BrowserIndexedDBManager; +if (environment_1.ENV.get('IS_BROWSER')) { + try { + model_management_1.ModelStoreManagerRegistry.registerManager(BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager()); + } + catch (err) { + } +} +//# sourceMappingURL=indexed_db.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js.map new file mode 100644 index 0000000..f85e11c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indexed_db.js","sourceRoot":"","sources":["../../src/io/indexed_db.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8CAAmC;AACnC,uCAAwD;AACxD,uDAA6D;AAC7D,qDAA6D;AAG7D,IAAM,aAAa,GAAG,cAAc,CAAC;AACrC,IAAM,gBAAgB,GAAG,CAAC,CAAC;AAK3B,IAAM,gBAAgB,GAAG,cAAc,CAAC;AAIxC,IAAM,eA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EAAE,CAAC,KAAK,EAAE,CAAC;wCACX,OAAO,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oCACtC,CAAC,CAAC;iCACH;4BACH,CAAC,CAAC;4BACF,cAAc,CAAC,OAAO,GAAG,UAAA,KAAK;gCAC5B,EAAE,CAAC,KAAK,EAAE,CAAC;gCACX,OAAO,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;4BACtC,CAAC,CAAC;4BAEF,MAAM,CAAC,UAAU,GAAG;gCAClB,IAAI,OAAO,IAAI,IAAI,EAAE;oCACnB,EAAE,CAAC,KAAK,EAAE,CAAC;iCACZ;qCAAM;oCACL,OAAO,CAAC,UAAU,GAAG,cAAM,OAAA,EAAE,CAAC,KAAK,EAAE,EAAV,CAAU,CAAC;iCACvC;4BACH,CAAC,CAAC;wBACJ,CAAC,CAAC;wBACF,WAAW,CAAC,OAAO,GAAG,UAAA,KAAK,IAAI,OAAA,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAzB,CAAyB,CAAC;oBAC3D,CAAC,CAAC,EAAC;;;KACJ;IACH,8BAAC;AAAD,CAAC,AAtGD,IAsGC;AAtGY,0DAAuB;AAwGpC,IAAI,iBAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;IAGzB,IAAI;QACF,4CAAyB,CAAC,eAAe,CACrC,gBAAgB,CAAC,UAAU,EAAE,IAAI,uBAAuB,EAAE,CAAC,CAAC;KACjE;IAAC,OAAO,GAAG,EAAE;KACb;CACF"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js new file mode 100644 index 0000000..3c19df7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js @@ -0,0 +1,313 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var indexed_db_1 = require("./indexed_db"); +jasmine_util_1.describeWithFlags('IndexedDB', test_util_1.BROWSER_ENVS, function () { + var modelTopology1 = { + 'class_name': 'Sequential', + 'keras_version': '2.1.4', + 'config': [{ + 'class_name': 'Dense', + 'config': { + 'kernel_initializer': { + 'class_name': 'VarianceScaling', + 'config': { + 'distribution': 'uniform', + 'scale': 1.0, + 'seed': null, + 'mode': 'fan_avg' + } + }, + 'name': 'dense', + 'kernel_constraint': null, + 'bias_regularizer': null, + 'bias_constraint': null, + 'dtype': 'float32', + 'activation': 'linear', + 'trainable': true, + 'kernel_regularizer': null, + 'bias_initializer': { 'class_name': 'Zeros', 'config': {} }, + 'units': 1, + 'batch_input_shape': [null, 3], + 'use_bias': true, + 'activity_regularizer': null + } + }], + 'backend': 'tensorflow' + }; + var weightSpecs1 = [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [1], + dtype: 'float32', + } + ]; + var weightData1 = new ArrayBuffer(16); + var artifacts1 = { + modelTopology: modelTopology1, + weightSpecs: weightSpecs1, + weightData: weightData1, + }; + var weightSpecs2 = [ + { + name: 'dense/new_kernel', + shape: [5, 1], + dtype: 'float32', + }, + { + name: 'dense/new_bias', + shape: [1], + dtype: 'float32', + } + ]; + beforeEach(function (done) { + indexed_db_1.deleteDatabase().then(function () { + done(); + }); + }); + afterEach(function (done) { + indexed_db_1.deleteDatabase().then(function () { + done(); + }); + }); + it('Save-load round trip', function (done) { + var testStartDate = new Date(); + var handler = tf.io.getSaveHandlers('indexeddb://FooModel')[0]; + handler.save(artifacts1) + .then(function (saveResult) { + expect(saveResult.modelArtifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs1).length); + expect(saveResult.modelArtifactsInfo.weightDataBytes) + .toEqual(weightData1.byteLength); + handler.load() + .then(function (loadedArtifacts) { + expect(loadedArtifacts.modelTopology).toEqual(modelTopology1); + expect(loadedArtifacts.weightSpecs).toEqual(weightSpecs1); + test_util_1.expectArrayBuffersEqual(loadedArtifacts.weightData, weightData1); + done(); + }) + .catch(function (err) { + console.error(err.stack); + }); + }) + .catch(function (err) { + console.error(err.stack); + }); + }); + it('Save two models and load one', function (done) { + var weightData2 = new ArrayBuffer(24); + var artifacts2 = { + modelTopology: modelTopology1, + weightSpecs: weightSpecs2, + weightData: weightData2, + }; + var handler1 = tf.io.getSaveHandlers('indexeddb://Model/1')[0]; + handler1.save(artifacts1) + .then(function (saveResult1) { + expect(saveResult1.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult1.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs1).length); + expect(saveResult1.modelArtifactsInfo.weightDataBytes) + .toEqual(weightData1.byteLength); + var handler2 = tf.io.getSaveHandlers('indexeddb://Model/2')[0]; + handler2.save(artifacts2) + .then(function (saveResult2) { + expect(saveResult2.modelArtifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(saveResult1.modelArtifactsInfo.dateSaved.getTime()); + expect(saveResult2.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult2.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs2).length); + expect(saveResult2.modelArtifactsInfo.weightDataBytes) + .toEqual(weightData2.byteLength); + handler1.load() + .then(function (loadedArtifacts) { + expect(loadedArtifacts.modelTopology) + .toEqual(modelTopology1); + expect(loadedArtifacts.weightSpecs).toEqual(weightSpecs1); + test_util_1.expectArrayBuffersEqual(loadedArtifacts.weightData, weightData1); + done(); + }) + .catch(function (err) { + console.error(err.stack); + }); + }) + .catch(function (err) { + console.error(err.stack); + }); + }) + .catch(function (err) { + console.error(err.stack); + }); + }); + it('Loading nonexistent model fails', function (done) { + var handler = tf.io.getSaveHandlers('indexeddb://NonexistentModel')[0]; + handler.load() + .then(function (modelArtifacts) { + done.fail('Loading nonexistent model from IndexedDB succeeded unexpectly'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Cannot find model with path \'NonexistentModel\' in ' + + 'IndexedDB.'); + done(); + }); + }); + it('Null, undefined or empty modelPath throws Error', function () { + expect(function () { return indexed_db_1.browserIndexedDB(null); }) + .toThrowError(/IndexedDB, modelPath must not be null, undefined or empty/); + expect(function () { return indexed_db_1.browserIndexedDB(undefined); }) + .toThrowError(/IndexedDB, modelPath must not be null, undefined or empty/); + expect(function () { return indexed_db_1.browserIndexedDB(''); }) + .toThrowError(/IndexedDB, modelPath must not be null, undefined or empty./); + }); + it('router', function () { + expect(indexed_db_1.indexedDBRouter('indexeddb://bar') instanceof indexed_db_1.BrowserIndexedDB) + .toEqual(true); + expect(indexed_db_1.indexedDBRouter('localstorage://bar')).toBeNull(); + expect(indexed_db_1.indexedDBRouter('qux')).toBeNull(); + }); + it('Manager: List models: 0 result', function (done) { + new indexed_db_1.BrowserIndexedDBManager() + .listModels() + .then(function (out) { + expect(out).toEqual({}); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Manager: List models: 1 result', function (done) { + var handler = tf.io.getSaveHandlers('indexeddb://baz/QuxModel')[0]; + handler.save(artifacts1) + .then(function (saveResult) { + new indexed_db_1.BrowserIndexedDBManager() + .listModels() + .then(function (out) { + expect(Object.keys(out).length).toEqual(1); + expect(out['baz/QuxModel'].modelTopologyType) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyType); + expect(out['baz/QuxModel'].modelTopologyBytes) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes); + expect(out['baz/QuxModel'].weightSpecsBytes) + .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes); + expect(out['baz/QuxModel'].weightDataBytes) + .toEqual(saveResult.modelArtifactsInfo.weightDataBytes); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Manager: List models: 2 results', function (done) { + var handler1 = tf.io.getSaveHandlers('indexeddb://QuxModel')[0]; + handler1.save(artifacts1) + .then(function (saveResult1) { + var handler2 = tf.io.getSaveHandlers('indexeddb://repeat/QuxModel')[0]; + handler2.save(artifacts1) + .then(function (saveResult2) { + new indexed_db_1.BrowserIndexedDBManager() + .listModels() + .then(function (out) { + expect(Object.keys(out).length).toEqual(2); + expect(out['QuxModel'].modelTopologyType) + .toEqual(saveResult1.modelArtifactsInfo.modelTopologyType); + expect(out['QuxModel'].modelTopologyBytes) + .toEqual(saveResult1.modelArtifactsInfo + .modelTopologyBytes); + expect(out['QuxModel'].weightSpecsBytes) + .toEqual(saveResult1.modelArtifactsInfo.weightSpecsBytes); + expect(out['QuxModel'].weightDataBytes) + .toEqual(saveResult1.modelArtifactsInfo.weightDataBytes); + expect(out['repeat/QuxModel'].modelTopologyType) + .toEqual(saveResult2.modelArtifactsInfo.modelTopologyType); + expect(out['repeat/QuxModel'].modelTopologyBytes) + .toEqual(saveResult2.modelArtifactsInfo + .modelTopologyBytes); + expect(out['repeat/QuxModel'].weightSpecsBytes) + .toEqual(saveResult2.modelArtifactsInfo.weightSpecsBytes); + expect(out['repeat/QuxModel'].weightDataBytes) + .toEqual(saveResult2.modelArtifactsInfo.weightDataBytes); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Manager: Successful deleteModel', function (done) { + var handler1 = tf.io.getSaveHandlers('indexeddb://QuxModel')[0]; + handler1.save(artifacts1) + .then(function (saveResult1) { + var handler2 = tf.io.getSaveHandlers('indexeddb://repeat/QuxModel')[0]; + handler2.save(artifacts1) + .then(function (saveResult2) { + var manager = new indexed_db_1.BrowserIndexedDBManager(); + manager.removeModel('QuxModel') + .then(function (deletedInfo) { + manager.listModels() + .then(function (out) { + expect(Object.keys(out)).toEqual([ + 'repeat/QuxModel' + ]); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Manager: Successful deleteModel with URL scheme', function (done) { + var handler1 = tf.io.getSaveHandlers('indexeddb://QuxModel')[0]; + handler1.save(artifacts1) + .then(function (saveResult1) { + var handler2 = tf.io.getSaveHandlers('indexeddb://repeat/QuxModel')[0]; + handler2.save(artifacts1) + .then(function (saveResult2) { + var manager = new indexed_db_1.BrowserIndexedDBManager(); + manager.removeModel('indexeddb://QuxModel') + .then(function (deletedInfo) { + manager.listModels() + .then(function (out) { + expect(Object.keys(out)).toEqual([ + 'repeat/QuxModel' + ]); + done(); + }) + .catch(function (err) { return done.fail(err); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Manager: Failed deletedModel', function (done) { + new indexed_db_1.BrowserIndexedDBManager() + .removeModel('nonexistent') + .then(function (out) { + done.fail('Deleting nonexistent model succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Cannot find model with path \'nonexistent\' in IndexedDB.'); + done(); + }); + }); +}); +//# sourceMappingURL=indexed_db_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js.map new file mode 100644 index 0000000..2a5eeb0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indexed_db_test.js","sourceRoot":"","sources":["../../src/io/indexed_db_test.ts"],"names":[],"mappings":";;AAqBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAmE;AACnE,2CAA0H;AAE1H,gCAAiB,CAAC,WAAW,EAAE,wBAAY,EAAE;IAE3C,IAAM,cAAc,GAAO;QACzB,YAAY,EAAE,YAAY;QAC1B,eAAe,EAAE,OAAO;QACxB,QAAQ,EAAE,CAAC;gBACT,YAAY,EAAE,OAAO;gBACrB,QAAQ,EAAE;oBACR,oBAAoB,EAAE;wBACpB,YAAY,EAAE,iBAAiB;wBAC/B,QAAQ,EAAE;4BACR,cAAc,EAAE,SAAS;4BACzB,OAAO,EAAE,GAAG;4BACZ,MAAM,EAAE,IAAI;4BACZ,MAAM,EAAE,SAAS;yBAClB;qBACF;oBACD,MAAM,EAAE,OAAO;oBACf,mBAAmB,EAAE,IAAI;oBACzB,kBAAkB,EAAE,IAAI;oBACxB,iBAAiB,EAAE,IAAI;oBACvB,OAAO,EAAE,SAAS;oBAClB,YAAY,EAAE,QAAQ;oBACtB,WAAW,EAAE,IAAI;oBACjB,oBAAoB,EAAE,IAAI;oBAC1B,kBAAkB,EAAE,EAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAC;oBACzD,OAAO,EAAE,CAAC;oBACV,mBAAmB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;oBAC9B,UAAU,EAAE,IAAI;oBAChB,sBAAsB,EAAE,IAAI;iBAC7B;aACF,CAAC;QACF,SAAS,EAAE,YAAY;KACxB,CAAC;IACF,IAAM,YAAY,GAAiC;QACjD;YACE,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YACb,KAAK,EAAE,SAAS;SACjB;QACD;YACE,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,CAAC,CAAC,CAAC;YACV,KAAK,EAAE,SA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C,OAAO,CAAC;4BAC/B,iBAAiB;yBAClB,CAAC,CAAC;wBACH,IAAI,EAAE,CAAC;oBACT,CAAC,CAAC;yBACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAd,CAAc,CAAC,CAAC;gBACpC,CAAC,CAAC;qBACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;YAC1C,CAAC,CAAC;iBACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;QAC1C,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,UAAA,IAAI;QAErC,IAAI,oCAAuB,EAAE;aACxB,WAAW,CAAC,aAAa,CAAC;aAC1B,IAAI,CAAC,UAAA,GAAG;YACP,IAAI,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;QAClE,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG;YACR,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;iBACd,OAAO,CACJ,2DAA2D,CAAC,CAAC;YACrE,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts new file mode 100644 index 0000000..9c53f97 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts @@ -0,0 +1,15 @@ +import './indexed_db'; +import './local_storage'; +import { browserFiles } from './browser_files'; +import { browserHTTPRequest } from './browser_http'; +import { concatenateArrayBuffers, decodeWeights, encodeWeights, getModelArtifactsInfoForJSON } from './io_utils'; +import { fromMemory, withSaveHandler } from './passthrough'; +import { IORouterRegistry } from './router_registry'; +import { IOHandler, LoadHandler, ModelArtifacts, ModelStoreManager, SaveConfig, SaveHandler, SaveResult, WeightsManifestConfig, WeightsManifestEntry } from './types'; +import { loadWeights } from './weights_loader'; +declare const registerSaveRouter: typeof IORouterRegistry.registerSaveRouter; +declare const registerLoadRouter: typeof IORouterRegistry.registerLoadRouter; +declare const getSaveHandlers: typeof IORouterRegistry.getSaveHandlers; +declare const getLoadHandlers: typeof IORouterRegistry.getLoadHandlers; +export { copyModel, listModels, moveModel, removeModel } from './model_management'; +export { browserFiles, browserHTTPRequest, concatenateArrayBuffers, decodeWeights, encodeWeights, fromMemory, getLoadHandlers, getModelArtifactsInfoForJSON, getSaveHandlers, IOHandler, LoadHandler, loadWeights, ModelArtifacts, ModelStoreManager, registerLoadRouter, registerSaveRouter, SaveConfig, SaveHandler, SaveResult, WeightsManifestConfig, WeightsManifestEntry, withSaveHandler }; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io.js b/node_modules/@tensorflow/tfjs-core/dist/io/io.js new file mode 100644 index 0000000..07f5b2a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/io.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +require("./indexed_db"); +require("./local_storage"); +var browser_files_1 = require("./browser_files"); +exports.browserFiles = browser_files_1.browserFiles; +var browser_http_1 = require("./browser_http"); +exports.browserHTTPRequest = browser_http_1.browserHTTPRequest; +var io_utils_1 = require("./io_utils"); +exports.concatenateArrayBuffers = io_utils_1.concatenateArrayBuffers; +exports.decodeWeights = io_utils_1.decodeWeights; +exports.encodeWeights = io_utils_1.encodeWeights; +exports.getModelArtifactsInfoForJSON = io_utils_1.getModelArtifactsInfoForJSON; +var passthrough_1 = require("./passthrough"); +exports.fromMemory = passthrough_1.fromMemory; +exports.withSaveHandler = passthrough_1.withSaveHandler; +var router_registry_1 = require("./router_registry"); +var weights_loader_1 = require("./weights_loader"); +exports.loadWeights = weights_loader_1.loadWeights; +var registerSaveRouter = router_registry_1.IORouterRegistry.registerSaveRouter; +exports.registerSaveRouter = registerSaveRouter; +var registerLoadRouter = router_registry_1.IORouterRegistry.registerLoadRouter; +exports.registerLoadRouter = registerLoadRouter; +var getSaveHandlers = router_registry_1.IORouterRegistry.getSaveHandlers; +exports.getSaveHandlers = getSaveHandlers; +var getLoadHandlers = router_registry_1.IORouterRegistry.getLoadHandlers; +exports.getLoadHandlers = getLoadHandlers; +var model_management_1 = require("./model_management"); +exports.copyModel = model_management_1.copyModel; +exports.listModels = model_management_1.listModels; +exports.moveModel = model_management_1.moveModel; +exports.removeModel = model_management_1.removeModel; +//# sourceMappingURL=io.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/io.js.map new file mode 100644 index 0000000..fae71e4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/io.js.map @@ -0,0 +1 @@ +{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/io/io.ts"],"names":[],"mappings":";;AAmBA,wBAAsB;AACtB,2BAAyB;AAEzB,iDAA6C;AAgB3C,uBAhBM,4BAAY,CAgBN;AAfd,+CAAkD;AAgBhD,6BAhBM,iCAAkB,CAgBN;AAfpB,uCAA+G;AAgB7G,kCAhBM,kCAAuB,CAgBN;AACvB,wBAjB+B,wBAAa,CAiB/B;AACb,wBAlB8C,wBAAa,CAkB9C;AAGb,uCArB6D,uCAA4B,CAqB7D;AApB9B,6CAA0D;AAkBxD,qBAlBM,wBAAU,CAkBN;AAgBV,0BAlCkB,6BAAe,CAkClB;AAjCjB,qDAAmD;AAEnD,mDAA6C;AAqB3C,sBArBM,4BAAW,CAqBN;AAnBb,IAAM,kBAAkB,GAAG,kCAAgB,CAAC,kBAAkB,CAAC;AAuB7D,gDAAkB;AAtBpB,IAAM,kBAAkB,GAAG,kCAAgB,CAAC,kBAAkB,CAAC;AAqB7D,gDAAkB;AApBpB,IAAM,eAAe,GAAG,kCAAgB,CAAC,eAAe,CAAC;AAcvD,0CAAe;AAbjB,IAAM,eAAe,GAAG,kCAAgB,CAAC,eAAe,CAAC;AAWvD,0CAAe;AATjB,uDAAiF;AAAzE,uCAAA,SAAS,CAAA;AAAE,wCAAA,UAAU,CAAA;AAAE,uCAAA,SAAS,CAAA;AAAE,yCAAA,WAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts new file mode 100644 index 0000000..8c70b11 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts @@ -0,0 +1,15 @@ +import { NamedTensorMap } from '../tensor_types'; +import { TypedArray } from '../types'; +import { ModelArtifacts, ModelArtifactsInfo, WeightsManifestEntry } from './types'; +export declare function encodeWeights(tensors: NamedTensorMap): Promise<{ + data: ArrayBuffer; + specs: WeightsManifestEntry[]; +}>; +export declare function decodeWeights(buffer: ArrayBuffer, specs: WeightsManifestEntry[]): NamedTensorMap; +export declare function concatenateTypedArrays(xs: TypedArray[]): ArrayBuffer; +export declare function stringByteLength(str: string): number; +export declare function arrayBufferToBase64String(buffer: ArrayBuffer): string; +export declare function base64StringToArrayBuffer(str: string): ArrayBuffer; +export declare function concatenateArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer; +export declare function basename(path: string): string; +export declare function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts): ModelArtifactsInfo; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js new file mode 100644 index 0000000..0ccd90f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js @@ -0,0 +1,195 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tensor_ops_1 = require("../ops/tensor_ops"); +var util_1 = require("../util"); +var types_1 = require("./types"); +function encodeWeights(tensors) { + return __awaiter(this, void 0, void 0, function () { + var specs, dataPromises, name_1, t, tensorValues; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + specs = []; + dataPromises = []; + for (name_1 in tensors) { + t = tensors[name_1]; + if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool') { + throw new Error("Unsupported dtype in weight '" + name_1 + "': " + t.dtype); + } + specs.push({ name: name_1, shape: t.shape, dtype: t.dtype }); + dataPromises.push(t.data()); + } + return [4, Promise.all(dataPromises)]; + case 1: + tensorValues = _a.sent(); + return [2, { data: concatenateTypedArrays(tensorValues), specs: specs }]; + } + }); + }); +} +exports.encodeWeights = encodeWeights; +function decodeWeights(buffer, specs) { + var out = {}; + var offset = 0; + for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { + var spec = specs_1[_i]; + var name_2 = spec.name; + var dtype = spec.dtype; + var shape = spec.shape; + if (spec.quantization != null) { + throw new Error("decodeWeights does not support quantization yet, but encountered " + + ("weight '" + name_2 + " with quantization.'")); + } + var size = util_1.sizeFromShape(shape); + var value = void 0; + if (dtype === 'float32') { + value = tensor_ops_1.tensor(new Float32Array(buffer, offset, size), shape, 'float32'); + } + else if (dtype === 'int32') { + value = tensor_ops_1.tensor(new Int32Array(buffer, offset, size), shape, 'int32'); + } + else if (dtype === 'bool') { + value = tensor_ops_1.tensor(new Uint8Array(buffer, offset, size), shape, 'bool'); + } + else { + throw new Error("Unsupported dtype in weight '" + name_2 + "': " + dtype); + } + out[name_2] = value; + offset += size * types_1.DTYPE_VALUE_SIZE_MAP[dtype]; + } + return out; +} +exports.decodeWeights = decodeWeights; +function concatenateTypedArrays(xs) { + if (xs === null) { + throw new Error("Invalid input value: " + JSON.stringify(xs)); + } + var totalByteLength = 0; + var normalizedXs = []; + xs.forEach(function (x) { + totalByteLength += x.byteLength; + normalizedXs.push(x.byteLength === x.buffer.byteLength ? x : + new x.constructor(x)); + if (!(x instanceof Float32Array || x instanceof Int32Array || + x instanceof Uint8Array)) { + throw new Error("Unsupported TypedArray subtype: " + x.constructor.name); + } + }); + var y = new Uint8Array(totalByteLength); + var offset = 0; + normalizedXs.forEach(function (x) { + y.set(new Uint8Array(x.buffer), offset); + offset += x.byteLength; + }); + return y.buffer; +} +exports.concatenateTypedArrays = concatenateTypedArrays; +var useNodeBuffer = typeof Buffer !== 'undefined' && + (typeof Blob === 'undefined' || typeof atob === 'undefined' || + typeof btoa === 'undefined'); +function stringByteLength(str) { + if (useNodeBuffer) { + return Buffer.byteLength(str); + } + return new Blob([str]).size; +} +exports.stringByteLength = stringByteLength; +function arrayBufferToBase64String(buffer) { + if (useNodeBuffer) { + return Buffer.from(buffer).toString('base64'); + } + return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer))); +} +exports.arrayBufferToBase64String = arrayBufferToBase64String; +function base64StringToArrayBuffer(str) { + if (useNodeBuffer) { + var buf = Buffer.from(str, 'base64'); + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + } + var s = atob(str); + var buffer = new Uint8Array(s.length); + for (var i = 0; i < s.length; ++i) { + buffer.set([s.charCodeAt(i)], i); + } + return buffer.buffer; +} +exports.base64StringToArrayBuffer = base64StringToArrayBuffer; +function concatenateArrayBuffers(buffers) { + var totalByteLength = 0; + buffers.forEach(function (buffer) { + totalByteLength += buffer.byteLength; + }); + var temp = new Uint8Array(totalByteLength); + var offset = 0; + buffers.forEach(function (buffer) { + temp.set(new Uint8Array(buffer), offset); + offset += buffer.byteLength; + }); + return temp.buffer; +} +exports.concatenateArrayBuffers = concatenateArrayBuffers; +function basename(path) { + var SEPARATOR = '/'; + path = path.trim(); + while (path.endsWith(SEPARATOR)) { + path = path.slice(0, path.length - 1); + } + var items = path.split(SEPARATOR); + return items[items.length - 1]; +} +exports.basename = basename; +function getModelArtifactsInfoForJSON(modelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('Expected JSON model topology, received ArrayBuffer.'); + } + return { + dateSaved: new Date(), + modelTopologyType: 'JSON', + modelTopologyBytes: modelArtifacts.modelTopology == null ? + 0 : + stringByteLength(JSON.stringify(modelArtifacts.modelTopology)), + weightSpecsBytes: modelArtifacts.weightSpecs == null ? + 0 : + stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)), + weightDataBytes: modelArtifacts.weightData == null ? + 0 : + modelArtifacts.weightData.byteLength, + }; +} +exports.getModelArtifactsInfoForJSON = getModelArtifactsInfoForJSON; +//# sourceMappingURL=io_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js.map new file mode 100644 index 0000000..e8e3574 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"io_utils.js","sourceRoot":"","sources":["../../src/io/io_utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,gDAAyC;AAIzC,gCAAsC;AACtC,iCAAuG;AAkBvG,uBAAoC,OAAuB;;;;;;oBAGnD,KAAK,GAA2B,EAAE,CAAC;oBACnC,YAAY,GAA+B,EAAE,CAAC;oBACpD,KAAW,MAAI,IAAI,OAAO,EAAE;wBACpB,CAAC,GAAG,OAAO,CAAC,MAAI,CAAC,CAAC;wBAExB,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,EAAE;4BACtE,MAAM,IAAI,KAAK,CAAC,kCAAgC,MAAI,WAAM,CAAC,CAAC,KAAO,CAAC,CAAC;yBACtE;wBACD,KAAK,CAAC,IAAI,CAAC,EAAC,IAAI,QAAA,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,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AAI,cAAc,CAAC,aAAa,YAAY,WAAW,EAAE;QACvD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KACxE;IAED,OAAO;QACL,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,iBAAiB,EAAE,MAAM;QACzB,kBAAkB,EAAE,cAAc,CAAC,aAAa,IAAI,IAAI,CAAC,CAAC;YACtD,CAAC,CAAC,CAAC;YACH,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAClE,gBAAgB,EAAE,cAAc,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;YAClD,CAAC,CAAC,CAAC;YACH,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAChE,eAAe,EAAE,cAAc,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;YACH,cAAc,CAAC,UAAU,CAAC,UAAU;KACzC,CAAC;AACJ,CAAC;AAnBD,oEAmBC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js new file mode 100644 index 0000000..387305d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js @@ -0,0 +1,465 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var ops_1 = require("../ops/ops"); +var test_util_1 = require("../test_util"); +var io_utils_1 = require("./io_utils"); +describe('concatenateTypedArrays', function () { + it('Single float arrays', function () { + var x = new Float32Array([1.1, 2.2, 3.3]); + var buffer = io_utils_1.concatenateTypedArrays([x]); + expect(buffer.byteLength).toEqual(12); + expect(new Float32Array(buffer, 0, 3)).toEqual(x); + }); + it('Float arrays', function () { + var x = new Float32Array([1.1, 2.2, 3.3]); + var y = new Float32Array([-1.1, -2.2, -3.3]); + var buffer = io_utils_1.concatenateTypedArrays([x, y]); + expect(buffer.byteLength).toEqual(24); + expect(new Float32Array(buffer, 0, 3)).toEqual(x); + expect(new Float32Array(buffer, 12, 3)).toEqual(y); + }); + it('Single int32 arrays', function () { + var x = new Int32Array([11, 22, 33]); + var buffer = io_utils_1.concatenateTypedArrays([x]); + expect(buffer.byteLength).toEqual(12); + expect(new Int32Array(buffer, 0, 3)).toEqual(x); + }); + it('Int32 arrays', function () { + var x = new Int32Array([11, 22, 33]); + var y = new Int32Array([-11, -22, -33]); + var buffer = io_utils_1.concatenateTypedArrays([x, y]); + expect(buffer.byteLength).toEqual(24); + expect(new Int32Array(buffer, 0, 3)).toEqual(x); + expect(new Int32Array(buffer, 12, 3)).toEqual(y); + }); + it('Single uint8 arrays', function () { + var x = new Uint8Array([11, 22, 33]); + var buffer = io_utils_1.concatenateTypedArrays([x]); + expect(buffer.byteLength).toEqual(3); + expect(new Uint8Array(buffer, 0, 3)).toEqual(x); + }); + it('Uint8 arrays', function () { + var x = new Uint8Array([11, 22, 33]); + var y = new Uint8Array([111, 122, 133]); + var buffer = io_utils_1.concatenateTypedArrays([x, y]); + expect(buffer.byteLength).toEqual(6); + expect(new Uint8Array(buffer, 0, 3)).toEqual(x); + expect(new Uint8Array(buffer, 3, 3)).toEqual(y); + }); + it('Mixed Uint8, Int32 and Float32 arrays', function () { + var x = new Uint8Array([0, 1, 1, 0]); + var y = new Int32Array([10, 20, 30, 40]); + var z = new Float32Array([-1.1, -2.2, -3.3, -4.4]); + var buffer = io_utils_1.concatenateTypedArrays([x, y, z]); + expect(buffer.byteLength).toEqual(1 * 4 + 4 * 4 + 4 * 4); + expect(new Uint8Array(buffer, 0, 4)).toEqual(x); + expect(new Int32Array(buffer, 4, 4)).toEqual(y); + expect(new Float32Array(buffer, 20, 4)).toEqual(z); + }); + it('Concatenate Float32Arrays from SubArrays', function () { + var x1 = new Float32Array([1.1, 2.2, 3.3]); + var x2 = new Float32Array([-1.1, -2.2, -3.3]); + var xConcatenated = io_utils_1.concatenateTypedArrays([x1, x2]); + var y1 = new Float32Array(xConcatenated, 0, 3); + var y2 = new Float32Array(xConcatenated, 3 * 4, 3); + expect(y1.buffer.byteLength).toEqual(6 * 4); + expect(y2.buffer.byteLength).toEqual(6 * 4); + var yConcatenated = io_utils_1.concatenateTypedArrays([y1, y2]); + expect(yConcatenated.byteLength).toEqual(6 * 4); + expect(new Float32Array(yConcatenated, 0, 3)).toEqual(x1); + expect(new Float32Array(yConcatenated, 3 * 4, 3)).toEqual(x2); + }); + it('Concatenate Int32Array from SubArrays', function () { + var x1 = new Int32Array([11, 22, 33]); + var x2 = new Int32Array([-11, -22, -33]); + var xConcatenated = io_utils_1.concatenateTypedArrays([x1, x2]); + var y1 = new Int32Array(xConcatenated, 0, 3); + var y2 = new Int32Array(xConcatenated, 3 * 4, 3); + expect(y1.buffer.byteLength).toEqual(6 * 4); + expect(y2.buffer.byteLength).toEqual(6 * 4); + var yConcatenated = io_utils_1.concatenateTypedArrays([y1, y2]); + expect(yConcatenated.byteLength).toEqual(6 * 4); + expect(new Int32Array(yConcatenated, 0, 3)).toEqual(x1); + expect(new Int32Array(yConcatenated, 3 * 4, 3)).toEqual(x2); + }); + it('Concatenate Uint8Array from SubArrays', function () { + var x1 = new Uint8Array([11, 22, 33]); + var x2 = new Uint8Array([44, 55, 66]); + var xConcatenated = io_utils_1.concatenateTypedArrays([x1, x2]); + var y1 = new Uint8Array(xConcatenated, 0, 3); + var y2 = new Uint8Array(xConcatenated, 3, 3); + expect(y1.buffer.byteLength).toEqual(6); + expect(y2.buffer.byteLength).toEqual(6); + var yConcatenated = io_utils_1.concatenateTypedArrays([y1, y2]); + expect(yConcatenated.byteLength).toEqual(6); + expect(new Uint8Array(yConcatenated, 0, 3)).toEqual(x1); + expect(new Uint8Array(yConcatenated, 3, 3)).toEqual(x2); + }); + it('Concatenate mixed TypedArrays from SubArrays', function () { + var x1 = new Uint8Array([11, 22, 33, 44]); + var x2 = new Int32Array([-44, -55, -66]); + var x3 = new Float32Array([1.1, 2.2, 3.3]); + var xConcatenated = io_utils_1.concatenateTypedArrays([x1, x2, x3]); + var y1 = new Uint8Array(xConcatenated, 0, 4); + var y2 = new Int32Array(xConcatenated, 4, 3); + var y3 = new Float32Array(xConcatenated, 4 + 3 * 4, 3); + expect(y1.buffer.byteLength).toEqual(4 + 3 * 4 + 3 * 4); + expect(y2.buffer.byteLength).toEqual(4 + 3 * 4 + 3 * 4); + expect(y3.buffer.byteLength).toEqual(4 + 3 * 4 + 3 * 4); + var yConcatenated = io_utils_1.concatenateTypedArrays([y1, y2, y3]); + expect(yConcatenated.byteLength).toEqual(4 + 3 * 4 + 3 * 4); + expect(new Uint8Array(yConcatenated, 0, 4)).toEqual(x1); + expect(new Int32Array(yConcatenated, 4, 3)).toEqual(x2); + expect(new Float32Array(yConcatenated, 4 + 3 * 4, 3)).toEqual(x3); + }); + it('null and undefined inputs', function () { + expect(function () { return io_utils_1.concatenateTypedArrays(null); }).toThrow(); + expect(function () { return io_utils_1.concatenateTypedArrays(undefined); }).toThrow(); + }); + it('empty input array', function () { + expect(io_utils_1.concatenateTypedArrays([]).byteLength).toEqual(0); + }); + it('Unsupported dtype', function () { + var x = new Int16Array([0, 1, 1, 0]); + expect(function () { return io_utils_1.concatenateTypedArrays([x]); }) + .toThrowError(/Unsupported TypedArray subtype: Int16Array/); + }); +}); +describe('encodeWeights', function () { + it('Float32 tensors', function (done) { return __awaiter(_this, void 0, void 0, function () { + var tensors; + return __generator(this, function (_a) { + tensors = { + x1: ops_1.tensor2d([[10, 20], [30, 40]]), + x2: ops_1.scalar(42), + x3: ops_1.tensor1d([-1.3, -3.7, 1.3, 3.7]), + }; + tf.io.encodeWeights(tensors) + .then(function (dataAndSpecs) { + var data = dataAndSpecs.data; + var specs = dataAndSpecs.specs; + expect(data.byteLength).toEqual(4 * (4 + 1 + 4)); + expect(new Float32Array(data, 0, 4)).toEqual(new Float32Array([ + 10, 20, 30, 40 + ])); + expect(new Float32Array(data, 16, 1)).toEqual(new Float32Array([42])); + expect(new Float32Array(data, 20, 4)).toEqual(new Float32Array([ + -1.3, -3.7, 1.3, 3.7 + ])); + expect(specs).toEqual([ + { + name: 'x1', + dtype: 'float32', + shape: [2, 2], + }, + { + name: 'x2', + dtype: 'float32', + shape: [], + }, + { + name: 'x3', + dtype: 'float32', + shape: [4], + } + ]); + done(); + }) + .catch(function (err) { + console.error(err.stack); + }); + return [2]; + }); + }); }); + it('Int32 tensors', function (done) { return __awaiter(_this, void 0, void 0, function () { + var tensors; + return __generator(this, function (_a) { + tensors = { + x1: ops_1.tensor2d([[10, 20], [30, 40]], [2, 2], 'int32'), + x2: ops_1.scalar(42, 'int32'), + x3: ops_1.tensor1d([-1, -3, -3, -7], 'int32'), + }; + tf.io.encodeWeights(tensors) + .then(function (dataAndSpecs) { + var data = dataAndSpecs.data; + var specs = dataAndSpecs.specs; + expect(data.byteLength).toEqual(4 * (4 + 1 + 4)); + expect(new Int32Array(data, 0, 4)).toEqual(new Int32Array([ + 10, 20, 30, 40 + ])); + expect(new Int32Array(data, 16, 1)).toEqual(new Int32Array([42])); + expect(new Int32Array(data, 20, 4)).toEqual(new Int32Array([ + -1, -3, -3, -7 + ])); + expect(specs).toEqual([ + { + name: 'x1', + dtype: 'int32', + shape: [2, 2], + }, + { + name: 'x2', + dtype: 'int32', + shape: [], + }, + { + name: 'x3', + dtype: 'int32', + shape: [4], + } + ]); + done(); + }) + .catch(function (err) { + console.error(err.stack); + }); + return [2]; + }); + }); }); + it('Bool tensors', function (done) { return __awaiter(_this, void 0, void 0, function () { + var tensors; + return __generator(this, function (_a) { + tensors = { + x1: ops_1.tensor2d([[true, false], [false, true]], [2, 2], 'bool'), + x2: ops_1.scalar(false, 'bool'), + x3: ops_1.tensor1d([false, true, true, false], 'bool'), + }; + tf.io.encodeWeights(tensors) + .then(function (dataAndSpecs) { + var data = dataAndSpecs.data; + var specs = dataAndSpecs.specs; + expect(data.byteLength).toEqual(4 + 1 + 4); + expect(new Uint8Array(data, 0, 4)).toEqual(new Uint8Array([ + 1, 0, 0, 1 + ])); + expect(new Uint8Array(data, 4, 1)).toEqual(new Uint8Array([0])); + expect(new Uint8Array(data, 5, 4)).toEqual(new Uint8Array([ + 0, 1, 1, 0 + ])); + expect(specs).toEqual([ + { + name: 'x1', + dtype: 'bool', + shape: [2, 2], + }, + { + name: 'x2', + dtype: 'bool', + shape: [], + }, + { + name: 'x3', + dtype: 'bool', + shape: [4], + } + ]); + done(); + }) + .catch(function (err) { + console.error(err.stack); + }); + return [2]; + }); + }); }); + it('Mixed dtype tensors', function (done) { return __awaiter(_this, void 0, void 0, function () { + var tensors; + return __generator(this, function (_a) { + tensors = { + x1: ops_1.tensor2d([[10, 20], [30, 40]], [2, 2], 'int32'), + x2: ops_1.scalar(13.37, 'float32'), + x3: ops_1.tensor1d([true, false, false, true], 'bool'), + }; + tf.io.encodeWeights(tensors) + .then(function (dataAndSpecs) { + var data = dataAndSpecs.data; + var specs = dataAndSpecs.specs; + expect(data.byteLength).toEqual(4 * 4 + 4 * 1 + 1 * 4); + expect(new Int32Array(data, 0, 4)).toEqual(new Int32Array([ + 10, 20, 30, 40 + ])); + expect(new Float32Array(data, 16, 1)) + .toEqual(new Float32Array([13.37])); + expect(new Uint8Array(data, 20, 4)).toEqual(new Uint8Array([ + 1, 0, 0, 1 + ])); + expect(specs).toEqual([ + { + name: 'x1', + dtype: 'int32', + shape: [2, 2], + }, + { + name: 'x2', + dtype: 'float32', + shape: [], + }, + { + name: 'x3', + dtype: 'bool', + shape: [4], + } + ]); + done(); + }) + .catch(function (err) { + console.error(err.stack); + }); + return [2]; + }); + }); }); +}); +describe('decodeWeights', function () { + it('Mixed dtype tensors', function (done) { return __awaiter(_this, void 0, void 0, function () { + var tensors; + return __generator(this, function (_a) { + tensors = { + x1: ops_1.tensor2d([[10, 20], [30, 40]], [2, 2], 'int32'), + x2: ops_1.scalar(13.37, 'float32'), + x3: ops_1.tensor1d([true, false, false, true], 'bool'), + y1: ops_1.tensor2d([-10, -20, -30], [3, 1], 'float32'), + }; + tf.io.encodeWeights(tensors) + .then(function (dataAndSpecs) { + var data = dataAndSpecs.data; + var specs = dataAndSpecs.specs; + expect(data.byteLength).toEqual(4 * 4 + 4 * 1 + 1 * 4 + 4 * 3); + var decoded = tf.io.decodeWeights(data, specs); + expect(Object.keys(decoded).length).toEqual(4); + test_util_1.expectArraysEqual(decoded['x1'], tensors['x1']); + test_util_1.expectArraysEqual(decoded['x2'], tensors['x2']); + test_util_1.expectArraysEqual(decoded['x3'], tensors['x3']); + test_util_1.expectArraysEqual(decoded['y1'], tensors['y1']); + done(); + }) + .catch(function (err) { + console.error(err.stack); + }); + return [2]; + }); + }); }); + it('Unsupported dtype raises Error', function () { + var buffer = new ArrayBuffer(4); + var specs = [ + { + name: 'x', + dtype: 'int16', + shape: [], + }, + { name: 'y', dtype: 'int16', shape: [] } + ]; + expect(function () { return tf.io.decodeWeights(buffer, specs); }) + .toThrowError(/Unsupported dtype in weight \'x\': int16/); + }); +}); +describe('stringByteLength', function () { + it('ASCII only', function () { + var str = '_Lorem ipsum 1337!'; + expect(io_utils_1.stringByteLength(str)).toEqual(str.length); + }); + it('Mixed narrow and wide chars', function () { + var str = 'aЖ文1'; + expect(io_utils_1.stringByteLength(str.slice(0, 1))).toEqual(1); + expect(io_utils_1.stringByteLength(str.slice(0, 2))).toEqual(3); + expect(io_utils_1.stringByteLength(str.slice(0, 3))).toEqual(6); + expect(io_utils_1.stringByteLength(str.slice(0, 4))).toEqual(7); + }); +}); +describe('arrayBufferToBase64String-base64StringToArrayBuffer', function () { + it('Round trip', function () { + var x = []; + for (var k = 0; k < 2; ++k) { + for (var i = 0; i < 254; ++i) { + x.push(i + k); + } + for (var i = 254; i >= 0; --i) { + x.push(i + k); + } + } + var buffer = Uint8Array.from(x).buffer; + var base64Str = io_utils_1.arrayBufferToBase64String(buffer); + var decoded = Array.from(new Uint8Array(io_utils_1.base64StringToArrayBuffer(base64Str))); + expect(decoded).toEqual(x); + }); +}); +describe('concatenateArrayBuffers', function () { + it('Concatenate 3 non-empty ArrayBuffers', function () { + var buffer1 = new Uint8Array([1, 2, 3]); + var buffer2 = new Uint8Array([11, 22, 33, 44]); + var buffer3 = new Uint8Array([111, 222, 100]); + var out = io_utils_1.concatenateArrayBuffers([buffer1.buffer, buffer2.buffer, buffer3.buffer]); + expect(new Uint8Array(out)).toEqual(new Uint8Array([ + 1, 2, 3, 11, 22, 33, 44, 111, 222, 100 + ])); + }); + it('Concatenate non-empty and empty ArrayBuffers', function () { + var buffer1 = new Uint8Array([1, 2, 3]); + var buffer2 = new Uint8Array([11, 22, 33, 44]); + var buffer3 = new Uint8Array([]); + var buffer4 = new Uint8Array([150, 100, 50]); + var out = io_utils_1.concatenateArrayBuffers([buffer1.buffer, buffer2.buffer, buffer3.buffer, buffer4.buffer]); + expect(new Uint8Array(out)).toEqual(new Uint8Array([ + 1, 2, 3, 11, 22, 33, 44, 150, 100, 50 + ])); + }); + it('A single ArrayBuffer', function () { + var buffer1 = new Uint8Array([1, 3, 3, 7]); + var out = io_utils_1.concatenateArrayBuffers([buffer1.buffer]); + expect(new Uint8Array(out)).toEqual(buffer1); + }); + it('Zero ArrayBuffers', function () { + expect(new Uint8Array(io_utils_1.concatenateArrayBuffers([]))) + .toEqual(new Uint8Array([])); + }); +}); +describe('basename', function () { + it('Paths without slashes', function () { + expect(io_utils_1.basename('foo.txt')).toEqual('foo.txt'); + expect(io_utils_1.basename('bar')).toEqual('bar'); + }); + it('Paths with slashes', function () { + expect(io_utils_1.basename('qux/foo.txt')).toEqual('foo.txt'); + expect(io_utils_1.basename('qux/My Model.json')).toEqual('My Model.json'); + expect(io_utils_1.basename('foo/bar/baz')).toEqual('baz'); + expect(io_utils_1.basename('/foo/bar/baz')).toEqual('baz'); + expect(io_utils_1.basename('foo/bar/baz/')).toEqual('baz'); + expect(io_utils_1.basename('foo/bar/baz//')).toEqual('baz'); + }); +}); +//# sourceMappingURL=io_utils_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js.map new file mode 100644 index 0000000..eebc1ba --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"io_utils_test.js","sourceRoot":"","sources":["../../src/io/io_utils_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBAycA;;AAzcA,6BAA+B;AAC/B,kCAAsD;AAEtD,0CAA+C;AAC/C,uCAA6J;AAE7J,QAAQ,CAAC,wBAAwB,EAAE;IACjC,EAAE,CAAC,qBAAqB,EAAE;QACxB,IAAM,CAAC,GAAG,IAAI,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC5C,IAAM,MAAM,GAAG,iCAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,cAAc,EAAE;QACjB,IAAM,CAAC,GAAG,IAAI,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC5C,IAAM,CAAC,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/C,IAAM,MAAM,GAAG,iCAA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/local_storage.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts new file mode 100644 index 0000000..567e324 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts @@ -0,0 +1,24 @@ +import { IORouter } from './router_registry'; +import { IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult } from './types'; +export declare function purgeLocalStorageArtifacts(): string[]; +export declare class BrowserLocalStorage implements IOHandler { + protected readonly LS: Storage; + protected readonly modelPath: string; + protected readonly keys: { + [key: string]: string; + }; + static readonly URL_SCHEME: string; + constructor(modelPath: string); + save(modelArtifacts: ModelArtifacts): Promise; + load(): Promise; +} +export declare const localStorageRouter: IORouter; +export declare function browserLocalStorage(modelPath: string): IOHandler; +export declare class BrowserLocalStorageManager implements ModelStoreManager { + private readonly LS; + constructor(); + listModels(): Promise<{ + [path: string]: ModelArtifactsInfo; + }>; + removeModel(path: string): Promise; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js new file mode 100644 index 0000000..c2417d8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js @@ -0,0 +1,246 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var util_1 = require("../util"); +var io_utils_1 = require("./io_utils"); +var model_management_1 = require("./model_management"); +var router_registry_1 = require("./router_registry"); +var PATH_SEPARATOR = '/'; +var PATH_PREFIX = 'tensorflowjs_models'; +var INFO_SUFFIX = 'info'; +var MODEL_TOPOLOGY_SUFFIX = 'model_topology'; +var WEIGHT_SPECS_SUFFIX = 'weight_specs'; +var WEIGHT_DATA_SUFFIX = 'weight_data'; +function purgeLocalStorageArtifacts() { + if (!environment_1.ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') { + throw new Error('purgeLocalStorageModels() cannot proceed because local storage is ' + + 'unavailable in the current environment.'); + } + var LS = window.localStorage; + var purgedModelPaths = []; + for (var i = 0; i < LS.length; ++i) { + var key = LS.key(i); + var prefix = PATH_PREFIX + PATH_SEPARATOR; + if (key.startsWith(prefix) && key.length > prefix.length) { + LS.removeItem(key); + var modelName = getModelPathFromKey(key); + if (purgedModelPaths.indexOf(modelName) === -1) { + purgedModelPaths.push(modelName); + } + } + } + return purgedModelPaths; +} +exports.purgeLocalStorageArtifacts = purgeLocalStorageArtifacts; +function getModelKeys(path) { + return { + info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR), + topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR), + weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR), + weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR) + }; +} +function getModelPathFromKey(key) { + var items = key.split(PATH_SEPARATOR); + if (items.length < 3) { + throw new Error("Invalid key format: " + key); + } + return items.slice(1, items.length - 1).join(PATH_SEPARATOR); +} +function maybeStripScheme(key) { + return key.startsWith(BrowserLocalStorage.URL_SCHEME) ? + key.slice(BrowserLocalStorage.URL_SCHEME.length) : + key; +} +var BrowserLocalStorage = (function () { + function BrowserLocalStorage(modelPath) { + if (!environment_1.ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') { + throw new Error('The current environment does not support local storage.'); + } + this.LS = window.localStorage; + if (modelPath == null || !modelPath) { + throw new Error('For local storage, modelPath must not be null, undefined or empty.'); + } + this.modelPath = modelPath; + this.keys = getModelKeys(this.modelPath); + } + BrowserLocalStorage.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + var topology, weightSpecs, modelArtifactsInfo, key; + return __generator(this, function (_a) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserLocalStorage.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + else { + topology = JSON.stringify(modelArtifacts.modelTopology); + weightSpecs = JSON.stringify(modelArtifacts.weightSpecs); + modelArtifactsInfo = io_utils_1.getModelArtifactsInfoForJSON(modelArtifacts); + try { + this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo)); + this.LS.setItem(this.keys.topology, topology); + this.LS.setItem(this.keys.weightSpecs, weightSpecs); + this.LS.setItem(this.keys.weightData, io_utils_1.arrayBufferToBase64String(modelArtifacts.weightData)); + return [2, { modelArtifactsInfo: modelArtifactsInfo }]; + } + catch (err) { + for (key in this.keys) { + this.LS.removeItem(this.keys[key]); + } + throw new Error("Failed to save model '" + this.modelPath + "' to local storage: " + + "size quota being exceeded is a possible cause of this failure: " + + ("modelTopologyBytes=" + modelArtifactsInfo.modelTopologyBytes + ", ") + + ("weightSpecsBytes=" + modelArtifactsInfo.weightSpecsBytes + ", ") + + ("weightDataBytes=" + modelArtifactsInfo.weightDataBytes + ".")); + } + } + return [2]; + }); + }); + }; + BrowserLocalStorage.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var info, out, topology, weightSpecs, weightDataBase64; + return __generator(this, function (_a) { + info = JSON.parse(this.LS.getItem(this.keys.info)); + if (info == null) { + throw new Error("In local storage, there is no model with name '" + this.modelPath + "'"); + } + if (info.modelTopologyType !== 'JSON') { + throw new Error('BrowserLocalStorage does not support loading non-JSON model ' + + 'topology yet.'); + } + out = {}; + topology = JSON.parse(this.LS.getItem(this.keys.topology)); + if (topology == null) { + throw new Error("In local storage, the topology of model '" + this.modelPath + "' " + + "is missing."); + } + out.modelTopology = topology; + weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs)); + if (weightSpecs == null) { + throw new Error("In local storage, the weight specs of model '" + this.modelPath + "' " + + "are missing."); + } + out.weightSpecs = weightSpecs; + weightDataBase64 = this.LS.getItem(this.keys.weightData); + if (weightDataBase64 == null) { + throw new Error("In local storage, the binary weight values of model " + + ("'" + this.modelPath + "' are missing.")); + } + out.weightData = io_utils_1.base64StringToArrayBuffer(weightDataBase64); + return [2, out]; + }); + }); + }; + BrowserLocalStorage.URL_SCHEME = 'localstorage://'; + return BrowserLocalStorage; +}()); +exports.BrowserLocalStorage = BrowserLocalStorage; +exports.localStorageRouter = function (url) { + if (!environment_1.ENV.get('IS_BROWSER')) { + return null; + } + else { + if (url.startsWith(BrowserLocalStorage.URL_SCHEME)) { + return browserLocalStorage(url.slice(BrowserLocalStorage.URL_SCHEME.length)); + } + else { + return null; + } + } +}; +router_registry_1.IORouterRegistry.registerSaveRouter(exports.localStorageRouter); +router_registry_1.IORouterRegistry.registerLoadRouter(exports.localStorageRouter); +function browserLocalStorage(modelPath) { + return new BrowserLocalStorage(modelPath); +} +exports.browserLocalStorage = browserLocalStorage; +var BrowserLocalStorageManager = (function () { + function BrowserLocalStorageManager() { + util_1.assert(environment_1.ENV.get('IS_BROWSER'), 'Current environment is not a web browser'); + util_1.assert(typeof window.localStorage !== 'undefined', 'Current browser does not appear to support localStorage'); + this.LS = window.localStorage; + } + BrowserLocalStorageManager.prototype.listModels = function () { + return __awaiter(this, void 0, void 0, function () { + var out, prefix, suffix, i, key, modelPath; + return __generator(this, function (_a) { + out = {}; + prefix = PATH_PREFIX + PATH_SEPARATOR; + suffix = PATH_SEPARATOR + INFO_SUFFIX; + for (i = 0; i < this.LS.length; ++i) { + key = this.LS.key(i); + if (key.startsWith(prefix) && key.endsWith(suffix)) { + modelPath = getModelPathFromKey(key); + out[modelPath] = JSON.parse(this.LS.getItem(key)); + } + } + return [2, out]; + }); + }); + }; + BrowserLocalStorageManager.prototype.removeModel = function (path) { + return __awaiter(this, void 0, void 0, function () { + var keys, info; + return __generator(this, function (_a) { + path = maybeStripScheme(path); + keys = getModelKeys(path); + if (this.LS.getItem(keys.info) == null) { + throw new Error("Cannot find model at path '" + path + "'"); + } + info = JSON.parse(this.LS.getItem(keys.info)); + this.LS.removeItem(keys.info); + this.LS.removeItem(keys.topology); + this.LS.removeItem(keys.weightSpecs); + this.LS.removeItem(keys.weightData); + return [2, info]; + }); + }); + }; + return BrowserLocalStorageManager; +}()); +exports.BrowserLocalStorageManager = BrowserLocalStorageManager; +if (environment_1.ENV.get('IS_BROWSER')) { + try { + model_management_1.ModelStoreManagerRegistry.registerManager(BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager()); + } + catch (err) { + } +} +//# sourceMappingURL=local_storage.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js.map new file mode 100644 index 0000000..c2a72c8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"local_storage.js","sourceRoot":"","sources":["../../src/io/local_storage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8CAAmC;AACnC,gCAA+B;AAC/B,uCAA8G;AAC9G,uDAA6D;AAC7D,qDAA6D;AAG7D,IAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,IAAM,WAAW,GAAG,qBAAqB,CAAC;AAC1C,IAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,IAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAC/C,IAAM,mBAAmB,GAAG,cAAc,CAAC;AAC3C,IAAM,kBAAkB,GAAG,aAAa,CAAC;AAOzC;IACE,IAAI,CAAC,iBAAG,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,OAAO,MAAM,CAAC,YAAY,KAAK,WAAW,EAAE;QACxE,MAAM,IAAI,KAAK,CACX,oEAAoE;YACpE,yCAAyC,CAAC,CAAC;KAChD;IACD,IAAM,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC;IAC/B,IAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QAClC,IAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACtB,IAAM,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC;QAC5C,IAAI,GAAG,CA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AgB,CAAC,IAAI,CAAC,CAAC;gBACxB,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;gBAChC,IAAI,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE;oBACtC,MAAM,IAAI,KAAK,CAAC,gCAA8B,IAAI,MAAG,CAAC,CAAC;iBACxD;gBACK,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAuB,CAAC;gBAE1E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAClC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACrC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACpC,WAAO,IAAI,EAAC;;;KACb;IACH,iCAAC;AAAD,CAAC,AAvCD,IAuCC;AAvCY,gEAA0B;AAyCvC,IAAI,iBAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;IAGzB,IAAI;QACF,4CAAyB,CAAC,eAAe,CACrC,mBAAmB,CAAC,UAAU,EAAE,IAAI,0BAA0B,EAAE,CAAC,CAAC;KACvE;IAAC,OAAO,GAAG,EAAE;KACb;CACF"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js new file mode 100644 index 0000000..c80e638 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js @@ -0,0 +1,379 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var io_utils_1 = require("./io_utils"); +var local_storage_1 = require("./local_storage"); +jasmine_util_1.describeWithFlags('LocalStorage', test_util_1.BROWSER_ENVS, function () { + var modelTopology1 = { + 'class_name': 'Sequential', + 'keras_version': '2.1.4', + 'config': [{ + 'class_name': 'Dense', + 'config': { + 'kernel_initializer': { + 'class_name': 'VarianceScaling', + 'config': { + 'distribution': 'uniform', + 'scale': 1.0, + 'seed': null, + 'mode': 'fan_avg' + } + }, + 'name': 'dense', + 'kernel_constraint': null, + 'bias_regularizer': null, + 'bias_constraint': null, + 'dtype': 'float32', + 'activation': 'linear', + 'trainable': true, + 'kernel_regularizer': null, + 'bias_initializer': { 'class_name': 'Zeros', 'config': {} }, + 'units': 1, + 'batch_input_shape': [null, 3], + 'use_bias': true, + 'activity_regularizer': null + } + }], + 'backend': 'tensorflow' + }; + var weightSpecs1 = [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [1], + dtype: 'float32', + } + ]; + var weightData1 = new ArrayBuffer(16); + var artifacts1 = { + modelTopology: modelTopology1, + weightSpecs: weightSpecs1, + weightData: weightData1, + }; + function findOverflowingByteSize() { + var LS = window.localStorage; + var probeKey = "tfjs_test_probe_values_" + new Date().getTime() + "_" + Math.random(); + var minKilobytes = 200; + var stepKilobytes = 200; + var maxKilobytes = 40000; + for (var kilobytes = minKilobytes; kilobytes < maxKilobytes; kilobytes += stepKilobytes) { + var bytes = kilobytes * 1024; + var data = new ArrayBuffer(bytes); + try { + var encoded = io_utils_1.arrayBufferToBase64String(data); + LS.setItem(probeKey, encoded); + } + catch (err) { + return bytes; + } + LS.removeItem(probeKey); + } + throw new Error("Unable to determined overflowing byte size up to " + maxKilobytes + " kB."); + } + beforeEach(function () { + local_storage_1.purgeLocalStorageArtifacts(); + }); + afterEach(function () { + local_storage_1.purgeLocalStorageArtifacts(); + }); + it('Save artifacts succeeds', function (done) { + var testStartDate = new Date(); + var handler = tf.io.getSaveHandlers('localstorage://foo/FooModel')[0]; + handler.save(artifacts1) + .then(function (saveResult) { + expect(saveResult.modelArtifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs1).length); + expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16); + var LS = window.localStorage; + var info = JSON.parse(LS.getItem('tensorflowjs_models/foo/FooModel/info')); + expect(Date.parse(info.dateSaved)) + .toEqual(saveResult.modelArtifactsInfo.dateSaved.getTime()); + expect(info.modelTopologyBytes) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes); + expect(info.weightSpecsBytes) + .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes); + expect(info.weightDataBytes) + .toEqual(saveResult.modelArtifactsInfo.weightDataBytes); + var topologyString = LS.getItem('tensorflowjs_models/foo/FooModel/model_topology'); + expect(JSON.stringify(modelTopology1)).toEqual(topologyString); + var weightSpecsString = LS.getItem('tensorflowjs_models/foo/FooModel/weight_specs'); + expect(JSON.stringify(weightSpecs1)).toEqual(weightSpecsString); + var weightDataBase64String = LS.getItem('tensorflowjs_models/foo/FooModel/weight_data'); + expect(io_utils_1.base64StringToArrayBuffer(weightDataBase64String)) + .toEqual(weightData1); + done(); + }) + .catch(function (err) { + console.error(err.stack); + }); + }); + it('Save-load round trip succeeds', function () { return __awaiter(_this, void 0, void 0, function () { + var handler1, handler2, loaded; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0]; + return [4, handler1.save(artifacts1)]; + case 1: + _a.sent(); + handler2 = tf.io.getLoadHandlers('localstorage://FooModel')[0]; + return [4, handler2.load()]; + case 2: + loaded = _a.sent(); + expect(loaded.modelTopology).toEqual(modelTopology1); + expect(loaded.weightSpecs).toEqual(weightSpecs1); + expect(loaded.weightData).toEqual(weightData1); + return [2]; + } + }); + }); }); + it('Loading nonexistent model fails.', function (done) { + var handler = tf.io.getSaveHandlers('localstorage://NonexistentModel')[0]; + handler.load() + .then(function (aritfacts) { + fail('Loading nonexistent model succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('In local storage, there is no model with name ' + + '\'NonexistentModel\''); + done(); + }); + }); + it('Loading model with missing topology fails.', function (done) { + var handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0]; + handler1.save(artifacts1) + .then(function (saveResult) { + window.localStorage.removeItem('tensorflowjs_models/FooModel/model_topology'); + var handler2 = tf.io.getLoadHandlers('localstorage://FooModel')[0]; + handler2.load() + .then(function (aritfacts) { + fail('Loading of model with missing topology succeeded ' + + 'unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('In local storage, the topology of model ' + + '\'FooModel\' is missing.'); + done(); + }); + }) + .catch(function (err) { + console.error(err.stack); + }); + }); + it('Loading model with missing weight specs fails.', function (done) { + var handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0]; + handler1.save(artifacts1) + .then(function (saveResult) { + window.localStorage.removeItem('tensorflowjs_models/FooModel/weight_specs'); + var handler2 = tf.io.getLoadHandlers('localstorage://FooModel')[0]; + handler2.load() + .then(function (aritfacts) { + fail('Loading of model with missing weight specs succeeded ' + + 'unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('In local storage, the weight specs of model ' + + '\'FooModel\' are missing.'); + done(); + }); + }) + .catch(function (err) { + console.error(err.stack); + }); + }); + it('Loading model with missing weight data fails.', function (done) { + var handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0]; + handler1.save(artifacts1) + .then(function (saveResult) { + window.localStorage.removeItem('tensorflowjs_models/FooModel/weight_data'); + var handler2 = tf.io.getLoadHandlers('localstorage://FooModel')[0]; + handler2.load() + .then(function (aritfacts) { + fail('Loading of model with missing weight data succeeded ' + + 'unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('In local storage, the binary weight values of model ' + + '\'FooModel\' are missing.'); + done(); + }); + }) + .catch(function (err) { + console.error(err.stack); + }); + }); + it('Data size too large leads to error thrown', function (done) { + var overflowByteSize = findOverflowingByteSize(); + var overflowArtifacts = { + modelTopology: modelTopology1, + weightSpecs: weightSpecs1, + weightData: new ArrayBuffer(overflowByteSize), + }; + var handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0]; + handler1.save(overflowArtifacts) + .then(function (saveResult) { + fail('Saving of model of overflowing-size weight data succeeded ' + + 'unexpectedly.'); + }) + .catch(function (err) { + expect(err.message + .indexOf('Failed to save model \'FooModel\' to local storage')) + .toEqual(0); + done(); + }); + }); + it('Null, undefined or empty modelPath throws Error', function () { + expect(function () { return local_storage_1.browserLocalStorage(null); }) + .toThrowError(/local storage, modelPath must not be null, undefined or empty/); + expect(function () { return local_storage_1.browserLocalStorage(undefined); }) + .toThrowError(/local storage, modelPath must not be null, undefined or empty/); + expect(function () { return local_storage_1.browserLocalStorage(''); }) + .toThrowError(/local storage, modelPath must not be null, undefined or empty./); + }); + it('router', function () { + expect(local_storage_1.localStorageRouter('localstorage://bar') instanceof local_storage_1.BrowserLocalStorage) + .toEqual(true); + expect(local_storage_1.localStorageRouter('indexeddb://bar')).toBeNull(); + expect(local_storage_1.localStorageRouter('qux')).toBeNull(); + }); + it('Manager: List models: 0 result', function (done) { + new local_storage_1.BrowserLocalStorageManager() + .listModels() + .then(function (out) { + expect(out).toEqual({}); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Manager: List models: 1 result', function (done) { + var handler = tf.io.getSaveHandlers('localstorage://baz/QuxModel')[0]; + handler.save(artifacts1) + .then(function (saveResult) { + new local_storage_1.BrowserLocalStorageManager() + .listModels() + .then(function (out) { + expect(Object.keys(out).length).toEqual(1); + expect(out['baz/QuxModel'].modelTopologyType) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyType); + expect(out['baz/QuxModel'].modelTopologyBytes) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes); + expect(out['baz/QuxModel'].weightSpecsBytes) + .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes); + expect(out['baz/QuxModel'].weightDataBytes) + .toEqual(saveResult.modelArtifactsInfo.weightDataBytes); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Manager: List models: 2 results', function (done) { + var handler1 = tf.io.getSaveHandlers('localstorage://QuxModel')[0]; + handler1.save(artifacts1) + .then(function (saveResult1) { + var handler2 = tf.io.getSaveHandlers('localstorage://repeat/QuxModel')[0]; + handler2.save(artifacts1) + .then(function (saveResult2) { + new local_storage_1.BrowserLocalStorageManager() + .listModels() + .then(function (out) { + expect(Object.keys(out).length).toEqual(2); + expect(out['QuxModel'].modelTopologyType) + .toEqual(saveResult1.modelArtifactsInfo.modelTopologyType); + expect(out['QuxModel'].modelTopologyBytes) + .toEqual(saveResult1.modelArtifactsInfo + .modelTopologyBytes); + expect(out['QuxModel'].weightSpecsBytes) + .toEqual(saveResult1.modelArtifactsInfo.weightSpecsBytes); + expect(out['QuxModel'].weightDataBytes) + .toEqual(saveResult1.modelArtifactsInfo.weightDataBytes); + expect(out['repeat/QuxModel'].modelTopologyType) + .toEqual(saveResult2.modelArtifactsInfo.modelTopologyType); + expect(out['repeat/QuxModel'].modelTopologyBytes) + .toEqual(saveResult2.modelArtifactsInfo + .modelTopologyBytes); + expect(out['repeat/QuxModel'].weightSpecsBytes) + .toEqual(saveResult2.modelArtifactsInfo.weightSpecsBytes); + expect(out['repeat/QuxModel'].weightDataBytes) + .toEqual(saveResult2.modelArtifactsInfo.weightDataBytes); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Manager: Successful deleteModel', function (done) { + var handler1 = tf.io.getSaveHandlers('localstorage://QuxModel')[0]; + handler1.save(artifacts1) + .then(function (saveResult1) { + var handler2 = tf.io.getSaveHandlers('localstorage://repeat/QuxModel')[0]; + handler2.save(artifacts1) + .then(function (saveResult2) { + var manager = new local_storage_1.BrowserLocalStorageManager(); + manager.removeModel('QuxModel') + .then(function (deletedInfo) { + manager.listModels().then(function (out) { + expect(Object.keys(out)).toEqual(['repeat/QuxModel']); + }); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); +}); +//# sourceMappingURL=local_storage_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js.map new file mode 100644 index 0000000..bf5218d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"local_storage_test.js","sourceRoot":"","sources":["../../src/io/local_storage_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBAkZA;;AAlZA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA0C;AAC1C,uCAAgF;AAChF,iDAAqJ;AAErJ,gCAAiB,CAAC,cAAc,EAAE,wBAAY,EAAE;IAE9C,IAAM,cAAc,GAAO;QACzB,YAAY,EAAE,YAAY;QAC1B,eAAe,EAAE,OAAO;QACxB,QAAQ,EAAE,CAAC;gBACT,YAAY,EAAE,OAAO;gBACrB,QAAQ,EAAE;oBACR,oBAAoB,EAAE;wBACpB,YAAY,EAAE,iBAAiB;wBAC/B,QAAQ,EAAE;4BACR,cAAc,EAAE,SAAS;4BACzB,OAAO,EAAE,GAAG;4BACZ,MAAM,EAAE,IAAI;4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AAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;QAC1C,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts new file mode 100644 index 0000000..483b7e3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts @@ -0,0 +1,17 @@ +import { ModelArtifactsInfo, ModelStoreManager } from './types'; +export declare class ModelStoreManagerRegistry { + private static instance; + private managers; + private constructor(); + private static getInstance; + static registerManager(scheme: string, manager: ModelStoreManager): void; + static getManager(scheme: string): ModelStoreManager; + static getSchemes(): string[]; +} +declare function listModels(): Promise<{ + [url: string]: ModelArtifactsInfo; +}>; +declare function removeModel(url: string): Promise; +declare function copyModel(sourceURL: string, destURL: string): Promise; +declare function moveModel(sourceURL: string, destURL: string): Promise; +export { moveModel, copyModel, removeModel, listModels }; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js new file mode 100644 index 0000000..e1c7fa4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js @@ -0,0 +1,203 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = require("../util"); +var router_registry_1 = require("./router_registry"); +var URL_SCHEME_SUFFIX = '://'; +var ModelStoreManagerRegistry = (function () { + function ModelStoreManagerRegistry() { + this.managers = {}; + } + ModelStoreManagerRegistry.getInstance = function () { + if (ModelStoreManagerRegistry.instance == null) { + ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry(); + } + return ModelStoreManagerRegistry.instance; + }; + ModelStoreManagerRegistry.registerManager = function (scheme, manager) { + util_1.assert(scheme != null, 'scheme must not be undefined or null.'); + if (scheme.endsWith(URL_SCHEME_SUFFIX)) { + scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX)); + } + util_1.assert(scheme.length > 0, 'scheme must not be an empty string.'); + var registry = ModelStoreManagerRegistry.getInstance(); + util_1.assert(registry.managers[scheme] == null, "A model store manager is already registered for scheme '" + scheme + "'."); + registry.managers[scheme] = manager; + }; + ModelStoreManagerRegistry.getManager = function (scheme) { + var manager = this.getInstance().managers[scheme]; + if (manager == null) { + throw new Error("Cannot find model manager for scheme '" + scheme + "'"); + } + return manager; + }; + ModelStoreManagerRegistry.getSchemes = function () { + return Object.keys(this.getInstance().managers); + }; + return ModelStoreManagerRegistry; +}()); +exports.ModelStoreManagerRegistry = ModelStoreManagerRegistry; +function parseURL(url) { + if (url.indexOf(URL_SCHEME_SUFFIX) === -1) { + throw new Error("The url string provided does not contain a scheme. " + + "Supported schemes are: " + + ("" + ModelStoreManagerRegistry.getSchemes().join(','))); + } + return { + scheme: url.split(URL_SCHEME_SUFFIX)[0], + path: url.split(URL_SCHEME_SUFFIX)[1], + }; +} +function cloneModelInternal(sourceURL, destURL, deleteSource) { + if (deleteSource === void 0) { deleteSource = false; } + return __awaiter(this, void 0, void 0, function () { + var loadHandlers, loadHandler, saveHandlers, saveHandler, sourceScheme, sourcePath, sameMedium, modelArtifacts, saveResult; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + util_1.assert(sourceURL !== destURL, "Old path and new path are the same: '" + sourceURL + "'"); + loadHandlers = router_registry_1.IORouterRegistry.getLoadHandlers(sourceURL); + util_1.assert(loadHandlers.length > 0, "Copying failed because no load handler is found for source URL " + sourceURL + "."); + util_1.assert(loadHandlers.length < 2, "Copying failed because more than one (" + loadHandlers.length + ") " + + ("load handlers for source URL " + sourceURL + ".")); + loadHandler = loadHandlers[0]; + saveHandlers = router_registry_1.IORouterRegistry.getSaveHandlers(destURL); + util_1.assert(saveHandlers.length > 0, "Copying failed because no save handler is found for destination URL " + + (destURL + ".")); + util_1.assert(saveHandlers.length < 2, "Copying failed because more than one (" + loadHandlers.length + ") " + + ("save handlers for destination URL " + destURL + ".")); + saveHandler = saveHandlers[0]; + sourceScheme = parseURL(sourceURL).scheme; + sourcePath = parseURL(sourceURL).path; + sameMedium = sourceScheme === parseURL(sourceURL).scheme; + return [4, loadHandler.load()]; + case 1: + modelArtifacts = _a.sent(); + if (!(deleteSource && sameMedium)) return [3, 3]; + return [4, ModelStoreManagerRegistry.getManager(sourceScheme) + .removeModel(sourcePath)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [4, saveHandler.save(modelArtifacts)]; + case 4: + saveResult = _a.sent(); + if (!(deleteSource && !sameMedium)) return [3, 6]; + return [4, ModelStoreManagerRegistry.getManager(sourceScheme) + .removeModel(sourcePath)]; + case 5: + _a.sent(); + _a.label = 6; + case 6: return [2, saveResult.modelArtifactsInfo]; + } + }); + }); +} +function listModels() { + return __awaiter(this, void 0, void 0, function () { + var schemes, out, _i, schemes_1, scheme, schemeOut, path, url; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + schemes = ModelStoreManagerRegistry.getSchemes(); + out = {}; + _i = 0, schemes_1 = schemes; + _a.label = 1; + case 1: + if (!(_i < schemes_1.length)) return [3, 4]; + scheme = schemes_1[_i]; + return [4, ModelStoreManagerRegistry.getManager(scheme).listModels()]; + case 2: + schemeOut = _a.sent(); + for (path in schemeOut) { + url = scheme + URL_SCHEME_SUFFIX + path; + out[url] = schemeOut[path]; + } + _a.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2, out]; + } + }); + }); +} +exports.listModels = listModels; +function removeModel(url) { + return __awaiter(this, void 0, void 0, function () { + var schemeAndPath, manager; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + schemeAndPath = parseURL(url); + manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme); + return [4, manager.removeModel(schemeAndPath.path)]; + case 1: return [2, _a.sent()]; + } + }); + }); +} +exports.removeModel = removeModel; +function copyModel(sourceURL, destURL) { + return __awaiter(this, void 0, void 0, function () { + var deleteSource; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + deleteSource = false; + return [4, cloneModelInternal(sourceURL, destURL, deleteSource)]; + case 1: return [2, _a.sent()]; + } + }); + }); +} +exports.copyModel = copyModel; +function moveModel(sourceURL, destURL) { + return __awaiter(this, void 0, void 0, function () { + var deleteSource; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + deleteSource = true; + return [4, cloneModelInternal(sourceURL, destURL, deleteSource)]; + case 1: return [2, _a.sent()]; + } + }); + }); +} +exports.moveModel = moveModel; +//# sourceMappingURL=model_management.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js.map new file mode 100644 index 0000000..a45712f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js.map @@ -0,0 +1 @@ +{"version":3,"file":"model_management.js","sourceRoot":"","sources":["../../src/io/model_management.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,gCAA+B;AAE/B,qDAAmD;AAGnD,IAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC;IAME;QACE,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,CAAC;IAEc,qCAAW,GAA1B;QACE,IAAI,yBAAyB,CAAC,QAAQ,IAAI,IAAI,EAAE;YAC9C,yBAAyB,CAAC,QAAQ,GAAG,IAAI,yBAAyB,EAAE,CAAC;SACtE;QACD,OAAO,yBAAyB,CAAC,QAAQ,CAAC;IAC5C,CAAC;IAQM,yCAAe,GAAtB,UAAuB,MAAc,EAAE,OAA0B;QAC/D,aAAM,CAAC,MAAM,IAAI,IAAI,EAAE,uCAAuC,CAAC,CAAC;QAChE,IAAI,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;YACtC,MAAM,GAAG,MAAM,CAAC,KAAK,CA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WAAM,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,EAAA;wBAAjE,WAAO,SAA0D,EAAC;;;;CACnE;AAgDkB,8BAAS;AAN5B,mBACI,SAAiB,EAAE,OAAe;;;;;;oBAC9B,YAAY,GAAG,IAAI,CAAC;oBACnB,WAAM,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,EAAA;wBAAjE,WAAO,SAA0D,EAAC;;;;CACnE;AAEO,8BAAS"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js new file mode 100644 index 0000000..5753160 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js @@ -0,0 +1,376 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var indexed_db_1 = require("./indexed_db"); +var local_storage_1 = require("./local_storage"); +jasmine_util_1.describeWithFlags('ModelManagement', test_util_1.CHROME_ENVS, function () { + var modelTopology1 = { + 'class_name': 'Sequential', + 'keras_version': '2.1.4', + 'config': [{ + 'class_name': 'Dense', + 'config': { + 'kernel_initializer': { + 'class_name': 'VarianceScaling', + 'config': { + 'distribution': 'uniform', + 'scale': 1.0, + 'seed': null, + 'mode': 'fan_avg' + } + }, + 'name': 'dense', + 'kernel_constraint': null, + 'bias_regularizer': null, + 'bias_constraint': null, + 'dtype': 'float32', + 'activation': 'linear', + 'trainable': true, + 'kernel_regularizer': null, + 'bias_initializer': { 'class_name': 'Zeros', 'config': {} }, + 'units': 1, + 'batch_input_shape': [null, 3], + 'use_bias': true, + 'activity_regularizer': null + } + }], + 'backend': 'tensorflow' + }; + var weightSpecs1 = [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [1], + dtype: 'float32', + } + ]; + var weightData1 = new ArrayBuffer(16); + var artifacts1 = { + modelTopology: modelTopology1, + weightSpecs: weightSpecs1, + weightData: weightData1, + }; + beforeEach(function (done) { + local_storage_1.purgeLocalStorageArtifacts(); + indexed_db_1.deleteDatabase().then(function () { + done(); + }); + }); + afterEach(function (done) { + local_storage_1.purgeLocalStorageArtifacts(); + indexed_db_1.deleteDatabase().then(function () { + done(); + }); + }); + it('List models: 0 result', function (done) { + tf.io.listModels() + .then(function (out) { + expect(out).toEqual({}); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('List models: 1 result', function (done) { + var url = 'localstorage://baz/QuxModel'; + var handler = tf.io.getSaveHandlers(url)[0]; + handler.save(artifacts1) + .then(function (saveResult) { + tf.io.listModels() + .then(function (out) { + expect(Object.keys(out).length).toEqual(1); + expect(out[url].modelTopologyType) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyType); + expect(out[url].modelTopologyBytes) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes); + expect(out[url].weightSpecsBytes) + .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes); + expect(out[url].weightDataBytes) + .toEqual(saveResult.modelArtifactsInfo.weightDataBytes); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Manager: List models: 2 results in 2 mediums', function (done) { + var url1 = 'localstorage://QuxModel'; + var url2 = 'indexeddb://QuxModel'; + var handler1 = tf.io.getSaveHandlers(url1)[0]; + handler1.save(artifacts1) + .then(function (saveResult1) { + var handler2 = tf.io.getSaveHandlers(url2)[0]; + handler2.save(artifacts1) + .then(function (saveResult2) { + tf.io.listModels() + .then(function (out) { + expect(Object.keys(out).length).toEqual(2); + expect(out[url1].modelTopologyType) + .toEqual(saveResult1.modelArtifactsInfo.modelTopologyType); + expect(out[url1].modelTopologyBytes) + .toEqual(saveResult1.modelArtifactsInfo + .modelTopologyBytes); + expect(out[url1].weightSpecsBytes) + .toEqual(saveResult1.modelArtifactsInfo.weightSpecsBytes); + expect(out[url1].weightDataBytes) + .toEqual(saveResult1.modelArtifactsInfo.weightDataBytes); + expect(out[url2].modelTopologyType) + .toEqual(saveResult2.modelArtifactsInfo.modelTopologyType); + expect(out[url2].modelTopologyBytes) + .toEqual(saveResult2.modelArtifactsInfo + .modelTopologyBytes); + expect(out[url2].weightSpecsBytes) + .toEqual(saveResult2.modelArtifactsInfo.weightSpecsBytes); + expect(out[url2].weightDataBytes) + .toEqual(saveResult2.modelArtifactsInfo.weightDataBytes); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Successful removeModel', function (done) { + var handler1 = tf.io.getSaveHandlers('localstorage://QuxModel')[0]; + handler1.save(artifacts1) + .then(function (saveResult1) { + var handler2 = tf.io.getSaveHandlers('indexeddb://repeat/QuxModel')[0]; + handler2.save(artifacts1) + .then(function (saveResult2) { + tf.io.removeModel('indexeddb://repeat/QuxModel') + .then(function (deletedInfo) { + tf.io.listModels() + .then(function (out) { + expect(Object.keys(out)).toEqual([ + 'localstorage://QuxModel' + ]); + tf.io.removeModel('localstorage://QuxModel') + .then(function (out) { + tf.io.listModels() + .then(function (out) { + expect(Object.keys(out)).toEqual([]); + done(); + }) + .catch(function (err) { return done.fail(err); }); + }) + .catch(function (err) { return done.fail(err); }); + }) + .catch(function (err) { return done.fail(err); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Successful copyModel between mediums', function (done) { + var url1 = 'localstorage://a1/FooModel'; + var url2 = 'indexeddb://a1/FooModel'; + var handler1 = tf.io.getSaveHandlers(url1)[0]; + handler1.save(artifacts1) + .then(function (saveResult) { + tf.io.copyModel(url1, url2) + .then(function (modelInfo) { + tf.io.listModels().then(function (out) { + expect(Object.keys(out).length).toEqual(2); + expect(out[url1].modelTopologyType) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyType); + expect(out[url1].modelTopologyBytes) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes); + expect(out[url1].weightSpecsBytes) + .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes); + expect(out[url1].weightDataBytes) + .toEqual(saveResult.modelArtifactsInfo.weightDataBytes); + expect(out[url2].modelTopologyType) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyType); + expect(out[url2].modelTopologyBytes) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes); + expect(out[url2].weightSpecsBytes) + .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes); + expect(out[url2].weightDataBytes) + .toEqual(saveResult.modelArtifactsInfo.weightDataBytes); + var handler2 = tf.io.getLoadHandlers(url2)[0]; + handler2.load() + .then(function (loaded) { + expect(loaded.modelTopology).toEqual(modelTopology1); + expect(loaded.weightSpecs).toEqual(weightSpecs1); + expect(new Uint8Array(loaded.weightData)) + .toEqual(new Uint8Array(weightData1)); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Successful moveModel between mediums', function (done) { + var url1 = 'localstorage://a1/FooModel'; + var url2 = 'indexeddb://a1/FooModel'; + var handler1 = tf.io.getSaveHandlers(url1)[0]; + handler1.save(artifacts1) + .then(function (saveResult) { + tf.io.moveModel(url1, url2) + .then(function (modelInfo) { + tf.io.listModels().then(function (out) { + expect(Object.keys(out)).toEqual([url2]); + expect(out[url2].modelTopologyType) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyType); + expect(out[url2].modelTopologyBytes) + .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes); + expect(out[url2].weightSpecsBytes) + .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes); + expect(out[url2].weightDataBytes) + .toEqual(saveResult.modelArtifactsInfo.weightDataBytes); + var handler2 = tf.io.getLoadHandlers(url2)[0]; + handler2.load() + .then(function (loaded) { + expect(loaded.modelTopology).toEqual(modelTopology1); + expect(loaded.weightSpecs).toEqual(weightSpecs1); + expect(new Uint8Array(loaded.weightData)) + .toEqual(new Uint8Array(weightData1)); + done(); + }) + .catch(function (err) { + done.fail(err.stack); + }); + }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Failed copyModel to invalid source URL', function (done) { + var url1 = 'invalidurl'; + var url2 = 'localstorage://a1/FooModel'; + tf.io.copyModel(url1, url2) + .then(function (out) { + done.fail('Copying from invalid URL succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Copying failed because no load handler is found for ' + + 'source URL invalidurl.'); + done(); + }); + }); + it('Failed copyModel to invalid destination URL', function (done) { + var url1 = 'localstorage://a1/FooModel'; + var url2 = 'invalidurl'; + var handler1 = tf.io.getSaveHandlers(url1)[0]; + handler1.save(artifacts1) + .then(function (saveResult) { + tf.io.copyModel(url1, url2) + .then(function (out) { + done.fail('Copying to invalid URL succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Copying failed because no save handler is found for ' + + 'destination URL invalidurl.'); + done(); + }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Failed moveModel to invalid destination URL', function (done) { + var url1 = 'localstorage://a1/FooModel'; + var url2 = 'invalidurl'; + var handler1 = tf.io.getSaveHandlers(url1)[0]; + handler1.save(artifacts1) + .then(function (saveResult) { + tf.io.moveModel(url1, url2) + .then(function (out) { + done.fail('Copying to invalid URL succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Copying failed because no save handler is found for ' + + 'destination URL invalidurl.'); + tf.io.listModels() + .then(function (out) { + expect(Object.keys(out)).toEqual([url1]); + done(); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + }) + .catch(function (err) { return done.fail(err.stack); }); + }); + it('Failed deletedModel: Absent scheme', function (done) { + tf.io.removeModel('foo') + .then(function (out) { + done.fail('Removing model with missing scheme succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toMatch(/The url string provided does not contain a scheme/); + expect(err.message.indexOf('localstorage')).toBeGreaterThan(0); + expect(err.message.indexOf('indexeddb')).toBeGreaterThan(0); + done(); + }); + }); + it('Failed deletedModel: Invalid scheme', function (done) { + tf.io.removeModel('invalidscheme://foo') + .then(function (out) { + done.fail('Removing nonexistent model succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Cannot find model manager for scheme \'invalidscheme\''); + done(); + }); + }); + it('Failed deletedModel: Nonexistent model', function (done) { + tf.io.removeModel('indexeddb://nonexistent') + .then(function (out) { + done.fail('Removing nonexistent model succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Cannot find model with path \'nonexistent\' in IndexedDB.'); + done(); + }); + }); + it('Failed copyModel', function (done) { + tf.io.copyModel('indexeddb://nonexistent', 'indexeddb://destination') + .then(function (out) { + done.fail('Copying nonexistent model succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Cannot find model with path \'nonexistent\' in IndexedDB.'); + done(); + }); + }); + it('copyModel: Identical oldPath and newPath leads to Error', function (done) { + tf.io.copyModel('a/1', 'a/1') + .then(function (out) { + done.fail('Copying with identical old & new paths succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Old path and new path are the same: \'a/1\''); + done(); + }); + }); + it('moveModel: Identical oldPath and newPath leads to Error', function (done) { + tf.io.moveModel('a/1', 'a/1') + .then(function (out) { + done.fail('Copying with identical old & new paths succeeded unexpectedly.'); + }) + .catch(function (err) { + expect(err.message) + .toEqual('Old path and new path are the same: \'a/1\''); + done(); + }); + }); +}); +//# sourceMappingURL=model_management_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js.map new file mode 100644 index 0000000..0601d55 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"model_management_test.js","sourceRoot":"","sources":["../../src/io/model_management_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyC;AACzC,2CAA4C;AAC5C,iDAA2D;AAI3D,gCAAiB,CAAC,iBAAiB,EAAE,uBAAW,EAAE;IAEhD,IAAM,cAAc,GAAO;QACzB,YAAY,EAAE,YAAY;QAC1B,eAAe,EAAE,OAAO;QACxB,QAAQ,EAAE,CAAC;gBACT,YAAY,EAAE,OAAO;gBACrB,QAAQ,EAAE;oBACR,oBAAoB,EAAE;wBACpB,YAAY,EAAE,iBAAiB;wBAC/B,QAAQ,EAAE;4BACR,cAAc,EAAE,SAAS;4BACzB,OAAO,EAAE,GAAG;4BACZ,MAAM,EAAE,IAAI;4BACZ,MAAM,EAAE,SAAS;yBAClB;qBACF;oBACD,MAAM,EAAE,OAAO;oBACf,mBAAmB,EAAE,IAAI;oBACzB,kBAAkB,EAAE,IAAI;oBACxB,iBAAiB,EAAE,IAAI;oBACvB,OAAO,EAAE,SAAS;oBAClB,YAAY,EAAE,QAAQ;oBACtB,WAAW,EAAE,IAAI;oBACjB,oBAAoB,EAAE,IAAI;oBAC1B,kBAAkB,EAAE,EAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAC;oBACzD,OAAO,EAAE,CAAC;oBACV,mBAAmB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;oBAC9B,UAAU,EAAE,IAAI;oBAChB,sBAAsB,EAAE,IAAI;iBAC7B;aACF,CAAC;QACF,SAAS,EAAE,YAAY;KAC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AAC;aACD,KAAK,CAAC,UAAA,GAAG;YACR,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;iBACd,OAAO,CACJ,2DAA2D,CAAC,CAAC;YACrE,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,UAAA,IAAI;QAChE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;aACxB,IAAI,CAAC,UAAA,GAAG;YACP,IAAI,CAAC,IAAI,CACL,gEAAgE,CAAC,CAAC;QACxE,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG;YACR,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;iBACd,OAAO,CAAC,6CAA6C,CAAC,CAAC;YAC5D,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,UAAA,IAAI;QAChE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;aACxB,IAAI,CAAC,UAAA,GAAG;YACP,IAAI,CAAC,IAAI,CACL,gEAAgE,CAAC,CAAC;QACxE,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG;YACR,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;iBACd,OAAO,CAAC,6CAA6C,CAAC,CAAC;YAC5D,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts new file mode 100644 index 0000000..157be24 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts @@ -0,0 +1,3 @@ +import { IOHandler, ModelArtifacts, SaveResult, WeightsManifestEntry } from './types'; +export declare function fromMemory(modelTopology: {}, weightSpecs?: WeightsManifestEntry[], weightData?: ArrayBuffer): IOHandler; +export declare function withSaveHandler(saveHandler: (artifacts: ModelArtifacts) => SaveResult): IOHandler; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js new file mode 100644 index 0000000..91b9757 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js @@ -0,0 +1,93 @@ +"use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var PassthroughLoader = (function () { + function PassthroughLoader(modelTopology, weightSpecs, weightData) { + this.modelTopology = modelTopology; + this.weightSpecs = weightSpecs; + this.weightData = weightData; + } + PassthroughLoader.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var result; + return __generator(this, function (_a) { + result = {}; + if (this.modelTopology != null) { + result = __assign({ modelTopology: this.modelTopology }, result); + } + if (this.weightSpecs != null && this.weightSpecs.length > 0) { + result = __assign({ weightSpecs: this.weightSpecs }, result); + } + if (this.weightData != null && this.weightData.byteLength > 0) { + result = __assign({ weightData: this.weightData }, result); + } + return [2, result]; + }); + }); + }; + return PassthroughLoader; +}()); +var PassthroughSaver = (function () { + function PassthroughSaver(saveHandler) { + this.saveHandler = saveHandler; + } + PassthroughSaver.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, this.saveHandler(modelArtifacts)]; + }); + }); + }; + return PassthroughSaver; +}()); +function fromMemory(modelTopology, weightSpecs, weightData) { + return new PassthroughLoader(modelTopology, weightSpecs, weightData); +} +exports.fromMemory = fromMemory; +function withSaveHandler(saveHandler) { + return new PassthroughSaver(saveHandler); +} +exports.withSaveHandler = withSaveHandler; +//# sourceMappingURL=passthrough.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js.map new file mode 100644 index 0000000..fffdafa --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js.map @@ -0,0 +1 @@ +{"version":3,"file":"passthrough.js","sourceRoot":"","sources":["../../src/io/passthrough.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;IACE,2BACqB,aAA8B,EAC9B,WAAoC,EACpC,UAAwB;QAFxB,kBAAa,GAAb,aAAa,CAAiB;QAC9B,gBAAW,GAAX,WAAW,CAAyB;QACpC,eAAU,GAAV,UAAU,CAAc;IAAG,CAAC;IAE3C,gCAAI,GAAV;;;;gBACM,MAAM,GAAG,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,EAAE;oBAC9B,MAAM,cAAI,aAAa,EAAE,IAAI,CAAC,aAAa,IAAK,MAAM,CAAC,CAAC;iBACzD;gBACD,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC3D,MAAM,cAAI,WAAW,EAAE,IAAI,CAAC,WAAW,IAAK,MAAM,CAAC,CAAC;iBACrD;gBACD,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,CAAC,EAAE;oBAC7D,MAAM,cAAI,UAAU,EAAE,IAAI,CAAC,UAAU,IAAK,MAAM,CAAC,CAAC;iBACnD;gBACD,WAAO,MAAM,EAAC;;;KACf;IACH,wBAAC;AAAD,CAAC,AAnBD,IAmBC;AAED;IACE,0BACqB,WAAsD;QAAtD,gBAAW,GAAX,WAAW,CAA2C;IAC3E,CAAC;IAEK,+BAAI,GAAV,UAAW,cAA8B;;;gBACvC,WAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,EAAC;;;KACzC;IACH,uBAAC;AAAD,CAAC,AARD,IAQC;AAsBD,oBACI,aAAiB,EAAE,WAAoC,EACvD,UAAwB;IAC1B,OAAO,IAAI,iBAAiB,CAAC,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;AACvE,CAAC;AAJD,gCAIC;AAiBD,yBACI,WAAsD;IACxD,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC;AAHD,0CAGC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js new file mode 100644 index 0000000..9420360 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js @@ -0,0 +1,167 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require(".."); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var modelTopology1 = { + 'class_name': 'Sequential', + 'keras_version': '2.1.4', + 'config': [{ + 'class_name': 'Dense', + 'config': { + 'kernel_initializer': { + 'class_name': 'VarianceScaling', + 'config': { + 'distribution': 'uniform', + 'scale': 1.0, + 'seed': null, + 'mode': 'fan_avg' + } + }, + 'name': 'dense', + 'kernel_constraint': null, + 'bias_regularizer': null, + 'bias_constraint': null, + 'dtype': 'float32', + 'activation': 'linear', + 'trainable': true, + 'kernel_regularizer': null, + 'bias_initializer': { 'class_name': 'Zeros', 'config': {} }, + 'units': 1, + 'batch_input_shape': [null, 3], + 'use_bias': true, + 'activity_regularizer': null + } + }], + 'backend': 'tensorflow' +}; +var weightSpecs1 = [ + { + name: 'dense/kernel', + shape: [3, 1], + dtype: 'float32', + }, + { + name: 'dense/bias', + shape: [1], + dtype: 'float32', + } +]; +var weightData1 = new ArrayBuffer(16); +var artifacts1 = { + modelTopology: modelTopology1, + weightSpecs: weightSpecs1, + weightData: weightData1, +}; +jasmine_util_1.describeWithFlags('Passthrough Saver', test_util_1.BROWSER_ENVS, function () { + it('passes provided arguments through on save', function () { return __awaiter(_this, void 0, void 0, function () { + function saveHandler(artifacts) { + savedArtifacts = artifacts; + return { + modelArtifactsInfo: { + dateSaved: testStartDate, + modelTopologyType: 'JSON', + modelTopologyBytes: JSON.stringify(modelTopology1).length, + weightSpecsBytes: JSON.stringify(weightSpecs1).length, + weightDataBytes: weightData1.byteLength, + } + }; + } + var testStartDate, savedArtifacts, saveTrigger, saveResult, artifactsInfo; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + testStartDate = new Date(); + savedArtifacts = null; + saveTrigger = tf.io.withSaveHandler(saveHandler); + return [4, saveTrigger.save(artifacts1)]; + case 1: + saveResult = _a.sent(); + expect(saveResult.errors).toEqual(undefined); + artifactsInfo = saveResult.modelArtifactsInfo; + expect(artifactsInfo.dateSaved.getTime()) + .toBeGreaterThanOrEqual(testStartDate.getTime()); + expect(saveResult.modelArtifactsInfo.modelTopologyBytes) + .toEqual(JSON.stringify(modelTopology1).length); + expect(saveResult.modelArtifactsInfo.weightSpecsBytes) + .toEqual(JSON.stringify(weightSpecs1).length); + expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16); + expect(savedArtifacts.modelTopology).toEqual(modelTopology1); + expect(savedArtifacts.weightSpecs).toEqual(weightSpecs1); + expect(savedArtifacts.weightData).toEqual(weightData1); + return [2]; + } + }); + }); }); +}); +jasmine_util_1.describeWithFlags('Passthrough Loader', test_util_1.BROWSER_ENVS, function () { + it('load topology and weights', function () { return __awaiter(_this, void 0, void 0, function () { + var passthroughHandler, modelArtifacts; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + passthroughHandler = tf.io.fromMemory(modelTopology1, weightSpecs1, weightData1); + return [4, passthroughHandler.load()]; + case 1: + modelArtifacts = _a.sent(); + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs).toEqual(weightSpecs1); + expect(modelArtifacts.weightData).toEqual(weightData1); + return [2]; + } + }); + }); }); + it('load model topology only', function () { return __awaiter(_this, void 0, void 0, function () { + var passthroughHandler, modelArtifacts; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + passthroughHandler = tf.io.fromMemory(modelTopology1); + return [4, passthroughHandler.load()]; + case 1: + modelArtifacts = _a.sent(); + expect(modelArtifacts.modelTopology).toEqual(modelTopology1); + expect(modelArtifacts.weightSpecs).toEqual(undefined); + expect(modelArtifacts.weightData).toEqual(undefined); + return [2]; + } + }); + }); }); +}); +//# sourceMappingURL=passthrough_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js.map new file mode 100644 index 0000000..1d01ace --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"passthrough_test.js","sourceRoot":"","sources":["../../src/io/passthrough_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,iBAgHA;;AAhHA,uBAAyB;AACzB,gDAAkD;AAClD,0CAA0C;AAE1C,IAAM,cAAc,GAAO;IACzB,YAAY,EAAE,YAAY;IAC1B,eAAe,EAAE,OAAO;IACxB,QAAQ,EAAE,CAAC;YACT,YAAY,EAAE,OAAO;YACrB,QAAQ,EAAE;gBACR,oBAAoB,EAAE;oBACpB,YAAY,EAAE,iBAAiB;oBAC/B,QAAQ,EAAE;wBACR,cAAc,EAAE,SAAS;wBACzB,OAAO,EAAE,GAAG;wBACZ,MAAM,EAAE,IAAI;wBACZ,MAAM,EAAE,SAAS;qBAClB;iBACF;gBACD,MAAM,EAAE,OAAO;gBACf,mBAAmB,EAAE,IAAI;gBACzB,kBAAkB,EAAE,IAAI;gBACxB,iBAAiB,EAAE,IAAI;g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CAAC,UAAU,CAAC,cAAc,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;oBACzC,WAAM,kBAAkB,CAAC,IAAI,EAAE,EAAA;;oBAAhD,cAAc,GAAG,SAA+B;oBACtD,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;oBAC7D,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;oBACzD,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;;;;SACxD,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE;;;;;oBACvB,kBAAkB,GAAG,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;oBACrC,WAAM,kBAAkB,CAAC,IAAI,EAAE,EAAA;;oBAAhD,cAAc,GAAG,SAA+B;oBACtD,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;oBAC7D,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;oBACtD,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;;;;SACtD,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts new file mode 100644 index 0000000..e5cc6bc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts @@ -0,0 +1,14 @@ +import { IOHandler } from './types'; +export declare type IORouter = (url: string) => IOHandler; +export declare class IORouterRegistry { + private static instance; + private saveRouters; + private loadRouters; + private constructor(); + private static getInstance; + static registerSaveRouter(saveRouter: IORouter): void; + static registerLoadRouter(loadRouter: IORouter): void; + static getSaveHandlers(url: string): IOHandler[]; + static getLoadHandlers(url: string): IOHandler[]; + private static getHandlers; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js new file mode 100644 index 0000000..e57dd46 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var IORouterRegistry = (function () { + function IORouterRegistry() { + this.saveRouters = []; + this.loadRouters = []; + } + IORouterRegistry.getInstance = function () { + if (IORouterRegistry.instance == null) { + IORouterRegistry.instance = new IORouterRegistry(); + } + return IORouterRegistry.instance; + }; + IORouterRegistry.registerSaveRouter = function (saveRouter) { + IORouterRegistry.getInstance().saveRouters.push(saveRouter); + }; + IORouterRegistry.registerLoadRouter = function (loadRouter) { + IORouterRegistry.getInstance().loadRouters.push(loadRouter); + }; + IORouterRegistry.getSaveHandlers = function (url) { + return IORouterRegistry.getHandlers(url, 'save'); + }; + IORouterRegistry.getLoadHandlers = function (url) { + return IORouterRegistry.getHandlers(url, 'load'); + }; + IORouterRegistry.getHandlers = function (url, handlerType) { + var validHandlers = []; + var routers = handlerType === 'load' ? this.getInstance().loadRouters : + this.getInstance().saveRouters; + routers.forEach(function (router) { + var handler = router(url); + if (handler !== null) { + validHandlers.push(handler); + } + }); + return validHandlers; + }; + return IORouterRegistry; +}()); +exports.IORouterRegistry = IORouterRegistry; +//# sourceMappingURL=router_registry.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js.map new file mode 100644 index 0000000..ec91550 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js.map @@ -0,0 +1 @@ +{"version":3,"file":"router_registry.js","sourceRoot":"","sources":["../../src/io/router_registry.ts"],"names":[],"mappings":";;AAqBA;IAOE;QACE,IAAI,CAAC,WA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ACvB,CAAC;IACH,uBAAC;AAAD,CAAC,AA3ED,IA2EC;AA3EY,4CAAgB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js new file mode 100644 index 0000000..65ec045 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var indexed_db_1 = require("./indexed_db"); +var local_storage_1 = require("./local_storage"); +var router_registry_1 = require("./router_registry"); +jasmine_util_1.describeWithFlags('IORouterRegistry', test_util_1.BROWSER_ENVS, function () { + var localStorageRouter = function (url) { + var scheme = 'localstorage://'; + if (url.startsWith(scheme)) { + return local_storage_1.browserLocalStorage(url.slice(scheme.length)); + } + else { + return null; + } + }; + var indexedDBRouter = function (url) { + var scheme = 'indexeddb://'; + if (url.startsWith(scheme)) { + return indexed_db_1.browserIndexedDB(url.slice(scheme.length)); + } + else { + return null; + } + }; + var tempRegistryInstance = null; + beforeEach(function () { + tempRegistryInstance = router_registry_1.IORouterRegistry.instance; + router_registry_1.IORouterRegistry.instance = null; + }); + afterEach(function () { + router_registry_1.IORouterRegistry.instance = tempRegistryInstance; + }); + it('getSaveHandler succeeds', function () { + router_registry_1.IORouterRegistry.registerSaveRouter(localStorageRouter); + router_registry_1.IORouterRegistry.registerSaveRouter(indexedDBRouter); + var out1 = tf.io.getSaveHandlers('localstorage://foo-model'); + expect(out1.length).toEqual(1); + expect(out1[0] instanceof local_storage_1.BrowserLocalStorage).toEqual(true); + var out2 = tf.io.getSaveHandlers('indexeddb://foo-model'); + expect(out2.length).toEqual(1); + expect(out2[0] instanceof indexed_db_1.BrowserIndexedDB).toEqual(true); + }); + it('getLoadHandler succeeds', function () { + router_registry_1.IORouterRegistry.registerLoadRouter(localStorageRouter); + router_registry_1.IORouterRegistry.registerLoadRouter(indexedDBRouter); + var out1 = tf.io.getLoadHandlers('localstorage://foo-model'); + expect(out1.length).toEqual(1); + expect(out1[0] instanceof local_storage_1.BrowserLocalStorage).toEqual(true); + var out2 = tf.io.getLoadHandlers('indexeddb://foo-model'); + expect(out2.length).toEqual(1); + expect(out2[0] instanceof indexed_db_1.BrowserIndexedDB).toEqual(true); + }); + it('getSaveHandler fails', function () { + router_registry_1.IORouterRegistry.registerSaveRouter(localStorageRouter); + expect(tf.io.getSaveHandlers('invalidscheme://foo-model')).toEqual([]); + expect(tf.io.getLoadHandlers('localstorage://foo-model')).toEqual([]); + }); +}); +//# sourceMappingURL=router_registry_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js.map new file mode 100644 index 0000000..984f9d3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"router_registry_test.js","sourceRoot":"","sources":["../../src/io/router_registry_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA0C;AAC1C,2CAAgE;AAChE,iDAAyE;AACzE,qDAAmD;AAEnD,gCAAiB,CAAC,kBAAkB,EAAE,wBAAY,EAAE;IAClD,IAAM,kBAAkB,GAAG,UAAC,GAAW;QACrC,IAAM,MAAM,GAAG,iBAAiB,CAAC;QACjC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YAC1B,OAAO,mCAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM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 index 0000000..979c9d3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts @@ -0,0 +1,50 @@ +export declare const DTYPE_VALUE_SIZE_MAP: { + [dtype: string]: number; +}; +export declare type WeightsManifestConfig = WeightsManifestGroupConfig[]; +export declare interface WeightsManifestGroupConfig { + paths: string[]; + weights: WeightsManifestEntry[]; +} +export declare interface WeightsManifestEntry { + name: string; + shape: number[]; + dtype: 'float32' | 'int32' | 'bool'; + quantization?: { + scale: number; + min: number; + dtype: 'uint16' | 'uint8'; + }; +} +export interface SaveConfig { + trainableOnly?: boolean; +} +export interface SaveResult { + modelArtifactsInfo: ModelArtifactsInfo; + responses?: Response[]; + errors?: Array<{} | string>; +} +export declare interface ModelArtifactsInfo { + dateSaved: Date; + modelTopologyType: 'JSON' | 'GraphDef'; + modelTopologyBytes?: number; + weightSpecsBytes?: number; + weightDataBytes?: number; +} +export declare interface ModelArtifacts { + modelTopology?: {} | ArrayBuffer; + weightSpecs?: WeightsManifestEntry[]; + weightData?: ArrayBuffer; +} +export declare type LoadHandler = () => Promise; +export declare type SaveHandler = (modelArtifact: ModelArtifacts) => Promise; +export interface IOHandler { + save?: SaveHandler; + load?: LoadHandler; +} +export interface ModelStoreManager { + listModels(): Promise<{ + [path: string]: ModelArtifactsInfo; + }>; + removeModel(path: string): Promise; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/types.js b/node_modules/@tensorflow/tfjs-core/dist/io/types.js new file mode 100644 index 0000000..cf52e5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/types.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DTYPE_VALUE_SIZE_MAP = { + 'float32': 4, + 'int32': 4, + 'uint16': 2, + 'uint8': 1, + 'bool': 1, +}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/types.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/types.js.map new file mode 100644 index 0000000..cc5eec8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/io/types.ts"],"names":[],"mappings":";;AAsBa,QAAA,oBAAoB,GAA8B;IAC7D,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;CACV,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts new file mode 100644 index 0000000..aa0a2a2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts @@ -0,0 +1,4 @@ +import { NamedTensorMap } from '../tensor_types'; +import { WeightsManifestConfig } from './types'; +export declare function loadWeightsAsArrayBuffer(fetchURLs: string[], requestOptions?: RequestInit): Promise; +export declare function loadWeights(manifest: WeightsManifestConfig, filePathPrefix?: string, weightNames?: string[], requestOptions?: RequestInit): Promise; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js new file mode 100644 index 0000000..07d10ab --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js @@ -0,0 +1,200 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var ops_1 = require("../ops/ops"); +var util = require("../util"); +var types_1 = require("./types"); +function loadWeightsAsArrayBuffer(fetchURLs, requestOptions) { + return __awaiter(this, void 0, void 0, function () { + var requests, responses, buffers; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + requests = fetchURLs.map(function (fetchURL) { return fetch(fetchURL, requestOptions); }); + return [4, Promise.all(requests)]; + case 1: + responses = _a.sent(); + return [4, Promise.all(responses.map(function (response) { return response.arrayBuffer(); }))]; + case 2: + buffers = _a.sent(); + return [2, buffers]; + } + }); + }); +} +exports.loadWeightsAsArrayBuffer = loadWeightsAsArrayBuffer; +function loadWeights(manifest, filePathPrefix, weightNames, requestOptions) { + if (filePathPrefix === void 0) { filePathPrefix = ''; } + return __awaiter(this, void 0, void 0, function () { + var groupIndicesToFetchMap, groupWeightsToFetch, weightsFound, allManifestWeightNames, weightsNotFound, groupIndicesToFetch, fetchUrls, buffers, weightsTensorMap, bufferIndexOffset; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + groupIndicesToFetchMap = manifest.map(function () { return false; }); + groupWeightsToFetch = {}; + weightsFound = weightNames != null ? weightNames.map(function () { return false; }) : []; + allManifestWeightNames = []; + manifest.forEach(function (manifestGroupConfig, groupIndex) { + var groupOffset = 0; + manifestGroupConfig.weights.forEach(function (weightsEntry) { + var rawDtype = ('quantization' in weightsEntry) ? + weightsEntry.quantization.dtype : + weightsEntry.dtype; + var weightsBytes = types_1.DTYPE_VALUE_SIZE_MAP[rawDtype] * + util.sizeFromShape(weightsEntry.shape); + var enqueueWeightsForFetchingFn = function () { + groupIndicesToFetchMap[groupIndex] = true; + if (groupWeightsToFetch[groupIndex] == null) { + groupWeightsToFetch[groupIndex] = []; + } + groupWeightsToFetch[groupIndex].push({ + manifestEntry: weightsEntry, + groupOffset: groupOffset, + sizeBytes: weightsBytes + }); + }; + if (weightNames != null) { + weightNames.forEach(function (weightName, weightIndex) { + if (weightName === weightsEntry.name) { + enqueueWeightsForFetchingFn(); + weightsFound[weightIndex] = true; + } + }); + } + else { + enqueueWeightsForFetchingFn(); + } + allManifestWeightNames.push(weightsEntry.name); + groupOffset += weightsBytes; + }); + }); + if (!weightsFound.every(function (found) { return found; })) { + weightsNotFound = weightNames.filter(function (weight, i) { return !weightsFound[i]; }); + throw new Error("Could not find weights in manifest with names: " + + (weightsNotFound.join(', ') + ". \n") + + "Manifest JSON has weights with names: " + + (allManifestWeightNames.join(', ') + ".")); + } + groupIndicesToFetch = groupIndicesToFetchMap.reduce(function (accumulator, shouldFetch, i) { + if (shouldFetch) { + accumulator.push(i); + } + return accumulator; + }, []); + fetchUrls = []; + groupIndicesToFetch.forEach(function (i) { + manifest[i].paths.forEach(function (filepath) { + var fetchUrl = filePathPrefix + + (!filePathPrefix.endsWith('/') ? '/' : '') + filepath; + fetchUrls.push(fetchUrl); + }); + }); + return [4, loadWeightsAsArrayBuffer(fetchUrls, requestOptions)]; + case 1: + buffers = _a.sent(); + weightsTensorMap = {}; + bufferIndexOffset = 0; + groupIndicesToFetch.forEach(function (i) { + var numBuffers = manifest[i].paths.length; + var groupBytes = 0; + for (var i_1 = 0; i_1 < numBuffers; i_1++) { + groupBytes += buffers[bufferIndexOffset + i_1].byteLength; + } + var groupBuffer = new ArrayBuffer(groupBytes); + var groupByteBuffer = new Uint8Array(groupBuffer); + var groupBufferOffset = 0; + for (var i_2 = 0; i_2 < numBuffers; i_2++) { + var buffer = new Uint8Array(buffers[bufferIndexOffset + i_2]); + groupByteBuffer.set(buffer, groupBufferOffset); + groupBufferOffset += buffer.byteLength; + } + var weightsEntries = groupWeightsToFetch[i]; + weightsEntries.forEach(function (weightsEntry) { + var byteBuffer = groupBuffer.slice(weightsEntry.groupOffset, weightsEntry.groupOffset + weightsEntry.sizeBytes); + var typedArray; + var dtype = weightsEntry.manifestEntry.dtype; + if ('quantization' in weightsEntry.manifestEntry) { + var quantization_1 = weightsEntry.manifestEntry.quantization; + if (quantization_1.dtype !== 'uint8' && quantization_1.dtype !== 'uint16') { + throw new Error("Weight " + weightsEntry.manifestEntry.name + " has unknown " + + ("quantization dtype " + quantization_1.dtype + ".")); + } + var quantizedArray = (quantization_1.dtype === 'uint8') ? + new Uint8Array(byteBuffer) : + new Uint16Array(byteBuffer); + if (dtype === 'float32') { + typedArray = Float32Array.from(quantizedArray, function (v) { return v * quantization_1.scale + quantization_1.min; }); + } + else if (dtype === 'int32') { + typedArray = Int32Array.from(quantizedArray, function (v) { return Math.round(v * quantization_1.scale + quantization_1.min); }); + } + else { + throw new Error("Weight " + weightsEntry.manifestEntry.name + " has a dtype not " + + ("supported by quantization: " + dtype)); + } + } + else { + if (dtype === 'float32') { + typedArray = new Float32Array(byteBuffer); + } + else if (dtype === 'int32') { + typedArray = new Int32Array(byteBuffer); + } + else if (dtype === 'bool') { + typedArray = new Uint8Array(byteBuffer); + } + else { + throw new Error("Weight " + weightsEntry.manifestEntry.name + " has unknown dtype " + + (dtype + ".")); + } + } + var weightName = weightsEntry.manifestEntry.name; + if (weightsTensorMap[weightName] != null) { + throw new Error("Duplicate weight with name " + weightName + ". " + + "Please make sure weights names are unique in the manifest JSON."); + } + weightsTensorMap[weightName] = ops_1.tensor(typedArray, weightsEntry.manifestEntry.shape, weightsEntry.manifestEntry.dtype); + }); + bufferIndexOffset += numBuffers; + }); + return [2, weightsTensorMap]; + } + }); + }); +} +exports.loadWeights = loadWeights; +//# sourceMappingURL=weights_loader.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js.map new file mode 100644 index 0000000..f47b706 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js.map @@ -0,0 +1 @@ +{"version":3,"file":"weights_loader.js","sourceRoot":"","sources":["../../src/io/weights_loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,kCAAkC;AAGlC,8BAAgC;AAChC,iCAA0F;AAU1F,kCACI,SAAmB,EAAE,cAA4B;;;;;;oBAE7C,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,UAAA,QAAQ,IAAI,OAAA,KAAK,CAAC,QAAQ,EAAE,cAAc,CAAC,EAA/B,CAA+B,CAAC,CAAC;oBAC1D,WAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAA;;oBAAvC,SAAS,GAAG,SAA2B;oBAEzC,WAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,WAAW,EAAE,EAAtB,CAAs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dist/io/weights_loader_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js new file mode 100644 index 0000000..e7ce1de --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js @@ -0,0 +1,531 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('loadWeights', test_util_1.BROWSER_ENVS, function () { + var setupFakeWeightFiles = function (fileBufferMap) { + spyOn(window, 'fetch').and.callFake(function (path) { + return new Response(fileBufferMap[path]); + }); + }; + it('1 group, 1 weight, 1 requested weight', function (done) { + setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3]) }); + var manifest = [{ + 'paths': ['weightfile0'], + 'weights': [{ 'name': 'weight0', 'dtype': 'float32', 'shape': [3] }] + }]; + var weightsNamesToFetch = ['weight0']; + tf.io.loadWeights(manifest, './', weightsNamesToFetch) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(1); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(weightsNamesToFetch.length); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [1, 2, 3]); + expect(weight0.shape).toEqual([3]); + expect(weight0.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('1 group, 2 weights, fetch 1st weight', function (done) { + setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3, 4, 5]) }); + var manifest = [{ + 'paths': ['weightfile0'], + 'weights': [ + { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] }, + { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] } + ] + }]; + tf.io.loadWeights(manifest, './', ['weight0']) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(1); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(1); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [1, 2]); + expect(weight0.shape).toEqual([2]); + expect(weight0.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('1 group, 2 weights, fetch 2nd weight', function (done) { + setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3, 4, 5]) }); + var manifest = [{ + 'paths': ['weightfile0'], + 'weights': [ + { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] }, + { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] } + ] + }]; + tf.io.loadWeights(manifest, './', ['weight1']) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(1); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(1); + var weight1 = weights['weight1']; + test_util_1.expectArraysClose(weight1, [3, 4, 5]); + expect(weight1.shape).toEqual([3]); + expect(weight1.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('1 group, 2 weights, fetch all weights', function (done) { + setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3, 4, 5]) }); + var manifest = [{ + 'paths': ['weightfile0'], + 'weights': [ + { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] }, + { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] } + ] + }]; + tf.io.loadWeights(manifest, './', ['weight0', 'weight1']) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(1); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(2); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [1, 2]); + expect(weight0.shape).toEqual([2]); + expect(weight0.dtype).toEqual('float32'); + var weight1 = weights['weight1']; + test_util_1.expectArraysClose(weight1, [3, 4, 5]); + expect(weight1.shape).toEqual([3]); + expect(weight1.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('1 group, multiple weights, different dtypes', function (done) { + var buffer = new ArrayBuffer(5 * 4 + 1); + var view = new DataView(buffer); + view.setInt32(0, 1, true); + view.setInt32(4, 2, true); + view.setUint8(8, 1); + view.setFloat32(9, 3., true); + view.setFloat32(13, 4., true); + view.setFloat32(17, 5., true); + setupFakeWeightFiles({ './weightfile0': buffer }); + var manifest = [{ + 'paths': ['weightfile0'], + 'weights': [ + { 'name': 'weight0', 'dtype': 'int32', 'shape': [2] }, + { 'name': 'weight1', 'dtype': 'bool', 'shape': [] }, + { 'name': 'weight2', 'dtype': 'float32', 'shape': [3] }, + ] + }]; + tf.io.loadWeights(manifest, './', ['weight0', 'weight1', 'weight2']) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(1); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(3); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [1, 2]); + expect(weight0.shape).toEqual([2]); + expect(weight0.dtype).toEqual('int32'); + var weight1 = weights['weight1']; + test_util_1.expectArraysClose(weight1, [1]); + expect(weight1.shape).toEqual([]); + expect(weight1.dtype).toEqual('bool'); + var weight2 = weights['weight2']; + test_util_1.expectArraysClose(weight2, [3, 4, 5]); + expect(weight2.shape).toEqual([3]); + expect(weight2.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('1 group, sharded 1 weight across multiple files', function (done) { + var shard0 = new Float32Array([1, 2, 3, 4, 5]); + var shard1 = new Float32Array([1.1, 2.2]); + var shard2 = new Float32Array([10, 20, 30]); + setupFakeWeightFiles({ + './weightfile0': shard0, + './weightsfile1': shard1, + './weightsfile2': shard2 + }); + var manifest = [{ + 'paths': ['weightfile0', 'weightsfile1', 'weightsfile2'], + 'weights': [{ 'name': 'weight0', 'dtype': 'float32', 'shape': [5, 2] }] + }]; + tf.io.loadWeights(manifest, './', ['weight0']) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(3); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(1); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [1, 2, 3, 4, 5, 1.1, 2.2, 10, 20, 30]); + expect(weight0.shape).toEqual([5, 2]); + expect(weight0.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('1 group, sharded 2 weights across multiple files', function (done) { + var shard0 = new Int32Array([1, 2, 3, 4, 5]); + var shard1 = new ArrayBuffer(5 * 4); + var intBuffer = new Int32Array(shard1, 0, 2); + intBuffer.set([10, 20]); + var floatBuffer = new Float32Array(shard1, intBuffer.byteLength, 3); + floatBuffer.set([3.0, 4.0, 5.0]); + var shard2 = new Float32Array([10, 20, 30]); + setupFakeWeightFiles({ + './weightfile0': shard0, + './weightsfile1': shard1, + './weightsfile2': shard2 + }); + var manifest = [{ + 'paths': ['weightfile0', 'weightsfile1', 'weightsfile2'], + 'weights': [ + { 'name': 'weight0', 'dtype': 'int32', 'shape': [7, 1] }, + { 'name': 'weight1', 'dtype': 'float32', 'shape': [3, 2] } + ] + }]; + tf.io.loadWeights(manifest, './', ['weight0', 'weight1']) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(3); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(2); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [1, 2, 3, 4, 5, 10, 20]); + expect(weight0.shape).toEqual([7, 1]); + expect(weight0.dtype).toEqual('int32'); + var weight1 = weights['weight1']; + test_util_1.expectArraysClose(weight1, [3.0, 4.0, 5.0, 10, 20, 30]); + expect(weight1.shape).toEqual([3, 2]); + expect(weight1.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('2 group, 4 weights, fetches one group', function (done) { + setupFakeWeightFiles({ + './weightfile0': new Float32Array([1, 2, 3, 4, 5]), + './weightfile1': new Float32Array([6, 7, 8, 9]) + }); + var manifest = [ + { + 'paths': ['weightfile0'], + 'weights': [ + { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] }, + { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] } + ] + }, + { + 'paths': ['weightfile1'], + 'weights': [ + { 'name': 'weight2', 'dtype': 'float32', 'shape': [3, 1] }, + { 'name': 'weight3', 'dtype': 'float32', 'shape': [] } + ] + } + ]; + tf.io.loadWeights(manifest, './', ['weight0', 'weight1']) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(1); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(2); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [1, 2]); + expect(weight0.shape).toEqual([2]); + expect(weight0.dtype).toEqual('float32'); + var weight1 = weights['weight1']; + test_util_1.expectArraysClose(weight1, [3, 4, 5]); + expect(weight1.shape).toEqual([3]); + expect(weight1.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('2 group, 4 weights, one weight from each group', function (done) { + setupFakeWeightFiles({ + './weightfile0': new Float32Array([1, 2, 3, 4, 5]), + './weightfile1': new Float32Array([6, 7, 8, 9]) + }); + var manifest = [ + { + 'paths': ['weightfile0'], + 'weights': [ + { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] }, + { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] } + ] + }, + { + 'paths': ['weightfile1'], + 'weights': [ + { 'name': 'weight2', 'dtype': 'float32', 'shape': [3, 1] }, + { 'name': 'weight3', 'dtype': 'float32', 'shape': [] } + ] + } + ]; + tf.io.loadWeights(manifest, './', ['weight0', 'weight2']) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(2); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(2); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [1, 2]); + expect(weight0.shape).toEqual([2]); + expect(weight0.dtype).toEqual('float32'); + var weight2 = weights['weight2']; + test_util_1.expectArraysClose(weight2, [6, 7, 8]); + expect(weight2.shape).toEqual([3, 1]); + expect(weight2.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('2 group, 4 weights, dont specify weights fetchs all', function (done) { + setupFakeWeightFiles({ + './weightfile0': new Float32Array([1, 2, 3, 4, 5]), + './weightfile1': new Float32Array([6, 7, 8, 9]) + }); + var manifest = [ + { + 'paths': ['weightfile0'], + 'weights': [ + { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] }, + { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] } + ] + }, + { + 'paths': ['weightfile1'], + 'weights': [ + { 'name': 'weight2', 'dtype': 'float32', 'shape': [3, 1] }, + { 'name': 'weight3', 'dtype': 'float32', 'shape': [] } + ] + } + ]; + tf.io.loadWeights(manifest, './') + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(2); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(4); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [1, 2]); + expect(weight0.shape).toEqual([2]); + expect(weight0.dtype).toEqual('float32'); + var weight1 = weights['weight1']; + test_util_1.expectArraysClose(weight1, [3, 4, 5]); + expect(weight1.shape).toEqual([3]); + expect(weight1.dtype).toEqual('float32'); + var weight2 = weights['weight2']; + test_util_1.expectArraysClose(weight2, [6, 7, 8]); + expect(weight2.shape).toEqual([3, 1]); + expect(weight2.dtype).toEqual('float32'); + var weight3 = weights['weight3']; + test_util_1.expectArraysClose(weight3, [9]); + expect(weight3.shape).toEqual([]); + expect(weight3.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); + it('throws if requested weight not found', function (done) { return __awaiter(_this, void 0, void 0, function () { + var manifest, weightsNamesToFetch, e_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3]) }); + manifest = [{ + 'paths': ['weightfile0'], + 'weights': [{ 'name': 'weight0', 'dtype': 'float32', 'shape': [3] }] + }]; + weightsNamesToFetch = ['doesntexist']; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4, tf.io.loadWeights(manifest, './', weightsNamesToFetch)]; + case 2: + _a.sent(); + done.fail(); + return [3, 4]; + case 3: + e_1 = _a.sent(); + done(); + return [3, 4]; + case 4: return [2]; + } + }); + }); }); + it('throws if requested weight has unknown dtype', function (done) { return __awaiter(_this, void 0, void 0, function () { + var manifest, weightsNamesToFetch, e_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3]) }); + manifest = [{ + 'paths': ['weightfile0'], + 'weights': [{ + 'name': 'weight0', + 'dtype': 'null', + 'shape': [3] + }] + }]; + weightsNamesToFetch = ['weight0']; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4, tf.io.loadWeights(manifest, './', weightsNamesToFetch)]; + case 2: + _a.sent(); + done.fail(); + return [3, 4]; + case 3: + e_2 = _a.sent(); + done(); + return [3, 4]; + case 4: return [2]; + } + }); + }); }); + it('should use request option', function (done) { + setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3]) }); + var manifest = [{ + 'paths': ['weightfile0'], + 'weights': [{ 'name': 'weight0', 'dtype': 'float32', 'shape': [3] }] + }]; + var weightsNamesToFetch = ['weight0']; + tf.io + .loadWeights(manifest, './', weightsNamesToFetch, { credentials: 'include' }) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(1); + expect(window.fetch).toHaveBeenCalledWith('./weightfile0', { + credentials: 'include' + }); + }) + .then(done) + .catch(done.fail); + }); + var quantizationTest = function (quantizationDtype, done) { + var arrayType = quantizationDtype === 'uint8' ? Uint8Array : Uint16Array; + setupFakeWeightFiles({ './weightfile0': new arrayType([0, 48, 255, 0, 48, 255]) }); + var manifest = [{ + 'paths': ['weightfile0'], + 'weights': [ + { + 'name': 'weight0', + 'dtype': 'float32', + 'shape': [3], + 'quantization': { 'min': -1, 'scale': 0.1, 'dtype': quantizationDtype } + }, + { + 'name': 'weight1', + 'dtype': 'int32', + 'shape': [3], + 'quantization': { 'min': -1, 'scale': 0.1, 'dtype': quantizationDtype } + } + ] + }]; + var weightsNamesToFetch = ['weight0', 'weight1']; + tf.io.loadWeights(manifest, './', weightsNamesToFetch) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(1); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(weightsNamesToFetch.length); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [-1, 3.8, 24.5]); + expect(weight0.shape).toEqual([3]); + expect(weight0.dtype).toEqual('float32'); + var weight1 = weights['weight1']; + test_util_1.expectArraysEqual(weight1, [-1, 4, 25]); + expect(weight1.shape).toEqual([3]); + expect(weight1.dtype).toEqual('int32'); + }) + .then(done) + .catch(done.fail); + }; + it('quantized weights (uint8)', function (done) { + quantizationTest('uint8', done); + }); + it('quantized weights (uint16)', function (done) { + quantizationTest('uint16', done); + }); + it('2 groups, 1 quantized, 1 unquantized', function (done) { + setupFakeWeightFiles({ + './weightfile0': new Uint8Array([0, 48, 255, 0, 48, 255]), + './weightfile1': new Float32Array([6, 7, 8, 9]) + }); + var manifest = [ + { + 'paths': ['weightfile0'], + 'weights': [ + { + 'name': 'weight0', + 'dtype': 'float32', + 'shape': [3], + 'quantization': { 'min': -1, 'scale': 0.1, 'dtype': 'uint8' } + }, + { + 'name': 'weight1', + 'dtype': 'int32', + 'shape': [3], + 'quantization': { 'min': -1, 'scale': 0.1, 'dtype': 'uint8' } + } + ] + }, + { + 'paths': ['weightfile1'], + 'weights': [ + { 'name': 'weight2', 'dtype': 'float32', 'shape': [3, 1] }, + { 'name': 'weight3', 'dtype': 'float32', 'shape': [] } + ] + } + ]; + tf.io.loadWeights(manifest, './', ['weight0', 'weight2']) + .then(function (weights) { + expect(window.fetch.calls.count()).toBe(2); + var weightNames = Object.keys(weights); + expect(weightNames.length).toEqual(2); + var weight0 = weights['weight0']; + test_util_1.expectArraysClose(weight0, [-1, 3.8, 24.5]); + expect(weight0.shape).toEqual([3]); + expect(weight0.dtype).toEqual('float32'); + var weight2 = weights['weight2']; + test_util_1.expectArraysClose(weight2, [6, 7, 8]); + expect(weight2.shape).toEqual([3, 1]); + expect(weight2.dtype).toEqual('float32'); + }) + .then(done) + .catch(done.fail); + }); +}); +//# sourceMappingURL=weights_loader_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js.map new file mode 100644 index 0000000..4487850 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"weights_loader_test.js","sourceRoot":"","sources":["../../src/io/weights_loader_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,iBA8jBA;;AA9jBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAgF;AAGhF,gCAAiB,CAAC,aAAa,EAAE,wBAAY,EAAE;IAC7C,IAAM,oBAAoB,GAAG,UAAC,aAG7B;QACC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAC,IAAY;YAC/C,OAAO,IAAI,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,EAAE,CAAC,uCAAuC,EAAE,UAAA,IAAI;QAC9C,oBAAoB,CAAC,EAAC,eAAe,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC;QAErE,IAAM,QAAQ,GAA0B,CAAC;gBACvC,OAAO,EAAE,CAAC,aAAa,CAAC;gBACxB,SAAS,EAAE,CAAC,EAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAC,CAAC;aACnE,CAAC,CAAC;QAEH,IAAM,mBAAmB,GAAG,CAAC,SAAS,CAAC,CAAC;QACxC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,mBAAmB,CAAC;aACjD,IAAI,CAAC,UAAA,OAAO;YACX,MAAM,CAAE,MAAM,CAAC,KAA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ensorflow/tfjs-core/dist/jasmine_util.d.ts new file mode 100644 index 0000000..ecb6501 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts @@ -0,0 +1,14 @@ +import { Features } from './environment_util'; +import { KernelBackend } from './kernels/backend'; +import { MathBackendCPU } from './kernels/backend_cpu'; +export declare function envSatisfiesConstraints(constraints: Features): boolean; +export declare function parseKarmaFlags(args: string[]): TestEnv; +export declare function describeWithFlags(name: string, constraints: Features, tests: () => void): void; +export interface TestEnv { + name: string; + factory: () => KernelBackend; + features: Features; +} +export declare let TEST_ENVS: TestEnv[]; +export declare const CPU_FACTORY: () => MathBackendCPU; +export declare function setTestEnvs(testEnvs: TestEnv[]): void; diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js new file mode 100644 index 0000000..1642252 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js @@ -0,0 +1,112 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("./environment"); +var backend_cpu_1 = require("./kernels/backend_cpu"); +var backend_webgl_1 = require("./kernels/backend_webgl"); +Error.stackTraceLimit = Infinity; +function envSatisfiesConstraints(constraints) { + for (var key in constraints) { + var value = constraints[key]; + if (environment_1.ENV.get(key) !== value) { + return false; + } + } + return true; +} +exports.envSatisfiesConstraints = envSatisfiesConstraints; +function parseKarmaFlags(args) { + var features; + var backend; + var name = ''; + args.forEach(function (arg, i) { + if (arg === '--features') { + features = JSON.parse(args[i + 1]); + } + else if (arg === '--backend') { + var type = args[i + 1]; + name = type; + if (type.toLowerCase() === 'cpu') { + backend = function () { return new backend_cpu_1.MathBackendCPU(); }; + } + else if (type.toLowerCase() === 'webgl') { + backend = function () { return new backend_webgl_1.MathBackendWebGL(); }; + } + else { + throw new Error("Unknown value " + type + " for flag --backend. " + + "Allowed values are 'cpu' or 'webgl'."); + } + } + }); + if (features == null && backend == null) { + return null; + } + if (features != null && backend == null) { + throw new Error('--backend flag is required when --features is present. ' + + 'Available values are "webgl" or "cpu".'); + } + return { features: features || {}, factory: backend, name: name }; +} +exports.parseKarmaFlags = parseKarmaFlags; +function describeWithFlags(name, constraints, tests) { + exports.TEST_ENVS.forEach(function (testEnv) { + environment_1.ENV.setFeatures(testEnv.features); + if (envSatisfiesConstraints(constraints)) { + var testName = name + ' ' + testEnv.name + ' ' + JSON.stringify(testEnv.features); + executeTests(testName, tests, testEnv); + } + }); +} +exports.describeWithFlags = describeWithFlags; +exports.TEST_ENVS = [ + { + name: 'test-webgl1', + factory: function () { return new backend_webgl_1.MathBackendWebGL(); }, + features: { 'WEBGL_VERSION': 1 } + }, + { + name: 'test-webgl2', + factory: function () { return new backend_webgl_1.MathBackendWebGL(); }, + features: { 'WEBGL_VERSION': 2 } + }, + { + name: 'test-cpu', + factory: function () { return new backend_cpu_1.MathBackendCPU(); }, + features: { 'HAS_WEBGL': false } + } +]; +exports.CPU_FACTORY = function () { return new backend_cpu_1.MathBackendCPU(); }; +if (typeof __karma__ !== 'undefined') { + var testEnv = parseKarmaFlags(__karma__.config.args); + if (testEnv) { + setTestEnvs([testEnv]); + } +} +function setTestEnvs(testEnvs) { + exports.TEST_ENVS = testEnvs; +} +exports.setTestEnvs = setTestEnvs; +function executeTests(testName, tests, testEnv) { + describe(testName, function () { + var backendName = 'test-' + testEnv.name; + beforeAll(function () { + environment_1.ENV.reset(); + environment_1.ENV.setFeatures(testEnv.features); + environment_1.ENV.set('IS_TEST', true); + environment_1.ENV.registerBackend(backendName, testEnv.factory, 1000); + environment_1.Environment.setBackend(backendName); + }); + beforeEach(function () { + environment_1.ENV.engine.startScope(); + }); + afterEach(function () { + environment_1.ENV.engine.endScope(); + environment_1.Environment.disposeVariables(); + }); + afterAll(function () { + environment_1.ENV.removeBackend(backendName); + environment_1.ENV.reset(); + }); + tests(); + }); +} +//# sourceMappingURL=jasmine_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js.map new file mode 100644 index 0000000..83f7141 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jasmine_util.js","sourceRoot":"","sources":["../src/jasmine_util.ts"],"names":[],"mappings":";;AAiBA,6CAA+C;AAG/C,qDAAqD;AACrD,yDAAyD;AAEzD,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;AAGjC,iCAAwC,WAAqB;IAC3D,KAAK,IAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,IAAM,KAAK,GAAG,WAAW,CAAC,GAAqB,CAAC,CAAC;QACjD,IAAI,iBAAG,CAAC,GAAG,CAAC,GAAqB,CAAC,KAAK,KAAK,EAAE;YAC5C,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AARD,0DAQC;AAKD,yBAAgC,IAAc;IAC5C,IAAI,QAAkB,CAAC;IACvB,IAAI,OAA4B,CAAC;IACjC,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG,EAAE,CAAC;QAClB,IAAI,GAAG,KAAK,YAAY,EAAE;YACxB,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACpC;aAAM,IAAI,GAAG,KAAK,WAAW,EAAE;YAC9B,IAAM,IAAI,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACzB,IAAI,GAAG,IAAI,CAAC;YACZ,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;gBAChC,OAAO,GAAG,cAAM,OAAA,IAAI,4BAAc,EAAE,EAApB,CAAoB,CAAC;aACtC;iBAAM,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,OAAO,EAAE;gBACzC,OAAO,GAAG,cAAM,O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CAAC,gBAAgB,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC;YACP,iBAAG,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;YAC/B,iBAAG,CAAC,KAAK,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,KAAK,EAAE,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js new file mode 100644 index 0000000..1fe5341 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var jasmine_util_1 = require("./jasmine_util"); +var backend_cpu_1 = require("./kernels/backend_cpu"); +var backend_webgl_1 = require("./kernels/backend_webgl"); +var test_util_1 = require("./test_util"); +describe('jasmine_util.envSatisfiesConstraints', function () { + it('ENV satisfies empty constraints', function () { + expect(jasmine_util_1.envSatisfiesConstraints({})).toBe(true); + }); + it('ENV satisfies matching constraints', function () { + var c = { TEST_EPSILON: tf.ENV.get('TEST_EPSILON') }; + expect(jasmine_util_1.envSatisfiesConstraints(c)).toBe(true); + }); + it('ENV does not satisfy mismatching constraints', function () { + var c = { TEST_EPSILON: tf.ENV.get('TEST_EPSILON') + 0.1 }; + expect(jasmine_util_1.envSatisfiesConstraints(c)).toBe(false); + }); +}); +describe('jasmine_util.parseKarmaFlags', function () { + it('parse empty args', function () { + var res = jasmine_util_1.parseKarmaFlags([]); + expect(res).toBeNull(); + }); + it('--backend cpu', function () { + var res = jasmine_util_1.parseKarmaFlags(['--backend', 'cpu']); + expect(res.name).toBe('cpu'); + expect(res.features).toEqual({}); + expect(res.factory() instanceof backend_cpu_1.MathBackendCPU).toBe(true); + }); + it('--backend cpu --features {"IS_NODE": true}', function () { + var res = jasmine_util_1.parseKarmaFlags(['--backend', 'cpu', '--features', '{"IS_NODE": true}']); + expect(res.name).toBe('cpu'); + expect(res.features).toEqual({ IS_NODE: true }); + expect(res.factory() instanceof backend_cpu_1.MathBackendCPU).toBe(true); + }); + it('"--backend unknown" throws error', function () { + expect(function () { return jasmine_util_1.parseKarmaFlags(['--backend', 'unknown']); }).toThrowError(); + }); + it('"--features {}" throws error since --backend is missing', function () { + expect(function () { return jasmine_util_1.parseKarmaFlags(['--features', '{}']); }).toThrowError(); + }); + it('"--backend cpu --features" throws error since features value is missing', function () { + expect(function () { return jasmine_util_1.parseKarmaFlags(['--backend', 'cpu', '--features']); }) + .toThrowError(); + }); + it('"--backend cpu --features notJson" throws error', function () { + expect(function () { return jasmine_util_1.parseKarmaFlags(['--backend', 'cpu', '--features', 'notJson']); }) + .toThrowError(); + }); +}); +jasmine_util_1.describeWithFlags('jasmine_util.envSatisfiesConstraints', test_util_1.WEBGL_ENVS, function () { + it('--backend webgl', function () { + var res = jasmine_util_1.parseKarmaFlags(['--backend', 'webgl']); + expect(res.name).toBe('webgl'); + expect(res.features).toEqual({}); + expect(res.factory() instanceof backend_webgl_1.MathBackendWebGL).toBe(true); + }); +}); +//# sourceMappingURL=jasmine_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js.map new file mode 100644 index 0000000..97e2e82 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jasmine_util_test.js","sourceRoot":"","sources":["../src/jasmine_util_test.ts"],"names":[],"mappings":";;AAiBA,4B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,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC,EAA9D,CAA8D,CAAC;aACvE,YAAY,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,gCAAiB,CAAC,sCAAsC,EAAE,sBAAU,EAAE;IACpE,EAAE,CAAC,iBAAiB,EAAE;QACpB,IAAM,GAAG,GAAG,8BAAe,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,gCAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.d.ts new file mode 100644 index 0000000..86bd06e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.d.ts @@ -0,0 +1,125 @@ +import { Conv2DInfo } from '../ops/conv_util'; +import { DataId, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D } from '../tensor'; +import { DataType, Rank, ShapeMap, TypedArray } from '../types'; +export interface BackendTimingInfo { + kernelMs: number; +} +export interface TensorStorage { + read(dataId: DataId): Promise; + readSync(dataId: DataId): TypedArray; + disposeData(dataId: DataId): void; + write(dataId: DataId, values: TypedArray): void; + fromPixels(pixels: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, numChannels: number): Tensor3D; + register(dataId: DataId, shape: number[], dtype: DataType): void; + memory(): { + unreliable: boolean; + }; +} +export interface BackendTimer { + time(f: () => void): Promise; +} +export interface KernelBackend extends TensorStorage, BackendTimer { + matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean): Tensor2D; + slice(x: T, begin: number[], size: number[]): T; + stridedSlice(x: T, begin: number[], end: number[], strides: number[], beginMask: number, endMask: number): T; + reverse(a: T, axis: number[]): T; + concat(a: Tensor2D, b: Tensor2D): Tensor2D; + neg(a: T): T; + add(a: Tensor, b: Tensor): Tensor; + addN(tensors: T[]): T; + subtract(a: Tensor, b: Tensor): Tensor; + multiply(a: Tensor, b: Tensor): Tensor; + realDivide(a: Tensor, b: Tensor): Tensor; + floorDiv(a: Tensor, b: Tensor): Tensor; + sum(x: Tensor, axes: number[]): Tensor; + unsortedSegmentSum(x: T, segmentIds: Tensor1D, numSegments: number): Tensor; + argMin(x: Tensor, axis: number): Tensor; + argMax(x: Tensor, axis: number): Tensor; + equal(a: Tensor, b: Tensor): Tensor; + notEqual(a: Tensor, b: Tensor): Tensor; + less(a: Tensor, b: Tensor): Tensor; + lessEqual(a: Tensor, b: Tensor): Tensor; + greater(a: Tensor, b: Tensor): Tensor; + greaterEqual(a: Tensor, b: Tensor): Tensor; + logicalNot(a: T): T; + logicalAnd(a: Tensor, b: Tensor): Tensor; + logicalOr(a: Tensor, b: Tensor): Tensor; + where(condition: Tensor): Tensor2D; + select(condition: Tensor, a: Tensor, b: Tensor): Tensor; + topk(x: T, k: number, sorted: boolean): [T, T]; + min(x: Tensor, axes: number[]): Tensor; + minimum(a: Tensor, b: Tensor): Tensor; + mod(a: Tensor, b: Tensor): Tensor; + max(x: Tensor, axes: number[]): Tensor; + maximum(a: Tensor, b: Tensor): Tensor; + all(x: Tensor, axes: number[]): Tensor; + any(x: Tensor, axes: number[]): Tensor; + squaredDifference(a: Tensor, b: Tensor): Tensor; + ceil(x: T): T; + floor(x: T): T; + round(x: T): T; + sign(x: T): T; + pow(a: T, b: Tensor): T; + exp(x: T): T; + expm1(x: T): T; + log(x: T): T; + log1p(x: T): T; + sqrt(x: T): T; + rsqrt(x: T): T; + square(x: T): T; + reciprocal(x: T): T; + relu(x: T): T; + elu(x: T): T; + eluDer(dy: T, y: T): T; + selu(x: T): T; + int(x: T): T; + clip(x: T, min: number, max: number): T; + abs(x: T): T; + sigmoid(x: T): T; + softplus(x: T): T; + sin(x: T): T; + cos(x: T): T; + tan(x: T): T; + asin(x: T): T; + acos(x: T): T; + atan(x: T): T; + atan2(a: T, b: T): T; + sinh(x: T): T; + cosh(x: T): T; + tanh(x: T): T; + asinh(x: T): T; + acosh(x: T): T; + atanh(x: T): T; + erf(x: T): T; + step(x: T, alpha: number): T; + conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + conv2dDerFilter(x: Tensor4D, dY: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + depthwiseConv2D(input: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + depthwiseConv2DDerFilter(x: Tensor4D, dY: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + reshape(x: T, shape: ShapeMap[R]): Tensor; + cast(x: T, dtype: DataType): T; + tile(x: T, reps: number[]): T; + pad(x: T, paddings: Array<[number, number]>, constantValue: number): T; + transpose(x: T, perm: number[]): T; + gather(x: T, indices: Tensor1D, axis: number): T; + batchToSpaceND(x: T, blockShape: number[], crops: number[][]): T; + spaceToBatchND(x: T, blockShape: number[], paddings: number[][]): T; + resizeBilinear(x: Tensor4D, newHeight: number, newWidth: number, alignCorners: boolean): Tensor4D; + resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor4D; + resizeNearestNeighbor(x: Tensor4D, newHEight: number, newWidth: number, alignCorners: boolean): Tensor4D; + resizeNearestNeighborBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor4D; + batchNormalization(x: Tensor4D, mean: Tensor4D | Tensor1D, variance: Tensor4D | Tensor1D, varianceEpsilon: number, scale?: Tensor4D | Tensor1D, offset?: Tensor4D | Tensor1D): Tensor4D; + localResponseNormalization4D(x: Tensor4D, radius: number, bias: number, alpha: number, beta: number): Tensor4D; + LRNGrad(dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D, radius: number, bias: number, alpha: number, beta: number): Tensor4D; + multinomial(logits: Tensor2D, normalized: boolean, numSamples: number, seed: number): Tensor2D; + oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number): Tensor2D; + cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean): Tensor; + nonMaxSuppression(boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number, iouThreshold: number, scoreThreshold?: number): Tensor1D; + dispose(): void; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.js new file mode 100644 index 0000000..702447e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=backend.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.js.map new file mode 100644 index 0000000..317978d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.js.map @@ -0,0 +1 @@ +{"version":3,"file":"backend.js","sourceRoot":"","sources":["../../src/kernels/backend.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_cpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_cpu.d.ts new file mode 100644 index 0000000..be55eec --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_cpu.d.ts @@ -0,0 +1,127 @@ +import { Conv2DInfo } from '../ops/conv_util'; +import { DataId, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D } from '../tensor'; +import { DataType, Rank, ShapeMap, TypedArray } from '../types'; +import { BackendTimingInfo, KernelBackend } from './backend'; +export declare class MathBackendCPU implements KernelBackend { + private data; + private canvas; + private firstUse; + constructor(); + register(dataId: DataId, shape: number[], dtype: DataType): void; + write(dataId: DataId, values: TypedArray): void; + fromPixels(pixels: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, numChannels: number): Tensor3D; + read(dataId: DataId): Promise; + readSync(dataId: DataId): TypedArray; + disposeData(dataId: DataId): void; + time(f: () => void): Promise; + memory(): { + unreliable: boolean; + }; + private throwIfNoData; + slice(x: T, begin: number[], size: number[]): T; + stridedSlice(x: T, begin: number[], end: number[], strides: number[], beginMask: number, endMask: number): T; + reverse(x: T, axis: number[]): T; + concat(a: Tensor2D, b: Tensor2D): Tensor2D; + neg(x: T): T; + add(a: Tensor, b: Tensor): Tensor; + addN(tensors: T[]): T; + subtract(a: Tensor, b: Tensor): Tensor; + pow(a: T, b: Tensor): T; + matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean): Tensor2D; + multiply(a: Tensor, b: Tensor): Tensor; + realDivide(a: Tensor, b: Tensor): Tensor; + floorDiv(a: Tensor, b: Tensor): Tensor; + sum(x: Tensor, axes: number[]): Tensor; + unsortedSegmentSum(x: T, segmentIds: Tensor1D, numSegments: number): Tensor; + argMin(x: Tensor, axis: number): Tensor; + argMax(x: Tensor, axis: number): Tensor; + cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean): Tensor; + equal(a: Tensor, b: Tensor): Tensor; + notEqual(a: Tensor, b: Tensor): Tensor; + less(a: Tensor, b: Tensor): Tensor; + lessEqual(a: Tensor, b: Tensor): Tensor; + greater(a: Tensor, b: Tensor): Tensor; + greaterEqual(a: Tensor, b: Tensor): Tensor; + logicalNot(x: T): T; + logicalAnd(a: Tensor, b: Tensor): Tensor; + logicalOr(a: Tensor, b: Tensor): Tensor; + select(condition: Tensor, a: Tensor, b: Tensor): Tensor; + where(condition: Tensor): Tensor2D; + topk(x: T, k: number, sorted: boolean): [T, T]; + min(x: Tensor, axes: number[]): Tensor; + minimum(a: Tensor, b: Tensor): Tensor; + mod(a: Tensor, b: Tensor): Tensor; + max(x: Tensor, axes: number[]): Tensor; + maximum(a: Tensor, b: Tensor): Tensor; + all(x: Tensor, axes: number[]): Tensor; + any(x: Tensor, axes: number[]): Tensor; + squaredDifference(a: Tensor, b: Tensor): Tensor; + ceil(x: T): T; + floor(x: T): T; + sign(x: T): T; + round(x: T): T; + exp(x: T): T; + expm1(x: T): T; + log(x: T): T; + log1p(x: T): T; + sqrt(x: T): T; + rsqrt(x: T): T; + square(x: T): T; + reciprocal(x: T): T; + relu(x: T): T; + elu(x: T): T; + eluDer(dy: T, y: T): T; + selu(x: T): T; + clip(x: T, min: number, max: number): T; + abs(x: T): T; + int(x: T): T; + sigmoid(x: T): T; + softplus(x: T): T; + sin(x: T): T; + cos(x: T): T; + tan(x: T): T; + asin(x: T): T; + acos(x: T): T; + atan(x: T): T; + atan2(a: T, b: T): T; + sinh(x: T): T; + cosh(x: T): T; + tanh(x: T): T; + asinh(x: T): T; + acosh(x: T): T; + atanh(x: T): T; + erf(x: T): T; + step(x: T, alpha?: number): T; + conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + conv2dDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + depthwiseConv2D(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + depthwiseConv2DDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + tile(x: T, reps: number[]): T; + pad(x: T, paddings: Array<[number, number]>, constantValue: number): T; + transpose(x: T, perm: number[]): T; + gather(x: T, indices: Tensor1D, axis: number): T; + batchToSpaceND(x: T, blockShape: number[], crops: number[][]): T; + spaceToBatchND(x: T, blockShape: number[], paddings: Array<[number, number]>): T; + private pool; + maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + private maxPoolPositions; + maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + cast(x: T, dtype: DataType): T; + reshape(x: Tensor, shape: ShapeMap[R]): Tensor; + avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + resizeBilinear(x: Tensor4D, newHeight: number, newWidth: number, alignCorners: boolean): Tensor4D; + resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor; + resizeNearestNeighbor(x: Tensor4D, newHeight: number, newWidth: number, alignCorners: boolean): Tensor4D; + resizeNearestNeighborBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor; + batchNormalization(x: Tensor4D, mean: Tensor4D | Tensor1D, variance: Tensor4D | Tensor1D, varianceEpsilon: number, scale?: Tensor4D | Tensor1D, offset?: Tensor4D | Tensor1D): Tensor4D; + localResponseNormalization4D(x: Tensor4D, radius: number, bias: number, alpha: number, beta: number): Tensor4D; + LRNGrad(dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D, depthRadius: number, bias: number, alpha: number, beta: number): Tensor4D; + multinomial(logits: Tensor2D, normalized: boolean, numSamples: number, seed: number): Tensor2D; + oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number): Tensor2D; + nonMaxSuppression(boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number, iouThreshold: number, scoreThreshold: number): Tensor1D; + private broadcastedBinaryOp; + dispose(): void; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_cpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_cpu.js new file mode 100644 index 0000000..13577c4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_cpu.js @@ -0,0 +1,1776 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var seedrandom = require("seedrandom"); +var environment_1 = require("../environment"); +var log_1 = require("../log"); +var array_ops_util = require("../ops/array_ops_util"); +var axis_util = require("../ops/axis_util"); +var broadcast_util = require("../ops/broadcast_util"); +var concat_util = require("../ops/concat_util"); +var erf_util = require("../ops/erf_util"); +var ops = require("../ops/ops"); +var ops_1 = require("../ops/ops"); +var selu_util = require("../ops/selu_util"); +var slice_util_1 = require("../ops/slice_util"); +var tensor_1 = require("../tensor"); +var types_1 = require("../types"); +var util = require("../util"); +var util_1 = require("../util"); +var backend_util = require("./backend_util"); +var non_max_suppression_impl_1 = require("./non_max_suppression_impl"); +var topk_impl_1 = require("./topk_impl"); +var where_impl_1 = require("./where_impl"); +var MathBackendCPU = (function () { + function MathBackendCPU() { + this.data = new WeakMap(); + this.firstUse = true; + if (environment_1.ENV.get('IS_BROWSER')) { + this.canvas = document.createElement('canvas'); + } + } + MathBackendCPU.prototype.register = function (dataId, shape, dtype) { + if (this.firstUse) { + this.firstUse = false; + if (environment_1.ENV.get('IS_NODE')) { + log_1.warn('\n============================\n' + + 'Hi there 👋. Looks like you are running TensorFlow.js in ' + + 'Node.js. To speed things up dramatically, install our node ' + + 'backend, which binds to TensorFlow C++, by running ' + + 'npm i @tensorflow/tfjs-node, ' + + 'or npm i @tensorflow/tfjs-node-gpu if you have CUDA. ' + + 'Then call require(\'@tensorflow/tfjs-node\'); (-gpu ' + + 'suffix for CUDA) at the start of your program. ' + + 'Visit https://github.com/tensorflow/tfjs-node for more details.' + + '\n============================\n'); + } + } + if (this.data.has(dataId)) { + throw new Error("Data buffer is already registered"); + } + this.data.set(dataId, null); + }; + MathBackendCPU.prototype.write = function (dataId, values) { + if (values == null) { + throw new Error('MathBackendCPU.write(): values can not be null'); + } + this.throwIfNoData(dataId); + this.data.set(dataId, values); + }; + MathBackendCPU.prototype.fromPixels = function (pixels, numChannels) { + if (pixels == null) { + throw new Error('pixels passed to tf.fromPixels() can not be null'); + } + var vals; + if (environment_1.ENV.get('IS_NODE') && pixels.getContext == null) { + throw new Error('When running in node, pixels must be an HTMLCanvasElement ' + + 'like the one returned by the `canvas` npm package'); + } + if (pixels.getContext != null) { + vals = pixels + .getContext('2d') + .getImageData(0, 0, pixels.width, pixels.height) + .data; + } + else if (pixels instanceof ImageData) { + vals = pixels.data; + } + else if (pixels instanceof HTMLImageElement || + pixels instanceof HTMLVideoElement) { + if (this.canvas == null) { + throw new Error('Can\'t read pixels from HTMLImageElement outside ' + + 'the browser.'); + } + this.canvas.width = pixels.width; + this.canvas.height = pixels.height; + this.canvas.getContext('2d').drawImage(pixels, 0, 0, pixels.width, pixels.height); + vals = this.canvas.getContext('2d') + .getImageData(0, 0, pixels.width, pixels.height) + .data; + } + else { + throw new Error('pixels passed to tf.fromPixels() must be either an ' + + "HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or " + + ("ImageData, but was " + pixels.constructor.name)); + } + var values; + if (numChannels === 4) { + values = new Int32Array(vals); + } + else { + var numPixels = pixels.width * pixels.height; + values = new Int32Array(numPixels * numChannels); + for (var i = 0; i < numPixels; i++) { + for (var channel = 0; channel < numChannels; ++channel) { + values[i * numChannels + channel] = vals[i * 4 + channel]; + } + } + } + var outShape = [pixels.height, pixels.width, numChannels]; + return ops_1.tensor3d(values, outShape, 'int32'); + }; + MathBackendCPU.prototype.read = function (dataId) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, this.readSync(dataId)]; + }); + }); + }; + MathBackendCPU.prototype.readSync = function (dataId) { + this.throwIfNoData(dataId); + return this.data.get(dataId); + }; + MathBackendCPU.prototype.disposeData = function (dataId) { + if (this.data.has(dataId)) { + this.data.delete(dataId); + } + }; + MathBackendCPU.prototype.time = function (f) { + return __awaiter(this, void 0, void 0, function () { + var start, kernelMs; + return __generator(this, function (_a) { + start = util_1.now(); + f(); + kernelMs = util_1.now() - start; + return [2, { kernelMs: kernelMs }]; + }); + }); + }; + MathBackendCPU.prototype.memory = function () { + return { + unreliable: true + }; + }; + MathBackendCPU.prototype.throwIfNoData = function (dataId) { + if (!this.data.has(dataId)) { + throw new Error("CPU backend: No data found for this tensor. " + + "Did you change your backend in the middle of the program? " + + "New backends can't use Tensors created with previous backends"); + } + }; + MathBackendCPU.prototype.slice = function (x, begin, size) { + var buffer = ops.buffer(size, x.dtype); + for (var i = 0; i < buffer.size; ++i) { + var loc = buffer.indexToLoc(i); + var xLoc = loc.map(function (idx, j) { return idx + begin[j]; }); + buffer.set.apply(buffer, [x.get.apply(x, xLoc)].concat(loc)); + } + return buffer.toTensor(); + }; + MathBackendCPU.prototype.stridedSlice = function (x, begin, end, strides, beginMask, endMask) { + var _a = slice_util_1.getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask), beginIndex = _a[0], size = _a[1]; + if (size.some(function (axis) { return axis === 0; })) { + return ops.tensor([], size); + } + var buffer = ops.buffer(size, x.dtype); + for (var i = 0; i < buffer.size; i++) { + var loc = buffer.indexToLoc(i); + var newLoc = new Array(loc.length); + for (var j = 0; j < newLoc.length; j++) { + newLoc[j] = loc[j] * strides[j] + beginIndex[j]; + } + buffer.set.apply(buffer, [x.get.apply(x, newLoc)].concat(loc)); + } + return buffer.toTensor(); + }; + MathBackendCPU.prototype.reverse = function (x, axis) { + var buffer = ops.buffer(x.shape, x.dtype); + var xBuffer = x.buffer(); + var _loop_1 = function (i) { + var outLoc = buffer.indexToLoc(i); + var inLoc = outLoc.slice(); + axis.forEach(function (ax) { return inLoc[ax] = x.shape[ax] - 1 - inLoc[ax]; }); + buffer.set.apply(buffer, [xBuffer.get.apply(xBuffer, inLoc)].concat(outLoc)); + }; + for (var i = 0; i < buffer.size; i++) { + _loop_1(i); + } + return buffer.toTensor(); + }; + MathBackendCPU.prototype.concat = function (a, b) { + var outShape = concat_util.computeOutShape(a.shape, b.shape, 1); + var buffer = ops.buffer(outShape, a.dtype); + if (a.shape[0] === 1 && b.shape[0] === 1) { + var aVals = a.dataSync(); + var bVals = b.dataSync(); + var vals = buffer.values; + vals.set(aVals, 0); + vals.set(bVals, a.size); + return buffer.toTensor(); + } + for (var i = 0; i < outShape[0]; ++i) { + for (var j = 0; j < a.shape[1]; ++j) { + buffer.set(a.get(i, j), i, j); + } + for (var j = 0; j < b.shape[1]; ++j) { + buffer.set(b.get(i, j), i, j + a.shape[1]); + } + } + return buffer.toTensor(); + }; + MathBackendCPU.prototype.neg = function (x) { + return this.multiply(ops.scalar(-1), x); + }; + MathBackendCPU.prototype.add = function (a, b) { + return this.broadcastedBinaryOp(a, b, types_1.upcastType(a.dtype, b.dtype), function (aValue, bValue) { return aValue + bValue; }); + }; + MathBackendCPU.prototype.addN = function (tensors) { + var vals = tensors.map(function (t) { return t.dataSync(); }); + var result = ops.buffer(tensors[0].shape, tensors[0].dtype); + var resultVals = result.values; + for (var i = 0; i < tensors.length; i++) { + var currVals = vals[i]; + for (var j = 0; j < resultVals.length; j++) { + resultVals[j] += currVals[j]; + } + } + return result.toTensor(); + }; + MathBackendCPU.prototype.subtract = function (a, b) { + return this.broadcastedBinaryOp(a, b, types_1.upcastType(a.dtype, b.dtype), function (aValue, bValue) { return aValue - bValue; }); + }; + MathBackendCPU.prototype.pow = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aValue, bValue) { return Math.pow(aValue, bValue); }); + }; + MathBackendCPU.prototype.matMul = function (a, b, transposeA, transposeB) { + var sharedDim = transposeA ? a.shape[0] : a.shape[1]; + var leftDim = transposeA ? a.shape[1] : a.shape[0]; + var rightDim = transposeB ? b.shape[0] : b.shape[1]; + var aValues = a.dataSync(); + var bValues = b.dataSync(); + var _a = transposeA ? [1, a.strides[0]] : [a.strides[0], 1], aOuterStep = _a[0], aInnerStep = _a[1]; + var _b = transposeB ? [b.strides[0], 1] : [1, b.strides[0]], bOuterStep = _b[0], bInnerStep = _b[1]; + var aOuterEnd = leftDim * aOuterStep; + var bOuterEnd = rightDim * bOuterStep; + var result = new Float32Array(leftDim * rightDim); + var resultIndex = 0; + for (var aOuter = 0; aOuter < aOuterEnd; aOuter += aOuterStep) { + for (var bOuter = 0; bOuter < bOuterEnd; bOuter += bOuterStep) { + var aInner = aOuter; + var bInner = bOuter; + var sum = 0; + for (var k = 0; k < sharedDim; ++k) { + sum += aValues[aInner] * bValues[bInner]; + aInner += aInnerStep; + bInner += bInnerStep; + } + result[resultIndex++] = sum; + } + } + return ops.tensor2d(result, [leftDim, rightDim]); + }; + MathBackendCPU.prototype.multiply = function (a, b) { + return this.broadcastedBinaryOp(a, b, types_1.upcastType(a.dtype, b.dtype), function (aValue, bValue) { return aValue * bValue; }); + }; + MathBackendCPU.prototype.realDivide = function (a, b) { + var op = function (a, b) { return a / b; }; + var outputDtype = 'float32'; + return this.broadcastedBinaryOp(a, b, outputDtype, op); + }; + MathBackendCPU.prototype.floorDiv = function (a, b) { + var op = function (a, b) { return Math.floor(a / b); }; + var outputDtype = 'int32'; + return this.broadcastedBinaryOp(a, b, outputDtype, op); + }; + MathBackendCPU.prototype.sum = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('sum', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var resultDtype = types_1.upcastType(x.dtype, 'int32'); + var result = ops.zeros(outShape, resultDtype); + var reduceSize = util.sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var sum = 0; + for (var j = 0; j < reduceSize; ++j) { + sum += aVals[offset + j]; + } + vals[i] = sum; + } + return result; + }; + MathBackendCPU.prototype.unsortedSegmentSum = function (x, segmentIds, numSegments) { + var res = []; + var numIters = x.rank - segmentIds.rank; + for (var i = 0; i < numIters; ++i) { + segmentIds = segmentIds.expandDims(i + 1); + } + for (var i = 0; i < numSegments; ++i) { + var segmentId = ops.scalar(i, 'int32'); + var mask = ops.equal(segmentId, segmentIds).asType('float32'); + var sum = mask.mul(x).sum(0); + res.push(sum); + } + return ops.stack(res); + }; + MathBackendCPU.prototype.argMin = function (x, axis) { + var axes = [axis]; + axis_util.assertAxesAreInnerMostDims('argMin', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = ops.zeros(outShape, 'int32'); + var reduceSize = util.sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var min = aVals[offset]; + var minIndex = 0; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + if (value < min) { + min = value; + minIndex = j; + } + } + vals[i] = minIndex; + } + return result; + }; + MathBackendCPU.prototype.argMax = function (x, axis) { + var axes = [axis]; + axis_util.assertAxesAreInnerMostDims('argMax', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = ops.zeros(outShape, 'int32'); + var reduceSize = util.sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var max = aVals[offset]; + var maxIndex = 0; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + if (value > max) { + max = value; + maxIndex = j; + } + } + vals[i] = maxIndex; + } + return result; + }; + MathBackendCPU.prototype.cumsum = function (x, axis, exclusive, reverse) { + if (axis !== x.rank - 1) { + throw new Error("backend.cumsum in CPU expects an inner-most axis=" + (x.rank - 1) + " " + + ("but got axis=" + axis)); + } + var resultDtype = types_1.upcastType(x.dtype, 'int32'); + var result = ops.zeros(x.shape, resultDtype); + var vals = result.dataSync(); + var aVals = x.dataSync(); + var finalDim = x.shape[x.rank - 1]; + var indexAdjuster = reverse ? + function (i, j) { return i + finalDim - j - 1; } : + function (i, j) { return i + j; }; + for (var i = 0; i < aVals.length; i += finalDim) { + for (var j = 0; j < finalDim; j++) { + var idx = indexAdjuster(i, j); + if (j === 0) { + vals[idx] = exclusive ? 0 : aVals[idx]; + } + else { + var prevIdx = indexAdjuster(i, j - 1); + vals[idx] = exclusive ? aVals[prevIdx] + vals[prevIdx] : + aVals[idx] + vals[prevIdx]; + } + } + } + return result; + }; + MathBackendCPU.prototype.equal = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal === bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.notEqual = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal !== bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.less = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal < bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.lessEqual = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal <= bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.greater = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal > bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.greaterEqual = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal >= bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.logicalNot = function (x) { + var values = x.dataSync(); + var newValues = new Int32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = values[i] ? 0 : 1; + } + return tensor_1.Tensor.make(x.shape, { values: newValues }, 'bool'); + }; + MathBackendCPU.prototype.logicalAnd = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return aVal && bVal; + }); + }; + MathBackendCPU.prototype.logicalOr = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return aVal || bVal; + }); + }; + MathBackendCPU.prototype.select = function (condition, a, b) { + var values = condition.dataSync(); + var aValues = a.dataSync(); + var bValues = b.dataSync(); + var result = ops.zeros(a.shape, types_1.upcastType(a.dtype, b.dtype)); + var newValues = result.dataSync(); + var index = 0; + var offset = condition.rank === 0 || condition.rank > 1 || a.rank === 1 ? + 1 : + a.shape[1]; + for (var i = 0; i < values.length; i++) { + for (var j = 0; j < offset; j++) { + if (values[i] === 1) { + newValues[index++] = aValues[i]; + } + else { + newValues[index++] = bValues[i]; + } + } + } + return result; + }; + MathBackendCPU.prototype.where = function (condition) { + var condVals = condition.dataSync(); + return where_impl_1.whereImpl(condition.shape, condVals); + }; + MathBackendCPU.prototype.topk = function (x, k, sorted) { + var xVals = x.dataSync(); + return topk_impl_1.topkImpl(xVals, x.shape, x.dtype, k, sorted); + }; + MathBackendCPU.prototype.min = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('min', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = ops.zeros(outShape, x.dtype); + var reduceSize = util.sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var min = aVals[offset]; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + if (value < min) { + min = value; + } + } + vals[i] = min; + } + return result; + }; + MathBackendCPU.prototype.minimum = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aVal, bVal) { return Math.min(aVal, bVal); }); + }; + MathBackendCPU.prototype.mod = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aVal, bVal) { + var rem = aVal % bVal; + if ((aVal < 0 && bVal < 0) || (aVal >= 0 && bVal >= 0)) { + return rem; + } + else { + return (rem + bVal) % bVal; + } + }); + }; + MathBackendCPU.prototype.max = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('max', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = ops.zeros(outShape, x.dtype); + var reduceSize = util.sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var max = aVals[offset]; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + if (value > max) { + max = value; + } + } + vals[i] = max; + } + return result; + }; + MathBackendCPU.prototype.maximum = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aVal, bVal) { return Math.max(aVal, bVal); }); + }; + MathBackendCPU.prototype.all = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('all', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = ops.zeros(outShape, x.dtype); + var reduceSize = util.sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var all = aVals[offset]; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + all = all && value; + } + vals[i] = all; + } + return result; + }; + MathBackendCPU.prototype.any = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('any', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = ops.zeros(outShape, x.dtype); + var reduceSize = util.sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var anyVal = aVals[offset]; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + anyVal = anyVal || value; + } + vals[i] = anyVal; + } + return result; + }; + MathBackendCPU.prototype.squaredDifference = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aVal, bVal) { + var diff = aVal - bVal; + return diff * diff; + }); + }; + MathBackendCPU.prototype.ceil = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = Math.ceil(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.floor = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = Math.floor(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.sign = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + if (values[i] < 0) { + newValues[i] = -1; + } + else if (values[i] > 0) { + newValues[i] = 1; + } + else { + newValues[i] = 0; + } + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.round = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var base = Math.floor(values[i]); + if (values[i] - base < 0.5) { + newValues[i] = Math.floor(values[i]); + } + else if (values[i] - base > 0.5) { + newValues[i] = Math.ceil(values[i]); + } + else { + if (base % 2.0 === 0.0) { + newValues[i] = base; + } + else { + newValues[i] = base + 1.0; + } + } + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.exp = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = Math.exp(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.expm1 = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = Math.expm1(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.log = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = Math.log(value); + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.log1p = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = Math.log1p(value); + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.sqrt = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = Math.sqrt(value); + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.rsqrt = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = 1 / Math.sqrt(value); + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.square = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = value * value; + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.reciprocal = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = 1 / values[i]; + } + return tensor_1.Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.relu = function (x) { + var res = ops.zeros(x.shape, x.dtype); + var resVals = res.dataSync(); + var inVals = x.dataSync(); + for (var i = 0; i < inVals.length; ++i) { + resVals[i] = Math.max(0, inVals[i]); + } + return res; + }; + MathBackendCPU.prototype.elu = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + var v = values[i]; + if (v >= 0) { + resultValues[i] = v; + } + else { + resultValues[i] = (Math.exp(v) - 1); + } + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.eluDer = function (dy, y) { + var resultValues = new Float32Array(y.size); + var values = y.dataSync(); + var dyValues = dy.dataSync(); + for (var i = 0; i < values.length; ++i) { + var v = values[i]; + if (v >= 1) { + resultValues[i] = dyValues[i]; + } + else { + resultValues[i] = dyValues[i] * (v + 1); + } + } + return tensor_1.Tensor.make(y.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.selu = function (x) { + var scaleAlpha = selu_util.SELU_SCALEALPHA; + var scale = selu_util.SELU_SCALE; + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + var v = values[i]; + if (v >= 0) { + resultValues[i] = scale * v; + } + else { + resultValues[i] = scaleAlpha * (Math.exp(v) - 1); + } + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.clip = function (x, min, max) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.min(max, Math.max(min, values[i])); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.abs = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.abs(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.int = function (x) { + var resultValues = new Int32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = values[i]; + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }, 'int32'); + }; + MathBackendCPU.prototype.sigmoid = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = 1 / (1 + Math.exp(-values[i])); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.softplus = function (x) { + var epsilon = 1.1920928955078125e-7; + var threshold = Math.log(epsilon) + 2.0; + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + var tooLarge = values[i] > -threshold; + var tooSmall = values[i] < threshold; + var expX = Math.exp(values[i]); + var result = void 0; + if (tooSmall) { + result = expX; + } + else if (tooLarge) { + result = values[i]; + } + else { + result = Math.log(1.0 + expX); + } + resultValues[i] = result; + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.sin = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.sin(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.cos = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.cos(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.tan = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.tan(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.asin = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.asin(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.acos = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.acos(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.atan = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.atan(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.atan2 = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aValue, bValue) { return Math.atan2(aValue, bValue); }); + }; + MathBackendCPU.prototype.sinh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.sinh(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.cosh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.cosh(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.tanh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = util.tanh(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.asinh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.asinh(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.acosh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.acosh(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.atanh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.atanh(values[i]); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.erf = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + var p = erf_util.ERF_P; + var a1 = erf_util.ERF_A1; + var a2 = erf_util.ERF_A2; + var a3 = erf_util.ERF_A3; + var a4 = erf_util.ERF_A4; + var a5 = erf_util.ERF_A5; + for (var i = 0; i < values.length; ++i) { + var v = values[i]; + var t = 1.0 / (1.0 + p * v); + resultValues[i] = 1.0 - + (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * + Math.exp(-v * v); + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.step = function (x, alpha) { + if (alpha === void 0) { alpha = 0; } + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + if (isNaN(value)) { + resultValues[i] = NaN; + } + else { + resultValues[i] = value > 0 ? 1 : alpha; + } + } + return tensor_1.Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.conv2d = function (x, filter, convInfo) { + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var padLeft = convInfo.padInfo.left; + var padTop = convInfo.padInfo.top; + var y = ops.buffer(convInfo.outShape, x.dtype); + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d2 = 0; d2 < convInfo.outChannels; ++d2) { + for (var yR = 0; yR < convInfo.outHeight; ++yR) { + var xRCorner = yR * convInfo.strideHeight - padLeft; + for (var yC = 0; yC < convInfo.outWidth; ++yC) { + var xCCorner = yC * convInfo.strideWidth - padTop; + var dotProd = 0; + for (var wR = 0; wR < filterHeight; wR++) { + var xR = xRCorner + wR * dilationHeight; + if (xR < 0 || xR >= convInfo.inHeight) { + continue; + } + for (var wC = 0; wC < filterWidth; wC++) { + var xC = xCCorner + wC * dilationWidth; + if (xC < 0 || xC >= convInfo.inWidth) { + continue; + } + for (var d1 = 0; d1 < convInfo.inChannels; ++d1) { + var pixel = x.get(b, xR, xC, d1); + var weight = filter.get(wR, wC, d1, d2); + dotProd += pixel * weight; + } + } + } + y.set(dotProd, b, yR, yC, d2); + } + } + } + } + return y.toTensor(); + }; + MathBackendCPU.prototype.conv2dDerInput = function (dy, filter, convInfo) { + var dx = ops.buffer(convInfo.inShape, 'float32'); + var dxValues = dx.values; + var _a = dx.strides, dxS0 = _a[0], dxS1 = _a[1], dxS2 = _a[2]; + var dyValues = dy.dataSync(); + var _b = dy.strides, dyS0 = _b[0], dyS1 = _b[1], dyS2 = _b[2]; + var fltValues = filter.dataSync(); + var _c = filter.strides, fltS0 = _c[0], fltS1 = _c[1], fltS2 = _c[2]; + var batchSize = convInfo.batchSize, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth; + var topPad = filterHeight - 1 - convInfo.padInfo.top; + var leftPad = filterWidth - 1 - convInfo.padInfo.left; + for (var b = 0; b < batchSize; ++b) { + for (var d1 = 0; d1 < inChannels; ++d1) { + for (var xR = 0; xR < inHeight; ++xR) { + var xRCorner = xR - topPad; + var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight)); + var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight); + for (var xC = 0; xC < inWidth; ++xC) { + var xCCorner = xC - leftPad; + var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth)); + var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth); + var dotProd = 0; + for (var yR = xRMin; yR < yRMax; ++yR) { + var wR = yR * strideHeight - xRCorner; + for (var yC = xCMin; yC < yCMax; ++yC) { + var wC = yC * strideWidth - xCCorner; + var dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC; + var fltOffset = fltS0 * (filterHeight - 1 - wR) + + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1; + for (var d2 = 0; d2 < outChannels; ++d2) { + var pixel = dyValues[dyOffset + d2]; + var weight = fltValues[fltOffset + d2]; + dotProd += pixel * weight; + } + } + } + dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd; + } + } + } + } + return dx.toTensor(); + }; + MathBackendCPU.prototype.conv2dDerFilter = function (x, dy, convInfo) { + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var dW = ops.buffer(convInfo.filterShape, 'float32'); + var leftPad = convInfo.padInfo.left; + var topPad = convInfo.padInfo.top; + for (var wR = 0; wR < filterHeight; ++wR) { + var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight)); + var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight); + for (var wC = 0; wC < filterWidth; ++wC) { + var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth)); + var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth); + for (var d1 = 0; d1 < convInfo.inChannels; ++d1) { + for (var d2 = 0; d2 < convInfo.outChannels; ++d2) { + var dotProd = 0; + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var yR = yRMin; yR < yRMax; ++yR) { + var xR = wR + yR * strideHeight - topPad; + for (var yC = yCMin; yC < yCMax; ++yC) { + var xC = wC + yC * strideWidth - leftPad; + dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2); + } + } + } + dW.set(dotProd, wR, wC, d1, d2); + } + } + } + } + return dW.toTensor(); + }; + MathBackendCPU.prototype.depthwiseConv2D = function (x, filter, convInfo) { + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var padLeft = convInfo.padInfo.left; + var padTop = convInfo.padInfo.top; + var chMul = convInfo.outChannels / convInfo.inChannels; + var y = ops.buffer(convInfo.outShape, x.dtype); + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d1 = 0; d1 < convInfo.inChannels; ++d1) { + for (var yR = 0; yR < convInfo.outHeight; ++yR) { + var xRCorner = yR * convInfo.strideHeight - padLeft; + for (var yC = 0; yC < convInfo.outWidth; ++yC) { + var xCCorner = yC * convInfo.strideWidth - padTop; + for (var q = 0; q < chMul; ++q) { + var dotProd = 0; + for (var wR = 0; wR < filterHeight; ++wR) { + var xR = xRCorner + wR * dilationHeight; + if (xR < 0 || xR >= convInfo.inHeight) { + continue; + } + for (var wC = 0; wC < filterWidth; ++wC) { + var xC = xCCorner + wC * dilationWidth; + if (xC < 0 || xC >= convInfo.inWidth) { + continue; + } + var pixel = x.get(b, xR, xC, d1); + var weight = filter.get(wR, wC, d1, q); + dotProd += pixel * weight; + } + } + y.set(dotProd, b, yR, yC, d1 * chMul + q); + } + } + } + } + } + return y.toTensor(); + }; + MathBackendCPU.prototype.depthwiseConv2DDerInput = function (dy, filter, convInfo) { + var dx = ops.buffer(convInfo.inShape, 'float32'); + var dxValues = dx.values; + var _a = dx.strides, dxS0 = _a[0], dxS1 = _a[1], dxS2 = _a[2]; + var dyValues = dy.dataSync(); + var _b = dy.strides, dyS0 = _b[0], dyS1 = _b[1], dyS2 = _b[2]; + var fltValues = filter.dataSync(); + var _c = filter.strides, fltS0 = _c[0], fltS1 = _c[1], fltS2 = _c[2]; + var batchSize = convInfo.batchSize, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth; + var topPad = filterHeight - 1 - convInfo.padInfo.top; + var leftPad = filterWidth - 1 - convInfo.padInfo.left; + var chMul = outChannels / inChannels; + for (var b = 0; b < batchSize; ++b) { + for (var d1 = 0; d1 < inChannels; ++d1) { + for (var xR = 0; xR < inHeight; ++xR) { + var xRCorner = xR - topPad; + var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight)); + var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight); + for (var xC = 0; xC < inWidth; ++xC) { + var xCCorner = xC - leftPad; + var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth)); + var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth); + var dotProd = 0; + for (var yR = xRMin; yR < yRMax; ++yR) { + var wR = yR * strideHeight - xRCorner; + for (var yC = xCMin; yC < yCMax; ++yC) { + var wC = yC * strideWidth - xCCorner; + var dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC; + var fltOffset = fltS0 * (filterHeight - 1 - wR) + + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1; + for (var dm = 0; dm < chMul; ++dm) { + var d2 = d1 * chMul + dm; + var pixel = dyValues[dyOffset + d2]; + var weight = fltValues[fltOffset + dm]; + dotProd += pixel * weight; + } + } + } + dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd; + } + } + } + } + return dx.toTensor(); + }; + MathBackendCPU.prototype.depthwiseConv2DDerFilter = function (x, dy, convInfo) { + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var dW = ops.buffer(convInfo.filterShape, 'float32'); + var leftPad = convInfo.padInfo.left; + var topPad = convInfo.padInfo.top; + var chMul = convInfo.outChannels / convInfo.inChannels; + for (var wR = 0; wR < filterHeight; ++wR) { + var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight)); + var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight); + for (var wC = 0; wC < filterWidth; ++wC) { + var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth)); + var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth); + for (var d2 = 0; d2 < convInfo.outChannels; ++d2) { + var d1 = Math.trunc(d2 / chMul); + var dm = d2 % chMul; + var dotProd = 0; + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var yR = yRMin; yR < yRMax; ++yR) { + var xR = wR + yR * strideHeight - topPad; + for (var yC = yCMin; yC < yCMax; ++yC) { + var xC = wC + yC * strideWidth - leftPad; + dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2); + } + } + } + dW.set(dotProd, wR, wC, d1, dm); + } + } + } + return dW.toTensor(); + }; + MathBackendCPU.prototype.tile = function (x, reps) { + var newShape = new Array(x.rank); + for (var i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[i] * reps[i]; + } + var result = ops.buffer(newShape, x.dtype); + var xBuf = x.buffer(); + for (var i = 0; i < result.values.length; ++i) { + var newLoc = result.indexToLoc(i); + var originalLoc = new Array(x.rank); + for (var i_1 = 0; i_1 < originalLoc.length; i_1++) { + originalLoc[i_1] = newLoc[i_1] % x.shape[i_1]; + } + var originalIndex = xBuf.locToIndex(originalLoc); + result.values[i] = xBuf.values[originalIndex]; + } + return result.toTensor(); + }; + MathBackendCPU.prototype.pad = function (x, paddings, constantValue) { + var outShape = paddings.map(function (p, i) { return p[0] + x.shape[i] + p[1]; }); + var start = paddings.map(function (p) { return p[0]; }); + var xBuffer = x.buffer(); + var buffer = ops.buffer(outShape, x.dtype); + if (constantValue !== 0) { + buffer.values.fill(constantValue); + } + for (var i = 0; i < x.size; i++) { + var coords = xBuffer.indexToLoc(i); + var outCoords = coords.map(function (c, i) { return c + start[i]; }); + buffer.set.apply(buffer, [x.get.apply(x, coords)].concat(outCoords)); + } + return buffer.toTensor(); + }; + MathBackendCPU.prototype.transpose = function (x, perm) { + var newShape = new Array(x.rank); + for (var i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[perm[i]]; + } + var values = x.dataSync(); + var result = ops_1.buffer(newShape, x.dtype); + var xBuf = x.buffer(); + for (var i = 0; i < x.size; ++i) { + var loc = xBuf.indexToLoc(i); + var newLoc = new Array(loc.length); + for (var i_2 = 0; i_2 < newLoc.length; i_2++) { + newLoc[i_2] = loc[perm[i_2]]; + } + var newIndex = result.locToIndex(newLoc); + result.values[newIndex] = values[i]; + } + return result.toTensor(); + }; + MathBackendCPU.prototype.gather = function (x, indices, axis) { + var newShape = x.shape.slice(); + var indicesValues = indices.dataSync(); + newShape[axis] = indicesValues.length; + var result = ops_1.buffer(newShape, x.dtype); + var xBuf = x.buffer(); + for (var i = 0; i < result.size; ++i) { + var newLoc = result.indexToLoc(i); + var originalLoc = newLoc.slice(); + originalLoc[axis] = indicesValues[newLoc[axis]]; + var originalIndex = xBuf.locToIndex(originalLoc); + result.values[i] = xBuf.values[originalIndex]; + } + return result.toTensor(); + }; + MathBackendCPU.prototype.batchToSpaceND = function (x, blockShape, crops) { + var prod = blockShape.reduce(function (a, b) { return a * b; }); + var reshaped = array_ops_util.getReshaped(x.shape, blockShape, prod); + var permuted = array_ops_util.getPermuted(reshaped.length, blockShape.length); + var reshapedPermuted = array_ops_util.getReshapedPermuted(x.shape, blockShape, prod); + var sliceBeginCoords = array_ops_util.getSliceBeginCoords(crops, blockShape.length); + var sliceSize = array_ops_util.getSliceSize(reshapedPermuted, crops, blockShape.length); + return x.reshape(reshaped) + .transpose(permuted) + .reshape(reshapedPermuted) + .slice(sliceBeginCoords, sliceSize); + }; + MathBackendCPU.prototype.spaceToBatchND = function (x, blockShape, paddings) { + var prod = blockShape.reduce(function (a, b) { return a * b; }); + var completePaddings = [[0, 0]]; + completePaddings.push.apply(completePaddings, paddings); + for (var i = 1 + blockShape.length; i < x.shape.length; ++i) { + completePaddings.push([0, 0]); + } + var paddedX = x.pad(completePaddings); + var reshapedPaddedShape = array_ops_util.getReshaped(paddedX.shape, blockShape, prod, false); + var permutedReshapedPaddedPermutation = array_ops_util.getPermuted(reshapedPaddedShape.length, blockShape.length, false); + var flattenShape = array_ops_util.getReshapedPermuted(paddedX.shape, blockShape, prod, false); + return paddedX.reshape(reshapedPaddedShape) + .transpose(permutedReshapedPaddedPermutation) + .reshape(flattenShape); + }; + MathBackendCPU.prototype.pool = function (x, convInfo, poolType) { + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var y = ops.buffer(convInfo.outShape, 'float32'); + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d = 0; d < convInfo.inChannels; ++d) { + for (var yR = 0; yR < convInfo.outHeight; ++yR) { + var xRCorner = yR * strideHeight - padTop; + var xRMin = Math.max(0, xRCorner); + var xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner); + for (var yC = 0; yC < convInfo.outWidth; ++yC) { + var xCCorner = yC * strideWidth - padLeft; + var xCMin = Math.max(0, xCCorner); + var xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner); + var minMaxValue = (poolType === 'max' ? Number.NEGATIVE_INFINITY : + Number.POSITIVE_INFINITY); + var avgValue = 0; + var count = 0; + for (var xR = xRMin; xR < xRMax; ++xR) { + for (var xC = xCMin; xC < xCMax; ++xC) { + var pixel = x.get(b, xR, xC, d); + if ((poolType === 'max' && pixel > minMaxValue)) { + minMaxValue = pixel; + } + else if (poolType === 'avg') { + avgValue += pixel; + count++; + } + } + if (isNaN(minMaxValue)) { + break; + } + } + y.set(poolType === 'avg' ? avgValue / count : minMaxValue, b, yR, yC, d); + } + } + } + } + return y.toTensor(); + }; + MathBackendCPU.prototype.maxPool = function (x, convInfo) { + return this.pool(x, convInfo, 'max'); + }; + MathBackendCPU.prototype.maxPoolPositions = function (x, convInfo) { + var maxPositions = ops.buffer(convInfo.outShape, 'int32'); + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d = 0; d < convInfo.inChannels; ++d) { + for (var yR = 0; yR < convInfo.outHeight; ++yR) { + var xRCorner = yR * strideHeight - padTop; + var xRMin = Math.max(0, xRCorner); + var xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner); + for (var yC = 0; yC < convInfo.outWidth; ++yC) { + var xCCorner = yC * strideWidth - padLeft; + var xCMin = Math.max(0, xCCorner); + var xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner); + var maxValue = Number.NEGATIVE_INFINITY; + var maxPosition = -1; + for (var xR = xRMin; xR < xRMax; ++xR) { + var wR = xR - xRCorner; + for (var xC = xCMin; xC < xCMax; ++xC) { + var wC = xC - xCCorner; + var pixel = x.get(b, xR, xC, d); + if (pixel > maxValue) { + maxValue = pixel; + maxPosition = wR * filterWidth + wC; + } + } + } + maxPositions.set(maxPosition, b, yR, yC, d); + } + } + } + } + return maxPositions.toTensor(); + }; + MathBackendCPU.prototype.maxPoolBackprop = function (dy, x, y, convInfo) { + var maxPositions = this.maxPoolPositions(x, convInfo); + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var dx = ops.buffer(x.shape, 'float32'); + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d = 0; d < convInfo.inChannels; ++d) { + for (var dxR = 0; dxR < convInfo.inHeight; ++dxR) { + for (var dxC = 0; dxC < convInfo.inWidth; ++dxC) { + var dyRCorner = dxR - padTop; + var dyCCorner = dxC - padLeft; + var dotProd = 0; + for (var wR = 0; wR < filterHeight; ++wR) { + var dyR = (dyRCorner + wR) / strideHeight; + if (dyR < 0 || dyR >= convInfo.outHeight || + Math.floor(dyR) !== dyR) { + continue; + } + for (var wC = 0; wC < filterWidth; ++wC) { + var dyC = (dyCCorner + wC) / strideWidth; + if (dyC < 0 || dyC >= convInfo.outWidth || + Math.floor(dyC) !== dyC) { + continue; + } + var maxPos = filterHeight * filterWidth - 1 - + maxPositions.get(b, dyR, dyC, d); + var curPos = wR * filterWidth + wC; + var mask = maxPos === curPos ? 1 : 0; + if (mask === 0) { + continue; + } + var pixel = dy.get(b, dyR, dyC, d); + dotProd += pixel * mask; + } + } + dx.set(dotProd, b, dxR, dxC, d); + } + } + } + } + return dx.toTensor(); + }; + MathBackendCPU.prototype.avgPoolBackprop = function (dy, x, convInfo) { + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var dx = ops.buffer(x.shape, 'float32'); + var avgMultiplier = 1 / (filterHeight * filterWidth); + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d = 0; d < convInfo.inChannels; ++d) { + for (var dxR = 0; dxR < convInfo.inHeight; ++dxR) { + for (var dxC = 0; dxC < convInfo.inWidth; ++dxC) { + var dyRCorner = dxR - padTop; + var dyCCorner = dxC - padLeft; + var dotProd = 0; + for (var wR = 0; wR < filterHeight; ++wR) { + var dyR = (dyRCorner + wR) / strideHeight; + if (dyR < 0 || dyR >= convInfo.outHeight || + Math.floor(dyR) !== dyR) { + continue; + } + for (var wC = 0; wC < filterWidth; ++wC) { + var dyC = (dyCCorner + wC) / strideWidth; + if (dyC < 0 || dyC >= convInfo.outWidth || + Math.floor(dyC) !== dyC) { + continue; + } + var pixel = dy.get(b, dyR, dyC, d); + dotProd += pixel; + } + } + dx.set(dotProd * avgMultiplier, b, dxR, dxC, d); + } + } + } + } + return dx.toTensor(); + }; + MathBackendCPU.prototype.cast = function (x, dtype) { + return backend_util.castTensor(x, dtype, this); + }; + MathBackendCPU.prototype.reshape = function (x, shape) { + return backend_util.reshapeTensor(x, shape); + }; + MathBackendCPU.prototype.avgPool = function (x, convInfo) { + return this.pool(x, convInfo, 'avg').toFloat(); + }; + MathBackendCPU.prototype.resizeBilinear = function (x, newHeight, newWidth, alignCorners) { + var _a = x.shape, batch = _a[0], oldHeight = _a[1], oldWidth = _a[2], numChannels = _a[3]; + var output = ops.buffer([batch, newHeight, newWidth, numChannels], x.dtype); + var effectiveInputSize = [ + (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight, + (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth + ]; + var effectiveOutputSize = [ + (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight, + (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth + ]; + for (var b = 0; b < batch; b++) { + for (var r = 0; r < newHeight; r++) { + for (var c = 0; c < newWidth; c++) { + for (var d = 0; d < numChannels; d++) { + var sourceFracRow = (effectiveInputSize[0]) * r / (effectiveOutputSize[0]); + var sourceFracCol = (effectiveInputSize[1]) * c / (effectiveOutputSize[1]); + var sourceRowFloor = Math.floor(sourceFracRow); + var sourceRowCeil = Math.min(oldHeight - 1, Math.ceil(sourceFracRow)); + var sourceColFloor = Math.floor(sourceFracCol); + var sourceColCeil = Math.min(oldWidth - 1, Math.ceil(sourceFracCol)); + var topLeft = x.get(b, sourceRowFloor, sourceColFloor, d); + var bottomLeft = x.get(b, sourceRowCeil, sourceColFloor, d); + var topRight = x.get(b, sourceRowFloor, sourceColCeil, d); + var bottomRight = x.get(b, sourceRowCeil, sourceColCeil, d); + var rowFrac = sourceFracRow - sourceRowFloor; + var colFrac = sourceFracCol - sourceColFloor; + var top_1 = topLeft + (topRight - topLeft) * colFrac; + var bottom = bottomLeft + (bottomRight - bottomLeft) * colFrac; + var newValue = top_1 + (bottom - top_1) * rowFrac; + output.set(newValue, b, r, c, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.resizeBilinearBackprop = function (dy, x, alignCorners) { + var _a = x.shape, batch = _a[0], xHeight = _a[1], xWidth = _a[2], depth = _a[3]; + var _b = dy.shape, yHeight = _b[1], yWidth = _b[2]; + var output = ops.buffer([batch, xHeight, xWidth, depth], x.dtype); + var effectiveXSize = [ + (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight, + (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth + ]; + var effectiveYSize = [ + (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight, + (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth + ]; + var heightScale = effectiveXSize[0] / effectiveYSize[0]; + var widthScale = effectiveXSize[1] / effectiveYSize[1]; + for (var b = 0; b < batch; b++) { + for (var r = 0; r < yHeight; r++) { + var dxR = r * heightScale; + var topDxRIndex = Math.floor(dxR); + var bottomDxRIndex = Math.min(Math.ceil(dxR), xHeight - 1); + var dxRLerp = dxR - topDxRIndex; + var inverseDxRLerp = 1.0 - dxRLerp; + for (var c = 0; c < yWidth; c++) { + var dxC = c * widthScale; + var leftDxCIndex = Math.floor(dxC); + var rightDxCIndex = Math.min(Math.ceil(dxC), xWidth - 1); + var dxCLerp = dxC - leftDxCIndex; + var inverseDxCLerp = 1.0 - dxCLerp; + for (var d = 0; d < depth; d++) { + var dyVal = dy.get(b, r, c, d); + var topLeft = output.get(b, topDxRIndex, leftDxCIndex, d); + topLeft += dyVal * inverseDxRLerp * inverseDxCLerp; + output.set(topLeft, b, topDxRIndex, leftDxCIndex, d); + var topRight = output.get(b, topDxRIndex, rightDxCIndex, d); + topRight += dyVal * inverseDxRLerp * dxCLerp; + output.set(topRight, b, topDxRIndex, rightDxCIndex, d); + var bottomLeft = output.get(b, bottomDxRIndex, leftDxCIndex, d); + bottomLeft += dyVal * dxRLerp * inverseDxCLerp; + output.set(bottomLeft, b, bottomDxRIndex, leftDxCIndex, d); + var bottomRight = output.get(b, bottomDxRIndex, rightDxCIndex, d); + bottomRight += dyVal * dxRLerp * dxCLerp; + output.set(bottomRight, b, bottomDxRIndex, rightDxCIndex, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.resizeNearestNeighbor = function (x, newHeight, newWidth, alignCorners) { + var _a = x.shape, batch = _a[0], oldHeight = _a[1], oldWidth = _a[2], numChannels = _a[3]; + var output = ops.buffer([batch, newHeight, newWidth, numChannels], x.dtype); + var effectiveInputSize = [ + (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight, + (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth + ]; + var effectiveOutputSize = [ + (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight, + (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth + ]; + for (var b = 0; b < batch; b++) { + for (var r = 0; r < newHeight; r++) { + for (var c = 0; c < newWidth; c++) { + for (var d = 0; d < numChannels; d++) { + var sourceFracRow = (effectiveInputSize[0]) * r / (effectiveOutputSize[0]); + var sourceFracCol = (effectiveInputSize[1]) * c / (effectiveOutputSize[1]); + var sourceNearestRow = Math.min(oldHeight - 1, alignCorners ? Math.round(sourceFracRow) : + Math.floor(sourceFracRow)); + var sourceNearestCol = Math.min(oldWidth - 1, alignCorners ? Math.round(sourceFracCol) : + Math.floor(sourceFracCol)); + var newValue = x.get(b, sourceNearestRow, sourceNearestCol, d); + output.set(newValue, b, r, c, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.resizeNearestNeighborBackprop = function (dy, x, alignCorners) { + var _a = x.shape, batch = _a[0], xHeight = _a[1], xWidth = _a[2], depth = _a[3]; + var _b = dy.shape, yHeight = _b[1], yWidth = _b[2]; + var output = ops.buffer([batch, xHeight, xWidth, depth], x.dtype); + var effectiveXSize = [ + (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight, + (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth + ]; + var effectiveYSize = [ + (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight, + (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth + ]; + var heightScale = effectiveXSize[0] / effectiveYSize[0]; + var widthScale = effectiveXSize[1] / effectiveYSize[1]; + var invHeightScale = 1 / heightScale; + var invWidthScale = 1 / widthScale; + var winHeight = (Math.ceil(invHeightScale) * 2) + 2; + var winWidth = (Math.ceil(invWidthScale) * 2) + 2; + for (var b = 0; b < batch; b++) { + for (var r = 0; r < xHeight; r++) { + for (var c = 0; c < xWidth; c++) { + var startRLerp = Math.floor(r * invHeightScale); + var startDyR = Math.floor(startRLerp - (winHeight / 2)); + var startCLerp = Math.floor(c * invWidthScale); + var startDyC = Math.floor(startCLerp - (winWidth / 2)); + for (var d = 0; d < depth; d++) { + var accum = 0; + for (var dyROffset = 0; dyROffset < winHeight; dyROffset++) { + var dyR = dyROffset + startDyR; + if (dyR < 0 || dyR >= yHeight) { + continue; + } + for (var dyCOffSet = 0; dyCOffSet < winWidth; dyCOffSet++) { + var dyC = dyCOffSet + startDyC; + if (dyC < 0 || dyC >= yWidth) { + continue; + } + var sourceFracRow = effectiveXSize[0] * (dyR / effectiveYSize[0]); + var sourceFracCol = effectiveXSize[1] * (dyC / effectiveYSize[1]); + var sourceNearestRow = Math.min(xHeight - 1, alignCorners ? Math.round(sourceFracRow) : + Math.floor(sourceFracRow)); + var sourceNearestCol = Math.min(xWidth - 1, alignCorners ? Math.round(sourceFracCol) : + Math.floor(sourceFracCol)); + if (r === sourceNearestRow && c === sourceNearestCol) { + accum += dy.get(b, dyR, dyC, d); + } + } + } + output.set(accum, b, r, c, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.batchNormalization = function (x, mean, variance, varianceEpsilon, scale, offset) { + var xValues = x.dataSync(); + var meanValues = mean.dataSync(); + var varianceValues = variance.dataSync(); + var scaleValues = scale ? scale.dataSync() : new Float32Array([1]); + var offsetValues = offset ? offset.dataSync() : new Float32Array([0]); + var outValues = new Float32Array(xValues.length); + for (var i = 0; i < xValues.length; i++) { + outValues[i] = offsetValues[i % offsetValues.length] + + (xValues[i] - meanValues[i % meanValues.length]) * + scaleValues[i % scaleValues.length] / + Math.sqrt(varianceValues[i % varianceValues.length] + varianceEpsilon); + } + return ops_1.tensor4d(outValues, x.shape); + }; + MathBackendCPU.prototype.localResponseNormalization4D = function (x, radius, bias, alpha, beta) { + var output = ops.buffer(x.shape, 'float32'); + var rad = radius; + var maxD = output.shape[3] - 1; + function sumAcrossChannels(b, r, c, d) { + var sum = 0.0; + for (var j = Math.max(0, d - rad); j <= Math.min(d + rad, maxD); j++) { + var z = x.get(b, r, c, j); + sum += z * z; + } + return sum; + } + for (var b = 0; b < output.shape[0]; b++) { + for (var r = 0; r <= output.shape[1]; r++) { + for (var c = 0; c < output.shape[2]; c++) { + for (var d = 0; d < output.shape[3]; d++) { + var sum = sumAcrossChannels(b, r, c, d); + var val = x.get(b, r, c, d) * Math.pow(bias + alpha * sum, -beta); + output.set(val, b, r, c, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.LRNGrad = function (dy, inputImage, outputImage, depthRadius, bias, alpha, beta) { + var batch = dy.shape[0]; + var rows = dy.shape[1]; + var cols = dy.shape[2]; + var depth = dy.shape[3]; + var output = ops.buffer([batch, rows, cols, depth], 'float32'); + for (var b = 0; b < batch; ++b) { + for (var r = 0; r < rows; ++r) { + for (var c = 0; c < cols; ++c) { + for (var d = 0; d < depth; ++d) { + var depthBegin = Math.max(0, d - depthRadius); + var depthEnd = Math.min(depth, d + depthRadius + 1); + var norm = 0; + for (var k = depthBegin; k < depthEnd; ++k) { + norm += inputImage.get(b, r, c, k) * inputImage.get(b, r, c, k); + } + norm = alpha * norm + bias; + for (var k = depthBegin; k < depthEnd; ++k) { + var dyi = -2 * alpha * beta * inputImage.get(b, r, c, k) * + outputImage.get(b, r, c, d) / norm; + if (d === k) { + dyi += Math.pow(norm, -beta); + } + dyi *= dy.get(b, r, c, d); + output.set(dyi + output.get(b, r, c, k), b, r, c, k); + } + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.multinomial = function (logits, normalized, numSamples, seed) { + var probabilities = normalized ? logits : ops.softmax(logits); + var batchSize = probabilities.shape[0]; + var numEvents = probabilities.shape[1]; + var res = ops.zeros([batchSize, numSamples], 'int32'); + var resVals = res.dataSync(); + var probVals = probabilities.dataSync(); + for (var b = 0; b < batchSize; ++b) { + var offset = b * numEvents; + var cdf = new Float32Array(numEvents - 1); + cdf[0] = probVals[offset]; + for (var event_1 = 1; event_1 < cdf.length; ++event_1) { + cdf[event_1] = cdf[event_1 - 1] + probVals[offset + event_1]; + } + var random = seedrandom.alea(seed.toString()); + var outOffset = b * numSamples; + for (var sampleId = 0; sampleId < numSamples; ++sampleId) { + var r = random(); + resVals[outOffset + sampleId] = cdf.length; + for (var event_2 = 0; event_2 < cdf.length; event_2++) { + if (r < cdf[event_2]) { + resVals[outOffset + sampleId] = event_2; + break; + } + } + } + } + return res; + }; + MathBackendCPU.prototype.oneHot = function (indices, depth, onValue, offValue) { + var res = new Float32Array(indices.size * depth); + res.fill(offValue); + for (var event_3 = 0; event_3 < indices.size; ++event_3) { + if (indices.get(event_3) >= 0 && indices.get(event_3) < depth) { + res[event_3 * depth + indices.get(event_3)] = onValue; + } + } + return ops.tensor2d(res, [indices.size, depth], 'int32'); + }; + MathBackendCPU.prototype.nonMaxSuppression = function (boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + var boxesVals = boxes.dataSync(); + var scoresVals = scores.dataSync(); + return non_max_suppression_impl_1.nonMaxSuppressionImpl(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold); + }; + MathBackendCPU.prototype.broadcastedBinaryOp = function (a, b, dtype, op) { + var newShape = broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape); + var result = ops.buffer(newShape, dtype); + var aValues = a.dataSync(); + var bValues = b.dataSync(); + var aBroadcastDims = broadcast_util.getBroadcastDims(a.shape, newShape); + var bBroadcastDims = broadcast_util.getBroadcastDims(b.shape, newShape); + var aBuf = a.buffer(); + var bBuf = b.buffer(); + var _loop_2 = function (i) { + var loc = result.indexToLoc(i); + var aLoc = loc.slice(-a.rank); + aBroadcastDims.forEach(function (d) { return aLoc[d] = 0; }); + var aIndex = aBuf.locToIndex(aLoc); + var bLoc = loc.slice(-b.rank); + bBroadcastDims.forEach(function (d) { return bLoc[d] = 0; }); + var bIndex = bBuf.locToIndex(bLoc); + result.values[i] = op(aValues[aIndex], bValues[bIndex]); + }; + for (var i = 0; i < result.values.length; ++i) { + _loop_2(i); + } + return result.toTensor(); + }; + MathBackendCPU.prototype.dispose = function () { }; + return MathBackendCPU; +}()); +exports.MathBackendCPU = MathBackendCPU; +environment_1.ENV.registerBackend('cpu', function () { return new MathBackendCPU(); }, 1, tensor_1.setTensorTracker); +//# sourceMappingURL=backend_cpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_cpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_cpu.js.map new file mode 100644 index 0000000..b6dda67 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_cpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"backend_cpu.js","sourceRoot":"","sources":["../../src/kernels/backend_cpu.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,uCAAyC;AACzC,8CAAmC;AACnC,8BAA4B;AAC5B,sDAAwD;AACxD,4CAA8C;AAC9C,sDAAwD;AACxD,gDAAkD;AAElD,0CAA4C;AAC5C,gCAAkC;AAClC,kCAAsD;AACtD,4CAA8C;AAC9C,gDAAuD;AACvD,oCAAmG;AACnG,kCAAuF;AACvF,8BAAgC;AAChC,gCAA4B;AAE5B,6CAA+C;AAC/C,uEAAiE;AACjE,yCAAqC;AACrC,2CAAuC;AAEvC;IAKE;QAJQ,SAAI,GAAG,IAAI,OAAO,EAAiC,CAAC;QAEpD,aAAQ,GAAG,IAAI,CAAC;QAGtB,IAAI,iBAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YACzB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;SAChD;IACH,CAAC;IAED,iCAAQ,GAAR,UAAS,MAAc,EAAE,KAAe,EAAE,KAAe;QACvD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,IAAI,iBAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;gBACtB,UAAI,CACA,kCAAkC;oBAClC,2DAA2D;oBAC3D,6DAA6D;oBAC7D,qDAAqD;oBACrD,+BAA+B;oBAC/B,uDAAuD;oBACvD,sDAAsD;o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,CAAC,IAAI,OAAA,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAX,CAAW,CAAC,CAAC;YACzC,IAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAErC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QAC1D,CAAC;QAZD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;oBAApC,CAAC;SAYT;QACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IACD,gCAAO,GAAP,cAAW,CAAC;IACd,qBAAC;AAAD,CAAC,AAvkED,IAukEC;AAvkEY,wCAAc;AAykE3B,iBAAG,CAAC,eAAe,CACf,KAAK,EAAE,cAAM,OAAA,IAAI,cAAc,EAAE,EAApB,CAAoB,EAAE,CAAC,EAAiB,yBAAgB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_util.d.ts new file mode 100644 index 0000000..4149084 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_util.d.ts @@ -0,0 +1,6 @@ +import { Tensor } from '../tensor'; +import { Rank } from '../types'; +import { DataType, ShapeMap } from '../types'; +import { KernelBackend } from './backend'; +export declare function castTensor(x: T, dtype: DataType, backend: KernelBackend): T; +export declare function reshapeTensor(x: T, shape: ShapeMap[R]): Tensor; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_util.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_util.js new file mode 100644 index 0000000..f0990fe --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_util.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tensor_ops_1 = require("../ops/tensor_ops"); +var tensor_1 = require("../tensor"); +var util_1 = require("../util"); +function castTensor(x, dtype, backend) { + if (!util_1.hasEncodingLoss(x.dtype, dtype)) { + return tensor_1.Tensor.make(x.shape, { dataId: x.dataId }, dtype); + } + if (dtype === 'int32') { + return backend.int(x); + } + else if (dtype === 'bool') { + return backend.notEqual(x, tensor_ops_1.scalar(0, x.dtype)); + } + else { + throw new Error("Error in Cast: unknown dtype argument (" + dtype + ")"); + } +} +exports.castTensor = castTensor; +function reshapeTensor(x, shape) { + return tensor_1.Tensor.make(shape, { dataId: x.dataId }, x.dtype); +} +exports.reshapeTensor = reshapeTensor; +//# sourceMappingURL=backend_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_util.js.map new file mode 100644 index 0000000..dbb10a8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"backend_util.js","sourceRoot":"","sources":["../../src/kernels/backend_util.ts"],"names":[],"mappings":";;AAiBA,gDAAyC;AACzC,oCAAiC;AAGjC,gCAAwC;AAGxC,oBACI,CAAI,EAAE,KAAe,EAAE,OAAsB;IAC/C,IAAI,CAAC,sBAAe,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;QAGpC,OAAO,eAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,EAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAC,EAAE,KAAK,CAAM,CAAC;KAC7D;IACD,IAAI,KAAK,KAAK,OAAO,EAAE;QACrB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KACvB;SAAM,IAAI,KAAK,KAAK,MAAM,EAAE;QAC3B,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,mBAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAM,CAAC;KACrD;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,4CAA0C,KAAK,MAAG,CAAC,CAAC;KACrE;AACH,CAAC;AAdD,gCAcC;AAED,uBACI,CAAI,EAAE,KAAkB;IAC1B,OAAO,eAAM,CAAC,IAAI,CAAC,KAAK,EAAE,EAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAHD,sCAGC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.d.ts new file mode 100644 index 0000000..1c4f47e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.d.ts @@ -0,0 +1,172 @@ +import { MemoryInfo, TimingInfo } from '../engine'; +import { Conv2DInfo } from '../ops/conv_util'; +import { DataId, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D } from '../tensor'; +import { DataType, Rank, ShapeMap, TypedArray } from '../types'; +import { KernelBackend } from './backend'; +import { GPGPUContext } from './webgl/gpgpu_context'; +import { TextureManager } from './webgl/texture_manager'; +export interface CPUTimerQuery { + startMs: number; + endMs?: number; +} +export interface WebGLMemoryInfo extends MemoryInfo { + numBytesInGPU: number; + unreliable: boolean; +} +export interface WebGLTimingInfo extends TimingInfo { + uploadWaitMs: number; + downloadWaitMs: number; +} +export declare const SIZE_UPLOAD_UNIFORM = 32; +export declare class MathBackendWebGL implements KernelBackend { + private gpgpu?; + private delayedStorage; + private texData; + private pendingRead; + private pendingDisposal; + private lruDataGPU; + private numBytesInGPU; + private NUM_BYTES_BEFORE_PAGING; + private canvas; + private fromPixelsCanvas; + private programTimersStack; + private activeTimers; + private uploadWaitMs; + private downloadWaitMs; + register(dataId: DataId, shape: number[], dtype: DataType): void; + fromPixels(pixels: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, numChannels: number): Tensor3D; + write(dataId: DataId, values: TypedArray): void; + readSync(dataId: DataId): TypedArray; + read(dataId: DataId): Promise; + private getValuesFromTexture; + time(f: () => void): Promise; + memory(): WebGLMemoryInfo; + private startTimer; + private endTimer; + private getQueryTime; + disposeData(dataId: DataId): void; + getTexture(dataId: DataId): WebGLTexture; + private textureManager; + private binaryCache; + private gpgpuCreatedLocally; + constructor(gpgpu?: GPGPUContext, delayedStorage?: boolean); + getGPGPUContext(): GPGPUContext; + getCanvas(): HTMLCanvasElement; + slice(x: T, begin: number[], size: number[]): T; + stridedSlice(x: T, begin: number[], end: number[], strides: number[], beginMask: number, endMask: number): T; + reverse(x: T, axis: number[]): T; + concat(a: Tensor2D, b: Tensor2D): Tensor2D; + neg(x: T): T; + matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean): Tensor2D; + multiply(a: Tensor, b: Tensor): Tensor; + batchNormalization(x: Tensor4D, mean: Tensor4D | Tensor1D, variance: Tensor4D | Tensor1D, varianceEpsilon: number, scale?: Tensor4D | Tensor1D, offset?: Tensor4D | Tensor1D): Tensor4D; + localResponseNormalization4D(x: Tensor4D, radius: number, bias: number, alpha: number, beta: number): Tensor4D; + LRNGrad(dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D, depthRadius: number, bias: number, alpha: number, beta: number): Tensor4D; + tile(x: T, reps: number[]): T; + pad(x: T, paddings: Array<[number, number]>, constantValue: number): T; + transpose(x: T, perm: number[]): T; + gather(x: T, indices: Tensor1D, axis: number): T; + batchToSpaceND(x: T, blockShape: number[], crops: number[][]): T; + spaceToBatchND(x: T, blockShape: number[], paddings: Array<[number, number]>): T; + private reduce; + private argReduce; + sum(x: Tensor, axes: number[]): Tensor; + unsortedSegmentSum(x: T, segmentIds: Tensor1D, numSegments: number): Tensor; + private segOpCompute; + argMin(x: Tensor, axis: number): Tensor; + argMax(x: Tensor, axis: number): Tensor; + cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean): Tensor; + equal(a: Tensor, b: Tensor): Tensor; + notEqual(a: Tensor, b: Tensor): Tensor; + less(a: Tensor, b: Tensor): Tensor; + lessEqual(a: Tensor, b: Tensor): Tensor; + greater(a: Tensor, b: Tensor): Tensor; + greaterEqual(a: Tensor, b: Tensor): Tensor; + logicalNot(x: T): T; + logicalAnd(a: Tensor, b: Tensor): Tensor; + logicalOr(a: Tensor, b: Tensor): Tensor; + select(condition: Tensor, a: Tensor, b: Tensor): Tensor; + where(condition: Tensor): Tensor2D; + topk(x: T, k: number, sorted: boolean): [T, T]; + min(x: Tensor, axes: number[]): Tensor; + minimum(a: Tensor, b: Tensor): Tensor; + mod(a: Tensor, b: Tensor): Tensor; + max(x: Tensor, axes: number[]): Tensor; + maximum(a: Tensor, b: Tensor): Tensor; + all(x: Tensor, axes: number[]): Tensor; + any(x: Tensor, axes: number[]): Tensor; + squaredDifference(a: Tensor, b: Tensor): Tensor; + realDivide(a: Tensor, b: Tensor): Tensor; + floorDiv(a: Tensor, b: Tensor): Tensor; + add(a: Tensor, b: Tensor): Tensor; + addN(tensors: T[]): T; + subtract(a: Tensor, b: Tensor): Tensor; + pow(a: T, b: Tensor): T; + ceil(x: T): T; + floor(x: T): T; + sign(x: T): T; + round(x: T): T; + exp(x: T): T; + expm1(x: T): T; + log(x: T): T; + log1p(x: T): T; + sqrt(x: T): T; + rsqrt(x: T): T; + square(x: T): T; + reciprocal(x: T): T; + relu(x: T): T; + elu(x: T): T; + eluDer(dy: T, y: T): T; + selu(x: T): T; + int(x: T): T; + clip(x: T, min: number, max: number): T; + abs(x: T): T; + sigmoid(x: T): T; + softplus(x: T): T; + sin(x: T): T; + cos(x: T): T; + tan(x: T): T; + asin(x: T): T; + acos(x: T): T; + atan(x: T): T; + atan2(a: T, b: T): T; + sinh(x: T): T; + cosh(x: T): T; + tanh(x: T): T; + asinh(x: T): T; + acosh(x: T): T; + atanh(x: T): T; + erf(x: T): T; + step(x: T, alpha: number): T; + conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + conv2dDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + depthwiseConv2D(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + depthwiseConv2DDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D; + cast(x: T, dtype: DataType): T; + reshape(x: Tensor, shape: ShapeMap[R]): Tensor; + resizeBilinear(x: Tensor4D, newHeight: number, newWidth: number, alignCorners: boolean): Tensor4D; + resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor4D; + resizeNearestNeighbor(x: Tensor4D, newHeight: number, newWidth: number, alignCorners: boolean): Tensor4D; + resizeNearestNeighborBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor4D; + multinomial(logits: Tensor2D, normalized: boolean, numSamples: number, seed: number): Tensor2D; + oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number): Tensor2D; + nonMaxSuppression(boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number, iouThreshold: number, scoreThreshold: number): Tensor1D; + private makeOutputArray; + private compileAndRun; + private getAndSaveBinary; + getTextureManager(): TextureManager; + private disposed; + dispose(): void; + private throwIfNoData; + private uploadToGPU; + private cacheOnCPU; + private releaseTexture; + private acquireTexture; + private computeBytes; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js new file mode 100644 index 0000000..29754e2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js @@ -0,0 +1,1132 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var log_1 = require("../log"); +var array_ops_util = require("../ops/array_ops_util"); +var axis_util = require("../ops/axis_util"); +var reduce_util = require("../ops/reduce_util"); +var segment_util = require("../ops/segment_util"); +var slice_util_1 = require("../ops/slice_util"); +var softmax_1 = require("../ops/softmax"); +var tensor_ops_1 = require("../ops/tensor_ops"); +var tensor_1 = require("../tensor"); +var types_1 = require("../types"); +var util = require("../util"); +var backend_util = require("./backend_util"); +var non_max_suppression_impl_1 = require("./non_max_suppression_impl"); +var topk_impl_1 = require("./topk_impl"); +var argminmax_gpu_1 = require("./webgl/argminmax_gpu"); +var avg_pool_backprop_gpu_1 = require("./webgl/avg_pool_backprop_gpu"); +var batchnorm_gpu_1 = require("./webgl/batchnorm_gpu"); +var binaryop_gpu = require("./webgl/binaryop_gpu"); +var binaryop_gpu_1 = require("./webgl/binaryop_gpu"); +var clip_gpu_1 = require("./webgl/clip_gpu"); +var concat_gpu_1 = require("./webgl/concat_gpu"); +var conv_backprop_gpu_1 = require("./webgl/conv_backprop_gpu"); +var conv_backprop_gpu_depthwise_1 = require("./webgl/conv_backprop_gpu_depthwise"); +var conv_gpu_1 = require("./webgl/conv_gpu"); +var conv_gpu_depthwise_1 = require("./webgl/conv_gpu_depthwise"); +var cumsum_gpu_1 = require("./webgl/cumsum_gpu"); +var encode_float_gpu_1 = require("./webgl/encode_float_gpu"); +var from_pixels_gpu_1 = require("./webgl/from_pixels_gpu"); +var gather_gpu_1 = require("./webgl/gather_gpu"); +var gpgpu_context_1 = require("./webgl/gpgpu_context"); +var gpgpu_math = require("./webgl/gpgpu_math"); +var gpgpu_util = require("./webgl/gpgpu_util"); +var lrn_gpu_1 = require("./webgl/lrn_gpu"); +var lrn_grad_gpu_1 = require("./webgl/lrn_grad_gpu"); +var max_pool_backprop_gpu_1 = require("./webgl/max_pool_backprop_gpu"); +var mulmat_gpu_1 = require("./webgl/mulmat_gpu"); +var multinomial_gpu_1 = require("./webgl/multinomial_gpu"); +var onehot_gpu_1 = require("./webgl/onehot_gpu"); +var pad_gpu_1 = require("./webgl/pad_gpu"); +var pool_gpu_1 = require("./webgl/pool_gpu"); +var reduce_gpu_1 = require("./webgl/reduce_gpu"); +var resize_bilinear_backprop_gpu_1 = require("./webgl/resize_bilinear_backprop_gpu"); +var resize_bilinear_gpu_1 = require("./webgl/resize_bilinear_gpu"); +var resize_nearest_neighbor_backprop_gpu_1 = require("./webgl/resize_nearest_neighbor_backprop_gpu"); +var resize_nearest_neighbor_gpu_1 = require("./webgl/resize_nearest_neighbor_gpu"); +var reverse_gpu_1 = require("./webgl/reverse_gpu"); +var segment_gpu_1 = require("./webgl/segment_gpu"); +var select_gpu_1 = require("./webgl/select_gpu"); +var slice_gpu_1 = require("./webgl/slice_gpu"); +var strided_slice_gpu_1 = require("./webgl/strided_slice_gpu"); +var tex_util_1 = require("./webgl/tex_util"); +var texture_manager_1 = require("./webgl/texture_manager"); +var tile_gpu_1 = require("./webgl/tile_gpu"); +var transpose_gpu_1 = require("./webgl/transpose_gpu"); +var unary_op = require("./webgl/unaryop_gpu"); +var unaryop_gpu_1 = require("./webgl/unaryop_gpu"); +var webgl_util = require("./webgl/webgl_util"); +var where_impl_1 = require("./where_impl"); +var BEFORE_PAGING_CONSTANT = 300; +exports.SIZE_UPLOAD_UNIFORM = 32; +var MathBackendWebGL = (function () { + function MathBackendWebGL(gpgpu, delayedStorage) { + if (delayedStorage === void 0) { delayedStorage = true; } + this.gpgpu = gpgpu; + this.delayedStorage = delayedStorage; + this.texData = new WeakMap(); + this.pendingRead = new WeakMap(); + this.pendingDisposal = new WeakSet(); + this.lruDataGPU = []; + this.numBytesInGPU = 0; + this.uploadWaitMs = 0; + this.downloadWaitMs = 0; + this.binaryCache = {}; + this.disposed = false; + if (environment_1.ENV.get('WEBGL_VERSION') < 1) { + throw new Error('WebGL is not supported on this device'); + } + if (environment_1.ENV.get('IS_BROWSER')) { + this.canvas = document.createElement('canvas'); + } + if (gpgpu == null) { + this.gpgpu = new gpgpu_context_1.GPGPUContext(gpgpu_util.createWebGLContext(this.canvas)); + this.gpgpuCreatedLocally = true; + } + else { + this.gpgpuCreatedLocally = false; + } + this.NUM_BYTES_BEFORE_PAGING = + (window.screen.height * window.screen.width * window.devicePixelRatio) * + BEFORE_PAGING_CONSTANT; + this.textureManager = new texture_manager_1.TextureManager(this.gpgpu); + } + MathBackendWebGL.prototype.register = function (dataId, shape, dtype) { + if (this.texData.has(dataId)) { + throw new Error('Data buffer is already registered'); + } + this.texData.set(dataId, { + shape: shape, + dtype: dtype, + values: null, + texture: null, + texShape: null, + usage: tex_util_1.TextureUsage.RENDER + }); + }; + MathBackendWebGL.prototype.fromPixels = function (pixels, numChannels) { + if (pixels == null) { + throw new Error('pixels passed to tf.fromPixels() can not be null'); + } + var texShape = [pixels.height, pixels.width]; + var outShape = [pixels.height, pixels.width, numChannels]; + if (!(pixels instanceof HTMLVideoElement) && + !(pixels instanceof HTMLImageElement) && + !(pixels instanceof HTMLCanvasElement) && + !(pixels instanceof ImageData)) { + throw new Error('pixels passed to tf.fromPixels() must be either an ' + + "HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or " + + ("ImageData, but was " + pixels.constructor.name)); + } + if (pixels instanceof HTMLVideoElement) { + if (this.fromPixelsCanvas == null) { + if (!environment_1.ENV.get('IS_BROWSER')) { + throw new Error('Can\'t read pixels from HTMLImageElement outside the browser.'); + } + if (document.readyState !== 'complete') { + throw new Error('The DOM is not ready yet. Please call tf.fromPixels() ' + + 'once the DOM is ready. One way to do that is to add an event ' + + 'listener for `DOMContentLoaded` on the document object'); + } + this.fromPixelsCanvas = document.createElement('canvas'); + } + this.fromPixelsCanvas.width = pixels.width; + this.fromPixelsCanvas.height = pixels.height; + this.fromPixelsCanvas.getContext('2d').drawImage(pixels, 0, 0, pixels.width, pixels.height); + pixels = this.fromPixelsCanvas; + } + var tempPixelArray = tensor_1.Tensor.make(texShape, {}, 'int32'); + this.texData.get(tempPixelArray.dataId).usage = tex_util_1.TextureUsage.PIXELS; + this.gpgpu.uploadPixelDataToTexture(this.getTexture(tempPixelArray.dataId), pixels); + var program = new from_pixels_gpu_1.FromPixelsProgram(outShape); + var res = this.compileAndRun(program, [tempPixelArray]); + tempPixelArray.dispose(); + return res; + }; + MathBackendWebGL.prototype.write = function (dataId, values) { + if (values == null) { + throw new Error('MathBackendWebGL.write(): values can not be null'); + } + this.throwIfNoData(dataId); + var texData = this.texData.get(dataId); + var texture = texData.texture, texShape = texData.texShape, usage = texData.usage; + if (texture != null) { + this.releaseTexture(dataId, texture, texShape, usage); + texData.texture = null; + texData.texShape = null; + } + texData.usage = tex_util_1.TextureUsage.UPLOAD; + texData.values = values; + if (!this.delayedStorage) { + this.uploadToGPU(dataId); + } + }; + MathBackendWebGL.prototype.readSync = function (dataId) { + this.throwIfNoData(dataId); + var texData = this.texData.get(dataId); + var shape = texData.shape, texture = texData.texture, values = texData.values, texShape = texData.texShape, dtype = texData.dtype; + if (values != null) { + this.cacheOnCPU(dataId); + return values; + } + var shouldTimeProgram = this.activeTimers != null; + var start; + if (shouldTimeProgram) { + start = performance.now(); + } + var float32Values = this.getValuesFromTexture(texture, dataId, dtype, texShape, shape); + if (shouldTimeProgram) { + this.downloadWaitMs += performance.now() - start; + } + this.cacheOnCPU(dataId, float32Values); + return texData.values; + }; + MathBackendWebGL.prototype.read = function (dataId) { + return __awaiter(this, void 0, void 0, function () { + var subscribers_1, texData, shape, texture, values, texShape, dtype, bufferOrTexture, vals, subscribers; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (this.pendingRead.has(dataId)) { + subscribers_1 = this.pendingRead.get(dataId); + return [2, new Promise(function (resolve) { return subscribers_1.push(resolve); })]; + } + this.throwIfNoData(dataId); + texData = this.texData.get(dataId); + shape = texData.shape, texture = texData.texture, values = texData.values, texShape = texData.texShape, dtype = texData.dtype; + if (values != null) { + this.cacheOnCPU(dataId); + return [2, values]; + } + this.pendingRead.set(dataId, []); + if (!environment_1.ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED') && + environment_1.ENV.get('WEBGL_VERSION') === 2) { + throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and " + + "WEBGL_VERSION=2 not yet supported."); + } + bufferOrTexture = this.gpgpu.maybeCreateBufferFromTexture(texture, texShape[0], texShape[1]); + return [4, this.gpgpu.createAndWaitForFence()]; + case 1: + _a.sent(); + if (bufferOrTexture instanceof WebGLTexture) { + vals = this.getValuesFromTexture(texture, dataId, dtype, texShape, shape); + } + else { + vals = this.gpgpu.downloadFloat32MatrixFromBuffer(bufferOrTexture, texShape[0], texShape[1]); + } + this.cacheOnCPU(dataId, vals); + subscribers = this.pendingRead.get(dataId); + this.pendingRead.delete(dataId); + subscribers.forEach(function (resolve) { return resolve(vals); }); + if (this.pendingDisposal.has(dataId)) { + this.pendingDisposal.delete(dataId); + this.disposeData(dataId); + } + return [2, vals]; + } + }); + }); + }; + MathBackendWebGL.prototype.getValuesFromTexture = function (texture, dataId, dtype, texShape, shape) { + if (environment_1.ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED')) { + return this.gpgpu.downloadFloat32MatrixFromOutputTexture(texture, texShape[0], texShape[1]); + } + var tmpTarget = tensor_1.Tensor.make(shape, {}); + this.texData.get(tmpTarget.dataId).usage = tex_util_1.TextureUsage.DOWNLOAD; + var tmpInput = tensor_1.Tensor.make(shape, { dataId: dataId }, dtype); + var program = new encode_float_gpu_1.EncodeFloatProgram(shape); + var pageToCpu = false; + this.compileAndRun(program, [tmpInput], tmpTarget, null, pageToCpu); + var tmpData = this.texData.get(tmpTarget.dataId); + var vals = this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(tmpData.texture, tmpData.texShape[0], tmpData.texShape[1]); + tmpInput.dispose(); + tmpTarget.dispose(); + return vals; + }; + MathBackendWebGL.prototype.time = function (f) { + return __awaiter(this, void 0, void 0, function () { + var oldActiveTimers, newActiveTimers, outerMostTime, flattenedActiveTimers, kernelMs, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + oldActiveTimers = this.activeTimers; + newActiveTimers = []; + outerMostTime = false; + if (this.programTimersStack == null) { + this.programTimersStack = newActiveTimers; + outerMostTime = true; + } + else { + this.activeTimers.push(newActiveTimers); + } + this.activeTimers = newActiveTimers; + f(); + flattenedActiveTimers = util.flatten(this.activeTimers); + this.activeTimers = oldActiveTimers; + if (outerMostTime) { + this.programTimersStack = null; + } + return [4, Promise.all(flattenedActiveTimers).then(function (results) { + var sum = 0; + results.forEach(function (result) { return sum += result; }); + return sum; + })]; + case 1: + kernelMs = _a.sent(); + res = { + uploadWaitMs: this.uploadWaitMs, + downloadWaitMs: this.downloadWaitMs, + kernelMs: kernelMs, + wallMs: null + }; + this.uploadWaitMs = 0; + this.downloadWaitMs = 0; + return [2, res]; + } + }); + }); + }; + MathBackendWebGL.prototype.memory = function () { + return { unreliable: false, numBytesInGPU: this.numBytesInGPU }; + }; + MathBackendWebGL.prototype.startTimer = function () { + if (environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) { + return this.gpgpu.beginQuery(); + } + return { startMs: performance.now(), endMs: null }; + }; + MathBackendWebGL.prototype.endTimer = function (query) { + if (environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) { + this.gpgpu.endQuery(); + return query; + } + query.endMs = performance.now(); + return query; + }; + MathBackendWebGL.prototype.getQueryTime = function (query) { + return __awaiter(this, void 0, void 0, function () { + var timerQuery; + return __generator(this, function (_a) { + if (environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) { + return [2, this.gpgpu.waitForQueryAndGetTime(query)]; + } + timerQuery = query; + return [2, timerQuery.endMs - timerQuery.startMs]; + }); + }); + }; + MathBackendWebGL.prototype.disposeData = function (dataId) { + if (this.pendingDisposal.has(dataId)) { + return; + } + if (this.pendingRead.has(dataId)) { + this.pendingDisposal.add(dataId); + return; + } + if (this.texData.has(dataId)) { + var _a = this.texData.get(dataId), texture = _a.texture, texShape = _a.texShape, usage = _a.usage; + if (texture != null) { + this.releaseTexture(dataId, texture, texShape, usage); + } + this.texData.delete(dataId); + } + }; + MathBackendWebGL.prototype.getTexture = function (dataId) { + this.uploadToGPU(dataId); + return this.texData.get(dataId).texture; + }; + MathBackendWebGL.prototype.getGPGPUContext = function () { + return this.gpgpu; + }; + MathBackendWebGL.prototype.getCanvas = function () { + return this.canvas; + }; + MathBackendWebGL.prototype.slice = function (x, begin, size) { + var program = new slice_gpu_1.SliceProgram(size); + var customSetup = program.getCustomSetupFunc(begin); + return this.compileAndRun(program, [x], null, customSetup); + }; + MathBackendWebGL.prototype.stridedSlice = function (x, begin, end, strides, beginMask, endMask) { + var _a = slice_util_1.getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask), beginIndex = _a[0], size = _a[1]; + if (size.some(function (axis) { return axis === 0; })) { + return tensor_ops_1.tensor([], size); + } + var program = new strided_slice_gpu_1.StridedSliceProgram(beginIndex, strides, size); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.reverse = function (x, axis) { + var program = new reverse_gpu_1.ReverseProgram(x.shape, axis); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.concat = function (a, b) { + var program = new concat_gpu_1.ConcatProgram(a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.neg = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.NEG); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.matMul = function (a, b, transposeA, transposeB) { + var program = new mulmat_gpu_1.MatMulProgram(a.shape, b.shape, transposeA, transposeB); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.multiply = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.MUL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, types_1.upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.batchNormalization = function (x, mean, variance, varianceEpsilon, scale, offset) { + var inputs = [x, mean, variance]; + var offsetShape = null; + if (offset != null) { + offsetShape = offset.shape; + inputs.push(offset); + } + var scaleShape = null; + if (scale != null) { + scaleShape = scale.shape; + inputs.push(scale); + } + var program = new batchnorm_gpu_1.BatchNormProgram(x.shape, mean.shape, variance.shape, offsetShape, scaleShape, varianceEpsilon); + return this.compileAndRun(program, inputs); + }; + MathBackendWebGL.prototype.localResponseNormalization4D = function (x, radius, bias, alpha, beta) { + var program = new lrn_gpu_1.LRNProgram(x.shape, radius, bias, alpha, beta); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.LRNGrad = function (dy, inputImage, outputImage, depthRadius, bias, alpha, beta) { + var program = new lrn_grad_gpu_1.LRNGradProgram(inputImage.shape, depthRadius, bias, alpha, beta); + return this.compileAndRun(program, [inputImage, outputImage, dy]); + }; + MathBackendWebGL.prototype.tile = function (x, reps) { + var program = new tile_gpu_1.TileProgram(x.shape, reps); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.pad = function (x, paddings, constantValue) { + var program = new pad_gpu_1.PadProgram(x.shape, paddings, constantValue); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.transpose = function (x, perm) { + var program = new transpose_gpu_1.TransposeProgram(x.shape, perm); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.gather = function (x, indices, axis) { + var program = new gather_gpu_1.GatherProgram(x.shape, indices.size, axis); + return this.compileAndRun(program, [x, indices]); + }; + MathBackendWebGL.prototype.batchToSpaceND = function (x, blockShape, crops) { + util.assert(x.rank <= 4, 'batchToSpaceND for rank > 4 with a WebGL backend not implemented yet'); + var prod = blockShape.reduce(function (a, b) { return a * b; }); + var reshaped = array_ops_util.getReshaped(x.shape, blockShape, prod); + var permuted = array_ops_util.getPermuted(reshaped.length, blockShape.length); + var reshapedPermuted = array_ops_util.getReshapedPermuted(x.shape, blockShape, prod); + var sliceBeginCoords = array_ops_util.getSliceBeginCoords(crops, blockShape.length); + var sliceSize = array_ops_util.getSliceSize(reshapedPermuted, crops, blockShape.length); + return x.reshape(reshaped) + .transpose(permuted) + .reshape(reshapedPermuted) + .slice(sliceBeginCoords, sliceSize); + }; + MathBackendWebGL.prototype.spaceToBatchND = function (x, blockShape, paddings) { + util.assert(x.rank <= 4, 'spaceToBatchND for rank > 4 with a WebGL backend not implemented yet'); + var prod = blockShape.reduce(function (a, b) { return a * b; }); + var completePaddings = [[0, 0]]; + completePaddings.push.apply(completePaddings, paddings); + for (var i = 1 + blockShape.length; i < x.shape.length; ++i) { + completePaddings.push([0, 0]); + } + var paddedX = x.pad(completePaddings); + var reshapedPaddedShape = array_ops_util.getReshaped(paddedX.shape, blockShape, prod, false); + var permutedReshapedPaddedPermutation = array_ops_util.getPermuted(reshapedPaddedShape.length, blockShape.length, false); + var flattenShape = array_ops_util.getReshapedPermuted(paddedX.shape, blockShape, prod, false); + return paddedX.reshape(reshapedPaddedShape) + .transpose(permutedReshapedPaddedPermutation) + .reshape(flattenShape); + }; + MathBackendWebGL.prototype.reduce = function (x, reduceType, dtype) { + var batchSize = x.shape[0]; + var inSize = x.shape[1]; + var windowSize = reduce_util.computeOptimalWindowSize(inSize); + var reduceInfo = { windowSize: windowSize, inSize: inSize, batchSize: batchSize }; + var program = new reduce_gpu_1.ReduceProgram(reduceInfo, reduceType); + var _a = program.outputShape, rows = _a[0], cols = _a[1]; + var output = this.makeOutputArray([rows, cols], dtype); + this.compileAndRun(program, [x], output); + if (output.shape[1] === 1) { + return output; + } + return this.reduce(output, reduceType, dtype); + }; + MathBackendWebGL.prototype.argReduce = function (x, reduceType, bestIndicesA) { + if (bestIndicesA === void 0) { bestIndicesA = null; } + var batchSize = x.shape[0]; + var inSize = x.shape[1]; + if (bestIndicesA != null) { + batchSize = bestIndicesA.shape[0]; + inSize = bestIndicesA.shape[1]; + } + var windowSize = reduce_util.computeOptimalWindowSize(inSize); + var reduceInfo = { windowSize: windowSize, inSize: inSize, batchSize: batchSize }; + var program = new argminmax_gpu_1.ArgMinMaxProgram(reduceInfo, reduceType, bestIndicesA == null); + var _a = program.outputShape, rows = _a[0], cols = _a[1]; + var output = this.makeOutputArray([rows, cols], 'int32'); + var inputs = [x]; + if (bestIndicesA != null) { + inputs.push(bestIndicesA); + } + this.compileAndRun(program, inputs, output); + if (output.shape[1] === 1) { + return output; + } + return this.argReduce(x, reduceType, output); + }; + MathBackendWebGL.prototype.sum = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('sum', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = util.sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + var outputDType = types_1.sumOutType(x.dtype); + return this.reduce(a2D, 'sum', outputDType).reshape(outShape); + }; + MathBackendWebGL.prototype.unsortedSegmentSum = function (x, segmentIds, numSegments) { + var axis = 0; + var permutation = axis_util.getAxesPermutation([axis], x.rank); + var permutedX = x; + if (permutation != null) { + permutedX = x.transpose(permutation); + axis = axis_util.getInnerMostAxes(1, x.rank)[0]; + } + var outShape = segment_util.computeOutShape(permutedX.shape, axis, numSegments); + var inSize = util.sizeFromShape([permutedX.shape[axis]]); + var a2D = permutedX.as2D(-1, inSize); + var outputDType = types_1.sumOutType(x.dtype); + var result = this.segOpCompute(a2D, 'unsortedSegmentSum', segmentIds, outputDType, numSegments) + .reshape(outShape); + if (permutation != null) { + result = result.transpose(axis_util.getUndoAxesPermutation(permutation)); + } + return result; + }; + MathBackendWebGL.prototype.segOpCompute = function (x, segOpType, segmentIds, dtype, numSegments) { + var batchSize = x.shape[0]; + var inSize = x.shape[1]; + var windowSize = segment_util.segOpComputeOptimalWindowSize(inSize, numSegments); + var segOpInfo = { windowSize: windowSize, inSize: inSize, batchSize: batchSize, numSegments: numSegments }; + var program = new segment_gpu_1.SegmentOpProgram(segOpInfo, segOpType); + var _a = program.outputShape, rows = _a[0], cols = _a[1]; + var output = this.makeOutputArray([rows, cols], dtype); + this.compileAndRun(program, [x, segmentIds], output); + if (output.shape[1] === numSegments) { + return output; + } + segmentIds = tensor_ops_1.range(0, numSegments).tile([inSize / windowSize]); + return this.segOpCompute(output, segOpType, segmentIds, dtype, numSegments); + }; + MathBackendWebGL.prototype.argMin = function (x, axis) { + var axes = [axis]; + axis_util.assertAxesAreInnerMostDims('argMin', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = util.sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.argReduce(a2D, 'min').reshape(outShape); + }; + MathBackendWebGL.prototype.argMax = function (x, axis) { + var axes = [axis]; + axis_util.assertAxesAreInnerMostDims('argMax', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = util.sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.argReduce(a2D, 'max').reshape(outShape); + }; + MathBackendWebGL.prototype.cumsum = function (x, axis, exclusive, reverse) { + if (axis !== x.rank - 1) { + throw new Error("WebGL cumsum shader expects an inner-most axis=" + (x.rank - 1) + " " + + ("but got axis=" + axis)); + } + var program = new cumsum_gpu_1.CumSumProgram(x.shape, exclusive, reverse); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.equal = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.EQUAL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.notEqual = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.NOT_EQUAL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.less = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.LESS, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.lessEqual = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.LESS_EQUAL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.greater = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.GREATER, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.greaterEqual = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.GREATER_EQUAL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.logicalNot = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.LOGICAL_NOT); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.logicalAnd = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.LOGICAL_AND, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.logicalOr = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.LOGICAL_OR, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.select = function (condition, a, b) { + var program = new select_gpu_1.SelectProgram(condition.rank, a.shape, a.rank); + var output = this.makeOutputArray(program.outputShape, types_1.upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [condition, a, b], output); + }; + MathBackendWebGL.prototype.where = function (condition) { + log_1.warn('tf.where() in webgl locks the UI thread. ' + + 'Call tf.whereAsync() instead'); + var condVals = condition.dataSync(); + return where_impl_1.whereImpl(condition.shape, condVals); + }; + MathBackendWebGL.prototype.topk = function (x, k, sorted) { + var xVals = x.dataSync(); + return topk_impl_1.topkImpl(xVals, x.shape, x.dtype, k, sorted); + }; + MathBackendWebGL.prototype.min = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('min', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = util.sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.reduce(a2D, 'min', a2D.dtype).reshape(outShape); + }; + MathBackendWebGL.prototype.minimum = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.MIN, a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.mod = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.MOD, a.shape, b.shape); + var customSetup = program.getCustomSetupFunc(); + return this.compileAndRun(program, [a, b], null, customSetup); + }; + MathBackendWebGL.prototype.max = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('max', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = util.sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.reduce(a2D, 'max', a2D.dtype).reshape(outShape); + }; + MathBackendWebGL.prototype.maximum = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.MAX, a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.all = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('all', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = util.sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.reduce(a2D, 'all', a2D.dtype).reshape(outShape); + }; + MathBackendWebGL.prototype.any = function (x, axes) { + axis_util.assertAxesAreInnerMostDims('any', axes, x.rank); + var _a = axis_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = util.sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.reduce(a2D, 'any', a2D.dtype).reshape(outShape); + }; + MathBackendWebGL.prototype.squaredDifference = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.SQUARED_DIFFERENCE, a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.realDivide = function (a, b) { + var op = binaryop_gpu.DIV; + var outputDtype = 'float32'; + var program = new binaryop_gpu_1.BinaryOpProgram(op, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, outputDtype); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.floorDiv = function (a, b) { + var op = binaryop_gpu.INT_DIV; + var outputDtype = 'int32'; + var program = new binaryop_gpu_1.BinaryOpProgram(op, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, outputDtype); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.add = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.ADD, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, types_1.upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.addN = function (tensors) { + var res = tensors[0]; + for (var i = 1; i < tensors.length; i++) { + res = this.add(res, tensors[i]); + } + return res; + }; + MathBackendWebGL.prototype.subtract = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.SUB, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, types_1.upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.pow = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.POW, a.shape, b.shape); + var customSetup = program.getCustomSetupFunc(); + var output = this.makeOutputArray(program.outputShape, types_1.upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [a, b], output, customSetup); + }; + MathBackendWebGL.prototype.ceil = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.CEIL); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.floor = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.FLOOR); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.sign = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.SIGN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.round = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ROUND); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.exp = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.EXP); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.expm1 = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.EXPM1); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.log = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.LOG); + var customSetup = program.getCustomSetupFunc(); + return this.compileAndRun(program, [x], null, customSetup); + }; + MathBackendWebGL.prototype.log1p = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.LOG1P); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.sqrt = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.SQRT); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.rsqrt = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.RSQRT); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.square = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.SQUARE); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.reciprocal = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.RECIPROCAL); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.relu = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.RELU); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.elu = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ELU); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.eluDer = function (dy, y) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.ELU_DER, dy.shape, y.shape); + return this.compileAndRun(program, [dy, y]); + }; + MathBackendWebGL.prototype.selu = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.SELU); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.int = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.TO_INT); + var output = this.makeOutputArray(program.outputShape, 'int32'); + return this.compileAndRun(program, [x], output); + }; + MathBackendWebGL.prototype.clip = function (x, min, max) { + var program = new clip_gpu_1.ClipProgram(x.shape, min, max); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.abs = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ABS); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.sigmoid = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.SIGMOID); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.softplus = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.SOFTPLUS); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.sin = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.SIN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.cos = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.COS); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.tan = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.TAN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.asin = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ASIN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.acos = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ACOS); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.atan = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ATAN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.atan2 = function (a, b) { + var program = new binaryop_gpu_1.BinaryOpProgram(binaryop_gpu.ATAN2, a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.sinh = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.SINH); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.cosh = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.COSH); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.tanh = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.TANH); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.asinh = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ASINH); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.acosh = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ACOSH); + var customSetup = program.getCustomSetupFunc(); + return this.compileAndRun(program, [x], null, customSetup); + }; + MathBackendWebGL.prototype.atanh = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ATANH); + var customSetup = program.getCustomSetupFunc(); + return this.compileAndRun(program, [x], null, customSetup); + }; + MathBackendWebGL.prototype.erf = function (x) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.ERF); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.step = function (x, alpha) { + var program = new unaryop_gpu_1.UnaryOpProgram(x.shape, unary_op.STEP(alpha)); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.conv2d = function (x, filter, convInfo) { + var program = new conv_gpu_1.Conv2DProgram(convInfo); + return this.compileAndRun(program, [x, filter]); + }; + MathBackendWebGL.prototype.conv2dDerInput = function (dy, filter, convInfo) { + var program = new conv_backprop_gpu_1.Conv2DDerInputProgram(convInfo); + return this.compileAndRun(program, [dy, filter]); + }; + MathBackendWebGL.prototype.conv2dDerFilter = function (x, dy, convInfo) { + var program = new conv_backprop_gpu_1.Conv2DDerFilterProgram(convInfo); + return this.compileAndRun(program, [x, dy]); + }; + MathBackendWebGL.prototype.depthwiseConv2D = function (x, filter, convInfo) { + var program = new conv_gpu_depthwise_1.DepthwiseConv2DProgram(convInfo); + return this.compileAndRun(program, [x, filter]); + }; + MathBackendWebGL.prototype.depthwiseConv2DDerInput = function (dy, filter, convInfo) { + var program = new conv_backprop_gpu_depthwise_1.DepthwiseConv2DDerInputProgram(convInfo); + return this.compileAndRun(program, [dy, filter]); + }; + MathBackendWebGL.prototype.depthwiseConv2DDerFilter = function (x, dy, convInfo) { + var program = new conv_backprop_gpu_depthwise_1.DepthwiseConv2DDerFilterProgram(convInfo); + return this.compileAndRun(program, [x, dy]); + }; + MathBackendWebGL.prototype.maxPool = function (x, convInfo) { + var program = new pool_gpu_1.Pool2DProgram(convInfo, 'max', false); + var output = this.makeOutputArray(program.outputShape, x.dtype); + return this.compileAndRun(program, [x], output); + }; + MathBackendWebGL.prototype.avgPool = function (x, convInfo) { + var program = new pool_gpu_1.Pool2DProgram(convInfo, 'avg', false); + var output = this.makeOutputArray(program.outputShape, 'float32'); + return this.compileAndRun(program, [x], output); + }; + MathBackendWebGL.prototype.maxPoolBackprop = function (dy, x, y, convInfo) { + var getPositions = true; + var maxPoolPositionsProgram = new pool_gpu_1.Pool2DProgram(convInfo, 'max', getPositions); + var maxPoolPositions = this.compileAndRun(maxPoolPositionsProgram, [x]); + var maxPoolBackPropProgram = new max_pool_backprop_gpu_1.MaxPool2DBackpropProgram(convInfo); + var output = this.makeOutputArray(maxPoolBackPropProgram.outputShape, x.dtype); + var result = this.compileAndRun(maxPoolBackPropProgram, [dy, maxPoolPositions], output); + maxPoolPositions.dispose(); + return result; + }; + MathBackendWebGL.prototype.avgPoolBackprop = function (dy, x, convInfo) { + var avgPoolBackpropProgram = new avg_pool_backprop_gpu_1.AvgPool2DBackpropProgram(convInfo); + var output = this.makeOutputArray(avgPoolBackpropProgram.outputShape, x.dtype); + return this.compileAndRun(avgPoolBackpropProgram, [dy], output); + }; + MathBackendWebGL.prototype.cast = function (x, dtype) { + return backend_util.castTensor(x, dtype, this); + }; + MathBackendWebGL.prototype.reshape = function (x, shape) { + return backend_util.reshapeTensor(x, shape); + }; + MathBackendWebGL.prototype.resizeBilinear = function (x, newHeight, newWidth, alignCorners) { + var program = new resize_bilinear_gpu_1.ResizeBilinearProgram(x.shape, newHeight, newWidth, alignCorners); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.resizeBilinearBackprop = function (dy, x, alignCorners) { + var program = new resize_bilinear_backprop_gpu_1.ResizeBilinearBackpropProgram(dy, x, alignCorners); + return this.compileAndRun(program, [dy]); + }; + MathBackendWebGL.prototype.resizeNearestNeighbor = function (x, newHeight, newWidth, alignCorners) { + var program = new resize_nearest_neighbor_gpu_1.ResizeNearestNeighborProgram(x.shape, newHeight, newWidth, alignCorners); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.resizeNearestNeighborBackprop = function (dy, x, alignCorners) { + var program = new resize_nearest_neighbor_backprop_gpu_1.ResizeNearestNeigborBackpropProgram(dy, x, alignCorners); + return this.compileAndRun(program, [dy]); + }; + MathBackendWebGL.prototype.multinomial = function (logits, normalized, numSamples, seed) { + var probs = normalized ? logits : softmax_1.softmax(logits); + var batchSize = probs.shape[0]; + var numOutcomes = probs.shape[1]; + var program = new multinomial_gpu_1.MultinomialProgram(batchSize, numOutcomes, numSamples); + var output = this.makeOutputArray(program.outputShape, 'int32'); + var customSetup = program.getCustomSetupFunc(seed); + return this.compileAndRun(program, [probs], output, customSetup); + }; + MathBackendWebGL.prototype.oneHot = function (indices, depth, onValue, offValue) { + var program = new onehot_gpu_1.OneHotProgram(indices.size, depth, onValue, offValue); + return this.compileAndRun(program, [indices]); + }; + MathBackendWebGL.prototype.nonMaxSuppression = function (boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + log_1.warn('tf.nonMaxSuppression() in webgl locks the UI thread. ' + + 'Call tf.nonMaxSuppressionAsync() instead'); + var boxesVals = boxes.dataSync(); + var scoresVals = scores.dataSync(); + return non_max_suppression_impl_1.nonMaxSuppressionImpl(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold); + }; + MathBackendWebGL.prototype.makeOutputArray = function (shape, dtype) { + return tensor_1.Tensor.make(shape, {}, dtype); + }; + MathBackendWebGL.prototype.compileAndRun = function (program, inputs, output, customSetup, pageToCpu) { + var _this = this; + if (pageToCpu === void 0) { pageToCpu = true; } + if (output == null) { + output = this.makeOutputArray(program.outputShape, inputs[0].dtype); + } + var inputsData = inputs.map(function (tensor) { + var texData = _this.texData.get(tensor.dataId); + if (texData.texture == null && tensor.size <= exports.SIZE_UPLOAD_UNIFORM) { + return { tensor: tensor, texData: null, isUniform: true }; + } + _this.uploadToGPU(tensor.dataId); + return { tensor: tensor, texData: texData, isUniform: false }; + }); + this.uploadToGPU(output.dataId); + var outputData = { + tensor: output, + texData: this.texData.get(output.dataId), + isUniform: false + }; + var key = gpgpu_math.makeShaderKey(program, inputsData, outputData); + var binary = this.getAndSaveBinary(key, function () { + return gpgpu_math.compileProgram(_this.gpgpu, program, inputsData, outputData); + }); + var shouldTimeProgram = this.activeTimers != null; + var query; + if (shouldTimeProgram) { + query = this.startTimer(); + } + gpgpu_math.runProgram(binary, inputsData, outputData, customSetup); + if (pageToCpu && this.numBytesInGPU > this.NUM_BYTES_BEFORE_PAGING) { + var numBytesToPage = this.numBytesInGPU - this.NUM_BYTES_BEFORE_PAGING; + while (numBytesToPage > 0 && this.lruDataGPU.length > 0) { + var dataId = this.lruDataGPU.shift(); + var _a = this.texData.get(dataId), shape = _a.shape, dtype = _a.dtype; + numBytesToPage -= this.computeBytes(shape, dtype); + this.read(dataId); + } + } + if (shouldTimeProgram) { + query = this.endTimer(query); + this.activeTimers.push(this.getQueryTime(query)); + } + return output; + }; + MathBackendWebGL.prototype.getAndSaveBinary = function (key, getBinary) { + if (!(key in this.binaryCache)) { + this.binaryCache[key] = getBinary(); + } + return this.binaryCache[key]; + }; + MathBackendWebGL.prototype.getTextureManager = function () { + return this.textureManager; + }; + MathBackendWebGL.prototype.dispose = function () { + if (this.disposed) { + return; + } + for (var key in this.binaryCache) { + this.gpgpu.deleteProgram(this.binaryCache[key].webGLProgram); + } + this.textureManager.dispose(); + this.canvas.remove(); + if (this.fromPixelsCanvas != null) { + this.fromPixelsCanvas.remove(); + } + if (this.gpgpuCreatedLocally) { + this.gpgpu.dispose(); + } + this.disposed = true; + }; + MathBackendWebGL.prototype.throwIfNoData = function (dataId) { + if (!this.texData.has(dataId)) { + throw new Error("WebGL backend: No data found for this tensor. " + + "Did you change your backend in the middle of the program? " + + "New backends can't use Tensors created with previous backends"); + } + }; + MathBackendWebGL.prototype.uploadToGPU = function (dataId) { + this.throwIfNoData(dataId); + var texData = this.texData.get(dataId); + var shape = texData.shape, values = texData.values, texture = texData.texture, dtype = texData.dtype, usage = texData.usage; + if (texture != null) { + var index = this.lruDataGPU.indexOf(dataId); + if (index >= 0) { + this.lruDataGPU.splice(this.lruDataGPU.indexOf(dataId), 1); + this.lruDataGPU.push(dataId); + } + return; + } + var shouldTimeProgram = this.activeTimers != null; + var start; + if (shouldTimeProgram) { + start = performance.now(); + } + var texShape = webgl_util.getTextureShapeFromLogicalShape(this.gpgpu.gl, shape); + texData.texShape = texShape; + var newTexture = this.acquireTexture(dataId, texShape, usage); + texData.texture = newTexture; + if (values != null) { + this.gpgpu.uploadMatrixToTexture(newTexture, texShape[0], texShape[1], typedArrayToFloat32(values, dtype)); + texData.values = null; + if (shouldTimeProgram) { + this.uploadWaitMs += performance.now() - start; + } + } + }; + MathBackendWebGL.prototype.cacheOnCPU = function (dataId, float32Values) { + var dontKeepCopyOnGPU = this.delayedStorage; + var texData = this.texData.get(dataId); + var texture = texData.texture, texShape = texData.texShape, dtype = texData.dtype, usage = texData.usage; + if (dontKeepCopyOnGPU && texture != null) { + this.releaseTexture(dataId, texture, texShape, usage); + texData.texture = null; + texData.texShape = null; + } + if (float32Values != null) { + texData.values = float32ToTypedArray(float32Values, dtype); + } + }; + MathBackendWebGL.prototype.releaseTexture = function (dataId, texture, texShape, texType) { + var _a = this.texData.get(dataId), shape = _a.shape, dtype = _a.dtype; + var idx = this.lruDataGPU.indexOf(dataId); + if (idx >= 0) { + this.lruDataGPU.splice(idx, 1); + } + this.numBytesInGPU -= this.computeBytes(shape, dtype); + this.textureManager.releaseTexture(texture, texShape, texType); + }; + MathBackendWebGL.prototype.acquireTexture = function (dataId, texShape, texType) { + var _a = this.texData.get(dataId), shape = _a.shape, dtype = _a.dtype; + this.lruDataGPU.push(dataId); + this.numBytesInGPU += this.computeBytes(shape, dtype); + return this.textureManager.acquireTexture(texShape, texType); + }; + MathBackendWebGL.prototype.computeBytes = function (shape, dtype) { + return util.sizeFromShape(shape) * util.bytesPerElement(dtype); + }; + return MathBackendWebGL; +}()); +exports.MathBackendWebGL = MathBackendWebGL; +if (environment_1.ENV.get('IS_BROWSER')) { + environment_1.ENV.registerBackend('webgl', function () { return new MathBackendWebGL(); }, 2, tensor_1.setTensorTracker); +} +function float32ToTypedArray(a, dtype) { + if (dtype === 'float32') { + return a; + } + else if (dtype === 'int32' || dtype === 'bool') { + var result = (dtype === 'int32') ? new Int32Array(a.length) : + new Uint8Array(a.length); + for (var i = 0; i < result.length; ++i) { + result[i] = Math.round(a[i]); + } + return result; + } + else { + throw new Error("Unknown dtype " + dtype); + } +} +function typedArrayToFloat32(a, dtype) { + return (a instanceof Float32Array) ? a : new Float32Array(a); +} +//# sourceMappingURL=backend_webgl.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js.map new file mode 100644 index 0000000..a63171b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"backend_webgl.js","sourceRoot":"","sources":["../../src/kernels/backend_webgl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,8CAAmC;AACnC,8BAA4B;AAC5B,sDAAwD;AACxD,4CAA8C;AAE9C,gDAAkD;AAClD,kDAAoD;AACpD,gDAAuD;AACvD,0CAAuC;AACvC,gDAAgD;AAChD,oCAAmG;AACnG,kCAAmH;AACnH,8BAAgC;AAGhC,6CAA+C;AAC/C,uEAAiE;AACjE,yCAAqC;AACrC,uDAAuD;AACvD,uEAAuE;AACvE,uDAAuD;AACvD,mDAAqD;AACrD,qDAAqD;AACrD,6CAA6C;AAC7C,iDAAiD;AACjD,+DAAwF;AACxF,mFAAoH;AACpH,6CAA+C;AAC/C,iEAAkE;AAClE,iDAAiD;AACjD,6DAA4D;AAC5D,2DAA0D;AAC1D,iDAAiD;AACjD,uDAAmD;AACnD,+CAAiD;AAEjD,+CAAiD;AACjD,2CAA2C;AAC3C,qDAAoD;AACpD,uEAAuE;AACvE,iDAAiD;AACjD,2DAA2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C,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YAC1B,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAC9D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACtC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9B;QACD,OAAO,MAAM,CAAC;KACf;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,mBAAiB,KAAO,CAAC,CAAC;KAC3C;AACH,CAAC;AAED,6BACI,CAAiB,EAAE,KAAQ;IAC7B,OAAO,CAAC,CAAC,YAAY,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl_test.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl_test.js new file mode 100644 index 0000000..d3db8bc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl_test.js @@ -0,0 +1,176 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var backend_webgl_1 = require("./backend_webgl"); +jasmine_util_1.describeWithFlags('backendWebGL', test_util_1.WEBGL_ENVS, function () { + var prevBackend; + beforeAll(function () { + prevBackend = tf.getBackend(); + }); + afterEach(function () { + tf.setBackend(prevBackend); + tf.ENV.removeBackend('test-storage'); + }); + it('delayed storage, reading', function () { + var delayedStorage = true; + var backend = new backend_webgl_1.MathBackendWebGL(null, delayedStorage); + tf.ENV.registerBackend('test-storage', function () { return backend; }); + tf.setBackend('test-storage'); + var texManager = backend.getTextureManager(); + var t = tf.Tensor.make([3], {}, 'float32'); + backend.write(t.dataId, new Float32Array([1, 2, 3])); + expect(texManager.getNumUsedTextures()).toBe(0); + backend.getTexture(t.dataId); + expect(texManager.getNumUsedTextures()).toBe(1); + test_util_1.expectArraysClose(backend.readSync(t.dataId), new Float32Array([1, 2, 3])); + expect(texManager.getNumUsedTextures()).toBe(0); + backend.getTexture(t.dataId); + expect(texManager.getNumUsedTextures()).toBe(1); + backend.disposeData(t.dataId); + expect(texManager.getNumUsedTextures()).toBe(0); + }); + it('delayed storage, overwriting', function () { + var delayedStorage = true; + var backend = new backend_webgl_1.MathBackendWebGL(null, delayedStorage); + tf.ENV.registerBackend('test-storage', function () { return backend; }); + tf.setBackend('test-storage'); + var texManager = backend.getTextureManager(); + var t = tf.Tensor.make([3], {}, 'float32'); + backend.write(t.dataId, new Float32Array([1, 2, 3])); + backend.getTexture(t.dataId); + expect(texManager.getNumUsedTextures()).toBe(1); + backend.write(t.dataId, new Float32Array([4, 5, 6])); + expect(texManager.getNumUsedTextures()).toBe(0); + test_util_1.expectArraysClose(backend.readSync(t.dataId), new Float32Array([4, 5, 6])); + backend.getTexture(t.dataId); + expect(texManager.getNumUsedTextures()).toBe(1); + test_util_1.expectArraysClose(backend.readSync(t.dataId), new Float32Array([4, 5, 6])); + expect(texManager.getNumUsedTextures()).toBe(0); + }); + it('immediate storage reading', function () { + var delayedStorage = false; + var backend = new backend_webgl_1.MathBackendWebGL(null, delayedStorage); + tf.ENV.registerBackend('test-storage', function () { return backend; }); + tf.setBackend('test-storage'); + var texManager = backend.getTextureManager(); + var t = tf.Tensor.make([3], {}, 'float32'); + backend.write(t.dataId, new Float32Array([1, 2, 3])); + expect(texManager.getNumUsedTextures()).toBe(1); + test_util_1.expectArraysClose(backend.readSync(t.dataId), new Float32Array([1, 2, 3])); + expect(texManager.getNumUsedTextures()).toBe(1); + backend.disposeData(t.dataId); + expect(texManager.getNumUsedTextures()).toBe(0); + }); + it('immediate storage overwriting', function () { + var delayedStorage = false; + var backend = new backend_webgl_1.MathBackendWebGL(null, delayedStorage); + tf.ENV.registerBackend('test-storage', function () { return backend; }); + tf.setBackend('test-storage'); + var texManager = backend.getTextureManager(); + var t = tf.Tensor.make([3], {}, 'float32'); + backend.write(t.dataId, new Float32Array([1, 2, 3])); + expect(texManager.getNumUsedTextures()).toBe(1); + backend.write(t.dataId, new Float32Array([4, 5, 6])); + expect(texManager.getNumUsedTextures()).toBe(1); + test_util_1.expectArraysClose(backend.readSync(t.dataId), new Float32Array([4, 5, 6])); + expect(texManager.getNumUsedTextures()).toBe(1); + backend.disposeData(t.dataId); + expect(texManager.getNumUsedTextures()).toBe(0); + }); + it('disposal of backend disposes all textures', function () { + var delayedStorage = false; + var backend = new backend_webgl_1.MathBackendWebGL(null, delayedStorage); + var texManager = backend.getTextureManager(); + tf.ENV.registerBackend('test-storage', function () { return backend; }); + tf.setBackend('test-storage'); + var t = tf.Tensor.make([3], {}, 'float32'); + backend.write(t.dataId, new Float32Array([1, 2, 3])); + var t2 = tf.Tensor.make([3], {}, 'float32'); + backend.write(t2.dataId, new Float32Array([4, 5, 6])); + expect(texManager.getNumUsedTextures()).toBe(2); + backend.dispose(); + expect(texManager.getNumUsedTextures()).toBe(0); + }); +}); +jasmine_util_1.describeWithFlags('Custom window size', test_util_1.WEBGL_ENVS, function () { + it('Set screen area to be 1x1', function () { return __awaiter(_this, void 0, void 0, function () { + var oldBackend, a; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + spyOnProperty(window, 'screen', 'get') + .and.returnValue({ height: 1, width: 1 }); + oldBackend = tf.getBackend(); + tf.ENV.registerBackend('custom-webgl', function () { return new backend_webgl_1.MathBackendWebGL(); }); + tf.setBackend('custom-webgl'); + a = tf.ones([100, 100]); + expect(tf.memory().numBytesInGPU).toBe(0); + return [4, a.square().data()]; + case 1: + _a.sent(); + expect(tf.memory().numBytesInGPU).toBe(0); + test_util_1.expectArraysEqual(a, new Float32Array(100 * 100).fill(1)); + tf.setBackend(oldBackend); + tf.ENV.removeBackend('custom-webgl'); + return [2]; + } + }); + }); }); +}); +jasmine_util_1.describeWithFlags('upload tensors as uniforms', test_util_1.WEBGL_ENVS, function () { + it('small tensor gets uploaded as scalar', function () { + var m = tf.memory(); + expect(m.numBytesInGPU).toBe(0); + var a = tf.zeros([backend_webgl_1.SIZE_UPLOAD_UNIFORM - 1]); + a.square(); + m = tf.memory(); + expect(m.numBytesInGPU).toBe(a.size * 4); + }); + it('large tensor gets uploaded to gpu', function () { + var m = tf.memory(); + expect(m.numBytesInGPU).toBe(0); + var a = tf.zeros([backend_webgl_1.SIZE_UPLOAD_UNIFORM + 1]); + a.square(); + m = tf.memory(); + expect(m.numBytesInGPU).toBe(a.size * 4 * 2); + }); +}); +//# sourceMappingURL=backend_webgl_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl_test.js.map new file mode 100644 index 0000000..29f68da --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend_webgl_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"backend_webgl_test.js","sourceRoot":"","sources":["../../src/kernels/backend_webgl_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBAgKA;;AAhKA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA8E;AAC9E,iDAAuF;AAEvF,gCAAiB,CAAC,cAAc,EAAE,sBAAU,EAAE;IAC5C,IAAI,WAAmB,CAAC;IAExB,SAAS,CAAC;QACR,WAAW,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC,CAAC,CAAC;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,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/non_max_suppression_impl.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/non_max_suppression_impl.d.ts new file mode 100644 index 0000000..9a623ab --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/non_max_suppression_impl.d.ts @@ -0,0 +1,3 @@ +import { Tensor1D } from '../tensor'; +import { TypedArray } from '../types'; +export declare function nonMaxSuppressionImpl(boxes: TypedArray, scores: TypedArray, maxOutputSize: number, iouThreshold: number, scoreThreshold: number): Tensor1D; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/non_max_suppression_impl.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/non_max_suppression_impl.js new file mode 100644 index 0000000..77c973e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/non_max_suppression_impl.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tensor_ops_1 = require("../ops/tensor_ops"); +function nonMaxSuppressionImpl(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + var candidates = Array.from(scores) + .map(function (score, boxIndex) { return ({ score: score, boxIndex: boxIndex }); }) + .filter(function (c) { return c.score > scoreThreshold; }) + .sort(function (c1, c2) { return c2.score - c1.score; }); + var selected = []; + for (var i = 0; i < candidates.length; i++) { + var _a = candidates[i], score = _a.score, boxIndex = _a.boxIndex; + if (score < scoreThreshold) { + break; + } + var ignoreCandidate = false; + for (var j = selected.length - 1; j >= 0; --j) { + var iou = intersectionOverUnion(boxes, boxIndex, selected[j]); + if (iou >= iouThreshold) { + ignoreCandidate = true; + break; + } + } + if (!ignoreCandidate) { + selected.push(boxIndex); + if (selected.length >= maxOutputSize) { + break; + } + } + } + return tensor_ops_1.tensor1d(selected, 'int32'); +} +exports.nonMaxSuppressionImpl = nonMaxSuppressionImpl; +function intersectionOverUnion(boxes, i, j) { + var iCoord = boxes.subarray(i * 4, i * 4 + 4); + var jCoord = boxes.subarray(j * 4, j * 4 + 4); + var yminI = Math.min(iCoord[0], iCoord[2]); + var xminI = Math.min(iCoord[1], iCoord[3]); + var ymaxI = Math.max(iCoord[0], iCoord[2]); + var xmaxI = Math.max(iCoord[1], iCoord[3]); + var yminJ = Math.min(jCoord[0], jCoord[2]); + var xminJ = Math.min(jCoord[1], jCoord[3]); + var ymaxJ = Math.max(jCoord[0], jCoord[2]); + var xmaxJ = Math.max(jCoord[1], jCoord[3]); + var areaI = (ymaxI - yminI) * (xmaxI - xminI); + var areaJ = (ymaxJ - yminJ) * (xmaxJ - xminJ); + if (areaI <= 0 || areaJ <= 0) { + return 0.0; + } + var intersectionYmin = Math.max(yminI, yminJ); + var intersectionXmin = Math.max(xminI, xminJ); + var intersectionYmax = Math.min(ymaxI, ymaxJ); + var intersectionXmax = Math.min(xmaxI, xmaxJ); + var intersectionArea = Math.max(intersectionYmax - intersectionYmin, 0.0) * + Math.max(intersectionXmax - intersectionXmin, 0.0); + return intersectionArea / (areaI + areaJ - intersectionArea); +} +//# sourceMappingURL=non_max_suppression_impl.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/non_max_suppression_impl.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/non_max_suppression_impl.js.map new file mode 100644 index 0000000..621675d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/non_max_suppression_impl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"non_max_suppression_impl.js","sourceRoot":"","sources":["../../src/kernels/non_max_suppression_impl.ts"],"names":[],"mappings":";;AAqBA,gDAA2C;AAI3C,+BACI,KAAiB,EAAE,MAAkB,EAAE,aAAqB,EAC5D,YAAoB,EAAE,cAAsB;IAC9C,IAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;SACb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IAChD,IAAM,KAAK,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;IAChD,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QAC5B,OAAO,GAAG,CAAC;KACZ;IACD,IAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,IAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,IAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,IAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,IAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,GAAG,gBAAgB,EAAE,GAAG,CAAC;QACvE,IAAI,CAAC,GAAG,CAAC,gBAAgB,GAAG,gBAAgB,EAAE,GAAG,CAAC,CAAC;IACvD,OAAO,gBAAgB,GAAG,CAAC,KAAK,GAAG,KAAK,GAAG,gBAAgB,CAAC,CAAC;AAC/D,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/topk_impl.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/topk_impl.d.ts new file mode 100644 index 0000000..1004334 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/topk_impl.d.ts @@ -0,0 +1,3 @@ +import { Tensor } from '../tensor'; +import { DataType, TypedArray } from '../types'; +export declare function topkImpl(x: TypedArray, xShape: number[], xDtype: DataType, k: number, sorted: boolean): [T, T]; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/topk_impl.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/topk_impl.js new file mode 100644 index 0000000..4036c1f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/topk_impl.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tensor_ops_1 = require("../ops/tensor_ops"); +var util_1 = require("../util"); +function topkImpl(x, xShape, xDtype, k, sorted) { + var lastDim = xShape[xShape.length - 1]; + var _a = [x.length / lastDim, lastDim], batch = _a[0], size = _a[1]; + var allTopKVals = util_1.getTypedArrayFromDType(xDtype, batch * k); + var allTopKIndices = util_1.getTypedArrayFromDType('int32', batch * k); + for (var b = 0; b < batch; b++) { + var offset = b * size; + var vals = x.subarray(offset, offset + size); + var valAndInd = []; + for (var i = 0; i < vals.length; i++) { + valAndInd.push({ value: vals[i], index: i }); + } + valAndInd.sort(function (a, b) { return b.value - a.value; }); + var outOffset = b * k; + var topKVals = allTopKVals.subarray(outOffset, outOffset + k); + var topKIndices = allTopKIndices.subarray(outOffset, outOffset + k); + for (var i = 0; i < k; i++) { + topKVals[i] = valAndInd[i].value; + topKIndices[i] = valAndInd[i].index; + } + } + var outputShape = xShape.slice(); + outputShape[outputShape.length - 1] = k; + return [ + tensor_ops_1.tensor(allTopKVals, outputShape, xDtype), + tensor_ops_1.tensor(allTopKIndices, outputShape, 'int32') + ]; +} +exports.topkImpl = topkImpl; +//# sourceMappingURL=topk_impl.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/topk_impl.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/topk_impl.js.map new file mode 100644 index 0000000..1bdceec --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/topk_impl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topk_impl.js","sourceRoot":"","sources":["../../src/kernels/topk_impl.ts"],"names":[],"mappings":";;AAmBA,gDAAyC;AAGzC,gCAA+C;AAE/C,kBACI,CAAa,EAAE,MAAgB,EAAE,MAAgB,EAAE,CAAS,EAC5D,MAAe;IAEjB,IAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAA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KAAK,CAAC;YACjC,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;SACrC;KACF;IAGD,IAAM,WAAW,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;IACnC,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACxC,OAAO;QACL,mBAAM,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAM;QAC7C,mBAAM,CAAC,cAAc,EAAE,WAAW,EAAE,OAAO,CAAM;KAClD,CAAC;AACJ,CAAC;AAlCD,4BAkCC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/argminmax_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/argminmax_gpu.d.ts new file mode 100644 index 0000000..298d3fc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/argminmax_gpu.d.ts @@ -0,0 +1,8 @@ +import { ReduceInfo } from '../../ops/reduce_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class ArgMinMaxProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(reduceInfo: ReduceInfo, op: 'max' | 'min', firstPass: boolean); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/argminmax_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/argminmax_gpu.js new file mode 100644 index 0000000..1ff477e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/argminmax_gpu.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ArgMinMaxProgram = (function () { + function ArgMinMaxProgram(reduceInfo, op, firstPass) { + this.variableNames = ['A']; + var windowSize = reduceInfo.windowSize; + var batchSize = reduceInfo.batchSize; + var inSize = reduceInfo.inSize; + var outSize = Math.ceil(inSize / windowSize); + if (!firstPass) { + this.variableNames.push('bestIndicesA'); + } + this.outputShape = [batchSize, outSize]; + var compOp = (op === 'max') ? '>' : '<'; + var indexSnippet = firstPass ? + 'inOffset + i;' : + 'round(getBestIndicesA(batch, inOffset + i));'; + this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * " + windowSize + ";\n\n int bestIndex = 0;\n float bestValue = getA(batch, inOffset);\n\n for (int i = 0; i < " + windowSize + "; i++) {\n int inIdx = " + indexSnippet + ";\n float candidate = getA(batch, inIdx);\n if (candidate " + compOp + " bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n "; + } + return ArgMinMaxProgram; +}()); +exports.ArgMinMaxProgram = ArgMinMaxProgram; +//# sourceMappingURL=argminmax_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/argminmax_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/argminmax_gpu.js.map new file mode 100644 index 0000000..21d8d6a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/argminmax_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"argminmax_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/argminmax_gpu.ts"],"names":[],"mappings":";;AAoBA;IAKE,0BAAY,UAAsB,EAAE,EAAe,EAAE,SAAkB;QAJvE,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAKpB,IAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACzC,IAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACvC,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QACjC,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,EAAE;YACd,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SACzC;QACD,IAAI,CAAC,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACxC,IAAM,MAAM,GAAG,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAC1C,IAAM,YAAY,GAAG,SAAS,CAAC,CAAC;YAC5B,eAAe,CAAC,CAAC;YACjB,8CAA8C,CAAC;QAEnD,IAAI,CAAC,QAAQ,GAAG,wKAKc,UAAU,yHAKd,UAAU,wCAChB,YAAY,oFAEV,MAAM,mKAO3B,CAAC;IACJ,CAAC;IACH,uBAAC;AAAD,CAAC,AAzCD,IAyCC;AAzCY,4CAAgB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/avg_pool_backprop_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/avg_pool_backprop_gpu.d.ts new file mode 100644 index 0000000..d419ff6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/avg_pool_backprop_gpu.d.ts @@ -0,0 +1,8 @@ +import { Conv2DInfo } from '../../ops/conv_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class AvgPool2DBackpropProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(convInfo: Conv2DInfo); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/avg_pool_backprop_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/avg_pool_backprop_gpu.js new file mode 100644 index 0000000..fa92982 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/avg_pool_backprop_gpu.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var AvgPool2DBackpropProgram = (function () { + function AvgPool2DBackpropProgram(convInfo) { + this.variableNames = ['dy']; + this.outputShape = convInfo.inShape; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var avgMultiplier = 1 / (filterHeight * filterWidth); + this.userCode = "\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n const float avgMultiplier = float(" + avgMultiplier + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + strideHeight + ".0;\n\n if (dyR < 0.0 || dyR >= " + convInfo.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + strideWidth + ".0;\n\n if (dyC < 0.0 || dyC >= " + convInfo.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n "; + } + return AvgPool2DBackpropProgram; +}()); +exports.AvgPool2DBackpropProgram = AvgPool2DBackpropProgram; +//# sourceMappingURL=avg_pool_backprop_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/avg_pool_backprop_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/avg_pool_backprop_gpu.js.map new file mode 100644 index 0000000..b8ce2db --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/avg_pool_backprop_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"avg_pool_backprop_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/avg_pool_backprop_gpu.ts"],"names":[],"mappings":";;AAqBA;IAKE,kCAAY,QAAoB;QAJhC,kBAAa,GAAG,CAAC,IAAI,CAAC,CAAC;QAKrB,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC;QACpC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACzC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QAEzC,IAAM,MAAM,GAAG,YAAY,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC;QACvD,IAAM,OAAO,GAAG,WAAW,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QAExD,IAAM,aAAa,GAAG,CAAC,GAAG,CAAC,YAAY,GAAG,WAAW,CAAC,CAAC;QAEvD,IAAI,CAAC,QAAQ,GAAG,sCACa,MAAM,UAAK,OAAO,oDACT,aAAa,sdAcvB,YAAY,iEACI,YAAY,iDAExB,QAAQ,CAAC,SAAS,yIAKpB,WAAW,mEACK,WAAW,mDAEvB,QAAQ,CAAC,QAAQ,wSAalD,CAAC;IACJ,CAAC;IACH,+BAAC;AAAD,CAAC,AA3DD,IA2DC;AA3DY,4DAAwB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/batchnorm_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/batchnorm_gpu.d.ts new file mode 100644 index 0000000..b2de35a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/batchnorm_gpu.d.ts @@ -0,0 +1,8 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class BatchNormProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + supportsBroadcasting: boolean; + constructor(xShape: number[], meanShape: number[], varianceShape: number[], offsetShape: number[] | null, scaleShape: number[] | null, varianceEpsilon: number); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/batchnorm_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/batchnorm_gpu.js new file mode 100644 index 0000000..576c294 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/batchnorm_gpu.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var broadcast_util = require("../../ops/broadcast_util"); +var BatchNormProgram = (function () { + function BatchNormProgram(xShape, meanShape, varianceShape, offsetShape, scaleShape, varianceEpsilon) { + this.outputShape = []; + this.supportsBroadcasting = true; + this.variableNames = ['x', 'mean', 'variance']; + broadcast_util.assertAndGetBroadcastShape(xShape, meanShape); + broadcast_util.assertAndGetBroadcastShape(xShape, varianceShape); + var offsetSnippet = '0.0'; + if (offsetShape != null) { + broadcast_util.assertAndGetBroadcastShape(xShape, offsetShape); + this.variableNames.push('offset'); + offsetSnippet = 'getOffsetAtOutCoords()'; + } + var scaleSnippet = '1.0'; + if (scaleShape != null) { + broadcast_util.assertAndGetBroadcastShape(xShape, scaleShape); + this.variableNames.push('scale'); + scaleSnippet = 'getScaleAtOutCoords()'; + } + this.outputShape = xShape; + this.userCode = "\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = " + offsetSnippet + ";\n float scale = " + scaleSnippet + ";\n float inv = scale * inversesqrt(variance + float(" + varianceEpsilon + "));\n setOutput((x - mean) * inv + offset);\n }\n "; + } + return BatchNormProgram; +}()); +exports.BatchNormProgram = BatchNormProgram; +//# sourceMappingURL=batchnorm_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/batchnorm_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/batchnorm_gpu.js.map new file mode 100644 index 0000000..81f3efe --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/batchnorm_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"batchnorm_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/batchnorm_gpu.ts"],"names":[],"mappings":";;AAiBA,yDAA2D;AAG3D;IAME,0BACI,MAAgB,EAAE,SAAmB,EAAE,aAAuB,EAC9D,WAA0B,EAAE,UAAyB,EACrD,eAAuB;QAP3B,gBAAW,GAAa,EAAE,CAAC;QAE3B,yBAAoB,GAAG,IAAI,CAAC;QAM1B,IAAI,CAAC,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC/C,cAAc,CAAC,0BAA0B,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC7D,cAAc,CAAC,0BAA0B,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAEjE,IAAI,aAAa,GAAG,KAAK,CAAC;QAC1B,IAAI,WAAW,IAAI,IAAI,EAAE;YACvB,cAAc,CAAC,0BAA0B,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YAC/D,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAClC,aAAa,GAAG,wBAAwB,CAAC;SAC1C;QAED,IAAI,YAAY,GAAG,KAAK,CAAC;QACzB,IAAI,UAAU,IAAI,IAAI,EAAE;YACtB,cAAc,CAAC,0BAA0B,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YAC9D,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACjC,YAAY,GAAG,uBAAuB,CAAC;SACxC;QAED,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,yLAKK,aAAa,iCACd,YAAY,oEACuB,eAAe,sEAGrE,CAAC;IACJ,CAAC;IACH,uBAAC;AAAD,CAAC,AAzCD,IAyCC;AAzCY,4CAAgB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/binaryop_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/binaryop_gpu.d.ts new file mode 100644 index 0000000..b7b111c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/binaryop_gpu.d.ts @@ -0,0 +1,31 @@ +import { GPGPUContext } from './gpgpu_context'; +import { GPGPUProgram } from './gpgpu_math'; +export declare const ADD = "return a + b;"; +export declare const SUB = "return a - b;"; +export declare const MUL = "return a * b;"; +export declare const DIV = "if (a == b) return 1.0;\n return a / b;"; +export declare const INT_DIV = "\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n"; +export declare const POW = "\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n"; +export declare const SQUARED_DIFFERENCE = "return (a - b) * (a - b);"; +export declare const EQUAL = "return float(a == b);"; +export declare const NOT_EQUAL = "return float(a != b);"; +export declare const LESS = "return float(a < b);"; +export declare const LESS_EQUAL = "return float(a <= b);"; +export declare const GREATER = "return float(a > b);"; +export declare const GREATER_EQUAL = "return float(a >= b);"; +export declare const LOGICAL_AND = "return float(a >= 1.0 && b >= 1.0);"; +export declare const LOGICAL_OR = "return float(a >= 1.0 || b >= 1.0);"; +export declare const MAX: string; +export declare const MIN: string; +export declare const MOD = "if (b == 0.0) return NAN;\n return mod(a, b);"; +export declare const ATAN2: string; +export declare const ELU_DER = "return (b >= 1.0) ? a : a * (b + 1.0);"; +export declare class BinaryOpProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + supportsBroadcasting: boolean; + startLoc: WebGLUniformLocation; + constructor(op: string, aShape: number[], bShape: number[]); + getCustomSetupFunc(): (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/binaryop_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/binaryop_gpu.js new file mode 100644 index 0000000..fbacce4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/binaryop_gpu.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var broadcast_util = require("../../ops/broadcast_util"); +var CHECK_NAN_SNIPPET = "\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n"; +exports.ADD = 'return a + b;'; +exports.SUB = 'return a - b;'; +exports.MUL = 'return a * b;'; +exports.DIV = "if (a == b) return 1.0;\n return a / b;"; +exports.INT_DIV = "\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n"; +exports.POW = "\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n"; +exports.SQUARED_DIFFERENCE = 'return (a - b) * (a - b);'; +exports.EQUAL = "return float(a == b);"; +exports.NOT_EQUAL = "return float(a != b);"; +exports.LESS = "return float(a < b);"; +exports.LESS_EQUAL = "return float(a <= b);"; +exports.GREATER = "return float(a > b);"; +exports.GREATER_EQUAL = "return float(a >= b);"; +exports.LOGICAL_AND = "return float(a >= 1.0 && b >= 1.0);"; +exports.LOGICAL_OR = "return float(a >= 1.0 || b >= 1.0);"; +exports.MAX = CHECK_NAN_SNIPPET + "\n return max(a, b);\n"; +exports.MIN = CHECK_NAN_SNIPPET + "\n return min(a, b);\n"; +exports.MOD = "if (b == 0.0) return NAN;\n return mod(a, b);"; +exports.ATAN2 = CHECK_NAN_SNIPPET + "\n return atan(a, b);\n"; +exports.ELU_DER = "return (b >= 1.0) ? a : a * (b + 1.0);"; +var BinaryOpProgram = (function () { + function BinaryOpProgram(op, aShape, bShape) { + this.variableNames = ['A', 'B']; + this.supportsBroadcasting = true; + this.outputShape = + broadcast_util.assertAndGetBroadcastShape(aShape, bShape); + this.userCode = "\n uniform float NAN;\n float binaryOperation(float a, float b) {\n " + op + "\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n "; + } + BinaryOpProgram.prototype.getCustomSetupFunc = function () { + var _this = this; + return function (gpgpu, webGLProgram) { + if (_this.startLoc == null) { + _this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN'); + if (_this.startLoc == null) { + return; + } + } + gpgpu.gl.uniform1f(_this.startLoc, NaN); + }; + }; + return BinaryOpProgram; +}()); +exports.BinaryOpProgram = BinaryOpProgram; +//# sourceMappingURL=binaryop_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/binaryop_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/binaryop_gpu.js.map new file mode 100644 index 0000000..63fd68f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/binaryop_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"binaryop_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/binaryop_gpu.ts"],"names":[],"mappings":";;AAiBA,yDAA2D;AAK3D,IAAM,iBAAiB,GAAG,0DAGzB,CAAC;AAEW,QAAA,GAAG,GAAG,eAAe,CAAC;AACtB,QAAA,GAAG,GAAG,eAAe,CAAC;AACtB,QAAA,GAAG,GAAG,eAAe,CAAC;AACtB,QAAA,GAAG,GAAG,0CACH,CAAC;AAMJ,QAAA,OAAO,GAAG,8OAWtB,CAAC;AAEW,QAA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AS,CAAC,KAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACzC,CAAC,CAAC;IACJ,CAAC;IACH,sBAAC;AAAD,CAAC,AAvCD,IAuCC;AAvCY,0CAAe"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/clip_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/clip_gpu.d.ts new file mode 100644 index 0000000..b1ff28b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/clip_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class ClipProgram implements GPGPUProgram { + variableNames: string[]; + userCode: string; + outputShape: number[]; + constructor(aShape: number[], min: number, max: number); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/clip_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/clip_gpu.js new file mode 100644 index 0000000..6d8134c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/clip_gpu.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ClipProgram = (function () { + function ClipProgram(aShape, min, max) { + this.variableNames = ['A']; + this.outputShape = aShape; + var minFixed = min.toFixed(20); + var maxFixed = max.toFixed(20); + this.userCode = "\n void main() {\n float value = getAAtOutCoords();\n if (isNaN(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, " + minFixed + ", " + maxFixed + "));\n }\n "; + } + return ClipProgram; +}()); +exports.ClipProgram = ClipProgram; +//# sourceMappingURL=clip_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/clip_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/clip_gpu.js.map new file mode 100644 index 0000000..1586d49 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/clip_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clip_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/clip_gpu.ts"],"names":[],"mappings":";;AAmBA;IAKE,qBAAY,MAAgB,EAAE,GAAW,EAAE,GAAW;QAJtD,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAKpB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,IAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjC,IAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,+LAQa,QAAQ,UAAK,QAAQ,uBAEjD,CAAC;IACJ,CAAC;IACH,kBAAC;AAAD,CAAC,AArBD,IAqBC;AArBY,kCAAW"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/concat_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/concat_gpu.d.ts new file mode 100644 index 0000000..aa8a095 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/concat_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class ConcatProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(aShape: [number, number], bShape: [number, number]); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/concat_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/concat_gpu.js new file mode 100644 index 0000000..f75d8c2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/concat_gpu.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var concat_util = require("../../ops/concat_util"); +var ConcatProgram = (function () { + function ConcatProgram(aShape, bShape) { + this.variableNames = ['A', 'B']; + this.outputShape = []; + this.outputShape = + concat_util.computeOutShape(aShape, bShape, 1); + this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n float value = 0.0;\n if (yC < " + aShape[1] + ") {\n value = getA(yR, yC);\n } else {\n yC -= " + aShape[1] + ";\n value = getB(yR, yC);\n }\n\n setOutput(value);\n }\n "; + } + return ConcatProgram; +}()); +exports.ConcatProgram = ConcatProgram; +//# sourceMappingURL=concat_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/concat_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/concat_gpu.js.map new file mode 100644 index 0000000..dc99d20 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/concat_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"concat_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/concat_gpu.ts"],"names":[],"mappings":";;AAiBA,mDAAqD;AAGrD;IAME,uBAAY,MAAwB,EAAE,MAAwB;QAL9D,kBAAa,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC3B,gBAAW,GAAa,EAAE,CAAC;QAKzB,IAAI,CAAC,WAAW;YACZ,WAAW,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAY,CAAC;QAE9D,IAAI,CAAC,QAAQ,GAAG,8KAOD,MAAM,CAAC,CAAC,CAAC,gFAGV,MAAM,CAAC,CAAC,CAAC,8FAMtB,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AA5BD,IA4BC;AA5BY,sCAAa"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu.d.ts new file mode 100644 index 0000000..e2c2c52 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu.d.ts @@ -0,0 +1,14 @@ +import { Conv2DInfo } from '../../ops/conv_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class Conv2DDerFilterProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(convInfo: Conv2DInfo); +} +export declare class Conv2DDerInputProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(convInfo: Conv2DInfo); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu.js new file mode 100644 index 0000000..5d9b4ad --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Conv2DDerFilterProgram = (function () { + function Conv2DDerFilterProgram(convInfo) { + this.variableNames = ['x', 'dy']; + this.outputShape = convInfo.filterShape; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < " + convInfo.batchSize + "; b++) {\n for (int yR = 0; yR < " + convInfo.outHeight + "; yR++) {\n int xR = wR + yR * " + strideHeight + " - " + padTop + ";\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int yC = 0; yC < " + convInfo.outWidth + "; yC++) {\n int xC = wC + yC * " + strideWidth + " - " + padLeft + ";\n\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return Conv2DDerFilterProgram; +}()); +exports.Conv2DDerFilterProgram = Conv2DDerFilterProgram; +var Conv2DDerInputProgram = (function () { + function Conv2DDerInputProgram(convInfo) { + this.variableNames = ['dy', 'W']; + this.outputShape = convInfo.inShape; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + this.userCode = "\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + strideHeight + ".0;\n\n if (dyR < 0.0 || dyR >= " + convInfo.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = " + filterHeight + " - 1 - wR;\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + strideWidth + ".0;\n\n if (dyC < 0.0 || dyC >= " + convInfo.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = " + filterWidth + " - 1 - wC;\n\n for (int d2 = 0; d2 < " + convInfo.outChannels + "; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return Conv2DDerInputProgram; +}()); +exports.Conv2DDerInputProgram = Conv2DDerInputProgram; +//# sourceMappingURL=conv_backprop_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu.js.map new file mode 100644 index 0000000..6509884 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv_backprop_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/conv_backprop_gpu.ts"],"names":[],"mappings":";;AAoBA;IAKE,gCAAY,QAAoB;QAJhC,kBAAa,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAK1B,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QAExC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACzC,IAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC;QACpC,IAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QAEtC,IAAI,CAAC,QAAQ,GAAG,yYAYU,QAAQ,CAAC,SAAS,kDACd,QAAQ,CAAC,SAAS,kDACnB,YAAY,WAAM,MAAM,6CAEvB,QAAQ,CAAC,QAAQ,yFAIf,QAAQ,CAAC,QAAQ,oDAClB,WAAW,WAAM,OAAO,+CAEvB,QAAQ,CAAC,OAAO,+RAY/C,CAAC;IACJ,CAAC;IACH,6BAAC;AAAD,CAAC,AAlDD,IAkDC;AAlDY,wDAAsB;AAoDnC;IAKE,+BAAY,QAAoB;QAJhC,kBAAa,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAK1B,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC;QAEpC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACzC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QAEzC,IAAM,MAAM,GAAG,YAAY,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC;QACvD,IAAM,OAAO,GAAG,WAAW,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QAExD,IAAI,CAAC,QAAQ,GAAG,sCACa,MAAM,UAAK,OAAO,ydAcnB,YAAY,iEACI,YAAY,iDAExB,QAAQ,CAAC,SAAS,gIAK7B,YAAY,sDAEH,WAAW,mEACK,WAAW,mDAEvB,QAAQ,CAAC,QAAQ,yJAM5B,WAAW,wDAEF,QAAQ,CAAC,WAAW,oQASnD,CAAC;IACJ,CAAC;IACH,4BAAC;AAAD,CAAC,AA/DD,IA+DC;AA/DY,sDAAqB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu_depthwise.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu_depthwise.d.ts new file mode 100644 index 0000000..4a0ab6e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu_depthwise.d.ts @@ -0,0 +1,14 @@ +import { Conv2DInfo } from '../../ops/conv_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class DepthwiseConv2DDerFilterProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(convInfo: Conv2DInfo); +} +export declare class DepthwiseConv2DDerInputProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(convInfo: Conv2DInfo); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu_depthwise.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu_depthwise.js new file mode 100644 index 0000000..47cb27e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu_depthwise.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var DepthwiseConv2DDerFilterProgram = (function () { + function DepthwiseConv2DDerFilterProgram(convInfo) { + this.variableNames = ['x', 'dy']; + this.outputShape = convInfo.filterShape; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + var channelMul = convInfo.outChannels / convInfo.inChannels; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * " + channelMul + " + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < " + convInfo.batchSize + "; b++) {\n for (int yR = 0; yR < " + convInfo.outHeight + "; yR++) {\n int xR = wR + yR * " + strideHeight + " - " + padTop + ";\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int yC = 0; yC < " + convInfo.outWidth + "; yC++) {\n int xC = wC + yC * " + strideWidth + " - " + padLeft + ";\n\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return DepthwiseConv2DDerFilterProgram; +}()); +exports.DepthwiseConv2DDerFilterProgram = DepthwiseConv2DDerFilterProgram; +var DepthwiseConv2DDerInputProgram = (function () { + function DepthwiseConv2DDerInputProgram(convInfo) { + this.variableNames = ['dy', 'W']; + this.outputShape = convInfo.inShape; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var channelMul = convInfo.outChannels / convInfo.inChannels; + this.userCode = "\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + strideHeight + ".0;\n\n if (dyR < 0.0 || dyR >= " + convInfo.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = " + filterHeight + " - 1 - wR;\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + strideWidth + ".0;\n\n if (dyC < 0.0 || dyC >= " + convInfo.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = " + filterWidth + " - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < " + channelMul + "; dm++) {\n int d2 = d1 * " + channelMul + " + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return DepthwiseConv2DDerInputProgram; +}()); +exports.DepthwiseConv2DDerInputProgram = DepthwiseConv2DDerInputProgram; +//# sourceMappingURL=conv_backprop_gpu_depthwise.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu_depthwise.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu_depthwise.js.map new file mode 100644 index 0000000..d82a2a9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_backprop_gpu_depthwise.js.map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AM,GAAG,YAAY,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC;QACvD,IAAM,OAAO,GAAG,WAAW,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QACxD,IAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC;QAE9D,IAAI,CAAC,QAAQ,GAAG,sCACa,MAAM,UAAK,OAAO,iUAYnB,YAAY,iEACI,YAAY,iDAExB,QAAQ,CAAC,SAAS,gIAK7B,YAAY,sDAEH,WAAW,mEACK,WAAW,mDAEvB,QAAQ,CAAC,QAAQ,yJAM5B,WAAW,uGAGF,UAAU,+CAChB,UAAU,iQASnC,CAAC;IACJ,CAAC;IACH,qCAAC;AAAD,CAAC,AAhED,IAgEC;AAhEY,wEAA8B"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu.d.ts new file mode 100644 index 0000000..4e4cbbe --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu.d.ts @@ -0,0 +1,8 @@ +import { Conv2DInfo } from '../../ops/conv_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class Conv2DProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(convInfo: Conv2DInfo); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu.js new file mode 100644 index 0000000..0ce1246 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Conv2DProgram = (function () { + function Conv2DProgram(convInfo) { + this.variableNames = ['x', 'W']; + this.outputShape = convInfo.outShape; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var inputDepthNearestVec4 = Math.floor(convInfo.inChannels / 4) * 4; + var inputDepthVec4Remainder = convInfo.inChannels % 4; + this.userCode = "\n const ivec2 strides = ivec2(" + strideHeight + ", " + strideWidth + ");\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n int xR = xRCorner + wR * " + dilationHeight + ";\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n int xC = xCCorner + wC * " + dilationWidth + ";\n\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n continue;\n }\n\n for (int d1 = 0; d1 < " + inputDepthNearestVec4 + "; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (" + (inputDepthVec4Remainder === 1) + ") {\n dotProd +=\n getX(batch, xR, xC, " + inputDepthNearestVec4 + ") *\n getW(wR, wC, " + inputDepthNearestVec4 + ", d2);\n } else if (" + (inputDepthVec4Remainder === 2) + ") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, " + inputDepthNearestVec4 + "),\n getX(batch, xR, xC, " + inputDepthNearestVec4 + " + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, " + inputDepthNearestVec4 + ", d2),\n getW(wR, wC, " + inputDepthNearestVec4 + " + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (" + (inputDepthVec4Remainder === 3) + ") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, " + inputDepthNearestVec4 + "),\n getX(batch, xR, xC, " + inputDepthNearestVec4 + " + 1),\n getX(batch, xR, xC, " + inputDepthNearestVec4 + " + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, " + inputDepthNearestVec4 + ", d2),\n getW(wR, wC, " + inputDepthNearestVec4 + " + 1, d2),\n getW(wR, wC, " + inputDepthNearestVec4 + " + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return Conv2DProgram; +}()); +exports.Conv2DProgram = Conv2DProgram; +//# sourceMappingURL=conv_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu.js.map new file mode 100644 index 0000000..35e583f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/conv_gpu.ts"],"names":[],"mappings":";;AAoBA;IAKE,uBAAY,QAAoB;QAJhC,kBAAa,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAKzB,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC;QACrC,IAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC;QACpC,IAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QACtC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACzC,IAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;QAC/C,IAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;QAC7C,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QAEzC,IAAM,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACtE,IAAM,uBAAuB,GAAG,QAAQ,CAAC,UAAU,GAAG,CAAC,CAAC;QAExD,IAAI,CAAC,QAAQ,GAAG,yCACgB,YAAY,UAAK,WAAW,2CAC/B,MAAM,UAAK,OAAO,8dAcnB,YAAY,sDACP,cAAc,2CAEnB,QAAQ,CAAC,QAAQ,mFAIf,WAAW,wDACN,aAAa,6CAElB,QAAQ,CAAC,OAAO,yFAId,qBAAqB,ijBAiBvC,uBAAuB,KAAK,CAAC,4EAET,qBAAqB,0CAC5B,qBAAqB,wCAC3B,uBAAuB,KAAK,CAAC,sFAEhB,qBAAqB,gDACrB,qBAAqB,kGAG5B,qBAAqB,6CACrB,qBAAqB,8GAG3B,uBAAuB,KAAK,CAAC,sFAEhB,qBAAqB,gDACrB,qBAAqB,oDACrB,qBAAqB,kGAG5B,qBAAqB,6CACrB,qBAAqB,iDACrB,qBAAqB,oKAQ/C,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAnGD,IAmGC;AAnGY,sCAAa"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu_depthwise.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu_depthwise.d.ts new file mode 100644 index 0000000..8efdb62 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu_depthwise.d.ts @@ -0,0 +1,8 @@ +import { Conv2DInfo } from '../../ops/conv_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class DepthwiseConv2DProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(convInfo: Conv2DInfo); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu_depthwise.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu_depthwise.js new file mode 100644 index 0000000..1ffb6c6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu_depthwise.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var DepthwiseConv2DProgram = (function () { + function DepthwiseConv2DProgram(convInfo) { + this.variableNames = ['x', 'W']; + this.outputShape = convInfo.outShape; + var xNumRows = convInfo.inHeight; + var xNumCols = convInfo.inWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var channelMul = convInfo.outChannels / convInfo.inChannels; + this.userCode = "\n const ivec2 strides = ivec2(" + strideHeight + ", " + strideWidth + ");\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / " + channelMul + ";\n int q = d2 - d1 * " + channelMul + ";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n int xR = xRCorner + wR * " + dilationHeight + ";\n\n if (xR < 0 || xR >= " + xNumRows + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n int xC = xCCorner + wC * " + dilationWidth + ";\n\n if (xC < 0 || xC >= " + xNumCols + ") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n "; + } + return DepthwiseConv2DProgram; +}()); +exports.DepthwiseConv2DProgram = DepthwiseConv2DProgram; +//# sourceMappingURL=conv_gpu_depthwise.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu_depthwise.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu_depthwise.js.map new file mode 100644 index 0000000..d63f2f0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/conv_gpu_depthwise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv_gpu_depthwise.js","sourceRoot":"","sources":["../../../src/kernels/webgl/conv_gpu_depthwise.ts"],"names":[],"mappings":";;AAoBA;IAKE,gCAAY,QAAoB;QAJhC,kBAAa,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAKzB,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC;QAErC,IAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;QACnC,IAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC;QAClC,IAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC;QACpC,IAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QACtC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACzC,IAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;QAC/C,IAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;QAC7C,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACzC,IAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC;QAE9D,IAAI,CAAC,QAAQ,GAAG,yCACgB,YAAY,UAAK,WAAW,2CAC/B,MAAM,UAAK,OAAO,sNAO3B,UAAU,qCACN,UAAU,qXASN,YAAY,sDACP,cAAc,2CAEnB,QAAQ,mFAIN,WAAW,wDACN,aAAa,6CAElB,QAAQ,6PAWrC,CAAC;IACJ,CAAC;IACH,6BAAC;AAAD,CAAC,AA9DD,IA8DC;AA9DY,wDAAsB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/cumsum_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/cumsum_gpu.d.ts new file mode 100644 index 0000000..f708f96 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/cumsum_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class CumSumProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(shape: number[], exclusive: boolean, reverse: boolean); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/cumsum_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/cumsum_gpu.js new file mode 100644 index 0000000..9ca0f0f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/cumsum_gpu.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var shader_compiler_1 = require("./shader_compiler"); +var CumSumProgram = (function () { + function CumSumProgram(shape, exclusive, reverse) { + this.variableNames = ['x']; + this.outputShape = shape; + var rank = shape.length; + var finalDim = shape[shape.length - 1]; + var comparator = reverse ? '<' : '>'; + this.userCode = "\n int getIndex(int i) {\n " + (reverse ? "return " + finalDim + " -i - 1;" : 'return i;') + "\n }\n\n void main() {\n " + shader_compiler_1.getCoordsDataType(rank) + " coords = getOutputCoords();\n int end = " + getFinalCoord(rank, 'coords') + ";\n float val = 0.0;\n for (int i = " + finalDim + " - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx " + comparator + " end) {\n continue;\n }\n if (idx == end && " + exclusive + ") {\n continue;\n }\n " + getFinalCoord(rank, 'coords') + " = idx;\n val += getX(" + getCoords(rank, 'coords') + ");\n }\n setOutput(val);\n }\n "; + } + return CumSumProgram; +}()); +exports.CumSumProgram = CumSumProgram; +function getCoords(rank, name) { + if (rank === 1) { + return "" + name; + } + else if (rank === 2) { + return name + ".x, " + name + ".y"; + } + else if (rank === 3) { + return name + ".x, " + name + ".y, " + name + ".z"; + } + else if (rank === 4) { + return name + ".x, " + name + ".y, " + name + ".z, " + name + ".w"; + } + else { + throw Error("Cumulative sum for rank " + rank + " is not yet supported"); + } +} +function getFinalCoord(rank, name) { + if (rank === 1) { + return "" + name; + } + else if (rank === 2) { + return name + ".y"; + } + else if (rank === 3) { + return name + ".z"; + } + else if (rank === 4) { + return name + ".w"; + } + else { + throw Error("Cumulative sum for rank " + rank + " is not yet supported"); + } +} +//# sourceMappingURL=cumsum_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/cumsum_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/cumsum_gpu.js.map new file mode 100644 index 0000000..d056393 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/cumsum_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cumsum_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/cumsum_g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BAAuB,CAAC,CAAC;KACrE;AACH,CAAC;AAED,uBAAuB,IAAY,EAAE,IAAY;IAC/C,IAAI,IAAI,KAAK,CAAC,EAAE;QACd,OAAO,KAAG,IAAM,CAAC;KAClB;SAAM,IAAI,IAAI,KAAK,CAAC,EAAE;QACrB,OAAU,IAAI,OAAI,CAAC;KACpB;SAAM,IAAI,IAAI,KAAK,CAAC,EAAE;QACrB,OAAU,IAAI,OAAI,CAAC;KACpB;SAAM,IAAI,IAAI,KAAK,CAAC,EAAE;QACrB,OAAU,IAAI,OAAI,CAAC;KACpB;SAAM;QACL,MAAM,KAAK,CAAC,6BAA2B,IAAI,0BAAuB,CAAC,CAAC;KACrE;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/encode_float_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/encode_float_gpu.d.ts new file mode 100644 index 0000000..54b72fc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/encode_float_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class EncodeFloatProgram implements GPGPUProgram { + variableNames: string[]; + userCode: string; + outputShape: number[]; + constructor(outputShape: number[]); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/encode_float_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/encode_float_gpu.js new file mode 100644 index 0000000..9f724b3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/encode_float_gpu.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var EncodeFloatProgram = (function () { + function EncodeFloatProgram(outputShape) { + this.variableNames = ['A']; + this.outputShape = outputShape; + this.userCode = "\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n gl_FragColor = encode_float(x);\n }\n "; + } + return EncodeFloatProgram; +}()); +exports.EncodeFloatProgram = EncodeFloatProgram; +//# sourceMappingURL=encode_float_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/encode_float_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/encode_float_gpu.js.map new file mode 100644 index 0000000..0f4b518 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/encode_float_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"encode_float_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/encode_float_gpu.ts"],"names":[],"mappings":";;AAmBA;IAKE,4BAAY,WAAqB;QAJjC,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAKpB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,gqCA4Cf,CAAC;IACJ,CAAC;IACH,yBAAC;AAAD,CAAC,AArDD,IAqDC;AArDY,gDAAkB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/from_pixels_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/from_pixels_gpu.d.ts new file mode 100644 index 0000000..1cfba93 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/from_pixels_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class FromPixelsProgram implements GPGPUProgram { + variableNames: string[]; + userCode: string; + outputShape: number[]; + constructor(outputShape: number[]); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/from_pixels_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/from_pixels_gpu.js new file mode 100644 index 0000000..e0c8a20 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/from_pixels_gpu.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var FromPixelsProgram = (function () { + function FromPixelsProgram(outputShape) { + this.variableNames = ['A']; + var height = outputShape[0], width = outputShape[1]; + this.outputShape = outputShape; + this.userCode = "\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(" + width + ".0, " + height + ".0);\n\n vec4 values = texture2D(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n "; + } + return FromPixelsProgram; +}()); +exports.FromPixelsProgram = FromPixelsProgram; +//# sourceMappingURL=from_pixels_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/from_pixels_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/from_pixels_gpu.js.map new file mode 100644 index 0000000..eedb16e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/from_pixels_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"from_pixels_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/from_pixels_gpu.ts"],"names":[],"mappings":";;AAmBA;IAKE,2BAAY,WAAqB;QAJjC,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAKb,IAAA,uBAAM,EAAE,sBAAK,CAAkB;QACtC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,0NAMmC,KAAK,YAAO,MAAM,2YAgBpE,CAAC;IACJ,CAAC;IACH,wBAAC;AAAD,CAAC,AAhCD,IAgCC;AAhCY,8CAAiB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gather_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gather_gpu.d.ts new file mode 100644 index 0000000..5ca9d41 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gather_gpu.d.ts @@ -0,0 +1,8 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class GatherProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + rank: number; + constructor(aShape: number[], indicesLength: number, axis: number); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gather_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gather_gpu.js new file mode 100644 index 0000000..2d70034 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gather_gpu.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var shader_compiler_1 = require("./shader_compiler"); +var GatherProgram = (function () { + function GatherProgram(aShape, indicesLength, axis) { + this.variableNames = ['A', 'indices']; + var outputShape = aShape.slice(); + outputShape[axis] = indicesLength; + this.outputShape = outputShape; + this.rank = outputShape.length; + var dtype = shader_compiler_1.getCoordsDataType(this.rank); + var sourceCoords = getSourceCoords(aShape, axis); + this.userCode = "\n void main() {\n " + dtype + " resRC = getOutputCoords();\n setOutput(getA(" + sourceCoords + "));\n }\n "; + } + return GatherProgram; +}()); +exports.GatherProgram = GatherProgram; +function getSourceCoords(aShape, axis) { + var rank = aShape.length; + if (rank > 4) { + throw Error("Gather for rank " + rank + " is not yet supported"); + } + if (rank === 1) { + return "int(getIndices(resRC))"; + } + var currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w']; + var sourceCoords = []; + for (var i = 0; i < aShape.length; i++) { + if (i === axis) { + sourceCoords.push("int(getIndices(" + currentCoords[i] + "))"); + } + else { + sourceCoords.push("" + currentCoords[i]); + } + } + return sourceCoords.join(); +} +//# sourceMappingURL=gather_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gather_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gather_gpu.js.map new file mode 100644 index 0000000..eb5fed5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gather_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gather_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/gather_gpu.ts"],"names":[],"mappings":";;AAkBA,qDAAoD;AAEpD;IAME,uBAAY,MAAgB,EAAE,aAAqB,EAAE,IAAY;QALjE,kBAAa,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAM/B,IAAM,WAAW,GAAa,MAAM,CAAC,KAAK,EAAE,CAAC;QAC7C,WAAW,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC;QAC/B,IAAM,KAAK,GAAG,mCAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAM,YAAY,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEnD,IAAI,CAAC,QAAQ,GAAG,oCAEV,KAAK,4DACU,YAAY,uBAEhC,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AArBD,IAqBC;AArBY,sCAAa;AAuB1B,yBAAyB,MAAgB,EAAE,IAAY;IACrD,IAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3B,IAAI,IAAI,GAAG,CAAC,EAAE;QACZ,MAAM,KAAK,CAAC,qBAAmB,IAAI,0BAAuB,CAAC,CAAC;KAC7D;IACD,IAAI,IAAI,KAAK,CAAC,EAAE;QACd,OAAO,wBAAwB,CAAC;KACjC;IAED,IAAM,aAAa,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAEnE,IAAM,YAAY,GAAG,EAAE,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,CAAC,KAAK,IAAI,EAAE;YACd,YAAY,CAAC,IAAI,CAAC,oBAAkB,aAAa,CAAC,CAAC,CAAC,OAAI,CAAC,CAAC;SAC3D;aAAM;YACL,YAAY,CAAC,IAAI,CAAC,KAAG,aAAa,CAAC,CAAC,CAAG,CAAC,CAAC;SAC1C;KACF;IACD,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC;AAC7B,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.d.ts new file mode 100644 index 0000000..a91e221 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.d.ts @@ -0,0 +1,79 @@ +/// +/// +import { WebGL1DisjointQueryTimerExtension, WebGL2DisjointQueryTimerExtension } from './webgl_types'; +export interface FenceContext { + query: WebGLQuery | WebGLSync; + isFencePassed(): boolean; +} +export declare class GPGPUContext { + gl: WebGLRenderingContext; + textureFloatExtension: {}; + textureHalfFloatExtension: {}; + colorBufferFloatExtension: {}; + colorBufferHalfFloatExtension: {}; + getBufferSubDataAsyncExtension: {}; + loseContextExtension: WebGLLoseContext; + disjointQueryTimerExtension: WebGL2DisjointQueryTimerExtension | WebGL1DisjointQueryTimerExtension; + vertexBuffer: WebGLBuffer; + indexBuffer: WebGLBuffer; + framebuffer: WebGLFramebuffer; + outputTexture: WebGLTexture | null; + program: WebGLProgram | null; + private disposed; + private autoDebugValidate; + private disjoint; + private textureConfig; + constructor(gl?: WebGLRenderingContext); + dispose(): void; + enableAutomaticDebugValidation(enabled: boolean): void; + createFloat32MatrixTexture(rows: number, columns: number): WebGLTexture; + createFloat16MatrixTexture(rows: number, columns: number): WebGLTexture; + createUnsignedBytesMatrixTexture(rows: number, columns: number): WebGLTexture; + uploadPixelDataToTexture(texture: WebGLTexture, pixels: ImageData | HTMLImageElement | HTMLCanvasElement): void; + createPackedMatrixTexture(rows: number, columns: number): WebGLTexture; + deleteMatrixTexture(texture: WebGLTexture): void; + uploadMatrixToTexture(texture: WebGLTexture, rows: number, columns: number, matrix: Float32Array): void; + uploadMatrixToPackedTexture(texture: WebGLTexture, rows: number, columns: number, matrix: Float32Array): void; + downloadFloat32MatrixFromOutputTexture(texture: WebGLTexture, rows: number, columns: number): Float32Array; + downloadByteEncodedFloatMatrixFromOutputTexture(texture: WebGLTexture, rows: number, columns: number): Float32Array; + downloadFloat32MatrixFromBuffer(buffer: WebGLBuffer, rows: number, columns: number): Float32Array; + maybeCreateBufferFromTexture(texture: WebGLTexture, rows: number, columns: number): WebGLBuffer | WebGLTexture; + createAndWaitForFence(): Promise; + private createFence; + downloadMatrixFromPackedTexture(texture: WebGLTexture, rows: number, columns: number): Float32Array; + private vertexAttrsAreBound; + createProgram(fragmentShaderSource: string): WebGLProgram; + deleteProgram(program: WebGLProgram): void; + setProgram(program: WebGLProgram | null): void; + getUniformLocation(program: WebGLProgram, uniformName: string, shouldThrow?: boolean): WebGLUniformLocation; + getAttributeLocation(program: WebGLProgram, attribute: string): number; + getUniformLocationNoThrow(program: WebGLProgram, uniformName: string): WebGLUniformLocation; + setInputMatrixTexture(inputMatrixTexture: WebGLTexture, uniformLocation: WebGLUniformLocation, textureUnit: number): void; + setOutputMatrixTexture(outputMatrixTexture: WebGLTexture, rows: number, columns: number): void; + setOutputPackedMatrixTexture(outputPackedMatrixTexture: WebGLTexture, rows: number, columns: number): void; + setOutputMatrixWriteRegion(startRow: number, numRows: number, startColumn: number, numColumns: number): void; + setOutputPackedMatrixWriteRegion(startRow: number, numRows: number, startColumn: number, numColumns: number): void; + debugValidate(): void; + executeProgram(): void; + blockUntilAllProgramsCompleted(): void; + private getQueryTimerExtension; + private getQueryTimerExtensionWebGL2; + private getQueryTimerExtensionWebGL1; + beginQuery(): WebGLQuery; + endQuery(): void; + waitForQueryAndGetTime(query: WebGLQuery): Promise; + private getQueryTime; + private isQueryAvailable; + pollFence(fenceContext: FenceContext): Promise; + private itemsToPoll; + pollItems(): void; + private addItemToPoll; + private bindTextureToFrameBuffer; + private unbindTextureToFrameBuffer; + private downloadMatrixDriver; + private setOutputMatrixTextureDriver; + private setOutputMatrixWriteRegionDriver; + private throwIfDisposed; + private throwIfNoProgram; +} +export declare function binSearchLastTrue(arr: Array<() => boolean>): number; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.js new file mode 100644 index 0000000..c02790e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.js @@ -0,0 +1,479 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../../environment"); +var util = require("../../util"); +var gpgpu_util = require("./gpgpu_util"); +var tex_util = require("./tex_util"); +var webgl_util = require("./webgl_util"); +var GPGPUContext = (function () { + function GPGPUContext(gl) { + this.outputTexture = null; + this.program = null; + this.disposed = false; + this.autoDebugValidate = false; + this.vertexAttrsAreBound = false; + this.itemsToPoll = []; + if (gl != null) { + this.gl = gl; + } + else { + this.gl = gpgpu_util.createWebGLContext(); + } + if (environment_1.ENV.get('WEBGL_VERSION') === 1) { + this.textureFloatExtension = + webgl_util.getExtensionOrThrow(this.gl, 'OES_texture_float'); + this.colorBufferFloatExtension = + this.gl.getExtension('WEBGL_color_buffer_float'); + if (!environment_1.ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) { + this.textureHalfFloatExtension = + webgl_util.getExtensionOrThrow(this.gl, 'OES_texture_half_float'); + this.colorBufferHalfFloatExtension = + this.gl.getExtension('EXT_color_buffer_half_float'); + } + } + else { + this.colorBufferFloatExtension = + webgl_util.getExtensionOrThrow(this.gl, 'EXT_color_buffer_float'); + } + this.loseContextExtension = + webgl_util.getExtensionOrThrow(this.gl, 'WEBGL_lose_context'); + this.vertexBuffer = gpgpu_util.createVertexBuffer(this.gl); + this.indexBuffer = gpgpu_util.createIndexBuffer(this.gl); + this.framebuffer = webgl_util.createFramebuffer(this.gl); + this.textureConfig = + gpgpu_util.getTextureConfig(this.gl, this.textureHalfFloatExtension); + } + GPGPUContext.prototype.dispose = function () { + var _this = this; + if (this.disposed) { + return; + } + if (this.program != null) { + console.warn('Disposing a GPGPUContext that still has a bound WebGLProgram.' + + ' This is probably a resource leak, delete the program with ' + + 'GPGPUContext.deleteProgram before disposing.'); + } + if (this.outputTexture != null) { + console.warn('Disposing a GPGPUContext that still has a bound output matrix ' + + 'texture. This is probably a resource leak, delete the output ' + + 'matrix texture with GPGPUContext.deleteMatrixTexture before ' + + 'disposing.'); + } + var gl = this.gl; + webgl_util.callAndCheck(gl, function () { return gl.finish(); }); + webgl_util.callAndCheck(gl, function () { return gl.bindFramebuffer(gl.FRAMEBUFFER, null); }); + webgl_util.callAndCheck(gl, function () { return gl.deleteFramebuffer(_this.framebuffer); }); + webgl_util.callAndCheck(gl, function () { return gl.bindBuffer(gl.ARRAY_BUFFER, null); }); + webgl_util.callAndCheck(gl, function () { return gl.deleteBuffer(_this.vertexBuffer); }); + webgl_util.callAndCheck(gl, function () { return gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); }); + webgl_util.callAndCheck(gl, function () { return gl.deleteBuffer(_this.indexBuffer); }); + this.loseContextExtension.loseContext(); + this.disposed = true; + }; + GPGPUContext.prototype.enableAutomaticDebugValidation = function (enabled) { + this.autoDebugValidate = enabled; + webgl_util.enableDebugWebGLErrorChecking(enabled); + }; + GPGPUContext.prototype.createFloat32MatrixTexture = function (rows, columns) { + this.throwIfDisposed(); + return gpgpu_util.createFloat32MatrixTexture(this.gl, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.createFloat16MatrixTexture = function (rows, columns) { + this.throwIfDisposed(); + return gpgpu_util.createFloat16MatrixTexture(this.gl, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.createUnsignedBytesMatrixTexture = function (rows, columns) { + this.throwIfDisposed(); + return gpgpu_util.createUnsignedBytesMatrixTexture(this.gl, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.uploadPixelDataToTexture = function (texture, pixels) { + this.throwIfDisposed(); + gpgpu_util.uploadPixelDataToTexture(this.gl, texture, pixels); + }; + GPGPUContext.prototype.createPackedMatrixTexture = function (rows, columns) { + this.throwIfDisposed(); + return gpgpu_util.createPackedMatrixTexture(this.gl, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.deleteMatrixTexture = function (texture) { + var _this = this; + this.throwIfDisposed(); + if (this.outputTexture === texture) { + webgl_util.unbindColorTextureFromFramebuffer(this.gl, this.framebuffer); + this.outputTexture = null; + } + webgl_util.callAndCheck(this.gl, function () { return _this.gl.deleteTexture(texture); }); + }; + GPGPUContext.prototype.uploadMatrixToTexture = function (texture, rows, columns, matrix) { + this.throwIfDisposed(); + var numChannels = webgl_util.getNumChannels(); + return gpgpu_util.uploadMatrixToTexture(this.gl, texture, rows, columns, matrix, numChannels, this.textureConfig); + }; + GPGPUContext.prototype.uploadMatrixToPackedTexture = function (texture, rows, columns, matrix) { + this.throwIfDisposed(); + return gpgpu_util.uploadMatrixToPackedTexture(this.gl, texture, rows, columns, matrix, this.textureConfig); + }; + GPGPUContext.prototype.downloadFloat32MatrixFromOutputTexture = function (texture, rows, columns) { + var _this = this; + return this.downloadMatrixDriver(texture, function () { return gpgpu_util.downloadFloat32MatrixFromOutputTexture(_this.gl, rows, columns, _this.textureConfig); }); + }; + GPGPUContext.prototype.downloadByteEncodedFloatMatrixFromOutputTexture = function (texture, rows, columns) { + var _this = this; + return this.downloadMatrixDriver(texture, function () { return gpgpu_util.downloadByteEncodedFloatMatrixFromOutputTexture(_this.gl, rows, columns, _this.textureConfig); }); + }; + GPGPUContext.prototype.downloadFloat32MatrixFromBuffer = function (buffer, rows, columns) { + return gpgpu_util.downloadFloat32MatrixFromBuffer(this.gl, buffer, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.maybeCreateBufferFromTexture = function (texture, rows, columns) { + this.bindTextureToFrameBuffer(texture); + var result = gpgpu_util.maybeCreateBufferFromOutputTexture(this.gl, texture, rows, columns, this.textureConfig); + this.unbindTextureToFrameBuffer(); + return result; + }; + GPGPUContext.prototype.createAndWaitForFence = function () { + var fenceContext = this.createFence(this.gl); + return this.pollFence(fenceContext); + }; + GPGPUContext.prototype.createFence = function (gl) { + var _this = this; + var query; + var isFencePassed; + if (environment_1.ENV.get('WEBGL_FENCE_API_ENABLED')) { + var gl2_1 = gl; + var sync_1 = gl2_1.fenceSync(gl2_1.SYNC_GPU_COMMANDS_COMPLETE, 0); + gl.flush(); + isFencePassed = function () { + var status = gl2_1.clientWaitSync(sync_1, 0, 0); + return status === gl2_1.ALREADY_SIGNALED || + status === gl2_1.CONDITION_SATISFIED; + }; + query = sync_1; + } + else if (environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) { + query = this.beginQuery(); + this.endQuery(); + isFencePassed = function () { return _this.isQueryAvailable(query, environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')); }; + } + else { + isFencePassed = function () { return true; }; + } + return { query: query, isFencePassed: isFencePassed }; + }; + GPGPUContext.prototype.downloadMatrixFromPackedTexture = function (texture, rows, columns) { + var _this = this; + return this.downloadMatrixDriver(texture, function () { return gpgpu_util.downloadMatrixFromPackedOutputTexture(_this.gl, rows, columns, _this.textureConfig); }); + }; + GPGPUContext.prototype.createProgram = function (fragmentShaderSource) { + this.throwIfDisposed(); + var gl = this.gl; + var fragmentShader = webgl_util.createFragmentShader(gl, fragmentShaderSource); + var vertexShader = gpgpu_util.createVertexShader(gl); + var program = webgl_util.createProgram(gl); + webgl_util.callAndCheck(gl, function () { return gl.attachShader(program, vertexShader); }); + webgl_util.callAndCheck(gl, function () { return gl.attachShader(program, fragmentShader); }); + webgl_util.linkProgram(gl, program); + if (this.autoDebugValidate) { + webgl_util.validateProgram(gl, program); + } + if (!this.vertexAttrsAreBound) { + this.setProgram(program); + this.vertexAttrsAreBound = gpgpu_util.bindVertexProgramAttributeStreams(gl, this.program, this.vertexBuffer); + } + return program; + }; + GPGPUContext.prototype.deleteProgram = function (program) { + var _this = this; + this.throwIfDisposed(); + if (program === this.program) { + this.program = null; + } + if (program != null) { + webgl_util.callAndCheck(this.gl, function () { return _this.gl.deleteProgram(program); }); + } + }; + GPGPUContext.prototype.setProgram = function (program) { + var _this = this; + this.throwIfDisposed(); + this.program = program; + if ((this.program != null) && this.autoDebugValidate) { + webgl_util.validateProgram(this.gl, this.program); + } + webgl_util.callAndCheck(this.gl, function () { return _this.gl.useProgram(program); }); + }; + GPGPUContext.prototype.getUniformLocation = function (program, uniformName, shouldThrow) { + if (shouldThrow === void 0) { shouldThrow = true; } + this.throwIfDisposed(); + if (shouldThrow) { + return webgl_util.getProgramUniformLocationOrThrow(this.gl, program, uniformName); + } + else { + return webgl_util.getProgramUniformLocation(this.gl, program, uniformName); + } + }; + GPGPUContext.prototype.getAttributeLocation = function (program, attribute) { + var _this = this; + this.throwIfDisposed(); + return webgl_util.callAndCheck(this.gl, function () { return _this.gl.getAttribLocation(program, attribute); }); + }; + GPGPUContext.prototype.getUniformLocationNoThrow = function (program, uniformName) { + this.throwIfDisposed(); + return this.gl.getUniformLocation(program, uniformName); + }; + GPGPUContext.prototype.setInputMatrixTexture = function (inputMatrixTexture, uniformLocation, textureUnit) { + this.throwIfDisposed(); + this.throwIfNoProgram(); + webgl_util.bindTextureToProgramUniformSampler(this.gl, this.program, inputMatrixTexture, uniformLocation, textureUnit); + }; + GPGPUContext.prototype.setOutputMatrixTexture = function (outputMatrixTexture, rows, columns) { + this.setOutputMatrixTextureDriver(outputMatrixTexture, columns, rows); + }; + GPGPUContext.prototype.setOutputPackedMatrixTexture = function (outputPackedMatrixTexture, rows, columns) { + this.throwIfDisposed(); + var _a = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + this.setOutputMatrixTextureDriver(outputPackedMatrixTexture, width, height); + }; + GPGPUContext.prototype.setOutputMatrixWriteRegion = function (startRow, numRows, startColumn, numColumns) { + this.setOutputMatrixWriteRegionDriver(startColumn, startRow, numColumns, numRows); + }; + GPGPUContext.prototype.setOutputPackedMatrixWriteRegion = function (startRow, numRows, startColumn, numColumns) { + throw new Error('setOutputPackedMatrixWriteRegion not implemented.'); + }; + GPGPUContext.prototype.debugValidate = function () { + if (this.program != null) { + webgl_util.validateProgram(this.gl, this.program); + } + webgl_util.validateFramebuffer(this.gl); + }; + GPGPUContext.prototype.executeProgram = function () { + this.throwIfDisposed(); + this.throwIfNoProgram(); + var gl = this.gl; + if (this.autoDebugValidate) { + this.debugValidate(); + } + webgl_util.callAndCheck(gl, function () { return gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0); }); + }; + GPGPUContext.prototype.blockUntilAllProgramsCompleted = function () { + var _this = this; + this.throwIfDisposed(); + webgl_util.callAndCheck(this.gl, function () { return _this.gl.finish(); }); + }; + GPGPUContext.prototype.getQueryTimerExtension = function () { + if (this.disjointQueryTimerExtension == null) { + this.disjointQueryTimerExtension = + webgl_util.getExtensionOrThrow(this.gl, environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2 ? + 'EXT_disjoint_timer_query_webgl2' : + 'EXT_disjoint_timer_query'); + } + return this.disjointQueryTimerExtension; + }; + GPGPUContext.prototype.getQueryTimerExtensionWebGL2 = function () { + return this.getQueryTimerExtension(); + }; + GPGPUContext.prototype.getQueryTimerExtensionWebGL1 = function () { + return this.getQueryTimerExtension(); + }; + GPGPUContext.prototype.beginQuery = function () { + if (environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) { + var gl2 = this.gl; + var ext_1 = this.getQueryTimerExtensionWebGL2(); + var query_1 = gl2.createQuery(); + gl2.beginQuery(ext_1.TIME_ELAPSED_EXT, query_1); + return query_1; + } + var ext = this.getQueryTimerExtensionWebGL1(); + var query = ext.createQueryEXT(); + ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query); + return query; + }; + GPGPUContext.prototype.endQuery = function () { + if (environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) { + var gl2 = this.gl; + var ext_2 = this.getQueryTimerExtensionWebGL2(); + gl2.endQuery(ext_2.TIME_ELAPSED_EXT); + return; + } + var ext = this.getQueryTimerExtensionWebGL1(); + ext.endQueryEXT(ext.TIME_ELAPSED_EXT); + }; + GPGPUContext.prototype.waitForQueryAndGetTime = function (query) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4, util.repeatedTry(function () { return _this.isQueryAvailable(query, environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')); })]; + case 1: + _a.sent(); + return [2, this.getQueryTime(query, environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'))]; + } + }); + }); + }; + GPGPUContext.prototype.getQueryTime = function (query, queryTimerVersion) { + if (queryTimerVersion === 0) { + return null; + } + if (queryTimerVersion === 2) { + var gl2 = this.gl; + var timeElapsedNanos = gl2.getQueryParameter(query, gl2.QUERY_RESULT); + return timeElapsedNanos / 1000000; + } + else { + var ext = this.getQueryTimerExtensionWebGL1(); + var timeElapsedNanos = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT); + return timeElapsedNanos / 1000000; + } + }; + GPGPUContext.prototype.isQueryAvailable = function (query, queryTimerVersion) { + if (queryTimerVersion === 0) { + return true; + } + if (queryTimerVersion === 2) { + var gl2 = this.gl; + var ext = this.getQueryTimerExtensionWebGL2(); + var available = gl2.getQueryParameter(query, gl2.QUERY_RESULT_AVAILABLE); + if (this.disjoint == null) { + this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT); + } + return available && !this.disjoint; + } + else { + var ext = this.getQueryTimerExtensionWebGL1(); + var available = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT); + if (this.disjoint == null) { + this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT); + } + return available && !this.disjoint; + } + }; + GPGPUContext.prototype.pollFence = function (fenceContext) { + var _this = this; + return new Promise(function (resolve) { + _this.addItemToPoll(function () { return fenceContext.isFencePassed(); }, function () { return resolve(); }); + }); + }; + GPGPUContext.prototype.pollItems = function () { + var index = binSearchLastTrue(this.itemsToPoll.map(function (x) { return x.isDoneFn; })); + for (var i = 0; i <= index; ++i) { + var resolveFn = this.itemsToPoll[i].resolveFn; + resolveFn(); + } + this.itemsToPoll = this.itemsToPoll.slice(index + 1); + }; + GPGPUContext.prototype.addItemToPoll = function (isDoneFn, resolveFn) { + var _this = this; + this.itemsToPoll.push({ isDoneFn: isDoneFn, resolveFn: resolveFn }); + if (this.itemsToPoll.length > 1) { + return; + } + util.repeatedTry(function () { + _this.pollItems(); + return _this.itemsToPoll.length === 0; + }); + }; + GPGPUContext.prototype.bindTextureToFrameBuffer = function (texture) { + this.throwIfDisposed(); + webgl_util.bindColorTextureToFramebuffer(this.gl, texture, this.framebuffer); + if (this.autoDebugValidate) { + webgl_util.validateFramebuffer(this.gl); + } + }; + GPGPUContext.prototype.unbindTextureToFrameBuffer = function () { + if (this.outputTexture != null) { + webgl_util.bindColorTextureToFramebuffer(this.gl, this.outputTexture, this.framebuffer); + if (this.autoDebugValidate) { + webgl_util.validateFramebuffer(this.gl); + } + } + else { + webgl_util.unbindColorTextureFromFramebuffer(this.gl, this.framebuffer); + } + }; + GPGPUContext.prototype.downloadMatrixDriver = function (texture, downloadAndDecode) { + this.bindTextureToFrameBuffer(texture); + var result = downloadAndDecode(); + this.unbindTextureToFrameBuffer(); + return result; + }; + GPGPUContext.prototype.setOutputMatrixTextureDriver = function (outputMatrixTextureMaybePacked, width, height) { + this.throwIfDisposed(); + var gl = this.gl; + webgl_util.bindColorTextureToFramebuffer(gl, outputMatrixTextureMaybePacked, this.framebuffer); + if (this.autoDebugValidate) { + webgl_util.validateFramebuffer(gl); + } + this.outputTexture = outputMatrixTextureMaybePacked; + webgl_util.callAndCheck(gl, function () { return gl.viewport(0, 0, width, height); }); + webgl_util.callAndCheck(gl, function () { return gl.scissor(0, 0, width, height); }); + }; + GPGPUContext.prototype.setOutputMatrixWriteRegionDriver = function (x, y, width, height) { + var _this = this; + this.throwIfDisposed(); + webgl_util.callAndCheck(this.gl, function () { return _this.gl.scissor(x, y, width, height); }); + }; + GPGPUContext.prototype.throwIfDisposed = function () { + if (this.disposed) { + throw new Error('Attempted to use disposed GPGPUContext.'); + } + }; + GPGPUContext.prototype.throwIfNoProgram = function () { + if (this.program == null) { + throw new Error('No GPU program is currently set.'); + } + }; + return GPGPUContext; +}()); +exports.GPGPUContext = GPGPUContext; +function binSearchLastTrue(arr) { + var start = 0; + var end = arr.length - 1; + var best = -1; + while (start <= end) { + var mid = (start + end) >> 1; + var isDone = arr[mid](); + if (isDone) { + best = mid; + start = mid + 1; + } + else { + end = mid - 1; + } + } + return best; +} +exports.binSearchLastTrue = binSearchLastTrue; +//# sourceMappingURL=gpgpu_context.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.js.map new file mode 100644 index 0000000..d560de2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gpgpu_context.js","sourceRoot":"","sources":["../../../src/kernels/webgl/gpgpu_context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iDAAsC;AACtC,iCAAmC;AACnC,yCAA2C;AAE3C,qCAAuC;AAEvC,yCAA2C;AAO3C;IAqBE,sBAAY,EAA0B;QARtC,kBAAa,GAAsB,IAAI,CAAC;QACxC,YAAO,GAAsB,IAAI,CAAC;QAC1B,aAAQ,GAAG,KAAK,CAAC;QACjB,sBAAiB,GAAG,KAAK,CAAC;QAwN1B,wBAAmB,GAAG,KAAK,CAAC;QAiP5B,gBAAW,GAAe,EAAE,CAAC;QAncnC,IAAI,EAAE,IAAI,IAAI,EAAE;YACd,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;SACd;aAAM;YACL,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,kBAAkB,EAAE,CAAC;SAC3C;QAED,IAAI,iBAAG,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE;YAClC,IAAI,CAAC,qBAAqB;gBACtB,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,EAAE,mBAAmB,CAAC,CAAC;YACjE,IAAI,CAAC,yBAAyB;gBAC1B,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC;YAErD,IAAI,CAAC,iBAAG,CAAC,GAAG,CAAC,8BAA8B,CAAC,EAAE;gBAC5C,IAAI,CAAC,yBAAyB;oBAC1B,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,EAAE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SACf;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAfD,8CAeC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context_test.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context_test.js new file mode 100644 index 0000000..5f5b92f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context_test.js @@ -0,0 +1,302 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var jasmine_util_1 = require("../../jasmine_util"); +var test_util_1 = require("../../test_util"); +var gpgpu_context_1 = require("./gpgpu_context"); +var tex_util = require("./tex_util"); +var DOWNLOAD_FLOAT_ENVS = { + 'WEBGL_DOWNLOAD_FLOAT_ENABLED': true +}; +jasmine_util_1.describeWithFlags('GPGPUContext downloadMatrixFromTexture', DOWNLOAD_FLOAT_ENVS, function () { + var gpgpu; + var texture; + beforeEach(function () { + gpgpu = new gpgpu_context_1.GPGPUContext(); + gpgpu.enableAutomaticDebugValidation(true); + texture = gpgpu.createFloat32MatrixTexture(1, 1); + }); + afterEach(function () { + gpgpu.deleteMatrixTexture(texture); + gpgpu.dispose(); + }); + it('returns 1x1 matrix that was uploaded', function () { + gpgpu.uploadMatrixToTexture(texture, 1, 1, new Float32Array([1.234])); + var result = gpgpu.downloadFloat32MatrixFromOutputTexture(texture, 1, 1); + test_util_1.expectNumbersClose(result[0], 1.234); + }); + it('returns 2x2 matrix that was uploaded', function () { + var texture2 = gpgpu.createFloat32MatrixTexture(2, 2); + gpgpu.uploadMatrixToTexture(texture2, 2, 2, new Float32Array([1.234, 2, 3, 4])); + var result = gpgpu.downloadFloat32MatrixFromOutputTexture(texture2, 2, 2); + test_util_1.expectArraysClose(result, new Float32Array([1.234, 2, 3, 4])); + gpgpu.deleteMatrixTexture(texture2); + }); + it('uses texture parameter', function () { + var texture2 = gpgpu.createFloat32MatrixTexture(1, 1); + gpgpu.uploadMatrixToTexture(texture, 1, 1, new Float32Array([1])); + gpgpu.uploadMatrixToTexture(texture2, 1, 1, new Float32Array([2])); + var read1 = gpgpu.downloadFloat32MatrixFromOutputTexture(texture, 1, 1); + var read2 = gpgpu.downloadFloat32MatrixFromOutputTexture(texture2, 1, 1); + test_util_1.expectNumbersClose(read1[0], 1); + test_util_1.expectNumbersClose(read2[0], 2); + gpgpu.deleteMatrixTexture(texture2); + }); +}); +jasmine_util_1.describeWithFlags('GPGPUContext color texture with float', DOWNLOAD_FLOAT_ENVS, function () { + var gpgpu; + var texture; + afterEach(function () { + gpgpu.deleteMatrixTexture(texture); + gpgpu.dispose(); + }); + it('basic', function () { + gpgpu = new gpgpu_context_1.GPGPUContext(); + gpgpu.enableAutomaticDebugValidation(true); + texture = gpgpu.createFloat32MatrixTexture(1, 1); + gpgpu.setOutputMatrixTexture(texture, 1, 1); + gpgpu.gl.clearColor(0.123, 0, 0, 0); + gpgpu.gl.clear(gpgpu.gl.COLOR_BUFFER_BIT); + var result = gpgpu.downloadFloat32MatrixFromOutputTexture(texture, 1, 1); + test_util_1.expectNumbersClose(result[0], 0.123); + }); +}); +jasmine_util_1.describeWithFlags('GPGPUContext setOutputMatrixTexture', DOWNLOAD_FLOAT_ENVS, function () { + var gpgpu; + var texture; + beforeEach(function () { + gpgpu = new gpgpu_context_1.GPGPUContext(); + gpgpu.enableAutomaticDebugValidation(true); + texture = gpgpu.createFloat32MatrixTexture(1, 1); + }); + afterEach(function () { + gpgpu.deleteMatrixTexture(texture); + gpgpu.dispose(); + }); + it('sets the output texture property to the output texture', function () { + gpgpu.setOutputMatrixTexture(texture, 1, 1); + expect(gpgpu.outputTexture).toBe(texture); + }); + it('rebinds the output texture to the color buffer target', function () { + var output = gpgpu.createFloat32MatrixTexture(1, 1); + gpgpu.uploadMatrixToTexture(texture, 1, 1, new Float32Array([10])); + gpgpu.setOutputMatrixTexture(output, 1, 1); + var tBeforeClear = gpgpu.downloadFloat32MatrixFromOutputTexture(texture, 1, 1); + test_util_1.expectNumbersClose(tBeforeClear[0], 10); + gpgpu.gl.clearColor(1, 0, 0, 0); + gpgpu.gl.clear(gpgpu.gl.COLOR_BUFFER_BIT); + var tAfterClear = gpgpu.downloadFloat32MatrixFromOutputTexture(texture, 1, 1); + test_util_1.expectNumbersClose(tAfterClear[0], 10); + gpgpu.deleteMatrixTexture(output); + }); + it('resets output texture to null if nothing was previously bound', function () { + expect(gpgpu.outputTexture).toBeNull(); + gpgpu.downloadFloat32MatrixFromOutputTexture(texture, 1, 1); + expect(gpgpu.outputTexture).toBeNull(); + }); + it('sets the gl viewport to the output texture dimensions', function () { + var columns = 456; + var rows = 123; + var output = gpgpu.createFloat32MatrixTexture(rows, columns); + gpgpu.setOutputMatrixTexture(output, rows, columns); + var expected = new Int32Array([0, 0, columns, rows]); + expect(gpgpu.gl.getParameter(gpgpu.gl.VIEWPORT)).toEqual(expected); + gpgpu.deleteMatrixTexture(output); + }); + it('doesn\'t change gl viewport when downloading a non-output tex', function () { + var output = gpgpu.createFloat32MatrixTexture(128, 128); + gpgpu.setOutputMatrixTexture(output, 128, 128); + gpgpu.downloadFloat32MatrixFromOutputTexture(texture, 1, 1); + var expected = new Int32Array([0, 0, 128, 128]); + expect(gpgpu.gl.getParameter(gpgpu.gl.VIEWPORT)).toEqual(expected); + gpgpu.deleteMatrixTexture(output); + }); +}); +jasmine_util_1.describeWithFlags('GPGPUContext setOutputPackedMatrixTexture', DOWNLOAD_FLOAT_ENVS, function () { + var gpgpu; + var texture; + beforeEach(function () { + gpgpu = new gpgpu_context_1.GPGPUContext(); + gpgpu.enableAutomaticDebugValidation(true); + }); + afterEach(function () { + if (texture != null) { + gpgpu.deleteMatrixTexture(texture); + } + gpgpu.dispose(); + }); + it('sets the output texture property to the output texture', function () { + texture = gpgpu.createPackedMatrixTexture(1, 1); + gpgpu.setOutputPackedMatrixTexture(texture, 1, 1); + expect(gpgpu.outputTexture).toBe(texture); + }); + it('sets the gl viewport to the output packed texture dimensions', function () { + var columns = 456; + var rows = 123; + texture = gpgpu.createPackedMatrixTexture(rows, columns); + gpgpu.setOutputPackedMatrixTexture(texture, rows, columns); + var _a = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + var expected = new Int32Array([0, 0, width, height]); + expect(gpgpu.gl.getParameter(gpgpu.gl.VIEWPORT)).toEqual(expected); + }); +}); +jasmine_util_1.describeWithFlags('GPGPUContext setOutputMatrixWriteRegion', DOWNLOAD_FLOAT_ENVS, function () { + var gpgpu; + var program; + var output; + beforeEach(function () { + gpgpu = new gpgpu_context_1.GPGPUContext(); + gpgpu.enableAutomaticDebugValidation(true); + var src = 'precision highp float; void main(){gl_FragColor = vec4(2,0,0,0);}'; + program = gpgpu.createProgram(src); + output = gpgpu.createFloat32MatrixTexture(4, 4); + gpgpu.uploadMatrixToTexture(output, 4, 4, new Float32Array(16)); + gpgpu.setOutputMatrixTexture(output, 4, 4); + gpgpu.setProgram(program); + }); + afterEach(function () { + gpgpu.deleteMatrixTexture(output); + gpgpu.deleteProgram(program); + gpgpu.dispose(); + }); + it('writes to all pixels by default', function () { + gpgpu.executeProgram(); + var result = gpgpu.downloadFloat32MatrixFromOutputTexture(output, 4, 4); + var expected = new Float32Array(4 * 4); + expected.fill(2); + test_util_1.expectArraysClose(result, expected); + }); + it('sets the scissor box to the requested parameters', function () { + gpgpu.setOutputMatrixWriteRegion(0, 1, 2, 3); + var scissorBox = gpgpu.gl.getParameter(gpgpu.gl.SCISSOR_BOX); + expect(scissorBox[0]).toEqual(2); + expect(scissorBox[1]).toEqual(0); + expect(scissorBox[2]).toEqual(3); + expect(scissorBox[3]).toEqual(1); + }); + it('writes only to center 2x2 region of 4x4 texture', function () { + gpgpu.setOutputMatrixWriteRegion(1, 2, 1, 2); + gpgpu.executeProgram(); + var result = gpgpu.downloadFloat32MatrixFromOutputTexture(output, 4, 4); + var expected = new Float32Array([0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0]); + test_util_1.expectArraysClose(result, expected); + }); + it('preserves data from previous writes outside of write region', function () { + gpgpu.setOutputMatrixWriteRegion(0, 1, 0, 4); + gpgpu.executeProgram(); + gpgpu.setOutputMatrixWriteRegion(3, 1, 0, 4); + gpgpu.executeProgram(); + var result = gpgpu.downloadFloat32MatrixFromOutputTexture(output, 4, 4); + var expected = new Float32Array([2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2]); + test_util_1.expectArraysClose(result, expected); + }); + it('writes adjacent cells across multiple calls', function () { + for (var row = 0; row < 4; ++row) { + for (var col = 0; col < 4; ++col) { + gpgpu.setOutputMatrixWriteRegion(row, 1, col, 1); + gpgpu.executeProgram(); + } + } + var result = gpgpu.downloadFloat32MatrixFromOutputTexture(output, 4, 4); + var expected = new Float32Array(4 * 4); + expected.fill(2); + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('GPGPUContext', DOWNLOAD_FLOAT_ENVS, function () { + var gpgpu; + beforeEach(function () { + gpgpu = new gpgpu_context_1.GPGPUContext(); + gpgpu.enableAutomaticDebugValidation(true); + }); + afterEach(function () { + gpgpu.dispose(); + }); + it('throws an error if used after dispose', function () { + var gpgpuContext = new gpgpu_context_1.GPGPUContext(); + gpgpuContext.dispose(); + expect(gpgpuContext.dispose).toThrowError(); + }); + it('throws an error if validation is on and framebuffer incomplete', function () { + var src = "precision highp float; void main() {}"; + var program = gpgpu.createProgram(src); + var result = gpgpu.createFloat32MatrixTexture(1, 1); + gpgpu.setOutputMatrixTexture(result, 1, 1); + gpgpu.setProgram(program); + gpgpu.deleteMatrixTexture(result); + expect(gpgpu.executeProgram).toThrowError(); + gpgpu.deleteProgram(program); + }); +}); +describe('gpgpu_context binSearchLastTrue', function () { + it('[false]', function () { + var a = [false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(-1); + }); + it('[true]', function () { + var a = [true]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(0); + }); + it('[false, false]', function () { + var a = [false, false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(-1); + }); + it('[true, false]', function () { + var a = [true, false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(0); + }); + it('[true, true]', function () { + var a = [true, true]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(1); + }); + it('[false, false, false]', function () { + var a = [false, false, false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(-1); + }); + it('[true, false, false]', function () { + var a = [true, false, false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(0); + }); + it('[true, true, false]', function () { + var a = [true, true, false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(1); + }); + it('[true, true, true]', function () { + var a = [true, true, true]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(2); + }); + it('[false, false, false, false]', function () { + var a = [false, false, false, false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(-1); + }); + it('[true, false, false, false]', function () { + var a = [true, false, false, false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(0); + }); + it('[true, true, false, false]', function () { + var a = [true, true, false, false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(1); + }); + it('[true, true, true, false]', function () { + var a = [true, true, true, false]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(2); + }); + it('[true, true, true, true]', function () { + var a = [true, true, true, true]; + var arr = a.map(function (x) { return function () { return x; }; }); + expect(gpgpu_context_1.binSearchLastTrue(arr)).toBe(3); + }); +}); +//# sourceMappingURL=gpgpu_context_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context_test.js.map new file mode 100644 index 0000000..7b4b9a8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_context_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gpgpu_context_test.js","sourceRoot":"","sources":["../../../src/kernels/webgl/gpgpu_context_test.ts"],"names":[],"mappings":";;AAiBA,mDAAqD;AACrD,6CAAsE;AACtE,iDAAgE;AAChE,qCAAuC;AAEvC,IAAM,mBAAmB,GAAG;IAC1B,8BAA8B,EAAE,IAAI;CACrC,CAAC;AAEF,gCAAiB,CACb,wCAAwC,EAAE,mBAAmB,EAAE;IAC7D,IAAI,KAAmB,CAAC;IACxB,IAAI,OAAqB,CAAC;IAE1B,UAAU,CAAC;QACT,KAAK,GAAG,IAAI,4BAAY,EAAE,CAAC;QAC3B,KAAK,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC;QAC3C,OAAO,GAAG,KAAK,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC;QACR,KAAK,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACnC,KAAK,CAAC,OAAO,EAAE,CAAC;IA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P,CAAO,CAAC,CAAC;QAChC,MAAM,CAAC,iCAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE;QAC7B,IAAM,CAAC,GAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9C,IAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,cAAM,OAAA,CAAC,EAAD,CAAC,EAAP,CAAO,CAAC,CAAC;QAChC,MAAM,CAAC,iCAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.d.ts new file mode 100644 index 0000000..36eafde --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.d.ts @@ -0,0 +1,29 @@ +import { Tensor } from '../../tensor'; +import { GPGPUContext } from './gpgpu_context'; +import { ShapeInfo } from './shader_compiler'; +import { TextureData } from './tex_util'; +export interface GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + supportsBroadcasting?: boolean; +} +export interface GPGPUBinary { + webGLProgram: WebGLProgram; + program: GPGPUProgram; + uniformLocations: { + [name: string]: WebGLUniformLocation; + }; + gpgpu: GPGPUContext; + source: string; + inShapeInfos: ShapeInfo[]; + outShapeInfo: ShapeInfo; +} +export interface TensorData { + tensor: T; + texData: TextureData; + isUniform: boolean; +} +export declare function compileProgram(gpgpu: GPGPUContext, program: GPGPUProgram, inputs: Array>, output: TensorData): GPGPUBinary; +export declare function runProgram(binary: GPGPUBinary, inputs: Array>, output: TensorData, customSetup?: (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void): void; +export declare function makeShaderKey(program: GPGPUProgram, inputs: Array>, output: TensorData): string; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.js new file mode 100644 index 0000000..8807a54 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.js @@ -0,0 +1,113 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util = require("../../util"); +var shader_compiler = require("./shader_compiler"); +function compileProgram(gpgpu, program, inputs, output) { + var userCode = program.userCode; + var inputInfos = inputs.map(function (input, i) { + var shapeInfo = { + logicalShape: input.tensor.shape, + texShape: input.isUniform ? null : input.texData.texShape, + isUniform: input.isUniform + }; + return { name: program.variableNames[i], shapeInfo: shapeInfo }; + }); + var inShapeInfos = inputInfos.map(function (x) { return x.shapeInfo; }); + var outShapeInfo = { + logicalShape: output.tensor.shape, + texShape: output.texData.texShape, + isUniform: false + }; + var source = shader_compiler.makeShader(inputInfos, outShapeInfo, userCode, program.supportsBroadcasting === true); + var webGLProgram = gpgpu.createProgram(source); + var uniformLocations = {}; + for (var i = 0; i < program.variableNames.length; i++) { + var uniformName = program.variableNames[i]; + var shouldThrow = false; + uniformLocations[uniformName] = + gpgpu.getUniformLocation(webGLProgram, uniformName, shouldThrow); + } + return { + program: program, + source: source, + webGLProgram: webGLProgram, + uniformLocations: uniformLocations, + gpgpu: gpgpu, + inShapeInfos: inShapeInfos, + outShapeInfo: outShapeInfo + }; +} +exports.compileProgram = compileProgram; +function validateBinaryAndProgram(shapeInfos, inputs) { + if (shapeInfos.length !== inputs.length) { + throw Error("Binary was compiled with " + shapeInfos.length + " inputs, but " + + ("was executed with " + inputs.length + " inputs")); + } + shapeInfos.forEach(function (s, i) { + var shapeA = s.logicalShape; + var input = inputs[i]; + var shapeB = input.tensor.shape; + if (!util.arraysEqual(shapeA, shapeB)) { + throw Error("Binary was compiled with different shapes than " + + ("the current args. Shapes " + shapeA + " and " + shapeB + " must match")); + } + if (s.isUniform && input.isUniform) { + return; + } + var texShapeA = s.texShape; + var texShapeB = input.isUniform ? null : input.texData.texShape; + if (!util.arraysEqual(texShapeA, texShapeB)) { + throw Error("Binary was compiled with different texture shapes than the" + + (" current args. Shape " + texShapeA + " and " + texShapeB + " must match")); + } + }); +} +function runProgram(binary, inputs, output, customSetup) { + validateBinaryAndProgram(binary.inShapeInfos, inputs); + validateBinaryAndProgram([binary.outShapeInfo], [output]); + var outTex = output.texData.texture; + var outTexShape = output.texData.texShape; + var gpgpu = binary.gpgpu; + gpgpu.setOutputMatrixTexture(outTex, outTexShape[0], outTexShape[1]); + gpgpu.setProgram(binary.webGLProgram); + inputs.forEach(function (input, i) { + var variableName = binary.program.variableNames[i]; + var variableUniformLocation = binary.uniformLocations[variableName]; + if (variableUniformLocation != null) { + if (input.isUniform) { + if (input.tensor.size === 1) { + gpgpu.gl.uniform1f(variableUniformLocation, input.tensor.dataSync()[0]); + } + else { + var vals = input.tensor.dataSync(); + if (!(vals instanceof Float32Array)) { + vals = new Float32Array(vals); + } + gpgpu.gl.uniform1fv(variableUniformLocation, vals); + } + return; + } + var tex = input.texData.texture; + gpgpu.setInputMatrixTexture(tex, variableUniformLocation, i); + } + }); + if (customSetup != null) { + customSetup(gpgpu, binary.webGLProgram); + } + gpgpu.executeProgram(); +} +exports.runProgram = runProgram; +function makeShaderKey(program, inputs, output) { + var keyInputs = ''; + inputs.concat(output).forEach(function (x) { + keyInputs += + x.tensor.shape + "_" + (x.isUniform ? 'uniform' : x.texData.texShape); + }); + var keyUserCode = program.userCode; + var keyBroadcast = (program.supportsBroadcasting === true).toString(); + var key = program.constructor.name; + key += '_' + keyBroadcast + '_' + keyInputs + '_' + keyUserCode; + return key; +} +exports.makeShaderKey = makeShaderKey; +//# sourceMappingURL=gpgpu_math.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.js.map new file mode 100644 index 0000000..e1e4e6b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_math.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gpgpu_math.js","sourceRoot":"","sources":["../../../src/kernels/webgl/gpgpu_math.ts"],"names":[],"mappings":";;AAkBA,iCAAmC;AAGnC,mDAAqD;AA2BrD,wBACI,KAAmB,EAAE,OAAqB,EAAE,MAA4B,EACxE,MAAqB;IACvB,IAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,IAAM,UAAU,GAAgB,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,CAAC;QAClD,IAAM,SAAS,GAAG;YAChB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;YAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ;YACzD,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;QACF,OAAO,EAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,WAAA,EAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IACH,IAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,SAAS,EAAX,CAAW,CAAC,CAAC;IACtD,IAAM,YAAY,GAAG;QACnB,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK;QACjC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;QACjC,SAAS,EAAE,KAAK;KACjB,CAAC;IACF,IAAM,MAAM,GAAG,eAAe,CAAC,UAAU,CACrC,UAAU,EAAE,YAAY,EAAE,QAAQ,EAClC,OAAO,CAAC,oBAAoB,KAAK,IAAI,CAAC,CAA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C,IAAM,YAAY,GAAG,CAAC,OAAO,CAAC,oBAAoB,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IACxE,IAAI,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC;IAEnC,GAAG,IAAI,GAAG,GAAG,YAAY,GAAG,GAAG,GAAG,SAAS,GAAG,GAAG,GAAG,WAAW,CAAC;IAChE,OAAO,GAAG,CAAC;AACb,CAAC;AAdD,sCAcC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util.d.ts new file mode 100644 index 0000000..f85a65f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util.d.ts @@ -0,0 +1,29 @@ +export declare function getWebGLContextAttributes(): WebGLContextAttributes; +export interface TextureConfig { + internalFormatFloat: number; + textureFormatFloat: number; + internalFormatHalfFloat: number; + internalFormatPackedFloat: number; + downloadTextureFormat: number; + downloadUnpackNumChannels: number; + defaultNumChannels: number; + textureTypeHalfFloat: number; +} +export declare function createWebGLContext(canvas?: HTMLCanvasElement): WebGLRenderingContext; +export declare function createVertexShader(gl: WebGLRenderingContext): WebGLShader; +export declare function createVertexBuffer(gl: WebGLRenderingContext): WebGLBuffer; +export declare function createIndexBuffer(gl: WebGLRenderingContext): WebGLBuffer; +export declare function getTextureConfig(gl: WebGLRenderingContext, textureHalfFloatExtension?: any): TextureConfig; +export declare function createFloat32MatrixTexture(gl: WebGLRenderingContext, rows: number, columns: number, textureConfig: TextureConfig): WebGLTexture; +export declare function createFloat16MatrixTexture(gl: WebGLRenderingContext, rows: number, columns: number, textureConfig: TextureConfig): WebGLTexture; +export declare function createUnsignedBytesMatrixTexture(gl: WebGLRenderingContext, rows: number, columns: number, textureConfig: TextureConfig): WebGLTexture; +export declare function createPackedMatrixTexture(gl: WebGLRenderingContext, rows: number, columns: number, textureConfig: TextureConfig): WebGLTexture; +export declare function bindVertexProgramAttributeStreams(gl: WebGLRenderingContext, program: WebGLProgram, vertexBuffer: WebGLBuffer): boolean; +export declare function uploadPixelDataToTexture(gl: WebGLRenderingContext, texture: WebGLTexture, pixels: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; +export declare function uploadMatrixToTexture(gl: WebGLRenderingContext, texture: WebGLTexture, rows: number, columns: number, matrix: Float32Array, numChannels: number, textureConfig: TextureConfig): void; +export declare function uploadMatrixToPackedTexture(gl: WebGLRenderingContext, texture: WebGLTexture, rows: number, columns: number, matrix: Float32Array, textureConfig: TextureConfig): void; +export declare function maybeCreateBufferFromOutputTexture(gl: WebGLRenderingContext, texture: WebGLTexture, rows: number, columns: number, textureConfig: TextureConfig): WebGLBuffer | WebGLTexture; +export declare function downloadFloat32MatrixFromBuffer(gl: WebGLRenderingContext, buffer: WebGLBuffer, rows: number, columns: number, textureConfig: TextureConfig): Float32Array; +export declare function downloadFloat32MatrixFromOutputTexture(gl: WebGLRenderingContext, rows: number, columns: number, textureConfig: TextureConfig): Float32Array; +export declare function downloadByteEncodedFloatMatrixFromOutputTexture(gl: WebGLRenderingContext, rows: number, columns: number, textureConfig: TextureConfig): Float32Array; +export declare function downloadMatrixFromPackedOutputTexture(gl: WebGLRenderingContext, rows: number, columns: number, textureConfig: TextureConfig): Float32Array; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util.js new file mode 100644 index 0000000..c2f4a39 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util.js @@ -0,0 +1,226 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../../environment"); +var tex_util = require("./tex_util"); +var webgl_util = require("./webgl_util"); +function getWebGLContextAttributes() { + return { + alpha: false, + antialias: false, + premultipliedAlpha: false, + preserveDrawingBuffer: false, + depth: false, + stencil: false, + failIfMajorPerformanceCaveat: true + }; +} +exports.getWebGLContextAttributes = getWebGLContextAttributes; +function createWebGLContext(canvas) { + var attributes = getWebGLContextAttributes(); + var gl; + if (canvas != null) { + gl = webgl_util.createWebGLRenderingContextFromCanvas(canvas, attributes); + } + else { + gl = webgl_util.createWebGLRenderingContext(attributes); + } + webgl_util.callAndCheck(gl, function () { return gl.disable(gl.DEPTH_TEST); }); + webgl_util.callAndCheck(gl, function () { return gl.disable(gl.STENCIL_TEST); }); + webgl_util.callAndCheck(gl, function () { return gl.disable(gl.BLEND); }); + webgl_util.callAndCheck(gl, function () { return gl.disable(gl.DITHER); }); + webgl_util.callAndCheck(gl, function () { return gl.disable(gl.POLYGON_OFFSET_FILL); }); + webgl_util.callAndCheck(gl, function () { return gl.disable(gl.SAMPLE_COVERAGE); }); + webgl_util.callAndCheck(gl, function () { return gl.enable(gl.SCISSOR_TEST); }); + webgl_util.callAndCheck(gl, function () { return gl.enable(gl.CULL_FACE); }); + webgl_util.callAndCheck(gl, function () { return gl.cullFace(gl.BACK); }); + return gl; +} +exports.createWebGLContext = createWebGLContext; +function createVertexShader(gl) { + var vertexShaderSource = "\n precision highp float;\n attribute vec3 clipSpacePos;\n attribute vec2 uv;\n varying vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }"; + return webgl_util.createVertexShader(gl, vertexShaderSource); +} +exports.createVertexShader = createVertexShader; +function createVertexBuffer(gl) { + var vertexArray = new Float32Array([-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0]); + return webgl_util.createStaticVertexBuffer(gl, vertexArray); +} +exports.createVertexBuffer = createVertexBuffer; +function createIndexBuffer(gl) { + var triangleVertexIndices = new Uint16Array([0, 1, 2, 2, 1, 3]); + return webgl_util.createStaticIndexBuffer(gl, triangleVertexIndices); +} +exports.createIndexBuffer = createIndexBuffer; +function getTextureConfig(gl, textureHalfFloatExtension) { + var glany = gl; + var internalFormatFloat; + var internalFormatHalfFloat; + var internalFormatPackedFloat; + var textureFormatFloat; + var downloadTextureFormat; + var downloadUnpackNumChannels; + var defaultNumChannels; + var textureTypeHalfFloat; + if (environment_1.ENV.get('WEBGL_VERSION') === 2) { + internalFormatFloat = glany.R32F; + internalFormatHalfFloat = glany.R16F; + internalFormatPackedFloat = glany.RGBA32F; + textureFormatFloat = glany.RED; + downloadUnpackNumChannels = 4; + defaultNumChannels = 1; + textureTypeHalfFloat = glany.HALF_FLOAT; + } + else { + internalFormatFloat = gl.RGBA; + internalFormatHalfFloat = gl.RGBA; + internalFormatPackedFloat = glany.RGBA; + textureFormatFloat = gl.RGBA; + downloadUnpackNumChannels = 4; + defaultNumChannels = 4; + textureTypeHalfFloat = textureHalfFloatExtension != null ? + textureHalfFloatExtension.HALF_FLOAT_OES : + null; + } + downloadTextureFormat = gl.RGBA; + return { + internalFormatFloat: internalFormatFloat, + internalFormatHalfFloat: internalFormatHalfFloat, + internalFormatPackedFloat: internalFormatPackedFloat, + textureFormatFloat: textureFormatFloat, + downloadTextureFormat: downloadTextureFormat, + downloadUnpackNumChannels: downloadUnpackNumChannels, + defaultNumChannels: defaultNumChannels, + textureTypeHalfFloat: textureTypeHalfFloat + }; +} +exports.getTextureConfig = getTextureConfig; +function createAndConfigureTexture(gl, width, height, internalFormat, textureFormat, textureType) { + webgl_util.validateTextureSize(gl, width, height); + var texture = webgl_util.createTexture(gl); + var tex2d = gl.TEXTURE_2D; + webgl_util.callAndCheck(gl, function () { return gl.bindTexture(tex2d, texture); }); + webgl_util.callAndCheck(gl, function () { return gl.texParameteri(tex2d, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); }); + webgl_util.callAndCheck(gl, function () { return gl.texParameteri(tex2d, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); }); + webgl_util.callAndCheck(gl, function () { return gl.texParameteri(tex2d, gl.TEXTURE_MIN_FILTER, gl.NEAREST); }); + webgl_util.callAndCheck(gl, function () { return gl.texParameteri(tex2d, gl.TEXTURE_MAG_FILTER, gl.NEAREST); }); + webgl_util.callAndCheck(gl, function () { return gl.texImage2D(tex2d, 0, internalFormat, width, height, 0, textureFormat, textureType, null); }); + webgl_util.callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, null); }); + return texture; +} +function createFloat32MatrixTexture(gl, rows, columns, textureConfig) { + var _a = tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + return createAndConfigureTexture(gl, width, height, textureConfig.internalFormatFloat, textureConfig.textureFormatFloat, gl.FLOAT); +} +exports.createFloat32MatrixTexture = createFloat32MatrixTexture; +function createFloat16MatrixTexture(gl, rows, columns, textureConfig) { + var _a = tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + return createAndConfigureTexture(gl, width, height, textureConfig.internalFormatFloat, textureConfig.textureFormatFloat, textureConfig.textureTypeHalfFloat); +} +exports.createFloat16MatrixTexture = createFloat16MatrixTexture; +function createUnsignedBytesMatrixTexture(gl, rows, columns, textureConfig) { + var _a = tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + return createAndConfigureTexture(gl, width, height, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE); +} +exports.createUnsignedBytesMatrixTexture = createUnsignedBytesMatrixTexture; +function createPackedMatrixTexture(gl, rows, columns, textureConfig) { + var _a = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + return createAndConfigureTexture(gl, width, height, textureConfig.internalFormatPackedFloat, gl.RGBA, gl.FLOAT); +} +exports.createPackedMatrixTexture = createPackedMatrixTexture; +function bindVertexProgramAttributeStreams(gl, program, vertexBuffer) { + var posOffset = 0; + var uvOffset = 3 * 4; + var stride = (3 * 4) + (2 * 4); + webgl_util.callAndCheck(gl, function () { return gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); }); + var success = webgl_util.bindVertexBufferToProgramAttribute(gl, program, 'clipSpacePos', vertexBuffer, 3, stride, posOffset); + return success && + webgl_util.bindVertexBufferToProgramAttribute(gl, program, 'uv', vertexBuffer, 2, stride, uvOffset); +} +exports.bindVertexProgramAttributeStreams = bindVertexProgramAttributeStreams; +function uploadPixelDataToTexture(gl, texture, pixels) { + webgl_util.callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, texture); }); + webgl_util.callAndCheck(gl, function () { return gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, pixels); }); + webgl_util.callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, null); }); +} +exports.uploadPixelDataToTexture = uploadPixelDataToTexture; +function uploadDataToTexture(gl, texture, width, height, data, textureFormat) { + webgl_util.validateTextureSize(gl, width, height); + webgl_util.callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, texture); }); + webgl_util.callAndCheck(gl, function () { return gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, textureFormat, gl.FLOAT, data); }); + webgl_util.callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, null); }); +} +function uploadMatrixToTexture(gl, texture, rows, columns, matrix, numChannels, textureConfig) { + var _a = tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var unpackedArray; + if (textureConfig.defaultNumChannels === 1) { + unpackedArray = matrix; + } + else { + unpackedArray = + new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(matrix.length, numChannels)); + tex_util.encodeMatrixToUnpackedArray(matrix, unpackedArray, numChannels); + } + uploadDataToTexture(gl, texture, w, h, unpackedArray, textureConfig.textureFormatFloat); +} +exports.uploadMatrixToTexture = uploadMatrixToTexture; +function uploadMatrixToPackedTexture(gl, texture, rows, columns, matrix, textureConfig) { + var _a = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var packedRGBA = new Float32Array(tex_util.getPackedRGBAArraySizeFromMatrixShape(rows, columns)); + tex_util.encodeMatrixToPackedRGBA(matrix, rows, columns, packedRGBA); + uploadDataToTexture(gl, texture, w, h, packedRGBA, gl.RGBA); +} +exports.uploadMatrixToPackedTexture = uploadMatrixToPackedTexture; +function maybeCreateBufferFromOutputTexture(gl, texture, rows, columns, textureConfig) { + var bufferOrTexture = texture; + if (environment_1.ENV.get('WEBGL_VERSION') === 2) { + var gl2_1 = gl; + var buffer_1 = gl2_1.createBuffer(); + webgl_util.callAndCheck(gl, function () { return gl.bindBuffer(gl2_1.PIXEL_PACK_BUFFER, buffer_1); }); + var bytesPerFloat = 4; + var bufferSizeBytes_1 = bytesPerFloat * + tex_util.getUnpackedArraySizeFromMatrixSize(rows * columns, textureConfig.downloadUnpackNumChannels); + webgl_util.callAndCheck(gl, function () { return gl.bufferData(gl2_1.PIXEL_PACK_BUFFER, bufferSizeBytes_1, gl.STATIC_DRAW); }); + webgl_util.callAndCheck(gl, function () { return gl2_1.readPixels(0, 0, columns, rows, gl.RGBA, gl.FLOAT, 0); }); + webgl_util.callAndCheck(gl, function () { return gl.bindBuffer(gl2_1.PIXEL_PACK_BUFFER, null); }); + bufferOrTexture = buffer_1; + } + return bufferOrTexture; +} +exports.maybeCreateBufferFromOutputTexture = maybeCreateBufferFromOutputTexture; +function downloadFloat32MatrixFromBuffer(gl, buffer, rows, columns, textureConfig) { + var gl2 = gl; + var downloadTarget = new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(rows * columns, textureConfig.downloadUnpackNumChannels)); + gl2.bindBuffer(gl.ARRAY_BUFFER, buffer); + gl2.getBufferSubData(gl.ARRAY_BUFFER, 0, downloadTarget); + gl2.bindBuffer(gl.ARRAY_BUFFER, null); + var matrix = new Float32Array(rows * columns); + tex_util.decodeMatrixFromUnpackedArray(downloadTarget, matrix, textureConfig.downloadUnpackNumChannels); + return matrix; +} +exports.downloadFloat32MatrixFromBuffer = downloadFloat32MatrixFromBuffer; +function downloadFloat32MatrixFromOutputTexture(gl, rows, columns, textureConfig) { + var _a = tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var downloadTarget = new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(rows * columns, textureConfig.downloadUnpackNumChannels)); + webgl_util.callAndCheck(gl, function () { return gl.readPixels(0, 0, w, h, textureConfig.downloadTextureFormat, gl.FLOAT, downloadTarget); }); + var matrix = new Float32Array(rows * columns); + tex_util.decodeMatrixFromUnpackedArray(downloadTarget, matrix, textureConfig.downloadUnpackNumChannels); + return matrix; +} +exports.downloadFloat32MatrixFromOutputTexture = downloadFloat32MatrixFromOutputTexture; +function downloadByteEncodedFloatMatrixFromOutputTexture(gl, rows, columns, textureConfig) { + var _a = tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var numChannels = 4; + var downloadTarget = new Uint8Array(tex_util.getUnpackedArraySizeFromMatrixSize(rows * columns, numChannels)); + webgl_util.callAndCheck(gl, function () { return gl.readPixels(0, 0, w, h, textureConfig.downloadTextureFormat, gl.UNSIGNED_BYTE, downloadTarget); }); + return new Float32Array(downloadTarget.buffer); +} +exports.downloadByteEncodedFloatMatrixFromOutputTexture = downloadByteEncodedFloatMatrixFromOutputTexture; +function downloadMatrixFromPackedOutputTexture(gl, rows, columns, textureConfig) { + var _a = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var packedRGBA = new Float32Array(tex_util.getPackedRGBAArraySizeFromMatrixShape(rows, columns)); + webgl_util.callAndCheck(gl, function () { return gl.readPixels(0, 0, w, h, gl.RGBA, gl.FLOAT, packedRGBA); }); + var matrix = new Float32Array(rows * columns); + return tex_util.decodeMatrixFromPackedRGBA(packedRGBA, rows, columns, matrix); +} +exports.downloadMatrixFromPackedOutputTexture = downloadMatrixFromPackedOutputTexture; +//# sourceMappingURL=gpgpu_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util.js.map new file mode 100644 index 0000000..ecd205b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gpgpu_util.js","sourceRoot":"","sources":["../../../src/kernels/webgl/gpgpu_util.ts"],"names":[],"mappings":";;AAiBA,iDAAsC;AAEtC,qCAAuC;AACvC,yCAA2C;AAE3C;IACE,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,KAAK;QAChB,kBAAkB,EAAE,KAAK;QACzB,qBAAqB,EAAE,KAAK;QAC5B,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,KAAK;QACd,4BAA4B,EAAE,IAAI;KACnC,CAAC;AACJ,CAAC;AAVD,8DAUC;AAiBD,4BAAmC,MAA0B;IAC3D,IAAM,UAAU,GAAG,yBAAyB,EAAE,CAAC;IAC/C,IAAI,EAAyB,CAAC;IAC9B,IAAI,MAAM,IAAI,IAAI,EAAE;QAClB,EAAE,GAAG,UAAU,CAAC,qCAAqC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;KAC3E;SAAM;QACL,EAAE,GAAG,UAAU,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC;KACzD;IACD,UAAU,CAAC,YAAY,CAAC,EAAE,EAAE,cAAM,OAAA,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,EAAzB,CAAyB,CAAC,CAAC;IAC7D,UAAU,CAAC,YAAY,CAAC,EAAE,EAAE,cAAM,OAAA,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,EAA3B,CAA2B,CAAC,CAAC;IAC/D,UAAU,CAAC,YAAY,CAAC,EAAE,EAAE,cAAM,OAAA,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;IAC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/gpgpu_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util_test.js new file mode 100644 index 0000000..5bedb26 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util_test.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var jasmine_util_1 = require("../../jasmine_util"); +var test_util_1 = require("../../test_util"); +var gpgpu_context_1 = require("./gpgpu_context"); +var gpgpu_util = require("./gpgpu_util"); +jasmine_util_1.describeWithFlags('gpgpu_util createWebGLContext', test_util_1.WEBGL_ENVS, function () { + var gpgpu; + beforeEach(function () { + gpgpu = new gpgpu_context_1.GPGPUContext(); + }); + afterEach(function () { + gpgpu.dispose(); + }); + it('disables DEPTH_TEST and STENCIL_TEST', function () { + expect(gpgpu.gl.getParameter(gpgpu.gl.DEPTH_TEST)).toEqual(false); + expect(gpgpu.gl.getParameter(gpgpu.gl.STENCIL_TEST)).toEqual(false); + }); + it('disables BLEND', function () { + expect(gpgpu.gl.getParameter(gpgpu.gl.BLEND)).toEqual(false); + }); + it('disables DITHER, POLYGON_OFFSET_FILL', function () { + expect(gpgpu.gl.getParameter(gpgpu.gl.DITHER)).toEqual(false); + expect(gpgpu.gl.getParameter(gpgpu.gl.POLYGON_OFFSET_FILL)).toEqual(false); + }); + it('enables CULL_FACE with BACK', function () { + expect(gpgpu.gl.getParameter(gpgpu.gl.CULL_FACE)).toEqual(true); + expect(gpgpu.gl.getParameter(gpgpu.gl.CULL_FACE_MODE)) + .toEqual(gpgpu.gl.BACK); + }); + it('enables SCISSOR_TEST', function () { + expect(gpgpu.gl.getParameter(gpgpu.gl.SCISSOR_TEST)).toEqual(true); + }); +}); +jasmine_util_1.describeWithFlags('gpgpu_util createFloat32MatrixTexture', test_util_1.WEBGL_ENVS, function () { + it('sets the TEXTURE_WRAP S+T parameters to CLAMP_TO_EDGE', function () { + var gpgpu = new gpgpu_context_1.GPGPUContext(); + var textureConfig = gpgpu_util.getTextureConfig(gpgpu.gl); + var tex = gpgpu_util.createFloat32MatrixTexture(gpgpu.gl, 32, 32, textureConfig); + gpgpu.gl.bindTexture(gpgpu.gl.TEXTURE_2D, tex); + expect(gpgpu.gl.getTexParameter(gpgpu.gl.TEXTURE_2D, gpgpu.gl.TEXTURE_WRAP_S)) + .toEqual(gpgpu.gl.CLAMP_TO_EDGE); + expect(gpgpu.gl.getTexParameter(gpgpu.gl.TEXTURE_2D, gpgpu.gl.TEXTURE_WRAP_T)) + .toEqual(gpgpu.gl.CLAMP_TO_EDGE); + gpgpu.gl.bindTexture(gpgpu.gl.TEXTURE_2D, null); + gpgpu.deleteMatrixTexture(tex); + gpgpu.dispose(); + }); + it('sets the TEXTURE_[MIN|MAG]_FILTER parameters to NEAREST', function () { + var gpgpu = new gpgpu_context_1.GPGPUContext(); + var textureConfig = gpgpu_util.getTextureConfig(gpgpu.gl); + var tex = gpgpu_util.createFloat32MatrixTexture(gpgpu.gl, 32, 32, textureConfig); + gpgpu.gl.bindTexture(gpgpu.gl.TEXTURE_2D, tex); + expect(gpgpu.gl.getTexParameter(gpgpu.gl.TEXTURE_2D, gpgpu.gl.TEXTURE_MIN_FILTER)) + .toEqual(gpgpu.gl.NEAREST); + expect(gpgpu.gl.getTexParameter(gpgpu.gl.TEXTURE_2D, gpgpu.gl.TEXTURE_MAG_FILTER)) + .toEqual(gpgpu.gl.NEAREST); + gpgpu.gl.bindTexture(gpgpu.gl.TEXTURE_2D, null); + gpgpu.deleteMatrixTexture(tex); + gpgpu.dispose(); + }); +}); +jasmine_util_1.describeWithFlags('gpgpu_util createPackedMatrixTexture', test_util_1.WEBGL_ENVS, function () { + it('sets the TEXTURE_WRAP S+T parameters to CLAMP_TO_EDGE', function () { + var gpgpu = new gpgpu_context_1.GPGPUContext(); + var textureConfig = gpgpu_util.getTextureConfig(gpgpu.gl); + var tex = gpgpu_util.createPackedMatrixTexture(gpgpu.gl, 32, 32, textureConfig); + gpgpu.gl.bindTexture(gpgpu.gl.TEXTURE_2D, tex); + expect(gpgpu.gl.getTexParameter(gpgpu.gl.TEXTURE_2D, gpgpu.gl.TEXTURE_WRAP_S)) + .toEqual(gpgpu.gl.CLAMP_TO_EDGE); + expect(gpgpu.gl.getTexParameter(gpgpu.gl.TEXTURE_2D, gpgpu.gl.TEXTURE_WRAP_T)) + .toEqual(gpgpu.gl.CLAMP_TO_EDGE); + gpgpu.gl.bindTexture(gpgpu.gl.TEXTURE_2D, null); + gpgpu.deleteMatrixTexture(tex); + gpgpu.dispose(); + }); + it('sets the TEXTURE_[MIN|MAG]_FILTER parameters to NEAREST', function () { + var gpgpu = new gpgpu_context_1.GPGPUContext(); + var textureConfig = gpgpu_util.getTextureConfig(gpgpu.gl); + var tex = gpgpu_util.createPackedMatrixTexture(gpgpu.gl, 32, 32, textureConfig); + gpgpu.gl.bindTexture(gpgpu.gl.TEXTURE_2D, tex); + expect(gpgpu.gl.getTexParameter(gpgpu.gl.TEXTURE_2D, gpgpu.gl.TEXTURE_MIN_FILTER)) + .toEqual(gpgpu.gl.NEAREST); + expect(gpgpu.gl.getTexParameter(gpgpu.gl.TEXTURE_2D, gpgpu.gl.TEXTURE_MAG_FILTER)) + .toEqual(gpgpu.gl.NEAREST); + gpgpu.gl.bindTexture(gpgpu.gl.TEXTURE_2D, null); + gpgpu.deleteMatrixTexture(tex); + gpgpu.dispose(); + }); +}); +//# sourceMappingURL=gpgpu_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util_test.js.map new file mode 100644 index 0000000..52205d1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/gpgpu_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gpgpu_util_test.js","sourceRoot":"","sources":["../../../src/kernels/webgl/gpgpu_util_test.ts"],"names":[],"mappings":";;AAiBA,mDAAqD;AACrD,6CAA2C;AAE3C,iDAA6C;AAC7C,yCAA2C;AAE3C,gCAAiB,CAAC,+BAA+B,EAAE,sBAAU,EAAE;IAC7D,IAAI,KAAmB,CAAC;IAExB,UAAU,CAAC;QACT,KAAK,GAAG,IAAI,4BAAY,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC;QACR,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE;QACzC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE;QACnB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE;QACzC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9D,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,YA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AC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE;QAC5D,IAAM,KAAK,GAAG,IAAI,4BAAY,EAAE,CAAC;QACjC,IAAM,aAAa,GAAG,UAAU,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC5D,IAAM,GAAG,GACL,UAAU,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,aAAa,CAAC,CAAC;QAC1E,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAC/C,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,CACpB,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;aACxD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;QAC/B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,CACpB,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;aACxD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;QAC/B,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAChD,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAC/B,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_gpu.d.ts new file mode 100644 index 0000000..186c911 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class LRNProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(xShape: number[], radius: number, bias: number, alpha: number, beta: number); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_gpu.js new file mode 100644 index 0000000..788b819 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_gpu.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var LRNProgram = (function () { + function LRNProgram(xShape, radius, bias, alpha, beta) { + this.variableNames = ['x']; + this.outputShape = []; + var rad = radius; + var maxD = xShape[3] - 1; + this.outputShape = xShape; + var powOperator; + var basis = "float(" + bias + ") + float(" + alpha + ") * sum"; + if (beta === 0.5) { + powOperator = "inversesqrt(" + basis + ")"; + } + else if (beta === 1.0) { + powOperator = "1.0/(" + basis + ")"; + } + else { + powOperator = "exp(log(" + basis + ") * float(-" + beta + "));"; + } + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -" + rad + "; j <= " + rad + "; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= " + maxD + ") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * " + powOperator + ";\n setOutput(val);\n }\n "; + } + return LRNProgram; +}()); +exports.LRNProgram = LRNProgram; +//# sourceMappingURL=lrn_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_gpu.js.map new file mode 100644 index 0000000..175f38e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lrn_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/lrn_gpu.ts"],"names":[],"mappings":";;AAmBA;IAKE,oBACI,MAAgB,EAAE,MAAc,EAAE,IAAY,EAAE,KAAa,EAC7D,IAAY;QANhB,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QACtB,gBAAW,GAAa,EAAE,CAAC;QAMzB,IAAM,GAAG,GAAG,MAAM,CAAC;QACnB,IAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAM1B,IAAI,WAAW,CAAC;QAChB,IAAM,KAAK,GAAG,WAAS,IAAI,kBAAa,KAAK,YAAS,CAAC;QACvD,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,WAAW,GAAG,iBAAe,KAAK,MAAG,CAAC;SACvC;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE;YACvB,WAAW,GAAG,UAAQ,KAAK,MAAG,CAAC;SAChC;aAAM;YACL,WAAW,GAAG,aAAW,KAAK,mBAAc,IAAI,QAAK,CAAC;SACvD;QAED,IAAI,CAAC,QAAQ,GAAG,4QASI,GAAG,eAAU,GAAG,gFAEJ,IAAI,mIAKd,WAAW,8CAGhC,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AA/CD,IA+CC;AA/CY,gCAAU"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_grad_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_grad_gpu.d.ts new file mode 100644 index 0000000..e77237f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_grad_gpu.d.ts @@ -0,0 +1,12 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class LRNGradProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + depthRadius: number; + bias: number; + alpha: number; + beta: number; + depth: number; + constructor(inputShape: number[], depthRadius: number, bias: number, alpha: number, beta: number); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_grad_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_grad_gpu.js new file mode 100644 index 0000000..930b18b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_grad_gpu.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var LRNGradProgram = (function () { + function LRNGradProgram(inputShape, depthRadius, bias, alpha, beta) { + this.variableNames = ['inputImage', 'outputImage', 'dy']; + this.outputShape = []; + this.outputShape = inputShape; + this.depth = inputShape[3]; + this.depthRadius = depthRadius; + this.bias = bias; + this.alpha = alpha; + this.beta = beta; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < " + this.depth + "; ++d) {\n int depthBegin = int(max(0.0, float(d - " + depthRadius + ")));\n int depthEnd = int(min(float(" + this.depth + "),\n float(d + " + depthRadius + " + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = " + this.depth + ";\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(" + alpha + ") * norm + float(" + bias + ");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(" + alpha + ")\n * float(" + beta + ")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * " + beta + ");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n "; + } + return LRNGradProgram; +}()); +exports.LRNGradProgram = LRNGradProgram; +//# sourceMappingURL=lrn_grad_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_grad_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_grad_gpu.js.map new file mode 100644 index 0000000..bbd1a9b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/lrn_grad_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lrn_grad_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/lrn_grad_gpu.ts"],"names":[],"mappings":";;AAEA;IAUE,wBACI,UAAoB,EAAE,WAAmB,EAAE,IAAY,EAAE,KAAa,EACtE,IAAY;QAXhB,kBAAa,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;QACpD,gBAAW,GAAa,EAAE,CAAC;QAWzB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,sNAQU,IAAI,CAAC,KAAK,oEACY,WAAW,qDACtB,IAAI,CAAC,KAAK,oCACzB,WAAW,kGAGC,IAAI,CAAC,KAAK,4aAevB,KAAK,yBAAoB,IAAI,wPAOb,KAAK,mCACpB,IAAI,mLAIY,IAAI,gSAczC,CAAC;IACJ,CAAC;IACH,qBAAC;AAAD,CAAC,AA5ED,IA4EC;AA5EY,wCAAc"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/max_pool_backprop_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/max_pool_backprop_gpu.d.ts new file mode 100644 index 0000000..5204f82 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/max_pool_backprop_gpu.d.ts @@ -0,0 +1,8 @@ +import { Conv2DInfo } from '../../ops/conv_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class MaxPool2DBackpropProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(convInfo: Conv2DInfo); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/max_pool_backprop_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/max_pool_backprop_gpu.js new file mode 100644 index 0000000..8891c71 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/max_pool_backprop_gpu.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var MaxPool2DBackpropProgram = (function () { + function MaxPool2DBackpropProgram(convInfo) { + this.variableNames = ['dy', 'maxPos']; + this.outputShape = convInfo.inShape; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var lastIndex = filterHeight * filterWidth - 1; + this.userCode = "\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + strideHeight + ".0;\n\n if (dyR < 0.0 || dyR >= " + convInfo.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + strideWidth + ".0;\n\n if (dyC < 0.0 || dyC >= " + convInfo.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = " + lastIndex + " - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * " + filterWidth + " + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n "; + } + return MaxPool2DBackpropProgram; +}()); +exports.MaxPool2DBackpropProgram = MaxPool2DBackpropProgram; +//# sourceMappingURL=max_pool_backprop_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/max_pool_backprop_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/max_pool_backprop_gpu.js.map new file mode 100644 index 0000000..c6a4290 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/max_pool_backprop_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"max_pool_backprop_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/max_pool_backprop_gpu.ts"],"names":[],"mappings":";;AAqBA;IAKE,kCAAY,QAAoB;QAJhC,kBAAa,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAK/B,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC;QACpC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACzC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QAEzC,IAAM,MAAM,GAAG,YAAY,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC;QACvD,IAAM,OAAO,GAAG,WAAW,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QAExD,IAAM,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,sCACa,MAAM,UAAK,OAAO,sdAcnB,YAAY,iEACI,YAAY,iDAExB,QAAQ,CAAC,SAAS,yIAKpB,WAAW,mEACK,WAAW,mDAEvB,QAAQ,CAAC,QAAQ,oNAOvB,SAAS,+LAIJ,WAAW,kMAQ3C,CAAC;IACJ,CAAC;IACH,+BAAC;AAAD,CAAC,AA/DD,IA+DC;AA/DY,4DAAwB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_gpu.d.ts new file mode 100644 index 0000000..c87bbc5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class MatMulProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(aShape: [number, number], bShape: [number, number], transposeA?: boolean, transposeB?: boolean); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_gpu.js new file mode 100644 index 0000000..d0228ae --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_gpu.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var MatMulProgram = (function () { + function MatMulProgram(aShape, bShape, transposeA, transposeB) { + if (transposeA === void 0) { transposeA = false; } + if (transposeB === void 0) { transposeB = false; } + this.variableNames = ['matrixA', 'matrixB']; + var outerShapeA = transposeA ? aShape[1] : aShape[0]; + var outerShapeB = transposeB ? bShape[0] : bShape[1]; + var sharedDim = transposeA ? aShape[0] : aShape[1]; + this.outputShape = [outerShapeA, outerShapeB]; + var aSnippetFromOffset = function (vec4Offset, indexVar) { + return transposeA ? indexVar + " + " + vec4Offset + ", aRow" : + "aRow, " + indexVar + " + " + vec4Offset; + }; + var bSnippetFromOffset = function (vec4Offset, indexVar) { + return transposeB ? "bCol, " + indexVar + " + " + vec4Offset : + indexVar + " + " + vec4Offset + ", bCol"; + }; + var sharedDimNearestVec4 = Math.floor(sharedDim / 4) * 4; + var sharedDimVec4Remainder = sharedDim % 4; + this.userCode = " float dotARowBCol(int aRow, int bCol) {\n float result = 0.0;\n for (int i = 0; i < " + sharedDimNearestVec4 + "; i += 4) {\n vec4 a = vec4(\n getMatrixA(" + aSnippetFromOffset(0, 'i') + "),\n getMatrixA(" + aSnippetFromOffset(1, 'i') + "),\n getMatrixA(" + aSnippetFromOffset(2, 'i') + "),\n getMatrixA(" + aSnippetFromOffset(3, 'i') + ")\n );\n vec4 b = vec4(\n getMatrixB(" + bSnippetFromOffset(0, 'i') + "),\n getMatrixB(" + bSnippetFromOffset(1, 'i') + "),\n getMatrixB(" + bSnippetFromOffset(2, 'i') + "),\n getMatrixB(" + bSnippetFromOffset(3, 'i') + ")\n );\n\n result += dot(a, b);\n }\n\n if (" + (sharedDimVec4Remainder === 1) + ") {\n result += getMatrixA(" + aSnippetFromOffset(0, sharedDimNearestVec4) + ") *\n getMatrixB(" + bSnippetFromOffset(0, sharedDimNearestVec4) + ");\n } else if (" + (sharedDimVec4Remainder === 2) + ") {\n vec2 a = vec2(\n getMatrixA(" + aSnippetFromOffset(0, sharedDimNearestVec4) + "),\n getMatrixA(" + aSnippetFromOffset(1, sharedDimNearestVec4) + ")\n );\n vec2 b = vec2(\n getMatrixB(" + bSnippetFromOffset(0, sharedDimNearestVec4) + "),\n getMatrixB(" + bSnippetFromOffset(1, sharedDimNearestVec4) + ")\n );\n result += dot(a, b);\n } else if (" + (sharedDimVec4Remainder === 3) + ") {\n vec3 a = vec3(\n getMatrixA(" + aSnippetFromOffset(0, sharedDimNearestVec4) + "),\n getMatrixA(" + aSnippetFromOffset(1, sharedDimNearestVec4) + "),\n getMatrixA(" + aSnippetFromOffset(2, sharedDimNearestVec4) + ")\n );\n vec3 b = vec3(\n getMatrixB(" + bSnippetFromOffset(0, sharedDimNearestVec4) + "),\n getMatrixB(" + bSnippetFromOffset(1, sharedDimNearestVec4) + "),\n getMatrixB(" + bSnippetFromOffset(2, sharedDimNearestVec4) + ")\n );\n result += dot(a, b);\n }\n\n return result;\n }\n\n void main() {\n ivec2 resRC = getOutputCoords();\n setOutput(dotARowBCol(resRC.x, resRC.y));\n }\n "; + } + return MatMulProgram; +}()); +exports.MatMulProgram = MatMulProgram; +//# sourceMappingURL=mulmat_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_gpu.js.map new file mode 100644 index 0000000..8e89246 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mulmat_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/mulmat_gpu.ts"],"names":[],"mappings":";;AAmBA;IAKE,uBACI,MAAwB,EAAE,MAAwB,EAAE,UAAkB,EACtE,UAAkB;QADkC,2BAAA,EAAA,kBAAkB;QACtE,2BAAA,EAAA,kBAAkB;QANtB,kBAAa,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAOrC,IAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,MA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CAAC,EAAE,GAAG,CAAC,iCAC1B,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,6EAMrC,sBAAsB,KAAK,CAAC,2CACT,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,kCACnD,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,8BAC/C,sBAAsB,KAAK,CAAC,2DAExB,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,iCAC3C,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,oEAG3C,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,iCAC3C,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,uEAG/C,sBAAsB,KAAK,CAAC,2DAExB,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,iCAC3C,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,iCAC3C,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,oEAG3C,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,iCAC3C,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,iCAC3C,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,mNAY7D,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AA9ED,IA8EC;AA9EY,sCAAa"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu.d.ts new file mode 100644 index 0000000..c715fd6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu.d.ts @@ -0,0 +1,8 @@ +import { GPGPUContext } from './gpgpu_context'; +export declare enum MatrixOrientation { + REGULAR = 0, + TRANSPOSED = 1 +} +export declare function getFragmentShaderSource(sharedDimension: number, aOrientation: MatrixOrientation, bOrientation: MatrixOrientation): string; +export declare function multiplyMatrixPacked(gpgpu: GPGPUContext, multiplyProgram: WebGLProgram, a: WebGLTexture, b: WebGLTexture, result: WebGLTexture, resultShapeRowCol: [number, number]): void; +export declare function uploadMultiplyMatrixPackedDownload(a: Float32Array, aShapeRowCol: [number, number], b: Float32Array, bShapeRowCol: [number, number], aOrientation?: MatrixOrientation, bOrientation?: MatrixOrientation): Float32Array; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu.js new file mode 100644 index 0000000..9b5061c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var gpgpu_context_1 = require("./gpgpu_context"); +var webgl_util = require("./webgl_util"); +var MatrixOrientation; +(function (MatrixOrientation) { + MatrixOrientation[MatrixOrientation["REGULAR"] = 0] = "REGULAR"; + MatrixOrientation[MatrixOrientation["TRANSPOSED"] = 1] = "TRANSPOSED"; +})(MatrixOrientation = exports.MatrixOrientation || (exports.MatrixOrientation = {})); +function getFragmentShaderSource(sharedDimension, aOrientation, bOrientation) { + var sharedDimensionPacked = Math.ceil(sharedDimension / 2); + var aSample = (aOrientation === MatrixOrientation.REGULAR) ? + 'center, resultUV.t' : + 'resultUV.t, center'; + var bSample = (bOrientation === MatrixOrientation.REGULAR) ? + 'resultUV.s, center' : + 'center, resultUV.s'; + var aSwizzle = (aOrientation === MatrixOrientation.REGULAR) ? ['a.xxzz', 'a.yyww'] : + ['a.xxyy', 'a.zzww']; + var bSwizzle = (bOrientation === MatrixOrientation.REGULAR) ? ['b.xyxy', 'b.zwzw'] : + ['b.xzxz', 'b.ywyw']; + return "\n precision highp float;\n uniform sampler2D matrixA;\n uniform sampler2D matrixB;\n varying vec2 resultUV;\n\n const float sharedDimension = " + sharedDimensionPacked + ".0;\n\n vec4 dot2x2ARowBCol() {\n vec4 result = vec4(0, 0, 0, 0);\n for (int ii = 0; ii < " + sharedDimensionPacked + "; ii++) {\n float i = float(ii);\n float center = (i + 0.5) / sharedDimension;\n vec4 a = texture2D(matrixA, vec2(" + aSample + "));\n vec4 b = texture2D(matrixB, vec2(" + bSample + "));\n result +=\n (" + aSwizzle[0] + " * " + bSwizzle[0] + ") + (" + aSwizzle[1] + " * " + bSwizzle[1] + ");\n }\n return result;\n }\n\n void main() {\n gl_FragColor = dot2x2ARowBCol();\n }"; +} +exports.getFragmentShaderSource = getFragmentShaderSource; +function multiplyMatrixPacked(gpgpu, multiplyProgram, a, b, result, resultShapeRowCol) { + gpgpu.setOutputPackedMatrixTexture(result, resultShapeRowCol[0], resultShapeRowCol[1]); + gpgpu.setProgram(multiplyProgram); + var matrixASamplerLocation = webgl_util.getProgramUniformLocationOrThrow(gpgpu.gl, multiplyProgram, 'matrixA'); + var matrixBSamplerLocation = webgl_util.getProgramUniformLocationOrThrow(gpgpu.gl, multiplyProgram, 'matrixB'); + gpgpu.setInputMatrixTexture(a, matrixASamplerLocation, 0); + gpgpu.setInputMatrixTexture(b, matrixBSamplerLocation, 1); + gpgpu.executeProgram(); +} +exports.multiplyMatrixPacked = multiplyMatrixPacked; +function uploadMultiplyMatrixPackedDownload(a, aShapeRowCol, b, bShapeRowCol, aOrientation, bOrientation) { + if (aOrientation === void 0) { aOrientation = MatrixOrientation.REGULAR; } + if (bOrientation === void 0) { bOrientation = MatrixOrientation.REGULAR; } + var resultNumRows = (aOrientation === MatrixOrientation.REGULAR) ? + aShapeRowCol[0] : + aShapeRowCol[1]; + var resultNumCols = (bOrientation === MatrixOrientation.REGULAR) ? + bShapeRowCol[1] : + bShapeRowCol[0]; + var sharedDimension = (aOrientation === MatrixOrientation.REGULAR) ? + aShapeRowCol[1] : + aShapeRowCol[0]; + var gpgpu = new gpgpu_context_1.GPGPUContext(); + var program = gpgpu.createProgram(getFragmentShaderSource(sharedDimension, aOrientation, bOrientation)); + var aTexture = gpgpu.createPackedMatrixTexture(aShapeRowCol[0], aShapeRowCol[1]); + var bTexture = gpgpu.createPackedMatrixTexture(bShapeRowCol[0], bShapeRowCol[1]); + var resultTexture = gpgpu.createPackedMatrixTexture(resultNumRows, resultNumCols); + gpgpu.uploadMatrixToPackedTexture(aTexture, aShapeRowCol[0], aShapeRowCol[1], a); + gpgpu.uploadMatrixToPackedTexture(bTexture, bShapeRowCol[0], bShapeRowCol[1], b); + multiplyMatrixPacked(gpgpu, program, aTexture, bTexture, resultTexture, [resultNumRows, resultNumCols]); + var result = gpgpu.downloadMatrixFromPackedTexture(resultTexture, resultNumRows, resultNumCols); + gpgpu.deleteMatrixTexture(aTexture); + gpgpu.deleteMatrixTexture(bTexture); + gpgpu.deleteMatrixTexture(resultTexture); + gpgpu.deleteProgram(program); + gpgpu.dispose(); + return result; +} +exports.uploadMultiplyMatrixPackedDownload = uploadMultiplyMatrixPackedDownload; +//# sourceMappingURL=mulmat_packed_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu.js.map new file mode 100644 index 0000000..66cf40e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mulmat_packed_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/mulmat_packed_gpu.ts"],"names":[],"mappings":";;AAiBA,iDAA6C;AAC7C,yCAA2C;AAE3C,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,+DAAO,CAAA;IACP,qEAAU,CAAA;AACZ,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B;AAED,iCACI,eAAuB,EAAE,YAA+B,EACxD,YAA+B;IAcjC,IAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;IAC7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AAM,QAAQ,GACV,KAAK,CAAC,yBAAyB,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,IAAM,aAAa,GACf,KAAK,CAAC,yBAAyB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IAElE,KAAK,CAAC,2BAA2B,CAC7B,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnD,KAAK,CAAC,2BAA2B,CAC7B,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnD,oBAAoB,CAChB,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EACjD,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC;IAEpC,IAAM,MAAM,GAAG,KAAK,CAAC,+BAA+B,CAChD,aAAa,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;IAEjD,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACpC,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACpC,KAAK,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACzC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC7B,KAAK,CAAC,OAAO,EAAE,CAAC;IAEhB,OAAO,MAAM,CAAC;AAChB,CAAC;AA5CD,gFA4CC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu_test.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu_test.js new file mode 100644 index 0000000..b7e1843 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu_test.js @@ -0,0 +1,322 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var jasmine_util_1 = require("../../jasmine_util"); +var test_util_1 = require("../../test_util"); +var gpgpu_context_1 = require("./gpgpu_context"); +var mulmat_packed_gpu = require("./mulmat_packed_gpu"); +var mulmat_packed_gpu_1 = require("./mulmat_packed_gpu"); +var DOWNLOAD_FLOAT_ENVS = { + 'WEBGL_DOWNLOAD_FLOAT_ENABLED': true +}; +jasmine_util_1.describeWithFlags('mulmat_packed_gpu (1x1 * 1x1)', DOWNLOAD_FLOAT_ENVS, function () { + it('returns a 1x1 matrix', function () { + var a = new Float32Array([0]); + var b = new Float32Array([0]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, 1], b, [1, 1]); + expect(result.length).toEqual(1); + }); + it('returns [0] when multiplying [0] by [0]', function () { + var a = new Float32Array([0]); + var b = new Float32Array([0]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, 1], b, [1, 1]); + expect(result[0]).toEqual(0); + }); + it('returns [1] when multiplying [1] by [1]', function () { + var a = new Float32Array([1]); + var b = new Float32Array([1]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, 1], b, [1, 1]); + expect(result[0]).toEqual(1); + }); + it('returns [-1] when multiplying [1] by [-1]', function () { + var a = new Float32Array([1]); + var b = new Float32Array([-1]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, 1], b, [1, 1]); + expect(result[0]).toEqual(-1); + }); + it('returns [4.08] when multiplying [1.2] by [3.4]', function () { + var a = new Float32Array([1.2]); + var b = new Float32Array([3.4]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, 1], b, [1, 1]); + test_util_1.expectNumbersClose(result[0], 4.08); + }); + it('returns [356000] when multiplying [356] by [1000]', function () { + var a = new Float32Array([356]); + var b = new Float32Array([1000]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, 1], b, [1, 1]); + expect(result[0]).toEqual(356000); + }); + it('returns [-31415926] when multiplying [-3.1415926] by [10000000]', function () { + var a = new Float32Array([-3.1415926]); + var b = new Float32Array([10000000]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, 1], b, [1, 1]); + expect(result[0]).toEqual(-31415926); + }); +}); +jasmine_util_1.describeWithFlags('mulmat_packed_gpu (dot product)', DOWNLOAD_FLOAT_ENVS, function () { + it('returns a 1x1 matrix', function () { + var a = new Float32Array(5); + var b = new Float32Array(5); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, a.length], b, [b.length, 1]); + expect(result.length).toEqual(1); + }); + it('returns zero when one vector is all zeroes', function () { + var a = new Float32Array(5); + var b = new Float32Array([1, 2, 3, 4, 5]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, a.length], b, [b.length, 1]); + expect(result[0]).toEqual(0); + }); + it('returns the sum of b when a is all ones', function () { + var a = new Float32Array([1, 1, 1, 1, 1]); + var b = new Float32Array([0, 1, 2, 3, 100]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, a.length], b, [b.length, 1]); + expect(result[0]).toEqual(106); + }); + it('computes the dot product of a and b', function () { + var a = new Float32Array([10, 20, 30, 40, 50]); + var b = new Float32Array([0.5, 1.1, 12.4, 32.5, -123.98]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, a.length], b, [b.length, 1]); + var expected = cpuDotProduct(a, b); + test_util_1.expectNumbersClose(result[0], expected); + }); + it('computes a dot product on very large vectors', function () { + var a = randomArrayInRange(2048, -1, 1); + var b = randomArrayInRange(2048, -1, 1); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, a.length], b, [b.length, 1]); + var expected = cpuDotProduct(a, b); + test_util_1.expectNumbersClose(result[0], expected); + }); +}); +function cpuMul2x2(a, b) { + if (a.length !== 4 || b.length !== 4) { + throw new Error('a and b must have 4 elements.'); + } + var result = new Float32Array(4); + result[0] = (a[0] * b[0]) + (a[1] * b[2]); + result[1] = (a[0] * b[1]) + (a[1] * b[3]); + result[2] = (a[2] * b[0]) + (a[3] * b[2]); + result[3] = (a[2] * b[1]) + (a[3] * b[3]); + return result; +} +jasmine_util_1.describeWithFlags('mulmat_packed_gpu (2x2 * 2x2)', DOWNLOAD_FLOAT_ENVS, function () { + it('returns a 2x2 matrix', function () { + var a = new Float32Array([0, 0, 0, 0]); + var b = new Float32Array([0, 0, 0, 0]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 2], b, [2, 2]); + expect(result.length).toEqual(4); + }); + it('returns the identity when multiplying two identity matrices', function () { + var a = makeIdentity(2); + var b = makeIdentity(2); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 2], b, [2, 2]); + expect(result).toEqual(cpuMul2x2(a, b)); + }); + it('returns [0] when A is [0]', function () { + var a = new Float32Array([0, 0, 0, 0]); + var b = new Float32Array([1, 2, 3, 4]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 2], b, [2, 2]); + expect(result).toEqual(a); + }); + it('returns [0] when B is [0]', function () { + var a = new Float32Array([1, 2, 3, 4]); + var b = new Float32Array(4); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 2], b, [2, 2]); + expect(result).toEqual(b); + }); + it('returns B when A is identity', function () { + var a = makeIdentity(2); + var b = new Float32Array([11, -22, 33.333, -44.44444]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 2], b, [2, 2]); + expect(result).toEqual(b); + }); + it('returns A when B is identity', function () { + var a = new Float32Array([11, -22, 33.333, -44.44444]); + var b = makeIdentity(2); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 2], b, [2, 2]); + expect(result).toEqual(a); + }); + it('returns the product of A and B when non-identity', function () { + var a = new Float32Array([10000.02, -1.2, 3.14159, -2345.1234]); + var b = new Float32Array([-23.45, 0.01234, 100, 2.5]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 2], b, [2, 2]); + expect(result).toEqual(cpuMul2x2(a, b)); + }); +}); +jasmine_util_1.describeWithFlags('mulmat_packed_gpu (different shapes)', DOWNLOAD_FLOAT_ENVS, function () { + it('returns a 4x1 when multiplying a 4x4 with a 4x1', function () { + var a = new Float32Array(16); + var b = new Float32Array(4); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [4, 4], b, [4, 1]); + expect(result.length).toEqual(4); + }); + it('returns B (4x1) when A (4x4) is I', function () { + var a = makeIdentity(4); + var b = new Float32Array([1, 2, 3, 4]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [4, 4], b, [4, 1]); + expect(result).toEqual(b); + }); + it('4x2 * 2x2', function () { + var a = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8]); + var b = new Float32Array([9, 10, 11, 12]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [4, 2], b, [2, 2]); + var expected = cpuMultiplyMatrix(a, 4, 2, b, 2, 2); + test_util_1.expectArraysClose(result, expected); + }); + it('multiplies a 4x1 by a non-identity 4x4', function () { + var a = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + var b = new Float32Array([1, 2, 3, 4]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [4, 4], b, [4, 1]); + expect(result).toEqual(cpuMultiplyMatrix(a, 4, 4, b, 4, 1)); + }); + it('returns a 2x3 when multiplying a 2x4 by a 4x3', function () { + var a = new Float32Array(8); + var b = new Float32Array(12); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 4], b, [4, 3]); + expect(result.length).toEqual(6); + }); + it('multiplies A (2x4) by B(4x3)', function () { + var a = new Float32Array([0.1, 3.2, -4.5, 11.78, -0.234, -2.999, 7, 9]); + var b = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 4], b, [4, 3]); + var expected = cpuMultiplyMatrix(a, 2, 4, b, 4, 3); + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('mulmat_packed_gpu (large matrices)', DOWNLOAD_FLOAT_ENVS, function () { + it('returns 128x128 when multiplying 2 128x128s', function () { + var a = new Float32Array(128 * 128); + var b = new Float32Array(128 * 128); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [128, 128], b, [128, 128]); + expect(result.length).toEqual(128 * 128); + }); + it('multiplies 2 128x128s', function () { + var a = randomArrayInRange(128 * 128, -1, 1); + var b = randomArrayInRange(128 * 128, -1, 1); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [128, 128], b, [128, 128]); + var expected = cpuMultiplyMatrix(a, 128, 128, b, 128, 128); + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('mulmat_packed_gpu (multiple matrices)', DOWNLOAD_FLOAT_ENVS, function () { + it('4x2 * 2x12 * 12x1 === 4x1', function () { + var aData = new Float32Array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]); + var bData = new Float32Array([ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 + ]); + var cData = new Float32Array([ + -0.1, -0.2, -0.3, -0.4, -0.5, -0.6, -0.7, -0.8, -0.9, -1.0, -1.1, -1.2 + ]); + var gpgpu = new gpgpu_context_1.GPGPUContext(); + var axbProgram = gpgpu.createProgram(mulmat_packed_gpu.getFragmentShaderSource(2, mulmat_packed_gpu_1.MatrixOrientation.REGULAR, mulmat_packed_gpu_1.MatrixOrientation.REGULAR)); + var abxcProgram = gpgpu.createProgram(mulmat_packed_gpu.getFragmentShaderSource(12, mulmat_packed_gpu_1.MatrixOrientation.REGULAR, mulmat_packed_gpu_1.MatrixOrientation.REGULAR)); + var a = gpgpu.createPackedMatrixTexture(4, 2); + var b = gpgpu.createPackedMatrixTexture(2, 12); + var ab = gpgpu.createPackedMatrixTexture(4, 12); + var c = gpgpu.createPackedMatrixTexture(12, 1); + var r = gpgpu.createPackedMatrixTexture(4, 1); + gpgpu.uploadMatrixToPackedTexture(a, 4, 2, aData); + gpgpu.uploadMatrixToPackedTexture(b, 2, 12, bData); + gpgpu.uploadMatrixToPackedTexture(c, 12, 1, cData); + mulmat_packed_gpu.multiplyMatrixPacked(gpgpu, axbProgram, a, b, ab, [4, 12]); + mulmat_packed_gpu.multiplyMatrixPacked(gpgpu, abxcProgram, ab, c, r, [4, 1]); + var result = gpgpu.downloadMatrixFromPackedTexture(r, 4, 1); + var expected = cpuMultiplyMatrix(cpuMultiplyMatrix(aData, 4, 2, bData, 2, 12), 4, 12, cData, 12, 1); + test_util_1.expectArraysClose(result, expected); + gpgpu.deleteMatrixTexture(a); + gpgpu.deleteMatrixTexture(b); + gpgpu.deleteMatrixTexture(ab); + gpgpu.deleteMatrixTexture(c); + gpgpu.deleteMatrixTexture(r); + gpgpu.deleteProgram(axbProgram); + gpgpu.deleteProgram(abxcProgram); + gpgpu.dispose(); + }); +}); +jasmine_util_1.describeWithFlags('mulmat_packed_gpu A * B^t', DOWNLOAD_FLOAT_ENVS, function () { + it('1x1 * 1x1', function () { + var a = new Float32Array([2]); + var b = new Float32Array([3]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [1, 1], b, [1, 1], mulmat_packed_gpu_1.MatrixOrientation.REGULAR, mulmat_packed_gpu_1.MatrixOrientation.TRANSPOSED); + expect(result[0]).toEqual(6); + }); + it('2x2 * 2x2', function () { + var a = new Float32Array([1, 2, 3, 4]); + var b = new Float32Array([5, 6, 7, 8]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 2], b, [2, 2], mulmat_packed_gpu_1.MatrixOrientation.REGULAR, mulmat_packed_gpu_1.MatrixOrientation.TRANSPOSED); + var bt = new Float32Array([b[0], b[2], b[1], b[3]]); + var expected = cpuMultiplyMatrix(a, 2, 2, bt, 2, 2); + test_util_1.expectArraysClose(result, expected); + }); + it('2x4 * 4x2', function () { + var a = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8]); + var b = new Float32Array([9, 10, 11, 12, 13, 14, 15, 16]); + var result = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 4], b, [2, 4], mulmat_packed_gpu_1.MatrixOrientation.REGULAR, mulmat_packed_gpu_1.MatrixOrientation.TRANSPOSED); + var bt = new Float32Array([b[0], b[4], b[1], b[5], b[2], b[6], b[3], b[7]]); + var expected = cpuMultiplyMatrix(a, 2, 4, bt, 4, 2); + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('mulmat_packed_gpu (transposed versions)', DOWNLOAD_FLOAT_ENVS, function () { + it('A * B^t', function () { + var a = new Float32Array([1, 2, 3, 4, 5, 6]); + var b = new Float32Array([1, 0, 2, 4, 3, 0]); + var c = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 3], b, [2, 3], mulmat_packed_gpu_1.MatrixOrientation.REGULAR, mulmat_packed_gpu_1.MatrixOrientation.TRANSPOSED); + var expected = new Float32Array([7, 10, 16, 31]); + expect(c).toEqual(expected); + }); + it('A^t * B', function () { + var a = new Float32Array([1, 2, 3, 4, 5, 6]); + var b = new Float32Array([1, 0, 2, 4, 3, 0]); + var c = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [2, 3], b, [2, 3], mulmat_packed_gpu_1.MatrixOrientation.TRANSPOSED, mulmat_packed_gpu_1.MatrixOrientation.REGULAR); + var expected = new Float32Array([17, 12, 2, 22, 15, 4, 27, 18, 6]); + expect(c).toEqual(expected); + }); + it('A^t * B^t', function () { + var a = new Float32Array([1, 2, 3, 4, 5, 6]); + var b = new Float32Array([1, 0, 2, 4, 3, 0]); + var c = mulmat_packed_gpu.uploadMultiplyMatrixPackedDownload(a, [3, 2], b, [2, 3], mulmat_packed_gpu_1.MatrixOrientation.TRANSPOSED, mulmat_packed_gpu_1.MatrixOrientation.TRANSPOSED); + var expected = new Float32Array([11, 13, 14, 20]); + expect(c).toEqual(expected); + }); +}); +function randomArrayInRange(n, minValue, maxValue) { + var v = new Float32Array(n); + var range = maxValue - minValue; + for (var i = 0; i < n; ++i) { + v[i] = (Math.random() * range) + minValue; + } + return v; +} +function makeIdentity(n) { + var i = new Float32Array(n * n); + for (var j = 0; j < n; ++j) { + i[(j * n) + j] = 1; + } + return i; +} +function cpuMultiplyMatrix(a, aRow, aCol, b, bRow, bCol) { + var result = new Float32Array(aRow * bCol); + for (var r = 0; r < aRow; ++r) { + var aOffset = (r * aCol); + var cOffset = (r * bCol); + for (var c = 0; c < bCol; ++c) { + var d = 0; + for (var k = 0; k < aCol; ++k) { + d += a[aOffset + k] * b[(k * bCol) + c]; + } + result[cOffset + c] = d; + } + } + return result; +} +function cpuDotProduct(a, b) { + if (a.length !== b.length) { + throw new Error('cpuDotProduct: incompatible vectors.'); + } + var d = 0; + for (var i = 0; i < a.length; ++i) { + d += a[i] * b[i]; + } + return d; +} +//# sourceMappingURL=mulmat_packed_gpu_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu_test.js.map new file mode 100644 index 0000000..f11e701 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/mulmat_packed_gpu_test.js.map @@ -0,0 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AAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KAClB;IACD,OAAO,CAAC,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/multinomial_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/multinomial_gpu.d.ts new file mode 100644 index 0000000..76673d1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/multinomial_gpu.d.ts @@ -0,0 +1,10 @@ +import { GPGPUContext } from './gpgpu_context'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class MultinomialProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + seedLoc: WebGLUniformLocation; + constructor(batchSize: number, numOutcomes: number, numSamples: number); + getCustomSetupFunc(seed: number): (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/multinomial_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/multinomial_gpu.js new file mode 100644 index 0000000..d26cc7b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/multinomial_gpu.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var MultinomialProgram = (function () { + function MultinomialProgram(batchSize, numOutcomes, numSamples) { + this.variableNames = ['probs']; + this.outputShape = [batchSize, numSamples]; + this.userCode = "\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < " + (numOutcomes - 1) + "; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(" + (numOutcomes - 1) + "));\n }\n "; + } + MultinomialProgram.prototype.getCustomSetupFunc = function (seed) { + var _this = this; + return function (gpgpu, webGLProgram) { + if (_this.seedLoc == null) { + _this.seedLoc = gpgpu.getUniformLocation(webGLProgram, 'seed'); + } + gpgpu.gl.uniform1f(_this.seedLoc, seed); + }; + }; + return MultinomialProgram; +}()); +exports.MultinomialProgram = MultinomialProgram; +//# sourceMappingURL=multinomial_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/multinomial_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/multinomial_gpu.js.map new file mode 100644 index 0000000..74bd948 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/multinomial_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"multinomial_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/multinomial_gpu.ts"],"names":[],"mappings":";;AAoBA;IAQE,4BAAY,SAAiB,EAAE,WAAmB,EAAE,UAAkB;QAPtE,kBAAa,GAAG,CAAC,OAAO,CAAC,CAAC;QAQxB,IAAI,CAAC,WAAW,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAE3C,IAAI,CAAC,QAAQ,GAAG,gOAUU,WAAW,GAAG,CAAC,4PAUnB,WAAW,GAAG,CAAC,wBAEpC,CAAC;IACJ,CAAC;IAED,+CAAkB,GAAlB,UAAmB,IAAY;QAA/B,iBAOC;QANC,OAAO,UAAC,KAAmB,EAAE,YAA0B;YACrD,IAAI,KAAI,CAAC,OAAO,IAAI,IAAI,EAAE;gBACxB,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC,kBAAkB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;aAC/D;YACD,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC,CAAC;IACJ,CAAC;IACH,yBAAC;AAAD,CAAC,AA5CD,IA4CC;AA5CY,gDAAkB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/onehot_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/onehot_gpu.d.ts new file mode 100644 index 0000000..fbcf404 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/onehot_gpu.d.ts @@ -0,0 +1,8 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class OneHotProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + seedLoc: WebGLUniformLocation; + constructor(numIndices: number, depth: number, onValue: number, offValue: number); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/onehot_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/onehot_gpu.js new file mode 100644 index 0000000..4e0e660 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/onehot_gpu.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var OneHotProgram = (function () { + function OneHotProgram(numIndices, depth, onValue, offValue) { + this.variableNames = ['indices']; + this.outputShape = [numIndices, depth]; + this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(" + offValue + "), float(" + onValue + "),\n float(index == coords.y)));\n }\n "; + } + return OneHotProgram; +}()); +exports.OneHotProgram = OneHotProgram; +//# sourceMappingURL=onehot_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/onehot_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/onehot_gpu.js.map new file mode 100644 index 0000000..69fa907 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/onehot_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"onehot_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/onehot_gpu.ts"],"names":[],"mappings":";;AAmBA;IAQE,uBACI,UAAkB,EAAE,KAAa,EAAE,OAAe,EAAE,QAAgB;QARxE,kBAAa,GAAG,CAAC,SAAS,CAAC,CAAC;QAS1B,IAAI,CAAC,WAAW,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAEvC,IAAI,CAAC,QAAQ,GAAG,qJAIU,QAAQ,iBAAY,OAAO,yEAGpD,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AArBD,IAqBC;AArBY,sCAAa"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pad_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pad_gpu.d.ts new file mode 100644 index 0000000..04b8862 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pad_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class PadProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(xShape: number[], paddings: Array<[number, number]>, constantValue: number); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pad_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pad_gpu.js new file mode 100644 index 0000000..8f274b3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pad_gpu.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var shader_compiler_1 = require("./shader_compiler"); +var PadProgram = (function () { + function PadProgram(xShape, paddings, constantValue) { + this.variableNames = ['x']; + this.outputShape = paddings.map(function (p, i) { return p[0] + xShape[i] + p[1]; }); + var rank = xShape.length; + var type = shader_compiler_1.getCoordsDataType(rank); + var start = paddings.map(function (p) { return p[0]; }).join(','); + var end = paddings.map(function (p, i) { return p[0] + xShape[i]; }).join(','); + var unpackedCoords = ['coords[0]', 'coords[1]', 'coords[2]', 'coords[3]'].slice(0, rank); + if (rank === 1) { + this.userCode = "\n int start = " + start + ";\n int end = " + end + ";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float(" + constantValue + "));\n } else {\n setOutput(getX(outC - start));\n }\n }\n "; + return; + } + this.userCode = "\n " + type + " start = " + type + "(" + start + ");\n " + type + " end = " + type + "(" + end + ");\n\n void main() {\n " + type + " outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float(" + constantValue + "));\n } else {\n " + type + " coords = outC - start;\n setOutput(getX(" + unpackedCoords + "));\n }\n }\n "; + } + return PadProgram; +}()); +exports.PadProgram = PadProgram; +//# sourceMappingURL=pad_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pad_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pad_gpu.js.map new file mode 100644 index 0000000..e60edfe --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pad_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pad_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/pad_gpu.ts"],"names":[],"mappings":";;AAkBA,qDAAoD;AAEpD;IAKE,oBACI,MAAgB,EAAE,QAAiC,EACnD,aAAqB;QANzB,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAOpB,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,GAAG,CAC3B,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,CAAC,CAAC,CAAC,GAAmB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAvC,CAAuC,CAAgB,CAAC;QACtE,IAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;QAC3B,IAAM,IAAI,GAAG,mCAAiB,CAAC,IAAI,CAAC,CAAC;QAErC,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,CAAC,EAAJ,CAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,IAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAhB,CAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/D,IAAM,cAAc,GACf,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAExE,IAAI,IAAI,KAAK,CAAC,EAAE;YACd,IAAI,CAAC,QAAQ,GAAG,2BACA,KAAK,6BACP,GAAG,uJAKO,aAAa,wGAKpC,CAAC;YACF,OAAO;SACR;QACD,IAAI,CAAC,QAAQ,GAAG,aACZ,IAAI,iBAAY,IAAI,SAAI,KAAK,kBAC7B,IAAI,eAAU,IAAI,SAAI,GAAG,2CAGvB,IAAI,6IAEc,aAAa,yCAE7B,IAAI,0DACW,cAAc,kCAGpC,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AAjDD,IAiDC;AAjDY,gCAAU"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pool_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pool_gpu.d.ts new file mode 100644 index 0000000..03d06d1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pool_gpu.d.ts @@ -0,0 +1,8 @@ +import { Conv2DInfo } from '../../ops/conv_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class Pool2DProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(convInfo: Conv2DInfo, poolType: 'max' | 'avg', computePositions: boolean); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pool_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pool_gpu.js new file mode 100644 index 0000000..5ff18ed --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pool_gpu.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Pool2DProgram = (function () { + function Pool2DProgram(convInfo, poolType, computePositions) { + this.variableNames = ['x']; + if (poolType === 'avg' && computePositions) { + throw new Error('Cannot compute positions for average pool.'); + } + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + this.outputShape = convInfo.outShape; + var isAvgPool = poolType === 'avg'; + var initializationValue = '0.0'; + if (!isAvgPool) { + initializationValue = '-1.0 / 0.0'; + } + if (computePositions) { + var compareOp_1 = '>='; + this.userCode = "\n const ivec2 strides = ivec2(" + strideHeight + ", " + strideWidth + ");\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value " + compareOp_1 + " currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * " + filterWidth + " + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n "; + return; + } + var compareOp = 'max'; + var returnValue = poolType + "(" + poolType + "(" + poolType + "(" + + 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])'; + if (poolType === 'avg') { + returnValue = "avgValue / count"; + } + var filterWidthNearestVec4 = Math.floor(filterWidth / 4) * 4; + var filterWidthVec4Remainder = filterWidth % 4; + var updateSnippet = "\n if (" + isAvgPool + ") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = " + compareOp + "(values, minMaxValue);\n }\n "; + this.userCode = "\n const ivec2 strides = ivec2(" + strideHeight + ", " + strideWidth + ");\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n const float initializationValue = " + initializationValue + ";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(" + initializationValue + ");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + filterWidthNearestVec4 + "; wC += 4) {\n int xC = xCCorner + wC;\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n getValue(batch, xR, xC + 3, d)\n );\n\n " + updateSnippet + "\n }\n\n int xC = xCCorner + " + filterWidthNearestVec4 + ";\n if (" + (filterWidthVec4Remainder === 1) + ") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n " + updateSnippet + "\n } else if (" + (filterWidthVec4Remainder === 2) + ") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n initializationValue,\n initializationValue\n );\n\n " + updateSnippet + "\n } else if (" + (filterWidthVec4Remainder === 3) + ") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n initializationValue\n );\n\n " + updateSnippet + "\n }\n }\n setOutput(" + returnValue + ");\n }\n "; + } + return Pool2DProgram; +}()); +exports.Pool2DProgram = Pool2DProgram; +//# sourceMappingURL=pool_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pool_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pool_gpu.js.map new file mode 100644 index 0000000..2616919 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/pool_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pool_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/pool_gpu.ts"],"names":[],"mappings":";;AAoBA;IAKE,uBACI,QAAoB,EAAE,QAAqB,EAAE,gBAAyB;QAL1E,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAMpB,IAAI,QAAQ,KAAK,KAAK,IAAI,gBAAgB,EAAE;YAC1C,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC/D;QAED,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACzC,IAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC3C,IAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACzC,IAAM,MAAM,GAAG,QAAQ,CAAC,OA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B,KAAK,CAAC,mOAQhC,aAAa,gCACJ,wBAAwB,KAAK,CAAC,8OAQvC,aAAa,gCACJ,wBAAwB,KAAK,CAAC,yPAQvC,aAAa,oDAGP,WAAW,sBAE1B,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AA1LD,IA0LC;AA1LY,sCAAa"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reduce_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reduce_gpu.d.ts new file mode 100644 index 0000000..a85146f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reduce_gpu.d.ts @@ -0,0 +1,8 @@ +import { ReduceInfo } from '../../ops/reduce_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class ReduceProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(reduceInfo: ReduceInfo, reduceType: 'all' | 'any' | 'max' | 'min' | 'sum'); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reduce_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reduce_gpu.js new file mode 100644 index 0000000..b8f6f83 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reduce_gpu.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ReduceProgram = (function () { + function ReduceProgram(reduceInfo, reduceType) { + this.variableNames = ['x']; + var windowSize = reduceInfo.windowSize; + var batchSize = reduceInfo.batchSize; + var inSize = reduceInfo.inSize; + var outSize = Math.ceil(inSize / windowSize); + this.outputShape = [batchSize, outSize]; + var initializationValue = '0.0'; + var compareOp = ""; + if (reduceType === 'min') { + initializationValue = '1.0 / 0.0'; + compareOp = "min"; + } + else if (reduceType === 'max') { + initializationValue = '-1.0 / 0.0'; + compareOp = "max"; + } + var returnValue = reduceType + "(" + reduceType + "(" + reduceType + "(" + + 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])'; + if (reduceType === 'sum') { + returnValue = "sumValue"; + } + else if (reduceType === 'all') { + returnValue = "allValue"; + } + else if (reduceType === 'any') { + returnValue = "anyValue"; + } + var windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4; + var windowSizeVec4Remainder = windowSize % 4; + var updateSnippet = "\n if (" + (reduceType === 'sum') + ") {\n sumValue += dot(values, ones);\n } else {\n minMaxValue = " + compareOp + "(values, minMaxValue);\n }\n "; + var vecType = "vec4"; + if (reduceType === 'all') { + initializationValue = '1.0'; + updateSnippet = "\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n "; + vecType = "bvec4"; + } + else if (reduceType === 'any') { + initializationValue = '0.0'; + updateSnippet = "\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n "; + vecType = "bvec4"; + } + var checkOutOfBounds = ''; + if (inSize % windowSize > 0) { + checkOutOfBounds = "\n if (inIdx < 0 || inIdx >= " + inSize + ") {\n return initializationValue;\n }\n "; + } + this.userCode = "\n const float initializationValue = " + initializationValue + ";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n " + checkOutOfBounds + "\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * " + windowSize + ";\n\n vec4 minMaxValue = vec4(" + initializationValue + ");\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < " + windowSizeNearestVec4 + "; i += 4) {\n int inIdx = inOffset + i;\n " + vecType + " values = " + vecType + "(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n " + updateSnippet + "\n }\n\n int inIdx = inOffset + " + windowSizeNearestVec4 + ";\n if (" + (windowSizeVec4Remainder === 1) + ") {\n " + vecType + " values = " + vecType + "(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 2) + ") {\n " + vecType + " values = " + vecType + "(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 3) + ") {\n " + vecType + " values = " + vecType + "(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n " + updateSnippet + "\n }\n setOutput(" + returnValue + ");\n }\n "; + } + return ReduceProgram; +}()); +exports.ReduceProgram = ReduceProgram; +//# sourceMappingURL=reduce_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reduce_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reduce_gpu.js.map new file mode 100644 index 0000000..e2fad8a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reduce_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reduce_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/reduce_gpu.ts"],"names":[],"mappings":";;AAoBA;IAKE,uBACI,UAAsB,EAAE,UAAyC;QALrE,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAMpB,IAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACzC,IAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACvC,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QACjC,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;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W,MAAM,kEAGnC,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,+CACsB,mBAAmB,sHAInD,gBAAgB,0NAQQ,UAAU,6CAEV,mBAAmB,uIAKvB,qBAAqB,oEAEvC,OAAO,kBAAa,OAAO,oMAO3B,aAAa,sDAGQ,qBAAqB,wBACxC,uBAAuB,KAAK,CAAC,wBAC/B,OAAO,kBAAa,OAAO,+KAO3B,aAAa,8BACJ,uBAAuB,KAAK,CAAC,wBACtC,OAAO,kBAAa,OAAO,sLAO3B,aAAa,8BACJ,uBAAuB,KAAK,CAAC,wBACtC,OAAO,kBAAa,OAAO,6LAO3B,aAAa,uCAEL,WAAW,sBAE1B,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AA3ID,IA2IC;AA3IY,sCAAa"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_backprop_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_backprop_gpu.d.ts new file mode 100644 index 0000000..69efde0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_backprop_gpu.d.ts @@ -0,0 +1,8 @@ +import { Tensor4D } from '../../tensor'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class ResizeBilinearBackpropProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(dy: Tensor4D, x: Tensor4D, alignCorners: boolean); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_backprop_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_backprop_gpu.js new file mode 100644 index 0000000..0185b3c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_backprop_gpu.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ResizeBilinearBackpropProgram = (function () { + function ResizeBilinearBackpropProgram(dy, x, alignCorners) { + this.variableNames = ['dy']; + this.outputShape = []; + this.outputShape = x.shape; + var _a = x.shape, xHeight = _a[1], xWidth = _a[2]; + var _b = dy.shape, yHeight = _b[1], yWidth = _b[2]; + var effectiveXSize = [ + (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight, + (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth + ]; + var effectiveYSize = [ + (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight, + (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth + ]; + var heightScale = effectiveXSize[0] / effectiveYSize[0]; + var widthScale = effectiveXSize[1] / effectiveYSize[1]; + var invHeightScale = 1 / heightScale; + var invWidthScale = 1 / widthScale; + var winHeight = (Math.ceil(invHeightScale) * 2) + 2; + var winWidth = (Math.ceil(invWidthScale) * 2) + 2; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(" + heightScale + ");\n const float widthScale = float(" + widthScale + ");\n\n const float invHeightScale = float(" + invHeightScale + ");\n const float invWidthScale = float(" + invWidthScale + ");\n\n const int winHeight = int(" + winHeight + ");\n const int winWidth = int(" + winWidth + ");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= " + yHeight + ") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= " + yWidth + ") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), " + (xHeight - 1) + ".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), " + (xWidth - 1) + ".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "; + } + return ResizeBilinearBackpropProgram; +}()); +exports.ResizeBilinearBackpropProgram = ResizeBilinearBackpropProgram; +//# sourceMappingURL=resize_bilinear_backprop_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_backprop_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_backprop_gpu.js.map new file mode 100644 index 0000000..2f72c70 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_backprop_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resize_bilinear_backprop_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/resize_bilinear_backprop_gpu.ts"],"names":[],"mappings":";;AAoBA;IAKE,uCAAY,EAAY,EAAE,CA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;QAEpD,IAAI,CAAC,QAAQ,GAAG,qQAUsB,WAAW,mDACZ,UAAU,yDAEN,cAAc,sDACf,aAAa,gDAErB,SAAS,6CACV,QAAQ,mjBAcT,OAAO,gRAQL,MAAM,+MAMY,OAAO,GAAG,CAAC,mRAMZ,MAAM,GAAG,CAAC,k9BA8B1D,CAAC;IACJ,CAAC;IACH,oCAAC;AAAD,CAAC,AAtHD,IAsHC;AAtHY,sEAA6B"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_gpu.d.ts new file mode 100644 index 0000000..286d872 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class ResizeBilinearProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(inputShape: [number, number, number, number], newHeight: number, newWidth: number, alignCorners: boolean); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_gpu.js new file mode 100644 index 0000000..a6d0edc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_gpu.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ResizeBilinearProgram = (function () { + function ResizeBilinearProgram(inputShape, newHeight, newWidth, alignCorners) { + this.variableNames = ['A']; + this.outputShape = []; + var batch = inputShape[0], oldHeight = inputShape[1], oldWidth = inputShape[2], depth = inputShape[3]; + this.outputShape = [batch, newHeight, newWidth, depth]; + var effectiveInSize = [ + (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight, + (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth + ]; + var effectiveOutSize = [ + (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight, + (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth + ]; + this.userCode = "\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n " + effectiveInSize[0] / effectiveOutSize[0] + ",\n " + effectiveInSize[1] / effectiveOutSize[1] + ");\n const vec2 inputShapeRC = vec2(" + oldHeight + ".0, " + oldWidth + ".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n "; + } + return ResizeBilinearProgram; +}()); +exports.ResizeBilinearProgram = ResizeBilinearProgram; +//# sourceMappingURL=resize_bilinear_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_gpu.js.map new file mode 100644 index 0000000..ba09b6b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_bilinear_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resize_bilinear_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/resize_bilinear_gpu.ts"],"names":[],"mappings":";;AAmBA;IAKE,+BACI,UAA4C,EAAE,SAAiB,EAC/D,QAAgB,EAAE,YAAqB;QAN3C,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QACtB,gBAAW,GAAa,EAAE,CAAC;QAMlB,IAAA,qBAAK,EAAE,yBAAS,EAAE,wBAAQ,EAAE,qBAAK,CAAe;QACvD,IAAI,CAAC,WAAW,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QAEvD,IAAM,eAAe,GAAqB;YACxC,CAAC,YAAY,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;YAC3D,CAAC,YAAY,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ;SACzD,CAAC;QAEF,IAAM,gBAAgB,GAAqB;YACzC,CAAC,YAAY,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;YAC3D,CAAC,YAAY,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ;SACzD,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,2EAER,eAAe,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,qBACxC,eAAe,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,iDACb,SAAS,YAAO,QAAQ,ikCA6B1D,CAAC;IACJ,CAAC;IACH,4BAAC;AAAD,CAAC,AAxDD,IAwDC;AAxDY,sDAAqB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_backprop_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_backprop_gpu.d.ts new file mode 100644 index 0000000..eb82c6e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_backprop_gpu.d.ts @@ -0,0 +1,8 @@ +import { Tensor4D } from '../../tensor'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class ResizeNearestNeigborBackpropProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(dy: Tensor4D, x: Tensor4D, alignCorners: boolean); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_backprop_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_backprop_gpu.js new file mode 100644 index 0000000..6a9896a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_backprop_gpu.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ResizeNearestNeigborBackpropProgram = (function () { + function ResizeNearestNeigborBackpropProgram(dy, x, alignCorners) { + this.variableNames = ['dy']; + this.outputShape = []; + this.outputShape = x.shape; + var _a = x.shape, xHeight = _a[1], xWidth = _a[2]; + var _b = dy.shape, yHeight = _b[1], yWidth = _b[2]; + var effectiveXSize = [ + (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight, + (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth + ]; + var effectiveYSize = [ + (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight, + (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth + ]; + var heightScale = effectiveXSize[0] / effectiveYSize[0]; + var widthScale = effectiveXSize[1] / effectiveYSize[1]; + var invHeightScale = 1 / heightScale; + var invWidthScale = 1 / widthScale; + var winHeight = (Math.ceil(invHeightScale) * 2) + 2; + var winWidth = (Math.ceil(invWidthScale) * 2) + 2; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(" + heightScale + ");\n const float widthScale = float(" + widthScale + ");\n\n const float invHeightScale = float(" + invHeightScale + ");\n const float invWidthScale = float(" + invWidthScale + ");\n\n const int winHeight = int(" + winHeight + ");\n const int winWidth = int(" + winWidth + ");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= " + yHeight + ") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= " + yWidth + ") {\n continue;\n }\n\n float sourceFracRow =\n float(" + effectiveXSize[0] + ") *\n (float(dyR) / float(" + effectiveYSize[0] + "));\n\n float sourceFracCol =\n float(" + effectiveXSize[1] + ") *\n (float(dyC) / float(" + effectiveYSize[1] + "));\n\n int sourceNearestRow = int(min(\n float(int(" + xHeight + ") - 1),\n " + alignCorners + " ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(" + xWidth + ") - 1),\n " + alignCorners + " ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "; + } + return ResizeNearestNeigborBackpropProgram; +}()); +exports.ResizeNearestNeigborBackpropProgram = ResizeNearestNeigborBackpropProgram; +//# sourceMappingURL=resize_nearest_neighbor_backprop_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_backprop_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_backprop_gpu.js.map new file mode 100644 index 0000000..52e660d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_backprop_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resize_nearest_neighbor_backprop_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/resize_nearest_neighbor_backprop_gpu.ts"],"names":[],"mappings":";;AAoBA;IAKE,6CAAY,EAAY,EAAE,CAAW,EAAE,YAAqB;QAJ5D,kBAAa,GAAG,CAAC,IAAI,CAAC,CAAC;QACvB,gBAAW,GAAa,EAAE,CAAC;QAIzB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC;QACrB,IAAA,YAA+B,EAA5B,eAAO,EAAE,cAAM,CAAc;QAChC,IAAA,aAA8B,EAA3B,eAAO,EAAE,cAAM,CAAa;QAMrC,IAAM,cAAc,GAAqB;YACvC,CAAC,YAAY,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO;YACrD,CAAC,YAAY,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM;SACnD,CAAC;QAEF,IAAM,cAAc,GAAqB;YACvC,CAAC,YAAY,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO;YACrD,CAAC,YAAY,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM;SACnD,CAAC;QAEF,IAAM,WAAW,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QAEzD,IAAM,cAAc,GAAG,CAAC,GAAG,WAAW,CAAC;QACvC,IAAM,aAAa,GAAG,CAAC,GAAG,UAAU,CAAC;QAIrC,IAAM,SAAS,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACtD,IAAM,QAAQ,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAEpD,IAAI,CAAC,QAAQ,GAAG,qQAUsB,WAAW,mDACZ,UAAU,yDAEN,cAAc,sDACf,aAAa,gDAErB,SAAS,6CACV,QAAQ,ikBAcT,OAAO,gRAQL,MAAM,8GAKpB,cAAc,CAAC,CAAC,CAAC,iDACD,cAAc,CAAC,CAAC,CAAC,wEAG/B,cAAc,CAAC,CAAC,CAAC,mDACD,cAAc,CAAC,CAAC,CAAC,sFAG7B,OAAO,iCACjB,YAAY,qLAIF,MAAM,iCAChB,YAAY,uVAYzB,CAAC;IACJ,CAAC;IACH,0CAAC;AAAD,CAAC,AA3GD,IA2GC;AA3GY,kFAAmC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_gpu.d.ts new file mode 100644 index 0000000..2b4d227 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class ResizeNearestNeighborProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(inputShape: [number, number, number, number], newHeight: number, newWidth: number, alignCorners: boolean); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_gpu.js new file mode 100644 index 0000000..66aa7d6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_gpu.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ResizeNearestNeighborProgram = (function () { + function ResizeNearestNeighborProgram(inputShape, newHeight, newWidth, alignCorners) { + this.variableNames = ['A']; + this.outputShape = []; + var batch = inputShape[0], oldHeight = inputShape[1], oldWidth = inputShape[2], depth = inputShape[3]; + this.outputShape = [batch, newHeight, newWidth, depth]; + var effectiveInSize = [ + (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight, + (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth + ]; + var effectiveOutSize = [ + (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight, + (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth + ]; + var roundBase = alignCorners ? '0.5' : '0.0'; + this.userCode = "\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n " + effectiveInSize[0] / effectiveOutSize[0] + ",\n " + effectiveInSize[1] / effectiveOutSize[1] + ");\n const vec2 inputShapeRC = vec2(" + oldHeight + ".0, " + oldWidth + ".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + " + roundBase + ")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n "; + } + return ResizeNearestNeighborProgram; +}()); +exports.ResizeNearestNeighborProgram = ResizeNearestNeighborProgram; +//# sourceMappingURL=resize_nearest_neighbor_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_gpu.js.map new file mode 100644 index 0000000..8a22298 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/resize_nearest_neighbor_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resize_nearest_neighbor_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/resize_nearest_neighbor_gpu.ts"],"names":[],"mappings":";;AAmBA;IAKE,sCACI,UAA4C,EAAE,SAAiB,EAC/D,QAAgB,EAAE,YAAqB;QAN3C,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QACtB,gBAAW,GAAa,EAAE,CAAC;QAMlB,IAAA,qBAAK,EAAE,yBAAS,EAAE,wBAAQ,EAAE,qBAAK,CAAe;QACvD,IAAI,CAAC,WAAW,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QAEvD,IAAM,eAAe,GAAqB;YACxC,CAAC,YAAY,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;YAC3D,CAAC,YAAY,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ;SACzD,CAAC;QAEF,IAAM,gBAAgB,GAAqB;YACzC,CAAC,YAAY,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;YAC3D,CAAC,YAAY,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ;SACzD,CAAC;QAGF,IAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAE/C,IAAI,CAAC,QAAQ,GAAG,2EAER,eAAe,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,qBACxC,eAAe,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,iDACb,SAAS,YAAO,QAAQ,ocAaD,SAAS,sIAMlE,CAAC;IACJ,CAAC;IACH,mCAAC;AAAD,CAAC,AAjDD,IAiDC;AAjDY,oEAA4B"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reverse_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reverse_gpu.d.ts new file mode 100644 index 0000000..b2465b0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reverse_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class ReverseProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(xShape: number[], axis: number[]); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reverse_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reverse_gpu.js new file mode 100644 index 0000000..f3d3663 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reverse_gpu.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var shader_compiler_1 = require("./shader_compiler"); +var ReverseProgram = (function () { + function ReverseProgram(xShape, axis) { + this.variableNames = ['x']; + var rank = xShape.length; + if (rank > 4) { + throw new Error("WebGL backend: Reverse of rank-" + rank + " tensor is not yet supported"); + } + this.outputShape = xShape; + if (rank === 1) { + this.userCode = "\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(" + xShape[0] + " - coord - 1));\n }\n "; + return; + } + var getInCoord = function (i) { + if (axis.indexOf(i) !== -1 && xShape[i] !== 1) { + return xShape[i] + " - coords[" + i + "] - 1"; + } + return "coords[" + i + "]"; + }; + var inCoords = xShape.map(function (_, i) { return getInCoord(i); }).join(','); + var type = shader_compiler_1.getCoordsDataType(rank); + this.userCode = "\n void main() {\n " + type + " coords = getOutputCoords();\n setOutput(getX(" + inCoords + "));\n }\n "; + } + return ReverseProgram; +}()); +exports.ReverseProgram = ReverseProgram; +//# sourceMappingURL=reverse_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reverse_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reverse_gpu.js.map new file mode 100644 index 0000000..bdf4aa8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/reverse_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reverse_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/reverse_gpu.ts"],"names":[],"mappings":";;AAkBA,qDAAoD;AAEpD;IAKE,wBAAY,MAAgB,EAAE,IAAc;QAJ5C,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAKpB,IAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;QAC3B,IAAI,IAAI,GAAG,CAAC,EAAE;YACZ,MAAM,IAAI,KAAK,CACX,oCAAkC,IAAI,iCAA8B,CAAC,CAAC;SAC3E;QACD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAE1B,IAAI,IAAI,KAAK,CAAC,EAAE;YACd,IAAI,CAAC,QAAQ,GAAG,iGAGK,MAAM,CAAC,CAAC,CAAC,uCAE7B,CAAC;YACF,OAAO;SACR;QACD,IAAM,UAAU,GAAG,UAAC,CAAS;YAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;gBAC7C,OAAU,MAAM,CAAC,CAAC,CAAC,kBAAa,CAAC,UAAO,CAAC;aAC1C;YACD,OAAO,YAAU,CAAC,MAAG,CAAC;QACxB,CAAC,CAAC;QACF,IAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,UAAU,CAAC,CAAC,CAAC,EAAb,CAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/D,IAAM,IAAI,GAAG,mCAAiB,CAAC,IAAI,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,oCAEV,IAAI,6DACW,QAAQ,uBAE5B,CAAC;IACJ,CAAC;IACH,qBAAC;AAAD,CAAC,AAtCD,IAsCC;AAtCY,wCAAc"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/segment_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/segment_gpu.d.ts new file mode 100644 index 0000000..db503c3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/segment_gpu.d.ts @@ -0,0 +1,8 @@ +import { SegOpInfo } from '../../ops/segment_util'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class SegmentOpProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(segOpInfo: SegOpInfo, segOpType: 'unsortedSegmentSum'); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/segment_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/segment_gpu.js new file mode 100644 index 0000000..ac1c74a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/segment_gpu.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var SegmentOpProgram = (function () { + function SegmentOpProgram(segOpInfo, segOpType) { + this.variableNames = ['x', 'segmentIds']; + var windowSize = segOpInfo.windowSize; + var batchSize = segOpInfo.batchSize; + var inSize = segOpInfo.inSize; + var numSegments = segOpInfo.numSegments; + var outSize = numSegments * Math.ceil(inSize / windowSize); + this.outputShape = [batchSize, outSize]; + var initializationValue = '0.0'; + var returnValue = "sumValue"; + var windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4; + var windowSizeVec4Remainder = windowSize % 4; + var updateSnippet = "\n sumValue += dot(values, filter);\n "; + var checkValueOutOfBounds = ''; + if (inSize % windowSize > 0) { + checkValueOutOfBounds = "\n if (inIdx < 0 || inIdx >= " + inSize + ") {\n return initializationValue;\n }\n "; + } + var checkSegmentIdOutOfBounds = ''; + if (inSize % windowSize > 0) { + checkSegmentIdOutOfBounds = "\n if (inIdx < 0 || inIdx >= " + inSize + ") {\n return -1.0;\n }\n "; + } + this.userCode = "\n const float initializationValue = " + initializationValue + ";\n\n float getValue(int batch, int inIdx) {\n " + checkValueOutOfBounds + "\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n " + checkSegmentIdOutOfBounds + "\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n " + numSegments + ")) * float(" + windowSize + "));\n int currentSeg = int(mod(float(outIdx), float(" + numSegments + ")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < " + windowSizeNearestVec4 + "; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n " + updateSnippet + "\n }\n\n int inIdx = inOffset + " + windowSizeNearestVec4 + ";\n if (" + (windowSizeVec4Remainder === 1) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 2) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 3) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n " + updateSnippet + "\n }\n setOutput(" + returnValue + ");\n }\n "; + } + return SegmentOpProgram; +}()); +exports.SegmentOpProgram = SegmentOpProgram; +//# sourceMappingURL=segment_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/segment_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/segment_gpu.js.map new file mode 100644 index 0000000..94b943b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/segment_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"segment_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/segment_gpu.ts"],"names":[],"mappings":";;AAoBA;IAKE,0BAAY,SAAoB,EAAE,SAA+B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etC,aAAa,uCAEL,WAAW,sBAE1B,CAAC;IACJ,CAAC;IACH,uBAAC;AAAD,CAAC,AA3ID,IA2IC;AA3IY,4CAAgB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/select_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/select_gpu.d.ts new file mode 100644 index 0000000..3cbcd41 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/select_gpu.d.ts @@ -0,0 +1,7 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class SelectProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + constructor(cRank: number, shape: number[], rank: number); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/select_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/select_gpu.js new file mode 100644 index 0000000..b100f05 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/select_gpu.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var shader_compiler_1 = require("./shader_compiler"); +var SelectProgram = (function () { + function SelectProgram(cRank, shape, rank) { + this.variableNames = ['c', 'a', 'b']; + this.outputShape = shape; + var cCoords; + var abCoords; + if (rank > 4) { + throw Error("Where for rank " + rank + " is not yet supported"); + } + if (rank === 1) { + abCoords = "resRC"; + cCoords = "resRC"; + } + else { + var currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w']; + var cCoordVars = []; + var abCoordVars = []; + for (var i = 0; i < shape.length; i++) { + abCoordVars.push("" + currentCoords[i]); + if (i < cRank) { + cCoordVars.push("" + currentCoords[i]); + } + } + cCoords = cCoordVars.join(); + abCoords = abCoordVars.join(); + } + var dtype = shader_compiler_1.getCoordsDataType(rank); + this.userCode = "\n void main() {\n " + dtype + " resRC = getOutputCoords();\n float cVal = getC(" + cCoords + ");\n if (cVal >= 1.0) {\n setOutput(getA(" + abCoords + "));\n } else {\n setOutput(getB(" + abCoords + "));\n }\n }\n "; + } + return SelectProgram; +}()); +exports.SelectProgram = SelectProgram; +//# sourceMappingURL=select_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/select_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/select_gpu.js.map new file mode 100644 index 0000000..304ede0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/select_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"select_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/select_gpu.ts"],"names":[],"mappings":";;AAkBA,qDAAoD;AAEpD;IAKE,uBAAY,KAAa,EAAE,KAAe,EAAE,IAAY;QAJxD,kBAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAK9B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAEzB,IAAI,OAAO,CAAC;QACZ,IAAI,QAAQ,CAAC;QACb,IAAI,IAAI,GAAG,CAAC,EAAE;YACZ,MAAM,KAAK,CAAC,oBAAkB,IAAI,0BAAuB,CAAC,CAAC;SAC5D;QAED,IAAI,IAAI,KAAK,CAAC,EAAE;YACd,QAAQ,GAAG,OAAO,CAAC;YACnB,OAAO,GAAG,OAAO,CAAC;SACnB;aAAM;YACL,IAAM,aAAa,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;YACnE,IAAM,UAAU,GAAG,EAAE,CAAC;YACtB,IAAM,WAAW,GAAG,EAAE,CAAC;YACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACrC,WAAW,CAAC,IAAI,CAAC,KAAG,aAAa,CAAC,CAAC,CAAG,CAAC,CAAC;gBACxC,IAAI,CAAC,GAAG,KAAK,EAAE;oBACb,UAAU,CAAC,IAAI,CAAC,KAAG,aAAa,CAAC,CAAC,CAAG,CAAC,CAAC;iBACxC;aACF;YACD,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;YAC5B,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;SAC/B;QAED,IAAM,KAAK,GAAG,mCAAiB,CAAC,IAAI,CAAC,CAAC;QAEtC,IAAI,CAAC,QAAQ,GAAG,oCAEV,KAAK,+DACa,OAAO,iEAER,QAAQ,wDAER,QAAQ,kCAG9B,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AA7CD,IA6CC;AA7CY,sCAAa"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/shader_compiler.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/shader_compiler.d.ts new file mode 100644 index 0000000..62b7065 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/shader_compiler.d.ts @@ -0,0 +1,11 @@ +export declare type ShapeInfo = { + logicalShape: number[]; + texShape: [number, number]; + isUniform: boolean; +}; +export declare type InputInfo = { + name: string; + shapeInfo: ShapeInfo; +}; +export declare function makeShader(inputsInfo: InputInfo[], outputShape: ShapeInfo, userCode: string, broadcast: boolean): string; +export declare function getCoordsDataType(rank: number): string; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/shader_compiler.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/shader_compiler.js new file mode 100644 index 0000000..857df3f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/shader_compiler.js @@ -0,0 +1,414 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var broadcast_util = require("../../ops/broadcast_util"); +var util = require("../../util"); +function makeShader(inputsInfo, outputShape, userCode, broadcast) { + var inputPrefixSnippet = inputsInfo.map(function (x) { + var size = util.sizeFromShape(x.shapeInfo.logicalShape); + if (x.shapeInfo.isUniform) { + return "uniform float " + x.name + (size > 1 ? "[" + size + "]" : '') + ";"; + } + return "uniform sampler2D " + x.name + ";"; + }); + inputPrefixSnippet = inputPrefixSnippet.join('\n'); + var inputSamplingSnippet = inputsInfo.map(function (x) { return getInputSamplingSnippet(x, outputShape, broadcast); }) + .join('\n'); + var outTexShape = outputShape.texShape; + var outputSamplingSnippet = getOutputSamplingSnippet(outputShape.logicalShape, outTexShape); + var source = [ + SHADER_PREFIX, FLOAT_TEXTURE_SAMPLE_SNIPPET, + FLOAT_TEXTURE_SETOUTPUT_SNIPPET, inputPrefixSnippet, outputSamplingSnippet, + inputSamplingSnippet, userCode + ].join('\n'); + return source; +} +exports.makeShader = makeShader; +function getSamplerFromInInfo(inInfo) { + var shape = inInfo.shapeInfo.logicalShape; + switch (shape.length) { + case 0: + return getSamplerScalar(inInfo); + case 1: + return getSampler1D(inInfo); + case 2: + return getSampler2D(inInfo); + case 3: + return getSampler3D(inInfo); + case 4: + return getSampler4D(inInfo); + case 5: + return getSampler5D(inInfo); + case 6: + return getSampler6D(inInfo); + default: + throw new Error(shape.length + "-D input sampling" + + " is not yet supported"); + } +} +function getInputSamplingSnippet(inInfo, outShapeInfo, broadcast) { + var res = getSamplerFlat(inInfo); + res += getSamplerFromInInfo(inInfo); + if (broadcast || + util.arraysEqual(inInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape)) { + res += getSamplerAtOutputCoords(inInfo, outShapeInfo, broadcast); + } + return res; +} +function getOutputSamplingSnippet(outShape, outTexShape) { + switch (outShape.length) { + case 0: + return getOutputScalarCoords(); + case 1: + return getOutput1DCoords(outShape, outTexShape); + case 2: + return getOutput2DCoords(outShape, outTexShape); + case 3: + return getOutput3DCoords(outShape, outTexShape); + case 4: + return getOutput4DCoords(outShape, outTexShape); + case 5: + return getOutput5DCoords(outShape, outTexShape); + case 6: + return getOutput6DCoords(outShape, outTexShape); + default: + throw new Error(outShape.length + "-D output sampling is not yet supported"); + } +} +var SAMPLE_1D_SNIPPET = "\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; +var SAMPLE_2D_SNIPPET = "\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\n int index = row * numC + col;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; +var SAMPLE_3D_SNIPPET = "\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\n int stride1, int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; +var SAMPLE_4D_SNIPPET = "\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int row, int col, int depth,\n int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; +var SAMPLE_5D_SNIPPET = "\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int row, int col, int depth,\n int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2 * stride3 + depth3;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; +var SAMPLE_6D_SNIPPET = "\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int stride4,\n int row, int col, int depth, int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\n stride3 + depth3 * stride4 + depth4;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; +var FLOAT_TEXTURE_SAMPLE_SNIPPET = "\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return texture2D(textureSampler, uv).r;\n }\n"; +var FLOAT_TEXTURE_SETOUTPUT_SNIPPET = "\n void setOutput(float val) {\n gl_FragColor = vec4(val, 0, 0, 0);\n }\n"; +var SHADER_PREFIX = "\n precision highp float;\n precision highp int;\n varying vec2 resultUV;\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n bool isNaN(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n bool hasNaN(vec4 values) {\n vec4 v1 = values * values;\n vec4 v2 = values * values;\n return any(notEqual(v1, v2));\n }\n\n float getNaN(vec4 values) {\n return dot(vec4(1), values);\n }\n\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n " + SAMPLE_1D_SNIPPET + "\n " + SAMPLE_2D_SNIPPET + "\n " + SAMPLE_3D_SNIPPET + "\n " + SAMPLE_4D_SNIPPET + "\n " + SAMPLE_5D_SNIPPET + "\n " + SAMPLE_6D_SNIPPET + "\n"; +function getOutputScalarCoords() { + return "\n int getOutputCoords() {\n return 0;\n }\n "; +} +function getOutput1DCoords(shape, texShape) { + if (texShape[0] === 1) { + return "\n int getOutputCoords() {\n return int(resultUV.x * " + texShape[1] + ".0);\n }\n "; + } + if (texShape[1] === 1) { + return "\n int getOutputCoords() {\n return int(resultUV.y * " + texShape[0] + ".0);\n }\n "; + } + return "\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n return resTexRC.x * " + texShape[1] + " + resTexRC.y;\n }\n "; +} +function getOutput3DCoords(shape, texShape) { + var stride0 = shape[1] * shape[2]; + var stride1 = shape[2]; + return "\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n int r = index / " + stride0 + ";\n index -= r * " + stride0 + ";\n int c = index / " + stride1 + ";\n int d = index - c * " + stride1 + ";\n return ivec3(r, c, d);\n }\n "; +} +function getOutput4DCoords(shape, texShape) { + var stride2 = shape[3]; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + return "\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n\n int r = index / " + stride0 + ";\n index -= r * " + stride0 + ";\n\n int c = index / " + stride1 + ";\n index -= c * " + stride1 + ";\n\n int d = index / " + stride2 + ";\n int d2 = index - d * " + stride2 + ";\n\n return ivec4(r, c, d, d2);\n }\n "; +} +function getOutput5DCoords(shape, texShape) { + var stride3 = shape[4]; + var stride2 = shape[3] * stride3; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + return "\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(" + texShape[0] + ",\n " + texShape[1] + "));\n\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n\n int r = index / " + stride0 + ";\n index -= r * " + stride0 + ";\n\n int c = index / " + stride1 + ";\n index -= c * " + stride1 + ";\n\n int d = index / " + stride2 + ";\n index -= d * " + stride2 + ";\n\n int d2 = index / " + stride3 + ";\n int d3 = index - d2 * " + stride3 + ";\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n "; +} +function getOutput6DCoords(shape, texShape) { + var stride4 = shape[5]; + var stride3 = shape[4] * stride4; + var stride2 = shape[3] * stride3; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + return "\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n\n int r = index / " + stride0 + ";\n index -= r * " + stride0 + ";\n\n int c = index / " + stride1 + ";\n index -= c * " + stride1 + ";\n\n int d = index / " + stride2 + ";\n index -= d * " + stride2 + ";\n\n int d2 = index / " + stride3 + ";\n index -= d2 * " + stride3 + ";\n\n int d3 = index / " + stride4 + ";\n int d4 = index - d3 * " + stride4 + ";\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n "; +} +function getOutput2DCoords(shape, texShape) { + if (util.arraysEqual(shape, texShape)) { + return "\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(" + texShape[0] + ", " + texShape[1] + "));\n }\n "; + } + if (shape[1] === 1) { + return "\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n return ivec2(index, 0);\n }\n "; + } + if (shape[0] === 1) { + return "\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n return ivec2(0, index);\n }\n "; + } + return "\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n int r = index / " + shape[1] + ";\n int c = index - r * " + shape[1] + ";\n return ivec2(r, c);\n }\n "; +} +function getSamplerScalar(inputInfo) { + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + if (inputInfo.shapeInfo.isUniform) { + return "float " + funcName + "() {return " + texName + ";}"; + } + return "\n float " + funcName + "() {\n return sampleTexture(" + texName + ", halfCR);\n }\n "; +} +function getSampler1D(inputInfo) { + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + return "\n float " + funcName + "(int index) {\n return " + funcName + "Flat(index);\n }\n "; +} +function getSampler2D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var texShape = inputInfo.shapeInfo.texShape; + if (texShape != null && util.arraysEqual(shape, texShape)) { + var texNumR_1 = texShape[0]; + var texNumC_1 = texShape[1]; + return "\n float " + funcName + "(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(" + texNumC_1 + ".0, " + texNumR_1 + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + var _a = util.squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + var squeezedShape = newShape; + if (squeezedShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, squeezedShape); + var params = ['row', 'col']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col) {\n int index = row * " + shape[1] + " + col;\n return " + funcName + "Flat(index);\n }\n "; + } + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === 1) { + return "\n float " + funcName + "(int row, int col) {\n int index = row * " + shape[1] + " + col;\n vec2 uv = vec2(0.5, (float(index) + 0.5) / " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumR === 1) { + return "\n float " + funcName + "(int row, int col) {\n int index = row * " + shape[1] + " + col;\n vec2 uv = vec2((float(index) + 0.5) / " + texNumC + ".0, 0.5);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col) {\n vec2 uv = UVfrom2D(" + texNumR + ", " + texNumC + ", " + shape[1] + ", row, col);\n return sampleTexture(" + texName + ", uv);\n }\n"; +} +function getSampler3D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var stride0 = shape[1] * shape[2]; + var stride1 = shape[2]; + var _a = util.squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + var squeezedShape = newShape; + if (squeezedShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, squeezedShape); + var params = ['row', 'col', 'depth']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col, int depth) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col, int depth) {\n int index = row * " + stride0 + " + col * " + stride1 + " + depth;\n return " + funcName + "Flat(index);\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === stride0) { + return "\n float " + funcName + "(int row, int col, int depth) {\n int texR = row;\n int texC = col * " + stride1 + " + depth;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumC === stride1) { + return "\n float " + funcName + "(int row, int col, int depth) {\n int texR = row * " + shape[1] + " + col;\n int texC = depth;\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col, int depth) {\n vec2 uv = UVfrom3D(\n " + texNumR + ", " + texNumC + ", " + stride0 + ", " + stride1 + ", row, col, depth);\n return sampleTexture(" + texName + ", uv);\n }\n "; +} +function getSampler4D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var stride2 = shape[3]; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + var _a = util.squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + if (newShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, newShape); + var params = ['row', 'col', 'depth', 'depth2']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n int index = row * " + stride0 + " + col * " + stride1 + " +\n depth * " + stride2 + " + depth2;\n return " + funcName + "Flat(index);\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === stride0) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n int texR = row;\n int texC = col * " + stride1 + " + depth * " + stride2 + " + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumC === stride2) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n int texR = row * " + shape[1] * shape[2] + " + col * " + shape[2] + " + depth;\n int texC = depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n vec2 uv = UVfrom4D(" + texNumR + ", " + texNumC + ", " + stride0 + ", " + stride1 + ",\n " + stride2 + ", row, col, depth, depth2);\n return sampleTexture(" + texName + ", uv);\n }\n "; +} +function getSampler5D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var stride3 = shape[4]; + var stride2 = shape[3] * stride3; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + var _a = util.squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + if (newShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, newShape); + var params = ['row', 'col', 'depth', 'depth2', 'depth3']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n int index = row * " + stride0 + " + col * " + stride1 + " +\n depth * " + stride2 + " + depth2 * " + stride3 + " + depth3;\n return " + funcName + "Flat(index);\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === stride0) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n int texC = col * " + stride1 + " + depth * " + stride2 + " +\n depth2 * " + stride3 + " + depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumC === stride3) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n int texR = row * " + shape[1] * shape[2] + " + col * " + shape[2] + " +\n depth * " + shape[3] + " + depth2;\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n vec2 uv = UVfrom5D(" + texNumR + ", " + texNumC + ", " + stride0 + ", " + stride1 + ",\n " + stride2 + ", " + stride3 + ", row, col, depth, depth2, depth3);\n return sampleTexture(" + texName + ", uv);\n }\n "; +} +function getSampler6D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var stride4 = shape[5]; + var stride3 = shape[4] * stride4; + var stride2 = shape[3] * stride3; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + var _a = util.squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + if (newShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, newShape); + var params = ['row', 'col', 'depth', 'depth2', 'depth3', 'depth4']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * " + stride0 + " + col * " + stride1 + " +\n depth * " + stride2 + " + depth2 * " + stride3 + " + depth3 * " + stride3 + "\n + depth4\n return " + funcName + "Flat(index);\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === stride0) { + return "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n int texC = col * " + stride1 + " + depth * " + stride2 + " + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumC === stride4) { + return "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row * " + shape[1] * shape[2] + " + col * " + shape[2] + " + depth;\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n vec2 uv = UVfrom6D(" + texNumR + ", " + texNumC + ", " + stride0 + ", " + stride1 + ",\n " + stride2 + ", " + stride3 + ", " + stride4 + "\n ,row, col, depth, depth2, depth3, depth4);\n return sampleTexture(" + texName + ", uv);\n }\n "; +} +function getSamplerFlat(inputInfo) { + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1) + 'Flat'; + var inSize = util.sizeFromShape(inputInfo.shapeInfo.logicalShape); + if (inputInfo.shapeInfo.isUniform) { + if (inSize === 1) { + return "float " + funcName + "(int index) {return " + texName + ";}"; + } + return "\n float " + funcName + "(int index) {\n for (int i = 0; i < " + inSize + "; i++) {\n if (i == index) {\n return " + texName + "[i];\n }\n }\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var tNumR = texShape[0]; + var tNumC = texShape[1]; + if (tNumC === 1 && tNumR === 1) { + return "\n float " + funcName + "(int index) {\n return sampleTexture(" + texName + ", halfCR);\n }\n "; + } + if (tNumC === 1) { + return "\n float " + funcName + "(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / " + tNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (tNumR === 1) { + return "\n float " + funcName + "(int index) {\n vec2 uv = vec2((float(index) + 0.5) / " + tNumC + ".0, 0.5);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int index) {\n vec2 uv = UVfrom1D(" + tNumR + ", " + tNumC + ", index);\n return sampleTexture(" + texName + ", uv);\n }\n "; +} +function getBroadcastOutputCoordsSampler(inputInfo, outShapeInfo, texFuncSnippet, funcName) { + var inRank = inputInfo.shapeInfo.logicalShape.length; + var outRank = outShapeInfo.logicalShape.length; + var type = 'int'; + if (outRank === 2) { + type = 'ivec2'; + } + else if (outRank === 3) { + type = 'ivec3'; + } + else if (outRank === 4) { + type = 'ivec4'; + } + var broadcastDims = broadcast_util.getBroadcastDims(inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape); + var rankDiff = outRank - inRank; + var coordsSnippet; + if (inRank === 0) { + coordsSnippet = ''; + } + else if (outRank < 2 && broadcastDims.length >= 1) { + coordsSnippet = 'coords = 0;'; + } + else { + coordsSnippet = + broadcastDims.map(function (d) { return "coords[" + (d + rankDiff) + "] = 0;"; }).join('\n'); + } + var unpackedCoordsSnippet = ''; + if (outRank < 2 && inRank > 0) { + unpackedCoordsSnippet = 'coords'; + } + else { + unpackedCoordsSnippet = inputInfo.shapeInfo.logicalShape + .map(function (s, i) { return "coords[" + (i + rankDiff) + "]"; }) + .join(', '); + } + return "\n float " + funcName + "() {\n " + type + " coords = getOutputCoords();\n " + coordsSnippet + "\n return get" + texFuncSnippet + "(" + unpackedCoordsSnippet + ");\n }\n "; +} +function getSamplerAtOutputCoords(inputInfo, outShapeInfo, supportsBroadcasting) { + var texName = inputInfo.name; + var texFuncSnippet = texName.charAt(0).toUpperCase() + texName.slice(1); + var funcName = 'get' + texFuncSnippet + 'AtOutCoords'; + var broadcastDims = broadcast_util.getBroadcastDims(inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape); + var inRank = inputInfo.shapeInfo.logicalShape.length; + var outRank = outShapeInfo.logicalShape.length; + var doBroadcast = supportsBroadcasting && ((outRank > inRank) || broadcastDims.length > 0); + var broadcastOverOuter = broadcast_util.broadcastDimsAreOuter(broadcastDims); + var isUniform = inputInfo.shapeInfo.isUniform; + if (doBroadcast && !broadcastOverOuter) { + return getBroadcastOutputCoordsSampler(inputInfo, outShapeInfo, texFuncSnippet, funcName); + } + var inSize = util.sizeFromShape(inputInfo.shapeInfo.logicalShape); + var broadcastSnippet = ''; + if (doBroadcast && broadcastOverOuter) { + broadcastSnippet = "\n int mainPart = index / " + inSize + ";\n index -= mainPart * " + inSize + ";\n "; + } + var outTexShape = outShapeInfo.texShape; + if (isUniform) { + if (inSize === 1) { + return "float " + funcName + "() {return " + texName + ";}"; + } + return "\n float " + funcName + "() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + outTexShape[0] + ", " + outTexShape[1] + "));\n int index = resTexRC.x * " + outTexShape[1] + " + resTexRC.y;\n " + broadcastSnippet + "\n return get" + texFuncSnippet + "Flat(index);\n }\n "; + } + var inTexShape = inputInfo.shapeInfo.texShape; + if (util.arraysEqual(inTexShape, outTexShape)) { + return "\n float " + funcName + "() {\n return sampleTexture(" + texName + ", resultUV);\n }\n "; + } + return "\n float " + funcName + "() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + outTexShape[0] + ", " + outTexShape[1] + "));\n int index = resTexRC.x * " + outTexShape[1] + " + resTexRC.y;\n " + broadcastSnippet + "\n int texR = index / " + inTexShape[1] + ";\n int texC = index - texR * " + inTexShape[1] + ";\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + inTexShape[1] + ".0, " + inTexShape[0] + ".0);\n\n return sampleTexture(" + texName + ", uv);\n }\n "; +} +function getCoordsDataType(rank) { + if (rank <= 1) { + return 'int'; + } + else if (rank === 2) { + return 'ivec2'; + } + else if (rank === 3) { + return 'ivec3'; + } + else if (rank === 4) { + return 'ivec4'; + } + else if (rank === 5) { + return 'ivec5'; + } + else if (rank === 6) { + return 'ivec6'; + } + else { + throw Error("GPU for rank " + rank + " is not yet supported"); + } +} +exports.getCoordsDataType = getCoordsDataType; +function squeezeInputInfo(inInfo, squeezedShape) { + var newInputInfo = JSON.parse(JSON.stringify(inInfo)); + newInputInfo.shapeInfo.logicalShape = squeezedShape; + return newInputInfo; +} +function getSqueezedParams(params, keptDims) { + return keptDims.map(function (d) { return params[d]; }).join(', '); +} +//# sourceMappingURL=shader_compiler.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/shader_compiler.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/shader_compiler.js.map new file mode 100644 index 0000000..b9745cb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/shader_compiler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"shader_compiler.js","sourceRoot":"","sources":["../../../src/kernels/webgl/shader_compiler.ts"],"names":[],"mappings":";;AAgBA,yDAA2D;AAC3D,iCAAmC;AAanC,oBACI,UAAuB,EAAE,WAAsB,EAAE,QAAgB,EACjE,SAAkB;IACpB,IAAI,kBAAkB,GAAoB,UAAU,CAAC,GAAG,CAAC,UAAA,CAAC;QACxD,IAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAC1D,IAAI,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE;YACzB,OAAO,mBAAiB,CAAC,CAAC,IAAI,IAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,MAAI,IAAI,MAAG,CAAC,CAAC,CAAC,EAAE,OAAG,CAAC;SACjE;QACD,OAAO,uBAAqB,CAAC,CAAC,IAAI,MAAG,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,kBAAkB,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,IAAM,oBAAoB,GACtB,UAAU,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,uBAAuB,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,EAAlD,CAAkD,CAAC;SAClE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,IAAM,WAAW,GAAG,WAAW,CAAC,QAAQ,CAAC;IACzC,IAAM,qBAAqB,GACvB,wBAAwB,CAAC,WAAW,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IACpE,IAAM,MAAM,GAAG;QACb,aAAa,EAAE,4BAA4B;QAC3C,+BAA+B,EAAE,kBAAkB,EAAE,qBAAqB;QAC1E,oB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0BACI,MAAiB,EAAE,aAAuB;IAE5C,IAAM,YAAY,GAAc,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IACnE,YAAY,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC;IACpD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,2BAA2B,MAAgB,EAAE,QAAkB;IAC7D,OAAO,QAAQ,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,MAAM,CAAC,CAAC,CAAC,EAAT,CAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/slice_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/slice_gpu.d.ts new file mode 100644 index 0000000..c5e7209 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/slice_gpu.d.ts @@ -0,0 +1,11 @@ +import { GPGPUContext } from './gpgpu_context'; +import { GPGPUProgram } from './gpgpu_math'; +export declare class SliceProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + rank: number; + startLoc: WebGLUniformLocation; + constructor(destSize: number[]); + getCustomSetupFunc(start: number[]): (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/slice_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/slice_gpu.js new file mode 100644 index 0000000..9fff0aa --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/slice_gpu.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var shader_compiler_1 = require("./shader_compiler"); +var SliceProgram = (function () { + function SliceProgram(destSize) { + this.variableNames = ['source']; + this.outputShape = destSize; + this.rank = destSize.length; + var dtype = shader_compiler_1.getCoordsDataType(this.rank); + var sourceCoords = getCoords(this.rank); + this.userCode = "\n uniform " + dtype + " start;\n\n void main() {\n " + dtype + " sourceLoc = start + getOutputCoords();\n setOutput(getSource(" + sourceCoords + "));\n }\n "; + } + SliceProgram.prototype.getCustomSetupFunc = function (start) { + var _this = this; + if (start.length !== this.rank) { + throw Error("The rank (" + this.rank + ") of the program must match the " + + ("length of start (" + start.length + ")")); + } + return function (gpgpu, webGLProgram) { + if (_this.startLoc == null) { + _this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'start'); + if (_this.startLoc == null) { + return; + } + } + if (_this.rank === 1) { + gpgpu.gl.uniform1i(_this.startLoc, start[0]); + } + else if (_this.rank === 2) { + gpgpu.gl.uniform2i(_this.startLoc, start[0], start[1]); + } + else if (_this.rank === 3) { + gpgpu.gl.uniform3i(_this.startLoc, start[0], start[1], start[2]); + } + else if (_this.rank === 4) { + gpgpu.gl.uniform4i(_this.startLoc, start[0], start[1], start[2], start[3]); + } + else { + throw Error("Slicing for rank " + _this.rank + " is not yet supported"); + } + }; + }; + return SliceProgram; +}()); +exports.SliceProgram = SliceProgram; +function getCoords(rank) { + if (rank === 1) { + return 'sourceLoc'; + } + else if (rank === 2) { + return 'sourceLoc.x, sourceLoc.y'; + } + else if (rank === 3) { + return 'sourceLoc.x, sourceLoc.y, sourceLoc.z'; + } + else if (rank === 4) { + return 'sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w'; + } + else { + throw Error("Slicing for rank " + rank + " is not yet supported"); + } +} +//# sourceMappingURL=slice_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/slice_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/slice_gpu.js.map new file mode 100644 index 0000000..f7247f9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/slice_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"slice_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/sl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,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aACvD;iBAAM,IAAI,KAAI,CAAC,IAAI,KAAK,CAAC,EAAE;gBAC1B,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aACjE;iBAAM,IAAI,KAAI,CAAC,IAAI,KAAK,CAAC,EAAE;gBAC1B,KAAK,CAAC,EAAE,CAAC,SAAS,CACd,KAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5D;iBAAM;gBACL,MAAM,KAAK,CAAC,sBAAoB,KAAI,CAAC,IAAI,0BAAuB,CAAC,CAAC;aACnE;QACH,CAAC,CAAC;IACJ,CAAC;IACH,mBAAC;AAAD,CAAC,AAvDD,IAuDC;AAvDY,oCAAY;AAyDzB,mBAAmB,IAAY;IAC7B,IAAI,IAAI,KAAK,CAAC,EAAE;QACd,OAAO,WAAW,CAAC;KACpB;SAAM,IAAI,IAAI,KAAK,CAAC,EAAE;QACrB,OAAO,0BAA0B,CAAC;KACnC;SAAM,IAAI,IAAI,KAAK,CAAC,EAAE;QACrB,OAAO,uCAAuC,CAAC;KAChD;SAAM,IAAI,IAAI,KAAK,CAAC,EAAE;QACrB,OAAO,oDAAoD,CAAC;KAC7D;SAAM;QACL,MAAM,KAAK,CAAC,sBAAoB,IAAI,0BAAuB,CAAC,CAAC;KAC9D;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/strided_slice_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/strided_slice_gpu.d.ts new file mode 100644 index 0000000..faf6244 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/strided_slice_gpu.d.ts @@ -0,0 +1,8 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class StridedSliceProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + rank: number; + constructor(begin: number[], strides: number[], shape: number[]); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/strided_slice_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/strided_slice_gpu.js new file mode 100644 index 0000000..d9147dd --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/strided_slice_gpu.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var shader_compiler_1 = require("./shader_compiler"); +var StridedSliceProgram = (function () { + function StridedSliceProgram(begin, strides, shape) { + this.variableNames = ['x']; + this.outputShape = shape; + this.rank = shape.length; + var dtype = shader_compiler_1.getCoordsDataType(this.rank); + var newCoords = ''; + if (this.rank === 1) { + newCoords = 'coords * strides + begin'; + } + else { + newCoords = + shape.map(function (_, i) { return "coords[" + i + "] * strides[" + i + "] + begin[" + i + "]"; }) + .join(','); + } + this.userCode = "\n " + dtype + " begin = " + dtype + "(" + begin + ");\n " + dtype + " strides = " + dtype + "(" + strides + ");\n\n void main() {\n " + dtype + " coords = getOutputCoords();\n setOutput(getX(" + newCoords + "));\n }\n "; + } + return StridedSliceProgram; +}()); +exports.StridedSliceProgram = StridedSliceProgram; +//# sourceMappingURL=strided_slice_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/strided_slice_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/strided_slice_gpu.js.map new file mode 100644 index 0000000..eda7095 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/strided_slice_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"strided_slice_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/strided_slice_gpu.ts"],"names":[],"mappings":";;AAkBA,qDAAoD;AAEpD;IAME,6BAAY,KAAe,EAAE,OAAiB,EAAE,KAAe;QAL/D,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAMpB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC;QACzB,IAAM,KAAK,GAAG,mCAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE;YACnB,SAAS,GAAG,0BAA0B,CAAC;SACxC;aAAM;YACL,SAAS;gBACL,KAAK,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,YAAU,CAAC,oBAAe,CAAC,kBAAa,CAAC,MAAG,EAA5C,CAA4C,CAAC;qBAC5D,IAAI,CAAC,GAAG,CAAC,CAAC;SACpB;QAED,IAAI,CAAC,QAAQ,GAAG,aACZ,KAAK,iBAAY,KAAK,SAAI,KAAK,kBAC/B,KAAK,mBAAc,KAAK,SAAI,OAAO,2CAGjC,KAAK,6DACU,SAAS,uBAE7B,CAAC;IACJ,CAAC;IACH,0BAAC;AAAD,CAAC,AA9BD,IA8BC;AA9BY,kDAAmB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util.d.ts new file mode 100644 index 0000000..d2863f1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util.d.ts @@ -0,0 +1,32 @@ +import { DataType, DataTypeMap } from '../../types'; +export declare enum TextureUsage { + RENDER = 0, + UPLOAD = 1, + PIXELS = 2, + DOWNLOAD = 3 +} +export declare enum PhysicalTextureType { + FLOAT16 = 0, + FLOAT32 = 1, + UNSIGNED_BYTE = 2 +} +export interface TextureData { + texture: WebGLTexture; + shape: number[]; + texShape: [number, number]; + dtype: DataType; + values: DataTypeMap[DataType]; + usage: TextureUsage; +} +export declare function getUnpackedMatrixTextureShapeWidthHeight(rows: number, columns: number): [number, number]; +export declare function getUnpackedArraySizeFromMatrixSize(matrixSize: number, channelsPerTexture: number): number; +export declare function getColorMatrixTextureShapeWidthHeight(rows: number, columns: number): [number, number]; +export declare function getMatrixSizeFromUnpackedArraySize(unpackedSize: number, channelsPerTexture: number): number; +export declare type TypedArray = Float32Array | Uint8Array; +export declare function encodeMatrixToUnpackedArray(matrix: TypedArray, unpackedArray: TypedArray, channelsPerTexture: number): void; +export declare function decodeMatrixFromUnpackedArray(unpackedArray: Float32Array, matrix: Float32Array, channelsPerTexture: number): void; +export declare function decodeMatrixFromUnpackedColorRGBAArray(unpackedArray: Float32Array, matrix: Float32Array, channels: number): void; +export declare function getPackedMatrixTextureShapeWidthHeight(rows: number, columns: number): [number, number]; +export declare function getPackedRGBAArraySizeFromMatrixShape(rows: number, columns: number): number; +export declare function encodeMatrixToPackedRGBA(matrix: Float32Array, rows: number, columns: number, packedRGBA: Float32Array): Float32Array; +export declare function decodeMatrixFromPackedRGBA(packedRGBA: Float32Array, rows: number, columns: number, matrix: Float32Array): Float32Array; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util.js new file mode 100644 index 0000000..b100fb1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util.js @@ -0,0 +1,192 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var TextureUsage; +(function (TextureUsage) { + TextureUsage[TextureUsage["RENDER"] = 0] = "RENDER"; + TextureUsage[TextureUsage["UPLOAD"] = 1] = "UPLOAD"; + TextureUsage[TextureUsage["PIXELS"] = 2] = "PIXELS"; + TextureUsage[TextureUsage["DOWNLOAD"] = 3] = "DOWNLOAD"; +})(TextureUsage = exports.TextureUsage || (exports.TextureUsage = {})); +var PhysicalTextureType; +(function (PhysicalTextureType) { + PhysicalTextureType[PhysicalTextureType["FLOAT16"] = 0] = "FLOAT16"; + PhysicalTextureType[PhysicalTextureType["FLOAT32"] = 1] = "FLOAT32"; + PhysicalTextureType[PhysicalTextureType["UNSIGNED_BYTE"] = 2] = "UNSIGNED_BYTE"; +})(PhysicalTextureType = exports.PhysicalTextureType || (exports.PhysicalTextureType = {})); +function getUnpackedMatrixTextureShapeWidthHeight(rows, columns) { + return [columns, rows]; +} +exports.getUnpackedMatrixTextureShapeWidthHeight = getUnpackedMatrixTextureShapeWidthHeight; +function getUnpackedArraySizeFromMatrixSize(matrixSize, channelsPerTexture) { + return matrixSize * channelsPerTexture; +} +exports.getUnpackedArraySizeFromMatrixSize = getUnpackedArraySizeFromMatrixSize; +function getColorMatrixTextureShapeWidthHeight(rows, columns) { + return [columns * 4, rows]; +} +exports.getColorMatrixTextureShapeWidthHeight = getColorMatrixTextureShapeWidthHeight; +function getMatrixSizeFromUnpackedArraySize(unpackedSize, channelsPerTexture) { + if (unpackedSize % channelsPerTexture !== 0) { + throw new Error("unpackedSize (" + unpackedSize + ") must be a multiple of " + + ("" + channelsPerTexture)); + } + return unpackedSize / channelsPerTexture; +} +exports.getMatrixSizeFromUnpackedArraySize = getMatrixSizeFromUnpackedArraySize; +function encodeMatrixToUnpackedArray(matrix, unpackedArray, channelsPerTexture) { + var requiredSize = getUnpackedArraySizeFromMatrixSize(matrix.length, channelsPerTexture); + if (unpackedArray.length < requiredSize) { + throw new Error("unpackedArray length (" + unpackedArray.length + ") must be >= " + + ("" + requiredSize)); + } + var dst = 0; + for (var src = 0; src < matrix.length; ++src) { + unpackedArray[dst] = matrix[src]; + dst += channelsPerTexture; + } +} +exports.encodeMatrixToUnpackedArray = encodeMatrixToUnpackedArray; +function decodeMatrixFromUnpackedArray(unpackedArray, matrix, channelsPerTexture) { + var requiredSize = getMatrixSizeFromUnpackedArraySize(unpackedArray.length, channelsPerTexture); + if (matrix.length < requiredSize) { + throw new Error("matrix length (" + matrix.length + ") must be >= " + requiredSize); + } + var dst = 0; + for (var src = 0; src < unpackedArray.length; src += channelsPerTexture) { + matrix[dst++] = unpackedArray[src]; + } +} +exports.decodeMatrixFromUnpackedArray = decodeMatrixFromUnpackedArray; +function decodeMatrixFromUnpackedColorRGBAArray(unpackedArray, matrix, channels) { + var requiredSize = unpackedArray.length * channels / 4; + if (matrix.length < requiredSize) { + throw new Error("matrix length (" + matrix.length + ") must be >= " + requiredSize); + } + var dst = 0; + for (var src = 0; src < unpackedArray.length; src += 4) { + for (var c = 0; c < channels; c++) { + matrix[dst++] = unpackedArray[src + c]; + } + } +} +exports.decodeMatrixFromUnpackedColorRGBAArray = decodeMatrixFromUnpackedColorRGBAArray; +function getPackedMatrixTextureShapeWidthHeight(rows, columns) { + return [Math.ceil(columns / 2), Math.ceil(rows / 2)]; +} +exports.getPackedMatrixTextureShapeWidthHeight = getPackedMatrixTextureShapeWidthHeight; +function getPackedRGBAArraySizeFromMatrixShape(rows, columns) { + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + return w * h * 4; +} +exports.getPackedRGBAArraySizeFromMatrixShape = getPackedRGBAArraySizeFromMatrixShape; +function encodeMatrixToPackedRGBA(matrix, rows, columns, packedRGBA) { + var requiredSize = getPackedRGBAArraySizeFromMatrixShape(rows, columns); + if (packedRGBA.length < requiredSize) { + throw new Error("packedRGBA length (" + packedRGBA.length + ") must be >= " + requiredSize); + } + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), textureWidth = _a[0], textureHeight = _a[1]; + var oddWidth = (columns % 2) === 1; + var oddHeight = (rows % 2) === 1; + var widthInFullBlocks = Math.floor(columns / 2); + var heightInFullBlocks = Math.floor(rows / 2); + { + var dstStride = (oddWidth ? 4 : 0); + var oneRow = columns; + var dst = 0; + for (var blockY = 0; blockY < heightInFullBlocks; ++blockY) { + var matrixSrcRow = (blockY * 2 * columns); + for (var blockX = 0; blockX < widthInFullBlocks; ++blockX) { + var matrixSrcCol = blockX * 2; + var src = matrixSrcRow + matrixSrcCol; + packedRGBA[dst] = matrix[src]; + packedRGBA[dst + 1] = matrix[src + 1]; + packedRGBA[dst + 2] = matrix[src + oneRow]; + packedRGBA[dst + 3] = matrix[src + oneRow + 1]; + dst += 4; + } + dst += dstStride; + } + } + if (oddWidth) { + var src = columns - 1; + var dst = (textureWidth - 1) * 4; + var srcStride = 2 * columns; + var dstStride = textureWidth * 4; + for (var blockY = 0; blockY < heightInFullBlocks; ++blockY) { + packedRGBA[dst] = matrix[src]; + packedRGBA[dst + 2] = matrix[src + columns]; + src += srcStride; + dst += dstStride; + } + } + if (oddHeight) { + var src = (rows - 1) * columns; + var dst = (textureHeight - 1) * textureWidth * 4; + for (var blockX = 0; blockX < widthInFullBlocks; ++blockX) { + packedRGBA[dst++] = matrix[src++]; + packedRGBA[dst++] = matrix[src++]; + dst += 2; + } + } + if (oddWidth && oddHeight) { + packedRGBA[packedRGBA.length - 4] = matrix[matrix.length - 1]; + } + return packedRGBA; +} +exports.encodeMatrixToPackedRGBA = encodeMatrixToPackedRGBA; +function decodeMatrixFromPackedRGBA(packedRGBA, rows, columns, matrix) { + var requiredSize = rows * columns; + if (requiredSize < matrix.length) { + throw new Error("matrix length (" + matrix.length + ") must be >= " + requiredSize); + } + var oddWidth = (columns % 2) === 1; + var oddHeight = (rows % 2) === 1; + var widthInFullBlocks = Math.floor(columns / 2); + var heightInFullBlocks = Math.floor(rows / 2); + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), textureWidth = _a[0], textureHeight = _a[1]; + { + var srcStride = oddWidth ? 4 : 0; + var dstStride = columns + (oddWidth ? 1 : 0); + var src = 0; + var dstRow1 = 0; + var dstRow2 = columns; + for (var blockY = 0; blockY < heightInFullBlocks; ++blockY) { + for (var blockX = 0; blockX < widthInFullBlocks; ++blockX) { + matrix[dstRow1++] = packedRGBA[src++]; + matrix[dstRow1++] = packedRGBA[src++]; + matrix[dstRow2++] = packedRGBA[src++]; + matrix[dstRow2++] = packedRGBA[src++]; + } + src += srcStride; + dstRow1 += dstStride; + dstRow2 += dstStride; + } + } + if (oddWidth) { + var src = (textureWidth - 1) * 4; + var dst = columns - 1; + var srcStride = textureWidth * 4; + var dstStride = 2 * columns; + for (var blockY = 0; blockY < heightInFullBlocks; ++blockY) { + matrix[dst] = packedRGBA[src]; + matrix[dst + columns] = packedRGBA[src + 2]; + src += srcStride; + dst += dstStride; + } + } + if (oddHeight) { + var src = (textureHeight - 1) * textureWidth * 4; + var dst = (rows - 1) * columns; + for (var blockX = 0; blockX < widthInFullBlocks; ++blockX) { + matrix[dst++] = packedRGBA[src++]; + matrix[dst++] = packedRGBA[src++]; + src += 2; + } + } + if (oddWidth && oddHeight) { + matrix[matrix.length - 1] = packedRGBA[packedRGBA.length - 4]; + } + return matrix; +} +exports.decodeMatrixFromPackedRGBA = decodeMatrixFromPackedRGBA; +//# sourceMappingURL=tex_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util.js.map new file mode 100644 index 0000000..66d8843 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tex_util.js","sourceRoot":"","sources":["../../../src/kernels/webgl/tex_util.ts"],"names":[],"mappings":";;AAmBA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,uDAAQ,CAAA;AACV,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AAED,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,mEAAO,CAAA;IACP,mEAAO,CAAA;IACP,+EAAa,CAAA;AACf,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BA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,SAAS,CAAC;YACjB,GAAG,IAAI,SAAS,CAAC;SAClB;KACF;IAGD,IAAI,SAAS,EAAE;QACb,IAAI,GAAG,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,GAAG,YAAY,GAAG,CAAC,CAAC;QACjD,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;QAC/B,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,EAAE,EAAE,MAAM,EAAE;YACzD,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;YAClC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;YAClC,GAAG,IAAI,CAAC,CAAC;SACV;KACF;IAGD,IAAI,QAAQ,IAAI,SAAS,EAAE;QACzB,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAC/D;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAlED,gEAkEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util_test.js new file mode 100644 index 0000000..c4c0d97 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util_test.js @@ -0,0 +1,204 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var test_util_1 = require("../../test_util"); +var tex_util = require("./tex_util"); +describe('tex_util getUnpackedMatrixTextureShapeWidthHeight', function () { + it('[1x1] => [1x1]', function () { + expect(tex_util.getUnpackedMatrixTextureShapeWidthHeight(1, 1)).toEqual([ + 1, 1 + ]); + }); + it('[MxN] => [NxM]', function () { + expect(tex_util.getUnpackedMatrixTextureShapeWidthHeight(123, 456)) + .toEqual([456, 123]); + }); +}); +describe('tex_util getPackedMatrixTextureShapeWidthHeight', function () { + it('[1x1] => [1x1]', function () { + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(1, 1); + expect(shape).toEqual([1, 1]); + }); + it('[1x2] => [1x1]', function () { + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(1, 2); + expect(shape).toEqual([1, 1]); + }); + it('[2x1] => [1x1]', function () { + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(2, 1); + expect(shape).toEqual([1, 1]); + }); + it('[2x2] => [1x1]', function () { + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(2, 2); + expect(shape).toEqual([1, 1]); + }); + it('[3x3] => [2x2]', function () { + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(3, 3); + expect(shape).toEqual([2, 2]); + }); + it('[4x3] => [2x2]', function () { + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(4, 3); + expect(shape).toEqual([2, 2]); + }); + it('[3x4] => [2x2]', function () { + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(3, 4); + expect(shape).toEqual([2, 2]); + }); + it('[4x4] => [2x2]', function () { + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(4, 4); + expect(shape).toEqual([2, 2]); + }); + it('[1024x1024] => [512x512]', function () { + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(1024, 1024); + expect(shape).toEqual([512, 512]); + }); + it('[MxN] => [ceil(N/2)xceil(M/2)]', function () { + var M = 123; + var N = 5013; + var shape = tex_util.getPackedMatrixTextureShapeWidthHeight(M, N); + expect(shape).toEqual([Math.ceil(N / 2), Math.ceil(M / 2)]); + }); +}); +describe('tex_util encodeMatrixToUnpackedArray, channels = 4', function () { + it('1x1 writes the only matrix array value to the only texel', function () { + var matrix = new Float32Array([1]); + var unpackedRGBA = new Float32Array([0, 0, 0, 0]); + tex_util.encodeMatrixToUnpackedArray(matrix, unpackedRGBA, 4); + test_util_1.expectArraysClose(unpackedRGBA, new Float32Array([1, 0, 0, 0])); + }); + it('1x1 can upload texels with values greater than 1', function () { + var matrix = new Float32Array([100]); + var unpackedRGBA = new Float32Array([0, 0, 0, 0]); + tex_util.encodeMatrixToUnpackedArray(matrix, unpackedRGBA, 4); + test_util_1.expectArraysClose(unpackedRGBA, new Float32Array([100, 0, 0, 0])); + }); + it('1x4 each texel has 4 elements with matrix value in R channel', function () { + var matrix = new Float32Array([1, 2, 3, 4]); + var unpackedRGBA = new Float32Array(16); + tex_util.encodeMatrixToUnpackedArray(matrix, unpackedRGBA, 4); + test_util_1.expectArraysClose(unpackedRGBA, new Float32Array([1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0])); + }); +}); +describe('tex_util encodeMatrixToUnpackedArray, channels = 1', function () { + it('1x1 writes the only matrix array value to the only texel', function () { + var matrix = new Float32Array([1]); + var unpackedRGBA = new Float32Array([0]); + tex_util.encodeMatrixToUnpackedArray(matrix, unpackedRGBA, 1); + test_util_1.expectArraysClose(unpackedRGBA, new Float32Array([1])); + }); + it('1x1 can upload texels with values greater than 1', function () { + var matrix = new Float32Array([100]); + var unpackedRGBA = new Float32Array([0]); + tex_util.encodeMatrixToUnpackedArray(matrix, unpackedRGBA, 1); + test_util_1.expectArraysClose(unpackedRGBA, new Float32Array([100])); + }); + it('1x4 each texel has 4 elements with matrix value in R channel', function () { + var matrix = new Float32Array([1, 2, 3, 4]); + var unpackedRGBA = new Float32Array(4); + tex_util.encodeMatrixToUnpackedArray(matrix, unpackedRGBA, 1); + test_util_1.expectArraysClose(unpackedRGBA, new Float32Array([1, 2, 3, 4])); + }); +}); +describe('tex_util decodeMatrixFromUnpackedArray', function () { + it('1x1 writes the only matrix array value to the first element', function () { + var unpackedRGBA = new Float32Array([1, 0, 0, 0]); + var matrix = new Float32Array(1); + tex_util.decodeMatrixFromUnpackedArray(unpackedRGBA, matrix, 4); + expect(matrix.length).toEqual(1); + expect(matrix[0]).toEqual(1); + }); + it('1x2 writes the second texel R component to the second element', function () { + var unpackedRGBA = new Float32Array([1, 0, 0, 0, 2, 0, 0, 0]); + var matrix = new Float32Array(2); + tex_util.decodeMatrixFromUnpackedArray(unpackedRGBA, matrix, 4); + expect(matrix.length).toEqual(2); + test_util_1.expectArraysClose(matrix, new Float32Array([1, 2])); + }); +}); +describe('tex_util encodeMatrixToPackedRGBA', function () { + it('1x1 loads the element into R and 0\'s into GBA', function () { + var matrix = new Float32Array([1]); + var packedRGBA = new Float32Array(4); + tex_util.encodeMatrixToPackedRGBA(matrix, 1, 1, packedRGBA); + test_util_1.expectArraysClose(packedRGBA, new Float32Array([1, 0, 0, 0])); + }); + it('1x2 loads the second element into G and 0\'s into BA', function () { + var matrix = new Float32Array([1, 2]); + var packedRGBA = new Float32Array(4); + tex_util.encodeMatrixToPackedRGBA(matrix, 1, 2, packedRGBA); + test_util_1.expectArraysClose(packedRGBA, new Float32Array([1, 2, 0, 0])); + }); + it('2x1 loads the second element into G and 0\'s into BA', function () { + var matrix = new Float32Array([1, 2]); + var packedRGBA = new Float32Array(4); + tex_util.encodeMatrixToPackedRGBA(matrix, 2, 1, packedRGBA); + test_util_1.expectArraysClose(packedRGBA, new Float32Array([1, 0, 2, 0])); + }); + it('2x2 exactly fills one texel', function () { + var matrix = new Float32Array([1, 2, 3, 4]); + var packedRGBA = new Float32Array(4); + tex_util.encodeMatrixToPackedRGBA(matrix, 2, 2, packedRGBA); + test_util_1.expectArraysClose(packedRGBA, new Float32Array([1, 2, 3, 4])); + }); + it('4x3 pads the final column G and A channels with 0', function () { + var matrix = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); + var packedRGBA = new Float32Array(16); + tex_util.encodeMatrixToPackedRGBA(matrix, 4, 3, packedRGBA); + test_util_1.expectArraysClose(packedRGBA, new Float32Array([1, 2, 4, 5, 3, 0, 6, 0, 7, 8, 10, 11, 9, 0, 12, 0])); + }); + it('3x4 pads the final row B and A channels with 0', function () { + var matrix = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); + var packedRGBA = new Float32Array(16); + tex_util.encodeMatrixToPackedRGBA(matrix, 3, 4, packedRGBA); + test_util_1.expectArraysClose(packedRGBA, new Float32Array([1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 0, 0, 11, 12, 0, 0])); + }); + it('3x3 bottom-right texel is R000', function () { + var matrix = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); + var packedRGBA = new Float32Array(16); + tex_util.encodeMatrixToPackedRGBA(matrix, 3, 3, packedRGBA); + test_util_1.expectArraysClose(packedRGBA, new Float32Array([1, 2, 4, 5, 3, 0, 6, 0, 7, 8, 0, 0, 9, 0, 0, 0])); + }); +}); +describe('tex_util decodeMatrixFromPackedRGBA', function () { + it('1x1 matrix only loads R component from only texel', function () { + var packedRGBA = new Float32Array([1, 0, 0, 0]); + var matrix = new Float32Array(1); + tex_util.decodeMatrixFromPackedRGBA(packedRGBA, 1, 1, matrix); + expect(matrix[0]).toEqual(1); + }); + it('1x2 matrix loads RG from only texel', function () { + var packedRGBA = new Float32Array([1, 2, 0, 0]); + var matrix = new Float32Array(2); + tex_util.decodeMatrixFromPackedRGBA(packedRGBA, 1, 2, matrix); + test_util_1.expectArraysClose(matrix, new Float32Array([1, 2])); + }); + it('2x1 matrix loads RB from only texel', function () { + var packedRGBA = new Float32Array([1, 0, 2, 0]); + var matrix = new Float32Array(2); + tex_util.decodeMatrixFromPackedRGBA(packedRGBA, 2, 1, matrix); + test_util_1.expectArraysClose(matrix, new Float32Array([1, 2])); + }); + it('2x2 matrix loads RGBA from only texel', function () { + var packedRGBA = new Float32Array([1, 2, 3, 4]); + var matrix = new Float32Array(4); + tex_util.decodeMatrixFromPackedRGBA(packedRGBA, 2, 2, matrix); + test_util_1.expectArraysClose(matrix, new Float32Array([1, 2, 3, 4])); + }); + it('4x3 final column only reads RB from edge texels', function () { + var packedRGBA = new Float32Array([1, 2, 4, 5, 3, 0, 6, 0, 7, 8, 10, 11, 9, 0, 12, 0]); + var matrix = new Float32Array(12); + tex_util.decodeMatrixFromPackedRGBA(packedRGBA, 4, 3, matrix); + test_util_1.expectArraysClose(matrix, new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])); + }); + it('3x4 final row only reads RG from edge texels', function () { + var packedRGBA = new Float32Array([1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 0, 0, 11, 12, 0, 0]); + var matrix = new Float32Array(12); + tex_util.decodeMatrixFromPackedRGBA(packedRGBA, 3, 4, matrix); + test_util_1.expectArraysClose(matrix, new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])); + }); + it('3x3 bottom-right only reads R from corner texel', function () { + var packedRGBA = new Float32Array([1, 2, 4, 5, 3, 0, 6, 0, 7, 8, 0, 0, 9, 0, 0, 0]); + var matrix = new Float32Array(9); + tex_util.decodeMatrixFromPackedRGBA(packedRGBA, 3, 3, matrix); + test_util_1.expectArraysClose(matrix, new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9])); + }); +}); +//# sourceMappingURL=tex_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util_test.js.map new file mode 100644 index 0000000..097103e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tex_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tex_util_test.js","sourceRoot":"","sources":["../../../src/kernels/webgl/tex_util_test.ts"],"names":[],"mappings":";;AAiBA,6CAAkD;AAClD,qCAAuC;AAEvC,QAAQ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AAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACvE,IAAM,MAAM,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;QACnC,QAAQ,CAAC,0BAA0B,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9D,6BAAiB,CAAC,MAAM,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/texture_manager.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/texture_manager.d.ts new file mode 100644 index 0000000..7c9e6db --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/texture_manager.d.ts @@ -0,0 +1,17 @@ +import { GPGPUContext } from './gpgpu_context'; +import { TextureUsage } from './tex_util'; +export declare class TextureManager { + private gpgpu; + private numUsedTextures; + private numFreeTextures; + private freeTextures; + private logEnabled; + private usedTextures; + constructor(gpgpu: GPGPUContext); + acquireTexture(shapeRC: [number, number], usage: TextureUsage): WebGLTexture; + releaseTexture(texture: WebGLTexture, shape: [number, number], logicalTexType: TextureUsage): void; + private log; + getNumUsedTextures(): number; + getNumFreeTextures(): number; + dispose(): void; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/texture_manager.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/texture_manager.js new file mode 100644 index 0000000..9779cb8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/texture_manager.js @@ -0,0 +1,121 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../../environment"); +var tex_util_1 = require("./tex_util"); +var TextureManager = (function () { + function TextureManager(gpgpu) { + this.gpgpu = gpgpu; + this.numUsedTextures = 0; + this.numFreeTextures = 0; + this.freeTextures = {}; + this.logEnabled = false; + this.usedTextures = {}; + } + TextureManager.prototype.acquireTexture = function (shapeRC, usage) { + var physicalTexType = getPhysicalFromLogicalTextureType(usage); + var shapeKey = getKeyFromTextureShape(shapeRC, physicalTexType); + if (!(shapeKey in this.freeTextures)) { + this.freeTextures[shapeKey] = []; + } + if (!(shapeKey in this.usedTextures)) { + this.usedTextures[shapeKey] = []; + } + if (this.freeTextures[shapeKey].length > 0) { + this.numFreeTextures--; + this.numUsedTextures++; + this.log(); + var newTexture_1 = this.freeTextures[shapeKey].shift(); + this.usedTextures[shapeKey].push(newTexture_1); + return newTexture_1; + } + this.numUsedTextures++; + this.log(); + var newTexture; + if (physicalTexType === tex_util_1.PhysicalTextureType.FLOAT32) { + newTexture = + this.gpgpu.createFloat32MatrixTexture(shapeRC[0], shapeRC[1]); + } + else if (physicalTexType === tex_util_1.PhysicalTextureType.FLOAT16) { + newTexture = + this.gpgpu.createFloat16MatrixTexture(shapeRC[0], shapeRC[1]); + } + else if (physicalTexType === tex_util_1.PhysicalTextureType.UNSIGNED_BYTE) { + newTexture = + this.gpgpu.createUnsignedBytesMatrixTexture(shapeRC[0], shapeRC[1]); + } + this.usedTextures[shapeKey].push(newTexture); + return newTexture; + }; + TextureManager.prototype.releaseTexture = function (texture, shape, logicalTexType) { + var physicalTexType = getPhysicalFromLogicalTextureType(logicalTexType); + var shapeKey = getKeyFromTextureShape(shape, physicalTexType); + if (!(shapeKey in this.freeTextures)) { + this.freeTextures[shapeKey] = []; + } + this.freeTextures[shapeKey].push(texture); + this.numFreeTextures++; + this.numUsedTextures--; + var texList = this.usedTextures[shapeKey]; + var texIndex = texList.indexOf(texture); + if (texIndex < 0) { + throw new Error('Cannot release a texture that was never provided by this ' + + 'texture manager'); + } + texList.splice(texIndex, 1); + this.log(); + }; + TextureManager.prototype.log = function () { + if (!this.logEnabled) { + return; + } + var total = this.numFreeTextures + this.numUsedTextures; + console.log('Free/Used', this.numFreeTextures + " / " + this.numUsedTextures, "(" + total + ")"); + }; + TextureManager.prototype.getNumUsedTextures = function () { + return this.numUsedTextures; + }; + TextureManager.prototype.getNumFreeTextures = function () { + return this.numFreeTextures; + }; + TextureManager.prototype.dispose = function () { + var _this = this; + if (this.freeTextures == null) { + return; + } + for (var texShape in this.freeTextures) { + this.freeTextures[texShape].forEach(function (tex) { + _this.gpgpu.deleteMatrixTexture(tex); + }); + } + for (var texShape in this.usedTextures) { + this.usedTextures[texShape].forEach(function (tex) { + _this.gpgpu.deleteMatrixTexture(tex); + }); + } + this.freeTextures = null; + this.usedTextures = null; + this.numUsedTextures = 0; + this.numFreeTextures = 0; + }; + return TextureManager; +}()); +exports.TextureManager = TextureManager; +function getPhysicalFromLogicalTextureType(logicalTexType) { + if (logicalTexType === tex_util_1.TextureUsage.DOWNLOAD || + logicalTexType === tex_util_1.TextureUsage.PIXELS) { + return tex_util_1.PhysicalTextureType.UNSIGNED_BYTE; + } + else if (logicalTexType === tex_util_1.TextureUsage.UPLOAD) { + return tex_util_1.PhysicalTextureType.FLOAT32; + } + else if (logicalTexType === tex_util_1.TextureUsage.RENDER) { + return environment_1.ENV.get('WEBGL_RENDER_FLOAT32_ENABLED') ? + tex_util_1.PhysicalTextureType.FLOAT32 : + tex_util_1.PhysicalTextureType.FLOAT16; + } + throw new Error("Unknown logical texture type " + logicalTexType); +} +function getKeyFromTextureShape(shapeRowsCol, physicalTexType) { + return shapeRowsCol[0] + "_" + shapeRowsCol[1] + "_" + physicalTexType; +} +//# sourceMappingURL=texture_manager.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/texture_manager.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/texture_manager.js.map new file mode 100644 index 0000000..45c0610 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/texture_manager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"texture_manager.js","sourceRoot":"","sources":["../../../src/kernels/webgl/texture_manager.ts"],"names":[],"mappings":";;AAiBA,iDAAsC;AAGtC,uCAA6D;AAE7D;IAOE,wBAAoB,KAAmB;QAAnB,UAAK,GAAL,KAAK,CAAc;QAN/B,oBAAe,GAAG,CAAC,CAAC;QACpB,oBAAe,GAAG,CAAC,CAAC;QACpB,iBAAY,GAAsC,EAAE,CAAC;QACrD,eAAU,GAAG,KAAK,CAAC;QACnB,iBAAY,GAAsC,EAAE,CAAC;IAEnB,CAAC;IAE3C,uCAAc,GAAd,UAAe,OAAyB,EAAE,KAAmB;QAC3D,IAAM,eAAe,GAAG,iCAAiC,CAAC,KAAK,CAAC,CAAC;QAEjE,IAAM,QAAQ,GAAG,sBAAsB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QAClE,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC,EAAE;YACpC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;SAClC;QACD,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC,EAAE;YACpC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;SAClC;QAED,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,IAAM,YAAU,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;YAC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,CAAC,YAAY,EAAE;YACxC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;gBACrC,KAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;SACJ;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;IAC3B,CAAC;IACH,qBAAC;AAAD,CAAC,AA5GD,IA4GC;AA5GY,wCAAc;AA8G3B,2CAA2C,cAA4B;IAErE,IAAI,cAAc,KAAK,uBAAY,CAAC,QAAQ;QACxC,cAAc,KAAK,uBAAY,CAAC,MAAM,EAAE;QAC1C,OAAO,8BAAmB,CAAC,aAAa,CAAC;KAC1C;SAAM,IAAI,cAAc,KAAK,uBAAY,CAAC,MAAM,EAAE;QACjD,OAAO,8BAAmB,CAAC,OAAO,CAAC;KACpC;SAAM,IAAI,cAAc,KAAK,uBAAY,CAAC,MAAM,EAAE;QACjD,OAAO,iBAAG,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC,CAAC;YAC5C,8BAAmB,CAAC,OAAO,CAAC,CAAC;YAC7B,8BAAmB,CAAC,OAAO,CAAC;KACjC;IACD,MAAM,IAAI,KAAK,CAAC,kCAAgC,cAAgB,CAAC,CAAC;AACpE,CAAC;AAED,gCACI,YAA8B,EAC9B,eAAoC;IACtC,OAAU,YAAY,CAAC,CAAC,CAAC,SAAI,YAAY,CAAC,CAAC,CAAC,SAAI,eAAiB,CAAC;AACpE,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tile_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tile_gpu.d.ts new file mode 100644 index 0000000..8476401 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tile_gpu.d.ts @@ -0,0 +1,8 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class TileProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + rank: number; + constructor(aShape: number[], reps: number[]); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tile_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tile_gpu.js new file mode 100644 index 0000000..8107e12 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tile_gpu.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var shader_compiler_1 = require("./shader_compiler"); +var TileProgram = (function () { + function TileProgram(aShape, reps) { + this.variableNames = ['A']; + var outputShape = new Array(aShape.length); + for (var i = 0; i < outputShape.length; i++) { + outputShape[i] = aShape[i] * reps[i]; + } + this.outputShape = outputShape; + this.rank = outputShape.length; + var dtype = shader_compiler_1.getCoordsDataType(this.rank); + var sourceCoords = getSourceCoords(aShape); + this.userCode = "\n void main() {\n " + dtype + " resRC = getOutputCoords();\n setOutput(getA(" + sourceCoords + "));\n }\n "; + } + return TileProgram; +}()); +exports.TileProgram = TileProgram; +function getSourceCoords(aShape) { + var rank = aShape.length; + if (rank > 5) { + throw Error("Tile for rank " + rank + " is not yet supported"); + } + if (rank === 1) { + return "imod(resRC, " + aShape[0] + ")"; + } + var currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u']; + var sourceCoords = []; + for (var i = 0; i < aShape.length; i++) { + sourceCoords.push("imod(" + currentCoords[i] + ", " + aShape[i] + ")"); + } + return sourceCoords.join(); +} +//# sourceMappingURL=tile_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tile_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/tile_gpu.js.map new file mode 100644 index 0000000..8b48e6f --- /dev/null +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AAS,CAAC,CAAC;IAE9E,IAAM,YAAY,GAAG,EAAE,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,YAAY,CAAC,IAAI,CAAC,UAAQ,aAAa,CAAC,CAAC,CAAC,UAAK,MAAM,CAAC,CAAC,CAAC,MAAG,CAAC,CAAC;KAC9D;IACD,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC;AAC7B,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/transpose_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/transpose_gpu.d.ts new file mode 100644 index 0000000..982c730 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/transpose_gpu.d.ts @@ -0,0 +1,8 @@ +import { GPGPUProgram } from './gpgpu_math'; +export declare class TransposeProgram implements GPGPUProgram { + variableNames: string[]; + outputShape: number[]; + userCode: string; + rank: number; + constructor(aShape: number[], newDim: number[]); +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/transpose_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/transpose_gpu.js new file mode 100644 index 0000000..753cc5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/transpose_gpu.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var shader_compiler_1 = require("./shader_compiler"); +var TransposeProgram = (function () { + function TransposeProgram(aShape, newDim) { + this.variableNames = ['A']; + var outputShape = new Array(aShape.length); + for (var i = 0; i < outputShape.length; i++) { + outputShape[i] = aShape[newDim[i]]; + } + this.outputShape = outputShape; + this.rank = outputShape.length; + var dtype = shader_compiler_1.getCoordsDataType(this.rank); + var switched = getSwitchedCoords(newDim); + this.userCode = "\n void main() {\n " + dtype + " resRC = getOutputCoords();\n setOutput(getA(" + switched + "));\n }\n "; + } + return TransposeProgram; +}()); +exports.TransposeProgram = TransposeProgram; +function getSwitchedCoords(newDim) { + var rank = newDim.length; + if (rank > 6) { + throw Error("Transpose for rank " + rank + " is not yet supported"); + } + var originalOrder = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u', 'resRC.v']; + var switchedCoords = new Array(rank); + for (var i = 0; i < newDim.length; i++) { + switchedCoords[newDim[i]] = originalOrder[i]; + } + return switchedCoords.join(); +} +//# sourceMappingURL=transpose_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/transpose_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/transpose_gpu.js.map new file mode 100644 index 0000000..20369f6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/transpose_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transpose_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/transpose_gpu.ts"],"names":[],"mappings":";;AAkBA,qDAAoD;AAEpD;IAME,0BAAY,MAAgB,EAAE,MAAgB;QAL9C,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAMpB,IAAM,WAAW,GAAa,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACvD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC3C,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;SACpC;QACD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC;QAC/B,IAAM,KAAK,GAAG,mCAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAE3C,IAAI,CAAC,QAAQ,GAAG,gCAEZ,KAAK,0DACU,QAAQ,qBAE1B,CAAC;IACJ,CAAC;IACH,uBAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBY,4CAAgB;AAyB7B,2BAA2B,MAAgB;IACzC,IAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3B,IAAI,IAAI,GAAG,CAAC,EAAE;QACZ,MAAM,KAAK,CAAC,wBAAsB,IAAI,0BAAuB,CAAC,CAAC;KAChE;IACD,IAAM,aAAa,GACf,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IACvE,IAAM,cAAc,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;KAC9C;IACD,OAAO,cAAc,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/unaryop_gpu.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/unaryop_gpu.d.ts new file mode 100644 index 0000000..bbbe5b3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/unaryop_gpu.d.ts @@ -0,0 +1,45 @@ +import { GPGPUProgram } from './gpgpu_math'; +import { GPGPUContext } from './gpgpu_context'; +export declare class UnaryOpProgram implements GPGPUProgram { + variableNames: string[]; + userCode: string; + outputShape: number[]; + startLoc: WebGLUniformLocation; + constructor(aShape: number[], opSnippet: string); + getCustomSetupFunc(): (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void; +} +export declare const ABS = "return abs(x);"; +export declare const RELU: string; +export declare const ELU = "return (x >= 0.0) ? x : (exp(x) - 1.0);"; +export declare const SELU: string; +export declare function STEP(alpha?: number): string; +export declare const NEG = "return -x;"; +export declare const CEIL = "return ceil(x);"; +export declare const FLOOR = "return floor(x);"; +export declare const SIGN = "\n if (isNaN(x)) { return 0.0; }\n return sign(x);\n"; +export declare const ROUND = "\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"; +export declare const EXP = "return exp(x);"; +export declare const EXPM1 = "return exp(x) - 1.0;"; +export declare const LOG = "if (x < 0.0) return NAN;\n return log(x);"; +export declare const LOG1P = "return log(1.0 + x);"; +export declare const SQRT = "return sqrt(x);"; +export declare const RSQRT = "return inversesqrt(x);"; +export declare const SIGMOID = "return 1.0 / (1.0 + exp(-1.0 * x));"; +export declare const SOFTPLUS = "\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"; +export declare const SIN: string; +export declare const COS: string; +export declare const TAN = "return tan(x);"; +export declare const ASIN = "return asin(x);"; +export declare const ACOS = "return acos(x);"; +export declare const ATAN: string; +export declare const SINH = "\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"; +export declare const COSH = "\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"; +export declare const TANH = "\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"; +export declare const ASINH = "return log(x + sqrt(x * x + 1.0));"; +export declare const ACOSH: string; +export declare const ATANH: string; +export declare const ERF: string; +export declare const SQUARE = "return x * x;"; +export declare const RECIPROCAL = "return 1.0 / x;"; +export declare const LOGICAL_NOT = "return float(!(x >= 1.0));"; +export declare const TO_INT = "return float(int(x));"; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/unaryop_gpu.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/unaryop_gpu.js new file mode 100644 index 0000000..8160ca9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/unaryop_gpu.js @@ -0,0 +1,66 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var erf_util = require("../../ops/erf_util"); +var selu_util = require("../../ops/selu_util"); +var UnaryOpProgram = (function () { + function UnaryOpProgram(aShape, opSnippet) { + this.variableNames = ['A']; + this.outputShape = aShape; + this.userCode = "\n uniform float NAN;\n float unaryOperation(float x) {\n " + opSnippet + "\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n "; + } + UnaryOpProgram.prototype.getCustomSetupFunc = function () { + var _this = this; + return function (gpgpu, webGLProgram) { + if (_this.startLoc == null) { + _this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN'); + if (_this.startLoc == null) { + return; + } + } + gpgpu.gl.uniform1f(_this.startLoc, NaN); + }; + }; + return UnaryOpProgram; +}()); +exports.UnaryOpProgram = UnaryOpProgram; +var CHECK_NAN_SNIPPET = "if (isNaN(x)) return x;"; +exports.ABS = "return abs(x);"; +exports.RELU = CHECK_NAN_SNIPPET + "\n return (x < 0.0) ? 0.0 : x;\n"; +exports.ELU = "return (x >= 0.0) ? x : (exp(x) - 1.0);"; +exports.SELU = "\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = " + selu_util.SELU_SCALEALPHA + ";\n float scale = " + selu_util.SELU_SCALE + ";\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n"; +function STEP(alpha) { + if (alpha === void 0) { alpha = 0.0; } + return CHECK_NAN_SNIPPET + ("\n return x > 0.0 ? 1.0 : float(" + alpha + ");\n "); +} +exports.STEP = STEP; +exports.NEG = "return -x;"; +exports.CEIL = "return ceil(x);"; +exports.FLOOR = "return floor(x);"; +exports.SIGN = "\n if (isNaN(x)) { return 0.0; }\n return sign(x);\n"; +exports.ROUND = "\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"; +exports.EXP = "return exp(x);"; +exports.EXPM1 = "return exp(x) - 1.0;"; +exports.LOG = "if (x < 0.0) return NAN;\n return log(x);"; +exports.LOG1P = "return log(1.0 + x);"; +exports.SQRT = "return sqrt(x);"; +exports.RSQRT = "return inversesqrt(x);"; +exports.SIGMOID = "return 1.0 / (1.0 + exp(-1.0 * x));"; +exports.SOFTPLUS = "\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"; +exports.SIN = CHECK_NAN_SNIPPET + "\n return sin(x);\n"; +exports.COS = CHECK_NAN_SNIPPET + "\n return cos(x);\n"; +exports.TAN = "return tan(x);"; +exports.ASIN = "return asin(x);"; +exports.ACOS = "return acos(x);"; +exports.ATAN = CHECK_NAN_SNIPPET + "\n return atan(x);\n"; +exports.SINH = "\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"; +exports.COSH = "\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"; +exports.TANH = "\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"; +exports.ASINH = "return log(x + sqrt(x * x + 1.0));"; +exports.ACOSH = CHECK_NAN_SNIPPET + "\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));"; +exports.ATANH = CHECK_NAN_SNIPPET + "\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;"; +exports.ERF = "\n // Error function is calculated approximately with elementary function.\n // See \"Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\n float p = " + erf_util.ERF_P + ";\n float a1 = " + erf_util.ERF_A1 + ";\n float a2 = " + erf_util.ERF_A2 + ";\n float a3 = " + erf_util.ERF_A3 + ";\n float a4 = " + erf_util.ERF_A4 + ";\n float a5 = " + erf_util.ERF_A5 + ";\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n"; +exports.SQUARE = "return x * x;"; +exports.RECIPROCAL = "return 1.0 / x;"; +exports.LOGICAL_NOT = "return float(!(x >= 1.0));"; +exports.TO_INT = "return float(int(x));"; +//# sourceMappingURL=unaryop_gpu.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/unaryop_gpu.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/unaryop_gpu.js.map new file mode 100644 index 0000000..90e3e52 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/unaryop_gpu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unaryop_gpu.js","sourceRoot":"","sources":["../../../src/kernels/webgl/unaryop_gpu.ts"],"names":[],"mappings":";;AAiBA,6CAA+C;AAC/C,+CAAiD;AAKjD;IAQE,wBAAY,MAAgB,EAAE,SAAiB;QAP/C,kBAAa,GAAG,CAAC,GAAG,CAAC,CAAC;QAQpB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,gFAGV,SAAS,yJASd,CAAC;IACJ,CAAC;I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AAEzB,QAAA,KAAK,GAAG,wBAAwB,CAAC;AAEjC,QAAA,OAAO,GAAG,qCAAqC,CAAC;AAehD,QAAA,QAAQ,GAAG,yWAoBvB,CAAC;AAEW,QAAA,GAAG,GAAG,iBAAiB,GAAG,sBAEtC,CAAC;AAEW,QAAA,GAAG,GAAG,iBAAiB,GAAG,sBAEtC,CAAC;AAEW,QAAA,GAAG,GAAG,gBAAgB,CAAC;AAEvB,QAAA,IAAI,GAAG,iBAAiB,CAAC;AAEzB,QAAA,IAAI,GAAG,iBAAiB,CAAC;AAEzB,QAAA,IAAI,GAAG,iBAAiB,GAAG,uBAEvC,CAAC;AAEW,QAAA,IAAI,GAAG,8DAGnB,CAAC;AAEW,QAAA,IAAI,GAAG,+DAGnB,CAAC;AAEW,QAAA,IAAI,GAAG,sFAGnB,CAAC;AAEW,QAAA,KAAK,GAAG,oCAAoC,CAAC;AAE7C,QAAA,KAAK,GAAG,iBAAiB,GAAG,oEAEJ,CAAC;AAEzB,QAAA,KAAK,GAAG,iBAAiB,GAAG,6FAEK,CAAC;AAElC,QAAA,GAAG,GAAG,4NAIL,QAAQ,CAAC,KAAK,wBACb,QAAQ,CAAC,MAAM,wBACf,QAAQ,CAAC,MAAM,wBACf,QAAQ,CAAC,MAAM,wBACf,QAAQ,CAAC,MAAM,wBACf,QAAQ,CAAC,MAAM,kHAI7B,CAAC;AAEW,QAAA,MAAM,GAAG,eAAe,CAAC;AAEzB,QAAA,UAAU,GAAG,iBAAiB,CAAC;AAE/B,QAAA,WAAW,GAAG,4BAA4B,CAAC;AAE3C,QAAA,MAAM,GAAG,uBAAuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_types.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_types.d.ts new file mode 100644 index 0000000..5cfe4b2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_types.d.ts @@ -0,0 +1,26 @@ +/// +export interface WebGL2DisjointQueryTimerExtension { + TIME_ELAPSED_EXT: number; + GPU_DISJOINT_EXT: number; +} +export interface WebGL1DisjointQueryTimerExtension { + TIME_ELAPSED_EXT: number; + QUERY_RESULT_AVAILABLE_EXT: number; + GPU_DISJOINT_EXT: number; + QUERY_RESULT_EXT: number; + createQueryEXT: () => {}; + beginQueryEXT: (ext: number, query: WebGLQuery) => void; + endQueryEXT: (ext: number) => void; + deleteQueryEXT: (query: WebGLQuery) => void; + isQueryEXT: (query: WebGLQuery) => boolean; + getQueryObjectEXT: (query: WebGLQuery, queryResultAvailableExt: number) => number; +} +export interface WebGLContextAttributes { + alpha?: boolean; + antialias?: boolean; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; + depth?: boolean; + stencil?: boolean; + failIfMajorPerformanceCaveat?: boolean; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_types.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_types.js new file mode 100644 index 0000000..2c46246 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=webgl_types.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_types.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_types.js.map new file mode 100644 index 0000000..e4ce532 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"webgl_types.js","sourceRoot":"","sources":["../../../src/kernels/webgl/webgl_types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.d.ts new file mode 100644 index 0000000..25260ff --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.d.ts @@ -0,0 +1,31 @@ +export declare function createWebGLRenderingContext(attributes: WebGLContextAttributes): WebGLRenderingContext; +export declare function createWebGLRenderingContextFromCanvas(canvas: HTMLCanvasElement, attributes: WebGLContextAttributes): WebGLRenderingContext; +export declare function callAndCheck(gl: WebGLRenderingContext, func: () => T): T; +export declare function enableDebugWebGLErrorChecking(enabled: boolean): void; +export declare function checkWebGLError(gl: WebGLRenderingContext): void; +export declare function getWebGLErrorMessage(gl: WebGLRenderingContext, status: number): string; +export declare function getExtensionOrThrow(gl: WebGLRenderingContext, extensionName: string): {}; +export declare function createVertexShader(gl: WebGLRenderingContext, vertexShaderSource: string): WebGLShader; +export declare function createFragmentShader(gl: WebGLRenderingContext, fragmentShaderSource: string): WebGLShader; +export declare function createProgram(gl: WebGLRenderingContext): WebGLProgram; +export declare function linkProgram(gl: WebGLRenderingContext, program: WebGLProgram): void; +export declare function validateProgram(gl: WebGLRenderingContext, program: WebGLProgram): void; +export declare function createStaticVertexBuffer(gl: WebGLRenderingContext, data: Float32Array): WebGLBuffer; +export declare function createStaticIndexBuffer(gl: WebGLRenderingContext, data: Uint16Array): WebGLBuffer; +export declare function queryMaxTextureSize(gl: WebGLRenderingContext): number; +export declare function getNumChannels(): number; +export declare function createTexture(gl: WebGLRenderingContext): WebGLTexture; +export declare function validateTextureSize(gl: WebGLRenderingContext, width: number, height: number): void; +export declare function createFramebuffer(gl: WebGLRenderingContext): WebGLFramebuffer; +export declare function bindVertexBufferToProgramAttribute(gl: WebGLRenderingContext, program: WebGLProgram, attribute: string, buffer: WebGLBuffer, arrayEntriesPerItem: number, itemStrideInBytes: number, itemOffsetInBytes: number): boolean; +export declare function bindTextureUnit(gl: WebGLRenderingContext, texture: WebGLTexture, textureUnit: number): void; +export declare function unbindTextureUnit(gl: WebGLRenderingContext, textureUnit: number): void; +export declare function getProgramUniformLocationOrThrow(gl: WebGLRenderingContext, program: WebGLProgram, uniformName: string): WebGLUniformLocation; +export declare function getProgramUniformLocation(gl: WebGLRenderingContext, program: WebGLProgram, uniformName: string): WebGLUniformLocation; +export declare function bindTextureToProgramUniformSampler(gl: WebGLRenderingContext, program: WebGLProgram, texture: WebGLTexture, uniformSamplerLocation: WebGLUniformLocation, textureUnit: number): void; +export declare function bindCanvasToFramebuffer(gl: WebGLRenderingContext): void; +export declare function bindColorTextureToFramebuffer(gl: WebGLRenderingContext, texture: WebGLTexture, framebuffer: WebGLFramebuffer): void; +export declare function unbindColorTextureFromFramebuffer(gl: WebGLRenderingContext, framebuffer: WebGLFramebuffer): void; +export declare function validateFramebuffer(gl: WebGLRenderingContext): void; +export declare function getFramebufferErrorMessage(gl: WebGLRenderingContext, status: number): string; +export declare function getTextureShapeFromLogicalShape(gl: WebGLRenderingContext, logShape: number[]): [number, number]; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.js new file mode 100644 index 0000000..eb31506 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.js @@ -0,0 +1,310 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var MAX_TEXTURE_SIZE = null; +var util = require("../../util"); +var environment_1 = require("../../environment"); +function createWebGLRenderingContext(attributes) { + var canvas = document.createElement('canvas'); + canvas.width = 1; + canvas.height = 1; + return createWebGLRenderingContextFromCanvas(canvas, attributes); +} +exports.createWebGLRenderingContext = createWebGLRenderingContext; +function createWebGLRenderingContextFromCanvas(canvas, attributes) { + var gl; + var webglVersion = environment_1.ENV.get('WEBGL_VERSION'); + if (webglVersion === 2) { + gl = canvas.getContext('webgl2', attributes); + } + else if (webglVersion === 1) { + gl = (canvas.getContext('webgl', attributes) || + canvas.getContext('experimental-webgl', attributes)); + } + if (webglVersion === 0 || gl == null) { + throw new Error('This browser does not support WebGL.'); + } + return gl; +} +exports.createWebGLRenderingContextFromCanvas = createWebGLRenderingContextFromCanvas; +function callAndCheck(gl, func) { + var returnValue = func(); + checkWebGLError(gl); + return returnValue; +} +exports.callAndCheck = callAndCheck; +var webGLDebugErrorCheckingEnabled = false; +function enableDebugWebGLErrorChecking(enabled) { + webGLDebugErrorCheckingEnabled = enabled; +} +exports.enableDebugWebGLErrorChecking = enableDebugWebGLErrorChecking; +function checkWebGLError(gl) { + if (webGLDebugErrorCheckingEnabled) { + var error = gl.getError(); + if (error !== gl.NO_ERROR) { + throw new Error('WebGL Error: ' + getWebGLErrorMessage(gl, error)); + } + } +} +exports.checkWebGLError = checkWebGLError; +function getWebGLErrorMessage(gl, status) { + switch (status) { + case gl.NO_ERROR: + return 'NO_ERROR'; + case gl.INVALID_ENUM: + return 'INVALID_ENUM'; + case gl.INVALID_VALUE: + return 'INVALID_VALUE'; + case gl.INVALID_OPERATION: + return 'INVALID_OPERATION'; + case gl.INVALID_FRAMEBUFFER_OPERATION: + return 'INVALID_FRAMEBUFFER_OPERATION'; + case gl.OUT_OF_MEMORY: + return 'OUT_OF_MEMORY'; + case gl.CONTEXT_LOST_WEBGL: + return 'CONTEXT_LOST_WEBGL'; + default: + return "Unknown error code " + status; + } +} +exports.getWebGLErrorMessage = getWebGLErrorMessage; +function getExtensionOrThrow(gl, extensionName) { + return throwIfNull(gl, function () { return gl.getExtension(extensionName); }, 'Extension "' + extensionName + '" not supported on this browser.'); +} +exports.getExtensionOrThrow = getExtensionOrThrow; +function createVertexShader(gl, vertexShaderSource) { + var vertexShader = throwIfNull(gl, function () { return gl.createShader(gl.VERTEX_SHADER); }, 'Unable to create vertex WebGLShader.'); + callAndCheck(gl, function () { return gl.shaderSource(vertexShader, vertexShaderSource); }); + callAndCheck(gl, function () { return gl.compileShader(vertexShader); }); + if (gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS) === false) { + console.log(gl.getShaderInfoLog(vertexShader)); + throw new Error('Failed to compile vertex shader.'); + } + return vertexShader; +} +exports.createVertexShader = createVertexShader; +function createFragmentShader(gl, fragmentShaderSource) { + var fragmentShader = throwIfNull(gl, function () { return gl.createShader(gl.FRAGMENT_SHADER); }, 'Unable to create fragment WebGLShader.'); + callAndCheck(gl, function () { return gl.shaderSource(fragmentShader, fragmentShaderSource); }); + callAndCheck(gl, function () { return gl.compileShader(fragmentShader); }); + if (gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS) === false) { + logShaderSourceAndInfoLog(fragmentShaderSource, gl.getShaderInfoLog(fragmentShader)); + throw new Error('Failed to compile fragment shader.'); + } + return fragmentShader; +} +exports.createFragmentShader = createFragmentShader; +var lineNumberRegex = /ERROR: [0-9]+:([0-9]+):/g; +function logShaderSourceAndInfoLog(shaderSource, shaderInfoLog) { + var lineNumberRegexResult = lineNumberRegex.exec(shaderInfoLog); + if (lineNumberRegexResult == null) { + console.log("Couldn't parse line number in error: " + shaderInfoLog); + console.log(shaderSource); + return; + } + var lineNumber = +lineNumberRegexResult[1]; + var shaderLines = shaderSource.split('\n'); + var pad = shaderLines.length.toString().length + 2; + var linesWithLineNumbers = shaderLines.map(function (line, lineNumber) { + return util.rightPad((lineNumber + 1).toString(), pad) + line; + }); + var maxLineLength = 0; + for (var i = 0; i < linesWithLineNumbers.length; i++) { + maxLineLength = Math.max(linesWithLineNumbers[i].length, maxLineLength); + } + var beforeErrorLines = linesWithLineNumbers.slice(0, lineNumber - 1); + var errorLine = linesWithLineNumbers.slice(lineNumber - 1, lineNumber); + var afterErrorLines = linesWithLineNumbers.slice(lineNumber); + console.log(beforeErrorLines.join('\n')); + console.log(shaderInfoLog.split('\n')[0]); + console.log("%c " + util.rightPad(errorLine[0], maxLineLength), 'border:1px solid red; background-color:#e3d2d2; color:#a61717'); + console.log(afterErrorLines.join('\n')); +} +function createProgram(gl) { + return throwIfNull(gl, function () { return gl.createProgram(); }, 'Unable to create WebGLProgram.'); +} +exports.createProgram = createProgram; +function linkProgram(gl, program) { + callAndCheck(gl, function () { return gl.linkProgram(program); }); + if (gl.getProgramParameter(program, gl.LINK_STATUS) === false) { + console.log(gl.getProgramInfoLog(program)); + throw new Error('Failed to link vertex and fragment shaders.'); + } +} +exports.linkProgram = linkProgram; +function validateProgram(gl, program) { + callAndCheck(gl, function () { return gl.validateProgram(program); }); + if (gl.getProgramParameter(program, gl.VALIDATE_STATUS) === false) { + console.log(gl.getProgramInfoLog(program)); + throw new Error('Shader program validation failed.'); + } +} +exports.validateProgram = validateProgram; +function createStaticVertexBuffer(gl, data) { + var buffer = throwIfNull(gl, function () { return gl.createBuffer(); }, 'Unable to create WebGLBuffer'); + callAndCheck(gl, function () { return gl.bindBuffer(gl.ARRAY_BUFFER, buffer); }); + callAndCheck(gl, function () { return gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW); }); + return buffer; +} +exports.createStaticVertexBuffer = createStaticVertexBuffer; +function createStaticIndexBuffer(gl, data) { + var buffer = throwIfNull(gl, function () { return gl.createBuffer(); }, 'Unable to create WebGLBuffer'); + callAndCheck(gl, function () { return gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer); }); + callAndCheck(gl, function () { return gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, gl.STATIC_DRAW); }); + return buffer; +} +exports.createStaticIndexBuffer = createStaticIndexBuffer; +function queryMaxTextureSize(gl) { + if (MAX_TEXTURE_SIZE != null) { + return MAX_TEXTURE_SIZE; + } + MAX_TEXTURE_SIZE = + callAndCheck(gl, function () { return gl.getParameter(gl.MAX_TEXTURE_SIZE); }); + return MAX_TEXTURE_SIZE; +} +exports.queryMaxTextureSize = queryMaxTextureSize; +function getNumChannels() { + if (environment_1.ENV.get('WEBGL_VERSION') === 2) { + return 1; + } + return 4; +} +exports.getNumChannels = getNumChannels; +function createTexture(gl) { + return throwIfNull(gl, function () { return gl.createTexture(); }, 'Unable to create WebGLTexture.'); +} +exports.createTexture = createTexture; +function validateTextureSize(gl, width, height) { + var maxTextureSize = queryMaxTextureSize(gl); + if ((width <= 0) || (height <= 0)) { + var requested = "[" + width + "x" + height + "]"; + throw new Error('Requested texture size ' + requested + ' is invalid.'); + } + if ((width > maxTextureSize) || (height > maxTextureSize)) { + var requested = "[" + width + "x" + height + "]"; + var max = "[" + maxTextureSize + "x" + maxTextureSize + "]"; + throw new Error('Requested texture size ' + requested + + ' greater than WebGL maximum on this browser / GPU ' + max + '.'); + } +} +exports.validateTextureSize = validateTextureSize; +function createFramebuffer(gl) { + return throwIfNull(gl, function () { return gl.createFramebuffer(); }, 'Unable to create WebGLFramebuffer.'); +} +exports.createFramebuffer = createFramebuffer; +function bindVertexBufferToProgramAttribute(gl, program, attribute, buffer, arrayEntriesPerItem, itemStrideInBytes, itemOffsetInBytes) { + var loc = gl.getAttribLocation(program, attribute); + if (loc === -1) { + return false; + } + callAndCheck(gl, function () { return gl.bindBuffer(gl.ARRAY_BUFFER, buffer); }); + callAndCheck(gl, function () { return gl.vertexAttribPointer(loc, arrayEntriesPerItem, gl.FLOAT, false, itemStrideInBytes, itemOffsetInBytes); }); + callAndCheck(gl, function () { return gl.enableVertexAttribArray(loc); }); + return true; +} +exports.bindVertexBufferToProgramAttribute = bindVertexBufferToProgramAttribute; +function bindTextureUnit(gl, texture, textureUnit) { + validateTextureUnit(gl, textureUnit); + callAndCheck(gl, function () { return gl.activeTexture(gl.TEXTURE0 + textureUnit); }); + callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, texture); }); +} +exports.bindTextureUnit = bindTextureUnit; +function unbindTextureUnit(gl, textureUnit) { + validateTextureUnit(gl, textureUnit); + callAndCheck(gl, function () { return gl.activeTexture(gl.TEXTURE0 + textureUnit); }); + callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, null); }); +} +exports.unbindTextureUnit = unbindTextureUnit; +function getProgramUniformLocationOrThrow(gl, program, uniformName) { + return throwIfNull(gl, function () { return gl.getUniformLocation(program, uniformName); }, 'uniform "' + uniformName + '" not present in program.'); +} +exports.getProgramUniformLocationOrThrow = getProgramUniformLocationOrThrow; +function getProgramUniformLocation(gl, program, uniformName) { + return gl.getUniformLocation(program, uniformName); +} +exports.getProgramUniformLocation = getProgramUniformLocation; +function bindTextureToProgramUniformSampler(gl, program, texture, uniformSamplerLocation, textureUnit) { + callAndCheck(gl, function () { return bindTextureUnit(gl, texture, textureUnit); }); + callAndCheck(gl, function () { return gl.uniform1i(uniformSamplerLocation, textureUnit); }); +} +exports.bindTextureToProgramUniformSampler = bindTextureToProgramUniformSampler; +function bindCanvasToFramebuffer(gl) { + callAndCheck(gl, function () { return gl.bindFramebuffer(gl.FRAMEBUFFER, null); }); + callAndCheck(gl, function () { return gl.viewport(0, 0, gl.canvas.width, gl.canvas.height); }); + callAndCheck(gl, function () { return gl.scissor(0, 0, gl.canvas.width, gl.canvas.height); }); +} +exports.bindCanvasToFramebuffer = bindCanvasToFramebuffer; +function bindColorTextureToFramebuffer(gl, texture, framebuffer) { + callAndCheck(gl, function () { return gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); }); + callAndCheck(gl, function () { return gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); }); +} +exports.bindColorTextureToFramebuffer = bindColorTextureToFramebuffer; +function unbindColorTextureFromFramebuffer(gl, framebuffer) { + callAndCheck(gl, function () { return gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); }); + callAndCheck(gl, function () { return gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); }); +} +exports.unbindColorTextureFromFramebuffer = unbindColorTextureFromFramebuffer; +function validateFramebuffer(gl) { + var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + if (status !== gl.FRAMEBUFFER_COMPLETE) { + throw new Error('Error binding framebuffer: ' + getFramebufferErrorMessage(gl, status)); + } +} +exports.validateFramebuffer = validateFramebuffer; +function getFramebufferErrorMessage(gl, status) { + switch (status) { + case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: + return 'FRAMEBUFFER_INCOMPLETE_ATTACHMENT'; + case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: + return 'FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT'; + case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: + return 'FRAMEBUFFER_INCOMPLETE_DIMENSIONS'; + case gl.FRAMEBUFFER_UNSUPPORTED: + return 'FRAMEBUFFER_UNSUPPORTED'; + default: + return "unknown error " + status; + } +} +exports.getFramebufferErrorMessage = getFramebufferErrorMessage; +function throwIfNull(gl, returnTOrNull, failureMessage) { + var tOrNull = callAndCheck(gl, function () { return returnTOrNull(); }); + if (tOrNull == null) { + throw new Error(failureMessage); + } + return tOrNull; +} +function validateTextureUnit(gl, textureUnit) { + var maxTextureUnit = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1; + var glTextureUnit = textureUnit + gl.TEXTURE0; + if (glTextureUnit < gl.TEXTURE0 || glTextureUnit > maxTextureUnit) { + var textureUnitRange = "[gl.TEXTURE0, gl.TEXTURE" + maxTextureUnit + "]"; + throw new Error("textureUnit must be in " + textureUnitRange + "."); + } +} +function getTextureShapeFromLogicalShape(gl, logShape) { + if (logShape.length !== 2) { + var squeezeResult = util.squeezeShape(logShape); + logShape = squeezeResult.newShape; + } + var maxTexSize = queryMaxTextureSize(gl); + var size = util.sizeFromShape(logShape); + if (logShape.length <= 1 && size <= maxTexSize) { + return [size, 1]; + } + else if (logShape.length === 2 && logShape[0] <= maxTexSize && + logShape[1] <= maxTexSize) { + return logShape; + } + else if (logShape.length === 3 && logShape[0] <= maxTexSize && + logShape[1] * logShape[2] <= maxTexSize) { + return [logShape[0], logShape[1] * logShape[2]]; + } + else if (logShape.length === 4 && logShape[0] <= maxTexSize && + logShape[1] * logShape[2] * logShape[3] <= maxTexSize) { + return [logShape[0], logShape[1] * logShape[2] * logShape[3]]; + } + else { + return util.sizeToSquarishShape(size); + } +} +exports.getTextureShapeFromLogicalShape = getTextureShapeFromLogicalShape; +//# sourceMappingURL=webgl_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.js.map new file mode 100644 index 0000000..33186e1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"webgl_util.js","sourceRoot":"","sources":["../../../src/kernels/webgl/webgl_util.ts"],"names":[],"mappings":";;AAiBA,IAAI,gBAAgB,GAAW,IAAI,CAAC;AAEpC,iCAAmC;AACnC,iDAAsC;AAEtC,qCAA4C,UAAkC;IAE5E,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC;IACjB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,OAAO,qCAAqC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC;AAND,kEAMC;AAED,+CACI,MAAyB,EACzB,UAAkC;IACpC,IAAI,EAAyB,CAAC;IAE9B,IAAM,YAAY,GAAG,iBAAG,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC9C,IAAI,YAAY,KAAK,CAAC,EAAE;QACtB,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAA0B,CAAC;KACvE;SAAM,IAAI,YAAY,KAAK,CAAC,EAAE;QAC7B,EAAE,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC;YACtC,MAAM,CAAC,UAAU,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAChC,CAAC;KAC3B;IAED,IAAI,YAAY,KAAK,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE;QACpC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;KACzD;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAlBD,s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,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/D;SAAM;QACL,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;KACvC;AACH,CAAC;AA3BD,0EA2BC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util_test.js new file mode 100644 index 0000000..e50a0bb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util_test.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var test_util_1 = require("../../test_util"); +var jasmine_util_1 = require("../../jasmine_util"); +var gpgpu_util = require("./gpgpu_util"); +var webgl_util = require("./webgl_util"); +jasmine_util_1.describeWithFlags('webgl_util getTextureShapeFromLogicalShape', test_util_1.WEBGL_ENVS, function () { + var gl; + beforeEach(function () { + gl = gpgpu_util.createWebGLContext(); + }); + it('scalar', function () { + var texShape = webgl_util.getTextureShapeFromLogicalShape(gl, []); + expect(texShape).toEqual([1, 1]); + }); + it('1d', function () { + var texShape = webgl_util.getTextureShapeFromLogicalShape(gl, [4]); + expect(texShape).toEqual([4, 1]); + }); + it('2d stays same', function () { + var texShape = webgl_util.getTextureShapeFromLogicalShape(gl, [5, 2]); + expect(texShape).toEqual([5, 2]); + texShape = webgl_util.getTextureShapeFromLogicalShape(gl, [5, 1]); + expect(texShape).toEqual([5, 1]); + texShape = webgl_util.getTextureShapeFromLogicalShape(gl, [1, 5]); + expect(texShape).toEqual([1, 5]); + }); + it('3d 2x3x4', function () { + var texShape = webgl_util.getTextureShapeFromLogicalShape(gl, [2, 3, 4]); + expect(texShape).toEqual([2, 12]); + }); + it('3d 2x1x4 got squeezed', function () { + var texShape = webgl_util.getTextureShapeFromLogicalShape(gl, [2, 1, 4]); + expect(texShape).toEqual([2, 4]); + }); + it('3d 1x8x2 got squeezed', function () { + var texShape = webgl_util.getTextureShapeFromLogicalShape(gl, [1, 8, 2]); + expect(texShape).toEqual([8, 2]); + }); + it('4d 1x8x1x3 got squeezed', function () { + var texShape = webgl_util.getTextureShapeFromLogicalShape(gl, [1, 8, 1, 3]); + expect(texShape).toEqual([8, 3]); + }); + it('4d 1x3x1x8 got squeezed', function () { + var texShape = webgl_util.getTextureShapeFromLogicalShape(gl, [1, 3, 1, 8]); + expect(texShape).toEqual([3, 8]); + }); +}); +//# sourceMappingURL=webgl_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util_test.js.map new file mode 100644 index 0000000..6072e7c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/webgl/webgl_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"webgl_util_test.js","sourceRoot":"","sources":["../../../src/kernels/webgl/webgl_util_test.ts"],"names":[],"mappings":";;AAiBA,6CAA2C;AAC3C,mDAAqD;AACrD,yCAA2C;AAC3C,yCAA2C;AAE3C,gCAAiB,CACb,4CAA4C,EAAE,sBAAU,EAAE;IACxD,IAAI,EAAyB,CAAC;IAE9B,UAAU,CAAC;QACT,EAAE,GAAG,UAAU,CAAC,kBAAkB,EAAE,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,QAAQ,EAAE;QACX,IAAM,QAAQ,GAAG,UAAU,CAAC,+BAA+B,CAAC,E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@tensorflow/tfjs-core/dist/kernels/where_impl.d.ts new file mode 100644 index 0000000..9c63507 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/where_impl.d.ts @@ -0,0 +1,3 @@ +import { Tensor2D } from '../tensor'; +import { TypedArray } from '../types'; +export declare function whereImpl(condShape: number[], condVals: TypedArray): Tensor2D; diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/where_impl.js b/node_modules/@tensorflow/tfjs-core/dist/kernels/where_impl.js new file mode 100644 index 0000000..b2a12ca --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/where_impl.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var array_ops_1 = require("../ops/array_ops"); +function whereImpl(condShape, condVals) { + var indices = []; + for (var i = 0; i < condVals.length; i++) { + if (condVals[i]) { + indices.push(i); + } + } + var inBuffer = array_ops_1.buffer(condShape, 'int32'); + var out = array_ops_1.buffer([indices.length, condShape.length], 'int32'); + for (var i = 0; i < indices.length; i++) { + var loc = inBuffer.indexToLoc(indices[i]); + var offset = i * condShape.length; + out.values.set(loc, offset); + } + return out.toTensor(); +} +exports.whereImpl = whereImpl; +//# sourceMappingURL=where_impl.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/where_impl.js.map b/node_modules/@tensorflow/tfjs-core/dist/kernels/where_impl.js.map new file mode 100644 index 0000000..6e108fb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/where_impl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"where_impl.js","sourceRoot":"","sources":["../../src/kernels/where_impl.ts"],"names":[],"mappings":";;AAmBA,8CAAwC;AAIxC,mBAA0B,SAAmB,EAAE,QAAoB;IACjE,IAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;KACF;IAED,IAAM,QAAQ,GAAG,kBAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAE5C,IAAM,GAAG,GAAG,kBAAM,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IAChE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,IAAM,GAAG,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,IAAM,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC;QACpC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;KAC7B;IACD,OAAO,GAAG,CAAC,QAAQ,EAAc,CAAC;AACpC,CAAC;AAjBD,8BAiBC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/log.d.ts b/node_modules/@tensorflow/tfjs-core/dist/log.d.ts new file mode 100644 index 0000000..42a6d73 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/log.d.ts @@ -0,0 +1,2 @@ +export declare function warn(...msg: Array<{}>): void; +export declare function log(...msg: Array<{}>): void; diff --git a/node_modules/@tensorflow/tfjs-core/dist/log.js b/node_modules/@tensorflow/tfjs-core/dist/log.js new file mode 100644 index 0000000..f85c06f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/log.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("./environment"); +function warn() { + var msg = []; + for (var _i = 0; _i < arguments.length; _i++) { + msg[_i] = arguments[_i]; + } + if (!environment_1.ENV.get('IS_TEST')) { + console.warn.apply(console, msg); + } +} +exports.warn = warn; +function log() { + var msg = []; + for (var _i = 0; _i < arguments.length; _i++) { + msg[_i] = arguments[_i]; + } + if (!environment_1.ENV.get('IS_TEST')) { + console.log.apply(console, msg); + } +} +exports.log = log; +//# sourceMappingURL=log.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/log.js.map b/node_modules/@tensorflow/tfjs-core/dist/log.js.map new file mode 100644 index 0000000..156cdc8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/log.js.map @@ -0,0 +1 @@ +{"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":";;AAiBA,6CAAkC;AAElC;IAAqB,aAAiB;SAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;QAAjB,wBAAiB;;IACpC,IAAI,CAAC,iBAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;QACvB,OAAO,CAAC,IAAI,OAAZ,OAAO,EAAS,GAAG,EAAE;KACtB;AACH,CAAC;AAJD,oBAIC;AAED;IAAoB,aAAiB;SAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;QAAjB,wBAAiB;;IACnC,IAAI,CAAC,iBAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;QACvB,OAAO,CAAC,GAAG,OAAX,OAAO,EAAQ,GAAG,EAAE;KACrB;AACH,CAAC;AAJD,kBAIC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts b/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts new file mode 100644 index 0000000..e9ae8ca --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts @@ -0,0 +1,12 @@ +import { Tensor } from './tensor'; +import { NamedTensorMap, TensorInfo } from './tensor_types'; +export interface ModelPredictConfig { + batchSize?: number; + verbose?: boolean; +} +export interface InferenceModel { + readonly inputs: TensorInfo[]; + readonly outputs: TensorInfo[]; + predict(inputs: Tensor | Tensor[] | NamedTensorMap, config: ModelPredictConfig): Tensor | Tensor[] | NamedTensorMap; + execute(inputs: Tensor | Tensor[] | NamedTensorMap, outputs: string | string[]): Tensor | Tensor[]; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/model_types.js b/node_modules/@tensorflow/tfjs-core/dist/model_types.js new file mode 100644 index 0000000..aaad700 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/model_types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=model_types.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/model_types.js.map b/node_modules/@tensorflow/tfjs-core/dist/model_types.js.map new file mode 100644 index 0000000..e36142b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/model_types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"model_types.js","sourceRoot":"","sources":["../src/model_types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/arithmetic_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/arithmetic_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/arithmetic_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/arithmetic_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/arithmetic_test.js new file mode 100644 index 0000000..f605420 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/arithmetic_test.js @@ -0,0 +1,946 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('div', test_util_1.ALL_ENVS, function () { + it('same shape', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var c = tf.tensor2d([1, 2, 3, 4, 2, 5], [2, 3]); + var r = tf.div(a, c); + test_util_1.expectArraysClose(r, [1, 1, 1, 1, 2.5, 6 / 5]); + }); + it('integer division implements floor divide', function () { + var a = tf.tensor1d([-6, -6, -5, -4, -3, -3, 3, 3, 2], 'int32'); + var c = tf.tensor1d([-2, 2, 3, 2, -3, 3, 2, 3, 2], 'int32'); + var r = tf.div(a, c); + expect(r.dtype).toEqual('int32'); + test_util_1.expectArraysClose(r, [3, -3, -2, -2, 1, -1, 1, 1, 1]); + }); + it('integer division broadcasts', function () { + var a = tf.tensor1d([-5, -4, 3, 2], 'int32'); + var c = tf.scalar(2, 'int32'); + var r = tf.div(a, c); + expect(r.dtype).toEqual('int32'); + test_util_1.expectArraysClose(r, [-3, -2, 1, 1]); + }); + it('propagates NaNs', function () { + var a = tf.tensor2d([1, 2], [2, 1]); + var c = tf.tensor2d([3, NaN], [2, 1]); + var r = tf.div(a, c); + test_util_1.expectArraysClose(r, [1 / 3, NaN]); + }); + it('broadcasting same rank Tensors different shape', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor2d([2, 3], [2, 1]); + var result = tf.div(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [1 / 2, 1, -1, -4 / 3]; + test_util_1.expectArraysClose(result, expected); + }); + it('broadcast 2D + 1D', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor1d([1, 2]); + var result = tf.div(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [1, 1, -3, -2]; + test_util_1.expectArraysClose(result, expected); + }); + it('throws when passed tensors of different types', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = tf.tensor2d([1, 2, 3, 4, 2, 5], [2, 3], 'int32'); + expect(function () { return tf.div(a, b); }).toThrowError(); + expect(function () { return tf.div(b, a); }).toThrowError(); + }); + it('throws when passed tensors of different shapes', function () { + var a = tf.tensor2d([1, 2, -3, -4, 5, 6], [2, 3]); + var b = tf.tensor2d([5, 3, 4, -7], [2, 2]); + expect(function () { return tf.div(a, b); }).toThrowError(); + expect(function () { return tf.div(b, a); }).toThrowError(); + }); + it('scalar divided by array', function () { + var c = tf.scalar(2); + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var r = tf.div(c, a); + test_util_1.expectArraysClose(r, [2 / 1, 2 / 2, 2 / 3, 2 / 4, 2 / 5, 2 / 6]); + }); + it('scalar divided by array propagates NaNs', function () { + var c = tf.scalar(NaN); + var a = tf.tensor2d([1, 2, 3], [1, 3]); + var r = tf.div(c, a); + test_util_1.expectArraysEqual(r, [NaN, NaN, NaN]); + }); + it('array divided by scalar', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var c = tf.scalar(2); + var r = tf.div(a, c); + test_util_1.expectArraysClose(r, [1 / 2, 2 / 2, 3 / 2, 4 / 2, 5 / 2, 6 / 2]); + }); + it('array divided by scalar propagates NaNs', function () { + var a = tf.tensor2d([1, 2, NaN], [1, 3]); + var c = tf.scalar(2); + var r = tf.div(a, c); + test_util_1.expectArraysClose(r, [1 / 2, 2 / 2, NaN]); + }); + it('gradient: Scalar', function () { + var a = tf.scalar(5); + var b = tf.scalar(2); + var dy = tf.scalar(4); + var grads = tf.grads(function (a, b) { return tf.div(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [4 / 2]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-4 * 5 / (2 * 2)]); + }); + it('gradient: Tensor1D', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([3, 4, 5]); + var dy = tf.tensor1d([1, 10, 20]); + var grads = tf.grads(function (a, b) { return tf.div(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 / 3, 10 / 4, 20 / 5]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-1 * 1 / 9, -10 * 2 / 16, -20 * 3 / 25]); + }); + it('gradient: Tensor1D with int32', function () { + var a = tf.tensor1d([1, 2, 3], 'int32'); + var b = tf.tensor1d([3, 4, 5], 'int32'); + var dy = tf.tensor1d([1, 10, 20]); + var grads = tf.grads(function (a, b) { return tf.div(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 / 3, 10 / 4, 20 / 5]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-1 * 1 / 9, -10 * 2 / 16, -20 * 3 / 25]); + }); + it('gradient: 1d with 1d ', function () { + var a = tf.tensor1d([true, false, true], 'bool'); + var b = tf.tensor1d([1, 2, 3], 'int32'); + var dy = tf.tensor1d([1, 19, 20]); + var grads = tf.grads(function (a, b) { return tf.div(a.toInt(), b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1, 19 / 2, 20 / 3]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-1 / 1, 0, -20 / 9]); + }); + it('gradient: Tensor2D', function () { + var a = tf.tensor2d([3, 1, 2, 3], [2, 2]); + var b = tf.tensor2d([1, 3, 4, 5], [2, 2]); + var dy = tf.tensor2d([1, 10, 15, 20], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.div(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 / 1, 10 / 3, 15 / 4, 20 / 5]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-1 * 3 / 1, -10 * 1 / 9, -15 * 2 / 16, -20 * 3 / 25]); + }); + it('gradient: scalar / Tensor1D', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([3, 4, 5]); + var dy = tf.tensor1d([6, 7, 8]); + var grads = tf.grads(function (a, b) { return tf.div(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [6 / 3 + 7 / 4 + 8 / 5]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-6 * 2 / 9, -7 * 2 / 16, -8 * 2 / 25]); + }); + it('gradient: Tensor2D / scalar', function () { + var a = tf.tensor2d([[2, 3], [4, 5]], [2, 2]); + var b = tf.scalar(2); + var dy = tf.tensor2d([[6, 7], [8, 9]], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.div(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [6 / 2, 7 / 2, 8 / 2, 9 / 2]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-6 * 2 / 4 + -7 * 3 / 4 + -8 * 4 / 4 + -9 * 5 / 4]); + }); + it('gradient: Tensor2D / Tensor2D w/ broadcast', function () { + var a = tf.tensor2d([3, 4], [2, 1]); + var b = tf.tensor2d([[2, 3], [4, 5]], [2, 2]); + var dy = tf.tensor2d([[6, 7], [8, 9]], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.div(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [6 / 2 + 7 / 3, 8 / 4 + 9 / 5]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-6 * 3 / 4, -7 * 3 / 9, -8 * 4 / 16, -9 * 4 / 25]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.div({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'div' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.div(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'div' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.div([[1, 2, 3], [4, 5, 6]], 2); + expect(r.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(r, [1 / 2, 2 / 2, 3 / 2, 4 / 2, 5 / 2, 6 / 2]); + }); +}); +jasmine_util_1.describeWithFlags('mul', test_util_1.ALL_ENVS, function () { + it('strict same-shaped tensors', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor2d([5, 3, 4, -7], [2, 2]); + var expected = [5, 6, -12, 28]; + var result = tf.mulStrict(a, b); + expect(result.shape).toEqual([2, 2]); + expect(result.dtype).toBe('float32'); + test_util_1.expectArraysClose(result, expected); + }); + it('strict propagates NaNs', function () { + var a = tf.tensor2d([1, 3, 4, 0], [2, 2]); + var b = tf.tensor2d([NaN, 3, NaN, 3], [2, 2]); + var result = tf.mulStrict(a, b); + expect(result.dtype).toBe('float32'); + test_util_1.expectArraysClose(result, [NaN, 9, NaN, 0]); + }); + it('strict throws when passed tensors of different shapes', function () { + var a = tf.tensor2d([1, 2, -3, -4, 5, 6], [2, 3]); + var b = tf.tensor2d([5, 3, 4, -7], [2, 2]); + expect(function () { return tf.mulStrict(a, b); }).toThrowError(); + expect(function () { return tf.mulStrict(b, a); }).toThrowError(); + }); + it('strict throws when dtypes do not match', function () { + var a = tf.tensor2d([1, 2, -3, -4, 5, 6], [2, 3], 'float32'); + var b = tf.tensor2d([5, 3, 4, -7], [2, 2], 'int32'); + expect(function () { return tf.mulStrict(a, b); }).toThrowError(); + expect(function () { return tf.mulStrict(b, a); }).toThrowError(); + }); + it('strict int32 * int32', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2], 'int32'); + var b = tf.tensor2d([2, 1, 3, -4], [2, 2], 'int32'); + var res = tf.mulStrict(a, b); + expect(res.dtype).toBe('int32'); + test_util_1.expectArraysClose(res, [2, 2, -9, 16]); + }); + it('same-shaped tensors', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor2d([5, 3, 4, -7], [2, 2]); + var expected = [5, 6, -12, 28]; + var result = tf.mul(a, b); + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, expected); + }); + it('broadcasting tensors', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.scalar(2); + var expected = [2, 4, -6, -8]; + var result = tf.mul(a, b); + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, expected); + }); + it('broadcasting same rank Tensors different shape', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor2d([2, 3], [2, 1]); + var result = tf.mul(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [2, 4, -9, -12]; + test_util_1.expectArraysClose(result, expected); + }); + it('broadcast 2D + 1D', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor1d([1, 2]); + var result = tf.mul(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [1, 4, -3, -8]; + test_util_1.expectArraysClose(result, expected); + }); + it('gradient: Scalar', function () { + var a = tf.scalar(5); + var b = tf.scalar(2); + var dy = tf.scalar(4); + var grads = tf.grads(function (a, b) { return tf.mul(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [b.get() * dy.get()]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [a.get() * dy.get()]); + }); + it('gradient: Tensor1D', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([3, 4, 5]); + var dy = tf.tensor1d([1, 10, 20]); + var grads = tf.grads(function (a, b) { return tf.mul(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [3 * 1, 4 * 10, 5 * 20]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [1 * 1, 2 * 10, 3 * 20]); + }); + it('gradient: Tensor1D with dtype int32', function () { + var a = tf.tensor1d([1, 2, 3], 'int32'); + var b = tf.tensor1d([3, 4, 5], 'int32'); + var dy = tf.tensor1d([1, 10, 20]); + var grads = tf.grads(function (a, b) { return tf.mul(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [3 * 1, 4 * 10, 5 * 20]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [1 * 1, 2 * 10, 3 * 20]); + }); + it('gradient: Tensor2D', function () { + var a = tf.tensor2d([3, 1, 2, 3], [2, 2]); + var b = tf.tensor2d([1, 3, 4, 5], [2, 2]); + var dy = tf.tensor2d([1, 10, 15, 20], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.mul(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 1, 3 * 10, 4 * 15, 5 * 20]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [3 * 1, 1 * 10, 2 * 15, 3 * 20]); + }); + it('gradient: scalar * Tensor1D', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([3, 4, 5]); + var dy = tf.tensor1d([6, 7, 8]); + var grads = tf.grads(function (a, b) { return tf.mul(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [3 * 6 + 4 * 7 + 5 * 8]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [2 * 6, 2 * 7, 2 * 8]); + }); + it('gradient: Tensor2D * scalar', function () { + var a = tf.tensor2d([[2, 3], [4, 5]], [2, 2]); + var b = tf.scalar(2); + var dy = tf.tensor2d([[6, 7], [8, 9]], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.mul(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [2 * 6, 2 * 7, 2 * 8, 2 * 9]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [2 * 6 + 3 * 7 + 4 * 8 + 5 * 9]); + }); + it('gradient: Tensor2D * Tensor2D w/ broadcast', function () { + var a = tf.tensor2d([3, 4], [2, 1]); + var b = tf.tensor2d([[2, 3], [4, 5]], [2, 2]); + var dy = tf.tensor2d([[6, 7], [8, 9]], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.mul(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [2 * 6 + 3 * 7, 4 * 8 + 5 * 9]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [6 * 3, 7 * 3, 8 * 4, 9 * 4]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.mul({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'mul' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.mul(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'mul' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.mul([[1, 2], [-3, -4]], 2); + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, [2, 4, -6, -8]); + }); +}); +jasmine_util_1.describeWithFlags('pow', test_util_1.ALL_ENVS, function () { + it('same-shaped tensors', function () { + var a = tf.tensor2d([1, -2, -3, 0, 7, 1], [2, 3]); + var b = tf.tensor2d([5, 3, 4, 5, 2, -3], [2, 3], 'int32'); + var expected = [1, -8, 81, 0, 49, 1]; + var result = tf.pow(a, b); + expect(result.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(result, expected, 0.01); + }); + it('int32^int32 returns int32', function () { + var a = tf.tensor1d([1, 2, 3], 'int32'); + var exp = tf.scalar(2, 'int32'); + var result = tf.pow(a, exp); + expect(result.shape).toEqual([3]); + expect(result.dtype).toBe('int32'); + test_util_1.expectArraysEqual(result, [1, 4, 9]); + }); + it('different-shaped tensors', function () { + var a = tf.tensor2d([1, -2, -3, 0, 7, 1], [2, 3]); + var b = tf.scalar(2, 'int32'); + var expected = [1, 4, 9, 0, 49, 1]; + var result = tf.pow(a, b); + expect(result.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(result, expected, 0.05); + }); + it('propagates NaNs', function () { + var a = tf.tensor2d([NaN, 3, NaN, 0], [2, 2]); + var b = tf.tensor2d([1, 3, 2, 3], [2, 2], 'int32'); + var result = tf.pow(a, b); + test_util_1.expectArraysClose(result, [NaN, 27, NaN, 0], 0.05); + }); + it('handles non int32 exponent param', function () { + var a = tf.tensor1d([2, 4]); + var b = tf.tensor1d([.5, 1.2]); + var result = tf.pow(a, b); + var expected = [Math.pow(2, 0.5), Math.pow(4, 1.2)]; + test_util_1.expectArraysClose(result, expected); + }); + it('broadcasting same rank Tensors different shape', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor2d([2, 1], [2, 1], 'int32'); + var result = tf.pow(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [1, 4, -3, -4]; + test_util_1.expectArraysClose(result, expected); + }); + it('broadcast 2D + 1D', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor1d([1, 2], 'int32'); + var result = tf.pow(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [1, 4, -3, 16]; + test_util_1.expectArraysClose(result, expected); + }); + it('powStrict same-shaped tensors', function () { + var a = tf.tensor2d([1, -2, -3, 0, 7, 1], [2, 3]); + var b = tf.tensor2d([5, 3, 4, 5, 2, -3], [2, 3], 'int32'); + var expected = [1, -8, 81, 0, 49, 1]; + var result = tf.powStrict(a, b); + expect(result.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(result, expected, 0.01); + }); + it('powStrict throws when passed tensors of different shapes', function () { + var a = tf.tensor2d([1, 2, -3, -4, 5, 6], [2, 3]); + var b = tf.tensor2d([5, 3, 4, -7], [2, 2], 'int32'); + expect(function () { return tf.powStrict(a, b); }).toThrowError(); + }); + it('powStrict handles non int32 exponent param', function () { + var a = tf.tensor1d([2, 4]); + var b = tf.tensor1d([.5, 1.2]); + var result = tf.powStrict(a, b); + var expected = [Math.pow(2, 0.5), Math.pow(4, 1.2)]; + test_util_1.expectArraysClose(result, expected); + }); + it('gradients: Scalar ^ Scalar', function () { + var a = tf.scalar(5); + var b = tf.scalar(2, 'int32'); + var dy = tf.scalar(3); + var grads = tf.grads(function (a, b) { return tf.pow(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [2 * 5 * 3]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [3 * Math.pow(5, 2) * Math.log(5)]); + }); + it('gradients: Scalar ^ Scalar fractional exponent', function () { + var a = tf.scalar(4.0); + var b = tf.scalar(1.5); + var dy = tf.scalar(3.0); + var grads = tf.grads(function (a, b) { return tf.pow(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1.5 * Math.pow(4, 0.5) * 3]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [3.0 * Math.pow(4, 1.5) * Math.log(4.0)]); + }); + it('gradients: Tensor ^ Tensor', function () { + var a = tf.tensor1d([-1, .5, 2]); + var b = tf.tensor1d([3, 2, -1], 'int32'); + var dy = tf.tensor1d([1, 5, 10]); + var grads = tf.grads(function (a, b) { return tf.pow(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [ + 3 * Math.pow(-1, 2) * 1, 2 * Math.pow(.5, 1) * 5, + -1 * Math.pow(2, -2) * 10 + ], 1e-1); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [ + NaN, 5 * Math.pow(.5, 2) * Math.log(.5), + 10 * Math.pow(2, -1) * Math.log(2) + ]); + }); + it('gradient: scalar / Tensor1D', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([3, 4, 5]); + var dy = tf.tensor1d([6, 7, 8]); + var grads = tf.grads(function (a, b) { return tf.pow(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [ + 6 * 3 * Math.pow(2, 2) + 7 * 4 * Math.pow(2, 3) + 8 * 5 * Math.pow(2, 4) + ]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [ + 6 * Math.pow(2, 3) * Math.log(2), 7 * Math.pow(2, 4) * Math.log(2), + 8 * Math.pow(2, 5) * Math.log(2) + ]); + }); + it('gradient: Tensor2D / scalar', function () { + var a = tf.tensor2d([[2, 3], [4, 5]], [2, 2]); + var b = tf.scalar(2); + var dy = tf.tensor2d([[6, 7], [8, 9]], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.pow(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [ + 6 * 2 * Math.pow(2, 1), 7 * 2 * Math.pow(3, 1), 8 * 2 * Math.pow(4, 1), + 9 * 2 * Math.pow(5, 1) + ]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [6 * Math.pow(2, 2) * Math.log(2) + 7 * Math.pow(3, 2) * Math.log(3) + + 8 * Math.pow(4, 2) * Math.log(4) + 9 * Math.pow(5, 2) * Math.log(5)]); + }); + it('gradient: Tensor2D / Tensor2D w/ broadcast', function () { + var a = tf.tensor2d([3, 4], [2, 1]); + var b = tf.tensor2d([[2, 3], [.4, .5]], [2, 2]); + var dy = tf.tensor2d([[6, 7], [8, 9]], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.pow(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [ + 6 * 2 * Math.pow(3, 1) + 7 * 3 * Math.pow(3, 2), + 8 * .4 * Math.pow(4, .4 - 1) + 9 * .5 * Math.pow(4, .5 - 1) + ]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [ + 6 * Math.pow(3, 2) * Math.log(3), 7 * Math.pow(3, 3) * Math.log(3), + 8 * Math.pow(4, .4) * Math.log(4), 9 * Math.pow(4, .5) * Math.log(4) + ]); + }); + it('throws when passed base as a non-tensor', function () { + expect(function () { return tf.pow({}, tf.scalar(1)); }) + .toThrowError(/Argument 'base' passed to 'pow' must be a Tensor/); + }); + it('throws when passed exp as a non-tensor', function () { + expect(function () { return tf.pow(tf.scalar(1), {}); }) + .toThrowError(/Argument 'exp' passed to 'pow' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.pow([1, 2, 3], 2); + expect(result.shape).toEqual([3]); + expect(result.dtype).toBe('float32'); + test_util_1.expectArraysEqual(result, [1, 4, 9]); + }); + it('negative base and whole exponent not NaN', function () { + var a = tf.tensor1d([-2, -3, -4], 'float32'); + var b = tf.tensor1d([2, -3, 4], 'float32'); + var expected = [Math.pow(-2, 2), Math.pow(-3, -3), Math.pow(-4, 4)]; + var result = tf.pow(a, b); + test_util_1.expectArraysClose(result, expected); + }); + it('negative base and fract exponent NaN', function () { + var a = tf.tensor1d([-2, -3, -4], 'float32'); + var b = tf.tensor1d([2.1, -3.01, 4.001], 'float32'); + var expected = [NaN, NaN, NaN]; + var result = tf.pow(a, b); + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('add', test_util_1.ALL_ENVS, function () { + it('c + A', function () { + var c = tf.scalar(5); + var a = tf.tensor1d([1, 2, 3]); + var result = tf.add(c, a); + test_util_1.expectArraysClose(result, [6, 7, 8]); + }); + it('c + A propagates NaNs', function () { + var c = tf.scalar(NaN); + var a = tf.tensor1d([1, 2, 3]); + var res = tf.add(c, a); + test_util_1.expectArraysEqual(res, [NaN, NaN, NaN]); + }); + it('A + B broadcasting same rank Tensors different shape', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor2d([2, 3], [2, 1]); + var result = tf.add(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [3, 4, 0, -1]; + test_util_1.expectArraysClose(result, expected); + }); + it('A + B broadcast 2D + 1D', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor1d([1, 2]); + var result = tf.add(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [2, 4, -2, -2]; + test_util_1.expectArraysClose(result, expected); + }); + it('A + B', function () { + var a = tf.tensor1d([2, 5, 1]); + var b = tf.tensor1d([4, 2, -1]); + var result = tf.add(a, b); + var expected = [6, 7, 0]; + test_util_1.expectArraysClose(result, expected); + }); + it('A + B propagates NaNs', function () { + var a = tf.tensor1d([2, 5, NaN]); + var b = tf.tensor1d([4, 2, -1]); + var res = tf.add(a, b); + test_util_1.expectArraysClose(res, [6, 7, NaN]); + }); + it('A + B throws when passed tensors with different shape', function () { + var a = tf.tensor1d([2, 5, 1, 5]); + var b = tf.tensor1d([4, 2, -1]); + expect(function () { return tf.add(a, b); }).toThrowError(); + expect(function () { return tf.add(b, a); }).toThrowError(); + }); + it('2D+scalar broadcast', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = tf.scalar(2); + var res = tf.add(a, b); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(res, [3, 4, 5, 6, 7, 8]); + }); + it('scalar+1D broadcast', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([1, 2, 3, 4, 5, 6]); + var res = tf.add(a, b); + expect(res.shape).toEqual([6]); + test_util_1.expectArraysClose(res, [3, 4, 5, 6, 7, 8]); + }); + it('2D+2D broadcast each with 1 dim', function () { + var a = tf.tensor2d([1, 2, 5], [1, 3]); + var b = tf.tensor2d([7, 3], [2, 1]); + var res = tf.add(a, b); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(res, [8, 9, 12, 4, 5, 8]); + }); + it('2D+2D broadcast inner dim of b', function () { + var a = tf.tensor2d([1, 2, 5, 4, 5, 6], [2, 3]); + var b = tf.tensor2d([7, 3], [2, 1]); + var res = tf.add(a, b); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(res, [8, 9, 12, 7, 8, 9]); + }); + it('3D+scalar', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6], [2, 3, 1]); + var b = tf.scalar(-1); + var res = tf.add(a, b); + expect(res.shape).toEqual([2, 3, 1]); + test_util_1.expectArraysClose(res, [0, 1, 2, 3, 4, 5]); + }); + it('6D+scalar', function () { + var a = tf.range(0, 64).reshape([2, 2, 2, 2, 2, 2]); + var b = tf.scalar(-1); + var res = tf.add(a, b); + expect(res.shape).toEqual([2, 2, 2, 2, 2, 2]); + var expectedResult = [ + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62 + ]; + test_util_1.expectArraysClose(res, expectedResult); + }); + it('6D+2D', function () { + var a = tf.range(0, 64).reshape([2, 2, 2, 2, 2, 2]); + var b = tf.tensor2d([11, 13, 17, 19], [2, 2]); + var res = tf.add(a, b); + expect(res.shape).toEqual([2, 2, 2, 2, 2, 2]); + var expectedResult = [ + 11, 14, 19, 22, 15, 18, 23, 26, 19, 22, 27, 30, 23, 26, 31, 34, + 27, 30, 35, 38, 31, 34, 39, 42, 35, 38, 43, 46, 39, 42, 47, 50, + 43, 46, 51, 54, 47, 50, 55, 58, 51, 54, 59, 62, 55, 58, 63, 66, + 59, 62, 67, 70, 63, 66, 71, 74, 67, 70, 75, 78, 71, 74, 79, 82 + ]; + test_util_1.expectArraysClose(res, expectedResult); + }); + it('gradient: scalar + 1D broadcast', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([3, 4, 5]); + var dy = tf.tensor1d([7, 8, 9]); + var grads = tf.grads(function (a, b) { return tf.add(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [7 + 8 + 9]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [7, 8, 9]); + }); + it('gradient: 2D + 2D broadcast', function () { + var a = tf.tensor2d([2, 3], [2, 1]); + var b = tf.tensor2d([4, 5, 6, 7], [2, 2]); + var dy = tf.tensor2d([5, 4, 3, 2], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.add(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [5 + 4, 3 + 2]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [5, 4, 3, 2]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.add({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'add' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.add(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'add' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.add(5, [1, 2, 3]); + test_util_1.expectArraysClose(result, [6, 7, 8]); + }); +}); +jasmine_util_1.describeWithFlags('addN', test_util_1.ALL_ENVS, function () { + it('a single tensor', function () { + var res = tf.addN([tf.tensor1d([1, 2, 3])]); + test_util_1.expectArraysClose(res, [1, 2, 3]); + }); + it('two tensors, int32', function () { + var res = tf.addN([ + tf.tensor1d([1, 2, -1], 'int32'), + tf.tensor1d([5, 3, 2], 'int32'), + ]); + test_util_1.expectArraysClose(res, [6, 5, 1]); + expect(res.dtype).toBe('int32'); + expect(res.shape).toEqual([3]); + }); + it('three tensors', function () { + var res = tf.addN([ + tf.tensor1d([1, 2]), + tf.tensor1d([5, 3]), + tf.tensor1d([-5, -2]), + ]); + test_util_1.expectArraysClose(res, [1, 3]); + expect(res.dtype).toBe('float32'); + expect(res.shape).toEqual([2]); + }); + it('accepts a tensor-like object', function () { + var res = tf.addN([[1, 2], [3, 4]]); + test_util_1.expectArraysClose(res, [4, 6]); + expect(res.dtype).toBe('float32'); + expect(res.shape).toEqual([2]); + }); + it('list of numbers gets treated as a list of scalars', function () { + var res = tf.addN([1, 2, 3, 4]); + test_util_1.expectArraysClose(res, [10]); + expect(res.dtype).toBe('float32'); + expect(res.shape).toEqual([]); + }); + it('errors if list is empty', function () { + expect(function () { return tf.addN([]); }) + .toThrowError(/Must pass at least one tensor to tf.addN\(\), but got 0/); + }); + it('errors if argument is not an array', function () { + expect(function () { return tf.addN(tf.scalar(3)); }) + .toThrowError(/The param passed to tf.addN\(\) must be a list of tensors/); + }); + it('errors if arguments not of same dtype', function () { + expect(function () { return tf.addN([tf.scalar(1, 'int32'), tf.scalar(2, 'float32')]); }) + .toThrowError(/All tensors passed to tf.addN\(\) must have the same dtype/); + }); + it('errors if arguments not of same shape', function () { + expect(function () { return tf.addN([tf.scalar(1), tf.tensor1d([2])]); }) + .toThrowError(/All tensors passed to tf.addN\(\) must have the same shape/); + }); +}); +jasmine_util_1.describeWithFlags('sub', test_util_1.ALL_ENVS, function () { + it('c - A', function () { + var c = tf.scalar(5); + var a = tf.tensor1d([7, 2, 3]); + var result = tf.sub(c, a); + test_util_1.expectArraysClose(result, [-2, 3, 2]); + }); + it('A - c', function () { + var a = tf.tensor1d([1, 2, -3]); + var c = tf.scalar(5); + var result = tf.sub(a, c); + test_util_1.expectArraysClose(result, [-4, -3, -8]); + }); + it('A - c propagates NaNs', function () { + var a = tf.tensor1d([1, NaN, 3]); + var c = tf.scalar(5); + var res = tf.sub(a, c); + test_util_1.expectArraysClose(res, [-4, NaN, -2]); + }); + it('A - B', function () { + var a = tf.tensor1d([2, 5, 1]); + var b = tf.tensor1d([4, 2, -1]); + var result = tf.sub(a, b); + var expected = [-2, 3, 2]; + test_util_1.expectArraysClose(result, expected); + }); + it('A - B propagates NaNs', function () { + var a = tf.tensor1d([2, 5, 1]); + var b = tf.tensor1d([4, NaN, -1]); + var res = tf.sub(a, b); + test_util_1.expectArraysClose(res, [-2, NaN, 2]); + }); + it('A - B throws when passed tensors with different shape', function () { + var a = tf.tensor1d([2, 5, 1, 5]); + var b = tf.tensor1d([4, 2, -1]); + expect(function () { return tf.sub(a, b); }).toThrowError(); + expect(function () { return tf.sub(b, a); }).toThrowError(); + }); + it('A - B broadcasting same rank Tensors different shape', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor2d([2, 3], [2, 1]); + var result = tf.sub(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [-1, 0, -6, -7]; + test_util_1.expectArraysClose(result, expected); + }); + it('A - B broadcast 2D + 1D', function () { + var a = tf.tensor2d([1, 2, -3, -4], [2, 2]); + var b = tf.tensor1d([1, 2]); + var result = tf.sub(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [0, 0, -4, -6]; + test_util_1.expectArraysClose(result, expected); + }); + it('2D-scalar broadcast', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = tf.scalar(2); + var res = tf.sub(a, b); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(res, [-1, 0, 1, 2, 3, 4]); + }); + it('scalar-1D broadcast', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([1, 2, 3, 4, 5, 6]); + var res = tf.sub(a, b); + expect(res.shape).toEqual([6]); + test_util_1.expectArraysClose(res, [1, 0, -1, -2, -3, -4]); + }); + it('2D-2D broadcast each with 1 dim', function () { + var a = tf.tensor2d([1, 2, 5], [1, 3]); + var b = tf.tensor2d([7, 3], [2, 1]); + var res = tf.sub(a, b); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(res, [-6, -5, -2, -2, -1, 2]); + }); + it('2D-2D broadcast inner dim of b', function () { + var a = tf.tensor2d([1, 2, 5, 4, 5, 6], [2, 3]); + var b = tf.tensor2d([7, 3], [2, 1]); + var res = tf.sub(a, b); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(res, [-6, -5, -2, 1, 2, 3]); + }); + it('3D-scalar', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6], [2, 3, 1]); + var b = tf.scalar(-1); + var res = tf.sub(a, b); + expect(res.shape).toEqual([2, 3, 1]); + test_util_1.expectArraysClose(res, [2, 3, 4, 5, 6, 7]); + }); + it('gradients: basic 1D arrays', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([3, 2, 1]); + var dy = tf.tensor1d([1, 10, 20]); + var grads = tf.grads(function (a, b) { return tf.sub(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1, 10, 20]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-1, -10, -20]); + }); + it('gradients: basic 2D arrays', function () { + var a = tf.tensor2d([0, 1, 2, 3], [2, 2]); + var b = tf.tensor2d([3, 2, 1, 0], [2, 2]); + var dy = tf.tensor2d([1, 10, 15, 20], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.sub(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1, 10, 15, 20]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-1, -10, -15, -20]); + }); + it('gradient: 1D - scalar broadcast', function () { + var a = tf.tensor1d([3, 4, 5]); + var b = tf.scalar(2); + var dy = tf.tensor1d([7, 8, 9]); + var grads = tf.grads(function (a, b) { return tf.sub(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [7, 8, 9]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-7 - 8 - 9]); + }); + it('gradient: scalar - 1D broadcast', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([3, 4, 5]); + var dy = tf.tensor1d([7, 8, 9]); + var grads = tf.grads(function (a, b) { return tf.sub(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [7 + 8 + 9]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-7, -8, -9]); + }); + it('gradient: 2D - 2D broadcast', function () { + var a = tf.tensor2d([4, 5, 6, 7], [2, 2]); + var b = tf.tensor2d([2, 3], [2, 1]); + var dy = tf.tensor2d([5, 4, 3, 2], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.sub(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [5, 4, 3, 2]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-5 - 4, -3 - 2]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.sub({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'sub' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.sub(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'sub' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.sub(5, [7, 2, 3]); + test_util_1.expectArraysClose(result, [-2, 3, 2]); + }); +}); +//# sourceMappingURL=arithmetic_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/arithmetic_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/arithmetic_test.js.map new file mode 100644 index 0000000..5040563 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/arithmetic_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"arithmetic_test.js","sourceRoot":"","sources":["../../src/ops/arithmetic_test.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CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACpC,6BAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE;QACzC,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,GAAG,CAAC,EAAe,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAArC,CAAqC,CAAC;aAC9C,YAAY,CAAC,+CAA+C,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,sCAAsC,EAAE;QACzC,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAe,CAAC,EAArC,CAAqC,CAAC;aAC9C,YAAY,CAAC,+CAA+C,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACpC,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops.d.ts new file mode 100644 index 0000000..46a4a34 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops.d.ts @@ -0,0 +1,56 @@ +import { Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorBuffer } from '../tensor'; +import { DataType, Rank, ShapeMap, TensorLike, TensorLike1D, TypedArray } from '../types'; +declare function clone_(x: T | TensorLike): T; +declare function eye_(numRows: number, numColumns?: number, batchShape?: [number] | [number, number] | [number, number, number] | [number, number, number, number], dtype?: DataType): Tensor2D; +declare function randomNormal_(shape: ShapeMap[R], mean?: number, stdDev?: number, dtype?: 'float32' | 'int32', seed?: number): Tensor; +declare function truncatedNormal_(shape: ShapeMap[R], mean?: number, stdDev?: number, dtype?: 'float32' | 'int32', seed?: number): Tensor; +declare function randomUniform_(shape: ShapeMap[R], minval?: number, maxval?: number, dtype?: DataType): Tensor; +declare function rand_(shape: ShapeMap[R], randFunction: () => number, dtype?: DataType): Tensor; +declare function multinomial_(logits: Tensor1D | Tensor2D | TensorLike, numSamples: number, seed?: number, normalized?: boolean): Tensor1D | Tensor2D; +declare function oneHot_(indices: Tensor1D | TensorLike1D, depth: number, onValue?: number, offValue?: number): Tensor2D; +declare function fromPixels_(pixels: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, numChannels?: number): Tensor3D; +declare function toPixels(img: Tensor2D | Tensor3D | TensorLike, canvas?: HTMLCanvasElement): Promise; +declare function reshape_(x: Tensor | TensorLike, shape: ShapeMap[R2]): Tensor; +declare function squeeze_(x: Tensor | TensorLike, axis?: number[]): T; +declare function cast_(x: T | TensorLike, dtype: DataType): T; +declare function tile_(x: T | TensorLike, reps: number[]): T; +declare function pad1d_(x: Tensor1D | TensorLike, paddings: [number, number], constantValue?: number): Tensor1D; +declare function pad2d_(x: Tensor2D | TensorLike, paddings: [[number, number], [number, number]], constantValue?: number): Tensor2D; +declare function pad3d_(x: Tensor3D | TensorLike, paddings: [[number, number], [number, number], [number, number]], constantValue?: number): Tensor3D; +declare function pad4d_(x: Tensor4D | TensorLike, paddings: [[number, number], [number, number], [number, number], [number, number]], constantValue?: number): Tensor4D; +declare function pad_(x: T | TensorLike, paddings: Array<[number, number]>, constantValue?: number): T; +declare function stack_(tensors: T[] | TensorLike[], axis?: number): Tensor; +declare function batchToSpaceND_(x: T | TensorLike, blockShape: number[], crops: number[][]): T; +declare function spaceToBatchND_(x: T | TensorLike, blockShape: number[], paddings: number[][]): T; +declare function unstack_(x: T | TensorLike, axis?: number): Tensor[]; +declare function split_(x: T | TensorLike, numOrSizeSplits: number[] | number, axis?: number): T[]; +declare function cumsum_(x: Tensor | TensorLike, axis?: number, exclusive?: boolean, reverse?: boolean): T; +declare function expandDims_(x: Tensor | TensorLike, axis?: number): Tensor; +declare function buffer(shape: ShapeMap[R], dtype?: DataType, values?: TypedArray): TensorBuffer; +declare function print(x: T, verbose?: boolean): void; +export { buffer, toPixels, print }; +export declare const cast: typeof cast_; +export declare const clone: typeof clone_; +export declare const cumsum: typeof cumsum_; +export declare const expandDims: typeof expandDims_; +export declare const eye: typeof eye_; +export declare const fromPixels: typeof fromPixels_; +export declare const multinomial: typeof multinomial_; +export declare const oneHot: typeof oneHot_; +export declare const pad: typeof pad_; +export declare const pad1d: typeof pad1d_; +export declare const pad2d: typeof pad2d_; +export declare const pad3d: typeof pad3d_; +export declare const pad4d: typeof pad4d_; +export declare const rand: typeof rand_; +export declare const randomNormal: typeof randomNormal_; +export declare const randomUniform: typeof randomUniform_; +export declare const reshape: typeof reshape_; +export declare const split: typeof split_; +export declare const squeeze: typeof squeeze_; +export declare const stack: typeof stack_; +export declare const tile: typeof tile_; +export declare const truncatedNormal: typeof truncatedNormal_; +export declare const unstack: typeof unstack_; +export declare const batchToSpaceND: typeof batchToSpaceND_; +export declare const spaceToBatchND: typeof spaceToBatchND_; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops.js new file mode 100644 index 0000000..985d670 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops.js @@ -0,0 +1,526 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_1 = require("../tensor"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var axis_util_1 = require("./axis_util"); +var concat_1 = require("./concat"); +var operation_1 = require("./operation"); +var rand_1 = require("./rand"); +var tensor_ops_1 = require("./tensor_ops"); +function clone_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'clone'); + var der = function (dy) { + return { $x: function () { return dy.toFloat(); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { + return tensor_1.Tensor.make($x.shape, { dataId: $x.dataId }, $x.dtype); + }, { $x: $x }, der); +} +function eye_(numRows, numColumns, batchShape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + if (numColumns == null) { + numColumns = numRows; + } + var buff = buffer([numRows, numColumns], dtype); + var n = numRows <= numColumns ? numRows : numColumns; + for (var i = 0; i < n; ++i) { + buff.set(1, i, i); + } + var out = buff.toTensor().as2D(numRows, numColumns); + if (batchShape == null) { + return out; + } + else { + if (batchShape.length === 1) { + return exports.tile(exports.expandDims(out, 0), [batchShape[0], 1, 1]); + } + else if (batchShape.length === 2) { + return exports.tile(exports.expandDims(exports.expandDims(out, 0), 0), [batchShape[0], batchShape[1], 1, 1]); + } + else if (batchShape.length === 3) { + return exports.tile(exports.expandDims(exports.expandDims(exports.expandDims(out, 0), 0), 0), [batchShape[0], batchShape[1], batchShape[2], 1, 1]); + } + else { + throw new Error("eye() currently supports only 1D and 2D " + + ("batchShapes, but received " + batchShape.length + "D.")); + } + } +} +function randomNormal_(shape, mean, stdDev, dtype, seed) { + if (mean === void 0) { mean = 0; } + if (stdDev === void 0) { stdDev = 1; } + if (dtype != null && dtype === 'bool') { + throw new Error("Unsupported data type " + dtype); + } + var randGauss = new rand_1.MPRandGauss(mean, stdDev, dtype, false, seed); + var res = buffer(shape, dtype); + for (var i = 0; i < res.values.length; i++) { + res.values[i] = randGauss.nextValue(); + } + return res.toTensor(); +} +function truncatedNormal_(shape, mean, stdDev, dtype, seed) { + if (mean === void 0) { mean = 0; } + if (stdDev === void 0) { stdDev = 1; } + if (dtype != null && dtype === 'bool') { + throw new Error("Unsupported data type " + dtype); + } + var randGauss = new rand_1.MPRandGauss(mean, stdDev, dtype, true, seed); + var res = buffer(shape, dtype); + for (var i = 0; i < res.values.length; i++) { + res.values[i] = randGauss.nextValue(); + } + return res.toTensor(); +} +function randomUniform_(shape, minval, maxval, dtype) { + if (minval === void 0) { minval = 0; } + if (maxval === void 0) { maxval = 1; } + if (dtype === void 0) { dtype = 'float32'; } + var res = buffer(shape, dtype); + for (var i = 0; i < res.values.length; i++) { + res.values[i] = util.randUniform(minval, maxval); + } + return res.toTensor(); +} +function rand_(shape, randFunction, dtype) { + var size = util.sizeFromShape(shape); + var values = null; + if (dtype == null || dtype === 'float32') { + values = new Float32Array(size); + } + else if (dtype === 'int32') { + values = new Int32Array(size); + } + else if (dtype === 'bool') { + values = new Uint8Array(size); + } + else { + throw new Error("Unknown data type " + dtype); + } + for (var i = 0; i < size; i++) { + values[i] = randFunction(); + } + return tensor_1.Tensor.make(shape, { values: values }, dtype); +} +function multinomial_(logits, numSamples, seed, normalized) { + if (normalized === void 0) { normalized = false; } + var $logits = tensor_util_env_1.convertToTensor(logits, 'logits', 'multinomial'); + var numOutcomes = $logits.size; + var origRank = $logits.rank; + if (numOutcomes < 2) { + throw new Error("Error in multinomial: you need at least 2 outcomes, but got " + + (numOutcomes + ".")); + } + if (origRank > 2) { + throw new Error("Rank of probabilities must be 1 or 2, but is " + origRank); + } + seed = seed || Math.random(); + var logits2D = origRank === 1 ? $logits.as2D(1, -1) : $logits; + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.multinomial(logits2D, normalized, numSamples, seed); }, { logits2D: logits2D }); + return origRank === 1 ? res.as1D() : res; +} +function oneHot_(indices, depth, onValue, offValue) { + if (onValue === void 0) { onValue = 1; } + if (offValue === void 0) { offValue = 0; } + var $indices = tensor_util_env_1.convertToTensor(indices, 'indices', 'oneHot', 'int32'); + util.assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`'); + if (depth < 2) { + throw new Error("Error in oneHot: depth must be >=2, but it is " + depth); + } + return environment_1.ENV.engine.runKernel(function (backend) { return backend.oneHot($indices, depth, onValue, offValue); }, { $indices: $indices }); +} +function fromPixels_(pixels, numChannels) { + if (numChannels === void 0) { numChannels = 3; } + if (numChannels > 4) { + throw new Error('Cannot construct Tensor with more than 4 channels from pixels.'); + } + return environment_1.ENV.engine.fromPixels(pixels, numChannels); +} +function toPixels(img, canvas) { + return __awaiter(this, void 0, void 0, function () { + var $img, _a, height, width, depth, minTensor, maxTensor, min, max, data, multiplier, bytes, i, r, g, b, a, j, ctx, imageData; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + $img = tensor_util_env_1.convertToTensor(img, 'img', 'toPixels', 'int32'); + if ($img.rank !== 2 && $img.rank !== 3) { + throw new Error("toPixels only supports rank 2 or 3 tensors, got rank " + $img.rank + "."); + } + _a = $img.shape.slice(0, 2), height = _a[0], width = _a[1]; + depth = $img.rank === 2 ? 1 : $img.shape[2]; + if (depth > 4 || depth === 2) { + throw new Error("toPixels only supports depth of size " + + ("1, 3 or 4 but got " + depth)); + } + minTensor = $img.min(); + maxTensor = $img.max(); + return [4, minTensor.data()]; + case 1: + min = (_b.sent())[0]; + return [4, maxTensor.data()]; + case 2: + max = (_b.sent())[0]; + minTensor.dispose(); + maxTensor.dispose(); + if ($img.dtype === 'float32') { + if (min < 0 || max > 1) { + throw new Error("Tensor values for a float32 Tensor must be in the " + + ("range [0 - 1] but got range [" + min + " - " + max + "].")); + } + } + else if ($img.dtype === 'int32') { + if (min < 0 || max > 255) { + throw new Error("Tensor values for a int32 Tensor must be in the " + + ("range [0 - 255] but got range [" + min + " - " + max + "].")); + } + } + else { + throw new Error("Unsupported type for toPixels: " + $img.dtype + "." + + " Please use float32 or int32 tensors."); + } + return [4, $img.data()]; + case 3: + data = _b.sent(); + multiplier = $img.dtype === 'float32' ? 255 : 1; + bytes = new Uint8ClampedArray(width * height * 4); + for (i = 0; i < height * width; ++i) { + r = void 0, g = void 0, b = void 0, a = void 0; + if (depth === 1) { + r = data[i] * multiplier; + g = data[i] * multiplier; + b = data[i] * multiplier; + a = 255; + } + else if (depth === 3) { + r = data[i * 3] * multiplier; + g = data[i * 3 + 1] * multiplier; + b = data[i * 3 + 2] * multiplier; + a = 255; + } + else if (depth === 4) { + r = data[i * 4] * multiplier; + g = data[i * 4 + 1] * multiplier; + b = data[i * 4 + 2] * multiplier; + a = data[i * 4 + 3] * multiplier; + } + j = i * 4; + bytes[j + 0] = Math.round(r); + bytes[j + 1] = Math.round(g); + bytes[j + 2] = Math.round(b); + bytes[j + 3] = Math.round(a); + } + if (canvas != null) { + canvas.width = width; + canvas.height = height; + ctx = canvas.getContext('2d'); + imageData = new ImageData(bytes, width, height); + ctx.putImageData(imageData, 0, 0); + } + if ($img !== img) { + $img.dispose(); + } + return [2, bytes]; + } + }); + }); +} +exports.toPixels = toPixels; +function reshape_(x, shape) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'reshape'); + shape = util.inferFromImplicitShape(shape, $x.size); + util.assert($x.size === util.sizeFromShape(shape), 'new shape and old shape must have the same number of elements.'); + var grad = function (dy) { + return { $x: function () { return dy.reshape($x.shape); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.reshape($x, shape); }, { $x: $x }, grad); +} +function squeeze_(x, axis) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'squeeze'); + return exports.reshape($x, util.squeezeShape($x.shape, axis).newShape); +} +function cast_(x, dtype) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'cast'); + var grad = function (dy) { + return { $x: function () { return dy.clone(); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.cast($x, dtype); }, { $x: $x }, grad); +} +function tile_(x, reps) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'tile'); + util.assert($x.rank === reps.length, "Error in transpose: rank of input " + $x.rank + " " + + ("must match length of reps " + reps + ".")); + var grad = function (dy) { + var derX = function () { + var xGrad = tensor_ops_1.zerosLike($x); + if ($x.rank === 1) { + for (var i = 0; i < reps[0]; ++i) { + xGrad = xGrad.add(dy.slice([i * $x.shape[0]], [$x.shape[0]])); + } + } + else if ($x.rank === 2) { + for (var i = 0; i < reps[0]; ++i) { + for (var j = 0; j < reps[1]; ++j) { + xGrad = xGrad.add(dy.slice([i * $x.shape[0], j * $x.shape[1]], [$x.shape[0], $x.shape[1]])); + } + } + } + else if ($x.rank === 3) { + for (var i = 0; i < reps[0]; ++i) { + for (var j = 0; j < reps[1]; ++j) { + for (var k = 0; k < reps[2]; ++k) { + xGrad = xGrad.add(dy.slice([i * $x.shape[0], j * $x.shape[1], k * $x.shape[2]], [$x.shape[0], $x.shape[1], $x.shape[2]])); + } + } + } + } + else if ($x.rank === 4) { + for (var i = 0; i < reps[0]; ++i) { + for (var j = 0; j < reps[1]; ++j) { + for (var k = 0; k < reps[2]; ++k) { + for (var l = 0; l < reps[3]; ++l) { + xGrad = xGrad.add(dy.slice([ + i * $x.shape[0], j * $x.shape[1], k * $x.shape[2], + l * $x.shape[3] + ], [$x.shape[0], $x.shape[1], $x.shape[2], $x.shape[3]])); + } + } + } + } + } + else { + throw new Error("Gradient for tile operation is not implemented for rank-" + + ($x.rank + " tensors yet.")); + } + return xGrad; + }; + return { $x: derX }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.tile($x, reps); }, { $x: $x }, grad); +} +function pad1d_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + util.assert(paddings.length === 2, 'Invalid number of paddings. Must be length of 2.'); + return exports.pad(x, [paddings], constantValue); +} +function pad2d_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + util.assert(paddings.length === 2 && paddings[0].length === 2 && + paddings[1].length === 2, 'Invalid number of paddings. Must be length of 2 each.'); + return exports.pad(x, paddings, constantValue); +} +function pad3d_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + util.assert(paddings.length === 3 && paddings[0].length === 2 && + paddings[1].length === 2 && paddings[2].length === 2, 'Invalid number of paddings. Must be length of 2 each.'); + return exports.pad(x, paddings, constantValue); +} +function pad4d_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + util.assert(paddings.length === 4 && paddings[0].length === 2 && + paddings[1].length === 2 && paddings[2].length === 2 && + paddings[3].length === 2, 'Invalid number of paddings. Must be length of 2 each.'); + return exports.pad(x, paddings, constantValue); +} +function pad_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'pad'); + if ($x.rank === 0) { + throw new Error('pad(scalar) is not defined. Pass non-scalar to pad'); + } + var begin = paddings.map(function (p) { return p[0]; }); + var grad = function (dy) { + return { $x: function () { return dy.slice(begin, $x.shape); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.pad($x, paddings, constantValue); }, { $x: $x }, grad); +} +function stack_(tensors, axis) { + if (axis === void 0) { axis = 0; } + var $tensors = tensor_util_env_1.convertToTensorArray(tensors, 'tensors', 'stack'); + util.assert($tensors.length >= 1, 'Pass at least one tensor to tf.stack'); + if ($tensors.length === 1) { + return $tensors[0].expandDims(axis); + } + var rank = $tensors[0].rank; + var shape = $tensors[0].shape; + var dtype = $tensors[0].dtype; + util.assert(axis <= rank, 'Axis must be <= rank of the tensor'); + $tensors.forEach(function (t) { + util.assertShapesMatch(shape, t.shape, 'All tensors passed to stack must have matching shapes'); + }); + $tensors.forEach(function (t) { + util.assert(dtype === t.dtype, 'All tensors passed to stack must have matching dtypes'); + }); + var expandedTensors = $tensors.map(function (t) { return t.expandDims(axis); }); + return concat_1.concat(expandedTensors, axis); +} +function batchToSpaceND_(x, blockShape, crops) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'batchToSpaceND'); + var prod = blockShape.reduce(function (a, b) { return a * b; }); + util.assert($x.rank >= 1 + blockShape.length, "input rank should be > than [blockShape] but got " + $x.rank); + util.assert(crops.length === blockShape.length, "crops.shape[0] must be equal to [blockShape] but got " + crops.length); + util.assert($x.shape[0] % prod === 0, "input tensor batch must be divisible by prod( blockShape )"); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.batchToSpaceND($x, blockShape, crops); }, {}); +} +function spaceToBatchND_(x, blockShape, paddings) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'spaceToBatchND'); + util.assert($x.rank >= 1 + blockShape.length, "input rank should be > than [blockShape] but got " + $x.rank); + util.assert(paddings.length === blockShape.length, "paddings.shape[0] must be equal to [blockShape], got " + paddings.length); + util.assert($x.shape.reduce(function (a, b, i) { + if (i > 0 && i <= blockShape.length) { + return a && (b % blockShape[i - 1] === 0); + } + return a; + }, true), "input spatial dimensions must be divisible by blockShapes"); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.spaceToBatchND($x, blockShape, paddings); }, {}); +} +function unstack_(x, axis) { + if (axis === void 0) { axis = 0; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'unstack'); + var num = $x.shape[axis]; + var outputShape = Array($x.rank - 1).fill(0); + var outIndex = 0; + for (var i = 0; i < $x.rank; i++) { + if (i !== axis) { + outputShape[outIndex] = $x.shape[i]; + outIndex++; + } + } + var splitSizes; + splitSizes = Array(num).fill(1); + var begin = Array($x.rank).fill(0); + var size = $x.shape.slice(); + return splitSizes.map(function (s) { + size[axis] = s; + var slice = $x.slice(begin, size); + begin[axis] += s; + return slice.reshape(outputShape); + }); +} +function split_(x, numOrSizeSplits, axis) { + if (axis === void 0) { axis = 0; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'split'); + axis = axis_util_1.parseAxisParam(axis, $x.shape)[0]; + var splitSizes; + if (typeof (numOrSizeSplits) === 'number') { + util.assert($x.shape[axis] % numOrSizeSplits === 0, 'Number of splits must evenly divide the axis.'); + splitSizes = Array(numOrSizeSplits).fill($x.shape[axis] / numOrSizeSplits); + } + else { + util.assert($x.shape[axis] === numOrSizeSplits.reduce(function (a, b) { return a + b; }), 'The sum of sizes must match the size of the axis dimension.'); + splitSizes = numOrSizeSplits; + } + var begin = Array($x.rank).fill(0); + var size = $x.shape.slice(); + return splitSizes.map(function (s) { + size[axis] = s; + var slice = $x.slice(begin, size); + begin[axis] += s; + return slice; + }); +} +function cumsum_(x, axis, exclusive, reverse) { + if (axis === void 0) { axis = 0; } + if (exclusive === void 0) { exclusive = false; } + if (reverse === void 0) { reverse = false; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'cumsum'); + axis = axis | 0; + var permutation = axis_util_1.getAxesPermutation([axis], $x.rank); + var permutedX = $x; + if (permutation != null) { + permutedX = $x.transpose(permutation); + } + var permutedAxis = axis_util_1.getInnerMostAxes(1, $x.rank)[0]; + var grad = function (dy) { + return { permutedX: function () { return dy.cumsum(axis, exclusive, !reverse); } }; + }; + var value = environment_1.ENV.engine.runKernel(function (backend) { return backend.cumsum(permutedX, permutedAxis, exclusive, reverse); }, { permutedX: permutedX }, grad); + if (permutation != null) { + value = value.transpose(permutation); + } + return value; +} +function expandDims_(x, axis) { + if (axis === void 0) { axis = 0; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'expandDims'); + util.assert(axis <= $x.rank, 'Axis must be <= rank of the tensor'); + var newShape = $x.shape.slice(); + if (axis < 0) { + util.assert(-($x.rank + 1) <= axis, "Axis must be in the interval [" + -($x.rank + 1) + ", " + $x.rank + "]"); + axis = $x.rank + axis + 1; + } + newShape.splice(axis, 0, 1); + return exports.reshape($x, newShape); +} +function buffer(shape, dtype, values) { + if (dtype === void 0) { dtype = 'float32'; } + return new tensor_1.TensorBuffer(shape, dtype, values); +} +exports.buffer = buffer; +function print(x, verbose) { + if (verbose === void 0) { verbose = false; } + console.log(x.toString(verbose)); +} +exports.print = print; +exports.cast = operation_1.op({ cast_: cast_ }); +exports.clone = operation_1.op({ clone_: clone_ }); +exports.cumsum = operation_1.op({ cumsum_: cumsum_ }); +exports.expandDims = operation_1.op({ expandDims_: expandDims_ }); +exports.eye = operation_1.op({ eye_: eye_ }); +exports.fromPixels = operation_1.op({ fromPixels_: fromPixels_ }); +exports.multinomial = operation_1.op({ multinomial_: multinomial_ }); +exports.oneHot = operation_1.op({ oneHot_: oneHot_ }); +exports.pad = operation_1.op({ pad_: pad_ }); +exports.pad1d = operation_1.op({ pad1d_: pad1d_ }); +exports.pad2d = operation_1.op({ pad2d_: pad2d_ }); +exports.pad3d = operation_1.op({ pad3d_: pad3d_ }); +exports.pad4d = operation_1.op({ pad4d_: pad4d_ }); +exports.rand = operation_1.op({ rand_: rand_ }); +exports.randomNormal = operation_1.op({ randomNormal_: randomNormal_ }); +exports.randomUniform = operation_1.op({ randomUniform_: randomUniform_ }); +exports.reshape = operation_1.op({ reshape_: reshape_ }); +exports.split = operation_1.op({ split_: split_ }); +exports.squeeze = operation_1.op({ squeeze_: squeeze_ }); +exports.stack = operation_1.op({ stack_: stack_ }); +exports.tile = operation_1.op({ tile_: tile_ }); +exports.truncatedNormal = operation_1.op({ truncatedNormal_: truncatedNormal_ }); +exports.unstack = operation_1.op({ unstack_: unstack_ }); +exports.batchToSpaceND = operation_1.op({ batchToSpaceND_: batchToSpaceND_ }); +exports.spaceToBatchND = operation_1.op({ spaceToBatchND_: spaceToBatchND_ }); +//# sourceMappingURL=array_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops.js.map new file mode 100644 index 0000000..a9f4d7b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"array_ops.js","sourceRoot":"","sources":["../../src/ops/array_ops.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,8CAAmC;AACnC,oCAAuF;AACvF,sDAAyE;AAEzE,8BAAgC;AAChC,yCAAiF;AACjF,mCAAgC;AAChC,yCAA+B;AAC/B,+BAAmC;AACnC,2CAAuC;AAevC,gBAAkC,CAAe;IAC/C,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,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,CAAC,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACrB,QAAA,KAAK,GAAG,cAAE,CAAC,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACrB,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;AACnB,QAAA,YAAY,GAAG,cAAE,CAAC,EAAC,aAAa,eAAA,EAAC,CAAC,CAAC;AACnC,QAAA,aAAa,GAAG,cAAE,CAAC,EAAC,cAAc,gBAAA,EAAC,CAAC,CAAC;AACrC,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,KAAK,GAAG,cAAE,CAAC,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACrB,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,KAAK,GAAG,cAAE,CAAC,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACrB,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;AACnB,QAAA,eAAe,GAAG,cAAE,CAAC,EAAC,gBAAgB,kBAAA,EAAC,CAAC,CAAC;AACzC,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,cAAc,GAAG,cAAE,CAAC,EAAC,eAAe,iBAAA,EAAC,CAAC,CAAC;AACvC,QAAA,cAAc,GAAG,cAAE,CAAC,EAAC,eAAe,iBAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_test.js new file mode 100644 index 0000000..74309f0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_test.js @@ -0,0 +1,2743 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var util = require("../util"); +var rand_util_1 = require("./rand_util"); +jasmine_util_1.describeWithFlags('zeros', test_util_1.ALL_ENVS, function () { + it('1D default dtype', function () { + var a = tf.zeros([3]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysClose(a, [0, 0, 0]); + }); + it('1D float32 dtype', function () { + var a = tf.zeros([3], 'float32'); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysClose(a, [0, 0, 0]); + }); + it('1D int32 dtype', function () { + var a = tf.zeros([3], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysEqual(a, [0, 0, 0]); + }); + it('1D bool dtype', function () { + var a = tf.zeros([3], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysEqual(a, [0, 0, 0]); + }); + it('2D default dtype', function () { + var a = tf.zeros([3, 2]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2]); + test_util_1.expectArraysClose(a, [0, 0, 0, 0, 0, 0]); + }); + it('2D float32 dtype', function () { + var a = tf.zeros([3, 2], 'float32'); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2]); + test_util_1.expectArraysClose(a, [0, 0, 0, 0, 0, 0]); + }); + it('2D int32 dtype', function () { + var a = tf.zeros([3, 2], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([3, 2]); + test_util_1.expectArraysEqual(a, [0, 0, 0, 0, 0, 0]); + }); + it('2D bool dtype', function () { + var a = tf.zeros([3, 2], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([3, 2]); + test_util_1.expectArraysEqual(a, [0, 0, 0, 0, 0, 0]); + }); + it('3D default dtype', function () { + var a = tf.zeros([2, 2, 2]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(a, [0, 0, 0, 0, 0, 0, 0, 0]); + }); + it('3D float32 dtype', function () { + var a = tf.zeros([2, 2, 2], 'float32'); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(a, [0, 0, 0, 0, 0, 0, 0, 0]); + }); + it('3D int32 dtype', function () { + var a = tf.zeros([2, 2, 2], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysEqual(a, [0, 0, 0, 0, 0, 0, 0, 0]); + }); + it('3D bool dtype', function () { + var a = tf.zeros([2, 2, 2], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysEqual(a, [0, 0, 0, 0, 0, 0, 0, 0]); + }); + it('4D default dtype', function () { + var a = tf.zeros([3, 2, 1, 1]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2, 1, 1]); + test_util_1.expectArraysClose(a, [0, 0, 0, 0, 0, 0]); + }); + it('4D float32 dtype', function () { + var a = tf.zeros([3, 2, 1, 1], 'float32'); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2, 1, 1]); + test_util_1.expectArraysClose(a, [0, 0, 0, 0, 0, 0]); + }); + it('4D int32 dtype', function () { + var a = tf.zeros([3, 2, 1, 1], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([3, 2, 1, 1]); + test_util_1.expectArraysEqual(a, [0, 0, 0, 0, 0, 0]); + }); + it('4D bool dtype', function () { + var a = tf.zeros([3, 2, 1, 1], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([3, 2, 1, 1]); + test_util_1.expectArraysEqual(a, [0, 0, 0, 0, 0, 0]); + }); +}); +jasmine_util_1.describeWithFlags('ones', test_util_1.ALL_ENVS, function () { + it('1D default dtype', function () { + var a = tf.ones([3]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysClose(a, [1, 1, 1]); + }); + it('1D float32 dtype', function () { + var a = tf.ones([3], 'float32'); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysClose(a, [1, 1, 1]); + }); + it('1D int32 dtype', function () { + var a = tf.ones([3], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysEqual(a, [1, 1, 1]); + }); + it('1D bool dtype', function () { + var a = tf.ones([3], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysEqual(a, [1, 1, 1]); + }); + it('2D default dtype', function () { + var a = tf.ones([3, 2]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2]); + test_util_1.expectArraysClose(a, [1, 1, 1, 1, 1, 1]); + }); + it('2D float32 dtype', function () { + var a = tf.ones([3, 2], 'float32'); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2]); + test_util_1.expectArraysClose(a, [1, 1, 1, 1, 1, 1]); + }); + it('2D int32 dtype', function () { + var a = tf.ones([3, 2], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([3, 2]); + test_util_1.expectArraysEqual(a, [1, 1, 1, 1, 1, 1]); + }); + it('2D bool dtype', function () { + var a = tf.ones([3, 2], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([3, 2]); + test_util_1.expectArraysEqual(a, [1, 1, 1, 1, 1, 1]); + }); + it('3D default dtype', function () { + var a = tf.ones([2, 2, 2]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(a, [1, 1, 1, 1, 1, 1, 1, 1]); + }); + it('3D float32 dtype', function () { + var a = tf.ones([2, 2, 2], 'float32'); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(a, [1, 1, 1, 1, 1, 1, 1, 1]); + }); + it('3D int32 dtype', function () { + var a = tf.ones([2, 2, 2], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysEqual(a, [1, 1, 1, 1, 1, 1, 1, 1]); + }); + it('3D bool dtype', function () { + var a = tf.ones([2, 2, 2], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysEqual(a, [1, 1, 1, 1, 1, 1, 1, 1]); + }); + it('4D default dtype', function () { + var a = tf.ones([3, 2, 1, 1]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2, 1, 1]); + test_util_1.expectArraysClose(a, [1, 1, 1, 1, 1, 1]); + }); + it('4D float32 dtype', function () { + var a = tf.ones([3, 2, 1, 1], 'float32'); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2, 1, 1]); + test_util_1.expectArraysClose(a, [1, 1, 1, 1, 1, 1]); + }); + it('4D int32 dtype', function () { + var a = tf.ones([3, 2, 1, 1], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([3, 2, 1, 1]); + test_util_1.expectArraysEqual(a, [1, 1, 1, 1, 1, 1]); + }); + it('4D bool dtype', function () { + var a = tf.ones([3, 2, 1, 1], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([3, 2, 1, 1]); + test_util_1.expectArraysEqual(a, [1, 1, 1, 1, 1, 1]); + }); +}); +jasmine_util_1.describeWithFlags('zerosLike', test_util_1.ALL_ENVS, function () { + it('1D default dtype', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysClose(b, [0, 0, 0]); + }); + it('1D float32 dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'float32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysClose(b, [0, 0, 0]); + }); + it('1D int32 dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'int32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysEqual(b, [0, 0, 0]); + }); + it('1D bool dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'bool'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysEqual(b, [0, 0, 0]); + }); + it('2D default dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('2D float32 dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'float32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('2D int32 dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'int32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('2D bool dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'bool'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('3D default dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('3D float32 dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1], 'float32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('3D int32 dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1], 'int32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('3D bool dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1], 'bool'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('4D default dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1]); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('4D float32 dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1], 'float32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('4D int32 dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1], 'int32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('4D bool dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1], 'bool'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('4D default dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1]); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('5D float32 dtype', function () { + var a = tf.tensor5d([1, 2, 3, 4], [1, 2, 2, 1, 1], 'float32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([1, 2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('5D int32 dtype', function () { + var a = tf.tensor5d([1, 2, 3, 4], [1, 2, 2, 1, 1], 'int32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([1, 2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('5D bool dtype', function () { + var a = tf.tensor5d([1, 2, 3, 4], [1, 2, 2, 1, 1], 'bool'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([1, 2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('5D default dtype', function () { + var a = tf.tensor5d([1, 2, 3, 4], [1, 2, 2, 1, 1]); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([1, 2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('6D float32 dtype', function () { + var a = tf.tensor6d([1, 2, 3, 4], [1, 2, 2, 1, 1, 1], 'float32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([1, 2, 2, 1, 1, 1]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('6D int32 dtype', function () { + var a = tf.tensor6d([1, 2, 3, 4], [1, 2, 2, 1, 1, 1], 'int32'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual(a.shape); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('6D bool dtype', function () { + var a = tf.tensor6d([1, 2, 3, 4], [1, 2, 2, 1, 1, 1], 'bool'); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual(a.shape); + test_util_1.expectArraysEqual(b, [0, 0, 0, 0]); + }); + it('6D default dtype', function () { + var a = tf.tensor6d([1, 2, 3, 4], [1, 2, 2, 1, 1, 1]); + var b = tf.zerosLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual(a.shape); + test_util_1.expectArraysClose(b, [0, 0, 0, 0]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.zerosLike({}); }) + .toThrowError(/Argument 'x' passed to 'zerosLike' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var res = tf.zerosLike([[1, 2], [3, 4]]); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(res, [0, 0, 0, 0]); + }); +}); +jasmine_util_1.describeWithFlags('onesLike', test_util_1.ALL_ENVS, function () { + it('1D default dtype', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysClose(b, [1, 1, 1]); + }); + it('1D float32 dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'float32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysClose(b, [1, 1, 1]); + }); + it('1D int32 dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'int32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysEqual(b, [1, 1, 1]); + }); + it('1D bool dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'bool'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysEqual(b, [1, 1, 1]); + }); + it('2D default dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('2D float32 dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'float32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('2D int32 dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'int32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('2D bool dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'bool'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('3D default dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('3D float32 dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1], 'float32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('3D int32 dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1], 'int32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('3D bool dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1], 'bool'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('4D default dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1]); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('4D float32 dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1], 'float32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('4D int32 dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1], 'int32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('4D bool dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1], 'bool'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('4D default dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1]); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('5D float32 dtype', function () { + var a = tf.tensor5d([1, 2, 3, 4], [1, 2, 2, 1, 1], 'float32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([1, 2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('5D int32 dtype', function () { + var a = tf.tensor5d([1, 2, 3, 4], [1, 2, 2, 1, 1], 'int32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([1, 2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('5D bool dtype', function () { + var a = tf.tensor5d([1, 2, 3, 4], [1, 2, 2, 1, 1], 'bool'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([1, 2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('5D default dtype', function () { + var a = tf.tensor5d([1, 2, 3, 4], [1, 2, 2, 1, 1]); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([1, 2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('6D int32 dtype', function () { + var a = tf.tensor6d([1, 2, 3, 4], [1, 2, 2, 1, 1, 1], 'int32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual(a.shape); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('6D bool dtype', function () { + var a = tf.tensor6d([1, 2, 3, 4], [1, 2, 2, 1, 1, 1], 'bool'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual(a.shape); + test_util_1.expectArraysEqual(b, [1, 1, 1, 1]); + }); + it('6D default dtype', function () { + var a = tf.tensor6d([1, 2, 3, 4], [1, 2, 2, 1, 1, 1]); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual(a.shape); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('6D float32 dtype', function () { + var a = tf.tensor6d([1, 2, 3, 4], [1, 2, 2, 1, 1, 1], 'float32'); + var b = tf.onesLike(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual(a.shape); + test_util_1.expectArraysClose(b, [1, 1, 1, 1]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.onesLike({}); }) + .toThrowError(/Argument 'x' passed to 'onesLike' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var res = tf.onesLike([[1, 2], [3, 4]]); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(res, [1, 1, 1, 1]); + }); +}); +jasmine_util_1.describeWithFlags('rand', test_util_1.ALL_ENVS, function () { + it('should return a random 1D float32 array', function () { + var shape = [10]; + var result = tf.rand(shape, function () { return util.randUniform(0, 2); }); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 2); + result = tf.rand(shape, function () { return util.randUniform(0, 1.5); }); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 1.5); + }); + it('should return a random 1D int32 array', function () { + var shape = [10]; + var result = tf.rand(shape, function () { return util.randUniform(0, 2); }, 'int32'); + expect(result.dtype).toBe('int32'); + test_util_1.expectValuesInRange(result, 0, 2); + }); + it('should return a random 1D bool array', function () { + var shape = [10]; + var result = tf.rand(shape, function () { return util.randUniform(0, 1); }, 'bool'); + expect(result.dtype).toBe('bool'); + test_util_1.expectValuesInRange(result, 0, 1); + }); + it('should return a random 2D float32 array', function () { + var shape = [3, 4]; + var result = tf.rand(shape, function () { return util.randUniform(0, 2.5); }); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 2.5); + result = tf.rand(shape, function () { return util.randUniform(0, 1.5); }, 'float32'); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 1.5); + }); + it('should return a random 2D int32 array', function () { + var shape = [3, 4]; + var result = tf.rand(shape, function () { return util.randUniform(0, 2); }, 'int32'); + expect(result.dtype).toBe('int32'); + test_util_1.expectValuesInRange(result, 0, 2); + }); + it('should return a random 2D bool array', function () { + var shape = [3, 4]; + var result = tf.rand(shape, function () { return util.randUniform(0, 1); }, 'bool'); + expect(result.dtype).toBe('bool'); + test_util_1.expectValuesInRange(result, 0, 1); + }); + it('should return a random 3D float32 array', function () { + var shape = [3, 4, 5]; + var result = tf.rand(shape, function () { return util.randUniform(0, 2.5); }); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 2.5); + result = tf.rand(shape, function () { return util.randUniform(0, 1.5); }, 'float32'); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 1.5); + }); + it('should return a random 3D int32 array', function () { + var shape = [3, 4, 5]; + var result = tf.rand(shape, function () { return util.randUniform(0, 2); }, 'int32'); + expect(result.dtype).toBe('int32'); + test_util_1.expectValuesInRange(result, 0, 2); + }); + it('should return a random 3D bool array', function () { + var shape = [3, 4, 5]; + var result = tf.rand(shape, function () { return util.randUniform(0, 1); }, 'bool'); + expect(result.dtype).toBe('bool'); + test_util_1.expectValuesInRange(result, 0, 1); + }); + it('should return a random 4D float32 array', function () { + var shape = [3, 4, 5, 6]; + var result = tf.rand(shape, function () { return util.randUniform(0, 2.5); }); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 2.5); + result = tf.rand(shape, function () { return util.randUniform(0, 1.5); }); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 1.5); + }); + it('should return a random 4D int32 array', function () { + var shape = [3, 4, 5, 6]; + var result = tf.rand(shape, function () { return util.randUniform(0, 2); }, 'int32'); + expect(result.dtype).toBe('int32'); + test_util_1.expectValuesInRange(result, 0, 2); + }); + it('should return a random 4D bool array', function () { + var shape = [3, 4, 5, 6]; + var result = tf.rand(shape, function () { return util.randUniform(0, 1); }, 'bool'); + expect(result.dtype).toBe('bool'); + test_util_1.expectValuesInRange(result, 0, 1); + }); +}); +jasmine_util_1.describeWithFlags('eye', test_util_1.ALL_ENVS, function () { + it('1x1', function () { + test_util_1.expectArraysClose(tf.eye(1), tf.tensor2d([[1]])); + }); + it('2x2', function () { + test_util_1.expectArraysClose(tf.eye(2), tf.tensor2d([[1, 0], [0, 1]])); + }); + it('3x3', function () { + test_util_1.expectArraysClose(tf.eye(3), tf.tensor2d([[1, 0, 0], [0, 1, 0], [0, 0, 1]])); + }); + it('3x4', function () { + test_util_1.expectArraysClose(tf.eye(3, 4), tf.tensor2d([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0]])); + }); + it('4x3', function () { + test_util_1.expectArraysClose(tf.eye(4, 3), tf.tensor2d([[1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 0, 0]])); + }); + it('with 1D batchShape', function () { + test_util_1.expectArraysClose(tf.eye(2, 2, [3]), tf.tensor3d([[[1, 0], [0, 1]], [[1, 0], [0, 1]], [[1, 0], [0, 1]]])); + }); + it('with 2D batchShape', function () { + test_util_1.expectArraysClose(tf.eye(2, 2, [2, 3]), tf.tensor4d([ + [[[1, 0], [0, 1]], [[1, 0], [0, 1]], [[1, 0], [0, 1]]], + [[[1, 0], [0, 1]], [[1, 0], [0, 1]], [[1, 0], [0, 1]]] + ])); + }); + it('with 3D batchShape', function () { + test_util_1.expectArraysClose(tf.eye(2, 2, [2, 2, 3]), tf.tensor5d([ + [ + [[[1, 0], [0, 1]], [[1, 0], [0, 1]], [[1, 0], [0, 1]]], + [[[1, 0], [0, 1]], [[1, 0], [0, 1]], [[1, 0], [0, 1]]] + ], + [ + [[[1, 0], [0, 1]], [[1, 0], [0, 1]], [[1, 0], [0, 1]]], + [[[1, 0], [0, 1]], [[1, 0], [0, 1]], [[1, 0], [0, 1]]] + ] + ])); + }); + it('3x3, int32', function () { + test_util_1.expectArraysClose(tf.eye(3, 3, null, 'int32'), tf.tensor2d([[1, 0, 0], [0, 1, 0], [0, 0, 1]], [3, 3], 'int32')); + }); + it('3x3, bool', function () { + test_util_1.expectArraysClose(tf.eye(3, 3, null, 'bool'), tf.tensor2d([[1, 0, 0], [0, 1, 0], [0, 0, 1]], [3, 3], 'bool')); + }); +}); +jasmine_util_1.describeWithFlags('randomNormal', test_util_1.ALL_ENVS, function () { + var SEED = 2002; + var EPSILON = 0.05; + it('should return a float32 1D of random normal values', function () { + var SAMPLES = 10000; + var result = tf.randomNormal([SAMPLES], 0, 0.5, null, SEED); + expect(result.dtype).toBe('float32'); + expect(result.shape).toEqual([SAMPLES]); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 0.5, EPSILON); + result = tf.randomNormal([SAMPLES], 0, 1.5, 'float32', SEED); + expect(result.dtype).toBe('float32'); + expect(result.shape).toEqual([SAMPLES]); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 1.5, EPSILON); + }); + it('should return a int32 1D of random normal values', function () { + var SAMPLES = 10000; + var result = tf.randomNormal([SAMPLES], 0, 2, 'int32', SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual([SAMPLES]); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 2, EPSILON); + }); + it('should return a float32 2D of random normal values', function () { + var SAMPLES = 100; + var result = tf.randomNormal([SAMPLES, SAMPLES], 0, 2.5, null, SEED); + expect(result.dtype).toBe('float32'); + expect(result.shape).toEqual([SAMPLES, SAMPLES]); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 2.5, EPSILON); + result = tf.randomNormal([SAMPLES, SAMPLES], 0, 3.5, 'float32', SEED); + expect(result.dtype).toBe('float32'); + expect(result.shape).toEqual([SAMPLES, SAMPLES]); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 3.5, EPSILON); + }); + it('should return a int32 2D of random normal values', function () { + var SAMPLES = 100; + var result = tf.randomNormal([SAMPLES, SAMPLES], 0, 2, 'int32', SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual([SAMPLES, SAMPLES]); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 2, EPSILON); + }); + it('should return a float32 3D of random normal values', function () { + var SAMPLES_SHAPE = [20, 20, 20]; + var result = tf.randomNormal(SAMPLES_SHAPE, 0, 0.5, null, SEED); + expect(result.dtype).toBe('float32'); + expect(result.shape).toEqual(SAMPLES_SHAPE); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 0.5, EPSILON); + result = tf.randomNormal(SAMPLES_SHAPE, 0, 1.5, 'float32', SEED); + expect(result.dtype).toBe('float32'); + expect(result.shape).toEqual(SAMPLES_SHAPE); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 1.5, EPSILON); + }); + it('should return a int32 3D of random normal values', function () { + var SAMPLES_SHAPE = [20, 20, 20]; + var result = tf.randomNormal(SAMPLES_SHAPE, 0, 2, 'int32', SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual(SAMPLES_SHAPE); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 2, EPSILON); + }); + it('should return a float32 4D of random normal values', function () { + var SAMPLES_SHAPE = [10, 10, 10, 10]; + var result = tf.randomNormal(SAMPLES_SHAPE, 0, 0.5, null, SEED); + expect(result.dtype).toBe('float32'); + expect(result.shape).toEqual(SAMPLES_SHAPE); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 0.5, EPSILON); + result = tf.randomNormal(SAMPLES_SHAPE, 0, 1.5, 'float32', SEED); + expect(result.dtype).toBe('float32'); + expect(result.shape).toEqual(SAMPLES_SHAPE); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 1.5, EPSILON); + }); + it('should return a int32 4D of random normal values', function () { + var SAMPLES_SHAPE = [10, 10, 10, 10]; + var result = tf.randomNormal(SAMPLES_SHAPE, 0, 2, 'int32', SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual(SAMPLES_SHAPE); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 2, EPSILON); + }); + it('should return a int32 5D of random normal values', function () { + var SAMPLES_SHAPE = [10, 10, 10, 10, 10]; + var result = tf.randomNormal(SAMPLES_SHAPE, 0, 2, 'int32', SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual(SAMPLES_SHAPE); + rand_util_1.jarqueBeraNormalityTest(result); + rand_util_1.expectArrayInMeanStdRange(result, 0, 2, EPSILON); + }); +}); +jasmine_util_1.describeWithFlags('truncatedNormal', test_util_1.ALL_ENVS, function () { + var EPSILON = 0.60; + var SEED = 2002; + function assertTruncatedValues(array, mean, stdv) { + var bounds = mean + stdv * 2; + var values = array.dataSync(); + for (var i = 0; i < values.length; i++) { + expect(Math.abs(values[i])).toBeLessThanOrEqual(bounds); + } + } + it('should return a random 1D float32 array', function () { + var shape = [1000]; + var result = tf.truncatedNormal(shape, 0, 3.5, null, SEED); + expect(result.dtype).toBe('float32'); + assertTruncatedValues(result, 0, 3.5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 3.5, EPSILON); + result = tf.truncatedNormal(shape, 0, 4.5, 'float32', SEED); + expect(result.dtype).toBe('float32'); + assertTruncatedValues(result, 0, 4.5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 4.5, EPSILON); + }); + it('should return a randon 1D int32 array', function () { + var shape = [1000]; + var result = tf.truncatedNormal(shape, 0, 5, 'int32', SEED); + expect(result.dtype).toBe('int32'); + assertTruncatedValues(result, 0, 5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 5, EPSILON); + }); + it('should return a 2D float32 array', function () { + var shape = [50, 50]; + var result = tf.truncatedNormal(shape, 0, 3.5, null, SEED); + expect(result.dtype).toBe('float32'); + assertTruncatedValues(result, 0, 3.5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 3.5, EPSILON); + result = tf.truncatedNormal(shape, 0, 4.5, 'float32', SEED); + expect(result.dtype).toBe('float32'); + assertTruncatedValues(result, 0, 4.5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 4.5, EPSILON); + }); + it('should return a 2D int32 array', function () { + var shape = [50, 50]; + var result = tf.truncatedNormal(shape, 0, 5, 'int32', SEED); + expect(result.dtype).toBe('int32'); + assertTruncatedValues(result, 0, 5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 5, EPSILON); + }); + it('should return a 3D float32 array', function () { + var shape = [10, 10, 10]; + var result = tf.truncatedNormal(shape, 0, 3.5, null, SEED); + expect(result.dtype).toBe('float32'); + assertTruncatedValues(result, 0, 3.5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 3.5, EPSILON); + result = tf.truncatedNormal(shape, 0, 4.5, 'float32', SEED); + expect(result.dtype).toBe('float32'); + assertTruncatedValues(result, 0, 4.5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 4.5, EPSILON); + }); + it('should return a 3D int32 array', function () { + var shape = [10, 10, 10]; + var result = tf.truncatedNormal(shape, 0, 5, 'int32', SEED); + expect(result.dtype).toBe('int32'); + assertTruncatedValues(result, 0, 5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 5, EPSILON); + }); + it('should return a 4D float32 array', function () { + var shape = [5, 5, 5, 5]; + var result = tf.truncatedNormal(shape, 0, 3.5, null, SEED); + expect(result.dtype).toBe('float32'); + assertTruncatedValues(result, 0, 3.5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 3.5, EPSILON); + result = tf.truncatedNormal(shape, 0, 4.5, 'float32', SEED); + expect(result.dtype).toBe('float32'); + assertTruncatedValues(result, 0, 4.5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 4.5, EPSILON); + }); + it('should return a 4D int32 array', function () { + var shape = [5, 5, 5, 5]; + var result = tf.truncatedNormal(shape, 0, 5, 'int32', SEED); + expect(result.dtype).toBe('int32'); + assertTruncatedValues(result, 0, 5); + rand_util_1.expectArrayInMeanStdRange(result, 0, 5, EPSILON); + }); +}); +jasmine_util_1.describeWithFlags('randomUniform', test_util_1.ALL_ENVS, function () { + it('should return a random 1D float32 array', function () { + var shape = [10]; + var result = tf.randomUniform(shape, 0, 2.5); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 2.5); + result = tf.randomUniform(shape, 0, 1.5, 'float32'); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 1.5); + }); + it('should return a random 1D int32 array', function () { + var shape = [10]; + var result = tf.randomUniform(shape, 0, 2, 'int32'); + expect(result.dtype).toBe('int32'); + test_util_1.expectValuesInRange(result, 0, 2); + }); + it('should return a random 1D bool array', function () { + var shape = [10]; + var result = tf.randomUniform(shape, 0, 1, 'bool'); + expect(result.dtype).toBe('bool'); + test_util_1.expectValuesInRange(result, 0, 1); + }); + it('should return a random 2D float32 array', function () { + var shape = [3, 4]; + var result = tf.randomUniform(shape, 0, 2.5); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 2.5); + result = tf.randomUniform(shape, 0, 1.5, 'float32'); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 1.5); + }); + it('should return a random 2D int32 array', function () { + var shape = [3, 4]; + var result = tf.randomUniform(shape, 0, 2, 'int32'); + expect(result.dtype).toBe('int32'); + test_util_1.expectValuesInRange(result, 0, 2); + }); + it('should return a random 2D bool array', function () { + var shape = [3, 4]; + var result = tf.randomUniform(shape, 0, 1, 'bool'); + expect(result.dtype).toBe('bool'); + test_util_1.expectValuesInRange(result, 0, 1); + }); + it('should return a random 3D float32 array', function () { + var shape = [3, 4, 5]; + var result = tf.randomUniform(shape, 0, 2.5); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 2.5); + result = tf.randomUniform(shape, 0, 1.5, 'float32'); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 1.5); + }); + it('should return a random 3D int32 array', function () { + var shape = [3, 4, 5]; + var result = tf.randomUniform(shape, 0, 2, 'int32'); + expect(result.dtype).toBe('int32'); + test_util_1.expectValuesInRange(result, 0, 2); + }); + it('should return a random 3D bool array', function () { + var shape = [3, 4, 5]; + var result = tf.randomUniform(shape, 0, 1, 'bool'); + expect(result.dtype).toBe('bool'); + test_util_1.expectValuesInRange(result, 0, 1); + }); + it('should return a random 4D float32 array', function () { + var shape = [3, 4, 5, 6]; + var result = tf.randomUniform(shape, 0, 2.5); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 2.5); + result = tf.randomUniform(shape, 0, 1.5, 'float32'); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 1.5); + }); + it('should return a random 4D int32 array', function () { + var shape = [3, 4, 5, 6]; + var result = tf.randomUniform(shape, 0, 2, 'int32'); + expect(result.dtype).toBe('int32'); + test_util_1.expectValuesInRange(result, 0, 2); + }); + it('should return a random 4D bool array', function () { + var shape = [3, 4, 5, 6]; + var result = tf.randomUniform(shape, 0, 1, 'bool'); + expect(result.dtype).toBe('bool'); + test_util_1.expectValuesInRange(result, 0, 1); + }); + it('should return a random 5D float32 array', function () { + var shape = [2, 3, 4, 5, 6]; + var result = tf.randomUniform(shape, 0, 2.5); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 2.5); + result = tf.randomUniform(shape, 0, 1.5, 'float32'); + expect(result.dtype).toBe('float32'); + test_util_1.expectValuesInRange(result, 0, 1.5); + }); + it('should return a random 5D int32 array', function () { + var shape = [2, 3, 4, 5, 6]; + var result = tf.randomUniform(shape, 0, 2, 'int32'); + expect(result.dtype).toBe('int32'); + test_util_1.expectValuesInRange(result, 0, 2); + }); + it('should return a random 5D bool array', function () { + var shape = [2, 3, 4, 5, 6]; + var result = tf.randomUniform(shape, 0, 1, 'bool'); + expect(result.dtype).toBe('bool'); + test_util_1.expectValuesInRange(result, 0, 1); + }); +}); +var MockContext = (function () { + function MockContext() { + } + MockContext.prototype.getImageData = function (x, y, width, height) { + var data = new Uint8ClampedArray(width * height * 4); + for (var i = 0; i < data.length; ++i) { + data[i] = i + 1; + } + return { data: data }; + }; + return MockContext; +}()); +var MockCanvas = (function () { + function MockCanvas(width, height) { + this.width = width; + this.height = height; + } + MockCanvas.prototype.getContext = function (type) { + return new MockContext(); + }; + return MockCanvas; +}()); +jasmine_util_1.describeWithFlags('fromPixels, mock canvas', test_util_1.NODE_ENVS, function () { + it('accepts a canvas-like element', function () { + var c = new MockCanvas(2, 2); + var t = tf.fromPixels(c); + expect(t.dtype).toBe('int32'); + expect(t.shape).toEqual([2, 2, 3]); + tf.test_util.expectArraysEqual(t, [1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15]); + }); + it('accepts a canvas-like element, numChannels=4', function () { + var c = new MockCanvas(2, 2); + var t = tf.fromPixels(c, 4); + expect(t.dtype).toBe('int32'); + expect(t.shape).toEqual([2, 2, 4]); + tf.test_util.expectArraysEqual(t, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + }); + it('errors when passed a non-canvas object', function () { + expect(function () { return tf.fromPixels(5); }).toThrowError(); + }); +}); +jasmine_util_1.describeWithFlags('fromPixels', test_util_1.BROWSER_ENVS, function () { + it('ImageData 1x1x3', function () { + var pixels = new ImageData(1, 1); + pixels.data[0] = 0; + pixels.data[1] = 80; + pixels.data[2] = 160; + pixels.data[3] = 240; + var array = tf.fromPixels(pixels, 3); + test_util_1.expectArraysEqual(array, [0, 80, 160]); + }); + it('ImageData 1x1x4', function () { + var pixels = new ImageData(1, 1); + pixels.data[0] = 0; + pixels.data[1] = 80; + pixels.data[2] = 160; + pixels.data[3] = 240; + var array = tf.fromPixels(pixels, 4); + test_util_1.expectArraysEqual(array, [0, 80, 160, 240]); + }); + it('ImageData 2x2x3', function () { + var pixels = new ImageData(2, 2); + for (var i = 0; i < 8; i++) { + pixels.data[i] = i * 2; + } + for (var i = 8; i < 16; i++) { + pixels.data[i] = i * 2; + } + var array = tf.fromPixels(pixels, 3); + test_util_1.expectArraysEqual(array, [0, 2, 4, 8, 10, 12, 16, 18, 20, 24, 26, 28]); + }); + it('ImageData 2x2x4', function () { + var pixels = new ImageData(2, 2); + for (var i = 0; i < 8; i++) { + pixels.data[i] = i * 2; + } + for (var i = 8; i < 16; i++) { + pixels.data[i] = i * 2; + } + var array = tf.fromPixels(pixels, 4); + test_util_1.expectArraysClose(array, new Int32Array([0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30])); + }); + it('fromPixels, 3 channels', function () { + var pixels = new ImageData(1, 2); + pixels.data[0] = 2; + pixels.data[1] = 3; + pixels.data[2] = 4; + pixels.data[3] = 255; + pixels.data[4] = 5; + pixels.data[5] = 6; + pixels.data[6] = 7; + pixels.data[7] = 255; + var res = tf.fromPixels(pixels, 3); + expect(res.shape).toEqual([2, 1, 3]); + expect(res.dtype).toBe('int32'); + test_util_1.expectArraysClose(res, [2, 3, 4, 5, 6, 7]); + }); + it('fromPixels, reshape, then do tf.add()', function () { + var pixels = new ImageData(1, 1); + pixels.data[0] = 2; + pixels.data[1] = 3; + pixels.data[2] = 4; + pixels.data[3] = 255; + var a = tf.fromPixels(pixels, 3).reshape([1, 1, 1, 3]); + var res = a.add(tf.scalar(2, 'int32')); + expect(res.shape).toEqual([1, 1, 1, 3]); + expect(res.dtype).toBe('int32'); + test_util_1.expectArraysClose(res, [4, 5, 6]); + }); + it('fromPixels + fromPixels', function () { + var pixelsA = new ImageData(1, 1); + pixelsA.data[0] = 255; + pixelsA.data[1] = 3; + pixelsA.data[2] = 4; + pixelsA.data[3] = 255; + var pixelsB = new ImageData(1, 1); + pixelsB.data[0] = 5; + pixelsB.data[1] = 6; + pixelsB.data[2] = 7; + pixelsB.data[3] = 255; + var a = tf.fromPixels(pixelsA, 3).toFloat(); + var b = tf.fromPixels(pixelsB, 3).toFloat(); + var res = a.add(b); + expect(res.shape).toEqual([1, 1, 3]); + expect(res.dtype).toBe('float32'); + test_util_1.expectArraysClose(res, [260, 9, 11]); + }); + it('throws when passed a primitive number', function () { + expect(function () { return tf.fromPixels(3); }) + .toThrowError(/pixels passed to tf.fromPixels\(\) must be either/); + }); + it('throws when passed a string', function () { + expect(function () { return tf.fromPixels('test'); }) + .toThrowError(/pixels passed to tf.fromPixels\(\) must be either/); + }); +}); +jasmine_util_1.describeWithFlags('toPixels no canvas', test_util_1.ALL_ENVS, function () { + it('draws a rank-2 float32 tensor', function (done) { + var x = tf.tensor2d([.1, .2], [2, 1], 'float32'); + tf.toPixels(x).then(function (data) { + var expected = new Uint8ClampedArray([ + Math.round(.1 * 255), Math.round(.1 * 255), Math.round(.1 * 255), 255, + Math.round(.2 * 255), Math.round(.2 * 255), Math.round(.2 * 255), 255 + ]); + expect(data).toEqual(expected); + done(); + }); + }); + it('draws a rank-2 int32 tensor', function (done) { + var x = tf.tensor2d([10, 20], [2, 1], 'int32'); + tf.toPixels(x).then(function (data) { + var expected = new Uint8ClampedArray([10, 10, 10, 255, 20, 20, 20, 255]); + expect(data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 float32 tensor, 1 channel', function (done) { + var x = tf.tensor3d([.1, .2], [2, 1, 1], 'float32'); + tf.toPixels(x).then(function (data) { + var expected = new Uint8ClampedArray([ + Math.round(.1 * 255), Math.round(.1 * 255), Math.round(.1 * 255), 255, + Math.round(.2 * 255), Math.round(.2 * 255), Math.round(.2 * 255), 255 + ]); + expect(data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 int32 tensor, 1 channel', function (done) { + var x = tf.tensor3d([10, 20], [2, 1, 1], 'int32'); + tf.toPixels(x).then(function (data) { + var expected = new Uint8ClampedArray([10, 10, 10, 255, 20, 20, 20, 255]); + expect(data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 float32 tensor, 3 channel', function (done) { + var x = tf.tensor3d([.05, .1, .15, .2, .25, .3], [2, 1, 3], 'float32'); + tf.toPixels(x).then(function (data) { + var expected = new Uint8ClampedArray([ + Math.round(.05 * 255), Math.round(.1 * 255), Math.round(.15 * 255), 255, + Math.round(.2 * 255), Math.round(.25 * 255), Math.round(.30 * 255), 255 + ]); + expect(data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 int32 tensor, 3 channel', function (done) { + var x = tf.tensor3d([10, 20, 30, 40, 50, 60], [2, 1, 3], 'int32'); + tf.toPixels(x).then(function (data) { + var expected = new Uint8ClampedArray([10, 20, 30, 255, 40, 50, 60, 255]); + expect(data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 float32 tensor, 4 channel', function (done) { + var x = tf.tensor3d([.05, .1, .15, .2, .25, .3, .35, .4], [2, 1, 4], 'float32'); + tf.toPixels(x).then(function (data) { + var expected = new Uint8ClampedArray([ + Math.round(.05 * 255), Math.round(.1 * 255), Math.round(.15 * 255), + Math.round(.20 * 255), Math.round(.25 * 255), Math.round(.30 * 255), + Math.round(.35 * 255), Math.round(.4 * 255) + ]); + expect(data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 int32 tensor, 4 channel', function (done) { + var x = tf.tensor3d([10, 20, 30, 40, 50, 60, 70, 80], [2, 1, 4], 'int32'); + tf.toPixels(x).then(function (data) { + var expected = new Uint8ClampedArray([10, 20, 30, 40, 50, 60, 70, 80]); + expect(data).toEqual(expected); + done(); + }); + }); + it('throws for scalars', function (done) { + test_util_1.expectPromiseToFail(function () { return tf.toPixels(tf.scalar(1)); }, done); + }); + it('throws for rank-1 tensors', function (done) { + test_util_1.expectPromiseToFail(function () { return tf.toPixels(tf.tensor1d([1])); }, done); + }); + it('throws for rank-4 tensors', function (done) { + test_util_1.expectPromiseToFail(function () { return tf.toPixels(tf.tensor4d([1], [1, 1, 1, 1])); }, done); + }); + it('throws for bool dtype', function (done) { + test_util_1.expectPromiseToFail(function () { return tf.toPixels(tf.tensor2d([1], [1, 1], 'bool')); }, done); + }); + it('throws for rank-3 depth = 2', function (done) { + test_util_1.expectPromiseToFail(function () { return tf.toPixels(tf.tensor3d([1, 2], [1, 1, 2])); }, done); + }); + it('throws for rank-3 depth = 5', function (done) { + test_util_1.expectPromiseToFail(function () { return tf.toPixels(tf.tensor3d([1, 2, 3, 4, 5], [1, 1, 5])); }, done); + }); + it('throws for float32 tensor with values not in [0 - 1]', function (done) { + test_util_1.expectPromiseToFail(function () { return tf.toPixels(tf.tensor2d([-1, .5], [1, 2])); }, done); + }); + it('throws for int32 tensor with values not in [0 - 255]', function (done) { + test_util_1.expectPromiseToFail(function () { return tf.toPixels(tf.tensor2d([-1, 100], [1, 2], 'int32')); }, done); + }); + it('throws when passed a non-tensor', function (done) { + test_util_1.expectPromiseToFail(function () { return tf.toPixels({}); }, done); + }); + it('accepts a tensor-like object', function () { return __awaiter(_this, void 0, void 0, function () { + var x, data, expected; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + x = [[10], [20]]; + return [4, tf.toPixels(x)]; + case 1: + data = _a.sent(); + expected = new Uint8ClampedArray([10, 10, 10, 255, 20, 20, 20, 255]); + expect(data).toEqual(expected); + return [2]; + } + }); + }); }); +}); +jasmine_util_1.describeWithFlags('toPixels', test_util_1.WEBGL_ENVS, function () { + it('draws a rank-2 float32 tensor, canvas', function (done) { + var x = tf.tensor2d([.1, .2], [2, 1], 'float32'); + var canvas = document.createElement('canvas'); + tf.toPixels(x, canvas).then(function (data) { + var expected = new Uint8ClampedArray([ + Math.round(.1 * 255), Math.round(.1 * 255), Math.round(.1 * 255), 255, + Math.round(.2 * 255), Math.round(.2 * 255), Math.round(.2 * 255), 255 + ]); + expect(data).toEqual(expected); + var ctx = canvas.getContext('2d'); + var imgData = ctx.getImageData(0, 0, 1, 2); + expect(imgData.data).toEqual(expected); + done(); + }); + }); + it('draws a rank-2 int32 tensor, canvas', function (done) { + var x = tf.tensor2d([10, 20], [2, 1], 'int32'); + var canvas = document.createElement('canvas'); + tf.toPixels(x, canvas).then(function (data) { + var expected = new Uint8ClampedArray([10, 10, 10, 255, 20, 20, 20, 255]); + expect(data).toEqual(expected); + var ctx = canvas.getContext('2d'); + var imgData = ctx.getImageData(0, 0, 1, 2); + expect(imgData.data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 float32 tensor, 1 channel, canvas', function (done) { + var x = tf.tensor3d([.1, .2], [2, 1, 1], 'float32'); + var canvas = document.createElement('canvas'); + tf.toPixels(x, canvas).then(function (data) { + var expected = new Uint8ClampedArray([ + Math.round(.1 * 255), Math.round(.1 * 255), Math.round(.1 * 255), 255, + Math.round(.2 * 255), Math.round(.2 * 255), Math.round(.2 * 255), 255 + ]); + expect(data).toEqual(expected); + var ctx = canvas.getContext('2d'); + var imgData = ctx.getImageData(0, 0, 1, 2); + expect(imgData.data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 int32 tensor, 1 channel, canvas', function (done) { + var x = tf.tensor3d([10, 20], [2, 1, 1], 'int32'); + var canvas = document.createElement('canvas'); + tf.toPixels(x, canvas).then(function (data) { + var expected = new Uint8ClampedArray([10, 10, 10, 255, 20, 20, 20, 255]); + expect(data).toEqual(expected); + var ctx = canvas.getContext('2d'); + var imgData = ctx.getImageData(0, 0, 1, 2); + expect(imgData.data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 float32 tensor, 3 channel, canvas', function (done) { + var x = tf.tensor3d([.05, .1, .15, .20, .25, .30], [2, 1, 3], 'float32'); + var canvas = document.createElement('canvas'); + tf.toPixels(x, canvas).then(function (data) { + var expected = new Uint8ClampedArray([ + Math.round(.05 * 255), Math.round(.1 * 255), Math.round(.15 * 255), 255, + Math.round(.2 * 255), Math.round(.25 * 255), Math.round(.3 * 255), 255 + ]); + expect(data).toEqual(expected); + var ctx = canvas.getContext('2d'); + var imgData = ctx.getImageData(0, 0, 1, 2); + expect(imgData.data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 int32 tensor, 3 channel, canvas', function (done) { + var x = tf.tensor3d([10, 20, 30, 40, 50, 60], [2, 1, 3], 'int32'); + var canvas = document.createElement('canvas'); + tf.toPixels(x, canvas).then(function (data) { + var expected = new Uint8ClampedArray([10, 20, 30, 255, 40, 50, 60, 255]); + expect(data).toEqual(expected); + var ctx = canvas.getContext('2d'); + var imgData = ctx.getImageData(0, 0, 1, 2); + expect(imgData.data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 float32 tensor, 4 channel, canvas', function (done) { + var x = tf.tensor3d([.05, .1, .15, 1, .20, .25, .30, 1], [2, 1, 4], 'float32'); + var canvas = document.createElement('canvas'); + tf.toPixels(x, canvas).then(function (data) { + var expected = new Uint8ClampedArray([ + Math.round(.05 * 255), Math.round(.1 * 255), Math.round(.15 * 255), 255, + Math.round(.20 * 255), Math.round(.25 * 255), Math.round(.30 * 255), 255 + ]); + expect(data).toEqual(expected); + var ctx = canvas.getContext('2d'); + var imgData = ctx.getImageData(0, 0, 1, 2); + expect(imgData.data).toEqual(expected); + done(); + }); + }); + it('draws a rank-3 int32 tensor, 4 channel, canvas', function (done) { + var x = tf.tensor3d([10, 20, 30, 255, 50, 60, 70, 255], [2, 1, 4], 'int32'); + var canvas = document.createElement('canvas'); + tf.toPixels(x, canvas).then(function (data) { + var expected = new Uint8ClampedArray([10, 20, 30, 255, 50, 60, 70, 255]); + expect(data).toEqual(expected); + var ctx = canvas.getContext('2d'); + var imgData = ctx.getImageData(0, 0, 1, 2); + expect(imgData.data).toEqual(expected); + done(); + }); + }); + it('accepts a tensor-like object', function () { return __awaiter(_this, void 0, void 0, function () { + var x, canvas, data, expected, ctx, imgData; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + x = [[127], [100]]; + canvas = document.createElement('canvas'); + return [4, tf.toPixels(x, canvas)]; + case 1: + data = _a.sent(); + expected = new Uint8ClampedArray([127, 127, 127, 255, 100, 100, 100, 255]); + expect(data).toEqual(expected); + ctx = canvas.getContext('2d'); + imgData = ctx.getImageData(0, 0, 1, 2); + expect(imgData.data).toEqual(expected); + return [2]; + } + }); + }); }); +}); +jasmine_util_1.describeWithFlags('clone', test_util_1.ALL_ENVS, function () { + it('1D default dtype', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.clone(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysClose(b, [1, 2, 3]); + }); + it('1D float32 dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'float32'); + var b = tf.clone(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysClose(b, [1, 2, 3]); + }); + it('1D int32 dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'int32'); + var b = tf.clone(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysEqual(b, [1, 2, 3]); + }); + it('1D bool dtype', function () { + var a = tf.tensor1d([1, 1, 0], 'bool'); + var b = tf.clone(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([3]); + test_util_1.expectArraysEqual(b, [1, 1, 0]); + }); + it('2D default dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var b = tf.clone(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(b, [1, 2, 3, 4]); + }); + it('2D float32 dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'float32'); + var b = tf.clone(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(b, [1, 2, 3, 4]); + }); + it('2D int32 dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'int32'); + var b = tf.clone(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(b, [1, 2, 3, 4]); + }); + it('2D bool dtype', function () { + var a = tf.tensor2d([1, 1, 1, 0], [2, 2], 'bool'); + var b = tf.clone(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 0]); + }); + it('3D default dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var b = tf.clone(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(b, [1, 2, 3, 4]); + }); + it('3D float32 dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1], 'float32'); + var b = tf.clone(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(b, [1, 2, 3, 4]); + }); + it('3D int32 dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1], 'int32'); + var b = tf.clone(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysEqual(b, [1, 2, 3, 4]); + }); + it('3D bool dtype', function () { + var a = tf.tensor3d([1, 1, 1, 0], [2, 2, 1], 'bool'); + var b = tf.clone(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 0]); + }); + it('4D default dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1]); + var b = tf.clone(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [1, 2, 3, 4]); + }); + it('4D float32 dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1], 'float32'); + var b = tf.clone(a); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(b, [1, 2, 3, 4]); + }); + it('4D int32 dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1], 'int32'); + var b = tf.clone(a); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [1, 2, 3, 4]); + }); + it('4D bool dtype', function () { + var a = tf.tensor4d([1, 1, 1, 0], [2, 2, 1, 1], 'bool'); + var b = tf.clone(a); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(b, [1, 1, 1, 0]); + }); + it('gradient: 1D', function () { + var a = tf.tensor1d([1, 2, 3]); + var dy = tf.tensor1d([4, 5, 6]); + var da = tf.grad(function (x) { return tf.clone(x); })(a, dy); + expect(da.dtype).toBe('float32'); + expect(da.shape).toEqual([3]); + test_util_1.expectArraysClose(da, [4, 5, 6]); + }); + it('gradient: 2D int32', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'int32'); + var dy = tf.tensor2d([5, 6, 7, 8], [2, 2], 'float32'); + var da = tf.grad(function (x) { return tf.clone(x); })(a, dy); + expect(da.dtype).toBe('float32'); + expect(da.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(da, [5, 6, 7, 8]); + }); + it('gradient: 4D bool', function () { + var a = tf.tensor4d([1, 1, 1, 0], [2, 2, 1, 1], 'bool'); + var dy = tf.tensor4d([5, 6, 7, 8], [2, 2, 1, 1], 'float32'); + var da = tf.grad(function (x) { return tf.clone(x); })(a, dy); + expect(da.dtype).toBe('float32'); + expect(da.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(da, [5, 6, 7, 8]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.clone({}); }) + .toThrowError(/Argument 'x' passed to 'clone' must be a Tensor/); + }); +}); +jasmine_util_1.describeWithFlags('tile', test_util_1.ALL_ENVS, function () { + it('1D (tile)', function () { + var t = tf.tensor1d([1, 2, 3]); + var t2 = tf.tile(t, [2]); + expect(t2.shape).toEqual([6]); + test_util_1.expectArraysClose(t2, [1, 2, 3, 1, 2, 3]); + }); + it('2D (tile)', function () { + var t = tf.tensor2d([1, 11, 2, 22], [2, 2]); + var t2 = tf.tile(t, [1, 2]); + expect(t2.shape).toEqual([2, 4]); + test_util_1.expectArraysClose(t2, [1, 11, 1, 11, 2, 22, 2, 22]); + t2 = tf.tile(t, [2, 1]); + expect(t2.shape).toEqual([4, 2]); + test_util_1.expectArraysClose(t2, [1, 11, 2, 22, 1, 11, 2, 22]); + t2 = tf.tile(t, [2, 2]); + expect(t2.shape).toEqual([4, 4]); + test_util_1.expectArraysClose(t2, [1, 11, 1, 11, 2, 22, 2, 22, 1, 11, 1, 11, 2, 22, 2, 22]); + }); + it('3D (tile)', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var t2 = tf.tile(t, [1, 2, 1]); + expect(t2.shape).toEqual([2, 4, 2]); + test_util_1.expectArraysClose(t2, [1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8, 5, 6, 7, 8]); + }); + it('4D (tile)', function () { + var t = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8], [1, 2, 2, 2]); + var t2 = tf.tile(t, [1, 2, 1, 1]); + expect(t2.shape).toEqual([1, 4, 2, 2]); + test_util_1.expectArraysClose(t2, [1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8]); + }); + it('5D (tile)', function () { + var t = tf.tensor5d([1, 2, 3, 4, 5, 6, 7, 8], [1, 1, 2, 2, 2]); + var t2 = tf.tile(t, [1, 2, 1, 1, 1]); + expect(t2.shape).toEqual([1, 2, 2, 2, 2]); + test_util_1.expectArraysClose(t2, [1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8]); + }); + it('propagates NaNs', function () { + var t = tf.tensor1d([1, 2, NaN]); + var t2 = tf.tile(t, [2]); + expect(t2.shape).toEqual([6]); + test_util_1.expectArraysClose(t2, [1, 2, NaN, 1, 2, NaN]); + }); + it('1D bool (tile)', function () { + var t = tf.tensor1d([true, false, true], 'bool'); + var t2 = tf.tile(t, [2]); + expect(t2.shape).toEqual([6]); + expect(t2.dtype).toBe('bool'); + test_util_1.expectArraysEqual(t2, [1, 0, 1, 1, 0, 1]); + }); + it('2D bool (tile)', function () { + var t = tf.tensor2d([true, false, true, true], [2, 2], 'bool'); + var t2 = tf.tile(t, [1, 2]); + expect(t2.shape).toEqual([2, 4]); + expect(t2.dtype).toBe('bool'); + test_util_1.expectArraysEqual(t2, [1, 0, 1, 0, 1, 1, 1, 1]); + t2 = tf.tile(t, [2, 1]); + expect(t2.shape).toEqual([4, 2]); + expect(t2.dtype).toBe('bool'); + test_util_1.expectArraysEqual(t2, [1, 0, 1, 1, 1, 0, 1, 1]); + t2 = tf.tile(t, [2, 2]); + expect(t2.shape).toEqual([4, 4]); + expect(t2.dtype).toBe('bool'); + test_util_1.expectArraysEqual(t2, [1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1]); + }); + it('3D bool (tile)', function () { + var t = tf.tensor3d([true, false, true, false, true, false, true, false], [2, 2, 2], 'bool'); + var t2 = tf.tile(t, [1, 2, 1]); + expect(t2.shape).toEqual([2, 4, 2]); + expect(t2.dtype).toBe('bool'); + test_util_1.expectArraysEqual(t2, [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]); + }); + it('1D int32 (tile)', function () { + var t = tf.tensor1d([1, 2, 5], 'int32'); + var t2 = tf.tile(t, [2]); + expect(t2.shape).toEqual([6]); + expect(t2.dtype).toBe('int32'); + test_util_1.expectArraysEqual(t2, [1, 2, 5, 1, 2, 5]); + }); + it('2D int32 (tile)', function () { + var t = tf.tensor2d([1, 2, 3, 4], [2, 2], 'int32'); + var t2 = tf.tile(t, [1, 2]); + expect(t2.shape).toEqual([2, 4]); + expect(t2.dtype).toBe('int32'); + test_util_1.expectArraysEqual(t2, [1, 2, 1, 2, 3, 4, 3, 4]); + t2 = tf.tile(t, [2, 1]); + expect(t2.shape).toEqual([4, 2]); + expect(t2.dtype).toBe('int32'); + test_util_1.expectArraysEqual(t2, [1, 2, 3, 4, 1, 2, 3, 4]); + t2 = tf.tile(t, [2, 2]); + expect(t2.shape).toEqual([4, 4]); + expect(t2.dtype).toBe('int32'); + test_util_1.expectArraysEqual(t2, [1, 2, 1, 2, 3, 4, 3, 4, 1, 2, 1, 2, 3, 4, 3, 4]); + }); + it('3D int32 (tile)', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2], 'int32'); + var t2 = tf.tile(t, [1, 2, 1]); + expect(t2.shape).toEqual([2, 4, 2]); + expect(t2.dtype).toBe('int32'); + test_util_1.expectArraysEqual(t2, [1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8, 5, 6, 7, 8]); + }); + it('1D (tile) gradient', function () { + var x = tf.tensor1d([1, 2, 3]); + var dy = tf.tensor1d([0.1, 0.2, 0.3, 1, 2, 3, 10, 20, 30]); + var gradients = tf.grad(function (x) { return tf.tile(x, [3]); })(x, dy); + test_util_1.expectArraysClose(gradients, tf.tensor1d([11.1, 22.2, 33.3])); + }); + it('2D (tile) gradient', function () { + var x = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + var dy = tf.tensor2d([[1, 2, 10, 20], [3, 4, 30, 40]], [2, 4]); + var gradients = tf.grad(function (x) { return tf.tile(x, [1, 2]); })(x, dy); + test_util_1.expectArraysClose(gradients, tf.tensor2d([[11, 22], [33, 44]], [2, 2])); + }); + it('3D (tile) gradient', function () { + var x = tf.tensor3d([[[1], [2]], [[3], [4]]], [2, 2, 1]); + var dy = tf.tensor3d([[[1, 10], [2, 20]], [[3, 30], [4, 40]]], [2, 2, 2]); + var gradients = tf.grad(function (x) { return tf.tile(x, [1, 1, 2]); })(x, dy); + test_util_1.expectArraysClose(gradients, tf.tensor3d([[[11], [22]], [[33], [44]]], [2, 2, 1])); + }); + it('4D (tile) gradient', function () { + var x = tf.tensor4d([[[[1]], [[2]]], [[[3]], [[4]]]], [2, 2, 1, 1]); + var dy = tf.tensor4d([ + [[[.01, .1], [1, 10]], [[.02, .2], [2, 20]]], + [[[.03, .3], [3, 30]], [[.04, .4], [4, 40]]] + ], [2, 2, 2, 2]); + var gradients = tf.grad(function (x) { return tf.tile(x, [1, 1, 2, 2]); })(x, dy); + test_util_1.expectArraysClose(gradients, tf.tensor4d([[[[11.11]], [[22.22]]], [[[33.33]], [[44.44]]]], [2, 2, 1, 1])); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.tile({}, [1]); }) + .toThrowError(/Argument 'x' passed to 'tile' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var res = tf.tile([1, 2, 3], [2]); + expect(res.shape).toEqual([6]); + test_util_1.expectArraysClose(res, [1, 2, 3, 1, 2, 3]); + }); +}); +jasmine_util_1.describeWithFlags('gather', test_util_1.ALL_ENVS, function () { + it('1D (gather)', function () { + var t = tf.tensor1d([1, 2, 3]); + var t2 = tf.gather(t, tf.tensor1d([0, 2, 0, 1], 'int32'), 0); + expect(t2.shape).toEqual([4]); + test_util_1.expectArraysClose(t2, [1, 3, 1, 2]); + }); + it('2D (gather)', function () { + var t = tf.tensor2d([1, 11, 2, 22], [2, 2]); + var t2 = tf.gather(t, tf.tensor1d([1, 0, 0, 1], 'int32'), 0); + expect(t2.shape).toEqual([4, 2]); + test_util_1.expectArraysClose(t2, [2, 22, 1, 11, 1, 11, 2, 22]); + t2 = tf.gather(t, tf.tensor1d([1, 0, 0, 1], 'int32'), 1); + expect(t2.shape).toEqual([2, 4]); + test_util_1.expectArraysClose(t2, [11, 1, 1, 11, 22, 2, 2, 22]); + }); + it('3D (gather)', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var t2 = tf.gather(t, tf.tensor1d([1, 0, 0, 1], 'int32'), 2); + expect(t2.shape).toEqual([2, 2, 4]); + test_util_1.expectArraysClose(t2, [2, 1, 1, 2, 4, 3, 3, 4, 6, 5, 5, 6, 8, 7, 7, 8]); + }); + it('bool (gather)', function () { + var t = tf.tensor1d([true, false, true], 'bool'); + var t2 = tf.gather(t, tf.tensor1d([0, 2, 0, 1], 'int32'), 0); + expect(t2.shape).toEqual([4]); + expect(t2.dtype).toBe('bool'); + expect(t2.dataSync()).toEqual(new Uint8Array([1, 1, 1, 0])); + }); + it('int32 (gather)', function () { + var t = tf.tensor1d([1, 2, 5], 'int32'); + var t2 = tf.gather(t, tf.tensor1d([0, 2, 0, 1], 'int32'), 0); + expect(t2.shape).toEqual([4]); + expect(t2.dtype).toBe('int32'); + expect(t2.dataSync()).toEqual(new Int32Array([1, 5, 1, 2])); + }); + it('propagates NaNs', function () { + var t = tf.tensor1d([1, 2, NaN]); + var t2 = tf.gather(t, tf.tensor1d([0, 2, 0, 1], 'int32'), 0); + expect(t2.shape).toEqual([4]); + test_util_1.expectArraysClose(t2, [1, NaN, 1, 2]); + }); + it('chaining, axis=1', function () { + var x = tf.zeros([2, 4, 6]); + var indices = tf.range(0, 6, 2, 'int32'); + var axis = 2; + expect(x.gather(indices, axis).shape).toEqual([2, 4, 3]); + }); + it('indices not int32 throws error', function () { + var x = tf.zeros([2, 4, 6]); + var indices = tf.range(0, 6, 2); + var axis = 2; + expect(function () { return x.gather(indices, axis); }).toThrowError(); + }); + it('throws when passed x as a non-tensor', function () { + expect(function () { return tf.gather({}, tf.tensor1d([1])); }) + .toThrowError(/Argument 'x' passed to 'gather' must be a Tensor/); + }); + it('throws when passed indices as a non-tensor', function () { + expect(function () { return tf.gather(tf.tensor1d([1]), {}); }) + .toThrowError(/Argument 'indices' passed to 'gather' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var res = tf.gather([1, 2, 3], [0, 2, 0, 1], 0); + expect(res.shape).toEqual([4]); + test_util_1.expectArraysClose(res, [1, 3, 1, 2]); + }); + it('gradient 1D (gather)', function () { + var t = tf.tensor1d([1, 2, 3]); + var indices = tf.tensor1d([0, 2, 0, 1], 'int32'); + var dy = tf.tensor([3, 4, 5, 6]); + var gradients = tf.grad(function (t) { return tf.gather(t, indices); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [8, 6, 4]); + }); + it('gradient 2D (gather) axis=0 shape=[2, 2]', function () { + var t = tf.tensor2d([1, 11, 2, 22], [2, 2]); + var indices = tf.tensor1d([1, 0, 0, 1], 'int32'); + var dy = tf.tensor([3, 4, 5, 6, 7, 8, 9, 10], [4, 2]); + var axis = 0; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [12, 14, 12, 14]); + }); + it('gradient 2D (gather) axis=0 shape=[4, 1]', function () { + var t = tf.tensor2d([1, 11, 2, 22], [4, 1]); + var indices = tf.tensor1d([1, 0, 0, 1], 'int32'); + var dy = tf.tensor([23, 7, 19, 13], [4, 1]); + var axis = 0; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [26, 36, 0, 0]); + }); + it('gradient 2D (gather) axis=1 shape=[2, 2]', function () { + var t = tf.tensor2d([1, 11, 2, 22], [2, 2]); + var indices = tf.tensor1d([1, 0, 0, 1], 'int32'); + var dy = tf.tensor([3, 4, 5, 6, 7, 8, 9, 10], [2, 4]); + var axis = 1; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [9, 9, 17, 17]); + }); + it('gradient 2D (gather) axis=1 shape=[4, 1]', function () { + var t = tf.tensor2d([1, 11, 2, 22], [4, 1]); + var indices = tf.tensor1d([0, 0, 0, 0], 'int32'); + var dy = tf.tensor([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], [4, 4]); + var axis = 1; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [18, 34, 50, 66]); + }); + it('gradient 3D (gather) axis=0 shape=[2, 3, 2]', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [2, 3, 2]); + var indices = tf.tensor1d([1, 0, 0, 1], 'int32'); + var dy = tf.tensor([ + 2, -3, 4, 15, 6, 0.7, 1, 18, 0.01, 0, 12, 13, + 4, 15, 12, -7, 18, 19, 2, 21, 6, 23, 24, 25 + ], [4, 3, 2]); + var axis = 0; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [5, 33, 12.01, -7, 30, 32, 4, 18, 10, 38, 30, 25.7]); + }); + it('gradient 3D (gather) axis=0 shape=[1, 4, 4]', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [1, 4, 4]); + var indices = tf.tensor1d([0, 0], 'int32'); + var dy = tf.tensor([ + 2, -3, 4, 15, 6, 0.7, 1, 18, 0.01, 0, 12, 13, 4, 15, 12, -7, + 18, 19, 2, 21, 6, 23, 24, 25, 101, 31, 34, 54, 1, 0, -3, -4 + ], [2, 4, 4]); + var axis = 0; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [20, 16, 6, 36, 12, 23.7, 25, 43, 101.01, 31, 46, 67, 5, 15, 9, -11]); + }); + it('gradient 3D (gather) axis=1 shape=[2, 3, 2]', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [2, 3, 2]); + var indices = tf.tensor1d([1, 2, 2, 1], 'int32'); + var dy = tf.tensor([2, -3, 4, 15, 6, 0.7, 1, 18, 0.01, 0, 12, 13, 4, 15, 12, -7], [2, 4, 2]); + var axis = 1; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [0, 0, 3, 15, 10, 15.7, 0, 0, 12.01, -7, 16, 28]); + }); + it('gradient 3D (gather) axis=1 shape=[1, 4, 4]', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [1, 4, 4]); + var indices = tf.tensor1d([1, 2, 2, 1], 'int32'); + var dy = tf.tensor([2, -3, 4, 15, 6, 0.7, 1, 18, 0.01, 0, 12, 13, 4, 15, 12, -7], [1, 4, 4]); + var axis = 1; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0, 6, 12, 16, 8, 6.01, .7, 13, 31, 0, 0, 0, 0]); + }); + it('gradient 3D (gather) axis=2 shape=[2, 3, 2]', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [2, 3, 2]); + var indices = tf.tensor1d([1, 0, 1, 0], 'int32'); + var dy = tf.tensor([ + 2, -3, 4, 15, 6, 0.7, 1, 18, 0.01, 0, 12, 13, + 4, 15, 12, -7, 18, 19, 2, 21, 6, 23, 24, 25 + ], [2, 3, 4]); + var axis = 2; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [12, 6, 18.7, 7, 13, 12.01, 8, 16, 40, 20, 48, 30]); + }); + it('gradient 3D (gather) axis=2 shape=[4, 1, 4]', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 1, 4]); + var indices = tf.tensor1d([1, 3, 1], 'int32'); + var dy = tf.tensor([2, -3, 4, 15, 6, 0.7, 1, 18, 0.01, 0, 4, 15], [4, 1, 3]); + var axis = 2; + var gradients = tf.grad(function (t) { return tf.gather(t, indices, axis); })(t, dy); + expect(gradients.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradients, [0, 6, 0, -3, 0, 15.7, 0, 6, 0, 1.01, 0, 18, 0, 15, 0, 4]); + }); +}); +jasmine_util_1.describeWithFlags('oneHot', test_util_1.ALL_ENVS, function () { + it('Depth 1 throws error', function () { + var indices = tf.tensor1d([0, 0, 0], 'int32'); + expect(function () { return tf.oneHot(indices, 1); }).toThrowError(); + }); + it('Depth 2, diagonal', function () { + var indices = tf.tensor1d([0, 1], 'int32'); + var res = tf.oneHot(indices, 2); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res, [1, 0, 0, 1]); + }); + it('Depth 2, transposed diagonal', function () { + var indices = tf.tensor1d([1, 0], 'int32'); + var res = tf.oneHot(indices, 2); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res, [0, 1, 1, 0]); + }); + it('Depth 3, 4 events', function () { + var indices = tf.tensor1d([2, 1, 2, 0], 'int32'); + var res = tf.oneHot(indices, 3); + expect(res.shape).toEqual([4, 3]); + test_util_1.expectArraysClose(res, [0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0]); + }); + it('Out of range events do not trigger onValue', function () { + var indices = tf.tensor1d([-1, 5, 12345], 'int32'); + var res = tf.oneHot(indices, 5); + expect(res.shape).toEqual([3, 5]); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + }); + it('Depth 2 onValue=3, offValue=-2', function () { + var indices = tf.tensor1d([0, 1], 'int32'); + var res = tf.oneHot(indices, 2, 3, -2); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res, [3, -2, -2, 3]); + }); + it('indices not int32 throws error', function () { + var indices = tf.tensor1d([0, 1], 'float32'); + expect(function () { return tf.oneHot(indices, 2); }).toThrowError(); + }); + it('check output dtype', function () { + var expectedType = 'int32'; + var indices = tf.tensor1d([0, 1], 'int32'); + var res = tf.oneHot(indices, 2); + expect(res.dtype).toEqual(expectedType); + }); + it('oneHot accepts a tensor-like object', function () { + var res = tf.oneHot([0, 1], 2); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res, [1, 0, 0, 1]); + }); +}); +jasmine_util_1.describeWithFlags('linspace', test_util_1.ALL_ENVS, function () { + it('start stop', function () { + var a = tf.linspace(1, 10, 10); + test_util_1.expectArraysEqual(a, [1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]); + expect(a.shape).toEqual([10]); + var b = tf.linspace(12, 17, 8); + test_util_1.expectArraysClose(b, [ + 12., 12.71428571, 13.42857143, 14.14285714, 14.85714286, 15.57142857, + 16.28571429, 17. + ]); + expect(b.shape).toEqual([8]); + var c = tf.linspace(9, 0, 6); + test_util_1.expectArraysClose(c, [9., 7.2, 5.4, 3.6, 1.8, 0.]); + expect(c.shape).toEqual([6]); + }); + it('negative start stop', function () { + var a = tf.linspace(-4, 5, 6); + test_util_1.expectArraysClose(a, [-4., -2.2, -0.4, 1.4, 3.2, 5.]); + expect(a.shape).toEqual([6]); + }); + it('start negative stop', function () { + var a = tf.linspace(4, -5, 6); + test_util_1.expectArraysClose(a, [4., 2.2, 0.4, -1.4, -3.2, -5.]); + expect(a.shape).toEqual([6]); + }); + it('negative start negative stop', function () { + var a = tf.linspace(-4, -5, 6); + test_util_1.expectArraysClose(a, [-4., -4.2, -4.4, -4.6, -4.8, -5.]); + expect(a.shape).toEqual([6]); + var b = tf.linspace(-9, -4, 5); + test_util_1.expectArraysClose(b, [-9., -7.75, -6.5, -5.25, -4.]); + expect(b.shape).toEqual([5]); + }); + it('should throw with no samples', function () { + expect(function () { return tf.linspace(2, 10, 0); }).toThrow(); + }); +}); +jasmine_util_1.describeWithFlags('range', test_util_1.ALL_ENVS, function () { + it('start stop', function () { + var a = tf.range(0, 3); + test_util_1.expectArraysEqual(a, [0, 1, 2]); + expect(a.shape).toEqual([3]); + var b = tf.range(3, 8); + test_util_1.expectArraysEqual(b, [3, 4, 5, 6, 7]); + expect(b.shape).toEqual([5]); + }); + it('start stop negative', function () { + var a = tf.range(-2, 3); + test_util_1.expectArraysEqual(a, [-2, -1, 0, 1, 2]); + expect(a.shape).toEqual([5]); + var b = tf.range(4, -2); + test_util_1.expectArraysEqual(b, [4, 3, 2, 1, 0, -1]); + expect(b.shape).toEqual([6]); + }); + it('start stop step', function () { + var a = tf.range(4, 15, 4); + test_util_1.expectArraysEqual(a, [4, 8, 12]); + expect(a.shape).toEqual([3]); + var b = tf.range(4, 11, 4); + test_util_1.expectArraysEqual(b, [4, 8]); + expect(b.shape).toEqual([2]); + var c = tf.range(4, 17, 4); + test_util_1.expectArraysEqual(c, [4, 8, 12, 16]); + expect(c.shape).toEqual([4]); + var d = tf.range(0, 30, 5); + test_util_1.expectArraysEqual(d, [0, 5, 10, 15, 20, 25]); + expect(d.shape).toEqual([6]); + var e = tf.range(-3, 9, 2); + test_util_1.expectArraysEqual(e, [-3, -1, 1, 3, 5, 7]); + expect(e.shape).toEqual([6]); + var f = tf.range(3, 3); + test_util_1.expectArraysEqual(f, new Float32Array(0)); + expect(f.shape).toEqual([0]); + var g = tf.range(3, 3, 1); + test_util_1.expectArraysEqual(g, new Float32Array(0)); + expect(g.shape).toEqual([0]); + var h = tf.range(3, 3, 4); + test_util_1.expectArraysEqual(h, new Float32Array(0)); + expect(h.shape).toEqual([0]); + var i = tf.range(-18, -2, 5); + test_util_1.expectArraysEqual(i, [-18, -13, -8, -3]); + expect(i.shape).toEqual([4]); + }); + it('start stop large step', function () { + var a = tf.range(3, 10, 150); + test_util_1.expectArraysEqual(a, [3]); + expect(a.shape).toEqual([1]); + var b = tf.range(10, 500, 205); + test_util_1.expectArraysEqual(b, [10, 215, 420]); + expect(b.shape).toEqual([3]); + var c = tf.range(3, -10, -150); + test_util_1.expectArraysEqual(c, [3]); + expect(c.shape).toEqual([1]); + var d = tf.range(-10, -500, -205); + test_util_1.expectArraysEqual(d, [-10, -215, -420]); + expect(d.shape).toEqual([3]); + }); + it('start stop negative step', function () { + var a = tf.range(0, -10, -1); + test_util_1.expectArraysEqual(a, [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]); + expect(a.shape).toEqual([10]); + var b = tf.range(0, -10); + test_util_1.expectArraysEqual(b, [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]); + expect(b.shape).toEqual([10]); + var c = tf.range(3, -4, -2); + test_util_1.expectArraysEqual(c, [3, 1, -1, -3]); + expect(c.shape).toEqual([4]); + var d = tf.range(-3, -18, -5); + test_util_1.expectArraysEqual(d, [-3, -8, -13]); + expect(d.shape).toEqual([3]); + }); + it('start stop incompatible step', function () { + var a = tf.range(3, 10, -2); + test_util_1.expectArraysEqual(a, new Float32Array(0)); + expect(a.shape).toEqual([0]); + var b = tf.range(40, 3, 2); + test_util_1.expectArraysEqual(b, new Float32Array(0)); + expect(b.shape).toEqual([0]); + }); + it('zero step', function () { + expect(function () { return tf.range(2, 10, 0); }).toThrow(); + }); + it('should have default dtype', function () { + var a = tf.range(1, 4); + test_util_1.expectArraysEqual(a, [1, 2, 3]); + expect(a.dtype).toEqual('float32'); + expect(a.shape).toEqual([3]); + }); + it('should have float32 dtype', function () { + var a = tf.range(1, 4, undefined, 'float32'); + test_util_1.expectArraysEqual(a, [1, 2, 3]); + expect(a.dtype).toEqual('float32'); + expect(a.shape).toEqual([3]); + }); + it('should have int32 dtype', function () { + var a = tf.range(1, 4, undefined, 'int32'); + test_util_1.expectArraysEqual(a, [1, 2, 3]); + expect(a.dtype).toEqual('int32'); + expect(a.shape).toEqual([3]); + }); +}); +jasmine_util_1.describeWithFlags('fill', test_util_1.ALL_ENVS, function () { + it('1D fill', function () { + var a = tf.fill([3], 2); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysClose(a, [2, 2, 2]); + }); + it('2D fill', function () { + var a = tf.fill([3, 2], 2); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2]); + test_util_1.expectArraysClose(a, [2, 2, 2, 2, 2, 2]); + }); + it('3D fill', function () { + var a = tf.fill([3, 2, 1], 2); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2, 1]); + test_util_1.expectArraysClose(a, [2, 2, 2, 2, 2, 2]); + }); + it('4D fill', function () { + var a = tf.fill([3, 2, 1, 2], 2); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3, 2, 1, 2]); + test_util_1.expectArraysClose(a, [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]); + }); + it('5D fill', function () { + var a = tf.fill([2, 1, 2, 1, 2], 2); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 1, 2, 1, 2]); + test_util_1.expectArraysClose(a, [2, 2, 2, 2, 2, 2, 2, 2]); + }); +}); +jasmine_util_1.describeWithFlags('stack', test_util_1.ALL_ENVS, function () { + it('scalars 3, 5 and 7', function () { + var a = tf.scalar(3); + var b = tf.scalar(5); + var c = tf.scalar(7); + var res = tf.stack([a, b, c]); + expect(res.shape).toEqual([3]); + test_util_1.expectArraysClose(res, [3, 5, 7]); + }); + it('scalars 3, 5 and 7 along axis=1 throws error', function () { + var a = tf.scalar(3); + var b = tf.scalar(5); + var c = tf.scalar(7); + var f = function () { return tf.stack([a, b, c], 1); }; + expect(f).toThrowError(); + }); + it('non matching shapes throws error', function () { + var a = tf.scalar(3); + var b = tf.tensor1d([5]); + var f = function () { return tf.stack([a, b]); }; + expect(f).toThrowError(); + }); + it('non matching dtypes throws error', function () { + var a = tf.scalar(3); + var b = tf.scalar(5, 'bool'); + var f = function () { return tf.stack([a, b]); }; + expect(f).toThrowError(); + }); + it('2d but axis=3 throws error', function () { + var a = tf.zeros([2, 2]); + var b = tf.zeros([2, 2]); + var f = function () { return tf.stack([a, b], 3); }; + expect(f).toThrowError(); + }); + it('[1,2], [3,4] and [5,6], axis=0', function () { + var a = tf.tensor1d([1, 2]); + var b = tf.tensor1d([3, 4]); + var c = tf.tensor1d([5, 6]); + var res = tf.stack([a, b, c], 0); + expect(res.shape).toEqual([3, 2]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6]); + }); + it('[1,2], [3,4] and [5,6], axis=1', function () { + var a = tf.tensor1d([1, 2]); + var b = tf.tensor1d([3, 4]); + var c = tf.tensor1d([5, 6]); + var res = tf.stack([a, b, c], 1); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(res, [1, 3, 5, 2, 4, 6]); + }); + it('[[1,2],[3,4]] and [[5, 6], [7, 8]], axis=0', function () { + var a = tf.tensor2d([[1, 2], [3, 4]]); + var b = tf.tensor2d([[5, 6], [7, 8]]); + var res = tf.stack([a, b], 0); + expect(res.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6, 7, 8]); + }); + it('[[1,2],[3,4]] and [[5, 6], [7, 8]], axis=2', function () { + var a = tf.tensor2d([[1, 2], [3, 4]]); + var b = tf.tensor2d([[5, 6], [7, 8]]); + var c = tf.tensor2d([[9, 10], [11, 12]]); + var res = tf.stack([a, b, c], 2); + expect(res.shape).toEqual([2, 2, 3]); + test_util_1.expectArraysClose(res, [1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12]); + }); + it('single tensor', function () { + var a = tf.tensor2d([[1, 2], [3, 4]]); + var res = tf.stack([a], 2); + expect(res.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.stack([{}]); }) + .toThrowError(/Argument 'tensors\[0\]' passed to 'stack' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [[1, 2], [3, 4]]; + var res = tf.stack([a], 2); + expect(res.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4]); + }); +}); +jasmine_util_1.describeWithFlags('unstack', test_util_1.ALL_ENVS, function () { + it('unstack by default', function () { + var x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); + var res = tf.unstack(x); + expect(res.length).toEqual(2); + expect(res[0].rank).toEqual(1); + expect(res[0].shape).toEqual([4]); + test_util_1.expectArraysClose(res[0], [1, 2, 3, 4]); + expect(res[1].rank).toEqual(1); + expect(res[1].shape).toEqual([4]); + test_util_1.expectArraysClose(res[1], [5, 6, 7, 8]); + }); + it('unstack into 3 tensors', function () { + var x = tf.tensor2d([1, 2, 3, 4, 5, 6], [3, 2]); + var res = tf.unstack(x, 0); + expect(res.length).toEqual(3); + expect(res[0].rank).toEqual(1); + expect(res[0].shape).toEqual([2]); + test_util_1.expectArraysClose(res[0], [1, 2]); + expect(res[1].rank).toEqual(1); + expect(res[1].shape).toEqual([2]); + test_util_1.expectArraysClose(res[1], [3, 4]); + expect(res[2].rank).toEqual(1); + expect(res[2].shape).toEqual([2]); + test_util_1.expectArraysClose(res[2], [5, 6]); + }); + it('unstack by axis=1', function () { + var x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); + var res = tf.unstack(x, 1); + expect(res.length).toEqual(4); + expect(res[0].rank).toEqual(1); + expect(res[0].shape).toEqual([2]); + test_util_1.expectArraysClose(res[0], [1, 5]); + expect(res[1].rank).toEqual(1); + expect(res[1].shape).toEqual([2]); + test_util_1.expectArraysClose(res[1], [2, 6]); + expect(res[2].rank).toEqual(1); + expect(res[2].shape).toEqual([2]); + test_util_1.expectArraysClose(res[2], [3, 7]); + expect(res[3].rank).toEqual(1); + expect(res[3].shape).toEqual([2]); + test_util_1.expectArraysClose(res[3], [4, 8]); + }); + it('unstack rank 3 tensor', function () { + var x = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var res = tf.unstack(x); + expect(res.length).toEqual(2); + expect(res[0].rank).toEqual(2); + expect(res[0].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[0], [1, 2, 3, 4]); + expect(res[1].rank).toEqual(2); + expect(res[1].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[1], [5, 6, 7, 8]); + }); + it('unstack rank 3 tensor with axis=1', function () { + var x = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var res = tf.unstack(x, 1); + expect(res.length).toEqual(2); + expect(res[0].rank).toEqual(2); + expect(res[0].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[0], [1, 2, 5, 6]); + expect(res[1].rank).toEqual(2); + expect(res[1].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[1], [3, 4, 7, 8]); + }); + it('unstack rank 3 tensor with axis=2', function () { + var x = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var res = tf.unstack(x, 2); + expect(res.length).toEqual(2); + expect(res[0].rank).toEqual(2); + expect(res[0].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[0], [1, 3, 5, 7]); + expect(res[1].rank).toEqual(2); + expect(res[1].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[1], [2, 4, 6, 8]); + }); + it('unstack rank 4 tensor', function () { + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2, 1]); + var res = tf.unstack(x); + expect(res.length).toEqual(2); + expect(res[0].rank).toEqual(3); + expect(res[0].shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(res[0], [1, 2, 3, 4]); + expect(res[1].rank).toEqual(3); + expect(res[1].shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(res[1], [5, 6, 7, 8]); + }); + it('unstack rank 4 tensor with axis=1', function () { + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2, 1]); + var res = tf.unstack(x, 1); + expect(res.length).toEqual(2); + expect(res[0].rank).toEqual(3); + expect(res[0].shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(res[0], [1, 2, 5, 6]); + expect(res[1].rank).toEqual(3); + expect(res[1].shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(res[1], [3, 4, 7, 8]); + }); + it('unstack rank 4 tensor with axis=2', function () { + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2, 1]); + var res = tf.unstack(x, 2); + expect(res.length).toEqual(2); + expect(res[0].rank).toEqual(3); + expect(res[0].shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(res[0], [1, 3, 5, 7]); + expect(res[1].rank).toEqual(3); + expect(res[1].shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(res[1], [2, 4, 6, 8]); + }); + it('unstack rank 4 tensor with axis=3', function () { + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2, 1]); + var res = tf.unstack(x, 3); + expect(res.length).toEqual(1); + expect(res[0].rank).toEqual(3); + expect(res[0].shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(res[0], [1, 2, 3, 4, 5, 6, 7, 8]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.unstack({}); }) + .toThrowError(/Argument 'x' passed to 'unstack' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var x = [[1, 2, 3, 4], [5, 6, 7, 8]]; + var res = tf.unstack(x); + expect(res.length).toEqual(2); + expect(res[0].rank).toEqual(1); + expect(res[0].shape).toEqual([4]); + test_util_1.expectArraysClose(res[0], [1, 2, 3, 4]); + expect(res[1].rank).toEqual(1); + expect(res[1].shape).toEqual([4]); + test_util_1.expectArraysClose(res[1], [5, 6, 7, 8]); + }); +}); +jasmine_util_1.describeWithFlags('split', test_util_1.ALL_ENVS, function () { + it('split by number', function () { + var x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); + var res = tf.split(x, 2, 1); + expect(res.length).toEqual(2); + expect(res[0].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[0], [1, 2, 5, 6]); + expect(res[1].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[1], [3, 4, 7, 8]); + }); + it('split by sizes', function () { + var x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); + var res = tf.split(x, [1, 2, 1], 1); + expect(res.length).toEqual(3); + expect(res[0].shape).toEqual([2, 1]); + test_util_1.expectArraysClose(res[0], [1, 5]); + expect(res[1].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[1], [2, 3, 6, 7]); + expect(res[2].shape).toEqual([2, 1]); + test_util_1.expectArraysClose(res[2], [4, 8]); + }); + it('sizes to not sum to axis size throws error', function () { + var x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); + var f = function () { return tf.split(x, [1, 2], 1); }; + expect(f).toThrowError(); + }); + it('number of splits does not evenly divide axis', function () { + var x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); + var f = function () { return tf.split(x, 3, 1); }; + expect(f).toThrowError(); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.split({}, 1); }) + .toThrowError(/Argument 'x' passed to 'split' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var x = [[1, 2, 3, 4], [5, 6, 7, 8]]; + var res = tf.split(x, 2, 1); + expect(res.length).toEqual(2); + expect(res[0].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[0], [1, 2, 5, 6]); + expect(res[1].shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res[1], [3, 4, 7, 8]); + }); +}); +jasmine_util_1.describeWithFlags('expandDims', test_util_1.ALL_ENVS, function () { + it('scalar, default axis is 0', function () { + var res = tf.scalar(1).expandDims(); + expect(res.shape).toEqual([1]); + test_util_1.expectArraysClose(res, [1]); + }); + it('scalar, axis is out of bounds throws error', function () { + var f = function () { return tf.scalar(1).expandDims(1); }; + expect(f).toThrowError(); + }); + it('1d, axis=-3', function () { + expect(function () { + tf.tensor1d([1, 2, 3]).expandDims(-3); + }).toThrowError('Axis must be in the interval [-2, 1]'); + }); + it('1d, axis=-2', function () { + var res = tf.tensor1d([1, 2, 3]).expandDims(-2); + expect(res.shape).toEqual([1, 3]); + test_util_1.expectArraysClose(res, [1, 2, 3]); + }); + it('1d, axis=-1', function () { + var res = tf.tensor1d([1, 2, 3]).expandDims(-1); + expect(res.shape).toEqual([3, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3]); + }); + it('1d, axis=0', function () { + var res = tf.tensor1d([1, 2, 3]).expandDims(0); + expect(res.shape).toEqual([1, 3]); + test_util_1.expectArraysClose(res, [1, 2, 3]); + }); + it('1d, axis=1', function () { + var res = tf.tensor1d([1, 2, 3]).expandDims(1); + expect(res.shape).toEqual([3, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3]); + }); + it('2d, axis=-4', function () { + expect(function () { + tf.tensor2d([[1, 2], [3, 4], [5, 6]]).expandDims(-4); + }).toThrowError('Axis must be in the interval [-3, 2]'); + }); + it('2d, axis=-3', function () { + var res = tf.tensor2d([[1, 2], [3, 4], [5, 6]]).expandDims(-3); + expect(res.shape).toEqual([1, 3, 2]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6]); + }); + it('2d, axis=-2', function () { + var res = tf.tensor2d([[1, 2], [3, 4], [5, 6]]).expandDims(-2); + expect(res.shape).toEqual([3, 1, 2]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6]); + }); + it('2d, axis=-1', function () { + var res = tf.tensor2d([[1, 2], [3, 4], [5, 6]]).expandDims(-1); + expect(res.shape).toEqual([3, 2, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6]); + }); + it('2d, axis=0', function () { + var res = tf.tensor2d([[1, 2], [3, 4], [5, 6]]).expandDims(0); + expect(res.shape).toEqual([1, 3, 2]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6]); + }); + it('2d, axis=1', function () { + var res = tf.tensor2d([[1, 2], [3, 4], [5, 6]]).expandDims(1); + expect(res.shape).toEqual([3, 1, 2]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6]); + }); + it('2d, axis=2', function () { + var res = tf.tensor2d([[1, 2], [3, 4], [5, 6]]).expandDims(2); + expect(res.shape).toEqual([3, 2, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6]); + }); + it('4d, axis=0', function () { + var res = tf.tensor4d([[[[4]]]]).expandDims(); + expect(res.shape).toEqual([1, 1, 1, 1, 1]); + test_util_1.expectArraysClose(res, [4]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.expandDims({}); }) + .toThrowError(/Argument 'x' passed to 'expandDims' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var res = tf.expandDims(7); + expect(res.shape).toEqual([1]); + test_util_1.expectArraysClose(res, [7]); + }); +}); +jasmine_util_1.describeWithFlags('cumsum', test_util_1.ALL_ENVS, function () { + it('1D standard', function () { + var res = tf.tensor1d([1, 2, 3, 4]).cumsum(); + expect(res.shape).toEqual([4]); + test_util_1.expectArraysClose(res, [1, 3, 6, 10]); + }); + it('1D reverse', function () { + var reverse = true; + var exclusive = false; + var res = tf.tensor1d([1, 2, 3, 4]).cumsum(0, exclusive, reverse); + expect(res.shape).toEqual([4]); + test_util_1.expectArraysClose(res, [10, 9, 7, 4]); + }); + it('1D exclusive', function () { + var exclusive = true; + var res = tf.tensor1d([1, 2, 3, 4]).cumsum(0, exclusive); + expect(res.shape).toEqual([4]); + test_util_1.expectArraysClose(res, [0, 1, 3, 6]); + }); + it('1D exclusive reverse', function () { + var reverse = true; + var exclusive = true; + var res = tf.tensor1d([1, 2, 3, 4]).cumsum(0, exclusive, reverse); + expect(res.shape).toEqual([4]); + test_util_1.expectArraysClose(res, [9, 7, 4, 0]); + }); + it('gradient: 1D', function () { + var a = tf.tensor1d([1, 2, 3]); + var dy = tf.tensor1d([4, 5, 6]); + var da = tf.grad(function (x) { return tf.cumsum(x); })(a, dy); + expect(da.shape).toEqual([3]); + test_util_1.expectArraysClose(da, [15, 11, 6]); + }); + it('2D standard', function () { + var res = tf.tensor2d([[1, 2], [3, 4]]).cumsum(1); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res, [1, 3, 3, 7]); + }); + it('2D reverse exclusive', function () { + var reverse = true; + var exclusive = true; + var res = tf.tensor2d([[1, 2], [3, 4]]).cumsum(1, exclusive, reverse); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res, [2, 0, 4, 0]); + }); + it('2D axis=0', function () { + var res = tf.tensor2d([[1, 2], [3, 4]]).cumsum(); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res, [1, 2, 4, 6]); + }); + it('3D standard', function () { + var res = tf.tensor3d([[[0, 1], [2, 3]], [[4, 5], [6, 7]]]).cumsum(2); + expect(res.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(res, [0, 1, 2, 5, 4, 9, 6, 13]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.cumsum({}); }) + .toThrowError(/Argument 'x' passed to 'cumsum' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var res = tf.cumsum([1, 2, 3, 4]); + expect(res.shape).toEqual([4]); + test_util_1.expectArraysClose(res, [1, 3, 6, 10]); + }); +}); +jasmine_util_1.describeWithFlags('batchToSpaceND', test_util_1.ALL_ENVS, function () { + it('tensor4d, input shape=[4, 1, 1, 1], blockShape=[2, 2]', function () { + var t = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]); + var blockShape = [2, 2]; + var crops = [[0, 0], [0, 0]]; + var res = tf.batchToSpaceND(t, blockShape, crops); + expect(res.shape).toEqual([1, 2, 2, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4]); + }); + it('tensor4d, input shape=[4, 1, 1, 3], blockShape=[2, 2]', function () { + var t = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [4, 1, 1, 3]); + var blockShape = [2, 2]; + var crops = [[0, 0], [0, 0]]; + var res = tf.batchToSpaceND(t, blockShape, crops); + expect(res.shape).toEqual([1, 2, 2, 3]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); + }); + it('tensor4d, input shape=[1, 4, 4, 1], blockShape=[2, 2]', function () { + var t = tf.tensor4d([1, 3, 9, 11, 2, 4, 10, 12, 5, 7, 13, 15, 6, 8, 14, 16], [4, 2, 2, 1]); + var blockShape = [2, 2]; + var crops = [[0, 0], [0, 0]]; + var res = tf.batchToSpaceND(t, blockShape, crops); + expect(res.shape).toEqual([1, 4, 4, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + }); + it('tensor4d, input shape=[8, 1, 3, 1], blockShape=[2, 2]', function () { + var t = tf.tensor4d([ + 0, 1, 3, 0, 9, 11, 0, 2, 4, 0, 10, 12, + 0, 5, 7, 0, 13, 15, 0, 6, 8, 0, 14, 16 + ], [8, 1, 3, 1]); + var blockShape = [2, 2]; + var crops = [[0, 0], [2, 0]]; + var res = tf.batchToSpaceND(t, blockShape, crops); + expect(res.shape).toEqual([2, 2, 4, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + }); + it('tensor2d, blockShape [1]', function () { + var t = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var blockShape = [2]; + var crops = [[0, 0]]; + var res = tf.batchToSpaceND(t, blockShape, crops); + expect(res.shape).toEqual([1, 4]); + test_util_1.expectArraysClose(res, [1, 3, 2, 4]); + }); + it('tensor3d, blockSHape [1]', function () { + var t = tf.tensor([ + -61, 37, -68, 72, 31, 62, 0, -13, 28, 54, 96, + 44, -55, -64, -88, -94, 65, -32, -96, -73, -2, -77, + -14, 47, 33, 15, 70, 20, 75, 28, 84, -13 + ], [8, 2, 2]); + var blockShape = [2]; + var crops = [[0, 2]]; + var res = tf.batchToSpaceND(t, blockShape, crops); + expect(res.shape).toEqual([4, 2, 2]); + test_util_1.expectArraysClose(res, [-61, 37, 65, -32, 31, 62, -2, -77, 28, 54, 33, 15, -55, -64, 75, 28]); + }); + it('tensor3d, blockShape [2]', function () { + var t = tf.tensor([ + -61, 37, -68, 72, 31, 62, 0, -13, 28, 54, 96, + 44, -55, -64, -88, -94, 65, -32, -96, -73, -2, -77, + -14, 47, 33, 15, 70, 20, 75, 28, 84, -13 + ], [8, 2, 2]); + var blockShape = [2, 2]; + var crops = [[2, 0], [2, 0]]; + var res = tf.batchToSpaceND(t, blockShape, crops); + expect(res.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(res, [72, 44, -73, 20, -13, -94, 47, -13]); + }); + it('throws when blockShape equal to input rank', function () { + var t = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]); + var blockShape = [2, 2, 2, 2]; + var crops = [[0, 0], [0, 0], [0, 0], [0, 0]]; + expect(function () { return tf.batchToSpaceND(t, blockShape, crops); }) + .toThrowError('input rank should be > than [blockShape] but got 4'); + }); + it('throws when crops row dimension not equal to blockshape', function () { + var t = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]); + var blockShape = [2, 2]; + var crops = [[0, 0]]; + expect(function () { return tf.batchToSpaceND(t, blockShape, crops); }) + .toThrowError('crops.shape[0] must be equal to [blockShape] but got 1'); + }); + it('throws when input tensor batch not divisible by prod(blockShape)', function () { + var t = tf.tensor4d([1, 2, 3, 4, 5], [5, 1, 1, 1]); + var blockShape = [2, 2]; + var crops = [[0, 0], [0, 0]]; + expect(function () { return tf.batchToSpaceND(t, blockShape, crops); }) + .toThrowError('input tensor batch must be divisible by prod( blockShape )'); + }); + it('accepts a tensor-like object', function () { + var t = [[[[1]]], [[[2]]], [[[3]]], [[[4]]]]; + var blockShape = [2, 2]; + var crops = [[0, 0], [0, 0]]; + var res = tf.batchToSpaceND(t, blockShape, crops); + expect(res.shape).toEqual([1, 2, 2, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4]); + }); +}); +jasmine_util_1.describeWithFlags('spaceToBatchND', test_util_1.ALL_ENVS, function () { + it('tensor4d, input shape=[1, 2, 2, 1], blockShape=[2, 2]', function () { + var t = tf.tensor4d([[[[1], [2]], [[3], [4]]]], [1, 2, 2, 1]); + var blockShape = [2, 2]; + var paddings = [[0, 0], [0, 0]]; + var res = tf.spaceToBatchND(t, blockShape, paddings); + expect(res.shape).toEqual([4, 1, 1, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4]); + }); + it('tensor4d, input shape=[1, 2, 2, 3], blockShape=[2, 2]', function () { + var t = tf.tensor4d([[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]], [1, 2, 2, 3]); + var blockShape = [2, 2]; + var paddings = [[0, 0], [0, 0]]; + var res = tf.spaceToBatchND(t, blockShape, paddings); + expect(res.shape).toEqual([4, 1, 1, 3]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); + }); + it('tensor4d, input shape=[1, 4, 4, 1], blockShape=[2, 2]', function () { + var t = tf.tensor4d([[ + [[1], [2], [3], [4]], [[5], [6], [7], [8]], [[9], [10], [11], [12]], + [[13], [14], [15], [16]] + ]], [1, 4, 4, 1]); + var blockShape = [2, 2]; + var paddings = [[0, 0], [0, 0]]; + var res = tf.spaceToBatchND(t, blockShape, paddings); + expect(res.shape).toEqual([4, 2, 2, 1]); + test_util_1.expectArraysClose(res, [1, 3, 9, 11, 2, 4, 10, 12, 5, 7, 13, 15, 6, 8, 14, 16]); + }); + it('tensor4d, input shape=[2, 6, 6, 1], blockShape=[2, 2]', function () { + var t = tf.tensor4d([ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 + ], [2, 6, 6, 1]); + var blockShape = [2, 2]; + var paddings = [[0, 0], [0, 0]]; + var res = tf.spaceToBatchND(t, blockShape, paddings); + expect(res.shape).toEqual([8, 3, 3, 1]); + test_util_1.expectArraysClose(res, [ + 1, 3, 5, 13, 15, 17, 25, 27, 29, 37, 39, 41, 49, 51, 53, 61, 63, 65, + 2, 4, 6, 14, 16, 18, 26, 28, 30, 38, 40, 42, 50, 52, 54, 62, 64, 66, + 7, 9, 11, 19, 21, 23, 31, 33, 35, 43, 45, 47, 55, 57, 59, 67, 69, 71, + 8, 10, 12, 20, 22, 24, 32, 34, 36, 44, 46, 48, 56, 58, 60, 68, 70, 72 + ]); + }); + it('tensor4d, input shape=[2, 2, 4, 1], blockShape=[2, 2]', function () { + var t = tf.tensor4d([ + [[[1], [2], [3], [4]], [[5], [6], [7], [8]]], + [[[9], [10], [11], [12]], [[13], [14], [15], [16]]] + ], [2, 2, 4, 1]); + var blockShape = [2, 2]; + var paddings = [[0, 0], [2, 0]]; + var res = tf.spaceToBatchND(t, blockShape, paddings); + expect(res.shape).toEqual([8, 1, 3, 1]); + test_util_1.expectArraysClose(res, [ + 0, 1, 3, 0, 9, 11, 0, 2, 4, 0, 10, 12, + 0, 5, 7, 0, 13, 15, 0, 6, 8, 0, 14, 16 + ]); + }); + it('tensor2d, blockShape [1]', function () { + var t = tf.tensor2d([1, 3, 2, 4], [1, 4]); + var blockShape = [2]; + var paddings = [[0, 0]]; + var res = tf.spaceToBatchND(t, blockShape, paddings); + expect(res.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4]); + }); + it('throws when blockShape equal to input rank', function () { + var t = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]); + var blockShape = [2, 2, 2, 2]; + var paddings = [[0, 0], [0, 0], [0, 0], [0, 0]]; + expect(function () { return tf.spaceToBatchND(t, blockShape, paddings); }) + .toThrowError('input rank should be > than [blockShape] but got 4'); + }); + it('throws when paddings row dimension not equal to blockshape', function () { + var t = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]); + var blockShape = [2, 2]; + var paddings = [[0, 0]]; + expect(function () { return tf.spaceToBatchND(t, blockShape, paddings); }) + .toThrowError('paddings.shape[0] must be equal to [blockShape], got 1'); + }); + it('throws when input tensor spatial dimension not divisible by \ + blockshapes', function () { + var t = tf.tensor4d([1, 2, 3, 4, 5, 6], [1, 2, 3, 1]); + var blockShape = [2, 2]; + var paddings = [[0, 0], [0, 0]]; + expect(function () { return tf.spaceToBatchND(t, blockShape, paddings); }) + .toThrowError('input spatial dimensions must be divisible by blockShapes'); + }); + it('accepts a tensor-like object', function () { + var t = [[[[1], [2]], [[3], [4]]]]; + var blockShape = [2, 2]; + var paddings = [[0, 0], [0, 0]]; + var res = tf.spaceToBatchND(t, blockShape, paddings); + expect(res.shape).toEqual([4, 1, 1, 1]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4]); + }); +}); +jasmine_util_1.describeWithFlags('batchToSpaceND X spaceToBatchND', test_util_1.ALL_ENVS, function () { + it('tensor4d, input shape=[4, 1, 1, 1], blockShape=[2, 2]', function () { + var t = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]); + var blockShape = [2, 2]; + var crops = [[0, 0], [0, 0]]; + var paddings = [[0, 0], [0, 0]]; + var b2s = tf.batchToSpaceND(t, blockShape, crops); + expect(b2s.shape).toEqual([1, 2, 2, 1]); + test_util_1.expectArraysClose(b2s, [1, 2, 3, 4]); + var s2b = tf.spaceToBatchND(b2s, blockShape, paddings); + expect(s2b.shape).toEqual([4, 1, 1, 1]); + test_util_1.expectArraysClose(s2b, [1, 2, 3, 4]); + }); + it('tensor4d, input shape=[2, 6, 6, 1], blockShape=[2, 2]', function () { + var t = tf.tensor4d([ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 + ], [2, 6, 6, 1]); + var blockShape = [2, 2]; + var crops = [[0, 0], [0, 0]]; + var paddings = [[0, 0], [0, 0]]; + var s2b = tf.spaceToBatchND(t, blockShape, paddings); + expect(s2b.shape).toEqual([8, 3, 3, 1]); + test_util_1.expectArraysClose(s2b, [ + 1, 3, 5, 13, 15, 17, 25, 27, 29, 37, 39, 41, 49, 51, 53, 61, 63, 65, + 2, 4, 6, 14, 16, 18, 26, 28, 30, 38, 40, 42, 50, 52, 54, 62, 64, 66, + 7, 9, 11, 19, 21, 23, 31, 33, 35, 43, 45, 47, 55, 57, 59, 67, 69, 71, + 8, 10, 12, 20, 22, 24, 32, 34, 36, 44, 46, 48, 56, 58, 60, 68, 70, 72 + ]); + var b2s = tf.batchToSpaceND(s2b, blockShape, crops); + expect(b2s.shape).toEqual([2, 6, 6, 1]); + test_util_1.expectArraysClose(b2s, [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 + ]); + }); +}); +//# sourceMappingURL=array_ops_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_test.js.map new file mode 100644 index 0000000..cd52df8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"array_ops_test.js","sourceRoot":"","sources":["../../src/ops/array_ops_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBAgxGA;;AAhxGA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA2J;AAC3J,8BAAgC;AAEhC,yCAA+E;AAE/E,gCAAiB,CAAC,OAAO,EAAE,oBAAQ,EAAE;IACnC,EAAE,CAAC,kBAAkB,EAAE;QACrB,IAAM,CAAC,GAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,6BAAiB,C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CAAC,EAAG,CAAC,EAAG,CAAC,EAAG,CAAC,EAAG,CAAC,EAAG,CAAC,EAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;YACtE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;YACtE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;YACtE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;SACvE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts new file mode 100644 index 0000000..bd8d7c9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts @@ -0,0 +1,5 @@ +export declare function getReshaped(inputShape: number[], blockShape: number[], prod: number, batchToSpace?: boolean): number[]; +export declare function getPermuted(reshapedRank: number, blockShapeRank: number, batchToSpace?: boolean): number[]; +export declare function getReshapedPermuted(inputShape: number[], blockShape: number[], prod: number, batchToSpace?: boolean): number[]; +export declare function getSliceBeginCoords(crops: number[][], blockShape: number): number[]; +export declare function getSliceSize(uncroppedShape: number[], crops: number[][], blockShape: number): number[]; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js new file mode 100644 index 0000000..cd655b9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function getReshaped(inputShape, blockShape, prod, batchToSpace) { + if (batchToSpace === void 0) { batchToSpace = true; } + var reshaped = []; + if (batchToSpace) { + reshaped = reshaped.concat(blockShape.slice(0)); + reshaped.push(inputShape[0] / prod); + reshaped = reshaped.concat(inputShape.slice(1)); + } + else { + reshaped = reshaped.concat(inputShape[0]); + var spatialLength = blockShape.length; + for (var i = 0; i < spatialLength; ++i) { + reshaped = + reshaped.concat([inputShape[i + 1] / blockShape[i], blockShape[i]]); + } + reshaped = reshaped.concat(inputShape.slice(spatialLength + 1)); + } + return reshaped; +} +exports.getReshaped = getReshaped; +function getPermuted(reshapedRank, blockShapeRank, batchToSpace) { + if (batchToSpace === void 0) { batchToSpace = true; } + var permuted = []; + if (batchToSpace) { + permuted.push(blockShapeRank); + for (var i = blockShapeRank + 1; i < reshapedRank; ++i) { + if (i <= 2 * blockShapeRank) { + permuted.push(i); + permuted.push(i - (blockShapeRank + 1)); + } + else { + permuted.push(i); + } + } + } + else { + var permutedBeforeBatch = []; + var permutedAfterBatch = []; + for (var i = 1; i < reshapedRank; ++i) { + if (i >= blockShapeRank * 2 + 1 || i % 2 === 1) { + permutedAfterBatch.push(i); + } + else { + permutedBeforeBatch.push(i); + } + } + permuted.push.apply(permuted, permutedBeforeBatch); + permuted.push(0); + permuted.push.apply(permuted, permutedAfterBatch); + } + return permuted; +} +exports.getPermuted = getPermuted; +function getReshapedPermuted(inputShape, blockShape, prod, batchToSpace) { + if (batchToSpace === void 0) { batchToSpace = true; } + var reshapedPermuted = []; + if (batchToSpace) { + reshapedPermuted.push(inputShape[0] / prod); + } + else { + reshapedPermuted.push(inputShape[0] * prod); + } + for (var i = 1; i < inputShape.length; ++i) { + if (i <= blockShape.length) { + if (batchToSpace) { + reshapedPermuted.push(blockShape[i - 1] * inputShape[i]); + } + else { + reshapedPermuted.push(inputShape[i] / blockShape[i - 1]); + } + } + else { + reshapedPermuted.push(inputShape[i]); + } + } + return reshapedPermuted; +} +exports.getReshapedPermuted = getReshapedPermuted; +function getSliceBeginCoords(crops, blockShape) { + var sliceBeginCoords = [0]; + for (var i = 0; i < blockShape; ++i) { + sliceBeginCoords.push(crops[i][0]); + } + return sliceBeginCoords; +} +exports.getSliceBeginCoords = getSliceBeginCoords; +function getSliceSize(uncroppedShape, crops, blockShape) { + var sliceSize = uncroppedShape.slice(0, 1); + for (var i = 0; i < blockShape; ++i) { + sliceSize.push(uncroppedShape[i + 1] - crops[i][0] - crops[i][1]); + } + return sliceSize; +} +exports.getSliceSize = getSliceSize; +//# sourceMappingURL=array_ops_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js.map new file mode 100644 index 0000000..501debc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"array_ops_util.js","sourceRoot":"","sources":["../../src/ops/array_ops_util.ts"],"names":[],"mappings":";;AAyBA,qBACI,UAAoB,EAAE,UAAoB,EAAE,IAAY,EACxD,YAAmB;IAAnB,6BAAA,EAAA,mBAAmB;IACrB,IAAI,QAAQ,GAAa,EAAE,CAAC;IAC5B,IAAI,YAAY,EAAE;QAChB,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,Q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G,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;aAC1D;iBAAM;gBACL,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aAC1D;SACF;aAAM;YACL,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;SACtC;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAxBD,kDAwBC;AAMD,6BACI,KAAiB,EAAE,UAAkB;IACvC,IAAM,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,EAAE;QACnC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACpC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAPD,kDAOC;AAaD,sBACI,cAAwB,EAAE,KAAiB,EAAE,UAAkB;IACjE,IAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,EAAE;QACnC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACnE;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AARD,oCAQC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts new file mode 100644 index 0000000..feae0eb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts @@ -0,0 +1,9 @@ +export declare function axesAreInnerMostDims(axes: number[], rank: number): boolean; +export declare function combineLocations(outputLoc: number[], reduceLoc: number[], axes: number[]): number[]; +export declare function computeOutAndReduceShapes(aShape: number[], axes: number[]): [number[], number[]]; +export declare function expandShapeToKeepDim(shape: number[], axes: number[]): number[]; +export declare function parseAxisParam(axis: number | number[], shape: number[]): number[]; +export declare function assertAxesAreInnerMostDims(msg: string, axes: number[], rank: number): void; +export declare function getAxesPermutation(axes: number[], rank: number): number[] | null; +export declare function getUndoAxesPermutation(axes: number[]): number[]; +export declare function getInnerMostAxes(numAxes: number, rank: number): number[]; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js new file mode 100644 index 0000000..9203f74 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js @@ -0,0 +1,89 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util = require("../util"); +function axesAreInnerMostDims(axes, rank) { + for (var i = 0; i < axes.length; ++i) { + if (axes[axes.length - i - 1] !== rank - 1 - i) { + return false; + } + } + return true; +} +exports.axesAreInnerMostDims = axesAreInnerMostDims; +function combineLocations(outputLoc, reduceLoc, axes) { + var rank = outputLoc.length + reduceLoc.length; + var loc = []; + var outIdx = 0; + var reduceIdx = 0; + for (var dim = 0; dim < rank; dim++) { + if (axes.indexOf(dim) === -1) { + loc.push(outputLoc[outIdx++]); + } + else { + loc.push(reduceLoc[reduceIdx++]); + } + } + return loc; +} +exports.combineLocations = combineLocations; +function computeOutAndReduceShapes(aShape, axes) { + var outShape = []; + var rank = aShape.length; + for (var dim = 0; dim < rank; dim++) { + if (axes.indexOf(dim) === -1) { + outShape.push(aShape[dim]); + } + } + var reduceShape = axes.map(function (dim) { return aShape[dim]; }); + return [outShape, reduceShape]; +} +exports.computeOutAndReduceShapes = computeOutAndReduceShapes; +function expandShapeToKeepDim(shape, axes) { + var reduceSubShape = axes.map(function (x) { return 1; }); + return combineLocations(shape, reduceSubShape, axes); +} +exports.expandShapeToKeepDim = expandShapeToKeepDim; +function parseAxisParam(axis, shape) { + var rank = shape.length; + axis = axis == null ? shape.map(function (s, i) { return i; }) : [].concat(axis); + util.assert(axis.every(function (ax) { return ax >= -rank && ax < rank; }), "All values in axis param must be in range [-" + rank + ", " + rank + ") but " + + ("got axis " + axis)); + util.assert(axis.every(function (ax) { return util.isInt(ax); }), "All values in axis param must be integers but " + + ("got axis " + axis)); + return axis.map(function (a) { return a < 0 ? rank + a : a; }); +} +exports.parseAxisParam = parseAxisParam; +function assertAxesAreInnerMostDims(msg, axes, rank) { + util.assert(axesAreInnerMostDims(axes, rank), msg + " supports only inner-most axes for now. " + + ("Got axes " + axes + " and rank-" + rank + " input.")); +} +exports.assertAxesAreInnerMostDims = assertAxesAreInnerMostDims; +function getAxesPermutation(axes, rank) { + if (axesAreInnerMostDims(axes, rank)) { + return null; + } + var result = []; + for (var i = 0; i < rank; ++i) { + if (axes.indexOf(i) === -1) { + result.push(i); + } + } + axes.forEach(function (axis) { return result.push(axis); }); + return result; +} +exports.getAxesPermutation = getAxesPermutation; +function getUndoAxesPermutation(axes) { + return axes.map(function (axis, i) { return [i, axis]; }) + .sort(function (a, b) { return a[1] - b[1]; }) + .map(function (x) { return x[0]; }); +} +exports.getUndoAxesPermutation = getUndoAxesPermutation; +function getInnerMostAxes(numAxes, rank) { + var res = []; + for (var i = rank - numAxes; i < rank; ++i) { + res.push(i); + } + return res; +} +exports.getInnerMostAxes = getInnerMostAxes; +//# sourceMappingURL=axis_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js.map new file mode 100644 index 0000000..2c34c07 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axis_util.js","sourceRoot":"","sources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CAAC,CAAC,EAAJ,CAAI,CAAC,CAAC;AACtB,CAAC;AAJD,wDAIC;AAED,0BAAiC,OAAe,EAAE,IAAY;IAC5D,IAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;QAC1C,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACb;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAND,4CAMC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util_test.js new file mode 100644 index 0000000..f07e2f5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util_test.js @@ -0,0 +1,224 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var axis_util = require("./axis_util"); +describe('axis_util combineLocations', function () { + it('rank 4, reduce last 2 dims', function () { + var loc = axis_util.combineLocations([4, 1], [3, 7], [2, 3]); + expect(loc).toEqual([4, 1, 3, 7]); + }); + it('rank 4, reduce first two dims', function () { + var loc = axis_util.combineLocations([4, 1], [3, 7], [0, 1]); + expect(loc).toEqual([3, 7, 4, 1]); + }); + it('rank 4, reduce 1st and 3rd dims', function () { + var loc = axis_util.combineLocations([4, 1], [3, 7], [0, 2]); + expect(loc).toEqual([3, 4, 7, 1]); + }); + it('rank 4, reduce 1st and 4th dims', function () { + var loc = axis_util.combineLocations([4, 1], [3, 7], [0, 3]); + expect(loc).toEqual([3, 4, 1, 7]); + }); + it('rank 3, reduce all dims', function () { + var loc = axis_util.combineLocations([], [3, 7, 1], [0, 1, 2]); + expect(loc).toEqual([3, 7, 1]); + }); + it('rank 2, reduce last dim', function () { + var loc = axis_util.combineLocations([3], [5], [1]); + expect(loc).toEqual([3, 5]); + }); + it('rank 2, reduce first dim', function () { + var loc = axis_util.combineLocations([3], [5], [0]); + expect(loc).toEqual([5, 3]); + }); +}); +describe('axis_util computeOutAndReduceShapes', function () { + it('rank 4, reduce all dims', function () { + var _a = axis_util.computeOutAndReduceShapes([3, 7, 2, 4], [0, 1, 2, 3]), out = _a[0], red = _a[1]; + expect(out).toEqual([]); + expect(red).toEqual([3, 7, 2, 4]); + }); + it('rank 4, reduce last 2 dims', function () { + var _a = axis_util.computeOutAndReduceShapes([3, 7, 2, 4], [2, 3]), out = _a[0], red = _a[1]; + expect(out).toEqual([3, 7]); + expect(red).toEqual([2, 4]); + }); + it('rank 4, reduce first 2 dims', function () { + var _a = axis_util.computeOutAndReduceShapes([3, 7, 2, 4], [0, 1]), out = _a[0], red = _a[1]; + expect(out).toEqual([2, 4]); + expect(red).toEqual([3, 7]); + }); + it('rank 4, reduce last 3 dims', function () { + var _a = axis_util.computeOutAndReduceShapes([3, 7, 2, 4], [1, 2, 3]), out = _a[0], red = _a[1]; + expect(out).toEqual([3]); + expect(red).toEqual([7, 2, 4]); + }); + it('rank 4, reduce 1st and 3rd dims', function () { + var _a = axis_util.computeOutAndReduceShapes([3, 7, 2, 4], [0, 2]), out = _a[0], red = _a[1]; + expect(out).toEqual([7, 4]); + expect(red).toEqual([3, 2]); + }); + it('rank 3, reduce all dims', function () { + var _a = axis_util.computeOutAndReduceShapes([3, 7, 2], [0, 1, 2]), out = _a[0], red = _a[1]; + expect(out).toEqual([]); + expect(red).toEqual([3, 7, 2]); + }); +}); +describe('axis_util axesAreInnerMostDims', function () { + it('rank 4, reduce last dim', function () { + var res = axis_util.axesAreInnerMostDims([3], 4); + expect(res).toBe(true); + }); + it('rank 4, reduce last 2 dims', function () { + var res = axis_util.axesAreInnerMostDims([2, 3], 4); + expect(res).toBe(true); + }); + it('rank 4, reduce last 3 dims', function () { + var res = axis_util.axesAreInnerMostDims([1, 2, 3], 4); + expect(res).toBe(true); + }); + it('rank 4, reduce all dims', function () { + var res = axis_util.axesAreInnerMostDims([0, 1, 2, 3], 4); + expect(res).toBe(true); + }); + it('rank 4, reduce all but 2nd', function () { + var res = axis_util.axesAreInnerMostDims([0, 2, 3], 4); + expect(res).toBe(false); + }); + it('rank 4, reduce all but 3rd', function () { + var res = axis_util.axesAreInnerMostDims([0, 1, 3], 4); + expect(res).toBe(false); + }); + it('rank 4, reduce all but last', function () { + var res = axis_util.axesAreInnerMostDims([0, 1, 2], 4); + expect(res).toBe(false); + }); +}); +describe('axis_util expandShapeToKeepDim', function () { + it('2d -> 1d axis=0', function () { + var shape = axis_util.expandShapeToKeepDim([2], [0]); + expect(shape).toEqual([1, 2]); + }); + it('2d -> 1d axis=1', function () { + var shape = axis_util.expandShapeToKeepDim([4], [1]); + expect(shape).toEqual([4, 1]); + }); + it('3d -> 1d axis=1,2', function () { + var shape = axis_util.expandShapeToKeepDim([7], [1, 2]); + expect(shape).toEqual([7, 1, 1]); + }); + it('3d -> 2d axis=1', function () { + var shape = axis_util.expandShapeToKeepDim([7, 3], [1]); + expect(shape).toEqual([7, 1, 3]); + }); +}); +describe('axis_util getPermAxes', function () { + it('all axes, no perm is needed', function () { + var perm = axis_util.getAxesPermutation([0, 1, 2], 3); + expect(perm).toBeNull(); + }); + it('no axes, no perm is needed', function () { + var perm = axis_util.getAxesPermutation([], 3); + expect(perm).toBeNull(); + }); + it('inner most 2 axes, no perm is needed', function () { + var perm = axis_util.getAxesPermutation([2, 3], 4); + expect(perm).toBeNull(); + }); + it('outer most axis, perm is needed', function () { + var perm = axis_util.getAxesPermutation([0], 4); + expect(perm).toEqual([1, 2, 3, 0]); + }); + it('2 outer most axes, perm is needed', function () { + var perm = axis_util.getAxesPermutation([0, 1], 4); + expect(perm).toEqual([2, 3, 0, 1]); + }); +}); +describe('axis_util parseAxisParam', function () { + it('axis=null returns no axes for scalar', function () { + var axis = null; + var shape = []; + expect(axis_util.parseAxisParam(axis, shape)).toEqual([]); + }); + it('axis=null returns 0 axis for Tensor1D', function () { + var axis = null; + var shape = [4]; + expect(axis_util.parseAxisParam(axis, shape)).toEqual([0]); + }); + it('axis=null returns all axes for Tensor3D', function () { + var axis = null; + var shape = [3, 1, 2]; + expect(axis_util.parseAxisParam(axis, shape)).toEqual([0, 1, 2]); + }); + it('axis as a single number', function () { + var axis = 1; + var shape = [3, 1, 2]; + expect(axis_util.parseAxisParam(axis, shape)).toEqual([1]); + }); + it('axis as single negative number', function () { + var axis = -1; + var shape = [3, 1, 2]; + expect(axis_util.parseAxisParam(axis, shape)).toEqual([2]); + var axis2 = -2; + expect(axis_util.parseAxisParam(axis2, shape)).toEqual([1]); + var axis3 = -3; + expect(axis_util.parseAxisParam(axis3, shape)).toEqual([0]); + }); + it('axis as list of negative numbers', function () { + var axis = [-1, -3]; + var shape = [3, 1, 2]; + expect(axis_util.parseAxisParam(axis, shape)).toEqual([2, 0]); + }); + it('axis as list of positive numbers', function () { + var axis = [0, 2]; + var shape = [3, 1, 2]; + expect(axis_util.parseAxisParam(axis, shape)).toEqual([0, 2]); + }); + it('axis as combo of positive and negative numbers', function () { + var axis = [0, -1]; + var shape = [3, 1, 2]; + expect(axis_util.parseAxisParam(axis, shape)).toEqual([0, 2]); + }); + it('axis out of range throws error', function () { + var axis = -4; + var shape = [3, 1, 2]; + expect(function () { return axis_util.parseAxisParam(axis, shape); }).toThrowError(); + var axis2 = 4; + expect(function () { return axis_util.parseAxisParam(axis2, shape); }).toThrowError(); + }); + it('axis a list with one number out of range throws error', function () { + var axis = [0, 4]; + var shape = [3, 1, 2]; + expect(function () { return axis_util.parseAxisParam(axis, shape); }).toThrowError(); + }); + it('axis with decimal value throws error', function () { + var axis = 0.5; + var shape = [3, 1, 2]; + expect(function () { return axis_util.parseAxisParam(axis, shape); }).toThrowError(); + }); +}); +jasmine_util_1.describeWithFlags('axis_util getUndoAxesPermutation', test_util_1.ALL_ENVS, function () { + it('4d axes', function () { + var axes = [2, 0, 1, 3]; + expect(axis_util.getUndoAxesPermutation(axes)).toEqual([1, 2, 0, 3]); + }); + it('3d axes, no perm', function () { + var axes = [0, 1, 2]; + expect(axis_util.getUndoAxesPermutation(axes)).toEqual([0, 1, 2]); + }); + it('3d axes, complete flip', function () { + var axes = [2, 1, 0]; + expect(axis_util.getUndoAxesPermutation(axes)).toEqual([2, 1, 0]); + }); + it('4d array with values', function () { + var axes = [2, 0, 1, 3]; + var undoPermutation = axis_util.getUndoAxesPermutation(axes); + var a = tf.randomNormal([2, 3, 4, 5]); + var aT = tf.transpose(a, axes); + var aTT = tf.transpose(aT, undoPermutation); + test_util_1.expectArraysClose(a, aTT); + }); +}); +//# sourceMappingURL=axis_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util_test.js.map new file mode 100644 index 0000000..8a2cfcc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axis_util_test.js","sourceRoot":"","sources":["../../src/ops/axis_util_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,uCAAyC;AAEzC,QAAQ,CAAC,4BAA4B,EAAE;IACrC,EAAE,CAAC,4BAA4B,EAAE;QAC/B,IAAM,GAAG,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/D,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,C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AAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACvB,MAAM,CAAC,SAAS,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACzB,IAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1B,IAAM,eAAe,GAAG,SAAS,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAE/D,IAAM,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,IAAM,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACjC,IAAM,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;QAC9C,6BAAiB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts new file mode 100644 index 0000000..d834e3c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts @@ -0,0 +1,11 @@ +import { Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D } from '../tensor'; +import { Rank, TensorLike } from '../types'; +declare function batchNormalization2d_(x: Tensor2D | TensorLike, mean: Tensor2D | Tensor1D | TensorLike, variance: Tensor2D | Tensor1D | TensorLike, varianceEpsilon?: number, scale?: Tensor2D | Tensor1D | TensorLike, offset?: Tensor2D | Tensor1D | TensorLike): Tensor2D; +declare function batchNormalization3d_(x: Tensor3D | TensorLike, mean: Tensor3D | Tensor1D | TensorLike, variance: Tensor3D | Tensor1D | TensorLike, varianceEpsilon?: number, scale?: Tensor3D | Tensor1D | TensorLike, offset?: Tensor3D | Tensor1D | TensorLike): Tensor3D; +declare function batchNormalization4d_(x: Tensor4D | TensorLike, mean: Tensor4D | Tensor1D | TensorLike, variance: Tensor4D | Tensor1D | TensorLike, varianceEpsilon?: number, scale?: Tensor4D | Tensor1D | TensorLike, offset?: Tensor4D | Tensor1D | TensorLike): Tensor4D; +declare function batchNormalization_(x: Tensor | Tensor1D | TensorLike, mean: Tensor | Tensor1D | TensorLike, variance: Tensor | Tensor1D | TensorLike, varianceEpsilon?: number, scale?: Tensor | Tensor1D | TensorLike, offset?: Tensor | Tensor1D | TensorLike): Tensor; +export declare const batchNormalization2d: typeof batchNormalization2d_; +export declare const batchNormalization3d: typeof batchNormalization3d_; +export declare const batchNormalization4d: typeof batchNormalization4d_; +export declare const batchNormalization: typeof batchNormalization_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js new file mode 100644 index 0000000..a2d8f54 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js @@ -0,0 +1,219 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var array_ops_1 = require("./array_ops"); +var broadcast_util_1 = require("./broadcast_util"); +var operation_1 = require("./operation"); +var tensor_ops_1 = require("./tensor_ops"); +var unary_ops_1 = require("./unary_ops"); +function batchNormalization2d_(x, mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'batchNormalization'); + var $mean = tensor_util_env_1.convertToTensor(mean, 'mean', 'batchNormalization'); + var $variance = tensor_util_env_1.convertToTensor(variance, 'variance', 'batchNormalization'); + var $scale; + if (scale != null) { + $scale = tensor_util_env_1.convertToTensor(scale, 'scale', 'batchNormalization'); + } + var $offset; + if (offset != null) { + $offset = tensor_util_env_1.convertToTensor(offset, 'offset', 'batchNormalization'); + } + util.assert($x.rank === 2, "Error in batchNormalization3D: x must be rank 3 but got rank " + + ($x.rank + ".")); + util.assert($mean.rank === 2 || $mean.rank === 1, "Error in batchNormalization2D: mean must be rank 2 or rank 1 but " + + ("got rank " + $mean.rank + ".")); + util.assert($variance.rank === 2 || $variance.rank === 1, "Error in batchNormalization2D: variance must be rank 2 or rank 1 " + + ("but got rank " + $variance.rank + ".")); + if ($scale != null) { + util.assert($scale.rank === 2 || $scale.rank === 1, "Error in batchNormalization2D: scale must be rank 2 or rank 1 " + + ("but got rank " + $scale.rank + ".")); + } + if ($offset != null) { + util.assert($offset.rank === 2 || $offset.rank === 1, "Error in batchNormalization2D: offset must be rank 2 or rank 1 " + + ("but got rank " + $offset.rank + ".")); + } + return exports.batchNormalization($x, $mean, $variance, varianceEpsilon, $scale, $offset); +} +function batchNormalization3d_(x, mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'batchNormalization'); + var $mean = tensor_util_env_1.convertToTensor(mean, 'mean', 'batchNormalization'); + var $variance = tensor_util_env_1.convertToTensor(variance, 'variance', 'batchNormalization'); + var $scale; + if (scale != null) { + $scale = tensor_util_env_1.convertToTensor(scale, 'scale', 'batchNormalization'); + } + var $offset; + if (offset != null) { + $offset = tensor_util_env_1.convertToTensor(offset, 'offset', 'batchNormalization'); + } + util.assert($x.rank === 3, "Error in batchNormalization3D: x must be rank 3 but got rank " + + ($x.rank + ".")); + util.assert($mean.rank === 3 || $mean.rank === 1, "Error in batchNormalization3D: mean must be rank 3 or rank 1 but " + + ("got rank " + $mean.rank + ".")); + util.assert($variance.rank === 3 || $variance.rank === 1, "Error in batchNormalization3D: variance must be rank 3 or rank 1 " + + ("but got rank " + $variance.rank + ".")); + if ($scale != null) { + util.assert($scale.rank === 3 || $scale.rank === 1, "Error in batchNormalization3D: scale must be rank 3 or rank 1 " + + ("but got rank " + $scale.rank + ".")); + } + if ($offset != null) { + util.assert($offset.rank === 3 || $offset.rank === 1, "Error in batchNormalization3D: offset must be rank 3 or rank 1 " + + ("but got rank " + $offset.rank + ".")); + } + return exports.batchNormalization($x, $mean, $variance, varianceEpsilon, $scale, $offset); +} +function batchNormalization4d_(x, mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'batchNormalization'); + var $mean = tensor_util_env_1.convertToTensor(mean, 'mean', 'batchNormalization'); + var $variance = tensor_util_env_1.convertToTensor(variance, 'variance', 'batchNormalization'); + var $scale; + if (scale != null) { + $scale = tensor_util_env_1.convertToTensor(scale, 'scale', 'batchNormalization'); + } + var $offset; + if (offset != null) { + $offset = tensor_util_env_1.convertToTensor(offset, 'offset', 'batchNormalization'); + } + util.assert($x.rank === 4, "Error in batchNormalization4D: x must be rank 4 but got rank " + + ($x.rank + ".")); + util.assert($mean.rank === 4 || $mean.rank === 1, "Error in batchNormalization4D: mean must be rank 4 or rank 1 but " + + ("got rank " + $mean.rank + ".")); + util.assert($variance.rank === 4 || $variance.rank === 1, "Error in batchNormalization4D: variance must be rank 4 or rank 1 " + + ("but got rank " + $variance.rank + ".")); + if ($scale != null) { + util.assert($scale.rank === 4 || $scale.rank === 1, "Error in batchNormalization4D: scale must be rank 4 or rank 1 " + + ("but got rank " + $scale.rank + ".")); + } + if ($offset != null) { + util.assert($offset.rank === 4 || $offset.rank === 1, "Error in batchNormalization4D: offset must be rank 4 or rank 1 " + + ("but got rank " + $offset.rank + ".")); + } + return exports.batchNormalization($x, $mean, $variance, varianceEpsilon, $scale, $offset); +} +function batchNormalization_(x, mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'batchNormalization'); + var $mean = tensor_util_env_1.convertToTensor(mean, 'mean', 'batchNormalization'); + var $variance = tensor_util_env_1.convertToTensor(variance, 'variance', 'batchNormalization'); + var $scale; + if (scale != null) { + $scale = tensor_util_env_1.convertToTensor(scale, 'scale', 'batchNormalization'); + } + var $offset; + if (offset != null) { + $offset = tensor_util_env_1.convertToTensor(offset, 'offset', 'batchNormalization'); + } + util.assert($mean.rank === $variance.rank, 'Batch normalization gradient requires mean and variance to have ' + + 'equal ranks.'); + util.assert($offset == null || $mean.rank === $offset.rank, 'Batch normalization gradient requires mean and offset to have ' + + 'equal ranks.'); + util.assert($scale == null || $mean.rank === $scale.rank, 'Batch normalization gradient requires mean and scale to have ' + + 'equal ranks.'); + var x4D; + if ($x.rank === 0 || $x.rank === 1) { + x4D = $x.as4D(1, 1, 1, $x.size); + } + else if ($x.rank === 2) { + x4D = $x.as4D(1, 1, $x.shape[0], $x.shape[1]); + } + else if ($x.rank === 3) { + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + else { + x4D = $x; + } + var der = function (dy) { + var scaleValue = $scale == null ? tensor_ops_1.scalar(1) : $scale; + var reductionAxes = broadcast_util_1.getReductionAxes($mean.shape, x4D.shape); + var tileShape = []; + if ($mean.rank === 1) { + for (var i = 0; i < x4D.shape.length - 1; ++i) { + tileShape.push(x4D.shape[i]); + } + tileShape.push(1); + } + var xMinusMean = $x.sub($mean); + var dyTimesScaleValue = dy.mul(scaleValue); + var oneOverSqrtVariance = unary_ops_1.rsqrt($variance.add(tensor_ops_1.scalar(varianceEpsilon))); + var minusHalfRCube = oneOverSqrtVariance.mul(oneOverSqrtVariance) + .mul(oneOverSqrtVariance) + .mul(tensor_ops_1.scalar(-0.5)); + var derX = function () { + if ($mean.rank === 1) { + return dy + .mul(array_ops_1.tile(oneOverSqrtVariance.as4D(1, 1, 1, $mean.shape[0]), tileShape)) + .mul(scaleValue) + .reshape($x.shape); + } + else { + return dy.mul(oneOverSqrtVariance).mul(scaleValue).reshape($x.shape); + } + }; + var derMean = function () { + var meanDer = oneOverSqrtVariance.mul(tensor_ops_1.scalar(-1)).mul(dyTimesScaleValue); + if ($mean.rank === 1) { + meanDer = meanDer.sum(reductionAxes); + } + return meanDer.reshape($mean.shape); + }; + var derVariance = function () { + var varianceDer = minusHalfRCube.mul(xMinusMean).mul(dyTimesScaleValue); + if ($mean.rank === 1) { + varianceDer = varianceDer.sum(reductionAxes); + } + return varianceDer.reshape($mean.shape); + }; + var derScale = function () { + var xMinusMean2TimesRsqrt = xMinusMean.mul(oneOverSqrtVariance); + var scaleDer = dy.mul(xMinusMean2TimesRsqrt); + if ($mean.rank === 1) { + scaleDer = scaleDer.sum(reductionAxes); + } + return scaleDer.reshape($mean.shape); + }; + var derOffset = function () { + var offsetDer = dy; + if ($mean.rank === 1) { + offsetDer = offsetDer.sum(reductionAxes); + } + return offsetDer.reshape($mean.shape); + }; + return { + $x: derX, + $mean: derMean, + $variance: derVariance, + $scale: derScale, + $offset: derOffset + }; + }; + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.batchNormalization(x4D, batchnormReshape4D($mean), batchnormReshape4D($variance), varianceEpsilon, batchnormReshape4D($scale), batchnormReshape4D($offset)); }, { $x: $x, $mean: $mean, $variance: $variance, $scale: $scale, $offset: $offset }, der); + return res.reshape($x.shape); +} +function batchnormReshape4D(x) { + if (x == null) { + return null; + } + if (x.rank === 0) { + return x.as1D(); + } + else if (x.rank === 1) { + return x; + } + else if (x.rank === 2) { + return x.as4D(1, 1, x.shape[0], x.shape[1]); + } + else if (x.rank === 3) { + return x.as4D(1, x.shape[0], x.shape[1], x.shape[2]); + } + return x; +} +exports.batchNormalization2d = operation_1.op({ batchNormalization2d_: batchNormalization2d_ }); +exports.batchNormalization3d = operation_1.op({ batchNormalization3d_: batchNormalization3d_ }); +exports.batchNormalization4d = operation_1.op({ batchNormalization4d_: batchNormalization4d_ }); +exports.batchNormalization = operation_1.op({ batchNormalization_: batchNormalization_ }); +//# sourceMappingURL=batchnorm.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js.map new file mode 100644 index 0000000..aa4b739 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"batchnorm.js","sourceRoot":"","sources":["../../src/ops/batchnorm.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,8BAAgC;AAEhC,yCAAiC;AACjC,mDAAkD;AAClD,yCAA+B;AAC/B,2CAAoC;AACpC,yCAAkC;AAalC,+BACI,CAAsB,EAAE,IAAkC,EAC1D,QAAsC,EAAE,eAAsB,EAC9D,KAAoC,EACpC,MAAqC;IAFG,gCAAA,EAAA,sBAAsB;IAGhE,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAAC;IACzD,IAAM,KAAK,GAAG,iCAAe,CAAC,IAAI,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAClE,IAAM,SAAS,GAAG,iCAAe,CAAC,QAAQ,EAAE,UAAU,EAAE,oBAAoB,CAAC,CAAC;IAC9E,IAAI,MAAyB,CAAC;IAC9B,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,MAAM,GAAG,iCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC;KAChE;IACD,IAAI,OAA0B,CAAC;IAC/B,IAAI,MAAM,IAAI,IAAI,EAAE;QAClB,OAAO,GAAG,iCAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC;KACnE;IACD,IAAI,CAAC,MAAM,CACP,EAAE,CAAC,IAAI,KAAK,CAAC,EACb,+DAA+D;SACxD,EAAE,CAAC,IAAI,MAAG,CAAA,CAAC,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B,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACtD;IACD,OAAO,CAAa,CAAC;AACvB,CAAC;AAEY,QAAA,oBAAoB,GAAG,cAAE,CAAC,EAAC,qBAAqB,uBAAA,EAAC,CAAC,CAAC;AACnD,QAAA,oBAAoB,GAAG,cAAE,CAAC,EAAC,qBAAqB,uBAAA,EAAC,CAAC,CAAC;AACnD,QAAA,oBAAoB,GAAG,cAAE,CAAC,EAAC,qBAAqB,uBAAA,EAAC,CAAC,CAAC;AACnD,QAAA,kBAAkB,GAAG,cAAE,CAAC,EAAC,mBAAmB,qBAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_test.js new file mode 100644 index 0000000..32e3c03 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_test.js @@ -0,0 +1,533 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('batchNormalization4D', test_util_1.ALL_ENVS, function () { + it('simple batchnorm4D, no offset or scale, 2x1x1x2', function () { + var x = tf.tensor4d([2, 4, 9, 23], [2, 1, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var varianceEpsilon = .001; + var result = tf.batchNormalization4d(x, mean, variance, varianceEpsilon, undefined, undefined); + test_util_1.expectArraysClose(result, [ + (x.get(0, 0, 0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(0, 0, 0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon), + (x.get(1, 0, 0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(1, 0, 0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm4D, no offset, 2x1x1x2', function () { + var x = tf.tensor4d([2, 4, 9, 23], [2, 1, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var scale = tf.tensor1d([4, 5]); + var varianceEpsilon = .001; + var result = tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, undefined); + test_util_1.expectArraysClose(result, [ + (x.get(0, 0, 0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(0, 0, 0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon), + (x.get(1, 0, 0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(1, 0, 0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm4D, no scale, 2x1x1x2', function () { + var x = tf.tensor4d([2, 4, 9, 23], [2, 1, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var offset = tf.tensor1d([4, 5]); + var varianceEpsilon = .001; + var result = tf.batchNormalization4d(x, mean, variance, varianceEpsilon, undefined, offset); + test_util_1.expectArraysClose(result, [ + offset.get(0) + + (x.get(0, 0, 0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(0, 0, 0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon), + offset.get(0) + + (x.get(1, 0, 0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(1, 0, 0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm4D, 2x1x1x2', function () { + var x = tf.tensor4d([2, 4, 9, 23], [2, 1, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var offset = tf.tensor1d([3, 4]); + var scale = tf.tensor1d([4, 5]); + var varianceEpsilon = .001; + var result = tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); + test_util_1.expectArraysClose(result, [ + offset.get(0) + + (x.get(0, 0, 0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(0, 0, 0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon), + offset.get(0) + + (x.get(1, 0, 0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(1, 0, 0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('accepts a tensor-like object', function () { + var x = [[[[2, 4]]], [[[9, 23]]]]; + var mean = [1, 2]; + var variance = [2, 3]; + var offset = [3, 4]; + var scale = [4, 5]; + var varianceEpsilon = .001; + var result = tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); + test_util_1.expectArraysClose(result, [ + offset[0] + + (x[0][0][0][0] - mean[0]) * scale[0] / + Math.sqrt(variance[0] + varianceEpsilon), + offset[1] + + (x[0][0][0][1] - mean[1]) * scale[1] / + Math.sqrt(variance[1] + varianceEpsilon), + offset[0] + + (x[1][0][0][0] - mean[0]) * scale[0] / + Math.sqrt(variance[0] + varianceEpsilon), + offset[1] + + (x[1][0][0][1] - mean[1]) * scale[1] / + Math.sqrt(variance[1] + varianceEpsilon) + ]); + }); + it('simple batchnorm4D gradients, 2x1x1x2', function () { + var x = tf.tensor4d([2, 4, 9, 23], [2, 1, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var offset = tf.tensor1d([3, 4]); + var scale = tf.tensor1d([2, 5]); + var varianceEpsilon = .001; + var dy = tf.tensor4d([-1, -1, -1, -1], [2, 1, 1, 2]); + var gradX = tf.grad(function (x) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(x, dy); + test_util_1.expectArraysClose(gradX, tf.tensor4d([-1.414, -2.887, -1.414, -2.887], [2, 1, 1, 2])); + var gradMean = tf.grad(function (mean) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(mean, dy); + test_util_1.expectArraysClose(gradMean, tf.tensor1d([2.828, 5.773])); + var gradVariance = tf.grad(function (variance) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(variance, dy); + test_util_1.expectArraysClose(gradVariance, tf.tensor1d([3.180, 11.060])); + var gradOffset = tf.grad(function (offset) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(offset, dy); + test_util_1.expectArraysClose(gradOffset, dy.sum([0, 1, 2])); + var gradScale = tf.grad(function (scale) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(scale, dy); + test_util_1.expectArraysClose(gradScale, tf.tensor1d([-6.362, -13.277])); + }); + it('batchnorm4D gradients, same shapes in x, mean and variance', function () { + var x = tf.tensor4d([10, 20, 30, 40], [2, 1, 1, 2]); + var mean = tf.tensor4d([0, 5, 10, 15], [2, 1, 1, 2]); + var variance = tf.tensor4d([2, 4, 6, 8], [2, 1, 1, 2]); + var scale = tf.tensor4d([2, 5, 2, 5], [2, 1, 1, 2]); + var offset = tf.tensor4d([0, 0, 0, 0], [2, 1, 1, 2]); + var varianceEpsilon = .001; + var dy = tf.tensor4d([-1, -1, -1, -1], [2, 1, 1, 2]); + var gradX = tf.grad(function (x) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(x, dy); + test_util_1.expectArraysClose(gradX, tf.tensor4d([-1.414, -2.500, -0.816, -1.768], [2, 1, 1, 2])); + var gradMean = tf.grad(function (mean) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(mean, dy); + test_util_1.expectArraysClose(gradMean, tf.tensor4d([1.414, 2.500, 0.816, 1.768], [2, 1, 1, 2])); + var gradVariance = tf.grad(function (variance) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(variance, dy); + test_util_1.expectArraysClose(gradVariance, tf.tensor4d([3.533, 4.686, 1.360, 2.762], [2, 1, 1, 2])); + var gradOffset = tf.grad(function (offset) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(offset, dy); + test_util_1.expectArraysClose(gradOffset, dy); + var gradScale = tf.grad(function (scale) { return tf.batchNormalization4d(x, mean, variance, varianceEpsilon, scale, offset); })(scale, dy); + test_util_1.expectArraysClose(gradScale, tf.tensor4d([-7.069, -7.499, -8.164, -8.838], [2, 1, 1, 2])); + }); +}); +jasmine_util_1.describeWithFlags('batchNormalization3D', test_util_1.ALL_ENVS, function () { + it('simple batchnorm3D, no offset or scale, 2x1x2', function () { + var x = tf.tensor3d([2, 4, 9, 23], [2, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var varianceEpsilon = .001; + var result = tf.batchNormalization3d(x, mean, variance, varianceEpsilon, undefined, undefined); + test_util_1.expectArraysClose(result, [ + (x.get(0, 0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(0, 0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon), + (x.get(1, 0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(1, 0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm3D, no offset, 2x1x2', function () { + var x = tf.tensor3d([2, 4, 9, 23], [2, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var scale = tf.tensor1d([4, 5]); + var varianceEpsilon = .001; + var result = tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, undefined); + test_util_1.expectArraysClose(result, [ + (x.get(0, 0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(0, 0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon), + (x.get(1, 0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(1, 0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm3D, no scale, 2x1x2', function () { + var x = tf.tensor3d([2, 4, 9, 23], [2, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var offset = tf.tensor1d([4, 5]); + var varianceEpsilon = .001; + var result = tf.batchNormalization3d(x, mean, variance, varianceEpsilon, undefined, offset); + test_util_1.expectArraysClose(result, [ + offset.get(0) + + (x.get(0, 0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(0, 0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon), + offset.get(0) + + (x.get(1, 0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(1, 0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm3D, 2x1x2', function () { + var x = tf.tensor3d([2, 4, 9, 23], [2, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var offset = tf.tensor1d([3, 4]); + var scale = tf.tensor1d([4, 5]); + var varianceEpsilon = .001; + var result = tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); + test_util_1.expectArraysClose(result, [ + offset.get(0) + + (x.get(0, 0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(0, 0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon), + offset.get(0) + + (x.get(1, 0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(1, 0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('accepts a tensor-like object', function () { + var x = [[[2, 4]], [[9, 23]]]; + var mean = [1, 2]; + var variance = [2, 3]; + var offset = [3, 4]; + var scale = [4, 5]; + var varianceEpsilon = .001; + var result = tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); + test_util_1.expectArraysClose(result, [ + offset[0] + + (x[0][0][0] - mean[0]) * scale[0] / + Math.sqrt(variance[0] + varianceEpsilon), + offset[1] + + (x[0][0][1] - mean[1]) * scale[1] / + Math.sqrt(variance[1] + varianceEpsilon), + offset[0] + + (x[1][0][0] - mean[0]) * scale[0] / + Math.sqrt(variance[0] + varianceEpsilon), + offset[1] + + (x[1][0][1] - mean[1]) * scale[1] / + Math.sqrt(variance[1] + varianceEpsilon) + ]); + }); + it('batchnorm3D, x,mean,var,offset,scale are all 3D', function () { + var shape = [2, 1, 2]; + var x = tf.tensor3d([2, 4, 9, 23], shape); + var mean = tf.tensor3d([1, 2, 3, 4], shape); + var variance = tf.tensor3d([2, 3, 4, 5], shape); + var offset = tf.tensor3d([3, 4, 5, 6], shape); + var scale = tf.tensor3d([4, 5, 6, 7], shape); + var varianceEpsilon = .001; + var result = tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); + test_util_1.expectArraysClose(result, [ + offset.get(0, 0, 0) + + (x.get(0, 0, 0) - mean.get(0, 0, 0)) * scale.get(0, 0, 0) / + Math.sqrt(variance.get(0, 0, 0) + varianceEpsilon), + offset.get(0, 0, 1) + + (x.get(0, 0, 1) - mean.get(0, 0, 1)) * scale.get(0, 0, 1) / + Math.sqrt(variance.get(0, 0, 1) + varianceEpsilon), + offset.get(1, 0, 0) + + (x.get(1, 0, 0) - mean.get(1, 0, 0)) * scale.get(1, 0, 0) / + Math.sqrt(variance.get(1, 0, 0) + varianceEpsilon), + offset.get(1, 0, 1) + + (x.get(1, 0, 1) - mean.get(1, 0, 1)) * scale.get(1, 0, 1) / + Math.sqrt(variance.get(1, 0, 1) + varianceEpsilon) + ]); + }); + it('simple batchnorm3D gradients, 2x1x2', function () { + var x = tf.tensor3d([2, 4, 9, 23], [2, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var offset = tf.tensor1d([3, 4]); + var scale = tf.tensor1d([2, 5]); + var varianceEpsilon = .001; + var dy = tf.tensor3d([1, 1, 1, 1], [2, 1, 2]); + var gradX = tf.grad(function (x) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(x, dy); + test_util_1.expectArraysClose(gradX, tf.tensor3d([1.414, 2.887, 1.414, 2.887], [2, 1, 2])); + var gradMean = tf.grad(function (mean) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(mean, dy); + test_util_1.expectArraysClose(gradMean, tf.tensor1d([-2.828, -5.773])); + var gradVariance = tf.grad(function (variance) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(variance, dy); + test_util_1.expectArraysClose(gradVariance, tf.tensor1d([-3.180, -11.060])); + var gradOffset = tf.grad(function (offset) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(offset, dy); + test_util_1.expectArraysClose(gradOffset, tf.onesLike(offset).mul(tf.scalar(2))); + var gradScale = tf.grad(function (scale) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(scale, dy); + test_util_1.expectArraysClose(gradScale, tf.tensor1d([6.362, 13.277])); + }); + it('batchnorm3D gradients, same shapes in x, mean and variance', function () { + var x = tf.tensor3d([10, 20, 30, 40], [2, 1, 2]); + var mean = tf.tensor3d([0, 5, 10, 15], [2, 1, 2]); + var variance = tf.tensor3d([2, 4, 6, 8], [2, 1, 2]); + var scale = tf.tensor3d([2, 5, 2, 5], [2, 1, 2]); + var offset = tf.tensor3d([0, 0, 0, 0], [2, 1, 2]); + var varianceEpsilon = .001; + var dy = tf.tensor3d([1, 1, 1, 1], [2, 1, 2]); + var gradX = tf.grad(function (x) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(x, dy); + test_util_1.expectArraysClose(gradX, tf.tensor3d([1.414, 2.500, 0.816, 1.768], [2, 1, 2])); + var gradMean = tf.grad(function (mean) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(mean, dy); + test_util_1.expectArraysClose(gradMean, tf.tensor3d([-1.414, -2.500, -0.816, -1.768], [2, 1, 2])); + var gradVariance = tf.grad(function (variance) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(variance, dy); + test_util_1.expectArraysClose(gradVariance, tf.tensor3d([-3.533, -4.686, -1.360, -2.762], [2, 1, 2])); + var gradOffset = tf.grad(function (offset) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(offset, dy); + test_util_1.expectArraysClose(gradOffset, tf.onesLike(offset)); + var gradScale = tf.grad(function (scale) { return tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); })(scale, dy); + test_util_1.expectArraysClose(gradScale, tf.tensor3d([7.069, 7.499, 8.164, 8.838], [2, 1, 2])); + }); + it('batchnorm matches tensorflow, 2x3x3', function () { + var x = tf.tensor3d([ + 0.49955603, 0.04158615, -1.09440524, 2.03854165, -0.61578344, + 2.87533573, 1.18105987, 0.807462, 1.87888837, 2.26563962, -0.37040935, + 1.35848753, -0.75347094, 0.15683117, 0.91925946, 0.34121279, + 0.92717143, 1.89683965 + ], [2, 3, 3]); + var mean = tf.tensor1d([0.39745062, -0.48062894, 0.4847822]); + var variance = tf.tensor1d([0.32375343, 0.67117643, 1.08334653]); + var offset = tf.tensor1d([0.69398749, -1.29056387, 0.9429723]); + var scale = tf.tensor1d([-0.5607271, 0.9878457, 0.25181573]); + var varianceEpsilon = .001; + var result = tf.batchNormalization3d(x, mean, variance, varianceEpsilon, scale, offset); + test_util_1.expectArraysClose(result, [ + 0.59352049, -0.66135202, 0.5610874, -0.92077015, -1.45341019, 1.52106473, + -0.07704776, 0.26144429, 1.28010017, -1.14422404, -1.15776136, 1.15425493, + 1.82644104, -0.52249442, 1.04803919, 0.74932291, 0.40568101, 1.2844412 + ]); + }); +}); +jasmine_util_1.describeWithFlags('batchNormalization2D', test_util_1.ALL_ENVS, function () { + it('simple batchnorm2D, no offset or scale, 2x2', function () { + var x = tf.tensor2d([2, 4, 9, 23], [2, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var varianceEpsilon = .001; + var result = tf.batchNormalization2d(x, mean, variance, varianceEpsilon, undefined, undefined); + test_util_1.expectArraysClose(result, [ + (x.get(0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon), + (x.get(1, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(1, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm2D, no offset, 2x2', function () { + var x = tf.tensor2d([2, 4, 9, 23], [2, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var scale = tf.tensor1d([4, 5]); + var varianceEpsilon = .001; + var result = tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, undefined); + test_util_1.expectArraysClose(result, [ + (x.get(0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon), + (x.get(1, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + (x.get(1, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm2D, no scale, 2x2', function () { + var x = tf.tensor2d([2, 4, 9, 23], [2, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var offset = tf.tensor1d([4, 5]); + var varianceEpsilon = .001; + var result = tf.batchNormalization2d(x, mean, variance, varianceEpsilon, undefined, offset); + test_util_1.expectArraysClose(result, [ + offset.get(0) + + (x.get(0, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(0, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon), + offset.get(0) + + (x.get(1, 0) - mean.get(0)) * 1 / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(1, 1) - mean.get(1)) * 1 / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm2D, 2x2', function () { + var x = tf.tensor2d([2, 4, 9, 23], [2, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var offset = tf.tensor1d([3, 4]); + var scale = tf.tensor1d([4, 5]); + var varianceEpsilon = .001; + var result = tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); + test_util_1.expectArraysClose(result, [ + offset.get(0) + + (x.get(0, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(0, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon), + offset.get(0) + + (x.get(1, 0) - mean.get(0)) * scale.get(0) / + Math.sqrt(variance.get(0) + varianceEpsilon), + offset.get(1) + + (x.get(1, 1) - mean.get(1)) * scale.get(1) / + Math.sqrt(variance.get(1) + varianceEpsilon) + ]); + }); + it('simple batchnorm2D gradients, 2x2', function () { + var x = tf.tensor2d([2, 4, 9, 23], [2, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var offset = tf.tensor1d([3, 4]); + var scale = tf.tensor1d([2, 5]); + var varianceEpsilon = .001; + var dy = tf.tensor2d([1, 1, 1, 1], [2, 2]); + var gradX = tf.grad(function (x) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(x, dy); + test_util_1.expectArraysClose(gradX, tf.tensor2d([1.414, 2.887, 1.414, 2.887], [2, 2])); + var gradMean = tf.grad(function (mean) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(mean, dy); + test_util_1.expectArraysClose(gradMean, tf.tensor1d([-2.828, -5.773])); + var gradVariance = tf.grad(function (variance) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(variance, dy); + test_util_1.expectArraysClose(gradVariance, tf.tensor1d([-3.180, -11.060])); + var gradOffset = tf.grad(function (offset) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(offset, dy); + test_util_1.expectArraysClose(gradOffset, tf.onesLike(offset).mul(tf.scalar(2))); + var gradScale = tf.grad(function (scale) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(scale, dy); + test_util_1.expectArraysClose(gradScale, tf.tensor1d([6.362, 13.277])); + }); + it('batchnorm2D gradients, same shapes in x, mean and variance', function () { + var x = tf.tensor2d([10, 20, 30, 40], [2, 2]); + var mean = tf.tensor2d([0, 5, 10, 15], [2, 2]); + var variance = tf.tensor2d([2, 4, 6, 8], [2, 2]); + var scale = tf.tensor2d([2, 5, 2, 5], [2, 2]); + var offset = tf.tensor2d([0, 0, 0, 0], [2, 2]); + var varianceEpsilon = .001; + var dy = tf.tensor2d([1, 1, 1, 1], [2, 2]); + var gradX = tf.grad(function (x) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(x, dy); + test_util_1.expectArraysClose(gradX, tf.tensor2d([1.414, 2.500, 0.816, 1.768], [2, 2])); + var gradMean = tf.grad(function (mean) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(mean, dy); + test_util_1.expectArraysClose(gradMean, tf.tensor2d([-1.414, -2.500, -0.816, -1.768], [2, 2])); + var gradVariance = tf.grad(function (variance) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(variance, dy); + test_util_1.expectArraysClose(gradVariance, tf.tensor2d([-3.533, -4.686, -1.360, -2.762], [2, 2])); + var gradOffset = tf.grad(function (offset) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(offset, dy); + test_util_1.expectArraysClose(gradOffset, tf.onesLike(offset)); + var gradScale = tf.grad(function (scale) { return tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); })(scale, dy); + test_util_1.expectArraysClose(gradScale, tf.tensor2d([7.069, 7.499, 8.164, 8.838], [2, 2])); + }); + it('batchnorm2D matches tensorflow, 3x3', function () { + var x = tf.tensor2d([ + 0.3136892, 0.92389025, 0.594782, 0.05021042, 0.67545404, 0.93910035, + 0.13277993, 0.96474269, 0.88608916 + ], [3, 3]); + var mean = tf.tensor1d([0.19526312, 0.74857256, 0.45166398]); + var variance = tf.tensor1d([0.22963001, 0.61521992, 0.46623685]); + var offset = tf.tensor1d([0.43098484, 0.77712237, 0.47916298]); + var scale = tf.tensor1d([0.62186907, 0.85673736, 0.19201061]); + var varianceEpsilon = .001; + var result = tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); + test_util_1.expectArraysClose(result, [ + 0.58433646, 0.96846228, 0.51936529, 0.24315402, 0.69732157, 0.61608542, + 0.35007446, 1.01304821, 0.60119441 + ]); + }); + it('throws when passed x as a non-tensor', function () { + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + expect(function () { return tf.batchNormalization({}, mean, variance); }) + .toThrowError(/Argument 'x' passed to 'batchNormalization' must be a Tensor/); + }); + it('throws when passed mean as a non-tensor', function () { + var x = tf.tensor4d([2, 4, 9, 23], [2, 1, 1, 2]); + var variance = tf.tensor1d([2, 3]); + expect(function () { return tf.batchNormalization(x, {}, variance); }) + .toThrowError(/Argument 'mean' passed to 'batchNormalization' must be a Tensor/); + }); + it('throws when passed variance as a non-tensor', function () { + var x = tf.tensor4d([2, 4, 9, 23], [2, 1, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var e = /Argument 'variance' passed to 'batchNormalization' must be a Tensor/; + expect(function () { return tf.batchNormalization(x, mean, {}); }) + .toThrowError(e); + }); + it('throws when passed scale as a non-tensor', function () { + var x = tf.tensor4d([2, 4, 9, 23], [2, 1, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var epsilon = .001; + expect(function () { + return tf.batchNormalization(x, mean, variance, epsilon, {}); + }) + .toThrowError(/Argument 'scale' passed to 'batchNormalization' must be a Tensor/); + }); + it('throws when passed offset as a non-tensor', function () { + var x = tf.tensor4d([2, 4, 9, 23], [2, 1, 1, 2]); + var mean = tf.tensor1d([1, 2]); + var variance = tf.tensor1d([2, 3]); + var epsilon = .001; + var scale = tf.tensor1d([0.62186907, 0.85673736, 0.19201061]); + var e = /Argument 'offset' passed to 'batchNormalization' must be a Tensor/; + expect(function () { return tf.batchNormalization(x, mean, variance, epsilon, scale, {}); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var x = [[2, 4], [9, 23]]; + var mean = [1, 2]; + var variance = [2, 3]; + var offset = [3, 4]; + var scale = [4, 5]; + var varianceEpsilon = .001; + var result = tf.batchNormalization2d(x, mean, variance, varianceEpsilon, scale, offset); + test_util_1.expectArraysClose(result, [ + offset[0] + + (x[0][0] - mean[0]) * scale[0] / + Math.sqrt(variance[0] + varianceEpsilon), + offset[1] + + (x[0][1] - mean[1]) * scale[1] / + Math.sqrt(variance[1] + varianceEpsilon), + offset[0] + + (x[1][0] - mean[0]) * scale[0] / + Math.sqrt(variance[0] + varianceEpsilon), + offset[1] + + (x[1][1] - mean[1]) * scale[1] / + Math.sqrt(variance[1] + varianceEpsilon) + ]); + }); +}); +//# sourceMappingURL=batchnorm_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_test.js.map new file mode 100644 index 0000000..30b94a6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"batchnorm_test.js","sourceRoot":"","sources":["../../src/ops/batchnorm_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,sBAAsB,EAAE,oBAAQ,EAAE;IAClD,EAAE,CAAC,iDAAiD,EAAE;QACpD,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,IAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACjC,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,IAAM,eAAe,GAAG,IAAI,CAAC;QAE7B,IAAM,MAAM,GAAG,EAAE,CAAC,oBAAoB,CAClC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,CAAC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AC,CAAC,GAAG,eAAe,CAAC;YAChD,MAAM,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;oBAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC;YAChD,MAAM,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;oBAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC;YAChD,MAAM,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;oBAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC;SACjD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops.d.ts new file mode 100644 index 0000000..8d8dc5e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops.d.ts @@ -0,0 +1,45 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function add_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function addN_(tensors: Array): T; +declare function addStrict_(a: T, b: T): T; +declare function sub_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function subStrict_(a: T, b: T): T; +declare function pow_(base: T | TensorLike, exp: Tensor | TensorLike): T; +declare function powStrict_(base: T, exp: Tensor): T; +declare function mul_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function mulStrict_(a: T, b: T): T; +declare function div_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function floorDiv_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function divStrict_(a: T, b: T): T; +declare function mod_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function modStrict_(a: T, b: T): T; +declare function minimum_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function minimumStrict_(a: T, b: T): T; +declare function maximum_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function maximumStrict_(a: T, b: T): T; +declare function squaredDifference_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function squaredDifferenceStrict_(a: T, b: T): T; +declare function atan2_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +export declare const add: typeof add_; +export declare const addN: typeof addN_; +export declare const addStrict: typeof addStrict_; +export declare const atan2: typeof atan2_; +export declare const div: typeof div_; +export declare const divStrict: typeof divStrict_; +export declare const floorDiv: typeof floorDiv_; +export declare const maximum: typeof maximum_; +export declare const maximumStrict: typeof maximumStrict_; +export declare const minimum: typeof minimum_; +export declare const minimumStrict: typeof minimumStrict_; +export declare const mod: typeof mod_; +export declare const modStrict: typeof modStrict_; +export declare const mul: typeof mul_; +export declare const mulStrict: typeof mulStrict_; +export declare const pow: typeof pow_; +export declare const powStrict: typeof powStrict_; +export declare const squaredDifference: typeof squaredDifference_; +export declare const squaredDifferenceStrict: typeof squaredDifferenceStrict_; +export declare const sub: typeof sub_; +export declare const subStrict: typeof subStrict_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops.js new file mode 100644 index 0000000..5e32035 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops.js @@ -0,0 +1,365 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_1 = require("../tensor_util"); +var tensor_util_env_1 = require("../tensor_util_env"); +var types_1 = require("../types"); +var util = require("../util"); +var broadcast_util = require("./broadcast_util"); +var operation_1 = require("./operation"); +var tensor_ops_1 = require("./tensor_ops"); +var unary_ops_1 = require("./unary_ops"); +function add_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'add'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'add'); + tensor_util_1.assertTypesMatch($a, $b); + var outShape = broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy; + var reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($a.shape); + }; + var derB = function () { + var res = dy; + var reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($b.shape); + }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.add($a, $b); }, { $a: $a, $b: $b }, der); +} +function addN_(tensors) { + util.assert(Array.isArray(tensors), function () { return 'The param passed to tf.addN() must be a list of tensors'; }); + util.assert(tensors.length >= 1, function () { return "Must pass at least one tensor to tf.addN(), but got " + + ("" + tensors.length); }); + var $tensors = tensors.map(function (t, i) { return tensor_util_env_1.convertToTensor(t, "tensors" + i, 'addN'); }); + var firstTensor = $tensors[0]; + $tensors.forEach(function (t) { + if (t.dtype !== firstTensor.dtype) { + throw new Error('All tensors passed to tf.addN() must have the same dtype'); + } + }); + $tensors.forEach(function (t) { + if (!util.arraysEqual(t.shape, firstTensor.shape)) { + throw new Error('All tensors passed to tf.addN() must have the same shape'); + } + }); + var der = function (dy) { + var ders = {}; + $tensors.forEach(function (t, i) { + ders[i] = function () { return dy.clone(); }; + }); + return ders; + }; + var inputs = $tensors; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.addN($tensors); }, inputs, der); +} +function addStrict_(a, b) { + util.assertShapesMatch(a.shape, b.shape, 'Error in addStrict: '); + return a.add(b); +} +function sub_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'sub'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'sub'); + tensor_util_1.assertTypesMatch($a, $b); + var outShape = broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy; + var reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($a.shape); + }; + var derB = function () { + var res = dy; + var reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.neg().reshape($b.shape); + }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.subtract($a, $b); }, { $a: $a, $b: $b }, der); +} +function subStrict_(a, b) { + util.assertShapesMatch(a.shape, b.shape, 'Error in subStrict: '); + return a.sub(b); +} +function pow_(base, exp) { + var $base = tensor_util_env_1.convertToTensor(base, 'base', 'pow'); + var $exp = tensor_util_env_1.convertToTensor(exp, 'exp', 'pow'); + var outShape = broadcast_util.assertAndGetBroadcastShape($base.shape, $exp.shape); + base = $base.cast(types_1.upcastType($base.dtype, $exp.dtype)); + exp = $exp.cast(types_1.upcastType($base.dtype, $exp.dtype)); + var grad = function (dy, saved) { + var y = saved[0]; + var derBase = function () { + var res = dy.mul($exp.toFloat().mul(y.div($base))); + var reduceAxes = broadcast_util.getReductionAxes($base.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($base.shape); + }; + var derExp = function () { + var res = dy.mul(y.mul($base.log()).toFloat()); + var reduceAxes = broadcast_util.getReductionAxes($exp.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($exp.shape); + }; + return { $base: derBase, $exp: derExp }; + }; + return environment_1.ENV.engine.runKernel(function (backend, save) { return save(backend.pow($base, $exp)); }, { $base: $base, $exp: $exp }, grad); +} +function powStrict_(base, exp) { + util.assertShapesMatch(base.shape, exp.shape, 'Error in powStrict: '); + return base.pow(exp); +} +function mul_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'mul'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'mul'); + tensor_util_1.assertTypesMatch($a, $b); + var outShape = broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy.mul($b.toFloat()); + var reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + var derB = function () { + var res = dy.mul($a.toFloat()); + var reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($b.shape); + } + return res; + }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.multiply($a, $b); }, { $a: $a, $b: $b }, der); +} +function mulStrict_(a, b) { + util.assertShapesMatch(a.shape, b.shape, 'Error in multiplyStrict: '); + return a.mul(b); +} +function div_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'div'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'div'); + tensor_util_1.assertTypesMatch($a, $b); + var forwardFunc; + if ($a.dtype === 'int32' && $b.dtype === 'int32') { + return exports.floorDiv($a, $b); + } + else { + forwardFunc = function (backend) { return backend.realDivide($a, $b); }; + } + var outShape = broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy.div($b.toFloat()); + var reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + var derB = function () { + var res = dy.mul($a.toFloat()); + var reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes).reshape($b.shape); + } + var tmp = $b.square(); + return res.div(tmp.toFloat()).neg(); + }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(forwardFunc, { $a: $a, $b: $b }, der); +} +function floorDiv_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'floorDiv'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'floorDiv'); + tensor_util_1.assertTypesMatch($a, $b); + var forwardFunc = function (backend) { return backend.floorDiv($a, $b); }; + var outShape = broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy.div($b.toFloat()); + var reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + var derB = function () { + var res = dy.mul($a.toFloat()); + var reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes).reshape($b.shape); + } + var tmp = $b.square(); + return res.div(tmp.toFloat()).neg(); + }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(forwardFunc, { $a: $a, $b: $b }, der); +} +function divStrict_(a, b) { + util.assertShapesMatch(a.shape, b.shape, 'Error in divideStrict: '); + return a.div(b); +} +function mod_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'mod'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'mod'); + tensor_util_1.assertTypesMatch($a, $b); + var outShape = broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return dy.sum(reduceAxes).reshape($a.shape); + } + return dy; + }; + var derB = function () { + var res = dy.mul($a.div($b).floor().neg()); + var reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($b.shape); + } + return res; + }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.mod($a, $b); }, { $a: $a, $b: $b }, der); +} +function modStrict_(a, b) { + util.assertShapesMatch(a.shape, b.shape, 'Error in modStrict: '); + return a.mod(b); +} +function minimum_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'minimum'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'minimum'); + tensor_util_1.assertTypesMatch($a, $b); + if ($a.dtype === 'bool') { + $a = $a.toInt(); + } + if ($b.dtype === 'bool') { + $b = $b.toInt(); + } + broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { return dy.mul($a.lessEqual($b).toFloat()); }; + var derB = function () { return dy.mul($a.greater($b).toFloat()); }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.minimum($a, $b); }, { $a: $a, $b: $b }, der); +} +function minimumStrict_(a, b) { + util.assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: '); + return a.minimum(b); +} +function maximum_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'maximum'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'maximum'); + tensor_util_1.assertTypesMatch($a, $b); + if ($a.dtype === 'bool') { + $a = $a.toInt(); + } + if ($b.dtype === 'bool') { + $b = $b.toInt(); + } + broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { return dy.mul($a.greaterEqual($b).toFloat()); }; + var derB = function () { return dy.mul($a.less($b).toFloat()); }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.maximum($a, $b); }, { $a: $a, $b: $b }, der); +} +function maximumStrict_(a, b) { + util.assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: '); + return a.maximum(b); +} +function squaredDifference_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'squaredDifference'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'squaredDifference'); + tensor_util_1.assertTypesMatch($a, $b); + broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var two = tensor_ops_1.scalar(2); + var derA = function () { return dy.mul($a.sub($b).mul(two)); }; + var derB = function () { return dy.mul($b.sub($a).mul(two)); }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.squaredDifference($a, $b); }, { $a: $a, $b: $b }, der); +} +function squaredDifferenceStrict_(a, b) { + util.assertShapesMatch(a.shape, b.shape, 'Error in squaredDifferenceStrict: '); + return a.squaredDifference(b); +} +function atan2_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'atan2'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'atan2'); + tensor_util_1.assertTypesMatch($a, $b); + var outShape = broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var d = exports.add($a.square(), $b.square()); + var res = dy.mul($b.div(d)); + var reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($a.shape); + }; + var derB = function () { + var d = exports.add($a.square(), $b.square()); + var res = unary_ops_1.neg(dy.mul($a.div(d))); + var reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($b.shape); + }; + return { $a: derA, $b: derB }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.atan2($a, $b); }, { $a: $a, $b: $b }, der); +} +exports.add = operation_1.op({ add_: add_ }); +exports.addN = operation_1.op({ addN_: addN_ }); +exports.addStrict = operation_1.op({ addStrict_: addStrict_ }); +exports.atan2 = operation_1.op({ atan2_: atan2_ }); +exports.div = operation_1.op({ div_: div_ }); +exports.divStrict = operation_1.op({ divStrict_: divStrict_ }); +exports.floorDiv = operation_1.op({ floorDiv_: floorDiv_ }); +exports.maximum = operation_1.op({ maximum_: maximum_ }); +exports.maximumStrict = operation_1.op({ maximumStrict_: maximumStrict_ }); +exports.minimum = operation_1.op({ minimum_: minimum_ }); +exports.minimumStrict = operation_1.op({ minimumStrict_: minimumStrict_ }); +exports.mod = operation_1.op({ mod_: mod_ }); +exports.modStrict = operation_1.op({ modStrict_: modStrict_ }); +exports.mul = operation_1.op({ mul_: mul_ }); +exports.mulStrict = operation_1.op({ mulStrict_: mulStrict_ }); +exports.pow = operation_1.op({ pow_: pow_ }); +exports.powStrict = operation_1.op({ powStrict_: powStrict_ }); +exports.squaredDifference = operation_1.op({ squaredDifference_: squaredDifference_ }); +exports.squaredDifferenceStrict = operation_1.op({ squaredDifferenceStrict_: squaredDifferenceStrict_ }); +exports.sub = operation_1.op({ sub_: sub_ }); +exports.subStrict = operation_1.op({ subStrict_: subStrict_ }); +//# sourceMappingURL=binary_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops.js.map new file mode 100644 index 0000000..d071ff6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"binary_ops.js","sourceRoot":"","sources":["../../src/ops/binary_ops.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAInC,8CAAgD;AAChD,sDAAmD;AACnD,kCAAgD;AAChD,8BAAgC;AAChC,iDAAmD;AACnD,yCAA+B;AAC/B,2CAAoC;AACpC,yCAAgC;AA0BhC,cAAgC,CAAoB,EAAE,CAAoB;IACxE,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC1C,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC1C,8BAAgB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAEzB,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,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,aAAa,GAAG,cAAE,CAAC,EAAC,cAAc,gBAAA,EAAC,CAAC,CAAC;AACrC,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,aAAa,GAAG,cAAE,CAAC,EAAC,cAAc,gBAAA,EAAC,CAAC,CAAC;AACrC,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,iBAAiB,GAAG,cAAE,CAAC,EAAC,kBAAkB,oBAAA,EAAC,CAAC,CAAC;AAC7C,QAAA,uBAAuB,GAAG,cAAE,CAAC,EAAC,wBAAwB,0BAAA,EAAC,CAAC,CAAC;AACzD,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js new file mode 100644 index 0000000..09e528c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js @@ -0,0 +1,744 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('prelu', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var x = tf.tensor1d([0, 1, -2, -4]); + var a = tf.tensor1d([0.15, 0.2, 0.25, 0.15]); + var result = tf.prelu(x, a); + expect(result.shape).toEqual(x.shape); + test_util_1.expectArraysClose(result, [0, 1, -0.5, -0.6]); + }); + it('derivative', function () { + var x = tf.tensor1d([0.5, 3, -0.1, -4]); + var a = tf.tensor1d([0.2, 0.4, 0.25, 0.15]); + var dy = tf.tensor1d([1, 1, 1, 1]); + var dx = tf.grad(function (x) { return tf.prelu(x, a); })(x, dy); + expect(dx.shape).toEqual(x.shape); + expect(dx.dtype).toEqual('float32'); + test_util_1.expectArraysClose(dx, [1, 1, 0.25, 0.15]); + }); + it('throws when passed x as a non-tensor', function () { + expect(function () { return tf.prelu({}, tf.scalar(1)); }) + .toThrowError(/Argument 'x' passed to 'prelu' must be a Tensor/); + }); + it('throws when passed alpha as a non-tensor', function () { + expect(function () { return tf.prelu(tf.scalar(1), {}); }) + .toThrowError(/Argument 'alpha' passed to 'prelu' must be a Tensor/); + }); +}); +jasmine_util_1.describeWithFlags('maximum', test_util_1.ALL_ENVS, function () { + it('float32 and float32', function () { + var a = tf.tensor1d([0.5, 3, -0.1, -4]); + var b = tf.tensor1d([0.2, 0.4, 0.25, 0.15]); + var result = tf.maximum(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0.5, 3, 0.25, 0.15]); + }); + it('int32 and int32', function () { + var a = tf.tensor1d([1, 5, 2, 3], 'int32'); + var b = tf.tensor1d([2, 3, 1, 4], 'int32'); + var result = tf.maximum(a, b); + expect(result.shape).toEqual(a.shape); + expect(result.dtype).toBe('int32'); + test_util_1.expectArraysEqual(result, [2, 5, 2, 4]); + }); + it('bool and bool', function () { + var a = tf.tensor1d([true, false, false, true], 'bool'); + var b = tf.tensor1d([false, false, true, true], 'bool'); + var result = tf.maximum(a, b); + expect(result.shape).toEqual(a.shape); + expect(result.dtype).toBe('int32'); + test_util_1.expectArraysEqual(result, [1, 0, 1, 1]); + }); + it('different dtypes throws error', function () { + var a = tf.tensor1d([true, false, false, true], 'float32'); + var b = tf.tensor1d([false, false, true, true], 'int32'); + expect(function () { return tf.maximum(a, b); }).toThrowError(); + }); + it('propagates NaN', function () { + var a = tf.tensor1d([0.5, -0.1, NaN]); + var b = tf.tensor1d([0.2, 0.3, 0.25]); + var result = tf.maximum(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0.5, 0.3, NaN]); + }); + it('broadcasts Tensor1D and scalar', function () { + var a = tf.tensor1d([0.5, 3, -0.1, -4]); + var b = tf.scalar(0.6); + var result = tf.maximum(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0.6, 3, 0.6, 0.6]); + }); + it('broadcasts scalar and Tensor1D', function () { + var a = tf.scalar(0.6); + var b = tf.tensor1d([0.5, 3, -0.1, -4]); + var result = tf.maximum(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [0.6, 3, 0.6, 0.6]); + }); + it('broadcasts Tensor1D and Tensor2D', function () { + var a = tf.tensor1d([0.5, 0.3]); + var b = tf.tensor2d([0.2, 0.4, 0.6, 0.15], [2, 2]); + var result = tf.maximum(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [0.5, 0.4, 0.6, 0.3]); + }); + it('broadcasts 2x1 Tensor2D and 2x2 Tensor2D', function () { + var a = tf.tensor2d([0.5, 0.3], [2, 1]); + var b = tf.tensor2d([0.2, 0.4, 0.6, 0.15], [2, 2]); + var result = tf.maximum(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [0.5, 0.5, 0.6, 0.3]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5.2); + var b = tf.scalar(0.6); + var dy = tf.scalar(3); + var grads = tf.grads(function (a, b) { return tf.maximum(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [3 * 1]); + test_util_1.expectArraysClose(db, [3 * 0]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1.1, 2.6, 3, 5.9]); + var b = tf.tensor1d([1.0, 2.7, 3, 5.8]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var grads = tf.grads(function (a, b) { return tf.maximum(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 1, 2 * 0, 3 * 1, 4 * 1]); + test_util_1.expectArraysClose(db, [1 * 0, 2 * 1, 3 * 0, 4 * 0]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([0.5, 0.3, 0.7, 0.9], [2, 2]); + var b = tf.tensor2d([0.2, 0.4, 0.7, 0.15], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.maximum(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 1, 2 * 0, 3 * 1, 4 * 1]); + test_util_1.expectArraysClose(db, [1 * 0, 2 * 1, 3 * 0, 4 * 0]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.maximum({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'maximum' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.maximum(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'maximum' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [[0.5, 3], [-0.1, -4]]; + var b = [[0.2, 0.4], [0.25, 0.15]]; + var result = tf.maximum(a, b); + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, [0.5, 3, 0.25, 0.15]); + }); +}); +jasmine_util_1.describeWithFlags('squaredDifference', test_util_1.ALL_ENVS, function () { + it('float32 and float32', function () { + var a = tf.tensor1d([0.5, 3, -0.1, -4]); + var b = tf.tensor1d([0.2, 0.4, 0.25, 0.15]); + var result = tf.squaredDifference(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [ + Math.pow(0.5 - 0.2, 2), Math.pow(3 - 0.4, 2), Math.pow(-0.1 - 0.25, 2), + Math.pow(-4 - 0.15, 2) + ]); + }); + it('int32 and int32', function () { + var a = tf.tensor1d([1, 5, 2, 3], 'int32'); + var b = tf.tensor1d([2, 3, 1, 4], 'int32'); + var result = tf.squaredDifference(a, b); + expect(result.shape).toEqual(a.shape); + expect(result.dtype).toBe('int32'); + test_util_1.expectArraysEqual(result, [ + Math.pow(1 - 2, 2), Math.pow(5 - 3, 2), Math.pow(2 - 1, 2), + Math.pow(3 - 4, 2) + ]); + }); + it('different dtypes throws error', function () { + var a = tf.tensor1d([0.5, 3, -0.1, -4], 'float32'); + var b = tf.tensor1d([2, 3, 1, 4], 'int32'); + expect(function () { return tf.squaredDifference(a, b); }).toThrowError(); + }); + it('propagates NaN', function () { + var a = tf.tensor1d([0.5, -0.1, NaN]); + var b = tf.tensor1d([0.2, 0.3, 0.25]); + var result = tf.squaredDifference(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [Math.pow(0.5 - 0.2, 2), Math.pow(-0.1 - 0.3, 2), NaN]); + }); + it('broadcasts Tensor1D and scalar', function () { + var a = tf.tensor1d([0.5, 3, -0.1, -4]); + var b = tf.scalar(0.6); + var result = tf.squaredDifference(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [ + Math.pow(0.5 - 0.6, 2), Math.pow(3 - 0.6, 2), Math.pow(-0.1 - 0.6, 2), + Math.pow(-4 - 0.6, 2) + ]); + }); + it('broadcasts scalar and Tensor1D', function () { + var a = tf.scalar(0.6); + var b = tf.tensor1d([0.5, 3, -0.1, -4]); + var result = tf.squaredDifference(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [ + Math.pow(0.6 - 0.5, 2), Math.pow(0.6 - 3, 2), Math.pow(0.6 - (-0.1), 2), + Math.pow(0.6 - (-4), 2) + ]); + }); + it('broadcasts Tensor1D and Tensor2D', function () { + var a = tf.tensor1d([0.5, 0.3]); + var b = tf.tensor2d([0.2, 0.4, 0.6, 0.15], [2, 2]); + var result = tf.squaredDifference(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [ + Math.pow(0.5 - 0.2, 2), Math.pow(0.3 - 0.4, 2), Math.pow(0.5 - 0.6, 2), + Math.pow(0.3 - 0.15, 2) + ]); + }); + it('broadcasts 2x1 Tensor2D and 2x2 Tensor2D', function () { + var a = tf.tensor2d([0.5, 0.3], [2, 1]); + var b = tf.tensor2d([0.2, 0.4, 0.6, 0.15], [2, 2]); + var result = tf.squaredDifference(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [ + Math.pow(0.5 - 0.2, 2), Math.pow(0.5 - 0.4, 2), Math.pow(0.3 - 0.6, 2), + Math.pow(0.3 - 0.15, 2) + ]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5.2); + var b = tf.scalar(0.6); + var dy = tf.scalar(3); + var grads = tf.grads(function (a, b) { return tf.squaredDifference(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [3 * 2 * (5.2 - 0.6)]); + test_util_1.expectArraysClose(db, [3 * 2 * (0.6 - 5.2)]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1.1, 2.6, 3, 5.9]); + var b = tf.tensor1d([1.0, 2.7, 3, 5.8]); + var dy = tf.tensor1d([1, 2, 3, 1]); + var grads = tf.grads(function (a, b) { return tf.squaredDifference(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [ + 1 * 2 * (1.1 - 1.0), 2 * 2 * (2.6 - 2.7), 3 * 2 * (3 - 3), + 1 * 2 * (5.9 - 5.8) + ]); + test_util_1.expectArraysClose(db, [ + 1 * 2 * (1.0 - 1.1), 2 * 2 * (2.7 - 2.6), 3 * 2 * (3 - 3), + 1 * 2 * (5.8 - 5.9) + ]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([0.5, 0.3, 0.7, 0.9], [2, 2]); + var b = tf.tensor2d([0.2, 0.4, 0.7, 0.15], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.squaredDifference(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [ + 1 * 2 * (0.5 - 0.2), 2 * 2 * (0.3 - 0.4), 3 * 2 * (0.7 - 0.7), + 4 * 2 * (0.9 - 0.15) + ]); + test_util_1.expectArraysClose(db, [ + 1 * 2 * (0.2 - 0.5), 2 * 2 * (0.4 - 0.3), 3 * 2 * (0.7 - 0.7), + 4 * 2 * (0.15 - 0.9) + ]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.squaredDifference({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'squaredDifference' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.squaredDifference(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'squaredDifference' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [[0.5, 3], [-0.1, -4]]; + var b = 0.6; + var result = tf.squaredDifference(a, b); + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, [ + Math.pow(0.5 - 0.6, 2), Math.pow(3 - 0.6, 2), Math.pow(-0.1 - 0.6, 2), + Math.pow(-4 - 0.6, 2) + ]); + }); +}); +jasmine_util_1.describeWithFlags('minimum', test_util_1.ALL_ENVS, function () { + it('float32 and float32', function () { + var a = tf.tensor1d([0.5, 3, -0.1, -4]); + var b = tf.tensor1d([0.2, 0.4, 0.25, 0.15]); + var result = tf.minimum(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0.2, 0.4, -0.1, -4]); + }); + it('int32 and int32', function () { + var a = tf.tensor1d([1, 5, 2, 3], 'int32'); + var b = tf.tensor1d([2, 3, 1, 4], 'int32'); + var result = tf.minimum(a, b); + expect(result.shape).toEqual(a.shape); + expect(result.dtype).toBe('int32'); + test_util_1.expectArraysEqual(result, [1, 3, 1, 3]); + }); + it('bool and bool', function () { + var a = tf.tensor1d([true, false, false, true], 'bool'); + var b = tf.tensor1d([false, false, true, true], 'bool'); + var result = tf.minimum(a, b); + expect(result.shape).toEqual(a.shape); + expect(result.dtype).toBe('int32'); + test_util_1.expectArraysEqual(result, [0, 0, 0, 1]); + }); + it('different dtypes throws error', function () { + var a = tf.tensor1d([true, false, false, true], 'float32'); + var b = tf.tensor1d([false, false, true, true], 'int32'); + expect(function () { return tf.minimum(a, b); }).toThrowError(); + }); + it('propagates NaN', function () { + var a = tf.tensor1d([0.5, -0.1, NaN]); + var b = tf.tensor1d([0.2, 0.3, 0.25]); + var result = tf.minimum(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0.2, -0.1, NaN]); + }); + it('broadcasts Tensor1D and scalar', function () { + var a = tf.tensor1d([0.5, 3, -0.1, -4]); + var b = tf.scalar(0.6); + var result = tf.minimum(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0.5, 0.6, -0.1, -4]); + }); + it('broadcasts scalar and Tensor1D', function () { + var a = tf.scalar(0.6); + var b = tf.tensor1d([0.5, 3, -0.1, -4]); + var result = tf.minimum(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [0.5, 0.6, -0.1, -4]); + }); + it('broadcasts Tensor1D and Tensor2D', function () { + var a = tf.tensor1d([0.5, 0.3]); + var b = tf.tensor2d([0.2, 0.4, 0.6, 0.15], [2, 2]); + var result = tf.minimum(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [0.2, 0.3, 0.5, 0.15]); + }); + it('broadcasts 2x1 Tensor2D and 2x2 Tensor2D', function () { + var a = tf.tensor2d([0.5, 0.3], [2, 1]); + var b = tf.tensor2d([0.2, 0.4, 0.6, 0.15], [2, 2]); + var result = tf.minimum(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [0.2, 0.4, 0.3, 0.15]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5.2); + var b = tf.scalar(0.6); + var dy = tf.scalar(3); + var grads = tf.grads(function (a, b) { return tf.minimum(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [3 * 0]); + test_util_1.expectArraysClose(db, [3 * 1]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1.1, 2.6, 3, 5.9]); + var b = tf.tensor1d([1.0, 2.7, 3, 5.8]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var grads = tf.grads(function (a, b) { return tf.minimum(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 0, 2 * 1, 3 * 1, 4 * 0]); + test_util_1.expectArraysClose(db, [1 * 1, 2 * 0, 3 * 0, 4 * 1]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([0.5, 0.3, 0.7, 0.9], [2, 2]); + var b = tf.tensor2d([0.2, 0.4, 0.7, 0.15], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.minimum(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 0, 2 * 1, 3 * 1, 4 * 0]); + test_util_1.expectArraysClose(db, [1 * 1, 2 * 0, 3 * 0, 4 * 1]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.minimum({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'minimum' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.minimum(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'minimum' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [[0.5, 3], [-0.1, -4]]; + var b = [[0.2, 0.4], [0.25, 0.15]]; + var result = tf.minimum(a, b); + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, [0.2, 0.4, -0.1, -4]); + }); +}); +jasmine_util_1.describeWithFlags('mod', test_util_1.ALL_ENVS, function () { + it('float32 and float32', function () { + var a = tf.tensor1d([0.5, 3, -0.1, -4]); + var b = tf.tensor1d([0.2, 0.4, 0.25, 0.15]); + var result = tf.mod(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0.1, 0.2, 0.15, 0.05]); + }); + it('int32 and int32', function () { + var a = tf.tensor1d([1, 5, 2, 3], 'int32'); + var b = tf.tensor1d([2, 3, 1, 4], 'int32'); + var result = tf.mod(a, b); + expect(result.shape).toEqual(a.shape); + expect(result.dtype).toBe('int32'); + test_util_1.expectArraysEqual(result, [1, 2, 0, 3]); + }); + it('different dtypes throws error', function () { + var a = tf.tensor1d([1.1, 2.2, 3.3, 4.4], 'float32'); + var b = tf.tensor1d([1, 2, 3, 4], 'int32'); + expect(function () { return tf.mod(a, b); }).toThrowError(); + }); + it('propagates NaN', function () { + var a = tf.tensor1d([5, -1, NaN]); + var b = tf.tensor1d([2, 3, 0.25]); + var result = tf.mod(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [1, 2, NaN]); + }); + it('broadcasts Tensor1D and scalar', function () { + var a = tf.tensor1d([0.5, 2.5, -0.1, -4], 'float32'); + var b = tf.scalar(0.6); + var result = tf.mod(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0.5, 0.1, 0.5, 0.2]); + }); + it('broadcasts scalar and Tensor1D', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([3, 3, -1, -4]); + var result = tf.mod(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [2, 2, 0, -2]); + }); + it('broadcasts Tensor1D and Tensor2D', function () { + var a = tf.tensor1d([0.5, 0.3]); + var b = tf.tensor2d([0.2, 0.4, 0.6, 0.15], [2, 2]); + var result = tf.mod(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [0.1, 0.3, 0.5, 0.0]); + }); + it('broadcasts 2x1 Tensor2D and 2x2 Tensor2D', function () { + var a = tf.tensor2d([0.5, 0.3], [2, 1]); + var b = tf.tensor2d([0.2, 0.4, 0.6, 0.15], [2, 2]); + var result = tf.mod(a, b); + expect(result.shape).toEqual(b.shape); + test_util_1.expectArraysClose(result, [0.1, 0.1, 0.3, 0.0]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5.2); + var b = tf.scalar(0.6); + var dy = tf.scalar(3); + var grads = tf.grads(function (a, b) { return tf.mod(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [3]); + test_util_1.expectArraysClose(db, [3 * -1 * Math.floor(5.2 / 0.6)]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1.1, 2.6, 3, 5.9]); + var b = tf.tensor1d([1.0, 2.7, 3, 5.8]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var grads = tf.grads(function (a, b) { return tf.mod(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 1, 2 * 1, 3 * 1, 4 * 1]); + test_util_1.expectArraysClose(db, [ + 1 * -1 * Math.floor(1.1 / 1.0), 2 * -1 * Math.floor(2.6 / 2.7), + 3 * -1 * Math.floor(3 / 3), 4 * -1 * Math.floor(5.9 / 5.8) + ]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([0.5, 0.3, 0.7, 0.91], [2, 2]); + var b = tf.tensor2d([0.2, 0.4, 0.7, 0.15], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.mod(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 1, 2 * 1, 3 * 1, 4 * 1]); + test_util_1.expectArraysClose(db, [ + 1 * -1 * Math.floor(0.5 / 0.2), 2 * -1 * Math.floor(0.3 / 0.4), + 3 * -1 * Math.floor(0.7 / 0.7), 4 * -1 * Math.floor(0.91 / 0.15) + ]); + }); + it('gradients: broadcasts scalar and Tensor1D', function () { + var a = tf.scalar(0.7); + var b = tf.tensor1d([0.2, 0.3, 0.4, 0.5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var grads = tf.grads(function (a, b) { return tf.mod(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 + 2 + 3 + 4]); + test_util_1.expectArraysClose(db, [ + 1 * -1 * Math.floor(0.7 / 0.2), 2 * -1 * Math.floor(0.7 / 0.3), + 3 * -1 * Math.floor(0.7 / 0.4), 4 * -1 * Math.floor(0.7 / 0.5) + ]); + }); + it('broadcasts Tensor1D and Tensor2D', function () { + var a = tf.tensor1d([0.5, 0.3]); + var b = tf.tensor2d([0.2, 0.4, 0.7, 0.15], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.mod(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + expect(da.dtype).toEqual('float32'); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 1 + 3 * 1, 2 * 1 + 4 * 1]); + test_util_1.expectArraysClose(db, [ + 1 * -1 * Math.floor(0.5 / 0.2), 2 * -1 * Math.floor(0.3 / 0.4), + 3 * -1 * Math.floor(0.5 / 0.7), 4 * -1 * Math.floor(0.3 / 0.15) + ]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.mod({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'mod' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.mod(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'mod' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [[0.5, 3], [-0.1, -4]]; + var b = [[0.2, 0.4], [0.25, 0.15]]; + var result = tf.mod(a, b); + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, [0.1, 0.2, 0.15, 0.05]); + }); +}); +jasmine_util_1.describeWithFlags('atan2', test_util_1.ALL_ENVS, function () { + it('same shape', function () { + var aValues = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]; + var bValues = [1.0, 2.5, 3.5, 4.5, 2.0, 5.0]; + var a = tf.tensor2d(aValues, [2, 3]); + var c = tf.tensor2d(bValues, [2, 3]); + var r = tf.atan2(a, c); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.atan2(aValues[i], bValues[i]); + } + test_util_1.expectArraysClose(r, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor2d([1.0, 2.0], [2, 1]); + var c = tf.tensor2d([3.0, NaN], [2, 1]); + var r = tf.atan2(a, c); + test_util_1.expectArraysClose(r, [Math.atan2(1.0, 3.0), NaN]); + }); + it('broadcasting same rank Tensors different shape', function () { + var aValues = [1.0, 2.0, -3.0, -4.0]; + var bValues = [2.0, 3.0]; + var a = tf.tensor2d(aValues, [2, 2]); + var b = tf.tensor2d(bValues, [2, 1]); + var result = tf.atan2(a, b); + expect(result.shape).toEqual([2, 2]); + var expected = [ + Math.atan2(1.0, 2.0), Math.atan2(2.0, 2.0), Math.atan2(-3.0, 3.0), + Math.atan2(-4.0, 3.0) + ]; + test_util_1.expectArraysClose(result, expected); + }); + it('throws when passed tensors of different shapes', function () { + var a = tf.tensor2d([1, 2, -3, -4, 5, 6], [2, 3]); + var b = tf.tensor2d([5, 3, 4, -7], [2, 2]); + expect(function () { return tf.atan2(a, b); }).toThrowError(); + expect(function () { return tf.atan2(b, a); }).toThrowError(); + }); + it('throws when passed tensors of different types', function () { + var a = tf.tensor2d([1, 2, -3, -4, 5, 6], [2, 3]); + var b = tf.tensor2d([5.0, 3.0, 4.0, -7.0], [2, 2]); + expect(function () { return tf.atan2(a, b); }).toThrowError(); + expect(function () { return tf.atan2(b, a); }).toThrowError(); + }); + it('atan2 of scalar and array propagates NaNs', function () { + var c = tf.scalar(NaN); + var a = tf.tensor2d([1, 2, 3], [1, 3]); + var r = tf.atan2(c, a); + test_util_1.expectArraysEqual(r, [NaN, NaN, NaN]); + }); + it('atan2 of scalar and array', function () { + var aValues = [1, 2, 3, 4, 5, 6]; + var a = tf.tensor2d(aValues, [2, 3]); + var c = tf.scalar(2); + var r = tf.atan2(a, c); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.atan2(aValues[i], 2); + } + test_util_1.expectArraysClose(r, expected); + }); + it('gradient: Scalar', function () { + var a = tf.scalar(5); + var b = tf.scalar(2); + var dy = tf.scalar(4); + var grads = tf.grads(function (a, b) { return tf.atan2(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [4 * 2 / 29]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [4 * -5 / 29]); + }); + it('gradient: Tensor1D', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([3, 4, 5]); + var dy = tf.tensor1d([1, 10, 20]); + var grads = tf.grads(function (a, b) { return tf.atan2(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 3 / 10, 10 * 4 / 20, 20 * 5 / 34]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-1 * 1 / 10, -10 * 2 / 20, -20 * 3 / 34]); + }); + it('gradient: Tensor2D', function () { + var a = tf.tensor2d([3, 1, 2, 3], [2, 2]); + var b = tf.tensor2d([1, 3, 4, 5], [2, 2]); + var dy = tf.tensor2d([1, 10, 15, 20], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.atan2(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 1 / 10, 10 * 3 / 10, 15 * 4 / 20, 20 * 5 / 34]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-1 * 3 / 10, -10 * 1 / 10, -15 * 2 / 20, -20 * 3 / 34]); + }); + it('gradient: scalar / Tensor1D', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([3, 4, 5]); + var dy = tf.tensor1d([6, 7, 8]); + var grads = tf.grads(function (a, b) { return tf.atan2(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [6 * 3 / 13 + 7 * 4 / 20 + 8 * 5 / 29]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-6 * 2 / 13, -7 * 2 / 20, -8 * 2 / 29]); + }); + it('gradient: Tensor2D / scalar', function () { + var a = tf.tensor2d([[2, 3], [4, 5]], [2, 2]); + var b = tf.scalar(2); + var dy = tf.tensor2d([[6, 7], [8, 9]], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.atan2(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [6 * 2 / 8, 7 * 2 / 13, 8 * 2 / 20, 9 * 2 / 29]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-6 * 2 / 8 + -7 * 3 / 13 + -8 * 4 / 20 + -9 * 5 / 29]); + }); + it('gradient: Tensor2D / Tensor2D w/ broadcast', function () { + var a = tf.tensor2d([3, 4], [2, 1]); + var b = tf.tensor2d([[2, 3], [4, 5]], [2, 2]); + var dy = tf.tensor2d([[6, 7], [8, 9]], [2, 2]); + var grads = tf.grads(function (a, b) { return tf.atan2(a, b); }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [6 * 2 / 13 + 7 * 3 / 18, 8 * 4 / 32 + 9 * 5 / 41]); + expect(db.shape).toEqual(b.shape); + expect(db.dtype).toEqual('float32'); + test_util_1.expectArraysClose(db, [-6 * 3 / 13, -7 * 3 / 18, -8 * 4 / 32, -9 * 4 / 41]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.atan2({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'atan2' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.atan2(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'atan2' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [[1, 2, 3], [4, 5, 6]]; + var c = 2; + var r = tf.atan2(a, c); + var expected = []; + for (var i = 0; i < 6; i++) { + expected[i] = Math.atan2(i + 1, 2); + } + test_util_1.expectArraysClose(r, expected); + }); +}); +jasmine_util_1.describeWithFlags('div', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([0, 1, -2, -4, 4, -4]); + var b = tf.tensor1d([0.15, 0.2, 0.25, 0.5, 0.7, 1.2]); + var result = tf.div(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0, 5.0, -8.0, -8.0, 5.714285850524902, -3.3333332538604736]); + }); + it('floored internally', function () { + var a = tf.tensor1d([10, 20, -20, -40], 'int32'); + var b = tf.tensor1d([10, 12, 8, 5], 'int32'); + var result = tf.div(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [1, 1, -3, -8]); + }); + it('floorDiv', function () { + var a = tf.tensor1d([10, 20, -20, -40], 'int32'); + var b = tf.tensor1d([10, 12, 8, 5], 'int32'); + var result = tf.floorDiv(a, b); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [1, 1, -3, -8]); + }); +}); +//# sourceMappingURL=binary_ops_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js.map new file mode 100644 index 0000000..7ca3680 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"binary_ops_test.js","sourceRoot":"","sources":["../../src/ops/binary_ops_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA4E;AAE5E,gCAAiB,CAAC,OAAO,EAAE,oBAAQ,EAAE;IACnC,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QAC/C,IAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAE9B,MAAM,CAAC,MAAM,CAAC,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AAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACtC,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts new file mode 100644 index 0000000..2abadb8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts @@ -0,0 +1,4 @@ +export declare function getBroadcastDims(inShape: number[], outShape: number[]): number[]; +export declare function getReductionAxes(inShape: number[], outShape: number[]): number[]; +export declare function broadcastDimsAreOuter(dims: number[]): boolean; +export declare function assertAndGetBroadcastShape(shapeA: number[], shapeB: number[]): number[]; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js new file mode 100644 index 0000000..3c0f3b3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function getBroadcastDims(inShape, outShape) { + var inRank = inShape.length; + var dims = []; + for (var i = 0; i < inRank; i++) { + var dim = inRank - 1 - i; + var a = inShape[dim] || 1; + var b = outShape[outShape.length - 1 - i] || 1; + if (b > 1 && a === 1) { + dims.unshift(dim); + } + } + return dims; +} +exports.getBroadcastDims = getBroadcastDims; +function getReductionAxes(inShape, outShape) { + var result = []; + for (var i = 0; i < outShape.length; i++) { + var inDim = inShape[inShape.length - i - 1]; + var outAxis = outShape.length - i - 1; + var outDim = outShape[outAxis]; + if (inDim == null || (inDim === 1 && outDim > 1)) { + result.unshift(outAxis); + } + } + return result; +} +exports.getReductionAxes = getReductionAxes; +function broadcastDimsAreOuter(dims) { + for (var i = 0; i < dims.length; i++) { + if (dims[i] !== i) { + return false; + } + } + return true; +} +exports.broadcastDimsAreOuter = broadcastDimsAreOuter; +function assertAndGetBroadcastShape(shapeA, shapeB) { + var result = []; + var errMsg = "Operands could not be broadcast together with shapes " + + (shapeA + " and " + shapeB + "."); + var l = Math.max(shapeA.length, shapeB.length); + for (var i = 0; i < l; i++) { + var a = shapeA[shapeA.length - i - 1] || 1; + var b = shapeB[shapeB.length - i - 1] || 1; + if (a > 1 && b > 1 && a !== b) { + throw Error(errMsg); + } + result.unshift(Math.max(a, b)); + } + return result; +} +exports.assertAndGetBroadcastShape = assertAndGetBroadcastShape; +//# sourceMappingURL=broadcast_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js.map new file mode 100644 index 0000000..db35be2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"broadcast_util.js","sourceRoot":"","sources":["../../src/ops/broadcast_util.ts"],"names":[],"mappings":";;AA0BA,0BACI,OAAiB,EAAE,QAAkB;IACvC,IAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,IAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,IAAM,GAAG,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAM,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACpB,IA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CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1B,IAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;SACrB;QACD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAChC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAhBD,gEAgBC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util_test.js new file mode 100644 index 0000000..e4e3b58 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util_test.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var broadcast_util = require("./broadcast_util"); +describe('broadcast_util.getBroadcastShape', function () { + it('two scalars', function () { + var res = broadcast_util.assertAndGetBroadcastShape([], []); + expect(res).toEqual([]); + }); + it('scalar and 1d', function () { + var res = broadcast_util.assertAndGetBroadcastShape([6], []); + expect(res).toEqual([6]); + }); + it('scalar and 2d', function () { + var res = broadcast_util.assertAndGetBroadcastShape([2, 6], []); + expect(res).toEqual([2, 6]); + }); + it('1d and 2d', function () { + var res = broadcast_util.assertAndGetBroadcastShape([6], [2, 6]); + expect(res).toEqual([2, 6]); + }); + it('2d and 3d', function () { + var res = broadcast_util.assertAndGetBroadcastShape([2, 6], [7, 2, 6]); + expect(res).toEqual([7, 2, 6]); + }); + it('3d and 3d', function () { + var res = broadcast_util.assertAndGetBroadcastShape([1, 1, 6], [7, 2, 6]); + expect(res).toEqual([7, 2, 6]); + }); + it('incompatible inner shape', function () { + var f = function () { + return broadcast_util.assertAndGetBroadcastShape([7, 2, 5], [7, 2, 6]); + }; + expect(f).toThrowError(); + }); + it('incompatible middle shape', function () { + var f = function () { + return broadcast_util.assertAndGetBroadcastShape([7, 3, 6], [7, 2, 6]); + }; + expect(f).toThrowError(); + }); + it('compatible with broadcasting support', function () { + var res = broadcast_util.assertAndGetBroadcastShape([7, 1, 1], [7, 1, 1]); + expect(res).toEqual([7, 1, 1]); + }); + it('3d and 3d, each gets broadcasted', function () { + var res = broadcast_util.assertAndGetBroadcastShape([4, 1, 7], [1, 3, 1]); + expect(res).toEqual([4, 3, 7]); + }); +}); +describe('broadcast_util.getBroadcastDims', function () { + it('[] => []', function () { + var dims = broadcast_util.getBroadcastDims([], []); + expect(dims.length).toBe(0); + }); + it('[] => [5, 4]', function () { + var dims = broadcast_util.getBroadcastDims([], [5, 4]); + expect(dims.length).toBe(0); + }); + it('[1] => [5]', function () { + var dims = broadcast_util.getBroadcastDims([1], [5]); + expect(dims).toEqual([0]); + }); + it('[5, 1] => [5, 3]', function () { + var dims = broadcast_util.getBroadcastDims([5, 1], [5, 3]); + expect(dims).toEqual([1]); + }); + it('[1, 3] => [5, 3]', function () { + var dims = broadcast_util.getBroadcastDims([1, 3], [5, 3]); + expect(dims).toEqual([0]); + }); + it('[1, 1] => [5, 3]', function () { + var dims = broadcast_util.getBroadcastDims([1, 1], [5, 3]); + expect(dims).toEqual([0, 1]); + }); + it('[4, 1, 3] => [4, 5, 3]', function () { + var dims = broadcast_util.getBroadcastDims([4, 1, 3], [4, 5, 3]); + expect(dims).toEqual([1]); + }); +}); +describe('broadcast_util.getReductionAxes', function () { + it('[] => []', function () { + var axes = broadcast_util.getReductionAxes([], []); + expect(axes).toEqual([]); + }); + it('[] => [5, 4]', function () { + var axes = broadcast_util.getReductionAxes([], [5, 4]); + expect(axes).toEqual([0, 1]); + }); + it('[1] => [5]', function () { + var axes = broadcast_util.getReductionAxes([1], [5]); + expect(axes).toEqual([0]); + }); + it('[5, 1] => [5, 3]', function () { + var axes = broadcast_util.getReductionAxes([5, 1], [5, 3]); + expect(axes).toEqual([1]); + }); + it('[1, 3] => [5, 3]', function () { + var axes = broadcast_util.getReductionAxes([1, 3], [5, 3]); + expect(axes).toEqual([0]); + }); + it('[1, 1] => [5, 3]', function () { + var axes = broadcast_util.getReductionAxes([1, 1], [5, 3]); + expect(axes).toEqual([0, 1]); + }); + it('[4, 1, 3] => [4, 5, 3]', function () { + var axes = broadcast_util.getReductionAxes([4, 1, 3], [4, 5, 3]); + expect(axes).toEqual([1]); + }); +}); +describe('broadcast_util.broadcastDimsAreOuter', function () { + it('[] => []', function () { + var dims = broadcast_util.getBroadcastDims([], []); + var areOuter = broadcast_util.broadcastDimsAreOuter(dims); + expect(areOuter).toBe(true); + }); + it('[] => [5, 4]', function () { + var dims = broadcast_util.getBroadcastDims([], [5, 4]); + var areOuter = broadcast_util.broadcastDimsAreOuter(dims); + expect(areOuter).toBe(true); + }); + it('[1] => [5]', function () { + var dims = broadcast_util.getBroadcastDims([1], [5]); + var areOuter = broadcast_util.broadcastDimsAreOuter(dims); + expect(areOuter).toBe(true); + }); + it('[5, 1] => [5, 3]', function () { + var dims = broadcast_util.getBroadcastDims([5, 1], [5, 3]); + var areOuter = broadcast_util.broadcastDimsAreOuter(dims); + expect(areOuter).toBe(false); + }); + it('[1, 1] => [5, 3]', function () { + var dims = broadcast_util.getBroadcastDims([1, 1], [5, 3]); + var areOuter = broadcast_util.broadcastDimsAreOuter(dims); + expect(areOuter).toBe(true); + }); + it('[4, 1, 3] => [4, 5, 3]', function () { + var dims = broadcast_util.getBroadcastDims([4, 1, 3], [4, 5, 3]); + var areOuter = broadcast_util.broadcastDimsAreOuter(dims); + expect(areOuter).toBe(false); + }); + it('[1, 1, 3] => [4, 5, 3]', function () { + var dims = broadcast_util.getBroadcastDims([1, 1, 3], [4, 5, 3]); + var areOuter = broadcast_util.broadcastDimsAreOuter(dims); + expect(areOuter).toBe(true); + }); +}); +//# sourceMappingURL=broadcast_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util_test.js.map new file mode 100644 index 0000000..1d7d8a6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"broadcast_util_test.js","sourceRoot":"","sources":["../../src/ops/broadcast_util_test.ts"],"names":[],"mappings":";;AAiBA,iDAAmD;AAEnD,QAAQ,CAAC,kCAAkC,EAAE;IAC3C,EAAE,CAAC,aAAa,EAAE;QAChB,IAAM,GAAG,GAAG,cAAc,CAAC,0BAA0B,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9D,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,eAAe,EAAE;QAClB,IAAM,GAAG,GAAG,cAAc,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/D,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,eAAe,EAAE;QAClB,IAAM,GAAG,GAAG,cAAc,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CA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Q,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE;QAC3B,IAAM,IAAI,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,IAAM,QAAQ,GAAG,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC5D,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE;QAC3B,IAAM,IAAI,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,IAAM,QAAQ,GAAG,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC5D,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/clone_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/clone_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/clone_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/clone_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/clone_test.js new file mode 100644 index 0000000..7b72a24 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/clone_test.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('clone', test_util_1.ALL_ENVS, function () { + it('returns a tensor with the same shape and value', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3]); + var aPrime = tf.clone(a); + expect(aPrime.shape).toEqual(a.shape); + test_util_1.expectArraysClose(aPrime, a); + }); + it('accepts a tensor-like object', function () { + var res = tf.clone([[1, 2, 3], [4, 5, 6]]); + expect(res.dtype).toBe('float32'); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6]); + }); +}); +//# sourceMappingURL=clone_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/clone_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/clone_test.js.map new file mode 100644 index 0000000..e0fc2fa --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/clone_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clone_test.js","sourceRoot":"","sources":["../../src/ops/clone_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,OAAO,EAAE,oBAAQ,EAAE;IACnC,EAAE,CAAC,gDAAgD,EAAE;QACnD,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3D,IAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACtC,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,6BAAiB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/compare.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/compare.d.ts new file mode 100644 index 0000000..f77a110 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/compare.d.ts @@ -0,0 +1,27 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function notEqual_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function notEqualStrict_(a: T | TensorLike, b: T | TensorLike): T; +declare function less_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function lessStrict_(a: T | TensorLike, b: T | TensorLike): T; +declare function equal_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function equalStrict_(a: T | TensorLike, b: T | TensorLike): T; +declare function lessEqual_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function lessEqualStrict_(a: T | TensorLike, b: T | TensorLike): T; +declare function greater_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function greaterStrict_(a: T | TensorLike, b: T | TensorLike): T; +declare function greaterEqual_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function greaterEqualStrict_(a: T | TensorLike, b: T | TensorLike): T; +export declare const equal: typeof equal_; +export declare const equalStrict: typeof equalStrict_; +export declare const greater: typeof greater_; +export declare const greaterEqual: typeof greaterEqual_; +export declare const greaterEqualStrict: typeof greaterEqualStrict_; +export declare const greaterStrict: typeof greaterStrict_; +export declare const less: typeof less_; +export declare const lessEqual: typeof lessEqual_; +export declare const lessEqualStrict: typeof lessEqualStrict_; +export declare const lessStrict: typeof lessStrict_; +export declare const notEqual: typeof notEqual_; +export declare const notEqualStrict: typeof notEqualStrict_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/compare.js b/node_modules/@tensorflow/tfjs-core/dist/ops/compare.js new file mode 100644 index 0000000..d4ea914 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/compare.js @@ -0,0 +1,99 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_1 = require("../tensor_util"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util_1 = require("../util"); +var broadcast_util_1 = require("./broadcast_util"); +var operation_1 = require("./operation"); +function notEqual_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'notEqual'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'notEqual'); + tensor_util_1.assertTypesMatch($a, $b); + broadcast_util_1.assertAndGetBroadcastShape($a.shape, $b.shape); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.notEqual($a, $b); }, { $a: $a, $b: $b }); +} +function notEqualStrict_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'notEqualStrict'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'notEqualStrict'); + util_1.assertShapesMatch($a.shape, $b.shape, 'Error in notEqualStrict: '); + return $a.notEqual($b); +} +function less_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'less'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'less'); + tensor_util_1.assertTypesMatch($a, $b); + broadcast_util_1.assertAndGetBroadcastShape($a.shape, $b.shape); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.less($a, $b); }, { $a: $a, $b: $b }); +} +function lessStrict_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'lessStrict'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'lessStrict'); + util_1.assertShapesMatch($a.shape, $b.shape, 'Error in lessStrict: '); + return $a.less($b); +} +function equal_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'equal'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'equal'); + tensor_util_1.assertTypesMatch($a, $b); + broadcast_util_1.assertAndGetBroadcastShape($a.shape, $b.shape); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.equal($a, $b); }, { $a: $a, $b: $b }); +} +function equalStrict_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'equalStrict'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'equalStrict'); + util_1.assertShapesMatch($a.shape, $b.shape, 'Error in equalStrict: '); + return $a.equal($b); +} +function lessEqual_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'lessEqual'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'lessEqual'); + tensor_util_1.assertTypesMatch($a, $b); + broadcast_util_1.assertAndGetBroadcastShape($a.shape, $b.shape); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.lessEqual($a, $b); }, { $a: $a, $b: $b }); +} +function lessEqualStrict_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'lessEqualStrict'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'lessEqualStrict'); + util_1.assertShapesMatch($a.shape, $b.shape, 'Error in lessEqualStrict: '); + return $a.lessEqual($b); +} +function greater_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'greater'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'greater'); + tensor_util_1.assertTypesMatch($a, $b); + broadcast_util_1.assertAndGetBroadcastShape($a.shape, $b.shape); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.greater($a, $b); }, { $a: $a, $b: $b }); +} +function greaterStrict_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'greaterStrict'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'greaterStrict'); + util_1.assertShapesMatch($a.shape, $b.shape, 'Error in greaterStrict: '); + return $a.greater($b); +} +function greaterEqual_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'greaterEqual'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'greaterEqual'); + tensor_util_1.assertTypesMatch($a, $b); + broadcast_util_1.assertAndGetBroadcastShape($a.shape, $b.shape); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.greaterEqual($a, $b); }, { $a: $a, $b: $b }); +} +function greaterEqualStrict_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'greaterEqualStrict'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'greaterEqualStrict'); + util_1.assertShapesMatch($a.shape, $b.shape, 'Error in greaterEqualStrict: '); + return $a.greaterEqual($b); +} +exports.equal = operation_1.op({ equal_: equal_ }); +exports.equalStrict = operation_1.op({ equalStrict_: equalStrict_ }); +exports.greater = operation_1.op({ greater_: greater_ }); +exports.greaterEqual = operation_1.op({ greaterEqual_: greaterEqual_ }); +exports.greaterEqualStrict = operation_1.op({ greaterEqualStrict_: greaterEqualStrict_ }); +exports.greaterStrict = operation_1.op({ greaterStrict_: greaterStrict_ }); +exports.less = operation_1.op({ less_: less_ }); +exports.lessEqual = operation_1.op({ lessEqual_: lessEqual_ }); +exports.lessEqualStrict = operation_1.op({ lessEqualStrict_: lessEqualStrict_ }); +exports.lessStrict = operation_1.op({ lessStrict_: lessStrict_ }); +exports.notEqual = operation_1.op({ notEqual_: notEqual_ }); +exports.notEqualStrict = operation_1.op({ notEqualStrict_: notEqualStrict_ }); +//# sourceMappingURL=compare.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/compare.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/compare.js.map new file mode 100644 index 0000000..826f987 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/compare.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/ops/compare.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,8CAAgD;AAChD,sDAAmD;AAEnD,gCAA0C;AAC1C,mDAA4D;AAC5D,yCAA+B;AAkB/B,mBACI,CAAoB,EAAE,CAAoB;IAC5C,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;IAC/C,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;IAC/C,8BAAgB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACzB,2CAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;IAC/C,OAAO,iBAAG,CAAC,MAAM,CAAC,SAAS,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,EAAxB,CAAwB,EAAE,EAAC,EAAE,IAAA,EAAE,EAAE,IAAA,EAAC,CACpE,CAAC;AACR,CAAC;AAUD,yBACI,CAAe,EAAE,CAAe;IAClC,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;IACrD,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;IACrD,wBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC;IACnE,OAAO,EAAE,CAAC,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AAC,CAAC;AACnB,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,eAAe,GAAG,cAAE,CAAC,EAAC,gBAAgB,kBAAA,EAAC,CAAC,CAAC;AACzC,QAAA,UAAU,GAAG,cAAE,CAAC,EAAC,WAAW,aAAA,EAAC,CAAC,CAAC;AAC/B,QAAA,QAAQ,GAAG,cAAE,CAAC,EAAC,SAAS,WAAA,EAAC,CAAC,CAAC;AAC3B,QAAA,cAAc,GAAG,cAAE,CAAC,EAAC,eAAe,iBAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/compareop_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/compareop_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/compareop_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/compareop_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/compareop_test.js new file mode 100644 index 0000000..199e98f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/compareop_test.js @@ -0,0 +1,1775 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var test_util_1 = require("../test_util"); +var jasmine_util_1 = require("../jasmine_util"); +jasmine_util_1.describeWithFlags('equal', test_util_1.ALL_ENVS, function () { + it('Tensor1D - int32', function () { + var a = tf.tensor1d([1, 4, 5], 'int32'); + var b = tf.tensor1d([2, 3, 5], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 1]); + a = tf.tensor1d([2, 2, 2], 'int32'); + b = tf.tensor1d([2, 2, 2], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 1, 1]); + a = tf.tensor1d([0, 0], 'int32'); + b = tf.tensor1d([3, 3], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0]); + }); + it('Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, 4.1, 5.1], 'float32'); + var b = tf.tensor1d([2.2, 3.2, 5.1], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 1]); + a = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + b = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 1, 1]); + a = tf.tensor1d([0.45, 0.123], 'float32'); + b = tf.tensor1d([3.123, 3.321], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0]); + }); + it('mismatched Tensor1D shapes - int32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + var b = tf.tensor1d([1, 2, 3], 'int32'); + var f = function () { + tf.equal(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatched Tensor1D shapes - float32', function () { + var a = tf.tensor1d([1.1, 2.1], 'float32'); + var b = tf.tensor1d([1.1, 2.1, 3.1], 'float32'); + var f = function () { + tf.equal(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, NaN, 2.1], 'float32'); + var b = tf.tensor1d([2.1, 3.1, NaN], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 0]); + }); + it('scalar and 1D broadcast', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([1, 2, 3, 4, 5, 2]); + var res = tf.equal(a, b); + expect(res.dtype).toBe('bool'); + expect(res.shape).toEqual([6]); + test_util_1.expectArraysEqual(res, [0, 1, 0, 0, 0, 1]); + }); + it('Tensor2D - int32', function () { + var a = tf.tensor2d([[1, 4, 5], [8, 9, 12]], [2, 3], 'int32'); + var b = tf.tensor2d([[2, 3, 6], [7, 10, 11]], [2, 3], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 0, 0, 0, 0]); + a = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + b = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 1, 1, 1]); + }); + it('Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, 4.1, 5.1], [8.1, 9.1, 12.1]], [2, 3], 'float32'); + var b = tf.tensor2d([[2.1, 4.1, 5.1], [7.1, 10.1, 11.1]], [2, 3], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 1, 1, 0, 0, 0]); + a = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + b = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 1, 1, 1]); + }); + it('broadcasting Tensor2D shapes - int32', function () { + var a = tf.tensor2d([[3], [7]], [2, 1], 'int32'); + var b = tf.tensor2d([[2, 3, 4], [7, 8, 9]], [2, 3], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 1, 0, 1, 0, 0]); + }); + it('broadcasting Tensor2D shapes - float32', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 1, 0, 1, 0, 0]); + }); + it('NaNs in Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + var b = tf.tensor2d([[0.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 1, 0]); + }); + it('2D and 2D broadcast each with 1 dim', function () { + var a = tf.tensor2d([1, 2, 5], [1, 3]); + var b = tf.tensor2d([5, 1], [2, 1]); + var res = tf.equal(a, b); + expect(res.dtype).toBe('bool'); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysEqual(res, [0, 0, 1, 1, 0, 0]); + }); + it('2D and scalar broadcast', function () { + var a = tf.tensor2d([1, 2, 3, 2, 5, 6], [2, 3]); + var b = tf.scalar(2); + var res = tf.equal(a, b); + expect(res.dtype).toBe('bool'); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysEqual(res, [0, 1, 0, 1, 0, 0]); + }); + it('Tensor3D - int32', function () { + var a = tf.tensor3d([[[1], [4], [5]], [[8], [9], [12]]], [2, 3, 1], 'int32'); + var b = tf.tensor3d([[[2], [3], [6]], [[7], [10], [12]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 0, 0, 0, 1]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 1, 1, 1, 1, 1]); + }); + it('Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [4.1], [5.1]], [[8.1], [9.1], [12.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[2.1], [3.1], [6.1]], [[7.1], [10.1], [12.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 0, 0, 0, 1]); + a = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + b = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 1, 1, 1, 1, 1]); + }); + it('broadcasting Tensor3D shapes - int32', function () { + var a = tf.tensor3d([[[1, 0], [2, 3], [4, 5]], [[6, 7], [9, 8], [10, 11]]], [2, 3, 2], 'int32'); + var b = tf.tensor3d([[[1], [2], [3]], [[7], [10], [9]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0]); + }); + it('broadcasting Tensor3D shapes - float32', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0]); + }); + it('NaNs in Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [NaN], [1.1]], [[0.1], [0.1], [0.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[0.1], [0.1], [1.1]], [[1.1], [0.1], [NaN]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 1, 0, 1, 0]); + }); + it('3D and scalar', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, -1], [2, 3, 1]); + var b = tf.scalar(-1); + var res = tf.equal(a, b); + expect(res.dtype).toBe('bool'); + expect(res.shape).toEqual([2, 3, 1]); + test_util_1.expectArraysEqual(res, [0, 0, 0, 0, 0, 1]); + }); + it('Tensor4D - int32', function () { + var a = tf.tensor4d([1, 4, 5, 8], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([2, 3, 6, 8], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 0, 1]); + a = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 1, 1, 1]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([2, 2, 2, 2], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 0, 0]); + }); + it('Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, 4.1, 5.1, 8.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([2.1, 3.1, 6.1, 8.1], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 0, 1]); + a = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 1, 1, 1]); + a = tf.tensor4d([0.1, 0.1, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([1.1, 1.1, 1.1, 1.1], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 0, 0]); + }); + it('broadcasting Tensor4D shapes - int32', function () { + var a = tf.tensor4d([1, 2, 5, 9], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([[[[1, 2]], [[3, 4]]], [[[5, 6]], [[7, 8]]]], [2, 2, 1, 2], 'int32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 0, 0, 0, 1, 0, 0, 0]); + }); + it('broadcasting Tensor4D shapes - float32', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [1, 0, 0, 0, 1, 0, 0, 0]); + }); + it('NaNs in Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, NaN, 1.1, 0.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([0.1, 1.1, 1.1, NaN], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 1, 0]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.equal({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'equal' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.equal(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'equal' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + test_util_1.expectArraysClose(tf.equal(a, b), [0, 0, 1]); + }); +}); +jasmine_util_1.describeWithFlags('equalStrict', test_util_1.ALL_ENVS, function () { + it('Tensor1D - int32', function () { + var a = tf.tensor1d([1, 4, 5], 'int32'); + var b = tf.tensor1d([2, 3, 5], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 1]); + a = tf.tensor1d([2, 2, 2], 'int32'); + b = tf.tensor1d([2, 2, 2], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [1, 1, 1]); + a = tf.tensor1d([0, 0], 'int32'); + b = tf.tensor1d([3, 3], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0]); + }); + it('Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, 4.1, 5.1], 'float32'); + var b = tf.tensor1d([2.2, 3.2, 5.1], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 1]); + a = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + b = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [1, 1, 1]); + a = tf.tensor1d([0.45, 0.123], 'float32'); + b = tf.tensor1d([3.123, 3.321], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0]); + }); + it('mismatched Tensor1D shapes - int32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + var b = tf.tensor1d([1, 2, 3], 'int32'); + var f = function () { + tf.equalStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatched Tensor1D shapes - float32', function () { + var a = tf.tensor1d([1.1, 2.1], 'float32'); + var b = tf.tensor1d([1.1, 2.1, 3.1], 'float32'); + var f = function () { + tf.equalStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, NaN, 2.1], 'float32'); + var b = tf.tensor1d([2.1, 3.1, NaN], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 0]); + }); + it('Tensor2D - int32', function () { + var a = tf.tensor2d([[1, 4, 5], [8, 9, 12]], [2, 3], 'int32'); + var b = tf.tensor2d([[2, 3, 6], [7, 10, 11]], [2, 3], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 0, 0, 0, 0]); + a = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + b = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [1, 1, 1, 1]); + }); + it('Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, 4.1, 5.1], [8.1, 9.1, 12.1]], [2, 3], 'float32'); + var b = tf.tensor2d([[2.1, 4.1, 5.1], [7.1, 10.1, 11.1]], [2, 3], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 1, 1, 0, 0, 0]); + a = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + b = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [1, 1, 1, 1]); + }); + it('mismatch Tensor2D shapes - int32', function () { + var a = tf.tensor2d([[3], [7]], [2, 1], 'int32'); + var b = tf.tensor2d([[2, 3, 4], [7, 8, 9]], [2, 3], 'int32'); + var f = function () { + tf.equalStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatch Tensor2D shapes - float32', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + var f = function () { + tf.equalStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + var b = tf.tensor2d([[0.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 1, 0]); + }); + it('Tensor3D - int32', function () { + var a = tf.tensor3d([[[1], [4], [5]], [[8], [9], [12]]], [2, 3, 1], 'int32'); + var b = tf.tensor3d([[[2], [3], [6]], [[7], [10], [12]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 0, 0, 0, 1]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [1, 1, 1, 1, 1, 1]); + }); + it('Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [4.1], [5.1]], [[8.1], [9.1], [12.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[2.1], [3.1], [6.1]], [[7.1], [10.1], [12.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 0, 0, 0, 1]); + a = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + b = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [1, 1, 1, 1, 1, 1]); + }); + it('mismatch Tensor3D shapes - int32', function () { + var a = tf.tensor3d([[[1, 0], [2, 3], [4, 5]], [[6, 7], [9, 8], [10, 11]]], [2, 3, 2], 'int32'); + var b = tf.tensor3d([[[1], [2], [3]], [[7], [10], [9]]], [2, 3, 1], 'int32'); + var f = function () { + tf.equalStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatch Tensor3D shapes - float32', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + var f = function () { + tf.equalStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [NaN], [1.1]], [[0.1], [0.1], [0.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[0.1], [0.1], [1.1]], [[1.1], [0.1], [NaN]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 1, 0, 1, 0]); + }); + it('Tensor4D - int32', function () { + var a = tf.tensor4d([1, 4, 5, 8], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([2, 3, 6, 8], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 0, 1]); + a = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [1, 1, 1, 1]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([2, 2, 2, 2], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 0, 0]); + }); + it('Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, 4.1, 5.1, 8.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([2.1, 3.1, 6.1, 8.1], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 0, 1]); + a = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [1, 1, 1, 1]); + a = tf.tensor4d([0.1, 0.1, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([1.1, 1.1, 1.1, 1.1], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 0, 0]); + }); + it('mismatch Tensor4D shapes - int32', function () { + var a = tf.tensor4d([1, 2, 5, 9], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([[[[1, 2]], [[3, 4]]], [[[5, 6]], [[7, 8]]]], [2, 2, 1, 2], 'int32'); + var f = function () { + tf.equalStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatch Tensor4D shapes - float32', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + var f = function () { + tf.equalStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, NaN, 1.1, 0.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([0.1, 1.1, 1.1, NaN], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 1, 0]); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + test_util_1.expectArraysClose(tf.equalStrict(a, b), [0, 0, 1]); + }); +}); +jasmine_util_1.describeWithFlags('notEqual', test_util_1.ALL_ENVS, function () { + it('Tensor1D - int32', function () { + var a = tf.tensor1d([1, 4, 5], 'int32'); + var b = tf.tensor1d([2, 3, 5], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 0]); + a = tf.tensor1d([2, 2, 2], 'int32'); + b = tf.tensor1d([2, 2, 2], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 0, 0]); + a = tf.tensor1d([0, 0], 'int32'); + b = tf.tensor1d([3, 3], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1]); + }); + it('Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, 4.1, 5.1], 'float32'); + var b = tf.tensor1d([2.2, 3.2, 5.1], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 0]); + a = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + b = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 0, 0]); + a = tf.tensor1d([0.45, 0.123], 'float32'); + b = tf.tensor1d([3.123, 3.321], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1]); + }); + it('mismatched Tensor1D shapes - int32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + var b = tf.tensor1d([1, 2, 3], 'int32'); + var f = function () { + tf.notEqual(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatched Tensor1D shapes - float32', function () { + var a = tf.tensor1d([1.1, 2.1], 'float32'); + var b = tf.tensor1d([1.1, 2.1, 3.1], 'float32'); + var f = function () { + tf.notEqual(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, NaN, 2.1], 'float32'); + var b = tf.tensor1d([2.1, 3.1, NaN], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 1]); + }); + it('works with NaNs', function () { + var a = tf.tensor1d([2, 5, NaN]); + var b = tf.tensor1d([4, 5, -1]); + var res = tf.notEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysEqual(res, [1, 0, 1]); + }); + it('scalar and 1D broadcast', function () { + var a = tf.scalar(2); + var b = tf.tensor1d([1, 2, 3, 4, 5, 2]); + var res = tf.notEqual(a, b); + expect(res.dtype).toBe('bool'); + expect(res.shape).toEqual([6]); + test_util_1.expectArraysEqual(res, [1, 0, 1, 1, 1, 0]); + }); + it('Tensor2D - int32', function () { + var a = tf.tensor2d([[1, 4, 5], [8, 9, 12]], [2, 3], 'int32'); + var b = tf.tensor2d([[2, 3, 6], [7, 10, 11]], [2, 3], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 1, 1, 1, 1]); + a = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + b = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 0, 0, 0]); + }); + it('Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, 4.1, 5.1], [8.1, 9.1, 12.1]], [2, 3], 'float32'); + var b = tf.tensor2d([[2.1, 4.1, 5.1], [7.1, 10.1, 11.1]], [2, 3], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 0, 0, 1, 1, 1]); + a = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + b = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 0, 0, 0]); + }); + it('broadcasting Tensor2D shapes - int32', function () { + var a = tf.tensor2d([[3], [7]], [2, 1], 'int32'); + var b = tf.tensor2d([[2, 3, 4], [7, 8, 9]], [2, 3], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 0, 1, 0, 1, 1]); + }); + it('broadcasting Tensor2D shapes - float32', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 0, 1, 0, 1, 1]); + }); + it('NaNs in Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + var b = tf.tensor2d([[0.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 0, 1]); + }); + it('2D and scalar broadcast', function () { + var a = tf.tensor2d([1, 2, 3, 2, 5, 6], [2, 3]); + var b = tf.scalar(2); + var res = tf.notEqual(a, b); + expect(res.dtype).toBe('bool'); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysEqual(res, [1, 0, 1, 0, 1, 1]); + }); + it('2D and 2D broadcast each with 1 dim', function () { + var a = tf.tensor2d([1, 2, 5], [1, 3]); + var b = tf.tensor2d([5, 1], [2, 1]); + var res = tf.notEqual(a, b); + expect(res.dtype).toBe('bool'); + expect(res.shape).toEqual([2, 3]); + test_util_1.expectArraysEqual(res, [1, 1, 0, 0, 1, 1]); + }); + it('Tensor3D - int32', function () { + var a = tf.tensor3d([[[1], [4], [5]], [[8], [9], [12]]], [2, 3, 1], 'int32'); + var b = tf.tensor3d([[[2], [3], [6]], [[7], [10], [12]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 1, 1, 1, 0]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 0, 0, 0, 0, 0]); + }); + it('Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [4.1], [5.1]], [[8.1], [9.1], [12.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[2.1], [3.1], [6.1]], [[7.1], [10.1], [12.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 1, 1, 1, 0]); + a = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + b = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 0, 0, 0, 0, 0]); + }); + it('broadcasting Tensor3D shapes - int32', function () { + var a = tf.tensor3d([[[1, 0], [2, 3], [4, 5]], [[6, 7], [9, 8], [10, 11]]], [2, 3, 2], 'int32'); + var b = tf.tensor3d([[[1], [2], [3]], [[7], [10], [9]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1]); + }); + it('broadcasting Tensor3D shapes - float32', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1]); + }); + it('NaNs in Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [NaN], [1.1]], [[0.1], [0.1], [0.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[0.1], [0.1], [1.1]], [[1.1], [0.1], [NaN]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 0, 1, 0, 1]); + }); + it('3D and scalar', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, -1], [2, 3, 1]); + var b = tf.scalar(-1); + var res = tf.notEqual(a, b); + expect(res.dtype).toBe('bool'); + expect(res.shape).toEqual([2, 3, 1]); + test_util_1.expectArraysEqual(res, [1, 1, 1, 1, 1, 0]); + }); + it('Tensor4D - int32', function () { + var a = tf.tensor4d([1, 4, 5, 8], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([2, 3, 6, 8], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 1, 0]); + a = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 0, 0, 0]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([2, 2, 2, 2], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 1, 1]); + }); + it('Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, 4.1, 5.1, 8.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([2.1, 3.1, 6.1, 8.1], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 1, 0]); + a = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 0, 0, 0]); + a = tf.tensor4d([0.1, 0.1, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([1.1, 1.1, 1.1, 1.1], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 1, 1]); + }); + it('broadcasting Tensor4D shapes - int32', function () { + var a = tf.tensor4d([1, 2, 5, 9], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([[[[1, 2]], [[3, 4]]], [[[5, 6]], [[7, 8]]]], [2, 2, 1, 2], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 1, 1, 1, 0, 1, 1, 1]); + }); + it('broadcasting Tensor4D shapes - float32', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [0, 1, 1, 1, 0, 1, 1, 1]); + }); + it('NaNs in Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, NaN, 1.1, 0.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([0.1, 1.1, 1.1, NaN], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 0, 1]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.notEqual({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'notEqual' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.notEqual(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'notEqual' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = tf.tensor1d([1, 4, 5], 'int32'); + var b = tf.tensor1d([2, 3, 5], 'int32'); + test_util_1.expectArraysClose(tf.notEqual(a, b), [1, 1, 0]); + }); +}); +jasmine_util_1.describeWithFlags('notEqualStrict', test_util_1.ALL_ENVS, function () { + it('Tensor1D - int32', function () { + var a = tf.tensor1d([1, 4, 5], 'int32'); + var b = tf.tensor1d([2, 3, 5], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 0]); + a = tf.tensor1d([2, 2, 2], 'int32'); + b = tf.tensor1d([2, 2, 2], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [0, 0, 0]); + a = tf.tensor1d([0, 0], 'int32'); + b = tf.tensor1d([3, 3], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1]); + }); + it('Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, 4.1, 5.1], 'float32'); + var b = tf.tensor1d([2.2, 3.2, 5.1], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 0]); + a = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + b = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [0, 0, 0]); + a = tf.tensor1d([0.45, 0.123], 'float32'); + b = tf.tensor1d([3.123, 3.321], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1]); + }); + it('mismatched Tensor1D shapes - int32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + var b = tf.tensor1d([1, 2, 3], 'int32'); + var f = function () { + tf.notEqualStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatched Tensor1D shapes - float32', function () { + var a = tf.tensor1d([1.1, 2.1], 'float32'); + var b = tf.tensor1d([1.1, 2.1, 3.1], 'float32'); + var f = function () { + tf.notEqualStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, NaN, 2.1], 'float32'); + var b = tf.tensor1d([2.1, 3.1, NaN], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 1]); + }); + it('strict version throws when x and y are different shape', function () { + var a = tf.tensor1d([2]); + var b = tf.tensor1d([4, 2, -1]); + expect(function () { return tf.notEqualStrict(a, b); }).toThrowError(); + expect(function () { return tf.notEqualStrict(b, a); }).toThrowError(); + }); + it('Tensor2D - int32', function () { + var a = tf.tensor2d([[1, 4, 5], [8, 9, 12]], [2, 3], 'int32'); + var b = tf.tensor2d([[2, 3, 6], [7, 10, 11]], [2, 3], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 1, 1, 1, 1]); + a = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + b = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [0, 0, 0, 0]); + }); + it('Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, 4.1, 5.1], [8.1, 9.1, 12.1]], [2, 3], 'float32'); + var b = tf.tensor2d([[2.1, 4.1, 5.1], [7.1, 10.1, 11.1]], [2, 3], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 0, 0, 1, 1, 1]); + a = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + b = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [0, 0, 0, 0]); + }); + it('mismatch Tensor2D shapes - int32', function () { + var a = tf.tensor2d([[3], [7]], [2, 1], 'int32'); + var b = tf.tensor2d([[2, 3, 4], [7, 8, 9]], [2, 3], 'int32'); + var f = function () { + tf.notEqualStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatch Tensor2D shapes - float32', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + var f = function () { + tf.notEqualStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + var b = tf.tensor2d([[0.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 0, 1]); + }); + it('Tensor3D - int32', function () { + var a = tf.tensor3d([[[1], [4], [5]], [[8], [9], [12]]], [2, 3, 1], 'int32'); + var b = tf.tensor3d([[[2], [3], [6]], [[7], [10], [12]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 1, 1, 1, 0]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [0, 0, 0, 0, 0, 0]); + }); + it('Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [4.1], [5.1]], [[8.1], [9.1], [12.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[2.1], [3.1], [6.1]], [[7.1], [10.1], [12.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 1, 1, 1, 0]); + a = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + b = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [0, 0, 0, 0, 0, 0]); + }); + it('mismatch Tensor3D shapes - int32', function () { + var a = tf.tensor3d([[[1, 0], [2, 3], [4, 5]], [[6, 7], [9, 8], [10, 11]]], [2, 3, 2], 'int32'); + var b = tf.tensor3d([[[1], [2], [3]], [[7], [10], [9]]], [2, 3, 1], 'int32'); + var f = function () { + tf.notEqualStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatch Tensor3D shapes - float32', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + var f = function () { + tf.notEqualStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [NaN], [1.1]], [[0.1], [0.1], [0.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[0.1], [0.1], [1.1]], [[1.1], [0.1], [NaN]]], [2, 3, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 0, 1, 0, 1]); + }); + it('Tensor4D - int32', function () { + var a = tf.tensor4d([1, 4, 5, 8], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([2, 3, 6, 8], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 1, 0]); + a = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [0, 0, 0, 0]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([2, 2, 2, 2], [2, 2, 1, 1], 'int32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 1, 1]); + }); + it('Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, 4.1, 5.1, 8.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([2.1, 3.1, 6.1, 8.1], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 1, 0]); + a = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [0, 0, 0, 0]); + a = tf.tensor4d([0.1, 0.1, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([1.1, 1.1, 1.1, 1.1], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 1, 1]); + }); + it('mismatch Tensor4D shapes - int32', function () { + var a = tf.tensor4d([1, 2, 5, 9], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([[[[1, 2]], [[3, 4]]], [[[5, 6]], [[7, 8]]]], [2, 2, 1, 2], 'int32'); + var f = function () { + tf.notEqualStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatch Tensor4D shapes - float32', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + var f = function () { + tf.notEqualStrict(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, NaN, 1.1, 0.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([0.1, 1.1, 1.1, NaN], [2, 2, 1, 1], 'float32'); + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 0, 1]); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + test_util_1.expectArraysClose(tf.notEqualStrict(a, b), [1, 1, 0]); + }); +}); +jasmine_util_1.describeWithFlags('less', test_util_1.ALL_ENVS, function () { + it('Tensor1D - int32', function () { + var a = tf.tensor1d([1, 4, 5], 'int32'); + var b = tf.tensor1d([2, 3, 5], 'int32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0]); + a = tf.tensor1d([2, 2, 2], 'int32'); + b = tf.tensor1d([2, 2, 2], 'int32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0]); + a = tf.tensor1d([0, 0], 'int32'); + b = tf.tensor1d([3, 3], 'int32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1]); + }); + it('Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, 4.1, 5.1], 'float32'); + var b = tf.tensor1d([2.2, 3.2, 5.1], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0]); + a = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + b = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0]); + a = tf.tensor1d([0.45, 0.123], 'float32'); + b = tf.tensor1d([3.123, 3.321], 'float32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1]); + }); + it('mismatched Tensor1D shapes - int32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + var b = tf.tensor1d([1, 2, 3], 'int32'); + var f = function () { + tf.less(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatched Tensor1D shapes - float32', function () { + var a = tf.tensor1d([1.1, 2.1], 'float32'); + var b = tf.tensor1d([1.1, 2.1, 3.1], 'float32'); + var f = function () { + tf.less(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, NaN, 2.1], 'float32'); + var b = tf.tensor1d([2.1, 3.1, NaN], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0]); + }); + it('Tensor2D - int32', function () { + var a = tf.tensor2d([[1, 4, 5], [8, 9, 12]], [2, 3], 'int32'); + var b = tf.tensor2d([[2, 3, 6], [7, 10, 11]], [2, 3], 'int32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0, 1, 0]); + a = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + b = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + }); + it('Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, 4.1, 5.1], [8.1, 9.1, 12.1]], [2, 3], 'float32'); + var b = tf.tensor2d([[2.1, 3.1, 6.1], [7.1, 10.1, 11.1]], [2, 3], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0, 1, 0]); + a = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + b = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + }); + it('broadcasting Tensor2D shapes - int32', function () { + var a = tf.tensor2d([[3], [7]], [2, 1], 'int32'); + var b = tf.tensor2d([[2, 3, 4], [7, 8, 9]], [2, 3], 'int32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 1, 0, 1, 1]); + }); + it('broadcasting Tensor2D shapes - float32', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 1, 0, 1, 1]); + }); + it('NaNs in Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, NaN], [0.1, NaN]], [2, 2], 'float32'); + var b = tf.tensor2d([[0.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 1, 0]); + }); + it('Tensor3D - int32', function () { + var a = tf.tensor3d([[[1], [4], [5]], [[8], [9], [12]]], [2, 3, 1], 'int32'); + var b = tf.tensor3d([[[2], [3], [6]], [[7], [10], [11]]], [2, 3, 1], 'int32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0, 1, 0]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 0, 0]); + }); + it('Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [4.1], [5.1]], [[8.1], [9.1], [12.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[2.1], [3.1], [6.1]], [[7.1], [10.1], [11.1]]], [2, 3, 1], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0, 1, 0]); + a = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.0]]], [2, 3, 1], 'float32'); + b = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 0, 1]); + }); + it('broadcasting Tensor3D shapes - int32', function () { + var a = tf.tensor3d([[[1, 0], [2, 3], [4, 5]], [[6, 7], [9, 8], [10, 11]]], [2, 3, 2], 'int32'); + var b = tf.tensor3d([[[1], [2], [3]], [[7], [10], [9]]], [2, 3, 1], 'int32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0]); + }); + it('broadcasting Tensor3D float32', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0]); + }); + it('NaNs in Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [NaN], [1.1]], [[0.1], [0.1], [0.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[0.1], [0.1], [1.1]], [[1.1], [0.1], [NaN]]], [2, 3, 1], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 1, 0, 0]); + }); + it('Tensor4D - int32', function () { + var a = tf.tensor4d([1, 4, 5, 8], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([2, 3, 6, 7], [2, 2, 1, 1], 'int32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0]); + a = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([2, 2, 2, 2], [2, 2, 1, 1], 'int32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, 4.1, 5.1, 8.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([2.1, 3.1, 6.1, 7.1], [2, 2, 1, 1], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0]); + a = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + a = tf.tensor4d([0.1, 0.1, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([1.1, 1.1, 1.1, 1.1], [2, 2, 1, 1], 'float32'); + res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('broadcasting Tensor4D shapes - int32', function () { + var a = tf.tensor4d([1, 2, 5, 9], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([[[[1, 2]], [[3, 4]]], [[[5, 6]], [[7, 8]]]], [2, 2, 1, 2], 'int32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 1, 1, 0, 1, 0, 0]); + }); + it('broadcasting Tensor4D shapes - float32', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 1, 1, 0, 1, 0, 0]); + }); + it('NaNs in Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, NaN, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([0.1, 1.1, 1.1, NaN], [2, 2, 1, 1], 'float32'); + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 1, 0]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.less({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'less' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.less(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'less' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + var res = tf.less(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0]); + }); +}); +jasmine_util_1.describeWithFlags('lessStrict', test_util_1.ALL_ENVS, function () { + it('Tensor1D - strict version throws when a and b are different shape', function () { + var a = tf.tensor1d([2]); + var b = tf.tensor1d([4, 2, -1]); + expect(function () { return tf.lessStrict(a, b); }).toThrowError(); + expect(function () { return tf.lessStrict(b, a); }).toThrowError(); + }); + it('Tensor2D - strict version throws when a and b are different shape', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + expect(function () { return tf.lessStrict(a, b); }).toThrowError(); + expect(function () { return tf.lessStrict(b, a); }).toThrowError(); + }); + it('Tensor3D - strict version throws when a and b are different shape', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + expect(function () { return tf.lessStrict(a, b); }).toThrowError(); + expect(function () { return tf.lessStrict(b, a); }).toThrowError(); + }); + it('Tensor4D - strict version throws when a and b are different shape', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + expect(function () { return tf.lessStrict(a, b); }).toThrowError(); + expect(function () { return tf.lessStrict(b, a); }).toThrowError(); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + var res = tf.lessStrict(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0]); + }); +}); +jasmine_util_1.describeWithFlags('lessEqual', test_util_1.ALL_ENVS, function () { + it('Tensor1D - int32', function () { + var a = tf.tensor1d([1, 4, 5], 'int32'); + var b = tf.tensor1d([2, 3, 5], 'int32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1]); + a = tf.tensor1d([2, 2, 2], 'int32'); + b = tf.tensor1d([2, 2, 2], 'int32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1]); + a = tf.tensor1d([0, 0], 'int32'); + b = tf.tensor1d([3, 3], 'int32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1]); + }); + it('Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, 4.1, 5.1], 'float32'); + var b = tf.tensor1d([2.2, 3.2, 5.1], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1]); + a = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + b = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1]); + a = tf.tensor1d([0.45, 0.123], 'float32'); + b = tf.tensor1d([3.123, 3.321], 'float32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1]); + }); + it('mismatched Tensor1D shapes - int32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + var b = tf.tensor1d([1, 2, 3], 'int32'); + var f = function () { + tf.lessEqual(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatched Tensor1D shapes - float32', function () { + var a = tf.tensor1d([1.1, 2.1], 'float32'); + var b = tf.tensor1d([1.1, 2.1, 3.1], 'float32'); + var f = function () { + tf.lessEqual(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, NaN, 2.1], 'float32'); + var b = tf.tensor1d([2.1, 3.1, NaN], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0]); + }); + it('Tensor2D - int32', function () { + var a = tf.tensor2d([[1, 4, 5], [8, 9, 12]], [2, 3], 'int32'); + var b = tf.tensor2d([[2, 3, 6], [7, 10, 11]], [2, 3], 'int32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0, 1, 0]); + a = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + b = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, 4.1, 5.1], [8.1, 9.1, 12.1]], [2, 3], 'float32'); + var b = tf.tensor2d([[2.1, 3.1, 6.1], [7.1, 10.1, 11.1]], [2, 3], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0, 1, 0]); + a = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + b = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('broadcasting Tensor2D shapes - int32', function () { + var a = tf.tensor2d([[3], [7]], [2, 1], 'int32'); + var b = tf.tensor2d([[2, 3, 4], [7, 8, 9]], [2, 3], 'int32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 1, 1, 1, 1]); + }); + it('broadcasting Tensor2D shapes - float32', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 1, 1, 1, 1]); + }); + it('NaNs in Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, NaN], [0.1, NaN]], [2, 2], 'float32'); + var b = tf.tensor2d([[0.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 1, 0]); + }); + it('Tensor3D - int32', function () { + var a = tf.tensor3d([[[1], [4], [5]], [[8], [9], [12]]], [2, 3, 1], 'int32'); + var b = tf.tensor3d([[[2], [3], [6]], [[7], [10], [11]]], [2, 3, 1], 'int32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0, 1, 0]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1, 1, 1]); + }); + it('Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [4.1], [5.1]], [[8.1], [9.1], [12.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[2.1], [3.1], [6.1]], [[7.1], [10.1], [11.1]]], [2, 3, 1], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0, 1, 0]); + a = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.2]]], [2, 3, 1], 'float32'); + b = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1, 1, 0]); + }); + it('broadcasting Tensor3D shapes - int32', function () { + var a = tf.tensor3d([[[1, 0], [2, 3], [4, 5]], [[6, 7], [9, 8], [10, 11]]], [2, 3, 2], 'int32'); + var b = tf.tensor3d([[[1], [2], [3]], [[7], [10], [9]]], [2, 3, 1], 'int32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0]); + }); + it('broadcasting Tensor3D float32', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0]); + }); + it('NaNs in Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [NaN], [1.1]], [[0.1], [0.1], [0.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[0.1], [0.1], [1.1]], [[1.1], [0.1], [NaN]]], [2, 3, 1], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 1, 1, 1, 0]); + }); + it('Tensor4D - int32', function () { + var a = tf.tensor4d([1, 4, 5, 8], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([2, 3, 6, 7], [2, 2, 1, 1], 'int32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0]); + a = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([2, 2, 2, 2], [2, 2, 1, 1], 'int32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, 4.1, 5.1, 8.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([2.1, 3.1, 6.1, 7.1], [2, 2, 1, 1], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0]); + a = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + a = tf.tensor4d([0.1, 0.1, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([1.1, 1.1, 1.1, 1.1], [2, 2, 1, 1], 'float32'); + res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('broadcasting Tensor4D shapes - int32', function () { + var a = tf.tensor4d([1, 2, 5, 9], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([[[[1, 2]], [[3, 4]]], [[[5, 6]], [[7, 8]]]], [2, 2, 1, 2], 'int32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1, 1, 1, 0, 0]); + }); + it('broadcasting Tensor4D shapes - float32', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1, 1, 1, 0, 0]); + }); + it('NaNs in Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, NaN, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([0.1, 1.1, 1.1, NaN], [2, 2, 1, 1], 'float32'); + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 1, 0]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.lessEqual({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'lessEqual' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.lessEqual(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'lessEqual' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + var res = tf.lessEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1]); + }); +}); +jasmine_util_1.describeWithFlags('lessEqualStrict', test_util_1.ALL_ENVS, function () { + it('Tensor1D - strict version throws when a and b are different shape', function () { + var a = tf.tensor1d([2]); + var b = tf.tensor1d([4, 2, -1]); + expect(function () { return tf.lessEqualStrict(a, b); }).toThrowError(); + expect(function () { return tf.lessEqualStrict(b, a); }).toThrowError(); + }); + it('Tensor2D - strict version throws when a and b are different shape', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + expect(function () { return tf.lessEqualStrict(a, b); }).toThrowError(); + expect(function () { return tf.lessEqualStrict(b, a); }).toThrowError(); + }); + it('Tensor3D - strict version throws when a and b are different shape', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + expect(function () { return tf.lessEqualStrict(a, b); }).toThrowError(); + expect(function () { return tf.lessEqualStrict(b, a); }).toThrowError(); + }); + it('Tensor4D - strict version throws when a and b are different shape', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + expect(function () { return tf.lessEqualStrict(a, b); }).toThrowError(); + expect(function () { return tf.lessEqualStrict(b, a); }).toThrowError(); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + var res = tf.lessEqualStrict(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1]); + }); +}); +jasmine_util_1.describeWithFlags('greater', test_util_1.ALL_ENVS, function () { + it('Tensor1D - int32', function () { + var a = tf.tensor1d([1, 4, 5], 'int32'); + var b = tf.tensor1d([2, 3, 5], 'int32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0]); + a = tf.tensor1d([2, 2, 2], 'int32'); + b = tf.tensor1d([2, 2, 2], 'int32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0]); + a = tf.tensor1d([3, 3], 'int32'); + b = tf.tensor1d([0, 0], 'int32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1]); + }); + it('Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, 4.1, 5.1], 'float32'); + var b = tf.tensor1d([2.2, 3.2, 5.1], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0]); + a = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + b = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0]); + a = tf.tensor1d([3.123, 3.321], 'float32'); + b = tf.tensor1d([0.45, 0.123], 'float32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1]); + }); + it('mismatched Tensor1D shapes - int32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + var b = tf.tensor1d([1, 2, 3], 'int32'); + var f = function () { + tf.greater(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatched Tensor1D shapes - float32', function () { + var a = tf.tensor1d([1.1, 2.1], 'float32'); + var b = tf.tensor1d([1.1, 2.1, 3.1], 'float32'); + var f = function () { + tf.greater(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, NaN, 2.1], 'float32'); + var b = tf.tensor1d([2.1, 3.1, NaN], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0]); + }); + it('Tensor2D - int32', function () { + var a = tf.tensor2d([[1, 4, 5], [8, 9, 11]], [2, 3], 'int32'); + var b = tf.tensor2d([[2, 3, 6], [7, 10, 11]], [2, 3], 'int32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1, 0, 0]); + a = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + b = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + }); + it('Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, 4.1, 5.1], [8.1, 9.1, 11.1]], [2, 3], 'float32'); + var b = tf.tensor2d([[2.1, 3.1, 6.1], [7.1, 10.1, 11.1]], [2, 3], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1, 0, 0]); + a = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + b = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + }); + it('broadcasting Tensor2D shapes - int32', function () { + var a = tf.tensor2d([[3], [7]], [2, 1], 'int32'); + var b = tf.tensor2d([[2, 3, 4], [7, 8, 9]], [2, 3], 'int32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0, 0, 0, 0]); + }); + it('broadcasting Tensor2D shapes - float32', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0, 0, 0, 0]); + }); + it('NaNs in Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, NaN], [0.1, NaN]], [2, 2], 'float32'); + var b = tf.tensor2d([[0.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0, 0]); + }); + it('Tensor3D - int32', function () { + var a = tf.tensor3d([[[1], [4], [5]], [[8], [9], [11]]], [2, 3, 1], 'int32'); + var b = tf.tensor3d([[[2], [3], [6]], [[7], [10], [11]]], [2, 3, 1], 'int32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1, 0, 0]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 0, 0]); + }); + it('Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [4.1], [5.1]], [[8.1], [9.1], [11.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[2.1], [3.1], [6.1]], [[7.1], [10.1], [11.1]]], [2, 3, 1], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1, 0, 0]); + a = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.2]]], [2, 3, 1], 'float32'); + b = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 0, 1]); + }); + it('broadcasting Tensor3D shapes - int32', function () { + var a = tf.tensor3d([[[1, 0], [2, 3], [4, 5]], [[6, 7], [9, 8], [10, 11]]], [2, 3, 2], 'int32'); + var b = tf.tensor3d([[[1], [2], [3]], [[7], [10], [9]]], [2, 3, 1], 'int32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1]); + }); + it('broadcasting Tensor3D float32', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1]); + }); + it('NaNs in Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [NaN], [1.1]], [[0.1], [0.1], [0.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[0.1], [0.1], [1.1]], [[1.1], [0.1], [NaN]]], [2, 3, 1], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0, 0, 0, 0]); + }); + it('Tensor4D - int32', function () { + var a = tf.tensor4d([1, 4, 5, 8], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([2, 3, 6, 8], [2, 2, 1, 1], 'int32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 0]); + a = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + a = tf.tensor4d([2, 2, 2, 2], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'int32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, 4.1, 5.1, 8.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([2.1, 3.1, 6.1, 8.1], [2, 2, 1, 1], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 0]); + a = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + a = tf.tensor4d([1.1, 1.1, 1.1, 1.1], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([0.1, 0.1, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('broadcasting Tensor4D shapes - int32', function () { + var a = tf.tensor4d([1, 2, 5, 9], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([[[[1, 2]], [[3, 4]]], [[[5, 6]], [[7, 8]]]], [2, 2, 1, 2], 'int32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 0, 0, 1, 1]); + }); + it('broadcasting Tensor4D shapes - float32', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 0, 0, 1, 1]); + }); + it('NaNs in Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, NaN, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([0.1, 1.1, 1.1, NaN], [2, 2, 1, 1], 'float32'); + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0, 0]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.greater({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'greater' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.greater(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'greater' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + var res = tf.greater(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0]); + }); +}); +jasmine_util_1.describeWithFlags('greaterStrict', test_util_1.ALL_ENVS, function () { + it('Tensor1D - strict version throws when a and b are different shape', function () { + var a = tf.tensor1d([2]); + var b = tf.tensor1d([4, 2, -1]); + expect(function () { return tf.greaterStrict(a, b); }).toThrowError(); + expect(function () { return tf.greaterStrict(b, a); }).toThrowError(); + }); + it('Tensor2D - strict version throws when a and b are different shape', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + expect(function () { return tf.greaterStrict(a, b); }).toThrowError(); + expect(function () { return tf.greaterStrict(b, a); }).toThrowError(); + }); + it('Tensor3D - strict version throws when a and b are different shape', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + expect(function () { return tf.greaterStrict(a, b); }).toThrowError(); + expect(function () { return tf.greaterStrict(b, a); }).toThrowError(); + }); + it('Tensor4D - strict version throws when a and b are different shape', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + expect(function () { return tf.greaterStrict(a, b); }).toThrowError(); + expect(function () { return tf.greaterStrict(b, a); }).toThrowError(); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + var res = tf.greaterStrict(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0]); + }); +}); +jasmine_util_1.describeWithFlags('greaterEqual', test_util_1.ALL_ENVS, function () { + it('Tensor1D - int32', function () { + var a = tf.tensor1d([1, 4, 5], 'int32'); + var b = tf.tensor1d([2, 3, 5], 'int32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 1]); + a = tf.tensor1d([2, 2, 2], 'int32'); + b = tf.tensor1d([2, 2, 2], 'int32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1]); + a = tf.tensor1d([0, 0], 'int32'); + b = tf.tensor1d([3, 3], 'int32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0]); + }); + it('Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, 4.1, 5.1], 'float32'); + var b = tf.tensor1d([2.2, 3.2, 5.1], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 1]); + a = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + b = tf.tensor1d([2.31, 2.31, 2.31], 'float32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1]); + a = tf.tensor1d([0.45, 0.123], 'float32'); + b = tf.tensor1d([3.123, 3.321], 'float32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0]); + }); + it('mismatched Tensor1D shapes - int32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + var b = tf.tensor1d([1, 2, 3], 'int32'); + var f = function () { + tf.greaterEqual(a, b); + }; + expect(f).toThrowError(); + }); + it('mismatched Tensor1D shapes - float32', function () { + var a = tf.tensor1d([1.1, 2.1], 'float32'); + var b = tf.tensor1d([1.1, 2.1, 3.1], 'float32'); + var f = function () { + tf.greaterEqual(a, b); + }; + expect(f).toThrowError(); + }); + it('NaNs in Tensor1D - float32', function () { + var a = tf.tensor1d([1.1, NaN, 2.1], 'float32'); + var b = tf.tensor1d([2.1, 3.1, NaN], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0]); + }); + it('Tensor2D - int32', function () { + var a = tf.tensor2d([[1, 4, 5], [8, 9, 12]], [2, 3], 'int32'); + var b = tf.tensor2d([[2, 3, 6], [7, 10, 11]], [2, 3], 'int32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1, 0, 1]); + a = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + b = tf.tensor2d([[0, 0], [1, 1]], [2, 2], 'int32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, 4.1, 5.1], [8.1, 9.1, 12.1]], [2, 3], 'float32'); + var b = tf.tensor2d([[2.1, 3.1, 6.1], [7.1, 10.1, 11.1]], [2, 3], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1, 0, 1]); + a = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + b = tf.tensor2d([[0.2, 0.2], [1.2, 1.2]], [2, 2], 'float32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + }); + it('broadcasting Tensor2D shapes - int32', function () { + var a = tf.tensor2d([[3], [7]], [2, 1], 'int32'); + var b = tf.tensor2d([[2, 3, 4], [7, 8, 9]], [2, 3], 'int32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 0, 1, 0, 0]); + }); + it('broadcasting Tensor2D shapes - float32', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 0, 1, 0, 0]); + }); + it('NaNs in Tensor2D - float32', function () { + var a = tf.tensor2d([[1.1, NaN], [0.1, NaN]], [2, 2], 'float32'); + var b = tf.tensor2d([[0.1, NaN], [1.1, NaN]], [2, 2], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0, 0]); + }); + it('Tensor3D - int32', function () { + var a = tf.tensor3d([[[1], [4], [5]], [[8], [9], [12]]], [2, 3, 1], 'int32'); + var b = tf.tensor3d([[[2], [3], [6]], [[7], [10], [11]]], [2, 3, 1], 'int32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1, 0, 1]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'int32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1, 1, 1]); + }); + it('Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [4.1], [5.1]], [[8.1], [9.1], [12.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[2.1], [3.1], [6.1]], [[7.1], [10.1], [11.1]]], [2, 3, 1], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1, 0, 1]); + a = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.2]]], [2, 3, 1], 'float32'); + b = tf.tensor3d([[[0.1], [0.1], [0.1]], [[1.1], [1.1], [1.1]]], [2, 3, 1], 'float32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1, 1, 1]); + }); + it('broadcasting Tensor3D shapes - int32', function () { + var a = tf.tensor3d([[[1, 0], [2, 3], [4, 5]], [[6, 7], [9, 8], [10, 11]]], [2, 3, 2], 'int32'); + var b = tf.tensor3d([[[1], [2], [3]], [[7], [10], [9]]], [2, 3, 1], 'int32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1]); + }); + it('broadcasting Tensor3D float32', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1]); + }); + it('NaNs in Tensor3D - float32', function () { + var a = tf.tensor3d([[[1.1], [NaN], [1.1]], [[0.1], [0.1], [0.1]]], [2, 3, 1], 'float32'); + var b = tf.tensor3d([[[0.1], [0.1], [1.1]], [[1.1], [0.1], [NaN]]], [2, 3, 1], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 1, 0, 1, 0]); + }); + it('Tensor4D - int32', function () { + var a = tf.tensor4d([1, 4, 5, 8], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([2, 3, 6, 7], [2, 2, 1, 1], 'int32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1]); + a = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([0, 1, 2, 3], [2, 2, 1, 1], 'int32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'int32'); + b = tf.tensor4d([2, 2, 2, 2], [2, 2, 1, 1], 'int32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + }); + it('Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, 4.1, 5.1, 8.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([2.1, 3.1, 6.1, 7.1], [2, 2, 1, 1], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 0, 1]); + a = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([0.1, 1.1, 2.2, 3.3], [2, 2, 1, 1], 'float32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 1, 1, 1]); + a = tf.tensor4d([0.1, 0.1, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + b = tf.tensor4d([1.1, 1.1, 1.1, 1.1], [2, 2, 1, 1], 'float32'); + res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 0, 0, 0]); + }); + it('broadcasting Tensor4D shapes - int32', function () { + var a = tf.tensor4d([1, 2, 5, 9], [2, 2, 1, 1], 'int32'); + var b = tf.tensor4d([[[[1, 2]], [[3, 4]]], [[[5, 6]], [[7, 8]]]], [2, 2, 1, 2], 'int32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0, 0, 1, 0, 1, 1]); + }); + it('broadcasting Tensor4D shapes - float32', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0, 0, 1, 0, 1, 1]); + }); + it('NaNs in Tensor4D - float32', function () { + var a = tf.tensor4d([1.1, NaN, 0.1, 0.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([0.1, 1.1, 1.1, NaN], [2, 2, 1, 1], 'float32'); + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [1, 0, 0, 0]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.greaterEqual({}, tf.scalar(1)); }) + .toThrowError(/Argument 'a' passed to 'greaterEqual' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.greaterEqual(tf.scalar(1), {}); }) + .toThrowError(/Argument 'b' passed to 'greaterEqual' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + var res = tf.greaterEqual(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 1]); + }); +}); +jasmine_util_1.describeWithFlags('greaterEqualStrict', test_util_1.ALL_ENVS, function () { + it('Tensor1D - strict version throws when a and b are different shape', function () { + var a = tf.tensor1d([2]); + var b = tf.tensor1d([4, 2, -1]); + expect(function () { return tf.greaterEqualStrict(a, b); }).toThrowError(); + expect(function () { return tf.greaterEqualStrict(b, a); }).toThrowError(); + }); + it('Tensor2D - strict version throws when a and b are different shape', function () { + var a = tf.tensor2d([[1.1], [7.1]], [2, 1], 'float32'); + var b = tf.tensor2d([[0.1, 1.1, 2.1], [7.1, 8.1, 9.1]], [2, 3], 'float32'); + expect(function () { return tf.greaterEqualStrict(a, b); }).toThrowError(); + expect(function () { return tf.greaterEqualStrict(b, a); }).toThrowError(); + }); + it('Tensor3D - strict version throws when a and b are different shape', function () { + var a = tf.tensor3d([ + [[1.1, 0.1], [2.1, 3.1], [4.1, 5.1]], + [[6.1, 7.1], [9.1, 8.1], [10.1, 11.1]] + ], [2, 3, 2], 'float32'); + var b = tf.tensor3d([[[1.1], [2.1], [3.1]], [[7.1], [10.1], [9.1]]], [2, 3, 1], 'float32'); + expect(function () { return tf.greaterEqualStrict(a, b); }).toThrowError(); + expect(function () { return tf.greaterEqualStrict(b, a); }).toThrowError(); + }); + it('Tensor4D - strict version throws when a and b are different shape', function () { + var a = tf.tensor4d([1.1, 2.1, 5.1, 9.1], [2, 2, 1, 1], 'float32'); + var b = tf.tensor4d([[[[1.1, 2.1]], [[3.1, 4.1]]], [[[5.1, 6.1]], [[7.1, 8.1]]]], [2, 2, 1, 2], 'float32'); + expect(function () { return tf.greaterEqualStrict(a, b); }).toThrowError(); + expect(function () { return tf.greaterEqualStrict(b, a); }).toThrowError(); + }); + it('accepts a tensor-like object', function () { + var a = [1, 4, 5]; + var b = [2, 3, 5]; + var res = tf.greaterEqualStrict(a, b); + expect(res.dtype).toBe('bool'); + test_util_1.expectArraysClose(res, [0, 1, 1]); + }); +}); +//# sourceMappingURL=compareop_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/compareop_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/compareop_test.js.map new file mode 100644 index 0000000..c99f12f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/compareop_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compareop_test.js","sourceRoot":"","sources":["../../src/ops/compareop_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,0CAA4E;AAC5E,gDAAkD;AAElD,gCAAiB,CAAC,OAAO,EAAE,oBAAQ,EAAE;IACnC,EAAE,CAAC,kBAAkB,EAAE;QACrB,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAExC,6BAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,E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E,CAAC,CAAC,EAA3B,CAA2B,CAAC,CAAC,YAAY,EAAE,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEP,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,IAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,IAAM,GAAG,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAExC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/B,6BAAiB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts new file mode 100644 index 0000000..db35d7b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts @@ -0,0 +1,13 @@ +import { Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D } from '../tensor'; +import { TensorLike } from '../types'; +declare function concat1d_(tensors: Tensor1D[] | TensorLike[]): Tensor1D; +declare function concat2d_(tensors: Tensor2D[] | TensorLike[], axis: number): Tensor2D; +declare function concat3d_(tensors: Tensor3D[] | TensorLike[], axis: number): Tensor3D; +declare function concat4d_(tensors: Tensor4D[] | TensorLike[], axis: number): Tensor4D; +declare function concat_(tensors: T[] | TensorLike[], axis?: number): T; +export declare const concat: typeof concat_; +export declare const concat1d: typeof concat1d_; +export declare const concat2d: typeof concat2d_; +export declare const concat3d: typeof concat3d_; +export declare const concat4d: typeof concat4d_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat.js b/node_modules/@tensorflow/tfjs-core/dist/ops/concat.js new file mode 100644 index 0000000..093da74 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util_1 = require("../util"); +var axis_util_1 = require("./axis_util"); +var concat_util = require("./concat_util"); +var operation_1 = require("./operation"); +function concat1d_(tensors) { + return exports.concat(tensors, 0); +} +function concat2d_(tensors, axis) { + return exports.concat(tensors, axis); +} +function concat3d_(tensors, axis) { + return exports.concat(tensors, axis); +} +function concat4d_(tensors, axis) { + return exports.concat(tensors, axis); +} +function concat_(tensors, axis) { + if (axis === void 0) { axis = 0; } + util_1.assert(tensors.length >= 1, 'Pass at least one tensor to concat'); + var $tensors = tensor_util_env_1.convertToTensorArray(tensors, 'tensors', 'concat'); + var result = $tensors[0]; + if ($tensors.length === 1) { + return result; + } + var axes = axis_util_1.parseAxisParam(axis, result.shape); + for (var i = 1; i < $tensors.length; ++i) { + result = concat2Tensors(result, $tensors[i], axes[0]); + } + return result; +} +function concat2Tensors(a, b, axis) { + concat_util.assertParams(a.shape, b.shape, axis); + var outShape = concat_util.computeOutShape(a.shape, b.shape, axis); + var a2D = a.as2D(-1, util_1.sizeFromShape(a.shape.slice(axis))); + var b2D = b.as2D(-1, util_1.sizeFromShape(b.shape.slice(axis))); + var _a = concat_util.computeGradientSliceShapes(a2D.shape, b2D.shape), aBegin = _a.aBegin, aSize = _a.aSize, bBegin = _a.bBegin, bSize = _a.bSize; + var der = function (dy) { + return { a: function () { return dy.slice(aBegin, aSize); }, b: function () { return dy.slice(bBegin, bSize); } }; + }; + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.concat(a2D, b2D); }, { a: a2D, b: b2D }, der); + return res.reshape(outShape); +} +exports.concat = operation_1.op({ concat_: concat_ }); +exports.concat1d = operation_1.op({ concat1d_: concat1d_ }); +exports.concat2d = operation_1.op({ concat2d_: concat2d_ }); +exports.concat3d = operation_1.op({ concat3d_: concat3d_ }); +exports.concat4d = operation_1.op({ concat4d_: concat4d_ }); +//# sourceMappingURL=concat.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/concat.js.map new file mode 100644 index 0000000..0deb8e1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"concat.js","sourceRoot":"","sources":["../../src/ops/concat.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAwD;AAExD,gCAA8C;AAC9C,yCAA2C;AAC3C,2CAA6C;AAC7C,yCAA+B;AAa/B,mBAAmB,OAAgC;IACjD,OAAO,cAAM,CAAC,OAAO,EAAE,CAAC,CAAY,CAAC;AACvC,CAAC;AA6BD,mBAAmB,OAAgC,EAAE,IAAY;IAC/D,OAAO,cAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAgCD,mBAAmB,OAAgC,EAAE,IAAY;IAC/D,OAAO,cAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AASD,mBAAmB,OAAgC,EAAE,IAAY;IAC/D,OAAO,cAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAyCD,iBAAmC,OAAyB,EAAE,IAAQ;IAAR,qBAAA,EAAA,QAAQ;IACpE,aAAM,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,oCAAoC,CAAC,CAAC;IAClE,IAAM,QAAQ,GAAG,sCAAoB,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEpE,IAAI,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAM,CAAC;IAC9B,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACzB,OAAO,MAAM,CAAC;KACf;IACD,IAAM,IAAI,GA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,CAAC,MAAM,CAAC,SAAS,CAC5B,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAxB,CAAwB,EAAE,EAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAC,EAAE,GAAG,CAAC,CAAC;IAChE,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAM,CAAC;AACpC,CAAC;AAEY,QAAA,MAAM,GAAG,cAAE,CAAC,EAAC,OAAO,SAAA,EAAC,CAAC,CAAC;AACvB,QAAA,QAAQ,GAAG,cAAE,CAAC,EAAC,SAAS,WAAA,EAAC,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAG,cAAE,CAAC,EAAC,SAAS,WAAA,EAAC,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAG,cAAE,CAAC,EAAC,SAAS,WAAA,EAAC,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAG,cAAE,CAAC,EAAC,SAAS,WAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_test.js new file mode 100644 index 0000000..0c8b20f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_test.js @@ -0,0 +1,247 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('concat1d', test_util_1.ALL_ENVS, function () { + it('3 + 5', function () { + var a = tf.tensor1d([3]); + var b = tf.tensor1d([5]); + var result = tf.concat1d([a, b]); + var expected = [3, 5]; + test_util_1.expectArraysClose(result, expected); + }); + it('3 + [5,7]', function () { + var a = tf.tensor1d([3]); + var b = tf.tensor1d([5, 7]); + var result = tf.concat1d([a, b]); + var expected = [3, 5, 7]; + test_util_1.expectArraysClose(result, expected); + }); + it('[3,5] + 7', function () { + var a = tf.tensor1d([3, 5]); + var b = tf.tensor1d([7]); + var result = tf.concat1d([a, b]); + var expected = [3, 5, 7]; + test_util_1.expectArraysClose(result, expected); + }); + it('3 + 5 + 7 + 9', function () { + var a = tf.tensor1d([3]); + var b = tf.tensor1d([5]); + var c = tf.tensor1d([7]); + var d = tf.tensor1d([9]); + var result = tf.concat1d([a, b, c, d]); + test_util_1.expectArraysClose(result, [3, 5, 7, 9]); + }); + it('single tensor', function () { + var a = tf.tensor1d([3]); + var result = tf.concat1d([a]); + test_util_1.expectArraysClose(result, [3]); + }); + it('accepts a tensor-like object', function () { + var a = [3]; + var b = [5]; + var result = tf.concat1d([a, b]); + var expected = [3, 5]; + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('concat2d', test_util_1.ALL_ENVS, function () { + it('[[3]] + [[5]], axis=0', function () { + var axis = 0; + var a = tf.tensor2d([3], [1, 1]); + var b = tf.tensor2d([5], [1, 1]); + var result = tf.concat2d([a, b], axis); + var expected = [3, 5]; + expect(result.shape).toEqual([2, 1]); + test_util_1.expectArraysClose(result, expected); + }); + it('[[3]] + [[5]], axis=1', function () { + var axis = 1; + var a = tf.tensor2d([3], [1, 1]); + var b = tf.tensor2d([5], [1, 1]); + var result = tf.concat2d([a, b], axis); + var expected = [3, 5]; + expect(result.shape).toEqual([1, 2]); + test_util_1.expectArraysClose(result, expected); + }); + it('[[1, 2], [3, 4]] + [[5, 6]], axis=0', function () { + var axis = 0; + var a = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + var b = tf.tensor2d([[5, 6]], [1, 2]); + var result = tf.concat2d([a, b], axis); + var expected = [1, 2, 3, 4, 5, 6]; + expect(result.shape).toEqual([3, 2]); + test_util_1.expectArraysClose(result, expected); + }); + it('[[1, 2],[3, 4]] + [[5, 6]] + [[7, 8]], axis=0', function () { + var axis = 0; + var a = tf.tensor2d([[1, 2], [3, 4]]); + var b = tf.tensor2d([[5, 6]]); + var c = tf.tensor2d([[7, 8]]); + var result = tf.concat2d([a, b, c], axis); + var expected = [1, 2, 3, 4, 5, 6, 7, 8]; + expect(result.shape).toEqual([4, 2]); + test_util_1.expectArraysClose(result, expected); + }); + it('[[1, 2], [3, 4]] + [[5, 6]], axis=1 throws error', function () { + var axis = 1; + var a = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + var b = tf.tensor2d([[5, 6]], [1, 2]); + expect(function () { return tf.concat2d([a, b], axis); }).toThrowError(); + }); + it('[[1, 2], [3, 4]] + [[5, 6], [7, 8]], axis=1', function () { + var axis = 1; + var a = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + var b = tf.tensor2d([[5, 6], [7, 8]], [2, 2]); + var result = tf.concat2d([a, b], axis); + var expected = [1, 2, 5, 6, 3, 4, 7, 8]; + expect(result.shape).toEqual([2, 4]); + test_util_1.expectArraysClose(result, expected); + }); + it('[[1, 2],[3, 4]] + [[5, 6],[7, 8]] + [[9, 10],[11, 12]], axis=1', function () { + var axis = 1; + var a = tf.tensor2d([[1, 2], [3, 4]]); + var b = tf.tensor2d([[5, 6], [7, 8]]); + var c = tf.tensor2d([[9, 10], [11, 12]]); + var result = tf.concat2d([a, b, c], axis); + var expected = [1, 2, 5, 6, 9, 10, 3, 4, 7, 8, 11, 12]; + expect(result.shape).toEqual([2, 6]); + test_util_1.expectArraysClose(result, expected); + }); + it('accepts a tensor-like object', function () { + var axis = 0; + var a = [[3]]; + var b = [[5]]; + var result = tf.concat2d([a, b], axis); + var expected = [3, 5]; + expect(result.shape).toEqual([2, 1]); + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('concat3d', test_util_1.ALL_ENVS, function () { + it('shapes correct concat axis=0', function () { + var tensor1 = tf.tensor3d([1, 2, 3], [1, 1, 3]); + var tensor2 = tf.tensor3d([4, 5, 6], [1, 1, 3]); + var values = tf.concat3d([tensor1, tensor2], 0); + expect(values.shape).toEqual([2, 1, 3]); + test_util_1.expectArraysClose(values, [1, 2, 3, 4, 5, 6]); + }); + it('concat axis=0', function () { + var tensor1 = tf.tensor3d([1, 11, 111, 2, 22, 222], [1, 2, 3]); + var tensor2 = tf.tensor3d([5, 55, 555, 6, 66, 666, 7, 77, 777, 8, 88, 888], [2, 2, 3]); + var values = tf.concat3d([tensor1, tensor2], 0); + expect(values.shape).toEqual([3, 2, 3]); + test_util_1.expectArraysClose(values, [ + 1, 11, 111, 2, 22, 222, 5, 55, 555, 6, 66, 666, 7, 77, 777, 8, 88, 888 + ]); + }); + it('shapes correct concat axis=1', function () { + var tensor1 = tf.tensor3d([1, 2, 3], [1, 1, 3]); + var tensor2 = tf.tensor3d([4, 5, 6], [1, 1, 3]); + var values = tf.concat3d([tensor1, tensor2], 1); + expect(values.shape).toEqual([1, 2, 3]); + test_util_1.expectArraysClose(values, [1, 2, 3, 4, 5, 6]); + }); + it('concat axis=1', function () { + var tensor1 = tf.tensor3d([1, 11, 111, 3, 33, 333], [2, 1, 3]); + var tensor2 = tf.tensor3d([5, 55, 555, 6, 66, 666, 7, 77, 777, 8, 88, 888], [2, 2, 3]); + var values = tf.concat3d([tensor1, tensor2], 1); + expect(values.shape).toEqual([2, 3, 3]); + test_util_1.expectArraysClose(values, [ + 1, 11, 111, 5, 55, 555, 6, 66, 666, 3, 33, 333, 7, 77, 777, 8, 88, 888 + ]); + }); + it('shapes correct concat axis=2', function () { + var tensor1 = tf.tensor3d([1, 2, 3], [1, 1, 3]); + var tensor2 = tf.tensor3d([4, 5, 6], [1, 1, 3]); + var values = tf.concat3d([tensor1, tensor2], 2); + expect(values.shape).toEqual([1, 1, 6]); + test_util_1.expectArraysClose(values, [1, 2, 3, 4, 5, 6]); + }); + it('concat axis=2', function () { + var tensor1 = tf.tensor3d([1, 11, 2, 22, 3, 33, 4, 44], [2, 2, 2]); + var tensor2 = tf.tensor3d([5, 55, 555, 6, 66, 666, 7, 77, 777, 8, 88, 888], [2, 2, 3]); + var values = tf.concat3d([tensor1, tensor2], 2); + expect(values.shape).toEqual([2, 2, 5]); + test_util_1.expectArraysClose(values, [ + 1, 11, 5, 55, 555, 2, 22, 6, 66, 666, + 3, 33, 7, 77, 777, 4, 44, 8, 88, 888 + ]); + }); + it('concat throws when invalid non-axis shapes, axis=0', function () { + var axis = 0; + var x1 = tf.tensor3d([1, 11, 111], [1, 1, 3]); + var x2 = tf.tensor3d([5, 55, 555, 6, 66, 666, 7, 77, 777, 8, 88, 888], [2, 2, 3]); + expect(function () { return tf.concat3d([x1, x2], axis); }).toThrowError(); + }); + it('concat throws when invalid non-axis shapes, axis=1', function () { + var axis = 1; + var x1 = tf.tensor3d([1, 11, 111], [1, 1, 3]); + var x2 = tf.tensor3d([5, 55, 555, 6, 66, 666, 7, 77, 777, 8, 88, 888], [2, 2, 3]); + expect(function () { return tf.concat3d([x1, x2], axis); }).toThrowError(); + }); + it('concat throws when invalid non-axis shapes, axis=2', function () { + var axis = 2; + var x1 = tf.tensor3d([1, 11, 2, 22], [1, 2, 2]); + var x2 = tf.tensor3d([5, 55, 555, 6, 66, 666, 7, 77, 777, 8, 88, 888], [2, 2, 3]); + expect(function () { return tf.concat3d([x1, x2], axis); }).toThrowError(); + }); + it('gradient concat axis=0', function () { + var x1 = tf.tensor3d([1, 11, 2, 22], [1, 2, 2]); + var x2 = tf.tensor3d([5, 55, 6, 66, 7, 77, 8, 88], [2, 2, 2]); + var dy = tf.tensor3d([66, 6, 55, 5, 44, 4, 33, 3, 22, 2, 11, 1], [3, 2, 2]); + var axis = 0; + var grads = tf.grads(function (x1, x2) { return tf.concat3d([x1, x2], axis); }); + var _a = grads([x1, x2], dy), dx1 = _a[0], dx2 = _a[1]; + expect(dx1.shape).toEqual(x1.shape); + test_util_1.expectArraysClose(dx1, [66, 6, 55, 5]); + expect(dx2.shape).toEqual(x2.shape); + test_util_1.expectArraysClose(dx2, [44, 4, 33, 3, 22, 2, 11, 1]); + }); + it('gradient concat axis=1', function () { + var x1 = tf.tensor3d([1, 11, 2, 22], [2, 1, 2]); + var x2 = tf.tensor3d([3, 33, 4, 44, 5, 55, 6, 66], [2, 2, 2]); + var dy = tf.tensor3d([66, 6, 55, 5, 44, 4, 33, 3, 22, 2, 11, 1], [2, 3, 2]); + var axis = 1; + var grads = tf.grads(function (x1, x2) { return tf.concat3d([x1, x2], axis); }); + var _a = grads([x1, x2], dy), dx1 = _a[0], dx2 = _a[1]; + expect(dx1.shape).toEqual(x1.shape); + test_util_1.expectArraysClose(dx1, [66, 6, 33, 3]); + expect(dx2.shape).toEqual(x2.shape); + test_util_1.expectArraysClose(dx2, [55, 5, 44, 4, 22, 2, 11, 1]); + }); + it('gradient concat axis=2', function () { + var x1 = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var x2 = tf.tensor3d([5, 55, 6, 66, 7, 77, 8, 88], [2, 2, 2]); + var dy = tf.tensor3d([4, 40, 400, 3, 30, 300, 2, 20, 200, 1, 10, 100], [2, 2, 3]); + var axis = 2; + var grads = tf.grads(function (x1, x2) { return tf.concat3d([x1, x2], axis); }); + var _a = grads([x1, x2], dy), dx1 = _a[0], dx2 = _a[1]; + expect(dx1.shape).toEqual(x1.shape); + test_util_1.expectArraysClose(dx1, [4, 3, 2, 1]); + expect(dx2.shape).toEqual(x2.shape); + test_util_1.expectArraysClose(dx2, [40, 400, 30, 300, 20, 200, 10, 100]); + }); + it('accepts a tensor-like object', function () { + var tensor1 = [[[1, 2, 3]]]; + var tensor2 = [[[4, 5, 6]]]; + var values = tf.concat3d([tensor1, tensor2], 0); + expect(values.shape).toEqual([2, 1, 3]); + test_util_1.expectArraysClose(values, [1, 2, 3, 4, 5, 6]); + }); +}); +jasmine_util_1.describeWithFlags('concat throws for non-tensors', test_util_1.ALL_ENVS, function () { + it('throws when passed a non-tensor', function () { + expect(function () { return tf.concat([{}]); }) + .toThrowError(/Argument 'tensors\[0\]' passed to 'concat' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var tensor1 = [[[1, 2, 3, 4]]]; + var tensor2 = [[[4, 5, 6, 7]]]; + var values = tf.concat([tensor1, tensor2], 0); + expect(values.shape).toEqual([2, 1, 4]); + test_util_1.expectArraysClose(values, [1, 2, 3, 4, 4, 5, 6, 7]); + }); +}); +//# sourceMappingURL=concat_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_test.js.map new file mode 100644 index 0000000..b2258ca --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"concat_test.js","sourceRoot":"","sources":["../../src/ops/concat_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,UAAU,EAAE,oBAAQ,EAAE;IACtC,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3B,IAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnC,IAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxB,6BAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,WAAW,EAAE;QACd,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAM,CAA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AC,EAAE,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,gCAAiB,CAAC,+BAA+B,EAAE,oBAAQ,EAAE;IAC3D,EAAE,CAAC,iCAAiC,EAAE;QACpC,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,MAAM,CAAC,CAAC,EAAiB,CAAC,CAAC,EAA9B,CAA8B,CAAC;aACvC,YAAY,CACT,6DAA6D,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,IAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,IAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts new file mode 100644 index 0000000..0b27c74 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts @@ -0,0 +1,8 @@ +export declare function assertParams(aShape: number[], bShape: number[], axis: number): void; +export declare function computeOutShape(x1Shape: number[], x2Shape: number[], axis: number): number[]; +export declare function computeGradientSliceShapes(aShape: [number, number], bShape: [number, number]): { + aBegin: [number, number]; + aSize: [number, number]; + bBegin: [number, number]; + bSize: [number, number]; +}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.js new file mode 100644 index 0000000..4bccbb0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util = require("../util"); +function assertParams(aShape, bShape, axis) { + var aRank = aShape.length; + var bRank = bShape.length; + util.assert(aShape.length === bShape.length, "Error in concat" + aRank + "D: rank of x1 (" + aRank + ") and x2 (" + bRank + ") " + + "must be the same."); + util.assert(axis >= 0 && axis < aRank, "Error in concat" + aRank + "D: axis must be " + + ("between 0 and " + (aRank - 1) + ".")); + for (var i = 0; i < aRank; i++) { + util.assert((i === axis) || (aShape[i] === bShape[i]), "Error in concat" + aRank + "D: Shape (" + aShape + ") does not match " + + ("(" + bShape + ") along the non-concatenated axis " + i + ".")); + } +} +exports.assertParams = assertParams; +function computeOutShape(x1Shape, x2Shape, axis) { + util.assert(x1Shape.length === x2Shape.length, 'x1 and x2 should have the same rank.'); + var outputShape = x1Shape.slice(); + outputShape[axis] += x2Shape[axis]; + return outputShape; +} +exports.computeOutShape = computeOutShape; +function computeGradientSliceShapes(aShape, bShape) { + return { + aBegin: [0, 0], + aSize: aShape, + bBegin: [0, aShape[1]], + bSize: bShape + }; +} +exports.computeGradientSliceShapes = computeGradientSliceShapes; +//# sourceMappingURL=concat_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.js.map new file mode 100644 index 0000000..89b39af --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.js.map @@ -0,0 +1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E,MAAwB;IACpD,OAAO;QACL,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAqB;QAClC,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAqB;QAC1C,KAAK,EAAE,MAAM;KACd,CAAC;AACJ,CAAC;AARD,gEAQC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util_test.js new file mode 100644 index 0000000..f4fa713 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util_test.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var concat_util = require("./concat_util"); +describe('concat_util.assertConcatShapesMatch rank=3D', function () { + it('Non-3D tensor x1', function () { + var assertFn = function () { + concat_util.assertParams([1], [1, 2, 3], 1); + }; + expect(assertFn).toThrow(); + }); + it('Non-3D tensor x2', function () { + var assertFn = function () { + concat_util.assertParams([1, 2, 3], [2, 3], 1); + }; + expect(assertFn).toThrow(); + }); + it('axis out of bound', function () { + var assertFn = function () { + concat_util.assertParams([1, 2, 3], [1, 2, 3], 4); + }; + expect(assertFn).toThrow(); + }); + it('non-axis shape mismatch', function () { + var assertFn = function () { + concat_util.assertParams([2, 3, 3], [2, 2, 4], 2); + }; + expect(assertFn).toThrow(); + }); + it('shapes line up', function () { + var assertFn = function () { + concat_util.assertParams([2, 3, 3], [2, 3, 4], 2); + }; + expect(assertFn).not.toThrow(); + }); +}); +describe('concat_util.computeConcatOutputShape', function () { + it('compute output shape, axis=0', function () { + expect(concat_util.computeOutShape([2, 2, 3], [1, 2, 3], 0)).toEqual([ + 3, 2, 3 + ]); + }); +}); +describe('concat_util.computeBackpropSizes', function () { + it('compute backprop sizes of 2D tensors, original axis=0', function () { + var a = [1, 6]; + var b = [1, 8]; + var _a = concat_util.computeGradientSliceShapes(a, b), aBegin = _a.aBegin, aSize = _a.aSize, bBegin = _a.bBegin, bSize = _a.bSize; + expect(aBegin).toEqual([0, 0]); + expect(aSize).toEqual([1, 6]); + expect(bBegin).toEqual([0, 6]); + expect(bSize).toEqual([1, 8]); + }); + it('compute backprop sizes of 2D tensors, original axis=1', function () { + var a = [3, 2]; + var b = [3, 7]; + var _a = concat_util.computeGradientSliceShapes(a, b), aBegin = _a.aBegin, aSize = _a.aSize, bBegin = _a.bBegin, bSize = _a.bSize; + expect(aBegin).toEqual([0, 0]); + expect(aSize).toEqual([3, 2]); + expect(bBegin).toEqual([0, 2]); + expect(bSize).toEqual([3, 7]); + }); +}); +//# sourceMappingURL=concat_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util_test.js.map new file mode 100644 index 0000000..fde2ad6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"concat_util_test.js","sourceRoot":"","sources":["../../src/ops/concat_util_test.ts"],"names":[],"mappings":";;AAiBA,2CAA6C;AAE7C,QAAQ,CAAC,6CAA6C,EAAE;IACtD,EAAE,CAAC,kBAAkB,EAAE;QACrB,IAAM,QAAQ,GAAG;YACf,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC;QAEF,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE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MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/conv.d.ts new file mode 100644 index 0000000..43ee4eb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv.d.ts @@ -0,0 +1,13 @@ +import { Tensor2D, Tensor3D, Tensor4D } from '../tensor'; +import { TensorLike } from '../types'; +declare function conv1d_(x: T | TensorLike, filter: Tensor3D | TensorLike, stride: number, pad: 'valid' | 'same' | number, dataFormat?: 'NWC' | 'NCW', dilation?: number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; +declare function conv2d_(x: T | TensorLike, filter: Tensor4D | TensorLike, strides: [number, number] | number, pad: 'valid' | 'same' | number, dataFormat?: 'NHWC' | 'NCHW', dilations?: [number, number] | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; +declare function conv2dTranspose_(x: T | TensorLike, filter: Tensor4D | TensorLike, outputShape: [number, number, number, number] | [number, number, number], strides: [number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; +declare function depthwiseConv2d_(x: T | TensorLike, filter: Tensor4D | TensorLike, strides: [number, number] | number, pad: 'valid' | 'same' | number, dataFormat?: 'NHWC' | 'NCHW', dilations?: [number, number] | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; +declare function separableConv2d_(x: T | TensorLike, depthwiseFilter: Tensor4D | TensorLike, pointwiseFilter: Tensor4D | TensorLike, strides: [number, number] | number, pad: 'valid' | 'same', dilation?: [number, number] | number, dataFormat?: 'NHWC' | 'NCHW'): T; +export declare const conv1d: typeof conv1d_; +export declare const conv2d: typeof conv2d_; +export declare const depthwiseConv2d: typeof depthwiseConv2d_; +export declare const separableConv2d: typeof separableConv2d_; +export declare const conv2dTranspose: typeof conv2dTranspose_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv.js b/node_modules/@tensorflow/tfjs-core/dist/ops/conv.js new file mode 100644 index 0000000..7aa3951 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv.js @@ -0,0 +1,267 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var conv_util = require("./conv_util"); +var operation_1 = require("./operation"); +function conv1d_(x, filter, stride, pad, dataFormat, dilation, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NWC'; } + if (dilation === void 0) { dilation = 1; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'conv1d'); + var $filter = tensor_util_env_1.convertToTensor(filter, 'filter', 'conv1d'); + var x3D = $x; + var reshapedTo3D = false; + if ($x.rank === 2) { + reshapedTo3D = true; + x3D = $x.as3D(1, $x.shape[0], $x.shape[1]); + } + util.assert(x3D.rank === 3, "Error in conv1d: input must be rank 3, but got rank " + x3D.rank + "."); + util.assert($filter.rank === 3, "Error in conv1d: filter must be rank 3, but got rank " + + ($filter.rank + ".")); + if (dimRoundingMode != null) { + util.assert(util.isInt(pad), "Error in conv1d: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + util.assert(x3D.shape[2] === $filter.shape[1], "Error in conv1d: depth of input (" + x3D.shape[2] + ") must match " + + ("input depth for filter " + $filter.shape[1] + ".")); + util.assert(eitherStridesOrDilationsAreOne(stride, dilation), 'Error in conv1D: Either stride or dilation must be 1. ' + + ("Got stride " + stride + " and dilation '" + dilation + "'")); + util.assert(dataFormat === 'NWC', "Error in conv1d: got dataFormat of " + dataFormat + " but only NWC is currently supported."); + var filter4D = $filter.as4D(1, $filter.shape[0], $filter.shape[1], $filter.shape[2]); + var input4D = x3D.as4D(x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]); + var strides = [1, stride]; + var dilations = [1, dilation]; + var conv2dDataFormat = 'NHWC'; + var res = exports.conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode); + if (reshapedTo3D) { + return res.as2D(res.shape[2], res.shape[3]); + } + return res.as3D(res.shape[0], res.shape[2], res.shape[3]); +} +function conv2d_(x, filter, strides, pad, dataFormat, dilations, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + if (dilations === void 0) { dilations = [1, 1]; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'conv2d'); + var $filter = tensor_util_env_1.convertToTensor(filter, 'filter', 'conv2d'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + util.assert(x4D.rank === 4, "Error in conv2d: input must be rank 4, but got rank " + x4D.rank + "."); + util.assert($filter.rank === 4, "Error in conv2d: filter must be rank 4, but got rank " + + ($filter.rank + ".")); + if (dimRoundingMode != null) { + util.assert(util.isInt(pad), "Error in conv2d: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + util.assert(x4D.shape[3] === $filter.shape[2], "Error in conv2d: depth of input (" + x4D.shape[3] + ") must match " + + ("input depth for filter " + $filter.shape[2] + ".")); + util.assert(eitherStridesOrDilationsAreOne(strides, dilations), 'Error in conv2D: Either strides or dilations must be 1. ' + + ("Got strides " + strides + " and dilations '" + dilations + "'")); + util.assert(dataFormat === 'NHWC', "Error in conv2d: got dataFormat of " + dataFormat + " but only NHWC is currently supported."); + var convInfo = conv_util.computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode); + var grad = function (dy) { + util.assert(tupleValuesAreOne(dilations), 'Error in gradient of conv2D: dilation rates greater than 1 are not' + + ("yet supported in gradients. Got dilations '" + dilations + "'")); + return { + x: function () { return conv2dDerInput_(x4D.shape, dy, $filter, strides, pad); }, + $filter: function () { return conv2dDerFilter_(x4D, dy, $filter.shape, strides, pad); } + }; + }; + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.conv2d(x4D, $filter, convInfo); }, { x: x4D, $filter: $filter }, grad); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +function conv2dDerInput_(xShape, dy, filter, strides, pad, dimRoundingMode) { + util.assert(xShape.length === dy.rank, "Length of inShape " + + ("(" + xShape.length + ") and rank of dy (" + dy.rank + ") must match")); + var xShape4D = xShape; + var dy4D = dy; + var reshapedTo4D = false; + if (dy.rank === 3) { + reshapedTo4D = true; + dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]); + xShape4D = [1, xShape[0], xShape[1], xShape[2]]; + } + var inDepth = xShape4D[3]; + var outDepth = dy4D.shape[3]; + util.assert(xShape4D.length === 4, "Error in conv2dDerInput: inShape must be length 4, but got length " + + (xShape4D.length + ".")); + util.assert(dy4D.rank === 4, "Error in conv2dDerInput: dy must be rank 4, but got " + + ("rank " + dy4D.rank)); + util.assert(filter.rank === 4, "Error in conv2dDerInput: filter must be rank 4, but got " + + ("rank " + filter.rank)); + util.assert(inDepth === filter.shape[2], "Error in conv2dDerInput: depth of input (" + inDepth + ") must " + + ("match input depth for filter " + filter.shape[2] + ".")); + util.assert(outDepth === filter.shape[3], "Error in conv2dDerInput: depth of output (" + outDepth + ") must " + + ("match output depth for filter " + filter.shape[3] + ".")); + if (dimRoundingMode != null) { + util.assert(util.isInt(pad), "Error in conv2dDerInput: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var dilations = 1; + var convInfo = conv_util.computeConv2DInfo(xShape4D, filter.shape, strides, dilations, pad, dimRoundingMode); + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.conv2dDerInput(dy4D, filter, convInfo); }, { dy4D: dy4D }); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +function conv2dDerFilter_(x, dy, filterShape, strides, pad, dimRoundingMode) { + var x4D = x; + if (x.rank === 3) { + x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]); + } + var dy4D = dy; + if (dy4D.rank === 3) { + dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]); + } + util.assert(x4D.rank === 4, "Error in conv2dDerFilter: input must be rank 4, but got shape " + + (x4D.shape + ".")); + util.assert(dy4D.rank === 4, "Error in conv2dDerFilter: dy must be rank 4, but got shape " + + (dy4D.shape + ".")); + util.assert(filterShape.length === 4, "Error in conv2dDerFilter: filterShape must be length 4, but got " + + (filterShape + ".")); + util.assert(x4D.shape[3] === filterShape[2], "Error in conv2dDerFilter: depth of input " + x4D.shape[3] + ") must " + + ("match input depth in filter (" + filterShape[2] + ".")); + util.assert(dy4D.shape[3] === filterShape[3], "Error in conv2dDerFilter: depth of dy (" + dy4D.shape[3] + ") must " + + ("match output depth for filter (" + filterShape[3] + ").")); + if (dimRoundingMode != null) { + util.assert(util.isInt(pad), "Error in conv2dDerFilter: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var dilations = 1; + var convInfo = conv_util.computeConv2DInfo(x4D.shape, filterShape, strides, dilations, pad, dimRoundingMode); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.conv2dDerFilter(x4D, dy4D, convInfo); }, { x4D: x4D, dy4D: dy4D }); +} +function conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'conv2dTranspose'); + var $filter = tensor_util_env_1.convertToTensor(filter, 'filter', 'conv2dTranspose'); + return conv2dDerInput_(outputShape, $x, $filter, strides, pad, dimRoundingMode); +} +function depthwiseConv2d_(x, filter, strides, pad, dataFormat, dilations, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + if (dilations === void 0) { dilations = [1, 1]; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'depthwiseConv2d'); + var $filter = tensor_util_env_1.convertToTensor(filter, 'filter', 'depthwiseConv2d'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + util.assert(x4D.rank === 4, "Error in depthwiseConv2d: input must be rank 4, but got " + + ("rank " + x4D.rank + ".")); + util.assert($filter.rank === 4, "Error in depthwiseConv2d: filter must be rank 4, but got rank " + + ($filter.rank + ".")); + util.assert(x4D.shape[3] === $filter.shape[2], "Error in depthwiseConv2d: number of input channels " + + ("(" + x4D.shape[3] + ") must match the inChannels dimension in ") + + ("filter " + $filter.shape[2] + ".")); + if (dilations == null) { + dilations = [1, 1]; + } + util.assert(eitherStridesOrDilationsAreOne(strides, dilations), 'Error in depthwiseConv2d: Either strides or dilations must be 1. ' + + ("Got strides " + strides + " and dilations '" + dilations + "'")); + if (dimRoundingMode != null) { + util.assert(util.isInt(pad), "Error in depthwiseConv2d: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var convInfo = conv_util.computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode, true); + var grad = function (dy) { + util.assert(tupleValuesAreOne(dilations), 'Error in gradient of depthwiseConv2d: dilation rates greater than ' + + ("1 are not yet supported. Got dilations '" + dilations + "'")); + return { + x: function () { return depthwiseConv2dDerInput(x4D.shape, dy, $filter, convInfo); }, + $filter: function () { return depthwiseConv2dDerFilter(x4D, dy, $filter.shape, convInfo); }, + }; + }; + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.depthwiseConv2D(x4D, $filter, convInfo); }, { x: x4D, $filter: $filter }, grad); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +function separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) { + if (dilation === void 0) { dilation = [1, 1]; } + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'separableConv2d'); + var $depthwiseFilter = tensor_util_env_1.convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d'); + var $pointwiseFilter = tensor_util_env_1.convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + if (dataFormat === 'NCHW') { + throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' + + 'NHWC is supported'); + } + util.assert(x4D.rank === 4, "Error in separableConv2d: input must be rank 4, but got " + + ("rank " + x4D.rank + ".")); + util.assert($depthwiseFilter.rank === 4, "Error in separableConv2d: depthwise filter must be rank 4, but got " + + ("rank " + $depthwiseFilter.rank + ".")); + util.assert($pointwiseFilter.rank === 4, "Error in separableConv2d: pointwise filter must be rank 4, but got " + + ("rank " + $depthwiseFilter.rank + ".")); + util.assert($pointwiseFilter.shape[0] === 1, "Error in separableConv2d: the first dimension of pointwise filter " + + (" must be 1, but got " + $pointwiseFilter.shape[0] + ".")); + util.assert($pointwiseFilter.shape[1] === 1, "Error in separableConv2d: the second dimension of pointwise filter " + + (" must be 1, but got " + $pointwiseFilter.shape[1] + ".")); + var inChannels = $depthwiseFilter.shape[2]; + var channelMultiplier = $depthwiseFilter.shape[3]; + util.assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, "Error in separableConv2d: the third dimension of pointwise filter " + + ("must be " + inChannels * channelMultiplier + ", ") + + ("but got " + $pointwiseFilter.shape[2] + ".")); + var depthwise = exports.depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation); + var pointwiseStride = 1; + var res = exports.conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +function parseTupleParam(param) { + return typeof param === 'number' ? [param, param] : param; +} +function tupleValuesAreOne(param) { + var _a = parseTupleParam(param), dimA = _a[0], dimB = _a[1]; + return dimA === 1 && dimB === 1; +} +function eitherStridesOrDilationsAreOne(strides, dilations) { + return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations); +} +function depthwiseConv2dDerInput(xShape, dy, filter, convInfo) { + var dy4D = dy; + var reshapedTo4D = false; + if (dy.rank === 3) { + reshapedTo4D = true; + dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]); + } + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.depthwiseConv2DDerInput(dy4D, filter, convInfo); }, { dy4D: dy4D }); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +function depthwiseConv2dDerFilter(x, dy, filterShape, convInfo) { + var x4D = x; + if (x.rank === 3) { + x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]); + } + var dy4D = dy; + if (dy4D.rank === 3) { + dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]); + } + return environment_1.ENV.engine.runKernel(function (backend) { return backend.depthwiseConv2DDerFilter(x4D, dy4D, convInfo); }, { x4D: x4D, dy4D: dy4D }); +} +exports.conv1d = operation_1.op({ conv1d_: conv1d_ }); +exports.conv2d = operation_1.op({ conv2d_: conv2d_ }); +exports.depthwiseConv2d = operation_1.op({ depthwiseConv2d_: depthwiseConv2d_ }); +exports.separableConv2d = operation_1.op({ separableConv2d_: separableConv2d_ }); +exports.conv2dTranspose = operation_1.op({ conv2dTranspose_: conv2dTranspose_ }); +//# sourceMappingURL=conv.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/conv.js.map new file mode 100644 index 0000000..0a62f80 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv.js","sourceRoot":"","sources":["../../src/ops/conv.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,8BAAgC;AAChC,uCAAyC;AACzC,yCAA+B;AA8B/B,iBACI,CAAe,EAAE,MAA2B,EAAE,MAAc,EAC5D,GAA0B,EAAE,UAA+B,EAAE,QAAY,EACzE,eAAwC;IADZ,2BAAA,EAAA,kBAA+B;IAAE,yBAAA,EAAA,YAAY;IAE3E,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC7C,IAAM,OAAO,GAAG,iCAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAE5D,IAAI,GAAG,GAAG,EAAc,CAAC;IACzB,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,IAAI,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE;QACjB,YAAY,GAAG,IAAI,CAAC;QACpB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5C;IAED,IAAI,CAAC,MAAM,CACP,GAAG,CAAC,IAAI,KAAK,CAAC,EACd,yDAAuD,GAAG,CAAC,IAAI,MAAG,CAAC,CAAC;IACxE,IAAI,CAAC,MAAM,CACP,OAAO,CAAC,IAAI,KAAK,CAAC,EAClB,uDAAuD;SAChD,OAAO,CAAC,IAAI,MAAG,CAAA,CAAC,CAAC;I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I,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1D;IACD,OAAO,iBAAG,CAAC,MAAM,CAAC,SAAS,CACvB,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,wBAAwB,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,EAArD,CAAqD,EAChE,EAAC,GAAG,KAAA,EAAE,IAAI,MAAA,EAAC,CAAC,CAAC;AACnB,CAAC;AAEY,QAAA,MAAM,GAAG,cAAE,CAAC,EAAC,OAAO,SAAA,EAAC,CAAC,CAAC;AACvB,QAAA,MAAM,GAAG,cAAE,CAAC,EAAC,OAAO,SAAA,EAAC,CAAC,CAAC;AACvB,QAAA,eAAe,GAAG,cAAE,CAAC,EAAC,gBAAgB,kBAAA,EAAC,CAAC,CAAC;AACzC,QAAA,eAAe,GAAG,cAAE,CAAC,EAAC,gBAAgB,kBAAA,EAAC,CAAC,CAAC;AACzC,QAAA,eAAe,GAAG,cAAE,CAAC,EAAC,gBAAgB,kBAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d_test.js new file mode 100644 index 0000000..d57d10d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d_test.js @@ -0,0 +1,210 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('conv1d', test_util_1.ALL_ENVS, function () { + it('conv1d input=2x2x1,d2=1,f=1,s=1,d=1,p=same', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 1; + var pad = 'same'; + var stride = 1; + var dataFormat = 'NWC'; + var dilation = 1; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.tensor3d([3], [fSize, inputDepth, outputDepth]); + var result = tf.conv1d(x, w, stride, pad, dataFormat, dilation); + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, [3, 6, 9, 12]); + }); + it('conv1d input=4x1,d2=1,f=2x1x1,s=1,d=1,p=valid', function () { + var inputDepth = 1; + var inputShape = [4, inputDepth]; + var outputDepth = 1; + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var dataFormat = 'NWC'; + var dilation = 1; + var x = tf.tensor2d([1, 2, 3, 4], inputShape); + var w = tf.tensor3d([2, 1], [fSize, inputDepth, outputDepth]); + var result = tf.conv1d(x, w, stride, pad, dataFormat, dilation); + expect(result.shape).toEqual([3, 1]); + test_util_1.expectArraysClose(result, [4, 7, 10]); + }); + it('conv1d input=4x1,d2=1,f=2x1x1,s=1,d=2,p=valid', function () { + var inputDepth = 1; + var inputShape = [4, inputDepth]; + var outputDepth = 1; + var fSize = 2; + var fSizeDilated = 3; + var pad = 'valid'; + var stride = 1; + var dataFormat = 'NWC'; + var dilation = 2; + var dilationWEffective = 1; + var x = tf.tensor2d([1, 2, 3, 4], inputShape); + var w = tf.tensor3d([2, 1], [fSize, inputDepth, outputDepth]); + var wDilated = tf.tensor3d([2, 0, 1], [fSizeDilated, inputDepth, outputDepth]); + var result = tf.conv1d(x, w, stride, pad, dataFormat, dilation); + var expectedResult = tf.conv1d(x, wDilated, stride, pad, dataFormat, dilationWEffective); + expect(result.shape).toEqual(expectedResult.shape); + test_util_1.expectArraysClose(result, expectedResult); + }); + it('conv1d input=14x1,d2=1,f=3x1x1,s=1,d=3,p=valid', function () { + var inputDepth = 1; + var inputShape = [14, inputDepth]; + var outputDepth = 1; + var fSize = 3; + var fSizeDilated = 7; + var pad = 'valid'; + var stride = 1; + var dataFormat = 'NWC'; + var dilation = 3; + var dilationWEffective = 1; + var x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], inputShape); + var w = tf.tensor3d([3, 2, 1], [fSize, inputDepth, outputDepth]); + var wDilated = tf.tensor3d([3, 0, 0, 2, 0, 0, 1], [fSizeDilated, inputDepth, outputDepth]); + var result = tf.conv1d(x, w, stride, pad, dataFormat, dilation); + var expectedResult = tf.conv1d(x, wDilated, stride, pad, dataFormat, dilationWEffective); + expect(result.shape).toEqual(expectedResult.shape); + test_util_1.expectArraysClose(result, expectedResult); + }); + it('throws when x is not rank 3', function () { + var inputDepth = 1; + var outputDepth = 1; + var fSize = 2; + var pad = 0; + var stride = 1; + var dataFormat = 'NWC'; + var dilation = 1; + var x = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var w = tf.tensor3d([3, 1], [fSize, inputDepth, outputDepth]); + expect(function () { return tf.conv1d(x, w, stride, pad, dataFormat, dilation); }) + .toThrowError(); + }); + it('throws when weights is not rank 3', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var pad = 0; + var stride = 1; + var dataFormat = 'NWC'; + var dilation = 1; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.tensor4d([3, 1, 5, 0], [2, 2, 1, 1]); + expect(function () { return tf.conv1d(x, w, stride, pad, dataFormat, dilation); }) + .toThrowError(); + }); + it('throws when x depth does not match weight depth', function () { + var inputDepth = 1; + var wrongInputDepth = 5; + var inputShape = [2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 2; + var pad = 0; + var stride = 1; + var dataFormat = 'NWC'; + var dilation = 1; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.randomNormal([fSize, wrongInputDepth, outputDepth]); + expect(function () { return tf.conv1d(x, w, stride, pad, dataFormat, dilation); }) + .toThrowError(); + }); + it('throws when both stride and dilation are greater than 1', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 1; + var pad = 'same'; + var stride = 2; + var dataFormat = 'NWC'; + var dilation = 2; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.tensor3d([3], [fSize, inputDepth, outputDepth]); + expect(function () { return tf.conv1d(x, w, stride, pad, dataFormat, dilation); }) + .toThrowError(); + }); + it('throws when passed x as a non-tensor', function () { + var inputDepth = 1; + var outputDepth = 1; + var fSize = 1; + var pad = 'same'; + var stride = 2; + var dataFormat = 'NWC'; + var dilation = 2; + var w = tf.tensor3d([3], [fSize, inputDepth, outputDepth]); + expect(function () { + return tf.conv1d({}, w, stride, pad, dataFormat, dilation); + }) + .toThrowError(/Argument 'x' passed to 'conv1d' must be a Tensor/); + }); + it('throws when passed filter as a non-tensor', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var pad = 'same'; + var stride = 2; + var dataFormat = 'NWC'; + var dilation = 2; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + expect(function () { + return tf.conv1d(x, {}, stride, pad, dataFormat, dilation); + }) + .toThrowError(/Argument 'filter' passed to 'conv1d' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var pad = 'same'; + var stride = 1; + var dataFormat = 'NWC'; + var dilation = 1; + var x = [[[1], [2]], [[3], [4]]]; + var w = [[[3]]]; + var result = tf.conv1d(x, w, stride, pad, dataFormat, dilation); + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, [3, 6, 9, 12]); + }); + it('conv1d gradients, input=2x2x1,d2=1,f=1,s=1,d=1,p=same', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 1; + var filterShape = [fSize, inputDepth, outputDepth]; + var pad = 'same'; + var stride = 1; + var dataFormat = 'NWC'; + var dilation = 1; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.tensor3d([3], filterShape); + var dy = tf.tensor3d([3, 2, 1, 0], inputShape); + var grads = tf.grads(function (x, w) { + return tf.conv1d(x, w, stride, pad, dataFormat, dilation); + }); + var _a = grads([x, w], dy), dx = _a[0], dw = _a[1]; + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, [9, 6, 3, 0]); + expect(dw.shape).toEqual(w.shape); + test_util_1.expectArraysClose(dw, [10]); + }); + it('conv1d gradients input=14x1,d2=1,f=3x1x1,s=1,p=valid', function () { + var inputDepth = 1; + var inputShape = [14, inputDepth]; + var outputDepth = 1; + var fSize = 3; + var pad = 'valid'; + var stride = 1; + var dataFormat = 'NWC'; + var x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], inputShape); + var w = tf.tensor3d([3, 2, 1], [fSize, inputDepth, outputDepth]); + var dy = tf.tensor2d([3, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 0], [12, inputDepth]); + var grads = tf.grads(function (x, w) { + return tf.conv1d(x, w, stride, pad, dataFormat); + }); + var _a = grads([x, w], dy), dx = _a[0], dw = _a[1]; + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, [9, 12, 10, 4, 10, 12, 10, 4, 10, 12, 10, 4, 1, 0]); + expect(dw.shape).toEqual(w.shape); + test_util_1.expectArraysClose(dw, [102, 120, 138]); + }); +}); +//# sourceMappingURL=conv1d_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d_test.js.map new file mode 100644 index 0000000..01b1f12 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv1d_test.js","sourceRoot":"","sources":["../../src/ops/conv1d_test.ts"],"names":[],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CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;QAExE,IAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAClB,UAAC,CAAc,EAAE,CAAc;YAC3B,OAAA,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC;QAAxC,CAAwC,CAAC,CAAC;QAC5C,IAAA,sBAA4B,EAA3B,UAAE,EAAE,UAAE,CAAsB;QAEnC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAClC,6BAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAE1E,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAClC,6BAAiB,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_depthwise_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_depthwise_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_depthwise_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_depthwise_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_depthwise_test.js new file mode 100644 index 0000000..8d0dd93 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_depthwise_test.js @@ -0,0 +1,377 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('depthwiseConv2D', test_util_1.ALL_ENVS, function () { + it('input=1x3x3x1,f=2,s=1,d=1,p=valid,chMul=1', function () { + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var chMul = 1; + var inDepth = 1; + var x = tf.tensor4d([ + 0.230664, 0.987388, 0.0685208, 0.419224, 0.887861, 0.731641, + 0.0741907, 0.409265, 0.351377 + ], [1, 3, 3, inDepth]); + var w = tf.tensor4d([0.303873, 0.229223, 0.144333, 0.803373], [fSize, fSize, inDepth, chMul]); + var result = tf.depthwiseConv2d(x, w, stride, pad); + expect(result.shape).toEqual([1, 2, 2, 1]); + var expected = [1.07022, 1.03167, 0.67041, 0.778863]; + test_util_1.expectArraysClose(result, expected); + }); + it('input=1x3x3x1,f=2,s=1,d=2,p=valid,chMul=1', function () { + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var dilation = 2; + var chMul = 1; + var inDepth = 1; + var x = tf.tensor4d([ + 0.230664, 0.987388, 0.0685208, 0.419224, 0.887861, 0.731641, + 0.0741907, 0.409265, 0.351377 + ], [1, 3, 3, inDepth]); + var w = tf.tensor4d([0.303873, 0.229223, 0.144333, 0.803373], [fSize, fSize, inDepth, chMul]); + var fSizeDilated = fSize + (fSize - 1) * (dilation - 1); + var wDilated = tf.tensor4d([0.303873, 0, 0.229223, 0, 0, 0, 0.144333, 0, 0.803373], [fSizeDilated, fSizeDilated, inDepth, chMul]); + var result = tf.depthwiseConv2d(x, w, stride, pad, 'NHWC', dilation); + var expectedResult = tf.depthwiseConv2d(x, wDilated, stride, pad); + expect(result.shape).toEqual(expectedResult.shape); + test_util_1.expectArraysClose(result, expectedResult); + }); + it('input=1x3x3x2,f=2,s=1,d=1,p=same,chMul=1', function () { + var fSize = 2; + var pad = 'same'; + var stride = 1; + var chMul = 1; + var inDepth = 2; + var x = tf.tensor4d([ + 0.111057, 0.661818, 0.701979, 0.424362, 0.992854, 0.417599, 0.423036, + 0.500499, 0.368484, 0.714135, 0.456693, 0.531058, 0.636636, 0.345024, + 0.0506303, 0.789682, 0.177473, 0.793569 + ], [1, 3, 3, inDepth]); + var w = tf.tensor4d([ + 0.614293, 0.0648011, 0.101113, 0.452887, 0.0582746, 0.426481, + 0.872743, 0.765767 + ], [fSize, fSize, inDepth, chMul]); + var result = tf.depthwiseConv2d(x, w, stride, pad); + expect(result.shape).toEqual([1, 3, 3, 2]); + var expected = [ + 0.485445, 0.995389, 0.95166, 0.927856, 0.636516, 0.253547, 0.378414, + 1.10771, 0.430373, 1.23126, 0.290885, 0.372855, 0.3962, 0.379995, + 0.0490466, 0.410569, 0.10902, 0.0514242 + ]; + test_util_1.expectArraysClose(result, expected); + }); + it('input=1x3x3x2,f=2,s=1,d=2,p=same,chMul=1', function () { + var fSize = 2; + var pad = 'same'; + var stride = 1; + var dilation = 2; + var inDepth = 2; + var x = tf.tensor4d([ + 0.111057, 0.661818, 0.701979, 0.424362, 0.992854, 0.417599, 0.423036, + 0.500499, 0.368484, 0.714135, 0.456693, 0.531058, 0.636636, 0.345024, + 0.0506303, 0.789682, 0.177473, 0.793569 + ], [1, 3, 3, inDepth]); + var w = tf.stack([ + tf.tensor2d([0.614293, 0.0648011, 0.101113, 0.452887], [fSize, fSize]), + tf.tensor2d([0.0582746, 0.426481, 0.872743, 0.765767], [fSize, fSize]) + ], 2) + .expandDims(3); + var fSizeDilated = fSize + (fSize - 1) * (dilation - 1); + var wDilated = tf.stack([ + tf.tensor2d([0.614293, 0, 0.0648011, 0, 0, 0, 0.101113, 0, 0.452887], [fSizeDilated, fSizeDilated]), + tf.tensor2d([0.0582746, 0, 0.426481, 0, 0, 0, 0.872743, 0, 0.765767], [fSizeDilated, fSizeDilated]) + ], 2) + .expandDims(3); + expect(wDilated.shape).toEqual([fSizeDilated, fSizeDilated, inDepth, 1]); + var result = tf.depthwiseConv2d(x, w, stride, pad, 'NHWC', dilation); + var expectedResult = tf.depthwiseConv2d(x, wDilated, stride, pad); + expect(result.shape).toEqual(expectedResult.shape); + test_util_1.expectArraysClose(result, expectedResult); + }); + it('input=1x3x3x2,f=2,s=1,p=same,chMul=2', function () { + var fSize = 2; + var pad = 'same'; + var stride = 1; + var chMul = 2; + var inDepth = 2; + var x = tf.tensor4d([ + 0.675707, 0.758567, 0.413529, 0.963967, 0.217291, 0.101335, 0.804231, + 0.329673, 0.924503, 0.728742, 0.180217, 0.210459, 0.133869, 0.650827, + 0.047613, 0.554795, 0.653365, 0.442196 + ], [1, 3, 3, inDepth]); + var w = tf.tensor4d([ + 0.347154, 0.386692, 0.327191, 0.483784, 0.591807, 0.24263, 0.95182, + 0.174353, 0.592136, 0.623469, 0.988244, 0.660731, 0.946534, 0.0801365, + 0.864889, 0.874602 + ], [fSize, fSize, inDepth, chMul]); + var result = tf.depthwiseConv2d(x, w, stride, pad); + expect(result.shape).toEqual([1, 3, 3, 4]); + var expected = [ + 1.83059, 0.937125, 2.1218, 1.39024, 0.990167, 0.803472, + 1.31405, 1.14959, 0.182147, 0.196385, 0.241141, 0.188081, + 0.950656, 0.622581, 1.92451, 1.20179, 1.07422, 0.483268, + 1.36948, 1.14256, 0.449444, 0.477042, 0.505857, 0.393989, + 0.0746509, 0.0633184, 0.74101, 0.41159, 0.403195, 0.176938, + 0.602415, 0.345499, 0.226819, 0.252651, 0.144682, 0.213927 + ]; + test_util_1.expectArraysClose(result, expected); + }); + it('input=2x3x3x2,f=2,s=1,p=same,chMul=2', function () { + var fSize = 2; + var pad = 'same'; + var stride = 1; + var chMul = 2; + var inDepth = 2; + var x = tf.tensor4d([ + 0.261945, 0.0528113, 0.656698, 0.127345, 0.610039, 0.169131, + 0.458647, 0.0988288, 0.966109, 0.0421747, 0.82035, 0.274711, + 0.359377, 0.512113, 0.689682, 0.941571, 0.31961, 0.743826, + 0.858147, 0.984766, 0.926973, 0.579597, 0.444104, 0.505969, + 0.241437, 0.937999, 0.0957074, 0.773611, 0.46023, 0.469379, + 0.363789, 0.269745, 0.486136, 0.894215, 0.794299, 0.724615 + ], [2, 3, 3, inDepth]); + var w = tf.tensor4d([ + 0.240347, 0.906352, 0.478657, 0.825918, 0.380769, 0.184705, 0.238241, + 0.201907, 0.294087, 0.181165, 0.191303, 0.7225, 0.430064, 0.900622, + 0.670338, 0.33478 + ], [fSize, fSize, inDepth, chMul]); + var result = tf.depthwiseConv2d(x, w, stride, pad); + expect(result.shape).toEqual([2, 3, 3, 4]); + var expected = [ + 0.863379, 1.3119, 0.102795, 0.154853, 1.02704, 1.62173, 0.293466, + 0.261764, 0.387876, 0.701529, 0.133508, 0.338167, 0.880395, 1.28039, + 0.786492, 0.775361, 0.884845, 1.43995, 0.764374, 1.0196, 0.291162, + 0.801428, 0.273788, 0.764303, 0.348985, 0.45311, 0.469447, 0.613073, + 0.287461, 0.684128, 0.627899, 0.927844, 0.0768174, 0.28968, 0.356037, + 0.614339, 0.67138, 1.07894, 1.30747, 1.86705, 0.617971, 1.35402, + 0.860607, 1.29693, 0.242087, 0.485892, 0.331979, 0.757015, 0.410527, + 0.740235, 1.28431, 1.42516, 0.68281, 0.975185, 1.13892, 1.62237, + 0.344208, 0.561029, 0.363292, 0.911203, 0.272541, 0.419513, 0.342154, + 0.403335, 0.419286, 0.587321, 0.600655, 0.884853, 0.190907, 0.719914, + 0.346842, 0.598472 + ]; + test_util_1.expectArraysClose(result, expected); + }); + it('input=2x3x3x2,f=2,s=1,d=2,p=same,chMul=2', function () { + var fSize = 2; + var pad = 'same'; + var stride = 1; + var inDepth = 2; + var dilation = 2; + var noDilation = 1; + var x = tf.tensor4d([ + 0.261945, 0.0528113, 0.656698, 0.127345, 0.610039, 0.169131, + 0.458647, 0.0988288, 0.966109, 0.0421747, 0.82035, 0.274711, + 0.359377, 0.512113, 0.689682, 0.941571, 0.31961, 0.743826, + 0.858147, 0.984766, 0.926973, 0.579597, 0.444104, 0.505969, + 0.241437, 0.937999, 0.0957074, 0.773611, 0.46023, 0.469379, + 0.363789, 0.269745, 0.486136, 0.894215, 0.794299, 0.724615 + ], [2, 3, 3, inDepth]); + var w = tf.stack([ + tf.stack([ + tf.tensor2d([0.240347, 0.906352, 0.478657, 0.825918], [fSize, fSize]), + tf.tensor2d([0.380769, 0.184705, 0.238241, 0.201907], [fSize, fSize]) + ], 2), + tf.stack([ + tf.tensor2d([0.294087, 0.181165, 0.191303, 0.7225], [fSize, fSize]), + tf.tensor2d([0.430064, 0.900622, 0.670338, 0.33478], [fSize, fSize]) + ], 2) + ], 3); + var fSizeDilated = fSize + (fSize - 1) * (dilation - 1); + var wDilated = tf.stack([ + tf.stack([ + tf.tensor2d([0.240347, 0, 0.906352, 0, 0, 0, 0.478657, 0, 0.825918], [fSizeDilated, fSizeDilated]), + tf.tensor2d([0.380769, 0, 0.184705, 0, 0, 0, 0.238241, 0, 0.201907], [fSizeDilated, fSizeDilated]) + ], 2), + tf.stack([ + tf.tensor2d([0.294087, 0, 0.181165, 0, 0, 0, 0.191303, 0, 0.7225], [fSizeDilated, fSizeDilated]), + tf.tensor2d([0.430064, 0, 0.900622, 0, 0, 0, 0.670338, 0, 0.33478], [fSizeDilated, fSizeDilated]) + ], 2) + ], 3); + var result = tf.depthwiseConv2d(x, w, stride, pad, 'NHWC', dilation); + var expectedResult = tf.depthwiseConv2d(x, wDilated, stride, pad, 'NHWC', noDilation); + expect(result.shape).toEqual(expectedResult.shape); + test_util_1.expectArraysClose(result, expectedResult); + }); + it('Tensor3D is allowed', function () { + var fSize = 2; + var pad = 'same'; + var stride = 1; + var chMul = 3; + var inDepth = 2; + var x = tf.zeros([3, 3, inDepth]); + var w = tf.zeros([fSize, fSize, inDepth, chMul]); + var result = tf.depthwiseConv2d(x, w, stride, pad); + expect(result.shape).toEqual([3, 3, inDepth * chMul]); + }); + it('Pass null for dilations, which defaults to [1, 1]', function () { + var fSize = 2; + var pad = 'same'; + var stride = 1; + var chMul = 3; + var inDepth = 2; + var dilations = null; + var x = tf.zeros([3, 3, inDepth]); + var w = tf.zeros([fSize, fSize, inDepth, chMul]); + var result = tf.depthwiseConv2d(x, w, stride, pad, 'NHWC', dilations); + expect(result.shape).toEqual([3, 3, inDepth * chMul]); + }); + it('throws when passed x as a non-tensor', function () { + var inputDepth = 1; + var outputDepth = 1; + var fSize = 1; + var pad = 'same'; + var stride = 2; + var dataFormat = 'NHWC'; + var dilation = 2; + var w = tf.tensor4d([3], [fSize, fSize, inputDepth, outputDepth]); + var e = /Argument 'x' passed to 'depthwiseConv2d' must be a Tensor/; + expect(function () { return tf.depthwiseConv2d({}, w, stride, pad, dataFormat, dilation); }) + .toThrowError(e); + }); + it('throws when passed filter as a non-tensor', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var pad = 'same'; + var stride = 2; + var dataFormat = 'NHWC'; + var dilation = 2; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var e = /Argument 'filter' passed to 'depthwiseConv2d' must be a Tensor/; + expect(function () { return tf.depthwiseConv2d(x, {}, stride, pad, dataFormat, dilation); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var pad = 'valid'; + var stride = 1; + var x = [[ + [[0.230664], [0.987388], [0.0685208]], + [[0.419224], [0.887861], [0.731641]], + [[0.0741907], [0.409265], [0.351377]] + ]]; + var w = [[[[0.303873]], [[0.229223]]], [[[0.144333]], [[0.803373]]]]; + var result = tf.depthwiseConv2d(x, w, stride, pad); + expect(result.shape).toEqual([1, 2, 2, 1]); + var expected = [1.07022, 1.03167, 0.67041, 0.778863]; + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('depthwiseConv2d gradients', test_util_1.ALL_ENVS, function () { + var images; + var filter; + var result; + var stride = 1; + var pad = 'same'; + beforeEach(function () { + images = tf.tensor4d([ + [[[2, 3, 1], [3, 0, 2]], [[0, 4, 1], [3, 1, 3]]], + [[[2, 1, 0], [0, 3, 3]], [[4, 0, 1], [1, 4, 1]]] + ]); + filter = tf.tensor4d([ + [[[1, 1], [1, 1], [0, 0]], [[0, 1], [1, 1], [1, 1]]], + [[[1, 0], [1, 1], [0, 0]], [[0, 1], [1, 0], [0, 0]]] + ]); + result = tf.tensor4d([ + [ + [[2, 8, 8, 7, 2, 2], [6, 3, 1, 1, 0, 0]], + [[0, 3, 5, 5, 3, 3], [3, 3, 1, 1, 0, 0]] + ], + [ + [[6, 3, 8, 4, 3, 3], [1, 0, 7, 7, 0, 0]], + [[4, 5, 4, 4, 1, 1], [1, 1, 4, 4, 0, 0]] + ] + ]); + }); + it('wrt input', function () { + var _a = tf.valueAndGrad(function (x) { return tf.depthwiseConv2d(x, filter, stride, pad); })(images), value = _a.value, grad = _a.grad; + test_util_1.expectArraysClose(value, result); + var expectedGrad = tf.tensor4d([ + [[[2., 2., 0.], [3., 4., 2.]], [[3., 4., 0.], [5., 7., 2.]]], + [[[2., 2., 0.], [3., 4., 2.]], [[3., 4., 0.], [5., 7., 2.]]] + ]); + test_util_1.expectArraysClose(grad, expectedGrad); + }); + it('wrt input, squared output', function () { + var grad = tf.grad(function (x) { + return tf.square(tf.depthwiseConv2d(x, filter, stride, pad)); + })(images); + var expectedGrad = tf.tensor4d([ + [[[20., 30., 0.], [34., 34., 8.]], [[10., 50., 0.], [46., 44., 12.]]], + [[[18., 24., 0.], [8., 52., 12.]], [[30., 40., 0.], [22., 76., 4.]]] + ]); + test_util_1.expectArraysClose(grad, expectedGrad); + }); + it('wrt filter', function () { + var _a = tf.valueAndGrad(function (f) { return tf.depthwiseConv2d(images, f, stride, pad); })(filter), value = _a.value, grad = _a.grad; + test_util_1.expectArraysClose(value, result); + var expectedGrad = tf.tensor4d([ + [[[15., 15.], [16., 16.], [12., 12.]], [[7., 7.], [8., 8.], [9., 9.]]], + [[[8., 8.], [9., 9.], [6., 6.]], [[4., 4.], [5., 5.], [4., 4.]]] + ]); + test_util_1.expectArraysClose(grad, expectedGrad); + }); + it('wrt filter, squared output', function () { + var grad = tf.grad(function (f) { + return tf.square(tf.depthwiseConv2d(images, f, stride, pad)); + })(filter); + var expectedGrad = tf.tensor4d([ + [ + [[120., 122.], [180., 166.], [12., 12.]], + [[20., 76.], [90., 66.], [46., 46.]] + ], + [ + [[86., 42.], [122., 114.], [10., 10.]], + [[24., 54.], [80., 46.], [18., 18.]] + ] + ]); + test_util_1.expectArraysClose(grad, expectedGrad); + }); + it('throws error on dilations > 1', function () { + var grad = tf.grad(function (x) { + return tf.depthwiseConv2d(x, filter, stride, pad, 'NHWC', 2); + }); + expect(function () { return grad(images); }) + .toThrowError(/dilation rates greater than 1 are not yet supported/); + }); + it('wrt input, stride=2, pad=valid', function () { + var dx = tf.grad(function (x) { return tf.depthwiseConv2d(x, filter, 2, 'valid'); })(images); + test_util_1.expectArraysClose(dx, tf.tensor4d([ + [[[2., 2., 0.], [1., 2., 2.]], [[1., 2., 0.], [1., 1., 0.]]], + [[[2., 2., 0.], [1., 2., 2.]], [[1., 2., 0.], [1., 1., 0.]]] + ])); + }); + it('wrt filter, stride=2, pad=valid', function () { + var df = tf.grad(function (f) { return tf.depthwiseConv2d(images, f, 2, 'valid'); })(filter); + test_util_1.expectArraysClose(df, tf.tensor4d([ + [[[4., 4.], [4., 4.], [1., 1.]], [[3., 3.], [3., 3.], [5., 5.]]], + [[[4., 4.], [4., 4.], [2., 2.]], [[4., 4.], [5., 5.], [4., 4.]]] + ])); + }); + it('wrt input and filter, 1x3x3x1 and 2x2x1x1', function () { + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var chMul = 1; + var inDepth = 1; + var x = tf.tensor4d([ + 0.230664, 0.987388, 0.0685208, 0.419224, 0.887861, 0.731641, + 0.0741907, 0.409265, 0.351377 + ], [1, 3, 3, inDepth]); + var f = tf.tensor4d([0.303873, 0.229223, 0.144333, 0.803373], [fSize, fSize, inDepth, chMul]); + var _a = tf.grads(function (x, f) { + return tf.depthwiseConv2d(x, f, stride, pad); + })([x, f]), dx = _a[0], df = _a[1]; + test_util_1.expectArraysClose(dx, tf.tensor4d([[ + [[0.303873], [0.533096], [0.229223]], + [[0.448206], [1.480802], [1.032596]], + [[0.144333], [0.947706], [0.803373]] + ]])); + test_util_1.expectArraysClose(df, tf.tensor4d([ + [[[2.525137]], [[2.6754108]]], [[[1.7905407]], [[2.380144]]] + ])); + }); +}); +//# sourceMappingURL=conv2d_depthwise_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_depthwise_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_depthwise_test.js.map new file mode 100644 index 0000000..dfe2b91 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_depthwise_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv2d_depthwise_test.js","sourceRoot":"","sources":["../../src/ops/conv2d_depthwise_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAGzD,gCAAiB,CAAC,iBAAiB,EAAE,oBAAQ,EAAE;IAC7C,EAAE,CAAC,2CAA2C,EAAE;QAC9C,IAAM,KAAK,GAAG,CAAC,CAAC;QAChB,IAAM,GAAG,GAAG,OAAO,CAAC;QACpB,IAAM,MAAM,GAAG,CAAC,CAAC;QACjB,IAAM,KAAK,GAAG,CAAC,CAAC;QAChB,IAAM,OAAO,GAAG,CAAC,CAAC;QAElB,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CACjB;YACE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ;YAC3D,SAAS,EAAE,QAAQ,EAAE,QAAQ;SAC9B,EACD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QACxB,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CACjB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QA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,QAAQ,CAAC,CAAC;gBACpC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;aACrC,CAAC,CAAC,CAAC,CAAC;QAEL,6BAAiB,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC;YAChC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC7D,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_separable_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_separable_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_separable_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_separable_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_separable_test.js new file mode 100644 index 0000000..fee453e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_separable_test.js @@ -0,0 +1,296 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('separableConv2d', test_util_1.ALL_ENVS, function () { + it('input=1x3x3x1,f=2,s=1,d=1,p=valid,chMul=1,outDepth=2', function () { + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var chMul = 1; + var inDepth = 1; + var outDepth = 2; + var x = tf.tensor4d([ + 0.230664, 0.987388, 0.0685208, 0.419224, 0.887861, 0.731641, + 0.0741907, 0.409265, 0.351377 + ], [1, 3, 3, inDepth]); + var depthwiseFilter = tf.tensor4d([0.303873, 0.229223, 0.144333, 0.803373], [fSize, fSize, inDepth, chMul]); + var pointwiseFilter = tf.tensor4d([0.1, -0.2], [1, 1, inDepth * chMul, outDepth]); + var result = tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, stride, pad); + test_util_1.expectArraysClose(result, tf.tensor4d([ + 0.10702161, -0.21404321, 0.10316753, -0.20633507, 0.06704096, + -0.13408193, 0.07788632, -0.15577264 + ], [1, 2, 2, outDepth])); + }); + it('input=1x3x3x1,f=2,s=1,d=1,p=valid,chMul=2,outDepth=2', function () { + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var chMul = 2; + var inDepth = 1; + var outDepth = 3; + var x = tf.tensor4d([ + 0.230664, 0.987388, 0.0685208, 0.419224, 0.887861, 0.731641, + 0.0741907, 0.409265, 0.351377 + ], [1, 3, 3, inDepth]); + var depthwiseFilter = tf.tensor4d([ + 0.303873, 0.229223, 0.144333, 0.803373, -0.303873, -0.229223, + -0.144333, -0.803373 + ], [fSize, fSize, inDepth, chMul]); + var pointwiseFilter = tf.tensor4d([0.1, -0.2, -0.1, 0.2, 0.15, 0.15], [1, 1, inDepth * chMul, outDepth]); + var result = tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, stride, pad); + test_util_1.expectArraysClose(result, tf.tensor4d([ + 0.00305368, 0.0140969, 0.00980358, -0.10853045, -0.06339455, + -0.0699412, 0.11010849, 0.0347524, 0.05214475, 0.10307151, + 0.02221644, 0.04224815 + ], [1, 2, 2, outDepth])); + }); + it('input=1x3x3x1,f=2,s=1,d=1,p=valid,chMul=1,outDepth=2,3D input', function () { + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var chMul = 1; + var inDepth = 1; + var outDepth = 2; + var x = tf.tensor3d([ + 0.230664, 0.987388, 0.0685208, 0.419224, 0.887861, 0.731641, + 0.0741907, 0.409265, 0.351377 + ], [3, 3, inDepth]); + var depthwiseFilter = tf.tensor4d([0.303873, 0.229223, 0.144333, 0.803373], [fSize, fSize, inDepth, chMul]); + var pointwiseFilter = tf.tensor4d([0.1, -0.2], [1, 1, inDepth * chMul, outDepth]); + var result = tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, stride, pad); + test_util_1.expectArraysClose(result, tf.tensor3d([ + 0.10702161, -0.21404321, 0.10316753, -0.20633507, 0.06704096, + -0.13408193, 0.07788632, -0.15577264 + ], [2, 2, outDepth])); + }); + it('input=1x4x4x1,f=2,s=2,d=1,p=valid,chMul=1,outDepth=2', function () { + var fSize = 2; + var pad = 'valid'; + var stride = [2, 2]; + var chMul = 1; + var inDepth = 1; + var outDepth = 2; + var x = tf.tensor4d([ + 0.675707, 0.758567, 0.413529, 0.963967, 0.217291, 0.101335, 0.804231, + 0.329673, 0.924503, 0.728742, 0.180217, 0.210459, 0.133869, 0.650827, + 0.047613, 0.554795 + ], [1, 4, 4, inDepth]); + var depthwiseFilter = tf.tensor4d([0.303873, 0.229223, 0.144333, 0.803373], [fSize, fSize, inDepth, chMul]); + var pointwiseFilter = tf.tensor4d([0.1, -0.2], [1, 1, inDepth * chMul, outDepth]); + var result = tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, stride, pad); + test_util_1.expectArraysClose(result, tf.tensor4d([ + 0.04919822, -0.09839644, 0.07275512, -0.14551024, 0.09901544, + -0.19803089, 0.05555845, -0.11111691 + ], [1, 2, 2, outDepth])); + }); + it('input=2x4x4x1,f=2,s=2,d=1,p=valid,chMul=1,outDepth=2', function () { + var fSize = 2; + var pad = 'valid'; + var stride = [2, 2]; + var chMul = 1; + var inDepth = 1; + var outDepth = 2; + var x = tf.tensor4d([ + 0.675707, 0.758567, 0.413529, 0.963967, 0.217291, 0.101335, + 0.804231, 0.329673, 0.924503, 0.728742, 0.180217, 0.210459, + 0.133869, 0.650827, 0.047613, 0.554795, -0.675707, -0.758567, + -0.413529, -0.963967, -0.217291, -0.101335, -0.804231, -0.329673, + -0.924503, -0.728742, -0.180217, -0.210459, -0.133869, -0.650827, + -0.047613, -0.554795 + ], [2, 4, 4, inDepth]); + var depthwiseFilter = tf.tensor4d([0.303873, 0.229223, 0.144333, 0.803373], [fSize, fSize, inDepth, chMul]); + var pointwiseFilter = tf.tensor4d([0.1, -0.2], [1, 1, inDepth * chMul, outDepth]); + var result = tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, stride, pad); + test_util_1.expectArraysClose(result, tf.tensor4d([ + 0.04919822, -0.09839644, 0.07275512, -0.14551024, 0.09901544, + -0.19803089, 0.05555845, -0.11111691, -0.04919822, 0.09839644, + -0.07275512, 0.14551024, -0.09901544, 0.19803089, -0.05555845, + 0.11111691 + ], [2, 2, 2, outDepth])); + }); + it('input=1x4x4x2,f=2,s=2,d=1,p=valid,chMul=1,outDepth=2', function () { + var fSize = 2; + var pad = 'valid'; + var stride = [2, 2]; + var chMul = 1; + var inDepth = 2; + var outDepth = 2; + var x = tf.tensor4d([ + 0.675707, 0.758567, 0.413529, 0.963967, 0.217291, 0.101335, + 0.804231, 0.329673, 0.924503, 0.728742, 0.180217, 0.210459, + 0.133869, 0.650827, 0.047613, 0.554795, -0.675707, -0.758567, + -0.413529, -0.963967, -0.217291, -0.101335, -0.804231, -0.329673, + -0.924503, -0.728742, -0.180217, -0.210459, -0.133869, -0.650827, + -0.047613, -0.554795 + ], [1, 4, 4, inDepth]); + var depthwiseFilter = tf.tensor4d([ + 0.303873, 0.229223, 0.144333, 0.803373, 0.98976838, 0.56597068, + 0.42654137, 0.66445535 + ], [fSize, fSize, inDepth, chMul]); + var pointwiseFilter = tf.tensor4d([0.1, -0.2, 0.05, -0.05], [1, 1, inDepth * chMul, outDepth]); + var result = tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, stride, pad); + test_util_1.expectArraysClose(result, tf.tensor4d([ + 0.20072255, -0.32641545, 0.08474462, -0.11823604, -0.20072255, + 0.32641545, -0.08474462, 0.11823604 + ], [1, 2, 2, outDepth])); + }); + it('input=1x4x4x1,f=2,s=1,d=2,p=valid,chMul=1,outDepth=2', function () { + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var chMul = 1; + var inDepth = 1; + var outDepth = 2; + var dilationRate = 2; + var x = tf.tensor4d([ + 0.675707, 0.758567, 0.413529, 0.963967, 0.217291, 0.101335, 0.804231, + 0.329673, 0.924503, 0.728742, 0.180217, 0.210459, 0.133869, 0.650827, + 0.047613, 0.554795 + ], [1, 4, 4, inDepth]); + var depthwiseFilter = tf.tensor4d([0.303873, 0.229223, 0.144333, 0.803373], [fSize, fSize, inDepth, chMul]); + var pointwiseFilter = tf.tensor4d([0.1, -0.2], [1, 1, inDepth * chMul, outDepth]); + var result = tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, stride, pad, dilationRate); + test_util_1.expectArraysClose(result, tf.tensor4d([ + 0.05783373, -0.11566745, 0.07257301, -0.14514601, 0.03079498, + -0.06158997, 0.06460048, -0.12920095 + ], [1, 2, 2, outDepth])); + }); + it('input=1x4x4x1,f=2,s=1,d=1,p=same,chMul=1,outDepth=2', function () { + var fSize = 2; + var pad = 'same'; + var stride = 1; + var chMul = 1; + var inDepth = 1; + var outDepth = 2; + var x = tf.tensor4d([ + 0.675707, 0.758567, 0.413529, 0.963967, 0.217291, 0.101335, 0.804231, + 0.329673, 0.924503, 0.728742, 0.180217, 0.210459, 0.133869, 0.650827, + 0.047613, 0.554795 + ], [1, 4, 4, inDepth]); + var depthwiseFilter = tf.tensor4d([0.303873, 0.229223, 0.144333, 0.803373], [fSize, fSize, inDepth, chMul]); + var pointwiseFilter = tf.tensor4d([0.1, -0.2], [1, 1, inDepth * chMul, outDepth]); + var result = tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, stride, pad); + test_util_1.expectArraysClose(result, tf.tensor4d([ + 0.04919822, -0.09839644, 0.09860218, -0.19720435, 0.07275512, + -0.14551024, 0.03405062, -0.06810125, 0.08081452, -0.16162904, + 0.04651042, -0.09302084, 0.05150411, -0.10300821, 0.01305549, + -0.02611098, 0.09901544, -0.19803089, 0.03949417, -0.07898834, + 0.05555845, -0.11111691, 0.0144028, -0.02880561, 0.01898637, + -0.03797274, 0.02086828, -0.04173655, 0.01416401, -0.02832802, + 0.01685872, -0.03371745 + ], [1, 4, 4, outDepth])); + }); + it('Incorrect input rank raises error', function () { + var x = tf.zeros([4, 4]); + var depthwiseFilter = tf.zeros([2, 2, 1, 3]); + var pointwiseFilter = tf.zeros([1, 1, 2, 4]); + expect(function () { + return tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, 1, 'valid'); + }) + .toThrowError(/rank 4/); + }); + it('Incorrect depthwise filter rank raises error', function () { + var x = tf.zeros([1, 4, 4, 1]); + var depthwiseFilter = tf.zeros([2, 2, 1]); + var pointwiseFilter = tf.zeros([1, 1, 2, 4]); + expect(function () { + return tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, 1, 'valid'); + }) + .toThrowError(/rank 4/); + }); + it('Incorrect depthwise filter rank raises error', function () { + var x = tf.zeros([1, 4, 4, 1]); + var depthwiseFilter = tf.zeros([2, 2, 1, 3]); + var pointwiseFilter = tf.zeros([1, 1, 2]); + expect(function () { + return tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, 1, 'valid'); + }) + .toThrowError(/rank 4/); + }); + it('Incorrect point filter 1st dimension raises error', function () { + var x = tf.zeros([1, 4, 4, 1]); + var depthwiseFilter = tf.zeros([2, 2, 1, 3]); + var pointwiseFilter = tf.zeros([2, 1, 3, 6]); + expect(function () { + return tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, 1, 'valid'); + }) + .toThrowError(/must be 1, but got 2/); + }); + it('Incorrect point filter 2nd dimension raises error', function () { + var x = tf.zeros([1, 4, 4, 1]); + var depthwiseFilter = tf.zeros([2, 2, 1, 3]); + var pointwiseFilter = tf.zeros([1, 5, 3, 6]); + expect(function () { + return tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, 1, 'valid'); + }) + .toThrowError(/must be 1, but got 5/); + }); + it('Incorrect pointwise filter 3rd dimension raises error', function () { + var x = tf.zeros([1, 4, 4, 1]); + var depthwiseFilter = tf.zeros([2, 2, 1, 3]); + var pointwiseFilter = tf.zeros([1, 1, 4, 6]); + expect(function () { + return tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, 1, 'valid'); + }) + .toThrowError(/must be 3, but got 4/); + }); + it('throws when passed x as a non-tensor', function () { + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var chMul = 1; + var inDepth = 1; + var outDepth = 2; + var depthwiseFilter = tf.zeros([fSize, fSize, inDepth, chMul]); + var pointwiseFilter = tf.zeros([1, 1, inDepth * chMul, outDepth]); + var e = /Argument 'x' passed to 'separableConv2d' must be a Tensor/; + expect(function () { return tf.separableConv2d({}, depthwiseFilter, pointwiseFilter, stride, pad); }) + .toThrowError(e); + }); + it('throws when passed depthwiseFilter as a non-tensor', function () { + var pad = 'valid'; + var stride = 1; + var chMul = 1; + var inDepth = 1; + var outDepth = 2; + var x = tf.zeros([1, 3, 3, inDepth]); + var pointwiseFilter = tf.zeros([1, 1, inDepth * chMul, outDepth]); + var e = new RegExp('Argument \'depthwiseFilter\' passed to \'separableConv2d\'' + + ' must be a Tensor'); + expect(function () { return tf.separableConv2d(x, {}, pointwiseFilter, stride, pad); }) + .toThrowError(e); + }); + it('throws when passed pointwiseFilter as a non-tensor', function () { + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var chMul = 1; + var inDepth = 1; + var x = tf.zeros([1, 3, 3, inDepth]); + var depthwiseFilter = tf.zeros([fSize, fSize, inDepth, chMul]); + var e = new RegExp('Argument \'pointwiseFilter\' passed to \'separableConv2d\'' + + ' must be a Tensor'); + expect(function () { return tf.separableConv2d(x, depthwiseFilter, {}, stride, pad); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var pad = 'valid'; + var stride = 1; + var outDepth = 2; + var x = [ + [[0.230664], [0.987388], [0.0685208]], + [[0.419224], [0.887861], [0.731641]], + [[0.0741907], [0.409265], [0.351377]] + ]; + var depthwiseFilter = [[[[0.303873]], [[0.229223]]], [[[0.144333]], [[0.803373]]]]; + var pointwiseFilter = [[[[0.1, -0.2]]]]; + var result = tf.separableConv2d(x, depthwiseFilter, pointwiseFilter, stride, pad); + test_util_1.expectArraysClose(result, tf.tensor3d([ + 0.10702161, -0.21404321, 0.10316753, -0.20633507, 0.06704096, + -0.13408193, 0.07788632, -0.15577264 + ], [2, 2, outDepth])); + }); +}); +//# sourceMappingURL=conv2d_separable_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_separable_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_separable_test.js.map new file mode 100644 index 0000000..fd818d3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_separable_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv2d_separable_test.js","sourceRoot":"","sources":["../../src/ops/conv2d_separable_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,iBAAiB,EAAE,oBAAQ,EAAE;IAC7C,EAAE,CAAC,sDAAsD,EAAE;QACzD,IAAM,KAAK,GAAG,CAAC,CAAC;QAChB,IAAM,GAAG,GAAG,OAAO,CAAC;QACpB,IAAM,MAAM,GAAG,CAAC,CAAC;QACjB,IAAM,KAAK,GAAG,CAAC,CAAC;QAChB,IAAM,OAAO,GAAG,CAAC,CAAC;QAClB,IAAM,QAAQ,GAAG,CAAC,CAAC;QAEnB,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CACjB;YACE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ;YAC3D,SAAS,EAAE,QAAQ,EAAE,QAAQ;SAC9B,EACD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QACxB,IAAM,eAAe,GAAG,EAAE,CAAC,QAAQ,CAC/B,CAAC,QAAQ,EAAE,QAAQ,EAAE,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AC,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;SACtC,CAAC;QAEF,IAAM,eAAe,GACjB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjE,IAAM,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAE1C,IAAM,MAAM,GACR,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QAEzE,6BAAiB,CACb,MAAM,EACN,EAAE,CAAC,QAAQ,CACP;YACE,UAAU,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,UAAU;YAC5D,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC,UAAU;SACrC,EACD,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_test.js new file mode 100644 index 0000000..9de0333 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_test.js @@ -0,0 +1,192 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('conv2d', test_util_1.ALL_ENVS, function () { + it('x=[2,2,1] f=[1,1,1,2] s=1 d=1 p=0', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 1; + var pad = 0; + var stride = 1; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.tensor4d([2], [fSize, fSize, inputDepth, outputDepth]); + var result = tf.conv2d(x, w, stride, pad); + test_util_1.expectArraysClose(result, [2, 4, 6, 8]); + }); + it('x=[2,2,2,1] f=[1,1,1,1] s=1 d=1 p=0', function () { + var inputDepth = 1; + var inShape = [2, 2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 1; + var pad = 0; + var stride = 1; + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8], inShape); + var w = tf.tensor4d([2], [fSize, fSize, inputDepth, outputDepth]); + var result = tf.conv2d(x, w, stride, pad); + expect(result.shape).toEqual([2, 2, 2, 1]); + var expected = [2, 4, 6, 8, 10, 12, 14, 16]; + test_util_1.expectArraysClose(result, expected); + }); + it('x=[2,2,1] f=[2,2,1,1] s=1 d=1 p=0', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 2; + var pad = 0; + var stride = 1; + var dataFormat = 'NHWC'; + var dilation = 1; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.tensor4d([3, 1, 5, 0], [fSize, fSize, inputDepth, outputDepth]); + var result = tf.conv2d(x, w, stride, pad, dataFormat, dilation); + test_util_1.expectArraysClose(result, [20]); + }); + it('x=[4,4,1] f=[2,2,1,1] s=1 d=2 p=0', function () { + var inputDepth = 1; + var inputShape = [4, 4, inputDepth]; + var outputDepth = 1; + var fSize = 2; + var fSizeDilated = 3; + var pad = 0; + var stride = 1; + var dataFormat = 'NHWC'; + var dilation = 2; + var noDilation = 1; + var x = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], inputShape); + var w = tf.tensor4d([3, 1, 5, 2], [fSize, fSize, inputDepth, outputDepth]); + var wDilated = tf.tensor4d([3, 0, 1, 0, 0, 0, 5, 0, 2], [fSizeDilated, fSizeDilated, inputDepth, outputDepth]); + var result = tf.conv2d(x, w, stride, pad, dataFormat, dilation); + var expectedResult = tf.conv2d(x, wDilated, stride, pad, dataFormat, noDilation); + expect(result.shape).toEqual(expectedResult.shape); + test_util_1.expectArraysClose(result, expectedResult); + }); + it('throws when x is not rank 3', function () { + var inputDepth = 1; + var outputDepth = 1; + var fSize = 2; + var pad = 0; + var stride = 1; + var x = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var w = tf.tensor4d([3, 1, 5, 0], [fSize, fSize, inputDepth, outputDepth]); + expect(function () { return tf.conv2d(x, w, stride, pad); }).toThrowError(); + }); + it('throws when weights is not rank 4', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var pad = 0; + var stride = 1; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.tensor3d([3, 1, 5, 0], [2, 2, 1]); + expect(function () { return tf.conv2d(x, w, stride, pad); }).toThrowError(); + }); + it('throws when x depth does not match weight depth', function () { + var inputDepth = 1; + var wrongInputDepth = 5; + var inputShape = [2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 2; + var pad = 0; + var stride = 1; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.randomNormal([fSize, fSize, wrongInputDepth, outputDepth]); + expect(function () { return tf.conv2d(x, w, stride, pad); }).toThrowError(); + }); + it('throws when dimRoundingMode is set and pad is not a number', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 2; + var pad = 'valid'; + var stride = 1; + var dataFormat = 'NHWC'; + var dilation = 1; + var dimRoundingMode = 'round'; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.randomNormal([fSize, fSize, inputDepth, outputDepth]); + expect(function () { + return tf.conv2d(x, w, stride, pad, dataFormat, dilation, dimRoundingMode); + }) + .toThrowError(); + }); + it('throws when both stride and dilation are greater than 1', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var outputDepth = 1; + var fSize = 2; + var pad = 0; + var stride = [2, 1]; + var dataFormat = 'NHWC'; + var dilation = [1, 2]; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + var w = tf.tensor4d([3, 1, 5, 0], [fSize, fSize, inputDepth, outputDepth]); + expect(function () { return tf.conv2d(x, w, stride, pad, dataFormat, dilation); }) + .toThrowError(); + }); + it('gradient input=[3,3,1] f=[2,2,1,1] s=1 p=0', function () { + var inputDepth = 1; + var outputDepth = 1; + var inputShape = [3, 3, inputDepth]; + var filterSize = 2; + var stride = 1; + var pad = 0; + var filterShape = [filterSize, filterSize, inputDepth, outputDepth]; + var filter = tf.ones(filterShape); + var x = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9], inputShape); + var dy = tf.tensor3d([3, 1, 2, 0], [2, 2, 1]); + var grads = tf.grads(function (x, filter) { return x.conv2d(filter, stride, pad); }); + var _a = grads([x, filter], dy), dx = _a[0], dfilter = _a[1]; + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, [3, 4, 1, 5, 6, 1, 2, 2, 0]); + expect(dfilter.shape).toEqual(filterShape); + test_util_1.expectArraysClose(dfilter, [13, 19, 31, 37]); + }); + it('gradient x=[2,3,3,1] f=[2,2,1,1] s=1 p=0', function () { + var inputDepth = 1; + var outputDepth = 1; + var inputShape = [2, 3, 3, inputDepth]; + var filterSize = 2; + var stride = 1; + var pad = 0; + var filterShape = [filterSize, filterSize, inputDepth, outputDepth]; + var filter = tf.ones(filterShape); + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9], inputShape); + var dy = tf.tensor4d([3, 1, 2, 0, 3, 1, 2, 0], [2, 2, 2, 1]); + var grads = tf.grads(function (x, filter) { return x.conv2d(filter, stride, pad); }); + var _a = grads([x, filter], dy), dx = _a[0], dfilter = _a[1]; + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, [3, 4, 1, 5, 6, 1, 2, 2, 0, 3, 4, 1, 5, 6, 1, 2, 2, 0]); + expect(dfilter.shape).toEqual(filterShape); + test_util_1.expectArraysClose(dfilter, [13 * 2, 19 * 2, 31 * 2, 37 * 2]); + }); + it('throws when passed x as a non-tensor', function () { + var inputDepth = 1; + var outputDepth = 1; + var fSize = 1; + var pad = 0; + var stride = 1; + var w = tf.tensor4d([2], [fSize, fSize, inputDepth, outputDepth]); + expect(function () { return tf.conv2d({}, w, stride, pad); }) + .toThrowError(/Argument 'x' passed to 'conv2d' must be a Tensor/); + }); + it('throws when passed filter as a non-tensor', function () { + var inputDepth = 1; + var inputShape = [2, 2, inputDepth]; + var pad = 0; + var stride = 1; + var x = tf.tensor3d([1, 2, 3, 4], inputShape); + expect(function () { return tf.conv2d(x, {}, stride, pad); }) + .toThrowError(/Argument 'filter' passed to 'conv2d' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var pad = 0; + var stride = 1; + var x = [[[1], [2]], [[3], [4]]]; + var w = [[[[2]]]]; + var result = tf.conv2d(x, w, stride, pad); + test_util_1.expectArraysClose(result, [2, 4, 6, 8]); + }); +}); +//# sourceMappingURL=conv2d_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_test.js.map new file mode 100644 index 0000000..a34c5e3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv2d_test.js","sourceRoot":"","sources":["../../src/ops/conv2d_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CA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C,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QAEhD,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,EAAiB,EAAE,MAAM,EAAE,GAAG,CAAC,EAA5C,CAA4C,CAAC;aACrD,YAAY,CAAC,uDAAuD,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,GAAG,GAAG,CAAC,CAAC;QACd,IAAM,MAAM,GAAG,CAAC,CAAC;QACjB,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEpB,IAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QAC5C,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose_test.js new file mode 100644 index 0000000..dddaf02 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose_test.js @@ -0,0 +1,101 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('conv2dTranspose', test_util_1.ALL_ENVS, function () { + it('input=2x2x1,d2=1,f=2,s=1,p=0', function () { + var origInputDepth = 1; + var origOutputDepth = 1; + var inputShape = [1, 1, origOutputDepth]; + var fSize = 2; + var origPad = 0; + var origStride = 1; + var x = tf.tensor3d([2], inputShape); + var w = tf.tensor4d([3, 1, 5, 0], [fSize, fSize, origInputDepth, origOutputDepth]); + var result = tf.conv2dTranspose(x, w, [2, 2, 1], origStride, origPad); + var expected = [6, 2, 10, 0]; + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, expected); + }); + it('input=2x2x1,d2=1,f=2,s=1,p=0, batch=2', function () { + var origInputDepth = 1; + var origOutputDepth = 1; + var inputShape = [2, 1, 1, origOutputDepth]; + var fSize = 2; + var origPad = 0; + var origStride = 1; + var x = tf.tensor4d([2, 3], inputShape); + var w = tf.tensor4d([3, 1, 5, 0], [fSize, fSize, origInputDepth, origOutputDepth]); + var result = tf.conv2dTranspose(x, w, [2, 2, 2, 1], origStride, origPad); + var expected = [6, 2, 10, 0, 9, 3, 15, 0]; + expect(result.shape).toEqual([2, 2, 2, 1]); + test_util_1.expectArraysClose(result, expected); + }); + it('throws when x is not rank 3', function () { + var origInputDepth = 1; + var origOutputDepth = 1; + var fSize = 2; + var origPad = 0; + var origStride = 1; + var x = tf.tensor2d([2, 2], [2, 1]); + var w = tf.tensor4d([3, 1, 5, 0], [fSize, fSize, origInputDepth, origOutputDepth]); + expect(function () { return tf.conv2dTranspose(x, w, [2, 2, 1], origStride, origPad); }) + .toThrowError(); + }); + it('throws when weights is not rank 4', function () { + var origInputDepth = 1; + var origOutputDepth = 1; + var inputShape = [1, 1, origOutputDepth]; + var fSize = 2; + var origPad = 0; + var origStride = 1; + var x = tf.tensor3d([2], inputShape); + var w = tf.tensor3d([3, 1, 5, 0], [fSize, fSize, origInputDepth]); + expect(function () { return tf.conv2dTranspose(x, w, [2, 2, 1], origStride, origPad); }) + .toThrowError(); + }); + it('throws when x depth does not match weights original output depth', function () { + var origInputDepth = 1; + var origOutputDepth = 2; + var wrongOrigOutputDepth = 3; + var inputShape = [1, 1, origOutputDepth]; + var fSize = 2; + var origPad = 0; + var origStride = 1; + var x = tf.tensor3d([2, 2], inputShape); + var w = tf.randomNormal([fSize, fSize, origInputDepth, wrongOrigOutputDepth]); + expect(function () { return tf.conv2dTranspose(x, w, [2, 2, 2], origStride, origPad); }) + .toThrowError(); + }); + it('throws when passed x as a non-tensor', function () { + var origInputDepth = 1; + var origOutputDepth = 1; + var fSize = 2; + var origPad = 0; + var origStride = 1; + var w = tf.tensor4d([3, 1, 5, 0], [fSize, fSize, origInputDepth, origOutputDepth]); + expect(function () { return tf.conv2dTranspose({}, w, [2, 2, 1], origStride, origPad); }) + .toThrowError(/Argument 'x' passed to 'conv2dTranspose' must be a Tensor/); + }); + it('throws when passed filter as a non-tensor', function () { + var origOutputDepth = 1; + var inputShape = [1, 1, origOutputDepth]; + var origPad = 0; + var origStride = 1; + var x = tf.tensor3d([2], inputShape); + expect(function () { return tf.conv2dTranspose(x, {}, [2, 2, 1], origStride, origPad); }) + .toThrowError(/Argument 'filter' passed to 'conv2dTranspose' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var origPad = 0; + var origStride = 1; + var x = [[[2]]]; + var w = [[[[3]], [[1]]], [[[5]], [[0]]]]; + var result = tf.conv2dTranspose(x, w, [2, 2, 1], origStride, origPad); + var expected = [6, 2, 10, 0]; + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, expected); + }); +}); +//# sourceMappingURL=conv2d_transpose_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose_test.js.map new file mode 100644 index 0000000..05c4dd1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv2d_transpose_test.js","sourceRoot":"","sources":["../../src/ops/conv2d_transpose_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAGzD,gCAAiB,CAAC,iBAAiB,EAAE,oBAAQ,EAAE;IAC7C,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,cAAc,GAAG,CAAC,CAAC;QACzB,IAAM,eAAe,GAAG,CAAC,CAAC;QAC1B,IAAM,UAAU,GAA6B,CAAC,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC;QACrE,IAAM,KAAK,GAAG,CAAC,CAAC;QAChB,IAAM,OAAO,GAAG,CAAC,CAAC;QAClB,IAAM,UAAU,GAAG,CAAC,CAAC;QAErB,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvC,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CACjB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC;QAEnE,IAAM,MAAM,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACxE,IAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAE/B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,6BAAiB,CAAC,MAAM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CAAC,CAAC,CAAC,CAAC;QAE3C,IAAM,MAAM,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACxE,IAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAE/B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,6BAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts new file mode 100644 index 0000000..846670b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts @@ -0,0 +1,30 @@ +export declare type PadInfo = { + top: number; + left: number; + right: number; + bottom: number; + type: string; +}; +export declare type Conv2DInfo = { + batchSize: number; + inHeight: number; + inWidth: number; + inChannels: number; + outHeight: number; + outWidth: number; + outChannels: number; + dataFormat: 'channelsFirst' | 'channelsLast'; + strideHeight: number; + strideWidth: number; + dilationHeight: number; + dilationWidth: number; + filterHeight: number; + filterWidth: number; + padInfo: PadInfo; + inShape: [number, number, number, number]; + outShape: [number, number, number, number]; + filterShape: [number, number, number, number]; +}; +export declare function computePool2DInfo(inShape: [number, number, number, number], filterSize: [number, number] | number, strides: number | [number, number], pad: 'same' | 'valid' | number, roundingMode?: 'floor' | 'round' | 'ceil', dataFormat?: 'channelsFirst' | 'channelsLast'): Conv2DInfo; +export declare function computeConv2DInfo(inShape: [number, number, number, number], filterShape: [number, number, number, number], strides: number | [number, number], dilations: number | [number, number], pad: 'same' | 'valid' | number, roundingMode?: 'floor' | 'round' | 'ceil', depthwise?: boolean, dataFormat?: 'channelsFirst' | 'channelsLast'): Conv2DInfo; +export declare function computeDefaultPad(inputShape: [number, number, number], fieldSize: number, stride: number, dilation?: number): number; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js new file mode 100644 index 0000000..fc6721c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js @@ -0,0 +1,146 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util = require("../util"); +function computePool2DInfo(inShape, filterSize, strides, pad, roundingMode, dataFormat) { + if (dataFormat === void 0) { dataFormat = 'channelsLast'; } + var _a = parseTupleParam(filterSize), filterHeight = _a[0], filterWidth = _a[1]; + var filterShape; + if (dataFormat === 'channelsLast') { + filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]]; + } + else if (dataFormat === 'channelsFirst') { + filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]]; + } + else { + throw new Error("Unknown dataFormat " + dataFormat); + } + var dilations = 1; + return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat); +} +exports.computePool2DInfo = computePool2DInfo; +function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise, dataFormat) { + if (depthwise === void 0) { depthwise = false; } + if (dataFormat === void 0) { dataFormat = 'channelsLast'; } + var _a = [-1, -1, -1, -1], batchSize = _a[0], inHeight = _a[1], inWidth = _a[2], inChannels = _a[3]; + if (dataFormat === 'channelsLast') { + batchSize = inShape[0], inHeight = inShape[1], inWidth = inShape[2], inChannels = inShape[3]; + } + else if (dataFormat === 'channelsFirst') { + batchSize = inShape[0], inChannels = inShape[1], inHeight = inShape[2], inWidth = inShape[3]; + } + else { + throw new Error("Unknown dataFormat " + dataFormat); + } + var filterHeight = filterShape[0], filterWidth = filterShape[1], filterChannels = filterShape[3]; + var _b = parseTupleParam(strides), strideHeight = _b[0], strideWidth = _b[1]; + var _c = parseTupleParam(dilations), dilationHeight = _c[0], dilationWidth = _c[1]; + var effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); + var effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); + var _d = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode), padInfo = _d.padInfo, outHeight = _d.outHeight, outWidth = _d.outWidth; + var outChannels = depthwise ? filterChannels * inChannels : filterChannels; + var outShape; + if (dataFormat === 'channelsFirst') { + outShape = [batchSize, outChannels, outHeight, outWidth]; + } + else if (dataFormat === 'channelsLast') { + outShape = [batchSize, outHeight, outWidth, outChannels]; + } + return { + batchSize: batchSize, + dataFormat: dataFormat, + inHeight: inHeight, + inWidth: inWidth, + inChannels: inChannels, + outHeight: outHeight, + outWidth: outWidth, + outChannels: outChannels, + padInfo: padInfo, + strideHeight: strideHeight, + strideWidth: strideWidth, + filterHeight: filterHeight, + filterWidth: filterWidth, + dilationHeight: dilationHeight, + dilationWidth: dilationWidth, + inShape: inShape, + outShape: outShape, + filterShape: filterShape + }; +} +exports.computeConv2DInfo = computeConv2DInfo; +function computeOutputShape3D(inShape, fieldSize, outDepth, stride, zeroPad, roundingMode) { + if (zeroPad == null) { + zeroPad = computeDefaultPad(inShape, fieldSize, stride); + } + var inputRows = inShape[0]; + var inputCols = inShape[1]; + var outputRows = conditionalRound((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + util.assert(util.isInt(outputRows), "The output # of rows (" + outputRows + ") must be an integer. Change the " + + "stride and/or zero pad parameters"); + var outputCols = conditionalRound((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + util.assert(util.isInt(outputCols), "The output # of columns (" + outputCols + ") must be an integer. Change " + + "the stride and/or zero pad parameters"); + return [outputRows, outputCols, outDepth]; +} +function computeDefaultPad(inputShape, fieldSize, stride, dilation) { + if (dilation === void 0) { dilation = 1; } + var effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation); + return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2); +} +exports.computeDefaultPad = computeDefaultPad; +function parseTupleParam(param) { + return typeof param === 'number' ? [param, param] : param; +} +function getEffectiveFilterSize(filterSize, dilation) { + if (dilation <= 1) { + return filterSize; + } + return filterSize + (filterSize - 1) * (dilation - 1); +} +function getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode) { + var padInfo; + var outHeight; + var outWidth; + if (typeof pad === 'number') { + var padType = (pad === 0) ? 'VALID' : 'NUMBER'; + padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType }; + var outShape = computeOutputShape3D([inHeight, inWidth, 1], filterHeight, 1, strideHeight, pad, roundingMode); + outHeight = outShape[0]; + outWidth = outShape[1]; + } + else if (pad === 'same') { + outHeight = Math.ceil(inHeight / strideHeight); + outWidth = Math.ceil(inWidth / strideWidth); + var padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight; + var padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth; + var top_1 = Math.floor(padAlongHeight / 2); + var bottom = padAlongHeight - top_1; + var left = Math.floor(padAlongWidth / 2); + var right = padAlongWidth - left; + padInfo = { top: top_1, bottom: bottom, left: left, right: right, type: 'SAME' }; + } + else if (pad === 'valid') { + padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' }; + outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); + outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); + } + else { + throw Error("Unknown padding parameter: " + pad); + } + return { padInfo: padInfo, outHeight: outHeight, outWidth: outWidth }; +} +function conditionalRound(value, roundingMode) { + if (!roundingMode) { + return value; + } + switch (roundingMode) { + case 'round': + return Math.round(value); + case 'ceil': + return Math.ceil(value); + case 'floor': + return Math.floor(value); + default: + throw new Error("Unknown roundingMode " + roundingMode); + } +} +//# sourceMappingURL=conv_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js.map new file mode 100644 index 0000000..22d8626 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv_util.js","sourceRoot":"","sources":["../../src/ops/conv_util.ts"],"names":[],"mappings":";;AAiBA,8BAAgC;AAoChC,2BACI,OAAyC,EACzC,UAAmC,EAAE,OAAgC,EACrE,GAA0B,EAAE,YAAqC,EACjE,UAA2D;IAA3D,2BAAA,EAAA,2BAA2D;IACvD,IAAA,gCAAyD,EAAxD,oBAAY,EAAE,mBAAW,CAAgC;IAEhE,IAAI,WAA6C,CAAC;IAClD,IAAI,UAAU,KAAK,cAAc,EAAE;QACjC,WAAW,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;KACnE;SAAM,IAAI,UAAU,KAAK,eAAe,EAAE;QACzC,WAAW,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;KACnE;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,wBAAsB,UAAY,CAAC,CAAC;KACrD;IACD,IAAM,SAAS,GAAG,CAAC,CAAC;IAEpB,OAAO,iBAAiB,CACpB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAClE,UAAU,CAAC,CAAC;AAClB,CAAC;AApBD,8CAoBC;AAMD,2BACI,OAAyC,EACzC,WAA6C,EAC7C,OAAgC,EAAE,SAAkC,EACpE,GAA0B,EAAE,YAAqC,EACjE,SAAiB,EACjB,UAA2D;IAD3D,0BAAA,EAAA,iBAAiB;IACjB,2BAAA,EAAA,2BAA2D;IACzD,IAAA,qB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O,GAAG,WAAW,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC;KACjE;SAAM;QACL,MAAM,KAAK,CAAC,gCAA8B,GAAK,CAAC,CAAC;KAClD;IACD,OAAO,EAAC,OAAO,SAAA,EAAE,SAAS,WAAA,EAAE,QAAQ,UAAA,EAAC,CAAC;AACxC,CAAC;AAOD,0BACI,KAAa,EAAE,YAAqC;IACtD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IACD,QAAQ,YAAY,EAAE;QACpB,KAAK,OAAO;YAEV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,KAAK,MAAM;YAET,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B;YACE,MAAM,IAAI,KAAK,CAAC,0BAAwB,YAAc,CAAC,CAAC;KAC3D;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util_test.js new file mode 100644 index 0000000..a7e39b2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util_test.js @@ -0,0 +1,322 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var conv_util = require("./conv_util"); +describe('conv_util computeConvInfo', function () { + it('1x1 conv over 1x1 array with same pad', function () { + var inShape = [1, 1, 1, 1]; + var stride = 1; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [1, 1, 1, 1], stride, dilation, 'same'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(1); + expect(convInfo.outWidth).toEqual(1); + expect(convInfo.outChannels).toEqual(1); + }); + it('2x2 conv over 3x3 array with same pad', function () { + var inShape = [1, 3, 3, 1]; + var stride = 1; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 2, 1, 1], stride, dilation, 'same'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(3); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(1); + expect(convInfo.padInfo.left).toBe(0); + expect(convInfo.padInfo.right).toBe(1); + expect(convInfo.padInfo.top).toBe(0); + expect(convInfo.padInfo.bottom).toBe(1); + }); + it('2x2 conv over 3x3 array with same pad', function () { + var inShape = [1, 3, 3, 1]; + var stride = 1; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 2, 1, 1], stride, dilation, 'same'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(3); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(1); + }); + it('2x2 conv over 3x3 array with valid pad', function () { + var inShape = [1, 3, 3, 1]; + var stride = 1; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 2, 1, 1], stride, dilation, 'valid'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(2); + expect(convInfo.outWidth).toEqual(2); + expect(convInfo.outChannels).toEqual(1); + }); + it('3x3 conv over 5x5 array with same pad with stride 2', function () { + var inShape = [1, 5, 5, 1]; + var stride = 2; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [3, 3, 1, 1], stride, dilation, 'same'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(3); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(1); + expect(convInfo.padInfo.left).toBe(1); + expect(convInfo.padInfo.right).toBe(1); + expect(convInfo.padInfo.top).toBe(1); + expect(convInfo.padInfo.bottom).toBe(1); + }); + it('2x2 conv over 3x3 array with valid pad with stride 2', function () { + var inShape = [1, 3, 3, 1]; + var stride = 2; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 2, 1, 1], stride, dilation, 'valid'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(1); + expect(convInfo.outWidth).toEqual(1); + expect(convInfo.outChannels).toEqual(1); + }); + it('2x1 conv over 3x3 array with valid pad with stride 1', function () { + var inShape = [1, 3, 3, 1]; + var stride = 1; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 1, 1, 1], stride, dilation, 'valid'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(2); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(1); + }); + it('2x1 conv over 3x3 array with valid pad with strides h=2, w=1', function () { + var inShape = [1, 3, 3, 1]; + var strides = [2, 1]; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 1, 1, 1], strides, dilation, 'valid'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(1); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(1); + }); + it('1x2 conv over 3x3 array with valid pad with stride 1', function () { + var inShape = [1, 3, 3, 1]; + var stride = 1; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [1, 2, 1, 1], stride, dilation, 'valid'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(3); + expect(convInfo.outWidth).toEqual(2); + expect(convInfo.outChannels).toEqual(1); + }); + it('1x2 conv over 3x3 array with valid pad with stride 1, batch=5', function () { + var inShape = [5, 3, 3, 1]; + var stride = 1; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [1, 2, 1, 1], stride, dilation, 'valid'); + expect(convInfo.batchSize).toEqual(5); + expect(convInfo.outHeight).toEqual(3); + expect(convInfo.outWidth).toEqual(2); + expect(convInfo.outChannels).toEqual(1); + }); + it('2x2 conv over 3x3 array with same pad with dilations 2', function () { + var inShape = [1, 3, 3, 1]; + var stride = 1; + var dilations = 2; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 2, 1, 1], stride, dilations, 'same'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(3); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(1); + expect(convInfo.padInfo.left).toBe(1); + expect(convInfo.padInfo.right).toBe(1); + expect(convInfo.padInfo.top).toBe(1); + expect(convInfo.padInfo.bottom).toBe(1); + }); + it('2x1 conv over 3x3 array with same pad with dilations 2', function () { + var inShape = [1, 3, 3, 1]; + var stride = 1; + var dilations = 2; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 1, 1, 1], stride, dilations, 'same'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(3); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(1); + expect(convInfo.padInfo.left).toBe(0); + expect(convInfo.padInfo.right).toBe(0); + expect(convInfo.padInfo.top).toBe(1); + expect(convInfo.padInfo.bottom).toBe(1); + }); + it('3x4 conv over 8x8 array with same pad with dilations h=4 w=3', function () { + var inShape = [1, 8, 8, 1]; + var stride = 1; + var dilations = [4, 3]; + var convInfo = conv_util.computeConv2DInfo(inShape, [3, 4, 1, 1], stride, dilations, 'same'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(8); + expect(convInfo.outWidth).toEqual(8); + expect(convInfo.outChannels).toEqual(1); + expect(convInfo.padInfo.left).toBe(4); + expect(convInfo.padInfo.right).toBe(5); + expect(convInfo.padInfo.top).toBe(4); + expect(convInfo.padInfo.bottom).toBe(4); + }); + it('2x1 conv over 3x3 array with valid pad with dilations 2', function () { + var inShape = [1, 3, 3, 1]; + var stride = 1; + var dilations = 2; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 1, 1, 1], stride, dilations, 'valid'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(1); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(1); + }); + it('2x2 conv over 3x3 array with valid pad with dilations 2', function () { + var inShape = [1, 3, 3, 1]; + var stride = 1; + var dilations = 2; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 2, 1, 1], stride, dilations, 'valid'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(1); + expect(convInfo.outWidth).toEqual(1); + expect(convInfo.outChannels).toEqual(1); + }); + it('2x2 conv over 4x4 array with valid pad with dilations 2', function () { + var inShape = [1, 4, 4, 1]; + var stride = 1; + var dilations = 2; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 2, 1, 1], stride, dilations, 'valid'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(2); + expect(convInfo.outWidth).toEqual(2); + expect(convInfo.outChannels).toEqual(1); + }); +}); +describe('conv_util computeConv2DInfo with depthwise=true', function () { + it('1x1 filter over 1x1 array with same pad', function () { + var inChannels = 1; + var inShape = [1, 1, 1, inChannels]; + var fSize = 1; + var chMul = 1; + var stride = 1; + var dilation = 1; + var pad = 'same'; + var convInfo = conv_util.computeConv2DInfo(inShape, [fSize, fSize, inChannels, chMul], stride, dilation, pad, null, true); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(1); + expect(convInfo.outWidth).toEqual(1); + expect(convInfo.outChannels).toEqual(1); + }); + it('2x2 filter over 3x3 array with same pad, chMul=3, depth=2', function () { + var inChannels = 2; + var batchSize = 1; + var inSize = 3; + var inShape = [batchSize, inSize, inSize, inChannels]; + var fSize = 2; + var chMul = 3; + var stride = 1; + var dilation = 1; + var pad = 'same'; + var convInfo = conv_util.computeConv2DInfo(inShape, [fSize, fSize, inChannels, chMul], stride, dilation, pad, null, true); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(3); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(6); + }); + it('2x2 filter over 3x3 array with valid pad, chMul=3, depth=2', function () { + var inChannels = 2; + var batchSize = 1; + var inSize = 3; + var inShape = [batchSize, inSize, inSize, inChannels]; + var fSize = 2; + var chMul = 3; + var stride = 1; + var dilation = 1; + var pad = 'valid'; + var convInfo = conv_util.computeConv2DInfo(inShape, [fSize, fSize, inChannels, chMul], stride, dilation, pad, null, true); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(2); + expect(convInfo.outWidth).toEqual(2); + expect(convInfo.outChannels).toEqual(6); + }); +}); +describe('conv_util computeConvInfo channelsFirst', function () { + it('2x2 conv over 3x3 array with same pad', function () { + var inDepth = 2; + var outDepth = 4; + var inShape = [1, inDepth, 3, 3]; + var stride = 1; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 2, inDepth, outDepth], stride, dilation, 'same', null, false, 'channelsFirst'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(3); + expect(convInfo.outWidth).toEqual(3); + expect(convInfo.outChannels).toEqual(4); + expect(convInfo.outShape).toEqual([1, 4, 3, 3]); + expect(convInfo.padInfo.left).toBe(0); + expect(convInfo.padInfo.right).toBe(1); + expect(convInfo.padInfo.top).toBe(0); + expect(convInfo.padInfo.bottom).toBe(1); + }); + it('2x2 conv over 3x3 array with valid pad', function () { + var inDepth = 6; + var outDepth = 16; + var inShape = [1, inDepth, 3, 3]; + var stride = 1; + var dilation = 1; + var convInfo = conv_util.computeConv2DInfo(inShape, [2, 2, inDepth, outDepth], stride, dilation, 'valid', null, false, 'channelsFirst'); + expect(convInfo.batchSize).toEqual(1); + expect(convInfo.outHeight).toEqual(2); + expect(convInfo.outWidth).toEqual(2); + expect(convInfo.outChannels).toEqual(16); + expect(convInfo.outShape).toEqual([1, 16, 2, 2]); + expect(convInfo.padInfo.left).toBe(0); + expect(convInfo.padInfo.right).toBe(0); + expect(convInfo.padInfo.top).toBe(0); + expect(convInfo.padInfo.bottom).toBe(0); + }); +}); +describe('conv_util computeConvInfo roundingMode', function () { + var inChannels = 6; + var batchSize = 1; + var inSize = 5; + var inShape = [batchSize, inSize, inSize, inChannels]; + var fSize = 2; + var chMul = 12; + var stride = 2; + var dilation = 1; + var pad = 1; + it('should fail computing the output dimension of Conv Layer', function () { + expect(function () { return conv_util.computeConv2DInfo(inShape, [fSize, fSize, inChannels, chMul], stride, dilation, pad); }) + .toThrowError(); + }); + it('Floor the output dimension of Conv Layer', function () { + var convInfo = conv_util.computeConv2DInfo(inShape, [fSize, fSize, inChannels, chMul], stride, dilation, pad, 'floor'); + expect(convInfo.outShape).toEqual([batchSize, 3, 3, chMul]); + }); + it('Round the output dimension of Conv Layer', function () { + var convInfo = conv_util.computeConv2DInfo(inShape, [fSize, fSize, inChannels, chMul], stride, dilation, pad, 'round'); + expect(convInfo.outShape).toEqual([batchSize, 4, 4, chMul]); + }); + it('Ceil the output dimension of Conv Layer', function () { + var convInfo = conv_util.computeConv2DInfo(inShape, [fSize, fSize, inChannels, chMul], stride, dilation, pad, 'ceil'); + expect(convInfo.outShape).toEqual([batchSize, 4, 4, chMul]); + }); +}); +describe('conv_util computePoolInfo roundingMode', function () { + var inChannels = 6; + var batchSize = 1; + var inSize = 5; + var inShape = [batchSize, inSize, inSize, inChannels]; + var fSize = 2; + var stride = 2; + var pad = 1; + it('should fail computing the output dimension of Pool Layer', function () { + expect(function () { return conv_util.computePool2DInfo(inShape, [fSize, fSize], stride, pad); }) + .toThrowError(); + }); + it('Floor the output dimension of Pool Layer', function () { + var poolInfo = conv_util.computePool2DInfo(inShape, [fSize, fSize], stride, pad, 'floor'); + expect(poolInfo.outShape).toEqual([batchSize, 3, 3, inChannels]); + }); + it('Round the output dimension of Pool Layer', function () { + var poolInfo = conv_util.computePool2DInfo(inShape, [fSize, fSize], stride, pad, 'round'); + expect(poolInfo.outShape).toEqual([batchSize, 4, 4, inChannels]); + }); + it('Ceil the output dimension of Pool Layer', function () { + var poolInfo = conv_util.computePool2DInfo(inShape, [fSize, fSize], stride, pad, 'ceil'); + expect(poolInfo.outShape).toEqual([batchSize, 4, 4, inChannels]); + }); +}); +//# sourceMappingURL=conv_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util_test.js.map new file mode 100644 index 0000000..784d7d5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv_util_test.js","sourceRoot":"","sources":["../../src/ops/conv_util_test.ts"],"names":[],"mappings":";;AAiBA,uCAAyC;AAEzC,QAAQ,CAAC,2BAA2B,EAAE;IACpC,EAAE,CAAC,uCAAuC,EAAE;QAC1C,IAAM,OAAO,GAAqC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/D,IAAM,MAAM,GAAG,CAAC,CAAC;QACjB,IAAM,QAAQ,GAAG,CAAC,CAAC;QACnB,IAAM,QAAQ,GAAG,SAAS,CAAC,iBAAiB,CACxC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACrD,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAA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AAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE;QAC5C,IAAM,QAAQ,GAAG,SAAS,CAAC,iBAAiB,CACxC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAElD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts new file mode 100644 index 0000000..04a64d4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts @@ -0,0 +1,6 @@ +export declare const ERF_P = 0.3275911; +export declare const ERF_A1 = 0.254829592; +export declare const ERF_A2 = -0.284496736; +export declare const ERF_A3 = 1.421413741; +export declare const ERF_A4 = -1.453152027; +export declare const ERF_A5 = 1.061405429; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js new file mode 100644 index 0000000..0987a81 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ERF_P = 0.3275911; +exports.ERF_A1 = 0.254829592; +exports.ERF_A2 = -0.284496736; +exports.ERF_A3 = 1.421413741; +exports.ERF_A4 = -1.453152027; +exports.ERF_A5 = 1.061405429; +//# sourceMappingURL=erf_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js.map new file mode 100644 index 0000000..d67cb7d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"erf_util.js","sourceRoot":"","sources":["../../src/ops/erf_util.ts"],"names":[],"mappings":";;AAiBa,QAAA,KAAK,GAAG,SAAS,CAAC;AAClB,QAAA,MAAM,GAAG,WAAW,CAAC;AACrB,QAAA,MAAM,GAAG,CAAC,WAAW,CAAC;AACtB,QAAA,MAAM,GAAG,WAAW,CAAC;AACrB,QAAA,MAAM,GAAG,CAAC,WAAW,CAAC;AACtB,QAAA,MAAM,GAAG,WAAW,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops.d.ts new file mode 100644 index 0000000..7e88df3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops.d.ts @@ -0,0 +1,11 @@ +import { Tensor1D, Tensor2D, Tensor3D, Tensor4D } from '../tensor'; +import { TensorLike } from '../types'; +declare function resizeBilinear_(images: T | TensorLike, size: [number, number], alignCorners?: boolean): T; +declare function resizeNearestNeighbor_(images: T | TensorLike, size: [number, number], alignCorners?: boolean): T; +declare function nonMaxSuppression_(boxes: Tensor2D | TensorLike, scores: Tensor1D | TensorLike, maxOutputSize: number, iouThreshold?: number, scoreThreshold?: number): Tensor1D; +declare function nonMaxSuppressionAsync_(boxes: Tensor2D | TensorLike, scores: Tensor1D | TensorLike, maxOutputSize: number, iouThreshold?: number, scoreThreshold?: number): Promise; +export declare const resizeBilinear: typeof resizeBilinear_; +export declare const resizeNearestNeighbor: typeof resizeNearestNeighbor_; +export declare const nonMaxSuppression: typeof nonMaxSuppression_; +export declare const nonMaxSuppressionAsync: typeof nonMaxSuppressionAsync_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops.js new file mode 100644 index 0000000..1c78459 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops.js @@ -0,0 +1,168 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var non_max_suppression_impl_1 = require("../kernels/non_max_suppression_impl"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var operation_1 = require("./operation"); +function resizeBilinear_(images, size, alignCorners) { + if (alignCorners === void 0) { alignCorners = false; } + var $images = tensor_util_env_1.convertToTensor(images, 'images', 'resizeBilinear'); + util.assert($images.rank === 3 || $images.rank === 4, "Error in resizeBilinear: x must be rank 3 or 4, but got " + + ("rank " + $images.rank + ".")); + util.assert(size.length === 2, "Error in resizeBilinear: new shape must 2D, but got shape " + + (size + ".")); + var batchImages = $images; + var reshapedTo4D = false; + if ($images.rank === 3) { + reshapedTo4D = true; + batchImages = + $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]); + } + var newHeight = size[0], newWidth = size[1]; + var forward = function (backend, save) { + return backend.resizeBilinear(batchImages, newHeight, newWidth, alignCorners); + }; + var backward = function (dy, saved) { + return { + batchImages: function () { return environment_1.ENV.engine.runKernel(function (backend) { + return backend.resizeBilinearBackprop(dy, batchImages, alignCorners); + }, {}); } + }; + }; + var res = environment_1.ENV.engine.runKernel(forward, { batchImages: batchImages }, backward); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +function resizeNearestNeighbor_(images, size, alignCorners) { + if (alignCorners === void 0) { alignCorners = false; } + var $images = tensor_util_env_1.convertToTensor(images, 'images', 'resizeNearestNeighbor'); + util.assert($images.rank === 3 || $images.rank === 4, "Error in resizeNearestNeighbor: x must be rank 3 or 4, but got " + + ("rank " + $images.rank + ".")); + util.assert(size.length === 2, "Error in resizeNearestNeighbor: new shape must 2D, but got shape " + + (size + ".")); + util.assert($images.dtype === 'float32' || $images.dtype === 'int32', '`images` must have `int32` or `float32` as dtype'); + var batchImages = $images; + var reshapedTo4D = false; + if ($images.rank === 3) { + reshapedTo4D = true; + batchImages = + $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]); + } + var newHeight = size[0], newWidth = size[1]; + var forward = function (backend, save) { + return backend.resizeNearestNeighbor(batchImages, newHeight, newWidth, alignCorners); + }; + var backward = function (dy, saved) { + return { + batchImages: function () { return environment_1.ENV.engine.runKernel(function (backend) { return backend.resizeNearestNeighborBackprop(dy, batchImages, alignCorners); }, {}); } + }; + }; + var res = environment_1.ENV.engine.runKernel(forward, { batchImages: batchImages }, backward); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +function nonMaxSuppression_(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + if (iouThreshold === void 0) { iouThreshold = 0.5; } + if (scoreThreshold === void 0) { scoreThreshold = Number.NEGATIVE_INFINITY; } + var $boxes = tensor_util_env_1.convertToTensor(boxes, 'boxes', 'nonMaxSuppression'); + var $scores = tensor_util_env_1.convertToTensor(scores, 'scores', 'nonMaxSuppression'); + var inputs = nonMaxSuppSanityCheck($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold); + maxOutputSize = inputs.maxOutputSize; + iouThreshold = inputs.iouThreshold; + scoreThreshold = inputs.scoreThreshold; + return environment_1.ENV.engine.runKernel(function (b) { return b.nonMaxSuppression($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold); }, { $boxes: $boxes }); +} +function nonMaxSuppressionAsync_(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + if (iouThreshold === void 0) { iouThreshold = 0.5; } + if (scoreThreshold === void 0) { scoreThreshold = Number.NEGATIVE_INFINITY; } + return __awaiter(this, void 0, void 0, function () { + var $boxes, $scores, inputs, boxesVals, scoresVals, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + $boxes = tensor_util_env_1.convertToTensor(boxes, 'boxes', 'nonMaxSuppressionAsync'); + $scores = tensor_util_env_1.convertToTensor(scores, 'scores', 'nonMaxSuppressionAsync'); + inputs = nonMaxSuppSanityCheck($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold); + maxOutputSize = inputs.maxOutputSize; + iouThreshold = inputs.iouThreshold; + scoreThreshold = inputs.scoreThreshold; + return [4, $boxes.data()]; + case 1: + boxesVals = _a.sent(); + return [4, $scores.data()]; + case 2: + scoresVals = _a.sent(); + res = non_max_suppression_impl_1.nonMaxSuppressionImpl(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold); + if ($boxes !== boxes) { + $boxes.dispose(); + } + if ($scores !== scores) { + $scores.dispose(); + } + return [2, res]; + } + }); + }); +} +function nonMaxSuppSanityCheck(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + if (iouThreshold == null) { + iouThreshold = 0.5; + } + if (scoreThreshold == null) { + scoreThreshold = Number.NEGATIVE_INFINITY; + } + var numBoxes = boxes.shape[0]; + maxOutputSize = Math.min(maxOutputSize, numBoxes); + util.assert(0 <= iouThreshold && iouThreshold <= 1, "iouThreshold must be in [0, 1], but was '" + iouThreshold + "'"); + util.assert(boxes.rank === 2, "boxes must be a 2D tensor, but was of rank '" + boxes.rank + "'"); + util.assert(boxes.shape[1] === 4, "boxes must have 4 columns, but 2nd dimension was " + boxes.shape[1]); + util.assert(scores.rank === 1, 'scores must be a 1D tensor'); + util.assert(scores.shape[0] === numBoxes, "scores has incompatible shape with boxes. Expected " + numBoxes + ", " + + ("but was " + scores.shape[0])); + return { maxOutputSize: maxOutputSize, iouThreshold: iouThreshold, scoreThreshold: scoreThreshold }; +} +exports.resizeBilinear = operation_1.op({ resizeBilinear_: resizeBilinear_ }); +exports.resizeNearestNeighbor = operation_1.op({ resizeNearestNeighbor_: resizeNearestNeighbor_ }); +exports.nonMaxSuppression = operation_1.op({ nonMaxSuppression_: nonMaxSuppression_ }); +exports.nonMaxSuppressionAsync = nonMaxSuppressionAsync_; +//# sourceMappingURL=image_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops.js.map new file mode 100644 index 0000000..4d626c2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs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AAC;IAC7D,IAAI,CAAC,MAAM,CACP,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAC5B,wDAAsD,QAAQ,OAAI;SAC9D,aAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAG,CAAA,CAAC,CAAC;IACtC,OAAO,EAAC,aAAa,eAAA,EAAE,YAAY,cAAA,EAAE,cAAc,gBAAA,EAAC,CAAC;AACvD,CAAC;AAEY,QAAA,cAAc,GAAG,cAAE,CAAC,EAAC,eAAe,iBAAA,EAAC,CAAC,CAAC;AACvC,QAAA,qBAAqB,GAAG,cAAE,CAAC,EAAC,sBAAsB,wBAAA,EAAC,CAAC,CAAC;AACrD,QAAA,iBAAiB,GAAG,cAAE,CAAC,EAAC,kBAAkB,oBAAA,EAAC,CAAC,CAAC;AAC7C,QAAA,sBAAsB,GAAG,uBAAuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops_test.js new file mode 100644 index 0000000..13e895c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops_test.js @@ -0,0 +1,211 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('nonMaxSuppression', test_util_1.ALL_ENVS, function () { + it('select from three clusters', function () { + var boxes = tf.tensor2d([ + 0, 0, 1, 1, 0, 0.1, 1, 1.1, 0, -0.1, 1, 0.9, + 0, 10, 1, 11, 0, 10.1, 1, 11.1, 0, 100, 1, 101 + ], [6, 4]); + var scores = tf.tensor1d([0.9, 0.75, 0.6, 0.95, 0.5, 0.3]); + var maxOutputSize = 3; + var iouThreshold = 0.5; + var scoreThreshold = 0; + var indices = tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); + expect(indices.shape).toEqual([3]); + test_util_1.expectArraysEqual(indices, [3, 0, 5]); + }); + it('select from three clusters flipped coordinates', function () { + var boxes = tf.tensor2d([ + 1, 1, 0, 0, 0, 0.1, 1, 1.1, 0, .9, 1, -0.1, + 0, 10, 1, 11, 1, 10.1, 0, 11.1, 1, 101, 0, 100 + ], [6, 4]); + var scores = tf.tensor1d([0.9, 0.75, 0.6, 0.95, 0.5, 0.3]); + var maxOutputSize = 3; + var iouThreshold = 0.5; + var scoreThreshold = 0; + var indices = tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); + expect(indices.shape).toEqual([3]); + test_util_1.expectArraysEqual(indices, [3, 0, 5]); + }); + it('select at most two boxes from three clusters', function () { + var boxes = tf.tensor2d([ + 0, 0, 1, 1, 0, 0.1, 1, 1.1, 0, -0.1, 1, 0.9, + 0, 10, 1, 11, 0, 10.1, 1, 11.1, 0, 100, 1, 101 + ], [6, 4]); + var scores = tf.tensor1d([0.9, 0.75, 0.6, 0.95, 0.5, 0.3]); + var maxOutputSize = 2; + var iouThreshold = 0.5; + var scoreThreshold = 0; + var indices = tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); + expect(indices.shape).toEqual([2]); + test_util_1.expectArraysEqual(indices, [3, 0]); + }); + it('select at most thirty boxes from three clusters', function () { + var boxes = tf.tensor2d([ + 0, 0, 1, 1, 0, 0.1, 1, 1.1, 0, -0.1, 1, 0.9, + 0, 10, 1, 11, 0, 10.1, 1, 11.1, 0, 100, 1, 101 + ], [6, 4]); + var scores = tf.tensor1d([0.9, 0.75, 0.6, 0.95, 0.5, 0.3]); + var maxOutputSize = 30; + var iouThreshold = 0.5; + var scoreThreshold = 0; + var indices = tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); + expect(indices.shape).toEqual([3]); + test_util_1.expectArraysEqual(indices, [3, 0, 5]); + }); + it('select single box', function () { + var boxes = tf.tensor2d([0, 0, 1, 1], [1, 4]); + var scores = tf.tensor1d([0.9]); + var maxOutputSize = 3; + var iouThreshold = 0.5; + var scoreThreshold = 0; + var indices = tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); + expect(indices.shape).toEqual([1]); + test_util_1.expectArraysEqual(indices, [0]); + }); + it('select from ten identical boxes', function () { + var boxes = tf.tensor2d([0, 0, 1, 1], [1, 4]); + var scores = tf.tensor1d([0.9]); + var maxOutputSize = 3; + var iouThreshold = 0.5; + var scoreThreshold = 0; + var indices = tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); + expect(indices.shape).toEqual([1]); + test_util_1.expectArraysEqual(indices, [0]); + }); + it('select from ten identical boxes', function () { + var numBoxes = 10; + var corners = Array(numBoxes) + .fill(0) + .map(function (_) { return [0, 0, 1, 1]; }) + .reduce(function (arr, curr) { return arr.concat(curr); }); + var boxes = tf.tensor2d(corners, [numBoxes, 4]); + var scores = tf.tensor1d(Array(numBoxes).fill(0.9)); + var maxOutputSize = 3; + var iouThreshold = 0.5; + var scoreThreshold = 0; + var indices = tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); + expect(indices.shape).toEqual([1]); + test_util_1.expectArraysEqual(indices, [0]); + }); + it('inconsistent box and score shapes', function () { + var boxes = tf.tensor2d([ + 0, 0, 1, 1, 0, 0.1, 1, 1.1, 0, -0.1, 1, 0.9, + 0, 10, 1, 11, 0, 10.1, 1, 11.1, 0, 100, 1, 101 + ], [6, 4]); + var scores = tf.tensor1d([0.9, 0.75, 0.6, 0.95, 0.5]); + var maxOutputSize = 30; + var iouThreshold = 0.5; + var scoreThreshold = 0; + expect(function () { return tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); }) + .toThrowError(/scores has incompatible shape with boxes/); + }); + it('invalid iou threshold', function () { + var boxes = tf.tensor2d([0, 0, 1, 1], [1, 4]); + var scores = tf.tensor1d([0.9]); + var maxOutputSize = 3; + var iouThreshold = 1.2; + var scoreThreshold = 0; + expect(function () { return tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); }) + .toThrowError(/iouThreshold must be in \[0, 1\]/); + }); + it('empty input', function () { + var boxes = tf.tensor2d([], [0, 4]); + var scores = tf.tensor1d([]); + var maxOutputSize = 3; + var iouThreshold = 0.5; + var scoreThreshold = 0; + var indices = tf.image.nonMaxSuppression(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold); + expect(indices.shape).toEqual([0]); + test_util_1.expectArraysEqual(indices, []); + }); + it('accepts a tensor-like object', function () { + var boxes = [[0, 0, 1, 1], [0, 1, 1, 2]]; + var scores = [1, 2]; + var indices = tf.image.nonMaxSuppression(boxes, scores, 10); + expect(indices.shape).toEqual([2]); + expect(indices.dtype).toEqual('int32'); + test_util_1.expectArraysEqual(indices, [1, 0]); + }); +}); +jasmine_util_1.describeWithFlags('nonMaxSuppressionAsync', test_util_1.ALL_ENVS, function () { + it('select from three clusters', function () { return __awaiter(_this, void 0, void 0, function () { + var boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, indices; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + boxes = tf.tensor2d([ + 0, 0, 1, 1, 0, 0.1, 1, 1.1, 0, -0.1, 1, 0.9, + 0, 10, 1, 11, 0, 10.1, 1, 11.1, 0, 100, 1, 101 + ], [6, 4]); + scores = tf.tensor1d([0.9, 0.75, 0.6, 0.95, 0.5, 0.3]); + maxOutputSize = 3; + iouThreshold = 0.5; + scoreThreshold = 0; + return [4, tf.image.nonMaxSuppressionAsync(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold)]; + case 1: + indices = _a.sent(); + expect(indices.shape).toEqual([3]); + test_util_1.expectArraysEqual(indices, [3, 0, 5]); + return [2]; + } + }); + }); }); + it('accepts a tensor-like object', function () { return __awaiter(_this, void 0, void 0, function () { + var boxes, scores, indices; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + boxes = [[0, 0, 1, 1], [0, 1, 1, 2]]; + scores = [1, 2]; + return [4, tf.image.nonMaxSuppressionAsync(boxes, scores, 10)]; + case 1: + indices = _a.sent(); + expect(indices.shape).toEqual([2]); + expect(indices.dtype).toEqual('int32'); + test_util_1.expectArraysEqual(indices, [1, 0]); + return [2]; + } + }); + }); }); +}); +//# sourceMappingURL=image_ops_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops_test.js.map new file mode 100644 index 0000000..013048a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/image_ops_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"image_ops_test.js","sourceRoot":"","sources":["../../src/ops/image_ops_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,iBAyMA;;AAzMA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,mBAAmB,EAAE,oBAAQ,EAAE;IAC/C,EAAE,CAAC,4BAA4B,EAAE;QAC/B,IAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,CACrB;YACE,CAAC,EAAE,CAAC,EAAG,CAAC,EAAE,CAAC,EAAG,CAAC,EAAE,GAAG,EAAG,CAAC,EAAE,GAAG,EAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG;YAC/C,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAG,CAAC,EAAE,GAAG;SAChD,EACD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACZ,IAAM,MAAM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,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;oBACrC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBACN,WAAM,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,EAAA;;oBAAlE,OAAO,GAAG,SAAwD;oBACxE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACnC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;oBACvC,6BAAiB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;;;;SACpC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops.d.ts new file mode 100644 index 0000000..5405f88 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops.d.ts @@ -0,0 +1,6 @@ +import { Tensor, Tensor1D, Tensor2D } from '../tensor'; +declare function gramSchmidt_(xs: Tensor1D[] | Tensor2D): Tensor1D[] | Tensor2D; +declare function qr_(x: Tensor, fullMatrices?: boolean): [Tensor, Tensor]; +export declare const gramSchmidt: typeof gramSchmidt_; +export declare const qr: typeof qr_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops.js new file mode 100644 index 0000000..00fcc48 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops.js @@ -0,0 +1,144 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var globals_1 = require("../globals"); +var util_1 = require("../util"); +var array_ops_1 = require("./array_ops"); +var norm_1 = require("./norm"); +var operation_1 = require("./operation"); +var reduction_ops_1 = require("./reduction_ops"); +var tensor_ops_1 = require("./tensor_ops"); +function gramSchmidt_(xs) { + var inputIsTensor2D; + if (Array.isArray(xs)) { + inputIsTensor2D = false; + util_1.assert(xs != null && xs.length > 0, 'Gram-Schmidt process: input must not be null, undefined, or empty'); + var dim = xs[0].shape[0]; + for (var i = 1; i < xs.length; ++i) { + util_1.assert(xs[i].shape[0] === dim, 'Gram-Schmidt: Non-unique lengths found in the input vectors: ' + + ("(" + xs[i].shape[0] + " vs. " + dim + ")")); + } + } + else { + inputIsTensor2D = true; + xs = array_ops_1.split(xs, xs.shape[0], 0).map(function (x) { return array_ops_1.squeeze(x, [0]); }); + } + util_1.assert(xs.length <= xs[0].shape[0], "Gram-Schmidt: Number of vectors (" + xs.length + ") exceeds " + + ("number of dimensions (" + xs[0].shape[0] + ").")); + var ys = []; + var xs1d = xs; + var _loop_1 = function (i) { + ys.push(environment_1.ENV.engine.tidy(function () { + var x = xs1d[i]; + if (i > 0) { + for (var j = 0; j < i; ++j) { + var proj = reduction_ops_1.sum(ys[j].mulStrict(x)).mul(ys[j]); + x = x.sub(proj); + } + } + return x.div(norm_1.norm(x, 'euclidean')); + })); + }; + for (var i = 0; i < xs.length; ++i) { + _loop_1(i); + } + if (inputIsTensor2D) { + return array_ops_1.stack(ys, 0); + } + else { + return ys; + } +} +function qr_(x, fullMatrices) { + if (fullMatrices === void 0) { fullMatrices = false; } + if (x.rank < 2) { + throw new Error("qr() requires input tensor to have a rank >= 2, but got rank " + x.rank); + } + else if (x.rank === 2) { + return qr2d(x, fullMatrices); + } + else { + var outerDimsProd = x.shape.slice(0, x.shape.length - 2) + .reduce(function (value, prev) { return value * prev; }); + var x2ds = array_ops_1.unstack(x.reshape([ + outerDimsProd, x.shape[x.shape.length - 2], + x.shape[x.shape.length - 1] + ]), 0); + var q2ds_1 = []; + var r2ds_1 = []; + x2ds.forEach(function (x2d) { + var _a = qr2d(x2d, fullMatrices), q2d = _a[0], r2d = _a[1]; + q2ds_1.push(q2d); + r2ds_1.push(r2d); + }); + var q = array_ops_1.stack(q2ds_1, 0).reshape(x.shape); + var r = array_ops_1.stack(r2ds_1, 0).reshape(x.shape); + return [q, r]; + } +} +function qr2d(x, fullMatrices) { + if (fullMatrices === void 0) { fullMatrices = false; } + return environment_1.ENV.engine.tidy(function () { + if (x.shape.length !== 2) { + throw new Error("qr2d() requires a 2D Tensor, but got a " + x.shape.length + "D Tensor."); + } + var m = x.shape[0]; + var n = x.shape[1]; + var q = array_ops_1.eye(m); + var r = x.clone(); + var one2D = tensor_ops_1.tensor2d([[1]], [1, 1]); + var w = one2D.clone(); + var iters = m >= n ? n : m; + var _loop_2 = function (j) { + var _a; + var rTemp = r; + var wTemp = w; + var qTemp = q; + _a = environment_1.ENV.engine.tidy(function () { + var rjEnd1 = r.slice([j, j], [m - j, 1]); + var normX = rjEnd1.norm(); + var rjj = r.slice([j, j], [1, 1]); + var s = rjj.sign().neg(); + var u1 = rjj.sub(s.mul(normX)); + var wPre = rjEnd1.div(u1); + if (wPre.shape[0] === 1) { + w = one2D.clone(); + } + else { + w = one2D.concat(wPre.slice([1, 0], [wPre.shape[0] - 1, wPre.shape[1]]), 0); + } + var tau = s.matMul(u1).div(normX).neg(); + var rjEndAll = r.slice([j, 0], [m - j, n]); + var tauTimesW = tau.mul(w); + if (j === 0) { + r = rjEndAll.sub(tauTimesW.matMul(w.transpose().matMul(rjEndAll))); + } + else { + r = r.slice([0, 0], [j, n]) + .concat(rjEndAll.sub(tauTimesW.matMul(w.transpose().matMul(rjEndAll))), 0); + } + var qAllJEnd = q.slice([0, j], [m, q.shape[1] - j]); + if (j === 0) { + q = qAllJEnd.sub(qAllJEnd.matMul(w).matMul(tauTimesW.transpose())); + } + else { + q = q.slice([0, 0], [m, j]) + .concat(qAllJEnd.sub(qAllJEnd.matMul(w).matMul(tauTimesW.transpose())), 1); + } + return [w, r, q]; + }), w = _a[0], r = _a[1], q = _a[2]; + globals_1.dispose([rTemp, wTemp, qTemp]); + }; + for (var j = 0; j < iters; ++j) { + _loop_2(j); + } + if (!fullMatrices && m > n) { + q = q.slice([0, 0], [m, n]); + r = r.slice([0, 0], [n, n]); + } + return [q, r]; + }); +} +exports.gramSchmidt = operation_1.op({ gramSchmidt_: gramSchmidt_ }); +exports.qr = operation_1.op({ qr_: qr_ }); +//# sourceMappingURL=linalg_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops.js.map new file mode 100644 index 0000000..15ca31a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"linalg_ops.js","sourceRoot":"","sources":["../../src/ops/linalg_ops.ts"],"names":[],"mappings":";;AAqBA,8CAAmC;AACnC,sCAAmC;AAEnC,gCAA+B;AAC/B,yCAAgE;AAChE,+BAA4B;AAC5B,yCAA+B;AAC/B,iDAAoC;AACpC,2CAAsC;AAkBtC,sBAAsB,EAAuB;IAC3C,IAAI,eAAwB,CAAC;IAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACrB,eAAe,GAAG,KAAK,CAAC;QACxB,aAAM,CACF,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAC3B,mEAAmE,CAAC,CAAC;QACzE,IAAM,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YAClC,aAAM,CACF,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,EACtB,+DAA+D;iBAC3D,MAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC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AC;YAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwCE,EAxCD,SAAC,EAAE,SAAC,EAAE,SAAC,CAwCL;YACH,iBAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;;QA/CjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC;oBAArB,CAAC;SAgDT;QAED,IAAI,CAAC,YAAY,IAAI,CAAC,GAAG,CAAC,EAAE;YAC1B,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC5B,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC7B;QAED,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChB,CAAC,CAAyB,CAAC;AAC7B,CAAC;AAEY,QAAA,WAAW,GAAG,cAAE,CAAC,EAAC,YAAY,cAAA,EAAC,CAAC,CAAC;AACjC,QAAA,EAAE,GAAG,cAAE,CAAC,EAAC,GAAG,KAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops_test.js new file mode 100644 index 0000000..b3a555e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops_test.js @@ -0,0 +1,146 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var ops_1 = require("./ops"); +jasmine_util_1.describeWithFlags('gramSchmidt-tiny', test_util_1.ALL_ENVS, function () { + it('2x2, Array of Tensor1D', function () { + var xs = [ + tf.randomNormal([2], 0, 1, 'float32', 1), + tf.randomNormal([2], 0, 1, 'float32', 2) + ]; + var ys = tf.linalg.gramSchmidt(xs); + var y = tf.stack(ys); + test_util_1.expectArraysClose(y.transpose().matMul(y), tf.eye(2)); + test_util_1.expectArraysClose(tf.sum(xs[0].mul(ys[0])), tf.norm(xs[0]).mul(tf.norm(ys[0]))); + }); + it('3x3, Array of Tensor1D', function () { + var xs = [ + tf.randomNormal([3], 0, 1, 'float32', 1), + tf.randomNormal([3], 0, 1, 'float32', 2), + tf.randomNormal([3], 0, 1, 'float32', 3) + ]; + var ys = tf.linalg.gramSchmidt(xs); + var y = tf.stack(ys); + test_util_1.expectArraysClose(y.transpose().matMul(y), tf.eye(3)); + test_util_1.expectArraysClose(tf.sum(xs[0].mul(ys[0])), tf.norm(xs[0]).mul(tf.norm(ys[0]))); + }); + it('3x3, Matrix', function () { + var xs = tf.randomNormal([3, 3], 0, 1, 'float32', 1); + var y = tf.linalg.gramSchmidt(xs); + test_util_1.expectArraysClose(y.transpose().matMul(y), tf.eye(3)); + }); + it('2x3, Matrix', function () { + var xs = tf.randomNormal([2, 3], 0, 1, 'float32', 1); + var y = tf.linalg.gramSchmidt(xs); + test_util_1.expectArraysClose(y.matMul(y.transpose()), tf.eye(2)); + }); + it('3x2 Matrix throws Error', function () { + var xs = tf.tensor2d([[1, 2], [3, -1], [5, 1]]); + expect(function () { return tf.linalg.gramSchmidt(xs); }) + .toThrowError(/Number of vectors \(3\) exceeds number of dimensions \(2\)/); + }); + it('Mismatching dimensions input throws Error', function () { + var xs = [tf.tensor1d([1, 2, 3]), tf.tensor1d([-1, 5, 1]), tf.tensor1d([0, 0])]; + expect(function () { return tf.linalg.gramSchmidt(xs); }).toThrowError(/Non-unique/); + }); + it('Empty input throws Error', function () { + expect(function () { return tf.linalg.gramSchmidt([]); }).toThrowError(/empty/); + }); +}); +jasmine_util_1.describeWithFlags('gramSchmidt-non-tiny', test_util_1.WEBGL_ENVS, function () { + it('32x512', function () { + var xs = tf.randomUniform([32, 512]); + var y = tf.linalg.gramSchmidt(xs); + test_util_1.expectArraysClose(y.matMul(y.transpose()), tf.eye(32)); + }); +}); +jasmine_util_1.describeWithFlags('qr', test_util_1.ALL_ENVS, function () { + it('1x1', function () { + var x = ops_1.tensor2d([[10]], [1, 1]); + var _a = tf.linalg.qr(x), q = _a[0], r = _a[1]; + test_util_1.expectArraysClose(q, ops_1.tensor2d([[-1]], [1, 1])); + test_util_1.expectArraysClose(r, ops_1.tensor2d([[-10]], [1, 1])); + }); + it('2x2', function () { + var x = ops_1.tensor2d([[1, 3], [-2, -4]], [2, 2]); + var _a = tf.linalg.qr(x), q = _a[0], r = _a[1]; + test_util_1.expectArraysClose(q, ops_1.tensor2d([[-0.4472, -0.8944], [0.8944, -0.4472]], [2, 2])); + test_util_1.expectArraysClose(r, ops_1.tensor2d([[-2.2361, -4.9193], [0, -0.8944]], [2, 2])); + }); + it('2x2x2', function () { + var x = ops_1.tensor3d([[[-1, -3], [2, 4]], [[1, 3], [-2, -4]]], [2, 2, 2]); + var _a = tf.linalg.qr(x), q = _a[0], r = _a[1]; + test_util_1.expectArraysClose(q, ops_1.tensor3d([ + [[-0.4472, -0.8944], [0.8944, -0.4472]], + [[-0.4472, -0.8944], [0.8944, -0.4472]] + ], [2, 2, 2])); + test_util_1.expectArraysClose(r, ops_1.tensor3d([ + [[2.2361, 4.9193], [0, 0.8944]], + [[-2.2361, -4.9193], [0, -0.8944]] + ], [2, 2, 2])); + }); + it('2x1x2x2', function () { + var x = ops_1.tensor4d([[[[-1, -3], [2, 4]]], [[[1, 3], [-2, -4]]]], [2, 1, 2, 2]); + var _a = tf.linalg.qr(x), q = _a[0], r = _a[1]; + test_util_1.expectArraysClose(q, ops_1.tensor4d([ + [[[-0.4472, -0.8944], [0.8944, -0.4472]]], + [[[-0.4472, -0.8944], [0.8944, -0.4472]]], + ], [2, 1, 2, 2])); + test_util_1.expectArraysClose(r, ops_1.tensor4d([ + [[[2.2361, 4.9193], [0, 0.8944]]], + [[[-2.2361, -4.9193], [0, -0.8944]]] + ], [2, 1, 2, 2])); + }); + it('3x3', function () { + var x = ops_1.tensor2d([[1, 3, 2], [-2, 0, 7], [8, -9, 4]], [3, 3]); + var _a = tf.linalg.qr(x), q = _a[0], r = _a[1]; + test_util_1.expectArraysClose(q, ops_1.tensor2d([ + [-0.1204, 0.8729, 0.4729], [0.2408, -0.4364, 0.8669], + [-0.9631, -0.2182, 0.1576] + ], [3, 3])); + test_util_1.expectArraysClose(r, ops_1.tensor2d([[-8.3066, 8.3066, -2.4077], [0, 4.5826, -2.1822], [0, 0, 7.6447]], [3, 3])); + }); + it('3x2, fullMatrices = default false', function () { + var x = ops_1.tensor2d([[1, 2], [3, -3], [-2, 1]], [3, 2]); + var _a = tf.linalg.qr(x), q = _a[0], r = _a[1]; + test_util_1.expectArraysClose(q, ops_1.tensor2d([[-0.2673, 0.9221], [-0.8018, -0.3738], [0.5345, -0.0997]], [3, 2])); + test_util_1.expectArraysClose(r, ops_1.tensor2d([[-3.7417, 2.4054], [0, 2.8661]], [2, 2])); + }); + it('3x2, fullMatrices = true', function () { + var x = ops_1.tensor2d([[1, 2], [3, -3], [-2, 1]], [3, 2]); + var _a = tf.linalg.qr(x, true), q = _a[0], r = _a[1]; + test_util_1.expectArraysClose(q, ops_1.tensor2d([ + [-0.2673, 0.9221, 0.2798], [-0.8018, -0.3738, 0.4663], + [0.5345, -0.0997, 0.8393] + ], [3, 3])); + test_util_1.expectArraysClose(r, ops_1.tensor2d([[-3.7417, 2.4054], [0, 2.8661], [0, 0]], [3, 2])); + }); + it('2x3, fullMatrices = default false', function () { + var x = ops_1.tensor2d([[1, 2, 3], [-3, -2, 1]], [2, 3]); + var _a = tf.linalg.qr(x), q = _a[0], r = _a[1]; + test_util_1.expectArraysClose(q, ops_1.tensor2d([[-0.3162278, -0.9486833], [0.9486833, -0.31622773]], [2, 2])); + test_util_1.expectArraysClose(r, ops_1.tensor2d([[-3.162, -2.5298, -2.3842e-07], [0, -1.2649, -3.162]], [2, 3])); + }); + it('2x3, fullMatrices = true', function () { + var x = ops_1.tensor2d([[1, 2, 3], [-3, -2, 1]], [2, 3]); + var _a = tf.linalg.qr(x, true), q = _a[0], r = _a[1]; + test_util_1.expectArraysClose(q, ops_1.tensor2d([[-0.3162278, -0.9486833], [0.9486833, -0.31622773]], [2, 2])); + test_util_1.expectArraysClose(r, ops_1.tensor2d([[-3.162, -2.5298, -2.3842e-07], [0, -1.2649, -3.162]], [2, 3])); + }); + it('Does not leak memory', function () { + var x = ops_1.tensor2d([[1, 3], [-2, -4]], [2, 2]); + tf.linalg.qr(x); + var numTensors = tf.memory().numTensors; + tf.linalg.qr(x); + expect(tf.memory().numTensors).toEqual(numTensors + 2); + }); + it('Insuffient input tensor rank leads to error', function () { + var x1 = ops_1.scalar(12); + expect(function () { return tf.linalg.qr(x1); }).toThrowError(/rank >= 2.*got rank 0/); + var x2 = ops_1.tensor1d([12]); + expect(function () { return tf.linalg.qr(x2); }).toThrowError(/rank >= 2.*got rank 1/); + }); +}); +//# sourceMappingURL=linalg_ops_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops_test.js.map new file mode 100644 index 0000000..d9bc3f8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/linalg_ops_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"linalg_ops_test.js","sourceRoot":"","sources":["../../src/ops/linalg_ops_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAElD,0CAAqE;AAErE,6BAA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AAgB,CAAC,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/logical_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/logical_ops.d.ts new file mode 100644 index 0000000..0ccf986 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/logical_ops.d.ts @@ -0,0 +1,15 @@ +import { Tensor, Tensor2D } from '../tensor'; +import { TensorLike } from '../types'; +declare function logicalNot_(x: T | TensorLike): T; +declare function logicalAnd_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function logicalOr_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function logicalXor_(a: Tensor | TensorLike, b: Tensor | TensorLike): T; +declare function where_(condition: Tensor | TensorLike, a: T | TensorLike, b: T | TensorLike): T; +declare function whereAsync_(condition: Tensor | TensorLike): Promise; +export declare const logicalAnd: typeof logicalAnd_; +export declare const logicalNot: typeof logicalNot_; +export declare const logicalOr: typeof logicalOr_; +export declare const logicalXor: typeof logicalXor_; +export declare const where: typeof where_; +export declare const whereAsync: typeof whereAsync_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/logical_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/logical_ops.js new file mode 100644 index 0000000..d10b3b2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/logical_ops.js @@ -0,0 +1,116 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var where_impl_1 = require("../kernels/where_impl"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util_1 = require("../util"); +var broadcast_util_1 = require("./broadcast_util"); +var operation_1 = require("./operation"); +var tensor_ops_1 = require("./tensor_ops"); +function logicalNot_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'logicalNot', 'bool'); + util_1.assert($x.dtype === 'bool', 'Error Array must be of type bool.'); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.logicalNot($x); }, { $x: $x }); +} +function logicalAnd_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'logicalAnd', 'bool'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'logicalAnd', 'bool'); + util_1.assert($a.dtype === 'bool' && $b.dtype === 'bool', 'Error Array must be of type bool.'); + broadcast_util_1.assertAndGetBroadcastShape($a.shape, $b.shape); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.logicalAnd($a, $b); }, { $a: $a, $b: $b }); +} +function logicalOr_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'logicalOr', 'bool'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'logicalOr', 'bool'); + util_1.assert($a.dtype === 'bool' && $b.dtype === 'bool', 'Error Array must be of type bool.'); + broadcast_util_1.assertAndGetBroadcastShape($a.shape, $b.shape); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.logicalOr($a, $b); }, { $a: $a, $b: $b }); +} +function logicalXor_(a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'logicalXor', 'bool'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'logicalXor', 'bool'); + util_1.assert($a.dtype === 'bool' && $b.dtype === 'bool', 'Error Array must be of type bool.'); + broadcast_util_1.assertAndGetBroadcastShape($a.shape, $b.shape); + return exports.logicalOr(a, b).logicalAnd(exports.logicalAnd(a, b).logicalNot()); +} +function where_(condition, a, b) { + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'where'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'where'); + var $condition = tensor_util_env_1.convertToTensor(condition, 'condition', 'where', 'bool'); + util_1.assert($condition.dtype === 'bool', 'Error Condition must be of type bool.'); + util_1.assertShapesMatch($a.shape, $b.shape, 'Error in where: '); + if ($condition.rank === 1) { + util_1.assert($condition.shape[0] === $a.shape[0], 'The first dimension of `a` must match the size of `condition`.'); + } + else { + util_1.assertShapesMatch($condition.shape, $b.shape, 'Error in where: '); + } + var grad = function (dy) { return ({ + $condition: function () { return tensor_ops_1.zerosLike($condition); }, + $a: function () { return dy.mul($condition.cast($a.dtype)); }, + $b: function () { return dy.mul($condition.logicalNot().cast($b.dtype)); } + }); }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.select($condition, $a, $b); }, { $condition: $condition, $a: $a, $b: $b }, grad); +} +function whereAsync_(condition) { + return __awaiter(this, void 0, void 0, function () { + var $condition, vals, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + $condition = tensor_util_env_1.convertToTensor(condition, 'condition', 'where', 'bool'); + util_1.assert($condition.dtype === 'bool', 'Condition must be of type bool.'); + return [4, $condition.data()]; + case 1: + vals = _a.sent(); + res = where_impl_1.whereImpl($condition.shape, vals); + if (condition !== $condition) { + $condition.dispose(); + } + return [2, res]; + } + }); + }); +} +exports.logicalAnd = operation_1.op({ logicalAnd_: logicalAnd_ }); +exports.logicalNot = operation_1.op({ logicalNot_: logicalNot_ }); +exports.logicalOr = operation_1.op({ logicalOr_: logicalOr_ }); +exports.logicalXor = operation_1.op({ logicalXor_: logicalXor_ }); +exports.where = operation_1.op({ where_: where_ }); +exports.whereAsync = whereAsync_; +//# sourceMappingURL=logical_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/logical_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/logical_ops.js.map new file mode 100644 index 0000000..c7ece2f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/logical_ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"logical_ops.js","sourceRoot":"","sources":["../../src/ops/logical_ops.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8CAAmC;AACnC,oDAAgD;AAEhD,sDAAmD;AAEnD,gCAAkD;AAClD,mDAA4D;AAC5D,yCAA+B;AAC/B,2CAAuC;AAcvC,qBAAuC,CAAe;IACpD,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,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AAI,EAAE,EAAA;;oBAA9B,IAAI,GAAG,SAAuB;oBAC9B,GAAG,GAAG,sBAAS,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;oBAC9C,IAAI,SAAS,KAAK,UAAU,EAAE;wBAC5B,UAAU,CAAC,OAAO,EAAE,CAAC;qBACtB;oBACD,WAAO,GAAG,EAAC;;;;CACZ;AAEY,QAAA,UAAU,GAAG,cAAE,CAAC,EAAC,WAAW,aAAA,EAAC,CAAC,CAAC;AAC/B,QAAA,UAAU,GAAG,cAAE,CAAC,EAAC,WAAW,aAAA,EAAC,CAAC,CAAC;AAC/B,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,UAAU,GAAG,cAAE,CAAC,EAAC,WAAW,aAAA,EAAC,CAAC,CAAC;AAC/B,QAAA,KAAK,GAAG,cAAE,CAAC,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACrB,QAAA,UAAU,GAAG,WAAW,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/logicalop_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/logicalop_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/logicalop_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/logicalop_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/logicalop_test.js new file mode 100644 index 0000000..d344b8c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/logicalop_test.js @@ -0,0 +1,672 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('logicalNot', test_util_1.ALL_ENVS, function () { + it('Tensor1D.', function () { + var a = tf.tensor1d([1, 0, 0], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [0, 1, 1]); + a = tf.tensor1d([0, 0, 0], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [1, 1, 1]); + a = tf.tensor1d([1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [0, 0]); + }); + it('Tests chaining in Tensor1D', function () { + var a = tf.tensor1d([1, 0, 0], 'bool'); + test_util_1.expectArraysClose(a.logicalNot(), [0, 1, 1]); + a = tf.tensor1d([0, 0, 0], 'bool'); + test_util_1.expectArraysClose(a.logicalNot(), [1, 1, 1]); + a = tf.tensor1d([1, 1], 'bool'); + test_util_1.expectArraysClose(a.logicalNot(), [0, 0]); + }); + it('Tensor2D', function () { + var a = tf.tensor2d([[1, 0, 1], [0, 0, 0]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [0, 1, 0, 1, 1, 1]); + a = tf.tensor2d([[0, 0, 0], [1, 1, 1]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [1, 1, 1, 0, 0, 0]); + }); + it('Tensor3D', function () { + var a = tf.tensor3d([[[1], [0], [1]], [[0], [0], [0]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [0, 1, 0, 1, 1, 1]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [1, 1, 1, 0, 0, 0]); + }); + it('Tensor4D', function () { + var a = tf.tensor4d([1, 0, 1, 0], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [0, 1, 0, 1]); + a = tf.tensor4d([0, 0, 0, 0], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [1, 1, 1, 1]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [0, 0, 0, 0]); + }); + it('Tensor6D', function () { + var a = tf.tensor6d([1, 0, 1, 0], [2, 2, 1, 1, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalNot(a), [0, 1, 0, 1]); + a = tf.zeros([2, 2, 2, 2, 2, 2]).cast('bool'); + var expectedResult = new Int32Array(64); + expectedResult = expectedResult.fill(1); + test_util_1.expectArraysClose(tf.logicalNot(a), expectedResult); + a = tf.ones([2, 2, 2, 2, 2, 2]).cast('bool'); + expectedResult = expectedResult.fill(0); + test_util_1.expectArraysClose(tf.logicalNot(a), expectedResult); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.logicalNot({}); }) + .toThrowError(/Argument 'x' passed to 'logicalNot' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [1, 0, 0]; + test_util_1.expectArraysClose(tf.logicalNot(a), [0, 1, 1]); + }); +}); +jasmine_util_1.describeWithFlags('logicalAnd', test_util_1.ALL_ENVS, function () { + it('Tensor1D.', function () { + var a = tf.tensor1d([1, 0, 0], 'bool'); + var b = tf.tensor1d([0, 1, 0], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 0]); + a = tf.tensor1d([0, 0, 0], 'bool'); + b = tf.tensor1d([0, 0, 0], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 0]); + a = tf.tensor1d([1, 1], 'bool'); + b = tf.tensor1d([1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [1, 1]); + }); + it('mismatched Tensor1D shapes', function () { + var a = tf.tensor1d([1, 0], 'bool'); + var b = tf.tensor1d([0, 1, 0], 'bool'); + var f = function () { + tf.logicalAnd(a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor2D', function () { + var a = tf.tensor2d([[1, 0, 1], [0, 0, 0]], [2, 3], 'bool'); + var b = tf.tensor2d([[0, 0, 0], [0, 1, 0]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 0, 0, 0, 0]); + a = tf.tensor2d([[0, 0, 0], [1, 1, 1]], [2, 3], 'bool'); + b = tf.tensor2d([[0, 0, 0], [1, 1, 1]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 0, 1, 1, 1]); + }); + it('broadcasting Tensor2D shapes', function () { + var a = tf.tensor2d([[1], [0]], [2, 1], 'bool'); + var b = tf.tensor2d([[0, 1, 0], [0, 1, 0]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 1, 0, 0, 0, 0]); + }); + it('Tensor3D', function () { + var a = tf.tensor3d([[[1], [0], [1]], [[0], [0], [1]]], [2, 3, 1], 'bool'); + var b = tf.tensor3d([[[0], [0], [1]], [[1], [0], [0]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 1, 0, 0, 0]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'bool'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 0, 1, 1, 1]); + }); + it('broadcasting Tensor3D shapes', function () { + var a = tf.tensor3d([[[1, 0], [0, 0], [1, 1]], [[0, 0], [0, 1], [0, 0]]], [2, 3, 2], 'bool'); + var b = tf.tensor3d([[[0], [0], [1]], [[1], [0], [0]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0]); + }); + it('Tensor4D', function () { + var a = tf.tensor4d([1, 0, 1, 0], [2, 2, 1, 1], 'bool'); + var b = tf.tensor4d([0, 1, 1, 0], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 1, 0]); + a = tf.tensor4d([0, 0, 0, 0], [2, 2, 1, 1], 'bool'); + b = tf.tensor4d([0, 0, 0, 0], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 0, 0]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'bool'); + b = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [1, 1, 1, 1]); + }); + it('broadcasting Tensor4D shapes', function () { + var a = tf.tensor4d([1, 0, 1, 0], [2, 2, 1, 1], 'bool'); + var b = tf.tensor4d([[[[1, 0]], [[0, 0]]], [[[0, 0]], [[1, 1]]]], [2, 2, 1, 2], 'bool'); + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [1, 0, 0, 0, 0, 0, 0, 0]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.logicalAnd({}, tf.scalar(1, 'bool')); }) + .toThrowError(/Argument 'a' passed to 'logicalAnd' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.logicalAnd(tf.scalar(1, 'bool'), {}); }) + .toThrowError(/Argument 'b' passed to 'logicalAnd' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [1, 0, 0, 1]; + var b = [0, 1, 0, 1]; + test_util_1.expectArraysClose(tf.logicalAnd(a, b), [0, 0, 0, 1]); + }); +}); +jasmine_util_1.describeWithFlags('logicalOr', test_util_1.ALL_ENVS, function () { + it('Tensor1D.', function () { + var a = tf.tensor1d([1, 0, 0], 'bool'); + var b = tf.tensor1d([0, 1, 0], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 1, 0]); + a = tf.tensor1d([0, 0, 0], 'bool'); + b = tf.tensor1d([0, 0, 0], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [0, 0, 0]); + a = tf.tensor1d([1, 1], 'bool'); + b = tf.tensor1d([1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 1]); + }); + it('mismatched Tensor1D shapes', function () { + var a = tf.tensor1d([1, 0], 'bool'); + var b = tf.tensor1d([0, 1, 0], 'bool'); + var f = function () { + tf.logicalOr(a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor2D', function () { + var a = tf.tensor2d([[1, 0, 1], [0, 0, 0]], [2, 3], 'bool'); + var b = tf.tensor2d([[0, 0, 0], [0, 1, 0]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 0, 1, 0, 1, 0]); + a = tf.tensor2d([[0, 0, 0], [1, 1, 1]], [2, 3], 'bool'); + b = tf.tensor2d([[0, 0, 0], [1, 1, 1]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [0, 0, 0, 1, 1, 1]); + }); + it('broadcasting Tensor2D shapes', function () { + var a = tf.tensor2d([[1], [0]], [2, 1], 'bool'); + var b = tf.tensor2d([[0, 0, 0], [0, 1, 0]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 1, 1, 0, 1, 0]); + }); + it('Tensor3D', function () { + var a = tf.tensor3d([[[1], [0], [1]], [[0], [0], [0]]], [2, 3, 1], 'bool'); + var b = tf.tensor3d([[[0], [0], [1]], [[1], [0], [0]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 0, 1, 1, 0, 0]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'bool'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [0, 0, 0, 1, 1, 1]); + }); + it('broadcasting Tensor3D shapes', function () { + var a = tf.tensor3d([[[1, 0], [0, 0], [1, 1]], [[0, 0], [0, 1], [0, 0]]], [2, 3, 2], 'bool'); + var b = tf.tensor3d([[[0], [0], [1]], [[1], [0], [0]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0]); + }); + it('Tensor4D', function () { + var a = tf.tensor4d([1, 0, 1, 0], [2, 2, 1, 1], 'bool'); + var b = tf.tensor4d([0, 1, 0, 0], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 1, 1, 0]); + a = tf.tensor4d([0, 0, 0, 0], [2, 2, 1, 1], 'bool'); + b = tf.tensor4d([0, 0, 0, 0], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [0, 0, 0, 0]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'bool'); + b = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 1, 1, 1]); + }); + it('broadcasting Tensor4D shapes', function () { + var a = tf.tensor4d([1, 0, 1, 0], [2, 2, 1, 1], 'bool'); + var b = tf.tensor4d([[[[1, 0]], [[0, 0]]], [[[0, 0]], [[1, 1]]]], [2, 2, 1, 2], 'bool'); + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 1, 0, 0, 1, 1, 1, 1]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.logicalOr({}, tf.scalar(1, 'bool')); }) + .toThrowError(/Argument 'a' passed to 'logicalOr' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.logicalOr(tf.scalar(1, 'bool'), {}); }) + .toThrowError(/Argument 'b' passed to 'logicalOr' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [1, 0, 0, 1]; + var b = [0, 1, 0, 1]; + test_util_1.expectArraysClose(tf.logicalOr(a, b), [1, 1, 0, 1]); + }); +}); +jasmine_util_1.describeWithFlags('logicalXor', test_util_1.ALL_ENVS, function () { + it('Tensor1D.', function () { + var a = tf.tensor1d([1, 0, 0], 'bool'); + var b = tf.tensor1d([0, 1, 0], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [1, 1, 0]); + a = tf.tensor1d([0, 0, 0], 'bool'); + b = tf.tensor1d([0, 0, 0], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [0, 0, 0]); + a = tf.tensor1d([1, 1], 'bool'); + b = tf.tensor1d([1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [0, 0]); + }); + it('mismatched Tensor1D shapes', function () { + var a = tf.tensor1d([1, 0], 'bool'); + var b = tf.tensor1d([0, 1, 0], 'bool'); + var f = function () { + tf.logicalXor(a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor2D', function () { + var a = tf.tensor2d([[1, 0, 1], [0, 0, 0]], [2, 3], 'bool'); + var b = tf.tensor2d([[0, 0, 0], [0, 1, 0]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [1, 0, 1, 0, 1, 0]); + a = tf.tensor2d([[0, 0, 0], [1, 1, 1]], [2, 3], 'bool'); + b = tf.tensor2d([[0, 0, 0], [1, 1, 1]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [0, 0, 0, 0, 0, 0]); + }); + it('broadcasting Tensor2D shapes', function () { + var a = tf.tensor2d([[1], [0]], [2, 1], 'bool'); + var b = tf.tensor2d([[0, 0, 0], [0, 1, 0]], [2, 3], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [1, 1, 1, 0, 1, 0]); + }); + it('Tensor3D', function () { + var a = tf.tensor3d([[[1], [0], [1]], [[0], [0], [0]]], [2, 3, 1], 'bool'); + var b = tf.tensor3d([[[0], [0], [1]], [[1], [0], [0]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [1, 0, 0, 1, 0, 0]); + a = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'bool'); + b = tf.tensor3d([[[0], [0], [0]], [[1], [1], [1]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [0, 0, 0, 0, 0, 0]); + }); + it('broadcasting Tensor3D shapes', function () { + var a = tf.tensor3d([[[1, 0], [0, 0], [1, 1]], [[0, 0], [0, 1], [0, 0]]], [2, 3, 2], 'bool'); + var b = tf.tensor3d([[[0], [0], [1]], [[1], [0], [0]]], [2, 3, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0]); + }); + it('Tensor4D', function () { + var a = tf.tensor4d([1, 0, 1, 0], [2, 2, 1, 1], 'bool'); + var b = tf.tensor4d([0, 1, 1, 0], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [1, 1, 0, 0]); + a = tf.tensor4d([0, 0, 0, 0], [2, 2, 1, 1], 'bool'); + b = tf.tensor4d([0, 0, 0, 0], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [0, 0, 0, 0]); + a = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'bool'); + b = tf.tensor4d([1, 1, 1, 1], [2, 2, 1, 1], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [0, 0, 0, 0]); + }); + it('broadcasting Tensor4D shapes', function () { + var a = tf.tensor4d([1, 0, 1, 0], [2, 2, 1, 1], 'bool'); + var b = tf.tensor4d([[[[1, 0]], [[0, 0]]], [[[0, 0]], [[1, 1]]]], [2, 2, 1, 2], 'bool'); + test_util_1.expectArraysClose(tf.logicalXor(a, b), [0, 1, 0, 0, 1, 1, 1, 1]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.logicalXor({}, tf.scalar(1, 'bool')); }) + .toThrowError(/Argument 'a' passed to 'logicalXor' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.logicalXor(tf.scalar(1, 'bool'), {}); }) + .toThrowError(/Argument 'b' passed to 'logicalXor' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [1, 0, 0, 1]; + var b = [0, 1, 0, 1]; + test_util_1.expectArraysClose(tf.logicalXor(a, b), [1, 1, 0, 0]); + }); +}); +jasmine_util_1.describeWithFlags('where', test_util_1.ALL_ENVS, function () { + it('Scalars.', function () { + var a = tf.scalar(10); + var b = tf.scalar(20); + var c = tf.scalar(1, 'bool'); + test_util_1.expectArraysClose(tf.where(c, a, b), [10]); + }); + it('Invalid condition type', function () { + var c = tf.tensor1d([1, 0, 1, 0], 'int32'); + var a = tf.tensor1d([10, 10, 10, 10], 'bool'); + var b = tf.tensor1d([20, 20, 20, 20], 'bool'); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor1D', function () { + var c = tf.tensor1d([1, 0, 1, 0], 'bool'); + var a = tf.tensor1d([10, 10, 10, 10]); + var b = tf.tensor1d([20, 20, 20, 20]); + test_util_1.expectArraysClose(tf.where(c, a, b), [10, 20, 10, 20]); + }); + it('Tensor1D different a/b shapes', function () { + var c = tf.tensor1d([1, 0, 1, 0], 'bool'); + var a = tf.tensor1d([10, 10, 10]); + var b = tf.tensor1d([20, 20, 20, 20]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + c = tf.tensor1d([1, 0, 1, 0], 'bool'); + a = tf.tensor1d([10, 10, 10, 10]); + b = tf.tensor1d([20, 20, 20]); + f = function () { + tf.where(c, a, b); + }; + }); + it('Tensor1D different condition/a shapes', function () { + var c = tf.tensor1d([1, 0, 1, 0], 'bool'); + var a = tf.tensor1d([10, 10, 10]); + var b = tf.tensor1d([20, 20, 20]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor2D', function () { + var c = tf.tensor2d([[1, 0], [0, 1]], [2, 2], 'bool'); + var a = tf.tensor2d([[10, 10], [10, 10]], [2, 2]); + var b = tf.tensor2d([[5, 5], [5, 5]], [2, 2]); + test_util_1.expectArraysClose(tf.where(c, a, b), [10, 5, 5, 10]); + }); + it('Tensor2D different a/b shapes', function () { + var c = tf.tensor2d([[1, 1], [0, 0]], [2, 2], 'bool'); + var a = tf.tensor2d([[5, 5, 5], [5, 5, 5]], [2, 3]); + var b = tf.tensor2d([[4, 4], [4, 4]], [2, 2]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + c = tf.tensor2d([[1, 1], [0, 0]], [2, 2], 'bool'); + a = tf.tensor2d([[5, 5], [5, 5]], [2, 2]); + b = tf.tensor2d([[4, 4, 4], [4, 4, 4]], [2, 3]); + f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor2D different condition/a shapes', function () { + var c = tf.tensor2d([[1, 0], [0, 1]], [2, 2], 'bool'); + var a = tf.tensor2d([[10, 10, 10], [10, 10, 10]], [2, 3]); + var b = tf.tensor2d([[5, 5, 5], [5, 5, 5]], [2, 3]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor2D different `a` dimension w/ condition rank=1', function () { + var c = tf.tensor1d([1, 0, 1, 0], 'bool'); + var a = tf.tensor2d([[10, 10], [10, 10]], [2, 2]); + var b = tf.tensor2d([[5, 5], [5, 5]], [2, 2]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + a = tf.tensor2d([[10], [10], [10], [10]], [4, 1]); + b = tf.tensor2d([[5], [5], [5], [5]], [4, 1]); + test_util_1.expectArraysClose(tf.where(c, a, b), [10, 5, 10, 5]); + a = tf.tensor2d([[10, 10], [10, 10], [10, 10], [10, 10]], [4, 2]); + b = tf.tensor2d([[5, 5], [5, 5], [5, 5], [5, 5]], [4, 2]); + test_util_1.expectArraysClose(tf.where(c, a, b), [10, 10, 5, 5, 10, 10, 5, 5]); + }); + it('Tensor3D', function () { + var c = tf.tensor3d([[[1], [0], [1]], [[0], [0], [0]]], [2, 3, 1], 'bool'); + var a = tf.tensor3d([[[5], [5], [5]], [[5], [5], [5]]], [2, 3, 1]); + var b = tf.tensor3d([[[3], [3], [3]], [[3], [3], [3]]], [2, 3, 1]); + test_util_1.expectArraysClose(tf.where(c, a, b), [5, 3, 5, 3, 3, 3]); + }); + it('Tensor3D different a/b shapes', function () { + var c = tf.tensor3d([[[1], [0], [1]], [[0], [0], [0]]], [2, 3, 1], 'bool'); + var a = tf.tensor3d([[[5], [5]], [[5], [5]]], [2, 2, 1]); + var b = tf.tensor3d([[[3], [3], [3]], [[3], [3], [3]]], [2, 3, 1]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + a = tf.tensor3d([[[5], [5], [5]], [[5], [5], [5]]], [2, 3, 1]); + b = tf.tensor3d([[[3], [3]], [[3], [3]]], [2, 2, 1]); + f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor3D different condition/a shapes', function () { + var c = tf.tensor3d([[[1], [0]], [[0], [0]]], [2, 2, 1], 'bool'); + var a = tf.tensor3d([[[5], [5], [5]], [[5], [5], [5]]], [2, 3, 1]); + var b = tf.tensor3d([[[3], [3], [3]], [[3], [3], [3]]], [2, 3, 1]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor3D different `a` dimension w/ condition rank=1', function () { + var c = tf.tensor1d([1, 0, 1, 0], 'bool'); + var a = tf.tensor3d([[[9, 9], [9, 9]], [[9, 9], [9, 9]]], [2, 2, 2]); + var b = tf.tensor3d([[[8, 8], [8, 8]], [[8, 8], [8, 8]]], [2, 2, 2]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + a = tf.tensor3d([[[9]], [[9]], [[9]], [[9]]], [4, 1, 1]); + b = tf.tensor3d([[[8]], [[8]], [[8]], [[8]]], [4, 1, 1]); + test_util_1.expectArraysClose(tf.where(c, a, b), [9, 8, 9, 8]); + a = tf.tensor3d([[[9], [9]], [[9], [9]], [[9], [9]], [[9], [9]]], [4, 2, 1]); + b = tf.tensor3d([[[8], [8]], [[8], [8]], [[8], [8]], [[8], [8]]], [4, 2, 1]); + test_util_1.expectArraysClose(tf.where(c, a, b), [9, 9, 8, 8, 9, 9, 8, 8]); + }); + it('Tensor4D', function () { + var c = tf.tensor4d([1, 0, 1, 1], [2, 2, 1, 1], 'bool'); + var a = tf.tensor4d([7, 7, 7, 7], [2, 2, 1, 1]); + var b = tf.tensor4d([3, 3, 3, 3], [2, 2, 1, 1]); + test_util_1.expectArraysClose(tf.where(c, a, b), [7, 3, 7, 7]); + }); + it('Tensor4D different a/b shapes', function () { + var c = tf.tensor4d([1, 0, 1, 1], [2, 2, 1, 1], 'bool'); + var a = tf.tensor4d([7, 7, 7, 7, 7, 7, 7, 7], [2, 2, 2, 1]); + var b = tf.tensor4d([3, 3, 3, 3], [2, 2, 1, 1]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + a = tf.tensor4d([7, 7, 7, 7], [2, 2, 1, 1]); + b = tf.tensor4d([3, 3, 3, 3, 3, 3, 3, 3], [2, 2, 2, 1]); + f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor4D different condition/a shapes', function () { + var c = tf.tensor4d([1, 0, 1, 1, 1, 0, 1, 1], [2, 2, 2, 1], 'bool'); + var a = tf.tensor4d([7, 7, 7, 7], [2, 2, 1, 1]); + var b = tf.tensor4d([3, 3, 3, 3], [2, 2, 1, 1]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + }); + it('Tensor4D different `a` dimension w/ condition rank=1', function () { + var c = tf.tensor1d([1, 0, 1, 0], 'bool'); + var a = tf.tensor4d([7, 7, 7, 7, 7, 7, 7, 7], [2, 2, 2, 1]); + var b = tf.tensor4d([3, 3, 3, 3, 3, 3, 3, 3], [2, 2, 2, 1]); + var f = function () { + tf.where(c, a, b); + }; + expect(f).toThrowError(); + a = tf.tensor4d([7, 7, 7, 7], [4, 1, 1, 1]); + b = tf.tensor4d([3, 3, 3, 3], [4, 1, 1, 1]); + test_util_1.expectArraysClose(tf.where(c, a, b), [7, 3, 7, 3]); + a = tf.tensor4d([7, 7, 7, 7, 7, 7, 7, 7], [4, 2, 1, 1]); + b = tf.tensor4d([3, 3, 3, 3, 3, 3, 3, 3], [4, 2, 1, 1]); + test_util_1.expectArraysClose(tf.where(c, a, b), [7, 7, 3, 3, 7, 7, 3, 3]); + }); + it('throws when passed condition as a non-tensor', function () { + expect(function () { return tf.where({}, tf.scalar(1, 'bool'), tf.scalar(1, 'bool')); }) + .toThrowError(/Argument 'condition' passed to 'where' must be a Tensor/); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.where(tf.scalar(1, 'bool'), {}, tf.scalar(1, 'bool')); }) + .toThrowError(/Argument 'a' passed to 'where' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.where(tf.scalar(1, 'bool'), tf.scalar(1, 'bool'), {}); }) + .toThrowError(/Argument 'b' passed to 'where' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = 10; + var b = 20; + var c = 1; + test_util_1.expectArraysClose(tf.where(c, a, b), [10]); + }); + it('1D gradient', function () { + var c = tf.tensor1d([1, 0, 1], 'bool'); + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([4, 5, 6]); + var dy = tf.tensor1d([1, 2, 3]); + var grads = tf.grads(function (c, a, b) { return tf.where(c, a, b); }); + var _a = grads([c, a, b], dy), dc = _a[0], da = _a[1], db = _a[2]; + test_util_1.expectArraysClose(dc, [0, 0, 0]); + test_util_1.expectArraysClose(da, [1, 0, 3]); + test_util_1.expectArraysClose(db, [0, 2, 0]); + expect(dc.shape).toEqual(c.shape); + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + }); + it('2D gradient', function () { + var c = tf.tensor2d([1, 0, 1, 1, 1, 0], [2, 3], 'bool'); + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = tf.tensor2d([7, 8, 9, 10, 11, 12], [2, 3]); + var dy = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var grads = tf.grads(function (c, a, b) { return tf.where(c, a, b); }); + var _a = grads([c, a, b], dy), dc = _a[0], da = _a[1], db = _a[2]; + test_util_1.expectArraysClose(dc, [0, 0, 0, 0, 0, 0]); + test_util_1.expectArraysClose(da, [1, 0, 3, 4, 5, 0]); + test_util_1.expectArraysClose(db, [0, 2, 0, 0, 0, 6]); + expect(dc.shape).toEqual(c.shape); + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + }); + it('3D gradient', function () { + var c = tf.tensor3d([1, 1, 0, 1, 1, 0], [2, 3, 1], 'bool'); + var a = tf.tensor3d([1, 2, 3, 4, 5, 6], [2, 3, 1]); + var b = tf.tensor3d([7, 8, 9, 10, 11, 12], [2, 3, 1]); + var dy = tf.tensor3d([1, 2, 3, 4, 5, 6], [2, 3, 1]); + var grads = tf.grads(function (c, a, b) { return tf.where(c, a, b); }); + var _a = grads([c, a, b], dy), dc = _a[0], da = _a[1], db = _a[2]; + test_util_1.expectArraysClose(dc, [0, 0, 0, 0, 0, 0]); + test_util_1.expectArraysClose(da, [1, 2, 0, 4, 5, 0]); + test_util_1.expectArraysClose(db, [0, 0, 3, 0, 0, 6]); + expect(dc.shape).toEqual(c.shape); + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + }); + it('4D gradient', function () { + var c = tf.tensor4d([1, 1, 0, 1], [2, 2, 1, 1], 'bool'); + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1]); + var b = tf.tensor4d([5, 6, 7, 8], [2, 2, 1, 1]); + var dy = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1]); + var grads = tf.grads(function (c, a, b) { return tf.where(c, a, b); }); + var _a = grads([c, a, b], dy), dc = _a[0], da = _a[1], db = _a[2]; + test_util_1.expectArraysClose(dc, [0, 0, 0, 0]); + test_util_1.expectArraysClose(da, [1, 2, 0, 4]); + test_util_1.expectArraysClose(db, [0, 0, 3, 0]); + expect(dc.shape).toEqual(c.shape); + expect(da.shape).toEqual(a.shape); + expect(db.shape).toEqual(b.shape); + }); +}); +jasmine_util_1.describeWithFlags('whereAsync', test_util_1.ALL_ENVS, function () { + it('1d tensor', function () { return __awaiter(_this, void 0, void 0, function () { + var condition, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + condition = tf.tensor1d([true, false, true, true], 'bool'); + return [4, tf.whereAsync(condition)]; + case 1: + res = _a.sent(); + expect(res.dtype).toBe('int32'); + expect(res.shape).toEqual([3, 1]); + test_util_1.expectArraysClose(res, [0, 2, 3]); + return [2]; + } + }); + }); }); + it('2d tensor', function () { return __awaiter(_this, void 0, void 0, function () { + var condition, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + condition = tf.tensor2d([[true, false, false], [false, true, true]], [2, 3], 'bool'); + return [4, tf.whereAsync(condition)]; + case 1: + res = _a.sent(); + expect(res.dtype).toBe('int32'); + expect(res.shape).toEqual([3, 2]); + test_util_1.expectArraysClose(res, [0, 0, 1, 1, 1, 2]); + return [2]; + } + }); + }); }); + it('3d tensor', function () { return __awaiter(_this, void 0, void 0, function () { + var condition, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + condition = tf.tensor3d([[[true, false, false], [false, true, true]], + [[false, false, false], [true, true, false]]], [2, 2, 3], 'bool'); + return [4, tf.whereAsync(condition)]; + case 1: + res = _a.sent(); + expect(res.dtype).toBe('int32'); + expect(res.shape).toEqual([5, 3]); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 1, 1, 0, 1, 2, 1, 1, 0, 1, 1, 1]); + return [2]; + } + }); + }); }); + it('accepts a tensor-like object', function () { return __awaiter(_this, void 0, void 0, function () { + var condition, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + condition = [true, false, true]; + return [4, tf.whereAsync(condition)]; + case 1: + res = _a.sent(); + expect(res.dtype).toBe('int32'); + expect(res.shape).toEqual([2, 1]); + test_util_1.expectArraysClose(res, [0, 2]); + return [2]; + } + }); + }); }); + it('throws error if condition is not of type bool', function () { return __awaiter(_this, void 0, void 0, function () { + var condition, ex_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + condition = tf.tensor1d([1, 0, 1]); + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4, tf.whereAsync(condition)]; + case 2: + _a.sent(); + throw new Error('The line above should have thrown an error'); + case 3: + ex_1 = _a.sent(); + expect(ex_1.message).toBe('Condition must be of type bool.'); + return [3, 4]; + case 4: return [2]; + } + }); + }); }); +}); +//# sourceMappingURL=logicalop_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/logicalop_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/logicalop_test.js.map new file mode 100644 index 0000000..214a10e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/logicalop_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"logicalop_test.js","sourceRoot":"","sources":["../../src/ops/logicalop_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBAisBA;;AAjsBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,YAAY,EAAE,oBAAQ,EAAE;IACxC,EAAE,CAAC,WAAW,EAAE;QACd,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACvC,6BAAiB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAE/C,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACnC,6BAAiB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAE/C,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAChC,6BAAiB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EA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AE,CAAC,CAAC,CAAC,CAAC;;;;SAChC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE;;;;;oBAC5C,SAAS,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;;;;oBAIvC,WAAM,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAA;;oBAA9B,SAA8B,CAAC;oBAC/B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;;;oBAE9D,MAAM,CAAC,IAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;;;;;SAE9D,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops.d.ts new file mode 100644 index 0000000..37d8f4d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops.d.ts @@ -0,0 +1,27 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +export declare enum Reduction { + NONE = 0, + MEAN = 1, + SUM = 2, + SUM_BY_NONZERO_WEIGHTS = 3 +} +declare function computeWeightedLoss_(losses: T | TensorLike, weights?: Tensor | TensorLike, reduction?: Reduction): O; +declare function absoluteDifference_(labels: T | TensorLike, predictions: T | TensorLike, weights?: Tensor | TensorLike, reduction?: Reduction): O; +declare function meanSquaredError_(labels: T | TensorLike, predictions: T | TensorLike, weights?: Tensor | TensorLike, reduction?: Reduction): O; +declare function cosineDistance_(labels: T | TensorLike, predictions: T | TensorLike, axis: number, weights?: Tensor | TensorLike, reduction?: Reduction): O; +declare function hingeLoss_(labels: T | TensorLike, predictions: T | TensorLike, weights?: Tensor | TensorLike, reduction?: Reduction): O; +declare function logLoss_(labels: T | TensorLike, predictions: T | TensorLike, weights?: Tensor | TensorLike, epsilon?: number, reduction?: Reduction): O; +declare function sigmoidCrossEntropy_(multiClassLabels: T | TensorLike, logits: T | TensorLike, weights?: Tensor | TensorLike, labelSmoothing?: number, reduction?: Reduction): O; +declare function huberLoss_(labels: T | TensorLike, predictions: T | TensorLike, weights?: Tensor | TensorLike, delta?: number, reduction?: Reduction): O; +declare function softmaxCrossEntropy_(onehotLabels: T | TensorLike, logits: T | TensorLike, weights?: Tensor | TensorLike, labelSmoothing?: number, reduction?: Reduction): O; +export declare const absoluteDifference: typeof absoluteDifference_; +export declare const computeWeightedLoss: typeof computeWeightedLoss_; +export declare const cosineDistance: typeof cosineDistance_; +export declare const hingeLoss: typeof hingeLoss_; +export declare const huberLoss: typeof huberLoss_; +export declare const logLoss: typeof logLoss_; +export declare const meanSquaredError: typeof meanSquaredError_; +export declare const sigmoidCrossEntropy: typeof sigmoidCrossEntropy_; +export declare const softmaxCrossEntropy: typeof softmaxCrossEntropy_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops.js new file mode 100644 index 0000000..f17f8e0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops.js @@ -0,0 +1,224 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var globals_1 = require("../globals"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util_1 = require("../util"); +var axis_util_1 = require("./axis_util"); +var binary_ops_1 = require("./binary_ops"); +var operation_1 = require("./operation"); +var tensor_ops_1 = require("./tensor_ops"); +var Reduction; +(function (Reduction) { + Reduction[Reduction["NONE"] = 0] = "NONE"; + Reduction[Reduction["MEAN"] = 1] = "MEAN"; + Reduction[Reduction["SUM"] = 2] = "SUM"; + Reduction[Reduction["SUM_BY_NONZERO_WEIGHTS"] = 3] = "SUM_BY_NONZERO_WEIGHTS"; +})(Reduction = exports.Reduction || (exports.Reduction = {})); +function computeWeightedLoss_(losses, weights, reduction) { + if (reduction === void 0) { reduction = Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $losses = tensor_util_env_1.convertToTensor(losses, 'losses', 'computeWeightedLoss'); + var $weights = null; + if (weights != null) { + $weights = tensor_util_env_1.convertToTensor(weights, 'weights', 'computeWeightedLoss'); + } + var weightedLoss = ($weights == null) ? $losses : $losses.mul($weights); + if (reduction === Reduction.NONE) { + return weightedLoss; + } + if (reduction === Reduction.SUM) { + return weightedLoss.sum(); + } + if (reduction === Reduction.MEAN) { + if ($weights == null) { + return weightedLoss.mean(); + } + else { + var broadcastFactor = util_1.sizeFromShape($losses.shape) / util_1.sizeFromShape($weights.shape); + var result = weightedLoss.sum().div($weights.sum()); + return broadcastFactor > 1 ? result.div(tensor_ops_1.scalar(broadcastFactor)) : + result; + } + } + if (reduction === Reduction.SUM_BY_NONZERO_WEIGHTS) { + if ($weights == null) { + return weightedLoss.sum().div(tensor_ops_1.scalar($losses.size)); + } + else { + var broadcastedWeights = $weights.mul(tensor_ops_1.ones($losses.shape)); + var numNonZeros = broadcastedWeights.notEqual(tensor_ops_1.scalar(0)).sum().toFloat(); + return weightedLoss.sum().div(numNonZeros); + } + } + throw Error("Unknown reduction: " + reduction); +} +function absoluteDifference_(labels, predictions, weights, reduction) { + if (reduction === void 0) { reduction = Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = tensor_util_env_1.convertToTensor(labels, 'labels', 'absoluteDifference'); + var $predictions = tensor_util_env_1.convertToTensor(predictions, 'predictions', 'absoluteDifference'); + var $weights = null; + if (weights != null) { + $weights = tensor_util_env_1.convertToTensor(weights, 'weights', 'absoluteDifference'); + } + util_1.assertShapesMatch($labels.shape, $predictions.shape, 'Error in absoluteDifference: '); + var losses = $labels.sub($predictions).abs(); + return exports.computeWeightedLoss(losses, $weights, reduction); +} +function meanSquaredError_(labels, predictions, weights, reduction) { + if (reduction === void 0) { reduction = Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = tensor_util_env_1.convertToTensor(labels, 'labels', 'meanSquaredError'); + var $predictions = tensor_util_env_1.convertToTensor(predictions, 'predictions', 'meanSquaredError'); + var $weights = null; + if (weights != null) { + $weights = tensor_util_env_1.convertToTensor(weights, 'weights', 'meanSquaredError'); + } + util_1.assertShapesMatch($labels.shape, $predictions.shape, 'Error in meanSquaredError: '); + var losses = $labels.squaredDifference($predictions); + return exports.computeWeightedLoss(losses, $weights, reduction); +} +function cosineDistance_(labels, predictions, axis, weights, reduction) { + if (reduction === void 0) { reduction = Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = tensor_util_env_1.convertToTensor(labels, 'labels', 'cosineDistance'); + var $predictions = tensor_util_env_1.convertToTensor(predictions, 'predictions', 'cosineDistance'); + var $weights = null; + if (weights != null) { + $weights = tensor_util_env_1.convertToTensor(weights, 'weights', 'cosineDistance'); + } + util_1.assertShapesMatch($labels.shape, $predictions.shape, 'Error in cosineDistance: '); + var one = tensor_ops_1.scalar(1); + var losses = one.sub($labels.mul($predictions).sum(axis, true)); + return exports.computeWeightedLoss(losses, $weights, reduction); +} +function hingeLoss_(labels, predictions, weights, reduction) { + if (reduction === void 0) { reduction = Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = tensor_util_env_1.convertToTensor(labels, 'labels', 'hingeLoss'); + var $predictions = tensor_util_env_1.convertToTensor(predictions, 'predictions', 'hingeLoss'); + var $weights = null; + if (weights != null) { + $weights = tensor_util_env_1.convertToTensor(weights, 'weights', 'hingeLoss'); + } + util_1.assertShapesMatch($labels.shape, $predictions.shape, 'Error in hingeLoss: '); + var one = tensor_ops_1.scalar(1); + $labels = tensor_ops_1.scalar(2).mul($labels).sub(one); + var losses = one.sub($labels.mul($predictions)).relu(); + return exports.computeWeightedLoss(losses, $weights, reduction); +} +function logLoss_(labels, predictions, weights, epsilon, reduction) { + if (epsilon === void 0) { epsilon = 1e-7; } + if (reduction === void 0) { reduction = Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = tensor_util_env_1.convertToTensor(labels, 'labels', 'logLoss'); + var $predictions = tensor_util_env_1.convertToTensor(predictions, 'predictions', 'logLoss'); + var $weights = null; + if (weights != null) { + $weights = tensor_util_env_1.convertToTensor(weights, 'weights', 'logLoss'); + } + util_1.assertShapesMatch($labels.shape, $predictions.shape, 'Error in logLoss: '); + var one = tensor_ops_1.scalar(1); + var epsilonScalar = tensor_ops_1.scalar(epsilon); + var losses = $labels.mul($predictions.add(epsilonScalar).log()) + .neg() + .sub(one.sub($labels).mul(one.sub($predictions).add(epsilonScalar).log())); + return exports.computeWeightedLoss(losses, $weights, reduction); +} +function sigmoidCrossEntropyWithLogits_(labels, logits) { + var $labels = tensor_util_env_1.convertToTensor(labels, 'labels', 'sigmoidCrossEntropyWithLogits'); + var $logits = tensor_util_env_1.convertToTensor(logits, 'logits', 'sigmoidCrossEntropyWithLogits'); + util_1.assertShapesMatch($labels.shape, $logits.shape, 'Error in sigmoidCrossEntropyWithLogits: '); + var maxOutput = $logits.relu(); + var outputXTarget = $logits.mul($labels); + var sigmoidOutput = $logits.abs().neg().exp().log1p(); + return maxOutput.sub(outputXTarget).add(sigmoidOutput); +} +function sigmoidCrossEntropy_(multiClassLabels, logits, weights, labelSmoothing, reduction) { + if (labelSmoothing === void 0) { labelSmoothing = 0; } + if (reduction === void 0) { reduction = Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $multiClassLabels = tensor_util_env_1.convertToTensor(multiClassLabels, 'multiClassLabels', 'sigmoidCrossEntropy'); + var $logits = tensor_util_env_1.convertToTensor(logits, 'logits', 'sigmoidCrossEntropy'); + var $weights = null; + if (weights != null) { + $weights = tensor_util_env_1.convertToTensor(weights, 'weights', 'sigmoidCrossEntropy'); + } + util_1.assertShapesMatch($multiClassLabels.shape, $logits.shape, 'Error in sigmoidCrossEntropy: '); + if (labelSmoothing > 0) { + var labelSmoothingScalar = tensor_ops_1.scalar(labelSmoothing); + var one = tensor_ops_1.scalar(1); + var half = tensor_ops_1.scalar(0.5); + $multiClassLabels = $multiClassLabels.mul(one.sub(labelSmoothingScalar)) + .add(half.mul(labelSmoothingScalar)); + } + var losses = sigmoidCrossEntropyWithLogits_($multiClassLabels, $logits); + return exports.computeWeightedLoss(losses, $weights, reduction); +} +function huberLoss_(labels, predictions, weights, delta, reduction) { + if (delta === void 0) { delta = 1.0; } + if (reduction === void 0) { reduction = Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = tensor_util_env_1.convertToTensor(labels, 'labels', 'huberLoss'); + var $predictions = tensor_util_env_1.convertToTensor(predictions, 'predictions', 'huberLoss'); + var $weights = null; + if (weights != null) { + $weights = tensor_util_env_1.convertToTensor(weights, 'weights', 'huberLoss'); + } + util_1.assertShapesMatch($labels.shape, $predictions.shape, 'Error in huberLoss: '); + var deltaScalar = tensor_ops_1.scalar(delta); + var error = $predictions.sub($labels).abs(); + var quadratic = binary_ops_1.minimum(error, deltaScalar); + var linear = error.sub(quadratic); + var losses = tensor_ops_1.scalar(0.5).mul(quadratic.square()).add(deltaScalar.mul(linear)); + return exports.computeWeightedLoss(losses, $weights, reduction); +} +function softmaxCrossEntropyWithLogits_(labels, logits, dim) { + if (dim === void 0) { dim = -1; } + if (dim === -1) { + dim = logits.rank - 1; + } + if (dim !== logits.rank - 1) { + throw Error("Softmax cross entropy along a non-last dimension is not yet " + + ("supported. Labels / logits was rank " + logits.rank + " ") + + ("and dim was " + dim)); + } + var customOp = globals_1.customGrad(function (labels, logits) { + var keepDims = true; + var lse = logits.logSumExp([dim], keepDims); + var logResult = logits.toFloat().sub(lse); + var costVector = logResult.mul(labels).neg(); + var value = costVector.sum([dim]); + var gradFunc = function (dy) { + var dyShape = axis_util_1.expandShapeToKeepDim(dy.shape, [dim]); + return [ + dy.reshape(dyShape).mul(labels.toFloat().sub(logResult.exp())), + dy.reshape(dyShape).mul(logResult.exp().sub(labels.toFloat())), + ]; + }; + return { value: value, gradFunc: gradFunc }; + }); + return customOp(labels, logits); +} +function softmaxCrossEntropy_(onehotLabels, logits, weights, labelSmoothing, reduction) { + if (labelSmoothing === void 0) { labelSmoothing = 0; } + if (reduction === void 0) { reduction = Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $onehotLabels = tensor_util_env_1.convertToTensor(onehotLabels, 'onehotLabels', 'softmaxCrossEntropy'); + var $logits = tensor_util_env_1.convertToTensor(logits, 'logits', 'softmaxCrossEntropy'); + var $weights = null; + if (weights != null) { + $weights = tensor_util_env_1.convertToTensor(weights, 'weights', 'softmaxCrossEntropy'); + } + util_1.assertShapesMatch($onehotLabels.shape, $logits.shape, 'Error in softmaxCrossEntropy: '); + if (labelSmoothing > 0) { + var labelSmoothingScalar = tensor_ops_1.scalar(labelSmoothing); + var one = tensor_ops_1.scalar(1); + var numClasses = tensor_ops_1.scalar($onehotLabels.shape[1]); + $onehotLabels = $onehotLabels.mul(one.sub(labelSmoothingScalar)) + .add(labelSmoothingScalar.div(numClasses)); + } + var losses = softmaxCrossEntropyWithLogits_($onehotLabels, $logits); + return exports.computeWeightedLoss(losses, $weights, reduction); +} +exports.absoluteDifference = operation_1.op({ absoluteDifference_: absoluteDifference_ }); +exports.computeWeightedLoss = operation_1.op({ computeWeightedLoss_: computeWeightedLoss_ }); +exports.cosineDistance = operation_1.op({ cosineDistance_: cosineDistance_ }); +exports.hingeLoss = operation_1.op({ hingeLoss_: hingeLoss_ }); +exports.huberLoss = operation_1.op({ huberLoss_: huberLoss_ }); +exports.logLoss = operation_1.op({ logLoss_: logLoss_ }); +exports.meanSquaredError = operation_1.op({ meanSquaredError_: meanSquaredError_ }); +exports.sigmoidCrossEntropy = operation_1.op({ sigmoidCrossEntropy_: sigmoidCrossEntropy_ }); +exports.softmaxCrossEntropy = operation_1.op({ softmaxCrossEntropy_: softmaxCrossEntropy_ }); +//# sourceMappingURL=loss_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops.js.map new file mode 100644 index 0000000..50300be --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops.js.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,CAAC;QACtB,IAAM,UAAU,GAAG,mBAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAElD,aAAa,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;aAC3C,GAAG,CAAC,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;KAChE;IAED,IAAM,MAAM,GAAG,8BAA8B,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAEtE,OAAO,2BAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAC1D,CAAC;AAEY,QAAA,kBAAkB,GAAG,cAAE,CAAC,EAAC,mBAAmB,qBAAA,EAAC,CAAC,CAAC;AAC/C,QAAA,mBAAmB,GAAG,cAAE,CAAC,EAAC,oBAAoB,sBAAA,EAAC,CAAC,CAAC;AACjD,QAAA,cAAc,GAAG,cAAE,CAAC,EAAC,eAAe,iBAAA,EAAC,CAAC,CAAC;AACvC,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,gBAAgB,GAAG,cAAE,CAAC,EAAC,iBAAiB,mBAAA,EAAC,CAAC,CAAC;AAC3C,QAAA,mBAAmB,GAAG,cAAE,CAAC,EAAC,oBAAoB,sBAAA,EAAC,CAAC,CAAC;AACjD,QAAA,mBAAmB,GAAG,cAAE,CAAC,EAAC,oBAAoB,sBAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_test.js new file mode 100644 index 0000000..646d289 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_test.js @@ -0,0 +1,1049 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('computeWeightedLoss', test_util_1.ALL_ENVS, function () { + it('1D - no weights', function () { + var losses = tf.tensor1d([1, 2, 3]); + var y = tf.losses.computeWeightedLoss(losses); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (1 + 2 + 3) / 3); + }); + it('1D - no weights - Reduction.NONE', function () { + var losses = tf.tensor1d([1, 2, 3]); + var y = tf.losses.computeWeightedLoss(losses, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [1, 2, 3]); + }); + it('1D - no weights - Reduction.MEAN', function () { + var losses = tf.tensor1d([1, 2, 3]); + var y = tf.losses.computeWeightedLoss(losses, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (1 + 2 + 3) / 3); + }); + it('1D - no weights - Reduction.SUM', function () { + var losses = tf.tensor1d([1, 2, 3]); + var y = tf.losses.computeWeightedLoss(losses, undefined, tf.Reduction.SUM); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (1 + 2 + 3)); + }); + it('1D - weights', function () { + var losses = tf.tensor1d([1, 2, 3]); + var weights = tf.tensor1d([0.1, 0, 0.3]); + var y = tf.losses.computeWeightedLoss(losses, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (1 * 0.1 + 2 * 0 + 3 * 0.3) / 2); + }); + it('2D - weights - broadcast', function () { + var losses = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var y = tf.losses.computeWeightedLoss(losses, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.06666667); + }); + it('1D - weights - Reduction.NONE', function () { + var losses = tf.tensor1d([1, 2, 3]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.computeWeightedLoss(losses, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [1 * 0.1, 2 * 0.2, 3 * 0.3]); + }); + it('1D - weights - Reduction.MEAN', function () { + var losses = tf.tensor1d([1, 2, 3]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.computeWeightedLoss(losses, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (1 * 0.1 + 2 * 0.2 + 3 * 0.3) / 0.6); + }); + it('1D - weights - Reduction.SUM', function () { + var losses = tf.tensor1d([1, 2, 3]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.computeWeightedLoss(losses, weights, tf.Reduction.SUM); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (1 * 0.1 + 2 * 0.2 + 3 * 0.3)); + }); + it('2D - no weights', function () { + var losses = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var y = tf.losses.computeWeightedLoss(losses); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (4 + 8 + 12 + 8 + 1 + 3) / 6); + }); + it('2D - weights', function () { + var losses = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var weights = tf.tensor2d([1, 0, 2, -5, 0, 6], [2, 3]); + var y = tf.losses.computeWeightedLoss(losses, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (4 * 1 + 8 * 0 + 12 * 2 + (8 * -5) + 1 * 0 + 3 * 6) / 4); + }); + it('2D - no weights - Reduction.MEAN', function () { + var losses = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var y = tf.losses.computeWeightedLoss(losses, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (4 + 8 + 12 + 8 + 1 + 3) / 6); + }); + it('2D - weights - Reduction.MEAN', function () { + var losses = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var weights = tf.tensor2d([1, 0, 2, -5, 0, 6], [2, 3]); + var y = tf.losses.computeWeightedLoss(losses, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (4 * 1 + 8 * 0 + 12 * 2 + (8 * -5) + 1 * 0 + 3 * 6) / 4); + }); + it('2D - weights - broadcast - MEAN', function () { + var losses = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var y = tf.losses.computeWeightedLoss(losses, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (0.3 + 0.1 + 0.2) / (3 * 0.6)); + }); + it('2D - no weights - Reduction.SUM', function () { + var losses = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var y = tf.losses.computeWeightedLoss(losses, undefined, tf.Reduction.SUM); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (4 + 8 + 12 + 8 + 1 + 3)); + }); + it('2D - weights - Reduction.SUM', function () { + var losses = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var weights = tf.tensor2d([1, 0, 2, -5, 0, 6], [2, 3]); + var y = tf.losses.computeWeightedLoss(losses, weights, tf.Reduction.SUM); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (4 * 1 + 8 * 0 + 12 * 2 + (8 * -5) + 1 * 0 + 3 * 6)); + }); + it('2D - no weights - Reduction.NONE', function () { + var losses = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var y = tf.losses.computeWeightedLoss(losses, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(y, [4, 8, 12, 8, 1, 3]); + }); + it('2D - weights - Reduction.NONE', function () { + var losses = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var weights = tf.tensor2d([1, 0, 2, -5, 0, 6], [2, 3]); + var y = tf.losses.computeWeightedLoss(losses, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(y, [4 * 1, 8 * 0, 12 * 2, (8 * -5), 1 * 0, 3 * 6]); + }); + it('throws when passed losses as a non-tensor', function () { + var weights = tf.tensor2d([1, 0, 2, -5, 0, 6], [2, 3]); + var e = /Argument 'losses' passed to 'computeWeightedLoss' must be a Tensor/; + expect(function () { return tf.losses.computeWeightedLoss({}, weights, tf.Reduction.NONE); }) + .toThrowError(e); + }); + it('throws when passed weights as a non-tensor', function () { + var losses = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var e = /Argument 'weights' passed to 'computeWeightedLoss' must be a Tensor/; + expect(function () { return tf.losses.computeWeightedLoss(losses, {}, tf.Reduction.NONE); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var losses = [1, 2, 3]; + var weights = [0.1, 0, 0.3]; + var y = tf.losses.computeWeightedLoss(losses, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (1 * 0.1 + 2 * 0 + 3 * 0.3) / 2); + }); +}); +jasmine_util_1.describeWithFlags('absoluteDifference', test_util_1.ALL_ENVS, function () { + it('1D', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var y = tf.losses.absoluteDifference(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (Math.abs(1 - 0.3) + Math.abs(2 - (-0.6)) + Math.abs(3 - (-0.1))) / 3); + }); + it('1D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.absoluteDifference(label, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (Math.abs(1 - 0.3) * 0.1 + Math.abs(2 - (-0.6)) * 0.2 + + Math.abs(3 - (-0.1)) * 0.3) / + 3); + }); + it('1D - weighted - Reduction.NONE', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.absoluteDifference(label, predictions, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [ + Math.abs(1 - 0.3) * 0.1, Math.abs(2 - (-0.6)) * 0.2, + Math.abs(3 - (-0.1)) * 0.3 + ]); + }); + it('1D - Reduction.MEAN', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var y = tf.losses.absoluteDifference(label, predictions, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (Math.abs(1 - 0.3) + Math.abs(2 - (-0.6)) + Math.abs(3 - (-0.1))) / 3); + }); + it('1D - weighted - Reduction.MEAN', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.absoluteDifference(label, predictions, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((Math.abs(1 - 0.3) * 0.1) + (Math.abs(2 - (-0.6)) * 0.2) + + (Math.abs(3 - (-0.1)) * 0.3)) / + 0.6); + }); + it('2D', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var y = tf.losses.absoluteDifference(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (Math.abs(4 - 1) + Math.abs(8 - 9) + Math.abs(12 - 2) + + Math.abs(8 - (-5)) + Math.abs(1 - (-2)) + Math.abs(3 - 6)) / + 6); + }); + it('2D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 0, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.absoluteDifference(label, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (Math.abs(4 - 1) * 3 + Math.abs(8 - 9) * 0 + Math.abs(12 - 2) * 5 + + Math.abs(8 - (-5)) * 0 + Math.abs(1 - (-2)) * 4 + + Math.abs(3 - 6) * 2) / + 4); + }); + it('2D - weighted - Reduction.NONE', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.absoluteDifference(label, predictions, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(y, [ + Math.abs(4 - 1) * 3, Math.abs(8 - 9) * 6, Math.abs(12 - 2) * 5, + Math.abs(8 - (-5)) * 0, Math.abs(1 - (-2)) * 4, Math.abs(3 - 6) * 2 + ]); + }); + it('2D - Reduction.MEAN', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var y = tf.losses.absoluteDifference(label, predictions, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (Math.abs(4 - 1) + Math.abs(8 - 9) + Math.abs(12 - 2) + + Math.abs(8 - (-5)) + Math.abs(1 - (-2)) + Math.abs(3 - 6)) / + 6); + }); + it('2D - weighted - Reduction.MEAN', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.absoluteDifference(label, predictions, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (Math.abs(4 - 1) * 3 + Math.abs(8 - 9) * 6 + Math.abs(12 - 2) * 5 + + Math.abs(8 - (-5)) * 0 + Math.abs(1 - (-2)) * 4 + + Math.abs(3 - 6) * 2) / + 20); + }); + it('throws when passed label as a non-tensor', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = /Argument 'labels' passed to 'absoluteDifference' must be a Tensor/; + expect(function () { return tf.losses.absoluteDifference({}, predictions, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed label as a non-tensor', function () { + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = new RegExp('Argument \'predictions\' passed to \'absoluteDifference\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.absoluteDifference(label, {}, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed weights as a non-tensor', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var e = /Argument 'weights' passed to 'absoluteDifference' must be a Tensor/; + expect(function () { return tf.losses.absoluteDifference(label, predictions, {}, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var predictions = [1, 2, 3]; + var label = [0.3, -0.6, -0.1]; + var weights = [0.1, 0.2, 0.3]; + var y = tf.losses.absoluteDifference(label, predictions, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [ + Math.abs(1 - 0.3) * 0.1, Math.abs(2 - (-0.6)) * 0.2, + Math.abs(3 - (-0.1)) * 0.3 + ]); + }); +}); +jasmine_util_1.describeWithFlags('meanSquaredError', test_util_1.ALL_ENVS, function () { + it('1D', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var y = tf.losses.meanSquaredError(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((1 - 0.3) * (1 - 0.3) + (2 - (-0.6)) * (2 - (-0.6)) + + (3 - (-0.1)) * (3 - (-0.1))) / + 3); + }); + it('1D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.meanSquaredError(label, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((1 - 0.3) * (1 - 0.3) * 0.1 + (2 - (-0.6)) * (2 - (-0.6)) * 0.2 + + (3 - (-0.1)) * (3 - (-0.1)) * 0.3) / + 3); + }); + it('1D - weighted - Reduction.NONE', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.meanSquaredError(label, predictions, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [ + (1 - 0.3) * (1 - 0.3) * 0.1, (2 - (-0.6)) * (2 - (-0.6)) * 0.2, + (3 - (-0.1)) * (3 - (-0.1)) * 0.3 + ]); + }); + it('1D - Reduction.MEAN', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var y = tf.losses.meanSquaredError(label, predictions, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((1 - 0.3) * (1 - 0.3) + (2 - (-0.6)) * (2 - (-0.6)) + + (3 - (-0.1)) * (3 - (-0.1))) / + 3); + }); + it('1D - weighted - Reduction.MEAN', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.meanSquaredError(label, predictions, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (((1 - 0.3) * (1 - 0.3) * 0.1) + ((2 - (-0.6)) * (2 - (-0.6)) * 0.2) + + ((3 - (-0.1)) * (3 - (-0.1)) * 0.3)) / + 0.6); + }); + it('2D', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var y = tf.losses.meanSquaredError(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((4 - 1) * (4 - 1) + (8 - 9) * (8 - 9) + (12 - 2) * (12 - 2) + + (8 - (-5)) * (8 - (-5)) + (1 - (-2)) * (1 - (-2)) + + (3 - 6) * (3 - 6)) / + 6); + }); + it('2D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 0, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.meanSquaredError(label, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((4 - 1) * (4 - 1) * 3 + (8 - 9) * (8 - 9) * 0 + + (12 - 2) * (12 - 2) * 5 + (8 - (-5)) * (8 - (-5)) * 0 + + (1 - (-2)) * (1 - (-2)) * 4 + (3 - 6) * (3 - 6) * 2) / + 4); + }); + it('2D - weighted - Reduction.NONE', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.meanSquaredError(label, predictions, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(y, [ + (4 - 1) * (4 - 1) * 3, (8 - 9) * (8 - 9) * 6, (12 - 2) * (12 - 2) * 5, + (8 - (-5)) * (8 - (-5)) * 0, (1 - (-2)) * (1 - (-2)) * 4, + (3 - 6) * (3 - 6) * 2 + ]); + }); + it('2D - Reduction.MEAN', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var y = tf.losses.meanSquaredError(label, predictions, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((4 - 1) * (4 - 1) + (8 - 9) * (8 - 9) + (12 - 2) * (12 - 2) + + (8 - (-5)) * (8 - (-5)) + (1 - (-2)) * (1 - (-2)) + + (3 - 6) * (3 - 6)) / + 6); + }); + it('2D - weighted - Reduction.MEAN', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.meanSquaredError(label, predictions, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((4 - 1) * (4 - 1) * 3 + (8 - 9) * (8 - 9) * 6 + + (12 - 2) * (12 - 2) * 5 + (8 - (-5)) * (8 - (-5)) * 0 + + (1 - (-2)) * (1 - (-2)) * 4 + (3 - 6) * (3 - 6) * 2) / + 20); + }); + it('throws when passed label as a non-tensor', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = /Argument 'labels' passed to 'meanSquaredError' must be a Tensor/; + expect(function () { return tf.losses.meanSquaredError({}, predictions, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed label as a non-tensor', function () { + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = new RegExp('Argument \'predictions\' passed to \'meanSquaredError\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.meanSquaredError(label, {}, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed weights as a non-tensor', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var e = /Argument 'weights' passed to 'meanSquaredError' must be a Tensor/; + expect(function () { return tf.losses.meanSquaredError(label, predictions, {}, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var predictions = [1, 2, 3]; + var label = [0.3, -0.6, -0.1]; + var weights = [0.1, 0.2, 0.3]; + var y = tf.losses.meanSquaredError(label, predictions, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [ + (1 - 0.3) * (1 - 0.3) * 0.1, (2 - (-0.6)) * (2 - (-0.6)) * 0.2, + (3 - (-0.1)) * (3 - (-0.1)) * 0.3 + ]); + }); +}); +jasmine_util_1.describeWithFlags('cosineDistance', test_util_1.ALL_ENVS, function () { + it('1D', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var y = tf.losses.cosineDistance(label, predictions, 0); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 1 - (1 * 0.3 + 2 * -0.6 + 3 * -0.1)); + }); + it('1D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var weights = tf.scalar(0.1); + var y = tf.losses.cosineDistance(label, predictions, 0, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (1 - (1 * 0.3 + 2 * -0.6 + 3 * -0.1)) * 0.1); + }); + it('1D - weighted - Reduction.NONE', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var weights = tf.scalar(0.1); + var y = tf.losses.cosineDistance(label, predictions, 0, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([1]); + test_util_1.expectArraysClose(y, [(1 - (1 * 0.3 + 2 * -0.6 + 3 * -0.1)) * 0.1]); + }); + it('1D - Reduction.MEAN', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var y = tf.losses.cosineDistance(label, predictions, 0, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), (1 - (1 * 0.3 + 2 * -0.6 + 3 * -0.1))); + }); + it('1D - weighted - Reduction.MEAN', function () { + var predictions = tf.tensor1d([1, 2, 3]); + var label = tf.tensor1d([0.3, -0.6, -0.1]); + var weights = tf.scalar(0.1); + var y = tf.losses.cosineDistance(label, predictions, 0, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((1 - (1 * 0.3 + 2 * -0.6 + 3 * -0.1)) * 0.1) / 0.1); + }); + it('2D', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var y = tf.losses.cosineDistance(label, predictions, 1); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((1 - (4 * 1 + 8 * 9 + 12 * 2)) + (1 - (8 * -5 + 1 * -2 + 3 * 6))) / 2); + }); + it('2D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 0], [2, 1]); + var y = tf.losses.cosineDistance(label, predictions, 1, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((1 - (4 * 1 + 8 * 9 + 12 * 2)) * 3 + + (1 - (8 * -5 + 1 * -2 + 3 * 6)) * 0) / + 1); + }); + it('2D - weighted - Reduction.NONE', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 0], [2, 1]); + var y = tf.losses.cosineDistance(label, predictions, 1, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([2, 1]); + test_util_1.expectArraysClose(y, [ + (1 - (4 * 1 + 8 * 9 + 12 * 2)) * 3, (1 - (8 * -5 + 1 * -2 + 3 * 6)) * 0 + ]); + }); + it('2D - Reduction.MEAN', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var y = tf.losses.cosineDistance(label, predictions, 1, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((1 - (4 * 1 + 8 * 9 + 12 * 2)) + (1 - (8 * -5 + 1 * -2 + 3 * 6))) / 2); + }); + it('2D - weighted - Reduction.MEAN', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 0], [2, 1]); + var y = tf.losses.cosineDistance(label, predictions, 1, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), ((1 - (4 * 1 + 8 * 9 + 12 * 2)) * 3 + + (1 - (8 * -5 + 1 * -2 + 3 * 6)) * 0) / + 3); + }); + it('throws when passed label as a non-tensor', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = /Argument 'labels' passed to 'cosineDistance' must be a Tensor/; + expect(function () { return tf.losses.cosineDistance({}, predictions, 0, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed label as a non-tensor', function () { + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = new RegExp('Argument \'predictions\' passed to \'cosineDistance\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.cosineDistance(label, {}, 0, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed weights as a non-tensor', function () { + var predictions = tf.tensor2d([4, 8, 12, 8, 1, 3], [2, 3]); + var label = tf.tensor2d([1, 9, 2, -5, -2, 6], [2, 3]); + var e = /Argument 'weights' passed to 'cosineDistance' must be a Tensor/; + expect(function () { return tf.losses.cosineDistance(label, predictions, 0, {}, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var predictions = [1, 2, 3]; + var label = [0.3, -0.6, -0.1]; + var weights = 0.1; + var y = tf.losses.cosineDistance(label, predictions, 0, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([1]); + test_util_1.expectArraysClose(y, [(1 - (1 * 0.3 + 2 * -0.6 + 3 * -0.1)) * 0.1]); + }); +}); +jasmine_util_1.describeWithFlags('hingeLoss', test_util_1.ALL_ENVS, function () { + it('1D', function () { + var predictions = tf.tensor1d([0, 0, 1, 1]); + var label = tf.tensor1d([0, 1, 0, 1]); + var y = tf.losses.hingeLoss(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 1.0); + }); + it('1D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var predictions = tf.tensor1d([0, 0, 1, 1]); + var label = tf.tensor1d([0, 1, 0, 1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3, 0.4]); + var y = tf.losses.hingeLoss(label, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.225); + }); + it('1D - weighted - Reduction.NONE', function () { + var predictions = tf.tensor1d([0, 0, 1, 1]); + var label = tf.tensor1d([0, 1, 0, 1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3, 0.4]); + var y = tf.losses.hingeLoss(label, predictions, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([4]); + test_util_1.expectArraysClose(y, [0.1, 0.2, 0.6, 0.0]); + }); + it('1D - Reduction.MEAN', function () { + var predictions = tf.tensor1d([0, 0, 1, 1]); + var label = tf.tensor1d([0, 1, 0, 1]); + var y = tf.losses.hingeLoss(label, predictions, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 1.0); + }); + it('1D - weighted - Reduction.MEAN', function () { + var predictions = tf.tensor1d([0, 0, 1, 1]); + var label = tf.tensor1d([0, 1, 0, 1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3, 0.4]); + var y = tf.losses.hingeLoss(label, predictions, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.9); + }); + it('2D', function () { + var predictions = tf.tensor2d([0, 0, 0, 1, 1, 1], [2, 3]); + var label = tf.tensor2d([0, 1, 0, 1, 0, 1], [2, 3]); + var y = tf.losses.hingeLoss(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.8333333); + }); + it('2D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var predictions = tf.tensor2d([0, 0, 0, 1, 1, 1], [2, 3]); + var label = tf.tensor2d([0, 1, 0, 1, 0, 1], [2, 3]); + var weights = tf.tensor2d([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], [2, 3]); + var y = tf.losses.hingeLoss(label, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.26666668); + }); + it('2D - weighted - Reduction.NONE', function () { + var predictions = tf.tensor2d([0, 0, 0, 1, 1, 1], [2, 3]); + var label = tf.tensor2d([0, 1, 0, 1, 0, 1], [2, 3]); + var weights = tf.tensor2d([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], [2, 3]); + var y = tf.losses.hingeLoss(label, predictions, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(y, [0.1, 0.2, 0.3, 0, 1, 0]); + }); + it('2D - Reduction.MEAN', function () { + var predictions = tf.tensor2d([0, 0, 0, 1, 1, 1], [2, 3]); + var label = tf.tensor2d([0, 1, 0, 1, 0, 1], [2, 3]); + var y = tf.losses.hingeLoss(label, predictions, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.8333333); + }); + it('2D - weighted - Reduction.MEAN', function () { + var predictions = tf.tensor2d([0, 0, 0, 1, 1, 1], [2, 3]); + var label = tf.tensor2d([0, 1, 0, 1, 0, 1], [2, 3]); + var weights = tf.tensor2d([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], [2, 3]); + var y = tf.losses.hingeLoss(label, predictions, weights, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.76190484); + }); + it('throws when passed label as a non-tensor', function () { + var predictions = tf.tensor2d([1, 0, 1, 0, 1, 0], [2, 3]); + var weights = tf.tensor2d([1, 0, 1, 0, 1, 0], [2, 3]); + var e = /Argument 'labels' passed to 'hingeLoss' must be a Tensor/; + expect(function () { return tf.losses.hingeLoss({}, predictions, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed label as a non-tensor', function () { + var label = tf.tensor2d([1, 0, 1, 0, 1, 0], [2, 3]); + var weights = tf.tensor2d([1, 0, 1, 0, 1, 0], [2, 3]); + var e = new RegExp('Argument \'predictions\' passed to \'hingeLoss\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.hingeLoss(label, {}, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed weights as a non-tensor', function () { + var predictions = tf.tensor2d([1, 0, 1, 0, 1, 0], [2, 3]); + var label = tf.tensor2d([1, 0, 1, 0, 1, 0], [2, 3]); + var e = /Argument 'weights' passed to 'hingeLoss' must be a Tensor/; + expect(function () { return tf.losses.hingeLoss(label, predictions, {}, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var predictions = [0, 0, 1, 1]; + var label = [0, 1, 0, 1]; + var weights = [0.1, 0.2, 0.3, 0.4]; + var y = tf.losses.hingeLoss(label, predictions, weights, tf.Reduction.NONE); + expect(y.shape).toEqual([4]); + test_util_1.expectArraysClose(y, [0.1, 0.2, 0.6, 0.0]); + }); +}); +jasmine_util_1.describeWithFlags('logLoss', test_util_1.ALL_ENVS, function () { + it('1D', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var y = tf.losses.logLoss(labels, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 2.668788); + }); + it('1D - Check for negative values', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, -0.6, -0.1]); + var y = tf.losses.logLoss(labels, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), NaN); + }); + it('1D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.logLoss(labels, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.7168596); + }); + it('1D - weighted - Reduction.NONE', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.logLoss(labels, predictions, weights, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [0.12039725, 0.02107204, 2.0091095]); + }); + it('1D - Reduction.MEAN', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var y = tf.losses.logLoss(labels, predictions, undefined, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 2.668788); + }); + it('1D - weighted - Reduction.MEAN', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.logLoss(labels, predictions, weights, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 3.5842977); + }); + it('2D', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var y = tf.losses.logLoss(labels, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.60019904); + }); + it('2D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var weights = tf.tensor2d([3, 0, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.logLoss(labels, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 1.8866577); + }); + it('2D - weighted - Reduction.NONE', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var weights = tf.tensor2d([3, 0, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.logLoss(labels, predictions, weights, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(y, [2.9527497, 0., 1.8451363, 0., 1.3829476, 1.3657978]); + }); + it('2D - Reduction.MEAN', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var y = tf.losses.logLoss(labels, predictions, undefined, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.60019904); + }); + it('2D - weighted - Reduction.MEAN', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var weights = tf.tensor2d([3, 0, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.logLoss(labels, predictions, weights, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.53904504); + }); + it('throws when passed label as a non-tensor', function () { + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = /Argument 'labels' passed to 'logLoss' must be a Tensor/; + expect(function () { return tf.losses.logLoss({}, predictions, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed label as a non-tensor', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = new RegExp('Argument \'predictions\' passed to \'logLoss\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.logLoss(labels, {}, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed weights as a non-tensor', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var e = /Argument 'weights' passed to 'logLoss' must be a Tensor/; + expect(function () { return tf.losses.logLoss(labels, predictions, {}, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var labels = [1, 2, 3]; + var predictions = [0.3, 0.6, 0.1]; + var weights = [0.1, 0.2, 0.3]; + var y = tf.losses.logLoss(labels, predictions, weights, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [0.12039725, 0.02107204, 2.0091095]); + }); +}); +jasmine_util_1.describeWithFlags('huberLoss', test_util_1.ALL_ENVS, function () { + it('1D', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var y = tf.losses.huberLoss(labels, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 1.1816667); + }); + it('1D - delta', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var delta = 0.4; + var y = tf.losses.huberLoss(labels, predictions, undefined, delta); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.58666664); + }); + it('1D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.huberLoss(labels, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.30816665); + }); + it('1D - weighted - Reduction.NONE', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.huberLoss(labels, predictions, weights, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [0.0245, 0.17999999, 0.72]); + }); + it('1D - Reduction.MEAN', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var y = tf.losses.huberLoss(labels, predictions, undefined, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 1.1816667); + }); + it('1D - weighted - Reduction.MEAN', function () { + var labels = tf.tensor1d([1, 2, 3]); + var predictions = tf.tensor1d([0.3, 0.6, 0.1]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.huberLoss(labels, predictions, weights, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 1.5408332); + }); + it('2D', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var y = tf.losses.huberLoss(labels, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.01795); + }); + it('2D - weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var weights = tf.tensor2d([3, 0, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.huberLoss(labels, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.040875003); + }); + it('2D - weighted - Reduction.NONE', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var weights = tf.tensor2d([3, 0, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.huberLoss(labels, predictions, weights, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(y, [0.135, 0., 0.001, 0., 0.005, 0.0225]); + }); + it('2D - Reduction.MEAN', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var y = tf.losses.huberLoss(labels, predictions, undefined, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.01795); + }); + it('2D - weighted - Reduction.MEAN', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var weights = tf.tensor2d([3, 0, 5, 0, 4, 2], [2, 3]); + var y = tf.losses.huberLoss(labels, predictions, weights, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0.011678572); + }); + it('throws when passed label as a non-tensor', function () { + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = /Argument 'labels' passed to 'huberLoss' must be a Tensor/; + expect(function () { return tf.losses.huberLoss({}, predictions, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed label as a non-tensor', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var weights = tf.tensor2d([3, 6, 5, 0, 4, 2], [2, 3]); + var e = new RegExp('Argument \'predictions\' passed to \'huberLoss\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.huberLoss(labels, {}, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed weights as a non-tensor', function () { + var labels = tf.tensor2d([0.4, 0.8, 0.12, 0.8, 0.1, 0.3], [2, 3]); + var predictions = tf.tensor2d([0.1, 0.7, 0.1, 0.5, 0.05, 0.15], [2, 3]); + var e = /Argument 'weights' passed to 'huberLoss' must be a Tensor/; + expect(function () { return tf.losses.huberLoss(labels, predictions, {}, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var labels = [1, 2, 3]; + var predictions = [0.3, 0.6, 0.1]; + var weights = [0.1, 0.2, 0.3]; + var y = tf.losses.huberLoss(labels, predictions, weights, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [0.0245, 0.17999999, 0.72]); + }); +}); +jasmine_util_1.describeWithFlags('sigmoidCrossEntropy', test_util_1.ALL_ENVS, function () { + it('All wrong', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var y = tf.losses.sigmoidCrossEntropy(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 6.6667123); + }); + it('All right', function () { + var label = tf.tensor2d([[1, 0, 0], [0, 1, 0], [0, 0, 1]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var y = tf.losses.sigmoidCrossEntropy(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0); + }); + it('Weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var y = tf.losses.sigmoidCrossEntropy(label, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 1.3333424); + }); + it('Weighted - Reduction.NONE', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var y = tf.losses.sigmoidCrossEntropy(label, predictions, weights, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([3, 3]); + test_util_1.expectArraysClose(y, [ + 1.0000046, 9.0797803e-06, 3.0000138e+00, 1.0000046e+00, 2.0000093e+00, + 1.3619671e-05, 4.5398901e-06, 2.0000093e+00, 3.0000138e+00 + ]); + }); + it('Reduction.MEAN', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var y = tf.losses.sigmoidCrossEntropy(label, predictions, undefined, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 6.6667123); + }); + it('Weighted - Reduction.MEAN', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var y = tf.losses.sigmoidCrossEntropy(label, predictions, weights, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 6.666712284088135); + }); + it('Label Smoothing - Weighted - Reduction.MEAN', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var labelSmoothing = 0.3; + var y = tf.losses.sigmoidCrossEntropy(label, predictions, weights, labelSmoothing, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 6.1667128); + }); + it('throws when multiClassLabels and logits are of different shapes', function () { + var multiClassLabels = tf.tensor2d([10, 10, 10, 10, 10, 10, 10, 10, 10], [3, 3]); + var logits = tf.tensor2d([10, 10, 10, 10, 10, 10], [2, 3]); + var e = new RegExp('Error in sigmoidCrossEntropy: Shapes 3,3 and 2,3 must match'); + expect(function () { return tf.losses.sigmoidCrossEntropy(multiClassLabels, logits); }) + .toThrowError(e); + }); + it('throws when passed multiClassLabels as a non-tensor', function () { + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var e = new RegExp('Argument \'multiClassLabels\' passed to \'sigmoidCrossEntropy\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.sigmoidCrossEntropy({}, predictions, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed logits as a non-tensor', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var e = new RegExp('Argument \'logits\' passed to \'sigmoidCrossEntropy\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.sigmoidCrossEntropy(label, {}, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed weights as a non-tensor', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var e = /Argument 'weights' passed to 'sigmoidCrossEntropy' must be a Tensor/; + expect(function () { return tf.losses.sigmoidCrossEntropy(label, predictions, {}, tf.Reduction.MEAN); }) + .toThrowError(e); + }); +}); +jasmine_util_1.describeWithFlags('softmaxCrossEntropy', test_util_1.ALL_ENVS, function () { + it('All wrong', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var y = tf.losses.softmaxCrossEntropy(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 20); + }); + it('All right', function () { + var label = tf.tensor2d([[1, 0, 0], [0, 1, 0], [0, 0, 1]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var y = tf.losses.softmaxCrossEntropy(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 0); + }); + it('Weighted - Reduction.SUM_BY_NONZERO_WEIGHTS', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3], [0.1, 0.2, 0.3], [0.1, 0.2, 0.3]]); + var y = tf.losses.softmaxCrossEntropy(label, predictions, weights); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 4); + }); + it('Weighted - Reduction.NONE', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.softmaxCrossEntropy(label, predictions, weights, undefined, tf.Reduction.NONE); + expect(y.shape).toEqual([3]); + test_util_1.expectArraysClose(y, [2, 4, 6]); + }); + it('Reduction.MEAN', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var y = tf.losses.softmaxCrossEntropy(label, predictions, undefined, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 20); + }); + it('Weighted - Reduction.MEAN', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor1d([0.1, 0.2, 0.3]); + var y = tf.losses.softmaxCrossEntropy(label, predictions, weights, undefined, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 20); + }); + it('Label Smoothing - Weighted - Reduction.MEAN', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var labelSmoothing = 0.3; + var y = tf.losses.softmaxCrossEntropy(label, predictions, weights, labelSmoothing, tf.Reduction.MEAN); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 18); + }); + it('throws when multiClassLabels and logits are of different shapes', function () { + var multiClassLabels = tf.tensor2d([10, 10, 10, 10, 10, 10, 10, 10, 10], [3, 3]); + var logits = tf.tensor2d([10, 10, 10, 10, 10, 10], [2, 3]); + var e = new RegExp('Error in softmaxCrossEntropy: Shapes 3,3 and 2,3 must match'); + expect(function () { return tf.losses.softmaxCrossEntropy(multiClassLabels, logits); }) + .toThrowError(e); + }); + it('throws when passed multiClassLabels as a non-tensor', function () { + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var e = new RegExp('Argument \'onehotLabels\' passed to \'softmaxCrossEntropy\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.softmaxCrossEntropy({}, predictions, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed logits as a non-tensor', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var weights = tf.tensor2d([[0.1, 0.2, 0.3]]); + var e = new RegExp('Argument \'logits\' passed to \'softmaxCrossEntropy\' ' + + 'must be a Tensor'); + expect(function () { return tf.losses.softmaxCrossEntropy(label, {}, weights, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('throws when passed weights as a non-tensor', function () { + var label = tf.tensor2d([[0, 0, 1], [1, 0, 0], [0, 1, 0]], [3, 3]); + var predictions = tf.tensor2d([[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]], [3, 3]); + var e = /Argument 'weights' passed to 'softmaxCrossEntropy' must be a Tensor/; + expect(function () { return tf.losses.softmaxCrossEntropy(label, predictions, {}, tf.Reduction.MEAN); }) + .toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var label = [[0, 0, 1], [1, 0, 0], [0, 1, 0]]; + var predictions = [[10.0, -10.0, -10.0], [-10.0, 10.0, -10.0], [-10.0, -10.0, 10.0]]; + var y = tf.losses.softmaxCrossEntropy(label, predictions); + expect(y.shape).toEqual([]); + test_util_1.expectNumbersClose(y.get(), 20); + }); +}); +//# sourceMappingURL=loss_ops_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_test.js.map new file mode 100644 index 0000000..5171c75 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"loss_ops_test.js","sourceRoot":"","sources":["../../src/ops/loss_ops_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA6E;AAE7E,gCAAiB,CAAC,qBAAqB,EAAE,oBAAQ,EAAE;IACjD,EAAE,CAAC,iBAAiB,EAAE;QACpB,IAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEtC,IAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAEhD,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5B,8BAAkB,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE;QACrC,IAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEtC,IAAM,CAAC,GACH,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAExE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAChD,IAAM,WAAW,GACb,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QAEvE,IAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAE5D,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5B,8BAAkB,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lrn.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn.d.ts new file mode 100644 index 0000000..e15821e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn.d.ts @@ -0,0 +1,5 @@ +import { Tensor3D, Tensor4D } from '../tensor'; +import { TensorLike } from '../types'; +declare function localResponseNormalization_(x: T | TensorLike, depthRadius?: number, bias?: number, alpha?: number, beta?: number): T; +export declare const localResponseNormalization: typeof localResponseNormalization_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lrn.js b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn.js new file mode 100644 index 0000000..40c3403 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var operation_1 = require("./operation"); +function localResponseNormalization_(x, depthRadius, bias, alpha, beta) { + if (depthRadius === void 0) { depthRadius = 5; } + if (bias === void 0) { bias = 1; } + if (alpha === void 0) { alpha = 1; } + if (beta === void 0) { beta = 0.5; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'localResponseNormalization'); + util.assert($x.rank === 4 || $x.rank === 3, "Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank " + $x.rank + "."); + util.assert(util.isInt(depthRadius), "Error in localResponseNormalization: depthRadius must be an integer\n but got depthRadius " + depthRadius + "."); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + var backward = function (dy, saved) { + var outputImage = saved[0]; + return { + x4D: function () { return environment_1.ENV.engine.runKernel(function (backend) { return backend.LRNGrad(dy, x4D, outputImage, depthRadius, bias, alpha, beta); }, {}); } + }; + }; + var res = environment_1.ENV.engine.runKernel(function (backend, save) { return save(backend.localResponseNormalization4D(x4D, depthRadius, bias, alpha, beta)); }, { x4D: x4D }, backward); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + else { + return res; + } +} +exports.localResponseNormalization = operation_1.op({ localResponseNormalization_: localResponseNormalization_ }); +//# sourceMappingURL=lrn.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lrn.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn.js.map new file mode 100644 index 0000000..4736bbf --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lrn.js","sourceRoot":"","sources":["../../src/ops/lrn.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,8BAAgC;AAChC,yCAA+B;AAgB/B,qCACI,CAAe,EAAE,WAAe,EA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5B,UAAC,OAAO,EAAE,IAAI,IAAK,OAAA,IAAI,CAAC,OAAO,CAAC,4BAA4B,CACxD,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,EADtB,CACsB,EACzC,EAAC,GAAG,KAAA,EAAC,EAAE,QAAQ,CAAC,CAAC;IACrB,IAAI,YAAY,EAAE;QAChB,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAM,CAAC;KAChE;SAAM;QACL,OAAO,GAAQ,CAAC;KACjB;AACH,CAAC;AAEY,QAAA,0BAA0B,GAAG,cAAE,CAAC,EAAC,2BAA2B,6BAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lrn_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lrn_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn_test.js new file mode 100644 index 0000000..b52eda9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn_test.js @@ -0,0 +1,854 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var sqArr = function (arr) { return arr.map(function (d) { return d * d; }); }; +var sumArr = function (arr) { return arr.reduce(function (prev, curr) { return prev + curr; }, 0); }; +var flatten = function (arr) { + return arr.reduce(function (prev, curr) { + return prev.concat(Array.isArray(curr) ? flatten(curr) : curr); + }, []); +}; +jasmine_util_1.describeWithFlags('localResponseNormalization with Tensor3D', test_util_1.ALL_ENVS, function () { + it('throws error with invalid input', function () { + var x = tf.tensor2d([1, 20, 300, 4], [1, 4]); + var radius = 3; + expect(function () { return x.localResponseNormalization(radius); }).toThrowError(); + }); + it('throws error with invalid radius', function () { + var x = tf.tensor3d([1, 20, 300, 4], [1, 1, 4]); + var radius = 0.5; + expect(function () { return x.localResponseNormalization(radius); }).toThrowError(); + }); + it('computes simple normalization across channels', function () { + var x = tf.tensor3d([1, 20, 300, 4], [1, 1, 4]); + var radius = 1; + var bias = 1; + var alpha = 1; + var beta = 0.5; + var result = x.localResponseNormalization(radius, bias, alpha, beta); + var f = function () { + var vals = []; + for (var _i = 0; _i < arguments.length; _i++) { + vals[_i] = arguments[_i]; + } + return Math.pow(bias + alpha * sumArr(sqArr(vals)), -beta); + }; + test_util_1.expectArraysClose(result, [ + x.get(0, 0, 0) * f(x.get(0, 0, 0), x.get(0, 0, 1)), + x.get(0, 0, 1) * f(x.get(0, 0, 0), x.get(0, 0, 1), x.get(0, 0, 2)), + x.get(0, 0, 2) * f(x.get(0, 0, 1), x.get(0, 0, 2), x.get(0, 0, 3)), + x.get(0, 0, 3) * f(x.get(0, 0, 2), x.get(0, 0, 3)), + ]); + }); + it('uses beta = 1.0 to test GPU optimization', function () { + var x = tf.tensor3d([1, 20, 300, 4], [1, 1, 4]); + var radius = 1; + var bias = 1; + var alpha = 1; + var beta = 1.0; + var result = x.localResponseNormalization(radius, bias, alpha, beta); + var f = function () { + var vals = []; + for (var _i = 0; _i < arguments.length; _i++) { + vals[_i] = arguments[_i]; + } + return Math.pow(bias + alpha * sumArr(sqArr(vals)), -beta); + }; + test_util_1.expectArraysClose(result, [ + x.get(0, 0, 0) * f(x.get(0, 0, 0), x.get(0, 0, 1)), + x.get(0, 0, 1) * f(x.get(0, 0, 0), x.get(0, 0, 1), x.get(0, 0, 2)), + x.get(0, 0, 2) * f(x.get(0, 0, 1), x.get(0, 0, 2), x.get(0, 0, 3)), + x.get(0, 0, 3) * f(x.get(0, 0, 2), x.get(0, 0, 3)), + ]); + }); + it('uses beta = 0.75 to test GPU optimization', function () { + var x = tf.tensor3d([1, 20, 300, 4], [1, 1, 4]); + var radius = 1; + var bias = 1; + var alpha = 1; + var beta = 0.75; + var result = x.localResponseNormalization(radius, bias, alpha, beta); + var f = function () { + var vals = []; + for (var _i = 0; _i < arguments.length; _i++) { + vals[_i] = arguments[_i]; + } + return Math.pow(bias + alpha * sumArr(sqArr(vals)), -beta); + }; + test_util_1.expectArraysClose(result, [ + x.get(0, 0, 0) * f(x.get(0, 0, 0), x.get(0, 0, 1)), + x.get(0, 0, 1) * f(x.get(0, 0, 0), x.get(0, 0, 1), x.get(0, 0, 2)), + x.get(0, 0, 2) * f(x.get(0, 0, 1), x.get(0, 0, 2), x.get(0, 0, 3)), + x.get(0, 0, 3) * f(x.get(0, 0, 2), x.get(0, 0, 3)), + ]); + }); + it('computes complex normalization across channels', function () { + var x = tf.tensor3d([1, 20, 300, 4, 5, 15, 24, 200, 1, 20, 300, 4, 5, 15, 24, 200], [2, 2, 4]); + var radius = 1; + var bias = 1; + var alpha = 1; + var beta = 0.5; + var result = x.localResponseNormalization(radius, bias, alpha, beta); + var f = function () { + var vals = []; + for (var _i = 0; _i < arguments.length; _i++) { + vals[_i] = arguments[_i]; + } + return Math.pow(bias + alpha * sumArr(sqArr(vals)), -beta); + }; + test_util_1.expectArraysClose(result, [ + x.get(0, 0, 0) * f(x.get(0, 0, 0), x.get(0, 0, 1)), + x.get(0, 0, 1) * f(x.get(0, 0, 0), x.get(0, 0, 1), x.get(0, 0, 2)), + x.get(0, 0, 2) * f(x.get(0, 0, 1), x.get(0, 0, 2), x.get(0, 0, 3)), + x.get(0, 0, 3) * f(x.get(0, 0, 2), x.get(0, 0, 3)), + x.get(0, 1, 0) * f(x.get(0, 1, 0), x.get(0, 1, 1)), + x.get(0, 1, 1) * f(x.get(0, 1, 0), x.get(0, 1, 1), x.get(0, 1, 2)), + x.get(0, 1, 2) * f(x.get(0, 1, 1), x.get(0, 1, 2), x.get(0, 1, 3)), + x.get(0, 1, 3) * f(x.get(0, 1, 2), x.get(0, 1, 3)), + x.get(1, 0, 0) * f(x.get(1, 0, 0), x.get(1, 0, 1)), + x.get(1, 0, 1) * f(x.get(1, 0, 0), x.get(1, 0, 1), x.get(1, 0, 2)), + x.get(1, 0, 2) * f(x.get(1, 0, 1), x.get(1, 0, 2), x.get(1, 0, 3)), + x.get(1, 0, 3) * f(x.get(1, 0, 2), x.get(1, 0, 3)), + x.get(1, 1, 0) * f(x.get(1, 1, 0), x.get(1, 1, 1)), + x.get(1, 1, 1) * f(x.get(1, 1, 0), x.get(1, 1, 1), x.get(1, 1, 2)), + x.get(1, 1, 2) * f(x.get(1, 1, 1), x.get(1, 1, 2), x.get(1, 1, 3)), + x.get(1, 1, 3) * f(x.get(1, 1, 2), x.get(1, 1, 3)), + ]); + }); + it('yields same result as tensorflow', function () { + var input = [ + [ + [ + 0.95782757, 0.12892687, 0.63624668, 0.70160735, 0.77376258, + 0.54166114, 0.71172535, 0.65087497 + ], + [ + 0.91872108, 0.38846886, 0.37847793, 0.50477624, 0.42154622, + 0.43310916, 0.36253822, 0.07576156 + ], + [ + 0.48662257, 0.4154036, 0.81704032, 0.91660416, 0.87671542, 0.64215934, + 0.29933751, 0.90671134 + ] + ], + [ + [ + 0.6208992, 0.60847163, 0.41475761, 0.2127713, 0.65306914, 0.13923979, + 0.32003641, 0.28183973 + ], + [ + 0.04751575, 0.26870155, 0.45150304, 0.58678186, 0.99118924, + 0.58878231, 0.30913198, 0.18836617 + ], + [ + 0.16166461, 0.56322742, 0.67908955, 0.2269547, 0.38491273, 0.97113752, + 0.51210916, 0.69430435 + ] + ], + [ + [ + 0.06625497, 0.13011181, 0.59202921, 0.88871598, 0.6366322, 0.47911358, + 0.96530843, 0.74259472 + ], + [ + 0.62660718, 0.0445286, 0.18430257, 0.76863647, 0.87511849, 0.53588808, + 0.27980685, 0.30281997 + ], + [ + 0.73987067, 0.91034842, 0.26241004, 0.72832751, 0.78974342, + 0.50751543, 0.05434644, 0.8231523 + ] + ] + ]; + var expected = [ + [ + [ + 0.62630326, 0.07662392, 0.34354961, 0.41885775, 0.42621866, + 0.29751951, 0.42365381, 0.4364861 + ], + [ + 0.62828875, 0.251122, 0.23605582, 0.36483878, 0.30624411, 0.32672295, + 0.29576892, 0.06582346 + ], + [ + 0.3376624, 0.24321821, 0.42558169, 0.46646208, 0.45103404, 0.32380751, + 0.17021206, 0.59476018 + ] + ], + [ + [ + 0.44719055, 0.43318295, 0.26775005, 0.14921051, 0.49148726, + 0.10764983, 0.25084552, 0.25714993 + ], + [ + 0.04202608, 0.21094096, 0.27973703, 0.34166718, 0.57487047, + 0.35158369, 0.19708875, 0.15495601 + ], + [ + 0.12034657, 0.41341963, 0.47968671, 0.13278878, 0.22735766, + 0.57154536, 0.30411762, 0.42352781 + ] + ], + [ + [ + 0.05656794, 0.08849642, 0.36951816, 0.53186077, 0.33065733, + 0.24236222, 0.54666328, 0.45085984 + ], + [ + 0.52425432, 0.03133496, 0.11043368, 0.46954039, 0.5271349, 0.31946796, + 0.1876673, 0.25085902 + ], + [ + 0.47316891, 0.5277527, 0.13831842, 0.40036613, 0.50113004, 0.28860986, + 0.03395459, 0.59127772 + ] + ] + ]; + var x = tf.tensor3d(flatten(input), [3, 3, 8]); + var radius = 2; + var bias = 1; + var alpha = 1; + var beta = 0.5; + var result = x.localResponseNormalization(radius, bias, alpha, beta); + test_util_1.expectArraysClose(result, flatten(expected)); + }); + it('accepts a tensor-like object', function () { + var x = [[[1, 20, 300, 4]]]; + var radius = 1; + var bias = 1; + var alpha = 1; + var beta = 0.5; + var result = tf.localResponseNormalization(x, radius, bias, alpha, beta); + var f = function () { + var vals = []; + for (var _i = 0; _i < arguments.length; _i++) { + vals[_i] = arguments[_i]; + } + return Math.pow(bias + alpha * sumArr(sqArr(vals)), -beta); + }; + test_util_1.expectArraysClose(result, [ + x[0][0][0] * f(x[0][0][0], x[0][0][1]), + x[0][0][1] * f(x[0][0][0], x[0][0][1], x[0][0][2]), + x[0][0][2] * f(x[0][0][1], x[0][0][2], x[0][0][3]), + x[0][0][3] * f(x[0][0][2], x[0][0][3]), + ]); + }); +}); +jasmine_util_1.describeWithFlags('localResponseNormalization with Tensor4D', test_util_1.ALL_ENVS, function () { + it('throws error with invalid input', function () { + var x = tf.tensor2d([1, 20, 300, 4], [1, 4]); + var radius = 3; + expect(function () { return x.localResponseNormalization(radius); }).toThrowError(); + }); + it('throws error with invalid radius', function () { + var x = tf.tensor4d([1, 20, 300, 4], [1, 1, 1, 4]); + var radius = 0.5; + expect(function () { return x.localResponseNormalization(radius); }).toThrowError(); + }); + it('computes simple normalization across channels', function () { + var x = tf.tensor4d([1, 20, 300, 4, 1, 20, 300, 4], [2, 1, 1, 4]); + var radius = 1; + var bias = 1; + var alpha = 1; + var beta = 0.5; + var result = x.localResponseNormalization(radius, bias, alpha, beta); + var f = function () { + var vals = []; + for (var _i = 0; _i < arguments.length; _i++) { + vals[_i] = arguments[_i]; + } + return Math.pow(bias + alpha * sumArr(sqArr(vals)), -beta); + }; + var b0 = 0; + var b1 = 1; + test_util_1.expectArraysClose(result, [ + x.get(b0, 0, 0, 0) * f(x.get(b0, 0, 0, 0), x.get(b0, 0, 0, 1)), + x.get(b0, 0, 0, 1) * + f(x.get(b0, 0, 0, 0), x.get(b0, 0, 0, 1), x.get(b0, 0, 0, 2)), + x.get(b0, 0, 0, 2) * + f(x.get(b0, 0, 0, 1), x.get(b0, 0, 0, 2), x.get(b0, 0, 0, 3)), + x.get(b0, 0, 0, 3) * f(x.get(b0, 0, 0, 2), x.get(b0, 0, 0, 3)), + x.get(b1, 0, 0, 0) * f(x.get(b1, 0, 0, 0), x.get(b1, 0, 0, 1)), + x.get(b1, 0, 0, 1) * + f(x.get(b1, 0, 0, 0), x.get(b1, 0, 0, 1), x.get(b1, 0, 0, 2)), + x.get(b1, 0, 0, 2) * + f(x.get(b1, 0, 0, 1), x.get(b1, 0, 0, 2), x.get(b1, 0, 0, 3)), + x.get(b1, 0, 0, 3) * f(x.get(b1, 0, 0, 2), x.get(b1, 0, 0, 3)), + ]); + }); + it('yields same result as tensorflow', function () { + var input = [ + [ + [ + [ + 0.5659827, 0.57000327, 0.75555623, 0.89843333, 0.55120194, + 0.53531718, 0.56402838, 0.95481384 + ], + [ + 0.57334661, 0.65172958, 0.75794137, 0.80764937, 0.376616, + 0.92726362, 0.36422753, 0.60535395 + ], + [ + 0.82404268, 0.01054764, 0.4649173, 0.91637003, 0.82287347, 0.043468, + 0.44953859, 0.92056584 + ] + ], + [ + [ + 0.68583369, 0.52534163, 0.53325927, 0.39608097, 0.9337523, + 0.37397444, 0.81212556, 0.5697 + ], + [ + 0.34278774, 0.57656682, 0.2356832, 0.02636456, 0.49111438, + 0.17981696, 0.65398049, 0.70132935 + ], + [ + 0.14241767, 0.68376505, 0.65419888, 0.69369483, 0.21489143, + 0.46235347, 0.0559243, 0.60612857 + ] + ], + [ + [ + 0.59678483, 0.09368539, 0.3017447, 0.36870825, 0.68145788, + 0.52048779, 0.46136606, 0.94114387 + ], + [ + 0.3156569, 0.75275254, 0.31970251, 0.3154043, 0.61088014, + 0.13359487, 0.99048364, 0.33625424 + ], + [ + 0.82103574, 0.52066624, 0.63629258, 0.42294252, 0.93214262, + 0.57041013, 0.66087878, 0.7019999 + ] + ] + ], + [ + [ + [ + 0.21894431, 0.43085241, 0.79883206, 0.19462204, 0.68623316, + 0.08703053, 0.82380795, 0.85634673 + ], + [ + 0.45011401, 0.70312083, 0.86319792, 0.83205295, 0.67109787, + 0.82081223, 0.46556532, 0.46408331 + ], + [ + 0.07028461, 0.0038743, 0.44619524, 0.0611403, 0.96373355, + 0.80561554, 0.42428243, 0.46897113 + ] + ], + [ + [ + 0.21006894, 0.48764861, 0.36842632, 0.23030031, 0.69685507, + 0.31707478, 0.68662715, 0.0639503 + ], + [ + 0.53940296, 0.50777435, 0.12625301, 0.12324154, 0.89205229, + 0.69380629, 0.33191144, 0.81000078 + ], + [ + 0.52650976, 0.71220326, 0.07246161, 0.08874547, 0.42528927, + 0.36320579, 0.54055619, 0.79342318 + ] + ], + [ + [ + 0.75916636, 0.74499428, 0.76877356, 0.87210917, 0.93040991, + 0.49491942, 0.70801985, 0.14901721 + ], + [ + 0.27037835, 0.89302075, 0.69147241, 0.23044991, 0.98916364, + 0.60161841, 0.63691151, 0.56759977 + ], + [ + 0.56307781, 0.92782414, 0.25880754, 0.98518133, 0.04097319, + 0.24640906, 0.54566145, 0.99261606 + ] + ] + ] + ]; + var expected = [ + [ + [ + [ + 0.38019636, 0.32782161, 0.414222, 0.49507114, 0.3040463, 0.28107059, + 0.33586296, 0.60191077 + ], + [ + 0.37577698, 0.37752095, 0.42895618, 0.4225589, 0.2054275, + 0.52219951, 0.23032214, 0.39414096 + ], + [ + 0.59856331, 0.00637784, 0.25168711, 0.5541048, 0.48015645, + 0.02301128, 0.27214608, 0.6427291 + ] + ], + [ + [ + 0.48127589, 0.35518789, 0.30486941, 0.23976389, 0.52926594, + 0.21061926, 0.46920502, 0.39090639 + ], + [ + 0.27937523, 0.46979892, 0.17829391, 0.02044933, 0.37045884, + 0.12140442, 0.44160855, 0.50198948 + ], + [ + 0.10289387, 0.44164398, 0.41853485, 0.42720893, 0.14580171, + 0.31817055, 0.043797, 0.48155668 + ] + ], + [ + [ + 0.49458414, 0.07425242, 0.21042404, 0.26262277, 0.46205613, + 0.30202535, 0.27406475, 0.61140078 + ], + [ + 0.23736385, 0.55076694, 0.2135559, 0.21463785, 0.38077739, + 0.08309806, 0.62830603, 0.23137885 + ], + [ + 0.5355776, 0.32740855, 0.3451882, 0.24221195, 0.51988536, + 0.31387195, 0.37391993, 0.46748781 + ] + ] + ], + [ + [ + [ + 0.16003507, 0.31178808, 0.51775187, 0.12722474, 0.40769571, + 0.05085804, 0.48455271, 0.5505302 + ], + [ + 0.2880325, 0.39714804, 0.45591024, 0.4131493, 0.34525412, 0.4554069, + 0.29119283, 0.31980222 + ], + [ + 0.0640529, 0.00352532, 0.3052578, 0.03666528, 0.56009793, + 0.46656418, 0.24587312, 0.32762629 + ] + ], + [ + [ + 0.17643087, 0.40210918, 0.2634095, 0.16233148, 0.4649446, + 0.21803913, 0.47819966, 0.05093931 + ], + [ + 0.43121469, 0.403974, 0.08191212, 0.07693455, 0.57362044, + 0.39671475, 0.19025819, 0.54028469 + ], + [ + 0.39356521, 0.53120333, 0.05151648, 0.06554616, 0.33433318, + 0.2425479, 0.36161765, 0.5536595 + ] + ], + [ + [ + 0.46011236, 0.39919043, 0.36865807, 0.43511948, 0.46734285, + 0.26861796, 0.43624333, 0.11205748 + ], + [ + 0.17642327, 0.57622254, 0.37609601, 0.12030836, 0.54640025, + 0.34052721, 0.36361033, 0.3926385 + ], + [ + 0.37581176, 0.51741964, 0.14429154, 0.57254595, 0.02646073, + 0.13531584, 0.35629693, 0.64837402 + ] + ] + ] + ]; + var x = tf.tensor4d(flatten(input), [2, 3, 3, 8]); + var radius = 2; + var result = x.localResponseNormalization(radius); + test_util_1.expectArraysClose(result, flatten(expected)); + }); + it('throws when passed a non-tensor', function () { + var e = /Argument 'x' passed to 'localResponseNormalization' must be a Tensor/; + expect(function () { return tf.localResponseNormalization({}); }) + .toThrowError(e); + }); + it('gradient with 3D input', function () { + var input = [ + [ + [ + 0.95782757, 0.12892687, 0.63624668, 0.70160735, 0.77376258, + 0.54166114, 0.71172535, 0.65087497 + ], + [ + 0.91872108, 0.38846886, 0.37847793, 0.50477624, 0.42154622, + 0.43310916, 0.36253822, 0.07576156 + ], + [ + 0.48662257, 0.4154036, 0.81704032, 0.91660416, 0.87671542, 0.64215934, + 0.29933751, 0.90671134 + ] + ], + [ + [ + 0.6208992, 0.60847163, 0.41475761, 0.2127713, 0.65306914, 0.13923979, + 0.32003641, 0.28183973 + ], + [ + 0.04751575, 0.26870155, 0.45150304, 0.58678186, 0.99118924, + 0.58878231, 0.30913198, 0.18836617 + ], + [ + 0.16166461, 0.56322742, 0.67908955, 0.2269547, 0.38491273, 0.97113752, + 0.51210916, 0.69430435 + ] + ], + [ + [ + 0.06625497, 0.13011181, 0.59202921, 0.88871598, 0.6366322, 0.47911358, + 0.96530843, 0.74259472 + ], + [ + 0.62660718, 0.0445286, 0.18430257, 0.76863647, 0.87511849, 0.53588808, + 0.27980685, 0.30281997 + ], + [ + 0.73987067, 0.91034842, 0.26241004, 0.72832751, 0.78974342, + 0.50751543, 0.05434644, 0.8231523 + ] + ] + ]; + var expected = [[ + [ + [ + 0.27552658, 0.52414668, 0.11137494, 0.24928074, 0.07215497, + 0.16210511, 0.19277242, 0.38672262 + ], + [ + 0.23314378, 0.38181645, 0.30470729, 0.35180706, 0.37793165, + 0.41450983, 0.60044503, 0.83605933 + ], + [ + 0.51801264, 0.38517883, 0.02934788, 0.03102355, 0.08222333, + 0.09746625, 0.4151727, 0.29936206 + ] + ], + [ + [ + 0.37059873, 0.32463685, 0.26611608, 0.54228389, 0.30733055, + 0.66392428, 0.55629295, 0.79049641 + ], + [ + 0.87162501, 0.68129337, 0.35793597, 0.18797961, -0.03660985, + 0.23235559, 0.48184156, 0.76417446 + ], + [ + 0.65893668, 0.41059417, 0.26254228, 0.40696776, 0.3330358, 0.01789692, + 0.3162199, 0.28867012 + ] + ], + [ + [ + 0.83880937, 0.62594998, 0.324698, 0.13046435, 0.09858654, 0.17851587, + 0.09067203, 0.30748016 + ], + [ + 0.57213897, 0.67710453, 0.45385274, 0.19951296, 0.07371041, + 0.20141563, 0.51362634, 0.7163325 + ], + [ + 0.33668244, 0.09696329, 0.33500126, 0.08948036, 0.26512182, + 0.19593786, 0.59144169, 0.379444 + ] + ] + ]]; + var radius = 2.0; + var bias = 1.0; + var alpha = 1.0; + var beta = 0.5; + var t = tf.tensor3d(input); + var dy = tf.onesLike(t); + var gradients = tf.grad(function (t) { + return tf.localResponseNormalization(t, radius, bias, alpha, beta); + })(t, dy); + test_util_1.expectArraysEqual(gradients.shape, t.shape); + test_util_1.expectArraysClose(gradients, flatten(expected)); + }); + it('gradient with 4D input', function () { + var input = [ + [ + [ + [ + 0.5659827, 0.57000327, 0.75555623, 0.89843333, 0.55120194, + 0.53531718, 0.56402838, 0.95481384 + ], + [ + 0.57334661, 0.65172958, 0.75794137, 0.80764937, 0.376616, + 0.92726362, 0.36422753, 0.60535395 + ], + [ + 0.82404268, 0.01054764, 0.4649173, 0.91637003, 0.82287347, 0.043468, + 0.44953859, 0.92056584 + ] + ], + [ + [ + 0.68583369, 0.52534163, 0.53325927, 0.39608097, 0.9337523, + 0.37397444, 0.81212556, 0.5697 + ], + [ + 0.34278774, 0.57656682, 0.2356832, 0.02636456, 0.49111438, + 0.17981696, 0.65398049, 0.70132935 + ], + [ + 0.14241767, 0.68376505, 0.65419888, 0.69369483, 0.21489143, + 0.46235347, 0.0559243, 0.60612857 + ] + ], + [ + [ + 0.59678483, 0.09368539, 0.3017447, 0.36870825, 0.68145788, + 0.52048779, 0.46136606, 0.94114387 + ], + [ + 0.3156569, 0.75275254, 0.31970251, 0.3154043, 0.61088014, + 0.13359487, 0.99048364, 0.33625424 + ], + [ + 0.82103574, 0.52066624, 0.63629258, 0.42294252, 0.93214262, + 0.57041013, 0.66087878, 0.7019999 + ] + ] + ], + [ + [ + [ + 0.21894431, 0.43085241, 0.79883206, 0.19462204, 0.68623316, + 0.08703053, 0.82380795, 0.85634673 + ], + [ + 0.45011401, 0.70312083, 0.86319792, 0.83205295, 0.67109787, + 0.82081223, 0.46556532, 0.46408331 + ], + [ + 0.07028461, 0.0038743, 0.44619524, 0.0611403, 0.96373355, + 0.80561554, 0.42428243, 0.46897113 + ] + ], + [ + [ + 0.21006894, 0.48764861, 0.36842632, 0.23030031, 0.69685507, + 0.31707478, 0.68662715, 0.0639503 + ], + [ + 0.53940296, 0.50777435, 0.12625301, 0.12324154, 0.89205229, + 0.69380629, 0.33191144, 0.81000078 + ], + [ + 0.52650976, 0.71220326, 0.07246161, 0.08874547, 0.42528927, + 0.36320579, 0.54055619, 0.79342318 + ] + ], + [ + [ + 0.75916636, 0.74499428, 0.76877356, 0.87210917, 0.93040991, + 0.49491942, 0.70801985, 0.14901721 + ], + [ + 0.27037835, 0.89302075, 0.69147241, 0.23044991, 0.98916364, + 0.60161841, 0.63691151, 0.56759977 + ], + [ + 0.56307781, 0.92782414, 0.25880754, 0.98518133, 0.04097319, + 0.24640906, 0.54566145, 0.99261606 + ] + ] + ] + ]; + var dyVals = [ + [ + [ + [ + 1.40394282, -1.68962789, -0.21134049, 1.15015793, 1.51244378, + 0.42844626, -2.70123291, 0.06449971 + ], + [ + -0.29038581, 0.67567694, 0.95617437, -1.07383668, 0.20920482, + 0.39050213, -0.81124371, 2.42158198 + ], + [ + -1.01235235, -0.63514435, -1.49017262, -0.01205151, 0.78492945, + -0.20330679, -2.31419802, -0.31220308 + ] + ], + [ + [ + 0.07061944, -0.46716127, 0.91232526, -1.30444264, -0.07080109, + 0.13207501, 0.26701283, -0.48946589 + ], + [ + -0.74995744, -0.79466617, -1.03790498, -0.32234526, 1.33345711, + 0.11863081, 1.93010819, 0.47857195 + ], + [ + 0.37702683, -0.7804451, 0.45868117, 1.06967258, -0.65336537, + 0.3594887, 0.62512684, 0.77009726 + ] + ], + [ + [ + 0.76865023, 1.00893021, -0.24408816, -0.3943336, 0.47094285, + -2.61926222, 1.52929449, 0.7862013 + ], + [ + -1.20878386, -0.26222935, -0.9076528, 0.03079577, -0.01467486, + -0.06949636, 0.05466342, 1.44880533 + ], + [ + 0.05611863, 0.15142779, 0.7802065, -1.2623471, 0.09119794, + -0.20110528, 0.17715968, -0.48476508 + ] + ] + ], + [ + [ + [ + 0.1549256, 0.94472402, -0.70033115, -1.05752802, -0.63035947, + -1.35643113, -0.27211693, 2.33576941 + ], + [ + 0.81070906, -0.58353454, -0.3253817, 2.53953528, -1.40062141, + 1.7728076, -0.59849483, 1.49650824 + ], + [ + -0.00610052, -2.29434419, -1.77995121, -0.66354084, -0.70676774, + -0.81570011, -1.30821037, 0.40997007 + ] + ], + [ + [ + -1.02013469, -0.74198806, -0.82677251, -0.00890179, -1.62196338, + -0.5095427, 1.26501179, 0.12931485 + ], + [ + -1.14763546, 0.11011696, -0.23312508, 0.29730096, -0.49138394, + -0.27012363, -0.15987533, -1.84277928 + ], + [ + -0.03816459, -0.73517877, -2.00476885, 0.47192496, -0.27395752, + 0.99806124, 1.54439747, -1.02016675 + ] + ], + [ + [ + -1.27831209, -0.6961385, -0.73713994, -1.97954738, 0.39108652, + -0.46152538, 1.8255372, 2.18119025 + ], + [ + 0.56322283, -1.59858179, 1.54127491, -0.57665956, -1.0098567, + 0.93239671, 0.25231698, -0.7346009 + ], + [ + 0.41614994, -1.20103085, 0.4330301, -1.23348403, -0.46117213, + -0.3780126, 0.35449561, -0.60129249 + ] + ] + ] + ]; + var depthRadius = 1; + var bias = 1; + var alpha = 1; + var beta = 0.75; + var expected = [ + [ + [ + [ + 0.88732064, -0.98597342, -0.00569269, 0.09561057, 0.42255375, + 0.30286378, -1.17104781, 0.44769961 + ], + [ + -0.22329885, 0.19271846, 0.41454071, -0.50674957, 0.14660946, + 0.1591837, -0.83707076, 1.19177234 + ], + [ + -0.26728818, -0.3847312, -0.72818488, 0.09040837, 0.24023688, + -0.11545581, -1.09341288, 0.33930668 + ] + ], + [ + [ + 0.10079086, -0.38184536, 0.60918945, -0.7267822, 0.13867335, + 0.03526202, 0.17270499, -0.2705338 + ], + [ + -0.38344458, -0.15589149, -0.68160093, -0.27644777, 0.79392856, + -0.14384332, 0.67121017, -0.23130262 + ], + [ + 0.31069142, -0.39895257, 0.11755499, 0.39481708, -0.5234766, + 0.2511853, 0.40955079, 0.3492966 + ] + ], + [ + [ + 0.32660595, 0.7240563, -0.18117335, -0.2649861, 0.67781603, + -1.46250272, 0.8465963, -0.05466701 + ], + [ + -0.71582067, 0.20831716, -0.50778204, 0.07256755, -0.00893679, + -0.03798783, -0.18604305, 0.75747406 + ], + [ + -0.00540833, -0.07677216, 0.41930205, -0.69235319, 0.20631291, + -0.11946303, 0.19601521, -0.21237698 + ] + ] + ], + [ + [ + [ + 0.0800111, 0.60922205, -0.31155977, -0.46448132, -0.15912701, + -0.72455585, -0.5727275, 0.71780092 + ], + [ + 0.50568235, -0.31544152, -0.40618286, 0.97909468, -1.15286613, + 0.8145386, -0.77758539, 0.93794745 + ], + [ + -0.00535599, -1.99269259, -1.15343952, -0.31053686, 0.01680636, + 0.10109296, -0.66026396, 0.35474917 + ] + ], + [ + [ + -0.74113333, -0.20625943, -0.4339568, 0.21517368, -0.5734458, + -0.23481363, 0.53855389, 0.05860626 + ], + [ + -0.61435795, 0.29290834, -0.19639145, 0.20930134, -0.08880179, + 0.02209887, 0.21427482, -0.51696646 + ], + [ + 0.13036536, -0.19079237, -1.43941545, 0.42789665, -0.29732707, + 0.52354813, 0.78893, -0.59992862 + ] + ], + [ + [ + -0.328383, 0.15830949, 0.13110149, -0.492423, 0.46827313, + -0.58950633, 0.56422544, 1.44929576 + ], + [ + 0.46141064, -0.80682266, 0.92562175, -0.28897452, -0.30567497, + 0.50646484, 0.16439518, -0.38878182 + ], + [ + 0.41004074, -0.38593128, 0.42881966, -0.22443436, -0.24573228, + -0.2941249, 0.31119603, -0.17903978 + ] + ] + ] + ]; + var t = tf.tensor(input); + var dy = tf.tensor(dyVals); + var gradients = tf.grad(function (t) { return tf.localResponseNormalization(t, depthRadius, bias, alpha, beta); })(t, dy); + test_util_1.expectArraysClose(gradients, flatten(expected)); + }); +}); +//# sourceMappingURL=lrn_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lrn_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn_test.js.map new file mode 100644 index 0000000..6680bf8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lrn_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lrn_test.js","sourceRoot":"","sources":["../../src/ops/lrn_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAElD,0CAA4E;AAE5E,IAAM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ClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lstm.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm.d.ts new file mode 100644 index 0000000..96cdc6c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm.d.ts @@ -0,0 +1,10 @@ +import { Scalar, Tensor1D, Tensor2D } from '../tensor'; +import { TensorLike } from '../types'; +export declare type LSTMCellFunc = { + (data: Tensor2D, c: Tensor2D, h: Tensor2D): [Tensor2D, Tensor2D]; +}; +declare function multiRNNCell_(lstmCells: LSTMCellFunc[], data: Tensor2D | TensorLike, c: Tensor2D[] | TensorLike[], h: Tensor2D[] | TensorLike[]): [Tensor2D[], Tensor2D[]]; +declare function basicLSTMCell_(forgetBias: Scalar | TensorLike, lstmKernel: Tensor2D | TensorLike, lstmBias: Tensor1D | TensorLike, data: Tensor2D | TensorLike, c: Tensor2D | TensorLike, h: Tensor2D | TensorLike): [Tensor2D, Tensor2D]; +export declare const basicLSTMCell: typeof basicLSTMCell_; +export declare const multiRNNCell: typeof multiRNNCell_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lstm.js b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm.js new file mode 100644 index 0000000..3dcc92d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tensor_util_env_1 = require("../tensor_util_env"); +var operation_1 = require("./operation"); +function multiRNNCell_(lstmCells, data, c, h) { + var $data = tensor_util_env_1.convertToTensor(data, 'data', 'multiRNNCell'); + var $c = tensor_util_env_1.convertToTensorArray(c, 'c', 'multiRNNCell'); + var $h = tensor_util_env_1.convertToTensorArray(h, 'h', 'multiRNNCell'); + var input = $data; + var newStates = []; + for (var i = 0; i < lstmCells.length; i++) { + var output = lstmCells[i](input, $c[i], $h[i]); + newStates.push(output[0]); + newStates.push(output[1]); + input = output[1]; + } + var newC = []; + var newH = []; + for (var i = 0; i < newStates.length; i += 2) { + newC.push(newStates[i]); + newH.push(newStates[i + 1]); + } + return [newC, newH]; +} +function basicLSTMCell_(forgetBias, lstmKernel, lstmBias, data, c, h) { + var $forgetBias = tensor_util_env_1.convertToTensor(forgetBias, 'forgetBias', 'basicLSTMCell'); + var $lstmKernel = tensor_util_env_1.convertToTensor(lstmKernel, 'lstmKernel', 'basicLSTMCell'); + var $lstmBias = tensor_util_env_1.convertToTensor(lstmBias, 'lstmBias', 'basicLSTMCell'); + var $data = tensor_util_env_1.convertToTensor(data, 'data', 'basicLSTMCell'); + var $c = tensor_util_env_1.convertToTensor(c, 'c', 'basicLSTMCell'); + var $h = tensor_util_env_1.convertToTensor(h, 'h', 'basicLSTMCell'); + var combined = $data.concat($h, 1); + var weighted = combined.matMul($lstmKernel); + var res = weighted.add($lstmBias); + var batchSize = res.shape[0]; + var sliceCols = res.shape[1] / 4; + var sliceSize = [batchSize, sliceCols]; + var i = res.slice([0, 0], sliceSize); + var j = res.slice([0, sliceCols], sliceSize); + var f = res.slice([0, sliceCols * 2], sliceSize); + var o = res.slice([0, sliceCols * 3], sliceSize); + var newC = i.sigmoid().mulStrict(j.tanh()).addStrict($c.mulStrict($forgetBias.add(f).sigmoid())); + var newH = newC.tanh().mulStrict(o.sigmoid()); + return [newC, newH]; +} +exports.basicLSTMCell = operation_1.op({ basicLSTMCell_: basicLSTMCell_ }); +exports.multiRNNCell = operation_1.op({ multiRNNCell_: multiRNNCell_ }); +//# sourceMappingURL=lstm.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lstm.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm.js.map new file mode 100644 index 0000000..f3bec61 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lstm.js","sourceRoot":"","sources":["../../src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G,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACnD,IAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAEnD,IAAM,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,SAAS,CAClD,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAc,CAAC,CAAC,CAAC;IAC5D,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACtB,CAAC;AAEY,QAAA,aAAa,GAAG,cAAE,CAAC,EAAC,cAAc,gBAAA,EAAC,CAAC,CAAC;AACrC,QAAA,YAAY,GAAG,cAAE,CAAC,EAAC,aAAa,eAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lstm_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lstm_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm_test.js new file mode 100644 index 0000000..1d7e5b6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm_test.js @@ -0,0 +1,209 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('lstm', test_util_1.ALL_ENVS, function () { + it('MultiRNNCell with 2 BasicLSTMCells', function () { + var lstmKernel1 = tf.tensor2d([ + 0.26242125034332275, -0.8787832260131836, 0.781475305557251, + 1.337337851524353, 0.6180247068405151, -0.2760246992111206, + -0.11299663782119751, -0.46332040429115295, -0.1765323281288147, + 0.6807947158813477, -0.8326982855796814, 0.6732975244522095 + ], [3, 4]); + var lstmBias1 = tf.tensor1d([1.090713620185852, -0.8282332420349121, 0, 1.0889357328414917]); + var lstmKernel2 = tf.tensor2d([ + -1.893059492111206, -1.0185645818710327, -0.6270437240600586, + -2.1829540729522705, -0.4583775997161865, -0.5454602241516113, + -0.3114445209503174, 0.8450229167938232 + ], [2, 4]); + var lstmBias2 = tf.tensor1d([0.9906240105628967, 0.6248329877853394, 0, 1.0224634408950806]); + var forgetBias = tf.scalar(1.0); + var lstm1 = function (data, c, h) { + return tf.basicLSTMCell(forgetBias, lstmKernel1, lstmBias1, data, c, h); + }; + var lstm2 = function (data, c, h) { + return tf.basicLSTMCell(forgetBias, lstmKernel2, lstmBias2, data, c, h); + }; + var c = [ + tf.zeros([1, lstmBias1.shape[0] / 4]), + tf.zeros([1, lstmBias2.shape[0] / 4]) + ]; + var h = [ + tf.zeros([1, lstmBias1.shape[0] / 4]), + tf.zeros([1, lstmBias2.shape[0] / 4]) + ]; + var onehot = tf.buffer([1, 2], 'float32'); + onehot.set(1.0, 0, 0); + var output = tf.multiRNNCell([lstm1, lstm2], onehot.toTensor(), c, h); + test_util_1.expectArraysClose(output[0][0], [-0.7440074682235718]); + test_util_1.expectArraysClose(output[0][1], [0.7460772395133972]); + test_util_1.expectArraysClose(output[1][0], [-0.5802832245826721]); + test_util_1.expectArraysClose(output[1][1], [0.5745711922645569]); + }); + it('basicLSTMCell with batch=2', function () { + var lstmKernel = tf.randomNormal([3, 4]); + var lstmBias = tf.randomNormal([4]); + var forgetBias = tf.scalar(1.0); + var data = tf.randomNormal([1, 2]); + var batchedData = tf.concat2d([data, data], 0); + var c = tf.randomNormal([1, 1]); + var batchedC = tf.concat2d([c, c], 0); + var h = tf.randomNormal([1, 1]); + var batchedH = tf.concat2d([h, h], 0); + var _a = tf.basicLSTMCell(forgetBias, lstmKernel, lstmBias, batchedData, batchedC, batchedH), newC = _a[0], newH = _a[1]; + expect(newC.get(0, 0)).toEqual(newC.get(1, 0)); + expect(newH.get(0, 0)).toEqual(newH.get(1, 0)); + }); + it('basicLSTMCell accepts a tensor-like object', function () { + var lstmKernel = tf.randomNormal([3, 4]); + var lstmBias = [0, 0, 0, 0]; + var forgetBias = 1; + var data = [[0, 0]]; + var batchedData = tf.concat2d([data, data], 0); + var c = [[0]]; + var batchedC = tf.concat2d([c, c], 0); + var h = [[0]]; + var batchedH = tf.concat2d([h, h], 0); + var _a = tf.basicLSTMCell(forgetBias, lstmKernel, lstmBias, batchedData, batchedC, batchedH), newC = _a[0], newH = _a[1]; + expect(newC.get(0, 0)).toEqual(newC.get(1, 0)); + expect(newH.get(0, 0)).toEqual(newH.get(1, 0)); + }); +}); +jasmine_util_1.describeWithFlags('multiRNN throws when passed non-tensor', test_util_1.ALL_ENVS, function () { + it('input: data', function () { + var lstmKernel1 = tf.zeros([3, 4]); + var lstmBias1 = tf.zeros([4]); + var lstmKernel2 = tf.zeros([2, 4]); + var lstmBias2 = tf.zeros([4]); + var forgetBias = tf.scalar(1.0); + var lstm1 = function (data, c, h) { + return tf.basicLSTMCell(forgetBias, lstmKernel1, lstmBias1, data, c, h); + }; + var lstm2 = function (data, c, h) { + return tf.basicLSTMCell(forgetBias, lstmKernel2, lstmBias2, data, c, h); + }; + var c = [ + tf.zeros([1, lstmBias1.shape[0] / 4]), + tf.zeros([1, lstmBias2.shape[0] / 4]) + ]; + var h = [ + tf.zeros([1, lstmBias1.shape[0] / 4]), + tf.zeros([1, lstmBias2.shape[0] / 4]) + ]; + expect(function () { return tf.multiRNNCell([lstm1, lstm2], {}, c, h); }) + .toThrowError(/Argument 'data' passed to 'multiRNNCell' must be a Tensor/); + }); + it('input: c', function () { + var lstmKernel1 = tf.zeros([3, 4]); + var lstmBias1 = tf.zeros([4]); + var lstmKernel2 = tf.zeros([2, 4]); + var lstmBias2 = tf.zeros([4]); + var forgetBias = tf.scalar(1.0); + var lstm1 = function (data, c, h) { + return tf.basicLSTMCell(forgetBias, lstmKernel1, lstmBias1, data, c, h); + }; + var lstm2 = function (data, c, h) { + return tf.basicLSTMCell(forgetBias, lstmKernel2, lstmBias2, data, c, h); + }; + var h = [ + tf.zeros([1, lstmBias1.shape[0] / 4]), + tf.zeros([1, lstmBias2.shape[0] / 4]) + ]; + var data = tf.zeros([1, 2]); + expect(function () { return tf.multiRNNCell([lstm1, lstm2], data, [{}], h); }) + .toThrowError(/Argument 'c\[0\]' passed to 'multiRNNCell' must be a Tensor/); + }); + it('input: h', function () { + var lstmKernel1 = tf.zeros([3, 4]); + var lstmBias1 = tf.zeros([4]); + var lstmKernel2 = tf.zeros([2, 4]); + var lstmBias2 = tf.zeros([4]); + var forgetBias = tf.scalar(1.0); + var lstm1 = function (data, c, h) { + return tf.basicLSTMCell(forgetBias, lstmKernel1, lstmBias1, data, c, h); + }; + var lstm2 = function (data, c, h) { + return tf.basicLSTMCell(forgetBias, lstmKernel2, lstmBias2, data, c, h); + }; + var c = [ + tf.zeros([1, lstmBias1.shape[0] / 4]), + tf.zeros([1, lstmBias2.shape[0] / 4]) + ]; + var data = tf.zeros([1, 2]); + expect(function () { return tf.multiRNNCell([lstm1, lstm2], data, c, [{}]); }) + .toThrowError(/Argument 'h\[0\]' passed to 'multiRNNCell' must be a Tensor/); + }); +}); +jasmine_util_1.describeWithFlags('basicLSTMCell throws with non-tensor', test_util_1.ALL_ENVS, function () { + it('input: forgetBias', function () { + var lstmKernel = tf.randomNormal([3, 4]); + var lstmBias = tf.randomNormal([4]); + var data = tf.randomNormal([1, 2]); + var batchedData = tf.concat2d([data, data], 0); + var c = tf.randomNormal([1, 1]); + var batchedC = tf.concat2d([c, c], 0); + var h = tf.randomNormal([1, 1]); + var batchedH = tf.concat2d([h, h], 0); + expect(function () { return tf.basicLSTMCell({}, lstmKernel, lstmBias, batchedData, batchedC, batchedH); }) + .toThrowError(/Argument 'forgetBias' passed to 'basicLSTMCell' must be a Tensor/); + }); + it('input: lstmKernel', function () { + var lstmBias = tf.randomNormal([4]); + var forgetBias = tf.scalar(1.0); + var data = tf.randomNormal([1, 2]); + var batchedData = tf.concat2d([data, data], 0); + var c = tf.randomNormal([1, 1]); + var batchedC = tf.concat2d([c, c], 0); + var h = tf.randomNormal([1, 1]); + var batchedH = tf.concat2d([h, h], 0); + expect(function () { return tf.basicLSTMCell(forgetBias, {}, lstmBias, batchedData, batchedC, batchedH); }) + .toThrowError(/Argument 'lstmKernel' passed to 'basicLSTMCell' must be a Tensor/); + }); + it('input: lstmBias', function () { + var lstmKernel = tf.randomNormal([3, 4]); + var forgetBias = tf.scalar(1.0); + var data = tf.randomNormal([1, 2]); + var batchedData = tf.concat2d([data, data], 0); + var c = tf.randomNormal([1, 1]); + var batchedC = tf.concat2d([c, c], 0); + var h = tf.randomNormal([1, 1]); + var batchedH = tf.concat2d([h, h], 0); + expect(function () { return tf.basicLSTMCell(forgetBias, lstmKernel, {}, batchedData, batchedC, batchedH); }) + .toThrowError(/Argument 'lstmBias' passed to 'basicLSTMCell' must be a Tensor/); + }); + it('input: data', function () { + var lstmKernel = tf.randomNormal([3, 4]); + var lstmBias = tf.randomNormal([4]); + var forgetBias = tf.scalar(1.0); + var c = tf.randomNormal([1, 1]); + var batchedC = tf.concat2d([c, c], 0); + var h = tf.randomNormal([1, 1]); + var batchedH = tf.concat2d([h, h], 0); + expect(function () { return tf.basicLSTMCell(forgetBias, lstmKernel, lstmBias, {}, batchedC, batchedH); }) + .toThrowError(/Argument 'data' passed to 'basicLSTMCell' must be a Tensor/); + }); + it('input: c', function () { + var lstmKernel = tf.randomNormal([3, 4]); + var lstmBias = tf.randomNormal([4]); + var forgetBias = tf.scalar(1.0); + var data = tf.randomNormal([1, 2]); + var batchedData = tf.concat2d([data, data], 0); + var h = tf.randomNormal([1, 1]); + var batchedH = tf.concat2d([h, h], 0); + expect(function () { return tf.basicLSTMCell(forgetBias, lstmKernel, lstmBias, batchedData, {}, batchedH); }) + .toThrowError(/Argument 'c' passed to 'basicLSTMCell' must be a Tensor/); + }); + it('input: h', function () { + var lstmKernel = tf.randomNormal([3, 4]); + var lstmBias = tf.randomNormal([4]); + var forgetBias = tf.scalar(1.0); + var data = tf.randomNormal([1, 2]); + var batchedData = tf.concat2d([data, data], 0); + var c = tf.randomNormal([1, 1]); + var batchedC = tf.concat2d([c, c], 0); + expect(function () { return tf.basicLSTMCell(forgetBias, lstmKernel, lstmBias, batchedData, batchedC, {}); }) + .toThrowError(/Argument 'h' passed to 'basicLSTMCell' must be a Tensor/); + }); +}); +//# sourceMappingURL=lstm_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/lstm_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm_test.js.map new file mode 100644 index 0000000..6a997a1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/lstm_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lstm_test.js","sourceRoot":"","sources":["../../src/ops/lstm_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAElD,0CAAyD;AAGzD,gCAAiB,CAAC,MAAM,EAAE,oBAAQ,EAAE;IAClC,EAAE,CAAC,oCAAoC,EAAE;QACvC,IAAM,WAAW,GAAG,EAAE,CAAC,QAAQ,CAC3B;YACE,mBAAmB,EAAE,CAAC,kBAAkB,EAAE,iBAAiB;YAC3D,iBAAiB,EAAE,kBAAkB,EAAE,CAAC,kBAAkB;YAC1D,CAAC,mBAAmB,EAAE,CAAC,mBAAmB,EAAE,CAAC,kBAAkB;YAC/D,kBAAkB,EAAE,CAAC,kBAAkB,EAAE,kBAAkB;SAC5D,EACD,CAAC,CAAC,EAAE,CAA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,cAAM,OAAA,EAAE,CAAC,aAAa,CAClB,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAiB,EAChE,QAAQ,CAAC,EAFP,CAEO,CAAC;aACb,YAAY,CACT,yDAAyD,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,UAAU,EAAE;QACb,IAAM,UAAU,GAAG,EAAE,CAAC,YAAY,CAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACpD,IAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAM,UAAU,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAElC,IAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9C,IAAM,WAAW,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QACjD,IAAM,CAAC,GAAG,EAAE,CAAC,YAAY,CAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxC,MAAM,CACF,cAAM,OAAA,EAAE,CAAC,aAAa,CAClB,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EACvD,EAAiB,CAAC,EAFhB,CAEgB,CAAC;aACtB,YAAY,CACT,yDAAyD,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/matmul.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul.d.ts new file mode 100644 index 0000000..380803d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul.d.ts @@ -0,0 +1,9 @@ +import { Tensor, Tensor1D, Tensor2D } from '../tensor'; +import { TensorLike } from '../types'; +declare function matMul_(a: Tensor2D | TensorLike, b: Tensor2D | TensorLike, transposeA?: boolean, transposeB?: boolean): Tensor2D; +declare function outerProduct_(v1: Tensor1D | TensorLike, v2: Tensor1D | TensorLike): Tensor2D; +declare function dot_(t1: Tensor | TensorLike, t2: Tensor | TensorLike): Tensor; +export declare const matMul: typeof matMul_; +export declare const dot: typeof dot_; +export declare const outerProduct: typeof outerProduct_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/matmul.js b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul.js new file mode 100644 index 0000000..89c8f04 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var operation_1 = require("./operation"); +function matMul_(a, b, transposeA, transposeB) { + if (transposeA === void 0) { transposeA = false; } + if (transposeB === void 0) { transposeB = false; } + var $a = tensor_util_env_1.convertToTensor(a, 'a', 'matMul'); + var $b = tensor_util_env_1.convertToTensor(b, 'b', 'matMul'); + var innerShapeA = transposeA ? $a.shape[0] : $a.shape[1]; + var innerShapeB = transposeB ? $b.shape[1] : $b.shape[0]; + util.assert($a.rank === 2 && $b.rank === 2, "Error in matMul: inputs must be rank 2, got ranks " + $a.rank + + (" and " + $b.rank + ".")); + util.assert(innerShapeA === innerShapeB, "Error in matMul: inner shapes (" + innerShapeA + ") and (" + + (innerShapeB + ") of Tensors with shapes " + $a.shape + " and ") + + ($b.shape + " and transposeA=" + transposeA) + + (" and transposeB=" + transposeB + " must match.")); + var grad = function (dy) { + if (!transposeA && !transposeB) { + return { + $a: function () { return dy.matMul($b.toFloat(), false, true); }, + $b: function () { return $a.toFloat().matMul(dy, true, false); } + }; + } + else if (!transposeA && transposeB) { + return { + $a: function () { return dy.matMul($b.toFloat(), false, false); }, + $b: function () { return dy.matMul($a.toFloat(), true, false); } + }; + } + else if (transposeA && !transposeB) { + return { + $a: function () { return $b.toFloat().matMul(dy, false, true); }, + $b: function () { return $a.toFloat().matMul(dy, false, false); } + }; + } + else { + return { + $a: function () { return $b.toFloat().matMul(dy, true, true); }, + $b: function () { return dy.matMul($a.toFloat(), true, true); } + }; + } + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.matMul($a, $b, transposeA, transposeB); }, { $a: $a, $b: $b }, grad); +} +function outerProduct_(v1, v2) { + var $v1 = tensor_util_env_1.convertToTensor(v1, 'v1', 'outerProduct'); + var $v2 = tensor_util_env_1.convertToTensor(v2, 'v2', 'outerProduct'); + util.assert($v1.rank === 1 && $v2.rank === 1, "Error in outerProduct: inputs must be rank 1, but got ranks " + + ($v1.rank + " and " + $v2.rank + ".")); + return $v1.as2D(-1, 1).matMul($v2.as2D(1, -1)); +} +function dot_(t1, t2) { + var $t1 = tensor_util_env_1.convertToTensor(t1, 't1', 'dot'); + var $t2 = tensor_util_env_1.convertToTensor(t2, 't2', 'dot'); + util.assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), "Error in dot: inputs must all be rank 1 or 2, but got ranks " + + ($t1.rank + " and " + $t2.rank + ".")); + var t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]); + var t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]); + util.assert(t1Inner === t2Inner, "Error in dot: inner dimensions of inputs must match, but got " + + (t1Inner + " and " + t2Inner + ".")); + if ($t1.rank === 1 && $t2.rank === 1) { + return $t1.as2D(1, -1).matMul($t2.as2D(-1, 1)).asScalar(); + } + else if ($t1.rank === 1 && $t2.rank === 2) { + return $t1.as2D(1, -1).matMul($t2.as2D($t2.shape[0], $t2.shape[1])).as1D(); + } + else if ($t1.rank === 2 && $t2.rank === 1) { + return $t1.matMul($t2.as2D(-1, 1)).as1D(); + } + else { + return $t1.matMul($t2.as2D($t2.shape[0], $t2.shape[1])); + } +} +exports.matMul = operation_1.op({ matMul_: matMul_ }); +exports.dot = operation_1.op({ dot_: dot_ }); +exports.outerProduct = operation_1.op({ outerProduct_: outerProduct_ }); +//# sourceMappingURL=matmul.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/matmul.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul.js.map new file mode 100644 index 0000000..f1e3fe6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul.js.map @@ -0,0 +1 @@ +{"version":3,"file":"matmul.js","sourceRoot":"","sources":["../../src/ops/matmul.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,8BAAgC;AAChC,yCAA+B;AAiB/B,iBACI,CAAsB,EAAE,CAAsB,EAAE,UAAkB,EAClE,UAAkB;IAD8B,2BAAA,EAAA,kBAAkB;IAClE,2BAAA,EAAA,kBAAkB;IACpB,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC7C,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;IAE7C,IAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3D,IAAI,CAAC,MAAM,CACP,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,KAAK,CAAC,EAC9B,uDAAqD,EAAE,CAAC,IAAM;SAC1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CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;KAC5E;SAAM,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE;QAC3C,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;KAC3C;SAAM;QACL,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACzD;AACH,CAAC;AAEY,QAAA,MAAM,GAAG,cAAE,CAAC,EAAC,OAAO,SAAA,EAAC,CAAC,CAAC;AACvB,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,YAAY,GAAG,cAAE,CAAC,EAAC,aAAa,eAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/matmul_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/matmul_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul_test.js new file mode 100644 index 0000000..2788bdd --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul_test.js @@ -0,0 +1,362 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('matmul', test_util_1.ALL_ENVS, function () { + it('A x B', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = tf.tensor2d([0, 1, -3, 2, 2, 1], [3, 2]); + var c = tf.matMul(a, b); + expect(c.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(c, [0, 8, -3, 20]); + }); + it('A x B^t', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = tf.tensor2d([1, 0, 2, 4, 3, 0], [2, 3]); + var transposeA = false; + var transposeB = true; + var c = tf.matMul(a, b, transposeA, transposeB); + var expected = [7, 10, 16, 31]; + test_util_1.expectArraysClose(c, expected); + }); + it('A^t x B', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = tf.tensor2d([1, 0, 2, 4, 3, 0], [2, 3]); + var transposeA = true; + var transposeB = false; + var c = tf.matMul(a, b, transposeA, transposeB); + var expected = [17, 12, 2, 22, 15, 4, 27, 18, 6]; + test_util_1.expectArraysClose(c, expected); + }); + it('A^t x B^t', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [3, 2]); + var b = tf.tensor2d([1, 0, 2, 4, 3, 0], [2, 3]); + var transposeA = true; + var transposeB = true; + var c = tf.matMul(a, b, transposeA, transposeB); + var expected = [11, 13, 14, 20]; + test_util_1.expectArraysClose(c, expected); + }); + it('A x B^t shapes do not match', function () { + var a = tf.zeros([2, 3]); + var b = tf.zeros([3, 2]); + var f = function () { + var transposeA = false; + var transposeB = true; + tf.matMul(a, b, transposeA, transposeB); + }; + expect(f).toThrowError(); + }); + it('A^t x B shapes do not match', function () { + var a = tf.zeros([2, 3]); + var b = tf.zeros([3, 2]); + var f = function () { + var transposeA = true; + var transposeB = false; + tf.matMul(a, b, transposeA, transposeB); + }; + expect(f).toThrowError(); + }); + it('A^t x B^t shapes do not match', function () { + var a = tf.zeros([3, 2]); + var b = tf.zeros([3, 2]); + var f = function () { + var transposeA = true; + var transposeB = true; + tf.matMul(a, b, transposeA, transposeB); + }; + expect(f).toThrowError(); + }); + it('matmul throws when inner dimensions dont match', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = tf.tensor2d([0, 1, -3, 2, 2, 1, 2, 2], [4, 2]); + expect(function () { return tf.matMul(a, b); }).toThrowError(); + }); + it('matmul throws when passed non matrices', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [2, 3, 2]); + var b = tf.tensor2d([0, 1, -3, 2, 2, 1, 2, 2], [4, 2]); + expect(function () { return tf.matMul(a, b); }).toThrowError(); + expect(function () { return tf.matMul(b, a); }).toThrowError(); + }); + it('Vector times matrix', function () { + var v = tf.tensor1d([2, 3]); + var matrix = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var result = tf.dot(v, matrix); + var expected = [11, 16]; + test_util_1.expectArraysClose(result, expected); + }); + it('Vector times matrix with implicit reshape', function () { + var v = tf.tensor1d([2, 3]); + var matrix = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var result = tf.dot(v, matrix); + var expected = [11, 16]; + test_util_1.expectArraysClose(result, expected); + }); + it('Matrix times vector', function () { + var matrix = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var v = tf.tensor1d([2, 3]); + var result = tf.dot(matrix, v); + var expected = [8, 18]; + test_util_1.expectArraysClose(result, expected); + }); + it('Matrix * vector propagates NaNs', function () { + var matrix = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var v = tf.tensor1d([2, NaN]); + var result = tf.dot(matrix, v); + var expected = [NaN, NaN]; + test_util_1.expectArraysClose(result, expected); + }); + it('matrix times vector throws when not passed a matrix', function () { + var v = tf.tensor1d([2, 3]); + var matrix = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + expect(function () { return tf.dot(matrix, v); }).toThrowError(); + }); + it('Dot product', function () { + var v1 = tf.tensor1d([2, 3]); + var v2 = tf.tensor1d([2, 1]); + var result = tf.dot(v1, v2); + test_util_1.expectNumbersClose(result.get(), 7); + }); + it('Dot product propagates NaNs', function () { + var v1 = tf.tensor1d([2, NaN]); + var v2 = tf.tensor1d([2, 1]); + var result = tf.dot(v1, v2); + expect(result.get()).toEqual(NaN); + }); + it('Dot product throws when vectors are different size', function () { + var v1 = tf.tensor1d([2, 3, 3]); + var v2 = tf.tensor1d([2, 1]); + expect(function () { return tf.dot(v1, v2); }).toThrowError(); + expect(function () { return tf.dot(v2, v1); }).toThrowError(); + }); + it('Outer product', function () { + var v1 = tf.tensor1d([2, 3]); + var v2 = tf.tensor1d([2, 1]); + var result = tf.outerProduct(v1, v2); + var expected = [4, 2, 6, 3]; + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, expected); + }); + it('outer product accepts a tensor-like object', function () { + var v1 = [2, 3]; + var v2 = [2, 1]; + var result = tf.outerProduct(v1, v2); + var expected = [4, 2, 6, 3]; + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, expected); + }); + it('gradients: A * B', function () { + var a = tf.tensor2d([1, 2, 3, 10, 20, 30], [2, 3]); + var b = tf.tensor2d([2, 3, 4, 1, 2, 3], [3, 2]); + var dy = tf.tensor2d([1, 10, 20, 30], [2, 2]); + var transposeA = false; + var transposeB = false; + var grads = tf.grads(function (a, b) { + return tf.matMul(a, b, transposeA, transposeB); + }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + test_util_1.expectArraysClose(da, [ + dy.get(0, 0) * b.get(0, 0) + dy.get(0, 1) * b.get(0, 1), + dy.get(0, 0) * b.get(1, 0) + dy.get(0, 1) * b.get(1, 1), + dy.get(0, 0) * b.get(2, 0) + dy.get(0, 1) * b.get(2, 1), + dy.get(1, 0) * b.get(0, 0) + dy.get(1, 1) * b.get(0, 1), + dy.get(1, 0) * b.get(1, 0) + dy.get(1, 1) * b.get(1, 1), + dy.get(1, 0) * b.get(2, 0) + dy.get(1, 1) * b.get(2, 1) + ], 1e-1); + expect(db.shape).toEqual(b.shape); + test_util_1.expectArraysClose(db, [ + a.get(0, 0) * dy.get(0, 0) + a.get(1, 0) * dy.get(1, 0), + a.get(0, 0) * dy.get(0, 1) + a.get(1, 0) * dy.get(1, 1), + a.get(0, 1) * dy.get(0, 0) + a.get(1, 1) * dy.get(1, 0), + a.get(0, 1) * dy.get(0, 1) + a.get(1, 1) * dy.get(1, 1), + a.get(0, 2) * dy.get(0, 0) + a.get(1, 2) * dy.get(1, 0), + a.get(0, 2) * dy.get(0, 1) + a.get(1, 2) * dy.get(1, 1) + ]); + }); + it('gradients: a * bT', function () { + var a = tf.tensor2d([1, 2, 3, 10, 20, 30], [3, 2]); + var b = tf.tensor2d([2, 3, 4, 1, 2, 3], [3, 2]); + var dy = tf.tensor2d([1, 10, 20, 30, 40, 50, 60, 70, 80], [3, 3]); + var transposeA = false; + var transposeB = true; + var grads = tf.grads(function (a, b) { + return tf.matMul(a, b, transposeA, transposeB); + }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + test_util_1.expectArraysClose(da, [ + dy.get(0, 0) * b.get(0, 0) + dy.get(0, 1) * b.get(1, 0) + + dy.get(0, 2) * b.get(2, 0), + dy.get(0, 0) * b.get(0, 1) + dy.get(0, 1) * b.get(1, 1) + + dy.get(0, 2) * b.get(2, 1), + dy.get(1, 0) * b.get(0, 0) + dy.get(1, 1) * b.get(1, 0) + + dy.get(1, 2) * b.get(2, 0), + dy.get(1, 0) * b.get(0, 1) + dy.get(1, 1) * b.get(1, 1) + + dy.get(1, 2) * b.get(2, 1), + dy.get(2, 0) * b.get(0, 0) + dy.get(2, 1) * b.get(1, 0) + + dy.get(2, 2) * b.get(2, 0), + dy.get(2, 0) * b.get(0, 1) + dy.get(2, 1) * b.get(1, 1) + + dy.get(2, 2) * b.get(2, 1) + ]); + expect(db.shape).toEqual(b.shape); + test_util_1.expectArraysClose(db, [ + dy.get(0, 0) * a.get(0, 0) + dy.get(1, 0) * a.get(1, 0) + + dy.get(2, 0) * a.get(2, 0), + dy.get(0, 0) * a.get(0, 1) + dy.get(1, 0) * a.get(1, 1) + + dy.get(2, 0) * a.get(2, 1), + dy.get(0, 1) * a.get(0, 0) + dy.get(1, 1) * a.get(1, 0) + + dy.get(2, 1) * a.get(2, 0), + dy.get(0, 1) * a.get(0, 1) + dy.get(1, 1) * a.get(1, 1) + + dy.get(2, 1) * a.get(2, 1), + dy.get(0, 2) * a.get(0, 0) + dy.get(1, 2) * a.get(1, 0) + + dy.get(2, 2) * a.get(2, 0), + dy.get(0, 2) * a.get(0, 1) + dy.get(1, 2) * a.get(1, 1) + + dy.get(2, 2) * a.get(2, 1) + ]); + }); + it('gradients: aT * b', function () { + var a = tf.tensor2d([1, 2, 3, 10, 20, 30], [3, 2]); + var b = tf.tensor2d([2, 3, 4, 1, 2, 3], [3, 2]); + var dy = tf.tensor2d([1, 10, 20, 30], [2, 2]); + var transposeA = true; + var transposeB = false; + var grads = tf.grads(function (a, b) { + return tf.matMul(a, b, transposeA, transposeB); + }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + test_util_1.expectArraysClose(da, [ + dy.get(0, 0) * b.get(0, 0) + dy.get(0, 1) * b.get(0, 1), + dy.get(1, 0) * b.get(0, 0) + dy.get(1, 1) * b.get(0, 1), + dy.get(0, 0) * b.get(1, 0) + dy.get(0, 1) * b.get(1, 1), + dy.get(1, 0) * b.get(1, 0) + dy.get(1, 1) * b.get(1, 1), + dy.get(0, 0) * b.get(2, 0) + dy.get(0, 1) * b.get(2, 1), + dy.get(1, 0) * b.get(2, 0) + dy.get(1, 1) * b.get(2, 1) + ]); + expect(db.shape).toEqual(b.shape); + test_util_1.expectArraysClose(db, [ + dy.get(0, 0) * a.get(0, 0) + dy.get(1, 0) * a.get(0, 1), + dy.get(0, 1) * a.get(0, 0) + dy.get(1, 1) * a.get(0, 1), + dy.get(0, 0) * a.get(1, 0) + dy.get(1, 0) * a.get(1, 1), + dy.get(0, 1) * a.get(1, 0) + dy.get(1, 1) * a.get(1, 1), + dy.get(0, 0) * a.get(2, 0) + dy.get(1, 0) * a.get(2, 1), + dy.get(0, 1) * a.get(2, 0) + dy.get(1, 1) * a.get(2, 1) + ]); + }); + it('gradients: aT * bT', function () { + var a = tf.tensor2d([1, 2, 3, 10, 20, 30], [3, 2]); + var b = tf.tensor2d([2, 3, 4, 1, 2, 3], [2, 3]); + var dy = tf.tensor2d([1, 10, 20, 30], [2, 2]); + var transposeA = true; + var transposeB = true; + var grads = tf.grads(function (a, b) { + return tf.matMul(a, b, transposeA, transposeB); + }); + var _a = grads([a, b], dy), da = _a[0], db = _a[1]; + expect(da.shape).toEqual(a.shape); + test_util_1.expectArraysClose(da, [ + dy.get(0, 0) * b.get(0, 0) + dy.get(0, 1) * b.get(1, 0), + dy.get(1, 0) * b.get(0, 0) + dy.get(1, 1) * b.get(1, 0), + dy.get(0, 0) * b.get(0, 1) + dy.get(0, 1) * b.get(1, 1), + dy.get(1, 0) * b.get(0, 1) + dy.get(1, 1) * b.get(1, 1), + dy.get(0, 0) * b.get(0, 2) + dy.get(0, 1) * b.get(1, 2), + dy.get(1, 0) * b.get(0, 2) + dy.get(1, 1) * b.get(1, 2) + ]); + expect(db.shape).toEqual(b.shape); + test_util_1.expectArraysClose(db, [ + dy.get(0, 0) * a.get(0, 0) + dy.get(1, 0) * a.get(0, 1), + dy.get(0, 0) * a.get(1, 0) + dy.get(1, 0) * a.get(1, 1), + dy.get(0, 0) * a.get(2, 0) + dy.get(1, 0) * a.get(2, 1), + dy.get(0, 1) * a.get(0, 0) + dy.get(1, 1) * a.get(0, 1), + dy.get(0, 1) * a.get(1, 0) + dy.get(1, 1) * a.get(1, 1), + dy.get(0, 1) * a.get(2, 0) + dy.get(1, 1) * a.get(2, 1) + ]); + }); + it('throws when passed a as a non-tensor', function () { + expect(function () { return tf.matMul({}, tf.tensor2d([2], [1, 1])); }) + .toThrowError(/Argument 'a' passed to 'matMul' must be a Tensor/); + }); + it('throws when passed b as a non-tensor', function () { + expect(function () { return tf.matMul(tf.tensor2d([2], [1, 1]), {}); }) + .toThrowError(/Argument 'b' passed to 'matMul' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [[1, 2, 3], [4, 5, 6]]; + var b = [[0, 1], [-3, 2], [2, 1]]; + var c = tf.matMul(a, b); + expect(c.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(c, [0, 8, -3, 20]); + }); +}); +jasmine_util_1.describeWithFlags('matmul webgl-only', test_util_1.WEBGL_ENVS, function () { + it('Matrix times vector, large matrix', function () { + var maxTexSize = 16000; + var sharedDim = maxTexSize + 4; + var matrix = tf.buffer([2, sharedDim], 'float32'); + matrix.set(1, 0, sharedDim - 3); + matrix.set(1, 0, sharedDim - 2); + var v = tf.buffer([sharedDim], 'float32'); + v.set(1, sharedDim - 3); + v.set(1, sharedDim - 2); + var result = tf.dot(matrix.toTensor(), v.toTensor()); + var expected = [2, 0]; + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('dot', test_util_1.ALL_ENVS, function () { + var a; + var b; + var c; + var d; + var e; + beforeEach(function () { + a = tf.tensor1d([1, 2]); + b = tf.tensor2d([[1, 2], [3, 4]]); + c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); + d = tf.tensor3d([1, 2], [1, 1, 2]); + e = tf.scalar(1); + }); + it('vector-vector', function () { + var aa = tf.dot(a, a); + test_util_1.expectArraysClose(aa, [5]); + expect(aa.shape).toEqual([]); + }); + it('vector-matrix', function () { + var ab = tf.dot(a, b); + var ac = tf.dot(a, c); + expect(ab.shape).toEqual([2]); + expect(ac.shape).toEqual([3]); + test_util_1.expectArraysClose(ab, [7, 10]); + test_util_1.expectArraysClose(ac, [9, 12, 15]); + }); + it('matrix-vector', function () { + var ba = b.dot(a); + expect(ba.shape).toEqual([2]); + test_util_1.expectArraysClose(ba, [5, 11]); + }); + it('matrix-matrix', function () { + var bb = tf.dot(b, b); + var bc = tf.dot(b, c); + expect(bb.shape).toEqual([2, 2]); + expect(bc.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(bb, [7, 10, 15, 22]); + test_util_1.expectArraysClose(bc, [9, 12, 15, 19, 26, 33]); + }); + it('throws error on incompatible dimensions', function () { + expect(function () { return tf.dot(c, a); }).toThrowError(); + expect(function () { return tf.dot(c, b); }).toThrowError(); + }); + it('throws error when inputs are not rank 1 or 2', function () { + expect(function () { return tf.dot(a, d); }).toThrowError(); + expect(function () { return tf.dot(a, e); }).toThrowError(); + }); + it('accepts a tensor-like object', function () { + var a = [1, 2, 3]; + var res = tf.dot(a, a); + test_util_1.expectArraysClose(res, [14]); + expect(res.shape).toEqual([]); + }); +}); +//# sourceMappingURL=matmul_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/matmul_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul_test.js.map new file mode 100644 index 0000000..024461c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/matmul_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"matmul_test.js","sourceRoot":"","sources":["../../src/ops/matmul_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyF;AAGzF,gCAAiB,CAAC,QAAQ,EAAE,oBAAQ,EAAE;IACpC,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClD,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC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AAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts new file mode 100644 index 0000000..6683208 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts @@ -0,0 +1,5 @@ +import { Scalar, Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function movingAverage_(v: T | TensorLike, x: T | TensorLike, decay: number | Scalar, step?: number | Scalar, zeroDebias?: boolean): T; +export declare const movingAverage: typeof movingAverage_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.js b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.js new file mode 100644 index 0000000..4ea2c06 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tensor_util_1 = require("../tensor_util"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var binary_ops_1 = require("./binary_ops"); +var operation_1 = require("./operation"); +var tensor_ops_1 = require("./tensor_ops"); +function movingAverage_(v, x, decay, step, zeroDebias) { + if (zeroDebias === void 0) { zeroDebias = true; } + var $v = tensor_util_env_1.convertToTensor(v, 'v', 'movingAverage'); + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'movingAverage'); + var $decay = tensor_util_env_1.convertToTensor(decay, 'decay', 'movingAverage'); + tensor_util_1.assertTypesMatch($v, $x); + util.assert(util.arraysEqual($v.shape, $x.shape), 'Shape mismatch in v and x'); + var one = tensor_ops_1.scalar(1); + var oneMinusDecay = one.sub($decay); + var update = $x.sub($v).mul(oneMinusDecay); + if (zeroDebias) { + util.assert(step != null, 'When using zeroDebias: true, step is required.'); + var $step = tensor_util_env_1.convertToTensor(step, 'step', 'movingAverage'); + update = update.div(one.sub(binary_ops_1.pow($decay, $step))); + } + return $v.add(update); +} +exports.movingAverage = operation_1.op({ movingAverage_: movingAverage_ }); +//# sourceMappingURL=moving_average.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.js.map new file mode 100644 index 0000000..1681b29 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.js.map @@ -0,0 +1 @@ +{"version":3,"file":"moving_average.js","sourceRoot":"","sources":["../../src/ops/moving_average.ts"],"names":[],"mappings":";;AAkBA,8CAAgD;AAChD,sDAAmD;AAEnD,8BAAgC;AAChC,2CAAiC;AACjC,yCAA+B;AAC/B,2CAAoC;AA6BpC,wBACI,CAAe,EAAE,CAAe,EAAE,KAAoB,EACtD,IAAoB,EAAE,UAAiB;IAAjB,2BAAA,EAAA,iBAAiB;IACzC,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC;IACpD,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC;IACpD,IAAM,MAAM,GAAG,iCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;IAEhE,8BAAgB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACzB,IAAI,CAAC,MAAM,CACP,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,2BAA2B,CAAC,CAAC;IAEvE,IAAM,GAAG,GAAG,mBAAM,CAAC,CAAC,CAAC,CAAC;IACtB,IAAM,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEtC,IAAI,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC3C,IAAI,UAAU,EAAE;QACd,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,EAAE,gDAAgD,CAAC,CAAC;QAC5E,IAAM,KAAK,GAAG,iCAAe,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC7D,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,gBAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;KAClD;IACD,OAAO,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAEY,QAAA,aAAa,GAAG,cAAE,CAAC,EAAC,cAAc,gBAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average_test.js new file mode 100644 index 0000000..85df968 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average_test.js @@ -0,0 +1,77 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('movingAverage', test_util_1.ALL_ENVS, function () { + it('zeroDebias=true, decay and step are numbers', function () { + var v0 = tf.tensor2d([[0, 0], [0, 0]], [2, 2]); + var x = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + var decay = 0.6; + var v1 = tf.movingAverage(v0, x, decay, 1); + test_util_1.expectArraysClose(v1, tf.tensor2d([[1, 2], [3, 4]], [2, 2])); + var y = tf.tensor2d([[11, 12], [13, 14]], [2, 2]); + var v2 = tf.movingAverage(v1, y, decay, 2); + test_util_1.expectArraysClose(v2, tf.tensor2d([[7.25, 8.25], [9.25, 10.25]], [2, 2])); + }); + it('zeroDebias=true, decay and step are scalars', function () { + var v0 = tf.tensor2d([[0, 0], [0, 0]], [2, 2]); + var x = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + var decay = tf.scalar(0.6); + var v1 = tf.movingAverage(v0, x, decay, tf.scalar(1)); + test_util_1.expectArraysClose(v1, tf.tensor2d([[1, 2], [3, 4]], [2, 2])); + var y = tf.tensor2d([[11, 12], [13, 14]], [2, 2]); + var v2 = tf.movingAverage(v1, y, decay, tf.scalar(2)); + test_util_1.expectArraysClose(v2, tf.tensor2d([[7.25, 8.25], [9.25, 10.25]], [2, 2])); + }); + it('zeroDebias=false, decay and step are numbers', function () { + var v0 = tf.tensor2d([[0, 0], [0, 0]], [2, 2]); + var x = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + var decay = 0.6; + var v1 = tf.movingAverage(v0, x, decay, null, false); + test_util_1.expectArraysClose(v1, tf.tensor2d([[0.4, 0.8], [1.2, 1.6]], [2, 2])); + var y = tf.tensor2d([[11, 12], [13, 14]], [2, 2]); + var v2 = tf.movingAverage(v1, y, decay, null, false); + test_util_1.expectArraysClose(v2, tf.tensor2d([[4.64, 5.28], [5.92, 6.56]], [2, 2])); + }); + it('zeroDebias=false, decay is scalar', function () { + var v0 = tf.tensor2d([[0, 0], [0, 0]], [2, 2]); + var x = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + var decay = tf.scalar(0.6); + var v1 = tf.movingAverage(v0, x, decay, null, false); + test_util_1.expectArraysClose(v1, tf.tensor2d([[0.4, 0.8], [1.2, 1.6]], [2, 2])); + var y = tf.tensor2d([[11, 12], [13, 14]], [2, 2]); + var v2 = tf.movingAverage(v1, y, decay, null, false); + test_util_1.expectArraysClose(v2, tf.tensor2d([[4.64, 5.28], [5.92, 6.56]], [2, 2])); + }); + it('zeroDebias=true, no step throws error', function () { + var v0 = tf.tensor2d([[0, 0], [0, 0]], [2, 2]); + var x = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + var decay = tf.scalar(0.6); + expect(function () { return tf.movingAverage(v0, x, decay, null); }).toThrowError(); + }); + it('shape mismatch in v and x throws error', function () { + var v0 = tf.tensor2d([[0, 0], [0, 0]], [2, 2]); + var x = tf.tensor2d([[1, 2]], [1, 2]); + var decay = tf.scalar(0.6); + expect(function () { return tf.movingAverage(v0, x, decay, null); }).toThrowError(); + }); + it('throws when passed v as a non-tensor', function () { + var x = tf.tensor2d([[1, 2], [3, 4]], [2, 2]); + expect(function () { return tf.movingAverage({}, x, 1); }) + .toThrowError(/Argument 'v' passed to 'movingAverage' must be a Tensor/); + }); + it('throws when passed v as a non-tensor', function () { + var v = tf.tensor2d([[0, 0], [0, 0]], [2, 2]); + expect(function () { return tf.movingAverage(v, {}, 1); }) + .toThrowError(/Argument 'x' passed to 'movingAverage' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var v0 = [[0, 0], [0, 0]]; + var x = [[1, 2], [3, 4]]; + var decay = 0.6; + var v1 = tf.movingAverage(v0, x, decay, 1); + test_util_1.expectArraysClose(v1, tf.tensor2d([[1, 2], [3, 4]], [2, 2])); + }); +}); +//# sourceMappingURL=moving_average_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average_test.js.map new file mode 100644 index 0000000..96e95e7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"moving_average_test.js","sourceRoot":"","sources":["../../src/ops/moving_average_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,eAAe,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AiB,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial_test.js new file mode 100644 index 0000000..2700b6b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial_test.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('multinomial', test_util_1.ALL_ENVS, function () { + var NUM_SAMPLES = 1000; + var EPSILON = 0.05; + var SEED = 3.14; + it('Flip a fair coin and check bounds', function () { + var probs = tf.tensor1d([1, 1]); + var result = tf.multinomial(probs, NUM_SAMPLES, SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual([NUM_SAMPLES]); + var outcomeProbs = computeProbs(result.dataSync(), 2); + test_util_1.expectArraysClose(outcomeProbs, [0.5, 0.5], EPSILON); + }); + it('Flip a two-sided coin with 100% of heads', function () { + var logits = tf.tensor1d([1, -100]); + var result = tf.multinomial(logits, NUM_SAMPLES, SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual([NUM_SAMPLES]); + var outcomeProbs = computeProbs(result.dataSync(), 2); + test_util_1.expectArraysClose(outcomeProbs, [1, 0], EPSILON); + }); + it('Flip a two-sided coin with 100% of tails', function () { + var logits = tf.tensor1d([-100, 1]); + var result = tf.multinomial(logits, NUM_SAMPLES, SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual([NUM_SAMPLES]); + var outcomeProbs = computeProbs(result.dataSync(), 2); + test_util_1.expectArraysClose(outcomeProbs, [0, 1], EPSILON); + }); + it('Flip a single-sided coin throws error', function () { + var probs = tf.tensor1d([1]); + expect(function () { return tf.multinomial(probs, NUM_SAMPLES, SEED); }).toThrowError(); + }); + it('Flip a ten-sided coin and check bounds', function () { + var numOutcomes = 10; + var logits = tf.fill([numOutcomes], 1).as1D(); + var result = tf.multinomial(logits, NUM_SAMPLES, SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual([NUM_SAMPLES]); + var outcomeProbs = computeProbs(result.dataSync(), numOutcomes); + expect(outcomeProbs.length).toBeLessThanOrEqual(numOutcomes); + }); + it('Flip 3 three-sided coins, each coin is 100% biases', function () { + var numOutcomes = 3; + var logits = tf.tensor2d([[-100, -100, 1], [-100, 1, -100], [1, -100, -100]], [3, numOutcomes]); + var result = tf.multinomial(logits, NUM_SAMPLES, SEED); + expect(result.dtype).toBe('int32'); + expect(result.shape).toEqual([3, NUM_SAMPLES]); + var outcomeProbs = computeProbs(result.dataSync().slice(0, NUM_SAMPLES), numOutcomes); + test_util_1.expectArraysClose(outcomeProbs, [0, 0, 1], EPSILON); + outcomeProbs = computeProbs(result.dataSync().slice(NUM_SAMPLES, 2 * NUM_SAMPLES), numOutcomes); + test_util_1.expectArraysClose(outcomeProbs, [0, 1, 0], EPSILON); + outcomeProbs = + computeProbs(result.dataSync().slice(2 * NUM_SAMPLES), numOutcomes); + test_util_1.expectArraysClose(outcomeProbs, [1, 0, 0], EPSILON); + }); + it('passing Tensor3D throws error', function () { + var probs = tf.zeros([3, 2, 2]); + var normalized = true; + expect(function () { return tf.multinomial(probs, 3, SEED, normalized); }) + .toThrowError(); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.multinomial({}, NUM_SAMPLES, SEED); }) + .toThrowError(/Argument 'logits' passed to 'multinomial' must be a Tensor/); + }); + it('accepts a tensor-like object for logits (biased coin)', function () { + var res = tf.multinomial([-100, 1], NUM_SAMPLES, SEED); + expect(res.dtype).toBe('int32'); + expect(res.shape).toEqual([NUM_SAMPLES]); + var outcomeProbs = computeProbs(res.dataSync(), 2); + test_util_1.expectArraysClose(outcomeProbs, [0, 1], EPSILON); + }); + function computeProbs(events, numOutcomes) { + var counts = []; + for (var i = 0; i < numOutcomes; ++i) { + counts[i] = 0; + } + var numSamples = events.length; + for (var i = 0; i < events.length; ++i) { + counts[events[i]]++; + } + for (var i = 0; i < counts.length; i++) { + counts[i] /= numSamples; + } + return counts; + } +}); +//# sourceMappingURL=multinomial_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial_test.js.map new file mode 100644 index 0000000..5d54a66 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"multinomial_test.js","sourceRoot":"","sources":["../../src/ops/multinomial_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAElD,0CAAyD;AAEzD,gCAAiB,CAAC,aAAa,EAAE,oBAAQ,EAAE;IACzC,IAAM,WAAW,GAAG,IAAI,CAAC;IAEzB,IAAM,OAAO,GAAG,IAAI,CAAC;IACrB,IAAM,IAAI,GAAG,IAAI,CAAC;IAElB,EAAE,CAAC,mCAAmC,EAAE;QACtC,IAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,IAAM,MAAM,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;QACxD,MAAM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CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,EAAE,CAAC,EAAE;YACpC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;SACf;QACD,IAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;QACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACtC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACrB;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC;SACzB;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts new file mode 100644 index 0000000..8369c33 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts @@ -0,0 +1,5 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function norm_(x: Tensor | TensorLike, ord?: number | 'euclidean' | 'fro', axis?: number | number[], keepDims?: boolean): Tensor; +export declare const norm: typeof norm_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/norm.js b/node_modules/@tensorflow/tfjs-core/dist/ops/norm.js new file mode 100644 index 0000000..230a84a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/norm.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tensor_util_env_1 = require("../tensor_util_env"); +var axis_util = require("./axis_util"); +var operation_1 = require("./operation"); +var tensor_ops_1 = require("./tensor_ops"); +function norm_(x, ord, axis, keepDims) { + if (ord === void 0) { ord = 'euclidean'; } + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + x = tensor_util_env_1.convertToTensor(x, 'x', 'norm'); + var norm = normImpl(x, ord, axis); + var keepDimsShape = norm.shape; + if (keepDims) { + var axes = axis_util.parseAxisParam(axis, x.shape); + keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes); + } + return norm.reshape(keepDimsShape); +} +function normImpl(x, p, axis) { + if (axis === void 0) { axis = null; } + if (x.rank === 0) { + return x.abs(); + } + if (x.rank !== 1 && axis === null) { + return normImpl(x.reshape([-1]), p, axis); + } + if (x.rank === 1 || typeof axis === 'number' || + axis instanceof Array && axis.length === 1) { + if (p === 1) { + return x.abs().sum(axis); + } + if (p === Infinity) { + return x.abs().max(axis); + } + if (p === -Infinity) { + return x.abs().min(axis); + } + if (p === 'euclidean' || p === 2) { + return x.abs().pow(tensor_ops_1.scalar(2, 'int32')).sum(axis).sqrt(); + } + throw new Error("Error in norm: invalid ord value: " + p); + } + if (axis instanceof Array && axis.length === 2) { + if (p === 1) { + return x.abs().sum(axis[0]).max(axis[1] - 1); + } + if (p === Infinity) { + return x.abs().sum(axis[1]).max(axis[0]); + } + if (p === -Infinity) { + return x.abs().sum(axis[1]).min(axis[0]); + } + if (p === 'fro' || p === 'euclidean') { + return x.square().sum(axis).sqrt(); + } + throw new Error("Error in norm: invalid ord value: " + p); + } + throw new Error("Error in norm: invalid axis: " + axis); +} +exports.norm = operation_1.op({ norm_: norm_ }); +//# sourceMappingURL=norm.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/norm.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/norm.js.map new file mode 100644 index 0000000..d9d23e7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/norm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"norm.js","sourceRoot":"","sources":["../../src/ops/norm.ts"],"names":[],"mappings":";;AAkBA,sDAAmD;AAEnD,uCAAyC;AACzC,yCAA+B;AAC/B,2CAAoC;AAuCpC,eACI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AM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;SACpC;QAED,MAAM,IAAI,KAAK,CAAC,uCAAqC,CAAG,CAAC,CAAC;KAC3D;IAED,MAAM,IAAI,KAAK,CAAC,kCAAgC,IAAM,CAAC,CAAC;AAC1D,CAAC;AAEY,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts new file mode 100644 index 0000000..6beba1c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts @@ -0,0 +1,3 @@ +export declare function op(f: { + [name: string]: T; +}): T; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js b/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js new file mode 100644 index 0000000..67d3472 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +function op(f) { + var keys = Object.keys(f); + if (keys.length !== 1) { + throw new Error("Please provide an object with a single key " + + "(operation name) mapping to a function. Got an object with " + + (keys.length + " keys.")); + } + var opName = keys[0]; + var fn = f[opName]; + if (opName.endsWith('_')) { + opName = opName.substring(0, opName.length - 1); + } + var f2 = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + environment_1.ENV.engine.startScope(opName); + try { + var result = fn.apply(void 0, args); + if (result instanceof Promise) { + console.error('Cannot return a Promise inside of tidy.'); + } + environment_1.ENV.engine.endScope(result); + return result; + } + catch (ex) { + environment_1.ENV.engine.endScope(null); + throw ex; + } + }; + Object.defineProperty(f2, 'name', { value: opName, configurable: true }); + return f2; +} +exports.op = op; +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js.map new file mode 100644 index 0000000..0e020d6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/ops/operation.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAOnC,YAAuC,CAAsB;IAC3D,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CACX,6CAA6C;YAC7C,6DAA6D;aAC1D,IAAI,CAAC,MAAM,WAAQ,CAAA,CAAC,CAAC;KAC7B;IAED,IAAI,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACrB,IAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IAGrB,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACxB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KACjD;IAGD,IAAM,EAAE,GAAG;QAAC,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QACxB,iBAAG,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI;YACF,IAAM,MAAM,GAAG,EAAE,eAAI,IAAI,CAAC,CAAC;YAC3B,IAAI,MAAM,YAAY,OAAO,EAAE;gBAC7B,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;aAC1D;YACD,iBAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC5B,OAAO,MAAM,CAAC;SACf;QAAC,OAAO,EAAE,EAAE;YACX,iBAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC1B,MAAM,EAAE,CAAC;SACV;IACH,CAAC,CAAC;IACF,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC,CAAC;IAGvE,OAAO,EAAc,CAAC;AACxB,CAAC;AApCD,gBAoCC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/operation_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/operation_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/operation_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/operation_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/operation_test.js new file mode 100644 index 0000000..95f9f30 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/operation_test.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var operation_1 = require("./operation"); +jasmine_util_1.describeWithFlags('operation', test_util_1.ALL_ENVS, function () { + it('executes and preserves function name', function () { + var f = function () { return 2; }; + var opfn = operation_1.op({ 'opName': f }); + expect(opfn.name).toBe('opName'); + expect(opfn()).toBe(2); + }); + it('executes, preserves function name, strips underscore', function () { + var f = function () { return 2; }; + var opfn = operation_1.op({ 'opName_': f }); + expect(opfn.name).toBe('opName'); + expect(opfn()).toBe(2); + }); + it('throws when passing an object with multiple keys', function () { + var f = function () { return 2; }; + expect(function () { return operation_1.op({ 'opName_': f, 'opName2_': f }); }) + .toThrowError(/Please provide an object with a single key/); + }); +}); +//# sourceMappingURL=operation_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/operation_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/operation_test.js.map new file mode 100644 index 0000000..34a26af --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/operation_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operation_test.js","sourceRoot":"","sources":["../../src/ops/operation_test.ts"],"names":[],"mappings":";;AAgBA,gDAAkD;AAClD,0CAAsC;AACtC,yCAA+B;AAE/B,gCAAiB,CAAC,WAAW,EAAE,oBAAQ,EAAE;IACvC,EAAE,CAAC,sCAAsC,EAAE;QACzC,IAAM,CAAC,GAAG,cAAM,OAAA,CAAC,EAAD,CAAC,CAAC;QAClB,IAAM,IAAI,GAAG,cAAE,CAAC,EAAC,QAAQ,EAAE,CAAC,EAAC,CAAC,CAAC;QAE/B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE;QACzD,IAAM,CAAC,GAAG,cAAM,OAAA,CAAC,EAAD,CAAC,CAAC;QAClB,IAAM,IAAI,GAAG,cAAE,CAAC,EAAC,SAAS,EAAE,CAAC,EAAC,CAAC,CAAC;QAEhC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE;QACrD,IAAM,CAAC,GAAG,cAAM,OAAA,CAAC,EAAD,CAAC,CAAC;QAClB,MAAM,CAAC,cAAM,OAAA,cAAE,CAAC,EAAC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAC,CAAC,EAAjC,CAAiC,CAAC;aAC1C,YAAY,CAAC,4CAA4C,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts new file mode 100644 index 0000000..dbf26a7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts @@ -0,0 +1,29 @@ +export * from './batchnorm'; +export * from './concat'; +export * from './conv'; +export * from './matmul'; +export * from './reverse'; +export * from './pool'; +export * from './slice'; +export * from './unary_ops'; +export * from './reduction_ops'; +export * from './compare'; +export * from './binary_ops'; +export * from './relu_ops'; +export * from './logical_ops'; +export * from './array_ops'; +export * from './tensor_ops'; +export * from './transpose'; +export * from './softmax'; +export * from './lrn'; +export * from './norm'; +export * from './segment_ops'; +export * from './lstm'; +export * from './moving_average'; +export * from './strided_slice'; +export * from './topk'; +export { op } from './operation'; +import * as losses from './loss_ops'; +import * as linalg from './linalg_ops'; +import * as image from './image_ops'; +export { image, linalg, losses }; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/ops.js new file mode 100644 index 0000000..83e086b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/ops.js @@ -0,0 +1,38 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("./batchnorm")); +__export(require("./concat")); +__export(require("./conv")); +__export(require("./matmul")); +__export(require("./reverse")); +__export(require("./pool")); +__export(require("./slice")); +__export(require("./unary_ops")); +__export(require("./reduction_ops")); +__export(require("./compare")); +__export(require("./binary_ops")); +__export(require("./relu_ops")); +__export(require("./logical_ops")); +__export(require("./array_ops")); +__export(require("./tensor_ops")); +__export(require("./transpose")); +__export(require("./softmax")); +__export(require("./lrn")); +__export(require("./norm")); +__export(require("./segment_ops")); +__export(require("./lstm")); +__export(require("./moving_average")); +__export(require("./strided_slice")); +__export(require("./topk")); +var operation_1 = require("./operation"); +exports.op = operation_1.op; +var losses = require("./loss_ops"); +exports.losses = losses; +var linalg = require("./linalg_ops"); +exports.linalg = linalg; +var image = require("./image_ops"); +exports.image = image; +//# sourceMappingURL=ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/ops.js.map new file mode 100644 index 0000000..bc3056e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ops.js","sourceRoot":"","sources":["../../src/ops/ops.ts"],"names":[],"mappings":";;;;;AAiBA,iCAA4B;AAC5B,8BAAyB;AACzB,4BAAuB;AACvB,8BAAyB;AACzB,+BAA0B;AAC1B,4BAAuB;AACvB,6BAAwB;AACxB,iCAA4B;AAC5B,qCAAgC;AAChC,+BAA0B;AAC1B,kCAA6B;AAC7B,gCAA2B;AAC3B,mCAA8B;AAC9B,iCAA4B;AAC5B,kCAA6B;AAC7B,iCAA4B;AAC5B,+BAA0B;AAC1B,2BAAsB;AACtB,4BAAuB;AACvB,mCAA8B;AAC9B,4BAAuB;AACvB,sCAAiC;AACjC,qCAAgC;AAChC,4BAAuB;AAEvB,yCAA+B;AAAvB,yBAAA,EAAE,CAAA;AAGV,mCAAqC;AAGd,wBAAM;AAF7B,qCAAuC;AAExB,wBAAM;AADrB,mCAAqC;AAC7B,sBAAK"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/pad_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/pad_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/pad_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/pad_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/pad_test.js new file mode 100644 index 0000000..8e5a46d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/pad_test.js @@ -0,0 +1,153 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('pad1d', test_util_1.ALL_ENVS, function () { + it('Should pad 1D arrays', function () { + var a = tf.tensor1d([1, 2, 3, 4, 5, 6], 'int32'); + var b = tf.pad1d(a, [2, 3]); + test_util_1.expectArraysClose(b, [0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 0]); + }); + it('Should not pad 1D arrays with 0s', function () { + var a = tf.tensor1d([1, 2, 3, 4], 'int32'); + var b = tf.pad1d(a, [0, 0]); + test_util_1.expectArraysClose(b, [1, 2, 3, 4]); + }); + it('Should handle padding with custom value', function () { + var a = tf.tensor1d([1, 2, 3, 4], 'int32'); + var b = tf.pad1d(a, [2, 3], 9); + test_util_1.expectArraysClose(b, [9, 9, 1, 2, 3, 4, 9, 9, 9]); + a = tf.tensor1d([1, 2, 3, 4]); + b = tf.pad1d(a, [2, 1], 1.1); + test_util_1.expectArraysClose(b, [1.1, 1.1, 1, 2, 3, 4, 1.1]); + a = tf.tensor1d([1, 2, 3, 4]); + b = tf.pad1d(a, [2, 1], 1); + test_util_1.expectArraysClose(b, [1, 1, 1, 2, 3, 4, 1]); + }); + it('Should handle NaNs with 1D arrays', function () { + var a = tf.tensor1d([1, NaN, 2, NaN]); + var b = tf.pad1d(a, [1, 1]); + test_util_1.expectArraysClose(b, [0, 1, NaN, 2, NaN, 0]); + }); + it('Should handle invalid paddings', function () { + var a = tf.tensor1d([1, 2, 3, 4], 'int32'); + var f = function () { + tf.pad1d(a, [2, 2, 2]); + }; + expect(f).toThrowError(); + }); + it('grad', function () { + var a = tf.tensor1d([1, 2, 3]); + var dy = tf.tensor1d([10, 20, 30, 40, 50, 60]); + var da = tf.grad(function (a) { return tf.pad1d(a, [2, 1]); })(a, dy); + expect(da.shape).toEqual([3]); + test_util_1.expectArraysClose(da, [30, 40, 50]); + }); + it('accepts a tensor-like object', function () { + var a = [1, 2, 3, 4, 5, 6]; + var b = tf.pad1d(a, [2, 3]); + test_util_1.expectArraysClose(b, [0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 0]); + }); +}); +jasmine_util_1.describeWithFlags('pad2d', test_util_1.ALL_ENVS, function () { + it('Should pad 2D arrays', function () { + var a = tf.tensor2d([[1], [2]], [2, 1], 'int32'); + var b = tf.pad2d(a, [[1, 1], [1, 1]]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0]); + a = tf.tensor2d([[1, 2, 3], [4, 5, 6]], [2, 3], 'int32'); + b = tf.pad2d(a, [[2, 2], [1, 1]]); + test_util_1.expectArraysClose(b, [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, + 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ]); + }); + it('Should not pad 2D arrays with 0s', function () { + var a = tf.tensor2d([[1, 2, 3], [4, 5, 6]], [2, 3], 'int32'); + var b = tf.pad2d(a, [[0, 0], [0, 0]]); + test_util_1.expectArraysClose(b, [1, 2, 3, 4, 5, 6]); + }); + it('Should handle padding with custom value', function () { + var a = tf.tensor2d([[1, 2, 3], [4, 5, 6]], [2, 3], 'int32'); + var b = tf.pad2d(a, [[1, 1], [1, 1]], 10); + test_util_1.expectArraysClose(b, [ + 10, 10, 10, 10, 10, 10, 1, 2, 3, 10, + 10, 4, 5, 6, 10, 10, 10, 10, 10, 10 + ]); + a = tf.tensor2d([[1], [1]], [2, 1]); + b = tf.pad2d(a, [[1, 1], [1, 1]], -2.1); + test_util_1.expectArraysClose(b, [-2.1, -2.1, -2.1, -2.1, 1, -2.1, -2.1, 1, -2.1, -2.1, -2.1, -2.1]); + a = tf.tensor2d([[1], [1]], [2, 1]); + b = tf.pad2d(a, [[1, 1], [1, 1]], -2); + test_util_1.expectArraysClose(b, [-2, -2, -2, -2, 1, -2, -2, 1, -2, -2, -2, -2]); + }); + it('Should handle NaNs with 2D arrays', function () { + var a = tf.tensor2d([[1, NaN], [1, NaN]], [2, 2]); + var b = tf.pad2d(a, [[1, 1], [1, 1]]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0, 0, 1, NaN, 0, 0, 1, NaN, 0, 0, 0, 0, 0]); + }); + it('Should handle invalid paddings', function () { + var a = tf.tensor2d([[1], [2]], [2, 1], 'int32'); + var f = function () { + tf.pad2d(a, [[2, 2, 2], [1, 1, 1]]); + }; + expect(f).toThrowError(); + }); + it('grad', function () { + var a = tf.tensor2d([[1, 2], [3, 4]]); + var dy = tf.tensor2d([[0, 0, 0], [10, 20, 0], [30, 40, 0]], [3, 3]); + var da = tf.grad(function (a) { return tf.pad2d(a, [[1, 0], [0, 1]]); })(a, dy); + expect(da.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(da, [10, 20, 30, 40]); + }); + it('accepts a tensor-like object', function () { + var a = [[1, 2, 3], [4, 5, 6]]; + var b = tf.pad2d(a, [[0, 0], [0, 0]]); + test_util_1.expectArraysClose(b, [1, 2, 3, 4, 5, 6]); + }); +}); +jasmine_util_1.describeWithFlags('pad4d', test_util_1.ALL_ENVS, function () { + it('Should pad 4D arrays', function () { + var a = tf.tensor4d([[[[9]]]], [1, 1, 1, 1], 'int32'); + var b = tf.pad4d(a, [[0, 0], [1, 1], [1, 1], [0, 0]]); + var expected = tf.tensor4d([[[[0], [0], [0]], [[0], [9], [0]], [[0], [0], [0]]]], [1, 3, 3, 1], 'int32'); + test_util_1.expectArraysClose(b, expected); + }); + it('does not leak memory', function () { + var a = tf.tensor4d([[[[9]]]], [1, 1, 1, 1], 'int32'); + tf.pad4d(a, [[0, 0], [1, 1], [1, 1], [0, 0]]); + var numTensors = environment_1.Environment.memory().numTensors; + tf.pad4d(a, [[0, 0], [1, 1], [1, 1], [0, 0]]); + expect(environment_1.Environment.memory().numTensors).toEqual(numTensors + 1); + }); + it('accepts a tensor-like object', function () { + var a = [[[[9]]]]; + var b = tf.pad4d(a, [[0, 0], [1, 1], [1, 1], [0, 0]]); + var expected = tf.tensor4d([[[[0], [0], [0]], [[0], [9], [0]], [[0], [0], [0]]]], [1, 3, 3, 1], 'float32'); + test_util_1.expectArraysClose(b, expected); + }); +}); +jasmine_util_1.describeWithFlags('pad', test_util_1.ALL_ENVS, function () { + it('Pad tensor2d', function () { + var a = tf.tensor2d([[1], [2]], [2, 1], 'int32'); + var b = tf.pad(a, [[1, 1], [1, 1]]); + test_util_1.expectArraysClose(b, [0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0]); + a = tf.tensor2d([[1, 2, 3], [4, 5, 6]], [2, 3], 'int32'); + b = tf.pad(a, [[2, 2], [1, 1]]); + test_util_1.expectArraysClose(b, [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, + 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.pad({}, [[0, 0]]); }) + .toThrowError(/Argument 'x' passed to 'pad' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var x = [[1], [2]]; + var res = tf.pad(x, [[1, 1], [1, 1]]); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0]); + }); +}); +//# sourceMappingURL=pad_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/pad_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/pad_test.js.map new file mode 100644 index 0000000..60b21fc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/pad_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pad_test.js","sourceRoot":"","sources":["../../src/ops/pad_test.ts"],"names":[],"mappings":";;AAiBA,8CAA2C;AAC3C,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;A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C,CAAC,CAAC,CAAC;QAKxC,6BAAiB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts new file mode 100644 index 0000000..c5396f3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts @@ -0,0 +1,7 @@ +import { Tensor3D, Tensor4D } from '../tensor'; +import { TensorLike } from '../types'; +declare function maxPool_(x: T | TensorLike, filterSize: [number, number] | number, strides: [number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; +declare function avgPool_(x: T | TensorLike, filterSize: [number, number] | number, strides: [number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; +export declare const maxPool: typeof maxPool_; +export declare const avgPool: typeof avgPool_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/pool.js b/node_modules/@tensorflow/tfjs-core/dist/ops/pool.js new file mode 100644 index 0000000..e1c7527 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/pool.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var conv_util = require("./conv_util"); +var operation_1 = require("./operation"); +function maxPool_(x, filterSize, strides, pad, dimRoundingMode) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'maxPool'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + util.assert(x4D.rank === 4, "Error in maxPool: input must be rank 4 but got rank " + x4D.rank + "."); + if (dimRoundingMode != null) { + util.assert(util.isInt(pad), "Error in maxPool: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var convInfo = conv_util.computePool2DInfo(x4D.shape, filterSize, strides, pad, dimRoundingMode); + var grad = function (dy, saved) { + var y4D = saved[0]; + return { + x: function () { + return maxPoolBackprop(dy, x4D, y4D, filterSize, strides, pad); + } + }; + }; + var res = environment_1.ENV.engine.runKernel(function (backend, save) { return save(backend.maxPool(x4D, convInfo)); }, { x: x4D }, grad); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +function avgPool_(x, filterSize, strides, pad, dimRoundingMode) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'avgPool'); + util.assert($x.dtype === 'float32', 'The input dtype to avgPool must be float32'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + util.assert(x4D.rank === 4, "Error in avgPool: x must be rank 4 but got rank " + x4D.rank + "."); + if (dimRoundingMode != null) { + util.assert(util.isInt(pad), "Error in avgPool: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var convInfo = conv_util.computePool2DInfo(x4D.shape, filterSize, strides, pad); + var grad = function (dy) { + return { x: function () { return avgPoolBackprop(dy, x4D, filterSize, strides, pad); } }; + }; + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.avgPool(x4D, convInfo); }, { x: x4D }, grad); + res = res.cast($x.dtype); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +function maxPoolBackprop(dy, input, output, filterSize, strides, pad, dimRoundingMode) { + var $dy = tensor_util_env_1.convertToTensor(dy, 'dy', 'maxPoolBackprop'); + var $input = tensor_util_env_1.convertToTensor(input, 'input', 'maxPoolBackprop'); + var $output = tensor_util_env_1.convertToTensor(output, 'output', 'maxPoolBackprop'); + util.assert($input.rank === $dy.rank, "Rank of input (" + $input.rank + ") does not match rank of dy (" + $dy.rank + ")"); + util.assert($dy.rank === 4, "Error in maxPoolBackprop: dy must be rank 4 but got rank " + + ($dy.rank + ".")); + util.assert($input.rank === 4, "Error in maxPoolBackprop: input must be rank 4 but got rank " + + ($input.rank + ".")); + if (dimRoundingMode != null) { + util.assert(util.isInt(pad), "Error in maxPoolBackprop: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var convInfo = conv_util.computePool2DInfo($input.shape, filterSize, strides, pad, dimRoundingMode); + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.maxPoolBackprop($dy, $input, $output, convInfo); }, { $dy: $dy, $input: $input }); + return res; +} +function avgPoolBackprop(dy, input, filterSize, strides, pad) { + var $dy = tensor_util_env_1.convertToTensor(dy, 'dy', 'avgPoolBackprop'); + var $input = tensor_util_env_1.convertToTensor(input, 'input', 'avgPoolBackprop'); + util.assert($input.rank === $dy.rank, "Rank of input (" + $input.rank + ") does not match rank of dy (" + $dy.rank + ")"); + var input4D = $input; + var dy4D = $dy; + var reshapedTo4D = false; + if ($input.rank === 3) { + reshapedTo4D = true; + input4D = $input.as4D(1, $input.shape[0], $input.shape[1], $input.shape[2]); + dy4D = $dy.as4D(1, $dy.shape[0], $dy.shape[1], $dy.shape[2]); + } + util.assert(dy4D.rank === 4, "Error in avgPoolBackprop: dy must be rank 4 but got rank " + + (dy4D.rank + ".")); + util.assert(input4D.rank === 4, "Error in avgPoolBackprop: input must be rank 4 but got rank " + + (input4D.rank + ".")); + var convInfo = conv_util.computePool2DInfo(input4D.shape, filterSize, strides, pad); + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.avgPoolBackprop(dy4D, input4D, convInfo); }, { dy4D: dy4D, input4D: input4D }); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; +} +exports.maxPool = operation_1.op({ maxPool_: maxPool_ }); +exports.avgPool = operation_1.op({ avgPool_: avgPool_ }); +//# sourceMappingURL=pool.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/pool.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/pool.js.map new file mode 100644 index 0000000..c08eca6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/pool.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pool.js","sourceRoot":"","sources":["../../src/ops/pool.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,8BAAgC;AAChC,uCAAyC;AACzC,yCAA+B;AAsB/B,kBACI,CAAe,EAAE,UAAmC,EACpD,OAAgC,EAAE,GAA0B,EAC5D,eAAwC;IAC1C,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAE9C,IAAI,GAAG,GAAG,EAAc,CAAC;IACzB,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,IAAI,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE;QACjB,YAAY,GAAG,IAAI,CAAC;QACpB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACzD;IACD,IAAI,CAAC,MAAM,CACP,GAAG,CAAC,IAAI,KAAK,CAAC,EACd,yDAAuD,GAAG,CAAC,IAAI,MAAG,CAAC,CAAC;IACxE,IAAI,eAAe,IAAI,IAAI,EAAE;QAC3B,IAAI,CAAC,MAAM,CACP,IAAI,CAAC,KAAK,CAAC,GAAa,CAAC,EACzB,uDAAuD;aACnD,qBAAmB,e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AK,CAAC,EACf,2DAA2D;SACpD,IAAI,CAAC,IAAI,MAAG,CAAA,CAAC,CAAC;IACzB,IAAI,CAAC,MAAM,CACP,OAAO,CAAC,IAAI,KAAK,CAAC,EAClB,8DAA8D;SACvD,OAAO,CAAC,IAAI,MAAG,CAAA,CAAC,CAAC;IAE5B,IAAM,QAAQ,GACV,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IACzE,IAAM,GAAG,GAAG,iBAAG,CAAC,MAAM,CAAC,SAAS,CAC5B,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAhD,CAAgD,EAC3D,EAAC,IAAI,MAAA,EAAE,OAAO,SAAA,EAAC,CAAC,CAAC;IACrB,IAAI,YAAY,EAAE;QAChB,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAM,CAAC;KAChE;IACD,OAAO,GAAQ,CAAC;AAClB,CAAC;AAEY,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/pool_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/pool_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/pool_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/pool_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/pool_test.js new file mode 100644 index 0000000..abf3f1a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/pool_test.js @@ -0,0 +1,309 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('maxPool', test_util_1.ALL_ENVS, function () { + it('x=[1,1,1] f=[1,1] s=1 [0] => [0]', function () { + var x = tf.tensor3d([0], [1, 1, 1]); + var result = tf.maxPool(x, 1, 1, 0); + test_util_1.expectArraysClose(result, [0]); + }); + it('x=[3,3,1] f=[2,2] s=1', function () { + var x = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 9, 8], [3, 3, 1]); + var result = tf.maxPool(x, 2, 1, 0); + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, [5, 6, 9, 9]); + }); + it('x=[2,3,3,1] f=[2,2] s=1', function () { + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 9, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9], [2, 3, 3, 1]); + var result = tf.maxPool(x, 2, 1, 0); + expect(result.shape).toEqual([2, 2, 2, 1]); + test_util_1.expectArraysClose(result, [5, 6, 9, 9, 5, 6, 8, 9]); + }); + it('[x=[3,3,1] f=[2,2] s=1 ignores NaNs', function () { + var x = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, NaN, 9], [3, 3, 1]); + var result = tf.maxPool(x, 2, 1, 0); + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, [5, 6, 7, 9]); + }); + it('x=[3,3,2] f=[2,2] s=1', function () { + var x = tf.tensor3d([1, 99, 2, 88, 3, 77, 4, 66, 5, 55, 6, 44, 7, 33, 9, 22, 8, 11], [3, 3, 2]); + var result = tf.maxPool(x, 2, 1, 0); + expect(result.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(result, [5, 99, 6, 88, 9, 66, 9, 55]); + }); + it('x=[4,4,1] f=[2,2] s=2', function () { + var x = tf.tensor3d([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [4, 4, 1]); + var result = tf.maxPool(x, 2, 2, 0); + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, [5, 7, 13, 15]); + }); + it('x=[2,2,1] f=[2,2] s=1 p=same', function () { + var x = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var fSize = 2; + var strides = 1; + var result = tf.maxPool(x, fSize, strides, 'same'); + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, [4, 4, 4, 4]); + }); + it('throws when x is not rank 3', function () { + var x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3]); + expect(function () { return tf.maxPool(x, 2, 1, 0); }).toThrowError(); + }); + it('throws when dimRoundingMode is set and pad is not a number', function () { + var x = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var pad = 'valid'; + var dimRoundingMode = 'round'; + expect(function () { return tf.maxPool(x, 2, 1, pad, dimRoundingMode); }).toThrowError(); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.maxPool({}, 2, 1, 'valid'); }) + .toThrowError(/Argument 'x' passed to 'maxPool' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var x = [[[0]]]; + var result = tf.maxPool(x, 1, 1, 0); + test_util_1.expectArraysClose(result, [0]); + }); +}); +jasmine_util_1.describeWithFlags('maxPoolBackprop', test_util_1.ALL_ENVS, function () { + it('gradients x=[3,3,1] f=[2,2] s=1 no dup max value, test #1', function () { + var dy = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var x = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3, 1]); + var expected = [0, 0, 0, 0, 1, 2, 0, 3, 4]; + var dx = tf.grad(function (x) { return x.maxPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradients x=[3,3,1] f=[2,2] s=1 no dup max value, test #2', function () { + var dy = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var x = tf.tensor3d([9, 5, 6, 6, 8, 4, 9, 5, 10], [3, 3, 1]); + var expected = [1, 0, 0, 0, 2, 0, 3, 0, 4]; + var dx = tf.grad(function (x) { return x.maxPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradients x=[2,3,3,1] f=[2,2] s=1 no duplicate max value', function () { + var dy = tf.tensor4d([1, 2, 3, 4, 1, 2, 3, 4], [2, 2, 2, 1]); + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 5, 6, 6, 8, 4, 9, 5, 10], [2, 3, 3, 1]); + var expected = [0, 0, 0, 0, 1, 2, 0, 3, 4, 1, 0, 0, 0, 2, 0, 3, 0, 4]; + var dx = tf.grad(function (x) { return x.maxPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[3,3,1] f=[2,2] s=1 dup max value, test 1', function () { + var dy = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var x = tf.tensor3d([0, 0, 0, 0, 5, 0, 0, 0, 0], [3, 3, 1]); + var expected = [0, 0, 0, 0, 10, 0, 0, 0, 0]; + var dx = tf.grad(function (x) { return x.maxPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[3,3,1] f=[2,2] s=1 dup max value, test 2', function () { + var dy = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var x = tf.tensor3d([1, 3, 2, 1, 2, 1, 1, 1, 5], [3, 3, 1]); + var expected = [0, 3, 0, 0, 3, 0, 0, 0, 4]; + var dx = tf.grad(function (x) { return x.maxPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[2,3,3,1] f=[2,2] s=1 dup max value in 2nd input', function () { + var dy = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2, 1]); + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 9, 8], [2, 3, 3, 1]); + var expected = new Float32Array([0, 0, 0, 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, 5, 6, 0, 15, 0]); + var dx = tf.grad(function (x) { return x.maxPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[4,4,1] f=[2,2] s=2 test #1', function () { + var dy = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var x = tf.tensor3d([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [4, 4, 1]); + var expected = [0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 3, 0, 4]; + var dx = tf.grad(function (x) { return x.maxPool(2, 2, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[4,4,1] f=[2,2] s=2 test #2', function () { + var dy = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var x = tf.tensor3d([1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1], [4, 4, 1]); + var expected = [0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0]; + var dx = tf.grad(function (x) { return x.maxPool(2, 2, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[5,5,1] f=[3,3] s=2 no duplicate max value', function () { + var dy = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var x = tf.tensor3d([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 + ], [5, 5, 1]); + var expected = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4 + ]; + var dx = tf.grad(function (x) { return x.maxPool(3, 2, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[5,5,1] f=[3,3] s=2 duplicate max value', function () { + var dy = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var x = tf.tensor3d([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 24, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 12 + ], [5, 5, 1]); + var expected = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ]; + var dx = tf.grad(function (x) { return x.maxPool(3, 2, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[3,3,2] f=[2,2] s=1, no duplicate max value', function () { + var dy = tf.tensor3d([1, 44, 2, 33, 3, 22, 4, 11], [2, 2, 2]); + var x = tf.tensor3d([1, 99, 2, 55, 3, 66, 4, 66, 5, 88, 6, 44, 7, 99, 8, 55, 9, 100], [3, 3, 2]); + var expected = [0, 44, 0, 0, 0, 0, 0, 0, 1, 33, 2, 0, 0, 22, 3, 0, 4, 11]; + var dx = tf.grad(function (x) { return x.maxPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[3,3,2] f=[2,2] s=1 duplicate max value', function () { + var dy = tf.tensor3d([1, 44, 2, 33, 3, 22, 4, 11], [2, 2, 2]); + var x = tf.tensor3d([0, 1, 0, 3, 0, 2, 0, 1, 5, 2, 0, 1, 0, 1, 0, 1, 0, 5], [3, 3, 2]); + var expected = new Float32Array([0, 0, 0, 77, 0, 0, 0, 0, 10, 22, 0, 0, 0, 0, 0, 0, 0, 11]); + var dx = tf.grad(function (x) { return x.maxPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=[4,4,2] f=[2,2] s=1', function () { + var dy = tf.tensor3d([1, 11, 2, 22, 3, 33, 4, 44], [2, 2, 2]); + var x = tf.tensor3d([ + 0, 1, 1, 2, 2, 2, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, + 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 2, 14, 2, 15, 1 + ], [4, 4, 2]); + var expected = [ + 0, 0, 0, 11, 0, 22, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 33, 0, 44, 4, 0 + ]; + var dx = tf.grad(function (x) { return x.maxPool(2, 2, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); + it('gradient x=5x5x2, f=3, s=2 no duplicate max value', function () { + var dy = tf.tensor3d([1, 11, 2, 22, 3, 33, 4, 44], [2, 2, 2]); + var x = tf.tensor3d([ + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, + 8, 9, 9, 10, 10, 11, 11, 12, 24, 13, 13, 14, 14, 15, 15, 16, 16, + 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 12 + ], [5, 5, 2]); + var expected = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 110, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0 + ]; + var dx = tf.grad(function (x) { return x.maxPool(3, 2, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, expected); + }); +}); +jasmine_util_1.describeWithFlags('avgPool', test_util_1.ALL_ENVS, function () { + it('x=[1,1,1] f=[1,1] s=1 [0] => [0]', function () { + var a = tf.tensor3d([0], [1, 1, 1]); + var result = tf.avgPool(a, 1, 1, 0); + test_util_1.expectArraysClose(result, [0]); + }); + it('x=[3,3,1] f=[2,2] s=1', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 9, 8], [3, 3, 1]); + var result = tf.avgPool(a, 2, 1, 0); + expect(result.shape).toEqual([2, 2, 1]); + expect(result.dtype).toBe('float32'); + test_util_1.expectArraysClose(result, [3, 4, 6.25, 7]); + }); + it('input int32 throws error', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 9, 8], [3, 3, 1], 'int32'); + expect(function () { return tf.avgPool(a, 2, 1, 0); }).toThrowError(); + }); + it('x=[2,3,3,1] f=[2,2], s=1', function () { + var a = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 9, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9], [2, 3, 3, 1]); + var result = tf.avgPool(a, 2, 1, 0); + expect(result.shape).toEqual([2, 2, 2, 1]); + test_util_1.expectArraysClose(result, [3, 4, 6.25, 7, 3, 4, 6, 7]); + }); + it('x=[3,3,1] f=[2,2] s=1 propagates NaNs', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, NaN, 8], [3, 3, 1]); + var result = tf.avgPool(a, 2, 1, 0); + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, [3, 4, NaN, NaN]); + }); + it('x=[3,3,2] f=[2,2] s=1', function () { + var a = tf.tensor3d([1, 99, 2, 88, 3, 77, 4, 66, 5, 55, 6, 44, 7, 33, 9, 22, 8, 11], [3, 3, 2]); + var result = tf.avgPool(a, 2, 1, 0); + expect(result.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(result, [3, 77, 4, 66, 6.25, 44, 7, 33]); + }); + it('x=[4,4,1] f=[2,2] s=2', function () { + var a = tf.tensor3d([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [4, 4, 1]); + var result = tf.avgPool(a, 2, 2, 0); + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, [2.5, 4.5, 10.5, 12.5]); + }); + it('x=[2,2,1] f=[2,2] s=1 p=same', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var fSize = 2; + var strides = 1; + var result = tf.avgPool(a, fSize, strides, 'same'); + expect(result.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(result, [2.5, 3, 3.5, 4]); + }); + it('gradient x=[1,1,1] f=[1,1] s=1 [0] => [0]', function () { + var x = tf.tensor3d([0], [1, 1, 1]); + var dy = tf.tensor3d([0], [1, 1, 1]); + var dx = tf.grad(function (x) { return x.avgPool(1, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, [0]); + }); + it('gradient x=[3,3,1] f=[2,2] s=1', function () { + var x = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 9, 8], [3, 3, 1]); + var dy = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var avgMultiplier = 1 / (2 * 2); + var dx = tf.grad(function (x) { return x.avgPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, [ + 1 * avgMultiplier, 3 * avgMultiplier, 2 * avgMultiplier, + 4 * avgMultiplier, 10 * avgMultiplier, 6 * avgMultiplier, + 3 * avgMultiplier, 7 * avgMultiplier, 4 * avgMultiplier + ]); + }); + it('gradient x=[2,3,3,1] f=[2,2], s=1', function () { + var x = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 9, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9], [2, 3, 3, 1]); + var dy = tf.tensor4d([1, 2, 3, 4, 1, 2, 3, 4], [2, 2, 2, 1]); + var avgMultiplier = 1 / (2 * 2); + var dx = tf.grad(function (x) { return x.avgPool(2, 1, 0); })(x, dy); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, [ + 1 * avgMultiplier, 3 * avgMultiplier, 2 * avgMultiplier, + 4 * avgMultiplier, 10 * avgMultiplier, 6 * avgMultiplier, + 3 * avgMultiplier, 7 * avgMultiplier, 4 * avgMultiplier, + 1 * avgMultiplier, 3 * avgMultiplier, 2 * avgMultiplier, + 4 * avgMultiplier, 10 * avgMultiplier, 6 * avgMultiplier, + 3 * avgMultiplier, 7 * avgMultiplier, 4 * avgMultiplier + ]); + }); + it('throws when dimRoundingMode is set and pad is not a number', function () { + var x = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + var pad = 'valid'; + var dimRoundingMode = 'round'; + expect(function () { return tf.avgPool(x, 2, 1, pad, dimRoundingMode); }).toThrowError(); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.avgPool({}, 2, 1, 'valid'); }) + .toThrowError(/Argument 'x' passed to 'avgPool' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [[[0]]]; + var result = tf.avgPool(a, 1, 1, 0); + test_util_1.expectArraysClose(result, [0]); + }); +}); +//# sourceMappingURL=pool_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/pool_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/pool_test.js.map new file mode 100644 index 0000000..325e76c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/pool_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pool_test.js","sourceRoot":"","sources":["../../src/ops/pool_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,SAAS,EAAE,oBAAQ,EAAE;IACrC,EAAE,CAAC,kCAAkC,EAAE;QACrC,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;Q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CAAC,CAAC,CAAC,CAAC;QAE/C,IAAM,GAAG,GAAG,OAAO,CAAC;QACpB,IAAM,eAAe,GAAG,OAAO,CAAC;QAEhC,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,eAAe,CAAC,EAAzC,CAAyC,CAAC,CAAC,YAAY,EAAE,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE;QACpC,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,OAAO,CAAC,EAAiB,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAA5C,CAA4C,CAAC;aACrD,YAAY,CAAC,mDAAmD,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClB,IAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACtC,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts new file mode 100644 index 0000000..57c13b0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts @@ -0,0 +1,21 @@ +export interface RandGauss { + nextValue(): number; +} +export interface RandNormalDataTypes { + float32: Float32Array; + int32: Int32Array; +} +export declare class MPRandGauss implements RandGauss { + private mean; + private stdDev; + private nextVal; + private dtype?; + private truncated?; + private upper?; + private lower?; + private random; + constructor(mean: number, stdDeviation: number, dtype?: keyof RandNormalDataTypes, truncated?: boolean, seed?: number); + nextValue(): number; + private convertValue; + private isValidTruncated; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/rand.js b/node_modules/@tensorflow/tfjs-core/dist/ops/rand.js new file mode 100644 index 0000000..defaee1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/rand.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var seedrandom = require("seedrandom"); +var MPRandGauss = (function () { + function MPRandGauss(mean, stdDeviation, dtype, truncated, seed) { + this.mean = mean; + this.stdDev = stdDeviation; + this.dtype = dtype; + this.nextVal = NaN; + this.truncated = truncated; + if (this.truncated) { + this.upper = this.mean + this.stdDev * 2; + this.lower = this.mean - this.stdDev * 2; + } + var seedValue = seed ? seed : Math.random(); + this.random = seedrandom.alea(seedValue.toString()); + } + MPRandGauss.prototype.nextValue = function () { + if (!isNaN(this.nextVal)) { + var value = this.nextVal; + this.nextVal = NaN; + return value; + } + var resultX, resultY; + var isValid = false; + while (!isValid) { + var v1 = void 0, v2 = void 0, s = void 0; + do { + v1 = 2 * this.random() - 1; + v2 = 2 * this.random() - 1; + s = v1 * v1 + v2 * v2; + } while (s >= 1 || s === 0); + var mul = Math.sqrt(-2.0 * Math.log(s) / s); + resultX = this.mean + this.stdDev * v1 * mul; + resultY = this.mean + this.stdDev * v2 * mul; + if (!this.truncated || this.isValidTruncated(resultX)) { + isValid = true; + } + } + if (!this.truncated || this.isValidTruncated(resultY)) { + this.nextVal = this.convertValue(resultY); + } + return this.convertValue(resultX); + }; + MPRandGauss.prototype.convertValue = function (value) { + if (this.dtype == null || this.dtype === 'float32') { + return value; + } + return Math.round(value); + }; + MPRandGauss.prototype.isValidTruncated = function (value) { + return value <= this.upper && value >= this.lower; + }; + return MPRandGauss; +}()); +exports.MPRandGauss = MPRandGauss; +//# sourceMappingURL=rand.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/rand.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/rand.js.map new file mode 100644 index 0000000..163c61e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/rand.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rand.js","sourceRoot":"","sources":["../../src/ops/rand.ts"],"names":[],"mappings":";;AAiBA,uCAAyC;AAYzC;IAUE,qBACI,IAAY,EAAE,YAAoB,EAAE,KAAiC,EACrE,SAAmB,EAAE,IAAa;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;YACzC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SAC1C;QACD,IAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtD,CAAC;IAGM,+BAAS,GAAhB;QACE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YACxB,IAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;YAC3B,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;YACnB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAe,EAAE,OAAe,CAAC;QACrC,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,OAAO,CAAC,OAAO,EAAE;YACf,IAAI,EAAE,SAAQ,EAAE,EAAE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,KAAa;QACpC,OAAO,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC;IACpD,CAAC;IACH,kBAAC;AAAD,CAAC,AAvED,IAuEC;AAvEY,kCAAW"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/rand_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/rand_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_test.js new file mode 100644 index 0000000..b08eb75 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_test.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var rand_1 = require("./rand"); +var rand_util_1 = require("./rand_util"); +function isFloat(n) { + return Number(n) === n && n % 1 !== 0; +} +describe('MPRandGauss', function () { + var EPSILON = 0.05; + var SEED = 2002; + it('should default to float32 numbers', function () { + var rand = new rand_1.MPRandGauss(0, 1.5); + expect(isFloat(rand.nextValue())).toBe(true); + }); + it('should handle create a mean/stdv of float32 numbers', function () { + var rand = new rand_1.MPRandGauss(0, 1.5, 'float32', false, SEED); + var values = []; + var size = 10000; + for (var i = 0; i < size; i++) { + values.push(rand.nextValue()); + } + rand_util_1.expectArrayInMeanStdRange(values, 0, 1.5, EPSILON); + rand_util_1.jarqueBeraNormalityTest(values); + }); + it('should handle int32 numbers', function () { + var rand = new rand_1.MPRandGauss(0, 1, 'int32'); + expect(isFloat(rand.nextValue())).toBe(false); + }); + it('should handle create a mean/stdv of int32 numbers', function () { + var rand = new rand_1.MPRandGauss(0, 2, 'int32', false, SEED); + var values = []; + var size = 10000; + for (var i = 0; i < size; i++) { + values.push(rand.nextValue()); + } + rand_util_1.expectArrayInMeanStdRange(values, 0, 2, EPSILON); + rand_util_1.jarqueBeraNormalityTest(values); + }); + it('Should not have a more than 2x std-d from mean for truncated values', function () { + var stdv = 1.5; + var rand = new rand_1.MPRandGauss(0, stdv, 'float32', true); + for (var i = 0; i < 1000; i++) { + expect(Math.abs(rand.nextValue())).toBeLessThan(stdv * 2); + } + }); +}); +//# sourceMappingURL=rand_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/rand_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_test.js.map new file mode 100644 index 0000000..47539fb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rand_test.js","sourceRoot":"","sources":["../../src/ops/rand_test.ts"],"names":[],"mappings":";;AAiBA,+BAAmC;AACnC,yCAA+E;AAE/E,iBAAiB,CAAS;IACxB,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAED,QAAQ,CAAC,aAAa,EAAE;IACtB,IAAM,OAAO,GAAG,IAAI,CAAC;IACrB,IAAM,IAAI,GAAG,IAAI,CAAC;IAElB,EAAE,CAAC,mCAAmC,EAAE;QACtC,IAAM,IAAI,GAAG,IAAI,kBAAW,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACrC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE;QACxD,IAAM,IAAI,GACN,IAAI,kBAAW,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAkB,IAAI,CAAC,CAAC;QACpE,IAAM,MAAM,GAAG,EAAE,CAAC;QAClB,IAAM,IAAI,GAAG,KAAK,CAAC;QACnB,KAAK,IAAI,CAAC,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E,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;YAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;SAC3D;IACH,CAAC,CAAC,CAAC;AACR,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.d.ts new file mode 100644 index 0000000..0b09be1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.d.ts @@ -0,0 +1,4 @@ +import { Tensor } from '../tensor'; +import { TypedArray } from '../types'; +export declare function jarqueBeraNormalityTest(a: Tensor | TypedArray | number[]): void; +export declare function expectArrayInMeanStdRange(actual: Tensor | TypedArray | number[], expectedMean: number, expectedStdDev: number, epsilon?: number): void; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.js new file mode 100644 index 0000000..bc8315c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_1 = require("../tensor"); +var test_util_1 = require("../test_util"); +function jarqueBeraNormalityTest(a) { + var values; + if (a instanceof tensor_1.Tensor) { + values = a.dataSync(); + } + else { + values = a; + } + var n = values.length; + var s = skewness(values); + var k = kurtosis(values); + var jb = n / 6 * (Math.pow(s, 2) + 0.25 * Math.pow(k - 3, 2)); + var CHI_SQUARE_2DEG = 5.991; + if (jb > CHI_SQUARE_2DEG) { + throw new Error("Invalid p-value for JB: " + jb); + } +} +exports.jarqueBeraNormalityTest = jarqueBeraNormalityTest; +function expectArrayInMeanStdRange(actual, expectedMean, expectedStdDev, epsilon) { + if (epsilon == null) { + epsilon = environment_1.ENV.get('TEST_EPSILON'); + } + var actualValues; + if (actual instanceof tensor_1.Tensor) { + actualValues = actual.dataSync(); + } + else { + actualValues = actual; + } + var actualMean = mean(actualValues); + test_util_1.expectNumbersClose(actualMean, expectedMean, epsilon); + test_util_1.expectNumbersClose(standardDeviation(actualValues, actualMean), expectedStdDev, epsilon); +} +exports.expectArrayInMeanStdRange = expectArrayInMeanStdRange; +function mean(values) { + var sum = 0; + for (var i = 0; i < values.length; i++) { + sum += values[i]; + } + return sum / values.length; +} +function standardDeviation(values, mean) { + var squareDiffSum = 0; + for (var i = 0; i < values.length; i++) { + var diff = values[i] - mean; + squareDiffSum += diff * diff; + } + return Math.sqrt(squareDiffSum / values.length); +} +function kurtosis(values) { + var valuesMean = mean(values); + var n = values.length; + var sum2 = 0; + var sum4 = 0; + for (var i = 0; i < n; i++) { + var v = values[i] - valuesMean; + sum2 += Math.pow(v, 2); + sum4 += Math.pow(v, 4); + } + return (1 / n) * sum4 / Math.pow((1 / n) * sum2, 2); +} +function skewness(values) { + var valuesMean = mean(values); + var n = values.length; + var sum2 = 0; + var sum3 = 0; + for (var i = 0; i < n; i++) { + var v = values[i] - valuesMean; + sum2 += Math.pow(v, 2); + sum3 += Math.pow(v, 3); + } + return (1 / n) * sum3 / Math.pow((1 / (n - 1)) * sum2, 3 / 2); +} +//# sourceMappingURL=rand_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.js.map new file mode 100644 index 0000000..0ee864e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/rand_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rand_util.js","sourceRoot":"","sources":["../../src/ops/rand_util.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AACnC,oCAAiC;AACjC,0CAAgD;AAGhD,iCAAwC,CAA6B;IACnE,IAAI,MAA2B,CAAC;IAChC,IAAI,CAAC,YAAY,eAAM,EAAE;QACvB,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;KACvB;SAAM;QACL,MAAM,GAAG,CAAC,CAAC;KACZ;IAED,IAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;IACxB,IAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3B,IAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3B,IAAM,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EA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;QACjC,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvB,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KACxB;IACD,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts new file mode 100644 index 0000000..ba4acd4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts @@ -0,0 +1,7 @@ +export declare const PARALLELIZE_THRESHOLD = 30; +export interface ReduceInfo { + windowSize: number; + batchSize: number; + inSize: number; +} +export declare function computeOptimalWindowSize(inSize: number): number; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.js new file mode 100644 index 0000000..cfbd2be --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = require("../util"); +exports.PARALLELIZE_THRESHOLD = 30; +function computeOptimalWindowSize(inSize) { + if (inSize <= exports.PARALLELIZE_THRESHOLD) { + return inSize; + } + return util_1.nearestDivisor(inSize, Math.floor(Math.sqrt(inSize))); +} +exports.computeOptimalWindowSize = computeOptimalWindowSize; +//# sourceMappingURL=reduce_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.js.map new file mode 100644 index 0000000..9654271 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reduce_util.js","sourceRoot":"","sources":["../../src/ops/reduce_util.ts"],"names":[],"mappings":";;AAqBA,gCAAuC;AAE1B,QAAA,qBAAqB,GAAG,EAAE,CAAC;AAQxC,kCAAyC,MAAc;IACrD,IAAI,MAAM,IAAI,6BAAqB,EAAE;QACnC,OAAO,MAAM,CAAC;KACf;IACD,OAAO,qBAAc,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AALD,4DAKC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops.d.ts new file mode 100644 index 0000000..6cc692c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops.d.ts @@ -0,0 +1,26 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function logSumExp_(x: Tensor | TensorLike, axis?: number | number[], keepDims?: boolean): T; +declare function sum_(x: Tensor | TensorLike, axis?: number | number[], keepDims?: boolean): T; +declare function mean_(x: Tensor | TensorLike, axis?: number | number[], keepDims?: boolean): T; +declare function min_(x: Tensor | TensorLike, axis?: number | number[], keepDims?: boolean): T; +declare function max_(x: Tensor | TensorLike, axis?: number | number[], keepDims?: boolean): T; +declare function argMin_(x: Tensor | TensorLike, axis?: number): T; +declare function argMax_(x: Tensor | TensorLike, axis?: number): T; +declare function all_(x: Tensor | TensorLike, axis?: number | number[], keepDims?: boolean): T; +declare function any_(x: Tensor | TensorLike, axis?: number | number[], keepDims?: boolean): T; +declare function moments_(x: Tensor | TensorLike, axis?: number | number[], keepDims?: boolean): { + mean: Tensor; + variance: Tensor; +}; +export declare const all: typeof all_; +export declare const any: typeof any_; +export declare const argMax: typeof argMax_; +export declare const argMin: typeof argMin_; +export declare const logSumExp: typeof logSumExp_; +export declare const max: typeof max_; +export declare const mean: typeof mean_; +export declare const min: typeof min_; +export declare const moments: typeof moments_; +export declare const sum: typeof sum_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops.js new file mode 100644 index 0000000..06c4b9d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops.js @@ -0,0 +1,213 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var globals_1 = require("../globals"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var axis_util = require("./axis_util"); +var operation_1 = require("./operation"); +var tensor_ops_1 = require("./tensor_ops"); +function logSumExp_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'logSumExp'); + var axes = axis_util.parseAxisParam(axis, $x.shape); + var xMax = $x.max(axes, true); + var a = $x.sub(xMax); + var b = a.exp(); + var c = b.sum(axes); + var d = c.log(); + var res = xMax.reshape(d.shape).add(d); + if (keepDims) { + var newShape = axis_util.expandShapeToKeepDim(res.shape, axes); + return res.reshape(newShape); + } + return res; +} +function sum_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'sum'); + if ($x.dtype === 'bool') { + $x = $x.toInt(); + } + var axes = axis_util.parseAxisParam(axis, $x.shape); + var customOp = globals_1.customGrad(function (x) { + var permutation = axis_util.getAxesPermutation(axes, x.rank); + var reductionAxes = axes; + var permutedX = x; + if (permutation != null) { + permutedX = x.transpose(permutation); + reductionAxes = axis_util.getInnerMostAxes(reductionAxes.length, x.rank); + } + var value = environment_1.ENV.engine.runKernel(function (backend) { return backend.sum(permutedX, reductionAxes); }, { permutedX: permutedX }); + if (keepDims) { + var newShape = axis_util.expandShapeToKeepDim(value.shape, axes); + value = value.reshape(newShape); + } + var gradFunc = function (dy) { + var expandedDyShape = x.shape.slice(); + axes.forEach(function (axis) { + expandedDyShape[axis] = 1; + }); + var expandedDy = dy.reshape(expandedDyShape); + var derX = expandedDy.mul(tensor_ops_1.ones(x.shape, 'float32')); + return derX; + }; + return { value: value, gradFunc: gradFunc }; + }); + return customOp($x); +} +function mean_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'mean'); + var axes = axis_util.parseAxisParam(axis, $x.shape); + var shapes = axis_util.computeOutAndReduceShapes($x.shape, axes); + var reduceShape = shapes[1]; + var reduceSize = util.sizeFromShape(reduceShape); + var customOp = globals_1.customGrad(function (x) { + var reduceSizeScalar = tensor_ops_1.scalar(reduceSize); + var xReduce = reduceSizeScalar.dtype === x.dtype ? x : x.cast(reduceSizeScalar.dtype); + var res = xReduce.div(reduceSizeScalar); + var value = res.sum(axis, keepDims); + var gradFunc = function (dy) { + var expandedDyShape = x.shape.slice(); + axes.forEach(function (axis) { + expandedDyShape[axis] = 1; + }); + var expandedDy = dy.reshape(expandedDyShape); + var derX = expandedDy.mul(tensor_ops_1.ones(x.shape, 'float32')).div(reduceSizeScalar); + return derX; + }; + return { value: value, gradFunc: gradFunc }; + }); + return customOp($x); +} +function min_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'min'); + var origAxes = axis_util.parseAxisParam(axis, $x.shape); + var axes = origAxes; + var permutedAxes = axis_util.getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = axis_util.getInnerMostAxes(axes.length, $x.rank); + } + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.min($x, axes); }, { $x: $x }); + if (keepDims) { + var newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; +} +function max_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'max'); + var origAxes = axis_util.parseAxisParam(axis, $x.shape); + var axes = origAxes; + var permutedAxes = axis_util.getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = axis_util.getInnerMostAxes(axes.length, $x.rank); + } + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.max($x, axes); }, { $x: $x }); + if (keepDims) { + var newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; +} +function argMin_(x, axis) { + if (axis === void 0) { axis = 0; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'argMin'); + if (axis == null) { + axis = 0; + } + var axes = axis_util.parseAxisParam(axis, $x.shape); + var permutedAxes = axis_util.getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = axis_util.getInnerMostAxes(axes.length, $x.rank); + } + return environment_1.ENV.engine.runKernel(function (backend) { return backend.argMin($x, axes[0]); }, { $x: $x }); +} +function argMax_(x, axis) { + if (axis === void 0) { axis = 0; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'argMax'); + if (axis == null) { + axis = 0; + } + var axes = axis_util.parseAxisParam(axis, $x.shape); + var permutedAxes = axis_util.getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = axis_util.getInnerMostAxes(axes.length, $x.rank); + } + return environment_1.ENV.engine.runKernel(function (backend) { return backend.argMax($x, axes[0]); }, { $x: $x }); +} +function all_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'all', 'bool'); + util.assert($x.dtype === 'bool', "Error Tensor must be of type bool. Got: " + $x.dtype); + var origAxes = axis_util.parseAxisParam(axis, $x.shape); + var axes = origAxes; + var permutedAxes = axis_util.getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = axis_util.getInnerMostAxes(axes.length, $x.rank); + } + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.all($x, axes); }, { $x: $x }); + if (keepDims) { + var newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; +} +function any_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'any', 'bool'); + util.assert($x.dtype === 'bool', "Error Tensor must be of type bool. Got: " + $x.dtype); + var origAxes = axis_util.parseAxisParam(axis, $x.shape); + var axes = origAxes; + var permutedAxes = axis_util.getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = axis_util.getInnerMostAxes(axes.length, $x.rank); + } + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.any($x, axes); }, { $x: $x }); + if (keepDims) { + var newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; +} +function moments_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + x = tensor_util_env_1.convertToTensor(x, 'x', 'moments'); + var axes = axis_util.parseAxisParam(axis, x.shape); + var mean = x.mean(axes, keepDims); + var keepDimsShape = mean.shape; + if (!keepDims) { + keepDimsShape = axis_util.expandShapeToKeepDim(mean.shape, axes); + } + var devSquared = x.toFloat().sub(mean.reshape(keepDimsShape)).square(); + var variance = devSquared.mean(axes, keepDims); + return { mean: mean, variance: variance }; +} +exports.all = operation_1.op({ all_: all_ }); +exports.any = operation_1.op({ any_: any_ }); +exports.argMax = operation_1.op({ argMax_: argMax_ }); +exports.argMin = operation_1.op({ argMin_: argMin_ }); +exports.logSumExp = operation_1.op({ logSumExp_: logSumExp_ }); +exports.max = operation_1.op({ max_: max_ }); +exports.mean = operation_1.op({ mean_: mean_ }); +exports.min = operation_1.op({ min_: min_ }); +exports.moments = operation_1.op({ moments_: moments_ }); +exports.sum = operation_1.op({ sum_: sum_ }); +//# sourceMappingURL=reduction_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops.js.map new file mode 100644 index 0000000..0106e42 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reduction_ops.js","sourceRoot":"","sources":["../../src/ops/reduction_ops.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AACnC,sCAAsC;AAEtC,sDAAmD;AAEnD,8BAAgC;AAChC,uCAAyC;AACzC,yCAA+B;AAC/B,2CAA0C;AA8B1C,oBACI,CAAoB,EAAE,IAA4B,EAAE,QAAgB;IAA9C,qBAAA,EAAA,WAA4B;IAAE,yBAAA,EAAA,gBAAgB;IACtE,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;IAEhD,IAAM,IAAI,GAAG,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;IACtD,IAAM,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAgB,CAAC;IAC/C,IAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACvB,IAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAClB,IAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtB,IAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAClB,IAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,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,EAAE,IAAI,CAAC,CAAC;KAClE;IACD,IAAM,UAAU,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACzE,IAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACjD,OAAO,EAAC,IAAI,MAAA,EAAE,QAAQ,UAAA,EAAC,CAAC;AAC1B,CAAC;AAEY,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AAEjB,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,MAAM,GAAG,cAAE,CAAC,EAAC,OAAO,SAAA,EAAC,CAAC,CAAC;AACvB,QAAA,MAAM,GAAG,cAAE,CAAC,EAAC,OAAO,SAAA,EAAC,CAAC,CAAC;AACvB,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;AACnB,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops_test.js new file mode 100644 index 0000000..66f10fd --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops_test.js @@ -0,0 +1,968 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var reduce_util = require("./reduce_util"); +jasmine_util_1.describeWithFlags('Reduction: min', test_util_1.ALL_ENVS, function () { + it('Tensor1D', function () { + var a = tf.tensor1d([3, -1, 0, 100, -7, 2]); + test_util_1.expectNumbersClose(tf.min(a).get(), -7); + }); + it('ignores NaNs', function () { + var a = tf.tensor1d([3, NaN, 2]); + expect(tf.min(a).get()).toEqual(2); + }); + it('2D', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + test_util_1.expectNumbersClose(tf.min(a).get(), -7); + }); + it('2D axis=[0,1]', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + test_util_1.expectNumbersClose(tf.min(a, [0, 1]).get(), -7); + }); + it('2D, axis=0', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + var r = tf.min(a, 0); + expect(r.shape).toEqual([3]); + test_util_1.expectArraysClose(r, [3, -7, 0]); + }); + it('2D, axis=0, keepDims', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + var r = tf.min(a, 0, true); + expect(r.shape).toEqual([1, 3]); + test_util_1.expectArraysClose(r, [3, -7, 0]); + }); + it('2D, axis=1 provided as a number', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]); + var r = tf.min(a, 1); + test_util_1.expectArraysClose(r, [2, -7]); + }); + it('2D, axis = -1 provided as a number', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]); + var r = tf.min(a, -1); + test_util_1.expectArraysClose(r, [2, -7]); + }); + it('2D, axis=[1]', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]); + var r = tf.min(a, [1]); + test_util_1.expectArraysClose(r, [2, -7]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.min({}); }) + .toThrowError(/Argument 'x' passed to 'min' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + test_util_1.expectNumbersClose(tf.min([3, -1, 0, 100, -7, 2]).get(), -7); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: max', test_util_1.ALL_ENVS, function () { + it('with one element dominating', function () { + var a = tf.tensor1d([3, -1, 0, 100, -7, 2]); + var r = tf.max(a); + test_util_1.expectNumbersClose(r.get(), 100); + }); + it('with all elements being the same', function () { + var a = tf.tensor1d([3, 3, 3]); + var r = tf.max(a); + test_util_1.expectNumbersClose(r.get(), 3); + }); + it('ignores NaNs', function () { + test_util_1.expectNumbersClose(tf.max(tf.tensor1d([3, NaN, 2])).get(), 3); + }); + it('2D', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + test_util_1.expectNumbersClose(tf.max(a).get(), 100); + }); + it('2D axis=[0,1]', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + test_util_1.expectNumbersClose(tf.max(a, [0, 1]).get(), 100); + }); + it('2D, axis=0', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + var r = tf.max(a, [0]); + expect(r.shape).toEqual([3]); + test_util_1.expectArraysClose(r, [100, -1, 2]); + }); + it('2D, axis=0, keepDims', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + var r = tf.max(a, [0], true); + expect(r.shape).toEqual([1, 3]); + test_util_1.expectArraysClose(r, [100, -1, 2]); + }); + it('2D, axis=1 provided as a number', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]); + var r = tf.max(a, 1); + test_util_1.expectArraysClose(r, [5, 100]); + }); + it('2D, axis = -1 provided as a number', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]); + var r = tf.max(a, -1); + test_util_1.expectArraysClose(r, [5, 100]); + }); + it('2D, axis=[1]', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]); + var r = tf.max(a, [1]); + test_util_1.expectArraysClose(r, [5, 100]); + }); + it('6D, axis=[5]', function () { + var a = tf.range(0, 64).reshape([2, 2, 2, 2, 2, 2]); + var r = tf.max(a, [5]); + var expectedResult = [ + 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, + 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63 + ]; + test_util_1.expectArraysClose(r, expectedResult); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.max({}); }) + .toThrowError(/Argument 'x' passed to 'max' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.max([3, -1, 0, 100, -7, 2]); + test_util_1.expectNumbersClose(r.get(), 100); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: argmax', test_util_1.ALL_ENVS, function () { + it('Tensor1D', function () { + var a = tf.tensor1d([1, 0, 3, 2]); + var result = tf.argMax(a); + expect(result.dtype).toBe('int32'); + expect(result.get()).toBe(2); + }); + it('one value', function () { + var a = tf.tensor1d([10]); + var result = tf.argMax(a); + expect(result.dtype).toBe('int32'); + expect(result.get()).toBe(0); + }); + it('N > than parallelization threshold', function () { + var n = reduce_util.PARALLELIZE_THRESHOLD * 2; + var values = new Float32Array(n); + for (var i = 0; i < n; i++) { + values[i] = i; + } + var a = tf.tensor1d(values); + var result = tf.argMax(a); + expect(result.dtype).toBe('int32'); + expect(result.get()).toBe(n - 1); + }); + it('ignores NaNs', function () { + var a = tf.tensor1d([0, 3, 5, NaN, 3]); + var res = tf.argMax(a); + expect(res.dtype).toBe('int32'); + expect(res.get()).toBe(2); + }); + it('2D, no axis specified', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + test_util_1.expectArraysEqual(tf.argMax(a), [1, 0, 1]); + }); + it('2D, axis=0', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + var r = tf.argMax(a, 0); + expect(r.shape).toEqual([3]); + expect(r.dtype).toBe('int32'); + test_util_1.expectArraysEqual(r, [1, 0, 1]); + }); + it('2D, axis=1', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]); + var r = tf.argMax(a, 1); + expect(r.dtype).toBe('int32'); + test_util_1.expectArraysEqual(r, [2, 0]); + }); + it('2D, axis = -1', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, 2], [2, 3]); + var r = tf.argMax(a, -1); + expect(r.dtype).toBe('int32'); + test_util_1.expectArraysEqual(r, [2, 0]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.argMax({}); }) + .toThrowError(/Argument 'x' passed to 'argMax' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.argMax([1, 0, 3, 2]); + expect(result.dtype).toBe('int32'); + expect(result.get()).toBe(2); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: argmin', test_util_1.ALL_ENVS, function () { + it('Tensor1D', function () { + var a = tf.tensor1d([1, 0, 3, 2]); + var result = tf.argMin(a); + expect(result.get()).toBe(1); + }); + it('one value', function () { + var a = tf.tensor1d([10]); + var result = tf.argMin(a); + expect(result.get()).toBe(0); + }); + it('N > than parallelization threshold', function () { + var n = reduce_util.PARALLELIZE_THRESHOLD * 2; + var values = new Float32Array(n); + for (var i = 0; i < n; i++) { + values[i] = n - i; + } + var a = tf.tensor1d(values); + var result = tf.argMin(a); + expect(result.dtype).toBe('int32'); + expect(result.get()).toBe(n - 1); + }); + it('ignores NaNs', function () { + var a = tf.tensor1d([5, 0, NaN, -1, 3]); + var res = tf.argMin(a); + expect(res.get()).toBe(3); + }); + it('2D, no axis specified', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + test_util_1.expectArraysEqual(tf.argMin(a), [0, 1, 0]); + }); + it('2D, axis=0', function () { + var a = tf.tensor2d([3, -1, 0, 100, -7, 2], [2, 3]); + var r = tf.argMin(a, 0); + expect(r.shape).toEqual([3]); + expect(r.dtype).toBe('int32'); + test_util_1.expectArraysEqual(r, [0, 1, 0]); + }); + it('2D, axis=1', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, -8], [2, 3]); + var r = tf.argMin(a, 1); + test_util_1.expectArraysEqual(r, [1, 2]); + }); + it('2D, axis = -1', function () { + var a = tf.tensor2d([3, 2, 5, 100, -7, -8], [2, 3]); + var r = tf.argMin(a, -1); + test_util_1.expectArraysEqual(r, [1, 2]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.argMin({}); }) + .toThrowError(/Argument 'x' passed to 'argMin' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.argMin([1, 0, 3, 2]); + expect(result.get()).toBe(1); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: logSumExp', test_util_1.ALL_ENVS, function () { + it('0', function () { + var a = tf.scalar(0); + var result = tf.logSumExp(a); + test_util_1.expectNumbersClose(result.get(), 0); + }); + it('basic', function () { + var a = tf.tensor1d([1, 2, -3]); + var result = tf.logSumExp(a); + test_util_1.expectNumbersClose(result.get(), Math.log(Math.exp(1) + Math.exp(2) + Math.exp(-3))); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([1, 2, NaN]); + var result = tf.logSumExp(a); + expect(result.get()).toEqual(NaN); + }); + it('axes=0 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var r = tf.logSumExp(a, [0]); + expect(r.shape).toEqual([2]); + var expected = [ + Math.log(Math.exp(1) + Math.exp(3) + Math.exp(0)), + Math.log(Math.exp(2) + Math.exp(0) + Math.exp(1)) + ]; + test_util_1.expectArraysClose(r, expected); + }); + it('axes=0 in 2D array, keepDims', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var r = tf.logSumExp(a, [0], true); + expect(r.shape).toEqual([1, 2]); + var expected = [ + Math.log(Math.exp(1) + Math.exp(3) + Math.exp(0)), + Math.log(Math.exp(2) + Math.exp(0) + Math.exp(1)) + ]; + test_util_1.expectArraysClose(r, expected); + }); + it('axes=1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.logSumExp(a, [1]); + expect(res.shape).toEqual([3]); + var expected = [ + Math.log(Math.exp(1) + Math.exp(2)), + Math.log(Math.exp(3) + Math.exp(0)), + Math.log(Math.exp(0) + Math.exp(1)), + ]; + test_util_1.expectArraysClose(res, expected); + }); + it('axes = -1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.logSumExp(a, -1); + expect(res.shape).toEqual([3]); + var expected = [ + Math.log(Math.exp(1) + Math.exp(2)), + Math.log(Math.exp(3) + Math.exp(0)), + Math.log(Math.exp(0) + Math.exp(1)), + ]; + test_util_1.expectArraysClose(res, expected); + }); + it('2D, axes=1 provided as a single digit', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [2, 3]); + var res = tf.logSumExp(a, 1); + expect(res.shape).toEqual([2]); + var expected = [ + Math.log(Math.exp(1) + Math.exp(2) + Math.exp(3)), + Math.log(Math.exp(0) + Math.exp(0) + Math.exp(1)) + ]; + test_util_1.expectArraysClose(res, expected); + }); + it('axes=0,1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.logSumExp(a, [0, 1]); + expect(res.shape).toEqual([]); + var expected = [Math.log(Math.exp(1) + Math.exp(2) + Math.exp(3) + Math.exp(0) + Math.exp(0) + + Math.exp(1))]; + test_util_1.expectArraysClose(res, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.logSumExp({}); }) + .toThrowError(/Argument 'x' passed to 'logSumExp' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.logSumExp([1, 2, -3]); + test_util_1.expectNumbersClose(result.get(), Math.log(Math.exp(1) + Math.exp(2) + Math.exp(-3))); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: sum', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var result = tf.sum(a); + test_util_1.expectNumbersClose(result.get(), 7); + }); + it('propagates NaNs', function () { + var a = tf.tensor2d([1, 2, 3, NaN, 0, 1], [3, 2]); + expect(tf.sum(a).get()).toEqual(NaN); + }); + it('sum over dtype int32', function () { + var a = tf.tensor1d([1, 5, 7, 3], 'int32'); + var sum = tf.sum(a); + expect(sum.get()).toBe(16); + }); + it('sum over dtype bool', function () { + var a = tf.tensor1d([true, false, false, true, true], 'bool'); + var sum = tf.sum(a); + expect(sum.get()).toBe(3); + }); + it('sums all values in 2D array with keep dim', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.sum(a, null, true); + expect(res.shape).toEqual([1, 1]); + test_util_1.expectArraysClose(res, [7]); + }); + it('sums across axis=0 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.sum(a, [0]); + expect(res.shape).toEqual([2]); + test_util_1.expectArraysClose(res, [4, 3]); + }); + it('sums across axis=0 in 2D array, keepDims', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.sum(a, [0], true); + expect(res.shape).toEqual([1, 2]); + test_util_1.expectArraysClose(res, [4, 3]); + }); + it('sums across axis=1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.sum(a, [1]); + expect(res.shape).toEqual([3]); + test_util_1.expectArraysClose(res, [3, 3, 1]); + }); + it('2D, axis=1 provided as number', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [2, 3]); + var res = tf.sum(a, 1); + expect(res.shape).toEqual([2]); + test_util_1.expectArraysClose(res, [6, 1]); + }); + it('2D, axis = -1 provided as number', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [2, 3]); + var res = tf.sum(a, -1); + expect(res.shape).toEqual([2]); + test_util_1.expectArraysClose(res, [6, 1]); + }); + it('sums across axis=0,1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.sum(a, [0, 1]); + expect(res.shape).toEqual([]); + test_util_1.expectArraysClose(res, [7]); + }); + it('2D, axis=[-1,-2] in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.sum(a, [-1, -2]); + expect(res.shape).toEqual([]); + test_util_1.expectArraysClose(res, [7]); + }); + it('gradients: sum(2d)', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var dy = tf.scalar(10); + var gradients = tf.grad(function (a) { return a.sum(); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [10, 10, 10, 10, 10, 10]); + }); + it('gradients: sum(2d, axis=0)', function () { + var a = tf.tensor2d([[1, 2], [3, 0], [0, 1]], [3, 2]); + var dy = tf.tensor1d([10, 20]); + var axis = 0; + var gradients = tf.grad(function (a) { return a.sum(axis); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [10, 20, 10, 20, 10, 20]); + }); + it('gradients: sum(2d, axis=1)', function () { + var a = tf.tensor2d([[1, 2], [3, 0], [0, 1]], [3, 2]); + var dy = tf.tensor1d([10, 20, 30]); + var axis = 1; + var gradients = tf.grad(function (a) { return a.sum(axis); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [10, 10, 20, 20, 30, 30]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.sum({}); }) + .toThrowError(/Argument 'x' passed to 'sum' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.sum([[1, 2], [3, 0], [0, 1]]); + test_util_1.expectNumbersClose(result.get(), 7); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: mean', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var r = tf.mean(a); + expect(r.dtype).toBe('float32'); + test_util_1.expectNumbersClose(r.get(), 7 / 6); + }); + it('propagates NaNs', function () { + var a = tf.tensor2d([1, 2, 3, NaN, 0, 1], [3, 2]); + var r = tf.mean(a); + expect(r.dtype).toBe('float32'); + expect(r.get()).toEqual(NaN); + }); + it('mean(int32) => float32', function () { + var a = tf.tensor1d([1, 5, 7, 3], 'int32'); + var r = tf.mean(a); + expect(r.dtype).toBe('float32'); + test_util_1.expectNumbersClose(r.get(), 4); + }); + it('mean(bool) => float32', function () { + var a = tf.tensor1d([true, false, false, true, true], 'bool'); + var r = tf.mean(a); + expect(r.dtype).toBe('float32'); + test_util_1.expectNumbersClose(r.get(), 3 / 5); + }); + it('2D array with keep dim', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.mean(a, null, true); + expect(res.shape).toEqual([1, 1]); + expect(res.dtype).toBe('float32'); + test_util_1.expectArraysClose(res, [7 / 6]); + }); + it('axis=0 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.mean(a, [0]); + expect(res.shape).toEqual([2]); + expect(res.dtype).toBe('float32'); + test_util_1.expectArraysClose(res, [4 / 3, 1]); + }); + it('axis=0 in 2D array, keepDims', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.mean(a, [0], true); + expect(res.shape).toEqual([1, 2]); + expect(res.dtype).toBe('float32'); + test_util_1.expectArraysClose(res, [4 / 3, 1]); + }); + it('axis=1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.mean(a, [1]); + expect(res.dtype).toBe('float32'); + expect(res.shape).toEqual([3]); + test_util_1.expectArraysClose(res, [1.5, 1.5, 0.5]); + }); + it('axis = -1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.mean(a, [-1]); + expect(res.dtype).toBe('float32'); + expect(res.shape).toEqual([3]); + test_util_1.expectArraysClose(res, [1.5, 1.5, 0.5]); + }); + it('2D, axis=1 provided as number', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [2, 3]); + var res = tf.mean(a, 1); + expect(res.shape).toEqual([2]); + expect(res.dtype).toBe('float32'); + test_util_1.expectArraysClose(res, [2, 1 / 3]); + }); + it('axis=0,1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var res = tf.mean(a, [0, 1]); + expect(res.shape).toEqual([]); + expect(res.dtype).toBe('float32'); + test_util_1.expectArraysClose(res, [7 / 6]); + }); + it('gradients', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var dy = tf.scalar(1.5); + var da = tf.grad(function (a) { return a.mean(); })(a, dy); + expect(da.shape).toEqual(a.shape); + test_util_1.expectArraysClose(da, [ + dy.get() / a.size, dy.get() / a.size, dy.get() / a.size, + dy.get() / a.size, dy.get() / a.size, dy.get() / a.size + ]); + }); + it('gradients throws for defined axis', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var dy = tf.scalar(1.5); + expect(function () { return tf.grad(function (a) { return a.mean(1); })(a, dy); }).toThrowError(); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.mean({}); }) + .toThrowError(/Argument 'x' passed to 'mean' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.mean([[1, 2, 3], [0, 0, 1]]); + expect(r.dtype).toBe('float32'); + test_util_1.expectNumbersClose(r.get(), 7 / 6); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: moments', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var _a = tf.moments(a), mean = _a.mean, variance = _a.variance; + expect(mean.dtype).toBe('float32'); + expect(variance.dtype).toBe('float32'); + test_util_1.expectNumbersClose(mean.get(), 7 / 6); + test_util_1.expectNumbersClose(variance.get(), 1.1389); + }); + it('propagates NaNs', function () { + var a = tf.tensor2d([1, 2, 3, NaN, 0, 1], [3, 2]); + var _a = tf.moments(a), mean = _a.mean, variance = _a.variance; + expect(mean.dtype).toBe('float32'); + expect(variance.dtype).toBe('float32'); + expect(mean.get()).toEqual(NaN); + expect(variance.get()).toEqual(NaN); + }); + it('moments(int32) => float32', function () { + var a = tf.tensor1d([1, 5, 7, 3], 'int32'); + var _a = tf.moments(a), mean = _a.mean, variance = _a.variance; + expect(mean.dtype).toBe('float32'); + expect(variance.dtype).toBe('float32'); + test_util_1.expectNumbersClose(mean.get(), 4); + test_util_1.expectNumbersClose(variance.get(), 5); + }); + it('moments(bool) => float32', function () { + var a = tf.tensor1d([true, false, false, true, true], 'bool'); + var _a = tf.moments(a), mean = _a.mean, variance = _a.variance; + expect(mean.dtype).toBe('float32'); + expect(variance.dtype).toBe('float32'); + test_util_1.expectNumbersClose(mean.get(), 3 / 5); + test_util_1.expectNumbersClose(variance.get(), 0.23999998); + }); + it('2D array with keep dim', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var _a = tf.moments(a, null, true), mean = _a.mean, variance = _a.variance; + expect(mean.shape).toEqual([1, 1]); + expect(mean.dtype).toBe('float32'); + expect(variance.shape).toEqual([1, 1]); + expect(variance.dtype).toBe('float32'); + test_util_1.expectArraysClose(mean, [7 / 6]); + test_util_1.expectArraysClose(variance, [1.138889]); + }); + it('axis=0 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var _a = tf.moments(a, [0]), mean = _a.mean, variance = _a.variance; + expect(mean.shape).toEqual([2]); + expect(mean.dtype).toBe('float32'); + expect(variance.shape).toEqual([2]); + expect(variance.dtype).toBe('float32'); + test_util_1.expectArraysClose(mean, [4 / 3, 1]); + test_util_1.expectArraysClose(variance, [1.556, 2 / 3]); + }); + it('axis=1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var _a = tf.moments(a, [1]), mean = _a.mean, variance = _a.variance; + expect(mean.dtype).toBe('float32'); + expect(mean.shape).toEqual([3]); + expect(variance.dtype).toBe('float32'); + expect(variance.shape).toEqual([3]); + test_util_1.expectArraysClose(mean, [1.5, 1.5, 0.5]); + test_util_1.expectArraysClose(variance, [0.25, 2.25, 0.25]); + }); + it('2D, axis=1 provided as number', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [2, 3]); + var _a = tf.moments(a, 1), mean = _a.mean, variance = _a.variance; + expect(mean.shape).toEqual([2]); + expect(mean.dtype).toBe('float32'); + expect(variance.shape).toEqual([2]); + expect(variance.dtype).toBe('float32'); + test_util_1.expectArraysClose(mean, [2, 1 / 3]); + test_util_1.expectArraysClose(variance, [2 / 3, 0.222]); + }); + it('2D, axis=-1 provided as number', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [2, 3]); + var _a = tf.moments(a, -1), mean = _a.mean, variance = _a.variance; + expect(mean.shape).toEqual([2]); + expect(mean.dtype).toBe('float32'); + expect(variance.shape).toEqual([2]); + expect(variance.dtype).toBe('float32'); + test_util_1.expectArraysClose(mean, [2, 1 / 3]); + test_util_1.expectArraysClose(variance, [2 / 3, 0.222]); + }); + it('axis=0,1 in 2D array', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var _a = tf.moments(a, [0, 1]), mean = _a.mean, variance = _a.variance; + expect(mean.shape).toEqual([]); + expect(mean.dtype).toBe('float32'); + expect(variance.shape).toEqual([]); + expect(variance.dtype).toBe('float32'); + test_util_1.expectArraysClose(mean, [7 / 6]); + test_util_1.expectArraysClose(variance, [1.1389]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.moments({}); }) + .toThrowError(/Argument 'x' passed to 'moments' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var _a = tf.moments([1, 2, 3, 0, 0, 1]), mean = _a.mean, variance = _a.variance; + expect(mean.dtype).toBe('float32'); + expect(variance.dtype).toBe('float32'); + test_util_1.expectNumbersClose(mean.get(), 7 / 6); + test_util_1.expectNumbersClose(variance.get(), 1.1389); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: norm', test_util_1.ALL_ENVS, function () { + it('scalar norm', function () { + var a = tf.scalar(-22.0); + var norm = tf.norm(a); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 22); + }); + it('vector inf norm', function () { + var a = tf.tensor1d([1, -2, 3, -4]); + var norm = tf.norm(a, Infinity); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 4); + }); + it('vector -inf norm', function () { + var a = tf.tensor1d([1, -2, 3, -4]); + var norm = tf.norm(a, -Infinity); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 1); + }); + it('vector 1 norm', function () { + var a = tf.tensor1d([1, -2, 3, -4]); + var norm = tf.norm(a, 1); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 10); + }); + it('vector euclidean norm', function () { + var a = tf.tensor1d([1, -2, 3, -4]); + var norm = tf.norm(a, 'euclidean'); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 5.4772); + }); + it('vector 2-norm', function () { + var a = tf.tensor1d([1, -2, 3, -4]); + var norm = tf.norm(a, 2); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 5.4772); + }); + it('vector >2-norm to throw error', function () { + var a = tf.tensor1d([1, -2, 3, -4]); + expect(function () { return tf.norm(a, 3); }).toThrowError(); + }); + it('matrix inf norm', function () { + var a = tf.tensor2d([1, 2, -3, 1, 0, 1], [3, 2]); + var norm = tf.norm(a, Infinity, [0, 1]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 4); + }); + it('matrix -inf norm', function () { + var a = tf.tensor2d([1, 2, -3, 1, 0, 1], [3, 2]); + var norm = tf.norm(a, -Infinity, [0, 1]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 1); + }); + it('matrix 1 norm', function () { + var a = tf.tensor2d([1, 2, -3, 1, 1, 1], [3, 2]); + var norm = tf.norm(a, 1, [0, 1]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 5); + }); + it('matrix euclidean norm', function () { + var a = tf.tensor2d([1, 2, -3, 1, 1, 1], [3, 2]); + var norm = tf.norm(a, 'euclidean', [0, 1]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 4.123); + }); + it('matrix fro norm', function () { + var a = tf.tensor2d([1, 2, -3, 1, 1, 1], [3, 2]); + var norm = tf.norm(a, 'fro', [0, 1]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 4.123); + }); + it('matrix other norm to throw error', function () { + var a = tf.tensor2d([1, 2, -3, 1, 1, 1], [3, 2]); + expect(function () { return tf.norm(a, 2, [0, 1]); }).toThrowError(); + }); + it('propagates NaNs for norm', function () { + var a = tf.tensor2d([1, 2, 3, NaN, 0, 1], [3, 2]); + var norm = tf.norm(a); + expect(norm.dtype).toBe('float32'); + expect(norm.get()).toEqual(NaN); + }); + it('axis=null in 2D array norm', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var norm = tf.norm(a, Infinity); + expect(norm.shape).toEqual([]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [3]); + }); + it('2D array norm with keep dim', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var norm = tf.norm(a, Infinity, null, true); + expect(norm.shape).toEqual([1, 1]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [3]); + }); + it('axis=0 in 2D array norm', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var norm = tf.norm(a, Infinity, [0]); + expect(norm.shape).toEqual([2]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [3, 2]); + }); + it('axis=1 in 2D array norm', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var norm = tf.norm(a, Infinity, [1]); + expect(norm.dtype).toBe('float32'); + expect(norm.shape).toEqual([3]); + test_util_1.expectArraysClose(norm, [2, 3, 1]); + }); + it('axis=1 keepDims in 2D array norm', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var norm = tf.norm(a, Infinity, [1], true); + expect(norm.dtype).toBe('float32'); + expect(norm.shape).toEqual([3, 1]); + test_util_1.expectArraysClose(norm, [2, 3, 1]); + }); + it('2D norm with axis=1 provided as number', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [2, 3]); + var norm = tf.norm(a, Infinity, 1); + expect(norm.shape).toEqual([2]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [3, 1]); + }); + it('axis=0,1 in 2D array norm', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var norm = tf.norm(a, Infinity, [0, 1]); + expect(norm.shape).toEqual([]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [3]); + }); + it('axis=0,1 keepDims in 2D array norm', function () { + var a = tf.tensor2d([1, 2, 3, 0, 0, 1], [3, 2]); + var norm = tf.norm(a, Infinity, [0, 1], true); + expect(norm.shape).toEqual([1, 1]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [3]); + }); + it('3D norm axis=0,1, matrix inf norm', function () { + var a = tf.tensor3d([1, 2, -3, 1, 0, 1], [3, 2, 1]); + var norm = tf.norm(a, Infinity, [0, 1]); + expect(norm.shape).toEqual([1]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [4]); + }); + it('axis=0,1 keepDims in 3D array norm', function () { + var a = tf.tensor3d([1, 2, 3, 0, 0, 1], [3, 2, 1]); + var norm = tf.norm(a, Infinity, [0, 1], true); + expect(norm.shape).toEqual([1, 1, 1]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [3]); + }); + it('axis=0,1 keepDims in 3D array norm', function () { + var a = tf.tensor3d([1, 2, 3, 0, 0, 1, 1, 2, 3, 0, 0, 1], [3, 2, 2]); + var norm = tf.norm(a, Infinity, [0, 1], true); + expect(norm.shape).toEqual([1, 1, 2]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [4, 3]); + }); + it('axis=null in 3D array norm', function () { + var a = tf.tensor3d([1, 2, 3, 0, 0, 1], [3, 2, 1]); + var norm = tf.norm(a, Infinity); + expect(norm.shape).toEqual([]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [3]); + }); + it('axis=null in 4D array norm', function () { + var a = tf.tensor4d([1, 2, 3, 0, 0, 1], [3, 2, 1, 1]); + var norm = tf.norm(a, Infinity); + expect(norm.shape).toEqual([]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [3]); + }); + it('axis=0,1 in 4D array norm', function () { + var a = tf.tensor4d([ + 1, 2, 3, 0, 0, 1, 1, 2, 3, 0, 0, 1, + 1, 2, 3, 0, 0, 1, 1, 2, 3, 0, 0, 1 + ], [3, 2, 2, 2]); + var norm = tf.norm(a, Infinity, [0, 1]); + expect(norm.shape).toEqual([2, 2]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [4, 3, 4, 3]); + }); + it('axis=0,1 in 4D array norm', function () { + var a = tf.tensor4d([ + 1, 2, 3, 0, 0, 1, 1, 2, 3, 0, 0, 1, + 1, 2, 3, 0, 0, 1, 1, 2, 3, 0, 0, 1 + ], [3, 2, 2, 2]); + var norm = tf.norm(a, Infinity, [0, 1], true); + expect(norm.shape).toEqual([1, 1, 2, 2]); + expect(norm.dtype).toBe('float32'); + test_util_1.expectArraysClose(norm, [4, 3, 4, 3]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.norm({}); }) + .toThrowError(/Argument 'x' passed to 'norm' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var norm = tf.norm([1, -2, 3, -4], 1); + expect(norm.dtype).toBe('float32'); + test_util_1.expectNumbersClose(norm.get(), 10); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: all', test_util_1.ALL_ENVS, function () { + it('Tensor1D', function () { + var a = tf.tensor1d([0, 0, 0], 'bool'); + test_util_1.expectNumbersClose(tf.all(a).get(), 0); + a = tf.tensor1d([1, 0, 1], 'bool'); + test_util_1.expectNumbersClose(tf.all(a).get(), 0); + a = tf.tensor1d([1, 1, 1], 'bool'); + test_util_1.expectNumbersClose(tf.all(a).get(), 1); + }); + it('ignores NaNs', function () { + var a = tf.tensor1d([1, NaN, 1], 'bool'); + expect(tf.all(a).get()).toEqual(1); + }); + it('2D', function () { + var a = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); + test_util_1.expectNumbersClose(tf.all(a).get(), 0); + }); + it('2D axis=[0,1]', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + test_util_1.expectNumbersClose(tf.all(a, [0, 1]).get(), 0); + }); + it('2D, axis=0', function () { + var a = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); + var r = tf.all(a, 0); + expect(r.shape).toEqual([2]); + test_util_1.expectArraysClose(r, [0, 0]); + r = tf.all(a, 1); + expect(r.shape).toEqual([2]); + test_util_1.expectArraysClose(r, [1, 0]); + }); + it('2D, axis=0, keepDims', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + var r = a.all(0, true); + expect(r.shape).toEqual([1, 3]); + test_util_1.expectArraysClose(r, [0, 1, 0]); + }); + it('2D, axis=1 provided as a number', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + var r = tf.all(a, 1); + test_util_1.expectArraysClose(r, [0, 0]); + }); + it('2D, axis = -1 provided as a number', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + var r = tf.all(a, -1); + test_util_1.expectArraysClose(r, [0, 0]); + }); + it('2D, axis=[1]', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + var r = tf.all(a, [1]); + test_util_1.expectArraysClose(r, [0, 0]); + }); + it('throws when dtype is not boolean', function () { + var a = tf.tensor2d([1, 1, 0, 0], [2, 2]); + expect(function () { return tf.all(a); }).toThrowError(/Error Tensor must be of type bool/); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.all({}); }) + .toThrowError(/Argument 'x' passed to 'all' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [0, 0, 0]; + test_util_1.expectNumbersClose(tf.all(a).get(), 0); + }); +}); +jasmine_util_1.describeWithFlags('Reduction: any', test_util_1.ALL_ENVS, function () { + it('Tensor1D', function () { + var a = tf.tensor1d([0, 0, 0], 'bool'); + test_util_1.expectNumbersClose(tf.any(a).get(), 0); + a = tf.tensor1d([1, 0, 1], 'bool'); + test_util_1.expectNumbersClose(tf.any(a).get(), 1); + a = tf.tensor1d([1, 1, 1], 'bool'); + test_util_1.expectNumbersClose(tf.any(a).get(), 1); + }); + it('ignores NaNs', function () { + var a = tf.tensor1d([1, NaN, 0], 'bool'); + expect(tf.any(a).get()).toEqual(1); + }); + it('2D', function () { + var a = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); + test_util_1.expectNumbersClose(tf.any(a).get(), 1); + }); + it('2D axis=[0,1]', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + test_util_1.expectNumbersClose(tf.any(a, [0, 1]).get(), 1); + }); + it('2D, axis=0', function () { + var a = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); + var r = tf.any(a, 0); + expect(r.shape).toEqual([2]); + test_util_1.expectArraysClose(r, [1, 1]); + r = tf.any(a, 1); + expect(r.shape).toEqual([2]); + test_util_1.expectArraysClose(r, [1, 0]); + }); + it('2D, axis=0, keepDims', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + var r = a.any(0, true); + expect(r.shape).toEqual([1, 3]); + test_util_1.expectArraysClose(r, [1, 1, 0]); + }); + it('2D, axis=1 provided as a number', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + var r = tf.any(a, 1); + test_util_1.expectArraysClose(r, [1, 1]); + }); + it('2D, axis = -1 provided as a number', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + var r = tf.any(a, -1); + test_util_1.expectArraysClose(r, [1, 1]); + }); + it('2D, axis=[1]', function () { + var a = tf.tensor2d([1, 1, 0, 0, 1, 0], [2, 3], 'bool'); + var r = tf.any(a, [1]); + test_util_1.expectArraysClose(r, [1, 1]); + }); + it('throws when dtype is not boolean', function () { + var a = tf.tensor2d([1, 1, 0, 0], [2, 2]); + expect(function () { return tf.any(a); }).toThrowError(/Error Tensor must be of type bool/); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.any({}); }) + .toThrowError(/Argument 'x' passed to 'any' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [0, 0, 0]; + test_util_1.expectNumbersClose(tf.any(a).get(), 0); + }); +}); +//# sourceMappingURL=reduction_ops_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops_test.js.map new file mode 100644 index 0000000..39242a2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reduction_ops_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reduction_ops_test.js","sourceRoot":"","sources":["../../src/ops/reduction_ops_test.ts"],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s-core/dist/ops/relu_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/relu_ops.d.ts new file mode 100644 index 0000000..4abc49f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/relu_ops.d.ts @@ -0,0 +1,13 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function relu_(x: T | TensorLike): T; +declare function elu_(x: T | TensorLike): T; +declare function selu_(x: T | TensorLike): T; +declare function leakyRelu_(x: T | TensorLike, alpha?: number): T; +declare function prelu_(x: T | TensorLike, alpha: T | TensorLike): T; +export declare const elu: typeof elu_; +export declare const leakyRelu: typeof leakyRelu_; +export declare const prelu: typeof prelu_; +export declare const relu: typeof relu_; +export declare const selu: typeof selu_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/relu_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/relu_ops.js new file mode 100644 index 0000000..d33deef --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/relu_ops.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var binary_ops_1 = require("./binary_ops"); +var logical_ops_1 = require("./logical_ops"); +var operation_1 = require("./operation"); +var selu_util_1 = require("./selu_util"); +var tensor_ops_1 = require("./tensor_ops"); +function relu_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'relu'); + if ($x.dtype === 'bool') { + return $x.toInt(); + } + var grad = function (dy) { + var stepRes = $x.step(); + return { $x: function () { return dy.mulStrict(stepRes.toFloat()); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.relu($x); }, { $x: $x }, grad); +} +function elu_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'elu'); + var grad = function (dy, saved) { + var y = saved[0]; + return { + $x: function () { + return environment_1.ENV.engine.runKernel(function (backend) { return backend.eluDer(dy, y); }, { dy: dy, y: y }); + } + }; + }; + return environment_1.ENV.engine.runKernel(function (backend, save) { return save(backend.elu($x)); }, { $x: $x }, grad); +} +function selu_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'selu'); + var grad = function (dy) { + return { + $x: function () { + var mask = $x.greater(tensor_ops_1.scalar(0)); + var scaleAlpha = tensor_ops_1.scalar(selu_util_1.SELU_SCALEALPHA); + var scale = tensor_ops_1.scalar(selu_util_1.SELU_SCALE); + var greaterThanZeroDer = dy.mul(scale); + var lessEqualZeroDer = dy.mul(scaleAlpha).mul($x.toFloat().exp()); + return logical_ops_1.where(mask, greaterThanZeroDer, lessEqualZeroDer); + } + }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.selu($x); }, { $x: $x }, grad); +} +function leakyRelu_(x, alpha) { + if (alpha === void 0) { alpha = 0.2; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'leakyRelu'); + return binary_ops_1.maximum(tensor_ops_1.scalar(alpha).mul($x), $x); +} +function prelu_(x, alpha) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'prelu'); + var $alpha = tensor_util_env_1.convertToTensor(alpha, 'alpha', 'prelu'); + var zero = tensor_ops_1.scalar(0); + return binary_ops_1.maximum(zero, $x).add($alpha.mul(binary_ops_1.minimum(zero, $x))); +} +exports.elu = operation_1.op({ elu_: elu_ }); +exports.leakyRelu = operation_1.op({ leakyRelu_: leakyRelu_ }); +exports.prelu = operation_1.op({ prelu_: prelu_ }); +exports.relu = operation_1.op({ relu_: relu_ }); +exports.selu = operation_1.op({ selu_: selu_ }); +//# sourceMappingURL=relu_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/relu_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/relu_ops.js.map new file mode 100644 index 0000000..4041d22 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/relu_ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"relu_ops.js","sourceRoot":"","sources":["../../src/ops/relu_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,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC;AAiBD,gBAAkC,CAAe,EAAE,KAAmB;IACpE,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,IAAM,MAAM,GAAG,iCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAExD,IAAM,IAAI,GAAG,mBAAM,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,oBAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAEY,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,KAAK,GAAG,cAAE,CAAC,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACrB,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;AACnB,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/resize_bilinear_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_bilinear_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_bilinear_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/resize_bilinear_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_bilinear_test.js new file mode 100644 index 0000000..440ac9d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_bilinear_test.js @@ -0,0 +1,678 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('resizeBilinear', test_util_1.ALL_ENVS, function () { + it('simple alignCorners=false', function () { + var input = tf.tensor3d([2, 2, 4, 4], [2, 2, 1]); + var output = input.resizeBilinear([3, 3], false); + test_util_1.expectArraysClose(output, [2, 2, 2, 10 / 3, 10 / 3, 10 / 3, 4, 4, 4]); + }); + it('simple alignCorners=true', function () { + var input = tf.tensor3d([2, 2, 4, 4], [2, 2, 1]); + var output = input.resizeBilinear([3, 3], true); + test_util_1.expectArraysClose(output, [2, 2, 2, 3, 3, 3, 4, 4, 4]); + }); + it('matches tensorflow w/ random numbers alignCorners=false', function () { + var input = tf.tensor3d([ + 1.19074044, 0.91373104, 2.01611669, -0.52270832, 0.38725395, + 1.30809779, 0.61835143, 3.49600659, 2.09230986, 0.56473997, + 0.03823943, 1.19864896 + ], [2, 3, 2]); + var output = input.resizeBilinear([4, 5], false); + test_util_1.expectArraysClose(output, [ + 1.19074047, 0.91373104, 1.68596613, 0.05186744, 1.69034398, -0.15654698, + 0.7130264, 0.94193673, 0.38725394, 1.30809784, 0.9045459, 2.20486879, + 1.59434628, 0.89455694, 1.68591988, 0.26748738, 0.58103991, 1.00690198, + 0.21274668, 1.25337338, 0.6183514, 3.49600649, 1.50272655, 1.73724651, + 1.68149579, 0.69152176, 0.44905344, 1.07186723, 0.03823943, 1.19864893, + 0.6183514, 3.49600649, 1.50272655, 1.73724651, 1.68149579, 0.69152176, + 0.44905344, 1.07186723, 0.03823943, 1.19864893 + ]); + }); + it('matches tensorflow w/ random numbers alignCorners=true', function () { + var input = tf.tensor3d([ + 1.56324531, 2.13817752, 1.44398421, 1.07632684, 0.59306785, + -0.36970865, 1.62451879, 1.8367334, 1.13944798, 2.01993218, + 2.01919952, 2.67524054 + ], [2, 3, 2]); + var output = input.resizeBilinear([4, 5], true); + test_util_1.expectArraysClose(output, [ + 1.5632453, 2.13817763, 1.50361478, 1.60725224, 1.44398427, 1.07632685, + 1.01852608, 0.35330909, 0.59306782, -0.36970866, 1.58366978, 2.03769612, + 1.46307099, 1.71427906, 1.3424722, 1.39086199, 1.20545864, 1.01806819, + 1.06844509, 0.6452744, 1.60409427, 1.93721485, 1.42252707, 1.82130599, + 1.24096, 1.70539713, 1.3923912, 1.68282723, 1.54382229, 1.66025746, + 1.62451875, 1.83673346, 1.38198328, 1.92833281, 1.13944793, 2.01993227, + 1.57932377, 2.34758639, 2.01919961, 2.67524052 + ]); + }); + it('batch of 2, simple, alignCorners=true', function () { + var input = tf.tensor4d([2, 2, 4, 4, 3, 3, 5, 5], [2, 2, 2, 1]); + var output = input.resizeBilinear([3, 3], true); + test_util_1.expectArraysClose(output, [2, 2, 2, 3, 3, 3, 4, 4, 4, 3, 3, 3, 4, 4, 4, 5, 5, 5]); + }); + it('target width = 1, alignCorners=true', function () { + var input = tf.tensor3d([ + [ + [120.68856811523438, 134.51638793945312, 83.03671264648438], + [121.58008575439453, 113.28836059570312, 136.3172149658203], + [79.38370513916016, 101.87127685546875, 104.54979705810547], + [96.31678771972656, 111.77168273925781, 83.73509979248047] + ], + [ + [119.45088195800781, 88.98846435546875, 97.47553253173828], + [117.5562973022461, 108.26356506347656, 99.62212371826172], + [136.62701416015625, 94.10433197021484, 80.97366333007812], + [83.61205291748047, 90.60148620605469, 81.82512664794922] + ], + [ + [103.0362777709961, 123.1098403930664, 125.62944030761719], + [92.2915267944336, 103.15729522705078, 119.18060302734375], + [102.93293762207031, 117.821044921875, 99.40152740478516], + [96.32952117919922, 105.80963134765625, 104.8491439819336] + ], + [ + [104.87507629394531, 134.0189208984375, 111.02627563476562], + [85.4534683227539, 107.68426513671875, 103.03722381591797], + [89.70533752441406, 98.25298309326172, 78.42916870117188], + [113.6744613647461, 95.8189697265625, 122.75005340576172] + ] + ]); + var output = input.resizeBilinear([3, 1], true); + var expected = tf.tensor3d([ + [[120.68857, 134.51639, 83.03671]], + [[111.243576, 106.04915, 111.55249]], + [[104.87508, 134.01892, 111.026276]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('target height = 1, alignCorners=true', function () { + var input = tf.tensor3d([ + [ + [120.68856811523438, 134.51638793945312, 83.03671264648438], + [121.58008575439453, 113.28836059570312, 136.3172149658203], + [79.38370513916016, 101.87127685546875, 104.54979705810547], + [96.31678771972656, 111.77168273925781, 83.73509979248047] + ], + [ + [119.45088195800781, 88.98846435546875, 97.47553253173828], + [117.5562973022461, 108.26356506347656, 99.62212371826172], + [136.62701416015625, 94.10433197021484, 80.97366333007812], + [83.61205291748047, 90.60148620605469, 81.82512664794922] + ], + [ + [103.0362777709961, 123.1098403930664, 125.62944030761719], + [92.2915267944336, 103.15729522705078, 119.18060302734375], + [102.93293762207031, 117.821044921875, 99.40152740478516], + [96.32952117919922, 105.80963134765625, 104.8491439819336] + ], + [ + [104.87507629394531, 134.0189208984375, 111.02627563476562], + [85.4534683227539, 107.68426513671875, 103.03722381591797], + [89.70533752441406, 98.25298309326172, 78.42916870117188], + [113.6744613647461, 95.8189697265625, 122.75005340576172] + ] + ]); + var output = input.resizeBilinear([1, 3], true); + var expected = tf.tensor3d([[ + [120.68857, 134.51639, 83.03671], + [100.481895, 107.57982, 120.4335], + [96.31679, 111.77168, 83.7351] + ]]); + test_util_1.expectArraysClose(output, expected); + }); + it('throws when passed a non-tensor', function () { + var e = /Argument 'images' passed to 'resizeBilinear' must be a Tensor/; + expect(function () { return tf.image.resizeBilinear({}, [ + 1, 1 + ]); }).toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var input = [[[2], [2]], [[4], [4]]]; + var output = tf.image.resizeBilinear(input, [3, 3], false); + test_util_1.expectArraysClose(output, [2, 2, 2, 10 / 3, 10 / 3, 10 / 3, 4, 4, 4]); + }); +}); +jasmine_util_1.describeWithFlags('resizeBilinear gradients', test_util_1.ALL_ENVS, function () { + it('greyscale: upscale, same aspect ratio', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0]], [[5.0], [6.0], [7.0], [8.0]], + [[9.0], [10.0], [11.0], [12.0]], [[13.0], [14.0], [15.0], [16.0]] + ]); + var size = [4, 4]; + var alignCorners = false; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([[[6.0], [17.0]], [[38.0], [75.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, same aspect ratio, align corners', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0]], [[5.0], [6.0], [7.0], [8.0]], + [[9.0], [10.0], [11.0], [12.0]], [[13.0], [14.0], [15.0], [16.0]] + ]); + var size = [4, 4]; + var alignCorners = true; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[17.333330154418945], [23.999998092651367]], + [[44.0], [50.66666793823242]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, taller than wider', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0]], [[5.0], [6.0], [7.0], [8.0]], + [[9.0], [10.0], [11.0], [12.0]], [[13.0], [14.0], [15.0], [16.0]], + [[17.0], [18.0], [19.0], [20.0]], [[21.0], [22.0], [23.0], [24.0]], + [[25.0], [26.0], [27.0], [28.0]], [[29.0], [30.0], [31.0], [32.0]], + [[33.0], [34.0], [35.0], [36.0]] + ]); + var size = [9, 4]; + var alignCorners = false; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[25.55555534362793], [55.5555534362793]], + [[208.44444274902344], [376.4444274902344]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, taller than wider, align corners', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0]], [[5.0], [6.0], [7.0], [8.0]], + [[9.0], [10.0], [11.0], [12.0]], [[13.0], [14.0], [15.0], [16.0]], + [[17.0], [18.0], [19.0], [20.0]], [[21.0], [22.0], [23.0], [24.0]], + [[25.0], [26.0], [27.0], [28.0]], [[29.0], [30.0], [31.0], [32.0]], + [[33.0], [34.0], [35.0], [36.0]] + ]); + var size = [9, 4]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[99.0], [114.0]], [[219.00001525878906], [233.99998474121094]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, wider than taller', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0], [7.0]], + [[8.0], [9.0], [10.0], [11.0], [12.0], [13.0], [14.0]], + [[15.0], [16.0], [17.0], [18.0], [19.0], [20.0], [21.0]], + [[22.0], [23.0], [24.0], [25.0], [26.0], [27.0], [28.0]] + ]); + var size = [4, 7]; + var alignCorners = false; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[14.428570747375488], [52.07142639160156]], + [[98.71427917480469], [240.78573608398438]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, wider than taller, align corners', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0], [7.0]], + [[8.0], [9.0], [10.0], [11.0], [12.0], [13.0], [14.0]], + [[15.0], [16.0], [17.0], [18.0], [19.0], [20.0], [21.0]], + [[22.0], [23.0], [24.0], [25.0], [26.0], [27.0], [28.0]] + ]); + var size = [4, 7]; + var alignCorners = true; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([[[51.33332824707031], [70.0]], [[133.0], [151.66668701171875]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, same aspect ratio', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + var size = [2, 2]; + var alignCorners = false; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [0.0], [2.0], [0.0]], [[0.0], [0.0], [0.0], [0.0]], + [[3.0], [0.0], [4.0], [0.0]], [[0.0], [0.0], [0.0], [0.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, same aspect ratio, align corners', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + var size = [2, 2]; + var alignCorners = true; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [0.0], [0.0], [2.0]], [[0.0], [0.0], [0.0], [0.0]], + [[0.0], [0.0], [0.0], [0.0]], [[3.0], [0.0], [0.0], [4.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, taller than wider', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]], [[5.0], [6.0]]]); + var size = [3, 2]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [0.0], [2.0], [0.0]], + [[1.9999998807907104], [0.0], [2.6666665077209473], [0.0]], + [[2.6666665077209473], [0.0], [3.3333330154418945], [0.0]], + [[3.333333730697632], [0.0], [4.000000476837158], [0.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, taller than wider, align corners', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]], [[5.0], [6.0]]]); + var size = [3, 2]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [0.0], [0.0], [2.0]], [[1.5], [0.0], [0.0], [2.0]], + [[1.5], [0.0], [0.0], [2.0]], [[5.0], [0.0], [0.0], [6.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, wider than taller', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0], [3.0]], [[4.0], [5.0], [6.0]]]); + var size = [2, 3]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [1.3333332538604736], [1.6666665077209473], [2.000000238418579]], + [[0.0], [0.0], [0.0], [0.0]], + [[4.0], [3.3333330154418945], [3.6666665077209473], [4.000000476837158]], + [[0.0], [0.0], [0.0], [0.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, wider than taller, align corners', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0], [3.0]], [[4.0], [5.0], [6.0]]]); + var size = [2, 3]; + var alignCorners = true; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [1.0], [1.0], [3.0]], [[0.0], [0.0], [0.0], [0.0]], + [[0.0], [0.0], [0.0], [0.0]], [[4.0], [2.5], [2.5], [6.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: same size', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + var size = [2, 2]; + var alignCorners = false; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: same size, align corners', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + var size = [2, 2]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: upscale, wider than taller', function () { + var input = tf.tensor3d([ + [ + [115.11029815673828, 111.90936279296875, 66.87433624267578], + [72.03849029541016, 81.86637878417969, 119.53585815429688] + ], + [ + [68.555419921875, 97.49642181396484, 116.90741729736328], + [128.69467163085938, 86.78314208984375, 104.3116683959961] + ] + ]); + var dy = tf.tensor3d([ + [ + [1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0], [10.0, 11.0, 12.0], + [13.0, 14.0, 15.0] + ], + [ + [16.0, 17.0, 18.0], [19.0, 20.0, 21.0], [22.0, 23.0, 24.0], + [25.0, 26.0, 27.0], [28.0, 29.0, 30.0] + ], + [ + [31.0, 32.0, 33.0], [34.0, 35.0, 36.0], [37.0, 38.0, 39.0], + [40.0, 41.0, 42.0], [43.0, 44.0, 45.0] + ] + ]); + var size = [3, 5]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [ + [15.399999618530273, 17.799999237060547, 20.19999885559082], + [56.26666259765625, 60.533329010009766, 64.79999542236328] + ], + [ + [80.00000762939453, 83.0, 86.0], + [178.33334350585938, 183.66668701171875, 189.00001525878906] + ] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: upscale, wider than taller, align corners', function () { + var input = tf.tensor3d([ + [ + [115.11029815673828, 111.90936279296875, 66.87433624267578], + [72.03849029541016, 81.86637878417969, 119.53585815429688] + ], + [ + [68.555419921875, 97.49642181396484, 116.90741729736328], + [128.69467163085938, 86.78314208984375, 104.3116683959961] + ] + ]); + var dy = tf.tensor3d([ + [ + [1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0], [10.0, 11.0, 12.0], + [13.0, 14.0, 15.0] + ], + [ + [16.0, 17.0, 18.0], [19.0, 20.0, 21.0], [22.0, 23.0, 24.0], + [25.0, 26.0, 27.0], [28.0, 29.0, 30.0] + ], + [ + [31.0, 32.0, 33.0], [34.0, 35.0, 36.0], [37.0, 38.0, 39.0], + [40.0, 41.0, 42.0], [43.0, 44.0, 45.0] + ] + ]); + var size = [3, 5]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[33.75, 37.5, 41.25], [56.25, 60.0, 63.75]], + [[108.75, 112.5, 116.25], [131.25, 135.0, 138.75]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: downscale, taller than wider', function () { + var input = tf.tensor3d([ + [ + [120.68856811523438, 134.51638793945312, 83.03671264648438], + [121.58008575439453, 113.28836059570312, 136.3172149658203], + [79.38370513916016, 101.87127685546875, 104.54979705810547], + [96.31678771972656, 111.77168273925781, 83.73509979248047] + ], + [ + [119.45088195800781, 88.98846435546875, 97.47553253173828], + [117.5562973022461, 108.26356506347656, 99.62212371826172], + [136.62701416015625, 94.10433197021484, 80.97366333007812], + [83.61205291748047, 90.60148620605469, 81.82512664794922] + ], + [ + [103.0362777709961, 123.1098403930664, 125.62944030761719], + [92.2915267944336, 103.15729522705078, 119.18060302734375], + [102.93293762207031, 117.821044921875, 99.40152740478516], + [96.32952117919922, 105.80963134765625, 104.8491439819336] + ], + [ + [104.87507629394531, 134.0189208984375, 111.02627563476562], + [85.4534683227539, 107.68426513671875, 103.03722381591797], + [89.70533752441406, 98.25298309326172, 78.42916870117188], + [113.6744613647461, 95.8189697265625, 122.75005340576172] + ] + ]); + var dy = tf.tensor3d([[[1.0, 2.0, 3.0]], [[4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0]]]); + var size = [3, 1]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0, 2.0, 3.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [ + [2.6666665077209473, 3.3333330154418945, 3.999999761581421], + [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0] + ], + [ + [3.666666269302368, 4.3333330154418945, 4.999999523162842], + [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0] + ], + [ + [4.6666669845581055, 5.333333969116211, 6.000000953674316], + [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0] + ] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: downscale, width = 1, align corners', function () { + var input = tf.tensor3d([ + [ + [120.68856811523438, 134.51638793945312, 83.03671264648438], + [121.58008575439453, 113.28836059570312, 136.3172149658203], + [79.38370513916016, 101.87127685546875, 104.54979705810547], + [96.31678771972656, 111.77168273925781, 83.73509979248047] + ], + [ + [119.45088195800781, 88.98846435546875, 97.47553253173828], + [117.5562973022461, 108.26356506347656, 99.62212371826172], + [136.62701416015625, 94.10433197021484, 80.97366333007812], + [83.61205291748047, 90.60148620605469, 81.82512664794922] + ], + [ + [103.0362777709961, 123.1098403930664, 125.62944030761719], + [92.2915267944336, 103.15729522705078, 119.18060302734375], + [102.93293762207031, 117.821044921875, 99.40152740478516], + [96.32952117919922, 105.80963134765625, 104.8491439819336] + ], + [ + [104.87507629394531, 134.0189208984375, 111.02627563476562], + [85.4534683227539, 107.68426513671875, 103.03722381591797], + [89.70533752441406, 98.25298309326172, 78.42916870117188], + [113.6744613647461, 95.8189697265625, 122.75005340576172] + ] + ]); + var dy = tf.tensor3d([[[1.0, 2.0, 3.0]], [[4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0]]]); + var size = [3, 1]; + var alignCorners = true; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0, 2.0, 3.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [[2.0, 2.5, 3.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [[2.0, 2.5, 3.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [[7.0, 8.0, 9.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: downscale, height = 1, align corners', function () { + var input = tf.tensor3d([ + [ + [120.68856811523438, 134.51638793945312, 83.03671264648438], + [121.58008575439453, 113.28836059570312, 136.3172149658203], + [79.38370513916016, 101.87127685546875, 104.54979705810547], + [96.31678771972656, 111.77168273925781, 83.73509979248047] + ], + [ + [119.45088195800781, 88.98846435546875, 97.47553253173828], + [117.5562973022461, 108.26356506347656, 99.62212371826172], + [136.62701416015625, 94.10433197021484, 80.97366333007812], + [83.61205291748047, 90.60148620605469, 81.82512664794922] + ], + [ + [103.0362777709961, 123.1098403930664, 125.62944030761719], + [92.2915267944336, 103.15729522705078, 119.18060302734375], + [102.93293762207031, 117.821044921875, 99.40152740478516], + [96.32952117919922, 105.80963134765625, 104.8491439819336] + ], + [ + [104.87507629394531, 134.0189208984375, 111.02627563476562], + [85.4534683227539, 107.68426513671875, 103.03722381591797], + [89.70533752441406, 98.25298309326172, 78.42916870117188], + [113.6744613647461, 95.8189697265625, 122.75005340576172] + ] + ]); + var dy = tf.tensor3d([[[1., 2., 3.], [4., 5., 6.], [7., 8., 9.]]]); + var size = [1, 3]; + var alignCorners = true; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1., 2., 3.], [2., 2.5, 3.], [2., 2.5, 3.], [7., 8., 9.]], + [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.], [0., 0., 0.]], + [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.], [0., 0., 0.]], + [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.], [0., 0., 0.]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: downscale, taller than wider, align corners', function () { + var input = tf.tensor3d([ + [ + [120.68856811523438, 134.51638793945312, 83.03671264648438], + [121.58008575439453, 113.28836059570312, 136.3172149658203], + [79.38370513916016, 101.87127685546875, 104.54979705810547], + [96.31678771972656, 111.77168273925781, 83.73509979248047] + ], + [ + [119.45088195800781, 88.98846435546875, 97.47553253173828], + [117.5562973022461, 108.26356506347656, 99.62212371826172], + [136.62701416015625, 94.10433197021484, 80.97366333007812], + [83.61205291748047, 90.60148620605469, 81.82512664794922] + ], + [ + [103.0362777709961, 123.1098403930664, 125.62944030761719], + [92.2915267944336, 103.15729522705078, 119.18060302734375], + [102.93293762207031, 117.821044921875, 99.40152740478516], + [96.32952117919922, 105.80963134765625, 104.8491439819336] + ], + [ + [104.87507629394531, 134.0189208984375, 111.02627563476562], + [85.4534683227539, 107.68426513671875, 103.03722381591797], + [89.70533752441406, 98.25298309326172, 78.42916870117188], + [113.6744613647461, 95.8189697265625, 122.75005340576172] + ] + ]); + var dy = tf.tensor3d([ + [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]], + [[13.0, 14.0, 15.0], [16.0, 17.0, 18.0]] + ]); + var size = [3, 2]; + var alignCorners = true; + var g = tf.grad(function (i) { return tf.image.resizeBilinear(i, size, alignCorners); }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0, 2.0, 3.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [4.0, 5.0, 6.0]], + [[3.5, 4.0, 4.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [5.0, 5.5, 6.0]], + [[3.5, 4.0, 4.5], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [5.0, 5.5, 6.0]], + [ + [13.0, 14.0, 15.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], + [16.0, 17.0, 18.0] + ] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: same size', function () { + var input = tf.tensor3d([ + [ + [115.11029815673828, 111.90936279296875, 66.87433624267578], + [72.03849029541016, 81.86637878417969, 119.53585815429688] + ], + [ + [68.555419921875, 97.49642181396484, 116.90741729736328], + [128.69467163085938, 86.78314208984375, 104.3116683959961] + ] + ]); + var dy = tf.tensor3d([ + [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], + [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]] + ]); + var size = [2, 2]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], + [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: same size, align corners', function () { + var input = tf.tensor3d([ + [ + [115.11029815673828, 111.90936279296875, 66.87433624267578], + [72.03849029541016, 81.86637878417969, 119.53585815429688] + ], + [ + [68.555419921875, 97.49642181396484, 116.90741729736328], + [128.69467163085938, 86.78314208984375, 104.3116683959961] + ] + ]); + var dy = tf.tensor3d([ + [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], + [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]] + ]); + var size = [2, 2]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeBilinear(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], + [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); +}); +//# sourceMappingURL=resize_bilinear_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/resize_bilinear_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_bilinear_test.js.map new file mode 100644 index 0000000..50acb86 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_bilinear_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resize_bilinear_test.js","sourceRoot":"","sources":["../../src/ops/resize_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CAAC,CAAC;SACtC,CAAC,CAAC;QAEH,IAAM,IAAI,GAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtC,IAAM,YAAY,GAAG,IAAI,CAAC;QAC1B,IAAM,CAAC,GACL,EAAE,CAAC,IAAI,CAAC,UAAC,CAAc;YACrB,OAAA,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC;QAA9C,CAA8C,CAAC,CAAC;QAEpD,IAAM,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC5B,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;YAC3B,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YAClC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;SACtC,CAAC,CAAC;QAEH,6BAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/resize_nearest_neighbor_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_nearest_neighbor_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_nearest_neighbor_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/resize_nearest_neighbor_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_nearest_neighbor_test.js new file mode 100644 index 0000000..8b3f4d2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_nearest_neighbor_test.js @@ -0,0 +1,500 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('resizeNearestNeighbor', test_util_1.ALL_ENVS, function () { + it('simple alignCorners=false', function () { + var input = tf.tensor3d([2, 2, 4, 4], [2, 2, 1]); + var output = input.resizeNearestNeighbor([3, 3], false); + test_util_1.expectArraysClose(output, [2, 2, 2, 2, 2, 2, 4, 4, 4]); + }); + it('simple alignCorners=true', function () { + var input = tf.tensor3d([2, 2, 4, 4], [2, 2, 1]); + var output = input.resizeNearestNeighbor([3, 3], true); + test_util_1.expectArraysClose(output, [2, 2, 2, 4, 4, 4, 4, 4, 4]); + }); + it('matches tensorflow w/ random numbers alignCorners=false', function () { + var input = tf.tensor3d([ + 1.19074044, 0.91373104, 2.01611669, -0.52270832, 0.38725395, + 1.30809779, 0.61835143, 3.49600659, 2.09230986, 0.56473997, + 0.03823943, 1.19864896 + ], [2, 3, 2]); + var output = input.resizeNearestNeighbor([4, 5], false); + test_util_1.expectArraysClose(output, [ + 1.19074047, 0.913731039, 1.19074047, 0.913731039, 2.01611662, + -0.522708297, 2.01611662, -0.522708297, 0.38725394, 1.30809784, + 1.19074047, 0.913731039, 1.19074047, 0.913731039, 2.01611662, + -0.522708297, 2.01611662, -0.522708297, 0.38725394, 1.30809784, + 0.61835146, 3.49600649, 0.61835146, 3.49600649, 2.09230995, + 0.564739943, 2.09230995, 0.564739943, 0.0382394306, 1.19864893, + 0.61835146, 3.49600649, 0.61835146, 3.49600649, 2.09230995, + 0.564739943, 2.09230995, 0.564739943, 0.0382394306, 1.19864893 + ]); + }); + it('matches tensorflow w/ random numbers alignCorners=true', function () { + var input = tf.tensor3d([ + 1.19074044, 0.91373104, 2.01611669, -0.52270832, 0.38725395, + 1.30809779, 0.61835143, 3.49600659, 2.09230986, 0.56473997, + 0.03823943, 1.19864896 + ], [2, 3, 2]); + var output = input.resizeNearestNeighbor([4, 5], true); + test_util_1.expectArraysClose(output, [ + 1.19074044, 0.91373104, 2.01611669, -0.52270832, 2.01611669, -0.52270832, + 0.38725395, 1.30809779, 0.38725395, 1.30809779, 1.19074044, 0.91373104, + 2.01611669, -0.52270832, 2.01611669, -0.52270832, 0.38725395, 1.30809779, + 0.38725395, 1.30809779, 0.61835143, 3.49600659, 2.09230986, 0.56473997, + 2.09230986, 0.56473997, 0.03823943, 1.19864896, 0.03823943, 1.19864896, + 0.61835143, 3.49600659, 2.09230986, 0.56473997, 2.09230986, 0.56473997, + 0.03823943, 1.19864896, 0.03823943, 1.19864896 + ]); + }); + it('batch of 2, simple, alignCorners=true', function () { + var input = tf.tensor4d([2, 2, 4, 4, 3, 3, 5, 5], [2, 2, 2, 1]); + var output = input.resizeNearestNeighbor([3, 3], true); + test_util_1.expectArraysClose(output, [2, 2, 2, 4, 4, 4, 4, 4, 4, 3, 3, 3, 5, 5, 5, 5, 5, 5]); + }); + it('throws when passed a non-tensor', function () { + var e = /Argument 'images' passed to 'resizeNearestNeighbor' must be a Tensor/; + expect(function () { return tf.image.resizeNearestNeighbor({}, [ + 1, 1 + ]); }).toThrowError(e); + }); + it('accepts a tensor-like object', function () { + var input = [[[2], [2]], [[4], [4]]]; + var output = tf.image.resizeNearestNeighbor(input, [3, 3], false); + test_util_1.expectArraysClose(output, [2, 2, 2, 2, 2, 2, 4, 4, 4]); + }); + it('does not throw when some output dim is 1 and alignCorners=true', function () { + var input = tf.tensor3d([2, 2, 4, 4], [2, 2, 1]); + expect(function () { return input.resizeNearestNeighbor([1, 3], true); }).not.toThrow(); + }); +}); +jasmine_util_1.describeWithFlags('resizeNearestNeighbor gradients', test_util_1.ALL_ENVS, function () { + it('greyscale: upscale, same aspect ratio', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0]], [[5.0], [6.0], [7.0], [8.0]], + [[9.0], [10.0], [11.0], [12.0]], [[13.0], [14.0], [15.0], [16.0]] + ]); + var size = [4, 4]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[14.0], [22.0]], [[46.0], [54.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, same aspect ratio, align corners', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0]], [[5.0], [6.0], [7.0], [8.0]], + [[9.0], [10.0], [11.0], [12.0]], [[13.0], [14.0], [15.0], [16.0]] + ]); + var size = [4, 4]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[14.0], [22.0]], [[46.0], [54.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, taller than wider', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0]], [[5.0], [6.0], [7.0], [8.0]], + [[9.0], [10.0], [11.0], [12.0]], [[13.0], [14.0], [15.0], [16.0]], + [[17.0], [18.0], [19.0], [20.0]], [[21.0], [22.0], [23.0], [24.0]], + [[25.0], [26.0], [27.0], [28.0]], [[29.0], [30.0], [31.0], [32.0]], + [[33.0], [34.0], [35.0], [36.0]] + ]); + var size = [9, 4]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[95.0], [115.0]], [[220.0], [236.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, taller than wider, align corners', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0]], [[5.0], [6.0], [7.0], [8.0]], + [[9.0], [10.0], [11.0], [12.0]], [[13.0], [14.0], [15.0], [16.0]], + [[17.0], [18.0], [19.0], [20.0]], [[21.0], [22.0], [23.0], [24.0]], + [[25.0], [26.0], [27.0], [28.0]], [[29.0], [30.0], [31.0], [32.0]], + [[33.0], [34.0], [35.0], [36.0]] + ]); + var size = [9, 4]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[60.0], [76.0]], [[255.0], [275.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, wider than taller', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0], [7.0]], + [[8.0], [9.0], [10.0], [11.0], [12.0], [13.0], [14.0]], + [[15.0], [16.0], [17.0], [18.0], [19.0], [20.0], [21.0]], + [[22.0], [23.0], [24.0], [25.0], [26.0], [27.0], [28.0]] + ]); + var size = [4, 7]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[48.0], [57.0]], [[160.0], [141.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: upscale, wider than taller, align corners', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([ + [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0], [7.0]], + [[8.0], [9.0], [10.0], [11.0], [12.0], [13.0], [14.0]], + [[15.0], [16.0], [17.0], [18.0], [19.0], [20.0], [21.0]], + [[22.0], [23.0], [24.0], [25.0], [26.0], [27.0], [28.0]] + ]); + var size = [4, 7]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[33.0], [72.0]], [[117.0], [184.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, same aspect ratio', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + var size = [2, 2]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [0.0], [2.0], [0.0]], [[0.0], [0.0], [0.0], [0.0]], + [[3.0], [0.0], [4.0], [0.0]], [[0.0], [0.0], [0.0], [0.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, same aspect ratio, align corners', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + var size = [2, 2]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [0.0], [0.0], [2.0]], [[0.0], [0.0], [0.0], [0.0]], + [[0.0], [0.0], [0.0], [0.0]], [[3.0], [0.0], [0.0], [4.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, taller than wider', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]], [[5.0], [6.0]]]); + var size = [3, 2]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [0.0], [2.0], [0.0]], + [[3.0], [0.0], [4.0], [0.0]], + [[5.0], [0.0], [6.0], [0.0]], + [[0.0], [0.0], [0.0], [0.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, taller than wider, align corners', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]], [[5.0], [6.0]]]); + var size = [3, 2]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [0.0], [0.0], [2.0]], + [[0.0], [0.0], [0.0], [0.0]], + [[3.0], [0.0], [0.0], [4.0]], + [[5.0], [0.0], [0.0], [6.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, taller than wider', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0], [3.0]], [[4.0], [5.0], [6.0]]]); + var size = [2, 3]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [2.0], [3.0], [0.0]], + [[0.0], [0.0], [0.0], [0.0]], + [[4.0], [5.0], [6.0], [0.0]], + [[0.0], [0.0], [0.0], [0.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, taller than wider, align corners', function () { + var input = tf.tensor3d([ + [[100.0], [50.0], [25.0], [10.0]], [[60.0], [20.0], [80.0], [20.0]], + [[40.0], [15.0], [200.0], [203.0]], [[40.0], [10.0], [230.0], [200.0]] + ]); + var dy = tf.tensor3d([[[1.0], [2.0], [3.0]], [[4.0], [5.0], [6.0]]]); + var size = [2, 3]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0], [0.0], [2.0], [3.0]], + [[0.0], [0.0], [0.0], [0.0]], + [[0.0], [0.0], [0.0], [0.0]], + [[4.0], [0.0], [5.0], [6.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, same size', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + var size = [2, 2]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('greyscale: downscale, same size, align corners', function () { + var input = tf.tensor3d([[[100.0], [50.0]], [[60.0], [20.0]]]); + var dy = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + var size = [2, 2]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([[[1.0], [2.0]], [[3.0], [4.0]]]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: upscale, wider than taller', function () { + var input = tf.tensor3d([ + [ + [100.26818084716797, 74.61857604980469, 81.62117767333984], + [127.86964416503906, 85.0583267211914, 102.95439147949219] + ], + [ + [104.3798828125, 96.70733642578125, 92.60601043701172], + [77.63021850585938, 68.55794525146484, 96.17212677001953] + ] + ]); + var dy = tf.tensor3d([ + [ + [1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0], [10.0, 11.0, 12.0], + [13.0, 14.0, 15.0] + ], + [ + [16.0, 17.0, 18.0], [19.0, 20.0, 21.0], [22.0, 23.0, 24.0], + [25.0, 26.0, 27.0], [28.0, 29.0, 30.0] + ], + [ + [31.0, 32.0, 33.0], [34.0, 35.0, 36.0], [37.0, 38.0, 39.0], + [40.0, 41.0, 42.0], [43.0, 44.0, 45.0] + ] + ]); + var size = [3, 5]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[69.0, 75.0, 81.0], [76.0, 80.0, 84.0]], + [[102.0, 105.0, 108.0], [83.0, 85.0, 87.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: upscale, wider than taller, align corners', function () { + var input = tf.tensor3d([ + [ + [100.26818084716797, 74.61857604980469, 81.62117767333984], + [127.86964416503906, 85.0583267211914, 102.95439147949219] + ], + [ + [104.3798828125, 96.70733642578125, 92.60601043701172], + [77.63021850585938, 68.55794525146484, 96.17212677001953] + ] + ]); + var dy = tf.tensor3d([ + [ + [1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0], [10.0, 11.0, 12.0], + [13.0, 14.0, 15.0] + ], + [ + [16.0, 17.0, 18.0], [19.0, 20.0, 21.0], [22.0, 23.0, 24.0], + [25.0, 26.0, 27.0], [28.0, 29.0, 30.0] + ], + [ + [31.0, 32.0, 33.0], [34.0, 35.0, 36.0], [37.0, 38.0, 39.0], + [40.0, 41.0, 42.0], [43.0, 44.0, 45.0] + ] + ]); + var size = [3, 5]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[5.0, 7.0, 9.0], [30.0, 33.0, 36.0]], + [[100.0, 104.0, 108.0], [195.0, 201.0, 207.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: downscale, taller than wider', function () { + var input = tf.tensor3d([ + [ + [97.98934936523438, 77.24969482421875, 113.70111846923828], + [111.34081268310547, 113.15758514404297, 157.90521240234375], + [105.77980041503906, 85.75989532470703, 69.62374114990234], + [125.94231414794922, 73.11385345458984, 87.03099822998047] + ], + [ + [62.25117111206055, 90.23927307128906, 119.1966552734375], + [93.55166625976562, 95.9106674194336, 115.56237030029297], + [102.98121643066406, 98.1983413696289, 97.55982971191406], + [86.47753143310547, 97.04051208496094, 121.50492095947266] + ], + [ + [92.4140853881836, 118.45619201660156, 108.0341796875], + [126.43061065673828, 123.28077697753906, 121.03379821777344], + [128.6694793701172, 98.47042846679688, 114.47464752197266], + [93.31566619873047, 95.2713623046875, 102.51188659667969] + ], + [ + [101.55884552001953, 83.31947326660156, 119.08016204833984], + [128.28546142578125, 92.56212615966797, 74.85054779052734], + [88.9786148071289, 119.43685913085938, 73.06110382080078], + [98.17908477783203, 105.54570007324219, 93.45832061767578] + ] + ]); + var dy = tf.tensor3d([[[1.0, 2.0, 3.0]], [[4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0]]]); + var size = [3, 1]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0, 2.0, 3.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [[4.0, 5.0, 6.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [[7.0, 8.0, 9.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: downscale, taller than wider, align corners', function () { + var input = tf.tensor3d([ + [ + [97.98934936523438, 77.24969482421875, 113.70111846923828], + [111.34081268310547, 113.15758514404297, 157.90521240234375], + [105.77980041503906, 85.75989532470703, 69.62374114990234], + [125.94231414794922, 73.11385345458984, 87.03099822998047] + ], + [ + [62.25117111206055, 90.23927307128906, 119.1966552734375], + [93.55166625976562, 95.9106674194336, 115.56237030029297], + [102.98121643066406, 98.1983413696289, 97.55982971191406], + [86.47753143310547, 97.04051208496094, 121.50492095947266] + ], + [ + [92.4140853881836, 118.45619201660156, 108.0341796875], + [126.43061065673828, 123.28077697753906, 121.03379821777344], + [128.6694793701172, 98.47042846679688, 114.47464752197266], + [93.31566619873047, 95.2713623046875, 102.51188659667969] + ], + [ + [101.55884552001953, 83.31947326660156, 119.08016204833984], + [128.28546142578125, 92.56212615966797, 74.85054779052734], + [88.9786148071289, 119.43685913085938, 73.06110382080078], + [98.17908477783203, 105.54570007324219, 93.45832061767578] + ] + ]); + var dy = tf.tensor3d([[[1.0, 2.0, 3.0]], [[4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0]]]); + var size = [3, 1]; + var alignCorners = true; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0, 2.0, 3.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [[4.0, 5.0, 6.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [[7.0, 8.0, 9.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); + it('color: same size', function () { + var input = tf.tensor3d([ + [ + [100.26818084716797, 74.61857604980469, 81.62117767333984], + [127.86964416503906, 85.0583267211914, 102.95439147949219] + ], + [ + [104.3798828125, 96.70733642578125, 92.60601043701172], + [77.63021850585938, 68.55794525146484, 96.17212677001953] + ] + ]); + var dy = tf.tensor3d([ + [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], + [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]] + ]); + var size = [2, 2]; + var alignCorners = false; + var g = tf.grad(function (i) { + return tf.image.resizeNearestNeighbor(i, size, alignCorners); + }); + var output = g(input, dy); + var expected = tf.tensor3d([ + [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], + [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]] + ]); + test_util_1.expectArraysClose(output, expected); + }); +}); +//# sourceMappingURL=resize_nearest_neighbor_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/resize_nearest_neighbor_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_nearest_neighbor_test.js.map new file mode 100644 index 0000000..c9bba8a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/resize_nearest_neighbor_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resize_nearest_neighbor_test.js","sourceRoot":"","sources":["../../src/ops/resize_nearest_neighbor_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,uBAAuB,EAAE,oBAAQ,EAAE;IACnD,EAAE,CAAC,2BAA2B,EAAE;QAC9B,IAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,IAAM,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAE1D,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC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,IAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CACf,UAAC,CAAc;YACb,OAAA,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC;QAArD,CAAqD,CAAC,CAAC;QAE3D,IAAM,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC5B,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;YAC3B,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YAClC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;SACtC,CAAC,CAAC;QAEH,6BAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts new file mode 100644 index 0000000..9af4911 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts @@ -0,0 +1,13 @@ +import { Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D } from '../tensor'; +import { TensorLike } from '../types'; +declare function reverse1d_(x: Tensor1D | TensorLike): Tensor1D; +declare function reverse2d_(x: Tensor2D | TensorLike, axis?: number | number[]): Tensor2D; +declare function reverse3d_(x: Tensor3D | TensorLike, axis?: number | number[]): Tensor3D; +declare function reverse4d_(x: Tensor4D | TensorLike, axis?: number | number[]): Tensor4D; +declare function reverse_(x: T | TensorLike, axis?: number | number[]): T; +export declare const reverse: typeof reverse_; +export declare const reverse1d: typeof reverse1d_; +export declare const reverse2d: typeof reverse2d_; +export declare const reverse3d: typeof reverse3d_; +export declare const reverse4d: typeof reverse4d_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js new file mode 100644 index 0000000..097c5b4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var axis_util_1 = require("./axis_util"); +var operation_1 = require("./operation"); +function reverse1d_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'reverse'); + util.assert($x.rank === 1, "Error in reverse1D: x must be rank 1 but got\n rank " + $x.rank + "."); + return exports.reverse($x, 0); +} +function reverse2d_(x, axis) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'reverse'); + util.assert($x.rank === 2, "Error in reverse2D: x must be rank 2 but got\n rank " + $x.rank + "."); + return exports.reverse($x, axis); +} +function reverse3d_(x, axis) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'reverse'); + util.assert($x.rank === 3, "Error in reverse3D: x must be rank 3 but got\n rank " + $x.rank + "."); + return exports.reverse($x, axis); +} +function reverse4d_(x, axis) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'reverse'); + util.assert($x.rank === 4, "Error in reverse4D: x must be rank 4 but got\n rank " + $x.rank + "."); + return exports.reverse($x, axis); +} +function reverse_(x, axis) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'reverse'); + if ($x.rank === 0) { + return $x.clone(); + } + var axes = axis_util_1.parseAxisParam(axis, $x.shape); + var grad = function (dy) { + return { $x: function () { return dy.reverse(axes); } }; + }; + var res = environment_1.ENV.engine.runKernel(function (backend) { return backend.reverse($x, axes); }, { $x: $x }, grad); + return res.reshapeAs($x); +} +exports.reverse = operation_1.op({ reverse_: reverse_ }); +exports.reverse1d = operation_1.op({ reverse1d_: reverse1d_ }); +exports.reverse2d = operation_1.op({ reverse2d_: reverse2d_ }); +exports.reverse3d = operation_1.op({ reverse3d_: reverse3d_ }); +exports.reverse4d = operation_1.op({ reverse4d_: reverse4d_ }); +//# sourceMappingURL=reverse.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js.map new file mode 100644 index 0000000..6193294 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reverse.js","sourceRoot":"","sources":["../../src/ops/reverse.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,8BAAgC;AAChC,yCAA2C;AAC3C,yCAA+B;AAO/B,oBAAoB,CAAsB;IACxC,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE,qEACT,EAAE,CAAC,IAAI,MAAG,CAAC,CAAC;IAC9B,OAAO,eAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACxB,CAAC;AASD,oBAAoB,CAAsB,EAAE,IAAsB;IAChE,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE,qEACT,EAAE,CAAC,IAAI,MAAG,CAAC,CAAC;IAC9B,OAAO,eAAO,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC;AASD,oBAAoB,CAAsB,EAAE,IAAsB;IAChE,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE,qEACT,EAAE,CAAC,IAAI,MAAG,C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AAC7B,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC;AAC7B,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_test.js new file mode 100644 index 0000000..4d201fd --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_test.js @@ -0,0 +1,270 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('reverse1d', test_util_1.ALL_ENVS, function () { + it('reverse a 1D array', function () { + var input = tf.tensor1d([1, 2, 3, 4, 5]); + var result = tf.reverse1d(input); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [5, 4, 3, 2, 1]); + }); + it('grad', function () { + var a = tf.tensor1d([1, 2, 3]); + var dy = tf.tensor1d([10, 20, 30]); + var da = tf.grad(function (a) { return tf.reverse1d(a); })(a, dy); + expect(da.shape).toEqual([3]); + test_util_1.expectArraysClose(da, [30, 20, 10]); + }); + it('accepts a tensor-like object', function () { + var input = [1, 2, 3, 4, 5]; + var result = tf.reverse1d(input); + expect(result.shape).toEqual([5]); + test_util_1.expectArraysClose(result, [5, 4, 3, 2, 1]); + }); +}); +jasmine_util_1.describeWithFlags('reverse2d', test_util_1.ALL_ENVS, function () { + it('reverse a 2D array at axis [0]', function () { + var axis = [0]; + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var result = tf.reverse2d(a, axis); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [4, 5, 6, 1, 2, 3]); + }); + it('reverse a 2D array at axis [1]', function () { + var axis = [1]; + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var result = tf.reverse2d(a, axis); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [3, 2, 1, 6, 5, 4]); + }); + it('throws error with invalid input', function () { + var x = tf.tensor1d([1, 20, 300, 4]); + expect(function () { return tf.reverse2d(x, [0]); }).toThrowError(); + }); + it('throws error with invalid axis param', function () { + var x = tf.tensor2d([1, 20, 300, 4], [1, 4]); + expect(function () { return tf.reverse2d(x, [2]); }).toThrowError(); + expect(function () { return tf.reverse2d(x, [-3]); }).toThrowError(); + }); + it('throws error with non integer axis param', function () { + var x = tf.tensor2d([1, 20, 300, 4], [1, 4]); + expect(function () { return tf.reverse2d(x, [0.5]); }).toThrowError(); + }); + it('grad', function () { + var a = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); + var dy = tf.tensor2d([[10, 20, 30], [40, 50, 60]]); + var da = tf.grad(function (a) { return tf.reverse2d(a); })(a, dy); + expect(da.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(da, [60, 50, 40, 30, 20, 10]); + }); + it('grad with reverse(axis=0)', function () { + var a = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); + var dy = tf.tensor2d([[10, 20, 30], [40, 50, 60]]); + var da = tf.grad(function (a) { return tf.reverse2d(a, 0); })(a, dy); + expect(da.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(da, [40, 50, 60, 10, 20, 30]); + }); + it('grad with reverse(axis=1)', function () { + var a = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); + var dy = tf.tensor2d([[10, 20, 30], [40, 50, 60]]); + var da = tf.grad(function (a) { return tf.reverse2d(a, 1); })(a, dy); + expect(da.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(da, [30, 20, 10, 60, 50, 40]); + }); + it('accepts a tensor-like object', function () { + var axis = [0]; + var a = [[1, 2, 3], [4, 5, 6]]; + var result = tf.reverse2d(a, axis); + expect(result.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(result, [4, 5, 6, 1, 2, 3]); + }); +}); +jasmine_util_1.describeWithFlags('reverse3d', test_util_1.ALL_ENVS, function () { + var shape = [2, 3, 4]; + var data = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 + ]; + it('reverse a 3D array at axis [0]', function () { + var input = tf.tensor3d(data, shape); + var result = tf.reverse3d(input, [0]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 + ]); + }); + it('reverse a 3D array at axis [1]', function () { + var input = tf.tensor3d(data, shape); + var result = tf.reverse3d(input, [1]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3, + 20, 21, 22, 23, 16, 17, 18, 19, 12, 13, 14, 15 + ]); + }); + it('reverse a 3D array at axis [2]', function () { + var input = tf.tensor3d(data, shape); + var result = tf.reverse3d(input, [2]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, + 15, 14, 13, 12, 19, 18, 17, 16, 23, 22, 21, 20 + ]); + }); + it('reverse a 3D array at axis [0, 1]', function () { + var input = tf.tensor3d(data, shape); + var result = tf.reverse3d(input, [0, 1]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 20, 21, 22, 23, 16, 17, 18, 19, 12, 13, 14, 15, + 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3 + ]); + }); + it('reverse a 3D array at axis [0, 2]', function () { + var input = tf.tensor3d(data, shape); + var result = tf.reverse3d(input, [0, 2]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 15, 14, 13, 12, 19, 18, 17, 16, 23, 22, 21, 20, + 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8 + ]); + }); + it('reverse a 3D array at axis [1, 2]', function () { + var input = tf.tensor3d(data, shape); + var result = tf.reverse3d(input, [1, 2]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, + 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12 + ]); + }); + it('throws error with invalid input', function () { + var x = tf.tensor2d([1, 20, 300, 4], [1, 4]); + expect(function () { return tf.reverse3d(x, [1]); }).toThrowError(); + }); + it('throws error with invalid axis param', function () { + var x = tf.tensor3d([1, 20, 300, 4], [1, 1, 4]); + expect(function () { return tf.reverse3d(x, [3]); }).toThrowError(); + expect(function () { return tf.reverse3d(x, [-4]); }).toThrowError(); + }); + it('throws error with non integer axis param', function () { + var x = tf.tensor3d([1, 20, 300, 4], [1, 1, 4]); + expect(function () { return tf.reverse3d(x, [0.5]); }).toThrowError(); + }); + it('accepts a tensor-like object', function () { + var input = [[[1], [2], [3]], [[4], [5], [6]]]; + var result = tf.reverse3d(input, [0]); + expect(result.shape).toEqual([2, 3, 1]); + test_util_1.expectArraysClose(result, [4, 5, 6, 1, 2, 3]); + }); +}); +jasmine_util_1.describeWithFlags('reverse4d', test_util_1.ALL_ENVS, function () { + var shape = [3, 2, 3, 4]; + var data = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71 + ]; + it('reverse a 4D array at axis [0]', function () { + var input = tf.tensor4d(data, shape); + var result = tf.reverse4d(input, [0]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 0, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 + ]); + }); + it('reverse a 4D array at axis [1]', function () { + var input = tf.tensor4d(data, shape); + var result = tf.reverse4d(input, [1]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 + ]); + }); + it('reverse a 4D array at axis [2]', function () { + var input = tf.tensor4d(data, shape); + var result = tf.reverse4d(input, [2]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3, 20, 21, 22, 23, 16, 17, + 18, 19, 12, 13, 14, 15, 32, 33, 34, 35, 28, 29, 30, 31, 24, 25, 26, 27, + 44, 45, 46, 47, 40, 41, 42, 43, 36, 37, 38, 39, 56, 57, 58, 59, 52, 53, + 54, 55, 48, 49, 50, 51, 68, 69, 70, 71, 64, 65, 66, 67, 60, 61, 62, 63 + ]); + }); + it('reverse a 4D array at axis [3]', function () { + var input = tf.tensor4d(data, shape); + var result = tf.reverse4d(input, [3]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12, 19, 18, + 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28, 35, 34, 33, 32, + 39, 38, 37, 36, 43, 42, 41, 40, 47, 46, 45, 44, 51, 50, 49, 48, 55, 54, + 53, 52, 59, 58, 57, 56, 63, 62, 61, 60, 67, 66, 65, 64, 71, 70, 69, 68 + ]); + }); + it('reverse a 4D array at axis [0, 2]', function () { + var input = tf.tensor4d(data, shape); + var result = tf.reverse4d(input, [0, 2]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 56, 57, 58, 59, 52, 53, 54, 55, 48, 49, 50, 51, 68, 69, 70, 71, 64, 65, + 66, 67, 60, 61, 62, 63, 32, 33, 34, 35, 28, 29, 30, 31, 24, 25, 26, 27, + 44, 45, 46, 47, 40, 41, 42, 43, 36, 37, 38, 39, 8, 9, 10, 11, 4, 5, + 6, 7, 0, 1, 2, 3, 20, 21, 22, 23, 16, 17, 18, 19, 12, 13, 14, 15 + ]); + }); + it('reverse a 4D array at axis [1, 3]', function () { + var input = tf.tensor4d(data, shape); + var result = tf.reverse4d(input, [1, 3]); + expect(result.shape).toEqual(input.shape); + test_util_1.expectArraysClose(result, [ + 15, 14, 13, 12, 19, 18, 17, 16, 23, 22, 21, 20, 3, 2, 1, 0, 7, 6, + 5, 4, 11, 10, 9, 8, 39, 38, 37, 36, 43, 42, 41, 40, 47, 46, 45, 44, + 27, 26, 25, 24, 31, 30, 29, 28, 35, 34, 33, 32, 63, 62, 61, 60, 67, 66, + 65, 64, 71, 70, 69, 68, 51, 50, 49, 48, 55, 54, 53, 52, 59, 58, 57, 56 + ]); + }); + it('throws error with invalid input', function () { + var x = tf.tensor3d([1, 20, 300, 4], [1, 1, 4]); + expect(function () { return tf.reverse4d(x, [1]); }).toThrowError(); + }); + it('throws error with invalid axis param', function () { + var x = tf.tensor4d([1, 20, 300, 4], [1, 1, 1, 4]); + expect(function () { return tf.reverse4d(x, [4]); }).toThrowError(); + expect(function () { return tf.reverse4d(x, [-5]); }).toThrowError(); + }); + it('throws error with non integer axis param', function () { + var x = tf.tensor4d([1, 20, 300, 4], [1, 1, 1, 4]); + expect(function () { return tf.reverse4d(x, [0.5]); }).toThrowError(); + }); + it('accepts a tensor-like object', function () { + var input = [[[[1]], [[2]], [[3]]], [[[4]], [[5]], [[6]]]]; + var result = tf.reverse4d(input, [0]); + expect(result.shape).toEqual([2, 3, 1, 1]); + test_util_1.expectArraysClose(result, [4, 5, 6, 1, 2, 3]); + }); +}); +jasmine_util_1.describeWithFlags('reverse', test_util_1.ALL_ENVS, function () { + it('throws when passed a non-tensor', function () { + expect(function () { return tf.reverse({}); }) + .toThrowError(/Argument 'x' passed to 'reverse' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var input = [1, 2, 3]; + var result = tf.reverse(input); + expect(result.shape).toEqual([3]); + test_util_1.expectArraysClose(result, [3, 2, 1]); + }); +}); +//# sourceMappingURL=reverse_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_test.js.map new file mode 100644 index 0000000..988fcd3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reverse_test.js","sourceRoot":"","sources":["../../src/ops/reverse_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,WAAW,EAAE,oBAAQ,EAAE;IACvC,EAAE,CAAC,oBAAoB,EAAE;QACvB,IAAM,KAAK,GAAG,EAAE,CAAC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,EAAE,CAAC,OAAO,CAAC,EAAe,CAAC,EAA3B,CAA2B,CAAC;aACpC,YAAY,CAAC,mDAAmD,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACxB,IAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops.d.ts new file mode 100644 index 0000000..3e6bd50 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops.d.ts @@ -0,0 +1,7 @@ +import { Tensor, Tensor1D } from '../tensor'; +import { TensorLike } from '../types'; +declare function unsortedSegmentSum_(x: T | TensorLike, segmentIds: Tensor1D | TensorLike, numSegments: number): T; +declare function gather_(x: T | TensorLike, indices: Tensor1D | TensorLike, axis?: number): T; +export declare const gather: typeof gather_; +export declare const unsortedSegmentSum: typeof unsortedSegmentSum_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops.js new file mode 100644 index 0000000..0d1f853 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util_1 = require("../util"); +var array_ops_1 = require("./array_ops"); +var axis_util_1 = require("./axis_util"); +var binary_ops_1 = require("./binary_ops"); +var compare_1 = require("./compare"); +var logical_ops_1 = require("./logical_ops"); +var operation_1 = require("./operation"); +var tensor_ops_1 = require("./tensor_ops"); +function unsortedSegmentSum_(x, segmentIds, numSegments) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'unsortedSegmentSum'); + var $segmentIds = tensor_util_env_1.convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32'); + util_1.assert($segmentIds.dtype === 'int32', 'segmentIds must be of dtype `int32`'); + util_1.assert(util_1.isInt(numSegments), 'numSegments must be of dtype int'); + var gradFunc = function (dy) { + var derX = function () { + return gatherDropNegatives(dy, $segmentIds); + }; + return { $x: derX }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { + return backend.unsortedSegmentSum($x, $segmentIds, numSegments); + }, { $x: $x }, gradFunc); +} +function gather_(x, indices, axis) { + if (axis === void 0) { axis = 0; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'gather'); + var $indices = tensor_util_env_1.convertToTensor(indices, 'indices', 'gather', 'int32'); + util_1.assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`'); + axis = axis_util_1.parseAxisParam(axis, $x.shape)[0]; + var grad = function (dy) { + var derX = function () { + if (axis === 0) { + return exports.unsortedSegmentSum(dy, $indices, $x.shape[axis]); + } + var paramsShape = $x.shape; + var indicesSize = $indices.size; + var outerShape = paramsShape.slice(0, axis); + var outerDims = outerShape.length; + var innerShape = paramsShape.slice(axis, paramsShape.length).slice(1); + var innerDims = innerShape.length; + var outerAxesIndices = arrayRange(0, outerDims); + var innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims); + var valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]); + var values = dy.reshape(valuesShape); + var reshapedIndices = $indices.reshape([indicesSize]); + var transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]); + var valuesTranspose = values.transpose(transposeDims); + var paramsGrad = exports.unsortedSegmentSum(valuesTranspose, reshapedIndices, $x.shape[axis]); + var invertTransposeDims = axis_util_1.getUndoAxesPermutation(transposeDims); + paramsGrad = paramsGrad.transpose(invertTransposeDims); + return paramsGrad; + }; + return { $x: derX }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.gather($x, $indices, axis); }, { $x: $x }, grad); +} +function arrayRange(start, stop) { + var result = []; + for (var i = start; i < stop; ++i) { + result.push(i); + } + return result; +} +function arrayConcat(arrays) { + var result = []; + for (var i = 0; i < arrays.length; ++i) { + for (var j = 0; j < arrays[i].length; ++j) { + result.push(arrays[i][j]); + } + } + return result; +} +function gatherDropNegatives(x, indices) { + var zeroClippedIndices = binary_ops_1.maximum(indices, tensor_ops_1.zerosLike(indices)); + var gathered = exports.gather(x, zeroClippedIndices); + var isPositive = compare_1.greaterEqual(indices, tensor_ops_1.scalar(0, 'int32')); + var numIters = gathered.rank - isPositive.rank; + for (var i = 0; i < numIters; ++i) { + isPositive = array_ops_1.expandDims(isPositive, i + 1); + } + isPositive = logical_ops_1.logicalAnd(isPositive, tensor_ops_1.ones(gathered.shape, 'bool')); + var zeroSlice = tensor_ops_1.zerosLike(gathered); + return logical_ops_1.where(isPositive, gathered, zeroSlice); +} +exports.gather = operation_1.op({ gather_: gather_ }); +exports.unsortedSegmentSum = operation_1.op({ unsortedSegmentSum_: unsortedSegmentSum_ }); +//# sourceMappingURL=segment_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops.js.map new file mode 100644 index 0000000..2028355 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"segment_ops.js","sourceRoot":"","sources":["../../src/ops/segment_ops.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,gCAAsC;AACtC,yCAAuC;AACvC,yC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AAiB;IAIpE,IAAM,kBAAkB,GAAG,oBAAO,CAAC,OAAO,EAAE,sBAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,IAAM,QAAQ,GAAG,cAAM,CAAC,CAAC,EAAE,kBAA8B,CAAC,CAAC;IAC3D,IAAI,UAAU,GAAG,sBAAY,CAAC,OAAO,EAAE,mBAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D,IAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;IACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,EAAE,CAAC,EAAE;QACjC,UAAU,GAAG,sBAAU,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC5C;IACD,UAAU,GAAG,wBAAU,CAAC,UAAU,EAAE,iBAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAClE,IAAM,SAAS,GAAG,sBAAS,CAAC,QAAQ,CAAC,CAAC;IACtC,OAAO,mBAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAChD,CAAC;AAEY,QAAA,MAAM,GAAG,cAAE,CAAC,EAAC,OAAO,SAAA,EAAC,CAAC,CAAC;AACvB,QAAA,kBAAkB,GAAG,cAAE,CAAC,EAAC,mBAAmB,qBAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops_test.js new file mode 100644 index 0000000..2506f17 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops_test.js @@ -0,0 +1,102 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var reduce_util_1 = require("./reduce_util"); +jasmine_util_1.describeWithFlags('unsortedSegmentSum', test_util_1.ALL_ENVS, function () { + it('tensor1D', function () { + var t = tf.tensor1d([1, 2, 3, 4]); + var segmentIds = tf.tensor1d([0, 2, 0, 1], 'int32'); + var numSegments = 3; + var res = tf.unsortedSegmentSum(t, segmentIds, numSegments); + expect(res.shape).toEqual([numSegments]); + test_util_1.expectArraysClose(res, [4, 4, 2]); + }); + it('tensor2D', function () { + var t = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var segmentIds = tf.tensor1d([0, 0], 'int32'); + var numSegments = 2; + var res = tf.unsortedSegmentSum(t, segmentIds, numSegments); + expect(res.shape).toEqual([numSegments, 2]); + test_util_1.expectArraysClose(res, [4, 6, 0, 0]); + }); + it('tensor3D', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [3, 2, 2]); + var segmentIds = tf.tensor1d([2, 1, 2], 'int32'); + var numSegments = 3; + var res = tf.unsortedSegmentSum(t, segmentIds, numSegments); + expect(res.shape).toEqual([numSegments, 2, 2]); + test_util_1.expectArraysClose(res, [0, 0, 0, 0, 5, 6, 7, 8, 10, 12, 14, 16]); + }); + it('N > than parallelization threshold, tensor1D', function () { + var n = reduce_util_1.PARALLELIZE_THRESHOLD * 2; + var values = new Float32Array(n); + var numSegments = 5; + var segmentIdValues = new Float32Array(n); + var vals = new Float32Array(numSegments); + for (var i = 0; i < n; i++) { + values[i] = i; + segmentIdValues[i] = i % numSegments; + vals[i % numSegments] += i; + } + var t = tf.tensor1d(values); + var segmentIds = tf.tensor1d(segmentIdValues, 'int32'); + var res = tf.unsortedSegmentSum(t, segmentIds, numSegments); + expect(res.shape).toEqual([numSegments]); + test_util_1.expectArraysClose(res, vals); + }); + it('ignores negative segmentIds', function () { + var t = tf.tensor1d([1, 2, 3, 4]); + var segmentIds = tf.tensor1d([0, 2, -1, 1], 'int32'); + var numSegments = 3; + var res = tf.unsortedSegmentSum(t, segmentIds, numSegments); + expect(res.shape).toEqual([numSegments]); + test_util_1.expectArraysClose(res, [1, 4, 2]); + }); + it('gradient ignores negative segmentIds', function () { + var t = tf.tensor1d([1, 2, 3, 4]); + var segmentIds = tf.tensor1d([0, 2, -1, 1], 'int32'); + var numSegments = 3; + var dy = tf.tensor1d([11, 2, 7]); + var gradient = tf.grad(function (a) { return tf.unsortedSegmentSum(a, segmentIds, numSegments); })(t, dy); + expect(gradient.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradient, [11, 7, 0, 2]); + }); + it('tensor1D gradient', function () { + var t = tf.tensor1d([1, 2, 3, 4]); + var segmentIds = tf.tensor1d([0, 2, 0, 1], 'int32'); + var numSegments = 3; + var dy = tf.tensor1d([11, 2, 7]); + var gradient = tf.grad(function (a) { return tf.unsortedSegmentSum(a, segmentIds, numSegments); })(t, dy); + expect(gradient.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradient, [11, 7, 11, 2]); + }); + it('tensor2D gradient', function () { + var t = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var segmentIds = tf.tensor1d([0, 0], 'int32'); + var numSegments = 2; + var dy = tf.tensor2d([11, 2, 4, 5], [2, 2]); + var gradient = tf.grad(function (a) { return tf.unsortedSegmentSum(a, segmentIds, numSegments); })(t, dy); + expect(gradient.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradient, [11, 2, 11, 2]); + }); + it('tensor3D gradient', function () { + var t = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [3, 2, 2]); + var segmentIds = tf.tensor1d([2, 1, 2], 'int32'); + var numSegments = 3; + var dy = tf.tensor3d([11, 2, 4, 5, 17, 31, 1, 0, -1, 14, 3, 28], [3, 2, 2]); + var gradient = tf.grad(function (a) { return tf.unsortedSegmentSum(a, segmentIds, numSegments); })(t, dy); + expect(gradient.shape).toEqual(t.shape); + test_util_1.expectArraysClose(gradient, [-1, 14, 3, 28, 17, 31, 1, 0, -1, 14, 3, 28]); + }); + it('accepts a tensor-like object', function () { + var x = [1, 2, 3, 4]; + var segmentIds = [0, 2, 0, 1]; + var numSegments = 3; + var res = tf.unsortedSegmentSum(x, segmentIds, numSegments); + expect(res.shape).toEqual([3]); + test_util_1.expectArraysClose(res, [4, 4, 2]); + }); +}); +//# sourceMappingURL=segment_ops_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops_test.js.map new file mode 100644 index 0000000..2c37f5a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_ops_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"segment_ops_test.js","sourceRoot":"","sources":["../../src/ops/segment_ops_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AACzD,6CAAoD;AAEpD,gCAAiB,CAAC,oBAAoB,EAAE,oBAAQ,EAAE;IAChD,EAAE,CAAC,UAAU,EAAE;QACb,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACpC,IAAM,UAAU,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACtD,IAAM,WAAW,GAAG,CAAC,CAAC;QACtB,IAAM,GAAG,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAE9D,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CA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AAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,6BAAiB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts new file mode 100644 index 0000000..c1ed265 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts @@ -0,0 +1,8 @@ +export interface SegOpInfo { + windowSize: number; + batchSize: number; + inSize: number; + numSegments: number; +} +export declare function segOpComputeOptimalWindowSize(inSize: number, numSegments: number): number; +export declare function computeOutShape(aShape: number[], axis: number, numSegments: number): number[]; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js new file mode 100644 index 0000000..fd67cab --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = require("../util"); +var reduce_util_1 = require("./reduce_util"); +function segOpComputeOptimalWindowSize(inSize, numSegments) { + var done = false; + var res; + if (inSize <= reduce_util_1.PARALLELIZE_THRESHOLD) { + res = inSize; + done = true; + } + else { + res = util_1.nearestDivisor(inSize, Math.floor(Math.sqrt(inSize))); + } + while (!done) { + if (res > numSegments || res === inSize) { + done = true; + break; + } + else { + res = util_1.nearestDivisor(inSize, res + 1); + } + } + return res; +} +exports.segOpComputeOptimalWindowSize = segOpComputeOptimalWindowSize; +function computeOutShape(aShape, axis, numSegments) { + var outShape = []; + var rank = aShape.length; + for (var dim = 0; dim < rank; dim++) { + if (dim !== axis) { + outShape.push(aShape[dim]); + } + else { + outShape.push(numSegments); + } + } + return outShape; +} +exports.computeOutShape = computeOutShape; +//# sourceMappingURL=segment_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js.map new file mode 100644 index 0000000..7755ad4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"segment_util.js","sourceRoot":"","sources":["../../src/ops/segment_util.ts"],"names":[],"mappings":";;AAiBA,gCAAuC;AACvC,6CAAoD;AASpD,uCACI,MAAc,EAAE,WAAmB;IACrC,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,GAAG,CAAC;IAER,IAAI,MAAM,IAAI,mCAAqB,EAAE;QACnC,GAAG,GAAG,MAAM,CAAC;QACb,IAAI,GAAG,IAAI,CAAC;KACb;SAAM;QACL,GAAG,GAAG,qBAAc,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC7D;IAED,OAAO,CAAC,IAAI,EAAE;QACZ,IAAI,GAAG,GAAG,WAAW,IAAI,GAAG,KAAK,MAAM,EAAE;YACvC,IAAI,GAAG,IAAI,CAAC;YACZ,MAAM;SACP;aAAM;YACL,GAAG,GAAG,qBAAc,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;SACvC;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AArBD,sEAqBC;AAED,yBACI,MAAgB,EAAE,IAAY,EAAE,WAAmB;IACrD,IAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,IAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3B,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,EAAE,GAAG,EAAE,EAAE;QACnC,IAAI,GAAG,KAAK,IAAI,EAAE;YAChB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;SAC5B;aAAM;YACL,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5B;KACF;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAZD,0CAYC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts new file mode 100644 index 0000000..1360106 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts @@ -0,0 +1,2 @@ +export declare const SELU_SCALEALPHA = 1.7580993408473768; +export declare const SELU_SCALE = 1.0507009873554805; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js new file mode 100644 index 0000000..356c45c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SELU_SCALEALPHA = 1.7580993408473768599402175208123; +exports.SELU_SCALE = 1.0507009873554804934193349852946; +//# sourceMappingURL=selu_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js.map new file mode 100644 index 0000000..d9acdcf --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"selu_util.js","sourceRoot":"","sources":["../../src/ops/selu_util.ts"],"names":[],"mappings":";;AAiBa,QAAA,eAAe,GAAG,iCAAiC,CAAC;AACpD,QAAA,UAAU,GAAG,iCAAiC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts new file mode 100644 index 0000000..3c1038a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts @@ -0,0 +1,13 @@ +import { Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D } from '../tensor'; +import { Rank, TensorLike } from '../types'; +declare function slice1d_(x: Tensor1D | TensorLike, begin: number, size: number): Tensor1D; +declare function slice2d_(x: Tensor2D | TensorLike, begin: [number, number], size: [number, number]): Tensor2D; +declare function slice3d_(x: Tensor3D | TensorLike, begin: [number, number, number], size: [number, number, number]): Tensor3D; +declare function slice4d_(x: Tensor4D | TensorLike, begin: [number, number, number, number], size: [number, number, number, number]): Tensor4D; +declare function slice_>(x: T | TensorLike, begin: number | number[], size?: number | number[]): T; +export declare const slice: typeof slice_; +export declare const slice1d: typeof slice1d_; +export declare const slice2d: typeof slice2d_; +export declare const slice3d: typeof slice3d_; +export declare const slice4d: typeof slice4d_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/slice.js b/node_modules/@tensorflow/tfjs-core/dist/ops/slice.js new file mode 100644 index 0000000..81854bf --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/slice.js @@ -0,0 +1,81 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var operation_1 = require("./operation"); +var slice_util = require("./slice_util"); +function slice1d_(x, begin, size) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'slice1d'); + util.assert($x.rank === 1, "slice1d expects a rank-1 tensor, but got a rank-" + $x.rank + " tensor"); + return exports.slice($x, [begin], [size]); +} +function slice2d_(x, begin, size) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'slice2d'); + util.assert($x.rank === 2, "slice1d expects a rank-2 tensor, but got a rank-" + $x.rank + " tensor"); + return exports.slice($x, begin, size); +} +function slice3d_(x, begin, size) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'slice3d'); + util.assert($x.rank === 3, "slice1d expects a rank-3 tensor, but got a rank-" + $x.rank + " tensor"); + return exports.slice($x, begin, size); +} +function slice4d_(x, begin, size) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'slice4d'); + util.assert($x.rank === 4, "slice1d expects a rank-4 tensor, but got a rank-" + $x.rank + " tensor"); + return exports.slice($x, begin, size); +} +function slice_(x, begin, size) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'slice'); + if ($x.rank === 0) { + throw new Error('Slicing scalar is not possible'); + } + var begin_; + if (typeof begin === 'number') { + begin_ = [begin].concat(new Array($x.rank - 1).fill(0)); + } + else if (begin.length < $x.rank) { + begin_ = begin.concat(new Array($x.rank - begin.length).fill(0)); + } + else { + begin_ = begin; + } + var size_; + if (size == null) { + size_ = new Array($x.rank).fill(-1); + } + else if (typeof size === 'number') { + size_ = [size].concat(new Array($x.rank - 1).fill(-1)); + } + else if (size.length < $x.rank) { + size_ = size.concat(new Array($x.rank - size.length).fill(-1)); + } + else { + size_ = size; + } + size_ = size_.map(function (d, i) { + if (d >= 0) { + return d; + } + else { + util.assert(d === -1, 'Bad value in size'); + return $x.shape[i] - begin_[i]; + } + }); + slice_util.assertParamsValid($x, begin_, size_); + var inputShape = $x.shape; + var grad = function (dy) { + var paddings = []; + for (var i = 0; i < dy.rank; i++) { + paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]); + } + return { $x: function () { return dy.pad(paddings); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.slice($x, begin_, size_); }, { $x: $x }, grad); +} +exports.slice = operation_1.op({ slice_: slice_ }); +exports.slice1d = operation_1.op({ slice1d_: slice1d_ }); +exports.slice2d = operation_1.op({ slice2d_: slice2d_ }); +exports.slice3d = operation_1.op({ slice3d_: slice3d_ }); +exports.slice4d = operation_1.op({ slice4d_: slice4d_ }); +//# sourceMappingURL=slice.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/slice.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/slice.js.map new file mode 100644 index 0000000..d65c6ec --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/slice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AAC,SAAS,CAChB,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAhC,CAAgC,EAAE,EAAC,EAAE,IAAA,EAAC,EAAE,IAAI,CAAM,CAAC;AAC3E,CAAC;AAEY,QAAA,KAAK,GAAG,cAAE,CAAC,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACrB,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/slice_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/slice_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_test.js new file mode 100644 index 0000000..12fbba8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_test.js @@ -0,0 +1,172 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('slice1d', test_util_1.ALL_ENVS, function () { + it('slices 1x1 into 1x1 (effectively a copy)', function () { + var a = tf.tensor1d([5]); + var result = tf.slice1d(a, 0, 1); + expect(result.shape).toEqual([1]); + test_util_1.expectNumbersClose(result.get(0), 5); + }); + it('slices 5x1 into shape 2x1 starting at 3', function () { + var a = tf.tensor1d([1, 2, 3, 4, 5]); + var result = tf.slice1d(a, 3, 2); + expect(result.shape).toEqual([2]); + test_util_1.expectArraysClose(result, [4, 5]); + }); + it('slices 5x1 into shape 3x1 starting at 1', function () { + var a = tf.tensor1d([1, 2, 3, 4, 5]); + var result = tf.slice1d(a, 1, 3); + expect(result.shape).toEqual([3]); + test_util_1.expectArraysClose(result, [2, 3, 4]); + }); + it('grad', function () { + var a = tf.tensor1d([1, 2, 3, 4, 5]); + var dy = tf.tensor1d([10, 100]); + var da = tf.grad(function (x) { return tf.slice1d(a, 1, 2); })(a, dy); + expect(da.shape).toEqual([5]); + test_util_1.expectArraysClose(da, [0, 10, 100, 0, 0]); + }); + it('accepts a tensor-like object', function () { + var a = [5]; + var result = tf.slice1d(a, 0, 1); + expect(result.shape).toEqual([1]); + test_util_1.expectNumbersClose(result.get(0), 5); + }); +}); +jasmine_util_1.describeWithFlags('slice2d', test_util_1.ALL_ENVS, function () { + it('slicing a 1x1 from a 1x1 returns a 1x1', function () { + var a = tf.tensor2d([0], [1, 1]); + var b = tf.slice2d(a, [0, 0], [1, 1]); + expect(b.shape).toEqual([1, 1]); + }); + it('returns a tensor of slice size', function () { + var a = tf.zeros([100, 100]); + var b = tf.slice2d(a, [0, 0], [12, 34]); + expect(b.shape).toEqual([12, 34]); + }); + it('returns the upper-left submatrix when begin is [0, 0]', function () { + var a = tf.randomUniform([10, 10], -1, 1); + var b = tf.slice2d(a, [0, 0], [2, 2]); + var aValues = a.dataSync(); + test_util_1.expectArraysClose(b, [aValues[0], aValues[1], aValues[10], aValues[11]]); + }); + it('returns the rectangle specified', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [4, 3]); + var b = tf.slice2d(a, [1, 1], [3, 2]); + test_util_1.expectArraysClose(b, [5, 6, 8, 9, 11, 12]); + }); + it('throws when requesting out of bounds slice', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [4, 3]); + expect(function () { return tf.slice2d(a, [1, 1], [10, 10]); }).toThrowError(); + }); + it('grad', function () { + var a = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); + var dy = tf.tensor2d([[20], [50]]); + var da = tf.grad(function (x) { return tf.slice2d(a, [0, 1], [2, 1]); })(a, dy); + expect(da.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(da, [0, 20, 0, 0, 50, 0]); + }); + it('accepts a tensor-like object', function () { + var a = [[0]]; + var b = tf.slice2d(a, [0, 0], [1, 1]); + expect(b.shape).toEqual([1, 1]); + }); +}); +jasmine_util_1.describeWithFlags('slice3d', test_util_1.ALL_ENVS, function () { + it('slices 1x1x1 into shape 1x1x1 (effectively a copy)', function () { + var a = tf.tensor3d([[[5]]], [1, 1, 1]); + var result = tf.slice3d(a, [0, 0, 0], [1, 1, 1]); + expect(result.shape).toEqual([1, 1, 1]); + test_util_1.expectArraysClose(result, [5]); + }); + it('slices 2x2x2 array into 1x2x2 starting at [1, 0, 0]', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var result = tf.slice3d(a, [1, 0, 0], [1, 2, 2]); + expect(result.shape).toEqual([1, 2, 2]); + test_util_1.expectArraysClose(result, [5, 6, 7, 8]); + }); + it('slices 2x2x2 array into 2x1x1 starting at [0, 1, 1]', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var result = tf.slice3d(a, [0, 1, 1], [2, 1, 1]); + expect(result.shape).toEqual([2, 1, 1]); + test_util_1.expectArraysClose(result, [4, 8]); + }); + it('accepts a tensor-like object', function () { + var a = [[[5]]]; + var result = tf.slice3d(a, [0, 0, 0], [1, 1, 1]); + expect(result.shape).toEqual([1, 1, 1]); + test_util_1.expectArraysClose(result, [5]); + }); +}); +jasmine_util_1.describeWithFlags('slice4d', test_util_1.ALL_ENVS, function () { + it('slices 1x1x1x1 into shape 1x1x1x1 (effectively a copy)', function () { + var a = tf.tensor4d([[[[5]]]], [1, 1, 1, 1]); + var result = tf.slice4d(a, [0, 0, 0, 0], [1, 1, 1, 1]); + expect(result.shape).toEqual([1, 1, 1, 1]); + test_util_1.expectArraysClose(result, [5]); + }); + it('slices 2x2x2x2 array into 1x2x2x2 starting at [1, 0, 0, 0]', function () { + var a = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8, 11, 22, 33, 44, 55, 66, 77, 88], [2, 2, 2, 2]); + var result = tf.slice4d(a, [1, 0, 0, 0], [1, 2, 2, 2]); + expect(result.shape).toEqual([1, 2, 2, 2]); + test_util_1.expectArraysClose(result, [11, 22, 33, 44, 55, 66, 77, 88]); + }); + it('slices 2x2x2x2 array into 2x1x1x1 starting at [0, 1, 1, 1]', function () { + var a = tf.tensor4d([1, 2, 3, 4, 5, 6, 7, 8, 11, 22, 33, 44, 55, 66, 77, 88], [2, 2, 2, 2]); + var result = tf.slice4d(a, [0, 1, 1, 1], [2, 1, 1, 1]); + expect(result.shape).toEqual([2, 1, 1, 1]); + test_util_1.expectArraysClose(result, [8, 88]); + }); + it('accepts a tensor-like object', function () { + var a = [[[[5]]]]; + var result = tf.slice4d(a, [0, 0, 0, 0], [1, 1, 1, 1]); + expect(result.shape).toEqual([1, 1, 1, 1]); + test_util_1.expectArraysClose(result, [5]); + }); +}); +jasmine_util_1.describeWithFlags('slice ergonomics', test_util_1.ALL_ENVS, function () { + it('slices 2x2x2 array into 2x1x1 no size', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var result = a.slice([0, 1, 1]); + expect(result.shape).toEqual([2, 1, 1]); + test_util_1.expectArraysClose(result, [4, 8]); + }); + it('slices 2x2x2 array into 1x2x2 with scalar begin no size', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var result = a.slice(1); + expect(result.shape).toEqual([1, 2, 2]); + test_util_1.expectArraysClose(result, [5, 6, 7, 8]); + }); + it('slices 2x2x2 array using 2d size and 2d size', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var result = a.slice([0, 1]); + expect(result.shape).toEqual([2, 1, 2]); + test_util_1.expectArraysClose(result, [3, 4, 7, 8]); + }); + it('slices 2x2x2 array using negative size', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var result = a.slice([0, 1], [-1, 1]); + expect(result.shape).toEqual([2, 1, 2]); + test_util_1.expectArraysClose(result, [3, 4, 7, 8]); + }); + it('slices 2x2x2 array using 1d size', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8], [2, 2, 2]); + var result = a.slice(0, 1); + expect(result.shape).toEqual([1, 2, 2]); + test_util_1.expectArraysClose(result, [1, 2, 3, 4]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.slice({}, 0, 0); }) + .toThrowError(/Argument 'x' passed to 'slice' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var a = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]; + var result = tf.slice(a, [0, 1, 1]); + expect(result.shape).toEqual([2, 1, 1]); + test_util_1.expectArraysClose(result, [4, 8]); + }); +}); +//# sourceMappingURL=slice_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/slice_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_test.js.map new file mode 100644 index 0000000..dcc9999 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"slice_test.js","sourceRoot":"","sources":["../../src/ops/slice_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA6E;AAG7E,gCAAiB,CAAC,SAAS,EAAE,oBAAQ,EAAE;IACrC,EAAE,CAAC,0CAA0C,EAAE;QAC7C,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,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/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts new file mode 100644 index 0000000..c9ed72a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts @@ -0,0 +1,5 @@ +import { Tensor } from '../tensor'; +export declare function assertParamsValid(input: Tensor, begin: number[], size: number[]): void; +export declare function getStridedSlicedInfo(shape: number[], begin: number[], end: number[], strides: number[], beginMask?: number, endMask?: number): [number[], number[]]; +export declare function startForAxis(beginMask: number, startIndices: number[], strides: number[], inputShape: number[], axis: number): number; +export declare function stopForAxis(endMask: number, stopIndices: number[], strides: number[], inputShape: number[], axis: number): number; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js new file mode 100644 index 0000000..f82c4eb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js @@ -0,0 +1,76 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util = require("../util"); +function assertParamsValid(input, begin, size) { + util.assert(input.rank === begin.length, "Error in slice" + input.rank + "D: Length of begin " + begin + " must " + + ("match the rank of the array (" + input.rank + ").")); + util.assert(input.rank === size.length, "Error in slice" + input.rank + "D: Length of size " + size + " must " + + ("match the rank of the array (" + input.rank + ").")); + for (var i = 0; i < input.rank; ++i) { + util.assert(begin[i] + size[i] <= input.shape[i], "Error in slice" + input.rank + "D: begin[" + i + "] + size[" + i + "] " + + ("(" + (begin[i] + size[i]) + ") would overflow input.shape[" + i + "] (" + input.shape[i] + ")")); + } +} +exports.assertParamsValid = assertParamsValid; +function getStridedSlicedInfo(shape, begin, end, strides, beginMask, endMask) { + if (beginMask === void 0) { beginMask = 0; } + if (endMask === void 0) { endMask = 0; } + var startIndex = []; + var endIndex = []; + for (var i = 0; i < shape.length; i++) { + startIndex[i] = startForAxis(beginMask, begin, strides, shape, i); + endIndex[i] = stopForAxis(endMask, end, strides, shape, i); + } + var size = new Array(shape.length).fill(0); + size = size.map(function (d, i) { + var count = 0; + for (var start = startIndex[i]; !(strides[i] > 0 ? start >= endIndex[i] : start <= endIndex[i]); start += strides[i]) { + count += 1; + } + return count; + }); + return [startIndex, size]; +} +exports.getStridedSlicedInfo = getStridedSlicedInfo; +function startForAxis(beginMask, startIndices, strides, inputShape, axis) { + var start = startIndices[axis]; + if (beginMask & 1 << axis) { + if (strides[axis] > 0) { + start = Number.MIN_SAFE_INTEGER; + } + else { + start = Number.MAX_SAFE_INTEGER; + } + } + var axisSize = inputShape[axis]; + if (start < 0) { + start += axisSize; + } + start = util.clamp(0, start, axisSize - 1); + return start; +} +exports.startForAxis = startForAxis; +function stopForAxis(endMask, stopIndices, strides, inputShape, axis) { + var stop = stopIndices[axis]; + if (endMask & (1 << axis)) { + if (strides[axis] > 0) { + stop = Number.MAX_SAFE_INTEGER; + } + else { + stop = Number.MIN_SAFE_INTEGER; + } + } + var axisSize = inputShape[axis]; + if (stop < 0) { + stop += axisSize; + } + if (strides[axis] > 0) { + stop = util.clamp(0, stop, axisSize); + } + else { + stop = util.clamp(-1, stop, axisSize - 1); + } + return stop; +} +exports.stopForAxis = stopForAxis; +//# sourceMappingURL=slice_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js.map new file mode 100644 index 0000000..3df6d63 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"slice_util.js","sourceRoot":"","sources":["../../src/ops/slice_util.ts"],"names":[],"mappings":";;AAkBA,8BAAgC;AAEhC,2BACI,KAAa,EAAE,KAAe,EAAE,IAAc;IAChD,IAAI,CAAC,MAAM,CACP,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,EAC3B,mBAAiB,KAAK,CAAC,IAAI,2BAAsB,KAAK,WAAQ;SAC1D,kC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;AACf,CAAC;AA7BD,oCA6BC;AAED,qBACI,OAAe,EAAE,WAAqB,EAAE,OAAiB,EACzD,UAAoB,EAAE,IAAY;IAEpC,IAAI,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAG7B,IAAI,OAAO,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,EAAE;QACzB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAGrB,IAAI,GAAG,MAAM,CAAC,gBAAgB,CAAC;SAChC;aAAM;YAEL,IAAI,GAAG,MAAM,CAAC,gBAAgB,CAAC;SAChC;KACF;IAGD,IAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,IAAI,GAAG,CAAC,EAAE;QACZ,IAAI,IAAI,QAAQ,CAAC;KAClB;IAKD,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAErB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;KACtC;SAAM;QAEL,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;KAC3C;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AApCD,kCAoCC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts new file mode 100644 index 0000000..772901e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts @@ -0,0 +1,5 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function softmax_(logits: T | TensorLike, dim?: number): T; +export declare const softmax: typeof softmax_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js new file mode 100644 index 0000000..5e6bb5e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var gradients_1 = require("../gradients"); +var tensor_util_env_1 = require("../tensor_util_env"); +var operation_1 = require("./operation"); +function softmax_(logits, dim) { + if (dim === void 0) { dim = -1; } + var $logits = tensor_util_env_1.convertToTensor(logits, 'logits', 'softmax'); + if (dim === -1) { + dim = $logits.rank - 1; + } + if (dim !== $logits.rank - 1) { + throw Error('Softmax along a non-last dimension is not yet supported. ' + + ("Logits was rank " + $logits.rank + " and dim was " + dim)); + } + var customOp = gradients_1.customGrad(function (logits) { + var keepDims = true; + var lse = logits.logSumExp([dim], keepDims); + var logResult = logits.toFloat().sub(lse); + var y = logResult.exp(); + var gradFunc = function (dy) { + var dyTimesY = dy.mul(y); + var keepDims = true; + return dyTimesY.sub(dyTimesY.sum([dim], keepDims).mul(y)); + }; + return { value: y, gradFunc: gradFunc }; + }); + return customOp($logits); +} +exports.softmax = operation_1.op({ softmax_: softmax_ }); +//# sourceMappingURL=softmax.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js.map new file mode 100644 index 0000000..b65d508 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js.map @@ -0,0 +1 @@ +{"version":3,"file":"softmax.js","sourceRoot":"","sources":["../../src/ops/softmax.ts"],"names":[],"mappings":";;AAiBA,0CAAwC;AAExC,sDAAmD;AAEnD,yCAA+B;AAsB/B,kBAAoC,MAAoB,EAAE,GAAQ;IAAR,oBAAA,EAAA,OAAO,CAAC;IAChE,IAAM,OAAO,GAAG,iCAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAE7D,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE;QACd,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;KACxB;IACD,IAAI,GAAG,KAAK,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE;QAC5B,MAAM,KAAK,CACP,2DAA2D;aAC3D,qBAAmB,OAAO,CAAC,IAAI,qBAAgB,GAAK,CAAA,CAAC,CAAC;KAC3D;IAED,IAAM,QAAQ,GAAG,sBAAU,CAAC,UAAA,MAAM;QAGhC,IAAM,QAAQ,GAAG,IAAI,CAAC;QACtB,IAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC9C,IAAM,SAAS,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAM,CAAC,GAAG,SAAS,CAAC,GAAG,EAAO,CAAC;QAE/B,IAAM,QAAQ,GAAG,UAAC,EAAK;YACrB,IAAM,QAAQ,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC3B,IAAM,QAAQ,GAAG,IAAI,CAAC;YACtB,OAAO,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC;QAEF,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,UAAA,EAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAEY,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/softmax_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/softmax_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax_test.js new file mode 100644 index 0000000..001925a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax_test.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('softmax', test_util_1.ALL_ENVS, function () { + it('regular test', function () { + var y = tf.softmax(tf.tensor1d([2, 1, 3])); + test_util_1.expectArraysClose(y, [0.24472847, 0.09003057, 0.66524095]); + test_util_1.expectNumbersClose(y.get(0) + y.get(1) + y.get(2), 1); + }); + it('overflow', function () { + var y = tf.softmax(tf.tensor1d([100, 100])); + test_util_1.expectArraysClose(y, [0.5, 0.5]); + }); + it('underflow', function () { + var y = tf.softmax(tf.tensor1d([-100, -100])); + test_util_1.expectArraysClose(y, [0.5, 0.5]); + }); + it('Huge difference between probabilities', function () { + var y = tf.softmax(tf.tensor1d([-1000, +1000])); + test_util_1.expectArraysClose(y, [0, 1]); + }); + it('Propagates NaNs', function () { + var a = tf.tensor1d([2, 1, NaN]); + var y = tf.softmax(a); + test_util_1.expectArraysClose(y, [NaN, NaN, NaN]); + }); + it('2D, dim=1', function () { + var y = tf.softmax(tf.tensor2d([[2, 1, 3], [1, 3, 2]], [2, 3]), 1); + var expected = [ + 0.24472847, 0.09003057, 0.66524095, 0.09003057, 0.66524095, 0.24472847 + ]; + expect(y.rank).toBe(2); + test_util_1.expectArraysClose(y, expected); + }); + it('2D, implicit dim=1', function () { + var y = tf.softmax(tf.tensor2d([[2, 1, 3], [1, 3, 2]], [2, 3])); + var expected = [ + 0.24472847, 0.09003057, 0.66524095, 0.09003057, 0.66524095, 0.24472847 + ]; + expect(y.rank).toBe(2); + test_util_1.expectArraysClose(y, expected); + }); + it('2D, dim=0 throws error', function () { + var f = function () { + tf.softmax(tf.tensor2d([[2, 1, 3], [1, 3, 2]], [2, 3]), 0); + }; + expect(f).toThrowError(); + }); + it('1D gradient', function () { + var x = tf.tensor1d([10, 0, -1]); + var y = tf.softmax(x); + var dy = tf.tensor1d([1, 2, 3]); + var dx = tf.grad(function (x) { return x.softmax(); })(x, dy); + var totalSum = tf.sum(tf.mul(dy, y)); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, [ + (dy.get(0) - totalSum.get()) * y.get(0), + (dy.get(1) - totalSum.get()) * y.get(1), + (dy.get(2) - totalSum.get()) * y.get(2) + ]); + }); + it('2D gradient', function () { + var x = tf.tensor2d([10, 0, -1, 5, 4, 3], [2, 3]); + var y = tf.softmax(x); + var dy = tf.tensor2d([3, 2, 1, 1, 2, 3], [2, 3]); + var dx = tf.grad(function (x) { return x.softmax(); })(x, dy); + var axis = -1; + var totalSum = tf.sum(tf.mulStrict(dy, y), axis); + expect(dx.shape).toEqual(x.shape); + test_util_1.expectArraysClose(dx, [ + (dy.get(0, 0) - totalSum.get(0)) * y.get(0, 0), + (dy.get(0, 1) - totalSum.get(0)) * y.get(0, 1), + (dy.get(0, 2) - totalSum.get(0)) * y.get(0, 2), + (dy.get(1, 0) - totalSum.get(1)) * y.get(1, 0), + (dy.get(1, 1) - totalSum.get(1)) * y.get(1, 1), + (dy.get(1, 2) - totalSum.get(1)) * y.get(1, 2) + ]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.softmax({}); }) + .toThrowError(/Argument 'logits' passed to 'softmax' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var y = tf.softmax([2, 1, 3]); + test_util_1.expectArraysClose(y, [0.24472847, 0.09003057, 0.66524095]); + test_util_1.expectNumbersClose(y.get(0) + y.get(1) + y.get(2), 1); + }); +}); +//# sourceMappingURL=softmax_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/softmax_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax_test.js.map new file mode 100644 index 0000000..2a5ca82 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/softmax_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"softmax_test.js","sourceRoot":"","sources":["../../src/ops/softmax_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA6E;AAE7E,gCAAiB,CAAC,SAAS,EAAE,oBAAQ,EAAE;IACrC,EAAE,CAAC,cAAc,EAAE;QACjB,IAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7C,6BAAiB,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;QAC3D,8BAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,UAAU,EAAE;QACb,IAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QAE9C,6BAAiB,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,WAAW,EAAE;QACd,IAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEhD,6BAAiB,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EA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GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;SAC/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE;QACpC,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,OAAO,CAAC,EAAe,CAAC,EAA3B,CAA2B,CAAC;aACpC,YAAY,CAAC,wDAAwD,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEhC,6BAAiB,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;QAC3D,8BAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts new file mode 100644 index 0000000..a2e2bf3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts @@ -0,0 +1,5 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function stridedSlice_(x: T | TensorLike, begin: number[], end: number[], strides: number[], beginMask?: number, endMask?: number): T; +export declare const stridedSlice: typeof stridedSlice_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js new file mode 100644 index 0000000..e27cbcf --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var operation_1 = require("./operation"); +function stridedSlice_(x, begin, end, strides, beginMask, endMask) { + if (beginMask === void 0) { beginMask = 0; } + if (endMask === void 0) { endMask = 0; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'stridedSlice'); + return environment_1.ENV.engine.runKernel(function (backend) { return backend.stridedSlice($x, begin, end, strides, beginMask, endMask); }, { $x: $x }); +} +exports.stridedSlice = operation_1.op({ stridedSlice_: stridedSlice_ }); +//# sourceMappingURL=strided_slice.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js.map new file mode 100644 index 0000000..b2fe414 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.js.map @@ -0,0 +1 @@ +{"version":3,"file":"strided_slice.js","sourceRoot":"","sources":["../../src/ops/strided_slice.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,yCAA+B;AA+B/B,uBACI,CAAe,EAAE,KAAe,EAAE,GAAa,EAAE,OAAiB,EAClE,SAAa,EAAE,OAAW;IAA1B,0BAAA,EAAA,aAAa;IAAE,wBAAA,EAAA,WAAW;IAC5B,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;IACnD,OAAO,iBAAG,CAAC,MAAM,CAAC,SAAS,CAChB,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,YAAY,CAC3B,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EADrC,CACqC,EAChD,EAAC,EAAE,IAAA,EAAC,CAAM,CAAC;AACxB,CAAC;AAEY,QAAA,YAAY,GAAG,cAAE,CAAC,EAAC,aAAa,eAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice_test.js new file mode 100644 index 0000000..6d10b15 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice_test.js @@ -0,0 +1,178 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('stridedSlice', test_util_1.ALL_ENVS, function () { + it('stridedSlice should suport 1d tensor', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [0], [3], [2]); + expect(output.shape).toEqual([2]); + test_util_1.expectArraysClose(output, [0, 2]); + }); + it('stridedSlice should suport 1d tensor empty result', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [10], [3], [2]); + expect(output.shape).toEqual([0]); + test_util_1.expectArraysClose(output, []); + }); + it('stridedSlice should suport 1d tensor negative begin', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [-3], [3], [1]); + expect(output.shape).toEqual([2]); + test_util_1.expectArraysClose(output, [1, 2]); + }); + it('stridedSlice should suport 1d tensor out of range begin', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [-5], [3], [1]); + expect(output.shape).toEqual([3]); + test_util_1.expectArraysClose(output, [0, 1, 2]); + }); + it('stridedSlice should suport 1d tensor negative end', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [1], [-2], [1]); + expect(output.shape).toEqual([1]); + test_util_1.expectArraysClose(output, [1]); + }); + it('stridedSlice should suport 1d tensor out of range end', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [-3], [5], [1]); + expect(output.shape).toEqual([3]); + test_util_1.expectArraysClose(output, [1, 2, 3]); + }); + it('stridedSlice should suport 1d tensor begin mask', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [1], [3], [1], 1); + expect(output.shape).toEqual([3]); + test_util_1.expectArraysClose(output, [0, 1, 2]); + }); + it('stridedSlice should suport 1d tensor nagtive begin and stride', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [-2], [-3], [-1]); + expect(output.shape).toEqual([1]); + test_util_1.expectArraysClose(output, [2]); + }); + it('stridedSlice should suport 1d tensor' + + ' out of range begin and negative stride', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [5], [-2], [-1]); + expect(output.shape).toEqual([1]); + test_util_1.expectArraysClose(output, [3]); + }); + it('stridedSlice should suport 1d tensor nagtive end and stride', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [2], [-4], [-1]); + expect(output.shape).toEqual([2]); + test_util_1.expectArraysClose(output, [2, 1]); + }); + it('stridedSlice should suport 1d tensor' + + ' out of range end and negative stride', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [-3], [-5], [-1]); + expect(output.shape).toEqual([2]); + test_util_1.expectArraysClose(output, [1, 0]); + }); + it('stridedSlice should suport 1d tensor end mask', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [1], [3], [1], 0, 1); + expect(output.shape).toEqual([3]); + test_util_1.expectArraysClose(output, [1, 2, 3]); + }); + it('stridedSlice should suport 1d tensor negative stride', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [-1], [-4], [-1]); + expect(output.shape).toEqual([3]); + test_util_1.expectArraysClose(output, [3, 2, 1]); + }); + it('stridedSlice should suport 1d tensor even length stride', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [0], [2], [2]); + expect(output.shape).toEqual([1]); + test_util_1.expectArraysClose(output, [0]); + }); + it('stridedSlice should suport 1d tensor odd length stride', function () { + var tensor = tf.tensor1d([0, 1, 2, 3]); + var output = tf.stridedSlice(tensor, [0], [3], [2]); + expect(output.shape).toEqual([2]); + test_util_1.expectArraysClose(output, [0, 2]); + }); + it('stridedSlice should suport 2d tensor identity', function () { + var tensor = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var output = tf.stridedSlice(tensor, [0, 0], [2, 3], [1, 1]); + expect(output.shape).toEqual([2, 3]); + test_util_1.expectArraysClose(output, [1, 2, 3, 4, 5, 6]); + }); + it('stridedSlice should suport 2d tensor', function () { + var tensor = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var output = tf.stridedSlice(tensor, [1, 0], [2, 2], [1, 1]); + expect(output.shape).toEqual([1, 2]); + test_util_1.expectArraysClose(output, [4, 5]); + }); + it('stridedSlice should suport 2d tensor strides', function () { + var tensor = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var output = tf.stridedSlice(tensor, [0, 0], [2, 3], [2, 2]); + expect(output.shape).toEqual([1, 2]); + test_util_1.expectArraysClose(output, [1, 3]); + }); + it('stridedSlice should suport 2d tensor negative strides', function () { + var tensor = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var output = tf.stridedSlice(tensor, [1, -1], [2, -4], [2, -1]); + expect(output.shape).toEqual([1, 3]); + test_util_1.expectArraysClose(output, [6, 5, 4]); + }); + it('stridedSlice should suport 2d tensor begin mask', function () { + var tensor = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var output = tf.stridedSlice(tensor, [1, 0], [2, 2], [1, 1], 1); + expect(output.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(output, [1, 2, 4, 5]); + }); + it('stridedSlice should suport 2d tensor end mask', function () { + var tensor = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var output = tf.stridedSlice(tensor, [1, 0], [2, 2], [1, 1], 0, 2); + expect(output.shape).toEqual([1, 3]); + test_util_1.expectArraysClose(output, [4, 5, 6]); + }); + it('stridedSlice should suport 2d tensor' + + ' negative strides and begin mask', function () { + var tensor = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var output = tf.stridedSlice(tensor, [1, -2], [2, -4], [1, -1], 2); + expect(output.shape).toEqual([1, 3]); + test_util_1.expectArraysClose(output, [6, 5, 4]); + }); + it('stridedSlice should suport 2d tensor' + + ' negative strides and end mask', function () { + var tensor = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var output = tf.stridedSlice(tensor, [1, -2], [2, -3], [1, -1], 0, 2); + expect(output.shape).toEqual([1, 2]); + test_util_1.expectArraysClose(output, [5, 4]); + }); + it('stridedSlice should suport 3d tensor identity', function () { + var tensor = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [2, 3, 2]); + var output = tf.stridedSlice(tensor, [0, 0, 0], [2, 3, 2], [1, 1, 1]); + expect(output.shape).toEqual([2, 3, 2]); + test_util_1.expectArraysClose(output, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); + }); + it('stridedSlice should suport 3d tensor negative stride', function () { + var tensor = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [2, 3, 2]); + var output = tf.stridedSlice(tensor, [-1, -1, -1], [-3, -4, -3], [-1, -1, -1]); + expect(output.shape).toEqual([2, 3, 2]); + test_util_1.expectArraysClose(output, [12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]); + }); + it('stridedSlice should suport 3d tensor strided 2', function () { + var tensor = tf.tensor3d([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [2, 3, 2]); + var output = tf.stridedSlice(tensor, [0, 0, 0], [2, 3, 2], [2, 2, 2]); + expect(output.shape).toEqual([1, 2, 1]); + test_util_1.expectArraysClose(output, [1, 5]); + }); + it('stridedSlice should throw when passed a non-tensor', function () { + expect(function () { return tf.stridedSlice({}, [0], [0], [1]); }) + .toThrowError(/Argument 'x' passed to 'stridedSlice' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var tensor = [0, 1, 2, 3]; + var output = tf.stridedSlice(tensor, [0], [3], [2]); + expect(output.shape).toEqual([2]); + test_util_1.expectArraysClose(output, [0, 2]); + }); +}); +//# sourceMappingURL=strided_slice_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice_test.js.map new file mode 100644 index 0000000..1e9b919 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"strided_slice_test.js","sourceRoot":"","sources":["../../src/ops/strided_slice_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,cAAc,EAAE,oBAAQ,EAAE;IAC1C,EAAE,CAAC,sCAAsC,EAAE;QACzC,IAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzC,IAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,6BAAiB,CAAC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MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops.d.ts new file mode 100644 index 0000000..f477095 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops.d.ts @@ -0,0 +1,21 @@ +import { Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, Tensor6D } from '../tensor'; +import { TensorLike, TensorLike1D, TensorLike2D, TensorLike3D, TensorLike4D, TensorLike5D, TensorLike6D } from '../types'; +import { DataType, Rank, ShapeMap } from '../types'; +declare function tensor(values: TensorLike, shape?: ShapeMap[R], dtype?: DataType): Tensor; +declare function scalar(value: number | boolean, dtype?: DataType): Scalar; +declare function tensor1d(values: TensorLike1D, dtype?: DataType): Tensor1D; +declare function tensor2d(values: TensorLike2D, shape?: [number, number], dtype?: DataType): Tensor2D; +declare function tensor3d(values: TensorLike3D, shape?: [number, number, number], dtype?: DataType): Tensor3D; +declare function tensor4d(values: TensorLike4D, shape?: [number, number, number, number], dtype?: DataType): Tensor4D; +declare function tensor5d(values: TensorLike5D, shape?: [number, number, number, number, number], dtype?: DataType): Tensor5D; +declare function tensor6d(values: TensorLike6D, shape?: [number, number, number, number, number, number], dtype?: DataType): Tensor6D; +declare function ones(shape: ShapeMap[R], dtype?: DataType): Tensor; +declare function zeros(shape: ShapeMap[R], dtype?: DataType): Tensor; +declare function fill(shape: ShapeMap[R], value: number, dtype?: DataType): Tensor; +declare function onesLike_(x: T | TensorLike): T; +declare function zerosLike_(x: T | TensorLike): T; +declare function linspace(start: number, stop: number, num: number): Tensor1D; +declare function range(start: number, stop: number, step?: number, dtype?: 'float32' | 'int32'): Tensor1D; +export { fill, linspace, ones, range, scalar, tensor, tensor1d, tensor2d, tensor3d, tensor4d, tensor5d, tensor6d, zeros }; +export declare const onesLike: typeof onesLike_; +export declare const zerosLike: typeof zerosLike_; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops.js new file mode 100644 index 0000000..8f2d8b2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops.js @@ -0,0 +1,208 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_1 = require("../tensor"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util_1 = require("../util"); +var operation_1 = require("./operation"); +function tensor(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + if (!util_1.isTypedArray(values) && !Array.isArray(values) && + typeof values !== 'number' && typeof values !== 'boolean') { + throw new Error('values passed to tensor(values) must be an ' + + 'array of numbers or booleans, or a TypedArray'); + } + var inferredShape = util_1.inferShape(values); + if (shape != null && inferredShape.length !== 1) { + util_1.assertShapesMatch(shape, inferredShape, "Error creating a new Tensor. " + + ("Inferred shape (" + inferredShape + ") does not match the ") + + ("provided shape (" + shape + "). ")); + } + if (!util_1.isTypedArray(values) && !Array.isArray(values)) { + values = [values]; + } + shape = shape || inferredShape; + return tensor_1.Tensor.make(shape, { + values: util_1.toTypedArray(values, dtype, environment_1.ENV.get('DEBUG')) + }, dtype); +} +exports.tensor = tensor; +function scalar(value, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + if (util_1.isTypedArray(value) || Array.isArray(value)) { + throw new Error('Error creating a new Scalar: value must be a primitive ' + + '(number|boolean)'); + } + return tensor(value, [], dtype); +} +exports.scalar = scalar; +function tensor1d(values, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + util_1.assertNonNull(values); + var inferredShape = util_1.inferShape(values); + if (inferredShape.length !== 1) { + throw new Error('tensor1d() requires values to be a flat/TypedArray'); + } + return tensor(values, inferredShape, dtype); +} +exports.tensor1d = tensor1d; +function tensor2d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + util_1.assertNonNull(values); + if (shape != null && shape.length !== 2) { + throw new Error('tensor2d() requires shape to have two numbers'); + } + var inferredShape = util_1.inferShape(values); + if (inferredShape.length !== 2 && inferredShape.length !== 1) { + throw new Error('tensor2d() requires values to be number[][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor2d() requires shape to be provided when `values` ' + + 'are a flat/TypedArray'); + } + shape = shape || inferredShape; + return tensor(values, shape, dtype); +} +exports.tensor2d = tensor2d; +function tensor3d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + util_1.assertNonNull(values); + if (shape != null && shape.length !== 3) { + throw new Error('tensor3d() requires shape to have three numbers'); + } + var inferredShape = util_1.inferShape(values); + if (inferredShape.length !== 3 && inferredShape.length !== 1) { + throw new Error('tensor3d() requires values to be number[][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor3d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + shape = shape || inferredShape; + return tensor(values, shape, dtype); +} +exports.tensor3d = tensor3d; +function tensor4d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + util_1.assertNonNull(values); + if (shape != null && shape.length !== 4) { + throw new Error('tensor4d() requires shape to have four numbers'); + } + var inferredShape = util_1.inferShape(values); + if (inferredShape.length !== 4 && inferredShape.length !== 1) { + throw new Error('tensor4d() requires values to be number[][][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor4d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + shape = shape || inferredShape; + return tensor(values, shape, dtype); +} +exports.tensor4d = tensor4d; +function tensor5d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + util_1.assertNonNull(values); + if (shape != null && shape.length !== 5) { + throw new Error('tensor5d() requires shape to have five numbers'); + } + var inferredShape = util_1.inferShape(values); + if (inferredShape.length !== 5 && inferredShape.length !== 1) { + throw new Error('tensor5d() requires values to be ' + + 'number[][][][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor5d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + shape = shape || inferredShape; + return tensor(values, shape, dtype); +} +exports.tensor5d = tensor5d; +function tensor6d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + util_1.assertNonNull(values); + if (shape != null && shape.length !== 6) { + throw new Error('tensor6d() requires shape to have six numbers'); + } + var inferredShape = util_1.inferShape(values); + if (inferredShape.length !== 6 && inferredShape.length !== 1) { + throw new Error('tensor6d() requires values to be number[][][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor6d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + shape = shape || + inferredShape; + return tensor(values, shape, dtype); +} +exports.tensor6d = tensor6d; +function ones(shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + var values = util_1.makeOnesTypedArray(util_1.sizeFromShape(shape), dtype); + return tensor_1.Tensor.make(shape, { values: values }, dtype); +} +exports.ones = ones; +function zeros(shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + var values = util_1.makeZerosTypedArray(util_1.sizeFromShape(shape), dtype); + return tensor_1.Tensor.make(shape, { values: values }, dtype); +} +exports.zeros = zeros; +function fill(shape, value, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + var values = util_1.getTypedArrayFromDType(dtype, util_1.sizeFromShape(shape)); + values.fill(value); + return tensor_1.Tensor.make(shape, { values: values }, dtype); +} +exports.fill = fill; +function onesLike_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'onesLike'); + return ones($x.shape, $x.dtype); +} +function zerosLike_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'zerosLike'); + return zeros($x.shape, $x.dtype); +} +function linspace(start, stop, num) { + if (num === 0) { + throw new Error('Cannot request zero samples'); + } + var step = (stop - start) / (num - 1); + var values = util_1.makeZerosTypedArray(num, 'float32'); + values[0] = start; + for (var i = 1; i < values.length; i++) { + values[i] = values[i - 1] + step; + } + return tensor1d(values, 'float32'); +} +exports.linspace = linspace; +function range(start, stop, step, dtype) { + if (step === void 0) { step = 1; } + if (dtype === void 0) { dtype = 'float32'; } + if (step === 0) { + throw new Error('Cannot have a step of zero'); + } + var sameStartStop = start === stop; + var increasingRangeNegativeStep = start < stop && step < 0; + var decreasingRangePositiveStep = stop < start && step > 1; + if (sameStartStop || increasingRangeNegativeStep || + decreasingRangePositiveStep) { + return zeros([0], dtype); + } + var numElements = Math.abs(Math.ceil((stop - start) / step)); + var values = util_1.makeZerosTypedArray(numElements, dtype); + if (stop < start && step === 1) { + step = -1; + } + values[0] = start; + for (var i = 1; i < values.length; i++) { + values[i] = values[i - 1] + step; + } + return tensor1d(values, dtype); +} +exports.range = range; +exports.onesLike = operation_1.op({ onesLike_: onesLike_ }); +exports.zerosLike = operation_1.op({ zerosLike_: zerosLike_ }); +//# sourceMappingURL=tensor_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops.js.map new file mode 100644 index 0000000..eedde9b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/tensor_ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tensor_ops.js","sourceRoot":"","sources":["../../src/ops/tensor_ops.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AACnC,oCAAqG;AACrG,sDAAmD;AAGnD,gCAAiL;AACjL,yCAA+B;AA4B/B,gBACI,MAAkB,EAAE,KAAmB,EACvC,KAA2B;IAA3B,sBAAA,EAAA,iBAA2B;IAC7B,IAAI,CAAC,mBAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QA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A2B,EAAE;QAC/B,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;KAC1B;IAED,IAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/D,IAAM,MAAM,GAAG,0BAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAEvD,IAAI,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,EAAE;QAG9B,IAAI,GAAG,CAAC,CAAC,CAAC;KACX;IAED,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;KAClC;IAED,OAAO,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACjC,CAAC;AAMC,sBAAK;AAYM,QAAA,QAAQ,GAAG,cAAE,CAAC,EAAC,SAAS,WAAA,EAAC,CAAC,CAAC;AAC3B,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts new file mode 100644 index 0000000..62c3248 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts @@ -0,0 +1,8 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function topk_(x: T | TensorLike, k?: number, sorted?: boolean): { + values: T; + indices: T; +}; +export declare const topk: typeof topk_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/topk.js b/node_modules/@tensorflow/tfjs-core/dist/ops/topk.js new file mode 100644 index 0000000..20f3fde --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/topk.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var operation_1 = require("./operation"); +function topk_(x, k, sorted) { + if (k === void 0) { k = 1; } + if (sorted === void 0) { sorted = true; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'topk'); + if ($x.rank === 0) { + throw new Error('topk() expects the input to be of rank 1 or higher'); + } + var lastDim = $x.shape[$x.shape.length - 1]; + if (k > lastDim) { + throw new Error("'k' passed to topk() must be <= the last dimension (" + lastDim + ") " + + ("but got " + k)); + } + var _a = environment_1.ENV.engine.runKernel(function (b) { return b.topk($x, k, sorted); }, { $x: $x }), values = _a[0], indices = _a[1]; + return { values: values, indices: indices }; +} +exports.topk = operation_1.op({ topk_: topk_ }); +//# sourceMappingURL=topk.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/topk.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/topk.js.map new file mode 100644 index 0000000..c08644b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/topk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topk.js","sourceRoot":"","sources":["../../src/ops/topk.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,yCAA+B;AAyB/B,eACI,CAAe,EAAE,CAAK,EAAE,MAAa;IAApB,kBAAA,EAAA,KAAK;IAAE,uBAAA,EAAA,aAAa;IACvC,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3C,IAAI,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;KACvE;IACD,IAAM,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,IAAI,CAAC,GAAG,OAAO,EAAE;QACf,MAAM,IAAI,KAAK,CACX,yDAAuD,OAAO,OAAI;aAClE,aAAW,CAAG,CAAA,CAAC,CAAC;KACrB;IAEK,IAAA,mGACoD,EADnD,cAAM,EAAE,eAAO,CACqC;IAC3D,OAAO,EAAC,MAAM,QAAA,EAAE,OAAO,SAAA,EAAC,CAAC;AAC3B,CAAC;AAEY,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/topk_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/topk_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/topk_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/topk_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/topk_test.js new file mode 100644 index 0000000..cb25f83 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/topk_test.js @@ -0,0 +1,101 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var tensor_ops_1 = require("./tensor_ops"); +jasmine_util_1.describeWithFlags('topk', test_util_1.ALL_ENVS, function () { + it('1d array with default k', function () { + var a = tensor_ops_1.tensor1d([20, 10, 40, 30]); + var _a = tf.topk(a), values = _a.values, indices = _a.indices; + expect(values.shape).toEqual([1]); + expect(indices.shape).toEqual([1]); + expect(values.dtype).toBe('float32'); + expect(indices.dtype).toBe('int32'); + test_util_1.expectArraysClose(values, [40]); + test_util_1.expectArraysClose(indices, [2]); + }); + it('2d array with default k', function () { + var a = tensor_ops_1.tensor2d([[10, 50], [40, 30]]); + var _a = tf.topk(a), values = _a.values, indices = _a.indices; + expect(values.shape).toEqual([2, 1]); + expect(indices.shape).toEqual([2, 1]); + expect(values.dtype).toBe('float32'); + expect(indices.dtype).toBe('int32'); + test_util_1.expectArraysClose(values, [50, 40]); + test_util_1.expectArraysClose(indices, [1, 0]); + }); + it('2d array with k=2', function () { + var a = tensor_ops_1.tensor2d([ + [1, 5, 2], + [4, 3, 6], + [3, 2, 1], + [1, 2, 3], + ]); + var k = 2; + var _a = tf.topk(a, k), values = _a.values, indices = _a.indices; + expect(values.shape).toEqual([4, 2]); + expect(indices.shape).toEqual([4, 2]); + expect(values.dtype).toBe('float32'); + expect(indices.dtype).toBe('int32'); + test_util_1.expectArraysClose(values, [5, 2, 6, 4, 3, 2, 3, 2]); + test_util_1.expectArraysClose(indices, [1, 2, 2, 0, 0, 1, 2, 1]); + }); + it('3d array with k=3', function () { + var a = tensor_ops_1.tensor3d([ + [[1, 5, 2], [4, 3, 6]], + [[3, 2, 1], [1, 2, 3]], + ]); + var k = 3; + var _a = tf.topk(a, k), values = _a.values, indices = _a.indices; + expect(values.shape).toEqual([2, 2, 3]); + expect(indices.shape).toEqual([2, 2, 3]); + expect(values.dtype).toBe('float32'); + expect(indices.dtype).toBe('int32'); + test_util_1.expectArraysClose(values, [5, 2, 1, 6, 4, 3, 3, 2, 1, 3, 2, 1]); + test_util_1.expectArraysClose(indices, [1, 2, 0, 2, 0, 1, 0, 1, 2, 2, 1, 0]); + }); + it('topk(int32) propagates int32 dtype', function () { + var a = tensor_ops_1.tensor1d([2, 3, 1, 4], 'int32'); + var _a = tf.topk(a), values = _a.values, indices = _a.indices; + expect(values.shape).toEqual([1]); + expect(indices.shape).toEqual([1]); + expect(values.dtype).toBe('int32'); + expect(indices.dtype).toBe('int32'); + test_util_1.expectArraysClose(values, [4]); + test_util_1.expectArraysClose(indices, [3]); + }); + it('lower-index element appears first, k=4', function () { + var a = tensor_ops_1.tensor1d([1, 2, 2, 1], 'int32'); + var k = 4; + var _a = tf.topk(a, k), values = _a.values, indices = _a.indices; + expect(values.shape).toEqual([4]); + expect(indices.shape).toEqual([4]); + expect(values.dtype).toBe('int32'); + expect(indices.dtype).toBe('int32'); + test_util_1.expectArraysClose(values, [2, 2, 1, 1]); + test_util_1.expectArraysClose(indices, [1, 2, 0, 3]); + }); + it('throws when k > size of array', function () { + var a = tensor_ops_1.tensor2d([[10, 50], [40, 30]]); + expect(function () { return tf.topk(a, 3); }) + .toThrowError(/'k' passed to topk\(\) must be <= the last dimension/); + }); + it('throws when passed a scalar', function () { + var a = tensor_ops_1.scalar(2); + expect(function () { return tf.topk(a); }) + .toThrowError(/topk\(\) expects the input to be of rank 1 or higher/); + }); + it('accepts a tensor-like object, k=2', function () { + var a = [20, 10, 40, 30]; + var k = 2; + var _a = tf.topk(a, k), values = _a.values, indices = _a.indices; + expect(values.shape).toEqual([2]); + expect(indices.shape).toEqual([2]); + expect(values.dtype).toBe('float32'); + expect(indices.dtype).toBe('int32'); + test_util_1.expectArraysClose(values, [40, 30]); + test_util_1.expectArraysClose(indices, [2, 3]); + }); +}); +//# sourceMappingURL=topk_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/topk_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/topk_test.js.map new file mode 100644 index 0000000..92a8785 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/topk_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topk_test.js","sourceRoot":"","sources":["../../src/ops/topk_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,2CAAkE;AAElE,gCAAiB,CAAC,MAAM,EAAE,oBAAQ,EAAE;IAClC,EAAE,CAAC,yBAAyB,EAAE;QAC5B,IAAM,CAAC,GAAG,qBAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAC/B,IAAA,eAA8B,EA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CAAC,CAAC;QACpC,6BAAiB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts new file mode 100644 index 0000000..43395b0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts @@ -0,0 +1,5 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function transpose_(x: T | TensorLike, perm?: number[]): T; +export declare const transpose: typeof transpose_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js new file mode 100644 index 0000000..09d49f6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var axis_util = require("./axis_util"); +var operation_1 = require("./operation"); +function transpose_(x, perm) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'transpose'); + if (perm == null) { + perm = $x.shape.map(function (s, i) { return i; }).reverse(); + } + util.assert($x.rank === perm.length, "Error in transpose: rank of input " + $x.rank + " " + + ("must match length of perm " + perm + ".")); + perm.forEach(function (axis) { + util.assert(axis >= 0 && axis < $x.rank, "All entries in 'perm' must be between 0 and " + ($x.rank - 1) + + (" but got " + perm)); + }); + if ($x.rank <= 1) { + return $x.clone(); + } + var der = function (dy) { + var undoPerm = axis_util.getUndoAxesPermutation(perm); + return { $x: function () { return dy.transpose(undoPerm); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.transpose($x, perm); }, { $x: $x }, der); +} +exports.transpose = operation_1.op({ transpose_: transpose_ }); +//# sourceMappingURL=transpose.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js.map new file mode 100644 index 0000000..4bbc5f9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transpose.js","sourceRoot":"","sources":["../../src/ops/transpose.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,8BAAgC;AAChC,uCAAyC;AACzC,yCAA+B;AAoB/B,oBAAsC,CAAe,EAAE,IAAe;IACpE,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;IAEhD,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,EAAD,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;KAC5C;IACD,IAAI,CAAC,MAAM,CACP,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EACvB,uCAAqC,EAAE,CAAC,IAAI,MAAG;SAC3C,+BAA6B,IAAI,MAAG,CAAA,CAAC,CAAC;IAC9C,IAAI,CAAC,OAAO,CAAC,UAAA,IAAI;QACf,IAAI,CAAC,MAAM,CACP,IAAI,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC,IAAI,EAC3B,kDAA+C,EAAE,CAAC,IAAI,GAAG,CAAC,CAAE;aACxD,cAAY,IAAM,CAAA,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE;QAChB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC;KACnB;IAED,IAAM,GAAG,GAAG,UAAC,EAAK;QAChB,IAAM,QAAQ,GAAG,SAAS,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,EAAC,EAAE,EAAE,cAAM,OAAA,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAtB,CAAsB,EAAC,CAAC;IAC5C,CAAC,CAAC;IACF,OAAO,iBAAG,CAAC,MAAM,CAAC,SAAS,CACvB,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,EAA3B,CAA2B,EAAE,EAAC,EAAE,IAAA,EAAC,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC;AAEY,QAAA,SAAS,GAAG,cAAE,CAAC,EAAC,UAAU,YAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/transpose_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/transpose_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose_test.js new file mode 100644 index 0000000..544d572 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose_test.js @@ -0,0 +1,110 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('transpose', test_util_1.ALL_ENVS, function () { + it('of scalar is no-op', function () { + var a = tf.scalar(3); + test_util_1.expectArraysClose(tf.transpose(a), [3]); + }); + it('of 1D is no-op', function () { + var a = tf.tensor1d([1, 2, 3]); + test_util_1.expectArraysClose(tf.transpose(a), [1, 2, 3]); + }); + it('of scalar with perm of incorrect rank throws error', function () { + var a = tf.scalar(3); + var perm = [0]; + expect(function () { return tf.transpose(a, perm); }).toThrowError(); + }); + it('of 1d with perm out of bounds throws error', function () { + var a = tf.tensor1d([1, 2, 3]); + var perm = [1]; + expect(function () { return tf.transpose(a, perm); }).toThrowError(); + }); + it('of 1d with perm incorrect rank throws error', function () { + var a = tf.tensor1d([1, 2, 3]); + var perm = [0, 0]; + expect(function () { return tf.transpose(a, perm); }).toThrowError(); + }); + it('2D (no change)', function () { + var t = tf.tensor2d([1, 11, 2, 22, 3, 33, 4, 44], [2, 4]); + var t2 = tf.transpose(t, [0, 1]); + expect(t2.shape).toEqual(t.shape); + test_util_1.expectArraysClose(t2, t); + }); + it('2D (transpose)', function () { + var t = tf.tensor2d([1, 11, 2, 22, 3, 33, 4, 44], [2, 4]); + var t2 = tf.transpose(t, [1, 0]); + expect(t2.shape).toEqual([4, 2]); + test_util_1.expectArraysClose(t2, [1, 3, 11, 33, 2, 4, 22, 44]); + }); + it('3D [r, c, d] => [d, r, c]', function () { + var t = tf.tensor3d([1, 11, 2, 22, 3, 33, 4, 44], [2, 2, 2]); + var t2 = tf.transpose(t, [2, 0, 1]); + expect(t2.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(t2, [1, 2, 3, 4, 11, 22, 33, 44]); + }); + it('3D [r, c, d] => [d, c, r]', function () { + var t = tf.tensor3d([1, 11, 2, 22, 3, 33, 4, 44], [2, 2, 2]); + var t2 = tf.transpose(t, [2, 1, 0]); + expect(t2.shape).toEqual([2, 2, 2]); + test_util_1.expectArraysClose(t2, [1, 3, 2, 4, 11, 33, 22, 44]); + }); + it('5D [r, c, d, e, f] => [r, c, f, e, d]', function () { + var t = tf.tensor5d([1, 11, 2, 22, 3, 33, 4, 44], [1, 1, 2, 2, 2]); + var t2 = tf.transpose(t, [0, 1, 4, 3, 2]); + expect(t2.shape).toEqual([1, 1, 2, 2, 2]); + test_util_1.expectArraysClose(t2, [1, 3, 2, 4, 11, 33, 22, 44]); + }); + it('5D [r, c, d, e, f] => [r, c, d, f, e]', function () { + var t = tf.tensor5d([1, 11, 2, 22, 3, 33, 4, 44], [1, 1, 2, 2, 2]); + var t2 = tf.transpose(t, [0, 1, 4, 2, 3]); + expect(t2.shape).toEqual([1, 1, 2, 2, 2]); + test_util_1.expectArraysClose(t2, [1, 2, 3, 4, 11, 22, 33, 44]); + }); + it('5D [r, c, d, e, f] => [c, r, d, e, f]', function () { + var t = tf.tensor5d([1, 11, 2, 22, 3, 33, 4, 44], [1, 1, 2, 2, 2]); + var t2 = tf.transpose(t, [1, 0, 2, 3, 4]); + expect(t2.shape).toEqual([1, 1, 2, 2, 2]); + test_util_1.expectArraysClose(t2, [1, 11, 2, 22, 3, 33, 4, 44]); + }); + it('6D [r, c, d, e, f, g] => [g, c, f, e, d, r]', function () { + var t = tf.tensor6d([1, 11, 2, 22, 3, 33, 4, 44, 1, 12, 3, 23, 4, 34, 5, 45], [1, 1, 2, 2, 2, 2]); + var t2 = tf.transpose(t, [5, 1, 4, 3, 2, 0]); + expect(t2.shape).toEqual([2, 1, 2, 2, 2, 1]); + test_util_1.expectArraysClose(t2, [1, 1, 3, 4, 2, 3, 4, 5, 11, 12, 33, 34, 22, 23, 44, 45]); + }); + it('6D [r, c, d, e, f, g] => [r, c, d, f, g, e]', function () { + var t = tf.tensor6d([1, 11, 2, 22, 3, 33, 4, 44, 1, 12, 3, 23, 4, 34, 5, 45], [1, 1, 2, 2, 2, 2]); + var t2 = tf.transpose(t, [0, 1, 5, 2, 3, 4]); + expect(t2.shape).toEqual([1, 1, 2, 2, 2, 2]); + test_util_1.expectArraysClose(t2, [1, 2, 3, 4, 1, 3, 4, 5, 11, 22, 33, 44, 12, 23, 34, 45]); + }); + it('6D [r, c, d, e, f, g] => [c, r, g, e, f, d]', function () { + var t = tf.tensor6d([1, 11, 2, 22, 3, 33, 4, 44, 1, 12, 3, 23, 4, 34, 5, 45], [1, 1, 2, 2, 2, 2]); + var t2 = tf.transpose(t, [1, 0, 5, 3, 4, 2]); + expect(t2.shape).toEqual([1, 1, 2, 2, 2, 2]); + test_util_1.expectArraysClose(t2, [1, 1, 2, 3, 3, 4, 4, 5, 11, 12, 22, 23, 33, 34, 44, 45]); + }); + it('gradient 3D [r, c, d] => [d, c, r]', function () { + var t = tf.tensor3d([1, 11, 2, 22, 3, 33, 4, 44], [2, 2, 2]); + var perm = [2, 1, 0]; + var dy = tf.tensor3d([111, 211, 121, 221, 112, 212, 122, 222], [2, 2, 2]); + var dt = tf.grad(function (t) { return t.transpose(perm); })(t, dy); + expect(dt.shape).toEqual(t.shape); + expect(dt.dtype).toEqual('float32'); + test_util_1.expectArraysClose(dt, [111, 112, 121, 122, 211, 212, 221, 222]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.transpose({}); }) + .toThrowError(/Argument 'x' passed to 'transpose' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var t = [[1, 11, 2, 22], [3, 33, 4, 44]]; + var res = tf.transpose(t, [1, 0]); + expect(res.shape).toEqual([4, 2]); + test_util_1.expectArraysClose(res, [1, 3, 11, 33, 2, 4, 22, 44]); + }); +}); +//# sourceMappingURL=transpose_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/transpose_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose_test.js.map new file mode 100644 index 0000000..591a9c4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/transpose_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transpose_test.js","sourceRoot":"","sources":["../../src/ops/transpose_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,WAAW,EAAE,oBAAQ,EAAE;IACvC,EAAE,CAAC,oBAAoB,EAAE;QACvB,IAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvB,6BAAiB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE;QACn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E;QACjC,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC3C,IAAM,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEpC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,6BAAiB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops.d.ts new file mode 100644 index 0000000..49a73e1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops.d.ts @@ -0,0 +1,67 @@ +import { Tensor } from '../tensor'; +import { TensorLike } from '../types'; +declare function neg_(x: T | TensorLike): T; +declare function ceil_(x: T | TensorLike): T; +declare function floor_(x: T | TensorLike): T; +declare function sign_(x: T | TensorLike): T; +declare function round_(x: T | TensorLike): T; +declare function exp_(x: T | TensorLike): T; +declare function expm1_(x: T | TensorLike): T; +declare function log_(x: T | TensorLike): T; +declare function log1p_(x: T | TensorLike): T; +declare function sqrt_(x: T | TensorLike): T; +declare function rsqrt_(x: T | TensorLike): T; +declare function square_(x: T | TensorLike): T; +declare function reciprocal_(x: T | TensorLike): T; +declare function abs_(x: T | TensorLike): T; +declare function clipByValue_(x: T | TensorLike, clipValueMin: number, clipValueMax: number): T; +declare function sigmoid_(x: T | TensorLike): T; +declare function logSigmoid_(x: T | TensorLike): T; +declare function softplus_(x: T | TensorLike): T; +declare function sin_(x: T | TensorLike): T; +declare function cos_(x: T | TensorLike): T; +declare function tan_(x: T | TensorLike): T; +declare function asin_(x: T | TensorLike): T; +declare function acos_(x: T | TensorLike): T; +declare function atan_(x: T | TensorLike): T; +declare function sinh_(x: T | TensorLike): T; +declare function cosh_(x: T | TensorLike): T; +declare function tanh_(x: T | TensorLike): T; +declare function asinh_(x: T | TensorLike): T; +declare function acosh_(x: T | TensorLike): T; +declare function atanh_(x: T | TensorLike): T; +declare function erf_(x: T | TensorLike): T; +declare function step_(x: T | TensorLike, alpha?: number): T; +export declare const abs: typeof abs_; +export declare const acos: typeof acos_; +export declare const acosh: typeof acosh_; +export declare const asin: typeof asin_; +export declare const asinh: typeof asinh_; +export declare const atan: typeof atan_; +export declare const atanh: typeof atanh_; +export declare const ceil: typeof ceil_; +export declare const clipByValue: typeof clipByValue_; +export declare const cos: typeof cos_; +export declare const cosh: typeof cosh_; +export declare const erf: typeof erf_; +export declare const exp: typeof exp_; +export declare const expm1: typeof expm1_; +export declare const floor: typeof floor_; +export declare const log: typeof log_; +export declare const log1p: typeof log1p_; +export declare const logSigmoid: typeof logSigmoid_; +export declare const neg: typeof neg_; +export declare const reciprocal: typeof reciprocal_; +export declare const round: typeof round_; +export declare const rsqrt: typeof rsqrt_; +export declare const sigmoid: typeof sigmoid_; +export declare const sign: typeof sign_; +export declare const sin: typeof sin_; +export declare const sinh: typeof sinh_; +export declare const softplus: typeof softplus_; +export declare const sqrt: typeof sqrt_; +export declare const square: typeof square_; +export declare const step: typeof step_; +export declare const tan: typeof tan_; +export declare const tanh: typeof tanh_; +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops.js b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops.js new file mode 100644 index 0000000..f3ae7d3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops.js @@ -0,0 +1,289 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var tensor_util_env_1 = require("../tensor_util_env"); +var util = require("../util"); +var operation_1 = require("./operation"); +var tensor_ops_1 = require("./tensor_ops"); +function neg_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'neg'); + var grad = function (dy) { + return { $x: function () { return dy.neg(); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.neg($x); }, { $x: $x }, grad); +} +function ceil_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'ceil'); + var grad = function (dy) { + return { $x: function () { return tensor_ops_1.zerosLike(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.ceil($x); }, { $x: $x }, grad); +} +function floor_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'floor'); + var grad = function (dy) { + return { $x: function () { return tensor_ops_1.zerosLike(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.floor($x); }, { $x: $x }, grad); +} +function sign_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'sign'); + var grad = function (dy) { + return { $x: function () { return tensor_ops_1.zerosLike(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.sign($x); }, { $x: $x }, grad); +} +function round_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'round'); + var grad = function (dy) { + return { $x: function () { return tensor_ops_1.zerosLike(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.round($x); }, { $x: $x }, grad); +} +function exp_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'exp'); + var bck = function (dy, saved) { + var y = saved[0]; + return { $x: function () { return dy.mulStrict(y); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend, save) { return save(backend.exp($x)); }, { $x: $x }, bck); +} +function expm1_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'expm1'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.exp()); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.expm1($x); }, { $x: $x }, grad); +} +function log_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'log'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.toFloat()); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.log($x); }, { $x: $x }, grad); +} +function log1p_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'log1p'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.add(tensor_ops_1.scalar(1))); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.log1p($x); }, { $x: $x }, grad); +} +function sqrt_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'sqrt'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.toFloat().sqrt().mul(tensor_ops_1.scalar(2))); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.sqrt($x); }, { $x: $x }, grad); +} +function rsqrt_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'rsqrt'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.pow(tensor_ops_1.scalar(1.5)).mul(tensor_ops_1.scalar(2))).neg(); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.rsqrt($x); }, { $x: $x }, grad); +} +function square_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'square'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.toFloat().mul(tensor_ops_1.scalar(2))); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.square($x); }, { $x: $x }, grad); +} +function reciprocal_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'reciprocal'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.square().neg()); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.reciprocal($x); }, { $x: $x }, grad); +} +function abs_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'abs'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.toFloat().step(-1)); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.abs($x); }, { $x: $x }, grad); +} +function clipByValue_(x, clipValueMin, clipValueMax) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'clipByValue'); + util.assert((clipValueMin <= clipValueMax), "Error in clip: min (" + clipValueMin + ") must be " + + ("less than or equal to max (" + clipValueMax + ").")); + var grad = function (dy) { + return { + $x: function () { return dy.where($x.greaterEqual(tensor_ops_1.scalar(clipValueMin)) + .logicalAnd($x.lessEqual(tensor_ops_1.scalar(clipValueMax))), tensor_ops_1.zerosLike(dy)); }, + }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.clip($x, clipValueMin, clipValueMax); }, { $x: $x }, grad); +} +function sigmoid_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'sigmoid'); + var grad = function (dy, saved) { + var y = saved[0]; + return { $x: function () { return dy.mulStrict(y.mul(tensor_ops_1.scalar(1).sub(y))); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend, save) { return save(backend.sigmoid($x)); }, { $x: $x }, grad); +} +function logSigmoid_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'logSigmoid'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.neg().sigmoid()); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.softplus($x.neg()).neg(); }, { $x: $x }, grad); +} +function softplus_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'softplus'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.sigmoid()); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.softplus($x); }, { $x: $x }, grad); +} +function sin_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'sin'); + var grad = function (dy) { + return { $x: function () { return $x.toFloat().cos().mulStrict(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.sin($x); }, { $x: $x }, grad); +} +function cos_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'cos'); + var grad = function (dy) { + return { $x: function () { return $x.toFloat().sin().neg().mulStrict(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.cos($x); }, { $x: $x }, grad); +} +function tan_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'tan'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.cos().square()); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.tan($x); }, { $x: $x }, grad); +} +function asin_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'asin'); + var grad = function (dy) { + return { + $x: function () { return dy.divStrict(tensor_ops_1.scalar(1).sub($x.toFloat().square()).sqrt()); } + }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.asin($x); }, { $x: $x }, grad); +} +function acos_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'acos'); + var grad = function (dy) { + return { + $x: function () { + return dy.divStrict(tensor_ops_1.scalar(1).sub($x.toFloat().square()).sqrt()).neg(); + } + }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.acos($x); }, { $x: $x }, grad); +} +function atan_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'atan'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict(tensor_ops_1.scalar(1).add($x.toFloat().square())); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.atan($x); }, { $x: $x }, grad); +} +function sinh_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'sinh'); + var grad = function (dy) { + return { $x: function () { return $x.toFloat().cosh().mulStrict(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.sinh($x); }, { $x: $x }, grad); +} +function cosh_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'cosh'); + var grad = function (dy) { + return { $x: function () { return $x.toFloat().sinh().mulStrict(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.cosh($x); }, { $x: $x }, grad); +} +function tanh_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'tanh'); + var grad = function (dy, saved) { + var y = saved[0]; + return { $x: function () { return tensor_ops_1.scalar(1).sub(y.square()).mulStrict(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend, save) { return save(backend.tanh($x)); }, { $x: $x }, grad); +} +function asinh_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'asinh'); + var grad = function (dy) { + return { + $x: function () { return dy.divStrict(tensor_ops_1.scalar(1).add($x.toFloat().square()).sqrt()); } + }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.asinh($x); }, { $x: $x }, grad); +} +function acosh_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'acosh'); + var grad = function (dy) { + return { + $x: function () { return dy.divStrict($x.toFloat().square().sub(tensor_ops_1.scalar(1)).sqrt()); } + }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.acosh($x); }, { $x: $x }, grad); +} +function atanh_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'atanh'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict(tensor_ops_1.scalar(1).sub($x.toFloat().square())); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.atanh($x); }, { $x: $x }, grad); +} +function erf_(x) { + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'erf'); + util.assert($x.dtype === 'int32' || $x.dtype === 'float32', 'Input dtype must be `int32` or `float32`.'); + if ($x.dtype === 'int32') { + $x = $x.toFloat(); + } + var grad = function (dy) { + return { + $x: function () { return dy.mulStrict(tensor_ops_1.scalar(2 / Math.sqrt(Math.PI)).mul($x.square().neg().exp())); } + }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.erf($x); }, { $x: $x }, grad); +} +function step_(x, alpha) { + if (alpha === void 0) { alpha = 0.0; } + var $x = tensor_util_env_1.convertToTensor(x, 'x', 'step'); + var grad = function (dy) { + return { $x: function () { return tensor_ops_1.zerosLike(dy); } }; + }; + return environment_1.ENV.engine.runKernel(function (backend) { return backend.step($x, alpha); }, { $x: $x }, grad); +} +exports.abs = operation_1.op({ abs_: abs_ }); +exports.acos = operation_1.op({ acos_: acos_ }); +exports.acosh = operation_1.op({ acosh_: acosh_ }); +exports.asin = operation_1.op({ asin_: asin_ }); +exports.asinh = operation_1.op({ asinh_: asinh_ }); +exports.atan = operation_1.op({ atan_: atan_ }); +exports.atanh = operation_1.op({ atanh_: atanh_ }); +exports.ceil = operation_1.op({ ceil_: ceil_ }); +exports.clipByValue = operation_1.op({ clipByValue_: clipByValue_ }); +exports.cos = operation_1.op({ cos_: cos_ }); +exports.cosh = operation_1.op({ cosh_: cosh_ }); +exports.erf = operation_1.op({ erf_: erf_ }); +exports.exp = operation_1.op({ exp_: exp_ }); +exports.expm1 = operation_1.op({ expm1_: expm1_ }); +exports.floor = operation_1.op({ floor_: floor_ }); +exports.log = operation_1.op({ log_: log_ }); +exports.log1p = operation_1.op({ log1p_: log1p_ }); +exports.logSigmoid = operation_1.op({ logSigmoid_: logSigmoid_ }); +exports.neg = operation_1.op({ neg_: neg_ }); +exports.reciprocal = operation_1.op({ reciprocal_: reciprocal_ }); +exports.round = operation_1.op({ round_: round_ }); +exports.rsqrt = operation_1.op({ rsqrt_: rsqrt_ }); +exports.sigmoid = operation_1.op({ sigmoid_: sigmoid_ }); +exports.sign = operation_1.op({ sign_: sign_ }); +exports.sin = operation_1.op({ sin_: sin_ }); +exports.sinh = operation_1.op({ sinh_: sinh_ }); +exports.softplus = operation_1.op({ softplus_: softplus_ }); +exports.sqrt = operation_1.op({ sqrt_: sqrt_ }); +exports.square = operation_1.op({ square_: square_ }); +exports.step = operation_1.op({ step_: step_ }); +exports.tan = operation_1.op({ tan_: tan_ }); +exports.tanh = operation_1.op({ tanh_: tanh_ }); +//# sourceMappingURL=unary_ops.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops.js.map new file mode 100644 index 0000000..7f6cf8d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unary_ops.js","sourceRoot":"","sources":["../../src/ops/unary_ops.ts"],"names":[],"mappings":";;AAiBA,8CAAmC;AAEnC,sDAAmD;AAEnD,8BAAgC;AAEhC,yCAA+B;AAC/B,2CAA+C;AAc/C,cAAgC,CAAe;IAC7C,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAE1C,IAAM,IAAI,GAAG,UAAC,EAAK;QACjB,OAAO,EAAC,EAAE,EAAE,cAAM,OAAA,EAAE,CAAC,GAAG,EAAE,EAAR,CAAQ,EAAC,CAAC;IAC9B,CAAC,CAAC;IACF,OAAO,iBAAG,CAAC,MAAM,CAAC,SAAS,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAf,CAAe,EAAE,EAAC,EAAE,IAAA,EAAC,EAAE,IAAI,CAAC,CAAC;AACtE,CAAC;AAaD,eAAiC,CAAe;IAC9C,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAG3C,IAAM,IAAI,GAAG,UAAC,EAAK;QACjB,OAAO,EAAC,EAAE,EAAE,cAAM,OAAA,sBAAS,CAAC,EAAE,CAAC,EAAb,CAAa,EAAC,CAAC;IACnC,CAAC,CAAC;IACF,OAAO,iBAAG,CAAC,MAAM,CAAC,SAAS,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAhB,CAAgB,EAAE,EAAC,EAAE,IAAA,EAAC,EAAE,IAAI,CAAC,CAAC;AACvE,CAAC;AAaD,gBAAkC,CAAe;IAC/C,IAAM,EAAE,GAAG,iCAAe,CAAC,CAAC,E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C/B,QAAA,KAAK,GAAG,cAAE,CAAC,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACrB,QAAA,KAAK,GAAG,cAAE,CAAC,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACrB,QAAA,OAAO,GAAG,cAAE,CAAC,EAAC,QAAQ,UAAA,EAAC,CAAC,CAAC;AACzB,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;AACnB,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;AACnB,QAAA,QAAQ,GAAG,cAAE,CAAC,EAAC,SAAS,WAAA,EAAC,CAAC,CAAC;AAC3B,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;AACnB,QAAA,MAAM,GAAG,cAAE,CAAC,EAAC,OAAO,SAAA,EAAC,CAAC,CAAC;AACvB,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC;AACnB,QAAA,GAAG,GAAG,cAAE,CAAC,EAAC,IAAI,MAAA,EAAC,CAAC,CAAC;AACjB,QAAA,IAAI,GAAG,cAAE,CAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops_test.js b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops_test.js new file mode 100644 index 0000000..3230785 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops_test.js @@ -0,0 +1,2240 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var util = require("../util"); +var selu_util = require("./selu_util"); +jasmine_util_1.describeWithFlags('relu', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([1, -2, 0, 3, -0.1]); + var result = tf.relu(a); + test_util_1.expectArraysClose(result, [1, 0, 0, 3, 0]); + }); + it('5D', function () { + var a = tf.tensor5d([1, -2, 5, -3], [1, 2, 2, 1, 1]); + var result = tf.relu(a); + test_util_1.expectArraysClose(result, [1, 0, 5, 0]); + }); + it('6D', function () { + var a = tf.tensor6d([1, -2, 5, -3, -1, 4, 7, 8], [1, 2, 2, 2, 1, 1]); + var result = tf.relu(a); + test_util_1.expectArraysClose(result, [1, 0, 5, 0, 0, 4, 7, 8]); + }); + it('does nothing to positive values', function () { + var a = tf.scalar(1); + var result = tf.relu(a); + test_util_1.expectNumbersClose(result.get(), 1); + }); + it('sets negative values to 0', function () { + var a = tf.scalar(-1); + var result = tf.relu(a); + test_util_1.expectNumbersClose(result.get(), 0); + }); + it('preserves zero values', function () { + var a = tf.scalar(0); + var result = tf.relu(a); + test_util_1.expectNumbersClose(result.get(), 0); + }); + it('propagates NaNs, float32', function () { + var a = tf.tensor1d([1, -2, 0, 3, -0.1, NaN]); + var result = tf.relu(a); + expect(result.dtype).toBe('float32'); + test_util_1.expectArraysClose(result, [1, 0, 0, 3, 0, NaN]); + }); + it('gradients: positive scalar', function () { + var a = tf.scalar(3); + var dy = tf.scalar(5); + var grad = tf.grad(function (a) { return tf.relu(a); }); + var da = grad(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [5]); + }); + it('gradients: negative scalar', function () { + var a = tf.scalar(-3); + var dy = tf.scalar(5); + var grad = tf.grad(function (a) { return tf.relu(a); }); + var da = grad(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [0]); + }); + it('gradients: array', function () { + var a = tf.tensor2d([1, -1, 0, .1], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var grad = tf.grad(function (a) { return tf.relu(a); }); + var da = grad(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1, 0, 0, 4]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.relu({}); }) + .toThrowError(/Argument 'x' passed to 'relu' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.relu([1, -2, 0, 3, -0.1]); + test_util_1.expectArraysClose(result, [1, 0, 0, 3, 0]); + }); +}); +jasmine_util_1.describeWithFlags('abs', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([1, -2, 0, 3, -0.1]); + var result = tf.abs(a); + test_util_1.expectArraysClose(result, [1, 2, 0, 3, 0.1]); + }); + it('5D', function () { + var a = tf.tensor5d([1, -2, 0, -3], [1, 2, 2, 1, 1]); + var result = tf.abs(a); + test_util_1.expectArraysClose(result, [1, 2, 0, 3]); + }); + it('6D', function () { + var a = tf.tensor6d([1, -2, 5, -3, -1, 4, 7, 8], [1, 2, 2, 2, 1, 1]); + var result = tf.abs(a); + test_util_1.expectArraysClose(result, [1, 2, 5, 3, 1, 4, 7, 8]); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([1, -2, 0, 3, -0.1, NaN]); + var result = tf.abs(a); + test_util_1.expectArraysClose(result, [1, 2, 0, 3, 0.1, NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(4); + var dy = tf.scalar(8); + var da = tf.grad(function (a) { return tf.abs(a); })(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [8 * 1]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1, 2, -3, 5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var da = tf.grad(function (a) { return tf.abs(a); })(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 1, 2 * 1, 3 * -1, 4 * 1]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([3, -1, -2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var da = tf.grad(function (a) { return tf.abs(a); })(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * 1, 2 * -1, 3 * -1, 4 * 1]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.abs({}); }) + .toThrowError(/Argument 'x' passed to 'abs' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.abs([1, -2, 0, 3, -0.1]); + test_util_1.expectArraysClose(result, [1, 2, 0, 3, 0.1]); + }); +}); +jasmine_util_1.describeWithFlags('step', test_util_1.ALL_ENVS, function () { + it('with 1d tensor', function () { + var a = tf.tensor1d([1, -2, -.01, 3, -0.1]); + var result = tf.step(a); + test_util_1.expectArraysClose(result, [1, 0, 0, 1, 0]); + }); + it('with 1d tensor and alpha', function () { + var a = tf.tensor1d([1, -2, -.01, 3, NaN]); + var result = tf.step(a, 0.1); + test_util_1.expectArraysClose(result, [1, 0.1, 0.1, 1, NaN]); + }); + it('with 2d tensor', function () { + var a = tf.tensor2d([1, -5, -3, 4], [2, 2]); + var result = tf.step(a); + expect(result.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(result, [1, 0, 0, 1]); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([1, -2, -.01, 3, NaN]); + var result = tf.step(a); + test_util_1.expectArraysClose(result, [1, 0, 0, 1, NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(-4); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.step(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1, 2, -3, 5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.step(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([3, -1, -2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.step(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.step({}); }) + .toThrowError(/Argument 'x' passed to 'step' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.step([1, -2, -.01, 3, -0.1]); + test_util_1.expectArraysClose(result, [1, 0, 0, 1, 0]); + }); +}); +jasmine_util_1.describeWithFlags('neg', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([1, -3, 2, 7, -4]); + var result = tf.neg(a); + test_util_1.expectArraysClose(result, [-1, 3, -2, -7, 4]); + }); + it('propagate NaNs', function () { + var a = tf.tensor1d([1, -3, 2, 7, NaN]); + var result = tf.neg(a); + var expected = [-1, 3, -2, -7, NaN]; + test_util_1.expectArraysClose(result, expected); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(4); + var dy = tf.scalar(8); + var da = tf.grad(function (a) { return tf.neg(a); })(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [8 * -1]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1, 2, -3, 5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var da = tf.grad(function (a) { return tf.neg(a); })(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * -1, 2 * -1, 3 * -1, 4 * -1]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([3, -1, -2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var da = tf.grad(function (a) { return tf.neg(a); })(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [1 * -1, 2 * -1, 3 * -1, 4 * -1]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.neg({}); }) + .toThrowError(/Argument 'x' passed to 'neg' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.neg([1, -3, 2, 7, -4]); + test_util_1.expectArraysClose(result, [-1, 3, -2, -7, 4]); + }); +}); +jasmine_util_1.describeWithFlags('sigmoid', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.sigmoid(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = 1 / (1 + Math.exp(-values[i])); + } + test_util_1.expectArraysClose(result, expected); + }); + it('6D', function () { + var a = tf.ones([2, 2, 2, 2, 2, 2]); + var result = tf.sigmoid(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = 1 / (1 + Math.exp(-1.0)); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([3, NaN]); + var res = tf.sigmoid(a); + test_util_1.expectArraysClose(res, [1 / (1 + Math.exp(-3)), NaN]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1, 2, -3, 5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var da = tf.grad(function (a) { return tf.sigmoid(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + var y = 1 / (1 + Math.exp(-a.get(i))); + expected[i] = dy.get(i) * y * (1 - y); + } + test_util_1.expectArraysClose(da, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.sigmoid({}); }) + .toThrowError(/Argument 'x' passed to 'sigmoid' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [1, -3, 2, 7, -4]; + var result = tf.sigmoid(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = 1 / (1 + Math.exp(-values[i])); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('logSigmoid', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.logSigmoid(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.log(1 / (1 + Math.exp(-values[i]))); + } + test_util_1.expectArraysClose(result, expected); + }); + it('scalar', function () { + var a = tf.scalar(-2); + var result = tf.logSigmoid(a); + var expected = [Math.log(1 / (1 + Math.exp(2)))]; + test_util_1.expectArraysClose(result, expected); + }); + it('tensor2D', function () { + var values = [1, 2, -3, 5]; + var a = tf.tensor2d(values, [2, 2]); + var result = tf.logSigmoid(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.log(1 / (1 + Math.exp(-values[i]))); + } + test_util_1.expectArraysClose(result, expected); + }); + it('larger magnitude negative inputs', function () { + var values = [-100, -200, -3000]; + var a = tf.tensor1d(values); + var result = tf.logSigmoid(a); + var expected = [-100, -200, -3000]; + test_util_1.expectArraysClose(result, expected); + }); + it('larger magnitude positive inputs', function () { + var values = [100, 200, 3000, 50000]; + var a = tf.tensor1d(values); + var result = tf.logSigmoid(a); + var expected = [0, 0, 0, 0]; + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([3, NaN]); + var res = tf.logSigmoid(a); + test_util_1.expectArraysClose(res, [Math.log(1 / (1 + Math.exp(-3))), NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(3); + var dy = tf.scalar(4); + var da = tf.grad(function (a) { return tf.logSigmoid(a); })(a, dy).get(); + var y = 1 / (1 + Math.exp(a.get())); + test_util_1.expectNumbersClose(da, dy.get() * y); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1, 2, -3, 5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var da = tf.grad(function (a) { return tf.logSigmoid(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + var y = 1 / (1 + Math.exp(a.get(i))); + expected[i] = dy.get(i) * y; + } + test_util_1.expectArraysClose(da, expected); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([1, 2, -3, 5], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var da = tf.grad(function (a) { return tf.logSigmoid(a); })(a, dy); + var expected = []; + var aVals = a.dataSync(); + var dyVals = dy.dataSync(); + for (var i = 0; i < a.size; i++) { + var y = 1 / (1 + Math.exp(aVals[i])); + expected[i] = dyVals[i] * y; + } + test_util_1.expectArraysClose(da, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.logSigmoid({}); }) + .toThrowError(/Argument 'x' passed to 'logSigmoid' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.logSigmoid(-2); + var expected = [Math.log(1 / (1 + Math.exp(2)))]; + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('softplus', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.softplus(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.log((1 + Math.exp(values[i]))); + } + test_util_1.expectArraysClose(result, expected); + }); + it('scalar', function () { + var a = tf.scalar(-2); + var result = tf.softplus(a); + var expected = [Math.log((1 + Math.exp(-2)))]; + test_util_1.expectArraysClose(result, expected); + }); + it('tensor2D', function () { + var values = [1, 2, -3, 5]; + var a = tf.tensor2d(values, [2, 2]); + var result = tf.softplus(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.log((1 + Math.exp(values[i]))); + } + test_util_1.expectArraysClose(result, expected); + }); + it('larger magnitude negative inputs', function () { + var values = [-100, -200, -3000, -50000]; + var a = tf.tensor1d(values); + var result = tf.softplus(a); + var expected = [0, 0, 0, 0]; + test_util_1.expectArraysClose(result, expected); + }); + it('larger magnitude positive inputs', function () { + var values = [100, 200, 3000]; + var a = tf.tensor1d(values); + var result = tf.softplus(a); + var expected = [100, 200, 3000]; + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([3, NaN]); + var res = tf.softplus(a); + test_util_1.expectArraysClose(res, [Math.log((1 + Math.exp(3))), NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(3); + var dy = tf.scalar(4); + var da = tf.grad(function (a) { return tf.softplus(a); })(a, dy); + var y = 1 / (1 + Math.exp(-a.get())); + test_util_1.expectNumbersClose(da.get(), dy.get() * y); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1, 2, -3, 5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var da = tf.grad(function (a) { return tf.softplus(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + var y = 1 / (1 + Math.exp(-a.get(i))); + expected[i] = dy.get(i) * y; + } + test_util_1.expectArraysClose(da, expected); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([1, 2, -3, 5], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var da = tf.grad(function (a) { return tf.softplus(a); })(a, dy); + var expected = []; + var aVals = a.dataSync(); + var dyVals = dy.dataSync(); + for (var i = 0; i < a.size; i++) { + var y = 1 / (1 + Math.exp(-aVals[i])); + expected[i] = dyVals[i] * y; + } + test_util_1.expectArraysClose(da, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.softplus({}); }) + .toThrowError(/Argument 'x' passed to 'softplus' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.softplus(-2); + var expected = [Math.log((1 + Math.exp(-2)))]; + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('sqrt', test_util_1.ALL_ENVS, function () { + it('sqrt', function () { + var a = tf.tensor1d([2, 4]); + var r = tf.sqrt(a); + test_util_1.expectNumbersClose(r.get(0), Math.sqrt(2)); + test_util_1.expectNumbersClose(r.get(1), Math.sqrt(4)); + }); + it('sqrt propagates NaNs', function () { + var a = tf.tensor1d([1, NaN]); + var r = tf.sqrt(a); + test_util_1.expectArraysClose(r, [Math.sqrt(1), NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(4); + var dy = tf.scalar(8); + var da = tf.grad(function (a) { return tf.sqrt(a); })(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [8 / (2 * Math.sqrt(4))]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1, 2, 3, 5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.sqrt(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [ + 1 / (2 * Math.sqrt(1)), 2 / (2 * Math.sqrt(2)), + 3 / (2 * Math.sqrt(3)), 4 / (2 * Math.sqrt(5)) + ], 1e-1); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([3, 1, 2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.sqrt(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [ + 1 / (2 * Math.sqrt(3)), 2 / (2 * Math.sqrt(1)), + 3 / (2 * Math.sqrt(2)), 4 / (2 * Math.sqrt(3)) + ], 1e-1); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.sqrt({}); }) + .toThrowError(/Argument 'x' passed to 'sqrt' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.sqrt([2, 4]); + test_util_1.expectNumbersClose(r.get(0), Math.sqrt(2)); + test_util_1.expectNumbersClose(r.get(1), Math.sqrt(4)); + }); +}); +jasmine_util_1.describeWithFlags('rsqrt', test_util_1.ALL_ENVS, function () { + it('rsqrt', function () { + var a = tf.tensor1d([2, 4]); + var r = tf.rsqrt(a); + test_util_1.expectNumbersClose(r.get(0), 1 / Math.sqrt(2)); + test_util_1.expectNumbersClose(r.get(1), 1 / Math.sqrt(4)); + }); + it('rsqrt propagates NaNs', function () { + var a = tf.tensor1d([1, NaN]); + var r = tf.rsqrt(a); + test_util_1.expectArraysClose(r, [1 / Math.sqrt(1), NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(4); + var dy = tf.scalar(8); + var da = tf.grad(function (a) { return tf.rsqrt(a); })(a, dy); + expect(da.shape).toEqual(a.shape); + expect(da.dtype).toEqual('float32'); + test_util_1.expectArraysClose(da, [(-1 * 8) / (2 * Math.pow(4, 1.5))]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([1, 2, 3, 5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.rsqrt(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [ + -1 * 1 / (2 * Math.pow(1, 1.5)), -1 * 2 / (2 * Math.pow(2, 1.5)), + -1 * 3 / (2 * Math.pow(3, 1.5)), -1 * 4 / (2 * Math.pow(5, 1.5)) + ], 1e-1); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([3, 1, 2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.rsqrt(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [ + -1 * 1 / (2 * Math.pow(3, 1.5)), -1 * 2 / (2 * Math.pow(1, 1.5)), + -1 * 3 / (2 * Math.pow(2, 1.5)), -1 * 4 / (2 * Math.pow(3, 1.5)) + ], 1e-1); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.rsqrt({}); }) + .toThrowError(/Argument 'x' passed to 'rsqrt' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.rsqrt([2, 4]); + test_util_1.expectNumbersClose(r.get(0), 1 / Math.sqrt(2)); + test_util_1.expectNumbersClose(r.get(1), 1 / Math.sqrt(4)); + }); +}); +jasmine_util_1.describeWithFlags('square', test_util_1.ALL_ENVS, function () { + it('1D array', function () { + var a = tf.tensor1d([2, 4, Math.sqrt(2)]); + var r = tf.square(a); + test_util_1.expectArraysClose(r, [4, 16, 2]); + }); + it('2D array', function () { + var a = tf.tensor2d([1, 2, Math.sqrt(2), Math.sqrt(3)], [2, 2]); + var r = tf.square(a); + expect(r.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(r, [1, 4, 2, 3]); + }); + it('5D array', function () { + var a = tf.tensor5d([1, 2, Math.sqrt(2), Math.sqrt(3)], [1, 1, 2, 2, 1]); + var r = tf.square(a); + expect(r.shape).toEqual([1, 1, 2, 2, 1]); + test_util_1.expectArraysClose(r, [1, 4, 2, 3]); + }); + it('6D array', function () { + var a = tf.tensor6d([1, 2, Math.sqrt(2), Math.sqrt(3), 3, 4, Math.sqrt(7), Math.sqrt(13)], [1, 1, 2, 2, 2, 1]); + var r = tf.square(a); + expect(r.shape).toEqual(a.shape); + test_util_1.expectArraysClose(r, [1, 4, 2, 3, 9, 16, 7, 13]); + }); + it('square propagates NaNs', function () { + var a = tf.tensor1d([1.5, NaN]); + var r = tf.square(a); + test_util_1.expectArraysClose(r, [2.25, NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.square(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [2 * 5 * 8]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1, 2, 3, -5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.square(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [-2, 4 * 2, 6 * 3, -10 * 4]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.square(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [-6 * 1, 2 * 2, 4 * 3, 6 * 4]); + }); + it('gradients: Tensor5D', function () { + var a = tf.tensor5d([-3, 1, 2, 3], [1, 1, 1, 2, 2]); + var dy = tf.tensor5d([1, 2, 3, 4], [1, 1, 1, 2, 2]); + var gradients = tf.grad(function (a) { return tf.square(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [-6 * 1, 2 * 2, 4 * 3, 6 * 4]); + }); + it('gradients: Tensor6D', function () { + var a = tf.tensor6d([-3, 1, 2, 3, -4, 5, 12, 3], [1, 1, 1, 2, 2, 2]); + var dy = tf.tensor6d([1, 2, 3, 4, 5, 6, 7, 8], [1, 1, 1, 2, 2, 2]); + var gradients = tf.grad(function (a) { return tf.square(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [-6 * 1, 2 * 2, 4 * 3, 6 * 4, -8 * 5, 10 * 6, 24 * 7, 6 * 8]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.square({}); }) + .toThrowError(/Argument 'x' passed to 'square' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.square([2, 4, Math.sqrt(2)]); + test_util_1.expectArraysClose(r, [4, 16, 2]); + }); +}); +jasmine_util_1.describeWithFlags('reciprocal', test_util_1.ALL_ENVS, function () { + it('1D array', function () { + var a = tf.tensor1d([2, 3, 0, NaN]); + var r = tf.reciprocal(a); + test_util_1.expectArraysClose(r, [1 / 2, 1 / 3, Infinity, NaN]); + }); + it('2D array', function () { + var a = tf.tensor2d([1, Infinity, 0, NaN], [2, 2]); + var r = tf.reciprocal(a); + expect(r.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(r, [1 / 1, 0, Infinity, NaN]); + }); + it('reciprocal propagates NaNs', function () { + var a = tf.tensor1d([1.5, NaN]); + var r = tf.reciprocal(a); + test_util_1.expectArraysClose(r, [1 / 1.5, NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.reciprocal(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [-1 * 8 * (1 / (5 * 5))]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1, 2, 3, -5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.reciprocal(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [ + -1 * 1 * (1 / (-1 * -1)), -1 * 2 * (1 / (2 * 2)), -1 * 3 * (1 / (3 * 3)), + -1 * 4 * (1 / (-5 * -5)) + ]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-1, 2, 3, -5], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.reciprocal(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [ + -1 * 1 * (1 / (-1 * -1)), -1 * 2 * (1 / (2 * 2)), -1 * 3 * (1 / (3 * 3)), + -1 * 4 * (1 / (-5 * -5)) + ]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.reciprocal({}); }) + .toThrowError(/Argument 'x' passed to 'reciprocal' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.reciprocal([2, 3, 0, NaN]); + test_util_1.expectArraysClose(r, [1 / 2, 1 / 3, Infinity, NaN]); + }); +}); +jasmine_util_1.describeWithFlags('log', test_util_1.ALL_ENVS, function () { + it('log', function () { + var a = tf.tensor1d([1, 2]); + var r = tf.log(a); + test_util_1.expectNumbersClose(r.get(0), Math.log(1)); + test_util_1.expectNumbersClose(r.get(1), Math.log(2)); + }); + it('log 6D', function () { + var a = tf.range(1, 65).reshape([2, 2, 2, 2, 2, 2]); + var r = tf.log(a); + var expectedResult = []; + for (var i = 1; i < 65; i++) { + expectedResult[i - 1] = Math.log(i); + } + test_util_1.expectArraysClose(r, expectedResult); + }); + it('log propagates NaNs', function () { + var a = tf.tensor1d([1, NaN]); + var r = tf.log(a); + test_util_1.expectArraysClose(r, [Math.log(1), NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5); + var dy = tf.scalar(3); + var gradients = tf.grad(function (a) { return tf.log(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [3 / 5]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1, 2, 3, -5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.log(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1 / -1, 2 / 2, 3 / 3, 4 / -5]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.log(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1 / -3, 2 / 1, 3 / 2, 4 / 3]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.log({}); }) + .toThrowError(/Argument 'x' passed to 'log' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.log([1, 2]); + test_util_1.expectNumbersClose(r.get(0), Math.log(1)); + test_util_1.expectNumbersClose(r.get(1), Math.log(2)); + }); +}); +jasmine_util_1.describeWithFlags('log1p', test_util_1.ALL_ENVS, function () { + it('log1p', function () { + var a = tf.tensor1d([1, 2]); + var r = tf.log1p(a); + test_util_1.expectNumbersClose(r.get(0), Math.log1p(1)); + test_util_1.expectNumbersClose(r.get(1), Math.log1p(2)); + }); + it('log1p propagates NaNs', function () { + var a = tf.tensor1d([1, NaN]); + var r = tf.log1p(a); + test_util_1.expectArraysClose(r, [Math.log1p(1), NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5); + var dy = tf.scalar(3); + var gradients = tf.grad(function (a) { return tf.log1p(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [3 / (1 + 5)]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1, 2, 3, -5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.log1p(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [Infinity, 2 / (1 + 2), 3 / (1 + 3), 4 / (1 + -5)]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.log1p(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1 / (1 + -3), 2 / (1 + 1), 3 / (1 + 2), 4 / (1 + 3)]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.log1p({}); }) + .toThrowError(/Argument 'x' passed to 'log1p' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.log1p([1, 2]); + test_util_1.expectNumbersClose(r.get(0), Math.log1p(1)); + test_util_1.expectNumbersClose(r.get(1), Math.log1p(2)); + }); +}); +jasmine_util_1.describeWithFlags('ceil', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([1.5, 2.1, -1.4]); + var r = tf.ceil(a); + test_util_1.expectNumbersClose(r.get(0), 2); + test_util_1.expectNumbersClose(r.get(1), 3); + test_util_1.expectNumbersClose(r.get(2), -1); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([1.5, NaN, -1.4]); + var r = tf.ceil(a); + test_util_1.expectArraysClose(r, [2, NaN, -1]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5.2); + var dy = tf.scalar(3); + var gradients = tf.grad(function (a) { return tf.ceil(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1.1, 2.6, 3, -5.9]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.ceil(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2.2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.ceil(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.ceil({}); }) + .toThrowError(/Argument 'x' passed to 'ceil' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.ceil([1.5, 2.1, -1.4]); + test_util_1.expectNumbersClose(r.get(0), 2); + test_util_1.expectNumbersClose(r.get(1), 3); + test_util_1.expectNumbersClose(r.get(2), -1); + }); +}); +jasmine_util_1.describeWithFlags('floor', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([1.5, 2.1, -1.4]); + var r = tf.floor(a); + test_util_1.expectNumbersClose(r.get(0), 1); + test_util_1.expectNumbersClose(r.get(1), 2); + test_util_1.expectNumbersClose(r.get(2), -2); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([1.5, NaN, -1.4]); + var r = tf.floor(a); + test_util_1.expectArraysClose(r, [1, NaN, -2]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5.2); + var dy = tf.scalar(3); + var gradients = tf.grad(function (a) { return tf.floor(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1.1, 2.6, 3, -5.9]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.floor(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2.2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.floor(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.floor({}); }) + .toThrowError(/Argument 'x' passed to 'floor' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.floor([1.5, 2.1, -1.4]); + test_util_1.expectNumbersClose(r.get(0), 1); + test_util_1.expectNumbersClose(r.get(1), 2); + test_util_1.expectNumbersClose(r.get(2), -2); + }); +}); +jasmine_util_1.describeWithFlags('sign', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([1.5, 0, NaN, -1.4]); + var r = tf.sign(a); + test_util_1.expectNumbersClose(r.get(0), 1); + test_util_1.expectNumbersClose(r.get(1), 0); + test_util_1.expectNumbersClose(r.get(2), 0); + test_util_1.expectNumbersClose(r.get(3), -1); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([1.5, NaN, -1.4]); + var r = tf.sign(a); + test_util_1.expectArraysClose(r, [1, 0, -1]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5.2); + var dy = tf.scalar(3); + var gradients = tf.grad(function (a) { return tf.sign(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1.1, 2.6, 3, -5.9]); + var dy = tf.tensor1d([-1, 1, 1, -1]); + var gradients = tf.grad(function (a) { return tf.sign(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2.2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.sign(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.sign({}); }) + .toThrowError(/Argument 'x' passed to 'sign' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.sign([1.5, 0, NaN, -1.4]); + test_util_1.expectNumbersClose(r.get(0), 1); + test_util_1.expectNumbersClose(r.get(1), 0); + test_util_1.expectNumbersClose(r.get(2), 0); + test_util_1.expectNumbersClose(r.get(3), -1); + }); +}); +jasmine_util_1.describeWithFlags('exp', test_util_1.ALL_ENVS, function () { + it('exp', function () { + var a = tf.tensor1d([1, 2, 0]); + var r = tf.exp(a); + test_util_1.expectNumbersClose(r.get(0), Math.exp(1)); + test_util_1.expectNumbersClose(r.get(1), Math.exp(2)); + test_util_1.expectNumbersClose(r.get(2), 1); + }); + it('exp propagates NaNs', function () { + var a = tf.tensor1d([1, NaN, 0]); + var r = tf.exp(a); + test_util_1.expectArraysClose(r, [Math.exp(1), NaN, 1]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(3); + var gradients = tf.grad(function (a) { return tf.exp(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [3 * Math.exp(0.5)]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1, 2, 3, -5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.exp(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1 * Math.exp(-1), 2 * Math.exp(2), 3 * Math.exp(3), 4 * Math.exp(-5)], 1e-1); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.exp(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1 * Math.exp(-3), 2 * Math.exp(1), 3 * Math.exp(2), 4 * Math.exp(3)], 1e-1); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.exp({}); }) + .toThrowError(/Argument 'x' passed to 'exp' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.exp([1, 2, 0]); + test_util_1.expectNumbersClose(r.get(0), Math.exp(1)); + test_util_1.expectNumbersClose(r.get(1), Math.exp(2)); + test_util_1.expectNumbersClose(r.get(2), 1); + }); +}); +jasmine_util_1.describeWithFlags('expm1', test_util_1.ALL_ENVS, function () { + it('expm1', function () { + var a = tf.tensor1d([1, 2, 0]); + var r = tf.expm1(a); + test_util_1.expectNumbersClose(r.get(0), Math.expm1(1)); + test_util_1.expectNumbersClose(r.get(1), Math.expm1(2)); + test_util_1.expectNumbersClose(r.get(2), Math.expm1(0)); + }); + it('expm1 propagates NaNs', function () { + var a = tf.tensor1d([1, NaN, 0]); + var r = tf.expm1(a); + test_util_1.expectArraysClose(r, [Math.expm1(1), NaN, Math.expm1(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(3); + var gradients = tf.grad(function (a) { return tf.expm1(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [3 * Math.exp(0.5)]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1, 2, 3, -5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.expm1(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1 * Math.exp(-1), 2 * Math.exp(2), 3 * Math.exp(3), 4 * Math.exp(-5)], 1e-1); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.expm1(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1 * Math.exp(-3), 2 * Math.exp(1), 3 * Math.exp(2), 4 * Math.exp(3)], 1e-1); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.expm1({}); }) + .toThrowError(/Argument 'x' passed to 'expm1' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.expm1([1, 2, 0]); + test_util_1.expectNumbersClose(r.get(0), Math.expm1(1)); + test_util_1.expectNumbersClose(r.get(1), Math.expm1(2)); + test_util_1.expectNumbersClose(r.get(2), Math.expm1(0)); + }); +}); +jasmine_util_1.describeWithFlags('sin', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.sin(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.sin(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.sin(a); + test_util_1.expectArraysClose(res, [Math.sin(4), NaN, Math.sin(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.sin(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 * Math.cos(5)]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1, 2, 3, -5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.sin(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1 * Math.cos(-1), 2 * Math.cos(2), 3 * Math.cos(3), 4 * Math.cos(-5)], 1e-1); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.sin(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1 * Math.cos(-3), 2 * Math.cos(1), 3 * Math.cos(2), 4 * Math.cos(3)], 1e-1); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.sin({}); }) + .toThrowError(/Argument 'x' passed to 'sin' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [1, -3, 2, 7, -4]; + var result = tf.sin(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.sin(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('cos', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.cos(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.cos(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.cos(a); + test_util_1.expectArraysClose(res, [Math.cos(4), NaN, Math.cos(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.cos(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 * Math.sin(5) * -1]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1, 2, 3, -5]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.cos(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [ + 1 * Math.sin(-1) * -1, 2 * Math.sin(2) * -1, 3 * Math.sin(3) * -1, + 4 * Math.sin(-5) * -1 + ], 1e-1); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.cos(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [ + 1 * Math.sin(-3) * -1, 2 * Math.sin(1) * -1, 3 * Math.sin(2) * -1, + 4 * Math.sin(3) * -1 + ], 1e-1); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.cos({}); }) + .toThrowError(/Argument 'x' passed to 'cos' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [1, -3, 2, 7, -4]; + var result = tf.cos(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.cos(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('tan', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.tan(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.tan(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.tan(a); + test_util_1.expectArraysClose(res, [Math.tan(4), NaN, Math.tan(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.tan(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 / (Math.cos(0.5) * Math.cos(0.5))]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-1, 2, 3, -5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.tan(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / (Math.cos(aValues[i]) * Math.cos(aValues[i])); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-3, 1, 2, 3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.tan(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / (Math.cos(aValues[i]) * Math.cos(aValues[i])); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.tan({}); }) + .toThrowError(/Argument 'x' passed to 'tan' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [1, -3, 2, 7, -4]; + var result = tf.tan(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.tan(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('asin', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [.1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.asin(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.asin(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.asin(a); + test_util_1.expectArraysClose(res, [Math.asin(4), NaN, Math.asin(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.asin(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 / Math.sqrt(1 - (0.5 * 0.5))]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-0.1, 0.2, 0.3, -0.5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.asin(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / Math.sqrt(1 - (aValues[i] * aValues[i])); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-0.3, 0.1, 0.2, 0.3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.asin(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / Math.sqrt(1 - (aValues[i] * aValues[i])); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.asin({}); }) + .toThrowError(/Argument 'x' passed to 'asin' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [.1, -3, 2, 7, -4]; + var result = tf.asin(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.asin(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('acos', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [.1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.acos(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.acos(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.acos(a); + test_util_1.expectArraysClose(res, [Math.acos(4), NaN, Math.acos(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.acos(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [(-1 * 8) / Math.sqrt(1 - (0.5 * 0.5))]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-0.1, 0.2, 0.3, -0.5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.acos(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = + (-1 * dyValues[i]) / Math.sqrt(1 - (aValues[i] * aValues[i])); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-0.3, 0.1, 0.2, 0.3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.acos(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = + (-1 * dyValues[i]) / Math.sqrt(1 - (aValues[i] * aValues[i])); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.acos({}); }) + .toThrowError(/Argument 'x' passed to 'acos' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [.1, -3, 2, 7, -4]; + var result = tf.acos(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.acos(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('atan', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.atan(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.atan(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('6D atan', function () { + var a = tf.range(1, 65).reshape([2, 2, 2, 2, 2, 2]); + var result = tf.atan(a); + var expected = []; + for (var i = 1; i < 65; ++i) { + expected[i - 1] = Math.atan(i); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.atan(a); + test_util_1.expectArraysClose(res, [Math.atan(4), NaN, Math.atan(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.atan(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 / (1 + (0.5 * 0.5))]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-0.1, 0.2, 0.3, -0.5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.atan(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / (1 + (aValues[i] * aValues[i])); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-0.3, 0.1, 0.2, 0.3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.atan(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / (1 + (aValues[i] * aValues[i])); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.atan({}); }) + .toThrowError(/Argument 'x' passed to 'atan' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [1, -3, 2, 7, -4]; + var result = tf.atan(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.atan(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('sinh', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, -1, -4]; + var a = tf.tensor1d(values); + var result = tf.sinh(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.sinh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.sinh(a); + test_util_1.expectArraysClose(res, [Math.sinh(4), NaN, Math.sinh(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.sinh(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 * Math.cosh(0.5)]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-1, 2, 3, -5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.sinh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] * Math.cosh(aValues[i]); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-3, 1, 2, 3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.sinh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] * Math.cosh(aValues[i]); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.sinh({}); }) + .toThrowError(/Argument 'x' passed to 'sinh' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [1, -3, 2, -1, -4]; + var result = tf.sinh(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.sinh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('cosh', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, -1, -4]; + var a = tf.tensor1d(values); + var result = tf.cosh(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.cosh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.cosh(a); + test_util_1.expectArraysClose(res, [Math.cosh(4), NaN, Math.cosh(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.cosh(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 * Math.sinh(0.5)]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-1, 2, 3, -5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.cosh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] * Math.sinh(aValues[i]); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-3, 1, 2, 3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.cosh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] * Math.sinh(aValues[i]); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.cosh({}); }) + .toThrowError(/Argument 'x' passed to 'cosh' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [1, -3, 2, -1, -4]; + var result = tf.cosh(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.cosh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('tanh', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.tanh(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = util.tanh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.tanh(a); + test_util_1.expectArraysClose(res, [util.tanh(4), NaN, util.tanh(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.tanh(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 * (1 - (Math.tanh(0.5) * Math.tanh(0.5)))]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-1, 2, 3, -5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.tanh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = + dyValues[i] * (1 - (Math.tanh(aValues[i]) * Math.tanh(aValues[i]))); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-3, 1, 2, 3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.tanh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = + dyValues[i] * (1 - (Math.tanh(aValues[i]) * Math.tanh(aValues[i]))); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.tanh({}); }) + .toThrowError(/Argument 'x' passed to 'tanh' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [1, -3, 2, 7, -4]; + var result = tf.tanh(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = util.tanh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('leakyRelu', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([0, 1, -2]); + var result = tf.leakyRelu(a); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0, 1, -0.4]); + }); + it('propagates NaN', function () { + var a = tf.tensor1d([0, 1, NaN]); + var result = tf.leakyRelu(a); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [0, 1, NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(-4); + var dy = tf.scalar(8); + var alpha = 0.1; + var gradients = tf.grad(function (a) { return tf.leakyRelu(a, alpha); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 * alpha]); + }); + it('gradients: Tensor1D', function () { + var aValues = [1, -1, 0.1]; + var dyValues = [1, 2, 3]; + var alpha = 0.1; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.leakyRelu(a, alpha); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1, 2 * alpha, 3]); + }); + it('gradients: Tensor2D', function () { + var aValues = [1, -1, 0.1, 0.5]; + var dyValues = [1, 2, 3, 4]; + var alpha = 0.1; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.leakyRelu(a, alpha); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1, 2 * alpha, 3, 4]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.leakyRelu({}); }) + .toThrowError(/Argument 'x' passed to 'leakyRelu' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.leakyRelu([0, 1, -2]); + expect(result.shape).toEqual([3]); + test_util_1.expectArraysClose(result, [0, 1, -0.4]); + }); +}); +jasmine_util_1.describeWithFlags('elu', test_util_1.ALL_ENVS, function () { + it('calculate elu', function () { + var a = tf.tensor1d([1, -1, 0]); + var result = tf.elu(a); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [1, -0.6321, 0]); + }); + it('elu propagates NaN', function () { + var a = tf.tensor1d([1, NaN]); + var result = tf.elu(a); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [1, NaN]); + }); + it('derivative', function () { + var x = tf.tensor1d([1, 3, -2]); + var dy = tf.tensor1d([5, 50, 500]); + var gradients = tf.grad(function (a) { return tf.elu(a); })(x, dy); + expect(gradients.shape).toEqual(x.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [5, 50, 500 * Math.exp(-2)]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.elu({}); }) + .toThrowError(/Argument 'x' passed to 'elu' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.elu([1, -1, 0]); + expect(result.shape).toEqual(result.shape); + test_util_1.expectArraysClose(result, [1, -0.6321, 0]); + }); +}); +jasmine_util_1.describeWithFlags('selu', test_util_1.ALL_ENVS, function () { + var scaleAlpha = selu_util.SELU_SCALEALPHA; + var scale = selu_util.SELU_SCALE; + it('calculate selu', function () { + var a = tf.tensor1d([1, -1, 0]); + var result = tf.selu(a); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [1.0507, -1.1113, 0]); + }); + it('selu propagates NaN', function () { + var a = tf.tensor1d([1, NaN]); + var result = tf.selu(a); + expect(result.shape).toEqual(a.shape); + test_util_1.expectArraysClose(result, [1.0507, NaN]); + }); + it('gradients: Scalar', function () { + var aValue = 1; + var dyValue = 1; + var a = tf.scalar(aValue); + var dy = tf.scalar(dyValue); + var gradients = tf.grad(function (a) { return tf.selu(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [dyValue * scale]); + aValue = -1; + dyValue = 2; + a = tf.scalar(aValue); + dy = tf.scalar(dyValue); + gradients = tf.grad(function (a) { return tf.selu(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [dyValue * scaleAlpha * Math.exp(aValue)]); + }); + it('gradients: Tensor1D', function () { + var aValues = [1, -1, 0]; + var dyValues = [1, 2, 3]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.selu(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + if (aValues[i] > 0) { + expected[i] = dyValues[i] * scale; + } + else { + expected[i] = dyValues[i] * scaleAlpha * Math.exp(aValues[i]); + } + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [1, -1, 0, 0.5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.selu(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + if (aValues[i] > 0) { + expected[i] = dyValues[i] * scale; + } + else { + expected[i] = dyValues[i] * scaleAlpha * Math.exp(aValues[i]); + } + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.selu({}); }) + .toThrowError(/Argument 'x' passed to 'selu' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.selu([1, -1, 0]); + expect(result.shape).toEqual([3]); + test_util_1.expectArraysClose(result, [1.0507, -1.1113, 0]); + }); +}); +jasmine_util_1.describeWithFlags('clip', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([3, -1, 0, 100, -7, 2]); + var min = -1; + var max = 50; + var result = tf.clipByValue(a, min, max); + test_util_1.expectArraysClose(result, [3, -1, 0, 50, -1, 2]); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([3, -1, 0, 100, -7, 2, NaN]); + var min = -1; + var max = 50; + var result = tf.clipByValue(a, min, max); + test_util_1.expectArraysClose(result, [3, -1, 0, 50, -1, 2, NaN]); + }); + it('min greater than max', function () { + var a = tf.tensor1d([3, -1, 0, 100, -7, 2]); + var min = 1; + var max = -1; + var f = function () { + tf.clipByValue(a, min, max); + }; + expect(f).toThrowError(); + }); + it('derivative: 1D tensor', function () { + var min = -1; + var max = 2; + var x = tf.tensor1d([3, -2, 1]); + var dy = tf.tensor1d([5, 50, 500]); + var gradients = tf.grad(function (x) { return x.clipByValue(min, max); })(x, dy); + expect(gradients.shape).toEqual(x.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 500]); + }); + it('derivative: 1D tensor with max or min value', function () { + var min = -1; + var max = 2; + var x = tf.tensor1d([-1, 1, 2, 3]); + var dy = tf.tensor1d([1, 10, 100, 1000]); + var gradients = tf.grad(function (x) { return x.clipByValue(min, max); })(x, dy); + expect(gradients.shape).toEqual(x.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [1, 10, 100, 0]); + }); + it('derivative: scalar', function () { + var min = -1; + var max = 2; + var x = tf.scalar(-10); + var dy = tf.scalar(5); + var gradients = tf.grad(function (x) { return x.clipByValue(min, max); })(x, dy); + expect(gradients.shape).toEqual(x.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.clipByValue({}, 0, 1); }) + .toThrowError(/Argument 'x' passed to 'clipByValue' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var min = -1; + var max = 50; + var result = tf.clipByValue([3, -1, 0, 100, -7, 2], min, max); + test_util_1.expectArraysClose(result, [3, -1, 0, 50, -1, 2]); + }); +}); +jasmine_util_1.describeWithFlags('round', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var a = tf.tensor1d([0.9, 2.5, 2.3, 1.5, -4.5]); + var r = a.round(); + test_util_1.expectNumbersClose(r.get(0), 1.0); + test_util_1.expectNumbersClose(r.get(1), 2.0); + test_util_1.expectNumbersClose(r.get(2), 2.0); + test_util_1.expectNumbersClose(r.get(3), 2.0); + test_util_1.expectNumbersClose(r.get(4), -4.0); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([1.5, NaN, -1.4]); + var r = tf.round(a); + test_util_1.expectArraysClose(r, [2, NaN, -1]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(5.2); + var dy = tf.scalar(3); + var gradients = tf.grad(function (a) { return tf.round(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0]); + }); + it('gradients: Tensor1D', function () { + var a = tf.tensor1d([-1.1, 2.6, 3, -5.9]); + var dy = tf.tensor1d([1, 2, 3, 4]); + var gradients = tf.grad(function (a) { return tf.round(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('gradients: Tensor2D', function () { + var a = tf.tensor2d([-3, 1, 2.2, 3], [2, 2]); + var dy = tf.tensor2d([1, 2, 3, 4], [2, 2]); + var gradients = tf.grad(function (a) { return tf.round(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [0, 0, 0, 0]); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.round({}); }) + .toThrowError(/Argument 'x' passed to 'round' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var r = tf.round([0.9, 2.5, 2.3, 1.5, -4.5]); + test_util_1.expectArraysClose(r, [1, 2, 2, 2, -4]); + }); +}); +jasmine_util_1.describeWithFlags('asinh', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [1, -3, 2, 7, -4]; + var a = tf.tensor1d(values); + var result = tf.asinh(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.asinh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('scalar', function () { + var a = tf.scalar(1); + var result = tf.asinh(a); + var expected = [Math.asinh(1)]; + test_util_1.expectArraysClose(result, expected); + }); + it('tensor2D', function () { + var values = [1, -3, 2, 7]; + var a = tf.tensor2d(values, [2, 2]); + var result = tf.asinh(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.asinh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 0]); + var res = tf.asinh(a); + test_util_1.expectArraysClose(res, [Math.asinh(4), NaN, Math.asinh(0)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.asinh(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 / Math.sqrt(1.0 + 0.5 * 0.5)]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-1, 2, 3, -5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.asinh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / Math.sqrt(1 + aValues[i] * aValues[i]); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-3, 1, 2, 3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.asinh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / Math.sqrt(1 + aValues[i] * aValues[i]); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.asinh({}); }) + .toThrowError(/Argument 'x' passed to 'asinh' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [1, -3, 2, 7, -4]; + var result = tf.asinh(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.asinh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('acosh', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [2, 3, 4, 5, 6]; + var a = tf.tensor1d(values); + var result = tf.acosh(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.acosh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('scalar', function () { + var value = 2; + var a = tf.scalar(value); + var result = tf.acosh(a); + var expected = [Math.acosh(value)]; + test_util_1.expectArraysClose(result, expected); + }); + it('tensor2d', function () { + var values = [2, 3, 4, 5]; + var a = tf.tensor2d(values, [2, 2]); + var result = tf.acosh(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.acosh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([4, NaN, 2]); + var res = tf.acosh(a); + test_util_1.expectArraysClose(res, [Math.acosh(4), NaN, Math.acosh(2)]); + }); + it('NaN outside function domain', function () { + var a = tf.tensor1d([4, -1, 2]); + var res = tf.acosh(a); + test_util_1.expectArraysClose(res, [Math.acosh(4), NaN, Math.acosh(2)]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(1.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.acosh(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8.0 / Math.sqrt(1.5 * 1.5 - 1.0)]); + }); + it('gradients: Tensor1D', function () { + var aValues = [2, 3, 5, 10]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.acosh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / Math.sqrt(Math.pow(aValues[i], 2) - 1.0); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [2, 3, 5, 7]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.acosh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / Math.sqrt(Math.pow(aValues[i], 2) - 1.0); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.acosh({}); }) + .toThrowError(/Argument 'x' passed to 'acosh' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var values = [2, 3, 4, 5, 6]; + var result = tf.acosh(values); + var expected = []; + for (var i = 0; i < values.length; i++) { + expected[i] = Math.acosh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); +}); +jasmine_util_1.describeWithFlags('atanh', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [-0.25, 0.25, 0.5, .75, -0.4]; + var a = tf.tensor1d(values); + var result = tf.atanh(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.atanh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('scalar', function () { + var value = 0.2; + var a = tf.scalar(value); + var result = tf.atanh(a); + var expected = [Math.atanh(value)]; + test_util_1.expectArraysClose(result, expected); + }); + it('tensor2d', function () { + var values = [0.2, 0.3, 0.4, 0.5]; + var a = tf.tensor2d(values, [2, 2]); + var result = tf.atanh(a); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = Math.atanh(values[i]); + } + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([0.5, NaN, 0]); + var res = tf.atanh(a); + test_util_1.expectArraysClose(res, [Math.atanh(0.5), NaN, Math.atanh(0)]); + }); + it('NaN outside function domain', function () { + var a = tf.tensor1d([-2, 0, 2]); + var res = tf.atanh(a); + test_util_1.expectArraysClose(res, [NaN, Math.atanh(0), NaN]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.atanh(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 / (1 - 0.5 * 0.5)]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-0.1, 0.2, 0.3, -0.5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.atanh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / (1 - Math.pow(aValues[i], 2)); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-0.3, 0.1, 0.2, 0.3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.atanh(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] / (1 - Math.pow(aValues[i], 2)); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.atanh({}); }) + .toThrowError(/Argument 'x' passed to 'atanh' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.atanh(0.2); + test_util_1.expectNumbersClose(result.get(), Math.atanh(0.2)); + }); +}); +jasmine_util_1.describeWithFlags('erf', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var values = [-0.25, 0.25, 0.5, .75, -0.4]; + var a = tf.tensor1d(values); + var result = tf.erf(a); + var expected = [-0.2763264, 0.2763264, 0.5204999, 0.7111556, -0.4283924]; + test_util_1.expectArraysClose(result, expected); + }); + it('scalar', function () { + var a = tf.scalar(1); + var result = tf.erf(a); + var expected = [0.8427008]; + test_util_1.expectArraysClose(result, expected); + }); + it('scalar in int32', function () { + var a = tf.scalar(1, 'int32'); + var result = tf.erf(a); + var expected = [0.8427008]; + test_util_1.expectArraysClose(result, expected); + }); + it('tensor2d', function () { + var values = [0.2, 0.3, 0.4, 0.5]; + var a = tf.tensor2d(values, [2, 2]); + var result = tf.erf(a); + var expected = [0.2227026, 0.32862678, 0.42839235, 0.5204999]; + test_util_1.expectArraysClose(result, expected); + }); + it('propagates NaNs', function () { + var a = tf.tensor1d([0.5, NaN, 0]); + var res = tf.erf(a); + test_util_1.expectArraysClose(res, [0.5204999, NaN, 0.0]); + }); + it('gradients: Scalar', function () { + var a = tf.scalar(0.5); + var dy = tf.scalar(8); + var gradients = tf.grad(function (a) { return tf.erf(a); })(a, dy); + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, [8 * 2 * Math.exp(-0.5 * 0.5) / Math.sqrt(Math.PI)]); + }); + it('gradients: Tensor1D', function () { + var aValues = [-0.1, 0.2, 0.3, -0.5]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor1d(aValues); + var dy = tf.tensor1d(dyValues); + var gradients = tf.grad(function (a) { return tf.erf(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] * 2 * Math.exp(-aValues[i] * aValues[i]) / + Math.sqrt(Math.PI); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('gradients: Tensor2D', function () { + var aValues = [-0.3, 0.1, 0.2, 0.3]; + var dyValues = [1, 2, 3, 4]; + var a = tf.tensor2d(aValues, [2, 2]); + var dy = tf.tensor2d(dyValues, [2, 2]); + var gradients = tf.grad(function (a) { return tf.erf(a); })(a, dy); + var expected = []; + for (var i = 0; i < a.size; i++) { + expected[i] = dyValues[i] * 2 * Math.exp(-aValues[i] * aValues[i]) / + Math.sqrt(Math.PI); + } + expect(gradients.shape).toEqual(a.shape); + expect(gradients.dtype).toEqual('float32'); + test_util_1.expectArraysClose(gradients, expected); + }); + it('throws when passed a non-tensor', function () { + expect(function () { return tf.erf({}); }) + .toThrowError(/Argument 'x' passed to 'erf' must be a Tensor/); + }); + it('accepts a tensor-like object', function () { + var result = tf.erf(1); + test_util_1.expectNumbersClose(result.get(), 0.8427008); + }); +}); +//# sourceMappingURL=unary_ops_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops_test.js.map new file mode 100644 index 0000000..55648ee --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/ops/unary_ops_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unary_ops_test.js","sourceRoot":"","sources":["../../src/ops/unary_ops_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA6E;AAC7E,8BAAgC;AAEhC,uCAAyC;AAEzC,gCAAiB,CAAC,MAAM,EAAE,oBAAQ,EAAE;IAClC,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,IAAM,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1B,6BAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,EAAE;QACP,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACvD,IAAM,MAAM,GAAG,EAAE,CAAC,IAA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IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACxB;QACD,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACzC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3C,6BAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE;QACpC,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,GAAG,CAAC,EAAe,CAAC,EAAvB,CAAuB,CAAC;aAChC,YAAY,CAAC,+CAA+C,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACzB,8BAAkB,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts new file mode 100644 index 0000000..ffe845b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts @@ -0,0 +1,20 @@ +import { ConfigDict, Serializable, SerializableConstructor } from '../serialization'; +import { NamedVariableMap } from '../tensor_types'; +import { Optimizer } from './optimizer'; +export declare class AdadeltaOptimizer extends Optimizer { + protected learningRate: number; + protected rho: number; + protected epsilon: number; + static className: string; + private c; + private epsilonScalar; + private rhoScalar; + private oneMinusRho; + private accumulatedGrads; + private accumulatedUpdates; + constructor(learningRate: number, rho: number, epsilon?: number); + applyGradients(variableGradients: NamedVariableMap): void; + dispose(): void; + getConfig(): ConfigDict; + static fromConfig(cls: SerializableConstructor, config: ConfigDict): T; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.js new file mode 100644 index 0000000..c15f914 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.js @@ -0,0 +1,107 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var globals_1 = require("../globals"); +var ops_1 = require("../ops/ops"); +var serialization_1 = require("../serialization"); +var optimizer_1 = require("./optimizer"); +var optimizer_utils = require("./optimizer_utils"); +var AdadeltaOptimizer = (function (_super) { + __extends(AdadeltaOptimizer, _super); + function AdadeltaOptimizer(learningRate, rho, epsilon) { + if (epsilon === void 0) { epsilon = null; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.rho = rho; + _this.epsilon = epsilon; + _this.accumulatedGrads = {}; + _this.accumulatedUpdates = {}; + _this.c = globals_1.keep(ops_1.scalar(-learningRate)); + _this.rhoScalar = globals_1.keep(ops_1.scalar(rho)); + _this.oneMinusRho = globals_1.keep(ops_1.scalar(1 - rho)); + if (epsilon === null) { + epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue(); + } + _this.epsilonScalar = globals_1.keep(ops_1.scalar(epsilon)); + return _this; + } + AdadeltaOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var _loop_1 = function (variableName) { + var value = environment_1.ENV.engine.registeredVariables[variableName]; + if (this_1.accumulatedGrads[variableName] == null) { + var trainable_1 = false; + globals_1.tidy(function () { + _this.accumulatedGrads[variableName] = + ops_1.zerosLike(value).variable(trainable_1); + }); + } + if (this_1.accumulatedUpdates[variableName] == null) { + var trainable_2 = false; + globals_1.tidy(function () { + _this.accumulatedUpdates[variableName] = + ops_1.zerosLike(value).variable(trainable_2); + }); + } + var gradient = variableGradients[variableName]; + var accumulatedGrad = this_1.accumulatedGrads[variableName]; + var accumulatedUpdate = this_1.accumulatedUpdates[variableName]; + globals_1.tidy(function () { + var newAccumulatedGrad = _this.rhoScalar.mul(accumulatedGrad) + .add(_this.oneMinusRho.mul(gradient.square())); + var updates = accumulatedUpdate.add(_this.epsilonScalar) + .sqrt() + .div(accumulatedGrad.add(_this.epsilonScalar).sqrt()) + .mul(gradient); + var newAccumulatedUpdate = _this.rhoScalar.mul(accumulatedUpdate) + .add(_this.oneMinusRho.mul(updates.square())); + _this.accumulatedGrads[variableName].assign(newAccumulatedGrad); + _this.accumulatedUpdates[variableName].assign(newAccumulatedUpdate); + var newValue = _this.c.mul(updates).add(value); + value.assign(newValue); + }); + }; + var this_1 = this; + for (var variableName in variableGradients) { + _loop_1(variableName); + } + }; + AdadeltaOptimizer.prototype.dispose = function () { + var _this = this; + this.c.dispose(); + this.epsilonScalar.dispose(); + this.rhoScalar.dispose(); + this.oneMinusRho.dispose(); + if (this.accumulatedUpdates != null) { + Object.keys(this.accumulatedUpdates) + .forEach(function (name) { return _this.accumulatedUpdates[name].dispose(); }); + Object.keys(this.accumulatedGrads) + .forEach(function (name) { return _this.accumulatedGrads[name].dispose(); }); + } + }; + AdadeltaOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + rho: this.rho, + epsilon: this.epsilon + }; + }; + AdadeltaOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.rho, config.epsilon); + }; + AdadeltaOptimizer.className = 'AdadeltaOptimizer'; + return AdadeltaOptimizer; +}(optimizer_1.Optimizer)); +exports.AdadeltaOptimizer = AdadeltaOptimizer; +serialization_1.SerializationMap.register(AdadeltaOptimizer); +//# sourceMappingURL=adadelta_optimizer.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.js.map new file mode 100644 index 0000000..f478fe4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adadelta_optimizer.js","sourceRoot":"","sources":["../../src/optimizers/adadelta_optimizer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,8CAAmC;AACnC,sCAAsC;AACtC,kCAA6C;AAC7C,kDAAqG;AAGrG,yCAAsC;AACtC,mDAAqD;AAGrD;IAAuC,qCAAS;IAU9C,2BACc,YAAoB,EAAY,GAAW,EAC3C,OAAsB;QAAtB,wBAAA,EAAA,cAAsB;QAFpC,YAGE,iBAAO,SAWR;QAba,kBAAY,GAAZ,YAAY,CAAQ;QAAY,SAAG,GAAH,GAAG,CAAQ;QAC3C,aAAO,GAAP,OAAO,CAAe;QAL5B,sBAAgB,GAAqB,EAAE,CAAC;QACxC,wBAAkB,GAAqB,EAAE,CAAC;QAOhD,KAAI,CAAC,CAAC,GAAG,cAAI,CAAC,YAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QACrC,KAAI,CAAC,SAAS,GAAG,cAAI,CAAC,YAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACnC,KAAI,CAAC,WAAW,GAAG,cAAI,CAAC,YAAM,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QAEzC,IAAI,OAAO,KAAK,IAAI,EAAE;YACpB,OAAO,GAAG,eAAe,CAAC,+BAA+B,EAAE,CAAC;SAC7D;QAED,KAAI,CAAC,aAAa,GAAG,cAAI,CAAC,YAAM,CAAC,OAAO,CAAC,CAAC,CAAC;;IAC7C,CAAC;IAED,0CAAc,GAAd,UAAe,iBAAmC;QAAlD,iBA2CC;gCA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E,EAArC,CAAqC,CAAC,CAAC;SAC7D;IACH,CAAC;IACD,qCAAS,GAAT;QACE,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;IACM,4BAAU,GAAjB,UACI,GAA+B,EAAE,MAAkB;QACrD,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;IA5FM,2BAAS,GAAG,mBAAmB,CAAC;IA6FzC,wBAAC;CAAA,AA9FD,CAAuC,qBAAS,GA8F/C;AA9FY,8CAAiB;AA+F9B,gCAAgB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer_test.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer_test.js new file mode 100644 index 0000000..3afad4c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer_test.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('AdadeltaOptimizer', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var learningRate = .1; + var rho = .95; + var optimizer = tf.train.adadelta(learningRate, rho); + var x = tf.tensor1d([1, 2]).variable(); + var f = function () { return x.square().sum(); }; + var numTensors = tf.memory().numTensors; + var cost = optimizer.minimize(f, true); + expect(tf.memory().numTensors).toBe(numTensors + 3); + test_util_1.expectArraysClose(x, [0.8, 1.6]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(f, false); + test_util_1.expectArraysClose(x, [0.64, 1.28]); + expect(tf.memory().numTensors).toBe(numTensors); + expect(cost).toBe(null); + x.dispose(); + optimizer.dispose(); + expect(tf.memory().numTensors).toBe(1); + }); + it('serialization round-trip', function () { + var originalOpt = tf.train.adadelta(0.1, 0.2, 2e-8); + var reserialized = tf.AdadeltaOptimizer.fromConfig(tf.AdadeltaOptimizer, originalOpt.getConfig()); + expect(reserialized.getConfig()).toEqual(originalOpt.getConfig()); + }); +}); +//# sourceMappingURL=adadelta_optimizer_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer_test.js.map new file mode 100644 index 0000000..29749f7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adadelta_optimizer_test.js","sourceRoot":"","sources":["../../src/optimizers/adadelta_optimizer_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,mBAAmB,EAAE,oBAAQ,EAAE;IAC/C,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,YAAY,GAAG,EAAE,CAAC;QACxB,IAAM,GAAG,GAAG,GAAG,CAAC;QAChB,IAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;QAEvD,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAEz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EAAE,CAAC,iBAAiB,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts new file mode 100644 index 0000000..353dd2e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts @@ -0,0 +1,16 @@ +import { ConfigDict, Serializable, SerializableConstructor } from '../serialization'; +import { NamedVariableMap } from '../tensor_types'; +import { Optimizer } from './optimizer'; +export declare class AdagradOptimizer extends Optimizer { + protected learningRate: number; + private initialAccumulatorValue; + static className: string; + private c; + private epsilon; + private accumulatedGrads; + constructor(learningRate: number, initialAccumulatorValue?: number); + applyGradients(variableGradients: NamedVariableMap): void; + dispose(): void; + getConfig(): ConfigDict; + static fromConfig(cls: SerializableConstructor, config: ConfigDict): T; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.js new file mode 100644 index 0000000..e98c3c3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.js @@ -0,0 +1,83 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var globals_1 = require("../globals"); +var ops_1 = require("../ops/ops"); +var serialization_1 = require("../serialization"); +var optimizer_1 = require("./optimizer"); +var optimizer_utils = require("./optimizer_utils"); +var AdagradOptimizer = (function (_super) { + __extends(AdagradOptimizer, _super); + function AdagradOptimizer(learningRate, initialAccumulatorValue) { + if (initialAccumulatorValue === void 0) { initialAccumulatorValue = 0.1; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.initialAccumulatorValue = initialAccumulatorValue; + _this.accumulatedGrads = {}; + _this.c = globals_1.keep(ops_1.scalar(-learningRate)); + var epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue(); + _this.epsilon = globals_1.keep(ops_1.scalar(epsilon)); + return _this; + } + AdagradOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var _loop_1 = function (variableName) { + var value = environment_1.ENV.engine.registeredVariables[variableName]; + if (this_1.accumulatedGrads[variableName] == null) { + var trainable_1 = false; + globals_1.tidy(function () { + _this.accumulatedGrads[variableName] = + ops_1.fill(value.shape, _this.initialAccumulatorValue) + .variable(trainable_1); + }); + } + var gradient = variableGradients[variableName]; + var accumulatedGrad = this_1.accumulatedGrads[variableName]; + globals_1.tidy(function () { + var newAccumulatedGrad = accumulatedGrad.add(gradient.square()); + _this.accumulatedGrads[variableName].assign(newAccumulatedGrad); + var newValue = _this.c + .mul(gradient.div(newAccumulatedGrad.add(_this.epsilon).sqrt())) + .add(value); + value.assign(newValue); + }); + }; + var this_1 = this; + for (var variableName in variableGradients) { + _loop_1(variableName); + } + }; + AdagradOptimizer.prototype.dispose = function () { + var _this = this; + this.epsilon.dispose(); + this.c.dispose(); + if (this.accumulatedGrads != null) { + Object.keys(this.accumulatedGrads) + .forEach(function (name) { return _this.accumulatedGrads[name].dispose(); }); + } + }; + AdagradOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + initialAccumulatorValue: this.initialAccumulatorValue, + }; + }; + AdagradOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.initialAccumulatorValue); + }; + AdagradOptimizer.className = 'AdagradOptimizer'; + return AdagradOptimizer; +}(optimizer_1.Optimizer)); +exports.AdagradOptimizer = AdagradOptimizer; +serialization_1.SerializationMap.register(AdagradOptimizer); +//# sourceMappingURL=adagrad_optimizer.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.js.map new file mode 100644 index 0000000..9775ff9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adagrad_optimizer.js","sourceRoot":"","sources":["../../src/optimizers/adagrad_optimizer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,8CAAmC;AACnC,sCAAsC;AACtC,kCAAwC;AACxC,kDAAqG;AAGrG,yCAAsC;AACtC,mDAAqD;AAGrD;IAAsC,oCAAS;IAO7C,0BACc,YAAoB,EAAU,uBAA6B;QAA7B,wCAAA,EAAA,6BAA6B;QADzE,YAEE,iBAAO,SAKR;QANa,kBAAY,GAAZ,YAAY,CAAQ;QAAU,6BAAuB,GAAvB,uBAAuB,CAAM;QAHjE,sBAAgB,GAAqB,EAAE,CAAC;QAK9C,KAAI,CAAC,CAAC,GAAG,cAAI,CAAC,YAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QAErC,IAAM,OAAO,GAAG,eAAe,CAAC,+BAA+B,EAAE,CAAC;QAClE,KAAI,CAAC,OAAO,GAAG,cAAI,CAAC,YAAM,CAAC,OAAO,CAAC,CAAC,CAAC;;IACvC,CAAC;IAED,yCAAc,GAAd,UAAe,iBAAmC;QAAlD,iBA0BC;gCAzBY,YAAY;YACrB,IAAM,KAAK,GAAG,iBAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;YAC3D,IAAI,OAAK,gBAAgB,CAAC,YAAY,CAAC,IAAI,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,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAArC,CAAqC,CAAC,CAAC;SAC7D;IACH,CAAC;IACD,oCAAS,GAAT;QACE,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;SACtD,CAAC;IACJ,CAAC;IACM,2BAAU,GAAjB,UACI,GAA+B,EAAE,MAAkB;QACrD,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,uBAAuB,CAAC,CAAC;IACtE,CAAC;IA5DM,0BAAS,GAAG,kBAAkB,CAAC;IA6DxC,uBAAC;CAAA,AA9DD,CAAsC,qBAAS,GA8D9C;AA9DY,4CAAgB;AA+D7B,gCAAgB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer_test.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer_test.js new file mode 100644 index 0000000..86c4491 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer_test.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('AdagradOptimizer', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var learningRate = .1; + var initialAccumulatorValue = .1; + var optimizer = tf.train.adagrad(learningRate, initialAccumulatorValue); + var x = tf.tensor1d([1, 2]).variable(); + var f = function () { return x.square().sum(); }; + var numTensors = tf.memory().numTensors; + var cost = optimizer.minimize(f, true); + expect(tf.memory().numTensors).toBe(numTensors + 2); + test_util_1.expectArraysClose(x, [0.9012270405, 1.9003110428]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(f, false); + test_util_1.expectArraysClose(x, [0.8347372764, 1.83015597828], 1e-2); + expect(tf.memory().numTensors).toBe(numTensors); + expect(cost).toBe(null); + x.dispose(); + optimizer.dispose(); + expect(tf.memory().numTensors).toBe(1); + }); + it('serialization round-trip', function () { + var originalOpt = tf.train.adagrad(0.1, 0.2); + var reserialized = tf.AdagradOptimizer.fromConfig(tf.AdagradOptimizer, originalOpt.getConfig()); + expect(reserialized.getConfig()).toEqual(originalOpt.getConfig()); + }); +}); +//# sourceMappingURL=adagrad_optimizer_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer_test.js.map new file mode 100644 index 0000000..83d25c6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adagrad_optimizer_test.js","sourceRoot":"","sources":["../../src/optimizers/adagrad_optimizer_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,kBAAkB,EAAE,oBAAQ,EAAE;IAC9C,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,YAAY,GAAG,EAAE,CAAC;QACxB,IAAM,uBAAuB,GAAG,EAAE,CAAC;QACnC,IAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;QAE1E,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAA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,UAAU,CAC/C,EAAE,CAAC,gBAAgB,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts new file mode 100644 index 0000000..55ce06b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts @@ -0,0 +1,26 @@ +import { ConfigDict, Serializable, SerializableConstructor } from '../serialization'; +import { NamedVariableMap } from '../tensor_types'; +import { Optimizer } from './optimizer'; +export declare class AdamOptimizer extends Optimizer { + protected learningRate: number; + protected beta1: number; + protected beta2: number; + protected epsilon: number; + static className: string; + private c; + private epsScalar; + private beta1Scalar; + private beta2Scalar; + private accBeta1; + private accBeta2; + private oneMinusBeta1; + private oneMinusBeta2; + private one; + private accumulatedFirstMoment; + private accumulatedSecondMoment; + constructor(learningRate: number, beta1: number, beta2: number, epsilon?: number); + applyGradients(variableGradients: NamedVariableMap): void; + dispose(): void; + getConfig(): ConfigDict; + static fromConfig(cls: SerializableConstructor, config: ConfigDict): T; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.js new file mode 100644 index 0000000..76e270f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.js @@ -0,0 +1,119 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var globals_1 = require("../globals"); +var ops_1 = require("../ops/ops"); +var serialization_1 = require("../serialization"); +var optimizer_1 = require("./optimizer"); +var optimizer_utils = require("./optimizer_utils"); +var AdamOptimizer = (function (_super) { + __extends(AdamOptimizer, _super); + function AdamOptimizer(learningRate, beta1, beta2, epsilon) { + if (epsilon === void 0) { epsilon = null; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.beta1 = beta1; + _this.beta2 = beta2; + _this.epsilon = epsilon; + _this.accumulatedFirstMoment = {}; + _this.accumulatedSecondMoment = {}; + _this.c = globals_1.keep(ops_1.scalar(-learningRate)); + _this.beta1Scalar = globals_1.keep(ops_1.scalar(beta1)); + _this.beta2Scalar = globals_1.keep(ops_1.scalar(beta2)); + globals_1.tidy(function () { + _this.accBeta1 = ops_1.scalar(beta1).variable(); + _this.accBeta2 = ops_1.scalar(beta2).variable(); + }); + _this.oneMinusBeta1 = globals_1.keep(ops_1.scalar(1 - beta1)); + _this.oneMinusBeta2 = globals_1.keep(ops_1.scalar(1 - beta2)); + _this.one = globals_1.keep(ops_1.scalar(1)); + if (epsilon === null) { + epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue(); + } + _this.epsScalar = globals_1.keep(ops_1.scalar(epsilon)); + return _this; + } + AdamOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + globals_1.tidy(function () { + var oneMinusAccBeta1 = _this.one.sub(_this.accBeta1); + var oneMinusAccBeta2 = _this.one.sub(_this.accBeta2); + for (var variableName in variableGradients) { + var value = environment_1.ENV.engine.registeredVariables[variableName]; + if (_this.accumulatedFirstMoment[variableName] == null) { + var trainable = false; + _this.accumulatedFirstMoment[variableName] = + ops_1.zerosLike(value).variable(trainable); + } + if (_this.accumulatedSecondMoment[variableName] == null) { + var trainable = false; + _this.accumulatedSecondMoment[variableName] = + ops_1.zerosLike(value).variable(trainable); + } + var gradient = variableGradients[variableName]; + var firstMoment = _this.accumulatedFirstMoment[variableName]; + var secondMoment = _this.accumulatedSecondMoment[variableName]; + var newFirstMoment = _this.beta1Scalar.mul(firstMoment) + .add(_this.oneMinusBeta1.mul(gradient)); + var newSecondMoment = _this.beta2Scalar.mul(secondMoment) + .add(_this.oneMinusBeta2.mul(gradient.square())); + var biasCorrectedFirstMoment = newFirstMoment.div(oneMinusAccBeta1); + var biasCorrectedSecondMoment = newSecondMoment.div(oneMinusAccBeta2); + _this.accumulatedFirstMoment[variableName].assign(newFirstMoment); + _this.accumulatedSecondMoment[variableName].assign(newSecondMoment); + var newValue = _this.c + .mul(biasCorrectedFirstMoment.div(_this.epsScalar.add(biasCorrectedSecondMoment.sqrt()))) + .add(value); + value.assign(newValue); + } + _this.accBeta1.assign(_this.accBeta1.mul(_this.beta1Scalar)); + _this.accBeta2.assign(_this.accBeta2.mul(_this.beta2Scalar)); + }); + }; + AdamOptimizer.prototype.dispose = function () { + var _this = this; + this.c.dispose(); + this.epsScalar.dispose(); + this.beta1Scalar.dispose(); + this.beta2Scalar.dispose(); + this.accBeta1.dispose(); + this.accBeta2.dispose(); + this.oneMinusBeta1.dispose(); + this.oneMinusBeta2.dispose(); + this.one.dispose(); + if (this.accumulatedFirstMoment != null) { + Object.keys(this.accumulatedFirstMoment) + .forEach(function (name) { return _this.accumulatedFirstMoment[name].dispose(); }); + } + if (this.accumulatedSecondMoment != null) { + Object.keys(this.accumulatedSecondMoment) + .forEach(function (name) { return _this.accumulatedSecondMoment[name].dispose(); }); + } + }; + AdamOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + beta1: this.beta1, + beta2: this.beta2, + epsilon: this.epsilon, + }; + }; + AdamOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.beta1, config.beta2, config.epsilon); + }; + AdamOptimizer.className = 'AdamOptimizer'; + return AdamOptimizer; +}(optimizer_1.Optimizer)); +exports.AdamOptimizer = AdamOptimizer; +serialization_1.SerializationMap.register(AdamOptimizer); +//# sourceMappingURL=adam_optimizer.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.js.map new file mode 100644 index 0000000..393f28e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adam_optimizer.js","sourceRoot":"","sources":["../../src/optimizers/adam_optimizer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,8CAAmC;AACnC,sCAAsC;AACtC,kCAA6C;AAC7C,kDAAqG;AAGrG,yCAAsC;AACtC,mDAAqD;AAErD;IAAmC,iCAAS;IAe1C,uBACc,YAAoB,EAAY,KAAa,EAC7C,KAAa,EAAY,OAAsB;QAAtB,wBAAA,EAAA,cAAsB;QAF7D,YAGE,iBAAO,SAmBR;QArBa,kBAAY,GAAZ,YAAY,CAAQ;QAAY,WAAK,GAAL,KAAK,CAAQ;QAC7C,WAAK,GAAL,KAAK,CAAQ;QAAY,aAAO,GAAP,OAAO,CAAe;QALrD,4BAAsB,GAAqB,EAAE,CAAC;QAC9C,6BAAuB,GAAqB,EAAE,CAAC;QAMrD,KAAI,CAAC,CAAC,GAAG,cAAI,CAAC,YAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QAErC,KAAI,CAAC,WAAW,GAAG,cAAI,CAAC,YAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACvC,KAAI,CAAC,WAAW,GAAG,cAAI,CAAC,YAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACvC,cAAI,CAAC;YAEH,KAAI,CAAC,QAAQ,GAAG,YAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;YACzC,KAAI,CAAC,QAAQ,GAAG,YAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,EAA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AAE,IAAI,CAAC,YAAY;YAC/B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;IACM,wBAAU,GAAjB,UACI,GAA+B,EAAE,MAAkB;QACrD,OAAO,IAAI,GAAG,CACV,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvE,CAAC;IAtHM,uBAAS,GAAG,eAAe,CAAC;IAuHrC,oBAAC;CAAA,AAxHD,CAAmC,qBAAS,GAwH3C;AAxHY,sCAAa;AAyH1B,gCAAgB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer_test.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer_test.js new file mode 100644 index 0000000..dd884b2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer_test.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('AdamOptimizer', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var learningRate = .1; + var beta1 = .8; + var beta2 = .9; + var optimizer = tf.train.adam(learningRate, beta1, beta2); + var x = tf.tensor1d([2, 4]).variable(); + var f = function () { return x.square().sum(); }; + var numTensors = tf.memory().numTensors; + var cost = optimizer.minimize(f, true); + expect(tf.memory().numTensors).toBe(numTensors + 3); + test_util_1.expectArraysClose(x, [1.9, 3.9]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(f, false); + test_util_1.expectArraysClose(x, [1.8000001, 3.8002]); + expect(tf.memory().numTensors).toBe(numTensors); + expect(cost).toBe(null); + x.dispose(); + optimizer.dispose(); + expect(tf.memory().numTensors).toBe(1); + }); + it('serialization round-trip', function () { + var originalOpt = tf.train.adam(0.1, 0.2, 0.3, 2e-8); + var reserialized = tf.AdamOptimizer.fromConfig(tf.AdamOptimizer, originalOpt.getConfig()); + expect(reserialized.getConfig()).toEqual(originalOpt.getConfig()); + }); +}); +//# sourceMappingURL=adam_optimizer_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer_test.js.map new file mode 100644 index 0000000..91ab4ee --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adam_optimizer_test.js","sourceRoot":"","sources":["../../src/optimizers/adam_optimizer_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,eAAe,EAAE,oBAAQ,EAAE;IAC3C,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,YAAY,GAAG,EAAE,CAAC;QACxB,IAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAE5D,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAEz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,CAAC,EAAE,CAAC,aAAa,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;QAC3E,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts new file mode 100644 index 0000000..1a60bfd --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts @@ -0,0 +1,27 @@ +import { ConfigDict, Serializable, SerializableConstructor } from '../serialization'; +import { NamedVariableMap } from '../tensor_types'; +import { Optimizer } from './optimizer'; +export declare class AdamaxOptimizer extends Optimizer { + protected learningRate: number; + protected beta1: number; + protected beta2: number; + protected epsilon: number; + protected decay: number; + static className: string; + private c; + private epsScalar; + private accBeta1; + private beta1Scalar; + private beta2Scalar; + private decayScalar; + private oneMinusBeta1; + private one; + private iteration; + private accumulatedFirstMoment; + private accumulatedWeightedInfNorm; + constructor(learningRate: number, beta1: number, beta2: number, epsilon?: number, decay?: number); + applyGradients(variableGradients: NamedVariableMap): void; + dispose(): void; + getConfig(): ConfigDict; + static fromConfig(cls: SerializableConstructor, config: ConfigDict): T; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.js new file mode 100644 index 0000000..0e07b96 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.js @@ -0,0 +1,121 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var globals_1 = require("../globals"); +var ops_1 = require("../ops/ops"); +var serialization_1 = require("../serialization"); +var optimizer_1 = require("./optimizer"); +var optimizer_utils = require("./optimizer_utils"); +var AdamaxOptimizer = (function (_super) { + __extends(AdamaxOptimizer, _super); + function AdamaxOptimizer(learningRate, beta1, beta2, epsilon, decay) { + if (epsilon === void 0) { epsilon = null; } + if (decay === void 0) { decay = 0.0; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.beta1 = beta1; + _this.beta2 = beta2; + _this.epsilon = epsilon; + _this.decay = decay; + _this.accumulatedFirstMoment = {}; + _this.accumulatedWeightedInfNorm = {}; + _this.c = globals_1.keep(ops_1.scalar(-learningRate)); + _this.beta1Scalar = globals_1.keep(ops_1.scalar(beta1)); + _this.beta2Scalar = globals_1.keep(ops_1.scalar(beta2)); + _this.decayScalar = globals_1.keep(ops_1.scalar(decay)); + globals_1.tidy(function () { + _this.iteration = ops_1.scalar(0).variable(); + _this.accBeta1 = ops_1.scalar(beta1).variable(); + }); + _this.oneMinusBeta1 = globals_1.keep(ops_1.scalar(1 - beta1)); + _this.one = globals_1.keep(ops_1.scalar(1)); + if (epsilon === null) { + epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue(); + } + _this.epsScalar = globals_1.keep(ops_1.scalar(epsilon)); + return _this; + } + AdamaxOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + globals_1.tidy(function () { + var oneMinusAccBeta1 = _this.one.sub(_this.accBeta1); + var lr = _this.c.div(_this.one.add(_this.decayScalar.mul(_this.iteration))); + for (var variableName in variableGradients) { + var value = environment_1.ENV.engine.registeredVariables[variableName]; + if (_this.accumulatedFirstMoment[variableName] == null) { + var trainable = false; + _this.accumulatedFirstMoment[variableName] = + ops_1.zerosLike(value).variable(trainable); + } + if (_this.accumulatedWeightedInfNorm[variableName] == null) { + var trainable = false; + _this.accumulatedWeightedInfNorm[variableName] = + ops_1.zerosLike(value).variable(trainable); + } + var gradient = variableGradients[variableName]; + var firstMoment = _this.accumulatedFirstMoment[variableName]; + var weightedInfNorm = _this.accumulatedWeightedInfNorm[variableName]; + var newFirstMoment = _this.beta1Scalar.mul(firstMoment) + .add(_this.oneMinusBeta1.mul(gradient)); + var ut0 = _this.beta2Scalar.mul(weightedInfNorm); + var ut1 = gradient.abs(); + var newWeightedInfNorm = ut0.maximum(ut1); + _this.accumulatedFirstMoment[variableName].assign(newFirstMoment); + _this.accumulatedWeightedInfNorm[variableName].assign(newWeightedInfNorm); + var newValue = lr.div(oneMinusAccBeta1) + .mul(newFirstMoment.div(_this.epsScalar.add(newWeightedInfNorm))) + .add(value); + value.assign(newValue); + } + _this.iteration.assign(_this.iteration.add(_this.one)); + _this.accBeta1.assign(_this.accBeta1.mul(_this.beta1Scalar)); + }); + }; + AdamaxOptimizer.prototype.dispose = function () { + var _this = this; + this.c.dispose(); + this.epsScalar.dispose(); + this.accBeta1.dispose(); + this.beta1Scalar.dispose(); + this.beta2Scalar.dispose(); + this.oneMinusBeta1.dispose(); + this.decayScalar.dispose(); + this.iteration.dispose(); + this.one.dispose(); + if (this.accumulatedFirstMoment != null) { + Object.keys(this.accumulatedFirstMoment) + .forEach(function (name) { return _this.accumulatedFirstMoment[name].dispose(); }); + } + if (this.accumulatedWeightedInfNorm != null) { + Object.keys(this.accumulatedWeightedInfNorm) + .forEach(function (name) { return _this.accumulatedWeightedInfNorm[name].dispose(); }); + } + }; + AdamaxOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + beta1: this.beta1, + beta2: this.beta2, + epsilon: this.epsilon, + decay: this.decay + }; + }; + AdamaxOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.beta1, config.beta2, config.epsilon, config.decay); + }; + AdamaxOptimizer.className = 'AdamaxOptimizer'; + return AdamaxOptimizer; +}(optimizer_1.Optimizer)); +exports.AdamaxOptimizer = AdamaxOptimizer; +serialization_1.SerializationMap.register(AdamaxOptimizer); +//# sourceMappingURL=adamax_optimizer.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.js.map new file mode 100644 index 0000000..25461c8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adamax_optimizer.js","sourceRoot":"","sources":["../../src/optimizers/adamax_optimizer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,8CAAmC;AACnC,sCAAsC;AACtC,kCAA6C;AAC7C,kDAAqG;AAGrG,yCAAsC;AACtC,mDAAqD;AAErD;IAAqC,mCAAS;IAe5C,yBACc,YAAoB,EAAY,KAAa,EAC7C,KAAa,EAAY,OAAsB,EAC/C,KAAW;QADc,wBAAA,EAAA,cAAsB;QAC/C,sBAAA,EAAA,WAAW;QAHzB,YAIE,iBAAO,SAsBR;QAzBa,kBAAY,GAAZ,YAAY,CAAQ;QAAY,WAAK,GAAL,KAAK,CAAQ;QAC7C,WAAK,GAAL,KAAK,CAAQ;QAAY,aAAO,GAAP,OAAO,CAAe;QAC/C,WAAK,GAAL,KAAK,CAAM;QANjB,4BAAsB,GAAqB,EAAE,CAAC;QAC9C,gCAA0B,GAAqB,EAAE,CAAC;QAOxD,KAAI,CAAC,CAAC,GAAG,cAAI,CAAC,YAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QAGrC,KAAI,CAAC,WAAW,GAAG,cAAI,CAAC,YAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACvC,KAAI,CAAC,WAAW,GAAG,cAAI,CAAC,YAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAEvC,KAAI,CAAC,WAAW,GAAG,cAAI,CAAC,YAAM,CAAC,KA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+C,CAAC,CAAC;SACvE;IACH,CAAC;IACD,mCAAS,GAAT;QACE,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;IACM,0BAAU,GAAjB,UACI,GAA+B,EAAE,MAAkB;QACrD,OAAO,IAAI,GAAG,CACV,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAC/D,MAAM,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IA9HM,yBAAS,GAAG,iBAAiB,CAAC;IA+HvC,sBAAC;CAAA,AAhID,CAAqC,qBAAS,GAgI7C;AAhIY,0CAAe;AAiI5B,gCAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer_test.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer_test.js new file mode 100644 index 0000000..9b7270f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer_test.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('AdamaxOptimizer', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var learningRate = 0.1; + var beta1 = 0.8; + var beta2 = 0.9; + var decay = 0.1; + var optimizer = tf.train.adamax(learningRate, beta1, beta2, undefined, decay); + var x = tf.tensor1d([2, 4]).variable(); + var f = function () { return x.square().sum(); }; + var numTensors = tf.memory().numTensors; + var cost = optimizer.minimize(f, true); + expect(tf.memory().numTensors).toBe(numTensors + 3); + test_util_1.expectArraysClose(x, [1.9, 3.9]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(f, false); + test_util_1.expectArraysClose(x, [1.80697, 3.8086]); + expect(tf.memory().numTensors).toBe(numTensors); + expect(cost).toBe(null); + x.dispose(); + optimizer.dispose(); + expect(tf.memory().numTensors).toBe(1); + }); + it('serialization round-trip', function () { + var originalOpt = tf.train.adamax(0.1, 0.2, 0.3, 2e-8, 0.1); + var reserialized = tf.AdamaxOptimizer.fromConfig(tf.AdamaxOptimizer, originalOpt.getConfig()); + expect(reserialized.getConfig()).toEqual(originalOpt.getConfig()); + }); +}); +//# sourceMappingURL=adamax_optimizer_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer_test.js.map new file mode 100644 index 0000000..1408fe6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adamax_optimizer_test.js","sourceRoot":"","sources":["../../src/optimizers/adamax_optimizer_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,iBAAiB,EAAE,oBAAQ,EAAE;IAC7C,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,YAAY,GAAG,GAAG,CAAC;QACzB,IAAM,KAAK,GAAG,GAAG,CAAC;QAClB,IAAM,KAAK,GAAG,GAAG,CAAC;QAClB,IAAM,KAAK,GAAG,G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,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,0BAA0B,EAAE;QAC7B,IAAM,WAAW,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAC9D,IAAM,YAAY,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,CAC9C,EAAE,CAAC,eAAe,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;QACjD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts new file mode 100644 index 0000000..474f9a3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts @@ -0,0 +1,17 @@ +import { ConfigDict, Serializable, SerializableConstructor } from '../serialization'; +import { NamedVariableMap } from '../tensor_types'; +import { SGDOptimizer } from './sgd_optimizer'; +export declare class MomentumOptimizer extends SGDOptimizer { + protected learningRate: number; + private momentum; + private useNesterov; + static className: string; + private m; + private accumulations; + constructor(learningRate: number, momentum: number, useNesterov?: boolean); + applyGradients(variableGradients: NamedVariableMap): void; + dispose(): void; + setMomentum(momentum: number): void; + getConfig(): ConfigDict; + static fromConfig(cls: SerializableConstructor, config: ConfigDict): T; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.js new file mode 100644 index 0000000..4c0c494 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.js @@ -0,0 +1,89 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var globals_1 = require("../globals"); +var ops_1 = require("../ops/ops"); +var serialization_1 = require("../serialization"); +var sgd_optimizer_1 = require("./sgd_optimizer"); +var MomentumOptimizer = (function (_super) { + __extends(MomentumOptimizer, _super); + function MomentumOptimizer(learningRate, momentum, useNesterov) { + if (useNesterov === void 0) { useNesterov = false; } + var _this = _super.call(this, learningRate) || this; + _this.learningRate = learningRate; + _this.momentum = momentum; + _this.useNesterov = useNesterov; + _this.m = ops_1.scalar(_this.momentum); + _this.accumulations = {}; + return _this; + } + MomentumOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var _loop_1 = function (variableName) { + var value = environment_1.ENV.engine.registeredVariables[variableName]; + if (this_1.accumulations[variableName] == null) { + var trainable_1 = false; + globals_1.tidy(function () { + _this.accumulations[variableName] = + ops_1.zerosLike(value).variable(trainable_1); + }); + } + var accumulation = this_1.accumulations[variableName]; + var gradient = variableGradients[variableName]; + globals_1.tidy(function () { + var newValue; + var newAccumulation = _this.m.mul(accumulation).add(gradient); + if (_this.useNesterov) { + newValue = + _this.c.mul(gradient.add(newAccumulation.mul(_this.m))).add(value); + } + else { + newValue = _this.c.mul(newAccumulation).add(value); + } + _this.accumulations[variableName].assign(newAccumulation); + value.assign(newValue); + }); + }; + var this_1 = this; + for (var variableName in variableGradients) { + _loop_1(variableName); + } + }; + MomentumOptimizer.prototype.dispose = function () { + _super.prototype.dispose.call(this); + this.m.dispose(); + if (this.accumulations != null) { + for (var variableName in this.accumulations) { + this.accumulations[variableName].dispose(); + } + } + }; + MomentumOptimizer.prototype.setMomentum = function (momentum) { + this.momentum = momentum; + }; + MomentumOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + momentum: this.momentum, + useNesterov: this.useNesterov + }; + }; + MomentumOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.momentum, config.useNesterov); + }; + MomentumOptimizer.className = 'MomentumOptimizer'; + return MomentumOptimizer; +}(sgd_optimizer_1.SGDOptimizer)); +exports.MomentumOptimizer = MomentumOptimizer; +serialization_1.SerializationMap.register(MomentumOptimizer); +//# sourceMappingURL=momentum_optimizer.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.js.map new file mode 100644 index 0000000..c938628 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"momentum_optimizer.js","sourceRoot":"","sources":["../../src/optimizers/momentum_optimizer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,8CAAmC;AACnC,sCAAgC;AAChC,kCAA6C;AAC7C,kDAAqG;AAGrG,iDAA6C;AAG7C;IAAuC,qCAAY;IAKjD,2BACc,YAAoB,EAAU,QAAgB,EAChD,WAAmB;QAAnB,4BAAA,EAAA,mBAAmB;QAF/B,YAGE,kBAAM,YAAY,CAAC,SAGpB;QALa,kBAAY,GAAZ,YAAY,CAAQ;QAAU,cAAQ,GAAR,QAAQ,CAAQ;QAChD,iBAAW,GAAX,WAAW,CAAQ;QAE7B,KAAI,CAAC,CAAC,GAAG,YAAM,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,KAAI,CAAC,aAAa,GAAG,EAAE,CAAC;;IAC1B,CAAC;IAED,0CAAc,GAAd,UAAe,iBAAmC;QAAlD,iBA2BC;gCA1BY,YAAY;YACrB,IAAM,KAAK,GAAG,iBAAG,CAAC,MAAM,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,OAAO,EAAE,CAAC;QACjB,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,EAAE;YAC9B,KAAK,IAAM,YAAY,IAAI,IAAI,CAAC,aAAa,EAAE;gBAC7C,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;aAC5C;SACF;IACH,CAAC;IAOD,uCAAW,GAAX,UAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,qCAAS,GAAT;QACE,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;IACJ,CAAC;IACM,4BAAU,GAAjB,UACI,GAA+B,EAAE,MAAkB;QACrD,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAC3E,CAAC;IAtEM,2BAAS,GAAG,mBAAmB,CAAC;IAuEzC,wBAAC;CAAA,AAxED,CAAuC,4BAAY,GAwElD;AAxEY,8CAAiB;AAyE9B,gCAAgB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer_test.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer_test.js new file mode 100644 index 0000000..6364dea --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer_test.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('MomentumOptimizer', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var learningRate = .1; + var momentum = .5; + var optimizer = tf.train.momentum(learningRate, momentum); + var x = tf.tensor1d([1, 2]).variable(); + var f = function () { return x.square().sum(); }; + var numTensors = tf.memory().numTensors; + var cost = optimizer.minimize(f, true); + expect(tf.memory().numTensors).toBe(numTensors + 2); + test_util_1.expectArraysClose(x, [.8, 1.6]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(f, false); + test_util_1.expectArraysClose(x, [0.54, 1.08]); + expect(tf.memory().numTensors).toBe(numTensors); + expect(cost).toBe(null); + x.dispose(); + optimizer.dispose(); + expect(tf.memory().numTensors).toBe(1); + }); + it('basic - with Nesterov', function () { + var learningRate = .1; + var momentum = .5; + var useNesterov = true; + var optimizer = tf.train.momentum(learningRate, momentum, useNesterov); + var x = tf.tensor1d([1, 2]).variable(); + var f = function () { return x.square().sum(); }; + var numTensors = tf.memory().numTensors; + var cost = optimizer.minimize(f, true); + expect(tf.memory().numTensors).toBe(numTensors + 2); + test_util_1.expectArraysClose(x, [.7, 1.4]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(f, false); + test_util_1.expectArraysClose(x, [0.44, 0.88]); + expect(tf.memory().numTensors).toBe(numTensors); + expect(cost).toBe(null); + x.dispose(); + optimizer.dispose(); + expect(tf.memory().numTensors).toBe(1); + }); + it('serialization round-trip', function () { + var originalOpt = tf.train.momentum(0.1, 0.2, true); + var reserialized = tf.MomentumOptimizer.fromConfig(tf.MomentumOptimizer, originalOpt.getConfig()); + expect(reserialized.getConfig()).toEqual(originalOpt.getConfig()); + }); +}); +//# sourceMappingURL=momentum_optimizer_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer_test.js.map new file mode 100644 index 0000000..e492c00 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"momentum_optimizer_test.js","sourceRoot":"","sources":["../../src/optimizers/momentum_optimizer_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,mBAAmB,EAAE,oBAAQ,EAAE;IAC/C,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,YAAY,GAAG,EAAE,CAAC;QACxB,IAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,IAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAE5D,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAEzC,IAAM,CAAC,GAAG,cAAM,OAAA,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAe,EAA7B,CAA6B,CAAC;QAE9C,IAAI,UAAU,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC;QAExC,IAAI,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAmB,IAAI,CAAC,CAAC;QAGxD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAQpD,6BAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QAEhC,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,UAAU,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC;QAEpC,IAAI,GAAG,SAAS,CAAC,QAAQ,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E,EAAE,GAAG,CAAC,CAAC,CAAC;QAEhC,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,UAAU,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC;QAEpC,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAmB,KAAK,CAAC,CAAC;QAOrD,6BAAiB,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QAGnC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEhD,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAExB,CAAC,CAAC,OAAO,EAAE,CAAC;QACZ,SAAS,CAAC,OAAO,EAAE,CAAC;QAGpB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,0BAA0B,EAAE;QAC7B,IAAM,WAAW,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QACtD,IAAM,YAAY,GAAG,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAChD,EAAE,CAAC,iBAAiB,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts new file mode 100644 index 0000000..f6d375a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts @@ -0,0 +1,11 @@ +import { Serializable } from '../serialization'; +import { Scalar, Variable } from '../tensor'; +import { NamedTensorMap } from '../tensor_types'; +export declare abstract class Optimizer extends Serializable { + minimize(f: () => Scalar, returnCost?: boolean, varList?: Variable[]): Scalar | null; + computeGradients(f: () => Scalar, varList?: Variable[]): { + value: Scalar; + grads: NamedTensorMap; + }; + abstract applyGradients(variableGradients: NamedTensorMap): void; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.js new file mode 100644 index 0000000..c96a875 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.js @@ -0,0 +1,40 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var globals_1 = require("../globals"); +var serialization_1 = require("../serialization"); +var Optimizer = (function (_super) { + __extends(Optimizer, _super); + function Optimizer() { + return _super !== null && _super.apply(this, arguments) || this; + } + Optimizer.prototype.minimize = function (f, returnCost, varList) { + if (returnCost === void 0) { returnCost = false; } + var _a = this.computeGradients(f, varList), value = _a.value, grads = _a.grads; + this.applyGradients(grads); + var varNames = Object.keys(grads); + varNames.forEach(function (varName) { return grads[varName].dispose(); }); + if (returnCost) { + return value; + } + else { + value.dispose(); + return null; + } + }; + Optimizer.prototype.computeGradients = function (f, varList) { + return globals_1.variableGrads(f, varList); + }; + return Optimizer; +}(serialization_1.Serializable)); +exports.Optimizer = Optimizer; +//# sourceMappingURL=optimizer.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.js.map new file mode 100644 index 0000000..98625c6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"optimizer.js","sourceRoot":"","sources":["../../src/optimizers/optimizer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,sCAAyC;AACzC,kDAA8C;AAK9C;IAAwC,6BAAY;IAApD;;IAmDA,CAAC;IAtCC,4BAAQ,GAAR,UAAS,CAAe,EAAE,UAAkB,EAAE,OAAoB;QAAxC,2BAAA,EAAA,kBAAkB;QAEpC,IAAA,sCAAkD,EAAjD,gBAAK,EAAE,gBAAK,CAAsC;QAEzD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAG3B,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAxB,CAAwB,CAAC,CAAC;QAEtD,IAAI,UAAU,EAAE;YACd,OAAO,KAAe,CAAC;SACxB;aAAM;YACL,KAAK,CAAC,OAAO,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAYD,oCAAgB,GAAhB,UAAiB,CAAe,EAAE,OAAoB;QAEpD,OAAO,uBAAa,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAOH,gBAAC;AAAD,CAAC,AAnDD,CAAwC,4BAAY,GAmDnD;AAnDqB,8BAAS"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts new file mode 100644 index 0000000..39ed799 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts @@ -0,0 +1,16 @@ +import { AdadeltaOptimizer } from './adadelta_optimizer'; +import { AdagradOptimizer } from './adagrad_optimizer'; +import { AdamOptimizer } from './adam_optimizer'; +import { AdamaxOptimizer } from './adamax_optimizer'; +import { MomentumOptimizer } from './momentum_optimizer'; +import { RMSPropOptimizer } from './rmsprop_optimizer'; +import { SGDOptimizer } from './sgd_optimizer'; +export declare class OptimizerConstructors { + static sgd(learningRate: number): SGDOptimizer; + static momentum(learningRate: number, momentum: number, useNesterov?: boolean): MomentumOptimizer; + static rmsprop(learningRate: number, decay?: number, momentum?: number, epsilon?: number, centered?: boolean): RMSPropOptimizer; + static adam(learningRate?: number, beta1?: number, beta2?: number, epsilon?: number): AdamOptimizer; + static adadelta(learningRate?: number, rho?: number, epsilon?: number): AdadeltaOptimizer; + static adamax(learningRate?: number, beta1?: number, beta2?: number, epsilon?: number, decay?: number): AdamaxOptimizer; + static adagrad(learningRate: number, initialAccumulatorValue?: number): AdagradOptimizer; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.js new file mode 100644 index 0000000..37d3b07 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var adadelta_optimizer_1 = require("./adadelta_optimizer"); +var adagrad_optimizer_1 = require("./adagrad_optimizer"); +var adam_optimizer_1 = require("./adam_optimizer"); +var adamax_optimizer_1 = require("./adamax_optimizer"); +var momentum_optimizer_1 = require("./momentum_optimizer"); +var rmsprop_optimizer_1 = require("./rmsprop_optimizer"); +var sgd_optimizer_1 = require("./sgd_optimizer"); +var OptimizerConstructors = (function () { + function OptimizerConstructors() { + } + OptimizerConstructors.sgd = function (learningRate) { + return new sgd_optimizer_1.SGDOptimizer(learningRate); + }; + OptimizerConstructors.momentum = function (learningRate, momentum, useNesterov) { + if (useNesterov === void 0) { useNesterov = false; } + return new momentum_optimizer_1.MomentumOptimizer(learningRate, momentum, useNesterov); + }; + OptimizerConstructors.rmsprop = function (learningRate, decay, momentum, epsilon, centered) { + if (decay === void 0) { decay = .9; } + if (momentum === void 0) { momentum = 0.0; } + if (epsilon === void 0) { epsilon = null; } + if (centered === void 0) { centered = false; } + return new rmsprop_optimizer_1.RMSPropOptimizer(learningRate, decay, momentum, epsilon, centered); + }; + OptimizerConstructors.adam = function (learningRate, beta1, beta2, epsilon) { + if (learningRate === void 0) { learningRate = 0.001; } + if (beta1 === void 0) { beta1 = 0.9; } + if (beta2 === void 0) { beta2 = 0.999; } + if (epsilon === void 0) { epsilon = null; } + return new adam_optimizer_1.AdamOptimizer(learningRate, beta1, beta2, epsilon); + }; + OptimizerConstructors.adadelta = function (learningRate, rho, epsilon) { + if (learningRate === void 0) { learningRate = .001; } + if (rho === void 0) { rho = .95; } + if (epsilon === void 0) { epsilon = null; } + return new adadelta_optimizer_1.AdadeltaOptimizer(learningRate, rho, epsilon); + }; + OptimizerConstructors.adamax = function (learningRate, beta1, beta2, epsilon, decay) { + if (learningRate === void 0) { learningRate = 0.002; } + if (beta1 === void 0) { beta1 = 0.9; } + if (beta2 === void 0) { beta2 = 0.999; } + if (epsilon === void 0) { epsilon = null; } + if (decay === void 0) { decay = 0.0; } + return new adamax_optimizer_1.AdamaxOptimizer(learningRate, beta1, beta2, epsilon, decay); + }; + OptimizerConstructors.adagrad = function (learningRate, initialAccumulatorValue) { + if (initialAccumulatorValue === void 0) { initialAccumulatorValue = 0.1; } + return new adagrad_optimizer_1.AdagradOptimizer(learningRate, initialAccumulatorValue); + }; + return OptimizerConstructors; +}()); +exports.OptimizerConstructors = OptimizerConstructors; +//# sourceMappingURL=optimizer_constructors.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.js.map new file mode 100644 index 0000000..50300fd --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"optimizer_constructors.js","sourceRoot":"","sources":["../../src/optimizers/optimizer_constructors.ts"],"names":[],"mappings":";;AAiBA,2DAAuD;AACvD,yDAAqD;AACrD,mDAA+C;AAC/C,uDAAmD;AACnD,2DAAuD;AACvD,yDAAqD;AACrD,iDAA6C;AAE7C;IAAA;IA0KA,CAAC;IAnIQ,yBAAG,GAAV,UAAW,YAAoB;QAC7B,OAAO,IAAI,4BAAY,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IAkBM,8BAAQ,GAAf,UAAgB,YAAoB,EAAE,QAAgB,EAAE,WAAmB;QAAnB,4BAAA,EAAA,mBAAmB;QAEzE,OAAO,IAAI,sCAAiB,CAAC,YAAY,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IACpE,CAAC;IAuBM,6BAAO,GAAd,UACI,YAAoB,EAAE,KAAU,EAAE,QAAc,EAAE,OAAsB,EACxE,QAAgB;QADM,sBAAA,EAAA,UAAU;QAAE,yBAAA,EAAA,cAAc;QAAE,wBAAA,EAAA,cAAsB;QACxE,yBAAA,EAAA,gBAAgB;QAClB,OAAO,IAAI,oCAAgB,CACvB,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;IAeM,0BAAI,GAAX,UACI,YAAoB,EAAE,KAAW,EAAE,KAAa,EAChD,OAAsB;QADtB,6BAAA,EAAA,oBAAoB;QAAE,sBAAA,EAAA,WAAW;QAAE,sBAAA,EAAA,aAAa;QAChD,wBAAA,EAAA,cAAsB;QACxB,OAAO,IAAI,8BAAa,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAeM,8BAAQ,GAAf,UAAgB,YAAmB,EAAE,GAAS,EAAE,OAAsB;QAAtD,6BAAA,EAAA,mBAAmB;QAAE,oBAAA,EAAA,SAAS;QAAE,wBAAA,EAAA,cAAsB;QAEpE,OAAO,IAAI,sCAAiB,CAAC,YAAY,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAgBM,4BAAM,GAAb,UACI,YAAoB,EAAE,KAAW,EAAE,KAAa,EAAE,OAAsB,EACxE,KAAW;QADX,6BAAA,EAAA,oBAAoB;QAAE,sBAAA,EAAA,WAAW;QAAE,sBAAA,EAAA,aAAa;QAAE,wBAAA,EAAA,cAAsB;QACxE,sBAAA,EAAA,WAAW;QACb,OAAO,IAAI,kCAAe,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACzE,CAAC;IAmBM,6BAAO,GAAd,UAAe,YAAoB,EAAE,uBAA6B;QAA7B,wCAAA,EAAA,6BAA6B;QAEhE,OAAO,IAAI,oCAAgB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;IACrE,CAAC;IACH,4BAAC;AAAD,CAAC,AA1KD,IA0KC;AA1KY,sDAAqB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_test.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_test.js new file mode 100644 index 0000000..bca539d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_test.js @@ -0,0 +1,136 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require(".."); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +var sgd_optimizer_1 = require("./sgd_optimizer"); +jasmine_util_1.describeWithFlags('optimizer', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var learningRate = .1; + var optimizer = tf.train.sgd(learningRate); + var x = tf.scalar(4).variable(); + var bias = tf.scalar(1).variable(); + var strayVariable = tf.scalar(-1).variable(); + var numTensors = tf.memory().numTensors; + var f = function () { return x.square().addStrict(bias); }; + var cost = optimizer.minimize(f, true); + expect(tf.memory().numTensors).toBe(numTensors + 1); + var expectedX1 = -2 * 4 * learningRate + 4; + var expectedBias1 = -1 * learningRate + 1; + test_util_1.expectArraysClose(x, [expectedX1]); + test_util_1.expectArraysClose(bias, [expectedBias1]); + test_util_1.expectArraysClose(cost, [Math.pow(4, 2) + 1]); + test_util_1.expectArraysClose(strayVariable, [-1]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(f, false); + expect(tf.memory().numTensors).toBe(numTensors); + var expectedX2 = -2 * expectedX1 * learningRate + expectedX1; + var expectedBias2 = -learningRate + expectedBias1; + test_util_1.expectArraysClose(x, [expectedX2]); + test_util_1.expectArraysClose(bias, [expectedBias2]); + expect(cost).toBe(null); + test_util_1.expectArraysClose(strayVariable, [-1]); + optimizer.dispose(); + x.dispose(); + bias.dispose(); + strayVariable.dispose(); + expect(tf.memory().numTensors).toBe(3); + }); + it('varList array of all variables', function () { + var learningRate = .1; + var optimizer = new sgd_optimizer_1.SGDOptimizer(learningRate); + var x = tf.scalar(4).variable(); + var bias = tf.scalar(1).variable(); + var strayVariable = tf.scalar(-1).variable(); + var varList = [x, bias]; + var f = function () { return x.square().addStrict(bias); }; + var cost = optimizer.minimize(f, true, varList); + var expectedX1 = -2 * 4 * learningRate + 4; + var expectedBias1 = -1 * learningRate + 1; + test_util_1.expectArraysClose(x, [expectedX1]); + test_util_1.expectArraysClose(bias, [expectedBias1]); + test_util_1.expectArraysClose(cost, [Math.pow(4, 2) + 1]); + test_util_1.expectArraysClose(strayVariable, [-1]); + cost = optimizer.minimize(f, false, varList); + var expectedX2 = -2 * expectedX1 * learningRate + expectedX1; + var expectedBias2 = -learningRate + expectedBias1; + test_util_1.expectArraysClose(x, [expectedX2]); + test_util_1.expectArraysClose(bias, [expectedBias2]); + test_util_1.expectArraysClose(strayVariable, [-1]); + expect(cost).toBe(null); + }); + it('varList empty array of variables throws error', function () { + var learningRate = .1; + var optimizer = new sgd_optimizer_1.SGDOptimizer(learningRate); + var x = tf.scalar(4).variable(); + var bias = tf.scalar(1).variable(); + tf.scalar(-1).variable(); + var varList = []; + var f = function () { return x.square().addStrict(bias); }; + expect(function () { return optimizer.minimize(f, true, varList); }) + .toThrowError(); + }); + it('varList subset of variables update', function () { + var learningRate = .1; + var optimizer = new sgd_optimizer_1.SGDOptimizer(learningRate); + var x = tf.scalar(4).variable(); + var bias = tf.scalar(1).variable(); + var strayVariable = tf.scalar(-1).variable(); + var varList = [x]; + var f = function () { return x.square().addStrict(bias); }; + var cost = optimizer.minimize(f, true, varList); + var expectedValue1 = -2 * 4 * learningRate + 4; + test_util_1.expectArraysClose(x, [expectedValue1]); + test_util_1.expectArraysClose(bias, [1]); + test_util_1.expectArraysClose(cost, [Math.pow(4, 2) + 1]); + test_util_1.expectArraysClose(strayVariable, [-1]); + cost = optimizer.minimize(f, false, varList); + var expectedValue2 = -2 * expectedValue1 * learningRate + expectedValue1; + test_util_1.expectArraysClose(x, [expectedValue2]); + test_util_1.expectArraysClose(bias, [1]); + expect(cost).toBe(null); + test_util_1.expectArraysClose(strayVariable, [-1]); + }); + it('only bias trainable', function () { + var learningRate = .1; + var optimizer = new sgd_optimizer_1.SGDOptimizer(learningRate); + var trainable = false; + var x = tf.scalar(4).variable(trainable); + var bias = tf.scalar(1).variable(); + var strayVariable = tf.scalar(-1).variable(); + var f = function () { return x.square().addStrict(bias); }; + var cost = optimizer.minimize(f, true); + test_util_1.expectArraysClose(x, [4]); + var expectedBias1 = -1 * learningRate + 1; + test_util_1.expectArraysClose(bias, [expectedBias1]); + test_util_1.expectArraysClose(cost, [Math.pow(4, 2) + 1]); + test_util_1.expectArraysClose(strayVariable, [-1]); + cost = optimizer.minimize(f, false); + test_util_1.expectArraysClose(x, [4]); + var expectedBias2 = -learningRate + expectedBias1; + test_util_1.expectArraysClose(bias, [expectedBias2]); + expect(cost).toBe(null); + test_util_1.expectArraysClose(strayVariable, [-1]); + }); + it('only bias trainable, only x in varList throws error', function () { + var learningRate = .1; + var optimizer = new sgd_optimizer_1.SGDOptimizer(learningRate); + var trainable = false; + var x = tf.scalar(4).variable(trainable); + var bias = tf.scalar(1).variable(); + tf.scalar(-1).variable(); + var varList = [x]; + var f = function () { return x.square().addStrict(bias); }; + expect(function () { return optimizer.minimize(f, true, varList); }) + .toThrowError(); + }); + it('throws error when f returns a non-scalar', function () { + var learningRate = .1; + var optimizer = new sgd_optimizer_1.SGDOptimizer(learningRate); + var x = tf.tensor1d([1, 2]).variable(); + var f = function () { return x.square(); }; + expect(function () { return optimizer.minimize(f); }).toThrowError(); + }); +}); +//# sourceMappingURL=optimizer_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_test.js.map new file mode 100644 index 0000000..f623e26 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"optimizer_test.js","sourceRoot":"","sources":["../../src/optimizers/optimizer_test.ts"],"names":[],"mappings":";;AAiBA,uBAAyB;AACzB,gDAAkD;AAElD,0CAAyD;AACzD,iDAA6C;AAE7C,gCAAiB,CAAC,WAAW,EAAE,oBAAQ,EAAE;IACvC,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,YAAY,GAAG,EAAE,CAAC;QACxB,IAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAE7C,IAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAClC,IAAM,IAAI,GAAG,EAAE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AAC,SAAS,CAAC,CAAC;QAC3C,IAAM,IAAI,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAErC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACzB,IAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;QAEpB,IAAM,CAAC,GAAG,cAAM,OAAA,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAA1B,CAA0B,CAAC;QAE3C,MAAM,CAAC,cAAM,OAAA,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAmB,IAAI,EAAE,OAAO,CAAC,EAArD,CAAqD,CAAC;aAC9D,YAAY,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,IAAM,YAAY,GAAG,EAAE,CAAC;QACxB,IAAM,SAAS,GAAG,IAAI,4BAAY,CAAC,YAAY,CAAC,CAAC;QAEjD,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAM,CAAC,GAAG,cAAM,OAAA,CAAC,CAAC,MAAM,EAAE,EAAV,CAAU,CAAC;QAG3B,MAAM,CAAC,cAAM,OAAA,SAAS,CAAC,QAAQ,CAAC,CAAQ,CAAC,EAA5B,CAA4B,CAAC,CAAC,YAAY,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_utils.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_utils.d.ts new file mode 100644 index 0000000..634983b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_utils.d.ts @@ -0,0 +1 @@ +export declare function getOptimizerDefaultEpsilonValue(): 1e-8 | 0.0001; diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_utils.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_utils.js new file mode 100644 index 0000000..013dc44 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_utils.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var DEFAULT_FLOAT32_EPSILON = 1e-8; +var DEFAULT_FLOAT16_EPSILON = 1e-4; +function getOptimizerDefaultEpsilonValue() { + if (environment_1.ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) { + return DEFAULT_FLOAT32_EPSILON; + } + return DEFAULT_FLOAT16_EPSILON; +} +exports.getOptimizerDefaultEpsilonValue = getOptimizerDefaultEpsilonValue; +//# sourceMappingURL=optimizer_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_utils.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_utils.js.map new file mode 100644 index 0000000..00b86fe --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"optimizer_utils.js","sourceRoot":"","sources":["../../src/optimizers/optimizer_utils.ts"],"names":[],"mappings":";;AAgBA,8CAAmC;AAEnC,IAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,IAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC;IACE,IAAI,iBAAG,CAAC,GAAG,CAAC,8BAA8B,CAAC,EAAE;QAC3C,OAAO,uBAAuB,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAND,0EAMC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts new file mode 100644 index 0000000..6dbcfc4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts @@ -0,0 +1,24 @@ +import { ConfigDict, Serializable, SerializableConstructor } from '../serialization'; +import { NamedVariableMap } from '../tensor_types'; +import { Optimizer } from './optimizer'; +export declare class RMSPropOptimizer extends Optimizer { + protected learningRate: number; + protected decay: number; + protected momentum: number; + protected epsilon: number; + static className: string; + private c; + private epsilonScalar; + private decayScalar; + private momentumScalar; + private oneMinusDecay; + private centered; + private accumulatedMeanSquares; + private accumulatedMeanGrads; + private accumulatedMoments; + constructor(learningRate: number, decay?: number, momentum?: number, epsilon?: number, centered?: boolean); + applyGradients(variableGradients: NamedVariableMap): void; + dispose(): void; + getConfig(): ConfigDict; + static fromConfig(cls: SerializableConstructor, config: ConfigDict): T; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.js new file mode 100644 index 0000000..393cbdf --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.js @@ -0,0 +1,144 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var globals_1 = require("../globals"); +var ops_1 = require("../ops/ops"); +var serialization_1 = require("../serialization"); +var optimizer_1 = require("./optimizer"); +var optimizer_utils = require("./optimizer_utils"); +var RMSPropOptimizer = (function (_super) { + __extends(RMSPropOptimizer, _super); + function RMSPropOptimizer(learningRate, decay, momentum, epsilon, centered) { + if (decay === void 0) { decay = 0.9; } + if (momentum === void 0) { momentum = 0.0; } + if (epsilon === void 0) { epsilon = null; } + if (centered === void 0) { centered = false; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.decay = decay; + _this.momentum = momentum; + _this.epsilon = epsilon; + _this.accumulatedMeanSquares = {}; + _this.accumulatedMeanGrads = {}; + _this.accumulatedMoments = {}; + _this.c = globals_1.keep(ops_1.scalar(learningRate)); + _this.decayScalar = globals_1.keep(ops_1.scalar(decay)); + _this.momentumScalar = globals_1.keep(ops_1.scalar(momentum)); + _this.oneMinusDecay = globals_1.keep(ops_1.scalar(1 - decay)); + _this.centered = centered; + if (epsilon === null) { + epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue(); + } + _this.epsilonScalar = globals_1.keep(ops_1.scalar(epsilon)); + return _this; + } + RMSPropOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var _loop_1 = function (variableName) { + var value = environment_1.ENV.engine.registeredVariables[variableName]; + if (this_1.accumulatedMeanSquares[variableName] == null) { + var trainable_1 = false; + globals_1.tidy(function () { + _this.accumulatedMeanSquares[variableName] = + ops_1.zerosLike(value).variable(trainable_1); + }); + } + if (this_1.accumulatedMeanGrads[variableName] == null && this_1.centered) { + var trainable_2 = false; + globals_1.tidy(function () { + _this.accumulatedMeanGrads[variableName] = + ops_1.zerosLike(value).variable(trainable_2); + }); + } + if (this_1.accumulatedMoments[variableName] == null) { + var trainable_3 = false; + globals_1.tidy(function () { + _this.accumulatedMoments[variableName] = + ops_1.zerosLike(value).variable(trainable_3); + }); + } + var accumulatedMeanSquare = this_1.accumulatedMeanSquares[variableName]; + var accumulatedMeanGrad = this_1.accumulatedMeanGrads[variableName]; + var accumulatedMoments = this_1.accumulatedMoments[variableName]; + var gradient = variableGradients[variableName]; + globals_1.tidy(function () { + var newAccumulatedMeanSquare = _this.decayScalar.mul(accumulatedMeanSquare) + .add(_this.oneMinusDecay.mul(gradient.square())); + if (_this.centered) { + var newAccumulatedMeanGrad = _this.decayScalar.mul(accumulatedMeanGrad) + .add(_this.oneMinusDecay.mul(gradient)); + var newAccumulatedMoments = _this.momentumScalar.mul(accumulatedMoments) + .add(_this.c.mul(gradient).div(newAccumulatedMeanSquare + .sub(newAccumulatedMeanGrad.square().add(_this.epsilonScalar)) + .sqrt())); + _this.accumulatedMeanSquares[variableName].assign(newAccumulatedMeanSquare); + _this.accumulatedMeanGrads[variableName].assign(newAccumulatedMeanGrad); + _this.accumulatedMoments[variableName].assign(newAccumulatedMoments); + var newValue = value.sub(newAccumulatedMoments); + value.assign(newValue); + } + else { + var newAccumulatedMeanSquare_1 = _this.decayScalar.mul(accumulatedMeanSquare) + .add(_this.oneMinusDecay.mul(gradient.square())); + var newAccumulatedMoments = _this.momentumScalar.mul(accumulatedMoments) + .add(_this.c.mul(gradient).div(newAccumulatedMeanSquare_1.add(_this.epsilonScalar).sqrt())); + _this.accumulatedMeanSquares[variableName].assign(newAccumulatedMeanSquare_1); + _this.accumulatedMoments[variableName].assign(newAccumulatedMoments); + var newValue = value.sub(newAccumulatedMoments); + value.assign(newValue); + } + }); + }; + var this_1 = this; + for (var variableName in variableGradients) { + _loop_1(variableName); + } + }; + RMSPropOptimizer.prototype.dispose = function () { + var _this = this; + this.c.dispose(); + this.epsilonScalar.dispose(); + this.decayScalar.dispose(); + this.momentumScalar.dispose(); + this.oneMinusDecay.dispose(); + if (this.accumulatedMeanSquares != null) { + Object.keys(this.accumulatedMeanSquares) + .forEach(function (name) { return _this.accumulatedMeanSquares[name].dispose(); }); + } + if (this.accumulatedMeanGrads != null && this.centered) { + Object.keys(this.accumulatedMeanGrads) + .forEach(function (name) { return _this.accumulatedMeanGrads[name].dispose(); }); + } + if (this.accumulatedMoments != null) { + Object.keys(this.accumulatedMoments) + .forEach(function (name) { return _this.accumulatedMoments[name].dispose(); }); + } + }; + RMSPropOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + decay: this.decay, + momentum: this.momentum, + epsilon: this.epsilon, + centered: this.centered + }; + }; + RMSPropOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.decay, config.momentum, config.epsilon, config.centered); + }; + RMSPropOptimizer.className = 'RMSPropOptimizer'; + return RMSPropOptimizer; +}(optimizer_1.Optimizer)); +exports.RMSPropOptimizer = RMSPropOptimizer; +serialization_1.SerializationMap.register(RMSPropOptimizer); +//# sourceMappingURL=rmsprop_optimizer.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.js.map new file mode 100644 index 0000000..7284b8c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rmsprop_optimizer.js","sourceRoot":"","sources":["../../src/optimizers/rmsprop_optimizer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,8CAAmC;AACnC,sCAAsC;AACtC,kCAA6C;AAC7C,kDAAqG;AAGrG,yCAAsC;AACtC,mDAAqD;AAGrD;IAAsC,oCAAS;IAa7C,0BACc,YAAoB,EAAY,KAAW,EAC3C,QAAc,EAAY,OAAsB,EAC1D,QAAgB;QAF0B,sBAAA,EAAA,WAAW;QAC3C,yBAAA,EAAA,cAAc;QAAY,wBAAA,EAAA,cAAsB;QAC1D,yBAAA,EAAA,gBAAgB;QAHpB,YAIE,iBAAO,SAaR;QAhBa,kBAAY,GAAZ,YAAY,CAAQ;QAAY,WAAK,GAAL,KAAK,CAAM;QAC3C,cAAQ,GAAR,QAAQ,CAAM;QAAY,aAAO,GAAP,OAAO,CAAe;QANtD,4BAAsB,GAAqB,EAAE,CAAC;QAC9C,0BAAoB,GAAqB,EAAE,CAAC;QAC5C,wBAAkB,GAAqB,EAAE,CAAC;QAQhD,KAAI,CAAC,CAAC,GAAG,cAAI,CAAC,YAAM,CAAC,YAAY,CAAC,CAAC,CAAC;QACpC,KAAI,CAAC,WAAW,GAAG,cAAI,CAAC,YAAM,CAAC,KAAK,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EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAClE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IAhJM,0BAAS,GAAG,kBAAkB,CAAC;IAiJxC,uBAAC;CAAA,AAlJD,CAAsC,qBAAS,GAkJ9C;AAlJY,4CAAgB;AAmJ7B,gCAAgB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer_test.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer_test.js new file mode 100644 index 0000000..eef2b44 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer_test.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('RMSPropOptimizer', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var learningRate = 0.1; + var moment = 0.1; + var rho = 0.95; + var optimizer = tf.train.rmsprop(learningRate, rho, moment); + var x = tf.tensor1d([1, 2]).variable(); + var f = function () { return x.square().sum(); }; + var numTensors = tf.memory().numTensors; + var cost = optimizer.minimize(f, true); + expect(tf.memory().numTensors).toBe(numTensors + 3); + test_util_1.expectArraysClose(x, [0.55279, 1.55279]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(f, false); + test_util_1.expectArraysClose(x, [0.28745, 1.222943], 1e-2); + expect(tf.memory().numTensors).toBe(numTensors); + expect(cost).toBe(null); + x.dispose(); + optimizer.dispose(); + expect(tf.memory().numTensors).toBe(1); + }); + it('gradient with centered momentum', function () { + var learningRate = 0.1; + var moment = 0.1; + var rho = 0.95; + var eps = 1e-8; + var optimizer = tf.train.rmsprop(learningRate, rho, moment, eps, true); + var x = tf.tensor1d([1, 2]).variable(); + var f = function () { return x.square().sum(); }; + var numTensors = tf.memory().numTensors; + var cost = optimizer.minimize(f, true); + expect(tf.memory().numTensors).toBe(numTensors + 4); + test_util_1.expectArraysClose(x, [0.54117, 1.541169]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(f, false); + test_util_1.expectArraysClose(x, [0.267785, 1.2035924], 1e-2); + expect(tf.memory().numTensors).toBe(numTensors); + expect(cost).toBe(null); + x.dispose(); + optimizer.dispose(); + expect(tf.memory().numTensors).toBe(1); + }); + it('serialization round-trip', function () { + var originalOpt = tf.train.rmsprop(0.1, 0.5, 0.1, 1e-7, true); + var reserialized = tf.RMSPropOptimizer.fromConfig(tf.RMSPropOptimizer, originalOpt.getConfig()); + expect(reserialized.getConfig()).toEqual(originalOpt.getConfig()); + }); +}); +//# sourceMappingURL=rmsprop_optimizer_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer_test.js.map new file mode 100644 index 0000000..0f92610 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rmsprop_optimizer_test.js","sourceRoot":"","sources":["../../src/optimizers/rmsprop_optimizer_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,kBAAkB,EAAE,oBAAQ,EAAE;IAC9C,EAAE,CAAC,OAAO,EAAE;QACV,I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AI,CAAC,CAAC;QAGlD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEhD,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAExB,CAAC,CAAC,OAAO,EAAE,CAAC;QACZ,SAAS,CAAC,OAAO,EAAE,CAAC;QAEpB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,0BAA0B,EAAE;QAC7B,IAAM,WAAW,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAChE,IAAM,YAAY,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAC/C,EAAE,CAAC,gBAAgB,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts new file mode 100644 index 0000000..169eb89 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts @@ -0,0 +1,15 @@ +import { ConfigDict, Serializable, SerializableConstructor } from '../serialization'; +import { Scalar } from '../tensor'; +import { NamedTensorMap } from '../tensor_types'; +import { Optimizer } from './optimizer'; +export declare class SGDOptimizer extends Optimizer { + protected learningRate: number; + static className: string; + protected c: Scalar; + constructor(learningRate: number); + applyGradients(variableGradients: NamedTensorMap): void; + setLearningRate(learningRate: number): void; + dispose(): void; + getConfig(): ConfigDict; + static fromConfig(cls: SerializableConstructor, config: ConfigDict): T; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.js new file mode 100644 index 0000000..6f82fd5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.js @@ -0,0 +1,59 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("../environment"); +var globals_1 = require("../globals"); +var ops_1 = require("../ops/ops"); +var serialization_1 = require("../serialization"); +var optimizer_1 = require("./optimizer"); +var SGDOptimizer = (function (_super) { + __extends(SGDOptimizer, _super); + function SGDOptimizer(learningRate) { + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.setLearningRate(learningRate); + return _this; + } + SGDOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var varNames = Object.keys(variableGradients); + varNames.forEach(function (varName) { + var gradient = variableGradients[varName]; + var value = environment_1.ENV.engine.registeredVariables[varName]; + globals_1.tidy(function () { + var newValue = _this.c.mul(gradient).add(value); + value.assign(newValue); + }); + }); + }; + SGDOptimizer.prototype.setLearningRate = function (learningRate) { + this.learningRate = learningRate; + if (this.c != null) { + this.c.dispose(); + } + this.c = globals_1.keep(ops_1.scalar(-learningRate)); + }; + SGDOptimizer.prototype.dispose = function () { + this.c.dispose(); + }; + SGDOptimizer.prototype.getConfig = function () { + return { learningRate: this.learningRate }; + }; + SGDOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate); + }; + SGDOptimizer.className = 'SGDOptimizer'; + return SGDOptimizer; +}(optimizer_1.Optimizer)); +exports.SGDOptimizer = SGDOptimizer; +serialization_1.SerializationMap.register(SGDOptimizer); +//# sourceMappingURL=sgd_optimizer.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.js.map new file mode 100644 index 0000000..7701fa4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sgd_optimizer.js","sourceRoot":"","sources":["../../src/optimizers/sgd_optimizer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,8CAAmC;AACnC,sCAAsC;AACtC,kCAAkC;AAClC,kDAAqG;AAGrG,yCAAsC;AAGtC;IAAkC,gCAAS;IAIzC,sBAAsB,YAAoB;QAA1C,YACE,iBAAO,SAER;QAHqB,kBAAY,GAAZ,YAAY,CAAQ;QAExC,KAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;;IACrC,CAAC;IAED,qCAAc,GAAd,UAAe,iBAAiC;QAAhD,iBAWC;QAVC,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAChD,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YACtB,IAAM,QAAQ,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAM,KAAK,GAAG,iBAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAEtD,cAAI,CAAC;gBACH,IAAM,QAAQ,GAAG,KAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACjD,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,sCAAe,GAAf,UAAgB,YAAoB;QAClC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE;YAClB,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAClB;QACD,IAAI,CAAC,CAAC,GAAG,cAAI,CAAC,YAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,8BAAO,GAAP;QACE,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,gCAAS,GAAT;QACE,OAAO,EAAC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAC,CAAC;IAC3C,CAAC;IACM,uBAAU,GAAjB,UACI,GAA+B,EAAE,MAAkB;QACrD,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;IA1CM,sBAAS,GAAG,cAAc,CAAC;IA2CpC,mBAAC;CAAA,AA5CD,CAAkC,qBAAS,GA4C1C;AA5CY,oCAAY;AA6CzB,gCAAgB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer_test.js b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer_test.js new file mode 100644 index 0000000..b7fcb69 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer_test.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("../index"); +var jasmine_util_1 = require("../jasmine_util"); +var test_util_1 = require("../test_util"); +jasmine_util_1.describeWithFlags('SGDOptimizer', test_util_1.ALL_ENVS, function () { + it('basic', function () { + var learningRate = .1; + var optimizer = tf.train.sgd(learningRate); + var x = tf.scalar(4).variable(); + var numTensors = tf.memory().numTensors; + var cost = optimizer.minimize(function () { return x.square(); }, true); + expect(tf.memory().numTensors).toBe(numTensors + 1); + var expectedValue1 = -2 * 4 * learningRate + 4; + test_util_1.expectArraysClose(x, [expectedValue1]); + test_util_1.expectArraysClose(cost, [Math.pow(4, 2)]); + cost.dispose(); + numTensors = tf.memory().numTensors; + cost = optimizer.minimize(function () { return x.square(); }, false); + expect(tf.memory().numTensors).toBe(numTensors); + var expectedValue2 = -2 * expectedValue1 * learningRate + expectedValue1; + test_util_1.expectArraysClose(x, [expectedValue2]); + expect(cost).toBe(null); + optimizer.dispose(); + x.dispose(); + expect(tf.memory().numTensors).toBe(1); + }); + it('serialization round-trip', function () { + var learningRate = .1; + var originalOpt = tf.train.sgd(learningRate); + var reserialized = tf.SGDOptimizer.fromConfig(tf.SGDOptimizer, originalOpt.getConfig()); + expect(reserialized.getConfig()).toEqual(originalOpt.getConfig()); + }); +}); +//# sourceMappingURL=sgd_optimizer_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer_test.js.map new file mode 100644 index 0000000..0d768c1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sgd_optimizer_test.js","sourceRoot":"","sources":["../../src/optimizers/sgd_optimizer_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyD;AAEzD,gCAAiB,CAAC,cAAc,EAAE,oBAAQ,EAAE;IAC1C,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,YAA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,IAAI,CAAC,CAAC;QAExB,SAAS,CAAC,OAAO,EAAE,CAAC;QACpB,CAAC,CAAC,OAAO,EAAE,CAAC;QAEZ,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,0BAA0B,EAAE;QAC7B,IAAM,YAAY,GAAG,EAAE,CAAC;QACxB,IAAM,WAAW,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC/C,IAAM,YAAY,GACd,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;QACzE,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/profiler.d.ts b/node_modules/@tensorflow/tfjs-core/dist/profiler.d.ts new file mode 100644 index 0000000..0634986 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/profiler.d.ts @@ -0,0 +1,12 @@ +import { BackendTimer } from './kernels/backend'; +import { Tensor } from './tensor'; +import { TypedArray } from './types'; +export declare class Profiler { + private backendTimer; + private logger?; + constructor(backendTimer: BackendTimer, logger?: Logger); + profileKernel(name: string, f: () => T | Tensor[]): T; +} +export declare class Logger { + logKernelProfile(name: string, result: Tensor, vals: TypedArray, timeMs: number): void; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/profiler.js b/node_modules/@tensorflow/tfjs-core/dist/profiler.js new file mode 100644 index 0000000..88e6322 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/profiler.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util = require("./util"); +var Profiler = (function () { + function Profiler(backendTimer, logger) { + this.backendTimer = backendTimer; + this.logger = logger; + if (logger == null) { + this.logger = new Logger(); + } + } + Profiler.prototype.profileKernel = function (name, f) { + var _this = this; + var result; + var holdResultWrapperFn = function () { + result = f(); + }; + var timer = this.backendTimer.time(holdResultWrapperFn); + var results = Array.isArray(result) ? result : [result]; + results.forEach(function (r) { + var vals = r.dataSync(); + util.checkComputationForNaN(vals, r.dtype, name); + timer.then(function (timing) { + _this.logger.logKernelProfile(name, r, vals, timing.kernelMs); + }); + }); + return result; + }; + return Profiler; +}()); +exports.Profiler = Profiler; +var Logger = (function () { + function Logger() { + } + Logger.prototype.logKernelProfile = function (name, result, vals, timeMs) { + var time = util.rightPad(timeMs + "ms", 9); + var paddedName = util.rightPad(name, 25); + var rank = result.rank; + var size = result.size; + var shape = util.rightPad(result.shape.toString(), 14); + console.log("%c" + paddedName + "\t%c" + time + "\t%c" + rank + "D " + shape + "\t%c" + size, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange'); + }; + return Logger; +}()); +exports.Logger = Logger; +//# sourceMappingURL=profiler.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/profiler.js.map b/node_modules/@tensorflow/tfjs-core/dist/profiler.js.map new file mode 100644 index 0000000..cc23cd2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/profiler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"profiler.js","sourceRoot":"","sources":["../src/profiler.ts"],"names":[],"mappings":";;AAoBA,6BAA+B;AAE/B;IACE,kBAAoB,YAA0B,EAAU,MAAe;QAAnD,iBAAY,GAAZ,YAAY,CAAc;QAAU,WAAM,GAAN,MAAM,CAAS;QACrE,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;SAC5B;IACH,CAAC;IAED,gCAAa,GAAb,UAAyC,IAAY,EAAE,CAAqB;QAA5E,iBAoBC;QA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E,EAAE,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CACP,OAAK,UAAU,YAAO,IAAI,YAAO,IAAI,UAAK,KAAK,YAAO,IAAM,EAC5D,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC;IACtE,CAAC;IACH,aAAC;AAAD,CAAC,AAZD,IAYC;AAZY,wBAAM"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/profiler_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/profiler_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/profiler_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/profiler_test.js b/node_modules/@tensorflow/tfjs-core/dist/profiler_test.js new file mode 100644 index 0000000..0e776c0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/profiler_test.js @@ -0,0 +1,147 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var profiler_1 = require("./profiler"); +var TestBackendTimer = (function () { + function TestBackendTimer(delayMs, queryTimeMs) { + this.delayMs = delayMs; + this.queryTimeMs = queryTimeMs; + this.counter = 1; + } + TestBackendTimer.prototype.time = function (query) { + return __awaiter(this, void 0, void 0, function () { + var kernelMs; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + query(); + return [4, new Promise(function (resolve) { return setTimeout(resolve(_this.queryTimeMs * _this.counter++), _this.delayMs); })]; + case 1: + kernelMs = _a.sent(); + return [2, { kernelMs: kernelMs }]; + } + }); + }); + }; + return TestBackendTimer; +}()); +var TestLogger = (function (_super) { + __extends(TestLogger, _super); + function TestLogger() { + return _super !== null && _super.apply(this, arguments) || this; + } + TestLogger.prototype.logKernelProfile = function (name, result, vals, timeMs) { }; + return TestLogger; +}(profiler_1.Logger)); +describe('profiler.Profiler', function () { + it('profiles simple function', function (doneFn) { + var delayMs = 5; + var queryTimeMs = 10; + var timer = new TestBackendTimer(delayMs, queryTimeMs); + var logger = new TestLogger(); + var profiler = new profiler_1.Profiler(timer, logger); + spyOn(timer, 'time').and.callThrough(); + spyOn(logger, 'logKernelProfile').and.callThrough(); + var timeSpy = timer.time; + var logKernelProfileSpy = logger.logKernelProfile; + var kernelCalled = false; + var result = 1; + var resultScalar = tf.scalar(result); + profiler.profileKernel('MatMul', function () { + kernelCalled = true; + return resultScalar; + }); + setTimeout(function () { + expect(timeSpy.calls.count()).toBe(1); + expect(logKernelProfileSpy.calls.count()).toBe(1); + expect(logKernelProfileSpy.calls.first().args).toEqual([ + 'MatMul', resultScalar, new Float32Array([result]), queryTimeMs + ]); + expect(kernelCalled).toBe(true); + doneFn(); + }, delayMs * 2); + }); + it('profiles nested kernel', function (doneFn) { + var delayMs = 5; + var queryTimeMs = 10; + var timer = new TestBackendTimer(delayMs, queryTimeMs); + var logger = new TestLogger(); + var profiler = new profiler_1.Profiler(timer, logger); + spyOn(timer, 'time').and.callThrough(); + spyOn(logger, 'logKernelProfile').and.callThrough(); + var timeSpy = timer.time; + var logKernelProfileSpy = logger.logKernelProfile; + var matmulKernelCalled = false; + var maxKernelCalled = false; + var result = 1; + var resultScalar = tf.scalar(result); + profiler.profileKernel('MatMul', function () { + var result = profiler.profileKernel('Max', function () { + maxKernelCalled = true; + return resultScalar; + }); + matmulKernelCalled = true; + return result; + }); + setTimeout(function () { + expect(timeSpy.calls.count()).toBe(2); + expect(logKernelProfileSpy.calls.count()).toBe(2); + expect(logKernelProfileSpy.calls.first().args).toEqual([ + 'Max', resultScalar, new Float32Array([result]), queryTimeMs + ]); + expect(logKernelProfileSpy.calls.argsFor(1)).toEqual([ + 'MatMul', resultScalar, new Float32Array([result]), queryTimeMs * 2 + ]); + expect(matmulKernelCalled).toBe(true); + expect(maxKernelCalled).toBe(true); + doneFn(); + }, delayMs * 2); + }); +}); +//# sourceMappingURL=profiler_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/profiler_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/profiler_test.js.map new file mode 100644 index 0000000..66c0153 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/profiler_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"profiler_test.js","sourceRoot":"","sources":["../src/profiler_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,4BAA8B;AAG9B,uCAA4C;AAG5C;IAEE,0BAAoB,OAAe,EAAU,WAAmB;QAA5C,YAAO,GAAP,OAAO,CAAQ;QAAU,gBAAW,GAAX,WAAW,CAAQ;QADxD,YAAO,GAAG,CAAC,CAAC;IAC+C,CAAC;IAE9D,+BAAI,GAAV,UAAW,KAAiB;;;;;;;wBAC1B,KAAK,EAAE,CAAC;wBACS,WAAM,IAAI,OAAO,CAC9B,UAAA,OAAO,IAAI,OAAA,UAAU,CACjB,OAAO,CAAC,KAAI,CAAC,WAAW,GAAG,KAAI,CAAC,OAAO,EAAE,CAAC,EAAE,KAAI,CAAC,OAAO,CAAC,EADlD,CACkD,CAAC,EAAA;;wBAF5D,QAAQ,GAAG,SAEiD;wBAClE,WAAO,EAAC,QAAQ,UAAA,EAAC,EAAC;;;;KACnB;IACH,uBAAC;AAAD,CAAC,AAXD,IAWC;AAED;IAAyB,8BAAM;IAA/B;;IAGA,CAAC;IAFC,qCAAgB,GAAhB,UACI,IAAY,EAAE,MAAc,EAAE,IAAgB,EAAE,MAAc,IAAG,CAAC;IACxE,iBAAC;AAAD,CAAC,AAHD,CAAyB,iBAAM,GAG9B;AAED,QAAQ,CAAC,mBAAmB,EAAE;IAC5B,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AAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAEtC,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;gBACrD,KAAK,EAAE,YAAY,EAAE,IAAI,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW;aAC7D,CAAC,CAAC;YACH,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;gBACnD,QAAQ,EAAE,YAAY,EAAE,IAAI,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC;aACpE,CAAC,CAAC;YAEH,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnC,MAAM,EAAE,CAAC;QACX,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts b/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts new file mode 100644 index 0000000..27c6d8a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts @@ -0,0 +1,26 @@ +export declare type ConfigDictValue = boolean | number | string | null | ConfigDictArray | ConfigDict; +export interface ConfigDict { + [key: string]: ConfigDictValue; +} +export interface ConfigDictArray extends Array { +} +export declare type SerializableConstructor = { + new (...args: any[]): T; + className: string; + fromConfig: FromConfigMethod; +}; +export declare type FromConfigMethod = (cls: SerializableConstructor, config: ConfigDict) => T; +export declare abstract class Serializable { + getClassName(): string; + abstract getConfig(): ConfigDict; + static fromConfig(cls: SerializableConstructor, config: ConfigDict): T; +} +export declare class SerializationMap { + private static instance; + classNameMap: { + [className: string]: [SerializableConstructor, FromConfigMethod]; + }; + private constructor(); + static getMap(): SerializationMap; + static register(cls: SerializableConstructor): void; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/serialization.js b/node_modules/@tensorflow/tfjs-core/dist/serialization.js new file mode 100644 index 0000000..956b836 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/serialization.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Serializable = (function () { + function Serializable() { + } + Serializable.prototype.getClassName = function () { + return this.constructor + .className; + }; + Serializable.fromConfig = function (cls, config) { + return new cls(config); + }; + return Serializable; +}()); +exports.Serializable = Serializable; +var SerializationMap = (function () { + function SerializationMap() { + this.classNameMap = {}; + } + SerializationMap.getMap = function () { + if (SerializationMap.instance == null) { + SerializationMap.instance = new SerializationMap(); + } + return SerializationMap.instance; + }; + SerializationMap.register = function (cls) { + SerializationMap.getMap().classNameMap[cls.className] = + [cls, cls.fromConfig]; + }; + return SerializationMap; +}()); +exports.SerializationMap = SerializationMap; +//# sourceMappingURL=serialization.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/serialization.js.map b/node_modules/@tensorflow/tfjs-core/dist/serialization.js.map new file mode 100644 index 0000000..3ea6247 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/serialization.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../src/serialization.ts"],"names":[],"mappings":";;AA4DA;IAAA;IAkCA,CAAC;IAtBC,mCAAY,GAAZ;QACE,OAAQ,IAAI,CAAC,WAAqD;aAC7D,SAAS,CAAC;IACjB,CAAC;IAeM,uBAAU,GAAjB,UACI,GAA+B,EAAE,MAAkB;QACrD,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IACH,mBAAC;AAAD,CAAC,AAlCD,IAkCC;AAlCqB,oCAAY;AA2ClC;IASE;QACE,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IACzB,CAAC;IAKM,uBAAM,GAAb;QACE,IAAI,gBAAgB,CAAC,QAAQ,IAAI,IAAI,EAAE;YACrC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAC;SACpD;QACD,OAAO,gBAAgB,CAAC,QAAQ,CAAC;IACnC,CAAC;IAKM,yBAAQ,GAAf,UAAwC,GAA+B;QACrE,gBAAgB,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC;YACjD,CAAC,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IACH,uBAAC;AAAD,CAAC,AA9BD,IA8BC;AA9BY,4CAAgB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts new file mode 100644 index 0000000..65b11c1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts @@ -0,0 +1,16 @@ +import { Tensor } from './tensor'; +import { NamedTensorMap } from './tensor_types'; +export interface TapeNode { + id: number; + name: string; + output: Tensor; + inputs: NamedTensorMap; + gradient?: (dy: Tensor | NamedTensorMap) => NamedGradientMap; +} +export declare type NamedGradientMap = { + [inputName: string]: () => Tensor; +}; +export declare function getFilteredNodesXToY(tape: TapeNode[], xs: Tensor[], y: Tensor): TapeNode[]; +export declare function backpropagateGradients(tensorAccumulatedGradientMap: { + [tensorId: number]: Tensor; +}, filteredTape: TapeNode[]): void; diff --git a/node_modules/@tensorflow/tfjs-core/dist/tape.js b/node_modules/@tensorflow/tfjs-core/dist/tape.js new file mode 100644 index 0000000..04619fb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tape.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util = require("./util"); +function getFilteredNodesXToY(tape, xs, y) { + var tensorsFromX = {}; + var nodesFromX = {}; + for (var i = 0; i < xs.length; i++) { + tensorsFromX[xs[i].id] = true; + } + for (var i = 0; i < tape.length; i++) { + var node = tape[i]; + var nodeInputs = node.inputs; + for (var inputName in nodeInputs) { + var input = nodeInputs[inputName]; + var anyInputFromX = false; + for (var j = 0; j < xs.length; j++) { + if (tensorsFromX[input.id]) { + tensorsFromX[node.output.id] = true; + anyInputFromX = true; + nodesFromX[node.id] = true; + break; + } + } + if (anyInputFromX) { + break; + } + } + } + var tensorsLeadToY = {}; + tensorsLeadToY[y.id] = true; + var nodesToY = {}; + for (var i = tape.length - 1; i >= 0; i--) { + var node = tape[i]; + var nodeInputs = node.inputs; + var outputs = []; + outputs.push(node.output); + for (var j = 0; j < outputs.length; j++) { + if (tensorsLeadToY[outputs[j].id]) { + for (var inputName in nodeInputs) { + tensorsLeadToY[nodeInputs[inputName].id] = true; + nodesToY[node.id] = true; + } + break; + } + } + } + var filteredTape = []; + for (var i = 0; i < tape.length; i++) { + var node = tape[i]; + if (nodesFromX[node.id] && nodesToY[node.id]) { + var prunedInputs = {}; + for (var inputName in node.inputs) { + var nodeInput = node.inputs[inputName]; + if (tensorsFromX[nodeInput.id]) { + prunedInputs[inputName] = nodeInput; + } + } + var prunedNode = Object.assign({}, node); + prunedNode.inputs = prunedInputs; + prunedNode.output = node.output; + filteredTape.push(prunedNode); + } + } + return filteredTape; +} +exports.getFilteredNodesXToY = getFilteredNodesXToY; +function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape) { + for (var i = filteredTape.length - 1; i >= 0; i--) { + var node = filteredTape[i]; + var dy = tensorAccumulatedGradientMap[node.output.id]; + if (node.gradient == null) { + throw new Error("Cannot compute gradient: gradient function not found " + + ("for " + node.name + ".")); + } + var inputGradients = node.gradient(dy); + for (var inputName in node.inputs) { + if (!(inputName in inputGradients)) { + throw new Error("Cannot backprop through input " + inputName + ". " + + ("Available gradients found: " + Object.keys(inputGradients) + ".")); + } + var dx = inputGradients[inputName](); + var x = node.inputs[inputName]; + if (!util.arraysEqual(dx.shape, x.shape)) { + throw new Error("Error in gradient for op " + node.name + ". The gradient of input " + + ("'" + inputName + "' has shape '" + dx.shape + "', which does not match ") + + ("the shape of the input '" + x.shape + "'")); + } + if (tensorAccumulatedGradientMap[x.id] == null) { + tensorAccumulatedGradientMap[x.id] = dx; + } + else { + var curGradient = tensorAccumulatedGradientMap[x.id]; + tensorAccumulatedGradientMap[x.id] = curGradient.add(dx); + curGradient.dispose(); + } + } + } +} +exports.backpropagateGradients = backpropagateGradients; +//# sourceMappingURL=tape.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tape.js.map b/node_modules/@tensorflow/tfjs-core/dist/tape.js.map new file mode 100644 index 0000000..41b8978 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tape.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tape.js","sourceRoot":"","sources":["../src/tape.ts"],"names":[],"mappings":";;AAmBA,6BAA+B;AAsB/B,8BACI,IAAgB,EAAE,EAAY,EAAE,CAAS;IAG3C,IAAM,YAAY,GAAkC,EAAE,CAAC;IACvD,IAAM,UAAU,GAAgC,EAAE,CAAC;IACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAClC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;KAC/B;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,IAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,IAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;QAC/B,KAAK,IAAM,SAAS,IAAI,UAA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AACH,CAAC;AA3CD,wDA2CC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tape_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tape_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tape_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/tape_test.js b/node_modules/@tensorflow/tfjs-core/dist/tape_test.js new file mode 100644 index 0000000..ea89200 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tape_test.js @@ -0,0 +1,235 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var jasmine_util_1 = require("./jasmine_util"); +var tape_util = require("./tape"); +var test_util_1 = require("./test_util"); +jasmine_util_1.describeWithFlags('getFilteredNodesXToY', test_util_1.ALL_ENVS, function () { + it('getFilteredNodesXToY no paths from x to y', function () { + var x = tf.scalar(1); + var intermediate1 = tf.scalar(0); + var intermediate2 = tf.scalar(0); + var y = tf.scalar(2); + var tape = [ + { + id: 0, + name: 'node0', + inputs: { x: x }, + output: intermediate1, + gradient: null + }, + { + id: 1, + name: 'node1', + inputs: { intermediate2: intermediate2 }, + output: y, + gradient: null + } + ]; + var filteredTapeNodes = tape_util.getFilteredNodesXToY(tape, [x], y); + expect(filteredTapeNodes.length).toBe(0); + expect(filteredTapeNodes).toEqual([]); + }); + it('getFilteredNodesXToY one operation x => y', function () { + var x = tf.scalar(1); + var y = tf.scalar(2); + var tape = [{ id: 0, name: 'node0', inputs: { x: x }, output: y, gradient: null }]; + var filteredTapeNodes = tape_util.getFilteredNodesXToY(tape, [x], y); + expect(filteredTapeNodes.length).toBe(1); + expect(filteredTapeNodes).toEqual(tape); + }); + it('getFilteredNodesXToY 1 operation [x0, x1] => y, all input paths', function () { + var x0 = tf.scalar(0); + var x1 = tf.scalar(1); + var y = tf.scalar(2); + var tape = [{ id: 0, name: 'node0', inputs: { x0: x0, x1: x1 }, output: y, gradient: null }]; + var filteredTapeNodes = tape_util.getFilteredNodesXToY(tape, [x0, x1], y); + expect(filteredTapeNodes.length).toBe(1); + expect(filteredTapeNodes).toEqual(tape); + }); + it('getFilteredNodesXToY one operation [x0, x1] => y, one input paths', function () { + var x0 = tf.scalar(0); + var x1 = tf.scalar(1); + var y = tf.scalar(2); + var tape = [ + { id: 0, name: 'node0', inputs: { x0: x0, x1: x1 }, output: y, gradient: null } + ]; + var filteredTapeNodes = tape_util.getFilteredNodesXToY(tape, [x0], y); + expect(filteredTapeNodes.length).toBe(1); + expect(filteredTapeNodes[0]) + .toEqual({ id: 0, name: 'node0', inputs: { x0: x0 }, output: y, gradient: null }); + }); + it('getFilteredNodesXToY two operations x => intermediate => y', function () { + var x = tf.scalar(1); + var intermediate = tf.scalar(0); + var y = tf.scalar(2); + var tape = [ + { id: 0, name: 'node0', inputs: { x: x }, output: intermediate, gradient: null }, + { + id: 1, + name: 'node1', + inputs: { intermediate: intermediate }, + output: y, + gradient: null + } + ]; + var filteredTapeNodes = tape_util.getFilteredNodesXToY(tape, [x], y); + expect(filteredTapeNodes.length).toBe(2); + expect(filteredTapeNodes).toEqual(tape); + }); + it('getFilteredNodesXToY two operations [x0, x1], [x2] => ' + + 'intermediate => y', function () { + var x0 = tf.scalar(1); + var x1 = tf.scalar(2); + var x2 = tf.scalar(3); + var intermediate = tf.scalar(4); + var y = tf.scalar(2); + var tape = [ + { + id: 0, + name: 'node0', + inputs: { x0: x0, x1: x1 }, + output: intermediate, + gradient: null + }, + { + id: 1, + name: 'node1', + inputs: { x2: x2, intermediate: intermediate }, + output: y, + gradient: null + } + ]; + var filteredTapeNodes = tape_util.getFilteredNodesXToY(tape, [x0, x1, x2], y); + expect(filteredTapeNodes.length).toBe(2); + expect(filteredTapeNodes).toEqual(tape); + }); + it('getFilteredNodesXToY x => y and x => orphan', function () { + var x = tf.scalar(1); + var orphan = tf.scalar(0); + var y = tf.scalar(2); + var tape = [ + { id: 0, name: 'node0', inputs: { x: x }, output: orphan, gradient: null }, + { id: 1, name: 'node1', inputs: { x: x }, output: y, gradient: null } + ]; + var filteredTapeNodes = tape_util.getFilteredNodesXToY(tape, [x], y); + expect(filteredTapeNodes.length).toBe(1); + expect(filteredTapeNodes[0]).toEqual(tape[1]); + }); + it('getFilteredNodesXToY x => y and orphan => y', function () { + var x = tf.scalar(1); + var orphan = tf.scalar(0); + var y = tf.scalar(2); + var tape = [ + { id: 0, name: 'node0', inputs: { x: x, orphan: orphan }, output: y, gradient: null } + ]; + var filteredTapeNodes = tape_util.getFilteredNodesXToY(tape, [x], y); + expect(filteredTapeNodes.length).toBe(1); + expect(filteredTapeNodes[0]) + .toEqual({ id: 0, name: 'node0', inputs: { x: x }, output: y, gradient: null }); + }); +}); +jasmine_util_1.describeWithFlags('backpropagateGradients', test_util_1.ALL_ENVS, function () { + it('Throws if gradient is not defined', function () { + var x = tf.scalar(0); + var y = tf.scalar(1); + var dy = tf.scalar(1); + var accumulatedGradientsMap = {}; + accumulatedGradientsMap[y.id] = dy; + var tape = [{ id: 0, name: 'node0', inputs: { x: x }, output: y, gradient: null }]; + expect(function () { return tape_util.backpropagateGradients(accumulatedGradientsMap, tape); }) + .toThrowError(); + }); + it('basic backprop with 1 node', function () { + var x = tf.scalar(0); + var y = tf.scalar(1); + var dy = tf.scalar(1); + var accumulatedGradientsMap = {}; + accumulatedGradientsMap[y.id] = dy; + var tape = [{ + id: 0, + name: 'node0', + inputs: { x: x }, + output: y, + gradient: function (dy) { + return { x: function () { return dy.add(tf.scalar(1)); } }; + } + }]; + tape_util.backpropagateGradients(accumulatedGradientsMap, tape); + test_util_1.expectArraysClose(accumulatedGradientsMap[x.id], [2]); + }); + it('basic backprop with 2 nodes', function () { + var x = tf.scalar(0); + var intermediate = tf.scalar(1); + var y = tf.scalar(2); + var dy = tf.scalar(1); + var accumulatedGradientsMap = {}; + accumulatedGradientsMap[y.id] = dy; + var tape = [ + { + id: 0, + name: 'node0', + inputs: { x: x }, + output: intermediate, + gradient: function (dy) { + return { x: function () { return dy.add(tf.scalar(1)); } }; + } + }, + { + id: 1, + name: 'node1', + inputs: { intermediate: intermediate }, + output: y, + gradient: function (dy) { + return { intermediate: function () { return dy.add(tf.scalar(1)); } }; + } + } + ]; + tape_util.backpropagateGradients(accumulatedGradientsMap, tape); + test_util_1.expectArraysClose(accumulatedGradientsMap[x.id], [3]); + }); + it('basic backprop with a split node accumulates gradients', function () { + var x = tf.scalar(0); + var intermediate1 = tf.scalar(1); + var intermediate2 = tf.scalar(2); + var y = tf.scalar(3); + var dy = tf.scalar(1); + var accumulatedGradientsMap = {}; + accumulatedGradientsMap[y.id] = dy; + var tape = [ + { + id: 0, + name: 'node0', + inputs: { x: x }, + output: intermediate1, + gradient: function (dy) { + return { x: function () { return dy.add(tf.scalar(1)); } }; + } + }, + { + id: 1, + name: 'node1', + inputs: { x: x }, + output: intermediate2, + gradient: function (dy) { + return { x: function () { return dy.add(tf.scalar(1)); } }; + } + }, + { + id: 2, + name: 'node2', + inputs: { intermediate1: intermediate1, intermediate2: intermediate2 }, + output: y, + gradient: function (dy) { + return { + intermediate1: function () { return dy.add(tf.scalar(1)); }, + intermediate2: function () { return dy.add(tf.scalar(1)); } + }; + } + } + ]; + tape_util.backpropagateGradients(accumulatedGradientsMap, tape); + test_util_1.expectArraysClose(accumulatedGradientsMap[x.id], [dy.dataSync()[0] + 5]); + }); +}); +//# sourceMappingURL=tape_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tape_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/tape_test.js.map new file mode 100644 index 0000000..119553d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tape_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tape_test.js","sourceRoot":"","sources":["../src/tape_test.ts"],"names":[],"mappings":";;AAiBA,4BAA8B;AAC9B,+CAAiD;AACjD,kCAAoC;AAEpC,yCAAwD;AAExD,gCAAiB,CA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C,CAAC,CAAC,CAAC,EAApB,CAAoB;wBACzC,aAAa,EAAE,cAAM,OAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAApB,CAAoB;qBAC1C,CAAC;gBACJ,CAAC;aACF;SACF,CAAC;QAEF,SAAS,CAAC,sBAAsB,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;QAGhE,6BAAiB,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts new file mode 100644 index 0000000..3f10d89 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts @@ -0,0 +1,316 @@ +import { DataType, Rank, ShapeMap, TypedArray } from './types'; +export interface TensorData { + dataId?: DataId; + values?: TypedArray; +} +export declare class TensorBuffer { + dtype: DataType; + size: number; + shape: ShapeMap[R]; + strides: number[]; + values: TypedArray; + constructor(shape: ShapeMap[R], dtype: DataType, values: TypedArray); + set(value: number, ...locs: number[]): void; + get(...locs: number[]): number; + locToIndex(locs: number[]): number; + indexToLoc(index: number): number[]; + readonly rank: number; + toTensor(): Tensor; +} +export interface TensorTracker { + registerTensor(t: Tensor): void; + disposeTensor(t: Tensor): void; + write(dataId: DataId, values: TypedArray): void; + read(dataId: DataId): Promise; + readSync(dataId: DataId): TypedArray; + registerVariable(v: Variable): void; +} +export interface OpHandler { + cast(x: T, dtype: DataType): T; + buffer(shape: ShapeMap[R], dtype: DataType, values?: TypedArray): TensorBuffer; + print(x: T, verbose: boolean): void; + reshape(x: Tensor, shape: ShapeMap[R2]): Tensor; + expandDims(x: Tensor, axis: number): Tensor; + cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean): T; + squeeze(x: Tensor, axis?: number[]): T; + clone(x: T): T; + tile(x: T, reps: number[]): T; + gather(x: T, indices: Tensor1D, axis: number): T; + matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean): Tensor2D; + dot(t1: Tensor, t2: Tensor): Tensor; + norm(x: Tensor, ord: number | 'euclidean' | 'fro', axis: number | number[], keepDims: boolean): Tensor; + slice>(x: T, begin: number | number[], size?: number | number[]): T; + reverse(x: T, axis?: number | number[]): T; + concat(tensors: T[], axis: number): T; + stack(tensors: T[], axis: number): Tensor; + unstack(value: T, axis: number): Tensor[]; + pad(x: T, paddings: Array<[number, number]>, constantValue: number): T; + batchNormalization(x: Tensor, mean: Tensor | Tensor1D, variance: Tensor | Tensor1D, varianceEpsilon: number, scale?: Tensor | Tensor1D, offset?: Tensor | Tensor1D): Tensor; + all(x: Tensor, axis: number | number[], keepDims: boolean): T; + any(x: Tensor, axis: number | number[], keepDims: boolean): T; + logSumExp(x: Tensor, axis: number | number[], keepDims: boolean): T; + sum(x: Tensor, axis: number | number[], keepDims: boolean): T; + mean(x: Tensor, axis: number | number[], keepDims: boolean): T; + min(x: Tensor, axis: number | number[], keepDims: boolean): T; + max(x: Tensor, axis: number | number[], keepDims: boolean): T; + argMin(x: Tensor, axis: number): T; + argMax(x: Tensor, axis: number): T; + add(a: Tensor, b: Tensor): T; + addStrict(a: T, b: T): T; + sub(a: Tensor, b: Tensor): T; + subStrict(a: T, b: T): T; + pow(base: T, exp: Tensor): T; + powStrict(base: T, exp: Tensor): T; + mul(a: Tensor, b: Tensor): T; + mulStrict(a: T, b: T): T; + div(a: Tensor, b: Tensor): T; + floorDiv(a: Tensor, b: Tensor): T; + divStrict(a: T, b: T): T; + mod(a: Tensor, b: Tensor): T; + modStrict(a: T, b: T): T; + minimum(a: Tensor, b: Tensor): T; + minimumStrict(a: T, b: T): T; + maximum(a: Tensor, b: Tensor): T; + maximumStrict(a: T, b: T): T; + squaredDifference(a: Tensor, b: Tensor): T; + squaredDifferenceStrict(a: T, b: T): T; + transpose(x: T, perm?: number[]): T; + logicalNot(x: T): T; + logicalAnd(a: Tensor, b: Tensor): T; + logicalOr(a: Tensor, b: Tensor): T; + logicalXor(a: Tensor, b: Tensor): T; + where(condition: Tensor, a: T, b: T): T; + notEqual(a: Tensor, b: Tensor): T; + notEqualStrict(a: T, b: T): T; + less(a: Tensor, b: Tensor): T; + lessStrict(a: T, b: T): T; + equal(a: Tensor, b: Tensor): T; + equalStrict(a: T, b: T): T; + lessEqual(a: Tensor, b: Tensor): T; + lessEqualStrict(a: T, b: T): T; + greater(a: Tensor, b: Tensor): T; + greaterStrict(a: T, b: T): T; + greaterEqual(a: Tensor, b: Tensor): T; + greaterEqualStrict(a: T, b: T): T; + neg(x: T): T; + ceil(x: T): T; + floor(x: T): T; + sign(x: T): T; + round(x: T): T; + exp(x: T): T; + expm1(x: T): T; + log(x: T): T; + log1p(x: T): T; + sqrt(x: T): T; + rsqrt(x: T): T; + square(x: T): T; + reciprocal(x: T): T; + abs(x: T): T; + clipByValue(x: T, clipValueMin: number, clipValueMax: number): T; + sigmoid(x: T): T; + logSigmoid(x: T): T; + softplus(x: T): T; + sin(x: T): T; + cos(x: T): T; + tan(x: T): T; + asin(x: T): T; + acos(x: T): T; + atan(x: T): T; + sinh(x: T): T; + cosh(x: T): T; + tanh(x: T): T; + asinh(x: T): T; + acosh(x: T): T; + atanh(x: T): T; + erf(x: T): T; + step(x: T, alpha: number): T; + relu(x: T): T; + elu(x: T): T; + selu(x: T): T; + leakyRelu(x: T, alpha: number): T; + prelu(x: T, alpha: T): T; + softmax(logits: T, dim: number): T; + image: { + resizeBilinear(images: T, size: [number, number], alignCorners: boolean): T; + resizeNearestNeighbor(images: T, size: [number, number], alignCorners: boolean): T; + }; + conv1d(x: T, filter: Tensor3D, stride: number, pad: 'valid' | 'same' | number, dataFormat: 'NWC' | 'NCW', dilation: number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + conv2d(x: T, filter: Tensor4D, strides: [number, number] | number, pad: 'valid' | 'same' | number, dataFormat: 'NHWC' | 'NCHW', dilations: [number, number] | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + conv2dTranspose(x: T, filter: Tensor4D, outputShape: [number, number, number, number] | [number, number, number], strides: [number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + depthwiseConv2d(x: T, filter: Tensor4D, strides: [number, number] | number, pad: 'valid' | 'same' | number, dataFormat: 'NHWC' | 'NCHW', dilations: [number, number] | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + maxPool(x: T, filterSize: [number, number] | number, strides: [number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + avgPool(x: T, filterSize: [number, number] | number, strides: [number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + localResponseNormalization(x: T, depthRadius: number, bias: number, alpha: number, beta: number): T; + unsortedSegmentSum(x: T, segmentIds: Tensor1D, numSegments: number): T; + batchToSpaceND(x: T, blockShape: number[], crops: number[][]): T; + spaceToBatchND(x: T, blockShape: number[], paddings: number[][]): T; +} +export declare function setTensorTracker(fn: () => TensorTracker): void; +export declare function setOpHandler(handler: OpHandler): void; +export declare type DataId = object; +export declare class Tensor { + private static nextId; + readonly id: number; + dataId: DataId; + readonly shape: ShapeMap[R]; + readonly size: number; + readonly dtype: DataType; + readonly rankType: R; + readonly strides: number[]; + protected constructor(shape: ShapeMap[R], dtype: DataType, values?: TypedArray, dataId?: DataId); + static make, D extends DataType = 'float32', R extends Rank = Rank>(shape: ShapeMap[R], data: TensorData, dtype?: D): T; + flatten(): Tensor1D; + asScalar(): Scalar; + as1D(): Tensor1D; + as2D(rows: number, columns: number): Tensor2D; + as3D(rows: number, columns: number, depth: number): Tensor3D; + as4D(rows: number, columns: number, depth: number, depth2: number): Tensor4D; + asType(this: T, dtype: DataType): T; + readonly rank: number; + get(...locs: number[]): number; + buffer(): TensorBuffer; + data(): Promise; + dataSync(): TypedArray; + dispose(): void; + private isDisposedInternal; + readonly isDisposed: boolean; + private throwIfDisposed; + toFloat(this: T): T; + toInt(): this; + toBool(): this; + print(verbose?: boolean): void; + reshape(newShape: ShapeMap[R2]): Tensor; + reshapeAs(x: T): T; + expandDims(axis?: number): Tensor; + cumsum(axis?: number, exclusive?: boolean, reverse?: boolean): T; + squeeze(axis?: number[]): T; + clone(this: T): T; + toString(verbose?: boolean): string; + tile(this: T, reps: number[]): T; + gather(this: T, indices: Tensor1D, axis?: number): T; + matMul(b: Tensor2D, transposeA?: boolean, transposeB?: boolean): Tensor2D; + dot(b: Tensor): Tensor; + norm(ord?: number | 'euclidean' | 'fro', axis?: number | number[], keepDims?: boolean): Tensor; + slice>(this: T, begin: number | number[], size?: number | number[]): T; + reverse(this: T, axis?: number | number[]): T; + concat(this: T, x: T, axis?: number): T; + stack(x: Tensor, axis?: number): Tensor; + unstack(x: Tensor, axis?: number): Tensor[]; + pad(this: T, paddings: Array<[number, number]>, constantValue?: number): T; + batchNormalization(mean: Tensor | Tensor1D, variance: Tensor | Tensor1D, varianceEpsilon?: number, scale?: Tensor | Tensor1D, offset?: Tensor | Tensor1D): Tensor; + all(axis?: number | number[], keepDims?: boolean): T; + any(axis?: number | number[], keepDims?: boolean): T; + logSumExp(axis?: number | number[], keepDims?: boolean): T; + sum(axis?: number | number[], keepDims?: boolean): T; + mean(axis?: number | number[], keepDims?: boolean): T; + min(axis?: number | number[], keepDims?: boolean): T; + max(axis?: number | number[], keepDims?: boolean): T; + argMin(axis?: number): T; + argMax(axis?: number): T; + cast(dtype: DataType): T; + add(x: Tensor): T; + addStrict(this: T, x: T): T; + sub(x: Tensor): T; + subStrict(this: T, x: T): T; + pow(this: T, exp: Tensor): T; + powStrict(exp: Tensor): Tensor; + mul(x: Tensor): T; + mulStrict(this: T, x: T): T; + div(x: Tensor): T; + floorDiv(x: Tensor): T; + divStrict(this: T, x: T): T; + minimum(x: Tensor): T; + minimumStrict(this: T, x: T): T; + maximum(x: Tensor): T; + maximumStrict(this: T, x: T): T; + mod(x: Tensor): T; + modStrict(this: T, x: T): T; + squaredDifference(x: Tensor): T; + squaredDifferenceStrict(this: T, x: T): T; + transpose(this: T, perm?: number[]): T; + notEqual(x: Tensor): T; + notEqualStrict(this: T, x: T): T; + less(x: Tensor): T; + lessStrict(this: T, x: T): T; + equal(x: Tensor): T; + equalStrict(this: T, x: T): T; + lessEqual(x: Tensor): T; + lessEqualStrict(this: T, x: T): T; + greater(x: Tensor): T; + greaterStrict(this: T, x: T): T; + greaterEqual(x: Tensor): T; + greaterEqualStrict(this: T, x: T): T; + logicalAnd(x: Tensor): Tensor; + logicalOr(x: Tensor): Tensor; + logicalNot(this: T): T; + logicalXor(x: Tensor): Tensor; + where(condition: Tensor, x: Tensor): Tensor; + neg(this: T): T; + ceil(this: T): T; + floor(this: T): T; + sign(this: T): T; + exp(this: T): T; + expm1(this: T): T; + log(this: T): T; + log1p(this: T): T; + sqrt(this: T): T; + rsqrt(this: T): T; + square(this: T): T; + reciprocal(this: T): T; + abs(this: T): T; + clipByValue(min: number, max: number): Tensor; + relu(this: T): T; + elu(this: T): T; + selu(this: T): T; + leakyRelu(alpha?: number): Tensor; + prelu(alpha: Tensor): Tensor; + sigmoid(this: T): T; + logSigmoid(this: T): T; + softplus(this: T): T; + sin(this: T): T; + cos(this: T): T; + tan(this: T): T; + asin(this: T): T; + acos(this: T): T; + atan(this: T): T; + sinh(this: T): T; + cosh(this: T): T; + tanh(this: T): T; + asinh(this: T): T; + acosh(this: T): T; + atanh(this: T): T; + erf(this: T): T; + round(this: T): T; + step(this: T, alpha?: number): T; + softmax(this: T, dim?: number): T; + resizeBilinear(this: T, newShape2D: [number, number], alignCorners?: boolean): T; + resizeNearestNeighbor(this: T, newShape2D: [number, number], alignCorners?: boolean): T; + conv1d(this: T, filter: Tensor3D, stride: number, pad: 'valid' | 'same' | number, dataFormat?: 'NWC' | 'NCW', dilation?: number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + conv2d(this: T, filter: Tensor4D, strides: [number, number] | number, pad: 'valid' | 'same' | number, dataFormat?: 'NHWC' | 'NCHW', dilations?: [number, number] | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + conv2dTranspose(this: T, filter: Tensor4D, outputShape: [number, number, number, number] | [number, number, number], strides: [number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + depthwiseConv2D(this: T, filter: Tensor4D, strides: [number, number] | number, pad: 'valid' | 'same' | number, dataFormat?: 'NHWC' | 'NCHW', dilations?: [number, number] | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + avgPool(this: T, filterSize: [number, number] | number, strides: [number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + maxPool(this: T, filterSize: [number, number] | number, strides: [number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T; + localResponseNormalization(this: T, radius?: number, bias?: number, alpha?: number, beta?: number): T; + variable(trainable?: boolean, name?: string, dtype?: DataType): Variable; + unsortedSegmentSum(this: T, segmentIds: Tensor1D, numSegments: number): T; + batchToSpaceND(this: T, blockShape: number[], crops: number[][]): T; + spaceToBatchND(this: T, blockShape: number[], paddings: number[][]): T; +} +export declare type Scalar = Tensor; +export declare type Tensor1D = Tensor; +export declare type Tensor2D = Tensor; +export declare type Tensor3D = Tensor; +export declare type Tensor4D = Tensor; +export declare type Tensor5D = Tensor; +export declare type Tensor6D = Tensor; +export declare class Variable extends Tensor { + trainable: boolean; + private static nextVarId; + name: string; + private constructor(); + static variable(initialValue: Tensor, trainable?: boolean, name?: string, dtype?: DataType): Variable; + assign(newValue: Tensor): void; +} +declare const variable: typeof Variable.variable; +export { variable }; diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor.js b/node_modules/@tensorflow/tfjs-core/dist/tensor.js new file mode 100644 index 0000000..208a7bb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor.js @@ -0,0 +1,836 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tensor_format_1 = require("./tensor_format"); +var util = require("./util"); +var util_1 = require("./util"); +var TensorBuffer = (function () { + function TensorBuffer(shape, dtype, values) { + this.dtype = dtype; + if (values != null) { + var n = values.length; + var size = util.sizeFromShape(shape); + util.assert(n === size, "Length of values '" + n + "' does not match the size " + + ("inferred by the shape '" + size + "'")); + } + this.shape = shape.slice(); + this.values = + values || util.getTypedArrayFromDType(dtype, util.sizeFromShape(shape)); + this.strides = util_1.computeStrides(shape); + this.size = util.sizeFromShape(shape); + } + TensorBuffer.prototype.set = function (value) { + var locs = []; + for (var _i = 1; _i < arguments.length; _i++) { + locs[_i - 1] = arguments[_i]; + } + if (locs.length === 0) { + locs = [0]; + } + util.assert(locs.length === this.rank, "The number of provided coordinates (" + locs.length + ") must " + + ("match the rank (" + this.rank + ")")); + var index = this.locToIndex(locs); + this.values[index] = value; + }; + TensorBuffer.prototype.get = function () { + var locs = []; + for (var _i = 0; _i < arguments.length; _i++) { + locs[_i] = arguments[_i]; + } + if (locs.length === 0) { + locs = [0]; + } + var index = locs[locs.length - 1]; + for (var i = 0; i < locs.length - 1; ++i) { + index += this.strides[i] * locs[i]; + } + return this.values[index]; + }; + TensorBuffer.prototype.locToIndex = function (locs) { + if (this.rank === 0) { + return 0; + } + else if (this.rank === 1) { + return locs[0]; + } + var index = locs[locs.length - 1]; + for (var i = 0; i < locs.length - 1; ++i) { + index += this.strides[i] * locs[i]; + } + return index; + }; + TensorBuffer.prototype.indexToLoc = function (index) { + if (this.rank === 0) { + return []; + } + else if (this.rank === 1) { + return [index]; + } + var locs = new Array(this.shape.length); + for (var i = 0; i < locs.length - 1; ++i) { + locs[i] = Math.floor(index / this.strides[i]); + index -= locs[i] * this.strides[i]; + } + locs[locs.length - 1] = index; + return locs; + }; + Object.defineProperty(TensorBuffer.prototype, "rank", { + get: function () { + return this.shape.length; + }, + enumerable: true, + configurable: true + }); + TensorBuffer.prototype.toTensor = function () { + return Tensor.make(this.shape, { values: this.values }, this.dtype); + }; + return TensorBuffer; +}()); +exports.TensorBuffer = TensorBuffer; +var trackerFn = null; +var opHandler = null; +function setTensorTracker(fn) { + trackerFn = fn; +} +exports.setTensorTracker = setTensorTracker; +function setOpHandler(handler) { + opHandler = handler; +} +exports.setOpHandler = setOpHandler; +var Tensor = (function () { + function Tensor(shape, dtype, values, dataId) { + this.isDisposedInternal = false; + this.size = util.sizeFromShape(shape); + if (values != null) { + util.assert(this.size === values.length, "Constructing tensor of shape (" + this.size + ") should match the " + + ("length of values (" + values.length + ")")); + } + this.shape = shape.slice(); + this.dtype = dtype || 'float32'; + this.strides = util_1.computeStrides(shape); + this.dataId = dataId != null ? dataId : {}; + this.id = Tensor.nextId++; + this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher'); + trackerFn().registerTensor(this); + if (values != null) { + trackerFn().write(this.dataId, values); + } + } + Tensor.make = function (shape, data, dtype) { + return new Tensor(shape, dtype, data.values, data.dataId); + }; + Tensor.prototype.flatten = function () { + this.throwIfDisposed(); + return this.as1D(); + }; + Tensor.prototype.asScalar = function () { + this.throwIfDisposed(); + util.assert(this.size === 1, 'The array must have only 1 element.'); + return this.reshape([]); + }; + Tensor.prototype.as1D = function () { + this.throwIfDisposed(); + return this.reshape([this.size]); + }; + Tensor.prototype.as2D = function (rows, columns) { + this.throwIfDisposed(); + return this.reshape([rows, columns]); + }; + Tensor.prototype.as3D = function (rows, columns, depth) { + this.throwIfDisposed(); + return this.reshape([rows, columns, depth]); + }; + Tensor.prototype.as4D = function (rows, columns, depth, depth2) { + this.throwIfDisposed(); + return this.reshape([rows, columns, depth, depth2]); + }; + Tensor.prototype.asType = function (dtype) { + this.throwIfDisposed(); + return opHandler.cast(this, dtype); + }; + Object.defineProperty(Tensor.prototype, "rank", { + get: function () { + return this.shape.length; + }, + enumerable: true, + configurable: true + }); + Tensor.prototype.get = function () { + var locs = []; + for (var _i = 0; _i < arguments.length; _i++) { + locs[_i] = arguments[_i]; + } + util.assert(locs.length === this.rank, 'Number of coordinates in get() must match the rank of the tensor'); + this.throwIfDisposed(); + if (locs.length === 0) { + locs = [0]; + } + var index = locs[locs.length - 1]; + for (var i = 0; i < locs.length - 1; ++i) { + index += this.strides[i] * locs[i]; + } + return this.dataSync()[index]; + }; + Tensor.prototype.buffer = function () { + return opHandler.buffer(this.shape, this.dtype, this.dataSync()); + }; + Tensor.prototype.data = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + this.throwIfDisposed(); + return [2, trackerFn().read(this.dataId)]; + }); + }); + }; + Tensor.prototype.dataSync = function () { + this.throwIfDisposed(); + return trackerFn().readSync(this.dataId); + }; + Tensor.prototype.dispose = function () { + if (this.isDisposed) { + return; + } + trackerFn().disposeTensor(this); + this.isDisposedInternal = true; + }; + Object.defineProperty(Tensor.prototype, "isDisposed", { + get: function () { + return this.isDisposedInternal; + }, + enumerable: true, + configurable: true + }); + Tensor.prototype.throwIfDisposed = function () { + if (this.isDisposed) { + throw new Error("Tensor is disposed."); + } + }; + Tensor.prototype.toFloat = function () { + return this.asType('float32'); + }; + Tensor.prototype.toInt = function () { + return this.asType('int32'); + }; + Tensor.prototype.toBool = function () { + return this.asType('bool'); + }; + Tensor.prototype.print = function (verbose) { + if (verbose === void 0) { verbose = false; } + return opHandler.print(this, verbose); + }; + Tensor.prototype.reshape = function (newShape) { + this.throwIfDisposed(); + return opHandler.reshape(this, newShape); + }; + Tensor.prototype.reshapeAs = function (x) { + this.throwIfDisposed(); + return this.reshape(x.shape); + }; + Tensor.prototype.expandDims = function (axis) { + if (axis === void 0) { axis = 0; } + return opHandler.expandDims(this, axis); + }; + Tensor.prototype.cumsum = function (axis, exclusive, reverse) { + if (axis === void 0) { axis = 0; } + if (exclusive === void 0) { exclusive = false; } + if (reverse === void 0) { reverse = false; } + return opHandler.cumsum(this, axis, exclusive, reverse); + }; + Tensor.prototype.squeeze = function (axis) { + this.throwIfDisposed(); + return opHandler.squeeze(this, axis); + }; + Tensor.prototype.clone = function () { + this.throwIfDisposed(); + return opHandler.clone(this); + }; + Tensor.prototype.toString = function (verbose) { + if (verbose === void 0) { verbose = false; } + var vals = this.dataSync(); + return tensor_format_1.tensorToString(vals, this.shape, this.dtype, verbose); + }; + Tensor.prototype.tile = function (reps) { + this.throwIfDisposed(); + return opHandler.tile(this, reps); + }; + Tensor.prototype.gather = function (indices, axis) { + if (axis === void 0) { axis = 0; } + this.throwIfDisposed(); + return opHandler.gather(this, indices, axis); + }; + Tensor.prototype.matMul = function (b, transposeA, transposeB) { + if (transposeA === void 0) { transposeA = false; } + if (transposeB === void 0) { transposeB = false; } + this.throwIfDisposed(); + return opHandler.matMul(this, b, transposeA, transposeB); + }; + Tensor.prototype.dot = function (b) { + this.throwIfDisposed(); + return opHandler.dot(this, b); + }; + Tensor.prototype.norm = function (ord, axis, keepDims) { + if (ord === void 0) { ord = 'euclidean'; } + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.norm(this, ord, axis, keepDims); + }; + Tensor.prototype.slice = function (begin, size) { + this.throwIfDisposed(); + return opHandler.slice(this, begin, size); + }; + Tensor.prototype.reverse = function (axis) { + this.throwIfDisposed(); + return opHandler.reverse(this, axis); + }; + Tensor.prototype.concat = function (x, axis) { + if (axis === void 0) { axis = 0; } + this.throwIfDisposed(); + return opHandler.concat([this, x], axis); + }; + Tensor.prototype.stack = function (x, axis) { + if (axis === void 0) { axis = 0; } + return opHandler.stack([this, x], axis); + }; + Tensor.prototype.unstack = function (x, axis) { + if (axis === void 0) { axis = 0; } + return opHandler.unstack(this, axis); + }; + Tensor.prototype.pad = function (paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + return opHandler.pad(this, paddings, constantValue); + }; + Tensor.prototype.batchNormalization = function (mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + this.throwIfDisposed(); + return opHandler.batchNormalization(this, mean, variance, varianceEpsilon, scale, offset); + }; + Tensor.prototype.all = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.all(this, axis, keepDims); + }; + Tensor.prototype.any = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.any(this, axis, keepDims); + }; + Tensor.prototype.logSumExp = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.logSumExp(this, axis, keepDims); + }; + Tensor.prototype.sum = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.sum(this, axis, keepDims); + }; + Tensor.prototype.mean = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.mean(this, axis, keepDims); + }; + Tensor.prototype.min = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.min(this, axis, keepDims); + }; + Tensor.prototype.max = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.max(this, axis, keepDims); + }; + Tensor.prototype.argMin = function (axis) { + if (axis === void 0) { axis = null; } + this.throwIfDisposed(); + return opHandler.argMin(this, axis); + }; + Tensor.prototype.argMax = function (axis) { + if (axis === void 0) { axis = null; } + this.throwIfDisposed(); + return opHandler.argMax(this, axis); + }; + Tensor.prototype.cast = function (dtype) { + this.throwIfDisposed(); + return opHandler.cast(this, dtype); + }; + Tensor.prototype.add = function (x) { + this.throwIfDisposed(); + return opHandler.add(this, x); + }; + Tensor.prototype.addStrict = function (x) { + this.throwIfDisposed(); + return opHandler.addStrict(this, x); + }; + Tensor.prototype.sub = function (x) { + this.throwIfDisposed(); + return opHandler.sub(this, x); + }; + Tensor.prototype.subStrict = function (x) { + this.throwIfDisposed(); + return opHandler.subStrict(this, x); + }; + Tensor.prototype.pow = function (exp) { + this.throwIfDisposed(); + return opHandler.pow(this, exp); + }; + Tensor.prototype.powStrict = function (exp) { + this.throwIfDisposed(); + return opHandler.powStrict(this, exp); + }; + Tensor.prototype.mul = function (x) { + this.throwIfDisposed(); + return opHandler.mul(this, x); + }; + Tensor.prototype.mulStrict = function (x) { + this.throwIfDisposed(); + return opHandler.mulStrict(this, x); + }; + Tensor.prototype.div = function (x) { + this.throwIfDisposed(); + return opHandler.div(this, x); + }; + Tensor.prototype.floorDiv = function (x) { + this.throwIfDisposed(); + return opHandler.floorDiv(this, x); + }; + Tensor.prototype.divStrict = function (x) { + this.throwIfDisposed(); + return opHandler.divStrict(this, x); + }; + Tensor.prototype.minimum = function (x) { + this.throwIfDisposed(); + return opHandler.minimum(this, x); + }; + Tensor.prototype.minimumStrict = function (x) { + this.throwIfDisposed(); + return opHandler.minimumStrict(this, x); + }; + Tensor.prototype.maximum = function (x) { + this.throwIfDisposed(); + return opHandler.maximum(this, x); + }; + Tensor.prototype.maximumStrict = function (x) { + this.throwIfDisposed(); + return opHandler.maximumStrict(this, x); + }; + Tensor.prototype.mod = function (x) { + this.throwIfDisposed(); + return opHandler.mod(this, x); + }; + Tensor.prototype.modStrict = function (x) { + this.throwIfDisposed(); + return opHandler.modStrict(this, x); + }; + Tensor.prototype.squaredDifference = function (x) { + this.throwIfDisposed(); + return opHandler.squaredDifference(this, x); + }; + Tensor.prototype.squaredDifferenceStrict = function (x) { + this.throwIfDisposed(); + return opHandler.squaredDifferenceStrict(this, x); + }; + Tensor.prototype.transpose = function (perm) { + this.throwIfDisposed(); + return opHandler.transpose(this, perm); + }; + Tensor.prototype.notEqual = function (x) { + this.throwIfDisposed(); + return opHandler.notEqual(this, x); + }; + Tensor.prototype.notEqualStrict = function (x) { + this.throwIfDisposed(); + return opHandler.notEqualStrict(this, x); + }; + Tensor.prototype.less = function (x) { + this.throwIfDisposed(); + return opHandler.less(this, x); + }; + Tensor.prototype.lessStrict = function (x) { + this.throwIfDisposed(); + return opHandler.lessStrict(this, x); + }; + Tensor.prototype.equal = function (x) { + this.throwIfDisposed(); + return opHandler.equal(this, x); + }; + Tensor.prototype.equalStrict = function (x) { + this.throwIfDisposed(); + return opHandler.equalStrict(this, x); + }; + Tensor.prototype.lessEqual = function (x) { + this.throwIfDisposed(); + return opHandler.lessEqual(this, x); + }; + Tensor.prototype.lessEqualStrict = function (x) { + this.throwIfDisposed(); + return opHandler.lessEqualStrict(this, x); + }; + Tensor.prototype.greater = function (x) { + this.throwIfDisposed(); + return opHandler.greater(this, x); + }; + Tensor.prototype.greaterStrict = function (x) { + this.throwIfDisposed(); + return opHandler.greaterStrict(this, x); + }; + Tensor.prototype.greaterEqual = function (x) { + this.throwIfDisposed(); + return opHandler.greaterEqual(this, x); + }; + Tensor.prototype.greaterEqualStrict = function (x) { + this.throwIfDisposed(); + return opHandler.greaterEqualStrict(this, x); + }; + Tensor.prototype.logicalAnd = function (x) { + this.throwIfDisposed(); + return opHandler.logicalAnd(this, x); + }; + Tensor.prototype.logicalOr = function (x) { + this.throwIfDisposed(); + return opHandler.logicalOr(this, x); + }; + Tensor.prototype.logicalNot = function () { + this.throwIfDisposed(); + return opHandler.logicalNot(this); + }; + Tensor.prototype.logicalXor = function (x) { + this.throwIfDisposed(); + return opHandler.logicalXor(this, x); + }; + Tensor.prototype.where = function (condition, x) { + this.throwIfDisposed(); + return opHandler.where(condition, this, x); + }; + Tensor.prototype.neg = function () { + this.throwIfDisposed(); + return opHandler.neg(this); + }; + Tensor.prototype.ceil = function () { + this.throwIfDisposed(); + return opHandler.ceil(this); + }; + Tensor.prototype.floor = function () { + this.throwIfDisposed(); + return opHandler.floor(this); + }; + Tensor.prototype.sign = function () { + this.throwIfDisposed(); + return opHandler.sign(this); + }; + Tensor.prototype.exp = function () { + this.throwIfDisposed(); + return opHandler.exp(this); + }; + Tensor.prototype.expm1 = function () { + this.throwIfDisposed(); + return opHandler.expm1(this); + }; + Tensor.prototype.log = function () { + this.throwIfDisposed(); + return opHandler.log(this); + }; + Tensor.prototype.log1p = function () { + this.throwIfDisposed(); + return opHandler.log1p(this); + }; + Tensor.prototype.sqrt = function () { + this.throwIfDisposed(); + return opHandler.sqrt(this); + }; + Tensor.prototype.rsqrt = function () { + this.throwIfDisposed(); + return opHandler.rsqrt(this); + }; + Tensor.prototype.square = function () { + this.throwIfDisposed(); + return opHandler.square(this); + }; + Tensor.prototype.reciprocal = function () { + this.throwIfDisposed(); + return opHandler.reciprocal(this); + }; + Tensor.prototype.abs = function () { + this.throwIfDisposed(); + return opHandler.abs(this); + }; + Tensor.prototype.clipByValue = function (min, max) { + this.throwIfDisposed(); + return opHandler.clipByValue(this, min, max); + }; + Tensor.prototype.relu = function () { + this.throwIfDisposed(); + return opHandler.relu(this); + }; + Tensor.prototype.elu = function () { + this.throwIfDisposed(); + return opHandler.elu(this); + }; + Tensor.prototype.selu = function () { + this.throwIfDisposed(); + return opHandler.selu(this); + }; + Tensor.prototype.leakyRelu = function (alpha) { + if (alpha === void 0) { alpha = 0.2; } + this.throwIfDisposed(); + return opHandler.leakyRelu(this, alpha); + }; + Tensor.prototype.prelu = function (alpha) { + this.throwIfDisposed(); + return opHandler.prelu(this, alpha); + }; + Tensor.prototype.sigmoid = function () { + this.throwIfDisposed(); + return opHandler.sigmoid(this); + }; + Tensor.prototype.logSigmoid = function () { + this.throwIfDisposed(); + return opHandler.logSigmoid(this); + }; + Tensor.prototype.softplus = function () { + this.throwIfDisposed(); + return opHandler.softplus(this); + }; + Tensor.prototype.sin = function () { + this.throwIfDisposed(); + return opHandler.sin(this); + }; + Tensor.prototype.cos = function () { + this.throwIfDisposed(); + return opHandler.cos(this); + }; + Tensor.prototype.tan = function () { + this.throwIfDisposed(); + return opHandler.tan(this); + }; + Tensor.prototype.asin = function () { + this.throwIfDisposed(); + return opHandler.asin(this); + }; + Tensor.prototype.acos = function () { + this.throwIfDisposed(); + return opHandler.acos(this); + }; + Tensor.prototype.atan = function () { + this.throwIfDisposed(); + return opHandler.atan(this); + }; + Tensor.prototype.sinh = function () { + this.throwIfDisposed(); + return opHandler.sinh(this); + }; + Tensor.prototype.cosh = function () { + this.throwIfDisposed(); + return opHandler.cosh(this); + }; + Tensor.prototype.tanh = function () { + this.throwIfDisposed(); + return opHandler.tanh(this); + }; + Tensor.prototype.asinh = function () { + this.throwIfDisposed(); + return opHandler.asinh(this); + }; + Tensor.prototype.acosh = function () { + this.throwIfDisposed(); + return opHandler.acosh(this); + }; + Tensor.prototype.atanh = function () { + this.throwIfDisposed(); + return opHandler.atanh(this); + }; + Tensor.prototype.erf = function () { + this.throwIfDisposed(); + return opHandler.erf(this); + }; + Tensor.prototype.round = function () { + this.throwIfDisposed(); + return opHandler.round(this); + }; + Tensor.prototype.step = function (alpha) { + if (alpha === void 0) { alpha = 0.0; } + this.throwIfDisposed(); + return opHandler.step(this, alpha); + }; + Tensor.prototype.softmax = function (dim) { + if (dim === void 0) { dim = -1; } + this.throwIfDisposed(); + return opHandler.softmax(this, dim); + }; + Tensor.prototype.resizeBilinear = function (newShape2D, alignCorners) { + if (alignCorners === void 0) { alignCorners = false; } + this.throwIfDisposed(); + return opHandler.image.resizeBilinear(this, newShape2D, alignCorners); + }; + Tensor.prototype.resizeNearestNeighbor = function (newShape2D, alignCorners) { + if (alignCorners === void 0) { alignCorners = false; } + this.throwIfDisposed(); + return opHandler.image.resizeNearestNeighbor(this, newShape2D, alignCorners); + }; + Tensor.prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NWC'; } + if (dilation === void 0) { dilation = 1; } + this.throwIfDisposed(); + return opHandler.conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode); + }; + Tensor.prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + if (dilations === void 0) { dilations = [1, 1]; } + this.throwIfDisposed(); + return opHandler.conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); + }; + Tensor.prototype.conv2dTranspose = function (filter, outputShape, strides, pad, dimRoundingMode) { + this.throwIfDisposed(); + return opHandler.conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode); + }; + Tensor.prototype.depthwiseConv2D = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + if (dilations === void 0) { dilations = [1, 1]; } + this.throwIfDisposed(); + return opHandler.depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); + }; + Tensor.prototype.avgPool = function (filterSize, strides, pad, dimRoundingMode) { + this.throwIfDisposed(); + return opHandler.avgPool(this, filterSize, strides, pad, dimRoundingMode); + }; + Tensor.prototype.maxPool = function (filterSize, strides, pad, dimRoundingMode) { + this.throwIfDisposed(); + return opHandler.maxPool(this, filterSize, strides, pad, dimRoundingMode); + }; + Tensor.prototype.localResponseNormalization = function (radius, bias, alpha, beta) { + if (radius === void 0) { radius = 5; } + if (bias === void 0) { bias = 1; } + if (alpha === void 0) { alpha = 1; } + if (beta === void 0) { beta = 0.5; } + return opHandler.localResponseNormalization(this, radius, bias, alpha, beta); + }; + Tensor.prototype.variable = function (trainable, name, dtype) { + if (trainable === void 0) { trainable = true; } + this.throwIfDisposed(); + return Variable.variable(this, trainable, name, dtype); + }; + Tensor.prototype.unsortedSegmentSum = function (segmentIds, numSegments) { + this.throwIfDisposed(); + return opHandler.unsortedSegmentSum(this, segmentIds, numSegments); + }; + Tensor.prototype.batchToSpaceND = function (blockShape, crops) { + this.throwIfDisposed(); + return opHandler.batchToSpaceND(this, blockShape, crops); + }; + Tensor.prototype.spaceToBatchND = function (blockShape, paddings) { + this.throwIfDisposed(); + return opHandler.spaceToBatchND(this, blockShape, paddings); + }; + Tensor.nextId = 0; + return Tensor; +}()); +exports.Tensor = Tensor; +Object.defineProperty(Tensor, Symbol.hasInstance, { + value: function (instance) { + return !!instance && instance.shape != null && instance.dtype != null; + } +}); +var Variable = (function (_super) { + __extends(Variable, _super); + function Variable(initialValue, trainable, name) { + if (trainable === void 0) { trainable = true; } + var _this = _super.call(this, initialValue.shape, initialValue.dtype, null, initialValue.dataId) || this; + _this.trainable = trainable; + _this.name = name; + if (_this.name == null) { + _this.name = Variable.nextVarId.toString(); + Variable.nextVarId++; + } + try { + trackerFn().registerVariable(_this); + } + catch (ex) { + trackerFn().disposeTensor(_this); + throw ex; + } + return _this; + } + Variable.variable = function (initialValue, trainable, name, dtype) { + if (trainable === void 0) { trainable = true; } + if (dtype != null && dtype !== initialValue.dtype) { + initialValue = initialValue.asType(dtype); + } + return new Variable(initialValue, trainable, name); + }; + Variable.prototype.assign = function (newValue) { + if (newValue.dtype !== this.dtype) { + throw new Error("dtype of the new value (" + newValue.dtype + ") and " + + ("previous value (" + this.dtype + ") must match")); + } + if (!util.arraysEqual(newValue.shape, this.shape)) { + throw new Error("shape of the new value (" + newValue.shape + ") and " + + ("previous value (" + this.shape + ") must match")); + } + trackerFn().disposeTensor(this); + this.dataId = newValue.dataId; + trackerFn().registerTensor(this); + }; + Variable.nextVarId = 0; + return Variable; +}(Tensor)); +exports.Variable = Variable; +Object.defineProperty(Variable, Symbol.hasInstance, { + value: function (instance) { + return instance instanceof Tensor && instance.assign != null && + instance.assign instanceof Function; + } +}); +var variable = Variable.variable; +exports.variable = variable; +//# sourceMappingURL=tensor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor.js.map b/node_modules/@tensorflow/tfjs-core/dist/tensor.js.map new file mode 100644 index 0000000..2790bd0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tensor.js","sourceRoot":"","sources":["../src/tensor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iDAA+C;AAE/C,6BAA+B;AAC/B,+BAAsC;AAetC;IAME,sBAAY,KAAkB,EAAS,KAAe,EAAE,MAAkB;QAAnC,UAAK,GAAL,KAAK,CAAU;QACpD,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,IAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;YACxB,IAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,CACP,CAAC,KAAK,IAAI,EACV,uBAAqB,CAAC,+BAA4B;iBAC9C,4BAA0B,IAAI,MAAG,CAAA,CAAC,CAAC;SAC5C;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM;YACP,MAAM,IAAI,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAC,OAAO,GAAG,qBAAc,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IASD,0BAAG,GAAH,UAAI,KAAa;QAAE,cAAiB;aAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;YAAjB,6BAAiB;;QAClC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;SACZ;QACD,I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,CAAC;AAEH,IAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;AAC3B,4BAAQ"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_format.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tensor_format.d.ts new file mode 100644 index 0000000..eb21384 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_format.d.ts @@ -0,0 +1,2 @@ +import { DataType, TypedArray } from './types'; +export declare function tensorToString(vals: TypedArray, shape: number[], dtype: DataType, verbose: boolean): string; diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_format.js b/node_modules/@tensorflow/tfjs-core/dist/tensor_format.js new file mode 100644 index 0000000..4ac35f5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_format.js @@ -0,0 +1,105 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = require("./util"); +var FORMAT_LIMIT_NUM_VALS = 20; +var FORMAT_NUM_FIRST_LAST_VALS = 3; +var FORMAT_NUM_SIG_DIGITS = 7; +function tensorToString(vals, shape, dtype, verbose) { + var strides = util_1.computeStrides(shape); + var padPerCol = computeMaxSizePerColumn(vals, shape, strides); + var rank = shape.length; + var valsLines = subTensorToString(vals, shape, strides, padPerCol); + var lines = ['Tensor']; + if (verbose) { + lines.push(" dtype: " + dtype); + lines.push(" rank: " + rank); + lines.push(" shape: [" + shape + "]"); + lines.push(" values:"); + } + lines.push(valsLines.map(function (l) { return ' ' + l; }).join('\n')); + return lines.join('\n'); +} +exports.tensorToString = tensorToString; +function computeMaxSizePerColumn(vals, shape, strides) { + var n = util_1.sizeFromShape(shape); + var numCols = strides[strides.length - 1]; + var padPerCol = new Array(numCols).fill(0); + var rank = shape.length; + if (rank > 1) { + for (var row = 0; row < n / numCols; row++) { + var offset = row * numCols; + for (var j = 0; j < numCols; j++) { + padPerCol[j] = + Math.max(padPerCol[j], valToString(vals[offset + j], 0).length); + } + } + } + return padPerCol; +} +function valToString(val, pad) { + return util_1.rightPad(parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(), pad); +} +function subTensorToString(vals, shape, strides, padPerCol, isLast) { + if (isLast === void 0) { isLast = true; } + var size = shape[0]; + var rank = shape.length; + if (rank === 0) { + return [vals[0].toString()]; + } + if (rank === 1) { + if (size > FORMAT_LIMIT_NUM_VALS) { + var firstVals = Array.from(vals.subarray(0, FORMAT_NUM_FIRST_LAST_VALS)); + var lastVals = Array.from(vals.subarray(size - FORMAT_NUM_FIRST_LAST_VALS, size)); + return [ + '[' + firstVals.map(function (x, i) { return valToString(x, padPerCol[i]); }).join(', ') + + ', ..., ' + + lastVals + .map(function (x, i) { return valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i]); }) + .join(', ') + + ']' + ]; + } + return [ + '[' + + Array.from(vals).map(function (x, i) { return valToString(x, padPerCol[i]); }).join(', ') + + ']' + ]; + } + var subshape = shape.slice(1); + var substrides = strides.slice(1); + var stride = strides[0]; + var lines = []; + if (size > FORMAT_LIMIT_NUM_VALS) { + for (var i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) { + var start = i * stride; + var end = start + stride; + lines.push.apply(lines, subTensorToString(vals.subarray(start, end), subshape, substrides, padPerCol, false)); + } + lines.push('...'); + for (var i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) { + var start = i * stride; + var end = start + stride; + lines.push.apply(lines, subTensorToString(vals.subarray(start, end), subshape, substrides, padPerCol, i === size - 1)); + } + } + else { + for (var i = 0; i < size; i++) { + var start = i * stride; + var end = start + stride; + lines.push.apply(lines, subTensorToString(vals.subarray(start, end), subshape, substrides, padPerCol, i === size - 1)); + } + } + var sep = rank === 2 ? ',' : ''; + lines[0] = '[' + lines[0] + sep; + for (var i = 1; i < lines.length - 1; i++) { + lines[i] = ' ' + lines[i] + sep; + } + var newLineSep = ',\n'; + for (var i = 2; i < rank; i++) { + newLineSep += '\n'; + } + lines[lines.length - 1] = + ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep); + return lines; +} +//# sourceMappingURL=tensor_format.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_format.js.map b/node_modules/@tensorflow/tfjs-core/dist/tensor_format.js.map new file mode 100644 index 0000000..e75ab92 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_format.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tensor_format.js","sourceRoot":"","sources":["../src/tensor_format.ts"],"names":[],"mappings":";;AAkBA,+BAA+D;AAG/D,IAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,IAAM,0BAA0B,GAAG,CAAC,CAAC;AAErC,IAAM,qBAAqB,GAAG,CAAC,CAAC;AAEhC,wBACI,IAAgB,EAAE,KAAe,EAAE,KAAe,EAAE,OAAgB;IACtE,IAAM,OAAO,GAAG,qBAAc,CAAC,KAAK,CAAC,CAAC;IACtC,IAAM,SAAS,GAAG,uBAAuB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAChE,IAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC;IAC1B,IAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IACrE,IAAM,KAAK,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzB,IAAI,OAAO,EAAE;QACX,KAAK,CAAC,IAAI,CAAC,cAAY,KAAO,CAAC,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,aAAW,IAAM,CAAC,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,eAAa,KAAK,MAAG,CAAC,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KACzB;IACD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,MAAM,GAAG,CAAC,EAAV,CAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAA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iBAAiB,CAC3B,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAC1D,CAAC,KAAK,IAAI,GAAG,CAAC,CAAc,EAAE;SACnC;KACF;IACD,IAAM,GAAG,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAClC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;KACjC;IACD,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;QAC7B,UAAU,IAAI,IAAI,CAAC;KACpB;IACD,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QACnB,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tensor_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_test.js b/node_modules/@tensorflow/tfjs-core/dist/tensor_test.js new file mode 100644 index 0000000..f77d820 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_test.js @@ -0,0 +1,1057 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var jasmine_util_1 = require("./jasmine_util"); +var tensor_1 = require("./tensor"); +var test_util_1 = require("./test_util"); +var types_1 = require("./types"); +jasmine_util_1.describeWithFlags('tensor', test_util_1.ALL_ENVS, function () { + it('Tensors of arbitrary size', function () { + var t = tf.tensor1d([1, 2, 3]); + expect(t.rank).toBe(1); + expect(t.size).toBe(3); + test_util_1.expectArraysClose(t, [1, 2, 3]); + expect(t.get(4)).toBeUndefined(); + t = tf.tensor2d([1, 2, 3], [1, 3]); + expect(t.rank).toBe(2); + expect(t.size).toBe(3); + test_util_1.expectArraysClose(t, [1, 2, 3]); + expect(t.get(0, 4)).toBeUndefined(); + t = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + expect(t.rank).toBe(2); + expect(t.size).toBe(6); + test_util_1.expectArraysClose(t, [1, 2, 3, 4, 5, 6]); + expect(t.get(5, 3)).toBeUndefined(); + expect(function () { return tf.tensor2d([1], [1, 2]); }).toThrowError(); + }); + it('Tensors of explicit size', function () { + var t = tf.tensor1d([5, 3, 2]); + expect(t.rank).toBe(1); + expect(t.shape).toEqual([3]); + test_util_1.expectNumbersClose(t.get(1), 3); + expect(function () { return tf.tensor3d([1, 2], [1, 2, 3, 5]); }).toThrowError(); + var t4 = tf.tensor4d([1, 2, 3, 4], [1, 2, 1, 2]); + test_util_1.expectNumbersClose(t4.get(0, 0, 0, 0), 1); + test_util_1.expectNumbersClose(t4.get(0, 0, 0, 1), 2); + test_util_1.expectNumbersClose(t4.get(0, 1, 0, 0), 3); + test_util_1.expectNumbersClose(t4.get(0, 1, 0, 1), 4); + var x = tf.ones([3, 4, 2]); + expect(x.rank).toBe(3); + expect(x.size).toBe(24); + for (var i = 0; i < 3; i++) { + for (var j = 0; j < 4; j++) { + for (var k = 0; k < 2; k++) { + test_util_1.expectNumbersClose(x.get(i, j, k), 1); + } + } + } + var z = tf.zeros([3, 4, 2]); + expect(z.rank).toBe(3); + expect(z.size).toBe(24); + for (var i = 0; i < 3; i++) { + for (var j = 0; j < 4; j++) { + for (var k = 0; k < 2; k++) { + test_util_1.expectNumbersClose(z.get(i, j, k), 0); + } + } + } + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + test_util_1.expectNumbersClose(a.get(1, 2), 6); + }); + it('Tensor dataSync CPU --> GPU', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [3, 2]); + test_util_1.expectArraysClose(a.dataSync(), new Float32Array([1, 2, 3, 4, 5, 6])); + }); + it('Tensor.data() CPU --> GPU', function () { return __awaiter(_this, void 0, void 0, function () { + var a, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + a = tf.tensor2d([1, 2, 3, 4, 5, 6], [3, 2]); + _a = test_util_1.expectArraysClose; + return [4, a.data()]; + case 1: + _a.apply(void 0, [_b.sent(), new Float32Array([1, 2, 3, 4, 5, 6])]); + return [2]; + } + }); + }); }); + it('Scalar basic methods', function () { + var a = tf.scalar(5); + test_util_1.expectNumbersClose(a.get(), 5); + test_util_1.expectArraysClose(a, [5]); + expect(a.rank).toBe(0); + expect(a.size).toBe(1); + expect(a.shape).toEqual([]); + }); + it('indexToLoc Scalar', function () { + var a = tf.scalar(0).buffer(); + expect(a.indexToLoc(0)).toEqual([]); + var b = tf.zeros([]).buffer(); + expect(b.indexToLoc(0)).toEqual([]); + }); + it('indexToLoc Tensor1D', function () { + var a = tf.zeros([3]).buffer(); + expect(a.indexToLoc(0)).toEqual([0]); + expect(a.indexToLoc(1)).toEqual([1]); + expect(a.indexToLoc(2)).toEqual([2]); + var b = tf.zeros([3]).buffer(); + expect(b.indexToLoc(0)).toEqual([0]); + expect(b.indexToLoc(1)).toEqual([1]); + expect(b.indexToLoc(2)).toEqual([2]); + }); + it('indexToLoc Tensor2D', function () { + var a = tf.zeros([3, 2]).buffer(); + expect(a.indexToLoc(0)).toEqual([0, 0]); + expect(a.indexToLoc(1)).toEqual([0, 1]); + expect(a.indexToLoc(2)).toEqual([1, 0]); + expect(a.indexToLoc(3)).toEqual([1, 1]); + expect(a.indexToLoc(4)).toEqual([2, 0]); + expect(a.indexToLoc(5)).toEqual([2, 1]); + var b = tf.zeros([3, 2]).buffer(); + expect(b.indexToLoc(0)).toEqual([0, 0]); + expect(b.indexToLoc(1)).toEqual([0, 1]); + expect(b.indexToLoc(2)).toEqual([1, 0]); + expect(b.indexToLoc(3)).toEqual([1, 1]); + expect(b.indexToLoc(4)).toEqual([2, 0]); + expect(b.indexToLoc(5)).toEqual([2, 1]); + }); + it('indexToLoc Tensor3D', function () { + var a = tf.zeros([3, 2, 2]).buffer(); + expect(a.indexToLoc(0)).toEqual([0, 0, 0]); + expect(a.indexToLoc(1)).toEqual([0, 0, 1]); + expect(a.indexToLoc(2)).toEqual([0, 1, 0]); + expect(a.indexToLoc(3)).toEqual([0, 1, 1]); + expect(a.indexToLoc(4)).toEqual([1, 0, 0]); + expect(a.indexToLoc(5)).toEqual([1, 0, 1]); + expect(a.indexToLoc(11)).toEqual([2, 1, 1]); + var b = tf.zeros([3, 2, 2]).buffer(); + expect(b.indexToLoc(0)).toEqual([0, 0, 0]); + expect(b.indexToLoc(1)).toEqual([0, 0, 1]); + expect(b.indexToLoc(2)).toEqual([0, 1, 0]); + expect(b.indexToLoc(3)).toEqual([0, 1, 1]); + expect(b.indexToLoc(4)).toEqual([1, 0, 0]); + expect(b.indexToLoc(5)).toEqual([1, 0, 1]); + expect(b.indexToLoc(11)).toEqual([2, 1, 1]); + }); + it('indexToLoc Tensor 5D', function () { + var values = new Float32Array([1, 2, 3, 4]); + var a = tensor_1.Tensor.make([2, 1, 1, 1, 2], { values: values }).buffer(); + expect(a.indexToLoc(0)).toEqual([0, 0, 0, 0, 0]); + expect(a.indexToLoc(1)).toEqual([0, 0, 0, 0, 1]); + expect(a.indexToLoc(2)).toEqual([1, 0, 0, 0, 0]); + expect(a.indexToLoc(3)).toEqual([1, 0, 0, 0, 1]); + }); + it('locToIndex Scalar', function () { + var a = tf.scalar(0).buffer(); + expect(a.locToIndex([])).toEqual(0); + var b = tf.zeros([]).buffer(); + expect(b.locToIndex([])).toEqual(0); + }); + it('locToIndex Tensor1D', function () { + var a = tf.zeros([3]).buffer(); + expect(a.locToIndex([0])).toEqual(0); + expect(a.locToIndex([1])).toEqual(1); + expect(a.locToIndex([2])).toEqual(2); + var b = tf.zeros([3]).buffer(); + expect(b.locToIndex([0])).toEqual(0); + expect(b.locToIndex([1])).toEqual(1); + expect(b.locToIndex([2])).toEqual(2); + }); + it('locToIndex Tensor2D', function () { + var a = tf.zeros([3, 2]).buffer(); + expect(a.locToIndex([0, 0])).toEqual(0); + expect(a.locToIndex([0, 1])).toEqual(1); + expect(a.locToIndex([1, 0])).toEqual(2); + expect(a.locToIndex([1, 1])).toEqual(3); + expect(a.locToIndex([2, 0])).toEqual(4); + expect(a.locToIndex([2, 1])).toEqual(5); + var b = tf.zeros([3, 2]).buffer(); + expect(b.locToIndex([0, 0])).toEqual(0); + expect(b.locToIndex([0, 1])).toEqual(1); + expect(b.locToIndex([1, 0])).toEqual(2); + expect(b.locToIndex([1, 1])).toEqual(3); + expect(b.locToIndex([2, 0])).toEqual(4); + expect(b.locToIndex([2, 1])).toEqual(5); + }); + it('locToIndex Tensor3D', function () { + var a = tf.zeros([3, 2, 2]).buffer(); + expect(a.locToIndex([0, 0, 0])).toEqual(0); + expect(a.locToIndex([0, 0, 1])).toEqual(1); + expect(a.locToIndex([0, 1, 0])).toEqual(2); + expect(a.locToIndex([0, 1, 1])).toEqual(3); + expect(a.locToIndex([1, 0, 0])).toEqual(4); + expect(a.locToIndex([1, 0, 1])).toEqual(5); + expect(a.locToIndex([2, 1, 1])).toEqual(11); + var b = tf.zeros([3, 2, 2]).buffer(); + expect(b.locToIndex([0, 0, 0])).toEqual(0); + expect(b.locToIndex([0, 0, 1])).toEqual(1); + expect(b.locToIndex([0, 1, 0])).toEqual(2); + expect(b.locToIndex([0, 1, 1])).toEqual(3); + expect(b.locToIndex([1, 0, 0])).toEqual(4); + expect(b.locToIndex([1, 0, 1])).toEqual(5); + expect(b.locToIndex([2, 1, 1])).toEqual(11); + }); + it('Tensor assignability (asserts compiler)', function () { + var a = null; + var b = a; + expect(b).toBeNull(); + var a1 = null; + var b1 = a1; + expect(b1).toBeNull(); + var a2 = null; + var b2 = a2; + expect(b2).toBeNull(); + var a3 = null; + var b3 = a3; + expect(b3).toBeNull(); + var a4 = null; + var b4 = a4; + expect(b4).toBeNull(); + }); + it('tf.tensor1d() from number[]', function () { + var a = tf.tensor1d([1, 2, 3]); + test_util_1.expectArraysClose(a, [1, 2, 3]); + }); + it('tf.tensor1d() throw error with null input value', function () { + expect(function () { return tf.tensor1d(null); }) + .toThrowError('The input to the tensor constructor ' + + 'must be a non-null value.'); + }); + it('tf.tensor1d() from number[][], shape mismatch', function () { + expect(function () { return tf.tensor1d([[1], [2], [3]]); }).toThrowError(); + }); + it('tf.tensor2d() from number[][]', function () { + var a = tf.tensor2d([[1, 2, 3], [4, 5, 6]], [2, 3]); + test_util_1.expectArraysClose(a, [1, 2, 3, 4, 5, 6]); + }); + it('tf.tensor2d() requires shape to be of length 2', function () { + var shape = [4]; + expect(function () { return tf.tensor2d([1, 2, 3, 4], shape); }).toThrowError(); + }); + it('tf.tensor2d() from number[][], but shape does not match', function () { + expect(function () { return tf.tensor2d([[1, 2, 3], [4, 5, 6]], [3, 2]); }).toThrowError(); + }); + it('tf.tensor2d() from number[], but no shape throws error', function () { + expect(function () { return tf.tensor2d([1, 2, 3, 4]); }).toThrowError(); + }); + it('tf.tensor2d() throw error with null input value', function () { + expect(function () { return tf.tensor2d(null); }) + .toThrowError('The input to the tensor constructor ' + + 'must be a non-null value.'); + }); + it('tensor3d() from number[][][]', function () { + var a = tf.tensor3d([[[1], [2], [3]], [[4], [5], [6]]], [2, 3, 1]); + test_util_1.expectArraysClose(a, [1, 2, 3, 4, 5, 6]); + }); + it('tensor3d() from number[][][], but shape does not match', function () { + var values = [[[1], [2], [3]], [[4], [5], [6]]]; + expect(function () { return tf.tensor3d(values, [3, 2, 1]); }).toThrowError(); + }); + it('tf.tensor3d() from number[], but no shape throws error', function () { + expect(function () { return tf.tensor3d([1, 2, 3, 4]); }).toThrowError(); + }); + it('tf.tensor3d() requires shape to be of length 3', function () { + var shape = [4, 1]; + expect(function () { return tf.tensor3d([1, 2, 3, 4], shape); }).toThrowError(); + }); + it('tf.tensor3d() throw error with null input value', function () { + expect(function () { return tf.tensor3d(null); }) + .toThrowError('The input to the tensor constructor ' + + 'must be a non-null value.'); + }); + it('tensor4d() from number[][][][]', function () { + var a = tf.tensor4d([[[[1]], [[2]]], [[[4]], [[5]]]], [2, 2, 1, 1]); + test_util_1.expectArraysClose(a, [1, 2, 4, 5]); + }); + it('tensor4d() from number[][][][], but shape does not match', function () { + var f = function () { + tf.tensor4d([[[[1]], [[2]]], [[[4]], [[5]]]], [2, 1, 2, 1]); + }; + expect(f).toThrowError(); + }); + it('tf.tensor4d() from number[], but no shape throws error', function () { + expect(function () { return tf.tensor4d([1, 2, 3, 4]); }).toThrowError(); + }); + it('tf.tensor4d() requires shape to be of length 4', function () { + var shape = [4, 1]; + expect(function () { return tf.tensor4d([1, 2, 3, 4], shape); }).toThrowError(); + }); + it('tf.tensor4d() throw error with null input value', function () { + expect(function () { return tf.tensor4d(null); }) + .toThrowError('The input to the tensor constructor ' + + 'must be a non-null value.'); + }); + it('tf.tensor5d() throw error with null input value', function () { + expect(function () { return tf.tensor5d(null); }) + .toThrowError('The input to the tensor constructor ' + + 'must be a non-null value.'); + }); + it('tf.tensor6d() throw error with null input value', function () { + expect(function () { return tf.tensor6d(null); }) + .toThrowError('The input to the tensor constructor ' + + 'must be a non-null value.'); + }); + it('default dtype', function () { + var a = tf.scalar(3); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [3]); + }); + it('float32 dtype', function () { + var a = tf.scalar(3, 'float32'); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [3]); + }); + it('int32 dtype', function () { + var a = tf.scalar(3, 'int32'); + expect(a.dtype).toBe('int32'); + test_util_1.expectArraysEqual(a, [3]); + }); + it('int32 dtype, 3.9 => 3, like numpy', function () { + var a = tf.scalar(3.9, 'int32'); + expect(a.dtype).toBe('int32'); + test_util_1.expectArraysEqual(a, [3]); + }); + it('int32 dtype, -3.9 => -3, like numpy', function () { + var a = tf.scalar(-3.9, 'int32'); + expect(a.dtype).toBe('int32'); + test_util_1.expectArraysEqual(a, [-3]); + }); + it('bool dtype, 3 => true, like numpy', function () { + var a = tf.scalar(3, 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.get()).toBe(1); + }); + it('bool dtype, -2 => true, like numpy', function () { + var a = tf.scalar(-2, 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.get()).toBe(1); + }); + it('bool dtype, 0 => false, like numpy', function () { + var a = tf.scalar(0, 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.get()).toBe(0); + }); + it('bool dtype from boolean', function () { + var a = tf.scalar(false, 'bool'); + expect(a.get()).toBe(0); + expect(a.dtype).toBe('bool'); + var b = tf.scalar(true, 'bool'); + expect(b.get()).toBe(1); + expect(b.dtype).toBe('bool'); + }); + it('int32 dtype from boolean', function () { + var a = tf.scalar(true, 'int32'); + expect(a.get()).toBe(1); + expect(a.dtype).toBe('int32'); + }); + it('default dtype from boolean', function () { + var a = tf.scalar(false); + test_util_1.expectNumbersClose(a.get(), 0); + expect(a.dtype).toBe('float32'); + }); + it('default dtype', function () { + var a = tf.tensor1d([1, 2, 3]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysClose(a, [1, 2, 3]); + }); + it('float32 dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'float32'); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysClose(a, [1, 2, 3]); + }); + it('int32 dtype', function () { + var a = tf.tensor1d([1, 2, 3], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysEqual(a, [1, 2, 3]); + }); + it('int32 dtype, non-ints get floored, like numpy', function () { + var a = tf.tensor1d([1.1, 2.5, 3.9], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysEqual(a, [1, 2, 3]); + }); + it('int32 dtype, negative non-ints get ceiled, like numpy', function () { + var a = tf.tensor1d([-1.1, -2.5, -3.9], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysEqual(a, [-1, -2, -3]); + }); + it('bool dtype, !=0 is truthy, 0 is falsy, like numpy', function () { + var a = tf.tensor1d([1, -2, 0, 3], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([4]); + expect(a.get(0)).toBe(1); + expect(a.get(1)).toBe(1); + expect(a.get(2)).toBe(0); + expect(a.get(3)).toBe(1); + }); + it('default dtype from boolean[]', function () { + var a = tf.tensor1d([false, false, true]); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [0, 0, 1]); + }); + it('int32 dtype from boolean[]', function () { + var a = tf.tensor1d([false, false, true], 'int32'); + expect(a.dtype).toBe('int32'); + test_util_1.expectArraysEqual(a, [0, 0, 1]); + }); + it('bool dtype from boolean[]', function () { + var a = tf.tensor1d([false, false, true], 'bool'); + expect(a.dtype).toBe('bool'); + test_util_1.expectArraysEqual(a, [0, 0, 1]); + }); + it('default dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(a, [1, 2, 3, 4]); + }); + it('float32 dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4], [2, 2]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2]); + test_util_1.expectArraysClose(a, [1, 2, 3, 4]); + }); + it('int32 dtype', function () { + var a = tf.tensor2d([[1, 2], [3, 4]], [2, 2], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(a, [1, 2, 3, 4]); + }); + it('int32 dtype, non-ints get floored, like numpy', function () { + var a = tf.tensor2d([1.1, 2.5, 3.9, 4.0], [2, 2], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(a, [1, 2, 3, 4]); + }); + it('int32 dtype, negative non-ints get ceiled, like numpy', function () { + var a = tf.tensor2d([-1.1, -2.5, -3.9, -4.0], [2, 2], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2]); + test_util_1.expectArraysEqual(a, [-1, -2, -3, -4]); + }); + it('bool dtype, !=0 is truthy, 0 is falsy, like numpy', function () { + var a = tf.tensor2d([1, -2, 0, 3], [2, 2], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([2, 2]); + expect(a.get(0, 0)).toBe(1); + expect(a.get(0, 1)).toBe(1); + expect(a.get(1, 0)).toBe(0); + expect(a.get(1, 1)).toBe(1); + }); + it('default dtype from boolean[]', function () { + var a = tf.tensor2d([[false, false], [true, false]], [2, 2]); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [0, 0, 1, 0]); + }); + it('int32 dtype from boolean[]', function () { + var a = tf.tensor2d([[false, false], [true, false]], [2, 2], 'int32'); + expect(a.dtype).toBe('int32'); + test_util_1.expectArraysEqual(a, [0, 0, 1, 0]); + }); + it('bool dtype from boolean[]', function () { + var a = tf.tensor2d([[false, false], [true, false]], [2, 2], 'bool'); + expect(a.dtype).toBe('bool'); + test_util_1.expectArraysEqual(a, [0, 0, 1, 0]); + }); + it('default dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(a, [1, 2, 3, 4]); + }); + it('float32 dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4], [2, 2, 1]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysClose(a, [1, 2, 3, 4]); + }); + it('int32 dtype', function () { + var a = tf.tensor3d([[[1], [2]], [[3], [4]]], [2, 2, 1], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysEqual(a, [1, 2, 3, 4]); + }); + it('int32 dtype, non-ints get floored, like numpy', function () { + var a = tf.tensor3d([1.1, 2.5, 3.9, 4.0], [2, 2, 1], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysEqual(a, [1, 2, 3, 4]); + }); + it('int32 dtype, negative non-ints get ceiled, like numpy', function () { + var a = tf.tensor3d([-1.1, -2.5, -3.9, -4.0], [2, 2, 1], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2, 1]); + test_util_1.expectArraysEqual(a, [-1, -2, -3, -4]); + }); + it('bool dtype, !=0 is truthy, 0 is falsy, like numpy', function () { + var a = tf.tensor3d([1, -2, 0, 3], [2, 2, 1], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([2, 2, 1]); + expect(a.get(0, 0, 0)).toBe(1); + expect(a.get(0, 1, 0)).toBe(1); + expect(a.get(1, 0, 0)).toBe(0); + expect(a.get(1, 1, 0)).toBe(1); + }); + it('default dtype from boolean[]', function () { + var a = tf.tensor3d([[[false], [false]], [[true], [false]]], [2, 2, 1]); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [0, 0, 1, 0]); + }); + it('int32 dtype from boolean[]', function () { + var a = tf.tensor3d([[[false], [false]], [[true], [false]]], [2, 2, 1], 'int32'); + expect(a.dtype).toBe('int32'); + test_util_1.expectArraysEqual(a, [0, 0, 1, 0]); + }); + it('bool dtype from boolean[]', function () { + var a = tf.tensor3d([[[false], [false]], [[true], [false]]], [2, 2, 1], 'bool'); + expect(a.dtype).toBe('bool'); + test_util_1.expectArraysEqual(a, [0, 0, 1, 0]); + }); + it('default dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(a, [1, 2, 3, 4]); + }); + it('float32 dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4], [2, 2, 1, 1]); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysClose(a, [1, 2, 3, 4]); + }); + it('int32 dtype', function () { + var a = tf.tensor4d([[[[1]], [[2]]], [[[3]], [[4]]]], [2, 2, 1, 1], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(a, [1, 2, 3, 4]); + }); + it('int32 dtype, non-ints get floored, like numpy', function () { + var a = tf.tensor4d([1.1, 2.5, 3.9, 4.0], [2, 2, 1, 1], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(a, [1, 2, 3, 4]); + }); + it('int32 dtype, negative non-ints get ceiled, like numpy', function () { + var a = tf.tensor4d([-1.1, -2.5, -3.9, -4.0], [2, 2, 1, 1], 'int32'); + expect(a.dtype).toBe('int32'); + expect(a.shape).toEqual([2, 2, 1, 1]); + test_util_1.expectArraysEqual(a, [-1, -2, -3, -4]); + }); + it('bool dtype, !=0 is truthy, 0 is falsy, like numpy', function () { + var a = tf.tensor4d([1, -2, 0, 3], [2, 2, 1, 1], 'bool'); + expect(a.dtype).toBe('bool'); + expect(a.shape).toEqual([2, 2, 1, 1]); + expect(a.get(0, 0, 0, 0)).toBe(1); + expect(a.get(0, 1, 0, 0)).toBe(1); + expect(a.get(1, 0, 0, 0)).toBe(0); + expect(a.get(1, 1, 0, 0)).toBe(1); + }); + it('default dtype from boolean[]', function () { + var a = tf.tensor4d([[[[false], [false]], [[true], [false]]]], [1, 2, 2, 1]); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [0, 0, 1, 0]); + }); + it('int32 dtype from boolean[]', function () { + var a = tf.tensor4d([[[[false], [false]], [[true], [false]]]], [1, 2, 2, 1], 'int32'); + expect(a.dtype).toBe('int32'); + test_util_1.expectArraysEqual(a, [0, 0, 1, 0]); + }); + it('bool dtype from boolean[]', function () { + var a = tf.tensor4d([[[[false], [false]], [[true], [false]]]], [1, 2, 2, 1], 'bool'); + expect(a.dtype).toBe('bool'); + test_util_1.expectArraysEqual(a, [0, 0, 1, 0]); + }); + it('Scalar default dtype', function () { + var a = tf.scalar(4); + var b = a.reshape([1, 1]); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([1, 1]); + }); + it('Scalar bool dtype', function () { + var a = tf.scalar(4, 'bool'); + var b = a.reshape([1, 1, 1]); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([1, 1, 1]); + }); + it('Tensor1D default dtype', function () { + var a = tf.tensor1d([1, 2, 3, 4]); + var b = a.reshape([2, 2]); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2]); + }); + it('Tensor1D int32 dtype', function () { + var a = tf.tensor1d([1, 2, 3, 4], 'int32'); + var b = a.reshape([2, 2]); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([2, 2]); + }); + it('Tensor2D default dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + var b = a.reshape([6]); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([6]); + }); + it('Tensor2D bool dtype', function () { + var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3], 'bool'); + var b = a.reshape([6]); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([6]); + }); + it('Tensor3D default dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6], [2, 3, 1]); + var b = a.reshape([6]); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([6]); + }); + it('Tensor3D bool dtype', function () { + var a = tf.tensor3d([1, 2, 3, 4, 5, 6], [2, 3, 1], 'bool'); + var b = a.reshape([6]); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([6]); + }); + it('Tensor4D default dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4, 5, 6], [2, 3, 1, 1]); + var b = a.reshape([2, 3]); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 3]); + }); + it('Tensor4D int32 dtype', function () { + var a = tf.tensor4d([1, 2, 3, 4, 5, 6], [2, 3, 1, 1], 'int32'); + var b = a.reshape([3, 2]); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([3, 2]); + }); + it('reshape is functional', function () { + var a = tf.scalar(2.4); + var b = a.reshape([]); + expect(a.id).not.toBe(b.id); + b.dispose(); + test_util_1.expectArraysClose(a, [2.4]); + }); + it('reshape throws when passed a non-tensor', function () { + expect(function () { return tf.reshape({}, []); }) + .toThrowError(/Argument 'x' passed to 'reshape' must be a Tensor/); + }); + it('reshape accepts a tensor-like object', function () { + var res = tf.reshape([[1, 2, 3], [4, 5, 6]], [3, 2]); + expect(res.dtype).toBe('float32'); + expect(res.shape).toEqual([3, 2]); + test_util_1.expectArraysClose(res, [1, 2, 3, 4, 5, 6]); + }); + it('cast bool -> bool', function () { + var a = tf.tensor1d([1, 0], 'bool'); + expect(a.cast('bool').dtype).toEqual('bool'); + }); + it('cast bool -> int32', function () { + var a = tf.tensor1d([1, 0], 'bool'); + expect(a.cast('int32').dtype).toEqual('int32'); + }); + it('cast bool -> float32', function () { + var a = tf.tensor1d([1, 0], 'bool'); + expect(a.cast('float32').dtype).toEqual('float32'); + }); + it('cast int32 -> bool', function () { + var a = tf.tensor1d([1, 0], 'int32'); + expect(a.cast('bool').dtype).toEqual('bool'); + }); + it('cast int32 -> int32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + expect(a.cast('int32').dtype).toEqual('int32'); + }); + it('cast int32 -> float32', function () { + var a = tf.tensor1d([1, 2], 'int32'); + expect(a.cast('float32').dtype).toEqual('float32'); + }); + it('cast float32 -> bool', function () { + var a = tf.tensor1d([1.0, 0.0]); + expect(a.cast('bool').dtype).toEqual('bool'); + }); + it('cast float32 -> int32', function () { + var a = tf.tensor1d([1.0, 2.0]); + expect(a.cast('int32').dtype).toEqual('int32'); + }); + it('cast float32 -> float32', function () { + var a = tf.tensor1d([1.0, 2.0]); + expect(a.cast('float32').dtype).toEqual('float32'); + }); + it('cast throws when passed a non-tensor', function () { + expect(function () { return tf.cast({}, 'float32'); }) + .toThrowError(/Argument 'x' passed to 'cast' must be a Tensor/); + }); + it('cast accepts a tensor-like object', function () { + var a = [1.0, 2.0]; + var res = tf.cast(a, 'int32'); + expect(res.dtype).toEqual('int32'); + test_util_1.expectArraysClose(res, [1, 2]); + }); + it('scalar bool -> int32', function () { + var a = tf.scalar(true, 'bool').toInt(); + expect(a.dtype).toBe('int32'); + expect(a.get()).toBe(1); + }); + it('Tensor1D float32 -> int32', function () { + var a = tf.tensor1d([1.1, 3.9, -2.9, 0]).toInt(); + expect(a.dtype).toBe('int32'); + test_util_1.expectArraysEqual(a, [1, 3, -2, 0]); + }); + it('Tensor2D float32 -> bool', function () { + var a = tf.tensor2d([1.1, 3.9, -2.9, 0], [2, 2]).asType(types_1.DType.bool); + expect(a.dtype).toBe('bool'); + expect(a.get(0, 0)).toBe(1); + expect(a.get(0, 1)).toBe(1); + expect(a.get(1, 0)).toBe(1); + expect(a.get(1, 1)).toBe(0); + }); + it('Tensor2D int32 -> bool', function () { + var a = tf.tensor2d([1, 3, 0, -1], [2, 2], 'int32').toBool(); + expect(a.dtype).toBe('bool'); + expect(a.get(0, 0)).toBe(1); + expect(a.get(0, 1)).toBe(1); + expect(a.get(1, 0)).toBe(0); + expect(a.get(1, 1)).toBe(1); + }); + it('Tensor3D bool -> float32', function () { + var a = tf.tensor3d([true, false, false, true], [2, 2, 1], 'bool').toFloat(); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [1, 0, 0, 1]); + }); + it('bool CPU -> GPU -> CPU', function () { + var a = tf.tensor1d([1, 2, 0, 0, 5], 'bool'); + test_util_1.expectArraysEqual(a, [1, 1, 0, 0, 1]); + }); + it('int32 CPU -> GPU -> CPU', function () { + var a = tf.tensor1d([1, 2, 0, 0, 5], 'int32'); + test_util_1.expectArraysEqual(a, [1, 2, 0, 0, 5]); + }); + it('asType is functional', function () { + var a = tf.scalar(2.4, 'float32'); + var b = a.toFloat(); + expect(a.id).not.toBe(b.id); + b.dispose(); + test_util_1.expectArraysClose(a, [2.4]); + }); + it('squeeze no axis', function () { + var a = tf.tensor2d([4, 2, 1], [3, 1], 'bool'); + var b = a.squeeze(); + expect(b.shape).toEqual([3]); + }); + it('squeeze with axis', function () { + var a = tf.tensor3d([4, 2, 1], [3, 1, 1], 'bool'); + var b = a.squeeze([1]); + expect(b.shape).toEqual([3, 1]); + }); + it('squeeze wrong axis', function () { + var a = tf.tensor3d([4, 2, 1], [3, 1, 1], 'bool'); + expect(function () { return a.squeeze([0, 1]); }).toThrowError(); + }); + it('squeeze throws when passed a non-tensor', function () { + expect(function () { return tf.squeeze({}); }) + .toThrowError(/Argument 'x' passed to 'squeeze' must be a Tensor/); + }); + it('squeeze accepts a tensor-like object', function () { + var res = tf.squeeze([[[4]], [[2]], [[1]]]); + expect(res.shape).toEqual([3]); + test_util_1.expectArraysClose(res, [4, 2, 1]); + }); + it('scalar -> 2d', function () { + var a = tf.scalar(4, 'int32'); + var b = a.as2D(1, 1); + expect(b.dtype).toBe('int32'); + expect(b.shape).toEqual([1, 1]); + }); + it('1d -> 2d', function () { + var a = tf.tensor1d([4, 2, 1], 'bool'); + var b = a.as2D(3, 1); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([3, 1]); + }); + it('2d -> 4d', function () { + var a = tf.tensor2d([4, 2, 1, 3], [2, 2]); + var b = a.as4D(1, 1, 2, 2); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([1, 1, 2, 2]); + }); + it('3d -> 2d', function () { + var a = tf.tensor3d([4, 2, 1, 3], [2, 2, 1], 'float32'); + var b = a.as2D(2, 2); + expect(b.dtype).toBe('float32'); + expect(b.shape).toEqual([2, 2]); + }); + it('4d -> 1d', function () { + var a = tf.tensor4d([4, 2, 1, 3], [2, 2, 1, 1], 'bool'); + var b = a.as1D(); + expect(b.dtype).toBe('bool'); + expect(b.shape).toEqual([4]); + }); +}); +describe('tensor.toString', function () { + it('scalar verbose', function () { + var verbose = true; + var str = tf.scalar(5).toString(verbose); + expect(str).toEqual('Tensor\n' + + ' dtype: float32\n' + + ' rank: 0\n' + + ' shape: []\n' + + ' values:\n' + + ' 5'); + }); + it('1d tensor verbose', function () { + var verbose = true; + var str = tf.zeros([4]).toString(verbose); + expect(str).toEqual('Tensor\n' + + ' dtype: float32\n' + + ' rank: 1\n' + + ' shape: [4]\n' + + ' values:\n' + + ' [0, 0, 0, 0]'); + }); + it('2d tensor verbose', function () { + var verbose = true; + var str = tf.zeros([3, 3]).toString(verbose); + expect(str).toEqual('Tensor\n' + + ' dtype: float32\n' + + ' rank: 2\n' + + ' shape: [3,3]\n' + + ' values:\n' + + ' [[0, 0, 0],\n' + + ' [0, 0, 0],\n' + + ' [0, 0, 0]]'); + }); + it('3d tensor verbose', function () { + var verbose = true; + var str = tf.zeros([3, 3, 2]).toString(verbose); + expect(str).toEqual('Tensor\n' + + ' dtype: float32\n' + + ' rank: 3\n' + + ' shape: [3,3,2]\n' + + ' values:\n' + + ' [[[0, 0],\n' + + ' [0, 0],\n' + + ' [0, 0]],\n\n' + + ' [[0, 0],\n' + + ' [0, 0],\n' + + ' [0, 0]],\n\n' + + ' [[0, 0],\n' + + ' [0, 0],\n' + + ' [0, 0]]]'); + }); + it('1d long tensor verbose', function () { + var verbose = true; + var str = tf.zeros([100]).toString(verbose); + expect(str).toEqual('Tensor\n' + + ' dtype: float32\n' + + ' rank: 1\n' + + ' shape: [100]\n' + + ' values:\n' + + ' [0, 0, 0, ..., 0, 0, 0]'); + }); + it('2d long tensor verbose', function () { + var verbose = true; + var str = tf.zeros([100, 100]).toString(verbose); + expect(str).toEqual('Tensor\n' + + ' dtype: float32\n' + + ' rank: 2\n' + + ' shape: [100,100]\n' + + ' values:\n' + + ' [[0, 0, 0, ..., 0, 0, 0],\n' + + ' [0, 0, 0, ..., 0, 0, 0],\n' + + ' [0, 0, 0, ..., 0, 0, 0],\n' + + ' ...,\n' + + ' [0, 0, 0, ..., 0, 0, 0],\n' + + ' [0, 0, 0, ..., 0, 0, 0],\n' + + ' [0, 0, 0, ..., 0, 0, 0]]'); + }); + it('2d with padding to align columns verbose', function () { + var verbose = true; + var str = tf.tensor([ + [0.8597712, 3, 0.2740789], [0.6696132, 0.4825962, 2.75], + [1.991, 0.0640865, 0.2983858] + ]).toString(verbose); + expect(str).toEqual('Tensor\n' + + ' dtype: float32\n' + + ' rank: 2\n' + + ' shape: [3,3]\n' + + ' values:\n' + + ' [[0.8597712, 3 , 0.2740789],\n' + + ' [0.6696132, 0.4825962, 2.75 ],\n' + + ' [1.9910001, 0.0640865, 0.2983858]]'); + }); + it('scalar', function () { + var str = tf.scalar(5).toString(); + expect(str).toEqual('Tensor\n' + + ' 5'); + }); + it('1d tensor', function () { + var str = tf.zeros([4]).toString(); + expect(str).toEqual('Tensor\n' + + ' [0, 0, 0, 0]'); + }); + it('2d tensor', function () { + var str = tf.zeros([3, 3]).toString(); + expect(str).toEqual('Tensor\n' + + ' [[0, 0, 0],\n' + + ' [0, 0, 0],\n' + + ' [0, 0, 0]]'); + }); + it('3d tensor', function () { + var str = tf.zeros([3, 3, 2]).toString(); + expect(str).toEqual('Tensor\n' + + ' [[[0, 0],\n' + + ' [0, 0],\n' + + ' [0, 0]],\n\n' + + ' [[0, 0],\n' + + ' [0, 0],\n' + + ' [0, 0]],\n\n' + + ' [[0, 0],\n' + + ' [0, 0],\n' + + ' [0, 0]]]'); + }); + it('1d long tensor', function () { + var str = tf.zeros([100]).toString(); + expect(str).toEqual('Tensor\n' + + ' [0, 0, 0, ..., 0, 0, 0]'); + }); + it('2d long tensor', function () { + var str = tf.zeros([100, 100]).toString(); + expect(str).toEqual('Tensor\n' + + ' [[0, 0, 0, ..., 0, 0, 0],\n' + + ' [0, 0, 0, ..., 0, 0, 0],\n' + + ' [0, 0, 0, ..., 0, 0, 0],\n' + + ' ...,\n' + + ' [0, 0, 0, ..., 0, 0, 0],\n' + + ' [0, 0, 0, ..., 0, 0, 0],\n' + + ' [0, 0, 0, ..., 0, 0, 0]]'); + }); + it('2d with padding to align columns', function () { + var str = tf.tensor([ + [0.8597712, 3, 0.2740789], [0.6696132, 0.4825962, 2.75], + [1.991, 0.0640865, 0.2983858] + ]).toString(); + expect(str).toEqual('Tensor\n' + + ' [[0.8597712, 3 , 0.2740789],\n' + + ' [0.6696132, 0.4825962, 2.75 ],\n' + + ' [1.9910001, 0.0640865, 0.2983858]]'); + }); +}); +jasmine_util_1.describeWithFlags('tensor grad', test_util_1.ALL_ENVS, function () { + it('grad with second derivative', function () { + var f = function (x) { return x.pow(tf.scalar(3, 'int32')); }; + var g = tf.grad(f); + var gg = tf.grad(g); + var x = tf.tensor1d([2, 3]); + var data = gg(x); + test_util_1.expectArraysClose(data, [12, 18]); + }); +}); +jasmine_util_1.describeWithFlags('tensor.data', test_util_1.ALL_ENVS, function () { + it('interleaving .data() and .dataSync()', function () { return __awaiter(_this, void 0, void 0, function () { + var a, b, ra, rb, _a, _b, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + a = tf.tensor1d([1, 2, 3]); + b = tf.tensor1d([4, 5, 6]); + ra = a.square().data(); + rb = b.square().dataSync(); + test_util_1.expectArraysClose(a, [1, 2, 3]); + test_util_1.expectArraysClose(b, [4, 5, 6]); + test_util_1.expectArraysClose(Array.from(rb), [16, 25, 36]); + _a = test_util_1.expectArraysClose; + _c = (_b = Array).from; + return [4, ra]; + case 1: + _a.apply(void 0, [_c.apply(_b, [_d.sent()]), [1, 4, 9]]); + return [2]; + } + }); + }); }); + it('.data() postpones disposal of tensor', function (done) { + expect(tf.memory().numTensors).toBe(0); + tf.tidy(function () { + var a = tf.scalar(5); + expect(tf.memory().numTensors).toBe(1); + a.square(); + a.data().then(function (vals) { + test_util_1.expectNumbersClose(vals[0], 5); + }); + }); + setTimeout(function () { + expect(tf.memory().numTensors).toBe(0); + done(); + }); + }); + it('calling .data() twice works (2 subscribers to a single read)', function (done) { + tf.tidy(function () { + var a = tf.scalar(5); + a.square(); + a.data().then(function (vals) { + test_util_1.expectNumbersClose(vals[0], 5); + }); + a.data() + .then(function (vals) { + test_util_1.expectNumbersClose(vals[0], 5); + }) + .then(done); + }); + }); +}); +jasmine_util_1.describeWithFlags('x instanceof Tensor', test_util_1.ALL_ENVS, function () { + it('x: Tensor', function () { + var t = tf.scalar(1); + expect(t instanceof tensor_1.Tensor).toBe(true); + }); + it('x: Tensor-like', function () { + var t = { shape: [2], dtype: 'float32' }; + expect(t instanceof tensor_1.Tensor).toBe(true); + }); + it('x: other object, fails', function () { + var t = { something: 'else' }; + expect(t instanceof tensor_1.Tensor).toBe(false); + }); + it('x: undefined or null, fails', function () { + expect(undefined instanceof tensor_1.Tensor).toBe(false); + expect(null instanceof tensor_1.Tensor).toBe(false); + }); +}); +//# sourceMappingURL=tensor_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/tensor_test.js.map new file mode 100644 index 0000000..11d13d1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tensor_test.js","sourceRoot":"","sources":["../src/tensor_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBA4sCA;;AA5sCA,4BAA8B;AAC9B,+CAAiD;AACjD,mCAAgF;AAChF,yCAA+F;AAC/F,iCAAoC;AAEpC,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,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,gCAAiB,CAAC,qBAAqB,EAAE,oBAAQ,EAAE;IACjD,EAAE,CAAC,WAAW,EAAE;QACd,IAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,CAAC,CAAC,YAAY,eAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE;QACnB,IAAM,CAAC,GAAG,EAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC;QACzC,MAAM,CAAC,CAAC,YAAY,eAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE;QAC3B,IAAM,CAAC,GAAG,EAAC,SAAS,EAAE,MAAM,EAAC,CAAC;QAC9B,MAAM,CAAC,CAAC,YAAY,eAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE;QAEhC,MAAM,CAAE,SAAiB,YAAY,eAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEzD,MAAM,CAAE,IAAY,YAAY,eAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts new file mode 100644 index 0000000..56070b9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts @@ -0,0 +1,19 @@ +import { Tensor, Variable } from './tensor'; +import { DataType } from './types'; +export declare type NamedTensorMap = { + [name: string]: Tensor; +}; +export declare type NamedVariableMap = { + [name: string]: Variable; +}; +export declare type TensorContainer = void | Tensor | string | number | boolean | TensorContainerObject | TensorContainerArray; +export interface TensorContainerObject { + [x: string]: TensorContainer; +} +export interface TensorContainerArray extends Array { +} +export interface TensorInfo { + name: string; + shape?: number[]; + dtype: DataType; +} diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_types.js b/node_modules/@tensorflow/tfjs-core/dist/tensor_types.js new file mode 100644 index 0000000..6c7dba7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=tensor_types.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_types.js.map b/node_modules/@tensorflow/tfjs-core/dist/tensor_types.js.map new file mode 100644 index 0000000..f832df6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tensor_types.js","sourceRoot":"","sources":["../src/tensor_types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts new file mode 100644 index 0000000..301c2cb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts @@ -0,0 +1,7 @@ +import { Tensor } from './tensor'; +import { NamedTensorMap, TensorContainer } from './tensor_types'; +export declare function assertTypesMatch(a: Tensor, b: Tensor): void; +export declare function isTensorInList(tensor: Tensor, tensorList: Tensor[]): boolean; +export declare function flattenNameArrayMap(nameArrayMap: Tensor | NamedTensorMap, keys?: string[]): Tensor[]; +export declare function unflattenToNameArrayMap(keys: string[], flatArrays: Tensor[]): NamedTensorMap; +export declare function getTensorsInContainer(result: TensorContainer): Tensor[]; diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_util.js b/node_modules/@tensorflow/tfjs-core/dist/tensor_util.js new file mode 100644 index 0000000..2941b92 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_util.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tensor_1 = require("./tensor"); +var util_1 = require("./util"); +function assertTypesMatch(a, b) { + util_1.assert(a.dtype === b.dtype, " The dtypes of the first(" + a.dtype + ") and" + + (" second(" + b.dtype + ") input must match")); +} +exports.assertTypesMatch = assertTypesMatch; +function isTensorInList(tensor, tensorList) { + for (var i = 0; i < tensorList.length; i++) { + if (tensorList[i].id === tensor.id) { + return true; + } + } + return false; +} +exports.isTensorInList = isTensorInList; +function flattenNameArrayMap(nameArrayMap, keys) { + var xs = []; + if (nameArrayMap instanceof tensor_1.Tensor) { + xs.push(nameArrayMap); + } + else { + var xMap = nameArrayMap; + for (var i = 0; i < keys.length; i++) { + xs.push(xMap[keys[i]]); + } + } + return xs; +} +exports.flattenNameArrayMap = flattenNameArrayMap; +function unflattenToNameArrayMap(keys, flatArrays) { + if (keys.length !== flatArrays.length) { + throw new Error("Cannot unflatten Tensor[], keys and arrays are not of same length."); + } + var result = {}; + for (var i = 0; i < keys.length; i++) { + result[keys[i]] = flatArrays[i]; + } + return result; +} +exports.unflattenToNameArrayMap = unflattenToNameArrayMap; +function getTensorsInContainer(result) { + var list = []; + var seen = new Set(); + walkTensorContainer(result, list, seen); + return list; +} +exports.getTensorsInContainer = getTensorsInContainer; +function walkTensorContainer(container, list, seen) { + if (container == null) { + return; + } + if (container instanceof tensor_1.Tensor) { + list.push(container); + return; + } + if (!isIterable(container)) { + return; + } + var iterable = container; + for (var k in iterable) { + var val = iterable[k]; + if (!seen.has(val)) { + seen.add(val); + walkTensorContainer(val, list, seen); + } + } +} +function isIterable(obj) { + return Array.isArray(obj) || typeof obj === 'object'; +} +//# sourceMappingURL=tensor_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/tensor_util.js.map new file mode 100644 index 0000000..de5ef6f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tensor_util.js","sourceRoot":"","sources":["../src/tensor_util.ts"],"names":[],"mappings":";;AAiBA,mCAAgC;AAEhC,+BAA8B;AAE9B,0BAAiC,CAAS,EAAE,CAAS;IACnD,aAAM,CACF,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,EACnB,8BAA4B,CAAC,CAAC,KAAK,UAAO;SACtC,aAAW,CAAC,CAAC,KAAK,uBAAoB,CAAA,CAAC,CAAC;AAClD,CAAC;AALD,4CAKC;AAED,wBAA+B,MAAc,EAAE,UAAoB;IACjE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,EAAE;YAClC,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAPD,wCAOC;AAED,6BACI,YAAmC,EAAE,IAAe;IACtD,IAAM,EAAE,GAAa,EAAE,CAAC;IACxB,IAAI,YAAY,YAAY,eAAM,EAAE;QAClC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACvB;SAAM;QACL,IAAM,IAAI,GAAG,YAAyC,CAAC;QACvD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACxB;KACF;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAZD,kDAYC;AAED,iCACI,IAAc,EAAE,UAAoB;IACtC,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,EAAE;QACr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,CAAC;AACvD,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.d.ts new file mode 100644 index 0000000..8bfc6bd --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.d.ts @@ -0,0 +1,4 @@ +import { Tensor } from './tensor'; +import { DataType, TensorLike } from './types'; +export declare function convertToTensor(x: T | TensorLike, argName: string, functionName: string, dtype?: DataType): T; +export declare function convertToTensorArray(arg: T[] | TensorLike[], argName: string, functionName: string): T[]; diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js new file mode 100644 index 0000000..cdad643 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("./environment"); +var tensor_1 = require("./tensor"); +var util_1 = require("./util"); +function convertToTensor(x, argName, functionName, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + dtype = dtype || 'float32'; + if (x instanceof tensor_1.Tensor) { + return x; + } + if (!util_1.isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' && + typeof x !== 'boolean') { + throw new Error("Argument '" + argName + "' passed to '" + functionName + "' must be a " + + ("Tensor or TensorLike, but got " + x.constructor.name)); + } + var inferredShape = util_1.inferShape(x); + if (!util_1.isTypedArray(x) && !Array.isArray(x)) { + x = [x]; + } + return tensor_1.Tensor.make(inferredShape, { values: util_1.toTypedArray(x, dtype, environment_1.ENV.get('DEBUG')) }, dtype); +} +exports.convertToTensor = convertToTensor; +function convertToTensorArray(arg, argName, functionName) { + if (!Array.isArray(arg)) { + throw new Error("Argument " + argName + " passed to " + functionName + " must be a " + + '`Tensor[]` or `TensorLike[]`'); + } + var tensors = arg; + return tensors.map(function (t, i) { return convertToTensor(t, argName + "[" + i + "]", functionName); }); +} +exports.convertToTensorArray = convertToTensorArray; +//# sourceMappingURL=tensor_util_env.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js.map b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js.map new file mode 100644 index 0000000..b13580c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tensor_util_env.js","sourceRoot":"","sources":["../src/tensor_util_env.ts"],"names":[],"mappings":";;AAiBA,6CAAkC;AAClC,mCAAgC;AAEhC,+BAA8D;AAE9D,yBACI,CAAe,EAAE,OAAe,EAAE,YAAoB,EACtD,KAA2B;IAA3B,sBAAA,EAAA,iBAA2B;IAC7B,KAAK,GAAG,KAAK,IAAI,SAAS,CAAC;IAC3B,IAAI,CAAC,YAAY,eAAM,EAAE;QACvB,OAAO,CAAC,CAAC;KACV;IACD,IAAI,CAAC,mBAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAC9D,OAAO,CAAC,KAAK,SAAS,EAAE;QAC1B,MAAM,IAAI,KAAK,CACX,eAAa,OAAO,qBAAgB,YAAY,iBAAc;aAC9D,mCAAiC,CAAC,CAAC,WAAW,CAAC,IAAM,CAAA,CAAC,CAAC;KAC5D;IACD,IAAM,aAAa,GAAG,iBAAU,CAAC,CAAC,CAAC,CAAC;IACpC,IAAI,CAAC,mBAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACzC,CAAC,GAAG,CAAC,CAAC,CAAa,CAAC;KACrB;IACD,OAAO,eAAM,CAAC,IAAI,CACd,aAAa,EACb,EAAC,MAAM,EAAE,mBAAY,CAAC,CAAwB,EAAE,KAAK,EAAE,iBAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAC,EACzE,KAAK,CAAC,CAAC;AACb,CAAC;AArBD,0CAqBC;AAED,8BACI,GAAqB,EAAE,OAAe,EAAE,YAAoB;IAC9D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACvB,MAAM,IAAI,KAAK,CACX,cAAY,OAAO,mBAAc,YAAY,gBAAa;YAC1D,8BAA8B,CAAC,CAAC;KACrC;IACD,IAAM,OAAO,GAAG,GAAU,CAAC;IAC3B,OAAO,OAAO,CAAC,GAAG,CACd,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,eAAe,CAAC,CAAC,EAAK,OAAO,SAAI,CAAC,MAAG,EAAE,YAAY,CAAC,EAApD,CAAoD,CAAC,CAAC;AACtE,CAAC;AAVD,oDAUC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_test.js new file mode 100644 index 0000000..0bd2034 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_test.js @@ -0,0 +1,159 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var jasmine_util_1 = require("./jasmine_util"); +var tensor_util_1 = require("./tensor_util"); +var tensor_util_env_1 = require("./tensor_util_env"); +var test_util_1 = require("./test_util"); +describe('tensor_util.isTensorInList', function () { + it('not in list', function () { + var a = tf.scalar(1); + var list = [tf.scalar(1), tf.tensor1d([1, 2, 3])]; + expect(tensor_util_1.isTensorInList(a, list)).toBe(false); + }); + it('in list', function () { + var a = tf.scalar(1); + var list = [tf.scalar(2), tf.tensor1d([1, 2, 3]), a]; + expect(tensor_util_1.isTensorInList(a, list)).toBe(true); + }); +}); +describe('tensor_util.flattenNameArrayMap', function () { + it('basic', function () { + var a = tf.scalar(1); + var b = tf.scalar(3); + var c = tf.tensor1d([1, 2, 3]); + var map = { a: a, b: b, c: c }; + expect(tensor_util_1.flattenNameArrayMap(map, Object.keys(map))).toEqual([a, b, c]); + }); +}); +describe('tensor_util.unflattenToNameArrayMap', function () { + it('basic', function () { + var a = tf.scalar(1); + var b = tf.scalar(3); + var c = tf.tensor1d([1, 2, 3]); + expect(tensor_util_1.unflattenToNameArrayMap(['a', 'b', 'c'], [ + a, b, c + ])).toEqual({ a: a, b: b, c: c }); + }); +}); +describe('getTensorsInContainer', function () { + it('null input returns empty tensor', function () { + var results = tensor_util_1.getTensorsInContainer(null); + expect(results).toEqual([]); + }); + it('tensor input returns one element tensor', function () { + var x = tf.scalar(1); + var results = tensor_util_1.getTensorsInContainer(x); + expect(results).toEqual([x]); + }); + it('name tensor map returns flattened tensor', function () { + var x1 = tf.scalar(1); + var x2 = tf.scalar(3); + var x3 = tf.scalar(4); + var results = tensor_util_1.getTensorsInContainer({ x1: x1, x2: x2, x3: x3 }); + expect(results).toEqual([x1, x2, x3]); + }); + it('can extract from arbitrary depth', function () { + var container = [ + { x: tf.scalar(1), y: tf.scalar(2) }, + [[[tf.scalar(3)]], { z: tf.scalar(4) }] + ]; + var results = tensor_util_1.getTensorsInContainer(container); + expect(results.length).toBe(4); + }); + it('works with loops in container', function () { + var container = [tf.scalar(1), tf.scalar(2), [tf.scalar(3)]]; + var innerContainer = [container]; + container.push(innerContainer); + var results = tensor_util_1.getTensorsInContainer(container); + expect(results.length).toBe(3); + }); +}); +jasmine_util_1.describeWithFlags('convertToTensor', test_util_1.ALL_ENVS, function () { + it('primitive integer, NaN converts to zero, no error thrown', function () { + var a = function () { return tensor_util_env_1.convertToTensor(NaN, 'a', 'test', 'int32'); }; + expect(a).not.toThrowError(); + var b = tensor_util_env_1.convertToTensor(NaN, 'b', 'test', 'int32'); + expect(b.rank).toBe(0); + expect(b.dtype).toBe('int32'); + test_util_1.expectNumbersClose(b.get(), 0); + }); + it('primitive number', function () { + var a = tensor_util_env_1.convertToTensor(3, 'a', 'test'); + expect(a.rank).toBe(0); + expect(a.dtype).toBe('float32'); + test_util_1.expectNumbersClose(a.get(), 3); + }); + it('primitive integer, NaN converts to zero', function () { + var a = tensor_util_env_1.convertToTensor(NaN, 'a', 'test', 'int32'); + expect(a.rank).toBe(0); + expect(a.dtype).toBe('int32'); + test_util_1.expectNumbersClose(a.get(), 0); + }); + it('primitive boolean, parsed as float', function () { + var a = tensor_util_env_1.convertToTensor(true, 'a', 'test'); + expect(a.rank).toBe(0); + expect(a.dtype).toBe('float32'); + test_util_1.expectNumbersClose(a.get(), 1); + }); + it('primitive boolean, parsed as bool', function () { + var a = tensor_util_env_1.convertToTensor(true, 'a', 'test', 'bool'); + expect(a.rank).toBe(0); + expect(a.dtype).toBe('bool'); + expect(a.get()).toBe(1); + }); + it('array1d', function () { + var a = tensor_util_env_1.convertToTensor([1, 2, 3], 'a', 'test'); + expect(a.rank).toBe(1); + expect(a.dtype).toBe('float32'); + expect(a.shape).toEqual([3]); + test_util_1.expectArraysClose(a, [1, 2, 3]); + }); + it('array2d', function () { + var a = tensor_util_env_1.convertToTensor([[1], [2], [3]], 'a', 'test'); + expect(a.rank).toBe(2); + expect(a.shape).toEqual([3, 1]); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [1, 2, 3]); + }); + it('array3d', function () { + var a = tensor_util_env_1.convertToTensor([[[1], [2]], [[3], [4]]], 'a', 'test'); + expect(a.rank).toBe(3); + expect(a.shape).toEqual([2, 2, 1]); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [1, 2, 3, 4]); + }); + it('array4d', function () { + var a = tensor_util_env_1.convertToTensor([[[[1]], [[2]]], [[[3]], [[4]]]], 'a', 'test'); + expect(a.rank).toBe(4); + expect(a.shape).toEqual([2, 2, 1, 1]); + expect(a.dtype).toBe('float32'); + test_util_1.expectArraysClose(a, [1, 2, 3, 4]); + }); + it('passing a tensor returns the tensor itself', function () { + var s = tf.scalar(3); + var res = tensor_util_env_1.convertToTensor(s, 'a', 'test'); + expect(res).toBe(s); + }); + it('passing a tensor with casting returns the tensor itself', function () { + var s = tf.scalar(3); + var res = tensor_util_env_1.convertToTensor(s, 'a', 'test', 'bool'); + expect(res).toBe(s); + }); + it('fails to convert a dict to tensor', function () { + expect(function () { return tensor_util_env_1.convertToTensor({}, 'a', 'test'); }) + .toThrowError('Argument \'a\' passed to \'test\' must be a Tensor ' + + 'or TensorLike, but got Object'); + }); + it('fails to convert a string to tensor', function () { + expect(function () { return tensor_util_env_1.convertToTensor('asdf', 'a', 'test'); }) + .toThrowError('Argument \'a\' passed to \'test\' must be a Tensor ' + + 'or TensorLike, but got String'); + }); + it('fails to convert a non-valid shape array to tensor', function () { + var a = [[1, 2], [3], [4, 5, 6]]; + expect(function () { return tensor_util_env_1.convertToTensor(a, 'a', 'test'); }) + .toThrowError('Element arr[1] should have 2 elements, but has 1 elements'); + }); +}); +//# sourceMappingURL=tensor_util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tensor_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_test.js.map new file mode 100644 index 0000000..095cbb1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tensor_util_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tensor_util_test.js","sourceRoot":"","sources":["../src/tensor_util_test.ts"],"names":[],"mappings":";;AAiBA,4BAA8B;AAC9B,+CAAiD;AAGjD,6CAAkH;AAClH,qDAAkD;AAClD,yCAA4E;AAE5E,QAAQ,CAAC,4BAA4B,EAAE;IACrC,EAAE,CAAC,aAAa,EAAE;QAChB,IAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvB,IAAM,IAAI,GAAa,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAA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AAC;QACpD,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE;QAEtC,MAAM,CAAC,cAAM,OAAA,iCAAe,CAAC,EAAS,EAAE,GAAG,EAAE,MAAM,CAAC,EAAvC,CAAuC,CAAC;aAChD,YAAY,CACT,qDAAqD;YACrD,+BAA+B,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE;QAExC,MAAM,CAAC,cAAM,OAAA,iCAAe,CAAC,MAAa,EAAE,GAAG,EAAE,MAAM,CAAC,EAA3C,CAA2C,CAAC;aACpD,YAAY,CACT,qDAAqD;YACrD,+BAA+B,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE;QACvD,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,cAAM,OAAA,iCAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAA/B,CAA+B,CAAC;aACxC,YAAY,CACT,2DAA2D,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/test_env.d.ts b/node_modules/@tensorflow/tfjs-core/dist/test_env.d.ts new file mode 100644 index 0000000..5ff8814 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/test_env.d.ts @@ -0,0 +1,2 @@ +import './kernels/backend_cpu'; +import './kernels/backend_webgl'; diff --git a/node_modules/@tensorflow/tfjs-core/dist/test_env.js b/node_modules/@tensorflow/tfjs-core/dist/test_env.js new file mode 100644 index 0000000..f9cf81f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/test_env.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +require("./kernels/backend_cpu"); +require("./kernels/backend_webgl"); +//# sourceMappingURL=test_env.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/test_env.js.map b/node_modules/@tensorflow/tfjs-core/dist/test_env.js.map new file mode 100644 index 0000000..ba69991 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/test_env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_env.js","sourceRoot":"","sources":["../src/test_env.ts"],"names":[],"mappings":";;AAiBA,iCAA+B;AAC/B,mCAAiC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/test_node.d.ts b/node_modules/@tensorflow/tfjs-core/dist/test_node.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/test_node.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/test_node.js b/node_modules/@tensorflow/tfjs-core/dist/test_node.js new file mode 100644 index 0000000..2c47718 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/test_node.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var jasmine_util_1 = require("./jasmine_util"); +var backend_cpu_1 = require("./kernels/backend_cpu"); +var jasmine = require('jasmine'); +process.on('unhandledRejection', function (e) { throw e; }); +jasmine_util_1.setTestEnvs([{ name: 'node', factory: function () { return new backend_cpu_1.MathBackendCPU(); }, features: {} }]); +var runner = new jasmine(); +runner.loadConfig({ spec_files: ['src/**/*_test.ts'], random: false }); +runner.execute(); +//# sourceMappingURL=test_node.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/test_node.js.map b/node_modules/@tensorflow/tfjs-core/dist/test_node.js.map new file mode 100644 index 0000000..9519092 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/test_node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_node.js","sourceRoot":"","sources":["../src/test_node.ts"],"names":[],"mappings":";;AAiBA,+CAA2C;AAC3C,qDAAqD;AAErD,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnC,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAA,CAAC,IAAM,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpD,0BAAW,CACP,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAM,OAAA,IAAI,4BAAc,EAAE,EAApB,CAAoB,EAAE,QAAQ,EAAE,EAAE,EAAC,CAAC,CAAC,CAAC;AAEzE,IAAM,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;AAC7B,MAAM,CAAC,UAAU,CAAC,EAAC,UAAU,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC;AACrE,MAAM,CAAC,OAAO,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts new file mode 100644 index 0000000..a12428c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts @@ -0,0 +1,19 @@ +import { Features } from './environment_util'; +import { Tensor } from './tensor'; +import { TypedArray } from './types'; +export declare const WEBGL_ENVS: Features; +export declare const NODE_ENVS: Features; +export declare const CHROME_ENVS: Features; +export declare const BROWSER_ENVS: Features; +export declare const CPU_ENVS: Features; +export declare const ALL_ENVS: Features; +export declare function expectArraysClose(actual: Tensor | TypedArray | number[], expected: Tensor | TypedArray | number[] | boolean[], epsilon?: number): void; +export interface DoneFn { + (): void; + fail: (message?: Error | string) => void; +} +export declare function expectPromiseToFail(fn: () => Promise<{}>, done: DoneFn): void; +export declare function expectArraysEqual(actual: Tensor | TypedArray | number[], expected: Tensor | TypedArray | number[] | boolean[]): void; +export declare function expectNumbersClose(a: number, e: number, epsilon?: number): void; +export declare function expectValuesInRange(actual: Tensor | TypedArray | number[], low: number, high: number): void; +export declare function expectArrayBuffersEqual(actual: ArrayBuffer, expected: ArrayBuffer): void; diff --git a/node_modules/@tensorflow/tfjs-core/dist/test_util.js b/node_modules/@tensorflow/tfjs-core/dist/test_util.js new file mode 100644 index 0000000..69c5983 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/test_util.js @@ -0,0 +1,120 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("./environment"); +var tensor_1 = require("./tensor"); +var util = require("./util"); +exports.WEBGL_ENVS = { + 'HAS_WEBGL': true +}; +exports.NODE_ENVS = { + 'IS_NODE': true +}; +exports.CHROME_ENVS = { + 'IS_CHROME': true +}; +exports.BROWSER_ENVS = { + 'IS_BROWSER': true +}; +exports.CPU_ENVS = { + 'HAS_WEBGL': false +}; +exports.ALL_ENVS = {}; +function expectArraysClose(actual, expected, epsilon) { + if (epsilon == null) { + epsilon = environment_1.ENV.get('TEST_EPSILON'); + } + if (!(actual instanceof tensor_1.Tensor) && !(expected instanceof tensor_1.Tensor)) { + var aType = actual.constructor.name; + var bType = expected.constructor.name; + if (aType !== bType) { + throw new Error("Arrays are of different type actual: " + aType + " " + + ("vs expected: " + bType)); + } + } + else if (actual instanceof tensor_1.Tensor && expected instanceof tensor_1.Tensor) { + if (actual.dtype !== expected.dtype) { + throw new Error("Arrays are of different type actual: " + actual.dtype + " " + + ("vs expected: " + expected.dtype + ".")); + } + if (!util.arraysEqual(actual.shape, expected.shape)) { + throw new Error("Arrays are of different shape actual: " + actual.shape + " " + + ("vs expected: " + expected.shape + ".")); + } + } + var actualValues; + var expectedValues; + if (actual instanceof tensor_1.Tensor) { + actualValues = actual.dataSync(); + } + else { + actualValues = actual; + } + if (expected instanceof tensor_1.Tensor) { + expectedValues = expected.dataSync(); + } + else { + expectedValues = expected; + } + if (actualValues.length !== expectedValues.length) { + throw new Error("Arrays have different lengths actual: " + actualValues.length + " vs " + + ("expected: " + expectedValues.length + ".\n") + + ("Actual: " + actualValues + ".\n") + + ("Expected: " + expectedValues + ".")); + } + for (var i = 0; i < expectedValues.length; ++i) { + var a = actualValues[i]; + var e = expectedValues[i]; + if (!areClose(a, Number(e), epsilon)) { + throw new Error("Arrays differ: actual[" + i + "] = " + a + ", expected[" + i + "] = " + e + ".\n" + + ("Actual: " + actualValues + ".\n") + + ("Expected: " + expectedValues + ".")); + } + } +} +exports.expectArraysClose = expectArraysClose; +function expectPromiseToFail(fn, done) { + fn().then(function () { return done.fail(); }, function () { return done(); }); +} +exports.expectPromiseToFail = expectPromiseToFail; +function expectArraysEqual(actual, expected) { + return expectArraysClose(actual, expected, 0); +} +exports.expectArraysEqual = expectArraysEqual; +function expectNumbersClose(a, e, epsilon) { + if (epsilon == null) { + epsilon = environment_1.ENV.get('TEST_EPSILON'); + } + if (!areClose(a, e, epsilon)) { + throw new Error("Numbers differ: actual === " + a + ", expected === " + e); + } +} +exports.expectNumbersClose = expectNumbersClose; +function areClose(a, e, epsilon) { + if (isNaN(a) && isNaN(e)) { + return true; + } + if (isNaN(a) || isNaN(e) || Math.abs(a - e) > epsilon) { + return false; + } + return true; +} +function expectValuesInRange(actual, low, high) { + var actualVals; + if (actual instanceof tensor_1.Tensor) { + actualVals = actual.dataSync(); + } + else { + actualVals = actual; + } + for (var i = 0; i < actualVals.length; i++) { + if (actualVals[i] < low || actualVals[i] > high) { + throw new Error("Value out of range:" + actualVals[i] + " low: " + low + ", high: " + high); + } + } +} +exports.expectValuesInRange = expectValuesInRange; +function expectArrayBuffersEqual(actual, expected) { + expect(new Float32Array(actual)).toEqual(new Float32Array(expected)); +} +exports.expectArrayBuffersEqual = expectArrayBuffersEqual; +//# sourceMappingURL=test_util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/test_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/test_util.js.map new file mode 100644 index 0000000..0cc4e11 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/test_util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_util.js","sourceRoot":"","sources":["../src/test_util.ts"],"names":[],"mappings":";;AAiBA,6CAAkC;AAElC,mCAAgC;AAEhC,6BAA+B;AAGlB,QAAA,UAAU,GAAa;IAClC,WAAW,EAAE,IAAI;CAClB,CAAC;AACW,QAAA,SAAS,GAAa;IACjC,SAAS,EAAE,IAAI;CAChB,CAAC;AACW,QAAA,WAAW,GAAa;IACnC,WAAW,EAAE,IAAI;CAClB,CAAC;AACW,QAAA,YAAY,GAAa;IACpC,YAAY,EAAE,IAAI;CACnB,CAAC;AACW,QAAA,QAAQ,GAAa;IAChC,WAAW,EAAE,KAAK;CACnB,CAAC;AACW,QAAA,QAAQ,GAAa,EAAE,CAAC;AAErC,2BACI,MAAkC,EAClC,QAA8C,EAAE,OAAgB;IAClE,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,GAAG,iBAAG,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;KACnC;IACD,IAAI,CAAC,CAAC,MAAM,YAAY,eAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,YAAY,eAAM,CAAC,EAAE;QAChE,IAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;QACtC,IAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;QAExC,IAAI,KAAK,KAAK,KAAK,EAAE;YACnB,MAAM,IAAI,KAAK,CACX,0CAAwC,KAAK,MAAG;iBAChD,kBAAgB,KAAO,CAAA,CAAC,CAAC;SAC9B;KACF;SAAM,IAAI,MAAM,YAAY,eAAM,IAAI,QAAQ,YAAY,eAAM,EAAE;QACjE,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,EAAE;YACnC,MAAM,IAAI,KAAK,CACX,0CAAwC,MAAM,CAAC,KAAK,MAAG;iBACvD,kBAAgB,QAAQ,CAAC,KAAK,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;KAChC;SAAM;QACL,UAAU,GAAG,MAAM,CAAC;KACrB;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE;YAC/C,MAAM,IAAI,KAAK,CACX,wBAAsB,UAAU,CAAC,CAAC,CAAC,cAAS,GAAG,gBAAW,IAAM,CAAC,CAAC;SACvE;KACF;AACH,CAAC;AAdD,kDAcC;AAED,iCACI,MAAmB,EAAE,QAAqB;IAG5C,MAAM,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvE,CAAC;AALD,0DAKC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js b/node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js new file mode 100644 index 0000000..39e54ef --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0;)r=Math.random()*t|0,n=e[--t],e[t]=e[r],e[r]=n}function clamp(e,t,n){return Math.max(e,Math.min(t,n))}function randUniform(e,t){return Math.random()*(t-e)+e}function distSquared(e,t){for(var n=0,r=0;r0,function(){return"Element arr["+n.join("][")+"] should be a primitive, but is an array of "+e.length+" elements"}),assert(e.length===t[0],function(){return"Element arr["+n.join("][")+"] should have "+t[0]+" elements, but has "+e.length+" elements"});for(var r=t.slice(1),o=0;o1;--t)if(e%t==0)return[t,e/t];return[1,e]}function createShuffledIndices(e){for(var t=new Uint32Array(e),n=0;n=n?o():setTimeout(i,s)}};i()})}function inferFromImplicitShape(e,t){for(var n=1,r=-1,o=0;o0)n*=e[o];else if(-1===e[o]){if(-1!==r)throw Error("Shapes can only have 1 implicit size. Found - 1 at dim "+r+" and dim "+o);r=o}else if(e[o]<=0)throw Error("Shapes can not be <= 0. Found "+e[o]+" at dim "+o);if(-1===r){if(t>0&&t!==n)throw Error("Size("+t+") must match the product of shape "+e);return e}if(t%n!=0)throw Error("The implicit shape can't be a fractional number. Got "+t+" / "+n);var a=e.slice();return a[r]=t/n,a}function squeezeShape(e,t){for(var n=[],r=[],o=0,a=0;a1)throw new Error("Can't squeeze axis "+a+" since its dim '"+e[a]+"' is not 1");(null==t[o]||t[o]>a)&&1===e[a]&&(n.push(e[a]),r.push(a)),t[o]<=a&&o++}e[a]>1&&(n.push(e[a]),r.push(a))}return{newShape:n,keptDims:r}}function getTypedArrayFromDType(e,t){var n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else{if("bool"!==e)throw new Error("Unknown data type "+e);n=new Uint8Array(t)}return n}function checkComputationForNaN(e,t,n){if("float32"===t)for(var r=0;r=0;--r)n[r]=n[r+1]*e[r+1];return n}function toTypedArray(e,t,n){return noConversionNeeded(e,t)?e:(Array.isArray(e)&&(e=flatten(e)),copyTypedArray(e,t,n))}function noConversionNeeded(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}function makeOnesTypedArray(e,t){for(var n=makeZerosTypedArray(e,t),r=0;r=0;a--){i=(m=e[a]).inputs;var h=[];h.push(m.output);for(c=0;c=0;n--){var r=t[n],o=e[r.output.id];if(null==r.gradient)throw new Error("Cannot compute gradient: gradient function not found for "+r.name+".");var a=r.gradient(o);for(var i in r.inputs){if(!(i in a))throw new Error("Cannot backprop through input "+i+". Available gradients found: "+Object.keys(a)+".");var s=a[i](),u=r.inputs[i];if(!arraysEqual(s.shape,u.shape))throw new Error("Error in gradient for op "+r.name+". The gradient of input '"+i+"' has shape '"+s.shape+"', which does not match the shape of the input '"+u.shape+"'");if(null==e[u.id])e[u.id]=s;else{var l=e[u.id];e[u.id]=l.add(s),l.dispose()}}}}var FORMAT_LIMIT_NUM_VALS=20,FORMAT_NUM_FIRST_LAST_VALS=3,FORMAT_NUM_SIG_DIGITS=7;function tensorToString(e,t,n,r){var o=computeStrides(t),a=computeMaxSizePerColumn(e,t,o),i=t.length,s=subTensorToString(e,t,o,a),u=["Tensor"];return r&&(u.push(" dtype: "+n),u.push(" rank: "+i),u.push(" shape: ["+t+"]"),u.push(" values:")),u.push(s.map(function(e){return" "+e}).join("\n")),u.join("\n")}function computeMaxSizePerColumn(e,t,n){var r=sizeFromShape(t),o=n[n.length-1],a=new Array(o).fill(0);if(t.length>1)for(var i=0;iFORMAT_LIMIT_NUM_VALS){var s=Array.from(e.subarray(0,FORMAT_NUM_FIRST_LAST_VALS)),u=Array.from(e.subarray(a-FORMAT_NUM_FIRST_LAST_VALS,a));return["["+s.map(function(e,t){return valToString(e,r[t])}).join(", ")+", ..., "+u.map(function(e,t){return valToString(e,r[a-FORMAT_NUM_FIRST_LAST_VALS+t])}).join(", ")+"]"]}return["["+Array.from(e).map(function(e,t){return valToString(e,r[t])}).join(", ")+"]"]}var l=t.slice(1),c=n.slice(1),p=n[0],d=[];if(a>FORMAT_LIMIT_NUM_VALS){for(var h=0;h {...}) to avoid memory leaks.");return this.keepTensors.add(e.id),e},e.prototype.startScope=function(e,t){void 0===t&&(t=!1),t&&0===this.gradientScopeCount&&(this.activeTape=[]),t&&this.gradientScopeCount++;var n={track:[],name:"unnamed scope"};e&&(n.name=e),this.scopeStack.push(n),this.activeScope=n},e.prototype.endScope=function(e,t){var n=this;void 0===t&&(t=!1),t&&(this.gradientScopeCount--,0===this.gradientScopeCount&&(this.activeTape=null));var r=new Set(this.keepTensors),o=getTensorsInContainer(e);o.forEach(function(e){return r.add(e.id)});for(var a=0;a0,"gradients() received an empty list of xs."),this.tidy("gradients",function(){var a=e();assert(a instanceof Tensor,"The result y returned by f() must be a tensor.");var i=getFilteredNodesXToY(o.activeTape,t,a);if(!r&&0===i.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");var s={};return s[a.id]=null==n?ones(a.shape):n,backpropagateGradients(s,i),{value:a,grads:t.map(function(e){return s[e.id]})}},!0)},e.prototype.customGrad=function(e){var t=this;return assert(isFunction(e),"The f passed in customGrad(f) must be a function."),function(){for(var n,r,o=[],a=0;a {op();...}); to avoid memory leaks.");return this.activeScope.track.push(e),e},e}();function ones(e){var t=makeOnesTypedArray(sizeFromShape(e),"float32");return Tensor.make(e,{values:t})}!function(e){e[e.NUMBER=0]="NUMBER",e[e.BOOLEAN=1]="BOOLEAN",e[e.STRING=2]="STRING"}(Type||(Type={}));var URL_PROPERTIES=[{name:"DEBUG",type:Type.BOOLEAN},{name:"IS_BROWSER",type:Type.BOOLEAN},{name:"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",type:Type.NUMBER},{name:"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",type:Type.BOOLEAN},{name:"WEBGL_VERSION",type:Type.NUMBER},{name:"WEBGL_RENDER_FLOAT32_ENABLED",type:Type.BOOLEAN},{name:"WEBGL_DOWNLOAD_FLOAT_ENABLED",type:Type.BOOLEAN},{name:"WEBGL_FENCE_API_ENABLED",type:Type.BOOLEAN},{name:"BACKEND",type:Type.STRING}];function isWebGLVersionEnabled(e,t){var n;try{n=getWebGLRenderingContext(e,t)}catch(e){return!1}return null!=n&&(loseContext(n),!0)}function getWebGLDisjointQueryTimerVersion(e,t){if(0===e)return 0;var n,r=getWebGLRenderingContext(e,t);return n=hasExtension(r,"EXT_disjoint_timer_query_webgl2")&&2===e?2:hasExtension(r,"EXT_disjoint_timer_query")?1:0,null!=r&&loseContext(r),n}function isRenderToFloatTextureEnabled(e,t){if(0===e)return!1;var n=getWebGLRenderingContext(e,t);if(1===e){if(!hasExtension(n,"OES_texture_float"))return!1}else if(!hasExtension(n,"EXT_color_buffer_float"))return!1;createFloatTextureAndBindToFramebuffer(n,e);var r=n.checkFramebufferStatus(n.FRAMEBUFFER)===n.FRAMEBUFFER_COMPLETE;return loseContext(n),r}function isDownloadFloatTextureEnabled(e,t){if(0===e)return!1;var n=getWebGLRenderingContext(e,t);if(1===e){if(!hasExtension(n,"OES_texture_float"))return!1}else if(!hasExtension(n,"EXT_color_buffer_float"))return!1;createFloatTextureAndBindToFramebuffer(n,e),n.readPixels(0,0,1,1,n.RGBA,n.FLOAT,new Float32Array(4));var r=n.getError()===n.NO_ERROR;return loseContext(n),r}function isWebGLFenceEnabled(e,t){if(2!==e)return!1;var n=getWebGLRenderingContext(e,t),r=null!=n.fenceSync;return loseContext(n),r}function isChrome(){return"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}var TENSORFLOWJS_FLAGS_PREFIX="tfjsflags";function getFeaturesFromURL(){var e={};if("undefined"==typeof window||void 0===window.location)return e;var t=getQueryParams(window.location.search);if(TENSORFLOWJS_FLAGS_PREFIX in t){var n={};t[TENSORFLOWJS_FLAGS_PREFIX].split(",").forEach(function(e){var t=e.split(":"),r=t[0],o=t[1];n[r]=o}),URL_PROPERTIES.forEach(function(t){t.name in n&&(console.log("Setting feature override from URL "+t.name+": "+n[t.name]),t.type===Type.NUMBER?e[t.name]=+n[t.name]:t.type===Type.BOOLEAN?e[t.name]="true"===n[t.name]:t.type===Type.STRING?e[t.name]=n[t.name]:console.warn("Unknown URL param: "+t.name+"."))})}return e}function hasExtension(e,t){return null!=e.getExtension(t)}function getWebGLRenderingContext(e,t){if(0===e||!t)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");var n=document.createElement("canvas");return 1===e?n.getContext("webgl")||n.getContext("experimental-webgl"):n.getContext("webgl2")}function loseContext(e){if(null!=e){var t=e.getExtension("WEBGL_lose_context");if(null==t)throw new Error("Extension WEBGL_lose_context not supported on this browser.");t.loseContext()}}function createFloatTextureAndBindToFramebuffer(e,t){var n=e.createFramebuffer(),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);var o=2===t?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,o,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0)}function getQueryParams(e){var t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(e){for(var n=[],r=1;r0?0:getWebGLDisjointQueryTimerVersion(t,this.get("IS_BROWSER"))}if("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE"===e)return this.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!isMobile();if("HAS_WEBGL"===e)return this.get("WEBGL_VERSION")>0;if("WEBGL_VERSION"===e)return isWebGLVersionEnabled(2,this.get("IS_BROWSER"))?2:isWebGLVersionEnabled(1,this.get("IS_BROWSER"))?1:0;if("WEBGL_RENDER_FLOAT32_ENABLED"===e)return isRenderToFloatTextureEnabled(this.get("WEBGL_VERSION"),this.get("IS_BROWSER"));if("WEBGL_DOWNLOAD_FLOAT_ENABLED"===e)return isDownloadFloatTextureEnabled(this.get("WEBGL_VERSION"),this.get("IS_BROWSER"));if("WEBGL_FENCE_API_ENABLED"===e)return isWebGLFenceEnabled(this.get("WEBGL_VERSION"),this.get("IS_BROWSER"));if("TEST_EPSILON"===e)return this.get("WEBGL_RENDER_FLOAT32_ENABLED")?TEST_EPSILON_FLOAT32_ENABLED:TEST_EPSILON_FLOAT32_DISABLED;throw new Error("Unknown feature "+e+".")},e.prototype.setFeatures=function(e){this.features=Object.assign({},e)},e.prototype.reset=function(){this.features=getFeaturesFromURL(),null!=this.globalEngine&&(this.globalEngine=null)},e.prototype.initBackend=function(e,t){var n=this;void 0===t&&(t=!1),this.backendName=e,this.backend=this.findBackend(e),this.globalEngine=new Engine(this.backend,t,function(){return n.get("DEBUG")})},e.prototype.findBackend=function(e){return e in this.registry?this.registry[e].backend:null},e.prototype.registerBackend=function(e,t,n,r){var o=this;if(void 0===n&&(n=1),e in this.registry)return console.warn(e+" backend was already registered. Reusing existing backend"),null!=r&&r(function(){return o.engine}),!1;try{var a=t();return this.registry[e]={backend:a,priority:n},!0}catch(t){return console.warn("Registration of backend "+e+" failed"),console.warn(t.stack||t.message),!1}},e.prototype.removeBackend=function(e){if(!(e in this.registry))throw new Error(e+" backend not found in registry");this.registry[e].backend.dispose(),delete this.registry[e]},Object.defineProperty(e.prototype,"engine",{get:function(){return this.initDefaultBackend(),this.globalEngine},enumerable:!0,configurable:!0}),e.prototype.initDefaultBackend=function(){null==this.globalEngine&&this.initBackend(this.get("BACKEND"),!1)},e}();function getGlobalNamespace(){var e;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof process)throw new Error("Could not find a global object");e=process}return e}function getOrMakeEnvironment(){var e=getGlobalNamespace();return null==e.ENV&&(e.ENV=new Environment(getFeaturesFromURL()),setTensorTracker(function(){return e.ENV.engine})),e.ENV}var ENV=getOrMakeEnvironment(),environment=Object.freeze({Environment:Environment,ENV:ENV});function warn(){for(var e=[],t=0;t=2*t+1||o%2==1?i.push(o):a.push(o);r.push.apply(r,a),r.push(0),r.push.apply(r,i)}return r}function getReshapedPermuted(e,t,n,r){void 0===r&&(r=!0);var o=[];r?o.push(e[0]/n):o.push(e[0]*n);for(var a=1;a=-n&&et||n===e){r=!0;break}n=nearestDivisor(e,n+1)}return n}function computeOutShape(e,t,n){for(var r=[],o=e.length,a=0;a0?o>=s[t]:o<=s[t]);o+=r[t])n+=1;return n}),[i,l]}function startForAxis(e,t,n,r,o){var a=t[o];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var i=r[o];return a<0&&(a+=i),a=clamp(0,a,i-1)}function stopForAxis(e,t,n,r,o){var a=t[o];e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var i=r[o];return a<0&&(a+=i),a=n[o]>0?clamp(0,a,i):clamp(-1,a,i-1)}function grad(e){return assert(isFunction(e),"The f passed in grad(f) must be a function"),function(t,n){return assert(t instanceof Tensor,"The x passed in grad(f)(x) must be a tensor"),assert(null==n||n instanceof Tensor,"The dy passed in grad(f)(x, dy) must be a tensor"),ENV.engine.tidy(function(){var r=ENV.engine.gradients(function(){return e(t)},[t],n),o=r.value,a=r.grads;return null!=n&&assertShapesMatch(o.shape,n.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),checkGrads(a),a[0]})}}function grads(e){return assert(isFunction(e),"The f passed in grads(f) must be a function"),function(t,n){return assert(Array.isArray(t)&&t.every(function(e){return e instanceof Tensor}),"The args passed in grads(f)(args) must be an array of tensors"),assert(null==n||n instanceof Tensor,"The dy passed in grads(f)(args, dy) must be a tensor"),ENV.engine.tidy(function(){var r=ENV.engine.gradients(function(){return e.apply(void 0,t)},t,n),o=r.value,a=r.grads;return null!=n&&assertShapesMatch(o.shape,n.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),checkGrads(a),a})}}function valueAndGrad(e){return assert(isFunction(e),"The f passed in valueAndGrad(f) must be a function"),function(t,n){assert(t instanceof Tensor,"The x passed in valueAndGrad(f)(x) must be a tensor"),assert(null==n||n instanceof Tensor,"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");var r=ENV.engine.gradients(function(){return e(t)},[t],n),o=r.grads,a=r.value;return checkGrads(o),{grad:o[0],value:a}}}function valueAndGrads(e){return assert(isFunction(e),"The f passed in valueAndGrads(f) must be a function"),function(t,n){assert(Array.isArray(t)&&t.every(function(e){return e instanceof Tensor}),"The args passed in valueAndGrads(f)(args) must be array of tensors"),assert(null==n||n instanceof Tensor,"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");var r=ENV.engine.gradients(function(){return e.apply(void 0,t)},t,n);return null!=n&&assertShapesMatch(r.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),checkGrads(r.grads),r}}function variableGrads(e,t){if(assert(isFunction(e),"The f passed in variableGrads(f) must be a function"),assert(null==t||Array.isArray(t)&&t.every(function(e){return e instanceof Variable}),"The varList passed in variableGrads(f, varList) must be an array of variables"),null==t)for(var n in t=[],ENV.engine.registeredVariables)t.push(ENV.engine.registeredVariables[n]);var r=t.length;assert((t=t.filter(function(e){return e.trainable})).length>0,"variableGrads() expects at least one of the input variables to be trainable, but none of the "+r+" variables is trainable.");var o=ENV.engine.gradients(e,t,null,!0),a=o.value,i=o.grads;assert(i.some(function(e){return null!=e}),"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),assert(0===a.rank,"The f passed in variableGrads(f) must return a scalar, but it returned a rank-"+a.rank+" tensor");var s={};return t.forEach(function(e,t){null!=i[t]&&(s[e.name]=i[t])}),{value:a,grads:s}}function customGrad(e){return ENV.engine.customGrad(e)}function checkGrads(e){if(e.filter(function(e){return null==e}).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.")}function convertToTensor(e,t,n,r){if(void 0===r&&(r="float32"),r=r||"float32",e instanceof Tensor)return e;if(!isTypedArray(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e)throw new Error("Argument '"+t+"' passed to '"+n+"' must be a Tensor or TensorLike, but got "+e.constructor.name);var o=inferShape(e);return isTypedArray(e)||Array.isArray(e)||(e=[e]),Tensor.make(o,{values:toTypedArray(e,r,ENV.get("DEBUG"))},r)}function convertToTensorArray(e,t,n){if(!Array.isArray(e))throw new Error("Argument "+t+" passed to "+n+" must be a `Tensor[]` or `TensorLike[]`");return e.map(function(e,r){return convertToTensor(e,t+"["+r+"]",n)})}function op(e){var t=Object.keys(e);if(1!==t.length)throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with "+t.length+" keys.");var n=t[0],r=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1));var o=function(){for(var e=[],t=0;t1)return zeros([0],r);var o=makeZerosTypedArray(Math.abs(Math.ceil((t-e)/n)),r);to}).sort(function(e,t){return t.score-e.score}),i=[],s=0;s=0;--d){if(intersectionOverUnion(e,c,i[d])>=r){p=!0;break}}if(!p&&(i.push(c),i.length>=n))break}return tensor1d(i,"int32")}function intersectionOverUnion(e,t,n){var r=e.subarray(4*t,4*t+4),o=e.subarray(4*n,4*n+4),a=Math.min(r[0],r[2]),i=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),u=Math.max(r[1],r[3]),l=Math.min(o[0],o[2]),c=Math.min(o[1],o[3]),p=Math.max(o[0],o[2]),d=Math.max(o[1],o[3]),h=(s-a)*(u-i),f=(p-l)*(d-c);if(h<=0||f<=0)return 0;var m=Math.max(a,l),g=Math.max(i,c),v=Math.min(s,p),y=Math.min(u,d),x=Math.max(v-m,0)*Math.max(y-g,0);return x/(h+f-x)}function topkImpl(e,t,n,r,o){for(var a=t[t.length-1],i=[e.length/a,a],s=i[0],u=i[1],l=getTypedArrayFromDType(n,s*r),c=getTypedArrayFromDType("int32",s*r),p=0;p":"<",u=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+r+";\n\n int bestIndex = 0;\n float bestValue = getA(batch, inOffset);\n\n for (int i = 0; i < "+r+"; i++) {\n int inIdx = "+u+";\n float candidate = getA(batch, inIdx);\n if (candidate "+s+" bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n "}}(),AvgPool2DBackpropProgram=function(){return function(e){this.variableNames=["dy"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,s=1/(t*n);this.userCode="\n const ivec2 pads = ivec2("+a+", "+i+");\n const float avgMultiplier = float("+s+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+o+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n "}}();function getBroadcastDims(e,t){for(var n=e.length,r=[],o=0;o1&&1===i&&r.unshift(a)}return r}function getReductionAxes(e,t){for(var n=[],r=0;r1)&&n.unshift(a)}return n}function broadcastDimsAreOuter(e){for(var t=0;t1&&s>1&&i!==s)throw Error(r);n.unshift(Math.max(i,s))}return n}var BatchNormProgram=function(){return function(e,t,n,r,o,a){this.outputShape=[],this.supportsBroadcasting=!0,this.variableNames=["x","mean","variance"],assertAndGetBroadcastShape(e,t),assertAndGetBroadcastShape(e,n);var i="0.0";null!=r&&(assertAndGetBroadcastShape(e,r),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");var s="1.0";null!=o&&(assertAndGetBroadcastShape(e,o),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode="\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = "+i+";\n float scale = "+s+";\n float inv = scale * inversesqrt(variance + float("+a+"));\n setOutput((x - mean) * inv + offset);\n }\n "}}(),CHECK_NAN_SNIPPET="\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n",ADD="return a + b;",SUB="return a - b;",MUL="return a * b;",DIV="if (a == b) return 1.0;\n return a / b;",INT_DIV="\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n",POW="\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",SQUARED_DIFFERENCE="return (a - b) * (a - b);",EQUAL="return float(a == b);",NOT_EQUAL="return float(a != b);",LESS="return float(a < b);",LESS_EQUAL="return float(a <= b);",GREATER="return float(a > b);",GREATER_EQUAL="return float(a >= b);",LOGICAL_AND="return float(a >= 1.0 && b >= 1.0);",LOGICAL_OR="return float(a >= 1.0 || b >= 1.0);",MAX=CHECK_NAN_SNIPPET+"\n return max(a, b);\n",MIN=CHECK_NAN_SNIPPET+"\n return min(a, b);\n",MOD="if (b == 0.0) return NAN;\n return mod(a, b);",ATAN2=CHECK_NAN_SNIPPET+"\n return atan(a, b);\n",ELU_DER="return (b >= 1.0) ? a : a * (b + 1.0);",BinaryOpProgram=function(){function e(e,t,n){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.outputShape=assertAndGetBroadcastShape(t,n),this.userCode="\n uniform float NAN;\n float binaryOperation(float a, float b) {\n "+e+"\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n "}return e.prototype.getCustomSetupFunc=function(){var e=this;return function(t,n){null==e.startLoc&&(e.startLoc=t.getUniformLocationNoThrow(n,"NAN"),null==e.startLoc)||t.gl.uniform1f(e.startLoc,NaN)}},e}(),ClipProgram=function(){return function(e,t,n){this.variableNames=["A"],this.outputShape=e;var r=t.toFixed(20),o=n.toFixed(20);this.userCode="\n void main() {\n float value = getAAtOutCoords();\n if (isNaN(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, "+r+", "+o+"));\n }\n "}}();function assertParams(e,t,n){var r=e.length,o=t.length;assert(e.length===t.length,"Error in concat"+r+"D: rank of x1 ("+r+") and x2 ("+o+") must be the same."),assert(n>=0&&n= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+o+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),Conv2DDerInputProgram=function(){return function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left;this.userCode="\n const ivec2 pads = ivec2("+a+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+t+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+o+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n for (int d2 = 0; d2 < "+e.outChannels+"; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),DepthwiseConv2DDerFilterProgram=function(){return function(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;var t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,o=e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * "+a+" + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < "+e.batchSize+"; b++) {\n for (int yR = 0; yR < "+e.outHeight+"; yR++) {\n int xR = wR + yR * "+t+" - "+r+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+o+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),DepthwiseConv2DDerInputProgram=function(){return function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode="\n const ivec2 pads = ivec2("+a+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+t+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+o+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < "+s+"; dm++) {\n int d2 = d1 * "+s+" + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),Conv2DProgram=function(){return function(e){this.variableNames=["x","W"],this.outputShape=e.outShape;var t=e.padInfo.top,n=e.padInfo.left,r=e.strideHeight,o=e.strideWidth,a=e.dilationHeight,i=e.dilationWidth,s=e.filterHeight,u=e.filterWidth,l=4*Math.floor(e.inChannels/4),c=e.inChannels%4;this.userCode="\n const ivec2 strides = ivec2("+r+", "+o+");\n const ivec2 pads = ivec2("+t+", "+n+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+s+"; wR++) {\n int xR = xRCorner + wR * "+a+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+u+"; wC++) {\n int xC = xCCorner + wC * "+i+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n for (int d1 = 0; d1 < "+l+"; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if ("+(1===c)+") {\n dotProd +=\n getX(batch, xR, xC, "+l+") *\n getW(wR, wC, "+l+", d2);\n } else if ("+(2===c)+") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, "+l+"),\n getX(batch, xR, xC, "+l+" + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, "+l+", d2),\n getW(wR, wC, "+l+" + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if ("+(3===c)+") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, "+l+"),\n getX(batch, xR, xC, "+l+" + 1),\n getX(batch, xR, xC, "+l+" + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, "+l+", d2),\n getW(wR, wC, "+l+" + 1, d2),\n getW(wR, wC, "+l+" + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),DepthwiseConv2DProgram=function(){return function(e){this.variableNames=["x","W"],this.outputShape=e.outShape;var t=e.inHeight,n=e.inWidth,r=e.padInfo.top,o=e.padInfo.left,a=e.strideHeight,i=e.strideWidth,s=e.dilationHeight,u=e.dilationWidth,l=e.filterHeight,c=e.filterWidth,p=e.outChannels/e.inChannels;this.userCode="\n const ivec2 strides = ivec2("+a+", "+i+");\n const ivec2 pads = ivec2("+r+", "+o+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / "+p+";\n int q = d2 - d1 * "+p+";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < "+l+"; wR++) {\n int xR = xRCorner + wR * "+s+";\n\n if (xR < 0 || xR >= "+t+") {\n continue;\n }\n\n for (int wC = 0; wC < "+c+"; wC++) {\n int xC = xCCorner + wC * "+u+";\n\n if (xC < 0 || xC >= "+n+") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n "}}();function makeShader(e,t,n,r){var o=e.map(function(e){var t=sizeFromShape(e.shapeInfo.logicalShape);return e.shapeInfo.isUniform?"uniform float "+e.name+(t>1?"["+t+"]":"")+";":"uniform sampler2D "+e.name+";"});o=o.join("\n");var a=e.map(function(e){return getInputSamplingSnippet(e,t,r)}).join("\n"),i=t.texShape,s=getOutputSamplingSnippet(t.logicalShape,i);return[SHADER_PREFIX,FLOAT_TEXTURE_SAMPLE_SNIPPET,FLOAT_TEXTURE_SETOUTPUT_SNIPPET,o,s,a,n].join("\n")}function getSamplerFromInInfo(e){var t=e.shapeInfo.logicalShape;switch(t.length){case 0:return getSamplerScalar(e);case 1:return getSampler1D(e);case 2:return getSampler2D(e);case 3:return getSampler3D(e);case 4:return getSampler4D(e);case 5:return getSampler5D(e);case 6:return getSampler6D(e);default:throw new Error(t.length+"-D input sampling is not yet supported")}}function getInputSamplingSnippet(e,t,n){var r=getSamplerFlat(e);return r+=getSamplerFromInInfo(e),(n||arraysEqual(e.shapeInfo.logicalShape,t.logicalShape))&&(r+=getSamplerAtOutputCoords(e,t,n)),r}function getOutputSamplingSnippet(e,t){switch(e.length){case 0:return getOutputScalarCoords();case 1:return getOutput1DCoords(e,t);case 2:return getOutput2DCoords(e,t);case 3:return getOutput3DCoords(e,t);case 4:return getOutput4DCoords(e,t);case 5:return getOutput5DCoords(e,t);case 6:return getOutput6DCoords(e,t);default:throw new Error(e.length+"-D output sampling is not yet supported")}}var SAMPLE_1D_SNIPPET="\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_2D_SNIPPET="\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\n int index = row * numC + col;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_3D_SNIPPET="\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\n int stride1, int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_4D_SNIPPET="\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int row, int col, int depth,\n int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_5D_SNIPPET="\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int row, int col, int depth,\n int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2 * stride3 + depth3;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_6D_SNIPPET="\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int stride4,\n int row, int col, int depth, int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\n stride3 + depth3 * stride4 + depth4;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",FLOAT_TEXTURE_SAMPLE_SNIPPET="\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return texture2D(textureSampler, uv).r;\n }\n",FLOAT_TEXTURE_SETOUTPUT_SNIPPET="\n void setOutput(float val) {\n gl_FragColor = vec4(val, 0, 0, 0);\n }\n",SHADER_PREFIX="\n precision highp float;\n precision highp int;\n varying vec2 resultUV;\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n bool isNaN(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n bool hasNaN(vec4 values) {\n vec4 v1 = values * values;\n vec4 v2 = values * values;\n return any(notEqual(v1, v2));\n }\n\n float getNaN(vec4 values) {\n return dot(vec4(1), values);\n }\n\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n "+SAMPLE_1D_SNIPPET+"\n "+SAMPLE_2D_SNIPPET+"\n "+SAMPLE_3D_SNIPPET+"\n "+SAMPLE_4D_SNIPPET+"\n "+SAMPLE_5D_SNIPPET+"\n "+SAMPLE_6D_SNIPPET+"\n";function getOutputScalarCoords(){return"\n int getOutputCoords() {\n return 0;\n }\n "}function getOutput1DCoords(e,t){return 1===t[0]?"\n int getOutputCoords() {\n return int(resultUV.x * "+t[1]+".0);\n }\n ":1===t[1]?"\n int getOutputCoords() {\n return int(resultUV.y * "+t[0]+".0);\n }\n ":"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n return resTexRC.x * "+t[1]+" + resTexRC.y;\n }\n "}function getOutput3DCoords(e,t){var n=e[1]*e[2],r=e[2];return"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n int r = index / "+n+";\n index -= r * "+n+";\n int c = index / "+r+";\n int d = index - c * "+r+";\n return ivec3(r, c, d);\n }\n "}function getOutput4DCoords(e,t){var n=e[3],r=e[2]*n,o=e[1]*r;return"\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n int r = index / "+o+";\n index -= r * "+o+";\n\n int c = index / "+r+";\n index -= c * "+r+";\n\n int d = index / "+n+";\n int d2 = index - d * "+n+";\n\n return ivec4(r, c, d, d2);\n }\n "}function getOutput5DCoords(e,t){var n=e[4],r=e[3]*n,o=e[2]*r,a=e[1]*o;return"\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2("+t[0]+",\n "+t[1]+"));\n\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n int r = index / "+a+";\n index -= r * "+a+";\n\n int c = index / "+o+";\n index -= c * "+o+";\n\n int d = index / "+r+";\n index -= d * "+r+";\n\n int d2 = index / "+n+";\n int d3 = index - d2 * "+n+";\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n "}function getOutput6DCoords(e,t){var n=e[5],r=e[4]*n,o=e[3]*r,a=e[2]*o,i=e[1]*a;return"\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n int r = index / "+i+";\n index -= r * "+i+";\n\n int c = index / "+a+";\n index -= c * "+a+";\n\n int d = index / "+o+";\n index -= d * "+o+";\n\n int d2 = index / "+r+";\n index -= d2 * "+r+";\n\n int d3 = index / "+n+";\n int d4 = index - d3 * "+n+";\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n "}function getOutput2DCoords(e,t){return arraysEqual(e,t)?"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2("+t[0]+", "+t[1]+"));\n }\n ":1===e[1]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n return ivec2(index, 0);\n }\n ":1===e[0]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n return ivec2(0, index);\n }\n ":"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n int r = index / "+e[1]+";\n int c = index - r * "+e[1]+";\n return ivec2(r, c);\n }\n "}function getSamplerScalar(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1);return e.shapeInfo.isUniform?"float "+n+"() {return "+t+";}":"\n float "+n+"() {\n return sampleTexture("+t+", halfCR);\n }\n "}function getSampler1D(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1);return"\n float "+n+"(int index) {\n return "+n+"Flat(index);\n }\n "}function getSampler2D(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),o=e.shapeInfo.texShape;if(null!=o&&arraysEqual(t,o)){var a=o[0];return"\n float "+r+"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2("+o[1]+".0, "+a+".0);\n return sampleTexture("+n+", uv);\n }\n "}var i=squeezeShape(t),s=i.newShape,u=i.keptDims,l=s;if(l.length=1?"coords = 0;":s.map(function(e){return"coords["+(e+u)+"] = 0;"}).join("\n"))+"\n return get"+n+"("+(a<2&&o>0?"coords":e.shapeInfo.logicalShape.map(function(e,t){return"coords["+(t+u)+"]"}).join(", "))+");\n }\n "}function getSamplerAtOutputCoords(e,t,n){var r=e.name,o=r.charAt(0).toUpperCase()+r.slice(1),a="get"+o+"AtOutCoords",i=getBroadcastDims(e.shapeInfo.logicalShape,t.logicalShape),s=e.shapeInfo.logicalShape.length,u=t.logicalShape.length,l=n&&(u>s||i.length>0),c=broadcastDimsAreOuter(i),p=e.shapeInfo.isUniform;if(l&&!c)return getBroadcastOutputCoordsSampler(e,t,o,a);var d=sizeFromShape(e.shapeInfo.logicalShape),h="";l&&c&&(h="\n int mainPart = index / "+d+";\n index -= mainPart * "+d+";\n ");var f=t.texShape;if(p)return 1===d?"float "+a+"() {return "+r+";}":"\n float "+a+"() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+f[0]+", "+f[1]+"));\n int index = resTexRC.x * "+f[1]+" + resTexRC.y;\n "+h+"\n return get"+o+"Flat(index);\n }\n ";var m=e.shapeInfo.texShape;return arraysEqual(m,f)?"\n float "+a+"() {\n return sampleTexture("+r+", resultUV);\n }\n ":"\n float "+a+"() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+f[0]+", "+f[1]+"));\n int index = resTexRC.x * "+f[1]+" + resTexRC.y;\n "+h+"\n int texR = index / "+m[1]+";\n int texC = index - texR * "+m[1]+";\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+m[1]+".0, "+m[0]+".0);\n\n return sampleTexture("+r+", uv);\n }\n "}function getCoordsDataType(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error("GPU for rank "+e+" is not yet supported")}function squeezeInputInfo(e,t){var n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function getSqueezedParams(e,t){return t.map(function(t){return e[t]}).join(", ")}var CumSumProgram=function(){return function(e,t,n){this.variableNames=["x"],this.outputShape=e;var r=e.length,o=e[e.length-1],a=n?"<":">";this.userCode="\n int getIndex(int i) {\n "+(n?"return "+o+" -i - 1;":"return i;")+"\n }\n\n void main() {\n "+getCoordsDataType(r)+" coords = getOutputCoords();\n int end = "+getFinalCoord(r,"coords")+";\n float val = 0.0;\n for (int i = "+o+" - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx "+a+" end) {\n continue;\n }\n if (idx == end && "+t+") {\n continue;\n }\n "+getFinalCoord(r,"coords")+" = idx;\n val += getX("+getCoords(r,"coords")+");\n }\n setOutput(val);\n }\n "}}();function getCoords(e,t){if(1===e)return""+t;if(2===e)return t+".x, "+t+".y";if(3===e)return t+".x, "+t+".y, "+t+".z";if(4===e)return t+".x, "+t+".y, "+t+".z, "+t+".w";throw Error("Cumulative sum for rank "+e+" is not yet supported")}function getFinalCoord(e,t){if(1===e)return""+t;if(2===e)return t+".y";if(3===e)return t+".z";if(4===e)return t+".w";throw Error("Cumulative sum for rank "+e+" is not yet supported")}var TextureUsage,PhysicalTextureType,EncodeFloatProgram=function(){return function(e){this.variableNames=["A"],this.outputShape=e,this.userCode="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n gl_FragColor = encode_float(x);\n }\n "}}(),FromPixelsProgram=function(){return function(e){this.variableNames=["A"];var t=e[0],n=e[1];this.outputShape=e,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+n+".0, "+t+".0);\n\n vec4 values = texture2D(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n "}}(),GatherProgram=function(){return function(e,t,n){this.variableNames=["A","indices"];var r=e.slice();r[n]=t,this.outputShape=r,this.rank=r.length;var o=getCoordsDataType(this.rank),a=getSourceCoords(e,n);this.userCode="\n void main() {\n "+o+" resRC = getOutputCoords();\n setOutput(getA("+a+"));\n }\n "}}();function getSourceCoords(e,t){var n=e.length;if(n>4)throw Error("Gather for rank "+n+" is not yet supported");if(1===n)return"int(getIndices(resRC))";for(var r=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],a=0;a= "+r);for(var o=0,a=0;a= "+r);for(var o=0,a=0;a= "+o);for(var a=getPackedMatrixTextureShapeWidthHeight(t,n),i=a[0],s=a[1],u=n%2==1,l=t%2==1,c=Math.floor(n/2),p=Math.floor(t/2),d=u?4:0,h=n,f=0,m=0;m= "+o);for(var a=n%2==1,i=t%2==1,s=Math.floor(n/2),u=Math.floor(t/2),l=getPackedMatrixTextureShapeWidthHeight(t,n),c=l[0],p=l[1],d=a?4:0,h=n+(a?1:0),f=0,m=0,g=n,v=0;vr||n>r){o="["+t+"x"+n+"]";throw new Error("Requested texture size "+o+" greater than WebGL maximum on this browser / GPU "+("["+r+"x"+r+"]")+".")}}function createFramebuffer(e){return throwIfNull(e,function(){return e.createFramebuffer()},"Unable to create WebGLFramebuffer.")}function bindVertexBufferToProgramAttribute(e,t,n,r,o,a,i){var s=e.getAttribLocation(t,n);return-1!==s&&(callAndCheck(e,function(){return e.bindBuffer(e.ARRAY_BUFFER,r)}),callAndCheck(e,function(){return e.vertexAttribPointer(s,o,e.FLOAT,!1,a,i)}),callAndCheck(e,function(){return e.enableVertexAttribArray(s)}),!0)}function bindTextureUnit(e,t,n){validateTextureUnit(e,n),callAndCheck(e,function(){return e.activeTexture(e.TEXTURE0+n)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)})}function unbindTextureUnit(e,t){validateTextureUnit(e,t),callAndCheck(e,function(){return e.activeTexture(e.TEXTURE0+t)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function getProgramUniformLocationOrThrow(e,t,n){return throwIfNull(e,function(){return e.getUniformLocation(t,n)},'uniform "'+n+'" not present in program.')}function getProgramUniformLocation(e,t,n){return e.getUniformLocation(t,n)}function bindTextureToProgramUniformSampler(e,t,n,r,o){callAndCheck(e,function(){return bindTextureUnit(e,n,o)}),callAndCheck(e,function(){return e.uniform1i(r,o)})}function bindCanvasToFramebuffer(e){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,null)}),callAndCheck(e,function(){return e.viewport(0,0,e.canvas.width,e.canvas.height)}),callAndCheck(e,function(){return e.scissor(0,0,e.canvas.width,e.canvas.height)})}function bindColorTextureToFramebuffer(e,t,n){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,n)}),callAndCheck(e,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)})}function unbindColorTextureFromFramebuffer(e,t){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,t)}),callAndCheck(e,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)})}function validateFramebuffer(e){var t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+getFramebufferErrorMessage(e,t))}function getFramebufferErrorMessage(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return"unknown error "+t}}function throwIfNull(e,t,n){var r=callAndCheck(e,function(){return t()});if(null==r)throw new Error(n);return r}function validateTextureUnit(e,t){var n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(rn)throw new Error("textureUnit must be in "+("[gl.TEXTURE0, gl.TEXTURE"+n+"]")+".")}function getTextureShapeFromLogicalShape(e,t){2!==t.length&&(t=squeezeShape(t).newShape);var n=queryMaxTextureSize(e),r=sizeFromShape(t);return t.length<=1&&r<=n?[r,1]:2===t.length&&t[0]<=n&&t[1]<=n?t:3===t.length&&t[0]<=n&&t[1]*t[2]<=n?[t[0],t[1]*t[2]]:4===t.length&&t[0]<=n&&t[1]*t[2]*t[3]<=n?[t[0],t[1]*t[2]*t[3]]:sizeToSquarishShape(r)}var webgl_util=Object.freeze({createWebGLRenderingContext:createWebGLRenderingContext,createWebGLRenderingContextFromCanvas:createWebGLRenderingContextFromCanvas,callAndCheck:callAndCheck,enableDebugWebGLErrorChecking:enableDebugWebGLErrorChecking,checkWebGLError:checkWebGLError,getWebGLErrorMessage:getWebGLErrorMessage,getExtensionOrThrow:getExtensionOrThrow,createVertexShader:createVertexShader,createFragmentShader:createFragmentShader,createProgram:createProgram,linkProgram:linkProgram,validateProgram:validateProgram,createStaticVertexBuffer:createStaticVertexBuffer,createStaticIndexBuffer:createStaticIndexBuffer,queryMaxTextureSize:queryMaxTextureSize,getNumChannels:getNumChannels,createTexture:createTexture,validateTextureSize:validateTextureSize,createFramebuffer:createFramebuffer,bindVertexBufferToProgramAttribute:bindVertexBufferToProgramAttribute,bindTextureUnit:bindTextureUnit,unbindTextureUnit:unbindTextureUnit,getProgramUniformLocationOrThrow:getProgramUniformLocationOrThrow,getProgramUniformLocation:getProgramUniformLocation,bindTextureToProgramUniformSampler:bindTextureToProgramUniformSampler,bindCanvasToFramebuffer:bindCanvasToFramebuffer,bindColorTextureToFramebuffer:bindColorTextureToFramebuffer,unbindColorTextureFromFramebuffer:unbindColorTextureFromFramebuffer,validateFramebuffer:validateFramebuffer,getFramebufferErrorMessage:getFramebufferErrorMessage,getTextureShapeFromLogicalShape:getTextureShapeFromLogicalShape});function getWebGLContextAttributes(){return{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0}}function createWebGLContext(e){var t,n=getWebGLContextAttributes();return callAndCheck(t=null!=e?createWebGLRenderingContextFromCanvas(e,n):createWebGLRenderingContext(n),function(){return t.disable(t.DEPTH_TEST)}),callAndCheck(t,function(){return t.disable(t.STENCIL_TEST)}),callAndCheck(t,function(){return t.disable(t.BLEND)}),callAndCheck(t,function(){return t.disable(t.DITHER)}),callAndCheck(t,function(){return t.disable(t.POLYGON_OFFSET_FILL)}),callAndCheck(t,function(){return t.disable(t.SAMPLE_COVERAGE)}),callAndCheck(t,function(){return t.enable(t.SCISSOR_TEST)}),callAndCheck(t,function(){return t.enable(t.CULL_FACE)}),callAndCheck(t,function(){return t.cullFace(t.BACK)}),t}function createVertexShader$1(e){return createVertexShader(e,"\n precision highp float;\n attribute vec3 clipSpacePos;\n attribute vec2 uv;\n varying vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }")}function createVertexBuffer(e){return createStaticVertexBuffer(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function createIndexBuffer(e){return createStaticIndexBuffer(e,new Uint16Array([0,1,2,2,1,3]))}function getTextureConfig(e,t){var n,r,o,a,i,s,u,l=e;return 2===ENV.get("WEBGL_VERSION")?(n=l.R32F,r=l.R16F,o=l.RGBA32F,a=l.RED,i=4,s=1,u=l.HALF_FLOAT):(n=e.RGBA,r=e.RGBA,o=l.RGBA,a=e.RGBA,i=4,s=4,u=null!=t?t.HALF_FLOAT_OES:null),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedFloat:o,textureFormatFloat:a,downloadTextureFormat:e.RGBA,downloadUnpackNumChannels:i,defaultNumChannels:s,textureTypeHalfFloat:u}}function createAndConfigureTexture(e,t,n,r,o,a){validateTextureSize(e,t,n);var i=createTexture(e),s=e.TEXTURE_2D;return callAndCheck(e,function(){return e.bindTexture(s,i)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_MIN_FILTER,e.NEAREST)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_MAG_FILTER,e.NEAREST)}),callAndCheck(e,function(){return e.texImage2D(s,0,r,t,n,0,o,a,null)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)}),i}function createFloat32MatrixTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],r.internalFormatFloat,r.textureFormatFloat,e.FLOAT)}function createFloat16MatrixTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],r.internalFormatFloat,r.textureFormatFloat,r.textureTypeHalfFloat)}function createUnsignedBytesMatrixTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],e.RGBA,e.RGBA,e.UNSIGNED_BYTE)}function createPackedMatrixTexture(e,t,n,r){var o=getPackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],r.internalFormatPackedFloat,e.RGBA,e.FLOAT)}function bindVertexProgramAttributeStreams(e,t,n){return callAndCheck(e,function(){return e.bindBuffer(e.ARRAY_BUFFER,n)}),bindVertexBufferToProgramAttribute(e,t,"clipSpacePos",n,3,20,0)&&bindVertexBufferToProgramAttribute(e,t,"uv",n,2,20,12)}function uploadPixelDataToTexture(e,t,n){callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)}),callAndCheck(e,function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function uploadDataToTexture(e,t,n,r,o,a){validateTextureSize(e,n,r),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)}),callAndCheck(e,function(){return e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,r,a,e.FLOAT,o)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function uploadMatrixToTexture(e,t,n,r,o,a,i){var s,u=getUnpackedMatrixTextureShapeWidthHeight(n,r),l=u[0],c=u[1];1===i.defaultNumChannels?s=o:encodeMatrixToUnpackedArray(o,s=new Float32Array(getUnpackedArraySizeFromMatrixSize(o.length,a)),a),uploadDataToTexture(e,t,l,c,s,i.textureFormatFloat)}function uploadMatrixToPackedTexture(e,t,n,r,o,a){var i=getPackedMatrixTextureShapeWidthHeight(n,r),s=i[0],u=i[1],l=new Float32Array(getPackedRGBAArraySizeFromMatrixShape(n,r));encodeMatrixToPackedRGBA(o,n,r,l),uploadDataToTexture(e,t,s,u,l,e.RGBA)}function maybeCreateBufferFromOutputTexture(e,t,n,r,o){var a=t;if(2===ENV.get("WEBGL_VERSION")){var i=e,s=i.createBuffer();callAndCheck(e,function(){return e.bindBuffer(i.PIXEL_PACK_BUFFER,s)});var u=4*getUnpackedArraySizeFromMatrixSize(n*r,o.downloadUnpackNumChannels);callAndCheck(e,function(){return e.bufferData(i.PIXEL_PACK_BUFFER,u,e.STATIC_DRAW)}),callAndCheck(e,function(){return i.readPixels(0,0,r,n,e.RGBA,e.FLOAT,0)}),callAndCheck(e,function(){return e.bindBuffer(i.PIXEL_PACK_BUFFER,null)}),a=s}return a}function downloadFloat32MatrixFromBuffer(e,t,n,r,o){var a=e,i=new Float32Array(getUnpackedArraySizeFromMatrixSize(n*r,o.downloadUnpackNumChannels));a.bindBuffer(e.ARRAY_BUFFER,t),a.getBufferSubData(e.ARRAY_BUFFER,0,i),a.bindBuffer(e.ARRAY_BUFFER,null);var s=new Float32Array(n*r);return decodeMatrixFromUnpackedArray(i,s,o.downloadUnpackNumChannels),s}function downloadFloat32MatrixFromOutputTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n),a=o[0],i=o[1],s=new Float32Array(getUnpackedArraySizeFromMatrixSize(t*n,r.downloadUnpackNumChannels));callAndCheck(e,function(){return e.readPixels(0,0,a,i,r.downloadTextureFormat,e.FLOAT,s)});var u=new Float32Array(t*n);return decodeMatrixFromUnpackedArray(s,u,r.downloadUnpackNumChannels),u}function downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n),a=o[0],i=o[1],s=new Uint8Array(getUnpackedArraySizeFromMatrixSize(t*n,4));return callAndCheck(e,function(){return e.readPixels(0,0,a,i,r.downloadTextureFormat,e.UNSIGNED_BYTE,s)}),new Float32Array(s.buffer)}function downloadMatrixFromPackedOutputTexture(e,t,n,r){var o=getPackedMatrixTextureShapeWidthHeight(t,n),a=o[0],i=o[1],s=new Float32Array(getPackedRGBAArraySizeFromMatrixShape(t,n));callAndCheck(e,function(){return e.readPixels(0,0,a,i,e.RGBA,e.FLOAT,s)});var u=new Float32Array(t*n);return decodeMatrixFromPackedRGBA(s,t,n,u)}var gpgpu_util=Object.freeze({getWebGLContextAttributes:getWebGLContextAttributes,createWebGLContext:createWebGLContext,createVertexShader:createVertexShader$1,createVertexBuffer:createVertexBuffer,createIndexBuffer:createIndexBuffer,getTextureConfig:getTextureConfig,createFloat32MatrixTexture:createFloat32MatrixTexture,createFloat16MatrixTexture:createFloat16MatrixTexture,createUnsignedBytesMatrixTexture:createUnsignedBytesMatrixTexture,createPackedMatrixTexture:createPackedMatrixTexture,bindVertexProgramAttributeStreams:bindVertexProgramAttributeStreams,uploadPixelDataToTexture:uploadPixelDataToTexture,uploadMatrixToTexture:uploadMatrixToTexture,uploadMatrixToPackedTexture:uploadMatrixToPackedTexture,maybeCreateBufferFromOutputTexture:maybeCreateBufferFromOutputTexture,downloadFloat32MatrixFromBuffer:downloadFloat32MatrixFromBuffer,downloadFloat32MatrixFromOutputTexture:downloadFloat32MatrixFromOutputTexture,downloadByteEncodedFloatMatrixFromOutputTexture:downloadByteEncodedFloatMatrixFromOutputTexture,downloadMatrixFromPackedOutputTexture:downloadMatrixFromPackedOutputTexture}),GPGPUContext=function(){function e(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.autoDebugValidate=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[],this.gl=null!=e?e:createWebGLContext(),1===ENV.get("WEBGL_VERSION")?(this.textureFloatExtension=getExtensionOrThrow(this.gl,"OES_texture_float"),this.colorBufferFloatExtension=this.gl.getExtension("WEBGL_color_buffer_float"),ENV.get("WEBGL_RENDER_FLOAT32_ENABLED")||(this.textureHalfFloatExtension=getExtensionOrThrow(this.gl,"OES_texture_half_float"),this.colorBufferHalfFloatExtension=this.gl.getExtension("EXT_color_buffer_half_float"))):this.colorBufferFloatExtension=getExtensionOrThrow(this.gl,"EXT_color_buffer_float"),this.loseContextExtension=getExtensionOrThrow(this.gl,"WEBGL_lose_context"),this.vertexBuffer=createVertexBuffer(this.gl),this.indexBuffer=createIndexBuffer(this.gl),this.framebuffer=createFramebuffer(this.gl),this.textureConfig=getTextureConfig(this.gl,this.textureHalfFloatExtension)}return e.prototype.dispose=function(){var e=this;if(!this.disposed){null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");var t=this.gl;callAndCheck(t,function(){return t.finish()}),callAndCheck(t,function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)}),callAndCheck(t,function(){return t.deleteFramebuffer(e.framebuffer)}),callAndCheck(t,function(){return t.bindBuffer(t.ARRAY_BUFFER,null)}),callAndCheck(t,function(){return t.deleteBuffer(e.vertexBuffer)}),callAndCheck(t,function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}),callAndCheck(t,function(){return t.deleteBuffer(e.indexBuffer)}),this.loseContextExtension.loseContext(),this.disposed=!0}},e.prototype.enableAutomaticDebugValidation=function(e){this.autoDebugValidate=e,enableDebugWebGLErrorChecking(e)},e.prototype.createFloat32MatrixTexture=function(e,t){return this.throwIfDisposed(),createFloat32MatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.createFloat16MatrixTexture=function(e,t){return this.throwIfDisposed(),createFloat16MatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.createUnsignedBytesMatrixTexture=function(e,t){return this.throwIfDisposed(),createUnsignedBytesMatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.uploadPixelDataToTexture=function(e,t){this.throwIfDisposed(),uploadPixelDataToTexture(this.gl,e,t)},e.prototype.createPackedMatrixTexture=function(e,t){return this.throwIfDisposed(),createPackedMatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.deleteMatrixTexture=function(e){var t=this;this.throwIfDisposed(),this.outputTexture===e&&(unbindColorTextureFromFramebuffer(this.gl,this.framebuffer),this.outputTexture=null),callAndCheck(this.gl,function(){return t.gl.deleteTexture(e)})},e.prototype.uploadMatrixToTexture=function(e,t,n,r){this.throwIfDisposed();var o=getNumChannels();return uploadMatrixToTexture(this.gl,e,t,n,r,o,this.textureConfig)},e.prototype.uploadMatrixToPackedTexture=function(e,t,n,r){return this.throwIfDisposed(),uploadMatrixToPackedTexture(this.gl,e,t,n,r,this.textureConfig)},e.prototype.downloadFloat32MatrixFromOutputTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return downloadFloat32MatrixFromOutputTexture(r.gl,t,n,r.textureConfig)})},e.prototype.downloadByteEncodedFloatMatrixFromOutputTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return downloadByteEncodedFloatMatrixFromOutputTexture(r.gl,t,n,r.textureConfig)})},e.prototype.downloadFloat32MatrixFromBuffer=function(e,t,n){return downloadFloat32MatrixFromBuffer(this.gl,e,t,n,this.textureConfig)},e.prototype.maybeCreateBufferFromTexture=function(e,t,n){this.bindTextureToFrameBuffer(e);var r=maybeCreateBufferFromOutputTexture(this.gl,e,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r},e.prototype.createAndWaitForFence=function(){var e=this.createFence(this.gl);return this.pollFence(e)},e.prototype.createFence=function(e){var t,n,r=this;if(ENV.get("WEBGL_FENCE_API_ENABLED")){var o=e,a=o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=function(){var e=o.clientWaitSync(a,0,0);return e===o.ALREADY_SIGNALED||e===o.CONDITION_SATISFIED},t=a}else ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=function(){return r.isQueryAvailable(t,ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}):n=function(){return!0};return{query:t,isFencePassed:n}},e.prototype.downloadMatrixFromPackedTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return downloadMatrixFromPackedOutputTexture(r.gl,t,n,r.textureConfig)})},e.prototype.createProgram=function(e){this.throwIfDisposed();var t=this.gl,n=createFragmentShader(t,e),r=createVertexShader$1(t),o=createProgram(t);return callAndCheck(t,function(){return t.attachShader(o,r)}),callAndCheck(t,function(){return t.attachShader(o,n)}),linkProgram(t,o),this.autoDebugValidate&&validateProgram(t,o),this.vertexAttrsAreBound||(this.setProgram(o),this.vertexAttrsAreBound=bindVertexProgramAttributeStreams(t,this.program,this.vertexBuffer)),o},e.prototype.deleteProgram=function(e){var t=this;this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&callAndCheck(this.gl,function(){return t.gl.deleteProgram(e)})},e.prototype.setProgram=function(e){var t=this;this.throwIfDisposed(),this.program=e,null!=this.program&&this.autoDebugValidate&&validateProgram(this.gl,this.program),callAndCheck(this.gl,function(){return t.gl.useProgram(e)})},e.prototype.getUniformLocation=function(e,t,n){return void 0===n&&(n=!0),this.throwIfDisposed(),n?getProgramUniformLocationOrThrow(this.gl,e,t):getProgramUniformLocation(this.gl,e,t)},e.prototype.getAttributeLocation=function(e,t){var n=this;return this.throwIfDisposed(),callAndCheck(this.gl,function(){return n.gl.getAttribLocation(e,t)})},e.prototype.getUniformLocationNoThrow=function(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)},e.prototype.setInputMatrixTexture=function(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),bindTextureToProgramUniformSampler(this.gl,this.program,e,t,n)},e.prototype.setOutputMatrixTexture=function(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)},e.prototype.setOutputPackedMatrixTexture=function(e,t,n){this.throwIfDisposed();var r=getPackedMatrixTextureShapeWidthHeight(t,n),o=r[0],a=r[1];this.setOutputMatrixTextureDriver(e,o,a)},e.prototype.setOutputMatrixWriteRegion=function(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)},e.prototype.setOutputPackedMatrixWriteRegion=function(e,t,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")},e.prototype.debugValidate=function(){null!=this.program&&validateProgram(this.gl,this.program),validateFramebuffer(this.gl)},e.prototype.executeProgram=function(){this.throwIfDisposed(),this.throwIfNoProgram();var e=this.gl;this.autoDebugValidate&&this.debugValidate(),callAndCheck(e,function(){return e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)})},e.prototype.blockUntilAllProgramsCompleted=function(){var e=this;this.throwIfDisposed(),callAndCheck(this.gl,function(){return e.gl.finish()})},e.prototype.getQueryTimerExtension=function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=getExtensionOrThrow(this.gl,2===ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension},e.prototype.getQueryTimerExtensionWebGL2=function(){return this.getQueryTimerExtension()},e.prototype.getQueryTimerExtensionWebGL1=function(){return this.getQueryTimerExtension()},e.prototype.beginQuery=function(){if(2===ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}var r=this.getQueryTimerExtensionWebGL1(),o=r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT,o),o},e.prototype.endQuery=function(){if(2!==ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}else{var t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT)}},e.prototype.waitForQueryAndGetTime=function(e){return __awaiter(this,void 0,void 0,function(){var t=this;return __generator(this,function(n){switch(n.label){case 0:return[4,repeatedTry(function(){return t.isQueryAvailable(e,ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))})];case 1:return n.sent(),[2,this.getQueryTime(e,ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))]}})})},e.prototype.getQueryTime=function(e,t){if(0===t)return null;if(2===t){var n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}var r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(e,r.QUERY_RESULT_EXT)/1e6},e.prototype.isQueryAvailable=function(e,t){if(0===t)return!0;if(2===t){var n=this.gl,r=this.getQueryTimerExtensionWebGL2(),o=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),o&&!this.disjoint}o=(r=this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(e,r.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),o&&!this.disjoint},e.prototype.pollFence=function(e){var t=this;return new Promise(function(n){t.addItemToPoll(function(){return e.isFencePassed()},function(){return n()})})},e.prototype.pollItems=function(){for(var e=binSearchLastTrue(this.itemsToPoll.map(function(e){return e.isDoneFn})),t=0;t<=e;++t){(0,this.itemsToPoll[t].resolveFn)()}this.itemsToPoll=this.itemsToPoll.slice(e+1)},e.prototype.addItemToPoll=function(e,t){var n=this;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||repeatedTry(function(){return n.pollItems(),0===n.itemsToPoll.length})},e.prototype.bindTextureToFrameBuffer=function(e){this.throwIfDisposed(),bindColorTextureToFramebuffer(this.gl,e,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(this.gl)},e.prototype.unbindTextureToFrameBuffer=function(){null!=this.outputTexture?(bindColorTextureToFramebuffer(this.gl,this.outputTexture,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(this.gl)):unbindColorTextureFromFramebuffer(this.gl,this.framebuffer)},e.prototype.downloadMatrixDriver=function(e,t){this.bindTextureToFrameBuffer(e);var n=t();return this.unbindTextureToFrameBuffer(),n},e.prototype.setOutputMatrixTextureDriver=function(e,t,n){this.throwIfDisposed();var r=this.gl;bindColorTextureToFramebuffer(r,e,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(r),this.outputTexture=e,callAndCheck(r,function(){return r.viewport(0,0,t,n)}),callAndCheck(r,function(){return r.scissor(0,0,t,n)})},e.prototype.setOutputMatrixWriteRegionDriver=function(e,t,n,r){var o=this;this.throwIfDisposed(),callAndCheck(this.gl,function(){return o.gl.scissor(e,t,n,r)})},e.prototype.throwIfDisposed=function(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")},e.prototype.throwIfNoProgram=function(){if(null==this.program)throw new Error("No GPU program is currently set.")},e}();function binSearchLastTrue(e){for(var t=0,n=e.length-1,r=-1;t<=n;){var o=t+n>>1;e[o]()?(r=o,t=o+1):n=o-1}return r}function compileProgram(e,t,n,r){for(var o=t.userCode,a=n.map(function(e,n){var r={logicalShape:e.tensor.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform};return{name:t.variableNames[n],shapeInfo:r}}),i=a.map(function(e){return e.shapeInfo}),s={logicalShape:r.tensor.shape,texShape:r.texData.texShape,isUniform:!1},u=makeShader(a,s,o,!0===t.supportsBroadcasting),l=e.createProgram(u),c={},p=0;p= 0 && idx <= "+s+") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * "+a+";\n setOutput(val);\n }\n "}}(),LRNGradProgram=function(){return function(e,t,n,r,o){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=r,this.beta=o,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < "+this.depth+"; ++d) {\n int depthBegin = int(max(0.0, float(d - "+t+")));\n int depthEnd = int(min(float("+this.depth+"),\n float(d + "+t+" + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = "+this.depth+";\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float("+r+") * norm + float("+n+");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float("+r+")\n * float("+o+")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * "+o+");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n "}}(),MaxPool2DBackpropProgram=function(){return function(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,s=t*n-1;this.userCode="\n const ivec2 pads = ivec2("+a+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+o+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = "+s+" - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * "+n+" + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n "}}(),MatMulProgram=function(){return function(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1),this.variableNames=["matrixA","matrixB"];var o=n?e[1]:e[0],a=r?t[0]:t[1],i=n?e[0]:e[1];this.outputShape=[o,a];var s=function(e,t){return n?t+" + "+e+", aRow":"aRow, "+t+" + "+e},u=function(e,t){return r?"bCol, "+t+" + "+e:t+" + "+e+", bCol"},l=4*Math.floor(i/4),c=i%4;this.userCode=" float dotARowBCol(int aRow, int bCol) {\n float result = 0.0;\n for (int i = 0; i < "+l+"; i += 4) {\n vec4 a = vec4(\n getMatrixA("+s(0,"i")+"),\n getMatrixA("+s(1,"i")+"),\n getMatrixA("+s(2,"i")+"),\n getMatrixA("+s(3,"i")+")\n );\n vec4 b = vec4(\n getMatrixB("+u(0,"i")+"),\n getMatrixB("+u(1,"i")+"),\n getMatrixB("+u(2,"i")+"),\n getMatrixB("+u(3,"i")+")\n );\n\n result += dot(a, b);\n }\n\n if ("+(1===c)+") {\n result += getMatrixA("+s(0,l)+") *\n getMatrixB("+u(0,l)+");\n } else if ("+(2===c)+") {\n vec2 a = vec2(\n getMatrixA("+s(0,l)+"),\n getMatrixA("+s(1,l)+")\n );\n vec2 b = vec2(\n getMatrixB("+u(0,l)+"),\n getMatrixB("+u(1,l)+")\n );\n result += dot(a, b);\n } else if ("+(3===c)+") {\n vec3 a = vec3(\n getMatrixA("+s(0,l)+"),\n getMatrixA("+s(1,l)+"),\n getMatrixA("+s(2,l)+")\n );\n vec3 b = vec3(\n getMatrixB("+u(0,l)+"),\n getMatrixB("+u(1,l)+"),\n getMatrixB("+u(2,l)+")\n );\n result += dot(a, b);\n }\n\n return result;\n }\n\n void main() {\n ivec2 resRC = getOutputCoords();\n setOutput(dotARowBCol(resRC.x, resRC.y));\n }\n "}}(),MultinomialProgram=function(){function e(e,t,n){this.variableNames=["probs"],this.outputShape=[e,n],this.userCode="\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < "+(t-1)+"; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float("+(t-1)+"));\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;return function(n,r){null==t.seedLoc&&(t.seedLoc=n.getUniformLocation(r,"seed")),n.gl.uniform1f(t.seedLoc,e)}},e}(),OneHotProgram=function(){return function(e,t,n,r){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float("+r+"), float("+n+"),\n float(index == coords.y)));\n }\n "}}(),PadProgram=function(){return function(e,t,n){this.variableNames=["x"],this.outputShape=t.map(function(t,n){return t[0]+e[n]+t[1]});var r=e.length,o=getCoordsDataType(r),a=t.map(function(e){return e[0]}).join(","),i=t.map(function(t,n){return t[0]+e[n]}).join(","),s=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);this.userCode=1!==r?"\n "+o+" start = "+o+"("+a+");\n "+o+" end = "+o+"("+i+");\n\n void main() {\n "+o+" outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float("+n+"));\n } else {\n "+o+" coords = outC - start;\n setOutput(getX("+s+"));\n }\n }\n ":"\n int start = "+a+";\n int end = "+i+";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float("+n+"));\n } else {\n setOutput(getX(outC - start));\n }\n }\n "}}(),Pool2DProgram=function(){return function(e,t,n){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");var r=e.filterHeight,o=e.filterWidth,a=e.strideHeight,i=e.strideWidth,s=e.padInfo.top,u=e.padInfo.left;this.outputShape=e.outShape;var l="avg"===t,c="0.0";if(l||(c="-1.0 / 0.0"),n)this.userCode="\n const ivec2 strides = ivec2("+a+", "+i+");\n const ivec2 pads = ivec2("+s+", "+u+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < "+r+"; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+o+"; wC++) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value >= currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * "+o+" + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ";else{var p=t+"("+t+"("+t+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===t&&(p="avgValue / count");var d=4*Math.floor(o/4),h=o%4,f="\n if ("+l+") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n ";this.userCode="\n const ivec2 strides = ivec2("+a+", "+i+");\n const ivec2 pads = ivec2("+s+", "+u+");\n const float initializationValue = "+c+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= "+e.inWidth+") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4("+c+");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < "+r+"; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+d+"; wC += 4) {\n int xC = xCCorner + wC;\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n getValue(batch, xR, xC + 3, d)\n );\n\n "+f+"\n }\n\n int xC = xCCorner + "+d+";\n if ("+(1===h)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+f+"\n } else if ("+(2===h)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n initializationValue,\n initializationValue\n );\n\n "+f+"\n } else if ("+(3===h)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n initializationValue\n );\n\n "+f+"\n }\n }\n setOutput("+p+");\n }\n "}}}(),ReduceProgram=function(){return function(e,t){this.variableNames=["x"];var n=e.windowSize,r=e.batchSize,o=e.inSize,a=Math.ceil(o/n);this.outputShape=[r,a];var i="0.0",s="";"min"===t?(i="1.0 / 0.0",s="min"):"max"===t&&(i="-1.0 / 0.0",s="max");var u=t+"("+t+"("+t+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum"===t?u="sumValue":"all"===t?u="allValue":"any"===t&&(u="anyValue");var l=4*Math.floor(n/4),c=n%4,p="\n if ("+("sum"===t)+") {\n sumValue += dot(values, ones);\n } else {\n minMaxValue = "+s+"(values, minMaxValue);\n }\n ",d="vec4";"all"===t?(i="1.0",p="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",d="bvec4"):"any"===t&&(i="0.0",p="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",d="bvec4");var h="";o%n>0&&(h="\n if (inIdx < 0 || inIdx >= "+o+") {\n return initializationValue;\n }\n "),this.userCode="\n const float initializationValue = "+i+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n "+h+"\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+n+";\n\n vec4 minMaxValue = vec4("+i+");\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < "+l+"; i += 4) {\n int inIdx = inOffset + i;\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n "+p+"\n }\n\n int inIdx = inOffset + "+l+";\n if ("+(1===c)+") {\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+p+"\n } else if ("+(2===c)+") {\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n "+p+"\n } else if ("+(3===c)+") {\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n "+p+"\n }\n setOutput("+u+");\n }\n "}}(),ResizeBilinearBackpropProgram=function(){return function(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,o=r[1],a=r[2],i=e.shape,s=i[1],u=i[2],l=[n&&s>1?o-1:o,n&&u>1?a-1:a],c=[n&&s>1?s-1:s,n&&u>1?u-1:u],p=l[0]/c[0],d=l[1]/c[1],h=1/p,f=1/d,m=2*Math.ceil(h)+2,g=2*Math.ceil(f)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+p+");\n const float widthScale = float("+d+");\n\n const float invHeightScale = float("+h+");\n const float invWidthScale = float("+f+");\n\n const int winHeight = int("+m+");\n const int winWidth = int("+g+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+s+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+u+") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), "+(o-1)+".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), "+(a-1)+".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "}}(),ResizeBilinearProgram=function(){return function(e,t,n,r){this.variableNames=["A"],this.outputShape=[];var o=e[0],a=e[1],i=e[2],s=e[3];this.outputShape=[o,t,n,s];var u=[r&&t>1?a-1:a,r&&n>1?i-1:i],l=[r&&t>1?t-1:t,r&&n>1?n-1:n];this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+u[0]/l[0]+",\n "+u[1]/l[1]+");\n const vec2 inputShapeRC = vec2("+a+".0, "+i+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n "}}(),ResizeNearestNeigborBackpropProgram=function(){return function(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,o=r[1],a=r[2],i=e.shape,s=i[1],u=i[2],l=[n&&s>1?o-1:o,n&&u>1?a-1:a],c=[n&&s>1?s-1:s,n&&u>1?u-1:u],p=l[0]/c[0],d=l[1]/c[1],h=1/p,f=1/d,m=2*Math.ceil(h)+2,g=2*Math.ceil(f)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+p+");\n const float widthScale = float("+d+");\n\n const float invHeightScale = float("+h+");\n const float invWidthScale = float("+f+");\n\n const int winHeight = int("+m+");\n const int winWidth = int("+g+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+s+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+u+") {\n continue;\n }\n\n float sourceFracRow =\n float("+l[0]+") *\n (float(dyR) / float("+c[0]+"));\n\n float sourceFracCol =\n float("+l[1]+") *\n (float(dyC) / float("+c[1]+"));\n\n int sourceNearestRow = int(min(\n float(int("+o+") - 1),\n "+n+" ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int("+a+") - 1),\n "+n+" ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "}}(),ResizeNearestNeighborProgram=function(){return function(e,t,n,r){this.variableNames=["A"],this.outputShape=[];var o=e[0],a=e[1],i=e[2],s=e[3];this.outputShape=[o,t,n,s];var u=[r&&t>1?a-1:a,r&&n>1?i-1:i],l=[r&&t>1?t-1:t,r&&n>1?n-1:n],c=r?"0.5":"0.0";this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+u[0]/l[0]+",\n "+u[1]/l[1]+");\n const vec2 inputShapeRC = vec2("+a+".0, "+i+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + "+c+")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n "}}(),ReverseProgram=function(){return function(e,t){this.variableNames=["x"];var n=e.length;if(n>4)throw new Error("WebGL backend: Reverse of rank-"+n+" tensor is not yet supported");if(this.outputShape=e,1!==n){var r=e.map(function(n,r){return function(n){return-1!==t.indexOf(n)&&1!==e[n]?e[n]+" - coords["+n+"] - 1":"coords["+n+"]"}(r)}).join(","),o=getCoordsDataType(n);this.userCode="\n void main() {\n "+o+" coords = getOutputCoords();\n setOutput(getX("+r+"));\n }\n "}else this.userCode="\n void main() {\n int coord = getOutputCoords();\n setOutput(getX("+e[0]+" - coord - 1));\n }\n "}}(),SegmentOpProgram=function(){return function(e,t){this.variableNames=["x","segmentIds"];var n=e.windowSize,r=e.batchSize,o=e.inSize,a=e.numSegments,i=a*Math.ceil(o/n);this.outputShape=[r,i];var s=4*Math.floor(n/4),u=n%4,l="\n sumValue += dot(values, filter);\n ",c="";o%n>0&&(c="\n if (inIdx < 0 || inIdx >= "+o+") {\n return initializationValue;\n }\n ");var p="";o%n>0&&(p="\n if (inIdx < 0 || inIdx >= "+o+") {\n return -1.0;\n }\n "),this.userCode="\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n "+c+"\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n "+p+"\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n "+a+")) * float("+n+"));\n int currentSeg = int(mod(float(outIdx), float("+a+")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < "+s+"; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n "+l+"\n }\n\n int inIdx = inOffset + "+s+";\n if ("+(1===u)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n "+l+"\n } else if ("+(2===u)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n "+l+"\n } else if ("+(3===u)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n "+l+"\n }\n setOutput(sumValue);\n }\n "}}(),SelectProgram=function(){return function(e,t,n){var r,o;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error("Where for rank "+n+" is not yet supported");if(1===n)o="resRC",r="resRC";else{for(var a=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],s=[],u=0;u= 1.0) {\n setOutput(getA("+o+"));\n } else {\n setOutput(getB("+o+"));\n }\n }\n "}}(),SliceProgram=function(){function e(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;var t=getCoordsDataType(this.rank),n=getCoords$1(this.rank);this.userCode="\n uniform "+t+" start;\n\n void main() {\n "+t+" sourceLoc = start + getOutputCoords();\n setOutput(getSource("+n+"));\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+e.length+")");return function(n,r){if(null!=t.startLoc||(t.startLoc=n.getUniformLocationNoThrow(r,"start"),null!=t.startLoc))if(1===t.rank)n.gl.uniform1i(t.startLoc,e[0]);else if(2===t.rank)n.gl.uniform2i(t.startLoc,e[0],e[1]);else if(3===t.rank)n.gl.uniform3i(t.startLoc,e[0],e[1],e[2]);else{if(4!==t.rank)throw Error("Slicing for rank "+t.rank+" is not yet supported");n.gl.uniform4i(t.startLoc,e[0],e[1],e[2],e[3])}}},e}();function getCoords$1(e){if(1===e)return"sourceLoc";if(2===e)return"sourceLoc.x, sourceLoc.y";if(3===e)return"sourceLoc.x, sourceLoc.y, sourceLoc.z";if(4===e)return"sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w";throw Error("Slicing for rank "+e+" is not yet supported")}var StridedSliceProgram=function(){return function(e,t,n){this.variableNames=["x"],this.outputShape=n,this.rank=n.length;var r=getCoordsDataType(this.rank),o="";o=1===this.rank?"coords * strides + begin":n.map(function(e,t){return"coords["+t+"] * strides["+t+"] + begin["+t+"]"}).join(","),this.userCode="\n "+r+" begin = "+r+"("+e+");\n "+r+" strides = "+r+"("+t+");\n\n void main() {\n "+r+" coords = getOutputCoords();\n setOutput(getX("+o+"));\n }\n "}}(),TextureManager=function(){function e(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return e.prototype.acquireTexture=function(e,t){var n,r=getPhysicalFromLogicalTextureType(t),o=getKeyFromTextureShape(e,r);if(o in this.freeTextures||(this.freeTextures[o]=[]),o in this.usedTextures||(this.usedTextures[o]=[]),this.freeTextures[o].length>0){this.numFreeTextures--,this.numUsedTextures++,this.log();var a=this.freeTextures[o].shift();return this.usedTextures[o].push(a),a}return this.numUsedTextures++,this.log(),r===PhysicalTextureType.FLOAT32?n=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):r===PhysicalTextureType.FLOAT16?n=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):r===PhysicalTextureType.UNSIGNED_BYTE&&(n=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[o].push(n),n},e.prototype.releaseTexture=function(e,t,n){var r=getKeyFromTextureShape(t,getPhysicalFromLogicalTextureType(n));r in this.freeTextures||(this.freeTextures[r]=[]),this.freeTextures[r].push(e),this.numFreeTextures++,this.numUsedTextures--;var o=this.usedTextures[r],a=o.indexOf(e);if(a<0)throw new Error("Cannot release a texture that was never provided by this texture manager");o.splice(a,1),this.log()},e.prototype.log=function(){if(this.logEnabled){var e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",this.numFreeTextures+" / "+this.numUsedTextures,"("+e+")")}},e.prototype.getNumUsedTextures=function(){return this.numUsedTextures},e.prototype.getNumFreeTextures=function(){return this.numFreeTextures},e.prototype.dispose=function(){var e=this;if(null!=this.freeTextures){for(var t in this.freeTextures)this.freeTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});for(var t in this.usedTextures)this.usedTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0}},e}();function getPhysicalFromLogicalTextureType(e){if(e===TextureUsage.DOWNLOAD||e===TextureUsage.PIXELS)return PhysicalTextureType.UNSIGNED_BYTE;if(e===TextureUsage.UPLOAD)return PhysicalTextureType.FLOAT32;if(e===TextureUsage.RENDER)return ENV.get("WEBGL_RENDER_FLOAT32_ENABLED")?PhysicalTextureType.FLOAT32:PhysicalTextureType.FLOAT16;throw new Error("Unknown logical texture type "+e)}function getKeyFromTextureShape(e,t){return e[0]+"_"+e[1]+"_"+t}var TileProgram=function(){return function(e,t){this.variableNames=["A"];for(var n=new Array(e.length),r=0;r5)throw Error("Tile for rank "+t+" is not yet supported");if(1===t)return"imod(resRC, "+e[0]+")";for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[],o=0;o6)throw Error("Transpose for rank "+t+" is not yet supported");for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(t),o=0;o= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n";function STEP(e){return void 0===e&&(e=0),CHECK_NAN_SNIPPET$1+"\n return x > 0.0 ? 1.0 : float("+e+");\n "}var NEG="return -x;",CEIL="return ceil(x);",FLOOR="return floor(x);",SIGN="\n if (isNaN(x)) { return 0.0; }\n return sign(x);\n",ROUND="\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n",EXP="return exp(x);",EXPM1="return exp(x) - 1.0;",LOG="if (x < 0.0) return NAN;\n return log(x);",LOG1P="return log(1.0 + x);",SQRT="return sqrt(x);",RSQRT="return inversesqrt(x);",SIGMOID="return 1.0 / (1.0 + exp(-1.0 * x));",SOFTPLUS="\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n",SIN=CHECK_NAN_SNIPPET$1+"\n return sin(x);\n",COS=CHECK_NAN_SNIPPET$1+"\n return cos(x);\n",TAN="return tan(x);",ASIN="return asin(x);",ACOS="return acos(x);",ATAN=CHECK_NAN_SNIPPET$1+"\n return atan(x);\n",SINH="\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n",COSH="\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n",TANH="\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n",ASINH="return log(x + sqrt(x * x + 1.0));",ACOSH=CHECK_NAN_SNIPPET$1+"\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));",ATANH=CHECK_NAN_SNIPPET$1+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;",ERF='\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = '+ERF_P+";\n float a1 = "+ERF_A1+";\n float a2 = "+ERF_A2+";\n float a3 = "+ERF_A3+";\n float a4 = "+ERF_A4+";\n float a5 = "+ERF_A5+";\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n",SQUARE="return x * x;",RECIPROCAL="return 1.0 / x;",LOGICAL_NOT="return float(!(x >= 1.0));",TO_INT="return float(int(x));";function concat1d_(e){return concat(e,0)}function concat2d_(e,t){return concat(e,t)}function concat3d_(e,t){return concat(e,t)}function concat4d_(e,t){return concat(e,t)}function concat_(e,t){void 0===t&&(t=0),assert(e.length>=1,"Pass at least one tensor to concat");var n=convertToTensorArray(e,"tensors","concat"),r=n[0];if(1===n.length)return r;for(var o=parseAxisParam(t,r.shape),a=1;a>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}(e),o=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+1.1102230246251565e-16*(2097152*a()|0)},a.quick=a,o&&("object"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.alea=o}(0,e,!1)}),xor128=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function o(e,t){var n=new function(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&("object"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xor128=o}(0,e,!1)}),xorwow=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function o(e,t){var n=new function(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&("object"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xorwow=o}(0,e,!1)}),xorshift7=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.x=e.x.slice(),t.i=e.i,t}function o(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.x,o=t.i;return e=r[o],n=(e^=e>>>7)^e<<24,n^=(e=r[o+1&7])^e>>>10,n^=(e=r[o+3&7])^e>>>3,n^=(e=r[o+4&7])^e<<7,e=r[o+7&7],n^=(e^=e<<13)^e<<9,r[o]=n,t.i=o+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(o.x&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xorshift7=o}(0,e,!1)}),xor4096=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function o(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.w,o=t.X,a=t.i;return t.w=r=r+1640531527|0,n=o[a+34&127],e=o[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=o[a]=n^e,t.i=a,n+(r^r>>>16)|0},function(e,t){var n,r,o,a,i,s=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),o=0,a=-32;a>>15,r^=r<<4,r^=r>>>13,a>=0&&(i=i+1640531527|0,o=0==(n=s[127&a]^=r+i)?o+1:0);for(o>=128&&(s[127&(t&&t.length||0)]=-1),o=127,a=512;a>0;--a)r=s[o+34&127],n=s[o=o+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[o]=r^n;e.w=i,e.X=s,e.i=o}(t,e)}(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(o.X&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xor4096=o}(0,e,!1)}),tychei=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function o(e,t){var n=new function(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,o=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^o,t.a=o-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&("object"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.tychei=o}(0,e,!1)}),seedrandom=createCommonjsModule(function(e){!function(t,n){var r,o=this,a=256,i=6,s="random",u=n.pow(a,i),l=n.pow(2,52),c=2*l,p=a-1;function d(e,d,g){var v=[],y=f(function e(t,n){var r,o=[],a=typeof t;if(n&&"object"==a)for(r in t)try{o.push(e(t[r],n-1))}catch(e){}return o.length?o:"string"==a?t:t+"\0"}((d=1==d?{entropy:!0}:d||{}).entropy?[e,m(t)]:null==e?function(){try{var e;return r&&(e=r.randomBytes)?e=e(a):(e=new Uint8Array(a),(o.crypto||o.msCrypto).getRandomValues(e)),m(e)}catch(e){var n=o.navigator,i=n&&n.plugins;return[+new Date,o,i,o.screen,m(t)]}}():e,3),v),x=new function(e){var t,n=e.length,r=this,o=0,i=r.i=r.j=0,s=r.S=[];n||(e=[n++]);for(;o=c;)e/=2,t/=2,n>>>=1;return(e+n)/t};return T.int32=function(){return 0|x.g(4)},T.quick=function(){return x.g(4)/4294967296},T.double=T,f(m(x.S),t),(d.pass||g||function(e,t,r,o){return o&&(o.S&&h(o,x),e.state=function(){return h(x,{})}),r?(n[s]=e,t):e})(T,y,"global"in d?d.global:this==n,d.state)}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function f(e,t){for(var n,r=e+"",o=0;o=1||0===i);var s=Math.sqrt(-2*Math.log(i)/i);t=this.mean+this.stdDev*o*s,n=this.mean+this.stdDev*a*s,this.truncated&&!this.isValidTruncated(t)||(r=!0)}return this.truncated&&!this.isValidTruncated(n)||(this.nextVal=this.convertValue(n)),this.convertValue(t)},e.prototype.convertValue=function(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)},e.prototype.isValidTruncated=function(e){return e<=this.upper&&e>=this.lower},e}();function clone_(e){var t=convertToTensor(e,"x","clone");return ENV.engine.runKernel(function(e){return Tensor.make(t.shape,{dataId:t.dataId},t.dtype)},{$x:t},function(e){return{$x:function(){return e.toFloat()}}})}function eye_(e,t,n,r){void 0===r&&(r="float32"),null==t&&(t=e);for(var o=buffer([e,t],r),a=e<=t?e:t,i=0;i2)throw new Error("Rank of probabilities must be 1 or 2, but is "+i);n=n||Math.random();var s=1===i?o.as2D(1,-1):o,u=ENV.engine.runKernel(function(e){return e.multinomial(s,r,t,n)},{logits2D:s});return 1===i?u.as1D():u}function oneHot_(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=0);var o=convertToTensor(e,"indices","oneHot","int32");if(assert("int32"===o.dtype,"Indices must be of dtype `int32`"),t<2)throw new Error("Error in oneHot: depth must be >=2, but it is "+t);return ENV.engine.runKernel(function(e){return e.oneHot(o,t,n,r)},{$indices:o})}function fromPixels_(e,t){if(void 0===t&&(t=3),t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");return ENV.engine.fromPixels(e,t)}function toPixels(e,t){return __awaiter(this,void 0,void 0,function(){var n,r,o,a,i,s,u,l,c,p,d,h,f,m,g,v,y,x,T,S;return __generator(this,function(b){switch(b.label){case 0:if(2!==(n=convertToTensor(e,"img","toPixels","int32")).rank&&3!==n.rank)throw new Error("toPixels only supports rank 2 or 3 tensors, got rank "+n.rank+".");if(r=n.shape.slice(0,2),o=r[0],a=r[1],(i=2===n.rank?1:n.shape[2])>4||2===i)throw new Error("toPixels only supports depth of size 1, 3 or 4 but got "+i);return s=n.min(),u=n.max(),[4,s.data()];case 1:return l=b.sent()[0],[4,u.data()];case 2:if(c=b.sent()[0],s.dispose(),u.dispose(),"float32"===n.dtype){if(l<0||c>1)throw new Error("Tensor values for a float32 Tensor must be in the range [0 - 1] but got range ["+l+" - "+c+"].")}else{if("int32"!==n.dtype)throw new Error("Unsupported type for toPixels: "+n.dtype+". Please use float32 or int32 tensors.");if(l<0||c>255)throw new Error("Tensor values for a int32 Tensor must be in the range [0 - 255] but got range ["+l+" - "+c+"].")}return[4,n.data()];case 3:for(p=b.sent(),d="float32"===n.dtype?255:1,h=new Uint8ClampedArray(a*o*4),f=0;f=1,"Pass at least one tensor to tf.stack"),1===n.length)return n[0].expandDims(t);var r=n[0].rank,o=n[0].shape,a=n[0].dtype;assert(t<=r,"Axis must be <= rank of the tensor"),n.forEach(function(e){assertShapesMatch(o,e.shape,"All tensors passed to stack must have matching shapes")}),n.forEach(function(e){assert(a===e.dtype,"All tensors passed to stack must have matching dtypes")});var i=n.map(function(e){return e.expandDims(t)});return concat(i,t)}function batchToSpaceND_(e,t,n){var r=convertToTensor(e,"x","batchToSpaceND"),o=t.reduce(function(e,t){return e*t});return assert(r.rank>=1+t.length,"input rank should be > than [blockShape] but got "+r.rank),assert(n.length===t.length,"crops.shape[0] must be equal to [blockShape] but got "+n.length),assert(r.shape[0]%o==0,"input tensor batch must be divisible by prod( blockShape )"),ENV.engine.runKernel(function(e){return e.batchToSpaceND(r,t,n)},{})}function spaceToBatchND_(e,t,n){var r=convertToTensor(e,"x","spaceToBatchND");return assert(r.rank>=1+t.length,"input rank should be > than [blockShape] but got "+r.rank),assert(n.length===t.length,"paddings.shape[0] must be equal to [blockShape], got "+n.length),assert(r.shape.reduce(function(e,n,r){return r>0&&r<=t.length?e&&n%t[r-1]==0:e},!0),"input spatial dimensions must be divisible by blockShapes"),ENV.engine.runKernel(function(e){return e.spaceToBatchND(r,t,n)},{})}function unstack_(e,t){void 0===t&&(t=0);for(var n,r=convertToTensor(e,"x","unstack"),o=r.shape[t],a=Array(r.rank-1).fill(0),i=0,s=0;s0?this.gpgpu.beginQuery():{startMs:performance.now(),endMs:null}},e.prototype.endTimer=function(e){return ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(this.gpgpu.endQuery(),e):(e.endMs=performance.now(),e)},e.prototype.getQueryTime=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){return ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?[2,this.gpgpu.waitForQueryAndGetTime(e)]:[2,(t=e).endMs-t.startMs]})})},e.prototype.disposeData=function(e){if(!this.pendingDisposal.has(e))if(this.pendingRead.has(e))this.pendingDisposal.add(e);else if(this.texData.has(e)){var t=this.texData.get(e),n=t.texture,r=t.texShape,o=t.usage;null!=n&&this.releaseTexture(e,n,r,o),this.texData.delete(e)}},e.prototype.getTexture=function(e){return this.uploadToGPU(e),this.texData.get(e).texture},e.prototype.getGPGPUContext=function(){return this.gpgpu},e.prototype.getCanvas=function(){return this.canvas},e.prototype.slice=function(e,t,n){var r=new SliceProgram(n),o=r.getCustomSetupFunc(t);return this.compileAndRun(r,[e],null,o)},e.prototype.stridedSlice=function(e,t,n,r,o,a){var i=getStridedSlicedInfo(e.shape,t,n,r,o,a),s=i[0],u=i[1];if(u.some(function(e){return 0===e}))return tensor([],u);var l=new StridedSliceProgram(s,r,u);return this.compileAndRun(l,[e])},e.prototype.reverse=function(e,t){var n=new ReverseProgram(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.concat=function(e,t){var n=new ConcatProgram(e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.neg=function(e){var t=new UnaryOpProgram(e.shape,NEG);return this.compileAndRun(t,[e])},e.prototype.matMul=function(e,t,n,r){var o=new MatMulProgram(e.shape,t.shape,n,r);return this.compileAndRun(o,[e,t])},e.prototype.multiply=function(e,t){var n=new BinaryOpProgram(MUL,e.shape,t.shape),r=this.makeOutputArray(n.outputShape,upcastType(e.dtype,t.dtype));return this.compileAndRun(n,[e,t],r)},e.prototype.batchNormalization=function(e,t,n,r,o,a){var i=[e,t,n],s=null;null!=a&&(s=a.shape,i.push(a));var u=null;null!=o&&(u=o.shape,i.push(o));var l=new BatchNormProgram(e.shape,t.shape,n.shape,s,u,r);return this.compileAndRun(l,i)},e.prototype.localResponseNormalization4D=function(e,t,n,r,o){var a=new LRNProgram(e.shape,t,n,r,o);return this.compileAndRun(a,[e])},e.prototype.LRNGrad=function(e,t,n,r,o,a,i){var s=new LRNGradProgram(t.shape,r,o,a,i);return this.compileAndRun(s,[t,n,e])},e.prototype.tile=function(e,t){var n=new TileProgram(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.pad=function(e,t,n){var r=new PadProgram(e.shape,t,n);return this.compileAndRun(r,[e])},e.prototype.transpose=function(e,t){var n=new TransposeProgram(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.gather=function(e,t,n){var r=new GatherProgram(e.shape,t.size,n);return this.compileAndRun(r,[e,t])},e.prototype.batchToSpaceND=function(e,t,n){assert(e.rank<=4,"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");var r=t.reduce(function(e,t){return e*t}),o=getReshaped(e.shape,t,r),a=getPermuted(o.length,t.length),i=getReshapedPermuted(e.shape,t,r),s=getSliceBeginCoords(n,t.length),u=getSliceSize(i,n,t.length);return e.reshape(o).transpose(a).reshape(i).slice(s,u)},e.prototype.spaceToBatchND=function(e,t,n){assert(e.rank<=4,"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");var r=t.reduce(function(e,t){return e*t}),o=[[0,0]];o.push.apply(o,n);for(var a=1+t.length;athis.NUM_BYTES_BEFORE_PAGING)for(var d=this.numBytesInGPU-this.NUM_BYTES_BEFORE_PAGING;d>0&&this.lruDataGPU.length>0;){var h=this.lruDataGPU.shift(),f=this.texData.get(h),m=f.shape,g=f.dtype;d-=this.computeBytes(m,g),this.read(h)}return p&&(s=this.endTimer(s),this.activeTimers.push(this.getQueryTime(s))),n},e.prototype.getAndSaveBinary=function(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]},e.prototype.getTextureManager=function(){return this.textureManager},e.prototype.dispose=function(){if(!this.disposed){for(var e in this.binaryCache)this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram);this.textureManager.dispose(),this.canvas.remove(),null!=this.fromPixelsCanvas&&this.fromPixelsCanvas.remove(),this.gpgpuCreatedLocally&&this.gpgpu.dispose(),this.disposed=!0}},e.prototype.throwIfNoData=function(e){if(!this.texData.has(e))throw new Error("WebGL backend: No data found for this tensor. Did you change your backend in the middle of the program? New backends can't use Tensors created with previous backends")},e.prototype.uploadToGPU=function(e){this.throwIfNoData(e);var t=this.texData.get(e),n=t.shape,r=t.values,o=t.texture,a=t.dtype,i=t.usage;if(null==o){var s,u=null!=this.activeTimers;u&&(s=performance.now());var l=getTextureShapeFromLogicalShape(this.gpgpu.gl,n);t.texShape=l;var c=this.acquireTexture(e,l,i);t.texture=c,null!=r&&(this.gpgpu.uploadMatrixToTexture(c,l[0],l[1],typedArrayToFloat32(r,a)),t.values=null,u&&(this.uploadWaitMs+=performance.now()-s))}else{this.lruDataGPU.indexOf(e)>=0&&(this.lruDataGPU.splice(this.lruDataGPU.indexOf(e),1),this.lruDataGPU.push(e))}},e.prototype.cacheOnCPU=function(e,t){var n=this.delayedStorage,r=this.texData.get(e),o=r.texture,a=r.texShape,i=r.dtype,s=r.usage;n&&null!=o&&(this.releaseTexture(e,o,a,s),r.texture=null,r.texShape=null),null!=t&&(r.values=float32ToTypedArray(t,i))},e.prototype.releaseTexture=function(e,t,n,r){var o=this.texData.get(e),a=o.shape,i=o.dtype,s=this.lruDataGPU.indexOf(e);s>=0&&this.lruDataGPU.splice(s,1),this.numBytesInGPU-=this.computeBytes(a,i),this.textureManager.releaseTexture(t,n,r)},e.prototype.acquireTexture=function(e,t,n){var r=this.texData.get(e),o=r.shape,a=r.dtype;return this.lruDataGPU.push(e),this.numBytesInGPU+=this.computeBytes(o,a),this.textureManager.acquireTexture(t,n)},e.prototype.computeBytes=function(e,t){return sizeFromShape(e)*bytesPerElement(t)},e}();function float32ToTypedArray(e,t){if("float32"===t)return e;if("int32"===t||"bool"===t){for(var n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length),r=0;r=0?e:(assert(-1===e,"Bad value in size"),a.shape[t]-r[t])}),assertParamsValid(a,r,o);var i=a.shape;return ENV.engine.runKernel(function(e){return e.slice(a,r,o)},{$x:a},function(e){for(var t=[],n=0;n0&&(t=t.sum(r)),t.reshape(n.shape)},$b:function(){var t=e,n=getReductionAxes(r.shape,o);return n.length>0&&(t=t.sum(n)),t.reshape(r.shape)}}})}function addN_(e){assert(Array.isArray(e),function(){return"The param passed to tf.addN() must be a list of tensors"}),assert(e.length>=1,function(){return"Must pass at least one tensor to tf.addN(), but got "+e.length});var t=e.map(function(e,t){return convertToTensor(e,"tensors"+t,"addN")}),n=t[0];t.forEach(function(e){if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(function(e){if(!arraysEqual(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});var r=t;return ENV.engine.runKernel(function(e){return e.addN(t)},r,function(e){var n={};return t.forEach(function(t,r){n[r]=function(){return e.clone()}}),n})}function addStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in addStrict: "),e.add(t)}function sub_(e,t){var n=convertToTensor(e,"a","sub"),r=convertToTensor(t,"b","sub");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.subtract(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=e,r=getReductionAxes(n.shape,o);return r.length>0&&(t=t.sum(r)),t.reshape(n.shape)},$b:function(){var t=e,n=getReductionAxes(r.shape,o);return n.length>0&&(t=t.sum(n)),t.neg().reshape(r.shape)}}})}function subStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in subStrict: "),e.sub(t)}function pow_(e,t){var n=convertToTensor(e,"base","pow"),r=convertToTensor(t,"exp","pow"),o=assertAndGetBroadcastShape(n.shape,r.shape);e=n.cast(upcastType(n.dtype,r.dtype)),t=r.cast(upcastType(n.dtype,r.dtype));return ENV.engine.runKernel(function(e,t){return t(e.pow(n,r))},{$base:n,$exp:r},function(e,t){var a=t[0];return{$base:function(){var t=e.mul(r.toFloat().mul(a.div(n))),i=getReductionAxes(n.shape,o);return i.length>0&&(t=t.sum(i)),t.reshape(n.shape)},$exp:function(){var t=e.mul(a.mul(n.log()).toFloat()),i=getReductionAxes(r.shape,o);return i.length>0&&(t=t.sum(i)),t.reshape(r.shape)}}})}function powStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in powStrict: "),e.pow(t)}function mul_(e,t){var n=convertToTensor(e,"a","mul"),r=convertToTensor(t,"b","mul");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.multiply(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=e.mul(r.toFloat()),a=getReductionAxes(n.shape,o);return a.length>0?t.sum(a).reshape(n.shape):t},$b:function(){var t=e.mul(n.toFloat()),a=getReductionAxes(r.shape,o);return a.length>0?t.sum(a).reshape(r.shape):t}}})}function mulStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in multiplyStrict: "),e.mul(t)}function div_(e,t){var n,r=convertToTensor(e,"a","div"),o=convertToTensor(t,"b","div");if(assertTypesMatch(r,o),"int32"===r.dtype&&"int32"===o.dtype)return floorDiv(r,o);n=function(e){return e.realDivide(r,o)};var a=assertAndGetBroadcastShape(r.shape,o.shape);return ENV.engine.runKernel(n,{$a:r,$b:o},function(e){return{$a:function(){var t=e.div(o.toFloat()),n=getReductionAxes(r.shape,a);return n.length>0?t.sum(n).reshape(r.shape):t},$b:function(){var t=e.mul(r.toFloat()),n=getReductionAxes(o.shape,a);n.length>0&&(t=t.sum(n).reshape(o.shape));var i=o.square();return t.div(i.toFloat()).neg()}}})}function floorDiv_(e,t){var n=convertToTensor(e,"a","floorDiv"),r=convertToTensor(t,"b","floorDiv");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.floorDiv(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=e.div(r.toFloat()),a=getReductionAxes(n.shape,o);return a.length>0?t.sum(a).reshape(n.shape):t},$b:function(){var t=e.mul(n.toFloat()),a=getReductionAxes(r.shape,o);a.length>0&&(t=t.sum(a).reshape(r.shape));var i=r.square();return t.div(i.toFloat()).neg()}}})}function divStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in divideStrict: "),e.div(t)}function mod_(e,t){var n=convertToTensor(e,"a","mod"),r=convertToTensor(t,"b","mod");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.mod(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=getReductionAxes(n.shape,o);return t.length>0?e.sum(t).reshape(n.shape):e},$b:function(){var t=e.mul(n.div(r).floor().neg()),a=getReductionAxes(r.shape,o);return a.length>0?t.sum(a).reshape(r.shape):t}}})}function modStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in modStrict: "),e.mod(t)}function minimum_(e,t){var n=convertToTensor(e,"a","minimum"),r=convertToTensor(t,"b","minimum");assertTypesMatch(n,r),"bool"===n.dtype&&(n=n.toInt()),"bool"===r.dtype&&(r=r.toInt()),assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.minimum(n,r)},{$a:n,$b:r},function(e){return{$a:function(){return e.mul(n.lessEqual(r).toFloat())},$b:function(){return e.mul(n.greater(r).toFloat())}}})}function minimumStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in minimumStrict: "),e.minimum(t)}function maximum_(e,t){var n=convertToTensor(e,"a","maximum"),r=convertToTensor(t,"b","maximum");assertTypesMatch(n,r),"bool"===n.dtype&&(n=n.toInt()),"bool"===r.dtype&&(r=r.toInt()),assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.maximum(n,r)},{$a:n,$b:r},function(e){return{$a:function(){return e.mul(n.greaterEqual(r).toFloat())},$b:function(){return e.mul(n.less(r).toFloat())}}})}function maximumStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in minimumStrict: "),e.maximum(t)}function squaredDifference_(e,t){var n=convertToTensor(e,"a","squaredDifference"),r=convertToTensor(t,"b","squaredDifference");assertTypesMatch(n,r),assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.squaredDifference(n,r)},{$a:n,$b:r},function(e){var t=scalar(2);return{$a:function(){return e.mul(n.sub(r).mul(t))},$b:function(){return e.mul(r.sub(n).mul(t))}}})}function squaredDifferenceStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in squaredDifferenceStrict: "),e.squaredDifference(t)}function atan2_(e,t){var n=convertToTensor(e,"a","atan2"),r=convertToTensor(t,"b","atan2");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.atan2(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=add(n.square(),r.square()),a=e.mul(r.div(t)),i=getReductionAxes(n.shape,o);return i.length>0&&(a=a.sum(i)),a.reshape(n.shape)},$b:function(){var t=add(n.square(),r.square()),a=neg(e.mul(n.div(t))),i=getReductionAxes(r.shape,o);return i.length>0&&(a=a.sum(i)),a.reshape(r.shape)}}})}var add=op({add_:add_}),addN=op({addN_:addN_}),addStrict=op({addStrict_:addStrict_}),atan2=op({atan2_:atan2_}),div=op({div_:div_}),divStrict=op({divStrict_:divStrict_}),floorDiv=op({floorDiv_:floorDiv_}),maximum=op({maximum_:maximum_}),maximumStrict=op({maximumStrict_:maximumStrict_}),minimum=op({minimum_:minimum_}),minimumStrict=op({minimumStrict_:minimumStrict_}),mod=op({mod_:mod_}),modStrict=op({modStrict_:modStrict_}),mul=op({mul_:mul_}),mulStrict=op({mulStrict_:mulStrict_}),pow=op({pow_:pow_}),powStrict=op({powStrict_:powStrict_}),squaredDifference=op({squaredDifference_:squaredDifference_}),squaredDifferenceStrict=op({squaredDifferenceStrict_:squaredDifferenceStrict_}),sub=op({sub_:sub_}),subStrict=op({subStrict_:subStrict_});function logicalNot_(e){var t=convertToTensor(e,"x","logicalNot","bool");return assert("bool"===t.dtype,"Error Array must be of type bool."),ENV.engine.runKernel(function(e){return e.logicalNot(t)},{$x:t})}function logicalAnd_(e,t){var n=convertToTensor(e,"a","logicalAnd","bool"),r=convertToTensor(t,"b","logicalAnd","bool");return assert("bool"===n.dtype&&"bool"===r.dtype,"Error Array must be of type bool."),assertAndGetBroadcastShape(n.shape,r.shape),ENV.engine.runKernel(function(e){return e.logicalAnd(n,r)},{$a:n,$b:r})}function logicalOr_(e,t){var n=convertToTensor(e,"a","logicalOr","bool"),r=convertToTensor(t,"b","logicalOr","bool");return assert("bool"===n.dtype&&"bool"===r.dtype,"Error Array must be of type bool."),assertAndGetBroadcastShape(n.shape,r.shape),ENV.engine.runKernel(function(e){return e.logicalOr(n,r)},{$a:n,$b:r})}function logicalXor_(e,t){var n=convertToTensor(e,"a","logicalXor","bool"),r=convertToTensor(t,"b","logicalXor","bool");return assert("bool"===n.dtype&&"bool"===r.dtype,"Error Array must be of type bool."),assertAndGetBroadcastShape(n.shape,r.shape),logicalOr(e,t).logicalAnd(logicalAnd(e,t).logicalNot())}function where_(e,t,n){var r=convertToTensor(t,"a","where"),o=convertToTensor(n,"b","where"),a=convertToTensor(e,"condition","where","bool");assert("bool"===a.dtype,"Error Condition must be of type bool."),assertShapesMatch(r.shape,o.shape,"Error in where: "),1===a.rank?assert(a.shape[0]===r.shape[0],"The first dimension of `a` must match the size of `condition`."):assertShapesMatch(a.shape,o.shape,"Error in where: ");return ENV.engine.runKernel(function(e){return e.select(a,r,o)},{$condition:a,$a:r,$b:o},function(e){return{$condition:function(){return zerosLike(a)},$a:function(){return e.mul(a.cast(r.dtype))},$b:function(){return e.mul(a.logicalNot().cast(o.dtype))}}})}function whereAsync_(e){return __awaiter(this,void 0,void 0,function(){var t,n,r;return __generator(this,function(o){switch(o.label){case 0:return assert("bool"===(t=convertToTensor(e,"condition","where","bool")).dtype,"Condition must be of type bool."),[4,t.data()];case 1:return n=o.sent(),r=whereImpl(t.shape,n),e!==t&&t.dispose(),[2,r]}})})}var logicalAnd=op({logicalAnd_:logicalAnd_}),logicalNot=op({logicalNot_:logicalNot_}),logicalOr=op({logicalOr_:logicalOr_}),logicalXor=op({logicalXor_:logicalXor_}),where=op({where_:where_}),whereAsync=whereAsync_;function relu_(e){var t=convertToTensor(e,"x","relu");if("bool"===t.dtype)return t.toInt();return ENV.engine.runKernel(function(e){return e.relu(t)},{$x:t},function(e){var n=t.step();return{$x:function(){return e.mulStrict(n.toFloat())}}})}function elu_(e){var t=convertToTensor(e,"x","elu");return ENV.engine.runKernel(function(e,n){return n(e.elu(t))},{$x:t},function(e,t){var n=t[0];return{$x:function(){return ENV.engine.runKernel(function(t){return t.eluDer(e,n)},{dy:e,y:n})}}})}function selu_(e){var t=convertToTensor(e,"x","selu");return ENV.engine.runKernel(function(e){return e.selu(t)},{$x:t},function(e){return{$x:function(){var n=t.greater(scalar(0)),r=scalar(SELU_SCALEALPHA),o=scalar(SELU_SCALE),a=e.mul(o),i=e.mul(r).mul(t.toFloat().exp());return where(n,a,i)}}})}function leakyRelu_(e,t){void 0===t&&(t=.2);var n=convertToTensor(e,"x","leakyRelu");return maximum(scalar(t).mul(n),n)}function prelu_(e,t){var n=convertToTensor(e,"x","prelu"),r=convertToTensor(t,"alpha","prelu"),o=scalar(0);return maximum(o,n).add(r.mul(minimum(o,n)))}var elu=op({elu_:elu_}),leakyRelu=op({leakyRelu_:leakyRelu_}),prelu=op({prelu_:prelu_}),relu=op({relu_:relu_}),selu=op({selu_:selu_});function transpose_(e,t){var n=convertToTensor(e,"x","transpose");if(null==t&&(t=n.shape.map(function(e,t){return t}).reverse()),assert(n.rank===t.length,"Error in transpose: rank of input "+n.rank+" must match length of perm "+t+"."),t.forEach(function(e){assert(e>=0&&eo)throw new Error("'k' passed to topk() must be <= the last dimension ("+o+") but got "+t);var a=ENV.engine.runKernel(function(e){return e.topk(r,t,n)},{$x:r});return{values:a[0],indices:a[1]}}var Reduction,topk=op({topk_:topk_});function computeWeightedLoss_(e,t,n){void 0===n&&(n=Reduction.SUM_BY_NONZERO_WEIGHTS);var r=convertToTensor(e,"losses","computeWeightedLoss"),o=null;null!=t&&(o=convertToTensor(t,"weights","computeWeightedLoss"));var a=null==o?r:r.mul(o);if(n===Reduction.NONE)return a;if(n===Reduction.SUM)return a.sum();if(n===Reduction.MEAN){if(null==o)return a.mean();var i=sizeFromShape(r.shape)/sizeFromShape(o.shape),s=a.sum().div(o.sum());return i>1?s.div(scalar(i)):s}if(n===Reduction.SUM_BY_NONZERO_WEIGHTS){if(null==o)return a.sum().div(scalar(r.size));var u=o.mul(ones$1(r.shape)).notEqual(scalar(0)).sum().toFloat();return a.sum().div(u)}throw Error("Unknown reduction: "+n)}function absoluteDifference_(e,t,n,r){void 0===r&&(r=Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,"labels","absoluteDifference"),a=convertToTensor(t,"predictions","absoluteDifference"),i=null;null!=n&&(i=convertToTensor(n,"weights","absoluteDifference")),assertShapesMatch(o.shape,a.shape,"Error in absoluteDifference: ");var s=o.sub(a).abs();return computeWeightedLoss(s,i,r)}function meanSquaredError_(e,t,n,r){void 0===r&&(r=Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,"labels","meanSquaredError"),a=convertToTensor(t,"predictions","meanSquaredError"),i=null;null!=n&&(i=convertToTensor(n,"weights","meanSquaredError")),assertShapesMatch(o.shape,a.shape,"Error in meanSquaredError: ");var s=o.squaredDifference(a);return computeWeightedLoss(s,i,r)}function cosineDistance_(e,t,n,r,o){void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,"labels","cosineDistance"),i=convertToTensor(t,"predictions","cosineDistance"),s=null;null!=r&&(s=convertToTensor(r,"weights","cosineDistance")),assertShapesMatch(a.shape,i.shape,"Error in cosineDistance: ");var u=scalar(1).sub(a.mul(i).sum(n,!0));return computeWeightedLoss(u,s,o)}function hingeLoss_(e,t,n,r){void 0===r&&(r=Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,"labels","hingeLoss"),a=convertToTensor(t,"predictions","hingeLoss"),i=null;null!=n&&(i=convertToTensor(n,"weights","hingeLoss")),assertShapesMatch(o.shape,a.shape,"Error in hingeLoss: ");var s=scalar(1);o=scalar(2).mul(o).sub(s);var u=s.sub(o.mul(a)).relu();return computeWeightedLoss(u,i,r)}function logLoss_(e,t,n,r,o){void 0===r&&(r=1e-7),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,"labels","logLoss"),i=convertToTensor(t,"predictions","logLoss"),s=null;null!=n&&(s=convertToTensor(n,"weights","logLoss")),assertShapesMatch(a.shape,i.shape,"Error in logLoss: ");var u=scalar(1),l=scalar(r),c=a.mul(i.add(l).log()).neg().sub(u.sub(a).mul(u.sub(i).add(l).log()));return computeWeightedLoss(c,s,o)}function sigmoidCrossEntropyWithLogits_(e,t){var n=convertToTensor(e,"labels","sigmoidCrossEntropyWithLogits"),r=convertToTensor(t,"logits","sigmoidCrossEntropyWithLogits");assertShapesMatch(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");var o=r.relu(),a=r.mul(n),i=r.abs().neg().exp().log1p();return o.sub(a).add(i)}function sigmoidCrossEntropy_(e,t,n,r,o){void 0===r&&(r=0),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,"multiClassLabels","sigmoidCrossEntropy"),i=convertToTensor(t,"logits","sigmoidCrossEntropy"),s=null;if(null!=n&&(s=convertToTensor(n,"weights","sigmoidCrossEntropy")),assertShapesMatch(a.shape,i.shape,"Error in sigmoidCrossEntropy: "),r>0){var u=scalar(r),l=scalar(1),c=scalar(.5);a=a.mul(l.sub(u)).add(c.mul(u))}var p=sigmoidCrossEntropyWithLogits_(a,i);return computeWeightedLoss(p,s,o)}function huberLoss_(e,t,n,r,o){void 0===r&&(r=1),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,"labels","huberLoss"),i=convertToTensor(t,"predictions","huberLoss"),s=null;null!=n&&(s=convertToTensor(n,"weights","huberLoss")),assertShapesMatch(a.shape,i.shape,"Error in huberLoss: ");var u=scalar(r),l=i.sub(a).abs(),c=minimum(l,u),p=l.sub(c),d=scalar(.5).mul(c.square()).add(u.mul(p));return computeWeightedLoss(d,s,o)}function softmaxCrossEntropyWithLogits_(e,t,n){if(void 0===n&&(n=-1),-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error("Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank "+t.rank+" and dim was "+n);return customGrad(function(e,t){var r=t.logSumExp([n],!0),o=t.toFloat().sub(r);return{value:o.mul(e).neg().sum([n]),gradFunc:function(t){var r=expandShapeToKeepDim(t.shape,[n]);return[t.reshape(r).mul(e.toFloat().sub(o.exp())),t.reshape(r).mul(o.exp().sub(e.toFloat()))]}}})(e,t)}function softmaxCrossEntropy_(e,t,n,r,o){void 0===r&&(r=0),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,"onehotLabels","softmaxCrossEntropy"),i=convertToTensor(t,"logits","softmaxCrossEntropy"),s=null;if(null!=n&&(s=convertToTensor(n,"weights","softmaxCrossEntropy")),assertShapesMatch(a.shape,i.shape,"Error in softmaxCrossEntropy: "),r>0){var u=scalar(r),l=scalar(1),c=scalar(a.shape[1]);a=a.mul(l.sub(u)).add(u.div(c))}var p=softmaxCrossEntropyWithLogits_(a,i);return computeWeightedLoss(p,s,o)}!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(Reduction||(Reduction={}));var absoluteDifference=op({absoluteDifference_:absoluteDifference_}),computeWeightedLoss=op({computeWeightedLoss_:computeWeightedLoss_}),cosineDistance=op({cosineDistance_:cosineDistance_}),hingeLoss=op({hingeLoss_:hingeLoss_}),huberLoss=op({huberLoss_:huberLoss_}),logLoss=op({logLoss_:logLoss_}),meanSquaredError=op({meanSquaredError_:meanSquaredError_}),sigmoidCrossEntropy=op({sigmoidCrossEntropy_:sigmoidCrossEntropy_}),softmaxCrossEntropy=op({softmaxCrossEntropy_:softmaxCrossEntropy_}),loss_ops=Object.freeze({get Reduction(){return Reduction},absoluteDifference:absoluteDifference,computeWeightedLoss:computeWeightedLoss,cosineDistance:cosineDistance,hingeLoss:hingeLoss,huberLoss:huberLoss,logLoss:logLoss,meanSquaredError:meanSquaredError,sigmoidCrossEntropy:sigmoidCrossEntropy,softmaxCrossEntropy:softmaxCrossEntropy});function gramSchmidt_(e){var t;if(Array.isArray(e)){t=!1,assert(null!=e&&e.length>0,"Gram-Schmidt process: input must not be null, undefined, or empty");for(var n=e[0].shape[0],r=1;r0)for(var n=0;n= 2, but got rank "+e.rank);if(2===e.rank)return qr2d(e,t);var n=e.shape.slice(0,e.shape.length-2).reduce(function(e,t){return e*t}),r=[],o=[];return unstack(e.reshape([n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0).forEach(function(e){var n=qr2d(e,t),a=n[0],i=n[1];r.push(a),o.push(i)}),[stack(r,0).reshape(e.shape),stack(o,0).reshape(e.shape)]}function qr2d(e,t){return void 0===t&&(t=!1),ENV.engine.tidy(function(){if(2!==e.shape.length)throw new Error("qr2d() requires a 2D Tensor, but got a "+e.shape.length+"D Tensor.");for(var n=e.shape[0],r=e.shape[1],o=eye(n),a=e.clone(),i=tensor2d([[1]],[1,1]),s=i.clone(),u=n>=r?r:n,l=function(e){var t,u=a,l=s,c=o;t=ENV.engine.tidy(function(){var t=a.slice([e,e],[n-e,1]),u=t.norm(),l=a.slice([e,e],[1,1]),c=l.sign().neg(),p=l.sub(c.mul(u)),d=t.div(p);s=1===d.shape[0]?i.clone():i.concat(d.slice([1,0],[d.shape[0]-1,d.shape[1]]),0);var h=c.matMul(p).div(u).neg(),f=a.slice([e,0],[n-e,r]),m=h.mul(s);a=0===e?f.sub(m.matMul(s.transpose().matMul(f))):a.slice([0,0],[e,r]).concat(f.sub(m.matMul(s.transpose().matMul(f))),0);var g=o.slice([0,e],[n,o.shape[1]-e]);return o=0===e?g.sub(g.matMul(s).matMul(m.transpose())):o.slice([0,0],[n,e]).concat(g.sub(g.matMul(s).matMul(m.transpose())),1),[s,a,o]}),s=t[0],a=t[1],o=t[2],dispose([u,l,c])},c=0;cr&&(o=o.slice([0,0],[n,r]),a=a.slice([0,0],[r,r])),[o,a]})}var gramSchmidt=op({gramSchmidt_:gramSchmidt_}),qr=op({qr_:qr_}),linalg_ops=Object.freeze({gramSchmidt:gramSchmidt,qr:qr});function resizeBilinear_(e,t,n){void 0===n&&(n=!1);var r=convertToTensor(e,"images","resizeBilinear");assert(3===r.rank||4===r.rank,"Error in resizeBilinear: x must be rank 3 or 4, but got rank "+r.rank+"."),assert(2===t.length,"Error in resizeBilinear: new shape must 2D, but got shape "+t+".");var o=r,a=!1;3===r.rank&&(a=!0,o=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var i=t[0],s=t[1],u=ENV.engine.runKernel(function(e,t){return e.resizeBilinear(o,i,s,n)},{batchImages:o},function(e,t){return{batchImages:function(){return ENV.engine.runKernel(function(t){return t.resizeBilinearBackprop(e,o,n)},{})}}});return a?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}function resizeNearestNeighbor_(e,t,n){void 0===n&&(n=!1);var r=convertToTensor(e,"images","resizeNearestNeighbor");assert(3===r.rank||4===r.rank,"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank "+r.rank+"."),assert(2===t.length,"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+t+"."),assert("float32"===r.dtype||"int32"===r.dtype,"`images` must have `int32` or `float32` as dtype");var o=r,a=!1;3===r.rank&&(a=!0,o=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var i=t[0],s=t[1],u=ENV.engine.runKernel(function(e,t){return e.resizeNearestNeighbor(o,i,s,n)},{batchImages:o},function(e,t){return{batchImages:function(){return ENV.engine.runKernel(function(t){return t.resizeNearestNeighborBackprop(e,o,n)},{})}}});return a?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}function nonMaxSuppression_(e,t,n,r,o){void 0===r&&(r=.5),void 0===o&&(o=Number.NEGATIVE_INFINITY);var a=convertToTensor(e,"boxes","nonMaxSuppression"),i=convertToTensor(t,"scores","nonMaxSuppression"),s=nonMaxSuppSanityCheck(a,i,n,r,o);return n=s.maxOutputSize,r=s.iouThreshold,o=s.scoreThreshold,ENV.engine.runKernel(function(e){return e.nonMaxSuppression(a,i,n,r,o)},{$boxes:a})}function nonMaxSuppressionAsync_(e,t,n,r,o){return void 0===r&&(r=.5),void 0===o&&(o=Number.NEGATIVE_INFINITY),__awaiter(this,void 0,void 0,function(){var a,i,s,u,l,c;return __generator(this,function(p){switch(p.label){case 0:return a=convertToTensor(e,"boxes","nonMaxSuppressionAsync"),i=convertToTensor(t,"scores","nonMaxSuppressionAsync"),s=nonMaxSuppSanityCheck(a,i,n,r,o),n=s.maxOutputSize,r=s.iouThreshold,o=s.scoreThreshold,[4,a.data()];case 1:return u=p.sent(),[4,i.data()];case 2:return l=p.sent(),c=nonMaxSuppressionImpl(u,l,n,r,o),a!==e&&a.dispose(),i!==t&&i.dispose(),[2,c]}})})}function nonMaxSuppSanityCheck(e,t,n,r,o){null==r&&(r=.5),null==o&&(o=Number.NEGATIVE_INFINITY);var a=e.shape[0];return n=Math.min(n,a),assert(0<=r&&r<=1,"iouThreshold must be in [0, 1], but was '"+r+"'"),assert(2===e.rank,"boxes must be a 2D tensor, but was of rank '"+e.rank+"'"),assert(4===e.shape[1],"boxes must have 4 columns, but 2nd dimension was "+e.shape[1]),assert(1===t.rank,"scores must be a 1D tensor"),assert(t.shape[0]===a,"scores has incompatible shape with boxes. Expected "+a+", but was "+t.shape[0]),{maxOutputSize:n,iouThreshold:r,scoreThreshold:o}}var resizeBilinear=op({resizeBilinear_:resizeBilinear_}),resizeNearestNeighbor=op({resizeNearestNeighbor_:resizeNearestNeighbor_}),nonMaxSuppression=op({nonMaxSuppression_:nonMaxSuppression_}),nonMaxSuppressionAsync=nonMaxSuppressionAsync_,image_ops=Object.freeze({resizeBilinear:resizeBilinear,resizeNearestNeighbor:resizeNearestNeighbor,nonMaxSuppression:nonMaxSuppression,nonMaxSuppressionAsync:nonMaxSuppressionAsync}),ops=Object.freeze({image:image_ops,linalg:linalg_ops,losses:loss_ops,op:op,batchNormalization2d:batchNormalization2d,batchNormalization3d:batchNormalization3d,batchNormalization4d:batchNormalization4d,batchNormalization:batchNormalization,concat:concat,concat1d:concat1d,concat2d:concat2d,concat3d:concat3d,concat4d:concat4d,conv1d:conv1d,conv2d:conv2d,depthwiseConv2d:depthwiseConv2d,separableConv2d:separableConv2d,conv2dTranspose:conv2dTranspose,matMul:matMul,dot:dot,outerProduct:outerProduct,reverse:reverse,reverse1d:reverse1d,reverse2d:reverse2d,reverse3d:reverse3d,reverse4d:reverse4d,maxPool:maxPool,avgPool:avgPool,slice:slice,slice1d:slice1d,slice2d:slice2d,slice3d:slice3d,slice4d:slice4d,abs:abs,acos:acos,acosh:acosh,asin:asin,asinh:asinh,atan:atan,atanh:atanh,ceil:ceil,clipByValue:clipByValue,cos:cos,cosh:cosh,erf:erf,exp:exp,expm1:expm1,floor:floor,log:log$1,log1p:log1p,logSigmoid:logSigmoid,neg:neg,reciprocal:reciprocal,round:round,rsqrt:rsqrt,sigmoid:sigmoid,sign:sign,sin:sin,sinh:sinh,softplus:softplus,sqrt:sqrt,square:square,step:step,tan:tan,tanh:tanh$1,all:all,any:any,argMax:argMax,argMin:argMin,logSumExp:logSumExp,max:max,mean:mean,min:min,moments:moments,sum:sum,equal:equal,equalStrict:equalStrict,greater:greater,greaterEqual:greaterEqual,greaterEqualStrict:greaterEqualStrict,greaterStrict:greaterStrict,less:less,lessEqual:lessEqual,lessEqualStrict:lessEqualStrict,lessStrict:lessStrict,notEqual:notEqual,notEqualStrict:notEqualStrict,add:add,addN:addN,addStrict:addStrict,atan2:atan2,div:div,divStrict:divStrict,floorDiv:floorDiv,maximum:maximum,maximumStrict:maximumStrict,minimum:minimum,minimumStrict:minimumStrict,mod:mod,modStrict:modStrict,mul:mul,mulStrict:mulStrict,pow:pow,powStrict:powStrict,squaredDifference:squaredDifference,squaredDifferenceStrict:squaredDifferenceStrict,sub:sub,subStrict:subStrict,elu:elu,leakyRelu:leakyRelu,prelu:prelu,relu:relu,selu:selu,logicalAnd:logicalAnd,logicalNot:logicalNot,logicalOr:logicalOr,logicalXor:logicalXor,where:where,whereAsync:whereAsync,buffer:buffer,toPixels:toPixels,print:print,cast:cast,clone:clone,cumsum:cumsum,expandDims:expandDims,eye:eye,fromPixels:fromPixels,multinomial:multinomial,oneHot:oneHot,pad:pad,pad1d:pad1d,pad2d:pad2d,pad3d:pad3d,pad4d:pad4d,rand:rand,randomNormal:randomNormal,randomUniform:randomUniform,reshape:reshape,split:split,squeeze:squeeze,stack:stack,tile:tile,truncatedNormal:truncatedNormal,unstack:unstack,batchToSpaceND:batchToSpaceND,spaceToBatchND:spaceToBatchND,fill:fill,linspace:linspace,ones:ones$1,range:range,scalar:scalar,tensor:tensor,tensor1d:tensor1d,tensor2d:tensor2d,tensor3d:tensor3d,tensor4d:tensor4d,tensor5d:tensor5d,tensor6d:tensor6d,zeros:zeros,onesLike:onesLike,zerosLike:zerosLike,transpose:transpose,softmax:softmax,localResponseNormalization:localResponseNormalization,norm:norm,gather:gather,unsortedSegmentSum:unsortedSegmentSum,basicLSTMCell:basicLSTMCell,multiRNNCell:multiRNNCell,movingAverage:movingAverage,stridedSlice:stridedSlice,topk:topk}),MathBackendCPU=function(){function e(){this.data=new WeakMap,this.firstUse=!0,ENV.get("IS_BROWSER")&&(this.canvas=document.createElement("canvas"))}return e.prototype.register=function(e,t,n){if(this.firstUse&&(this.firstUse=!1,ENV.get("IS_NODE")&&warn("\n============================\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================\n")),this.data.has(e))throw new Error("Data buffer is already registered");this.data.set(e,null)},e.prototype.write=function(e,t){if(null==t)throw new Error("MathBackendCPU.write(): values can not be null");this.throwIfNoData(e),this.data.set(e,t)},e.prototype.fromPixels=function(e,t){if(null==e)throw new Error("pixels passed to tf.fromPixels() can not be null");var n,r;if(ENV.get("IS_NODE")&&null==e.getContext)throw new Error("When running in node, pixels must be an HTMLCanvasElement like the one returned by the `canvas` npm package");if(null!=e.getContext)n=e.getContext("2d").getImageData(0,0,e.width,e.height).data;else if(e instanceof ImageData)n=e.data;else{if(!(e instanceof HTMLImageElement||e instanceof HTMLVideoElement))throw new Error("pixels passed to tf.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ImageData, but was "+e.constructor.name);if(null==this.canvas)throw new Error("Can't read pixels from HTMLImageElement outside the browser.");this.canvas.width=e.width,this.canvas.height=e.height,this.canvas.getContext("2d").drawImage(e,0,0,e.width,e.height),n=this.canvas.getContext("2d").getImageData(0,0,e.width,e.height).data}if(4===t)r=new Int32Array(n);else{var o=e.width*e.height;r=new Int32Array(o*t);for(var a=0;ad&&(d=m,h=f)}u[c]=h}return i},e.prototype.cumsum=function(e,t,n,r){if(t!==e.rank-1)throw new Error("backend.cumsum in CPU expects an inner-most axis="+(e.rank-1)+" but got axis="+t);for(var o=upcastType(e.dtype,"int32"),a=zeros(e.shape,o),i=a.dataSync(),s=e.dataSync(),u=e.shape[e.rank-1],l=r?function(e,t){return e+u-t-1}:function(e,t){return e+t},c=0;ct?1:0})},e.prototype.greaterEqual=function(e,t){return this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e>=t?1:0})},e.prototype.logicalNot=function(e){for(var t=e.dataSync(),n=new Int32Array(t.length),r=0;r1||1===t.rank?1:t.shape[1],c=0;c=0&&t>=0?n:(n+t)%t})},e.prototype.max=function(e,t){assertAxesAreInnerMostDims("max",t,e.rank);for(var n=computeOutAndReduceShapes(e.shape,t),r=n[0],o=n[1],a=zeros(r,e.dtype),i=sizeFromShape(o),s=a.dataSync(),u=e.dataSync(),l=0;lp&&(p=h)}s[l]=p}return a},e.prototype.maximum=function(e,t){return this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.max(e,t)})},e.prototype.all=function(e,t){assertAxesAreInnerMostDims("all",t,e.rank);for(var n=computeOutAndReduceShapes(e.shape,t),r=n[0],o=n[1],a=zeros(r,e.dtype),i=sizeFromShape(o),s=a.dataSync(),u=e.dataSync(),l=0;l0?n[r]=1:n[r]=0;return Tensor.make(e.shape,{values:n})},e.prototype.round=function(e){for(var t=e.dataSync(),n=new Float32Array(t.length),r=0;r.5?n[r]=Math.ceil(t[r]):n[r]=o%2==0?o:o+1}return Tensor.make(e.shape,{values:n})},e.prototype.exp=function(e){for(var t=e.dataSync(),n=new Float32Array(t.length),r=0;r=0?o:Math.exp(o)-1}return Tensor.make(e.shape,{values:t})},e.prototype.eluDer=function(e,t){for(var n=new Float32Array(t.size),r=t.dataSync(),o=e.dataSync(),a=0;a=1?o[a]:o[a]*(i+1)}return Tensor.make(t.shape,{values:n})},e.prototype.selu=function(e){for(var t=SELU_SCALEALPHA,n=SELU_SCALE,r=new Float32Array(e.size),o=e.dataSync(),a=0;a=0?n*i:t*(Math.exp(i)-1)}return Tensor.make(e.shape,{values:r})},e.prototype.clip=function(e,t,n){for(var r=new Float32Array(e.size),o=e.dataSync(),a=0;a-t,i=r[o]0?1:t}return Tensor.make(e.shape,{values:n})},e.prototype.conv2d=function(e,t,n){for(var r=n.filterHeight,o=n.filterWidth,a=n.dilationHeight,i=n.dilationWidth,s=n.padInfo.left,u=n.padInfo.top,l=buffer(n.outShape,e.dtype),c=0;c=n.inHeight))for(var x=0;x=n.inWidth))for(var S=0;S=n.inHeight))for(var S=0;S=n.inWidth))y+=e.get(p,T,b,d)*t.get(x,S,d,v)}}c.set(y,p,h,m,d*l+v)}return c.toTensor()},e.prototype.depthwiseConv2DDerInput=function(e,t,n){for(var r=buffer(n.inShape,"float32"),o=r.values,a=r.strides,i=a[0],s=a[1],u=a[2],l=e.dataSync(),c=e.strides,p=c[0],d=c[1],h=c[2],f=t.dataSync(),m=t.strides,g=m[0],v=m[1],y=m[2],x=n.batchSize,T=n.filterHeight,S=n.filterWidth,b=n.inChannels,E=n.inHeight,w=n.inWidth,_=n.outChannels,A=n.outHeight,R=n.outWidth,C=n.strideHeight,N=n.strideWidth,k=T-1-n.padInfo.top,I=S-1-n.padInfo.left,D=_/b,M=0;MT?T=_:"avg"===n&&(S+=_,b++)}if(isNaN(T))break}s.set("avg"===n?S/b:T,c,d,g,p)}return s.toTensor()},e.prototype.maxPool=function(e,t){return this.pool(e,t,"max")},e.prototype.maxPoolPositions=function(e,t){for(var n=buffer(t.outShape,"int32"),r=t.strideHeight,o=t.strideWidth,a=t.filterHeight,i=t.filterWidth,s=t.padInfo.top,u=t.padInfo.left,l=0;lx&&(x=_,T=b*i+w)}n.set(T,l,p,m,c)}return n.toTensor()},e.prototype.maxPoolBackprop=function(e,t,n,r){for(var o=this.maxPoolPositions(t,r),a=r.strideHeight,i=r.strideWidth,s=r.filterHeight,u=r.filterWidth,l=u-1-r.padInfo.left,c=s-1-r.padInfo.top,p=buffer(t.shape,"float32"),d=0;d=r.outHeight||Math.floor(T)!==T))for(var S=0;S=r.outWidth||Math.floor(b)!==b)){var E=s*u-1-o.get(d,T,b,h)===x*u+S?1:0;if(0!==E)y+=e.get(d,T,b,h)*E}}}p.set(y,d,f,m,h)}return p.toTensor()},e.prototype.avgPoolBackprop=function(e,t,n){for(var r=n.strideHeight,o=n.strideWidth,a=n.filterHeight,i=n.filterWidth,s=i-1-n.padInfo.left,u=a-1-n.padInfo.top,l=buffer(t.shape,"float32"),c=1/(a*i),p=0;p=n.outHeight||Math.floor(x)!==x))for(var T=0;T=n.outWidth||Math.floor(S)!==S))v+=e.get(p,x,S,d)}}l.set(v*c,p,h,f,d)}return l.toTensor()},e.prototype.cast=function(e,t){return castTensor(e,t,this)},e.prototype.reshape=function(e,t){return reshapeTensor(e,t)},e.prototype.avgPool=function(e,t){return this.pool(e,t,"avg").toFloat()},e.prototype.resizeBilinear=function(e,t,n,r){for(var o=e.shape,a=o[0],i=o[1],s=o[2],u=o[3],l=buffer([a,t,n,u],e.dtype),c=[r&&t>1?i-1:i,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],d=0;d1?a-1:a,n&&c>1?i-1:i],h=[n&&l>1?l-1:l,n&&c>1?c-1:c],f=d[0]/h[0],m=d[1]/h[1],g=0;g1?i-1:i,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],d=0;d1?a-1:a,n&&c>1?i-1:i],h=[n&&l>1?l-1:l,n&&c>1?c-1:c],f=1/(d[0]/h[0]),m=1/(d[1]/h[1]),g=2*Math.ceil(f)+2,v=2*Math.ceil(m)+2,y=0;y=l))for(var N=0;N=c)){var I=d[0]*(C/h[0]),D=d[1]*(k/h[1]),M=Math.min(a-1,n?Math.round(I):Math.floor(I)),O=Math.min(i-1,n?Math.round(D):Math.floor(D));x===M&&T===O&&(A+=e.get(y,C,k,_))}}}p.set(A,y,x,T,_)}return p.toTensor()},e.prototype.batchNormalization=function(e,t,n,r,o,a){for(var i=e.dataSync(),s=t.dataSync(),u=n.dataSync(),l=o?o.dataSync():new Float32Array([1]),c=a?a.dataSync():new Float32Array([0]),p=new Float32Array(i.length),d=0;d=0&&e.get(a)0,"scheme must not be an empty string.");var r=e.getInstance();assert(null==r.managers[t],"A model store manager is already registered for scheme '"+t+"'."),r.managers[t]=n},e.getManager=function(e){var t=this.getInstance().managers[e];if(null==t)throw new Error("Cannot find model manager for scheme '"+e+"'");return t},e.getSchemes=function(){return Object.keys(this.getInstance().managers)},e}();function parseURL(e){if(-1===e.indexOf(URL_SCHEME_SUFFIX))throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+ModelStoreManagerRegistry.getSchemes().join(","));return{scheme:e.split(URL_SCHEME_SUFFIX)[0],path:e.split(URL_SCHEME_SUFFIX)[1]}}function cloneModelInternal(e,t,n){return void 0===n&&(n=!1),__awaiter(this,void 0,void 0,function(){var r,o,a,i,s,u,l,c,p;return __generator(this,function(d){switch(d.label){case 0:return assert(e!==t,"Old path and new path are the same: '"+e+"'"),assert((r=IORouterRegistry.getLoadHandlers(e)).length>0,"Copying failed because no load handler is found for source URL "+e+"."),assert(r.length<2,"Copying failed because more than one ("+r.length+") load handlers for source URL "+e+"."),o=r[0],assert((a=IORouterRegistry.getSaveHandlers(t)).length>0,"Copying failed because no save handler is found for destination URL "+t+"."),assert(a.length<2,"Copying failed because more than one ("+r.length+") save handlers for destination URL "+t+"."),i=a[0],s=parseURL(e).scheme,u=parseURL(e).path,l=s===parseURL(e).scheme,[4,o.load()];case 1:return c=d.sent(),n&&l?[4,ModelStoreManagerRegistry.getManager(s).removeModel(u)]:[3,3];case 2:d.sent(),d.label=3;case 3:return[4,i.save(c)];case 4:return p=d.sent(),!n||l?[3,6]:[4,ModelStoreManagerRegistry.getManager(s).removeModel(u)];case 5:d.sent(),d.label=6;case 6:return[2,p.modelArtifactsInfo]}})})}function listModels(){return __awaiter(this,void 0,void 0,function(){var e,t,n,r,o,a,i;return __generator(this,function(s){switch(s.label){case 0:e=ModelStoreManagerRegistry.getSchemes(),t={},n=0,r=e,s.label=1;case 1:return n0,"URL path for browserHTTPRequest must not be null, undefined or empty."),this.path=e,null!=t&&null!=t.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t||{}}return e.prototype.save=function(e){return __awaiter(this,void 0,void 0,function(){var t,n,r,o;return __generator(this,function(a){switch(a.label){case 0:if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");return(t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,weightsManifest:n},t.body.append("model.json",new Blob([JSON.stringify(r)],{type:"application/json"}),"model.json"),null!=e.weightData&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:"application/octet-stream"}),"model.weights.bin"),[4,fetch(this.path,t)];case 1:if(200===(o=a.sent()).status)return[2,{modelArtifactsInfo:getModelArtifactsInfoForJSON(e),responses:[o]}];throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+o.status+".")}})})},e.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){var e,t,n,r,o,a,i,s,u,l,c,p;return __generator(this,function(d){switch(d.label){case 0:return[4,fetch(this.path,this.requestInit)];case 1:return[4,d.sent().json()];case 2:if(e=d.sent(),t=e.modelTopology,n=e.weightsManifest,null==t&&null==n)throw new Error("The JSON from HTTP path "+this.path+" contains neither model topology or manifest for weights.");if(null==n)return[3,4];for(a=e.weightsManifest,r=[],i=0,s=a;i0&&(e=__assign({weightSpecs:this.weightSpecs},e)),null!=this.weightData&&this.weightData.byteLength>0&&(e=__assign({weightData:this.weightData},e)),[2,e]})})},e}(),PassthroughSaver=function(){function e(e){this.saveHandler=e}return e.prototype.save=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,this.saveHandler(e)]})})},e}();function fromMemory(e,t,n){return new PassthroughLoader(e,t,n)}function withSaveHandler(e){return new PassthroughSaver(e)}var registerSaveRouter=IORouterRegistry.registerSaveRouter,registerLoadRouter=IORouterRegistry.registerLoadRouter,getSaveHandlers=IORouterRegistry.getSaveHandlers,getLoadHandlers=IORouterRegistry.getLoadHandlers,io=Object.freeze({browserFiles:browserFiles,browserHTTPRequest:browserHTTPRequest,concatenateArrayBuffers:concatenateArrayBuffers,decodeWeights:decodeWeights,encodeWeights:encodeWeights,fromMemory:fromMemory,getLoadHandlers:getLoadHandlers,getModelArtifactsInfoForJSON:getModelArtifactsInfoForJSON,getSaveHandlers:getSaveHandlers,loadWeights:loadWeights,registerLoadRouter:registerLoadRouter,registerSaveRouter:registerSaveRouter,withSaveHandler:withSaveHandler,copyModel:copyModel,listModels:listModels,moveModel:moveModel,removeModel:removeModel}),Serializable=function(){function e(){}return e.prototype.getClassName=function(){return this.constructor.className},e.fromConfig=function(e,t){return new e(t)},e}(),SerializationMap=function(){function e(){this.classNameMap={}}return e.getMap=function(){return null==e.instance&&(e.instance=new e),e.instance},e.register=function(t){e.getMap().classNameMap[t.className]=[t,t.fromConfig]},e}(),serialization=Object.freeze({Serializable:Serializable,SerializationMap:SerializationMap}),WEBGL_ENVS={HAS_WEBGL:!0},NODE_ENVS={IS_NODE:!0},CHROME_ENVS={IS_CHROME:!0},BROWSER_ENVS={IS_BROWSER:!0},CPU_ENVS={HAS_WEBGL:!1},ALL_ENVS={};function expectArraysClose(e,t,n){if(null==n&&(n=ENV.get("TEST_EPSILON")),e instanceof Tensor||t instanceof Tensor){if(e instanceof Tensor&&t instanceof Tensor){if(e.dtype!==t.dtype)throw new Error("Arrays are of different type actual: "+e.dtype+" vs expected: "+t.dtype+".");if(!arraysEqual(e.shape,t.shape))throw new Error("Arrays are of different shape actual: "+e.shape+" vs expected: "+t.shape+".")}}else{var r=e.constructor.name,o=t.constructor.name;if(r!==o)throw new Error("Arrays are of different type actual: "+r+" vs expected: "+o)}var a,i;if(a=e instanceof Tensor?e.dataSync():e,i=t instanceof Tensor?t.dataSync():t,a.length!==i.length)throw new Error("Arrays have different lengths actual: "+a.length+" vs expected: "+i.length+".\nActual: "+a+".\nExpected: "+i+".");for(var s=0;sn)}function expectValuesInRange(e,t,n){var r;r=e instanceof Tensor?e.dataSync():e;for(var o=0;on)throw new Error("Value out of range:"+r[o]+" low: "+t+", high: "+n)}function expectArrayBuffersEqual(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}var test_util=Object.freeze({WEBGL_ENVS:WEBGL_ENVS,NODE_ENVS:NODE_ENVS,CHROME_ENVS:CHROME_ENVS,BROWSER_ENVS:BROWSER_ENVS,CPU_ENVS:CPU_ENVS,ALL_ENVS:ALL_ENVS,expectArraysClose:expectArraysClose,expectPromiseToFail:expectPromiseToFail,expectArraysEqual:expectArraysEqual,expectNumbersClose:expectNumbersClose,expectValuesInRange:expectValuesInRange,expectArrayBuffersEqual:expectArrayBuffersEqual}),version="0.12.8",webgl=Object.freeze({gpgpu_util:gpgpu_util,webgl_util:webgl_util,MathBackendWebGL:MathBackendWebGL,GPGPUContext:GPGPUContext}),Optimizer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.minimize=function(e,t,n){void 0===t&&(t=!1);var r=this.computeGradients(e,n),o=r.value,a=r.grads;return this.applyGradients(a),Object.keys(a).forEach(function(e){return a[e].dispose()}),t?o:(o.dispose(),null)},t.prototype.computeGradients=function(e,t){return variableGrads(e,t)},t}(Serializable),DEFAULT_FLOAT32_EPSILON=1e-8,DEFAULT_FLOAT16_EPSILON=1e-4;function getOptimizerDefaultEpsilonValue(){return ENV.get("WEBGL_RENDER_FLOAT32_ENABLED")?DEFAULT_FLOAT32_EPSILON:DEFAULT_FLOAT16_EPSILON}var AdadeltaOptimizer=function(e){function t(t,n,r){void 0===r&&(r=null);var o=e.call(this)||this;return o.learningRate=t,o.rho=n,o.epsilon=r,o.accumulatedGrads={},o.accumulatedUpdates={},o.c=keep(scalar(-t)),o.rhoScalar=keep(scalar(n)),o.oneMinusRho=keep(scalar(1-n)),null===r&&(r=getOptimizerDefaultEpsilonValue()),o.epsilonScalar=keep(scalar(r)),o}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulatedGrads[n]){tidy(function(){t.accumulatedGrads[n]=zerosLike(o).variable(!1)})}if(null==r.accumulatedUpdates[n]){tidy(function(){t.accumulatedUpdates[n]=zerosLike(o).variable(!1)})}var a=e[n],i=r.accumulatedGrads[n],s=r.accumulatedUpdates[n];tidy(function(){var e=t.rhoScalar.mul(i).add(t.oneMinusRho.mul(a.square())),r=s.add(t.epsilonScalar).sqrt().div(i.add(t.epsilonScalar).sqrt()).mul(a),u=t.rhoScalar.mul(s).add(t.oneMinusRho.mul(r.square()));t.accumulatedGrads[n].assign(e),t.accumulatedUpdates[n].assign(u);var l=t.c.mul(r).add(o);o.assign(l)})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsilonScalar.dispose(),this.rhoScalar.dispose(),this.oneMinusRho.dispose(),null!=this.accumulatedUpdates&&(Object.keys(this.accumulatedUpdates).forEach(function(t){return e.accumulatedUpdates[t].dispose()}),Object.keys(this.accumulatedGrads).forEach(function(t){return e.accumulatedGrads[t].dispose()}))},t.prototype.getConfig=function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.rho,t.epsilon)},t.className="AdadeltaOptimizer",t}(Optimizer);SerializationMap.register(AdadeltaOptimizer);var AdagradOptimizer=function(e){function t(t,n){void 0===n&&(n=.1);var r=e.call(this)||this;r.learningRate=t,r.initialAccumulatorValue=n,r.accumulatedGrads={},r.c=keep(scalar(-t));var o=getOptimizerDefaultEpsilonValue();return r.epsilon=keep(scalar(o)),r}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulatedGrads[n]){tidy(function(){t.accumulatedGrads[n]=fill(o.shape,t.initialAccumulatorValue).variable(!1)})}var a=e[n],i=r.accumulatedGrads[n];tidy(function(){var e=i.add(a.square());t.accumulatedGrads[n].assign(e);var r=t.c.mul(a.div(e.add(t.epsilon).sqrt())).add(o);o.assign(r)})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){var e=this;this.epsilon.dispose(),this.c.dispose(),null!=this.accumulatedGrads&&Object.keys(this.accumulatedGrads).forEach(function(t){return e.accumulatedGrads[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}},t.fromConfig=function(e,t){return new e(t.learningRate,t.initialAccumulatorValue)},t.className="AdagradOptimizer",t}(Optimizer);SerializationMap.register(AdagradOptimizer);var AdamOptimizer=function(e){function t(t,n,r,o){void 0===o&&(o=null);var a=e.call(this)||this;return a.learningRate=t,a.beta1=n,a.beta2=r,a.epsilon=o,a.accumulatedFirstMoment={},a.accumulatedSecondMoment={},a.c=keep(scalar(-t)),a.beta1Scalar=keep(scalar(n)),a.beta2Scalar=keep(scalar(r)),tidy(function(){a.accBeta1=scalar(n).variable(),a.accBeta2=scalar(r).variable()}),a.oneMinusBeta1=keep(scalar(1-n)),a.oneMinusBeta2=keep(scalar(1-r)),a.one=keep(scalar(1)),null===o&&(o=getOptimizerDefaultEpsilonValue()),a.epsScalar=keep(scalar(o)),a}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;tidy(function(){var n=t.one.sub(t.accBeta1),r=t.one.sub(t.accBeta2);for(var o in e){var a=ENV.engine.registeredVariables[o];if(null==t.accumulatedFirstMoment[o]){var i=!1;t.accumulatedFirstMoment[o]=zerosLike(a).variable(i)}if(null==t.accumulatedSecondMoment[o]){i=!1;t.accumulatedSecondMoment[o]=zerosLike(a).variable(i)}var s=e[o],u=t.accumulatedFirstMoment[o],l=t.accumulatedSecondMoment[o],c=t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)),p=t.beta2Scalar.mul(l).add(t.oneMinusBeta2.mul(s.square())),d=c.div(n),h=p.div(r);t.accumulatedFirstMoment[o].assign(c),t.accumulatedSecondMoment[o].assign(p);var f=t.c.mul(d.div(t.epsScalar.add(h.sqrt()))).add(a);a.assign(f)}t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar)),t.accBeta2.assign(t.accBeta2.mul(t.beta2Scalar))})},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsScalar.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.accBeta1.dispose(),this.accBeta2.dispose(),this.oneMinusBeta1.dispose(),this.oneMinusBeta2.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(t){return e.accumulatedFirstMoment[t].dispose()}),null!=this.accumulatedSecondMoment&&Object.keys(this.accumulatedSecondMoment).forEach(function(t){return e.accumulatedSecondMoment[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)},t.className="AdamOptimizer",t}(Optimizer);SerializationMap.register(AdamOptimizer);var AdamaxOptimizer=function(e){function t(t,n,r,o,a){void 0===o&&(o=null),void 0===a&&(a=0);var i=e.call(this)||this;return i.learningRate=t,i.beta1=n,i.beta2=r,i.epsilon=o,i.decay=a,i.accumulatedFirstMoment={},i.accumulatedWeightedInfNorm={},i.c=keep(scalar(-t)),i.beta1Scalar=keep(scalar(n)),i.beta2Scalar=keep(scalar(r)),i.decayScalar=keep(scalar(a)),tidy(function(){i.iteration=scalar(0).variable(),i.accBeta1=scalar(n).variable()}),i.oneMinusBeta1=keep(scalar(1-n)),i.one=keep(scalar(1)),null===o&&(o=getOptimizerDefaultEpsilonValue()),i.epsScalar=keep(scalar(o)),i}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;tidy(function(){var n=t.one.sub(t.accBeta1),r=t.c.div(t.one.add(t.decayScalar.mul(t.iteration)));for(var o in e){var a=ENV.engine.registeredVariables[o];if(null==t.accumulatedFirstMoment[o]){var i=!1;t.accumulatedFirstMoment[o]=zerosLike(a).variable(i)}if(null==t.accumulatedWeightedInfNorm[o]){i=!1;t.accumulatedWeightedInfNorm[o]=zerosLike(a).variable(i)}var s=e[o],u=t.accumulatedFirstMoment[o],l=t.accumulatedWeightedInfNorm[o],c=t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)),p=t.beta2Scalar.mul(l),d=s.abs(),h=p.maximum(d);t.accumulatedFirstMoment[o].assign(c),t.accumulatedWeightedInfNorm[o].assign(h);var f=r.div(n).mul(c.div(t.epsScalar.add(h))).add(a);a.assign(f)}t.iteration.assign(t.iteration.add(t.one)),t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar))})},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsScalar.dispose(),this.accBeta1.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.oneMinusBeta1.dispose(),this.decayScalar.dispose(),this.iteration.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(t){return e.accumulatedFirstMoment[t].dispose()}),null!=this.accumulatedWeightedInfNorm&&Object.keys(this.accumulatedWeightedInfNorm).forEach(function(t){return e.accumulatedWeightedInfNorm[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)},t.className="AdamaxOptimizer",t}(Optimizer);SerializationMap.register(AdamaxOptimizer);var SGDOptimizer=function(e){function t(t){var n=e.call(this)||this;return n.learningRate=t,n.setLearningRate(t),n}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n],o=ENV.engine.registeredVariables[n];tidy(function(){var e=t.c.mul(r).add(o);o.assign(e)})})},t.prototype.setLearningRate=function(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=keep(scalar(-e))},t.prototype.dispose=function(){this.c.dispose()},t.prototype.getConfig=function(){return{learningRate:this.learningRate}},t.fromConfig=function(e,t){return new e(t.learningRate)},t.className="SGDOptimizer",t}(Optimizer);SerializationMap.register(SGDOptimizer);var MomentumOptimizer=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t)||this;return o.learningRate=t,o.momentum=n,o.useNesterov=r,o.m=scalar(o.momentum),o.accumulations={},o}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulations[n]){tidy(function(){t.accumulations[n]=zerosLike(o).variable(!1)})}var a=r.accumulations[n],i=e[n];tidy(function(){var e,r=t.m.mul(a).add(i);e=t.useNesterov?t.c.mul(i.add(r.mul(t.m))).add(o):t.c.mul(r).add(o),t.accumulations[n].assign(r),o.assign(e)})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){if(e.prototype.dispose.call(this),this.m.dispose(),null!=this.accumulations)for(var t in this.accumulations)this.accumulations[t].dispose()},t.prototype.setMomentum=function(e){this.momentum=e},t.prototype.getConfig=function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}},t.fromConfig=function(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)},t.className="MomentumOptimizer",t}(SGDOptimizer);SerializationMap.register(MomentumOptimizer);var RMSPropOptimizer=function(e){function t(t,n,r,o,a){void 0===n&&(n=.9),void 0===r&&(r=0),void 0===o&&(o=null),void 0===a&&(a=!1);var i=e.call(this)||this;return i.learningRate=t,i.decay=n,i.momentum=r,i.epsilon=o,i.accumulatedMeanSquares={},i.accumulatedMeanGrads={},i.accumulatedMoments={},i.c=keep(scalar(t)),i.decayScalar=keep(scalar(n)),i.momentumScalar=keep(scalar(r)),i.oneMinusDecay=keep(scalar(1-n)),i.centered=a,null===o&&(o=getOptimizerDefaultEpsilonValue()),i.epsilonScalar=keep(scalar(o)),i}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulatedMeanSquares[n]){tidy(function(){t.accumulatedMeanSquares[n]=zerosLike(o).variable(!1)})}if(null==r.accumulatedMeanGrads[n]&&r.centered){tidy(function(){t.accumulatedMeanGrads[n]=zerosLike(o).variable(!1)})}if(null==r.accumulatedMoments[n]){tidy(function(){t.accumulatedMoments[n]=zerosLike(o).variable(!1)})}var a=r.accumulatedMeanSquares[n],i=r.accumulatedMeanGrads[n],s=r.accumulatedMoments[n],u=e[n];tidy(function(){var e=t.decayScalar.mul(a).add(t.oneMinusDecay.mul(u.square()));if(t.centered){var r=t.decayScalar.mul(i).add(t.oneMinusDecay.mul(u)),l=t.momentumScalar.mul(s).add(t.c.mul(u).div(e.sub(r.square().add(t.epsilonScalar)).sqrt()));t.accumulatedMeanSquares[n].assign(e),t.accumulatedMeanGrads[n].assign(r),t.accumulatedMoments[n].assign(l);var c=o.sub(l);o.assign(c)}else{var p=t.decayScalar.mul(a).add(t.oneMinusDecay.mul(u.square()));l=t.momentumScalar.mul(s).add(t.c.mul(u).div(p.add(t.epsilonScalar).sqrt()));t.accumulatedMeanSquares[n].assign(p),t.accumulatedMoments[n].assign(l);c=o.sub(l);o.assign(c)}})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsilonScalar.dispose(),this.decayScalar.dispose(),this.momentumScalar.dispose(),this.oneMinusDecay.dispose(),null!=this.accumulatedMeanSquares&&Object.keys(this.accumulatedMeanSquares).forEach(function(t){return e.accumulatedMeanSquares[t].dispose()}),null!=this.accumulatedMeanGrads&&this.centered&&Object.keys(this.accumulatedMeanGrads).forEach(function(t){return e.accumulatedMeanGrads[t].dispose()}),null!=this.accumulatedMoments&&Object.keys(this.accumulatedMoments).forEach(function(t){return e.accumulatedMoments[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}},t.fromConfig=function(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)},t.className="RMSPropOptimizer",t}(Optimizer);SerializationMap.register(RMSPropOptimizer);var OptimizerConstructors=function(){function e(){}return e.sgd=function(e){return new SGDOptimizer(e)},e.momentum=function(e,t,n){return void 0===n&&(n=!1),new MomentumOptimizer(e,t,n)},e.rmsprop=function(e,t,n,r,o){return void 0===t&&(t=.9),void 0===n&&(n=0),void 0===r&&(r=null),void 0===o&&(o=!1),new RMSPropOptimizer(e,t,n,r,o)},e.adam=function(e,t,n,r){return void 0===e&&(e=.001),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),new AdamOptimizer(e,t,n,r)},e.adadelta=function(e,t,n){return void 0===e&&(e=.001),void 0===t&&(t=.95),void 0===n&&(n=null),new AdadeltaOptimizer(e,t,n)},e.adamax=function(e,t,n,r,o){return void 0===e&&(e=.002),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),void 0===o&&(o=0),new AdamaxOptimizer(e,t,n,r,o)},e.adagrad=function(e,t){return void 0===t&&(t=.1),new AdagradOptimizer(e,t)},e}(),train={sgd:OptimizerConstructors.sgd,momentum:OptimizerConstructors.momentum,adadelta:OptimizerConstructors.adadelta,adagrad:OptimizerConstructors.adagrad,rmsprop:OptimizerConstructors.rmsprop,adamax:OptimizerConstructors.adamax,adam:OptimizerConstructors.adam},setBackend=Environment.setBackend,getBackend=Environment.getBackend,disposeVariables=Environment.disposeVariables,memory=Environment.memory;setOpHandler(ops);export{setBackend,getBackend,disposeVariables,memory,version as version_core,nextFrame,environment,io,serialization,test_util,util,webgl,AdadeltaOptimizer,AdagradOptimizer,AdamOptimizer,AdamaxOptimizer,MomentumOptimizer,Optimizer,RMSPropOptimizer,SGDOptimizer,Tensor,TensorBuffer,variable,Variable,Rank,Reduction,ENV,Environment,image_ops as image,linalg_ops as linalg,loss_ops as losses,op,batchNormalization2d,batchNormalization3d,batchNormalization4d,batchNormalization,concat,concat1d,concat2d,concat3d,concat4d,conv1d,conv2d,depthwiseConv2d,separableConv2d,conv2dTranspose,matMul,dot,outerProduct,reverse,reverse1d,reverse2d,reverse3d,reverse4d,maxPool,avgPool,slice,slice1d,slice2d,slice3d,slice4d,abs,acos,acosh,asin,asinh,atan,atanh,ceil,clipByValue,cos,cosh,erf,exp,expm1,floor,log$1 as log,log1p,logSigmoid,neg,reciprocal,round,rsqrt,sigmoid,sign,sin,sinh,softplus,sqrt,square,step,tan,tanh$1 as tanh,all,any,argMax,argMin,logSumExp,max,mean,min,moments,sum,equal,equalStrict,greater,greaterEqual,greaterEqualStrict,greaterStrict,less,lessEqual,lessEqualStrict,lessStrict,notEqual,notEqualStrict,add,addN,addStrict,atan2,div,divStrict,floorDiv,maximum,maximumStrict,minimum,minimumStrict,mod,modStrict,mul,mulStrict,pow,powStrict,squaredDifference,squaredDifferenceStrict,sub,subStrict,elu,leakyRelu,prelu,relu,selu,logicalAnd,logicalNot,logicalOr,logicalXor,where,whereAsync,buffer,toPixels,print,cast,clone,cumsum,expandDims,eye,fromPixels,multinomial,oneHot,pad,pad1d,pad2d,pad3d,pad4d,rand,randomNormal,randomUniform,reshape,split,squeeze,stack,tile,truncatedNormal,unstack,batchToSpaceND,spaceToBatchND,fill,linspace,ones$1 as ones,range,scalar,tensor,tensor1d,tensor2d,tensor3d,tensor4d,tensor5d,tensor6d,zeros,onesLike,zerosLike,transpose,softmax,localResponseNormalization,norm,gather,unsortedSegmentSum,basicLSTMCell,multiRNNCell,movingAverage,stridedSlice,topk,train,tidy,keep,dispose,time,customGrad,grad,grads,valueAndGrad,valueAndGrads,variableGrads}; +//# sourceMappingURL=tf-core.esm.js.map diff --git a/node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js.map b/node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js.map new file mode 100644 index 0000000..55df755 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tf-core.esm.js","sources":["../src/device_util.ts","../src/util.ts","../src/profiler.ts","../src/tape.ts","../src/tensor_format.ts","../src/tensor.ts","../src/tensor_util.ts","../src/engine.ts","../src/environment_util.ts","../src/environment.ts","../src/log.ts","../src/ops/array_ops_util.ts","../src/ops/axis_util.ts","../src/ops/reduce_util.ts","../src/ops/segment_util.ts","../src/ops/slice_util.ts","../src/gradients.ts","../src/tensor_util_env.ts","../src/ops/operation.ts","../src/ops/softmax.ts","../src/ops/tensor_ops.ts","../src/types.ts","../src/kernels/backend_util.ts","../src/kernels/non_max_suppression_impl.ts","../src/kernels/topk_impl.ts","../src/kernels/webgl/argminmax_gpu.ts","../src/kernels/webgl/avg_pool_backprop_gpu.ts","../src/ops/broadcast_util.ts","../src/kernels/webgl/batchnorm_gpu.ts","../src/kernels/webgl/binaryop_gpu.ts","../src/kernels/webgl/clip_gpu.ts","../src/ops/concat_util.ts","../src/kernels/webgl/concat_gpu.ts","../src/kernels/webgl/conv_backprop_gpu.ts","../src/kernels/webgl/conv_backprop_gpu_depthwise.ts","../src/kernels/webgl/conv_gpu.ts","../src/kernels/webgl/conv_gpu_depthwise.ts","../src/kernels/webgl/shader_compiler.ts","../src/kernels/webgl/cumsum_gpu.ts","../src/kernels/webgl/encode_float_gpu.ts","../src/kernels/webgl/tex_util.ts","../src/kernels/webgl/from_pixels_gpu.ts","../src/kernels/webgl/gather_gpu.ts","../src/kernels/webgl/webgl_util.ts","../src/kernels/webgl/gpgpu_util.ts","../src/kernels/webgl/gpgpu_context.ts","../src/kernels/webgl/gpgpu_math.ts","../src/kernels/webgl/lrn_gpu.ts","../src/kernels/webgl/lrn_grad_gpu.ts","../src/kernels/webgl/max_pool_backprop_gpu.ts","../src/kernels/webgl/mulmat_gpu.ts","../src/kernels/webgl/multinomial_gpu.ts","../src/kernels/webgl/onehot_gpu.ts","../src/kernels/webgl/pad_gpu.ts","../src/kernels/webgl/pool_gpu.ts","../src/kernels/webgl/reduce_gpu.ts","../src/kernels/webgl/resize_bilinear_backprop_gpu.ts","../src/kernels/webgl/resize_bilinear_gpu.ts","../src/kernels/webgl/resize_nearest_neighbor_backprop_gpu.ts","../src/kernels/webgl/resize_nearest_neighbor_gpu.ts","../src/kernels/webgl/reverse_gpu.ts","../src/kernels/webgl/segment_gpu.ts","../src/kernels/webgl/select_gpu.ts","../src/kernels/webgl/slice_gpu.ts","../src/kernels/webgl/strided_slice_gpu.ts","../src/kernels/webgl/texture_manager.ts","../src/kernels/webgl/tile_gpu.ts","../src/kernels/webgl/transpose_gpu.ts","../src/ops/erf_util.ts","../src/ops/selu_util.ts","../src/kernels/webgl/unaryop_gpu.ts","../src/ops/concat.ts","../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/ops/rand.ts","../src/ops/array_ops.ts","../src/kernels/where_impl.ts","../src/kernels/backend_webgl.ts","../src/ops/unary_ops.ts","../src/ops/batchnorm.ts","../src/ops/conv_util.ts","../src/ops/conv.ts","../src/ops/matmul.ts","../src/ops/reverse.ts","../src/ops/pool.ts","../src/ops/slice.ts","../src/globals.ts","../src/ops/reduction_ops.ts","../src/ops/compare.ts","../src/ops/binary_ops.ts","../src/ops/logical_ops.ts","../src/ops/relu_ops.ts","../src/ops/transpose.ts","../src/ops/lrn.ts","../src/ops/norm.ts","../src/ops/segment_ops.ts","../src/ops/lstm.ts","../src/ops/moving_average.ts","../src/ops/strided_slice.ts","../src/ops/topk.ts","../src/ops/loss_ops.ts","../src/ops/linalg_ops.ts","../src/ops/image_ops.ts","../src/kernels/backend_cpu.ts","../src/browser_util.ts","../src/io/types.ts","../src/io/io_utils.ts","../src/io/router_registry.ts","../src/io/model_management.ts","../src/io/indexed_db.ts","../src/io/local_storage.ts","../src/io/browser_files.ts","../src/io/weights_loader.ts","../src/io/browser_http.ts","../src/io/passthrough.ts","../src/io/io.ts","../src/serialization.ts","../src/test_util.ts","../src/version.ts","../src/optimizers/optimizer.ts","../src/optimizers/optimizer_utils.ts","../src/optimizers/adadelta_optimizer.ts","../src/optimizers/adagrad_optimizer.ts","../src/optimizers/adam_optimizer.ts","../src/optimizers/adamax_optimizer.ts","../src/optimizers/sgd_optimizer.ts","../src/optimizers/momentum_optimizer.ts","../src/optimizers/rmsprop_optimizer.ts","../src/optimizers/optimizer_constructors.ts","../src/train.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport function isMobile(): boolean {\n // tslint:disable-next-line:no-any\n const a = navigator.userAgent || navigator.vendor || (window as any).opera;\n // tslint:disable-next-line:max-line-length\n return /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i\n .test(a) ||\n // tslint:disable-next-line:max-line-length\n /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i\n .test(a.substr(0, 4));\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ArrayData, DataType, DataTypeMap, FlatVector, RecursiveArray, RegularArray, TensorLike, TypedArray} from './types';\n\n/** Shuffles the array using Fisher-Yates algorithm. */\n// tslint:disable-next-line:no-any\nexport function shuffle(array: any[]|Uint32Array|Int32Array|\n Float32Array): void {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n\n/** Clamps a value to a specified range. */\nexport function clamp(min: number, x: number, max: number): number {\n return Math.max(min, Math.min(x, max));\n}\n\n/** Returns a sample from a uniform [a, b] distribution. */\nexport function randUniform(a: number, b: number) {\n return Math.random() * (b - a) + a;\n}\n\n/** Returns squared eucledian distance between two vectors. */\nexport function distSquared(a: FlatVector, b: FlatVector): number {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n\nexport function assert(expr: boolean, msg: string|(() => string)) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\n\nexport function assertShapesMatch(\n shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {\n assert(\n arraysEqual(shapeA, shapeB),\n errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\n\nexport function assertNonNull(a: TensorLike): void {\n assert(\n a != null,\n `The input to the tensor constructor must be a non-null value.`);\n}\n\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\nexport function flatten>(\n arr: T|RecursiveArray, ret: T[] = []): T[] {\n if (Array.isArray(arr)) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], ret);\n }\n } else {\n ret.push(arr as T);\n }\n return ret;\n}\n\nexport function inferShape(val: TypedArray|number|boolean|RegularArray|\n RegularArray): number[] {\n let firstElem: typeof val = val;\n\n if (isTypedArray(val)) {\n return [(val as TypedArray).length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape: number[] = [];\n\n while (firstElem instanceof Array) {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (val instanceof Array) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\n\nfunction deepAssertShapeConsistency(\n val: number|boolean|RegularArray|RegularArray,\n shape: number[], indices?: number[]) {\n indices = indices || [];\n if (!(val instanceof Array)) {\n assert(\n shape.length === 0,\n () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array of ${shape[0]} elements`);\n return;\n }\n assert(\n shape.length > 0,\n () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(\n val.length === shape[0],\n () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\n\nexport function sizeFromShape(shape: number[]): number {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\n\nexport function isScalarShape(shape: number[]): boolean {\n return shape.length === 0;\n}\n\nexport function arraysEqual(n1: FlatVector, n2: FlatVector) {\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\n\nexport function isInt(a: number): boolean {\n return a % 1 === 0;\n}\n\nexport function tanh(x: number): number {\n // tslint:disable-next-line:no-any\n if ((Math as any).tanh != null) {\n // tslint:disable-next-line:no-any\n return (Math as any).tanh(x);\n }\n if (x === Infinity) {\n return 1;\n } else if (x === -Infinity) {\n return -1;\n } else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\n\nexport function sizeToSquarishShape(size: number): [number, number] {\n for (let a = Math.floor(Math.sqrt(size)); a > 1; --a) {\n if (size % a === 0) {\n return [a, size / a];\n }\n }\n return [1, size];\n}\n\nexport function createShuffledIndices(n: number): Uint32Array {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\n\nexport function rightPad(a: string, size: number): string {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\n\nexport function repeatedTry(\n checkFn: () => boolean, delayFn = (counter: number) => 0,\n maxCounter?: number): Promise {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n\n tryCount++;\n\n const nextBackoff = delayFn(tryCount);\n\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n\n tryFn();\n });\n}\n\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(\n shape: number[], size: number): number[] {\n let shapeProd = 1;\n let implicitIdx = -1;\n\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] > 0) {\n shapeProd *= shape[i];\n } else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(\n `Shapes can only have 1 implicit size. ` +\n `Found - 1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n } else if (shape[i] <= 0) {\n throw Error(`Shapes can not be <= 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n\n if (size % shapeProd !== 0) {\n throw Error(\n `The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\n\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape: number[], axis?: number[]):\n {newShape: number[], keptDims: number[]} {\n const newShape: number[] = [];\n const keptDims: number[] = [];\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axis != null) {\n if (axis[j] === i && shape[i] > 1) {\n throw new Error(\n `Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axis[j] == null || axis[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axis[j] <= i) {\n j++;\n }\n }\n if (shape[i] > 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return {newShape, keptDims};\n}\n\nexport function getTypedArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\n\nexport function checkComputationForNaN(\n vals: DataTypeMap[D], dtype: D, name: string): void {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return;\n }\n for (let i = 0; i < vals.length; i++) {\n if (isNaN(vals[i])) {\n throw Error(`The result of the '${name}' has NaNs.`);\n }\n }\n}\n\nexport function checkConversionForNaN(\n vals: DataTypeMap[D]|number[], dtype: D): void {\n if (dtype === 'float32') {\n // NaN is valid for floating point conversions\n return;\n }\n\n for (let i = 0; i < vals.length; i++) {\n if (isNaN(vals[i])) {\n throw Error(`NaN is not a valid value for dtype: '${dtype}'.`);\n }\n }\n}\n\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType: DataType, newType: DataType): boolean {\n if (newType === 'float32') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\n\nfunction copyTypedArray(\n array: DataTypeMap[D]|number[]|boolean[], dtype: D,\n debugMode: boolean): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32') {\n return new Float32Array(array as number[]);\n } else if (dtype === 'int32') {\n if (debugMode) {\n checkConversionForNaN(array as number[], dtype);\n }\n return new Int32Array(array as number[]);\n } else if (dtype === 'bool') {\n const bool = new Uint8Array(array.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(array[i] as number) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\nexport function isTypedArray(a: TypedArray|number|boolean|RegularArray|\n RegularArray): boolean {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\n\nexport function bytesPerElement(dtype: DataType): number {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n } else if (dtype === 'bool') {\n return 1;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\nexport function isFunction(f: Function) {\n return !!(f && f.constructor && f.call && f.apply);\n}\n\nexport function nearestDivisor(size: number, start: number): number {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\n\nexport function computeStrides(shape: number[]): number[] {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\n\nexport function toTypedArray(\n a: ArrayData, dtype: D, debugMode: boolean): DataTypeMap[D] {\n if (noConversionNeeded(a, dtype)) {\n return a as DataTypeMap[D];\n }\n if (Array.isArray(a)) {\n a = flatten(a as number[]);\n }\n return copyTypedArray(a, dtype, debugMode);\n}\n\nfunction noConversionNeeded(\n a: ArrayData, dtype: D): boolean {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\n\nexport function makeOnesTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\n\nexport function makeZerosTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32') {\n return new Float32Array(size);\n } else if (dtype === 'int32') {\n return new Int32Array(size);\n } else if (dtype === 'bool') {\n return new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Returns the current high-resolution real time in milliseconds. It is\n * relative to an arbitrary time in the past.\n */\nexport function now(): number {\n if (typeof performance !== 'undefined') {\n return performance.now();\n } else if (typeof process !== 'undefined') {\n const time = process.hrtime();\n return time[0] * 1000 + time[1] / 1000000;\n } else {\n throw new Error(\n 'Can not measure time in this environment. You should run tf.js ' +\n 'in the browser or in Node.js');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimer} from './kernels/backend';\nimport {Tensor} from './tensor';\nimport {TypedArray} from './types';\nimport * as util from './util';\n\nexport class Profiler {\n constructor(private backendTimer: BackendTimer, private logger?: Logger) {\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n\n profileKernel(name: string, f: () => T | Tensor[]):\n T {\n let result: T|Tensor[];\n const holdResultWrapperFn = () => {\n result = f();\n };\n const timer = this.backendTimer.time(holdResultWrapperFn);\n\n const results: Tensor[] =\n Array.isArray(result) ? result : [result] as Tensor[];\n results.forEach(r => {\n const vals = r.dataSync();\n util.checkComputationForNaN(vals, r.dtype, name);\n\n timer.then(timing => {\n this.logger.logKernelProfile(name, r, vals, timing.kernelMs);\n });\n });\n\n return result as T;\n }\n}\n\nexport class Logger {\n logKernelProfile(\n name: string, result: Tensor, vals: TypedArray, timeMs: number) {\n const time = util.rightPad(`${timeMs}ms`, 9);\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n console.log(\n `%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}`,\n 'font-weight:bold', 'color:red', 'color:blue', 'color: orange');\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport * as util from './util';\n\nexport interface TapeNode {\n id: number;\n name: string;\n output: Tensor;\n inputs: NamedTensorMap;\n // Optional params, defined only for ops with gradient impl.\n gradient?: (dy: Tensor|NamedTensorMap) => NamedGradientMap;\n}\n\nexport type NamedGradientMap = {\n [inputName: string]: () => Tensor;\n};\n\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(\n tape: TapeNode[], xs: Tensor[], y: Tensor): TapeNode[] {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX: {[tensorId: number]: boolean} = {};\n const nodesFromX: {[nodeId: number]: boolean} = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n tensorsFromX[node.output.id] = true;\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n\n if (anyInputFromX) {\n break;\n }\n }\n }\n\n // Backwards pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY: {[tensorId: number]: boolean} = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY: {[nodeId: number]: boolean} = {};\n\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n\n const outputs: Tensor[] = [];\n outputs.push(node.output);\n\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < outputs.length; j++) {\n if (tensorsLeadToY[outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n\n // Return the paths that come from x and lead to y.\n const filteredTape: TapeNode[] = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs: {[inputName: string]: Tensor} = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node) as TapeNode;\n prunedNode.inputs = prunedInputs;\n prunedNode.output = node.output;\n\n filteredTape.push(prunedNode);\n }\n }\n\n return filteredTape;\n}\n\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(\n tensorAccumulatedGradientMap: {[tensorId: number]: Tensor},\n filteredTape: TapeNode[]) {\n // Walk the tape backwards and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n\n const dy = tensorAccumulatedGradientMap[node.output.id];\n\n if (node.gradient == null) {\n throw new Error(\n `Cannot compute gradient: gradient function not found ` +\n `for ${node.name}.`);\n }\n\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dy);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(\n `Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n\n // Call the gradient function.\n const dx = inputGradients[inputName]();\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(\n `Error in gradient for op ${node.name}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n } else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = curGradient.add(dx);\n curGradient.dispose();\n }\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, TypedArray} from './types';\nimport {computeStrides, rightPad, sizeFromShape} from './util';\n\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\n\nexport function tensorToString(\n vals: TypedArray, shape: number[], dtype: DataType, verbose: boolean) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\n\nfunction computeMaxSizePerColumn(\n vals: TypedArray, shape: number[], strides: number[]): number[] {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] =\n Math.max(padPerCol[j], valToString(vals[offset + j], 0).length);\n }\n }\n }\n return padPerCol;\n}\n\nfunction valToString(val: number, pad: number) {\n return rightPad(\n parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(), pad);\n}\n\nfunction subTensorToString(\n vals: TypedArray, shape: number[], strides: number[], padPerCol: number[],\n isLast = true): string[] {\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n return [vals[0].toString()];\n }\n\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstVals =\n Array.from(vals.subarray(0, FORMAT_NUM_FIRST_LAST_VALS));\n const lastVals =\n Array.from(vals.subarray(size - FORMAT_NUM_FIRST_LAST_VALS, size));\n return [\n '[' + firstVals.map((x, i) => valToString(x, padPerCol[i])).join(', ') +\n ', ..., ' +\n lastVals\n .map(\n (x, i) => valToString(\n x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i]))\n .join(', ') +\n ']'\n ];\n }\n return [\n '[' +\n Array.from(vals).map((x, i) => valToString(x, padPerCol[i])).join(', ') +\n ']'\n ];\n }\n\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0];\n const lines: string[] = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.subarray(start, end), subshape, substrides, padPerCol,\n false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.subarray(start, end), subshape, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n } else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.subarray(start, end), subshape, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensorToString} from './tensor_format';\nimport {DataType, Rank, ShapeMap, TypedArray} from './types';\nimport * as util from './util';\nimport {computeStrides} from './util';\n\n/** @hidden */\nexport interface TensorData {\n dataId?: DataId;\n values?: TypedArray;\n}\n\n/**\n * A mutable object, similar to `Tensor`, that allows users to set values\n * at locations before converting to an immutable `Tensor`.\n *\n * See `buffer` for creating a tensor buffer.\n */\n/** @doc {heading: 'Tensors', subheading: 'Classes'} */\nexport class TensorBuffer {\n size: number;\n shape: ShapeMap[R];\n strides: number[];\n values: TypedArray;\n\n constructor(shape: ShapeMap[R], public dtype: DataType, values: TypedArray) {\n if (values != null) {\n const n = values.length;\n const size = util.sizeFromShape(shape);\n util.assert(\n n === size,\n `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${size}'`);\n }\n this.shape = shape.slice();\n this.values =\n values || util.getTypedArrayFromDType(dtype, util.sizeFromShape(shape));\n this.strides = computeStrides(shape);\n this.size = util.sizeFromShape(shape);\n }\n\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n set(value: number, ...locs: number[]) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(\n locs.length === this.rank,\n `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n get(...locs: number[]): number {\n if (locs.length === 0) {\n locs = [0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n\n locToIndex(locs: number[]): number {\n if (this.rank === 0) {\n return 0;\n } else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n\n indexToLoc(index: number): number[] {\n if (this.rank === 0) {\n return [];\n } else if (this.rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n\n get rank() {\n return this.shape.length;\n }\n\n /**\n * Creates an immutable `Tensor` object from the buffer.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n toTensor(): Tensor {\n return Tensor.make(this.shape, {values: this.values}, this.dtype);\n }\n}\n\nexport interface TensorTracker {\n registerTensor(t: Tensor): void;\n disposeTensor(t: Tensor): void;\n write(dataId: DataId, values: TypedArray): void;\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): TypedArray;\n registerVariable(v: Variable): void;\n}\n\n/**\n * The Tensor class calls into this handler to delegate chaining operations.\n */\nexport interface OpHandler {\n cast(x: T, dtype: DataType): T;\n buffer(\n shape: ShapeMap[R], dtype: DataType,\n values?: TypedArray): TensorBuffer;\n print(x: T, verbose: boolean): void;\n reshape(x: Tensor, shape: ShapeMap[R2]): Tensor;\n expandDims(x: Tensor, axis: number): Tensor;\n cumsum(\n x: Tensor, axis: number, exclusive: boolean, reverse: boolean): T;\n squeeze(x: Tensor, axis?: number[]): T;\n clone(x: T): T;\n tile(x: T, reps: number[]): T;\n gather(x: T, indices: Tensor1D, axis: number): T;\n matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean):\n Tensor2D;\n dot(t1: Tensor, t2: Tensor): Tensor;\n norm(\n x: Tensor, ord: number|'euclidean'|'fro', axis: number|number[],\n keepDims: boolean): Tensor;\n slice>(\n x: T, begin: number|number[], size?: number|number[]): T;\n reverse(x: T, axis?: number|number[]): T;\n concat(tensors: T[], axis: number): T;\n stack(tensors: T[], axis: number): Tensor;\n unstack(value: T, axis: number): Tensor[];\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T;\n batchNormalization(\n x: Tensor, mean: Tensor|Tensor1D, variance: Tensor|Tensor1D,\n varianceEpsilon: number, scale?: Tensor|Tensor1D,\n offset?: Tensor|Tensor1D): Tensor;\n all(x: Tensor, axis: number|number[], keepDims: boolean): T;\n any(x: Tensor, axis: number|number[], keepDims: boolean): T;\n logSumExp(\n x: Tensor, axis: number|number[], keepDims: boolean): T;\n sum(x: Tensor, axis: number|number[], keepDims: boolean): T;\n mean(x: Tensor, axis: number|number[], keepDims: boolean):\n T;\n min(x: Tensor, axis: number|number[], keepDims: boolean): T;\n max(x: Tensor, axis: number|number[], keepDims: boolean): T;\n argMin(x: Tensor, axis: number): T;\n argMax(x: Tensor, axis: number): T;\n add(a: Tensor, b: Tensor): T;\n addStrict(a: T, b: T): T;\n sub(a: Tensor, b: Tensor): T;\n subStrict(a: T, b: T): T;\n pow(base: T, exp: Tensor): T;\n powStrict(base: T, exp: Tensor): T;\n mul(a: Tensor, b: Tensor): T;\n mulStrict(a: T, b: T): T;\n div(a: Tensor, b: Tensor): T;\n floorDiv(a: Tensor, b: Tensor): T;\n divStrict(a: T, b: T): T;\n mod(a: Tensor, b: Tensor): T;\n modStrict(a: T, b: T): T;\n minimum(a: Tensor, b: Tensor): T;\n minimumStrict(a: T, b: T): T;\n maximum(a: Tensor, b: Tensor): T;\n maximumStrict(a: T, b: T): T;\n squaredDifference(a: Tensor, b: Tensor): T;\n squaredDifferenceStrict(a: T, b: T): T;\n transpose(x: T, perm?: number[]): T;\n logicalNot(x: T): T;\n logicalAnd(a: Tensor, b: Tensor): T;\n logicalOr(a: Tensor, b: Tensor): T;\n logicalXor(a: Tensor, b: Tensor): T;\n where(condition: Tensor, a: T, b: T): T;\n notEqual(a: Tensor, b: Tensor): T;\n notEqualStrict(a: T, b: T): T;\n less(a: Tensor, b: Tensor): T;\n lessStrict(a: T, b: T): T;\n equal(a: Tensor, b: Tensor): T;\n equalStrict(a: T, b: T): T;\n lessEqual(a: Tensor, b: Tensor): T;\n lessEqualStrict(a: T, b: T): T;\n greater(a: Tensor, b: Tensor): T;\n greaterStrict(a: T, b: T): T;\n greaterEqual(a: Tensor, b: Tensor): T;\n greaterEqualStrict(a: T, b: T): T;\n neg(x: T): T;\n ceil(x: T): T;\n floor(x: T): T;\n sign(x: T): T;\n round(x: T): T;\n exp(x: T): T;\n expm1(x: T): T;\n log(x: T): T;\n log1p(x: T): T;\n sqrt(x: T): T;\n rsqrt(x: T): T;\n square(x: T): T;\n reciprocal(x: T): T;\n abs(x: T): T;\n clipByValue(\n x: T, clipValueMin: number, clipValueMax: number): T;\n sigmoid(x: T): T;\n logSigmoid(x: T): T;\n softplus(x: T): T;\n sin(x: T): T;\n cos(x: T): T;\n tan(x: T): T;\n asin(x: T): T;\n acos(x: T): T;\n atan(x: T): T;\n sinh(x: T): T;\n cosh(x: T): T;\n tanh(x: T): T;\n asinh(x: T): T;\n acosh(x: T): T;\n atanh(x: T): T;\n erf(x: T): T;\n step(x: T, alpha: number): T;\n relu(x: T): T;\n elu(x: T): T;\n selu(x: T): T;\n leakyRelu(x: T, alpha: number): T;\n prelu(x: T, alpha: T): T;\n softmax(logits: T, dim: number): T;\n image: {\n resizeBilinear(\n images: T, size: [number, number], alignCorners: boolean): T;\n resizeNearestNeighbor(\n images: T, size: [number, number], alignCorners: boolean): T;\n };\n conv1d(\n x: T, filter: Tensor3D, stride: number, pad: 'valid'|'same'|number,\n dataFormat: 'NWC'|'NCW', dilation: number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n conv2d(\n x: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW',\n dilations: [number, number]|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n conv2dTranspose(\n x: T, filter: Tensor4D,\n outputShape: [number, number, number, number]|[number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n depthwiseConv2d(\n x: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW',\n dilations: [number, number]|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n maxPool(\n x: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n avgPool(\n x: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n localResponseNormalization(\n x: T, depthRadius: number, bias: number, alpha: number, beta: number): T;\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): T;\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T;\n spaceToBatchND(\n x: T, blockShape: number[], paddings: number[][]): T;\n}\n\n// For tracking tensor creation and disposal.\nlet trackerFn: () => TensorTracker = null;\n// Used by chaining methods to call into ops.\nlet opHandler: OpHandler = null;\n\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn: () => TensorTracker) {\n trackerFn = fn;\n}\n\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op handler.\n */\nexport function setOpHandler(handler: OpHandler) {\n opHandler = handler;\n}\n\n/**\n * We wrap data id since we use weak map to avoid memory leaks.\n * Since we have our own memory management, we have a reference counter\n * mapping a tensor to its data, so there is always a pointer (even if that\n * data is otherwise garbage collectable).\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/\n * Global_Objects/WeakMap\n */\nexport type DataId = object; // object instead of {} to force non-primitive.\n\n/**\n * A `Tensor` object represents an immutable, multidimensional array of numbers\n * that has a shape and a data type.\n *\n * See `tensor` for details on how to create a `Tensor`.\n */\n/** @doc {heading: 'Tensors', subheading: 'Classes'} */\nexport class Tensor {\n private static nextId = 0;\n\n /** Unique id of this tensor. */\n readonly id: number;\n /**\n * Id of the bucket holding the data for this tensor. Multiple arrays can\n * point to the same bucket (e.g. when calling array.reshape()).\n */\n dataId: DataId;\n /** The shape of the tensor. */\n readonly shape: ShapeMap[R];\n /** Number of elements in the tensor. */\n readonly size: number;\n /** The data type for the array. */\n readonly dtype: DataType;\n /** The rank type for the array (see `Rank` enum). */\n readonly rankType: R;\n\n /**\n * Number of elements to skip in each dimension when indexing. See\n * https://docs.scipy.org/doc/numpy/reference/generated/\\\n * numpy.ndarray.strides.html\n */\n readonly strides: number[];\n\n protected constructor(\n shape: ShapeMap[R], dtype: DataType, values?: TypedArray,\n dataId?: DataId) {\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n util.assert(\n this.size === values.length,\n `Constructing tensor of shape (${this.size}) should match the ` +\n `length of values (${values.length})`);\n }\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.strides = computeStrides(shape);\n this.dataId = dataId != null ? dataId : {};\n this.id = Tensor.nextId++;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher') as R;\n trackerFn().registerTensor(this);\n if (values != null) {\n trackerFn().write(this.dataId, values);\n }\n }\n\n /**\n * Makes a new tensor with the provided shape and values. Values should be in\n * a flat array.\n */\n static make, D extends DataType = 'float32',\n R extends Rank = Rank>(\n shape: ShapeMap[R], data: TensorData, dtype?: D): T {\n return new Tensor(shape, dtype, data.values, data.dataId) as T;\n }\n\n /** Flatten a Tensor to a 1D array. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n flatten(): Tensor1D {\n this.throwIfDisposed();\n return this.as1D();\n }\n\n /** Converts a size-1 `Tensor` to a `Scalar`. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n asScalar(): Scalar {\n this.throwIfDisposed();\n util.assert(this.size === 1, 'The array must have only 1 element.');\n return this.reshape([]);\n }\n\n /** Converts a `Tensor` to a `Tensor1D`. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as1D(): Tensor1D {\n this.throwIfDisposed();\n return this.reshape([this.size]);\n }\n\n /**\n * Converts a `Tensor` to a `Tensor2D`.\n *\n * @param rows Number of rows in `Tensor2D`.\n * @param columns Number of columns in `Tensor2D`.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as2D(rows: number, columns: number): Tensor2D {\n this.throwIfDisposed();\n return this.reshape([rows, columns]);\n }\n\n /**\n * Converts a `Tensor` to a `Tensor3D`.\n *\n * @param rows Number of rows in `Tensor3D`.\n * @param columns Number of columns in `Tensor3D`.\n * @param depth Depth of `Tensor3D`.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as3D(rows: number, columns: number, depth: number): Tensor3D {\n this.throwIfDisposed();\n return this.reshape([rows, columns, depth]);\n }\n\n /**\n * Converts a `Tensor` to a `Tensor4D`.\n *\n * @param rows Number of rows in `Tensor4D`.\n * @param columns Number of columns in `Tensor4D`.\n * @param depth Depth of `Tensor4D`.\n * @param depth2 4th dimension of `Tensor4D`.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as4D(rows: number, columns: number, depth: number, depth2: number): Tensor4D {\n this.throwIfDisposed();\n return this.reshape([rows, columns, depth, depth2]);\n }\n\n /**\n * Casts a `Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n asType(this: T, dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype) as T;\n }\n\n get rank(): number {\n return this.shape.length;\n }\n\n /**\n * Returns the value in the tensor at the provided location.\n * If using WebGL backend, this is a blocking call.\n * Prefer calling the `async data()[flatIndex]` method instead.\n *\n * @param locs The location indices.\n */\n get(...locs: number[]) {\n util.assert(\n locs.length === this.rank,\n 'Number of coordinates in get() must match the rank of the tensor');\n this.throwIfDisposed();\n if (locs.length === 0) {\n locs = [0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.dataSync()[index];\n }\n\n /** Returns a `TensorBuffer` that holds the underlying data. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n buffer(): TensorBuffer {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n\n /**\n * Asynchronously downloads the values from the `Tensor`. Returns a promise of\n * `TypedArray` that resolves when the computation has finished.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n async data(): Promise {\n this.throwIfDisposed();\n return trackerFn().read(this.dataId);\n }\n\n /**\n * Synchronously downloads the values from the `Tensor`. This blocks the UI\n * thread until the values are ready, which can cause performance issues.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n dataSync(): TypedArray {\n this.throwIfDisposed();\n return trackerFn().readSync(this.dataId);\n }\n\n /**\n * Disposes `Tensor` from memory.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n\n private isDisposedInternal = false;\n get isDisposed(): boolean {\n return this.isDisposedInternal;\n }\n\n private throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n\n /** Casts the array to type `float32` */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toFloat(this: T): T {\n return this.asType('float32');\n }\n\n /** Casts the array to type `int32` */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toInt() {\n return this.asType('int32');\n }\n\n /** Casts the array to type `bool` */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toBool() {\n return this.asType('bool');\n }\n\n /**\n * Prints the `Tensor`. See `print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n print(verbose = false): void {\n return opHandler.print(this, verbose);\n }\n\n /**\n * Reshapes the tensor into the provided shape.\n * See `reshape` for more details.\n *\n * @param newShape An array of integers defining the output tensor shape.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n reshape(newShape: ShapeMap[R2]): Tensor {\n this.throwIfDisposed();\n return opHandler.reshape(this, newShape);\n }\n\n /**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n reshapeAs(x: T): T {\n this.throwIfDisposed();\n return this.reshape(x.shape) as T;\n }\n\n /**\n * Returns a `Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape. See `expandDims` for details.\n *\n * @param axis The dimension index at which to insert shape of 1. Defaults to\n * 0 (the first dimension).\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n expandDims(axis = 0): Tensor {\n return opHandler.expandDims(this, axis);\n }\n\n /**\n * Returns the cumulative sum of the `Tensor` along `axis`.\n *\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Defaults to\n * false. If set to true then the sum of each tensor entry does not include\n * its own value, but only the values previous to it along the specified\n * axis.\n * @param reverse Whether to sum in the opposite direction. Defaults to\n * false.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n cumsum(axis = 0, exclusive = false, reverse = false): T {\n return opHandler.cumsum(this, axis, exclusive, reverse);\n }\n\n /**\n * Returns a `Tensor` with dimensions of size 1 removed from the shape.\n * See `squeeze` for more details.\n *\n * @param axis A list of numbers. If specified, only squeezes the\n * dimensions listed. The dimension index starts at 0. It is an error to\n * squeeze a dimension that is not 1.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n squeeze(axis?: number[]): T {\n this.throwIfDisposed();\n return opHandler.squeeze(this, axis);\n }\n\n /** Returns a copy of the tensor. See `clone` for details. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n clone(this: T): T {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n\n /** Returns a human-readable description of the tensor. Useful for logging. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toString(verbose = false): string {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n\n // Below is chain API that is not exposed to docs to avoid repetition. To\n // expose a method, move it above this comment and add @doc and jsdoc.\n\n tile(this: T, reps: number[]): T {\n this.throwIfDisposed();\n return opHandler.tile(this, reps) as T;\n }\n\n gather(this: T, indices: Tensor1D, axis = 0): T {\n this.throwIfDisposed();\n return opHandler.gather(this, indices, axis) as T;\n }\n\n matMul(b: Tensor2D, transposeA = false, transposeB = false): Tensor2D {\n this.throwIfDisposed();\n return opHandler.matMul(this as Tensor2D, b, transposeA, transposeB);\n }\n dot(b: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.dot(this, b);\n }\n norm(\n ord: number|'euclidean'|'fro' = 'euclidean', axis: number|number[] = null,\n keepDims = false): Tensor {\n this.throwIfDisposed();\n return opHandler.norm(this, ord, axis, keepDims);\n }\n slice>(\n this: T, begin: number|number[], size?: number|number[]): T {\n this.throwIfDisposed();\n return opHandler.slice(this, begin, size);\n }\n reverse(this: T, axis?: number|number[]): T {\n this.throwIfDisposed();\n return opHandler.reverse(this, axis);\n }\n concat(this: T, x: T, axis = 0): T {\n this.throwIfDisposed();\n return opHandler.concat([this, x], axis);\n }\n stack(x: Tensor, axis = 0): Tensor {\n return opHandler.stack([this, x], axis);\n }\n unstack(x: Tensor, axis = 0): Tensor[] {\n return opHandler.unstack(this, axis);\n }\n pad(\n this: T, paddings: Array<[number, number]>, constantValue = 0): T {\n return opHandler.pad(this, paddings, constantValue);\n }\n batchNormalization(\n mean: Tensor|Tensor1D, variance: Tensor|Tensor1D,\n varianceEpsilon = .001, scale?: Tensor|Tensor1D,\n offset?: Tensor|Tensor1D): Tensor {\n this.throwIfDisposed();\n return opHandler.batchNormalization(\n this, mean, variance, varianceEpsilon, scale, offset);\n }\n\n // Reduction ops.\n all(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.all(this, axis, keepDims);\n }\n any(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.any(this, axis, keepDims);\n }\n logSumExp(axis: number|number[] = null, keepDims = false):\n T {\n this.throwIfDisposed();\n return opHandler.logSumExp(this, axis, keepDims);\n }\n sum(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.sum(this, axis, keepDims);\n }\n mean(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.mean(this, axis, keepDims);\n }\n min(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.min(this, axis, keepDims);\n }\n max(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.max(this, axis, keepDims);\n }\n argMin(axis: number = null): T {\n this.throwIfDisposed();\n return opHandler.argMin(this, axis);\n }\n argMax(axis: number = null): T {\n this.throwIfDisposed();\n return opHandler.argMax(this, axis);\n }\n\n // Transformations\n cast(dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this as T, dtype) as T;\n }\n\n // Binary ops.\n\n add(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.add(this, x);\n }\n addStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.addStrict(this, x) as T;\n }\n sub(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.sub(this, x);\n }\n subStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.subStrict(this, x) as T;\n }\n pow(this: T, exp: Tensor): T {\n this.throwIfDisposed();\n return opHandler.pow(this, exp);\n }\n powStrict(exp: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.powStrict(this, exp);\n }\n mul(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.mul(this, x);\n }\n mulStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.mulStrict(this, x) as T;\n }\n div(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.div(this, x);\n }\n floorDiv(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.floorDiv(this, x);\n }\n divStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.divStrict(this, x) as T;\n }\n minimum(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.minimum(this, x);\n }\n minimumStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.minimumStrict(this, x) as T;\n }\n maximum(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.maximum(this, x);\n }\n maximumStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.maximumStrict(this, x) as T;\n }\n mod(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.mod(this, x);\n }\n modStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.modStrict(this, x) as T;\n }\n squaredDifference(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.squaredDifference(this, x);\n }\n squaredDifferenceStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.squaredDifferenceStrict(this, x) as T;\n }\n transpose(this: T, perm?: number[]): T {\n this.throwIfDisposed();\n return opHandler.transpose(this, perm);\n }\n\n // Compare ops.\n\n notEqual(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.notEqual(this, x);\n }\n notEqualStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.notEqualStrict(this, x) as T;\n }\n less(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.less(this, x);\n }\n lessStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.lessStrict(this, x) as T;\n }\n equal(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.equal(this, x);\n }\n equalStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.equalStrict(this, x) as T;\n }\n lessEqual(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.lessEqual(this, x);\n }\n lessEqualStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.lessEqualStrict(this, x) as T;\n }\n greater(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.greater(this, x);\n }\n greaterStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.greaterStrict(this, x) as T;\n }\n greaterEqual(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.greaterEqual(this, x);\n }\n greaterEqualStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.greaterEqualStrict(this, x) as T;\n }\n\n // Compare ops.\n logicalAnd(x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.logicalAnd(this, x);\n }\n logicalOr(x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.logicalOr(this, x);\n }\n logicalNot(this: T): T {\n this.throwIfDisposed();\n return opHandler.logicalNot(this);\n }\n logicalXor(x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.logicalXor(this, x);\n }\n where(condition: Tensor, x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.where(condition, this, x);\n }\n\n // Unary ops.\n neg(this: T): T {\n this.throwIfDisposed();\n return opHandler.neg(this);\n }\n ceil(this: T): T {\n this.throwIfDisposed();\n return opHandler.ceil(this);\n }\n floor(this: T): T {\n this.throwIfDisposed();\n return opHandler.floor(this);\n }\n sign(this: T): T {\n this.throwIfDisposed();\n return opHandler.sign(this);\n }\n exp(this: T): T {\n this.throwIfDisposed();\n return opHandler.exp(this);\n }\n expm1(this: T): T {\n this.throwIfDisposed();\n return opHandler.expm1(this);\n }\n log(this: T): T {\n this.throwIfDisposed();\n return opHandler.log(this);\n }\n log1p(this: T): T {\n this.throwIfDisposed();\n return opHandler.log1p(this);\n }\n sqrt(this: T): T {\n this.throwIfDisposed();\n return opHandler.sqrt(this);\n }\n rsqrt(this: T): T {\n this.throwIfDisposed();\n return opHandler.rsqrt(this);\n }\n square(this: T): T {\n this.throwIfDisposed();\n return opHandler.square(this);\n }\n reciprocal(this: T): T {\n this.throwIfDisposed();\n return opHandler.reciprocal(this);\n }\n abs(this: T): T {\n this.throwIfDisposed();\n return opHandler.abs(this);\n }\n clipByValue(min: number, max: number): Tensor {\n this.throwIfDisposed();\n return opHandler.clipByValue(this, min, max);\n }\n relu(this: T): T {\n this.throwIfDisposed();\n return opHandler.relu(this);\n }\n elu(this: T): T {\n this.throwIfDisposed();\n return opHandler.elu(this);\n }\n selu(this: T): T {\n this.throwIfDisposed();\n return opHandler.selu(this);\n }\n leakyRelu(alpha = 0.2): Tensor {\n this.throwIfDisposed();\n return opHandler.leakyRelu(this, alpha);\n }\n prelu(alpha: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.prelu(this, alpha);\n }\n sigmoid(this: T): T {\n this.throwIfDisposed();\n return opHandler.sigmoid(this);\n }\n logSigmoid(this: T): T {\n this.throwIfDisposed();\n return opHandler.logSigmoid(this);\n }\n softplus(this: T): T {\n this.throwIfDisposed();\n return opHandler.softplus(this);\n }\n sin(this: T): T {\n this.throwIfDisposed();\n return opHandler.sin(this);\n }\n cos(this: T): T {\n this.throwIfDisposed();\n return opHandler.cos(this);\n }\n tan(this: T): T {\n this.throwIfDisposed();\n return opHandler.tan(this);\n }\n asin(this: T): T {\n this.throwIfDisposed();\n return opHandler.asin(this);\n }\n acos(this: T): T {\n this.throwIfDisposed();\n return opHandler.acos(this);\n }\n atan(this: T): T {\n this.throwIfDisposed();\n return opHandler.atan(this);\n }\n sinh(this: T): T {\n this.throwIfDisposed();\n return opHandler.sinh(this);\n }\n cosh(this: T): T {\n this.throwIfDisposed();\n return opHandler.cosh(this);\n }\n tanh(this: T): T {\n this.throwIfDisposed();\n return opHandler.tanh(this);\n }\n asinh(this: T): T {\n this.throwIfDisposed();\n return opHandler.asinh(this);\n }\n acosh(this: T): T {\n this.throwIfDisposed();\n return opHandler.acosh(this);\n }\n atanh(this: T): T {\n this.throwIfDisposed();\n return opHandler.atanh(this);\n }\n erf(this: T): T {\n this.throwIfDisposed();\n return opHandler.erf(this);\n }\n round(this: T): T {\n this.throwIfDisposed();\n return opHandler.round(this);\n }\n step(this: T, alpha = 0.0): T {\n this.throwIfDisposed();\n return opHandler.step(this, alpha);\n }\n softmax(this: T, dim = -1): T {\n this.throwIfDisposed();\n return opHandler.softmax(this, dim) as T;\n }\n\n // Image ops.\n resizeBilinear(\n this: T, newShape2D: [number, number], alignCorners = false): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.image.resizeBilinear(this, newShape2D, alignCorners);\n }\n\n resizeNearestNeighbor(\n this: T, newShape2D: [number, number], alignCorners = false): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.image.resizeNearestNeighbor(\n this, newShape2D, alignCorners);\n }\n\n // Convolutions.\n conv1d(\n this: T, filter: Tensor3D, stride: number, pad: 'valid'|'same'|number,\n dataFormat: 'NWC'|'NCW' = 'NWC', dilation = 1,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.conv1d(\n this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n }\n conv2d(\n this: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.conv2d(\n this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n }\n conv2dTranspose(\n this: T, filter: Tensor4D,\n outputShape: [number, number, number, number]|[number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.conv2dTranspose(\n this, filter, outputShape, strides, pad, dimRoundingMode);\n }\n depthwiseConv2D(\n this: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.depthwiseConv2d(\n this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n }\n\n // Pooling.\n avgPool(\n this: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.avgPool(this, filterSize, strides, pad, dimRoundingMode);\n }\n maxPool(\n this: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.maxPool(this, filterSize, strides, pad, dimRoundingMode);\n }\n localResponseNormalization(\n this: T, radius = 5, bias = 1, alpha = 1, beta = 0.5): T {\n return opHandler.localResponseNormalization(\n this, radius, bias, alpha, beta);\n }\n\n variable(trainable = true, name?: string, dtype?: DataType): Variable {\n this.throwIfDisposed();\n return Variable.variable(this, trainable, name, dtype);\n }\n\n unsortedSegmentSum(\n this: T, segmentIds: Tensor1D, numSegments: number): T {\n this.throwIfDisposed();\n return opHandler.unsortedSegmentSum(this, segmentIds, numSegments);\n }\n\n batchToSpaceND(\n this: T, blockShape: number[], crops: number[][]): T {\n this.throwIfDisposed();\n return opHandler.batchToSpaceND(this, blockShape, crops);\n }\n\n spaceToBatchND(\n this: T, blockShape: number[], paddings: number[][]): T {\n this.throwIfDisposed();\n return opHandler.spaceToBatchND(this, blockShape, paddings);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance: Tensor) => {\n return !!instance && instance.shape != null && instance.dtype != null;\n }\n});\n\n/** @doclink Tensor */\nexport type Scalar = Tensor;\n/** @doclink Tensor */\nexport type Tensor1D = Tensor;\n/** @doclink Tensor */\nexport type Tensor2D = Tensor;\n/** @doclink Tensor */\nexport type Tensor3D = Tensor;\n/** @doclink Tensor */\nexport type Tensor4D = Tensor;\n/** @doclink Tensor */\nexport type Tensor5D = Tensor;\n/** @doclink Tensor */\nexport type Tensor6D = Tensor;\n\n/**\n * A mutable `Tensor`, useful for persisting state, e.g. for training.\n */\n/** @doc {heading: 'Tensors', subheading: 'Classes'} */\nexport class Variable extends Tensor {\n private static nextVarId = 0;\n name: string;\n\n /**\n * Private constructor since we can not add logic before calling `super()`.\n * Instead, we expose static `Variable.variable` method below, which will be\n * added to global namespace.\n */\n private constructor(\n initialValue: Tensor, public trainable = true, name?: string) {\n super(\n initialValue.shape, initialValue.dtype, null /* values */,\n initialValue.dataId);\n this.name = name;\n if (this.name == null) {\n this.name = Variable.nextVarId.toString();\n Variable.nextVarId++;\n }\n try {\n trackerFn().registerVariable(this);\n } catch (ex) {\n trackerFn().disposeTensor(this);\n throw ex;\n }\n }\n\n /**\n * Creates a new variable with the provided initial value.\n * ```js\n * const x = tf.variable(tf.tensor([1, 2, 3]));\n * x.assign(tf.tensor([4, 5, 6]));\n *\n * x.print();\n * ```\n *\n * @param initialValue Initial value for the tensor.\n * @param trainable If true, optimizers are allowed to update it.\n * @param name Name of the variable. Defaults to a unique id.\n * @param dtype If set, initialValue will be converted to the given type.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n static variable(\n initialValue: Tensor, trainable = true, name?: string,\n dtype?: DataType): Variable {\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.asType(dtype) as Tensor;\n }\n return new Variable(initialValue, trainable, name);\n }\n\n /**\n * Assign a new `Tensor` to this variable. The new `Tensor` must have the\n * same shape and dtype as the old `Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n assign(newValue: Tensor): void {\n if (newValue.dtype !== this.dtype) {\n throw new Error(\n `dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(\n `shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().registerTensor(this);\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance: Variable) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n\nconst variable = Variable.variable;\nexport {variable};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap, TensorContainer, TensorContainerArray} from './tensor_types';\nimport {assert} from './util';\n\nexport function assertTypesMatch(a: Tensor, b: Tensor): void {\n assert(\n a.dtype === b.dtype,\n ` The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\n\nexport function isTensorInList(tensor: Tensor, tensorList: Tensor[]): boolean {\n for (let i = 0; i < tensorList.length; i++) {\n if (tensorList[i].id === tensor.id) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenNameArrayMap(\n nameArrayMap: Tensor|NamedTensorMap, keys?: string[]): Tensor[] {\n const xs: Tensor[] = [];\n if (nameArrayMap instanceof Tensor) {\n xs.push(nameArrayMap);\n } else {\n const xMap = nameArrayMap as {[xName: string]: Tensor};\n for (let i = 0; i < keys.length; i++) {\n xs.push(xMap[keys[i]]);\n }\n }\n return xs;\n}\n\nexport function unflattenToNameArrayMap(\n keys: string[], flatArrays: Tensor[]): NamedTensorMap {\n if (keys.length !== flatArrays.length) {\n throw new Error(\n `Cannot unflatten Tensor[], keys and arrays are not of same length.`);\n }\n const result: NamedTensorMap = {};\n for (let i = 0; i < keys.length; i++) {\n result[keys[i]] = flatArrays[i];\n }\n return result;\n}\n\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result: TensorContainer): Tensor[] {\n const list: Tensor[] = [];\n const seen = new Set<{}|void>();\n walkTensorContainer(result, list, seen);\n return list;\n}\n\nfunction walkTensorContainer(\n container: TensorContainer, list: Tensor[], seen: Set<{}|void>): void {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container as TensorContainerArray;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction isIterable(obj: any): boolean {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimingInfo, KernelBackend} from './kernels/backend';\nimport {Profiler} from './profiler';\nimport {backpropagateGradients, getFilteredNodesXToY, NamedGradientMap, TapeNode} from './tape';\nimport {DataId, Tensor, Tensor3D, Variable} from './tensor';\nimport {NamedTensorMap, NamedVariableMap, TensorContainer} from './tensor_types';\nimport {getTensorsInContainer, isTensorInList} from './tensor_util';\nimport {TypedArray} from './types';\nimport * as util from './util';\nimport {makeOnesTypedArray, now, sizeFromShape} from './util';\n\n/**\n * A function that computes an output. The save function is for saving tensors\n * computed in the forward pass, that we need in the backwards pass.\n */\nexport type ForwardFunc =\n (backend: KernelBackend, save?: (tensor: S) => S) => T;\n\n/**\n * @docalias (a: Tensor, b: Tensor,...) => {\n * value: Tensor, * gradFunc: (dy: Tensor) => Tensor | Tensor[] * }\n */\nexport type CustomGradientFunc = (...args: Tensor[]) => {\n value: T, gradFunc: (dy: T) => Tensor | Tensor[];\n};\n\nexport type MemoryInfo = {\n numTensors: number; numDataBuffers: number; numBytes: number;\n unreliable?: boolean;\n};\n\nexport interface TimingInfo extends BackendTimingInfo {\n wallMs: number;\n}\n\n/** @docalias Function */\nexport type ScopeFn = () => T;\n\nexport interface TensorManager {\n registerTensor(a: Tensor): void;\n registerVariable(v: Variable): void;\n disposeTensor(a: Tensor): void;\n memory(): {numDataBuffers: number; numBytes: number;};\n}\n\ninterface ScopeState {\n track: Tensor[];\n name: string;\n}\n\nexport class Engine implements TensorManager {\n // Public since optimizers will use it.\n registeredVariables: NamedVariableMap = {};\n\n private refCounter = new WeakMap();\n private nextTapeNodeId = 0;\n private numBytes = 0;\n private numTensors = 0;\n private numDataBuffers = 0;\n\n private activeTape: TapeNode[];\n private gradientScopeCount = 0;\n private customGradientDepth = 0;\n\n // Keep Tensors that parallel the tapes.\n private activeScope: ScopeState;\n private scopeStack: ScopeState[];\n private keepTensors: Set = new Set();\n private profiler: Profiler;\n\n constructor(\n private backend: KernelBackend, public safeMode: boolean,\n private debugMode: () => boolean) {\n // Create a default outer scope.\n this.activeScope = {track: [], name: 'default scope'};\n this.scopeStack = [this.activeScope];\n this.profiler = new Profiler(backend);\n }\n\n tidy(\n nameOrFn: string|ScopeFn, fn?: ScopeFn, gradMode = false): T {\n // gradMode Primarily for internal use during backprop\n // If true, will start a tape if it is the outermost tidy.\n\n let name: string = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n } else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error(\n 'When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error(\n 'When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn as string;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result: T;\n return this.scopedRun(\n () => this.startScope(name, gradMode),\n () => this.endScope(result, gradMode), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n\n private scopedRun(start: () => void, end: () => void, f: () => T): T {\n start();\n try {\n const res = f();\n end();\n return res;\n } catch (ex) {\n end();\n throw ex;\n }\n }\n\n runKernel(\n forwardFunc: ForwardFunc,\n inputs: I,\n backwardsFunc?: (dy: T, saved: Tensor[]) => {[P in keyof I]: () => I[P]},\n ): T {\n let result: T;\n const saved: Tensor[] = [];\n const saveFunc = (x: T): T => {\n saved.push(x);\n return x;\n };\n const scopeName = this.activeScope.name;\n\n // Stop recording to a tape when running a kernel.\n this.scopedRun(\n () => this.customGradientDepth++, () => this.customGradientDepth--,\n () => {\n if (!this.debugMode()) {\n result = forwardFunc(this.backend, saveFunc);\n } else {\n result = this.profiler.profileKernel(\n scopeName, () => forwardFunc(this.backend, saveFunc));\n }\n });\n\n if (this.shouldRecord()) {\n const tapeNode: TapeNode = {\n id: this.nextTapeNodeId++,\n name: scopeName,\n inputs,\n // Keep gradient records only for the first output.\n output: Array.isArray(result) ? result[0] : result\n };\n if (backwardsFunc != null) {\n tapeNode.gradient =\n ((dy: T) => backwardsFunc(dy, saved)) as (dy: Tensor) =>\n NamedGradientMap;\n }\n this.activeTape.push(tapeNode);\n }\n return result;\n }\n\n // TensorManager implementation.\n\n registerTensor(a: Tensor|Variable): void {\n const refCount =\n this.refCounter.has(a.dataId) ? this.refCounter.get(a.dataId) : 0;\n this.numTensors++;\n if (refCount === 0) {\n this.numDataBuffers++;\n this.numBytes +=\n util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype);\n this.backend.register(a.dataId, a.shape, a.dtype);\n }\n this.refCounter.set(a.dataId, refCount + 1);\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n\n registerVariable(v: Variable) {\n if (this.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.registeredVariables[v.name] = v;\n }\n\n disposeTensor(a: Tensor): void {\n if (!this.refCounter.has(a.dataId)) {\n return;\n }\n if (this.keepTensors.has(a.id)) {\n this.keepTensors.delete(a.id);\n }\n this.numTensors--;\n const refCount = this.refCounter.get(a.dataId);\n if (refCount <= 1) {\n this.refCounter.delete(a.dataId);\n this.backend.disposeData(a.dataId);\n this.numDataBuffers--;\n this.numBytes -=\n util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype);\n } else {\n this.refCounter.set(a.dataId, refCount - 1);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n\n disposeVariables(): void {\n for (const varName in this.registeredVariables) {\n const v = this.registeredVariables[varName];\n this.disposeTensor(v);\n delete this.registeredVariables[varName];\n }\n }\n\n memory(): MemoryInfo {\n const info = this.backend.memory() as MemoryInfo;\n info.numTensors = this.numTensors;\n info.numDataBuffers = this.numDataBuffers;\n info.numBytes = this.numBytes;\n return info;\n }\n\n private shouldRecord(): boolean {\n return this.activeTape != null && this.customGradientDepth === 0;\n }\n\n private addTapeNode(\n inputs: Tensor[], result: Tensor,\n gradientsFunc: (dy: Tensor) => Tensor[]): void {\n const inputsMap: NamedTensorMap = {};\n inputs.forEach((input, idx) => {\n inputsMap[idx] = input;\n });\n\n const gradient = (dy: Tensor) => {\n const res = gradientsFunc(dy);\n const resMap: NamedGradientMap = {};\n res.forEach((r, idx) => {\n resMap[idx] = () => r;\n });\n return resMap;\n };\n\n const tapeNode: TapeNode = {\n id: this.nextTapeNodeId++,\n name: this.activeScope.name,\n inputs: inputsMap,\n output: result,\n gradient\n };\n this.activeTape.push(tapeNode);\n }\n\n keep(result: T): T {\n if (this.scopeStack.length === 1 && this.safeMode) {\n throw new Error(\n 'Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' +\n 'tf.tidy(() => {...}) to avoid memory leaks.');\n }\n this.keepTensors.add(result.id);\n return result;\n }\n\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name?: string, gradientsMode = false) {\n if (gradientsMode && this.gradientScopeCount === 0) {\n this.activeTape = [];\n }\n if (gradientsMode) {\n this.gradientScopeCount++;\n }\n\n const scopeInfo: ScopeState = {track: [], name: 'unnamed scope'};\n if (name) {\n scopeInfo.name = name;\n }\n this.scopeStack.push(scopeInfo);\n this.activeScope = scopeInfo;\n }\n\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result?: TensorContainer, gradientsMode = false) {\n if (gradientsMode) {\n this.gradientScopeCount--;\n if (this.gradientScopeCount === 0) {\n this.activeTape = null;\n }\n }\n\n const tensorsToKeep = new Set(this.keepTensors);\n\n const tensorsToTrackInParent = getTensorsInContainer(result);\n tensorsToTrackInParent.forEach(tensor => tensorsToKeep.add(tensor.id));\n\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.activeScope.track.length; i++) {\n const tensor = this.activeScope.track[i];\n if (tensorsToKeep.has(tensor.id)) {\n continue;\n }\n\n if (this.activeTape != null) {\n tensorsToTrackInParent.push(tensor);\n } else {\n tensor.dispose();\n }\n }\n\n const oldScope = this.scopeStack.pop();\n this.activeScope = this.scopeStack.length === 0 ?\n {track: [], name: 'default scope'} :\n this.scopeStack[this.scopeStack.length - 1];\n\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!this.keepTensors.has(tensor.id) &&\n isTensorInList(tensor, oldScope.track)) {\n this.track(tensor);\n }\n });\n }\n\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f` was\n * not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(\n f: () => T, xs: Tensor[], dy?: T,\n allowNoGradients = false): {value: T, grads: Tensor[]} {\n util.assert(xs.length > 0, 'gradients() received an empty list of xs.');\n\n return this.tidy('gradients', () => {\n const y = f();\n util.assert(\n y instanceof Tensor,\n 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error(\n 'Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n\n const accumulatedGradientMap: {[tensorId: number]: Tensor} = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape);\n\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n return {value: y, grads};\n }, true /* gradientsMode */);\n }\n\n customGrad(f: CustomGradientFunc):\n (...args: Tensor[]) => T {\n util.assert(\n util.isFunction(f),\n 'The f passed in customGrad(f) must be a function.');\n return (...inputs: Tensor[]): T => {\n util.assert(\n inputs.every(t => t instanceof Tensor),\n 'The args passed in customGrad(f)(x1, x2,...) must all be tensors');\n\n let gradientsFunc: (dy: T) => Tensor | Tensor[];\n let result: T;\n this.scopedRun(\n () => this.customGradientDepth++, () => this.customGradientDepth--,\n () => {\n const gradientsMode = true;\n result = this.tidy(f.name, () => {\n const {value, gradFunc} = f(...inputs);\n util.assert(\n value instanceof Tensor,\n 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(\n util.isFunction(gradFunc),\n 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n gradientsFunc = gradFunc;\n return value;\n }, gradientsMode);\n });\n\n if (this.shouldRecord()) {\n const gradFunc = (dy: T): Tensor[] => {\n const res = gradientsFunc(dy);\n const grads: Tensor[] = Array.isArray(res) ? res : [res];\n util.assert(\n grads.length === inputs.length,\n 'The function f passed in customGrad(f) must return an object ' +\n 'where `obj.gradFunc` is a function that returns the same ' +\n 'number of tensors as inputs passed to f(...).');\n util.assert(\n grads.every(t => t instanceof Tensor),\n 'The function f passed in customGrad(f) must return an object ' +\n 'where `obj.gradFunc` is a function that returns a list of ' +\n 'only tensors.');\n return grads;\n };\n this.addTapeNode(inputs, result, gradFunc);\n }\n return result;\n };\n }\n\n // Forwarding to backend.\n write(dataId: DataId, values: TypedArray): void {\n this.backend.write(dataId, values);\n }\n readSync(dataId: DataId): TypedArray {\n return this.backend.readSync(dataId);\n }\n read(dataId: DataId): Promise {\n return this.backend.read(dataId);\n }\n fromPixels(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels: number): Tensor3D {\n return this.backend.fromPixels(pixels, numChannels);\n }\n async time(query: () => void): Promise {\n const start = now();\n const timingInfo = await this.backend.time(query) as TimingInfo;\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n private track(result: T): T {\n if (this.scopeStack.length === 1 && this.safeMode) {\n throw new Error(\n 'Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' +\n 'tf.tidy(() => {op();...}); to avoid memory leaks.');\n }\n this.activeScope.track.push(result);\n return result;\n }\n}\n\nfunction ones(shape: number[]): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return Tensor.make(shape, {values});\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport interface Features {\n // Whether to enable debug mode.\n 'DEBUG'?: boolean;\n // Whether we are in a browser (as versus, say, node.js) environment.\n 'IS_BROWSER'?: boolean;\n // Whether we are in the Node.js environment.\n 'IS_NODE'?: boolean;\n // The disjoint_query_timer extension version.\n // 0: disabled, 1: EXT_disjoint_timer_query, 2:\n // EXT_disjoint_timer_query_webgl2.\n // In Firefox with WebGL 2.0,\n // EXT_disjoint_timer_query_webgl2 is not available, so we must use the\n // WebGL 1.0 extension.\n 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'?: number;\n // Whether the timer object from the disjoint_query_timer extension gives\n // timing information that is reliable.\n 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE'?: boolean;\n // 0: No WebGL, 1: WebGL 1.0, 2: WebGL 2.0.\n 'WEBGL_VERSION'?: number;\n // True if WebGL is supported.\n 'HAS_WEBGL'?: boolean;\n // Whether rendering to float32 textures is enabled. If disabled, renders to\n // float16 textures.\n 'WEBGL_RENDER_FLOAT32_ENABLED'?: boolean;\n // Whether downloading float textures is enabled. If disabled, uses IEEE 754\n // encoding of the float32 values to 4 uint8 when downloading.\n 'WEBGL_DOWNLOAD_FLOAT_ENABLED'?: boolean;\n // Whether the fence API is available.\n 'WEBGL_FENCE_API_ENABLED'?: boolean;\n 'BACKEND'?: string;\n // Test precision for unit tests. This is decreased when we can't render\n // float32 textures.\n 'TEST_EPSILON'?: number;\n 'IS_CHROME'?: boolean;\n // True if running unit tests.\n 'IS_TEST'?: boolean;\n}\n\nexport enum Type {\n NUMBER,\n BOOLEAN,\n STRING\n}\n\nexport const URL_PROPERTIES: URLProperty[] = [\n {name: 'DEBUG', type: Type.BOOLEAN}, {name: 'IS_BROWSER', type: Type.BOOLEAN},\n {name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION', type: Type.NUMBER},\n {name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE', type: Type.BOOLEAN},\n {name: 'WEBGL_VERSION', type: Type.NUMBER},\n {name: 'WEBGL_RENDER_FLOAT32_ENABLED', type: Type.BOOLEAN},\n {name: 'WEBGL_DOWNLOAD_FLOAT_ENABLED', type: Type.BOOLEAN},\n {name: 'WEBGL_FENCE_API_ENABLED', type: Type.BOOLEAN},\n {name: 'BACKEND', type: Type.STRING}\n];\n\nexport interface URLProperty {\n name: keyof Features;\n type: Type;\n}\n\nexport function isWebGLVersionEnabled(webGLVersion: 1|2, isBrowser: boolean) {\n let gl;\n try {\n gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n } catch (e) {\n return false;\n }\n\n if (gl != null) {\n loseContext(gl);\n return true;\n }\n return false;\n}\n\nexport function getWebGLDisjointQueryTimerVersion(\n webGLVersion: number, isBrowser: boolean): number {\n if (webGLVersion === 0) {\n return 0;\n }\n\n let queryTimerVersion: number;\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n if (hasExtension(gl, 'EXT_disjoint_timer_query_webgl2') &&\n webGLVersion === 2) {\n queryTimerVersion = 2;\n } else if (hasExtension(gl, 'EXT_disjoint_timer_query')) {\n queryTimerVersion = 1;\n } else {\n queryTimerVersion = 0;\n }\n\n if (gl != null) {\n loseContext(gl);\n }\n return queryTimerVersion;\n}\n\nexport function isRenderToFloatTextureEnabled(\n webGLVersion: number, isBrowser: boolean): boolean {\n if (webGLVersion === 0) {\n return false;\n }\n\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n if (webGLVersion === 1) {\n if (!hasExtension(gl, 'OES_texture_float')) {\n return false;\n }\n } else {\n if (!hasExtension(gl, 'EXT_color_buffer_float')) {\n return false;\n }\n }\n\n createFloatTextureAndBindToFramebuffer(gl, webGLVersion);\n\n const isFrameBufferComplete =\n gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;\n\n loseContext(gl);\n return isFrameBufferComplete;\n}\n\nexport function isDownloadFloatTextureEnabled(\n webGLVersion: number, isBrowser: boolean): boolean {\n if (webGLVersion === 0) {\n return false;\n }\n\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n if (webGLVersion === 1) {\n if (!hasExtension(gl, 'OES_texture_float')) {\n return false;\n }\n } else {\n if (!hasExtension(gl, 'EXT_color_buffer_float')) {\n return false;\n }\n }\n\n createFloatTextureAndBindToFramebuffer(gl, webGLVersion);\n gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, new Float32Array(4));\n\n const readPixelsNoError = gl.getError() === gl.NO_ERROR;\n\n loseContext(gl);\n\n return readPixelsNoError;\n}\n\nexport function isWebGLFenceEnabled(webGLVersion: number, isBrowser: boolean) {\n if (webGLVersion !== 2) {\n return false;\n }\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n // tslint:disable-next-line:no-any\n const isEnabled = (gl as any).fenceSync != null;\n loseContext(gl);\n return isEnabled;\n}\n\nexport function isChrome() {\n return typeof navigator !== 'undefined' && navigator != null &&\n navigator.userAgent != null && /Chrome/.test(navigator.userAgent) &&\n /Google Inc/.test(navigator.vendor);\n}\n\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\nexport function getFeaturesFromURL(): Features {\n const features: Features = {};\n\n if (typeof window === 'undefined' || typeof window.location === 'undefined') {\n return features;\n }\n\n const urlParams = getQueryParams(window.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const urlFlags: {[key: string]: string} = {};\n\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':') as [string, string];\n urlFlags[key] = value;\n });\n\n URL_PROPERTIES.forEach(urlProperty => {\n if (urlProperty.name in urlFlags) {\n console.log(\n `Setting feature override from URL ${urlProperty.name}: ` +\n `${urlFlags[urlProperty.name]}`);\n if (urlProperty.type === Type.NUMBER) {\n features[urlProperty.name] = +urlFlags[urlProperty.name];\n } else if (urlProperty.type === Type.BOOLEAN) {\n features[urlProperty.name] = urlFlags[urlProperty.name] === 'true';\n } else if (urlProperty.type === Type.STRING) {\n // tslint:disable-next-line:no-any\n features[urlProperty.name] = urlFlags[urlProperty.name] as any;\n } else {\n console.warn(`Unknown URL param: ${urlProperty.name}.`);\n }\n }\n });\n }\n\n return features;\n}\n\nfunction hasExtension(gl: WebGLRenderingContext, extensionName: string) {\n const ext = gl.getExtension(extensionName);\n return ext != null;\n}\n\nfunction getWebGLRenderingContext(\n webGLVersion: number, isBrowser: boolean): WebGLRenderingContext {\n if (webGLVersion === 0 || !isBrowser) {\n throw new Error('Cannot get WebGL rendering context, WebGL is disabled.');\n }\n\n const tempCanvas = document.createElement('canvas');\n\n if (webGLVersion === 1) {\n return (tempCanvas.getContext('webgl') ||\n tempCanvas.getContext('experimental-webgl')) as\n WebGLRenderingContext;\n }\n return tempCanvas.getContext('webgl2') as WebGLRenderingContext;\n}\n\nfunction loseContext(gl: WebGLRenderingContext) {\n if (gl != null) {\n const loseContextExtension = gl.getExtension('WEBGL_lose_context');\n if (loseContextExtension == null) {\n throw new Error(\n 'Extension WEBGL_lose_context not supported on this browser.');\n }\n loseContextExtension.loseContext();\n }\n}\n\nfunction createFloatTextureAndBindToFramebuffer(\n gl: WebGLRenderingContext, webGLVersion: number) {\n const frameBuffer = gl.createFramebuffer();\n const texture = gl.createTexture();\n\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // tslint:disable-next-line:no-any\n const internalFormat = webGLVersion === 2 ? (gl as any).RGBA32F : gl.RGBA;\n gl.texImage2D(\n gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n}\n\nexport function getQueryParams(queryString: string): {[key: string]: string} {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\n\nfunction decodeParam(\n params: {[key: string]: string}, name: string, value?: string) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as device_util from './device_util';\nimport {Engine, MemoryInfo, ScopeFn, TimingInfo} from './engine';\nimport {Features, getFeaturesFromURL, getWebGLDisjointQueryTimerVersion, isChrome, isDownloadFloatTextureEnabled, isRenderToFloatTextureEnabled, isWebGLFenceEnabled, isWebGLVersionEnabled} from './environment_util';\nimport {KernelBackend} from './kernels/backend';\nimport {setTensorTracker, Tensor, TensorTracker} from './tensor';\nimport {TensorContainer} from './tensor_types';\nimport {getTensorsInContainer} from './tensor_util';\n\nconst TEST_EPSILON_FLOAT32_ENABLED = 1e-3;\nconst TEST_EPSILON_FLOAT32_DISABLED = 1e-1;\n\nexport class Environment {\n private features: Features = {};\n private globalEngine: Engine;\n private registry:\n {[id: string]: {backend: KernelBackend, priority: number}} = {};\n backendName: string;\n backend: KernelBackend;\n\n constructor(features?: Features) {\n if (features != null) {\n this.features = features;\n }\n\n if (this.get('DEBUG')) {\n console.warn(\n 'Debugging mode is ON. The output of every math call will ' +\n 'be downloaded to CPU and checked for NaNs. ' +\n 'This significantly impacts performance.');\n }\n }\n\n /**\n * Sets the backend (cpu, webgl, etc) responsible for creating tensors and\n * executing operations on those tensors.\n *\n * Note this disposes the current backend, if any, as well as any tensors\n * associated with it. A new backend is initialized, even if it is of the\n * same type as the previous one.\n *\n * @param backendName The name of the backend. Currently supports\n * `'webgl'|'cpu'` in the browser, and `'tensorflow'` under node.js\n * (requires tfjs-node).\n * @param safeMode Defaults to false. In safe mode, you are forced to\n * construct tensors and call math operations inside a `tidy()` which\n * will automatically clean up intermediate tensors.\n */\n /** @doc {heading: 'Environment'} */\n static setBackend(backendName: string, safeMode = false) {\n if (!(backendName in ENV.registry)) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n ENV.initBackend(backendName, safeMode);\n }\n\n /**\n * Returns the current backend name (cpu, webgl, etc). The backend is\n * responsible for creating tensors and executing operations on those tensors.\n */\n /** @doc {heading: 'Environment'} */\n static getBackend(): string {\n ENV.initDefaultBackend();\n return ENV.backendName;\n }\n\n /**\n * Dispose all variables kept in backend engine.\n */\n /** @doc {heading: 'Environment'} */\n static disposeVariables(): void {\n ENV.engine.disposeVariables();\n }\n\n /**\n * Returns memory info at the current time in the program. The result is an\n * object with the following properties:\n *\n * - `numBytes`: Number of bytes allocated (undisposed) at this time.\n * - `numTensors`: Number of unique tensors allocated.\n * - `numDataBuffers`: Number of unique data buffers allocated\n * (undisposed) at this time, which is ≤ the number of tensors\n * (e.g. `a.reshape(newShape)` makes a new Tensor that shares the same\n * data buffer with `a`).\n * - `unreliable`: `Optional` `boolean`:\n * - On WebGL, not present (always reliable).\n * - On CPU, true. Due to automatic garbage collection, these numbers\n * represent undisposed tensors, i.e. not wrapped in `tidy()`, or\n * lacking a call to `tensor.dispose()`.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static memory(): MemoryInfo {\n return ENV.engine.memory();\n }\n\n /**\n * Executes the provided function `fn` and after it is executed, cleans up all\n * intermediate tensors allocated by `fn` except those returned by `fn`.\n * `f` must not return a Promise (async functions not allowed).\n * The returned result can be a complex object, however tidy only walks the\n * top-level properties (depth 1) of that object to search for tensors, or\n * lists of tensors that need to be tracked in the parent scope.\n *\n * Using this method helps avoid memory leaks. In general, wrap calls to\n * operations in `tidy` for automatic memory cleanup.\n *\n * When in safe mode, you must enclose all `Tensor` creation and ops\n * inside a `tidy` to prevent memory leaks.\n *\n * ```js\n * // y = 2 ^ 2 + 1\n * const y = tf.tidy(() => {\n * // a, b, and one will be cleaned up when the tidy ends.\n * const one = tf.scalar(1);\n * const a = tf.scalar(2);\n * const b = a.square();\n *\n * console.log('numTensors (in tidy): ' + tf.memory().numTensors);\n *\n * // The value returned inside the tidy function will return\n * // through the tidy, in this case to the variable y.\n * return b.add(one);\n * });\n *\n * console.log('numTensors (outside tidy): ' + tf.memory().numTensors);\n * y.print();\n * ```\n *\n * @param nameOrFn The name of the closure, or the function to execute.\n * If a name is provided, the 2nd argument should be the function.\n * If debug mode is on, the timing and the memory usage of the function\n * will be tracked and displayed on the console using the provided name.\n * @param fn The function to execute.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static tidy(\n nameOrFn: string|ScopeFn, fn?: ScopeFn, gradMode = false): T {\n return ENV.engine.tidy(nameOrFn, fn, gradMode);\n }\n\n /**\n * Disposes any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. If the\n * object is not a `Tensor` or does not contain `Tensors`, nothing\n * happens. In general it is safe to pass any object here, except that\n * `Promise`s are not supported.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static dispose(container: TensorContainer) {\n const tensors = getTensorsInContainer(container);\n tensors.forEach(tensor => tensor.dispose());\n }\n\n /**\n * Keeps a `Tensor` generated inside a `tidy` from being disposed\n * automatically.\n *\n * ```js\n * let b;\n * const y = tf.tidy(() => {\n * const one = tf.scalar(1);\n * const a = tf.scalar(2);\n *\n * // b will not be cleaned up by the tidy. a and one will be cleaned up\n * // when the tidy ends.\n * b = tf.keep(a.square());\n *\n * console.log('numTensors (in tidy): ' + tf.memory().numTensors);\n *\n * // The value returned inside the tidy function will return\n * // through the tidy, in this case to the variable y.\n * return b.add(one);\n * });\n *\n * console.log('numTensors (outside tidy): ' + tf.memory().numTensors);\n * console.log('y:');\n * y.print();\n * console.log('b:');\n * b.print();\n * ```\n *\n * @param result The tensor to keep from being disposed.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static keep(result: T): T {\n return ENV.engine.keep(result);\n }\n\n /**\n * Executes `f()` and returns a promise that resolves with timing\n * information.\n *\n * The result is an object with the following properties:\n *\n * - `wallMs`: Wall execution time.\n * - `kernelMs`: Kernel execution time, ignoring data transfer.\n * - On `WebGL` The following additional properties exist:\n * - `uploadWaitMs`: CPU blocking time on texture uploads.\n * - `downloadWaitMs`: CPU blocking time on texture downloads (readPixels).\n *\n * ```js\n * const x = tf.randomNormal([20, 20]);\n * const time = await tf.time(() => x.matMul(x));\n *\n * console.log(`kernelMs: ${time.kernelMs}, wallTimeMs: ${time.wallMs}`);\n * ```\n *\n * @param f The function to execute and time.\n */\n /** @doc {heading: 'Performance', subheading: 'Timing'} */\n static time(f: () => void): Promise {\n return ENV.engine.time(f);\n }\n\n get(feature: K): Features[K] {\n if (feature in this.features) {\n return this.features[feature];\n }\n\n this.features[feature] = this.evaluateFeature(feature);\n\n return this.features[feature];\n }\n\n getFeatures(): Features {\n return this.features;\n }\n\n set(feature: K, value: Features[K]): void {\n this.features[feature] = value;\n }\n\n private getBestBackendName(): string {\n if (Object.keys(this.registry).length === 0) {\n throw new Error('No backend found in registry.');\n }\n const sortedBackends = Object.keys(this.registry)\n .map(name => {\n return {name, entry: this.registry[name]};\n })\n .sort((a, b) => {\n // Highest priority comes first.\n return b.entry.priority - a.entry.priority;\n });\n return sortedBackends[0].name;\n }\n\n private evaluateFeature(feature: K): Features[K] {\n if (feature === 'DEBUG') {\n return false;\n } else if (feature === 'IS_BROWSER') {\n return typeof window !== 'undefined';\n } else if (feature === 'IS_NODE') {\n return (typeof process !== 'undefined') &&\n (typeof process.versions.node !== 'undefined');\n } else if (feature === 'IS_CHROME') {\n return isChrome();\n } else if (feature === 'IS_TEST') {\n return false;\n } else if (feature === 'BACKEND') {\n return this.getBestBackendName();\n } else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') {\n const webGLVersion = this.get('WEBGL_VERSION');\n\n if (webGLVersion === 0) {\n return 0;\n }\n // Remove this and reenable this extension when the\n // EXT_disjoint_query_timer extension is reenabled in chrome.\n // https://github.com/tensorflow/tfjs/issues/544\n if (webGLVersion > 0) {\n return 0;\n }\n return getWebGLDisjointQueryTimerVersion(\n webGLVersion, this.get('IS_BROWSER'));\n } else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE') {\n return this.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0 &&\n !device_util.isMobile();\n } else if (feature === 'HAS_WEBGL') {\n return this.get('WEBGL_VERSION') > 0;\n } else if (feature === 'WEBGL_VERSION') {\n if (isWebGLVersionEnabled(2, this.get('IS_BROWSER'))) {\n return 2;\n } else if (isWebGLVersionEnabled(1, this.get('IS_BROWSER'))) {\n return 1;\n }\n return 0;\n } else if (feature === 'WEBGL_RENDER_FLOAT32_ENABLED') {\n return isRenderToFloatTextureEnabled(\n this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));\n } else if (feature === 'WEBGL_DOWNLOAD_FLOAT_ENABLED') {\n return isDownloadFloatTextureEnabled(\n this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));\n } else if (feature === 'WEBGL_FENCE_API_ENABLED') {\n return isWebGLFenceEnabled(\n this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));\n } else if (feature === 'TEST_EPSILON') {\n if (this.get('WEBGL_RENDER_FLOAT32_ENABLED')) {\n return TEST_EPSILON_FLOAT32_ENABLED;\n }\n return TEST_EPSILON_FLOAT32_DISABLED;\n }\n throw new Error(`Unknown feature ${feature}.`);\n }\n\n setFeatures(features: Features) {\n this.features = Object.assign({}, features);\n }\n\n reset() {\n this.features = getFeaturesFromURL();\n if (this.globalEngine != null) {\n this.globalEngine = null;\n }\n }\n\n private initBackend(backendName?: string, safeMode = false) {\n this.backendName = backendName;\n this.backend = this.findBackend(backendName);\n this.globalEngine =\n new Engine(this.backend, safeMode, () => this.get('DEBUG'));\n }\n\n findBackend(name: string): KernelBackend {\n if (!(name in this.registry)) {\n return null;\n }\n return this.registry[name].backend;\n }\n\n /**\n * Registers a global backend. The registration should happen when importing\n * a module file (e.g. when importing `backend_webgl.ts`), and is used for\n * modular builds (e.g. custom tfjs bundle with only webgl support).\n *\n * @param factory: The backend factory function. When called, it should\n * return an instance of the backend.\n * @param priority The priority of the backend (higher = more important).\n * In case multiple backends are registered, the priority is used to find\n * the best backend. Defaults to 1.\n * @return False if the creation/registration failed. True otherwise.\n */\n registerBackend(\n name: string, factory: () => KernelBackend, priority = 1,\n setTensorTrackerFn?: (f: () => TensorTracker) => void): boolean {\n if (name in this.registry) {\n console.warn(\n `${name} backend was already registered. Reusing existing backend`);\n if (setTensorTrackerFn != null) {\n setTensorTrackerFn(() => this.engine);\n }\n return false;\n }\n try {\n const backend = factory();\n this.registry[name] = {backend, priority};\n return true;\n } catch (err) {\n console.warn(`Registration of backend ${name} failed`);\n console.warn(err.stack || err.message);\n return false;\n }\n }\n\n removeBackend(name: string): void {\n if (!(name in this.registry)) {\n throw new Error(`${name} backend not found in registry`);\n }\n this.registry[name].backend.dispose();\n delete this.registry[name];\n }\n\n get engine(): Engine {\n this.initDefaultBackend();\n return this.globalEngine;\n }\n\n private initDefaultBackend() {\n if (this.globalEngine == null) {\n this.initBackend(this.get('BACKEND'), false /* safeMode */);\n }\n }\n}\n\nfunction getGlobalNamespace(): {ENV: Environment} {\n // tslint:disable-next-line:no-any\n let ns: any;\n if (typeof (window) !== 'undefined') {\n ns = window;\n } else if (typeof (process) !== 'undefined') {\n ns = process;\n } else {\n throw new Error('Could not find a global object');\n }\n return ns;\n}\n\nfunction getOrMakeEnvironment(): Environment {\n const ns = getGlobalNamespace();\n if (ns.ENV == null) {\n ns.ENV = new Environment(getFeaturesFromURL());\n setTensorTracker(() => ns.ENV.engine);\n }\n return ns.ENV;\n}\n\nexport let ENV = getOrMakeEnvironment();\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from './environment';\n\nexport function warn(...msg: Array<{}>): void {\n if (!ENV.get('IS_TEST')) {\n console.warn(...msg);\n }\n}\n\nexport function log(...msg: Array<{}>): void {\n if (!ENV.get('IS_TEST')) {\n console.log(...msg);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Gets the new shape of the input Tensor after it's been reshaped\n * to :\n * [blockShape[0], ..., blockShape[M-1], batch / prod(blockShape),\n * inputShape[1], ..., inputShape[N-1]]\n *\n * See step 1: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getReshaped(\n inputShape: number[], blockShape: number[], prod: number,\n batchToSpace = true): number[] {\n let reshaped: number[] = [];\n if (batchToSpace) {\n reshaped = reshaped.concat(blockShape.slice(0));\n reshaped.push(inputShape[0] / prod);\n reshaped = reshaped.concat(inputShape.slice(1));\n } else {\n reshaped = reshaped.concat(inputShape[0]);\n const spatialLength = blockShape.length;\n for (let i = 0; i < spatialLength; ++i) {\n reshaped =\n reshaped.concat([inputShape[i + 1] / blockShape[i], blockShape[i]]);\n }\n reshaped = reshaped.concat(inputShape.slice(spatialLength + 1));\n }\n return reshaped;\n}\n\n/**\n * Gets the permutation that will transpose the dimensions of the\n * reshaped tensor to shape:\n *\n * [batch / prod(block_shape),inputShape[1], blockShape[0], ...,\n * inputShape[M], blockShape[M-1],inputShape[M+1], ..., inputShape[N-1]]\n *\n * see step 2: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getPermuted(\n reshapedRank: number, blockShapeRank: number,\n batchToSpace = true): number[] {\n const permuted = [];\n if (batchToSpace) {\n permuted.push(blockShapeRank);\n for (let i = blockShapeRank + 1; i < reshapedRank; ++i) {\n if (i <= 2 * blockShapeRank) {\n permuted.push(i);\n permuted.push(i - (blockShapeRank + 1));\n } else {\n permuted.push(i);\n }\n }\n } else {\n const permutedBeforeBatch = [];\n const permutedAfterBatch = [];\n for (let i = 1; i < reshapedRank; ++i) {\n if (i >= blockShapeRank * 2 + 1 || i % 2 === 1) {\n permutedAfterBatch.push(i);\n } else {\n permutedBeforeBatch.push(i);\n }\n }\n permuted.push(...permutedBeforeBatch);\n permuted.push(0);\n permuted.push(...permutedAfterBatch);\n }\n return permuted;\n}\n\n/**\n * Gets the shape of the reshaped and permuted input Tensor before any cropping\n * is applied. The new shape will be:\n *\n * [batch / prod(blockShape),inputShape[1] * blockShape[0], ...,\n * inputShape[M] * blockShape[M-1],inputShape[M+1], ..., inputShape[N-1]]\n *\n * See step 3: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getReshapedPermuted(\n inputShape: number[], blockShape: number[], prod: number,\n batchToSpace = true): number[] {\n const reshapedPermuted = [];\n\n if (batchToSpace) {\n reshapedPermuted.push(inputShape[0] / prod);\n } else {\n reshapedPermuted.push(inputShape[0] * prod);\n }\n\n for (let i = 1; i < inputShape.length; ++i) {\n if (i <= blockShape.length) {\n if (batchToSpace) {\n reshapedPermuted.push(blockShape[i - 1] * inputShape[i]);\n } else {\n reshapedPermuted.push(inputShape[i] / blockShape[i - 1]);\n }\n } else {\n reshapedPermuted.push(inputShape[i]);\n }\n }\n\n return reshapedPermuted;\n}\n\n/**\n * Converts the crops argument into the beginning coordinates of a slice\n * operation\n */\nexport function getSliceBeginCoords(\n crops: number[][], blockShape: number): number[] {\n const sliceBeginCoords = [0];\n for (let i = 0; i < blockShape; ++i) {\n sliceBeginCoords.push(crops[i][0]);\n }\n return sliceBeginCoords;\n}\n\n/**\n * converts the crops argument into the size of a slice operation. When\n * combined with getSliceBeginCoords this function allows the reshaped and\n * permuted Tensor to be cropped to its final output shape of:\n *\n * inputShape[1] * blockShape[0] - crops[0,0] - crops[0,1], ...,\n * inputShape[M] * blockShape[M-1] -crops[M-1,0] -\n * crops[M-1,1],inputShape[M+1], ..., inputShape[N-1]]\n *\n * See step 4: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getSliceSize(\n uncroppedShape: number[], crops: number[][], blockShape: number): number[] {\n const sliceSize = uncroppedShape.slice(0, 1);\n for (let i = 0; i < blockShape; ++i) {\n sliceSize.push(uncroppedShape[i + 1] - crops[i][0] - crops[i][1]);\n }\n\n return sliceSize;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as util from '../util';\n\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes: number[], rank: number): boolean {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\n\nexport function combineLocations(\n outputLoc: number[], reduceLoc: number[], axes: number[]): number[] {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n   for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n } else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\n\nexport function computeOutAndReduceShapes(\n aShape: number[], axes: number[]): [number[], number[]] {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\n\nexport function expandShapeToKeepDim(\n shape: number[], axes: number[]): number[] {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\n\nexport function parseAxisParam(\n axis: number|number[], shape: number[]): number[] {\n const rank = shape.length;\n\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n\n // Check for valid range\n util.assert(\n axis.every(ax => ax >= -rank && ax < rank),\n `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n\n // Check for only integers\n util.assert(\n axis.every(ax => util.isInt(ax)),\n `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n\nexport function assertAxesAreInnerMostDims(\n msg: string, axes: number[], rank: number): void {\n util.assert(\n axesAreInnerMostDims(axes, rank),\n `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is neccesary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes: number[], rank: number): number[]|\n null {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result: number[] = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes: number[]): number[] {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\n\nexport function getInnerMostAxes(numAxes: number, rank: number): number[] {\n const res: number[] = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Inputs of size above this threshold will be parallelized by calling multiple\n * shader programs.\n */\nimport {nearestDivisor} from '../util';\n\nexport const PARALLELIZE_THRESHOLD = 30;\n\nexport interface ReduceInfo {\n windowSize: number;\n batchSize: number;\n inSize: number;\n}\n\nexport function computeOptimalWindowSize(inSize: number): number {\n if (inSize <= PARALLELIZE_THRESHOLD) {\n return inSize;\n }\n return nearestDivisor(inSize, Math.floor(Math.sqrt(inSize)));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {nearestDivisor} from '../util';\nimport {PARALLELIZE_THRESHOLD} from './reduce_util';\n\nexport interface SegOpInfo {\n windowSize: number;\n batchSize: number;\n inSize: number;\n numSegments: number;\n}\n\nexport function segOpComputeOptimalWindowSize(\n inSize: number, numSegments: number): number {\n let done = false;\n let res;\n\n if (inSize <= PARALLELIZE_THRESHOLD) {\n res = inSize;\n done = true;\n } else {\n res = nearestDivisor(inSize, Math.floor(Math.sqrt(inSize)));\n }\n\n while (!done) {\n if (res > numSegments || res === inSize) {\n done = true;\n break;\n } else {\n res = nearestDivisor(inSize, res + 1);\n }\n }\n return res;\n}\n\nexport function computeOutShape(\n aShape: number[], axis: number, numSegments: number): number[] {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (dim !== axis) {\n outShape.push(aShape[dim]);\n } else {\n outShape.push(numSegments);\n }\n }\n return outShape;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport * as util from '../util';\n\nexport function assertParamsValid(\n input: Tensor, begin: number[], size: number[]): void {\n util.assert(\n input.rank === begin.length,\n `Error in slice${input.rank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${input.rank}).`);\n util.assert(\n input.rank === size.length,\n `Error in slice${input.rank}D: Length of size ${size} must ` +\n `match the rank of the array (${input.rank}).`);\n\n for (let i = 0; i < input.rank; ++i) {\n util.assert(\n begin[i] + size[i] <= input.shape[i],\n `Error in slice${input.rank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${\n input.shape[i]})`);\n }\n}\n\n/**\n * Calculate the start index and output tensor shape for strided slice op.\n */\nexport function getStridedSlicedInfo(\n shape: number[], begin: number[], end: number[], strides: number[],\n beginMask = 0, endMask = 0): [number[], number[]] {\n // Note that the axis orders are reversed for runtime ops, so the indices,\n // strides and masks must be as well too.\n const startIndex: number[] = [];\n const endIndex: number[] = [];\n for (let i = 0; i < shape.length; i++) {\n startIndex[i] = startForAxis(beginMask, begin, strides, shape, i);\n endIndex[i] = stopForAxis(endMask, end, strides, shape, i);\n }\n\n let size = new Array(shape.length).fill(0);\n size = size.map((d, i) => {\n let count = 0;\n for (let start = startIndex[i];\n !(strides[i] > 0 ? start >= endIndex[i] : start <= endIndex[i]);\n start += strides[i]) {\n count += 1;\n }\n return count;\n });\n return [startIndex, size];\n}\n\nexport function startForAxis(\n beginMask: number, startIndices: number[], strides: number[],\n inputShape: number[], axis: number): number {\n // Begin with the specified index\n let start = startIndices[axis];\n\n // Check the axis bit from right of beginMask\n if (beginMask & 1 << axis) {\n if (strides[axis] > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n } else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n\n return start;\n}\n\nexport function stopForAxis(\n endMask: number, stopIndices: number[], strides: number[],\n inputShape: number[], axis: number): number {\n // Begin with the specified index\n let stop = stopIndices[axis];\n\n // Check the axis bit from right of endMask\n if (endMask & (1 << axis)) {\n if (strides[axis] > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n } else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (strides[axis] > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n } else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n\n return stop;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {CustomGradientFunc, ScopeFn} from './engine';\nimport {ENV} from './environment';\nimport {Scalar, Tensor, Variable} from './tensor';\nimport {NamedTensorMap, TensorContainer} from './tensor_types';\nimport * as util from './util';\n\n/**\n * Create a new gradient scope. Similar to scope, but forces all inner scopes\n * to not clean up so that gradient operations can be used inside of this\n * scope.\n * @param nameOrScopeFn The name of the scope, or the function to execute.\n * If a name is provided, the 2nd argument should be the function.\n * If a name is provided, and debug mode is on, the timing and the memory\n * usage of the function will be tracked and displayed on the console\n * using the provided name.\n * @param scopeFn The function to execute.\n */\nfunction gradScope(\n nameOrScopeFn: string|ScopeFn, scopeFn?: ScopeFn): T {\n return ENV.engine.tidy(nameOrScopeFn, scopeFn, true /* gradScope */);\n}\n\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction grad(f: (x: I) => O): (\n x: I, dy?: O) => I {\n util.assert(util.isFunction(f), 'The f passed in grad(f) must be a function');\n return (x: I, dy?: O): I => {\n util.assert(\n x instanceof Tensor, 'The x passed in grad(f)(x) must be a tensor');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in grad(f)(x, dy) must be a tensor');\n return ENV.engine.tidy(() => {\n const {value, grads} = ENV.engine.gradients(() => f(x), [x], dy);\n if (dy != null) {\n util.assertShapesMatch(\n value.shape, dy.shape,\n 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0] as I;\n });\n };\n}\n\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction grads(f: (...args: Tensor[]) => O): (\n args: Tensor[], dy?: O) => Tensor[] {\n util.assert(\n util.isFunction(f), 'The f passed in grads(f) must be a function');\n return (args: Tensor[], dy?: O): Tensor[] => {\n util.assert(\n Array.isArray(args) && args.every(arg => arg instanceof Tensor),\n 'The args passed in grads(f)(args) must be an array of tensors');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in grads(f)(args, dy) must be a tensor');\n return ENV.engine.tidy(() => {\n const {value, grads} = ENV.engine.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(\n value.shape, dy.shape,\n 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n\n/**\n * Like `grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction valueAndGrad(f: (x: I) => O): (\n x: I, dy?: O) => {\n value: O;\n grad: I;\n} {\n util.assert(\n util.isFunction(f), 'The f passed in valueAndGrad(f) must be a function');\n return (x: I, dy?: O) => {\n util.assert(\n x instanceof Tensor,\n 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const {grads, value} = ENV.engine.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return {grad: grads[0] as I, value: value as O};\n };\n}\n\n/**\n * Like `grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction valueAndGrads(f: (...args: Tensor[]) => O): (\n args: Tensor[], dy?: O) => {\n grads: Tensor[];\n value: O;\n} {\n util.assert(\n util.isFunction(f),\n 'The f passed in valueAndGrads(f) must be a function');\n return (args: Tensor[], dy?: O) => {\n util.assert(\n Array.isArray(args) && args.every(arg => arg instanceof Tensor),\n 'The args passed in valueAndGrads(f)(args) must be array of tensors');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENV.engine.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(\n res.value.shape, dy.shape,\n 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of trainable variables. Defaults to all variables.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction variableGrads(f: () => Scalar, varList?: Variable[]):\n {value: Scalar, grads: NamedTensorMap} {\n util.assert(\n util.isFunction(f),\n 'The f passed in variableGrads(f) must be a function');\n util.assert(\n varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable),\n 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n if (varList == null) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENV.engine.registeredVariables) {\n varList.push(ENV.engine.registeredVariables[varName]);\n }\n }\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(\n varList.length > 0,\n `variableGrads() expects at least one of the input variables to be ` +\n `trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n\n const allowNoGradients = true;\n const {value, grads} =\n ENV.engine.gradients(f, varList, null, allowNoGradients);\n\n util.assert(\n grads.some(g => g != null),\n 'Cannot find a connection between any variable and the result of the ' +\n 'loss function y=f(x). Please make sure the operations that use ' +\n 'variables are inside the function f passed to minimize().');\n util.assert(\n value.rank === 0,\n `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n\n const namedGrads: NamedTensorMap = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n return {value, grads: namedGrads};\n}\n\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs) => {value: Tensor, gradFunc: dy => Tensor[]}` and returns\n * another function `g(...inputs)` which takes the same inputs as `f`. When\n * called, `g` returns `f().value`. In backward mode, custom gradients with\n * respect to each input of `f` are computed using `f().gradFunc`.\n *\n * ```js\n * const customOp = tf.customGrad(x => {\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {value: x.square(), gradFunc: dy => [dy.mul(x.abs())]};\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy) => Tensor[]}`, where `gradFunc` returns\n * the custom gradients of `f` with respect to its inputs.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction customGrad(f: CustomGradientFunc):\n (...args: Tensor[]) => T {\n return ENV.engine.customGrad(f);\n}\n\nfunction checkGrads(grads: Tensor[]) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(\n `Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\n\nexport {\n gradScope,\n customGrad,\n variableGrads,\n valueAndGrad,\n valueAndGrads,\n grad,\n grads,\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from './environment';\nimport {Tensor} from './tensor';\nimport {ArrayData, DataType, TensorLike} from './types';\nimport {inferShape, isTypedArray, toTypedArray} from './util';\n\nexport function convertToTensor(\n x: T|TensorLike, argName: string, functionName: string,\n dtype: DataType = 'float32'): T {\n dtype = dtype || 'float32';\n if (x instanceof Tensor) {\n return x;\n }\n if (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean') {\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got ${x.constructor.name}`);\n }\n const inferredShape = inferShape(x);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x] as number[];\n }\n return Tensor.make(\n inferredShape,\n {values: toTypedArray(x as ArrayData, dtype, ENV.get('DEBUG'))},\n dtype);\n}\n\nexport function convertToTensorArray(\n arg: T[]|TensorLike[], argName: string, functionName: string): T[] {\n if (!Array.isArray(arg)) {\n throw new Error(\n `Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg as T[];\n return tensors.map(\n (t, i) => convertToTensor(t, `${argName}[${i}]`, functionName));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\n\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f: {[name: string]: T}): T {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(\n `Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n\n let opName = keys[0];\n const fn = f[opName];\n\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n\n // tslint:disable-next-line:no-any\n const f2 = (...args: any[]) => {\n ENV.engine.startScope(opName);\n try {\n const result = fn(...args);\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENV.engine.endScope(result);\n return result;\n } catch (ex) {\n ENV.engine.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', {value: opName, configurable: true});\n\n // tslint:disable-next-line:no-any\n return f2 as any as T;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {customGrad} from '../gradients';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction softmax_(logits: T|TensorLike, dim = -1): T {\n const $logits = convertToTensor(logits, 'logits', 'softmax');\n\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error(\n 'Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n\n const customOp = customGrad(logits => {\n // Do it in log space for numerical stability.\n // exp(X - logSumExp(X))\n const keepDims = true;\n const lse = logits.logSumExp([dim], keepDims);\n const logResult = logits.toFloat().sub(lse);\n const y = logResult.exp() as T;\n\n const gradFunc = (dy: T) => {\n const dyTimesY = dy.mul(y);\n const keepDims = true;\n return dyTimesY.sub(dyTimesY.sum([dim], keepDims).mul(y));\n };\n\n return {value: y, gradFunc};\n });\n\n return customOp($logits);\n}\n\nexport const softmax = op({softmax_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, Tensor6D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike, TensorLike1D, TensorLike2D, TensorLike3D, TensorLike4D, TensorLike5D, TensorLike6D} from '../types';\nimport {ArrayData, DataType, Rank, ShapeMap} from '../types';\nimport {assertNonNull, assertShapesMatch, getTypedArrayFromDType, inferShape, isTypedArray, makeOnesTypedArray, makeZerosTypedArray, sizeFromShape, toTypedArray} from '../util';\nimport {op} from './operation';\n\n/**\n * Creates a `Tensor` with the provided values, shape and dtype.\n *\n * ```js\n * // Pass an array of values to create a vector.\n * tf.tensor([1, 2, 3, 4]).print();\n * ```\n *\n * ```js\n * // Pass a nested array of values to make a matrix or a higher\n * // dimensional tensor.\n * tf.tensor([[1, 2], [3, 4]]).print();\n * ```\n *\n * ```js\n * // Pass a flat array and specify a shape yourself.\n * tf.tensor([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor(\n values: TensorLike, shape?: ShapeMap[R],\n dtype: DataType = 'float32'): Tensor {\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean') {\n throw new Error(\n 'values passed to tensor(values) must be an ' +\n 'array of numbers or booleans, or a TypedArray');\n }\n const inferredShape = inferShape(values);\n if (shape != null && inferredShape.length !== 1) {\n assertShapesMatch(\n shape, inferredShape,\n `Error creating a new Tensor. ` +\n `Inferred shape (${inferredShape}) does not match the ` +\n `provided shape (${shape}). `);\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values] as number[];\n }\n shape = shape || inferredShape;\n return Tensor.make(\n shape, {\n values:\n toTypedArray(values as ArrayData, dtype, ENV.get('DEBUG'))\n },\n dtype);\n}\n\n/**\n * Creates rank-0 `Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction scalar(value: number|boolean, dtype: DataType = 'float32'): Scalar {\n if (isTypedArray(value) || Array.isArray(value)) {\n throw new Error(\n 'Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean)');\n }\n return tensor(value, [], dtype);\n}\n\n/**\n * Creates rank-1 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor1d` as it makes the code more readable.\n *\n * ```js\n * tf.tensor1d([1, 2, 3]).print();\n * ```\n *\n * @param values The values of the tensor. Can be array of numbers,\n * or a `TypedArray`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor1d(values: TensorLike1D, dtype: DataType = 'float32'): Tensor1D {\n assertNonNull(values);\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 1) {\n throw new Error('tensor1d() requires values to be a flat/TypedArray');\n }\n return tensor(values, inferredShape as [number], dtype);\n}\n\n/**\n * Creates rank-2 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor2d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor2d([[1, 2], [3, 4]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. If not provided, it is inferred from\n * `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor2d(\n values: TensorLike2D, shape?: [number, number],\n dtype: DataType = 'float32'): Tensor2D {\n assertNonNull(values);\n if (shape != null && shape.length !== 2) {\n throw new Error('tensor2d() requires shape to have two numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 2 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor2d() requires values to be number[][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor2d() requires shape to be provided when `values` ' +\n 'are a flat/TypedArray');\n }\n shape = shape || inferredShape as [number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-3 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor3d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor3d([[[1], [2]], [[3], [4]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor3d([1, 2, 3, 4], [2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. If not provided, it is inferred from\n * `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor3d(\n values: TensorLike3D, shape?: [number, number, number],\n dtype: DataType = 'float32'): Tensor3D {\n assertNonNull(values);\n if (shape != null && shape.length !== 3) {\n throw new Error('tensor3d() requires shape to have three numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 3 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor3d() requires values to be number[][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor3d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape || inferredShape as [number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-4 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor4d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor4d([[[[1], [2]], [[3], [4]]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor4d(\n values: TensorLike4D, shape?: [number, number, number, number],\n dtype: DataType = 'float32'): Tensor4D {\n assertNonNull(values);\n if (shape != null && shape.length !== 4) {\n throw new Error('tensor4d() requires shape to have four numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 4 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor4d() requires values to be number[][][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor4d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape || inferredShape as [number, number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-5 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor5d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor5d([[[[[1], [2]], [[3], [4]]]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor5d([1, 2, 3, 4, 5, 6, 7, 8], [1, 2, 2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor5d(\n values: TensorLike5D, shape?: [number, number, number, number, number],\n dtype: DataType = 'float32'): Tensor5D {\n assertNonNull(values);\n if (shape != null && shape.length !== 5) {\n throw new Error('tensor5d() requires shape to have five numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 5 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor5d() requires values to be ' +\n 'number[][][][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor5d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape || inferredShape as [number, number, number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-6 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor6d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor6d([[[[[[1],[2]],[[3],[4]]],[[[5],[6]],[[7],[8]]]]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor6d([1, 2, 3, 4, 5, 6, 7, 8], [1, 1, 2, 2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor6d(\n values: TensorLike6D,\n shape?: [number, number, number, number, number, number],\n dtype: DataType = 'float32'): Tensor6D {\n assertNonNull(values);\n if (shape != null && shape.length !== 6) {\n throw new Error('tensor6d() requires shape to have six numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 6 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor6d() requires values to be number[][][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor6d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape ||\n inferredShape as [number, number, number, number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates a `Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction ones(\n shape: ShapeMap[R], dtype: DataType = 'float32'): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction zeros(\n shape: ShapeMap[R], dtype: DataType = 'float32'): Tensor {\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` filled with a scalar value.\n *\n * ```js\n * tf.fill([2, 2], 4).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param value The scalar value to fill the tensor with.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction fill(\n shape: ShapeMap[R], value: number, dtype: DataType = 'float32'): Tensor {\n const values = getTypedArrayFromDType(dtype, sizeFromShape(shape));\n values.fill(value);\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction onesLike_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'onesLike');\n return ones($x.shape, $x.dtype) as T;\n}\n\n/**\n * Creates a `Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction zerosLike_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n return zeros($x.shape, $x.dtype) as T;\n}\n\n/**\n * Return an evenly spaced sequence of numbers over the given interval.\n *\n * ```js\n * tf.linspace(0, 9, 10).print();\n * ```\n * @param start The start value of the sequence.\n * @param stop The end value of the sequence.\n * @param num The number of values to generate.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction linspace(start: number, stop: number, num: number): Tensor1D {\n if (num === 0) {\n throw new Error('Cannot request zero samples');\n }\n\n const step = (stop - start) / (num - 1);\n\n const values = makeZerosTypedArray(num, 'float32');\n values[0] = start;\n for (let i = 1; i < values.length; i++) {\n values[i] = values[i - 1] + step;\n }\n\n return tensor1d(values, 'float32');\n}\n\n/**\n * Creates a new `Tensor1D` filled with the numbers in the range provided.\n *\n * The tensor is a is half-open interval meaning it includes start, but\n * excludes stop. Decrementing ranges and negative step values are also\n * supported.\n *\n * ```js\n * tf.range(0, 9, 2).print();\n * ```\n *\n * @param start An integer start value\n * @param stop An integer stop value\n * @param step An integer increment (will default to 1 or -1)\n * @param dtype The data type of the output tensor. Defaults to 'float32'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction range(\n start: number, stop: number, step = 1,\n dtype: 'float32'|'int32' = 'float32'): Tensor1D {\n if (step === 0) {\n throw new Error('Cannot have a step of zero');\n }\n\n const sameStartStop = start === stop;\n const increasingRangeNegativeStep = start < stop && step < 0;\n const decreasingRangePositiveStep = stop < start && step > 1;\n\n if (sameStartStop || increasingRangeNegativeStep ||\n decreasingRangePositiveStep) {\n return zeros([0], dtype);\n }\n\n const numElements = Math.abs(Math.ceil((stop - start) / step));\n const values = makeZerosTypedArray(numElements, dtype);\n\n if (stop < start && step === 1) {\n // Auto adjust the step's sign if it hasn't been set\n // (or was set to 1)\n step = -1;\n }\n\n values[0] = start;\n for (let i = 1; i < values.length; i++) {\n values[i] = values[i - 1] + step;\n }\n\n return tensor1d(values, dtype);\n}\n\nexport {\n fill,\n linspace,\n ones,\n range,\n scalar,\n tensor,\n tensor1d,\n tensor2d,\n tensor3d,\n tensor4d,\n tensor5d,\n tensor6d,\n zeros\n};\n\nexport const onesLike = op({onesLike_});\nexport const zerosLike = op({zerosLike_});\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport enum DType {\n float32 = 'float32',\n int32 = 'int32',\n bool = 'bool'\n}\n\n/** @docalias number[] */\nexport interface ShapeMap {\n R0: number[];\n R1: [number];\n R2: [number, number];\n R3: [number, number, number];\n R4: [number, number, number, number];\n R5: [number, number, number, number, number];\n R6: [number, number, number, number, number, number];\n}\n\n/** @hidden */\nexport interface DataTypeMap {\n float32: Float32Array;\n int32: Int32Array;\n bool: Uint8Array;\n}\n/** @docalias 'float32'|'int32'|'bool' */\nexport type DataType = keyof DataTypeMap;\nexport type TypedArray = DataTypeMap[DataType];\n\nexport enum Rank {\n R0 = 'R0',\n R1 = 'R1',\n R2 = 'R2',\n R3 = 'R3',\n R4 = 'R4',\n R5 = 'R5',\n R6 = 'R6'\n}\n\nexport type FlatVector = boolean[]|number[]|TypedArray;\nexport type RegularArray =\n T[]|T[][]|T[][][]|T[][][][]|T[][][][][]|T[][][][][][];\nexport type ArrayData =\n DataTypeMap[D]|RegularArray|RegularArray;\n\n// tslint:disable-next-line:no-any\nexport interface RecursiveArray {\n [index: number]: T|RecursiveArray;\n}\n\nenum UpcastInt32AndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'int32'\n}\n\nenum UpcastBoolAndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'bool'\n}\n\nenum UpcastFloat32AndMap {\n 'float32' = 'float32',\n 'int32' = 'float32',\n 'bool' = 'float32'\n}\n\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap\n};\n\nexport function upcastType(typeA: DataType, typeB: DataType): DataType {\n return upcastTypeMap[typeA][typeB];\n}\n\n/** Returns the output type after summation. */\nexport function sumOutType(type: DataType) {\n return upcastType(type, 'int32');\n}\n\n/** @docalias TypedArray|Array */\nexport type TensorLike =\n TypedArray|number|boolean|number[]|number[][]|number[][][]|number[][][][]|\n number[][][][][]|number[][][][][][]|boolean[]|boolean[][]|boolean[][][]|\n boolean[][][][]|boolean[][][][][]|boolean[][][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike1D = TypedArray|number[]|boolean[];\n/** @docalias TypedArray|Array */\nexport type TensorLike2D = TypedArray|number[]|number[][]|boolean[]|boolean[][];\n/** @docalias TypedArray|Array */\nexport type TensorLike3D =\n TypedArray|number[]|number[][][]|boolean[]|boolean[][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike4D =\n TypedArray|number[]|number[][][][]|boolean[]|boolean[][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike5D =\n TypedArray|number[]|number[][][][][]|boolean[]|boolean[][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike6D =\n TypedArray|number[]|number[][][][][][]|boolean[]|boolean[][][][][][];\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {scalar} from '../ops/tensor_ops';\nimport {Tensor} from '../tensor';\nimport {Rank} from '../types';\nimport {DataType, ShapeMap} from '../types';\nimport {hasEncodingLoss} from '../util';\nimport {KernelBackend} from './backend';\n\nexport function castTensor(\n x: T, dtype: DataType, backend: KernelBackend): T {\n if (!hasEncodingLoss(x.dtype, dtype)) {\n // We don't change the underlying data, since we cast to higher\n // precision.\n return Tensor.make(x.shape, {dataId: x.dataId}, dtype) as T;\n }\n if (dtype === 'int32') {\n return backend.int(x);\n } else if (dtype === 'bool') {\n return backend.notEqual(x, scalar(0, x.dtype)) as T;\n } else {\n throw new Error(`Error in Cast: unknown dtype argument (${dtype})`);\n }\n}\n\nexport function reshapeTensor(\n x: T, shape: ShapeMap[R]): Tensor {\n return Tensor.make(shape, {dataId: x.dataId}, x.dtype);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Implementation of the NonMaxSuppression kernel shared between webgl and cpu.\n */\n\nimport {tensor1d} from '../ops/tensor_ops';\nimport {Tensor1D} from '../tensor';\nimport {TypedArray} from '../types';\n\nexport function nonMaxSuppressionImpl(\n boxes: TypedArray, scores: TypedArray, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number): Tensor1D {\n const candidates = Array.from(scores)\n .map((score, boxIndex) => ({score, boxIndex}))\n .filter(c => c.score > scoreThreshold)\n .sort((c1, c2) => c2.score - c1.score);\n\n const selected: number[] = [];\n\n for (let i = 0; i < candidates.length; i++) {\n const {score, boxIndex} = candidates[i];\n if (score < scoreThreshold) {\n break;\n }\n\n let ignoreCandidate = false;\n for (let j = selected.length - 1; j >= 0; --j) {\n const iou = intersectionOverUnion(boxes, boxIndex, selected[j]);\n if (iou >= iouThreshold) {\n ignoreCandidate = true;\n break;\n }\n }\n\n if (!ignoreCandidate) {\n selected.push(boxIndex);\n if (selected.length >= maxOutputSize) {\n break;\n }\n }\n }\n\n return tensor1d(selected, 'int32');\n}\n\nfunction intersectionOverUnion(boxes: TypedArray, i: number, j: number) {\n const iCoord = boxes.subarray(i * 4, i * 4 + 4);\n const jCoord = boxes.subarray(j * 4, j * 4 + 4);\n const yminI = Math.min(iCoord[0], iCoord[2]);\n const xminI = Math.min(iCoord[1], iCoord[3]);\n const ymaxI = Math.max(iCoord[0], iCoord[2]);\n const xmaxI = Math.max(iCoord[1], iCoord[3]);\n const yminJ = Math.min(jCoord[0], jCoord[2]);\n const xminJ = Math.min(jCoord[1], jCoord[3]);\n const ymaxJ = Math.max(jCoord[0], jCoord[2]);\n const xmaxJ = Math.max(jCoord[1], jCoord[3]);\n const areaI = (ymaxI - yminI) * (xmaxI - xminI);\n const areaJ = (ymaxJ - yminJ) * (xmaxJ - xminJ);\n if (areaI <= 0 || areaJ <= 0) {\n return 0.0;\n }\n const intersectionYmin = Math.max(yminI, yminJ);\n const intersectionXmin = Math.max(xminI, xminJ);\n const intersectionYmax = Math.min(ymaxI, ymaxJ);\n const intersectionXmax = Math.min(xmaxI, xmaxJ);\n const intersectionArea = Math.max(intersectionYmax - intersectionYmin, 0.0) *\n Math.max(intersectionXmax - intersectionXmin, 0.0);\n return intersectionArea / (areaI + areaJ - intersectionArea);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** An implementation of the TopK kernel shared between webgl and cpu. */\n\nimport {tensor} from '../ops/tensor_ops';\nimport {Tensor} from '../tensor';\nimport {DataType, TypedArray} from '../types';\nimport {getTypedArrayFromDType} from '../util';\n\nexport function topkImpl(\n x: TypedArray, xShape: number[], xDtype: DataType, k: number,\n sorted: boolean): [T, T] {\n // Reshape into a 2d tensor [batch, lastDim] and compute topk along lastDim.\n const lastDim = xShape[xShape.length - 1];\n const [batch, size] = [x.length / lastDim, lastDim];\n const allTopKVals = getTypedArrayFromDType(xDtype, batch * k);\n const allTopKIndices = getTypedArrayFromDType('int32', batch * k);\n\n for (let b = 0; b < batch; b++) {\n const offset = b * size;\n const vals = x.subarray(offset, offset + size);\n const valAndInd: Array<{value: number, index: number}> = [];\n for (let i = 0; i < vals.length; i++) {\n valAndInd.push({value: vals[i], index: i});\n }\n valAndInd.sort((a, b) => b.value - a.value);\n\n const outOffset = b * k;\n const topKVals = allTopKVals.subarray(outOffset, outOffset + k);\n const topKIndices = allTopKIndices.subarray(outOffset, outOffset + k);\n for (let i = 0; i < k; i++) {\n topKVals[i] = valAndInd[i].value;\n topKIndices[i] = valAndInd[i].index;\n }\n }\n // Reshape back to the original input shape, except that the last\n // dimension is k.\n const outputShape = xShape.slice();\n outputShape[outputShape.length - 1] = k;\n return [\n tensor(allTopKVals, outputShape, xDtype) as T,\n tensor(allTopKIndices, outputShape, 'int32') as T\n ];\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ReduceInfo} from '../../ops/reduce_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ArgMinMaxProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[];\n userCode: string;\n\n constructor(reduceInfo: ReduceInfo, op: 'max'|'min', firstPass: boolean) {\n const windowSize = reduceInfo.windowSize;\n const batchSize = reduceInfo.batchSize;\n const inSize = reduceInfo.inSize;\n const outSize = Math.ceil(inSize / windowSize);\n if (!firstPass) {\n this.variableNames.push('bestIndicesA');\n }\n this.outputShape = [batchSize, outSize];\n const compOp = (op === 'max') ? '>' : '<';\n const indexSnippet = firstPass ?\n 'inOffset + i;' :\n 'round(getBestIndicesA(batch, inOffset + i));';\n\n this.userCode = `\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${windowSize};\n\n int bestIndex = 0;\n float bestValue = getA(batch, inOffset);\n\n for (int i = 0; i < ${windowSize}; i++) {\n int inIdx = ${indexSnippet};\n float candidate = getA(batch, inIdx);\n if (candidate ${compOp} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class AvgPool2DBackpropProgram implements GPGPUProgram {\n variableNames = ['dy'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n\n const avgMultiplier = 1 / (filterHeight * filterWidth);\n\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n const float avgMultiplier = float(${avgMultiplier});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(\n inShape: number[], outShape: number[]): number[] {\n const inRank = inShape.length;\n const dims: number[] = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(\n inShape: number[], outShape: number[]): number[] {\n const result: number[] = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\n\n/**\n * Given the output of `getBroadcastDims()`, returns true if the broadcasting\n * is along the outer-most dimensions of the input.\n */\nexport function broadcastDimsAreOuter(dims: number[]): boolean {\n for (let i = 0; i < dims.length; i++) {\n if (dims[i] !== i) {\n return false;\n }\n }\n return true;\n}\n\nexport function assertAndGetBroadcastShape(\n shapeA: number[], shapeB: number[]): number[] {\n const result: number[] = [];\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n const l = Math.max(shapeA.length, shapeB.length);\n\n for (let i = 0; i < l; i++) {\n const a = shapeA[shapeA.length - i - 1] || 1;\n const b = shapeB[shapeB.length - i - 1] || 1;\n if (a > 1 && b > 1 && a !== b) {\n throw Error(errMsg);\n }\n result.unshift(Math.max(a, b));\n }\n return result;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as broadcast_util from '../../ops/broadcast_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class BatchNormProgram implements GPGPUProgram {\n variableNames: string[];\n outputShape: number[] = [];\n userCode: string;\n supportsBroadcasting = true;\n\n constructor(\n xShape: number[], meanShape: number[], varianceShape: number[],\n offsetShape: number[]|null, scaleShape: number[]|null,\n varianceEpsilon: number) {\n this.variableNames = ['x', 'mean', 'variance'];\n broadcast_util.assertAndGetBroadcastShape(xShape, meanShape);\n broadcast_util.assertAndGetBroadcastShape(xShape, varianceShape);\n\n let offsetSnippet = '0.0';\n if (offsetShape != null) {\n broadcast_util.assertAndGetBroadcastShape(xShape, offsetShape);\n this.variableNames.push('offset');\n offsetSnippet = 'getOffsetAtOutCoords()';\n }\n\n let scaleSnippet = '1.0';\n if (scaleShape != null) {\n broadcast_util.assertAndGetBroadcastShape(xShape, scaleShape);\n this.variableNames.push('scale');\n scaleSnippet = 'getScaleAtOutCoords()';\n }\n\n this.outputShape = xShape;\n this.userCode = `\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${offsetSnippet};\n float scale = ${scaleSnippet};\n float inv = scale * inversesqrt(variance + float(${varianceEpsilon}));\n setOutput((x - mean) * inv + offset);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as broadcast_util from '../../ops/broadcast_util';\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {GPGPUProgram} from './gpgpu_math';\n\nconst CHECK_NAN_SNIPPET = `\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n`;\n\nexport const ADD = 'return a + b;';\nexport const SUB = 'return a - b;';\nexport const MUL = 'return a * b;';\nexport const DIV = `if (a == b) return 1.0;\n return a / b;`;\n\n// We use native integer division to deal with floating point imprecision. Since\n// we implement floor division and glsl implements truncated division, we\n// correct for this by subtracting 1 from result when the result is negative and\n// there is a remainder.\nexport const INT_DIV = `\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n`;\n\nexport const POW = `\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n`;\nexport const SQUARED_DIFFERENCE = 'return (a - b) * (a - b);';\n\nexport const EQUAL = `return float(a == b);`;\n\nexport const NOT_EQUAL = `return float(a != b);`;\n\nexport const LESS = `return float(a < b);`;\n\nexport const LESS_EQUAL = `return float(a <= b);`;\n\nexport const GREATER = `return float(a > b);`;\n\nexport const GREATER_EQUAL = `return float(a >= b);`;\n\nexport const LOGICAL_AND = `return float(a >= 1.0 && b >= 1.0);`;\n\nexport const LOGICAL_OR = `return float(a >= 1.0 || b >= 1.0);`;\n\nexport const MAX = CHECK_NAN_SNIPPET + `\n return max(a, b);\n`;\nexport const MIN = CHECK_NAN_SNIPPET + `\n return min(a, b);\n`;\nexport const MOD = `if (b == 0.0) return NAN;\n return mod(a, b);`;\n\nexport const ATAN2 = CHECK_NAN_SNIPPET + `\n return atan(a, b);\n`;\n\nexport const ELU_DER = `return (b >= 1.0) ? a : a * (b + 1.0);`;\n\nexport class BinaryOpProgram implements GPGPUProgram {\n variableNames = ['A', 'B'];\n outputShape: number[];\n userCode: string;\n supportsBroadcasting = true;\n\n // Caching uniform location for speed.\n startLoc: WebGLUniformLocation;\n\n constructor(op: string, aShape: number[], bShape: number[]) {\n this.outputShape =\n broadcast_util.assertAndGetBroadcastShape(aShape, bShape);\n this.userCode = `\n uniform float NAN;\n float binaryOperation(float a, float b) {\n ${op}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `;\n }\n\n getCustomSetupFunc() {\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.startLoc == null) {\n this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN');\n if (this.startLoc == null) {\n // This means the compiler has optimized and realized it doesn't need\n // the uniform.\n return;\n }\n }\n gpgpu.gl.uniform1f(this.startLoc, NaN);\n };\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ClipProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n constructor(aShape: number[], min: number, max: number) {\n this.outputShape = aShape;\n const minFixed = min.toFixed(20);\n const maxFixed = max.toFixed(20);\n this.userCode = `\n void main() {\n float value = getAAtOutCoords();\n if (isNaN(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, ${minFixed}, ${maxFixed}));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as util from '../util';\n\nexport function assertParams(aShape: number[], bShape: number[], axis: number) {\n const aRank = aShape.length;\n const bRank = bShape.length;\n util.assert(\n aShape.length === bShape.length,\n `Error in concat${aRank}D: rank of x1 (${aRank}) and x2 (${bRank}) ` +\n `must be the same.`);\n\n util.assert(\n axis >= 0 && axis < aRank,\n `Error in concat${aRank}D: axis must be ` +\n `between 0 and ${aRank - 1}.`);\n\n for (let i = 0; i < aRank; i++) {\n util.assert(\n (i === axis) || (aShape[i] === bShape[i]),\n `Error in concat${aRank}D: Shape (${aShape}) does not match ` +\n `(${bShape}) along the non-concatenated axis ${i}.`);\n }\n}\n\nexport function computeOutShape(\n x1Shape: number[], x2Shape: number[], axis: number): number[] {\n util.assert(\n x1Shape.length === x2Shape.length,\n 'x1 and x2 should have the same rank.');\n const outputShape = x1Shape.slice();\n outputShape[axis] += x2Shape[axis];\n return outputShape;\n}\n\nexport function computeGradientSliceShapes(\n aShape: [number, number], bShape: [number, number]) {\n return {\n aBegin: [0, 0] as [number, number],\n aSize: aShape,\n bBegin: [0, aShape[1]] as [number, number],\n bSize: bShape\n };\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as concat_util from '../../ops/concat_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ConcatProgram implements GPGPUProgram {\n variableNames = ['A', 'B'];\n outputShape: number[] = [];\n userCode: string;\n\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n constructor(aShape: [number, number], bShape: [number, number]) {\n this.outputShape =\n concat_util.computeOutShape(aShape, bShape, 1 /* axis */);\n\n this.userCode = `\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n float value = 0.0;\n if (yC < ${aShape[1]}) {\n value = getA(yR, yC);\n } else {\n yC -= ${aShape[1]};\n value = getB(yR, yC);\n }\n\n setOutput(value);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class Conv2DDerFilterProgram implements GPGPUProgram {\n variableNames = ['x', 'dy'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.filterShape;\n\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${convInfo.batchSize}; b++) {\n for (int yR = 0; yR < ${convInfo.outHeight}; yR++) {\n int xR = wR + yR * ${strideHeight} - ${padTop};\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${convInfo.outWidth}; yC++) {\n int xC = wC + yC * ${strideWidth} - ${padLeft};\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n\nexport class Conv2DDerInputProgram implements GPGPUProgram {\n variableNames = ['dy', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${filterHeight} - 1 - wR;\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${filterWidth} - 1 - wC;\n\n for (int d2 = 0; d2 < ${convInfo.outChannels}; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class DepthwiseConv2DDerFilterProgram implements GPGPUProgram {\n variableNames = ['x', 'dy'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.filterShape;\n\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n const channelMul = convInfo.outChannels / convInfo.inChannels;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${channelMul} + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < ${convInfo.batchSize}; b++) {\n for (int yR = 0; yR < ${convInfo.outHeight}; yR++) {\n int xR = wR + yR * ${strideHeight} - ${padTop};\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${convInfo.outWidth}; yC++) {\n int xC = wC + yC * ${strideWidth} - ${padLeft};\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n\nexport class DepthwiseConv2DDerInputProgram implements GPGPUProgram {\n variableNames = ['dy', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n const channelMul = convInfo.outChannels / convInfo.inChannels;\n\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${filterHeight} - 1 - wR;\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${filterWidth} - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < ${channelMul}; dm++) {\n int d2 = d1 * ${channelMul} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class Conv2DProgram implements GPGPUProgram {\n variableNames = ['x', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.outShape;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n\n const inputDepthNearestVec4 = Math.floor(convInfo.inChannels / 4) * 4;\n const inputDepthVec4Remainder = convInfo.inChannels % 4;\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR * ${dilationHeight};\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n int xC = xCCorner + wC * ${dilationWidth};\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${inputDepthNearestVec4}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${inputDepthVec4Remainder === 1}) {\n dotProd +=\n getX(batch, xR, xC, ${inputDepthNearestVec4}) *\n getW(wR, wC, ${inputDepthNearestVec4}, d2);\n } else if (${inputDepthVec4Remainder === 2}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${inputDepthNearestVec4}),\n getX(batch, xR, xC, ${inputDepthNearestVec4} + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, ${inputDepthNearestVec4}, d2),\n getW(wR, wC, ${inputDepthNearestVec4} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${inputDepthVec4Remainder === 3}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${inputDepthNearestVec4}),\n getX(batch, xR, xC, ${inputDepthNearestVec4} + 1),\n getX(batch, xR, xC, ${inputDepthNearestVec4} + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, ${inputDepthNearestVec4}, d2),\n getW(wR, wC, ${inputDepthNearestVec4} + 1, d2),\n getW(wR, wC, ${inputDepthNearestVec4} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class DepthwiseConv2DProgram implements GPGPUProgram {\n variableNames = ['x', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.outShape;\n\n const xNumRows = convInfo.inHeight;\n const xNumCols = convInfo.inWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const channelMul = convInfo.outChannels / convInfo.inChannels;\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${channelMul};\n int q = d2 - d1 * ${channelMul};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR * ${dilationHeight};\n\n if (xR < 0 || xR >= ${xNumRows}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n int xC = xCCorner + wC * ${dilationWidth};\n\n if (xC < 0 || xC >= ${xNumCols}) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport * as broadcast_util from '../../ops/broadcast_util';\nimport * as util from '../../util';\n\nexport type ShapeInfo = {\n logicalShape: number[],\n texShape: [number, number],\n isUniform: boolean\n};\n\nexport type InputInfo = {\n name: string,\n shapeInfo: ShapeInfo\n};\n\nexport function makeShader(\n inputsInfo: InputInfo[], outputShape: ShapeInfo, userCode: string,\n broadcast: boolean): string {\n let inputPrefixSnippet: string[]|string = inputsInfo.map(x => {\n const size = util.sizeFromShape(x.shapeInfo.logicalShape);\n if (x.shapeInfo.isUniform) {\n return `uniform float ${x.name}${size > 1 ? `[${size}]` : ''};`;\n }\n return `uniform sampler2D ${x.name};`;\n });\n inputPrefixSnippet = inputPrefixSnippet.join('\\n');\n const inputSamplingSnippet =\n inputsInfo.map(x => getInputSamplingSnippet(x, outputShape, broadcast))\n .join('\\n');\n const outTexShape = outputShape.texShape;\n const outputSamplingSnippet =\n getOutputSamplingSnippet(outputShape.logicalShape, outTexShape);\n const source = [\n SHADER_PREFIX, FLOAT_TEXTURE_SAMPLE_SNIPPET,\n FLOAT_TEXTURE_SETOUTPUT_SNIPPET, inputPrefixSnippet, outputSamplingSnippet,\n inputSamplingSnippet, userCode\n ].join('\\n');\n return source;\n}\n\nfunction getSamplerFromInInfo(inInfo: InputInfo): string {\n const shape = inInfo.shapeInfo.logicalShape;\n switch (shape.length) {\n case 0:\n return getSamplerScalar(inInfo);\n case 1:\n return getSampler1D(inInfo);\n case 2:\n return getSampler2D(inInfo);\n case 3:\n return getSampler3D(inInfo);\n case 4:\n return getSampler4D(inInfo);\n case 5:\n return getSampler5D(inInfo);\n case 6:\n return getSampler6D(inInfo);\n default:\n throw new Error(\n `${shape.length}-D input sampling` +\n ` is not yet supported`);\n }\n}\n\nfunction getInputSamplingSnippet(\n inInfo: InputInfo, outShapeInfo: ShapeInfo, broadcast: boolean): string {\n let res = getSamplerFlat(inInfo);\n res += getSamplerFromInInfo(inInfo);\n\n // If input and output have matching logical shapes, add\n // getTexNameAtOutCoord() method that samples the input\n // textureSampler using the output coordinates.\n if (broadcast ||\n util.arraysEqual(\n inInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape)) {\n res += getSamplerAtOutputCoords(inInfo, outShapeInfo, broadcast);\n }\n return res;\n}\n\nfunction getOutputSamplingSnippet(\n outShape: number[], outTexShape: [number, number]): string {\n switch (outShape.length) {\n case 0:\n return getOutputScalarCoords();\n case 1:\n return getOutput1DCoords(outShape as [number], outTexShape);\n case 2:\n return getOutput2DCoords(outShape as [number, number], outTexShape);\n case 3:\n return getOutput3DCoords(\n outShape as [number, number, number], outTexShape);\n case 4:\n return getOutput4DCoords(\n outShape as [number, number, number, number], outTexShape);\n case 5:\n return getOutput5DCoords(\n outShape as [number, number, number, number, number], outTexShape);\n case 6:\n return getOutput6DCoords(\n outShape as [number, number, number, number, number, number],\n outTexShape);\n default:\n throw new Error(\n `${outShape.length}-D output sampling is not yet supported`);\n }\n}\n\nconst SAMPLE_1D_SNIPPET = `\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_2D_SNIPPET = `\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\n int index = row * numC + col;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_3D_SNIPPET = `\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\n int stride1, int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_4D_SNIPPET = `\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int row, int col, int depth,\n int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_5D_SNIPPET = `\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int row, int col, int depth,\n int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2 * stride3 + depth3;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_6D_SNIPPET = `\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int stride4,\n int row, int col, int depth, int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\n stride3 + depth3 * stride4 + depth4;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst FLOAT_TEXTURE_SAMPLE_SNIPPET = `\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return texture2D(textureSampler, uv).r;\n }\n`;\n\nconst FLOAT_TEXTURE_SETOUTPUT_SNIPPET = `\n void setOutput(float val) {\n gl_FragColor = vec4(val, 0, 0, 0);\n }\n`;\n\nconst SHADER_PREFIX = `\n precision highp float;\n precision highp int;\n varying vec2 resultUV;\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n bool isNaN(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n bool hasNaN(vec4 values) {\n vec4 v1 = values * values;\n vec4 v2 = values * values;\n return any(notEqual(v1, v2));\n }\n\n float getNaN(vec4 values) {\n return dot(vec4(1), values);\n }\n\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${SAMPLE_1D_SNIPPET}\n ${SAMPLE_2D_SNIPPET}\n ${SAMPLE_3D_SNIPPET}\n ${SAMPLE_4D_SNIPPET}\n ${SAMPLE_5D_SNIPPET}\n ${SAMPLE_6D_SNIPPET}\n`;\n\nfunction getOutputScalarCoords() {\n return `\n int getOutputCoords() {\n return 0;\n }\n `;\n}\n\nfunction getOutput1DCoords(\n shape: [number], texShape: [number, number]): string {\n if (texShape[0] === 1) {\n return `\n int getOutputCoords() {\n return int(resultUV.x * ${texShape[1]}.0);\n }\n `;\n }\n if (texShape[1] === 1) {\n return `\n int getOutputCoords() {\n return int(resultUV.y * ${texShape[0]}.0);\n }\n `;\n }\n return `\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n return resTexRC.x * ${texShape[1]} + resTexRC.y;\n }\n `;\n}\n\nfunction getOutput3DCoords(\n shape: [number, number, number], texShape: [number, number]): string {\n const stride0 = shape[1] * shape[2];\n const stride1 = shape[2];\n return `\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n int r = index / ${stride0};\n index -= r * ${stride0};\n int c = index / ${stride1};\n int d = index - c * ${stride1};\n return ivec3(r, c, d);\n }\n `;\n}\n\nfunction getOutput4DCoords(\n shape: [number, number, number, number],\n texShape: [number, number]): string {\n const stride2 = shape[3];\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n return `\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n\n int r = index / ${stride0};\n index -= r * ${stride0};\n\n int c = index / ${stride1};\n index -= c * ${stride1};\n\n int d = index / ${stride2};\n int d2 = index - d * ${stride2};\n\n return ivec4(r, c, d, d2);\n }\n `;\n}\n\nfunction getOutput5DCoords(\n shape: [number, number, number, number, number],\n texShape: [number, number]): string {\n const stride3 = shape[4];\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n return `\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(${texShape[0]},\n ${texShape[1]}));\n\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n\n int r = index / ${stride0};\n index -= r * ${stride0};\n\n int c = index / ${stride1};\n index -= c * ${stride1};\n\n int d = index / ${stride2};\n index -= d * ${stride2};\n\n int d2 = index / ${stride3};\n int d3 = index - d2 * ${stride3};\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n `;\n}\n\nfunction getOutput6DCoords(\n shape: [number, number, number, number, number, number],\n texShape: [number, number]): string {\n const stride4 = shape[5];\n const stride3 = shape[4] * stride4;\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n return `\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n\n int r = index / ${stride0};\n index -= r * ${stride0};\n\n int c = index / ${stride1};\n index -= c * ${stride1};\n\n int d = index / ${stride2};\n index -= d * ${stride2};\n\n int d2 = index / ${stride3};\n index -= d2 * ${stride3};\n\n int d3 = index / ${stride4};\n int d4 = index - d3 * ${stride4};\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n `;\n}\n\nfunction getOutput2DCoords(\n shape: [number, number], texShape: [number, number]): string {\n if (util.arraysEqual(shape, texShape)) {\n return `\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(${texShape[0]}, ${texShape[1]}));\n }\n `;\n }\n if (shape[1] === 1) {\n return `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n return ivec2(index, 0);\n }\n `;\n }\n if (shape[0] === 1) {\n return `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n return ivec2(0, index);\n }\n `;\n }\n return `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n int r = index / ${shape[1]};\n int c = index - r * ${shape[1]};\n return ivec2(r, c);\n }\n `;\n}\n\nfunction getSamplerScalar(inputInfo: InputInfo): string {\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n if (inputInfo.shapeInfo.isUniform) {\n return `float ${funcName}() {return ${texName};}`;\n }\n return `\n float ${funcName}() {\n return sampleTexture(${texName}, halfCR);\n }\n `;\n}\n\nfunction getSampler1D(inputInfo: InputInfo): string {\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n\n return `\n float ${funcName}(int index) {\n return ${funcName}Flat(index);\n }\n `;\n}\n\nfunction getSampler2D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n\n const texShape = inputInfo.shapeInfo.texShape;\n if (texShape != null && util.arraysEqual(shape, texShape)) {\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n return `\n float ${funcName}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n const squeezedShape = newShape;\n if (squeezedShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, squeezedShape);\n const params = ['row', 'col'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col) {\n int index = row * ${shape[1]} + col;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === 1) {\n return `\n float ${funcName}(int row, int col) {\n int index = row * ${shape[1]} + col;\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (texNumR === 1) {\n return `\n float ${funcName}(int row, int col) {\n int index = row * ${shape[1]} + col;\n vec2 uv = vec2((float(index) + 0.5) / ${texNumC}.0, 0.5);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int row, int col) {\n vec2 uv = UVfrom2D(${texNumR}, ${texNumC}, ${shape[1]}, row, col);\n return sampleTexture(${texName}, uv);\n }\n`;\n}\n\nfunction getSampler3D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride0 = shape[1] * shape[2];\n const stride1 = shape[2];\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n const squeezedShape = newShape;\n if (squeezedShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, squeezedShape);\n const params = ['row', 'col', 'depth'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth) {\n int index = row * ${stride0} + col * ${stride1} + depth;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth) {\n int texR = row;\n int texC = col * ${stride1} + depth;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n if (texNumC === stride1) {\n return `\n float ${funcName}(int row, int col, int depth) {\n int texR = row * ${shape[1]} + col;\n int texC = depth;\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n return `\n float ${funcName}(int row, int col, int depth) {\n vec2 uv = UVfrom3D(\n ${texNumR}, ${texNumC}, ${stride0}, ${stride1}, row, col, depth);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSampler4D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride2 = shape[3];\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n if (newShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, newShape);\n const params = ['row', 'col', 'depth', 'depth2'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth, int depth2) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int index = row * ${stride0} + col * ${stride1} +\n depth * ${stride2} + depth2;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int texR = row;\n int texC = col * ${stride1} + depth * ${stride2} + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (texNumC === stride2) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int texR = row * ${shape[1] * shape[2]} + col * ${shape[2]} + depth;\n int texC = depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n vec2 uv = UVfrom4D(${texNumR}, ${texNumC}, ${stride0}, ${stride1},\n ${stride2}, row, col, depth, depth2);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSampler5D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride3 = shape[4];\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n if (newShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, newShape);\n const params = ['row', 'col', 'depth', 'depth2', 'depth3'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int index = row * ${stride0} + col * ${stride1} +\n depth * ${stride2} + depth2 * ${stride3} + depth3;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n int texC = col * ${stride1} + depth * ${stride2} +\n depth2 * ${stride3} + depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n if (texNumC === stride3) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int texR = row * ${shape[1] * shape[2]} + col * ${shape[2]} +\n depth * ${shape[3]} + depth2;\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n vec2 uv = UVfrom5D(${texNumR}, ${texNumC}, ${stride0}, ${stride1},\n ${stride2}, ${stride3}, row, col, depth, depth2, depth3);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSampler6D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride4 = shape[5];\n const stride3 = shape[4] * stride4;\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n const {newShape, keptDims} = util.squeezeShape(shape);\n if (newShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, newShape);\n const params = ['row', 'col', 'depth', 'depth2', 'depth3', 'depth4'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * ${stride0} + col * ${stride1} +\n depth * ${stride2} + depth2 * ${stride3} + depth3 * ${stride3}\n + depth4\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n int texC = col * ${stride1} + depth * ${stride2} + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (texNumC === stride4) {\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row * ${shape[1] * shape[2]} + col * ${shape[2]} + depth;\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n vec2 uv = UVfrom6D(${texNumR}, ${texNumC}, ${stride0}, ${stride1},\n ${stride2}, ${stride3}, ${stride4}\n ,row, col, depth, depth2, depth3, depth4);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSamplerFlat(inputInfo: InputInfo): string {\n const texName = inputInfo.name;\n const funcName =\n 'get' + texName.charAt(0).toUpperCase() + texName.slice(1) + 'Flat';\n const inSize = util.sizeFromShape(inputInfo.shapeInfo.logicalShape);\n\n if (inputInfo.shapeInfo.isUniform) {\n if (inSize === 1) {\n return `float ${funcName}(int index) {return ${texName};}`;\n }\n return `\n float ${funcName}(int index) {\n for (int i = 0; i < ${inSize}; i++) {\n if (i == index) {\n return ${texName}[i];\n }\n }\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const tNumR = texShape[0];\n const tNumC = texShape[1];\n if (tNumC === 1 && tNumR === 1) {\n return `\n float ${funcName}(int index) {\n return sampleTexture(${texName}, halfCR);\n }\n `;\n }\n if (tNumC === 1) {\n return `\n float ${funcName}(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${tNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (tNumR === 1) {\n return `\n float ${funcName}(int index) {\n vec2 uv = vec2((float(index) + 0.5) / ${tNumC}.0, 0.5);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int index) {\n vec2 uv = UVfrom1D(${tNumR}, ${tNumC}, index);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getBroadcastOutputCoordsSampler(\n inputInfo: InputInfo, outShapeInfo: ShapeInfo, texFuncSnippet: string,\n funcName: string): string {\n const inRank = inputInfo.shapeInfo.logicalShape.length;\n const outRank = outShapeInfo.logicalShape.length;\n\n let type = 'int';\n if (outRank === 2) {\n type = 'ivec2';\n } else if (outRank === 3) {\n type = 'ivec3';\n } else if (outRank === 4) {\n type = 'ivec4';\n }\n const broadcastDims = broadcast_util.getBroadcastDims(\n inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape);\n const rankDiff = outRank - inRank;\n let coordsSnippet: string;\n if (inRank === 0) {\n coordsSnippet = '';\n } else if (outRank < 2 && broadcastDims.length >= 1) {\n coordsSnippet = 'coords = 0;';\n } else {\n coordsSnippet =\n broadcastDims.map(d => `coords[${d + rankDiff}] = 0;`).join('\\n');\n }\n let unpackedCoordsSnippet = '';\n if (outRank < 2 && inRank > 0) {\n unpackedCoordsSnippet = 'coords';\n } else {\n unpackedCoordsSnippet = inputInfo.shapeInfo.logicalShape\n .map((s, i) => `coords[${i + rankDiff}]`)\n .join(', ');\n }\n return `\n float ${funcName}() {\n ${type} coords = getOutputCoords();\n ${coordsSnippet}\n return get${texFuncSnippet}(${unpackedCoordsSnippet});\n }\n `;\n}\n\nfunction getSamplerAtOutputCoords(\n inputInfo: InputInfo, outShapeInfo: ShapeInfo,\n supportsBroadcasting: boolean) {\n const texName = inputInfo.name;\n const texFuncSnippet = texName.charAt(0).toUpperCase() + texName.slice(1);\n const funcName = 'get' + texFuncSnippet + 'AtOutCoords';\n\n const broadcastDims = broadcast_util.getBroadcastDims(\n inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape);\n const inRank = inputInfo.shapeInfo.logicalShape.length;\n const outRank = outShapeInfo.logicalShape.length;\n const doBroadcast =\n supportsBroadcasting && ((outRank > inRank) || broadcastDims.length > 0);\n const broadcastOverOuter =\n broadcast_util.broadcastDimsAreOuter(broadcastDims);\n const isUniform = inputInfo.shapeInfo.isUniform;\n\n if (doBroadcast && !broadcastOverOuter) {\n return getBroadcastOutputCoordsSampler(\n inputInfo, outShapeInfo, texFuncSnippet, funcName);\n }\n\n const inSize = util.sizeFromShape(inputInfo.shapeInfo.logicalShape);\n let broadcastSnippet = '';\n if (doBroadcast && broadcastOverOuter) {\n broadcastSnippet = `\n int mainPart = index / ${inSize};\n index -= mainPart * ${inSize};\n `;\n }\n\n const outTexShape = outShapeInfo.texShape;\n if (isUniform) {\n if (inSize === 1) {\n return `float ${funcName}() {return ${texName};}`;\n }\n return `\n float ${funcName}() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${outTexShape[0]}, ${outTexShape[1]}));\n int index = resTexRC.x * ${outTexShape[1]} + resTexRC.y;\n ${broadcastSnippet}\n return get${texFuncSnippet}Flat(index);\n }\n `;\n }\n\n // At this point, the input is not a uniform.\n const inTexShape = inputInfo.shapeInfo.texShape;\n if (util.arraysEqual(inTexShape, outTexShape)) {\n return `\n float ${funcName}() {\n return sampleTexture(${texName}, resultUV);\n }\n `;\n }\n\n return `\n float ${funcName}() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${outTexShape[0]}, ${outTexShape[1]}));\n int index = resTexRC.x * ${outTexShape[1]} + resTexRC.y;\n ${broadcastSnippet}\n int texR = index / ${inTexShape[1]};\n int texC = index - texR * ${inTexShape[1]};\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${inTexShape[1]}.0, ${inTexShape[0]}.0);\n\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nexport function getCoordsDataType(rank: number): string {\n if (rank <= 1) {\n return 'int';\n } else if (rank === 2) {\n return 'ivec2';\n } else if (rank === 3) {\n return 'ivec3';\n } else if (rank === 4) {\n return 'ivec4';\n } else if (rank === 5) {\n return 'ivec5';\n } else if (rank === 6) {\n return 'ivec6';\n } else {\n throw Error(`GPU for rank ${rank} is not yet supported`);\n }\n}\n\n/** Returns a new input info (a copy) that has a squeezed logical shape. */\nfunction squeezeInputInfo(\n inInfo: InputInfo, squeezedShape: number[]): InputInfo {\n // Deep copy.\n const newInputInfo: InputInfo = JSON.parse(JSON.stringify(inInfo));\n newInputInfo.shapeInfo.logicalShape = squeezedShape;\n return newInputInfo;\n}\n\nfunction getSqueezedParams(params: string[], keptDims: number[]): string {\n return keptDims.map(d => params[d]).join(', ');\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class CumSumProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(shape: number[], exclusive: boolean, reverse: boolean) {\n this.outputShape = shape;\n const rank = shape.length;\n const finalDim = shape[shape.length - 1];\n const comparator = reverse ? '<' : '>';\n\n this.userCode = `\n int getIndex(int i) {\n ${reverse ? `return ${finalDim} -i - 1;` : 'return i;'}\n }\n\n void main() {\n ${getCoordsDataType(rank)} coords = getOutputCoords();\n int end = ${getFinalCoord(rank, 'coords')};\n float val = 0.0;\n for (int i = ${finalDim} - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx ${comparator} end) {\n continue;\n }\n if (idx == end && ${exclusive}) {\n continue;\n }\n ${getFinalCoord(rank, 'coords')} = idx;\n val += getX(${getCoords(rank, 'coords')});\n }\n setOutput(val);\n }\n `;\n }\n}\n\nfunction getCoords(rank: number, name: string): string {\n if (rank === 1) {\n return `${name}`;\n } else if (rank === 2) {\n return `${name}.x, ${name}.y`;\n } else if (rank === 3) {\n return `${name}.x, ${name}.y, ${name}.z`;\n } else if (rank === 4) {\n return `${name}.x, ${name}.y, ${name}.z, ${name}.w`;\n } else {\n throw Error(`Cumulative sum for rank ${rank} is not yet supported`);\n }\n}\n\nfunction getFinalCoord(rank: number, name: string): string {\n if (rank === 1) {\n return `${name}`;\n } else if (rank === 2) {\n return `${name}.y`;\n } else if (rank === 3) {\n return `${name}.z`;\n } else if (rank === 4) {\n return `${name}.w`;\n } else {\n throw Error(`Cumulative sum for rank ${rank} is not yet supported`);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class EncodeFloatProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n constructor(outputShape: number[]) {\n this.outputShape = outputShape;\n this.userCode = `\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n gl_FragColor = encode_float(x);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, DataTypeMap} from '../../types';\n\nexport enum TextureUsage {\n RENDER,\n UPLOAD,\n PIXELS,\n DOWNLOAD\n}\n\nexport enum PhysicalTextureType {\n FLOAT16,\n FLOAT32,\n UNSIGNED_BYTE\n}\n\nexport interface TextureData {\n texture: WebGLTexture;\n shape: number[];\n /** [rows, columns] shape of the texture. */\n texShape: [number, number];\n dtype: DataType;\n values: DataTypeMap[DataType];\n usage: TextureUsage;\n}\n\nexport function getUnpackedMatrixTextureShapeWidthHeight(\n rows: number, columns: number): [number, number] {\n return [columns, rows];\n}\n\nexport function getUnpackedArraySizeFromMatrixSize(\n matrixSize: number, channelsPerTexture: number): number {\n return matrixSize * channelsPerTexture;\n}\n\nexport function getColorMatrixTextureShapeWidthHeight(\n rows: number, columns: number): [number, number] {\n return [columns * 4, rows];\n}\n\nexport function getMatrixSizeFromUnpackedArraySize(\n unpackedSize: number, channelsPerTexture: number): number {\n if (unpackedSize % channelsPerTexture !== 0) {\n throw new Error(\n `unpackedSize (${unpackedSize}) must be a multiple of ` +\n `${channelsPerTexture}`);\n }\n return unpackedSize / channelsPerTexture;\n}\n\nexport type TypedArray = Float32Array|Uint8Array;\n\nexport function encodeMatrixToUnpackedArray(\n matrix: TypedArray, unpackedArray: TypedArray, channelsPerTexture: number) {\n const requiredSize =\n getUnpackedArraySizeFromMatrixSize(matrix.length, channelsPerTexture);\n if (unpackedArray.length < requiredSize) {\n throw new Error(\n `unpackedArray length (${unpackedArray.length}) must be >= ` +\n `${requiredSize}`);\n }\n let dst = 0;\n for (let src = 0; src < matrix.length; ++src) {\n unpackedArray[dst] = matrix[src];\n dst += channelsPerTexture;\n }\n}\n\nexport function decodeMatrixFromUnpackedArray(\n unpackedArray: Float32Array, matrix: Float32Array,\n channelsPerTexture: number) {\n const requiredSize = getMatrixSizeFromUnpackedArraySize(\n unpackedArray.length, channelsPerTexture);\n if (matrix.length < requiredSize) {\n throw new Error(\n `matrix length (${matrix.length}) must be >= ${requiredSize}`);\n }\n let dst = 0;\n for (let src = 0; src < unpackedArray.length; src += channelsPerTexture) {\n matrix[dst++] = unpackedArray[src];\n }\n}\n\nexport function decodeMatrixFromUnpackedColorRGBAArray(\n unpackedArray: Float32Array, matrix: Float32Array, channels: number) {\n const requiredSize = unpackedArray.length * channels / 4;\n if (matrix.length < requiredSize) {\n throw new Error(\n `matrix length (${matrix.length}) must be >= ${requiredSize}`);\n }\n let dst = 0;\n for (let src = 0; src < unpackedArray.length; src += 4) {\n for (let c = 0; c < channels; c++) {\n matrix[dst++] = unpackedArray[src + c];\n }\n }\n}\n\nexport function getPackedMatrixTextureShapeWidthHeight(\n rows: number, columns: number): [number, number] {\n return [Math.ceil(columns / 2), Math.ceil(rows / 2)];\n}\n\nexport function getPackedRGBAArraySizeFromMatrixShape(\n rows: number, columns: number): number {\n const [w, h] = getPackedMatrixTextureShapeWidthHeight(rows, columns);\n return w * h * 4;\n}\n\nexport function encodeMatrixToPackedRGBA(\n matrix: Float32Array, rows: number, columns: number,\n packedRGBA: Float32Array) {\n const requiredSize = getPackedRGBAArraySizeFromMatrixShape(rows, columns);\n if (packedRGBA.length < requiredSize) {\n throw new Error(\n `packedRGBA length (${packedRGBA.length}) must be >= ${requiredSize}`);\n }\n /*\n Unpacked matrix, row-major order in Float32Array[16]: A B C D\n E F G H\n I J K L\n M N O P\n\n Packed matrix, 2x2 RGBA32 texture (memory view): ABEF CDGH IJMN KLOP\n\n Packed matrix, 2x2 RGBA32 texture (matrix view): AB|CD\n EF|GH\n --+--\n IJ|KL\n MN|OP\n */\n const [textureWidth, textureHeight] =\n getPackedMatrixTextureShapeWidthHeight(rows, columns);\n const oddWidth = (columns % 2) === 1;\n const oddHeight = (rows % 2) === 1;\n const widthInFullBlocks = Math.floor(columns / 2);\n const heightInFullBlocks = Math.floor(rows / 2);\n\n // loop over full 2x2 blocks\n {\n const dstStride = (oddWidth ? 4 : 0);\n const oneRow = columns;\n let dst = 0;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n const matrixSrcRow = (blockY * 2 * columns);\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n const matrixSrcCol = blockX * 2;\n const src = matrixSrcRow + matrixSrcCol;\n packedRGBA[dst] = matrix[src];\n packedRGBA[dst + 1] = matrix[src + 1];\n packedRGBA[dst + 2] = matrix[src + oneRow];\n packedRGBA[dst + 3] = matrix[src + oneRow + 1];\n dst += 4;\n }\n dst += dstStride;\n }\n }\n\n // loop down final odd column\n if (oddWidth) {\n let src = columns - 1;\n let dst = (textureWidth - 1) * 4;\n const srcStride = 2 * columns;\n const dstStride = textureWidth * 4;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n packedRGBA[dst] = matrix[src];\n packedRGBA[dst + 2] = matrix[src + columns];\n src += srcStride;\n dst += dstStride;\n }\n }\n\n // loop across final row\n if (oddHeight) {\n let src = (rows - 1) * columns;\n let dst = (textureHeight - 1) * textureWidth * 4;\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n packedRGBA[dst++] = matrix[src++];\n packedRGBA[dst++] = matrix[src++];\n dst += 2;\n }\n }\n\n // fill in bottom-right texel\n if (oddWidth && oddHeight) {\n packedRGBA[packedRGBA.length - 4] = matrix[matrix.length - 1];\n }\n\n return packedRGBA;\n}\n\nexport function decodeMatrixFromPackedRGBA(\n packedRGBA: Float32Array, rows: number, columns: number,\n matrix: Float32Array): Float32Array {\n const requiredSize = rows * columns;\n if (requiredSize < matrix.length) {\n throw new Error(\n `matrix length (${matrix.length}) must be >= ${requiredSize}`);\n }\n const oddWidth = (columns % 2) === 1;\n const oddHeight = (rows % 2) === 1;\n const widthInFullBlocks = Math.floor(columns / 2);\n const heightInFullBlocks = Math.floor(rows / 2);\n const [textureWidth, textureHeight] =\n getPackedMatrixTextureShapeWidthHeight(rows, columns);\n\n // loop over full 2x2 blocks\n {\n const srcStride = oddWidth ? 4 : 0;\n const dstStride = columns + (oddWidth ? 1 : 0);\n let src = 0;\n let dstRow1 = 0;\n let dstRow2 = columns;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n matrix[dstRow1++] = packedRGBA[src++];\n matrix[dstRow1++] = packedRGBA[src++];\n matrix[dstRow2++] = packedRGBA[src++];\n matrix[dstRow2++] = packedRGBA[src++];\n }\n src += srcStride;\n dstRow1 += dstStride;\n dstRow2 += dstStride;\n }\n }\n\n // loop down final column\n if (oddWidth) {\n let src = (textureWidth - 1) * 4;\n let dst = columns - 1;\n const srcStride = textureWidth * 4;\n const dstStride = 2 * columns;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n matrix[dst] = packedRGBA[src];\n matrix[dst + columns] = packedRGBA[src + 2];\n src += srcStride;\n dst += dstStride;\n }\n }\n\n // loop across final row\n if (oddHeight) {\n let src = (textureHeight - 1) * textureWidth * 4;\n let dst = (rows - 1) * columns;\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n matrix[dst++] = packedRGBA[src++];\n matrix[dst++] = packedRGBA[src++];\n src += 2;\n }\n }\n\n // fill in bottom-right cell\n if (oddWidth && oddHeight) {\n matrix[matrix.length - 1] = packedRGBA[packedRGBA.length - 4];\n }\n\n return matrix;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class FromPixelsProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n constructor(outputShape: number[]) {\n const [height, width, ] = outputShape;\n this.outputShape = outputShape;\n this.userCode = `\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${width}.0, ${height}.0);\n\n vec4 values = texture2D(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class GatherProgram implements GPGPUProgram {\n variableNames = ['A', 'indices'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(aShape: number[], indicesLength: number, axis: number) {\n const outputShape: number[] = aShape.slice();\n outputShape[axis] = indicesLength;\n this.outputShape = outputShape;\n this.rank = outputShape.length;\n const dtype = getCoordsDataType(this.rank);\n const sourceCoords = getSourceCoords(aShape, axis);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n setOutput(getA(${sourceCoords}));\n }\n `;\n }\n}\n\nfunction getSourceCoords(aShape: number[], axis: number): string {\n const rank = aShape.length;\n if (rank > 4) {\n throw Error(`Gather for rank ${rank} is not yet supported`);\n }\n if (rank === 1) {\n return `int(getIndices(resRC))`;\n }\n\n const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w'];\n\n const sourceCoords = [];\n for (let i = 0; i < aShape.length; i++) {\n if (i === axis) {\n sourceCoords.push(`int(getIndices(${currentCoords[i]}))`);\n } else {\n sourceCoords.push(`${currentCoords[i]}`);\n }\n }\n return sourceCoords.join();\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nlet MAX_TEXTURE_SIZE: number = null;\n\nimport * as util from '../../util';\nimport {ENV} from '../../environment';\n\nexport function createWebGLRenderingContext(attributes: WebGLContextAttributes):\n WebGLRenderingContext {\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return createWebGLRenderingContextFromCanvas(canvas, attributes);\n}\n\nexport function createWebGLRenderingContextFromCanvas(\n canvas: HTMLCanvasElement,\n attributes: WebGLContextAttributes): WebGLRenderingContext {\n let gl: WebGLRenderingContext;\n\n const webglVersion = ENV.get('WEBGL_VERSION');\n if (webglVersion === 2) {\n gl = canvas.getContext('webgl2', attributes) as WebGLRenderingContext;\n } else if (webglVersion === 1) {\n gl = (canvas.getContext('webgl', attributes) ||\n canvas.getContext('experimental-webgl', attributes)) as\n WebGLRenderingContext;\n }\n\n if (webglVersion === 0 || gl == null) {\n throw new Error('This browser does not support WebGL.');\n }\n return gl;\n}\n\nexport function callAndCheck(gl: WebGLRenderingContext, func: () => T): T {\n const returnValue = func();\n checkWebGLError(gl);\n return returnValue;\n}\n\nlet webGLDebugErrorCheckingEnabled = false;\n\nexport function enableDebugWebGLErrorChecking(enabled: boolean) {\n webGLDebugErrorCheckingEnabled = enabled;\n}\n\nexport function checkWebGLError(gl: WebGLRenderingContext) {\n if (webGLDebugErrorCheckingEnabled) {\n const error = gl.getError();\n if (error !== gl.NO_ERROR) {\n throw new Error('WebGL Error: ' + getWebGLErrorMessage(gl, error));\n }\n }\n}\n\nexport function getWebGLErrorMessage(\n gl: WebGLRenderingContext, status: number): string {\n switch (status) {\n case gl.NO_ERROR:\n return 'NO_ERROR';\n case gl.INVALID_ENUM:\n return 'INVALID_ENUM';\n case gl.INVALID_VALUE:\n return 'INVALID_VALUE';\n case gl.INVALID_OPERATION:\n return 'INVALID_OPERATION';\n case gl.INVALID_FRAMEBUFFER_OPERATION:\n return 'INVALID_FRAMEBUFFER_OPERATION';\n case gl.OUT_OF_MEMORY:\n return 'OUT_OF_MEMORY';\n case gl.CONTEXT_LOST_WEBGL:\n return 'CONTEXT_LOST_WEBGL';\n default:\n return `Unknown error code ${status}`;\n }\n}\n\nexport function getExtensionOrThrow(\n gl: WebGLRenderingContext, extensionName: string): {} {\n return throwIfNull<{}>(\n gl, () => gl.getExtension(extensionName),\n 'Extension \"' + extensionName + '\" not supported on this browser.');\n}\n\nexport function createVertexShader(\n gl: WebGLRenderingContext, vertexShaderSource: string): WebGLShader {\n const vertexShader: WebGLShader = throwIfNull(\n gl, () => gl.createShader(gl.VERTEX_SHADER),\n 'Unable to create vertex WebGLShader.');\n callAndCheck(gl, () => gl.shaderSource(vertexShader, vertexShaderSource));\n callAndCheck(gl, () => gl.compileShader(vertexShader));\n if (gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS) === false) {\n console.log(gl.getShaderInfoLog(vertexShader));\n throw new Error('Failed to compile vertex shader.');\n }\n return vertexShader;\n}\n\nexport function createFragmentShader(\n gl: WebGLRenderingContext, fragmentShaderSource: string): WebGLShader {\n const fragmentShader: WebGLShader = throwIfNull(\n gl, () => gl.createShader(gl.FRAGMENT_SHADER),\n 'Unable to create fragment WebGLShader.');\n callAndCheck(gl, () => gl.shaderSource(fragmentShader, fragmentShaderSource));\n callAndCheck(gl, () => gl.compileShader(fragmentShader));\n if (gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS) === false) {\n logShaderSourceAndInfoLog(\n fragmentShaderSource, gl.getShaderInfoLog(fragmentShader));\n throw new Error('Failed to compile fragment shader.');\n }\n return fragmentShader;\n}\n\nconst lineNumberRegex = /ERROR: [0-9]+:([0-9]+):/g;\nfunction logShaderSourceAndInfoLog(\n shaderSource: string, shaderInfoLog: string) {\n const lineNumberRegexResult = lineNumberRegex.exec(shaderInfoLog);\n if (lineNumberRegexResult == null) {\n console.log(`Couldn't parse line number in error: ${shaderInfoLog}`);\n console.log(shaderSource);\n return;\n }\n\n const lineNumber = +lineNumberRegexResult[1];\n\n const shaderLines = shaderSource.split('\\n');\n const pad = shaderLines.length.toString().length + 2;\n const linesWithLineNumbers = shaderLines.map(\n (line, lineNumber) =>\n util.rightPad((lineNumber + 1).toString(), pad) + line);\n let maxLineLength = 0;\n for (let i = 0; i < linesWithLineNumbers.length; i++) {\n maxLineLength = Math.max(linesWithLineNumbers[i].length, maxLineLength);\n }\n\n const beforeErrorLines = linesWithLineNumbers.slice(0, lineNumber - 1);\n const errorLine = linesWithLineNumbers.slice(lineNumber - 1, lineNumber);\n const afterErrorLines = linesWithLineNumbers.slice(lineNumber);\n\n console.log(beforeErrorLines.join('\\n'));\n console.log(shaderInfoLog.split('\\n')[0]);\n console.log(\n `%c ${util.rightPad(errorLine[0], maxLineLength)}`,\n 'border:1px solid red; background-color:#e3d2d2; color:#a61717');\n console.log(afterErrorLines.join('\\n'));\n}\n\nexport function createProgram(gl: WebGLRenderingContext): WebGLProgram {\n return throwIfNull(\n gl, () => gl.createProgram(), 'Unable to create WebGLProgram.');\n}\n\nexport function linkProgram(gl: WebGLRenderingContext, program: WebGLProgram) {\n callAndCheck(gl, () => gl.linkProgram(program));\n if (gl.getProgramParameter(program, gl.LINK_STATUS) === false) {\n console.log(gl.getProgramInfoLog(program));\n throw new Error('Failed to link vertex and fragment shaders.');\n }\n}\n\nexport function validateProgram(\n gl: WebGLRenderingContext, program: WebGLProgram) {\n callAndCheck(gl, () => gl.validateProgram(program));\n if (gl.getProgramParameter(program, gl.VALIDATE_STATUS) === false) {\n console.log(gl.getProgramInfoLog(program));\n throw new Error('Shader program validation failed.');\n }\n}\n\nexport function createStaticVertexBuffer(\n gl: WebGLRenderingContext, data: Float32Array): WebGLBuffer {\n const buffer: WebGLBuffer = throwIfNull(\n gl, () => gl.createBuffer(), 'Unable to create WebGLBuffer');\n callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer));\n callAndCheck(gl, () => gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW));\n return buffer;\n}\n\nexport function createStaticIndexBuffer(\n gl: WebGLRenderingContext, data: Uint16Array): WebGLBuffer {\n const buffer: WebGLBuffer = throwIfNull(\n gl, () => gl.createBuffer(), 'Unable to create WebGLBuffer');\n callAndCheck(gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer));\n callAndCheck(\n gl, () => gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, gl.STATIC_DRAW));\n return buffer;\n}\n\nexport function queryMaxTextureSize(gl: WebGLRenderingContext): number {\n if (MAX_TEXTURE_SIZE != null) {\n return MAX_TEXTURE_SIZE;\n }\n MAX_TEXTURE_SIZE =\n callAndCheck(gl, () => gl.getParameter(gl.MAX_TEXTURE_SIZE));\n return MAX_TEXTURE_SIZE;\n}\n\nexport function getNumChannels(): number {\n if (ENV.get('WEBGL_VERSION') === 2) {\n return 1;\n }\n return 4;\n}\n\nexport function createTexture(gl: WebGLRenderingContext): WebGLTexture {\n return throwIfNull(\n gl, () => gl.createTexture(), 'Unable to create WebGLTexture.');\n}\n\nexport function validateTextureSize(\n gl: WebGLRenderingContext, width: number, height: number) {\n const maxTextureSize: number = queryMaxTextureSize(gl);\n if ((width <= 0) || (height <= 0)) {\n const requested = `[${width}x${height}]`;\n throw new Error('Requested texture size ' + requested + ' is invalid.');\n }\n if ((width > maxTextureSize) || (height > maxTextureSize)) {\n const requested = `[${width}x${height}]`;\n const max = `[${maxTextureSize}x${maxTextureSize}]`;\n throw new Error(\n 'Requested texture size ' + requested +\n ' greater than WebGL maximum on this browser / GPU ' + max + '.');\n }\n}\n\nexport function createFramebuffer(gl: WebGLRenderingContext): WebGLFramebuffer {\n return throwIfNull(\n gl, () => gl.createFramebuffer(), 'Unable to create WebGLFramebuffer.');\n}\n\nexport function bindVertexBufferToProgramAttribute(\n gl: WebGLRenderingContext, program: WebGLProgram, attribute: string,\n buffer: WebGLBuffer, arrayEntriesPerItem: number, itemStrideInBytes: number,\n itemOffsetInBytes: number): boolean {\n const loc = gl.getAttribLocation(program, attribute);\n if (loc === -1) {\n // The GPU compiler decided to strip out this attribute because it's unused,\n // thus no need to bind.\n return false;\n }\n callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer));\n callAndCheck(\n gl,\n () => gl.vertexAttribPointer(\n loc, arrayEntriesPerItem, gl.FLOAT, false, itemStrideInBytes,\n itemOffsetInBytes));\n callAndCheck(gl, () => gl.enableVertexAttribArray(loc));\n return true;\n}\n\nexport function bindTextureUnit(\n gl: WebGLRenderingContext, texture: WebGLTexture, textureUnit: number) {\n validateTextureUnit(gl, textureUnit);\n callAndCheck(gl, () => gl.activeTexture(gl.TEXTURE0 + textureUnit));\n callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture));\n}\n\nexport function unbindTextureUnit(\n gl: WebGLRenderingContext, textureUnit: number) {\n validateTextureUnit(gl, textureUnit);\n callAndCheck(gl, () => gl.activeTexture(gl.TEXTURE0 + textureUnit));\n callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n}\n\nexport function getProgramUniformLocationOrThrow(\n gl: WebGLRenderingContext, program: WebGLProgram,\n uniformName: string): WebGLUniformLocation {\n return throwIfNull(\n gl, () => gl.getUniformLocation(program, uniformName),\n 'uniform \"' + uniformName + '\" not present in program.');\n}\n\nexport function getProgramUniformLocation(\n gl: WebGLRenderingContext, program: WebGLProgram,\n uniformName: string): WebGLUniformLocation {\n return gl.getUniformLocation(program, uniformName);\n}\n\nexport function bindTextureToProgramUniformSampler(\n gl: WebGLRenderingContext, program: WebGLProgram, texture: WebGLTexture,\n uniformSamplerLocation: WebGLUniformLocation, textureUnit: number) {\n callAndCheck(gl, () => bindTextureUnit(gl, texture, textureUnit));\n callAndCheck(gl, () => gl.uniform1i(uniformSamplerLocation, textureUnit));\n}\n\nexport function bindCanvasToFramebuffer(gl: WebGLRenderingContext) {\n callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, null));\n callAndCheck(gl, () => gl.viewport(0, 0, gl.canvas.width, gl.canvas.height));\n callAndCheck(gl, () => gl.scissor(0, 0, gl.canvas.width, gl.canvas.height));\n}\n\nexport function bindColorTextureToFramebuffer(\n gl: WebGLRenderingContext, texture: WebGLTexture,\n framebuffer: WebGLFramebuffer) {\n callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer));\n callAndCheck(\n gl,\n () => gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0));\n}\n\nexport function unbindColorTextureFromFramebuffer(\n gl: WebGLRenderingContext, framebuffer: WebGLFramebuffer) {\n callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer));\n callAndCheck(\n gl,\n () => gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0));\n}\n\nexport function validateFramebuffer(gl: WebGLRenderingContext) {\n const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n if (status !== gl.FRAMEBUFFER_COMPLETE) {\n throw new Error(\n 'Error binding framebuffer: ' + getFramebufferErrorMessage(gl, status));\n }\n}\n\nexport function getFramebufferErrorMessage(\n gl: WebGLRenderingContext, status: number): string {\n switch (status) {\n case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:\n return 'FRAMEBUFFER_INCOMPLETE_ATTACHMENT';\n case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:\n return 'FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT';\n case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:\n return 'FRAMEBUFFER_INCOMPLETE_DIMENSIONS';\n case gl.FRAMEBUFFER_UNSUPPORTED:\n return 'FRAMEBUFFER_UNSUPPORTED';\n default:\n return `unknown error ${status}`;\n }\n}\n\nfunction throwIfNull(\n gl: WebGLRenderingContext, returnTOrNull: () => T | null,\n failureMessage: string): T {\n const tOrNull: T|null = callAndCheck(gl, () => returnTOrNull());\n if (tOrNull == null) {\n throw new Error(failureMessage);\n }\n return tOrNull as T;\n}\n\nfunction validateTextureUnit(gl: WebGLRenderingContext, textureUnit: number) {\n const maxTextureUnit = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1;\n const glTextureUnit = textureUnit + gl.TEXTURE0;\n if (glTextureUnit < gl.TEXTURE0 || glTextureUnit > maxTextureUnit) {\n const textureUnitRange = `[gl.TEXTURE0, gl.TEXTURE${maxTextureUnit}]`;\n throw new Error(`textureUnit must be in ${textureUnitRange}.`);\n }\n}\n\nexport function getTextureShapeFromLogicalShape(\n gl: WebGLRenderingContext, logShape: number[]): [number, number] {\n // If logical shape is 2, we don't squeeze, since we want to match physical.\n if (logShape.length !== 2) {\n const squeezeResult = util.squeezeShape(logShape);\n logShape = squeezeResult.newShape;\n }\n\n const maxTexSize = queryMaxTextureSize(gl);\n const size = util.sizeFromShape(logShape);\n if (logShape.length <= 1 && size <= maxTexSize) {\n return [size, 1];\n } else if (\n logShape.length === 2 && logShape[0] <= maxTexSize &&\n logShape[1] <= maxTexSize) {\n return logShape as [number, number];\n } else if (\n logShape.length === 3 && logShape[0] <= maxTexSize &&\n logShape[1] * logShape[2] <= maxTexSize) {\n return [logShape[0], logShape[1] * logShape[2]];\n } else if (\n logShape.length === 4 && logShape[0] <= maxTexSize &&\n logShape[1] * logShape[2] * logShape[3] <= maxTexSize) {\n return [logShape[0], logShape[1] * logShape[2] * logShape[3]];\n } else {\n return util.sizeToSquarishShape(size);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../../environment';\n\nimport * as tex_util from './tex_util';\nimport * as webgl_util from './webgl_util';\n\nexport function getWebGLContextAttributes(): WebGLContextAttributes {\n return {\n alpha: false,\n antialias: false,\n premultipliedAlpha: false,\n preserveDrawingBuffer: false,\n depth: false,\n stencil: false,\n failIfMajorPerformanceCaveat: true\n };\n}\n\nexport interface TextureConfig {\n internalFormatFloat: number;\n textureFormatFloat: number;\n internalFormatHalfFloat: number;\n internalFormatPackedFloat: number;\n\n // The format to use during a gl.readPixels call.\n downloadTextureFormat: number;\n // How many channels need to be unpacked after a gl.readPixels call.\n downloadUnpackNumChannels: number;\n\n defaultNumChannels: number;\n textureTypeHalfFloat: number;\n}\n\nexport function createWebGLContext(canvas?: HTMLCanvasElement) {\n const attributes = getWebGLContextAttributes();\n let gl: WebGLRenderingContext;\n if (canvas != null) {\n gl = webgl_util.createWebGLRenderingContextFromCanvas(canvas, attributes);\n } else {\n gl = webgl_util.createWebGLRenderingContext(attributes);\n }\n webgl_util.callAndCheck(gl, () => gl.disable(gl.DEPTH_TEST));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.STENCIL_TEST));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.BLEND));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.DITHER));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.POLYGON_OFFSET_FILL));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.SAMPLE_COVERAGE));\n webgl_util.callAndCheck(gl, () => gl.enable(gl.SCISSOR_TEST));\n webgl_util.callAndCheck(gl, () => gl.enable(gl.CULL_FACE));\n webgl_util.callAndCheck(gl, () => gl.cullFace(gl.BACK));\n\n return gl;\n}\n\nexport function createVertexShader(gl: WebGLRenderingContext): WebGLShader {\n const vertexShaderSource = `\n precision highp float;\n attribute vec3 clipSpacePos;\n attribute vec2 uv;\n varying vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`;\n return webgl_util.createVertexShader(gl, vertexShaderSource);\n}\n\nexport function createVertexBuffer(gl: WebGLRenderingContext): WebGLBuffer {\n // [x y z u v] * [upper-left, lower-left, upper-right, lower-right]\n const vertexArray = new Float32Array(\n [-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0]);\n return webgl_util.createStaticVertexBuffer(gl, vertexArray);\n}\n\nexport function createIndexBuffer(gl: WebGLRenderingContext): WebGLBuffer {\n // OpenGL (and WebGL) have \"CCW == front\" winding\n const triangleVertexIndices = new Uint16Array([0, 1, 2, 2, 1, 3]);\n return webgl_util.createStaticIndexBuffer(gl, triangleVertexIndices);\n}\n\nexport function getTextureConfig(\n // tslint:disable-next-line:no-any\n gl: WebGLRenderingContext, textureHalfFloatExtension?: any): TextureConfig {\n // tslint:disable-next-line:no-any\n const glany = gl as any;\n\n let internalFormatFloat: number;\n let internalFormatHalfFloat: number;\n let internalFormatPackedFloat: number;\n let textureFormatFloat: number;\n\n let downloadTextureFormat: number;\n let downloadUnpackNumChannels: number;\n\n let defaultNumChannels: number;\n let textureTypeHalfFloat: number;\n\n if (ENV.get('WEBGL_VERSION') === 2) {\n internalFormatFloat = glany.R32F;\n internalFormatHalfFloat = glany.R16F;\n internalFormatPackedFloat = glany.RGBA32F;\n textureFormatFloat = glany.RED;\n downloadUnpackNumChannels = 4;\n defaultNumChannels = 1;\n textureTypeHalfFloat = glany.HALF_FLOAT;\n } else {\n internalFormatFloat = gl.RGBA;\n internalFormatHalfFloat = gl.RGBA;\n internalFormatPackedFloat = glany.RGBA;\n textureFormatFloat = gl.RGBA;\n downloadUnpackNumChannels = 4;\n defaultNumChannels = 4;\n textureTypeHalfFloat = textureHalfFloatExtension != null ?\n textureHalfFloatExtension.HALF_FLOAT_OES :\n null;\n }\n downloadTextureFormat = gl.RGBA;\n\n return {\n internalFormatFloat,\n internalFormatHalfFloat,\n internalFormatPackedFloat,\n textureFormatFloat,\n downloadTextureFormat,\n downloadUnpackNumChannels,\n defaultNumChannels,\n textureTypeHalfFloat\n };\n}\n\nfunction createAndConfigureTexture(\n gl: WebGLRenderingContext, width: number, height: number,\n internalFormat: number, textureFormat: number,\n textureType: number): WebGLTexture {\n webgl_util.validateTextureSize(gl, width, height);\n const texture = webgl_util.createTexture(gl);\n\n const tex2d = gl.TEXTURE_2D;\n webgl_util.callAndCheck(gl, () => gl.bindTexture(tex2d, texture));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_MIN_FILTER, gl.NEAREST));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_MAG_FILTER, gl.NEAREST));\n webgl_util.callAndCheck(\n gl,\n () => gl.texImage2D(\n tex2d, 0, internalFormat, width, height, 0, textureFormat,\n textureType, null));\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n return texture;\n}\n\nexport function createFloat32MatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, textureConfig.internalFormatFloat,\n textureConfig.textureFormatFloat, gl.FLOAT);\n}\n\nexport function createFloat16MatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, textureConfig.internalFormatFloat,\n textureConfig.textureFormatFloat, textureConfig.textureTypeHalfFloat);\n}\n\nexport function createUnsignedBytesMatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE);\n}\n\nexport function createPackedMatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, textureConfig.internalFormatPackedFloat, gl.RGBA,\n gl.FLOAT);\n}\n\nexport function bindVertexProgramAttributeStreams(\n gl: WebGLRenderingContext, program: WebGLProgram,\n vertexBuffer: WebGLBuffer): boolean {\n const posOffset = 0; // x is the first buffer element\n const uvOffset = 3 * 4; // uv comes after [x y z]\n const stride = (3 * 4) + (2 * 4); // xyz + uv, each entry is 4-byte float.\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer));\n const success = webgl_util.bindVertexBufferToProgramAttribute(\n gl, program, 'clipSpacePos', vertexBuffer, 3, stride, posOffset);\n return success &&\n webgl_util.bindVertexBufferToProgramAttribute(\n gl, program, 'uv', vertexBuffer, 2, stride, uvOffset);\n}\n\nexport function uploadPixelDataToTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture,\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement) {\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture));\n webgl_util.callAndCheck(\n gl,\n () => gl.texImage2D(\n gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, pixels));\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n}\n\nfunction uploadDataToTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, width: number,\n height: number, data: Float32Array, textureFormat: number) {\n webgl_util.validateTextureSize(gl, width, height);\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture));\n webgl_util.callAndCheck(\n gl,\n () => gl.texSubImage2D(\n gl.TEXTURE_2D, 0, 0, 0, width, height, textureFormat, gl.FLOAT,\n data));\n\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n}\n\nexport function uploadMatrixToTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, rows: number,\n columns: number, matrix: Float32Array, numChannels: number,\n textureConfig: TextureConfig) {\n const [w, h] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n\n let unpackedArray: Float32Array;\n if (textureConfig.defaultNumChannels === 1) {\n // No need to allocate a temporary array.\n unpackedArray = matrix;\n } else {\n unpackedArray =\n new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(\n matrix.length, numChannels));\n tex_util.encodeMatrixToUnpackedArray(matrix, unpackedArray, numChannels);\n }\n\n uploadDataToTexture(\n gl, texture, w, h, unpackedArray, textureConfig.textureFormatFloat);\n}\n\nexport function uploadMatrixToPackedTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, rows: number,\n columns: number, matrix: Float32Array, textureConfig: TextureConfig) {\n const [w, h] = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n const packedRGBA = new Float32Array(\n tex_util.getPackedRGBAArraySizeFromMatrixShape(rows, columns));\n tex_util.encodeMatrixToPackedRGBA(matrix, rows, columns, packedRGBA);\n uploadDataToTexture(gl, texture, w, h, packedRGBA, gl.RGBA);\n}\n\nexport function maybeCreateBufferFromOutputTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, rows: number,\n columns: number, textureConfig: TextureConfig): WebGLBuffer|WebGLTexture {\n let bufferOrTexture: WebGLBuffer|WebGLTexture = texture;\n\n if (ENV.get('WEBGL_VERSION') === 2) {\n const gl2 = gl as WebGL2RenderingContext;\n\n // Create and bind the buffer.\n const buffer = gl2.createBuffer();\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer));\n\n // Initialize the buffer to the size of the texture in bytes.\n const bytesPerFloat = 4;\n const bufferSizeBytes = bytesPerFloat *\n tex_util.getUnpackedArraySizeFromMatrixSize(\n rows * columns, textureConfig.downloadUnpackNumChannels);\n\n webgl_util.callAndCheck(\n gl,\n () => gl.bufferData(\n gl2.PIXEL_PACK_BUFFER, bufferSizeBytes, gl.STATIC_DRAW));\n\n // Enqueue a command on the GPU command queue to copy of texture into the\n // buffer.\n webgl_util.callAndCheck(\n gl, () => gl2.readPixels(0, 0, columns, rows, gl.RGBA, gl.FLOAT, 0));\n\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl2.PIXEL_PACK_BUFFER, null));\n\n bufferOrTexture = buffer;\n }\n\n return bufferOrTexture;\n}\n\nexport function downloadFloat32MatrixFromBuffer(\n gl: WebGLRenderingContext, buffer: WebGLBuffer, rows: number,\n columns: number, textureConfig: TextureConfig): Float32Array {\n const gl2 = gl as WebGL2RenderingContext;\n\n const downloadTarget =\n new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(\n rows * columns, textureConfig.downloadUnpackNumChannels));\n\n gl2.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl2.getBufferSubData(gl.ARRAY_BUFFER, 0, downloadTarget);\n gl2.bindBuffer(gl.ARRAY_BUFFER, null);\n\n const matrix = new Float32Array(rows * columns);\n tex_util.decodeMatrixFromUnpackedArray(\n downloadTarget as Float32Array, matrix,\n textureConfig.downloadUnpackNumChannels);\n\n return matrix;\n}\n\nexport function downloadFloat32MatrixFromOutputTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): Float32Array {\n const [w, h] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n\n const downloadTarget =\n new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(\n rows * columns, textureConfig.downloadUnpackNumChannels));\n\n webgl_util.callAndCheck(\n gl,\n () => gl.readPixels(\n 0, 0, w, h, textureConfig.downloadTextureFormat, gl.FLOAT,\n downloadTarget));\n\n const matrix = new Float32Array(rows * columns);\n tex_util.decodeMatrixFromUnpackedArray(\n downloadTarget as Float32Array, matrix,\n textureConfig.downloadUnpackNumChannels);\n return matrix;\n}\n\nexport function downloadByteEncodedFloatMatrixFromOutputTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig) {\n const [w, h] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n\n const numChannels = 4;\n const downloadTarget = new Uint8Array(\n tex_util.getUnpackedArraySizeFromMatrixSize(rows * columns, numChannels));\n\n webgl_util.callAndCheck(\n gl,\n () => gl.readPixels(\n 0, 0, w, h, textureConfig.downloadTextureFormat, gl.UNSIGNED_BYTE,\n downloadTarget));\n\n // By wrapping the buffer in a Float32Array, we use native browser IEEE 754\n // decoding of the 4 bytes that back each 32 bit float.\n return new Float32Array(downloadTarget.buffer);\n}\n\nexport function downloadMatrixFromPackedOutputTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): Float32Array {\n const [w, h] = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n const packedRGBA = new Float32Array(\n tex_util.getPackedRGBAArraySizeFromMatrixShape(rows, columns));\n webgl_util.callAndCheck(\n gl, () => gl.readPixels(0, 0, w, h, gl.RGBA, gl.FLOAT, packedRGBA));\n const matrix = new Float32Array(rows * columns);\n return tex_util.decodeMatrixFromPackedRGBA(packedRGBA, rows, columns, matrix);\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../../environment';\nimport * as util from '../../util';\nimport * as gpgpu_util from './gpgpu_util';\nimport {TextureConfig} from './gpgpu_util';\nimport * as tex_util from './tex_util';\nimport {WebGL1DisjointQueryTimerExtension, WebGL2DisjointQueryTimerExtension} from './webgl_types';\nimport * as webgl_util from './webgl_util';\n\nexport interface FenceContext {\n query: WebGLQuery|WebGLSync;\n isFencePassed(): boolean;\n}\n\nexport class GPGPUContext {\n gl: WebGLRenderingContext;\n textureFloatExtension: {};\n textureHalfFloatExtension: {};\n colorBufferFloatExtension: {};\n colorBufferHalfFloatExtension: {};\n getBufferSubDataAsyncExtension: {};\n loseContextExtension: WebGLLoseContext;\n disjointQueryTimerExtension: WebGL2DisjointQueryTimerExtension|\n WebGL1DisjointQueryTimerExtension;\n vertexBuffer: WebGLBuffer;\n indexBuffer: WebGLBuffer;\n framebuffer: WebGLFramebuffer;\n outputTexture: WebGLTexture|null = null;\n program: WebGLProgram|null = null;\n private disposed = false;\n private autoDebugValidate = false;\n private disjoint: boolean;\n\n private textureConfig: TextureConfig;\n\n constructor(gl?: WebGLRenderingContext) {\n if (gl != null) {\n this.gl = gl;\n } else {\n this.gl = gpgpu_util.createWebGLContext();\n }\n // WebGL 2.0 enables texture floats without an extension.\n if (ENV.get('WEBGL_VERSION') === 1) {\n this.textureFloatExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'OES_texture_float');\n this.colorBufferFloatExtension =\n this.gl.getExtension('WEBGL_color_buffer_float');\n\n if (!ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) {\n this.textureHalfFloatExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'OES_texture_half_float');\n this.colorBufferHalfFloatExtension =\n this.gl.getExtension('EXT_color_buffer_half_float');\n }\n } else {\n this.colorBufferFloatExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'EXT_color_buffer_float');\n }\n\n this.loseContextExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'WEBGL_lose_context') as\n WebGLLoseContext;\n\n this.vertexBuffer = gpgpu_util.createVertexBuffer(this.gl);\n this.indexBuffer = gpgpu_util.createIndexBuffer(this.gl);\n this.framebuffer = webgl_util.createFramebuffer(this.gl);\n\n this.textureConfig =\n gpgpu_util.getTextureConfig(this.gl, this.textureHalfFloatExtension);\n }\n\n public dispose() {\n if (this.disposed) {\n return;\n }\n if (this.program != null) {\n console.warn(\n 'Disposing a GPGPUContext that still has a bound WebGLProgram.' +\n ' This is probably a resource leak, delete the program with ' +\n 'GPGPUContext.deleteProgram before disposing.');\n }\n if (this.outputTexture != null) {\n console.warn(\n 'Disposing a GPGPUContext that still has a bound output matrix ' +\n 'texture. This is probably a resource leak, delete the output ' +\n 'matrix texture with GPGPUContext.deleteMatrixTexture before ' +\n 'disposing.');\n }\n const gl = this.gl;\n webgl_util.callAndCheck(gl, () => gl.finish());\n webgl_util.callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, null));\n webgl_util.callAndCheck(gl, () => gl.deleteFramebuffer(this.framebuffer));\n webgl_util.callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, null));\n webgl_util.callAndCheck(gl, () => gl.deleteBuffer(this.vertexBuffer));\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null));\n webgl_util.callAndCheck(gl, () => gl.deleteBuffer(this.indexBuffer));\n this.loseContextExtension.loseContext();\n this.disposed = true;\n }\n\n public enableAutomaticDebugValidation(enabled: boolean) {\n this.autoDebugValidate = enabled;\n webgl_util.enableDebugWebGLErrorChecking(enabled);\n }\n\n public createFloat32MatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createFloat32MatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public createFloat16MatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createFloat16MatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public createUnsignedBytesMatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createUnsignedBytesMatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public uploadPixelDataToTexture(\n texture: WebGLTexture,\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement) {\n this.throwIfDisposed();\n gpgpu_util.uploadPixelDataToTexture(this.gl, texture, pixels);\n }\n\n public createPackedMatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createPackedMatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public deleteMatrixTexture(texture: WebGLTexture) {\n this.throwIfDisposed();\n if (this.outputTexture === texture) {\n webgl_util.unbindColorTextureFromFramebuffer(this.gl, this.framebuffer);\n this.outputTexture = null;\n }\n webgl_util.callAndCheck(this.gl, () => this.gl.deleteTexture(texture));\n }\n\n public uploadMatrixToTexture(\n texture: WebGLTexture, rows: number, columns: number,\n matrix: Float32Array) {\n this.throwIfDisposed();\n const numChannels = webgl_util.getNumChannels();\n return gpgpu_util.uploadMatrixToTexture(\n this.gl, texture, rows, columns, matrix, numChannels,\n this.textureConfig);\n }\n\n public uploadMatrixToPackedTexture(\n texture: WebGLTexture, rows: number, columns: number,\n matrix: Float32Array) {\n this.throwIfDisposed();\n return gpgpu_util.uploadMatrixToPackedTexture(\n this.gl, texture, rows, columns, matrix, this.textureConfig);\n }\n\n public downloadFloat32MatrixFromOutputTexture(\n texture: WebGLTexture, rows: number, columns: number): Float32Array {\n return this.downloadMatrixDriver(\n texture,\n () => gpgpu_util.downloadFloat32MatrixFromOutputTexture(\n this.gl, rows, columns, this.textureConfig));\n }\n\n public downloadByteEncodedFloatMatrixFromOutputTexture(\n texture: WebGLTexture, rows: number, columns: number): Float32Array {\n return this.downloadMatrixDriver(\n texture,\n () => gpgpu_util.downloadByteEncodedFloatMatrixFromOutputTexture(\n this.gl, rows, columns, this.textureConfig));\n }\n\n public downloadFloat32MatrixFromBuffer(\n buffer: WebGLBuffer, rows: number, columns: number): Float32Array {\n return gpgpu_util.downloadFloat32MatrixFromBuffer(\n this.gl, buffer, rows, columns, this.textureConfig);\n }\n\n public maybeCreateBufferFromTexture(\n texture: WebGLTexture, rows: number, columns: number): WebGLBuffer\n |WebGLTexture {\n this.bindTextureToFrameBuffer(texture);\n const result = gpgpu_util.maybeCreateBufferFromOutputTexture(\n this.gl, texture, rows, columns, this.textureConfig);\n this.unbindTextureToFrameBuffer();\n return result;\n }\n\n public createAndWaitForFence(): Promise {\n const fenceContext = this.createFence(this.gl);\n return this.pollFence(fenceContext);\n }\n\n private createFence(gl: WebGLRenderingContext): FenceContext {\n let query: WebGLQuery|WebGLSync;\n let isFencePassed: () => boolean;\n\n if (ENV.get('WEBGL_FENCE_API_ENABLED')) {\n const gl2 = gl as WebGL2RenderingContext;\n\n const sync = gl2.fenceSync(gl2.SYNC_GPU_COMMANDS_COMPLETE, 0);\n gl.flush();\n\n isFencePassed = () => {\n const status = gl2.clientWaitSync(sync, 0, 0);\n return status === gl2.ALREADY_SIGNALED ||\n status === gl2.CONDITION_SATISFIED;\n };\n\n query = sync;\n } else if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n query = this.beginQuery();\n this.endQuery();\n isFencePassed = () => this.isQueryAvailable(\n query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'));\n } else {\n // If we have no way to fence, return true immediately. This will fire in\n // WebGL 1.0 when there is no disjoint query timer. In this case, because\n // the fence passes immediately, we'll immediately ask for a download of\n // the texture, which will cause the UI thread to hang.\n isFencePassed = () => true;\n }\n\n return {query, isFencePassed};\n }\n\n public downloadMatrixFromPackedTexture(\n texture: WebGLTexture, rows: number, columns: number): Float32Array {\n return this.downloadMatrixDriver(\n texture,\n () => gpgpu_util.downloadMatrixFromPackedOutputTexture(\n this.gl, rows, columns, this.textureConfig));\n }\n\n private vertexAttrsAreBound = false;\n\n public createProgram(fragmentShaderSource: string): WebGLProgram {\n this.throwIfDisposed();\n const gl = this.gl;\n const fragmentShader: WebGLShader =\n webgl_util.createFragmentShader(gl, fragmentShaderSource);\n const vertexShader: WebGLShader = gpgpu_util.createVertexShader(gl);\n const program: WebGLProgram = webgl_util.createProgram(gl);\n webgl_util.callAndCheck(gl, () => gl.attachShader(program, vertexShader));\n webgl_util.callAndCheck(gl, () => gl.attachShader(program, fragmentShader));\n webgl_util.linkProgram(gl, program);\n if (this.autoDebugValidate) {\n webgl_util.validateProgram(gl, program);\n }\n if (!this.vertexAttrsAreBound) {\n this.setProgram(program);\n this.vertexAttrsAreBound = gpgpu_util.bindVertexProgramAttributeStreams(\n gl, this.program, this.vertexBuffer);\n }\n return program;\n }\n\n public deleteProgram(program: WebGLProgram) {\n this.throwIfDisposed();\n if (program === this.program) {\n this.program = null;\n }\n if (program != null) {\n webgl_util.callAndCheck(this.gl, () => this.gl.deleteProgram(program));\n }\n }\n\n public setProgram(program: WebGLProgram|null) {\n this.throwIfDisposed();\n this.program = program;\n if ((this.program != null) && this.autoDebugValidate) {\n webgl_util.validateProgram(this.gl, this.program);\n }\n webgl_util.callAndCheck(this.gl, () => this.gl.useProgram(program));\n }\n\n public getUniformLocation(\n program: WebGLProgram, uniformName: string,\n shouldThrow = true): WebGLUniformLocation {\n this.throwIfDisposed();\n if (shouldThrow) {\n return webgl_util.getProgramUniformLocationOrThrow(\n this.gl, program, uniformName);\n } else {\n return webgl_util.getProgramUniformLocation(\n this.gl, program, uniformName);\n }\n }\n\n public getAttributeLocation(program: WebGLProgram, attribute: string):\n number {\n this.throwIfDisposed();\n return webgl_util.callAndCheck(\n this.gl, () => this.gl.getAttribLocation(program, attribute));\n }\n\n public getUniformLocationNoThrow(program: WebGLProgram, uniformName: string):\n WebGLUniformLocation {\n this.throwIfDisposed();\n return this.gl.getUniformLocation(program, uniformName);\n }\n\n public setInputMatrixTexture(\n inputMatrixTexture: WebGLTexture, uniformLocation: WebGLUniformLocation,\n textureUnit: number) {\n this.throwIfDisposed();\n this.throwIfNoProgram();\n webgl_util.bindTextureToProgramUniformSampler(\n this.gl, this.program, inputMatrixTexture, uniformLocation,\n textureUnit);\n }\n\n public setOutputMatrixTexture(\n outputMatrixTexture: WebGLTexture, rows: number, columns: number) {\n this.setOutputMatrixTextureDriver(outputMatrixTexture, columns, rows);\n }\n\n public setOutputPackedMatrixTexture(\n outputPackedMatrixTexture: WebGLTexture, rows: number, columns: number) {\n this.throwIfDisposed();\n const [width, height] =\n tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n this.setOutputMatrixTextureDriver(outputPackedMatrixTexture, width, height);\n }\n\n public setOutputMatrixWriteRegion(\n startRow: number, numRows: number, startColumn: number,\n numColumns: number) {\n this.setOutputMatrixWriteRegionDriver(\n startColumn, startRow, numColumns, numRows);\n }\n\n public setOutputPackedMatrixWriteRegion(\n startRow: number, numRows: number, startColumn: number,\n numColumns: number) {\n throw new Error('setOutputPackedMatrixWriteRegion not implemented.');\n }\n\n public debugValidate() {\n if (this.program != null) {\n webgl_util.validateProgram(this.gl, this.program);\n }\n webgl_util.validateFramebuffer(this.gl);\n }\n\n public executeProgram() {\n this.throwIfDisposed();\n this.throwIfNoProgram();\n const gl = this.gl;\n if (this.autoDebugValidate) {\n this.debugValidate();\n }\n webgl_util.callAndCheck(\n gl, () => gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0));\n }\n\n public blockUntilAllProgramsCompleted() {\n this.throwIfDisposed();\n webgl_util.callAndCheck(this.gl, () => this.gl.finish());\n }\n\n private getQueryTimerExtension(): WebGL1DisjointQueryTimerExtension\n |WebGL2DisjointQueryTimerExtension {\n if (this.disjointQueryTimerExtension == null) {\n this.disjointQueryTimerExtension =\n webgl_util.getExtensionOrThrow(\n this.gl,\n ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2 ?\n 'EXT_disjoint_timer_query_webgl2' :\n 'EXT_disjoint_timer_query') as\n WebGL1DisjointQueryTimerExtension |\n WebGL2DisjointQueryTimerExtension;\n }\n return this.disjointQueryTimerExtension;\n }\n\n private getQueryTimerExtensionWebGL2(): WebGL2DisjointQueryTimerExtension {\n return this.getQueryTimerExtension();\n }\n\n private getQueryTimerExtensionWebGL1(): WebGL1DisjointQueryTimerExtension {\n return this.getQueryTimerExtension() as WebGL1DisjointQueryTimerExtension;\n }\n\n beginQuery(): WebGLQuery {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.getQueryTimerExtensionWebGL2();\n\n const query = gl2.createQuery();\n gl2.beginQuery(ext.TIME_ELAPSED_EXT, query);\n return query;\n }\n const ext = this.getQueryTimerExtensionWebGL1();\n const query = ext.createQueryEXT();\n ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);\n return query;\n }\n\n endQuery() {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.getQueryTimerExtensionWebGL2();\n gl2.endQuery(ext.TIME_ELAPSED_EXT);\n return;\n }\n const ext = this.getQueryTimerExtensionWebGL1();\n ext.endQueryEXT(ext.TIME_ELAPSED_EXT);\n }\n\n public async waitForQueryAndGetTime(query: WebGLQuery): Promise {\n await util.repeatedTry(\n () => this.isQueryAvailable(\n query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')));\n return this.getQueryTime(\n query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'));\n }\n\n private getQueryTime(query: WebGLQuery, queryTimerVersion: number): number {\n if (queryTimerVersion === 0) {\n return null;\n }\n\n if (queryTimerVersion === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n\n const timeElapsedNanos = gl2.getQueryParameter(query, gl2.QUERY_RESULT);\n // Return milliseconds.\n return timeElapsedNanos / 1000000;\n } else {\n const ext = this.getQueryTimerExtensionWebGL1();\n\n const timeElapsedNanos =\n ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT);\n // Return milliseconds.\n return timeElapsedNanos / 1000000;\n }\n }\n\n private isQueryAvailable(query: WebGLQuery, queryTimerVersion: number):\n boolean {\n if (queryTimerVersion === 0) {\n return true;\n }\n\n if (queryTimerVersion === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.getQueryTimerExtensionWebGL2();\n\n const available =\n gl2.getQueryParameter(query, gl2.QUERY_RESULT_AVAILABLE);\n if (this.disjoint == null) {\n this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT);\n }\n\n return available && !this.disjoint;\n } else {\n const ext = this.getQueryTimerExtensionWebGL1();\n\n const available =\n ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT);\n if (this.disjoint == null) {\n this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT);\n }\n\n return available && !this.disjoint;\n }\n }\n\n pollFence(fenceContext: FenceContext) {\n return new Promise(resolve => {\n this.addItemToPoll(() => fenceContext.isFencePassed(), () => resolve());\n });\n }\n\n private itemsToPoll: PollItem[] = [];\n\n pollItems(): void {\n // Find the last query that has finished using binary search.\n // All other queries before it are also done.\n const index = binSearchLastTrue(this.itemsToPoll.map(x => x.isDoneFn));\n for (let i = 0; i <= index; ++i) {\n const {resolveFn} = this.itemsToPoll[i];\n resolveFn();\n }\n this.itemsToPoll = this.itemsToPoll.slice(index + 1);\n }\n\n private addItemToPoll(isDoneFn: () => boolean, resolveFn: () => void) {\n this.itemsToPoll.push({isDoneFn, resolveFn});\n if (this.itemsToPoll.length > 1) {\n // We already have a running loop that polls.\n return;\n }\n // Start a new loop that polls.\n util.repeatedTry(() => {\n this.pollItems();\n // End the loop if no more items to poll.\n return this.itemsToPoll.length === 0;\n });\n }\n private bindTextureToFrameBuffer(texture: WebGLTexture) {\n this.throwIfDisposed();\n webgl_util.bindColorTextureToFramebuffer(\n this.gl, texture, this.framebuffer);\n if (this.autoDebugValidate) {\n webgl_util.validateFramebuffer(this.gl);\n }\n }\n\n private unbindTextureToFrameBuffer() {\n if (this.outputTexture != null) {\n webgl_util.bindColorTextureToFramebuffer(\n this.gl, this.outputTexture, this.framebuffer);\n if (this.autoDebugValidate) {\n webgl_util.validateFramebuffer(this.gl);\n }\n } else {\n webgl_util.unbindColorTextureFromFramebuffer(this.gl, this.framebuffer);\n }\n }\n\n private downloadMatrixDriver(\n texture: WebGLTexture,\n downloadAndDecode: () => Float32Array): Float32Array {\n this.bindTextureToFrameBuffer(texture);\n const result = downloadAndDecode();\n this.unbindTextureToFrameBuffer();\n\n return result;\n }\n\n private setOutputMatrixTextureDriver(\n outputMatrixTextureMaybePacked: WebGLTexture, width: number,\n height: number) {\n this.throwIfDisposed();\n const gl = this.gl;\n webgl_util.bindColorTextureToFramebuffer(\n gl, outputMatrixTextureMaybePacked, this.framebuffer);\n if (this.autoDebugValidate) {\n webgl_util.validateFramebuffer(gl);\n }\n this.outputTexture = outputMatrixTextureMaybePacked;\n webgl_util.callAndCheck(gl, () => gl.viewport(0, 0, width, height));\n webgl_util.callAndCheck(gl, () => gl.scissor(0, 0, width, height));\n }\n\n private setOutputMatrixWriteRegionDriver(\n x: number, y: number, width: number, height: number) {\n this.throwIfDisposed();\n webgl_util.callAndCheck(\n this.gl, () => this.gl.scissor(x, y, width, height));\n }\n\n private throwIfDisposed() {\n if (this.disposed) {\n throw new Error('Attempted to use disposed GPGPUContext.');\n }\n }\n\n private throwIfNoProgram() {\n if (this.program == null) {\n throw new Error('No GPU program is currently set.');\n }\n }\n}\n\ntype PollItem = {\n isDoneFn: () => boolean,\n resolveFn: () => void\n};\n\n/**\n * Finds the index of the last true element using binary search where\n * evaluation of an entry is expensive.\n */\nexport function binSearchLastTrue(arr: Array<() => boolean>): number {\n let start = 0;\n let end = arr.length - 1;\n let best = -1;\n while (start <= end) {\n const mid = (start + end) >> 1;\n const isDone = arr[mid]();\n if (isDone) {\n best = mid;\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n return best;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../../tensor';\nimport * as util from '../../util';\n\nimport {GPGPUContext} from './gpgpu_context';\nimport * as shader_compiler from './shader_compiler';\nimport {InputInfo, ShapeInfo} from './shader_compiler';\nimport {TextureData} from './tex_util';\n\nexport interface GPGPUProgram {\n variableNames: string[];\n outputShape: number[];\n userCode: string;\n supportsBroadcasting?: boolean;\n}\n\nexport interface GPGPUBinary {\n webGLProgram: WebGLProgram;\n program: GPGPUProgram;\n uniformLocations: {[name: string]: WebGLUniformLocation};\n gpgpu: GPGPUContext;\n source: string;\n inShapeInfos: ShapeInfo[];\n outShapeInfo: ShapeInfo;\n}\n\nexport interface TensorData {\n tensor: T;\n texData: TextureData;\n isUniform: boolean;\n}\n\nexport function compileProgram(\n gpgpu: GPGPUContext, program: GPGPUProgram, inputs: Array>,\n output: TensorData): GPGPUBinary {\n const userCode = program.userCode;\n const inputInfos: InputInfo[] = inputs.map((input, i) => {\n const shapeInfo = {\n logicalShape: input.tensor.shape,\n texShape: input.isUniform ? null : input.texData.texShape,\n isUniform: input.isUniform\n };\n return {name: program.variableNames[i], shapeInfo};\n });\n const inShapeInfos = inputInfos.map(x => x.shapeInfo);\n const outShapeInfo = {\n logicalShape: output.tensor.shape,\n texShape: output.texData.texShape,\n isUniform: false\n };\n const source = shader_compiler.makeShader(\n inputInfos, outShapeInfo, userCode,\n program.supportsBroadcasting === true);\n\n const webGLProgram = gpgpu.createProgram(source);\n\n const uniformLocations: {[name: string]: WebGLUniformLocation} = {};\n for (let i = 0; i < program.variableNames.length; i++) {\n const uniformName = program.variableNames[i];\n const shouldThrow = false;\n uniformLocations[uniformName] =\n gpgpu.getUniformLocation(webGLProgram, uniformName, shouldThrow);\n }\n\n return {\n program,\n source,\n webGLProgram,\n uniformLocations,\n gpgpu,\n inShapeInfos,\n outShapeInfo\n };\n}\n\nfunction validateBinaryAndProgram(\n shapeInfos: ShapeInfo[], inputs: Array>) {\n if (shapeInfos.length !== inputs.length) {\n throw Error(\n `Binary was compiled with ${shapeInfos.length} inputs, but ` +\n `was executed with ${inputs.length} inputs`);\n }\n\n shapeInfos.forEach((s, i) => {\n const shapeA = s.logicalShape;\n const input = inputs[i];\n const shapeB = input.tensor.shape;\n\n if (!util.arraysEqual(shapeA, shapeB)) {\n throw Error(\n `Binary was compiled with different shapes than ` +\n `the current args. Shapes ${shapeA} and ${shapeB} must match`);\n }\n // The input is uploaded as uniform.\n if (s.isUniform && input.isUniform) {\n return;\n }\n\n const texShapeA = s.texShape;\n const texShapeB = input.isUniform ? null : input.texData.texShape;\n if (!util.arraysEqual(texShapeA, texShapeB)) {\n throw Error(\n `Binary was compiled with different texture shapes than the` +\n ` current args. Shape ${texShapeA} and ${texShapeB} must match`);\n }\n });\n}\n\nexport function runProgram(\n binary: GPGPUBinary, inputs: Array>, output: TensorData,\n customSetup?: (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) =>\n void): void {\n validateBinaryAndProgram(binary.inShapeInfos, inputs);\n validateBinaryAndProgram([binary.outShapeInfo], [output]);\n\n const outTex = output.texData.texture;\n const outTexShape = output.texData.texShape;\n const gpgpu = binary.gpgpu;\n gpgpu.setOutputMatrixTexture(outTex, outTexShape[0], outTexShape[1]);\n gpgpu.setProgram(binary.webGLProgram);\n inputs.forEach((input, i) => {\n const variableName = binary.program.variableNames[i];\n const variableUniformLocation = binary.uniformLocations[variableName];\n if (variableUniformLocation != null) {\n if (input.isUniform) {\n if (input.tensor.size === 1) {\n gpgpu.gl.uniform1f(\n variableUniformLocation, input.tensor.dataSync()[0]);\n } else {\n let vals = input.tensor.dataSync();\n if (!(vals instanceof Float32Array)) {\n vals = new Float32Array(vals);\n }\n gpgpu.gl.uniform1fv(variableUniformLocation, vals);\n }\n return;\n }\n const tex = input.texData.texture;\n gpgpu.setInputMatrixTexture(tex, variableUniformLocation, i);\n }\n });\n\n if (customSetup != null) {\n customSetup(gpgpu, binary.webGLProgram);\n }\n gpgpu.executeProgram();\n}\n\nexport function makeShaderKey(\n program: GPGPUProgram, inputs: Array>,\n output: TensorData): string {\n let keyInputs = '';\n inputs.concat(output).forEach(x => {\n keyInputs +=\n `${x.tensor.shape}_${x.isUniform ? 'uniform' : x.texData.texShape}`;\n });\n const keyUserCode = program.userCode;\n const keyBroadcast = (program.supportsBroadcasting === true).toString();\n let key = program.constructor.name;\n // Fast string concat. See https://jsperf.com/string-concatenation/14.\n key += '_' + keyBroadcast + '_' + keyInputs + '_' + keyUserCode;\n return key;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class LRNProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(\n xShape: number[], radius: number, bias: number, alpha: number,\n beta: number) {\n const rad = radius;\n const maxD = xShape[3] - 1;\n this.outputShape = xShape;\n\n // optimize pow(bias + alpha * sum, -beta)\n // src: https://github.com/tensorflow/tensorflow/..\n // blob/26033a1644a9c4a5fbe3170ab2e864b6a4ccd4ca/..\n // tensorflow/core/kernels/mkl_lrn_op.cc#L320\n let powOperator;\n const basis = `float(${bias}) + float(${alpha}) * sum`;\n if (beta === 0.5) {\n powOperator = `inversesqrt(${basis})`;\n } else if (beta === 1.0) {\n powOperator = `1.0/(${basis})`;\n } else {\n powOperator = `exp(log(${basis}) * float(-${beta}));`;\n }\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${rad}; j <= ${rad}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${maxD}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${powOperator};\n setOutput(val);\n }\n `;\n }\n}\n","import {GPGPUProgram} from './gpgpu_math';\n\nexport class LRNGradProgram implements GPGPUProgram {\n variableNames = ['inputImage', 'outputImage', 'dy'];\n outputShape: number[] = [];\n userCode: string;\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n depth: number;\n\n constructor(\n inputShape: number[], depthRadius: number, bias: number, alpha: number,\n beta: number) {\n this.outputShape = inputShape;\n this.depth = inputShape[3];\n this.depthRadius = depthRadius;\n this.bias = bias;\n this.alpha = alpha;\n this.beta = beta;\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${depthRadius})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${depthRadius} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${alpha}) * norm + float(${bias});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${alpha})\n * float(${beta})\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${beta});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class MaxPool2DBackpropProgram implements GPGPUProgram {\n variableNames = ['dy', 'maxPos'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n\n const lastIndex = filterHeight * filterWidth - 1;\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${lastIndex} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${filterWidth} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class MatMulProgram implements GPGPUProgram {\n variableNames = ['matrixA', 'matrixB'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n aShape: [number, number], bShape: [number, number], transposeA = false,\n transposeB = false) {\n const outerShapeA = transposeA ? aShape[1] : aShape[0];\n const outerShapeB = transposeB ? bShape[0] : bShape[1];\n const sharedDim = transposeA ? aShape[0] : aShape[1];\n this.outputShape = [outerShapeA, outerShapeB];\n\n const aSnippetFromOffset = (vec4Offset: number, indexVar: string|number) =>\n transposeA ? `${indexVar} + ${vec4Offset}, aRow` :\n `aRow, ${indexVar} + ${vec4Offset}`;\n const bSnippetFromOffset = (vec4Offset: number, indexVar: string|number) =>\n transposeB ? `bCol, ${indexVar} + ${vec4Offset}` :\n `${indexVar} + ${vec4Offset}, bCol`;\n\n const sharedDimNearestVec4 = Math.floor(sharedDim / 4) * 4;\n const sharedDimVec4Remainder = sharedDim % 4;\n\n this.userCode = ` float dotARowBCol(int aRow, int bCol) {\n float result = 0.0;\n for (int i = 0; i < ${sharedDimNearestVec4}; i += 4) {\n vec4 a = vec4(\n getMatrixA(${aSnippetFromOffset(0, 'i')}),\n getMatrixA(${aSnippetFromOffset(1, 'i')}),\n getMatrixA(${aSnippetFromOffset(2, 'i')}),\n getMatrixA(${aSnippetFromOffset(3, 'i')})\n );\n vec4 b = vec4(\n getMatrixB(${bSnippetFromOffset(0, 'i')}),\n getMatrixB(${bSnippetFromOffset(1, 'i')}),\n getMatrixB(${bSnippetFromOffset(2, 'i')}),\n getMatrixB(${bSnippetFromOffset(3, 'i')})\n );\n\n result += dot(a, b);\n }\n\n if (${sharedDimVec4Remainder === 1}) {\n result += getMatrixA(${aSnippetFromOffset(0, sharedDimNearestVec4)}) *\n getMatrixB(${bSnippetFromOffset(0, sharedDimNearestVec4)});\n } else if (${sharedDimVec4Remainder === 2}) {\n vec2 a = vec2(\n getMatrixA(${aSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixA(${aSnippetFromOffset(1, sharedDimNearestVec4)})\n );\n vec2 b = vec2(\n getMatrixB(${bSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixB(${bSnippetFromOffset(1, sharedDimNearestVec4)})\n );\n result += dot(a, b);\n } else if (${sharedDimVec4Remainder === 3}) {\n vec3 a = vec3(\n getMatrixA(${aSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixA(${aSnippetFromOffset(1, sharedDimNearestVec4)}),\n getMatrixA(${aSnippetFromOffset(2, sharedDimNearestVec4)})\n );\n vec3 b = vec3(\n getMatrixB(${bSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixB(${bSnippetFromOffset(1, sharedDimNearestVec4)}),\n getMatrixB(${bSnippetFromOffset(2, sharedDimNearestVec4)})\n );\n result += dot(a, b);\n }\n\n return result;\n }\n\n void main() {\n ivec2 resRC = getOutputCoords();\n setOutput(dotARowBCol(resRC.x, resRC.y));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class MultinomialProgram implements GPGPUProgram {\n variableNames = ['probs'];\n outputShape: number[];\n userCode: string;\n\n // Caching uniform location for speed.\n seedLoc: WebGLUniformLocation;\n\n constructor(batchSize: number, numOutcomes: number, numSamples: number) {\n this.outputShape = [batchSize, numSamples];\n\n this.userCode = `\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${numOutcomes - 1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${numOutcomes - 1}));\n }\n `;\n }\n\n getCustomSetupFunc(seed: number) {\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.seedLoc == null) {\n this.seedLoc = gpgpu.getUniformLocation(webGLProgram, 'seed');\n }\n gpgpu.gl.uniform1f(this.seedLoc, seed);\n };\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class OneHotProgram implements GPGPUProgram {\n variableNames = ['indices'];\n outputShape: number[];\n userCode: string;\n\n // Caching uniform location for speed.\n seedLoc: WebGLUniformLocation;\n\n constructor(\n numIndices: number, depth: number, onValue: number, offValue: number) {\n this.outputShape = [numIndices, depth];\n\n this.userCode = `\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${offValue}), float(${onValue}),\n float(index == coords.y)));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class PadProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n xShape: number[], paddings: Array<[number, number]>,\n constantValue: number) {\n this.outputShape = paddings.map(\n (p, i) => p[0] /* beforePad */ + xShape[i] + p[1] /* afterPad */);\n const rank = xShape.length;\n const type = getCoordsDataType(rank);\n\n const start = paddings.map(p => p[0]).join(',');\n const end = paddings.map((p, i) => p[0] + xShape[i]).join(',');\n const unpackedCoords =\n ['coords[0]', 'coords[1]', 'coords[2]','coords[3]'].slice(0, rank);\n\n if (rank === 1) {\n this.userCode = `\n int start = ${start};\n int end = ${end};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float(${constantValue}));\n } else {\n setOutput(getX(outC - start));\n }\n }\n `;\n return;\n }\n this.userCode = `\n ${type} start = ${type}(${start});\n ${type} end = ${type}(${end});\n\n void main() {\n ${type} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float(${constantValue}));\n } else {\n ${type} coords = outC - start;\n setOutput(getX(${unpackedCoords}));\n }\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class Pool2DProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n convInfo: Conv2DInfo, poolType: 'max'|'avg', computePositions: boolean) {\n if (poolType === 'avg' && computePositions) {\n throw new Error('Cannot compute positions for average pool.');\n }\n\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n this.outputShape = convInfo.outShape;\n\n const isAvgPool = poolType === 'avg';\n\n let initializationValue = '0.0';\n if (!isAvgPool) {\n initializationValue = '-1.0 / 0.0';\n }\n\n if (computePositions) {\n const compareOp = '>=';\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${compareOp} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * ${filterWidth} + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `;\n return;\n }\n\n const compareOp = 'max';\n\n let returnValue = `${poolType}(${poolType}(${poolType}(` +\n 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])';\n if (poolType === 'avg') {\n returnValue = `avgValue / count`;\n }\n\n const filterWidthNearestVec4 = Math.floor(filterWidth / 4) * 4;\n const filterWidthVec4Remainder = filterWidth % 4;\n\n const updateSnippet = `\n if (${isAvgPool}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ${compareOp}(values, minMaxValue);\n }\n `;\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n const float initializationValue = ${initializationValue};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${initializationValue});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidthNearestVec4}; wC += 4) {\n int xC = xCCorner + wC;\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n getValue(batch, xR, xC + 3, d)\n );\n\n ${updateSnippet}\n }\n\n int xC = xCCorner + ${filterWidthNearestVec4};\n if (${filterWidthVec4Remainder === 1}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${filterWidthVec4Remainder === 2}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${filterWidthVec4Remainder === 3}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n initializationValue\n );\n\n ${updateSnippet}\n }\n }\n setOutput(${returnValue});\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ReduceInfo} from '../../ops/reduce_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ReduceProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n reduceInfo: ReduceInfo, reduceType: 'all'|'any'|'max'|'min'|'sum') {\n const windowSize = reduceInfo.windowSize;\n const batchSize = reduceInfo.batchSize;\n const inSize = reduceInfo.inSize;\n const outSize = Math.ceil(inSize / windowSize);\n this.outputShape = [batchSize, outSize];\n\n let initializationValue = '0.0';\n let compareOp = ``;\n\n if (reduceType === 'min') {\n initializationValue = '1.0 / 0.0';\n compareOp = `min`;\n } else if (reduceType === 'max') {\n initializationValue = '-1.0 / 0.0';\n compareOp = `max`;\n }\n\n let returnValue = `${reduceType}(${reduceType}(${reduceType}(` +\n 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])';\n\n if (reduceType === 'sum') {\n returnValue = `sumValue`;\n } else if (reduceType === 'all') {\n returnValue = `allValue`;\n } else if (reduceType === 'any') {\n returnValue = `anyValue`;\n }\n\n const windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4;\n const windowSizeVec4Remainder = windowSize % 4;\n\n let updateSnippet = `\n if (${reduceType === 'sum'}) {\n sumValue += dot(values, ones);\n } else {\n minMaxValue = ${compareOp}(values, minMaxValue);\n }\n `;\n\n let vecType = `vec4`;\n\n if (reduceType === 'all') {\n initializationValue = '1.0';\n updateSnippet = `\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n `;\n vecType = `bvec4`;\n } else if (reduceType === 'any') {\n initializationValue = '0.0';\n updateSnippet = `\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n `;\n vecType = `bvec4`;\n }\n\n let checkOutOfBounds = '';\n if (inSize % windowSize > 0) {\n checkOutOfBounds = `\n if (inIdx < 0 || inIdx >= ${inSize}) {\n return initializationValue;\n }\n `;\n }\n this.userCode = `\n const float initializationValue = ${initializationValue};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${checkOutOfBounds}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${windowSize};\n\n vec4 minMaxValue = vec4(${initializationValue});\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${windowSizeNearestVec4}; i += 4) {\n int inIdx = inOffset + i;\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${updateSnippet}\n }\n\n int inIdx = inOffset + ${windowSizeNearestVec4};\n if (${windowSizeVec4Remainder === 1}) {\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 2}) {\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 3}) {\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${updateSnippet}\n }\n setOutput(${returnValue});\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor4D} from '../../tensor';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeBilinearBackpropProgram implements GPGPUProgram {\n variableNames = ['dy'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n this.outputShape = x.shape;\n const [, xHeight, xWidth, ] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass and add the corresponding\n // coefficient from dy to the gradient (with some interpolation).\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n const invHeightScale = 1 / heightScale;\n const invWidthScale = 1 / widthScale;\n\n // This defines the size of the window of values around a particular\n // index in dy that we want to search for contributions to dx.\n const winHeight = (Math.ceil(invHeightScale) * 2) + 2;\n const winWidth = (Math.ceil(invWidthScale) * 2) + 2;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${heightScale});\n const float widthScale = float(${widthScale});\n\n const float invHeightScale = float(${invHeightScale});\n const float invWidthScale = float(${invWidthScale});\n\n const int winHeight = int(${winHeight});\n const int winWidth = int(${winWidth});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${yHeight}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${yWidth}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${xHeight - 1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${xWidth - 1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeBilinearProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(\n inputShape: [number, number, number, number], newHeight: number,\n newWidth: number, alignCorners: boolean) {\n const [batch, oldHeight, oldWidth, depth] = inputShape;\n this.outputShape = [batch, newHeight, newWidth, depth];\n\n const effectiveInSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n this.userCode = `\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${effectiveInSize[0] / effectiveOutSize[0]},\n ${effectiveInSize[1] / effectiveOutSize[1]});\n const vec2 inputShapeRC = vec2(${oldHeight}.0, ${oldWidth}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor4D} from '../../tensor';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeNearestNeigborBackpropProgram implements GPGPUProgram {\n variableNames = ['dy'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n this.outputShape = x.shape;\n const [, xHeight, xWidth, ] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass and add the corresponding\n // coefficient from dy to the gradient (with some interpolation).\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n const invHeightScale = 1 / heightScale;\n const invWidthScale = 1 / widthScale;\n\n // This defines the size of the window of values around a particular\n // index in dy that we want to search for contributions to dx.\n const winHeight = (Math.ceil(invHeightScale) * 2) + 2;\n const winWidth = (Math.ceil(invWidthScale) * 2) + 2;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${heightScale});\n const float widthScale = float(${widthScale});\n\n const float invHeightScale = float(${invHeightScale});\n const float invWidthScale = float(${invWidthScale});\n\n const int winHeight = int(${winHeight});\n const int winWidth = int(${winWidth});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${yHeight}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${yWidth}) {\n continue;\n }\n\n float sourceFracRow =\n float(${effectiveXSize[0]}) *\n (float(dyR) / float(${effectiveYSize[0]}));\n\n float sourceFracCol =\n float(${effectiveXSize[1]}) *\n (float(dyC) / float(${effectiveYSize[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${xHeight}) - 1),\n ${alignCorners} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${xWidth}) - 1),\n ${alignCorners} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeNearestNeighborProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(\n inputShape: [number, number, number, number], newHeight: number,\n newWidth: number, alignCorners: boolean) {\n const [batch, oldHeight, oldWidth, depth] = inputShape;\n this.outputShape = [batch, newHeight, newWidth, depth];\n\n const effectiveInSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n // When align corners is false, we rounds the value with floor.\n const roundBase = alignCorners ? '0.5' : '0.0';\n\n this.userCode = `\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${effectiveInSize[0] / effectiveOutSize[0]},\n ${effectiveInSize[1] / effectiveOutSize[1]});\n const vec2 inputShapeRC = vec2(${oldHeight}.0, ${oldWidth}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${roundBase})));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class ReverseProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(xShape: number[], axis: number[]) {\n const rank = xShape.length;\n if (rank > 4) {\n throw new Error(\n `WebGL backend: Reverse of rank-${rank} tensor is not yet supported`);\n }\n this.outputShape = xShape;\n\n if (rank === 1) {\n this.userCode = `\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${xShape[0]} - coord - 1));\n }\n `;\n return;\n }\n const getInCoord = (i: number) => {\n if (axis.indexOf(i) !== -1 && xShape[i] !== 1) {\n return `${xShape[i]} - coords[${i}] - 1`;\n }\n return `coords[${i}]`;\n };\n const inCoords = xShape.map((_, i) => getInCoord(i)).join(',');\n const type = getCoordsDataType(rank);\n\n this.userCode = `\n void main() {\n ${type} coords = getOutputCoords();\n setOutput(getX(${inCoords}));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {SegOpInfo} from '../../ops/segment_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class SegmentOpProgram implements GPGPUProgram {\n variableNames = ['x', 'segmentIds'];\n outputShape: number[];\n userCode: string;\n\n constructor(segOpInfo: SegOpInfo, segOpType: 'unsortedSegmentSum') {\n const windowSize = segOpInfo.windowSize;\n const batchSize = segOpInfo.batchSize;\n const inSize = segOpInfo.inSize;\n const numSegments = segOpInfo.numSegments;\n const outSize = numSegments * Math.ceil(inSize / windowSize);\n this.outputShape = [batchSize, outSize];\n\n const initializationValue = '0.0';\n const returnValue = `sumValue`;\n\n const windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4;\n const windowSizeVec4Remainder = windowSize % 4;\n\n const updateSnippet = `\n sumValue += dot(values, filter);\n `;\n\n let checkValueOutOfBounds = '';\n if (inSize % windowSize > 0) {\n checkValueOutOfBounds = `\n if (inIdx < 0 || inIdx >= ${inSize}) {\n return initializationValue;\n }\n `;\n }\n\n let checkSegmentIdOutOfBounds = '';\n if (inSize % windowSize > 0) {\n checkSegmentIdOutOfBounds = `\n if (inIdx < 0 || inIdx >= ${inSize}) {\n return -1.0;\n }\n `;\n }\n\n this.userCode = `\n const float initializationValue = ${initializationValue};\n\n float getValue(int batch, int inIdx) {\n ${checkValueOutOfBounds}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${checkSegmentIdOutOfBounds}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${numSegments})) * float(${windowSize}));\n int currentSeg = int(mod(float(outIdx), float(${numSegments})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${windowSizeNearestVec4}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${updateSnippet}\n }\n\n int inIdx = inOffset + ${windowSizeNearestVec4};\n if (${windowSizeVec4Remainder === 1}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 2}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 3}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${updateSnippet}\n }\n setOutput(${returnValue});\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class SelectProgram implements GPGPUProgram {\n variableNames = ['c', 'a', 'b'];\n outputShape: number[];\n userCode: string;\n\n constructor(cRank: number, shape: number[], rank: number) {\n this.outputShape = shape;\n\n let cCoords;\n let abCoords;\n if (rank > 4) {\n throw Error(`Where for rank ${rank} is not yet supported`);\n }\n\n if (rank === 1) {\n abCoords = `resRC`;\n cCoords = `resRC`;\n } else {\n const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w'];\n const cCoordVars = [];\n const abCoordVars = [];\n for (let i = 0; i < shape.length; i++) {\n abCoordVars.push(`${currentCoords[i]}`);\n if (i < cRank) {\n cCoordVars.push(`${currentCoords[i]}`);\n }\n }\n cCoords = cCoordVars.join();\n abCoords = abCoordVars.join();\n }\n\n const dtype = getCoordsDataType(rank);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n float cVal = getC(${cCoords});\n if (cVal >= 1.0) {\n setOutput(getA(${abCoords}));\n } else {\n setOutput(getB(${abCoords}));\n }\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class SliceProgram implements GPGPUProgram {\n variableNames = ['source'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n // Caching uniform location for speed.\n startLoc: WebGLUniformLocation;\n\n constructor(destSize: number[]) {\n this.outputShape = destSize;\n this.rank = destSize.length;\n\n const dtype = getCoordsDataType(this.rank);\n const sourceCoords = getCoords(this.rank);\n\n this.userCode = `\n uniform ${dtype} start;\n\n void main() {\n ${dtype} sourceLoc = start + getOutputCoords();\n setOutput(getSource(${sourceCoords}));\n }\n `;\n }\n\n getCustomSetupFunc(start: number[]) {\n if (start.length !== this.rank) {\n throw Error(\n `The rank (${this.rank}) of the program must match the ` +\n `length of start (${start.length})`);\n }\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.startLoc == null) {\n this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'start');\n if (this.startLoc == null) {\n // This means the compiler has optimized and realized it doesn't need\n // the uniform.\n return;\n }\n }\n if (this.rank === 1) {\n gpgpu.gl.uniform1i(this.startLoc, start[0]);\n } else if (this.rank === 2) {\n gpgpu.gl.uniform2i(this.startLoc, start[0], start[1]);\n } else if (this.rank === 3) {\n gpgpu.gl.uniform3i(this.startLoc, start[0], start[1], start[2]);\n } else if (this.rank === 4) {\n gpgpu.gl.uniform4i(\n this.startLoc, start[0], start[1], start[2], start[3]);\n } else {\n throw Error(`Slicing for rank ${this.rank} is not yet supported`);\n }\n };\n }\n}\n\nfunction getCoords(rank: number): string {\n if (rank === 1) {\n return 'sourceLoc';\n } else if (rank === 2) {\n return 'sourceLoc.x, sourceLoc.y';\n } else if (rank === 3) {\n return 'sourceLoc.x, sourceLoc.y, sourceLoc.z';\n } else if (rank === 4) {\n return 'sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w';\n } else {\n throw Error(`Slicing for rank ${rank} is not yet supported`);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class StridedSliceProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(begin: number[], strides: number[], shape: number[]) {\n this.outputShape = shape;\n this.rank = shape.length;\n const dtype = getCoordsDataType(this.rank);\n\n let newCoords = '';\n if (this.rank === 1) {\n newCoords = 'coords * strides + begin';\n } else {\n newCoords =\n shape.map((_, i) => `coords[${i}] * strides[${i}] + begin[${i}]`)\n .join(',');\n }\n\n this.userCode = `\n ${dtype} begin = ${dtype}(${begin});\n ${dtype} strides = ${dtype}(${strides});\n\n void main() {\n ${dtype} coords = getOutputCoords();\n setOutput(getX(${newCoords}));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../../environment';\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {PhysicalTextureType, TextureUsage} from './tex_util';\n\nexport class TextureManager {\n private numUsedTextures = 0;\n private numFreeTextures = 0;\n private freeTextures: {[shape: string]: WebGLTexture[]} = {};\n private logEnabled = false;\n private usedTextures: {[shape: string]: WebGLTexture[]} = {};\n\n constructor(private gpgpu: GPGPUContext) {}\n\n acquireTexture(shapeRC: [number, number], usage: TextureUsage): WebGLTexture {\n const physicalTexType = getPhysicalFromLogicalTextureType(usage);\n\n const shapeKey = getKeyFromTextureShape(shapeRC, physicalTexType);\n if (!(shapeKey in this.freeTextures)) {\n this.freeTextures[shapeKey] = [];\n }\n if (!(shapeKey in this.usedTextures)) {\n this.usedTextures[shapeKey] = [];\n }\n\n if (this.freeTextures[shapeKey].length > 0) {\n this.numFreeTextures--;\n this.numUsedTextures++;\n this.log();\n const newTexture = this.freeTextures[shapeKey].shift();\n this.usedTextures[shapeKey].push(newTexture);\n return newTexture;\n }\n this.numUsedTextures++;\n this.log();\n\n let newTexture: WebGLTexture;\n if (physicalTexType === PhysicalTextureType.FLOAT32) {\n newTexture =\n this.gpgpu.createFloat32MatrixTexture(shapeRC[0], shapeRC[1]);\n } else if (physicalTexType === PhysicalTextureType.FLOAT16) {\n newTexture =\n this.gpgpu.createFloat16MatrixTexture(shapeRC[0], shapeRC[1]);\n\n } else if (physicalTexType === PhysicalTextureType.UNSIGNED_BYTE) {\n newTexture =\n this.gpgpu.createUnsignedBytesMatrixTexture(shapeRC[0], shapeRC[1]);\n }\n this.usedTextures[shapeKey].push(newTexture);\n\n return newTexture;\n }\n\n releaseTexture(\n texture: WebGLTexture, shape: [number, number],\n logicalTexType: TextureUsage): void {\n const physicalTexType = getPhysicalFromLogicalTextureType(logicalTexType);\n const shapeKey = getKeyFromTextureShape(shape, physicalTexType);\n if (!(shapeKey in this.freeTextures)) {\n this.freeTextures[shapeKey] = [];\n }\n this.freeTextures[shapeKey].push(texture);\n this.numFreeTextures++;\n this.numUsedTextures--;\n const texList = this.usedTextures[shapeKey];\n const texIndex = texList.indexOf(texture);\n if (texIndex < 0) {\n throw new Error(\n 'Cannot release a texture that was never provided by this ' +\n 'texture manager');\n }\n texList.splice(texIndex, 1);\n this.log();\n }\n\n private log() {\n if (!this.logEnabled) {\n return;\n }\n const total = this.numFreeTextures + this.numUsedTextures;\n console.log(\n 'Free/Used', `${this.numFreeTextures} / ${this.numUsedTextures}`,\n `(${total})`);\n }\n\n getNumUsedTextures(): number {\n return this.numUsedTextures;\n }\n\n getNumFreeTextures(): number {\n return this.numFreeTextures;\n }\n\n dispose() {\n if (this.freeTextures == null) {\n // Already disposed.\n return;\n }\n for (const texShape in this.freeTextures) {\n this.freeTextures[texShape].forEach(tex => {\n this.gpgpu.deleteMatrixTexture(tex);\n });\n }\n for (const texShape in this.usedTextures) {\n this.usedTextures[texShape].forEach(tex => {\n this.gpgpu.deleteMatrixTexture(tex);\n });\n }\n this.freeTextures = null;\n this.usedTextures = null;\n this.numUsedTextures = 0;\n this.numFreeTextures = 0;\n }\n}\n\nfunction getPhysicalFromLogicalTextureType(logicalTexType: TextureUsage):\n PhysicalTextureType {\n if (logicalTexType === TextureUsage.DOWNLOAD ||\n logicalTexType === TextureUsage.PIXELS) {\n return PhysicalTextureType.UNSIGNED_BYTE;\n } else if (logicalTexType === TextureUsage.UPLOAD) {\n return PhysicalTextureType.FLOAT32;\n } else if (logicalTexType === TextureUsage.RENDER) {\n return ENV.get('WEBGL_RENDER_FLOAT32_ENABLED') ?\n PhysicalTextureType.FLOAT32 :\n PhysicalTextureType.FLOAT16;\n }\n throw new Error(`Unknown logical texture type ${logicalTexType}`);\n}\n\nfunction getKeyFromTextureShape(\n shapeRowsCol: [number, number],\n physicalTexType: PhysicalTextureType): string {\n return `${shapeRowsCol[0]}_${shapeRowsCol[1]}_${physicalTexType}`;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class TileProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(aShape: number[], reps: number[]) {\n const outputShape: number[] = new Array(aShape.length);\n for (let i = 0; i < outputShape.length; i++) {\n outputShape[i] = aShape[i] * reps[i];\n }\n this.outputShape = outputShape;\n this.rank = outputShape.length;\n const dtype = getCoordsDataType(this.rank);\n const sourceCoords = getSourceCoords(aShape);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n setOutput(getA(${sourceCoords}));\n }\n `;\n }\n}\n\nfunction getSourceCoords(aShape: number[]): string {\n const rank = aShape.length;\n if (rank > 5) {\n throw Error(`Tile for rank ${rank} is not yet supported`);\n }\n if (rank === 1) {\n return `imod(resRC, ${aShape[0]})`;\n }\n\n const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u'];\n\n const sourceCoords = [];\n for (let i = 0; i < aShape.length; i++) {\n sourceCoords.push(`imod(${currentCoords[i]}, ${aShape[i]})`);\n }\n return sourceCoords.join();\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class TransposeProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(aShape: number[], newDim: number[]) {\n const outputShape: number[] = new Array(aShape.length);\n for (let i = 0; i < outputShape.length; i++) {\n outputShape[i] = aShape[newDim[i]];\n }\n this.outputShape = outputShape;\n this.rank = outputShape.length;\n const dtype = getCoordsDataType(this.rank);\n const switched = getSwitchedCoords(newDim);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n setOutput(getA(${switched}));\n }\n `;\n }\n}\n\nfunction getSwitchedCoords(newDim: number[]): string {\n const rank = newDim.length;\n if (rank > 6) {\n throw Error(`Transpose for rank ${rank} is not yet supported`);\n }\n const originalOrder =\n ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u', 'resRC.v'];\n const switchedCoords = new Array(rank);\n for (let i = 0; i < newDim.length; i++) {\n switchedCoords[newDim[i]] = originalOrder[i];\n }\n return switchedCoords.join();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport const ERF_P = 0.3275911;\nexport const ERF_A1 = 0.254829592;\nexport const ERF_A2 = -0.284496736;\nexport const ERF_A3 = 1.421413741;\nexport const ERF_A4 = -1.453152027;\nexport const ERF_A5 = 1.061405429;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as erf_util from '../../ops/erf_util';\nimport * as selu_util from '../../ops/selu_util';\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {GPGPUContext} from './gpgpu_context';\n\nexport class UnaryOpProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n // Caching uniform location for speed.\n startLoc: WebGLUniformLocation;\n\n constructor(aShape: number[], opSnippet: string) {\n this.outputShape = aShape;\n this.userCode = `\n uniform float NAN;\n float unaryOperation(float x) {\n ${opSnippet}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `;\n }\n\n getCustomSetupFunc() {\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.startLoc == null) {\n this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN');\n if (this.startLoc == null) {\n // This means the compiler has optimized and realized it doesn't need\n // the uniform.\n return;\n }\n }\n gpgpu.gl.uniform1f(this.startLoc, NaN);\n };\n }\n}\n\nconst CHECK_NAN_SNIPPET = `if (isNaN(x)) return x;`;\n\nexport const ABS = `return abs(x);`;\n\nexport const RELU = CHECK_NAN_SNIPPET + `\n return (x < 0.0) ? 0.0 : x;\n`;\n\nexport const ELU = `return (x >= 0.0) ? x : (exp(x) - 1.0);`;\n\nexport const SELU = `\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${selu_util.SELU_SCALEALPHA};\n float scale = ${selu_util.SELU_SCALE};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`;\n\nexport function STEP(alpha = 0.0) {\n return CHECK_NAN_SNIPPET + `\n return x > 0.0 ? 1.0 : float(${alpha});\n `;\n}\n\nexport const NEG = `return -x;`;\n\nexport const CEIL = `return ceil(x);`;\n\nexport const FLOOR = `return floor(x);`;\n\nexport const SIGN = `\n if (isNaN(x)) { return 0.0; }\n return sign(x);\n`;\n\nexport const ROUND = `\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n`;\n\nexport const EXP = `return exp(x);`;\n\nexport const EXPM1 = `return exp(x) - 1.0;`;\n\nexport const LOG = `if (x < 0.0) return NAN;\n return log(x);`;\n\nexport const LOG1P = `return log(1.0 + x);`;\n\nexport const SQRT = `return sqrt(x);`;\n\nexport const RSQRT = `return inversesqrt(x);`;\n\nexport const SIGMOID = `return 1.0 / (1.0 + exp(-1.0 * x));`;\n\n/**\n * mirrors the implementation of tf.nn.softplus: https://goo.gl/vkcvwX\n *\n * epsilon is the difference between 1.0 and the next representable\n * float. For a single precision 32 bit float this should be 2^-23, see:\n * https://math.byu.edu/~schow/work/IEEEFloatingPoint.htm\n *\n * too_large = (x > -threshold) is value above which exp(x) may overflow\n * but softplus(x) == x is within machine epsilon\n *\n * too_small = (x < threshold) is value below which exp(x) may underflow,\n * but softplus(x) == exp(x) is within machine epsilon.\n */\nexport const SOFTPLUS = `\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n`;\n\nexport const SIN = CHECK_NAN_SNIPPET + `\n return sin(x);\n`;\n\nexport const COS = CHECK_NAN_SNIPPET + `\n return cos(x);\n`;\n\nexport const TAN = `return tan(x);`;\n\nexport const ASIN = `return asin(x);`;\n\nexport const ACOS = `return acos(x);`;\n\nexport const ATAN = CHECK_NAN_SNIPPET + `\n return atan(x);\n`;\n\nexport const SINH = `\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n`;\n\nexport const COSH = `\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n`;\n\nexport const TANH = `\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n`;\n\nexport const ASINH = `return log(x + sqrt(x * x + 1.0));`;\n\nexport const ACOSH = CHECK_NAN_SNIPPET + `\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));`;\n\nexport const ATANH = CHECK_NAN_SNIPPET + `\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;`;\n\nexport const ERF = `\n // Error function is calculated approximately with elementary function.\n // See \"Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\n float p = ${erf_util.ERF_P};\n float a1 = ${erf_util.ERF_A1};\n float a2 = ${erf_util.ERF_A2};\n float a3 = ${erf_util.ERF_A3};\n float a4 = ${erf_util.ERF_A4};\n float a5 = ${erf_util.ERF_A5};\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n`;\n\nexport const SQUARE = `return x * x;`;\n\nexport const RECIPROCAL = `return 1.0 / x;`;\n\nexport const LOGICAL_NOT = `return float(!(x >= 1.0));`;\n\nexport const TO_INT = `return float(int(x));`;\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensorArray} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assert, sizeFromShape} from '../util';\nimport {parseAxisParam} from './axis_util';\nimport * as concat_util from './concat_util';\nimport {op} from './operation';\n\n/**\n * Concatenates a list of `Tensor1D`s along an axis. See `concat` for details.\n *\n * For example, if:\n * A: shape(3) = |r1, g1, b1|\n * B: shape(2) = |r2, g2|\n * C = tf.concat1d([A, B]) == |r1, g1, b1, r2, g2|\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @return The concatenated array.\n */\nfunction concat1d_(tensors: Tensor1D[]|TensorLike[]): Tensor1D {\n return concat(tensors, 0 /* axis */);\n}\n\n/**\n * Concatenates a list of `Tensor2D`s along an axis. See `concat` for details.\n *\n * For example, if:\n * A: shape(2, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n *\n * B: shape(2, 3) = | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * C = tf.concat2d([A, B], axis)\n *\n * if axis = 0:\n * C: shape(4, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n * | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * if axis = 1:\n * C = shape(2, 6) = | r1, g1, b1, r3, g3, b3 |\n * | r2, g2, b2, r4, g4, b4 |\n *\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @param axis The axis to concatenate along.\n * @return The concatenated array.\n */\nfunction concat2d_(tensors: Tensor2D[]|TensorLike[], axis: number): Tensor2D {\n return concat(tensors, axis);\n}\n\n/**\n * Concatenates a list of `Tensor3D`s along an axis. See `concat` for details.\n *\n * For example, if:\n * A: shape(2, 1, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n *\n * B: shape(2, 1, 3) = | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * C = tf.concat3d([A, B], axis)\n *\n * if axis = 0:\n * C: shape(4, 1, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n * | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * if axis = 1:\n * C: shape(2, 2, 3) = | r1, g1, b1, r3, g3, b3 |\n * | r2, g2, b2, r4, g4, b4 |\n *\n * if axis = 2:\n * C = shape(2, 1, 6) = | r1, g1, b1, r3, g3, b3 |\n * | r2, g2, b2, r4, g4, b4 |\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @param axis The axis to concate along.\n * @return The concatenated array.\n */\nfunction concat3d_(tensors: Tensor3D[]|TensorLike[], axis: number): Tensor3D {\n return concat(tensors, axis);\n}\n\n/**\n * Concatenates a list of `Tensor4D`s along an axis. See `concat` for details.\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @param axis The axis to concate along.\n * @return The concatenated array.\n */\nfunction concat4d_(tensors: Tensor4D[]|TensorLike[], axis: number): Tensor4D {\n return concat(tensors, axis);\n}\n\n/**\n * Concatenates a list of `Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction concat_(tensors: T[]|TensorLike[], axis = 0): T {\n assert(tensors.length >= 1, 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat');\n\n let result = $tensors[0] as T;\n if ($tensors.length === 1) {\n return result;\n }\n const axes = parseAxisParam(axis, result.shape);\n\n for (let i = 1; i < $tensors.length; ++i) {\n result = concat2Tensors(result, $tensors[i], axes[0]) as T;\n }\n return result;\n}\n\nfunction concat2Tensors(a: T, b: T, axis: number): T {\n concat_util.assertParams(a.shape, b.shape, axis);\n const outShape = concat_util.computeOutShape(a.shape, b.shape, axis);\n\n // Do the reshape.\n const a2D = a.as2D(-1, sizeFromShape(a.shape.slice(axis)));\n const b2D = b.as2D(-1, sizeFromShape(b.shape.slice(axis)));\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n const {aBegin, aSize, bBegin, bSize} =\n concat_util.computeGradientSliceShapes(a2D.shape, b2D.shape);\n const der = (dy: Tensor2D) => {\n return {a: () => dy.slice(aBegin, aSize), b: () => dy.slice(bBegin, bSize)};\n };\n const res = ENV.engine.runKernel(\n backend => backend.concat(a2D, b2D), {a: a2D, b: b2D}, der);\n return res.reshape(outShape) as T;\n}\n\nexport const concat = op({concat_});\nexport const concat1d = op({concat1d_});\nexport const concat2d = op({concat2d_});\nexport const concat3d = op({concat3d_});\nexport const concat4d = op({concat4d_});\n","// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as seedrandom from 'seedrandom';\n\nexport interface RandGauss {\n nextValue(): number;\n}\n\nexport interface RandNormalDataTypes {\n float32: Float32Array;\n int32: Int32Array;\n}\n\n// https://en.wikipedia.org/wiki/Marsaglia_polar_method\nexport class MPRandGauss implements RandGauss {\n private mean: number;\n private stdDev: number;\n private nextVal: number;\n private dtype?: keyof RandNormalDataTypes;\n private truncated?: boolean;\n private upper?: number;\n private lower?: number;\n private random: seedrandom.prng;\n\n constructor(\n mean: number, stdDeviation: number, dtype?: keyof RandNormalDataTypes,\n truncated?: boolean, seed?: number) {\n this.mean = mean;\n this.stdDev = stdDeviation;\n this.dtype = dtype;\n this.nextVal = NaN;\n this.truncated = truncated;\n if (this.truncated) {\n this.upper = this.mean + this.stdDev * 2;\n this.lower = this.mean - this.stdDev * 2;\n }\n const seedValue = seed ? seed : Math.random();\n this.random = seedrandom.alea(seedValue.toString());\n }\n\n /** Returns next sample from a gaussian distribution. */\n public nextValue(): number {\n if (!isNaN(this.nextVal)) {\n const value = this.nextVal;\n this.nextVal = NaN;\n return value;\n }\n\n let resultX: number, resultY: number;\n let isValid = false;\n while (!isValid) {\n let v1: number, v2: number, s: number;\n do {\n v1 = 2 * this.random() - 1;\n v2 = 2 * this.random() - 1;\n s = v1 * v1 + v2 * v2;\n } while (s >= 1 || s === 0);\n\n const mul = Math.sqrt(-2.0 * Math.log(s) / s);\n resultX = this.mean + this.stdDev * v1 * mul;\n resultY = this.mean + this.stdDev * v2 * mul;\n\n if (!this.truncated || this.isValidTruncated(resultX)) {\n isValid = true;\n }\n }\n\n if (!this.truncated || this.isValidTruncated(resultY)) {\n this.nextVal = this.convertValue(resultY);\n }\n return this.convertValue(resultX);\n }\n\n /** Handles proper rounding for non floating point numbers. */\n private convertValue(value: number): number {\n if (this.dtype == null || this.dtype === 'float32') {\n return value;\n }\n return Math.round(value);\n }\n\n /** Returns true if less than 2-standard-deviations from the mean. */\n private isValidTruncated(value: number): boolean {\n return value <= this.upper && value >= this.lower;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorBuffer} from '../tensor';\nimport {convertToTensor, convertToTensorArray} from '../tensor_util_env';\nimport {DataType, Rank, ShapeMap, TensorLike, TensorLike1D, TypedArray} from '../types';\nimport * as util from '../util';\nimport {getAxesPermutation, getInnerMostAxes, parseAxisParam} from './axis_util';\nimport {concat} from './concat';\nimport {op} from './operation';\nimport {MPRandGauss} from './rand';\nimport {zerosLike} from './tensor_ops';\n\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction clone_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'clone');\n const der = (dy: T) => {\n return {$x: () => dy.toFloat()};\n };\n\n return ENV.engine.runKernel(\n backend =>\n Tensor.make($x.shape, {dataId: $x.dataId}, $x.dtype) as T,\n {$x}, der) as T;\n}\n\n/**\n * Create an identity matrix.\n *\n * @param numRows Number of rows.\n * @param numColumns Number of columns. Defaults to `numRows`.\n * @param batchShape If provided, will add the batch shape to the beginning\n * of the shape of the returned `Tensor` by repeating the identity\n * matrix.\n * @param dtype Data type.\n * @returns Identity matrix of the specified size and data type, possibly\n * with batch repetition if `batchShape` is specified.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction eye_(\n numRows: number, numColumns?: number,\n batchShape?:\n [\n number\n ]|[number,\n number]|[number, number, number]|[number, number, number, number],\n dtype: DataType = 'float32'): Tensor2D {\n if (numColumns == null) {\n numColumns = numRows;\n }\n const buff = buffer([numRows, numColumns], dtype);\n const n = numRows <= numColumns ? numRows : numColumns;\n for (let i = 0; i < n; ++i) {\n buff.set(1, i, i);\n }\n const out = buff.toTensor().as2D(numRows, numColumns);\n if (batchShape == null) {\n return out;\n } else {\n if (batchShape.length === 1) {\n return tile(expandDims(out, 0), [batchShape[0], 1, 1]);\n } else if (batchShape.length === 2) {\n return tile(\n expandDims(expandDims(out, 0), 0),\n [batchShape[0], batchShape[1], 1, 1]);\n } else if (batchShape.length === 3) {\n return tile(\n expandDims(expandDims(expandDims(out, 0), 0), 0),\n [batchShape[0], batchShape[1], batchShape[2], 1, 1]);\n } else {\n throw new Error(\n `eye() currently supports only 1D and 2D ` +\n // tslint:disable-next-line:no-any\n `batchShapes, but received ${(batchShape as any).length}D.`);\n }\n }\n}\n\n/**\n * Creates a `Tensor` with values sampled from a normal distribution.\n *\n * ```js\n * tf.randomNormal([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param mean The mean of the normal distribution.\n * @param stdDev The standard deviation of the normal distribution.\n * @param dtype The data type of the output.\n * @param seed The seed for the random number generator.\n */\n/** @doc {heading: 'Tensors', subheading: 'Random'} */\nfunction randomNormal_(\n shape: ShapeMap[R], mean = 0, stdDev = 1, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n if (dtype != null && (dtype as DataType) === 'bool') {\n throw new Error(`Unsupported data type ${dtype}`);\n }\n const randGauss =\n new MPRandGauss(mean, stdDev, dtype, false /* truncated */, seed);\n const res = buffer(shape, dtype);\n for (let i = 0; i < res.values.length; i++) {\n res.values[i] = randGauss.nextValue();\n }\n return res.toTensor();\n}\n\n/**\n * Creates a `Tensor` with values sampled from a truncated normal\n * distribution.\n *\n * ```js\n * tf.truncatedNormal([2, 2]).print();\n * ```\n *\n * The generated values follow a normal distribution with specified mean and\n * standard deviation, except that values whose magnitude is more than 2\n * standard deviations from the mean are dropped and re-picked.\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param mean The mean of the normal distribution.\n * @param stdDev The standard deviation of the normal distribution.\n * @param dtype The data type of the output tensor.\n * @param seed The seed for the random number generator.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction truncatedNormal_(\n shape: ShapeMap[R], mean = 0, stdDev = 1, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n if (dtype != null && (dtype as DataType) === 'bool') {\n throw new Error(`Unsupported data type ${dtype}`);\n }\n const randGauss =\n new MPRandGauss(mean, stdDev, dtype, true /* truncated */, seed);\n const res = buffer(shape, dtype);\n for (let i = 0; i < res.values.length; i++) {\n res.values[i] = randGauss.nextValue();\n }\n return res.toTensor();\n}\n\n/**\n * Creates a `Tensor` with values sampled from a uniform distribution.\n *\n * The generated values follow a uniform distribution in the range [minval,\n * maxval). The lower bound minval is included in the range, while the upper\n * bound maxval is excluded.\n *\n * ```js\n * tf.randomUniform([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param minval The lower bound on the range of random values to generate.\n * Defaults to 0.\n * @param maxval The upper bound on the range of random values to generate.\n * Defaults to 1.\n * @param dtype The data type of the output tensor. Defaults to 'float32'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Random'} */\nfunction randomUniform_(\n shape: ShapeMap[R], minval = 0, maxval = 1,\n dtype: DataType = 'float32'): Tensor {\n const res = buffer(shape, dtype);\n for (let i = 0; i < res.values.length; i++) {\n res.values[i] = util.randUniform(minval, maxval);\n }\n return res.toTensor();\n}\n\n/**\n * Creates a `Tensor` with values sampled from a random number generator\n * function defined by the user.\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param randFunction A random number generator function which is called\n * for each element in the output tensor.\n * @param dtype The data type of the output tensor. Defaults to 'float32'.\n */\nfunction rand_(\n shape: ShapeMap[R], randFunction: () => number,\n dtype?: DataType): Tensor {\n const size = util.sizeFromShape(shape);\n\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n\n for (let i = 0; i < size; i++) {\n values[i] = randFunction();\n }\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` with values drawn from a multinomial distribution.\n *\n * ```js\n * const probs = tf.tensor([.75, .25]);\n * tf.multinomial(probs, 3).print();\n * ```\n *\n * @param logits 1D array with unnormalized log-probabilities, or\n * 2D array of shape `[batchSize, numOutcomes]`. See the `normalized`\n * parameter.\n * @param numSamples Number of samples to draw for each row slice.\n * @param seed The seed number.\n * @param normalized Whether the provided `logits` are normalized true\n * probabilities (sum to 1). Defaults to false.\n * @return 1D array of shape `[numSamples]`, or 2D array of shape\n * `[batchSize, numSamples]`, depending on the rank of the input.\n */\n/** @doc {heading: 'Tensors', subheading: 'Random'} */\nfunction multinomial_(\n logits: Tensor1D|Tensor2D|TensorLike, numSamples: number, seed?: number,\n normalized = false): Tensor1D|Tensor2D {\n const $logits = convertToTensor(logits, 'logits', 'multinomial');\n const numOutcomes = $logits.size;\n const origRank = $logits.rank;\n if (numOutcomes < 2) {\n throw new Error(\n `Error in multinomial: you need at least 2 outcomes, but got ` +\n `${numOutcomes}.`);\n }\n if (origRank > 2) {\n throw new Error(`Rank of probabilities must be 1 or 2, but is ${origRank}`);\n }\n seed = seed || Math.random();\n const logits2D = origRank === 1 ? $logits.as2D(1, -1) : $logits as Tensor2D;\n const res = ENV.engine.runKernel(\n backend => backend.multinomial(logits2D, normalized, numSamples, seed),\n {logits2D});\n\n return origRank === 1 ? res.as1D() : res;\n}\n\n/**\n * Creates a one-hot `Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0).\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `Tensor1D` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction oneHot_(\n indices: Tensor1D|TensorLike1D, depth: number, onValue = 1,\n offValue = 0): Tensor2D {\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n util.assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`');\n\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n return ENV.engine.runKernel(\n backend => backend.oneHot($indices, depth, onValue, offValue),\n {$indices});\n}\n\n/**\n * Creates a `Tensor` from an image.\n *\n * ```js\n * const image = new ImageData(1, 1);\n * image.data[0] = 100;\n * image.data[1] = 150;\n * image.data[2] = 200;\n * image.data[3] = 255;\n *\n * tf.fromPixels(image).print();\n * ```\n *\n * @param pixels The input image to construct the tensor from. The\n * supported image types are all 4-channel.\n * @param numChannels The number of channels of the output tensor. A\n * numChannels value less than 4 allows you to ignore channels. Defaults to\n * 3 (ignores alpha channel of input image).\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction fromPixels_(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels = 3): Tensor3D {\n if (numChannels > 4) {\n throw new Error(\n 'Cannot construct Tensor with more than 4 channels from pixels.');\n }\n return ENV.engine.fromPixels(pixels, numChannels);\n}\n\n/**\n * Draws a `Tensor` of pixel values to a byte array or optionally a\n * canvas.\n *\n * When the dtype of the input is 'float32', we assume values in the range\n * [0-1]. Otherwise, when input is 'int32', we assume values in the range\n * [0-255].\n *\n * Returns a promise that resolves when the canvas has been drawn to.\n *\n * @param img A rank-2 or rank-3 tensor. If rank-2, draws grayscale. If\n * rank-3, must have depth of 1, 3 or 4. When depth of 1, draws\n * grayscale. When depth of 3, we draw with the first three components of\n * the depth dimension corresponding to r, g, b and alpha = 1. When depth of\n * 4, all four components of the depth dimension correspond to r, g, b, a.\n * @param canvas The canvas to draw to.\n */\n/** @doc {heading: 'Visualization'} */\nasync function toPixels(\n img: Tensor2D|Tensor3D|TensorLike,\n canvas?: HTMLCanvasElement): Promise {\n const $img = convertToTensor(img, 'img', 'toPixels', 'int32');\n if ($img.rank !== 2 && $img.rank !== 3) {\n throw new Error(\n `toPixels only supports rank 2 or 3 tensors, got rank ${$img.rank}.`);\n }\n const [height, width] = $img.shape.slice(0, 2);\n const depth = $img.rank === 2 ? 1 : $img.shape[2];\n\n if (depth > 4 || depth === 2) {\n throw new Error(\n `toPixels only supports depth of size ` +\n `1, 3 or 4 but got ${depth}`);\n }\n\n const minTensor = $img.min();\n const maxTensor = $img.max();\n const min = (await minTensor.data())[0];\n const max = (await maxTensor.data())[0];\n minTensor.dispose();\n maxTensor.dispose();\n if ($img.dtype === 'float32') {\n if (min < 0 || max > 1) {\n throw new Error(\n `Tensor values for a float32 Tensor must be in the ` +\n `range [0 - 1] but got range [${min} - ${max}].`);\n }\n } else if ($img.dtype === 'int32') {\n if (min < 0 || max > 255) {\n throw new Error(\n `Tensor values for a int32 Tensor must be in the ` +\n `range [0 - 255] but got range [${min} - ${max}].`);\n }\n } else {\n throw new Error(\n `Unsupported type for toPixels: ${$img.dtype}.` +\n ` Please use float32 or int32 tensors.`);\n }\n\n const data = await $img.data();\n const multiplier = $img.dtype === 'float32' ? 255 : 1;\n const bytes = new Uint8ClampedArray(width * height * 4);\n\n for (let i = 0; i < height * width; ++i) {\n let r, g, b, a;\n if (depth === 1) {\n r = data[i] * multiplier;\n g = data[i] * multiplier;\n b = data[i] * multiplier;\n a = 255;\n } else if (depth === 3) {\n r = data[i * 3] * multiplier;\n g = data[i * 3 + 1] * multiplier;\n b = data[i * 3 + 2] * multiplier;\n a = 255;\n } else if (depth === 4) {\n r = data[i * 4] * multiplier;\n g = data[i * 4 + 1] * multiplier;\n b = data[i * 4 + 2] * multiplier;\n a = data[i * 4 + 3] * multiplier;\n }\n\n const j = i * 4;\n bytes[j + 0] = Math.round(r);\n bytes[j + 1] = Math.round(g);\n bytes[j + 2] = Math.round(b);\n bytes[j + 3] = Math.round(a);\n }\n\n if (canvas != null) {\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d');\n const imageData = new ImageData(bytes, width, height);\n ctx.putImageData(imageData, 0, 0);\n }\n if ($img !== img) {\n $img.dispose();\n }\n return bytes;\n}\n\n/**\n * Reshapes a `Tensor` to a given shape.\n *\n * Given a input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction reshape_(\n x: Tensor|TensorLike, shape: ShapeMap[R2]): Tensor {\n const $x = convertToTensor(x, 'x', 'reshape');\n shape = util.inferFromImplicitShape(shape, $x.size);\n util.assert(\n $x.size === util.sizeFromShape(shape),\n 'new shape and old shape must have the same number of elements.');\n\n const grad = (dy: Tensor) => {\n return {$x: () => dy.reshape($x.shape)};\n };\n return ENV.engine.runKernel(\n backend => backend.reshape($x, shape), {$x}, grad);\n}\n\n/**\n * Removes dimensions of size 1 from the shape of a `Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction squeeze_(x: Tensor|TensorLike, axis?: number[]): T {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, util.squeezeShape($x.shape, axis).newShape) as T;\n}\n\n/**\n * Casts a `Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction cast_(x: T|TensorLike, dtype: DataType): T {\n const $x = convertToTensor(x, 'x', 'cast');\n\n const grad = (dy: T) => {\n return {$x: () => dy.clone()};\n };\n return ENV.engine.runKernel(backend => backend.cast($x, dtype), {$x}, grad) as\n T;\n}\n\n/**\n * Construct an tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction tile_(x: T|TensorLike, reps: number[]): T {\n const $x = convertToTensor(x, 'x', 'tile');\n\n util.assert(\n $x.rank === reps.length,\n `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const grad = (dy: T) => {\n const derX = () => {\n let xGrad = zerosLike($x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if ($x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = xGrad.add(dy.slice([i * $x.shape[0]], [$x.shape[0]]));\n }\n } else if ($x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = xGrad.add(dy.slice(\n [i * $x.shape[0], j * $x.shape[1]],\n [$x.shape[0], $x.shape[1]]));\n }\n }\n } else if ($x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad = xGrad.add(dy.slice(\n [i * $x.shape[0], j * $x.shape[1], k * $x.shape[2]],\n [$x.shape[0], $x.shape[1], $x.shape[2]]));\n }\n }\n }\n } else if ($x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad = xGrad.add(dy.slice(\n [\n i * $x.shape[0], j * $x.shape[1], k * $x.shape[2],\n l * $x.shape[3]\n ],\n [$x.shape[0], $x.shape[1], $x.shape[2], $x.shape[3]]));\n }\n }\n }\n }\n } else {\n throw new Error(\n `Gradient for tile operation is not implemented for rank-` +\n `${$x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return {$x: derX};\n };\n return ENV.engine.runKernel(backend => backend.tile($x, reps), {$x}, grad);\n}\n\n/**\n * Pads a `Tensor1D` with a given value and paddings. See `pad` for details.\n */\nfunction pad1d_(\n x: Tensor1D|TensorLike, paddings: [number, number],\n constantValue = 0): Tensor1D {\n util.assert(\n paddings.length === 2,\n 'Invalid number of paddings. Must be length of 2.');\n return pad(x, [paddings], constantValue);\n}\n\n/**\n * Pads a `Tensor2D` with a given value and paddings. See `pad` for details.\n */\nfunction pad2d_(\n x: Tensor2D|TensorLike, paddings: [[number, number], [number, number]],\n constantValue = 0): Tensor2D {\n util.assert(\n paddings.length === 2 && paddings[0].length === 2 &&\n paddings[1].length === 2,\n 'Invalid number of paddings. Must be length of 2 each.');\n return pad(x, paddings, constantValue);\n}\n\n/**\n * Pads a `Tensor3D` with a given value and paddings. See `pad` for details.\n */\nfunction pad3d_(\n x: Tensor3D|TensorLike,\n paddings: [[number, number], [number, number], [number, number]],\n constantValue = 0): Tensor3D {\n util.assert(\n paddings.length === 3 && paddings[0].length === 2 &&\n paddings[1].length === 2 && paddings[2].length === 2,\n 'Invalid number of paddings. Must be length of 2 each.');\n return pad(x, paddings, constantValue);\n}\n\n/**\n * Pads a `Tensor4D` with a given value and paddings. See `pad` for details.\n */\nfunction pad4d_(\n x: Tensor4D|TensorLike,\n paddings:\n [\n [number, number], [number, number], [number, number],\n [number, number]\n ],\n constantValue = 0): Tensor4D {\n util.assert(\n paddings.length === 4 && paddings[0].length === 2 &&\n paddings[1].length === 2 && paddings[2].length === 2 &&\n paddings[3].length === 2,\n 'Invalid number of paddings. Must be length of 2 each.');\n return pad(x, paddings, constantValue);\n}\n\n/**\n * Pads a `Tensor` with a given value and paddings.\n *\n * This operation currently only implements the `CONSTANT` mode.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction pad_(\n x: T|TensorLike, paddings: Array<[number, number]>, constantValue = 0): T {\n const $x = convertToTensor(x, 'x', 'pad');\n\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const begin = paddings.map(p => p[0]);\n const grad = (dy: T) => {\n return {$x: () => dy.slice(begin, $x.shape)};\n };\n return ENV.engine.runKernel(\n backend => backend.pad($x, paddings, constantValue), {$x}, grad) as\n T;\n}\n\n/**\n * Stacks a list of rank-`R` `Tensor`s into one rank-`(R+1)` `Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction stack_(tensors: T[]|TensorLike[], axis = 0): Tensor {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack');\n\n util.assert($tensors.length >= 1, 'Pass at least one tensor to tf.stack');\n if ($tensors.length === 1) {\n return $tensors[0].expandDims(axis);\n }\n const rank = $tensors[0].rank;\n const shape = $tensors[0].shape;\n const dtype = $tensors[0].dtype;\n\n util.assert(axis <= rank, 'Axis must be <= rank of the tensor');\n\n $tensors.forEach(t => {\n util.assertShapesMatch(\n shape, t.shape,\n 'All tensors passed to stack must have matching shapes');\n });\n\n $tensors.forEach(t => {\n util.assert(\n dtype === t.dtype,\n 'All tensors passed to stack must have matching dtypes');\n });\n const expandedTensors = $tensors.map(t => t.expandDims(axis));\n return concat(expandedTensors, axis);\n}\n\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M]`, all values must be >= 1.\n * @param crops A 2-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M, 2]`, all values must be >= 0. `crops[i] =\n * [cropStart, cropEnd]` specifies the amount to crop from input dimension `i\n * + 1`, which corresponds to spatial dimension `i`. It is required that\n * `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction batchToSpaceND_(\n x: T|TensorLike, blockShape: number[], crops: number[][]): T {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n\n util.assert(\n $x.rank >= 1 + blockShape.length,\n `input rank should be > than [blockShape] but got ${$x.rank}`);\n\n util.assert(\n crops.length === blockShape.length,\n `crops.shape[0] must be equal to [blockShape] but got ${crops.length}`);\n\n util.assert(\n $x.shape[0] % prod === 0,\n `input tensor batch must be divisible by prod( blockShape )`);\n return ENV.engine.runKernel(\n backend => backend.batchToSpaceND($x, blockShape, crops), {});\n}\n\n/**\n * This operation divides \"spatial\" dimensions [1, ..., M] of the input into\n * a grid of blocks of shape block_shape, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions [1, ..., M] correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to paddings. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M]`, all values must be >= 1.\n * @param paddings A 2-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M, 2]`, all values must be >= 0. `paddings[i] =\n * [padStart, padEnd]` specifies the amount to zero-pad from input dimension\n * `i + 1`, which corresponds to spatial dimension `i`.\n * It is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions [1, ..., M] of the input\n * according to paddings to produce padded of shape padded_shape.\n *\n * 2. Reshape padded to reshaped_padded of shape:\n * [batch] + [padded_shape[1] / block_shape[0], block_shape[0], ...,\n * padded_shape[M] / block_shape[M-1], block_shape[M-1]] + remaining_shape\n *\n * 3. Permute dimensions of reshaped_padded to produce permuted_\n * reshaped_padded of shape:\n * block_shape + [batch] + [padded_shape[1] / block_shape[0], ...,\n * padded_shape[M] / block_shape[M-1]] + remaining_shape\n *\n * 4. Reshape permuted_reshaped_padded to flatten block_shape into the\n * batch dimension, producing an output tensor of shape:\n * [batch * prod(block_shape)] + [padded_shape[1] / block_shape[0], ...,\n * padded_shape[M] / block_shape[M-1]] + remaining_shape\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction spaceToBatchND_(\n x: T|TensorLike, blockShape: number[], paddings: number[][]): T {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n\n util.assert(\n $x.rank >= 1 + blockShape.length,\n `input rank should be > than [blockShape] but got ${$x.rank}`);\n\n util.assert(\n paddings.length === blockShape.length,\n `paddings.shape[0] must be equal to [blockShape], got ${\n paddings.length}`);\n\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a && (b % blockShape[i - 1] === 0);\n }\n return a;\n }, true), `input spatial dimensions must be divisible by blockShapes`);\n return ENV.engine.runKernel(\n backend => backend.spaceToBatchND($x, blockShape, paddings), {});\n}\n\n/**\n * Unstacks a `Tensor` of rank-`R` into a list of rank-`(R-1)` `Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction unstack_(x: T|TensorLike, axis = 0): Tensor[] {\n const $x = convertToTensor(x, 'x', 'unstack');\n const num = $x.shape[axis];\n const outputShape: number[] = Array($x.rank - 1).fill(0);\n let outIndex = 0;\n for (let i = 0; i < $x.rank; i++) {\n if (i !== axis) {\n outputShape[outIndex] = $x.shape[i];\n outIndex++;\n }\n }\n\n let splitSizes: number[];\n splitSizes = Array(num).fill(1);\n const begin = Array($x.rank).fill(0);\n const size = $x.shape.slice();\n return splitSizes.map(s => {\n size[axis] = s;\n const slice = $x.slice(begin, size);\n begin[axis] += s;\n return slice.reshape(outputShape);\n });\n}\n\n/**\n * Splits a `Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `(numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction split_(\n x: T|TensorLike, numOrSizeSplits: number[]|number, axis = 0): T[] {\n const $x = convertToTensor(x, 'x', 'split');\n\n axis = parseAxisParam(axis, $x.shape)[0];\n let splitSizes: number[];\n if (typeof (numOrSizeSplits) === 'number') {\n util.assert(\n $x.shape[axis] % numOrSizeSplits === 0,\n 'Number of splits must evenly divide the axis.');\n splitSizes = Array(numOrSizeSplits).fill($x.shape[axis] / numOrSizeSplits);\n } else {\n util.assert(\n $x.shape[axis] === numOrSizeSplits.reduce((a, b) => a + b),\n 'The sum of sizes must match the size of the axis dimension.');\n splitSizes = numOrSizeSplits;\n }\n const begin = Array($x.rank).fill(0);\n const size = $x.shape.slice();\n return splitSizes.map(s => {\n size[axis] = s;\n const slice = $x.slice(begin, size);\n begin[axis] += s;\n return slice;\n });\n}\n\n/**\n * Computes the cumulative sum of a `Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n */\n/** @doc {heading: 'Operations', subheading: 'Scan'} */\nfunction cumsum_(\n x: Tensor|TensorLike, axis = 0, exclusive = false, reverse = false): T {\n const $x = convertToTensor(x, 'x', 'cumsum');\n\n axis = axis | 0;\n const permutation = getAxesPermutation([axis], $x.rank);\n let permutedX = $x;\n if (permutation != null) {\n permutedX = $x.transpose(permutation);\n }\n const permutedAxis = getInnerMostAxes(1, $x.rank)[0];\n\n const grad = (dy: T) => {\n return {permutedX: () => dy.cumsum(axis, exclusive, !reverse)};\n };\n let value = ENV.engine.runKernel(\n backend => backend.cumsum(\n permutedX, permutedAxis, exclusive, reverse),\n {permutedX}, grad) as T;\n\n if (permutation != null) {\n value = value.transpose(permutation);\n }\n return value;\n}\n\n/**\n * Returns a `Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction expandDims_(\n x: Tensor|TensorLike, axis = 0): Tensor {\n const $x = convertToTensor(x, 'x', 'expandDims');\n\n util.assert(axis <= $x.rank, 'Axis must be <= rank of the tensor');\n const newShape = $x.shape.slice();\n if (axis < 0) {\n // Negative value is counted from the tail of rank.\n util.assert(\n -($x.rank + 1) <= axis,\n `Axis must be in the interval [${- ($x.rank + 1)}, ${$x.rank}]`);\n axis = $x.rank + axis + 1;\n }\n newShape.splice(axis, 0, 1);\n return reshape($x, newShape);\n}\n\n/**\n * Creates an empty `TensorBuffer` with the specified `shape` and `dtype`.\n *\n * The values are stored in cpu as `TypedArray`. Fill the buffer using\n * `buffer.set()`, or by modifying directly `buffer.values`.\n *\n * When done, call `buffer.toTensor()` to get an immutable `Tensor` with\n * those values.\n *\n * ```js\n * // Create a buffer and set values at particular indices.\n * const buffer = tf.buffer([2, 2]);\n * buffer.set(3, 0, 0);\n * buffer.set(5, 1, 0);\n *\n * // Convert the buffer back to a tensor.\n * buffer.toTensor().print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The dtype of the buffer. Defaults to 'float32'.\n * @param values The values of the buffer as `TypedArray`. Defaults to\n * zeros.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction buffer(\n shape: ShapeMap[R], dtype: DataType = 'float32',\n values?: TypedArray): TensorBuffer {\n return new TensorBuffer(shape, dtype, values);\n}\n\n/**\n * Prints information about the `Tensor` including its data.\n *\n * ```js\n * const verbose = true;\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print(verbose);\n * ```\n * @param x The tensor to be printed.\n * @param verbose Whether to print verbose information about the ` Tensor`,\n * including dtype and size.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction print(x: T, verbose = false): void {\n console.log(x.toString(verbose));\n}\n\nexport {\n buffer, // Not wrapped in op() since no tensors.\n toPixels, // Not wrapped in op() since async.\n print // Not wrapped in op() since no need to increase stack trace.\n};\n\nexport const cast = op({cast_});\nexport const clone = op({clone_});\nexport const cumsum = op({cumsum_});\nexport const expandDims = op({expandDims_});\nexport const eye = op({eye_});\nexport const fromPixels = op({fromPixels_});\nexport const multinomial = op({multinomial_});\nexport const oneHot = op({oneHot_});\nexport const pad = op({pad_});\nexport const pad1d = op({pad1d_});\nexport const pad2d = op({pad2d_});\nexport const pad3d = op({pad3d_});\nexport const pad4d = op({pad4d_});\nexport const rand = op({rand_});\nexport const randomNormal = op({randomNormal_});\nexport const randomUniform = op({randomUniform_});\nexport const reshape = op({reshape_});\nexport const split = op({split_});\nexport const squeeze = op({squeeze_});\nexport const stack = op({stack_});\nexport const tile = op({tile_});\nexport const truncatedNormal = op({truncatedNormal_});\nexport const unstack = op({unstack_});\nexport const batchToSpaceND = op({batchToSpaceND_});\nexport const spaceToBatchND = op({spaceToBatchND_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** An implementation of the Where kernel shared between cpu and webgl */\n\nimport {buffer} from '../ops/array_ops';\nimport {Tensor2D} from '../tensor';\nimport {TypedArray} from '../types';\n\nexport function whereImpl(condShape: number[], condVals: TypedArray): Tensor2D {\n const indices = [];\n for (let i = 0; i < condVals.length; i++) {\n if (condVals[i]) {\n indices.push(i);\n }\n }\n\n const inBuffer = buffer(condShape, 'int32');\n\n const out = buffer([indices.length, condShape.length], 'int32');\n for (let i = 0; i < indices.length; i++) {\n const loc = inBuffer.indexToLoc(indices[i]);\n const offset = i * condShape.length;\n out.values.set(loc, offset);\n }\n return out.toTensor() as Tensor2D;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {MemoryInfo, TimingInfo} from '../engine';\nimport {ENV} from '../environment';\nimport {warn} from '../log';\nimport * as array_ops_util from '../ops/array_ops_util';\nimport * as axis_util from '../ops/axis_util';\nimport {Conv2DInfo} from '../ops/conv_util';\nimport * as reduce_util from '../ops/reduce_util';\nimport * as segment_util from '../ops/segment_util';\nimport {getStridedSlicedInfo} from '../ops/slice_util';\nimport {softmax} from '../ops/softmax';\nimport {range, tensor} from '../ops/tensor_ops';\nimport {DataId, setTensorTracker, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {DataType, DataTypeMap, Rank, RecursiveArray, ShapeMap, sumOutType, TypedArray, upcastType} from '../types';\nimport * as util from '../util';\n\nimport {KernelBackend} from './backend';\nimport * as backend_util from './backend_util';\nimport {nonMaxSuppressionImpl} from './non_max_suppression_impl';\nimport {topkImpl} from './topk_impl';\nimport {ArgMinMaxProgram} from './webgl/argminmax_gpu';\nimport {AvgPool2DBackpropProgram} from './webgl/avg_pool_backprop_gpu';\nimport {BatchNormProgram} from './webgl/batchnorm_gpu';\nimport * as binaryop_gpu from './webgl/binaryop_gpu';\nimport {BinaryOpProgram} from './webgl/binaryop_gpu';\nimport {ClipProgram} from './webgl/clip_gpu';\nimport {ConcatProgram} from './webgl/concat_gpu';\nimport {Conv2DDerFilterProgram, Conv2DDerInputProgram} from './webgl/conv_backprop_gpu';\nimport {DepthwiseConv2DDerFilterProgram, DepthwiseConv2DDerInputProgram} from './webgl/conv_backprop_gpu_depthwise';\nimport {Conv2DProgram} from './webgl/conv_gpu';\nimport {DepthwiseConv2DProgram} from './webgl/conv_gpu_depthwise';\nimport {CumSumProgram} from './webgl/cumsum_gpu';\nimport {EncodeFloatProgram} from './webgl/encode_float_gpu';\nimport {FromPixelsProgram} from './webgl/from_pixels_gpu';\nimport {GatherProgram} from './webgl/gather_gpu';\nimport {GPGPUContext} from './webgl/gpgpu_context';\nimport * as gpgpu_math from './webgl/gpgpu_math';\nimport {GPGPUBinary, GPGPUProgram, TensorData} from './webgl/gpgpu_math';\nimport * as gpgpu_util from './webgl/gpgpu_util';\nimport {LRNProgram} from './webgl/lrn_gpu';\nimport {LRNGradProgram} from './webgl/lrn_grad_gpu';\nimport {MaxPool2DBackpropProgram} from './webgl/max_pool_backprop_gpu';\nimport {MatMulProgram} from './webgl/mulmat_gpu';\nimport {MultinomialProgram} from './webgl/multinomial_gpu';\nimport {OneHotProgram} from './webgl/onehot_gpu';\nimport {PadProgram} from './webgl/pad_gpu';\nimport {Pool2DProgram} from './webgl/pool_gpu';\nimport {ReduceProgram} from './webgl/reduce_gpu';\nimport {ResizeBilinearBackpropProgram} from './webgl/resize_bilinear_backprop_gpu';\nimport {ResizeBilinearProgram} from './webgl/resize_bilinear_gpu';\nimport {ResizeNearestNeigborBackpropProgram} from './webgl/resize_nearest_neighbor_backprop_gpu';\nimport {ResizeNearestNeighborProgram} from './webgl/resize_nearest_neighbor_gpu';\nimport {ReverseProgram} from './webgl/reverse_gpu';\nimport {SegmentOpProgram} from './webgl/segment_gpu';\nimport {SelectProgram} from './webgl/select_gpu';\nimport {SliceProgram} from './webgl/slice_gpu';\nimport {StridedSliceProgram} from './webgl/strided_slice_gpu';\nimport {TextureData, TextureUsage} from './webgl/tex_util';\nimport {TextureManager} from './webgl/texture_manager';\nimport {TileProgram} from './webgl/tile_gpu';\nimport {TransposeProgram} from './webgl/transpose_gpu';\nimport * as unary_op from './webgl/unaryop_gpu';\nimport {UnaryOpProgram} from './webgl/unaryop_gpu';\nimport * as webgl_util from './webgl/webgl_util';\nimport {whereImpl} from './where_impl';\n\ntype TimerNode = RecursiveArray>|Promise;\nexport interface CPUTimerQuery {\n startMs: number;\n endMs?: number;\n}\n\nexport interface WebGLMemoryInfo extends MemoryInfo {\n numBytesInGPU: number;\n unreliable: boolean;\n}\n\nexport interface WebGLTimingInfo extends TimingInfo {\n uploadWaitMs: number;\n downloadWaitMs: number;\n}\n\n// Empirically determined constant used to decide the number of bytes on GPU\n// before we start paging. The bytes are this constant * screen area * dpi.\nconst BEFORE_PAGING_CONSTANT = 300;\n// Tensors with size <= than this will be uploaded as uniforms, not textures.\nexport const SIZE_UPLOAD_UNIFORM = 32;\n\nexport class MathBackendWebGL implements KernelBackend {\n private texData = new WeakMap();\n // Maps data ids that have a pending read operation, to list of subscribers.\n private pendingRead = new WeakMap void>>();\n // List of data ids that are scheduled for disposal, but are waiting on a\n // pending read operation.\n private pendingDisposal = new WeakSet();\n // List of data ids that are currently residing on gpu memory. Sorted with\n // least recently used being first.\n private lruDataGPU: DataId[] = [];\n private numBytesInGPU = 0;\n /**\n * Number of bytes allocated on the GPU before we start moving data to cpu.\n * Moving avoids gpu memory leaks and relies on JS's garbage collector.\n */\n private NUM_BYTES_BEFORE_PAGING: number;\n\n private canvas: HTMLCanvasElement;\n private fromPixelsCanvas: HTMLCanvasElement;\n\n private programTimersStack: TimerNode[];\n private activeTimers: TimerNode[];\n // Accumulated time spent (including blocking) in uploading data to webgl.\n private uploadWaitMs = 0;\n // Accumulated time spent (including blocking in downloading data from webgl.\n private downloadWaitMs = 0;\n\n register(dataId: DataId, shape: number[], dtype: DataType): void {\n if (this.texData.has(dataId)) {\n throw new Error('Data buffer is already registered');\n }\n this.texData.set(dataId, {\n shape,\n dtype,\n values: null,\n texture: null,\n texShape: null,\n usage: TextureUsage.RENDER\n });\n }\n fromPixels(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels: number): Tensor3D {\n if (pixels == null) {\n throw new Error('pixels passed to tf.fromPixels() can not be null');\n }\n const texShape: [number, number] = [pixels.height, pixels.width];\n const outShape = [pixels.height, pixels.width, numChannels];\n\n if (!(pixels instanceof HTMLVideoElement) &&\n !(pixels instanceof HTMLImageElement) &&\n !(pixels instanceof HTMLCanvasElement) &&\n !(pixels instanceof ImageData)) {\n throw new Error(\n 'pixels passed to tf.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ` +\n `ImageData, but was ${(pixels as {}).constructor.name}`);\n }\n if (pixels instanceof HTMLVideoElement) {\n if (this.fromPixelsCanvas == null) {\n if (!ENV.get('IS_BROWSER')) {\n throw new Error(\n 'Can\\'t read pixels from HTMLImageElement outside the browser.');\n }\n if (document.readyState !== 'complete') {\n throw new Error(\n 'The DOM is not ready yet. Please call tf.fromPixels() ' +\n 'once the DOM is ready. One way to do that is to add an event ' +\n 'listener for `DOMContentLoaded` on the document object');\n }\n this.fromPixelsCanvas = document.createElement('canvas');\n }\n this.fromPixelsCanvas.width = pixels.width;\n this.fromPixelsCanvas.height = pixels.height;\n this.fromPixelsCanvas.getContext('2d').drawImage(\n pixels, 0, 0, pixels.width, pixels.height);\n pixels = this.fromPixelsCanvas;\n }\n const tempPixelArray = Tensor.make(texShape, {}, 'int32');\n\n // This is a byte texture with pixels.\n this.texData.get(tempPixelArray.dataId).usage = TextureUsage.PIXELS;\n this.gpgpu.uploadPixelDataToTexture(\n this.getTexture(tempPixelArray.dataId), pixels);\n const program = new FromPixelsProgram(outShape);\n const res = this.compileAndRun(program, [tempPixelArray]);\n\n tempPixelArray.dispose();\n\n return res as Tensor3D;\n }\n write(dataId: DataId, values: TypedArray): void {\n if (values == null) {\n throw new Error('MathBackendWebGL.write(): values can not be null');\n }\n this.throwIfNoData(dataId);\n\n const texData = this.texData.get(dataId);\n const {texture, texShape, usage} = texData;\n if (texture != null) {\n // Release the old texture.\n this.releaseTexture(dataId, texture, texShape, usage);\n texData.texture = null;\n texData.texShape = null;\n }\n texData.usage = TextureUsage.UPLOAD;\n texData.values = values;\n\n if (!this.delayedStorage) {\n this.uploadToGPU(dataId);\n }\n }\n readSync(dataId: DataId): TypedArray {\n this.throwIfNoData(dataId);\n const texData = this.texData.get(dataId);\n const {shape, texture, values, texShape, dtype} = texData;\n if (values != null) {\n this.cacheOnCPU(dataId);\n return values;\n }\n const shouldTimeProgram = this.activeTimers != null;\n let start: number;\n if (shouldTimeProgram) {\n start = performance.now();\n }\n\n const float32Values =\n this.getValuesFromTexture(texture, dataId, dtype, texShape, shape);\n\n if (shouldTimeProgram) {\n this.downloadWaitMs += performance.now() - start;\n }\n this.cacheOnCPU(dataId, float32Values);\n return texData.values;\n }\n\n async read(dataId: DataId): Promise {\n if (this.pendingRead.has(dataId)) {\n const subscribers = this.pendingRead.get(dataId);\n return new Promise(resolve => subscribers.push(resolve));\n }\n this.throwIfNoData(dataId);\n const texData = this.texData.get(dataId);\n const {shape, texture, values, texShape, dtype} = texData;\n if (values != null) {\n this.cacheOnCPU(dataId);\n return values;\n }\n\n this.pendingRead.set(dataId, []);\n\n if (!ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED') &&\n ENV.get('WEBGL_VERSION') === 2) {\n throw new Error(\n `tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and ` +\n `WEBGL_VERSION=2 not yet supported.`);\n }\n\n // Possibly copy the texture into a buffer before inserting a fence.\n const bufferOrTexture = this.gpgpu.maybeCreateBufferFromTexture(\n texture, texShape[0], texShape[1]);\n\n // Create a fence and wait for it to resolve.\n await this.gpgpu.createAndWaitForFence();\n\n // Download the values from the GPU.\n let vals: Float32Array;\n if (bufferOrTexture instanceof WebGLTexture) {\n vals = this.getValuesFromTexture(texture, dataId, dtype, texShape, shape);\n } else {\n vals = this.gpgpu.downloadFloat32MatrixFromBuffer(\n bufferOrTexture, texShape[0], texShape[1]);\n }\n this.cacheOnCPU(dataId, vals);\n\n const subscribers = this.pendingRead.get(dataId);\n this.pendingRead.delete(dataId);\n\n // Notify all pending reads.\n subscribers.forEach(resolve => resolve(vals));\n if (this.pendingDisposal.has(dataId)) {\n this.pendingDisposal.delete(dataId);\n this.disposeData(dataId);\n }\n return vals;\n }\n\n private getValuesFromTexture(\n texture: WebGLTexture, dataId: DataId, dtype: DataType,\n texShape: [number, number], shape: number[]): Float32Array {\n if (ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED')) {\n return this.gpgpu.downloadFloat32MatrixFromOutputTexture(\n texture, texShape[0], texShape[1]);\n }\n\n const tmpTarget = Tensor.make(shape, {});\n this.texData.get(tmpTarget.dataId).usage = TextureUsage.DOWNLOAD;\n\n const tmpInput = Tensor.make(shape, {dataId}, dtype);\n const program = new EncodeFloatProgram(shape);\n const pageToCpu = false;\n this.compileAndRun(program, [tmpInput], tmpTarget, null, pageToCpu);\n const tmpData = this.texData.get(tmpTarget.dataId);\n const vals = this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(\n tmpData.texture, tmpData.texShape[0], tmpData.texShape[1]);\n\n tmpInput.dispose();\n tmpTarget.dispose();\n\n return vals;\n }\n\n async time(f: () => void): Promise {\n const oldActiveTimers = this.activeTimers;\n const newActiveTimers: TimerNode[] = [];\n\n let outerMostTime = false;\n if (this.programTimersStack == null) {\n this.programTimersStack = newActiveTimers;\n outerMostTime = true;\n } else {\n this.activeTimers.push(newActiveTimers);\n }\n this.activeTimers = newActiveTimers;\n\n f();\n\n const flattenedActiveTimers = util.flatten(this.activeTimers);\n this.activeTimers = oldActiveTimers;\n\n if (outerMostTime) {\n this.programTimersStack = null;\n }\n\n const kernelMs = await Promise.all(flattenedActiveTimers).then(results => {\n let sum = 0;\n results.forEach(result => sum += result);\n return sum;\n });\n const res: WebGLTimingInfo = {\n uploadWaitMs: this.uploadWaitMs,\n downloadWaitMs: this.downloadWaitMs,\n kernelMs,\n wallMs: null // will be filled by the engine\n };\n this.uploadWaitMs = 0;\n this.downloadWaitMs = 0;\n return res;\n }\n memory(): WebGLMemoryInfo {\n return {unreliable: false, numBytesInGPU: this.numBytesInGPU} as\n WebGLMemoryInfo;\n }\n\n private startTimer(): WebGLQuery|CPUTimerQuery {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n return this.gpgpu.beginQuery();\n }\n return {startMs: performance.now(), endMs: null};\n }\n\n private endTimer(query: WebGLQuery|CPUTimerQuery): WebGLQuery|\n {startMs: number, endMs: number} {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n this.gpgpu.endQuery();\n return query;\n }\n (query as CPUTimerQuery).endMs = performance.now();\n return query;\n }\n\n private async getQueryTime(query: WebGLQuery|CPUTimerQuery): Promise {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n return this.gpgpu.waitForQueryAndGetTime(query);\n }\n const timerQuery = query as CPUTimerQuery;\n return timerQuery.endMs - timerQuery.startMs;\n }\n\n disposeData(dataId: DataId): void {\n if (this.pendingDisposal.has(dataId)) {\n return;\n }\n if (this.pendingRead.has(dataId)) {\n this.pendingDisposal.add(dataId);\n return;\n }\n if (this.texData.has(dataId)) {\n const {texture, texShape, usage} = this.texData.get(dataId);\n if (texture != null) {\n this.releaseTexture(dataId, texture, texShape, usage);\n }\n this.texData.delete(dataId);\n }\n }\n\n getTexture(dataId: DataId): WebGLTexture {\n this.uploadToGPU(dataId);\n return this.texData.get(dataId).texture;\n }\n\n private textureManager: TextureManager;\n private binaryCache: {[key: string]: GPGPUBinary} = {};\n private gpgpuCreatedLocally: boolean;\n\n constructor(private gpgpu?: GPGPUContext, private delayedStorage = true) {\n if (ENV.get('WEBGL_VERSION') < 1) {\n throw new Error('WebGL is not supported on this device');\n }\n if (ENV.get('IS_BROWSER')) {\n this.canvas = document.createElement('canvas');\n }\n if (gpgpu == null) {\n this.gpgpu = new GPGPUContext(gpgpu_util.createWebGLContext(this.canvas));\n this.gpgpuCreatedLocally = true;\n } else {\n this.gpgpuCreatedLocally = false;\n }\n // Use the device screen's resolution as a heuristic to decide on the\n // maximum memory allocated on the GPU before starting to page.\n this.NUM_BYTES_BEFORE_PAGING =\n (window.screen.height * window.screen.width * window.devicePixelRatio) *\n BEFORE_PAGING_CONSTANT;\n this.textureManager = new TextureManager(this.gpgpu);\n }\n\n getGPGPUContext(): GPGPUContext {\n return this.gpgpu;\n }\n getCanvas(): HTMLCanvasElement {\n return this.canvas;\n }\n\n slice(x: T, begin: number[], size: number[]): T {\n const program = new SliceProgram(size);\n const customSetup = program.getCustomSetupFunc(begin);\n return this.compileAndRun(program, [x], null, customSetup);\n }\n\n stridedSlice(\n x: T, begin: number[], end: number[], strides: number[],\n beginMask: number, endMask: number): T {\n const [beginIndex, size] =\n getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask);\n\n if (size.some(axis => axis === 0)) {\n return tensor([], size) as T;\n }\n\n const program = new StridedSliceProgram(beginIndex, strides, size);\n return this.compileAndRun(program, [x]);\n }\n\n reverse(x: T, axis: number[]): T {\n const program = new ReverseProgram(x.shape, axis);\n return this.compileAndRun(program, [x]);\n }\n\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n concat(a: Tensor2D, b: Tensor2D): Tensor2D {\n const program = new ConcatProgram(a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n neg(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.NEG);\n return this.compileAndRun(program, [x]) as T;\n }\n\n matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean):\n Tensor2D {\n const program = new MatMulProgram(a.shape, b.shape, transposeA, transposeB);\n return this.compileAndRun(program, [a, b]);\n }\n\n multiply(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MUL, a.shape, b.shape);\n const output =\n this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as Tensor;\n return this.compileAndRun(program, [a, b], output) as Tensor;\n }\n\n batchNormalization(\n x: Tensor4D, mean: Tensor4D|Tensor1D, variance: Tensor4D|Tensor1D,\n varianceEpsilon: number, scale?: Tensor4D|Tensor1D,\n offset?: Tensor4D|Tensor1D): Tensor4D {\n const inputs = [x, mean, variance];\n\n let offsetShape = null;\n if (offset != null) {\n offsetShape = offset.shape;\n inputs.push(offset);\n }\n\n let scaleShape = null;\n if (scale != null) {\n scaleShape = scale.shape;\n inputs.push(scale);\n }\n\n const program = new BatchNormProgram(\n x.shape, mean.shape, variance.shape, offsetShape, scaleShape,\n varianceEpsilon);\n return this.compileAndRun(program, inputs);\n }\n\n localResponseNormalization4D(\n x: Tensor4D, radius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const program = new LRNProgram(x.shape, radius, bias, alpha, beta);\n return this.compileAndRun(program, [x]);\n }\n\n LRNGrad(\n dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D,\n depthRadius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const program =\n new LRNGradProgram(inputImage.shape, depthRadius, bias, alpha, beta);\n return this.compileAndRun(program, [inputImage, outputImage, dy]);\n }\n\n tile(x: T, reps: number[]): T {\n const program = new TileProgram(x.shape, reps);\n return this.compileAndRun(program, [x]);\n }\n\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T {\n const program = new PadProgram(x.shape, paddings, constantValue);\n return this.compileAndRun(program, [x]);\n }\n\n transpose(x: T, perm: number[]): T {\n const program = new TransposeProgram(x.shape, perm);\n return this.compileAndRun(program, [x]);\n }\n\n gather(x: T, indices: Tensor1D, axis: number): T {\n const program = new GatherProgram(x.shape, indices.size, axis);\n return this.compileAndRun(program, [x, indices]);\n }\n\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T {\n util.assert(\n x.rank <= 4,\n 'batchToSpaceND for rank > 4 with a WebGL backend not implemented yet');\n const prod = blockShape.reduce((a, b) => a * b);\n\n const reshaped = array_ops_util.getReshaped(x.shape, blockShape, prod);\n const permuted =\n array_ops_util.getPermuted(reshaped.length, blockShape.length);\n const reshapedPermuted =\n array_ops_util.getReshapedPermuted(x.shape, blockShape, prod);\n const sliceBeginCoords =\n array_ops_util.getSliceBeginCoords(crops, blockShape.length);\n const sliceSize =\n array_ops_util.getSliceSize(reshapedPermuted, crops, blockShape.length);\n\n return x.reshape(reshaped)\n .transpose(permuted)\n .reshape(reshapedPermuted)\n .slice(sliceBeginCoords, sliceSize) as T;\n }\n\n spaceToBatchND(\n x: T, blockShape: number[], paddings: Array<[number, number]>): T {\n util.assert(\n x.rank <= 4,\n 'spaceToBatchND for rank > 4 with a WebGL backend not implemented yet');\n\n const prod = blockShape.reduce((a, b) => a * b);\n\n const completePaddings: Array<[number, number]> = [[0, 0]];\n completePaddings.push(...paddings);\n for (let i = 1 + blockShape.length; i < x.shape.length; ++i) {\n completePaddings.push([0, 0]);\n }\n\n const paddedX = x.pad(completePaddings);\n\n const reshapedPaddedShape =\n array_ops_util.getReshaped(paddedX.shape, blockShape, prod, false);\n\n const permutedReshapedPaddedPermutation = array_ops_util.getPermuted(\n reshapedPaddedShape.length, blockShape.length, false);\n\n const flattenShape = array_ops_util.getReshapedPermuted(\n paddedX.shape, blockShape, prod, false);\n\n return paddedX.reshape(reshapedPaddedShape)\n .transpose(permutedReshapedPaddedPermutation)\n .reshape(flattenShape) as T;\n }\n\n private reduce(\n x: Tensor2D, reduceType: 'all'|'any'|'max'|'min'|'sum',\n dtype: DataType): Tensor2D {\n const batchSize = x.shape[0];\n const inSize = x.shape[1];\n const windowSize = reduce_util.computeOptimalWindowSize(inSize);\n const reduceInfo = {windowSize, inSize, batchSize};\n const program = new ReduceProgram(reduceInfo, reduceType);\n const [rows, cols] = program.outputShape;\n const output = this.makeOutputArray([rows, cols], dtype);\n this.compileAndRun(program, [x], output);\n // No need to run another GPGPU program.\n if (output.shape[1] === 1) {\n return output;\n }\n return this.reduce(output, reduceType, dtype);\n }\n\n private argReduce(\n x: Tensor2D, reduceType: 'max'|'min',\n bestIndicesA: Tensor2D = null): Tensor2D {\n let batchSize = x.shape[0];\n let inSize = x.shape[1];\n if (bestIndicesA != null) {\n batchSize = bestIndicesA.shape[0];\n inSize = bestIndicesA.shape[1];\n }\n const windowSize = reduce_util.computeOptimalWindowSize(inSize);\n const reduceInfo = {windowSize, inSize, batchSize};\n const program =\n new ArgMinMaxProgram(reduceInfo, reduceType, bestIndicesA == null);\n const [rows, cols] = program.outputShape;\n const output = this.makeOutputArray([rows, cols], 'int32');\n const inputs = [x];\n if (bestIndicesA != null) {\n inputs.push(bestIndicesA);\n }\n this.compileAndRun(program, inputs, output);\n // No need to run another GPGPU program.\n if (output.shape[1] === 1) {\n return output;\n }\n return this.argReduce(x, reduceType, output);\n }\n\n sum(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('sum', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n const outputDType = sumOutType(x.dtype);\n return this.reduce(a2D, 'sum', outputDType).reshape(outShape);\n }\n\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): Tensor {\n let axis = 0;\n const permutation = axis_util.getAxesPermutation([axis], x.rank);\n let permutedX = x;\n if (permutation != null) {\n permutedX = x.transpose(permutation);\n axis = axis_util.getInnerMostAxes(1, x.rank)[0];\n }\n\n const outShape =\n segment_util.computeOutShape(permutedX.shape, axis, numSegments);\n const inSize = util.sizeFromShape([permutedX.shape[axis]]);\n const a2D = permutedX.as2D(-1, inSize);\n const outputDType = sumOutType(x.dtype);\n let result =\n this.segOpCompute(\n a2D, 'unsortedSegmentSum', segmentIds, outputDType, numSegments)\n .reshape(outShape);\n if (permutation != null) {\n result = result.transpose(axis_util.getUndoAxesPermutation(permutation));\n }\n return result;\n }\n\n private segOpCompute(\n x: Tensor2D, segOpType: 'unsortedSegmentSum', segmentIds: Tensor1D,\n dtype: DataType, numSegments: number): Tensor2D {\n const batchSize = x.shape[0];\n const inSize = x.shape[1];\n const windowSize =\n segment_util.segOpComputeOptimalWindowSize(inSize, numSegments);\n const segOpInfo = {windowSize, inSize, batchSize, numSegments};\n const program = new SegmentOpProgram(segOpInfo, segOpType);\n const [rows, cols] = program.outputShape;\n const output = this.makeOutputArray([rows, cols], dtype);\n this.compileAndRun(program, [x, segmentIds], output);\n // No need to run another GPGPU program.\n if (output.shape[1] === numSegments) {\n return output;\n }\n segmentIds = range(0, numSegments).tile([inSize / windowSize]);\n return this.segOpCompute(output, segOpType, segmentIds, dtype, numSegments);\n }\n\n argMin(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMin', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.argReduce(a2D, 'min').reshape(outShape);\n }\n\n argMax(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMax', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.argReduce(a2D, 'max').reshape(outShape);\n }\n\n cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean):\n Tensor {\n if (axis !== x.rank - 1) {\n throw new Error(\n `WebGL cumsum shader expects an inner-most axis=${x.rank - 1} ` +\n `but got axis=${axis}`);\n }\n const program = new CumSumProgram(x.shape, exclusive, reverse);\n return this.compileAndRun(program, [x]);\n }\n\n equal(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n notEqual(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.NOT_EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n less(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.LESS, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n lessEqual(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.LESS_EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n greater(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.GREATER, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n greaterEqual(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.GREATER_EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n logicalNot(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.LOGICAL_NOT);\n return this.compileAndRun(program, [x]) as T;\n }\n\n logicalAnd(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.LOGICAL_AND, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n logicalOr(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.LOGICAL_OR, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n select(condition: Tensor, a: Tensor, b: Tensor): Tensor {\n const program = new SelectProgram(condition.rank, a.shape, a.rank);\n const output =\n this.makeOutputArray(program.outputShape, upcastType(a.dtype, b.dtype));\n return this.compileAndRun(program, [condition, a, b], output);\n }\n\n where(condition: Tensor): Tensor2D {\n warn(\n 'tf.where() in webgl locks the UI thread. ' +\n 'Call tf.whereAsync() instead');\n const condVals = condition.dataSync();\n return whereImpl(condition.shape, condVals);\n }\n\n topk(x: T, k: number, sorted: boolean): [T, T] {\n const xVals = x.dataSync();\n return topkImpl(xVals, x.shape, x.dtype, k, sorted);\n }\n\n min(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('min', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'min', a2D.dtype).reshape(outShape);\n }\n\n minimum(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MIN, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n mod(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MOD, a.shape, b.shape);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [a, b], null, customSetup);\n }\n\n max(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('max', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'max', a2D.dtype).reshape(outShape);\n }\n\n maximum(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MAX, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n all(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('all', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'all', a2D.dtype).reshape(outShape);\n }\n\n any(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('any', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'any', a2D.dtype).reshape(outShape);\n }\n\n squaredDifference(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.SQUARED_DIFFERENCE, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n realDivide(a: Tensor, b: Tensor): Tensor {\n const op = binaryop_gpu.DIV;\n const outputDtype = 'float32';\n const program = new BinaryOpProgram(op, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, outputDtype);\n return this.compileAndRun(program, [a, b], output);\n }\n\n floorDiv(a: Tensor, b: Tensor): Tensor {\n const op = binaryop_gpu.INT_DIV;\n const outputDtype = 'int32';\n const program = new BinaryOpProgram(op, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, outputDtype);\n return this.compileAndRun(program, [a, b], output);\n }\n\n add(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.ADD, a.shape, b.shape);\n const output =\n this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as Tensor;\n return this.compileAndRun(program, [a, b], output);\n }\n\n addN(tensors: T[]): T {\n let res = tensors[0];\n for (let i = 1; i < tensors.length; i++) {\n res = this.add(res, tensors[i]) as T;\n }\n return res;\n }\n\n subtract(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.SUB, a.shape, b.shape);\n const output =\n this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as Tensor;\n return this.compileAndRun(program, [a, b], output);\n }\n\n pow(a: T, b: Tensor): T {\n const program = new BinaryOpProgram(binaryop_gpu.POW, a.shape, b.shape);\n const customSetup = program.getCustomSetupFunc();\n const output = this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as T;\n return this.compileAndRun(program, [a, b], output, customSetup);\n }\n\n ceil(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.CEIL);\n return this.compileAndRun(program, [x]) as T;\n }\n\n floor(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.FLOOR);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sign(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SIGN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n round(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ROUND);\n return this.compileAndRun(program, [x]) as T;\n }\n\n exp(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.EXP);\n return this.compileAndRun(program, [x]) as T;\n }\n\n expm1(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.EXPM1);\n return this.compileAndRun(program, [x]) as T;\n }\n\n log(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.LOG);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [x], null, customSetup) as T;\n }\n\n log1p(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.LOG1P);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sqrt(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SQRT);\n return this.compileAndRun(program, [x]) as T;\n }\n\n rsqrt(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.RSQRT);\n return this.compileAndRun(program, [x]) as T;\n }\n\n square(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SQUARE);\n return this.compileAndRun(program, [x]) as T;\n }\n\n reciprocal(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.RECIPROCAL);\n return this.compileAndRun(program, [x]) as T;\n }\n\n relu(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.RELU);\n return this.compileAndRun(program, [x]) as T;\n }\n\n elu(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ELU);\n return this.compileAndRun(program, [x]) as T;\n }\n\n eluDer(dy: T, y: T): T {\n const program =\n new BinaryOpProgram(binaryop_gpu.ELU_DER, dy.shape, y.shape);\n return this.compileAndRun(program, [dy, y]) as T;\n }\n\n selu(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SELU);\n return this.compileAndRun(program, [x]) as T;\n }\n\n int(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.TO_INT);\n const output = this.makeOutputArray(program.outputShape, 'int32');\n return this.compileAndRun(program, [x], output) as T;\n }\n\n clip(x: T, min: number, max: number): T {\n const program = new ClipProgram(x.shape, min, max);\n return this.compileAndRun(program, [x]) as T;\n }\n\n abs(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ABS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sigmoid(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SIGMOID);\n return this.compileAndRun(program, [x]) as T;\n }\n\n softplus(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SOFTPLUS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sin(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SIN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n cos(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.COS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n tan(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.TAN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n asin(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ASIN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n acos(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ACOS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n atan(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ATAN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n atan2(a: T, b: T): T {\n const program = new BinaryOpProgram(binaryop_gpu.ATAN2, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]) as T;\n }\n\n sinh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SINH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n cosh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.COSH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n tanh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.TANH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n asinh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ASINH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n acosh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ACOSH);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [x], null, customSetup) as T;\n }\n\n atanh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ATANH);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [x], null, customSetup) as T;\n }\n\n erf(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ERF);\n return this.compileAndRun(program, [x]) as T;\n }\n\n step(x: T, alpha: number): T {\n const program = new UnaryOpProgram(x.shape, unary_op.STEP(alpha));\n return this.compileAndRun(program, [x]) as T;\n }\n\n conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Conv2DProgram(convInfo);\n return this.compileAndRun(program, [x, filter]);\n }\n\n conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new Conv2DDerInputProgram(convInfo);\n return this.compileAndRun(program, [dy, filter]);\n }\n\n conv2dDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Conv2DDerFilterProgram(convInfo);\n return this.compileAndRun(program, [x, dy]);\n }\n\n depthwiseConv2D(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new DepthwiseConv2DProgram(convInfo);\n return this.compileAndRun(program, [x, filter]);\n }\n\n depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new DepthwiseConv2DDerInputProgram(convInfo);\n return this.compileAndRun(program, [dy, filter]);\n }\n\n depthwiseConv2DDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new DepthwiseConv2DDerFilterProgram(convInfo);\n return this.compileAndRun(program, [x, dy]);\n }\n\n maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Pool2DProgram(convInfo, 'max', false);\n const output =\n this.makeOutputArray(program.outputShape, x.dtype) as Tensor4D;\n return this.compileAndRun(program, [x], output);\n }\n\n avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Pool2DProgram(convInfo, 'avg', false);\n const output = this.makeOutputArray(program.outputShape, 'float32');\n return this.compileAndRun(program, [x], output) as Tensor4D;\n }\n\n maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const getPositions = true;\n const maxPoolPositionsProgram =\n new Pool2DProgram(convInfo, 'max', getPositions);\n const maxPoolPositions: Tensor4D =\n this.compileAndRun(maxPoolPositionsProgram, [x]);\n\n const maxPoolBackPropProgram = new MaxPool2DBackpropProgram(convInfo);\n const output =\n this.makeOutputArray(maxPoolBackPropProgram.outputShape, x.dtype);\n const result = this.compileAndRun(\n maxPoolBackPropProgram, [dy, maxPoolPositions], output);\n maxPoolPositions.dispose();\n return result as Tensor4D;\n }\n\n avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const avgPoolBackpropProgram = new AvgPool2DBackpropProgram(convInfo);\n const output =\n this.makeOutputArray(avgPoolBackpropProgram.outputShape, x.dtype);\n return this.compileAndRun(avgPoolBackpropProgram, [dy], output) as Tensor4D;\n }\n\n cast(x: T, dtype: DataType): T {\n return backend_util.castTensor(x, dtype, this);\n }\n\n reshape(x: Tensor, shape: ShapeMap[R]): Tensor {\n return backend_util.reshapeTensor(x, shape);\n }\n\n resizeBilinear(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const program =\n new ResizeBilinearProgram(x.shape, newHeight, newWidth, alignCorners);\n return this.compileAndRun(program, [x]);\n }\n\n resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean):\n Tensor4D {\n const program = new ResizeBilinearBackpropProgram(dy, x, alignCorners);\n\n return this.compileAndRun(program, [dy]);\n }\n\n resizeNearestNeighbor(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const program = new ResizeNearestNeighborProgram(\n x.shape, newHeight, newWidth, alignCorners);\n return this.compileAndRun(program, [x]);\n }\n\n resizeNearestNeighborBackprop(\n dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor4D {\n const program =\n new ResizeNearestNeigborBackpropProgram(dy, x, alignCorners);\n return this.compileAndRun(program, [dy]);\n }\n\n multinomial(\n logits: Tensor2D, normalized: boolean, numSamples: number,\n seed: number): Tensor2D {\n const probs = normalized ? logits : softmax(logits);\n const batchSize = probs.shape[0];\n const numOutcomes = probs.shape[1];\n const program = new MultinomialProgram(batchSize, numOutcomes, numSamples);\n const output =\n this.makeOutputArray(program.outputShape, 'int32') as Tensor2D;\n const customSetup = program.getCustomSetupFunc(seed);\n return this.compileAndRun(program, [probs], output, customSetup);\n }\n\n oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number):\n Tensor2D {\n const program = new OneHotProgram(indices.size, depth, onValue, offValue);\n return this.compileAndRun(program, [indices]);\n }\n\n nonMaxSuppression(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number): Tensor1D {\n warn(\n 'tf.nonMaxSuppression() in webgl locks the UI thread. ' +\n 'Call tf.nonMaxSuppressionAsync() instead');\n const boxesVals = boxes.dataSync();\n const scoresVals = scores.dataSync();\n return nonMaxSuppressionImpl(\n boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold);\n }\n\n private makeOutputArray(shape: number[], dtype: DataType):\n T {\n return Tensor.make(shape, {}, dtype) as T;\n }\n\n private compileAndRun(\n program: GPGPUProgram, inputs: T[], output?: K,\n customSetup?: (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void,\n pageToCpu = true): K {\n if (output == null) {\n output = this.makeOutputArray(program.outputShape, inputs[0].dtype);\n }\n const inputsData: Array> = inputs.map(tensor => {\n const texData = this.texData.get(tensor.dataId);\n // Upload small tensors that live on the CPU as uniforms, not as\n // textures.\n if (texData.texture == null && tensor.size <= SIZE_UPLOAD_UNIFORM) {\n return {tensor, texData: null, isUniform: true};\n }\n this.uploadToGPU(tensor.dataId);\n return {tensor, texData, isUniform: false};\n });\n this.uploadToGPU(output.dataId);\n const outputData = {\n tensor: output,\n texData: this.texData.get(output.dataId),\n isUniform: false\n };\n const key = gpgpu_math.makeShaderKey(program, inputsData, outputData);\n const binary = this.getAndSaveBinary(key, () => {\n return gpgpu_math.compileProgram(\n this.gpgpu, program, inputsData, outputData);\n });\n const shouldTimeProgram = this.activeTimers != null;\n let query: WebGLQuery|CPUTimerQuery;\n if (shouldTimeProgram) {\n query = this.startTimer();\n }\n\n gpgpu_math.runProgram(binary, inputsData, outputData, customSetup);\n\n if (pageToCpu && this.numBytesInGPU > this.NUM_BYTES_BEFORE_PAGING) {\n let numBytesToPage = this.numBytesInGPU - this.NUM_BYTES_BEFORE_PAGING;\n while (numBytesToPage > 0 && this.lruDataGPU.length > 0) {\n const dataId = this.lruDataGPU.shift();\n const {shape, dtype} = this.texData.get(dataId);\n numBytesToPage -= this.computeBytes(shape, dtype);\n this.read(dataId);\n }\n }\n\n if (shouldTimeProgram) {\n query = this.endTimer(query);\n this.activeTimers.push(this.getQueryTime(query));\n }\n return output;\n }\n\n private getAndSaveBinary(key: string, getBinary: () => GPGPUBinary):\n GPGPUBinary {\n if (!(key in this.binaryCache)) {\n this.binaryCache[key] = getBinary();\n }\n return this.binaryCache[key];\n }\n\n getTextureManager(): TextureManager {\n return this.textureManager;\n }\n\n private disposed = false;\n\n dispose() {\n if (this.disposed) {\n return;\n }\n for (const key in this.binaryCache) {\n this.gpgpu.deleteProgram(this.binaryCache[key].webGLProgram);\n }\n this.textureManager.dispose();\n this.canvas.remove();\n if (this.fromPixelsCanvas != null) {\n this.fromPixelsCanvas.remove();\n }\n if (this.gpgpuCreatedLocally) {\n this.gpgpu.dispose();\n }\n this.disposed = true;\n }\n\n private throwIfNoData(dataId: DataId) {\n if (!this.texData.has(dataId)) {\n throw new Error(\n `WebGL backend: No data found for this tensor. ` +\n `Did you change your backend in the middle of the program? ` +\n `New backends can't use Tensors created with previous backends`);\n }\n }\n\n private uploadToGPU(dataId: DataId): void {\n this.throwIfNoData(dataId);\n const texData = this.texData.get(dataId);\n const {shape, values, texture, dtype, usage} = texData;\n if (texture != null) {\n // Array is already on GPU. No-op.\n // Touching the texture.\n const index = this.lruDataGPU.indexOf(dataId);\n if (index >= 0) {\n this.lruDataGPU.splice(this.lruDataGPU.indexOf(dataId), 1);\n this.lruDataGPU.push(dataId);\n }\n return;\n }\n const shouldTimeProgram = this.activeTimers != null;\n let start: number;\n if (shouldTimeProgram) {\n start = performance.now();\n }\n const texShape =\n webgl_util.getTextureShapeFromLogicalShape(this.gpgpu.gl, shape);\n texData.texShape = texShape;\n const newTexture = this.acquireTexture(dataId, texShape, usage);\n texData.texture = newTexture;\n if (values != null) {\n this.gpgpu.uploadMatrixToTexture(\n newTexture, texShape[0],\n // TODO(smilkov): Propagate the original typed array to gpgpu.\n texShape[1], typedArrayToFloat32(values, dtype));\n // Once uploaded, don't store the values on cpu.\n texData.values = null;\n if (shouldTimeProgram) {\n this.uploadWaitMs += performance.now() - start;\n }\n }\n }\n\n private cacheOnCPU(dataId: DataId, float32Values?: Float32Array) {\n // In delayed storage mode, when the user reads data, we don't keep a\n // copy on the gpu, to minimize likelihood of memory leak. We re-upload\n // to gpu the next time a gpgpu program needs the texture.\n const dontKeepCopyOnGPU = this.delayedStorage;\n const texData = this.texData.get(dataId);\n const {texture, texShape, dtype, usage} = texData;\n if (dontKeepCopyOnGPU && texture != null) {\n this.releaseTexture(dataId, texture, texShape, usage);\n texData.texture = null;\n texData.texShape = null;\n }\n if (float32Values != null) {\n texData.values = float32ToTypedArray(float32Values, dtype);\n }\n }\n\n private releaseTexture(\n dataId: DataId, texture: WebGLTexture, texShape: [number, number],\n texType: TextureUsage) {\n const {shape, dtype} = this.texData.get(dataId);\n const idx = this.lruDataGPU.indexOf(dataId);\n if (idx >= 0) {\n this.lruDataGPU.splice(idx, 1);\n }\n this.numBytesInGPU -= this.computeBytes(shape, dtype);\n this.textureManager.releaseTexture(texture, texShape, texType);\n }\n\n private acquireTexture(\n dataId: DataId, texShape: [number, number],\n texType: TextureUsage): WebGLTexture {\n const {shape, dtype} = this.texData.get(dataId);\n this.lruDataGPU.push(dataId);\n this.numBytesInGPU += this.computeBytes(shape, dtype);\n return this.textureManager.acquireTexture(texShape, texType);\n }\n\n private computeBytes(shape: number[], dtype: DataType) {\n return util.sizeFromShape(shape) * util.bytesPerElement(dtype);\n }\n}\n\nif (ENV.get('IS_BROWSER')) {\n ENV.registerBackend(\n 'webgl', () => new MathBackendWebGL(), 2 /* priority */,\n setTensorTracker);\n}\n\nfunction float32ToTypedArray(\n a: Float32Array, dtype: D): DataTypeMap[D] {\n if (dtype === 'float32') {\n return a;\n } else if (dtype === 'int32' || dtype === 'bool') {\n const result = (dtype === 'int32') ? new Int32Array(a.length) :\n new Uint8Array(a.length);\n for (let i = 0; i < result.length; ++i) {\n result[i] = Math.round(a[i]);\n }\n return result;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\nfunction typedArrayToFloat32(\n a: DataTypeMap[D], dtype: D): Float32Array {\n return (a instanceof Float32Array) ? a : new Float32Array(a);\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\nimport {scalar, zerosLike} from './tensor_ops';\n\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction neg_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'neg');\n\n const grad = (dy: T) => {\n return {$x: () => dy.neg()};\n };\n return ENV.engine.runKernel(backend => backend.neg($x), {$x}, grad);\n}\n\n/**\n * Computes ceiling of input `Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction ceil_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'ceil');\n\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.ceil($x), {$x}, grad);\n}\n\n/**\n * Computes floor of input `Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction floor_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'floor');\n\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.floor($x), {$x}, grad);\n}\n\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sign_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sign');\n\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.sign($x), {$x}, grad);\n}\n\n/**\n * Computes round of input `Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction round_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'round');\n\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.round($x), {$x}, grad);\n}\n\n/**\n * Computes exponential of the input `Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction exp_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'exp');\n\n const bck = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {$x: () => dy.mulStrict(y as T)};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.exp($x)), {$x}, bck);\n}\n\n/**\n * Computes exponential of the input `Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction expm1_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'expm1');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.exp())};\n };\n return ENV.engine.runKernel(backend => backend.expm1($x), {$x}, grad);\n}\n\n/**\n * Computes natural logarithm of the input `Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction log_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'log');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.toFloat())};\n };\n return ENV.engine.runKernel(backend => backend.log($x), {$x}, grad);\n}\n\n/**\n * Computes natural logarithm of the input `Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction log1p_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'log1p');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.add(scalar(1)))};\n };\n return ENV.engine.runKernel(backend => backend.log1p($x), {$x}, grad);\n}\n\n/**\n * Computes square root of the input `Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sqrt_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sqrt');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.toFloat().sqrt().mul(scalar(2)))};\n };\n return ENV.engine.runKernel(backend => backend.sqrt($x), {$x}, grad);\n}\n\n/**\n * Computes reciprocal of square root of the input `Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction rsqrt_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.pow(scalar(1.5)).mul(scalar(2))).neg()};\n };\n return ENV.engine.runKernel(backend => backend.rsqrt($x), {$x}, grad);\n}\n\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction square_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'square');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.toFloat().mul(scalar(2)))};\n };\n return ENV.engine.runKernel(backend => backend.square($x), {$x}, grad);\n}\n\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction reciprocal_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.square().neg())};\n };\n return ENV.engine.runKernel(backend => backend.reciprocal($x), {$x}, grad);\n}\n\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `Tensor`.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction abs_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'abs');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.toFloat().step(-1))};\n };\n return ENV.engine.runKernel(backend => backend.abs($x), {$x}, grad);\n}\n\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction clipByValue_(\n x: T|TensorLike, clipValueMin: number, clipValueMax: number): T {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert(\n (clipValueMin <= clipValueMax),\n `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.where(\n $x.greaterEqual(scalar(clipValueMin))\n .logicalAnd($x.lessEqual(scalar(clipValueMax))),\n zerosLike(dy)) as T,\n };\n };\n return ENV.engine.runKernel(\n backend => backend.clip($x, clipValueMin, clipValueMax), {$x}, grad);\n}\n\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sigmoid_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n\n const grad = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {$x: () => dy.mulStrict(y.mul(scalar(1).sub(y)))};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.sigmoid($x)), {$x}, grad);\n}\n\n/**\n * Computes log sigmoid of the input `Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction logSigmoid_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.neg().sigmoid())};\n };\n return ENV.engine.runKernel(\n backend => backend.softplus($x.neg()).neg(), {$x}, grad);\n}\n\n/**\n * Computes softplus of the input `Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction softplus_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'softplus');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.sigmoid())};\n };\n return ENV.engine.runKernel(backend => backend.softplus($x), {$x}, grad);\n}\n\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sin_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sin');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().cos().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.sin($x), {$x}, grad);\n}\n\n/**\n * Computes cos of the input `Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction cos_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'cos');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().sin().neg().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.cos($x), {$x}, grad);\n}\n\n/**\n * Computes tan of the input `Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction tan_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'tan');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.cos().square())};\n };\n return ENV.engine.runKernel(backend => backend.tan($x), {$x}, grad);\n}\n\n/**\n * Computes asin of the input `Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction asin_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'asin');\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.divStrict(scalar(1).sub($x.toFloat().square()).sqrt() as T)\n };\n };\n return ENV.engine.runKernel(backend => backend.asin($x), {$x}, grad);\n}\n\n/**\n * Computes acos of the input `Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction acos_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'acos');\n\n const grad = (dy: T) => {\n return {\n $x: () =>\n dy.divStrict(scalar(1).sub($x.toFloat().square()).sqrt() as T).neg()\n };\n };\n return ENV.engine.runKernel(backend => backend.acos($x), {$x}, grad);\n}\n\n/**\n * Computes atan of the input `Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction atan_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'atan');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict(scalar(1).add($x.toFloat().square()))};\n };\n return ENV.engine.runKernel(backend => backend.atan($x), {$x}, grad);\n}\n\n/**\n * Computes hyperbolic sin of the input `Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sinh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sinh');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().cosh().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.sinh($x), {$x}, grad);\n}\n\n/**\n * Computes hyperbolic cos of the input `Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction cosh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'cosh');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().sinh().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.cosh($x), {$x}, grad);\n}\n\n/**\n * Computes hyperbolic tangent of the input `Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction tanh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'tanh');\n\n const grad = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {$x: () => scalar(1).sub(y.square()).mulStrict(dy) as T};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.tanh($x)), {$x}, grad);\n}\n\n/**\n * Computes inverse hyperbolic sin of the input `Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction asinh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'asinh');\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.divStrict(scalar(1).add($x.toFloat().square()).sqrt() as T)\n };\n };\n return ENV.engine.runKernel(backend => backend.asinh($x), {$x}, grad);\n}\n\n/**\n * Computes the inverse hyperbolic cos of the input `Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction acosh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'acosh');\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.divStrict($x.toFloat().square().sub(scalar(1)).sqrt() as T)\n };\n };\n return ENV.engine.runKernel(backend => backend.acosh($x), {$x}, grad);\n}\n\n/**\n * Computes inverse hyperbolic tan of the input `Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction atanh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'atanh');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict(scalar(1).sub($x.toFloat().square()))};\n };\n return ENV.engine.runKernel(backend => backend.atanh($x), {$x}, grad);\n}\n\n/**\n * Computes gause error function of the input `Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction erf_(x: T|TensorLike): T {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert(\n $x.dtype === 'int32' || $x.dtype === 'float32',\n 'Input dtype must be `int32` or `float32`.');\n\n if ($x.dtype === 'int32') {\n $x = $x.toFloat();\n }\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.mulStrict(\n scalar(2 / Math.sqrt(Math.PI)).mul($x.square().neg().exp()))\n };\n };\n return ENV.engine.runKernel(backend => backend.erf($x), {$x}, grad);\n}\n\n/**\n * Computes step of the input `Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction step_(x: T|TensorLike, alpha = 0.0): T {\n const $x = convertToTensor(x, 'x', 'step');\n\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.step($x, alpha), {$x}, grad);\n}\n\nexport const abs = op({abs_});\nexport const acos = op({acos_});\nexport const acosh = op({acosh_});\nexport const asin = op({asin_});\nexport const asinh = op({asinh_});\nexport const atan = op({atan_});\nexport const atanh = op({atanh_});\nexport const ceil = op({ceil_});\nexport const clipByValue = op({clipByValue_});\nexport const cos = op({cos_});\nexport const cosh = op({cosh_});\nexport const erf = op({erf_});\nexport const exp = op({exp_});\nexport const expm1 = op({expm1_});\nexport const floor = op({floor_});\nexport const log = op({log_});\nexport const log1p = op({log1p_});\nexport const logSigmoid = op({logSigmoid_});\nexport const neg = op({neg_});\nexport const reciprocal = op({reciprocal_});\nexport const round = op({round_});\nexport const rsqrt = op({rsqrt_});\nexport const sigmoid = op({sigmoid_});\nexport const sign = op({sign_});\nexport const sin = op({sin_});\nexport const sinh = op({sinh_});\nexport const softplus = op({softplus_});\nexport const sqrt = op({sqrt_});\nexport const square = op({square_});\nexport const step = op({step_});\nexport const tan = op({tan_});\nexport const tanh = op({tanh_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {Rank, TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {tile} from './array_ops';\nimport {getReductionAxes} from './broadcast_util';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\nimport {rsqrt} from './unary_ops';\n\n/**\n * Batch normalization, strictly for 2D. For the more relaxed version, see\n * `batchNormalization`.\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\nfunction batchNormalization2d_(\n x: Tensor2D|TensorLike, mean: Tensor2D|Tensor1D|TensorLike,\n variance: Tensor2D|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor2D|Tensor1D|TensorLike,\n offset?: Tensor2D|Tensor1D|TensorLike): Tensor2D {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor2D|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor2D|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n util.assert(\n $x.rank === 2,\n `Error in batchNormalization3D: x must be rank 3 but got rank ` +\n `${$x.rank}.`);\n util.assert(\n $mean.rank === 2 || $mean.rank === 1,\n `Error in batchNormalization2D: mean must be rank 2 or rank 1 but ` +\n `got rank ${$mean.rank}.`);\n util.assert(\n $variance.rank === 2 || $variance.rank === 1,\n `Error in batchNormalization2D: variance must be rank 2 or rank 1 ` +\n `but got rank ${$variance.rank}.`);\n if ($scale != null) {\n util.assert(\n $scale.rank === 2 || $scale.rank === 1,\n `Error in batchNormalization2D: scale must be rank 2 or rank 1 ` +\n `but got rank ${$scale.rank}.`);\n }\n if ($offset != null) {\n util.assert(\n $offset.rank === 2 || $offset.rank === 1,\n `Error in batchNormalization2D: offset must be rank 2 or rank 1 ` +\n `but got rank ${$offset.rank}.`);\n }\n\n return batchNormalization(\n $x, $mean, $variance, varianceEpsilon, $scale, $offset);\n}\n\n/**\n * Batch normalization, strictly for 3D. For the more relaxed version, see\n * `batchNormalization`.\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\nfunction batchNormalization3d_(\n x: Tensor3D|TensorLike, mean: Tensor3D|Tensor1D|TensorLike,\n variance: Tensor3D|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor3D|Tensor1D|TensorLike,\n offset?: Tensor3D|Tensor1D|TensorLike): Tensor3D {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor3D|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor3D|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n util.assert(\n $x.rank === 3,\n `Error in batchNormalization3D: x must be rank 3 but got rank ` +\n `${$x.rank}.`);\n util.assert(\n $mean.rank === 3 || $mean.rank === 1,\n `Error in batchNormalization3D: mean must be rank 3 or rank 1 but ` +\n `got rank ${$mean.rank}.`);\n util.assert(\n $variance.rank === 3 || $variance.rank === 1,\n `Error in batchNormalization3D: variance must be rank 3 or rank 1 ` +\n `but got rank ${$variance.rank}.`);\n if ($scale != null) {\n util.assert(\n $scale.rank === 3 || $scale.rank === 1,\n `Error in batchNormalization3D: scale must be rank 3 or rank 1 ` +\n `but got rank ${$scale.rank}.`);\n }\n if ($offset != null) {\n util.assert(\n $offset.rank === 3 || $offset.rank === 1,\n `Error in batchNormalization3D: offset must be rank 3 or rank 1 ` +\n `but got rank ${$offset.rank}.`);\n }\n\n return batchNormalization(\n $x, $mean, $variance, varianceEpsilon, $scale, $offset);\n}\n\n/**\n * Batch normalization, strictly for 4D. For the more relaxed version, see\n * `batchNormalization`.\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\nfunction batchNormalization4d_(\n x: Tensor4D|TensorLike, mean: Tensor4D|Tensor1D|TensorLike,\n variance: Tensor4D|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor4D|Tensor1D|TensorLike,\n offset?: Tensor4D|Tensor1D|TensorLike): Tensor4D {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor4D|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor4D|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n util.assert(\n $x.rank === 4,\n `Error in batchNormalization4D: x must be rank 4 but got rank ` +\n `${$x.rank}.`);\n util.assert(\n $mean.rank === 4 || $mean.rank === 1,\n `Error in batchNormalization4D: mean must be rank 4 or rank 1 but ` +\n `got rank ${$mean.rank}.`);\n util.assert(\n $variance.rank === 4 || $variance.rank === 1,\n `Error in batchNormalization4D: variance must be rank 4 or rank 1 ` +\n `but got rank ${$variance.rank}.`);\n if ($scale != null) {\n util.assert(\n $scale.rank === 4 || $scale.rank === 1,\n `Error in batchNormalization4D: scale must be rank 4 or rank 1 ` +\n `but got rank ${$scale.rank}.`);\n }\n if ($offset != null) {\n util.assert(\n $offset.rank === 4 || $offset.rank === 1,\n `Error in batchNormalization4D: offset must be rank 4 or rank 1 ` +\n `but got rank ${$offset.rank}.`);\n }\n return batchNormalization(\n $x, $mean, $variance, varianceEpsilon, $scale, $offset);\n}\n\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two\n * shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNormalization2d`\n * - `tf.batchNormalization3d`\n * - `tf.batchNormalization4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction batchNormalization_(\n x: Tensor|Tensor1D|TensorLike, mean: Tensor|Tensor1D|TensorLike,\n variance: Tensor|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor|Tensor1D|TensorLike,\n offset?: Tensor|Tensor1D|TensorLike): Tensor {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n\n util.assert(\n $mean.rank === $variance.rank,\n 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert(\n $offset == null || $mean.rank === $offset.rank,\n 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert(\n $scale == null || $mean.rank === $scale.rank,\n 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n\n let x4D: Tensor4D;\n if ($x.rank === 0 || $x.rank === 1) {\n x4D = $x.as4D(1, 1, 1, $x.size);\n } else if ($x.rank === 2) {\n x4D = $x.as4D(1, 1, $x.shape[0], $x.shape[1]);\n } else if ($x.rank === 3) {\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]) as Tensor4D;\n } else {\n x4D = $x as Tensor4D;\n }\n\n const der = (dy: Tensor) => {\n const scaleValue = $scale == null ? scalar(1) : $scale;\n const reductionAxes = getReductionAxes($mean.shape, x4D.shape);\n const tileShape: number[] = [];\n if ($mean.rank === 1) {\n for (let i = 0; i < x4D.shape.length - 1; ++i) {\n tileShape.push(x4D.shape[i]);\n }\n tileShape.push(1);\n }\n\n const xMinusMean = $x.sub($mean);\n const dyTimesScaleValue = dy.mul(scaleValue);\n const oneOverSqrtVariance = rsqrt($variance.add(scalar(varianceEpsilon)));\n const minusHalfRCube = oneOverSqrtVariance.mul(oneOverSqrtVariance)\n .mul(oneOverSqrtVariance)\n .mul(scalar(-0.5));\n const derX = () => {\n if ($mean.rank === 1) {\n return dy\n .mul(tile(\n oneOverSqrtVariance.as4D(1, 1, 1, $mean.shape[0]), tileShape))\n .mul(scaleValue)\n .reshape($x.shape);\n } else {\n return dy.mul(oneOverSqrtVariance).mul(scaleValue).reshape($x.shape);\n }\n };\n const derMean = () => {\n let meanDer = oneOverSqrtVariance.mul(scalar(-1)).mul(dyTimesScaleValue);\n if ($mean.rank === 1) {\n meanDer = meanDer.sum(reductionAxes);\n }\n return meanDer.reshape($mean.shape);\n };\n const derVariance = () => {\n let varianceDer = minusHalfRCube.mul(xMinusMean).mul(dyTimesScaleValue);\n if ($mean.rank === 1) {\n varianceDer = varianceDer.sum(reductionAxes);\n }\n return varianceDer.reshape($mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = xMinusMean.mul(oneOverSqrtVariance);\n let scaleDer = dy.mul(xMinusMean2TimesRsqrt);\n if ($mean.rank === 1) {\n scaleDer = scaleDer.sum(reductionAxes);\n }\n return scaleDer.reshape($mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if ($mean.rank === 1) {\n offsetDer = offsetDer.sum(reductionAxes);\n }\n return offsetDer.reshape($mean.shape);\n };\n return {\n $x: derX,\n $mean: derMean,\n $variance: derVariance,\n $scale: derScale,\n $offset: derOffset\n };\n };\n\n const res = ENV.engine.runKernel(\n backend => backend.batchNormalization(\n x4D, batchnormReshape4D($mean), batchnormReshape4D($variance),\n varianceEpsilon, batchnormReshape4D($scale),\n batchnormReshape4D($offset)),\n {$x, $mean, $variance, $scale, $offset}, der);\n return res.reshape($x.shape);\n}\n\nfunction batchnormReshape4D(x: Tensor): Tensor4D|Tensor1D {\n if (x == null) {\n return null;\n }\n if (x.rank === 0) {\n return x.as1D();\n } else if (x.rank === 1) {\n return x as Tensor1D;\n } else if (x.rank === 2) {\n return x.as4D(1, 1, x.shape[0], x.shape[1]);\n } else if (x.rank === 3) {\n return x.as4D(1, x.shape[0], x.shape[1], x.shape[2]);\n }\n return x as Tensor4D;\n}\n\nexport const batchNormalization2d = op({batchNormalization2d_});\nexport const batchNormalization3d = op({batchNormalization3d_});\nexport const batchNormalization4d = op({batchNormalization4d_});\nexport const batchNormalization = op({batchNormalization_});\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as util from '../util';\n\nexport type PadInfo = {\n top: number,\n left: number,\n right: number,\n bottom: number,\n type: string\n};\n\n/**\n * Information about the forward pass of a convolution/pooling operation.\n * It includes input and output shape, strides, filter size and padding\n * information.\n */\nexport type Conv2DInfo = {\n batchSize: number,\n inHeight: number,\n inWidth: number,\n inChannels: number,\n outHeight: number,\n outWidth: number,\n outChannels: number,\n dataFormat: 'channelsFirst'|'channelsLast',\n strideHeight: number,\n strideWidth: number,\n dilationHeight: number,\n dilationWidth: number,\n filterHeight: number,\n filterWidth: number,\n padInfo: PadInfo,\n inShape: [number, number, number, number],\n outShape: [number, number, number, number],\n filterShape: [number, number, number, number]\n};\n\nexport function computePool2DInfo(\n inShape: [number, number, number, number],\n filterSize: [number, number]|number, strides: number|[number, number],\n pad: 'same'|'valid'|number, roundingMode?: 'floor'|'round'|'ceil',\n dataFormat: 'channelsFirst'|'channelsLast' = 'channelsLast'): Conv2DInfo {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n\n let filterShape: [number, number, number, number];\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n } else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n } else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const dilations = 1;\n\n return computeConv2DInfo(\n inShape, filterShape, strides, dilations, pad, roundingMode, false,\n dataFormat);\n}\n\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(\n inShape: [number, number, number, number],\n filterShape: [number, number, number, number],\n strides: number|[number, number], dilations: number|[number, number],\n pad: 'same'|'valid'|number, roundingMode?: 'floor'|'round'|'ceil',\n depthwise = false,\n dataFormat: 'channelsFirst'|'channelsLast' = 'channelsLast'): Conv2DInfo {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n } else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n } else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n\n const effectiveFilterHeight =\n getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth =\n getEffectiveFilterSize(filterWidth, dilationWidth);\n const {padInfo, outHeight, outWidth} = getPadAndOutInfo(\n pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight,\n effectiveFilterWidth, roundingMode);\n\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n\n let outShape: [number, number, number, number];\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n } else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n\nfunction computeOutputShape3D(\n inShape: [number, number, number], fieldSize: number, outDepth: number,\n stride: number, zeroPad?: number,\n roundingMode?: 'floor'|'round'|'ceil'): [number, number, number] {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n\n const outputRows = conditionalRound(\n (inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n util.assert(\n util.isInt(outputRows),\n `The output # of rows (${outputRows}) must be an integer. Change the ` +\n `stride and/or zero pad parameters`);\n\n const outputCols = conditionalRound(\n (inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n util.assert(\n util.isInt(outputCols),\n `The output # of columns (${outputCols}) must be an integer. Change ` +\n `the stride and/or zero pad parameters`);\n\n return [outputRows, outputCols, outDepth];\n}\n\nexport function computeDefaultPad(\n inputShape: [number, number, number], fieldSize: number, stride: number,\n dilation = 1): number {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor(\n (inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\n\nfunction parseTupleParam(param: number|[number, number]): [number, number] {\n return typeof param === 'number' ? [param, param] : param;\n}\n\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize: number, dilation: number) {\n if (dilation <= 1) {\n return filterSize;\n }\n\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\n\nfunction getPadAndOutInfo(\n pad: 'same'|'valid'|number, inHeight: number, inWidth: number,\n strideHeight: number, strideWidth: number, filterHeight: number,\n filterWidth: number, roundingMode?: 'floor'|'round'|'ceil'):\n {padInfo: PadInfo, outHeight: number, outWidth: number} {\n let padInfo: PadInfo;\n let outHeight: number;\n let outWidth: number;\n\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {top: pad, bottom: pad, left: pad, right: pad, type: padType};\n const outShape = computeOutputShape3D(\n [inHeight, inWidth, 1], filterHeight, 1, strideHeight, pad,\n roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n } else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight =\n (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = {top, bottom, left, right, type: 'SAME'};\n } else if (pad === 'valid') {\n padInfo = {top: 0, bottom: 0, left: 0, right: 0, type: 'VALID'};\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n } else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return {padInfo, outHeight, outWidth};\n}\n\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode\n */\nfunction conditionalRound(\n value: number, roundingMode?: 'floor'|'round'|'ceil') {\n if (!roundingMode) {\n return value;\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport {op} from './operation';\n\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction conv1d_(\n x: T|TensorLike, filter: Tensor3D|TensorLike, stride: number,\n pad: 'valid'|'same'|number, dataFormat: 'NWC'|'NCW' = 'NWC', dilation = 1,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n\n let x3D = $x as Tensor3D;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = $x.as3D(1, $x.shape[0], $x.shape[1]);\n }\n\n util.assert(\n x3D.rank === 3,\n `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert(\n $filter.rank === 3,\n `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n util.assert(\n x3D.shape[2] === $filter.shape[1],\n `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(\n eitherStridesOrDilationsAreOne(stride, dilation),\n 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(\n dataFormat === 'NWC',\n `Error in conv1d: got dataFormat of ${\n dataFormat} but only NWC is currently supported.`);\n\n const filter4D =\n $filter.as4D(1, $filter.shape[0], $filter.shape[1], $filter.shape[2]);\n const input4D = x3D.as4D(x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]);\n const strides: [number, number] = [1, stride];\n const dilations: [number, number] = [1, dilation];\n\n const conv2dDataFormat = 'NHWC';\n\n const res = conv2d(\n input4D, filter4D, strides, pad, conv2dDataFormat, dilations,\n dimRoundingMode);\n\n if (reshapedTo3D) {\n return res.as2D(res.shape[2], res.shape[3]) as T;\n }\n return res.as3D(res.shape[0], res.shape[2], res.shape[3]) as T;\n}\n\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction conv2d_(\n x: T|TensorLike, filter: Tensor4D|TensorLike,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert(\n $filter.rank === 4,\n `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n util.assert(\n x4D.shape[3] === $filter.shape[2],\n `Error in conv2d: depth of input (${x4D.shape[3]}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(\n eitherStridesOrDilationsAreOne(strides, dilations),\n 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n util.assert(\n dataFormat === 'NHWC',\n `Error in conv2d: got dataFormat of ${\n dataFormat} but only NHWC is currently supported.`);\n\n const convInfo = conv_util.computeConv2DInfo(\n x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode);\n\n const grad = (dy: Tensor4D) => {\n util.assert(\n tupleValuesAreOne(dilations),\n 'Error in gradient of conv2D: dilation rates greater than 1 are not' +\n `yet supported in gradients. Got dilations '${dilations}'`);\n\n return {\n x: () => conv2dDerInput_(x4D.shape, dy, $filter, strides, pad),\n $filter: () => conv2dDerFilter_(x4D, dy, $filter.shape, strides, pad)\n };\n };\n\n const res = ENV.engine.runKernel(\n backend => backend.conv2d(x4D, $filter, convInfo), {x: x4D, $filter},\n grad);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\nfunction conv2dDerInput_(\n xShape: [number, number, number, number]|[number, number, number], dy: T,\n filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n util.assert(\n xShape.length === dy.rank,\n `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n\n let xShape4D = xShape as [number, number, number, number];\n let dy4D = dy as Tensor4D;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n\n const inDepth = xShape4D[3];\n const outDepth = dy4D.shape[3];\n util.assert(\n xShape4D.length === 4,\n `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(\n dy4D.rank === 4,\n `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(\n filter.rank === 4,\n `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n util.assert(\n inDepth === filter.shape[2],\n `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(\n outDepth === filter.shape[3],\n `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const dilations = 1;\n\n const convInfo = conv_util.computeConv2DInfo(\n xShape4D, filter.shape, strides, dilations, pad, dimRoundingMode);\n const res = ENV.engine.runKernel(\n backend => backend.conv2dDerInput(dy4D, filter, convInfo), {dy4D});\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. The\n * rounding mode used when computing output dimensions if pad is a\n * number. If none is provided, it will not round and error if the output\n * is of fractional size.\n */\nfunction conv2dDerFilter_(\n x: T, dy: T, filterShape: [number, number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): Tensor4D {\n let x4D = x as Tensor4D;\n if (x.rank === 3) {\n x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]);\n }\n let dy4D = dy as Tensor4D;\n if (dy4D.rank === 3) {\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(\n dy4D.rank === 4,\n `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(\n filterShape.length === 4,\n `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n util.assert(\n x4D.shape[3] === filterShape[2],\n `Error in conv2dDerFilter: depth of input ${x4D.shape[3]}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(\n dy4D.shape[3] === filterShape[3],\n `Error in conv2dDerFilter: depth of dy (${dy4D.shape[3]}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const dilations = 1;\n\n const convInfo = conv_util.computeConv2DInfo(\n x4D.shape, filterShape, strides, dilations, pad, dimRoundingMode);\n return ENV.engine.runKernel(\n backend => backend.conv2dDerFilter(x4D, dy4D, convInfo), {x4D, dy4D});\n}\n\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction conv2dTranspose_(\n x: T|TensorLike, filter: Tensor4D|TensorLike,\n outputShape: [number, number, number, number]|[number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n\n return conv2dDerInput_(\n outputShape, $x, $filter, strides, pad, dimRoundingMode);\n}\n\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction depthwiseConv2d_(\n x: T|TensorLike, filter: Tensor4D|TensorLike,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert(\n $filter.rank === 4,\n `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(\n x4D.shape[3] === $filter.shape[2],\n `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dilations == null) {\n dilations = [1, 1];\n }\n util.assert(\n eitherStridesOrDilationsAreOne(strides, dilations),\n 'Error in depthwiseConv2d: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const convInfo = conv_util.computeConv2DInfo(\n x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode,\n true /* depthwise */);\n\n const grad = (dy: Tensor4D) => {\n util.assert(\n tupleValuesAreOne(dilations),\n 'Error in gradient of depthwiseConv2d: dilation rates greater than ' +\n `1 are not yet supported. Got dilations '${dilations}'`);\n return {\n x: () => depthwiseConv2dDerInput(x4D.shape, dy, $filter, convInfo),\n $filter: () => depthwiseConv2dDerFilter(x4D, dy, $filter.shape, convInfo),\n };\n };\n\n const res = ENV.engine.runKernel(\n backend => backend.depthwiseConv2D(x4D, $filter, convInfo),\n {x: x4D, $filter}, grad);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction separableConv2d_(\n x: T|TensorLike, depthwiseFilter: Tensor4D|TensorLike,\n pointwiseFilter: Tensor4D|TensorLike, strides: [number, number]|number,\n pad: 'valid'|'same', dilation: [number, number]|number = [1, 1],\n dataFormat: 'NHWC'|'NCHW' = 'NHWC'): T {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter =\n convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter =\n convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n\n if (dataFormat === 'NCHW') {\n throw new Error(\n 'separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n\n util.assert(\n x4D.rank === 4,\n `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert(\n $depthwiseFilter.rank === 4,\n `Error in separableConv2d: depthwise filter must be rank 4, but got ` +\n `rank ${$depthwiseFilter.rank}.`);\n util.assert(\n $pointwiseFilter.rank === 4,\n `Error in separableConv2d: pointwise filter must be rank 4, but got ` +\n `rank ${$depthwiseFilter.rank}.`);\n util.assert(\n $pointwiseFilter.shape[0] === 1,\n `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert(\n $pointwiseFilter.shape[1] === 1,\n `Error in separableConv2d: the second dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert(\n $pointwiseFilter.shape[2] === inChannels * channelMultiplier,\n `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n\n const depthwise = depthwiseConv2d(\n x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res =\n conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\nfunction parseTupleParam(param: number|[number, number]): [number, number] {\n return typeof param === 'number' ? [param, param] : param;\n}\n\nfunction tupleValuesAreOne(param: number|[number, number]): boolean {\n const [dimA, dimB] = parseTupleParam(param);\n return dimA === 1 && dimB === 1;\n}\n\nfunction eitherStridesOrDilationsAreOne(\n strides: number|[number, number],\n dilations: number|[number, number]): boolean {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n\nfunction depthwiseConv2dDerInput(\n xShape: [number, number, number, number]|[number, number, number], dy: T,\n filter: Tensor4D, convInfo: conv_util.Conv2DInfo): T {\n let dy4D = dy as Tensor4D;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n }\n const res = ENV.engine.runKernel(\n backend => backend.depthwiseConv2DDerInput(dy4D, filter, convInfo),\n {dy4D});\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\nfunction depthwiseConv2dDerFilter(\n x: T, dy: T, filterShape: [number, number, number, number],\n convInfo: conv_util.Conv2DInfo): Tensor4D {\n let x4D = x as Tensor4D;\n if (x.rank === 3) {\n x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]);\n }\n let dy4D = dy as Tensor4D;\n if (dy4D.rank === 3) {\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n }\n return ENV.engine.runKernel(\n backend => backend.depthwiseConv2DDerFilter(x4D, dy4D, convInfo),\n {x4D, dy4D});\n}\n\nexport const conv1d = op({conv1d_});\nexport const conv2d = op({conv2d_});\nexport const depthwiseConv2d = op({depthwiseConv2d_});\nexport const separableConv2d = op({separableConv2d_});\nexport const conv2dTranspose = op({conv2dTranspose_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\n\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction matMul_(\n a: Tensor2D|TensorLike, b: Tensor2D|TensorLike, transposeA = false,\n transposeB = false): Tensor2D {\n const $a = convertToTensor(a, 'a', 'matMul');\n const $b = convertToTensor(b, 'b', 'matMul');\n\n const innerShapeA = transposeA ? $a.shape[0] : $a.shape[1];\n const innerShapeB = transposeB ? $b.shape[1] : $b.shape[0];\n\n util.assert(\n $a.rank === 2 && $b.rank === 2,\n `Error in matMul: inputs must be rank 2, got ranks ${$a.rank}` +\n ` and ${$b.rank}.`);\n\n util.assert(\n innerShapeA === innerShapeB,\n `Error in matMul: inner shapes (${innerShapeA}) and (` +\n `${innerShapeB}) of Tensors with shapes ${$a.shape} and ` +\n `${$b.shape} and transposeA=${transposeA}` +\n ` and transposeB=${transposeB} must match.`);\n\n const grad = (dy: Tensor2D) => {\n if (!transposeA && !transposeB) {\n return {\n $a: () => dy.matMul($b.toFloat(), false, true),\n $b: () => $a.toFloat().matMul(dy, true, false)\n };\n } else if (!transposeA && transposeB) {\n return {\n $a: () => dy.matMul($b.toFloat(), false, false),\n $b: () => dy.matMul($a.toFloat(), true, false)\n };\n } else if (transposeA && !transposeB) {\n return {\n $a: () => $b.toFloat().matMul(dy, false, true),\n $b: () => $a.toFloat().matMul(dy, false, false)\n };\n } else {\n return {\n $a: () => $b.toFloat().matMul(dy, true, true),\n $b: () => dy.matMul($a.toFloat(), true, true)\n };\n }\n };\n return ENV.engine.runKernel(\n backend => backend.matMul($a, $b, transposeA, transposeB), {$a, $b},\n grad);\n}\n\n/**\n * Computes the outer product of two vectors, v1 and v2.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([3, 4, 5]);\n *\n * tf.outerProduct(a, b).print();\n * ```\n * @param v1 The first vector in the outer product operation.\n * @param v2 The second vector in the dot product operation.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction outerProduct_(\n v1: Tensor1D|TensorLike, v2: Tensor1D|TensorLike): Tensor2D {\n const $v1 = convertToTensor(v1, 'v1', 'outerProduct');\n const $v2 = convertToTensor(v2, 'v2', 'outerProduct');\n\n util.assert(\n $v1.rank === 1 && $v2.rank === 1,\n `Error in outerProduct: inputs must be rank 1, but got ranks ` +\n `${$v1.rank} and ${$v2.rank}.`);\n\n return $v1.as2D(-1, 1).matMul($v2.as2D(1, -1));\n}\n\n/**\n * Computes the dot product of two matrices and/or vectors, t1 and t2.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction dot_(t1: Tensor|TensorLike, t2: Tensor|TensorLike): Tensor {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(\n ($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2),\n `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n\n util.assert(\n t1Inner === t2Inner,\n `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n\n if ($t1.rank === 1 && $t2.rank === 1) {\n return $t1.as2D(1, -1).matMul($t2.as2D(-1, 1)).asScalar();\n } else if ($t1.rank === 1 && $t2.rank === 2) {\n return $t1.as2D(1, -1).matMul($t2.as2D($t2.shape[0], $t2.shape[1])).as1D();\n } else if ($t1.rank === 2 && $t2.rank === 1) {\n return $t1.matMul($t2.as2D(-1, 1)).as1D();\n } else {\n return $t1.matMul($t2.as2D($t2.shape[0], $t2.shape[1]));\n }\n}\n\nexport const matMul = op({matMul_});\nexport const dot = op({dot_});\nexport const outerProduct = op({outerProduct_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {parseAxisParam} from './axis_util';\nimport {op} from './operation';\n\n/**\n * Reverses a `Tensor1D`.\n *\n * @param x The input tensor.\n */\nfunction reverse1d_(x: Tensor1D|TensorLike): Tensor1D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 1, `Error in reverse1D: x must be rank 1 but got\n rank ${$x.rank}.`);\n return reverse($x, 0);\n}\n\n/**\n * Reverses a `Tensor2D` along a specified axis\n *\n * @param x The input tensor.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\nfunction reverse2d_(x: Tensor2D|TensorLike, axis?: number|number[]): Tensor2D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 2, `Error in reverse2D: x must be rank 2 but got\n rank ${$x.rank}.`);\n return reverse($x, axis);\n}\n\n/**\n * Reverses a `Tensor3D` along a specified axis\n *\n * @param x The input tensor.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\nfunction reverse3d_(x: Tensor3D|TensorLike, axis?: number|number[]): Tensor3D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 3, `Error in reverse3D: x must be rank 3 but got\n rank ${$x.rank}.`);\n return reverse($x, axis);\n}\n\n/**\n * Reverses a `Tensor4D` along a specified axis\n *\n * @param x The input tensor.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\nfunction reverse4d_(x: Tensor4D|TensorLike, axis?: number|number[]): Tensor4D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 4, `Error in reverse4D: x must be rank 4 but got\n rank ${$x.rank}.`);\n return reverse($x, axis);\n}\n\n/**\n * Reverses a `Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction reverse_(\n x: T|TensorLike, axis?: number|number[]): T {\n const $x = convertToTensor(x, 'x', 'reverse');\n\n if ($x.rank === 0) {\n return $x.clone();\n }\n const axes = parseAxisParam(axis, $x.shape);\n const grad = (dy: T) => {\n return {$x: () => dy.reverse(axes)};\n };\n const res =\n ENV.engine.runKernel(backend => backend.reverse($x, axes), {$x}, grad);\n return res.reshapeAs($x);\n}\n\nexport const reverse = op({reverse_});\nexport const reverse1d = op({reverse1d_});\nexport const reverse2d = op({reverse2d_});\nexport const reverse3d = op({reverse3d_});\nexport const reverse4d = op({reverse4d_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport {op} from './operation';\n\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction maxPool_(\n x: T|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'maxPool');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const convInfo = conv_util.computePool2DInfo(\n x4D.shape, filterSize, strides, pad, dimRoundingMode);\n\n const grad = (dy: Tensor4D, saved: Tensor[]) => {\n const [y4D] = saved;\n return {\n x: () =>\n maxPoolBackprop(dy, x4D, y4D as Tensor4D, filterSize, strides, pad)\n };\n };\n\n const res = ENV.engine.runKernel(\n (backend, save) => save(backend.maxPool(x4D, convInfo)), {x: x4D}, grad);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction avgPool_(\n x: T|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'avgPool');\n util.assert(\n $x.dtype === 'float32', 'The input dtype to avgPool must be float32');\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const convInfo =\n conv_util.computePool2DInfo(x4D.shape, filterSize, strides, pad);\n\n const grad = (dy: Tensor4D) => {\n return {x: () => avgPoolBackprop(dy, x4D, filterSize, strides, pad)};\n };\n let res = ENV.engine.runKernel(\n backend => backend.avgPool(x4D, convInfo), {x: x4D}, grad);\n res = res.cast($x.dtype);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the backprop of a max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size, a tuple [filterHeight, filterWidth].\n * @param strides The strides of the pooling: [strideHeight, strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. The\n * rounding mode used when computing output dimensions if pad is a\n * number. If none is provided, it will not round and error if the output\n * is of fractional size.\n */\nfunction maxPoolBackprop(\n dy: Tensor4D|TensorLike, input: Tensor4D|TensorLike,\n output: Tensor4D|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): Tensor4D {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolBackprop');\n const $input = convertToTensor(input, 'input', 'maxPoolBackprop');\n const $output = convertToTensor(output, 'output', 'maxPoolBackprop');\n util.assert(\n $input.rank === $dy.rank,\n `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n\n util.assert(\n $dy.rank === 4,\n `Error in maxPoolBackprop: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert(\n $input.rank === 4,\n `Error in maxPoolBackprop: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in maxPoolBackprop: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const convInfo = conv_util.computePool2DInfo(\n $input.shape, filterSize, strides, pad, dimRoundingMode);\n const res = ENV.engine.runKernel(\n backend => backend.maxPoolBackprop($dy, $input, $output, convInfo),\n {$dy, $input});\n return res;\n}\n\n/**\n * Computes the backprop of an avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size, a tuple [filterHeight, filterWidth].\n * @param strides The strides of the pooling: [strideHeight, strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolBackprop(\n dy: T|TensorLike, input: T|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number): T {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolBackprop');\n const $input = convertToTensor(input, 'input', 'avgPoolBackprop');\n util.assert(\n $input.rank === $dy.rank,\n `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n\n let input4D = $input as Tensor4D;\n let dy4D = $dy as Tensor4D;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D = $input.as4D(1, $input.shape[0], $input.shape[1], $input.shape[2]);\n dy4D = $dy.as4D(1, $dy.shape[0], $dy.shape[1], $dy.shape[2]);\n }\n\n util.assert(\n dy4D.rank === 4,\n `Error in avgPoolBackprop: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(\n input4D.rank === 4,\n `Error in avgPoolBackprop: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n\n const convInfo =\n conv_util.computePool2DInfo(input4D.shape, filterSize, strides, pad);\n const res = ENV.engine.runKernel(\n backend => backend.avgPoolBackprop(dy4D, input4D, convInfo),\n {dy4D, input4D});\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\nexport const maxPool = op({maxPool_});\nexport const avgPool = op({avgPool_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {Rank, TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\nimport * as slice_util from './slice_util';\n\n/**\n * Extracts a 1D slice from 1D array starting at coordinates `begin` and is\n * of length `size`. See `slice` for details.\n */\nfunction slice1d_(\n x: Tensor1D|TensorLike, begin: number, size: number): Tensor1D {\n const $x = convertToTensor(x, 'x', 'slice1d');\n util.assert(\n $x.rank === 1,\n `slice1d expects a rank-1 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, [begin], [size]);\n}\n\n/**\n * Extracts a 2D slice from a 2D array starting at coordinates `begin` and\n * is of size `size`. See `slice` for details.\n */\nfunction slice2d_(\n x: Tensor2D|TensorLike, begin: [number, number],\n size: [number, number]): Tensor2D {\n const $x = convertToTensor(x, 'x', 'slice2d');\n util.assert(\n $x.rank === 2,\n `slice1d expects a rank-2 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, begin, size);\n}\n\n/**\n * Extracts a 3D slice from a 3D array starting at coordinates `begin` and\n * is of size `size`. See `slice` for details.\n */\nfunction slice3d_(\n x: Tensor3D|TensorLike, begin: [number, number, number],\n size: [number, number, number]): Tensor3D {\n const $x = convertToTensor(x, 'x', 'slice3d');\n util.assert(\n $x.rank === 3,\n `slice1d expects a rank-3 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, begin, size);\n}\n\n/**\n * Extracts a 4D slice from a 4D array starting at coordinates `begin` and\n * is of size `size`. See `slice` for details.\n */\nfunction slice4d_(\n x: Tensor4D|TensorLike, begin: [number, number, number, number],\n size: [number, number, number, number]): Tensor4D {\n const $x = convertToTensor(x, 'x', 'slice4d');\n util.assert(\n $x.rank === 4,\n `slice1d expects a rank-4 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, begin, size);\n}\n\n/**\n * Extracts a slice from a `Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction slice_>(\n x: T|TensorLike, begin: number|number[], size?: number|number[]): T {\n const $x = convertToTensor(x, 'x', 'slice');\n\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n // The following logic allows for more ergonomic calls.\n let begin_: number[];\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array($x.rank - 1).fill(0)];\n } else if (begin.length < $x.rank) {\n begin_ = begin.concat(new Array($x.rank - begin.length).fill(0));\n } else {\n begin_ = begin;\n }\n let size_: number[];\n if (size == null) {\n size_ = new Array($x.rank).fill(-1);\n } else if (typeof size === 'number') {\n size_ = [size, ...new Array($x.rank - 1).fill(-1)];\n } else if (size.length < $x.rank) {\n size_ = size.concat(new Array($x.rank - size.length).fill(-1));\n } else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n } else {\n util.assert(d === -1, 'Bad value in size');\n return $x.shape[i] - begin_[i];\n }\n });\n slice_util.assertParamsValid($x, begin_, size_);\n const inputShape = $x.shape;\n const grad = (dy: T) => {\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings: Array<[number, number]> = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return {$x: () => dy.pad(paddings)};\n };\n return ENV.engine.runKernel(\n backend => backend.slice($x, begin_, size_), {$x}, grad) as T;\n}\n\nexport const slice = op({slice_});\nexport const slice1d = op({slice1d_});\nexport const slice2d = op({slice2d_});\nexport const slice3d = op({slice3d_});\nexport const slice4d = op({slice4d_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Environment} from './environment';\nexport {customGrad, grad, grads, valueAndGrad, valueAndGrads, variableGrads} from './gradients';\n\nexport const tidy = Environment.tidy;\nexport const keep = Environment.keep;\nexport const dispose = Environment.dispose;\nexport const time = Environment.time;\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {customGrad} from '../globals';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as axis_util from './axis_util';\nimport {op} from './operation';\nimport {ones, scalar} from './tensor_ops';\n\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction logSumExp_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n\n const axes = axis_util.parseAxisParam(axis, $x.shape);\n const xMax = $x.max(axes, true /* keepDims */);\n const a = $x.sub(xMax);\n const b = a.exp();\n const c = b.sum(axes);\n const d = c.log();\n const res = xMax.reshape(d.shape).add(d);\n\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, axes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the sum of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If axes has no entries, all dimensions are reduced, and a `Tensor` with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction sum_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'sum');\n\n if ($x.dtype === 'bool') {\n $x = $x.toInt();\n }\n const axes = axis_util.parseAxisParam(axis, $x.shape);\n\n // Use a custom gradient to bypass 2 gradient backprops since sum is used\n // extremely often.\n const customOp = customGrad(x => {\n const permutation = axis_util.getAxesPermutation(axes, x.rank);\n let reductionAxes = axes;\n let permutedX = x;\n if (permutation != null) {\n permutedX = x.transpose(permutation);\n reductionAxes = axis_util.getInnerMostAxes(reductionAxes.length, x.rank);\n }\n let value = ENV.engine.runKernel(\n backend => backend.sum(permutedX, reductionAxes), {permutedX});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(value.shape, axes);\n value = value.reshape(newShape);\n }\n\n const gradFunc = (dy: Tensor) => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = dy.reshape(expandedDyShape);\n const derX = expandedDy.mul(ones(x.shape, 'float32'));\n return derX;\n };\n return {value, gradFunc};\n });\n\n return customOp($x) as T;\n}\n\n/**\n * Computes the mean of elements across dimensions of a `Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction mean_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n const $x = convertToTensor(x, 'x', 'mean');\n\n const axes = axis_util.parseAxisParam(axis, $x.shape);\n const shapes = axis_util.computeOutAndReduceShapes($x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n\n // Use a custom gradient to bypass 2 gradient backprops since mean is used\n // extremely often.\n const customOp = customGrad(x => {\n const reduceSizeScalar = scalar(reduceSize);\n // Cast if needed.\n const xReduce =\n reduceSizeScalar.dtype === x.dtype ? x : x.cast(reduceSizeScalar.dtype);\n const res = xReduce.div(reduceSizeScalar);\n const value = res.sum(axis, keepDims);\n\n const gradFunc = (dy: Tensor) => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = dy.reshape(expandedDyShape);\n const derX =\n expandedDy.mul(ones(x.shape, 'float32')).div(reduceSizeScalar);\n return derX;\n };\n return {value, gradFunc};\n });\n\n return customOp($x) as T;\n}\n\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction min_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'min');\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.min($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the maximum of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction max_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'max');\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.max($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction argMin_(x: Tensor|TensorLike, axis = 0): T {\n let $x = convertToTensor(x, 'x', 'argMin');\n\n if (axis == null) {\n axis = 0;\n }\n let axes = axis_util.parseAxisParam(axis, $x.shape);\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n return ENV.engine.runKernel(backend => backend.argMin($x, axes[0]), {$x}) as\n T;\n}\n\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction argMax_(x: Tensor|TensorLike, axis = 0): T {\n let $x = convertToTensor(x, 'x', 'argMax');\n\n if (axis == null) {\n axis = 0;\n }\n let axes = axis_util.parseAxisParam(axis, $x.shape);\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n return ENV.engine.runKernel(backend => backend.argMax($x, axes[0]), {$x}) as\n T;\n}\n\n/**\n * Computes the logical and of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1]);\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction all_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'all', 'bool');\n util.assert(\n $x.dtype === 'bool',\n `Error Tensor must be of type bool. Got: ${$x.dtype}`);\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.all($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the logical or of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1]);\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction any_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'any', 'bool');\n util.assert(\n $x.dtype === 'bool',\n `Error Tensor must be of type bool. Got: ${$x.dtype}`);\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.any($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Calculates the mean and variance of `x`. The mean and variance are\n * calculated by aggregating the contents of `x` across `axes`. If `x` is\n * 1-D and `axes = [0]` this is just the mean and variance of a vector.\n *\n * @param x The input tensor.\n * @param axis The dimension(s) along with to compute mean and\n * variance. By default it reduces all dimensions.\n * @param keepDims If true, the moments have the same dimensionality as the\n * input.\n * @return An object with two keys: `mean` and `variance`.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction moments_(\n x: Tensor|TensorLike, axis: number|number[] = null,\n keepDims = false): {mean: Tensor, variance: Tensor} {\n x = convertToTensor(x, 'x', 'moments');\n const axes = axis_util.parseAxisParam(axis, x.shape);\n const mean = x.mean(axes, keepDims);\n let keepDimsShape = mean.shape;\n if (!keepDims) {\n keepDimsShape = axis_util.expandShapeToKeepDim(mean.shape, axes);\n }\n const devSquared = x.toFloat().sub(mean.reshape(keepDimsShape)).square();\n const variance = devSquared.mean(axes, keepDims);\n return {mean, variance};\n}\n\nexport const all = op({all_});\n// tslint:disable-next-line:variable-name\nexport const any = op({any_});\nexport const argMax = op({argMax_});\nexport const argMin = op({argMin_});\nexport const logSumExp = op({logSumExp_});\nexport const max = op({max_});\nexport const mean = op({mean_});\nexport const min = op({min_});\nexport const moments = op({moments_});\nexport const sum = op({sum_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {assertTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assertShapesMatch} from '../util';\nimport {assertAndGetBroadcastShape} from './broadcast_util';\nimport {op} from './operation';\n\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * We also expose `notEqualStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction notEqual_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'notEqual');\n const $b = convertToTensor(b, 'b', 'notEqual');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n return ENV.engine.runKernel(backend => backend.notEqual($a, $b), {$a, $b}) as\n T;\n}\n\n/**\n * Strict version of `notEqual` that forces `a` and `b` to be of the same\n * shape.\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same shape and dtype as\n * `a`.\n */\nfunction notEqualStrict_(\n a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'notEqualStrict');\n const $b = convertToTensor(b, 'b', 'notEqualStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in notEqualStrict: ');\n return $a.notEqual($b);\n}\n\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * We also expose `lessStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction less_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'less');\n const $b = convertToTensor(b, 'b', 'less');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.less($a, $b), {$a, $b}) as T;\n}\n\n/**\n * Strict version of `less` that forces `a` and `b` to be of the same\n * shape.\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same shape and dtype as\n * `a`.\n */\nfunction lessStrict_(a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'lessStrict');\n const $b = convertToTensor(b, 'b', 'lessStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in lessStrict: ');\n return $a.less($b);\n}\n\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * We also expose `equalStrict` which has the same signature as this op\n * and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction equal_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'equal');\n const $b = convertToTensor(b, 'b', 'equal');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.equal($a, $b), {$a, $b}) as T;\n}\n\nfunction equalStrict_(a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'equalStrict');\n const $b = convertToTensor(b, 'b', 'equalStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in equalStrict: ');\n return $a.equal($b);\n}\n\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * We also expose `lessEqualStrict` which has the same signature as this op\n * and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction lessEqual_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'lessEqual');\n const $b = convertToTensor(b, 'b', 'lessEqual');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.lessEqual($a, $b), {$a, $b}) as\n T;\n}\n\nfunction lessEqualStrict_(\n a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'lessEqualStrict');\n const $b = convertToTensor(b, 'b', 'lessEqualStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in lessEqualStrict: ');\n return $a.lessEqual($b);\n}\n\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * We also expose `greaterStrict` which has the same signature as this\n * op and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction greater_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greater');\n const $b = convertToTensor(b, 'b', 'greater');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.greater($a, $b), {$a, $b}) as\n T;\n}\n\nfunction greaterStrict_(a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greaterStrict');\n const $b = convertToTensor(b, 'b', 'greaterStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in greaterStrict: ');\n return $a.greater($b);\n}\n\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * We also expose `greaterEqualStrict` which has the same signature as this\n * op and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction greaterEqual_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greaterEqual');\n const $b = convertToTensor(b, 'b', 'greaterEqual');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(\n backend => backend.greaterEqual($a, $b), {$a, $b}) as T;\n}\n\nfunction greaterEqualStrict_(\n a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greaterEqualStrict');\n const $b = convertToTensor(b, 'b', 'greaterEqualStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in greaterEqualStrict: ');\n return $a.greaterEqual($b);\n}\n\nexport const equal = op({equal_});\nexport const equalStrict = op({equalStrict_});\nexport const greater = op({greater_});\nexport const greaterEqual = op({greaterEqual_});\nexport const greaterEqualStrict = op({greaterEqualStrict_});\nexport const greaterStrict = op({greaterStrict_});\nexport const less = op({less_});\nexport const lessEqual = op({lessEqual_});\nexport const lessEqualStrict = op({lessEqualStrict_});\nexport const lessStrict = op({lessStrict_});\nexport const notEqual = op({notEqual_});\nexport const notEqualStrict = op({notEqualStrict_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {KernelBackend} from '../kernels/backend';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {assertTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike, upcastType} from '../types';\nimport * as util from '../util';\nimport * as broadcast_util from './broadcast_util';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\nimport {neg} from './unary_ops';\n\n/**\n * Adds two `Tensor`s element-wise, A + B. Supports broadcasting.\n *\n * We also expose `addStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `Tensor` to add.\n * @param b The second `Tensor` to add. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction add_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'add');\n const $b = convertToTensor(b, 'b', 'add');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($b.shape);\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(backend => backend.add($a, $b), {$a, $b}, der) as\n T;\n}\n\n/**\n * Adds a list of `Tensor`s element-wise, each with the same shape and dtype.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n *\n * tf.addN([a, b, c]).print();\n * ```\n * @param tensors A list of tensors with the same shape and dtype.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction addN_(tensors: Array): T {\n util.assert(\n Array.isArray(tensors),\n () => 'The param passed to tf.addN() must be a list of tensors');\n util.assert(\n tensors.length >= 1,\n () => `Must pass at least one tensor to tf.addN(), but got ` +\n `${tensors.length}`);\n const $tensors =\n tensors.map((t, i) => convertToTensor(t, `tensors${i}`, 'addN'));\n const firstTensor = $tensors[0];\n $tensors.forEach(t => {\n if (t.dtype !== firstTensor.dtype) {\n throw new Error(\n 'All tensors passed to tf.addN() must have the same dtype');\n }\n });\n $tensors.forEach(t => {\n if (!util.arraysEqual(t.shape, firstTensor.shape)) {\n throw new Error(\n 'All tensors passed to tf.addN() must have the same shape');\n }\n });\n\n const der = (dy: T) => {\n const ders: {[key: string]: () => Tensor} = {};\n $tensors.forEach((t, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n };\n const inputs: NamedTensorMap = $tensors as {} as NamedTensorMap;\n return ENV.engine.runKernel(backend => backend.addN($tensors), inputs, der);\n}\n\n/**\n * Adds two `Tensor`s element-wise, A + B.\n *\n * Inputs must be the same shape. For broadcasting support, use add() instead.\n *\n * @param a The first Tensor to add element-wise.\n * @param b The second Tensor to add element-wise.\n */\nfunction addStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in addStrict: ');\n return a.add(b);\n}\n\n/**\n * Subtracts two `Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * We also expose `subStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `Tensor` to subtract from.\n * @param b The second `Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction sub_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'sub');\n const $b = convertToTensor(b, 'b', 'sub');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.neg().reshape($b.shape);\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.subtract($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Subtracts two `Tensor`s element-wise, A - B. Inputs must\n * be the same shape.\n *\n * For broadcasting support, use sub() instead.\n *\n * @param a The first Tensor to subtract element-wise.\n * @param b The second Tensor to subtract element-wise.\n */\nfunction subStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in subStrict: ');\n return a.sub(b);\n}\n\n/**\n * Computes the power of one `Tensor` to another. Supports broadcasting.\n *\n * Given a `Tensor` x and a `Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `Tensor` to pow element-wise.\n * @param exp The exponent `Tensor` to pow element-wise.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction pow_(base: T|TensorLike, exp: Tensor|TensorLike): T {\n const $base = convertToTensor(base, 'base', 'pow');\n const $exp = convertToTensor(exp, 'exp', 'pow');\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($base.shape, $exp.shape);\n base = $base.cast(upcastType($base.dtype, $exp.dtype));\n exp = $exp.cast(upcastType($base.dtype, $exp.dtype));\n const grad = (dy: Tensor, saved: Tensor[]) => {\n const [y] = saved;\n const derBase = () => {\n let res = dy.mul($exp.toFloat().mul(y.div($base)));\n const reduceAxes = broadcast_util.getReductionAxes($base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($base.shape) as T;\n };\n const derExp = () => {\n let res = dy.mul(y.mul($base.log()).toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($exp.shape);\n };\n return {$base: derBase, $exp: derExp};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.pow($base, $exp)), {$base, $exp},\n grad) as T;\n}\n\n/**\n * Computes the power of one `Tensor` to another. Inputs must\n * be the same shape.\n *\n * For broadcasting support, use pow() instead.\n *\n * @param base The base tensor to pow element-wise.\n * @param exp The exponent tensor to pow element-wise.\n */\nfunction powStrict_(base: T, exp: Tensor): T {\n util.assertShapesMatch(base.shape, exp.shape, 'Error in powStrict: ');\n return base.pow(exp);\n}\n\n/**\n * Multiplies two `Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction mul_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'mul');\n const $b = convertToTensor(b, 'b', 'mul');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n const res = dy.mul($b.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = dy.mul($a.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($b.shape);\n }\n return res;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.multiply($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Multiplies two `Tensor`s element-wise, A * B.\n *\n * Inputs must be the same shape. For broadcasting support, use mul().\n *\n * @param a The first tensor to multiply.\n * @param b The first tensor to multiply. Must have the same\n * dtype as `a`.\n */\nfunction mulStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in multiplyStrict: ');\n return a.mul(b) as T;\n}\n\n/**\n * Divides two `Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * We also expose `divStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction div_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'div');\n const $b = convertToTensor(b, 'b', 'div');\n assertTypesMatch($a, $b);\n\n let forwardFunc: (backend: KernelBackend) => Tensor;\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n } else {\n forwardFunc = (backend: KernelBackend) => backend.realDivide($a, $b);\n }\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => {\n const res = dy.div($b.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = dy.mul($a.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes).reshape($b.shape);\n }\n const tmp = $b.square() as Tensor;\n return res.div(tmp.toFloat()).neg() as Tensor;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(forwardFunc, {$a, $b}, der) as T;\n}\n\n/**\n * Divides two `Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction floorDiv_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'floorDiv');\n const $b = convertToTensor(b, 'b', 'floorDiv');\n assertTypesMatch($a, $b);\n\n const forwardFunc = (backend: KernelBackend) => backend.floorDiv($a, $b);\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => {\n const res = dy.div($b.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = dy.mul($a.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes).reshape($b.shape);\n }\n const tmp = $b.square() as Tensor;\n return res.div(tmp.toFloat()).neg() as Tensor;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(forwardFunc, {$a, $b}, der) as T;\n}\n\n/**\n * Divides two `Tensor`s element-wise, A / B. Inputs must\n * be the same shape.\n *\n * @param a The first tensor as the numerator for element-wise division.\n * @param b The second tensor as the denominator for element-wise division.\n */\nfunction divStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in divideStrict: ');\n return a.div(b) as T;\n}\n\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction mod_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'mod');\n const $b = convertToTensor(b, 'b', 'mod');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => {\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return dy.sum(reduceAxes).reshape($a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = dy.mul($a.div($b).floor().neg());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($b.shape);\n }\n return res;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(backend => backend.mod($a, $b), {$a, $b}, der) as\n T;\n}\n\n/**\n * Returns the mod of a and b (`a < b ? a : b`) element-wise. Inputs must\n * be the same shape. For broadcasting support, use mod().\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n */\nfunction modStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in modStrict: ');\n return a.mod(b);\n}\n\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction minimum_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n assertTypesMatch($a, $b);\n\n if ($a.dtype === 'bool') {\n $a = $a.toInt();\n }\n if ($b.dtype === 'bool') {\n $b = $b.toInt();\n }\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => dy.mul($a.lessEqual($b).toFloat());\n const derB = () => dy.mul($a.greater($b).toFloat());\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.minimum($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise. Inputs must\n * be the same shape. For broadcasting support, use minimum().\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n */\nfunction minimumStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: ');\n return a.minimum(b);\n}\n\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction maximum_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n assertTypesMatch($a, $b);\n\n if ($a.dtype === 'bool') {\n $a = $a.toInt();\n }\n if ($b.dtype === 'bool') {\n $b = $b.toInt();\n }\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => dy.mul($a.greaterEqual($b).toFloat());\n const derB = () => dy.mul($a.less($b).toFloat());\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.maximum($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise. Inputs must\n * be the same shape. For broadcasting support, use maximum().\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n */\nfunction maximumStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: ');\n return a.maximum(b);\n}\n\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * We also expose `squaredDifferenceStrict` which has the same signature as\n * this op and asserts that `a` and `b` are the same shape (does not\n * broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction squaredDifference_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'squaredDifference');\n const $b = convertToTensor(b, 'b', 'squaredDifference');\n assertTypesMatch($a, $b);\n\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const two = scalar(2);\n const derA = () => dy.mul($a.sub($b).mul(two));\n const derB = () => dy.mul($b.sub($a).mul(two));\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.squaredDifference($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Returns (a - b) * (a - b) element-wise.\n *\n * Inputs must be the same shape. For broadcasting support, use\n * squaredDifference() instead.\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\nfunction squaredDifferenceStrict_(a: T, b: T): T {\n util.assertShapesMatch(\n a.shape, b.shape, 'Error in squaredDifferenceStrict: ');\n return a.squaredDifference(b);\n}\n\n/**\n * Computes arctangent of `Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction atan2_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'atan2');\n const $b = convertToTensor(b, 'b', 'atan2');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n const d = add($a.square(), $b.square());\n let res = dy.mul($b.div(d));\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($a.shape);\n };\n const derB = () => {\n const d = add($a.square(), $b.square()) as T;\n let res = neg(dy.mul($a.div(d)));\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($b.shape);\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.atan2($a, $b), {$a, $b}, der) as T;\n}\n\nexport const add = op({add_});\nexport const addN = op({addN_});\nexport const addStrict = op({addStrict_});\nexport const atan2 = op({atan2_});\nexport const div = op({div_});\nexport const divStrict = op({divStrict_});\nexport const floorDiv = op({floorDiv_});\nexport const maximum = op({maximum_});\nexport const maximumStrict = op({maximumStrict_});\nexport const minimum = op({minimum_});\nexport const minimumStrict = op({minimumStrict_});\nexport const mod = op({mod_});\nexport const modStrict = op({modStrict_});\nexport const mul = op({mul_});\nexport const mulStrict = op({mulStrict_});\nexport const pow = op({pow_});\nexport const powStrict = op({powStrict_});\nexport const squaredDifference = op({squaredDifference_});\nexport const squaredDifferenceStrict = op({squaredDifferenceStrict_});\nexport const sub = op({sub_});\nexport const subStrict = op({subStrict_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {whereImpl} from '../kernels/where_impl';\nimport {Tensor, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assert, assertShapesMatch} from '../util';\nimport {assertAndGetBroadcastShape} from './broadcast_util';\nimport {op} from './operation';\nimport {zerosLike} from './tensor_ops';\n\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalNot_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n assert($x.dtype === 'bool', 'Error Array must be of type bool.');\n\n return ENV.engine.runKernel(backend => backend.logicalNot($x), {$x});\n}\n\n/**\n * Returns the truth value of a AND b element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalAnd_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assert(\n $a.dtype === 'bool' && $b.dtype === 'bool',\n 'Error Array must be of type bool.');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(\n backend => backend.logicalAnd($a, $b), {$a, $b}) as T;\n}\n\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalOr_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assert(\n $a.dtype === 'bool' && $b.dtype === 'bool',\n 'Error Array must be of type bool.');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.logicalOr($a, $b), {$a, $b}) as\n T;\n}\n\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalXor_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assert(\n $a.dtype === 'bool' && $b.dtype === 'bool',\n 'Error Array must be of type bool.');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n // x ^ y = (x | y) & ~(x & y)\n return logicalOr(a, b).logicalAnd(logicalAnd(a, b).logicalNot()) as T;\n}\n\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same shape and type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction where_(\n condition: Tensor|TensorLike, a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n\n assert($condition.dtype === 'bool', 'Error Condition must be of type bool.');\n assertShapesMatch($a.shape, $b.shape, 'Error in where: ');\n\n if ($condition.rank === 1) {\n // If condition rank is 1, then the first dimension must match the size of\n // condition.\n assert(\n $condition.shape[0] === $a.shape[0],\n 'The first dimension of `a` must match the size of `condition`.');\n } else {\n // A must have the same shape as condition.\n assertShapesMatch($condition.shape, $b.shape, 'Error in where: ');\n }\n\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n const grad = (dy: T) => ({\n $condition: () => zerosLike($condition),\n $a: () => dy.mul($condition.cast($a.dtype)) as T,\n $b: () => dy.mul($condition.logicalNot().cast($b.dtype)) as T\n });\n\n return ENV.engine.runKernel(\n backend => backend.select($condition, $a, $b),\n {$condition, $a, $b}, grad) as T;\n}\n\n/**\n * Returns the coordinates of true elements of condition.\n *\n * The coordinates are returned in a 2-D tensor where the first dimension (rows)\n * represents the number of true elements, and the second dimension (columns)\n * represents the coordinates of the true elements. Keep in mind, the shape of\n * the output tensor can vary depending on how many true values there are in\n * input. Indices are output in row-major order. The resulting tensor has the\n * shape `[numTrueElems, condition.rank]`.\n */\nasync function whereAsync_(condition: Tensor|TensorLike): Promise {\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n assert($condition.dtype === 'bool', 'Condition must be of type bool.');\n const vals = await $condition.data();\n const res = whereImpl($condition.shape, vals);\n if (condition !== $condition) {\n $condition.dispose();\n }\n return res;\n}\n\nexport const logicalAnd = op({logicalAnd_});\nexport const logicalNot = op({logicalNot_});\nexport const logicalOr = op({logicalOr_});\nexport const logicalXor = op({logicalXor_});\nexport const where = op({where_});\nexport const whereAsync = whereAsync_;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {maximum, minimum} from './binary_ops';\nimport {where} from './logical_ops';\nimport {op} from './operation';\nimport {SELU_SCALE, SELU_SCALEALPHA} from './selu_util';\nimport {scalar} from './tensor_ops';\n\n/**\n * Computes rectified linear element-wise: `max(x, 0)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction relu_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'relu');\n\n if ($x.dtype === 'bool') {\n return $x.toInt();\n }\n const grad = (dy: T) => {\n const stepRes = $x.step();\n return {$x: () => dy.mulStrict(stepRes.toFloat())};\n };\n return ENV.engine.runKernel(backend => backend.relu($x), {$x}, grad);\n}\n\n/**\n * Computes exponential linear element-wise, `x > 0 ? e ^ x - 1 : 0`\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction elu_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'elu');\n\n const grad = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {\n $x: () =>\n ENV.engine.runKernel(backend => backend.eluDer(dy, y), {dy, y}) as T\n };\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.elu($x)), {$x}, grad);\n}\n\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction selu_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'selu');\n\n const grad = (dy: T) => {\n return {\n $x: () => {\n const mask = $x.greater(scalar(0));\n\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n\n const greaterThanZeroDer = dy.mul(scale);\n const lessEqualZeroDer = dy.mul(scaleAlpha).mul($x.toFloat().exp());\n\n return where(mask, greaterThanZeroDer, lessEqualZeroDer) as T;\n }\n };\n };\n return ENV.engine.runKernel(backend => backend.selu($x), {$x}, grad);\n}\n\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction leakyRelu_(x: T|TensorLike, alpha = 0.2): T {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n return maximum(scalar(alpha).mul($x), $x);\n}\n\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction prelu_(x: T|TensorLike, alpha: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n\n const zero = scalar(0);\n return maximum(zero, $x).add($alpha.mul(minimum(zero, $x)));\n}\n\nexport const elu = op({elu_});\nexport const leakyRelu = op({leakyRelu_});\nexport const prelu = op({prelu_});\nexport const relu = op({relu_});\nexport const selu = op({selu_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as axis_util from './axis_util';\nimport {op} from './operation';\n\n/**\n * Transposes the `Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction transpose_(x: T|TensorLike, perm?: number[]): T {\n const $x = convertToTensor(x, 'x', 'transpose');\n\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert(\n $x.rank === perm.length,\n `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(\n axis >= 0 && axis < $x.rank,\n `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n\n if ($x.rank <= 1) {\n return $x.clone();\n }\n\n const der = (dy: T) => {\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return {$x: () => dy.transpose(undoPerm)};\n };\n return ENV.engine.runKernel(\n backend => backend.transpose($x, perm), {$x}, der);\n}\n\nexport const transpose = op({transpose_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\n\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction localResponseNormalization_(\n x: T|TensorLike, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5): T {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert(\n $x.rank === 4 || $x.rank === 3,\n `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(\n util.isInt(depthRadius),\n `Error in localResponseNormalization: depthRadius must be an integer\n but got depthRadius ${depthRadius}.`);\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n const backward = (dy: Tensor4D, saved: Tensor[]) => {\n const [outputImage] = saved;\n return {\n x4D: () => ENV.engine.runKernel(\n backend => backend.LRNGrad(\n dy, x4D, outputImage as Tensor4D, depthRadius, bias, alpha, beta),\n {})\n };\n };\n const res = ENV.engine.runKernel(\n (backend, save) => save(backend.localResponseNormalization4D(\n x4D, depthRadius, bias, alpha, beta)),\n {x4D}, backward);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n } else {\n return res as T;\n }\n}\n\nexport const localResponseNormalization = op({localResponseNormalization_});","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as axis_util from './axis_util';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\n\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction norm_(\n x: Tensor|TensorLike, ord: number|'euclidean'|'fro' = 'euclidean',\n axis: number|number[] = null, keepDims = false): Tensor {\n x = convertToTensor(x, 'x', 'norm');\n\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = axis_util.parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return norm.reshape(keepDimsShape);\n}\n\nfunction normImpl(\n x: Tensor, p: number|string, axis: number|number[] = null): Tensor {\n if (x.rank === 0) {\n return x.abs();\n }\n\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(x.reshape([-1]), p, axis);\n }\n\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n axis instanceof Array && axis.length === 1) {\n if (p === 1) {\n return x.abs().sum(axis);\n }\n if (p === Infinity) {\n return x.abs().max(axis);\n }\n if (p === -Infinity) {\n return x.abs().min(axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return x.abs().pow(scalar(2, 'int32')).sum(axis).sqrt() as Tensor;\n }\n\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n\n // matrix (assumption axis[0] < axis[1])\n if (axis instanceof Array && axis.length === 2) {\n if (p === 1) {\n return x.abs().sum(axis[0]).max(axis[1] - 1);\n }\n if (p === Infinity) {\n return x.abs().sum(axis[1]).max(axis[0]);\n }\n if (p === -Infinity) {\n return x.abs().sum(axis[1]).min(axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return x.square().sum(axis).sqrt();\n }\n\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\n\nexport const norm = op({norm_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assert, isInt} from '../util';\nimport {expandDims} from './array_ops';\nimport {getUndoAxesPermutation, parseAxisParam} from './axis_util';\nimport {maximum} from './binary_ops';\nimport {greaterEqual} from './compare';\nimport {logicalAnd, where} from './logical_ops';\nimport {op} from './operation';\nimport {ones, scalar, zerosLike} from './tensor_ops';\n\n/**\n * Computes the sum along segments of a `Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `Tensor` that will be summed along its segments\n * @param segmentIds A `Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`\n */\n/** @doc {heading: 'Operations', subheading: 'Segment'} */\nfunction unsortedSegmentSum_(\n x: T|TensorLike, segmentIds: Tensor1D|TensorLike, numSegments: number): T {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds =\n convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert($segmentIds.dtype === 'int32', 'segmentIds must be of dtype `int32`');\n assert(isInt(numSegments), 'numSegments must be of dtype int');\n\n const gradFunc = (dy: T) => {\n const derX = () => {\n return gatherDropNegatives(dy, $segmentIds);\n };\n return {$x: derX};\n };\n return ENV.engine.runKernel(\n backend =>\n backend.unsortedSegmentSum($x, $segmentIds, numSegments),\n {$x}, gradFunc) as T;\n}\n\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction gather_(\n x: T|TensorLike, indices: Tensor1D|TensorLike, axis = 0): T {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n\n assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`');\n axis = parseAxisParam(axis, $x.shape)[0];\n const grad = (dy: T) => {\n const derX = () => {\n if (axis === 0) {\n return unsortedSegmentSum(dy, $indices, $x.shape[axis]);\n }\n const paramsShape = $x.shape;\n const indicesSize = $indices.size;\n\n const outerShape = paramsShape.slice(0, axis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices =\n arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n\n const values = dy.reshape(valuesShape);\n const reshapedIndices = $indices.reshape([indicesSize]);\n\n const transposeDims =\n arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = values.transpose(transposeDims);\n\n let paramsGrad = unsortedSegmentSum(\n valuesTranspose, reshapedIndices as Tensor1D, $x.shape[axis]);\n\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = paramsGrad.transpose(invertTransposeDims);\n\n return paramsGrad as T;\n };\n return {$x: derX};\n };\n return ENV.engine.runKernel(\n backend => backend.gather($x, $indices as Tensor1D, axis), {$x},\n grad) as T;\n}\n\nfunction arrayRange(start: number, stop: number): number[] {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\n\nfunction arrayConcat(arrays: number[][]): number[] {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n\nfunction gatherDropNegatives(x: T, indices: Tensor1D) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices as Tensor1D);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n\nexport const gather = op({gather_});\nexport const unsortedSegmentSum = op({unsortedSegmentSum_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Scalar, Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor, convertToTensorArray} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * @docalias (data: Tensor2D, c: Tensor2D, h: Tensor2D): [Tensor2D, Tensor2D]\n */\nexport type LSTMCellFunc = {\n (data: Tensor2D, c: Tensor2D, h: Tensor2D): [Tensor2D, Tensor2D];\n};\n\n/**\n * Computes the next states and outputs of a stack of LSTMCells.\n *\n * Each cell output is used as input to the next cell.\n *\n * Returns `[cellState, cellOutput]`.\n *\n * Derived from tf.contrib.rn.MultiRNNCell.\n *\n * @param lstmCells Array of LSTMCell functions.\n * @param data The input to the cell.\n * @param c Array of previous cell states.\n * @param h Array of previous cell outputs.\n */\n/** @doc {heading: 'Operations', subheading: 'RNN'} */\nfunction multiRNNCell_(\n lstmCells: LSTMCellFunc[], data: Tensor2D|TensorLike,\n c: Tensor2D[]|TensorLike[],\n h: Tensor2D[]|TensorLike[]): [Tensor2D[], Tensor2D[]] {\n const $data = convertToTensor(data, 'data', 'multiRNNCell');\n const $c = convertToTensorArray(c, 'c', 'multiRNNCell');\n const $h = convertToTensorArray(h, 'h', 'multiRNNCell');\n\n let input = $data;\n const newStates = [];\n for (let i = 0; i < lstmCells.length; i++) {\n const output = lstmCells[i](input, $c[i], $h[i]);\n newStates.push(output[0]);\n newStates.push(output[1]);\n input = output[1];\n }\n const newC: Tensor2D[] = [];\n const newH: Tensor2D[] = [];\n for (let i = 0; i < newStates.length; i += 2) {\n newC.push(newStates[i]);\n newH.push(newStates[i + 1]);\n }\n return [newC, newH];\n}\n\n/**\n * Computes the next state and output of a BasicLSTMCell.\n *\n * Returns `[newC, newH]`.\n *\n * Derived from tf.contrib.rnn.BasicLSTMCell.\n *\n * @param forgetBias Forget bias for the cell.\n * @param lstmKernel The weights for the cell.\n * @param lstmBias The bias for the cell.\n * @param data The input to the cell.\n * @param c Previous cell state.\n * @param h Previous cell output.\n */\n/** @doc {heading: 'Operations', subheading: 'RNN'} */\nfunction basicLSTMCell_(\n forgetBias: Scalar|TensorLike, lstmKernel: Tensor2D|TensorLike,\n lstmBias: Tensor1D|TensorLike, data: Tensor2D|TensorLike,\n c: Tensor2D|TensorLike, h: Tensor2D|TensorLike): [Tensor2D, Tensor2D] {\n const $forgetBias =\n convertToTensor(forgetBias, 'forgetBias', 'basicLSTMCell');\n const $lstmKernel =\n convertToTensor(lstmKernel, 'lstmKernel', 'basicLSTMCell');\n const $lstmBias = convertToTensor(lstmBias, 'lstmBias', 'basicLSTMCell');\n const $data = convertToTensor(data, 'data', 'basicLSTMCell');\n const $c = convertToTensor(c, 'c', 'basicLSTMCell');\n const $h = convertToTensor(h, 'h', 'basicLSTMCell');\n\n const combined = $data.concat($h, 1);\n const weighted = combined.matMul($lstmKernel);\n const res = weighted.add($lstmBias) as Tensor2D;\n\n // i = input_gate, j = new_input, f = forget_gate, o = output_gate\n const batchSize = res.shape[0];\n const sliceCols = res.shape[1] / 4;\n const sliceSize: [number, number] = [batchSize, sliceCols];\n const i = res.slice([0, 0], sliceSize);\n const j = res.slice([0, sliceCols], sliceSize);\n const f = res.slice([0, sliceCols * 2], sliceSize);\n const o = res.slice([0, sliceCols * 3], sliceSize);\n\n const newC = i.sigmoid().mulStrict(j.tanh()).addStrict(\n $c.mulStrict($forgetBias.add(f).sigmoid() as Tensor2D));\n const newH = newC.tanh().mulStrict(o.sigmoid());\n return [newC, newH];\n}\n\nexport const basicLSTMCell = op({basicLSTMCell_});\nexport const multiRNNCell = op({multiRNNCell_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Scalar, Tensor} from '../tensor';\nimport {assertTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {pow} from './binary_ops';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\n\n/**\n * Compute the moving average of a variable.\n *\n * Without zeroDebias, the moving average operation is defined by:\n * `v += delta`\n * where\n * `delta = (1 - decay) * (x - v)`\n *\n * With zeroDebias (default), the `delta` term is scaled to debias the\n * effect of the (assumed) zero-initialization of `v`.\n * `delta /= (1 - decay ^ step)`\n *\n * For more details on the zero-debiasing algorithm, see:\n * https://arxiv.org/abs/1412.6980\n *\n * Note that this function is completely stateless and does not keep track of\n * step count. The step count needs to be maintained by the caller and passed\n * in as `step`.\n *\n * @param v The current moving average value.\n * @param x New input value, must have the same shape and dtype as `v`.\n * @param decay The decay factor. Typical values are 0.95 and 0.99.\n * @param step Step count.\n * @param zeroDebias: Whether zeroDebias is to be performed (default: `true`).\n * @returns The new moving average value.\n */\n/** @doc {heading: 'Operations', subheading: 'Moving Average'} */\nfunction movingAverage_(\n v: T|TensorLike, x: T|TensorLike, decay: number|Scalar,\n step?: number|Scalar, zeroDebias = true): T {\n const $v = convertToTensor(v, 'v', 'movingAverage');\n const $x = convertToTensor(x, 'x', 'movingAverage');\n const $decay = convertToTensor(decay, 'decay', 'movingAverage');\n\n assertTypesMatch($v, $x);\n util.assert(\n util.arraysEqual($v.shape, $x.shape), 'Shape mismatch in v and x');\n\n const one = scalar(1);\n const oneMinusDecay = one.sub($decay);\n\n let update = $x.sub($v).mul(oneMinusDecay);\n if (zeroDebias) {\n util.assert(step != null, 'When using zeroDebias: true, step is required.');\n const $step = convertToTensor(step, 'step', 'movingAverage');\n update = update.div(one.sub(pow($decay, $step)));\n }\n return $v.add(update);\n}\n\nexport const movingAverage = op({movingAverage_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input_ tensor. Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of begin_mask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of end_mask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n */\n/** @doc {heading: 'Operations', subheading: 'Slicing and Joining'} */\nfunction stridedSlice_(\n x: T|TensorLike, begin: number[], end: number[], strides: number[],\n beginMask = 0, endMask = 0): T {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n return ENV.engine.runKernel(\n backend => backend.stridedSlice(\n $x, begin, end, strides, beginMask, endMask),\n {$x}) as T;\n}\n\nexport const stridedSlice = op({stridedSlice_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n */\n/** @doc {heading: 'Operations', subheading: 'Evaluation'} */\nfunction topk_(\n x: T|TensorLike, k = 1, sorted = true): {values: T, indices: T} {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(\n `'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n\n const [values, indices] =\n ENV.engine.runKernel(b => b.topk($x, k, sorted), {$x});\n return {values, indices};\n}\n\nexport const topk = op({topk_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {customGrad} from '../globals';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assertShapesMatch, sizeFromShape} from '../util';\n\nimport {expandShapeToKeepDim} from './axis_util';\n\nimport {minimum} from './binary_ops';\nimport {op} from './operation';\nimport {ones, scalar} from './tensor_ops';\n\nexport enum Reduction {\n NONE,\n MEAN,\n SUM,\n SUM_BY_NONZERO_WEIGHTS\n}\n\n/**\n * Computes the weighted loss between two tensors.\n *\n * @param losses Tensor of shape `[batch_size, d1, ... dN]`.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `losses`, and must be broadcastable to `losses` (i.e., all\n * dimensions must be either `1`, or the same as the corresponding\n * `losses` dimension).\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction computeWeightedLoss_(\n losses: T|TensorLike, weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $losses = convertToTensor(losses, 'losses', 'computeWeightedLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'computeWeightedLoss');\n }\n\n const weightedLoss = ($weights == null) ? $losses : $losses.mul($weights);\n\n if (reduction === Reduction.NONE) {\n return weightedLoss as O;\n }\n if (reduction === Reduction.SUM) {\n return weightedLoss.sum();\n }\n if (reduction === Reduction.MEAN) {\n if ($weights == null) {\n return weightedLoss.mean();\n } else {\n const broadcastFactor =\n sizeFromShape($losses.shape) / sizeFromShape($weights.shape);\n const result = weightedLoss.sum().div($weights.sum());\n return broadcastFactor > 1 ? result.div(scalar(broadcastFactor)) :\n result as O;\n }\n }\n if (reduction === Reduction.SUM_BY_NONZERO_WEIGHTS) {\n if ($weights == null) {\n return weightedLoss.sum().div(scalar($losses.size));\n } else {\n const broadcastedWeights = $weights.mul(ones($losses.shape));\n\n const numNonZeros =\n broadcastedWeights.notEqual(scalar(0)).sum().toFloat();\n return weightedLoss.sum().div(numNonZeros);\n }\n }\n\n throw Error(`Unknown reduction: ${reduction}`);\n}\n\n/**\n * Computes the absolute difference loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction absoluteDifference_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'absoluteDifference');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'absoluteDifference');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'absoluteDifference');\n }\n assertShapesMatch(\n $labels.shape, $predictions.shape, 'Error in absoluteDifference: ');\n\n const losses = $labels.sub($predictions).abs();\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the mean squared error between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction meanSquaredError_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'meanSquaredError');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'meanSquaredError');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'meanSquaredError');\n }\n assertShapesMatch(\n $labels.shape, $predictions.shape, 'Error in meanSquaredError: ');\n\n const losses = $labels.squaredDifference($predictions);\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the cosine distance loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param axis The dimension along which the cosine distance is computed.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction cosineDistance_(\n labels: T|TensorLike, predictions: T|TensorLike, axis: number,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'cosineDistance');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'cosineDistance');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'cosineDistance');\n }\n assertShapesMatch(\n $labels.shape, $predictions.shape, 'Error in cosineDistance: ');\n\n const one = scalar(1);\n const losses = one.sub($labels.mul($predictions).sum(axis, true));\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the Hinge loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction hingeLoss_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n let $labels = convertToTensor(labels, 'labels', 'hingeLoss');\n const $predictions = convertToTensor(predictions, 'predictions', 'hingeLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'hingeLoss');\n }\n assertShapesMatch($labels.shape, $predictions.shape, 'Error in hingeLoss: ');\n\n const one = scalar(1);\n // Convert binary labels to (-1, 1)\n $labels = scalar(2).mul($labels).sub(one);\n const losses = one.sub($labels.mul($predictions)).relu();\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the log loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param epsilon A small increment to avoid taking log of zero\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction logLoss_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike, epsilon = 1e-7,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'logLoss');\n const $predictions = convertToTensor(predictions, 'predictions', 'logLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'logLoss');\n }\n assertShapesMatch($labels.shape, $predictions.shape, 'Error in logLoss: ');\n\n const one = scalar(1);\n const epsilonScalar = scalar(epsilon);\n const losses = $labels.mul($predictions.add(epsilonScalar).log())\n .neg()\n .sub(one.sub($labels).mul(\n one.sub($predictions).add(epsilonScalar).log()));\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\nfunction sigmoidCrossEntropyWithLogits_(\n labels: T|TensorLike, logits: T|TensorLike): O {\n const $labels =\n convertToTensor(labels, 'labels', 'sigmoidCrossEntropyWithLogits');\n const $logits =\n convertToTensor(logits, 'logits', 'sigmoidCrossEntropyWithLogits');\n assertShapesMatch(\n $labels.shape, $logits.shape, 'Error in sigmoidCrossEntropyWithLogits: ');\n\n /**\n * Implementation Details:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n *\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n *\n * Hence, to ensure stability and avoid overflow, the implementation uses\n * this equivalent formulation:\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n */\n const maxOutput = $logits.relu();\n const outputXTarget = $logits.mul($labels);\n const sigmoidOutput = $logits.abs().neg().exp().log1p();\n\n return maxOutput.sub(outputXTarget).add(sigmoidOutput);\n}\n\n/**\n * Computes the sigmoid cross entropy loss between two tensors.\n *\n * If labelSmoothing is nonzero, smooth the labels towards 1/2:\n *\n * newMulticlassLabels = multiclassLabels * (1 - labelSmoothing)\n * + 0.5 * labelSmoothing\n *\n * @param multiClassLabels The ground truth output tensor of shape\n * [batch_size, num_classes], same dimensions as 'predictions'.\n * @param logits The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param labelSmoothing If greater than 0, then smooth the labels.\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc { heading: 'Training', subheading: 'Losses', namespace: 'losses' } */\nfunction sigmoidCrossEntropy_(\n multiClassLabels: T|TensorLike, logits: T|TensorLike,\n weights?: Tensor|TensorLike, labelSmoothing = 0,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n let $multiClassLabels = convertToTensor(\n multiClassLabels, 'multiClassLabels', 'sigmoidCrossEntropy');\n const $logits = convertToTensor(logits, 'logits', 'sigmoidCrossEntropy');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'sigmoidCrossEntropy');\n }\n assertShapesMatch(\n $multiClassLabels.shape, $logits.shape, 'Error in sigmoidCrossEntropy: ');\n\n if (labelSmoothing > 0) {\n const labelSmoothingScalar = scalar(labelSmoothing);\n const one = scalar(1);\n const half = scalar(0.5);\n\n $multiClassLabels = $multiClassLabels.mul(one.sub(labelSmoothingScalar))\n .add(half.mul(labelSmoothingScalar));\n }\n const losses = sigmoidCrossEntropyWithLogits_($multiClassLabels, $logits);\n\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the huber loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param delta Point where huber loss changes from quadratic to linear.\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`.\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction huberLoss_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike, delta = 1.0,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'huberLoss');\n const $predictions = convertToTensor(predictions, 'predictions', 'huberLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'huberLoss');\n }\n assertShapesMatch($labels.shape, $predictions.shape, 'Error in huberLoss: ');\n\n const deltaScalar = scalar(delta);\n const error = $predictions.sub($labels).abs();\n const quadratic = minimum(error, deltaScalar);\n const linear = error.sub(quadratic);\n\n const losses =\n scalar(0.5).mul(quadratic.square()).add(deltaScalar.mul(linear));\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes softmax cross entropy between logits and labels.\n *\n * Measures the probability error in discrete classification tasks in which\n * the classes are mutually exclusive (each entry is in exactly one class).\n * For example, each CIFAR-10 image is labeled with one and only one label: an\n * image can be a dog or a truck, but not both.\n *\n * `NOTE`: While the classes are mutually exclusive, their probabilities need\n * not be. All that is required is that each row of labels is a valid\n * probability distribution. If they are not, the computation of the gradient\n * will be incorrect.\n *\n * `WARNING`: This op expects unscaled logits, since it performs a softmax on\n * logits internally for efficiency. Do not call this op with the output of\n * softmax, as it will produce incorrect results.\n *\n * logits and labels must have the same shape, e.g. [batch_size, num_classes]\n * and the same dtype.\n * @param labels The labels array.\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n */\nfunction softmaxCrossEntropyWithLogits_(\n labels: T, logits: T, dim = -1): O {\n if (dim === -1) {\n dim = logits.rank - 1;\n }\n\n if (dim !== logits.rank - 1) {\n throw Error(\n `Softmax cross entropy along a non-last dimension is not yet ` +\n `supported. Labels / logits was rank ${logits.rank} ` +\n `and dim was ${dim}`);\n }\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((labels, logits) => {\n // Reference:\n // 1. http://cs231n.github.io/linear-classify/#softmax\n // 2. https://blog.feedly.com/tricks-of-the-trade-logsumexp/\n const keepDims = true;\n const lse = logits.logSumExp([dim], keepDims);\n\n const logResult = logits.toFloat().sub(lse);\n const costVector = logResult.mul(labels).neg();\n\n const value = costVector.sum([dim]) as O;\n\n const gradFunc = (dy: O) => {\n const dyShape = expandShapeToKeepDim(dy.shape, [dim]);\n return [\n dy.reshape(dyShape).mul(labels.toFloat().sub(logResult.exp())),\n dy.reshape(dyShape).mul(logResult.exp().sub(labels.toFloat())),\n ];\n };\n return {value, gradFunc};\n });\n\n return customOp(labels, logits);\n}\n\n/**\n * Computes the softmax cross entropy loss between two tensors.\n *\n * If labelSmoothing is nonzero, smooth the labels towards 1/2:\n *\n * newOnehotLabels = onehotLabels * (1 - labelSmoothing)\n * + labelSmoothing / numClasses\n *\n * @param onehotLabels One hot encoded labels\n * [batch_size, num_classes], same dimensions as 'predictions'.\n * @param logits The predicted outputs.\n * @param weights Tensor whose rank is either 0, or 1, and must be\n * broadcastable to `loss` of shape [batch_size]\n * @param labelSmoothing If greater than 0, then smooth the labels.\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc { heading: 'Training', subheading: 'Losses', namespace: 'losses' } */\nfunction softmaxCrossEntropy_(\n onehotLabels: T|TensorLike, logits: T|TensorLike,\n weights?: Tensor|TensorLike, labelSmoothing = 0,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n let $onehotLabels =\n convertToTensor(onehotLabels, 'onehotLabels', 'softmaxCrossEntropy');\n const $logits = convertToTensor(logits, 'logits', 'softmaxCrossEntropy');\n let $weights: Tensor = null;\n\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'softmaxCrossEntropy');\n }\n\n assertShapesMatch(\n $onehotLabels.shape, $logits.shape, 'Error in softmaxCrossEntropy: ');\n\n if (labelSmoothing > 0) {\n const labelSmoothingScalar = scalar(labelSmoothing);\n const one = scalar(1);\n const numClasses = scalar($onehotLabels.shape[1]);\n\n $onehotLabels = $onehotLabels.mul(one.sub(labelSmoothingScalar))\n .add(labelSmoothingScalar.div(numClasses));\n }\n\n const losses = softmaxCrossEntropyWithLogits_($onehotLabels, $logits);\n\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\nexport const absoluteDifference = op({absoluteDifference_});\nexport const computeWeightedLoss = op({computeWeightedLoss_});\nexport const cosineDistance = op({cosineDistance_});\nexport const hingeLoss = op({hingeLoss_});\nexport const huberLoss = op({huberLoss_});\nexport const logLoss = op({logLoss_});\nexport const meanSquaredError = op({meanSquaredError_});\nexport const sigmoidCrossEntropy = op({sigmoidCrossEntropy_});\nexport const softmaxCrossEntropy = op({softmaxCrossEntropy_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Linear algebra ops.\n */\n\nimport {ENV} from '../environment';\nimport {dispose} from '../globals';\nimport {Tensor, Tensor1D, Tensor2D} from '../tensor';\nimport {assert} from '../util';\nimport {eye, split, squeeze, stack, unstack} from './array_ops';\nimport {norm} from './norm';\nimport {op} from './operation';\nimport {sum} from './reduction_ops';\nimport {tensor2d} from './tensor_ops';\n\n/**\n * Gram-Schmidt orthogonalization.\n *\n * @param xs The vectors to be orthogonalized, in one of the two following\n * formats:\n * - An Array of `Tensor1D`.\n * - A `Tensor2D`, i.e., a matrix, in which case the vectors are the rows\n * of `xs`.\n * In each case, all the vectors must have the same length and the length\n * must be greater than or equal to the number of vectors.\n * @returns The orthogonalized and normalized vectors or matrix.\n * Orthogonalization means that the vectors or the rows of the matrix\n * are orthogonal (zero inner products). Normalization means that each\n * vector or each row of the matrix has an L2 norm that equals `1`.\n */\n/** @doc {heading: 'Operations', subheading: 'Linear Algebra'} */\nfunction gramSchmidt_(xs: Tensor1D[]|Tensor2D): Tensor1D[]|Tensor2D {\n let inputIsTensor2D: boolean;\n if (Array.isArray(xs)) {\n inputIsTensor2D = false;\n assert(\n xs != null && xs.length > 0,\n 'Gram-Schmidt process: input must not be null, undefined, or empty');\n const dim = xs[0].shape[0];\n for (let i = 1; i < xs.length; ++i) {\n assert(\n xs[i].shape[0] === dim,\n 'Gram-Schmidt: Non-unique lengths found in the input vectors: ' +\n `(${xs[i].shape[0]} vs. ${dim})`);\n }\n } else {\n inputIsTensor2D = true;\n xs = split(xs, xs.shape[0], 0).map(x => squeeze(x, [0]));\n }\n\n assert(\n xs.length <= xs[0].shape[0],\n `Gram-Schmidt: Number of vectors (${xs.length}) exceeds ` +\n `number of dimensions (${xs[0].shape[0]}).`);\n\n const ys: Tensor1D[] = [];\n const xs1d = xs as Tensor1D[];\n for (let i = 0; i < xs.length; ++i) {\n ys.push(ENV.engine.tidy(() => {\n let x = xs1d[i];\n if (i > 0) {\n for (let j = 0; j < i; ++j) {\n const proj = sum(ys[j].mulStrict(x)).mul(ys[j]);\n x = x.sub(proj);\n }\n }\n return x.div(norm(x, 'euclidean'));\n }));\n }\n\n if (inputIsTensor2D) {\n return stack(ys, 0) as Tensor2D;\n } else {\n return ys;\n }\n}\n\n/**\n * Compute QR decomposition of m-by-n matrix using Householder transformation.\n *\n * Implementation based on\n * [http://www.cs.cornell.edu/~bindel/class/cs6210-f09/lec18.pdf]\n * (http://www.cs.cornell.edu/~bindel/class/cs6210-f09/lec18.pdf)\n *\n * @param x The `Tensor` to be QR-decomposed. Must have rank >= 2. Suppose\n * it has the shape `[..., M, N]`.\n * @param fullMatrices An optional boolean parameter. Defaults to `false`.\n * If `true`, compute full-sized `Q`. If `false` (the default),\n * compute only the leading N columns of `Q` and `R`.\n * @return An `Array` of two `Tensor`s: `[Q, R]`. `Q` is a unitary matrix,\n * i.e., its columns all have unit norm and are mutually orthogonal.\n * If `M >= N`,\n * If `fullMatrices` is `false` (default),\n * - `Q` has a shape of `[..., M, N]`,\n * - `R` has a shape of `[..., N, N]`.\n * If `fullMatrices` is `true` (default),\n * - `Q` has a shape of `[..., M, M]`,\n * - `R` has a shape of `[..., M, N]`.\n * If `M < N`,\n * - `Q` has a shape of `[..., M, M]`,\n * - `R` has a shape of `[..., M, N]`.\n * @throws If the rank of `x` is less than 2.\n */\n/** @doc {heading: 'Operations', subheading: 'Linear Algebra'} */\nfunction qr_(x: Tensor, fullMatrices = false): [Tensor, Tensor] {\n if (x.rank < 2) {\n throw new Error(\n `qr() requires input tensor to have a rank >= 2, but got rank ${\n x.rank}`);\n } else if (x.rank === 2) {\n return qr2d(x as Tensor2D, fullMatrices);\n } else {\n // Rank > 2.\n // TODO(cais): Below we split the input into individual 2D tensors,\n // perform QR decomposition on them and then stack the results back\n // together. We should explore whether this can be parallelized.\n const outerDimsProd = x.shape.slice(0, x.shape.length - 2)\n .reduce((value, prev) => value * prev);\n const x2ds = unstack(\n x.reshape([\n outerDimsProd, x.shape[x.shape.length - 2],\n x.shape[x.shape.length - 1]\n ]),\n 0);\n const q2ds: Tensor2D[] = [];\n const r2ds: Tensor2D[] = [];\n x2ds.forEach(x2d => {\n const [q2d, r2d] = qr2d(x2d as Tensor2D, fullMatrices);\n q2ds.push(q2d);\n r2ds.push(r2d);\n });\n const q = stack(q2ds, 0).reshape(x.shape);\n const r = stack(r2ds, 0).reshape(x.shape);\n return [q, r];\n }\n}\n\nfunction qr2d(x: Tensor2D, fullMatrices = false): [Tensor2D, Tensor2D] {\n return ENV.engine.tidy(() => {\n if (x.shape.length !== 2) {\n throw new Error(\n `qr2d() requires a 2D Tensor, but got a ${x.shape.length}D Tensor.`);\n }\n\n const m = x.shape[0];\n const n = x.shape[1];\n\n let q = eye(m) as Tensor2D; // Orthogonal transform so far.\n let r = x.clone(); // Transformed matrix so far.\n\n const one2D = tensor2d([[1]], [1, 1]);\n let w: Tensor2D = one2D.clone();\n\n const iters = m >= n ? n : m;\n for (let j = 0; j < iters; ++j) {\n // This tidy within the for-loop ensures we clean up temporary\n // tensors as soon as they are no longer needed.\n const rTemp = r;\n const wTemp = w;\n const qTemp = q;\n [w, r, q] = ENV.engine.tidy((): [Tensor2D, Tensor2D, Tensor2D] => {\n // Find H = I - tau * w * w', to put zeros below R(j, j).\n const rjEnd1 = r.slice([j, j], [m - j, 1]);\n const normX = rjEnd1.norm();\n const rjj = r.slice([j, j], [1, 1]);\n const s = rjj.sign().neg() as Tensor2D;\n const u1 = rjj.sub(s.mul(normX)) as Tensor2D;\n const wPre = rjEnd1.div(u1);\n if (wPre.shape[0] === 1) {\n w = one2D.clone();\n } else {\n w = one2D.concat(\n wPre.slice([1, 0], [wPre.shape[0] - 1, wPre.shape[1]]), 0) as\n Tensor2D;\n }\n const tau = s.matMul(u1).div(normX).neg() as Tensor2D;\n\n // -- R := HR, Q := QH.\n const rjEndAll = r.slice([j, 0], [m - j, n]);\n const tauTimesW = tau.mul(w) as Tensor2D;\n if (j === 0) {\n r = rjEndAll.sub(tauTimesW.matMul(w.transpose().matMul(rjEndAll)));\n } else {\n r = r.slice([0, 0], [j, n])\n .concat(\n rjEndAll.sub(\n tauTimesW.matMul(w.transpose().matMul(rjEndAll))),\n 0) as Tensor2D;\n }\n const qAllJEnd = q.slice([0, j], [m, q.shape[1] - j]);\n if (j === 0) {\n q = qAllJEnd.sub(qAllJEnd.matMul(w).matMul(tauTimesW.transpose()));\n } else {\n q = q.slice([0, 0], [m, j])\n .concat(\n qAllJEnd.sub(\n qAllJEnd.matMul(w).matMul(tauTimesW.transpose())),\n 1) as Tensor2D;\n }\n return [w, r, q];\n });\n dispose([rTemp, wTemp, qTemp]);\n }\n\n if (!fullMatrices && m > n) {\n q = q.slice([0, 0], [m, n]);\n r = r.slice([0, 0], [n, n]);\n }\n\n return [q, r];\n }) as [Tensor2D, Tensor2D];\n}\n\nexport const gramSchmidt = op({gramSchmidt_});\nexport const qr = op({qr_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ForwardFunc} from '../engine';\nimport {ENV} from '../environment';\nimport {nonMaxSuppressionImpl} from '../kernels/non_max_suppression_impl';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\n\n/**\n * Bilinear resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n */\n/** @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} */\nfunction resizeBilinear_(\n images: T|TensorLike, size: [number, number], alignCorners = false): T {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert(\n $images.rank === 3 || $images.rank === 4,\n `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(\n size.length === 2,\n `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n\n let batchImages = $images as Tensor4D;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages =\n $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]);\n }\n\n const [newHeight, newWidth] = size;\n const forward: ForwardFunc = (backend, save) =>\n backend.resizeBilinear(batchImages, newHeight, newWidth, alignCorners);\n\n const backward = (dy: Tensor4D, saved: Tensor[]) => {\n return {\n batchImages: () => ENV.engine.runKernel(\n backend =>\n backend.resizeBilinearBackprop(dy, batchImages, alignCorners),\n {})\n };\n };\n\n const res = ENV.engine.runKernel(forward, {batchImages}, backward);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n */\n/** @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} */\nfunction resizeNearestNeighbor_(\n images: T|TensorLike, size: [number, number], alignCorners = false): T {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert(\n $images.rank === 3 || $images.rank === 4,\n `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(\n size.length === 2,\n `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(\n $images.dtype === 'float32' || $images.dtype === 'int32',\n '`images` must have `int32` or `float32` as dtype');\n\n let batchImages = $images as Tensor4D;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages =\n $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]);\n }\n const [newHeight, newWidth] = size;\n\n const forward: ForwardFunc = (backend, save) =>\n backend.resizeNearestNeighbor(\n batchImages, newHeight, newWidth, alignCorners);\n\n const backward = (dy: Tensor4D, saved: Tensor[]) => {\n return {\n batchImages: () => ENV.engine.runKernel(\n backend => backend.resizeNearestNeighborBackprop(\n dy, batchImages, alignCorners),\n {})\n };\n };\n\n const res = ENV.engine.runKernel(forward, {batchImages}, backward);\n\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Performs non maximum suppression of bounding boxes based on\n * iou (intersection over union)\n *\n * @param boxes a 2d tensor of shape `[numBoxes, 4]`. Each entry is\n * `[y1, x1, y2, x2]`, where `(y1, x1)` and `(y2, x2)` are the corners of\n * the bounding box.\n * @param scores a 1d tensor providing the box scores of shape `[numBoxes]`.\n * @param maxOutputSize The maximum number of boxes to be selected.\n * @param iouThreshold A float representing the threshold for deciding whether\n * boxes overlap too much with respect to IOU. Must be betwen [0, 1].\n * Defaults to 0.5 (50% box overlap).\n * @param scoreThreshold A threshold for deciding when to remove boxes based\n * on score. Defaults to -inf, which means any score is accepted.\n * @return A 1D tensor with the selected box indices.\n */\n/** @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} */\nfunction nonMaxSuppression_(\n boxes: Tensor2D|TensorLike, scores: Tensor1D|TensorLike,\n maxOutputSize: number, iouThreshold = 0.5,\n scoreThreshold = Number.NEGATIVE_INFINITY): Tensor1D {\n const $boxes = convertToTensor(boxes, 'boxes', 'nonMaxSuppression');\n const $scores = convertToTensor(scores, 'scores', 'nonMaxSuppression');\n\n const inputs = nonMaxSuppSanityCheck(\n $boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold);\n maxOutputSize = inputs.maxOutputSize;\n iouThreshold = inputs.iouThreshold;\n scoreThreshold = inputs.scoreThreshold;\n\n return ENV.engine.runKernel(\n b => b.nonMaxSuppression(\n $boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold),\n {$boxes});\n}\n\n/** This is the async version of `nonMaxSuppression` */\nasync function nonMaxSuppressionAsync_(\n boxes: Tensor2D|TensorLike, scores: Tensor1D|TensorLike,\n maxOutputSize: number, iouThreshold = 0.5,\n scoreThreshold = Number.NEGATIVE_INFINITY): Promise {\n const $boxes = convertToTensor(boxes, 'boxes', 'nonMaxSuppressionAsync');\n const $scores = convertToTensor(scores, 'scores', 'nonMaxSuppressionAsync');\n\n const inputs = nonMaxSuppSanityCheck(\n $boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold);\n maxOutputSize = inputs.maxOutputSize;\n iouThreshold = inputs.iouThreshold;\n scoreThreshold = inputs.scoreThreshold;\n\n const boxesVals = await $boxes.data();\n const scoresVals = await $scores.data();\n const res = nonMaxSuppressionImpl(\n boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold);\n if ($boxes !== boxes) {\n $boxes.dispose();\n }\n if ($scores !== scores) {\n $scores.dispose();\n }\n return res;\n}\n\nfunction nonMaxSuppSanityCheck(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number):\n {maxOutputSize: number, iouThreshold: number, scoreThreshold: number} {\n if (iouThreshold == null) {\n iouThreshold = 0.5;\n }\n if (scoreThreshold == null) {\n scoreThreshold = Number.NEGATIVE_INFINITY;\n }\n const numBoxes = boxes.shape[0];\n maxOutputSize = Math.min(maxOutputSize, numBoxes);\n\n util.assert(\n 0 <= iouThreshold && iouThreshold <= 1,\n `iouThreshold must be in [0, 1], but was '${iouThreshold}'`);\n util.assert(\n boxes.rank === 2,\n `boxes must be a 2D tensor, but was of rank '${boxes.rank}'`);\n util.assert(\n boxes.shape[1] === 4,\n `boxes must have 4 columns, but 2nd dimension was ${boxes.shape[1]}`);\n util.assert(scores.rank === 1, 'scores must be a 1D tensor');\n util.assert(\n scores.shape[0] === numBoxes,\n `scores has incompatible shape with boxes. Expected ${numBoxes}, ` +\n `but was ${scores.shape[0]}`);\n return {maxOutputSize, iouThreshold, scoreThreshold};\n}\n\nexport const resizeBilinear = op({resizeBilinear_});\nexport const resizeNearestNeighbor = op({resizeNearestNeighbor_});\nexport const nonMaxSuppression = op({nonMaxSuppression_});\nexport const nonMaxSuppressionAsync = nonMaxSuppressionAsync_;\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as seedrandom from 'seedrandom';\nimport {ENV} from '../environment';\nimport {warn} from '../log';\nimport * as array_ops_util from '../ops/array_ops_util';\nimport * as axis_util from '../ops/axis_util';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport * as concat_util from '../ops/concat_util';\nimport {Conv2DInfo} from '../ops/conv_util';\nimport * as erf_util from '../ops/erf_util';\nimport * as ops from '../ops/ops';\nimport {buffer, tensor3d, tensor4d} from '../ops/ops';\nimport * as selu_util from '../ops/selu_util';\nimport {getStridedSlicedInfo} from '../ops/slice_util';\nimport {DataId, setTensorTracker, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {DataType, DataTypeMap, Rank, ShapeMap, TypedArray, upcastType} from '../types';\nimport * as util from '../util';\nimport {now} from '../util';\nimport {BackendTimingInfo, KernelBackend} from './backend';\nimport * as backend_util from './backend_util';\nimport {nonMaxSuppressionImpl} from './non_max_suppression_impl';\nimport {topkImpl} from './topk_impl';\nimport {whereImpl} from './where_impl';\n\nexport class MathBackendCPU implements KernelBackend {\n private data = new WeakMap();\n private canvas: HTMLCanvasElement;\n private firstUse = true;\n\n constructor() {\n if (ENV.get('IS_BROWSER')) {\n this.canvas = document.createElement('canvas');\n }\n }\n\n register(dataId: DataId, shape: number[], dtype: DataType): void {\n if (this.firstUse) {\n this.firstUse = false;\n if (ENV.get('IS_NODE')) {\n warn(\n '\\n============================\\n' +\n 'Hi there 👋. Looks like you are running TensorFlow.js in ' +\n 'Node.js. To speed things up dramatically, install our node ' +\n 'backend, which binds to TensorFlow C++, by running ' +\n 'npm i @tensorflow/tfjs-node, ' +\n 'or npm i @tensorflow/tfjs-node-gpu if you have CUDA. ' +\n 'Then call require(\\'@tensorflow/tfjs-node\\'); (-gpu ' +\n 'suffix for CUDA) at the start of your program. ' +\n 'Visit https://github.com/tensorflow/tfjs-node for more details.' +\n '\\n============================\\n');\n }\n }\n if (this.data.has(dataId)) {\n throw new Error(`Data buffer is already registered`);\n }\n this.data.set(dataId, null);\n }\n write(dataId: DataId, values: TypedArray): void {\n if (values == null) {\n throw new Error('MathBackendCPU.write(): values can not be null');\n }\n this.throwIfNoData(dataId);\n this.data.set(dataId, values);\n }\n fromPixels(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels: number): Tensor3D {\n if (pixels == null) {\n throw new Error('pixels passed to tf.fromPixels() can not be null');\n }\n let vals: Uint8ClampedArray;\n // tslint:disable-next-line:no-any\n if (ENV.get('IS_NODE') && (pixels as any).getContext == null) {\n throw new Error(\n 'When running in node, pixels must be an HTMLCanvasElement ' +\n 'like the one returned by the `canvas` npm package');\n }\n // tslint:disable-next-line:no-any\n if ((pixels as any).getContext != null) {\n // tslint:disable-next-line:no-any\n vals = (pixels as any)\n .getContext('2d')\n .getImageData(0, 0, pixels.width, pixels.height)\n .data;\n } else if (pixels instanceof ImageData) {\n vals = pixels.data;\n } else if (\n pixels instanceof HTMLImageElement ||\n pixels instanceof HTMLVideoElement) {\n if (this.canvas == null) {\n throw new Error(\n 'Can\\'t read pixels from HTMLImageElement outside ' +\n 'the browser.');\n }\n this.canvas.width = pixels.width;\n this.canvas.height = pixels.height;\n this.canvas.getContext('2d').drawImage(\n pixels, 0, 0, pixels.width, pixels.height);\n vals = this.canvas.getContext('2d')\n .getImageData(0, 0, pixels.width, pixels.height)\n .data;\n } else {\n throw new Error(\n 'pixels passed to tf.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ` +\n `ImageData, but was ${(pixels as {}).constructor.name}`);\n }\n let values: Int32Array;\n if (numChannels === 4) {\n values = new Int32Array(vals);\n } else {\n const numPixels = pixels.width * pixels.height;\n values = new Int32Array(numPixels * numChannels);\n for (let i = 0; i < numPixels; i++) {\n for (let channel = 0; channel < numChannels; ++channel) {\n values[i * numChannels + channel] = vals[i * 4 + channel];\n }\n }\n }\n const outShape: [number, number, number] =\n [pixels.height, pixels.width, numChannels];\n return tensor3d(values, outShape, 'int32');\n }\n async read(dataId: DataId): Promise {\n return this.readSync(dataId);\n }\n readSync(dataId: DataId): TypedArray {\n this.throwIfNoData(dataId);\n return this.data.get(dataId);\n }\n\n disposeData(dataId: DataId): void {\n if (this.data.has(dataId)) {\n this.data.delete(dataId);\n }\n }\n\n async time(f: () => void): Promise {\n const start = now();\n f();\n const kernelMs = now() - start;\n return {kernelMs};\n }\n memory() {\n return {\n // Unreliable due to automatic gc. The numbers above are cumulative.\n unreliable: true\n };\n }\n\n private throwIfNoData(dataId: DataId) {\n if (!this.data.has(dataId)) {\n throw new Error(\n `CPU backend: No data found for this tensor. ` +\n `Did you change your backend in the middle of the program? ` +\n `New backends can't use Tensors created with previous backends`);\n }\n }\n\n slice(x: T, begin: number[], size: number[]): T {\n const buffer = ops.buffer(size, x.dtype);\n\n for (let i = 0; i < buffer.size; ++i) {\n const loc = buffer.indexToLoc(i);\n const xLoc = loc.map((idx, j) => idx + begin[j]);\n buffer.set(x.get(...xLoc), ...loc);\n }\n return buffer.toTensor() as T;\n }\n\n stridedSlice(\n x: T, begin: number[], end: number[], strides: number[],\n beginMask: number, endMask: number): T {\n const [beginIndex, size] =\n getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask);\n\n if (size.some(axis => axis === 0)) {\n return ops.tensor([], size) as T;\n }\n\n const buffer = ops.buffer(size, x.dtype);\n\n for (let i = 0; i < buffer.size; i++) {\n const loc = buffer.indexToLoc(i);\n\n const newLoc: number[] = new Array(loc.length);\n for (let j = 0; j < newLoc.length; j++) {\n newLoc[j] = loc[j] * strides[j] + beginIndex[j];\n }\n buffer.set(x.get(...newLoc), ...loc);\n }\n\n return buffer.toTensor() as T;\n }\n\n reverse(x: T, axis: number[]): T {\n const buffer = ops.buffer(x.shape, x.dtype);\n const xBuffer = x.buffer();\n\n for (let i = 0; i < buffer.size; i++) {\n const outLoc = buffer.indexToLoc(i);\n const inLoc = outLoc.slice();\n axis.forEach(ax => inLoc[ax] = x.shape[ax] - 1 - inLoc[ax]);\n buffer.set(xBuffer.get(...inLoc), ...outLoc);\n }\n\n return buffer.toTensor() as T;\n }\n\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n concat(a: Tensor2D, b: Tensor2D): Tensor2D {\n const outShape = concat_util.computeOutShape(\n a.shape, b.shape, 1 /* axis */) as [number, number];\n const buffer = ops.buffer(outShape, a.dtype);\n\n if (a.shape[0] === 1 && b.shape[0] === 1) {\n // Use built-in TypedArray.set() method for speed.\n const aVals = a.dataSync();\n const bVals = b.dataSync();\n const vals = buffer.values;\n vals.set(aVals, 0);\n vals.set(bVals, a.size);\n return buffer.toTensor();\n }\n\n for (let i = 0; i < outShape[0]; ++i) {\n for (let j = 0; j < a.shape[1]; ++j) {\n buffer.set(a.get(i, j), i, j);\n }\n for (let j = 0; j < b.shape[1]; ++j) {\n buffer.set(b.get(i, j), i, j + a.shape[1]);\n }\n }\n return buffer.toTensor();\n }\n\n neg(x: T): T {\n return this.multiply(ops.scalar(-1), x) as T;\n }\n\n add(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, upcastType(a.dtype, b.dtype),\n (aValue, bValue) => aValue + bValue) as Tensor;\n }\n\n addN(tensors: T[]): T {\n const vals = tensors.map(t => t.dataSync());\n const result = ops.buffer(tensors[0].shape, tensors[0].dtype);\n const resultVals = result.values;\n for (let i = 0; i < tensors.length; i++) {\n const currVals = vals[i];\n for (let j = 0; j < resultVals.length; j++) {\n resultVals[j] += currVals[j];\n }\n }\n return result.toTensor() as T;\n }\n\n subtract(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, upcastType(a.dtype, b.dtype),\n (aValue, bValue) => aValue - bValue) as Tensor;\n }\n\n pow(a: T, b: Tensor): T {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aValue, bValue) => Math.pow(aValue, bValue)) as\n T;\n }\n\n matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean):\n Tensor2D {\n const sharedDim = transposeA ? a.shape[0] : a.shape[1];\n const leftDim = transposeA ? a.shape[1] : a.shape[0];\n const rightDim = transposeB ? b.shape[0] : b.shape[1];\n\n const aValues = a.dataSync();\n const bValues = b.dataSync();\n\n const [aOuterStep, aInnerStep] =\n transposeA ? [1, a.strides[0]] : [a.strides[0], 1];\n const [bOuterStep, bInnerStep] =\n transposeB ? [b.strides[0], 1] : [1, b.strides[0]];\n\n const aOuterEnd = leftDim * aOuterStep;\n const bOuterEnd = rightDim * bOuterStep;\n\n const result = new Float32Array(leftDim * rightDim);\n let resultIndex = 0;\n\n for (let aOuter = 0; aOuter < aOuterEnd; aOuter += aOuterStep) {\n for (let bOuter = 0; bOuter < bOuterEnd; bOuter += bOuterStep) {\n let aInner = aOuter;\n let bInner = bOuter;\n let sum = 0;\n for (let k = 0; k < sharedDim; ++k) {\n sum += aValues[aInner] * bValues[bInner];\n aInner += aInnerStep;\n bInner += bInnerStep;\n }\n result[resultIndex++] = sum;\n }\n }\n return ops.tensor2d(result, [leftDim, rightDim]);\n }\n\n multiply(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, upcastType(a.dtype, b.dtype),\n (aValue, bValue) => aValue * bValue) as Tensor;\n }\n\n realDivide(a: Tensor, b: Tensor): Tensor {\n const op = (a: number, b: number) => a / b;\n const outputDtype = 'float32';\n return this.broadcastedBinaryOp(a, b, outputDtype, op) as Tensor;\n }\n\n floorDiv(a: Tensor, b: Tensor): Tensor {\n const op = (a: number, b: number) => Math.floor(a / b);\n const outputDtype = 'int32';\n return this.broadcastedBinaryOp(a, b, outputDtype, op) as Tensor;\n }\n\n sum(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('sum', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const resultDtype = upcastType(x.dtype, 'int32');\n const result = ops.zeros(outShape, resultDtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let sum = 0;\n for (let j = 0; j < reduceSize; ++j) {\n sum += aVals[offset + j];\n }\n vals[i] = sum;\n }\n return result;\n }\n\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): Tensor {\n const res = [];\n\n // Reshape the segment id's so that they can be broadcast with\n // x. The new shape should be [segmentIds.shape, 1, ..., 1]\n const numIters = x.rank - segmentIds.rank;\n for (let i = 0; i < numIters; ++i) {\n segmentIds = segmentIds.expandDims(i + 1);\n }\n\n for (let i = 0; i < numSegments; ++i) {\n const segmentId = ops.scalar(i, 'int32');\n const mask = ops.equal(segmentId, segmentIds).asType('float32');\n const sum = mask.mul(x).sum(0);\n res.push(sum);\n }\n\n return ops.stack(res);\n }\n\n argMin(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMin', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, 'int32');\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let min = aVals[offset];\n let minIndex = 0;\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value < min) {\n min = value;\n minIndex = j;\n }\n }\n vals[i] = minIndex;\n }\n return result;\n }\n\n argMax(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMax', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, 'int32');\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let max = aVals[offset];\n let maxIndex = 0;\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value > max) {\n max = value;\n maxIndex = j;\n }\n }\n vals[i] = maxIndex;\n }\n return result;\n }\n\n cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean):\n Tensor {\n if (axis !== x.rank - 1) {\n throw new Error(\n `backend.cumsum in CPU expects an inner-most axis=${x.rank - 1} ` +\n `but got axis=${axis}`);\n }\n const resultDtype = upcastType(x.dtype, 'int32');\n const result = ops.zeros(x.shape, resultDtype);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n const finalDim = x.shape[x.rank - 1];\n const indexAdjuster = reverse ?\n (i: number, j: number) => i + finalDim - j - 1 :\n (i: number, j: number) => i + j;\n for (let i = 0; i < aVals.length; i += finalDim) {\n for (let j = 0; j < finalDim; j++) {\n const idx = indexAdjuster(i, j);\n if (j === 0) {\n vals[idx] = exclusive ? 0 : aVals[idx];\n } else {\n const prevIdx = indexAdjuster(i, j - 1);\n vals[idx] = exclusive ? aVals[prevIdx] + vals[prevIdx] :\n aVals[idx] + vals[prevIdx];\n }\n }\n }\n return result;\n }\n\n equal(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal === bVal) ? 1 : 0;\n });\n }\n\n notEqual(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal !== bVal) ? 1 : 0;\n });\n }\n\n less(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal < bVal) ? 1 : 0;\n });\n }\n\n lessEqual(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal <= bVal) ? 1 : 0;\n });\n }\n\n greater(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal > bVal) ? 1 : 0;\n });\n }\n\n greaterEqual(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal >= bVal) ? 1 : 0;\n });\n }\n\n logicalNot(x: T): T {\n const values = x.dataSync();\n const newValues = new Int32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = values[i] ? 0 : 1;\n }\n return Tensor.make(x.shape, {values: newValues}, 'bool') as T;\n }\n\n logicalAnd(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return aVal && bVal;\n });\n }\n\n logicalOr(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return aVal || bVal;\n });\n }\n\n select(condition: Tensor, a: Tensor, b: Tensor): Tensor {\n const values = condition.dataSync();\n const aValues = a.dataSync();\n const bValues = b.dataSync();\n const result = ops.zeros(a.shape, upcastType(a.dtype, b.dtype));\n const newValues = result.dataSync();\n let index = 0;\n const offset = condition.rank === 0 || condition.rank > 1 || a.rank === 1 ?\n 1 :\n a.shape[1];\n\n for (let i = 0; i < values.length; i++) {\n for (let j = 0; j < offset; j++) {\n if (values[i] === 1) {\n newValues[index++] = aValues[i];\n } else {\n newValues[index++] = bValues[i];\n }\n }\n }\n return result;\n }\n\n where(condition: Tensor): Tensor2D {\n const condVals = condition.dataSync();\n return whereImpl(condition.shape, condVals);\n }\n\n topk(x: T, k: number, sorted: boolean): [T, T] {\n const xVals = x.dataSync();\n return topkImpl(xVals, x.shape, x.dtype, k, sorted);\n }\n\n min(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('min', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let min = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value < min) {\n min = value;\n }\n }\n vals[i] = min;\n }\n return result;\n }\n\n minimum(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aVal, bVal) => Math.min(aVal, bVal));\n }\n\n mod(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, a.dtype, (aVal, bVal) => {\n const rem = aVal % bVal;\n if ((aVal < 0 && bVal < 0) || (aVal >= 0 && bVal >= 0)) {\n return rem;\n } else {\n return (rem + bVal) % bVal;\n }\n });\n }\n\n max(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('max', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let max = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value > max) {\n max = value;\n }\n }\n vals[i] = max;\n }\n return result;\n }\n\n maximum(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aVal, bVal) => Math.max(aVal, bVal));\n }\n\n all(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('all', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let all = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n all = all && value;\n }\n vals[i] = all;\n }\n return result;\n }\n\n any(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('any', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let anyVal = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n anyVal = anyVal || value;\n }\n vals[i] = anyVal;\n }\n return result;\n }\n\n squaredDifference(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, a.dtype, (aVal, bVal) => {\n const diff = aVal - bVal;\n return diff * diff;\n });\n }\n\n ceil(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.ceil(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n floor(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.floor(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n sign(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n if (values[i] < 0) {\n newValues[i] = -1;\n } else if (values[i] > 0) {\n newValues[i] = 1;\n } else {\n newValues[i] = 0;\n }\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n round(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n // The algorithm is based on banker's rounding.\n const base = Math.floor(values[i]);\n if (values[i] - base < 0.5) {\n newValues[i] = Math.floor(values[i]);\n } else if (values[i] - base > 0.5) {\n newValues[i] = Math.ceil(values[i]);\n } else {\n if (base % 2.0 === 0.0) {\n newValues[i] = base;\n } else {\n newValues[i] = base + 1.0;\n }\n }\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n exp(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.exp(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n expm1(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.expm1(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n log(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = Math.log(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n log1p(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = Math.log1p(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n sqrt(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = Math.sqrt(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n rsqrt(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = 1 / Math.sqrt(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n square(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = value * value;\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n reciprocal(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = 1 / values[i];\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n relu(x: T): T {\n const res = ops.zeros(x.shape, x.dtype);\n const resVals = res.dataSync();\n const inVals = x.dataSync();\n for (let i = 0; i < inVals.length; ++i) {\n resVals[i] = Math.max(0, inVals[i]);\n }\n return res as T;\n }\n\n elu(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n if (v >= 0) {\n resultValues[i] = v;\n } else {\n resultValues[i] = (Math.exp(v) - 1);\n }\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n eluDer(dy: T, y: T): T {\n const resultValues = new Float32Array(y.size);\n const values = y.dataSync();\n const dyValues = dy.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n if (v >= 1) {\n resultValues[i] = dyValues[i];\n } else {\n resultValues[i] = dyValues[i] * (v + 1);\n }\n }\n return Tensor.make(y.shape, {values: resultValues}) as T;\n }\n\n selu(x: T): T {\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n const scaleAlpha = selu_util.SELU_SCALEALPHA;\n const scale = selu_util.SELU_SCALE;\n\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n if (v >= 0) {\n resultValues[i] = scale * v;\n } else {\n resultValues[i] = scaleAlpha * (Math.exp(v) - 1);\n }\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n clip(x: T, min: number, max: number): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.min(max, Math.max(min, values[i]));\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n abs(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.abs(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n int(x: T): T {\n const resultValues = new Int32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = values[i];\n }\n return Tensor.make(x.shape, {values: resultValues}, 'int32');\n }\n\n sigmoid(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = 1 / (1 + Math.exp(-values[i]));\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n softplus(x: T): T {\n // mirrors the implementation of tf.nn.softplus: https://goo.gl/vkcvwX\n\n // epsilon is the difference between 1.0 and the next representable float.\n // For a single precision 32 bit float this should be 2^-23, see:\n // https://math.byu.edu/~schow/work/IEEEFloatingPoint.htm\n const epsilon = 1.1920928955078125e-7;\n const threshold = Math.log(epsilon) + 2.0;\n\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n\n for (let i = 0; i < values.length; ++i) {\n // Value above which exp(x) may overflow, but softplus(x) == x\n // is within machine epsilon.\n const tooLarge = values[i] > -threshold;\n\n // Value below which exp(x) may underflow, but softplus(x) == exp(x)\n // is within machine epsilon.\n const tooSmall = values[i] < threshold;\n\n const expX = Math.exp(values[i]);\n let result;\n\n if (tooSmall) {\n result = expX;\n } else if (tooLarge) {\n result = values[i];\n } else {\n result = Math.log(1.0 + expX);\n }\n resultValues[i] = result;\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n sin(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.sin(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n cos(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.cos(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n tan(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.tan(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n asin(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.asin(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n acos(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.acos(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n atan(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.atan(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n atan2(a: T, b: T): T {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aValue, bValue) => Math.atan2(aValue, bValue)) as\n T;\n }\n\n sinh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.sinh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n cosh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.cosh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n tanh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = util.tanh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n asinh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.asinh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n acosh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.acosh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n atanh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.atanh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n erf(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n const p = erf_util.ERF_P;\n const a1 = erf_util.ERF_A1;\n const a2 = erf_util.ERF_A2;\n const a3 = erf_util.ERF_A3;\n const a4 = erf_util.ERF_A4;\n const a5 = erf_util.ERF_A5;\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n const t = 1.0 / (1.0 + p * v);\n resultValues[i] = 1.0 -\n (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t *\n Math.exp(-v * v);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n step(x: T, alpha = 0): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n if (isNaN(value)) {\n resultValues[i] = NaN;\n } else {\n resultValues[i] = value > 0 ? 1 : alpha;\n }\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const padLeft = convInfo.padInfo.left;\n const padTop = convInfo.padInfo.top;\n const y = ops.buffer(convInfo.outShape, x.dtype);\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d2 = 0; d2 < convInfo.outChannels; ++d2) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * convInfo.strideHeight - padLeft;\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * convInfo.strideWidth - padTop;\n\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; wR++) {\n const xR = xRCorner + wR * dilationHeight;\n\n if (xR < 0 || xR >= convInfo.inHeight) {\n continue;\n }\n\n for (let wC = 0; wC < filterWidth; wC++) {\n const xC = xCCorner + wC * dilationWidth;\n\n if (xC < 0 || xC >= convInfo.inWidth) {\n continue;\n }\n\n for (let d1 = 0; d1 < convInfo.inChannels; ++d1) {\n const pixel = x.get(b, xR, xC, d1);\n const weight = filter.get(wR, wC, d1, d2);\n dotProd += pixel * weight;\n }\n }\n }\n y.set(dotProd, b, yR, yC, d2);\n }\n }\n }\n }\n return y.toTensor();\n }\n\n conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const dx = ops.buffer(convInfo.inShape, 'float32');\n const dxValues = dx.values;\n const [dxS0, dxS1, dxS2] = dx.strides;\n const dyValues = dy.dataSync();\n const [dyS0, dyS1, dyS2] = dy.strides;\n const fltValues = filter.dataSync();\n const [fltS0, fltS1, fltS2] = filter.strides;\n const {\n batchSize,\n filterHeight,\n filterWidth,\n inChannels,\n inHeight,\n inWidth,\n outChannels,\n outHeight,\n outWidth,\n strideHeight,\n strideWidth\n } = convInfo;\n const topPad = filterHeight - 1 - convInfo.padInfo.top;\n const leftPad = filterWidth - 1 - convInfo.padInfo.left;\n\n for (let b = 0; b < batchSize; ++b) {\n for (let d1 = 0; d1 < inChannels; ++d1) {\n for (let xR = 0; xR < inHeight; ++xR) {\n const xRCorner = xR - topPad;\n const xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));\n const yRMax =\n Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);\n\n for (let xC = 0; xC < inWidth; ++xC) {\n const xCCorner = xC - leftPad;\n const xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));\n const yCMax =\n Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);\n\n let dotProd = 0;\n for (let yR = xRMin; yR < yRMax; ++yR) {\n const wR = yR * strideHeight - xRCorner;\n\n for (let yC = xCMin; yC < yCMax; ++yC) {\n const wC = yC * strideWidth - xCCorner;\n const dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC;\n const fltOffset = fltS0 * (filterHeight - 1 - wR) +\n fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;\n\n for (let d2 = 0; d2 < outChannels; ++d2) {\n const pixel = dyValues[dyOffset + d2];\n const weight = fltValues[fltOffset + d2];\n dotProd += pixel * weight;\n }\n }\n }\n dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd;\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n conv2dDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dW = ops.buffer(convInfo.filterShape, 'float32');\n\n const leftPad = convInfo.padInfo.left;\n const topPad = convInfo.padInfo.top;\n\n for (let wR = 0; wR < filterHeight; ++wR) {\n const yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));\n const yRMax = Math.min(\n convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);\n\n for (let wC = 0; wC < filterWidth; ++wC) {\n const yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));\n const yCMax = Math.min(\n convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);\n\n for (let d1 = 0; d1 < convInfo.inChannels; ++d1) {\n for (let d2 = 0; d2 < convInfo.outChannels; ++d2) {\n // Need to convolve.\n let dotProd = 0;\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let yR = yRMin; yR < yRMax; ++yR) {\n const xR = wR + yR * strideHeight - topPad;\n for (let yC = yCMin; yC < yCMax; ++yC) {\n const xC = wC + yC * strideWidth - leftPad;\n dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2);\n }\n }\n }\n dW.set(dotProd, wR, wC, d1, d2);\n }\n }\n }\n }\n return dW.toTensor();\n }\n\n depthwiseConv2D(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const padLeft = convInfo.padInfo.left;\n const padTop = convInfo.padInfo.top;\n const chMul = convInfo.outChannels / convInfo.inChannels;\n const y = ops.buffer(convInfo.outShape, x.dtype);\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d1 = 0; d1 < convInfo.inChannels; ++d1) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * convInfo.strideHeight - padLeft;\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * convInfo.strideWidth - padTop;\n for (let q = 0; q < chMul; ++q) {\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; ++wR) {\n const xR = xRCorner + wR * dilationHeight;\n\n if (xR < 0 || xR >= convInfo.inHeight) {\n continue;\n }\n\n for (let wC = 0; wC < filterWidth; ++wC) {\n const xC = xCCorner + wC * dilationWidth;\n\n if (xC < 0 || xC >= convInfo.inWidth) {\n continue;\n }\n\n const pixel = x.get(b, xR, xC, d1);\n const weight = filter.get(wR, wC, d1, q);\n dotProd += pixel * weight;\n }\n }\n y.set(dotProd, b, yR, yC, d1 * chMul + q);\n }\n }\n }\n }\n }\n\n return y.toTensor();\n }\n\n depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const dx = ops.buffer(convInfo.inShape, 'float32');\n const dxValues = dx.values;\n const [dxS0, dxS1, dxS2] = dx.strides;\n const dyValues = dy.dataSync();\n const [dyS0, dyS1, dyS2] = dy.strides;\n const fltValues = filter.dataSync();\n const [fltS0, fltS1, fltS2] = filter.strides;\n const {\n batchSize,\n filterHeight,\n filterWidth,\n inChannels,\n inHeight,\n inWidth,\n outChannels,\n outHeight,\n outWidth,\n strideHeight,\n strideWidth\n } = convInfo;\n const topPad = filterHeight - 1 - convInfo.padInfo.top;\n const leftPad = filterWidth - 1 - convInfo.padInfo.left;\n const chMul = outChannels / inChannels;\n\n for (let b = 0; b < batchSize; ++b) {\n for (let d1 = 0; d1 < inChannels; ++d1) {\n for (let xR = 0; xR < inHeight; ++xR) {\n const xRCorner = xR - topPad;\n const xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));\n const yRMax =\n Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);\n\n for (let xC = 0; xC < inWidth; ++xC) {\n const xCCorner = xC - leftPad;\n const xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));\n const yCMax =\n Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);\n\n let dotProd = 0;\n for (let yR = xRMin; yR < yRMax; ++yR) {\n const wR = yR * strideHeight - xRCorner;\n\n for (let yC = xCMin; yC < yCMax; ++yC) {\n const wC = yC * strideWidth - xCCorner;\n const dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC;\n const fltOffset = fltS0 * (filterHeight - 1 - wR) +\n fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;\n\n for (let dm = 0; dm < chMul; ++dm) {\n const d2 = d1 * chMul + dm;\n const pixel = dyValues[dyOffset + d2];\n const weight = fltValues[fltOffset + dm];\n dotProd += pixel * weight;\n }\n }\n }\n dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd;\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n depthwiseConv2DDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dW = ops.buffer(convInfo.filterShape, 'float32');\n\n const leftPad = convInfo.padInfo.left;\n const topPad = convInfo.padInfo.top;\n const chMul = convInfo.outChannels / convInfo.inChannels;\n\n for (let wR = 0; wR < filterHeight; ++wR) {\n const yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));\n const yRMax = Math.min(\n convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);\n\n for (let wC = 0; wC < filterWidth; ++wC) {\n const yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));\n const yCMax = Math.min(\n convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);\n\n for (let d2 = 0; d2 < convInfo.outChannels; ++d2) {\n const d1 = Math.trunc(d2 / chMul);\n const dm = d2 % chMul;\n\n let dotProd = 0;\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let yR = yRMin; yR < yRMax; ++yR) {\n const xR = wR + yR * strideHeight - topPad;\n for (let yC = yCMin; yC < yCMax; ++yC) {\n const xC = wC + yC * strideWidth - leftPad;\n dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2);\n }\n }\n }\n dW.set(dotProd, wR, wC, d1, dm);\n }\n }\n }\n return dW.toTensor();\n }\n\n tile(x: T, reps: number[]): T {\n const newShape: number[] = new Array(x.rank);\n for (let i = 0; i < newShape.length; i++) {\n newShape[i] = x.shape[i] * reps[i];\n }\n const result = ops.buffer(newShape, x.dtype);\n const xBuf = x.buffer();\n for (let i = 0; i < result.values.length; ++i) {\n const newLoc = result.indexToLoc(i);\n\n const originalLoc: number[] = new Array(x.rank);\n for (let i = 0; i < originalLoc.length; i++) {\n originalLoc[i] = newLoc[i] % x.shape[i];\n }\n\n const originalIndex = xBuf.locToIndex(originalLoc);\n\n result.values[i] = xBuf.values[originalIndex];\n }\n return result.toTensor() as T;\n }\n\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T {\n const outShape = paddings.map(\n (p, i) => p[0] /* beforePad */ + x.shape[i] + p[1] /* afterPad */);\n const start = paddings.map(p => p[0]);\n const xBuffer = x.buffer();\n const buffer = ops.buffer(outShape, x.dtype);\n if (constantValue !== 0) {\n buffer.values.fill(constantValue);\n }\n\n for (let i = 0; i < x.size; i++) {\n const coords = xBuffer.indexToLoc(i);\n const outCoords = coords.map((c, i) => c + start[i]);\n buffer.set(x.get(...coords), ...outCoords);\n }\n return buffer.toTensor() as T;\n }\n\n transpose(x: T, perm: number[]): T {\n const newShape: number[] = new Array(x.rank);\n for (let i = 0; i < newShape.length; i++) {\n newShape[i] = x.shape[perm[i]];\n }\n const values = x.dataSync();\n const result = buffer(newShape, x.dtype);\n\n const xBuf = x.buffer();\n for (let i = 0; i < x.size; ++i) {\n const loc = xBuf.indexToLoc(i);\n\n // Permute location.\n const newLoc: number[] = new Array(loc.length);\n for (let i = 0; i < newLoc.length; i++) {\n newLoc[i] = loc[perm[i]];\n }\n\n const newIndex = result.locToIndex(newLoc);\n result.values[newIndex] = values[i];\n }\n return result.toTensor() as T;\n }\n\n gather(x: T, indices: Tensor1D, axis: number): T {\n const newShape: number[] = x.shape.slice();\n const indicesValues = indices.dataSync();\n newShape[axis] = indicesValues.length;\n const result = buffer(newShape, x.dtype);\n const xBuf = x.buffer();\n\n for (let i = 0; i < result.size; ++i) {\n const newLoc = result.indexToLoc(i);\n\n const originalLoc: number[] = newLoc.slice();\n originalLoc[axis] = indicesValues[newLoc[axis]];\n\n const originalIndex = xBuf.locToIndex(originalLoc);\n result.values[i] = xBuf.values[originalIndex];\n }\n return result.toTensor() as T;\n }\n\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T {\n const prod = blockShape.reduce((a, b) => a * b);\n\n const reshaped = array_ops_util.getReshaped(x.shape, blockShape, prod);\n const permuted =\n array_ops_util.getPermuted(reshaped.length, blockShape.length);\n const reshapedPermuted =\n array_ops_util.getReshapedPermuted(x.shape, blockShape, prod);\n const sliceBeginCoords =\n array_ops_util.getSliceBeginCoords(crops, blockShape.length);\n const sliceSize =\n array_ops_util.getSliceSize(reshapedPermuted, crops, blockShape.length);\n\n return x.reshape(reshaped)\n .transpose(permuted)\n .reshape(reshapedPermuted)\n .slice(sliceBeginCoords, sliceSize) as T;\n }\n\n spaceToBatchND(\n x: T, blockShape: number[], paddings: Array<[number, number]>): T {\n const prod = blockShape.reduce((a, b) => a * b);\n\n const completePaddings: Array<[number, number]> = [[0, 0]];\n completePaddings.push(...paddings);\n for (let i = 1 + blockShape.length; i < x.shape.length; ++i) {\n completePaddings.push([0, 0]);\n }\n\n const paddedX = x.pad(completePaddings);\n\n const reshapedPaddedShape =\n array_ops_util.getReshaped(paddedX.shape, blockShape, prod, false);\n const permutedReshapedPaddedPermutation = array_ops_util.getPermuted(\n reshapedPaddedShape.length, blockShape.length, false);\n const flattenShape = array_ops_util.getReshapedPermuted(\n paddedX.shape, blockShape, prod, false);\n\n return paddedX.reshape(reshapedPaddedShape)\n .transpose(permutedReshapedPaddedPermutation)\n .reshape(flattenShape) as T;\n }\n\n private pool(x: Tensor4D, convInfo: Conv2DInfo, poolType: 'max'|'avg'):\n Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const y = ops.buffer(convInfo.outShape, 'float32');\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * strideHeight - padTop;\n const xRMin = Math.max(0, xRCorner);\n const xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner);\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * strideWidth - padLeft;\n const xCMin = Math.max(0, xCCorner);\n const xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner);\n\n let minMaxValue =\n (poolType === 'max' ? Number.NEGATIVE_INFINITY :\n Number.POSITIVE_INFINITY);\n let avgValue = 0;\n let count = 0;\n for (let xR = xRMin; xR < xRMax; ++xR) {\n for (let xC = xCMin; xC < xCMax; ++xC) {\n const pixel = x.get(b, xR, xC, d);\n if ((poolType === 'max' && pixel > minMaxValue)) {\n minMaxValue = pixel;\n } else if (poolType === 'avg') {\n avgValue += pixel;\n count++;\n }\n }\n if (isNaN(minMaxValue)) {\n break;\n }\n }\n y.set(\n poolType === 'avg' ? avgValue / count : minMaxValue, b, yR, yC,\n d);\n }\n }\n }\n }\n return y.toTensor();\n }\n\n maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return this.pool(x, convInfo, 'max');\n }\n\n private maxPoolPositions(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const maxPositions = ops.buffer(convInfo.outShape, 'int32');\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * strideHeight - padTop;\n const xRMin = Math.max(0, xRCorner);\n const xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner);\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * strideWidth - padLeft;\n const xCMin = Math.max(0, xCCorner);\n const xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner);\n let maxValue = Number.NEGATIVE_INFINITY;\n let maxPosition = -1;\n for (let xR = xRMin; xR < xRMax; ++xR) {\n const wR = xR - xRCorner;\n for (let xC = xCMin; xC < xCMax; ++xC) {\n const wC = xC - xCCorner;\n const pixel = x.get(b, xR, xC, d);\n if (pixel > maxValue) {\n maxValue = pixel;\n maxPosition = wR * filterWidth + wC;\n }\n }\n }\n maxPositions.set(maxPosition, b, yR, yC, d);\n }\n }\n }\n }\n return maxPositions.toTensor();\n }\n\n maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const maxPositions = this.maxPoolPositions(x, convInfo);\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const dx = ops.buffer(x.shape, 'float32');\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let dxR = 0; dxR < convInfo.inHeight; ++dxR) {\n for (let dxC = 0; dxC < convInfo.inWidth; ++dxC) {\n // Shader code begins.\n const dyRCorner = dxR - padTop;\n const dyCCorner = dxC - padLeft;\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; ++wR) {\n const dyR = (dyRCorner + wR) / strideHeight;\n if (dyR < 0 || dyR >= convInfo.outHeight ||\n Math.floor(dyR) !== dyR) {\n continue;\n }\n for (let wC = 0; wC < filterWidth; ++wC) {\n const dyC = (dyCCorner + wC) / strideWidth;\n if (dyC < 0 || dyC >= convInfo.outWidth ||\n Math.floor(dyC) !== dyC) {\n continue;\n }\n const maxPos = filterHeight * filterWidth - 1 -\n maxPositions.get(b, dyR, dyC, d);\n const curPos = wR * filterWidth + wC;\n\n const mask = maxPos === curPos ? 1 : 0;\n if (mask === 0) {\n continue;\n }\n\n const pixel = dy.get(b, dyR, dyC, d);\n dotProd += pixel * mask;\n }\n }\n dx.set(dotProd, b, dxR, dxC, d);\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const dx = ops.buffer(x.shape, 'float32');\n\n const avgMultiplier = 1 / (filterHeight * filterWidth);\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let dxR = 0; dxR < convInfo.inHeight; ++dxR) {\n for (let dxC = 0; dxC < convInfo.inWidth; ++dxC) {\n // Shader code begins.\n const dyRCorner = dxR - padTop;\n const dyCCorner = dxC - padLeft;\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; ++wR) {\n const dyR = (dyRCorner + wR) / strideHeight;\n if (dyR < 0 || dyR >= convInfo.outHeight ||\n Math.floor(dyR) !== dyR) {\n continue;\n }\n for (let wC = 0; wC < filterWidth; ++wC) {\n const dyC = (dyCCorner + wC) / strideWidth;\n if (dyC < 0 || dyC >= convInfo.outWidth ||\n Math.floor(dyC) !== dyC) {\n continue;\n }\n\n const pixel = dy.get(b, dyR, dyC, d);\n dotProd += pixel;\n }\n }\n dx.set(dotProd * avgMultiplier, b, dxR, dxC, d);\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n cast(x: T, dtype: DataType): T {\n return backend_util.castTensor(x, dtype, this);\n }\n\n reshape(x: Tensor, shape: ShapeMap[R]): Tensor {\n return backend_util.reshapeTensor(x, shape);\n }\n\n avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return this.pool(x, convInfo, 'avg').toFloat();\n }\n\n resizeBilinear(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const [batch, oldHeight, oldWidth, numChannels] = x.shape;\n const output =\n ops.buffer([batch, newHeight, newWidth, numChannels], x.dtype);\n\n const effectiveInputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < newHeight; r++) {\n for (let c = 0; c < newWidth; c++) {\n for (let d = 0; d < numChannels; d++) {\n // Begin shader.\n\n // Compute the fractional index of the source.\n const sourceFracRow =\n (effectiveInputSize[0]) * r / (effectiveOutputSize[0]);\n const sourceFracCol =\n (effectiveInputSize[1]) * c / (effectiveOutputSize[1]);\n\n const sourceRowFloor = Math.floor(sourceFracRow);\n const sourceRowCeil =\n Math.min(oldHeight - 1, Math.ceil(sourceFracRow));\n const sourceColFloor = Math.floor(sourceFracCol);\n const sourceColCeil =\n Math.min(oldWidth - 1, Math.ceil(sourceFracCol));\n\n const topLeft = x.get(b, sourceRowFloor, sourceColFloor, d);\n const bottomLeft = x.get(b, sourceRowCeil, sourceColFloor, d);\n const topRight = x.get(b, sourceRowFloor, sourceColCeil, d);\n const bottomRight = x.get(b, sourceRowCeil, sourceColCeil, d);\n\n const rowFrac = sourceFracRow - sourceRowFloor;\n const colFrac = sourceFracCol - sourceColFloor;\n\n const top = topLeft + (topRight - topLeft) * colFrac;\n const bottom = bottomLeft + (bottomRight - bottomLeft) * colFrac;\n const newValue = top + (bottom - top) * rowFrac;\n\n output.set(newValue, b, r, c, d);\n }\n }\n }\n }\n return output.toTensor();\n }\n\n resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n const [batch, xHeight, xWidth, depth] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n const output =\n ops.buffer([batch, xHeight, xWidth, depth], x.dtype);\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass and add the corresponding\n // coefficient from dy to the gradient (with some interpolation).\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n // Reference implementation\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/3039375c86a5bbc9610c7725dcaa95d635f87ba2/tensorflow/core/kernels/resize_bilinear_op.cc#L275\n\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < yHeight; r++) {\n const dxR = r * heightScale;\n const topDxRIndex = Math.floor(dxR);\n const bottomDxRIndex = Math.min(Math.ceil(dxR), xHeight - 1);\n const dxRLerp = dxR - topDxRIndex;\n const inverseDxRLerp = 1.0 - dxRLerp;\n\n for (let c = 0; c < yWidth; c++) {\n const dxC = c * widthScale;\n const leftDxCIndex = Math.floor(dxC);\n const rightDxCIndex = Math.min(Math.ceil(dxC), xWidth - 1);\n const dxCLerp = dxC - leftDxCIndex;\n const inverseDxCLerp = 1.0 - dxCLerp;\n\n for (let d = 0; d < depth; d++) {\n const dyVal = dy.get(b, r, c, d);\n\n let topLeft = output.get(b, topDxRIndex, leftDxCIndex, d);\n topLeft += dyVal * inverseDxRLerp * inverseDxCLerp;\n output.set(topLeft, b, topDxRIndex, leftDxCIndex, d);\n\n let topRight = output.get(b, topDxRIndex, rightDxCIndex, d);\n topRight += dyVal * inverseDxRLerp * dxCLerp;\n output.set(topRight, b, topDxRIndex, rightDxCIndex, d);\n\n let bottomLeft = output.get(b, bottomDxRIndex, leftDxCIndex, d);\n bottomLeft += dyVal * dxRLerp * inverseDxCLerp;\n output.set(bottomLeft, b, bottomDxRIndex, leftDxCIndex, d);\n\n let bottomRight = output.get(b, bottomDxRIndex, rightDxCIndex, d);\n bottomRight += dyVal * dxRLerp * dxCLerp;\n output.set(bottomRight, b, bottomDxRIndex, rightDxCIndex, d);\n }\n }\n }\n }\n\n return output.toTensor();\n }\n\n resizeNearestNeighbor(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const [batch, oldHeight, oldWidth, numChannels] = x.shape;\n const output =\n ops.buffer([batch, newHeight, newWidth, numChannels], x.dtype);\n\n const effectiveInputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < newHeight; r++) {\n for (let c = 0; c < newWidth; c++) {\n for (let d = 0; d < numChannels; d++) {\n // Begin shader.\n // Compute the fractional index of the source.\n const sourceFracRow =\n (effectiveInputSize[0]) * r / (effectiveOutputSize[0]);\n const sourceFracCol =\n (effectiveInputSize[1]) * c / (effectiveOutputSize[1]);\n const sourceNearestRow = Math.min(\n oldHeight - 1,\n alignCorners ? Math.round(sourceFracRow) :\n Math.floor(sourceFracRow));\n const sourceNearestCol = Math.min(\n oldWidth - 1,\n alignCorners ? Math.round(sourceFracCol) :\n Math.floor(sourceFracCol));\n const newValue = x.get(b, sourceNearestRow, sourceNearestCol, d);\n output.set(newValue, b, r, c, d);\n }\n }\n }\n }\n\n return output.toTensor();\n }\n\n resizeNearestNeighborBackprop(\n dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n const [batch, xHeight, xWidth, depth] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n const output =\n ops.buffer([batch, xHeight, xWidth, depth], x.dtype);\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n const invHeightScale = 1 / heightScale;\n const invWidthScale = 1 / widthScale;\n\n // This defines the size of the window of values around a particular\n // index in dy that we want to search for contributions to dx.\n const winHeight = (Math.ceil(invHeightScale) * 2) + 2;\n const winWidth = (Math.ceil(invWidthScale) * 2) + 2;\n\n // Loop over the output space.\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < xHeight; r++) {\n for (let c = 0; c < xWidth; c++) {\n // Compute bounds for where in dy we will look\n const startRLerp = Math.floor(r * invHeightScale);\n const startDyR = Math.floor(startRLerp - (winHeight / 2));\n\n const startCLerp = Math.floor(c * invWidthScale);\n const startDyC = Math.floor(startCLerp - (winWidth / 2));\n\n for (let d = 0; d < depth; d++) {\n let accum = 0;\n // loop over dy\n\n for (let dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n const dyR = dyROffset + startDyR;\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= yHeight) {\n continue;\n }\n\n for (let dyCOffSet = 0; dyCOffSet < winWidth; dyCOffSet++) {\n const dyC = dyCOffSet + startDyC;\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= yWidth) {\n continue;\n }\n\n const sourceFracRow =\n effectiveXSize[0] * (dyR / effectiveYSize[0]);\n const sourceFracCol =\n effectiveXSize[1] * (dyC / effectiveYSize[1]);\n\n const sourceNearestRow = Math.min(\n xHeight - 1,\n alignCorners ? Math.round(sourceFracRow) :\n Math.floor(sourceFracRow));\n\n const sourceNearestCol = Math.min(\n xWidth - 1,\n alignCorners ? Math.round(sourceFracCol) :\n Math.floor(sourceFracCol));\n\n if (r === sourceNearestRow && c === sourceNearestCol) {\n accum += dy.get(b, dyR, dyC, d);\n }\n }\n }\n\n output.set(accum, b, r, c, d);\n }\n }\n }\n }\n return output.toTensor();\n }\n\n batchNormalization(\n x: Tensor4D, mean: Tensor4D|Tensor1D, variance: Tensor4D|Tensor1D,\n varianceEpsilon: number, scale?: Tensor4D|Tensor1D,\n offset?: Tensor4D|Tensor1D): Tensor4D {\n const xValues = x.dataSync();\n const meanValues = mean.dataSync();\n const varianceValues = variance.dataSync();\n const scaleValues = scale ? scale.dataSync() : new Float32Array([1]);\n const offsetValues = offset ? offset.dataSync() : new Float32Array([0]);\n const outValues = new Float32Array(xValues.length);\n\n for (let i = 0; i < xValues.length; i++) {\n outValues[i] = offsetValues[i % offsetValues.length] +\n (xValues[i] - meanValues[i % meanValues.length]) *\n scaleValues[i % scaleValues.length] /\n Math.sqrt(\n varianceValues[i % varianceValues.length] + varianceEpsilon);\n }\n return tensor4d(outValues, x.shape);\n }\n\n localResponseNormalization4D(\n x: Tensor4D, radius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const output = ops.buffer(x.shape, 'float32');\n const rad = radius;\n const maxD = output.shape[3] - 1;\n\n function sumAcrossChannels(\n b: number, r: number, c: number, d: number): number {\n let sum = 0.0;\n for (let j = Math.max(0, d - rad); j <= Math.min(d + rad, maxD); j++) {\n const z = x.get(b, r, c, j);\n sum += z * z;\n }\n return sum;\n }\n\n for (let b = 0; b < output.shape[0]; b++) {\n for (let r = 0; r <= output.shape[1]; r++) {\n for (let c = 0; c < output.shape[2]; c++) {\n for (let d = 0; d < output.shape[3]; d++) {\n const sum = sumAcrossChannels(b, r, c, d);\n const val = x.get(b, r, c, d) * Math.pow(bias + alpha * sum, -beta);\n output.set(val, b, r, c, d);\n }\n }\n }\n }\n\n return output.toTensor();\n }\n\n LRNGrad(\n dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D,\n depthRadius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const batch = dy.shape[0];\n const rows = dy.shape[1];\n const cols = dy.shape[2];\n const depth = dy.shape[3];\n const output = ops.buffer([batch, rows, cols, depth], 'float32');\n\n for (let b = 0; b < batch; ++b) {\n for (let r = 0; r < rows; ++r) {\n for (let c = 0; c < cols; ++c) {\n for (let d = 0; d < depth; ++d) {\n const depthBegin = Math.max(0, d - depthRadius);\n const depthEnd = Math.min(depth, d + depthRadius + 1);\n\n let norm = 0;\n for (let k = depthBegin; k < depthEnd; ++k) {\n norm += inputImage.get(b, r, c, k) * inputImage.get(b, r, c, k);\n }\n norm = alpha * norm + bias;\n for (let k = depthBegin; k < depthEnd; ++k) {\n let dyi = -2 * alpha * beta * inputImage.get(b, r, c, k) *\n outputImage.get(b, r, c, d) / norm;\n if (d === k) {\n dyi += Math.pow(norm, -beta);\n }\n dyi *= dy.get(b, r, c, d);\n output.set(dyi + output.get(b, r, c, k), b, r, c, k);\n }\n }\n }\n }\n }\n return output.toTensor();\n }\n\n multinomial(\n logits: Tensor2D, normalized: boolean, numSamples: number,\n seed: number): Tensor2D {\n const probabilities = normalized ? logits : ops.softmax(logits);\n const batchSize = probabilities.shape[0];\n const numEvents = probabilities.shape[1];\n const res = ops.zeros([batchSize, numSamples], 'int32');\n const resVals = res.dataSync();\n const probVals = probabilities.dataSync();\n\n for (let b = 0; b < batchSize; ++b) {\n const offset = b * numEvents;\n // The cdf won't include the last event. It will be implicit if no other\n // event happened.\n const cdf = new Float32Array(numEvents - 1);\n cdf[0] = probVals[offset];\n for (let event = 1; event < cdf.length; ++event) {\n cdf[event] = cdf[event - 1] + probVals[offset + event];\n }\n\n const random = seedrandom.alea(seed.toString());\n const outOffset = b * numSamples;\n for (let sampleId = 0; sampleId < numSamples; ++sampleId) {\n const r = random();\n\n // Assume last event happened by default.\n resVals[outOffset + sampleId] = cdf.length;\n\n for (let event = 0; event < cdf.length; event++) {\n if (r < cdf[event]) {\n resVals[outOffset + sampleId] = event;\n break;\n }\n }\n }\n }\n return res;\n }\n\n oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number):\n Tensor2D {\n const res = new Float32Array(indices.size * depth);\n res.fill(offValue);\n\n for (let event = 0; event < indices.size; ++event) {\n if (indices.get(event) >= 0 && indices.get(event) < depth) {\n res[event * depth + indices.get(event)] = onValue;\n }\n }\n return ops.tensor2d(res, [indices.size, depth], 'int32');\n }\n\n nonMaxSuppression(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number): Tensor1D {\n const boxesVals = boxes.dataSync();\n const scoresVals = scores.dataSync();\n return nonMaxSuppressionImpl(\n boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold);\n }\n\n private broadcastedBinaryOp(\n a: Tensor, b: Tensor, dtype: DataType,\n op: (a: number, b: number) => number): Tensor {\n const newShape =\n broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const result = ops.buffer(newShape, dtype);\n const aValues = a.dataSync();\n const bValues = b.dataSync();\n\n const aBroadcastDims = broadcast_util.getBroadcastDims(a.shape, newShape);\n const bBroadcastDims = broadcast_util.getBroadcastDims(b.shape, newShape);\n\n const aBuf = a.buffer();\n const bBuf = b.buffer();\n for (let i = 0; i < result.values.length; ++i) {\n const loc = result.indexToLoc(i);\n\n const aLoc = loc.slice(-a.rank);\n aBroadcastDims.forEach(d => aLoc[d] = 0);\n const aIndex = aBuf.locToIndex(aLoc);\n\n const bLoc = loc.slice(-b.rank);\n bBroadcastDims.forEach(d => bLoc[d] = 0);\n const bIndex = bBuf.locToIndex(bLoc);\n\n result.values[i] = op(aValues[aIndex], bValues[bIndex]);\n }\n return result.toTensor();\n }\n dispose() {}\n}\n\nENV.registerBackend(\n 'cpu', () => new MathBackendCPU(), 1 /* priority */, setTensorTracker);\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nconst delayCallback = typeof requestAnimationFrame !== 'undefined' ?\n requestAnimationFrame : // Browsers\n setImmediate; // Node.js\n\n/**\n * Returns a promise that resolve when a requestAnimationFrame has completed.\n *\n * On Node.js this uses setImmediate instead of requestAnimationFrame.\n *\n * This is simply a sugar method so that users can do the following:\n * `await tf.nextFrame();`\n */\n/** @doc {heading: 'Performance', subheading: 'Timing'} */\nfunction nextFrame(): Promise {\n return new Promise(resolve => delayCallback(() => resolve()));\n}\n\nexport {nextFrame};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/* Type definitions for exporting and importing of models. */\n\n/**\n * A map from Tensor dtype to number of bytes per element of the Tensor.\n */\nexport const DTYPE_VALUE_SIZE_MAP: {[dtype: string]: number} = {\n 'float32': 4,\n 'int32': 4,\n 'uint16': 2,\n 'uint8': 1,\n 'bool': 1,\n};\n\n/**\n * A weight manifest.\n *\n * The weight manifest consists of an ordered list of weight-manifest groups.\n * Each weight-manifest group (\"group\" for short hereafter) consists of a\n * number of weight values stored in a number of paths.\n * See the documentation of `WeightManifestGroupConfig` below for more details.\n */\nexport declare type WeightsManifestConfig = WeightsManifestGroupConfig[];\n\n/**\n * A weight-manifest group.\n *\n * Consists of an ordered list of weight values encoded in binary format,\n * stored in an ordered list of paths.\n */\nexport declare interface WeightsManifestGroupConfig {\n /**\n * An ordered list of paths.\n *\n * Paths are intentionally abstract in order to be general. For example, they\n * can be relative URL paths or relative paths on the file system.\n */\n paths: string[];\n\n /**\n * Specifications of the weights stored in the paths.\n */\n weights: WeightsManifestEntry[];\n}\n\n/**\n * An entry in the weight manifest.\n *\n * The entry contains specification of a weight.\n */\nexport declare interface WeightsManifestEntry {\n /**\n * Name of the weight, e.g., 'Dense_1/bias'\n */\n name: string;\n\n /**\n * Shape of the weight.\n */\n shape: number[];\n\n /**\n * Data type of the weight.\n */\n dtype: 'float32'|'int32'|'bool';\n\n /**\n * Information for dequantization of the weight.\n */\n quantization?: {\n scale: number, // The scaling constant to multiply by.\n min: number, // The (possibly nudged) minimum weight to add.\n dtype: 'uint16'|'uint8' // The dtype of the quantized weights.\n };\n}\n\n/**\n * Options for saving a model.\n */\nexport interface SaveConfig {\n /**\n * Whether to save only the trainable weights of the model, ignoring the\n * untrainable ones.\n */\n trainableOnly?: boolean;\n}\n\n/**\n * Result of a saving operation.\n */\nexport interface SaveResult {\n /**\n * Information about the model artifacts saved.\n */\n modelArtifactsInfo: ModelArtifactsInfo;\n\n /**\n * HTTP responses from the server that handled the model-saving request (if\n * any). This is applicable only to server-based saving routes.\n */\n responses?: Response[];\n\n /**\n * Error messages and related data (if any).\n */\n errors?: Array<{}|string>;\n}\n\nexport declare interface ModelArtifactsInfo {\n /**\n * Timestamp for when the model is saved.\n */\n dateSaved: Date;\n\n /**\n * Type of the model topology\n *\n * Possible values:\n * - JSON: JSON config (human-readable, e.g., Keras JSON).\n * - GraphDef: TensorFlow\n * [GraphDef](https://www.tensorflow.org/extend/tool_developers/#graphdef)\n * protocal buffer (binary).\n */\n modelTopologyType: 'JSON'|'GraphDef';\n\n /**\n * Size of model topology (Keras JSON or GraphDef), in bytes.\n */\n modelTopologyBytes?: number;\n\n /**\n * Size of weight specification or manifest, in bytes.\n */\n weightSpecsBytes?: number;\n\n /**\n * Size of weight value data, in bytes.\n */\n weightDataBytes?: number;\n}\n\n/**\n * The serialized artifacts of a model, including topology and weights.\n *\n * The `modelTopology`, `weightSpecs` and `weightData` fields of this interface\n * are optional, in order to support topology- or weights-only saving and\n * loading.\n */\nexport declare interface ModelArtifacts {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `FrozenModel`), this is a binary buffer\n * carrying the `GraphDef` protocol buffer.\n */\n modelTopology?: {}|ArrayBuffer;\n\n /**\n * Weight specifications.\n *\n * This corresponds to the weightsData below.\n */\n weightSpecs?: WeightsManifestEntry[];\n\n /**\n * Binary buffer for all weight values concatenated in the order specified\n * by `weightSpecs`.\n */\n weightData?: ArrayBuffer;\n}\n\n/**\n * Type definition for handlers of loading operations.\n */\nexport type LoadHandler = () => Promise;\n\n/**\n * Type definition for handlers of saving operations.\n */\nexport type SaveHandler = (modelArtifact: ModelArtifacts) =>\n Promise;\n\n/**\n * Interface for a model import/export handler.\n *\n * The `save` and `load` handlers are both optional, in order to allow handlers\n * that support only saving or loading.\n */\n// tslint:disable-next-line:interface-name\nexport interface IOHandler {\n save?: SaveHandler;\n load?: LoadHandler;\n}\n\n/**\n * An interface for the manager of a model store.\n *\n * A model store is defined as a storage medium on which multiple models can\n * be stored. Each stored model has a unique `path` as its identifier.\n * A `ModelStoreManager` for the store allows actions including\n *\n * - Listing the models stored in the store.\n * - Deleting a model from the store.\n */\nexport interface ModelStoreManager {\n /**\n * List all models in the model store.\n *\n * @returns A dictionary mapping paths of existing models to their\n * model artifacts info. Model artifacts info include type of the model's\n * topology, byte sizes of the topology, weights, etc.\n */\n listModels(): Promise<{[path: string]: ModelArtifactsInfo}>;\n\n /**\n * Remove a model specified by `path`.\n *\n * @param path\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n removeModel(path: string): Promise;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensor} from '../ops/tensor_ops';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport {sizeFromShape} from '../util';\nimport {DTYPE_VALUE_SIZE_MAP, ModelArtifacts, ModelArtifactsInfo, WeightsManifestEntry} from './types';\n\n/**\n * Encode a map from names to weight values as an ArrayBuffer, along with an\n * `Array` of `WeightsManifestEntry` as specification of the encoded weights.\n *\n * This function does not perform sharding.\n *\n * This function is the reverse of `decodeWeights`.\n *\n * @param tensors A map (\"dict\") from names to tensors.\n * @returns A `Promise` of\n * - A flat `ArrayBuffer` with all the binary values of the `Tensor`s\n * concatenated.\n * - An `Array` of `WeightManifestEntry`s, carrying information including\n * tensor names, `dtype`s and shapes.\n * @throws Error: on unsupported tensor `dtype`.\n */\nexport async function encodeWeights(tensors: NamedTensorMap):\n Promise<{data: ArrayBuffer, specs: WeightsManifestEntry[]}> {\n // TODO(adarob, cais): Support quantization.\n const specs: WeightsManifestEntry[] = [];\n const dataPromises: Array> = [];\n for (const name in tensors) {\n const t = tensors[name];\n\n if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool') {\n throw new Error(`Unsupported dtype in weight '${name}': ${t.dtype}`);\n }\n specs.push({name, shape: t.shape, dtype: t.dtype});\n dataPromises.push(t.data());\n }\n const tensorValues = await Promise.all(dataPromises);\n return {data: concatenateTypedArrays(tensorValues), specs};\n}\n\n/**\n * Decode flat ArrayBuffer as weights.\n *\n * This function does not handle sharding.\n *\n * This function is the reverse of `encodeWeights`.\n *\n * @param buffer A flat ArrayBuffer carrying the binary values of the tensors\n * concatenated in the order specified in `specs`.\n * @param specs Specifications of the names, dtypes and shapes of the tensors\n * whose value are encoded by `buffer`.\n * @return A map from tensor name to tensor value, with the names corresponding\n * to names in `specs`.\n * @throws Error, if any of the tensors has unsupported dtype.\n */\nexport function decodeWeights(\n buffer: ArrayBuffer, specs: WeightsManifestEntry[]): NamedTensorMap {\n // TODO(adarob, cais): Support quantization.\n const out: NamedTensorMap = {};\n let offset = 0;\n for (const spec of specs) {\n const name = spec.name;\n const dtype = spec.dtype;\n const shape = spec.shape;\n\n if (spec.quantization != null) {\n throw new Error(\n `decodeWeights does not support quantization yet, but encountered ` +\n `weight '${name} with quantization.'`);\n }\n\n const size = sizeFromShape(shape);\n let value: Tensor;\n if (dtype === 'float32') {\n value = tensor(new Float32Array(buffer, offset, size), shape, 'float32');\n } else if (dtype === 'int32') {\n value = tensor(new Int32Array(buffer, offset, size), shape, 'int32');\n } else if (dtype === 'bool') {\n value = tensor(new Uint8Array(buffer, offset, size), shape, 'bool');\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n out[name] = value;\n\n offset += size * DTYPE_VALUE_SIZE_MAP[dtype];\n }\n return out;\n}\n\n/**\n * Concatenate TypedArrays into an ArrayBuffer.\n */\nexport function concatenateTypedArrays(xs: TypedArray[]): ArrayBuffer {\n // TODO(adarob, cais): Support quantization.\n if (xs === null) {\n throw new Error(`Invalid input value: ${JSON.stringify(xs)}`);\n }\n\n let totalByteLength = 0;\n\n // `normalizedXs` is here for this reason: a `TypedArray`'s `buffer'\n // can have a different byte length from that of the `TypedArray` itself,\n // for example, when the `TypedArray` is created from an offset in an\n // `ArrayBuffer`. `normliazedXs` holds `TypedArray`s whose `buffer`s match\n // the `TypedArray` in byte length. If an element of `xs` does not show\n // this property, a new `TypedArray` that satisfy this property will be\n // constructed and pushed into `normalizedXs`.\n const normalizedXs: TypedArray[] = [];\n xs.forEach((x: TypedArray) => {\n totalByteLength += x.byteLength;\n // tslint:disable:no-any\n normalizedXs.push(\n x.byteLength === x.buffer.byteLength ? x :\n new (x.constructor as any)(x));\n if (!(x as any instanceof Float32Array || x as any instanceof Int32Array ||\n x as any instanceof Uint8Array)) {\n throw new Error(`Unsupported TypedArray subtype: ${x.constructor.name}`);\n }\n // tslint:enable:no-any\n });\n\n const y = new Uint8Array(totalByteLength);\n let offset = 0;\n normalizedXs.forEach((x: TypedArray) => {\n y.set(new Uint8Array(x.buffer), offset);\n offset += x.byteLength;\n });\n\n return y.buffer;\n}\n\n// Use Buffer on Node.js instead of Blob/atob/btoa\nconst useNodeBuffer = typeof Buffer !== 'undefined' &&\n (typeof Blob === 'undefined' || typeof atob === 'undefined' ||\n typeof btoa === 'undefined');\n\n/**\n * Calculate the byte length of a JavaScript string.\n *\n * Note that a JavaScript string can contain wide characters, therefore the\n * length of the string is not necessarily equal to the byte length.\n *\n * @param str Input string.\n * @returns Byte length.\n */\nexport function stringByteLength(str: string): number {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}\n\n/**\n * Encode an ArrayBuffer as a base64 encoded string.\n *\n * @param buffer `ArrayBuffer` to be converted.\n * @returns A string that base64-encodes `buffer`.\n */\nexport function arrayBufferToBase64String(buffer: ArrayBuffer): string {\n if (useNodeBuffer) {\n return Buffer.from(buffer).toString('base64');\n }\n return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer)));\n}\n\n/**\n * Decode a base64 string as an ArrayBuffer.\n *\n * @param str Base64 string.\n * @returns Decoded `ArrayBuffer`.\n */\nexport function base64StringToArrayBuffer(str: string): ArrayBuffer {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}\n\n/**\n * Concatenate a number of ArrayBuffers into one.\n *\n * @param buffers A number of array buffers to concatenate.\n * @returns Result of concatenating `buffers` in order.\n */\nexport function concatenateArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer {\n let totalByteLength = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n totalByteLength += buffer.byteLength;\n });\n\n const temp = new Uint8Array(totalByteLength);\n let offset = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}\n\n/**\n * Get the basename of a path.\n *\n * Behaves in a way analogous to Linux's basename command.\n *\n * @param path\n */\nexport function basename(path: string): string {\n const SEPARATOR = '/';\n path = path.trim();\n while (path.endsWith(SEPARATOR)) {\n path = path.slice(0, path.length - 1);\n }\n const items = path.split(SEPARATOR);\n return items[items.length - 1];\n}\n\n/**\n * Populate ModelArtifactsInfo fields for a model with JSON topology.\n * @param modelArtifacts\n * @returns A ModelArtifactsInfo object.\n */\nexport function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts):\n ModelArtifactsInfo {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error('Expected JSON model topology, received ArrayBuffer.');\n }\n\n return {\n dateSaved: new Date(),\n modelTopologyType: 'JSON',\n modelTopologyBytes: modelArtifacts.modelTopology == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.modelTopology)),\n weightSpecsBytes: modelArtifacts.weightSpecs == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)),\n weightDataBytes: modelArtifacts.weightData == null ?\n 0 :\n modelArtifacts.weightData.byteLength,\n };\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {IOHandler} from './types';\n\nexport type IORouter = (url: string) => IOHandler;\n\nexport class IORouterRegistry {\n // Singleton instance.\n private static instance: IORouterRegistry;\n\n private saveRouters: IORouter[];\n private loadRouters: IORouter[];\n\n private constructor() {\n this.saveRouters = [];\n this.loadRouters = [];\n }\n\n private static getInstance(): IORouterRegistry {\n if (IORouterRegistry.instance == null) {\n IORouterRegistry.instance = new IORouterRegistry();\n }\n return IORouterRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerSaveRouter(saveRouter: IORouter) {\n IORouterRegistry.getInstance().saveRouters.push(saveRouter);\n }\n\n /**\n * Register a load-handler router.\n *\n * @param loadRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `load` method defined or `null`.\n */\n static registerLoadRouter(loadRouter: IORouter) {\n IORouterRegistry.getInstance().loadRouters.push(loadRouter);\n }\n\n /**\n * Look up IOHandler for saving, given a URL-like string.\n *\n * @param url\n * @returns If only one match is found, an instance of IOHandler with the\n * `save` method defined. If no match is found, `null`.\n * @throws Error, if more than one match is found.\n */\n static getSaveHandlers(url: string): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'save');\n }\n\n /**\n * Look up IOHandler for loading, given a URL-like string.\n *\n * @param url\n * @returns All valid handlers for `url`, given the currently registered\n * handler routers.\n */\n static getLoadHandlers(url: string): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'load');\n }\n\n private static getHandlers(url: string, handlerType: 'save'|'load'):\n IOHandler[] {\n const validHandlers: IOHandler[] = [];\n const routers = handlerType === 'load' ? this.getInstance().loadRouters :\n this.getInstance().saveRouters;\n routers.forEach(router => {\n const handler = router(url);\n if (handler !== null) {\n validHandlers.push(handler);\n }\n });\n return validHandlers;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Classes and functions for model management across multiple storage mediums.\n *\n * Supported client actions:\n * - Listing models on all registered storage mediums.\n * - Remove model by URL from any registered storage mediums, by using URL\n * string.\n * - Moving or copying model from one path to another in the same medium or from\n * one medium to another, by using URL strings.\n */\n\nimport {assert} from '../util';\n\nimport {IORouterRegistry} from './router_registry';\nimport {ModelArtifactsInfo, ModelStoreManager} from './types';\n\nconst URL_SCHEME_SUFFIX = '://';\n\nexport class ModelStoreManagerRegistry {\n // Singleton instance.\n private static instance: ModelStoreManagerRegistry;\n\n private managers: {[scheme: string]: ModelStoreManager};\n\n private constructor() {\n this.managers = {};\n }\n\n private static getInstance(): ModelStoreManagerRegistry {\n if (ModelStoreManagerRegistry.instance == null) {\n ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry();\n }\n return ModelStoreManagerRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerManager(scheme: string, manager: ModelStoreManager) {\n assert(scheme != null, 'scheme must not be undefined or null.');\n if (scheme.endsWith(URL_SCHEME_SUFFIX)) {\n scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX));\n }\n assert(scheme.length > 0, 'scheme must not be an empty string.');\n const registry = ModelStoreManagerRegistry.getInstance();\n assert(\n registry.managers[scheme] == null,\n `A model store manager is already registered for scheme '${scheme}'.`);\n registry.managers[scheme] = manager;\n }\n\n static getManager(scheme: string): ModelStoreManager {\n const manager = this.getInstance().managers[scheme];\n if (manager == null) {\n throw new Error(`Cannot find model manager for scheme '${scheme}'`);\n }\n return manager;\n }\n\n static getSchemes(): string[] {\n return Object.keys(this.getInstance().managers);\n }\n}\n\n/**\n * Helper method for parsing a URL string into a scheme and a path.\n *\n * @param url E.g., 'localstorage://my-model'\n * @returns A dictionary with two fields: scheme and path.\n * Scheme: e.g., 'localstorage' in the example above.\n * Path: e.g., 'my-model' in the example above.\n */\nfunction parseURL(url: string): {scheme: string, path: string} {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\n `The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}\n\nasync function cloneModelInternal(\n sourceURL: string, destURL: string,\n deleteSource = false): Promise {\n assert(\n sourceURL !== destURL,\n `Old path and new path are the same: '${sourceURL}'`);\n\n const loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL);\n assert(\n loadHandlers.length > 0,\n `Copying failed because no load handler is found for source URL ${\n sourceURL}.`);\n assert(\n loadHandlers.length < 2,\n `Copying failed because more than one (${loadHandlers.length}) ` +\n `load handlers for source URL ${sourceURL}.`);\n const loadHandler = loadHandlers[0];\n\n const saveHandlers = IORouterRegistry.getSaveHandlers(destURL);\n assert(\n saveHandlers.length > 0,\n `Copying failed because no save handler is found for destination URL ` +\n `${destURL}.`);\n assert(\n saveHandlers.length < 2,\n `Copying failed because more than one (${loadHandlers.length}) ` +\n `save handlers for destination URL ${destURL}.`);\n const saveHandler = saveHandlers[0];\n\n const sourceScheme = parseURL(sourceURL).scheme;\n const sourcePath = parseURL(sourceURL).path;\n const sameMedium = sourceScheme === parseURL(sourceURL).scheme;\n\n const modelArtifacts = await loadHandler.load();\n\n // If moving within the same storage medium, remove the old model as soon as\n // the loading is done. Without doing this, it is possible that the combined\n // size of the two models will cause the cloning to fail.\n if (deleteSource && sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n const saveResult = await saveHandler.save(modelArtifacts);\n\n // If moving between mediums, the deletion is done after the save succeeds.\n // This guards against the case in which saving to the destination medium\n // fails.\n if (deleteSource && !sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n return saveResult.modelArtifactsInfo;\n}\n\n/**\n * List all models stored in registered storage mediums.\n *\n * For a web browser environment, the registered mediums are Local Storage and\n * IndexedDB.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @returns A `Promise` of a dictionary mapping URLs of existing models to\n * their model artifacts info. URLs include medium-specific schemes, e.g.,\n * 'indexeddb://my/model/1'. Model artifacts info include type of the\n * model's topology, byte sizes of the topology, weights, etc.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function listModels(): Promise<{[url: string]: ModelArtifactsInfo}> {\n const schemes = ModelStoreManagerRegistry.getSchemes();\n const out: {[url: string]: ModelArtifactsInfo} = {};\n for (const scheme of schemes) {\n const schemeOut =\n await ModelStoreManagerRegistry.getManager(scheme).listModels();\n for (const path in schemeOut) {\n const url = scheme + URL_SCHEME_SUFFIX + path;\n out[url] = schemeOut[path];\n }\n }\n return out;\n}\n\n/**\n * Remove a model specified by URL from a reigstered storage medium.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @param url A URL to a stored model, with a scheme prefix, e.g.,\n * 'localstorage://my-model-1', 'indexeddb://my/model/2'.\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function removeModel(url: string): Promise {\n const schemeAndPath = parseURL(url);\n const manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme);\n return await manager.removeModel(schemeAndPath.path);\n}\n\n/**\n * Copy a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Copying within a storage medium, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Copying between two storage mediums, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Copy the model, from Local Storage to IndexedDB.\n * await tf.io.copyModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove both models.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of copying.\n * @param destURL Destination URL of copying.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if copying fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function copyModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = false;\n return await cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\n/**\n * Move a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Moving within a storage medium, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Moving between two storage mediums, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Move the model, from Local Storage to IndexedDB.\n * await tf.io.moveModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove the moved model.\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of moving.\n * @param destURL Destination URL of moving.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if moving fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function moveModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = true;\n return await cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\nexport {moveModel, copyModel, removeModel, listModels};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {getModelArtifactsInfoForJSON} from './io_utils';\nimport {ModelStoreManagerRegistry} from './model_management';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst DATABASE_NAME = 'tensorflowjs';\nconst DATABASE_VERSION = 1;\n\n// Model data and ModelArtifactsInfo (metadata) are stored in two separate\n// stores for efficient access of the list of stored models and their metadata.\n// 1. The object store for model data: topology, weights and weight manifests.\nconst MODEL_STORE_NAME = 'models_store';\n// 2. The object store for ModelArtifactsInfo, including meta-information such\n// as the type of topology (JSON vs binary), byte size of the topology, byte\n// size of the weights, etc.\nconst INFO_STORE_NAME = 'model_info_store';\n\n/**\n * Delete the entire database for tensorflow.js, including the models store.\n */\nexport async function deleteDatabase(): Promise {\n const idbFactory = getIndexedDBFactory();\n\n return new Promise((resolve, reject) => {\n const deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME);\n deleteRequest.onsuccess = () => resolve();\n deleteRequest.onerror = error => reject(error);\n });\n}\n\nfunction getIndexedDBFactory(): IDBFactory {\n if (!ENV.get('IS_BROWSER')) {\n // TODO(cais): Add more info about what IOHandler subtypes are available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'Failed to obtain IndexedDB factory because the current environment' +\n 'is not a web browser.');\n }\n // tslint:disable-next-line:no-any\n const theWindow: any = window;\n const factory = theWindow.indexedDB || theWindow.mozIndexedDB ||\n theWindow.webkitIndexedDB || theWindow.msIndexedDB ||\n theWindow.shimIndexedDB;\n if (factory == null) {\n throw new Error(\n 'The current browser does not appear to support IndexedDB.');\n }\n return factory;\n}\n\nfunction setUpDatabase(openRequest: IDBRequest) {\n const db = openRequest.result as IDBDatabase;\n db.createObjectStore(MODEL_STORE_NAME, {keyPath: 'modelPath'});\n db.createObjectStore(INFO_STORE_NAME, {keyPath: 'modelPath'});\n}\n\n/**\n * IOHandler subclass: Browser IndexedDB.\n *\n * See the doc string of `browserIndexedDB` for more details.\n */\nexport class BrowserIndexedDB implements IOHandler {\n protected readonly indexedDB: IDBFactory;\n protected readonly modelPath: string;\n\n static readonly URL_SCHEME = 'indexeddb://';\n\n constructor(modelPath: string) {\n this.indexedDB = getIndexedDBFactory();\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For IndexedDB, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n // TODO(cais): Support saving GraphDef models.\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n return this.databaseAction(this.modelPath, modelArtifacts) as\n Promise;\n }\n\n async load(): Promise {\n return this.databaseAction(this.modelPath) as Promise;\n }\n\n /**\n * Perform database action to put model artifacts into or read model artifacts\n * from IndexedDB object store.\n *\n * Whether the action is put or get depends on whether `modelArtifacts` is\n * specified. If it is specified, the action will be put; otherwise the action\n * will be get.\n *\n * @param modelPath A unique string path for the model.\n * @param modelArtifacts If specified, it will be the model artifacts to be\n * stored in IndexedDB.\n * @returns A `Promise` of `SaveResult`, if the action is put, or a `Promise`\n * of `ModelArtifacts`, if the action is get.\n */\n private databaseAction(modelPath: string, modelArtifacts?: ModelArtifacts):\n Promise {\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result as IDBDatabase;\n\n if (modelArtifacts == null) {\n // Read model out from object store.\n const modelTx = db.transaction(MODEL_STORE_NAME, 'readonly');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const getRequest = modelStore.get(this.modelPath);\n getRequest.onsuccess = () => {\n if (getRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${this.modelPath}' ` +\n `in IndexedDB.`));\n } else {\n resolve(getRequest.result.modelArtifacts);\n }\n };\n getRequest.onerror = error => {\n db.close();\n return reject(getRequest.error);\n };\n modelTx.oncomplete = () => db.close();\n } else {\n // Put model into object store.\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n // First, put ModelArtifactsInfo into info store.\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n let infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const putInfoRequest =\n infoStore.put({modelPath: this.modelPath, modelArtifactsInfo});\n let modelTx: IDBTransaction;\n putInfoRequest.onsuccess = () => {\n // Second, put model data into model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const putModelRequest = modelStore.put({\n modelPath: this.modelPath,\n modelArtifacts,\n modelArtifactsInfo\n });\n putModelRequest.onsuccess = () => resolve({modelArtifactsInfo});\n putModelRequest.onerror = error => {\n // If the put-model request fails, roll back the info entry as\n // well.\n infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const deleteInfoRequest = infoStore.delete(this.modelPath);\n deleteInfoRequest.onsuccess = () => {\n db.close();\n return reject(putModelRequest.error);\n };\n deleteInfoRequest.onerror = error => {\n db.close();\n return reject(putModelRequest.error);\n };\n };\n };\n putInfoRequest.onerror = error => {\n db.close();\n return reject(putInfoRequest.error);\n };\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n }\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nexport const indexedDBRouter: IORouter = (url: string) => {\n if (!ENV.get('IS_BROWSER')) {\n return null;\n } else {\n if (url.startsWith(BrowserIndexedDB.URL_SCHEME)) {\n return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(indexedDBRouter);\nIORouterRegistry.registerLoadRouter(indexedDBRouter);\n\n/**\n * Creates a browser IndexedDB IOHandler for saving and loading models.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save('indexeddb://MyModel'));\n * console.log(saveResult);\n * ```\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`),\n * which can be used with, e.g., `tf.Model.save`.\n */\nexport function browserIndexedDB(modelPath: string): IOHandler {\n return new BrowserIndexedDB(modelPath);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserIndexedDB.URL_SCHEME) ?\n key.slice(BrowserIndexedDB.URL_SCHEME.length) :\n key;\n}\n\nexport class BrowserIndexedDBManager implements ModelStoreManager {\n private indexedDB: IDBFactory;\n\n constructor() {\n this.indexedDB = getIndexedDBFactory();\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n return new Promise<{[path: string]: ModelArtifactsInfo}>(\n (resolve, reject) => {\n const openRequest =\n this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result as IDBDatabase;\n const tx = db.transaction(INFO_STORE_NAME, 'readonly');\n const store = tx.objectStore(INFO_STORE_NAME);\n // tslint:disable:max-line-length\n // Need to cast `store` as `any` here because TypeScript's DOM\n // library does not have the `getAll()` method even though the\n // method is supported in the latest version of most mainstream\n // browsers:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll\n // tslint:enable:max-line-length\n // tslint:disable-next-line:no-any\n const getAllInfoRequest = (store as any).getAll() as IDBRequest;\n getAllInfoRequest.onsuccess = () => {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n for (const item of getAllInfoRequest.result) {\n out[item.modelPath] = item.modelArtifactsInfo;\n }\n resolve(out);\n };\n getAllInfoRequest.onerror = error => {\n db.close();\n return reject(getAllInfoRequest.error);\n };\n tx.oncomplete = () => db.close();\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result as IDBDatabase;\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n const infoStore = infoTx.objectStore(INFO_STORE_NAME);\n\n const getInfoRequest = infoStore.get(path);\n let modelTx: IDBTransaction;\n getInfoRequest.onsuccess = () => {\n if (getInfoRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${path}' ` +\n `in IndexedDB.`));\n } else {\n // First, delete the entry in the info store.\n const deleteInfoRequest = infoStore.delete(path);\n const deleteModelData = () => {\n // Second, delete the entry in the model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const deleteModelRequest = modelStore.delete(path);\n deleteModelRequest.onsuccess = () =>\n resolve(getInfoRequest.result.modelArtifactsInfo);\n deleteModelRequest.onerror = error =>\n reject(getInfoRequest.error);\n };\n // Proceed with deleting model data regardless of whether deletion\n // of info data succeeds or not.\n deleteInfoRequest.onsuccess = deleteModelData;\n deleteInfoRequest.onerror = error => {\n deleteModelData();\n db.close();\n return reject(getInfoRequest.error);\n };\n }\n };\n getInfoRequest.onerror = error => {\n db.close();\n return reject(getInfoRequest.error);\n };\n\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nif (ENV.get('IS_BROWSER')) {\n // Wrap the construction and registration, to guard against browsers that\n // don't support Local Storage.\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager());\n } catch (err) {\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {assert} from '../util';\nimport {arrayBufferToBase64String, base64StringToArrayBuffer, getModelArtifactsInfoForJSON} from './io_utils';\nimport {ModelStoreManagerRegistry} from './model_management';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst PATH_SEPARATOR = '/';\nconst PATH_PREFIX = 'tensorflowjs_models';\nconst INFO_SUFFIX = 'info';\nconst MODEL_TOPOLOGY_SUFFIX = 'model_topology';\nconst WEIGHT_SPECS_SUFFIX = 'weight_specs';\nconst WEIGHT_DATA_SUFFIX = 'weight_data';\n\n/**\n * Purge all tensorflow.js-saved model artifacts from local storage.\n *\n * @returns Paths of the models purged.\n */\nexport function purgeLocalStorageArtifacts(): string[] {\n if (!ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') {\n throw new Error(\n 'purgeLocalStorageModels() cannot proceed because local storage is ' +\n 'unavailable in the current environment.');\n }\n const LS = window.localStorage;\n const purgedModelPaths: string[] = [];\n for (let i = 0; i < LS.length; ++i) {\n const key = LS.key(i);\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n if (key.startsWith(prefix) && key.length > prefix.length) {\n LS.removeItem(key);\n const modelName = getModelPathFromKey(key);\n if (purgedModelPaths.indexOf(modelName) === -1) {\n purgedModelPaths.push(modelName);\n }\n }\n }\n return purgedModelPaths;\n}\n\nfunction getModelKeys(path: string):\n {info: string, topology: string, weightSpecs: string, weightData: string} {\n return {\n info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR),\n topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR),\n weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR),\n weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR)\n };\n}\n\n/**\n * Get model path from a local-storage key.\n *\n * E.g., 'tensorflowjs_models/my/model/1/info' --> 'my/model/1'\n *\n * @param key\n */\nfunction getModelPathFromKey(key: string) {\n const items = key.split(PATH_SEPARATOR);\n if (items.length < 3) {\n throw new Error(`Invalid key format: ${key}`);\n }\n return items.slice(1, items.length - 1).join(PATH_SEPARATOR);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserLocalStorage.URL_SCHEME) ?\n key.slice(BrowserLocalStorage.URL_SCHEME.length) :\n key;\n}\n\n/**\n * IOHandler subclass: Browser Local Storage.\n *\n * See the doc string to `browserLocalStorage` for more details.\n */\nexport class BrowserLocalStorage implements IOHandler {\n protected readonly LS: Storage;\n protected readonly modelPath: string;\n protected readonly keys: {[key: string]: string};\n\n static readonly URL_SCHEME = 'localstorage://';\n\n constructor(modelPath: string) {\n if (!ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') {\n // TODO(cais): Add more info about what IOHandler subtypes are\n // available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'The current environment does not support local storage.');\n }\n this.LS = window.localStorage;\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For local storage, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n this.keys = getModelKeys(this.modelPath);\n }\n\n /**\n * Save model artifacts to browser local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @param modelArtifacts The model artifacts to be stored.\n * @returns An instance of SaveResult.\n */\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const topology = JSON.stringify(modelArtifacts.modelTopology);\n const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs);\n\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n\n try {\n this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo));\n this.LS.setItem(this.keys.topology, topology);\n this.LS.setItem(this.keys.weightSpecs, weightSpecs);\n this.LS.setItem(\n this.keys.weightData,\n arrayBufferToBase64String(modelArtifacts.weightData));\n\n return {modelArtifactsInfo};\n } catch (err) {\n // If saving failed, clean up all items saved so far.\n for (const key in this.keys) {\n this.LS.removeItem(this.keys[key]);\n }\n\n throw new Error(\n `Failed to save model '${this.modelPath}' to local storage: ` +\n `size quota being exceeded is a possible cause of this failure: ` +\n `modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, ` +\n `weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, ` +\n `weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`);\n }\n }\n }\n\n /**\n * Load a model from local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @returns The loaded model (if loading succeeds).\n */\n async load(): Promise {\n const info =\n JSON.parse(this.LS.getItem(this.keys.info)) as ModelArtifactsInfo;\n if (info == null) {\n throw new Error(\n `In local storage, there is no model with name '${this.modelPath}'`);\n }\n\n if (info.modelTopologyType !== 'JSON') {\n throw new Error(\n 'BrowserLocalStorage does not support loading non-JSON model ' +\n 'topology yet.');\n }\n\n const out: ModelArtifacts = {};\n\n // Load topology.\n const topology = JSON.parse(this.LS.getItem(this.keys.topology));\n if (topology == null) {\n throw new Error(\n `In local storage, the topology of model '${this.modelPath}' ` +\n `is missing.`);\n }\n out.modelTopology = topology;\n\n // Load weight specs.\n const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs));\n if (weightSpecs == null) {\n throw new Error(\n `In local storage, the weight specs of model '${this.modelPath}' ` +\n `are missing.`);\n }\n out.weightSpecs = weightSpecs;\n\n // Load weight data.\n const weightDataBase64 = this.LS.getItem(this.keys.weightData);\n if (weightDataBase64 == null) {\n throw new Error(\n `In local storage, the binary weight values of model ` +\n `'${this.modelPath}' are missing.`);\n }\n out.weightData = base64StringToArrayBuffer(weightDataBase64);\n\n return out;\n }\n}\n\nexport const localStorageRouter: IORouter = (url: string) => {\n if (!ENV.get('IS_BROWSER')) {\n return null;\n } else {\n if (url.startsWith(BrowserLocalStorage.URL_SCHEME)) {\n return browserLocalStorage(\n url.slice(BrowserLocalStorage.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(localStorageRouter);\nIORouterRegistry.registerLoadRouter(localStorageRouter);\n\n/**\n * Factory function for local storage IOHandler.\n *\n * This `IOHandler` supports both `save` and `load`.\n *\n * For each model's saved artifacts, four items are saved to local storage.\n * - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the\n * model, such as date saved, type of the topology, size in bytes, etc.\n * - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras-\n * style models, this is a stringized JSON.\n * - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the\n * model, can be used to decode the saved binary weight values (see\n * item below).\n * - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary\n * weight values, stored as a base64-encoded string.\n *\n * Saving may throw an `Error` if the total size of the artifacts exceed the\n * browser-specific quota.\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `IOHandler`, which can be used with, e.g.,\n * `tf.Model.save`.\n */\nexport function browserLocalStorage(modelPath: string): IOHandler {\n return new BrowserLocalStorage(modelPath);\n}\n\nexport class BrowserLocalStorageManager implements ModelStoreManager {\n private readonly LS: Storage;\n\n constructor() {\n assert(ENV.get('IS_BROWSER'), 'Current environment is not a web browser');\n assert(\n typeof window.localStorage !== 'undefined',\n 'Current browser does not appear to support localStorage');\n this.LS = window.localStorage;\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n const suffix = PATH_SEPARATOR + INFO_SUFFIX;\n for (let i = 0; i < this.LS.length; ++i) {\n const key = this.LS.key(i);\n if (key.startsWith(prefix) && key.endsWith(suffix)) {\n const modelPath = getModelPathFromKey(key);\n out[modelPath] = JSON.parse(this.LS.getItem(key)) as ModelArtifactsInfo;\n }\n }\n return out;\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n const keys = getModelKeys(path);\n if (this.LS.getItem(keys.info) == null) {\n throw new Error(`Cannot find model at path '${path}'`);\n }\n const info = JSON.parse(this.LS.getItem(keys.info)) as ModelArtifactsInfo;\n\n this.LS.removeItem(keys.info);\n this.LS.removeItem(keys.topology);\n this.LS.removeItem(keys.weightSpecs);\n this.LS.removeItem(keys.weightData);\n return info;\n }\n}\n\nif (ENV.get('IS_BROWSER')) {\n // Wrap the construction and registration, to guard against browsers that\n // don't support Local Storage.\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager());\n } catch (err) {\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers related to files, such as browser-triggered file downloads,\n * user-selected files in browser.\n */\n\nimport {ENV} from '../environment';\nimport {basename, concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\nconst DEFAULT_FILE_NAME_PREFIX = 'model';\nconst DEFAULT_JSON_EXTENSION_NAME = '.json';\nconst DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin';\n\nexport class BrowserDownloads implements IOHandler {\n private readonly modelTopologyFileName: string;\n private readonly weightDataFileName: string;\n private readonly jsonAnchor: HTMLAnchorElement;\n private readonly weightDataAnchor: HTMLAnchorElement;\n\n static readonly URL_SCHEME = 'downloads://';\n\n constructor(fileNamePrefix?: string) {\n if (!ENV.get('IS_BROWSER')) {\n // TODO(cais): Provide info on what IOHandlers are available under the\n // current environment.\n throw new Error(\n 'triggerDownloads() cannot proceed because the current environment ' +\n 'is not a browser.');\n }\n\n if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) {\n fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length);\n }\n if (fileNamePrefix == null || fileNamePrefix.length === 0) {\n fileNamePrefix = DEFAULT_FILE_NAME_PREFIX;\n }\n\n this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME;\n this.weightDataFileName =\n fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n const weightsURL = window.URL.createObjectURL(new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}));\n\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'DownloadTrigger.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./' + this.weightDataFileName],\n weights: modelArtifacts.weightSpecs\n }];\n const modelTopologyAndWeightManifest = {\n modelTopology: modelArtifacts.modelTopology,\n weightsManifest\n };\n const modelTopologyAndWeightManifestURL =\n window.URL.createObjectURL(new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: 'application/json'}));\n\n // If anchor elements are not provided, create them without attaching them\n // to parents, so that the downloaded file names can be controlled.\n const jsonAnchor = this.jsonAnchor == null ? document.createElement('a') :\n this.jsonAnchor;\n jsonAnchor.download = this.modelTopologyFileName;\n jsonAnchor.href = modelTopologyAndWeightManifestURL;\n // Trigger downloads by calling the `click` methods on the download\n // anchors.\n jsonAnchor.click();\n\n if (modelArtifacts.weightData != null) {\n const weightDataAnchor = this.weightDataAnchor == null ?\n document.createElement('a') :\n this.weightDataAnchor;\n weightDataAnchor.download = this.weightDataFileName;\n weightDataAnchor.href = weightsURL;\n weightDataAnchor.click();\n }\n\n return {modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts)};\n }\n }\n}\n\nclass BrowserFiles implements IOHandler {\n private readonly files: File[];\n\n constructor(files: File[]) {\n if (files == null || files.length < 1) {\n throw new Error(\n `When calling browserFiles, at least 1 file is required, ` +\n `but received ${files}`);\n }\n this.files = files;\n }\n\n async load(): Promise {\n const jsonFile = this.files[0];\n const weightFiles = this.files.slice(1);\n\n return new Promise((resolve, reject) => {\n const jsonReader = new FileReader();\n jsonReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const modelJSON = JSON.parse((event.target as any).result);\n const modelTopology = modelJSON.modelTopology as {};\n if (modelTopology == null) {\n reject(new Error(\n `modelTopology field is missing from file ${jsonFile.name}`));\n return;\n }\n\n if (weightFiles.length === 0) {\n resolve({modelTopology});\n }\n\n const weightsManifest =\n modelJSON.weightsManifest as WeightsManifestConfig;\n if (weightsManifest == null) {\n reject(new Error(\n `weightManifest field is missing from file ${jsonFile.name}`));\n return;\n }\n\n let pathToFile: {[path: string]: File};\n try {\n pathToFile =\n this.checkManifestAndWeightFiles(weightsManifest, weightFiles);\n } catch (err) {\n reject(err);\n return;\n }\n\n const weightSpecs: WeightsManifestEntry[] = [];\n const paths: string[] = [];\n const perFileBuffers: ArrayBuffer[] = [];\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n paths.push(path);\n perFileBuffers.push(null);\n });\n weightSpecs.push(...weightsGroup.weights);\n });\n\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n const weightFileReader = new FileReader();\n weightFileReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const weightData = (event.target as any).result as ArrayBuffer;\n const index = paths.indexOf(path);\n perFileBuffers[index] = weightData;\n if (perFileBuffers.indexOf(null) === -1) {\n resolve({\n modelTopology,\n weightSpecs,\n weightData: concatenateArrayBuffers(perFileBuffers),\n });\n }\n };\n weightFileReader.onerror = (error: FileReaderProgressEvent) => {\n reject(`Failed to weights data from file of path '${path}'.`);\n return;\n };\n weightFileReader.readAsArrayBuffer(pathToFile[path]);\n });\n });\n };\n jsonReader.onerror = (error: FileReaderProgressEvent) => {\n reject(\n `Failed to read model topology and weights manifest JSON ` +\n `from file '${jsonFile.name}'. BrowserFiles supports loading ` +\n `Keras-style tf.Model artifacts only.`);\n return;\n };\n jsonReader.readAsText(jsonFile);\n });\n }\n\n /**\n * Check the compatibility between weights manifest and weight files.\n */\n private checkManifestAndWeightFiles(\n manifest: WeightsManifestConfig, files: File[]): {[path: string]: File} {\n const basenames: string[] = [];\n const fileNames = files.map(file => basename(file.name));\n const pathToFile: {[path: string]: File} = {};\n for (const group of manifest) {\n group.paths.forEach(path => {\n const pathBasename = basename(path);\n if (basenames.indexOf(pathBasename) !== -1) {\n throw new Error(\n `Duplicate file basename found in weights manifest: ` +\n `'${pathBasename}'`);\n }\n basenames.push(pathBasename);\n if (fileNames.indexOf(pathBasename) === -1) {\n throw new Error(\n `Weight file with basename '${pathBasename}' is not provided.`);\n } else {\n pathToFile[path] = files[fileNames.indexOf(pathBasename)];\n }\n });\n }\n\n if (basenames.length !== files.length) {\n throw new Error(\n `Mismatch in the number of files in weights manifest ` +\n `(${basenames.length}) and the number of weight files provided ` +\n `(${files.length}).`);\n }\n return pathToFile;\n }\n}\n\nexport const browserDownloadsRouter: IORouter = (url: string) => {\n if (!ENV.get('IS_BROWSER')) {\n return null;\n } else {\n if (url.startsWith(BrowserDownloads.URL_SCHEME)) {\n return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(browserDownloadsRouter);\n\n/**\n * Creates an IOHandler that triggers file downloads from the browser.\n *\n * The returned `IOHandler` instance can be used as model exporting methods such\n * as `tf.Model.save` and supports only saving.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * const saveResult = await model.save('downloads://mymodel'));\n * // This will trigger downloading of two files:\n * // 'mymodel.json' and 'mymodel.weights.bin'.\n * console.log(saveResult);\n * ```\n *\n * @param fileNamePrefix Prefix name of the files to be downloaded. For use with\n * `tf.Model`, `fileNamePrefix` should follow either of the following two\n * formats:\n * 1. `null` or `undefined`, in which case the default file\n * names will be used:\n * - 'model.json' for the JSON file containing the model topology and\n * weights manifest.\n * - 'model.weights.bin' for the binary file containing the binary weight\n * values.\n * 2. A single string or an Array of a single string, as the file name prefix.\n * For example, if `'foo'` is provided, the downloaded JSON\n * file and binary weights file will be named 'foo.json' and\n * 'foo.weights.bin', respectively.\n * @param config Additional configuration for triggering downloads.\n * @returns An instance of `DownloadTrigger` `IOHandler`.\n */\nexport function browserDownloads(fileNamePrefix = 'model'): IOHandler {\n return new BrowserDownloads(fileNamePrefix);\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from user-selected files.\n *\n * This method can be used for loading from files such as user-selected files\n * in the browser.\n * When used in conjunction with `tf.loadModel`, an instance of `tf.Model`\n * (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * // Note: This code snippet won't run properly without the actual file input\n * // elements in the HTML DOM.\n *\n * // Suppose there are two HTML file input (``)\n * // elements.\n * const uploadJSONInput = document.getElementById('upload-json');\n * const uploadWeightsInput = document.getElementById('upload-weights');\n * const model = await tfl.loadModel(tf.io.browserFiles(\n * [uploadJSONInput.files[0], uploadWeightsInput.files[0]]));\n * ```\n *\n * @param files `File`s to load from. Currently, this function supports only\n * loading from files that contain Keras-style models (i.e., `tf.Model`s), for\n * which an `Array` of `File`s is expected (in that order):\n * - A JSON file containing the model topology and weight manifest.\n * - Optionally, One or more binary files containing the binary weights.\n * These files must have names that match the paths in the `weightsManifest`\n * contained by the aforementioned JSON file, or errors will be thrown\n * during loading. These weights files have the same format as the ones\n * generated by `tensorflowjs_converter` that comes with the `tensorflowjs`\n * Python PIP package. If no weights files are provided, only the model\n * topology will be loaded from the JSON file above.\n * @returns An instance of `Files` `IOHandler`.\n */\nexport function browserFiles(files: File[]): IOHandler {\n return new BrowserFiles(files);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensor} from '../ops/ops';\nimport {NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport * as util from '../util';\nimport {DTYPE_VALUE_SIZE_MAP, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\n/**\n * Reads binary weights data from a number of URLs.\n *\n * @param fetchURLs URLs to send the HTTP requests at, using `fetch` calls.\n * @param requestOptions RequestInit (options) for the HTTP requests.\n * @returns A `Promise` of an Array of `ArrayBuffer`. The Array has the same\n * length as `fetchURLs`.\n */\nexport async function loadWeightsAsArrayBuffer(\n fetchURLs: string[], requestOptions?: RequestInit): Promise {\n // Create the requests for all of the weights in parallel.\n const requests = fetchURLs.map(fetchURL => fetch(fetchURL, requestOptions));\n const responses = await Promise.all(requests);\n const buffers =\n await Promise.all(responses.map(response => response.arrayBuffer()));\n return buffers;\n}\n\n/**\n * Reads a weights manifest JSON configuration, fetches the weights and\n * returns them as `Tensor`s.\n *\n * @param manifest The weights manifest JSON.\n * @param filePathPrefix The path prefix for filenames given in the manifest.\n * Defaults to the empty string.\n * @param weightNames The names of the weights to be fetched.\n */\nexport async function loadWeights(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[],\n requestOptions?: RequestInit): Promise {\n // TODO(nsthorat): Groups are currently fetched atomically. If you need a\n // single weight from a group, the whole group will be fetched. At a future\n // date, we should support fetching only the individual shards within a\n // group that are needed to reconstruct the requested weight.\n // TODO(cais): Use `decodeWeights` for implementation.\n\n // Collect all the groups, weights, and their relative offsets to be\n // fetched.\n const groupIndicesToFetchMap = manifest.map(() => false);\n const groupWeightsToFetch: {\n [group: number]: Array<{\n manifestEntry: WeightsManifestEntry; groupOffset: number;\n sizeBytes: number;\n }>\n } = {};\n const weightsFound = weightNames != null ? weightNames.map(() => false) : [];\n const allManifestWeightNames: string[] = [];\n manifest.forEach((manifestGroupConfig, groupIndex) => {\n let groupOffset = 0;\n manifestGroupConfig.weights.forEach(weightsEntry => {\n const rawDtype = ('quantization' in weightsEntry) ?\n weightsEntry.quantization.dtype :\n weightsEntry.dtype;\n\n const weightsBytes = DTYPE_VALUE_SIZE_MAP[rawDtype] *\n util.sizeFromShape(weightsEntry.shape);\n\n const enqueueWeightsForFetchingFn = () => {\n groupIndicesToFetchMap[groupIndex] = true;\n if (groupWeightsToFetch[groupIndex] == null) {\n groupWeightsToFetch[groupIndex] = [];\n }\n\n groupWeightsToFetch[groupIndex].push({\n manifestEntry: weightsEntry,\n groupOffset,\n sizeBytes: weightsBytes\n });\n };\n\n if (weightNames != null) {\n weightNames.forEach((weightName, weightIndex) => {\n if (weightName === weightsEntry.name) {\n enqueueWeightsForFetchingFn();\n weightsFound[weightIndex] = true;\n }\n });\n } else {\n enqueueWeightsForFetchingFn();\n }\n\n allManifestWeightNames.push(weightsEntry.name);\n groupOffset += weightsBytes;\n });\n });\n\n if (!weightsFound.every(found => found)) {\n const weightsNotFound = weightNames.filter((weight, i) => !weightsFound[i]);\n throw new Error(\n `Could not find weights in manifest with names: ` +\n `${weightsNotFound.join(', ')}. \\n` +\n `Manifest JSON has weights with names: ` +\n `${allManifestWeightNames.join(', ')}.`);\n }\n\n // Convert the one-hot boolean groupId => shouldFetch map to a list of group\n // IDs.\n const groupIndicesToFetch =\n groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => {\n if (shouldFetch) {\n accumulator.push(i);\n }\n return accumulator;\n }, []);\n\n const fetchUrls: string[] = [];\n groupIndicesToFetch.forEach(i => {\n manifest[i].paths.forEach(filepath => {\n const fetchUrl = filePathPrefix +\n (!filePathPrefix.endsWith('/') ? '/' : '') + filepath;\n fetchUrls.push(fetchUrl);\n });\n });\n const buffers = await loadWeightsAsArrayBuffer(fetchUrls, requestOptions);\n\n const weightsTensorMap: NamedTensorMap = {};\n let bufferIndexOffset = 0;\n groupIndicesToFetch.forEach(i => {\n const numBuffers = manifest[i].paths.length;\n\n let groupBytes = 0;\n for (let i = 0; i < numBuffers; i++) {\n groupBytes += buffers[bufferIndexOffset + i].byteLength;\n }\n\n // Create a buffer for the whole group.\n const groupBuffer = new ArrayBuffer(groupBytes);\n const groupByteBuffer = new Uint8Array(groupBuffer);\n let groupBufferOffset = 0;\n for (let i = 0; i < numBuffers; i++) {\n const buffer = new Uint8Array(buffers[bufferIndexOffset + i]);\n groupByteBuffer.set(buffer, groupBufferOffset);\n groupBufferOffset += buffer.byteLength;\n }\n\n const weightsEntries = groupWeightsToFetch[i];\n\n weightsEntries.forEach(weightsEntry => {\n const byteBuffer = groupBuffer.slice(\n weightsEntry.groupOffset,\n weightsEntry.groupOffset + weightsEntry.sizeBytes);\n\n let typedArray: TypedArray;\n\n const dtype = weightsEntry.manifestEntry.dtype;\n\n if ('quantization' in weightsEntry.manifestEntry) {\n const quantization = weightsEntry.manifestEntry.quantization;\n if (quantization.dtype !== 'uint8' && quantization.dtype !== 'uint16') {\n throw new Error(\n `Weight ${weightsEntry.manifestEntry.name} has unknown ` +\n `quantization dtype ${quantization.dtype}.`);\n }\n const quantizedArray = (quantization.dtype === 'uint8') ?\n new Uint8Array(byteBuffer) :\n new Uint16Array(byteBuffer);\n if (dtype === 'float32') {\n typedArray = Float32Array.from(\n quantizedArray, v => v * quantization.scale + quantization.min);\n } else if (dtype === 'int32') {\n typedArray = Int32Array.from(\n quantizedArray,\n v => Math.round(v * quantization.scale + quantization.min));\n } else {\n throw new Error(\n `Weight ${weightsEntry.manifestEntry.name} has a dtype not ` +\n `supported by quantization: ${dtype}`);\n }\n } else {\n if (dtype === 'float32') {\n typedArray = new Float32Array(byteBuffer);\n } else if (dtype === 'int32') {\n typedArray = new Int32Array(byteBuffer);\n } else if (dtype === 'bool') {\n typedArray = new Uint8Array(byteBuffer);\n } else {\n throw new Error(\n `Weight ${weightsEntry.manifestEntry.name} has unknown dtype ` +\n `${dtype}.`);\n }\n }\n\n const weightName = weightsEntry.manifestEntry.name;\n if (weightsTensorMap[weightName] != null) {\n throw new Error(\n `Duplicate weight with name ${weightName}. ` +\n `Please make sure weights names are unique in the manifest JSON.`);\n }\n weightsTensorMap[weightName] = tensor(\n typedArray, weightsEntry.manifestEntry.shape,\n weightsEntry.manifestEntry.dtype);\n });\n\n bufferIndexOffset += numBuffers;\n });\n\n return weightsTensorMap;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandler implementations based on HTTP requests in the web browser.\n *\n * Uses [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n */\n\nimport {assert} from '../util';\nimport {concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeightsAsArrayBuffer} from './weights_loader';\n\nexport class BrowserHTTPRequest implements IOHandler {\n protected readonly path: string;\n protected readonly requestInit: RequestInit;\n\n readonly DEFAULT_METHOD = 'POST';\n\n static readonly URL_SCHEMES = ['http://', 'https://'];\n\n constructor(path: string, requestInit?: RequestInit) {\n if (typeof fetch === 'undefined') {\n throw new Error(\n // tslint:disable-next-line:max-line-length\n 'browserHTTPRequest is not supported outside the web browser without a fetch polyfill.');\n }\n\n assert(\n path != null && path.length > 0,\n 'URL path for browserHTTPRequest must not be null, undefined or ' +\n 'empty.');\n this.path = path;\n\n if (requestInit != null && requestInit.body != null) {\n throw new Error(\n 'requestInit is expected to have no pre-existing body, but has one.');\n }\n this.requestInit = requestInit || {};\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserHTTPRequest.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n const init = Object.assign({method: this.DEFAULT_METHOD}, this.requestInit);\n init.body = new FormData();\n\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./model.weights.bin'],\n weights: modelArtifacts.weightSpecs,\n }];\n const modelTopologyAndWeightManifest = {\n modelTopology: modelArtifacts.modelTopology,\n weightsManifest\n };\n\n init.body.append(\n 'model.json',\n new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: 'application/json'}),\n 'model.json');\n\n if (modelArtifacts.weightData != null) {\n init.body.append(\n 'model.weights.bin',\n new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}),\n 'model.weights.bin');\n }\n\n const response = await fetch(this.path, init);\n\n if (response.status === 200) {\n return {\n modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts),\n responses: [response],\n };\n } else {\n throw new Error(\n `BrowserHTTPRequest.save() failed due to HTTP response status ` +\n `${response.status}.`);\n }\n }\n\n /**\n * Load model artifacts via HTTP request(s).\n *\n * See the documentation to `browserHTTPRequest` for details on the saved\n * artifacts.\n *\n * @returns The loaded model artifacts (if loading succeeds).\n */\n async load(): Promise {\n const modelConfigRequest = await fetch(this.path, this.requestInit);\n const modelConfig = await modelConfigRequest.json();\n const modelTopology = modelConfig['modelTopology'];\n const weightsManifest = modelConfig['weightsManifest'];\n\n // We do not allow both modelTopology and weightsManifest to be missing.\n if (modelTopology == null && weightsManifest == null) {\n throw new Error(\n `The JSON from HTTP path ${this.path} contains neither model ` +\n `topology or manifest for weights.`);\n }\n\n let weightSpecs: WeightsManifestEntry[];\n let weightData: ArrayBuffer;\n if (weightsManifest != null) {\n const weightsManifest =\n modelConfig['weightsManifest'] as WeightsManifestConfig;\n weightSpecs = [];\n for (const entry of weightsManifest) {\n weightSpecs.push(...entry.weights);\n }\n\n let pathPrefix = this.path.substring(0, this.path.lastIndexOf('/'));\n if (!pathPrefix.endsWith('/')) {\n pathPrefix = pathPrefix + '/';\n }\n\n const fetchURLs: string[] = [];\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n fetchURLs.push(pathPrefix + path);\n });\n });\n weightData = concatenateArrayBuffers(\n await loadWeightsAsArrayBuffer(fetchURLs, this.requestInit));\n }\n\n return {modelTopology, weightSpecs, weightData};\n }\n}\n\nexport const httpRequestRouter: IORouter = (url: string) => {\n if (typeof fetch === 'undefined') {\n // browserHTTPRequest uses `fetch`, if one wants to use it in node.js\n // they have to setup a global fetch polyfill.\n return null;\n } else {\n for (const scheme of BrowserHTTPRequest.URL_SCHEMES) {\n if (url.startsWith(scheme)) {\n return browserHTTPRequest(url);\n }\n }\n return null;\n }\n};\nIORouterRegistry.registerSaveRouter(httpRequestRouter);\nIORouterRegistry.registerLoadRouter(httpRequestRouter);\n\n/**\n * Creates an IOHandler subtype that sends model artifacts to HTTP server.\n *\n * An HTTP request of the `multipart/form-data` mime type will be sent to the\n * `path` URL. The form data includes artifacts that represent the topology\n * and/or weights of the model. In the case of Keras-style `tf.Model`, two\n * blobs (files) exist in form-data:\n * - A JSON file consisting of `modelTopology` and `weightsManifest`.\n * - A binary weights file consisting of the concatenated weight values.\n * These files are in the same format as the one generated by\n * [tfjs_converter](https://js.tensorflow.org/tutorials/import-keras.html).\n *\n * The following code snippet exemplifies the client-side code that uses this\n * function:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save(tf.io.browserHTTPRequest(\n * 'http://model-server:5000/upload', {method: 'PUT'}));\n * console.log(saveResult);\n * ```\n *\n * If the default `POST` method is to be used, without any custom parameters\n * such as headers, you can simply pass an HTTP or HTTPS URL to `model.save`:\n *\n * ```js\n * const saveResult = await model.save('http://model-server:5000/upload');\n * ```\n *\n * The following Python code snippet based on the\n * [flask](https://github.com/pallets/flask) server framework implements a\n * server that can receive the request. Upon receiving the model artifacts\n * via the requst, this particular server reconsistutes instances of\n * [Keras Models](https://keras.io/models/model/) in memory.\n *\n * ```python\n * # pip install -U flask flask-cors tensorflow tensorflowjs\n *\n * from __future__ import absolute_import\n * from __future__ import division\n * from __future__ import print_function\n *\n * import io\n *\n * from flask import Flask, Response, request\n * from flask_cors import CORS, cross_origin\n * import tensorflow as tf\n * import tensorflowjs as tfjs\n * import werkzeug.formparser\n *\n *\n * class ModelReceiver(object):\n *\n * def __init__(self):\n * self._model = None\n * self._model_json_bytes = None\n * self._model_json_writer = None\n * self._weight_bytes = None\n * self._weight_writer = None\n *\n * @property\n * def model(self):\n * self._model_json_writer.flush()\n * self._weight_writer.flush()\n * self._model_json_writer.seek(0)\n * self._weight_writer.seek(0)\n *\n * json_content = self._model_json_bytes.read()\n * weights_content = self._weight_bytes.read()\n * return tfjs.converters.deserialize_keras_model(\n * json_content,\n * weight_data=[weights_content],\n * use_unique_name_scope=True)\n *\n * def stream_factory(self,\n * total_content_length,\n * content_type,\n * filename,\n * content_length=None):\n * # Note: this example code is *not* thread-safe.\n * if filename == 'model.json':\n * self._model_json_bytes = io.BytesIO()\n * self._model_json_writer = io.BufferedWriter(self._model_json_bytes)\n * return self._model_json_writer\n * elif filename == 'model.weights.bin':\n * self._weight_bytes = io.BytesIO()\n * self._weight_writer = io.BufferedWriter(self._weight_bytes)\n * return self._weight_writer\n *\n *\n * def main():\n * app = Flask('model-server')\n * CORS(app)\n * app.config['CORS_HEADER'] = 'Content-Type'\n *\n * model_receiver = ModelReceiver()\n *\n * @app.route('/upload', methods=['POST'])\n * @cross_origin()\n * def upload():\n * print('Handling request...')\n * werkzeug.formparser.parse_form_data(\n * request.environ, stream_factory=model_receiver.stream_factory)\n * print('Received model:')\n * with tf.Graph().as_default(), tf.Session():\n * model = model_receiver.model\n * model.summary()\n * # You can perform `model.predict()`, `model.fit()`,\n * # `model.evaluate()` etc. here.\n * return Response(status=200)\n *\n * app.run('localhost', 5000)\n *\n *\n * if __name__ == '__main__':\n * main()\n * ```\n *\n * @param path URL path. Can be an absolute HTTP path (e.g.,\n * 'http://localhost:8000/model-upload)') or a relative path (e.g.,\n * './model-upload').\n * @param requestInit Request configurations to be used when sending\n * HTTP request to server using `fetch`. It can contain fields such as\n * `method`, `credentials`, `headers`, `mode`, etc. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request\n * for more information. `requestInit` must not have a body, because the body\n * will be set by TensorFlow.js. File blobs representing\n * the model topology (filename: 'model.json') and the weights of the\n * model (filename: 'model.weights.bin') will be appended to the body.\n * If `requestInit` has a `body`, an Error will be thrown.\n * @returns An instance of `IOHandler`.\n */\nexport function browserHTTPRequest(\n path: string, requestInit?: RequestInit): IOHandler {\n return new BrowserHTTPRequest(path, requestInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers that pass through the in-memory ModelArtifacts format.\n */\n\nimport {IOHandler, ModelArtifacts, SaveResult, WeightsManifestEntry} from './types';\n\nclass PassthroughLoader implements IOHandler {\n constructor(\n private readonly modelTopology?: {}|ArrayBuffer,\n private readonly weightSpecs?: WeightsManifestEntry[],\n private readonly weightData?: ArrayBuffer) {}\n\n async load(): Promise {\n let result = {};\n if (this.modelTopology != null) {\n result = {modelTopology: this.modelTopology, ...result};\n }\n if (this.weightSpecs != null && this.weightSpecs.length > 0) {\n result = {weightSpecs: this.weightSpecs, ...result};\n }\n if (this.weightData != null && this.weightData.byteLength > 0) {\n result = {weightData: this.weightData, ...result};\n }\n return result;\n }\n}\n\nclass PassthroughSaver implements IOHandler {\n constructor(\n private readonly saveHandler: (artifacts: ModelArtifacts) => SaveResult) {\n }\n\n async save(modelArtifacts: ModelArtifacts) {\n return this.saveHandler(modelArtifacts);\n }\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from memory.\n *\n * When used in conjunction with `tf.loadModel`, an instance of `tf.Model`\n * (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * const model = await tf.loadModel(tf.io.fromMemory(\n * modelTopology, weightSpecs, weightData));\n * ```\n *\n * @param modelTopology a object containing model topology (i.e., parsed from\n * the JSON format).\n * @param weightSpecs An array of `WeightsManifestEntry` objects describing the\n * names, shapes, types, and quantization of the weight data.\n * @param weightData A single `ArrayBuffer` containing the weight data,\n * concatenated in the order described by the weightSpecs.\n *\n * @returns A passthrough `IOHandler` that simply loads the provided data.\n */\nexport function fromMemory(\n modelTopology: {}, weightSpecs?: WeightsManifestEntry[],\n weightData?: ArrayBuffer): IOHandler {\n return new PassthroughLoader(modelTopology, weightSpecs, weightData);\n}\n\n/**\n * Creates an IOHandler that passes saved model artifacts to a callback.\n *\n * ```js\n * function handleSave(artifacts) {\n * // ... do something with the artifacts ...\n * return {modelArtifactsInfo: {...}, ...};\n * }\n *\n * const saveResult = model.save(tf.io.withSaveHandler(handleSave));\n * ```\n *\n * @param saveHandler A function that accepts a `ModelArtifacts` and returns a\n * `SaveResult`.\n */\nexport function withSaveHandler(\n saveHandler: (artifacts: ModelArtifacts) => SaveResult): IOHandler {\n return new PassthroughSaver(saveHandler);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Importing local_storage and indexed_db is necessary for the routers to be\n// registered.\nimport './indexed_db';\nimport './local_storage';\n\nimport {browserFiles} from './browser_files';\nimport {browserHTTPRequest} from './browser_http';\nimport {concatenateArrayBuffers, decodeWeights, encodeWeights, getModelArtifactsInfoForJSON} from './io_utils';\nimport {fromMemory, withSaveHandler} from './passthrough';\nimport {IORouterRegistry} from './router_registry';\nimport {IOHandler, LoadHandler, ModelArtifacts, ModelStoreManager, SaveConfig, SaveHandler, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeights} from './weights_loader';\n\nconst registerSaveRouter = IORouterRegistry.registerSaveRouter;\nconst registerLoadRouter = IORouterRegistry.registerLoadRouter;\nconst getSaveHandlers = IORouterRegistry.getSaveHandlers;\nconst getLoadHandlers = IORouterRegistry.getLoadHandlers;\n\nexport {copyModel, listModels, moveModel, removeModel} from './model_management';\n\nexport {\n browserFiles,\n browserHTTPRequest,\n concatenateArrayBuffers,\n decodeWeights,\n encodeWeights,\n fromMemory,\n getLoadHandlers,\n getModelArtifactsInfoForJSON,\n getSaveHandlers,\n IOHandler,\n LoadHandler,\n loadWeights,\n ModelArtifacts,\n ModelStoreManager,\n registerLoadRouter,\n registerSaveRouter,\n SaveConfig,\n SaveHandler,\n SaveResult,\n WeightsManifestConfig,\n WeightsManifestEntry,\n withSaveHandler\n};\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Types to support JSON-esque data structures internally.\n *\n * Internally ConfigDict's use camelCase keys and values where the\n * values are class names to be instantiated. On the python side, these\n * will be snake_case. Internally we allow Enums into the values for better\n * type safety, but these need to be converted to raw primitives (usually\n * strings) for round-tripping with python.\n *\n * toConfig returns the TS-friendly representation. model.toJSON() returns\n * the pythonic version as that's the portable format. If you need to\n * python-ify a non-model level toConfig output, you'll need to use a\n * convertTsToPythonic from serialization_utils in -Layers.\n *\n */\nexport type ConfigDictValue =\n boolean|number|string|null|ConfigDictArray|ConfigDict;\nexport interface ConfigDict {\n [key: string]: ConfigDictValue;\n}\nexport interface ConfigDictArray extends Array {}\n\n/**\n * Type to represent the class-type of Serializable objects.\n *\n * Ie the class prototype with access to the constructor and any\n * static members/methods. Instance methods are not listed here.\n *\n * Source for this idea: https://stackoverflow.com/a/43607255\n */\nexport type SerializableConstructor = {\n // tslint:disable-next-line:no-any\n new (...args: any[]): T; className: string; fromConfig: FromConfigMethod;\n};\nexport type FromConfigMethod =\n (cls: SerializableConstructor, config: ConfigDict) => T;\n\n/**\n * Serializable defines the serialization contract.\n *\n * TFJS requires serializable classes to return their className when asked\n * to avoid issues with minification.\n */\nexport abstract class Serializable {\n /**\n * Return the class name for this class to use in serialization contexts.\n *\n * Generally speaking this will be the same thing that constructor.name\n * would have returned. However, the class name needs to be robust\n * against minification for serialization/deserialazation to work properly.\n *\n * There's also places such as initializers.VarianceScaling, where\n * implementation details between different languages led to different\n * class hierarchies and a non-leaf node is used for serialization purposes.\n */\n getClassName(): string {\n return (this.constructor as SerializableConstructor)\n .className;\n }\n\n /**\n * Return all the non-weight state needed to serialize this object.\n */\n abstract getConfig(): ConfigDict;\n\n /**\n * Creates an instance of T from a ConfigDict.\n *\n * This works for most descendants of serializable. A few need to\n * provide special handling.\n * @param cls A Constructor for the class to instantiate.\n * @param config The Configuration for the object.\n */\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config);\n }\n}\n\n/**\n * Maps string keys to class constructors.\n *\n * Used during (de)serialization from the cross-language JSON format, which\n * requires the class name in the serialization format matches the class\n * names as used in Python, should it exist.\n */\nexport class SerializationMap {\n private static instance: SerializationMap;\n classNameMap: {\n [className: string]:\n [\n SerializableConstructor, FromConfigMethod\n ]\n };\n\n private constructor() {\n this.classNameMap = {};\n }\n\n /**\n * Returns the singleton instance of the map.\n */\n static getMap(): SerializationMap {\n if (SerializationMap.instance == null) {\n SerializationMap.instance = new SerializationMap();\n }\n return SerializationMap.instance;\n }\n\n /**\n * Registers the class as serializable.\n */\n static register(cls: SerializableConstructor) {\n SerializationMap.getMap().classNameMap[cls.className] =\n [cls, cls.fromConfig];\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from './environment';\nimport {Features} from './environment_util';\nimport {Tensor} from './tensor';\nimport {TypedArray} from './types';\nimport * as util from './util';\n\n// TODO(smilkov): Move these constants to jasmine_util.\nexport const WEBGL_ENVS: Features = {\n 'HAS_WEBGL': true\n};\nexport const NODE_ENVS: Features = {\n 'IS_NODE': true\n};\nexport const CHROME_ENVS: Features = {\n 'IS_CHROME': true\n};\nexport const BROWSER_ENVS: Features = {\n 'IS_BROWSER': true\n};\nexport const CPU_ENVS: Features = {\n 'HAS_WEBGL': false\n};\nexport const ALL_ENVS: Features = {};\n\nexport function expectArraysClose(\n actual: Tensor|TypedArray|number[],\n expected: Tensor|TypedArray|number[]|boolean[], epsilon?: number) {\n if (epsilon == null) {\n epsilon = ENV.get('TEST_EPSILON');\n }\n if (!(actual instanceof Tensor) && !(expected instanceof Tensor)) {\n const aType = actual.constructor.name;\n const bType = expected.constructor.name;\n\n if (aType !== bType) {\n throw new Error(\n `Arrays are of different type actual: ${aType} ` +\n `vs expected: ${bType}`);\n }\n } else if (actual instanceof Tensor && expected instanceof Tensor) {\n if (actual.dtype !== expected.dtype) {\n throw new Error(\n `Arrays are of different type actual: ${actual.dtype} ` +\n `vs expected: ${expected.dtype}.`);\n }\n if (!util.arraysEqual(actual.shape, expected.shape)) {\n throw new Error(\n `Arrays are of different shape actual: ${actual.shape} ` +\n `vs expected: ${expected.shape}.`);\n }\n }\n\n let actualValues: TypedArray|number[];\n let expectedValues: TypedArray|number[]|boolean[];\n if (actual instanceof Tensor) {\n actualValues = actual.dataSync();\n } else {\n actualValues = actual;\n }\n if (expected instanceof Tensor) {\n expectedValues = expected.dataSync();\n } else {\n expectedValues = expected;\n }\n\n if (actualValues.length !== expectedValues.length) {\n throw new Error(\n `Arrays have different lengths actual: ${actualValues.length} vs ` +\n `expected: ${expectedValues.length}.\\n` +\n `Actual: ${actualValues}.\\n` +\n `Expected: ${expectedValues}.`);\n }\n for (let i = 0; i < expectedValues.length; ++i) {\n const a = actualValues[i];\n const e = expectedValues[i];\n\n if (!areClose(a, Number(e), epsilon)) {\n throw new Error(\n `Arrays differ: actual[${i}] = ${a}, expected[${i}] = ${e}.\\n` +\n `Actual: ${actualValues}.\\n` +\n `Expected: ${expectedValues}.`);\n }\n }\n}\n\nexport interface DoneFn {\n (): void;\n fail: (message?: Error|string) => void;\n}\n\nexport function expectPromiseToFail(fn: () => Promise<{}>, done: DoneFn): void {\n fn().then(() => done.fail(), () => done());\n}\n\nexport function expectArraysEqual(\n actual: Tensor|TypedArray|number[],\n expected: Tensor|TypedArray|number[]|boolean[]) {\n return expectArraysClose(actual, expected, 0);\n}\n\nexport function expectNumbersClose(a: number, e: number, epsilon?: number) {\n if (epsilon == null) {\n epsilon = ENV.get('TEST_EPSILON');\n }\n if (!areClose(a, e, epsilon)) {\n throw new Error(`Numbers differ: actual === ${a}, expected === ${e}`);\n }\n}\n\nfunction areClose(a: number, e: number, epsilon: number): boolean {\n if (isNaN(a) && isNaN(e)) {\n return true;\n }\n if (isNaN(a) || isNaN(e) || Math.abs(a - e) > epsilon) {\n return false;\n }\n return true;\n}\n\nexport function expectValuesInRange(\n actual: Tensor|TypedArray|number[], low: number, high: number) {\n let actualVals: TypedArray|number[];\n if (actual instanceof Tensor) {\n actualVals = actual.dataSync();\n } else {\n actualVals = actual;\n }\n for (let i = 0; i < actualVals.length; i++) {\n if (actualVals[i] < low || actualVals[i] > high) {\n throw new Error(\n `Value out of range:${actualVals[i]} low: ${low}, high: ${high}`);\n }\n }\n}\n\nexport function expectArrayBuffersEqual(\n actual: ArrayBuffer, expected: ArrayBuffer) {\n // Safari & Jasmine dont like comparing ArrayBuffers directly. Wrapping in\n // a Float32Array solves this issue.\n expect(new Float32Array(actual)).toEqual(new Float32Array(expected));\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '0.12.8';\nexport {version};\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {variableGrads} from '../globals';\nimport {Serializable} from '../serialization';\nimport {Scalar, Variable} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\n\n/** @doc {heading: 'Training', subheading: 'Classes', namespace: 'train'} */\nexport abstract class Optimizer extends Serializable {\n /**\n * Executes `f()` and minimizes the scalar output of `f()` by computing\n * gradients of y with respect to the list of trainable variables provided by\n * `varList`. If no list is provided, it defaults to all trainable variables.\n * @param f The function to execute and whose output to minimize.\n * @param returnCost Whether to return the scalar cost value produced by\n * executing `f()`.\n * @param varList An optional list of variables to update. If specified, only\n * the trainable variables in varList will be updated by minimize. Defaults to\n * all trainable variables.\n */\n /** @doc {heading: 'Training', subheading: 'Optimizers'} */\n minimize(f: () => Scalar, returnCost = false, varList?: Variable[]): Scalar\n |null {\n const {value, grads} = this.computeGradients(f, varList);\n\n this.applyGradients(grads);\n\n // Dispose gradients.\n const varNames = Object.keys(grads);\n varNames.forEach(varName => grads[varName].dispose());\n\n if (returnCost) {\n return value as Scalar;\n } else {\n value.dispose();\n return null;\n }\n }\n\n /**\n * Executes f() and computes the gradient of the scalar output of f() with\n * respect to the list of trainable variables provided by `varList`. If no\n * list is provided, it defaults to all trainable variables.\n * @param f The function to execute and whose output to use for computing\n * gradients with respect to variables.\n * @param varList An optional list of variables to compute gradients with\n * respect to. If specified, only the trainable variables in varList will have\n * gradients computed with respect to. Defaults to all trainable variables.\n */\n computeGradients(f: () => Scalar, varList?: Variable[]):\n {value: Scalar, grads: NamedTensorMap} {\n return variableGrads(f, varList);\n }\n\n /**\n * Updates variables by using the computed gradients.\n * @param variableGradients A mapping of variable name to its gradient value.\n */\n abstract applyGradients(variableGradients: NamedTensorMap): void;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENV} from '../environment';\n\nconst DEFAULT_FLOAT32_EPSILON = 1e-8;\nconst DEFAULT_FLOAT16_EPSILON = 1e-4;\n\nexport function getOptimizerDefaultEpsilonValue() {\n if (ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) {\n return DEFAULT_FLOAT32_EPSILON;\n }\n\n return DEFAULT_FLOAT16_EPSILON;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\n/** @doclink Optimizer */\nexport class AdadeltaOptimizer extends Optimizer {\n static className = 'AdadeltaOptimizer';\n private c: Scalar;\n private epsilonScalar: Scalar;\n private rhoScalar: Scalar;\n private oneMinusRho: Scalar;\n\n private accumulatedGrads: NamedVariableMap = {};\n private accumulatedUpdates: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected rho: number,\n protected epsilon: number = null) {\n super();\n\n this.c = keep(scalar(-learningRate));\n this.rhoScalar = keep(scalar(rho));\n this.oneMinusRho = keep(scalar(1 - rho));\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsilonScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedGrads[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedGrads[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n if (this.accumulatedUpdates[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedUpdates[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n\n const gradient = variableGradients[variableName];\n const accumulatedGrad = this.accumulatedGrads[variableName];\n const accumulatedUpdate = this.accumulatedUpdates[variableName];\n\n tidy(() => {\n const newAccumulatedGrad =\n this.rhoScalar.mul(accumulatedGrad)\n .add(this.oneMinusRho.mul(gradient.square()));\n\n const updates = accumulatedUpdate.add(this.epsilonScalar)\n .sqrt()\n .div(accumulatedGrad.add(this.epsilonScalar).sqrt())\n .mul(gradient);\n\n const newAccumulatedUpdate =\n this.rhoScalar.mul(accumulatedUpdate)\n .add(this.oneMinusRho.mul(updates.square()));\n\n this.accumulatedGrads[variableName].assign(newAccumulatedGrad);\n this.accumulatedUpdates[variableName].assign(newAccumulatedUpdate);\n\n const newValue = this.c.mul(updates).add(value);\n value.assign(newValue);\n });\n }\n }\n\n dispose() {\n this.c.dispose();\n this.epsilonScalar.dispose();\n this.rhoScalar.dispose();\n this.oneMinusRho.dispose();\n if (this.accumulatedUpdates != null) {\n Object.keys(this.accumulatedUpdates)\n .forEach(name => this.accumulatedUpdates[name].dispose());\n Object.keys(this.accumulatedGrads)\n .forEach(name => this.accumulatedGrads[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n rho: this.rho,\n epsilon: this.epsilon\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate, config.rho, config.epsilon);\n }\n}\nSerializationMap.register(AdadeltaOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {fill, scalar} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\n/** @doclink Optimizer */\nexport class AdagradOptimizer extends Optimizer {\n static className = 'AdagradOptimizer';\n private c: Scalar;\n private epsilon: Scalar;\n\n private accumulatedGrads: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, private initialAccumulatorValue = 0.1) {\n super();\n this.c = keep(scalar(-learningRate));\n\n const epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n this.epsilon = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedGrads[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedGrads[variableName] =\n fill(value.shape, this.initialAccumulatorValue)\n .variable(trainable);\n });\n }\n\n const gradient = variableGradients[variableName];\n const accumulatedGrad = this.accumulatedGrads[variableName];\n\n tidy(() => {\n const newAccumulatedGrad = accumulatedGrad.add(gradient.square());\n this.accumulatedGrads[variableName].assign(newAccumulatedGrad);\n\n const newValue =\n this.c\n .mul(gradient.div(newAccumulatedGrad.add(this.epsilon).sqrt()))\n .add(value);\n value.assign(newValue);\n });\n }\n }\n\n dispose() {\n this.epsilon.dispose();\n this.c.dispose();\n if (this.accumulatedGrads != null) {\n Object.keys(this.accumulatedGrads)\n .forEach(name => this.accumulatedGrads[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n initialAccumulatorValue: this.initialAccumulatorValue,\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate, config.initialAccumulatorValue);\n }\n}\nSerializationMap.register(AdagradOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar, Variable} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\nexport class AdamOptimizer extends Optimizer {\n static className = 'AdamOptimizer';\n private c: Scalar;\n private epsScalar: Scalar;\n private beta1Scalar: Scalar;\n private beta2Scalar: Scalar;\n private accBeta1: Variable;\n private accBeta2: Variable;\n private oneMinusBeta1: Scalar;\n private oneMinusBeta2: Scalar;\n private one: Scalar;\n\n private accumulatedFirstMoment: NamedVariableMap = {};\n private accumulatedSecondMoment: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected beta1: number,\n protected beta2: number, protected epsilon: number = null) {\n super();\n this.c = keep(scalar(-learningRate));\n // b1, b2 keep initial value of beta* hyperparameters.\n this.beta1Scalar = keep(scalar(beta1));\n this.beta2Scalar = keep(scalar(beta2));\n tidy(() => {\n // accB* will be updated by batch.\n this.accBeta1 = scalar(beta1).variable();\n this.accBeta2 = scalar(beta2).variable();\n });\n this.oneMinusBeta1 = keep(scalar(1 - beta1));\n this.oneMinusBeta2 = keep(scalar(1 - beta2));\n this.one = keep(scalar(1));\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n tidy(() => {\n const oneMinusAccBeta1 = this.one.sub(this.accBeta1);\n const oneMinusAccBeta2 = this.one.sub(this.accBeta2);\n\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedFirstMoment[variableName] == null) {\n const trainable = false;\n this.accumulatedFirstMoment[variableName] =\n zerosLike(value).variable(trainable);\n }\n if (this.accumulatedSecondMoment[variableName] == null) {\n const trainable = false;\n this.accumulatedSecondMoment[variableName] =\n zerosLike(value).variable(trainable);\n }\n\n const gradient = variableGradients[variableName];\n const firstMoment = this.accumulatedFirstMoment[variableName];\n const secondMoment = this.accumulatedSecondMoment[variableName];\n\n const newFirstMoment = this.beta1Scalar.mul(firstMoment)\n .add(this.oneMinusBeta1.mul(gradient));\n const newSecondMoment =\n this.beta2Scalar.mul(secondMoment)\n .add(this.oneMinusBeta2.mul(gradient.square()));\n\n const biasCorrectedFirstMoment = newFirstMoment.div(oneMinusAccBeta1);\n const biasCorrectedSecondMoment = newSecondMoment.div(oneMinusAccBeta2);\n\n this.accumulatedFirstMoment[variableName].assign(newFirstMoment);\n this.accumulatedSecondMoment[variableName].assign(newSecondMoment);\n\n const newValue =\n this.c\n .mul(biasCorrectedFirstMoment.div(\n this.epsScalar.add(biasCorrectedSecondMoment.sqrt())))\n .add(value);\n value.assign(newValue);\n }\n\n this.accBeta1.assign(this.accBeta1.mul(this.beta1Scalar));\n this.accBeta2.assign(this.accBeta2.mul(this.beta2Scalar));\n });\n }\n\n dispose() {\n this.c.dispose();\n this.epsScalar.dispose();\n this.beta1Scalar.dispose();\n this.beta2Scalar.dispose();\n this.accBeta1.dispose();\n this.accBeta2.dispose();\n this.oneMinusBeta1.dispose();\n this.oneMinusBeta2.dispose();\n this.one.dispose();\n\n if (this.accumulatedFirstMoment != null) {\n Object.keys(this.accumulatedFirstMoment)\n .forEach(name => this.accumulatedFirstMoment[name].dispose());\n }\n\n if (this.accumulatedSecondMoment != null) {\n Object.keys(this.accumulatedSecondMoment)\n .forEach(name => this.accumulatedSecondMoment[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n beta1: this.beta1,\n beta2: this.beta2,\n epsilon: this.epsilon,\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(\n config.learningRate, config.beta1, config.beta2, config.epsilon);\n }\n}\nSerializationMap.register(AdamOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar, Variable} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\nexport class AdamaxOptimizer extends Optimizer {\n static className = 'AdamaxOptimizer';\n private c: Scalar;\n private epsScalar: Scalar;\n private accBeta1: Variable;\n private beta1Scalar: Scalar;\n private beta2Scalar: Scalar;\n private decayScalar: Scalar;\n private oneMinusBeta1: Scalar;\n private one: Scalar;\n private iteration: Variable;\n\n private accumulatedFirstMoment: NamedVariableMap = {};\n private accumulatedWeightedInfNorm: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected beta1: number,\n protected beta2: number, protected epsilon: number = null,\n protected decay = 0.0) {\n super();\n this.c = keep(scalar(-learningRate));\n\n // b1, b2 keep initial value of beta* hyperparameters.\n this.beta1Scalar = keep(scalar(beta1));\n this.beta2Scalar = keep(scalar(beta2));\n\n this.decayScalar = keep(scalar(decay));\n\n tidy(() => {\n this.iteration = scalar(0).variable();\n this.accBeta1 = scalar(beta1).variable();\n });\n\n this.oneMinusBeta1 = keep(scalar(1 - beta1));\n this.one = keep(scalar(1));\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n tidy(() => {\n const oneMinusAccBeta1 = this.one.sub(this.accBeta1);\n const lr = this.c.div(this.one.add(this.decayScalar.mul(this.iteration)));\n\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedFirstMoment[variableName] == null) {\n const trainable = false;\n this.accumulatedFirstMoment[variableName] =\n zerosLike(value).variable(trainable);\n }\n if (this.accumulatedWeightedInfNorm[variableName] == null) {\n const trainable = false;\n this.accumulatedWeightedInfNorm[variableName] =\n zerosLike(value).variable(trainable);\n }\n\n const gradient = variableGradients[variableName];\n const firstMoment = this.accumulatedFirstMoment[variableName];\n const weightedInfNorm = this.accumulatedWeightedInfNorm[variableName];\n\n const newFirstMoment = this.beta1Scalar.mul(firstMoment)\n .add(this.oneMinusBeta1.mul(gradient));\n\n const ut0 = this.beta2Scalar.mul(weightedInfNorm);\n const ut1 = gradient.abs();\n\n const newWeightedInfNorm = ut0.maximum(ut1);\n\n this.accumulatedFirstMoment[variableName].assign(newFirstMoment);\n this.accumulatedWeightedInfNorm[variableName].assign(\n newWeightedInfNorm);\n\n const newValue =\n lr.div(oneMinusAccBeta1)\n .mul(newFirstMoment.div(this.epsScalar.add(newWeightedInfNorm)))\n .add(value);\n\n value.assign(newValue);\n }\n\n this.iteration.assign(this.iteration.add(this.one));\n this.accBeta1.assign(this.accBeta1.mul(this.beta1Scalar));\n });\n }\n\n dispose() {\n this.c.dispose();\n this.epsScalar.dispose();\n this.accBeta1.dispose();\n this.beta1Scalar.dispose();\n this.beta2Scalar.dispose();\n this.oneMinusBeta1.dispose();\n\n this.decayScalar.dispose();\n this.iteration.dispose();\n\n this.one.dispose();\n\n if (this.accumulatedFirstMoment != null) {\n Object.keys(this.accumulatedFirstMoment)\n .forEach(name => this.accumulatedFirstMoment[name].dispose());\n }\n\n if (this.accumulatedWeightedInfNorm != null) {\n Object.keys(this.accumulatedWeightedInfNorm)\n .forEach(name => this.accumulatedWeightedInfNorm[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n beta1: this.beta1,\n beta2: this.beta2,\n epsilon: this.epsilon,\n decay: this.decay\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(\n config.learningRate, config.beta1, config.beta2, config.epsilon,\n config.decay);\n }\n}\nSerializationMap.register(AdamaxOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\n\n/** @doclink Optimizer */\nexport class SGDOptimizer extends Optimizer {\n static className = 'SGDOptimizer';\n protected c: Scalar;\n\n constructor(protected learningRate: number) {\n super();\n this.setLearningRate(learningRate);\n }\n\n applyGradients(variableGradients: NamedTensorMap) {\n const varNames = Object.keys(variableGradients);\n varNames.forEach(varName => {\n const gradient = variableGradients[varName];\n const value = ENV.engine.registeredVariables[varName];\n\n tidy(() => {\n const newValue = this.c.mul(gradient).add(value);\n value.assign(newValue);\n });\n });\n }\n\n /**\n * Sets the learning rate of the optimizer.\n */\n setLearningRate(learningRate: number) {\n this.learningRate = learningRate;\n if (this.c != null) {\n this.c.dispose();\n }\n this.c = keep(scalar(-learningRate));\n }\n\n dispose() {\n this.c.dispose();\n }\n\n getConfig(): ConfigDict {\n return {learningRate: this.learningRate};\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate);\n }\n}\nSerializationMap.register(SGDOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar, Tensor} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {SGDOptimizer} from './sgd_optimizer';\n\n/** @doclink Optimizer */\nexport class MomentumOptimizer extends SGDOptimizer {\n static className = 'MomentumOptimizer';\n private m: Scalar;\n private accumulations: NamedVariableMap;\n\n constructor(\n protected learningRate: number, private momentum: number,\n private useNesterov = false) {\n super(learningRate);\n this.m = scalar(this.momentum);\n this.accumulations = {};\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulations[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulations[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n\n const accumulation = this.accumulations[variableName];\n const gradient = variableGradients[variableName];\n\n tidy(() => {\n let newValue: Tensor;\n const newAccumulation = this.m.mul(accumulation).add(gradient);\n if (this.useNesterov) {\n newValue =\n this.c.mul(gradient.add(newAccumulation.mul(this.m))).add(value);\n } else {\n newValue = this.c.mul(newAccumulation).add(value);\n }\n this.accumulations[variableName].assign(newAccumulation);\n value.assign(newValue);\n });\n }\n }\n\n dispose() {\n super.dispose();\n this.m.dispose();\n if (this.accumulations != null) {\n for (const variableName in this.accumulations) {\n this.accumulations[variableName].dispose();\n }\n }\n }\n\n /**\n * Sets the momentum of the optimizer.\n *\n * @param momentum\n */\n setMomentum(momentum: number) {\n this.momentum = momentum;\n }\n\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n momentum: this.momentum,\n useNesterov: this.useNesterov\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate, config.momentum, config.useNesterov);\n }\n}\nSerializationMap.register(MomentumOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\n/** @doclink Optimizer */\nexport class RMSPropOptimizer extends Optimizer {\n static className = 'RMSPropOptimizer';\n private c: Scalar;\n private epsilonScalar: Scalar;\n private decayScalar: Scalar;\n private momentumScalar: Scalar;\n private oneMinusDecay: Scalar;\n private centered: boolean;\n\n private accumulatedMeanSquares: NamedVariableMap = {};\n private accumulatedMeanGrads: NamedVariableMap = {};\n private accumulatedMoments: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected decay = 0.9,\n protected momentum = 0.0, protected epsilon: number = null,\n centered = false) {\n super();\n\n this.c = keep(scalar(learningRate));\n this.decayScalar = keep(scalar(decay));\n this.momentumScalar = keep(scalar(momentum));\n this.oneMinusDecay = keep(scalar(1 - decay));\n this.centered = centered;\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsilonScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedMeanSquares[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedMeanSquares[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n if (this.accumulatedMeanGrads[variableName] == null && this.centered) {\n const trainable = false;\n tidy(() => {\n this.accumulatedMeanGrads[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n if (this.accumulatedMoments[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedMoments[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n\n const accumulatedMeanSquare = this.accumulatedMeanSquares[variableName];\n const accumulatedMeanGrad = this.accumulatedMeanGrads[variableName];\n const accumulatedMoments = this.accumulatedMoments[variableName];\n const gradient = variableGradients[variableName];\n\n tidy(() => {\n const newAccumulatedMeanSquare =\n this.decayScalar.mul(accumulatedMeanSquare)\n .add(this.oneMinusDecay.mul(gradient.square()));\n\n if (this.centered) {\n // Centered gradient\n const newAccumulatedMeanGrad =\n this.decayScalar.mul(accumulatedMeanGrad)\n .add(this.oneMinusDecay.mul(gradient));\n\n const newAccumulatedMoments =\n this.momentumScalar.mul(accumulatedMoments)\n .add(this.c.mul(gradient).div(\n newAccumulatedMeanSquare\n .sub(newAccumulatedMeanGrad.square().add(\n this.epsilonScalar))\n .sqrt()));\n\n this.accumulatedMeanSquares[variableName].assign(\n newAccumulatedMeanSquare);\n this.accumulatedMeanGrads[variableName].assign(\n newAccumulatedMeanGrad);\n this.accumulatedMoments[variableName].assign(newAccumulatedMoments);\n\n const newValue = value.sub(newAccumulatedMoments);\n value.assign(newValue);\n } else {\n // Plain gradient\n const newAccumulatedMeanSquare =\n this.decayScalar.mul(accumulatedMeanSquare)\n .add(this.oneMinusDecay.mul(gradient.square()));\n\n const newAccumulatedMoments =\n this.momentumScalar.mul(accumulatedMoments)\n .add(this.c.mul(gradient).div(\n newAccumulatedMeanSquare.add(this.epsilonScalar).sqrt()));\n\n this.accumulatedMeanSquares[variableName].assign(\n newAccumulatedMeanSquare);\n this.accumulatedMoments[variableName].assign(newAccumulatedMoments);\n\n const newValue = value.sub(newAccumulatedMoments);\n value.assign(newValue);\n }\n });\n }\n }\n\n dispose() {\n this.c.dispose();\n this.epsilonScalar.dispose();\n this.decayScalar.dispose();\n this.momentumScalar.dispose();\n this.oneMinusDecay.dispose();\n if (this.accumulatedMeanSquares != null) {\n Object.keys(this.accumulatedMeanSquares)\n .forEach(name => this.accumulatedMeanSquares[name].dispose());\n }\n if (this.accumulatedMeanGrads != null && this.centered) {\n Object.keys(this.accumulatedMeanGrads)\n .forEach(name => this.accumulatedMeanGrads[name].dispose());\n }\n if (this.accumulatedMoments != null) {\n Object.keys(this.accumulatedMoments)\n .forEach(name => this.accumulatedMoments[name].dispose());\n }\n }\n\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n decay: this.decay,\n momentum: this.momentum,\n epsilon: this.epsilon,\n centered: this.centered\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(\n config.learningRate, config.decay, config.momentum, config.epsilon,\n config.centered);\n }\n}\nSerializationMap.register(RMSPropOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {AdadeltaOptimizer} from './adadelta_optimizer';\nimport {AdagradOptimizer} from './adagrad_optimizer';\nimport {AdamOptimizer} from './adam_optimizer';\nimport {AdamaxOptimizer} from './adamax_optimizer';\nimport {MomentumOptimizer} from './momentum_optimizer';\nimport {RMSPropOptimizer} from './rmsprop_optimizer';\nimport {SGDOptimizer} from './sgd_optimizer';\n\nexport class OptimizerConstructors {\n /**\n * Constructs a `SGDOptimizer` that uses stochastic gradient descent.\n *\n * ```js\n * // Fit a quadratic function by learning the coefficients a, b, c.\n * const xs = tf.tensor1d([0, 1, 2, 3]);\n * const ys = tf.tensor1d([1.1, 5.9, 16.8, 33.9]);\n *\n * const a = tf.scalar(Math.random()).variable();\n * const b = tf.scalar(Math.random()).variable();\n * const c = tf.scalar(Math.random()).variable();\n *\n * // y = a * x^2 + b * x + c.\n * const f = x => a.mul(x.square()).add(b.mul(x)).add(c);\n * const loss = (pred, label) => pred.sub(label).square().mean();\n *\n * const learningRate = 0.01;\n * const optimizer = tf.train.sgd(learningRate);\n *\n * // Train the model.\n * for (let i = 0; i < 10; i++) {\n * optimizer.minimize(() => loss(f(xs), ys));\n * }\n *\n * // Make predictions.\n * console.log(\n * `a: ${a.dataSync()}, b: ${b.dataSync()}, c: ${c.dataSync()}`);\n * const preds = f(xs).dataSync();\n * preds.forEach((pred, i) => {\n * console.log(`x: ${i}, pred: ${pred}`);\n * });\n * ```\n *\n * @param learningRate The learning rate to use for the SGD algorithm.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static sgd(learningRate: number): SGDOptimizer {\n return new SGDOptimizer(learningRate);\n }\n\n /**\n * Constructs a `MomentumOptimizer` that uses momentum gradient\n * descent.\n *\n * See\n * [http://proceedings.mlr.press/v28/sutskever13.pdf](\n * http://proceedings.mlr.press/v28/sutskever13.pdf)\n *\n * @param learningRate The learning rate to use for the Momentum gradient\n * descent algorithm.\n * @param momentum The momentum to use for the momentum gradient descent\n * algorithm.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static momentum(learningRate: number, momentum: number, useNesterov = false):\n MomentumOptimizer {\n return new MomentumOptimizer(learningRate, momentum, useNesterov);\n }\n\n /**\n * Constructs a `RMSPropOptimizer` that uses RMSProp gradient\n * descent. This implementation uses plain momentum and is not centered\n * version of RMSProp.\n *\n * See\n * [http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf](\n * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf)\n *\n * @param learningRate The learning rate to use for the RMSProp gradient\n * descent algorithm.\n * @param decay The discounting factor for the history/coming gradient.\n * @param momentum The momentum to use for the RMSProp gradient descent\n * algorithm.\n * @param epsilon Small value to avoid zero denominator.\n * @param centered If true, gradients are normalized by the estimated\n * variance of the gradient.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static rmsprop(\n learningRate: number, decay = .9, momentum = 0.0, epsilon: number = null,\n centered = false): RMSPropOptimizer {\n return new RMSPropOptimizer(\n learningRate, decay, momentum, epsilon, centered);\n }\n\n /**\n * Constructs a `AdamOptimizer` that uses the Adam algorithm.\n * See [https://arxiv.org/abs/1412.6980](https://arxiv.org/abs/1412.6980)\n *\n * @param learningRate The learning rate to use for the Adam gradient\n * descent algorithm.\n * @param beta1 The exponential decay rate for the 1st moment estimates.\n * @param beta2 The exponential decay rate for the 2nd moment estimates.\n * @param epsilon A small constant for numerical stability.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adam(\n learningRate = 0.001, beta1 = 0.9, beta2 = 0.999,\n epsilon: number = null): AdamOptimizer {\n return new AdamOptimizer(learningRate, beta1, beta2, epsilon);\n }\n\n /**\n * Constructs a `AdadeltaOptimizer` that uses the Adadelta algorithm.\n * See [https://arxiv.org/abs/1212.5701](https://arxiv.org/abs/1212.5701)\n *\n * @param learningRate The learning rate to use for the Adadelta gradient\n * descent algorithm.\n * @param rho The learning rate decay over each update.\n * @param epsilon A constant epsilon used to better condition the grad\n * update.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adadelta(learningRate = .001, rho = .95, epsilon: number = null):\n AdadeltaOptimizer {\n return new AdadeltaOptimizer(learningRate, rho, epsilon);\n }\n\n /**\n * Constructs a `AdamaxOptimizer` that uses the Adamax algorithm.\n * See [https://arxiv.org/abs/1412.6980](https://arxiv.org/abs/1412.6980)\n *\n * @param learningRate The learning rate to use for the Adamax gradient\n * descent algorithm.\n * @param beta1 The exponential decay rate for the 1st moment estimates.\n * @param beta2 The exponential decay rate for the 2nd moment estimates.\n * @param epsilon A small constant for numerical stability.\n * @param decay The learning rate decay over each update.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adamax(\n learningRate = 0.002, beta1 = 0.9, beta2 = 0.999, epsilon: number = null,\n decay = 0.0): AdamaxOptimizer {\n return new AdamaxOptimizer(learningRate, beta1, beta2, epsilon, decay);\n }\n\n /**\n * Constructs a `AdagradOptimizer` that uses the Adagrad algorithm.\n * See\n * [http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf](\n * http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf)\n * or\n * [http://ruder.io/optimizing-gradient-descent/index.html#adagrad](\n * http://ruder.io/optimizing-gradient-descent/index.html#adagrad)\n *\n * @param learningRate The learning rate to use for the Adagrad gradient\n * descent algorithm.\n * @param initialAccumulatorValue Starting value for the accumulators, must be\n * positive.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adagrad(learningRate: number, initialAccumulatorValue = 0.1):\n AdagradOptimizer {\n return new AdagradOptimizer(learningRate, initialAccumulatorValue);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// So typings can propagate.\nimport {AdadeltaOptimizer} from './optimizers/adadelta_optimizer';\nimport {AdagradOptimizer} from './optimizers/adagrad_optimizer';\nimport {AdamOptimizer} from './optimizers/adam_optimizer';\nimport {AdamaxOptimizer} from './optimizers/adamax_optimizer';\nimport {MomentumOptimizer} from './optimizers/momentum_optimizer';\nimport {OptimizerConstructors} from './optimizers/optimizer_constructors';\nimport {RMSPropOptimizer} from './optimizers/rmsprop_optimizer';\nimport {SGDOptimizer} from './optimizers/sgd_optimizer';\n\n// tslint:disable-next-line:no-unused-expression\n[MomentumOptimizer, SGDOptimizer, AdadeltaOptimizer, AdagradOptimizer,\n RMSPropOptimizer, AdamaxOptimizer, AdamOptimizer];\n\nexport const train = {\n sgd: OptimizerConstructors.sgd,\n momentum: OptimizerConstructors.momentum,\n adadelta: OptimizerConstructors.adadelta,\n adagrad: OptimizerConstructors.adagrad,\n rmsprop: OptimizerConstructors.rmsprop,\n adamax: OptimizerConstructors.adamax,\n adam: OptimizerConstructors.adam\n};\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// backend_cpu.ts and backend_webgl.ts are standalone files and should be\n// explicily included here. Below, there is an export from backend_webgl, but\n// that doesn't count since it's exporting a Typescript interface.\nimport './kernels/backend_webgl';\nimport './kernels/backend_cpu';\n\nimport {nextFrame} from './browser_util';\nimport * as environment from './environment';\nimport {Environment} from './environment';\n\n// Serialization.\nimport * as io from './io/io';\nimport * as serialization from './serialization';\nimport {setOpHandler} from './tensor';\nimport * as test_util from './test_util';\nimport * as util from './util';\nimport {version} from './version';\nimport * as webgl from './webgl';\n\nexport {InferenceModel, ModelPredictConfig} from './model_types';\n\n// Optimizers.\nexport {AdadeltaOptimizer} from './optimizers/adadelta_optimizer';\nexport {AdagradOptimizer} from './optimizers/adagrad_optimizer';\nexport {AdamOptimizer} from './optimizers/adam_optimizer';\nexport {AdamaxOptimizer} from './optimizers/adamax_optimizer';\nexport {MomentumOptimizer} from './optimizers/momentum_optimizer';\nexport {Optimizer} from './optimizers/optimizer';\nexport {RMSPropOptimizer} from './optimizers/rmsprop_optimizer';\nexport {SGDOptimizer} from './optimizers/sgd_optimizer';\nexport {Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorBuffer, variable, Variable} from './tensor';\nexport {NamedTensorMap} from './tensor_types';\nexport {DataType, Rank, ShapeMap} from './types';\n\nexport * from './ops/ops';\nexport {LSTMCellFunc} from './ops/lstm';\nexport {Reduction} from './ops/loss_ops';\n\nexport * from './train';\nexport * from './globals';\n\nexport {Features} from './environment_util';\nexport {TimingInfo} from './engine';\nexport {ENV, Environment} from './environment';\n\nexport const setBackend = Environment.setBackend;\nexport const getBackend = Environment.getBackend;\nexport const disposeVariables = Environment.disposeVariables;\nexport const memory = Environment.memory;\nexport {version as version_core};\n\nexport {nextFrame};\n\n// Second level exports.\nexport {environment, io, serialization, test_util, util, webgl};\n\n// Backend specific.\nexport {KernelBackend, BackendTimingInfo} from './kernels/backend';\n\nimport * as ops from './ops/ops';\nsetOpHandler(ops);\n"],"names":["a","navigator","userAgent","vendor","window","opera","test","substr","array","counter","length","temp","index","Math","random","min","x","max","b","result","i","diff","Number","expr","msg","Error","shapeA","shapeB","errorMessagePrefix","assert","arraysEqual","arr","ret","Array","isArray","flatten","push","val","firstElem","isTypedArray","shape","deepAssertShapeConsistency","indices","join","subShape","slice","concat","size","n1","n2","tanh","Infinity","e2x","exp","floor","sqrt","n","shuffledIndices","Uint32Array","shuffle","repeat","checkFn","delayFn","maxCounter","Promise","resolve","reject","tryCount","tryFn","nextBackoff","setTimeout","shapeProd","implicitIdx","newShape","axis","keptDims","j","dtype","values","Float32Array","Int32Array","Uint8Array","vals","name","isNaN","oldType","newType","debugMode","checkConversionForNaN","bool","round","f","constructor","call","apply","start","rank","strides","noConversionNeeded","copyTypedArray","makeZerosTypedArray","performance","now","process","time","hrtime","backendTimer","logger","this","Logger","Profiler","timer","forEach","r","dataSync","util.checkComputationForNaN","then","timing","_this","logKernelProfile","kernelMs","timeMs","util.rightPad","paddedName","toString","console","log","tape","xs","y","tensorsFromX","nodesFromX","id","nodeInputs","node","inputs","inputName","input","anyInputFromX","output","tensorsLeadToY","nodesToY","outputs","filteredTape","prunedInputs","nodeInput","prunedNode","Object","assign","tensorAccumulatedGradientMap","dy","gradient","inputGradients","keys","dx","util.arraysEqual","curGradient","add","dispose","FORMAT_LIMIT_NUM_VALS","FORMAT_NUM_FIRST_LAST_VALS","FORMAT_NUM_SIG_DIGITS","verbose","computeStrides","padPerCol","computeMaxSizePerColumn","valsLines","subTensorToString","lines","map","l","sizeFromShape","numCols","fill","row","offset","valToString","pad","rightPad","parseFloat","toFixed","isLast","firstVals","from","subarray","lastVals","subshape","substrides","stride","end","sep","newLineSep","util.sizeFromShape","util.assert","util.getTypedArrayFromDType","TensorBuffer","value","_i","locs","locToIndex","Tensor","make","trackerFn","opHandler","fn","handler","dataId","nextId","rankType","registerTensor","write","data","throwIfDisposed","as1D","reshape","rows","columns","depth","depth2","cast","buffer","read","readSync","isDisposed","disposeTensor","isDisposedInternal","asType","print","expandDims","exclusive","reverse","cumsum","squeeze","clone","tensorToString","reps","tile","gather","transposeA","transposeB","matMul","dot","ord","keepDims","norm","begin","stack","unstack","paddings","constantValue","mean","variance","varianceEpsilon","scale","batchNormalization","all","any","logSumExp","sum","argMin","argMax","addStrict","sub","subStrict","pow","powStrict","mul","mulStrict","div","floorDiv","divStrict","minimum","minimumStrict","maximum","maximumStrict","mod","modStrict","squaredDifference","squaredDifferenceStrict","perm","transpose","notEqual","notEqualStrict","less","lessStrict","equal","equalStrict","lessEqual","lessEqualStrict","greater","greaterStrict","greaterEqual","greaterEqualStrict","logicalAnd","logicalOr","logicalNot","logicalXor","condition","where","neg","ceil","sign","expm1","log1p","rsqrt","square","reciprocal","abs","clipByValue","relu","elu","selu","alpha","leakyRelu","prelu","sigmoid","logSigmoid","softplus","sin","cos","tan","asin","acos","atan","sinh","cosh","asinh","acosh","atanh","erf","step","dim","softmax","newShape2D","alignCorners","image","resizeBilinear","resizeNearestNeighbor","filter","dataFormat","dilation","dimRoundingMode","conv1d","dilations","conv2d","outputShape","conv2dTranspose","depthwiseConv2d","filterSize","avgPool","maxPool","radius","bias","beta","localResponseNormalization","trainable","Variable","variable","segmentIds","numSegments","unsortedSegmentSum","blockShape","crops","batchToSpaceND","spaceToBatchND","defineProperty","Symbol","hasInstance","instance","initialValue","_super","nextVarId","registerVariable","ex","tslib_1.__extends","newValue","Function","tensor","tensorList","list","walkTensorContainer","Set","container","seen","isIterable","iterable","k","has","obj","Type","backend","safeMode","WeakMap","activeScope","track","scopeStack","profiler","Engine","nameOrFn","gradMode","String","scopedRun","startScope","endScope","error","res","forwardFunc","backwardsFunc","saved","saveFunc","scopeName","customGradientDepth","profileKernel","shouldRecord","tapeNode","nextTapeNodeId","activeTape","refCount","refCounter","get","numTensors","numDataBuffers","numBytes","util.bytesPerElement","register","set","v","registeredVariables","keepTensors","delete","disposeData","varName","info","memory","gradientsFunc","inputsMap","idx","resMap","gradientsMode","gradientScopeCount","scopeInfo","tensorsToKeep","tensorsToTrackInParent","getTensorsInContainer","oldScope","pop","isTensorInList","allowNoGradients","tidy","getFilteredNodesXToY","accumulatedGradientMap","ones","backpropagateGradients","grads","util.isFunction","every","t","_a","gradFunc","addTapeNode","pixels","numChannels","fromPixels","query","timingInfo","wallMs","makeOnesTypedArray","URL_PROPERTIES","type","BOOLEAN","NUMBER","STRING","webGLVersion","isBrowser","gl","getWebGLRenderingContext","e","loseContext","queryTimerVersion","hasExtension","createFloatTextureAndBindToFramebuffer","isFrameBufferComplete","checkFramebufferStatus","FRAMEBUFFER","FRAMEBUFFER_COMPLETE","readPixels","RGBA","FLOAT","readPixelsNoError","getError","NO_ERROR","isEnabled","fenceSync","TENSORFLOWJS_FLAGS_PREFIX","features","location","urlParams","getQueryParams","search","urlFlags_1","split","keyValue","key","urlProperty","warn","extensionName","getExtension","tempCanvas","document","createElement","getContext","loseContextExtension","frameBuffer","createFramebuffer","texture","createTexture","bindTexture","TEXTURE_2D","internalFormat","RGBA32F","texImage2D","bindFramebuffer","framebufferTexture2D","COLOR_ATTACHMENT0","queryString","params","replace","s","decodeParam","decodeURIComponent","TEST_EPSILON_FLOAT32_ENABLED","TEST_EPSILON_FLOAT32_DISABLED","Environment","backendName","ENV","registry","initBackend","initDefaultBackend","engine","disposeVariables","keep","feature","evaluateFeature","entry","sort","priority","versions","isChrome","getBestBackendName","getWebGLDisjointQueryTimerVersion","device_util.isMobile","isWebGLVersionEnabled","isRenderToFloatTextureEnabled","isDownloadFloatTextureEnabled","isWebGLFenceEnabled","getFeaturesFromURL","globalEngine","findBackend","factory","setTensorTrackerFn","err","message","ns","getGlobalNamespace","setTensorTracker","getOrMakeEnvironment","inputShape","prod","batchToSpace","reshaped","spatialLength","reshapedRank","blockShapeRank","permuted","permutedBeforeBatch","permutedAfterBatch","reshapedPermuted","sliceBeginCoords","uncroppedShape","sliceSize","axes","outputLoc","reduceLoc","loc","outIdx","reduceIdx","indexOf","aShape","outShape","combineLocations","ax","util.isInt","axesAreInnerMostDims","numAxes","PARALLELIZE_THRESHOLD","inSize","nearestDivisor","done","beginMask","endMask","startIndex","endIndex","startForAxis","stopForAxis","d","count","startIndices","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","axisSize","util.clamp","stopIndices","stop","util.assertShapesMatch","checkGrads","args","arg","grad","gradients","varList","originalVarCount","some","g","namedGrads","customGrad","argName","functionName","inferredShape","inferShape","toTypedArray","convertToTensor","opName","endsWith","substring","f2","configurable","logits","$logits","lse","toFloat","dyTimesY","customOp","op","softmax_","assertShapesMatch","assertNonNull","getTypedArrayFromDType","$x","zeros","num","tensor1d","DType","Rank","UpcastInt32AndMap","UpcastBoolAndMap","UpcastFloat32AndMap","onesLike","onesLike_","zerosLike","zerosLike_","upcastTypeMap","float32","int32","typeA","typeB","upcastType","hasEncodingLoss","int","scalar","boxes","scores","maxOutputSize","iouThreshold","scoreThreshold","candidates","score","boxIndex","c","c1","c2","selected","ignoreCandidate","intersectionOverUnion","iCoord","jCoord","yminI","xminI","ymaxI","xmaxI","yminJ","xminJ","ymaxJ","xmaxJ","areaI","areaJ","intersectionYmin","intersectionXmin","intersectionYmax","intersectionXmax","intersectionArea","xShape","xDtype","sorted","lastDim","batch","allTopKVals","allTopKIndices","valAndInd","outOffset","topKVals","topKIndices","reduceInfo","firstPass","windowSize","batchSize","outSize","variableNames","compOp","indexSnippet","userCode","convInfo","inShape","filterHeight","filterWidth","strideHeight","strideWidth","padTop","padInfo","top","padLeft","left","avgMultiplier","outHeight","outWidth","inRank","dims","unshift","inDim","outAxis","outDim","errMsg","meanShape","varianceShape","offsetShape","scaleShape","broadcast_util.assertAndGetBroadcastShape","offsetSnippet","scaleSnippet","CHECK_NAN_SNIPPET","ADD","SUB","MUL","DIV","INT_DIV","POW","SQUARED_DIFFERENCE","EQUAL","NOT_EQUAL","LESS","LESS_EQUAL","GREATER","GREATER_EQUAL","LOGICAL_AND","LOGICAL_OR","MAX","MIN","MOD","ATAN2","ELU_DER","bShape","BinaryOpProgram","gpgpu","webGLProgram","startLoc","getUniformLocationNoThrow","uniform1f","NaN","minFixed","maxFixed","aRank","bRank","x1Shape","x2Shape","aBegin","aSize","bBegin","bSize","concat_util.computeOutShape","filterShape","inHeight","inWidth","outChannels","channelMul","inChannels","dilationHeight","dilationWidth","inputDepthNearestVec4","inputDepthVec4Remainder","xNumRows","xNumCols","inputsInfo","broadcast","inputPrefixSnippet","shapeInfo","logicalShape","isUniform","inputSamplingSnippet","getInputSamplingSnippet","outTexShape","texShape","outputSamplingSnippet","getOutputSamplingSnippet","SHADER_PREFIX","FLOAT_TEXTURE_SAMPLE_SNIPPET","FLOAT_TEXTURE_SETOUTPUT_SNIPPET","inInfo","getSamplerScalar","getSampler1D","getSampler2D","getSampler3D","getSampler4D","getSampler5D","getSampler6D","outShapeInfo","getSamplerFlat","getSamplerFromInInfo","getSamplerAtOutputCoords","getOutputScalarCoords","getOutput1DCoords","getOutput2DCoords","getOutput3DCoords","getOutput4DCoords","getOutput5DCoords","getOutput6DCoords","SAMPLE_1D_SNIPPET","SAMPLE_2D_SNIPPET","SAMPLE_3D_SNIPPET","SAMPLE_4D_SNIPPET","SAMPLE_5D_SNIPPET","SAMPLE_6D_SNIPPET","stride0","stride1","stride2","stride3","stride4","inputInfo","texName","funcName","charAt","toUpperCase","texNumR_1","squeezedShape","squeezeInputInfo","getSqueezedParams","texNumR","texNumC","tNumR","tNumC","texFuncSnippet","outRank","broadcastDims","broadcast_util.getBroadcastDims","rankDiff","supportsBroadcasting","doBroadcast","broadcastOverOuter","broadcast_util.broadcastDimsAreOuter","getBroadcastOutputCoordsSampler","broadcastSnippet","inTexShape","newInputInfo","JSON","parse","stringify","finalDim","comparator","getCoordsDataType","getFinalCoord","getCoords","TextureUsage","PhysicalTextureType","height","width","indicesLength","sourceCoords","getSourceCoords","currentCoords","matrixSize","channelsPerTexture","unpackedSize","matrix","unpackedArray","requiredSize","getUnpackedArraySizeFromMatrixSize","dst","src","getMatrixSizeFromUnpackedArraySize","packedRGBA","getPackedRGBAArraySizeFromMatrixShape","textureWidth","textureHeight","oddWidth","oddHeight","widthInFullBlocks","heightInFullBlocks","dstStride","oneRow","blockY","matrixSrcRow","blockX","srcStride","dstRow1","dstRow2","MAX_TEXTURE_SIZE","attributes","canvas","createWebGLRenderingContextFromCanvas","webglVersion","func","returnValue","checkWebGLError","webGLDebugErrorCheckingEnabled","enabled","getWebGLErrorMessage","status","INVALID_ENUM","INVALID_VALUE","INVALID_OPERATION","INVALID_FRAMEBUFFER_OPERATION","OUT_OF_MEMORY","CONTEXT_LOST_WEBGL","throwIfNull","vertexShaderSource","vertexShader","createShader","VERTEX_SHADER","callAndCheck","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","fragmentShaderSource","fragmentShader","FRAGMENT_SHADER","logShaderSourceAndInfoLog","lineNumberRegex","shaderInfoLog","lineNumberRegexResult","exec","lineNumber","shaderLines","linesWithLineNumbers","line","maxLineLength","beforeErrorLines","errorLine","afterErrorLines","createProgram","program","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","validateProgram","VALIDATE_STATUS","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","ELEMENT_ARRAY_BUFFER","getParameter","maxTextureSize","queryMaxTextureSize","requested","attribute","arrayEntriesPerItem","itemStrideInBytes","itemOffsetInBytes","getAttribLocation","vertexAttribPointer","enableVertexAttribArray","textureUnit","validateTextureUnit","activeTexture","TEXTURE0","uniformName","getUniformLocation","uniformSamplerLocation","bindTextureUnit","uniform1i","viewport","scissor","framebuffer","getFramebufferErrorMessage","FRAMEBUFFER_INCOMPLETE_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_DIMENSIONS","FRAMEBUFFER_UNSUPPORTED","returnTOrNull","failureMessage","tOrNull","maxTextureUnit","MAX_COMBINED_TEXTURE_IMAGE_UNITS","glTextureUnit","logShape","util.squeezeShape","maxTexSize","util.sizeToSquarishShape","antialias","premultipliedAlpha","preserveDrawingBuffer","stencil","failIfMajorPerformanceCaveat","getWebGLContextAttributes","webgl_util.callAndCheck","webgl_util.createWebGLRenderingContextFromCanvas","webgl_util.createWebGLRenderingContext","disable","DEPTH_TEST","STENCIL_TEST","BLEND","DITHER","POLYGON_OFFSET_FILL","SAMPLE_COVERAGE","enable","SCISSOR_TEST","CULL_FACE","cullFace","BACK","webgl_util.createVertexShader","webgl_util.createStaticVertexBuffer","webgl_util.createStaticIndexBuffer","Uint16Array","textureHalfFloatExtension","internalFormatFloat","internalFormatHalfFloat","internalFormatPackedFloat","textureFormatFloat","downloadUnpackNumChannels","defaultNumChannels","textureTypeHalfFloat","glany","R32F","R16F","RED","HALF_FLOAT","HALF_FLOAT_OES","downloadTextureFormat","textureFormat","textureType","webgl_util.validateTextureSize","webgl_util.createTexture","tex2d","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","textureConfig","createAndConfigureTexture","UNSIGNED_BYTE","vertexBuffer","webgl_util.bindVertexBufferToProgramAttribute","texSubImage2D","w","h","tex_util.encodeMatrixToUnpackedArray","tex_util.getUnpackedArraySizeFromMatrixSize","uploadDataToTexture","tex_util.getPackedRGBAArraySizeFromMatrixShape","tex_util.encodeMatrixToPackedRGBA","bufferOrTexture","gl2_1","buffer_1","PIXEL_PACK_BUFFER","bufferSizeBytes_1","gl2","downloadTarget","getBufferSubData","tex_util.decodeMatrixFromUnpackedArray","tex_util.decodeMatrixFromPackedRGBA","gpgpu_util.createWebGLContext","textureFloatExtension","webgl_util.getExtensionOrThrow","colorBufferFloatExtension","colorBufferHalfFloatExtension","gpgpu_util.createVertexBuffer","indexBuffer","gpgpu_util.createIndexBuffer","webgl_util.createFramebuffer","gpgpu_util.getTextureConfig","GPGPUContext","disposed","outputTexture","finish","deleteFramebuffer","deleteBuffer","autoDebugValidate","webgl_util.enableDebugWebGLErrorChecking","gpgpu_util.createFloat32MatrixTexture","gpgpu_util.createFloat16MatrixTexture","gpgpu_util.createUnsignedBytesMatrixTexture","gpgpu_util.uploadPixelDataToTexture","gpgpu_util.createPackedMatrixTexture","webgl_util.unbindColorTextureFromFramebuffer","deleteTexture","webgl_util.getNumChannels","gpgpu_util.uploadMatrixToTexture","gpgpu_util.uploadMatrixToPackedTexture","downloadMatrixDriver","gpgpu_util.downloadFloat32MatrixFromOutputTexture","gpgpu_util.downloadByteEncodedFloatMatrixFromOutputTexture","gpgpu_util.downloadFloat32MatrixFromBuffer","bindTextureToFrameBuffer","gpgpu_util.maybeCreateBufferFromOutputTexture","unbindTextureToFrameBuffer","fenceContext","createFence","pollFence","isFencePassed","sync_1","SYNC_GPU_COMMANDS_COMPLETE","flush","clientWaitSync","ALREADY_SIGNALED","CONDITION_SATISFIED","beginQuery","endQuery","isQueryAvailable","gpgpu_util.downloadMatrixFromPackedOutputTexture","webgl_util.createFragmentShader","gpgpu_util.createVertexShader","webgl_util.createProgram","attachShader","webgl_util.linkProgram","webgl_util.validateProgram","vertexAttrsAreBound","setProgram","gpgpu_util.bindVertexProgramAttributeStreams","deleteProgram","useProgram","shouldThrow","webgl_util.getProgramUniformLocationOrThrow","webgl_util.getProgramUniformLocation","inputMatrixTexture","uniformLocation","throwIfNoProgram","webgl_util.bindTextureToProgramUniformSampler","outputMatrixTexture","setOutputMatrixTextureDriver","outputPackedMatrixTexture","startRow","numRows","startColumn","numColumns","setOutputMatrixWriteRegionDriver","webgl_util.validateFramebuffer","debugValidate","drawElements","TRIANGLES","UNSIGNED_SHORT","disjointQueryTimerExtension","getQueryTimerExtension","ext_1","getQueryTimerExtensionWebGL2","query_1","createQuery","TIME_ELAPSED_EXT","ext","getQueryTimerExtensionWebGL1","createQueryEXT","beginQueryEXT","endQueryEXT","ext_2","util.repeatedTry","getQueryTime","getQueryParameter","QUERY_RESULT","getQueryObjectEXT","QUERY_RESULT_EXT","available","QUERY_RESULT_AVAILABLE","disjoint","GPU_DISJOINT_EXT","QUERY_RESULT_AVAILABLE_EXT","addItemToPoll","binSearchLastTrue","itemsToPoll","isDoneFn","resolveFn","pollItems","webgl_util.bindColorTextureToFramebuffer","downloadAndDecode","outputMatrixTextureMaybePacked","best","mid","inputInfos","texData","inShapeInfos","source","shader_compiler.makeShader","uniformLocations","shapeInfos","texShapeA","texShapeB","binary","customSetup","validateBinaryAndProgram","outTex","setOutputMatrixTexture","variableName","variableUniformLocation","uniform1fv","tex","setInputMatrixTexture","executeProgram","keyInputs","keyUserCode","keyBroadcast","powOperator","rad","maxD","basis","depthRadius","lastIndex","outerShapeA","outerShapeB","sharedDim","aSnippetFromOffset","vec4Offset","indexVar","bSnippetFromOffset","sharedDimNearestVec4","sharedDimVec4Remainder","numOutcomes","numSamples","MultinomialProgram","seed","seedLoc","numIndices","onValue","offValue","p","unpackedCoords","poolType","computePositions","isAvgPool","initializationValue","filterWidthNearestVec4","filterWidthVec4Remainder","updateSnippet","reduceType","compareOp","windowSizeNearestVec4","windowSizeVec4Remainder","vecType","checkOutOfBounds","xHeight","xWidth","_b","yHeight","yWidth","effectiveXSize","effectiveYSize","heightScale","widthScale","invHeightScale","invWidthScale","winHeight","winWidth","newHeight","newWidth","oldHeight","oldWidth","effectiveInSize","effectiveOutSize","roundBase","inCoords","_","getInCoord","segOpInfo","segOpType","checkValueOutOfBounds","checkSegmentIdOutOfBounds","cRank","cCoords","abCoords","cCoordVars","abCoordVars","destSize","SliceProgram","uniform2i","uniform3i","uniform4i","newCoords","TextureManager","shapeRC","usage","newTexture","physicalTexType","getPhysicalFromLogicalTextureType","shapeKey","getKeyFromTextureShape","freeTextures","usedTextures","numFreeTextures","numUsedTextures","newTexture_1","shift","FLOAT32","createFloat32MatrixTexture","FLOAT16","createFloat16MatrixTexture","createUnsignedBytesMatrixTexture","logicalTexType","texList","texIndex","splice","logEnabled","total","deleteMatrixTexture","DOWNLOAD","PIXELS","UPLOAD","RENDER","shapeRowsCol","newDim","switched","getSwitchedCoords","originalOrder","switchedCoords","ERF_P","ERF_A1","ERF_A2","ERF_A3","ERF_A4","ERF_A5","SELU_SCALEALPHA","SELU_SCALE","opSnippet","UnaryOpProgram","ABS","RELU","ELU","SELU","selu_util.SELU_SCALEALPHA","selu_util.SELU_SCALE","NEG","CEIL","FLOOR","SIGN","ROUND","EXP","EXPM1","LOG","LOG1P","SQRT","RSQRT","SIGMOID","SOFTPLUS","SIN","COS","TAN","ASIN","ACOS","ATAN","SINH","COSH","TANH","ASINH","ACOSH","ATANH","ERF","erf_util.ERF_P","erf_util.ERF_A1","erf_util.ERF_A2","erf_util.ERF_A3","erf_util.ERF_A4","erf_util.ERF_A5","SQUARE","RECIPROCAL","LOGICAL_NOT","TO_INT","tensors","$tensors","convertToTensorArray","parseAxisParam","concat2Tensors","concat_util.assertParams","a2D","as2D","b2D","runKernel","concat_","concat1d","concat1d_","concat2d","concat2d_","concat3d","concat3d_","concat4d","concat4d_","global","module","define","copy","s0","s1","s2","impl","opts","xg","me","mash","charCodeAt","next","state","prng","double","quick","exports","amd","alea","z","strseed","xor128","xorwow","Date","X","init","xorshift7","limit","xor4096","tychei","pool","math","nodecrypto","chunks","rngname","startdenom","significance","overflow","mask","seedrandom","options","callback","shortseed","mixkey","prop","typ","entropy","tostring","out","randomBytes","crypto","msCrypto","getRandomValues","browser","plugins","screen","autoseed","arc4","keylen","S","pass","is_math_call","smear","stringseed","fromCharCode","require","sr","stdDeviation","truncated","stdDev","nextVal","upper","lower","seedValue","seedrandom.alea","MPRandGauss","resultX","resultY","isValid","v1","v2","isValidTruncated","convertValue","batchShape","buff","toTensor","randGauss","nextValue","minval","maxval","util.randUniform","randFunction","normalized","origRank","logits2D","multinomial","$indices","oneHot","img","$img","minTensor","maxTensor","multiplier","bytes","Uint8ClampedArray","ctx","imageData","ImageData","putImageData","util.inferFromImplicitShape","xGrad","expandedTensors","reduce","splitSizes","outIndex","numOrSizeSplits","permutation","getAxesPermutation","permutedX","permutedAxis","getInnerMostAxes","cast_","clone_","cumsum_","expandDims_","eye","eye_","fromPixels_","multinomial_","oneHot_","pad_","pad1d","pad1d_","pad2d","pad2d_","pad3d","pad3d_","pad4d","pad4d_","rand","rand_","randomNormal","randomNormal_","randomUniform","randomUniform_","reshape_","split_","squeeze_","stack_","tile_","truncatedNormal","truncatedNormal_","unstack_","batchToSpaceND_","spaceToBatchND_","condShape","condVals","inBuffer","indexToLoc","BEFORE_PAGING_CONSTANT","SIZE_UPLOAD_UNIFORM","delayedStorage","WeakSet","gpgpuCreatedLocally","NUM_BYTES_BEFORE_PAGING","devicePixelRatio","textureManager","MathBackendWebGL","HTMLVideoElement","HTMLImageElement","HTMLCanvasElement","fromPixelsCanvas","readyState","drawImage","tempPixelArray","uploadPixelDataToTexture","getTexture","FromPixelsProgram","compileAndRun","throwIfNoData","releaseTexture","uploadToGPU","cacheOnCPU","shouldTimeProgram","activeTimers","float32Values","getValuesFromTexture","downloadWaitMs","pendingRead","subscribers_1","maybeCreateBufferFromTexture","createAndWaitForFence","WebGLTexture","downloadFloat32MatrixFromBuffer","subscribers","pendingDisposal","downloadFloat32MatrixFromOutputTexture","tmpTarget","tmpInput","EncodeFloatProgram","tmpData","downloadByteEncodedFloatMatrixFromOutputTexture","oldActiveTimers","newActiveTimers","outerMostTime","programTimersStack","flattenedActiveTimers","util.flatten","results","uploadWaitMs","unreliable","numBytesInGPU","startMs","endMs","waitForQueryAndGetTime","timerQuery","getCustomSetupFunc","beginIndex","StridedSliceProgram","ReverseProgram","ConcatProgram","unary_op.NEG","MatMulProgram","binaryop_gpu.MUL","makeOutputArray","BatchNormProgram","LRNProgram","inputImage","outputImage","LRNGradProgram","TileProgram","PadProgram","TransposeProgram","GatherProgram","array_ops_util.getReshaped","array_ops_util.getPermuted","array_ops_util.getReshapedPermuted","array_ops_util.getSliceBeginCoords","array_ops_util.getSliceSize","completePaddings","paddedX","reshapedPaddedShape","permutedReshapedPaddedPermutation","flattenShape","reduce_util.computeOptimalWindowSize","ReduceProgram","cols","bestIndicesA","ArgMinMaxProgram","argReduce","axis_util.assertAxesAreInnerMostDims","outputDType","sumOutType","axis_util.getAxesPermutation","axis_util.getInnerMostAxes","segment_util.computeOutShape","segOpCompute","axis_util.getUndoAxesPermutation","segment_util.segOpComputeOptimalWindowSize","SegmentOpProgram","range","CumSumProgram","binaryop_gpu.EQUAL","binaryop_gpu.NOT_EQUAL","binaryop_gpu.LESS","binaryop_gpu.LESS_EQUAL","binaryop_gpu.GREATER","binaryop_gpu.GREATER_EQUAL","unary_op.LOGICAL_NOT","binaryop_gpu.LOGICAL_AND","binaryop_gpu.LOGICAL_OR","SelectProgram","whereImpl","topkImpl","binaryop_gpu.MIN","binaryop_gpu.MOD","binaryop_gpu.MAX","binaryop_gpu.SQUARED_DIFFERENCE","binaryop_gpu.DIV","binaryop_gpu.INT_DIV","binaryop_gpu.ADD","binaryop_gpu.SUB","binaryop_gpu.POW","unary_op.CEIL","unary_op.FLOOR","unary_op.SIGN","unary_op.ROUND","unary_op.EXP","unary_op.EXPM1","unary_op.LOG","unary_op.LOG1P","unary_op.SQRT","unary_op.RSQRT","unary_op.SQUARE","unary_op.RECIPROCAL","unary_op.RELU","unary_op.ELU","binaryop_gpu.ELU_DER","unary_op.SELU","unary_op.TO_INT","ClipProgram","unary_op.ABS","unary_op.SIGMOID","unary_op.SOFTPLUS","unary_op.SIN","unary_op.COS","unary_op.TAN","unary_op.ASIN","unary_op.ACOS","unary_op.ATAN","binaryop_gpu.ATAN2","unary_op.SINH","unary_op.COSH","unary_op.TANH","unary_op.ASINH","unary_op.ACOSH","unary_op.ATANH","unary_op.ERF","unary_op.STEP","Conv2DProgram","Conv2DDerInputProgram","Conv2DDerFilterProgram","DepthwiseConv2DProgram","DepthwiseConv2DDerInputProgram","DepthwiseConv2DDerFilterProgram","Pool2DProgram","maxPoolPositionsProgram","maxPoolPositions","maxPoolBackPropProgram","MaxPool2DBackpropProgram","avgPoolBackpropProgram","AvgPool2DBackpropProgram","backend_util.castTensor","backend_util.reshapeTensor","ResizeBilinearProgram","ResizeBilinearBackpropProgram","ResizeNearestNeighborProgram","ResizeNearestNeigborBackpropProgram","probs","OneHotProgram","nonMaxSuppressionImpl","pageToCpu","inputsData","outputData","gpgpu_math.makeShaderKey","getAndSaveBinary","gpgpu_math.compileProgram","startTimer","gpgpu_math.runProgram","numBytesToPage","lruDataGPU","computeBytes","endTimer","getBinary","binaryCache","remove","webgl_util.getTextureShapeFromLogicalShape","acquireTexture","uploadMatrixToTexture","typedArrayToFloat32","dontKeepCopyOnGPU","float32ToTypedArray","texType","save","clipValueMin","clipValueMax","clip","PI","registerBackend","abs_","acos_","acosh_","asin_","asinh_","atan_","atanh_","ceil_","clipByValue_","cos_","cosh_","erf_","exp_","expm1_","floor_","log_","log1p_","logSigmoid_","neg_","reciprocal_","round_","rsqrt_","sigmoid_","sign_","sin_","sinh_","softplus_","sqrt_","square_","step_","tan_","tanh_","$scale","$offset","$mean","$variance","x4D","as4D","batchnormReshape4D","scaleValue","reductionAxes","getReductionAxes","tileShape","xMinusMean","dyTimesScaleValue","oneOverSqrtVariance","minusHalfRCube","meanDer","varianceDer","xMinusMean2TimesRsqrt","scaleDer","offsetDer","batchNormalization2d","batchNormalization2d_","batchNormalization3d","batchNormalization3d_","batchNormalization4d","batchNormalization4d_","batchNormalization_","roundingMode","computeConv2DInfo","depthwise","filterChannels","_c","_d","getEffectiveFilterSize","fieldSize","outDepth","zeroPad","computeDefaultPad","inputRows","inputCols","outputRows","conditionalRound","outputCols","effectiveFieldSize","param","bottom","right","computeOutputShape3D","padAlongHeight","padAlongWidth","top_1","$filter","x3D","reshapedTo3D","as3D","eitherStridesOrDilationsAreOne","filter4D","input4D","reshapedTo4D","conv_util.computeConv2DInfo","tupleValuesAreOne","conv2dDerInput_","conv2dDerFilter_","xShape4D","dy4D","inDepth","conv2dDerInput","conv2dDerFilter","depthwiseConv2D","depthwiseConv2dDerInput","depthwiseConv2dDerFilter","depthwiseFilter","pointwiseFilter","$depthwiseFilter","$pointwiseFilter","channelMultiplier","dimA","dimB","depthwiseConv2DDerInput","depthwiseConv2DDerFilter","conv1d_","conv2d_","depthwiseConv2d_","separableConv2d","separableConv2d_","conv2dTranspose_","$a","$b","innerShapeA","innerShapeB","$v1","$v2","t1","t2","$t1","$t2","t1Inner","t2Inner","asScalar","matMul_","dot_","outerProduct","outerProduct_","reshapeAs","reverse_","reverse1d","reverse1d_","reverse2d","reverse2d_","reverse3d","reverse3d_","reverse4d","reverse4d_","conv_util.computePool2DInfo","y4D","maxPoolBackprop","avgPoolBackprop","$dy","$input","$output","maxPool_","avgPool_","begin_","size_","slice_util.assertParamsValid","slice_","slice1d","slice1d_","slice2d","slice2d_","slice3d","slice3d_","slice4d","slice4d_","axis_util.parseAxisParam","xMax","axis_util.expandShapeToKeepDim","toInt","expandedDyShape","reduceSize","axis_util.computeOutAndReduceShapes","reduceSizeScalar","origAxes","permutedAxes","keepDimsShape","all_","any_","argMax_","argMin_","logSumExp_","max_","mean_","min_","moments","moments_","sum_","assertTypesMatch","assertAndGetBroadcastShape","equal_","equalStrict_","greater_","greaterEqual_","greaterEqualStrict_","greaterStrict_","less_","lessEqual_","lessEqualStrict_","lessStrict_","notEqual_","notEqualStrict_","reduceAxes","broadcast_util.getReductionAxes","firstTensor","addN","ders","subtract","base","$base","$exp","multiply","realDivide","tmp","two","atan2","add_","addN_","addStrict_","atan2_","div_","divStrict_","floorDiv_","maximum_","maximumStrict_","minimum_","minimumStrict_","mod_","modStrict_","mul_","mulStrict_","pow_","powStrict_","squaredDifference_","squaredDifferenceStrict_","sub_","subStrict_","$condition","select","logicalAnd_","logicalNot_","logicalOr_","logicalXor_","where_","whereAsync","whereAsync_","stepRes","eluDer","scaleAlpha","greaterThanZeroDer","lessEqualZeroDer","$alpha","zero","elu_","leakyRelu_","prelu_","relu_","selu_","undoPerm","transpose_","localResponseNormalization4D","LRNGrad","localResponseNormalization_","normImpl","norm_","$segmentIds","isInt","gatherDropNegatives","paramsShape","indicesSize","outerShape","outerDims","innerShape","innerDims","outerAxesIndices","arrayRange","innerAxesIndices","valuesShape","arrayConcat","reshapedIndices","transposeDims","valuesTranspose","paramsGrad","invertTransposeDims","getUndoAxesPermutation","arrays","zeroClippedIndices","gathered","isPositive","numIters","zeroSlice","gather_","unsortedSegmentSum_","lstmCells","$data","$c","$h","newStates","newC","newH","forgetBias","lstmKernel","lstmBias","$forgetBias","$lstmKernel","$lstmBias","sliceCols","o","basicLSTMCell","basicLSTMCell_","multiRNNCell","multiRNNCell_","decay","zeroDebias","$v","$decay","one","oneMinusDecay","update","$step","movingAverage","movingAverage_","stridedSlice","stridedSlice_","Reduction","topk","topk_","losses","weights","reduction","SUM_BY_NONZERO_WEIGHTS","$losses","$weights","weightedLoss","NONE","SUM","MEAN","broadcastFactor","numNonZeros","labels","predictions","$labels","$predictions","computeWeightedLoss","epsilon","epsilonScalar","maxOutput","outputXTarget","sigmoidOutput","multiClassLabels","labelSmoothing","$multiClassLabels","labelSmoothingScalar","half","sigmoidCrossEntropyWithLogits_","delta","deltaScalar","quadratic","linear","logResult","dyShape","expandShapeToKeepDim","onehotLabels","$onehotLabels","numClasses","softmaxCrossEntropyWithLogits_","absoluteDifference","absoluteDifference_","computeWeightedLoss_","cosineDistance","cosineDistance_","hingeLoss","hingeLoss_","huberLoss","huberLoss_","logLoss","logLoss_","meanSquaredError","meanSquaredError_","sigmoidCrossEntropy","sigmoidCrossEntropy_","softmaxCrossEntropy","softmaxCrossEntropy_","inputIsTensor2D","ys","xs1d","proj","fullMatrices","qr2d","outerDimsProd","prev","q2ds_1","r2ds_1","x2d","q2d","r2d","m","q","one2D","tensor2d","iters","rTemp","wTemp","qTemp","gramSchmidt","gramSchmidt_","qr","qr_","images","$images","batchImages","resizeBilinearBackprop","resizeNearestNeighborBackprop","NEGATIVE_INFINITY","$boxes","$scores","nonMaxSuppSanityCheck","nonMaxSuppression","boxesVals","scoresVals","numBoxes","resizeBilinear_","resizeNearestNeighbor_","nonMaxSuppression_","nonMaxSuppressionAsync","nonMaxSuppressionAsync_","MathBackendCPU","firstUse","getImageData","numPixels","channel","tensor3d","ops.buffer","xLoc","ops.tensor","newLoc","xBuffer","outLoc","inLoc","aVals","bVals","ops.scalar","broadcastedBinaryOp","aValue","bValue","resultVals","currVals","leftDim","rightDim","aValues","bValues","aOuterStep","aInnerStep","bOuterStep","bInnerStep","aOuterEnd","bOuterEnd","resultIndex","aOuter","bOuter","aInner","bInner","ops.tensor2d","reduceShape","ops.zeros","segmentId","ops.equal","ops.stack","minIndex","maxIndex","resultDtype","indexAdjuster","prevIdx","aVal","bVal","newValues","rem","anyVal","resVals","inVals","resultValues","dyValues","threshold","tooLarge","tooSmall","expX","util.tanh","a1","a2","a3","a4","a5","d2","yR","xRCorner","yC","xCCorner","dotProd","wR","xR","wC","xC","d1","dxValues","dxS0","dxS1","dxS2","dyS0","dyS1","dyS2","fltValues","fltS0","fltS1","fltS2","topPad","leftPad","xRMin","yRMax","xCMin","yCMax","dyOffset","fltOffset","dW","yRMin","yCMin","chMul","dm","trunc","xBuf","originalLoc","i_1","originalIndex","coords","outCoords","i_2","newIndex","indicesValues","xRMax","xCMax","minMaxValue","POSITIVE_INFINITY","avgValue","pixel","maxPositions","maxValue","maxPosition","dxR","dxC","dyRCorner","dyCCorner","dyR","dyC","effectiveInputSize","effectiveOutputSize","sourceFracRow","sourceFracCol","sourceRowFloor","sourceRowCeil","sourceColFloor","sourceColCeil","topLeft","bottomLeft","colFrac","topDxRIndex","bottomDxRIndex","dxRLerp","inverseDxRLerp","leftDxCIndex","rightDxCIndex","dxCLerp","inverseDxCLerp","dyVal","topRight","bottomRight","sourceNearestRow","sourceNearestCol","startRLerp","startDyR","startCLerp","startDyC","accum","dyROffset","dyCOffSet","xValues","meanValues","varianceValues","scaleValues","offsetValues","outValues","tensor4d","sumAcrossChannels","depthBegin","depthEnd","dyi","probabilities","ops.softmax","numEvents","probVals","cdf","event_1","sampleId","event_2","event_3","aBroadcastDims","bBroadcastDims","aBuf","bBuf","aLoc","aIndex","bLoc","bIndex","delayCallback","requestAnimationFrame","setImmediate","DTYPE_VALUE_SIZE_MAP","uint16","uint8","name_1","specs","dataPromises","concatenateTypedArrays","specs_1","spec","name_2","quantization","totalByteLength","normalizedXs","byteLength","useNodeBuffer","Buffer","Blob","atob","btoa","str","buf","byteOffset","buffers","path","trim","items","modelArtifacts","modelTopology","ArrayBuffer","dateSaved","modelTopologyType","modelTopologyBytes","stringByteLength","weightSpecsBytes","weightSpecs","weightDataBytes","weightData","saveRouters","loadRouters","IORouterRegistry","saveRouter","getInstance","loadRouter","url","getHandlers","handlerType","validHandlers","router","URL_SCHEME_SUFFIX","managers","ModelStoreManagerRegistry","scheme","manager","getSchemes","sourceURL","destURL","deleteSource","loadHandlers","getLoadHandlers","loadHandler","saveHandlers","getSaveHandlers","saveHandler","sourceScheme","parseURL","sourcePath","sameMedium","load","getManager","removeModel","saveResult","modelArtifactsInfo","schemes","schemes_1","listModels","schemeOut","schemeAndPath","cloneModelInternal","DATABASE_NAME","DATABASE_VERSION","MODEL_STORE_NAME","INFO_STORE_NAME","theWindow","indexedDB","mozIndexedDB","webkitIndexedDB","msIndexedDB","shimIndexedDB","openRequest","db","createObjectStore","keyPath","modelPath","getIndexedDBFactory","BrowserIndexedDB","databaseAction","open","onupgradeneeded","setUpDatabase","onsuccess","modelTx","transaction","getRequest_1","objectStore","close","onerror","oncomplete","modelTx_1","modelArtifactsInfo_1","getModelArtifactsInfoForJSON","infoTx_1","infoStore_1","putInfoRequest_1","put","putModelRequest","deleteInfoRequest","indexedDBRouter","startsWith","URL_SCHEME","browserIndexedDB","registerSaveRouter","registerLoadRouter","BrowserIndexedDBManager","tx","getAllInfoRequest","getAll","item","maybeStripScheme","infoTx","infoStore","getInfoRequest","deleteModelData_1","deleteModelRequest","registerManager","PATH_SEPARATOR","PATH_PREFIX","INFO_SUFFIX","MODEL_TOPOLOGY_SUFFIX","WEIGHT_SPECS_SUFFIX","WEIGHT_DATA_SUFFIX","topology","BrowserLocalStorage","localStorage","LS","getModelKeys","setItem","arrayBufferToBase64String","removeItem","getItem","weightDataBase64","base64StringToArrayBuffer","localStorageRouter","browserLocalStorage","BrowserLocalStorageManager","prefix","suffix","getModelPathFromKey","DEFAULT_FILE_NAME_PREFIX","DEFAULT_JSON_EXTENSION_NAME","DEFAULT_WEIGHT_DATA_EXTENSION_NAME","fileNamePrefix","BrowserDownloads","modelTopologyFileName","weightDataFileName","weightsURL","URL","createObjectURL","weightsManifest","paths","modelTopologyAndWeightManifest","modelTopologyAndWeightManifestURL","jsonAnchor","download","href","click","weightDataAnchor","files","BrowserFiles","jsonFile","weightFiles","jsonReader","FileReader","onload","event","modelJSON","target","pathToFile","checkManifestAndWeightFiles","perFileBuffers","weightsGroup","weightFileReader","concatenateArrayBuffers","readAsArrayBuffer","readAsText","manifest","basenames","fileNames","file","basename","manifest_1","pathBasename","browserDownloadsRouter","browserDownloads","fetchURLs","requestOptions","requests","fetchURL","fetch","responses","response","arrayBuffer","filePathPrefix","weightNames","groupIndicesToFetchMap","groupWeightsToFetch","weightsFound","allManifestWeightNames","manifestGroupConfig","groupIndex","groupOffset","weightsEntry","rawDtype","weightsBytes","enqueueWeightsForFetchingFn","manifestEntry","sizeBytes","weightName","weightIndex","found","weightsNotFound","weight","groupIndicesToFetch","accumulator","shouldFetch","fetchUrls","filepath","fetchUrl","loadWeightsAsArrayBuffer","weightsTensorMap","bufferIndexOffset","numBuffers","groupBytes","groupBuffer","groupByteBuffer","groupBufferOffset","typedArray","byteBuffer","quantization_1","quantizedArray","requestInit","body","BrowserHTTPRequest","method","DEFAULT_METHOD","FormData","append","json","modelConfig","weightsManifest_2","weightsManifest_1","pathPrefix_1","lastIndexOf","fetchURLs_1","httpRequestRouter","URL_SCHEMES","browserHTTPRequest","PassthroughLoader","PassthroughSaver","Serializable","className","cls","config","classNameMap","SerializationMap","getMap","fromConfig","WEBGL_ENVS","HAS_WEBGL","NODE_ENVS","IS_NODE","CHROME_ENVS","IS_CHROME","BROWSER_ENVS","IS_BROWSER","CPU_ENVS","ALL_ENVS","actual","expected","aType","bType","actualValues","expectedValues","areClose","fail","expectArraysClose","low","high","actualVals","expect","toEqual","version","Optimizer","returnCost","applyGradients","variableGrads","DEFAULT_FLOAT32_EPSILON","DEFAULT_FLOAT16_EPSILON","learningRate","rho","rhoScalar","oneMinusRho","optimizer_utils.getOptimizerDefaultEpsilonValue","AdadeltaOptimizer","variableGradients","this_1","accumulatedGrads","accumulatedUpdates","accumulatedGrad","accumulatedUpdate","newAccumulatedGrad","updates","newAccumulatedUpdate","initialAccumulatorValue","AdagradOptimizer","beta1","beta2","beta1Scalar","beta2Scalar","accBeta1","accBeta2","oneMinusBeta1","oneMinusBeta2","epsScalar","AdamOptimizer","oneMinusAccBeta1","oneMinusAccBeta2","accumulatedFirstMoment","accumulatedSecondMoment","firstMoment","secondMoment","newFirstMoment","newSecondMoment","biasCorrectedFirstMoment","biasCorrectedSecondMoment","decayScalar","iteration","AdamaxOptimizer","lr","accumulatedWeightedInfNorm","weightedInfNorm","ut0","ut1","newWeightedInfNorm","setLearningRate","SGDOptimizer","momentum","useNesterov","accumulations","MomentumOptimizer","accumulation","newAccumulation","centered","momentumScalar","RMSPropOptimizer","accumulatedMeanSquares","accumulatedMeanGrads","accumulatedMoments","accumulatedMeanSquare","accumulatedMeanGrad","newAccumulatedMeanSquare","newAccumulatedMeanGrad","newAccumulatedMoments","newAccumulatedMeanSquare_1","OptimizerConstructors","train","sgd","adadelta","adagrad","rmsprop","adamax","adam","setBackend","getBackend","setOpHandler","ops"],"mappings":";;;;;;;;;;;;;;;;qzDAmBE,IAAMA,EAAIC,UAAUC,WAAaD,UAAUE,QAAWC,OAAeC,MAErE,MAAO,2TACKC,KAAKN,IAEb,0kDACKM,KAAKN,EAAEO,OAAO,EAAG,qBCJJC,GAMtB,IAJA,IAAIC,EAAUD,EAAME,OAChBC,EAAO,EACPC,EAAQ,EAELH,EAAU,GAEfG,EAASC,KAAKC,SAAWL,EAAW,EAIpCE,EAAOH,IAFPC,GAGAD,EAAMC,GAAWD,EAAMI,GACvBJ,EAAMI,GAASD,EAKnB,eAAsBI,EAAaC,EAAWC,GAC5C,OAAOJ,KAAKI,IAAIF,EAAKF,KAAKE,IAAIC,EAAGC,IAInC,qBAA4BjB,EAAWkB,GACrC,OAAOL,KAAKC,UAAYI,EAAIlB,GAAKA,EAInC,qBAA4BA,EAAekB,GAEzC,IADA,IAAIC,EAAS,EACJC,EAAI,EAAGA,EAAIpB,EAAEU,OAAQU,IAAK,CACjC,IAAMC,EAAOC,OAAOtB,EAAEoB,IAAME,OAAOJ,EAAEE,IACrCD,GAAUE,EAAOA,EAEnB,OAAOF,EAGT,gBAAuBI,EAAeC,GACpC,IAAKD,EACH,MAAM,IAAIE,MAAqB,iBAARD,EAAmBA,EAAMA,KAIpD,2BAC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E,IAC3BpB,SAAUkB,sBAAsBlB,SAChCqB,SAAUH,sBAAsBG,SAChCC,QAASJ,sBAAsBI,QAC/BC,QAASL,sBAAsBK,QAC/BC,OAAQN,sBAAsBM,OAC9BC,KAAMP,sBAAsBO,MCwBjBC,WAAahsE,YAAYgsE,WACzBC,WAAajsE,YAAYisE,WACzB1rE,iBAAmBP,YAAYO,iBAC/B1G,OAASmG,YAAYnG,OAClCqyE,aAWaC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tf-core.js b/node_modules/@tensorflow/tfjs-core/dist/tf-core.js new file mode 100644 index 0000000..e8d193c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tf-core.js @@ -0,0 +1,15500 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.tf = global.tf || {}))); +}(this, (function (exports) { 'use strict'; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + function isMobile() { + var a = navigator.userAgent || navigator.vendor || window.opera; + return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i + .test(a) || + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i + .test(a.substr(0, 4)); + } + + function shuffle(array) { + var counter = array.length; + var temp = 0; + var index = 0; + while (counter > 0) { + index = (Math.random() * counter) | 0; + counter--; + temp = array[counter]; + array[counter] = array[index]; + array[index] = temp; + } + } + function clamp(min, x, max) { + return Math.max(min, Math.min(x, max)); + } + function randUniform(a, b) { + return Math.random() * (b - a) + a; + } + function distSquared(a, b) { + var result = 0; + for (var i = 0; i < a.length; i++) { + var diff = Number(a[i]) - Number(b[i]); + result += diff * diff; + } + return result; + } + function assert(expr, msg) { + if (!expr) { + throw new Error(typeof msg === 'string' ? msg : msg()); + } + } + function assertShapesMatch(shapeA, shapeB, errorMessagePrefix) { + if (errorMessagePrefix === void 0) { errorMessagePrefix = ''; } + assert(arraysEqual(shapeA, shapeB), errorMessagePrefix + (" Shapes " + shapeA + " and " + shapeB + " must match")); + } + function assertNonNull(a) { + assert(a != null, "The input to the tensor constructor must be a non-null value."); + } + function flatten(arr, ret) { + if (ret === void 0) { ret = []; } + if (Array.isArray(arr)) { + for (var i = 0; i < arr.length; ++i) { + flatten(arr[i], ret); + } + } + else { + ret.push(arr); + } + return ret; + } + function inferShape(val) { + var firstElem = val; + if (isTypedArray(val)) { + return [val.length]; + } + if (!Array.isArray(val)) { + return []; + } + var shape = []; + while (firstElem instanceof Array) { + shape.push(firstElem.length); + firstElem = firstElem[0]; + } + if (val instanceof Array) { + deepAssertShapeConsistency(val, shape, []); + } + return shape; + } + function deepAssertShapeConsistency(val, shape, indices) { + indices = indices || []; + if (!(val instanceof Array)) { + assert(shape.length === 0, function () { return "Element arr[" + indices.join('][') + "] is a primitive, " + + ("but should be an array of " + shape[0] + " elements"); }); + return; + } + assert(shape.length > 0, function () { return "Element arr[" + indices.join('][') + "] should be a primitive, " + + ("but is an array of " + val.length + " elements"); }); + assert(val.length === shape[0], function () { return "Element arr[" + indices.join('][') + "] should have " + shape[0] + " " + + ("elements, but has " + val.length + " elements"); }); + var subShape = shape.slice(1); + for (var i = 0; i < val.length; ++i) { + deepAssertShapeConsistency(val[i], subShape, indices.concat(i)); + } + } + function sizeFromShape(shape) { + if (shape.length === 0) { + return 1; + } + var size = shape[0]; + for (var i = 1; i < shape.length; i++) { + size *= shape[i]; + } + return size; + } + function isScalarShape(shape) { + return shape.length === 0; + } + function arraysEqual(n1, n2) { + if (n1.length !== n2.length) { + return false; + } + for (var i = 0; i < n1.length; i++) { + if (n1[i] !== n2[i]) { + return false; + } + } + return true; + } + function isInt(a) { + return a % 1 === 0; + } + function tanh(x) { + if (Math.tanh != null) { + return Math.tanh(x); + } + if (x === Infinity) { + return 1; + } + else if (x === -Infinity) { + return -1; + } + else { + var e2x = Math.exp(2 * x); + return (e2x - 1) / (e2x + 1); + } + } + function sizeToSquarishShape(size) { + for (var a = Math.floor(Math.sqrt(size)); a > 1; --a) { + if (size % a === 0) { + return [a, size / a]; + } + } + return [1, size]; + } + function createShuffledIndices(n) { + var shuffledIndices = new Uint32Array(n); + for (var i = 0; i < n; ++i) { + shuffledIndices[i] = i; + } + shuffle(shuffledIndices); + return shuffledIndices; + } + function rightPad(a, size) { + if (size <= a.length) { + return a; + } + return a + ' '.repeat(size - a.length); + } + function repeatedTry(checkFn, delayFn, maxCounter) { + if (delayFn === void 0) { delayFn = function (counter) { return 0; }; } + return new Promise(function (resolve, reject) { + var tryCount = 0; + var tryFn = function () { + if (checkFn()) { + resolve(); + return; + } + tryCount++; + var nextBackoff = delayFn(tryCount); + if (maxCounter != null && tryCount >= maxCounter) { + reject(); + return; + } + setTimeout(tryFn, nextBackoff); + }; + tryFn(); + }); + } + function inferFromImplicitShape(shape, size) { + var shapeProd = 1; + var implicitIdx = -1; + for (var i = 0; i < shape.length; ++i) { + if (shape[i] > 0) { + shapeProd *= shape[i]; + } + else if (shape[i] === -1) { + if (implicitIdx !== -1) { + throw Error("Shapes can only have 1 implicit size. " + + ("Found - 1 at dim " + implicitIdx + " and dim " + i)); + } + implicitIdx = i; + } + else if (shape[i] <= 0) { + throw Error("Shapes can not be <= 0. Found " + shape[i] + " at dim " + i); + } + } + if (implicitIdx === -1) { + if (size > 0 && size !== shapeProd) { + throw Error("Size(" + size + ") must match the product of shape " + shape); + } + return shape; + } + if (size % shapeProd !== 0) { + throw Error("The implicit shape can't be a fractional number. " + + ("Got " + size + " / " + shapeProd)); + } + var newShape = shape.slice(); + newShape[implicitIdx] = size / shapeProd; + return newShape; + } + function squeezeShape(shape, axis) { + var newShape = []; + var keptDims = []; + var j = 0; + for (var i = 0; i < shape.length; ++i) { + if (axis != null) { + if (axis[j] === i && shape[i] > 1) { + throw new Error("Can't squeeze axis " + i + " since its dim '" + shape[i] + "' is not 1"); + } + if ((axis[j] == null || axis[j] > i) && shape[i] === 1) { + newShape.push(shape[i]); + keptDims.push(i); + } + if (axis[j] <= i) { + j++; + } + } + if (shape[i] > 1) { + newShape.push(shape[i]); + keptDims.push(i); + } + } + return { newShape: newShape, keptDims: keptDims }; + } + function getTypedArrayFromDType(dtype, size) { + var values = null; + if (dtype == null || dtype === 'float32') { + values = new Float32Array(size); + } + else if (dtype === 'int32') { + values = new Int32Array(size); + } + else if (dtype === 'bool') { + values = new Uint8Array(size); + } + else { + throw new Error("Unknown data type " + dtype); + } + return values; + } + function checkComputationForNaN(vals, dtype, name) { + if (dtype !== 'float32') { + return; + } + for (var i = 0; i < vals.length; i++) { + if (isNaN(vals[i])) { + throw Error("The result of the '" + name + "' has NaNs."); + } + } + } + function checkConversionForNaN(vals, dtype) { + if (dtype === 'float32') { + return; + } + for (var i = 0; i < vals.length; i++) { + if (isNaN(vals[i])) { + throw Error("NaN is not a valid value for dtype: '" + dtype + "'."); + } + } + } + function hasEncodingLoss(oldType, newType) { + if (newType === 'float32') { + return false; + } + if (newType === 'int32' && oldType !== 'float32') { + return false; + } + if (newType === 'bool' && oldType === 'bool') { + return false; + } + return true; + } + function copyTypedArray(array, dtype, debugMode) { + if (dtype == null || dtype === 'float32') { + return new Float32Array(array); + } + else if (dtype === 'int32') { + if (debugMode) { + checkConversionForNaN(array, dtype); + } + return new Int32Array(array); + } + else if (dtype === 'bool') { + var bool = new Uint8Array(array.length); + for (var i = 0; i < bool.length; ++i) { + if (Math.round(array[i]) !== 0) { + bool[i] = 1; + } + } + return bool; + } + else { + throw new Error("Unknown data type " + dtype); + } + } + function isTypedArray(a) { + return a instanceof Float32Array || a instanceof Int32Array || + a instanceof Uint8Array; + } + function bytesPerElement(dtype) { + if (dtype === 'float32' || dtype === 'int32') { + return 4; + } + else if (dtype === 'bool') { + return 1; + } + else { + throw new Error("Unknown dtype " + dtype); + } + } + function isFunction(f) { + return !!(f && f.constructor && f.call && f.apply); + } + function nearestDivisor(size, start) { + for (var i = start; i < size; ++i) { + if (size % i === 0) { + return i; + } + } + return size; + } + function computeStrides(shape) { + var rank = shape.length; + if (rank < 2) { + return []; + } + var strides = new Array(rank - 1); + strides[rank - 2] = shape[rank - 1]; + for (var i = rank - 3; i >= 0; --i) { + strides[i] = strides[i + 1] * shape[i + 1]; + } + return strides; + } + function toTypedArray(a, dtype, debugMode) { + if (noConversionNeeded(a, dtype)) { + return a; + } + if (Array.isArray(a)) { + a = flatten(a); + } + return copyTypedArray(a, dtype, debugMode); + } + function noConversionNeeded(a, dtype) { + return (a instanceof Float32Array && dtype === 'float32') || + (a instanceof Int32Array && dtype === 'int32') || + (a instanceof Uint8Array && dtype === 'bool'); + } + function makeOnesTypedArray(size, dtype) { + var array = makeZerosTypedArray(size, dtype); + for (var i = 0; i < array.length; i++) { + array[i] = 1; + } + return array; + } + function makeZerosTypedArray(size, dtype) { + if (dtype == null || dtype === 'float32') { + return new Float32Array(size); + } + else if (dtype === 'int32') { + return new Int32Array(size); + } + else if (dtype === 'bool') { + return new Uint8Array(size); + } + else { + throw new Error("Unknown data type " + dtype); + } + } + function now() { + if (typeof performance !== 'undefined') { + return performance.now(); + } + else if (typeof process !== 'undefined') { + var time = process.hrtime(); + return time[0] * 1000 + time[1] / 1000000; + } + else { + throw new Error('Can not measure time in this environment. You should run tf.js ' + + 'in the browser or in Node.js'); + } + } + + var util = /*#__PURE__*/Object.freeze({ + shuffle: shuffle, + clamp: clamp, + randUniform: randUniform, + distSquared: distSquared, + assert: assert, + assertShapesMatch: assertShapesMatch, + assertNonNull: assertNonNull, + flatten: flatten, + inferShape: inferShape, + sizeFromShape: sizeFromShape, + isScalarShape: isScalarShape, + arraysEqual: arraysEqual, + isInt: isInt, + tanh: tanh, + sizeToSquarishShape: sizeToSquarishShape, + createShuffledIndices: createShuffledIndices, + rightPad: rightPad, + repeatedTry: repeatedTry, + inferFromImplicitShape: inferFromImplicitShape, + squeezeShape: squeezeShape, + getTypedArrayFromDType: getTypedArrayFromDType, + checkComputationForNaN: checkComputationForNaN, + checkConversionForNaN: checkConversionForNaN, + hasEncodingLoss: hasEncodingLoss, + isTypedArray: isTypedArray, + bytesPerElement: bytesPerElement, + isFunction: isFunction, + nearestDivisor: nearestDivisor, + computeStrides: computeStrides, + toTypedArray: toTypedArray, + makeOnesTypedArray: makeOnesTypedArray, + makeZerosTypedArray: makeZerosTypedArray, + now: now + }); + + var Profiler = (function () { + function Profiler(backendTimer, logger) { + this.backendTimer = backendTimer; + this.logger = logger; + if (logger == null) { + this.logger = new Logger(); + } + } + Profiler.prototype.profileKernel = function (name, f) { + var _this = this; + var result; + var holdResultWrapperFn = function () { + result = f(); + }; + var timer = this.backendTimer.time(holdResultWrapperFn); + var results = Array.isArray(result) ? result : [result]; + results.forEach(function (r) { + var vals = r.dataSync(); + checkComputationForNaN(vals, r.dtype, name); + timer.then(function (timing) { + _this.logger.logKernelProfile(name, r, vals, timing.kernelMs); + }); + }); + return result; + }; + return Profiler; + }()); + var Logger = (function () { + function Logger() { + } + Logger.prototype.logKernelProfile = function (name, result, vals, timeMs) { + var time = rightPad(timeMs + "ms", 9); + var paddedName = rightPad(name, 25); + var rank = result.rank; + var size = result.size; + var shape = rightPad(result.shape.toString(), 14); + console.log("%c" + paddedName + "\t%c" + time + "\t%c" + rank + "D " + shape + "\t%c" + size, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange'); + }; + return Logger; + }()); + + function getFilteredNodesXToY(tape, xs, y) { + var tensorsFromX = {}; + var nodesFromX = {}; + for (var i = 0; i < xs.length; i++) { + tensorsFromX[xs[i].id] = true; + } + for (var i = 0; i < tape.length; i++) { + var node = tape[i]; + var nodeInputs = node.inputs; + for (var inputName in nodeInputs) { + var input = nodeInputs[inputName]; + var anyInputFromX = false; + for (var j = 0; j < xs.length; j++) { + if (tensorsFromX[input.id]) { + tensorsFromX[node.output.id] = true; + anyInputFromX = true; + nodesFromX[node.id] = true; + break; + } + } + if (anyInputFromX) { + break; + } + } + } + var tensorsLeadToY = {}; + tensorsLeadToY[y.id] = true; + var nodesToY = {}; + for (var i = tape.length - 1; i >= 0; i--) { + var node = tape[i]; + var nodeInputs = node.inputs; + var outputs = []; + outputs.push(node.output); + for (var j = 0; j < outputs.length; j++) { + if (tensorsLeadToY[outputs[j].id]) { + for (var inputName in nodeInputs) { + tensorsLeadToY[nodeInputs[inputName].id] = true; + nodesToY[node.id] = true; + } + break; + } + } + } + var filteredTape = []; + for (var i = 0; i < tape.length; i++) { + var node = tape[i]; + if (nodesFromX[node.id] && nodesToY[node.id]) { + var prunedInputs = {}; + for (var inputName in node.inputs) { + var nodeInput = node.inputs[inputName]; + if (tensorsFromX[nodeInput.id]) { + prunedInputs[inputName] = nodeInput; + } + } + var prunedNode = Object.assign({}, node); + prunedNode.inputs = prunedInputs; + prunedNode.output = node.output; + filteredTape.push(prunedNode); + } + } + return filteredTape; + } + function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape) { + for (var i = filteredTape.length - 1; i >= 0; i--) { + var node = filteredTape[i]; + var dy = tensorAccumulatedGradientMap[node.output.id]; + if (node.gradient == null) { + throw new Error("Cannot compute gradient: gradient function not found " + + ("for " + node.name + ".")); + } + var inputGradients = node.gradient(dy); + for (var inputName in node.inputs) { + if (!(inputName in inputGradients)) { + throw new Error("Cannot backprop through input " + inputName + ". " + + ("Available gradients found: " + Object.keys(inputGradients) + ".")); + } + var dx = inputGradients[inputName](); + var x = node.inputs[inputName]; + if (!arraysEqual(dx.shape, x.shape)) { + throw new Error("Error in gradient for op " + node.name + ". The gradient of input " + + ("'" + inputName + "' has shape '" + dx.shape + "', which does not match ") + + ("the shape of the input '" + x.shape + "'")); + } + if (tensorAccumulatedGradientMap[x.id] == null) { + tensorAccumulatedGradientMap[x.id] = dx; + } + else { + var curGradient = tensorAccumulatedGradientMap[x.id]; + tensorAccumulatedGradientMap[x.id] = curGradient.add(dx); + curGradient.dispose(); + } + } + } + } + + var FORMAT_LIMIT_NUM_VALS = 20; + var FORMAT_NUM_FIRST_LAST_VALS = 3; + var FORMAT_NUM_SIG_DIGITS = 7; + function tensorToString(vals, shape, dtype, verbose) { + var strides = computeStrides(shape); + var padPerCol = computeMaxSizePerColumn(vals, shape, strides); + var rank = shape.length; + var valsLines = subTensorToString(vals, shape, strides, padPerCol); + var lines = ['Tensor']; + if (verbose) { + lines.push(" dtype: " + dtype); + lines.push(" rank: " + rank); + lines.push(" shape: [" + shape + "]"); + lines.push(" values:"); + } + lines.push(valsLines.map(function (l) { return ' ' + l; }).join('\n')); + return lines.join('\n'); + } + function computeMaxSizePerColumn(vals, shape, strides) { + var n = sizeFromShape(shape); + var numCols = strides[strides.length - 1]; + var padPerCol = new Array(numCols).fill(0); + var rank = shape.length; + if (rank > 1) { + for (var row = 0; row < n / numCols; row++) { + var offset = row * numCols; + for (var j = 0; j < numCols; j++) { + padPerCol[j] = + Math.max(padPerCol[j], valToString(vals[offset + j], 0).length); + } + } + } + return padPerCol; + } + function valToString(val, pad) { + return rightPad(parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(), pad); + } + function subTensorToString(vals, shape, strides, padPerCol, isLast) { + if (isLast === void 0) { isLast = true; } + var size = shape[0]; + var rank = shape.length; + if (rank === 0) { + return [vals[0].toString()]; + } + if (rank === 1) { + if (size > FORMAT_LIMIT_NUM_VALS) { + var firstVals = Array.from(vals.subarray(0, FORMAT_NUM_FIRST_LAST_VALS)); + var lastVals = Array.from(vals.subarray(size - FORMAT_NUM_FIRST_LAST_VALS, size)); + return [ + '[' + firstVals.map(function (x, i) { return valToString(x, padPerCol[i]); }).join(', ') + + ', ..., ' + + lastVals + .map(function (x, i) { return valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i]); }) + .join(', ') + + ']' + ]; + } + return [ + '[' + + Array.from(vals).map(function (x, i) { return valToString(x, padPerCol[i]); }).join(', ') + + ']' + ]; + } + var subshape = shape.slice(1); + var substrides = strides.slice(1); + var stride = strides[0]; + var lines = []; + if (size > FORMAT_LIMIT_NUM_VALS) { + for (var i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) { + var start = i * stride; + var end = start + stride; + lines.push.apply(lines, subTensorToString(vals.subarray(start, end), subshape, substrides, padPerCol, false)); + } + lines.push('...'); + for (var i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) { + var start = i * stride; + var end = start + stride; + lines.push.apply(lines, subTensorToString(vals.subarray(start, end), subshape, substrides, padPerCol, i === size - 1)); + } + } + else { + for (var i = 0; i < size; i++) { + var start = i * stride; + var end = start + stride; + lines.push.apply(lines, subTensorToString(vals.subarray(start, end), subshape, substrides, padPerCol, i === size - 1)); + } + } + var sep = rank === 2 ? ',' : ''; + lines[0] = '[' + lines[0] + sep; + for (var i = 1; i < lines.length - 1; i++) { + lines[i] = ' ' + lines[i] + sep; + } + var newLineSep = ',\n'; + for (var i = 2; i < rank; i++) { + newLineSep += '\n'; + } + lines[lines.length - 1] = + ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep); + return lines; + } + + var TensorBuffer = (function () { + function TensorBuffer(shape, dtype, values) { + this.dtype = dtype; + if (values != null) { + var n = values.length; + var size = sizeFromShape(shape); + assert(n === size, "Length of values '" + n + "' does not match the size " + + ("inferred by the shape '" + size + "'")); + } + this.shape = shape.slice(); + this.values = + values || getTypedArrayFromDType(dtype, sizeFromShape(shape)); + this.strides = computeStrides(shape); + this.size = sizeFromShape(shape); + } + TensorBuffer.prototype.set = function (value) { + var locs = []; + for (var _i = 1; _i < arguments.length; _i++) { + locs[_i - 1] = arguments[_i]; + } + if (locs.length === 0) { + locs = [0]; + } + assert(locs.length === this.rank, "The number of provided coordinates (" + locs.length + ") must " + + ("match the rank (" + this.rank + ")")); + var index = this.locToIndex(locs); + this.values[index] = value; + }; + TensorBuffer.prototype.get = function () { + var locs = []; + for (var _i = 0; _i < arguments.length; _i++) { + locs[_i] = arguments[_i]; + } + if (locs.length === 0) { + locs = [0]; + } + var index = locs[locs.length - 1]; + for (var i = 0; i < locs.length - 1; ++i) { + index += this.strides[i] * locs[i]; + } + return this.values[index]; + }; + TensorBuffer.prototype.locToIndex = function (locs) { + if (this.rank === 0) { + return 0; + } + else if (this.rank === 1) { + return locs[0]; + } + var index = locs[locs.length - 1]; + for (var i = 0; i < locs.length - 1; ++i) { + index += this.strides[i] * locs[i]; + } + return index; + }; + TensorBuffer.prototype.indexToLoc = function (index) { + if (this.rank === 0) { + return []; + } + else if (this.rank === 1) { + return [index]; + } + var locs = new Array(this.shape.length); + for (var i = 0; i < locs.length - 1; ++i) { + locs[i] = Math.floor(index / this.strides[i]); + index -= locs[i] * this.strides[i]; + } + locs[locs.length - 1] = index; + return locs; + }; + Object.defineProperty(TensorBuffer.prototype, "rank", { + get: function () { + return this.shape.length; + }, + enumerable: true, + configurable: true + }); + TensorBuffer.prototype.toTensor = function () { + return Tensor.make(this.shape, { values: this.values }, this.dtype); + }; + return TensorBuffer; + }()); + var trackerFn = null; + var opHandler = null; + function setTensorTracker(fn) { + trackerFn = fn; + } + function setOpHandler(handler) { + opHandler = handler; + } + var Tensor = (function () { + function Tensor(shape, dtype, values, dataId) { + this.isDisposedInternal = false; + this.size = sizeFromShape(shape); + if (values != null) { + assert(this.size === values.length, "Constructing tensor of shape (" + this.size + ") should match the " + + ("length of values (" + values.length + ")")); + } + this.shape = shape.slice(); + this.dtype = dtype || 'float32'; + this.strides = computeStrides(shape); + this.dataId = dataId != null ? dataId : {}; + this.id = Tensor.nextId++; + this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher'); + trackerFn().registerTensor(this); + if (values != null) { + trackerFn().write(this.dataId, values); + } + } + Tensor.make = function (shape, data, dtype) { + return new Tensor(shape, dtype, data.values, data.dataId); + }; + Tensor.prototype.flatten = function () { + this.throwIfDisposed(); + return this.as1D(); + }; + Tensor.prototype.asScalar = function () { + this.throwIfDisposed(); + assert(this.size === 1, 'The array must have only 1 element.'); + return this.reshape([]); + }; + Tensor.prototype.as1D = function () { + this.throwIfDisposed(); + return this.reshape([this.size]); + }; + Tensor.prototype.as2D = function (rows, columns) { + this.throwIfDisposed(); + return this.reshape([rows, columns]); + }; + Tensor.prototype.as3D = function (rows, columns, depth) { + this.throwIfDisposed(); + return this.reshape([rows, columns, depth]); + }; + Tensor.prototype.as4D = function (rows, columns, depth, depth2) { + this.throwIfDisposed(); + return this.reshape([rows, columns, depth, depth2]); + }; + Tensor.prototype.asType = function (dtype) { + this.throwIfDisposed(); + return opHandler.cast(this, dtype); + }; + Object.defineProperty(Tensor.prototype, "rank", { + get: function () { + return this.shape.length; + }, + enumerable: true, + configurable: true + }); + Tensor.prototype.get = function () { + var locs = []; + for (var _i = 0; _i < arguments.length; _i++) { + locs[_i] = arguments[_i]; + } + assert(locs.length === this.rank, 'Number of coordinates in get() must match the rank of the tensor'); + this.throwIfDisposed(); + if (locs.length === 0) { + locs = [0]; + } + var index = locs[locs.length - 1]; + for (var i = 0; i < locs.length - 1; ++i) { + index += this.strides[i] * locs[i]; + } + return this.dataSync()[index]; + }; + Tensor.prototype.buffer = function () { + return opHandler.buffer(this.shape, this.dtype, this.dataSync()); + }; + Tensor.prototype.data = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + this.throwIfDisposed(); + return [2, trackerFn().read(this.dataId)]; + }); + }); + }; + Tensor.prototype.dataSync = function () { + this.throwIfDisposed(); + return trackerFn().readSync(this.dataId); + }; + Tensor.prototype.dispose = function () { + if (this.isDisposed) { + return; + } + trackerFn().disposeTensor(this); + this.isDisposedInternal = true; + }; + Object.defineProperty(Tensor.prototype, "isDisposed", { + get: function () { + return this.isDisposedInternal; + }, + enumerable: true, + configurable: true + }); + Tensor.prototype.throwIfDisposed = function () { + if (this.isDisposed) { + throw new Error("Tensor is disposed."); + } + }; + Tensor.prototype.toFloat = function () { + return this.asType('float32'); + }; + Tensor.prototype.toInt = function () { + return this.asType('int32'); + }; + Tensor.prototype.toBool = function () { + return this.asType('bool'); + }; + Tensor.prototype.print = function (verbose) { + if (verbose === void 0) { verbose = false; } + return opHandler.print(this, verbose); + }; + Tensor.prototype.reshape = function (newShape) { + this.throwIfDisposed(); + return opHandler.reshape(this, newShape); + }; + Tensor.prototype.reshapeAs = function (x) { + this.throwIfDisposed(); + return this.reshape(x.shape); + }; + Tensor.prototype.expandDims = function (axis) { + if (axis === void 0) { axis = 0; } + return opHandler.expandDims(this, axis); + }; + Tensor.prototype.cumsum = function (axis, exclusive, reverse) { + if (axis === void 0) { axis = 0; } + if (exclusive === void 0) { exclusive = false; } + if (reverse === void 0) { reverse = false; } + return opHandler.cumsum(this, axis, exclusive, reverse); + }; + Tensor.prototype.squeeze = function (axis) { + this.throwIfDisposed(); + return opHandler.squeeze(this, axis); + }; + Tensor.prototype.clone = function () { + this.throwIfDisposed(); + return opHandler.clone(this); + }; + Tensor.prototype.toString = function (verbose) { + if (verbose === void 0) { verbose = false; } + var vals = this.dataSync(); + return tensorToString(vals, this.shape, this.dtype, verbose); + }; + Tensor.prototype.tile = function (reps) { + this.throwIfDisposed(); + return opHandler.tile(this, reps); + }; + Tensor.prototype.gather = function (indices, axis) { + if (axis === void 0) { axis = 0; } + this.throwIfDisposed(); + return opHandler.gather(this, indices, axis); + }; + Tensor.prototype.matMul = function (b, transposeA, transposeB) { + if (transposeA === void 0) { transposeA = false; } + if (transposeB === void 0) { transposeB = false; } + this.throwIfDisposed(); + return opHandler.matMul(this, b, transposeA, transposeB); + }; + Tensor.prototype.dot = function (b) { + this.throwIfDisposed(); + return opHandler.dot(this, b); + }; + Tensor.prototype.norm = function (ord, axis, keepDims) { + if (ord === void 0) { ord = 'euclidean'; } + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.norm(this, ord, axis, keepDims); + }; + Tensor.prototype.slice = function (begin, size) { + this.throwIfDisposed(); + return opHandler.slice(this, begin, size); + }; + Tensor.prototype.reverse = function (axis) { + this.throwIfDisposed(); + return opHandler.reverse(this, axis); + }; + Tensor.prototype.concat = function (x, axis) { + if (axis === void 0) { axis = 0; } + this.throwIfDisposed(); + return opHandler.concat([this, x], axis); + }; + Tensor.prototype.stack = function (x, axis) { + if (axis === void 0) { axis = 0; } + return opHandler.stack([this, x], axis); + }; + Tensor.prototype.unstack = function (x, axis) { + if (axis === void 0) { axis = 0; } + return opHandler.unstack(this, axis); + }; + Tensor.prototype.pad = function (paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + return opHandler.pad(this, paddings, constantValue); + }; + Tensor.prototype.batchNormalization = function (mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + this.throwIfDisposed(); + return opHandler.batchNormalization(this, mean, variance, varianceEpsilon, scale, offset); + }; + Tensor.prototype.all = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.all(this, axis, keepDims); + }; + Tensor.prototype.any = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.any(this, axis, keepDims); + }; + Tensor.prototype.logSumExp = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.logSumExp(this, axis, keepDims); + }; + Tensor.prototype.sum = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.sum(this, axis, keepDims); + }; + Tensor.prototype.mean = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.mean(this, axis, keepDims); + }; + Tensor.prototype.min = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.min(this, axis, keepDims); + }; + Tensor.prototype.max = function (axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + this.throwIfDisposed(); + return opHandler.max(this, axis, keepDims); + }; + Tensor.prototype.argMin = function (axis) { + if (axis === void 0) { axis = null; } + this.throwIfDisposed(); + return opHandler.argMin(this, axis); + }; + Tensor.prototype.argMax = function (axis) { + if (axis === void 0) { axis = null; } + this.throwIfDisposed(); + return opHandler.argMax(this, axis); + }; + Tensor.prototype.cast = function (dtype) { + this.throwIfDisposed(); + return opHandler.cast(this, dtype); + }; + Tensor.prototype.add = function (x) { + this.throwIfDisposed(); + return opHandler.add(this, x); + }; + Tensor.prototype.addStrict = function (x) { + this.throwIfDisposed(); + return opHandler.addStrict(this, x); + }; + Tensor.prototype.sub = function (x) { + this.throwIfDisposed(); + return opHandler.sub(this, x); + }; + Tensor.prototype.subStrict = function (x) { + this.throwIfDisposed(); + return opHandler.subStrict(this, x); + }; + Tensor.prototype.pow = function (exp) { + this.throwIfDisposed(); + return opHandler.pow(this, exp); + }; + Tensor.prototype.powStrict = function (exp) { + this.throwIfDisposed(); + return opHandler.powStrict(this, exp); + }; + Tensor.prototype.mul = function (x) { + this.throwIfDisposed(); + return opHandler.mul(this, x); + }; + Tensor.prototype.mulStrict = function (x) { + this.throwIfDisposed(); + return opHandler.mulStrict(this, x); + }; + Tensor.prototype.div = function (x) { + this.throwIfDisposed(); + return opHandler.div(this, x); + }; + Tensor.prototype.floorDiv = function (x) { + this.throwIfDisposed(); + return opHandler.floorDiv(this, x); + }; + Tensor.prototype.divStrict = function (x) { + this.throwIfDisposed(); + return opHandler.divStrict(this, x); + }; + Tensor.prototype.minimum = function (x) { + this.throwIfDisposed(); + return opHandler.minimum(this, x); + }; + Tensor.prototype.minimumStrict = function (x) { + this.throwIfDisposed(); + return opHandler.minimumStrict(this, x); + }; + Tensor.prototype.maximum = function (x) { + this.throwIfDisposed(); + return opHandler.maximum(this, x); + }; + Tensor.prototype.maximumStrict = function (x) { + this.throwIfDisposed(); + return opHandler.maximumStrict(this, x); + }; + Tensor.prototype.mod = function (x) { + this.throwIfDisposed(); + return opHandler.mod(this, x); + }; + Tensor.prototype.modStrict = function (x) { + this.throwIfDisposed(); + return opHandler.modStrict(this, x); + }; + Tensor.prototype.squaredDifference = function (x) { + this.throwIfDisposed(); + return opHandler.squaredDifference(this, x); + }; + Tensor.prototype.squaredDifferenceStrict = function (x) { + this.throwIfDisposed(); + return opHandler.squaredDifferenceStrict(this, x); + }; + Tensor.prototype.transpose = function (perm) { + this.throwIfDisposed(); + return opHandler.transpose(this, perm); + }; + Tensor.prototype.notEqual = function (x) { + this.throwIfDisposed(); + return opHandler.notEqual(this, x); + }; + Tensor.prototype.notEqualStrict = function (x) { + this.throwIfDisposed(); + return opHandler.notEqualStrict(this, x); + }; + Tensor.prototype.less = function (x) { + this.throwIfDisposed(); + return opHandler.less(this, x); + }; + Tensor.prototype.lessStrict = function (x) { + this.throwIfDisposed(); + return opHandler.lessStrict(this, x); + }; + Tensor.prototype.equal = function (x) { + this.throwIfDisposed(); + return opHandler.equal(this, x); + }; + Tensor.prototype.equalStrict = function (x) { + this.throwIfDisposed(); + return opHandler.equalStrict(this, x); + }; + Tensor.prototype.lessEqual = function (x) { + this.throwIfDisposed(); + return opHandler.lessEqual(this, x); + }; + Tensor.prototype.lessEqualStrict = function (x) { + this.throwIfDisposed(); + return opHandler.lessEqualStrict(this, x); + }; + Tensor.prototype.greater = function (x) { + this.throwIfDisposed(); + return opHandler.greater(this, x); + }; + Tensor.prototype.greaterStrict = function (x) { + this.throwIfDisposed(); + return opHandler.greaterStrict(this, x); + }; + Tensor.prototype.greaterEqual = function (x) { + this.throwIfDisposed(); + return opHandler.greaterEqual(this, x); + }; + Tensor.prototype.greaterEqualStrict = function (x) { + this.throwIfDisposed(); + return opHandler.greaterEqualStrict(this, x); + }; + Tensor.prototype.logicalAnd = function (x) { + this.throwIfDisposed(); + return opHandler.logicalAnd(this, x); + }; + Tensor.prototype.logicalOr = function (x) { + this.throwIfDisposed(); + return opHandler.logicalOr(this, x); + }; + Tensor.prototype.logicalNot = function () { + this.throwIfDisposed(); + return opHandler.logicalNot(this); + }; + Tensor.prototype.logicalXor = function (x) { + this.throwIfDisposed(); + return opHandler.logicalXor(this, x); + }; + Tensor.prototype.where = function (condition, x) { + this.throwIfDisposed(); + return opHandler.where(condition, this, x); + }; + Tensor.prototype.neg = function () { + this.throwIfDisposed(); + return opHandler.neg(this); + }; + Tensor.prototype.ceil = function () { + this.throwIfDisposed(); + return opHandler.ceil(this); + }; + Tensor.prototype.floor = function () { + this.throwIfDisposed(); + return opHandler.floor(this); + }; + Tensor.prototype.sign = function () { + this.throwIfDisposed(); + return opHandler.sign(this); + }; + Tensor.prototype.exp = function () { + this.throwIfDisposed(); + return opHandler.exp(this); + }; + Tensor.prototype.expm1 = function () { + this.throwIfDisposed(); + return opHandler.expm1(this); + }; + Tensor.prototype.log = function () { + this.throwIfDisposed(); + return opHandler.log(this); + }; + Tensor.prototype.log1p = function () { + this.throwIfDisposed(); + return opHandler.log1p(this); + }; + Tensor.prototype.sqrt = function () { + this.throwIfDisposed(); + return opHandler.sqrt(this); + }; + Tensor.prototype.rsqrt = function () { + this.throwIfDisposed(); + return opHandler.rsqrt(this); + }; + Tensor.prototype.square = function () { + this.throwIfDisposed(); + return opHandler.square(this); + }; + Tensor.prototype.reciprocal = function () { + this.throwIfDisposed(); + return opHandler.reciprocal(this); + }; + Tensor.prototype.abs = function () { + this.throwIfDisposed(); + return opHandler.abs(this); + }; + Tensor.prototype.clipByValue = function (min, max) { + this.throwIfDisposed(); + return opHandler.clipByValue(this, min, max); + }; + Tensor.prototype.relu = function () { + this.throwIfDisposed(); + return opHandler.relu(this); + }; + Tensor.prototype.elu = function () { + this.throwIfDisposed(); + return opHandler.elu(this); + }; + Tensor.prototype.selu = function () { + this.throwIfDisposed(); + return opHandler.selu(this); + }; + Tensor.prototype.leakyRelu = function (alpha) { + if (alpha === void 0) { alpha = 0.2; } + this.throwIfDisposed(); + return opHandler.leakyRelu(this, alpha); + }; + Tensor.prototype.prelu = function (alpha) { + this.throwIfDisposed(); + return opHandler.prelu(this, alpha); + }; + Tensor.prototype.sigmoid = function () { + this.throwIfDisposed(); + return opHandler.sigmoid(this); + }; + Tensor.prototype.logSigmoid = function () { + this.throwIfDisposed(); + return opHandler.logSigmoid(this); + }; + Tensor.prototype.softplus = function () { + this.throwIfDisposed(); + return opHandler.softplus(this); + }; + Tensor.prototype.sin = function () { + this.throwIfDisposed(); + return opHandler.sin(this); + }; + Tensor.prototype.cos = function () { + this.throwIfDisposed(); + return opHandler.cos(this); + }; + Tensor.prototype.tan = function () { + this.throwIfDisposed(); + return opHandler.tan(this); + }; + Tensor.prototype.asin = function () { + this.throwIfDisposed(); + return opHandler.asin(this); + }; + Tensor.prototype.acos = function () { + this.throwIfDisposed(); + return opHandler.acos(this); + }; + Tensor.prototype.atan = function () { + this.throwIfDisposed(); + return opHandler.atan(this); + }; + Tensor.prototype.sinh = function () { + this.throwIfDisposed(); + return opHandler.sinh(this); + }; + Tensor.prototype.cosh = function () { + this.throwIfDisposed(); + return opHandler.cosh(this); + }; + Tensor.prototype.tanh = function () { + this.throwIfDisposed(); + return opHandler.tanh(this); + }; + Tensor.prototype.asinh = function () { + this.throwIfDisposed(); + return opHandler.asinh(this); + }; + Tensor.prototype.acosh = function () { + this.throwIfDisposed(); + return opHandler.acosh(this); + }; + Tensor.prototype.atanh = function () { + this.throwIfDisposed(); + return opHandler.atanh(this); + }; + Tensor.prototype.erf = function () { + this.throwIfDisposed(); + return opHandler.erf(this); + }; + Tensor.prototype.round = function () { + this.throwIfDisposed(); + return opHandler.round(this); + }; + Tensor.prototype.step = function (alpha) { + if (alpha === void 0) { alpha = 0.0; } + this.throwIfDisposed(); + return opHandler.step(this, alpha); + }; + Tensor.prototype.softmax = function (dim) { + if (dim === void 0) { dim = -1; } + this.throwIfDisposed(); + return opHandler.softmax(this, dim); + }; + Tensor.prototype.resizeBilinear = function (newShape2D, alignCorners) { + if (alignCorners === void 0) { alignCorners = false; } + this.throwIfDisposed(); + return opHandler.image.resizeBilinear(this, newShape2D, alignCorners); + }; + Tensor.prototype.resizeNearestNeighbor = function (newShape2D, alignCorners) { + if (alignCorners === void 0) { alignCorners = false; } + this.throwIfDisposed(); + return opHandler.image.resizeNearestNeighbor(this, newShape2D, alignCorners); + }; + Tensor.prototype.conv1d = function (filter, stride, pad, dataFormat, dilation, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NWC'; } + if (dilation === void 0) { dilation = 1; } + this.throwIfDisposed(); + return opHandler.conv1d(this, filter, stride, pad, dataFormat, dilation, dimRoundingMode); + }; + Tensor.prototype.conv2d = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + if (dilations === void 0) { dilations = [1, 1]; } + this.throwIfDisposed(); + return opHandler.conv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); + }; + Tensor.prototype.conv2dTranspose = function (filter, outputShape, strides, pad, dimRoundingMode) { + this.throwIfDisposed(); + return opHandler.conv2dTranspose(this, filter, outputShape, strides, pad, dimRoundingMode); + }; + Tensor.prototype.depthwiseConv2D = function (filter, strides, pad, dataFormat, dilations, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + if (dilations === void 0) { dilations = [1, 1]; } + this.throwIfDisposed(); + return opHandler.depthwiseConv2d(this, filter, strides, pad, dataFormat, dilations, dimRoundingMode); + }; + Tensor.prototype.avgPool = function (filterSize, strides, pad, dimRoundingMode) { + this.throwIfDisposed(); + return opHandler.avgPool(this, filterSize, strides, pad, dimRoundingMode); + }; + Tensor.prototype.maxPool = function (filterSize, strides, pad, dimRoundingMode) { + this.throwIfDisposed(); + return opHandler.maxPool(this, filterSize, strides, pad, dimRoundingMode); + }; + Tensor.prototype.localResponseNormalization = function (radius, bias, alpha, beta) { + if (radius === void 0) { radius = 5; } + if (bias === void 0) { bias = 1; } + if (alpha === void 0) { alpha = 1; } + if (beta === void 0) { beta = 0.5; } + return opHandler.localResponseNormalization(this, radius, bias, alpha, beta); + }; + Tensor.prototype.variable = function (trainable, name, dtype) { + if (trainable === void 0) { trainable = true; } + this.throwIfDisposed(); + return Variable.variable(this, trainable, name, dtype); + }; + Tensor.prototype.unsortedSegmentSum = function (segmentIds, numSegments) { + this.throwIfDisposed(); + return opHandler.unsortedSegmentSum(this, segmentIds, numSegments); + }; + Tensor.prototype.batchToSpaceND = function (blockShape, crops) { + this.throwIfDisposed(); + return opHandler.batchToSpaceND(this, blockShape, crops); + }; + Tensor.prototype.spaceToBatchND = function (blockShape, paddings) { + this.throwIfDisposed(); + return opHandler.spaceToBatchND(this, blockShape, paddings); + }; + Tensor.nextId = 0; + return Tensor; + }()); + Object.defineProperty(Tensor, Symbol.hasInstance, { + value: function (instance) { + return !!instance && instance.shape != null && instance.dtype != null; + } + }); + var Variable = (function (_super) { + __extends(Variable, _super); + function Variable(initialValue, trainable, name) { + if (trainable === void 0) { trainable = true; } + var _this = _super.call(this, initialValue.shape, initialValue.dtype, null, initialValue.dataId) || this; + _this.trainable = trainable; + _this.name = name; + if (_this.name == null) { + _this.name = Variable.nextVarId.toString(); + Variable.nextVarId++; + } + try { + trackerFn().registerVariable(_this); + } + catch (ex) { + trackerFn().disposeTensor(_this); + throw ex; + } + return _this; + } + Variable.variable = function (initialValue, trainable, name, dtype) { + if (trainable === void 0) { trainable = true; } + if (dtype != null && dtype !== initialValue.dtype) { + initialValue = initialValue.asType(dtype); + } + return new Variable(initialValue, trainable, name); + }; + Variable.prototype.assign = function (newValue) { + if (newValue.dtype !== this.dtype) { + throw new Error("dtype of the new value (" + newValue.dtype + ") and " + + ("previous value (" + this.dtype + ") must match")); + } + if (!arraysEqual(newValue.shape, this.shape)) { + throw new Error("shape of the new value (" + newValue.shape + ") and " + + ("previous value (" + this.shape + ") must match")); + } + trackerFn().disposeTensor(this); + this.dataId = newValue.dataId; + trackerFn().registerTensor(this); + }; + Variable.nextVarId = 0; + return Variable; + }(Tensor)); + Object.defineProperty(Variable, Symbol.hasInstance, { + value: function (instance) { + return instance instanceof Tensor && instance.assign != null && + instance.assign instanceof Function; + } + }); + var variable = Variable.variable; + + function assertTypesMatch(a, b) { + assert(a.dtype === b.dtype, " The dtypes of the first(" + a.dtype + ") and" + + (" second(" + b.dtype + ") input must match")); + } + function isTensorInList(tensor, tensorList) { + for (var i = 0; i < tensorList.length; i++) { + if (tensorList[i].id === tensor.id) { + return true; + } + } + return false; + } + function getTensorsInContainer(result) { + var list = []; + var seen = new Set(); + walkTensorContainer(result, list, seen); + return list; + } + function walkTensorContainer(container, list, seen) { + if (container == null) { + return; + } + if (container instanceof Tensor) { + list.push(container); + return; + } + if (!isIterable(container)) { + return; + } + var iterable = container; + for (var k in iterable) { + var val = iterable[k]; + if (!seen.has(val)) { + seen.add(val); + walkTensorContainer(val, list, seen); + } + } + } + function isIterable(obj) { + return Array.isArray(obj) || typeof obj === 'object'; + } + + var Engine = (function () { + function Engine(backend, safeMode, debugMode) { + this.backend = backend; + this.safeMode = safeMode; + this.debugMode = debugMode; + this.registeredVariables = {}; + this.refCounter = new WeakMap(); + this.nextTapeNodeId = 0; + this.numBytes = 0; + this.numTensors = 0; + this.numDataBuffers = 0; + this.gradientScopeCount = 0; + this.customGradientDepth = 0; + this.keepTensors = new Set(); + this.activeScope = { track: [], name: 'default scope' }; + this.scopeStack = [this.activeScope]; + this.profiler = new Profiler(backend); + } + Engine.prototype.tidy = function (nameOrFn, fn, gradMode) { + var _this = this; + if (gradMode === void 0) { gradMode = false; } + var name = null; + if (fn == null) { + if (typeof nameOrFn !== 'function') { + throw new Error('Please provide a function to tidy()'); + } + fn = nameOrFn; + } + else { + if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) { + throw new Error('When calling with two arguments, the first argument ' + + 'to tidy() must be a string'); + } + if (typeof fn !== 'function') { + throw new Error('When calling with two arguments, the 2nd argument ' + + 'to tidy() must be a function'); + } + name = nameOrFn; + } + var result; + return this.scopedRun(function () { return _this.startScope(name, gradMode); }, function () { return _this.endScope(result, gradMode); }, function () { + result = fn(); + if (result instanceof Promise) { + console.error('Cannot return a Promise inside of tidy.'); + } + return result; + }); + }; + Engine.prototype.scopedRun = function (start, end, f) { + start(); + try { + var res = f(); + end(); + return res; + } + catch (ex) { + end(); + throw ex; + } + }; + Engine.prototype.runKernel = function (forwardFunc, inputs, backwardsFunc) { + var _this = this; + var result; + var saved = []; + var saveFunc = function (x) { + saved.push(x); + return x; + }; + var scopeName = this.activeScope.name; + this.scopedRun(function () { return _this.customGradientDepth++; }, function () { return _this.customGradientDepth--; }, function () { + if (!_this.debugMode()) { + result = forwardFunc(_this.backend, saveFunc); + } + else { + result = _this.profiler.profileKernel(scopeName, function () { return forwardFunc(_this.backend, saveFunc); }); + } + }); + if (this.shouldRecord()) { + var tapeNode = { + id: this.nextTapeNodeId++, + name: scopeName, + inputs: inputs, + output: Array.isArray(result) ? result[0] : result + }; + if (backwardsFunc != null) { + tapeNode.gradient = + (function (dy) { return backwardsFunc(dy, saved); }); + } + this.activeTape.push(tapeNode); + } + return result; + }; + Engine.prototype.registerTensor = function (a) { + var refCount = this.refCounter.has(a.dataId) ? this.refCounter.get(a.dataId) : 0; + this.numTensors++; + if (refCount === 0) { + this.numDataBuffers++; + this.numBytes += + sizeFromShape(a.shape) * bytesPerElement(a.dtype); + this.backend.register(a.dataId, a.shape, a.dtype); + } + this.refCounter.set(a.dataId, refCount + 1); + if (!(a instanceof Variable)) { + this.track(a); + } + }; + Engine.prototype.registerVariable = function (v) { + if (this.registeredVariables[v.name] != null) { + throw new Error("Variable with name " + v.name + " was already registered"); + } + this.registeredVariables[v.name] = v; + }; + Engine.prototype.disposeTensor = function (a) { + if (!this.refCounter.has(a.dataId)) { + return; + } + if (this.keepTensors.has(a.id)) { + this.keepTensors.delete(a.id); + } + this.numTensors--; + var refCount = this.refCounter.get(a.dataId); + if (refCount <= 1) { + this.refCounter.delete(a.dataId); + this.backend.disposeData(a.dataId); + this.numDataBuffers--; + this.numBytes -= + sizeFromShape(a.shape) * bytesPerElement(a.dtype); + } + else { + this.refCounter.set(a.dataId, refCount - 1); + } + }; + Engine.prototype.disposeVariables = function () { + for (var varName in this.registeredVariables) { + var v = this.registeredVariables[varName]; + this.disposeTensor(v); + delete this.registeredVariables[varName]; + } + }; + Engine.prototype.memory = function () { + var info = this.backend.memory(); + info.numTensors = this.numTensors; + info.numDataBuffers = this.numDataBuffers; + info.numBytes = this.numBytes; + return info; + }; + Engine.prototype.shouldRecord = function () { + return this.activeTape != null && this.customGradientDepth === 0; + }; + Engine.prototype.addTapeNode = function (inputs, result, gradientsFunc) { + var inputsMap = {}; + inputs.forEach(function (input, idx) { + inputsMap[idx] = input; + }); + var gradient = function (dy) { + var res = gradientsFunc(dy); + var resMap = {}; + res.forEach(function (r, idx) { + resMap[idx] = function () { return r; }; + }); + return resMap; + }; + var tapeNode = { + id: this.nextTapeNodeId++, + name: this.activeScope.name, + inputs: inputsMap, + output: result, + gradient: gradient + }; + this.activeTape.push(tapeNode); + }; + Engine.prototype.keep = function (result) { + if (this.scopeStack.length === 1 && this.safeMode) { + throw new Error('Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' + + 'tf.tidy(() => {...}) to avoid memory leaks.'); + } + this.keepTensors.add(result.id); + return result; + }; + Engine.prototype.startScope = function (name, gradientsMode) { + if (gradientsMode === void 0) { gradientsMode = false; } + if (gradientsMode && this.gradientScopeCount === 0) { + this.activeTape = []; + } + if (gradientsMode) { + this.gradientScopeCount++; + } + var scopeInfo = { track: [], name: 'unnamed scope' }; + if (name) { + scopeInfo.name = name; + } + this.scopeStack.push(scopeInfo); + this.activeScope = scopeInfo; + }; + Engine.prototype.endScope = function (result, gradientsMode) { + var _this = this; + if (gradientsMode === void 0) { gradientsMode = false; } + if (gradientsMode) { + this.gradientScopeCount--; + if (this.gradientScopeCount === 0) { + this.activeTape = null; + } + } + var tensorsToKeep = new Set(this.keepTensors); + var tensorsToTrackInParent = getTensorsInContainer(result); + tensorsToTrackInParent.forEach(function (tensor) { return tensorsToKeep.add(tensor.id); }); + for (var i = 0; i < this.activeScope.track.length; i++) { + var tensor = this.activeScope.track[i]; + if (tensorsToKeep.has(tensor.id)) { + continue; + } + if (this.activeTape != null) { + tensorsToTrackInParent.push(tensor); + } + else { + tensor.dispose(); + } + } + var oldScope = this.scopeStack.pop(); + this.activeScope = this.scopeStack.length === 0 ? + { track: [], name: 'default scope' } : + this.scopeStack[this.scopeStack.length - 1]; + tensorsToTrackInParent.forEach(function (tensor) { + if (!_this.keepTensors.has(tensor.id) && + isTensorInList(tensor, oldScope.track)) { + _this.track(tensor); + } + }); + }; + Engine.prototype.gradients = function (f, xs, dy, allowNoGradients) { + var _this = this; + if (allowNoGradients === void 0) { allowNoGradients = false; } + assert(xs.length > 0, 'gradients() received an empty list of xs.'); + return this.tidy('gradients', function () { + var y = f(); + assert(y instanceof Tensor, 'The result y returned by f() must be a tensor.'); + var filteredTape = getFilteredNodesXToY(_this.activeTape, xs, y); + if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) { + throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' + + 'that the f you passed encloses all operations that lead from x ' + + 'to y.'); + } + var accumulatedGradientMap = {}; + accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy; + backpropagateGradients(accumulatedGradientMap, filteredTape); + var grads = xs.map(function (x) { return accumulatedGradientMap[x.id]; }); + return { value: y, grads: grads }; + }, true); + }; + Engine.prototype.customGrad = function (f) { + var _this = this; + assert(isFunction(f), 'The f passed in customGrad(f) must be a function.'); + return function () { + var inputs = []; + for (var _i = 0; _i < arguments.length; _i++) { + inputs[_i] = arguments[_i]; + } + assert(inputs.every(function (t) { return t instanceof Tensor; }), 'The args passed in customGrad(f)(x1, x2,...) must all be tensors'); + var gradientsFunc; + var result; + _this.scopedRun(function () { return _this.customGradientDepth++; }, function () { return _this.customGradientDepth--; }, function () { + var gradientsMode = true; + result = _this.tidy(f.name, function () { + var _a = f.apply(void 0, inputs), value = _a.value, gradFunc = _a.gradFunc; + assert(value instanceof Tensor, 'The function f passed in customGrad(f) must return an ' + + 'object where `obj.value` is a tensor'); + assert(isFunction(gradFunc), 'The function f passed in customGrad(f) must return an ' + + 'object where `obj.gradFunc` is a function.'); + gradientsFunc = gradFunc; + return value; + }, gradientsMode); + }); + if (_this.shouldRecord()) { + var gradFunc = function (dy) { + var res = gradientsFunc(dy); + var grads = Array.isArray(res) ? res : [res]; + assert(grads.length === inputs.length, 'The function f passed in customGrad(f) must return an object ' + + 'where `obj.gradFunc` is a function that returns the same ' + + 'number of tensors as inputs passed to f(...).'); + assert(grads.every(function (t) { return t instanceof Tensor; }), 'The function f passed in customGrad(f) must return an object ' + + 'where `obj.gradFunc` is a function that returns a list of ' + + 'only tensors.'); + return grads; + }; + _this.addTapeNode(inputs, result, gradFunc); + } + return result; + }; + }; + Engine.prototype.write = function (dataId, values) { + this.backend.write(dataId, values); + }; + Engine.prototype.readSync = function (dataId) { + return this.backend.readSync(dataId); + }; + Engine.prototype.read = function (dataId) { + return this.backend.read(dataId); + }; + Engine.prototype.fromPixels = function (pixels, numChannels) { + return this.backend.fromPixels(pixels, numChannels); + }; + Engine.prototype.time = function (query) { + return __awaiter(this, void 0, void 0, function () { + var start, timingInfo; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + start = now(); + return [4, this.backend.time(query)]; + case 1: + timingInfo = _a.sent(); + timingInfo.wallMs = now() - start; + return [2, timingInfo]; + } + }); + }); + }; + Engine.prototype.track = function (result) { + if (this.scopeStack.length === 1 && this.safeMode) { + throw new Error('Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' + + 'tf.tidy(() => {op();...}); to avoid memory leaks.'); + } + this.activeScope.track.push(result); + return result; + }; + return Engine; + }()); + function ones(shape) { + var values = makeOnesTypedArray(sizeFromShape(shape), 'float32'); + return Tensor.make(shape, { values: values }); + } + + var Type; + (function (Type) { + Type[Type["NUMBER"] = 0] = "NUMBER"; + Type[Type["BOOLEAN"] = 1] = "BOOLEAN"; + Type[Type["STRING"] = 2] = "STRING"; + })(Type || (Type = {})); + var URL_PROPERTIES = [ + { name: 'DEBUG', type: Type.BOOLEAN }, { name: 'IS_BROWSER', type: Type.BOOLEAN }, + { name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION', type: Type.NUMBER }, + { name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE', type: Type.BOOLEAN }, + { name: 'WEBGL_VERSION', type: Type.NUMBER }, + { name: 'WEBGL_RENDER_FLOAT32_ENABLED', type: Type.BOOLEAN }, + { name: 'WEBGL_DOWNLOAD_FLOAT_ENABLED', type: Type.BOOLEAN }, + { name: 'WEBGL_FENCE_API_ENABLED', type: Type.BOOLEAN }, + { name: 'BACKEND', type: Type.STRING } + ]; + function isWebGLVersionEnabled(webGLVersion, isBrowser) { + var gl; + try { + gl = getWebGLRenderingContext(webGLVersion, isBrowser); + } + catch (e) { + return false; + } + if (gl != null) { + loseContext(gl); + return true; + } + return false; + } + function getWebGLDisjointQueryTimerVersion(webGLVersion, isBrowser) { + if (webGLVersion === 0) { + return 0; + } + var queryTimerVersion; + var gl = getWebGLRenderingContext(webGLVersion, isBrowser); + if (hasExtension(gl, 'EXT_disjoint_timer_query_webgl2') && + webGLVersion === 2) { + queryTimerVersion = 2; + } + else if (hasExtension(gl, 'EXT_disjoint_timer_query')) { + queryTimerVersion = 1; + } + else { + queryTimerVersion = 0; + } + if (gl != null) { + loseContext(gl); + } + return queryTimerVersion; + } + function isRenderToFloatTextureEnabled(webGLVersion, isBrowser) { + if (webGLVersion === 0) { + return false; + } + var gl = getWebGLRenderingContext(webGLVersion, isBrowser); + if (webGLVersion === 1) { + if (!hasExtension(gl, 'OES_texture_float')) { + return false; + } + } + else { + if (!hasExtension(gl, 'EXT_color_buffer_float')) { + return false; + } + } + createFloatTextureAndBindToFramebuffer(gl, webGLVersion); + var isFrameBufferComplete = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE; + loseContext(gl); + return isFrameBufferComplete; + } + function isDownloadFloatTextureEnabled(webGLVersion, isBrowser) { + if (webGLVersion === 0) { + return false; + } + var gl = getWebGLRenderingContext(webGLVersion, isBrowser); + if (webGLVersion === 1) { + if (!hasExtension(gl, 'OES_texture_float')) { + return false; + } + } + else { + if (!hasExtension(gl, 'EXT_color_buffer_float')) { + return false; + } + } + createFloatTextureAndBindToFramebuffer(gl, webGLVersion); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, new Float32Array(4)); + var readPixelsNoError = gl.getError() === gl.NO_ERROR; + loseContext(gl); + return readPixelsNoError; + } + function isWebGLFenceEnabled(webGLVersion, isBrowser) { + if (webGLVersion !== 2) { + return false; + } + var gl = getWebGLRenderingContext(webGLVersion, isBrowser); + var isEnabled = gl.fenceSync != null; + loseContext(gl); + return isEnabled; + } + function isChrome() { + return typeof navigator !== 'undefined' && navigator != null && + navigator.userAgent != null && /Chrome/.test(navigator.userAgent) && + /Google Inc/.test(navigator.vendor); + } + var TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags'; + function getFeaturesFromURL() { + var features = {}; + if (typeof window === 'undefined' || typeof window.location === 'undefined') { + return features; + } + var urlParams = getQueryParams(window.location.search); + if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) { + var urlFlags_1 = {}; + var keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(','); + keyValues.forEach(function (keyValue) { + var _a = keyValue.split(':'), key = _a[0], value = _a[1]; + urlFlags_1[key] = value; + }); + URL_PROPERTIES.forEach(function (urlProperty) { + if (urlProperty.name in urlFlags_1) { + console.log("Setting feature override from URL " + urlProperty.name + ": " + + ("" + urlFlags_1[urlProperty.name])); + if (urlProperty.type === Type.NUMBER) { + features[urlProperty.name] = +urlFlags_1[urlProperty.name]; + } + else if (urlProperty.type === Type.BOOLEAN) { + features[urlProperty.name] = urlFlags_1[urlProperty.name] === 'true'; + } + else if (urlProperty.type === Type.STRING) { + features[urlProperty.name] = urlFlags_1[urlProperty.name]; + } + else { + console.warn("Unknown URL param: " + urlProperty.name + "."); + } + } + }); + } + return features; + } + function hasExtension(gl, extensionName) { + var ext = gl.getExtension(extensionName); + return ext != null; + } + function getWebGLRenderingContext(webGLVersion, isBrowser) { + if (webGLVersion === 0 || !isBrowser) { + throw new Error('Cannot get WebGL rendering context, WebGL is disabled.'); + } + var tempCanvas = document.createElement('canvas'); + if (webGLVersion === 1) { + return (tempCanvas.getContext('webgl') || + tempCanvas.getContext('experimental-webgl')); + } + return tempCanvas.getContext('webgl2'); + } + function loseContext(gl) { + if (gl != null) { + var loseContextExtension = gl.getExtension('WEBGL_lose_context'); + if (loseContextExtension == null) { + throw new Error('Extension WEBGL_lose_context not supported on this browser.'); + } + loseContextExtension.loseContext(); + } + } + function createFloatTextureAndBindToFramebuffer(gl, webGLVersion) { + var frameBuffer = gl.createFramebuffer(); + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + var internalFormat = webGLVersion === 2 ? gl.RGBA32F : gl.RGBA; + gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null); + gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + } + function getQueryParams(queryString) { + var params = {}; + queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, function (s) { + var t = []; + for (var _i = 1; _i < arguments.length; _i++) { + t[_i - 1] = arguments[_i]; + } + decodeParam(params, t[0], t[1]); + return t.join('='); + }); + return params; + } + function decodeParam(params, name, value) { + params[decodeURIComponent(name)] = decodeURIComponent(value || ''); + } + + var TEST_EPSILON_FLOAT32_ENABLED = 1e-3; + var TEST_EPSILON_FLOAT32_DISABLED = 1e-1; + var Environment = (function () { + function Environment(features) { + this.features = {}; + this.registry = {}; + if (features != null) { + this.features = features; + } + if (this.get('DEBUG')) { + console.warn('Debugging mode is ON. The output of every math call will ' + + 'be downloaded to CPU and checked for NaNs. ' + + 'This significantly impacts performance.'); + } + } + Environment.setBackend = function (backendName, safeMode) { + if (safeMode === void 0) { safeMode = false; } + if (!(backendName in ENV.registry)) { + throw new Error("Backend name '" + backendName + "' not found in registry"); + } + ENV.initBackend(backendName, safeMode); + }; + Environment.getBackend = function () { + ENV.initDefaultBackend(); + return ENV.backendName; + }; + Environment.disposeVariables = function () { + ENV.engine.disposeVariables(); + }; + Environment.memory = function () { + return ENV.engine.memory(); + }; + Environment.tidy = function (nameOrFn, fn, gradMode) { + if (gradMode === void 0) { gradMode = false; } + return ENV.engine.tidy(nameOrFn, fn, gradMode); + }; + Environment.dispose = function (container) { + var tensors = getTensorsInContainer(container); + tensors.forEach(function (tensor) { return tensor.dispose(); }); + }; + Environment.keep = function (result) { + return ENV.engine.keep(result); + }; + Environment.time = function (f) { + return ENV.engine.time(f); + }; + Environment.prototype.get = function (feature) { + if (feature in this.features) { + return this.features[feature]; + } + this.features[feature] = this.evaluateFeature(feature); + return this.features[feature]; + }; + Environment.prototype.getFeatures = function () { + return this.features; + }; + Environment.prototype.set = function (feature, value) { + this.features[feature] = value; + }; + Environment.prototype.getBestBackendName = function () { + var _this = this; + if (Object.keys(this.registry).length === 0) { + throw new Error('No backend found in registry.'); + } + var sortedBackends = Object.keys(this.registry) + .map(function (name) { + return { name: name, entry: _this.registry[name] }; + }) + .sort(function (a, b) { + return b.entry.priority - a.entry.priority; + }); + return sortedBackends[0].name; + }; + Environment.prototype.evaluateFeature = function (feature) { + if (feature === 'DEBUG') { + return false; + } + else if (feature === 'IS_BROWSER') { + return typeof window !== 'undefined'; + } + else if (feature === 'IS_NODE') { + return (typeof process !== 'undefined') && + (typeof process.versions.node !== 'undefined'); + } + else if (feature === 'IS_CHROME') { + return isChrome(); + } + else if (feature === 'IS_TEST') { + return false; + } + else if (feature === 'BACKEND') { + return this.getBestBackendName(); + } + else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') { + var webGLVersion = this.get('WEBGL_VERSION'); + if (webGLVersion === 0) { + return 0; + } + if (webGLVersion > 0) { + return 0; + } + return getWebGLDisjointQueryTimerVersion(webGLVersion, this.get('IS_BROWSER')); + } + else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE') { + return this.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0 && + !isMobile(); + } + else if (feature === 'HAS_WEBGL') { + return this.get('WEBGL_VERSION') > 0; + } + else if (feature === 'WEBGL_VERSION') { + if (isWebGLVersionEnabled(2, this.get('IS_BROWSER'))) { + return 2; + } + else if (isWebGLVersionEnabled(1, this.get('IS_BROWSER'))) { + return 1; + } + return 0; + } + else if (feature === 'WEBGL_RENDER_FLOAT32_ENABLED') { + return isRenderToFloatTextureEnabled(this.get('WEBGL_VERSION'), this.get('IS_BROWSER')); + } + else if (feature === 'WEBGL_DOWNLOAD_FLOAT_ENABLED') { + return isDownloadFloatTextureEnabled(this.get('WEBGL_VERSION'), this.get('IS_BROWSER')); + } + else if (feature === 'WEBGL_FENCE_API_ENABLED') { + return isWebGLFenceEnabled(this.get('WEBGL_VERSION'), this.get('IS_BROWSER')); + } + else if (feature === 'TEST_EPSILON') { + if (this.get('WEBGL_RENDER_FLOAT32_ENABLED')) { + return TEST_EPSILON_FLOAT32_ENABLED; + } + return TEST_EPSILON_FLOAT32_DISABLED; + } + throw new Error("Unknown feature " + feature + "."); + }; + Environment.prototype.setFeatures = function (features) { + this.features = Object.assign({}, features); + }; + Environment.prototype.reset = function () { + this.features = getFeaturesFromURL(); + if (this.globalEngine != null) { + this.globalEngine = null; + } + }; + Environment.prototype.initBackend = function (backendName, safeMode) { + var _this = this; + if (safeMode === void 0) { safeMode = false; } + this.backendName = backendName; + this.backend = this.findBackend(backendName); + this.globalEngine = + new Engine(this.backend, safeMode, function () { return _this.get('DEBUG'); }); + }; + Environment.prototype.findBackend = function (name) { + if (!(name in this.registry)) { + return null; + } + return this.registry[name].backend; + }; + Environment.prototype.registerBackend = function (name, factory, priority, setTensorTrackerFn) { + var _this = this; + if (priority === void 0) { priority = 1; } + if (name in this.registry) { + console.warn(name + " backend was already registered. Reusing existing backend"); + if (setTensorTrackerFn != null) { + setTensorTrackerFn(function () { return _this.engine; }); + } + return false; + } + try { + var backend = factory(); + this.registry[name] = { backend: backend, priority: priority }; + return true; + } + catch (err) { + console.warn("Registration of backend " + name + " failed"); + console.warn(err.stack || err.message); + return false; + } + }; + Environment.prototype.removeBackend = function (name) { + if (!(name in this.registry)) { + throw new Error(name + " backend not found in registry"); + } + this.registry[name].backend.dispose(); + delete this.registry[name]; + }; + Object.defineProperty(Environment.prototype, "engine", { + get: function () { + this.initDefaultBackend(); + return this.globalEngine; + }, + enumerable: true, + configurable: true + }); + Environment.prototype.initDefaultBackend = function () { + if (this.globalEngine == null) { + this.initBackend(this.get('BACKEND'), false); + } + }; + return Environment; + }()); + function getGlobalNamespace() { + var ns; + if (typeof (window) !== 'undefined') { + ns = window; + } + else if (typeof (process) !== 'undefined') { + ns = process; + } + else { + throw new Error('Could not find a global object'); + } + return ns; + } + function getOrMakeEnvironment() { + var ns = getGlobalNamespace(); + if (ns.ENV == null) { + ns.ENV = new Environment(getFeaturesFromURL()); + setTensorTracker(function () { return ns.ENV.engine; }); + } + return ns.ENV; + } + var ENV = getOrMakeEnvironment(); + + var environment = /*#__PURE__*/Object.freeze({ + Environment: Environment, + ENV: ENV + }); + + function warn() { + var msg = []; + for (var _i = 0; _i < arguments.length; _i++) { + msg[_i] = arguments[_i]; + } + if (!ENV.get('IS_TEST')) { + console.warn.apply(console, msg); + } + } + + function getReshaped(inputShape, blockShape, prod, batchToSpace) { + if (batchToSpace === void 0) { batchToSpace = true; } + var reshaped = []; + if (batchToSpace) { + reshaped = reshaped.concat(blockShape.slice(0)); + reshaped.push(inputShape[0] / prod); + reshaped = reshaped.concat(inputShape.slice(1)); + } + else { + reshaped = reshaped.concat(inputShape[0]); + var spatialLength = blockShape.length; + for (var i = 0; i < spatialLength; ++i) { + reshaped = + reshaped.concat([inputShape[i + 1] / blockShape[i], blockShape[i]]); + } + reshaped = reshaped.concat(inputShape.slice(spatialLength + 1)); + } + return reshaped; + } + function getPermuted(reshapedRank, blockShapeRank, batchToSpace) { + if (batchToSpace === void 0) { batchToSpace = true; } + var permuted = []; + if (batchToSpace) { + permuted.push(blockShapeRank); + for (var i = blockShapeRank + 1; i < reshapedRank; ++i) { + if (i <= 2 * blockShapeRank) { + permuted.push(i); + permuted.push(i - (blockShapeRank + 1)); + } + else { + permuted.push(i); + } + } + } + else { + var permutedBeforeBatch = []; + var permutedAfterBatch = []; + for (var i = 1; i < reshapedRank; ++i) { + if (i >= blockShapeRank * 2 + 1 || i % 2 === 1) { + permutedAfterBatch.push(i); + } + else { + permutedBeforeBatch.push(i); + } + } + permuted.push.apply(permuted, permutedBeforeBatch); + permuted.push(0); + permuted.push.apply(permuted, permutedAfterBatch); + } + return permuted; + } + function getReshapedPermuted(inputShape, blockShape, prod, batchToSpace) { + if (batchToSpace === void 0) { batchToSpace = true; } + var reshapedPermuted = []; + if (batchToSpace) { + reshapedPermuted.push(inputShape[0] / prod); + } + else { + reshapedPermuted.push(inputShape[0] * prod); + } + for (var i = 1; i < inputShape.length; ++i) { + if (i <= blockShape.length) { + if (batchToSpace) { + reshapedPermuted.push(blockShape[i - 1] * inputShape[i]); + } + else { + reshapedPermuted.push(inputShape[i] / blockShape[i - 1]); + } + } + else { + reshapedPermuted.push(inputShape[i]); + } + } + return reshapedPermuted; + } + function getSliceBeginCoords(crops, blockShape) { + var sliceBeginCoords = [0]; + for (var i = 0; i < blockShape; ++i) { + sliceBeginCoords.push(crops[i][0]); + } + return sliceBeginCoords; + } + function getSliceSize(uncroppedShape, crops, blockShape) { + var sliceSize = uncroppedShape.slice(0, 1); + for (var i = 0; i < blockShape; ++i) { + sliceSize.push(uncroppedShape[i + 1] - crops[i][0] - crops[i][1]); + } + return sliceSize; + } + + function axesAreInnerMostDims(axes, rank) { + for (var i = 0; i < axes.length; ++i) { + if (axes[axes.length - i - 1] !== rank - 1 - i) { + return false; + } + } + return true; + } + function combineLocations(outputLoc, reduceLoc, axes) { + var rank = outputLoc.length + reduceLoc.length; + var loc = []; + var outIdx = 0; + var reduceIdx = 0; + for (var dim = 0; dim < rank; dim++) { + if (axes.indexOf(dim) === -1) { + loc.push(outputLoc[outIdx++]); + } + else { + loc.push(reduceLoc[reduceIdx++]); + } + } + return loc; + } + function computeOutAndReduceShapes(aShape, axes) { + var outShape = []; + var rank = aShape.length; + for (var dim = 0; dim < rank; dim++) { + if (axes.indexOf(dim) === -1) { + outShape.push(aShape[dim]); + } + } + var reduceShape = axes.map(function (dim) { return aShape[dim]; }); + return [outShape, reduceShape]; + } + function expandShapeToKeepDim(shape, axes) { + var reduceSubShape = axes.map(function (x) { return 1; }); + return combineLocations(shape, reduceSubShape, axes); + } + function parseAxisParam(axis, shape) { + var rank = shape.length; + axis = axis == null ? shape.map(function (s, i) { return i; }) : [].concat(axis); + assert(axis.every(function (ax) { return ax >= -rank && ax < rank; }), "All values in axis param must be in range [-" + rank + ", " + rank + ") but " + + ("got axis " + axis)); + assert(axis.every(function (ax) { return isInt(ax); }), "All values in axis param must be integers but " + + ("got axis " + axis)); + return axis.map(function (a) { return a < 0 ? rank + a : a; }); + } + function assertAxesAreInnerMostDims(msg, axes, rank) { + assert(axesAreInnerMostDims(axes, rank), msg + " supports only inner-most axes for now. " + + ("Got axes " + axes + " and rank-" + rank + " input.")); + } + function getAxesPermutation(axes, rank) { + if (axesAreInnerMostDims(axes, rank)) { + return null; + } + var result = []; + for (var i = 0; i < rank; ++i) { + if (axes.indexOf(i) === -1) { + result.push(i); + } + } + axes.forEach(function (axis) { return result.push(axis); }); + return result; + } + function getUndoAxesPermutation(axes) { + return axes.map(function (axis, i) { return [i, axis]; }) + .sort(function (a, b) { return a[1] - b[1]; }) + .map(function (x) { return x[0]; }); + } + function getInnerMostAxes(numAxes, rank) { + var res = []; + for (var i = rank - numAxes; i < rank; ++i) { + res.push(i); + } + return res; + } + + var PARALLELIZE_THRESHOLD = 30; + function computeOptimalWindowSize(inSize) { + if (inSize <= PARALLELIZE_THRESHOLD) { + return inSize; + } + return nearestDivisor(inSize, Math.floor(Math.sqrt(inSize))); + } + + function segOpComputeOptimalWindowSize(inSize, numSegments) { + var done = false; + var res; + if (inSize <= PARALLELIZE_THRESHOLD) { + res = inSize; + done = true; + } + else { + res = nearestDivisor(inSize, Math.floor(Math.sqrt(inSize))); + } + while (!done) { + if (res > numSegments || res === inSize) { + done = true; + break; + } + else { + res = nearestDivisor(inSize, res + 1); + } + } + return res; + } + function computeOutShape(aShape, axis, numSegments) { + var outShape = []; + var rank = aShape.length; + for (var dim = 0; dim < rank; dim++) { + if (dim !== axis) { + outShape.push(aShape[dim]); + } + else { + outShape.push(numSegments); + } + } + return outShape; + } + + function assertParamsValid(input, begin, size) { + assert(input.rank === begin.length, "Error in slice" + input.rank + "D: Length of begin " + begin + " must " + + ("match the rank of the array (" + input.rank + ").")); + assert(input.rank === size.length, "Error in slice" + input.rank + "D: Length of size " + size + " must " + + ("match the rank of the array (" + input.rank + ").")); + for (var i = 0; i < input.rank; ++i) { + assert(begin[i] + size[i] <= input.shape[i], "Error in slice" + input.rank + "D: begin[" + i + "] + size[" + i + "] " + + ("(" + (begin[i] + size[i]) + ") would overflow input.shape[" + i + "] (" + input.shape[i] + ")")); + } + } + function getStridedSlicedInfo(shape, begin, end, strides, beginMask, endMask) { + if (beginMask === void 0) { beginMask = 0; } + if (endMask === void 0) { endMask = 0; } + var startIndex = []; + var endIndex = []; + for (var i = 0; i < shape.length; i++) { + startIndex[i] = startForAxis(beginMask, begin, strides, shape, i); + endIndex[i] = stopForAxis(endMask, end, strides, shape, i); + } + var size = new Array(shape.length).fill(0); + size = size.map(function (d, i) { + var count = 0; + for (var start = startIndex[i]; !(strides[i] > 0 ? start >= endIndex[i] : start <= endIndex[i]); start += strides[i]) { + count += 1; + } + return count; + }); + return [startIndex, size]; + } + function startForAxis(beginMask, startIndices, strides, inputShape, axis) { + var start = startIndices[axis]; + if (beginMask & 1 << axis) { + if (strides[axis] > 0) { + start = Number.MIN_SAFE_INTEGER; + } + else { + start = Number.MAX_SAFE_INTEGER; + } + } + var axisSize = inputShape[axis]; + if (start < 0) { + start += axisSize; + } + start = clamp(0, start, axisSize - 1); + return start; + } + function stopForAxis(endMask, stopIndices, strides, inputShape, axis) { + var stop = stopIndices[axis]; + if (endMask & (1 << axis)) { + if (strides[axis] > 0) { + stop = Number.MAX_SAFE_INTEGER; + } + else { + stop = Number.MIN_SAFE_INTEGER; + } + } + var axisSize = inputShape[axis]; + if (stop < 0) { + stop += axisSize; + } + if (strides[axis] > 0) { + stop = clamp(0, stop, axisSize); + } + else { + stop = clamp(-1, stop, axisSize - 1); + } + return stop; + } + + function grad(f) { + assert(isFunction(f), 'The f passed in grad(f) must be a function'); + return function (x, dy) { + assert(x instanceof Tensor, 'The x passed in grad(f)(x) must be a tensor'); + assert(dy == null || dy instanceof Tensor, 'The dy passed in grad(f)(x, dy) must be a tensor'); + return ENV.engine.tidy(function () { + var _a = ENV.engine.gradients(function () { return f(x); }, [x], dy), value = _a.value, grads = _a.grads; + if (dy != null) { + assertShapesMatch(value.shape, dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' + + 'returned by f(x)'); + } + checkGrads(grads); + return grads[0]; + }); + }; + } + function grads(f) { + assert(isFunction(f), 'The f passed in grads(f) must be a function'); + return function (args, dy) { + assert(Array.isArray(args) && args.every(function (arg) { return arg instanceof Tensor; }), 'The args passed in grads(f)(args) must be an array of tensors'); + assert(dy == null || dy instanceof Tensor, 'The dy passed in grads(f)(args, dy) must be a tensor'); + return ENV.engine.tidy(function () { + var _a = ENV.engine.gradients(function () { return f.apply(void 0, args); }, args, dy), value = _a.value, grads = _a.grads; + if (dy != null) { + assertShapesMatch(value.shape, dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' + + 'match the shape returned by f([x1,...])'); + } + checkGrads(grads); + return grads; + }); + }; + } + function valueAndGrad(f) { + assert(isFunction(f), 'The f passed in valueAndGrad(f) must be a function'); + return function (x, dy) { + assert(x instanceof Tensor, 'The x passed in valueAndGrad(f)(x) must be a tensor'); + assert(dy == null || dy instanceof Tensor, 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor'); + var _a = ENV.engine.gradients(function () { return f(x); }, [x], dy), grads = _a.grads, value = _a.value; + checkGrads(grads); + return { grad: grads[0], value: value }; + }; + } + function valueAndGrads(f) { + assert(isFunction(f), 'The f passed in valueAndGrads(f) must be a function'); + return function (args, dy) { + assert(Array.isArray(args) && args.every(function (arg) { return arg instanceof Tensor; }), 'The args passed in valueAndGrads(f)(args) must be array of tensors'); + assert(dy == null || dy instanceof Tensor, 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor'); + var res = ENV.engine.gradients(function () { return f.apply(void 0, args); }, args, dy); + if (dy != null) { + assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' + + 'match the shape returned by f([x1,...])'); + } + checkGrads(res.grads); + return res; + }; + } + function variableGrads(f, varList) { + assert(isFunction(f), 'The f passed in variableGrads(f) must be a function'); + assert(varList == null || + Array.isArray(varList) && varList.every(function (v) { return v instanceof Variable; }), 'The varList passed in variableGrads(f, varList) must be an array ' + + 'of variables'); + if (varList == null) { + varList = []; + for (var varName in ENV.engine.registeredVariables) { + varList.push(ENV.engine.registeredVariables[varName]); + } + } + var originalVarCount = varList.length; + varList = varList.filter(function (variable$$1) { return variable$$1.trainable; }); + assert(varList.length > 0, "variableGrads() expects at least one of the input variables to be " + + ("trainable, but none of the " + originalVarCount + " variables is ") + + "trainable."); + var allowNoGradients = true; + var _a = ENV.engine.gradients(f, varList, null, allowNoGradients), value = _a.value, grads = _a.grads; + assert(grads.some(function (g) { return g != null; }), 'Cannot find a connection between any variable and the result of the ' + + 'loss function y=f(x). Please make sure the operations that use ' + + 'variables are inside the function f passed to minimize().'); + assert(value.rank === 0, "The f passed in variableGrads(f) must return a scalar, but it " + + ("returned a rank-" + value.rank + " tensor")); + var namedGrads = {}; + varList.forEach(function (v, i) { + if (grads[i] != null) { + namedGrads[v.name] = grads[i]; + } + }); + return { value: value, grads: namedGrads }; + } + function customGrad(f) { + return ENV.engine.customGrad(f); + } + function checkGrads(grads) { + var numNullGradients = grads.filter(function (g) { return g == null; }).length; + if (numNullGradients > 0) { + throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y."); + } + } + + function convertToTensor(x, argName, functionName, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + dtype = dtype || 'float32'; + if (x instanceof Tensor) { + return x; + } + if (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' && + typeof x !== 'boolean') { + throw new Error("Argument '" + argName + "' passed to '" + functionName + "' must be a " + + ("Tensor or TensorLike, but got " + x.constructor.name)); + } + var inferredShape = inferShape(x); + if (!isTypedArray(x) && !Array.isArray(x)) { + x = [x]; + } + return Tensor.make(inferredShape, { values: toTypedArray(x, dtype, ENV.get('DEBUG')) }, dtype); + } + function convertToTensorArray(arg, argName, functionName) { + if (!Array.isArray(arg)) { + throw new Error("Argument " + argName + " passed to " + functionName + " must be a " + + '`Tensor[]` or `TensorLike[]`'); + } + var tensors = arg; + return tensors.map(function (t, i) { return convertToTensor(t, argName + "[" + i + "]", functionName); }); + } + + function op(f) { + var keys = Object.keys(f); + if (keys.length !== 1) { + throw new Error("Please provide an object with a single key " + + "(operation name) mapping to a function. Got an object with " + + (keys.length + " keys.")); + } + var opName = keys[0]; + var fn = f[opName]; + if (opName.endsWith('_')) { + opName = opName.substring(0, opName.length - 1); + } + var f2 = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + ENV.engine.startScope(opName); + try { + var result = fn.apply(void 0, args); + if (result instanceof Promise) { + console.error('Cannot return a Promise inside of tidy.'); + } + ENV.engine.endScope(result); + return result; + } + catch (ex) { + ENV.engine.endScope(null); + throw ex; + } + }; + Object.defineProperty(f2, 'name', { value: opName, configurable: true }); + return f2; + } + + function softmax_(logits, dim) { + if (dim === void 0) { dim = -1; } + var $logits = convertToTensor(logits, 'logits', 'softmax'); + if (dim === -1) { + dim = $logits.rank - 1; + } + if (dim !== $logits.rank - 1) { + throw Error('Softmax along a non-last dimension is not yet supported. ' + + ("Logits was rank " + $logits.rank + " and dim was " + dim)); + } + var customOp = customGrad(function (logits) { + var keepDims = true; + var lse = logits.logSumExp([dim], keepDims); + var logResult = logits.toFloat().sub(lse); + var y = logResult.exp(); + var gradFunc = function (dy) { + var dyTimesY = dy.mul(y); + var keepDims = true; + return dyTimesY.sub(dyTimesY.sum([dim], keepDims).mul(y)); + }; + return { value: y, gradFunc: gradFunc }; + }); + return customOp($logits); + } + var softmax = op({ softmax_: softmax_ }); + + function tensor(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + if (!isTypedArray(values) && !Array.isArray(values) && + typeof values !== 'number' && typeof values !== 'boolean') { + throw new Error('values passed to tensor(values) must be an ' + + 'array of numbers or booleans, or a TypedArray'); + } + var inferredShape = inferShape(values); + if (shape != null && inferredShape.length !== 1) { + assertShapesMatch(shape, inferredShape, "Error creating a new Tensor. " + + ("Inferred shape (" + inferredShape + ") does not match the ") + + ("provided shape (" + shape + "). ")); + } + if (!isTypedArray(values) && !Array.isArray(values)) { + values = [values]; + } + shape = shape || inferredShape; + return Tensor.make(shape, { + values: toTypedArray(values, dtype, ENV.get('DEBUG')) + }, dtype); + } + function scalar(value, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + if (isTypedArray(value) || Array.isArray(value)) { + throw new Error('Error creating a new Scalar: value must be a primitive ' + + '(number|boolean)'); + } + return tensor(value, [], dtype); + } + function tensor1d(values, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + assertNonNull(values); + var inferredShape = inferShape(values); + if (inferredShape.length !== 1) { + throw new Error('tensor1d() requires values to be a flat/TypedArray'); + } + return tensor(values, inferredShape, dtype); + } + function tensor2d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + assertNonNull(values); + if (shape != null && shape.length !== 2) { + throw new Error('tensor2d() requires shape to have two numbers'); + } + var inferredShape = inferShape(values); + if (inferredShape.length !== 2 && inferredShape.length !== 1) { + throw new Error('tensor2d() requires values to be number[][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor2d() requires shape to be provided when `values` ' + + 'are a flat/TypedArray'); + } + shape = shape || inferredShape; + return tensor(values, shape, dtype); + } + function tensor3d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + assertNonNull(values); + if (shape != null && shape.length !== 3) { + throw new Error('tensor3d() requires shape to have three numbers'); + } + var inferredShape = inferShape(values); + if (inferredShape.length !== 3 && inferredShape.length !== 1) { + throw new Error('tensor3d() requires values to be number[][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor3d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + shape = shape || inferredShape; + return tensor(values, shape, dtype); + } + function tensor4d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + assertNonNull(values); + if (shape != null && shape.length !== 4) { + throw new Error('tensor4d() requires shape to have four numbers'); + } + var inferredShape = inferShape(values); + if (inferredShape.length !== 4 && inferredShape.length !== 1) { + throw new Error('tensor4d() requires values to be number[][][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor4d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + shape = shape || inferredShape; + return tensor(values, shape, dtype); + } + function tensor5d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + assertNonNull(values); + if (shape != null && shape.length !== 5) { + throw new Error('tensor5d() requires shape to have five numbers'); + } + var inferredShape = inferShape(values); + if (inferredShape.length !== 5 && inferredShape.length !== 1) { + throw new Error('tensor5d() requires values to be ' + + 'number[][][][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor5d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + shape = shape || inferredShape; + return tensor(values, shape, dtype); + } + function tensor6d(values, shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + assertNonNull(values); + if (shape != null && shape.length !== 6) { + throw new Error('tensor6d() requires shape to have six numbers'); + } + var inferredShape = inferShape(values); + if (inferredShape.length !== 6 && inferredShape.length !== 1) { + throw new Error('tensor6d() requires values to be number[][][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor6d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + shape = shape || + inferredShape; + return tensor(values, shape, dtype); + } + function ones$1(shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + var values = makeOnesTypedArray(sizeFromShape(shape), dtype); + return Tensor.make(shape, { values: values }, dtype); + } + function zeros(shape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + var values = makeZerosTypedArray(sizeFromShape(shape), dtype); + return Tensor.make(shape, { values: values }, dtype); + } + function fill(shape, value, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + var values = getTypedArrayFromDType(dtype, sizeFromShape(shape)); + values.fill(value); + return Tensor.make(shape, { values: values }, dtype); + } + function onesLike_(x) { + var $x = convertToTensor(x, 'x', 'onesLike'); + return ones$1($x.shape, $x.dtype); + } + function zerosLike_(x) { + var $x = convertToTensor(x, 'x', 'zerosLike'); + return zeros($x.shape, $x.dtype); + } + function linspace(start, stop, num) { + if (num === 0) { + throw new Error('Cannot request zero samples'); + } + var step = (stop - start) / (num - 1); + var values = makeZerosTypedArray(num, 'float32'); + values[0] = start; + for (var i = 1; i < values.length; i++) { + values[i] = values[i - 1] + step; + } + return tensor1d(values, 'float32'); + } + function range(start, stop, step, dtype) { + if (step === void 0) { step = 1; } + if (dtype === void 0) { dtype = 'float32'; } + if (step === 0) { + throw new Error('Cannot have a step of zero'); + } + var sameStartStop = start === stop; + var increasingRangeNegativeStep = start < stop && step < 0; + var decreasingRangePositiveStep = stop < start && step > 1; + if (sameStartStop || increasingRangeNegativeStep || + decreasingRangePositiveStep) { + return zeros([0], dtype); + } + var numElements = Math.abs(Math.ceil((stop - start) / step)); + var values = makeZerosTypedArray(numElements, dtype); + if (stop < start && step === 1) { + step = -1; + } + values[0] = start; + for (var i = 1; i < values.length; i++) { + values[i] = values[i - 1] + step; + } + return tensor1d(values, dtype); + } + var onesLike = op({ onesLike_: onesLike_ }); + var zerosLike = op({ zerosLike_: zerosLike_ }); + + var DType; + (function (DType) { + DType["float32"] = "float32"; + DType["int32"] = "int32"; + DType["bool"] = "bool"; + })(DType || (DType = {})); + (function (Rank) { + Rank["R0"] = "R0"; + Rank["R1"] = "R1"; + Rank["R2"] = "R2"; + Rank["R3"] = "R3"; + Rank["R4"] = "R4"; + Rank["R5"] = "R5"; + Rank["R6"] = "R6"; + })(exports.Rank || (exports.Rank = {})); + var UpcastInt32AndMap; + (function (UpcastInt32AndMap) { + UpcastInt32AndMap["float32"] = "float32"; + UpcastInt32AndMap["int32"] = "int32"; + UpcastInt32AndMap["bool"] = "int32"; + })(UpcastInt32AndMap || (UpcastInt32AndMap = {})); + var UpcastBoolAndMap; + (function (UpcastBoolAndMap) { + UpcastBoolAndMap["float32"] = "float32"; + UpcastBoolAndMap["int32"] = "int32"; + UpcastBoolAndMap["bool"] = "bool"; + })(UpcastBoolAndMap || (UpcastBoolAndMap = {})); + var UpcastFloat32AndMap; + (function (UpcastFloat32AndMap) { + UpcastFloat32AndMap["float32"] = "float32"; + UpcastFloat32AndMap["int32"] = "float32"; + UpcastFloat32AndMap["bool"] = "float32"; + })(UpcastFloat32AndMap || (UpcastFloat32AndMap = {})); + var upcastTypeMap = { + 'float32': UpcastFloat32AndMap, + 'int32': UpcastInt32AndMap, + 'bool': UpcastBoolAndMap + }; + function upcastType(typeA, typeB) { + return upcastTypeMap[typeA][typeB]; + } + function sumOutType(type) { + return upcastType(type, 'int32'); + } + + function castTensor(x, dtype, backend) { + if (!hasEncodingLoss(x.dtype, dtype)) { + return Tensor.make(x.shape, { dataId: x.dataId }, dtype); + } + if (dtype === 'int32') { + return backend.int(x); + } + else if (dtype === 'bool') { + return backend.notEqual(x, scalar(0, x.dtype)); + } + else { + throw new Error("Error in Cast: unknown dtype argument (" + dtype + ")"); + } + } + function reshapeTensor(x, shape) { + return Tensor.make(shape, { dataId: x.dataId }, x.dtype); + } + + function nonMaxSuppressionImpl(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + var candidates = Array.from(scores) + .map(function (score, boxIndex) { return ({ score: score, boxIndex: boxIndex }); }) + .filter(function (c) { return c.score > scoreThreshold; }) + .sort(function (c1, c2) { return c2.score - c1.score; }); + var selected = []; + for (var i = 0; i < candidates.length; i++) { + var _a = candidates[i], score = _a.score, boxIndex = _a.boxIndex; + if (score < scoreThreshold) { + break; + } + var ignoreCandidate = false; + for (var j = selected.length - 1; j >= 0; --j) { + var iou = intersectionOverUnion(boxes, boxIndex, selected[j]); + if (iou >= iouThreshold) { + ignoreCandidate = true; + break; + } + } + if (!ignoreCandidate) { + selected.push(boxIndex); + if (selected.length >= maxOutputSize) { + break; + } + } + } + return tensor1d(selected, 'int32'); + } + function intersectionOverUnion(boxes, i, j) { + var iCoord = boxes.subarray(i * 4, i * 4 + 4); + var jCoord = boxes.subarray(j * 4, j * 4 + 4); + var yminI = Math.min(iCoord[0], iCoord[2]); + var xminI = Math.min(iCoord[1], iCoord[3]); + var ymaxI = Math.max(iCoord[0], iCoord[2]); + var xmaxI = Math.max(iCoord[1], iCoord[3]); + var yminJ = Math.min(jCoord[0], jCoord[2]); + var xminJ = Math.min(jCoord[1], jCoord[3]); + var ymaxJ = Math.max(jCoord[0], jCoord[2]); + var xmaxJ = Math.max(jCoord[1], jCoord[3]); + var areaI = (ymaxI - yminI) * (xmaxI - xminI); + var areaJ = (ymaxJ - yminJ) * (xmaxJ - xminJ); + if (areaI <= 0 || areaJ <= 0) { + return 0.0; + } + var intersectionYmin = Math.max(yminI, yminJ); + var intersectionXmin = Math.max(xminI, xminJ); + var intersectionYmax = Math.min(ymaxI, ymaxJ); + var intersectionXmax = Math.min(xmaxI, xmaxJ); + var intersectionArea = Math.max(intersectionYmax - intersectionYmin, 0.0) * + Math.max(intersectionXmax - intersectionXmin, 0.0); + return intersectionArea / (areaI + areaJ - intersectionArea); + } + + function topkImpl(x, xShape, xDtype, k, sorted) { + var lastDim = xShape[xShape.length - 1]; + var _a = [x.length / lastDim, lastDim], batch = _a[0], size = _a[1]; + var allTopKVals = getTypedArrayFromDType(xDtype, batch * k); + var allTopKIndices = getTypedArrayFromDType('int32', batch * k); + for (var b = 0; b < batch; b++) { + var offset = b * size; + var vals = x.subarray(offset, offset + size); + var valAndInd = []; + for (var i = 0; i < vals.length; i++) { + valAndInd.push({ value: vals[i], index: i }); + } + valAndInd.sort(function (a, b) { return b.value - a.value; }); + var outOffset = b * k; + var topKVals = allTopKVals.subarray(outOffset, outOffset + k); + var topKIndices = allTopKIndices.subarray(outOffset, outOffset + k); + for (var i = 0; i < k; i++) { + topKVals[i] = valAndInd[i].value; + topKIndices[i] = valAndInd[i].index; + } + } + var outputShape = xShape.slice(); + outputShape[outputShape.length - 1] = k; + return [ + tensor(allTopKVals, outputShape, xDtype), + tensor(allTopKIndices, outputShape, 'int32') + ]; + } + + var ArgMinMaxProgram = (function () { + function ArgMinMaxProgram(reduceInfo, op, firstPass) { + this.variableNames = ['A']; + var windowSize = reduceInfo.windowSize; + var batchSize = reduceInfo.batchSize; + var inSize = reduceInfo.inSize; + var outSize = Math.ceil(inSize / windowSize); + if (!firstPass) { + this.variableNames.push('bestIndicesA'); + } + this.outputShape = [batchSize, outSize]; + var compOp = (op === 'max') ? '>' : '<'; + var indexSnippet = firstPass ? + 'inOffset + i;' : + 'round(getBestIndicesA(batch, inOffset + i));'; + this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * " + windowSize + ";\n\n int bestIndex = 0;\n float bestValue = getA(batch, inOffset);\n\n for (int i = 0; i < " + windowSize + "; i++) {\n int inIdx = " + indexSnippet + ";\n float candidate = getA(batch, inIdx);\n if (candidate " + compOp + " bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n "; + } + return ArgMinMaxProgram; + }()); + + var AvgPool2DBackpropProgram = (function () { + function AvgPool2DBackpropProgram(convInfo) { + this.variableNames = ['dy']; + this.outputShape = convInfo.inShape; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var avgMultiplier = 1 / (filterHeight * filterWidth); + this.userCode = "\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n const float avgMultiplier = float(" + avgMultiplier + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + strideHeight + ".0;\n\n if (dyR < 0.0 || dyR >= " + convInfo.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + strideWidth + ".0;\n\n if (dyC < 0.0 || dyC >= " + convInfo.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n "; + } + return AvgPool2DBackpropProgram; + }()); + + function getBroadcastDims(inShape, outShape) { + var inRank = inShape.length; + var dims = []; + for (var i = 0; i < inRank; i++) { + var dim = inRank - 1 - i; + var a = inShape[dim] || 1; + var b = outShape[outShape.length - 1 - i] || 1; + if (b > 1 && a === 1) { + dims.unshift(dim); + } + } + return dims; + } + function getReductionAxes(inShape, outShape) { + var result = []; + for (var i = 0; i < outShape.length; i++) { + var inDim = inShape[inShape.length - i - 1]; + var outAxis = outShape.length - i - 1; + var outDim = outShape[outAxis]; + if (inDim == null || (inDim === 1 && outDim > 1)) { + result.unshift(outAxis); + } + } + return result; + } + function broadcastDimsAreOuter(dims) { + for (var i = 0; i < dims.length; i++) { + if (dims[i] !== i) { + return false; + } + } + return true; + } + function assertAndGetBroadcastShape(shapeA, shapeB) { + var result = []; + var errMsg = "Operands could not be broadcast together with shapes " + + (shapeA + " and " + shapeB + "."); + var l = Math.max(shapeA.length, shapeB.length); + for (var i = 0; i < l; i++) { + var a = shapeA[shapeA.length - i - 1] || 1; + var b = shapeB[shapeB.length - i - 1] || 1; + if (a > 1 && b > 1 && a !== b) { + throw Error(errMsg); + } + result.unshift(Math.max(a, b)); + } + return result; + } + + var BatchNormProgram = (function () { + function BatchNormProgram(xShape, meanShape, varianceShape, offsetShape, scaleShape, varianceEpsilon) { + this.outputShape = []; + this.supportsBroadcasting = true; + this.variableNames = ['x', 'mean', 'variance']; + assertAndGetBroadcastShape(xShape, meanShape); + assertAndGetBroadcastShape(xShape, varianceShape); + var offsetSnippet = '0.0'; + if (offsetShape != null) { + assertAndGetBroadcastShape(xShape, offsetShape); + this.variableNames.push('offset'); + offsetSnippet = 'getOffsetAtOutCoords()'; + } + var scaleSnippet = '1.0'; + if (scaleShape != null) { + assertAndGetBroadcastShape(xShape, scaleShape); + this.variableNames.push('scale'); + scaleSnippet = 'getScaleAtOutCoords()'; + } + this.outputShape = xShape; + this.userCode = "\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = " + offsetSnippet + ";\n float scale = " + scaleSnippet + ";\n float inv = scale * inversesqrt(variance + float(" + varianceEpsilon + "));\n setOutput((x - mean) * inv + offset);\n }\n "; + } + return BatchNormProgram; + }()); + + var CHECK_NAN_SNIPPET = "\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n"; + var ADD = 'return a + b;'; + var SUB = 'return a - b;'; + var MUL = 'return a * b;'; + var DIV = "if (a == b) return 1.0;\n return a / b;"; + var INT_DIV = "\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n"; + var POW = "\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n"; + var SQUARED_DIFFERENCE = 'return (a - b) * (a - b);'; + var EQUAL = "return float(a == b);"; + var NOT_EQUAL = "return float(a != b);"; + var LESS = "return float(a < b);"; + var LESS_EQUAL = "return float(a <= b);"; + var GREATER = "return float(a > b);"; + var GREATER_EQUAL = "return float(a >= b);"; + var LOGICAL_AND = "return float(a >= 1.0 && b >= 1.0);"; + var LOGICAL_OR = "return float(a >= 1.0 || b >= 1.0);"; + var MAX = CHECK_NAN_SNIPPET + "\n return max(a, b);\n"; + var MIN = CHECK_NAN_SNIPPET + "\n return min(a, b);\n"; + var MOD = "if (b == 0.0) return NAN;\n return mod(a, b);"; + var ATAN2 = CHECK_NAN_SNIPPET + "\n return atan(a, b);\n"; + var ELU_DER = "return (b >= 1.0) ? a : a * (b + 1.0);"; + var BinaryOpProgram = (function () { + function BinaryOpProgram(op, aShape, bShape) { + this.variableNames = ['A', 'B']; + this.supportsBroadcasting = true; + this.outputShape = + assertAndGetBroadcastShape(aShape, bShape); + this.userCode = "\n uniform float NAN;\n float binaryOperation(float a, float b) {\n " + op + "\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n "; + } + BinaryOpProgram.prototype.getCustomSetupFunc = function () { + var _this = this; + return function (gpgpu, webGLProgram) { + if (_this.startLoc == null) { + _this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN'); + if (_this.startLoc == null) { + return; + } + } + gpgpu.gl.uniform1f(_this.startLoc, NaN); + }; + }; + return BinaryOpProgram; + }()); + + var ClipProgram = (function () { + function ClipProgram(aShape, min, max) { + this.variableNames = ['A']; + this.outputShape = aShape; + var minFixed = min.toFixed(20); + var maxFixed = max.toFixed(20); + this.userCode = "\n void main() {\n float value = getAAtOutCoords();\n if (isNaN(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, " + minFixed + ", " + maxFixed + "));\n }\n "; + } + return ClipProgram; + }()); + + function assertParams(aShape, bShape, axis) { + var aRank = aShape.length; + var bRank = bShape.length; + assert(aShape.length === bShape.length, "Error in concat" + aRank + "D: rank of x1 (" + aRank + ") and x2 (" + bRank + ") " + + "must be the same."); + assert(axis >= 0 && axis < aRank, "Error in concat" + aRank + "D: axis must be " + + ("between 0 and " + (aRank - 1) + ".")); + for (var i = 0; i < aRank; i++) { + assert((i === axis) || (aShape[i] === bShape[i]), "Error in concat" + aRank + "D: Shape (" + aShape + ") does not match " + + ("(" + bShape + ") along the non-concatenated axis " + i + ".")); + } + } + function computeOutShape$1(x1Shape, x2Shape, axis) { + assert(x1Shape.length === x2Shape.length, 'x1 and x2 should have the same rank.'); + var outputShape = x1Shape.slice(); + outputShape[axis] += x2Shape[axis]; + return outputShape; + } + function computeGradientSliceShapes(aShape, bShape) { + return { + aBegin: [0, 0], + aSize: aShape, + bBegin: [0, aShape[1]], + bSize: bShape + }; + } + + var ConcatProgram = (function () { + function ConcatProgram(aShape, bShape) { + this.variableNames = ['A', 'B']; + this.outputShape = []; + this.outputShape = + computeOutShape$1(aShape, bShape, 1); + this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n float value = 0.0;\n if (yC < " + aShape[1] + ") {\n value = getA(yR, yC);\n } else {\n yC -= " + aShape[1] + ";\n value = getB(yR, yC);\n }\n\n setOutput(value);\n }\n "; + } + return ConcatProgram; + }()); + + var Conv2DDerFilterProgram = (function () { + function Conv2DDerFilterProgram(convInfo) { + this.variableNames = ['x', 'dy']; + this.outputShape = convInfo.filterShape; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < " + convInfo.batchSize + "; b++) {\n for (int yR = 0; yR < " + convInfo.outHeight + "; yR++) {\n int xR = wR + yR * " + strideHeight + " - " + padTop + ";\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int yC = 0; yC < " + convInfo.outWidth + "; yC++) {\n int xC = wC + yC * " + strideWidth + " - " + padLeft + ";\n\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return Conv2DDerFilterProgram; + }()); + var Conv2DDerInputProgram = (function () { + function Conv2DDerInputProgram(convInfo) { + this.variableNames = ['dy', 'W']; + this.outputShape = convInfo.inShape; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + this.userCode = "\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + strideHeight + ".0;\n\n if (dyR < 0.0 || dyR >= " + convInfo.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = " + filterHeight + " - 1 - wR;\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + strideWidth + ".0;\n\n if (dyC < 0.0 || dyC >= " + convInfo.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = " + filterWidth + " - 1 - wC;\n\n for (int d2 = 0; d2 < " + convInfo.outChannels + "; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return Conv2DDerInputProgram; + }()); + + var DepthwiseConv2DDerFilterProgram = (function () { + function DepthwiseConv2DDerFilterProgram(convInfo) { + this.variableNames = ['x', 'dy']; + this.outputShape = convInfo.filterShape; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + var channelMul = convInfo.outChannels / convInfo.inChannels; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * " + channelMul + " + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < " + convInfo.batchSize + "; b++) {\n for (int yR = 0; yR < " + convInfo.outHeight + "; yR++) {\n int xR = wR + yR * " + strideHeight + " - " + padTop + ";\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int yC = 0; yC < " + convInfo.outWidth + "; yC++) {\n int xC = wC + yC * " + strideWidth + " - " + padLeft + ";\n\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return DepthwiseConv2DDerFilterProgram; + }()); + var DepthwiseConv2DDerInputProgram = (function () { + function DepthwiseConv2DDerInputProgram(convInfo) { + this.variableNames = ['dy', 'W']; + this.outputShape = convInfo.inShape; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var channelMul = convInfo.outChannels / convInfo.inChannels; + this.userCode = "\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + strideHeight + ".0;\n\n if (dyR < 0.0 || dyR >= " + convInfo.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = " + filterHeight + " - 1 - wR;\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + strideWidth + ".0;\n\n if (dyC < 0.0 || dyC >= " + convInfo.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = " + filterWidth + " - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < " + channelMul + "; dm++) {\n int d2 = d1 * " + channelMul + " + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return DepthwiseConv2DDerInputProgram; + }()); + + var Conv2DProgram = (function () { + function Conv2DProgram(convInfo) { + this.variableNames = ['x', 'W']; + this.outputShape = convInfo.outShape; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var inputDepthNearestVec4 = Math.floor(convInfo.inChannels / 4) * 4; + var inputDepthVec4Remainder = convInfo.inChannels % 4; + this.userCode = "\n const ivec2 strides = ivec2(" + strideHeight + ", " + strideWidth + ");\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n int xR = xRCorner + wR * " + dilationHeight + ";\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n int xC = xCCorner + wC * " + dilationWidth + ";\n\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n continue;\n }\n\n for (int d1 = 0; d1 < " + inputDepthNearestVec4 + "; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (" + (inputDepthVec4Remainder === 1) + ") {\n dotProd +=\n getX(batch, xR, xC, " + inputDepthNearestVec4 + ") *\n getW(wR, wC, " + inputDepthNearestVec4 + ", d2);\n } else if (" + (inputDepthVec4Remainder === 2) + ") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, " + inputDepthNearestVec4 + "),\n getX(batch, xR, xC, " + inputDepthNearestVec4 + " + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, " + inputDepthNearestVec4 + ", d2),\n getW(wR, wC, " + inputDepthNearestVec4 + " + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (" + (inputDepthVec4Remainder === 3) + ") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, " + inputDepthNearestVec4 + "),\n getX(batch, xR, xC, " + inputDepthNearestVec4 + " + 1),\n getX(batch, xR, xC, " + inputDepthNearestVec4 + " + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, " + inputDepthNearestVec4 + ", d2),\n getW(wR, wC, " + inputDepthNearestVec4 + " + 1, d2),\n getW(wR, wC, " + inputDepthNearestVec4 + " + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n "; + } + return Conv2DProgram; + }()); + + var DepthwiseConv2DProgram = (function () { + function DepthwiseConv2DProgram(convInfo) { + this.variableNames = ['x', 'W']; + this.outputShape = convInfo.outShape; + var xNumRows = convInfo.inHeight; + var xNumCols = convInfo.inWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var channelMul = convInfo.outChannels / convInfo.inChannels; + this.userCode = "\n const ivec2 strides = ivec2(" + strideHeight + ", " + strideWidth + ");\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / " + channelMul + ";\n int q = d2 - d1 * " + channelMul + ";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n int xR = xRCorner + wR * " + dilationHeight + ";\n\n if (xR < 0 || xR >= " + xNumRows + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n int xC = xCCorner + wC * " + dilationWidth + ";\n\n if (xC < 0 || xC >= " + xNumCols + ") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n "; + } + return DepthwiseConv2DProgram; + }()); + + function makeShader(inputsInfo, outputShape, userCode, broadcast) { + var inputPrefixSnippet = inputsInfo.map(function (x) { + var size = sizeFromShape(x.shapeInfo.logicalShape); + if (x.shapeInfo.isUniform) { + return "uniform float " + x.name + (size > 1 ? "[" + size + "]" : '') + ";"; + } + return "uniform sampler2D " + x.name + ";"; + }); + inputPrefixSnippet = inputPrefixSnippet.join('\n'); + var inputSamplingSnippet = inputsInfo.map(function (x) { return getInputSamplingSnippet(x, outputShape, broadcast); }) + .join('\n'); + var outTexShape = outputShape.texShape; + var outputSamplingSnippet = getOutputSamplingSnippet(outputShape.logicalShape, outTexShape); + var source = [ + SHADER_PREFIX, FLOAT_TEXTURE_SAMPLE_SNIPPET, + FLOAT_TEXTURE_SETOUTPUT_SNIPPET, inputPrefixSnippet, outputSamplingSnippet, + inputSamplingSnippet, userCode + ].join('\n'); + return source; + } + function getSamplerFromInInfo(inInfo) { + var shape = inInfo.shapeInfo.logicalShape; + switch (shape.length) { + case 0: + return getSamplerScalar(inInfo); + case 1: + return getSampler1D(inInfo); + case 2: + return getSampler2D(inInfo); + case 3: + return getSampler3D(inInfo); + case 4: + return getSampler4D(inInfo); + case 5: + return getSampler5D(inInfo); + case 6: + return getSampler6D(inInfo); + default: + throw new Error(shape.length + "-D input sampling" + + " is not yet supported"); + } + } + function getInputSamplingSnippet(inInfo, outShapeInfo, broadcast) { + var res = getSamplerFlat(inInfo); + res += getSamplerFromInInfo(inInfo); + if (broadcast || + arraysEqual(inInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape)) { + res += getSamplerAtOutputCoords(inInfo, outShapeInfo, broadcast); + } + return res; + } + function getOutputSamplingSnippet(outShape, outTexShape) { + switch (outShape.length) { + case 0: + return getOutputScalarCoords(); + case 1: + return getOutput1DCoords(outShape, outTexShape); + case 2: + return getOutput2DCoords(outShape, outTexShape); + case 3: + return getOutput3DCoords(outShape, outTexShape); + case 4: + return getOutput4DCoords(outShape, outTexShape); + case 5: + return getOutput5DCoords(outShape, outTexShape); + case 6: + return getOutput6DCoords(outShape, outTexShape); + default: + throw new Error(outShape.length + "-D output sampling is not yet supported"); + } + } + var SAMPLE_1D_SNIPPET = "\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; + var SAMPLE_2D_SNIPPET = "\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\n int index = row * numC + col;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; + var SAMPLE_3D_SNIPPET = "\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\n int stride1, int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; + var SAMPLE_4D_SNIPPET = "\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int row, int col, int depth,\n int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; + var SAMPLE_5D_SNIPPET = "\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int row, int col, int depth,\n int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2 * stride3 + depth3;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; + var SAMPLE_6D_SNIPPET = "\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int stride4,\n int row, int col, int depth, int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\n stride3 + depth3 * stride4 + depth4;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n"; + var FLOAT_TEXTURE_SAMPLE_SNIPPET = "\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return texture2D(textureSampler, uv).r;\n }\n"; + var FLOAT_TEXTURE_SETOUTPUT_SNIPPET = "\n void setOutput(float val) {\n gl_FragColor = vec4(val, 0, 0, 0);\n }\n"; + var SHADER_PREFIX = "\n precision highp float;\n precision highp int;\n varying vec2 resultUV;\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n bool isNaN(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n bool hasNaN(vec4 values) {\n vec4 v1 = values * values;\n vec4 v2 = values * values;\n return any(notEqual(v1, v2));\n }\n\n float getNaN(vec4 values) {\n return dot(vec4(1), values);\n }\n\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n " + SAMPLE_1D_SNIPPET + "\n " + SAMPLE_2D_SNIPPET + "\n " + SAMPLE_3D_SNIPPET + "\n " + SAMPLE_4D_SNIPPET + "\n " + SAMPLE_5D_SNIPPET + "\n " + SAMPLE_6D_SNIPPET + "\n"; + function getOutputScalarCoords() { + return "\n int getOutputCoords() {\n return 0;\n }\n "; + } + function getOutput1DCoords(shape, texShape) { + if (texShape[0] === 1) { + return "\n int getOutputCoords() {\n return int(resultUV.x * " + texShape[1] + ".0);\n }\n "; + } + if (texShape[1] === 1) { + return "\n int getOutputCoords() {\n return int(resultUV.y * " + texShape[0] + ".0);\n }\n "; + } + return "\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n return resTexRC.x * " + texShape[1] + " + resTexRC.y;\n }\n "; + } + function getOutput3DCoords(shape, texShape) { + var stride0 = shape[1] * shape[2]; + var stride1 = shape[2]; + return "\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n int r = index / " + stride0 + ";\n index -= r * " + stride0 + ";\n int c = index / " + stride1 + ";\n int d = index - c * " + stride1 + ";\n return ivec3(r, c, d);\n }\n "; + } + function getOutput4DCoords(shape, texShape) { + var stride2 = shape[3]; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + return "\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n\n int r = index / " + stride0 + ";\n index -= r * " + stride0 + ";\n\n int c = index / " + stride1 + ";\n index -= c * " + stride1 + ";\n\n int d = index / " + stride2 + ";\n int d2 = index - d * " + stride2 + ";\n\n return ivec4(r, c, d, d2);\n }\n "; + } + function getOutput5DCoords(shape, texShape) { + var stride3 = shape[4]; + var stride2 = shape[3] * stride3; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + return "\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(" + texShape[0] + ",\n " + texShape[1] + "));\n\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n\n int r = index / " + stride0 + ";\n index -= r * " + stride0 + ";\n\n int c = index / " + stride1 + ";\n index -= c * " + stride1 + ";\n\n int d = index / " + stride2 + ";\n index -= d * " + stride2 + ";\n\n int d2 = index / " + stride3 + ";\n int d3 = index - d2 * " + stride3 + ";\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n "; + } + function getOutput6DCoords(shape, texShape) { + var stride4 = shape[5]; + var stride3 = shape[4] * stride4; + var stride2 = shape[3] * stride3; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + return "\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n\n int r = index / " + stride0 + ";\n index -= r * " + stride0 + ";\n\n int c = index / " + stride1 + ";\n index -= c * " + stride1 + ";\n\n int d = index / " + stride2 + ";\n index -= d * " + stride2 + ";\n\n int d2 = index / " + stride3 + ";\n index -= d2 * " + stride3 + ";\n\n int d3 = index / " + stride4 + ";\n int d4 = index - d3 * " + stride4 + ";\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n "; + } + function getOutput2DCoords(shape, texShape) { + if (arraysEqual(shape, texShape)) { + return "\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(" + texShape[0] + ", " + texShape[1] + "));\n }\n "; + } + if (shape[1] === 1) { + return "\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n return ivec2(index, 0);\n }\n "; + } + if (shape[0] === 1) { + return "\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n return ivec2(0, index);\n }\n "; + } + return "\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + texShape[0] + ", " + texShape[1] + "));\n int index = resTexRC.x * " + texShape[1] + " + resTexRC.y;\n int r = index / " + shape[1] + ";\n int c = index - r * " + shape[1] + ";\n return ivec2(r, c);\n }\n "; + } + function getSamplerScalar(inputInfo) { + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + if (inputInfo.shapeInfo.isUniform) { + return "float " + funcName + "() {return " + texName + ";}"; + } + return "\n float " + funcName + "() {\n return sampleTexture(" + texName + ", halfCR);\n }\n "; + } + function getSampler1D(inputInfo) { + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + return "\n float " + funcName + "(int index) {\n return " + funcName + "Flat(index);\n }\n "; + } + function getSampler2D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var texShape = inputInfo.shapeInfo.texShape; + if (texShape != null && arraysEqual(shape, texShape)) { + var texNumR_1 = texShape[0]; + var texNumC_1 = texShape[1]; + return "\n float " + funcName + "(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(" + texNumC_1 + ".0, " + texNumR_1 + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + var _a = squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + var squeezedShape = newShape; + if (squeezedShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, squeezedShape); + var params = ['row', 'col']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col) {\n int index = row * " + shape[1] + " + col;\n return " + funcName + "Flat(index);\n }\n "; + } + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === 1) { + return "\n float " + funcName + "(int row, int col) {\n int index = row * " + shape[1] + " + col;\n vec2 uv = vec2(0.5, (float(index) + 0.5) / " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumR === 1) { + return "\n float " + funcName + "(int row, int col) {\n int index = row * " + shape[1] + " + col;\n vec2 uv = vec2((float(index) + 0.5) / " + texNumC + ".0, 0.5);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col) {\n vec2 uv = UVfrom2D(" + texNumR + ", " + texNumC + ", " + shape[1] + ", row, col);\n return sampleTexture(" + texName + ", uv);\n }\n"; + } + function getSampler3D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var stride0 = shape[1] * shape[2]; + var stride1 = shape[2]; + var _a = squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + var squeezedShape = newShape; + if (squeezedShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, squeezedShape); + var params = ['row', 'col', 'depth']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col, int depth) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col, int depth) {\n int index = row * " + stride0 + " + col * " + stride1 + " + depth;\n return " + funcName + "Flat(index);\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === stride0) { + return "\n float " + funcName + "(int row, int col, int depth) {\n int texR = row;\n int texC = col * " + stride1 + " + depth;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumC === stride1) { + return "\n float " + funcName + "(int row, int col, int depth) {\n int texR = row * " + shape[1] + " + col;\n int texC = depth;\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col, int depth) {\n vec2 uv = UVfrom3D(\n " + texNumR + ", " + texNumC + ", " + stride0 + ", " + stride1 + ", row, col, depth);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + function getSampler4D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var stride2 = shape[3]; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + var _a = squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + if (newShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, newShape); + var params = ['row', 'col', 'depth', 'depth2']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n int index = row * " + stride0 + " + col * " + stride1 + " +\n depth * " + stride2 + " + depth2;\n return " + funcName + "Flat(index);\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === stride0) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n int texR = row;\n int texC = col * " + stride1 + " + depth * " + stride2 + " + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumC === stride2) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n int texR = row * " + shape[1] * shape[2] + " + col * " + shape[2] + " + depth;\n int texC = depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col, int depth, int depth2) {\n vec2 uv = UVfrom4D(" + texNumR + ", " + texNumC + ", " + stride0 + ", " + stride1 + ",\n " + stride2 + ", row, col, depth, depth2);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + function getSampler5D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var stride3 = shape[4]; + var stride2 = shape[3] * stride3; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + var _a = squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + if (newShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, newShape); + var params = ['row', 'col', 'depth', 'depth2', 'depth3']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n int index = row * " + stride0 + " + col * " + stride1 + " +\n depth * " + stride2 + " + depth2 * " + stride3 + " + depth3;\n return " + funcName + "Flat(index);\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === stride0) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n int texC = col * " + stride1 + " + depth * " + stride2 + " +\n depth2 * " + stride3 + " + depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumC === stride3) { + return "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n int texR = row * " + shape[1] * shape[2] + " + col * " + shape[2] + " +\n depth * " + shape[3] + " + depth2;\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col, int depth, int depth2, int depth3) {\n vec2 uv = UVfrom5D(" + texNumR + ", " + texNumC + ", " + stride0 + ", " + stride1 + ",\n " + stride2 + ", " + stride3 + ", row, col, depth, depth2, depth3);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + function getSampler6D(inputInfo) { + var shape = inputInfo.shapeInfo.logicalShape; + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1); + var stride4 = shape[5]; + var stride3 = shape[4] * stride4; + var stride2 = shape[3] * stride3; + var stride1 = shape[2] * stride2; + var stride0 = shape[1] * stride1; + var _a = squeezeShape(shape), newShape = _a.newShape, keptDims = _a.keptDims; + if (newShape.length < shape.length) { + var newInputInfo = squeezeInputInfo(inputInfo, newShape); + var params = ['row', 'col', 'depth', 'depth2', 'depth3', 'depth4']; + return "\n " + getSamplerFromInInfo(newInputInfo) + "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return " + funcName + "(" + getSqueezedParams(params, keptDims) + ");\n }\n "; + } + if (inputInfo.shapeInfo.isUniform) { + return "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * " + stride0 + " + col * " + stride1 + " +\n depth * " + stride2 + " + depth2 * " + stride3 + " + depth3 * " + stride3 + "\n + depth4\n return " + funcName + "Flat(index);\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var texNumR = texShape[0]; + var texNumC = texShape[1]; + if (texNumC === stride0) { + return "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n int texC = col * " + stride1 + " + depth * " + stride2 + " + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (texNumC === stride4) { + return "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row * " + shape[1] * shape[2] + " + col * " + shape[2] + " + depth;\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + texNumC + ".0, " + texNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n vec2 uv = UVfrom6D(" + texNumR + ", " + texNumC + ", " + stride0 + ", " + stride1 + ",\n " + stride2 + ", " + stride3 + ", " + stride4 + "\n ,row, col, depth, depth2, depth3, depth4);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + function getSamplerFlat(inputInfo) { + var texName = inputInfo.name; + var funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1) + 'Flat'; + var inSize = sizeFromShape(inputInfo.shapeInfo.logicalShape); + if (inputInfo.shapeInfo.isUniform) { + if (inSize === 1) { + return "float " + funcName + "(int index) {return " + texName + ";}"; + } + return "\n float " + funcName + "(int index) {\n for (int i = 0; i < " + inSize + "; i++) {\n if (i == index) {\n return " + texName + "[i];\n }\n }\n }\n "; + } + var texShape = inputInfo.shapeInfo.texShape; + var tNumR = texShape[0]; + var tNumC = texShape[1]; + if (tNumC === 1 && tNumR === 1) { + return "\n float " + funcName + "(int index) {\n return sampleTexture(" + texName + ", halfCR);\n }\n "; + } + if (tNumC === 1) { + return "\n float " + funcName + "(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / " + tNumR + ".0);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + if (tNumR === 1) { + return "\n float " + funcName + "(int index) {\n vec2 uv = vec2((float(index) + 0.5) / " + tNumC + ".0, 0.5);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + return "\n float " + funcName + "(int index) {\n vec2 uv = UVfrom1D(" + tNumR + ", " + tNumC + ", index);\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + function getBroadcastOutputCoordsSampler(inputInfo, outShapeInfo, texFuncSnippet, funcName) { + var inRank = inputInfo.shapeInfo.logicalShape.length; + var outRank = outShapeInfo.logicalShape.length; + var type = 'int'; + if (outRank === 2) { + type = 'ivec2'; + } + else if (outRank === 3) { + type = 'ivec3'; + } + else if (outRank === 4) { + type = 'ivec4'; + } + var broadcastDims = getBroadcastDims(inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape); + var rankDiff = outRank - inRank; + var coordsSnippet; + if (inRank === 0) { + coordsSnippet = ''; + } + else if (outRank < 2 && broadcastDims.length >= 1) { + coordsSnippet = 'coords = 0;'; + } + else { + coordsSnippet = + broadcastDims.map(function (d) { return "coords[" + (d + rankDiff) + "] = 0;"; }).join('\n'); + } + var unpackedCoordsSnippet = ''; + if (outRank < 2 && inRank > 0) { + unpackedCoordsSnippet = 'coords'; + } + else { + unpackedCoordsSnippet = inputInfo.shapeInfo.logicalShape + .map(function (s, i) { return "coords[" + (i + rankDiff) + "]"; }) + .join(', '); + } + return "\n float " + funcName + "() {\n " + type + " coords = getOutputCoords();\n " + coordsSnippet + "\n return get" + texFuncSnippet + "(" + unpackedCoordsSnippet + ");\n }\n "; + } + function getSamplerAtOutputCoords(inputInfo, outShapeInfo, supportsBroadcasting) { + var texName = inputInfo.name; + var texFuncSnippet = texName.charAt(0).toUpperCase() + texName.slice(1); + var funcName = 'get' + texFuncSnippet + 'AtOutCoords'; + var broadcastDims = getBroadcastDims(inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape); + var inRank = inputInfo.shapeInfo.logicalShape.length; + var outRank = outShapeInfo.logicalShape.length; + var doBroadcast = supportsBroadcasting && ((outRank > inRank) || broadcastDims.length > 0); + var broadcastOverOuter = broadcastDimsAreOuter(broadcastDims); + var isUniform = inputInfo.shapeInfo.isUniform; + if (doBroadcast && !broadcastOverOuter) { + return getBroadcastOutputCoordsSampler(inputInfo, outShapeInfo, texFuncSnippet, funcName); + } + var inSize = sizeFromShape(inputInfo.shapeInfo.logicalShape); + var broadcastSnippet = ''; + if (doBroadcast && broadcastOverOuter) { + broadcastSnippet = "\n int mainPart = index / " + inSize + ";\n index -= mainPart * " + inSize + ";\n "; + } + var outTexShape = outShapeInfo.texShape; + if (isUniform) { + if (inSize === 1) { + return "float " + funcName + "() {return " + texName + ";}"; + } + return "\n float " + funcName + "() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + outTexShape[0] + ", " + outTexShape[1] + "));\n int index = resTexRC.x * " + outTexShape[1] + " + resTexRC.y;\n " + broadcastSnippet + "\n return get" + texFuncSnippet + "Flat(index);\n }\n "; + } + var inTexShape = inputInfo.shapeInfo.texShape; + if (arraysEqual(inTexShape, outTexShape)) { + return "\n float " + funcName + "() {\n return sampleTexture(" + texName + ", resultUV);\n }\n "; + } + return "\n float " + funcName + "() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + outTexShape[0] + ", " + outTexShape[1] + "));\n int index = resTexRC.x * " + outTexShape[1] + " + resTexRC.y;\n " + broadcastSnippet + "\n int texR = index / " + inTexShape[1] + ";\n int texC = index - texR * " + inTexShape[1] + ";\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + inTexShape[1] + ".0, " + inTexShape[0] + ".0);\n\n return sampleTexture(" + texName + ", uv);\n }\n "; + } + function getCoordsDataType(rank) { + if (rank <= 1) { + return 'int'; + } + else if (rank === 2) { + return 'ivec2'; + } + else if (rank === 3) { + return 'ivec3'; + } + else if (rank === 4) { + return 'ivec4'; + } + else if (rank === 5) { + return 'ivec5'; + } + else if (rank === 6) { + return 'ivec6'; + } + else { + throw Error("GPU for rank " + rank + " is not yet supported"); + } + } + function squeezeInputInfo(inInfo, squeezedShape) { + var newInputInfo = JSON.parse(JSON.stringify(inInfo)); + newInputInfo.shapeInfo.logicalShape = squeezedShape; + return newInputInfo; + } + function getSqueezedParams(params, keptDims) { + return keptDims.map(function (d) { return params[d]; }).join(', '); + } + + var CumSumProgram = (function () { + function CumSumProgram(shape, exclusive, reverse) { + this.variableNames = ['x']; + this.outputShape = shape; + var rank = shape.length; + var finalDim = shape[shape.length - 1]; + var comparator = reverse ? '<' : '>'; + this.userCode = "\n int getIndex(int i) {\n " + (reverse ? "return " + finalDim + " -i - 1;" : 'return i;') + "\n }\n\n void main() {\n " + getCoordsDataType(rank) + " coords = getOutputCoords();\n int end = " + getFinalCoord(rank, 'coords') + ";\n float val = 0.0;\n for (int i = " + finalDim + " - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx " + comparator + " end) {\n continue;\n }\n if (idx == end && " + exclusive + ") {\n continue;\n }\n " + getFinalCoord(rank, 'coords') + " = idx;\n val += getX(" + getCoords(rank, 'coords') + ");\n }\n setOutput(val);\n }\n "; + } + return CumSumProgram; + }()); + function getCoords(rank, name) { + if (rank === 1) { + return "" + name; + } + else if (rank === 2) { + return name + ".x, " + name + ".y"; + } + else if (rank === 3) { + return name + ".x, " + name + ".y, " + name + ".z"; + } + else if (rank === 4) { + return name + ".x, " + name + ".y, " + name + ".z, " + name + ".w"; + } + else { + throw Error("Cumulative sum for rank " + rank + " is not yet supported"); + } + } + function getFinalCoord(rank, name) { + if (rank === 1) { + return "" + name; + } + else if (rank === 2) { + return name + ".y"; + } + else if (rank === 3) { + return name + ".z"; + } + else if (rank === 4) { + return name + ".w"; + } + else { + throw Error("Cumulative sum for rank " + rank + " is not yet supported"); + } + } + + var EncodeFloatProgram = (function () { + function EncodeFloatProgram(outputShape) { + this.variableNames = ['A']; + this.outputShape = outputShape; + this.userCode = "\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n gl_FragColor = encode_float(x);\n }\n "; + } + return EncodeFloatProgram; + }()); + + var FromPixelsProgram = (function () { + function FromPixelsProgram(outputShape) { + this.variableNames = ['A']; + var height = outputShape[0], width = outputShape[1]; + this.outputShape = outputShape; + this.userCode = "\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(" + width + ".0, " + height + ".0);\n\n vec4 values = texture2D(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n "; + } + return FromPixelsProgram; + }()); + + var GatherProgram = (function () { + function GatherProgram(aShape, indicesLength, axis) { + this.variableNames = ['A', 'indices']; + var outputShape = aShape.slice(); + outputShape[axis] = indicesLength; + this.outputShape = outputShape; + this.rank = outputShape.length; + var dtype = getCoordsDataType(this.rank); + var sourceCoords = getSourceCoords(aShape, axis); + this.userCode = "\n void main() {\n " + dtype + " resRC = getOutputCoords();\n setOutput(getA(" + sourceCoords + "));\n }\n "; + } + return GatherProgram; + }()); + function getSourceCoords(aShape, axis) { + var rank = aShape.length; + if (rank > 4) { + throw Error("Gather for rank " + rank + " is not yet supported"); + } + if (rank === 1) { + return "int(getIndices(resRC))"; + } + var currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w']; + var sourceCoords = []; + for (var i = 0; i < aShape.length; i++) { + if (i === axis) { + sourceCoords.push("int(getIndices(" + currentCoords[i] + "))"); + } + else { + sourceCoords.push("" + currentCoords[i]); + } + } + return sourceCoords.join(); + } + + var TextureUsage; + (function (TextureUsage) { + TextureUsage[TextureUsage["RENDER"] = 0] = "RENDER"; + TextureUsage[TextureUsage["UPLOAD"] = 1] = "UPLOAD"; + TextureUsage[TextureUsage["PIXELS"] = 2] = "PIXELS"; + TextureUsage[TextureUsage["DOWNLOAD"] = 3] = "DOWNLOAD"; + })(TextureUsage || (TextureUsage = {})); + var PhysicalTextureType; + (function (PhysicalTextureType) { + PhysicalTextureType[PhysicalTextureType["FLOAT16"] = 0] = "FLOAT16"; + PhysicalTextureType[PhysicalTextureType["FLOAT32"] = 1] = "FLOAT32"; + PhysicalTextureType[PhysicalTextureType["UNSIGNED_BYTE"] = 2] = "UNSIGNED_BYTE"; + })(PhysicalTextureType || (PhysicalTextureType = {})); + function getUnpackedMatrixTextureShapeWidthHeight(rows, columns) { + return [columns, rows]; + } + function getUnpackedArraySizeFromMatrixSize(matrixSize, channelsPerTexture) { + return matrixSize * channelsPerTexture; + } + function getMatrixSizeFromUnpackedArraySize(unpackedSize, channelsPerTexture) { + if (unpackedSize % channelsPerTexture !== 0) { + throw new Error("unpackedSize (" + unpackedSize + ") must be a multiple of " + + ("" + channelsPerTexture)); + } + return unpackedSize / channelsPerTexture; + } + function encodeMatrixToUnpackedArray(matrix, unpackedArray, channelsPerTexture) { + var requiredSize = getUnpackedArraySizeFromMatrixSize(matrix.length, channelsPerTexture); + if (unpackedArray.length < requiredSize) { + throw new Error("unpackedArray length (" + unpackedArray.length + ") must be >= " + + ("" + requiredSize)); + } + var dst = 0; + for (var src = 0; src < matrix.length; ++src) { + unpackedArray[dst] = matrix[src]; + dst += channelsPerTexture; + } + } + function decodeMatrixFromUnpackedArray(unpackedArray, matrix, channelsPerTexture) { + var requiredSize = getMatrixSizeFromUnpackedArraySize(unpackedArray.length, channelsPerTexture); + if (matrix.length < requiredSize) { + throw new Error("matrix length (" + matrix.length + ") must be >= " + requiredSize); + } + var dst = 0; + for (var src = 0; src < unpackedArray.length; src += channelsPerTexture) { + matrix[dst++] = unpackedArray[src]; + } + } + function getPackedMatrixTextureShapeWidthHeight(rows, columns) { + return [Math.ceil(columns / 2), Math.ceil(rows / 2)]; + } + function getPackedRGBAArraySizeFromMatrixShape(rows, columns) { + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + return w * h * 4; + } + function encodeMatrixToPackedRGBA(matrix, rows, columns, packedRGBA) { + var requiredSize = getPackedRGBAArraySizeFromMatrixShape(rows, columns); + if (packedRGBA.length < requiredSize) { + throw new Error("packedRGBA length (" + packedRGBA.length + ") must be >= " + requiredSize); + } + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), textureWidth = _a[0], textureHeight = _a[1]; + var oddWidth = (columns % 2) === 1; + var oddHeight = (rows % 2) === 1; + var widthInFullBlocks = Math.floor(columns / 2); + var heightInFullBlocks = Math.floor(rows / 2); + { + var dstStride = (oddWidth ? 4 : 0); + var oneRow = columns; + var dst = 0; + for (var blockY = 0; blockY < heightInFullBlocks; ++blockY) { + var matrixSrcRow = (blockY * 2 * columns); + for (var blockX = 0; blockX < widthInFullBlocks; ++blockX) { + var matrixSrcCol = blockX * 2; + var src = matrixSrcRow + matrixSrcCol; + packedRGBA[dst] = matrix[src]; + packedRGBA[dst + 1] = matrix[src + 1]; + packedRGBA[dst + 2] = matrix[src + oneRow]; + packedRGBA[dst + 3] = matrix[src + oneRow + 1]; + dst += 4; + } + dst += dstStride; + } + } + if (oddWidth) { + var src = columns - 1; + var dst = (textureWidth - 1) * 4; + var srcStride = 2 * columns; + var dstStride = textureWidth * 4; + for (var blockY = 0; blockY < heightInFullBlocks; ++blockY) { + packedRGBA[dst] = matrix[src]; + packedRGBA[dst + 2] = matrix[src + columns]; + src += srcStride; + dst += dstStride; + } + } + if (oddHeight) { + var src = (rows - 1) * columns; + var dst = (textureHeight - 1) * textureWidth * 4; + for (var blockX = 0; blockX < widthInFullBlocks; ++blockX) { + packedRGBA[dst++] = matrix[src++]; + packedRGBA[dst++] = matrix[src++]; + dst += 2; + } + } + if (oddWidth && oddHeight) { + packedRGBA[packedRGBA.length - 4] = matrix[matrix.length - 1]; + } + return packedRGBA; + } + function decodeMatrixFromPackedRGBA(packedRGBA, rows, columns, matrix) { + var requiredSize = rows * columns; + if (requiredSize < matrix.length) { + throw new Error("matrix length (" + matrix.length + ") must be >= " + requiredSize); + } + var oddWidth = (columns % 2) === 1; + var oddHeight = (rows % 2) === 1; + var widthInFullBlocks = Math.floor(columns / 2); + var heightInFullBlocks = Math.floor(rows / 2); + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), textureWidth = _a[0], textureHeight = _a[1]; + { + var srcStride = oddWidth ? 4 : 0; + var dstStride = columns + (oddWidth ? 1 : 0); + var src = 0; + var dstRow1 = 0; + var dstRow2 = columns; + for (var blockY = 0; blockY < heightInFullBlocks; ++blockY) { + for (var blockX = 0; blockX < widthInFullBlocks; ++blockX) { + matrix[dstRow1++] = packedRGBA[src++]; + matrix[dstRow1++] = packedRGBA[src++]; + matrix[dstRow2++] = packedRGBA[src++]; + matrix[dstRow2++] = packedRGBA[src++]; + } + src += srcStride; + dstRow1 += dstStride; + dstRow2 += dstStride; + } + } + if (oddWidth) { + var src = (textureWidth - 1) * 4; + var dst = columns - 1; + var srcStride = textureWidth * 4; + var dstStride = 2 * columns; + for (var blockY = 0; blockY < heightInFullBlocks; ++blockY) { + matrix[dst] = packedRGBA[src]; + matrix[dst + columns] = packedRGBA[src + 2]; + src += srcStride; + dst += dstStride; + } + } + if (oddHeight) { + var src = (textureHeight - 1) * textureWidth * 4; + var dst = (rows - 1) * columns; + for (var blockX = 0; blockX < widthInFullBlocks; ++blockX) { + matrix[dst++] = packedRGBA[src++]; + matrix[dst++] = packedRGBA[src++]; + src += 2; + } + } + if (oddWidth && oddHeight) { + matrix[matrix.length - 1] = packedRGBA[packedRGBA.length - 4]; + } + return matrix; + } + + var MAX_TEXTURE_SIZE = null; + function createWebGLRenderingContext(attributes) { + var canvas = document.createElement('canvas'); + canvas.width = 1; + canvas.height = 1; + return createWebGLRenderingContextFromCanvas(canvas, attributes); + } + function createWebGLRenderingContextFromCanvas(canvas, attributes) { + var gl; + var webglVersion = ENV.get('WEBGL_VERSION'); + if (webglVersion === 2) { + gl = canvas.getContext('webgl2', attributes); + } + else if (webglVersion === 1) { + gl = (canvas.getContext('webgl', attributes) || + canvas.getContext('experimental-webgl', attributes)); + } + if (webglVersion === 0 || gl == null) { + throw new Error('This browser does not support WebGL.'); + } + return gl; + } + function callAndCheck(gl, func) { + var returnValue = func(); + checkWebGLError(gl); + return returnValue; + } + var webGLDebugErrorCheckingEnabled = false; + function enableDebugWebGLErrorChecking(enabled) { + webGLDebugErrorCheckingEnabled = enabled; + } + function checkWebGLError(gl) { + if (webGLDebugErrorCheckingEnabled) { + var error = gl.getError(); + if (error !== gl.NO_ERROR) { + throw new Error('WebGL Error: ' + getWebGLErrorMessage(gl, error)); + } + } + } + function getWebGLErrorMessage(gl, status) { + switch (status) { + case gl.NO_ERROR: + return 'NO_ERROR'; + case gl.INVALID_ENUM: + return 'INVALID_ENUM'; + case gl.INVALID_VALUE: + return 'INVALID_VALUE'; + case gl.INVALID_OPERATION: + return 'INVALID_OPERATION'; + case gl.INVALID_FRAMEBUFFER_OPERATION: + return 'INVALID_FRAMEBUFFER_OPERATION'; + case gl.OUT_OF_MEMORY: + return 'OUT_OF_MEMORY'; + case gl.CONTEXT_LOST_WEBGL: + return 'CONTEXT_LOST_WEBGL'; + default: + return "Unknown error code " + status; + } + } + function getExtensionOrThrow(gl, extensionName) { + return throwIfNull(gl, function () { return gl.getExtension(extensionName); }, 'Extension "' + extensionName + '" not supported on this browser.'); + } + function createVertexShader(gl, vertexShaderSource) { + var vertexShader = throwIfNull(gl, function () { return gl.createShader(gl.VERTEX_SHADER); }, 'Unable to create vertex WebGLShader.'); + callAndCheck(gl, function () { return gl.shaderSource(vertexShader, vertexShaderSource); }); + callAndCheck(gl, function () { return gl.compileShader(vertexShader); }); + if (gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS) === false) { + console.log(gl.getShaderInfoLog(vertexShader)); + throw new Error('Failed to compile vertex shader.'); + } + return vertexShader; + } + function createFragmentShader(gl, fragmentShaderSource) { + var fragmentShader = throwIfNull(gl, function () { return gl.createShader(gl.FRAGMENT_SHADER); }, 'Unable to create fragment WebGLShader.'); + callAndCheck(gl, function () { return gl.shaderSource(fragmentShader, fragmentShaderSource); }); + callAndCheck(gl, function () { return gl.compileShader(fragmentShader); }); + if (gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS) === false) { + logShaderSourceAndInfoLog(fragmentShaderSource, gl.getShaderInfoLog(fragmentShader)); + throw new Error('Failed to compile fragment shader.'); + } + return fragmentShader; + } + var lineNumberRegex = /ERROR: [0-9]+:([0-9]+):/g; + function logShaderSourceAndInfoLog(shaderSource, shaderInfoLog) { + var lineNumberRegexResult = lineNumberRegex.exec(shaderInfoLog); + if (lineNumberRegexResult == null) { + console.log("Couldn't parse line number in error: " + shaderInfoLog); + console.log(shaderSource); + return; + } + var lineNumber = +lineNumberRegexResult[1]; + var shaderLines = shaderSource.split('\n'); + var pad = shaderLines.length.toString().length + 2; + var linesWithLineNumbers = shaderLines.map(function (line, lineNumber) { + return rightPad((lineNumber + 1).toString(), pad) + line; + }); + var maxLineLength = 0; + for (var i = 0; i < linesWithLineNumbers.length; i++) { + maxLineLength = Math.max(linesWithLineNumbers[i].length, maxLineLength); + } + var beforeErrorLines = linesWithLineNumbers.slice(0, lineNumber - 1); + var errorLine = linesWithLineNumbers.slice(lineNumber - 1, lineNumber); + var afterErrorLines = linesWithLineNumbers.slice(lineNumber); + console.log(beforeErrorLines.join('\n')); + console.log(shaderInfoLog.split('\n')[0]); + console.log("%c " + rightPad(errorLine[0], maxLineLength), 'border:1px solid red; background-color:#e3d2d2; color:#a61717'); + console.log(afterErrorLines.join('\n')); + } + function createProgram(gl) { + return throwIfNull(gl, function () { return gl.createProgram(); }, 'Unable to create WebGLProgram.'); + } + function linkProgram(gl, program) { + callAndCheck(gl, function () { return gl.linkProgram(program); }); + if (gl.getProgramParameter(program, gl.LINK_STATUS) === false) { + console.log(gl.getProgramInfoLog(program)); + throw new Error('Failed to link vertex and fragment shaders.'); + } + } + function validateProgram(gl, program) { + callAndCheck(gl, function () { return gl.validateProgram(program); }); + if (gl.getProgramParameter(program, gl.VALIDATE_STATUS) === false) { + console.log(gl.getProgramInfoLog(program)); + throw new Error('Shader program validation failed.'); + } + } + function createStaticVertexBuffer(gl, data) { + var buffer = throwIfNull(gl, function () { return gl.createBuffer(); }, 'Unable to create WebGLBuffer'); + callAndCheck(gl, function () { return gl.bindBuffer(gl.ARRAY_BUFFER, buffer); }); + callAndCheck(gl, function () { return gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW); }); + return buffer; + } + function createStaticIndexBuffer(gl, data) { + var buffer = throwIfNull(gl, function () { return gl.createBuffer(); }, 'Unable to create WebGLBuffer'); + callAndCheck(gl, function () { return gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer); }); + callAndCheck(gl, function () { return gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, gl.STATIC_DRAW); }); + return buffer; + } + function queryMaxTextureSize(gl) { + if (MAX_TEXTURE_SIZE != null) { + return MAX_TEXTURE_SIZE; + } + MAX_TEXTURE_SIZE = + callAndCheck(gl, function () { return gl.getParameter(gl.MAX_TEXTURE_SIZE); }); + return MAX_TEXTURE_SIZE; + } + function getNumChannels() { + if (ENV.get('WEBGL_VERSION') === 2) { + return 1; + } + return 4; + } + function createTexture(gl) { + return throwIfNull(gl, function () { return gl.createTexture(); }, 'Unable to create WebGLTexture.'); + } + function validateTextureSize(gl, width, height) { + var maxTextureSize = queryMaxTextureSize(gl); + if ((width <= 0) || (height <= 0)) { + var requested = "[" + width + "x" + height + "]"; + throw new Error('Requested texture size ' + requested + ' is invalid.'); + } + if ((width > maxTextureSize) || (height > maxTextureSize)) { + var requested = "[" + width + "x" + height + "]"; + var max = "[" + maxTextureSize + "x" + maxTextureSize + "]"; + throw new Error('Requested texture size ' + requested + + ' greater than WebGL maximum on this browser / GPU ' + max + '.'); + } + } + function createFramebuffer(gl) { + return throwIfNull(gl, function () { return gl.createFramebuffer(); }, 'Unable to create WebGLFramebuffer.'); + } + function bindVertexBufferToProgramAttribute(gl, program, attribute, buffer, arrayEntriesPerItem, itemStrideInBytes, itemOffsetInBytes) { + var loc = gl.getAttribLocation(program, attribute); + if (loc === -1) { + return false; + } + callAndCheck(gl, function () { return gl.bindBuffer(gl.ARRAY_BUFFER, buffer); }); + callAndCheck(gl, function () { return gl.vertexAttribPointer(loc, arrayEntriesPerItem, gl.FLOAT, false, itemStrideInBytes, itemOffsetInBytes); }); + callAndCheck(gl, function () { return gl.enableVertexAttribArray(loc); }); + return true; + } + function bindTextureUnit(gl, texture, textureUnit) { + validateTextureUnit(gl, textureUnit); + callAndCheck(gl, function () { return gl.activeTexture(gl.TEXTURE0 + textureUnit); }); + callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, texture); }); + } + function unbindTextureUnit(gl, textureUnit) { + validateTextureUnit(gl, textureUnit); + callAndCheck(gl, function () { return gl.activeTexture(gl.TEXTURE0 + textureUnit); }); + callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, null); }); + } + function getProgramUniformLocationOrThrow(gl, program, uniformName) { + return throwIfNull(gl, function () { return gl.getUniformLocation(program, uniformName); }, 'uniform "' + uniformName + '" not present in program.'); + } + function getProgramUniformLocation(gl, program, uniformName) { + return gl.getUniformLocation(program, uniformName); + } + function bindTextureToProgramUniformSampler(gl, program, texture, uniformSamplerLocation, textureUnit) { + callAndCheck(gl, function () { return bindTextureUnit(gl, texture, textureUnit); }); + callAndCheck(gl, function () { return gl.uniform1i(uniformSamplerLocation, textureUnit); }); + } + function bindCanvasToFramebuffer(gl) { + callAndCheck(gl, function () { return gl.bindFramebuffer(gl.FRAMEBUFFER, null); }); + callAndCheck(gl, function () { return gl.viewport(0, 0, gl.canvas.width, gl.canvas.height); }); + callAndCheck(gl, function () { return gl.scissor(0, 0, gl.canvas.width, gl.canvas.height); }); + } + function bindColorTextureToFramebuffer(gl, texture, framebuffer) { + callAndCheck(gl, function () { return gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); }); + callAndCheck(gl, function () { return gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); }); + } + function unbindColorTextureFromFramebuffer(gl, framebuffer) { + callAndCheck(gl, function () { return gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); }); + callAndCheck(gl, function () { return gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0); }); + } + function validateFramebuffer(gl) { + var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + if (status !== gl.FRAMEBUFFER_COMPLETE) { + throw new Error('Error binding framebuffer: ' + getFramebufferErrorMessage(gl, status)); + } + } + function getFramebufferErrorMessage(gl, status) { + switch (status) { + case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: + return 'FRAMEBUFFER_INCOMPLETE_ATTACHMENT'; + case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: + return 'FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT'; + case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: + return 'FRAMEBUFFER_INCOMPLETE_DIMENSIONS'; + case gl.FRAMEBUFFER_UNSUPPORTED: + return 'FRAMEBUFFER_UNSUPPORTED'; + default: + return "unknown error " + status; + } + } + function throwIfNull(gl, returnTOrNull, failureMessage) { + var tOrNull = callAndCheck(gl, function () { return returnTOrNull(); }); + if (tOrNull == null) { + throw new Error(failureMessage); + } + return tOrNull; + } + function validateTextureUnit(gl, textureUnit) { + var maxTextureUnit = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1; + var glTextureUnit = textureUnit + gl.TEXTURE0; + if (glTextureUnit < gl.TEXTURE0 || glTextureUnit > maxTextureUnit) { + var textureUnitRange = "[gl.TEXTURE0, gl.TEXTURE" + maxTextureUnit + "]"; + throw new Error("textureUnit must be in " + textureUnitRange + "."); + } + } + function getTextureShapeFromLogicalShape(gl, logShape) { + if (logShape.length !== 2) { + var squeezeResult = squeezeShape(logShape); + logShape = squeezeResult.newShape; + } + var maxTexSize = queryMaxTextureSize(gl); + var size = sizeFromShape(logShape); + if (logShape.length <= 1 && size <= maxTexSize) { + return [size, 1]; + } + else if (logShape.length === 2 && logShape[0] <= maxTexSize && + logShape[1] <= maxTexSize) { + return logShape; + } + else if (logShape.length === 3 && logShape[0] <= maxTexSize && + logShape[1] * logShape[2] <= maxTexSize) { + return [logShape[0], logShape[1] * logShape[2]]; + } + else if (logShape.length === 4 && logShape[0] <= maxTexSize && + logShape[1] * logShape[2] * logShape[3] <= maxTexSize) { + return [logShape[0], logShape[1] * logShape[2] * logShape[3]]; + } + else { + return sizeToSquarishShape(size); + } + } + + var webgl_util = /*#__PURE__*/Object.freeze({ + createWebGLRenderingContext: createWebGLRenderingContext, + createWebGLRenderingContextFromCanvas: createWebGLRenderingContextFromCanvas, + callAndCheck: callAndCheck, + enableDebugWebGLErrorChecking: enableDebugWebGLErrorChecking, + checkWebGLError: checkWebGLError, + getWebGLErrorMessage: getWebGLErrorMessage, + getExtensionOrThrow: getExtensionOrThrow, + createVertexShader: createVertexShader, + createFragmentShader: createFragmentShader, + createProgram: createProgram, + linkProgram: linkProgram, + validateProgram: validateProgram, + createStaticVertexBuffer: createStaticVertexBuffer, + createStaticIndexBuffer: createStaticIndexBuffer, + queryMaxTextureSize: queryMaxTextureSize, + getNumChannels: getNumChannels, + createTexture: createTexture, + validateTextureSize: validateTextureSize, + createFramebuffer: createFramebuffer, + bindVertexBufferToProgramAttribute: bindVertexBufferToProgramAttribute, + bindTextureUnit: bindTextureUnit, + unbindTextureUnit: unbindTextureUnit, + getProgramUniformLocationOrThrow: getProgramUniformLocationOrThrow, + getProgramUniformLocation: getProgramUniformLocation, + bindTextureToProgramUniformSampler: bindTextureToProgramUniformSampler, + bindCanvasToFramebuffer: bindCanvasToFramebuffer, + bindColorTextureToFramebuffer: bindColorTextureToFramebuffer, + unbindColorTextureFromFramebuffer: unbindColorTextureFromFramebuffer, + validateFramebuffer: validateFramebuffer, + getFramebufferErrorMessage: getFramebufferErrorMessage, + getTextureShapeFromLogicalShape: getTextureShapeFromLogicalShape + }); + + function getWebGLContextAttributes() { + return { + alpha: false, + antialias: false, + premultipliedAlpha: false, + preserveDrawingBuffer: false, + depth: false, + stencil: false, + failIfMajorPerformanceCaveat: true + }; + } + function createWebGLContext(canvas) { + var attributes = getWebGLContextAttributes(); + var gl; + if (canvas != null) { + gl = createWebGLRenderingContextFromCanvas(canvas, attributes); + } + else { + gl = createWebGLRenderingContext(attributes); + } + callAndCheck(gl, function () { return gl.disable(gl.DEPTH_TEST); }); + callAndCheck(gl, function () { return gl.disable(gl.STENCIL_TEST); }); + callAndCheck(gl, function () { return gl.disable(gl.BLEND); }); + callAndCheck(gl, function () { return gl.disable(gl.DITHER); }); + callAndCheck(gl, function () { return gl.disable(gl.POLYGON_OFFSET_FILL); }); + callAndCheck(gl, function () { return gl.disable(gl.SAMPLE_COVERAGE); }); + callAndCheck(gl, function () { return gl.enable(gl.SCISSOR_TEST); }); + callAndCheck(gl, function () { return gl.enable(gl.CULL_FACE); }); + callAndCheck(gl, function () { return gl.cullFace(gl.BACK); }); + return gl; + } + function createVertexShader$1(gl) { + var vertexShaderSource = "\n precision highp float;\n attribute vec3 clipSpacePos;\n attribute vec2 uv;\n varying vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }"; + return createVertexShader(gl, vertexShaderSource); + } + function createVertexBuffer(gl) { + var vertexArray = new Float32Array([-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0]); + return createStaticVertexBuffer(gl, vertexArray); + } + function createIndexBuffer(gl) { + var triangleVertexIndices = new Uint16Array([0, 1, 2, 2, 1, 3]); + return createStaticIndexBuffer(gl, triangleVertexIndices); + } + function getTextureConfig(gl, textureHalfFloatExtension) { + var glany = gl; + var internalFormatFloat; + var internalFormatHalfFloat; + var internalFormatPackedFloat; + var textureFormatFloat; + var downloadTextureFormat; + var downloadUnpackNumChannels; + var defaultNumChannels; + var textureTypeHalfFloat; + if (ENV.get('WEBGL_VERSION') === 2) { + internalFormatFloat = glany.R32F; + internalFormatHalfFloat = glany.R16F; + internalFormatPackedFloat = glany.RGBA32F; + textureFormatFloat = glany.RED; + downloadUnpackNumChannels = 4; + defaultNumChannels = 1; + textureTypeHalfFloat = glany.HALF_FLOAT; + } + else { + internalFormatFloat = gl.RGBA; + internalFormatHalfFloat = gl.RGBA; + internalFormatPackedFloat = glany.RGBA; + textureFormatFloat = gl.RGBA; + downloadUnpackNumChannels = 4; + defaultNumChannels = 4; + textureTypeHalfFloat = textureHalfFloatExtension != null ? + textureHalfFloatExtension.HALF_FLOAT_OES : + null; + } + downloadTextureFormat = gl.RGBA; + return { + internalFormatFloat: internalFormatFloat, + internalFormatHalfFloat: internalFormatHalfFloat, + internalFormatPackedFloat: internalFormatPackedFloat, + textureFormatFloat: textureFormatFloat, + downloadTextureFormat: downloadTextureFormat, + downloadUnpackNumChannels: downloadUnpackNumChannels, + defaultNumChannels: defaultNumChannels, + textureTypeHalfFloat: textureTypeHalfFloat + }; + } + function createAndConfigureTexture(gl, width, height, internalFormat, textureFormat, textureType) { + validateTextureSize(gl, width, height); + var texture = createTexture(gl); + var tex2d = gl.TEXTURE_2D; + callAndCheck(gl, function () { return gl.bindTexture(tex2d, texture); }); + callAndCheck(gl, function () { return gl.texParameteri(tex2d, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); }); + callAndCheck(gl, function () { return gl.texParameteri(tex2d, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); }); + callAndCheck(gl, function () { return gl.texParameteri(tex2d, gl.TEXTURE_MIN_FILTER, gl.NEAREST); }); + callAndCheck(gl, function () { return gl.texParameteri(tex2d, gl.TEXTURE_MAG_FILTER, gl.NEAREST); }); + callAndCheck(gl, function () { return gl.texImage2D(tex2d, 0, internalFormat, width, height, 0, textureFormat, textureType, null); }); + callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, null); }); + return texture; + } + function createFloat32MatrixTexture(gl, rows, columns, textureConfig) { + var _a = getUnpackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + return createAndConfigureTexture(gl, width, height, textureConfig.internalFormatFloat, textureConfig.textureFormatFloat, gl.FLOAT); + } + function createFloat16MatrixTexture(gl, rows, columns, textureConfig) { + var _a = getUnpackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + return createAndConfigureTexture(gl, width, height, textureConfig.internalFormatFloat, textureConfig.textureFormatFloat, textureConfig.textureTypeHalfFloat); + } + function createUnsignedBytesMatrixTexture(gl, rows, columns, textureConfig) { + var _a = getUnpackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + return createAndConfigureTexture(gl, width, height, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE); + } + function createPackedMatrixTexture(gl, rows, columns, textureConfig) { + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + return createAndConfigureTexture(gl, width, height, textureConfig.internalFormatPackedFloat, gl.RGBA, gl.FLOAT); + } + function bindVertexProgramAttributeStreams(gl, program, vertexBuffer) { + var posOffset = 0; + var uvOffset = 3 * 4; + var stride = (3 * 4) + (2 * 4); + callAndCheck(gl, function () { return gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); }); + var success = bindVertexBufferToProgramAttribute(gl, program, 'clipSpacePos', vertexBuffer, 3, stride, posOffset); + return success && + bindVertexBufferToProgramAttribute(gl, program, 'uv', vertexBuffer, 2, stride, uvOffset); + } + function uploadPixelDataToTexture(gl, texture, pixels) { + callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, texture); }); + callAndCheck(gl, function () { return gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, pixels); }); + callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, null); }); + } + function uploadDataToTexture(gl, texture, width, height, data, textureFormat) { + validateTextureSize(gl, width, height); + callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, texture); }); + callAndCheck(gl, function () { return gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, textureFormat, gl.FLOAT, data); }); + callAndCheck(gl, function () { return gl.bindTexture(gl.TEXTURE_2D, null); }); + } + function uploadMatrixToTexture(gl, texture, rows, columns, matrix, numChannels, textureConfig) { + var _a = getUnpackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var unpackedArray; + if (textureConfig.defaultNumChannels === 1) { + unpackedArray = matrix; + } + else { + unpackedArray = + new Float32Array(getUnpackedArraySizeFromMatrixSize(matrix.length, numChannels)); + encodeMatrixToUnpackedArray(matrix, unpackedArray, numChannels); + } + uploadDataToTexture(gl, texture, w, h, unpackedArray, textureConfig.textureFormatFloat); + } + function uploadMatrixToPackedTexture(gl, texture, rows, columns, matrix, textureConfig) { + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var packedRGBA = new Float32Array(getPackedRGBAArraySizeFromMatrixShape(rows, columns)); + encodeMatrixToPackedRGBA(matrix, rows, columns, packedRGBA); + uploadDataToTexture(gl, texture, w, h, packedRGBA, gl.RGBA); + } + function maybeCreateBufferFromOutputTexture(gl, texture, rows, columns, textureConfig) { + var bufferOrTexture = texture; + if (ENV.get('WEBGL_VERSION') === 2) { + var gl2_1 = gl; + var buffer_1 = gl2_1.createBuffer(); + callAndCheck(gl, function () { return gl.bindBuffer(gl2_1.PIXEL_PACK_BUFFER, buffer_1); }); + var bytesPerFloat = 4; + var bufferSizeBytes_1 = bytesPerFloat * + getUnpackedArraySizeFromMatrixSize(rows * columns, textureConfig.downloadUnpackNumChannels); + callAndCheck(gl, function () { return gl.bufferData(gl2_1.PIXEL_PACK_BUFFER, bufferSizeBytes_1, gl.STATIC_DRAW); }); + callAndCheck(gl, function () { return gl2_1.readPixels(0, 0, columns, rows, gl.RGBA, gl.FLOAT, 0); }); + callAndCheck(gl, function () { return gl.bindBuffer(gl2_1.PIXEL_PACK_BUFFER, null); }); + bufferOrTexture = buffer_1; + } + return bufferOrTexture; + } + function downloadFloat32MatrixFromBuffer(gl, buffer, rows, columns, textureConfig) { + var gl2 = gl; + var downloadTarget = new Float32Array(getUnpackedArraySizeFromMatrixSize(rows * columns, textureConfig.downloadUnpackNumChannels)); + gl2.bindBuffer(gl.ARRAY_BUFFER, buffer); + gl2.getBufferSubData(gl.ARRAY_BUFFER, 0, downloadTarget); + gl2.bindBuffer(gl.ARRAY_BUFFER, null); + var matrix = new Float32Array(rows * columns); + decodeMatrixFromUnpackedArray(downloadTarget, matrix, textureConfig.downloadUnpackNumChannels); + return matrix; + } + function downloadFloat32MatrixFromOutputTexture(gl, rows, columns, textureConfig) { + var _a = getUnpackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var downloadTarget = new Float32Array(getUnpackedArraySizeFromMatrixSize(rows * columns, textureConfig.downloadUnpackNumChannels)); + callAndCheck(gl, function () { return gl.readPixels(0, 0, w, h, textureConfig.downloadTextureFormat, gl.FLOAT, downloadTarget); }); + var matrix = new Float32Array(rows * columns); + decodeMatrixFromUnpackedArray(downloadTarget, matrix, textureConfig.downloadUnpackNumChannels); + return matrix; + } + function downloadByteEncodedFloatMatrixFromOutputTexture(gl, rows, columns, textureConfig) { + var _a = getUnpackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var numChannels = 4; + var downloadTarget = new Uint8Array(getUnpackedArraySizeFromMatrixSize(rows * columns, numChannels)); + callAndCheck(gl, function () { return gl.readPixels(0, 0, w, h, textureConfig.downloadTextureFormat, gl.UNSIGNED_BYTE, downloadTarget); }); + return new Float32Array(downloadTarget.buffer); + } + function downloadMatrixFromPackedOutputTexture(gl, rows, columns, textureConfig) { + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), w = _a[0], h = _a[1]; + var packedRGBA = new Float32Array(getPackedRGBAArraySizeFromMatrixShape(rows, columns)); + callAndCheck(gl, function () { return gl.readPixels(0, 0, w, h, gl.RGBA, gl.FLOAT, packedRGBA); }); + var matrix = new Float32Array(rows * columns); + return decodeMatrixFromPackedRGBA(packedRGBA, rows, columns, matrix); + } + + var gpgpu_util = /*#__PURE__*/Object.freeze({ + getWebGLContextAttributes: getWebGLContextAttributes, + createWebGLContext: createWebGLContext, + createVertexShader: createVertexShader$1, + createVertexBuffer: createVertexBuffer, + createIndexBuffer: createIndexBuffer, + getTextureConfig: getTextureConfig, + createFloat32MatrixTexture: createFloat32MatrixTexture, + createFloat16MatrixTexture: createFloat16MatrixTexture, + createUnsignedBytesMatrixTexture: createUnsignedBytesMatrixTexture, + createPackedMatrixTexture: createPackedMatrixTexture, + bindVertexProgramAttributeStreams: bindVertexProgramAttributeStreams, + uploadPixelDataToTexture: uploadPixelDataToTexture, + uploadMatrixToTexture: uploadMatrixToTexture, + uploadMatrixToPackedTexture: uploadMatrixToPackedTexture, + maybeCreateBufferFromOutputTexture: maybeCreateBufferFromOutputTexture, + downloadFloat32MatrixFromBuffer: downloadFloat32MatrixFromBuffer, + downloadFloat32MatrixFromOutputTexture: downloadFloat32MatrixFromOutputTexture, + downloadByteEncodedFloatMatrixFromOutputTexture: downloadByteEncodedFloatMatrixFromOutputTexture, + downloadMatrixFromPackedOutputTexture: downloadMatrixFromPackedOutputTexture + }); + + var GPGPUContext = (function () { + function GPGPUContext(gl) { + this.outputTexture = null; + this.program = null; + this.disposed = false; + this.autoDebugValidate = false; + this.vertexAttrsAreBound = false; + this.itemsToPoll = []; + if (gl != null) { + this.gl = gl; + } + else { + this.gl = createWebGLContext(); + } + if (ENV.get('WEBGL_VERSION') === 1) { + this.textureFloatExtension = + getExtensionOrThrow(this.gl, 'OES_texture_float'); + this.colorBufferFloatExtension = + this.gl.getExtension('WEBGL_color_buffer_float'); + if (!ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) { + this.textureHalfFloatExtension = + getExtensionOrThrow(this.gl, 'OES_texture_half_float'); + this.colorBufferHalfFloatExtension = + this.gl.getExtension('EXT_color_buffer_half_float'); + } + } + else { + this.colorBufferFloatExtension = + getExtensionOrThrow(this.gl, 'EXT_color_buffer_float'); + } + this.loseContextExtension = + getExtensionOrThrow(this.gl, 'WEBGL_lose_context'); + this.vertexBuffer = createVertexBuffer(this.gl); + this.indexBuffer = createIndexBuffer(this.gl); + this.framebuffer = createFramebuffer(this.gl); + this.textureConfig = + getTextureConfig(this.gl, this.textureHalfFloatExtension); + } + GPGPUContext.prototype.dispose = function () { + var _this = this; + if (this.disposed) { + return; + } + if (this.program != null) { + console.warn('Disposing a GPGPUContext that still has a bound WebGLProgram.' + + ' This is probably a resource leak, delete the program with ' + + 'GPGPUContext.deleteProgram before disposing.'); + } + if (this.outputTexture != null) { + console.warn('Disposing a GPGPUContext that still has a bound output matrix ' + + 'texture. This is probably a resource leak, delete the output ' + + 'matrix texture with GPGPUContext.deleteMatrixTexture before ' + + 'disposing.'); + } + var gl = this.gl; + callAndCheck(gl, function () { return gl.finish(); }); + callAndCheck(gl, function () { return gl.bindFramebuffer(gl.FRAMEBUFFER, null); }); + callAndCheck(gl, function () { return gl.deleteFramebuffer(_this.framebuffer); }); + callAndCheck(gl, function () { return gl.bindBuffer(gl.ARRAY_BUFFER, null); }); + callAndCheck(gl, function () { return gl.deleteBuffer(_this.vertexBuffer); }); + callAndCheck(gl, function () { return gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); }); + callAndCheck(gl, function () { return gl.deleteBuffer(_this.indexBuffer); }); + this.loseContextExtension.loseContext(); + this.disposed = true; + }; + GPGPUContext.prototype.enableAutomaticDebugValidation = function (enabled) { + this.autoDebugValidate = enabled; + enableDebugWebGLErrorChecking(enabled); + }; + GPGPUContext.prototype.createFloat32MatrixTexture = function (rows, columns) { + this.throwIfDisposed(); + return createFloat32MatrixTexture(this.gl, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.createFloat16MatrixTexture = function (rows, columns) { + this.throwIfDisposed(); + return createFloat16MatrixTexture(this.gl, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.createUnsignedBytesMatrixTexture = function (rows, columns) { + this.throwIfDisposed(); + return createUnsignedBytesMatrixTexture(this.gl, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.uploadPixelDataToTexture = function (texture, pixels) { + this.throwIfDisposed(); + uploadPixelDataToTexture(this.gl, texture, pixels); + }; + GPGPUContext.prototype.createPackedMatrixTexture = function (rows, columns) { + this.throwIfDisposed(); + return createPackedMatrixTexture(this.gl, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.deleteMatrixTexture = function (texture) { + var _this = this; + this.throwIfDisposed(); + if (this.outputTexture === texture) { + unbindColorTextureFromFramebuffer(this.gl, this.framebuffer); + this.outputTexture = null; + } + callAndCheck(this.gl, function () { return _this.gl.deleteTexture(texture); }); + }; + GPGPUContext.prototype.uploadMatrixToTexture = function (texture, rows, columns, matrix) { + this.throwIfDisposed(); + var numChannels = getNumChannels(); + return uploadMatrixToTexture(this.gl, texture, rows, columns, matrix, numChannels, this.textureConfig); + }; + GPGPUContext.prototype.uploadMatrixToPackedTexture = function (texture, rows, columns, matrix) { + this.throwIfDisposed(); + return uploadMatrixToPackedTexture(this.gl, texture, rows, columns, matrix, this.textureConfig); + }; + GPGPUContext.prototype.downloadFloat32MatrixFromOutputTexture = function (texture, rows, columns) { + var _this = this; + return this.downloadMatrixDriver(texture, function () { return downloadFloat32MatrixFromOutputTexture(_this.gl, rows, columns, _this.textureConfig); }); + }; + GPGPUContext.prototype.downloadByteEncodedFloatMatrixFromOutputTexture = function (texture, rows, columns) { + var _this = this; + return this.downloadMatrixDriver(texture, function () { return downloadByteEncodedFloatMatrixFromOutputTexture(_this.gl, rows, columns, _this.textureConfig); }); + }; + GPGPUContext.prototype.downloadFloat32MatrixFromBuffer = function (buffer, rows, columns) { + return downloadFloat32MatrixFromBuffer(this.gl, buffer, rows, columns, this.textureConfig); + }; + GPGPUContext.prototype.maybeCreateBufferFromTexture = function (texture, rows, columns) { + this.bindTextureToFrameBuffer(texture); + var result = maybeCreateBufferFromOutputTexture(this.gl, texture, rows, columns, this.textureConfig); + this.unbindTextureToFrameBuffer(); + return result; + }; + GPGPUContext.prototype.createAndWaitForFence = function () { + var fenceContext = this.createFence(this.gl); + return this.pollFence(fenceContext); + }; + GPGPUContext.prototype.createFence = function (gl) { + var _this = this; + var query; + var isFencePassed; + if (ENV.get('WEBGL_FENCE_API_ENABLED')) { + var gl2_1 = gl; + var sync_1 = gl2_1.fenceSync(gl2_1.SYNC_GPU_COMMANDS_COMPLETE, 0); + gl.flush(); + isFencePassed = function () { + var status = gl2_1.clientWaitSync(sync_1, 0, 0); + return status === gl2_1.ALREADY_SIGNALED || + status === gl2_1.CONDITION_SATISFIED; + }; + query = sync_1; + } + else if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) { + query = this.beginQuery(); + this.endQuery(); + isFencePassed = function () { return _this.isQueryAvailable(query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')); }; + } + else { + isFencePassed = function () { return true; }; + } + return { query: query, isFencePassed: isFencePassed }; + }; + GPGPUContext.prototype.downloadMatrixFromPackedTexture = function (texture, rows, columns) { + var _this = this; + return this.downloadMatrixDriver(texture, function () { return downloadMatrixFromPackedOutputTexture(_this.gl, rows, columns, _this.textureConfig); }); + }; + GPGPUContext.prototype.createProgram = function (fragmentShaderSource) { + this.throwIfDisposed(); + var gl = this.gl; + var fragmentShader = createFragmentShader(gl, fragmentShaderSource); + var vertexShader = createVertexShader$1(gl); + var program = createProgram(gl); + callAndCheck(gl, function () { return gl.attachShader(program, vertexShader); }); + callAndCheck(gl, function () { return gl.attachShader(program, fragmentShader); }); + linkProgram(gl, program); + if (this.autoDebugValidate) { + validateProgram(gl, program); + } + if (!this.vertexAttrsAreBound) { + this.setProgram(program); + this.vertexAttrsAreBound = bindVertexProgramAttributeStreams(gl, this.program, this.vertexBuffer); + } + return program; + }; + GPGPUContext.prototype.deleteProgram = function (program) { + var _this = this; + this.throwIfDisposed(); + if (program === this.program) { + this.program = null; + } + if (program != null) { + callAndCheck(this.gl, function () { return _this.gl.deleteProgram(program); }); + } + }; + GPGPUContext.prototype.setProgram = function (program) { + var _this = this; + this.throwIfDisposed(); + this.program = program; + if ((this.program != null) && this.autoDebugValidate) { + validateProgram(this.gl, this.program); + } + callAndCheck(this.gl, function () { return _this.gl.useProgram(program); }); + }; + GPGPUContext.prototype.getUniformLocation = function (program, uniformName, shouldThrow) { + if (shouldThrow === void 0) { shouldThrow = true; } + this.throwIfDisposed(); + if (shouldThrow) { + return getProgramUniformLocationOrThrow(this.gl, program, uniformName); + } + else { + return getProgramUniformLocation(this.gl, program, uniformName); + } + }; + GPGPUContext.prototype.getAttributeLocation = function (program, attribute) { + var _this = this; + this.throwIfDisposed(); + return callAndCheck(this.gl, function () { return _this.gl.getAttribLocation(program, attribute); }); + }; + GPGPUContext.prototype.getUniformLocationNoThrow = function (program, uniformName) { + this.throwIfDisposed(); + return this.gl.getUniformLocation(program, uniformName); + }; + GPGPUContext.prototype.setInputMatrixTexture = function (inputMatrixTexture, uniformLocation, textureUnit) { + this.throwIfDisposed(); + this.throwIfNoProgram(); + bindTextureToProgramUniformSampler(this.gl, this.program, inputMatrixTexture, uniformLocation, textureUnit); + }; + GPGPUContext.prototype.setOutputMatrixTexture = function (outputMatrixTexture, rows, columns) { + this.setOutputMatrixTextureDriver(outputMatrixTexture, columns, rows); + }; + GPGPUContext.prototype.setOutputPackedMatrixTexture = function (outputPackedMatrixTexture, rows, columns) { + this.throwIfDisposed(); + var _a = getPackedMatrixTextureShapeWidthHeight(rows, columns), width = _a[0], height = _a[1]; + this.setOutputMatrixTextureDriver(outputPackedMatrixTexture, width, height); + }; + GPGPUContext.prototype.setOutputMatrixWriteRegion = function (startRow, numRows, startColumn, numColumns) { + this.setOutputMatrixWriteRegionDriver(startColumn, startRow, numColumns, numRows); + }; + GPGPUContext.prototype.setOutputPackedMatrixWriteRegion = function (startRow, numRows, startColumn, numColumns) { + throw new Error('setOutputPackedMatrixWriteRegion not implemented.'); + }; + GPGPUContext.prototype.debugValidate = function () { + if (this.program != null) { + validateProgram(this.gl, this.program); + } + validateFramebuffer(this.gl); + }; + GPGPUContext.prototype.executeProgram = function () { + this.throwIfDisposed(); + this.throwIfNoProgram(); + var gl = this.gl; + if (this.autoDebugValidate) { + this.debugValidate(); + } + callAndCheck(gl, function () { return gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0); }); + }; + GPGPUContext.prototype.blockUntilAllProgramsCompleted = function () { + var _this = this; + this.throwIfDisposed(); + callAndCheck(this.gl, function () { return _this.gl.finish(); }); + }; + GPGPUContext.prototype.getQueryTimerExtension = function () { + if (this.disjointQueryTimerExtension == null) { + this.disjointQueryTimerExtension = + getExtensionOrThrow(this.gl, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2 ? + 'EXT_disjoint_timer_query_webgl2' : + 'EXT_disjoint_timer_query'); + } + return this.disjointQueryTimerExtension; + }; + GPGPUContext.prototype.getQueryTimerExtensionWebGL2 = function () { + return this.getQueryTimerExtension(); + }; + GPGPUContext.prototype.getQueryTimerExtensionWebGL1 = function () { + return this.getQueryTimerExtension(); + }; + GPGPUContext.prototype.beginQuery = function () { + if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) { + var gl2 = this.gl; + var ext_1 = this.getQueryTimerExtensionWebGL2(); + var query_1 = gl2.createQuery(); + gl2.beginQuery(ext_1.TIME_ELAPSED_EXT, query_1); + return query_1; + } + var ext = this.getQueryTimerExtensionWebGL1(); + var query = ext.createQueryEXT(); + ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query); + return query; + }; + GPGPUContext.prototype.endQuery = function () { + if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) { + var gl2 = this.gl; + var ext_2 = this.getQueryTimerExtensionWebGL2(); + gl2.endQuery(ext_2.TIME_ELAPSED_EXT); + return; + } + var ext = this.getQueryTimerExtensionWebGL1(); + ext.endQueryEXT(ext.TIME_ELAPSED_EXT); + }; + GPGPUContext.prototype.waitForQueryAndGetTime = function (query) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4, repeatedTry(function () { return _this.isQueryAvailable(query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')); })]; + case 1: + _a.sent(); + return [2, this.getQueryTime(query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'))]; + } + }); + }); + }; + GPGPUContext.prototype.getQueryTime = function (query, queryTimerVersion) { + if (queryTimerVersion === 0) { + return null; + } + if (queryTimerVersion === 2) { + var gl2 = this.gl; + var timeElapsedNanos = gl2.getQueryParameter(query, gl2.QUERY_RESULT); + return timeElapsedNanos / 1000000; + } + else { + var ext = this.getQueryTimerExtensionWebGL1(); + var timeElapsedNanos = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT); + return timeElapsedNanos / 1000000; + } + }; + GPGPUContext.prototype.isQueryAvailable = function (query, queryTimerVersion) { + if (queryTimerVersion === 0) { + return true; + } + if (queryTimerVersion === 2) { + var gl2 = this.gl; + var ext = this.getQueryTimerExtensionWebGL2(); + var available = gl2.getQueryParameter(query, gl2.QUERY_RESULT_AVAILABLE); + if (this.disjoint == null) { + this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT); + } + return available && !this.disjoint; + } + else { + var ext = this.getQueryTimerExtensionWebGL1(); + var available = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT); + if (this.disjoint == null) { + this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT); + } + return available && !this.disjoint; + } + }; + GPGPUContext.prototype.pollFence = function (fenceContext) { + var _this = this; + return new Promise(function (resolve) { + _this.addItemToPoll(function () { return fenceContext.isFencePassed(); }, function () { return resolve(); }); + }); + }; + GPGPUContext.prototype.pollItems = function () { + var index = binSearchLastTrue(this.itemsToPoll.map(function (x) { return x.isDoneFn; })); + for (var i = 0; i <= index; ++i) { + var resolveFn = this.itemsToPoll[i].resolveFn; + resolveFn(); + } + this.itemsToPoll = this.itemsToPoll.slice(index + 1); + }; + GPGPUContext.prototype.addItemToPoll = function (isDoneFn, resolveFn) { + var _this = this; + this.itemsToPoll.push({ isDoneFn: isDoneFn, resolveFn: resolveFn }); + if (this.itemsToPoll.length > 1) { + return; + } + repeatedTry(function () { + _this.pollItems(); + return _this.itemsToPoll.length === 0; + }); + }; + GPGPUContext.prototype.bindTextureToFrameBuffer = function (texture) { + this.throwIfDisposed(); + bindColorTextureToFramebuffer(this.gl, texture, this.framebuffer); + if (this.autoDebugValidate) { + validateFramebuffer(this.gl); + } + }; + GPGPUContext.prototype.unbindTextureToFrameBuffer = function () { + if (this.outputTexture != null) { + bindColorTextureToFramebuffer(this.gl, this.outputTexture, this.framebuffer); + if (this.autoDebugValidate) { + validateFramebuffer(this.gl); + } + } + else { + unbindColorTextureFromFramebuffer(this.gl, this.framebuffer); + } + }; + GPGPUContext.prototype.downloadMatrixDriver = function (texture, downloadAndDecode) { + this.bindTextureToFrameBuffer(texture); + var result = downloadAndDecode(); + this.unbindTextureToFrameBuffer(); + return result; + }; + GPGPUContext.prototype.setOutputMatrixTextureDriver = function (outputMatrixTextureMaybePacked, width, height) { + this.throwIfDisposed(); + var gl = this.gl; + bindColorTextureToFramebuffer(gl, outputMatrixTextureMaybePacked, this.framebuffer); + if (this.autoDebugValidate) { + validateFramebuffer(gl); + } + this.outputTexture = outputMatrixTextureMaybePacked; + callAndCheck(gl, function () { return gl.viewport(0, 0, width, height); }); + callAndCheck(gl, function () { return gl.scissor(0, 0, width, height); }); + }; + GPGPUContext.prototype.setOutputMatrixWriteRegionDriver = function (x, y, width, height) { + var _this = this; + this.throwIfDisposed(); + callAndCheck(this.gl, function () { return _this.gl.scissor(x, y, width, height); }); + }; + GPGPUContext.prototype.throwIfDisposed = function () { + if (this.disposed) { + throw new Error('Attempted to use disposed GPGPUContext.'); + } + }; + GPGPUContext.prototype.throwIfNoProgram = function () { + if (this.program == null) { + throw new Error('No GPU program is currently set.'); + } + }; + return GPGPUContext; + }()); + function binSearchLastTrue(arr) { + var start = 0; + var end = arr.length - 1; + var best = -1; + while (start <= end) { + var mid = (start + end) >> 1; + var isDone = arr[mid](); + if (isDone) { + best = mid; + start = mid + 1; + } + else { + end = mid - 1; + } + } + return best; + } + + function compileProgram(gpgpu, program, inputs, output) { + var userCode = program.userCode; + var inputInfos = inputs.map(function (input, i) { + var shapeInfo = { + logicalShape: input.tensor.shape, + texShape: input.isUniform ? null : input.texData.texShape, + isUniform: input.isUniform + }; + return { name: program.variableNames[i], shapeInfo: shapeInfo }; + }); + var inShapeInfos = inputInfos.map(function (x) { return x.shapeInfo; }); + var outShapeInfo = { + logicalShape: output.tensor.shape, + texShape: output.texData.texShape, + isUniform: false + }; + var source = makeShader(inputInfos, outShapeInfo, userCode, program.supportsBroadcasting === true); + var webGLProgram = gpgpu.createProgram(source); + var uniformLocations = {}; + for (var i = 0; i < program.variableNames.length; i++) { + var uniformName = program.variableNames[i]; + var shouldThrow = false; + uniformLocations[uniformName] = + gpgpu.getUniformLocation(webGLProgram, uniformName, shouldThrow); + } + return { + program: program, + source: source, + webGLProgram: webGLProgram, + uniformLocations: uniformLocations, + gpgpu: gpgpu, + inShapeInfos: inShapeInfos, + outShapeInfo: outShapeInfo + }; + } + function validateBinaryAndProgram(shapeInfos, inputs) { + if (shapeInfos.length !== inputs.length) { + throw Error("Binary was compiled with " + shapeInfos.length + " inputs, but " + + ("was executed with " + inputs.length + " inputs")); + } + shapeInfos.forEach(function (s, i) { + var shapeA = s.logicalShape; + var input = inputs[i]; + var shapeB = input.tensor.shape; + if (!arraysEqual(shapeA, shapeB)) { + throw Error("Binary was compiled with different shapes than " + + ("the current args. Shapes " + shapeA + " and " + shapeB + " must match")); + } + if (s.isUniform && input.isUniform) { + return; + } + var texShapeA = s.texShape; + var texShapeB = input.isUniform ? null : input.texData.texShape; + if (!arraysEqual(texShapeA, texShapeB)) { + throw Error("Binary was compiled with different texture shapes than the" + + (" current args. Shape " + texShapeA + " and " + texShapeB + " must match")); + } + }); + } + function runProgram(binary, inputs, output, customSetup) { + validateBinaryAndProgram(binary.inShapeInfos, inputs); + validateBinaryAndProgram([binary.outShapeInfo], [output]); + var outTex = output.texData.texture; + var outTexShape = output.texData.texShape; + var gpgpu = binary.gpgpu; + gpgpu.setOutputMatrixTexture(outTex, outTexShape[0], outTexShape[1]); + gpgpu.setProgram(binary.webGLProgram); + inputs.forEach(function (input, i) { + var variableName = binary.program.variableNames[i]; + var variableUniformLocation = binary.uniformLocations[variableName]; + if (variableUniformLocation != null) { + if (input.isUniform) { + if (input.tensor.size === 1) { + gpgpu.gl.uniform1f(variableUniformLocation, input.tensor.dataSync()[0]); + } + else { + var vals = input.tensor.dataSync(); + if (!(vals instanceof Float32Array)) { + vals = new Float32Array(vals); + } + gpgpu.gl.uniform1fv(variableUniformLocation, vals); + } + return; + } + var tex = input.texData.texture; + gpgpu.setInputMatrixTexture(tex, variableUniformLocation, i); + } + }); + if (customSetup != null) { + customSetup(gpgpu, binary.webGLProgram); + } + gpgpu.executeProgram(); + } + function makeShaderKey(program, inputs, output) { + var keyInputs = ''; + inputs.concat(output).forEach(function (x) { + keyInputs += + x.tensor.shape + "_" + (x.isUniform ? 'uniform' : x.texData.texShape); + }); + var keyUserCode = program.userCode; + var keyBroadcast = (program.supportsBroadcasting === true).toString(); + var key = program.constructor.name; + key += '_' + keyBroadcast + '_' + keyInputs + '_' + keyUserCode; + return key; + } + + var LRNProgram = (function () { + function LRNProgram(xShape, radius, bias, alpha, beta) { + this.variableNames = ['x']; + this.outputShape = []; + var rad = radius; + var maxD = xShape[3] - 1; + this.outputShape = xShape; + var powOperator; + var basis = "float(" + bias + ") + float(" + alpha + ") * sum"; + if (beta === 0.5) { + powOperator = "inversesqrt(" + basis + ")"; + } + else if (beta === 1.0) { + powOperator = "1.0/(" + basis + ")"; + } + else { + powOperator = "exp(log(" + basis + ") * float(-" + beta + "));"; + } + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -" + rad + "; j <= " + rad + "; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= " + maxD + ") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * " + powOperator + ";\n setOutput(val);\n }\n "; + } + return LRNProgram; + }()); + + var LRNGradProgram = (function () { + function LRNGradProgram(inputShape, depthRadius, bias, alpha, beta) { + this.variableNames = ['inputImage', 'outputImage', 'dy']; + this.outputShape = []; + this.outputShape = inputShape; + this.depth = inputShape[3]; + this.depthRadius = depthRadius; + this.bias = bias; + this.alpha = alpha; + this.beta = beta; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < " + this.depth + "; ++d) {\n int depthBegin = int(max(0.0, float(d - " + depthRadius + ")));\n int depthEnd = int(min(float(" + this.depth + "),\n float(d + " + depthRadius + " + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = " + this.depth + ";\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(" + alpha + ") * norm + float(" + bias + ");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(" + alpha + ")\n * float(" + beta + ")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * " + beta + ");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n "; + } + return LRNGradProgram; + }()); + + var MaxPool2DBackpropProgram = (function () { + function MaxPool2DBackpropProgram(convInfo) { + this.variableNames = ['dy', 'maxPos']; + this.outputShape = convInfo.inShape; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var lastIndex = filterHeight * filterWidth - 1; + this.userCode = "\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + strideHeight + ".0;\n\n if (dyR < 0.0 || dyR >= " + convInfo.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + strideWidth + ".0;\n\n if (dyC < 0.0 || dyC >= " + convInfo.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = " + lastIndex + " - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * " + filterWidth + " + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n "; + } + return MaxPool2DBackpropProgram; + }()); + + var MatMulProgram = (function () { + function MatMulProgram(aShape, bShape, transposeA, transposeB) { + if (transposeA === void 0) { transposeA = false; } + if (transposeB === void 0) { transposeB = false; } + this.variableNames = ['matrixA', 'matrixB']; + var outerShapeA = transposeA ? aShape[1] : aShape[0]; + var outerShapeB = transposeB ? bShape[0] : bShape[1]; + var sharedDim = transposeA ? aShape[0] : aShape[1]; + this.outputShape = [outerShapeA, outerShapeB]; + var aSnippetFromOffset = function (vec4Offset, indexVar) { + return transposeA ? indexVar + " + " + vec4Offset + ", aRow" : + "aRow, " + indexVar + " + " + vec4Offset; + }; + var bSnippetFromOffset = function (vec4Offset, indexVar) { + return transposeB ? "bCol, " + indexVar + " + " + vec4Offset : + indexVar + " + " + vec4Offset + ", bCol"; + }; + var sharedDimNearestVec4 = Math.floor(sharedDim / 4) * 4; + var sharedDimVec4Remainder = sharedDim % 4; + this.userCode = " float dotARowBCol(int aRow, int bCol) {\n float result = 0.0;\n for (int i = 0; i < " + sharedDimNearestVec4 + "; i += 4) {\n vec4 a = vec4(\n getMatrixA(" + aSnippetFromOffset(0, 'i') + "),\n getMatrixA(" + aSnippetFromOffset(1, 'i') + "),\n getMatrixA(" + aSnippetFromOffset(2, 'i') + "),\n getMatrixA(" + aSnippetFromOffset(3, 'i') + ")\n );\n vec4 b = vec4(\n getMatrixB(" + bSnippetFromOffset(0, 'i') + "),\n getMatrixB(" + bSnippetFromOffset(1, 'i') + "),\n getMatrixB(" + bSnippetFromOffset(2, 'i') + "),\n getMatrixB(" + bSnippetFromOffset(3, 'i') + ")\n );\n\n result += dot(a, b);\n }\n\n if (" + (sharedDimVec4Remainder === 1) + ") {\n result += getMatrixA(" + aSnippetFromOffset(0, sharedDimNearestVec4) + ") *\n getMatrixB(" + bSnippetFromOffset(0, sharedDimNearestVec4) + ");\n } else if (" + (sharedDimVec4Remainder === 2) + ") {\n vec2 a = vec2(\n getMatrixA(" + aSnippetFromOffset(0, sharedDimNearestVec4) + "),\n getMatrixA(" + aSnippetFromOffset(1, sharedDimNearestVec4) + ")\n );\n vec2 b = vec2(\n getMatrixB(" + bSnippetFromOffset(0, sharedDimNearestVec4) + "),\n getMatrixB(" + bSnippetFromOffset(1, sharedDimNearestVec4) + ")\n );\n result += dot(a, b);\n } else if (" + (sharedDimVec4Remainder === 3) + ") {\n vec3 a = vec3(\n getMatrixA(" + aSnippetFromOffset(0, sharedDimNearestVec4) + "),\n getMatrixA(" + aSnippetFromOffset(1, sharedDimNearestVec4) + "),\n getMatrixA(" + aSnippetFromOffset(2, sharedDimNearestVec4) + ")\n );\n vec3 b = vec3(\n getMatrixB(" + bSnippetFromOffset(0, sharedDimNearestVec4) + "),\n getMatrixB(" + bSnippetFromOffset(1, sharedDimNearestVec4) + "),\n getMatrixB(" + bSnippetFromOffset(2, sharedDimNearestVec4) + ")\n );\n result += dot(a, b);\n }\n\n return result;\n }\n\n void main() {\n ivec2 resRC = getOutputCoords();\n setOutput(dotARowBCol(resRC.x, resRC.y));\n }\n "; + } + return MatMulProgram; + }()); + + var MultinomialProgram = (function () { + function MultinomialProgram(batchSize, numOutcomes, numSamples) { + this.variableNames = ['probs']; + this.outputShape = [batchSize, numSamples]; + this.userCode = "\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < " + (numOutcomes - 1) + "; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(" + (numOutcomes - 1) + "));\n }\n "; + } + MultinomialProgram.prototype.getCustomSetupFunc = function (seed) { + var _this = this; + return function (gpgpu, webGLProgram) { + if (_this.seedLoc == null) { + _this.seedLoc = gpgpu.getUniformLocation(webGLProgram, 'seed'); + } + gpgpu.gl.uniform1f(_this.seedLoc, seed); + }; + }; + return MultinomialProgram; + }()); + + var OneHotProgram = (function () { + function OneHotProgram(numIndices, depth, onValue, offValue) { + this.variableNames = ['indices']; + this.outputShape = [numIndices, depth]; + this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(" + offValue + "), float(" + onValue + "),\n float(index == coords.y)));\n }\n "; + } + return OneHotProgram; + }()); + + var PadProgram = (function () { + function PadProgram(xShape, paddings, constantValue) { + this.variableNames = ['x']; + this.outputShape = paddings.map(function (p, i) { return p[0] + xShape[i] + p[1]; }); + var rank = xShape.length; + var type = getCoordsDataType(rank); + var start = paddings.map(function (p) { return p[0]; }).join(','); + var end = paddings.map(function (p, i) { return p[0] + xShape[i]; }).join(','); + var unpackedCoords = ['coords[0]', 'coords[1]', 'coords[2]', 'coords[3]'].slice(0, rank); + if (rank === 1) { + this.userCode = "\n int start = " + start + ";\n int end = " + end + ";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float(" + constantValue + "));\n } else {\n setOutput(getX(outC - start));\n }\n }\n "; + return; + } + this.userCode = "\n " + type + " start = " + type + "(" + start + ");\n " + type + " end = " + type + "(" + end + ");\n\n void main() {\n " + type + " outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float(" + constantValue + "));\n } else {\n " + type + " coords = outC - start;\n setOutput(getX(" + unpackedCoords + "));\n }\n }\n "; + } + return PadProgram; + }()); + + var Pool2DProgram = (function () { + function Pool2DProgram(convInfo, poolType, computePositions) { + this.variableNames = ['x']; + if (poolType === 'avg' && computePositions) { + throw new Error('Cannot compute positions for average pool.'); + } + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + this.outputShape = convInfo.outShape; + var isAvgPool = poolType === 'avg'; + var initializationValue = '0.0'; + if (!isAvgPool) { + initializationValue = '-1.0 / 0.0'; + } + if (computePositions) { + var compareOp_1 = '>='; + this.userCode = "\n const ivec2 strides = ivec2(" + strideHeight + ", " + strideWidth + ");\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + filterWidth + "; wC++) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value " + compareOp_1 + " currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * " + filterWidth + " + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n "; + return; + } + var compareOp = 'max'; + var returnValue = poolType + "(" + poolType + "(" + poolType + "(" + + 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])'; + if (poolType === 'avg') { + returnValue = "avgValue / count"; + } + var filterWidthNearestVec4 = Math.floor(filterWidth / 4) * 4; + var filterWidthVec4Remainder = filterWidth % 4; + var updateSnippet = "\n if (" + isAvgPool + ") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = " + compareOp + "(values, minMaxValue);\n }\n "; + this.userCode = "\n const ivec2 strides = ivec2(" + strideHeight + ", " + strideWidth + ");\n const ivec2 pads = ivec2(" + padTop + ", " + padLeft + ");\n const float initializationValue = " + initializationValue + ";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= " + convInfo.inWidth + ") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(" + initializationValue + ");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < " + filterHeight + "; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= " + convInfo.inHeight + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + filterWidthNearestVec4 + "; wC += 4) {\n int xC = xCCorner + wC;\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n getValue(batch, xR, xC + 3, d)\n );\n\n " + updateSnippet + "\n }\n\n int xC = xCCorner + " + filterWidthNearestVec4 + ";\n if (" + (filterWidthVec4Remainder === 1) + ") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n " + updateSnippet + "\n } else if (" + (filterWidthVec4Remainder === 2) + ") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n initializationValue,\n initializationValue\n );\n\n " + updateSnippet + "\n } else if (" + (filterWidthVec4Remainder === 3) + ") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n initializationValue\n );\n\n " + updateSnippet + "\n }\n }\n setOutput(" + returnValue + ");\n }\n "; + } + return Pool2DProgram; + }()); + + var ReduceProgram = (function () { + function ReduceProgram(reduceInfo, reduceType) { + this.variableNames = ['x']; + var windowSize = reduceInfo.windowSize; + var batchSize = reduceInfo.batchSize; + var inSize = reduceInfo.inSize; + var outSize = Math.ceil(inSize / windowSize); + this.outputShape = [batchSize, outSize]; + var initializationValue = '0.0'; + var compareOp = ""; + if (reduceType === 'min') { + initializationValue = '1.0 / 0.0'; + compareOp = "min"; + } + else if (reduceType === 'max') { + initializationValue = '-1.0 / 0.0'; + compareOp = "max"; + } + var returnValue = reduceType + "(" + reduceType + "(" + reduceType + "(" + + 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])'; + if (reduceType === 'sum') { + returnValue = "sumValue"; + } + else if (reduceType === 'all') { + returnValue = "allValue"; + } + else if (reduceType === 'any') { + returnValue = "anyValue"; + } + var windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4; + var windowSizeVec4Remainder = windowSize % 4; + var updateSnippet = "\n if (" + (reduceType === 'sum') + ") {\n sumValue += dot(values, ones);\n } else {\n minMaxValue = " + compareOp + "(values, minMaxValue);\n }\n "; + var vecType = "vec4"; + if (reduceType === 'all') { + initializationValue = '1.0'; + updateSnippet = "\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n "; + vecType = "bvec4"; + } + else if (reduceType === 'any') { + initializationValue = '0.0'; + updateSnippet = "\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n "; + vecType = "bvec4"; + } + var checkOutOfBounds = ''; + if (inSize % windowSize > 0) { + checkOutOfBounds = "\n if (inIdx < 0 || inIdx >= " + inSize + ") {\n return initializationValue;\n }\n "; + } + this.userCode = "\n const float initializationValue = " + initializationValue + ";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n " + checkOutOfBounds + "\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * " + windowSize + ";\n\n vec4 minMaxValue = vec4(" + initializationValue + ");\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < " + windowSizeNearestVec4 + "; i += 4) {\n int inIdx = inOffset + i;\n " + vecType + " values = " + vecType + "(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n " + updateSnippet + "\n }\n\n int inIdx = inOffset + " + windowSizeNearestVec4 + ";\n if (" + (windowSizeVec4Remainder === 1) + ") {\n " + vecType + " values = " + vecType + "(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 2) + ") {\n " + vecType + " values = " + vecType + "(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 3) + ") {\n " + vecType + " values = " + vecType + "(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n " + updateSnippet + "\n }\n setOutput(" + returnValue + ");\n }\n "; + } + return ReduceProgram; + }()); + + var ResizeBilinearBackpropProgram = (function () { + function ResizeBilinearBackpropProgram(dy, x, alignCorners) { + this.variableNames = ['dy']; + this.outputShape = []; + this.outputShape = x.shape; + var _a = x.shape, xHeight = _a[1], xWidth = _a[2]; + var _b = dy.shape, yHeight = _b[1], yWidth = _b[2]; + var effectiveXSize = [ + (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight, + (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth + ]; + var effectiveYSize = [ + (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight, + (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth + ]; + var heightScale = effectiveXSize[0] / effectiveYSize[0]; + var widthScale = effectiveXSize[1] / effectiveYSize[1]; + var invHeightScale = 1 / heightScale; + var invWidthScale = 1 / widthScale; + var winHeight = (Math.ceil(invHeightScale) * 2) + 2; + var winWidth = (Math.ceil(invWidthScale) * 2) + 2; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(" + heightScale + ");\n const float widthScale = float(" + widthScale + ");\n\n const float invHeightScale = float(" + invHeightScale + ");\n const float invWidthScale = float(" + invWidthScale + ");\n\n const int winHeight = int(" + winHeight + ");\n const int winWidth = int(" + winWidth + ");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= " + yHeight + ") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= " + yWidth + ") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), " + (xHeight - 1) + ".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), " + (xWidth - 1) + ".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "; + } + return ResizeBilinearBackpropProgram; + }()); + + var ResizeBilinearProgram = (function () { + function ResizeBilinearProgram(inputShape, newHeight, newWidth, alignCorners) { + this.variableNames = ['A']; + this.outputShape = []; + var batch = inputShape[0], oldHeight = inputShape[1], oldWidth = inputShape[2], depth = inputShape[3]; + this.outputShape = [batch, newHeight, newWidth, depth]; + var effectiveInSize = [ + (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight, + (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth + ]; + var effectiveOutSize = [ + (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight, + (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth + ]; + this.userCode = "\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n " + effectiveInSize[0] / effectiveOutSize[0] + ",\n " + effectiveInSize[1] / effectiveOutSize[1] + ");\n const vec2 inputShapeRC = vec2(" + oldHeight + ".0, " + oldWidth + ".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n "; + } + return ResizeBilinearProgram; + }()); + + var ResizeNearestNeigborBackpropProgram = (function () { + function ResizeNearestNeigborBackpropProgram(dy, x, alignCorners) { + this.variableNames = ['dy']; + this.outputShape = []; + this.outputShape = x.shape; + var _a = x.shape, xHeight = _a[1], xWidth = _a[2]; + var _b = dy.shape, yHeight = _b[1], yWidth = _b[2]; + var effectiveXSize = [ + (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight, + (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth + ]; + var effectiveYSize = [ + (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight, + (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth + ]; + var heightScale = effectiveXSize[0] / effectiveYSize[0]; + var widthScale = effectiveXSize[1] / effectiveYSize[1]; + var invHeightScale = 1 / heightScale; + var invWidthScale = 1 / widthScale; + var winHeight = (Math.ceil(invHeightScale) * 2) + 2; + var winWidth = (Math.ceil(invWidthScale) * 2) + 2; + this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(" + heightScale + ");\n const float widthScale = float(" + widthScale + ");\n\n const float invHeightScale = float(" + invHeightScale + ");\n const float invWidthScale = float(" + invWidthScale + ");\n\n const int winHeight = int(" + winHeight + ");\n const int winWidth = int(" + winWidth + ");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= " + yHeight + ") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= " + yWidth + ") {\n continue;\n }\n\n float sourceFracRow =\n float(" + effectiveXSize[0] + ") *\n (float(dyR) / float(" + effectiveYSize[0] + "));\n\n float sourceFracCol =\n float(" + effectiveXSize[1] + ") *\n (float(dyC) / float(" + effectiveYSize[1] + "));\n\n int sourceNearestRow = int(min(\n float(int(" + xHeight + ") - 1),\n " + alignCorners + " ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(" + xWidth + ") - 1),\n " + alignCorners + " ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "; + } + return ResizeNearestNeigborBackpropProgram; + }()); + + var ResizeNearestNeighborProgram = (function () { + function ResizeNearestNeighborProgram(inputShape, newHeight, newWidth, alignCorners) { + this.variableNames = ['A']; + this.outputShape = []; + var batch = inputShape[0], oldHeight = inputShape[1], oldWidth = inputShape[2], depth = inputShape[3]; + this.outputShape = [batch, newHeight, newWidth, depth]; + var effectiveInSize = [ + (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight, + (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth + ]; + var effectiveOutSize = [ + (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight, + (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth + ]; + var roundBase = alignCorners ? '0.5' : '0.0'; + this.userCode = "\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n " + effectiveInSize[0] / effectiveOutSize[0] + ",\n " + effectiveInSize[1] / effectiveOutSize[1] + ");\n const vec2 inputShapeRC = vec2(" + oldHeight + ".0, " + oldWidth + ".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + " + roundBase + ")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n "; + } + return ResizeNearestNeighborProgram; + }()); + + var ReverseProgram = (function () { + function ReverseProgram(xShape, axis) { + this.variableNames = ['x']; + var rank = xShape.length; + if (rank > 4) { + throw new Error("WebGL backend: Reverse of rank-" + rank + " tensor is not yet supported"); + } + this.outputShape = xShape; + if (rank === 1) { + this.userCode = "\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(" + xShape[0] + " - coord - 1));\n }\n "; + return; + } + var getInCoord = function (i) { + if (axis.indexOf(i) !== -1 && xShape[i] !== 1) { + return xShape[i] + " - coords[" + i + "] - 1"; + } + return "coords[" + i + "]"; + }; + var inCoords = xShape.map(function (_, i) { return getInCoord(i); }).join(','); + var type = getCoordsDataType(rank); + this.userCode = "\n void main() {\n " + type + " coords = getOutputCoords();\n setOutput(getX(" + inCoords + "));\n }\n "; + } + return ReverseProgram; + }()); + + var SegmentOpProgram = (function () { + function SegmentOpProgram(segOpInfo, segOpType) { + this.variableNames = ['x', 'segmentIds']; + var windowSize = segOpInfo.windowSize; + var batchSize = segOpInfo.batchSize; + var inSize = segOpInfo.inSize; + var numSegments = segOpInfo.numSegments; + var outSize = numSegments * Math.ceil(inSize / windowSize); + this.outputShape = [batchSize, outSize]; + var initializationValue = '0.0'; + var returnValue = "sumValue"; + var windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4; + var windowSizeVec4Remainder = windowSize % 4; + var updateSnippet = "\n sumValue += dot(values, filter);\n "; + var checkValueOutOfBounds = ''; + if (inSize % windowSize > 0) { + checkValueOutOfBounds = "\n if (inIdx < 0 || inIdx >= " + inSize + ") {\n return initializationValue;\n }\n "; + } + var checkSegmentIdOutOfBounds = ''; + if (inSize % windowSize > 0) { + checkSegmentIdOutOfBounds = "\n if (inIdx < 0 || inIdx >= " + inSize + ") {\n return -1.0;\n }\n "; + } + this.userCode = "\n const float initializationValue = " + initializationValue + ";\n\n float getValue(int batch, int inIdx) {\n " + checkValueOutOfBounds + "\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n " + checkSegmentIdOutOfBounds + "\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n " + numSegments + ")) * float(" + windowSize + "));\n int currentSeg = int(mod(float(outIdx), float(" + numSegments + ")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < " + windowSizeNearestVec4 + "; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n " + updateSnippet + "\n }\n\n int inIdx = inOffset + " + windowSizeNearestVec4 + ";\n if (" + (windowSizeVec4Remainder === 1) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 2) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n " + updateSnippet + "\n } else if (" + (windowSizeVec4Remainder === 3) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n " + updateSnippet + "\n }\n setOutput(" + returnValue + ");\n }\n "; + } + return SegmentOpProgram; + }()); + + var SelectProgram = (function () { + function SelectProgram(cRank, shape, rank) { + this.variableNames = ['c', 'a', 'b']; + this.outputShape = shape; + var cCoords; + var abCoords; + if (rank > 4) { + throw Error("Where for rank " + rank + " is not yet supported"); + } + if (rank === 1) { + abCoords = "resRC"; + cCoords = "resRC"; + } + else { + var currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w']; + var cCoordVars = []; + var abCoordVars = []; + for (var i = 0; i < shape.length; i++) { + abCoordVars.push("" + currentCoords[i]); + if (i < cRank) { + cCoordVars.push("" + currentCoords[i]); + } + } + cCoords = cCoordVars.join(); + abCoords = abCoordVars.join(); + } + var dtype = getCoordsDataType(rank); + this.userCode = "\n void main() {\n " + dtype + " resRC = getOutputCoords();\n float cVal = getC(" + cCoords + ");\n if (cVal >= 1.0) {\n setOutput(getA(" + abCoords + "));\n } else {\n setOutput(getB(" + abCoords + "));\n }\n }\n "; + } + return SelectProgram; + }()); + + var SliceProgram = (function () { + function SliceProgram(destSize) { + this.variableNames = ['source']; + this.outputShape = destSize; + this.rank = destSize.length; + var dtype = getCoordsDataType(this.rank); + var sourceCoords = getCoords$1(this.rank); + this.userCode = "\n uniform " + dtype + " start;\n\n void main() {\n " + dtype + " sourceLoc = start + getOutputCoords();\n setOutput(getSource(" + sourceCoords + "));\n }\n "; + } + SliceProgram.prototype.getCustomSetupFunc = function (start) { + var _this = this; + if (start.length !== this.rank) { + throw Error("The rank (" + this.rank + ") of the program must match the " + + ("length of start (" + start.length + ")")); + } + return function (gpgpu, webGLProgram) { + if (_this.startLoc == null) { + _this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'start'); + if (_this.startLoc == null) { + return; + } + } + if (_this.rank === 1) { + gpgpu.gl.uniform1i(_this.startLoc, start[0]); + } + else if (_this.rank === 2) { + gpgpu.gl.uniform2i(_this.startLoc, start[0], start[1]); + } + else if (_this.rank === 3) { + gpgpu.gl.uniform3i(_this.startLoc, start[0], start[1], start[2]); + } + else if (_this.rank === 4) { + gpgpu.gl.uniform4i(_this.startLoc, start[0], start[1], start[2], start[3]); + } + else { + throw Error("Slicing for rank " + _this.rank + " is not yet supported"); + } + }; + }; + return SliceProgram; + }()); + function getCoords$1(rank) { + if (rank === 1) { + return 'sourceLoc'; + } + else if (rank === 2) { + return 'sourceLoc.x, sourceLoc.y'; + } + else if (rank === 3) { + return 'sourceLoc.x, sourceLoc.y, sourceLoc.z'; + } + else if (rank === 4) { + return 'sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w'; + } + else { + throw Error("Slicing for rank " + rank + " is not yet supported"); + } + } + + var StridedSliceProgram = (function () { + function StridedSliceProgram(begin, strides, shape) { + this.variableNames = ['x']; + this.outputShape = shape; + this.rank = shape.length; + var dtype = getCoordsDataType(this.rank); + var newCoords = ''; + if (this.rank === 1) { + newCoords = 'coords * strides + begin'; + } + else { + newCoords = + shape.map(function (_, i) { return "coords[" + i + "] * strides[" + i + "] + begin[" + i + "]"; }) + .join(','); + } + this.userCode = "\n " + dtype + " begin = " + dtype + "(" + begin + ");\n " + dtype + " strides = " + dtype + "(" + strides + ");\n\n void main() {\n " + dtype + " coords = getOutputCoords();\n setOutput(getX(" + newCoords + "));\n }\n "; + } + return StridedSliceProgram; + }()); + + var TextureManager = (function () { + function TextureManager(gpgpu) { + this.gpgpu = gpgpu; + this.numUsedTextures = 0; + this.numFreeTextures = 0; + this.freeTextures = {}; + this.logEnabled = false; + this.usedTextures = {}; + } + TextureManager.prototype.acquireTexture = function (shapeRC, usage) { + var physicalTexType = getPhysicalFromLogicalTextureType(usage); + var shapeKey = getKeyFromTextureShape(shapeRC, physicalTexType); + if (!(shapeKey in this.freeTextures)) { + this.freeTextures[shapeKey] = []; + } + if (!(shapeKey in this.usedTextures)) { + this.usedTextures[shapeKey] = []; + } + if (this.freeTextures[shapeKey].length > 0) { + this.numFreeTextures--; + this.numUsedTextures++; + this.log(); + var newTexture_1 = this.freeTextures[shapeKey].shift(); + this.usedTextures[shapeKey].push(newTexture_1); + return newTexture_1; + } + this.numUsedTextures++; + this.log(); + var newTexture; + if (physicalTexType === PhysicalTextureType.FLOAT32) { + newTexture = + this.gpgpu.createFloat32MatrixTexture(shapeRC[0], shapeRC[1]); + } + else if (physicalTexType === PhysicalTextureType.FLOAT16) { + newTexture = + this.gpgpu.createFloat16MatrixTexture(shapeRC[0], shapeRC[1]); + } + else if (physicalTexType === PhysicalTextureType.UNSIGNED_BYTE) { + newTexture = + this.gpgpu.createUnsignedBytesMatrixTexture(shapeRC[0], shapeRC[1]); + } + this.usedTextures[shapeKey].push(newTexture); + return newTexture; + }; + TextureManager.prototype.releaseTexture = function (texture, shape, logicalTexType) { + var physicalTexType = getPhysicalFromLogicalTextureType(logicalTexType); + var shapeKey = getKeyFromTextureShape(shape, physicalTexType); + if (!(shapeKey in this.freeTextures)) { + this.freeTextures[shapeKey] = []; + } + this.freeTextures[shapeKey].push(texture); + this.numFreeTextures++; + this.numUsedTextures--; + var texList = this.usedTextures[shapeKey]; + var texIndex = texList.indexOf(texture); + if (texIndex < 0) { + throw new Error('Cannot release a texture that was never provided by this ' + + 'texture manager'); + } + texList.splice(texIndex, 1); + this.log(); + }; + TextureManager.prototype.log = function () { + if (!this.logEnabled) { + return; + } + var total = this.numFreeTextures + this.numUsedTextures; + console.log('Free/Used', this.numFreeTextures + " / " + this.numUsedTextures, "(" + total + ")"); + }; + TextureManager.prototype.getNumUsedTextures = function () { + return this.numUsedTextures; + }; + TextureManager.prototype.getNumFreeTextures = function () { + return this.numFreeTextures; + }; + TextureManager.prototype.dispose = function () { + var _this = this; + if (this.freeTextures == null) { + return; + } + for (var texShape in this.freeTextures) { + this.freeTextures[texShape].forEach(function (tex) { + _this.gpgpu.deleteMatrixTexture(tex); + }); + } + for (var texShape in this.usedTextures) { + this.usedTextures[texShape].forEach(function (tex) { + _this.gpgpu.deleteMatrixTexture(tex); + }); + } + this.freeTextures = null; + this.usedTextures = null; + this.numUsedTextures = 0; + this.numFreeTextures = 0; + }; + return TextureManager; + }()); + function getPhysicalFromLogicalTextureType(logicalTexType) { + if (logicalTexType === TextureUsage.DOWNLOAD || + logicalTexType === TextureUsage.PIXELS) { + return PhysicalTextureType.UNSIGNED_BYTE; + } + else if (logicalTexType === TextureUsage.UPLOAD) { + return PhysicalTextureType.FLOAT32; + } + else if (logicalTexType === TextureUsage.RENDER) { + return ENV.get('WEBGL_RENDER_FLOAT32_ENABLED') ? + PhysicalTextureType.FLOAT32 : + PhysicalTextureType.FLOAT16; + } + throw new Error("Unknown logical texture type " + logicalTexType); + } + function getKeyFromTextureShape(shapeRowsCol, physicalTexType) { + return shapeRowsCol[0] + "_" + shapeRowsCol[1] + "_" + physicalTexType; + } + + var TileProgram = (function () { + function TileProgram(aShape, reps) { + this.variableNames = ['A']; + var outputShape = new Array(aShape.length); + for (var i = 0; i < outputShape.length; i++) { + outputShape[i] = aShape[i] * reps[i]; + } + this.outputShape = outputShape; + this.rank = outputShape.length; + var dtype = getCoordsDataType(this.rank); + var sourceCoords = getSourceCoords$1(aShape); + this.userCode = "\n void main() {\n " + dtype + " resRC = getOutputCoords();\n setOutput(getA(" + sourceCoords + "));\n }\n "; + } + return TileProgram; + }()); + function getSourceCoords$1(aShape) { + var rank = aShape.length; + if (rank > 5) { + throw Error("Tile for rank " + rank + " is not yet supported"); + } + if (rank === 1) { + return "imod(resRC, " + aShape[0] + ")"; + } + var currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u']; + var sourceCoords = []; + for (var i = 0; i < aShape.length; i++) { + sourceCoords.push("imod(" + currentCoords[i] + ", " + aShape[i] + ")"); + } + return sourceCoords.join(); + } + + var TransposeProgram = (function () { + function TransposeProgram(aShape, newDim) { + this.variableNames = ['A']; + var outputShape = new Array(aShape.length); + for (var i = 0; i < outputShape.length; i++) { + outputShape[i] = aShape[newDim[i]]; + } + this.outputShape = outputShape; + this.rank = outputShape.length; + var dtype = getCoordsDataType(this.rank); + var switched = getSwitchedCoords(newDim); + this.userCode = "\n void main() {\n " + dtype + " resRC = getOutputCoords();\n setOutput(getA(" + switched + "));\n }\n "; + } + return TransposeProgram; + }()); + function getSwitchedCoords(newDim) { + var rank = newDim.length; + if (rank > 6) { + throw Error("Transpose for rank " + rank + " is not yet supported"); + } + var originalOrder = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u', 'resRC.v']; + var switchedCoords = new Array(rank); + for (var i = 0; i < newDim.length; i++) { + switchedCoords[newDim[i]] = originalOrder[i]; + } + return switchedCoords.join(); + } + + var ERF_P = 0.3275911; + var ERF_A1 = 0.254829592; + var ERF_A2 = -0.284496736; + var ERF_A3 = 1.421413741; + var ERF_A4 = -1.453152027; + var ERF_A5 = 1.061405429; + + var SELU_SCALEALPHA = 1.7580993408473768599402175208123; + var SELU_SCALE = 1.0507009873554804934193349852946; + + var UnaryOpProgram = (function () { + function UnaryOpProgram(aShape, opSnippet) { + this.variableNames = ['A']; + this.outputShape = aShape; + this.userCode = "\n uniform float NAN;\n float unaryOperation(float x) {\n " + opSnippet + "\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n "; + } + UnaryOpProgram.prototype.getCustomSetupFunc = function () { + var _this = this; + return function (gpgpu, webGLProgram) { + if (_this.startLoc == null) { + _this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN'); + if (_this.startLoc == null) { + return; + } + } + gpgpu.gl.uniform1f(_this.startLoc, NaN); + }; + }; + return UnaryOpProgram; + }()); + var CHECK_NAN_SNIPPET$1 = "if (isNaN(x)) return x;"; + var ABS = "return abs(x);"; + var RELU = CHECK_NAN_SNIPPET$1 + "\n return (x < 0.0) ? 0.0 : x;\n"; + var ELU = "return (x >= 0.0) ? x : (exp(x) - 1.0);"; + var SELU = "\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = " + SELU_SCALEALPHA + ";\n float scale = " + SELU_SCALE + ";\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n"; + function STEP(alpha) { + if (alpha === void 0) { alpha = 0.0; } + return CHECK_NAN_SNIPPET$1 + ("\n return x > 0.0 ? 1.0 : float(" + alpha + ");\n "); + } + var NEG = "return -x;"; + var CEIL = "return ceil(x);"; + var FLOOR = "return floor(x);"; + var SIGN = "\n if (isNaN(x)) { return 0.0; }\n return sign(x);\n"; + var ROUND = "\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"; + var EXP = "return exp(x);"; + var EXPM1 = "return exp(x) - 1.0;"; + var LOG = "if (x < 0.0) return NAN;\n return log(x);"; + var LOG1P = "return log(1.0 + x);"; + var SQRT = "return sqrt(x);"; + var RSQRT = "return inversesqrt(x);"; + var SIGMOID = "return 1.0 / (1.0 + exp(-1.0 * x));"; + var SOFTPLUS = "\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"; + var SIN = CHECK_NAN_SNIPPET$1 + "\n return sin(x);\n"; + var COS = CHECK_NAN_SNIPPET$1 + "\n return cos(x);\n"; + var TAN = "return tan(x);"; + var ASIN = "return asin(x);"; + var ACOS = "return acos(x);"; + var ATAN = CHECK_NAN_SNIPPET$1 + "\n return atan(x);\n"; + var SINH = "\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"; + var COSH = "\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"; + var TANH = "\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"; + var ASINH = "return log(x + sqrt(x * x + 1.0));"; + var ACOSH = CHECK_NAN_SNIPPET$1 + "\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));"; + var ATANH = CHECK_NAN_SNIPPET$1 + "\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;"; + var ERF = "\n // Error function is calculated approximately with elementary function.\n // See \"Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\n float p = " + ERF_P + ";\n float a1 = " + ERF_A1 + ";\n float a2 = " + ERF_A2 + ";\n float a3 = " + ERF_A3 + ";\n float a4 = " + ERF_A4 + ";\n float a5 = " + ERF_A5 + ";\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n"; + var SQUARE = "return x * x;"; + var RECIPROCAL = "return 1.0 / x;"; + var LOGICAL_NOT = "return float(!(x >= 1.0));"; + var TO_INT = "return float(int(x));"; + + function concat1d_(tensors) { + return concat(tensors, 0); + } + function concat2d_(tensors, axis) { + return concat(tensors, axis); + } + function concat3d_(tensors, axis) { + return concat(tensors, axis); + } + function concat4d_(tensors, axis) { + return concat(tensors, axis); + } + function concat_(tensors, axis) { + if (axis === void 0) { axis = 0; } + assert(tensors.length >= 1, 'Pass at least one tensor to concat'); + var $tensors = convertToTensorArray(tensors, 'tensors', 'concat'); + var result = $tensors[0]; + if ($tensors.length === 1) { + return result; + } + var axes = parseAxisParam(axis, result.shape); + for (var i = 1; i < $tensors.length; ++i) { + result = concat2Tensors(result, $tensors[i], axes[0]); + } + return result; + } + function concat2Tensors(a, b, axis) { + assertParams(a.shape, b.shape, axis); + var outShape = computeOutShape$1(a.shape, b.shape, axis); + var a2D = a.as2D(-1, sizeFromShape(a.shape.slice(axis))); + var b2D = b.as2D(-1, sizeFromShape(b.shape.slice(axis))); + var _a = computeGradientSliceShapes(a2D.shape, b2D.shape), aBegin = _a.aBegin, aSize = _a.aSize, bBegin = _a.bBegin, bSize = _a.bSize; + var der = function (dy) { + return { a: function () { return dy.slice(aBegin, aSize); }, b: function () { return dy.slice(bBegin, bSize); } }; + }; + var res = ENV.engine.runKernel(function (backend) { return backend.concat(a2D, b2D); }, { a: a2D, b: b2D }, der); + return res.reshape(outShape); + } + var concat = op({ concat_: concat_ }); + var concat1d = op({ concat1d_: concat1d_ }); + var concat2d = op({ concat2d_: concat2d_ }); + var concat3d = op({ concat3d_: concat3d_ }); + var concat4d = op({ concat4d_: concat4d_ }); + + var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var alea = createCommonjsModule(function (module) { + // A port of an algorithm by Johannes Baagøe , 2010 + // http://baagoe.com/en/RandomMusings/javascript/ + // https://github.com/nquinlan/better-random-numbers-for-javascript-mirror + // Original work is under MIT license - + + // Copyright (C) 2010 by Johannes Baagøe + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to deal + // in the Software without restriction, including without limitation the rights + // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + // copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + + + + (function(global, module, define) { + + function Alea(seed) { + var me = this, mash = Mash(); + + me.next = function() { + var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 + me.s0 = me.s1; + me.s1 = me.s2; + return me.s2 = t - (me.c = t | 0); + }; + + // Apply the seeding algorithm from Baagoe. + me.c = 1; + me.s0 = mash(' '); + me.s1 = mash(' '); + me.s2 = mash(' '); + me.s0 -= mash(seed); + if (me.s0 < 0) { me.s0 += 1; } + me.s1 -= mash(seed); + if (me.s1 < 0) { me.s1 += 1; } + me.s2 -= mash(seed); + if (me.s2 < 0) { me.s2 += 1; } + mash = null; + } + + function copy(f, t) { + t.c = f.c; + t.s0 = f.s0; + t.s1 = f.s1; + t.s2 = f.s2; + return t; + } + + function impl(seed, opts) { + var xg = new Alea(seed), + state = opts && opts.state, + prng = xg.next; + prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }; + prng.double = function() { + return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 + }; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); }; + } + return prng; + } + + function Mash() { + var n = 0xefc8249d; + + var mash = function(data) { + data = data.toString(); + for (var i = 0; i < data.length; i++) { + n += data.charCodeAt(i); + var h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000; // 2^32 + } + return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 + }; + + return mash; + } + + + if (module && module.exports) { + module.exports = impl; + } else if (define && define.amd) { + define(function() { return impl; }); + } else { + this.alea = impl; + } + + })( + commonjsGlobal, + module, // present in node.js + (typeof undefined) == 'function' && undefined // present with an AMD loader + ); + }); + + var xor128 = createCommonjsModule(function (module) { + // A Javascript implementaion of the "xor128" prng algorithm by + // George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + + (function(global, module, define) { + + function XorGen(seed) { + var me = this, strseed = ''; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + + // Set up generator function. + me.next = function() { + var t = me.x ^ (me.x << 11); + me.x = me.y; + me.y = me.z; + me.z = me.w; + return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); + }; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + me.next(); + } + } + + function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + return t; + } + + function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); }; + } + return prng; + } + + if (module && module.exports) { + module.exports = impl; + } else if (define && define.amd) { + define(function() { return impl; }); + } else { + this.xor128 = impl; + } + + })( + commonjsGlobal, + module, // present in node.js + (typeof undefined) == 'function' && undefined // present with an AMD loader + ); + }); + + var xorwow = createCommonjsModule(function (module) { + // A Javascript implementaion of the "xorwow" prng algorithm by + // George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + + (function(global, module, define) { + + function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var t = (me.x ^ (me.x >>> 2)); + me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; + return (me.d = (me.d + 362437 | 0)) + + (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; + }; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.v = 0; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + if (k == strseed.length) { + me.d = me.x << 10 ^ me.x >>> 4; + } + me.next(); + } + } + + function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + t.v = f.v; + t.d = f.d; + return t; + } + + function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); }; + } + return prng; + } + + if (module && module.exports) { + module.exports = impl; + } else if (define && define.amd) { + define(function() { return impl; }); + } else { + this.xorwow = impl; + } + + })( + commonjsGlobal, + module, // present in node.js + (typeof undefined) == 'function' && undefined // present with an AMD loader + ); + }); + + var xorshift7 = createCommonjsModule(function (module) { + // A Javascript implementaion of the "xorshift7" algorithm by + // François Panneton and Pierre L'ecuyer: + // "On the Xorgshift Random Number Generators" + // http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf + + (function(global, module, define) { + + function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + // Update xor generator. + var X = me.x, i = me.i, t, v; + t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); + t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); + t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); + t = X[(i + 4) & 7]; v ^= t ^ (t << 7); + t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); + X[i] = v; + me.i = (i + 1) & 7; + return v; + }; + + function init(me, seed) { + var j, w, X = []; + + if (seed === (seed | 0)) { + // Seed state array using a 32-bit integer. + w = X[0] = seed; + } else { + // Seed state using a string. + seed = '' + seed; + for (j = 0; j < seed.length; ++j) { + X[j & 7] = (X[j & 7] << 15) ^ + (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); + } + } + // Enforce an array length of 8, not all zeroes. + while (X.length < 8) X.push(0); + for (j = 0; j < 8 && X[j] === 0; ++j); + if (j == 8) w = X[7] = -1; else w = X[j]; + + me.x = X; + me.i = 0; + + // Discard an initial 256 values. + for (j = 256; j > 0; --j) { + me.next(); + } + } + + init(me, seed); + } + + function copy(f, t) { + t.x = f.x.slice(); + t.i = f.i; + return t; + } + + function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.x) copy(state, xg); + prng.state = function() { return copy(xg, {}); }; + } + return prng; + } + + if (module && module.exports) { + module.exports = impl; + } else if (define && define.amd) { + define(function() { return impl; }); + } else { + this.xorshift7 = impl; + } + + })( + commonjsGlobal, + module, // present in node.js + (typeof undefined) == 'function' && undefined // present with an AMD loader + ); + }); + + var xor4096 = createCommonjsModule(function (module) { + // A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. + // + // This fast non-cryptographic random number generator is designed for + // use in Monte-Carlo algorithms. It combines a long-period xorshift + // generator with a Weyl generator, and it passes all common batteries + // of stasticial tests for randomness while consuming only a few nanoseconds + // for each prng generated. For background on the generator, see Brent's + // paper: "Some long-period random number generators using shifts and xors." + // http://arxiv.org/pdf/1004.3115v1.pdf + // + // Usage: + // + // var xor4096 = require('xor4096'); + // random = xor4096(1); // Seed with int32 or string. + // assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. + // assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. + // + // For nonzero numeric keys, this impelementation provides a sequence + // identical to that by Brent's xorgens 3 implementaion in C. This + // implementation also provides for initalizing the generator with + // string seeds, or for saving and restoring the state of the generator. + // + // On Chrome, this prng benchmarks about 2.1 times slower than + // Javascript's built-in Math.random(). + + (function(global, module, define) { + + function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + var w = me.w, + X = me.X, i = me.i, t, v; + // Update Weyl generator. + me.w = w = (w + 0x61c88647) | 0; + // Update xor generator. + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + // Update Xor generator array state. + v = X[i] = v ^ t; + me.i = i; + // Result is the combination. + return (v + (w ^ (w >>> 16))) | 0; + }; + + function init(me, seed) { + var t, v, i, j, w, X = [], limit = 128; + if (seed === (seed | 0)) { + // Numeric seeds initialize v, which is used to generates X. + v = seed; + seed = null; + } else { + // String seeds are mixed into v and X one character at a time. + seed = seed + '\0'; + v = 0; + limit = Math.max(limit, seed.length); + } + // Initialize circular array and weyl value. + for (i = 0, j = -32; j < limit; ++j) { + // Put the unicode characters into the array, and shuffle them. + if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); + // After 32 shuffles, take v as the starting w value. + if (j === 0) w = v; + v ^= v << 10; + v ^= v >>> 15; + v ^= v << 4; + v ^= v >>> 13; + if (j >= 0) { + w = (w + 0x61c88647) | 0; // Weyl. + t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. + i = (0 == t) ? i + 1 : 0; // Count zeroes. + } + } + // We have detected all zeroes; make the key nonzero. + if (i >= 128) { + X[(seed && seed.length || 0) & 127] = -1; + } + // Run the generator 512 times to further mix the state before using it. + // Factoring this as a function slows the main generator, so it is just + // unrolled here. The weyl generator is not advanced while warming up. + i = 127; + for (j = 4 * 128; j > 0; --j) { + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + X[i] = v ^ t; + } + // Storing state as object members is faster than using closure variables. + me.w = w; + me.X = X; + me.i = i; + } + + init(me, seed); + } + + function copy(f, t) { + t.i = f.i; + t.w = f.w; + t.X = f.X.slice(); + return t; + } + function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.X) copy(state, xg); + prng.state = function() { return copy(xg, {}); }; + } + return prng; + } + + if (module && module.exports) { + module.exports = impl; + } else if (define && define.amd) { + define(function() { return impl; }); + } else { + this.xor4096 = impl; + } + + })( + commonjsGlobal, // window object or global + module, // present in node.js + (typeof undefined) == 'function' && undefined // present with an AMD loader + ); + }); + + var tychei = createCommonjsModule(function (module) { + // A Javascript implementaion of the "Tyche-i" prng algorithm by + // Samuel Neves and Filipe Araujo. + // See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf + + (function(global, module, define) { + + function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var b = me.b, c = me.c, d = me.d, a = me.a; + b = (b << 25) ^ (b >>> 7) ^ c; + c = (c - d) | 0; + d = (d << 24) ^ (d >>> 8) ^ a; + a = (a - b) | 0; + me.b = b = (b << 20) ^ (b >>> 12) ^ c; + me.c = c = (c - d) | 0; + me.d = (d << 16) ^ (c >>> 16) ^ a; + return me.a = (a - b) | 0; + }; + + /* The following is non-inverted tyche, which has better internal + * bit diffusion, but which is about 25% slower than tyche-i in JS. + me.next = function() { + var a = me.a, b = me.b, c = me.c, d = me.d; + a = (me.a + me.b | 0) >>> 0; + d = me.d ^ a; d = d << 16 ^ d >>> 16; + c = me.c + d | 0; + b = me.b ^ c; b = b << 12 ^ d >>> 20; + me.a = a = a + b | 0; + d = d ^ a; me.d = d = d << 8 ^ d >>> 24; + me.c = c = c + d | 0; + b = b ^ c; + return me.b = (b << 7 ^ b >>> 25); + } + */ + + me.a = 0; + me.b = 0; + me.c = 2654435769 | 0; + me.d = 1367130551; + + if (seed === Math.floor(seed)) { + // Integer seed. + me.a = (seed / 0x100000000) | 0; + me.b = seed | 0; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 20; k++) { + me.b ^= strseed.charCodeAt(k) | 0; + me.next(); + } + } + + function copy(f, t) { + t.a = f.a; + t.b = f.b; + t.c = f.c; + t.d = f.d; + return t; + } + function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); }; + } + return prng; + } + + if (module && module.exports) { + module.exports = impl; + } else if (define && define.amd) { + define(function() { return impl; }); + } else { + this.tychei = impl; + } + + })( + commonjsGlobal, + module, // present in node.js + (typeof undefined) == 'function' && undefined // present with an AMD loader + ); + }); + + var seedrandom = createCommonjsModule(function (module) { + /* + Copyright 2014 David Bau. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + + (function (pool, math) { + // + // The following constants are related to IEEE 754 limits. + // + var global = this, + width = 256, // each RC4 output is 0 <= x < 256 + chunks = 6, // at least six RC4 outputs for each double + digits = 52, // there are 52 significant digits in a double + rngname = 'random', // rngname: name for Math.random and Math.seedrandom + startdenom = math.pow(width, chunks), + significance = math.pow(2, digits), + overflow = significance * 2, + mask = width - 1, + nodecrypto; // node.js crypto module, initialized at the bottom. + + // + // seedrandom() + // This is the seedrandom function described above. + // + function seedrandom(seed, options, callback) { + var key = []; + options = (options == true) ? { entropy: true } : (options || {}); + + // Flatten the seed string or build one from local entropy if needed. + var shortseed = mixkey(flatten( + options.entropy ? [seed, tostring(pool)] : + (seed == null) ? autoseed() : seed, 3), key); + + // Use the seed to initialize an ARC4 generator. + var arc4 = new ARC4(key); + + // This function returns a random double in [0, 1) that contains + // randomness in every bit of the mantissa of the IEEE 754 value. + var prng = function() { + var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 + d = startdenom, // and denominator d = 2 ^ 48. + x = 0; // and no 'extra last byte'. + while (n < significance) { // Fill up all significant digits by + n = (n + x) * width; // shifting numerator and + d *= width; // denominator and generating a + x = arc4.g(1); // new least-significant-byte. + } + while (n >= overflow) { // To avoid rounding up, before adding + n /= 2; // last byte, shift everything + d /= 2; // right using integer math until + x >>>= 1; // we have exactly the desired bits. + } + return (n + x) / d; // Form the number within [0, 1). + }; + + prng.int32 = function() { return arc4.g(4) | 0; }; + prng.quick = function() { return arc4.g(4) / 0x100000000; }; + prng.double = prng; + + // Mix the randomness into accumulated entropy. + mixkey(tostring(arc4.S), pool); + + // Calling convention: what to return as a function of prng, seed, is_math. + return (options.pass || callback || + function(prng, seed, is_math_call, state) { + if (state) { + // Load the arc4 state from the given state if it has an S array. + if (state.S) { copy(state, arc4); } + // Only provide the .state method if requested via options.state. + prng.state = function() { return copy(arc4, {}); }; + } + + // If called as a method of Math (Math.seedrandom()), mutate + // Math.random because that is how seedrandom.js has worked since v1.0. + if (is_math_call) { math[rngname] = prng; return seed; } + + // Otherwise, it is a newer calling convention, so return the + // prng directly. + else return prng; + })( + prng, + shortseed, + 'global' in options ? options.global : (this == math), + options.state); + } + math['seed' + rngname] = seedrandom; + + // + // ARC4 + // + // An ARC4 implementation. The constructor takes a key in the form of + // an array of at most (width) integers that should be 0 <= x < (width). + // + // The g(count) method returns a pseudorandom integer that concatenates + // the next (count) outputs from ARC4. Its return value is a number x + // that is in the range 0 <= x < (width ^ count). + // + function ARC4(key) { + var t, keylen = key.length, + me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; + + // The empty key [] is treated as [0]. + if (!keylen) { key = [keylen++]; } + + // Set up S using the standard key scheduling algorithm. + while (i < width) { + s[i] = i++; + } + for (i = 0; i < width; i++) { + s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; + s[j] = t; + } + + // The "g" method returns the next (count) outputs as one number. + (me.g = function(count) { + // Using instance members instead of closure state nearly doubles speed. + var t, r = 0, + i = me.i, j = me.j, s = me.S; + while (count--) { + t = s[i = mask & (i + 1)]; + r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; + } + me.i = i; me.j = j; + return r; + // For robust unpredictability, the function call below automatically + // discards an initial batch of values. This is called RC4-drop[256]. + // See http://google.com/search?q=rsa+fluhrer+response&btnI + })(width); + } + + // + // copy() + // Copies internal state of ARC4 to or from a plain object. + // + function copy(f, t) { + t.i = f.i; + t.j = f.j; + t.S = f.S.slice(); + return t; + } + // + // flatten() + // Converts an object tree to nested arrays of strings. + // + function flatten(obj, depth) { + var result = [], typ = (typeof obj), prop; + if (depth && typ == 'object') { + for (prop in obj) { + try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} + } + } + return (result.length ? result : typ == 'string' ? obj : obj + '\0'); + } + + // + // mixkey() + // Mixes a string seed into a key that is an array of integers, and + // returns a shortened string seed that is equivalent to the result key. + // + function mixkey(seed, key) { + var stringseed = seed + '', smear, j = 0; + while (j < stringseed.length) { + key[mask & j] = + mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); + } + return tostring(key); + } + + // + // autoseed() + // Returns an object for autoseeding, using window.crypto and Node crypto + // module if available. + // + function autoseed() { + try { + var out; + if (nodecrypto && (out = nodecrypto.randomBytes)) { + // The use of 'out' to remember randomBytes makes tight minified code. + out = out(width); + } else { + out = new Uint8Array(width); + (global.crypto || global.msCrypto).getRandomValues(out); + } + return tostring(out); + } catch (e) { + var browser = global.navigator, + plugins = browser && browser.plugins; + return [+new Date, global, plugins, global.screen, tostring(pool)]; + } + } + + // + // tostring() + // Converts an array of charcodes to a string + // + function tostring(a) { + return String.fromCharCode.apply(0, a); + } + + // + // When seedrandom.js is loaded, we immediately mix a few bits + // from the built-in RNG into the entropy pool. Because we do + // not want to interfere with deterministic PRNG state later, + // seedrandom will not call math.random on its own again after + // initialization. + // + mixkey(math.random(), pool); + + // + // Nodejs and AMD support: export the implementation as a module using + // either convention. + // + if (module.exports) { + module.exports = seedrandom; + // When in node.js, try using crypto package for autoseeding. + try { + nodecrypto = require('crypto'); + } catch (ex) {} + } else if ((typeof undefined) == 'function' && undefined.amd) { + undefined(function() { return seedrandom; }); + } + + // End anonymous scope, and pass initial values. + })( + [], // pool: entropy pool starts empty + Math // math: package containing random, pow, and seedrandom + ); + }); + + // A library of seedable RNGs implemented in Javascript. + // + // Usage: + // + // var seedrandom = require('seedrandom'); + // var random = seedrandom(1); // or any seed. + // var x = random(); // 0 <= x < 1. Every bit is random. + // var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. + + // alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. + // Period: ~2^116 + // Reported to pass all BigCrush tests. + + + // xor128, a pure xor-shift generator by George Marsaglia. + // Period: 2^128-1. + // Reported to fail: MatrixRank and LinearComp. + + + // xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. + // Period: 2^192-2^32 + // Reported to fail: CollisionOver, SimpPoker, and LinearComp. + + + // xorshift7, by François Panneton and Pierre L'ecuyer, takes + // a different approach: it adds robustness by allowing more shifts + // than Marsaglia's original three. It is a 7-shift generator + // with 256 bits, that passes BigCrush with no systmatic failures. + // Period 2^256-1. + // No systematic BigCrush failures reported. + + + // xor4096, by Richard Brent, is a 4096-bit xor-shift with a + // very long period that also adds a Weyl generator. It also passes + // BigCrush with no systematic failures. Its long period may + // be useful if you have many generators and need to avoid + // collisions. + // Period: 2^4128-2^32. + // No systematic BigCrush failures reported. + + + // Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random + // number generator derived from ChaCha, a modern stream cipher. + // https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf + // Period: ~2^127 + // No systematic BigCrush failures reported. + + + // The original ARC4-based prng included in this library. + // Period: ~2^1600 + + + seedrandom.alea = alea; + seedrandom.xor128 = xor128; + seedrandom.xorwow = xorwow; + seedrandom.xorshift7 = xorshift7; + seedrandom.xor4096 = xor4096; + seedrandom.tychei = tychei; + + var seedrandom$1 = seedrandom; + var seedrandom_1 = seedrandom$1.alea; + + var MPRandGauss = (function () { + function MPRandGauss(mean, stdDeviation, dtype, truncated, seed) { + this.mean = mean; + this.stdDev = stdDeviation; + this.dtype = dtype; + this.nextVal = NaN; + this.truncated = truncated; + if (this.truncated) { + this.upper = this.mean + this.stdDev * 2; + this.lower = this.mean - this.stdDev * 2; + } + var seedValue = seed ? seed : Math.random(); + this.random = seedrandom_1(seedValue.toString()); + } + MPRandGauss.prototype.nextValue = function () { + if (!isNaN(this.nextVal)) { + var value = this.nextVal; + this.nextVal = NaN; + return value; + } + var resultX, resultY; + var isValid = false; + while (!isValid) { + var v1 = void 0, v2 = void 0, s = void 0; + do { + v1 = 2 * this.random() - 1; + v2 = 2 * this.random() - 1; + s = v1 * v1 + v2 * v2; + } while (s >= 1 || s === 0); + var mul = Math.sqrt(-2.0 * Math.log(s) / s); + resultX = this.mean + this.stdDev * v1 * mul; + resultY = this.mean + this.stdDev * v2 * mul; + if (!this.truncated || this.isValidTruncated(resultX)) { + isValid = true; + } + } + if (!this.truncated || this.isValidTruncated(resultY)) { + this.nextVal = this.convertValue(resultY); + } + return this.convertValue(resultX); + }; + MPRandGauss.prototype.convertValue = function (value) { + if (this.dtype == null || this.dtype === 'float32') { + return value; + } + return Math.round(value); + }; + MPRandGauss.prototype.isValidTruncated = function (value) { + return value <= this.upper && value >= this.lower; + }; + return MPRandGauss; + }()); + + function clone_(x) { + var $x = convertToTensor(x, 'x', 'clone'); + var der = function (dy) { + return { $x: function () { return dy.toFloat(); } }; + }; + return ENV.engine.runKernel(function (backend) { + return Tensor.make($x.shape, { dataId: $x.dataId }, $x.dtype); + }, { $x: $x }, der); + } + function eye_(numRows, numColumns, batchShape, dtype) { + if (dtype === void 0) { dtype = 'float32'; } + if (numColumns == null) { + numColumns = numRows; + } + var buff = buffer([numRows, numColumns], dtype); + var n = numRows <= numColumns ? numRows : numColumns; + for (var i = 0; i < n; ++i) { + buff.set(1, i, i); + } + var out = buff.toTensor().as2D(numRows, numColumns); + if (batchShape == null) { + return out; + } + else { + if (batchShape.length === 1) { + return tile(expandDims(out, 0), [batchShape[0], 1, 1]); + } + else if (batchShape.length === 2) { + return tile(expandDims(expandDims(out, 0), 0), [batchShape[0], batchShape[1], 1, 1]); + } + else if (batchShape.length === 3) { + return tile(expandDims(expandDims(expandDims(out, 0), 0), 0), [batchShape[0], batchShape[1], batchShape[2], 1, 1]); + } + else { + throw new Error("eye() currently supports only 1D and 2D " + + ("batchShapes, but received " + batchShape.length + "D.")); + } + } + } + function randomNormal_(shape, mean, stdDev, dtype, seed) { + if (mean === void 0) { mean = 0; } + if (stdDev === void 0) { stdDev = 1; } + if (dtype != null && dtype === 'bool') { + throw new Error("Unsupported data type " + dtype); + } + var randGauss = new MPRandGauss(mean, stdDev, dtype, false, seed); + var res = buffer(shape, dtype); + for (var i = 0; i < res.values.length; i++) { + res.values[i] = randGauss.nextValue(); + } + return res.toTensor(); + } + function truncatedNormal_(shape, mean, stdDev, dtype, seed) { + if (mean === void 0) { mean = 0; } + if (stdDev === void 0) { stdDev = 1; } + if (dtype != null && dtype === 'bool') { + throw new Error("Unsupported data type " + dtype); + } + var randGauss = new MPRandGauss(mean, stdDev, dtype, true, seed); + var res = buffer(shape, dtype); + for (var i = 0; i < res.values.length; i++) { + res.values[i] = randGauss.nextValue(); + } + return res.toTensor(); + } + function randomUniform_(shape, minval, maxval, dtype) { + if (minval === void 0) { minval = 0; } + if (maxval === void 0) { maxval = 1; } + if (dtype === void 0) { dtype = 'float32'; } + var res = buffer(shape, dtype); + for (var i = 0; i < res.values.length; i++) { + res.values[i] = randUniform(minval, maxval); + } + return res.toTensor(); + } + function rand_(shape, randFunction, dtype) { + var size = sizeFromShape(shape); + var values = null; + if (dtype == null || dtype === 'float32') { + values = new Float32Array(size); + } + else if (dtype === 'int32') { + values = new Int32Array(size); + } + else if (dtype === 'bool') { + values = new Uint8Array(size); + } + else { + throw new Error("Unknown data type " + dtype); + } + for (var i = 0; i < size; i++) { + values[i] = randFunction(); + } + return Tensor.make(shape, { values: values }, dtype); + } + function multinomial_(logits, numSamples, seed, normalized) { + if (normalized === void 0) { normalized = false; } + var $logits = convertToTensor(logits, 'logits', 'multinomial'); + var numOutcomes = $logits.size; + var origRank = $logits.rank; + if (numOutcomes < 2) { + throw new Error("Error in multinomial: you need at least 2 outcomes, but got " + + (numOutcomes + ".")); + } + if (origRank > 2) { + throw new Error("Rank of probabilities must be 1 or 2, but is " + origRank); + } + seed = seed || Math.random(); + var logits2D = origRank === 1 ? $logits.as2D(1, -1) : $logits; + var res = ENV.engine.runKernel(function (backend) { return backend.multinomial(logits2D, normalized, numSamples, seed); }, { logits2D: logits2D }); + return origRank === 1 ? res.as1D() : res; + } + function oneHot_(indices, depth, onValue, offValue) { + if (onValue === void 0) { onValue = 1; } + if (offValue === void 0) { offValue = 0; } + var $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32'); + assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`'); + if (depth < 2) { + throw new Error("Error in oneHot: depth must be >=2, but it is " + depth); + } + return ENV.engine.runKernel(function (backend) { return backend.oneHot($indices, depth, onValue, offValue); }, { $indices: $indices }); + } + function fromPixels_(pixels, numChannels) { + if (numChannels === void 0) { numChannels = 3; } + if (numChannels > 4) { + throw new Error('Cannot construct Tensor with more than 4 channels from pixels.'); + } + return ENV.engine.fromPixels(pixels, numChannels); + } + function toPixels(img, canvas) { + return __awaiter(this, void 0, void 0, function () { + var $img, _a, height, width, depth, minTensor, maxTensor, min, max, data, multiplier, bytes, i, r, g, b, a, j, ctx, imageData; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + $img = convertToTensor(img, 'img', 'toPixels', 'int32'); + if ($img.rank !== 2 && $img.rank !== 3) { + throw new Error("toPixels only supports rank 2 or 3 tensors, got rank " + $img.rank + "."); + } + _a = $img.shape.slice(0, 2), height = _a[0], width = _a[1]; + depth = $img.rank === 2 ? 1 : $img.shape[2]; + if (depth > 4 || depth === 2) { + throw new Error("toPixels only supports depth of size " + + ("1, 3 or 4 but got " + depth)); + } + minTensor = $img.min(); + maxTensor = $img.max(); + return [4, minTensor.data()]; + case 1: + min = (_b.sent())[0]; + return [4, maxTensor.data()]; + case 2: + max = (_b.sent())[0]; + minTensor.dispose(); + maxTensor.dispose(); + if ($img.dtype === 'float32') { + if (min < 0 || max > 1) { + throw new Error("Tensor values for a float32 Tensor must be in the " + + ("range [0 - 1] but got range [" + min + " - " + max + "].")); + } + } + else if ($img.dtype === 'int32') { + if (min < 0 || max > 255) { + throw new Error("Tensor values for a int32 Tensor must be in the " + + ("range [0 - 255] but got range [" + min + " - " + max + "].")); + } + } + else { + throw new Error("Unsupported type for toPixels: " + $img.dtype + "." + + " Please use float32 or int32 tensors."); + } + return [4, $img.data()]; + case 3: + data = _b.sent(); + multiplier = $img.dtype === 'float32' ? 255 : 1; + bytes = new Uint8ClampedArray(width * height * 4); + for (i = 0; i < height * width; ++i) { + r = void 0, g = void 0, b = void 0, a = void 0; + if (depth === 1) { + r = data[i] * multiplier; + g = data[i] * multiplier; + b = data[i] * multiplier; + a = 255; + } + else if (depth === 3) { + r = data[i * 3] * multiplier; + g = data[i * 3 + 1] * multiplier; + b = data[i * 3 + 2] * multiplier; + a = 255; + } + else if (depth === 4) { + r = data[i * 4] * multiplier; + g = data[i * 4 + 1] * multiplier; + b = data[i * 4 + 2] * multiplier; + a = data[i * 4 + 3] * multiplier; + } + j = i * 4; + bytes[j + 0] = Math.round(r); + bytes[j + 1] = Math.round(g); + bytes[j + 2] = Math.round(b); + bytes[j + 3] = Math.round(a); + } + if (canvas != null) { + canvas.width = width; + canvas.height = height; + ctx = canvas.getContext('2d'); + imageData = new ImageData(bytes, width, height); + ctx.putImageData(imageData, 0, 0); + } + if ($img !== img) { + $img.dispose(); + } + return [2, bytes]; + } + }); + }); + } + function reshape_(x, shape) { + var $x = convertToTensor(x, 'x', 'reshape'); + shape = inferFromImplicitShape(shape, $x.size); + assert($x.size === sizeFromShape(shape), 'new shape and old shape must have the same number of elements.'); + var grad = function (dy) { + return { $x: function () { return dy.reshape($x.shape); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.reshape($x, shape); }, { $x: $x }, grad); + } + function squeeze_(x, axis) { + var $x = convertToTensor(x, 'x', 'squeeze'); + return reshape($x, squeezeShape($x.shape, axis).newShape); + } + function cast_(x, dtype) { + var $x = convertToTensor(x, 'x', 'cast'); + var grad = function (dy) { + return { $x: function () { return dy.clone(); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.cast($x, dtype); }, { $x: $x }, grad); + } + function tile_(x, reps) { + var $x = convertToTensor(x, 'x', 'tile'); + assert($x.rank === reps.length, "Error in transpose: rank of input " + $x.rank + " " + + ("must match length of reps " + reps + ".")); + var grad = function (dy) { + var derX = function () { + var xGrad = zerosLike($x); + if ($x.rank === 1) { + for (var i = 0; i < reps[0]; ++i) { + xGrad = xGrad.add(dy.slice([i * $x.shape[0]], [$x.shape[0]])); + } + } + else if ($x.rank === 2) { + for (var i = 0; i < reps[0]; ++i) { + for (var j = 0; j < reps[1]; ++j) { + xGrad = xGrad.add(dy.slice([i * $x.shape[0], j * $x.shape[1]], [$x.shape[0], $x.shape[1]])); + } + } + } + else if ($x.rank === 3) { + for (var i = 0; i < reps[0]; ++i) { + for (var j = 0; j < reps[1]; ++j) { + for (var k = 0; k < reps[2]; ++k) { + xGrad = xGrad.add(dy.slice([i * $x.shape[0], j * $x.shape[1], k * $x.shape[2]], [$x.shape[0], $x.shape[1], $x.shape[2]])); + } + } + } + } + else if ($x.rank === 4) { + for (var i = 0; i < reps[0]; ++i) { + for (var j = 0; j < reps[1]; ++j) { + for (var k = 0; k < reps[2]; ++k) { + for (var l = 0; l < reps[3]; ++l) { + xGrad = xGrad.add(dy.slice([ + i * $x.shape[0], j * $x.shape[1], k * $x.shape[2], + l * $x.shape[3] + ], [$x.shape[0], $x.shape[1], $x.shape[2], $x.shape[3]])); + } + } + } + } + } + else { + throw new Error("Gradient for tile operation is not implemented for rank-" + + ($x.rank + " tensors yet.")); + } + return xGrad; + }; + return { $x: derX }; + }; + return ENV.engine.runKernel(function (backend) { return backend.tile($x, reps); }, { $x: $x }, grad); + } + function pad1d_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + assert(paddings.length === 2, 'Invalid number of paddings. Must be length of 2.'); + return pad(x, [paddings], constantValue); + } + function pad2d_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + assert(paddings.length === 2 && paddings[0].length === 2 && + paddings[1].length === 2, 'Invalid number of paddings. Must be length of 2 each.'); + return pad(x, paddings, constantValue); + } + function pad3d_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + assert(paddings.length === 3 && paddings[0].length === 2 && + paddings[1].length === 2 && paddings[2].length === 2, 'Invalid number of paddings. Must be length of 2 each.'); + return pad(x, paddings, constantValue); + } + function pad4d_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + assert(paddings.length === 4 && paddings[0].length === 2 && + paddings[1].length === 2 && paddings[2].length === 2 && + paddings[3].length === 2, 'Invalid number of paddings. Must be length of 2 each.'); + return pad(x, paddings, constantValue); + } + function pad_(x, paddings, constantValue) { + if (constantValue === void 0) { constantValue = 0; } + var $x = convertToTensor(x, 'x', 'pad'); + if ($x.rank === 0) { + throw new Error('pad(scalar) is not defined. Pass non-scalar to pad'); + } + var begin = paddings.map(function (p) { return p[0]; }); + var grad = function (dy) { + return { $x: function () { return dy.slice(begin, $x.shape); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.pad($x, paddings, constantValue); }, { $x: $x }, grad); + } + function stack_(tensors, axis) { + if (axis === void 0) { axis = 0; } + var $tensors = convertToTensorArray(tensors, 'tensors', 'stack'); + assert($tensors.length >= 1, 'Pass at least one tensor to tf.stack'); + if ($tensors.length === 1) { + return $tensors[0].expandDims(axis); + } + var rank = $tensors[0].rank; + var shape = $tensors[0].shape; + var dtype = $tensors[0].dtype; + assert(axis <= rank, 'Axis must be <= rank of the tensor'); + $tensors.forEach(function (t) { + assertShapesMatch(shape, t.shape, 'All tensors passed to stack must have matching shapes'); + }); + $tensors.forEach(function (t) { + assert(dtype === t.dtype, 'All tensors passed to stack must have matching dtypes'); + }); + var expandedTensors = $tensors.map(function (t) { return t.expandDims(axis); }); + return concat(expandedTensors, axis); + } + function batchToSpaceND_(x, blockShape, crops) { + var $x = convertToTensor(x, 'x', 'batchToSpaceND'); + var prod = blockShape.reduce(function (a, b) { return a * b; }); + assert($x.rank >= 1 + blockShape.length, "input rank should be > than [blockShape] but got " + $x.rank); + assert(crops.length === blockShape.length, "crops.shape[0] must be equal to [blockShape] but got " + crops.length); + assert($x.shape[0] % prod === 0, "input tensor batch must be divisible by prod( blockShape )"); + return ENV.engine.runKernel(function (backend) { return backend.batchToSpaceND($x, blockShape, crops); }, {}); + } + function spaceToBatchND_(x, blockShape, paddings) { + var $x = convertToTensor(x, 'x', 'spaceToBatchND'); + assert($x.rank >= 1 + blockShape.length, "input rank should be > than [blockShape] but got " + $x.rank); + assert(paddings.length === blockShape.length, "paddings.shape[0] must be equal to [blockShape], got " + paddings.length); + assert($x.shape.reduce(function (a, b, i) { + if (i > 0 && i <= blockShape.length) { + return a && (b % blockShape[i - 1] === 0); + } + return a; + }, true), "input spatial dimensions must be divisible by blockShapes"); + return ENV.engine.runKernel(function (backend) { return backend.spaceToBatchND($x, blockShape, paddings); }, {}); + } + function unstack_(x, axis) { + if (axis === void 0) { axis = 0; } + var $x = convertToTensor(x, 'x', 'unstack'); + var num = $x.shape[axis]; + var outputShape = Array($x.rank - 1).fill(0); + var outIndex = 0; + for (var i = 0; i < $x.rank; i++) { + if (i !== axis) { + outputShape[outIndex] = $x.shape[i]; + outIndex++; + } + } + var splitSizes; + splitSizes = Array(num).fill(1); + var begin = Array($x.rank).fill(0); + var size = $x.shape.slice(); + return splitSizes.map(function (s) { + size[axis] = s; + var slice = $x.slice(begin, size); + begin[axis] += s; + return slice.reshape(outputShape); + }); + } + function split_(x, numOrSizeSplits, axis) { + if (axis === void 0) { axis = 0; } + var $x = convertToTensor(x, 'x', 'split'); + axis = parseAxisParam(axis, $x.shape)[0]; + var splitSizes; + if (typeof (numOrSizeSplits) === 'number') { + assert($x.shape[axis] % numOrSizeSplits === 0, 'Number of splits must evenly divide the axis.'); + splitSizes = Array(numOrSizeSplits).fill($x.shape[axis] / numOrSizeSplits); + } + else { + assert($x.shape[axis] === numOrSizeSplits.reduce(function (a, b) { return a + b; }), 'The sum of sizes must match the size of the axis dimension.'); + splitSizes = numOrSizeSplits; + } + var begin = Array($x.rank).fill(0); + var size = $x.shape.slice(); + return splitSizes.map(function (s) { + size[axis] = s; + var slice = $x.slice(begin, size); + begin[axis] += s; + return slice; + }); + } + function cumsum_(x, axis, exclusive, reverse) { + if (axis === void 0) { axis = 0; } + if (exclusive === void 0) { exclusive = false; } + if (reverse === void 0) { reverse = false; } + var $x = convertToTensor(x, 'x', 'cumsum'); + axis = axis | 0; + var permutation = getAxesPermutation([axis], $x.rank); + var permutedX = $x; + if (permutation != null) { + permutedX = $x.transpose(permutation); + } + var permutedAxis = getInnerMostAxes(1, $x.rank)[0]; + var grad = function (dy) { + return { permutedX: function () { return dy.cumsum(axis, exclusive, !reverse); } }; + }; + var value = ENV.engine.runKernel(function (backend) { return backend.cumsum(permutedX, permutedAxis, exclusive, reverse); }, { permutedX: permutedX }, grad); + if (permutation != null) { + value = value.transpose(permutation); + } + return value; + } + function expandDims_(x, axis) { + if (axis === void 0) { axis = 0; } + var $x = convertToTensor(x, 'x', 'expandDims'); + assert(axis <= $x.rank, 'Axis must be <= rank of the tensor'); + var newShape = $x.shape.slice(); + if (axis < 0) { + assert(-($x.rank + 1) <= axis, "Axis must be in the interval [" + -($x.rank + 1) + ", " + $x.rank + "]"); + axis = $x.rank + axis + 1; + } + newShape.splice(axis, 0, 1); + return reshape($x, newShape); + } + function buffer(shape, dtype, values) { + if (dtype === void 0) { dtype = 'float32'; } + return new TensorBuffer(shape, dtype, values); + } + function print(x, verbose) { + if (verbose === void 0) { verbose = false; } + console.log(x.toString(verbose)); + } + var cast = op({ cast_: cast_ }); + var clone = op({ clone_: clone_ }); + var cumsum = op({ cumsum_: cumsum_ }); + var expandDims = op({ expandDims_: expandDims_ }); + var eye = op({ eye_: eye_ }); + var fromPixels = op({ fromPixels_: fromPixels_ }); + var multinomial = op({ multinomial_: multinomial_ }); + var oneHot = op({ oneHot_: oneHot_ }); + var pad = op({ pad_: pad_ }); + var pad1d = op({ pad1d_: pad1d_ }); + var pad2d = op({ pad2d_: pad2d_ }); + var pad3d = op({ pad3d_: pad3d_ }); + var pad4d = op({ pad4d_: pad4d_ }); + var rand = op({ rand_: rand_ }); + var randomNormal = op({ randomNormal_: randomNormal_ }); + var randomUniform = op({ randomUniform_: randomUniform_ }); + var reshape = op({ reshape_: reshape_ }); + var split = op({ split_: split_ }); + var squeeze = op({ squeeze_: squeeze_ }); + var stack = op({ stack_: stack_ }); + var tile = op({ tile_: tile_ }); + var truncatedNormal = op({ truncatedNormal_: truncatedNormal_ }); + var unstack = op({ unstack_: unstack_ }); + var batchToSpaceND = op({ batchToSpaceND_: batchToSpaceND_ }); + var spaceToBatchND = op({ spaceToBatchND_: spaceToBatchND_ }); + + function whereImpl(condShape, condVals) { + var indices = []; + for (var i = 0; i < condVals.length; i++) { + if (condVals[i]) { + indices.push(i); + } + } + var inBuffer = buffer(condShape, 'int32'); + var out = buffer([indices.length, condShape.length], 'int32'); + for (var i = 0; i < indices.length; i++) { + var loc = inBuffer.indexToLoc(indices[i]); + var offset = i * condShape.length; + out.values.set(loc, offset); + } + return out.toTensor(); + } + + var BEFORE_PAGING_CONSTANT = 300; + var SIZE_UPLOAD_UNIFORM = 32; + var MathBackendWebGL = (function () { + function MathBackendWebGL(gpgpu, delayedStorage) { + if (delayedStorage === void 0) { delayedStorage = true; } + this.gpgpu = gpgpu; + this.delayedStorage = delayedStorage; + this.texData = new WeakMap(); + this.pendingRead = new WeakMap(); + this.pendingDisposal = new WeakSet(); + this.lruDataGPU = []; + this.numBytesInGPU = 0; + this.uploadWaitMs = 0; + this.downloadWaitMs = 0; + this.binaryCache = {}; + this.disposed = false; + if (ENV.get('WEBGL_VERSION') < 1) { + throw new Error('WebGL is not supported on this device'); + } + if (ENV.get('IS_BROWSER')) { + this.canvas = document.createElement('canvas'); + } + if (gpgpu == null) { + this.gpgpu = new GPGPUContext(createWebGLContext(this.canvas)); + this.gpgpuCreatedLocally = true; + } + else { + this.gpgpuCreatedLocally = false; + } + this.NUM_BYTES_BEFORE_PAGING = + (window.screen.height * window.screen.width * window.devicePixelRatio) * + BEFORE_PAGING_CONSTANT; + this.textureManager = new TextureManager(this.gpgpu); + } + MathBackendWebGL.prototype.register = function (dataId, shape, dtype) { + if (this.texData.has(dataId)) { + throw new Error('Data buffer is already registered'); + } + this.texData.set(dataId, { + shape: shape, + dtype: dtype, + values: null, + texture: null, + texShape: null, + usage: TextureUsage.RENDER + }); + }; + MathBackendWebGL.prototype.fromPixels = function (pixels, numChannels) { + if (pixels == null) { + throw new Error('pixels passed to tf.fromPixels() can not be null'); + } + var texShape = [pixels.height, pixels.width]; + var outShape = [pixels.height, pixels.width, numChannels]; + if (!(pixels instanceof HTMLVideoElement) && + !(pixels instanceof HTMLImageElement) && + !(pixels instanceof HTMLCanvasElement) && + !(pixels instanceof ImageData)) { + throw new Error('pixels passed to tf.fromPixels() must be either an ' + + "HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or " + + ("ImageData, but was " + pixels.constructor.name)); + } + if (pixels instanceof HTMLVideoElement) { + if (this.fromPixelsCanvas == null) { + if (!ENV.get('IS_BROWSER')) { + throw new Error('Can\'t read pixels from HTMLImageElement outside the browser.'); + } + if (document.readyState !== 'complete') { + throw new Error('The DOM is not ready yet. Please call tf.fromPixels() ' + + 'once the DOM is ready. One way to do that is to add an event ' + + 'listener for `DOMContentLoaded` on the document object'); + } + this.fromPixelsCanvas = document.createElement('canvas'); + } + this.fromPixelsCanvas.width = pixels.width; + this.fromPixelsCanvas.height = pixels.height; + this.fromPixelsCanvas.getContext('2d').drawImage(pixels, 0, 0, pixels.width, pixels.height); + pixels = this.fromPixelsCanvas; + } + var tempPixelArray = Tensor.make(texShape, {}, 'int32'); + this.texData.get(tempPixelArray.dataId).usage = TextureUsage.PIXELS; + this.gpgpu.uploadPixelDataToTexture(this.getTexture(tempPixelArray.dataId), pixels); + var program = new FromPixelsProgram(outShape); + var res = this.compileAndRun(program, [tempPixelArray]); + tempPixelArray.dispose(); + return res; + }; + MathBackendWebGL.prototype.write = function (dataId, values) { + if (values == null) { + throw new Error('MathBackendWebGL.write(): values can not be null'); + } + this.throwIfNoData(dataId); + var texData = this.texData.get(dataId); + var texture = texData.texture, texShape = texData.texShape, usage = texData.usage; + if (texture != null) { + this.releaseTexture(dataId, texture, texShape, usage); + texData.texture = null; + texData.texShape = null; + } + texData.usage = TextureUsage.UPLOAD; + texData.values = values; + if (!this.delayedStorage) { + this.uploadToGPU(dataId); + } + }; + MathBackendWebGL.prototype.readSync = function (dataId) { + this.throwIfNoData(dataId); + var texData = this.texData.get(dataId); + var shape = texData.shape, texture = texData.texture, values = texData.values, texShape = texData.texShape, dtype = texData.dtype; + if (values != null) { + this.cacheOnCPU(dataId); + return values; + } + var shouldTimeProgram = this.activeTimers != null; + var start; + if (shouldTimeProgram) { + start = performance.now(); + } + var float32Values = this.getValuesFromTexture(texture, dataId, dtype, texShape, shape); + if (shouldTimeProgram) { + this.downloadWaitMs += performance.now() - start; + } + this.cacheOnCPU(dataId, float32Values); + return texData.values; + }; + MathBackendWebGL.prototype.read = function (dataId) { + return __awaiter(this, void 0, void 0, function () { + var subscribers_1, texData, shape, texture, values, texShape, dtype, bufferOrTexture, vals, subscribers; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (this.pendingRead.has(dataId)) { + subscribers_1 = this.pendingRead.get(dataId); + return [2, new Promise(function (resolve) { return subscribers_1.push(resolve); })]; + } + this.throwIfNoData(dataId); + texData = this.texData.get(dataId); + shape = texData.shape, texture = texData.texture, values = texData.values, texShape = texData.texShape, dtype = texData.dtype; + if (values != null) { + this.cacheOnCPU(dataId); + return [2, values]; + } + this.pendingRead.set(dataId, []); + if (!ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED') && + ENV.get('WEBGL_VERSION') === 2) { + throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and " + + "WEBGL_VERSION=2 not yet supported."); + } + bufferOrTexture = this.gpgpu.maybeCreateBufferFromTexture(texture, texShape[0], texShape[1]); + return [4, this.gpgpu.createAndWaitForFence()]; + case 1: + _a.sent(); + if (bufferOrTexture instanceof WebGLTexture) { + vals = this.getValuesFromTexture(texture, dataId, dtype, texShape, shape); + } + else { + vals = this.gpgpu.downloadFloat32MatrixFromBuffer(bufferOrTexture, texShape[0], texShape[1]); + } + this.cacheOnCPU(dataId, vals); + subscribers = this.pendingRead.get(dataId); + this.pendingRead.delete(dataId); + subscribers.forEach(function (resolve) { return resolve(vals); }); + if (this.pendingDisposal.has(dataId)) { + this.pendingDisposal.delete(dataId); + this.disposeData(dataId); + } + return [2, vals]; + } + }); + }); + }; + MathBackendWebGL.prototype.getValuesFromTexture = function (texture, dataId, dtype, texShape, shape) { + if (ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED')) { + return this.gpgpu.downloadFloat32MatrixFromOutputTexture(texture, texShape[0], texShape[1]); + } + var tmpTarget = Tensor.make(shape, {}); + this.texData.get(tmpTarget.dataId).usage = TextureUsage.DOWNLOAD; + var tmpInput = Tensor.make(shape, { dataId: dataId }, dtype); + var program = new EncodeFloatProgram(shape); + var pageToCpu = false; + this.compileAndRun(program, [tmpInput], tmpTarget, null, pageToCpu); + var tmpData = this.texData.get(tmpTarget.dataId); + var vals = this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(tmpData.texture, tmpData.texShape[0], tmpData.texShape[1]); + tmpInput.dispose(); + tmpTarget.dispose(); + return vals; + }; + MathBackendWebGL.prototype.time = function (f) { + return __awaiter(this, void 0, void 0, function () { + var oldActiveTimers, newActiveTimers, outerMostTime, flattenedActiveTimers, kernelMs, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + oldActiveTimers = this.activeTimers; + newActiveTimers = []; + outerMostTime = false; + if (this.programTimersStack == null) { + this.programTimersStack = newActiveTimers; + outerMostTime = true; + } + else { + this.activeTimers.push(newActiveTimers); + } + this.activeTimers = newActiveTimers; + f(); + flattenedActiveTimers = flatten(this.activeTimers); + this.activeTimers = oldActiveTimers; + if (outerMostTime) { + this.programTimersStack = null; + } + return [4, Promise.all(flattenedActiveTimers).then(function (results) { + var sum = 0; + results.forEach(function (result) { return sum += result; }); + return sum; + })]; + case 1: + kernelMs = _a.sent(); + res = { + uploadWaitMs: this.uploadWaitMs, + downloadWaitMs: this.downloadWaitMs, + kernelMs: kernelMs, + wallMs: null + }; + this.uploadWaitMs = 0; + this.downloadWaitMs = 0; + return [2, res]; + } + }); + }); + }; + MathBackendWebGL.prototype.memory = function () { + return { unreliable: false, numBytesInGPU: this.numBytesInGPU }; + }; + MathBackendWebGL.prototype.startTimer = function () { + if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) { + return this.gpgpu.beginQuery(); + } + return { startMs: performance.now(), endMs: null }; + }; + MathBackendWebGL.prototype.endTimer = function (query) { + if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) { + this.gpgpu.endQuery(); + return query; + } + query.endMs = performance.now(); + return query; + }; + MathBackendWebGL.prototype.getQueryTime = function (query) { + return __awaiter(this, void 0, void 0, function () { + var timerQuery; + return __generator(this, function (_a) { + if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) { + return [2, this.gpgpu.waitForQueryAndGetTime(query)]; + } + timerQuery = query; + return [2, timerQuery.endMs - timerQuery.startMs]; + }); + }); + }; + MathBackendWebGL.prototype.disposeData = function (dataId) { + if (this.pendingDisposal.has(dataId)) { + return; + } + if (this.pendingRead.has(dataId)) { + this.pendingDisposal.add(dataId); + return; + } + if (this.texData.has(dataId)) { + var _a = this.texData.get(dataId), texture = _a.texture, texShape = _a.texShape, usage = _a.usage; + if (texture != null) { + this.releaseTexture(dataId, texture, texShape, usage); + } + this.texData.delete(dataId); + } + }; + MathBackendWebGL.prototype.getTexture = function (dataId) { + this.uploadToGPU(dataId); + return this.texData.get(dataId).texture; + }; + MathBackendWebGL.prototype.getGPGPUContext = function () { + return this.gpgpu; + }; + MathBackendWebGL.prototype.getCanvas = function () { + return this.canvas; + }; + MathBackendWebGL.prototype.slice = function (x, begin, size) { + var program = new SliceProgram(size); + var customSetup = program.getCustomSetupFunc(begin); + return this.compileAndRun(program, [x], null, customSetup); + }; + MathBackendWebGL.prototype.stridedSlice = function (x, begin, end, strides, beginMask, endMask) { + var _a = getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask), beginIndex = _a[0], size = _a[1]; + if (size.some(function (axis) { return axis === 0; })) { + return tensor([], size); + } + var program = new StridedSliceProgram(beginIndex, strides, size); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.reverse = function (x, axis) { + var program = new ReverseProgram(x.shape, axis); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.concat = function (a, b) { + var program = new ConcatProgram(a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.neg = function (x) { + var program = new UnaryOpProgram(x.shape, NEG); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.matMul = function (a, b, transposeA, transposeB) { + var program = new MatMulProgram(a.shape, b.shape, transposeA, transposeB); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.multiply = function (a, b) { + var program = new BinaryOpProgram(MUL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.batchNormalization = function (x, mean, variance, varianceEpsilon, scale, offset) { + var inputs = [x, mean, variance]; + var offsetShape = null; + if (offset != null) { + offsetShape = offset.shape; + inputs.push(offset); + } + var scaleShape = null; + if (scale != null) { + scaleShape = scale.shape; + inputs.push(scale); + } + var program = new BatchNormProgram(x.shape, mean.shape, variance.shape, offsetShape, scaleShape, varianceEpsilon); + return this.compileAndRun(program, inputs); + }; + MathBackendWebGL.prototype.localResponseNormalization4D = function (x, radius, bias, alpha, beta) { + var program = new LRNProgram(x.shape, radius, bias, alpha, beta); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.LRNGrad = function (dy, inputImage, outputImage, depthRadius, bias, alpha, beta) { + var program = new LRNGradProgram(inputImage.shape, depthRadius, bias, alpha, beta); + return this.compileAndRun(program, [inputImage, outputImage, dy]); + }; + MathBackendWebGL.prototype.tile = function (x, reps) { + var program = new TileProgram(x.shape, reps); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.pad = function (x, paddings, constantValue) { + var program = new PadProgram(x.shape, paddings, constantValue); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.transpose = function (x, perm) { + var program = new TransposeProgram(x.shape, perm); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.gather = function (x, indices, axis) { + var program = new GatherProgram(x.shape, indices.size, axis); + return this.compileAndRun(program, [x, indices]); + }; + MathBackendWebGL.prototype.batchToSpaceND = function (x, blockShape, crops) { + assert(x.rank <= 4, 'batchToSpaceND for rank > 4 with a WebGL backend not implemented yet'); + var prod = blockShape.reduce(function (a, b) { return a * b; }); + var reshaped = getReshaped(x.shape, blockShape, prod); + var permuted = getPermuted(reshaped.length, blockShape.length); + var reshapedPermuted = getReshapedPermuted(x.shape, blockShape, prod); + var sliceBeginCoords = getSliceBeginCoords(crops, blockShape.length); + var sliceSize = getSliceSize(reshapedPermuted, crops, blockShape.length); + return x.reshape(reshaped) + .transpose(permuted) + .reshape(reshapedPermuted) + .slice(sliceBeginCoords, sliceSize); + }; + MathBackendWebGL.prototype.spaceToBatchND = function (x, blockShape, paddings) { + assert(x.rank <= 4, 'spaceToBatchND for rank > 4 with a WebGL backend not implemented yet'); + var prod = blockShape.reduce(function (a, b) { return a * b; }); + var completePaddings = [[0, 0]]; + completePaddings.push.apply(completePaddings, paddings); + for (var i = 1 + blockShape.length; i < x.shape.length; ++i) { + completePaddings.push([0, 0]); + } + var paddedX = x.pad(completePaddings); + var reshapedPaddedShape = getReshaped(paddedX.shape, blockShape, prod, false); + var permutedReshapedPaddedPermutation = getPermuted(reshapedPaddedShape.length, blockShape.length, false); + var flattenShape = getReshapedPermuted(paddedX.shape, blockShape, prod, false); + return paddedX.reshape(reshapedPaddedShape) + .transpose(permutedReshapedPaddedPermutation) + .reshape(flattenShape); + }; + MathBackendWebGL.prototype.reduce = function (x, reduceType, dtype) { + var batchSize = x.shape[0]; + var inSize = x.shape[1]; + var windowSize = computeOptimalWindowSize(inSize); + var reduceInfo = { windowSize: windowSize, inSize: inSize, batchSize: batchSize }; + var program = new ReduceProgram(reduceInfo, reduceType); + var _a = program.outputShape, rows = _a[0], cols = _a[1]; + var output = this.makeOutputArray([rows, cols], dtype); + this.compileAndRun(program, [x], output); + if (output.shape[1] === 1) { + return output; + } + return this.reduce(output, reduceType, dtype); + }; + MathBackendWebGL.prototype.argReduce = function (x, reduceType, bestIndicesA) { + if (bestIndicesA === void 0) { bestIndicesA = null; } + var batchSize = x.shape[0]; + var inSize = x.shape[1]; + if (bestIndicesA != null) { + batchSize = bestIndicesA.shape[0]; + inSize = bestIndicesA.shape[1]; + } + var windowSize = computeOptimalWindowSize(inSize); + var reduceInfo = { windowSize: windowSize, inSize: inSize, batchSize: batchSize }; + var program = new ArgMinMaxProgram(reduceInfo, reduceType, bestIndicesA == null); + var _a = program.outputShape, rows = _a[0], cols = _a[1]; + var output = this.makeOutputArray([rows, cols], 'int32'); + var inputs = [x]; + if (bestIndicesA != null) { + inputs.push(bestIndicesA); + } + this.compileAndRun(program, inputs, output); + if (output.shape[1] === 1) { + return output; + } + return this.argReduce(x, reduceType, output); + }; + MathBackendWebGL.prototype.sum = function (x, axes) { + assertAxesAreInnerMostDims('sum', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + var outputDType = sumOutType(x.dtype); + return this.reduce(a2D, 'sum', outputDType).reshape(outShape); + }; + MathBackendWebGL.prototype.unsortedSegmentSum = function (x, segmentIds, numSegments) { + var axis = 0; + var permutation = getAxesPermutation([axis], x.rank); + var permutedX = x; + if (permutation != null) { + permutedX = x.transpose(permutation); + axis = getInnerMostAxes(1, x.rank)[0]; + } + var outShape = computeOutShape(permutedX.shape, axis, numSegments); + var inSize = sizeFromShape([permutedX.shape[axis]]); + var a2D = permutedX.as2D(-1, inSize); + var outputDType = sumOutType(x.dtype); + var result = this.segOpCompute(a2D, 'unsortedSegmentSum', segmentIds, outputDType, numSegments) + .reshape(outShape); + if (permutation != null) { + result = result.transpose(getUndoAxesPermutation(permutation)); + } + return result; + }; + MathBackendWebGL.prototype.segOpCompute = function (x, segOpType, segmentIds, dtype, numSegments) { + var batchSize = x.shape[0]; + var inSize = x.shape[1]; + var windowSize = segOpComputeOptimalWindowSize(inSize, numSegments); + var segOpInfo = { windowSize: windowSize, inSize: inSize, batchSize: batchSize, numSegments: numSegments }; + var program = new SegmentOpProgram(segOpInfo, segOpType); + var _a = program.outputShape, rows = _a[0], cols = _a[1]; + var output = this.makeOutputArray([rows, cols], dtype); + this.compileAndRun(program, [x, segmentIds], output); + if (output.shape[1] === numSegments) { + return output; + } + segmentIds = range(0, numSegments).tile([inSize / windowSize]); + return this.segOpCompute(output, segOpType, segmentIds, dtype, numSegments); + }; + MathBackendWebGL.prototype.argMin = function (x, axis) { + var axes = [axis]; + assertAxesAreInnerMostDims('argMin', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.argReduce(a2D, 'min').reshape(outShape); + }; + MathBackendWebGL.prototype.argMax = function (x, axis) { + var axes = [axis]; + assertAxesAreInnerMostDims('argMax', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.argReduce(a2D, 'max').reshape(outShape); + }; + MathBackendWebGL.prototype.cumsum = function (x, axis, exclusive, reverse) { + if (axis !== x.rank - 1) { + throw new Error("WebGL cumsum shader expects an inner-most axis=" + (x.rank - 1) + " " + + ("but got axis=" + axis)); + } + var program = new CumSumProgram(x.shape, exclusive, reverse); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.equal = function (a, b) { + var program = new BinaryOpProgram(EQUAL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.notEqual = function (a, b) { + var program = new BinaryOpProgram(NOT_EQUAL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.less = function (a, b) { + var program = new BinaryOpProgram(LESS, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.lessEqual = function (a, b) { + var program = new BinaryOpProgram(LESS_EQUAL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.greater = function (a, b) { + var program = new BinaryOpProgram(GREATER, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.greaterEqual = function (a, b) { + var program = new BinaryOpProgram(GREATER_EQUAL, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.logicalNot = function (x) { + var program = new UnaryOpProgram(x.shape, LOGICAL_NOT); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.logicalAnd = function (a, b) { + var program = new BinaryOpProgram(LOGICAL_AND, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.logicalOr = function (a, b) { + var program = new BinaryOpProgram(LOGICAL_OR, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, 'bool'); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.select = function (condition, a, b) { + var program = new SelectProgram(condition.rank, a.shape, a.rank); + var output = this.makeOutputArray(program.outputShape, upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [condition, a, b], output); + }; + MathBackendWebGL.prototype.where = function (condition) { + warn('tf.where() in webgl locks the UI thread. ' + + 'Call tf.whereAsync() instead'); + var condVals = condition.dataSync(); + return whereImpl(condition.shape, condVals); + }; + MathBackendWebGL.prototype.topk = function (x, k, sorted) { + var xVals = x.dataSync(); + return topkImpl(xVals, x.shape, x.dtype, k, sorted); + }; + MathBackendWebGL.prototype.min = function (x, axes) { + assertAxesAreInnerMostDims('min', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.reduce(a2D, 'min', a2D.dtype).reshape(outShape); + }; + MathBackendWebGL.prototype.minimum = function (a, b) { + var program = new BinaryOpProgram(MIN, a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.mod = function (a, b) { + var program = new BinaryOpProgram(MOD, a.shape, b.shape); + var customSetup = program.getCustomSetupFunc(); + return this.compileAndRun(program, [a, b], null, customSetup); + }; + MathBackendWebGL.prototype.max = function (x, axes) { + assertAxesAreInnerMostDims('max', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.reduce(a2D, 'max', a2D.dtype).reshape(outShape); + }; + MathBackendWebGL.prototype.maximum = function (a, b) { + var program = new BinaryOpProgram(MAX, a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.all = function (x, axes) { + assertAxesAreInnerMostDims('all', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.reduce(a2D, 'all', a2D.dtype).reshape(outShape); + }; + MathBackendWebGL.prototype.any = function (x, axes) { + assertAxesAreInnerMostDims('any', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var inSize = sizeFromShape(reduceShape); + var a2D = x.as2D(-1, inSize); + return this.reduce(a2D, 'any', a2D.dtype).reshape(outShape); + }; + MathBackendWebGL.prototype.squaredDifference = function (a, b) { + var program = new BinaryOpProgram(SQUARED_DIFFERENCE, a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.realDivide = function (a, b) { + var op = DIV; + var outputDtype = 'float32'; + var program = new BinaryOpProgram(op, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, outputDtype); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.floorDiv = function (a, b) { + var op = INT_DIV; + var outputDtype = 'int32'; + var program = new BinaryOpProgram(op, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, outputDtype); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.add = function (a, b) { + var program = new BinaryOpProgram(ADD, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.addN = function (tensors) { + var res = tensors[0]; + for (var i = 1; i < tensors.length; i++) { + res = this.add(res, tensors[i]); + } + return res; + }; + MathBackendWebGL.prototype.subtract = function (a, b) { + var program = new BinaryOpProgram(SUB, a.shape, b.shape); + var output = this.makeOutputArray(program.outputShape, upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [a, b], output); + }; + MathBackendWebGL.prototype.pow = function (a, b) { + var program = new BinaryOpProgram(POW, a.shape, b.shape); + var customSetup = program.getCustomSetupFunc(); + var output = this.makeOutputArray(program.outputShape, upcastType(a.dtype, b.dtype)); + return this.compileAndRun(program, [a, b], output, customSetup); + }; + MathBackendWebGL.prototype.ceil = function (x) { + var program = new UnaryOpProgram(x.shape, CEIL); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.floor = function (x) { + var program = new UnaryOpProgram(x.shape, FLOOR); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.sign = function (x) { + var program = new UnaryOpProgram(x.shape, SIGN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.round = function (x) { + var program = new UnaryOpProgram(x.shape, ROUND); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.exp = function (x) { + var program = new UnaryOpProgram(x.shape, EXP); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.expm1 = function (x) { + var program = new UnaryOpProgram(x.shape, EXPM1); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.log = function (x) { + var program = new UnaryOpProgram(x.shape, LOG); + var customSetup = program.getCustomSetupFunc(); + return this.compileAndRun(program, [x], null, customSetup); + }; + MathBackendWebGL.prototype.log1p = function (x) { + var program = new UnaryOpProgram(x.shape, LOG1P); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.sqrt = function (x) { + var program = new UnaryOpProgram(x.shape, SQRT); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.rsqrt = function (x) { + var program = new UnaryOpProgram(x.shape, RSQRT); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.square = function (x) { + var program = new UnaryOpProgram(x.shape, SQUARE); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.reciprocal = function (x) { + var program = new UnaryOpProgram(x.shape, RECIPROCAL); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.relu = function (x) { + var program = new UnaryOpProgram(x.shape, RELU); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.elu = function (x) { + var program = new UnaryOpProgram(x.shape, ELU); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.eluDer = function (dy, y) { + var program = new BinaryOpProgram(ELU_DER, dy.shape, y.shape); + return this.compileAndRun(program, [dy, y]); + }; + MathBackendWebGL.prototype.selu = function (x) { + var program = new UnaryOpProgram(x.shape, SELU); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.int = function (x) { + var program = new UnaryOpProgram(x.shape, TO_INT); + var output = this.makeOutputArray(program.outputShape, 'int32'); + return this.compileAndRun(program, [x], output); + }; + MathBackendWebGL.prototype.clip = function (x, min, max) { + var program = new ClipProgram(x.shape, min, max); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.abs = function (x) { + var program = new UnaryOpProgram(x.shape, ABS); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.sigmoid = function (x) { + var program = new UnaryOpProgram(x.shape, SIGMOID); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.softplus = function (x) { + var program = new UnaryOpProgram(x.shape, SOFTPLUS); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.sin = function (x) { + var program = new UnaryOpProgram(x.shape, SIN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.cos = function (x) { + var program = new UnaryOpProgram(x.shape, COS); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.tan = function (x) { + var program = new UnaryOpProgram(x.shape, TAN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.asin = function (x) { + var program = new UnaryOpProgram(x.shape, ASIN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.acos = function (x) { + var program = new UnaryOpProgram(x.shape, ACOS); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.atan = function (x) { + var program = new UnaryOpProgram(x.shape, ATAN); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.atan2 = function (a, b) { + var program = new BinaryOpProgram(ATAN2, a.shape, b.shape); + return this.compileAndRun(program, [a, b]); + }; + MathBackendWebGL.prototype.sinh = function (x) { + var program = new UnaryOpProgram(x.shape, SINH); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.cosh = function (x) { + var program = new UnaryOpProgram(x.shape, COSH); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.tanh = function (x) { + var program = new UnaryOpProgram(x.shape, TANH); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.asinh = function (x) { + var program = new UnaryOpProgram(x.shape, ASINH); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.acosh = function (x) { + var program = new UnaryOpProgram(x.shape, ACOSH); + var customSetup = program.getCustomSetupFunc(); + return this.compileAndRun(program, [x], null, customSetup); + }; + MathBackendWebGL.prototype.atanh = function (x) { + var program = new UnaryOpProgram(x.shape, ATANH); + var customSetup = program.getCustomSetupFunc(); + return this.compileAndRun(program, [x], null, customSetup); + }; + MathBackendWebGL.prototype.erf = function (x) { + var program = new UnaryOpProgram(x.shape, ERF); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.step = function (x, alpha) { + var program = new UnaryOpProgram(x.shape, STEP(alpha)); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.conv2d = function (x, filter, convInfo) { + var program = new Conv2DProgram(convInfo); + return this.compileAndRun(program, [x, filter]); + }; + MathBackendWebGL.prototype.conv2dDerInput = function (dy, filter, convInfo) { + var program = new Conv2DDerInputProgram(convInfo); + return this.compileAndRun(program, [dy, filter]); + }; + MathBackendWebGL.prototype.conv2dDerFilter = function (x, dy, convInfo) { + var program = new Conv2DDerFilterProgram(convInfo); + return this.compileAndRun(program, [x, dy]); + }; + MathBackendWebGL.prototype.depthwiseConv2D = function (x, filter, convInfo) { + var program = new DepthwiseConv2DProgram(convInfo); + return this.compileAndRun(program, [x, filter]); + }; + MathBackendWebGL.prototype.depthwiseConv2DDerInput = function (dy, filter, convInfo) { + var program = new DepthwiseConv2DDerInputProgram(convInfo); + return this.compileAndRun(program, [dy, filter]); + }; + MathBackendWebGL.prototype.depthwiseConv2DDerFilter = function (x, dy, convInfo) { + var program = new DepthwiseConv2DDerFilterProgram(convInfo); + return this.compileAndRun(program, [x, dy]); + }; + MathBackendWebGL.prototype.maxPool = function (x, convInfo) { + var program = new Pool2DProgram(convInfo, 'max', false); + var output = this.makeOutputArray(program.outputShape, x.dtype); + return this.compileAndRun(program, [x], output); + }; + MathBackendWebGL.prototype.avgPool = function (x, convInfo) { + var program = new Pool2DProgram(convInfo, 'avg', false); + var output = this.makeOutputArray(program.outputShape, 'float32'); + return this.compileAndRun(program, [x], output); + }; + MathBackendWebGL.prototype.maxPoolBackprop = function (dy, x, y, convInfo) { + var getPositions = true; + var maxPoolPositionsProgram = new Pool2DProgram(convInfo, 'max', getPositions); + var maxPoolPositions = this.compileAndRun(maxPoolPositionsProgram, [x]); + var maxPoolBackPropProgram = new MaxPool2DBackpropProgram(convInfo); + var output = this.makeOutputArray(maxPoolBackPropProgram.outputShape, x.dtype); + var result = this.compileAndRun(maxPoolBackPropProgram, [dy, maxPoolPositions], output); + maxPoolPositions.dispose(); + return result; + }; + MathBackendWebGL.prototype.avgPoolBackprop = function (dy, x, convInfo) { + var avgPoolBackpropProgram = new AvgPool2DBackpropProgram(convInfo); + var output = this.makeOutputArray(avgPoolBackpropProgram.outputShape, x.dtype); + return this.compileAndRun(avgPoolBackpropProgram, [dy], output); + }; + MathBackendWebGL.prototype.cast = function (x, dtype) { + return castTensor(x, dtype, this); + }; + MathBackendWebGL.prototype.reshape = function (x, shape) { + return reshapeTensor(x, shape); + }; + MathBackendWebGL.prototype.resizeBilinear = function (x, newHeight, newWidth, alignCorners) { + var program = new ResizeBilinearProgram(x.shape, newHeight, newWidth, alignCorners); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.resizeBilinearBackprop = function (dy, x, alignCorners) { + var program = new ResizeBilinearBackpropProgram(dy, x, alignCorners); + return this.compileAndRun(program, [dy]); + }; + MathBackendWebGL.prototype.resizeNearestNeighbor = function (x, newHeight, newWidth, alignCorners) { + var program = new ResizeNearestNeighborProgram(x.shape, newHeight, newWidth, alignCorners); + return this.compileAndRun(program, [x]); + }; + MathBackendWebGL.prototype.resizeNearestNeighborBackprop = function (dy, x, alignCorners) { + var program = new ResizeNearestNeigborBackpropProgram(dy, x, alignCorners); + return this.compileAndRun(program, [dy]); + }; + MathBackendWebGL.prototype.multinomial = function (logits, normalized, numSamples, seed) { + var probs = normalized ? logits : softmax(logits); + var batchSize = probs.shape[0]; + var numOutcomes = probs.shape[1]; + var program = new MultinomialProgram(batchSize, numOutcomes, numSamples); + var output = this.makeOutputArray(program.outputShape, 'int32'); + var customSetup = program.getCustomSetupFunc(seed); + return this.compileAndRun(program, [probs], output, customSetup); + }; + MathBackendWebGL.prototype.oneHot = function (indices, depth, onValue, offValue) { + var program = new OneHotProgram(indices.size, depth, onValue, offValue); + return this.compileAndRun(program, [indices]); + }; + MathBackendWebGL.prototype.nonMaxSuppression = function (boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + warn('tf.nonMaxSuppression() in webgl locks the UI thread. ' + + 'Call tf.nonMaxSuppressionAsync() instead'); + var boxesVals = boxes.dataSync(); + var scoresVals = scores.dataSync(); + return nonMaxSuppressionImpl(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold); + }; + MathBackendWebGL.prototype.makeOutputArray = function (shape, dtype) { + return Tensor.make(shape, {}, dtype); + }; + MathBackendWebGL.prototype.compileAndRun = function (program, inputs, output, customSetup, pageToCpu) { + var _this = this; + if (pageToCpu === void 0) { pageToCpu = true; } + if (output == null) { + output = this.makeOutputArray(program.outputShape, inputs[0].dtype); + } + var inputsData = inputs.map(function (tensor$$1) { + var texData = _this.texData.get(tensor$$1.dataId); + if (texData.texture == null && tensor$$1.size <= SIZE_UPLOAD_UNIFORM) { + return { tensor: tensor$$1, texData: null, isUniform: true }; + } + _this.uploadToGPU(tensor$$1.dataId); + return { tensor: tensor$$1, texData: texData, isUniform: false }; + }); + this.uploadToGPU(output.dataId); + var outputData = { + tensor: output, + texData: this.texData.get(output.dataId), + isUniform: false + }; + var key = makeShaderKey(program, inputsData, outputData); + var binary = this.getAndSaveBinary(key, function () { + return compileProgram(_this.gpgpu, program, inputsData, outputData); + }); + var shouldTimeProgram = this.activeTimers != null; + var query; + if (shouldTimeProgram) { + query = this.startTimer(); + } + runProgram(binary, inputsData, outputData, customSetup); + if (pageToCpu && this.numBytesInGPU > this.NUM_BYTES_BEFORE_PAGING) { + var numBytesToPage = this.numBytesInGPU - this.NUM_BYTES_BEFORE_PAGING; + while (numBytesToPage > 0 && this.lruDataGPU.length > 0) { + var dataId = this.lruDataGPU.shift(); + var _a = this.texData.get(dataId), shape = _a.shape, dtype = _a.dtype; + numBytesToPage -= this.computeBytes(shape, dtype); + this.read(dataId); + } + } + if (shouldTimeProgram) { + query = this.endTimer(query); + this.activeTimers.push(this.getQueryTime(query)); + } + return output; + }; + MathBackendWebGL.prototype.getAndSaveBinary = function (key, getBinary) { + if (!(key in this.binaryCache)) { + this.binaryCache[key] = getBinary(); + } + return this.binaryCache[key]; + }; + MathBackendWebGL.prototype.getTextureManager = function () { + return this.textureManager; + }; + MathBackendWebGL.prototype.dispose = function () { + if (this.disposed) { + return; + } + for (var key in this.binaryCache) { + this.gpgpu.deleteProgram(this.binaryCache[key].webGLProgram); + } + this.textureManager.dispose(); + this.canvas.remove(); + if (this.fromPixelsCanvas != null) { + this.fromPixelsCanvas.remove(); + } + if (this.gpgpuCreatedLocally) { + this.gpgpu.dispose(); + } + this.disposed = true; + }; + MathBackendWebGL.prototype.throwIfNoData = function (dataId) { + if (!this.texData.has(dataId)) { + throw new Error("WebGL backend: No data found for this tensor. " + + "Did you change your backend in the middle of the program? " + + "New backends can't use Tensors created with previous backends"); + } + }; + MathBackendWebGL.prototype.uploadToGPU = function (dataId) { + this.throwIfNoData(dataId); + var texData = this.texData.get(dataId); + var shape = texData.shape, values = texData.values, texture = texData.texture, dtype = texData.dtype, usage = texData.usage; + if (texture != null) { + var index = this.lruDataGPU.indexOf(dataId); + if (index >= 0) { + this.lruDataGPU.splice(this.lruDataGPU.indexOf(dataId), 1); + this.lruDataGPU.push(dataId); + } + return; + } + var shouldTimeProgram = this.activeTimers != null; + var start; + if (shouldTimeProgram) { + start = performance.now(); + } + var texShape = getTextureShapeFromLogicalShape(this.gpgpu.gl, shape); + texData.texShape = texShape; + var newTexture = this.acquireTexture(dataId, texShape, usage); + texData.texture = newTexture; + if (values != null) { + this.gpgpu.uploadMatrixToTexture(newTexture, texShape[0], texShape[1], typedArrayToFloat32(values, dtype)); + texData.values = null; + if (shouldTimeProgram) { + this.uploadWaitMs += performance.now() - start; + } + } + }; + MathBackendWebGL.prototype.cacheOnCPU = function (dataId, float32Values) { + var dontKeepCopyOnGPU = this.delayedStorage; + var texData = this.texData.get(dataId); + var texture = texData.texture, texShape = texData.texShape, dtype = texData.dtype, usage = texData.usage; + if (dontKeepCopyOnGPU && texture != null) { + this.releaseTexture(dataId, texture, texShape, usage); + texData.texture = null; + texData.texShape = null; + } + if (float32Values != null) { + texData.values = float32ToTypedArray(float32Values, dtype); + } + }; + MathBackendWebGL.prototype.releaseTexture = function (dataId, texture, texShape, texType) { + var _a = this.texData.get(dataId), shape = _a.shape, dtype = _a.dtype; + var idx = this.lruDataGPU.indexOf(dataId); + if (idx >= 0) { + this.lruDataGPU.splice(idx, 1); + } + this.numBytesInGPU -= this.computeBytes(shape, dtype); + this.textureManager.releaseTexture(texture, texShape, texType); + }; + MathBackendWebGL.prototype.acquireTexture = function (dataId, texShape, texType) { + var _a = this.texData.get(dataId), shape = _a.shape, dtype = _a.dtype; + this.lruDataGPU.push(dataId); + this.numBytesInGPU += this.computeBytes(shape, dtype); + return this.textureManager.acquireTexture(texShape, texType); + }; + MathBackendWebGL.prototype.computeBytes = function (shape, dtype) { + return sizeFromShape(shape) * bytesPerElement(dtype); + }; + return MathBackendWebGL; + }()); + if (ENV.get('IS_BROWSER')) { + ENV.registerBackend('webgl', function () { return new MathBackendWebGL(); }, 2, setTensorTracker); + } + function float32ToTypedArray(a, dtype) { + if (dtype === 'float32') { + return a; + } + else if (dtype === 'int32' || dtype === 'bool') { + var result = (dtype === 'int32') ? new Int32Array(a.length) : + new Uint8Array(a.length); + for (var i = 0; i < result.length; ++i) { + result[i] = Math.round(a[i]); + } + return result; + } + else { + throw new Error("Unknown dtype " + dtype); + } + } + function typedArrayToFloat32(a, dtype) { + return (a instanceof Float32Array) ? a : new Float32Array(a); + } + + function neg_(x) { + var $x = convertToTensor(x, 'x', 'neg'); + var grad = function (dy) { + return { $x: function () { return dy.neg(); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.neg($x); }, { $x: $x }, grad); + } + function ceil_(x) { + var $x = convertToTensor(x, 'x', 'ceil'); + var grad = function (dy) { + return { $x: function () { return zerosLike(dy); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.ceil($x); }, { $x: $x }, grad); + } + function floor_(x) { + var $x = convertToTensor(x, 'x', 'floor'); + var grad = function (dy) { + return { $x: function () { return zerosLike(dy); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.floor($x); }, { $x: $x }, grad); + } + function sign_(x) { + var $x = convertToTensor(x, 'x', 'sign'); + var grad = function (dy) { + return { $x: function () { return zerosLike(dy); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.sign($x); }, { $x: $x }, grad); + } + function round_(x) { + var $x = convertToTensor(x, 'x', 'round'); + var grad = function (dy) { + return { $x: function () { return zerosLike(dy); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.round($x); }, { $x: $x }, grad); + } + function exp_(x) { + var $x = convertToTensor(x, 'x', 'exp'); + var bck = function (dy, saved) { + var y = saved[0]; + return { $x: function () { return dy.mulStrict(y); } }; + }; + return ENV.engine.runKernel(function (backend, save) { return save(backend.exp($x)); }, { $x: $x }, bck); + } + function expm1_(x) { + var $x = convertToTensor(x, 'x', 'expm1'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.exp()); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.expm1($x); }, { $x: $x }, grad); + } + function log_(x) { + var $x = convertToTensor(x, 'x', 'log'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.toFloat()); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.log($x); }, { $x: $x }, grad); + } + function log1p_(x) { + var $x = convertToTensor(x, 'x', 'log1p'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.add(scalar(1))); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.log1p($x); }, { $x: $x }, grad); + } + function sqrt_(x) { + var $x = convertToTensor(x, 'x', 'sqrt'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.toFloat().sqrt().mul(scalar(2))); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.sqrt($x); }, { $x: $x }, grad); + } + function rsqrt_(x) { + var $x = convertToTensor(x, 'x', 'rsqrt'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.pow(scalar(1.5)).mul(scalar(2))).neg(); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.rsqrt($x); }, { $x: $x }, grad); + } + function square_(x) { + var $x = convertToTensor(x, 'x', 'square'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.toFloat().mul(scalar(2))); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.square($x); }, { $x: $x }, grad); + } + function reciprocal_(x) { + var $x = convertToTensor(x, 'x', 'reciprocal'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.square().neg()); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.reciprocal($x); }, { $x: $x }, grad); + } + function abs_(x) { + var $x = convertToTensor(x, 'x', 'abs'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.toFloat().step(-1)); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.abs($x); }, { $x: $x }, grad); + } + function clipByValue_(x, clipValueMin, clipValueMax) { + var $x = convertToTensor(x, 'x', 'clipByValue'); + assert((clipValueMin <= clipValueMax), "Error in clip: min (" + clipValueMin + ") must be " + + ("less than or equal to max (" + clipValueMax + ").")); + var grad = function (dy) { + return { + $x: function () { return dy.where($x.greaterEqual(scalar(clipValueMin)) + .logicalAnd($x.lessEqual(scalar(clipValueMax))), zerosLike(dy)); }, + }; + }; + return ENV.engine.runKernel(function (backend) { return backend.clip($x, clipValueMin, clipValueMax); }, { $x: $x }, grad); + } + function sigmoid_(x) { + var $x = convertToTensor(x, 'x', 'sigmoid'); + var grad = function (dy, saved) { + var y = saved[0]; + return { $x: function () { return dy.mulStrict(y.mul(scalar(1).sub(y))); } }; + }; + return ENV.engine.runKernel(function (backend, save) { return save(backend.sigmoid($x)); }, { $x: $x }, grad); + } + function logSigmoid_(x) { + var $x = convertToTensor(x, 'x', 'logSigmoid'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.neg().sigmoid()); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.softplus($x.neg()).neg(); }, { $x: $x }, grad); + } + function softplus_(x) { + var $x = convertToTensor(x, 'x', 'softplus'); + var grad = function (dy) { + return { $x: function () { return dy.mulStrict($x.sigmoid()); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.softplus($x); }, { $x: $x }, grad); + } + function sin_(x) { + var $x = convertToTensor(x, 'x', 'sin'); + var grad = function (dy) { + return { $x: function () { return $x.toFloat().cos().mulStrict(dy); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.sin($x); }, { $x: $x }, grad); + } + function cos_(x) { + var $x = convertToTensor(x, 'x', 'cos'); + var grad = function (dy) { + return { $x: function () { return $x.toFloat().sin().neg().mulStrict(dy); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.cos($x); }, { $x: $x }, grad); + } + function tan_(x) { + var $x = convertToTensor(x, 'x', 'tan'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict($x.cos().square()); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.tan($x); }, { $x: $x }, grad); + } + function asin_(x) { + var $x = convertToTensor(x, 'x', 'asin'); + var grad = function (dy) { + return { + $x: function () { return dy.divStrict(scalar(1).sub($x.toFloat().square()).sqrt()); } + }; + }; + return ENV.engine.runKernel(function (backend) { return backend.asin($x); }, { $x: $x }, grad); + } + function acos_(x) { + var $x = convertToTensor(x, 'x', 'acos'); + var grad = function (dy) { + return { + $x: function () { + return dy.divStrict(scalar(1).sub($x.toFloat().square()).sqrt()).neg(); + } + }; + }; + return ENV.engine.runKernel(function (backend) { return backend.acos($x); }, { $x: $x }, grad); + } + function atan_(x) { + var $x = convertToTensor(x, 'x', 'atan'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict(scalar(1).add($x.toFloat().square())); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.atan($x); }, { $x: $x }, grad); + } + function sinh_(x) { + var $x = convertToTensor(x, 'x', 'sinh'); + var grad = function (dy) { + return { $x: function () { return $x.toFloat().cosh().mulStrict(dy); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.sinh($x); }, { $x: $x }, grad); + } + function cosh_(x) { + var $x = convertToTensor(x, 'x', 'cosh'); + var grad = function (dy) { + return { $x: function () { return $x.toFloat().sinh().mulStrict(dy); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.cosh($x); }, { $x: $x }, grad); + } + function tanh_(x) { + var $x = convertToTensor(x, 'x', 'tanh'); + var grad = function (dy, saved) { + var y = saved[0]; + return { $x: function () { return scalar(1).sub(y.square()).mulStrict(dy); } }; + }; + return ENV.engine.runKernel(function (backend, save) { return save(backend.tanh($x)); }, { $x: $x }, grad); + } + function asinh_(x) { + var $x = convertToTensor(x, 'x', 'asinh'); + var grad = function (dy) { + return { + $x: function () { return dy.divStrict(scalar(1).add($x.toFloat().square()).sqrt()); } + }; + }; + return ENV.engine.runKernel(function (backend) { return backend.asinh($x); }, { $x: $x }, grad); + } + function acosh_(x) { + var $x = convertToTensor(x, 'x', 'acosh'); + var grad = function (dy) { + return { + $x: function () { return dy.divStrict($x.toFloat().square().sub(scalar(1)).sqrt()); } + }; + }; + return ENV.engine.runKernel(function (backend) { return backend.acosh($x); }, { $x: $x }, grad); + } + function atanh_(x) { + var $x = convertToTensor(x, 'x', 'atanh'); + var grad = function (dy) { + return { $x: function () { return dy.divStrict(scalar(1).sub($x.toFloat().square())); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.atanh($x); }, { $x: $x }, grad); + } + function erf_(x) { + var $x = convertToTensor(x, 'x', 'erf'); + assert($x.dtype === 'int32' || $x.dtype === 'float32', 'Input dtype must be `int32` or `float32`.'); + if ($x.dtype === 'int32') { + $x = $x.toFloat(); + } + var grad = function (dy) { + return { + $x: function () { return dy.mulStrict(scalar(2 / Math.sqrt(Math.PI)).mul($x.square().neg().exp())); } + }; + }; + return ENV.engine.runKernel(function (backend) { return backend.erf($x); }, { $x: $x }, grad); + } + function step_(x, alpha) { + if (alpha === void 0) { alpha = 0.0; } + var $x = convertToTensor(x, 'x', 'step'); + var grad = function (dy) { + return { $x: function () { return zerosLike(dy); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.step($x, alpha); }, { $x: $x }, grad); + } + var abs = op({ abs_: abs_ }); + var acos = op({ acos_: acos_ }); + var acosh = op({ acosh_: acosh_ }); + var asin = op({ asin_: asin_ }); + var asinh = op({ asinh_: asinh_ }); + var atan = op({ atan_: atan_ }); + var atanh = op({ atanh_: atanh_ }); + var ceil = op({ ceil_: ceil_ }); + var clipByValue = op({ clipByValue_: clipByValue_ }); + var cos = op({ cos_: cos_ }); + var cosh = op({ cosh_: cosh_ }); + var erf = op({ erf_: erf_ }); + var exp = op({ exp_: exp_ }); + var expm1 = op({ expm1_: expm1_ }); + var floor = op({ floor_: floor_ }); + var log$1 = op({ log_: log_ }); + var log1p = op({ log1p_: log1p_ }); + var logSigmoid = op({ logSigmoid_: logSigmoid_ }); + var neg = op({ neg_: neg_ }); + var reciprocal = op({ reciprocal_: reciprocal_ }); + var round = op({ round_: round_ }); + var rsqrt = op({ rsqrt_: rsqrt_ }); + var sigmoid = op({ sigmoid_: sigmoid_ }); + var sign = op({ sign_: sign_ }); + var sin = op({ sin_: sin_ }); + var sinh = op({ sinh_: sinh_ }); + var softplus = op({ softplus_: softplus_ }); + var sqrt = op({ sqrt_: sqrt_ }); + var square = op({ square_: square_ }); + var step = op({ step_: step_ }); + var tan = op({ tan_: tan_ }); + var tanh$1 = op({ tanh_: tanh_ }); + + function batchNormalization2d_(x, mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + var $x = convertToTensor(x, 'x', 'batchNormalization'); + var $mean = convertToTensor(mean, 'mean', 'batchNormalization'); + var $variance = convertToTensor(variance, 'variance', 'batchNormalization'); + var $scale; + if (scale != null) { + $scale = convertToTensor(scale, 'scale', 'batchNormalization'); + } + var $offset; + if (offset != null) { + $offset = convertToTensor(offset, 'offset', 'batchNormalization'); + } + assert($x.rank === 2, "Error in batchNormalization3D: x must be rank 3 but got rank " + + ($x.rank + ".")); + assert($mean.rank === 2 || $mean.rank === 1, "Error in batchNormalization2D: mean must be rank 2 or rank 1 but " + + ("got rank " + $mean.rank + ".")); + assert($variance.rank === 2 || $variance.rank === 1, "Error in batchNormalization2D: variance must be rank 2 or rank 1 " + + ("but got rank " + $variance.rank + ".")); + if ($scale != null) { + assert($scale.rank === 2 || $scale.rank === 1, "Error in batchNormalization2D: scale must be rank 2 or rank 1 " + + ("but got rank " + $scale.rank + ".")); + } + if ($offset != null) { + assert($offset.rank === 2 || $offset.rank === 1, "Error in batchNormalization2D: offset must be rank 2 or rank 1 " + + ("but got rank " + $offset.rank + ".")); + } + return batchNormalization($x, $mean, $variance, varianceEpsilon, $scale, $offset); + } + function batchNormalization3d_(x, mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + var $x = convertToTensor(x, 'x', 'batchNormalization'); + var $mean = convertToTensor(mean, 'mean', 'batchNormalization'); + var $variance = convertToTensor(variance, 'variance', 'batchNormalization'); + var $scale; + if (scale != null) { + $scale = convertToTensor(scale, 'scale', 'batchNormalization'); + } + var $offset; + if (offset != null) { + $offset = convertToTensor(offset, 'offset', 'batchNormalization'); + } + assert($x.rank === 3, "Error in batchNormalization3D: x must be rank 3 but got rank " + + ($x.rank + ".")); + assert($mean.rank === 3 || $mean.rank === 1, "Error in batchNormalization3D: mean must be rank 3 or rank 1 but " + + ("got rank " + $mean.rank + ".")); + assert($variance.rank === 3 || $variance.rank === 1, "Error in batchNormalization3D: variance must be rank 3 or rank 1 " + + ("but got rank " + $variance.rank + ".")); + if ($scale != null) { + assert($scale.rank === 3 || $scale.rank === 1, "Error in batchNormalization3D: scale must be rank 3 or rank 1 " + + ("but got rank " + $scale.rank + ".")); + } + if ($offset != null) { + assert($offset.rank === 3 || $offset.rank === 1, "Error in batchNormalization3D: offset must be rank 3 or rank 1 " + + ("but got rank " + $offset.rank + ".")); + } + return batchNormalization($x, $mean, $variance, varianceEpsilon, $scale, $offset); + } + function batchNormalization4d_(x, mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + var $x = convertToTensor(x, 'x', 'batchNormalization'); + var $mean = convertToTensor(mean, 'mean', 'batchNormalization'); + var $variance = convertToTensor(variance, 'variance', 'batchNormalization'); + var $scale; + if (scale != null) { + $scale = convertToTensor(scale, 'scale', 'batchNormalization'); + } + var $offset; + if (offset != null) { + $offset = convertToTensor(offset, 'offset', 'batchNormalization'); + } + assert($x.rank === 4, "Error in batchNormalization4D: x must be rank 4 but got rank " + + ($x.rank + ".")); + assert($mean.rank === 4 || $mean.rank === 1, "Error in batchNormalization4D: mean must be rank 4 or rank 1 but " + + ("got rank " + $mean.rank + ".")); + assert($variance.rank === 4 || $variance.rank === 1, "Error in batchNormalization4D: variance must be rank 4 or rank 1 " + + ("but got rank " + $variance.rank + ".")); + if ($scale != null) { + assert($scale.rank === 4 || $scale.rank === 1, "Error in batchNormalization4D: scale must be rank 4 or rank 1 " + + ("but got rank " + $scale.rank + ".")); + } + if ($offset != null) { + assert($offset.rank === 4 || $offset.rank === 1, "Error in batchNormalization4D: offset must be rank 4 or rank 1 " + + ("but got rank " + $offset.rank + ".")); + } + return batchNormalization($x, $mean, $variance, varianceEpsilon, $scale, $offset); + } + function batchNormalization_(x, mean, variance, varianceEpsilon, scale, offset) { + if (varianceEpsilon === void 0) { varianceEpsilon = .001; } + var $x = convertToTensor(x, 'x', 'batchNormalization'); + var $mean = convertToTensor(mean, 'mean', 'batchNormalization'); + var $variance = convertToTensor(variance, 'variance', 'batchNormalization'); + var $scale; + if (scale != null) { + $scale = convertToTensor(scale, 'scale', 'batchNormalization'); + } + var $offset; + if (offset != null) { + $offset = convertToTensor(offset, 'offset', 'batchNormalization'); + } + assert($mean.rank === $variance.rank, 'Batch normalization gradient requires mean and variance to have ' + + 'equal ranks.'); + assert($offset == null || $mean.rank === $offset.rank, 'Batch normalization gradient requires mean and offset to have ' + + 'equal ranks.'); + assert($scale == null || $mean.rank === $scale.rank, 'Batch normalization gradient requires mean and scale to have ' + + 'equal ranks.'); + var x4D; + if ($x.rank === 0 || $x.rank === 1) { + x4D = $x.as4D(1, 1, 1, $x.size); + } + else if ($x.rank === 2) { + x4D = $x.as4D(1, 1, $x.shape[0], $x.shape[1]); + } + else if ($x.rank === 3) { + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + else { + x4D = $x; + } + var der = function (dy) { + var scaleValue = $scale == null ? scalar(1) : $scale; + var reductionAxes = getReductionAxes($mean.shape, x4D.shape); + var tileShape = []; + if ($mean.rank === 1) { + for (var i = 0; i < x4D.shape.length - 1; ++i) { + tileShape.push(x4D.shape[i]); + } + tileShape.push(1); + } + var xMinusMean = $x.sub($mean); + var dyTimesScaleValue = dy.mul(scaleValue); + var oneOverSqrtVariance = rsqrt($variance.add(scalar(varianceEpsilon))); + var minusHalfRCube = oneOverSqrtVariance.mul(oneOverSqrtVariance) + .mul(oneOverSqrtVariance) + .mul(scalar(-0.5)); + var derX = function () { + if ($mean.rank === 1) { + return dy + .mul(tile(oneOverSqrtVariance.as4D(1, 1, 1, $mean.shape[0]), tileShape)) + .mul(scaleValue) + .reshape($x.shape); + } + else { + return dy.mul(oneOverSqrtVariance).mul(scaleValue).reshape($x.shape); + } + }; + var derMean = function () { + var meanDer = oneOverSqrtVariance.mul(scalar(-1)).mul(dyTimesScaleValue); + if ($mean.rank === 1) { + meanDer = meanDer.sum(reductionAxes); + } + return meanDer.reshape($mean.shape); + }; + var derVariance = function () { + var varianceDer = minusHalfRCube.mul(xMinusMean).mul(dyTimesScaleValue); + if ($mean.rank === 1) { + varianceDer = varianceDer.sum(reductionAxes); + } + return varianceDer.reshape($mean.shape); + }; + var derScale = function () { + var xMinusMean2TimesRsqrt = xMinusMean.mul(oneOverSqrtVariance); + var scaleDer = dy.mul(xMinusMean2TimesRsqrt); + if ($mean.rank === 1) { + scaleDer = scaleDer.sum(reductionAxes); + } + return scaleDer.reshape($mean.shape); + }; + var derOffset = function () { + var offsetDer = dy; + if ($mean.rank === 1) { + offsetDer = offsetDer.sum(reductionAxes); + } + return offsetDer.reshape($mean.shape); + }; + return { + $x: derX, + $mean: derMean, + $variance: derVariance, + $scale: derScale, + $offset: derOffset + }; + }; + var res = ENV.engine.runKernel(function (backend) { return backend.batchNormalization(x4D, batchnormReshape4D($mean), batchnormReshape4D($variance), varianceEpsilon, batchnormReshape4D($scale), batchnormReshape4D($offset)); }, { $x: $x, $mean: $mean, $variance: $variance, $scale: $scale, $offset: $offset }, der); + return res.reshape($x.shape); + } + function batchnormReshape4D(x) { + if (x == null) { + return null; + } + if (x.rank === 0) { + return x.as1D(); + } + else if (x.rank === 1) { + return x; + } + else if (x.rank === 2) { + return x.as4D(1, 1, x.shape[0], x.shape[1]); + } + else if (x.rank === 3) { + return x.as4D(1, x.shape[0], x.shape[1], x.shape[2]); + } + return x; + } + var batchNormalization2d = op({ batchNormalization2d_: batchNormalization2d_ }); + var batchNormalization3d = op({ batchNormalization3d_: batchNormalization3d_ }); + var batchNormalization4d = op({ batchNormalization4d_: batchNormalization4d_ }); + var batchNormalization = op({ batchNormalization_: batchNormalization_ }); + + function computePool2DInfo(inShape, filterSize, strides, pad, roundingMode, dataFormat) { + if (dataFormat === void 0) { dataFormat = 'channelsLast'; } + var _a = parseTupleParam(filterSize), filterHeight = _a[0], filterWidth = _a[1]; + var filterShape; + if (dataFormat === 'channelsLast') { + filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]]; + } + else if (dataFormat === 'channelsFirst') { + filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]]; + } + else { + throw new Error("Unknown dataFormat " + dataFormat); + } + var dilations = 1; + return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat); + } + function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise, dataFormat) { + if (depthwise === void 0) { depthwise = false; } + if (dataFormat === void 0) { dataFormat = 'channelsLast'; } + var _a = [-1, -1, -1, -1], batchSize = _a[0], inHeight = _a[1], inWidth = _a[2], inChannels = _a[3]; + if (dataFormat === 'channelsLast') { + batchSize = inShape[0], inHeight = inShape[1], inWidth = inShape[2], inChannels = inShape[3]; + } + else if (dataFormat === 'channelsFirst') { + batchSize = inShape[0], inChannels = inShape[1], inHeight = inShape[2], inWidth = inShape[3]; + } + else { + throw new Error("Unknown dataFormat " + dataFormat); + } + var filterHeight = filterShape[0], filterWidth = filterShape[1], filterChannels = filterShape[3]; + var _b = parseTupleParam(strides), strideHeight = _b[0], strideWidth = _b[1]; + var _c = parseTupleParam(dilations), dilationHeight = _c[0], dilationWidth = _c[1]; + var effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); + var effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); + var _d = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode), padInfo = _d.padInfo, outHeight = _d.outHeight, outWidth = _d.outWidth; + var outChannels = depthwise ? filterChannels * inChannels : filterChannels; + var outShape; + if (dataFormat === 'channelsFirst') { + outShape = [batchSize, outChannels, outHeight, outWidth]; + } + else if (dataFormat === 'channelsLast') { + outShape = [batchSize, outHeight, outWidth, outChannels]; + } + return { + batchSize: batchSize, + dataFormat: dataFormat, + inHeight: inHeight, + inWidth: inWidth, + inChannels: inChannels, + outHeight: outHeight, + outWidth: outWidth, + outChannels: outChannels, + padInfo: padInfo, + strideHeight: strideHeight, + strideWidth: strideWidth, + filterHeight: filterHeight, + filterWidth: filterWidth, + dilationHeight: dilationHeight, + dilationWidth: dilationWidth, + inShape: inShape, + outShape: outShape, + filterShape: filterShape + }; + } + function computeOutputShape3D(inShape, fieldSize, outDepth, stride, zeroPad, roundingMode) { + if (zeroPad == null) { + zeroPad = computeDefaultPad(inShape, fieldSize, stride); + } + var inputRows = inShape[0]; + var inputCols = inShape[1]; + var outputRows = conditionalRound((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + assert(isInt(outputRows), "The output # of rows (" + outputRows + ") must be an integer. Change the " + + "stride and/or zero pad parameters"); + var outputCols = conditionalRound((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + assert(isInt(outputCols), "The output # of columns (" + outputCols + ") must be an integer. Change " + + "the stride and/or zero pad parameters"); + return [outputRows, outputCols, outDepth]; + } + function computeDefaultPad(inputShape, fieldSize, stride, dilation) { + if (dilation === void 0) { dilation = 1; } + var effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation); + return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2); + } + function parseTupleParam(param) { + return typeof param === 'number' ? [param, param] : param; + } + function getEffectiveFilterSize(filterSize, dilation) { + if (dilation <= 1) { + return filterSize; + } + return filterSize + (filterSize - 1) * (dilation - 1); + } + function getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode) { + var padInfo; + var outHeight; + var outWidth; + if (typeof pad === 'number') { + var padType = (pad === 0) ? 'VALID' : 'NUMBER'; + padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType }; + var outShape = computeOutputShape3D([inHeight, inWidth, 1], filterHeight, 1, strideHeight, pad, roundingMode); + outHeight = outShape[0]; + outWidth = outShape[1]; + } + else if (pad === 'same') { + outHeight = Math.ceil(inHeight / strideHeight); + outWidth = Math.ceil(inWidth / strideWidth); + var padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight; + var padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth; + var top_1 = Math.floor(padAlongHeight / 2); + var bottom = padAlongHeight - top_1; + var left = Math.floor(padAlongWidth / 2); + var right = padAlongWidth - left; + padInfo = { top: top_1, bottom: bottom, left: left, right: right, type: 'SAME' }; + } + else if (pad === 'valid') { + padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' }; + outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); + outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); + } + else { + throw Error("Unknown padding parameter: " + pad); + } + return { padInfo: padInfo, outHeight: outHeight, outWidth: outWidth }; + } + function conditionalRound(value, roundingMode) { + if (!roundingMode) { + return value; + } + switch (roundingMode) { + case 'round': + return Math.round(value); + case 'ceil': + return Math.ceil(value); + case 'floor': + return Math.floor(value); + default: + throw new Error("Unknown roundingMode " + roundingMode); + } + } + + function conv1d_(x, filter, stride, pad, dataFormat, dilation, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NWC'; } + if (dilation === void 0) { dilation = 1; } + var $x = convertToTensor(x, 'x', 'conv1d'); + var $filter = convertToTensor(filter, 'filter', 'conv1d'); + var x3D = $x; + var reshapedTo3D = false; + if ($x.rank === 2) { + reshapedTo3D = true; + x3D = $x.as3D(1, $x.shape[0], $x.shape[1]); + } + assert(x3D.rank === 3, "Error in conv1d: input must be rank 3, but got rank " + x3D.rank + "."); + assert($filter.rank === 3, "Error in conv1d: filter must be rank 3, but got rank " + + ($filter.rank + ".")); + if (dimRoundingMode != null) { + assert(isInt(pad), "Error in conv1d: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + assert(x3D.shape[2] === $filter.shape[1], "Error in conv1d: depth of input (" + x3D.shape[2] + ") must match " + + ("input depth for filter " + $filter.shape[1] + ".")); + assert(eitherStridesOrDilationsAreOne(stride, dilation), 'Error in conv1D: Either stride or dilation must be 1. ' + + ("Got stride " + stride + " and dilation '" + dilation + "'")); + assert(dataFormat === 'NWC', "Error in conv1d: got dataFormat of " + dataFormat + " but only NWC is currently supported."); + var filter4D = $filter.as4D(1, $filter.shape[0], $filter.shape[1], $filter.shape[2]); + var input4D = x3D.as4D(x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]); + var strides = [1, stride]; + var dilations = [1, dilation]; + var conv2dDataFormat = 'NHWC'; + var res = conv2d(input4D, filter4D, strides, pad, conv2dDataFormat, dilations, dimRoundingMode); + if (reshapedTo3D) { + return res.as2D(res.shape[2], res.shape[3]); + } + return res.as3D(res.shape[0], res.shape[2], res.shape[3]); + } + function conv2d_(x, filter, strides, pad, dataFormat, dilations, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + if (dilations === void 0) { dilations = [1, 1]; } + var $x = convertToTensor(x, 'x', 'conv2d'); + var $filter = convertToTensor(filter, 'filter', 'conv2d'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + assert(x4D.rank === 4, "Error in conv2d: input must be rank 4, but got rank " + x4D.rank + "."); + assert($filter.rank === 4, "Error in conv2d: filter must be rank 4, but got rank " + + ($filter.rank + ".")); + if (dimRoundingMode != null) { + assert(isInt(pad), "Error in conv2d: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + assert(x4D.shape[3] === $filter.shape[2], "Error in conv2d: depth of input (" + x4D.shape[3] + ") must match " + + ("input depth for filter " + $filter.shape[2] + ".")); + assert(eitherStridesOrDilationsAreOne(strides, dilations), 'Error in conv2D: Either strides or dilations must be 1. ' + + ("Got strides " + strides + " and dilations '" + dilations + "'")); + assert(dataFormat === 'NHWC', "Error in conv2d: got dataFormat of " + dataFormat + " but only NHWC is currently supported."); + var convInfo = computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode); + var grad = function (dy) { + assert(tupleValuesAreOne(dilations), 'Error in gradient of conv2D: dilation rates greater than 1 are not' + + ("yet supported in gradients. Got dilations '" + dilations + "'")); + return { + x: function () { return conv2dDerInput_(x4D.shape, dy, $filter, strides, pad); }, + $filter: function () { return conv2dDerFilter_(x4D, dy, $filter.shape, strides, pad); } + }; + }; + var res = ENV.engine.runKernel(function (backend) { return backend.conv2d(x4D, $filter, convInfo); }, { x: x4D, $filter: $filter }, grad); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + function conv2dDerInput_(xShape, dy, filter, strides, pad, dimRoundingMode) { + assert(xShape.length === dy.rank, "Length of inShape " + + ("(" + xShape.length + ") and rank of dy (" + dy.rank + ") must match")); + var xShape4D = xShape; + var dy4D = dy; + var reshapedTo4D = false; + if (dy.rank === 3) { + reshapedTo4D = true; + dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]); + xShape4D = [1, xShape[0], xShape[1], xShape[2]]; + } + var inDepth = xShape4D[3]; + var outDepth = dy4D.shape[3]; + assert(xShape4D.length === 4, "Error in conv2dDerInput: inShape must be length 4, but got length " + + (xShape4D.length + ".")); + assert(dy4D.rank === 4, "Error in conv2dDerInput: dy must be rank 4, but got " + + ("rank " + dy4D.rank)); + assert(filter.rank === 4, "Error in conv2dDerInput: filter must be rank 4, but got " + + ("rank " + filter.rank)); + assert(inDepth === filter.shape[2], "Error in conv2dDerInput: depth of input (" + inDepth + ") must " + + ("match input depth for filter " + filter.shape[2] + ".")); + assert(outDepth === filter.shape[3], "Error in conv2dDerInput: depth of output (" + outDepth + ") must " + + ("match output depth for filter " + filter.shape[3] + ".")); + if (dimRoundingMode != null) { + assert(isInt(pad), "Error in conv2dDerInput: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var dilations = 1; + var convInfo = computeConv2DInfo(xShape4D, filter.shape, strides, dilations, pad, dimRoundingMode); + var res = ENV.engine.runKernel(function (backend) { return backend.conv2dDerInput(dy4D, filter, convInfo); }, { dy4D: dy4D }); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + function conv2dDerFilter_(x, dy, filterShape, strides, pad, dimRoundingMode) { + var x4D = x; + if (x.rank === 3) { + x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]); + } + var dy4D = dy; + if (dy4D.rank === 3) { + dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]); + } + assert(x4D.rank === 4, "Error in conv2dDerFilter: input must be rank 4, but got shape " + + (x4D.shape + ".")); + assert(dy4D.rank === 4, "Error in conv2dDerFilter: dy must be rank 4, but got shape " + + (dy4D.shape + ".")); + assert(filterShape.length === 4, "Error in conv2dDerFilter: filterShape must be length 4, but got " + + (filterShape + ".")); + assert(x4D.shape[3] === filterShape[2], "Error in conv2dDerFilter: depth of input " + x4D.shape[3] + ") must " + + ("match input depth in filter (" + filterShape[2] + ".")); + assert(dy4D.shape[3] === filterShape[3], "Error in conv2dDerFilter: depth of dy (" + dy4D.shape[3] + ") must " + + ("match output depth for filter (" + filterShape[3] + ").")); + if (dimRoundingMode != null) { + assert(isInt(pad), "Error in conv2dDerFilter: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var dilations = 1; + var convInfo = computeConv2DInfo(x4D.shape, filterShape, strides, dilations, pad, dimRoundingMode); + return ENV.engine.runKernel(function (backend) { return backend.conv2dDerFilter(x4D, dy4D, convInfo); }, { x4D: x4D, dy4D: dy4D }); + } + function conv2dTranspose_(x, filter, outputShape, strides, pad, dimRoundingMode) { + var $x = convertToTensor(x, 'x', 'conv2dTranspose'); + var $filter = convertToTensor(filter, 'filter', 'conv2dTranspose'); + return conv2dDerInput_(outputShape, $x, $filter, strides, pad, dimRoundingMode); + } + function depthwiseConv2d_(x, filter, strides, pad, dataFormat, dilations, dimRoundingMode) { + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + if (dilations === void 0) { dilations = [1, 1]; } + var $x = convertToTensor(x, 'x', 'depthwiseConv2d'); + var $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + assert(x4D.rank === 4, "Error in depthwiseConv2d: input must be rank 4, but got " + + ("rank " + x4D.rank + ".")); + assert($filter.rank === 4, "Error in depthwiseConv2d: filter must be rank 4, but got rank " + + ($filter.rank + ".")); + assert(x4D.shape[3] === $filter.shape[2], "Error in depthwiseConv2d: number of input channels " + + ("(" + x4D.shape[3] + ") must match the inChannels dimension in ") + + ("filter " + $filter.shape[2] + ".")); + if (dilations == null) { + dilations = [1, 1]; + } + assert(eitherStridesOrDilationsAreOne(strides, dilations), 'Error in depthwiseConv2d: Either strides or dilations must be 1. ' + + ("Got strides " + strides + " and dilations '" + dilations + "'")); + if (dimRoundingMode != null) { + assert(isInt(pad), "Error in depthwiseConv2d: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var convInfo = computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode, true); + var grad = function (dy) { + assert(tupleValuesAreOne(dilations), 'Error in gradient of depthwiseConv2d: dilation rates greater than ' + + ("1 are not yet supported. Got dilations '" + dilations + "'")); + return { + x: function () { return depthwiseConv2dDerInput(x4D.shape, dy, $filter, convInfo); }, + $filter: function () { return depthwiseConv2dDerFilter(x4D, dy, $filter.shape, convInfo); }, + }; + }; + var res = ENV.engine.runKernel(function (backend) { return backend.depthwiseConv2D(x4D, $filter, convInfo); }, { x: x4D, $filter: $filter }, grad); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + function separableConv2d_(x, depthwiseFilter, pointwiseFilter, strides, pad, dilation, dataFormat) { + if (dilation === void 0) { dilation = [1, 1]; } + if (dataFormat === void 0) { dataFormat = 'NHWC'; } + var $x = convertToTensor(x, 'x', 'separableConv2d'); + var $depthwiseFilter = convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d'); + var $pointwiseFilter = convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + if (dataFormat === 'NCHW') { + throw new Error('separableConv2d currently does not support dataFormat NCHW; only ' + + 'NHWC is supported'); + } + assert(x4D.rank === 4, "Error in separableConv2d: input must be rank 4, but got " + + ("rank " + x4D.rank + ".")); + assert($depthwiseFilter.rank === 4, "Error in separableConv2d: depthwise filter must be rank 4, but got " + + ("rank " + $depthwiseFilter.rank + ".")); + assert($pointwiseFilter.rank === 4, "Error in separableConv2d: pointwise filter must be rank 4, but got " + + ("rank " + $depthwiseFilter.rank + ".")); + assert($pointwiseFilter.shape[0] === 1, "Error in separableConv2d: the first dimension of pointwise filter " + + (" must be 1, but got " + $pointwiseFilter.shape[0] + ".")); + assert($pointwiseFilter.shape[1] === 1, "Error in separableConv2d: the second dimension of pointwise filter " + + (" must be 1, but got " + $pointwiseFilter.shape[1] + ".")); + var inChannels = $depthwiseFilter.shape[2]; + var channelMultiplier = $depthwiseFilter.shape[3]; + assert($pointwiseFilter.shape[2] === inChannels * channelMultiplier, "Error in separableConv2d: the third dimension of pointwise filter " + + ("must be " + inChannels * channelMultiplier + ", ") + + ("but got " + $pointwiseFilter.shape[2] + ".")); + var depthwise = depthwiseConv2d(x4D, $depthwiseFilter, strides, pad, dataFormat, dilation); + var pointwiseStride = 1; + var res = conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + function parseTupleParam$1(param) { + return typeof param === 'number' ? [param, param] : param; + } + function tupleValuesAreOne(param) { + var _a = parseTupleParam$1(param), dimA = _a[0], dimB = _a[1]; + return dimA === 1 && dimB === 1; + } + function eitherStridesOrDilationsAreOne(strides, dilations) { + return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations); + } + function depthwiseConv2dDerInput(xShape, dy, filter, convInfo) { + var dy4D = dy; + var reshapedTo4D = false; + if (dy.rank === 3) { + reshapedTo4D = true; + dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]); + } + var res = ENV.engine.runKernel(function (backend) { return backend.depthwiseConv2DDerInput(dy4D, filter, convInfo); }, { dy4D: dy4D }); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + function depthwiseConv2dDerFilter(x, dy, filterShape, convInfo) { + var x4D = x; + if (x.rank === 3) { + x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]); + } + var dy4D = dy; + if (dy4D.rank === 3) { + dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]); + } + return ENV.engine.runKernel(function (backend) { return backend.depthwiseConv2DDerFilter(x4D, dy4D, convInfo); }, { x4D: x4D, dy4D: dy4D }); + } + var conv1d = op({ conv1d_: conv1d_ }); + var conv2d = op({ conv2d_: conv2d_ }); + var depthwiseConv2d = op({ depthwiseConv2d_: depthwiseConv2d_ }); + var separableConv2d = op({ separableConv2d_: separableConv2d_ }); + var conv2dTranspose = op({ conv2dTranspose_: conv2dTranspose_ }); + + function matMul_(a, b, transposeA, transposeB) { + if (transposeA === void 0) { transposeA = false; } + if (transposeB === void 0) { transposeB = false; } + var $a = convertToTensor(a, 'a', 'matMul'); + var $b = convertToTensor(b, 'b', 'matMul'); + var innerShapeA = transposeA ? $a.shape[0] : $a.shape[1]; + var innerShapeB = transposeB ? $b.shape[1] : $b.shape[0]; + assert($a.rank === 2 && $b.rank === 2, "Error in matMul: inputs must be rank 2, got ranks " + $a.rank + + (" and " + $b.rank + ".")); + assert(innerShapeA === innerShapeB, "Error in matMul: inner shapes (" + innerShapeA + ") and (" + + (innerShapeB + ") of Tensors with shapes " + $a.shape + " and ") + + ($b.shape + " and transposeA=" + transposeA) + + (" and transposeB=" + transposeB + " must match.")); + var grad = function (dy) { + if (!transposeA && !transposeB) { + return { + $a: function () { return dy.matMul($b.toFloat(), false, true); }, + $b: function () { return $a.toFloat().matMul(dy, true, false); } + }; + } + else if (!transposeA && transposeB) { + return { + $a: function () { return dy.matMul($b.toFloat(), false, false); }, + $b: function () { return dy.matMul($a.toFloat(), true, false); } + }; + } + else if (transposeA && !transposeB) { + return { + $a: function () { return $b.toFloat().matMul(dy, false, true); }, + $b: function () { return $a.toFloat().matMul(dy, false, false); } + }; + } + else { + return { + $a: function () { return $b.toFloat().matMul(dy, true, true); }, + $b: function () { return dy.matMul($a.toFloat(), true, true); } + }; + } + }; + return ENV.engine.runKernel(function (backend) { return backend.matMul($a, $b, transposeA, transposeB); }, { $a: $a, $b: $b }, grad); + } + function outerProduct_(v1, v2) { + var $v1 = convertToTensor(v1, 'v1', 'outerProduct'); + var $v2 = convertToTensor(v2, 'v2', 'outerProduct'); + assert($v1.rank === 1 && $v2.rank === 1, "Error in outerProduct: inputs must be rank 1, but got ranks " + + ($v1.rank + " and " + $v2.rank + ".")); + return $v1.as2D(-1, 1).matMul($v2.as2D(1, -1)); + } + function dot_(t1, t2) { + var $t1 = convertToTensor(t1, 't1', 'dot'); + var $t2 = convertToTensor(t2, 't2', 'dot'); + assert(($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2), "Error in dot: inputs must all be rank 1 or 2, but got ranks " + + ($t1.rank + " and " + $t2.rank + ".")); + var t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]); + var t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]); + assert(t1Inner === t2Inner, "Error in dot: inner dimensions of inputs must match, but got " + + (t1Inner + " and " + t2Inner + ".")); + if ($t1.rank === 1 && $t2.rank === 1) { + return $t1.as2D(1, -1).matMul($t2.as2D(-1, 1)).asScalar(); + } + else if ($t1.rank === 1 && $t2.rank === 2) { + return $t1.as2D(1, -1).matMul($t2.as2D($t2.shape[0], $t2.shape[1])).as1D(); + } + else if ($t1.rank === 2 && $t2.rank === 1) { + return $t1.matMul($t2.as2D(-1, 1)).as1D(); + } + else { + return $t1.matMul($t2.as2D($t2.shape[0], $t2.shape[1])); + } + } + var matMul = op({ matMul_: matMul_ }); + var dot = op({ dot_: dot_ }); + var outerProduct = op({ outerProduct_: outerProduct_ }); + + function reverse1d_(x) { + var $x = convertToTensor(x, 'x', 'reverse'); + assert($x.rank === 1, "Error in reverse1D: x must be rank 1 but got\n rank " + $x.rank + "."); + return reverse($x, 0); + } + function reverse2d_(x, axis) { + var $x = convertToTensor(x, 'x', 'reverse'); + assert($x.rank === 2, "Error in reverse2D: x must be rank 2 but got\n rank " + $x.rank + "."); + return reverse($x, axis); + } + function reverse3d_(x, axis) { + var $x = convertToTensor(x, 'x', 'reverse'); + assert($x.rank === 3, "Error in reverse3D: x must be rank 3 but got\n rank " + $x.rank + "."); + return reverse($x, axis); + } + function reverse4d_(x, axis) { + var $x = convertToTensor(x, 'x', 'reverse'); + assert($x.rank === 4, "Error in reverse4D: x must be rank 4 but got\n rank " + $x.rank + "."); + return reverse($x, axis); + } + function reverse_(x, axis) { + var $x = convertToTensor(x, 'x', 'reverse'); + if ($x.rank === 0) { + return $x.clone(); + } + var axes = parseAxisParam(axis, $x.shape); + var grad = function (dy) { + return { $x: function () { return dy.reverse(axes); } }; + }; + var res = ENV.engine.runKernel(function (backend) { return backend.reverse($x, axes); }, { $x: $x }, grad); + return res.reshapeAs($x); + } + var reverse = op({ reverse_: reverse_ }); + var reverse1d = op({ reverse1d_: reverse1d_ }); + var reverse2d = op({ reverse2d_: reverse2d_ }); + var reverse3d = op({ reverse3d_: reverse3d_ }); + var reverse4d = op({ reverse4d_: reverse4d_ }); + + function maxPool_(x, filterSize, strides, pad, dimRoundingMode) { + var $x = convertToTensor(x, 'x', 'maxPool'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + assert(x4D.rank === 4, "Error in maxPool: input must be rank 4 but got rank " + x4D.rank + "."); + if (dimRoundingMode != null) { + assert(isInt(pad), "Error in maxPool: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var convInfo = computePool2DInfo(x4D.shape, filterSize, strides, pad, dimRoundingMode); + var grad = function (dy, saved) { + var y4D = saved[0]; + return { + x: function () { + return maxPoolBackprop(dy, x4D, y4D, filterSize, strides, pad); + } + }; + }; + var res = ENV.engine.runKernel(function (backend, save) { return save(backend.maxPool(x4D, convInfo)); }, { x: x4D }, grad); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + function avgPool_(x, filterSize, strides, pad, dimRoundingMode) { + var $x = convertToTensor(x, 'x', 'avgPool'); + assert($x.dtype === 'float32', 'The input dtype to avgPool must be float32'); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + assert(x4D.rank === 4, "Error in avgPool: x must be rank 4 but got rank " + x4D.rank + "."); + if (dimRoundingMode != null) { + assert(isInt(pad), "Error in avgPool: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var convInfo = computePool2DInfo(x4D.shape, filterSize, strides, pad); + var grad = function (dy) { + return { x: function () { return avgPoolBackprop(dy, x4D, filterSize, strides, pad); } }; + }; + var res = ENV.engine.runKernel(function (backend) { return backend.avgPool(x4D, convInfo); }, { x: x4D }, grad); + res = res.cast($x.dtype); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + function maxPoolBackprop(dy, input, output, filterSize, strides, pad, dimRoundingMode) { + var $dy = convertToTensor(dy, 'dy', 'maxPoolBackprop'); + var $input = convertToTensor(input, 'input', 'maxPoolBackprop'); + var $output = convertToTensor(output, 'output', 'maxPoolBackprop'); + assert($input.rank === $dy.rank, "Rank of input (" + $input.rank + ") does not match rank of dy (" + $dy.rank + ")"); + assert($dy.rank === 4, "Error in maxPoolBackprop: dy must be rank 4 but got rank " + + ($dy.rank + ".")); + assert($input.rank === 4, "Error in maxPoolBackprop: input must be rank 4 but got rank " + + ($input.rank + ".")); + if (dimRoundingMode != null) { + assert(isInt(pad), "Error in maxPoolBackprop: pad must be an integer when using, " + + ("dimRoundingMode " + dimRoundingMode + " but got pad " + pad + ".")); + } + var convInfo = computePool2DInfo($input.shape, filterSize, strides, pad, dimRoundingMode); + var res = ENV.engine.runKernel(function (backend) { return backend.maxPoolBackprop($dy, $input, $output, convInfo); }, { $dy: $dy, $input: $input }); + return res; + } + function avgPoolBackprop(dy, input, filterSize, strides, pad) { + var $dy = convertToTensor(dy, 'dy', 'avgPoolBackprop'); + var $input = convertToTensor(input, 'input', 'avgPoolBackprop'); + assert($input.rank === $dy.rank, "Rank of input (" + $input.rank + ") does not match rank of dy (" + $dy.rank + ")"); + var input4D = $input; + var dy4D = $dy; + var reshapedTo4D = false; + if ($input.rank === 3) { + reshapedTo4D = true; + input4D = $input.as4D(1, $input.shape[0], $input.shape[1], $input.shape[2]); + dy4D = $dy.as4D(1, $dy.shape[0], $dy.shape[1], $dy.shape[2]); + } + assert(dy4D.rank === 4, "Error in avgPoolBackprop: dy must be rank 4 but got rank " + + (dy4D.rank + ".")); + assert(input4D.rank === 4, "Error in avgPoolBackprop: input must be rank 4 but got rank " + + (input4D.rank + ".")); + var convInfo = computePool2DInfo(input4D.shape, filterSize, strides, pad); + var res = ENV.engine.runKernel(function (backend) { return backend.avgPoolBackprop(dy4D, input4D, convInfo); }, { dy4D: dy4D, input4D: input4D }); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + var maxPool = op({ maxPool_: maxPool_ }); + var avgPool = op({ avgPool_: avgPool_ }); + + function slice1d_(x, begin, size) { + var $x = convertToTensor(x, 'x', 'slice1d'); + assert($x.rank === 1, "slice1d expects a rank-1 tensor, but got a rank-" + $x.rank + " tensor"); + return slice($x, [begin], [size]); + } + function slice2d_(x, begin, size) { + var $x = convertToTensor(x, 'x', 'slice2d'); + assert($x.rank === 2, "slice1d expects a rank-2 tensor, but got a rank-" + $x.rank + " tensor"); + return slice($x, begin, size); + } + function slice3d_(x, begin, size) { + var $x = convertToTensor(x, 'x', 'slice3d'); + assert($x.rank === 3, "slice1d expects a rank-3 tensor, but got a rank-" + $x.rank + " tensor"); + return slice($x, begin, size); + } + function slice4d_(x, begin, size) { + var $x = convertToTensor(x, 'x', 'slice4d'); + assert($x.rank === 4, "slice1d expects a rank-4 tensor, but got a rank-" + $x.rank + " tensor"); + return slice($x, begin, size); + } + function slice_(x, begin, size) { + var $x = convertToTensor(x, 'x', 'slice'); + if ($x.rank === 0) { + throw new Error('Slicing scalar is not possible'); + } + var begin_; + if (typeof begin === 'number') { + begin_ = [begin].concat(new Array($x.rank - 1).fill(0)); + } + else if (begin.length < $x.rank) { + begin_ = begin.concat(new Array($x.rank - begin.length).fill(0)); + } + else { + begin_ = begin; + } + var size_; + if (size == null) { + size_ = new Array($x.rank).fill(-1); + } + else if (typeof size === 'number') { + size_ = [size].concat(new Array($x.rank - 1).fill(-1)); + } + else if (size.length < $x.rank) { + size_ = size.concat(new Array($x.rank - size.length).fill(-1)); + } + else { + size_ = size; + } + size_ = size_.map(function (d, i) { + if (d >= 0) { + return d; + } + else { + assert(d === -1, 'Bad value in size'); + return $x.shape[i] - begin_[i]; + } + }); + assertParamsValid($x, begin_, size_); + var inputShape = $x.shape; + var grad = function (dy) { + var paddings = []; + for (var i = 0; i < dy.rank; i++) { + paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]); + } + return { $x: function () { return dy.pad(paddings); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.slice($x, begin_, size_); }, { $x: $x }, grad); + } + var slice = op({ slice_: slice_ }); + var slice1d = op({ slice1d_: slice1d_ }); + var slice2d = op({ slice2d_: slice2d_ }); + var slice3d = op({ slice3d_: slice3d_ }); + var slice4d = op({ slice4d_: slice4d_ }); + + var tidy = Environment.tidy; + var keep = Environment.keep; + var dispose = Environment.dispose; + var time = Environment.time; + + function logSumExp_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = convertToTensor(x, 'x', 'logSumExp'); + var axes = parseAxisParam(axis, $x.shape); + var xMax = $x.max(axes, true); + var a = $x.sub(xMax); + var b = a.exp(); + var c = b.sum(axes); + var d = c.log(); + var res = xMax.reshape(d.shape).add(d); + if (keepDims) { + var newShape = expandShapeToKeepDim(res.shape, axes); + return res.reshape(newShape); + } + return res; + } + function sum_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = convertToTensor(x, 'x', 'sum'); + if ($x.dtype === 'bool') { + $x = $x.toInt(); + } + var axes = parseAxisParam(axis, $x.shape); + var customOp = customGrad(function (x) { + var permutation = getAxesPermutation(axes, x.rank); + var reductionAxes = axes; + var permutedX = x; + if (permutation != null) { + permutedX = x.transpose(permutation); + reductionAxes = getInnerMostAxes(reductionAxes.length, x.rank); + } + var value = ENV.engine.runKernel(function (backend) { return backend.sum(permutedX, reductionAxes); }, { permutedX: permutedX }); + if (keepDims) { + var newShape = expandShapeToKeepDim(value.shape, axes); + value = value.reshape(newShape); + } + var gradFunc = function (dy) { + var expandedDyShape = x.shape.slice(); + axes.forEach(function (axis) { + expandedDyShape[axis] = 1; + }); + var expandedDy = dy.reshape(expandedDyShape); + var derX = expandedDy.mul(ones$1(x.shape, 'float32')); + return derX; + }; + return { value: value, gradFunc: gradFunc }; + }); + return customOp($x); + } + function mean_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = convertToTensor(x, 'x', 'mean'); + var axes = parseAxisParam(axis, $x.shape); + var shapes = computeOutAndReduceShapes($x.shape, axes); + var reduceShape = shapes[1]; + var reduceSize = sizeFromShape(reduceShape); + var customOp = customGrad(function (x) { + var reduceSizeScalar = scalar(reduceSize); + var xReduce = reduceSizeScalar.dtype === x.dtype ? x : x.cast(reduceSizeScalar.dtype); + var res = xReduce.div(reduceSizeScalar); + var value = res.sum(axis, keepDims); + var gradFunc = function (dy) { + var expandedDyShape = x.shape.slice(); + axes.forEach(function (axis) { + expandedDyShape[axis] = 1; + }); + var expandedDy = dy.reshape(expandedDyShape); + var derX = expandedDy.mul(ones$1(x.shape, 'float32')).div(reduceSizeScalar); + return derX; + }; + return { value: value, gradFunc: gradFunc }; + }); + return customOp($x); + } + function min_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = convertToTensor(x, 'x', 'min'); + var origAxes = parseAxisParam(axis, $x.shape); + var axes = origAxes; + var permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + var res = ENV.engine.runKernel(function (backend) { return backend.min($x, axes); }, { $x: $x }); + if (keepDims) { + var newShape = expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; + } + function max_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = convertToTensor(x, 'x', 'max'); + var origAxes = parseAxisParam(axis, $x.shape); + var axes = origAxes; + var permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + var res = ENV.engine.runKernel(function (backend) { return backend.max($x, axes); }, { $x: $x }); + if (keepDims) { + var newShape = expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; + } + function argMin_(x, axis) { + if (axis === void 0) { axis = 0; } + var $x = convertToTensor(x, 'x', 'argMin'); + if (axis == null) { + axis = 0; + } + var axes = parseAxisParam(axis, $x.shape); + var permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + return ENV.engine.runKernel(function (backend) { return backend.argMin($x, axes[0]); }, { $x: $x }); + } + function argMax_(x, axis) { + if (axis === void 0) { axis = 0; } + var $x = convertToTensor(x, 'x', 'argMax'); + if (axis == null) { + axis = 0; + } + var axes = parseAxisParam(axis, $x.shape); + var permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + return ENV.engine.runKernel(function (backend) { return backend.argMax($x, axes[0]); }, { $x: $x }); + } + function all_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = convertToTensor(x, 'x', 'all', 'bool'); + assert($x.dtype === 'bool', "Error Tensor must be of type bool. Got: " + $x.dtype); + var origAxes = parseAxisParam(axis, $x.shape); + var axes = origAxes; + var permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + var res = ENV.engine.runKernel(function (backend) { return backend.all($x, axes); }, { $x: $x }); + if (keepDims) { + var newShape = expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; + } + function any_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + var $x = convertToTensor(x, 'x', 'any', 'bool'); + assert($x.dtype === 'bool', "Error Tensor must be of type bool. Got: " + $x.dtype); + var origAxes = parseAxisParam(axis, $x.shape); + var axes = origAxes; + var permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + var res = ENV.engine.runKernel(function (backend) { return backend.any($x, axes); }, { $x: $x }); + if (keepDims) { + var newShape = expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; + } + function moments_(x, axis, keepDims) { + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + x = convertToTensor(x, 'x', 'moments'); + var axes = parseAxisParam(axis, x.shape); + var mean = x.mean(axes, keepDims); + var keepDimsShape = mean.shape; + if (!keepDims) { + keepDimsShape = expandShapeToKeepDim(mean.shape, axes); + } + var devSquared = x.toFloat().sub(mean.reshape(keepDimsShape)).square(); + var variance = devSquared.mean(axes, keepDims); + return { mean: mean, variance: variance }; + } + var all = op({ all_: all_ }); + var any = op({ any_: any_ }); + var argMax = op({ argMax_: argMax_ }); + var argMin = op({ argMin_: argMin_ }); + var logSumExp = op({ logSumExp_: logSumExp_ }); + var max = op({ max_: max_ }); + var mean = op({ mean_: mean_ }); + var min = op({ min_: min_ }); + var moments = op({ moments_: moments_ }); + var sum = op({ sum_: sum_ }); + + function notEqual_(a, b) { + var $a = convertToTensor(a, 'a', 'notEqual'); + var $b = convertToTensor(b, 'b', 'notEqual'); + assertTypesMatch($a, $b); + assertAndGetBroadcastShape($a.shape, $b.shape); + return ENV.engine.runKernel(function (backend) { return backend.notEqual($a, $b); }, { $a: $a, $b: $b }); + } + function notEqualStrict_(a, b) { + var $a = convertToTensor(a, 'a', 'notEqualStrict'); + var $b = convertToTensor(b, 'b', 'notEqualStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in notEqualStrict: '); + return $a.notEqual($b); + } + function less_(a, b) { + var $a = convertToTensor(a, 'a', 'less'); + var $b = convertToTensor(b, 'b', 'less'); + assertTypesMatch($a, $b); + assertAndGetBroadcastShape($a.shape, $b.shape); + return ENV.engine.runKernel(function (backend) { return backend.less($a, $b); }, { $a: $a, $b: $b }); + } + function lessStrict_(a, b) { + var $a = convertToTensor(a, 'a', 'lessStrict'); + var $b = convertToTensor(b, 'b', 'lessStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in lessStrict: '); + return $a.less($b); + } + function equal_(a, b) { + var $a = convertToTensor(a, 'a', 'equal'); + var $b = convertToTensor(b, 'b', 'equal'); + assertTypesMatch($a, $b); + assertAndGetBroadcastShape($a.shape, $b.shape); + return ENV.engine.runKernel(function (backend) { return backend.equal($a, $b); }, { $a: $a, $b: $b }); + } + function equalStrict_(a, b) { + var $a = convertToTensor(a, 'a', 'equalStrict'); + var $b = convertToTensor(b, 'b', 'equalStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in equalStrict: '); + return $a.equal($b); + } + function lessEqual_(a, b) { + var $a = convertToTensor(a, 'a', 'lessEqual'); + var $b = convertToTensor(b, 'b', 'lessEqual'); + assertTypesMatch($a, $b); + assertAndGetBroadcastShape($a.shape, $b.shape); + return ENV.engine.runKernel(function (backend) { return backend.lessEqual($a, $b); }, { $a: $a, $b: $b }); + } + function lessEqualStrict_(a, b) { + var $a = convertToTensor(a, 'a', 'lessEqualStrict'); + var $b = convertToTensor(b, 'b', 'lessEqualStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in lessEqualStrict: '); + return $a.lessEqual($b); + } + function greater_(a, b) { + var $a = convertToTensor(a, 'a', 'greater'); + var $b = convertToTensor(b, 'b', 'greater'); + assertTypesMatch($a, $b); + assertAndGetBroadcastShape($a.shape, $b.shape); + return ENV.engine.runKernel(function (backend) { return backend.greater($a, $b); }, { $a: $a, $b: $b }); + } + function greaterStrict_(a, b) { + var $a = convertToTensor(a, 'a', 'greaterStrict'); + var $b = convertToTensor(b, 'b', 'greaterStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in greaterStrict: '); + return $a.greater($b); + } + function greaterEqual_(a, b) { + var $a = convertToTensor(a, 'a', 'greaterEqual'); + var $b = convertToTensor(b, 'b', 'greaterEqual'); + assertTypesMatch($a, $b); + assertAndGetBroadcastShape($a.shape, $b.shape); + return ENV.engine.runKernel(function (backend) { return backend.greaterEqual($a, $b); }, { $a: $a, $b: $b }); + } + function greaterEqualStrict_(a, b) { + var $a = convertToTensor(a, 'a', 'greaterEqualStrict'); + var $b = convertToTensor(b, 'b', 'greaterEqualStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in greaterEqualStrict: '); + return $a.greaterEqual($b); + } + var equal = op({ equal_: equal_ }); + var equalStrict = op({ equalStrict_: equalStrict_ }); + var greater = op({ greater_: greater_ }); + var greaterEqual = op({ greaterEqual_: greaterEqual_ }); + var greaterEqualStrict = op({ greaterEqualStrict_: greaterEqualStrict_ }); + var greaterStrict = op({ greaterStrict_: greaterStrict_ }); + var less = op({ less_: less_ }); + var lessEqual = op({ lessEqual_: lessEqual_ }); + var lessEqualStrict = op({ lessEqualStrict_: lessEqualStrict_ }); + var lessStrict = op({ lessStrict_: lessStrict_ }); + var notEqual = op({ notEqual_: notEqual_ }); + var notEqualStrict = op({ notEqualStrict_: notEqualStrict_ }); + + function add_(a, b) { + var $a = convertToTensor(a, 'a', 'add'); + var $b = convertToTensor(b, 'b', 'add'); + assertTypesMatch($a, $b); + var outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy; + var reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($a.shape); + }; + var derB = function () { + var res = dy; + var reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($b.shape); + }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(function (backend) { return backend.add($a, $b); }, { $a: $a, $b: $b }, der); + } + function addN_(tensors) { + assert(Array.isArray(tensors), function () { return 'The param passed to tf.addN() must be a list of tensors'; }); + assert(tensors.length >= 1, function () { return "Must pass at least one tensor to tf.addN(), but got " + + ("" + tensors.length); }); + var $tensors = tensors.map(function (t, i) { return convertToTensor(t, "tensors" + i, 'addN'); }); + var firstTensor = $tensors[0]; + $tensors.forEach(function (t) { + if (t.dtype !== firstTensor.dtype) { + throw new Error('All tensors passed to tf.addN() must have the same dtype'); + } + }); + $tensors.forEach(function (t) { + if (!arraysEqual(t.shape, firstTensor.shape)) { + throw new Error('All tensors passed to tf.addN() must have the same shape'); + } + }); + var der = function (dy) { + var ders = {}; + $tensors.forEach(function (t, i) { + ders[i] = function () { return dy.clone(); }; + }); + return ders; + }; + var inputs = $tensors; + return ENV.engine.runKernel(function (backend) { return backend.addN($tensors); }, inputs, der); + } + function addStrict_(a, b) { + assertShapesMatch(a.shape, b.shape, 'Error in addStrict: '); + return a.add(b); + } + function sub_(a, b) { + var $a = convertToTensor(a, 'a', 'sub'); + var $b = convertToTensor(b, 'b', 'sub'); + assertTypesMatch($a, $b); + var outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy; + var reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($a.shape); + }; + var derB = function () { + var res = dy; + var reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.neg().reshape($b.shape); + }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(function (backend) { return backend.subtract($a, $b); }, { $a: $a, $b: $b }, der); + } + function subStrict_(a, b) { + assertShapesMatch(a.shape, b.shape, 'Error in subStrict: '); + return a.sub(b); + } + function pow_(base, exp$$1) { + var $base = convertToTensor(base, 'base', 'pow'); + var $exp = convertToTensor(exp$$1, 'exp', 'pow'); + var outShape = assertAndGetBroadcastShape($base.shape, $exp.shape); + base = $base.cast(upcastType($base.dtype, $exp.dtype)); + exp$$1 = $exp.cast(upcastType($base.dtype, $exp.dtype)); + var grad = function (dy, saved) { + var y = saved[0]; + var derBase = function () { + var res = dy.mul($exp.toFloat().mul(y.div($base))); + var reduceAxes = getReductionAxes($base.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($base.shape); + }; + var derExp = function () { + var res = dy.mul(y.mul($base.log()).toFloat()); + var reduceAxes = getReductionAxes($exp.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($exp.shape); + }; + return { $base: derBase, $exp: derExp }; + }; + return ENV.engine.runKernel(function (backend, save) { return save(backend.pow($base, $exp)); }, { $base: $base, $exp: $exp }, grad); + } + function powStrict_(base, exp$$1) { + assertShapesMatch(base.shape, exp$$1.shape, 'Error in powStrict: '); + return base.pow(exp$$1); + } + function mul_(a, b) { + var $a = convertToTensor(a, 'a', 'mul'); + var $b = convertToTensor(b, 'b', 'mul'); + assertTypesMatch($a, $b); + var outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy.mul($b.toFloat()); + var reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + var derB = function () { + var res = dy.mul($a.toFloat()); + var reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($b.shape); + } + return res; + }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(function (backend) { return backend.multiply($a, $b); }, { $a: $a, $b: $b }, der); + } + function mulStrict_(a, b) { + assertShapesMatch(a.shape, b.shape, 'Error in multiplyStrict: '); + return a.mul(b); + } + function div_(a, b) { + var $a = convertToTensor(a, 'a', 'div'); + var $b = convertToTensor(b, 'b', 'div'); + assertTypesMatch($a, $b); + var forwardFunc; + if ($a.dtype === 'int32' && $b.dtype === 'int32') { + return floorDiv($a, $b); + } + else { + forwardFunc = function (backend) { return backend.realDivide($a, $b); }; + } + var outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy.div($b.toFloat()); + var reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + var derB = function () { + var res = dy.mul($a.toFloat()); + var reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes).reshape($b.shape); + } + var tmp = $b.square(); + return res.div(tmp.toFloat()).neg(); + }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(forwardFunc, { $a: $a, $b: $b }, der); + } + function floorDiv_(a, b) { + var $a = convertToTensor(a, 'a', 'floorDiv'); + var $b = convertToTensor(b, 'b', 'floorDiv'); + assertTypesMatch($a, $b); + var forwardFunc = function (backend) { return backend.floorDiv($a, $b); }; + var outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var res = dy.div($b.toFloat()); + var reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + var derB = function () { + var res = dy.mul($a.toFloat()); + var reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes).reshape($b.shape); + } + var tmp = $b.square(); + return res.div(tmp.toFloat()).neg(); + }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(forwardFunc, { $a: $a, $b: $b }, der); + } + function divStrict_(a, b) { + assertShapesMatch(a.shape, b.shape, 'Error in divideStrict: '); + return a.div(b); + } + function mod_(a, b) { + var $a = convertToTensor(a, 'a', 'mod'); + var $b = convertToTensor(b, 'b', 'mod'); + assertTypesMatch($a, $b); + var outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return dy.sum(reduceAxes).reshape($a.shape); + } + return dy; + }; + var derB = function () { + var res = dy.mul($a.div($b).floor().neg()); + var reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($b.shape); + } + return res; + }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(function (backend) { return backend.mod($a, $b); }, { $a: $a, $b: $b }, der); + } + function modStrict_(a, b) { + assertShapesMatch(a.shape, b.shape, 'Error in modStrict: '); + return a.mod(b); + } + function minimum_(a, b) { + var $a = convertToTensor(a, 'a', 'minimum'); + var $b = convertToTensor(b, 'b', 'minimum'); + assertTypesMatch($a, $b); + if ($a.dtype === 'bool') { + $a = $a.toInt(); + } + if ($b.dtype === 'bool') { + $b = $b.toInt(); + } + assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { return dy.mul($a.lessEqual($b).toFloat()); }; + var derB = function () { return dy.mul($a.greater($b).toFloat()); }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(function (backend) { return backend.minimum($a, $b); }, { $a: $a, $b: $b }, der); + } + function minimumStrict_(a, b) { + assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: '); + return a.minimum(b); + } + function maximum_(a, b) { + var $a = convertToTensor(a, 'a', 'maximum'); + var $b = convertToTensor(b, 'b', 'maximum'); + assertTypesMatch($a, $b); + if ($a.dtype === 'bool') { + $a = $a.toInt(); + } + if ($b.dtype === 'bool') { + $b = $b.toInt(); + } + assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { return dy.mul($a.greaterEqual($b).toFloat()); }; + var derB = function () { return dy.mul($a.less($b).toFloat()); }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(function (backend) { return backend.maximum($a, $b); }, { $a: $a, $b: $b }, der); + } + function maximumStrict_(a, b) { + assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: '); + return a.maximum(b); + } + function squaredDifference_(a, b) { + var $a = convertToTensor(a, 'a', 'squaredDifference'); + var $b = convertToTensor(b, 'b', 'squaredDifference'); + assertTypesMatch($a, $b); + assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var two = scalar(2); + var derA = function () { return dy.mul($a.sub($b).mul(two)); }; + var derB = function () { return dy.mul($b.sub($a).mul(two)); }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(function (backend) { return backend.squaredDifference($a, $b); }, { $a: $a, $b: $b }, der); + } + function squaredDifferenceStrict_(a, b) { + assertShapesMatch(a.shape, b.shape, 'Error in squaredDifferenceStrict: '); + return a.squaredDifference(b); + } + function atan2_(a, b) { + var $a = convertToTensor(a, 'a', 'atan2'); + var $b = convertToTensor(b, 'b', 'atan2'); + assertTypesMatch($a, $b); + var outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + var der = function (dy) { + var derA = function () { + var d = add($a.square(), $b.square()); + var res = dy.mul($b.div(d)); + var reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($a.shape); + }; + var derB = function () { + var d = add($a.square(), $b.square()); + var res = neg(dy.mul($a.div(d))); + var reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($b.shape); + }; + return { $a: derA, $b: derB }; + }; + return ENV.engine.runKernel(function (backend) { return backend.atan2($a, $b); }, { $a: $a, $b: $b }, der); + } + var add = op({ add_: add_ }); + var addN = op({ addN_: addN_ }); + var addStrict = op({ addStrict_: addStrict_ }); + var atan2 = op({ atan2_: atan2_ }); + var div = op({ div_: div_ }); + var divStrict = op({ divStrict_: divStrict_ }); + var floorDiv = op({ floorDiv_: floorDiv_ }); + var maximum = op({ maximum_: maximum_ }); + var maximumStrict = op({ maximumStrict_: maximumStrict_ }); + var minimum = op({ minimum_: minimum_ }); + var minimumStrict = op({ minimumStrict_: minimumStrict_ }); + var mod = op({ mod_: mod_ }); + var modStrict = op({ modStrict_: modStrict_ }); + var mul = op({ mul_: mul_ }); + var mulStrict = op({ mulStrict_: mulStrict_ }); + var pow = op({ pow_: pow_ }); + var powStrict = op({ powStrict_: powStrict_ }); + var squaredDifference = op({ squaredDifference_: squaredDifference_ }); + var squaredDifferenceStrict = op({ squaredDifferenceStrict_: squaredDifferenceStrict_ }); + var sub = op({ sub_: sub_ }); + var subStrict = op({ subStrict_: subStrict_ }); + + function logicalNot_(x) { + var $x = convertToTensor(x, 'x', 'logicalNot', 'bool'); + assert($x.dtype === 'bool', 'Error Array must be of type bool.'); + return ENV.engine.runKernel(function (backend) { return backend.logicalNot($x); }, { $x: $x }); + } + function logicalAnd_(a, b) { + var $a = convertToTensor(a, 'a', 'logicalAnd', 'bool'); + var $b = convertToTensor(b, 'b', 'logicalAnd', 'bool'); + assert($a.dtype === 'bool' && $b.dtype === 'bool', 'Error Array must be of type bool.'); + assertAndGetBroadcastShape($a.shape, $b.shape); + return ENV.engine.runKernel(function (backend) { return backend.logicalAnd($a, $b); }, { $a: $a, $b: $b }); + } + function logicalOr_(a, b) { + var $a = convertToTensor(a, 'a', 'logicalOr', 'bool'); + var $b = convertToTensor(b, 'b', 'logicalOr', 'bool'); + assert($a.dtype === 'bool' && $b.dtype === 'bool', 'Error Array must be of type bool.'); + assertAndGetBroadcastShape($a.shape, $b.shape); + return ENV.engine.runKernel(function (backend) { return backend.logicalOr($a, $b); }, { $a: $a, $b: $b }); + } + function logicalXor_(a, b) { + var $a = convertToTensor(a, 'a', 'logicalXor', 'bool'); + var $b = convertToTensor(b, 'b', 'logicalXor', 'bool'); + assert($a.dtype === 'bool' && $b.dtype === 'bool', 'Error Array must be of type bool.'); + assertAndGetBroadcastShape($a.shape, $b.shape); + return logicalOr(a, b).logicalAnd(logicalAnd(a, b).logicalNot()); + } + function where_(condition, a, b) { + var $a = convertToTensor(a, 'a', 'where'); + var $b = convertToTensor(b, 'b', 'where'); + var $condition = convertToTensor(condition, 'condition', 'where', 'bool'); + assert($condition.dtype === 'bool', 'Error Condition must be of type bool.'); + assertShapesMatch($a.shape, $b.shape, 'Error in where: '); + if ($condition.rank === 1) { + assert($condition.shape[0] === $a.shape[0], 'The first dimension of `a` must match the size of `condition`.'); + } + else { + assertShapesMatch($condition.shape, $b.shape, 'Error in where: '); + } + var grad = function (dy) { return ({ + $condition: function () { return zerosLike($condition); }, + $a: function () { return dy.mul($condition.cast($a.dtype)); }, + $b: function () { return dy.mul($condition.logicalNot().cast($b.dtype)); } + }); }; + return ENV.engine.runKernel(function (backend) { return backend.select($condition, $a, $b); }, { $condition: $condition, $a: $a, $b: $b }, grad); + } + function whereAsync_(condition) { + return __awaiter(this, void 0, void 0, function () { + var $condition, vals, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + $condition = convertToTensor(condition, 'condition', 'where', 'bool'); + assert($condition.dtype === 'bool', 'Condition must be of type bool.'); + return [4, $condition.data()]; + case 1: + vals = _a.sent(); + res = whereImpl($condition.shape, vals); + if (condition !== $condition) { + $condition.dispose(); + } + return [2, res]; + } + }); + }); + } + var logicalAnd = op({ logicalAnd_: logicalAnd_ }); + var logicalNot = op({ logicalNot_: logicalNot_ }); + var logicalOr = op({ logicalOr_: logicalOr_ }); + var logicalXor = op({ logicalXor_: logicalXor_ }); + var where = op({ where_: where_ }); + var whereAsync = whereAsync_; + + function relu_(x) { + var $x = convertToTensor(x, 'x', 'relu'); + if ($x.dtype === 'bool') { + return $x.toInt(); + } + var grad = function (dy) { + var stepRes = $x.step(); + return { $x: function () { return dy.mulStrict(stepRes.toFloat()); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.relu($x); }, { $x: $x }, grad); + } + function elu_(x) { + var $x = convertToTensor(x, 'x', 'elu'); + var grad = function (dy, saved) { + var y = saved[0]; + return { + $x: function () { + return ENV.engine.runKernel(function (backend) { return backend.eluDer(dy, y); }, { dy: dy, y: y }); + } + }; + }; + return ENV.engine.runKernel(function (backend, save) { return save(backend.elu($x)); }, { $x: $x }, grad); + } + function selu_(x) { + var $x = convertToTensor(x, 'x', 'selu'); + var grad = function (dy) { + return { + $x: function () { + var mask = $x.greater(scalar(0)); + var scaleAlpha = scalar(SELU_SCALEALPHA); + var scale = scalar(SELU_SCALE); + var greaterThanZeroDer = dy.mul(scale); + var lessEqualZeroDer = dy.mul(scaleAlpha).mul($x.toFloat().exp()); + return where(mask, greaterThanZeroDer, lessEqualZeroDer); + } + }; + }; + return ENV.engine.runKernel(function (backend) { return backend.selu($x); }, { $x: $x }, grad); + } + function leakyRelu_(x, alpha) { + if (alpha === void 0) { alpha = 0.2; } + var $x = convertToTensor(x, 'x', 'leakyRelu'); + return maximum(scalar(alpha).mul($x), $x); + } + function prelu_(x, alpha) { + var $x = convertToTensor(x, 'x', 'prelu'); + var $alpha = convertToTensor(alpha, 'alpha', 'prelu'); + var zero = scalar(0); + return maximum(zero, $x).add($alpha.mul(minimum(zero, $x))); + } + var elu = op({ elu_: elu_ }); + var leakyRelu = op({ leakyRelu_: leakyRelu_ }); + var prelu = op({ prelu_: prelu_ }); + var relu = op({ relu_: relu_ }); + var selu = op({ selu_: selu_ }); + + function transpose_(x, perm) { + var $x = convertToTensor(x, 'x', 'transpose'); + if (perm == null) { + perm = $x.shape.map(function (s, i) { return i; }).reverse(); + } + assert($x.rank === perm.length, "Error in transpose: rank of input " + $x.rank + " " + + ("must match length of perm " + perm + ".")); + perm.forEach(function (axis) { + assert(axis >= 0 && axis < $x.rank, "All entries in 'perm' must be between 0 and " + ($x.rank - 1) + + (" but got " + perm)); + }); + if ($x.rank <= 1) { + return $x.clone(); + } + var der = function (dy) { + var undoPerm = getUndoAxesPermutation(perm); + return { $x: function () { return dy.transpose(undoPerm); } }; + }; + return ENV.engine.runKernel(function (backend) { return backend.transpose($x, perm); }, { $x: $x }, der); + } + var transpose = op({ transpose_: transpose_ }); + + function localResponseNormalization_(x, depthRadius, bias, alpha, beta) { + if (depthRadius === void 0) { depthRadius = 5; } + if (bias === void 0) { bias = 1; } + if (alpha === void 0) { alpha = 1; } + if (beta === void 0) { beta = 0.5; } + var $x = convertToTensor(x, 'x', 'localResponseNormalization'); + assert($x.rank === 4 || $x.rank === 3, "Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank " + $x.rank + "."); + assert(isInt(depthRadius), "Error in localResponseNormalization: depthRadius must be an integer\n but got depthRadius " + depthRadius + "."); + var x4D = $x; + var reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]); + } + var backward = function (dy, saved) { + var outputImage = saved[0]; + return { + x4D: function () { return ENV.engine.runKernel(function (backend) { return backend.LRNGrad(dy, x4D, outputImage, depthRadius, bias, alpha, beta); }, {}); } + }; + }; + var res = ENV.engine.runKernel(function (backend, save) { return save(backend.localResponseNormalization4D(x4D, depthRadius, bias, alpha, beta)); }, { x4D: x4D }, backward); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + else { + return res; + } + } + var localResponseNormalization = op({ localResponseNormalization_: localResponseNormalization_ }); + + function norm_(x, ord, axis, keepDims) { + if (ord === void 0) { ord = 'euclidean'; } + if (axis === void 0) { axis = null; } + if (keepDims === void 0) { keepDims = false; } + x = convertToTensor(x, 'x', 'norm'); + var norm = normImpl(x, ord, axis); + var keepDimsShape = norm.shape; + if (keepDims) { + var axes = parseAxisParam(axis, x.shape); + keepDimsShape = expandShapeToKeepDim(norm.shape, axes); + } + return norm.reshape(keepDimsShape); + } + function normImpl(x, p, axis) { + if (axis === void 0) { axis = null; } + if (x.rank === 0) { + return x.abs(); + } + if (x.rank !== 1 && axis === null) { + return normImpl(x.reshape([-1]), p, axis); + } + if (x.rank === 1 || typeof axis === 'number' || + axis instanceof Array && axis.length === 1) { + if (p === 1) { + return x.abs().sum(axis); + } + if (p === Infinity) { + return x.abs().max(axis); + } + if (p === -Infinity) { + return x.abs().min(axis); + } + if (p === 'euclidean' || p === 2) { + return x.abs().pow(scalar(2, 'int32')).sum(axis).sqrt(); + } + throw new Error("Error in norm: invalid ord value: " + p); + } + if (axis instanceof Array && axis.length === 2) { + if (p === 1) { + return x.abs().sum(axis[0]).max(axis[1] - 1); + } + if (p === Infinity) { + return x.abs().sum(axis[1]).max(axis[0]); + } + if (p === -Infinity) { + return x.abs().sum(axis[1]).min(axis[0]); + } + if (p === 'fro' || p === 'euclidean') { + return x.square().sum(axis).sqrt(); + } + throw new Error("Error in norm: invalid ord value: " + p); + } + throw new Error("Error in norm: invalid axis: " + axis); + } + var norm = op({ norm_: norm_ }); + + function unsortedSegmentSum_(x, segmentIds, numSegments) { + var $x = convertToTensor(x, 'x', 'unsortedSegmentSum'); + var $segmentIds = convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32'); + assert($segmentIds.dtype === 'int32', 'segmentIds must be of dtype `int32`'); + assert(isInt(numSegments), 'numSegments must be of dtype int'); + var gradFunc = function (dy) { + var derX = function () { + return gatherDropNegatives(dy, $segmentIds); + }; + return { $x: derX }; + }; + return ENV.engine.runKernel(function (backend) { + return backend.unsortedSegmentSum($x, $segmentIds, numSegments); + }, { $x: $x }, gradFunc); + } + function gather_(x, indices, axis) { + if (axis === void 0) { axis = 0; } + var $x = convertToTensor(x, 'x', 'gather'); + var $indices = convertToTensor(indices, 'indices', 'gather', 'int32'); + assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`'); + axis = parseAxisParam(axis, $x.shape)[0]; + var grad = function (dy) { + var derX = function () { + if (axis === 0) { + return unsortedSegmentSum(dy, $indices, $x.shape[axis]); + } + var paramsShape = $x.shape; + var indicesSize = $indices.size; + var outerShape = paramsShape.slice(0, axis); + var outerDims = outerShape.length; + var innerShape = paramsShape.slice(axis, paramsShape.length).slice(1); + var innerDims = innerShape.length; + var outerAxesIndices = arrayRange(0, outerDims); + var innerAxesIndices = arrayRange(outerDims + 1, outerDims + 1 + innerDims); + var valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]); + var values = dy.reshape(valuesShape); + var reshapedIndices = $indices.reshape([indicesSize]); + var transposeDims = arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]); + var valuesTranspose = values.transpose(transposeDims); + var paramsGrad = unsortedSegmentSum(valuesTranspose, reshapedIndices, $x.shape[axis]); + var invertTransposeDims = getUndoAxesPermutation(transposeDims); + paramsGrad = paramsGrad.transpose(invertTransposeDims); + return paramsGrad; + }; + return { $x: derX }; + }; + return ENV.engine.runKernel(function (backend) { return backend.gather($x, $indices, axis); }, { $x: $x }, grad); + } + function arrayRange(start, stop) { + var result = []; + for (var i = start; i < stop; ++i) { + result.push(i); + } + return result; + } + function arrayConcat(arrays) { + var result = []; + for (var i = 0; i < arrays.length; ++i) { + for (var j = 0; j < arrays[i].length; ++j) { + result.push(arrays[i][j]); + } + } + return result; + } + function gatherDropNegatives(x, indices) { + var zeroClippedIndices = maximum(indices, zerosLike(indices)); + var gathered = gather(x, zeroClippedIndices); + var isPositive = greaterEqual(indices, scalar(0, 'int32')); + var numIters = gathered.rank - isPositive.rank; + for (var i = 0; i < numIters; ++i) { + isPositive = expandDims(isPositive, i + 1); + } + isPositive = logicalAnd(isPositive, ones$1(gathered.shape, 'bool')); + var zeroSlice = zerosLike(gathered); + return where(isPositive, gathered, zeroSlice); + } + var gather = op({ gather_: gather_ }); + var unsortedSegmentSum = op({ unsortedSegmentSum_: unsortedSegmentSum_ }); + + function multiRNNCell_(lstmCells, data, c, h) { + var $data = convertToTensor(data, 'data', 'multiRNNCell'); + var $c = convertToTensorArray(c, 'c', 'multiRNNCell'); + var $h = convertToTensorArray(h, 'h', 'multiRNNCell'); + var input = $data; + var newStates = []; + for (var i = 0; i < lstmCells.length; i++) { + var output = lstmCells[i](input, $c[i], $h[i]); + newStates.push(output[0]); + newStates.push(output[1]); + input = output[1]; + } + var newC = []; + var newH = []; + for (var i = 0; i < newStates.length; i += 2) { + newC.push(newStates[i]); + newH.push(newStates[i + 1]); + } + return [newC, newH]; + } + function basicLSTMCell_(forgetBias, lstmKernel, lstmBias, data, c, h) { + var $forgetBias = convertToTensor(forgetBias, 'forgetBias', 'basicLSTMCell'); + var $lstmKernel = convertToTensor(lstmKernel, 'lstmKernel', 'basicLSTMCell'); + var $lstmBias = convertToTensor(lstmBias, 'lstmBias', 'basicLSTMCell'); + var $data = convertToTensor(data, 'data', 'basicLSTMCell'); + var $c = convertToTensor(c, 'c', 'basicLSTMCell'); + var $h = convertToTensor(h, 'h', 'basicLSTMCell'); + var combined = $data.concat($h, 1); + var weighted = combined.matMul($lstmKernel); + var res = weighted.add($lstmBias); + var batchSize = res.shape[0]; + var sliceCols = res.shape[1] / 4; + var sliceSize = [batchSize, sliceCols]; + var i = res.slice([0, 0], sliceSize); + var j = res.slice([0, sliceCols], sliceSize); + var f = res.slice([0, sliceCols * 2], sliceSize); + var o = res.slice([0, sliceCols * 3], sliceSize); + var newC = i.sigmoid().mulStrict(j.tanh()).addStrict($c.mulStrict($forgetBias.add(f).sigmoid())); + var newH = newC.tanh().mulStrict(o.sigmoid()); + return [newC, newH]; + } + var basicLSTMCell = op({ basicLSTMCell_: basicLSTMCell_ }); + var multiRNNCell = op({ multiRNNCell_: multiRNNCell_ }); + + function movingAverage_(v, x, decay, step, zeroDebias) { + if (zeroDebias === void 0) { zeroDebias = true; } + var $v = convertToTensor(v, 'v', 'movingAverage'); + var $x = convertToTensor(x, 'x', 'movingAverage'); + var $decay = convertToTensor(decay, 'decay', 'movingAverage'); + assertTypesMatch($v, $x); + assert(arraysEqual($v.shape, $x.shape), 'Shape mismatch in v and x'); + var one = scalar(1); + var oneMinusDecay = one.sub($decay); + var update = $x.sub($v).mul(oneMinusDecay); + if (zeroDebias) { + assert(step != null, 'When using zeroDebias: true, step is required.'); + var $step = convertToTensor(step, 'step', 'movingAverage'); + update = update.div(one.sub(pow($decay, $step))); + } + return $v.add(update); + } + var movingAverage = op({ movingAverage_: movingAverage_ }); + + function stridedSlice_(x, begin, end, strides, beginMask, endMask) { + if (beginMask === void 0) { beginMask = 0; } + if (endMask === void 0) { endMask = 0; } + var $x = convertToTensor(x, 'x', 'stridedSlice'); + return ENV.engine.runKernel(function (backend) { return backend.stridedSlice($x, begin, end, strides, beginMask, endMask); }, { $x: $x }); + } + var stridedSlice = op({ stridedSlice_: stridedSlice_ }); + + function topk_(x, k, sorted) { + if (k === void 0) { k = 1; } + if (sorted === void 0) { sorted = true; } + var $x = convertToTensor(x, 'x', 'topk'); + if ($x.rank === 0) { + throw new Error('topk() expects the input to be of rank 1 or higher'); + } + var lastDim = $x.shape[$x.shape.length - 1]; + if (k > lastDim) { + throw new Error("'k' passed to topk() must be <= the last dimension (" + lastDim + ") " + + ("but got " + k)); + } + var _a = ENV.engine.runKernel(function (b) { return b.topk($x, k, sorted); }, { $x: $x }), values = _a[0], indices = _a[1]; + return { values: values, indices: indices }; + } + var topk = op({ topk_: topk_ }); + + (function (Reduction) { + Reduction[Reduction["NONE"] = 0] = "NONE"; + Reduction[Reduction["MEAN"] = 1] = "MEAN"; + Reduction[Reduction["SUM"] = 2] = "SUM"; + Reduction[Reduction["SUM_BY_NONZERO_WEIGHTS"] = 3] = "SUM_BY_NONZERO_WEIGHTS"; + })(exports.Reduction || (exports.Reduction = {})); + function computeWeightedLoss_(losses, weights, reduction) { + if (reduction === void 0) { reduction = exports.Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $losses = convertToTensor(losses, 'losses', 'computeWeightedLoss'); + var $weights = null; + if (weights != null) { + $weights = convertToTensor(weights, 'weights', 'computeWeightedLoss'); + } + var weightedLoss = ($weights == null) ? $losses : $losses.mul($weights); + if (reduction === exports.Reduction.NONE) { + return weightedLoss; + } + if (reduction === exports.Reduction.SUM) { + return weightedLoss.sum(); + } + if (reduction === exports.Reduction.MEAN) { + if ($weights == null) { + return weightedLoss.mean(); + } + else { + var broadcastFactor = sizeFromShape($losses.shape) / sizeFromShape($weights.shape); + var result = weightedLoss.sum().div($weights.sum()); + return broadcastFactor > 1 ? result.div(scalar(broadcastFactor)) : + result; + } + } + if (reduction === exports.Reduction.SUM_BY_NONZERO_WEIGHTS) { + if ($weights == null) { + return weightedLoss.sum().div(scalar($losses.size)); + } + else { + var broadcastedWeights = $weights.mul(ones$1($losses.shape)); + var numNonZeros = broadcastedWeights.notEqual(scalar(0)).sum().toFloat(); + return weightedLoss.sum().div(numNonZeros); + } + } + throw Error("Unknown reduction: " + reduction); + } + function absoluteDifference_(labels, predictions, weights, reduction) { + if (reduction === void 0) { reduction = exports.Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = convertToTensor(labels, 'labels', 'absoluteDifference'); + var $predictions = convertToTensor(predictions, 'predictions', 'absoluteDifference'); + var $weights = null; + if (weights != null) { + $weights = convertToTensor(weights, 'weights', 'absoluteDifference'); + } + assertShapesMatch($labels.shape, $predictions.shape, 'Error in absoluteDifference: '); + var losses = $labels.sub($predictions).abs(); + return computeWeightedLoss(losses, $weights, reduction); + } + function meanSquaredError_(labels, predictions, weights, reduction) { + if (reduction === void 0) { reduction = exports.Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = convertToTensor(labels, 'labels', 'meanSquaredError'); + var $predictions = convertToTensor(predictions, 'predictions', 'meanSquaredError'); + var $weights = null; + if (weights != null) { + $weights = convertToTensor(weights, 'weights', 'meanSquaredError'); + } + assertShapesMatch($labels.shape, $predictions.shape, 'Error in meanSquaredError: '); + var losses = $labels.squaredDifference($predictions); + return computeWeightedLoss(losses, $weights, reduction); + } + function cosineDistance_(labels, predictions, axis, weights, reduction) { + if (reduction === void 0) { reduction = exports.Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = convertToTensor(labels, 'labels', 'cosineDistance'); + var $predictions = convertToTensor(predictions, 'predictions', 'cosineDistance'); + var $weights = null; + if (weights != null) { + $weights = convertToTensor(weights, 'weights', 'cosineDistance'); + } + assertShapesMatch($labels.shape, $predictions.shape, 'Error in cosineDistance: '); + var one = scalar(1); + var losses = one.sub($labels.mul($predictions).sum(axis, true)); + return computeWeightedLoss(losses, $weights, reduction); + } + function hingeLoss_(labels, predictions, weights, reduction) { + if (reduction === void 0) { reduction = exports.Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = convertToTensor(labels, 'labels', 'hingeLoss'); + var $predictions = convertToTensor(predictions, 'predictions', 'hingeLoss'); + var $weights = null; + if (weights != null) { + $weights = convertToTensor(weights, 'weights', 'hingeLoss'); + } + assertShapesMatch($labels.shape, $predictions.shape, 'Error in hingeLoss: '); + var one = scalar(1); + $labels = scalar(2).mul($labels).sub(one); + var losses = one.sub($labels.mul($predictions)).relu(); + return computeWeightedLoss(losses, $weights, reduction); + } + function logLoss_(labels, predictions, weights, epsilon, reduction) { + if (epsilon === void 0) { epsilon = 1e-7; } + if (reduction === void 0) { reduction = exports.Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = convertToTensor(labels, 'labels', 'logLoss'); + var $predictions = convertToTensor(predictions, 'predictions', 'logLoss'); + var $weights = null; + if (weights != null) { + $weights = convertToTensor(weights, 'weights', 'logLoss'); + } + assertShapesMatch($labels.shape, $predictions.shape, 'Error in logLoss: '); + var one = scalar(1); + var epsilonScalar = scalar(epsilon); + var losses = $labels.mul($predictions.add(epsilonScalar).log()) + .neg() + .sub(one.sub($labels).mul(one.sub($predictions).add(epsilonScalar).log())); + return computeWeightedLoss(losses, $weights, reduction); + } + function sigmoidCrossEntropyWithLogits_(labels, logits) { + var $labels = convertToTensor(labels, 'labels', 'sigmoidCrossEntropyWithLogits'); + var $logits = convertToTensor(logits, 'logits', 'sigmoidCrossEntropyWithLogits'); + assertShapesMatch($labels.shape, $logits.shape, 'Error in sigmoidCrossEntropyWithLogits: '); + var maxOutput = $logits.relu(); + var outputXTarget = $logits.mul($labels); + var sigmoidOutput = $logits.abs().neg().exp().log1p(); + return maxOutput.sub(outputXTarget).add(sigmoidOutput); + } + function sigmoidCrossEntropy_(multiClassLabels, logits, weights, labelSmoothing, reduction) { + if (labelSmoothing === void 0) { labelSmoothing = 0; } + if (reduction === void 0) { reduction = exports.Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $multiClassLabels = convertToTensor(multiClassLabels, 'multiClassLabels', 'sigmoidCrossEntropy'); + var $logits = convertToTensor(logits, 'logits', 'sigmoidCrossEntropy'); + var $weights = null; + if (weights != null) { + $weights = convertToTensor(weights, 'weights', 'sigmoidCrossEntropy'); + } + assertShapesMatch($multiClassLabels.shape, $logits.shape, 'Error in sigmoidCrossEntropy: '); + if (labelSmoothing > 0) { + var labelSmoothingScalar = scalar(labelSmoothing); + var one = scalar(1); + var half = scalar(0.5); + $multiClassLabels = $multiClassLabels.mul(one.sub(labelSmoothingScalar)) + .add(half.mul(labelSmoothingScalar)); + } + var losses = sigmoidCrossEntropyWithLogits_($multiClassLabels, $logits); + return computeWeightedLoss(losses, $weights, reduction); + } + function huberLoss_(labels, predictions, weights, delta, reduction) { + if (delta === void 0) { delta = 1.0; } + if (reduction === void 0) { reduction = exports.Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $labels = convertToTensor(labels, 'labels', 'huberLoss'); + var $predictions = convertToTensor(predictions, 'predictions', 'huberLoss'); + var $weights = null; + if (weights != null) { + $weights = convertToTensor(weights, 'weights', 'huberLoss'); + } + assertShapesMatch($labels.shape, $predictions.shape, 'Error in huberLoss: '); + var deltaScalar = scalar(delta); + var error = $predictions.sub($labels).abs(); + var quadratic = minimum(error, deltaScalar); + var linear = error.sub(quadratic); + var losses = scalar(0.5).mul(quadratic.square()).add(deltaScalar.mul(linear)); + return computeWeightedLoss(losses, $weights, reduction); + } + function softmaxCrossEntropyWithLogits_(labels, logits, dim) { + if (dim === void 0) { dim = -1; } + if (dim === -1) { + dim = logits.rank - 1; + } + if (dim !== logits.rank - 1) { + throw Error("Softmax cross entropy along a non-last dimension is not yet " + + ("supported. Labels / logits was rank " + logits.rank + " ") + + ("and dim was " + dim)); + } + var customOp = customGrad(function (labels, logits) { + var keepDims = true; + var lse = logits.logSumExp([dim], keepDims); + var logResult = logits.toFloat().sub(lse); + var costVector = logResult.mul(labels).neg(); + var value = costVector.sum([dim]); + var gradFunc = function (dy) { + var dyShape = expandShapeToKeepDim(dy.shape, [dim]); + return [ + dy.reshape(dyShape).mul(labels.toFloat().sub(logResult.exp())), + dy.reshape(dyShape).mul(logResult.exp().sub(labels.toFloat())), + ]; + }; + return { value: value, gradFunc: gradFunc }; + }); + return customOp(labels, logits); + } + function softmaxCrossEntropy_(onehotLabels, logits, weights, labelSmoothing, reduction) { + if (labelSmoothing === void 0) { labelSmoothing = 0; } + if (reduction === void 0) { reduction = exports.Reduction.SUM_BY_NONZERO_WEIGHTS; } + var $onehotLabels = convertToTensor(onehotLabels, 'onehotLabels', 'softmaxCrossEntropy'); + var $logits = convertToTensor(logits, 'logits', 'softmaxCrossEntropy'); + var $weights = null; + if (weights != null) { + $weights = convertToTensor(weights, 'weights', 'softmaxCrossEntropy'); + } + assertShapesMatch($onehotLabels.shape, $logits.shape, 'Error in softmaxCrossEntropy: '); + if (labelSmoothing > 0) { + var labelSmoothingScalar = scalar(labelSmoothing); + var one = scalar(1); + var numClasses = scalar($onehotLabels.shape[1]); + $onehotLabels = $onehotLabels.mul(one.sub(labelSmoothingScalar)) + .add(labelSmoothingScalar.div(numClasses)); + } + var losses = softmaxCrossEntropyWithLogits_($onehotLabels, $logits); + return computeWeightedLoss(losses, $weights, reduction); + } + var absoluteDifference = op({ absoluteDifference_: absoluteDifference_ }); + var computeWeightedLoss = op({ computeWeightedLoss_: computeWeightedLoss_ }); + var cosineDistance = op({ cosineDistance_: cosineDistance_ }); + var hingeLoss = op({ hingeLoss_: hingeLoss_ }); + var huberLoss = op({ huberLoss_: huberLoss_ }); + var logLoss = op({ logLoss_: logLoss_ }); + var meanSquaredError = op({ meanSquaredError_: meanSquaredError_ }); + var sigmoidCrossEntropy = op({ sigmoidCrossEntropy_: sigmoidCrossEntropy_ }); + var softmaxCrossEntropy = op({ softmaxCrossEntropy_: softmaxCrossEntropy_ }); + + var loss_ops = /*#__PURE__*/Object.freeze({ + get Reduction () { return exports.Reduction; }, + absoluteDifference: absoluteDifference, + computeWeightedLoss: computeWeightedLoss, + cosineDistance: cosineDistance, + hingeLoss: hingeLoss, + huberLoss: huberLoss, + logLoss: logLoss, + meanSquaredError: meanSquaredError, + sigmoidCrossEntropy: sigmoidCrossEntropy, + softmaxCrossEntropy: softmaxCrossEntropy + }); + + function gramSchmidt_(xs) { + var inputIsTensor2D; + if (Array.isArray(xs)) { + inputIsTensor2D = false; + assert(xs != null && xs.length > 0, 'Gram-Schmidt process: input must not be null, undefined, or empty'); + var dim = xs[0].shape[0]; + for (var i = 1; i < xs.length; ++i) { + assert(xs[i].shape[0] === dim, 'Gram-Schmidt: Non-unique lengths found in the input vectors: ' + + ("(" + xs[i].shape[0] + " vs. " + dim + ")")); + } + } + else { + inputIsTensor2D = true; + xs = split(xs, xs.shape[0], 0).map(function (x) { return squeeze(x, [0]); }); + } + assert(xs.length <= xs[0].shape[0], "Gram-Schmidt: Number of vectors (" + xs.length + ") exceeds " + + ("number of dimensions (" + xs[0].shape[0] + ").")); + var ys = []; + var xs1d = xs; + var _loop_1 = function (i) { + ys.push(ENV.engine.tidy(function () { + var x = xs1d[i]; + if (i > 0) { + for (var j = 0; j < i; ++j) { + var proj = sum(ys[j].mulStrict(x)).mul(ys[j]); + x = x.sub(proj); + } + } + return x.div(norm(x, 'euclidean')); + })); + }; + for (var i = 0; i < xs.length; ++i) { + _loop_1(i); + } + if (inputIsTensor2D) { + return stack(ys, 0); + } + else { + return ys; + } + } + function qr_(x, fullMatrices) { + if (fullMatrices === void 0) { fullMatrices = false; } + if (x.rank < 2) { + throw new Error("qr() requires input tensor to have a rank >= 2, but got rank " + x.rank); + } + else if (x.rank === 2) { + return qr2d(x, fullMatrices); + } + else { + var outerDimsProd = x.shape.slice(0, x.shape.length - 2) + .reduce(function (value, prev) { return value * prev; }); + var x2ds = unstack(x.reshape([ + outerDimsProd, x.shape[x.shape.length - 2], + x.shape[x.shape.length - 1] + ]), 0); + var q2ds_1 = []; + var r2ds_1 = []; + x2ds.forEach(function (x2d) { + var _a = qr2d(x2d, fullMatrices), q2d = _a[0], r2d = _a[1]; + q2ds_1.push(q2d); + r2ds_1.push(r2d); + }); + var q = stack(q2ds_1, 0).reshape(x.shape); + var r = stack(r2ds_1, 0).reshape(x.shape); + return [q, r]; + } + } + function qr2d(x, fullMatrices) { + if (fullMatrices === void 0) { fullMatrices = false; } + return ENV.engine.tidy(function () { + if (x.shape.length !== 2) { + throw new Error("qr2d() requires a 2D Tensor, but got a " + x.shape.length + "D Tensor."); + } + var m = x.shape[0]; + var n = x.shape[1]; + var q = eye(m); + var r = x.clone(); + var one2D = tensor2d([[1]], [1, 1]); + var w = one2D.clone(); + var iters = m >= n ? n : m; + var _loop_2 = function (j) { + var _a; + var rTemp = r; + var wTemp = w; + var qTemp = q; + _a = ENV.engine.tidy(function () { + var rjEnd1 = r.slice([j, j], [m - j, 1]); + var normX = rjEnd1.norm(); + var rjj = r.slice([j, j], [1, 1]); + var s = rjj.sign().neg(); + var u1 = rjj.sub(s.mul(normX)); + var wPre = rjEnd1.div(u1); + if (wPre.shape[0] === 1) { + w = one2D.clone(); + } + else { + w = one2D.concat(wPre.slice([1, 0], [wPre.shape[0] - 1, wPre.shape[1]]), 0); + } + var tau = s.matMul(u1).div(normX).neg(); + var rjEndAll = r.slice([j, 0], [m - j, n]); + var tauTimesW = tau.mul(w); + if (j === 0) { + r = rjEndAll.sub(tauTimesW.matMul(w.transpose().matMul(rjEndAll))); + } + else { + r = r.slice([0, 0], [j, n]) + .concat(rjEndAll.sub(tauTimesW.matMul(w.transpose().matMul(rjEndAll))), 0); + } + var qAllJEnd = q.slice([0, j], [m, q.shape[1] - j]); + if (j === 0) { + q = qAllJEnd.sub(qAllJEnd.matMul(w).matMul(tauTimesW.transpose())); + } + else { + q = q.slice([0, 0], [m, j]) + .concat(qAllJEnd.sub(qAllJEnd.matMul(w).matMul(tauTimesW.transpose())), 1); + } + return [w, r, q]; + }), w = _a[0], r = _a[1], q = _a[2]; + dispose([rTemp, wTemp, qTemp]); + }; + for (var j = 0; j < iters; ++j) { + _loop_2(j); + } + if (!fullMatrices && m > n) { + q = q.slice([0, 0], [m, n]); + r = r.slice([0, 0], [n, n]); + } + return [q, r]; + }); + } + var gramSchmidt = op({ gramSchmidt_: gramSchmidt_ }); + var qr = op({ qr_: qr_ }); + + var linalg_ops = /*#__PURE__*/Object.freeze({ + gramSchmidt: gramSchmidt, + qr: qr + }); + + function resizeBilinear_(images, size, alignCorners) { + if (alignCorners === void 0) { alignCorners = false; } + var $images = convertToTensor(images, 'images', 'resizeBilinear'); + assert($images.rank === 3 || $images.rank === 4, "Error in resizeBilinear: x must be rank 3 or 4, but got " + + ("rank " + $images.rank + ".")); + assert(size.length === 2, "Error in resizeBilinear: new shape must 2D, but got shape " + + (size + ".")); + var batchImages = $images; + var reshapedTo4D = false; + if ($images.rank === 3) { + reshapedTo4D = true; + batchImages = + $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]); + } + var newHeight = size[0], newWidth = size[1]; + var forward = function (backend, save) { + return backend.resizeBilinear(batchImages, newHeight, newWidth, alignCorners); + }; + var backward = function (dy, saved) { + return { + batchImages: function () { return ENV.engine.runKernel(function (backend) { + return backend.resizeBilinearBackprop(dy, batchImages, alignCorners); + }, {}); } + }; + }; + var res = ENV.engine.runKernel(forward, { batchImages: batchImages }, backward); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + function resizeNearestNeighbor_(images, size, alignCorners) { + if (alignCorners === void 0) { alignCorners = false; } + var $images = convertToTensor(images, 'images', 'resizeNearestNeighbor'); + assert($images.rank === 3 || $images.rank === 4, "Error in resizeNearestNeighbor: x must be rank 3 or 4, but got " + + ("rank " + $images.rank + ".")); + assert(size.length === 2, "Error in resizeNearestNeighbor: new shape must 2D, but got shape " + + (size + ".")); + assert($images.dtype === 'float32' || $images.dtype === 'int32', '`images` must have `int32` or `float32` as dtype'); + var batchImages = $images; + var reshapedTo4D = false; + if ($images.rank === 3) { + reshapedTo4D = true; + batchImages = + $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]); + } + var newHeight = size[0], newWidth = size[1]; + var forward = function (backend, save) { + return backend.resizeNearestNeighbor(batchImages, newHeight, newWidth, alignCorners); + }; + var backward = function (dy, saved) { + return { + batchImages: function () { return ENV.engine.runKernel(function (backend) { return backend.resizeNearestNeighborBackprop(dy, batchImages, alignCorners); }, {}); } + }; + }; + var res = ENV.engine.runKernel(forward, { batchImages: batchImages }, backward); + if (reshapedTo4D) { + return res.as3D(res.shape[1], res.shape[2], res.shape[3]); + } + return res; + } + function nonMaxSuppression_(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + if (iouThreshold === void 0) { iouThreshold = 0.5; } + if (scoreThreshold === void 0) { scoreThreshold = Number.NEGATIVE_INFINITY; } + var $boxes = convertToTensor(boxes, 'boxes', 'nonMaxSuppression'); + var $scores = convertToTensor(scores, 'scores', 'nonMaxSuppression'); + var inputs = nonMaxSuppSanityCheck($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold); + maxOutputSize = inputs.maxOutputSize; + iouThreshold = inputs.iouThreshold; + scoreThreshold = inputs.scoreThreshold; + return ENV.engine.runKernel(function (b) { return b.nonMaxSuppression($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold); }, { $boxes: $boxes }); + } + function nonMaxSuppressionAsync_(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + if (iouThreshold === void 0) { iouThreshold = 0.5; } + if (scoreThreshold === void 0) { scoreThreshold = Number.NEGATIVE_INFINITY; } + return __awaiter(this, void 0, void 0, function () { + var $boxes, $scores, inputs, boxesVals, scoresVals, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + $boxes = convertToTensor(boxes, 'boxes', 'nonMaxSuppressionAsync'); + $scores = convertToTensor(scores, 'scores', 'nonMaxSuppressionAsync'); + inputs = nonMaxSuppSanityCheck($boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold); + maxOutputSize = inputs.maxOutputSize; + iouThreshold = inputs.iouThreshold; + scoreThreshold = inputs.scoreThreshold; + return [4, $boxes.data()]; + case 1: + boxesVals = _a.sent(); + return [4, $scores.data()]; + case 2: + scoresVals = _a.sent(); + res = nonMaxSuppressionImpl(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold); + if ($boxes !== boxes) { + $boxes.dispose(); + } + if ($scores !== scores) { + $scores.dispose(); + } + return [2, res]; + } + }); + }); + } + function nonMaxSuppSanityCheck(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + if (iouThreshold == null) { + iouThreshold = 0.5; + } + if (scoreThreshold == null) { + scoreThreshold = Number.NEGATIVE_INFINITY; + } + var numBoxes = boxes.shape[0]; + maxOutputSize = Math.min(maxOutputSize, numBoxes); + assert(0 <= iouThreshold && iouThreshold <= 1, "iouThreshold must be in [0, 1], but was '" + iouThreshold + "'"); + assert(boxes.rank === 2, "boxes must be a 2D tensor, but was of rank '" + boxes.rank + "'"); + assert(boxes.shape[1] === 4, "boxes must have 4 columns, but 2nd dimension was " + boxes.shape[1]); + assert(scores.rank === 1, 'scores must be a 1D tensor'); + assert(scores.shape[0] === numBoxes, "scores has incompatible shape with boxes. Expected " + numBoxes + ", " + + ("but was " + scores.shape[0])); + return { maxOutputSize: maxOutputSize, iouThreshold: iouThreshold, scoreThreshold: scoreThreshold }; + } + var resizeBilinear = op({ resizeBilinear_: resizeBilinear_ }); + var resizeNearestNeighbor = op({ resizeNearestNeighbor_: resizeNearestNeighbor_ }); + var nonMaxSuppression = op({ nonMaxSuppression_: nonMaxSuppression_ }); + var nonMaxSuppressionAsync = nonMaxSuppressionAsync_; + + var image_ops = /*#__PURE__*/Object.freeze({ + resizeBilinear: resizeBilinear, + resizeNearestNeighbor: resizeNearestNeighbor, + nonMaxSuppression: nonMaxSuppression, + nonMaxSuppressionAsync: nonMaxSuppressionAsync + }); + + + + var ops = /*#__PURE__*/Object.freeze({ + image: image_ops, + linalg: linalg_ops, + losses: loss_ops, + op: op, + batchNormalization2d: batchNormalization2d, + batchNormalization3d: batchNormalization3d, + batchNormalization4d: batchNormalization4d, + batchNormalization: batchNormalization, + concat: concat, + concat1d: concat1d, + concat2d: concat2d, + concat3d: concat3d, + concat4d: concat4d, + conv1d: conv1d, + conv2d: conv2d, + depthwiseConv2d: depthwiseConv2d, + separableConv2d: separableConv2d, + conv2dTranspose: conv2dTranspose, + matMul: matMul, + dot: dot, + outerProduct: outerProduct, + reverse: reverse, + reverse1d: reverse1d, + reverse2d: reverse2d, + reverse3d: reverse3d, + reverse4d: reverse4d, + maxPool: maxPool, + avgPool: avgPool, + slice: slice, + slice1d: slice1d, + slice2d: slice2d, + slice3d: slice3d, + slice4d: slice4d, + abs: abs, + acos: acos, + acosh: acosh, + asin: asin, + asinh: asinh, + atan: atan, + atanh: atanh, + ceil: ceil, + clipByValue: clipByValue, + cos: cos, + cosh: cosh, + erf: erf, + exp: exp, + expm1: expm1, + floor: floor, + log: log$1, + log1p: log1p, + logSigmoid: logSigmoid, + neg: neg, + reciprocal: reciprocal, + round: round, + rsqrt: rsqrt, + sigmoid: sigmoid, + sign: sign, + sin: sin, + sinh: sinh, + softplus: softplus, + sqrt: sqrt, + square: square, + step: step, + tan: tan, + tanh: tanh$1, + all: all, + any: any, + argMax: argMax, + argMin: argMin, + logSumExp: logSumExp, + max: max, + mean: mean, + min: min, + moments: moments, + sum: sum, + equal: equal, + equalStrict: equalStrict, + greater: greater, + greaterEqual: greaterEqual, + greaterEqualStrict: greaterEqualStrict, + greaterStrict: greaterStrict, + less: less, + lessEqual: lessEqual, + lessEqualStrict: lessEqualStrict, + lessStrict: lessStrict, + notEqual: notEqual, + notEqualStrict: notEqualStrict, + add: add, + addN: addN, + addStrict: addStrict, + atan2: atan2, + div: div, + divStrict: divStrict, + floorDiv: floorDiv, + maximum: maximum, + maximumStrict: maximumStrict, + minimum: minimum, + minimumStrict: minimumStrict, + mod: mod, + modStrict: modStrict, + mul: mul, + mulStrict: mulStrict, + pow: pow, + powStrict: powStrict, + squaredDifference: squaredDifference, + squaredDifferenceStrict: squaredDifferenceStrict, + sub: sub, + subStrict: subStrict, + elu: elu, + leakyRelu: leakyRelu, + prelu: prelu, + relu: relu, + selu: selu, + logicalAnd: logicalAnd, + logicalNot: logicalNot, + logicalOr: logicalOr, + logicalXor: logicalXor, + where: where, + whereAsync: whereAsync, + buffer: buffer, + toPixels: toPixels, + print: print, + cast: cast, + clone: clone, + cumsum: cumsum, + expandDims: expandDims, + eye: eye, + fromPixels: fromPixels, + multinomial: multinomial, + oneHot: oneHot, + pad: pad, + pad1d: pad1d, + pad2d: pad2d, + pad3d: pad3d, + pad4d: pad4d, + rand: rand, + randomNormal: randomNormal, + randomUniform: randomUniform, + reshape: reshape, + split: split, + squeeze: squeeze, + stack: stack, + tile: tile, + truncatedNormal: truncatedNormal, + unstack: unstack, + batchToSpaceND: batchToSpaceND, + spaceToBatchND: spaceToBatchND, + fill: fill, + linspace: linspace, + ones: ones$1, + range: range, + scalar: scalar, + tensor: tensor, + tensor1d: tensor1d, + tensor2d: tensor2d, + tensor3d: tensor3d, + tensor4d: tensor4d, + tensor5d: tensor5d, + tensor6d: tensor6d, + zeros: zeros, + onesLike: onesLike, + zerosLike: zerosLike, + transpose: transpose, + softmax: softmax, + localResponseNormalization: localResponseNormalization, + norm: norm, + gather: gather, + unsortedSegmentSum: unsortedSegmentSum, + basicLSTMCell: basicLSTMCell, + multiRNNCell: multiRNNCell, + movingAverage: movingAverage, + stridedSlice: stridedSlice, + topk: topk + }); + + var MathBackendCPU = (function () { + function MathBackendCPU() { + this.data = new WeakMap(); + this.firstUse = true; + if (ENV.get('IS_BROWSER')) { + this.canvas = document.createElement('canvas'); + } + } + MathBackendCPU.prototype.register = function (dataId, shape, dtype) { + if (this.firstUse) { + this.firstUse = false; + if (ENV.get('IS_NODE')) { + warn('\n============================\n' + + 'Hi there 👋. Looks like you are running TensorFlow.js in ' + + 'Node.js. To speed things up dramatically, install our node ' + + 'backend, which binds to TensorFlow C++, by running ' + + 'npm i @tensorflow/tfjs-node, ' + + 'or npm i @tensorflow/tfjs-node-gpu if you have CUDA. ' + + 'Then call require(\'@tensorflow/tfjs-node\'); (-gpu ' + + 'suffix for CUDA) at the start of your program. ' + + 'Visit https://github.com/tensorflow/tfjs-node for more details.' + + '\n============================\n'); + } + } + if (this.data.has(dataId)) { + throw new Error("Data buffer is already registered"); + } + this.data.set(dataId, null); + }; + MathBackendCPU.prototype.write = function (dataId, values) { + if (values == null) { + throw new Error('MathBackendCPU.write(): values can not be null'); + } + this.throwIfNoData(dataId); + this.data.set(dataId, values); + }; + MathBackendCPU.prototype.fromPixels = function (pixels, numChannels) { + if (pixels == null) { + throw new Error('pixels passed to tf.fromPixels() can not be null'); + } + var vals; + if (ENV.get('IS_NODE') && pixels.getContext == null) { + throw new Error('When running in node, pixels must be an HTMLCanvasElement ' + + 'like the one returned by the `canvas` npm package'); + } + if (pixels.getContext != null) { + vals = pixels + .getContext('2d') + .getImageData(0, 0, pixels.width, pixels.height) + .data; + } + else if (pixels instanceof ImageData) { + vals = pixels.data; + } + else if (pixels instanceof HTMLImageElement || + pixels instanceof HTMLVideoElement) { + if (this.canvas == null) { + throw new Error('Can\'t read pixels from HTMLImageElement outside ' + + 'the browser.'); + } + this.canvas.width = pixels.width; + this.canvas.height = pixels.height; + this.canvas.getContext('2d').drawImage(pixels, 0, 0, pixels.width, pixels.height); + vals = this.canvas.getContext('2d') + .getImageData(0, 0, pixels.width, pixels.height) + .data; + } + else { + throw new Error('pixels passed to tf.fromPixels() must be either an ' + + "HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or " + + ("ImageData, but was " + pixels.constructor.name)); + } + var values; + if (numChannels === 4) { + values = new Int32Array(vals); + } + else { + var numPixels = pixels.width * pixels.height; + values = new Int32Array(numPixels * numChannels); + for (var i = 0; i < numPixels; i++) { + for (var channel = 0; channel < numChannels; ++channel) { + values[i * numChannels + channel] = vals[i * 4 + channel]; + } + } + } + var outShape = [pixels.height, pixels.width, numChannels]; + return tensor3d(values, outShape, 'int32'); + }; + MathBackendCPU.prototype.read = function (dataId) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, this.readSync(dataId)]; + }); + }); + }; + MathBackendCPU.prototype.readSync = function (dataId) { + this.throwIfNoData(dataId); + return this.data.get(dataId); + }; + MathBackendCPU.prototype.disposeData = function (dataId) { + if (this.data.has(dataId)) { + this.data.delete(dataId); + } + }; + MathBackendCPU.prototype.time = function (f) { + return __awaiter(this, void 0, void 0, function () { + var start, kernelMs; + return __generator(this, function (_a) { + start = now(); + f(); + kernelMs = now() - start; + return [2, { kernelMs: kernelMs }]; + }); + }); + }; + MathBackendCPU.prototype.memory = function () { + return { + unreliable: true + }; + }; + MathBackendCPU.prototype.throwIfNoData = function (dataId) { + if (!this.data.has(dataId)) { + throw new Error("CPU backend: No data found for this tensor. " + + "Did you change your backend in the middle of the program? " + + "New backends can't use Tensors created with previous backends"); + } + }; + MathBackendCPU.prototype.slice = function (x, begin, size) { + var buffer$$1 = buffer(size, x.dtype); + for (var i = 0; i < buffer$$1.size; ++i) { + var loc = buffer$$1.indexToLoc(i); + var xLoc = loc.map(function (idx, j) { return idx + begin[j]; }); + buffer$$1.set.apply(buffer$$1, [x.get.apply(x, xLoc)].concat(loc)); + } + return buffer$$1.toTensor(); + }; + MathBackendCPU.prototype.stridedSlice = function (x, begin, end, strides, beginMask, endMask) { + var _a = getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask), beginIndex = _a[0], size = _a[1]; + if (size.some(function (axis) { return axis === 0; })) { + return tensor([], size); + } + var buffer$$1 = buffer(size, x.dtype); + for (var i = 0; i < buffer$$1.size; i++) { + var loc = buffer$$1.indexToLoc(i); + var newLoc = new Array(loc.length); + for (var j = 0; j < newLoc.length; j++) { + newLoc[j] = loc[j] * strides[j] + beginIndex[j]; + } + buffer$$1.set.apply(buffer$$1, [x.get.apply(x, newLoc)].concat(loc)); + } + return buffer$$1.toTensor(); + }; + MathBackendCPU.prototype.reverse = function (x, axis) { + var buffer$$1 = buffer(x.shape, x.dtype); + var xBuffer = x.buffer(); + var _loop_1 = function (i) { + var outLoc = buffer$$1.indexToLoc(i); + var inLoc = outLoc.slice(); + axis.forEach(function (ax) { return inLoc[ax] = x.shape[ax] - 1 - inLoc[ax]; }); + buffer$$1.set.apply(buffer$$1, [xBuffer.get.apply(xBuffer, inLoc)].concat(outLoc)); + }; + for (var i = 0; i < buffer$$1.size; i++) { + _loop_1(i); + } + return buffer$$1.toTensor(); + }; + MathBackendCPU.prototype.concat = function (a, b) { + var outShape = computeOutShape$1(a.shape, b.shape, 1); + var buffer$$1 = buffer(outShape, a.dtype); + if (a.shape[0] === 1 && b.shape[0] === 1) { + var aVals = a.dataSync(); + var bVals = b.dataSync(); + var vals = buffer$$1.values; + vals.set(aVals, 0); + vals.set(bVals, a.size); + return buffer$$1.toTensor(); + } + for (var i = 0; i < outShape[0]; ++i) { + for (var j = 0; j < a.shape[1]; ++j) { + buffer$$1.set(a.get(i, j), i, j); + } + for (var j = 0; j < b.shape[1]; ++j) { + buffer$$1.set(b.get(i, j), i, j + a.shape[1]); + } + } + return buffer$$1.toTensor(); + }; + MathBackendCPU.prototype.neg = function (x) { + return this.multiply(scalar(-1), x); + }; + MathBackendCPU.prototype.add = function (a, b) { + return this.broadcastedBinaryOp(a, b, upcastType(a.dtype, b.dtype), function (aValue, bValue) { return aValue + bValue; }); + }; + MathBackendCPU.prototype.addN = function (tensors) { + var vals = tensors.map(function (t) { return t.dataSync(); }); + var result = buffer(tensors[0].shape, tensors[0].dtype); + var resultVals = result.values; + for (var i = 0; i < tensors.length; i++) { + var currVals = vals[i]; + for (var j = 0; j < resultVals.length; j++) { + resultVals[j] += currVals[j]; + } + } + return result.toTensor(); + }; + MathBackendCPU.prototype.subtract = function (a, b) { + return this.broadcastedBinaryOp(a, b, upcastType(a.dtype, b.dtype), function (aValue, bValue) { return aValue - bValue; }); + }; + MathBackendCPU.prototype.pow = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aValue, bValue) { return Math.pow(aValue, bValue); }); + }; + MathBackendCPU.prototype.matMul = function (a, b, transposeA, transposeB) { + var sharedDim = transposeA ? a.shape[0] : a.shape[1]; + var leftDim = transposeA ? a.shape[1] : a.shape[0]; + var rightDim = transposeB ? b.shape[0] : b.shape[1]; + var aValues = a.dataSync(); + var bValues = b.dataSync(); + var _a = transposeA ? [1, a.strides[0]] : [a.strides[0], 1], aOuterStep = _a[0], aInnerStep = _a[1]; + var _b = transposeB ? [b.strides[0], 1] : [1, b.strides[0]], bOuterStep = _b[0], bInnerStep = _b[1]; + var aOuterEnd = leftDim * aOuterStep; + var bOuterEnd = rightDim * bOuterStep; + var result = new Float32Array(leftDim * rightDim); + var resultIndex = 0; + for (var aOuter = 0; aOuter < aOuterEnd; aOuter += aOuterStep) { + for (var bOuter = 0; bOuter < bOuterEnd; bOuter += bOuterStep) { + var aInner = aOuter; + var bInner = bOuter; + var sum$$1 = 0; + for (var k = 0; k < sharedDim; ++k) { + sum$$1 += aValues[aInner] * bValues[bInner]; + aInner += aInnerStep; + bInner += bInnerStep; + } + result[resultIndex++] = sum$$1; + } + } + return tensor2d(result, [leftDim, rightDim]); + }; + MathBackendCPU.prototype.multiply = function (a, b) { + return this.broadcastedBinaryOp(a, b, upcastType(a.dtype, b.dtype), function (aValue, bValue) { return aValue * bValue; }); + }; + MathBackendCPU.prototype.realDivide = function (a, b) { + var op$$1 = function (a, b) { return a / b; }; + var outputDtype = 'float32'; + return this.broadcastedBinaryOp(a, b, outputDtype, op$$1); + }; + MathBackendCPU.prototype.floorDiv = function (a, b) { + var op$$1 = function (a, b) { return Math.floor(a / b); }; + var outputDtype = 'int32'; + return this.broadcastedBinaryOp(a, b, outputDtype, op$$1); + }; + MathBackendCPU.prototype.sum = function (x, axes) { + assertAxesAreInnerMostDims('sum', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var resultDtype = upcastType(x.dtype, 'int32'); + var result = zeros(outShape, resultDtype); + var reduceSize = sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var sum$$1 = 0; + for (var j = 0; j < reduceSize; ++j) { + sum$$1 += aVals[offset + j]; + } + vals[i] = sum$$1; + } + return result; + }; + MathBackendCPU.prototype.unsortedSegmentSum = function (x, segmentIds, numSegments) { + var res = []; + var numIters = x.rank - segmentIds.rank; + for (var i = 0; i < numIters; ++i) { + segmentIds = segmentIds.expandDims(i + 1); + } + for (var i = 0; i < numSegments; ++i) { + var segmentId = scalar(i, 'int32'); + var mask = equal(segmentId, segmentIds).asType('float32'); + var sum$$1 = mask.mul(x).sum(0); + res.push(sum$$1); + } + return stack(res); + }; + MathBackendCPU.prototype.argMin = function (x, axis) { + var axes = [axis]; + assertAxesAreInnerMostDims('argMin', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = zeros(outShape, 'int32'); + var reduceSize = sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var min$$1 = aVals[offset]; + var minIndex = 0; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + if (value < min$$1) { + min$$1 = value; + minIndex = j; + } + } + vals[i] = minIndex; + } + return result; + }; + MathBackendCPU.prototype.argMax = function (x, axis) { + var axes = [axis]; + assertAxesAreInnerMostDims('argMax', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = zeros(outShape, 'int32'); + var reduceSize = sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var max$$1 = aVals[offset]; + var maxIndex = 0; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + if (value > max$$1) { + max$$1 = value; + maxIndex = j; + } + } + vals[i] = maxIndex; + } + return result; + }; + MathBackendCPU.prototype.cumsum = function (x, axis, exclusive, reverse$$1) { + if (axis !== x.rank - 1) { + throw new Error("backend.cumsum in CPU expects an inner-most axis=" + (x.rank - 1) + " " + + ("but got axis=" + axis)); + } + var resultDtype = upcastType(x.dtype, 'int32'); + var result = zeros(x.shape, resultDtype); + var vals = result.dataSync(); + var aVals = x.dataSync(); + var finalDim = x.shape[x.rank - 1]; + var indexAdjuster = reverse$$1 ? + function (i, j) { return i + finalDim - j - 1; } : + function (i, j) { return i + j; }; + for (var i = 0; i < aVals.length; i += finalDim) { + for (var j = 0; j < finalDim; j++) { + var idx = indexAdjuster(i, j); + if (j === 0) { + vals[idx] = exclusive ? 0 : aVals[idx]; + } + else { + var prevIdx = indexAdjuster(i, j - 1); + vals[idx] = exclusive ? aVals[prevIdx] + vals[prevIdx] : + aVals[idx] + vals[prevIdx]; + } + } + } + return result; + }; + MathBackendCPU.prototype.equal = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal === bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.notEqual = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal !== bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.less = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal < bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.lessEqual = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal <= bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.greater = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal > bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.greaterEqual = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return (aVal >= bVal) ? 1 : 0; + }); + }; + MathBackendCPU.prototype.logicalNot = function (x) { + var values = x.dataSync(); + var newValues = new Int32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = values[i] ? 0 : 1; + } + return Tensor.make(x.shape, { values: newValues }, 'bool'); + }; + MathBackendCPU.prototype.logicalAnd = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return aVal && bVal; + }); + }; + MathBackendCPU.prototype.logicalOr = function (a, b) { + return this.broadcastedBinaryOp(a, b, 'bool', function (aVal, bVal) { + return aVal || bVal; + }); + }; + MathBackendCPU.prototype.select = function (condition, a, b) { + var values = condition.dataSync(); + var aValues = a.dataSync(); + var bValues = b.dataSync(); + var result = zeros(a.shape, upcastType(a.dtype, b.dtype)); + var newValues = result.dataSync(); + var index = 0; + var offset = condition.rank === 0 || condition.rank > 1 || a.rank === 1 ? + 1 : + a.shape[1]; + for (var i = 0; i < values.length; i++) { + for (var j = 0; j < offset; j++) { + if (values[i] === 1) { + newValues[index++] = aValues[i]; + } + else { + newValues[index++] = bValues[i]; + } + } + } + return result; + }; + MathBackendCPU.prototype.where = function (condition) { + var condVals = condition.dataSync(); + return whereImpl(condition.shape, condVals); + }; + MathBackendCPU.prototype.topk = function (x, k, sorted) { + var xVals = x.dataSync(); + return topkImpl(xVals, x.shape, x.dtype, k, sorted); + }; + MathBackendCPU.prototype.min = function (x, axes) { + assertAxesAreInnerMostDims('min', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = zeros(outShape, x.dtype); + var reduceSize = sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var min$$1 = aVals[offset]; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + if (value < min$$1) { + min$$1 = value; + } + } + vals[i] = min$$1; + } + return result; + }; + MathBackendCPU.prototype.minimum = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aVal, bVal) { return Math.min(aVal, bVal); }); + }; + MathBackendCPU.prototype.mod = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aVal, bVal) { + var rem = aVal % bVal; + if ((aVal < 0 && bVal < 0) || (aVal >= 0 && bVal >= 0)) { + return rem; + } + else { + return (rem + bVal) % bVal; + } + }); + }; + MathBackendCPU.prototype.max = function (x, axes) { + assertAxesAreInnerMostDims('max', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = zeros(outShape, x.dtype); + var reduceSize = sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var max$$1 = aVals[offset]; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + if (value > max$$1) { + max$$1 = value; + } + } + vals[i] = max$$1; + } + return result; + }; + MathBackendCPU.prototype.maximum = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aVal, bVal) { return Math.max(aVal, bVal); }); + }; + MathBackendCPU.prototype.all = function (x, axes) { + assertAxesAreInnerMostDims('all', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = zeros(outShape, x.dtype); + var reduceSize = sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var all$$1 = aVals[offset]; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + all$$1 = all$$1 && value; + } + vals[i] = all$$1; + } + return result; + }; + MathBackendCPU.prototype.any = function (x, axes) { + assertAxesAreInnerMostDims('any', axes, x.rank); + var _a = computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var result = zeros(outShape, x.dtype); + var reduceSize = sizeFromShape(reduceShape); + var vals = result.dataSync(); + var aVals = x.dataSync(); + for (var i = 0; i < vals.length; ++i) { + var offset = i * reduceSize; + var anyVal = aVals[offset]; + for (var j = 0; j < reduceSize; ++j) { + var value = aVals[offset + j]; + anyVal = anyVal || value; + } + vals[i] = anyVal; + } + return result; + }; + MathBackendCPU.prototype.squaredDifference = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aVal, bVal) { + var diff = aVal - bVal; + return diff * diff; + }); + }; + MathBackendCPU.prototype.ceil = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = Math.ceil(values[i]); + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.floor = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = Math.floor(values[i]); + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.sign = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + if (values[i] < 0) { + newValues[i] = -1; + } + else if (values[i] > 0) { + newValues[i] = 1; + } + else { + newValues[i] = 0; + } + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.round = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var base = Math.floor(values[i]); + if (values[i] - base < 0.5) { + newValues[i] = Math.floor(values[i]); + } + else if (values[i] - base > 0.5) { + newValues[i] = Math.ceil(values[i]); + } + else { + if (base % 2.0 === 0.0) { + newValues[i] = base; + } + else { + newValues[i] = base + 1.0; + } + } + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.exp = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = Math.exp(values[i]); + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.expm1 = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = Math.expm1(values[i]); + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.log = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = Math.log(value); + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.log1p = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = Math.log1p(value); + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.sqrt = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = Math.sqrt(value); + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.rsqrt = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = 1 / Math.sqrt(value); + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.square = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + newValues[i] = value * value; + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.reciprocal = function (x) { + var values = x.dataSync(); + var newValues = new Float32Array(values.length); + for (var i = 0; i < values.length; ++i) { + newValues[i] = 1 / values[i]; + } + return Tensor.make(x.shape, { values: newValues }); + }; + MathBackendCPU.prototype.relu = function (x) { + var res = zeros(x.shape, x.dtype); + var resVals = res.dataSync(); + var inVals = x.dataSync(); + for (var i = 0; i < inVals.length; ++i) { + resVals[i] = Math.max(0, inVals[i]); + } + return res; + }; + MathBackendCPU.prototype.elu = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + var v = values[i]; + if (v >= 0) { + resultValues[i] = v; + } + else { + resultValues[i] = (Math.exp(v) - 1); + } + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.eluDer = function (dy, y) { + var resultValues = new Float32Array(y.size); + var values = y.dataSync(); + var dyValues = dy.dataSync(); + for (var i = 0; i < values.length; ++i) { + var v = values[i]; + if (v >= 1) { + resultValues[i] = dyValues[i]; + } + else { + resultValues[i] = dyValues[i] * (v + 1); + } + } + return Tensor.make(y.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.selu = function (x) { + var scaleAlpha = SELU_SCALEALPHA; + var scale = SELU_SCALE; + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + var v = values[i]; + if (v >= 0) { + resultValues[i] = scale * v; + } + else { + resultValues[i] = scaleAlpha * (Math.exp(v) - 1); + } + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.clip = function (x, min$$1, max$$1) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.min(max$$1, Math.max(min$$1, values[i])); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.abs = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.abs(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.int = function (x) { + var resultValues = new Int32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = values[i]; + } + return Tensor.make(x.shape, { values: resultValues }, 'int32'); + }; + MathBackendCPU.prototype.sigmoid = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = 1 / (1 + Math.exp(-values[i])); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.softplus = function (x) { + var epsilon = 1.1920928955078125e-7; + var threshold = Math.log(epsilon) + 2.0; + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + var tooLarge = values[i] > -threshold; + var tooSmall = values[i] < threshold; + var expX = Math.exp(values[i]); + var result = void 0; + if (tooSmall) { + result = expX; + } + else if (tooLarge) { + result = values[i]; + } + else { + result = Math.log(1.0 + expX); + } + resultValues[i] = result; + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.sin = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.sin(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.cos = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.cos(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.tan = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.tan(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.asin = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.asin(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.acos = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.acos(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.atan = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.atan(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.atan2 = function (a, b) { + return this.broadcastedBinaryOp(a, b, a.dtype, function (aValue, bValue) { return Math.atan2(aValue, bValue); }); + }; + MathBackendCPU.prototype.sinh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.sinh(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.cosh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.cosh(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.tanh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = tanh(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.asinh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.asinh(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.acosh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.acosh(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.atanh = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + resultValues[i] = Math.atanh(values[i]); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.erf = function (x) { + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + var p = ERF_P; + var a1 = ERF_A1; + var a2 = ERF_A2; + var a3 = ERF_A3; + var a4 = ERF_A4; + var a5 = ERF_A5; + for (var i = 0; i < values.length; ++i) { + var v = values[i]; + var t = 1.0 / (1.0 + p * v); + resultValues[i] = 1.0 - + (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * + Math.exp(-v * v); + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.step = function (x, alpha) { + if (alpha === void 0) { alpha = 0; } + var resultValues = new Float32Array(x.size); + var values = x.dataSync(); + for (var i = 0; i < values.length; ++i) { + var value = values[i]; + if (isNaN(value)) { + resultValues[i] = NaN; + } + else { + resultValues[i] = value > 0 ? 1 : alpha; + } + } + return Tensor.make(x.shape, { values: resultValues }); + }; + MathBackendCPU.prototype.conv2d = function (x, filter, convInfo) { + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var padLeft = convInfo.padInfo.left; + var padTop = convInfo.padInfo.top; + var y = buffer(convInfo.outShape, x.dtype); + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d2 = 0; d2 < convInfo.outChannels; ++d2) { + for (var yR = 0; yR < convInfo.outHeight; ++yR) { + var xRCorner = yR * convInfo.strideHeight - padLeft; + for (var yC = 0; yC < convInfo.outWidth; ++yC) { + var xCCorner = yC * convInfo.strideWidth - padTop; + var dotProd = 0; + for (var wR = 0; wR < filterHeight; wR++) { + var xR = xRCorner + wR * dilationHeight; + if (xR < 0 || xR >= convInfo.inHeight) { + continue; + } + for (var wC = 0; wC < filterWidth; wC++) { + var xC = xCCorner + wC * dilationWidth; + if (xC < 0 || xC >= convInfo.inWidth) { + continue; + } + for (var d1 = 0; d1 < convInfo.inChannels; ++d1) { + var pixel = x.get(b, xR, xC, d1); + var weight = filter.get(wR, wC, d1, d2); + dotProd += pixel * weight; + } + } + } + y.set(dotProd, b, yR, yC, d2); + } + } + } + } + return y.toTensor(); + }; + MathBackendCPU.prototype.conv2dDerInput = function (dy, filter, convInfo) { + var dx = buffer(convInfo.inShape, 'float32'); + var dxValues = dx.values; + var _a = dx.strides, dxS0 = _a[0], dxS1 = _a[1], dxS2 = _a[2]; + var dyValues = dy.dataSync(); + var _b = dy.strides, dyS0 = _b[0], dyS1 = _b[1], dyS2 = _b[2]; + var fltValues = filter.dataSync(); + var _c = filter.strides, fltS0 = _c[0], fltS1 = _c[1], fltS2 = _c[2]; + var batchSize = convInfo.batchSize, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth; + var topPad = filterHeight - 1 - convInfo.padInfo.top; + var leftPad = filterWidth - 1 - convInfo.padInfo.left; + for (var b = 0; b < batchSize; ++b) { + for (var d1 = 0; d1 < inChannels; ++d1) { + for (var xR = 0; xR < inHeight; ++xR) { + var xRCorner = xR - topPad; + var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight)); + var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight); + for (var xC = 0; xC < inWidth; ++xC) { + var xCCorner = xC - leftPad; + var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth)); + var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth); + var dotProd = 0; + for (var yR = xRMin; yR < yRMax; ++yR) { + var wR = yR * strideHeight - xRCorner; + for (var yC = xCMin; yC < yCMax; ++yC) { + var wC = yC * strideWidth - xCCorner; + var dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC; + var fltOffset = fltS0 * (filterHeight - 1 - wR) + + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1; + for (var d2 = 0; d2 < outChannels; ++d2) { + var pixel = dyValues[dyOffset + d2]; + var weight = fltValues[fltOffset + d2]; + dotProd += pixel * weight; + } + } + } + dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd; + } + } + } + } + return dx.toTensor(); + }; + MathBackendCPU.prototype.conv2dDerFilter = function (x, dy, convInfo) { + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var dW = buffer(convInfo.filterShape, 'float32'); + var leftPad = convInfo.padInfo.left; + var topPad = convInfo.padInfo.top; + for (var wR = 0; wR < filterHeight; ++wR) { + var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight)); + var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight); + for (var wC = 0; wC < filterWidth; ++wC) { + var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth)); + var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth); + for (var d1 = 0; d1 < convInfo.inChannels; ++d1) { + for (var d2 = 0; d2 < convInfo.outChannels; ++d2) { + var dotProd = 0; + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var yR = yRMin; yR < yRMax; ++yR) { + var xR = wR + yR * strideHeight - topPad; + for (var yC = yCMin; yC < yCMax; ++yC) { + var xC = wC + yC * strideWidth - leftPad; + dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2); + } + } + } + dW.set(dotProd, wR, wC, d1, d2); + } + } + } + } + return dW.toTensor(); + }; + MathBackendCPU.prototype.depthwiseConv2D = function (x, filter, convInfo) { + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var padLeft = convInfo.padInfo.left; + var padTop = convInfo.padInfo.top; + var chMul = convInfo.outChannels / convInfo.inChannels; + var y = buffer(convInfo.outShape, x.dtype); + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d1 = 0; d1 < convInfo.inChannels; ++d1) { + for (var yR = 0; yR < convInfo.outHeight; ++yR) { + var xRCorner = yR * convInfo.strideHeight - padLeft; + for (var yC = 0; yC < convInfo.outWidth; ++yC) { + var xCCorner = yC * convInfo.strideWidth - padTop; + for (var q = 0; q < chMul; ++q) { + var dotProd = 0; + for (var wR = 0; wR < filterHeight; ++wR) { + var xR = xRCorner + wR * dilationHeight; + if (xR < 0 || xR >= convInfo.inHeight) { + continue; + } + for (var wC = 0; wC < filterWidth; ++wC) { + var xC = xCCorner + wC * dilationWidth; + if (xC < 0 || xC >= convInfo.inWidth) { + continue; + } + var pixel = x.get(b, xR, xC, d1); + var weight = filter.get(wR, wC, d1, q); + dotProd += pixel * weight; + } + } + y.set(dotProd, b, yR, yC, d1 * chMul + q); + } + } + } + } + } + return y.toTensor(); + }; + MathBackendCPU.prototype.depthwiseConv2DDerInput = function (dy, filter, convInfo) { + var dx = buffer(convInfo.inShape, 'float32'); + var dxValues = dx.values; + var _a = dx.strides, dxS0 = _a[0], dxS1 = _a[1], dxS2 = _a[2]; + var dyValues = dy.dataSync(); + var _b = dy.strides, dyS0 = _b[0], dyS1 = _b[1], dyS2 = _b[2]; + var fltValues = filter.dataSync(); + var _c = filter.strides, fltS0 = _c[0], fltS1 = _c[1], fltS2 = _c[2]; + var batchSize = convInfo.batchSize, filterHeight = convInfo.filterHeight, filterWidth = convInfo.filterWidth, inChannels = convInfo.inChannels, inHeight = convInfo.inHeight, inWidth = convInfo.inWidth, outChannels = convInfo.outChannels, outHeight = convInfo.outHeight, outWidth = convInfo.outWidth, strideHeight = convInfo.strideHeight, strideWidth = convInfo.strideWidth; + var topPad = filterHeight - 1 - convInfo.padInfo.top; + var leftPad = filterWidth - 1 - convInfo.padInfo.left; + var chMul = outChannels / inChannels; + for (var b = 0; b < batchSize; ++b) { + for (var d1 = 0; d1 < inChannels; ++d1) { + for (var xR = 0; xR < inHeight; ++xR) { + var xRCorner = xR - topPad; + var xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight)); + var yRMax = Math.min(outHeight, (filterHeight + xRCorner) / strideHeight); + for (var xC = 0; xC < inWidth; ++xC) { + var xCCorner = xC - leftPad; + var xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth)); + var yCMax = Math.min(outWidth, (filterWidth + xCCorner) / strideWidth); + var dotProd = 0; + for (var yR = xRMin; yR < yRMax; ++yR) { + var wR = yR * strideHeight - xRCorner; + for (var yC = xCMin; yC < yCMax; ++yC) { + var wC = yC * strideWidth - xCCorner; + var dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC; + var fltOffset = fltS0 * (filterHeight - 1 - wR) + + fltS1 * (filterWidth - 1 - wC) + fltS2 * d1; + for (var dm = 0; dm < chMul; ++dm) { + var d2 = d1 * chMul + dm; + var pixel = dyValues[dyOffset + d2]; + var weight = fltValues[fltOffset + dm]; + dotProd += pixel * weight; + } + } + } + dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd; + } + } + } + } + return dx.toTensor(); + }; + MathBackendCPU.prototype.depthwiseConv2DDerFilter = function (x, dy, convInfo) { + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var dW = buffer(convInfo.filterShape, 'float32'); + var leftPad = convInfo.padInfo.left; + var topPad = convInfo.padInfo.top; + var chMul = convInfo.outChannels / convInfo.inChannels; + for (var wR = 0; wR < filterHeight; ++wR) { + var yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight)); + var yRMax = Math.min(convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight); + for (var wC = 0; wC < filterWidth; ++wC) { + var yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth)); + var yCMax = Math.min(convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth); + for (var d2 = 0; d2 < convInfo.outChannels; ++d2) { + var d1 = Math.trunc(d2 / chMul); + var dm = d2 % chMul; + var dotProd = 0; + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var yR = yRMin; yR < yRMax; ++yR) { + var xR = wR + yR * strideHeight - topPad; + for (var yC = yCMin; yC < yCMax; ++yC) { + var xC = wC + yC * strideWidth - leftPad; + dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2); + } + } + } + dW.set(dotProd, wR, wC, d1, dm); + } + } + } + return dW.toTensor(); + }; + MathBackendCPU.prototype.tile = function (x, reps) { + var newShape = new Array(x.rank); + for (var i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[i] * reps[i]; + } + var result = buffer(newShape, x.dtype); + var xBuf = x.buffer(); + for (var i = 0; i < result.values.length; ++i) { + var newLoc = result.indexToLoc(i); + var originalLoc = new Array(x.rank); + for (var i_1 = 0; i_1 < originalLoc.length; i_1++) { + originalLoc[i_1] = newLoc[i_1] % x.shape[i_1]; + } + var originalIndex = xBuf.locToIndex(originalLoc); + result.values[i] = xBuf.values[originalIndex]; + } + return result.toTensor(); + }; + MathBackendCPU.prototype.pad = function (x, paddings, constantValue) { + var outShape = paddings.map(function (p, i) { return p[0] + x.shape[i] + p[1]; }); + var start = paddings.map(function (p) { return p[0]; }); + var xBuffer = x.buffer(); + var buffer$$1 = buffer(outShape, x.dtype); + if (constantValue !== 0) { + buffer$$1.values.fill(constantValue); + } + for (var i = 0; i < x.size; i++) { + var coords = xBuffer.indexToLoc(i); + var outCoords = coords.map(function (c, i) { return c + start[i]; }); + buffer$$1.set.apply(buffer$$1, [x.get.apply(x, coords)].concat(outCoords)); + } + return buffer$$1.toTensor(); + }; + MathBackendCPU.prototype.transpose = function (x, perm) { + var newShape = new Array(x.rank); + for (var i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[perm[i]]; + } + var values = x.dataSync(); + var result = buffer(newShape, x.dtype); + var xBuf = x.buffer(); + for (var i = 0; i < x.size; ++i) { + var loc = xBuf.indexToLoc(i); + var newLoc = new Array(loc.length); + for (var i_2 = 0; i_2 < newLoc.length; i_2++) { + newLoc[i_2] = loc[perm[i_2]]; + } + var newIndex = result.locToIndex(newLoc); + result.values[newIndex] = values[i]; + } + return result.toTensor(); + }; + MathBackendCPU.prototype.gather = function (x, indices, axis) { + var newShape = x.shape.slice(); + var indicesValues = indices.dataSync(); + newShape[axis] = indicesValues.length; + var result = buffer(newShape, x.dtype); + var xBuf = x.buffer(); + for (var i = 0; i < result.size; ++i) { + var newLoc = result.indexToLoc(i); + var originalLoc = newLoc.slice(); + originalLoc[axis] = indicesValues[newLoc[axis]]; + var originalIndex = xBuf.locToIndex(originalLoc); + result.values[i] = xBuf.values[originalIndex]; + } + return result.toTensor(); + }; + MathBackendCPU.prototype.batchToSpaceND = function (x, blockShape, crops) { + var prod = blockShape.reduce(function (a, b) { return a * b; }); + var reshaped = getReshaped(x.shape, blockShape, prod); + var permuted = getPermuted(reshaped.length, blockShape.length); + var reshapedPermuted = getReshapedPermuted(x.shape, blockShape, prod); + var sliceBeginCoords = getSliceBeginCoords(crops, blockShape.length); + var sliceSize = getSliceSize(reshapedPermuted, crops, blockShape.length); + return x.reshape(reshaped) + .transpose(permuted) + .reshape(reshapedPermuted) + .slice(sliceBeginCoords, sliceSize); + }; + MathBackendCPU.prototype.spaceToBatchND = function (x, blockShape, paddings) { + var prod = blockShape.reduce(function (a, b) { return a * b; }); + var completePaddings = [[0, 0]]; + completePaddings.push.apply(completePaddings, paddings); + for (var i = 1 + blockShape.length; i < x.shape.length; ++i) { + completePaddings.push([0, 0]); + } + var paddedX = x.pad(completePaddings); + var reshapedPaddedShape = getReshaped(paddedX.shape, blockShape, prod, false); + var permutedReshapedPaddedPermutation = getPermuted(reshapedPaddedShape.length, blockShape.length, false); + var flattenShape = getReshapedPermuted(paddedX.shape, blockShape, prod, false); + return paddedX.reshape(reshapedPaddedShape) + .transpose(permutedReshapedPaddedPermutation) + .reshape(flattenShape); + }; + MathBackendCPU.prototype.pool = function (x, convInfo, poolType) { + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var y = buffer(convInfo.outShape, 'float32'); + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d = 0; d < convInfo.inChannels; ++d) { + for (var yR = 0; yR < convInfo.outHeight; ++yR) { + var xRCorner = yR * strideHeight - padTop; + var xRMin = Math.max(0, xRCorner); + var xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner); + for (var yC = 0; yC < convInfo.outWidth; ++yC) { + var xCCorner = yC * strideWidth - padLeft; + var xCMin = Math.max(0, xCCorner); + var xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner); + var minMaxValue = (poolType === 'max' ? Number.NEGATIVE_INFINITY : + Number.POSITIVE_INFINITY); + var avgValue = 0; + var count = 0; + for (var xR = xRMin; xR < xRMax; ++xR) { + for (var xC = xCMin; xC < xCMax; ++xC) { + var pixel = x.get(b, xR, xC, d); + if ((poolType === 'max' && pixel > minMaxValue)) { + minMaxValue = pixel; + } + else if (poolType === 'avg') { + avgValue += pixel; + count++; + } + } + if (isNaN(minMaxValue)) { + break; + } + } + y.set(poolType === 'avg' ? avgValue / count : minMaxValue, b, yR, yC, d); + } + } + } + } + return y.toTensor(); + }; + MathBackendCPU.prototype.maxPool = function (x, convInfo) { + return this.pool(x, convInfo, 'max'); + }; + MathBackendCPU.prototype.maxPoolPositions = function (x, convInfo) { + var maxPositions = buffer(convInfo.outShape, 'int32'); + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padLeft = convInfo.padInfo.left; + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d = 0; d < convInfo.inChannels; ++d) { + for (var yR = 0; yR < convInfo.outHeight; ++yR) { + var xRCorner = yR * strideHeight - padTop; + var xRMin = Math.max(0, xRCorner); + var xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner); + for (var yC = 0; yC < convInfo.outWidth; ++yC) { + var xCCorner = yC * strideWidth - padLeft; + var xCMin = Math.max(0, xCCorner); + var xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner); + var maxValue = Number.NEGATIVE_INFINITY; + var maxPosition = -1; + for (var xR = xRMin; xR < xRMax; ++xR) { + var wR = xR - xRCorner; + for (var xC = xCMin; xC < xCMax; ++xC) { + var wC = xC - xCCorner; + var pixel = x.get(b, xR, xC, d); + if (pixel > maxValue) { + maxValue = pixel; + maxPosition = wR * filterWidth + wC; + } + } + } + maxPositions.set(maxPosition, b, yR, yC, d); + } + } + } + } + return maxPositions.toTensor(); + }; + MathBackendCPU.prototype.maxPoolBackprop = function (dy, x, y, convInfo) { + var maxPositions = this.maxPoolPositions(x, convInfo); + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var dx = buffer(x.shape, 'float32'); + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d = 0; d < convInfo.inChannels; ++d) { + for (var dxR = 0; dxR < convInfo.inHeight; ++dxR) { + for (var dxC = 0; dxC < convInfo.inWidth; ++dxC) { + var dyRCorner = dxR - padTop; + var dyCCorner = dxC - padLeft; + var dotProd = 0; + for (var wR = 0; wR < filterHeight; ++wR) { + var dyR = (dyRCorner + wR) / strideHeight; + if (dyR < 0 || dyR >= convInfo.outHeight || + Math.floor(dyR) !== dyR) { + continue; + } + for (var wC = 0; wC < filterWidth; ++wC) { + var dyC = (dyCCorner + wC) / strideWidth; + if (dyC < 0 || dyC >= convInfo.outWidth || + Math.floor(dyC) !== dyC) { + continue; + } + var maxPos = filterHeight * filterWidth - 1 - + maxPositions.get(b, dyR, dyC, d); + var curPos = wR * filterWidth + wC; + var mask = maxPos === curPos ? 1 : 0; + if (mask === 0) { + continue; + } + var pixel = dy.get(b, dyR, dyC, d); + dotProd += pixel * mask; + } + } + dx.set(dotProd, b, dxR, dxC, d); + } + } + } + } + return dx.toTensor(); + }; + MathBackendCPU.prototype.avgPoolBackprop = function (dy, x, convInfo) { + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padLeft = filterWidth - 1 - convInfo.padInfo.left; + var padTop = filterHeight - 1 - convInfo.padInfo.top; + var dx = buffer(x.shape, 'float32'); + var avgMultiplier = 1 / (filterHeight * filterWidth); + for (var b = 0; b < convInfo.batchSize; ++b) { + for (var d = 0; d < convInfo.inChannels; ++d) { + for (var dxR = 0; dxR < convInfo.inHeight; ++dxR) { + for (var dxC = 0; dxC < convInfo.inWidth; ++dxC) { + var dyRCorner = dxR - padTop; + var dyCCorner = dxC - padLeft; + var dotProd = 0; + for (var wR = 0; wR < filterHeight; ++wR) { + var dyR = (dyRCorner + wR) / strideHeight; + if (dyR < 0 || dyR >= convInfo.outHeight || + Math.floor(dyR) !== dyR) { + continue; + } + for (var wC = 0; wC < filterWidth; ++wC) { + var dyC = (dyCCorner + wC) / strideWidth; + if (dyC < 0 || dyC >= convInfo.outWidth || + Math.floor(dyC) !== dyC) { + continue; + } + var pixel = dy.get(b, dyR, dyC, d); + dotProd += pixel; + } + } + dx.set(dotProd * avgMultiplier, b, dxR, dxC, d); + } + } + } + } + return dx.toTensor(); + }; + MathBackendCPU.prototype.cast = function (x, dtype) { + return castTensor(x, dtype, this); + }; + MathBackendCPU.prototype.reshape = function (x, shape) { + return reshapeTensor(x, shape); + }; + MathBackendCPU.prototype.avgPool = function (x, convInfo) { + return this.pool(x, convInfo, 'avg').toFloat(); + }; + MathBackendCPU.prototype.resizeBilinear = function (x, newHeight, newWidth, alignCorners) { + var _a = x.shape, batch = _a[0], oldHeight = _a[1], oldWidth = _a[2], numChannels = _a[3]; + var output = buffer([batch, newHeight, newWidth, numChannels], x.dtype); + var effectiveInputSize = [ + (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight, + (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth + ]; + var effectiveOutputSize = [ + (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight, + (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth + ]; + for (var b = 0; b < batch; b++) { + for (var r = 0; r < newHeight; r++) { + for (var c = 0; c < newWidth; c++) { + for (var d = 0; d < numChannels; d++) { + var sourceFracRow = (effectiveInputSize[0]) * r / (effectiveOutputSize[0]); + var sourceFracCol = (effectiveInputSize[1]) * c / (effectiveOutputSize[1]); + var sourceRowFloor = Math.floor(sourceFracRow); + var sourceRowCeil = Math.min(oldHeight - 1, Math.ceil(sourceFracRow)); + var sourceColFloor = Math.floor(sourceFracCol); + var sourceColCeil = Math.min(oldWidth - 1, Math.ceil(sourceFracCol)); + var topLeft = x.get(b, sourceRowFloor, sourceColFloor, d); + var bottomLeft = x.get(b, sourceRowCeil, sourceColFloor, d); + var topRight = x.get(b, sourceRowFloor, sourceColCeil, d); + var bottomRight = x.get(b, sourceRowCeil, sourceColCeil, d); + var rowFrac = sourceFracRow - sourceRowFloor; + var colFrac = sourceFracCol - sourceColFloor; + var top_1 = topLeft + (topRight - topLeft) * colFrac; + var bottom = bottomLeft + (bottomRight - bottomLeft) * colFrac; + var newValue = top_1 + (bottom - top_1) * rowFrac; + output.set(newValue, b, r, c, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.resizeBilinearBackprop = function (dy, x, alignCorners) { + var _a = x.shape, batch = _a[0], xHeight = _a[1], xWidth = _a[2], depth = _a[3]; + var _b = dy.shape, yHeight = _b[1], yWidth = _b[2]; + var output = buffer([batch, xHeight, xWidth, depth], x.dtype); + var effectiveXSize = [ + (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight, + (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth + ]; + var effectiveYSize = [ + (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight, + (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth + ]; + var heightScale = effectiveXSize[0] / effectiveYSize[0]; + var widthScale = effectiveXSize[1] / effectiveYSize[1]; + for (var b = 0; b < batch; b++) { + for (var r = 0; r < yHeight; r++) { + var dxR = r * heightScale; + var topDxRIndex = Math.floor(dxR); + var bottomDxRIndex = Math.min(Math.ceil(dxR), xHeight - 1); + var dxRLerp = dxR - topDxRIndex; + var inverseDxRLerp = 1.0 - dxRLerp; + for (var c = 0; c < yWidth; c++) { + var dxC = c * widthScale; + var leftDxCIndex = Math.floor(dxC); + var rightDxCIndex = Math.min(Math.ceil(dxC), xWidth - 1); + var dxCLerp = dxC - leftDxCIndex; + var inverseDxCLerp = 1.0 - dxCLerp; + for (var d = 0; d < depth; d++) { + var dyVal = dy.get(b, r, c, d); + var topLeft = output.get(b, topDxRIndex, leftDxCIndex, d); + topLeft += dyVal * inverseDxRLerp * inverseDxCLerp; + output.set(topLeft, b, topDxRIndex, leftDxCIndex, d); + var topRight = output.get(b, topDxRIndex, rightDxCIndex, d); + topRight += dyVal * inverseDxRLerp * dxCLerp; + output.set(topRight, b, topDxRIndex, rightDxCIndex, d); + var bottomLeft = output.get(b, bottomDxRIndex, leftDxCIndex, d); + bottomLeft += dyVal * dxRLerp * inverseDxCLerp; + output.set(bottomLeft, b, bottomDxRIndex, leftDxCIndex, d); + var bottomRight = output.get(b, bottomDxRIndex, rightDxCIndex, d); + bottomRight += dyVal * dxRLerp * dxCLerp; + output.set(bottomRight, b, bottomDxRIndex, rightDxCIndex, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.resizeNearestNeighbor = function (x, newHeight, newWidth, alignCorners) { + var _a = x.shape, batch = _a[0], oldHeight = _a[1], oldWidth = _a[2], numChannels = _a[3]; + var output = buffer([batch, newHeight, newWidth, numChannels], x.dtype); + var effectiveInputSize = [ + (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight, + (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth + ]; + var effectiveOutputSize = [ + (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight, + (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth + ]; + for (var b = 0; b < batch; b++) { + for (var r = 0; r < newHeight; r++) { + for (var c = 0; c < newWidth; c++) { + for (var d = 0; d < numChannels; d++) { + var sourceFracRow = (effectiveInputSize[0]) * r / (effectiveOutputSize[0]); + var sourceFracCol = (effectiveInputSize[1]) * c / (effectiveOutputSize[1]); + var sourceNearestRow = Math.min(oldHeight - 1, alignCorners ? Math.round(sourceFracRow) : + Math.floor(sourceFracRow)); + var sourceNearestCol = Math.min(oldWidth - 1, alignCorners ? Math.round(sourceFracCol) : + Math.floor(sourceFracCol)); + var newValue = x.get(b, sourceNearestRow, sourceNearestCol, d); + output.set(newValue, b, r, c, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.resizeNearestNeighborBackprop = function (dy, x, alignCorners) { + var _a = x.shape, batch = _a[0], xHeight = _a[1], xWidth = _a[2], depth = _a[3]; + var _b = dy.shape, yHeight = _b[1], yWidth = _b[2]; + var output = buffer([batch, xHeight, xWidth, depth], x.dtype); + var effectiveXSize = [ + (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight, + (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth + ]; + var effectiveYSize = [ + (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight, + (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth + ]; + var heightScale = effectiveXSize[0] / effectiveYSize[0]; + var widthScale = effectiveXSize[1] / effectiveYSize[1]; + var invHeightScale = 1 / heightScale; + var invWidthScale = 1 / widthScale; + var winHeight = (Math.ceil(invHeightScale) * 2) + 2; + var winWidth = (Math.ceil(invWidthScale) * 2) + 2; + for (var b = 0; b < batch; b++) { + for (var r = 0; r < xHeight; r++) { + for (var c = 0; c < xWidth; c++) { + var startRLerp = Math.floor(r * invHeightScale); + var startDyR = Math.floor(startRLerp - (winHeight / 2)); + var startCLerp = Math.floor(c * invWidthScale); + var startDyC = Math.floor(startCLerp - (winWidth / 2)); + for (var d = 0; d < depth; d++) { + var accum = 0; + for (var dyROffset = 0; dyROffset < winHeight; dyROffset++) { + var dyR = dyROffset + startDyR; + if (dyR < 0 || dyR >= yHeight) { + continue; + } + for (var dyCOffSet = 0; dyCOffSet < winWidth; dyCOffSet++) { + var dyC = dyCOffSet + startDyC; + if (dyC < 0 || dyC >= yWidth) { + continue; + } + var sourceFracRow = effectiveXSize[0] * (dyR / effectiveYSize[0]); + var sourceFracCol = effectiveXSize[1] * (dyC / effectiveYSize[1]); + var sourceNearestRow = Math.min(xHeight - 1, alignCorners ? Math.round(sourceFracRow) : + Math.floor(sourceFracRow)); + var sourceNearestCol = Math.min(xWidth - 1, alignCorners ? Math.round(sourceFracCol) : + Math.floor(sourceFracCol)); + if (r === sourceNearestRow && c === sourceNearestCol) { + accum += dy.get(b, dyR, dyC, d); + } + } + } + output.set(accum, b, r, c, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.batchNormalization = function (x, mean$$1, variance, varianceEpsilon, scale, offset) { + var xValues = x.dataSync(); + var meanValues = mean$$1.dataSync(); + var varianceValues = variance.dataSync(); + var scaleValues = scale ? scale.dataSync() : new Float32Array([1]); + var offsetValues = offset ? offset.dataSync() : new Float32Array([0]); + var outValues = new Float32Array(xValues.length); + for (var i = 0; i < xValues.length; i++) { + outValues[i] = offsetValues[i % offsetValues.length] + + (xValues[i] - meanValues[i % meanValues.length]) * + scaleValues[i % scaleValues.length] / + Math.sqrt(varianceValues[i % varianceValues.length] + varianceEpsilon); + } + return tensor4d(outValues, x.shape); + }; + MathBackendCPU.prototype.localResponseNormalization4D = function (x, radius, bias, alpha, beta) { + var output = buffer(x.shape, 'float32'); + var rad = radius; + var maxD = output.shape[3] - 1; + function sumAcrossChannels(b, r, c, d) { + var sum$$1 = 0.0; + for (var j = Math.max(0, d - rad); j <= Math.min(d + rad, maxD); j++) { + var z = x.get(b, r, c, j); + sum$$1 += z * z; + } + return sum$$1; + } + for (var b = 0; b < output.shape[0]; b++) { + for (var r = 0; r <= output.shape[1]; r++) { + for (var c = 0; c < output.shape[2]; c++) { + for (var d = 0; d < output.shape[3]; d++) { + var sum$$1 = sumAcrossChannels(b, r, c, d); + var val = x.get(b, r, c, d) * Math.pow(bias + alpha * sum$$1, -beta); + output.set(val, b, r, c, d); + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.LRNGrad = function (dy, inputImage, outputImage, depthRadius, bias, alpha, beta) { + var batch = dy.shape[0]; + var rows = dy.shape[1]; + var cols = dy.shape[2]; + var depth = dy.shape[3]; + var output = buffer([batch, rows, cols, depth], 'float32'); + for (var b = 0; b < batch; ++b) { + for (var r = 0; r < rows; ++r) { + for (var c = 0; c < cols; ++c) { + for (var d = 0; d < depth; ++d) { + var depthBegin = Math.max(0, d - depthRadius); + var depthEnd = Math.min(depth, d + depthRadius + 1); + var norm$$1 = 0; + for (var k = depthBegin; k < depthEnd; ++k) { + norm$$1 += inputImage.get(b, r, c, k) * inputImage.get(b, r, c, k); + } + norm$$1 = alpha * norm$$1 + bias; + for (var k = depthBegin; k < depthEnd; ++k) { + var dyi = -2 * alpha * beta * inputImage.get(b, r, c, k) * + outputImage.get(b, r, c, d) / norm$$1; + if (d === k) { + dyi += Math.pow(norm$$1, -beta); + } + dyi *= dy.get(b, r, c, d); + output.set(dyi + output.get(b, r, c, k), b, r, c, k); + } + } + } + } + } + return output.toTensor(); + }; + MathBackendCPU.prototype.multinomial = function (logits, normalized, numSamples, seed) { + var probabilities = normalized ? logits : softmax(logits); + var batchSize = probabilities.shape[0]; + var numEvents = probabilities.shape[1]; + var res = zeros([batchSize, numSamples], 'int32'); + var resVals = res.dataSync(); + var probVals = probabilities.dataSync(); + for (var b = 0; b < batchSize; ++b) { + var offset = b * numEvents; + var cdf = new Float32Array(numEvents - 1); + cdf[0] = probVals[offset]; + for (var event_1 = 1; event_1 < cdf.length; ++event_1) { + cdf[event_1] = cdf[event_1 - 1] + probVals[offset + event_1]; + } + var random = seedrandom_1(seed.toString()); + var outOffset = b * numSamples; + for (var sampleId = 0; sampleId < numSamples; ++sampleId) { + var r = random(); + resVals[outOffset + sampleId] = cdf.length; + for (var event_2 = 0; event_2 < cdf.length; event_2++) { + if (r < cdf[event_2]) { + resVals[outOffset + sampleId] = event_2; + break; + } + } + } + } + return res; + }; + MathBackendCPU.prototype.oneHot = function (indices, depth, onValue, offValue) { + var res = new Float32Array(indices.size * depth); + res.fill(offValue); + for (var event_3 = 0; event_3 < indices.size; ++event_3) { + if (indices.get(event_3) >= 0 && indices.get(event_3) < depth) { + res[event_3 * depth + indices.get(event_3)] = onValue; + } + } + return tensor2d(res, [indices.size, depth], 'int32'); + }; + MathBackendCPU.prototype.nonMaxSuppression = function (boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) { + var boxesVals = boxes.dataSync(); + var scoresVals = scores.dataSync(); + return nonMaxSuppressionImpl(boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold); + }; + MathBackendCPU.prototype.broadcastedBinaryOp = function (a, b, dtype, op$$1) { + var newShape = assertAndGetBroadcastShape(a.shape, b.shape); + var result = buffer(newShape, dtype); + var aValues = a.dataSync(); + var bValues = b.dataSync(); + var aBroadcastDims = getBroadcastDims(a.shape, newShape); + var bBroadcastDims = getBroadcastDims(b.shape, newShape); + var aBuf = a.buffer(); + var bBuf = b.buffer(); + var _loop_2 = function (i) { + var loc = result.indexToLoc(i); + var aLoc = loc.slice(-a.rank); + aBroadcastDims.forEach(function (d) { return aLoc[d] = 0; }); + var aIndex = aBuf.locToIndex(aLoc); + var bLoc = loc.slice(-b.rank); + bBroadcastDims.forEach(function (d) { return bLoc[d] = 0; }); + var bIndex = bBuf.locToIndex(bLoc); + result.values[i] = op$$1(aValues[aIndex], bValues[bIndex]); + }; + for (var i = 0; i < result.values.length; ++i) { + _loop_2(i); + } + return result.toTensor(); + }; + MathBackendCPU.prototype.dispose = function () { }; + return MathBackendCPU; + }()); + ENV.registerBackend('cpu', function () { return new MathBackendCPU(); }, 1, setTensorTracker); + + var delayCallback = typeof requestAnimationFrame !== 'undefined' ? + requestAnimationFrame : + setImmediate; + function nextFrame() { + return new Promise(function (resolve) { return delayCallback(function () { return resolve(); }); }); + } + + var DTYPE_VALUE_SIZE_MAP = { + 'float32': 4, + 'int32': 4, + 'uint16': 2, + 'uint8': 1, + 'bool': 1, + }; + + function encodeWeights(tensors) { + return __awaiter(this, void 0, void 0, function () { + var specs, dataPromises, name_1, t, tensorValues; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + specs = []; + dataPromises = []; + for (name_1 in tensors) { + t = tensors[name_1]; + if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool') { + throw new Error("Unsupported dtype in weight '" + name_1 + "': " + t.dtype); + } + specs.push({ name: name_1, shape: t.shape, dtype: t.dtype }); + dataPromises.push(t.data()); + } + return [4, Promise.all(dataPromises)]; + case 1: + tensorValues = _a.sent(); + return [2, { data: concatenateTypedArrays(tensorValues), specs: specs }]; + } + }); + }); + } + function decodeWeights(buffer, specs) { + var out = {}; + var offset = 0; + for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { + var spec = specs_1[_i]; + var name_2 = spec.name; + var dtype = spec.dtype; + var shape = spec.shape; + if (spec.quantization != null) { + throw new Error("decodeWeights does not support quantization yet, but encountered " + + ("weight '" + name_2 + " with quantization.'")); + } + var size = sizeFromShape(shape); + var value = void 0; + if (dtype === 'float32') { + value = tensor(new Float32Array(buffer, offset, size), shape, 'float32'); + } + else if (dtype === 'int32') { + value = tensor(new Int32Array(buffer, offset, size), shape, 'int32'); + } + else if (dtype === 'bool') { + value = tensor(new Uint8Array(buffer, offset, size), shape, 'bool'); + } + else { + throw new Error("Unsupported dtype in weight '" + name_2 + "': " + dtype); + } + out[name_2] = value; + offset += size * DTYPE_VALUE_SIZE_MAP[dtype]; + } + return out; + } + function concatenateTypedArrays(xs) { + if (xs === null) { + throw new Error("Invalid input value: " + JSON.stringify(xs)); + } + var totalByteLength = 0; + var normalizedXs = []; + xs.forEach(function (x) { + totalByteLength += x.byteLength; + normalizedXs.push(x.byteLength === x.buffer.byteLength ? x : + new x.constructor(x)); + if (!(x instanceof Float32Array || x instanceof Int32Array || + x instanceof Uint8Array)) { + throw new Error("Unsupported TypedArray subtype: " + x.constructor.name); + } + }); + var y = new Uint8Array(totalByteLength); + var offset = 0; + normalizedXs.forEach(function (x) { + y.set(new Uint8Array(x.buffer), offset); + offset += x.byteLength; + }); + return y.buffer; + } + var useNodeBuffer = typeof Buffer !== 'undefined' && + (typeof Blob === 'undefined' || typeof atob === 'undefined' || + typeof btoa === 'undefined'); + function stringByteLength(str) { + if (useNodeBuffer) { + return Buffer.byteLength(str); + } + return new Blob([str]).size; + } + function arrayBufferToBase64String(buffer) { + if (useNodeBuffer) { + return Buffer.from(buffer).toString('base64'); + } + return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer))); + } + function base64StringToArrayBuffer(str) { + if (useNodeBuffer) { + var buf = Buffer.from(str, 'base64'); + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + } + var s = atob(str); + var buffer = new Uint8Array(s.length); + for (var i = 0; i < s.length; ++i) { + buffer.set([s.charCodeAt(i)], i); + } + return buffer.buffer; + } + function concatenateArrayBuffers(buffers) { + var totalByteLength = 0; + buffers.forEach(function (buffer) { + totalByteLength += buffer.byteLength; + }); + var temp = new Uint8Array(totalByteLength); + var offset = 0; + buffers.forEach(function (buffer) { + temp.set(new Uint8Array(buffer), offset); + offset += buffer.byteLength; + }); + return temp.buffer; + } + function basename(path) { + var SEPARATOR = '/'; + path = path.trim(); + while (path.endsWith(SEPARATOR)) { + path = path.slice(0, path.length - 1); + } + var items = path.split(SEPARATOR); + return items[items.length - 1]; + } + function getModelArtifactsInfoForJSON(modelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('Expected JSON model topology, received ArrayBuffer.'); + } + return { + dateSaved: new Date(), + modelTopologyType: 'JSON', + modelTopologyBytes: modelArtifacts.modelTopology == null ? + 0 : + stringByteLength(JSON.stringify(modelArtifacts.modelTopology)), + weightSpecsBytes: modelArtifacts.weightSpecs == null ? + 0 : + stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)), + weightDataBytes: modelArtifacts.weightData == null ? + 0 : + modelArtifacts.weightData.byteLength, + }; + } + + var IORouterRegistry = (function () { + function IORouterRegistry() { + this.saveRouters = []; + this.loadRouters = []; + } + IORouterRegistry.getInstance = function () { + if (IORouterRegistry.instance == null) { + IORouterRegistry.instance = new IORouterRegistry(); + } + return IORouterRegistry.instance; + }; + IORouterRegistry.registerSaveRouter = function (saveRouter) { + IORouterRegistry.getInstance().saveRouters.push(saveRouter); + }; + IORouterRegistry.registerLoadRouter = function (loadRouter) { + IORouterRegistry.getInstance().loadRouters.push(loadRouter); + }; + IORouterRegistry.getSaveHandlers = function (url) { + return IORouterRegistry.getHandlers(url, 'save'); + }; + IORouterRegistry.getLoadHandlers = function (url) { + return IORouterRegistry.getHandlers(url, 'load'); + }; + IORouterRegistry.getHandlers = function (url, handlerType) { + var validHandlers = []; + var routers = handlerType === 'load' ? this.getInstance().loadRouters : + this.getInstance().saveRouters; + routers.forEach(function (router) { + var handler = router(url); + if (handler !== null) { + validHandlers.push(handler); + } + }); + return validHandlers; + }; + return IORouterRegistry; + }()); + + var URL_SCHEME_SUFFIX = '://'; + var ModelStoreManagerRegistry = (function () { + function ModelStoreManagerRegistry() { + this.managers = {}; + } + ModelStoreManagerRegistry.getInstance = function () { + if (ModelStoreManagerRegistry.instance == null) { + ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry(); + } + return ModelStoreManagerRegistry.instance; + }; + ModelStoreManagerRegistry.registerManager = function (scheme, manager) { + assert(scheme != null, 'scheme must not be undefined or null.'); + if (scheme.endsWith(URL_SCHEME_SUFFIX)) { + scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX)); + } + assert(scheme.length > 0, 'scheme must not be an empty string.'); + var registry = ModelStoreManagerRegistry.getInstance(); + assert(registry.managers[scheme] == null, "A model store manager is already registered for scheme '" + scheme + "'."); + registry.managers[scheme] = manager; + }; + ModelStoreManagerRegistry.getManager = function (scheme) { + var manager = this.getInstance().managers[scheme]; + if (manager == null) { + throw new Error("Cannot find model manager for scheme '" + scheme + "'"); + } + return manager; + }; + ModelStoreManagerRegistry.getSchemes = function () { + return Object.keys(this.getInstance().managers); + }; + return ModelStoreManagerRegistry; + }()); + function parseURL(url) { + if (url.indexOf(URL_SCHEME_SUFFIX) === -1) { + throw new Error("The url string provided does not contain a scheme. " + + "Supported schemes are: " + + ("" + ModelStoreManagerRegistry.getSchemes().join(','))); + } + return { + scheme: url.split(URL_SCHEME_SUFFIX)[0], + path: url.split(URL_SCHEME_SUFFIX)[1], + }; + } + function cloneModelInternal(sourceURL, destURL, deleteSource) { + if (deleteSource === void 0) { deleteSource = false; } + return __awaiter(this, void 0, void 0, function () { + var loadHandlers, loadHandler, saveHandlers, saveHandler, sourceScheme, sourcePath, sameMedium, modelArtifacts, saveResult; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + assert(sourceURL !== destURL, "Old path and new path are the same: '" + sourceURL + "'"); + loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL); + assert(loadHandlers.length > 0, "Copying failed because no load handler is found for source URL " + sourceURL + "."); + assert(loadHandlers.length < 2, "Copying failed because more than one (" + loadHandlers.length + ") " + + ("load handlers for source URL " + sourceURL + ".")); + loadHandler = loadHandlers[0]; + saveHandlers = IORouterRegistry.getSaveHandlers(destURL); + assert(saveHandlers.length > 0, "Copying failed because no save handler is found for destination URL " + + (destURL + ".")); + assert(saveHandlers.length < 2, "Copying failed because more than one (" + loadHandlers.length + ") " + + ("save handlers for destination URL " + destURL + ".")); + saveHandler = saveHandlers[0]; + sourceScheme = parseURL(sourceURL).scheme; + sourcePath = parseURL(sourceURL).path; + sameMedium = sourceScheme === parseURL(sourceURL).scheme; + return [4, loadHandler.load()]; + case 1: + modelArtifacts = _a.sent(); + if (!(deleteSource && sameMedium)) return [3, 3]; + return [4, ModelStoreManagerRegistry.getManager(sourceScheme) + .removeModel(sourcePath)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [4, saveHandler.save(modelArtifacts)]; + case 4: + saveResult = _a.sent(); + if (!(deleteSource && !sameMedium)) return [3, 6]; + return [4, ModelStoreManagerRegistry.getManager(sourceScheme) + .removeModel(sourcePath)]; + case 5: + _a.sent(); + _a.label = 6; + case 6: return [2, saveResult.modelArtifactsInfo]; + } + }); + }); + } + function listModels() { + return __awaiter(this, void 0, void 0, function () { + var schemes, out, _i, schemes_1, scheme, schemeOut, path, url; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + schemes = ModelStoreManagerRegistry.getSchemes(); + out = {}; + _i = 0, schemes_1 = schemes; + _a.label = 1; + case 1: + if (!(_i < schemes_1.length)) return [3, 4]; + scheme = schemes_1[_i]; + return [4, ModelStoreManagerRegistry.getManager(scheme).listModels()]; + case 2: + schemeOut = _a.sent(); + for (path in schemeOut) { + url = scheme + URL_SCHEME_SUFFIX + path; + out[url] = schemeOut[path]; + } + _a.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2, out]; + } + }); + }); + } + function removeModel(url) { + return __awaiter(this, void 0, void 0, function () { + var schemeAndPath, manager; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + schemeAndPath = parseURL(url); + manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme); + return [4, manager.removeModel(schemeAndPath.path)]; + case 1: return [2, _a.sent()]; + } + }); + }); + } + function copyModel(sourceURL, destURL) { + return __awaiter(this, void 0, void 0, function () { + var deleteSource; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + deleteSource = false; + return [4, cloneModelInternal(sourceURL, destURL, deleteSource)]; + case 1: return [2, _a.sent()]; + } + }); + }); + } + function moveModel(sourceURL, destURL) { + return __awaiter(this, void 0, void 0, function () { + var deleteSource; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + deleteSource = true; + return [4, cloneModelInternal(sourceURL, destURL, deleteSource)]; + case 1: return [2, _a.sent()]; + } + }); + }); + } + + var DATABASE_NAME = 'tensorflowjs'; + var DATABASE_VERSION = 1; + var MODEL_STORE_NAME = 'models_store'; + var INFO_STORE_NAME = 'model_info_store'; + function getIndexedDBFactory() { + if (!ENV.get('IS_BROWSER')) { + throw new Error('Failed to obtain IndexedDB factory because the current environment' + + 'is not a web browser.'); + } + var theWindow = window; + var factory = theWindow.indexedDB || theWindow.mozIndexedDB || + theWindow.webkitIndexedDB || theWindow.msIndexedDB || + theWindow.shimIndexedDB; + if (factory == null) { + throw new Error('The current browser does not appear to support IndexedDB.'); + } + return factory; + } + function setUpDatabase(openRequest) { + var db = openRequest.result; + db.createObjectStore(MODEL_STORE_NAME, { keyPath: 'modelPath' }); + db.createObjectStore(INFO_STORE_NAME, { keyPath: 'modelPath' }); + } + var BrowserIndexedDB = (function () { + function BrowserIndexedDB(modelPath) { + this.indexedDB = getIndexedDBFactory(); + if (modelPath == null || !modelPath) { + throw new Error('For IndexedDB, modelPath must not be null, undefined or empty.'); + } + this.modelPath = modelPath; + } + BrowserIndexedDB.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserLocalStorage.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + return [2, this.databaseAction(this.modelPath, modelArtifacts)]; + }); + }); + }; + BrowserIndexedDB.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, this.databaseAction(this.modelPath)]; + }); + }); + }; + BrowserIndexedDB.prototype.databaseAction = function (modelPath, modelArtifacts) { + var _this = this; + return new Promise(function (resolve, reject) { + var openRequest = _this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); + openRequest.onupgradeneeded = function () { return setUpDatabase(openRequest); }; + openRequest.onsuccess = function () { + var db = openRequest.result; + if (modelArtifacts == null) { + var modelTx = db.transaction(MODEL_STORE_NAME, 'readonly'); + var modelStore = modelTx.objectStore(MODEL_STORE_NAME); + var getRequest_1 = modelStore.get(_this.modelPath); + getRequest_1.onsuccess = function () { + if (getRequest_1.result == null) { + db.close(); + return reject(new Error("Cannot find model with path '" + _this.modelPath + "' " + + "in IndexedDB.")); + } + else { + resolve(getRequest_1.result.modelArtifacts); + } + }; + getRequest_1.onerror = function (error) { + db.close(); + return reject(getRequest_1.error); + }; + modelTx.oncomplete = function () { return db.close(); }; + } + else { + var modelArtifactsInfo_1 = getModelArtifactsInfoForJSON(modelArtifacts); + var infoTx_1 = db.transaction(INFO_STORE_NAME, 'readwrite'); + var infoStore_1 = infoTx_1.objectStore(INFO_STORE_NAME); + var putInfoRequest_1 = infoStore_1.put({ modelPath: _this.modelPath, modelArtifactsInfo: modelArtifactsInfo_1 }); + var modelTx_1; + putInfoRequest_1.onsuccess = function () { + modelTx_1 = db.transaction(MODEL_STORE_NAME, 'readwrite'); + var modelStore = modelTx_1.objectStore(MODEL_STORE_NAME); + var putModelRequest = modelStore.put({ + modelPath: _this.modelPath, + modelArtifacts: modelArtifacts, + modelArtifactsInfo: modelArtifactsInfo_1 + }); + putModelRequest.onsuccess = function () { return resolve({ modelArtifactsInfo: modelArtifactsInfo_1 }); }; + putModelRequest.onerror = function (error) { + infoStore_1 = infoTx_1.objectStore(INFO_STORE_NAME); + var deleteInfoRequest = infoStore_1.delete(_this.modelPath); + deleteInfoRequest.onsuccess = function () { + db.close(); + return reject(putModelRequest.error); + }; + deleteInfoRequest.onerror = function (error) { + db.close(); + return reject(putModelRequest.error); + }; + }; + }; + putInfoRequest_1.onerror = function (error) { + db.close(); + return reject(putInfoRequest_1.error); + }; + infoTx_1.oncomplete = function () { + if (modelTx_1 == null) { + db.close(); + } + else { + modelTx_1.oncomplete = function () { return db.close(); }; + } + }; + } + }; + openRequest.onerror = function (error) { return reject(openRequest.error); }; + }); + }; + BrowserIndexedDB.URL_SCHEME = 'indexeddb://'; + return BrowserIndexedDB; + }()); + var indexedDBRouter = function (url) { + if (!ENV.get('IS_BROWSER')) { + return null; + } + else { + if (url.startsWith(BrowserIndexedDB.URL_SCHEME)) { + return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length)); + } + else { + return null; + } + } + }; + IORouterRegistry.registerSaveRouter(indexedDBRouter); + IORouterRegistry.registerLoadRouter(indexedDBRouter); + function browserIndexedDB(modelPath) { + return new BrowserIndexedDB(modelPath); + } + function maybeStripScheme(key) { + return key.startsWith(BrowserIndexedDB.URL_SCHEME) ? + key.slice(BrowserIndexedDB.URL_SCHEME.length) : + key; + } + var BrowserIndexedDBManager = (function () { + function BrowserIndexedDBManager() { + this.indexedDB = getIndexedDBFactory(); + } + BrowserIndexedDBManager.prototype.listModels = function () { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + return [2, new Promise(function (resolve, reject) { + var openRequest = _this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); + openRequest.onupgradeneeded = function () { return setUpDatabase(openRequest); }; + openRequest.onsuccess = function () { + var db = openRequest.result; + var tx = db.transaction(INFO_STORE_NAME, 'readonly'); + var store = tx.objectStore(INFO_STORE_NAME); + var getAllInfoRequest = store.getAll(); + getAllInfoRequest.onsuccess = function () { + var out = {}; + for (var _i = 0, _a = getAllInfoRequest.result; _i < _a.length; _i++) { + var item = _a[_i]; + out[item.modelPath] = item.modelArtifactsInfo; + } + resolve(out); + }; + getAllInfoRequest.onerror = function (error) { + db.close(); + return reject(getAllInfoRequest.error); + }; + tx.oncomplete = function () { return db.close(); }; + }; + openRequest.onerror = function (error) { return reject(openRequest.error); }; + })]; + }); + }); + }; + BrowserIndexedDBManager.prototype.removeModel = function (path) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + path = maybeStripScheme(path); + return [2, new Promise(function (resolve, reject) { + var openRequest = _this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); + openRequest.onupgradeneeded = function () { return setUpDatabase(openRequest); }; + openRequest.onsuccess = function () { + var db = openRequest.result; + var infoTx = db.transaction(INFO_STORE_NAME, 'readwrite'); + var infoStore = infoTx.objectStore(INFO_STORE_NAME); + var getInfoRequest = infoStore.get(path); + var modelTx; + getInfoRequest.onsuccess = function () { + if (getInfoRequest.result == null) { + db.close(); + return reject(new Error("Cannot find model with path '" + path + "' " + + "in IndexedDB.")); + } + else { + var deleteInfoRequest = infoStore.delete(path); + var deleteModelData_1 = function () { + modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite'); + var modelStore = modelTx.objectStore(MODEL_STORE_NAME); + var deleteModelRequest = modelStore.delete(path); + deleteModelRequest.onsuccess = function () { + return resolve(getInfoRequest.result.modelArtifactsInfo); + }; + deleteModelRequest.onerror = function (error) { + return reject(getInfoRequest.error); + }; + }; + deleteInfoRequest.onsuccess = deleteModelData_1; + deleteInfoRequest.onerror = function (error) { + deleteModelData_1(); + db.close(); + return reject(getInfoRequest.error); + }; + } + }; + getInfoRequest.onerror = function (error) { + db.close(); + return reject(getInfoRequest.error); + }; + infoTx.oncomplete = function () { + if (modelTx == null) { + db.close(); + } + else { + modelTx.oncomplete = function () { return db.close(); }; + } + }; + }; + openRequest.onerror = function (error) { return reject(openRequest.error); }; + })]; + }); + }); + }; + return BrowserIndexedDBManager; + }()); + if (ENV.get('IS_BROWSER')) { + try { + ModelStoreManagerRegistry.registerManager(BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager()); + } + catch (err) { + } + } + + var PATH_SEPARATOR = '/'; + var PATH_PREFIX = 'tensorflowjs_models'; + var INFO_SUFFIX = 'info'; + var MODEL_TOPOLOGY_SUFFIX = 'model_topology'; + var WEIGHT_SPECS_SUFFIX = 'weight_specs'; + var WEIGHT_DATA_SUFFIX = 'weight_data'; + function getModelKeys(path) { + return { + info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR), + topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR), + weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR), + weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR) + }; + } + function getModelPathFromKey(key) { + var items = key.split(PATH_SEPARATOR); + if (items.length < 3) { + throw new Error("Invalid key format: " + key); + } + return items.slice(1, items.length - 1).join(PATH_SEPARATOR); + } + function maybeStripScheme$1(key) { + return key.startsWith(BrowserLocalStorage.URL_SCHEME) ? + key.slice(BrowserLocalStorage.URL_SCHEME.length) : + key; + } + var BrowserLocalStorage = (function () { + function BrowserLocalStorage(modelPath) { + if (!ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') { + throw new Error('The current environment does not support local storage.'); + } + this.LS = window.localStorage; + if (modelPath == null || !modelPath) { + throw new Error('For local storage, modelPath must not be null, undefined or empty.'); + } + this.modelPath = modelPath; + this.keys = getModelKeys(this.modelPath); + } + BrowserLocalStorage.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + var topology, weightSpecs, modelArtifactsInfo, key; + return __generator(this, function (_a) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserLocalStorage.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + else { + topology = JSON.stringify(modelArtifacts.modelTopology); + weightSpecs = JSON.stringify(modelArtifacts.weightSpecs); + modelArtifactsInfo = getModelArtifactsInfoForJSON(modelArtifacts); + try { + this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo)); + this.LS.setItem(this.keys.topology, topology); + this.LS.setItem(this.keys.weightSpecs, weightSpecs); + this.LS.setItem(this.keys.weightData, arrayBufferToBase64String(modelArtifacts.weightData)); + return [2, { modelArtifactsInfo: modelArtifactsInfo }]; + } + catch (err) { + for (key in this.keys) { + this.LS.removeItem(this.keys[key]); + } + throw new Error("Failed to save model '" + this.modelPath + "' to local storage: " + + "size quota being exceeded is a possible cause of this failure: " + + ("modelTopologyBytes=" + modelArtifactsInfo.modelTopologyBytes + ", ") + + ("weightSpecsBytes=" + modelArtifactsInfo.weightSpecsBytes + ", ") + + ("weightDataBytes=" + modelArtifactsInfo.weightDataBytes + ".")); + } + } + return [2]; + }); + }); + }; + BrowserLocalStorage.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var info, out, topology, weightSpecs, weightDataBase64; + return __generator(this, function (_a) { + info = JSON.parse(this.LS.getItem(this.keys.info)); + if (info == null) { + throw new Error("In local storage, there is no model with name '" + this.modelPath + "'"); + } + if (info.modelTopologyType !== 'JSON') { + throw new Error('BrowserLocalStorage does not support loading non-JSON model ' + + 'topology yet.'); + } + out = {}; + topology = JSON.parse(this.LS.getItem(this.keys.topology)); + if (topology == null) { + throw new Error("In local storage, the topology of model '" + this.modelPath + "' " + + "is missing."); + } + out.modelTopology = topology; + weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs)); + if (weightSpecs == null) { + throw new Error("In local storage, the weight specs of model '" + this.modelPath + "' " + + "are missing."); + } + out.weightSpecs = weightSpecs; + weightDataBase64 = this.LS.getItem(this.keys.weightData); + if (weightDataBase64 == null) { + throw new Error("In local storage, the binary weight values of model " + + ("'" + this.modelPath + "' are missing.")); + } + out.weightData = base64StringToArrayBuffer(weightDataBase64); + return [2, out]; + }); + }); + }; + BrowserLocalStorage.URL_SCHEME = 'localstorage://'; + return BrowserLocalStorage; + }()); + var localStorageRouter = function (url) { + if (!ENV.get('IS_BROWSER')) { + return null; + } + else { + if (url.startsWith(BrowserLocalStorage.URL_SCHEME)) { + return browserLocalStorage(url.slice(BrowserLocalStorage.URL_SCHEME.length)); + } + else { + return null; + } + } + }; + IORouterRegistry.registerSaveRouter(localStorageRouter); + IORouterRegistry.registerLoadRouter(localStorageRouter); + function browserLocalStorage(modelPath) { + return new BrowserLocalStorage(modelPath); + } + var BrowserLocalStorageManager = (function () { + function BrowserLocalStorageManager() { + assert(ENV.get('IS_BROWSER'), 'Current environment is not a web browser'); + assert(typeof window.localStorage !== 'undefined', 'Current browser does not appear to support localStorage'); + this.LS = window.localStorage; + } + BrowserLocalStorageManager.prototype.listModels = function () { + return __awaiter(this, void 0, void 0, function () { + var out, prefix, suffix, i, key, modelPath; + return __generator(this, function (_a) { + out = {}; + prefix = PATH_PREFIX + PATH_SEPARATOR; + suffix = PATH_SEPARATOR + INFO_SUFFIX; + for (i = 0; i < this.LS.length; ++i) { + key = this.LS.key(i); + if (key.startsWith(prefix) && key.endsWith(suffix)) { + modelPath = getModelPathFromKey(key); + out[modelPath] = JSON.parse(this.LS.getItem(key)); + } + } + return [2, out]; + }); + }); + }; + BrowserLocalStorageManager.prototype.removeModel = function (path) { + return __awaiter(this, void 0, void 0, function () { + var keys, info; + return __generator(this, function (_a) { + path = maybeStripScheme$1(path); + keys = getModelKeys(path); + if (this.LS.getItem(keys.info) == null) { + throw new Error("Cannot find model at path '" + path + "'"); + } + info = JSON.parse(this.LS.getItem(keys.info)); + this.LS.removeItem(keys.info); + this.LS.removeItem(keys.topology); + this.LS.removeItem(keys.weightSpecs); + this.LS.removeItem(keys.weightData); + return [2, info]; + }); + }); + }; + return BrowserLocalStorageManager; + }()); + if (ENV.get('IS_BROWSER')) { + try { + ModelStoreManagerRegistry.registerManager(BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager()); + } + catch (err) { + } + } + + var DEFAULT_FILE_NAME_PREFIX = 'model'; + var DEFAULT_JSON_EXTENSION_NAME = '.json'; + var DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin'; + var BrowserDownloads = (function () { + function BrowserDownloads(fileNamePrefix) { + if (!ENV.get('IS_BROWSER')) { + throw new Error('triggerDownloads() cannot proceed because the current environment ' + + 'is not a browser.'); + } + if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) { + fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length); + } + if (fileNamePrefix == null || fileNamePrefix.length === 0) { + fileNamePrefix = DEFAULT_FILE_NAME_PREFIX; + } + this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME; + this.weightDataFileName = + fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME; + } + BrowserDownloads.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + var weightsURL, weightsManifest, modelTopologyAndWeightManifest, modelTopologyAndWeightManifestURL, jsonAnchor, weightDataAnchor; + return __generator(this, function (_a) { + weightsURL = window.URL.createObjectURL(new Blob([modelArtifacts.weightData], { type: 'application/octet-stream' })); + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('DownloadTrigger.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + else { + weightsManifest = [{ + paths: ['./' + this.weightDataFileName], + weights: modelArtifacts.weightSpecs + }]; + modelTopologyAndWeightManifest = { + modelTopology: modelArtifacts.modelTopology, + weightsManifest: weightsManifest + }; + modelTopologyAndWeightManifestURL = window.URL.createObjectURL(new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: 'application/json' })); + jsonAnchor = this.jsonAnchor == null ? document.createElement('a') : + this.jsonAnchor; + jsonAnchor.download = this.modelTopologyFileName; + jsonAnchor.href = modelTopologyAndWeightManifestURL; + jsonAnchor.click(); + if (modelArtifacts.weightData != null) { + weightDataAnchor = this.weightDataAnchor == null ? + document.createElement('a') : + this.weightDataAnchor; + weightDataAnchor.download = this.weightDataFileName; + weightDataAnchor.href = weightsURL; + weightDataAnchor.click(); + } + return [2, { modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts) }]; + } + return [2]; + }); + }); + }; + BrowserDownloads.URL_SCHEME = 'downloads://'; + return BrowserDownloads; + }()); + var BrowserFiles = (function () { + function BrowserFiles(files) { + if (files == null || files.length < 1) { + throw new Error("When calling browserFiles, at least 1 file is required, " + + ("but received " + files)); + } + this.files = files; + } + BrowserFiles.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var jsonFile, weightFiles; + var _this = this; + return __generator(this, function (_a) { + jsonFile = this.files[0]; + weightFiles = this.files.slice(1); + return [2, new Promise(function (resolve, reject) { + var jsonReader = new FileReader(); + jsonReader.onload = function (event) { + var modelJSON = JSON.parse(event.target.result); + var modelTopology = modelJSON.modelTopology; + if (modelTopology == null) { + reject(new Error("modelTopology field is missing from file " + jsonFile.name)); + return; + } + if (weightFiles.length === 0) { + resolve({ modelTopology: modelTopology }); + } + var weightsManifest = modelJSON.weightsManifest; + if (weightsManifest == null) { + reject(new Error("weightManifest field is missing from file " + jsonFile.name)); + return; + } + var pathToFile; + try { + pathToFile = + _this.checkManifestAndWeightFiles(weightsManifest, weightFiles); + } + catch (err) { + reject(err); + return; + } + var weightSpecs = []; + var paths = []; + var perFileBuffers = []; + weightsManifest.forEach(function (weightsGroup) { + weightsGroup.paths.forEach(function (path) { + paths.push(path); + perFileBuffers.push(null); + }); + weightSpecs.push.apply(weightSpecs, weightsGroup.weights); + }); + weightsManifest.forEach(function (weightsGroup) { + weightsGroup.paths.forEach(function (path) { + var weightFileReader = new FileReader(); + weightFileReader.onload = function (event) { + var weightData = event.target.result; + var index = paths.indexOf(path); + perFileBuffers[index] = weightData; + if (perFileBuffers.indexOf(null) === -1) { + resolve({ + modelTopology: modelTopology, + weightSpecs: weightSpecs, + weightData: concatenateArrayBuffers(perFileBuffers), + }); + } + }; + weightFileReader.onerror = function (error) { + reject("Failed to weights data from file of path '" + path + "'."); + return; + }; + weightFileReader.readAsArrayBuffer(pathToFile[path]); + }); + }); + }; + jsonReader.onerror = function (error) { + reject("Failed to read model topology and weights manifest JSON " + + ("from file '" + jsonFile.name + "'. BrowserFiles supports loading ") + + "Keras-style tf.Model artifacts only."); + return; + }; + jsonReader.readAsText(jsonFile); + })]; + }); + }); + }; + BrowserFiles.prototype.checkManifestAndWeightFiles = function (manifest, files) { + var basenames = []; + var fileNames = files.map(function (file) { return basename(file.name); }); + var pathToFile = {}; + for (var _i = 0, manifest_1 = manifest; _i < manifest_1.length; _i++) { + var group = manifest_1[_i]; + group.paths.forEach(function (path) { + var pathBasename = basename(path); + if (basenames.indexOf(pathBasename) !== -1) { + throw new Error("Duplicate file basename found in weights manifest: " + + ("'" + pathBasename + "'")); + } + basenames.push(pathBasename); + if (fileNames.indexOf(pathBasename) === -1) { + throw new Error("Weight file with basename '" + pathBasename + "' is not provided."); + } + else { + pathToFile[path] = files[fileNames.indexOf(pathBasename)]; + } + }); + } + if (basenames.length !== files.length) { + throw new Error("Mismatch in the number of files in weights manifest " + + ("(" + basenames.length + ") and the number of weight files provided ") + + ("(" + files.length + ").")); + } + return pathToFile; + }; + return BrowserFiles; + }()); + var browserDownloadsRouter = function (url) { + if (!ENV.get('IS_BROWSER')) { + return null; + } + else { + if (url.startsWith(BrowserDownloads.URL_SCHEME)) { + return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length)); + } + else { + return null; + } + } + }; + IORouterRegistry.registerSaveRouter(browserDownloadsRouter); + function browserDownloads(fileNamePrefix) { + if (fileNamePrefix === void 0) { fileNamePrefix = 'model'; } + return new BrowserDownloads(fileNamePrefix); + } + function browserFiles(files) { + return new BrowserFiles(files); + } + + function loadWeightsAsArrayBuffer(fetchURLs, requestOptions) { + return __awaiter(this, void 0, void 0, function () { + var requests, responses, buffers; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + requests = fetchURLs.map(function (fetchURL) { return fetch(fetchURL, requestOptions); }); + return [4, Promise.all(requests)]; + case 1: + responses = _a.sent(); + return [4, Promise.all(responses.map(function (response) { return response.arrayBuffer(); }))]; + case 2: + buffers = _a.sent(); + return [2, buffers]; + } + }); + }); + } + function loadWeights(manifest, filePathPrefix, weightNames, requestOptions) { + if (filePathPrefix === void 0) { filePathPrefix = ''; } + return __awaiter(this, void 0, void 0, function () { + var groupIndicesToFetchMap, groupWeightsToFetch, weightsFound, allManifestWeightNames, weightsNotFound, groupIndicesToFetch, fetchUrls, buffers, weightsTensorMap, bufferIndexOffset; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + groupIndicesToFetchMap = manifest.map(function () { return false; }); + groupWeightsToFetch = {}; + weightsFound = weightNames != null ? weightNames.map(function () { return false; }) : []; + allManifestWeightNames = []; + manifest.forEach(function (manifestGroupConfig, groupIndex) { + var groupOffset = 0; + manifestGroupConfig.weights.forEach(function (weightsEntry) { + var rawDtype = ('quantization' in weightsEntry) ? + weightsEntry.quantization.dtype : + weightsEntry.dtype; + var weightsBytes = DTYPE_VALUE_SIZE_MAP[rawDtype] * + sizeFromShape(weightsEntry.shape); + var enqueueWeightsForFetchingFn = function () { + groupIndicesToFetchMap[groupIndex] = true; + if (groupWeightsToFetch[groupIndex] == null) { + groupWeightsToFetch[groupIndex] = []; + } + groupWeightsToFetch[groupIndex].push({ + manifestEntry: weightsEntry, + groupOffset: groupOffset, + sizeBytes: weightsBytes + }); + }; + if (weightNames != null) { + weightNames.forEach(function (weightName, weightIndex) { + if (weightName === weightsEntry.name) { + enqueueWeightsForFetchingFn(); + weightsFound[weightIndex] = true; + } + }); + } + else { + enqueueWeightsForFetchingFn(); + } + allManifestWeightNames.push(weightsEntry.name); + groupOffset += weightsBytes; + }); + }); + if (!weightsFound.every(function (found) { return found; })) { + weightsNotFound = weightNames.filter(function (weight, i) { return !weightsFound[i]; }); + throw new Error("Could not find weights in manifest with names: " + + (weightsNotFound.join(', ') + ". \n") + + "Manifest JSON has weights with names: " + + (allManifestWeightNames.join(', ') + ".")); + } + groupIndicesToFetch = groupIndicesToFetchMap.reduce(function (accumulator, shouldFetch, i) { + if (shouldFetch) { + accumulator.push(i); + } + return accumulator; + }, []); + fetchUrls = []; + groupIndicesToFetch.forEach(function (i) { + manifest[i].paths.forEach(function (filepath) { + var fetchUrl = filePathPrefix + + (!filePathPrefix.endsWith('/') ? '/' : '') + filepath; + fetchUrls.push(fetchUrl); + }); + }); + return [4, loadWeightsAsArrayBuffer(fetchUrls, requestOptions)]; + case 1: + buffers = _a.sent(); + weightsTensorMap = {}; + bufferIndexOffset = 0; + groupIndicesToFetch.forEach(function (i) { + var numBuffers = manifest[i].paths.length; + var groupBytes = 0; + for (var i_1 = 0; i_1 < numBuffers; i_1++) { + groupBytes += buffers[bufferIndexOffset + i_1].byteLength; + } + var groupBuffer = new ArrayBuffer(groupBytes); + var groupByteBuffer = new Uint8Array(groupBuffer); + var groupBufferOffset = 0; + for (var i_2 = 0; i_2 < numBuffers; i_2++) { + var buffer$$1 = new Uint8Array(buffers[bufferIndexOffset + i_2]); + groupByteBuffer.set(buffer$$1, groupBufferOffset); + groupBufferOffset += buffer$$1.byteLength; + } + var weightsEntries = groupWeightsToFetch[i]; + weightsEntries.forEach(function (weightsEntry) { + var byteBuffer = groupBuffer.slice(weightsEntry.groupOffset, weightsEntry.groupOffset + weightsEntry.sizeBytes); + var typedArray; + var dtype = weightsEntry.manifestEntry.dtype; + if ('quantization' in weightsEntry.manifestEntry) { + var quantization_1 = weightsEntry.manifestEntry.quantization; + if (quantization_1.dtype !== 'uint8' && quantization_1.dtype !== 'uint16') { + throw new Error("Weight " + weightsEntry.manifestEntry.name + " has unknown " + + ("quantization dtype " + quantization_1.dtype + ".")); + } + var quantizedArray = (quantization_1.dtype === 'uint8') ? + new Uint8Array(byteBuffer) : + new Uint16Array(byteBuffer); + if (dtype === 'float32') { + typedArray = Float32Array.from(quantizedArray, function (v) { return v * quantization_1.scale + quantization_1.min; }); + } + else if (dtype === 'int32') { + typedArray = Int32Array.from(quantizedArray, function (v) { return Math.round(v * quantization_1.scale + quantization_1.min); }); + } + else { + throw new Error("Weight " + weightsEntry.manifestEntry.name + " has a dtype not " + + ("supported by quantization: " + dtype)); + } + } + else { + if (dtype === 'float32') { + typedArray = new Float32Array(byteBuffer); + } + else if (dtype === 'int32') { + typedArray = new Int32Array(byteBuffer); + } + else if (dtype === 'bool') { + typedArray = new Uint8Array(byteBuffer); + } + else { + throw new Error("Weight " + weightsEntry.manifestEntry.name + " has unknown dtype " + + (dtype + ".")); + } + } + var weightName = weightsEntry.manifestEntry.name; + if (weightsTensorMap[weightName] != null) { + throw new Error("Duplicate weight with name " + weightName + ". " + + "Please make sure weights names are unique in the manifest JSON."); + } + weightsTensorMap[weightName] = tensor(typedArray, weightsEntry.manifestEntry.shape, weightsEntry.manifestEntry.dtype); + }); + bufferIndexOffset += numBuffers; + }); + return [2, weightsTensorMap]; + } + }); + }); + } + + var BrowserHTTPRequest = (function () { + function BrowserHTTPRequest(path, requestInit) { + this.DEFAULT_METHOD = 'POST'; + if (typeof fetch === 'undefined') { + throw new Error('browserHTTPRequest is not supported outside the web browser without a fetch polyfill.'); + } + assert(path != null && path.length > 0, 'URL path for browserHTTPRequest must not be null, undefined or ' + + 'empty.'); + this.path = path; + if (requestInit != null && requestInit.body != null) { + throw new Error('requestInit is expected to have no pre-existing body, but has one.'); + } + this.requestInit = requestInit || {}; + } + BrowserHTTPRequest.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + var init, weightsManifest, modelTopologyAndWeightManifest, response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserHTTPRequest.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + init = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit); + init.body = new FormData(); + weightsManifest = [{ + paths: ['./model.weights.bin'], + weights: modelArtifacts.weightSpecs, + }]; + modelTopologyAndWeightManifest = { + modelTopology: modelArtifacts.modelTopology, + weightsManifest: weightsManifest + }; + init.body.append('model.json', new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: 'application/json' }), 'model.json'); + if (modelArtifacts.weightData != null) { + init.body.append('model.weights.bin', new Blob([modelArtifacts.weightData], { type: 'application/octet-stream' }), 'model.weights.bin'); + } + return [4, fetch(this.path, init)]; + case 1: + response = _a.sent(); + if (response.status === 200) { + return [2, { + modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts), + responses: [response], + }]; + } + else { + throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status " + + (response.status + ".")); + } + return [2]; + } + }); + }); + }; + BrowserHTTPRequest.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var modelConfigRequest, modelConfig, modelTopology, weightsManifest, weightSpecs, weightData, weightsManifest_2, _i, weightsManifest_1, entry, pathPrefix_1, fetchURLs_1, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: return [4, fetch(this.path, this.requestInit)]; + case 1: + modelConfigRequest = _b.sent(); + return [4, modelConfigRequest.json()]; + case 2: + modelConfig = _b.sent(); + modelTopology = modelConfig['modelTopology']; + weightsManifest = modelConfig['weightsManifest']; + if (modelTopology == null && weightsManifest == null) { + throw new Error("The JSON from HTTP path " + this.path + " contains neither model " + + "topology or manifest for weights."); + } + if (!(weightsManifest != null)) return [3, 4]; + weightsManifest_2 = modelConfig['weightsManifest']; + weightSpecs = []; + for (_i = 0, weightsManifest_1 = weightsManifest_2; _i < weightsManifest_1.length; _i++) { + entry = weightsManifest_1[_i]; + weightSpecs.push.apply(weightSpecs, entry.weights); + } + pathPrefix_1 = this.path.substring(0, this.path.lastIndexOf('/')); + if (!pathPrefix_1.endsWith('/')) { + pathPrefix_1 = pathPrefix_1 + '/'; + } + fetchURLs_1 = []; + weightsManifest_2.forEach(function (weightsGroup) { + weightsGroup.paths.forEach(function (path) { + fetchURLs_1.push(pathPrefix_1 + path); + }); + }); + _a = concatenateArrayBuffers; + return [4, loadWeightsAsArrayBuffer(fetchURLs_1, this.requestInit)]; + case 3: + weightData = _a.apply(void 0, [_b.sent()]); + _b.label = 4; + case 4: return [2, { modelTopology: modelTopology, weightSpecs: weightSpecs, weightData: weightData }]; + } + }); + }); + }; + BrowserHTTPRequest.URL_SCHEMES = ['http://', 'https://']; + return BrowserHTTPRequest; + }()); + var httpRequestRouter = function (url) { + if (typeof fetch === 'undefined') { + return null; + } + else { + for (var _i = 0, _a = BrowserHTTPRequest.URL_SCHEMES; _i < _a.length; _i++) { + var scheme = _a[_i]; + if (url.startsWith(scheme)) { + return browserHTTPRequest(url); + } + } + return null; + } + }; + IORouterRegistry.registerSaveRouter(httpRequestRouter); + IORouterRegistry.registerLoadRouter(httpRequestRouter); + function browserHTTPRequest(path, requestInit) { + return new BrowserHTTPRequest(path, requestInit); + } + + var PassthroughLoader = (function () { + function PassthroughLoader(modelTopology, weightSpecs, weightData) { + this.modelTopology = modelTopology; + this.weightSpecs = weightSpecs; + this.weightData = weightData; + } + PassthroughLoader.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var result; + return __generator(this, function (_a) { + result = {}; + if (this.modelTopology != null) { + result = __assign({ modelTopology: this.modelTopology }, result); + } + if (this.weightSpecs != null && this.weightSpecs.length > 0) { + result = __assign({ weightSpecs: this.weightSpecs }, result); + } + if (this.weightData != null && this.weightData.byteLength > 0) { + result = __assign({ weightData: this.weightData }, result); + } + return [2, result]; + }); + }); + }; + return PassthroughLoader; + }()); + var PassthroughSaver = (function () { + function PassthroughSaver(saveHandler) { + this.saveHandler = saveHandler; + } + PassthroughSaver.prototype.save = function (modelArtifacts) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, this.saveHandler(modelArtifacts)]; + }); + }); + }; + return PassthroughSaver; + }()); + function fromMemory(modelTopology, weightSpecs, weightData) { + return new PassthroughLoader(modelTopology, weightSpecs, weightData); + } + function withSaveHandler(saveHandler) { + return new PassthroughSaver(saveHandler); + } + + var registerSaveRouter = IORouterRegistry.registerSaveRouter; + var registerLoadRouter = IORouterRegistry.registerLoadRouter; + var getSaveHandlers = IORouterRegistry.getSaveHandlers; + var getLoadHandlers = IORouterRegistry.getLoadHandlers; + + var io = /*#__PURE__*/Object.freeze({ + browserFiles: browserFiles, + browserHTTPRequest: browserHTTPRequest, + concatenateArrayBuffers: concatenateArrayBuffers, + decodeWeights: decodeWeights, + encodeWeights: encodeWeights, + fromMemory: fromMemory, + getLoadHandlers: getLoadHandlers, + getModelArtifactsInfoForJSON: getModelArtifactsInfoForJSON, + getSaveHandlers: getSaveHandlers, + loadWeights: loadWeights, + registerLoadRouter: registerLoadRouter, + registerSaveRouter: registerSaveRouter, + withSaveHandler: withSaveHandler, + copyModel: copyModel, + listModels: listModels, + moveModel: moveModel, + removeModel: removeModel + }); + + var Serializable = (function () { + function Serializable() { + } + Serializable.prototype.getClassName = function () { + return this.constructor + .className; + }; + Serializable.fromConfig = function (cls, config) { + return new cls(config); + }; + return Serializable; + }()); + var SerializationMap = (function () { + function SerializationMap() { + this.classNameMap = {}; + } + SerializationMap.getMap = function () { + if (SerializationMap.instance == null) { + SerializationMap.instance = new SerializationMap(); + } + return SerializationMap.instance; + }; + SerializationMap.register = function (cls) { + SerializationMap.getMap().classNameMap[cls.className] = + [cls, cls.fromConfig]; + }; + return SerializationMap; + }()); + + var serialization = /*#__PURE__*/Object.freeze({ + Serializable: Serializable, + SerializationMap: SerializationMap + }); + + var WEBGL_ENVS = { + 'HAS_WEBGL': true + }; + var NODE_ENVS = { + 'IS_NODE': true + }; + var CHROME_ENVS = { + 'IS_CHROME': true + }; + var BROWSER_ENVS = { + 'IS_BROWSER': true + }; + var CPU_ENVS = { + 'HAS_WEBGL': false + }; + var ALL_ENVS = {}; + function expectArraysClose(actual, expected, epsilon) { + if (epsilon == null) { + epsilon = ENV.get('TEST_EPSILON'); + } + if (!(actual instanceof Tensor) && !(expected instanceof Tensor)) { + var aType = actual.constructor.name; + var bType = expected.constructor.name; + if (aType !== bType) { + throw new Error("Arrays are of different type actual: " + aType + " " + + ("vs expected: " + bType)); + } + } + else if (actual instanceof Tensor && expected instanceof Tensor) { + if (actual.dtype !== expected.dtype) { + throw new Error("Arrays are of different type actual: " + actual.dtype + " " + + ("vs expected: " + expected.dtype + ".")); + } + if (!arraysEqual(actual.shape, expected.shape)) { + throw new Error("Arrays are of different shape actual: " + actual.shape + " " + + ("vs expected: " + expected.shape + ".")); + } + } + var actualValues; + var expectedValues; + if (actual instanceof Tensor) { + actualValues = actual.dataSync(); + } + else { + actualValues = actual; + } + if (expected instanceof Tensor) { + expectedValues = expected.dataSync(); + } + else { + expectedValues = expected; + } + if (actualValues.length !== expectedValues.length) { + throw new Error("Arrays have different lengths actual: " + actualValues.length + " vs " + + ("expected: " + expectedValues.length + ".\n") + + ("Actual: " + actualValues + ".\n") + + ("Expected: " + expectedValues + ".")); + } + for (var i = 0; i < expectedValues.length; ++i) { + var a = actualValues[i]; + var e = expectedValues[i]; + if (!areClose(a, Number(e), epsilon)) { + throw new Error("Arrays differ: actual[" + i + "] = " + a + ", expected[" + i + "] = " + e + ".\n" + + ("Actual: " + actualValues + ".\n") + + ("Expected: " + expectedValues + ".")); + } + } + } + function expectPromiseToFail(fn, done) { + fn().then(function () { return done.fail(); }, function () { return done(); }); + } + function expectArraysEqual(actual, expected) { + return expectArraysClose(actual, expected, 0); + } + function expectNumbersClose(a, e, epsilon) { + if (epsilon == null) { + epsilon = ENV.get('TEST_EPSILON'); + } + if (!areClose(a, e, epsilon)) { + throw new Error("Numbers differ: actual === " + a + ", expected === " + e); + } + } + function areClose(a, e, epsilon) { + if (isNaN(a) && isNaN(e)) { + return true; + } + if (isNaN(a) || isNaN(e) || Math.abs(a - e) > epsilon) { + return false; + } + return true; + } + function expectValuesInRange(actual, low, high) { + var actualVals; + if (actual instanceof Tensor) { + actualVals = actual.dataSync(); + } + else { + actualVals = actual; + } + for (var i = 0; i < actualVals.length; i++) { + if (actualVals[i] < low || actualVals[i] > high) { + throw new Error("Value out of range:" + actualVals[i] + " low: " + low + ", high: " + high); + } + } + } + function expectArrayBuffersEqual(actual, expected) { + expect(new Float32Array(actual)).toEqual(new Float32Array(expected)); + } + + var test_util = /*#__PURE__*/Object.freeze({ + WEBGL_ENVS: WEBGL_ENVS, + NODE_ENVS: NODE_ENVS, + CHROME_ENVS: CHROME_ENVS, + BROWSER_ENVS: BROWSER_ENVS, + CPU_ENVS: CPU_ENVS, + ALL_ENVS: ALL_ENVS, + expectArraysClose: expectArraysClose, + expectPromiseToFail: expectPromiseToFail, + expectArraysEqual: expectArraysEqual, + expectNumbersClose: expectNumbersClose, + expectValuesInRange: expectValuesInRange, + expectArrayBuffersEqual: expectArrayBuffersEqual + }); + + var version = '0.12.8'; + + + + var webgl = /*#__PURE__*/Object.freeze({ + gpgpu_util: gpgpu_util, + webgl_util: webgl_util, + MathBackendWebGL: MathBackendWebGL, + GPGPUContext: GPGPUContext + }); + + var Optimizer = (function (_super) { + __extends(Optimizer, _super); + function Optimizer() { + return _super !== null && _super.apply(this, arguments) || this; + } + Optimizer.prototype.minimize = function (f, returnCost, varList) { + if (returnCost === void 0) { returnCost = false; } + var _a = this.computeGradients(f, varList), value = _a.value, grads$$1 = _a.grads; + this.applyGradients(grads$$1); + var varNames = Object.keys(grads$$1); + varNames.forEach(function (varName) { return grads$$1[varName].dispose(); }); + if (returnCost) { + return value; + } + else { + value.dispose(); + return null; + } + }; + Optimizer.prototype.computeGradients = function (f, varList) { + return variableGrads(f, varList); + }; + return Optimizer; + }(Serializable)); + + var DEFAULT_FLOAT32_EPSILON = 1e-8; + var DEFAULT_FLOAT16_EPSILON = 1e-4; + function getOptimizerDefaultEpsilonValue() { + if (ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) { + return DEFAULT_FLOAT32_EPSILON; + } + return DEFAULT_FLOAT16_EPSILON; + } + + var AdadeltaOptimizer = (function (_super) { + __extends(AdadeltaOptimizer, _super); + function AdadeltaOptimizer(learningRate, rho, epsilon) { + if (epsilon === void 0) { epsilon = null; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.rho = rho; + _this.epsilon = epsilon; + _this.accumulatedGrads = {}; + _this.accumulatedUpdates = {}; + _this.c = keep(scalar(-learningRate)); + _this.rhoScalar = keep(scalar(rho)); + _this.oneMinusRho = keep(scalar(1 - rho)); + if (epsilon === null) { + epsilon = getOptimizerDefaultEpsilonValue(); + } + _this.epsilonScalar = keep(scalar(epsilon)); + return _this; + } + AdadeltaOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var _loop_1 = function (variableName) { + var value = ENV.engine.registeredVariables[variableName]; + if (this_1.accumulatedGrads[variableName] == null) { + var trainable_1 = false; + tidy(function () { + _this.accumulatedGrads[variableName] = + zerosLike(value).variable(trainable_1); + }); + } + if (this_1.accumulatedUpdates[variableName] == null) { + var trainable_2 = false; + tidy(function () { + _this.accumulatedUpdates[variableName] = + zerosLike(value).variable(trainable_2); + }); + } + var gradient = variableGradients[variableName]; + var accumulatedGrad = this_1.accumulatedGrads[variableName]; + var accumulatedUpdate = this_1.accumulatedUpdates[variableName]; + tidy(function () { + var newAccumulatedGrad = _this.rhoScalar.mul(accumulatedGrad) + .add(_this.oneMinusRho.mul(gradient.square())); + var updates = accumulatedUpdate.add(_this.epsilonScalar) + .sqrt() + .div(accumulatedGrad.add(_this.epsilonScalar).sqrt()) + .mul(gradient); + var newAccumulatedUpdate = _this.rhoScalar.mul(accumulatedUpdate) + .add(_this.oneMinusRho.mul(updates.square())); + _this.accumulatedGrads[variableName].assign(newAccumulatedGrad); + _this.accumulatedUpdates[variableName].assign(newAccumulatedUpdate); + var newValue = _this.c.mul(updates).add(value); + value.assign(newValue); + }); + }; + var this_1 = this; + for (var variableName in variableGradients) { + _loop_1(variableName); + } + }; + AdadeltaOptimizer.prototype.dispose = function () { + var _this = this; + this.c.dispose(); + this.epsilonScalar.dispose(); + this.rhoScalar.dispose(); + this.oneMinusRho.dispose(); + if (this.accumulatedUpdates != null) { + Object.keys(this.accumulatedUpdates) + .forEach(function (name) { return _this.accumulatedUpdates[name].dispose(); }); + Object.keys(this.accumulatedGrads) + .forEach(function (name) { return _this.accumulatedGrads[name].dispose(); }); + } + }; + AdadeltaOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + rho: this.rho, + epsilon: this.epsilon + }; + }; + AdadeltaOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.rho, config.epsilon); + }; + AdadeltaOptimizer.className = 'AdadeltaOptimizer'; + return AdadeltaOptimizer; + }(Optimizer)); + SerializationMap.register(AdadeltaOptimizer); + + var AdagradOptimizer = (function (_super) { + __extends(AdagradOptimizer, _super); + function AdagradOptimizer(learningRate, initialAccumulatorValue) { + if (initialAccumulatorValue === void 0) { initialAccumulatorValue = 0.1; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.initialAccumulatorValue = initialAccumulatorValue; + _this.accumulatedGrads = {}; + _this.c = keep(scalar(-learningRate)); + var epsilon = getOptimizerDefaultEpsilonValue(); + _this.epsilon = keep(scalar(epsilon)); + return _this; + } + AdagradOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var _loop_1 = function (variableName) { + var value = ENV.engine.registeredVariables[variableName]; + if (this_1.accumulatedGrads[variableName] == null) { + var trainable_1 = false; + tidy(function () { + _this.accumulatedGrads[variableName] = + fill(value.shape, _this.initialAccumulatorValue) + .variable(trainable_1); + }); + } + var gradient = variableGradients[variableName]; + var accumulatedGrad = this_1.accumulatedGrads[variableName]; + tidy(function () { + var newAccumulatedGrad = accumulatedGrad.add(gradient.square()); + _this.accumulatedGrads[variableName].assign(newAccumulatedGrad); + var newValue = _this.c + .mul(gradient.div(newAccumulatedGrad.add(_this.epsilon).sqrt())) + .add(value); + value.assign(newValue); + }); + }; + var this_1 = this; + for (var variableName in variableGradients) { + _loop_1(variableName); + } + }; + AdagradOptimizer.prototype.dispose = function () { + var _this = this; + this.epsilon.dispose(); + this.c.dispose(); + if (this.accumulatedGrads != null) { + Object.keys(this.accumulatedGrads) + .forEach(function (name) { return _this.accumulatedGrads[name].dispose(); }); + } + }; + AdagradOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + initialAccumulatorValue: this.initialAccumulatorValue, + }; + }; + AdagradOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.initialAccumulatorValue); + }; + AdagradOptimizer.className = 'AdagradOptimizer'; + return AdagradOptimizer; + }(Optimizer)); + SerializationMap.register(AdagradOptimizer); + + var AdamOptimizer = (function (_super) { + __extends(AdamOptimizer, _super); + function AdamOptimizer(learningRate, beta1, beta2, epsilon) { + if (epsilon === void 0) { epsilon = null; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.beta1 = beta1; + _this.beta2 = beta2; + _this.epsilon = epsilon; + _this.accumulatedFirstMoment = {}; + _this.accumulatedSecondMoment = {}; + _this.c = keep(scalar(-learningRate)); + _this.beta1Scalar = keep(scalar(beta1)); + _this.beta2Scalar = keep(scalar(beta2)); + tidy(function () { + _this.accBeta1 = scalar(beta1).variable(); + _this.accBeta2 = scalar(beta2).variable(); + }); + _this.oneMinusBeta1 = keep(scalar(1 - beta1)); + _this.oneMinusBeta2 = keep(scalar(1 - beta2)); + _this.one = keep(scalar(1)); + if (epsilon === null) { + epsilon = getOptimizerDefaultEpsilonValue(); + } + _this.epsScalar = keep(scalar(epsilon)); + return _this; + } + AdamOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + tidy(function () { + var oneMinusAccBeta1 = _this.one.sub(_this.accBeta1); + var oneMinusAccBeta2 = _this.one.sub(_this.accBeta2); + for (var variableName in variableGradients) { + var value = ENV.engine.registeredVariables[variableName]; + if (_this.accumulatedFirstMoment[variableName] == null) { + var trainable = false; + _this.accumulatedFirstMoment[variableName] = + zerosLike(value).variable(trainable); + } + if (_this.accumulatedSecondMoment[variableName] == null) { + var trainable = false; + _this.accumulatedSecondMoment[variableName] = + zerosLike(value).variable(trainable); + } + var gradient = variableGradients[variableName]; + var firstMoment = _this.accumulatedFirstMoment[variableName]; + var secondMoment = _this.accumulatedSecondMoment[variableName]; + var newFirstMoment = _this.beta1Scalar.mul(firstMoment) + .add(_this.oneMinusBeta1.mul(gradient)); + var newSecondMoment = _this.beta2Scalar.mul(secondMoment) + .add(_this.oneMinusBeta2.mul(gradient.square())); + var biasCorrectedFirstMoment = newFirstMoment.div(oneMinusAccBeta1); + var biasCorrectedSecondMoment = newSecondMoment.div(oneMinusAccBeta2); + _this.accumulatedFirstMoment[variableName].assign(newFirstMoment); + _this.accumulatedSecondMoment[variableName].assign(newSecondMoment); + var newValue = _this.c + .mul(biasCorrectedFirstMoment.div(_this.epsScalar.add(biasCorrectedSecondMoment.sqrt()))) + .add(value); + value.assign(newValue); + } + _this.accBeta1.assign(_this.accBeta1.mul(_this.beta1Scalar)); + _this.accBeta2.assign(_this.accBeta2.mul(_this.beta2Scalar)); + }); + }; + AdamOptimizer.prototype.dispose = function () { + var _this = this; + this.c.dispose(); + this.epsScalar.dispose(); + this.beta1Scalar.dispose(); + this.beta2Scalar.dispose(); + this.accBeta1.dispose(); + this.accBeta2.dispose(); + this.oneMinusBeta1.dispose(); + this.oneMinusBeta2.dispose(); + this.one.dispose(); + if (this.accumulatedFirstMoment != null) { + Object.keys(this.accumulatedFirstMoment) + .forEach(function (name) { return _this.accumulatedFirstMoment[name].dispose(); }); + } + if (this.accumulatedSecondMoment != null) { + Object.keys(this.accumulatedSecondMoment) + .forEach(function (name) { return _this.accumulatedSecondMoment[name].dispose(); }); + } + }; + AdamOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + beta1: this.beta1, + beta2: this.beta2, + epsilon: this.epsilon, + }; + }; + AdamOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.beta1, config.beta2, config.epsilon); + }; + AdamOptimizer.className = 'AdamOptimizer'; + return AdamOptimizer; + }(Optimizer)); + SerializationMap.register(AdamOptimizer); + + var AdamaxOptimizer = (function (_super) { + __extends(AdamaxOptimizer, _super); + function AdamaxOptimizer(learningRate, beta1, beta2, epsilon, decay) { + if (epsilon === void 0) { epsilon = null; } + if (decay === void 0) { decay = 0.0; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.beta1 = beta1; + _this.beta2 = beta2; + _this.epsilon = epsilon; + _this.decay = decay; + _this.accumulatedFirstMoment = {}; + _this.accumulatedWeightedInfNorm = {}; + _this.c = keep(scalar(-learningRate)); + _this.beta1Scalar = keep(scalar(beta1)); + _this.beta2Scalar = keep(scalar(beta2)); + _this.decayScalar = keep(scalar(decay)); + tidy(function () { + _this.iteration = scalar(0).variable(); + _this.accBeta1 = scalar(beta1).variable(); + }); + _this.oneMinusBeta1 = keep(scalar(1 - beta1)); + _this.one = keep(scalar(1)); + if (epsilon === null) { + epsilon = getOptimizerDefaultEpsilonValue(); + } + _this.epsScalar = keep(scalar(epsilon)); + return _this; + } + AdamaxOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + tidy(function () { + var oneMinusAccBeta1 = _this.one.sub(_this.accBeta1); + var lr = _this.c.div(_this.one.add(_this.decayScalar.mul(_this.iteration))); + for (var variableName in variableGradients) { + var value = ENV.engine.registeredVariables[variableName]; + if (_this.accumulatedFirstMoment[variableName] == null) { + var trainable = false; + _this.accumulatedFirstMoment[variableName] = + zerosLike(value).variable(trainable); + } + if (_this.accumulatedWeightedInfNorm[variableName] == null) { + var trainable = false; + _this.accumulatedWeightedInfNorm[variableName] = + zerosLike(value).variable(trainable); + } + var gradient = variableGradients[variableName]; + var firstMoment = _this.accumulatedFirstMoment[variableName]; + var weightedInfNorm = _this.accumulatedWeightedInfNorm[variableName]; + var newFirstMoment = _this.beta1Scalar.mul(firstMoment) + .add(_this.oneMinusBeta1.mul(gradient)); + var ut0 = _this.beta2Scalar.mul(weightedInfNorm); + var ut1 = gradient.abs(); + var newWeightedInfNorm = ut0.maximum(ut1); + _this.accumulatedFirstMoment[variableName].assign(newFirstMoment); + _this.accumulatedWeightedInfNorm[variableName].assign(newWeightedInfNorm); + var newValue = lr.div(oneMinusAccBeta1) + .mul(newFirstMoment.div(_this.epsScalar.add(newWeightedInfNorm))) + .add(value); + value.assign(newValue); + } + _this.iteration.assign(_this.iteration.add(_this.one)); + _this.accBeta1.assign(_this.accBeta1.mul(_this.beta1Scalar)); + }); + }; + AdamaxOptimizer.prototype.dispose = function () { + var _this = this; + this.c.dispose(); + this.epsScalar.dispose(); + this.accBeta1.dispose(); + this.beta1Scalar.dispose(); + this.beta2Scalar.dispose(); + this.oneMinusBeta1.dispose(); + this.decayScalar.dispose(); + this.iteration.dispose(); + this.one.dispose(); + if (this.accumulatedFirstMoment != null) { + Object.keys(this.accumulatedFirstMoment) + .forEach(function (name) { return _this.accumulatedFirstMoment[name].dispose(); }); + } + if (this.accumulatedWeightedInfNorm != null) { + Object.keys(this.accumulatedWeightedInfNorm) + .forEach(function (name) { return _this.accumulatedWeightedInfNorm[name].dispose(); }); + } + }; + AdamaxOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + beta1: this.beta1, + beta2: this.beta2, + epsilon: this.epsilon, + decay: this.decay + }; + }; + AdamaxOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.beta1, config.beta2, config.epsilon, config.decay); + }; + AdamaxOptimizer.className = 'AdamaxOptimizer'; + return AdamaxOptimizer; + }(Optimizer)); + SerializationMap.register(AdamaxOptimizer); + + var SGDOptimizer = (function (_super) { + __extends(SGDOptimizer, _super); + function SGDOptimizer(learningRate) { + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.setLearningRate(learningRate); + return _this; + } + SGDOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var varNames = Object.keys(variableGradients); + varNames.forEach(function (varName) { + var gradient = variableGradients[varName]; + var value = ENV.engine.registeredVariables[varName]; + tidy(function () { + var newValue = _this.c.mul(gradient).add(value); + value.assign(newValue); + }); + }); + }; + SGDOptimizer.prototype.setLearningRate = function (learningRate) { + this.learningRate = learningRate; + if (this.c != null) { + this.c.dispose(); + } + this.c = keep(scalar(-learningRate)); + }; + SGDOptimizer.prototype.dispose = function () { + this.c.dispose(); + }; + SGDOptimizer.prototype.getConfig = function () { + return { learningRate: this.learningRate }; + }; + SGDOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate); + }; + SGDOptimizer.className = 'SGDOptimizer'; + return SGDOptimizer; + }(Optimizer)); + SerializationMap.register(SGDOptimizer); + + var MomentumOptimizer = (function (_super) { + __extends(MomentumOptimizer, _super); + function MomentumOptimizer(learningRate, momentum, useNesterov) { + if (useNesterov === void 0) { useNesterov = false; } + var _this = _super.call(this, learningRate) || this; + _this.learningRate = learningRate; + _this.momentum = momentum; + _this.useNesterov = useNesterov; + _this.m = scalar(_this.momentum); + _this.accumulations = {}; + return _this; + } + MomentumOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var _loop_1 = function (variableName) { + var value = ENV.engine.registeredVariables[variableName]; + if (this_1.accumulations[variableName] == null) { + var trainable_1 = false; + tidy(function () { + _this.accumulations[variableName] = + zerosLike(value).variable(trainable_1); + }); + } + var accumulation = this_1.accumulations[variableName]; + var gradient = variableGradients[variableName]; + tidy(function () { + var newValue; + var newAccumulation = _this.m.mul(accumulation).add(gradient); + if (_this.useNesterov) { + newValue = + _this.c.mul(gradient.add(newAccumulation.mul(_this.m))).add(value); + } + else { + newValue = _this.c.mul(newAccumulation).add(value); + } + _this.accumulations[variableName].assign(newAccumulation); + value.assign(newValue); + }); + }; + var this_1 = this; + for (var variableName in variableGradients) { + _loop_1(variableName); + } + }; + MomentumOptimizer.prototype.dispose = function () { + _super.prototype.dispose.call(this); + this.m.dispose(); + if (this.accumulations != null) { + for (var variableName in this.accumulations) { + this.accumulations[variableName].dispose(); + } + } + }; + MomentumOptimizer.prototype.setMomentum = function (momentum) { + this.momentum = momentum; + }; + MomentumOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + momentum: this.momentum, + useNesterov: this.useNesterov + }; + }; + MomentumOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.momentum, config.useNesterov); + }; + MomentumOptimizer.className = 'MomentumOptimizer'; + return MomentumOptimizer; + }(SGDOptimizer)); + SerializationMap.register(MomentumOptimizer); + + var RMSPropOptimizer = (function (_super) { + __extends(RMSPropOptimizer, _super); + function RMSPropOptimizer(learningRate, decay, momentum, epsilon, centered) { + if (decay === void 0) { decay = 0.9; } + if (momentum === void 0) { momentum = 0.0; } + if (epsilon === void 0) { epsilon = null; } + if (centered === void 0) { centered = false; } + var _this = _super.call(this) || this; + _this.learningRate = learningRate; + _this.decay = decay; + _this.momentum = momentum; + _this.epsilon = epsilon; + _this.accumulatedMeanSquares = {}; + _this.accumulatedMeanGrads = {}; + _this.accumulatedMoments = {}; + _this.c = keep(scalar(learningRate)); + _this.decayScalar = keep(scalar(decay)); + _this.momentumScalar = keep(scalar(momentum)); + _this.oneMinusDecay = keep(scalar(1 - decay)); + _this.centered = centered; + if (epsilon === null) { + epsilon = getOptimizerDefaultEpsilonValue(); + } + _this.epsilonScalar = keep(scalar(epsilon)); + return _this; + } + RMSPropOptimizer.prototype.applyGradients = function (variableGradients) { + var _this = this; + var _loop_1 = function (variableName) { + var value = ENV.engine.registeredVariables[variableName]; + if (this_1.accumulatedMeanSquares[variableName] == null) { + var trainable_1 = false; + tidy(function () { + _this.accumulatedMeanSquares[variableName] = + zerosLike(value).variable(trainable_1); + }); + } + if (this_1.accumulatedMeanGrads[variableName] == null && this_1.centered) { + var trainable_2 = false; + tidy(function () { + _this.accumulatedMeanGrads[variableName] = + zerosLike(value).variable(trainable_2); + }); + } + if (this_1.accumulatedMoments[variableName] == null) { + var trainable_3 = false; + tidy(function () { + _this.accumulatedMoments[variableName] = + zerosLike(value).variable(trainable_3); + }); + } + var accumulatedMeanSquare = this_1.accumulatedMeanSquares[variableName]; + var accumulatedMeanGrad = this_1.accumulatedMeanGrads[variableName]; + var accumulatedMoments = this_1.accumulatedMoments[variableName]; + var gradient = variableGradients[variableName]; + tidy(function () { + var newAccumulatedMeanSquare = _this.decayScalar.mul(accumulatedMeanSquare) + .add(_this.oneMinusDecay.mul(gradient.square())); + if (_this.centered) { + var newAccumulatedMeanGrad = _this.decayScalar.mul(accumulatedMeanGrad) + .add(_this.oneMinusDecay.mul(gradient)); + var newAccumulatedMoments = _this.momentumScalar.mul(accumulatedMoments) + .add(_this.c.mul(gradient).div(newAccumulatedMeanSquare + .sub(newAccumulatedMeanGrad.square().add(_this.epsilonScalar)) + .sqrt())); + _this.accumulatedMeanSquares[variableName].assign(newAccumulatedMeanSquare); + _this.accumulatedMeanGrads[variableName].assign(newAccumulatedMeanGrad); + _this.accumulatedMoments[variableName].assign(newAccumulatedMoments); + var newValue = value.sub(newAccumulatedMoments); + value.assign(newValue); + } + else { + var newAccumulatedMeanSquare_1 = _this.decayScalar.mul(accumulatedMeanSquare) + .add(_this.oneMinusDecay.mul(gradient.square())); + var newAccumulatedMoments = _this.momentumScalar.mul(accumulatedMoments) + .add(_this.c.mul(gradient).div(newAccumulatedMeanSquare_1.add(_this.epsilonScalar).sqrt())); + _this.accumulatedMeanSquares[variableName].assign(newAccumulatedMeanSquare_1); + _this.accumulatedMoments[variableName].assign(newAccumulatedMoments); + var newValue = value.sub(newAccumulatedMoments); + value.assign(newValue); + } + }); + }; + var this_1 = this; + for (var variableName in variableGradients) { + _loop_1(variableName); + } + }; + RMSPropOptimizer.prototype.dispose = function () { + var _this = this; + this.c.dispose(); + this.epsilonScalar.dispose(); + this.decayScalar.dispose(); + this.momentumScalar.dispose(); + this.oneMinusDecay.dispose(); + if (this.accumulatedMeanSquares != null) { + Object.keys(this.accumulatedMeanSquares) + .forEach(function (name) { return _this.accumulatedMeanSquares[name].dispose(); }); + } + if (this.accumulatedMeanGrads != null && this.centered) { + Object.keys(this.accumulatedMeanGrads) + .forEach(function (name) { return _this.accumulatedMeanGrads[name].dispose(); }); + } + if (this.accumulatedMoments != null) { + Object.keys(this.accumulatedMoments) + .forEach(function (name) { return _this.accumulatedMoments[name].dispose(); }); + } + }; + RMSPropOptimizer.prototype.getConfig = function () { + return { + learningRate: this.learningRate, + decay: this.decay, + momentum: this.momentum, + epsilon: this.epsilon, + centered: this.centered + }; + }; + RMSPropOptimizer.fromConfig = function (cls, config) { + return new cls(config.learningRate, config.decay, config.momentum, config.epsilon, config.centered); + }; + RMSPropOptimizer.className = 'RMSPropOptimizer'; + return RMSPropOptimizer; + }(Optimizer)); + SerializationMap.register(RMSPropOptimizer); + + var OptimizerConstructors = (function () { + function OptimizerConstructors() { + } + OptimizerConstructors.sgd = function (learningRate) { + return new SGDOptimizer(learningRate); + }; + OptimizerConstructors.momentum = function (learningRate, momentum, useNesterov) { + if (useNesterov === void 0) { useNesterov = false; } + return new MomentumOptimizer(learningRate, momentum, useNesterov); + }; + OptimizerConstructors.rmsprop = function (learningRate, decay, momentum, epsilon, centered) { + if (decay === void 0) { decay = .9; } + if (momentum === void 0) { momentum = 0.0; } + if (epsilon === void 0) { epsilon = null; } + if (centered === void 0) { centered = false; } + return new RMSPropOptimizer(learningRate, decay, momentum, epsilon, centered); + }; + OptimizerConstructors.adam = function (learningRate, beta1, beta2, epsilon) { + if (learningRate === void 0) { learningRate = 0.001; } + if (beta1 === void 0) { beta1 = 0.9; } + if (beta2 === void 0) { beta2 = 0.999; } + if (epsilon === void 0) { epsilon = null; } + return new AdamOptimizer(learningRate, beta1, beta2, epsilon); + }; + OptimizerConstructors.adadelta = function (learningRate, rho, epsilon) { + if (learningRate === void 0) { learningRate = .001; } + if (rho === void 0) { rho = .95; } + if (epsilon === void 0) { epsilon = null; } + return new AdadeltaOptimizer(learningRate, rho, epsilon); + }; + OptimizerConstructors.adamax = function (learningRate, beta1, beta2, epsilon, decay) { + if (learningRate === void 0) { learningRate = 0.002; } + if (beta1 === void 0) { beta1 = 0.9; } + if (beta2 === void 0) { beta2 = 0.999; } + if (epsilon === void 0) { epsilon = null; } + if (decay === void 0) { decay = 0.0; } + return new AdamaxOptimizer(learningRate, beta1, beta2, epsilon, decay); + }; + OptimizerConstructors.adagrad = function (learningRate, initialAccumulatorValue) { + if (initialAccumulatorValue === void 0) { initialAccumulatorValue = 0.1; } + return new AdagradOptimizer(learningRate, initialAccumulatorValue); + }; + return OptimizerConstructors; + }()); + + var train = { + sgd: OptimizerConstructors.sgd, + momentum: OptimizerConstructors.momentum, + adadelta: OptimizerConstructors.adadelta, + adagrad: OptimizerConstructors.adagrad, + rmsprop: OptimizerConstructors.rmsprop, + adamax: OptimizerConstructors.adamax, + adam: OptimizerConstructors.adam + }; + + var setBackend = Environment.setBackend; + var getBackend = Environment.getBackend; + var disposeVariables = Environment.disposeVariables; + var memory = Environment.memory; + setOpHandler(ops); + + exports.setBackend = setBackend; + exports.getBackend = getBackend; + exports.disposeVariables = disposeVariables; + exports.memory = memory; + exports.version_core = version; + exports.nextFrame = nextFrame; + exports.environment = environment; + exports.io = io; + exports.serialization = serialization; + exports.test_util = test_util; + exports.util = util; + exports.webgl = webgl; + exports.AdadeltaOptimizer = AdadeltaOptimizer; + exports.AdagradOptimizer = AdagradOptimizer; + exports.AdamOptimizer = AdamOptimizer; + exports.AdamaxOptimizer = AdamaxOptimizer; + exports.MomentumOptimizer = MomentumOptimizer; + exports.Optimizer = Optimizer; + exports.RMSPropOptimizer = RMSPropOptimizer; + exports.SGDOptimizer = SGDOptimizer; + exports.Tensor = Tensor; + exports.TensorBuffer = TensorBuffer; + exports.variable = variable; + exports.Variable = Variable; + exports.ENV = ENV; + exports.Environment = Environment; + exports.image = image_ops; + exports.linalg = linalg_ops; + exports.losses = loss_ops; + exports.op = op; + exports.batchNormalization2d = batchNormalization2d; + exports.batchNormalization3d = batchNormalization3d; + exports.batchNormalization4d = batchNormalization4d; + exports.batchNormalization = batchNormalization; + exports.concat = concat; + exports.concat1d = concat1d; + exports.concat2d = concat2d; + exports.concat3d = concat3d; + exports.concat4d = concat4d; + exports.conv1d = conv1d; + exports.conv2d = conv2d; + exports.depthwiseConv2d = depthwiseConv2d; + exports.separableConv2d = separableConv2d; + exports.conv2dTranspose = conv2dTranspose; + exports.matMul = matMul; + exports.dot = dot; + exports.outerProduct = outerProduct; + exports.reverse = reverse; + exports.reverse1d = reverse1d; + exports.reverse2d = reverse2d; + exports.reverse3d = reverse3d; + exports.reverse4d = reverse4d; + exports.maxPool = maxPool; + exports.avgPool = avgPool; + exports.slice = slice; + exports.slice1d = slice1d; + exports.slice2d = slice2d; + exports.slice3d = slice3d; + exports.slice4d = slice4d; + exports.abs = abs; + exports.acos = acos; + exports.acosh = acosh; + exports.asin = asin; + exports.asinh = asinh; + exports.atan = atan; + exports.atanh = atanh; + exports.ceil = ceil; + exports.clipByValue = clipByValue; + exports.cos = cos; + exports.cosh = cosh; + exports.erf = erf; + exports.exp = exp; + exports.expm1 = expm1; + exports.floor = floor; + exports.log = log$1; + exports.log1p = log1p; + exports.logSigmoid = logSigmoid; + exports.neg = neg; + exports.reciprocal = reciprocal; + exports.round = round; + exports.rsqrt = rsqrt; + exports.sigmoid = sigmoid; + exports.sign = sign; + exports.sin = sin; + exports.sinh = sinh; + exports.softplus = softplus; + exports.sqrt = sqrt; + exports.square = square; + exports.step = step; + exports.tan = tan; + exports.tanh = tanh$1; + exports.all = all; + exports.any = any; + exports.argMax = argMax; + exports.argMin = argMin; + exports.logSumExp = logSumExp; + exports.max = max; + exports.mean = mean; + exports.min = min; + exports.moments = moments; + exports.sum = sum; + exports.equal = equal; + exports.equalStrict = equalStrict; + exports.greater = greater; + exports.greaterEqual = greaterEqual; + exports.greaterEqualStrict = greaterEqualStrict; + exports.greaterStrict = greaterStrict; + exports.less = less; + exports.lessEqual = lessEqual; + exports.lessEqualStrict = lessEqualStrict; + exports.lessStrict = lessStrict; + exports.notEqual = notEqual; + exports.notEqualStrict = notEqualStrict; + exports.add = add; + exports.addN = addN; + exports.addStrict = addStrict; + exports.atan2 = atan2; + exports.div = div; + exports.divStrict = divStrict; + exports.floorDiv = floorDiv; + exports.maximum = maximum; + exports.maximumStrict = maximumStrict; + exports.minimum = minimum; + exports.minimumStrict = minimumStrict; + exports.mod = mod; + exports.modStrict = modStrict; + exports.mul = mul; + exports.mulStrict = mulStrict; + exports.pow = pow; + exports.powStrict = powStrict; + exports.squaredDifference = squaredDifference; + exports.squaredDifferenceStrict = squaredDifferenceStrict; + exports.sub = sub; + exports.subStrict = subStrict; + exports.elu = elu; + exports.leakyRelu = leakyRelu; + exports.prelu = prelu; + exports.relu = relu; + exports.selu = selu; + exports.logicalAnd = logicalAnd; + exports.logicalNot = logicalNot; + exports.logicalOr = logicalOr; + exports.logicalXor = logicalXor; + exports.where = where; + exports.whereAsync = whereAsync; + exports.buffer = buffer; + exports.toPixels = toPixels; + exports.print = print; + exports.cast = cast; + exports.clone = clone; + exports.cumsum = cumsum; + exports.expandDims = expandDims; + exports.eye = eye; + exports.fromPixels = fromPixels; + exports.multinomial = multinomial; + exports.oneHot = oneHot; + exports.pad = pad; + exports.pad1d = pad1d; + exports.pad2d = pad2d; + exports.pad3d = pad3d; + exports.pad4d = pad4d; + exports.rand = rand; + exports.randomNormal = randomNormal; + exports.randomUniform = randomUniform; + exports.reshape = reshape; + exports.split = split; + exports.squeeze = squeeze; + exports.stack = stack; + exports.tile = tile; + exports.truncatedNormal = truncatedNormal; + exports.unstack = unstack; + exports.batchToSpaceND = batchToSpaceND; + exports.spaceToBatchND = spaceToBatchND; + exports.fill = fill; + exports.linspace = linspace; + exports.ones = ones$1; + exports.range = range; + exports.scalar = scalar; + exports.tensor = tensor; + exports.tensor1d = tensor1d; + exports.tensor2d = tensor2d; + exports.tensor3d = tensor3d; + exports.tensor4d = tensor4d; + exports.tensor5d = tensor5d; + exports.tensor6d = tensor6d; + exports.zeros = zeros; + exports.onesLike = onesLike; + exports.zerosLike = zerosLike; + exports.transpose = transpose; + exports.softmax = softmax; + exports.localResponseNormalization = localResponseNormalization; + exports.norm = norm; + exports.gather = gather; + exports.unsortedSegmentSum = unsortedSegmentSum; + exports.basicLSTMCell = basicLSTMCell; + exports.multiRNNCell = multiRNNCell; + exports.movingAverage = movingAverage; + exports.stridedSlice = stridedSlice; + exports.topk = topk; + exports.train = train; + exports.tidy = tidy; + exports.keep = keep; + exports.dispose = dispose; + exports.time = time; + exports.customGrad = customGrad; + exports.grad = grad; + exports.grads = grads; + exports.valueAndGrad = valueAndGrad; + exports.valueAndGrads = valueAndGrads; + exports.variableGrads = variableGrads; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=tf-core.js.map diff --git a/node_modules/@tensorflow/tfjs-core/dist/tf-core.js.map b/node_modules/@tensorflow/tfjs-core/dist/tf-core.js.map new file mode 100644 index 0000000..d8a5d99 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tf-core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tf-core.js","sources":["../src/device_util.ts","../src/util.ts","../src/profiler.ts","../src/tape.ts","../src/tensor_format.ts","../src/tensor.ts","../src/tensor_util.ts","../src/engine.ts","../src/environment_util.ts","../src/environment.ts","../src/log.ts","../src/ops/array_ops_util.ts","../src/ops/axis_util.ts","../src/ops/reduce_util.ts","../src/ops/segment_util.ts","../src/ops/slice_util.ts","../src/gradients.ts","../src/tensor_util_env.ts","../src/ops/operation.ts","../src/ops/softmax.ts","../src/ops/tensor_ops.ts","../src/types.ts","../src/kernels/backend_util.ts","../src/kernels/non_max_suppression_impl.ts","../src/kernels/topk_impl.ts","../src/kernels/webgl/argminmax_gpu.ts","../src/kernels/webgl/avg_pool_backprop_gpu.ts","../src/ops/broadcast_util.ts","../src/kernels/webgl/batchnorm_gpu.ts","../src/kernels/webgl/binaryop_gpu.ts","../src/kernels/webgl/clip_gpu.ts","../src/ops/concat_util.ts","../src/kernels/webgl/concat_gpu.ts","../src/kernels/webgl/conv_backprop_gpu.ts","../src/kernels/webgl/conv_backprop_gpu_depthwise.ts","../src/kernels/webgl/conv_gpu.ts","../src/kernels/webgl/conv_gpu_depthwise.ts","../src/kernels/webgl/shader_compiler.ts","../src/kernels/webgl/cumsum_gpu.ts","../src/kernels/webgl/encode_float_gpu.ts","../src/kernels/webgl/from_pixels_gpu.ts","../src/kernels/webgl/gather_gpu.ts","../src/kernels/webgl/tex_util.ts","../src/kernels/webgl/webgl_util.ts","../src/kernels/webgl/gpgpu_util.ts","../src/kernels/webgl/gpgpu_context.ts","../src/kernels/webgl/gpgpu_math.ts","../src/kernels/webgl/lrn_gpu.ts","../src/kernels/webgl/lrn_grad_gpu.ts","../src/kernels/webgl/max_pool_backprop_gpu.ts","../src/kernels/webgl/mulmat_gpu.ts","../src/kernels/webgl/multinomial_gpu.ts","../src/kernels/webgl/onehot_gpu.ts","../src/kernels/webgl/pad_gpu.ts","../src/kernels/webgl/pool_gpu.ts","../src/kernels/webgl/reduce_gpu.ts","../src/kernels/webgl/resize_bilinear_backprop_gpu.ts","../src/kernels/webgl/resize_bilinear_gpu.ts","../src/kernels/webgl/resize_nearest_neighbor_backprop_gpu.ts","../src/kernels/webgl/resize_nearest_neighbor_gpu.ts","../src/kernels/webgl/reverse_gpu.ts","../src/kernels/webgl/segment_gpu.ts","../src/kernels/webgl/select_gpu.ts","../src/kernels/webgl/slice_gpu.ts","../src/kernels/webgl/strided_slice_gpu.ts","../src/kernels/webgl/texture_manager.ts","../src/kernels/webgl/tile_gpu.ts","../src/kernels/webgl/transpose_gpu.ts","../src/ops/erf_util.ts","../src/ops/selu_util.ts","../src/kernels/webgl/unaryop_gpu.ts","../src/ops/concat.ts","../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/ops/rand.ts","../src/ops/array_ops.ts","../src/kernels/where_impl.ts","../src/kernels/backend_webgl.ts","../src/ops/unary_ops.ts","../src/ops/batchnorm.ts","../src/ops/conv_util.ts","../src/ops/conv.ts","../src/ops/matmul.ts","../src/ops/reverse.ts","../src/ops/pool.ts","../src/ops/slice.ts","../src/globals.ts","../src/ops/reduction_ops.ts","../src/ops/compare.ts","../src/ops/binary_ops.ts","../src/ops/logical_ops.ts","../src/ops/relu_ops.ts","../src/ops/transpose.ts","../src/ops/lrn.ts","../src/ops/norm.ts","../src/ops/segment_ops.ts","../src/ops/lstm.ts","../src/ops/moving_average.ts","../src/ops/strided_slice.ts","../src/ops/topk.ts","../src/ops/loss_ops.ts","../src/ops/linalg_ops.ts","../src/ops/image_ops.ts","../src/kernels/backend_cpu.ts","../src/browser_util.ts","../src/io/types.ts","../src/io/io_utils.ts","../src/io/router_registry.ts","../src/io/model_management.ts","../src/io/indexed_db.ts","../src/io/local_storage.ts","../src/io/browser_files.ts","../src/io/weights_loader.ts","../src/io/browser_http.ts","../src/io/passthrough.ts","../src/io/io.ts","../src/serialization.ts","../src/test_util.ts","../src/version.ts","../src/optimizers/optimizer.ts","../src/optimizers/optimizer_utils.ts","../src/optimizers/adadelta_optimizer.ts","../src/optimizers/adagrad_optimizer.ts","../src/optimizers/adam_optimizer.ts","../src/optimizers/adamax_optimizer.ts","../src/optimizers/sgd_optimizer.ts","../src/optimizers/momentum_optimizer.ts","../src/optimizers/rmsprop_optimizer.ts","../src/optimizers/optimizer_constructors.ts","../src/train.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport function isMobile(): boolean {\n // tslint:disable-next-line:no-any\n const a = navigator.userAgent || navigator.vendor || (window as any).opera;\n // tslint:disable-next-line:max-line-length\n return /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i\n .test(a) ||\n // tslint:disable-next-line:max-line-length\n /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i\n .test(a.substr(0, 4));\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ArrayData, DataType, DataTypeMap, FlatVector, RecursiveArray, RegularArray, TensorLike, TypedArray} from './types';\n\n/** Shuffles the array using Fisher-Yates algorithm. */\n// tslint:disable-next-line:no-any\nexport function shuffle(array: any[]|Uint32Array|Int32Array|\n Float32Array): void {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n\n/** Clamps a value to a specified range. */\nexport function clamp(min: number, x: number, max: number): number {\n return Math.max(min, Math.min(x, max));\n}\n\n/** Returns a sample from a uniform [a, b] distribution. */\nexport function randUniform(a: number, b: number) {\n return Math.random() * (b - a) + a;\n}\n\n/** Returns squared eucledian distance between two vectors. */\nexport function distSquared(a: FlatVector, b: FlatVector): number {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n\nexport function assert(expr: boolean, msg: string|(() => string)) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\n\nexport function assertShapesMatch(\n shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {\n assert(\n arraysEqual(shapeA, shapeB),\n errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\n\nexport function assertNonNull(a: TensorLike): void {\n assert(\n a != null,\n `The input to the tensor constructor must be a non-null value.`);\n}\n\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\nexport function flatten>(\n arr: T|RecursiveArray, ret: T[] = []): T[] {\n if (Array.isArray(arr)) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], ret);\n }\n } else {\n ret.push(arr as T);\n }\n return ret;\n}\n\nexport function inferShape(val: TypedArray|number|boolean|RegularArray|\n RegularArray): number[] {\n let firstElem: typeof val = val;\n\n if (isTypedArray(val)) {\n return [(val as TypedArray).length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape: number[] = [];\n\n while (firstElem instanceof Array) {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (val instanceof Array) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\n\nfunction deepAssertShapeConsistency(\n val: number|boolean|RegularArray|RegularArray,\n shape: number[], indices?: number[]) {\n indices = indices || [];\n if (!(val instanceof Array)) {\n assert(\n shape.length === 0,\n () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array of ${shape[0]} elements`);\n return;\n }\n assert(\n shape.length > 0,\n () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(\n val.length === shape[0],\n () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\n\nexport function sizeFromShape(shape: number[]): number {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\n\nexport function isScalarShape(shape: number[]): boolean {\n return shape.length === 0;\n}\n\nexport function arraysEqual(n1: FlatVector, n2: FlatVector) {\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\n\nexport function isInt(a: number): boolean {\n return a % 1 === 0;\n}\n\nexport function tanh(x: number): number {\n // tslint:disable-next-line:no-any\n if ((Math as any).tanh != null) {\n // tslint:disable-next-line:no-any\n return (Math as any).tanh(x);\n }\n if (x === Infinity) {\n return 1;\n } else if (x === -Infinity) {\n return -1;\n } else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\n\nexport function sizeToSquarishShape(size: number): [number, number] {\n for (let a = Math.floor(Math.sqrt(size)); a > 1; --a) {\n if (size % a === 0) {\n return [a, size / a];\n }\n }\n return [1, size];\n}\n\nexport function createShuffledIndices(n: number): Uint32Array {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\n\nexport function rightPad(a: string, size: number): string {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\n\nexport function repeatedTry(\n checkFn: () => boolean, delayFn = (counter: number) => 0,\n maxCounter?: number): Promise {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n\n tryCount++;\n\n const nextBackoff = delayFn(tryCount);\n\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n\n tryFn();\n });\n}\n\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(\n shape: number[], size: number): number[] {\n let shapeProd = 1;\n let implicitIdx = -1;\n\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] > 0) {\n shapeProd *= shape[i];\n } else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(\n `Shapes can only have 1 implicit size. ` +\n `Found - 1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n } else if (shape[i] <= 0) {\n throw Error(`Shapes can not be <= 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n\n if (size % shapeProd !== 0) {\n throw Error(\n `The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\n\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape: number[], axis?: number[]):\n {newShape: number[], keptDims: number[]} {\n const newShape: number[] = [];\n const keptDims: number[] = [];\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axis != null) {\n if (axis[j] === i && shape[i] > 1) {\n throw new Error(\n `Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axis[j] == null || axis[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axis[j] <= i) {\n j++;\n }\n }\n if (shape[i] > 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return {newShape, keptDims};\n}\n\nexport function getTypedArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\n\nexport function checkComputationForNaN(\n vals: DataTypeMap[D], dtype: D, name: string): void {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return;\n }\n for (let i = 0; i < vals.length; i++) {\n if (isNaN(vals[i])) {\n throw Error(`The result of the '${name}' has NaNs.`);\n }\n }\n}\n\nexport function checkConversionForNaN(\n vals: DataTypeMap[D]|number[], dtype: D): void {\n if (dtype === 'float32') {\n // NaN is valid for floating point conversions\n return;\n }\n\n for (let i = 0; i < vals.length; i++) {\n if (isNaN(vals[i])) {\n throw Error(`NaN is not a valid value for dtype: '${dtype}'.`);\n }\n }\n}\n\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType: DataType, newType: DataType): boolean {\n if (newType === 'float32') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\n\nfunction copyTypedArray(\n array: DataTypeMap[D]|number[]|boolean[], dtype: D,\n debugMode: boolean): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32') {\n return new Float32Array(array as number[]);\n } else if (dtype === 'int32') {\n if (debugMode) {\n checkConversionForNaN(array as number[], dtype);\n }\n return new Int32Array(array as number[]);\n } else if (dtype === 'bool') {\n const bool = new Uint8Array(array.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(array[i] as number) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\nexport function isTypedArray(a: TypedArray|number|boolean|RegularArray|\n RegularArray): boolean {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\n\nexport function bytesPerElement(dtype: DataType): number {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n } else if (dtype === 'bool') {\n return 1;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\nexport function isFunction(f: Function) {\n return !!(f && f.constructor && f.call && f.apply);\n}\n\nexport function nearestDivisor(size: number, start: number): number {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\n\nexport function computeStrides(shape: number[]): number[] {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\n\nexport function toTypedArray(\n a: ArrayData, dtype: D, debugMode: boolean): DataTypeMap[D] {\n if (noConversionNeeded(a, dtype)) {\n return a as DataTypeMap[D];\n }\n if (Array.isArray(a)) {\n a = flatten(a as number[]);\n }\n return copyTypedArray(a, dtype, debugMode);\n}\n\nfunction noConversionNeeded(\n a: ArrayData, dtype: D): boolean {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\n\nexport function makeOnesTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\n\nexport function makeZerosTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32') {\n return new Float32Array(size);\n } else if (dtype === 'int32') {\n return new Int32Array(size);\n } else if (dtype === 'bool') {\n return new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Returns the current high-resolution real time in milliseconds. It is\n * relative to an arbitrary time in the past.\n */\nexport function now(): number {\n if (typeof performance !== 'undefined') {\n return performance.now();\n } else if (typeof process !== 'undefined') {\n const time = process.hrtime();\n return time[0] * 1000 + time[1] / 1000000;\n } else {\n throw new Error(\n 'Can not measure time in this environment. You should run tf.js ' +\n 'in the browser or in Node.js');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimer} from './kernels/backend';\nimport {Tensor} from './tensor';\nimport {TypedArray} from './types';\nimport * as util from './util';\n\nexport class Profiler {\n constructor(private backendTimer: BackendTimer, private logger?: Logger) {\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n\n profileKernel(name: string, f: () => T | Tensor[]):\n T {\n let result: T|Tensor[];\n const holdResultWrapperFn = () => {\n result = f();\n };\n const timer = this.backendTimer.time(holdResultWrapperFn);\n\n const results: Tensor[] =\n Array.isArray(result) ? result : [result] as Tensor[];\n results.forEach(r => {\n const vals = r.dataSync();\n util.checkComputationForNaN(vals, r.dtype, name);\n\n timer.then(timing => {\n this.logger.logKernelProfile(name, r, vals, timing.kernelMs);\n });\n });\n\n return result as T;\n }\n}\n\nexport class Logger {\n logKernelProfile(\n name: string, result: Tensor, vals: TypedArray, timeMs: number) {\n const time = util.rightPad(`${timeMs}ms`, 9);\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n console.log(\n `%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}`,\n 'font-weight:bold', 'color:red', 'color:blue', 'color: orange');\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport * as util from './util';\n\nexport interface TapeNode {\n id: number;\n name: string;\n output: Tensor;\n inputs: NamedTensorMap;\n // Optional params, defined only for ops with gradient impl.\n gradient?: (dy: Tensor|NamedTensorMap) => NamedGradientMap;\n}\n\nexport type NamedGradientMap = {\n [inputName: string]: () => Tensor;\n};\n\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(\n tape: TapeNode[], xs: Tensor[], y: Tensor): TapeNode[] {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX: {[tensorId: number]: boolean} = {};\n const nodesFromX: {[nodeId: number]: boolean} = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n tensorsFromX[node.output.id] = true;\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n\n if (anyInputFromX) {\n break;\n }\n }\n }\n\n // Backwards pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY: {[tensorId: number]: boolean} = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY: {[nodeId: number]: boolean} = {};\n\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n\n const outputs: Tensor[] = [];\n outputs.push(node.output);\n\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < outputs.length; j++) {\n if (tensorsLeadToY[outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n\n // Return the paths that come from x and lead to y.\n const filteredTape: TapeNode[] = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs: {[inputName: string]: Tensor} = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node) as TapeNode;\n prunedNode.inputs = prunedInputs;\n prunedNode.output = node.output;\n\n filteredTape.push(prunedNode);\n }\n }\n\n return filteredTape;\n}\n\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(\n tensorAccumulatedGradientMap: {[tensorId: number]: Tensor},\n filteredTape: TapeNode[]) {\n // Walk the tape backwards and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n\n const dy = tensorAccumulatedGradientMap[node.output.id];\n\n if (node.gradient == null) {\n throw new Error(\n `Cannot compute gradient: gradient function not found ` +\n `for ${node.name}.`);\n }\n\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dy);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(\n `Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n\n // Call the gradient function.\n const dx = inputGradients[inputName]();\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(\n `Error in gradient for op ${node.name}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n } else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = curGradient.add(dx);\n curGradient.dispose();\n }\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, TypedArray} from './types';\nimport {computeStrides, rightPad, sizeFromShape} from './util';\n\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\n\nexport function tensorToString(\n vals: TypedArray, shape: number[], dtype: DataType, verbose: boolean) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\n\nfunction computeMaxSizePerColumn(\n vals: TypedArray, shape: number[], strides: number[]): number[] {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] =\n Math.max(padPerCol[j], valToString(vals[offset + j], 0).length);\n }\n }\n }\n return padPerCol;\n}\n\nfunction valToString(val: number, pad: number) {\n return rightPad(\n parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(), pad);\n}\n\nfunction subTensorToString(\n vals: TypedArray, shape: number[], strides: number[], padPerCol: number[],\n isLast = true): string[] {\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n return [vals[0].toString()];\n }\n\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstVals =\n Array.from(vals.subarray(0, FORMAT_NUM_FIRST_LAST_VALS));\n const lastVals =\n Array.from(vals.subarray(size - FORMAT_NUM_FIRST_LAST_VALS, size));\n return [\n '[' + firstVals.map((x, i) => valToString(x, padPerCol[i])).join(', ') +\n ', ..., ' +\n lastVals\n .map(\n (x, i) => valToString(\n x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i]))\n .join(', ') +\n ']'\n ];\n }\n return [\n '[' +\n Array.from(vals).map((x, i) => valToString(x, padPerCol[i])).join(', ') +\n ']'\n ];\n }\n\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0];\n const lines: string[] = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.subarray(start, end), subshape, substrides, padPerCol,\n false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.subarray(start, end), subshape, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n } else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.subarray(start, end), subshape, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensorToString} from './tensor_format';\nimport {DataType, Rank, ShapeMap, TypedArray} from './types';\nimport * as util from './util';\nimport {computeStrides} from './util';\n\n/** @hidden */\nexport interface TensorData {\n dataId?: DataId;\n values?: TypedArray;\n}\n\n/**\n * A mutable object, similar to `Tensor`, that allows users to set values\n * at locations before converting to an immutable `Tensor`.\n *\n * See `buffer` for creating a tensor buffer.\n */\n/** @doc {heading: 'Tensors', subheading: 'Classes'} */\nexport class TensorBuffer {\n size: number;\n shape: ShapeMap[R];\n strides: number[];\n values: TypedArray;\n\n constructor(shape: ShapeMap[R], public dtype: DataType, values: TypedArray) {\n if (values != null) {\n const n = values.length;\n const size = util.sizeFromShape(shape);\n util.assert(\n n === size,\n `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${size}'`);\n }\n this.shape = shape.slice();\n this.values =\n values || util.getTypedArrayFromDType(dtype, util.sizeFromShape(shape));\n this.strides = computeStrides(shape);\n this.size = util.sizeFromShape(shape);\n }\n\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n set(value: number, ...locs: number[]) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(\n locs.length === this.rank,\n `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n get(...locs: number[]): number {\n if (locs.length === 0) {\n locs = [0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n\n locToIndex(locs: number[]): number {\n if (this.rank === 0) {\n return 0;\n } else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n\n indexToLoc(index: number): number[] {\n if (this.rank === 0) {\n return [];\n } else if (this.rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n\n get rank() {\n return this.shape.length;\n }\n\n /**\n * Creates an immutable `Tensor` object from the buffer.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n toTensor(): Tensor {\n return Tensor.make(this.shape, {values: this.values}, this.dtype);\n }\n}\n\nexport interface TensorTracker {\n registerTensor(t: Tensor): void;\n disposeTensor(t: Tensor): void;\n write(dataId: DataId, values: TypedArray): void;\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): TypedArray;\n registerVariable(v: Variable): void;\n}\n\n/**\n * The Tensor class calls into this handler to delegate chaining operations.\n */\nexport interface OpHandler {\n cast(x: T, dtype: DataType): T;\n buffer(\n shape: ShapeMap[R], dtype: DataType,\n values?: TypedArray): TensorBuffer;\n print(x: T, verbose: boolean): void;\n reshape(x: Tensor, shape: ShapeMap[R2]): Tensor;\n expandDims(x: Tensor, axis: number): Tensor;\n cumsum(\n x: Tensor, axis: number, exclusive: boolean, reverse: boolean): T;\n squeeze(x: Tensor, axis?: number[]): T;\n clone(x: T): T;\n tile(x: T, reps: number[]): T;\n gather(x: T, indices: Tensor1D, axis: number): T;\n matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean):\n Tensor2D;\n dot(t1: Tensor, t2: Tensor): Tensor;\n norm(\n x: Tensor, ord: number|'euclidean'|'fro', axis: number|number[],\n keepDims: boolean): Tensor;\n slice>(\n x: T, begin: number|number[], size?: number|number[]): T;\n reverse(x: T, axis?: number|number[]): T;\n concat(tensors: T[], axis: number): T;\n stack(tensors: T[], axis: number): Tensor;\n unstack(value: T, axis: number): Tensor[];\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T;\n batchNormalization(\n x: Tensor, mean: Tensor|Tensor1D, variance: Tensor|Tensor1D,\n varianceEpsilon: number, scale?: Tensor|Tensor1D,\n offset?: Tensor|Tensor1D): Tensor;\n all(x: Tensor, axis: number|number[], keepDims: boolean): T;\n any(x: Tensor, axis: number|number[], keepDims: boolean): T;\n logSumExp(\n x: Tensor, axis: number|number[], keepDims: boolean): T;\n sum(x: Tensor, axis: number|number[], keepDims: boolean): T;\n mean(x: Tensor, axis: number|number[], keepDims: boolean):\n T;\n min(x: Tensor, axis: number|number[], keepDims: boolean): T;\n max(x: Tensor, axis: number|number[], keepDims: boolean): T;\n argMin(x: Tensor, axis: number): T;\n argMax(x: Tensor, axis: number): T;\n add(a: Tensor, b: Tensor): T;\n addStrict(a: T, b: T): T;\n sub(a: Tensor, b: Tensor): T;\n subStrict(a: T, b: T): T;\n pow(base: T, exp: Tensor): T;\n powStrict(base: T, exp: Tensor): T;\n mul(a: Tensor, b: Tensor): T;\n mulStrict(a: T, b: T): T;\n div(a: Tensor, b: Tensor): T;\n floorDiv(a: Tensor, b: Tensor): T;\n divStrict(a: T, b: T): T;\n mod(a: Tensor, b: Tensor): T;\n modStrict(a: T, b: T): T;\n minimum(a: Tensor, b: Tensor): T;\n minimumStrict(a: T, b: T): T;\n maximum(a: Tensor, b: Tensor): T;\n maximumStrict(a: T, b: T): T;\n squaredDifference(a: Tensor, b: Tensor): T;\n squaredDifferenceStrict(a: T, b: T): T;\n transpose(x: T, perm?: number[]): T;\n logicalNot(x: T): T;\n logicalAnd(a: Tensor, b: Tensor): T;\n logicalOr(a: Tensor, b: Tensor): T;\n logicalXor(a: Tensor, b: Tensor): T;\n where(condition: Tensor, a: T, b: T): T;\n notEqual(a: Tensor, b: Tensor): T;\n notEqualStrict(a: T, b: T): T;\n less(a: Tensor, b: Tensor): T;\n lessStrict(a: T, b: T): T;\n equal(a: Tensor, b: Tensor): T;\n equalStrict(a: T, b: T): T;\n lessEqual(a: Tensor, b: Tensor): T;\n lessEqualStrict(a: T, b: T): T;\n greater(a: Tensor, b: Tensor): T;\n greaterStrict(a: T, b: T): T;\n greaterEqual(a: Tensor, b: Tensor): T;\n greaterEqualStrict(a: T, b: T): T;\n neg(x: T): T;\n ceil(x: T): T;\n floor(x: T): T;\n sign(x: T): T;\n round(x: T): T;\n exp(x: T): T;\n expm1(x: T): T;\n log(x: T): T;\n log1p(x: T): T;\n sqrt(x: T): T;\n rsqrt(x: T): T;\n square(x: T): T;\n reciprocal(x: T): T;\n abs(x: T): T;\n clipByValue(\n x: T, clipValueMin: number, clipValueMax: number): T;\n sigmoid(x: T): T;\n logSigmoid(x: T): T;\n softplus(x: T): T;\n sin(x: T): T;\n cos(x: T): T;\n tan(x: T): T;\n asin(x: T): T;\n acos(x: T): T;\n atan(x: T): T;\n sinh(x: T): T;\n cosh(x: T): T;\n tanh(x: T): T;\n asinh(x: T): T;\n acosh(x: T): T;\n atanh(x: T): T;\n erf(x: T): T;\n step(x: T, alpha: number): T;\n relu(x: T): T;\n elu(x: T): T;\n selu(x: T): T;\n leakyRelu(x: T, alpha: number): T;\n prelu(x: T, alpha: T): T;\n softmax(logits: T, dim: number): T;\n image: {\n resizeBilinear(\n images: T, size: [number, number], alignCorners: boolean): T;\n resizeNearestNeighbor(\n images: T, size: [number, number], alignCorners: boolean): T;\n };\n conv1d(\n x: T, filter: Tensor3D, stride: number, pad: 'valid'|'same'|number,\n dataFormat: 'NWC'|'NCW', dilation: number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n conv2d(\n x: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW',\n dilations: [number, number]|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n conv2dTranspose(\n x: T, filter: Tensor4D,\n outputShape: [number, number, number, number]|[number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n depthwiseConv2d(\n x: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW',\n dilations: [number, number]|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n maxPool(\n x: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n avgPool(\n x: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n localResponseNormalization(\n x: T, depthRadius: number, bias: number, alpha: number, beta: number): T;\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): T;\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T;\n spaceToBatchND(\n x: T, blockShape: number[], paddings: number[][]): T;\n}\n\n// For tracking tensor creation and disposal.\nlet trackerFn: () => TensorTracker = null;\n// Used by chaining methods to call into ops.\nlet opHandler: OpHandler = null;\n\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn: () => TensorTracker) {\n trackerFn = fn;\n}\n\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op handler.\n */\nexport function setOpHandler(handler: OpHandler) {\n opHandler = handler;\n}\n\n/**\n * We wrap data id since we use weak map to avoid memory leaks.\n * Since we have our own memory management, we have a reference counter\n * mapping a tensor to its data, so there is always a pointer (even if that\n * data is otherwise garbage collectable).\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/\n * Global_Objects/WeakMap\n */\nexport type DataId = object; // object instead of {} to force non-primitive.\n\n/**\n * A `Tensor` object represents an immutable, multidimensional array of numbers\n * that has a shape and a data type.\n *\n * See `tensor` for details on how to create a `Tensor`.\n */\n/** @doc {heading: 'Tensors', subheading: 'Classes'} */\nexport class Tensor {\n private static nextId = 0;\n\n /** Unique id of this tensor. */\n readonly id: number;\n /**\n * Id of the bucket holding the data for this tensor. Multiple arrays can\n * point to the same bucket (e.g. when calling array.reshape()).\n */\n dataId: DataId;\n /** The shape of the tensor. */\n readonly shape: ShapeMap[R];\n /** Number of elements in the tensor. */\n readonly size: number;\n /** The data type for the array. */\n readonly dtype: DataType;\n /** The rank type for the array (see `Rank` enum). */\n readonly rankType: R;\n\n /**\n * Number of elements to skip in each dimension when indexing. See\n * https://docs.scipy.org/doc/numpy/reference/generated/\\\n * numpy.ndarray.strides.html\n */\n readonly strides: number[];\n\n protected constructor(\n shape: ShapeMap[R], dtype: DataType, values?: TypedArray,\n dataId?: DataId) {\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n util.assert(\n this.size === values.length,\n `Constructing tensor of shape (${this.size}) should match the ` +\n `length of values (${values.length})`);\n }\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.strides = computeStrides(shape);\n this.dataId = dataId != null ? dataId : {};\n this.id = Tensor.nextId++;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher') as R;\n trackerFn().registerTensor(this);\n if (values != null) {\n trackerFn().write(this.dataId, values);\n }\n }\n\n /**\n * Makes a new tensor with the provided shape and values. Values should be in\n * a flat array.\n */\n static make, D extends DataType = 'float32',\n R extends Rank = Rank>(\n shape: ShapeMap[R], data: TensorData, dtype?: D): T {\n return new Tensor(shape, dtype, data.values, data.dataId) as T;\n }\n\n /** Flatten a Tensor to a 1D array. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n flatten(): Tensor1D {\n this.throwIfDisposed();\n return this.as1D();\n }\n\n /** Converts a size-1 `Tensor` to a `Scalar`. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n asScalar(): Scalar {\n this.throwIfDisposed();\n util.assert(this.size === 1, 'The array must have only 1 element.');\n return this.reshape([]);\n }\n\n /** Converts a `Tensor` to a `Tensor1D`. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as1D(): Tensor1D {\n this.throwIfDisposed();\n return this.reshape([this.size]);\n }\n\n /**\n * Converts a `Tensor` to a `Tensor2D`.\n *\n * @param rows Number of rows in `Tensor2D`.\n * @param columns Number of columns in `Tensor2D`.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as2D(rows: number, columns: number): Tensor2D {\n this.throwIfDisposed();\n return this.reshape([rows, columns]);\n }\n\n /**\n * Converts a `Tensor` to a `Tensor3D`.\n *\n * @param rows Number of rows in `Tensor3D`.\n * @param columns Number of columns in `Tensor3D`.\n * @param depth Depth of `Tensor3D`.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as3D(rows: number, columns: number, depth: number): Tensor3D {\n this.throwIfDisposed();\n return this.reshape([rows, columns, depth]);\n }\n\n /**\n * Converts a `Tensor` to a `Tensor4D`.\n *\n * @param rows Number of rows in `Tensor4D`.\n * @param columns Number of columns in `Tensor4D`.\n * @param depth Depth of `Tensor4D`.\n * @param depth2 4th dimension of `Tensor4D`.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as4D(rows: number, columns: number, depth: number, depth2: number): Tensor4D {\n this.throwIfDisposed();\n return this.reshape([rows, columns, depth, depth2]);\n }\n\n /**\n * Casts a `Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n asType(this: T, dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype) as T;\n }\n\n get rank(): number {\n return this.shape.length;\n }\n\n /**\n * Returns the value in the tensor at the provided location.\n * If using WebGL backend, this is a blocking call.\n * Prefer calling the `async data()[flatIndex]` method instead.\n *\n * @param locs The location indices.\n */\n get(...locs: number[]) {\n util.assert(\n locs.length === this.rank,\n 'Number of coordinates in get() must match the rank of the tensor');\n this.throwIfDisposed();\n if (locs.length === 0) {\n locs = [0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.dataSync()[index];\n }\n\n /** Returns a `TensorBuffer` that holds the underlying data. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n buffer(): TensorBuffer {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n\n /**\n * Asynchronously downloads the values from the `Tensor`. Returns a promise of\n * `TypedArray` that resolves when the computation has finished.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n async data(): Promise {\n this.throwIfDisposed();\n return trackerFn().read(this.dataId);\n }\n\n /**\n * Synchronously downloads the values from the `Tensor`. This blocks the UI\n * thread until the values are ready, which can cause performance issues.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n dataSync(): TypedArray {\n this.throwIfDisposed();\n return trackerFn().readSync(this.dataId);\n }\n\n /**\n * Disposes `Tensor` from memory.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n\n private isDisposedInternal = false;\n get isDisposed(): boolean {\n return this.isDisposedInternal;\n }\n\n private throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n\n /** Casts the array to type `float32` */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toFloat(this: T): T {\n return this.asType('float32');\n }\n\n /** Casts the array to type `int32` */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toInt() {\n return this.asType('int32');\n }\n\n /** Casts the array to type `bool` */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toBool() {\n return this.asType('bool');\n }\n\n /**\n * Prints the `Tensor`. See `print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n print(verbose = false): void {\n return opHandler.print(this, verbose);\n }\n\n /**\n * Reshapes the tensor into the provided shape.\n * See `reshape` for more details.\n *\n * @param newShape An array of integers defining the output tensor shape.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n reshape(newShape: ShapeMap[R2]): Tensor {\n this.throwIfDisposed();\n return opHandler.reshape(this, newShape);\n }\n\n /**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n reshapeAs(x: T): T {\n this.throwIfDisposed();\n return this.reshape(x.shape) as T;\n }\n\n /**\n * Returns a `Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape. See `expandDims` for details.\n *\n * @param axis The dimension index at which to insert shape of 1. Defaults to\n * 0 (the first dimension).\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n expandDims(axis = 0): Tensor {\n return opHandler.expandDims(this, axis);\n }\n\n /**\n * Returns the cumulative sum of the `Tensor` along `axis`.\n *\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Defaults to\n * false. If set to true then the sum of each tensor entry does not include\n * its own value, but only the values previous to it along the specified\n * axis.\n * @param reverse Whether to sum in the opposite direction. Defaults to\n * false.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n cumsum(axis = 0, exclusive = false, reverse = false): T {\n return opHandler.cumsum(this, axis, exclusive, reverse);\n }\n\n /**\n * Returns a `Tensor` with dimensions of size 1 removed from the shape.\n * See `squeeze` for more details.\n *\n * @param axis A list of numbers. If specified, only squeezes the\n * dimensions listed. The dimension index starts at 0. It is an error to\n * squeeze a dimension that is not 1.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n squeeze(axis?: number[]): T {\n this.throwIfDisposed();\n return opHandler.squeeze(this, axis);\n }\n\n /** Returns a copy of the tensor. See `clone` for details. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n clone(this: T): T {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n\n /** Returns a human-readable description of the tensor. Useful for logging. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toString(verbose = false): string {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n\n // Below is chain API that is not exposed to docs to avoid repetition. To\n // expose a method, move it above this comment and add @doc and jsdoc.\n\n tile(this: T, reps: number[]): T {\n this.throwIfDisposed();\n return opHandler.tile(this, reps) as T;\n }\n\n gather(this: T, indices: Tensor1D, axis = 0): T {\n this.throwIfDisposed();\n return opHandler.gather(this, indices, axis) as T;\n }\n\n matMul(b: Tensor2D, transposeA = false, transposeB = false): Tensor2D {\n this.throwIfDisposed();\n return opHandler.matMul(this as Tensor2D, b, transposeA, transposeB);\n }\n dot(b: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.dot(this, b);\n }\n norm(\n ord: number|'euclidean'|'fro' = 'euclidean', axis: number|number[] = null,\n keepDims = false): Tensor {\n this.throwIfDisposed();\n return opHandler.norm(this, ord, axis, keepDims);\n }\n slice>(\n this: T, begin: number|number[], size?: number|number[]): T {\n this.throwIfDisposed();\n return opHandler.slice(this, begin, size);\n }\n reverse(this: T, axis?: number|number[]): T {\n this.throwIfDisposed();\n return opHandler.reverse(this, axis);\n }\n concat(this: T, x: T, axis = 0): T {\n this.throwIfDisposed();\n return opHandler.concat([this, x], axis);\n }\n stack(x: Tensor, axis = 0): Tensor {\n return opHandler.stack([this, x], axis);\n }\n unstack(x: Tensor, axis = 0): Tensor[] {\n return opHandler.unstack(this, axis);\n }\n pad(\n this: T, paddings: Array<[number, number]>, constantValue = 0): T {\n return opHandler.pad(this, paddings, constantValue);\n }\n batchNormalization(\n mean: Tensor|Tensor1D, variance: Tensor|Tensor1D,\n varianceEpsilon = .001, scale?: Tensor|Tensor1D,\n offset?: Tensor|Tensor1D): Tensor {\n this.throwIfDisposed();\n return opHandler.batchNormalization(\n this, mean, variance, varianceEpsilon, scale, offset);\n }\n\n // Reduction ops.\n all(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.all(this, axis, keepDims);\n }\n any(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.any(this, axis, keepDims);\n }\n logSumExp(axis: number|number[] = null, keepDims = false):\n T {\n this.throwIfDisposed();\n return opHandler.logSumExp(this, axis, keepDims);\n }\n sum(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.sum(this, axis, keepDims);\n }\n mean(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.mean(this, axis, keepDims);\n }\n min(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.min(this, axis, keepDims);\n }\n max(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.max(this, axis, keepDims);\n }\n argMin(axis: number = null): T {\n this.throwIfDisposed();\n return opHandler.argMin(this, axis);\n }\n argMax(axis: number = null): T {\n this.throwIfDisposed();\n return opHandler.argMax(this, axis);\n }\n\n // Transformations\n cast(dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this as T, dtype) as T;\n }\n\n // Binary ops.\n\n add(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.add(this, x);\n }\n addStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.addStrict(this, x) as T;\n }\n sub(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.sub(this, x);\n }\n subStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.subStrict(this, x) as T;\n }\n pow(this: T, exp: Tensor): T {\n this.throwIfDisposed();\n return opHandler.pow(this, exp);\n }\n powStrict(exp: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.powStrict(this, exp);\n }\n mul(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.mul(this, x);\n }\n mulStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.mulStrict(this, x) as T;\n }\n div(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.div(this, x);\n }\n floorDiv(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.floorDiv(this, x);\n }\n divStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.divStrict(this, x) as T;\n }\n minimum(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.minimum(this, x);\n }\n minimumStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.minimumStrict(this, x) as T;\n }\n maximum(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.maximum(this, x);\n }\n maximumStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.maximumStrict(this, x) as T;\n }\n mod(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.mod(this, x);\n }\n modStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.modStrict(this, x) as T;\n }\n squaredDifference(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.squaredDifference(this, x);\n }\n squaredDifferenceStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.squaredDifferenceStrict(this, x) as T;\n }\n transpose(this: T, perm?: number[]): T {\n this.throwIfDisposed();\n return opHandler.transpose(this, perm);\n }\n\n // Compare ops.\n\n notEqual(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.notEqual(this, x);\n }\n notEqualStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.notEqualStrict(this, x) as T;\n }\n less(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.less(this, x);\n }\n lessStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.lessStrict(this, x) as T;\n }\n equal(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.equal(this, x);\n }\n equalStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.equalStrict(this, x) as T;\n }\n lessEqual(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.lessEqual(this, x);\n }\n lessEqualStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.lessEqualStrict(this, x) as T;\n }\n greater(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.greater(this, x);\n }\n greaterStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.greaterStrict(this, x) as T;\n }\n greaterEqual(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.greaterEqual(this, x);\n }\n greaterEqualStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.greaterEqualStrict(this, x) as T;\n }\n\n // Compare ops.\n logicalAnd(x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.logicalAnd(this, x);\n }\n logicalOr(x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.logicalOr(this, x);\n }\n logicalNot(this: T): T {\n this.throwIfDisposed();\n return opHandler.logicalNot(this);\n }\n logicalXor(x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.logicalXor(this, x);\n }\n where(condition: Tensor, x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.where(condition, this, x);\n }\n\n // Unary ops.\n neg(this: T): T {\n this.throwIfDisposed();\n return opHandler.neg(this);\n }\n ceil(this: T): T {\n this.throwIfDisposed();\n return opHandler.ceil(this);\n }\n floor(this: T): T {\n this.throwIfDisposed();\n return opHandler.floor(this);\n }\n sign(this: T): T {\n this.throwIfDisposed();\n return opHandler.sign(this);\n }\n exp(this: T): T {\n this.throwIfDisposed();\n return opHandler.exp(this);\n }\n expm1(this: T): T {\n this.throwIfDisposed();\n return opHandler.expm1(this);\n }\n log(this: T): T {\n this.throwIfDisposed();\n return opHandler.log(this);\n }\n log1p(this: T): T {\n this.throwIfDisposed();\n return opHandler.log1p(this);\n }\n sqrt(this: T): T {\n this.throwIfDisposed();\n return opHandler.sqrt(this);\n }\n rsqrt(this: T): T {\n this.throwIfDisposed();\n return opHandler.rsqrt(this);\n }\n square(this: T): T {\n this.throwIfDisposed();\n return opHandler.square(this);\n }\n reciprocal(this: T): T {\n this.throwIfDisposed();\n return opHandler.reciprocal(this);\n }\n abs(this: T): T {\n this.throwIfDisposed();\n return opHandler.abs(this);\n }\n clipByValue(min: number, max: number): Tensor {\n this.throwIfDisposed();\n return opHandler.clipByValue(this, min, max);\n }\n relu(this: T): T {\n this.throwIfDisposed();\n return opHandler.relu(this);\n }\n elu(this: T): T {\n this.throwIfDisposed();\n return opHandler.elu(this);\n }\n selu(this: T): T {\n this.throwIfDisposed();\n return opHandler.selu(this);\n }\n leakyRelu(alpha = 0.2): Tensor {\n this.throwIfDisposed();\n return opHandler.leakyRelu(this, alpha);\n }\n prelu(alpha: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.prelu(this, alpha);\n }\n sigmoid(this: T): T {\n this.throwIfDisposed();\n return opHandler.sigmoid(this);\n }\n logSigmoid(this: T): T {\n this.throwIfDisposed();\n return opHandler.logSigmoid(this);\n }\n softplus(this: T): T {\n this.throwIfDisposed();\n return opHandler.softplus(this);\n }\n sin(this: T): T {\n this.throwIfDisposed();\n return opHandler.sin(this);\n }\n cos(this: T): T {\n this.throwIfDisposed();\n return opHandler.cos(this);\n }\n tan(this: T): T {\n this.throwIfDisposed();\n return opHandler.tan(this);\n }\n asin(this: T): T {\n this.throwIfDisposed();\n return opHandler.asin(this);\n }\n acos(this: T): T {\n this.throwIfDisposed();\n return opHandler.acos(this);\n }\n atan(this: T): T {\n this.throwIfDisposed();\n return opHandler.atan(this);\n }\n sinh(this: T): T {\n this.throwIfDisposed();\n return opHandler.sinh(this);\n }\n cosh(this: T): T {\n this.throwIfDisposed();\n return opHandler.cosh(this);\n }\n tanh(this: T): T {\n this.throwIfDisposed();\n return opHandler.tanh(this);\n }\n asinh(this: T): T {\n this.throwIfDisposed();\n return opHandler.asinh(this);\n }\n acosh(this: T): T {\n this.throwIfDisposed();\n return opHandler.acosh(this);\n }\n atanh(this: T): T {\n this.throwIfDisposed();\n return opHandler.atanh(this);\n }\n erf(this: T): T {\n this.throwIfDisposed();\n return opHandler.erf(this);\n }\n round(this: T): T {\n this.throwIfDisposed();\n return opHandler.round(this);\n }\n step(this: T, alpha = 0.0): T {\n this.throwIfDisposed();\n return opHandler.step(this, alpha);\n }\n softmax(this: T, dim = -1): T {\n this.throwIfDisposed();\n return opHandler.softmax(this, dim) as T;\n }\n\n // Image ops.\n resizeBilinear(\n this: T, newShape2D: [number, number], alignCorners = false): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.image.resizeBilinear(this, newShape2D, alignCorners);\n }\n\n resizeNearestNeighbor(\n this: T, newShape2D: [number, number], alignCorners = false): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.image.resizeNearestNeighbor(\n this, newShape2D, alignCorners);\n }\n\n // Convolutions.\n conv1d(\n this: T, filter: Tensor3D, stride: number, pad: 'valid'|'same'|number,\n dataFormat: 'NWC'|'NCW' = 'NWC', dilation = 1,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.conv1d(\n this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n }\n conv2d(\n this: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.conv2d(\n this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n }\n conv2dTranspose(\n this: T, filter: Tensor4D,\n outputShape: [number, number, number, number]|[number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.conv2dTranspose(\n this, filter, outputShape, strides, pad, dimRoundingMode);\n }\n depthwiseConv2D(\n this: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.depthwiseConv2d(\n this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n }\n\n // Pooling.\n avgPool(\n this: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.avgPool(this, filterSize, strides, pad, dimRoundingMode);\n }\n maxPool(\n this: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.maxPool(this, filterSize, strides, pad, dimRoundingMode);\n }\n localResponseNormalization(\n this: T, radius = 5, bias = 1, alpha = 1, beta = 0.5): T {\n return opHandler.localResponseNormalization(\n this, radius, bias, alpha, beta);\n }\n\n variable(trainable = true, name?: string, dtype?: DataType): Variable {\n this.throwIfDisposed();\n return Variable.variable(this, trainable, name, dtype);\n }\n\n unsortedSegmentSum(\n this: T, segmentIds: Tensor1D, numSegments: number): T {\n this.throwIfDisposed();\n return opHandler.unsortedSegmentSum(this, segmentIds, numSegments);\n }\n\n batchToSpaceND(\n this: T, blockShape: number[], crops: number[][]): T {\n this.throwIfDisposed();\n return opHandler.batchToSpaceND(this, blockShape, crops);\n }\n\n spaceToBatchND(\n this: T, blockShape: number[], paddings: number[][]): T {\n this.throwIfDisposed();\n return opHandler.spaceToBatchND(this, blockShape, paddings);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance: Tensor) => {\n return !!instance && instance.shape != null && instance.dtype != null;\n }\n});\n\n/** @doclink Tensor */\nexport type Scalar = Tensor;\n/** @doclink Tensor */\nexport type Tensor1D = Tensor;\n/** @doclink Tensor */\nexport type Tensor2D = Tensor;\n/** @doclink Tensor */\nexport type Tensor3D = Tensor;\n/** @doclink Tensor */\nexport type Tensor4D = Tensor;\n/** @doclink Tensor */\nexport type Tensor5D = Tensor;\n/** @doclink Tensor */\nexport type Tensor6D = Tensor;\n\n/**\n * A mutable `Tensor`, useful for persisting state, e.g. for training.\n */\n/** @doc {heading: 'Tensors', subheading: 'Classes'} */\nexport class Variable extends Tensor {\n private static nextVarId = 0;\n name: string;\n\n /**\n * Private constructor since we can not add logic before calling `super()`.\n * Instead, we expose static `Variable.variable` method below, which will be\n * added to global namespace.\n */\n private constructor(\n initialValue: Tensor, public trainable = true, name?: string) {\n super(\n initialValue.shape, initialValue.dtype, null /* values */,\n initialValue.dataId);\n this.name = name;\n if (this.name == null) {\n this.name = Variable.nextVarId.toString();\n Variable.nextVarId++;\n }\n try {\n trackerFn().registerVariable(this);\n } catch (ex) {\n trackerFn().disposeTensor(this);\n throw ex;\n }\n }\n\n /**\n * Creates a new variable with the provided initial value.\n * ```js\n * const x = tf.variable(tf.tensor([1, 2, 3]));\n * x.assign(tf.tensor([4, 5, 6]));\n *\n * x.print();\n * ```\n *\n * @param initialValue Initial value for the tensor.\n * @param trainable If true, optimizers are allowed to update it.\n * @param name Name of the variable. Defaults to a unique id.\n * @param dtype If set, initialValue will be converted to the given type.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n static variable(\n initialValue: Tensor, trainable = true, name?: string,\n dtype?: DataType): Variable {\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.asType(dtype) as Tensor;\n }\n return new Variable(initialValue, trainable, name);\n }\n\n /**\n * Assign a new `Tensor` to this variable. The new `Tensor` must have the\n * same shape and dtype as the old `Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n assign(newValue: Tensor): void {\n if (newValue.dtype !== this.dtype) {\n throw new Error(\n `dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(\n `shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().registerTensor(this);\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance: Variable) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n\nconst variable = Variable.variable;\nexport {variable};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap, TensorContainer, TensorContainerArray} from './tensor_types';\nimport {assert} from './util';\n\nexport function assertTypesMatch(a: Tensor, b: Tensor): void {\n assert(\n a.dtype === b.dtype,\n ` The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\n\nexport function isTensorInList(tensor: Tensor, tensorList: Tensor[]): boolean {\n for (let i = 0; i < tensorList.length; i++) {\n if (tensorList[i].id === tensor.id) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenNameArrayMap(\n nameArrayMap: Tensor|NamedTensorMap, keys?: string[]): Tensor[] {\n const xs: Tensor[] = [];\n if (nameArrayMap instanceof Tensor) {\n xs.push(nameArrayMap);\n } else {\n const xMap = nameArrayMap as {[xName: string]: Tensor};\n for (let i = 0; i < keys.length; i++) {\n xs.push(xMap[keys[i]]);\n }\n }\n return xs;\n}\n\nexport function unflattenToNameArrayMap(\n keys: string[], flatArrays: Tensor[]): NamedTensorMap {\n if (keys.length !== flatArrays.length) {\n throw new Error(\n `Cannot unflatten Tensor[], keys and arrays are not of same length.`);\n }\n const result: NamedTensorMap = {};\n for (let i = 0; i < keys.length; i++) {\n result[keys[i]] = flatArrays[i];\n }\n return result;\n}\n\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result: TensorContainer): Tensor[] {\n const list: Tensor[] = [];\n const seen = new Set<{}|void>();\n walkTensorContainer(result, list, seen);\n return list;\n}\n\nfunction walkTensorContainer(\n container: TensorContainer, list: Tensor[], seen: Set<{}|void>): void {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container as TensorContainerArray;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction isIterable(obj: any): boolean {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimingInfo, KernelBackend} from './kernels/backend';\nimport {Profiler} from './profiler';\nimport {backpropagateGradients, getFilteredNodesXToY, NamedGradientMap, TapeNode} from './tape';\nimport {DataId, Tensor, Tensor3D, Variable} from './tensor';\nimport {NamedTensorMap, NamedVariableMap, TensorContainer} from './tensor_types';\nimport {getTensorsInContainer, isTensorInList} from './tensor_util';\nimport {TypedArray} from './types';\nimport * as util from './util';\nimport {makeOnesTypedArray, now, sizeFromShape} from './util';\n\n/**\n * A function that computes an output. The save function is for saving tensors\n * computed in the forward pass, that we need in the backwards pass.\n */\nexport type ForwardFunc =\n (backend: KernelBackend, save?: (tensor: S) => S) => T;\n\n/**\n * @docalias (a: Tensor, b: Tensor,...) => {\n * value: Tensor, * gradFunc: (dy: Tensor) => Tensor | Tensor[] * }\n */\nexport type CustomGradientFunc = (...args: Tensor[]) => {\n value: T, gradFunc: (dy: T) => Tensor | Tensor[];\n};\n\nexport type MemoryInfo = {\n numTensors: number; numDataBuffers: number; numBytes: number;\n unreliable?: boolean;\n};\n\nexport interface TimingInfo extends BackendTimingInfo {\n wallMs: number;\n}\n\n/** @docalias Function */\nexport type ScopeFn = () => T;\n\nexport interface TensorManager {\n registerTensor(a: Tensor): void;\n registerVariable(v: Variable): void;\n disposeTensor(a: Tensor): void;\n memory(): {numDataBuffers: number; numBytes: number;};\n}\n\ninterface ScopeState {\n track: Tensor[];\n name: string;\n}\n\nexport class Engine implements TensorManager {\n // Public since optimizers will use it.\n registeredVariables: NamedVariableMap = {};\n\n private refCounter = new WeakMap();\n private nextTapeNodeId = 0;\n private numBytes = 0;\n private numTensors = 0;\n private numDataBuffers = 0;\n\n private activeTape: TapeNode[];\n private gradientScopeCount = 0;\n private customGradientDepth = 0;\n\n // Keep Tensors that parallel the tapes.\n private activeScope: ScopeState;\n private scopeStack: ScopeState[];\n private keepTensors: Set = new Set();\n private profiler: Profiler;\n\n constructor(\n private backend: KernelBackend, public safeMode: boolean,\n private debugMode: () => boolean) {\n // Create a default outer scope.\n this.activeScope = {track: [], name: 'default scope'};\n this.scopeStack = [this.activeScope];\n this.profiler = new Profiler(backend);\n }\n\n tidy(\n nameOrFn: string|ScopeFn, fn?: ScopeFn, gradMode = false): T {\n // gradMode Primarily for internal use during backprop\n // If true, will start a tape if it is the outermost tidy.\n\n let name: string = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n } else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error(\n 'When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error(\n 'When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn as string;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result: T;\n return this.scopedRun(\n () => this.startScope(name, gradMode),\n () => this.endScope(result, gradMode), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n\n private scopedRun(start: () => void, end: () => void, f: () => T): T {\n start();\n try {\n const res = f();\n end();\n return res;\n } catch (ex) {\n end();\n throw ex;\n }\n }\n\n runKernel(\n forwardFunc: ForwardFunc,\n inputs: I,\n backwardsFunc?: (dy: T, saved: Tensor[]) => {[P in keyof I]: () => I[P]},\n ): T {\n let result: T;\n const saved: Tensor[] = [];\n const saveFunc = (x: T): T => {\n saved.push(x);\n return x;\n };\n const scopeName = this.activeScope.name;\n\n // Stop recording to a tape when running a kernel.\n this.scopedRun(\n () => this.customGradientDepth++, () => this.customGradientDepth--,\n () => {\n if (!this.debugMode()) {\n result = forwardFunc(this.backend, saveFunc);\n } else {\n result = this.profiler.profileKernel(\n scopeName, () => forwardFunc(this.backend, saveFunc));\n }\n });\n\n if (this.shouldRecord()) {\n const tapeNode: TapeNode = {\n id: this.nextTapeNodeId++,\n name: scopeName,\n inputs,\n // Keep gradient records only for the first output.\n output: Array.isArray(result) ? result[0] : result\n };\n if (backwardsFunc != null) {\n tapeNode.gradient =\n ((dy: T) => backwardsFunc(dy, saved)) as (dy: Tensor) =>\n NamedGradientMap;\n }\n this.activeTape.push(tapeNode);\n }\n return result;\n }\n\n // TensorManager implementation.\n\n registerTensor(a: Tensor|Variable): void {\n const refCount =\n this.refCounter.has(a.dataId) ? this.refCounter.get(a.dataId) : 0;\n this.numTensors++;\n if (refCount === 0) {\n this.numDataBuffers++;\n this.numBytes +=\n util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype);\n this.backend.register(a.dataId, a.shape, a.dtype);\n }\n this.refCounter.set(a.dataId, refCount + 1);\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n\n registerVariable(v: Variable) {\n if (this.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.registeredVariables[v.name] = v;\n }\n\n disposeTensor(a: Tensor): void {\n if (!this.refCounter.has(a.dataId)) {\n return;\n }\n if (this.keepTensors.has(a.id)) {\n this.keepTensors.delete(a.id);\n }\n this.numTensors--;\n const refCount = this.refCounter.get(a.dataId);\n if (refCount <= 1) {\n this.refCounter.delete(a.dataId);\n this.backend.disposeData(a.dataId);\n this.numDataBuffers--;\n this.numBytes -=\n util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype);\n } else {\n this.refCounter.set(a.dataId, refCount - 1);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n\n disposeVariables(): void {\n for (const varName in this.registeredVariables) {\n const v = this.registeredVariables[varName];\n this.disposeTensor(v);\n delete this.registeredVariables[varName];\n }\n }\n\n memory(): MemoryInfo {\n const info = this.backend.memory() as MemoryInfo;\n info.numTensors = this.numTensors;\n info.numDataBuffers = this.numDataBuffers;\n info.numBytes = this.numBytes;\n return info;\n }\n\n private shouldRecord(): boolean {\n return this.activeTape != null && this.customGradientDepth === 0;\n }\n\n private addTapeNode(\n inputs: Tensor[], result: Tensor,\n gradientsFunc: (dy: Tensor) => Tensor[]): void {\n const inputsMap: NamedTensorMap = {};\n inputs.forEach((input, idx) => {\n inputsMap[idx] = input;\n });\n\n const gradient = (dy: Tensor) => {\n const res = gradientsFunc(dy);\n const resMap: NamedGradientMap = {};\n res.forEach((r, idx) => {\n resMap[idx] = () => r;\n });\n return resMap;\n };\n\n const tapeNode: TapeNode = {\n id: this.nextTapeNodeId++,\n name: this.activeScope.name,\n inputs: inputsMap,\n output: result,\n gradient\n };\n this.activeTape.push(tapeNode);\n }\n\n keep(result: T): T {\n if (this.scopeStack.length === 1 && this.safeMode) {\n throw new Error(\n 'Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' +\n 'tf.tidy(() => {...}) to avoid memory leaks.');\n }\n this.keepTensors.add(result.id);\n return result;\n }\n\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name?: string, gradientsMode = false) {\n if (gradientsMode && this.gradientScopeCount === 0) {\n this.activeTape = [];\n }\n if (gradientsMode) {\n this.gradientScopeCount++;\n }\n\n const scopeInfo: ScopeState = {track: [], name: 'unnamed scope'};\n if (name) {\n scopeInfo.name = name;\n }\n this.scopeStack.push(scopeInfo);\n this.activeScope = scopeInfo;\n }\n\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result?: TensorContainer, gradientsMode = false) {\n if (gradientsMode) {\n this.gradientScopeCount--;\n if (this.gradientScopeCount === 0) {\n this.activeTape = null;\n }\n }\n\n const tensorsToKeep = new Set(this.keepTensors);\n\n const tensorsToTrackInParent = getTensorsInContainer(result);\n tensorsToTrackInParent.forEach(tensor => tensorsToKeep.add(tensor.id));\n\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.activeScope.track.length; i++) {\n const tensor = this.activeScope.track[i];\n if (tensorsToKeep.has(tensor.id)) {\n continue;\n }\n\n if (this.activeTape != null) {\n tensorsToTrackInParent.push(tensor);\n } else {\n tensor.dispose();\n }\n }\n\n const oldScope = this.scopeStack.pop();\n this.activeScope = this.scopeStack.length === 0 ?\n {track: [], name: 'default scope'} :\n this.scopeStack[this.scopeStack.length - 1];\n\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!this.keepTensors.has(tensor.id) &&\n isTensorInList(tensor, oldScope.track)) {\n this.track(tensor);\n }\n });\n }\n\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f` was\n * not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(\n f: () => T, xs: Tensor[], dy?: T,\n allowNoGradients = false): {value: T, grads: Tensor[]} {\n util.assert(xs.length > 0, 'gradients() received an empty list of xs.');\n\n return this.tidy('gradients', () => {\n const y = f();\n util.assert(\n y instanceof Tensor,\n 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error(\n 'Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n\n const accumulatedGradientMap: {[tensorId: number]: Tensor} = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape);\n\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n return {value: y, grads};\n }, true /* gradientsMode */);\n }\n\n customGrad(f: CustomGradientFunc):\n (...args: Tensor[]) => T {\n util.assert(\n util.isFunction(f),\n 'The f passed in customGrad(f) must be a function.');\n return (...inputs: Tensor[]): T => {\n util.assert(\n inputs.every(t => t instanceof Tensor),\n 'The args passed in customGrad(f)(x1, x2,...) must all be tensors');\n\n let gradientsFunc: (dy: T) => Tensor | Tensor[];\n let result: T;\n this.scopedRun(\n () => this.customGradientDepth++, () => this.customGradientDepth--,\n () => {\n const gradientsMode = true;\n result = this.tidy(f.name, () => {\n const {value, gradFunc} = f(...inputs);\n util.assert(\n value instanceof Tensor,\n 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(\n util.isFunction(gradFunc),\n 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n gradientsFunc = gradFunc;\n return value;\n }, gradientsMode);\n });\n\n if (this.shouldRecord()) {\n const gradFunc = (dy: T): Tensor[] => {\n const res = gradientsFunc(dy);\n const grads: Tensor[] = Array.isArray(res) ? res : [res];\n util.assert(\n grads.length === inputs.length,\n 'The function f passed in customGrad(f) must return an object ' +\n 'where `obj.gradFunc` is a function that returns the same ' +\n 'number of tensors as inputs passed to f(...).');\n util.assert(\n grads.every(t => t instanceof Tensor),\n 'The function f passed in customGrad(f) must return an object ' +\n 'where `obj.gradFunc` is a function that returns a list of ' +\n 'only tensors.');\n return grads;\n };\n this.addTapeNode(inputs, result, gradFunc);\n }\n return result;\n };\n }\n\n // Forwarding to backend.\n write(dataId: DataId, values: TypedArray): void {\n this.backend.write(dataId, values);\n }\n readSync(dataId: DataId): TypedArray {\n return this.backend.readSync(dataId);\n }\n read(dataId: DataId): Promise {\n return this.backend.read(dataId);\n }\n fromPixels(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels: number): Tensor3D {\n return this.backend.fromPixels(pixels, numChannels);\n }\n async time(query: () => void): Promise {\n const start = now();\n const timingInfo = await this.backend.time(query) as TimingInfo;\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n private track(result: T): T {\n if (this.scopeStack.length === 1 && this.safeMode) {\n throw new Error(\n 'Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' +\n 'tf.tidy(() => {op();...}); to avoid memory leaks.');\n }\n this.activeScope.track.push(result);\n return result;\n }\n}\n\nfunction ones(shape: number[]): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return Tensor.make(shape, {values});\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport interface Features {\n // Whether to enable debug mode.\n 'DEBUG'?: boolean;\n // Whether we are in a browser (as versus, say, node.js) environment.\n 'IS_BROWSER'?: boolean;\n // Whether we are in the Node.js environment.\n 'IS_NODE'?: boolean;\n // The disjoint_query_timer extension version.\n // 0: disabled, 1: EXT_disjoint_timer_query, 2:\n // EXT_disjoint_timer_query_webgl2.\n // In Firefox with WebGL 2.0,\n // EXT_disjoint_timer_query_webgl2 is not available, so we must use the\n // WebGL 1.0 extension.\n 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'?: number;\n // Whether the timer object from the disjoint_query_timer extension gives\n // timing information that is reliable.\n 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE'?: boolean;\n // 0: No WebGL, 1: WebGL 1.0, 2: WebGL 2.0.\n 'WEBGL_VERSION'?: number;\n // True if WebGL is supported.\n 'HAS_WEBGL'?: boolean;\n // Whether rendering to float32 textures is enabled. If disabled, renders to\n // float16 textures.\n 'WEBGL_RENDER_FLOAT32_ENABLED'?: boolean;\n // Whether downloading float textures is enabled. If disabled, uses IEEE 754\n // encoding of the float32 values to 4 uint8 when downloading.\n 'WEBGL_DOWNLOAD_FLOAT_ENABLED'?: boolean;\n // Whether the fence API is available.\n 'WEBGL_FENCE_API_ENABLED'?: boolean;\n 'BACKEND'?: string;\n // Test precision for unit tests. This is decreased when we can't render\n // float32 textures.\n 'TEST_EPSILON'?: number;\n 'IS_CHROME'?: boolean;\n // True if running unit tests.\n 'IS_TEST'?: boolean;\n}\n\nexport enum Type {\n NUMBER,\n BOOLEAN,\n STRING\n}\n\nexport const URL_PROPERTIES: URLProperty[] = [\n {name: 'DEBUG', type: Type.BOOLEAN}, {name: 'IS_BROWSER', type: Type.BOOLEAN},\n {name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION', type: Type.NUMBER},\n {name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE', type: Type.BOOLEAN},\n {name: 'WEBGL_VERSION', type: Type.NUMBER},\n {name: 'WEBGL_RENDER_FLOAT32_ENABLED', type: Type.BOOLEAN},\n {name: 'WEBGL_DOWNLOAD_FLOAT_ENABLED', type: Type.BOOLEAN},\n {name: 'WEBGL_FENCE_API_ENABLED', type: Type.BOOLEAN},\n {name: 'BACKEND', type: Type.STRING}\n];\n\nexport interface URLProperty {\n name: keyof Features;\n type: Type;\n}\n\nexport function isWebGLVersionEnabled(webGLVersion: 1|2, isBrowser: boolean) {\n let gl;\n try {\n gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n } catch (e) {\n return false;\n }\n\n if (gl != null) {\n loseContext(gl);\n return true;\n }\n return false;\n}\n\nexport function getWebGLDisjointQueryTimerVersion(\n webGLVersion: number, isBrowser: boolean): number {\n if (webGLVersion === 0) {\n return 0;\n }\n\n let queryTimerVersion: number;\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n if (hasExtension(gl, 'EXT_disjoint_timer_query_webgl2') &&\n webGLVersion === 2) {\n queryTimerVersion = 2;\n } else if (hasExtension(gl, 'EXT_disjoint_timer_query')) {\n queryTimerVersion = 1;\n } else {\n queryTimerVersion = 0;\n }\n\n if (gl != null) {\n loseContext(gl);\n }\n return queryTimerVersion;\n}\n\nexport function isRenderToFloatTextureEnabled(\n webGLVersion: number, isBrowser: boolean): boolean {\n if (webGLVersion === 0) {\n return false;\n }\n\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n if (webGLVersion === 1) {\n if (!hasExtension(gl, 'OES_texture_float')) {\n return false;\n }\n } else {\n if (!hasExtension(gl, 'EXT_color_buffer_float')) {\n return false;\n }\n }\n\n createFloatTextureAndBindToFramebuffer(gl, webGLVersion);\n\n const isFrameBufferComplete =\n gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;\n\n loseContext(gl);\n return isFrameBufferComplete;\n}\n\nexport function isDownloadFloatTextureEnabled(\n webGLVersion: number, isBrowser: boolean): boolean {\n if (webGLVersion === 0) {\n return false;\n }\n\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n if (webGLVersion === 1) {\n if (!hasExtension(gl, 'OES_texture_float')) {\n return false;\n }\n } else {\n if (!hasExtension(gl, 'EXT_color_buffer_float')) {\n return false;\n }\n }\n\n createFloatTextureAndBindToFramebuffer(gl, webGLVersion);\n gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, new Float32Array(4));\n\n const readPixelsNoError = gl.getError() === gl.NO_ERROR;\n\n loseContext(gl);\n\n return readPixelsNoError;\n}\n\nexport function isWebGLFenceEnabled(webGLVersion: number, isBrowser: boolean) {\n if (webGLVersion !== 2) {\n return false;\n }\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n // tslint:disable-next-line:no-any\n const isEnabled = (gl as any).fenceSync != null;\n loseContext(gl);\n return isEnabled;\n}\n\nexport function isChrome() {\n return typeof navigator !== 'undefined' && navigator != null &&\n navigator.userAgent != null && /Chrome/.test(navigator.userAgent) &&\n /Google Inc/.test(navigator.vendor);\n}\n\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\nexport function getFeaturesFromURL(): Features {\n const features: Features = {};\n\n if (typeof window === 'undefined' || typeof window.location === 'undefined') {\n return features;\n }\n\n const urlParams = getQueryParams(window.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const urlFlags: {[key: string]: string} = {};\n\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':') as [string, string];\n urlFlags[key] = value;\n });\n\n URL_PROPERTIES.forEach(urlProperty => {\n if (urlProperty.name in urlFlags) {\n console.log(\n `Setting feature override from URL ${urlProperty.name}: ` +\n `${urlFlags[urlProperty.name]}`);\n if (urlProperty.type === Type.NUMBER) {\n features[urlProperty.name] = +urlFlags[urlProperty.name];\n } else if (urlProperty.type === Type.BOOLEAN) {\n features[urlProperty.name] = urlFlags[urlProperty.name] === 'true';\n } else if (urlProperty.type === Type.STRING) {\n // tslint:disable-next-line:no-any\n features[urlProperty.name] = urlFlags[urlProperty.name] as any;\n } else {\n console.warn(`Unknown URL param: ${urlProperty.name}.`);\n }\n }\n });\n }\n\n return features;\n}\n\nfunction hasExtension(gl: WebGLRenderingContext, extensionName: string) {\n const ext = gl.getExtension(extensionName);\n return ext != null;\n}\n\nfunction getWebGLRenderingContext(\n webGLVersion: number, isBrowser: boolean): WebGLRenderingContext {\n if (webGLVersion === 0 || !isBrowser) {\n throw new Error('Cannot get WebGL rendering context, WebGL is disabled.');\n }\n\n const tempCanvas = document.createElement('canvas');\n\n if (webGLVersion === 1) {\n return (tempCanvas.getContext('webgl') ||\n tempCanvas.getContext('experimental-webgl')) as\n WebGLRenderingContext;\n }\n return tempCanvas.getContext('webgl2') as WebGLRenderingContext;\n}\n\nfunction loseContext(gl: WebGLRenderingContext) {\n if (gl != null) {\n const loseContextExtension = gl.getExtension('WEBGL_lose_context');\n if (loseContextExtension == null) {\n throw new Error(\n 'Extension WEBGL_lose_context not supported on this browser.');\n }\n loseContextExtension.loseContext();\n }\n}\n\nfunction createFloatTextureAndBindToFramebuffer(\n gl: WebGLRenderingContext, webGLVersion: number) {\n const frameBuffer = gl.createFramebuffer();\n const texture = gl.createTexture();\n\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // tslint:disable-next-line:no-any\n const internalFormat = webGLVersion === 2 ? (gl as any).RGBA32F : gl.RGBA;\n gl.texImage2D(\n gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n}\n\nexport function getQueryParams(queryString: string): {[key: string]: string} {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\n\nfunction decodeParam(\n params: {[key: string]: string}, name: string, value?: string) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as device_util from './device_util';\nimport {Engine, MemoryInfo, ScopeFn, TimingInfo} from './engine';\nimport {Features, getFeaturesFromURL, getWebGLDisjointQueryTimerVersion, isChrome, isDownloadFloatTextureEnabled, isRenderToFloatTextureEnabled, isWebGLFenceEnabled, isWebGLVersionEnabled} from './environment_util';\nimport {KernelBackend} from './kernels/backend';\nimport {setTensorTracker, Tensor, TensorTracker} from './tensor';\nimport {TensorContainer} from './tensor_types';\nimport {getTensorsInContainer} from './tensor_util';\n\nconst TEST_EPSILON_FLOAT32_ENABLED = 1e-3;\nconst TEST_EPSILON_FLOAT32_DISABLED = 1e-1;\n\nexport class Environment {\n private features: Features = {};\n private globalEngine: Engine;\n private registry:\n {[id: string]: {backend: KernelBackend, priority: number}} = {};\n backendName: string;\n backend: KernelBackend;\n\n constructor(features?: Features) {\n if (features != null) {\n this.features = features;\n }\n\n if (this.get('DEBUG')) {\n console.warn(\n 'Debugging mode is ON. The output of every math call will ' +\n 'be downloaded to CPU and checked for NaNs. ' +\n 'This significantly impacts performance.');\n }\n }\n\n /**\n * Sets the backend (cpu, webgl, etc) responsible for creating tensors and\n * executing operations on those tensors.\n *\n * Note this disposes the current backend, if any, as well as any tensors\n * associated with it. A new backend is initialized, even if it is of the\n * same type as the previous one.\n *\n * @param backendName The name of the backend. Currently supports\n * `'webgl'|'cpu'` in the browser, and `'tensorflow'` under node.js\n * (requires tfjs-node).\n * @param safeMode Defaults to false. In safe mode, you are forced to\n * construct tensors and call math operations inside a `tidy()` which\n * will automatically clean up intermediate tensors.\n */\n /** @doc {heading: 'Environment'} */\n static setBackend(backendName: string, safeMode = false) {\n if (!(backendName in ENV.registry)) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n ENV.initBackend(backendName, safeMode);\n }\n\n /**\n * Returns the current backend name (cpu, webgl, etc). The backend is\n * responsible for creating tensors and executing operations on those tensors.\n */\n /** @doc {heading: 'Environment'} */\n static getBackend(): string {\n ENV.initDefaultBackend();\n return ENV.backendName;\n }\n\n /**\n * Dispose all variables kept in backend engine.\n */\n /** @doc {heading: 'Environment'} */\n static disposeVariables(): void {\n ENV.engine.disposeVariables();\n }\n\n /**\n * Returns memory info at the current time in the program. The result is an\n * object with the following properties:\n *\n * - `numBytes`: Number of bytes allocated (undisposed) at this time.\n * - `numTensors`: Number of unique tensors allocated.\n * - `numDataBuffers`: Number of unique data buffers allocated\n * (undisposed) at this time, which is ≤ the number of tensors\n * (e.g. `a.reshape(newShape)` makes a new Tensor that shares the same\n * data buffer with `a`).\n * - `unreliable`: `Optional` `boolean`:\n * - On WebGL, not present (always reliable).\n * - On CPU, true. Due to automatic garbage collection, these numbers\n * represent undisposed tensors, i.e. not wrapped in `tidy()`, or\n * lacking a call to `tensor.dispose()`.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static memory(): MemoryInfo {\n return ENV.engine.memory();\n }\n\n /**\n * Executes the provided function `fn` and after it is executed, cleans up all\n * intermediate tensors allocated by `fn` except those returned by `fn`.\n * `f` must not return a Promise (async functions not allowed).\n * The returned result can be a complex object, however tidy only walks the\n * top-level properties (depth 1) of that object to search for tensors, or\n * lists of tensors that need to be tracked in the parent scope.\n *\n * Using this method helps avoid memory leaks. In general, wrap calls to\n * operations in `tidy` for automatic memory cleanup.\n *\n * When in safe mode, you must enclose all `Tensor` creation and ops\n * inside a `tidy` to prevent memory leaks.\n *\n * ```js\n * // y = 2 ^ 2 + 1\n * const y = tf.tidy(() => {\n * // a, b, and one will be cleaned up when the tidy ends.\n * const one = tf.scalar(1);\n * const a = tf.scalar(2);\n * const b = a.square();\n *\n * console.log('numTensors (in tidy): ' + tf.memory().numTensors);\n *\n * // The value returned inside the tidy function will return\n * // through the tidy, in this case to the variable y.\n * return b.add(one);\n * });\n *\n * console.log('numTensors (outside tidy): ' + tf.memory().numTensors);\n * y.print();\n * ```\n *\n * @param nameOrFn The name of the closure, or the function to execute.\n * If a name is provided, the 2nd argument should be the function.\n * If debug mode is on, the timing and the memory usage of the function\n * will be tracked and displayed on the console using the provided name.\n * @param fn The function to execute.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static tidy(\n nameOrFn: string|ScopeFn, fn?: ScopeFn, gradMode = false): T {\n return ENV.engine.tidy(nameOrFn, fn, gradMode);\n }\n\n /**\n * Disposes any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. If the\n * object is not a `Tensor` or does not contain `Tensors`, nothing\n * happens. In general it is safe to pass any object here, except that\n * `Promise`s are not supported.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static dispose(container: TensorContainer) {\n const tensors = getTensorsInContainer(container);\n tensors.forEach(tensor => tensor.dispose());\n }\n\n /**\n * Keeps a `Tensor` generated inside a `tidy` from being disposed\n * automatically.\n *\n * ```js\n * let b;\n * const y = tf.tidy(() => {\n * const one = tf.scalar(1);\n * const a = tf.scalar(2);\n *\n * // b will not be cleaned up by the tidy. a and one will be cleaned up\n * // when the tidy ends.\n * b = tf.keep(a.square());\n *\n * console.log('numTensors (in tidy): ' + tf.memory().numTensors);\n *\n * // The value returned inside the tidy function will return\n * // through the tidy, in this case to the variable y.\n * return b.add(one);\n * });\n *\n * console.log('numTensors (outside tidy): ' + tf.memory().numTensors);\n * console.log('y:');\n * y.print();\n * console.log('b:');\n * b.print();\n * ```\n *\n * @param result The tensor to keep from being disposed.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static keep(result: T): T {\n return ENV.engine.keep(result);\n }\n\n /**\n * Executes `f()` and returns a promise that resolves with timing\n * information.\n *\n * The result is an object with the following properties:\n *\n * - `wallMs`: Wall execution time.\n * - `kernelMs`: Kernel execution time, ignoring data transfer.\n * - On `WebGL` The following additional properties exist:\n * - `uploadWaitMs`: CPU blocking time on texture uploads.\n * - `downloadWaitMs`: CPU blocking time on texture downloads (readPixels).\n *\n * ```js\n * const x = tf.randomNormal([20, 20]);\n * const time = await tf.time(() => x.matMul(x));\n *\n * console.log(`kernelMs: ${time.kernelMs}, wallTimeMs: ${time.wallMs}`);\n * ```\n *\n * @param f The function to execute and time.\n */\n /** @doc {heading: 'Performance', subheading: 'Timing'} */\n static time(f: () => void): Promise {\n return ENV.engine.time(f);\n }\n\n get(feature: K): Features[K] {\n if (feature in this.features) {\n return this.features[feature];\n }\n\n this.features[feature] = this.evaluateFeature(feature);\n\n return this.features[feature];\n }\n\n getFeatures(): Features {\n return this.features;\n }\n\n set(feature: K, value: Features[K]): void {\n this.features[feature] = value;\n }\n\n private getBestBackendName(): string {\n if (Object.keys(this.registry).length === 0) {\n throw new Error('No backend found in registry.');\n }\n const sortedBackends = Object.keys(this.registry)\n .map(name => {\n return {name, entry: this.registry[name]};\n })\n .sort((a, b) => {\n // Highest priority comes first.\n return b.entry.priority - a.entry.priority;\n });\n return sortedBackends[0].name;\n }\n\n private evaluateFeature(feature: K): Features[K] {\n if (feature === 'DEBUG') {\n return false;\n } else if (feature === 'IS_BROWSER') {\n return typeof window !== 'undefined';\n } else if (feature === 'IS_NODE') {\n return (typeof process !== 'undefined') &&\n (typeof process.versions.node !== 'undefined');\n } else if (feature === 'IS_CHROME') {\n return isChrome();\n } else if (feature === 'IS_TEST') {\n return false;\n } else if (feature === 'BACKEND') {\n return this.getBestBackendName();\n } else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') {\n const webGLVersion = this.get('WEBGL_VERSION');\n\n if (webGLVersion === 0) {\n return 0;\n }\n // Remove this and reenable this extension when the\n // EXT_disjoint_query_timer extension is reenabled in chrome.\n // https://github.com/tensorflow/tfjs/issues/544\n if (webGLVersion > 0) {\n return 0;\n }\n return getWebGLDisjointQueryTimerVersion(\n webGLVersion, this.get('IS_BROWSER'));\n } else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE') {\n return this.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0 &&\n !device_util.isMobile();\n } else if (feature === 'HAS_WEBGL') {\n return this.get('WEBGL_VERSION') > 0;\n } else if (feature === 'WEBGL_VERSION') {\n if (isWebGLVersionEnabled(2, this.get('IS_BROWSER'))) {\n return 2;\n } else if (isWebGLVersionEnabled(1, this.get('IS_BROWSER'))) {\n return 1;\n }\n return 0;\n } else if (feature === 'WEBGL_RENDER_FLOAT32_ENABLED') {\n return isRenderToFloatTextureEnabled(\n this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));\n } else if (feature === 'WEBGL_DOWNLOAD_FLOAT_ENABLED') {\n return isDownloadFloatTextureEnabled(\n this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));\n } else if (feature === 'WEBGL_FENCE_API_ENABLED') {\n return isWebGLFenceEnabled(\n this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));\n } else if (feature === 'TEST_EPSILON') {\n if (this.get('WEBGL_RENDER_FLOAT32_ENABLED')) {\n return TEST_EPSILON_FLOAT32_ENABLED;\n }\n return TEST_EPSILON_FLOAT32_DISABLED;\n }\n throw new Error(`Unknown feature ${feature}.`);\n }\n\n setFeatures(features: Features) {\n this.features = Object.assign({}, features);\n }\n\n reset() {\n this.features = getFeaturesFromURL();\n if (this.globalEngine != null) {\n this.globalEngine = null;\n }\n }\n\n private initBackend(backendName?: string, safeMode = false) {\n this.backendName = backendName;\n this.backend = this.findBackend(backendName);\n this.globalEngine =\n new Engine(this.backend, safeMode, () => this.get('DEBUG'));\n }\n\n findBackend(name: string): KernelBackend {\n if (!(name in this.registry)) {\n return null;\n }\n return this.registry[name].backend;\n }\n\n /**\n * Registers a global backend. The registration should happen when importing\n * a module file (e.g. when importing `backend_webgl.ts`), and is used for\n * modular builds (e.g. custom tfjs bundle with only webgl support).\n *\n * @param factory: The backend factory function. When called, it should\n * return an instance of the backend.\n * @param priority The priority of the backend (higher = more important).\n * In case multiple backends are registered, the priority is used to find\n * the best backend. Defaults to 1.\n * @return False if the creation/registration failed. True otherwise.\n */\n registerBackend(\n name: string, factory: () => KernelBackend, priority = 1,\n setTensorTrackerFn?: (f: () => TensorTracker) => void): boolean {\n if (name in this.registry) {\n console.warn(\n `${name} backend was already registered. Reusing existing backend`);\n if (setTensorTrackerFn != null) {\n setTensorTrackerFn(() => this.engine);\n }\n return false;\n }\n try {\n const backend = factory();\n this.registry[name] = {backend, priority};\n return true;\n } catch (err) {\n console.warn(`Registration of backend ${name} failed`);\n console.warn(err.stack || err.message);\n return false;\n }\n }\n\n removeBackend(name: string): void {\n if (!(name in this.registry)) {\n throw new Error(`${name} backend not found in registry`);\n }\n this.registry[name].backend.dispose();\n delete this.registry[name];\n }\n\n get engine(): Engine {\n this.initDefaultBackend();\n return this.globalEngine;\n }\n\n private initDefaultBackend() {\n if (this.globalEngine == null) {\n this.initBackend(this.get('BACKEND'), false /* safeMode */);\n }\n }\n}\n\nfunction getGlobalNamespace(): {ENV: Environment} {\n // tslint:disable-next-line:no-any\n let ns: any;\n if (typeof (window) !== 'undefined') {\n ns = window;\n } else if (typeof (process) !== 'undefined') {\n ns = process;\n } else {\n throw new Error('Could not find a global object');\n }\n return ns;\n}\n\nfunction getOrMakeEnvironment(): Environment {\n const ns = getGlobalNamespace();\n if (ns.ENV == null) {\n ns.ENV = new Environment(getFeaturesFromURL());\n setTensorTracker(() => ns.ENV.engine);\n }\n return ns.ENV;\n}\n\nexport let ENV = getOrMakeEnvironment();\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from './environment';\n\nexport function warn(...msg: Array<{}>): void {\n if (!ENV.get('IS_TEST')) {\n console.warn(...msg);\n }\n}\n\nexport function log(...msg: Array<{}>): void {\n if (!ENV.get('IS_TEST')) {\n console.log(...msg);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Gets the new shape of the input Tensor after it's been reshaped\n * to :\n * [blockShape[0], ..., blockShape[M-1], batch / prod(blockShape),\n * inputShape[1], ..., inputShape[N-1]]\n *\n * See step 1: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getReshaped(\n inputShape: number[], blockShape: number[], prod: number,\n batchToSpace = true): number[] {\n let reshaped: number[] = [];\n if (batchToSpace) {\n reshaped = reshaped.concat(blockShape.slice(0));\n reshaped.push(inputShape[0] / prod);\n reshaped = reshaped.concat(inputShape.slice(1));\n } else {\n reshaped = reshaped.concat(inputShape[0]);\n const spatialLength = blockShape.length;\n for (let i = 0; i < spatialLength; ++i) {\n reshaped =\n reshaped.concat([inputShape[i + 1] / blockShape[i], blockShape[i]]);\n }\n reshaped = reshaped.concat(inputShape.slice(spatialLength + 1));\n }\n return reshaped;\n}\n\n/**\n * Gets the permutation that will transpose the dimensions of the\n * reshaped tensor to shape:\n *\n * [batch / prod(block_shape),inputShape[1], blockShape[0], ...,\n * inputShape[M], blockShape[M-1],inputShape[M+1], ..., inputShape[N-1]]\n *\n * see step 2: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getPermuted(\n reshapedRank: number, blockShapeRank: number,\n batchToSpace = true): number[] {\n const permuted = [];\n if (batchToSpace) {\n permuted.push(blockShapeRank);\n for (let i = blockShapeRank + 1; i < reshapedRank; ++i) {\n if (i <= 2 * blockShapeRank) {\n permuted.push(i);\n permuted.push(i - (blockShapeRank + 1));\n } else {\n permuted.push(i);\n }\n }\n } else {\n const permutedBeforeBatch = [];\n const permutedAfterBatch = [];\n for (let i = 1; i < reshapedRank; ++i) {\n if (i >= blockShapeRank * 2 + 1 || i % 2 === 1) {\n permutedAfterBatch.push(i);\n } else {\n permutedBeforeBatch.push(i);\n }\n }\n permuted.push(...permutedBeforeBatch);\n permuted.push(0);\n permuted.push(...permutedAfterBatch);\n }\n return permuted;\n}\n\n/**\n * Gets the shape of the reshaped and permuted input Tensor before any cropping\n * is applied. The new shape will be:\n *\n * [batch / prod(blockShape),inputShape[1] * blockShape[0], ...,\n * inputShape[M] * blockShape[M-1],inputShape[M+1], ..., inputShape[N-1]]\n *\n * See step 3: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getReshapedPermuted(\n inputShape: number[], blockShape: number[], prod: number,\n batchToSpace = true): number[] {\n const reshapedPermuted = [];\n\n if (batchToSpace) {\n reshapedPermuted.push(inputShape[0] / prod);\n } else {\n reshapedPermuted.push(inputShape[0] * prod);\n }\n\n for (let i = 1; i < inputShape.length; ++i) {\n if (i <= blockShape.length) {\n if (batchToSpace) {\n reshapedPermuted.push(blockShape[i - 1] * inputShape[i]);\n } else {\n reshapedPermuted.push(inputShape[i] / blockShape[i - 1]);\n }\n } else {\n reshapedPermuted.push(inputShape[i]);\n }\n }\n\n return reshapedPermuted;\n}\n\n/**\n * Converts the crops argument into the beginning coordinates of a slice\n * operation\n */\nexport function getSliceBeginCoords(\n crops: number[][], blockShape: number): number[] {\n const sliceBeginCoords = [0];\n for (let i = 0; i < blockShape; ++i) {\n sliceBeginCoords.push(crops[i][0]);\n }\n return sliceBeginCoords;\n}\n\n/**\n * converts the crops argument into the size of a slice operation. When\n * combined with getSliceBeginCoords this function allows the reshaped and\n * permuted Tensor to be cropped to its final output shape of:\n *\n * inputShape[1] * blockShape[0] - crops[0,0] - crops[0,1], ...,\n * inputShape[M] * blockShape[M-1] -crops[M-1,0] -\n * crops[M-1,1],inputShape[M+1], ..., inputShape[N-1]]\n *\n * See step 4: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getSliceSize(\n uncroppedShape: number[], crops: number[][], blockShape: number): number[] {\n const sliceSize = uncroppedShape.slice(0, 1);\n for (let i = 0; i < blockShape; ++i) {\n sliceSize.push(uncroppedShape[i + 1] - crops[i][0] - crops[i][1]);\n }\n\n return sliceSize;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as util from '../util';\n\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes: number[], rank: number): boolean {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\n\nexport function combineLocations(\n outputLoc: number[], reduceLoc: number[], axes: number[]): number[] {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n   for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n } else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\n\nexport function computeOutAndReduceShapes(\n aShape: number[], axes: number[]): [number[], number[]] {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\n\nexport function expandShapeToKeepDim(\n shape: number[], axes: number[]): number[] {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\n\nexport function parseAxisParam(\n axis: number|number[], shape: number[]): number[] {\n const rank = shape.length;\n\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n\n // Check for valid range\n util.assert(\n axis.every(ax => ax >= -rank && ax < rank),\n `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n\n // Check for only integers\n util.assert(\n axis.every(ax => util.isInt(ax)),\n `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n\nexport function assertAxesAreInnerMostDims(\n msg: string, axes: number[], rank: number): void {\n util.assert(\n axesAreInnerMostDims(axes, rank),\n `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is neccesary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes: number[], rank: number): number[]|\n null {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result: number[] = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes: number[]): number[] {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\n\nexport function getInnerMostAxes(numAxes: number, rank: number): number[] {\n const res: number[] = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Inputs of size above this threshold will be parallelized by calling multiple\n * shader programs.\n */\nimport {nearestDivisor} from '../util';\n\nexport const PARALLELIZE_THRESHOLD = 30;\n\nexport interface ReduceInfo {\n windowSize: number;\n batchSize: number;\n inSize: number;\n}\n\nexport function computeOptimalWindowSize(inSize: number): number {\n if (inSize <= PARALLELIZE_THRESHOLD) {\n return inSize;\n }\n return nearestDivisor(inSize, Math.floor(Math.sqrt(inSize)));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {nearestDivisor} from '../util';\nimport {PARALLELIZE_THRESHOLD} from './reduce_util';\n\nexport interface SegOpInfo {\n windowSize: number;\n batchSize: number;\n inSize: number;\n numSegments: number;\n}\n\nexport function segOpComputeOptimalWindowSize(\n inSize: number, numSegments: number): number {\n let done = false;\n let res;\n\n if (inSize <= PARALLELIZE_THRESHOLD) {\n res = inSize;\n done = true;\n } else {\n res = nearestDivisor(inSize, Math.floor(Math.sqrt(inSize)));\n }\n\n while (!done) {\n if (res > numSegments || res === inSize) {\n done = true;\n break;\n } else {\n res = nearestDivisor(inSize, res + 1);\n }\n }\n return res;\n}\n\nexport function computeOutShape(\n aShape: number[], axis: number, numSegments: number): number[] {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (dim !== axis) {\n outShape.push(aShape[dim]);\n } else {\n outShape.push(numSegments);\n }\n }\n return outShape;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport * as util from '../util';\n\nexport function assertParamsValid(\n input: Tensor, begin: number[], size: number[]): void {\n util.assert(\n input.rank === begin.length,\n `Error in slice${input.rank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${input.rank}).`);\n util.assert(\n input.rank === size.length,\n `Error in slice${input.rank}D: Length of size ${size} must ` +\n `match the rank of the array (${input.rank}).`);\n\n for (let i = 0; i < input.rank; ++i) {\n util.assert(\n begin[i] + size[i] <= input.shape[i],\n `Error in slice${input.rank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${\n input.shape[i]})`);\n }\n}\n\n/**\n * Calculate the start index and output tensor shape for strided slice op.\n */\nexport function getStridedSlicedInfo(\n shape: number[], begin: number[], end: number[], strides: number[],\n beginMask = 0, endMask = 0): [number[], number[]] {\n // Note that the axis orders are reversed for runtime ops, so the indices,\n // strides and masks must be as well too.\n const startIndex: number[] = [];\n const endIndex: number[] = [];\n for (let i = 0; i < shape.length; i++) {\n startIndex[i] = startForAxis(beginMask, begin, strides, shape, i);\n endIndex[i] = stopForAxis(endMask, end, strides, shape, i);\n }\n\n let size = new Array(shape.length).fill(0);\n size = size.map((d, i) => {\n let count = 0;\n for (let start = startIndex[i];\n !(strides[i] > 0 ? start >= endIndex[i] : start <= endIndex[i]);\n start += strides[i]) {\n count += 1;\n }\n return count;\n });\n return [startIndex, size];\n}\n\nexport function startForAxis(\n beginMask: number, startIndices: number[], strides: number[],\n inputShape: number[], axis: number): number {\n // Begin with the specified index\n let start = startIndices[axis];\n\n // Check the axis bit from right of beginMask\n if (beginMask & 1 << axis) {\n if (strides[axis] > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n } else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n\n return start;\n}\n\nexport function stopForAxis(\n endMask: number, stopIndices: number[], strides: number[],\n inputShape: number[], axis: number): number {\n // Begin with the specified index\n let stop = stopIndices[axis];\n\n // Check the axis bit from right of endMask\n if (endMask & (1 << axis)) {\n if (strides[axis] > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n } else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (strides[axis] > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n } else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n\n return stop;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {CustomGradientFunc, ScopeFn} from './engine';\nimport {ENV} from './environment';\nimport {Scalar, Tensor, Variable} from './tensor';\nimport {NamedTensorMap, TensorContainer} from './tensor_types';\nimport * as util from './util';\n\n/**\n * Create a new gradient scope. Similar to scope, but forces all inner scopes\n * to not clean up so that gradient operations can be used inside of this\n * scope.\n * @param nameOrScopeFn The name of the scope, or the function to execute.\n * If a name is provided, the 2nd argument should be the function.\n * If a name is provided, and debug mode is on, the timing and the memory\n * usage of the function will be tracked and displayed on the console\n * using the provided name.\n * @param scopeFn The function to execute.\n */\nfunction gradScope(\n nameOrScopeFn: string|ScopeFn, scopeFn?: ScopeFn): T {\n return ENV.engine.tidy(nameOrScopeFn, scopeFn, true /* gradScope */);\n}\n\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction grad(f: (x: I) => O): (\n x: I, dy?: O) => I {\n util.assert(util.isFunction(f), 'The f passed in grad(f) must be a function');\n return (x: I, dy?: O): I => {\n util.assert(\n x instanceof Tensor, 'The x passed in grad(f)(x) must be a tensor');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in grad(f)(x, dy) must be a tensor');\n return ENV.engine.tidy(() => {\n const {value, grads} = ENV.engine.gradients(() => f(x), [x], dy);\n if (dy != null) {\n util.assertShapesMatch(\n value.shape, dy.shape,\n 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0] as I;\n });\n };\n}\n\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction grads(f: (...args: Tensor[]) => O): (\n args: Tensor[], dy?: O) => Tensor[] {\n util.assert(\n util.isFunction(f), 'The f passed in grads(f) must be a function');\n return (args: Tensor[], dy?: O): Tensor[] => {\n util.assert(\n Array.isArray(args) && args.every(arg => arg instanceof Tensor),\n 'The args passed in grads(f)(args) must be an array of tensors');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in grads(f)(args, dy) must be a tensor');\n return ENV.engine.tidy(() => {\n const {value, grads} = ENV.engine.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(\n value.shape, dy.shape,\n 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n\n/**\n * Like `grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction valueAndGrad(f: (x: I) => O): (\n x: I, dy?: O) => {\n value: O;\n grad: I;\n} {\n util.assert(\n util.isFunction(f), 'The f passed in valueAndGrad(f) must be a function');\n return (x: I, dy?: O) => {\n util.assert(\n x instanceof Tensor,\n 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const {grads, value} = ENV.engine.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return {grad: grads[0] as I, value: value as O};\n };\n}\n\n/**\n * Like `grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction valueAndGrads(f: (...args: Tensor[]) => O): (\n args: Tensor[], dy?: O) => {\n grads: Tensor[];\n value: O;\n} {\n util.assert(\n util.isFunction(f),\n 'The f passed in valueAndGrads(f) must be a function');\n return (args: Tensor[], dy?: O) => {\n util.assert(\n Array.isArray(args) && args.every(arg => arg instanceof Tensor),\n 'The args passed in valueAndGrads(f)(args) must be array of tensors');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENV.engine.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(\n res.value.shape, dy.shape,\n 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of trainable variables. Defaults to all variables.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction variableGrads(f: () => Scalar, varList?: Variable[]):\n {value: Scalar, grads: NamedTensorMap} {\n util.assert(\n util.isFunction(f),\n 'The f passed in variableGrads(f) must be a function');\n util.assert(\n varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable),\n 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n if (varList == null) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENV.engine.registeredVariables) {\n varList.push(ENV.engine.registeredVariables[varName]);\n }\n }\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(\n varList.length > 0,\n `variableGrads() expects at least one of the input variables to be ` +\n `trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n\n const allowNoGradients = true;\n const {value, grads} =\n ENV.engine.gradients(f, varList, null, allowNoGradients);\n\n util.assert(\n grads.some(g => g != null),\n 'Cannot find a connection between any variable and the result of the ' +\n 'loss function y=f(x). Please make sure the operations that use ' +\n 'variables are inside the function f passed to minimize().');\n util.assert(\n value.rank === 0,\n `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n\n const namedGrads: NamedTensorMap = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n return {value, grads: namedGrads};\n}\n\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs) => {value: Tensor, gradFunc: dy => Tensor[]}` and returns\n * another function `g(...inputs)` which takes the same inputs as `f`. When\n * called, `g` returns `f().value`. In backward mode, custom gradients with\n * respect to each input of `f` are computed using `f().gradFunc`.\n *\n * ```js\n * const customOp = tf.customGrad(x => {\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {value: x.square(), gradFunc: dy => [dy.mul(x.abs())]};\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy) => Tensor[]}`, where `gradFunc` returns\n * the custom gradients of `f` with respect to its inputs.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction customGrad(f: CustomGradientFunc):\n (...args: Tensor[]) => T {\n return ENV.engine.customGrad(f);\n}\n\nfunction checkGrads(grads: Tensor[]) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(\n `Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\n\nexport {\n gradScope,\n customGrad,\n variableGrads,\n valueAndGrad,\n valueAndGrads,\n grad,\n grads,\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from './environment';\nimport {Tensor} from './tensor';\nimport {ArrayData, DataType, TensorLike} from './types';\nimport {inferShape, isTypedArray, toTypedArray} from './util';\n\nexport function convertToTensor(\n x: T|TensorLike, argName: string, functionName: string,\n dtype: DataType = 'float32'): T {\n dtype = dtype || 'float32';\n if (x instanceof Tensor) {\n return x;\n }\n if (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean') {\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got ${x.constructor.name}`);\n }\n const inferredShape = inferShape(x);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x] as number[];\n }\n return Tensor.make(\n inferredShape,\n {values: toTypedArray(x as ArrayData, dtype, ENV.get('DEBUG'))},\n dtype);\n}\n\nexport function convertToTensorArray(\n arg: T[]|TensorLike[], argName: string, functionName: string): T[] {\n if (!Array.isArray(arg)) {\n throw new Error(\n `Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg as T[];\n return tensors.map(\n (t, i) => convertToTensor(t, `${argName}[${i}]`, functionName));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\n\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f: {[name: string]: T}): T {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(\n `Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n\n let opName = keys[0];\n const fn = f[opName];\n\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n\n // tslint:disable-next-line:no-any\n const f2 = (...args: any[]) => {\n ENV.engine.startScope(opName);\n try {\n const result = fn(...args);\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENV.engine.endScope(result);\n return result;\n } catch (ex) {\n ENV.engine.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', {value: opName, configurable: true});\n\n // tslint:disable-next-line:no-any\n return f2 as any as T;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {customGrad} from '../gradients';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction softmax_(logits: T|TensorLike, dim = -1): T {\n const $logits = convertToTensor(logits, 'logits', 'softmax');\n\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error(\n 'Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n\n const customOp = customGrad(logits => {\n // Do it in log space for numerical stability.\n // exp(X - logSumExp(X))\n const keepDims = true;\n const lse = logits.logSumExp([dim], keepDims);\n const logResult = logits.toFloat().sub(lse);\n const y = logResult.exp() as T;\n\n const gradFunc = (dy: T) => {\n const dyTimesY = dy.mul(y);\n const keepDims = true;\n return dyTimesY.sub(dyTimesY.sum([dim], keepDims).mul(y));\n };\n\n return {value: y, gradFunc};\n });\n\n return customOp($logits);\n}\n\nexport const softmax = op({softmax_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, Tensor6D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike, TensorLike1D, TensorLike2D, TensorLike3D, TensorLike4D, TensorLike5D, TensorLike6D} from '../types';\nimport {ArrayData, DataType, Rank, ShapeMap} from '../types';\nimport {assertNonNull, assertShapesMatch, getTypedArrayFromDType, inferShape, isTypedArray, makeOnesTypedArray, makeZerosTypedArray, sizeFromShape, toTypedArray} from '../util';\nimport {op} from './operation';\n\n/**\n * Creates a `Tensor` with the provided values, shape and dtype.\n *\n * ```js\n * // Pass an array of values to create a vector.\n * tf.tensor([1, 2, 3, 4]).print();\n * ```\n *\n * ```js\n * // Pass a nested array of values to make a matrix or a higher\n * // dimensional tensor.\n * tf.tensor([[1, 2], [3, 4]]).print();\n * ```\n *\n * ```js\n * // Pass a flat array and specify a shape yourself.\n * tf.tensor([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor(\n values: TensorLike, shape?: ShapeMap[R],\n dtype: DataType = 'float32'): Tensor {\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean') {\n throw new Error(\n 'values passed to tensor(values) must be an ' +\n 'array of numbers or booleans, or a TypedArray');\n }\n const inferredShape = inferShape(values);\n if (shape != null && inferredShape.length !== 1) {\n assertShapesMatch(\n shape, inferredShape,\n `Error creating a new Tensor. ` +\n `Inferred shape (${inferredShape}) does not match the ` +\n `provided shape (${shape}). `);\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values] as number[];\n }\n shape = shape || inferredShape;\n return Tensor.make(\n shape, {\n values:\n toTypedArray(values as ArrayData, dtype, ENV.get('DEBUG'))\n },\n dtype);\n}\n\n/**\n * Creates rank-0 `Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction scalar(value: number|boolean, dtype: DataType = 'float32'): Scalar {\n if (isTypedArray(value) || Array.isArray(value)) {\n throw new Error(\n 'Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean)');\n }\n return tensor(value, [], dtype);\n}\n\n/**\n * Creates rank-1 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor1d` as it makes the code more readable.\n *\n * ```js\n * tf.tensor1d([1, 2, 3]).print();\n * ```\n *\n * @param values The values of the tensor. Can be array of numbers,\n * or a `TypedArray`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor1d(values: TensorLike1D, dtype: DataType = 'float32'): Tensor1D {\n assertNonNull(values);\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 1) {\n throw new Error('tensor1d() requires values to be a flat/TypedArray');\n }\n return tensor(values, inferredShape as [number], dtype);\n}\n\n/**\n * Creates rank-2 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor2d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor2d([[1, 2], [3, 4]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. If not provided, it is inferred from\n * `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor2d(\n values: TensorLike2D, shape?: [number, number],\n dtype: DataType = 'float32'): Tensor2D {\n assertNonNull(values);\n if (shape != null && shape.length !== 2) {\n throw new Error('tensor2d() requires shape to have two numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 2 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor2d() requires values to be number[][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor2d() requires shape to be provided when `values` ' +\n 'are a flat/TypedArray');\n }\n shape = shape || inferredShape as [number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-3 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor3d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor3d([[[1], [2]], [[3], [4]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor3d([1, 2, 3, 4], [2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. If not provided, it is inferred from\n * `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor3d(\n values: TensorLike3D, shape?: [number, number, number],\n dtype: DataType = 'float32'): Tensor3D {\n assertNonNull(values);\n if (shape != null && shape.length !== 3) {\n throw new Error('tensor3d() requires shape to have three numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 3 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor3d() requires values to be number[][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor3d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape || inferredShape as [number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-4 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor4d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor4d([[[[1], [2]], [[3], [4]]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor4d(\n values: TensorLike4D, shape?: [number, number, number, number],\n dtype: DataType = 'float32'): Tensor4D {\n assertNonNull(values);\n if (shape != null && shape.length !== 4) {\n throw new Error('tensor4d() requires shape to have four numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 4 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor4d() requires values to be number[][][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor4d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape || inferredShape as [number, number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-5 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor5d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor5d([[[[[1], [2]], [[3], [4]]]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor5d([1, 2, 3, 4, 5, 6, 7, 8], [1, 2, 2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor5d(\n values: TensorLike5D, shape?: [number, number, number, number, number],\n dtype: DataType = 'float32'): Tensor5D {\n assertNonNull(values);\n if (shape != null && shape.length !== 5) {\n throw new Error('tensor5d() requires shape to have five numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 5 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor5d() requires values to be ' +\n 'number[][][][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor5d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape || inferredShape as [number, number, number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-6 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor6d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor6d([[[[[[1],[2]],[[3],[4]]],[[[5],[6]],[[7],[8]]]]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor6d([1, 2, 3, 4, 5, 6, 7, 8], [1, 1, 2, 2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor6d(\n values: TensorLike6D,\n shape?: [number, number, number, number, number, number],\n dtype: DataType = 'float32'): Tensor6D {\n assertNonNull(values);\n if (shape != null && shape.length !== 6) {\n throw new Error('tensor6d() requires shape to have six numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 6 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor6d() requires values to be number[][][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor6d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape ||\n inferredShape as [number, number, number, number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates a `Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction ones(\n shape: ShapeMap[R], dtype: DataType = 'float32'): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction zeros(\n shape: ShapeMap[R], dtype: DataType = 'float32'): Tensor {\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` filled with a scalar value.\n *\n * ```js\n * tf.fill([2, 2], 4).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param value The scalar value to fill the tensor with.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction fill(\n shape: ShapeMap[R], value: number, dtype: DataType = 'float32'): Tensor {\n const values = getTypedArrayFromDType(dtype, sizeFromShape(shape));\n values.fill(value);\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction onesLike_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'onesLike');\n return ones($x.shape, $x.dtype) as T;\n}\n\n/**\n * Creates a `Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction zerosLike_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n return zeros($x.shape, $x.dtype) as T;\n}\n\n/**\n * Return an evenly spaced sequence of numbers over the given interval.\n *\n * ```js\n * tf.linspace(0, 9, 10).print();\n * ```\n * @param start The start value of the sequence.\n * @param stop The end value of the sequence.\n * @param num The number of values to generate.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction linspace(start: number, stop: number, num: number): Tensor1D {\n if (num === 0) {\n throw new Error('Cannot request zero samples');\n }\n\n const step = (stop - start) / (num - 1);\n\n const values = makeZerosTypedArray(num, 'float32');\n values[0] = start;\n for (let i = 1; i < values.length; i++) {\n values[i] = values[i - 1] + step;\n }\n\n return tensor1d(values, 'float32');\n}\n\n/**\n * Creates a new `Tensor1D` filled with the numbers in the range provided.\n *\n * The tensor is a is half-open interval meaning it includes start, but\n * excludes stop. Decrementing ranges and negative step values are also\n * supported.\n *\n * ```js\n * tf.range(0, 9, 2).print();\n * ```\n *\n * @param start An integer start value\n * @param stop An integer stop value\n * @param step An integer increment (will default to 1 or -1)\n * @param dtype The data type of the output tensor. Defaults to 'float32'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction range(\n start: number, stop: number, step = 1,\n dtype: 'float32'|'int32' = 'float32'): Tensor1D {\n if (step === 0) {\n throw new Error('Cannot have a step of zero');\n }\n\n const sameStartStop = start === stop;\n const increasingRangeNegativeStep = start < stop && step < 0;\n const decreasingRangePositiveStep = stop < start && step > 1;\n\n if (sameStartStop || increasingRangeNegativeStep ||\n decreasingRangePositiveStep) {\n return zeros([0], dtype);\n }\n\n const numElements = Math.abs(Math.ceil((stop - start) / step));\n const values = makeZerosTypedArray(numElements, dtype);\n\n if (stop < start && step === 1) {\n // Auto adjust the step's sign if it hasn't been set\n // (or was set to 1)\n step = -1;\n }\n\n values[0] = start;\n for (let i = 1; i < values.length; i++) {\n values[i] = values[i - 1] + step;\n }\n\n return tensor1d(values, dtype);\n}\n\nexport {\n fill,\n linspace,\n ones,\n range,\n scalar,\n tensor,\n tensor1d,\n tensor2d,\n tensor3d,\n tensor4d,\n tensor5d,\n tensor6d,\n zeros\n};\n\nexport const onesLike = op({onesLike_});\nexport const zerosLike = op({zerosLike_});\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport enum DType {\n float32 = 'float32',\n int32 = 'int32',\n bool = 'bool'\n}\n\n/** @docalias number[] */\nexport interface ShapeMap {\n R0: number[];\n R1: [number];\n R2: [number, number];\n R3: [number, number, number];\n R4: [number, number, number, number];\n R5: [number, number, number, number, number];\n R6: [number, number, number, number, number, number];\n}\n\n/** @hidden */\nexport interface DataTypeMap {\n float32: Float32Array;\n int32: Int32Array;\n bool: Uint8Array;\n}\n/** @docalias 'float32'|'int32'|'bool' */\nexport type DataType = keyof DataTypeMap;\nexport type TypedArray = DataTypeMap[DataType];\n\nexport enum Rank {\n R0 = 'R0',\n R1 = 'R1',\n R2 = 'R2',\n R3 = 'R3',\n R4 = 'R4',\n R5 = 'R5',\n R6 = 'R6'\n}\n\nexport type FlatVector = boolean[]|number[]|TypedArray;\nexport type RegularArray =\n T[]|T[][]|T[][][]|T[][][][]|T[][][][][]|T[][][][][][];\nexport type ArrayData =\n DataTypeMap[D]|RegularArray|RegularArray;\n\n// tslint:disable-next-line:no-any\nexport interface RecursiveArray {\n [index: number]: T|RecursiveArray;\n}\n\nenum UpcastInt32AndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'int32'\n}\n\nenum UpcastBoolAndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'bool'\n}\n\nenum UpcastFloat32AndMap {\n 'float32' = 'float32',\n 'int32' = 'float32',\n 'bool' = 'float32'\n}\n\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap\n};\n\nexport function upcastType(typeA: DataType, typeB: DataType): DataType {\n return upcastTypeMap[typeA][typeB];\n}\n\n/** Returns the output type after summation. */\nexport function sumOutType(type: DataType) {\n return upcastType(type, 'int32');\n}\n\n/** @docalias TypedArray|Array */\nexport type TensorLike =\n TypedArray|number|boolean|number[]|number[][]|number[][][]|number[][][][]|\n number[][][][][]|number[][][][][][]|boolean[]|boolean[][]|boolean[][][]|\n boolean[][][][]|boolean[][][][][]|boolean[][][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike1D = TypedArray|number[]|boolean[];\n/** @docalias TypedArray|Array */\nexport type TensorLike2D = TypedArray|number[]|number[][]|boolean[]|boolean[][];\n/** @docalias TypedArray|Array */\nexport type TensorLike3D =\n TypedArray|number[]|number[][][]|boolean[]|boolean[][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike4D =\n TypedArray|number[]|number[][][][]|boolean[]|boolean[][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike5D =\n TypedArray|number[]|number[][][][][]|boolean[]|boolean[][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike6D =\n TypedArray|number[]|number[][][][][][]|boolean[]|boolean[][][][][][];\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {scalar} from '../ops/tensor_ops';\nimport {Tensor} from '../tensor';\nimport {Rank} from '../types';\nimport {DataType, ShapeMap} from '../types';\nimport {hasEncodingLoss} from '../util';\nimport {KernelBackend} from './backend';\n\nexport function castTensor(\n x: T, dtype: DataType, backend: KernelBackend): T {\n if (!hasEncodingLoss(x.dtype, dtype)) {\n // We don't change the underlying data, since we cast to higher\n // precision.\n return Tensor.make(x.shape, {dataId: x.dataId}, dtype) as T;\n }\n if (dtype === 'int32') {\n return backend.int(x);\n } else if (dtype === 'bool') {\n return backend.notEqual(x, scalar(0, x.dtype)) as T;\n } else {\n throw new Error(`Error in Cast: unknown dtype argument (${dtype})`);\n }\n}\n\nexport function reshapeTensor(\n x: T, shape: ShapeMap[R]): Tensor {\n return Tensor.make(shape, {dataId: x.dataId}, x.dtype);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Implementation of the NonMaxSuppression kernel shared between webgl and cpu.\n */\n\nimport {tensor1d} from '../ops/tensor_ops';\nimport {Tensor1D} from '../tensor';\nimport {TypedArray} from '../types';\n\nexport function nonMaxSuppressionImpl(\n boxes: TypedArray, scores: TypedArray, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number): Tensor1D {\n const candidates = Array.from(scores)\n .map((score, boxIndex) => ({score, boxIndex}))\n .filter(c => c.score > scoreThreshold)\n .sort((c1, c2) => c2.score - c1.score);\n\n const selected: number[] = [];\n\n for (let i = 0; i < candidates.length; i++) {\n const {score, boxIndex} = candidates[i];\n if (score < scoreThreshold) {\n break;\n }\n\n let ignoreCandidate = false;\n for (let j = selected.length - 1; j >= 0; --j) {\n const iou = intersectionOverUnion(boxes, boxIndex, selected[j]);\n if (iou >= iouThreshold) {\n ignoreCandidate = true;\n break;\n }\n }\n\n if (!ignoreCandidate) {\n selected.push(boxIndex);\n if (selected.length >= maxOutputSize) {\n break;\n }\n }\n }\n\n return tensor1d(selected, 'int32');\n}\n\nfunction intersectionOverUnion(boxes: TypedArray, i: number, j: number) {\n const iCoord = boxes.subarray(i * 4, i * 4 + 4);\n const jCoord = boxes.subarray(j * 4, j * 4 + 4);\n const yminI = Math.min(iCoord[0], iCoord[2]);\n const xminI = Math.min(iCoord[1], iCoord[3]);\n const ymaxI = Math.max(iCoord[0], iCoord[2]);\n const xmaxI = Math.max(iCoord[1], iCoord[3]);\n const yminJ = Math.min(jCoord[0], jCoord[2]);\n const xminJ = Math.min(jCoord[1], jCoord[3]);\n const ymaxJ = Math.max(jCoord[0], jCoord[2]);\n const xmaxJ = Math.max(jCoord[1], jCoord[3]);\n const areaI = (ymaxI - yminI) * (xmaxI - xminI);\n const areaJ = (ymaxJ - yminJ) * (xmaxJ - xminJ);\n if (areaI <= 0 || areaJ <= 0) {\n return 0.0;\n }\n const intersectionYmin = Math.max(yminI, yminJ);\n const intersectionXmin = Math.max(xminI, xminJ);\n const intersectionYmax = Math.min(ymaxI, ymaxJ);\n const intersectionXmax = Math.min(xmaxI, xmaxJ);\n const intersectionArea = Math.max(intersectionYmax - intersectionYmin, 0.0) *\n Math.max(intersectionXmax - intersectionXmin, 0.0);\n return intersectionArea / (areaI + areaJ - intersectionArea);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** An implementation of the TopK kernel shared between webgl and cpu. */\n\nimport {tensor} from '../ops/tensor_ops';\nimport {Tensor} from '../tensor';\nimport {DataType, TypedArray} from '../types';\nimport {getTypedArrayFromDType} from '../util';\n\nexport function topkImpl(\n x: TypedArray, xShape: number[], xDtype: DataType, k: number,\n sorted: boolean): [T, T] {\n // Reshape into a 2d tensor [batch, lastDim] and compute topk along lastDim.\n const lastDim = xShape[xShape.length - 1];\n const [batch, size] = [x.length / lastDim, lastDim];\n const allTopKVals = getTypedArrayFromDType(xDtype, batch * k);\n const allTopKIndices = getTypedArrayFromDType('int32', batch * k);\n\n for (let b = 0; b < batch; b++) {\n const offset = b * size;\n const vals = x.subarray(offset, offset + size);\n const valAndInd: Array<{value: number, index: number}> = [];\n for (let i = 0; i < vals.length; i++) {\n valAndInd.push({value: vals[i], index: i});\n }\n valAndInd.sort((a, b) => b.value - a.value);\n\n const outOffset = b * k;\n const topKVals = allTopKVals.subarray(outOffset, outOffset + k);\n const topKIndices = allTopKIndices.subarray(outOffset, outOffset + k);\n for (let i = 0; i < k; i++) {\n topKVals[i] = valAndInd[i].value;\n topKIndices[i] = valAndInd[i].index;\n }\n }\n // Reshape back to the original input shape, except that the last\n // dimension is k.\n const outputShape = xShape.slice();\n outputShape[outputShape.length - 1] = k;\n return [\n tensor(allTopKVals, outputShape, xDtype) as T,\n tensor(allTopKIndices, outputShape, 'int32') as T\n ];\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ReduceInfo} from '../../ops/reduce_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ArgMinMaxProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[];\n userCode: string;\n\n constructor(reduceInfo: ReduceInfo, op: 'max'|'min', firstPass: boolean) {\n const windowSize = reduceInfo.windowSize;\n const batchSize = reduceInfo.batchSize;\n const inSize = reduceInfo.inSize;\n const outSize = Math.ceil(inSize / windowSize);\n if (!firstPass) {\n this.variableNames.push('bestIndicesA');\n }\n this.outputShape = [batchSize, outSize];\n const compOp = (op === 'max') ? '>' : '<';\n const indexSnippet = firstPass ?\n 'inOffset + i;' :\n 'round(getBestIndicesA(batch, inOffset + i));';\n\n this.userCode = `\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${windowSize};\n\n int bestIndex = 0;\n float bestValue = getA(batch, inOffset);\n\n for (int i = 0; i < ${windowSize}; i++) {\n int inIdx = ${indexSnippet};\n float candidate = getA(batch, inIdx);\n if (candidate ${compOp} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class AvgPool2DBackpropProgram implements GPGPUProgram {\n variableNames = ['dy'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n\n const avgMultiplier = 1 / (filterHeight * filterWidth);\n\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n const float avgMultiplier = float(${avgMultiplier});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(\n inShape: number[], outShape: number[]): number[] {\n const inRank = inShape.length;\n const dims: number[] = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(\n inShape: number[], outShape: number[]): number[] {\n const result: number[] = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\n\n/**\n * Given the output of `getBroadcastDims()`, returns true if the broadcasting\n * is along the outer-most dimensions of the input.\n */\nexport function broadcastDimsAreOuter(dims: number[]): boolean {\n for (let i = 0; i < dims.length; i++) {\n if (dims[i] !== i) {\n return false;\n }\n }\n return true;\n}\n\nexport function assertAndGetBroadcastShape(\n shapeA: number[], shapeB: number[]): number[] {\n const result: number[] = [];\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n const l = Math.max(shapeA.length, shapeB.length);\n\n for (let i = 0; i < l; i++) {\n const a = shapeA[shapeA.length - i - 1] || 1;\n const b = shapeB[shapeB.length - i - 1] || 1;\n if (a > 1 && b > 1 && a !== b) {\n throw Error(errMsg);\n }\n result.unshift(Math.max(a, b));\n }\n return result;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as broadcast_util from '../../ops/broadcast_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class BatchNormProgram implements GPGPUProgram {\n variableNames: string[];\n outputShape: number[] = [];\n userCode: string;\n supportsBroadcasting = true;\n\n constructor(\n xShape: number[], meanShape: number[], varianceShape: number[],\n offsetShape: number[]|null, scaleShape: number[]|null,\n varianceEpsilon: number) {\n this.variableNames = ['x', 'mean', 'variance'];\n broadcast_util.assertAndGetBroadcastShape(xShape, meanShape);\n broadcast_util.assertAndGetBroadcastShape(xShape, varianceShape);\n\n let offsetSnippet = '0.0';\n if (offsetShape != null) {\n broadcast_util.assertAndGetBroadcastShape(xShape, offsetShape);\n this.variableNames.push('offset');\n offsetSnippet = 'getOffsetAtOutCoords()';\n }\n\n let scaleSnippet = '1.0';\n if (scaleShape != null) {\n broadcast_util.assertAndGetBroadcastShape(xShape, scaleShape);\n this.variableNames.push('scale');\n scaleSnippet = 'getScaleAtOutCoords()';\n }\n\n this.outputShape = xShape;\n this.userCode = `\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${offsetSnippet};\n float scale = ${scaleSnippet};\n float inv = scale * inversesqrt(variance + float(${varianceEpsilon}));\n setOutput((x - mean) * inv + offset);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as broadcast_util from '../../ops/broadcast_util';\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {GPGPUProgram} from './gpgpu_math';\n\nconst CHECK_NAN_SNIPPET = `\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n`;\n\nexport const ADD = 'return a + b;';\nexport const SUB = 'return a - b;';\nexport const MUL = 'return a * b;';\nexport const DIV = `if (a == b) return 1.0;\n return a / b;`;\n\n// We use native integer division to deal with floating point imprecision. Since\n// we implement floor division and glsl implements truncated division, we\n// correct for this by subtracting 1 from result when the result is negative and\n// there is a remainder.\nexport const INT_DIV = `\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n`;\n\nexport const POW = `\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n`;\nexport const SQUARED_DIFFERENCE = 'return (a - b) * (a - b);';\n\nexport const EQUAL = `return float(a == b);`;\n\nexport const NOT_EQUAL = `return float(a != b);`;\n\nexport const LESS = `return float(a < b);`;\n\nexport const LESS_EQUAL = `return float(a <= b);`;\n\nexport const GREATER = `return float(a > b);`;\n\nexport const GREATER_EQUAL = `return float(a >= b);`;\n\nexport const LOGICAL_AND = `return float(a >= 1.0 && b >= 1.0);`;\n\nexport const LOGICAL_OR = `return float(a >= 1.0 || b >= 1.0);`;\n\nexport const MAX = CHECK_NAN_SNIPPET + `\n return max(a, b);\n`;\nexport const MIN = CHECK_NAN_SNIPPET + `\n return min(a, b);\n`;\nexport const MOD = `if (b == 0.0) return NAN;\n return mod(a, b);`;\n\nexport const ATAN2 = CHECK_NAN_SNIPPET + `\n return atan(a, b);\n`;\n\nexport const ELU_DER = `return (b >= 1.0) ? a : a * (b + 1.0);`;\n\nexport class BinaryOpProgram implements GPGPUProgram {\n variableNames = ['A', 'B'];\n outputShape: number[];\n userCode: string;\n supportsBroadcasting = true;\n\n // Caching uniform location for speed.\n startLoc: WebGLUniformLocation;\n\n constructor(op: string, aShape: number[], bShape: number[]) {\n this.outputShape =\n broadcast_util.assertAndGetBroadcastShape(aShape, bShape);\n this.userCode = `\n uniform float NAN;\n float binaryOperation(float a, float b) {\n ${op}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `;\n }\n\n getCustomSetupFunc() {\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.startLoc == null) {\n this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN');\n if (this.startLoc == null) {\n // This means the compiler has optimized and realized it doesn't need\n // the uniform.\n return;\n }\n }\n gpgpu.gl.uniform1f(this.startLoc, NaN);\n };\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ClipProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n constructor(aShape: number[], min: number, max: number) {\n this.outputShape = aShape;\n const minFixed = min.toFixed(20);\n const maxFixed = max.toFixed(20);\n this.userCode = `\n void main() {\n float value = getAAtOutCoords();\n if (isNaN(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, ${minFixed}, ${maxFixed}));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as util from '../util';\n\nexport function assertParams(aShape: number[], bShape: number[], axis: number) {\n const aRank = aShape.length;\n const bRank = bShape.length;\n util.assert(\n aShape.length === bShape.length,\n `Error in concat${aRank}D: rank of x1 (${aRank}) and x2 (${bRank}) ` +\n `must be the same.`);\n\n util.assert(\n axis >= 0 && axis < aRank,\n `Error in concat${aRank}D: axis must be ` +\n `between 0 and ${aRank - 1}.`);\n\n for (let i = 0; i < aRank; i++) {\n util.assert(\n (i === axis) || (aShape[i] === bShape[i]),\n `Error in concat${aRank}D: Shape (${aShape}) does not match ` +\n `(${bShape}) along the non-concatenated axis ${i}.`);\n }\n}\n\nexport function computeOutShape(\n x1Shape: number[], x2Shape: number[], axis: number): number[] {\n util.assert(\n x1Shape.length === x2Shape.length,\n 'x1 and x2 should have the same rank.');\n const outputShape = x1Shape.slice();\n outputShape[axis] += x2Shape[axis];\n return outputShape;\n}\n\nexport function computeGradientSliceShapes(\n aShape: [number, number], bShape: [number, number]) {\n return {\n aBegin: [0, 0] as [number, number],\n aSize: aShape,\n bBegin: [0, aShape[1]] as [number, number],\n bSize: bShape\n };\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as concat_util from '../../ops/concat_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ConcatProgram implements GPGPUProgram {\n variableNames = ['A', 'B'];\n outputShape: number[] = [];\n userCode: string;\n\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n constructor(aShape: [number, number], bShape: [number, number]) {\n this.outputShape =\n concat_util.computeOutShape(aShape, bShape, 1 /* axis */);\n\n this.userCode = `\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n float value = 0.0;\n if (yC < ${aShape[1]}) {\n value = getA(yR, yC);\n } else {\n yC -= ${aShape[1]};\n value = getB(yR, yC);\n }\n\n setOutput(value);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class Conv2DDerFilterProgram implements GPGPUProgram {\n variableNames = ['x', 'dy'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.filterShape;\n\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${convInfo.batchSize}; b++) {\n for (int yR = 0; yR < ${convInfo.outHeight}; yR++) {\n int xR = wR + yR * ${strideHeight} - ${padTop};\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${convInfo.outWidth}; yC++) {\n int xC = wC + yC * ${strideWidth} - ${padLeft};\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n\nexport class Conv2DDerInputProgram implements GPGPUProgram {\n variableNames = ['dy', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${filterHeight} - 1 - wR;\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${filterWidth} - 1 - wC;\n\n for (int d2 = 0; d2 < ${convInfo.outChannels}; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class DepthwiseConv2DDerFilterProgram implements GPGPUProgram {\n variableNames = ['x', 'dy'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.filterShape;\n\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n const channelMul = convInfo.outChannels / convInfo.inChannels;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${channelMul} + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < ${convInfo.batchSize}; b++) {\n for (int yR = 0; yR < ${convInfo.outHeight}; yR++) {\n int xR = wR + yR * ${strideHeight} - ${padTop};\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${convInfo.outWidth}; yC++) {\n int xC = wC + yC * ${strideWidth} - ${padLeft};\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n\nexport class DepthwiseConv2DDerInputProgram implements GPGPUProgram {\n variableNames = ['dy', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n const channelMul = convInfo.outChannels / convInfo.inChannels;\n\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${filterHeight} - 1 - wR;\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${filterWidth} - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < ${channelMul}; dm++) {\n int d2 = d1 * ${channelMul} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class Conv2DProgram implements GPGPUProgram {\n variableNames = ['x', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.outShape;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n\n const inputDepthNearestVec4 = Math.floor(convInfo.inChannels / 4) * 4;\n const inputDepthVec4Remainder = convInfo.inChannels % 4;\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR * ${dilationHeight};\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n int xC = xCCorner + wC * ${dilationWidth};\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${inputDepthNearestVec4}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${inputDepthVec4Remainder === 1}) {\n dotProd +=\n getX(batch, xR, xC, ${inputDepthNearestVec4}) *\n getW(wR, wC, ${inputDepthNearestVec4}, d2);\n } else if (${inputDepthVec4Remainder === 2}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${inputDepthNearestVec4}),\n getX(batch, xR, xC, ${inputDepthNearestVec4} + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, ${inputDepthNearestVec4}, d2),\n getW(wR, wC, ${inputDepthNearestVec4} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${inputDepthVec4Remainder === 3}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${inputDepthNearestVec4}),\n getX(batch, xR, xC, ${inputDepthNearestVec4} + 1),\n getX(batch, xR, xC, ${inputDepthNearestVec4} + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, ${inputDepthNearestVec4}, d2),\n getW(wR, wC, ${inputDepthNearestVec4} + 1, d2),\n getW(wR, wC, ${inputDepthNearestVec4} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class DepthwiseConv2DProgram implements GPGPUProgram {\n variableNames = ['x', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.outShape;\n\n const xNumRows = convInfo.inHeight;\n const xNumCols = convInfo.inWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const channelMul = convInfo.outChannels / convInfo.inChannels;\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${channelMul};\n int q = d2 - d1 * ${channelMul};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR * ${dilationHeight};\n\n if (xR < 0 || xR >= ${xNumRows}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n int xC = xCCorner + wC * ${dilationWidth};\n\n if (xC < 0 || xC >= ${xNumCols}) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport * as broadcast_util from '../../ops/broadcast_util';\nimport * as util from '../../util';\n\nexport type ShapeInfo = {\n logicalShape: number[],\n texShape: [number, number],\n isUniform: boolean\n};\n\nexport type InputInfo = {\n name: string,\n shapeInfo: ShapeInfo\n};\n\nexport function makeShader(\n inputsInfo: InputInfo[], outputShape: ShapeInfo, userCode: string,\n broadcast: boolean): string {\n let inputPrefixSnippet: string[]|string = inputsInfo.map(x => {\n const size = util.sizeFromShape(x.shapeInfo.logicalShape);\n if (x.shapeInfo.isUniform) {\n return `uniform float ${x.name}${size > 1 ? `[${size}]` : ''};`;\n }\n return `uniform sampler2D ${x.name};`;\n });\n inputPrefixSnippet = inputPrefixSnippet.join('\\n');\n const inputSamplingSnippet =\n inputsInfo.map(x => getInputSamplingSnippet(x, outputShape, broadcast))\n .join('\\n');\n const outTexShape = outputShape.texShape;\n const outputSamplingSnippet =\n getOutputSamplingSnippet(outputShape.logicalShape, outTexShape);\n const source = [\n SHADER_PREFIX, FLOAT_TEXTURE_SAMPLE_SNIPPET,\n FLOAT_TEXTURE_SETOUTPUT_SNIPPET, inputPrefixSnippet, outputSamplingSnippet,\n inputSamplingSnippet, userCode\n ].join('\\n');\n return source;\n}\n\nfunction getSamplerFromInInfo(inInfo: InputInfo): string {\n const shape = inInfo.shapeInfo.logicalShape;\n switch (shape.length) {\n case 0:\n return getSamplerScalar(inInfo);\n case 1:\n return getSampler1D(inInfo);\n case 2:\n return getSampler2D(inInfo);\n case 3:\n return getSampler3D(inInfo);\n case 4:\n return getSampler4D(inInfo);\n case 5:\n return getSampler5D(inInfo);\n case 6:\n return getSampler6D(inInfo);\n default:\n throw new Error(\n `${shape.length}-D input sampling` +\n ` is not yet supported`);\n }\n}\n\nfunction getInputSamplingSnippet(\n inInfo: InputInfo, outShapeInfo: ShapeInfo, broadcast: boolean): string {\n let res = getSamplerFlat(inInfo);\n res += getSamplerFromInInfo(inInfo);\n\n // If input and output have matching logical shapes, add\n // getTexNameAtOutCoord() method that samples the input\n // textureSampler using the output coordinates.\n if (broadcast ||\n util.arraysEqual(\n inInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape)) {\n res += getSamplerAtOutputCoords(inInfo, outShapeInfo, broadcast);\n }\n return res;\n}\n\nfunction getOutputSamplingSnippet(\n outShape: number[], outTexShape: [number, number]): string {\n switch (outShape.length) {\n case 0:\n return getOutputScalarCoords();\n case 1:\n return getOutput1DCoords(outShape as [number], outTexShape);\n case 2:\n return getOutput2DCoords(outShape as [number, number], outTexShape);\n case 3:\n return getOutput3DCoords(\n outShape as [number, number, number], outTexShape);\n case 4:\n return getOutput4DCoords(\n outShape as [number, number, number, number], outTexShape);\n case 5:\n return getOutput5DCoords(\n outShape as [number, number, number, number, number], outTexShape);\n case 6:\n return getOutput6DCoords(\n outShape as [number, number, number, number, number, number],\n outTexShape);\n default:\n throw new Error(\n `${outShape.length}-D output sampling is not yet supported`);\n }\n}\n\nconst SAMPLE_1D_SNIPPET = `\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_2D_SNIPPET = `\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\n int index = row * numC + col;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_3D_SNIPPET = `\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\n int stride1, int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_4D_SNIPPET = `\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int row, int col, int depth,\n int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_5D_SNIPPET = `\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int row, int col, int depth,\n int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2 * stride3 + depth3;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_6D_SNIPPET = `\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int stride4,\n int row, int col, int depth, int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\n stride3 + depth3 * stride4 + depth4;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst FLOAT_TEXTURE_SAMPLE_SNIPPET = `\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return texture2D(textureSampler, uv).r;\n }\n`;\n\nconst FLOAT_TEXTURE_SETOUTPUT_SNIPPET = `\n void setOutput(float val) {\n gl_FragColor = vec4(val, 0, 0, 0);\n }\n`;\n\nconst SHADER_PREFIX = `\n precision highp float;\n precision highp int;\n varying vec2 resultUV;\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n bool isNaN(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n bool hasNaN(vec4 values) {\n vec4 v1 = values * values;\n vec4 v2 = values * values;\n return any(notEqual(v1, v2));\n }\n\n float getNaN(vec4 values) {\n return dot(vec4(1), values);\n }\n\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${SAMPLE_1D_SNIPPET}\n ${SAMPLE_2D_SNIPPET}\n ${SAMPLE_3D_SNIPPET}\n ${SAMPLE_4D_SNIPPET}\n ${SAMPLE_5D_SNIPPET}\n ${SAMPLE_6D_SNIPPET}\n`;\n\nfunction getOutputScalarCoords() {\n return `\n int getOutputCoords() {\n return 0;\n }\n `;\n}\n\nfunction getOutput1DCoords(\n shape: [number], texShape: [number, number]): string {\n if (texShape[0] === 1) {\n return `\n int getOutputCoords() {\n return int(resultUV.x * ${texShape[1]}.0);\n }\n `;\n }\n if (texShape[1] === 1) {\n return `\n int getOutputCoords() {\n return int(resultUV.y * ${texShape[0]}.0);\n }\n `;\n }\n return `\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n return resTexRC.x * ${texShape[1]} + resTexRC.y;\n }\n `;\n}\n\nfunction getOutput3DCoords(\n shape: [number, number, number], texShape: [number, number]): string {\n const stride0 = shape[1] * shape[2];\n const stride1 = shape[2];\n return `\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n int r = index / ${stride0};\n index -= r * ${stride0};\n int c = index / ${stride1};\n int d = index - c * ${stride1};\n return ivec3(r, c, d);\n }\n `;\n}\n\nfunction getOutput4DCoords(\n shape: [number, number, number, number],\n texShape: [number, number]): string {\n const stride2 = shape[3];\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n return `\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n\n int r = index / ${stride0};\n index -= r * ${stride0};\n\n int c = index / ${stride1};\n index -= c * ${stride1};\n\n int d = index / ${stride2};\n int d2 = index - d * ${stride2};\n\n return ivec4(r, c, d, d2);\n }\n `;\n}\n\nfunction getOutput5DCoords(\n shape: [number, number, number, number, number],\n texShape: [number, number]): string {\n const stride3 = shape[4];\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n return `\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(${texShape[0]},\n ${texShape[1]}));\n\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n\n int r = index / ${stride0};\n index -= r * ${stride0};\n\n int c = index / ${stride1};\n index -= c * ${stride1};\n\n int d = index / ${stride2};\n index -= d * ${stride2};\n\n int d2 = index / ${stride3};\n int d3 = index - d2 * ${stride3};\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n `;\n}\n\nfunction getOutput6DCoords(\n shape: [number, number, number, number, number, number],\n texShape: [number, number]): string {\n const stride4 = shape[5];\n const stride3 = shape[4] * stride4;\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n return `\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n\n int r = index / ${stride0};\n index -= r * ${stride0};\n\n int c = index / ${stride1};\n index -= c * ${stride1};\n\n int d = index / ${stride2};\n index -= d * ${stride2};\n\n int d2 = index / ${stride3};\n index -= d2 * ${stride3};\n\n int d3 = index / ${stride4};\n int d4 = index - d3 * ${stride4};\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n `;\n}\n\nfunction getOutput2DCoords(\n shape: [number, number], texShape: [number, number]): string {\n if (util.arraysEqual(shape, texShape)) {\n return `\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(${texShape[0]}, ${texShape[1]}));\n }\n `;\n }\n if (shape[1] === 1) {\n return `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n return ivec2(index, 0);\n }\n `;\n }\n if (shape[0] === 1) {\n return `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n return ivec2(0, index);\n }\n `;\n }\n return `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n int r = index / ${shape[1]};\n int c = index - r * ${shape[1]};\n return ivec2(r, c);\n }\n `;\n}\n\nfunction getSamplerScalar(inputInfo: InputInfo): string {\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n if (inputInfo.shapeInfo.isUniform) {\n return `float ${funcName}() {return ${texName};}`;\n }\n return `\n float ${funcName}() {\n return sampleTexture(${texName}, halfCR);\n }\n `;\n}\n\nfunction getSampler1D(inputInfo: InputInfo): string {\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n\n return `\n float ${funcName}(int index) {\n return ${funcName}Flat(index);\n }\n `;\n}\n\nfunction getSampler2D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n\n const texShape = inputInfo.shapeInfo.texShape;\n if (texShape != null && util.arraysEqual(shape, texShape)) {\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n return `\n float ${funcName}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n const squeezedShape = newShape;\n if (squeezedShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, squeezedShape);\n const params = ['row', 'col'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col) {\n int index = row * ${shape[1]} + col;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === 1) {\n return `\n float ${funcName}(int row, int col) {\n int index = row * ${shape[1]} + col;\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (texNumR === 1) {\n return `\n float ${funcName}(int row, int col) {\n int index = row * ${shape[1]} + col;\n vec2 uv = vec2((float(index) + 0.5) / ${texNumC}.0, 0.5);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int row, int col) {\n vec2 uv = UVfrom2D(${texNumR}, ${texNumC}, ${shape[1]}, row, col);\n return sampleTexture(${texName}, uv);\n }\n`;\n}\n\nfunction getSampler3D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride0 = shape[1] * shape[2];\n const stride1 = shape[2];\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n const squeezedShape = newShape;\n if (squeezedShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, squeezedShape);\n const params = ['row', 'col', 'depth'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth) {\n int index = row * ${stride0} + col * ${stride1} + depth;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth) {\n int texR = row;\n int texC = col * ${stride1} + depth;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n if (texNumC === stride1) {\n return `\n float ${funcName}(int row, int col, int depth) {\n int texR = row * ${shape[1]} + col;\n int texC = depth;\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n return `\n float ${funcName}(int row, int col, int depth) {\n vec2 uv = UVfrom3D(\n ${texNumR}, ${texNumC}, ${stride0}, ${stride1}, row, col, depth);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSampler4D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride2 = shape[3];\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n if (newShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, newShape);\n const params = ['row', 'col', 'depth', 'depth2'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth, int depth2) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int index = row * ${stride0} + col * ${stride1} +\n depth * ${stride2} + depth2;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int texR = row;\n int texC = col * ${stride1} + depth * ${stride2} + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (texNumC === stride2) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int texR = row * ${shape[1] * shape[2]} + col * ${shape[2]} + depth;\n int texC = depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n vec2 uv = UVfrom4D(${texNumR}, ${texNumC}, ${stride0}, ${stride1},\n ${stride2}, row, col, depth, depth2);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSampler5D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride3 = shape[4];\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n if (newShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, newShape);\n const params = ['row', 'col', 'depth', 'depth2', 'depth3'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int index = row * ${stride0} + col * ${stride1} +\n depth * ${stride2} + depth2 * ${stride3} + depth3;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n int texC = col * ${stride1} + depth * ${stride2} +\n depth2 * ${stride3} + depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n if (texNumC === stride3) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int texR = row * ${shape[1] * shape[2]} + col * ${shape[2]} +\n depth * ${shape[3]} + depth2;\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n vec2 uv = UVfrom5D(${texNumR}, ${texNumC}, ${stride0}, ${stride1},\n ${stride2}, ${stride3}, row, col, depth, depth2, depth3);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSampler6D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride4 = shape[5];\n const stride3 = shape[4] * stride4;\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n const {newShape, keptDims} = util.squeezeShape(shape);\n if (newShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, newShape);\n const params = ['row', 'col', 'depth', 'depth2', 'depth3', 'depth4'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * ${stride0} + col * ${stride1} +\n depth * ${stride2} + depth2 * ${stride3} + depth3 * ${stride3}\n + depth4\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n int texC = col * ${stride1} + depth * ${stride2} + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (texNumC === stride4) {\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row * ${shape[1] * shape[2]} + col * ${shape[2]} + depth;\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n vec2 uv = UVfrom6D(${texNumR}, ${texNumC}, ${stride0}, ${stride1},\n ${stride2}, ${stride3}, ${stride4}\n ,row, col, depth, depth2, depth3, depth4);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSamplerFlat(inputInfo: InputInfo): string {\n const texName = inputInfo.name;\n const funcName =\n 'get' + texName.charAt(0).toUpperCase() + texName.slice(1) + 'Flat';\n const inSize = util.sizeFromShape(inputInfo.shapeInfo.logicalShape);\n\n if (inputInfo.shapeInfo.isUniform) {\n if (inSize === 1) {\n return `float ${funcName}(int index) {return ${texName};}`;\n }\n return `\n float ${funcName}(int index) {\n for (int i = 0; i < ${inSize}; i++) {\n if (i == index) {\n return ${texName}[i];\n }\n }\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const tNumR = texShape[0];\n const tNumC = texShape[1];\n if (tNumC === 1 && tNumR === 1) {\n return `\n float ${funcName}(int index) {\n return sampleTexture(${texName}, halfCR);\n }\n `;\n }\n if (tNumC === 1) {\n return `\n float ${funcName}(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${tNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (tNumR === 1) {\n return `\n float ${funcName}(int index) {\n vec2 uv = vec2((float(index) + 0.5) / ${tNumC}.0, 0.5);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int index) {\n vec2 uv = UVfrom1D(${tNumR}, ${tNumC}, index);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getBroadcastOutputCoordsSampler(\n inputInfo: InputInfo, outShapeInfo: ShapeInfo, texFuncSnippet: string,\n funcName: string): string {\n const inRank = inputInfo.shapeInfo.logicalShape.length;\n const outRank = outShapeInfo.logicalShape.length;\n\n let type = 'int';\n if (outRank === 2) {\n type = 'ivec2';\n } else if (outRank === 3) {\n type = 'ivec3';\n } else if (outRank === 4) {\n type = 'ivec4';\n }\n const broadcastDims = broadcast_util.getBroadcastDims(\n inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape);\n const rankDiff = outRank - inRank;\n let coordsSnippet: string;\n if (inRank === 0) {\n coordsSnippet = '';\n } else if (outRank < 2 && broadcastDims.length >= 1) {\n coordsSnippet = 'coords = 0;';\n } else {\n coordsSnippet =\n broadcastDims.map(d => `coords[${d + rankDiff}] = 0;`).join('\\n');\n }\n let unpackedCoordsSnippet = '';\n if (outRank < 2 && inRank > 0) {\n unpackedCoordsSnippet = 'coords';\n } else {\n unpackedCoordsSnippet = inputInfo.shapeInfo.logicalShape\n .map((s, i) => `coords[${i + rankDiff}]`)\n .join(', ');\n }\n return `\n float ${funcName}() {\n ${type} coords = getOutputCoords();\n ${coordsSnippet}\n return get${texFuncSnippet}(${unpackedCoordsSnippet});\n }\n `;\n}\n\nfunction getSamplerAtOutputCoords(\n inputInfo: InputInfo, outShapeInfo: ShapeInfo,\n supportsBroadcasting: boolean) {\n const texName = inputInfo.name;\n const texFuncSnippet = texName.charAt(0).toUpperCase() + texName.slice(1);\n const funcName = 'get' + texFuncSnippet + 'AtOutCoords';\n\n const broadcastDims = broadcast_util.getBroadcastDims(\n inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape);\n const inRank = inputInfo.shapeInfo.logicalShape.length;\n const outRank = outShapeInfo.logicalShape.length;\n const doBroadcast =\n supportsBroadcasting && ((outRank > inRank) || broadcastDims.length > 0);\n const broadcastOverOuter =\n broadcast_util.broadcastDimsAreOuter(broadcastDims);\n const isUniform = inputInfo.shapeInfo.isUniform;\n\n if (doBroadcast && !broadcastOverOuter) {\n return getBroadcastOutputCoordsSampler(\n inputInfo, outShapeInfo, texFuncSnippet, funcName);\n }\n\n const inSize = util.sizeFromShape(inputInfo.shapeInfo.logicalShape);\n let broadcastSnippet = '';\n if (doBroadcast && broadcastOverOuter) {\n broadcastSnippet = `\n int mainPart = index / ${inSize};\n index -= mainPart * ${inSize};\n `;\n }\n\n const outTexShape = outShapeInfo.texShape;\n if (isUniform) {\n if (inSize === 1) {\n return `float ${funcName}() {return ${texName};}`;\n }\n return `\n float ${funcName}() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${outTexShape[0]}, ${outTexShape[1]}));\n int index = resTexRC.x * ${outTexShape[1]} + resTexRC.y;\n ${broadcastSnippet}\n return get${texFuncSnippet}Flat(index);\n }\n `;\n }\n\n // At this point, the input is not a uniform.\n const inTexShape = inputInfo.shapeInfo.texShape;\n if (util.arraysEqual(inTexShape, outTexShape)) {\n return `\n float ${funcName}() {\n return sampleTexture(${texName}, resultUV);\n }\n `;\n }\n\n return `\n float ${funcName}() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${outTexShape[0]}, ${outTexShape[1]}));\n int index = resTexRC.x * ${outTexShape[1]} + resTexRC.y;\n ${broadcastSnippet}\n int texR = index / ${inTexShape[1]};\n int texC = index - texR * ${inTexShape[1]};\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${inTexShape[1]}.0, ${inTexShape[0]}.0);\n\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nexport function getCoordsDataType(rank: number): string {\n if (rank <= 1) {\n return 'int';\n } else if (rank === 2) {\n return 'ivec2';\n } else if (rank === 3) {\n return 'ivec3';\n } else if (rank === 4) {\n return 'ivec4';\n } else if (rank === 5) {\n return 'ivec5';\n } else if (rank === 6) {\n return 'ivec6';\n } else {\n throw Error(`GPU for rank ${rank} is not yet supported`);\n }\n}\n\n/** Returns a new input info (a copy) that has a squeezed logical shape. */\nfunction squeezeInputInfo(\n inInfo: InputInfo, squeezedShape: number[]): InputInfo {\n // Deep copy.\n const newInputInfo: InputInfo = JSON.parse(JSON.stringify(inInfo));\n newInputInfo.shapeInfo.logicalShape = squeezedShape;\n return newInputInfo;\n}\n\nfunction getSqueezedParams(params: string[], keptDims: number[]): string {\n return keptDims.map(d => params[d]).join(', ');\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class CumSumProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(shape: number[], exclusive: boolean, reverse: boolean) {\n this.outputShape = shape;\n const rank = shape.length;\n const finalDim = shape[shape.length - 1];\n const comparator = reverse ? '<' : '>';\n\n this.userCode = `\n int getIndex(int i) {\n ${reverse ? `return ${finalDim} -i - 1;` : 'return i;'}\n }\n\n void main() {\n ${getCoordsDataType(rank)} coords = getOutputCoords();\n int end = ${getFinalCoord(rank, 'coords')};\n float val = 0.0;\n for (int i = ${finalDim} - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx ${comparator} end) {\n continue;\n }\n if (idx == end && ${exclusive}) {\n continue;\n }\n ${getFinalCoord(rank, 'coords')} = idx;\n val += getX(${getCoords(rank, 'coords')});\n }\n setOutput(val);\n }\n `;\n }\n}\n\nfunction getCoords(rank: number, name: string): string {\n if (rank === 1) {\n return `${name}`;\n } else if (rank === 2) {\n return `${name}.x, ${name}.y`;\n } else if (rank === 3) {\n return `${name}.x, ${name}.y, ${name}.z`;\n } else if (rank === 4) {\n return `${name}.x, ${name}.y, ${name}.z, ${name}.w`;\n } else {\n throw Error(`Cumulative sum for rank ${rank} is not yet supported`);\n }\n}\n\nfunction getFinalCoord(rank: number, name: string): string {\n if (rank === 1) {\n return `${name}`;\n } else if (rank === 2) {\n return `${name}.y`;\n } else if (rank === 3) {\n return `${name}.z`;\n } else if (rank === 4) {\n return `${name}.w`;\n } else {\n throw Error(`Cumulative sum for rank ${rank} is not yet supported`);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class EncodeFloatProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n constructor(outputShape: number[]) {\n this.outputShape = outputShape;\n this.userCode = `\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n gl_FragColor = encode_float(x);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class FromPixelsProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n constructor(outputShape: number[]) {\n const [height, width, ] = outputShape;\n this.outputShape = outputShape;\n this.userCode = `\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${width}.0, ${height}.0);\n\n vec4 values = texture2D(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class GatherProgram implements GPGPUProgram {\n variableNames = ['A', 'indices'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(aShape: number[], indicesLength: number, axis: number) {\n const outputShape: number[] = aShape.slice();\n outputShape[axis] = indicesLength;\n this.outputShape = outputShape;\n this.rank = outputShape.length;\n const dtype = getCoordsDataType(this.rank);\n const sourceCoords = getSourceCoords(aShape, axis);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n setOutput(getA(${sourceCoords}));\n }\n `;\n }\n}\n\nfunction getSourceCoords(aShape: number[], axis: number): string {\n const rank = aShape.length;\n if (rank > 4) {\n throw Error(`Gather for rank ${rank} is not yet supported`);\n }\n if (rank === 1) {\n return `int(getIndices(resRC))`;\n }\n\n const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w'];\n\n const sourceCoords = [];\n for (let i = 0; i < aShape.length; i++) {\n if (i === axis) {\n sourceCoords.push(`int(getIndices(${currentCoords[i]}))`);\n } else {\n sourceCoords.push(`${currentCoords[i]}`);\n }\n }\n return sourceCoords.join();\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, DataTypeMap} from '../../types';\n\nexport enum TextureUsage {\n RENDER,\n UPLOAD,\n PIXELS,\n DOWNLOAD\n}\n\nexport enum PhysicalTextureType {\n FLOAT16,\n FLOAT32,\n UNSIGNED_BYTE\n}\n\nexport interface TextureData {\n texture: WebGLTexture;\n shape: number[];\n /** [rows, columns] shape of the texture. */\n texShape: [number, number];\n dtype: DataType;\n values: DataTypeMap[DataType];\n usage: TextureUsage;\n}\n\nexport function getUnpackedMatrixTextureShapeWidthHeight(\n rows: number, columns: number): [number, number] {\n return [columns, rows];\n}\n\nexport function getUnpackedArraySizeFromMatrixSize(\n matrixSize: number, channelsPerTexture: number): number {\n return matrixSize * channelsPerTexture;\n}\n\nexport function getColorMatrixTextureShapeWidthHeight(\n rows: number, columns: number): [number, number] {\n return [columns * 4, rows];\n}\n\nexport function getMatrixSizeFromUnpackedArraySize(\n unpackedSize: number, channelsPerTexture: number): number {\n if (unpackedSize % channelsPerTexture !== 0) {\n throw new Error(\n `unpackedSize (${unpackedSize}) must be a multiple of ` +\n `${channelsPerTexture}`);\n }\n return unpackedSize / channelsPerTexture;\n}\n\nexport type TypedArray = Float32Array|Uint8Array;\n\nexport function encodeMatrixToUnpackedArray(\n matrix: TypedArray, unpackedArray: TypedArray, channelsPerTexture: number) {\n const requiredSize =\n getUnpackedArraySizeFromMatrixSize(matrix.length, channelsPerTexture);\n if (unpackedArray.length < requiredSize) {\n throw new Error(\n `unpackedArray length (${unpackedArray.length}) must be >= ` +\n `${requiredSize}`);\n }\n let dst = 0;\n for (let src = 0; src < matrix.length; ++src) {\n unpackedArray[dst] = matrix[src];\n dst += channelsPerTexture;\n }\n}\n\nexport function decodeMatrixFromUnpackedArray(\n unpackedArray: Float32Array, matrix: Float32Array,\n channelsPerTexture: number) {\n const requiredSize = getMatrixSizeFromUnpackedArraySize(\n unpackedArray.length, channelsPerTexture);\n if (matrix.length < requiredSize) {\n throw new Error(\n `matrix length (${matrix.length}) must be >= ${requiredSize}`);\n }\n let dst = 0;\n for (let src = 0; src < unpackedArray.length; src += channelsPerTexture) {\n matrix[dst++] = unpackedArray[src];\n }\n}\n\nexport function decodeMatrixFromUnpackedColorRGBAArray(\n unpackedArray: Float32Array, matrix: Float32Array, channels: number) {\n const requiredSize = unpackedArray.length * channels / 4;\n if (matrix.length < requiredSize) {\n throw new Error(\n `matrix length (${matrix.length}) must be >= ${requiredSize}`);\n }\n let dst = 0;\n for (let src = 0; src < unpackedArray.length; src += 4) {\n for (let c = 0; c < channels; c++) {\n matrix[dst++] = unpackedArray[src + c];\n }\n }\n}\n\nexport function getPackedMatrixTextureShapeWidthHeight(\n rows: number, columns: number): [number, number] {\n return [Math.ceil(columns / 2), Math.ceil(rows / 2)];\n}\n\nexport function getPackedRGBAArraySizeFromMatrixShape(\n rows: number, columns: number): number {\n const [w, h] = getPackedMatrixTextureShapeWidthHeight(rows, columns);\n return w * h * 4;\n}\n\nexport function encodeMatrixToPackedRGBA(\n matrix: Float32Array, rows: number, columns: number,\n packedRGBA: Float32Array) {\n const requiredSize = getPackedRGBAArraySizeFromMatrixShape(rows, columns);\n if (packedRGBA.length < requiredSize) {\n throw new Error(\n `packedRGBA length (${packedRGBA.length}) must be >= ${requiredSize}`);\n }\n /*\n Unpacked matrix, row-major order in Float32Array[16]: A B C D\n E F G H\n I J K L\n M N O P\n\n Packed matrix, 2x2 RGBA32 texture (memory view): ABEF CDGH IJMN KLOP\n\n Packed matrix, 2x2 RGBA32 texture (matrix view): AB|CD\n EF|GH\n --+--\n IJ|KL\n MN|OP\n */\n const [textureWidth, textureHeight] =\n getPackedMatrixTextureShapeWidthHeight(rows, columns);\n const oddWidth = (columns % 2) === 1;\n const oddHeight = (rows % 2) === 1;\n const widthInFullBlocks = Math.floor(columns / 2);\n const heightInFullBlocks = Math.floor(rows / 2);\n\n // loop over full 2x2 blocks\n {\n const dstStride = (oddWidth ? 4 : 0);\n const oneRow = columns;\n let dst = 0;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n const matrixSrcRow = (blockY * 2 * columns);\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n const matrixSrcCol = blockX * 2;\n const src = matrixSrcRow + matrixSrcCol;\n packedRGBA[dst] = matrix[src];\n packedRGBA[dst + 1] = matrix[src + 1];\n packedRGBA[dst + 2] = matrix[src + oneRow];\n packedRGBA[dst + 3] = matrix[src + oneRow + 1];\n dst += 4;\n }\n dst += dstStride;\n }\n }\n\n // loop down final odd column\n if (oddWidth) {\n let src = columns - 1;\n let dst = (textureWidth - 1) * 4;\n const srcStride = 2 * columns;\n const dstStride = textureWidth * 4;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n packedRGBA[dst] = matrix[src];\n packedRGBA[dst + 2] = matrix[src + columns];\n src += srcStride;\n dst += dstStride;\n }\n }\n\n // loop across final row\n if (oddHeight) {\n let src = (rows - 1) * columns;\n let dst = (textureHeight - 1) * textureWidth * 4;\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n packedRGBA[dst++] = matrix[src++];\n packedRGBA[dst++] = matrix[src++];\n dst += 2;\n }\n }\n\n // fill in bottom-right texel\n if (oddWidth && oddHeight) {\n packedRGBA[packedRGBA.length - 4] = matrix[matrix.length - 1];\n }\n\n return packedRGBA;\n}\n\nexport function decodeMatrixFromPackedRGBA(\n packedRGBA: Float32Array, rows: number, columns: number,\n matrix: Float32Array): Float32Array {\n const requiredSize = rows * columns;\n if (requiredSize < matrix.length) {\n throw new Error(\n `matrix length (${matrix.length}) must be >= ${requiredSize}`);\n }\n const oddWidth = (columns % 2) === 1;\n const oddHeight = (rows % 2) === 1;\n const widthInFullBlocks = Math.floor(columns / 2);\n const heightInFullBlocks = Math.floor(rows / 2);\n const [textureWidth, textureHeight] =\n getPackedMatrixTextureShapeWidthHeight(rows, columns);\n\n // loop over full 2x2 blocks\n {\n const srcStride = oddWidth ? 4 : 0;\n const dstStride = columns + (oddWidth ? 1 : 0);\n let src = 0;\n let dstRow1 = 0;\n let dstRow2 = columns;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n matrix[dstRow1++] = packedRGBA[src++];\n matrix[dstRow1++] = packedRGBA[src++];\n matrix[dstRow2++] = packedRGBA[src++];\n matrix[dstRow2++] = packedRGBA[src++];\n }\n src += srcStride;\n dstRow1 += dstStride;\n dstRow2 += dstStride;\n }\n }\n\n // loop down final column\n if (oddWidth) {\n let src = (textureWidth - 1) * 4;\n let dst = columns - 1;\n const srcStride = textureWidth * 4;\n const dstStride = 2 * columns;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n matrix[dst] = packedRGBA[src];\n matrix[dst + columns] = packedRGBA[src + 2];\n src += srcStride;\n dst += dstStride;\n }\n }\n\n // loop across final row\n if (oddHeight) {\n let src = (textureHeight - 1) * textureWidth * 4;\n let dst = (rows - 1) * columns;\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n matrix[dst++] = packedRGBA[src++];\n matrix[dst++] = packedRGBA[src++];\n src += 2;\n }\n }\n\n // fill in bottom-right cell\n if (oddWidth && oddHeight) {\n matrix[matrix.length - 1] = packedRGBA[packedRGBA.length - 4];\n }\n\n return matrix;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nlet MAX_TEXTURE_SIZE: number = null;\n\nimport * as util from '../../util';\nimport {ENV} from '../../environment';\n\nexport function createWebGLRenderingContext(attributes: WebGLContextAttributes):\n WebGLRenderingContext {\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return createWebGLRenderingContextFromCanvas(canvas, attributes);\n}\n\nexport function createWebGLRenderingContextFromCanvas(\n canvas: HTMLCanvasElement,\n attributes: WebGLContextAttributes): WebGLRenderingContext {\n let gl: WebGLRenderingContext;\n\n const webglVersion = ENV.get('WEBGL_VERSION');\n if (webglVersion === 2) {\n gl = canvas.getContext('webgl2', attributes) as WebGLRenderingContext;\n } else if (webglVersion === 1) {\n gl = (canvas.getContext('webgl', attributes) ||\n canvas.getContext('experimental-webgl', attributes)) as\n WebGLRenderingContext;\n }\n\n if (webglVersion === 0 || gl == null) {\n throw new Error('This browser does not support WebGL.');\n }\n return gl;\n}\n\nexport function callAndCheck(gl: WebGLRenderingContext, func: () => T): T {\n const returnValue = func();\n checkWebGLError(gl);\n return returnValue;\n}\n\nlet webGLDebugErrorCheckingEnabled = false;\n\nexport function enableDebugWebGLErrorChecking(enabled: boolean) {\n webGLDebugErrorCheckingEnabled = enabled;\n}\n\nexport function checkWebGLError(gl: WebGLRenderingContext) {\n if (webGLDebugErrorCheckingEnabled) {\n const error = gl.getError();\n if (error !== gl.NO_ERROR) {\n throw new Error('WebGL Error: ' + getWebGLErrorMessage(gl, error));\n }\n }\n}\n\nexport function getWebGLErrorMessage(\n gl: WebGLRenderingContext, status: number): string {\n switch (status) {\n case gl.NO_ERROR:\n return 'NO_ERROR';\n case gl.INVALID_ENUM:\n return 'INVALID_ENUM';\n case gl.INVALID_VALUE:\n return 'INVALID_VALUE';\n case gl.INVALID_OPERATION:\n return 'INVALID_OPERATION';\n case gl.INVALID_FRAMEBUFFER_OPERATION:\n return 'INVALID_FRAMEBUFFER_OPERATION';\n case gl.OUT_OF_MEMORY:\n return 'OUT_OF_MEMORY';\n case gl.CONTEXT_LOST_WEBGL:\n return 'CONTEXT_LOST_WEBGL';\n default:\n return `Unknown error code ${status}`;\n }\n}\n\nexport function getExtensionOrThrow(\n gl: WebGLRenderingContext, extensionName: string): {} {\n return throwIfNull<{}>(\n gl, () => gl.getExtension(extensionName),\n 'Extension \"' + extensionName + '\" not supported on this browser.');\n}\n\nexport function createVertexShader(\n gl: WebGLRenderingContext, vertexShaderSource: string): WebGLShader {\n const vertexShader: WebGLShader = throwIfNull(\n gl, () => gl.createShader(gl.VERTEX_SHADER),\n 'Unable to create vertex WebGLShader.');\n callAndCheck(gl, () => gl.shaderSource(vertexShader, vertexShaderSource));\n callAndCheck(gl, () => gl.compileShader(vertexShader));\n if (gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS) === false) {\n console.log(gl.getShaderInfoLog(vertexShader));\n throw new Error('Failed to compile vertex shader.');\n }\n return vertexShader;\n}\n\nexport function createFragmentShader(\n gl: WebGLRenderingContext, fragmentShaderSource: string): WebGLShader {\n const fragmentShader: WebGLShader = throwIfNull(\n gl, () => gl.createShader(gl.FRAGMENT_SHADER),\n 'Unable to create fragment WebGLShader.');\n callAndCheck(gl, () => gl.shaderSource(fragmentShader, fragmentShaderSource));\n callAndCheck(gl, () => gl.compileShader(fragmentShader));\n if (gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS) === false) {\n logShaderSourceAndInfoLog(\n fragmentShaderSource, gl.getShaderInfoLog(fragmentShader));\n throw new Error('Failed to compile fragment shader.');\n }\n return fragmentShader;\n}\n\nconst lineNumberRegex = /ERROR: [0-9]+:([0-9]+):/g;\nfunction logShaderSourceAndInfoLog(\n shaderSource: string, shaderInfoLog: string) {\n const lineNumberRegexResult = lineNumberRegex.exec(shaderInfoLog);\n if (lineNumberRegexResult == null) {\n console.log(`Couldn't parse line number in error: ${shaderInfoLog}`);\n console.log(shaderSource);\n return;\n }\n\n const lineNumber = +lineNumberRegexResult[1];\n\n const shaderLines = shaderSource.split('\\n');\n const pad = shaderLines.length.toString().length + 2;\n const linesWithLineNumbers = shaderLines.map(\n (line, lineNumber) =>\n util.rightPad((lineNumber + 1).toString(), pad) + line);\n let maxLineLength = 0;\n for (let i = 0; i < linesWithLineNumbers.length; i++) {\n maxLineLength = Math.max(linesWithLineNumbers[i].length, maxLineLength);\n }\n\n const beforeErrorLines = linesWithLineNumbers.slice(0, lineNumber - 1);\n const errorLine = linesWithLineNumbers.slice(lineNumber - 1, lineNumber);\n const afterErrorLines = linesWithLineNumbers.slice(lineNumber);\n\n console.log(beforeErrorLines.join('\\n'));\n console.log(shaderInfoLog.split('\\n')[0]);\n console.log(\n `%c ${util.rightPad(errorLine[0], maxLineLength)}`,\n 'border:1px solid red; background-color:#e3d2d2; color:#a61717');\n console.log(afterErrorLines.join('\\n'));\n}\n\nexport function createProgram(gl: WebGLRenderingContext): WebGLProgram {\n return throwIfNull(\n gl, () => gl.createProgram(), 'Unable to create WebGLProgram.');\n}\n\nexport function linkProgram(gl: WebGLRenderingContext, program: WebGLProgram) {\n callAndCheck(gl, () => gl.linkProgram(program));\n if (gl.getProgramParameter(program, gl.LINK_STATUS) === false) {\n console.log(gl.getProgramInfoLog(program));\n throw new Error('Failed to link vertex and fragment shaders.');\n }\n}\n\nexport function validateProgram(\n gl: WebGLRenderingContext, program: WebGLProgram) {\n callAndCheck(gl, () => gl.validateProgram(program));\n if (gl.getProgramParameter(program, gl.VALIDATE_STATUS) === false) {\n console.log(gl.getProgramInfoLog(program));\n throw new Error('Shader program validation failed.');\n }\n}\n\nexport function createStaticVertexBuffer(\n gl: WebGLRenderingContext, data: Float32Array): WebGLBuffer {\n const buffer: WebGLBuffer = throwIfNull(\n gl, () => gl.createBuffer(), 'Unable to create WebGLBuffer');\n callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer));\n callAndCheck(gl, () => gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW));\n return buffer;\n}\n\nexport function createStaticIndexBuffer(\n gl: WebGLRenderingContext, data: Uint16Array): WebGLBuffer {\n const buffer: WebGLBuffer = throwIfNull(\n gl, () => gl.createBuffer(), 'Unable to create WebGLBuffer');\n callAndCheck(gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer));\n callAndCheck(\n gl, () => gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, gl.STATIC_DRAW));\n return buffer;\n}\n\nexport function queryMaxTextureSize(gl: WebGLRenderingContext): number {\n if (MAX_TEXTURE_SIZE != null) {\n return MAX_TEXTURE_SIZE;\n }\n MAX_TEXTURE_SIZE =\n callAndCheck(gl, () => gl.getParameter(gl.MAX_TEXTURE_SIZE));\n return MAX_TEXTURE_SIZE;\n}\n\nexport function getNumChannels(): number {\n if (ENV.get('WEBGL_VERSION') === 2) {\n return 1;\n }\n return 4;\n}\n\nexport function createTexture(gl: WebGLRenderingContext): WebGLTexture {\n return throwIfNull(\n gl, () => gl.createTexture(), 'Unable to create WebGLTexture.');\n}\n\nexport function validateTextureSize(\n gl: WebGLRenderingContext, width: number, height: number) {\n const maxTextureSize: number = queryMaxTextureSize(gl);\n if ((width <= 0) || (height <= 0)) {\n const requested = `[${width}x${height}]`;\n throw new Error('Requested texture size ' + requested + ' is invalid.');\n }\n if ((width > maxTextureSize) || (height > maxTextureSize)) {\n const requested = `[${width}x${height}]`;\n const max = `[${maxTextureSize}x${maxTextureSize}]`;\n throw new Error(\n 'Requested texture size ' + requested +\n ' greater than WebGL maximum on this browser / GPU ' + max + '.');\n }\n}\n\nexport function createFramebuffer(gl: WebGLRenderingContext): WebGLFramebuffer {\n return throwIfNull(\n gl, () => gl.createFramebuffer(), 'Unable to create WebGLFramebuffer.');\n}\n\nexport function bindVertexBufferToProgramAttribute(\n gl: WebGLRenderingContext, program: WebGLProgram, attribute: string,\n buffer: WebGLBuffer, arrayEntriesPerItem: number, itemStrideInBytes: number,\n itemOffsetInBytes: number): boolean {\n const loc = gl.getAttribLocation(program, attribute);\n if (loc === -1) {\n // The GPU compiler decided to strip out this attribute because it's unused,\n // thus no need to bind.\n return false;\n }\n callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer));\n callAndCheck(\n gl,\n () => gl.vertexAttribPointer(\n loc, arrayEntriesPerItem, gl.FLOAT, false, itemStrideInBytes,\n itemOffsetInBytes));\n callAndCheck(gl, () => gl.enableVertexAttribArray(loc));\n return true;\n}\n\nexport function bindTextureUnit(\n gl: WebGLRenderingContext, texture: WebGLTexture, textureUnit: number) {\n validateTextureUnit(gl, textureUnit);\n callAndCheck(gl, () => gl.activeTexture(gl.TEXTURE0 + textureUnit));\n callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture));\n}\n\nexport function unbindTextureUnit(\n gl: WebGLRenderingContext, textureUnit: number) {\n validateTextureUnit(gl, textureUnit);\n callAndCheck(gl, () => gl.activeTexture(gl.TEXTURE0 + textureUnit));\n callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n}\n\nexport function getProgramUniformLocationOrThrow(\n gl: WebGLRenderingContext, program: WebGLProgram,\n uniformName: string): WebGLUniformLocation {\n return throwIfNull(\n gl, () => gl.getUniformLocation(program, uniformName),\n 'uniform \"' + uniformName + '\" not present in program.');\n}\n\nexport function getProgramUniformLocation(\n gl: WebGLRenderingContext, program: WebGLProgram,\n uniformName: string): WebGLUniformLocation {\n return gl.getUniformLocation(program, uniformName);\n}\n\nexport function bindTextureToProgramUniformSampler(\n gl: WebGLRenderingContext, program: WebGLProgram, texture: WebGLTexture,\n uniformSamplerLocation: WebGLUniformLocation, textureUnit: number) {\n callAndCheck(gl, () => bindTextureUnit(gl, texture, textureUnit));\n callAndCheck(gl, () => gl.uniform1i(uniformSamplerLocation, textureUnit));\n}\n\nexport function bindCanvasToFramebuffer(gl: WebGLRenderingContext) {\n callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, null));\n callAndCheck(gl, () => gl.viewport(0, 0, gl.canvas.width, gl.canvas.height));\n callAndCheck(gl, () => gl.scissor(0, 0, gl.canvas.width, gl.canvas.height));\n}\n\nexport function bindColorTextureToFramebuffer(\n gl: WebGLRenderingContext, texture: WebGLTexture,\n framebuffer: WebGLFramebuffer) {\n callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer));\n callAndCheck(\n gl,\n () => gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0));\n}\n\nexport function unbindColorTextureFromFramebuffer(\n gl: WebGLRenderingContext, framebuffer: WebGLFramebuffer) {\n callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer));\n callAndCheck(\n gl,\n () => gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0));\n}\n\nexport function validateFramebuffer(gl: WebGLRenderingContext) {\n const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n if (status !== gl.FRAMEBUFFER_COMPLETE) {\n throw new Error(\n 'Error binding framebuffer: ' + getFramebufferErrorMessage(gl, status));\n }\n}\n\nexport function getFramebufferErrorMessage(\n gl: WebGLRenderingContext, status: number): string {\n switch (status) {\n case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:\n return 'FRAMEBUFFER_INCOMPLETE_ATTACHMENT';\n case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:\n return 'FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT';\n case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:\n return 'FRAMEBUFFER_INCOMPLETE_DIMENSIONS';\n case gl.FRAMEBUFFER_UNSUPPORTED:\n return 'FRAMEBUFFER_UNSUPPORTED';\n default:\n return `unknown error ${status}`;\n }\n}\n\nfunction throwIfNull(\n gl: WebGLRenderingContext, returnTOrNull: () => T | null,\n failureMessage: string): T {\n const tOrNull: T|null = callAndCheck(gl, () => returnTOrNull());\n if (tOrNull == null) {\n throw new Error(failureMessage);\n }\n return tOrNull as T;\n}\n\nfunction validateTextureUnit(gl: WebGLRenderingContext, textureUnit: number) {\n const maxTextureUnit = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1;\n const glTextureUnit = textureUnit + gl.TEXTURE0;\n if (glTextureUnit < gl.TEXTURE0 || glTextureUnit > maxTextureUnit) {\n const textureUnitRange = `[gl.TEXTURE0, gl.TEXTURE${maxTextureUnit}]`;\n throw new Error(`textureUnit must be in ${textureUnitRange}.`);\n }\n}\n\nexport function getTextureShapeFromLogicalShape(\n gl: WebGLRenderingContext, logShape: number[]): [number, number] {\n // If logical shape is 2, we don't squeeze, since we want to match physical.\n if (logShape.length !== 2) {\n const squeezeResult = util.squeezeShape(logShape);\n logShape = squeezeResult.newShape;\n }\n\n const maxTexSize = queryMaxTextureSize(gl);\n const size = util.sizeFromShape(logShape);\n if (logShape.length <= 1 && size <= maxTexSize) {\n return [size, 1];\n } else if (\n logShape.length === 2 && logShape[0] <= maxTexSize &&\n logShape[1] <= maxTexSize) {\n return logShape as [number, number];\n } else if (\n logShape.length === 3 && logShape[0] <= maxTexSize &&\n logShape[1] * logShape[2] <= maxTexSize) {\n return [logShape[0], logShape[1] * logShape[2]];\n } else if (\n logShape.length === 4 && logShape[0] <= maxTexSize &&\n logShape[1] * logShape[2] * logShape[3] <= maxTexSize) {\n return [logShape[0], logShape[1] * logShape[2] * logShape[3]];\n } else {\n return util.sizeToSquarishShape(size);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../../environment';\n\nimport * as tex_util from './tex_util';\nimport * as webgl_util from './webgl_util';\n\nexport function getWebGLContextAttributes(): WebGLContextAttributes {\n return {\n alpha: false,\n antialias: false,\n premultipliedAlpha: false,\n preserveDrawingBuffer: false,\n depth: false,\n stencil: false,\n failIfMajorPerformanceCaveat: true\n };\n}\n\nexport interface TextureConfig {\n internalFormatFloat: number;\n textureFormatFloat: number;\n internalFormatHalfFloat: number;\n internalFormatPackedFloat: number;\n\n // The format to use during a gl.readPixels call.\n downloadTextureFormat: number;\n // How many channels need to be unpacked after a gl.readPixels call.\n downloadUnpackNumChannels: number;\n\n defaultNumChannels: number;\n textureTypeHalfFloat: number;\n}\n\nexport function createWebGLContext(canvas?: HTMLCanvasElement) {\n const attributes = getWebGLContextAttributes();\n let gl: WebGLRenderingContext;\n if (canvas != null) {\n gl = webgl_util.createWebGLRenderingContextFromCanvas(canvas, attributes);\n } else {\n gl = webgl_util.createWebGLRenderingContext(attributes);\n }\n webgl_util.callAndCheck(gl, () => gl.disable(gl.DEPTH_TEST));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.STENCIL_TEST));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.BLEND));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.DITHER));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.POLYGON_OFFSET_FILL));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.SAMPLE_COVERAGE));\n webgl_util.callAndCheck(gl, () => gl.enable(gl.SCISSOR_TEST));\n webgl_util.callAndCheck(gl, () => gl.enable(gl.CULL_FACE));\n webgl_util.callAndCheck(gl, () => gl.cullFace(gl.BACK));\n\n return gl;\n}\n\nexport function createVertexShader(gl: WebGLRenderingContext): WebGLShader {\n const vertexShaderSource = `\n precision highp float;\n attribute vec3 clipSpacePos;\n attribute vec2 uv;\n varying vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`;\n return webgl_util.createVertexShader(gl, vertexShaderSource);\n}\n\nexport function createVertexBuffer(gl: WebGLRenderingContext): WebGLBuffer {\n // [x y z u v] * [upper-left, lower-left, upper-right, lower-right]\n const vertexArray = new Float32Array(\n [-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0]);\n return webgl_util.createStaticVertexBuffer(gl, vertexArray);\n}\n\nexport function createIndexBuffer(gl: WebGLRenderingContext): WebGLBuffer {\n // OpenGL (and WebGL) have \"CCW == front\" winding\n const triangleVertexIndices = new Uint16Array([0, 1, 2, 2, 1, 3]);\n return webgl_util.createStaticIndexBuffer(gl, triangleVertexIndices);\n}\n\nexport function getTextureConfig(\n // tslint:disable-next-line:no-any\n gl: WebGLRenderingContext, textureHalfFloatExtension?: any): TextureConfig {\n // tslint:disable-next-line:no-any\n const glany = gl as any;\n\n let internalFormatFloat: number;\n let internalFormatHalfFloat: number;\n let internalFormatPackedFloat: number;\n let textureFormatFloat: number;\n\n let downloadTextureFormat: number;\n let downloadUnpackNumChannels: number;\n\n let defaultNumChannels: number;\n let textureTypeHalfFloat: number;\n\n if (ENV.get('WEBGL_VERSION') === 2) {\n internalFormatFloat = glany.R32F;\n internalFormatHalfFloat = glany.R16F;\n internalFormatPackedFloat = glany.RGBA32F;\n textureFormatFloat = glany.RED;\n downloadUnpackNumChannels = 4;\n defaultNumChannels = 1;\n textureTypeHalfFloat = glany.HALF_FLOAT;\n } else {\n internalFormatFloat = gl.RGBA;\n internalFormatHalfFloat = gl.RGBA;\n internalFormatPackedFloat = glany.RGBA;\n textureFormatFloat = gl.RGBA;\n downloadUnpackNumChannels = 4;\n defaultNumChannels = 4;\n textureTypeHalfFloat = textureHalfFloatExtension != null ?\n textureHalfFloatExtension.HALF_FLOAT_OES :\n null;\n }\n downloadTextureFormat = gl.RGBA;\n\n return {\n internalFormatFloat,\n internalFormatHalfFloat,\n internalFormatPackedFloat,\n textureFormatFloat,\n downloadTextureFormat,\n downloadUnpackNumChannels,\n defaultNumChannels,\n textureTypeHalfFloat\n };\n}\n\nfunction createAndConfigureTexture(\n gl: WebGLRenderingContext, width: number, height: number,\n internalFormat: number, textureFormat: number,\n textureType: number): WebGLTexture {\n webgl_util.validateTextureSize(gl, width, height);\n const texture = webgl_util.createTexture(gl);\n\n const tex2d = gl.TEXTURE_2D;\n webgl_util.callAndCheck(gl, () => gl.bindTexture(tex2d, texture));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_MIN_FILTER, gl.NEAREST));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_MAG_FILTER, gl.NEAREST));\n webgl_util.callAndCheck(\n gl,\n () => gl.texImage2D(\n tex2d, 0, internalFormat, width, height, 0, textureFormat,\n textureType, null));\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n return texture;\n}\n\nexport function createFloat32MatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, textureConfig.internalFormatFloat,\n textureConfig.textureFormatFloat, gl.FLOAT);\n}\n\nexport function createFloat16MatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, textureConfig.internalFormatFloat,\n textureConfig.textureFormatFloat, textureConfig.textureTypeHalfFloat);\n}\n\nexport function createUnsignedBytesMatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE);\n}\n\nexport function createPackedMatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, textureConfig.internalFormatPackedFloat, gl.RGBA,\n gl.FLOAT);\n}\n\nexport function bindVertexProgramAttributeStreams(\n gl: WebGLRenderingContext, program: WebGLProgram,\n vertexBuffer: WebGLBuffer): boolean {\n const posOffset = 0; // x is the first buffer element\n const uvOffset = 3 * 4; // uv comes after [x y z]\n const stride = (3 * 4) + (2 * 4); // xyz + uv, each entry is 4-byte float.\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer));\n const success = webgl_util.bindVertexBufferToProgramAttribute(\n gl, program, 'clipSpacePos', vertexBuffer, 3, stride, posOffset);\n return success &&\n webgl_util.bindVertexBufferToProgramAttribute(\n gl, program, 'uv', vertexBuffer, 2, stride, uvOffset);\n}\n\nexport function uploadPixelDataToTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture,\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement) {\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture));\n webgl_util.callAndCheck(\n gl,\n () => gl.texImage2D(\n gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, pixels));\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n}\n\nfunction uploadDataToTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, width: number,\n height: number, data: Float32Array, textureFormat: number) {\n webgl_util.validateTextureSize(gl, width, height);\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture));\n webgl_util.callAndCheck(\n gl,\n () => gl.texSubImage2D(\n gl.TEXTURE_2D, 0, 0, 0, width, height, textureFormat, gl.FLOAT,\n data));\n\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n}\n\nexport function uploadMatrixToTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, rows: number,\n columns: number, matrix: Float32Array, numChannels: number,\n textureConfig: TextureConfig) {\n const [w, h] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n\n let unpackedArray: Float32Array;\n if (textureConfig.defaultNumChannels === 1) {\n // No need to allocate a temporary array.\n unpackedArray = matrix;\n } else {\n unpackedArray =\n new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(\n matrix.length, numChannels));\n tex_util.encodeMatrixToUnpackedArray(matrix, unpackedArray, numChannels);\n }\n\n uploadDataToTexture(\n gl, texture, w, h, unpackedArray, textureConfig.textureFormatFloat);\n}\n\nexport function uploadMatrixToPackedTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, rows: number,\n columns: number, matrix: Float32Array, textureConfig: TextureConfig) {\n const [w, h] = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n const packedRGBA = new Float32Array(\n tex_util.getPackedRGBAArraySizeFromMatrixShape(rows, columns));\n tex_util.encodeMatrixToPackedRGBA(matrix, rows, columns, packedRGBA);\n uploadDataToTexture(gl, texture, w, h, packedRGBA, gl.RGBA);\n}\n\nexport function maybeCreateBufferFromOutputTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, rows: number,\n columns: number, textureConfig: TextureConfig): WebGLBuffer|WebGLTexture {\n let bufferOrTexture: WebGLBuffer|WebGLTexture = texture;\n\n if (ENV.get('WEBGL_VERSION') === 2) {\n const gl2 = gl as WebGL2RenderingContext;\n\n // Create and bind the buffer.\n const buffer = gl2.createBuffer();\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer));\n\n // Initialize the buffer to the size of the texture in bytes.\n const bytesPerFloat = 4;\n const bufferSizeBytes = bytesPerFloat *\n tex_util.getUnpackedArraySizeFromMatrixSize(\n rows * columns, textureConfig.downloadUnpackNumChannels);\n\n webgl_util.callAndCheck(\n gl,\n () => gl.bufferData(\n gl2.PIXEL_PACK_BUFFER, bufferSizeBytes, gl.STATIC_DRAW));\n\n // Enqueue a command on the GPU command queue to copy of texture into the\n // buffer.\n webgl_util.callAndCheck(\n gl, () => gl2.readPixels(0, 0, columns, rows, gl.RGBA, gl.FLOAT, 0));\n\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl2.PIXEL_PACK_BUFFER, null));\n\n bufferOrTexture = buffer;\n }\n\n return bufferOrTexture;\n}\n\nexport function downloadFloat32MatrixFromBuffer(\n gl: WebGLRenderingContext, buffer: WebGLBuffer, rows: number,\n columns: number, textureConfig: TextureConfig): Float32Array {\n const gl2 = gl as WebGL2RenderingContext;\n\n const downloadTarget =\n new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(\n rows * columns, textureConfig.downloadUnpackNumChannels));\n\n gl2.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl2.getBufferSubData(gl.ARRAY_BUFFER, 0, downloadTarget);\n gl2.bindBuffer(gl.ARRAY_BUFFER, null);\n\n const matrix = new Float32Array(rows * columns);\n tex_util.decodeMatrixFromUnpackedArray(\n downloadTarget as Float32Array, matrix,\n textureConfig.downloadUnpackNumChannels);\n\n return matrix;\n}\n\nexport function downloadFloat32MatrixFromOutputTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): Float32Array {\n const [w, h] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n\n const downloadTarget =\n new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(\n rows * columns, textureConfig.downloadUnpackNumChannels));\n\n webgl_util.callAndCheck(\n gl,\n () => gl.readPixels(\n 0, 0, w, h, textureConfig.downloadTextureFormat, gl.FLOAT,\n downloadTarget));\n\n const matrix = new Float32Array(rows * columns);\n tex_util.decodeMatrixFromUnpackedArray(\n downloadTarget as Float32Array, matrix,\n textureConfig.downloadUnpackNumChannels);\n return matrix;\n}\n\nexport function downloadByteEncodedFloatMatrixFromOutputTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig) {\n const [w, h] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n\n const numChannels = 4;\n const downloadTarget = new Uint8Array(\n tex_util.getUnpackedArraySizeFromMatrixSize(rows * columns, numChannels));\n\n webgl_util.callAndCheck(\n gl,\n () => gl.readPixels(\n 0, 0, w, h, textureConfig.downloadTextureFormat, gl.UNSIGNED_BYTE,\n downloadTarget));\n\n // By wrapping the buffer in a Float32Array, we use native browser IEEE 754\n // decoding of the 4 bytes that back each 32 bit float.\n return new Float32Array(downloadTarget.buffer);\n}\n\nexport function downloadMatrixFromPackedOutputTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): Float32Array {\n const [w, h] = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n const packedRGBA = new Float32Array(\n tex_util.getPackedRGBAArraySizeFromMatrixShape(rows, columns));\n webgl_util.callAndCheck(\n gl, () => gl.readPixels(0, 0, w, h, gl.RGBA, gl.FLOAT, packedRGBA));\n const matrix = new Float32Array(rows * columns);\n return tex_util.decodeMatrixFromPackedRGBA(packedRGBA, rows, columns, matrix);\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../../environment';\nimport * as util from '../../util';\nimport * as gpgpu_util from './gpgpu_util';\nimport {TextureConfig} from './gpgpu_util';\nimport * as tex_util from './tex_util';\nimport {WebGL1DisjointQueryTimerExtension, WebGL2DisjointQueryTimerExtension} from './webgl_types';\nimport * as webgl_util from './webgl_util';\n\nexport interface FenceContext {\n query: WebGLQuery|WebGLSync;\n isFencePassed(): boolean;\n}\n\nexport class GPGPUContext {\n gl: WebGLRenderingContext;\n textureFloatExtension: {};\n textureHalfFloatExtension: {};\n colorBufferFloatExtension: {};\n colorBufferHalfFloatExtension: {};\n getBufferSubDataAsyncExtension: {};\n loseContextExtension: WebGLLoseContext;\n disjointQueryTimerExtension: WebGL2DisjointQueryTimerExtension|\n WebGL1DisjointQueryTimerExtension;\n vertexBuffer: WebGLBuffer;\n indexBuffer: WebGLBuffer;\n framebuffer: WebGLFramebuffer;\n outputTexture: WebGLTexture|null = null;\n program: WebGLProgram|null = null;\n private disposed = false;\n private autoDebugValidate = false;\n private disjoint: boolean;\n\n private textureConfig: TextureConfig;\n\n constructor(gl?: WebGLRenderingContext) {\n if (gl != null) {\n this.gl = gl;\n } else {\n this.gl = gpgpu_util.createWebGLContext();\n }\n // WebGL 2.0 enables texture floats without an extension.\n if (ENV.get('WEBGL_VERSION') === 1) {\n this.textureFloatExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'OES_texture_float');\n this.colorBufferFloatExtension =\n this.gl.getExtension('WEBGL_color_buffer_float');\n\n if (!ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) {\n this.textureHalfFloatExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'OES_texture_half_float');\n this.colorBufferHalfFloatExtension =\n this.gl.getExtension('EXT_color_buffer_half_float');\n }\n } else {\n this.colorBufferFloatExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'EXT_color_buffer_float');\n }\n\n this.loseContextExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'WEBGL_lose_context') as\n WebGLLoseContext;\n\n this.vertexBuffer = gpgpu_util.createVertexBuffer(this.gl);\n this.indexBuffer = gpgpu_util.createIndexBuffer(this.gl);\n this.framebuffer = webgl_util.createFramebuffer(this.gl);\n\n this.textureConfig =\n gpgpu_util.getTextureConfig(this.gl, this.textureHalfFloatExtension);\n }\n\n public dispose() {\n if (this.disposed) {\n return;\n }\n if (this.program != null) {\n console.warn(\n 'Disposing a GPGPUContext that still has a bound WebGLProgram.' +\n ' This is probably a resource leak, delete the program with ' +\n 'GPGPUContext.deleteProgram before disposing.');\n }\n if (this.outputTexture != null) {\n console.warn(\n 'Disposing a GPGPUContext that still has a bound output matrix ' +\n 'texture. This is probably a resource leak, delete the output ' +\n 'matrix texture with GPGPUContext.deleteMatrixTexture before ' +\n 'disposing.');\n }\n const gl = this.gl;\n webgl_util.callAndCheck(gl, () => gl.finish());\n webgl_util.callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, null));\n webgl_util.callAndCheck(gl, () => gl.deleteFramebuffer(this.framebuffer));\n webgl_util.callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, null));\n webgl_util.callAndCheck(gl, () => gl.deleteBuffer(this.vertexBuffer));\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null));\n webgl_util.callAndCheck(gl, () => gl.deleteBuffer(this.indexBuffer));\n this.loseContextExtension.loseContext();\n this.disposed = true;\n }\n\n public enableAutomaticDebugValidation(enabled: boolean) {\n this.autoDebugValidate = enabled;\n webgl_util.enableDebugWebGLErrorChecking(enabled);\n }\n\n public createFloat32MatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createFloat32MatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public createFloat16MatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createFloat16MatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public createUnsignedBytesMatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createUnsignedBytesMatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public uploadPixelDataToTexture(\n texture: WebGLTexture,\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement) {\n this.throwIfDisposed();\n gpgpu_util.uploadPixelDataToTexture(this.gl, texture, pixels);\n }\n\n public createPackedMatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createPackedMatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public deleteMatrixTexture(texture: WebGLTexture) {\n this.throwIfDisposed();\n if (this.outputTexture === texture) {\n webgl_util.unbindColorTextureFromFramebuffer(this.gl, this.framebuffer);\n this.outputTexture = null;\n }\n webgl_util.callAndCheck(this.gl, () => this.gl.deleteTexture(texture));\n }\n\n public uploadMatrixToTexture(\n texture: WebGLTexture, rows: number, columns: number,\n matrix: Float32Array) {\n this.throwIfDisposed();\n const numChannels = webgl_util.getNumChannels();\n return gpgpu_util.uploadMatrixToTexture(\n this.gl, texture, rows, columns, matrix, numChannels,\n this.textureConfig);\n }\n\n public uploadMatrixToPackedTexture(\n texture: WebGLTexture, rows: number, columns: number,\n matrix: Float32Array) {\n this.throwIfDisposed();\n return gpgpu_util.uploadMatrixToPackedTexture(\n this.gl, texture, rows, columns, matrix, this.textureConfig);\n }\n\n public downloadFloat32MatrixFromOutputTexture(\n texture: WebGLTexture, rows: number, columns: number): Float32Array {\n return this.downloadMatrixDriver(\n texture,\n () => gpgpu_util.downloadFloat32MatrixFromOutputTexture(\n this.gl, rows, columns, this.textureConfig));\n }\n\n public downloadByteEncodedFloatMatrixFromOutputTexture(\n texture: WebGLTexture, rows: number, columns: number): Float32Array {\n return this.downloadMatrixDriver(\n texture,\n () => gpgpu_util.downloadByteEncodedFloatMatrixFromOutputTexture(\n this.gl, rows, columns, this.textureConfig));\n }\n\n public downloadFloat32MatrixFromBuffer(\n buffer: WebGLBuffer, rows: number, columns: number): Float32Array {\n return gpgpu_util.downloadFloat32MatrixFromBuffer(\n this.gl, buffer, rows, columns, this.textureConfig);\n }\n\n public maybeCreateBufferFromTexture(\n texture: WebGLTexture, rows: number, columns: number): WebGLBuffer\n |WebGLTexture {\n this.bindTextureToFrameBuffer(texture);\n const result = gpgpu_util.maybeCreateBufferFromOutputTexture(\n this.gl, texture, rows, columns, this.textureConfig);\n this.unbindTextureToFrameBuffer();\n return result;\n }\n\n public createAndWaitForFence(): Promise {\n const fenceContext = this.createFence(this.gl);\n return this.pollFence(fenceContext);\n }\n\n private createFence(gl: WebGLRenderingContext): FenceContext {\n let query: WebGLQuery|WebGLSync;\n let isFencePassed: () => boolean;\n\n if (ENV.get('WEBGL_FENCE_API_ENABLED')) {\n const gl2 = gl as WebGL2RenderingContext;\n\n const sync = gl2.fenceSync(gl2.SYNC_GPU_COMMANDS_COMPLETE, 0);\n gl.flush();\n\n isFencePassed = () => {\n const status = gl2.clientWaitSync(sync, 0, 0);\n return status === gl2.ALREADY_SIGNALED ||\n status === gl2.CONDITION_SATISFIED;\n };\n\n query = sync;\n } else if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n query = this.beginQuery();\n this.endQuery();\n isFencePassed = () => this.isQueryAvailable(\n query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'));\n } else {\n // If we have no way to fence, return true immediately. This will fire in\n // WebGL 1.0 when there is no disjoint query timer. In this case, because\n // the fence passes immediately, we'll immediately ask for a download of\n // the texture, which will cause the UI thread to hang.\n isFencePassed = () => true;\n }\n\n return {query, isFencePassed};\n }\n\n public downloadMatrixFromPackedTexture(\n texture: WebGLTexture, rows: number, columns: number): Float32Array {\n return this.downloadMatrixDriver(\n texture,\n () => gpgpu_util.downloadMatrixFromPackedOutputTexture(\n this.gl, rows, columns, this.textureConfig));\n }\n\n private vertexAttrsAreBound = false;\n\n public createProgram(fragmentShaderSource: string): WebGLProgram {\n this.throwIfDisposed();\n const gl = this.gl;\n const fragmentShader: WebGLShader =\n webgl_util.createFragmentShader(gl, fragmentShaderSource);\n const vertexShader: WebGLShader = gpgpu_util.createVertexShader(gl);\n const program: WebGLProgram = webgl_util.createProgram(gl);\n webgl_util.callAndCheck(gl, () => gl.attachShader(program, vertexShader));\n webgl_util.callAndCheck(gl, () => gl.attachShader(program, fragmentShader));\n webgl_util.linkProgram(gl, program);\n if (this.autoDebugValidate) {\n webgl_util.validateProgram(gl, program);\n }\n if (!this.vertexAttrsAreBound) {\n this.setProgram(program);\n this.vertexAttrsAreBound = gpgpu_util.bindVertexProgramAttributeStreams(\n gl, this.program, this.vertexBuffer);\n }\n return program;\n }\n\n public deleteProgram(program: WebGLProgram) {\n this.throwIfDisposed();\n if (program === this.program) {\n this.program = null;\n }\n if (program != null) {\n webgl_util.callAndCheck(this.gl, () => this.gl.deleteProgram(program));\n }\n }\n\n public setProgram(program: WebGLProgram|null) {\n this.throwIfDisposed();\n this.program = program;\n if ((this.program != null) && this.autoDebugValidate) {\n webgl_util.validateProgram(this.gl, this.program);\n }\n webgl_util.callAndCheck(this.gl, () => this.gl.useProgram(program));\n }\n\n public getUniformLocation(\n program: WebGLProgram, uniformName: string,\n shouldThrow = true): WebGLUniformLocation {\n this.throwIfDisposed();\n if (shouldThrow) {\n return webgl_util.getProgramUniformLocationOrThrow(\n this.gl, program, uniformName);\n } else {\n return webgl_util.getProgramUniformLocation(\n this.gl, program, uniformName);\n }\n }\n\n public getAttributeLocation(program: WebGLProgram, attribute: string):\n number {\n this.throwIfDisposed();\n return webgl_util.callAndCheck(\n this.gl, () => this.gl.getAttribLocation(program, attribute));\n }\n\n public getUniformLocationNoThrow(program: WebGLProgram, uniformName: string):\n WebGLUniformLocation {\n this.throwIfDisposed();\n return this.gl.getUniformLocation(program, uniformName);\n }\n\n public setInputMatrixTexture(\n inputMatrixTexture: WebGLTexture, uniformLocation: WebGLUniformLocation,\n textureUnit: number) {\n this.throwIfDisposed();\n this.throwIfNoProgram();\n webgl_util.bindTextureToProgramUniformSampler(\n this.gl, this.program, inputMatrixTexture, uniformLocation,\n textureUnit);\n }\n\n public setOutputMatrixTexture(\n outputMatrixTexture: WebGLTexture, rows: number, columns: number) {\n this.setOutputMatrixTextureDriver(outputMatrixTexture, columns, rows);\n }\n\n public setOutputPackedMatrixTexture(\n outputPackedMatrixTexture: WebGLTexture, rows: number, columns: number) {\n this.throwIfDisposed();\n const [width, height] =\n tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n this.setOutputMatrixTextureDriver(outputPackedMatrixTexture, width, height);\n }\n\n public setOutputMatrixWriteRegion(\n startRow: number, numRows: number, startColumn: number,\n numColumns: number) {\n this.setOutputMatrixWriteRegionDriver(\n startColumn, startRow, numColumns, numRows);\n }\n\n public setOutputPackedMatrixWriteRegion(\n startRow: number, numRows: number, startColumn: number,\n numColumns: number) {\n throw new Error('setOutputPackedMatrixWriteRegion not implemented.');\n }\n\n public debugValidate() {\n if (this.program != null) {\n webgl_util.validateProgram(this.gl, this.program);\n }\n webgl_util.validateFramebuffer(this.gl);\n }\n\n public executeProgram() {\n this.throwIfDisposed();\n this.throwIfNoProgram();\n const gl = this.gl;\n if (this.autoDebugValidate) {\n this.debugValidate();\n }\n webgl_util.callAndCheck(\n gl, () => gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0));\n }\n\n public blockUntilAllProgramsCompleted() {\n this.throwIfDisposed();\n webgl_util.callAndCheck(this.gl, () => this.gl.finish());\n }\n\n private getQueryTimerExtension(): WebGL1DisjointQueryTimerExtension\n |WebGL2DisjointQueryTimerExtension {\n if (this.disjointQueryTimerExtension == null) {\n this.disjointQueryTimerExtension =\n webgl_util.getExtensionOrThrow(\n this.gl,\n ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2 ?\n 'EXT_disjoint_timer_query_webgl2' :\n 'EXT_disjoint_timer_query') as\n WebGL1DisjointQueryTimerExtension |\n WebGL2DisjointQueryTimerExtension;\n }\n return this.disjointQueryTimerExtension;\n }\n\n private getQueryTimerExtensionWebGL2(): WebGL2DisjointQueryTimerExtension {\n return this.getQueryTimerExtension();\n }\n\n private getQueryTimerExtensionWebGL1(): WebGL1DisjointQueryTimerExtension {\n return this.getQueryTimerExtension() as WebGL1DisjointQueryTimerExtension;\n }\n\n beginQuery(): WebGLQuery {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.getQueryTimerExtensionWebGL2();\n\n const query = gl2.createQuery();\n gl2.beginQuery(ext.TIME_ELAPSED_EXT, query);\n return query;\n }\n const ext = this.getQueryTimerExtensionWebGL1();\n const query = ext.createQueryEXT();\n ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);\n return query;\n }\n\n endQuery() {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.getQueryTimerExtensionWebGL2();\n gl2.endQuery(ext.TIME_ELAPSED_EXT);\n return;\n }\n const ext = this.getQueryTimerExtensionWebGL1();\n ext.endQueryEXT(ext.TIME_ELAPSED_EXT);\n }\n\n public async waitForQueryAndGetTime(query: WebGLQuery): Promise {\n await util.repeatedTry(\n () => this.isQueryAvailable(\n query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')));\n return this.getQueryTime(\n query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'));\n }\n\n private getQueryTime(query: WebGLQuery, queryTimerVersion: number): number {\n if (queryTimerVersion === 0) {\n return null;\n }\n\n if (queryTimerVersion === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n\n const timeElapsedNanos = gl2.getQueryParameter(query, gl2.QUERY_RESULT);\n // Return milliseconds.\n return timeElapsedNanos / 1000000;\n } else {\n const ext = this.getQueryTimerExtensionWebGL1();\n\n const timeElapsedNanos =\n ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT);\n // Return milliseconds.\n return timeElapsedNanos / 1000000;\n }\n }\n\n private isQueryAvailable(query: WebGLQuery, queryTimerVersion: number):\n boolean {\n if (queryTimerVersion === 0) {\n return true;\n }\n\n if (queryTimerVersion === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.getQueryTimerExtensionWebGL2();\n\n const available =\n gl2.getQueryParameter(query, gl2.QUERY_RESULT_AVAILABLE);\n if (this.disjoint == null) {\n this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT);\n }\n\n return available && !this.disjoint;\n } else {\n const ext = this.getQueryTimerExtensionWebGL1();\n\n const available =\n ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT);\n if (this.disjoint == null) {\n this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT);\n }\n\n return available && !this.disjoint;\n }\n }\n\n pollFence(fenceContext: FenceContext) {\n return new Promise(resolve => {\n this.addItemToPoll(() => fenceContext.isFencePassed(), () => resolve());\n });\n }\n\n private itemsToPoll: PollItem[] = [];\n\n pollItems(): void {\n // Find the last query that has finished using binary search.\n // All other queries before it are also done.\n const index = binSearchLastTrue(this.itemsToPoll.map(x => x.isDoneFn));\n for (let i = 0; i <= index; ++i) {\n const {resolveFn} = this.itemsToPoll[i];\n resolveFn();\n }\n this.itemsToPoll = this.itemsToPoll.slice(index + 1);\n }\n\n private addItemToPoll(isDoneFn: () => boolean, resolveFn: () => void) {\n this.itemsToPoll.push({isDoneFn, resolveFn});\n if (this.itemsToPoll.length > 1) {\n // We already have a running loop that polls.\n return;\n }\n // Start a new loop that polls.\n util.repeatedTry(() => {\n this.pollItems();\n // End the loop if no more items to poll.\n return this.itemsToPoll.length === 0;\n });\n }\n private bindTextureToFrameBuffer(texture: WebGLTexture) {\n this.throwIfDisposed();\n webgl_util.bindColorTextureToFramebuffer(\n this.gl, texture, this.framebuffer);\n if (this.autoDebugValidate) {\n webgl_util.validateFramebuffer(this.gl);\n }\n }\n\n private unbindTextureToFrameBuffer() {\n if (this.outputTexture != null) {\n webgl_util.bindColorTextureToFramebuffer(\n this.gl, this.outputTexture, this.framebuffer);\n if (this.autoDebugValidate) {\n webgl_util.validateFramebuffer(this.gl);\n }\n } else {\n webgl_util.unbindColorTextureFromFramebuffer(this.gl, this.framebuffer);\n }\n }\n\n private downloadMatrixDriver(\n texture: WebGLTexture,\n downloadAndDecode: () => Float32Array): Float32Array {\n this.bindTextureToFrameBuffer(texture);\n const result = downloadAndDecode();\n this.unbindTextureToFrameBuffer();\n\n return result;\n }\n\n private setOutputMatrixTextureDriver(\n outputMatrixTextureMaybePacked: WebGLTexture, width: number,\n height: number) {\n this.throwIfDisposed();\n const gl = this.gl;\n webgl_util.bindColorTextureToFramebuffer(\n gl, outputMatrixTextureMaybePacked, this.framebuffer);\n if (this.autoDebugValidate) {\n webgl_util.validateFramebuffer(gl);\n }\n this.outputTexture = outputMatrixTextureMaybePacked;\n webgl_util.callAndCheck(gl, () => gl.viewport(0, 0, width, height));\n webgl_util.callAndCheck(gl, () => gl.scissor(0, 0, width, height));\n }\n\n private setOutputMatrixWriteRegionDriver(\n x: number, y: number, width: number, height: number) {\n this.throwIfDisposed();\n webgl_util.callAndCheck(\n this.gl, () => this.gl.scissor(x, y, width, height));\n }\n\n private throwIfDisposed() {\n if (this.disposed) {\n throw new Error('Attempted to use disposed GPGPUContext.');\n }\n }\n\n private throwIfNoProgram() {\n if (this.program == null) {\n throw new Error('No GPU program is currently set.');\n }\n }\n}\n\ntype PollItem = {\n isDoneFn: () => boolean,\n resolveFn: () => void\n};\n\n/**\n * Finds the index of the last true element using binary search where\n * evaluation of an entry is expensive.\n */\nexport function binSearchLastTrue(arr: Array<() => boolean>): number {\n let start = 0;\n let end = arr.length - 1;\n let best = -1;\n while (start <= end) {\n const mid = (start + end) >> 1;\n const isDone = arr[mid]();\n if (isDone) {\n best = mid;\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n return best;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../../tensor';\nimport * as util from '../../util';\n\nimport {GPGPUContext} from './gpgpu_context';\nimport * as shader_compiler from './shader_compiler';\nimport {InputInfo, ShapeInfo} from './shader_compiler';\nimport {TextureData} from './tex_util';\n\nexport interface GPGPUProgram {\n variableNames: string[];\n outputShape: number[];\n userCode: string;\n supportsBroadcasting?: boolean;\n}\n\nexport interface GPGPUBinary {\n webGLProgram: WebGLProgram;\n program: GPGPUProgram;\n uniformLocations: {[name: string]: WebGLUniformLocation};\n gpgpu: GPGPUContext;\n source: string;\n inShapeInfos: ShapeInfo[];\n outShapeInfo: ShapeInfo;\n}\n\nexport interface TensorData {\n tensor: T;\n texData: TextureData;\n isUniform: boolean;\n}\n\nexport function compileProgram(\n gpgpu: GPGPUContext, program: GPGPUProgram, inputs: Array>,\n output: TensorData): GPGPUBinary {\n const userCode = program.userCode;\n const inputInfos: InputInfo[] = inputs.map((input, i) => {\n const shapeInfo = {\n logicalShape: input.tensor.shape,\n texShape: input.isUniform ? null : input.texData.texShape,\n isUniform: input.isUniform\n };\n return {name: program.variableNames[i], shapeInfo};\n });\n const inShapeInfos = inputInfos.map(x => x.shapeInfo);\n const outShapeInfo = {\n logicalShape: output.tensor.shape,\n texShape: output.texData.texShape,\n isUniform: false\n };\n const source = shader_compiler.makeShader(\n inputInfos, outShapeInfo, userCode,\n program.supportsBroadcasting === true);\n\n const webGLProgram = gpgpu.createProgram(source);\n\n const uniformLocations: {[name: string]: WebGLUniformLocation} = {};\n for (let i = 0; i < program.variableNames.length; i++) {\n const uniformName = program.variableNames[i];\n const shouldThrow = false;\n uniformLocations[uniformName] =\n gpgpu.getUniformLocation(webGLProgram, uniformName, shouldThrow);\n }\n\n return {\n program,\n source,\n webGLProgram,\n uniformLocations,\n gpgpu,\n inShapeInfos,\n outShapeInfo\n };\n}\n\nfunction validateBinaryAndProgram(\n shapeInfos: ShapeInfo[], inputs: Array>) {\n if (shapeInfos.length !== inputs.length) {\n throw Error(\n `Binary was compiled with ${shapeInfos.length} inputs, but ` +\n `was executed with ${inputs.length} inputs`);\n }\n\n shapeInfos.forEach((s, i) => {\n const shapeA = s.logicalShape;\n const input = inputs[i];\n const shapeB = input.tensor.shape;\n\n if (!util.arraysEqual(shapeA, shapeB)) {\n throw Error(\n `Binary was compiled with different shapes than ` +\n `the current args. Shapes ${shapeA} and ${shapeB} must match`);\n }\n // The input is uploaded as uniform.\n if (s.isUniform && input.isUniform) {\n return;\n }\n\n const texShapeA = s.texShape;\n const texShapeB = input.isUniform ? null : input.texData.texShape;\n if (!util.arraysEqual(texShapeA, texShapeB)) {\n throw Error(\n `Binary was compiled with different texture shapes than the` +\n ` current args. Shape ${texShapeA} and ${texShapeB} must match`);\n }\n });\n}\n\nexport function runProgram(\n binary: GPGPUBinary, inputs: Array>, output: TensorData,\n customSetup?: (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) =>\n void): void {\n validateBinaryAndProgram(binary.inShapeInfos, inputs);\n validateBinaryAndProgram([binary.outShapeInfo], [output]);\n\n const outTex = output.texData.texture;\n const outTexShape = output.texData.texShape;\n const gpgpu = binary.gpgpu;\n gpgpu.setOutputMatrixTexture(outTex, outTexShape[0], outTexShape[1]);\n gpgpu.setProgram(binary.webGLProgram);\n inputs.forEach((input, i) => {\n const variableName = binary.program.variableNames[i];\n const variableUniformLocation = binary.uniformLocations[variableName];\n if (variableUniformLocation != null) {\n if (input.isUniform) {\n if (input.tensor.size === 1) {\n gpgpu.gl.uniform1f(\n variableUniformLocation, input.tensor.dataSync()[0]);\n } else {\n let vals = input.tensor.dataSync();\n if (!(vals instanceof Float32Array)) {\n vals = new Float32Array(vals);\n }\n gpgpu.gl.uniform1fv(variableUniformLocation, vals);\n }\n return;\n }\n const tex = input.texData.texture;\n gpgpu.setInputMatrixTexture(tex, variableUniformLocation, i);\n }\n });\n\n if (customSetup != null) {\n customSetup(gpgpu, binary.webGLProgram);\n }\n gpgpu.executeProgram();\n}\n\nexport function makeShaderKey(\n program: GPGPUProgram, inputs: Array>,\n output: TensorData): string {\n let keyInputs = '';\n inputs.concat(output).forEach(x => {\n keyInputs +=\n `${x.tensor.shape}_${x.isUniform ? 'uniform' : x.texData.texShape}`;\n });\n const keyUserCode = program.userCode;\n const keyBroadcast = (program.supportsBroadcasting === true).toString();\n let key = program.constructor.name;\n // Fast string concat. See https://jsperf.com/string-concatenation/14.\n key += '_' + keyBroadcast + '_' + keyInputs + '_' + keyUserCode;\n return key;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class LRNProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(\n xShape: number[], radius: number, bias: number, alpha: number,\n beta: number) {\n const rad = radius;\n const maxD = xShape[3] - 1;\n this.outputShape = xShape;\n\n // optimize pow(bias + alpha * sum, -beta)\n // src: https://github.com/tensorflow/tensorflow/..\n // blob/26033a1644a9c4a5fbe3170ab2e864b6a4ccd4ca/..\n // tensorflow/core/kernels/mkl_lrn_op.cc#L320\n let powOperator;\n const basis = `float(${bias}) + float(${alpha}) * sum`;\n if (beta === 0.5) {\n powOperator = `inversesqrt(${basis})`;\n } else if (beta === 1.0) {\n powOperator = `1.0/(${basis})`;\n } else {\n powOperator = `exp(log(${basis}) * float(-${beta}));`;\n }\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${rad}; j <= ${rad}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${maxD}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${powOperator};\n setOutput(val);\n }\n `;\n }\n}\n","import {GPGPUProgram} from './gpgpu_math';\n\nexport class LRNGradProgram implements GPGPUProgram {\n variableNames = ['inputImage', 'outputImage', 'dy'];\n outputShape: number[] = [];\n userCode: string;\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n depth: number;\n\n constructor(\n inputShape: number[], depthRadius: number, bias: number, alpha: number,\n beta: number) {\n this.outputShape = inputShape;\n this.depth = inputShape[3];\n this.depthRadius = depthRadius;\n this.bias = bias;\n this.alpha = alpha;\n this.beta = beta;\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${depthRadius})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${depthRadius} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${alpha}) * norm + float(${bias});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${alpha})\n * float(${beta})\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${beta});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class MaxPool2DBackpropProgram implements GPGPUProgram {\n variableNames = ['dy', 'maxPos'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n\n const lastIndex = filterHeight * filterWidth - 1;\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${lastIndex} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${filterWidth} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class MatMulProgram implements GPGPUProgram {\n variableNames = ['matrixA', 'matrixB'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n aShape: [number, number], bShape: [number, number], transposeA = false,\n transposeB = false) {\n const outerShapeA = transposeA ? aShape[1] : aShape[0];\n const outerShapeB = transposeB ? bShape[0] : bShape[1];\n const sharedDim = transposeA ? aShape[0] : aShape[1];\n this.outputShape = [outerShapeA, outerShapeB];\n\n const aSnippetFromOffset = (vec4Offset: number, indexVar: string|number) =>\n transposeA ? `${indexVar} + ${vec4Offset}, aRow` :\n `aRow, ${indexVar} + ${vec4Offset}`;\n const bSnippetFromOffset = (vec4Offset: number, indexVar: string|number) =>\n transposeB ? `bCol, ${indexVar} + ${vec4Offset}` :\n `${indexVar} + ${vec4Offset}, bCol`;\n\n const sharedDimNearestVec4 = Math.floor(sharedDim / 4) * 4;\n const sharedDimVec4Remainder = sharedDim % 4;\n\n this.userCode = ` float dotARowBCol(int aRow, int bCol) {\n float result = 0.0;\n for (int i = 0; i < ${sharedDimNearestVec4}; i += 4) {\n vec4 a = vec4(\n getMatrixA(${aSnippetFromOffset(0, 'i')}),\n getMatrixA(${aSnippetFromOffset(1, 'i')}),\n getMatrixA(${aSnippetFromOffset(2, 'i')}),\n getMatrixA(${aSnippetFromOffset(3, 'i')})\n );\n vec4 b = vec4(\n getMatrixB(${bSnippetFromOffset(0, 'i')}),\n getMatrixB(${bSnippetFromOffset(1, 'i')}),\n getMatrixB(${bSnippetFromOffset(2, 'i')}),\n getMatrixB(${bSnippetFromOffset(3, 'i')})\n );\n\n result += dot(a, b);\n }\n\n if (${sharedDimVec4Remainder === 1}) {\n result += getMatrixA(${aSnippetFromOffset(0, sharedDimNearestVec4)}) *\n getMatrixB(${bSnippetFromOffset(0, sharedDimNearestVec4)});\n } else if (${sharedDimVec4Remainder === 2}) {\n vec2 a = vec2(\n getMatrixA(${aSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixA(${aSnippetFromOffset(1, sharedDimNearestVec4)})\n );\n vec2 b = vec2(\n getMatrixB(${bSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixB(${bSnippetFromOffset(1, sharedDimNearestVec4)})\n );\n result += dot(a, b);\n } else if (${sharedDimVec4Remainder === 3}) {\n vec3 a = vec3(\n getMatrixA(${aSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixA(${aSnippetFromOffset(1, sharedDimNearestVec4)}),\n getMatrixA(${aSnippetFromOffset(2, sharedDimNearestVec4)})\n );\n vec3 b = vec3(\n getMatrixB(${bSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixB(${bSnippetFromOffset(1, sharedDimNearestVec4)}),\n getMatrixB(${bSnippetFromOffset(2, sharedDimNearestVec4)})\n );\n result += dot(a, b);\n }\n\n return result;\n }\n\n void main() {\n ivec2 resRC = getOutputCoords();\n setOutput(dotARowBCol(resRC.x, resRC.y));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class MultinomialProgram implements GPGPUProgram {\n variableNames = ['probs'];\n outputShape: number[];\n userCode: string;\n\n // Caching uniform location for speed.\n seedLoc: WebGLUniformLocation;\n\n constructor(batchSize: number, numOutcomes: number, numSamples: number) {\n this.outputShape = [batchSize, numSamples];\n\n this.userCode = `\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${numOutcomes - 1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${numOutcomes - 1}));\n }\n `;\n }\n\n getCustomSetupFunc(seed: number) {\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.seedLoc == null) {\n this.seedLoc = gpgpu.getUniformLocation(webGLProgram, 'seed');\n }\n gpgpu.gl.uniform1f(this.seedLoc, seed);\n };\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class OneHotProgram implements GPGPUProgram {\n variableNames = ['indices'];\n outputShape: number[];\n userCode: string;\n\n // Caching uniform location for speed.\n seedLoc: WebGLUniformLocation;\n\n constructor(\n numIndices: number, depth: number, onValue: number, offValue: number) {\n this.outputShape = [numIndices, depth];\n\n this.userCode = `\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${offValue}), float(${onValue}),\n float(index == coords.y)));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class PadProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n xShape: number[], paddings: Array<[number, number]>,\n constantValue: number) {\n this.outputShape = paddings.map(\n (p, i) => p[0] /* beforePad */ + xShape[i] + p[1] /* afterPad */);\n const rank = xShape.length;\n const type = getCoordsDataType(rank);\n\n const start = paddings.map(p => p[0]).join(',');\n const end = paddings.map((p, i) => p[0] + xShape[i]).join(',');\n const unpackedCoords =\n ['coords[0]', 'coords[1]', 'coords[2]','coords[3]'].slice(0, rank);\n\n if (rank === 1) {\n this.userCode = `\n int start = ${start};\n int end = ${end};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float(${constantValue}));\n } else {\n setOutput(getX(outC - start));\n }\n }\n `;\n return;\n }\n this.userCode = `\n ${type} start = ${type}(${start});\n ${type} end = ${type}(${end});\n\n void main() {\n ${type} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float(${constantValue}));\n } else {\n ${type} coords = outC - start;\n setOutput(getX(${unpackedCoords}));\n }\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class Pool2DProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n convInfo: Conv2DInfo, poolType: 'max'|'avg', computePositions: boolean) {\n if (poolType === 'avg' && computePositions) {\n throw new Error('Cannot compute positions for average pool.');\n }\n\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n this.outputShape = convInfo.outShape;\n\n const isAvgPool = poolType === 'avg';\n\n let initializationValue = '0.0';\n if (!isAvgPool) {\n initializationValue = '-1.0 / 0.0';\n }\n\n if (computePositions) {\n const compareOp = '>=';\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${compareOp} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * ${filterWidth} + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `;\n return;\n }\n\n const compareOp = 'max';\n\n let returnValue = `${poolType}(${poolType}(${poolType}(` +\n 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])';\n if (poolType === 'avg') {\n returnValue = `avgValue / count`;\n }\n\n const filterWidthNearestVec4 = Math.floor(filterWidth / 4) * 4;\n const filterWidthVec4Remainder = filterWidth % 4;\n\n const updateSnippet = `\n if (${isAvgPool}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ${compareOp}(values, minMaxValue);\n }\n `;\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n const float initializationValue = ${initializationValue};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${initializationValue});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidthNearestVec4}; wC += 4) {\n int xC = xCCorner + wC;\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n getValue(batch, xR, xC + 3, d)\n );\n\n ${updateSnippet}\n }\n\n int xC = xCCorner + ${filterWidthNearestVec4};\n if (${filterWidthVec4Remainder === 1}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${filterWidthVec4Remainder === 2}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${filterWidthVec4Remainder === 3}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n initializationValue\n );\n\n ${updateSnippet}\n }\n }\n setOutput(${returnValue});\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ReduceInfo} from '../../ops/reduce_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ReduceProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n reduceInfo: ReduceInfo, reduceType: 'all'|'any'|'max'|'min'|'sum') {\n const windowSize = reduceInfo.windowSize;\n const batchSize = reduceInfo.batchSize;\n const inSize = reduceInfo.inSize;\n const outSize = Math.ceil(inSize / windowSize);\n this.outputShape = [batchSize, outSize];\n\n let initializationValue = '0.0';\n let compareOp = ``;\n\n if (reduceType === 'min') {\n initializationValue = '1.0 / 0.0';\n compareOp = `min`;\n } else if (reduceType === 'max') {\n initializationValue = '-1.0 / 0.0';\n compareOp = `max`;\n }\n\n let returnValue = `${reduceType}(${reduceType}(${reduceType}(` +\n 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])';\n\n if (reduceType === 'sum') {\n returnValue = `sumValue`;\n } else if (reduceType === 'all') {\n returnValue = `allValue`;\n } else if (reduceType === 'any') {\n returnValue = `anyValue`;\n }\n\n const windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4;\n const windowSizeVec4Remainder = windowSize % 4;\n\n let updateSnippet = `\n if (${reduceType === 'sum'}) {\n sumValue += dot(values, ones);\n } else {\n minMaxValue = ${compareOp}(values, minMaxValue);\n }\n `;\n\n let vecType = `vec4`;\n\n if (reduceType === 'all') {\n initializationValue = '1.0';\n updateSnippet = `\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n `;\n vecType = `bvec4`;\n } else if (reduceType === 'any') {\n initializationValue = '0.0';\n updateSnippet = `\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n `;\n vecType = `bvec4`;\n }\n\n let checkOutOfBounds = '';\n if (inSize % windowSize > 0) {\n checkOutOfBounds = `\n if (inIdx < 0 || inIdx >= ${inSize}) {\n return initializationValue;\n }\n `;\n }\n this.userCode = `\n const float initializationValue = ${initializationValue};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${checkOutOfBounds}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${windowSize};\n\n vec4 minMaxValue = vec4(${initializationValue});\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${windowSizeNearestVec4}; i += 4) {\n int inIdx = inOffset + i;\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${updateSnippet}\n }\n\n int inIdx = inOffset + ${windowSizeNearestVec4};\n if (${windowSizeVec4Remainder === 1}) {\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 2}) {\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 3}) {\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${updateSnippet}\n }\n setOutput(${returnValue});\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor4D} from '../../tensor';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeBilinearBackpropProgram implements GPGPUProgram {\n variableNames = ['dy'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n this.outputShape = x.shape;\n const [, xHeight, xWidth, ] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass and add the corresponding\n // coefficient from dy to the gradient (with some interpolation).\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n const invHeightScale = 1 / heightScale;\n const invWidthScale = 1 / widthScale;\n\n // This defines the size of the window of values around a particular\n // index in dy that we want to search for contributions to dx.\n const winHeight = (Math.ceil(invHeightScale) * 2) + 2;\n const winWidth = (Math.ceil(invWidthScale) * 2) + 2;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${heightScale});\n const float widthScale = float(${widthScale});\n\n const float invHeightScale = float(${invHeightScale});\n const float invWidthScale = float(${invWidthScale});\n\n const int winHeight = int(${winHeight});\n const int winWidth = int(${winWidth});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${yHeight}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${yWidth}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${xHeight - 1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${xWidth - 1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeBilinearProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(\n inputShape: [number, number, number, number], newHeight: number,\n newWidth: number, alignCorners: boolean) {\n const [batch, oldHeight, oldWidth, depth] = inputShape;\n this.outputShape = [batch, newHeight, newWidth, depth];\n\n const effectiveInSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n this.userCode = `\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${effectiveInSize[0] / effectiveOutSize[0]},\n ${effectiveInSize[1] / effectiveOutSize[1]});\n const vec2 inputShapeRC = vec2(${oldHeight}.0, ${oldWidth}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor4D} from '../../tensor';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeNearestNeigborBackpropProgram implements GPGPUProgram {\n variableNames = ['dy'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n this.outputShape = x.shape;\n const [, xHeight, xWidth, ] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass and add the corresponding\n // coefficient from dy to the gradient (with some interpolation).\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n const invHeightScale = 1 / heightScale;\n const invWidthScale = 1 / widthScale;\n\n // This defines the size of the window of values around a particular\n // index in dy that we want to search for contributions to dx.\n const winHeight = (Math.ceil(invHeightScale) * 2) + 2;\n const winWidth = (Math.ceil(invWidthScale) * 2) + 2;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${heightScale});\n const float widthScale = float(${widthScale});\n\n const float invHeightScale = float(${invHeightScale});\n const float invWidthScale = float(${invWidthScale});\n\n const int winHeight = int(${winHeight});\n const int winWidth = int(${winWidth});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${yHeight}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${yWidth}) {\n continue;\n }\n\n float sourceFracRow =\n float(${effectiveXSize[0]}) *\n (float(dyR) / float(${effectiveYSize[0]}));\n\n float sourceFracCol =\n float(${effectiveXSize[1]}) *\n (float(dyC) / float(${effectiveYSize[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${xHeight}) - 1),\n ${alignCorners} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${xWidth}) - 1),\n ${alignCorners} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeNearestNeighborProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(\n inputShape: [number, number, number, number], newHeight: number,\n newWidth: number, alignCorners: boolean) {\n const [batch, oldHeight, oldWidth, depth] = inputShape;\n this.outputShape = [batch, newHeight, newWidth, depth];\n\n const effectiveInSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n // When align corners is false, we rounds the value with floor.\n const roundBase = alignCorners ? '0.5' : '0.0';\n\n this.userCode = `\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${effectiveInSize[0] / effectiveOutSize[0]},\n ${effectiveInSize[1] / effectiveOutSize[1]});\n const vec2 inputShapeRC = vec2(${oldHeight}.0, ${oldWidth}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${roundBase})));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class ReverseProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(xShape: number[], axis: number[]) {\n const rank = xShape.length;\n if (rank > 4) {\n throw new Error(\n `WebGL backend: Reverse of rank-${rank} tensor is not yet supported`);\n }\n this.outputShape = xShape;\n\n if (rank === 1) {\n this.userCode = `\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${xShape[0]} - coord - 1));\n }\n `;\n return;\n }\n const getInCoord = (i: number) => {\n if (axis.indexOf(i) !== -1 && xShape[i] !== 1) {\n return `${xShape[i]} - coords[${i}] - 1`;\n }\n return `coords[${i}]`;\n };\n const inCoords = xShape.map((_, i) => getInCoord(i)).join(',');\n const type = getCoordsDataType(rank);\n\n this.userCode = `\n void main() {\n ${type} coords = getOutputCoords();\n setOutput(getX(${inCoords}));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {SegOpInfo} from '../../ops/segment_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class SegmentOpProgram implements GPGPUProgram {\n variableNames = ['x', 'segmentIds'];\n outputShape: number[];\n userCode: string;\n\n constructor(segOpInfo: SegOpInfo, segOpType: 'unsortedSegmentSum') {\n const windowSize = segOpInfo.windowSize;\n const batchSize = segOpInfo.batchSize;\n const inSize = segOpInfo.inSize;\n const numSegments = segOpInfo.numSegments;\n const outSize = numSegments * Math.ceil(inSize / windowSize);\n this.outputShape = [batchSize, outSize];\n\n const initializationValue = '0.0';\n const returnValue = `sumValue`;\n\n const windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4;\n const windowSizeVec4Remainder = windowSize % 4;\n\n const updateSnippet = `\n sumValue += dot(values, filter);\n `;\n\n let checkValueOutOfBounds = '';\n if (inSize % windowSize > 0) {\n checkValueOutOfBounds = `\n if (inIdx < 0 || inIdx >= ${inSize}) {\n return initializationValue;\n }\n `;\n }\n\n let checkSegmentIdOutOfBounds = '';\n if (inSize % windowSize > 0) {\n checkSegmentIdOutOfBounds = `\n if (inIdx < 0 || inIdx >= ${inSize}) {\n return -1.0;\n }\n `;\n }\n\n this.userCode = `\n const float initializationValue = ${initializationValue};\n\n float getValue(int batch, int inIdx) {\n ${checkValueOutOfBounds}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${checkSegmentIdOutOfBounds}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${numSegments})) * float(${windowSize}));\n int currentSeg = int(mod(float(outIdx), float(${numSegments})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${windowSizeNearestVec4}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${updateSnippet}\n }\n\n int inIdx = inOffset + ${windowSizeNearestVec4};\n if (${windowSizeVec4Remainder === 1}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 2}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 3}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${updateSnippet}\n }\n setOutput(${returnValue});\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class SelectProgram implements GPGPUProgram {\n variableNames = ['c', 'a', 'b'];\n outputShape: number[];\n userCode: string;\n\n constructor(cRank: number, shape: number[], rank: number) {\n this.outputShape = shape;\n\n let cCoords;\n let abCoords;\n if (rank > 4) {\n throw Error(`Where for rank ${rank} is not yet supported`);\n }\n\n if (rank === 1) {\n abCoords = `resRC`;\n cCoords = `resRC`;\n } else {\n const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w'];\n const cCoordVars = [];\n const abCoordVars = [];\n for (let i = 0; i < shape.length; i++) {\n abCoordVars.push(`${currentCoords[i]}`);\n if (i < cRank) {\n cCoordVars.push(`${currentCoords[i]}`);\n }\n }\n cCoords = cCoordVars.join();\n abCoords = abCoordVars.join();\n }\n\n const dtype = getCoordsDataType(rank);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n float cVal = getC(${cCoords});\n if (cVal >= 1.0) {\n setOutput(getA(${abCoords}));\n } else {\n setOutput(getB(${abCoords}));\n }\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class SliceProgram implements GPGPUProgram {\n variableNames = ['source'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n // Caching uniform location for speed.\n startLoc: WebGLUniformLocation;\n\n constructor(destSize: number[]) {\n this.outputShape = destSize;\n this.rank = destSize.length;\n\n const dtype = getCoordsDataType(this.rank);\n const sourceCoords = getCoords(this.rank);\n\n this.userCode = `\n uniform ${dtype} start;\n\n void main() {\n ${dtype} sourceLoc = start + getOutputCoords();\n setOutput(getSource(${sourceCoords}));\n }\n `;\n }\n\n getCustomSetupFunc(start: number[]) {\n if (start.length !== this.rank) {\n throw Error(\n `The rank (${this.rank}) of the program must match the ` +\n `length of start (${start.length})`);\n }\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.startLoc == null) {\n this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'start');\n if (this.startLoc == null) {\n // This means the compiler has optimized and realized it doesn't need\n // the uniform.\n return;\n }\n }\n if (this.rank === 1) {\n gpgpu.gl.uniform1i(this.startLoc, start[0]);\n } else if (this.rank === 2) {\n gpgpu.gl.uniform2i(this.startLoc, start[0], start[1]);\n } else if (this.rank === 3) {\n gpgpu.gl.uniform3i(this.startLoc, start[0], start[1], start[2]);\n } else if (this.rank === 4) {\n gpgpu.gl.uniform4i(\n this.startLoc, start[0], start[1], start[2], start[3]);\n } else {\n throw Error(`Slicing for rank ${this.rank} is not yet supported`);\n }\n };\n }\n}\n\nfunction getCoords(rank: number): string {\n if (rank === 1) {\n return 'sourceLoc';\n } else if (rank === 2) {\n return 'sourceLoc.x, sourceLoc.y';\n } else if (rank === 3) {\n return 'sourceLoc.x, sourceLoc.y, sourceLoc.z';\n } else if (rank === 4) {\n return 'sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w';\n } else {\n throw Error(`Slicing for rank ${rank} is not yet supported`);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class StridedSliceProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(begin: number[], strides: number[], shape: number[]) {\n this.outputShape = shape;\n this.rank = shape.length;\n const dtype = getCoordsDataType(this.rank);\n\n let newCoords = '';\n if (this.rank === 1) {\n newCoords = 'coords * strides + begin';\n } else {\n newCoords =\n shape.map((_, i) => `coords[${i}] * strides[${i}] + begin[${i}]`)\n .join(',');\n }\n\n this.userCode = `\n ${dtype} begin = ${dtype}(${begin});\n ${dtype} strides = ${dtype}(${strides});\n\n void main() {\n ${dtype} coords = getOutputCoords();\n setOutput(getX(${newCoords}));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../../environment';\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {PhysicalTextureType, TextureUsage} from './tex_util';\n\nexport class TextureManager {\n private numUsedTextures = 0;\n private numFreeTextures = 0;\n private freeTextures: {[shape: string]: WebGLTexture[]} = {};\n private logEnabled = false;\n private usedTextures: {[shape: string]: WebGLTexture[]} = {};\n\n constructor(private gpgpu: GPGPUContext) {}\n\n acquireTexture(shapeRC: [number, number], usage: TextureUsage): WebGLTexture {\n const physicalTexType = getPhysicalFromLogicalTextureType(usage);\n\n const shapeKey = getKeyFromTextureShape(shapeRC, physicalTexType);\n if (!(shapeKey in this.freeTextures)) {\n this.freeTextures[shapeKey] = [];\n }\n if (!(shapeKey in this.usedTextures)) {\n this.usedTextures[shapeKey] = [];\n }\n\n if (this.freeTextures[shapeKey].length > 0) {\n this.numFreeTextures--;\n this.numUsedTextures++;\n this.log();\n const newTexture = this.freeTextures[shapeKey].shift();\n this.usedTextures[shapeKey].push(newTexture);\n return newTexture;\n }\n this.numUsedTextures++;\n this.log();\n\n let newTexture: WebGLTexture;\n if (physicalTexType === PhysicalTextureType.FLOAT32) {\n newTexture =\n this.gpgpu.createFloat32MatrixTexture(shapeRC[0], shapeRC[1]);\n } else if (physicalTexType === PhysicalTextureType.FLOAT16) {\n newTexture =\n this.gpgpu.createFloat16MatrixTexture(shapeRC[0], shapeRC[1]);\n\n } else if (physicalTexType === PhysicalTextureType.UNSIGNED_BYTE) {\n newTexture =\n this.gpgpu.createUnsignedBytesMatrixTexture(shapeRC[0], shapeRC[1]);\n }\n this.usedTextures[shapeKey].push(newTexture);\n\n return newTexture;\n }\n\n releaseTexture(\n texture: WebGLTexture, shape: [number, number],\n logicalTexType: TextureUsage): void {\n const physicalTexType = getPhysicalFromLogicalTextureType(logicalTexType);\n const shapeKey = getKeyFromTextureShape(shape, physicalTexType);\n if (!(shapeKey in this.freeTextures)) {\n this.freeTextures[shapeKey] = [];\n }\n this.freeTextures[shapeKey].push(texture);\n this.numFreeTextures++;\n this.numUsedTextures--;\n const texList = this.usedTextures[shapeKey];\n const texIndex = texList.indexOf(texture);\n if (texIndex < 0) {\n throw new Error(\n 'Cannot release a texture that was never provided by this ' +\n 'texture manager');\n }\n texList.splice(texIndex, 1);\n this.log();\n }\n\n private log() {\n if (!this.logEnabled) {\n return;\n }\n const total = this.numFreeTextures + this.numUsedTextures;\n console.log(\n 'Free/Used', `${this.numFreeTextures} / ${this.numUsedTextures}`,\n `(${total})`);\n }\n\n getNumUsedTextures(): number {\n return this.numUsedTextures;\n }\n\n getNumFreeTextures(): number {\n return this.numFreeTextures;\n }\n\n dispose() {\n if (this.freeTextures == null) {\n // Already disposed.\n return;\n }\n for (const texShape in this.freeTextures) {\n this.freeTextures[texShape].forEach(tex => {\n this.gpgpu.deleteMatrixTexture(tex);\n });\n }\n for (const texShape in this.usedTextures) {\n this.usedTextures[texShape].forEach(tex => {\n this.gpgpu.deleteMatrixTexture(tex);\n });\n }\n this.freeTextures = null;\n this.usedTextures = null;\n this.numUsedTextures = 0;\n this.numFreeTextures = 0;\n }\n}\n\nfunction getPhysicalFromLogicalTextureType(logicalTexType: TextureUsage):\n PhysicalTextureType {\n if (logicalTexType === TextureUsage.DOWNLOAD ||\n logicalTexType === TextureUsage.PIXELS) {\n return PhysicalTextureType.UNSIGNED_BYTE;\n } else if (logicalTexType === TextureUsage.UPLOAD) {\n return PhysicalTextureType.FLOAT32;\n } else if (logicalTexType === TextureUsage.RENDER) {\n return ENV.get('WEBGL_RENDER_FLOAT32_ENABLED') ?\n PhysicalTextureType.FLOAT32 :\n PhysicalTextureType.FLOAT16;\n }\n throw new Error(`Unknown logical texture type ${logicalTexType}`);\n}\n\nfunction getKeyFromTextureShape(\n shapeRowsCol: [number, number],\n physicalTexType: PhysicalTextureType): string {\n return `${shapeRowsCol[0]}_${shapeRowsCol[1]}_${physicalTexType}`;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class TileProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(aShape: number[], reps: number[]) {\n const outputShape: number[] = new Array(aShape.length);\n for (let i = 0; i < outputShape.length; i++) {\n outputShape[i] = aShape[i] * reps[i];\n }\n this.outputShape = outputShape;\n this.rank = outputShape.length;\n const dtype = getCoordsDataType(this.rank);\n const sourceCoords = getSourceCoords(aShape);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n setOutput(getA(${sourceCoords}));\n }\n `;\n }\n}\n\nfunction getSourceCoords(aShape: number[]): string {\n const rank = aShape.length;\n if (rank > 5) {\n throw Error(`Tile for rank ${rank} is not yet supported`);\n }\n if (rank === 1) {\n return `imod(resRC, ${aShape[0]})`;\n }\n\n const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u'];\n\n const sourceCoords = [];\n for (let i = 0; i < aShape.length; i++) {\n sourceCoords.push(`imod(${currentCoords[i]}, ${aShape[i]})`);\n }\n return sourceCoords.join();\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class TransposeProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(aShape: number[], newDim: number[]) {\n const outputShape: number[] = new Array(aShape.length);\n for (let i = 0; i < outputShape.length; i++) {\n outputShape[i] = aShape[newDim[i]];\n }\n this.outputShape = outputShape;\n this.rank = outputShape.length;\n const dtype = getCoordsDataType(this.rank);\n const switched = getSwitchedCoords(newDim);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n setOutput(getA(${switched}));\n }\n `;\n }\n}\n\nfunction getSwitchedCoords(newDim: number[]): string {\n const rank = newDim.length;\n if (rank > 6) {\n throw Error(`Transpose for rank ${rank} is not yet supported`);\n }\n const originalOrder =\n ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u', 'resRC.v'];\n const switchedCoords = new Array(rank);\n for (let i = 0; i < newDim.length; i++) {\n switchedCoords[newDim[i]] = originalOrder[i];\n }\n return switchedCoords.join();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport const ERF_P = 0.3275911;\nexport const ERF_A1 = 0.254829592;\nexport const ERF_A2 = -0.284496736;\nexport const ERF_A3 = 1.421413741;\nexport const ERF_A4 = -1.453152027;\nexport const ERF_A5 = 1.061405429;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as erf_util from '../../ops/erf_util';\nimport * as selu_util from '../../ops/selu_util';\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {GPGPUContext} from './gpgpu_context';\n\nexport class UnaryOpProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n // Caching uniform location for speed.\n startLoc: WebGLUniformLocation;\n\n constructor(aShape: number[], opSnippet: string) {\n this.outputShape = aShape;\n this.userCode = `\n uniform float NAN;\n float unaryOperation(float x) {\n ${opSnippet}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `;\n }\n\n getCustomSetupFunc() {\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.startLoc == null) {\n this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN');\n if (this.startLoc == null) {\n // This means the compiler has optimized and realized it doesn't need\n // the uniform.\n return;\n }\n }\n gpgpu.gl.uniform1f(this.startLoc, NaN);\n };\n }\n}\n\nconst CHECK_NAN_SNIPPET = `if (isNaN(x)) return x;`;\n\nexport const ABS = `return abs(x);`;\n\nexport const RELU = CHECK_NAN_SNIPPET + `\n return (x < 0.0) ? 0.0 : x;\n`;\n\nexport const ELU = `return (x >= 0.0) ? x : (exp(x) - 1.0);`;\n\nexport const SELU = `\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${selu_util.SELU_SCALEALPHA};\n float scale = ${selu_util.SELU_SCALE};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`;\n\nexport function STEP(alpha = 0.0) {\n return CHECK_NAN_SNIPPET + `\n return x > 0.0 ? 1.0 : float(${alpha});\n `;\n}\n\nexport const NEG = `return -x;`;\n\nexport const CEIL = `return ceil(x);`;\n\nexport const FLOOR = `return floor(x);`;\n\nexport const SIGN = `\n if (isNaN(x)) { return 0.0; }\n return sign(x);\n`;\n\nexport const ROUND = `\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n`;\n\nexport const EXP = `return exp(x);`;\n\nexport const EXPM1 = `return exp(x) - 1.0;`;\n\nexport const LOG = `if (x < 0.0) return NAN;\n return log(x);`;\n\nexport const LOG1P = `return log(1.0 + x);`;\n\nexport const SQRT = `return sqrt(x);`;\n\nexport const RSQRT = `return inversesqrt(x);`;\n\nexport const SIGMOID = `return 1.0 / (1.0 + exp(-1.0 * x));`;\n\n/**\n * mirrors the implementation of tf.nn.softplus: https://goo.gl/vkcvwX\n *\n * epsilon is the difference between 1.0 and the next representable\n * float. For a single precision 32 bit float this should be 2^-23, see:\n * https://math.byu.edu/~schow/work/IEEEFloatingPoint.htm\n *\n * too_large = (x > -threshold) is value above which exp(x) may overflow\n * but softplus(x) == x is within machine epsilon\n *\n * too_small = (x < threshold) is value below which exp(x) may underflow,\n * but softplus(x) == exp(x) is within machine epsilon.\n */\nexport const SOFTPLUS = `\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n`;\n\nexport const SIN = CHECK_NAN_SNIPPET + `\n return sin(x);\n`;\n\nexport const COS = CHECK_NAN_SNIPPET + `\n return cos(x);\n`;\n\nexport const TAN = `return tan(x);`;\n\nexport const ASIN = `return asin(x);`;\n\nexport const ACOS = `return acos(x);`;\n\nexport const ATAN = CHECK_NAN_SNIPPET + `\n return atan(x);\n`;\n\nexport const SINH = `\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n`;\n\nexport const COSH = `\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n`;\n\nexport const TANH = `\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n`;\n\nexport const ASINH = `return log(x + sqrt(x * x + 1.0));`;\n\nexport const ACOSH = CHECK_NAN_SNIPPET + `\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));`;\n\nexport const ATANH = CHECK_NAN_SNIPPET + `\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;`;\n\nexport const ERF = `\n // Error function is calculated approximately with elementary function.\n // See \"Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\n float p = ${erf_util.ERF_P};\n float a1 = ${erf_util.ERF_A1};\n float a2 = ${erf_util.ERF_A2};\n float a3 = ${erf_util.ERF_A3};\n float a4 = ${erf_util.ERF_A4};\n float a5 = ${erf_util.ERF_A5};\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n`;\n\nexport const SQUARE = `return x * x;`;\n\nexport const RECIPROCAL = `return 1.0 / x;`;\n\nexport const LOGICAL_NOT = `return float(!(x >= 1.0));`;\n\nexport const TO_INT = `return float(int(x));`;\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensorArray} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assert, sizeFromShape} from '../util';\nimport {parseAxisParam} from './axis_util';\nimport * as concat_util from './concat_util';\nimport {op} from './operation';\n\n/**\n * Concatenates a list of `Tensor1D`s along an axis. See `concat` for details.\n *\n * For example, if:\n * A: shape(3) = |r1, g1, b1|\n * B: shape(2) = |r2, g2|\n * C = tf.concat1d([A, B]) == |r1, g1, b1, r2, g2|\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @return The concatenated array.\n */\nfunction concat1d_(tensors: Tensor1D[]|TensorLike[]): Tensor1D {\n return concat(tensors, 0 /* axis */);\n}\n\n/**\n * Concatenates a list of `Tensor2D`s along an axis. See `concat` for details.\n *\n * For example, if:\n * A: shape(2, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n *\n * B: shape(2, 3) = | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * C = tf.concat2d([A, B], axis)\n *\n * if axis = 0:\n * C: shape(4, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n * | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * if axis = 1:\n * C = shape(2, 6) = | r1, g1, b1, r3, g3, b3 |\n * | r2, g2, b2, r4, g4, b4 |\n *\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @param axis The axis to concatenate along.\n * @return The concatenated array.\n */\nfunction concat2d_(tensors: Tensor2D[]|TensorLike[], axis: number): Tensor2D {\n return concat(tensors, axis);\n}\n\n/**\n * Concatenates a list of `Tensor3D`s along an axis. See `concat` for details.\n *\n * For example, if:\n * A: shape(2, 1, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n *\n * B: shape(2, 1, 3) = | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * C = tf.concat3d([A, B], axis)\n *\n * if axis = 0:\n * C: shape(4, 1, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n * | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * if axis = 1:\n * C: shape(2, 2, 3) = | r1, g1, b1, r3, g3, b3 |\n * | r2, g2, b2, r4, g4, b4 |\n *\n * if axis = 2:\n * C = shape(2, 1, 6) = | r1, g1, b1, r3, g3, b3 |\n * | r2, g2, b2, r4, g4, b4 |\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @param axis The axis to concate along.\n * @return The concatenated array.\n */\nfunction concat3d_(tensors: Tensor3D[]|TensorLike[], axis: number): Tensor3D {\n return concat(tensors, axis);\n}\n\n/**\n * Concatenates a list of `Tensor4D`s along an axis. See `concat` for details.\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @param axis The axis to concate along.\n * @return The concatenated array.\n */\nfunction concat4d_(tensors: Tensor4D[]|TensorLike[], axis: number): Tensor4D {\n return concat(tensors, axis);\n}\n\n/**\n * Concatenates a list of `Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction concat_(tensors: T[]|TensorLike[], axis = 0): T {\n assert(tensors.length >= 1, 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat');\n\n let result = $tensors[0] as T;\n if ($tensors.length === 1) {\n return result;\n }\n const axes = parseAxisParam(axis, result.shape);\n\n for (let i = 1; i < $tensors.length; ++i) {\n result = concat2Tensors(result, $tensors[i], axes[0]) as T;\n }\n return result;\n}\n\nfunction concat2Tensors(a: T, b: T, axis: number): T {\n concat_util.assertParams(a.shape, b.shape, axis);\n const outShape = concat_util.computeOutShape(a.shape, b.shape, axis);\n\n // Do the reshape.\n const a2D = a.as2D(-1, sizeFromShape(a.shape.slice(axis)));\n const b2D = b.as2D(-1, sizeFromShape(b.shape.slice(axis)));\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n const {aBegin, aSize, bBegin, bSize} =\n concat_util.computeGradientSliceShapes(a2D.shape, b2D.shape);\n const der = (dy: Tensor2D) => {\n return {a: () => dy.slice(aBegin, aSize), b: () => dy.slice(bBegin, bSize)};\n };\n const res = ENV.engine.runKernel(\n backend => backend.concat(a2D, b2D), {a: a2D, b: b2D}, der);\n return res.reshape(outShape) as T;\n}\n\nexport const concat = op({concat_});\nexport const concat1d = op({concat1d_});\nexport const concat2d = op({concat2d_});\nexport const concat3d = op({concat3d_});\nexport const concat4d = op({concat4d_});\n","// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as seedrandom from 'seedrandom';\n\nexport interface RandGauss {\n nextValue(): number;\n}\n\nexport interface RandNormalDataTypes {\n float32: Float32Array;\n int32: Int32Array;\n}\n\n// https://en.wikipedia.org/wiki/Marsaglia_polar_method\nexport class MPRandGauss implements RandGauss {\n private mean: number;\n private stdDev: number;\n private nextVal: number;\n private dtype?: keyof RandNormalDataTypes;\n private truncated?: boolean;\n private upper?: number;\n private lower?: number;\n private random: seedrandom.prng;\n\n constructor(\n mean: number, stdDeviation: number, dtype?: keyof RandNormalDataTypes,\n truncated?: boolean, seed?: number) {\n this.mean = mean;\n this.stdDev = stdDeviation;\n this.dtype = dtype;\n this.nextVal = NaN;\n this.truncated = truncated;\n if (this.truncated) {\n this.upper = this.mean + this.stdDev * 2;\n this.lower = this.mean - this.stdDev * 2;\n }\n const seedValue = seed ? seed : Math.random();\n this.random = seedrandom.alea(seedValue.toString());\n }\n\n /** Returns next sample from a gaussian distribution. */\n public nextValue(): number {\n if (!isNaN(this.nextVal)) {\n const value = this.nextVal;\n this.nextVal = NaN;\n return value;\n }\n\n let resultX: number, resultY: number;\n let isValid = false;\n while (!isValid) {\n let v1: number, v2: number, s: number;\n do {\n v1 = 2 * this.random() - 1;\n v2 = 2 * this.random() - 1;\n s = v1 * v1 + v2 * v2;\n } while (s >= 1 || s === 0);\n\n const mul = Math.sqrt(-2.0 * Math.log(s) / s);\n resultX = this.mean + this.stdDev * v1 * mul;\n resultY = this.mean + this.stdDev * v2 * mul;\n\n if (!this.truncated || this.isValidTruncated(resultX)) {\n isValid = true;\n }\n }\n\n if (!this.truncated || this.isValidTruncated(resultY)) {\n this.nextVal = this.convertValue(resultY);\n }\n return this.convertValue(resultX);\n }\n\n /** Handles proper rounding for non floating point numbers. */\n private convertValue(value: number): number {\n if (this.dtype == null || this.dtype === 'float32') {\n return value;\n }\n return Math.round(value);\n }\n\n /** Returns true if less than 2-standard-deviations from the mean. */\n private isValidTruncated(value: number): boolean {\n return value <= this.upper && value >= this.lower;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorBuffer} from '../tensor';\nimport {convertToTensor, convertToTensorArray} from '../tensor_util_env';\nimport {DataType, Rank, ShapeMap, TensorLike, TensorLike1D, TypedArray} from '../types';\nimport * as util from '../util';\nimport {getAxesPermutation, getInnerMostAxes, parseAxisParam} from './axis_util';\nimport {concat} from './concat';\nimport {op} from './operation';\nimport {MPRandGauss} from './rand';\nimport {zerosLike} from './tensor_ops';\n\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction clone_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'clone');\n const der = (dy: T) => {\n return {$x: () => dy.toFloat()};\n };\n\n return ENV.engine.runKernel(\n backend =>\n Tensor.make($x.shape, {dataId: $x.dataId}, $x.dtype) as T,\n {$x}, der) as T;\n}\n\n/**\n * Create an identity matrix.\n *\n * @param numRows Number of rows.\n * @param numColumns Number of columns. Defaults to `numRows`.\n * @param batchShape If provided, will add the batch shape to the beginning\n * of the shape of the returned `Tensor` by repeating the identity\n * matrix.\n * @param dtype Data type.\n * @returns Identity matrix of the specified size and data type, possibly\n * with batch repetition if `batchShape` is specified.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction eye_(\n numRows: number, numColumns?: number,\n batchShape?:\n [\n number\n ]|[number,\n number]|[number, number, number]|[number, number, number, number],\n dtype: DataType = 'float32'): Tensor2D {\n if (numColumns == null) {\n numColumns = numRows;\n }\n const buff = buffer([numRows, numColumns], dtype);\n const n = numRows <= numColumns ? numRows : numColumns;\n for (let i = 0; i < n; ++i) {\n buff.set(1, i, i);\n }\n const out = buff.toTensor().as2D(numRows, numColumns);\n if (batchShape == null) {\n return out;\n } else {\n if (batchShape.length === 1) {\n return tile(expandDims(out, 0), [batchShape[0], 1, 1]);\n } else if (batchShape.length === 2) {\n return tile(\n expandDims(expandDims(out, 0), 0),\n [batchShape[0], batchShape[1], 1, 1]);\n } else if (batchShape.length === 3) {\n return tile(\n expandDims(expandDims(expandDims(out, 0), 0), 0),\n [batchShape[0], batchShape[1], batchShape[2], 1, 1]);\n } else {\n throw new Error(\n `eye() currently supports only 1D and 2D ` +\n // tslint:disable-next-line:no-any\n `batchShapes, but received ${(batchShape as any).length}D.`);\n }\n }\n}\n\n/**\n * Creates a `Tensor` with values sampled from a normal distribution.\n *\n * ```js\n * tf.randomNormal([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param mean The mean of the normal distribution.\n * @param stdDev The standard deviation of the normal distribution.\n * @param dtype The data type of the output.\n * @param seed The seed for the random number generator.\n */\n/** @doc {heading: 'Tensors', subheading: 'Random'} */\nfunction randomNormal_(\n shape: ShapeMap[R], mean = 0, stdDev = 1, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n if (dtype != null && (dtype as DataType) === 'bool') {\n throw new Error(`Unsupported data type ${dtype}`);\n }\n const randGauss =\n new MPRandGauss(mean, stdDev, dtype, false /* truncated */, seed);\n const res = buffer(shape, dtype);\n for (let i = 0; i < res.values.length; i++) {\n res.values[i] = randGauss.nextValue();\n }\n return res.toTensor();\n}\n\n/**\n * Creates a `Tensor` with values sampled from a truncated normal\n * distribution.\n *\n * ```js\n * tf.truncatedNormal([2, 2]).print();\n * ```\n *\n * The generated values follow a normal distribution with specified mean and\n * standard deviation, except that values whose magnitude is more than 2\n * standard deviations from the mean are dropped and re-picked.\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param mean The mean of the normal distribution.\n * @param stdDev The standard deviation of the normal distribution.\n * @param dtype The data type of the output tensor.\n * @param seed The seed for the random number generator.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction truncatedNormal_(\n shape: ShapeMap[R], mean = 0, stdDev = 1, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n if (dtype != null && (dtype as DataType) === 'bool') {\n throw new Error(`Unsupported data type ${dtype}`);\n }\n const randGauss =\n new MPRandGauss(mean, stdDev, dtype, true /* truncated */, seed);\n const res = buffer(shape, dtype);\n for (let i = 0; i < res.values.length; i++) {\n res.values[i] = randGauss.nextValue();\n }\n return res.toTensor();\n}\n\n/**\n * Creates a `Tensor` with values sampled from a uniform distribution.\n *\n * The generated values follow a uniform distribution in the range [minval,\n * maxval). The lower bound minval is included in the range, while the upper\n * bound maxval is excluded.\n *\n * ```js\n * tf.randomUniform([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param minval The lower bound on the range of random values to generate.\n * Defaults to 0.\n * @param maxval The upper bound on the range of random values to generate.\n * Defaults to 1.\n * @param dtype The data type of the output tensor. Defaults to 'float32'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Random'} */\nfunction randomUniform_(\n shape: ShapeMap[R], minval = 0, maxval = 1,\n dtype: DataType = 'float32'): Tensor {\n const res = buffer(shape, dtype);\n for (let i = 0; i < res.values.length; i++) {\n res.values[i] = util.randUniform(minval, maxval);\n }\n return res.toTensor();\n}\n\n/**\n * Creates a `Tensor` with values sampled from a random number generator\n * function defined by the user.\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param randFunction A random number generator function which is called\n * for each element in the output tensor.\n * @param dtype The data type of the output tensor. Defaults to 'float32'.\n */\nfunction rand_(\n shape: ShapeMap[R], randFunction: () => number,\n dtype?: DataType): Tensor {\n const size = util.sizeFromShape(shape);\n\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n\n for (let i = 0; i < size; i++) {\n values[i] = randFunction();\n }\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` with values drawn from a multinomial distribution.\n *\n * ```js\n * const probs = tf.tensor([.75, .25]);\n * tf.multinomial(probs, 3).print();\n * ```\n *\n * @param logits 1D array with unnormalized log-probabilities, or\n * 2D array of shape `[batchSize, numOutcomes]`. See the `normalized`\n * parameter.\n * @param numSamples Number of samples to draw for each row slice.\n * @param seed The seed number.\n * @param normalized Whether the provided `logits` are normalized true\n * probabilities (sum to 1). Defaults to false.\n * @return 1D array of shape `[numSamples]`, or 2D array of shape\n * `[batchSize, numSamples]`, depending on the rank of the input.\n */\n/** @doc {heading: 'Tensors', subheading: 'Random'} */\nfunction multinomial_(\n logits: Tensor1D|Tensor2D|TensorLike, numSamples: number, seed?: number,\n normalized = false): Tensor1D|Tensor2D {\n const $logits = convertToTensor(logits, 'logits', 'multinomial');\n const numOutcomes = $logits.size;\n const origRank = $logits.rank;\n if (numOutcomes < 2) {\n throw new Error(\n `Error in multinomial: you need at least 2 outcomes, but got ` +\n `${numOutcomes}.`);\n }\n if (origRank > 2) {\n throw new Error(`Rank of probabilities must be 1 or 2, but is ${origRank}`);\n }\n seed = seed || Math.random();\n const logits2D = origRank === 1 ? $logits.as2D(1, -1) : $logits as Tensor2D;\n const res = ENV.engine.runKernel(\n backend => backend.multinomial(logits2D, normalized, numSamples, seed),\n {logits2D});\n\n return origRank === 1 ? res.as1D() : res;\n}\n\n/**\n * Creates a one-hot `Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0).\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `Tensor1D` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction oneHot_(\n indices: Tensor1D|TensorLike1D, depth: number, onValue = 1,\n offValue = 0): Tensor2D {\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n util.assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`');\n\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n return ENV.engine.runKernel(\n backend => backend.oneHot($indices, depth, onValue, offValue),\n {$indices});\n}\n\n/**\n * Creates a `Tensor` from an image.\n *\n * ```js\n * const image = new ImageData(1, 1);\n * image.data[0] = 100;\n * image.data[1] = 150;\n * image.data[2] = 200;\n * image.data[3] = 255;\n *\n * tf.fromPixels(image).print();\n * ```\n *\n * @param pixels The input image to construct the tensor from. The\n * supported image types are all 4-channel.\n * @param numChannels The number of channels of the output tensor. A\n * numChannels value less than 4 allows you to ignore channels. Defaults to\n * 3 (ignores alpha channel of input image).\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction fromPixels_(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels = 3): Tensor3D {\n if (numChannels > 4) {\n throw new Error(\n 'Cannot construct Tensor with more than 4 channels from pixels.');\n }\n return ENV.engine.fromPixels(pixels, numChannels);\n}\n\n/**\n * Draws a `Tensor` of pixel values to a byte array or optionally a\n * canvas.\n *\n * When the dtype of the input is 'float32', we assume values in the range\n * [0-1]. Otherwise, when input is 'int32', we assume values in the range\n * [0-255].\n *\n * Returns a promise that resolves when the canvas has been drawn to.\n *\n * @param img A rank-2 or rank-3 tensor. If rank-2, draws grayscale. If\n * rank-3, must have depth of 1, 3 or 4. When depth of 1, draws\n * grayscale. When depth of 3, we draw with the first three components of\n * the depth dimension corresponding to r, g, b and alpha = 1. When depth of\n * 4, all four components of the depth dimension correspond to r, g, b, a.\n * @param canvas The canvas to draw to.\n */\n/** @doc {heading: 'Visualization'} */\nasync function toPixels(\n img: Tensor2D|Tensor3D|TensorLike,\n canvas?: HTMLCanvasElement): Promise {\n const $img = convertToTensor(img, 'img', 'toPixels', 'int32');\n if ($img.rank !== 2 && $img.rank !== 3) {\n throw new Error(\n `toPixels only supports rank 2 or 3 tensors, got rank ${$img.rank}.`);\n }\n const [height, width] = $img.shape.slice(0, 2);\n const depth = $img.rank === 2 ? 1 : $img.shape[2];\n\n if (depth > 4 || depth === 2) {\n throw new Error(\n `toPixels only supports depth of size ` +\n `1, 3 or 4 but got ${depth}`);\n }\n\n const minTensor = $img.min();\n const maxTensor = $img.max();\n const min = (await minTensor.data())[0];\n const max = (await maxTensor.data())[0];\n minTensor.dispose();\n maxTensor.dispose();\n if ($img.dtype === 'float32') {\n if (min < 0 || max > 1) {\n throw new Error(\n `Tensor values for a float32 Tensor must be in the ` +\n `range [0 - 1] but got range [${min} - ${max}].`);\n }\n } else if ($img.dtype === 'int32') {\n if (min < 0 || max > 255) {\n throw new Error(\n `Tensor values for a int32 Tensor must be in the ` +\n `range [0 - 255] but got range [${min} - ${max}].`);\n }\n } else {\n throw new Error(\n `Unsupported type for toPixels: ${$img.dtype}.` +\n ` Please use float32 or int32 tensors.`);\n }\n\n const data = await $img.data();\n const multiplier = $img.dtype === 'float32' ? 255 : 1;\n const bytes = new Uint8ClampedArray(width * height * 4);\n\n for (let i = 0; i < height * width; ++i) {\n let r, g, b, a;\n if (depth === 1) {\n r = data[i] * multiplier;\n g = data[i] * multiplier;\n b = data[i] * multiplier;\n a = 255;\n } else if (depth === 3) {\n r = data[i * 3] * multiplier;\n g = data[i * 3 + 1] * multiplier;\n b = data[i * 3 + 2] * multiplier;\n a = 255;\n } else if (depth === 4) {\n r = data[i * 4] * multiplier;\n g = data[i * 4 + 1] * multiplier;\n b = data[i * 4 + 2] * multiplier;\n a = data[i * 4 + 3] * multiplier;\n }\n\n const j = i * 4;\n bytes[j + 0] = Math.round(r);\n bytes[j + 1] = Math.round(g);\n bytes[j + 2] = Math.round(b);\n bytes[j + 3] = Math.round(a);\n }\n\n if (canvas != null) {\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d');\n const imageData = new ImageData(bytes, width, height);\n ctx.putImageData(imageData, 0, 0);\n }\n if ($img !== img) {\n $img.dispose();\n }\n return bytes;\n}\n\n/**\n * Reshapes a `Tensor` to a given shape.\n *\n * Given a input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction reshape_(\n x: Tensor|TensorLike, shape: ShapeMap[R2]): Tensor {\n const $x = convertToTensor(x, 'x', 'reshape');\n shape = util.inferFromImplicitShape(shape, $x.size);\n util.assert(\n $x.size === util.sizeFromShape(shape),\n 'new shape and old shape must have the same number of elements.');\n\n const grad = (dy: Tensor) => {\n return {$x: () => dy.reshape($x.shape)};\n };\n return ENV.engine.runKernel(\n backend => backend.reshape($x, shape), {$x}, grad);\n}\n\n/**\n * Removes dimensions of size 1 from the shape of a `Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction squeeze_(x: Tensor|TensorLike, axis?: number[]): T {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, util.squeezeShape($x.shape, axis).newShape) as T;\n}\n\n/**\n * Casts a `Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction cast_(x: T|TensorLike, dtype: DataType): T {\n const $x = convertToTensor(x, 'x', 'cast');\n\n const grad = (dy: T) => {\n return {$x: () => dy.clone()};\n };\n return ENV.engine.runKernel(backend => backend.cast($x, dtype), {$x}, grad) as\n T;\n}\n\n/**\n * Construct an tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction tile_(x: T|TensorLike, reps: number[]): T {\n const $x = convertToTensor(x, 'x', 'tile');\n\n util.assert(\n $x.rank === reps.length,\n `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const grad = (dy: T) => {\n const derX = () => {\n let xGrad = zerosLike($x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if ($x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = xGrad.add(dy.slice([i * $x.shape[0]], [$x.shape[0]]));\n }\n } else if ($x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = xGrad.add(dy.slice(\n [i * $x.shape[0], j * $x.shape[1]],\n [$x.shape[0], $x.shape[1]]));\n }\n }\n } else if ($x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad = xGrad.add(dy.slice(\n [i * $x.shape[0], j * $x.shape[1], k * $x.shape[2]],\n [$x.shape[0], $x.shape[1], $x.shape[2]]));\n }\n }\n }\n } else if ($x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad = xGrad.add(dy.slice(\n [\n i * $x.shape[0], j * $x.shape[1], k * $x.shape[2],\n l * $x.shape[3]\n ],\n [$x.shape[0], $x.shape[1], $x.shape[2], $x.shape[3]]));\n }\n }\n }\n }\n } else {\n throw new Error(\n `Gradient for tile operation is not implemented for rank-` +\n `${$x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return {$x: derX};\n };\n return ENV.engine.runKernel(backend => backend.tile($x, reps), {$x}, grad);\n}\n\n/**\n * Pads a `Tensor1D` with a given value and paddings. See `pad` for details.\n */\nfunction pad1d_(\n x: Tensor1D|TensorLike, paddings: [number, number],\n constantValue = 0): Tensor1D {\n util.assert(\n paddings.length === 2,\n 'Invalid number of paddings. Must be length of 2.');\n return pad(x, [paddings], constantValue);\n}\n\n/**\n * Pads a `Tensor2D` with a given value and paddings. See `pad` for details.\n */\nfunction pad2d_(\n x: Tensor2D|TensorLike, paddings: [[number, number], [number, number]],\n constantValue = 0): Tensor2D {\n util.assert(\n paddings.length === 2 && paddings[0].length === 2 &&\n paddings[1].length === 2,\n 'Invalid number of paddings. Must be length of 2 each.');\n return pad(x, paddings, constantValue);\n}\n\n/**\n * Pads a `Tensor3D` with a given value and paddings. See `pad` for details.\n */\nfunction pad3d_(\n x: Tensor3D|TensorLike,\n paddings: [[number, number], [number, number], [number, number]],\n constantValue = 0): Tensor3D {\n util.assert(\n paddings.length === 3 && paddings[0].length === 2 &&\n paddings[1].length === 2 && paddings[2].length === 2,\n 'Invalid number of paddings. Must be length of 2 each.');\n return pad(x, paddings, constantValue);\n}\n\n/**\n * Pads a `Tensor4D` with a given value and paddings. See `pad` for details.\n */\nfunction pad4d_(\n x: Tensor4D|TensorLike,\n paddings:\n [\n [number, number], [number, number], [number, number],\n [number, number]\n ],\n constantValue = 0): Tensor4D {\n util.assert(\n paddings.length === 4 && paddings[0].length === 2 &&\n paddings[1].length === 2 && paddings[2].length === 2 &&\n paddings[3].length === 2,\n 'Invalid number of paddings. Must be length of 2 each.');\n return pad(x, paddings, constantValue);\n}\n\n/**\n * Pads a `Tensor` with a given value and paddings.\n *\n * This operation currently only implements the `CONSTANT` mode.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction pad_(\n x: T|TensorLike, paddings: Array<[number, number]>, constantValue = 0): T {\n const $x = convertToTensor(x, 'x', 'pad');\n\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const begin = paddings.map(p => p[0]);\n const grad = (dy: T) => {\n return {$x: () => dy.slice(begin, $x.shape)};\n };\n return ENV.engine.runKernel(\n backend => backend.pad($x, paddings, constantValue), {$x}, grad) as\n T;\n}\n\n/**\n * Stacks a list of rank-`R` `Tensor`s into one rank-`(R+1)` `Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction stack_(tensors: T[]|TensorLike[], axis = 0): Tensor {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack');\n\n util.assert($tensors.length >= 1, 'Pass at least one tensor to tf.stack');\n if ($tensors.length === 1) {\n return $tensors[0].expandDims(axis);\n }\n const rank = $tensors[0].rank;\n const shape = $tensors[0].shape;\n const dtype = $tensors[0].dtype;\n\n util.assert(axis <= rank, 'Axis must be <= rank of the tensor');\n\n $tensors.forEach(t => {\n util.assertShapesMatch(\n shape, t.shape,\n 'All tensors passed to stack must have matching shapes');\n });\n\n $tensors.forEach(t => {\n util.assert(\n dtype === t.dtype,\n 'All tensors passed to stack must have matching dtypes');\n });\n const expandedTensors = $tensors.map(t => t.expandDims(axis));\n return concat(expandedTensors, axis);\n}\n\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M]`, all values must be >= 1.\n * @param crops A 2-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M, 2]`, all values must be >= 0. `crops[i] =\n * [cropStart, cropEnd]` specifies the amount to crop from input dimension `i\n * + 1`, which corresponds to spatial dimension `i`. It is required that\n * `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction batchToSpaceND_(\n x: T|TensorLike, blockShape: number[], crops: number[][]): T {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n\n util.assert(\n $x.rank >= 1 + blockShape.length,\n `input rank should be > than [blockShape] but got ${$x.rank}`);\n\n util.assert(\n crops.length === blockShape.length,\n `crops.shape[0] must be equal to [blockShape] but got ${crops.length}`);\n\n util.assert(\n $x.shape[0] % prod === 0,\n `input tensor batch must be divisible by prod( blockShape )`);\n return ENV.engine.runKernel(\n backend => backend.batchToSpaceND($x, blockShape, crops), {});\n}\n\n/**\n * This operation divides \"spatial\" dimensions [1, ..., M] of the input into\n * a grid of blocks of shape block_shape, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions [1, ..., M] correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to paddings. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M]`, all values must be >= 1.\n * @param paddings A 2-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M, 2]`, all values must be >= 0. `paddings[i] =\n * [padStart, padEnd]` specifies the amount to zero-pad from input dimension\n * `i + 1`, which corresponds to spatial dimension `i`.\n * It is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions [1, ..., M] of the input\n * according to paddings to produce padded of shape padded_shape.\n *\n * 2. Reshape padded to reshaped_padded of shape:\n * [batch] + [padded_shape[1] / block_shape[0], block_shape[0], ...,\n * padded_shape[M] / block_shape[M-1], block_shape[M-1]] + remaining_shape\n *\n * 3. Permute dimensions of reshaped_padded to produce permuted_\n * reshaped_padded of shape:\n * block_shape + [batch] + [padded_shape[1] / block_shape[0], ...,\n * padded_shape[M] / block_shape[M-1]] + remaining_shape\n *\n * 4. Reshape permuted_reshaped_padded to flatten block_shape into the\n * batch dimension, producing an output tensor of shape:\n * [batch * prod(block_shape)] + [padded_shape[1] / block_shape[0], ...,\n * padded_shape[M] / block_shape[M-1]] + remaining_shape\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction spaceToBatchND_(\n x: T|TensorLike, blockShape: number[], paddings: number[][]): T {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n\n util.assert(\n $x.rank >= 1 + blockShape.length,\n `input rank should be > than [blockShape] but got ${$x.rank}`);\n\n util.assert(\n paddings.length === blockShape.length,\n `paddings.shape[0] must be equal to [blockShape], got ${\n paddings.length}`);\n\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a && (b % blockShape[i - 1] === 0);\n }\n return a;\n }, true), `input spatial dimensions must be divisible by blockShapes`);\n return ENV.engine.runKernel(\n backend => backend.spaceToBatchND($x, blockShape, paddings), {});\n}\n\n/**\n * Unstacks a `Tensor` of rank-`R` into a list of rank-`(R-1)` `Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction unstack_(x: T|TensorLike, axis = 0): Tensor[] {\n const $x = convertToTensor(x, 'x', 'unstack');\n const num = $x.shape[axis];\n const outputShape: number[] = Array($x.rank - 1).fill(0);\n let outIndex = 0;\n for (let i = 0; i < $x.rank; i++) {\n if (i !== axis) {\n outputShape[outIndex] = $x.shape[i];\n outIndex++;\n }\n }\n\n let splitSizes: number[];\n splitSizes = Array(num).fill(1);\n const begin = Array($x.rank).fill(0);\n const size = $x.shape.slice();\n return splitSizes.map(s => {\n size[axis] = s;\n const slice = $x.slice(begin, size);\n begin[axis] += s;\n return slice.reshape(outputShape);\n });\n}\n\n/**\n * Splits a `Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `(numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction split_(\n x: T|TensorLike, numOrSizeSplits: number[]|number, axis = 0): T[] {\n const $x = convertToTensor(x, 'x', 'split');\n\n axis = parseAxisParam(axis, $x.shape)[0];\n let splitSizes: number[];\n if (typeof (numOrSizeSplits) === 'number') {\n util.assert(\n $x.shape[axis] % numOrSizeSplits === 0,\n 'Number of splits must evenly divide the axis.');\n splitSizes = Array(numOrSizeSplits).fill($x.shape[axis] / numOrSizeSplits);\n } else {\n util.assert(\n $x.shape[axis] === numOrSizeSplits.reduce((a, b) => a + b),\n 'The sum of sizes must match the size of the axis dimension.');\n splitSizes = numOrSizeSplits;\n }\n const begin = Array($x.rank).fill(0);\n const size = $x.shape.slice();\n return splitSizes.map(s => {\n size[axis] = s;\n const slice = $x.slice(begin, size);\n begin[axis] += s;\n return slice;\n });\n}\n\n/**\n * Computes the cumulative sum of a `Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n */\n/** @doc {heading: 'Operations', subheading: 'Scan'} */\nfunction cumsum_(\n x: Tensor|TensorLike, axis = 0, exclusive = false, reverse = false): T {\n const $x = convertToTensor(x, 'x', 'cumsum');\n\n axis = axis | 0;\n const permutation = getAxesPermutation([axis], $x.rank);\n let permutedX = $x;\n if (permutation != null) {\n permutedX = $x.transpose(permutation);\n }\n const permutedAxis = getInnerMostAxes(1, $x.rank)[0];\n\n const grad = (dy: T) => {\n return {permutedX: () => dy.cumsum(axis, exclusive, !reverse)};\n };\n let value = ENV.engine.runKernel(\n backend => backend.cumsum(\n permutedX, permutedAxis, exclusive, reverse),\n {permutedX}, grad) as T;\n\n if (permutation != null) {\n value = value.transpose(permutation);\n }\n return value;\n}\n\n/**\n * Returns a `Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction expandDims_(\n x: Tensor|TensorLike, axis = 0): Tensor {\n const $x = convertToTensor(x, 'x', 'expandDims');\n\n util.assert(axis <= $x.rank, 'Axis must be <= rank of the tensor');\n const newShape = $x.shape.slice();\n if (axis < 0) {\n // Negative value is counted from the tail of rank.\n util.assert(\n -($x.rank + 1) <= axis,\n `Axis must be in the interval [${- ($x.rank + 1)}, ${$x.rank}]`);\n axis = $x.rank + axis + 1;\n }\n newShape.splice(axis, 0, 1);\n return reshape($x, newShape);\n}\n\n/**\n * Creates an empty `TensorBuffer` with the specified `shape` and `dtype`.\n *\n * The values are stored in cpu as `TypedArray`. Fill the buffer using\n * `buffer.set()`, or by modifying directly `buffer.values`.\n *\n * When done, call `buffer.toTensor()` to get an immutable `Tensor` with\n * those values.\n *\n * ```js\n * // Create a buffer and set values at particular indices.\n * const buffer = tf.buffer([2, 2]);\n * buffer.set(3, 0, 0);\n * buffer.set(5, 1, 0);\n *\n * // Convert the buffer back to a tensor.\n * buffer.toTensor().print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The dtype of the buffer. Defaults to 'float32'.\n * @param values The values of the buffer as `TypedArray`. Defaults to\n * zeros.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction buffer(\n shape: ShapeMap[R], dtype: DataType = 'float32',\n values?: TypedArray): TensorBuffer {\n return new TensorBuffer(shape, dtype, values);\n}\n\n/**\n * Prints information about the `Tensor` including its data.\n *\n * ```js\n * const verbose = true;\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print(verbose);\n * ```\n * @param x The tensor to be printed.\n * @param verbose Whether to print verbose information about the ` Tensor`,\n * including dtype and size.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction print(x: T, verbose = false): void {\n console.log(x.toString(verbose));\n}\n\nexport {\n buffer, // Not wrapped in op() since no tensors.\n toPixels, // Not wrapped in op() since async.\n print // Not wrapped in op() since no need to increase stack trace.\n};\n\nexport const cast = op({cast_});\nexport const clone = op({clone_});\nexport const cumsum = op({cumsum_});\nexport const expandDims = op({expandDims_});\nexport const eye = op({eye_});\nexport const fromPixels = op({fromPixels_});\nexport const multinomial = op({multinomial_});\nexport const oneHot = op({oneHot_});\nexport const pad = op({pad_});\nexport const pad1d = op({pad1d_});\nexport const pad2d = op({pad2d_});\nexport const pad3d = op({pad3d_});\nexport const pad4d = op({pad4d_});\nexport const rand = op({rand_});\nexport const randomNormal = op({randomNormal_});\nexport const randomUniform = op({randomUniform_});\nexport const reshape = op({reshape_});\nexport const split = op({split_});\nexport const squeeze = op({squeeze_});\nexport const stack = op({stack_});\nexport const tile = op({tile_});\nexport const truncatedNormal = op({truncatedNormal_});\nexport const unstack = op({unstack_});\nexport const batchToSpaceND = op({batchToSpaceND_});\nexport const spaceToBatchND = op({spaceToBatchND_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** An implementation of the Where kernel shared between cpu and webgl */\n\nimport {buffer} from '../ops/array_ops';\nimport {Tensor2D} from '../tensor';\nimport {TypedArray} from '../types';\n\nexport function whereImpl(condShape: number[], condVals: TypedArray): Tensor2D {\n const indices = [];\n for (let i = 0; i < condVals.length; i++) {\n if (condVals[i]) {\n indices.push(i);\n }\n }\n\n const inBuffer = buffer(condShape, 'int32');\n\n const out = buffer([indices.length, condShape.length], 'int32');\n for (let i = 0; i < indices.length; i++) {\n const loc = inBuffer.indexToLoc(indices[i]);\n const offset = i * condShape.length;\n out.values.set(loc, offset);\n }\n return out.toTensor() as Tensor2D;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {MemoryInfo, TimingInfo} from '../engine';\nimport {ENV} from '../environment';\nimport {warn} from '../log';\nimport * as array_ops_util from '../ops/array_ops_util';\nimport * as axis_util from '../ops/axis_util';\nimport {Conv2DInfo} from '../ops/conv_util';\nimport * as reduce_util from '../ops/reduce_util';\nimport * as segment_util from '../ops/segment_util';\nimport {getStridedSlicedInfo} from '../ops/slice_util';\nimport {softmax} from '../ops/softmax';\nimport {range, tensor} from '../ops/tensor_ops';\nimport {DataId, setTensorTracker, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {DataType, DataTypeMap, Rank, RecursiveArray, ShapeMap, sumOutType, TypedArray, upcastType} from '../types';\nimport * as util from '../util';\n\nimport {KernelBackend} from './backend';\nimport * as backend_util from './backend_util';\nimport {nonMaxSuppressionImpl} from './non_max_suppression_impl';\nimport {topkImpl} from './topk_impl';\nimport {ArgMinMaxProgram} from './webgl/argminmax_gpu';\nimport {AvgPool2DBackpropProgram} from './webgl/avg_pool_backprop_gpu';\nimport {BatchNormProgram} from './webgl/batchnorm_gpu';\nimport * as binaryop_gpu from './webgl/binaryop_gpu';\nimport {BinaryOpProgram} from './webgl/binaryop_gpu';\nimport {ClipProgram} from './webgl/clip_gpu';\nimport {ConcatProgram} from './webgl/concat_gpu';\nimport {Conv2DDerFilterProgram, Conv2DDerInputProgram} from './webgl/conv_backprop_gpu';\nimport {DepthwiseConv2DDerFilterProgram, DepthwiseConv2DDerInputProgram} from './webgl/conv_backprop_gpu_depthwise';\nimport {Conv2DProgram} from './webgl/conv_gpu';\nimport {DepthwiseConv2DProgram} from './webgl/conv_gpu_depthwise';\nimport {CumSumProgram} from './webgl/cumsum_gpu';\nimport {EncodeFloatProgram} from './webgl/encode_float_gpu';\nimport {FromPixelsProgram} from './webgl/from_pixels_gpu';\nimport {GatherProgram} from './webgl/gather_gpu';\nimport {GPGPUContext} from './webgl/gpgpu_context';\nimport * as gpgpu_math from './webgl/gpgpu_math';\nimport {GPGPUBinary, GPGPUProgram, TensorData} from './webgl/gpgpu_math';\nimport * as gpgpu_util from './webgl/gpgpu_util';\nimport {LRNProgram} from './webgl/lrn_gpu';\nimport {LRNGradProgram} from './webgl/lrn_grad_gpu';\nimport {MaxPool2DBackpropProgram} from './webgl/max_pool_backprop_gpu';\nimport {MatMulProgram} from './webgl/mulmat_gpu';\nimport {MultinomialProgram} from './webgl/multinomial_gpu';\nimport {OneHotProgram} from './webgl/onehot_gpu';\nimport {PadProgram} from './webgl/pad_gpu';\nimport {Pool2DProgram} from './webgl/pool_gpu';\nimport {ReduceProgram} from './webgl/reduce_gpu';\nimport {ResizeBilinearBackpropProgram} from './webgl/resize_bilinear_backprop_gpu';\nimport {ResizeBilinearProgram} from './webgl/resize_bilinear_gpu';\nimport {ResizeNearestNeigborBackpropProgram} from './webgl/resize_nearest_neighbor_backprop_gpu';\nimport {ResizeNearestNeighborProgram} from './webgl/resize_nearest_neighbor_gpu';\nimport {ReverseProgram} from './webgl/reverse_gpu';\nimport {SegmentOpProgram} from './webgl/segment_gpu';\nimport {SelectProgram} from './webgl/select_gpu';\nimport {SliceProgram} from './webgl/slice_gpu';\nimport {StridedSliceProgram} from './webgl/strided_slice_gpu';\nimport {TextureData, TextureUsage} from './webgl/tex_util';\nimport {TextureManager} from './webgl/texture_manager';\nimport {TileProgram} from './webgl/tile_gpu';\nimport {TransposeProgram} from './webgl/transpose_gpu';\nimport * as unary_op from './webgl/unaryop_gpu';\nimport {UnaryOpProgram} from './webgl/unaryop_gpu';\nimport * as webgl_util from './webgl/webgl_util';\nimport {whereImpl} from './where_impl';\n\ntype TimerNode = RecursiveArray>|Promise;\nexport interface CPUTimerQuery {\n startMs: number;\n endMs?: number;\n}\n\nexport interface WebGLMemoryInfo extends MemoryInfo {\n numBytesInGPU: number;\n unreliable: boolean;\n}\n\nexport interface WebGLTimingInfo extends TimingInfo {\n uploadWaitMs: number;\n downloadWaitMs: number;\n}\n\n// Empirically determined constant used to decide the number of bytes on GPU\n// before we start paging. The bytes are this constant * screen area * dpi.\nconst BEFORE_PAGING_CONSTANT = 300;\n// Tensors with size <= than this will be uploaded as uniforms, not textures.\nexport const SIZE_UPLOAD_UNIFORM = 32;\n\nexport class MathBackendWebGL implements KernelBackend {\n private texData = new WeakMap();\n // Maps data ids that have a pending read operation, to list of subscribers.\n private pendingRead = new WeakMap void>>();\n // List of data ids that are scheduled for disposal, but are waiting on a\n // pending read operation.\n private pendingDisposal = new WeakSet();\n // List of data ids that are currently residing on gpu memory. Sorted with\n // least recently used being first.\n private lruDataGPU: DataId[] = [];\n private numBytesInGPU = 0;\n /**\n * Number of bytes allocated on the GPU before we start moving data to cpu.\n * Moving avoids gpu memory leaks and relies on JS's garbage collector.\n */\n private NUM_BYTES_BEFORE_PAGING: number;\n\n private canvas: HTMLCanvasElement;\n private fromPixelsCanvas: HTMLCanvasElement;\n\n private programTimersStack: TimerNode[];\n private activeTimers: TimerNode[];\n // Accumulated time spent (including blocking) in uploading data to webgl.\n private uploadWaitMs = 0;\n // Accumulated time spent (including blocking in downloading data from webgl.\n private downloadWaitMs = 0;\n\n register(dataId: DataId, shape: number[], dtype: DataType): void {\n if (this.texData.has(dataId)) {\n throw new Error('Data buffer is already registered');\n }\n this.texData.set(dataId, {\n shape,\n dtype,\n values: null,\n texture: null,\n texShape: null,\n usage: TextureUsage.RENDER\n });\n }\n fromPixels(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels: number): Tensor3D {\n if (pixels == null) {\n throw new Error('pixels passed to tf.fromPixels() can not be null');\n }\n const texShape: [number, number] = [pixels.height, pixels.width];\n const outShape = [pixels.height, pixels.width, numChannels];\n\n if (!(pixels instanceof HTMLVideoElement) &&\n !(pixels instanceof HTMLImageElement) &&\n !(pixels instanceof HTMLCanvasElement) &&\n !(pixels instanceof ImageData)) {\n throw new Error(\n 'pixels passed to tf.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ` +\n `ImageData, but was ${(pixels as {}).constructor.name}`);\n }\n if (pixels instanceof HTMLVideoElement) {\n if (this.fromPixelsCanvas == null) {\n if (!ENV.get('IS_BROWSER')) {\n throw new Error(\n 'Can\\'t read pixels from HTMLImageElement outside the browser.');\n }\n if (document.readyState !== 'complete') {\n throw new Error(\n 'The DOM is not ready yet. Please call tf.fromPixels() ' +\n 'once the DOM is ready. One way to do that is to add an event ' +\n 'listener for `DOMContentLoaded` on the document object');\n }\n this.fromPixelsCanvas = document.createElement('canvas');\n }\n this.fromPixelsCanvas.width = pixels.width;\n this.fromPixelsCanvas.height = pixels.height;\n this.fromPixelsCanvas.getContext('2d').drawImage(\n pixels, 0, 0, pixels.width, pixels.height);\n pixels = this.fromPixelsCanvas;\n }\n const tempPixelArray = Tensor.make(texShape, {}, 'int32');\n\n // This is a byte texture with pixels.\n this.texData.get(tempPixelArray.dataId).usage = TextureUsage.PIXELS;\n this.gpgpu.uploadPixelDataToTexture(\n this.getTexture(tempPixelArray.dataId), pixels);\n const program = new FromPixelsProgram(outShape);\n const res = this.compileAndRun(program, [tempPixelArray]);\n\n tempPixelArray.dispose();\n\n return res as Tensor3D;\n }\n write(dataId: DataId, values: TypedArray): void {\n if (values == null) {\n throw new Error('MathBackendWebGL.write(): values can not be null');\n }\n this.throwIfNoData(dataId);\n\n const texData = this.texData.get(dataId);\n const {texture, texShape, usage} = texData;\n if (texture != null) {\n // Release the old texture.\n this.releaseTexture(dataId, texture, texShape, usage);\n texData.texture = null;\n texData.texShape = null;\n }\n texData.usage = TextureUsage.UPLOAD;\n texData.values = values;\n\n if (!this.delayedStorage) {\n this.uploadToGPU(dataId);\n }\n }\n readSync(dataId: DataId): TypedArray {\n this.throwIfNoData(dataId);\n const texData = this.texData.get(dataId);\n const {shape, texture, values, texShape, dtype} = texData;\n if (values != null) {\n this.cacheOnCPU(dataId);\n return values;\n }\n const shouldTimeProgram = this.activeTimers != null;\n let start: number;\n if (shouldTimeProgram) {\n start = performance.now();\n }\n\n const float32Values =\n this.getValuesFromTexture(texture, dataId, dtype, texShape, shape);\n\n if (shouldTimeProgram) {\n this.downloadWaitMs += performance.now() - start;\n }\n this.cacheOnCPU(dataId, float32Values);\n return texData.values;\n }\n\n async read(dataId: DataId): Promise {\n if (this.pendingRead.has(dataId)) {\n const subscribers = this.pendingRead.get(dataId);\n return new Promise(resolve => subscribers.push(resolve));\n }\n this.throwIfNoData(dataId);\n const texData = this.texData.get(dataId);\n const {shape, texture, values, texShape, dtype} = texData;\n if (values != null) {\n this.cacheOnCPU(dataId);\n return values;\n }\n\n this.pendingRead.set(dataId, []);\n\n if (!ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED') &&\n ENV.get('WEBGL_VERSION') === 2) {\n throw new Error(\n `tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and ` +\n `WEBGL_VERSION=2 not yet supported.`);\n }\n\n // Possibly copy the texture into a buffer before inserting a fence.\n const bufferOrTexture = this.gpgpu.maybeCreateBufferFromTexture(\n texture, texShape[0], texShape[1]);\n\n // Create a fence and wait for it to resolve.\n await this.gpgpu.createAndWaitForFence();\n\n // Download the values from the GPU.\n let vals: Float32Array;\n if (bufferOrTexture instanceof WebGLTexture) {\n vals = this.getValuesFromTexture(texture, dataId, dtype, texShape, shape);\n } else {\n vals = this.gpgpu.downloadFloat32MatrixFromBuffer(\n bufferOrTexture, texShape[0], texShape[1]);\n }\n this.cacheOnCPU(dataId, vals);\n\n const subscribers = this.pendingRead.get(dataId);\n this.pendingRead.delete(dataId);\n\n // Notify all pending reads.\n subscribers.forEach(resolve => resolve(vals));\n if (this.pendingDisposal.has(dataId)) {\n this.pendingDisposal.delete(dataId);\n this.disposeData(dataId);\n }\n return vals;\n }\n\n private getValuesFromTexture(\n texture: WebGLTexture, dataId: DataId, dtype: DataType,\n texShape: [number, number], shape: number[]): Float32Array {\n if (ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED')) {\n return this.gpgpu.downloadFloat32MatrixFromOutputTexture(\n texture, texShape[0], texShape[1]);\n }\n\n const tmpTarget = Tensor.make(shape, {});\n this.texData.get(tmpTarget.dataId).usage = TextureUsage.DOWNLOAD;\n\n const tmpInput = Tensor.make(shape, {dataId}, dtype);\n const program = new EncodeFloatProgram(shape);\n const pageToCpu = false;\n this.compileAndRun(program, [tmpInput], tmpTarget, null, pageToCpu);\n const tmpData = this.texData.get(tmpTarget.dataId);\n const vals = this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(\n tmpData.texture, tmpData.texShape[0], tmpData.texShape[1]);\n\n tmpInput.dispose();\n tmpTarget.dispose();\n\n return vals;\n }\n\n async time(f: () => void): Promise {\n const oldActiveTimers = this.activeTimers;\n const newActiveTimers: TimerNode[] = [];\n\n let outerMostTime = false;\n if (this.programTimersStack == null) {\n this.programTimersStack = newActiveTimers;\n outerMostTime = true;\n } else {\n this.activeTimers.push(newActiveTimers);\n }\n this.activeTimers = newActiveTimers;\n\n f();\n\n const flattenedActiveTimers = util.flatten(this.activeTimers);\n this.activeTimers = oldActiveTimers;\n\n if (outerMostTime) {\n this.programTimersStack = null;\n }\n\n const kernelMs = await Promise.all(flattenedActiveTimers).then(results => {\n let sum = 0;\n results.forEach(result => sum += result);\n return sum;\n });\n const res: WebGLTimingInfo = {\n uploadWaitMs: this.uploadWaitMs,\n downloadWaitMs: this.downloadWaitMs,\n kernelMs,\n wallMs: null // will be filled by the engine\n };\n this.uploadWaitMs = 0;\n this.downloadWaitMs = 0;\n return res;\n }\n memory(): WebGLMemoryInfo {\n return {unreliable: false, numBytesInGPU: this.numBytesInGPU} as\n WebGLMemoryInfo;\n }\n\n private startTimer(): WebGLQuery|CPUTimerQuery {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n return this.gpgpu.beginQuery();\n }\n return {startMs: performance.now(), endMs: null};\n }\n\n private endTimer(query: WebGLQuery|CPUTimerQuery): WebGLQuery|\n {startMs: number, endMs: number} {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n this.gpgpu.endQuery();\n return query;\n }\n (query as CPUTimerQuery).endMs = performance.now();\n return query;\n }\n\n private async getQueryTime(query: WebGLQuery|CPUTimerQuery): Promise {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n return this.gpgpu.waitForQueryAndGetTime(query);\n }\n const timerQuery = query as CPUTimerQuery;\n return timerQuery.endMs - timerQuery.startMs;\n }\n\n disposeData(dataId: DataId): void {\n if (this.pendingDisposal.has(dataId)) {\n return;\n }\n if (this.pendingRead.has(dataId)) {\n this.pendingDisposal.add(dataId);\n return;\n }\n if (this.texData.has(dataId)) {\n const {texture, texShape, usage} = this.texData.get(dataId);\n if (texture != null) {\n this.releaseTexture(dataId, texture, texShape, usage);\n }\n this.texData.delete(dataId);\n }\n }\n\n getTexture(dataId: DataId): WebGLTexture {\n this.uploadToGPU(dataId);\n return this.texData.get(dataId).texture;\n }\n\n private textureManager: TextureManager;\n private binaryCache: {[key: string]: GPGPUBinary} = {};\n private gpgpuCreatedLocally: boolean;\n\n constructor(private gpgpu?: GPGPUContext, private delayedStorage = true) {\n if (ENV.get('WEBGL_VERSION') < 1) {\n throw new Error('WebGL is not supported on this device');\n }\n if (ENV.get('IS_BROWSER')) {\n this.canvas = document.createElement('canvas');\n }\n if (gpgpu == null) {\n this.gpgpu = new GPGPUContext(gpgpu_util.createWebGLContext(this.canvas));\n this.gpgpuCreatedLocally = true;\n } else {\n this.gpgpuCreatedLocally = false;\n }\n // Use the device screen's resolution as a heuristic to decide on the\n // maximum memory allocated on the GPU before starting to page.\n this.NUM_BYTES_BEFORE_PAGING =\n (window.screen.height * window.screen.width * window.devicePixelRatio) *\n BEFORE_PAGING_CONSTANT;\n this.textureManager = new TextureManager(this.gpgpu);\n }\n\n getGPGPUContext(): GPGPUContext {\n return this.gpgpu;\n }\n getCanvas(): HTMLCanvasElement {\n return this.canvas;\n }\n\n slice(x: T, begin: number[], size: number[]): T {\n const program = new SliceProgram(size);\n const customSetup = program.getCustomSetupFunc(begin);\n return this.compileAndRun(program, [x], null, customSetup);\n }\n\n stridedSlice(\n x: T, begin: number[], end: number[], strides: number[],\n beginMask: number, endMask: number): T {\n const [beginIndex, size] =\n getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask);\n\n if (size.some(axis => axis === 0)) {\n return tensor([], size) as T;\n }\n\n const program = new StridedSliceProgram(beginIndex, strides, size);\n return this.compileAndRun(program, [x]);\n }\n\n reverse(x: T, axis: number[]): T {\n const program = new ReverseProgram(x.shape, axis);\n return this.compileAndRun(program, [x]);\n }\n\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n concat(a: Tensor2D, b: Tensor2D): Tensor2D {\n const program = new ConcatProgram(a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n neg(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.NEG);\n return this.compileAndRun(program, [x]) as T;\n }\n\n matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean):\n Tensor2D {\n const program = new MatMulProgram(a.shape, b.shape, transposeA, transposeB);\n return this.compileAndRun(program, [a, b]);\n }\n\n multiply(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MUL, a.shape, b.shape);\n const output =\n this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as Tensor;\n return this.compileAndRun(program, [a, b], output) as Tensor;\n }\n\n batchNormalization(\n x: Tensor4D, mean: Tensor4D|Tensor1D, variance: Tensor4D|Tensor1D,\n varianceEpsilon: number, scale?: Tensor4D|Tensor1D,\n offset?: Tensor4D|Tensor1D): Tensor4D {\n const inputs = [x, mean, variance];\n\n let offsetShape = null;\n if (offset != null) {\n offsetShape = offset.shape;\n inputs.push(offset);\n }\n\n let scaleShape = null;\n if (scale != null) {\n scaleShape = scale.shape;\n inputs.push(scale);\n }\n\n const program = new BatchNormProgram(\n x.shape, mean.shape, variance.shape, offsetShape, scaleShape,\n varianceEpsilon);\n return this.compileAndRun(program, inputs);\n }\n\n localResponseNormalization4D(\n x: Tensor4D, radius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const program = new LRNProgram(x.shape, radius, bias, alpha, beta);\n return this.compileAndRun(program, [x]);\n }\n\n LRNGrad(\n dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D,\n depthRadius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const program =\n new LRNGradProgram(inputImage.shape, depthRadius, bias, alpha, beta);\n return this.compileAndRun(program, [inputImage, outputImage, dy]);\n }\n\n tile(x: T, reps: number[]): T {\n const program = new TileProgram(x.shape, reps);\n return this.compileAndRun(program, [x]);\n }\n\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T {\n const program = new PadProgram(x.shape, paddings, constantValue);\n return this.compileAndRun(program, [x]);\n }\n\n transpose(x: T, perm: number[]): T {\n const program = new TransposeProgram(x.shape, perm);\n return this.compileAndRun(program, [x]);\n }\n\n gather(x: T, indices: Tensor1D, axis: number): T {\n const program = new GatherProgram(x.shape, indices.size, axis);\n return this.compileAndRun(program, [x, indices]);\n }\n\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T {\n util.assert(\n x.rank <= 4,\n 'batchToSpaceND for rank > 4 with a WebGL backend not implemented yet');\n const prod = blockShape.reduce((a, b) => a * b);\n\n const reshaped = array_ops_util.getReshaped(x.shape, blockShape, prod);\n const permuted =\n array_ops_util.getPermuted(reshaped.length, blockShape.length);\n const reshapedPermuted =\n array_ops_util.getReshapedPermuted(x.shape, blockShape, prod);\n const sliceBeginCoords =\n array_ops_util.getSliceBeginCoords(crops, blockShape.length);\n const sliceSize =\n array_ops_util.getSliceSize(reshapedPermuted, crops, blockShape.length);\n\n return x.reshape(reshaped)\n .transpose(permuted)\n .reshape(reshapedPermuted)\n .slice(sliceBeginCoords, sliceSize) as T;\n }\n\n spaceToBatchND(\n x: T, blockShape: number[], paddings: Array<[number, number]>): T {\n util.assert(\n x.rank <= 4,\n 'spaceToBatchND for rank > 4 with a WebGL backend not implemented yet');\n\n const prod = blockShape.reduce((a, b) => a * b);\n\n const completePaddings: Array<[number, number]> = [[0, 0]];\n completePaddings.push(...paddings);\n for (let i = 1 + blockShape.length; i < x.shape.length; ++i) {\n completePaddings.push([0, 0]);\n }\n\n const paddedX = x.pad(completePaddings);\n\n const reshapedPaddedShape =\n array_ops_util.getReshaped(paddedX.shape, blockShape, prod, false);\n\n const permutedReshapedPaddedPermutation = array_ops_util.getPermuted(\n reshapedPaddedShape.length, blockShape.length, false);\n\n const flattenShape = array_ops_util.getReshapedPermuted(\n paddedX.shape, blockShape, prod, false);\n\n return paddedX.reshape(reshapedPaddedShape)\n .transpose(permutedReshapedPaddedPermutation)\n .reshape(flattenShape) as T;\n }\n\n private reduce(\n x: Tensor2D, reduceType: 'all'|'any'|'max'|'min'|'sum',\n dtype: DataType): Tensor2D {\n const batchSize = x.shape[0];\n const inSize = x.shape[1];\n const windowSize = reduce_util.computeOptimalWindowSize(inSize);\n const reduceInfo = {windowSize, inSize, batchSize};\n const program = new ReduceProgram(reduceInfo, reduceType);\n const [rows, cols] = program.outputShape;\n const output = this.makeOutputArray([rows, cols], dtype);\n this.compileAndRun(program, [x], output);\n // No need to run another GPGPU program.\n if (output.shape[1] === 1) {\n return output;\n }\n return this.reduce(output, reduceType, dtype);\n }\n\n private argReduce(\n x: Tensor2D, reduceType: 'max'|'min',\n bestIndicesA: Tensor2D = null): Tensor2D {\n let batchSize = x.shape[0];\n let inSize = x.shape[1];\n if (bestIndicesA != null) {\n batchSize = bestIndicesA.shape[0];\n inSize = bestIndicesA.shape[1];\n }\n const windowSize = reduce_util.computeOptimalWindowSize(inSize);\n const reduceInfo = {windowSize, inSize, batchSize};\n const program =\n new ArgMinMaxProgram(reduceInfo, reduceType, bestIndicesA == null);\n const [rows, cols] = program.outputShape;\n const output = this.makeOutputArray([rows, cols], 'int32');\n const inputs = [x];\n if (bestIndicesA != null) {\n inputs.push(bestIndicesA);\n }\n this.compileAndRun(program, inputs, output);\n // No need to run another GPGPU program.\n if (output.shape[1] === 1) {\n return output;\n }\n return this.argReduce(x, reduceType, output);\n }\n\n sum(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('sum', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n const outputDType = sumOutType(x.dtype);\n return this.reduce(a2D, 'sum', outputDType).reshape(outShape);\n }\n\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): Tensor {\n let axis = 0;\n const permutation = axis_util.getAxesPermutation([axis], x.rank);\n let permutedX = x;\n if (permutation != null) {\n permutedX = x.transpose(permutation);\n axis = axis_util.getInnerMostAxes(1, x.rank)[0];\n }\n\n const outShape =\n segment_util.computeOutShape(permutedX.shape, axis, numSegments);\n const inSize = util.sizeFromShape([permutedX.shape[axis]]);\n const a2D = permutedX.as2D(-1, inSize);\n const outputDType = sumOutType(x.dtype);\n let result =\n this.segOpCompute(\n a2D, 'unsortedSegmentSum', segmentIds, outputDType, numSegments)\n .reshape(outShape);\n if (permutation != null) {\n result = result.transpose(axis_util.getUndoAxesPermutation(permutation));\n }\n return result;\n }\n\n private segOpCompute(\n x: Tensor2D, segOpType: 'unsortedSegmentSum', segmentIds: Tensor1D,\n dtype: DataType, numSegments: number): Tensor2D {\n const batchSize = x.shape[0];\n const inSize = x.shape[1];\n const windowSize =\n segment_util.segOpComputeOptimalWindowSize(inSize, numSegments);\n const segOpInfo = {windowSize, inSize, batchSize, numSegments};\n const program = new SegmentOpProgram(segOpInfo, segOpType);\n const [rows, cols] = program.outputShape;\n const output = this.makeOutputArray([rows, cols], dtype);\n this.compileAndRun(program, [x, segmentIds], output);\n // No need to run another GPGPU program.\n if (output.shape[1] === numSegments) {\n return output;\n }\n segmentIds = range(0, numSegments).tile([inSize / windowSize]);\n return this.segOpCompute(output, segOpType, segmentIds, dtype, numSegments);\n }\n\n argMin(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMin', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.argReduce(a2D, 'min').reshape(outShape);\n }\n\n argMax(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMax', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.argReduce(a2D, 'max').reshape(outShape);\n }\n\n cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean):\n Tensor {\n if (axis !== x.rank - 1) {\n throw new Error(\n `WebGL cumsum shader expects an inner-most axis=${x.rank - 1} ` +\n `but got axis=${axis}`);\n }\n const program = new CumSumProgram(x.shape, exclusive, reverse);\n return this.compileAndRun(program, [x]);\n }\n\n equal(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n notEqual(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.NOT_EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n less(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.LESS, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n lessEqual(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.LESS_EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n greater(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.GREATER, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n greaterEqual(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.GREATER_EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n logicalNot(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.LOGICAL_NOT);\n return this.compileAndRun(program, [x]) as T;\n }\n\n logicalAnd(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.LOGICAL_AND, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n logicalOr(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.LOGICAL_OR, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n select(condition: Tensor, a: Tensor, b: Tensor): Tensor {\n const program = new SelectProgram(condition.rank, a.shape, a.rank);\n const output =\n this.makeOutputArray(program.outputShape, upcastType(a.dtype, b.dtype));\n return this.compileAndRun(program, [condition, a, b], output);\n }\n\n where(condition: Tensor): Tensor2D {\n warn(\n 'tf.where() in webgl locks the UI thread. ' +\n 'Call tf.whereAsync() instead');\n const condVals = condition.dataSync();\n return whereImpl(condition.shape, condVals);\n }\n\n topk(x: T, k: number, sorted: boolean): [T, T] {\n const xVals = x.dataSync();\n return topkImpl(xVals, x.shape, x.dtype, k, sorted);\n }\n\n min(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('min', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'min', a2D.dtype).reshape(outShape);\n }\n\n minimum(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MIN, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n mod(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MOD, a.shape, b.shape);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [a, b], null, customSetup);\n }\n\n max(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('max', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'max', a2D.dtype).reshape(outShape);\n }\n\n maximum(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MAX, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n all(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('all', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'all', a2D.dtype).reshape(outShape);\n }\n\n any(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('any', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'any', a2D.dtype).reshape(outShape);\n }\n\n squaredDifference(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.SQUARED_DIFFERENCE, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n realDivide(a: Tensor, b: Tensor): Tensor {\n const op = binaryop_gpu.DIV;\n const outputDtype = 'float32';\n const program = new BinaryOpProgram(op, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, outputDtype);\n return this.compileAndRun(program, [a, b], output);\n }\n\n floorDiv(a: Tensor, b: Tensor): Tensor {\n const op = binaryop_gpu.INT_DIV;\n const outputDtype = 'int32';\n const program = new BinaryOpProgram(op, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, outputDtype);\n return this.compileAndRun(program, [a, b], output);\n }\n\n add(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.ADD, a.shape, b.shape);\n const output =\n this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as Tensor;\n return this.compileAndRun(program, [a, b], output);\n }\n\n addN(tensors: T[]): T {\n let res = tensors[0];\n for (let i = 1; i < tensors.length; i++) {\n res = this.add(res, tensors[i]) as T;\n }\n return res;\n }\n\n subtract(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.SUB, a.shape, b.shape);\n const output =\n this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as Tensor;\n return this.compileAndRun(program, [a, b], output);\n }\n\n pow(a: T, b: Tensor): T {\n const program = new BinaryOpProgram(binaryop_gpu.POW, a.shape, b.shape);\n const customSetup = program.getCustomSetupFunc();\n const output = this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as T;\n return this.compileAndRun(program, [a, b], output, customSetup);\n }\n\n ceil(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.CEIL);\n return this.compileAndRun(program, [x]) as T;\n }\n\n floor(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.FLOOR);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sign(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SIGN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n round(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ROUND);\n return this.compileAndRun(program, [x]) as T;\n }\n\n exp(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.EXP);\n return this.compileAndRun(program, [x]) as T;\n }\n\n expm1(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.EXPM1);\n return this.compileAndRun(program, [x]) as T;\n }\n\n log(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.LOG);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [x], null, customSetup) as T;\n }\n\n log1p(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.LOG1P);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sqrt(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SQRT);\n return this.compileAndRun(program, [x]) as T;\n }\n\n rsqrt(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.RSQRT);\n return this.compileAndRun(program, [x]) as T;\n }\n\n square(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SQUARE);\n return this.compileAndRun(program, [x]) as T;\n }\n\n reciprocal(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.RECIPROCAL);\n return this.compileAndRun(program, [x]) as T;\n }\n\n relu(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.RELU);\n return this.compileAndRun(program, [x]) as T;\n }\n\n elu(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ELU);\n return this.compileAndRun(program, [x]) as T;\n }\n\n eluDer(dy: T, y: T): T {\n const program =\n new BinaryOpProgram(binaryop_gpu.ELU_DER, dy.shape, y.shape);\n return this.compileAndRun(program, [dy, y]) as T;\n }\n\n selu(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SELU);\n return this.compileAndRun(program, [x]) as T;\n }\n\n int(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.TO_INT);\n const output = this.makeOutputArray(program.outputShape, 'int32');\n return this.compileAndRun(program, [x], output) as T;\n }\n\n clip(x: T, min: number, max: number): T {\n const program = new ClipProgram(x.shape, min, max);\n return this.compileAndRun(program, [x]) as T;\n }\n\n abs(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ABS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sigmoid(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SIGMOID);\n return this.compileAndRun(program, [x]) as T;\n }\n\n softplus(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SOFTPLUS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sin(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SIN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n cos(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.COS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n tan(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.TAN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n asin(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ASIN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n acos(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ACOS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n atan(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ATAN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n atan2(a: T, b: T): T {\n const program = new BinaryOpProgram(binaryop_gpu.ATAN2, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]) as T;\n }\n\n sinh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SINH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n cosh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.COSH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n tanh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.TANH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n asinh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ASINH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n acosh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ACOSH);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [x], null, customSetup) as T;\n }\n\n atanh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ATANH);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [x], null, customSetup) as T;\n }\n\n erf(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ERF);\n return this.compileAndRun(program, [x]) as T;\n }\n\n step(x: T, alpha: number): T {\n const program = new UnaryOpProgram(x.shape, unary_op.STEP(alpha));\n return this.compileAndRun(program, [x]) as T;\n }\n\n conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Conv2DProgram(convInfo);\n return this.compileAndRun(program, [x, filter]);\n }\n\n conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new Conv2DDerInputProgram(convInfo);\n return this.compileAndRun(program, [dy, filter]);\n }\n\n conv2dDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Conv2DDerFilterProgram(convInfo);\n return this.compileAndRun(program, [x, dy]);\n }\n\n depthwiseConv2D(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new DepthwiseConv2DProgram(convInfo);\n return this.compileAndRun(program, [x, filter]);\n }\n\n depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new DepthwiseConv2DDerInputProgram(convInfo);\n return this.compileAndRun(program, [dy, filter]);\n }\n\n depthwiseConv2DDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new DepthwiseConv2DDerFilterProgram(convInfo);\n return this.compileAndRun(program, [x, dy]);\n }\n\n maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Pool2DProgram(convInfo, 'max', false);\n const output =\n this.makeOutputArray(program.outputShape, x.dtype) as Tensor4D;\n return this.compileAndRun(program, [x], output);\n }\n\n avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Pool2DProgram(convInfo, 'avg', false);\n const output = this.makeOutputArray(program.outputShape, 'float32');\n return this.compileAndRun(program, [x], output) as Tensor4D;\n }\n\n maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const getPositions = true;\n const maxPoolPositionsProgram =\n new Pool2DProgram(convInfo, 'max', getPositions);\n const maxPoolPositions: Tensor4D =\n this.compileAndRun(maxPoolPositionsProgram, [x]);\n\n const maxPoolBackPropProgram = new MaxPool2DBackpropProgram(convInfo);\n const output =\n this.makeOutputArray(maxPoolBackPropProgram.outputShape, x.dtype);\n const result = this.compileAndRun(\n maxPoolBackPropProgram, [dy, maxPoolPositions], output);\n maxPoolPositions.dispose();\n return result as Tensor4D;\n }\n\n avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const avgPoolBackpropProgram = new AvgPool2DBackpropProgram(convInfo);\n const output =\n this.makeOutputArray(avgPoolBackpropProgram.outputShape, x.dtype);\n return this.compileAndRun(avgPoolBackpropProgram, [dy], output) as Tensor4D;\n }\n\n cast(x: T, dtype: DataType): T {\n return backend_util.castTensor(x, dtype, this);\n }\n\n reshape(x: Tensor, shape: ShapeMap[R]): Tensor {\n return backend_util.reshapeTensor(x, shape);\n }\n\n resizeBilinear(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const program =\n new ResizeBilinearProgram(x.shape, newHeight, newWidth, alignCorners);\n return this.compileAndRun(program, [x]);\n }\n\n resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean):\n Tensor4D {\n const program = new ResizeBilinearBackpropProgram(dy, x, alignCorners);\n\n return this.compileAndRun(program, [dy]);\n }\n\n resizeNearestNeighbor(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const program = new ResizeNearestNeighborProgram(\n x.shape, newHeight, newWidth, alignCorners);\n return this.compileAndRun(program, [x]);\n }\n\n resizeNearestNeighborBackprop(\n dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor4D {\n const program =\n new ResizeNearestNeigborBackpropProgram(dy, x, alignCorners);\n return this.compileAndRun(program, [dy]);\n }\n\n multinomial(\n logits: Tensor2D, normalized: boolean, numSamples: number,\n seed: number): Tensor2D {\n const probs = normalized ? logits : softmax(logits);\n const batchSize = probs.shape[0];\n const numOutcomes = probs.shape[1];\n const program = new MultinomialProgram(batchSize, numOutcomes, numSamples);\n const output =\n this.makeOutputArray(program.outputShape, 'int32') as Tensor2D;\n const customSetup = program.getCustomSetupFunc(seed);\n return this.compileAndRun(program, [probs], output, customSetup);\n }\n\n oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number):\n Tensor2D {\n const program = new OneHotProgram(indices.size, depth, onValue, offValue);\n return this.compileAndRun(program, [indices]);\n }\n\n nonMaxSuppression(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number): Tensor1D {\n warn(\n 'tf.nonMaxSuppression() in webgl locks the UI thread. ' +\n 'Call tf.nonMaxSuppressionAsync() instead');\n const boxesVals = boxes.dataSync();\n const scoresVals = scores.dataSync();\n return nonMaxSuppressionImpl(\n boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold);\n }\n\n private makeOutputArray(shape: number[], dtype: DataType):\n T {\n return Tensor.make(shape, {}, dtype) as T;\n }\n\n private compileAndRun(\n program: GPGPUProgram, inputs: T[], output?: K,\n customSetup?: (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void,\n pageToCpu = true): K {\n if (output == null) {\n output = this.makeOutputArray(program.outputShape, inputs[0].dtype);\n }\n const inputsData: Array> = inputs.map(tensor => {\n const texData = this.texData.get(tensor.dataId);\n // Upload small tensors that live on the CPU as uniforms, not as\n // textures.\n if (texData.texture == null && tensor.size <= SIZE_UPLOAD_UNIFORM) {\n return {tensor, texData: null, isUniform: true};\n }\n this.uploadToGPU(tensor.dataId);\n return {tensor, texData, isUniform: false};\n });\n this.uploadToGPU(output.dataId);\n const outputData = {\n tensor: output,\n texData: this.texData.get(output.dataId),\n isUniform: false\n };\n const key = gpgpu_math.makeShaderKey(program, inputsData, outputData);\n const binary = this.getAndSaveBinary(key, () => {\n return gpgpu_math.compileProgram(\n this.gpgpu, program, inputsData, outputData);\n });\n const shouldTimeProgram = this.activeTimers != null;\n let query: WebGLQuery|CPUTimerQuery;\n if (shouldTimeProgram) {\n query = this.startTimer();\n }\n\n gpgpu_math.runProgram(binary, inputsData, outputData, customSetup);\n\n if (pageToCpu && this.numBytesInGPU > this.NUM_BYTES_BEFORE_PAGING) {\n let numBytesToPage = this.numBytesInGPU - this.NUM_BYTES_BEFORE_PAGING;\n while (numBytesToPage > 0 && this.lruDataGPU.length > 0) {\n const dataId = this.lruDataGPU.shift();\n const {shape, dtype} = this.texData.get(dataId);\n numBytesToPage -= this.computeBytes(shape, dtype);\n this.read(dataId);\n }\n }\n\n if (shouldTimeProgram) {\n query = this.endTimer(query);\n this.activeTimers.push(this.getQueryTime(query));\n }\n return output;\n }\n\n private getAndSaveBinary(key: string, getBinary: () => GPGPUBinary):\n GPGPUBinary {\n if (!(key in this.binaryCache)) {\n this.binaryCache[key] = getBinary();\n }\n return this.binaryCache[key];\n }\n\n getTextureManager(): TextureManager {\n return this.textureManager;\n }\n\n private disposed = false;\n\n dispose() {\n if (this.disposed) {\n return;\n }\n for (const key in this.binaryCache) {\n this.gpgpu.deleteProgram(this.binaryCache[key].webGLProgram);\n }\n this.textureManager.dispose();\n this.canvas.remove();\n if (this.fromPixelsCanvas != null) {\n this.fromPixelsCanvas.remove();\n }\n if (this.gpgpuCreatedLocally) {\n this.gpgpu.dispose();\n }\n this.disposed = true;\n }\n\n private throwIfNoData(dataId: DataId) {\n if (!this.texData.has(dataId)) {\n throw new Error(\n `WebGL backend: No data found for this tensor. ` +\n `Did you change your backend in the middle of the program? ` +\n `New backends can't use Tensors created with previous backends`);\n }\n }\n\n private uploadToGPU(dataId: DataId): void {\n this.throwIfNoData(dataId);\n const texData = this.texData.get(dataId);\n const {shape, values, texture, dtype, usage} = texData;\n if (texture != null) {\n // Array is already on GPU. No-op.\n // Touching the texture.\n const index = this.lruDataGPU.indexOf(dataId);\n if (index >= 0) {\n this.lruDataGPU.splice(this.lruDataGPU.indexOf(dataId), 1);\n this.lruDataGPU.push(dataId);\n }\n return;\n }\n const shouldTimeProgram = this.activeTimers != null;\n let start: number;\n if (shouldTimeProgram) {\n start = performance.now();\n }\n const texShape =\n webgl_util.getTextureShapeFromLogicalShape(this.gpgpu.gl, shape);\n texData.texShape = texShape;\n const newTexture = this.acquireTexture(dataId, texShape, usage);\n texData.texture = newTexture;\n if (values != null) {\n this.gpgpu.uploadMatrixToTexture(\n newTexture, texShape[0],\n // TODO(smilkov): Propagate the original typed array to gpgpu.\n texShape[1], typedArrayToFloat32(values, dtype));\n // Once uploaded, don't store the values on cpu.\n texData.values = null;\n if (shouldTimeProgram) {\n this.uploadWaitMs += performance.now() - start;\n }\n }\n }\n\n private cacheOnCPU(dataId: DataId, float32Values?: Float32Array) {\n // In delayed storage mode, when the user reads data, we don't keep a\n // copy on the gpu, to minimize likelihood of memory leak. We re-upload\n // to gpu the next time a gpgpu program needs the texture.\n const dontKeepCopyOnGPU = this.delayedStorage;\n const texData = this.texData.get(dataId);\n const {texture, texShape, dtype, usage} = texData;\n if (dontKeepCopyOnGPU && texture != null) {\n this.releaseTexture(dataId, texture, texShape, usage);\n texData.texture = null;\n texData.texShape = null;\n }\n if (float32Values != null) {\n texData.values = float32ToTypedArray(float32Values, dtype);\n }\n }\n\n private releaseTexture(\n dataId: DataId, texture: WebGLTexture, texShape: [number, number],\n texType: TextureUsage) {\n const {shape, dtype} = this.texData.get(dataId);\n const idx = this.lruDataGPU.indexOf(dataId);\n if (idx >= 0) {\n this.lruDataGPU.splice(idx, 1);\n }\n this.numBytesInGPU -= this.computeBytes(shape, dtype);\n this.textureManager.releaseTexture(texture, texShape, texType);\n }\n\n private acquireTexture(\n dataId: DataId, texShape: [number, number],\n texType: TextureUsage): WebGLTexture {\n const {shape, dtype} = this.texData.get(dataId);\n this.lruDataGPU.push(dataId);\n this.numBytesInGPU += this.computeBytes(shape, dtype);\n return this.textureManager.acquireTexture(texShape, texType);\n }\n\n private computeBytes(shape: number[], dtype: DataType) {\n return util.sizeFromShape(shape) * util.bytesPerElement(dtype);\n }\n}\n\nif (ENV.get('IS_BROWSER')) {\n ENV.registerBackend(\n 'webgl', () => new MathBackendWebGL(), 2 /* priority */,\n setTensorTracker);\n}\n\nfunction float32ToTypedArray(\n a: Float32Array, dtype: D): DataTypeMap[D] {\n if (dtype === 'float32') {\n return a;\n } else if (dtype === 'int32' || dtype === 'bool') {\n const result = (dtype === 'int32') ? new Int32Array(a.length) :\n new Uint8Array(a.length);\n for (let i = 0; i < result.length; ++i) {\n result[i] = Math.round(a[i]);\n }\n return result;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\nfunction typedArrayToFloat32(\n a: DataTypeMap[D], dtype: D): Float32Array {\n return (a instanceof Float32Array) ? a : new Float32Array(a);\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\nimport {scalar, zerosLike} from './tensor_ops';\n\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction neg_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'neg');\n\n const grad = (dy: T) => {\n return {$x: () => dy.neg()};\n };\n return ENV.engine.runKernel(backend => backend.neg($x), {$x}, grad);\n}\n\n/**\n * Computes ceiling of input `Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction ceil_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'ceil');\n\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.ceil($x), {$x}, grad);\n}\n\n/**\n * Computes floor of input `Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction floor_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'floor');\n\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.floor($x), {$x}, grad);\n}\n\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sign_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sign');\n\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.sign($x), {$x}, grad);\n}\n\n/**\n * Computes round of input `Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction round_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'round');\n\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.round($x), {$x}, grad);\n}\n\n/**\n * Computes exponential of the input `Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction exp_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'exp');\n\n const bck = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {$x: () => dy.mulStrict(y as T)};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.exp($x)), {$x}, bck);\n}\n\n/**\n * Computes exponential of the input `Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction expm1_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'expm1');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.exp())};\n };\n return ENV.engine.runKernel(backend => backend.expm1($x), {$x}, grad);\n}\n\n/**\n * Computes natural logarithm of the input `Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction log_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'log');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.toFloat())};\n };\n return ENV.engine.runKernel(backend => backend.log($x), {$x}, grad);\n}\n\n/**\n * Computes natural logarithm of the input `Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction log1p_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'log1p');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.add(scalar(1)))};\n };\n return ENV.engine.runKernel(backend => backend.log1p($x), {$x}, grad);\n}\n\n/**\n * Computes square root of the input `Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sqrt_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sqrt');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.toFloat().sqrt().mul(scalar(2)))};\n };\n return ENV.engine.runKernel(backend => backend.sqrt($x), {$x}, grad);\n}\n\n/**\n * Computes reciprocal of square root of the input `Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction rsqrt_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.pow(scalar(1.5)).mul(scalar(2))).neg()};\n };\n return ENV.engine.runKernel(backend => backend.rsqrt($x), {$x}, grad);\n}\n\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction square_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'square');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.toFloat().mul(scalar(2)))};\n };\n return ENV.engine.runKernel(backend => backend.square($x), {$x}, grad);\n}\n\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction reciprocal_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.square().neg())};\n };\n return ENV.engine.runKernel(backend => backend.reciprocal($x), {$x}, grad);\n}\n\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `Tensor`.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction abs_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'abs');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.toFloat().step(-1))};\n };\n return ENV.engine.runKernel(backend => backend.abs($x), {$x}, grad);\n}\n\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction clipByValue_(\n x: T|TensorLike, clipValueMin: number, clipValueMax: number): T {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert(\n (clipValueMin <= clipValueMax),\n `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.where(\n $x.greaterEqual(scalar(clipValueMin))\n .logicalAnd($x.lessEqual(scalar(clipValueMax))),\n zerosLike(dy)) as T,\n };\n };\n return ENV.engine.runKernel(\n backend => backend.clip($x, clipValueMin, clipValueMax), {$x}, grad);\n}\n\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sigmoid_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n\n const grad = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {$x: () => dy.mulStrict(y.mul(scalar(1).sub(y)))};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.sigmoid($x)), {$x}, grad);\n}\n\n/**\n * Computes log sigmoid of the input `Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction logSigmoid_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.neg().sigmoid())};\n };\n return ENV.engine.runKernel(\n backend => backend.softplus($x.neg()).neg(), {$x}, grad);\n}\n\n/**\n * Computes softplus of the input `Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction softplus_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'softplus');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.sigmoid())};\n };\n return ENV.engine.runKernel(backend => backend.softplus($x), {$x}, grad);\n}\n\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sin_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sin');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().cos().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.sin($x), {$x}, grad);\n}\n\n/**\n * Computes cos of the input `Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction cos_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'cos');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().sin().neg().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.cos($x), {$x}, grad);\n}\n\n/**\n * Computes tan of the input `Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction tan_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'tan');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.cos().square())};\n };\n return ENV.engine.runKernel(backend => backend.tan($x), {$x}, grad);\n}\n\n/**\n * Computes asin of the input `Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction asin_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'asin');\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.divStrict(scalar(1).sub($x.toFloat().square()).sqrt() as T)\n };\n };\n return ENV.engine.runKernel(backend => backend.asin($x), {$x}, grad);\n}\n\n/**\n * Computes acos of the input `Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction acos_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'acos');\n\n const grad = (dy: T) => {\n return {\n $x: () =>\n dy.divStrict(scalar(1).sub($x.toFloat().square()).sqrt() as T).neg()\n };\n };\n return ENV.engine.runKernel(backend => backend.acos($x), {$x}, grad);\n}\n\n/**\n * Computes atan of the input `Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction atan_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'atan');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict(scalar(1).add($x.toFloat().square()))};\n };\n return ENV.engine.runKernel(backend => backend.atan($x), {$x}, grad);\n}\n\n/**\n * Computes hyperbolic sin of the input `Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sinh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sinh');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().cosh().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.sinh($x), {$x}, grad);\n}\n\n/**\n * Computes hyperbolic cos of the input `Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction cosh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'cosh');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().sinh().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.cosh($x), {$x}, grad);\n}\n\n/**\n * Computes hyperbolic tangent of the input `Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction tanh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'tanh');\n\n const grad = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {$x: () => scalar(1).sub(y.square()).mulStrict(dy) as T};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.tanh($x)), {$x}, grad);\n}\n\n/**\n * Computes inverse hyperbolic sin of the input `Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction asinh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'asinh');\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.divStrict(scalar(1).add($x.toFloat().square()).sqrt() as T)\n };\n };\n return ENV.engine.runKernel(backend => backend.asinh($x), {$x}, grad);\n}\n\n/**\n * Computes the inverse hyperbolic cos of the input `Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction acosh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'acosh');\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.divStrict($x.toFloat().square().sub(scalar(1)).sqrt() as T)\n };\n };\n return ENV.engine.runKernel(backend => backend.acosh($x), {$x}, grad);\n}\n\n/**\n * Computes inverse hyperbolic tan of the input `Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction atanh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'atanh');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict(scalar(1).sub($x.toFloat().square()))};\n };\n return ENV.engine.runKernel(backend => backend.atanh($x), {$x}, grad);\n}\n\n/**\n * Computes gause error function of the input `Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction erf_(x: T|TensorLike): T {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert(\n $x.dtype === 'int32' || $x.dtype === 'float32',\n 'Input dtype must be `int32` or `float32`.');\n\n if ($x.dtype === 'int32') {\n $x = $x.toFloat();\n }\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.mulStrict(\n scalar(2 / Math.sqrt(Math.PI)).mul($x.square().neg().exp()))\n };\n };\n return ENV.engine.runKernel(backend => backend.erf($x), {$x}, grad);\n}\n\n/**\n * Computes step of the input `Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction step_(x: T|TensorLike, alpha = 0.0): T {\n const $x = convertToTensor(x, 'x', 'step');\n\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.step($x, alpha), {$x}, grad);\n}\n\nexport const abs = op({abs_});\nexport const acos = op({acos_});\nexport const acosh = op({acosh_});\nexport const asin = op({asin_});\nexport const asinh = op({asinh_});\nexport const atan = op({atan_});\nexport const atanh = op({atanh_});\nexport const ceil = op({ceil_});\nexport const clipByValue = op({clipByValue_});\nexport const cos = op({cos_});\nexport const cosh = op({cosh_});\nexport const erf = op({erf_});\nexport const exp = op({exp_});\nexport const expm1 = op({expm1_});\nexport const floor = op({floor_});\nexport const log = op({log_});\nexport const log1p = op({log1p_});\nexport const logSigmoid = op({logSigmoid_});\nexport const neg = op({neg_});\nexport const reciprocal = op({reciprocal_});\nexport const round = op({round_});\nexport const rsqrt = op({rsqrt_});\nexport const sigmoid = op({sigmoid_});\nexport const sign = op({sign_});\nexport const sin = op({sin_});\nexport const sinh = op({sinh_});\nexport const softplus = op({softplus_});\nexport const sqrt = op({sqrt_});\nexport const square = op({square_});\nexport const step = op({step_});\nexport const tan = op({tan_});\nexport const tanh = op({tanh_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {Rank, TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {tile} from './array_ops';\nimport {getReductionAxes} from './broadcast_util';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\nimport {rsqrt} from './unary_ops';\n\n/**\n * Batch normalization, strictly for 2D. For the more relaxed version, see\n * `batchNormalization`.\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\nfunction batchNormalization2d_(\n x: Tensor2D|TensorLike, mean: Tensor2D|Tensor1D|TensorLike,\n variance: Tensor2D|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor2D|Tensor1D|TensorLike,\n offset?: Tensor2D|Tensor1D|TensorLike): Tensor2D {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor2D|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor2D|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n util.assert(\n $x.rank === 2,\n `Error in batchNormalization3D: x must be rank 3 but got rank ` +\n `${$x.rank}.`);\n util.assert(\n $mean.rank === 2 || $mean.rank === 1,\n `Error in batchNormalization2D: mean must be rank 2 or rank 1 but ` +\n `got rank ${$mean.rank}.`);\n util.assert(\n $variance.rank === 2 || $variance.rank === 1,\n `Error in batchNormalization2D: variance must be rank 2 or rank 1 ` +\n `but got rank ${$variance.rank}.`);\n if ($scale != null) {\n util.assert(\n $scale.rank === 2 || $scale.rank === 1,\n `Error in batchNormalization2D: scale must be rank 2 or rank 1 ` +\n `but got rank ${$scale.rank}.`);\n }\n if ($offset != null) {\n util.assert(\n $offset.rank === 2 || $offset.rank === 1,\n `Error in batchNormalization2D: offset must be rank 2 or rank 1 ` +\n `but got rank ${$offset.rank}.`);\n }\n\n return batchNormalization(\n $x, $mean, $variance, varianceEpsilon, $scale, $offset);\n}\n\n/**\n * Batch normalization, strictly for 3D. For the more relaxed version, see\n * `batchNormalization`.\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\nfunction batchNormalization3d_(\n x: Tensor3D|TensorLike, mean: Tensor3D|Tensor1D|TensorLike,\n variance: Tensor3D|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor3D|Tensor1D|TensorLike,\n offset?: Tensor3D|Tensor1D|TensorLike): Tensor3D {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor3D|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor3D|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n util.assert(\n $x.rank === 3,\n `Error in batchNormalization3D: x must be rank 3 but got rank ` +\n `${$x.rank}.`);\n util.assert(\n $mean.rank === 3 || $mean.rank === 1,\n `Error in batchNormalization3D: mean must be rank 3 or rank 1 but ` +\n `got rank ${$mean.rank}.`);\n util.assert(\n $variance.rank === 3 || $variance.rank === 1,\n `Error in batchNormalization3D: variance must be rank 3 or rank 1 ` +\n `but got rank ${$variance.rank}.`);\n if ($scale != null) {\n util.assert(\n $scale.rank === 3 || $scale.rank === 1,\n `Error in batchNormalization3D: scale must be rank 3 or rank 1 ` +\n `but got rank ${$scale.rank}.`);\n }\n if ($offset != null) {\n util.assert(\n $offset.rank === 3 || $offset.rank === 1,\n `Error in batchNormalization3D: offset must be rank 3 or rank 1 ` +\n `but got rank ${$offset.rank}.`);\n }\n\n return batchNormalization(\n $x, $mean, $variance, varianceEpsilon, $scale, $offset);\n}\n\n/**\n * Batch normalization, strictly for 4D. For the more relaxed version, see\n * `batchNormalization`.\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\nfunction batchNormalization4d_(\n x: Tensor4D|TensorLike, mean: Tensor4D|Tensor1D|TensorLike,\n variance: Tensor4D|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor4D|Tensor1D|TensorLike,\n offset?: Tensor4D|Tensor1D|TensorLike): Tensor4D {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor4D|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor4D|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n util.assert(\n $x.rank === 4,\n `Error in batchNormalization4D: x must be rank 4 but got rank ` +\n `${$x.rank}.`);\n util.assert(\n $mean.rank === 4 || $mean.rank === 1,\n `Error in batchNormalization4D: mean must be rank 4 or rank 1 but ` +\n `got rank ${$mean.rank}.`);\n util.assert(\n $variance.rank === 4 || $variance.rank === 1,\n `Error in batchNormalization4D: variance must be rank 4 or rank 1 ` +\n `but got rank ${$variance.rank}.`);\n if ($scale != null) {\n util.assert(\n $scale.rank === 4 || $scale.rank === 1,\n `Error in batchNormalization4D: scale must be rank 4 or rank 1 ` +\n `but got rank ${$scale.rank}.`);\n }\n if ($offset != null) {\n util.assert(\n $offset.rank === 4 || $offset.rank === 1,\n `Error in batchNormalization4D: offset must be rank 4 or rank 1 ` +\n `but got rank ${$offset.rank}.`);\n }\n return batchNormalization(\n $x, $mean, $variance, varianceEpsilon, $scale, $offset);\n}\n\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two\n * shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNormalization2d`\n * - `tf.batchNormalization3d`\n * - `tf.batchNormalization4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction batchNormalization_(\n x: Tensor|Tensor1D|TensorLike, mean: Tensor|Tensor1D|TensorLike,\n variance: Tensor|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor|Tensor1D|TensorLike,\n offset?: Tensor|Tensor1D|TensorLike): Tensor {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n\n util.assert(\n $mean.rank === $variance.rank,\n 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert(\n $offset == null || $mean.rank === $offset.rank,\n 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert(\n $scale == null || $mean.rank === $scale.rank,\n 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n\n let x4D: Tensor4D;\n if ($x.rank === 0 || $x.rank === 1) {\n x4D = $x.as4D(1, 1, 1, $x.size);\n } else if ($x.rank === 2) {\n x4D = $x.as4D(1, 1, $x.shape[0], $x.shape[1]);\n } else if ($x.rank === 3) {\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]) as Tensor4D;\n } else {\n x4D = $x as Tensor4D;\n }\n\n const der = (dy: Tensor) => {\n const scaleValue = $scale == null ? scalar(1) : $scale;\n const reductionAxes = getReductionAxes($mean.shape, x4D.shape);\n const tileShape: number[] = [];\n if ($mean.rank === 1) {\n for (let i = 0; i < x4D.shape.length - 1; ++i) {\n tileShape.push(x4D.shape[i]);\n }\n tileShape.push(1);\n }\n\n const xMinusMean = $x.sub($mean);\n const dyTimesScaleValue = dy.mul(scaleValue);\n const oneOverSqrtVariance = rsqrt($variance.add(scalar(varianceEpsilon)));\n const minusHalfRCube = oneOverSqrtVariance.mul(oneOverSqrtVariance)\n .mul(oneOverSqrtVariance)\n .mul(scalar(-0.5));\n const derX = () => {\n if ($mean.rank === 1) {\n return dy\n .mul(tile(\n oneOverSqrtVariance.as4D(1, 1, 1, $mean.shape[0]), tileShape))\n .mul(scaleValue)\n .reshape($x.shape);\n } else {\n return dy.mul(oneOverSqrtVariance).mul(scaleValue).reshape($x.shape);\n }\n };\n const derMean = () => {\n let meanDer = oneOverSqrtVariance.mul(scalar(-1)).mul(dyTimesScaleValue);\n if ($mean.rank === 1) {\n meanDer = meanDer.sum(reductionAxes);\n }\n return meanDer.reshape($mean.shape);\n };\n const derVariance = () => {\n let varianceDer = minusHalfRCube.mul(xMinusMean).mul(dyTimesScaleValue);\n if ($mean.rank === 1) {\n varianceDer = varianceDer.sum(reductionAxes);\n }\n return varianceDer.reshape($mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = xMinusMean.mul(oneOverSqrtVariance);\n let scaleDer = dy.mul(xMinusMean2TimesRsqrt);\n if ($mean.rank === 1) {\n scaleDer = scaleDer.sum(reductionAxes);\n }\n return scaleDer.reshape($mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if ($mean.rank === 1) {\n offsetDer = offsetDer.sum(reductionAxes);\n }\n return offsetDer.reshape($mean.shape);\n };\n return {\n $x: derX,\n $mean: derMean,\n $variance: derVariance,\n $scale: derScale,\n $offset: derOffset\n };\n };\n\n const res = ENV.engine.runKernel(\n backend => backend.batchNormalization(\n x4D, batchnormReshape4D($mean), batchnormReshape4D($variance),\n varianceEpsilon, batchnormReshape4D($scale),\n batchnormReshape4D($offset)),\n {$x, $mean, $variance, $scale, $offset}, der);\n return res.reshape($x.shape);\n}\n\nfunction batchnormReshape4D(x: Tensor): Tensor4D|Tensor1D {\n if (x == null) {\n return null;\n }\n if (x.rank === 0) {\n return x.as1D();\n } else if (x.rank === 1) {\n return x as Tensor1D;\n } else if (x.rank === 2) {\n return x.as4D(1, 1, x.shape[0], x.shape[1]);\n } else if (x.rank === 3) {\n return x.as4D(1, x.shape[0], x.shape[1], x.shape[2]);\n }\n return x as Tensor4D;\n}\n\nexport const batchNormalization2d = op({batchNormalization2d_});\nexport const batchNormalization3d = op({batchNormalization3d_});\nexport const batchNormalization4d = op({batchNormalization4d_});\nexport const batchNormalization = op({batchNormalization_});\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as util from '../util';\n\nexport type PadInfo = {\n top: number,\n left: number,\n right: number,\n bottom: number,\n type: string\n};\n\n/**\n * Information about the forward pass of a convolution/pooling operation.\n * It includes input and output shape, strides, filter size and padding\n * information.\n */\nexport type Conv2DInfo = {\n batchSize: number,\n inHeight: number,\n inWidth: number,\n inChannels: number,\n outHeight: number,\n outWidth: number,\n outChannels: number,\n dataFormat: 'channelsFirst'|'channelsLast',\n strideHeight: number,\n strideWidth: number,\n dilationHeight: number,\n dilationWidth: number,\n filterHeight: number,\n filterWidth: number,\n padInfo: PadInfo,\n inShape: [number, number, number, number],\n outShape: [number, number, number, number],\n filterShape: [number, number, number, number]\n};\n\nexport function computePool2DInfo(\n inShape: [number, number, number, number],\n filterSize: [number, number]|number, strides: number|[number, number],\n pad: 'same'|'valid'|number, roundingMode?: 'floor'|'round'|'ceil',\n dataFormat: 'channelsFirst'|'channelsLast' = 'channelsLast'): Conv2DInfo {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n\n let filterShape: [number, number, number, number];\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n } else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n } else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const dilations = 1;\n\n return computeConv2DInfo(\n inShape, filterShape, strides, dilations, pad, roundingMode, false,\n dataFormat);\n}\n\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(\n inShape: [number, number, number, number],\n filterShape: [number, number, number, number],\n strides: number|[number, number], dilations: number|[number, number],\n pad: 'same'|'valid'|number, roundingMode?: 'floor'|'round'|'ceil',\n depthwise = false,\n dataFormat: 'channelsFirst'|'channelsLast' = 'channelsLast'): Conv2DInfo {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n } else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n } else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n\n const effectiveFilterHeight =\n getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth =\n getEffectiveFilterSize(filterWidth, dilationWidth);\n const {padInfo, outHeight, outWidth} = getPadAndOutInfo(\n pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight,\n effectiveFilterWidth, roundingMode);\n\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n\n let outShape: [number, number, number, number];\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n } else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n\nfunction computeOutputShape3D(\n inShape: [number, number, number], fieldSize: number, outDepth: number,\n stride: number, zeroPad?: number,\n roundingMode?: 'floor'|'round'|'ceil'): [number, number, number] {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n\n const outputRows = conditionalRound(\n (inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n util.assert(\n util.isInt(outputRows),\n `The output # of rows (${outputRows}) must be an integer. Change the ` +\n `stride and/or zero pad parameters`);\n\n const outputCols = conditionalRound(\n (inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n util.assert(\n util.isInt(outputCols),\n `The output # of columns (${outputCols}) must be an integer. Change ` +\n `the stride and/or zero pad parameters`);\n\n return [outputRows, outputCols, outDepth];\n}\n\nexport function computeDefaultPad(\n inputShape: [number, number, number], fieldSize: number, stride: number,\n dilation = 1): number {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor(\n (inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\n\nfunction parseTupleParam(param: number|[number, number]): [number, number] {\n return typeof param === 'number' ? [param, param] : param;\n}\n\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize: number, dilation: number) {\n if (dilation <= 1) {\n return filterSize;\n }\n\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\n\nfunction getPadAndOutInfo(\n pad: 'same'|'valid'|number, inHeight: number, inWidth: number,\n strideHeight: number, strideWidth: number, filterHeight: number,\n filterWidth: number, roundingMode?: 'floor'|'round'|'ceil'):\n {padInfo: PadInfo, outHeight: number, outWidth: number} {\n let padInfo: PadInfo;\n let outHeight: number;\n let outWidth: number;\n\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {top: pad, bottom: pad, left: pad, right: pad, type: padType};\n const outShape = computeOutputShape3D(\n [inHeight, inWidth, 1], filterHeight, 1, strideHeight, pad,\n roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n } else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight =\n (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = {top, bottom, left, right, type: 'SAME'};\n } else if (pad === 'valid') {\n padInfo = {top: 0, bottom: 0, left: 0, right: 0, type: 'VALID'};\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n } else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return {padInfo, outHeight, outWidth};\n}\n\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode\n */\nfunction conditionalRound(\n value: number, roundingMode?: 'floor'|'round'|'ceil') {\n if (!roundingMode) {\n return value;\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport {op} from './operation';\n\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction conv1d_(\n x: T|TensorLike, filter: Tensor3D|TensorLike, stride: number,\n pad: 'valid'|'same'|number, dataFormat: 'NWC'|'NCW' = 'NWC', dilation = 1,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n\n let x3D = $x as Tensor3D;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = $x.as3D(1, $x.shape[0], $x.shape[1]);\n }\n\n util.assert(\n x3D.rank === 3,\n `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert(\n $filter.rank === 3,\n `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n util.assert(\n x3D.shape[2] === $filter.shape[1],\n `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(\n eitherStridesOrDilationsAreOne(stride, dilation),\n 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(\n dataFormat === 'NWC',\n `Error in conv1d: got dataFormat of ${\n dataFormat} but only NWC is currently supported.`);\n\n const filter4D =\n $filter.as4D(1, $filter.shape[0], $filter.shape[1], $filter.shape[2]);\n const input4D = x3D.as4D(x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]);\n const strides: [number, number] = [1, stride];\n const dilations: [number, number] = [1, dilation];\n\n const conv2dDataFormat = 'NHWC';\n\n const res = conv2d(\n input4D, filter4D, strides, pad, conv2dDataFormat, dilations,\n dimRoundingMode);\n\n if (reshapedTo3D) {\n return res.as2D(res.shape[2], res.shape[3]) as T;\n }\n return res.as3D(res.shape[0], res.shape[2], res.shape[3]) as T;\n}\n\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction conv2d_(\n x: T|TensorLike, filter: Tensor4D|TensorLike,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert(\n $filter.rank === 4,\n `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n util.assert(\n x4D.shape[3] === $filter.shape[2],\n `Error in conv2d: depth of input (${x4D.shape[3]}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(\n eitherStridesOrDilationsAreOne(strides, dilations),\n 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n util.assert(\n dataFormat === 'NHWC',\n `Error in conv2d: got dataFormat of ${\n dataFormat} but only NHWC is currently supported.`);\n\n const convInfo = conv_util.computeConv2DInfo(\n x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode);\n\n const grad = (dy: Tensor4D) => {\n util.assert(\n tupleValuesAreOne(dilations),\n 'Error in gradient of conv2D: dilation rates greater than 1 are not' +\n `yet supported in gradients. Got dilations '${dilations}'`);\n\n return {\n x: () => conv2dDerInput_(x4D.shape, dy, $filter, strides, pad),\n $filter: () => conv2dDerFilter_(x4D, dy, $filter.shape, strides, pad)\n };\n };\n\n const res = ENV.engine.runKernel(\n backend => backend.conv2d(x4D, $filter, convInfo), {x: x4D, $filter},\n grad);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\nfunction conv2dDerInput_(\n xShape: [number, number, number, number]|[number, number, number], dy: T,\n filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n util.assert(\n xShape.length === dy.rank,\n `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n\n let xShape4D = xShape as [number, number, number, number];\n let dy4D = dy as Tensor4D;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n\n const inDepth = xShape4D[3];\n const outDepth = dy4D.shape[3];\n util.assert(\n xShape4D.length === 4,\n `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(\n dy4D.rank === 4,\n `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(\n filter.rank === 4,\n `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n util.assert(\n inDepth === filter.shape[2],\n `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(\n outDepth === filter.shape[3],\n `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const dilations = 1;\n\n const convInfo = conv_util.computeConv2DInfo(\n xShape4D, filter.shape, strides, dilations, pad, dimRoundingMode);\n const res = ENV.engine.runKernel(\n backend => backend.conv2dDerInput(dy4D, filter, convInfo), {dy4D});\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. The\n * rounding mode used when computing output dimensions if pad is a\n * number. If none is provided, it will not round and error if the output\n * is of fractional size.\n */\nfunction conv2dDerFilter_(\n x: T, dy: T, filterShape: [number, number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): Tensor4D {\n let x4D = x as Tensor4D;\n if (x.rank === 3) {\n x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]);\n }\n let dy4D = dy as Tensor4D;\n if (dy4D.rank === 3) {\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(\n dy4D.rank === 4,\n `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(\n filterShape.length === 4,\n `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n util.assert(\n x4D.shape[3] === filterShape[2],\n `Error in conv2dDerFilter: depth of input ${x4D.shape[3]}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(\n dy4D.shape[3] === filterShape[3],\n `Error in conv2dDerFilter: depth of dy (${dy4D.shape[3]}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const dilations = 1;\n\n const convInfo = conv_util.computeConv2DInfo(\n x4D.shape, filterShape, strides, dilations, pad, dimRoundingMode);\n return ENV.engine.runKernel(\n backend => backend.conv2dDerFilter(x4D, dy4D, convInfo), {x4D, dy4D});\n}\n\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction conv2dTranspose_(\n x: T|TensorLike, filter: Tensor4D|TensorLike,\n outputShape: [number, number, number, number]|[number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n\n return conv2dDerInput_(\n outputShape, $x, $filter, strides, pad, dimRoundingMode);\n}\n\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction depthwiseConv2d_(\n x: T|TensorLike, filter: Tensor4D|TensorLike,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert(\n $filter.rank === 4,\n `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(\n x4D.shape[3] === $filter.shape[2],\n `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dilations == null) {\n dilations = [1, 1];\n }\n util.assert(\n eitherStridesOrDilationsAreOne(strides, dilations),\n 'Error in depthwiseConv2d: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const convInfo = conv_util.computeConv2DInfo(\n x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode,\n true /* depthwise */);\n\n const grad = (dy: Tensor4D) => {\n util.assert(\n tupleValuesAreOne(dilations),\n 'Error in gradient of depthwiseConv2d: dilation rates greater than ' +\n `1 are not yet supported. Got dilations '${dilations}'`);\n return {\n x: () => depthwiseConv2dDerInput(x4D.shape, dy, $filter, convInfo),\n $filter: () => depthwiseConv2dDerFilter(x4D, dy, $filter.shape, convInfo),\n };\n };\n\n const res = ENV.engine.runKernel(\n backend => backend.depthwiseConv2D(x4D, $filter, convInfo),\n {x: x4D, $filter}, grad);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction separableConv2d_(\n x: T|TensorLike, depthwiseFilter: Tensor4D|TensorLike,\n pointwiseFilter: Tensor4D|TensorLike, strides: [number, number]|number,\n pad: 'valid'|'same', dilation: [number, number]|number = [1, 1],\n dataFormat: 'NHWC'|'NCHW' = 'NHWC'): T {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter =\n convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter =\n convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n\n if (dataFormat === 'NCHW') {\n throw new Error(\n 'separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n\n util.assert(\n x4D.rank === 4,\n `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert(\n $depthwiseFilter.rank === 4,\n `Error in separableConv2d: depthwise filter must be rank 4, but got ` +\n `rank ${$depthwiseFilter.rank}.`);\n util.assert(\n $pointwiseFilter.rank === 4,\n `Error in separableConv2d: pointwise filter must be rank 4, but got ` +\n `rank ${$depthwiseFilter.rank}.`);\n util.assert(\n $pointwiseFilter.shape[0] === 1,\n `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert(\n $pointwiseFilter.shape[1] === 1,\n `Error in separableConv2d: the second dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert(\n $pointwiseFilter.shape[2] === inChannels * channelMultiplier,\n `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n\n const depthwise = depthwiseConv2d(\n x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res =\n conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\nfunction parseTupleParam(param: number|[number, number]): [number, number] {\n return typeof param === 'number' ? [param, param] : param;\n}\n\nfunction tupleValuesAreOne(param: number|[number, number]): boolean {\n const [dimA, dimB] = parseTupleParam(param);\n return dimA === 1 && dimB === 1;\n}\n\nfunction eitherStridesOrDilationsAreOne(\n strides: number|[number, number],\n dilations: number|[number, number]): boolean {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n\nfunction depthwiseConv2dDerInput(\n xShape: [number, number, number, number]|[number, number, number], dy: T,\n filter: Tensor4D, convInfo: conv_util.Conv2DInfo): T {\n let dy4D = dy as Tensor4D;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n }\n const res = ENV.engine.runKernel(\n backend => backend.depthwiseConv2DDerInput(dy4D, filter, convInfo),\n {dy4D});\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\nfunction depthwiseConv2dDerFilter(\n x: T, dy: T, filterShape: [number, number, number, number],\n convInfo: conv_util.Conv2DInfo): Tensor4D {\n let x4D = x as Tensor4D;\n if (x.rank === 3) {\n x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]);\n }\n let dy4D = dy as Tensor4D;\n if (dy4D.rank === 3) {\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n }\n return ENV.engine.runKernel(\n backend => backend.depthwiseConv2DDerFilter(x4D, dy4D, convInfo),\n {x4D, dy4D});\n}\n\nexport const conv1d = op({conv1d_});\nexport const conv2d = op({conv2d_});\nexport const depthwiseConv2d = op({depthwiseConv2d_});\nexport const separableConv2d = op({separableConv2d_});\nexport const conv2dTranspose = op({conv2dTranspose_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\n\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction matMul_(\n a: Tensor2D|TensorLike, b: Tensor2D|TensorLike, transposeA = false,\n transposeB = false): Tensor2D {\n const $a = convertToTensor(a, 'a', 'matMul');\n const $b = convertToTensor(b, 'b', 'matMul');\n\n const innerShapeA = transposeA ? $a.shape[0] : $a.shape[1];\n const innerShapeB = transposeB ? $b.shape[1] : $b.shape[0];\n\n util.assert(\n $a.rank === 2 && $b.rank === 2,\n `Error in matMul: inputs must be rank 2, got ranks ${$a.rank}` +\n ` and ${$b.rank}.`);\n\n util.assert(\n innerShapeA === innerShapeB,\n `Error in matMul: inner shapes (${innerShapeA}) and (` +\n `${innerShapeB}) of Tensors with shapes ${$a.shape} and ` +\n `${$b.shape} and transposeA=${transposeA}` +\n ` and transposeB=${transposeB} must match.`);\n\n const grad = (dy: Tensor2D) => {\n if (!transposeA && !transposeB) {\n return {\n $a: () => dy.matMul($b.toFloat(), false, true),\n $b: () => $a.toFloat().matMul(dy, true, false)\n };\n } else if (!transposeA && transposeB) {\n return {\n $a: () => dy.matMul($b.toFloat(), false, false),\n $b: () => dy.matMul($a.toFloat(), true, false)\n };\n } else if (transposeA && !transposeB) {\n return {\n $a: () => $b.toFloat().matMul(dy, false, true),\n $b: () => $a.toFloat().matMul(dy, false, false)\n };\n } else {\n return {\n $a: () => $b.toFloat().matMul(dy, true, true),\n $b: () => dy.matMul($a.toFloat(), true, true)\n };\n }\n };\n return ENV.engine.runKernel(\n backend => backend.matMul($a, $b, transposeA, transposeB), {$a, $b},\n grad);\n}\n\n/**\n * Computes the outer product of two vectors, v1 and v2.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([3, 4, 5]);\n *\n * tf.outerProduct(a, b).print();\n * ```\n * @param v1 The first vector in the outer product operation.\n * @param v2 The second vector in the dot product operation.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction outerProduct_(\n v1: Tensor1D|TensorLike, v2: Tensor1D|TensorLike): Tensor2D {\n const $v1 = convertToTensor(v1, 'v1', 'outerProduct');\n const $v2 = convertToTensor(v2, 'v2', 'outerProduct');\n\n util.assert(\n $v1.rank === 1 && $v2.rank === 1,\n `Error in outerProduct: inputs must be rank 1, but got ranks ` +\n `${$v1.rank} and ${$v2.rank}.`);\n\n return $v1.as2D(-1, 1).matMul($v2.as2D(1, -1));\n}\n\n/**\n * Computes the dot product of two matrices and/or vectors, t1 and t2.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction dot_(t1: Tensor|TensorLike, t2: Tensor|TensorLike): Tensor {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(\n ($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2),\n `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n\n util.assert(\n t1Inner === t2Inner,\n `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n\n if ($t1.rank === 1 && $t2.rank === 1) {\n return $t1.as2D(1, -1).matMul($t2.as2D(-1, 1)).asScalar();\n } else if ($t1.rank === 1 && $t2.rank === 2) {\n return $t1.as2D(1, -1).matMul($t2.as2D($t2.shape[0], $t2.shape[1])).as1D();\n } else if ($t1.rank === 2 && $t2.rank === 1) {\n return $t1.matMul($t2.as2D(-1, 1)).as1D();\n } else {\n return $t1.matMul($t2.as2D($t2.shape[0], $t2.shape[1]));\n }\n}\n\nexport const matMul = op({matMul_});\nexport const dot = op({dot_});\nexport const outerProduct = op({outerProduct_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {parseAxisParam} from './axis_util';\nimport {op} from './operation';\n\n/**\n * Reverses a `Tensor1D`.\n *\n * @param x The input tensor.\n */\nfunction reverse1d_(x: Tensor1D|TensorLike): Tensor1D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 1, `Error in reverse1D: x must be rank 1 but got\n rank ${$x.rank}.`);\n return reverse($x, 0);\n}\n\n/**\n * Reverses a `Tensor2D` along a specified axis\n *\n * @param x The input tensor.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\nfunction reverse2d_(x: Tensor2D|TensorLike, axis?: number|number[]): Tensor2D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 2, `Error in reverse2D: x must be rank 2 but got\n rank ${$x.rank}.`);\n return reverse($x, axis);\n}\n\n/**\n * Reverses a `Tensor3D` along a specified axis\n *\n * @param x The input tensor.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\nfunction reverse3d_(x: Tensor3D|TensorLike, axis?: number|number[]): Tensor3D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 3, `Error in reverse3D: x must be rank 3 but got\n rank ${$x.rank}.`);\n return reverse($x, axis);\n}\n\n/**\n * Reverses a `Tensor4D` along a specified axis\n *\n * @param x The input tensor.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\nfunction reverse4d_(x: Tensor4D|TensorLike, axis?: number|number[]): Tensor4D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 4, `Error in reverse4D: x must be rank 4 but got\n rank ${$x.rank}.`);\n return reverse($x, axis);\n}\n\n/**\n * Reverses a `Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction reverse_(\n x: T|TensorLike, axis?: number|number[]): T {\n const $x = convertToTensor(x, 'x', 'reverse');\n\n if ($x.rank === 0) {\n return $x.clone();\n }\n const axes = parseAxisParam(axis, $x.shape);\n const grad = (dy: T) => {\n return {$x: () => dy.reverse(axes)};\n };\n const res =\n ENV.engine.runKernel(backend => backend.reverse($x, axes), {$x}, grad);\n return res.reshapeAs($x);\n}\n\nexport const reverse = op({reverse_});\nexport const reverse1d = op({reverse1d_});\nexport const reverse2d = op({reverse2d_});\nexport const reverse3d = op({reverse3d_});\nexport const reverse4d = op({reverse4d_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport {op} from './operation';\n\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction maxPool_(\n x: T|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'maxPool');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const convInfo = conv_util.computePool2DInfo(\n x4D.shape, filterSize, strides, pad, dimRoundingMode);\n\n const grad = (dy: Tensor4D, saved: Tensor[]) => {\n const [y4D] = saved;\n return {\n x: () =>\n maxPoolBackprop(dy, x4D, y4D as Tensor4D, filterSize, strides, pad)\n };\n };\n\n const res = ENV.engine.runKernel(\n (backend, save) => save(backend.maxPool(x4D, convInfo)), {x: x4D}, grad);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction avgPool_(\n x: T|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'avgPool');\n util.assert(\n $x.dtype === 'float32', 'The input dtype to avgPool must be float32');\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const convInfo =\n conv_util.computePool2DInfo(x4D.shape, filterSize, strides, pad);\n\n const grad = (dy: Tensor4D) => {\n return {x: () => avgPoolBackprop(dy, x4D, filterSize, strides, pad)};\n };\n let res = ENV.engine.runKernel(\n backend => backend.avgPool(x4D, convInfo), {x: x4D}, grad);\n res = res.cast($x.dtype);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the backprop of a max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size, a tuple [filterHeight, filterWidth].\n * @param strides The strides of the pooling: [strideHeight, strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. The\n * rounding mode used when computing output dimensions if pad is a\n * number. If none is provided, it will not round and error if the output\n * is of fractional size.\n */\nfunction maxPoolBackprop(\n dy: Tensor4D|TensorLike, input: Tensor4D|TensorLike,\n output: Tensor4D|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): Tensor4D {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolBackprop');\n const $input = convertToTensor(input, 'input', 'maxPoolBackprop');\n const $output = convertToTensor(output, 'output', 'maxPoolBackprop');\n util.assert(\n $input.rank === $dy.rank,\n `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n\n util.assert(\n $dy.rank === 4,\n `Error in maxPoolBackprop: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert(\n $input.rank === 4,\n `Error in maxPoolBackprop: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in maxPoolBackprop: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const convInfo = conv_util.computePool2DInfo(\n $input.shape, filterSize, strides, pad, dimRoundingMode);\n const res = ENV.engine.runKernel(\n backend => backend.maxPoolBackprop($dy, $input, $output, convInfo),\n {$dy, $input});\n return res;\n}\n\n/**\n * Computes the backprop of an avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size, a tuple [filterHeight, filterWidth].\n * @param strides The strides of the pooling: [strideHeight, strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolBackprop(\n dy: T|TensorLike, input: T|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number): T {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolBackprop');\n const $input = convertToTensor(input, 'input', 'avgPoolBackprop');\n util.assert(\n $input.rank === $dy.rank,\n `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n\n let input4D = $input as Tensor4D;\n let dy4D = $dy as Tensor4D;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D = $input.as4D(1, $input.shape[0], $input.shape[1], $input.shape[2]);\n dy4D = $dy.as4D(1, $dy.shape[0], $dy.shape[1], $dy.shape[2]);\n }\n\n util.assert(\n dy4D.rank === 4,\n `Error in avgPoolBackprop: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(\n input4D.rank === 4,\n `Error in avgPoolBackprop: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n\n const convInfo =\n conv_util.computePool2DInfo(input4D.shape, filterSize, strides, pad);\n const res = ENV.engine.runKernel(\n backend => backend.avgPoolBackprop(dy4D, input4D, convInfo),\n {dy4D, input4D});\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\nexport const maxPool = op({maxPool_});\nexport const avgPool = op({avgPool_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {Rank, TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\nimport * as slice_util from './slice_util';\n\n/**\n * Extracts a 1D slice from 1D array starting at coordinates `begin` and is\n * of length `size`. See `slice` for details.\n */\nfunction slice1d_(\n x: Tensor1D|TensorLike, begin: number, size: number): Tensor1D {\n const $x = convertToTensor(x, 'x', 'slice1d');\n util.assert(\n $x.rank === 1,\n `slice1d expects a rank-1 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, [begin], [size]);\n}\n\n/**\n * Extracts a 2D slice from a 2D array starting at coordinates `begin` and\n * is of size `size`. See `slice` for details.\n */\nfunction slice2d_(\n x: Tensor2D|TensorLike, begin: [number, number],\n size: [number, number]): Tensor2D {\n const $x = convertToTensor(x, 'x', 'slice2d');\n util.assert(\n $x.rank === 2,\n `slice1d expects a rank-2 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, begin, size);\n}\n\n/**\n * Extracts a 3D slice from a 3D array starting at coordinates `begin` and\n * is of size `size`. See `slice` for details.\n */\nfunction slice3d_(\n x: Tensor3D|TensorLike, begin: [number, number, number],\n size: [number, number, number]): Tensor3D {\n const $x = convertToTensor(x, 'x', 'slice3d');\n util.assert(\n $x.rank === 3,\n `slice1d expects a rank-3 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, begin, size);\n}\n\n/**\n * Extracts a 4D slice from a 4D array starting at coordinates `begin` and\n * is of size `size`. See `slice` for details.\n */\nfunction slice4d_(\n x: Tensor4D|TensorLike, begin: [number, number, number, number],\n size: [number, number, number, number]): Tensor4D {\n const $x = convertToTensor(x, 'x', 'slice4d');\n util.assert(\n $x.rank === 4,\n `slice1d expects a rank-4 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, begin, size);\n}\n\n/**\n * Extracts a slice from a `Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction slice_>(\n x: T|TensorLike, begin: number|number[], size?: number|number[]): T {\n const $x = convertToTensor(x, 'x', 'slice');\n\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n // The following logic allows for more ergonomic calls.\n let begin_: number[];\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array($x.rank - 1).fill(0)];\n } else if (begin.length < $x.rank) {\n begin_ = begin.concat(new Array($x.rank - begin.length).fill(0));\n } else {\n begin_ = begin;\n }\n let size_: number[];\n if (size == null) {\n size_ = new Array($x.rank).fill(-1);\n } else if (typeof size === 'number') {\n size_ = [size, ...new Array($x.rank - 1).fill(-1)];\n } else if (size.length < $x.rank) {\n size_ = size.concat(new Array($x.rank - size.length).fill(-1));\n } else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n } else {\n util.assert(d === -1, 'Bad value in size');\n return $x.shape[i] - begin_[i];\n }\n });\n slice_util.assertParamsValid($x, begin_, size_);\n const inputShape = $x.shape;\n const grad = (dy: T) => {\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings: Array<[number, number]> = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return {$x: () => dy.pad(paddings)};\n };\n return ENV.engine.runKernel(\n backend => backend.slice($x, begin_, size_), {$x}, grad) as T;\n}\n\nexport const slice = op({slice_});\nexport const slice1d = op({slice1d_});\nexport const slice2d = op({slice2d_});\nexport const slice3d = op({slice3d_});\nexport const slice4d = op({slice4d_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Environment} from './environment';\nexport {customGrad, grad, grads, valueAndGrad, valueAndGrads, variableGrads} from './gradients';\n\nexport const tidy = Environment.tidy;\nexport const keep = Environment.keep;\nexport const dispose = Environment.dispose;\nexport const time = Environment.time;\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {customGrad} from '../globals';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as axis_util from './axis_util';\nimport {op} from './operation';\nimport {ones, scalar} from './tensor_ops';\n\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction logSumExp_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n\n const axes = axis_util.parseAxisParam(axis, $x.shape);\n const xMax = $x.max(axes, true /* keepDims */);\n const a = $x.sub(xMax);\n const b = a.exp();\n const c = b.sum(axes);\n const d = c.log();\n const res = xMax.reshape(d.shape).add(d);\n\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, axes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the sum of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If axes has no entries, all dimensions are reduced, and a `Tensor` with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction sum_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'sum');\n\n if ($x.dtype === 'bool') {\n $x = $x.toInt();\n }\n const axes = axis_util.parseAxisParam(axis, $x.shape);\n\n // Use a custom gradient to bypass 2 gradient backprops since sum is used\n // extremely often.\n const customOp = customGrad(x => {\n const permutation = axis_util.getAxesPermutation(axes, x.rank);\n let reductionAxes = axes;\n let permutedX = x;\n if (permutation != null) {\n permutedX = x.transpose(permutation);\n reductionAxes = axis_util.getInnerMostAxes(reductionAxes.length, x.rank);\n }\n let value = ENV.engine.runKernel(\n backend => backend.sum(permutedX, reductionAxes), {permutedX});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(value.shape, axes);\n value = value.reshape(newShape);\n }\n\n const gradFunc = (dy: Tensor) => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = dy.reshape(expandedDyShape);\n const derX = expandedDy.mul(ones(x.shape, 'float32'));\n return derX;\n };\n return {value, gradFunc};\n });\n\n return customOp($x) as T;\n}\n\n/**\n * Computes the mean of elements across dimensions of a `Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction mean_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n const $x = convertToTensor(x, 'x', 'mean');\n\n const axes = axis_util.parseAxisParam(axis, $x.shape);\n const shapes = axis_util.computeOutAndReduceShapes($x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n\n // Use a custom gradient to bypass 2 gradient backprops since mean is used\n // extremely often.\n const customOp = customGrad(x => {\n const reduceSizeScalar = scalar(reduceSize);\n // Cast if needed.\n const xReduce =\n reduceSizeScalar.dtype === x.dtype ? x : x.cast(reduceSizeScalar.dtype);\n const res = xReduce.div(reduceSizeScalar);\n const value = res.sum(axis, keepDims);\n\n const gradFunc = (dy: Tensor) => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = dy.reshape(expandedDyShape);\n const derX =\n expandedDy.mul(ones(x.shape, 'float32')).div(reduceSizeScalar);\n return derX;\n };\n return {value, gradFunc};\n });\n\n return customOp($x) as T;\n}\n\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction min_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'min');\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.min($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the maximum of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction max_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'max');\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.max($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction argMin_(x: Tensor|TensorLike, axis = 0): T {\n let $x = convertToTensor(x, 'x', 'argMin');\n\n if (axis == null) {\n axis = 0;\n }\n let axes = axis_util.parseAxisParam(axis, $x.shape);\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n return ENV.engine.runKernel(backend => backend.argMin($x, axes[0]), {$x}) as\n T;\n}\n\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction argMax_(x: Tensor|TensorLike, axis = 0): T {\n let $x = convertToTensor(x, 'x', 'argMax');\n\n if (axis == null) {\n axis = 0;\n }\n let axes = axis_util.parseAxisParam(axis, $x.shape);\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n return ENV.engine.runKernel(backend => backend.argMax($x, axes[0]), {$x}) as\n T;\n}\n\n/**\n * Computes the logical and of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1]);\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction all_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'all', 'bool');\n util.assert(\n $x.dtype === 'bool',\n `Error Tensor must be of type bool. Got: ${$x.dtype}`);\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.all($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the logical or of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1]);\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction any_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'any', 'bool');\n util.assert(\n $x.dtype === 'bool',\n `Error Tensor must be of type bool. Got: ${$x.dtype}`);\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.any($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Calculates the mean and variance of `x`. The mean and variance are\n * calculated by aggregating the contents of `x` across `axes`. If `x` is\n * 1-D and `axes = [0]` this is just the mean and variance of a vector.\n *\n * @param x The input tensor.\n * @param axis The dimension(s) along with to compute mean and\n * variance. By default it reduces all dimensions.\n * @param keepDims If true, the moments have the same dimensionality as the\n * input.\n * @return An object with two keys: `mean` and `variance`.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction moments_(\n x: Tensor|TensorLike, axis: number|number[] = null,\n keepDims = false): {mean: Tensor, variance: Tensor} {\n x = convertToTensor(x, 'x', 'moments');\n const axes = axis_util.parseAxisParam(axis, x.shape);\n const mean = x.mean(axes, keepDims);\n let keepDimsShape = mean.shape;\n if (!keepDims) {\n keepDimsShape = axis_util.expandShapeToKeepDim(mean.shape, axes);\n }\n const devSquared = x.toFloat().sub(mean.reshape(keepDimsShape)).square();\n const variance = devSquared.mean(axes, keepDims);\n return {mean, variance};\n}\n\nexport const all = op({all_});\n// tslint:disable-next-line:variable-name\nexport const any = op({any_});\nexport const argMax = op({argMax_});\nexport const argMin = op({argMin_});\nexport const logSumExp = op({logSumExp_});\nexport const max = op({max_});\nexport const mean = op({mean_});\nexport const min = op({min_});\nexport const moments = op({moments_});\nexport const sum = op({sum_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {assertTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assertShapesMatch} from '../util';\nimport {assertAndGetBroadcastShape} from './broadcast_util';\nimport {op} from './operation';\n\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * We also expose `notEqualStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction notEqual_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'notEqual');\n const $b = convertToTensor(b, 'b', 'notEqual');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n return ENV.engine.runKernel(backend => backend.notEqual($a, $b), {$a, $b}) as\n T;\n}\n\n/**\n * Strict version of `notEqual` that forces `a` and `b` to be of the same\n * shape.\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same shape and dtype as\n * `a`.\n */\nfunction notEqualStrict_(\n a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'notEqualStrict');\n const $b = convertToTensor(b, 'b', 'notEqualStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in notEqualStrict: ');\n return $a.notEqual($b);\n}\n\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * We also expose `lessStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction less_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'less');\n const $b = convertToTensor(b, 'b', 'less');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.less($a, $b), {$a, $b}) as T;\n}\n\n/**\n * Strict version of `less` that forces `a` and `b` to be of the same\n * shape.\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same shape and dtype as\n * `a`.\n */\nfunction lessStrict_(a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'lessStrict');\n const $b = convertToTensor(b, 'b', 'lessStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in lessStrict: ');\n return $a.less($b);\n}\n\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * We also expose `equalStrict` which has the same signature as this op\n * and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction equal_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'equal');\n const $b = convertToTensor(b, 'b', 'equal');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.equal($a, $b), {$a, $b}) as T;\n}\n\nfunction equalStrict_(a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'equalStrict');\n const $b = convertToTensor(b, 'b', 'equalStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in equalStrict: ');\n return $a.equal($b);\n}\n\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * We also expose `lessEqualStrict` which has the same signature as this op\n * and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction lessEqual_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'lessEqual');\n const $b = convertToTensor(b, 'b', 'lessEqual');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.lessEqual($a, $b), {$a, $b}) as\n T;\n}\n\nfunction lessEqualStrict_(\n a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'lessEqualStrict');\n const $b = convertToTensor(b, 'b', 'lessEqualStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in lessEqualStrict: ');\n return $a.lessEqual($b);\n}\n\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * We also expose `greaterStrict` which has the same signature as this\n * op and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction greater_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greater');\n const $b = convertToTensor(b, 'b', 'greater');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.greater($a, $b), {$a, $b}) as\n T;\n}\n\nfunction greaterStrict_(a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greaterStrict');\n const $b = convertToTensor(b, 'b', 'greaterStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in greaterStrict: ');\n return $a.greater($b);\n}\n\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * We also expose `greaterEqualStrict` which has the same signature as this\n * op and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction greaterEqual_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greaterEqual');\n const $b = convertToTensor(b, 'b', 'greaterEqual');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(\n backend => backend.greaterEqual($a, $b), {$a, $b}) as T;\n}\n\nfunction greaterEqualStrict_(\n a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greaterEqualStrict');\n const $b = convertToTensor(b, 'b', 'greaterEqualStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in greaterEqualStrict: ');\n return $a.greaterEqual($b);\n}\n\nexport const equal = op({equal_});\nexport const equalStrict = op({equalStrict_});\nexport const greater = op({greater_});\nexport const greaterEqual = op({greaterEqual_});\nexport const greaterEqualStrict = op({greaterEqualStrict_});\nexport const greaterStrict = op({greaterStrict_});\nexport const less = op({less_});\nexport const lessEqual = op({lessEqual_});\nexport const lessEqualStrict = op({lessEqualStrict_});\nexport const lessStrict = op({lessStrict_});\nexport const notEqual = op({notEqual_});\nexport const notEqualStrict = op({notEqualStrict_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {KernelBackend} from '../kernels/backend';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {assertTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike, upcastType} from '../types';\nimport * as util from '../util';\nimport * as broadcast_util from './broadcast_util';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\nimport {neg} from './unary_ops';\n\n/**\n * Adds two `Tensor`s element-wise, A + B. Supports broadcasting.\n *\n * We also expose `addStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `Tensor` to add.\n * @param b The second `Tensor` to add. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction add_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'add');\n const $b = convertToTensor(b, 'b', 'add');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($b.shape);\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(backend => backend.add($a, $b), {$a, $b}, der) as\n T;\n}\n\n/**\n * Adds a list of `Tensor`s element-wise, each with the same shape and dtype.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n *\n * tf.addN([a, b, c]).print();\n * ```\n * @param tensors A list of tensors with the same shape and dtype.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction addN_(tensors: Array): T {\n util.assert(\n Array.isArray(tensors),\n () => 'The param passed to tf.addN() must be a list of tensors');\n util.assert(\n tensors.length >= 1,\n () => `Must pass at least one tensor to tf.addN(), but got ` +\n `${tensors.length}`);\n const $tensors =\n tensors.map((t, i) => convertToTensor(t, `tensors${i}`, 'addN'));\n const firstTensor = $tensors[0];\n $tensors.forEach(t => {\n if (t.dtype !== firstTensor.dtype) {\n throw new Error(\n 'All tensors passed to tf.addN() must have the same dtype');\n }\n });\n $tensors.forEach(t => {\n if (!util.arraysEqual(t.shape, firstTensor.shape)) {\n throw new Error(\n 'All tensors passed to tf.addN() must have the same shape');\n }\n });\n\n const der = (dy: T) => {\n const ders: {[key: string]: () => Tensor} = {};\n $tensors.forEach((t, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n };\n const inputs: NamedTensorMap = $tensors as {} as NamedTensorMap;\n return ENV.engine.runKernel(backend => backend.addN($tensors), inputs, der);\n}\n\n/**\n * Adds two `Tensor`s element-wise, A + B.\n *\n * Inputs must be the same shape. For broadcasting support, use add() instead.\n *\n * @param a The first Tensor to add element-wise.\n * @param b The second Tensor to add element-wise.\n */\nfunction addStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in addStrict: ');\n return a.add(b);\n}\n\n/**\n * Subtracts two `Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * We also expose `subStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `Tensor` to subtract from.\n * @param b The second `Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction sub_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'sub');\n const $b = convertToTensor(b, 'b', 'sub');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.neg().reshape($b.shape);\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.subtract($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Subtracts two `Tensor`s element-wise, A - B. Inputs must\n * be the same shape.\n *\n * For broadcasting support, use sub() instead.\n *\n * @param a The first Tensor to subtract element-wise.\n * @param b The second Tensor to subtract element-wise.\n */\nfunction subStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in subStrict: ');\n return a.sub(b);\n}\n\n/**\n * Computes the power of one `Tensor` to another. Supports broadcasting.\n *\n * Given a `Tensor` x and a `Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `Tensor` to pow element-wise.\n * @param exp The exponent `Tensor` to pow element-wise.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction pow_(base: T|TensorLike, exp: Tensor|TensorLike): T {\n const $base = convertToTensor(base, 'base', 'pow');\n const $exp = convertToTensor(exp, 'exp', 'pow');\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($base.shape, $exp.shape);\n base = $base.cast(upcastType($base.dtype, $exp.dtype));\n exp = $exp.cast(upcastType($base.dtype, $exp.dtype));\n const grad = (dy: Tensor, saved: Tensor[]) => {\n const [y] = saved;\n const derBase = () => {\n let res = dy.mul($exp.toFloat().mul(y.div($base)));\n const reduceAxes = broadcast_util.getReductionAxes($base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($base.shape) as T;\n };\n const derExp = () => {\n let res = dy.mul(y.mul($base.log()).toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($exp.shape);\n };\n return {$base: derBase, $exp: derExp};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.pow($base, $exp)), {$base, $exp},\n grad) as T;\n}\n\n/**\n * Computes the power of one `Tensor` to another. Inputs must\n * be the same shape.\n *\n * For broadcasting support, use pow() instead.\n *\n * @param base The base tensor to pow element-wise.\n * @param exp The exponent tensor to pow element-wise.\n */\nfunction powStrict_(base: T, exp: Tensor): T {\n util.assertShapesMatch(base.shape, exp.shape, 'Error in powStrict: ');\n return base.pow(exp);\n}\n\n/**\n * Multiplies two `Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction mul_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'mul');\n const $b = convertToTensor(b, 'b', 'mul');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n const res = dy.mul($b.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = dy.mul($a.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($b.shape);\n }\n return res;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.multiply($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Multiplies two `Tensor`s element-wise, A * B.\n *\n * Inputs must be the same shape. For broadcasting support, use mul().\n *\n * @param a The first tensor to multiply.\n * @param b The first tensor to multiply. Must have the same\n * dtype as `a`.\n */\nfunction mulStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in multiplyStrict: ');\n return a.mul(b) as T;\n}\n\n/**\n * Divides two `Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * We also expose `divStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction div_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'div');\n const $b = convertToTensor(b, 'b', 'div');\n assertTypesMatch($a, $b);\n\n let forwardFunc: (backend: KernelBackend) => Tensor;\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n } else {\n forwardFunc = (backend: KernelBackend) => backend.realDivide($a, $b);\n }\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => {\n const res = dy.div($b.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = dy.mul($a.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes).reshape($b.shape);\n }\n const tmp = $b.square() as Tensor;\n return res.div(tmp.toFloat()).neg() as Tensor;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(forwardFunc, {$a, $b}, der) as T;\n}\n\n/**\n * Divides two `Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction floorDiv_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'floorDiv');\n const $b = convertToTensor(b, 'b', 'floorDiv');\n assertTypesMatch($a, $b);\n\n const forwardFunc = (backend: KernelBackend) => backend.floorDiv($a, $b);\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => {\n const res = dy.div($b.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = dy.mul($a.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes).reshape($b.shape);\n }\n const tmp = $b.square() as Tensor;\n return res.div(tmp.toFloat()).neg() as Tensor;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(forwardFunc, {$a, $b}, der) as T;\n}\n\n/**\n * Divides two `Tensor`s element-wise, A / B. Inputs must\n * be the same shape.\n *\n * @param a The first tensor as the numerator for element-wise division.\n * @param b The second tensor as the denominator for element-wise division.\n */\nfunction divStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in divideStrict: ');\n return a.div(b) as T;\n}\n\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction mod_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'mod');\n const $b = convertToTensor(b, 'b', 'mod');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => {\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return dy.sum(reduceAxes).reshape($a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = dy.mul($a.div($b).floor().neg());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($b.shape);\n }\n return res;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(backend => backend.mod($a, $b), {$a, $b}, der) as\n T;\n}\n\n/**\n * Returns the mod of a and b (`a < b ? a : b`) element-wise. Inputs must\n * be the same shape. For broadcasting support, use mod().\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n */\nfunction modStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in modStrict: ');\n return a.mod(b);\n}\n\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction minimum_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n assertTypesMatch($a, $b);\n\n if ($a.dtype === 'bool') {\n $a = $a.toInt();\n }\n if ($b.dtype === 'bool') {\n $b = $b.toInt();\n }\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => dy.mul($a.lessEqual($b).toFloat());\n const derB = () => dy.mul($a.greater($b).toFloat());\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.minimum($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise. Inputs must\n * be the same shape. For broadcasting support, use minimum().\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n */\nfunction minimumStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: ');\n return a.minimum(b);\n}\n\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction maximum_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n assertTypesMatch($a, $b);\n\n if ($a.dtype === 'bool') {\n $a = $a.toInt();\n }\n if ($b.dtype === 'bool') {\n $b = $b.toInt();\n }\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => dy.mul($a.greaterEqual($b).toFloat());\n const derB = () => dy.mul($a.less($b).toFloat());\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.maximum($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise. Inputs must\n * be the same shape. For broadcasting support, use maximum().\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n */\nfunction maximumStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: ');\n return a.maximum(b);\n}\n\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * We also expose `squaredDifferenceStrict` which has the same signature as\n * this op and asserts that `a` and `b` are the same shape (does not\n * broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction squaredDifference_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'squaredDifference');\n const $b = convertToTensor(b, 'b', 'squaredDifference');\n assertTypesMatch($a, $b);\n\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const two = scalar(2);\n const derA = () => dy.mul($a.sub($b).mul(two));\n const derB = () => dy.mul($b.sub($a).mul(two));\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.squaredDifference($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Returns (a - b) * (a - b) element-wise.\n *\n * Inputs must be the same shape. For broadcasting support, use\n * squaredDifference() instead.\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\nfunction squaredDifferenceStrict_(a: T, b: T): T {\n util.assertShapesMatch(\n a.shape, b.shape, 'Error in squaredDifferenceStrict: ');\n return a.squaredDifference(b);\n}\n\n/**\n * Computes arctangent of `Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction atan2_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'atan2');\n const $b = convertToTensor(b, 'b', 'atan2');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n const d = add($a.square(), $b.square());\n let res = dy.mul($b.div(d));\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($a.shape);\n };\n const derB = () => {\n const d = add($a.square(), $b.square()) as T;\n let res = neg(dy.mul($a.div(d)));\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($b.shape);\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.atan2($a, $b), {$a, $b}, der) as T;\n}\n\nexport const add = op({add_});\nexport const addN = op({addN_});\nexport const addStrict = op({addStrict_});\nexport const atan2 = op({atan2_});\nexport const div = op({div_});\nexport const divStrict = op({divStrict_});\nexport const floorDiv = op({floorDiv_});\nexport const maximum = op({maximum_});\nexport const maximumStrict = op({maximumStrict_});\nexport const minimum = op({minimum_});\nexport const minimumStrict = op({minimumStrict_});\nexport const mod = op({mod_});\nexport const modStrict = op({modStrict_});\nexport const mul = op({mul_});\nexport const mulStrict = op({mulStrict_});\nexport const pow = op({pow_});\nexport const powStrict = op({powStrict_});\nexport const squaredDifference = op({squaredDifference_});\nexport const squaredDifferenceStrict = op({squaredDifferenceStrict_});\nexport const sub = op({sub_});\nexport const subStrict = op({subStrict_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {whereImpl} from '../kernels/where_impl';\nimport {Tensor, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assert, assertShapesMatch} from '../util';\nimport {assertAndGetBroadcastShape} from './broadcast_util';\nimport {op} from './operation';\nimport {zerosLike} from './tensor_ops';\n\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalNot_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n assert($x.dtype === 'bool', 'Error Array must be of type bool.');\n\n return ENV.engine.runKernel(backend => backend.logicalNot($x), {$x});\n}\n\n/**\n * Returns the truth value of a AND b element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalAnd_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assert(\n $a.dtype === 'bool' && $b.dtype === 'bool',\n 'Error Array must be of type bool.');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(\n backend => backend.logicalAnd($a, $b), {$a, $b}) as T;\n}\n\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalOr_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assert(\n $a.dtype === 'bool' && $b.dtype === 'bool',\n 'Error Array must be of type bool.');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.logicalOr($a, $b), {$a, $b}) as\n T;\n}\n\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalXor_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assert(\n $a.dtype === 'bool' && $b.dtype === 'bool',\n 'Error Array must be of type bool.');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n // x ^ y = (x | y) & ~(x & y)\n return logicalOr(a, b).logicalAnd(logicalAnd(a, b).logicalNot()) as T;\n}\n\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same shape and type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction where_(\n condition: Tensor|TensorLike, a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n\n assert($condition.dtype === 'bool', 'Error Condition must be of type bool.');\n assertShapesMatch($a.shape, $b.shape, 'Error in where: ');\n\n if ($condition.rank === 1) {\n // If condition rank is 1, then the first dimension must match the size of\n // condition.\n assert(\n $condition.shape[0] === $a.shape[0],\n 'The first dimension of `a` must match the size of `condition`.');\n } else {\n // A must have the same shape as condition.\n assertShapesMatch($condition.shape, $b.shape, 'Error in where: ');\n }\n\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n const grad = (dy: T) => ({\n $condition: () => zerosLike($condition),\n $a: () => dy.mul($condition.cast($a.dtype)) as T,\n $b: () => dy.mul($condition.logicalNot().cast($b.dtype)) as T\n });\n\n return ENV.engine.runKernel(\n backend => backend.select($condition, $a, $b),\n {$condition, $a, $b}, grad) as T;\n}\n\n/**\n * Returns the coordinates of true elements of condition.\n *\n * The coordinates are returned in a 2-D tensor where the first dimension (rows)\n * represents the number of true elements, and the second dimension (columns)\n * represents the coordinates of the true elements. Keep in mind, the shape of\n * the output tensor can vary depending on how many true values there are in\n * input. Indices are output in row-major order. The resulting tensor has the\n * shape `[numTrueElems, condition.rank]`.\n */\nasync function whereAsync_(condition: Tensor|TensorLike): Promise {\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n assert($condition.dtype === 'bool', 'Condition must be of type bool.');\n const vals = await $condition.data();\n const res = whereImpl($condition.shape, vals);\n if (condition !== $condition) {\n $condition.dispose();\n }\n return res;\n}\n\nexport const logicalAnd = op({logicalAnd_});\nexport const logicalNot = op({logicalNot_});\nexport const logicalOr = op({logicalOr_});\nexport const logicalXor = op({logicalXor_});\nexport const where = op({where_});\nexport const whereAsync = whereAsync_;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {maximum, minimum} from './binary_ops';\nimport {where} from './logical_ops';\nimport {op} from './operation';\nimport {SELU_SCALE, SELU_SCALEALPHA} from './selu_util';\nimport {scalar} from './tensor_ops';\n\n/**\n * Computes rectified linear element-wise: `max(x, 0)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction relu_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'relu');\n\n if ($x.dtype === 'bool') {\n return $x.toInt();\n }\n const grad = (dy: T) => {\n const stepRes = $x.step();\n return {$x: () => dy.mulStrict(stepRes.toFloat())};\n };\n return ENV.engine.runKernel(backend => backend.relu($x), {$x}, grad);\n}\n\n/**\n * Computes exponential linear element-wise, `x > 0 ? e ^ x - 1 : 0`\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction elu_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'elu');\n\n const grad = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {\n $x: () =>\n ENV.engine.runKernel(backend => backend.eluDer(dy, y), {dy, y}) as T\n };\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.elu($x)), {$x}, grad);\n}\n\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction selu_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'selu');\n\n const grad = (dy: T) => {\n return {\n $x: () => {\n const mask = $x.greater(scalar(0));\n\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n\n const greaterThanZeroDer = dy.mul(scale);\n const lessEqualZeroDer = dy.mul(scaleAlpha).mul($x.toFloat().exp());\n\n return where(mask, greaterThanZeroDer, lessEqualZeroDer) as T;\n }\n };\n };\n return ENV.engine.runKernel(backend => backend.selu($x), {$x}, grad);\n}\n\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction leakyRelu_(x: T|TensorLike, alpha = 0.2): T {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n return maximum(scalar(alpha).mul($x), $x);\n}\n\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction prelu_(x: T|TensorLike, alpha: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n\n const zero = scalar(0);\n return maximum(zero, $x).add($alpha.mul(minimum(zero, $x)));\n}\n\nexport const elu = op({elu_});\nexport const leakyRelu = op({leakyRelu_});\nexport const prelu = op({prelu_});\nexport const relu = op({relu_});\nexport const selu = op({selu_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as axis_util from './axis_util';\nimport {op} from './operation';\n\n/**\n * Transposes the `Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction transpose_(x: T|TensorLike, perm?: number[]): T {\n const $x = convertToTensor(x, 'x', 'transpose');\n\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert(\n $x.rank === perm.length,\n `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(\n axis >= 0 && axis < $x.rank,\n `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n\n if ($x.rank <= 1) {\n return $x.clone();\n }\n\n const der = (dy: T) => {\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return {$x: () => dy.transpose(undoPerm)};\n };\n return ENV.engine.runKernel(\n backend => backend.transpose($x, perm), {$x}, der);\n}\n\nexport const transpose = op({transpose_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\n\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction localResponseNormalization_(\n x: T|TensorLike, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5): T {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert(\n $x.rank === 4 || $x.rank === 3,\n `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(\n util.isInt(depthRadius),\n `Error in localResponseNormalization: depthRadius must be an integer\n but got depthRadius ${depthRadius}.`);\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n const backward = (dy: Tensor4D, saved: Tensor[]) => {\n const [outputImage] = saved;\n return {\n x4D: () => ENV.engine.runKernel(\n backend => backend.LRNGrad(\n dy, x4D, outputImage as Tensor4D, depthRadius, bias, alpha, beta),\n {})\n };\n };\n const res = ENV.engine.runKernel(\n (backend, save) => save(backend.localResponseNormalization4D(\n x4D, depthRadius, bias, alpha, beta)),\n {x4D}, backward);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n } else {\n return res as T;\n }\n}\n\nexport const localResponseNormalization = op({localResponseNormalization_});","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as axis_util from './axis_util';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\n\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction norm_(\n x: Tensor|TensorLike, ord: number|'euclidean'|'fro' = 'euclidean',\n axis: number|number[] = null, keepDims = false): Tensor {\n x = convertToTensor(x, 'x', 'norm');\n\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = axis_util.parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return norm.reshape(keepDimsShape);\n}\n\nfunction normImpl(\n x: Tensor, p: number|string, axis: number|number[] = null): Tensor {\n if (x.rank === 0) {\n return x.abs();\n }\n\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(x.reshape([-1]), p, axis);\n }\n\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n axis instanceof Array && axis.length === 1) {\n if (p === 1) {\n return x.abs().sum(axis);\n }\n if (p === Infinity) {\n return x.abs().max(axis);\n }\n if (p === -Infinity) {\n return x.abs().min(axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return x.abs().pow(scalar(2, 'int32')).sum(axis).sqrt() as Tensor;\n }\n\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n\n // matrix (assumption axis[0] < axis[1])\n if (axis instanceof Array && axis.length === 2) {\n if (p === 1) {\n return x.abs().sum(axis[0]).max(axis[1] - 1);\n }\n if (p === Infinity) {\n return x.abs().sum(axis[1]).max(axis[0]);\n }\n if (p === -Infinity) {\n return x.abs().sum(axis[1]).min(axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return x.square().sum(axis).sqrt();\n }\n\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\n\nexport const norm = op({norm_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assert, isInt} from '../util';\nimport {expandDims} from './array_ops';\nimport {getUndoAxesPermutation, parseAxisParam} from './axis_util';\nimport {maximum} from './binary_ops';\nimport {greaterEqual} from './compare';\nimport {logicalAnd, where} from './logical_ops';\nimport {op} from './operation';\nimport {ones, scalar, zerosLike} from './tensor_ops';\n\n/**\n * Computes the sum along segments of a `Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `Tensor` that will be summed along its segments\n * @param segmentIds A `Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`\n */\n/** @doc {heading: 'Operations', subheading: 'Segment'} */\nfunction unsortedSegmentSum_(\n x: T|TensorLike, segmentIds: Tensor1D|TensorLike, numSegments: number): T {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds =\n convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert($segmentIds.dtype === 'int32', 'segmentIds must be of dtype `int32`');\n assert(isInt(numSegments), 'numSegments must be of dtype int');\n\n const gradFunc = (dy: T) => {\n const derX = () => {\n return gatherDropNegatives(dy, $segmentIds);\n };\n return {$x: derX};\n };\n return ENV.engine.runKernel(\n backend =>\n backend.unsortedSegmentSum($x, $segmentIds, numSegments),\n {$x}, gradFunc) as T;\n}\n\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction gather_(\n x: T|TensorLike, indices: Tensor1D|TensorLike, axis = 0): T {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n\n assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`');\n axis = parseAxisParam(axis, $x.shape)[0];\n const grad = (dy: T) => {\n const derX = () => {\n if (axis === 0) {\n return unsortedSegmentSum(dy, $indices, $x.shape[axis]);\n }\n const paramsShape = $x.shape;\n const indicesSize = $indices.size;\n\n const outerShape = paramsShape.slice(0, axis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices =\n arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n\n const values = dy.reshape(valuesShape);\n const reshapedIndices = $indices.reshape([indicesSize]);\n\n const transposeDims =\n arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = values.transpose(transposeDims);\n\n let paramsGrad = unsortedSegmentSum(\n valuesTranspose, reshapedIndices as Tensor1D, $x.shape[axis]);\n\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = paramsGrad.transpose(invertTransposeDims);\n\n return paramsGrad as T;\n };\n return {$x: derX};\n };\n return ENV.engine.runKernel(\n backend => backend.gather($x, $indices as Tensor1D, axis), {$x},\n grad) as T;\n}\n\nfunction arrayRange(start: number, stop: number): number[] {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\n\nfunction arrayConcat(arrays: number[][]): number[] {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n\nfunction gatherDropNegatives(x: T, indices: Tensor1D) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices as Tensor1D);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n\nexport const gather = op({gather_});\nexport const unsortedSegmentSum = op({unsortedSegmentSum_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Scalar, Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor, convertToTensorArray} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * @docalias (data: Tensor2D, c: Tensor2D, h: Tensor2D): [Tensor2D, Tensor2D]\n */\nexport type LSTMCellFunc = {\n (data: Tensor2D, c: Tensor2D, h: Tensor2D): [Tensor2D, Tensor2D];\n};\n\n/**\n * Computes the next states and outputs of a stack of LSTMCells.\n *\n * Each cell output is used as input to the next cell.\n *\n * Returns `[cellState, cellOutput]`.\n *\n * Derived from tf.contrib.rn.MultiRNNCell.\n *\n * @param lstmCells Array of LSTMCell functions.\n * @param data The input to the cell.\n * @param c Array of previous cell states.\n * @param h Array of previous cell outputs.\n */\n/** @doc {heading: 'Operations', subheading: 'RNN'} */\nfunction multiRNNCell_(\n lstmCells: LSTMCellFunc[], data: Tensor2D|TensorLike,\n c: Tensor2D[]|TensorLike[],\n h: Tensor2D[]|TensorLike[]): [Tensor2D[], Tensor2D[]] {\n const $data = convertToTensor(data, 'data', 'multiRNNCell');\n const $c = convertToTensorArray(c, 'c', 'multiRNNCell');\n const $h = convertToTensorArray(h, 'h', 'multiRNNCell');\n\n let input = $data;\n const newStates = [];\n for (let i = 0; i < lstmCells.length; i++) {\n const output = lstmCells[i](input, $c[i], $h[i]);\n newStates.push(output[0]);\n newStates.push(output[1]);\n input = output[1];\n }\n const newC: Tensor2D[] = [];\n const newH: Tensor2D[] = [];\n for (let i = 0; i < newStates.length; i += 2) {\n newC.push(newStates[i]);\n newH.push(newStates[i + 1]);\n }\n return [newC, newH];\n}\n\n/**\n * Computes the next state and output of a BasicLSTMCell.\n *\n * Returns `[newC, newH]`.\n *\n * Derived from tf.contrib.rnn.BasicLSTMCell.\n *\n * @param forgetBias Forget bias for the cell.\n * @param lstmKernel The weights for the cell.\n * @param lstmBias The bias for the cell.\n * @param data The input to the cell.\n * @param c Previous cell state.\n * @param h Previous cell output.\n */\n/** @doc {heading: 'Operations', subheading: 'RNN'} */\nfunction basicLSTMCell_(\n forgetBias: Scalar|TensorLike, lstmKernel: Tensor2D|TensorLike,\n lstmBias: Tensor1D|TensorLike, data: Tensor2D|TensorLike,\n c: Tensor2D|TensorLike, h: Tensor2D|TensorLike): [Tensor2D, Tensor2D] {\n const $forgetBias =\n convertToTensor(forgetBias, 'forgetBias', 'basicLSTMCell');\n const $lstmKernel =\n convertToTensor(lstmKernel, 'lstmKernel', 'basicLSTMCell');\n const $lstmBias = convertToTensor(lstmBias, 'lstmBias', 'basicLSTMCell');\n const $data = convertToTensor(data, 'data', 'basicLSTMCell');\n const $c = convertToTensor(c, 'c', 'basicLSTMCell');\n const $h = convertToTensor(h, 'h', 'basicLSTMCell');\n\n const combined = $data.concat($h, 1);\n const weighted = combined.matMul($lstmKernel);\n const res = weighted.add($lstmBias) as Tensor2D;\n\n // i = input_gate, j = new_input, f = forget_gate, o = output_gate\n const batchSize = res.shape[0];\n const sliceCols = res.shape[1] / 4;\n const sliceSize: [number, number] = [batchSize, sliceCols];\n const i = res.slice([0, 0], sliceSize);\n const j = res.slice([0, sliceCols], sliceSize);\n const f = res.slice([0, sliceCols * 2], sliceSize);\n const o = res.slice([0, sliceCols * 3], sliceSize);\n\n const newC = i.sigmoid().mulStrict(j.tanh()).addStrict(\n $c.mulStrict($forgetBias.add(f).sigmoid() as Tensor2D));\n const newH = newC.tanh().mulStrict(o.sigmoid());\n return [newC, newH];\n}\n\nexport const basicLSTMCell = op({basicLSTMCell_});\nexport const multiRNNCell = op({multiRNNCell_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Scalar, Tensor} from '../tensor';\nimport {assertTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {pow} from './binary_ops';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\n\n/**\n * Compute the moving average of a variable.\n *\n * Without zeroDebias, the moving average operation is defined by:\n * `v += delta`\n * where\n * `delta = (1 - decay) * (x - v)`\n *\n * With zeroDebias (default), the `delta` term is scaled to debias the\n * effect of the (assumed) zero-initialization of `v`.\n * `delta /= (1 - decay ^ step)`\n *\n * For more details on the zero-debiasing algorithm, see:\n * https://arxiv.org/abs/1412.6980\n *\n * Note that this function is completely stateless and does not keep track of\n * step count. The step count needs to be maintained by the caller and passed\n * in as `step`.\n *\n * @param v The current moving average value.\n * @param x New input value, must have the same shape and dtype as `v`.\n * @param decay The decay factor. Typical values are 0.95 and 0.99.\n * @param step Step count.\n * @param zeroDebias: Whether zeroDebias is to be performed (default: `true`).\n * @returns The new moving average value.\n */\n/** @doc {heading: 'Operations', subheading: 'Moving Average'} */\nfunction movingAverage_(\n v: T|TensorLike, x: T|TensorLike, decay: number|Scalar,\n step?: number|Scalar, zeroDebias = true): T {\n const $v = convertToTensor(v, 'v', 'movingAverage');\n const $x = convertToTensor(x, 'x', 'movingAverage');\n const $decay = convertToTensor(decay, 'decay', 'movingAverage');\n\n assertTypesMatch($v, $x);\n util.assert(\n util.arraysEqual($v.shape, $x.shape), 'Shape mismatch in v and x');\n\n const one = scalar(1);\n const oneMinusDecay = one.sub($decay);\n\n let update = $x.sub($v).mul(oneMinusDecay);\n if (zeroDebias) {\n util.assert(step != null, 'When using zeroDebias: true, step is required.');\n const $step = convertToTensor(step, 'step', 'movingAverage');\n update = update.div(one.sub(pow($decay, $step)));\n }\n return $v.add(update);\n}\n\nexport const movingAverage = op({movingAverage_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input_ tensor. Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of begin_mask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of end_mask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n */\n/** @doc {heading: 'Operations', subheading: 'Slicing and Joining'} */\nfunction stridedSlice_(\n x: T|TensorLike, begin: number[], end: number[], strides: number[],\n beginMask = 0, endMask = 0): T {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n return ENV.engine.runKernel(\n backend => backend.stridedSlice(\n $x, begin, end, strides, beginMask, endMask),\n {$x}) as T;\n}\n\nexport const stridedSlice = op({stridedSlice_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n */\n/** @doc {heading: 'Operations', subheading: 'Evaluation'} */\nfunction topk_(\n x: T|TensorLike, k = 1, sorted = true): {values: T, indices: T} {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(\n `'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n\n const [values, indices] =\n ENV.engine.runKernel(b => b.topk($x, k, sorted), {$x});\n return {values, indices};\n}\n\nexport const topk = op({topk_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {customGrad} from '../globals';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assertShapesMatch, sizeFromShape} from '../util';\n\nimport {expandShapeToKeepDim} from './axis_util';\n\nimport {minimum} from './binary_ops';\nimport {op} from './operation';\nimport {ones, scalar} from './tensor_ops';\n\nexport enum Reduction {\n NONE,\n MEAN,\n SUM,\n SUM_BY_NONZERO_WEIGHTS\n}\n\n/**\n * Computes the weighted loss between two tensors.\n *\n * @param losses Tensor of shape `[batch_size, d1, ... dN]`.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `losses`, and must be broadcastable to `losses` (i.e., all\n * dimensions must be either `1`, or the same as the corresponding\n * `losses` dimension).\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction computeWeightedLoss_(\n losses: T|TensorLike, weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $losses = convertToTensor(losses, 'losses', 'computeWeightedLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'computeWeightedLoss');\n }\n\n const weightedLoss = ($weights == null) ? $losses : $losses.mul($weights);\n\n if (reduction === Reduction.NONE) {\n return weightedLoss as O;\n }\n if (reduction === Reduction.SUM) {\n return weightedLoss.sum();\n }\n if (reduction === Reduction.MEAN) {\n if ($weights == null) {\n return weightedLoss.mean();\n } else {\n const broadcastFactor =\n sizeFromShape($losses.shape) / sizeFromShape($weights.shape);\n const result = weightedLoss.sum().div($weights.sum());\n return broadcastFactor > 1 ? result.div(scalar(broadcastFactor)) :\n result as O;\n }\n }\n if (reduction === Reduction.SUM_BY_NONZERO_WEIGHTS) {\n if ($weights == null) {\n return weightedLoss.sum().div(scalar($losses.size));\n } else {\n const broadcastedWeights = $weights.mul(ones($losses.shape));\n\n const numNonZeros =\n broadcastedWeights.notEqual(scalar(0)).sum().toFloat();\n return weightedLoss.sum().div(numNonZeros);\n }\n }\n\n throw Error(`Unknown reduction: ${reduction}`);\n}\n\n/**\n * Computes the absolute difference loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction absoluteDifference_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'absoluteDifference');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'absoluteDifference');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'absoluteDifference');\n }\n assertShapesMatch(\n $labels.shape, $predictions.shape, 'Error in absoluteDifference: ');\n\n const losses = $labels.sub($predictions).abs();\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the mean squared error between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction meanSquaredError_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'meanSquaredError');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'meanSquaredError');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'meanSquaredError');\n }\n assertShapesMatch(\n $labels.shape, $predictions.shape, 'Error in meanSquaredError: ');\n\n const losses = $labels.squaredDifference($predictions);\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the cosine distance loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param axis The dimension along which the cosine distance is computed.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction cosineDistance_(\n labels: T|TensorLike, predictions: T|TensorLike, axis: number,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'cosineDistance');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'cosineDistance');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'cosineDistance');\n }\n assertShapesMatch(\n $labels.shape, $predictions.shape, 'Error in cosineDistance: ');\n\n const one = scalar(1);\n const losses = one.sub($labels.mul($predictions).sum(axis, true));\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the Hinge loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction hingeLoss_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n let $labels = convertToTensor(labels, 'labels', 'hingeLoss');\n const $predictions = convertToTensor(predictions, 'predictions', 'hingeLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'hingeLoss');\n }\n assertShapesMatch($labels.shape, $predictions.shape, 'Error in hingeLoss: ');\n\n const one = scalar(1);\n // Convert binary labels to (-1, 1)\n $labels = scalar(2).mul($labels).sub(one);\n const losses = one.sub($labels.mul($predictions)).relu();\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the log loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param epsilon A small increment to avoid taking log of zero\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction logLoss_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike, epsilon = 1e-7,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'logLoss');\n const $predictions = convertToTensor(predictions, 'predictions', 'logLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'logLoss');\n }\n assertShapesMatch($labels.shape, $predictions.shape, 'Error in logLoss: ');\n\n const one = scalar(1);\n const epsilonScalar = scalar(epsilon);\n const losses = $labels.mul($predictions.add(epsilonScalar).log())\n .neg()\n .sub(one.sub($labels).mul(\n one.sub($predictions).add(epsilonScalar).log()));\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\nfunction sigmoidCrossEntropyWithLogits_(\n labels: T|TensorLike, logits: T|TensorLike): O {\n const $labels =\n convertToTensor(labels, 'labels', 'sigmoidCrossEntropyWithLogits');\n const $logits =\n convertToTensor(logits, 'logits', 'sigmoidCrossEntropyWithLogits');\n assertShapesMatch(\n $labels.shape, $logits.shape, 'Error in sigmoidCrossEntropyWithLogits: ');\n\n /**\n * Implementation Details:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n *\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n *\n * Hence, to ensure stability and avoid overflow, the implementation uses\n * this equivalent formulation:\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n */\n const maxOutput = $logits.relu();\n const outputXTarget = $logits.mul($labels);\n const sigmoidOutput = $logits.abs().neg().exp().log1p();\n\n return maxOutput.sub(outputXTarget).add(sigmoidOutput);\n}\n\n/**\n * Computes the sigmoid cross entropy loss between two tensors.\n *\n * If labelSmoothing is nonzero, smooth the labels towards 1/2:\n *\n * newMulticlassLabels = multiclassLabels * (1 - labelSmoothing)\n * + 0.5 * labelSmoothing\n *\n * @param multiClassLabels The ground truth output tensor of shape\n * [batch_size, num_classes], same dimensions as 'predictions'.\n * @param logits The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param labelSmoothing If greater than 0, then smooth the labels.\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc { heading: 'Training', subheading: 'Losses', namespace: 'losses' } */\nfunction sigmoidCrossEntropy_(\n multiClassLabels: T|TensorLike, logits: T|TensorLike,\n weights?: Tensor|TensorLike, labelSmoothing = 0,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n let $multiClassLabels = convertToTensor(\n multiClassLabels, 'multiClassLabels', 'sigmoidCrossEntropy');\n const $logits = convertToTensor(logits, 'logits', 'sigmoidCrossEntropy');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'sigmoidCrossEntropy');\n }\n assertShapesMatch(\n $multiClassLabels.shape, $logits.shape, 'Error in sigmoidCrossEntropy: ');\n\n if (labelSmoothing > 0) {\n const labelSmoothingScalar = scalar(labelSmoothing);\n const one = scalar(1);\n const half = scalar(0.5);\n\n $multiClassLabels = $multiClassLabels.mul(one.sub(labelSmoothingScalar))\n .add(half.mul(labelSmoothingScalar));\n }\n const losses = sigmoidCrossEntropyWithLogits_($multiClassLabels, $logits);\n\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the huber loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param delta Point where huber loss changes from quadratic to linear.\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`.\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction huberLoss_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike, delta = 1.0,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'huberLoss');\n const $predictions = convertToTensor(predictions, 'predictions', 'huberLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'huberLoss');\n }\n assertShapesMatch($labels.shape, $predictions.shape, 'Error in huberLoss: ');\n\n const deltaScalar = scalar(delta);\n const error = $predictions.sub($labels).abs();\n const quadratic = minimum(error, deltaScalar);\n const linear = error.sub(quadratic);\n\n const losses =\n scalar(0.5).mul(quadratic.square()).add(deltaScalar.mul(linear));\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes softmax cross entropy between logits and labels.\n *\n * Measures the probability error in discrete classification tasks in which\n * the classes are mutually exclusive (each entry is in exactly one class).\n * For example, each CIFAR-10 image is labeled with one and only one label: an\n * image can be a dog or a truck, but not both.\n *\n * `NOTE`: While the classes are mutually exclusive, their probabilities need\n * not be. All that is required is that each row of labels is a valid\n * probability distribution. If they are not, the computation of the gradient\n * will be incorrect.\n *\n * `WARNING`: This op expects unscaled logits, since it performs a softmax on\n * logits internally for efficiency. Do not call this op with the output of\n * softmax, as it will produce incorrect results.\n *\n * logits and labels must have the same shape, e.g. [batch_size, num_classes]\n * and the same dtype.\n * @param labels The labels array.\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n */\nfunction softmaxCrossEntropyWithLogits_(\n labels: T, logits: T, dim = -1): O {\n if (dim === -1) {\n dim = logits.rank - 1;\n }\n\n if (dim !== logits.rank - 1) {\n throw Error(\n `Softmax cross entropy along a non-last dimension is not yet ` +\n `supported. Labels / logits was rank ${logits.rank} ` +\n `and dim was ${dim}`);\n }\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((labels, logits) => {\n // Reference:\n // 1. http://cs231n.github.io/linear-classify/#softmax\n // 2. https://blog.feedly.com/tricks-of-the-trade-logsumexp/\n const keepDims = true;\n const lse = logits.logSumExp([dim], keepDims);\n\n const logResult = logits.toFloat().sub(lse);\n const costVector = logResult.mul(labels).neg();\n\n const value = costVector.sum([dim]) as O;\n\n const gradFunc = (dy: O) => {\n const dyShape = expandShapeToKeepDim(dy.shape, [dim]);\n return [\n dy.reshape(dyShape).mul(labels.toFloat().sub(logResult.exp())),\n dy.reshape(dyShape).mul(logResult.exp().sub(labels.toFloat())),\n ];\n };\n return {value, gradFunc};\n });\n\n return customOp(labels, logits);\n}\n\n/**\n * Computes the softmax cross entropy loss between two tensors.\n *\n * If labelSmoothing is nonzero, smooth the labels towards 1/2:\n *\n * newOnehotLabels = onehotLabels * (1 - labelSmoothing)\n * + labelSmoothing / numClasses\n *\n * @param onehotLabels One hot encoded labels\n * [batch_size, num_classes], same dimensions as 'predictions'.\n * @param logits The predicted outputs.\n * @param weights Tensor whose rank is either 0, or 1, and must be\n * broadcastable to `loss` of shape [batch_size]\n * @param labelSmoothing If greater than 0, then smooth the labels.\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc { heading: 'Training', subheading: 'Losses', namespace: 'losses' } */\nfunction softmaxCrossEntropy_(\n onehotLabels: T|TensorLike, logits: T|TensorLike,\n weights?: Tensor|TensorLike, labelSmoothing = 0,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n let $onehotLabels =\n convertToTensor(onehotLabels, 'onehotLabels', 'softmaxCrossEntropy');\n const $logits = convertToTensor(logits, 'logits', 'softmaxCrossEntropy');\n let $weights: Tensor = null;\n\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'softmaxCrossEntropy');\n }\n\n assertShapesMatch(\n $onehotLabels.shape, $logits.shape, 'Error in softmaxCrossEntropy: ');\n\n if (labelSmoothing > 0) {\n const labelSmoothingScalar = scalar(labelSmoothing);\n const one = scalar(1);\n const numClasses = scalar($onehotLabels.shape[1]);\n\n $onehotLabels = $onehotLabels.mul(one.sub(labelSmoothingScalar))\n .add(labelSmoothingScalar.div(numClasses));\n }\n\n const losses = softmaxCrossEntropyWithLogits_($onehotLabels, $logits);\n\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\nexport const absoluteDifference = op({absoluteDifference_});\nexport const computeWeightedLoss = op({computeWeightedLoss_});\nexport const cosineDistance = op({cosineDistance_});\nexport const hingeLoss = op({hingeLoss_});\nexport const huberLoss = op({huberLoss_});\nexport const logLoss = op({logLoss_});\nexport const meanSquaredError = op({meanSquaredError_});\nexport const sigmoidCrossEntropy = op({sigmoidCrossEntropy_});\nexport const softmaxCrossEntropy = op({softmaxCrossEntropy_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Linear algebra ops.\n */\n\nimport {ENV} from '../environment';\nimport {dispose} from '../globals';\nimport {Tensor, Tensor1D, Tensor2D} from '../tensor';\nimport {assert} from '../util';\nimport {eye, split, squeeze, stack, unstack} from './array_ops';\nimport {norm} from './norm';\nimport {op} from './operation';\nimport {sum} from './reduction_ops';\nimport {tensor2d} from './tensor_ops';\n\n/**\n * Gram-Schmidt orthogonalization.\n *\n * @param xs The vectors to be orthogonalized, in one of the two following\n * formats:\n * - An Array of `Tensor1D`.\n * - A `Tensor2D`, i.e., a matrix, in which case the vectors are the rows\n * of `xs`.\n * In each case, all the vectors must have the same length and the length\n * must be greater than or equal to the number of vectors.\n * @returns The orthogonalized and normalized vectors or matrix.\n * Orthogonalization means that the vectors or the rows of the matrix\n * are orthogonal (zero inner products). Normalization means that each\n * vector or each row of the matrix has an L2 norm that equals `1`.\n */\n/** @doc {heading: 'Operations', subheading: 'Linear Algebra'} */\nfunction gramSchmidt_(xs: Tensor1D[]|Tensor2D): Tensor1D[]|Tensor2D {\n let inputIsTensor2D: boolean;\n if (Array.isArray(xs)) {\n inputIsTensor2D = false;\n assert(\n xs != null && xs.length > 0,\n 'Gram-Schmidt process: input must not be null, undefined, or empty');\n const dim = xs[0].shape[0];\n for (let i = 1; i < xs.length; ++i) {\n assert(\n xs[i].shape[0] === dim,\n 'Gram-Schmidt: Non-unique lengths found in the input vectors: ' +\n `(${xs[i].shape[0]} vs. ${dim})`);\n }\n } else {\n inputIsTensor2D = true;\n xs = split(xs, xs.shape[0], 0).map(x => squeeze(x, [0]));\n }\n\n assert(\n xs.length <= xs[0].shape[0],\n `Gram-Schmidt: Number of vectors (${xs.length}) exceeds ` +\n `number of dimensions (${xs[0].shape[0]}).`);\n\n const ys: Tensor1D[] = [];\n const xs1d = xs as Tensor1D[];\n for (let i = 0; i < xs.length; ++i) {\n ys.push(ENV.engine.tidy(() => {\n let x = xs1d[i];\n if (i > 0) {\n for (let j = 0; j < i; ++j) {\n const proj = sum(ys[j].mulStrict(x)).mul(ys[j]);\n x = x.sub(proj);\n }\n }\n return x.div(norm(x, 'euclidean'));\n }));\n }\n\n if (inputIsTensor2D) {\n return stack(ys, 0) as Tensor2D;\n } else {\n return ys;\n }\n}\n\n/**\n * Compute QR decomposition of m-by-n matrix using Householder transformation.\n *\n * Implementation based on\n * [http://www.cs.cornell.edu/~bindel/class/cs6210-f09/lec18.pdf]\n * (http://www.cs.cornell.edu/~bindel/class/cs6210-f09/lec18.pdf)\n *\n * @param x The `Tensor` to be QR-decomposed. Must have rank >= 2. Suppose\n * it has the shape `[..., M, N]`.\n * @param fullMatrices An optional boolean parameter. Defaults to `false`.\n * If `true`, compute full-sized `Q`. If `false` (the default),\n * compute only the leading N columns of `Q` and `R`.\n * @return An `Array` of two `Tensor`s: `[Q, R]`. `Q` is a unitary matrix,\n * i.e., its columns all have unit norm and are mutually orthogonal.\n * If `M >= N`,\n * If `fullMatrices` is `false` (default),\n * - `Q` has a shape of `[..., M, N]`,\n * - `R` has a shape of `[..., N, N]`.\n * If `fullMatrices` is `true` (default),\n * - `Q` has a shape of `[..., M, M]`,\n * - `R` has a shape of `[..., M, N]`.\n * If `M < N`,\n * - `Q` has a shape of `[..., M, M]`,\n * - `R` has a shape of `[..., M, N]`.\n * @throws If the rank of `x` is less than 2.\n */\n/** @doc {heading: 'Operations', subheading: 'Linear Algebra'} */\nfunction qr_(x: Tensor, fullMatrices = false): [Tensor, Tensor] {\n if (x.rank < 2) {\n throw new Error(\n `qr() requires input tensor to have a rank >= 2, but got rank ${\n x.rank}`);\n } else if (x.rank === 2) {\n return qr2d(x as Tensor2D, fullMatrices);\n } else {\n // Rank > 2.\n // TODO(cais): Below we split the input into individual 2D tensors,\n // perform QR decomposition on them and then stack the results back\n // together. We should explore whether this can be parallelized.\n const outerDimsProd = x.shape.slice(0, x.shape.length - 2)\n .reduce((value, prev) => value * prev);\n const x2ds = unstack(\n x.reshape([\n outerDimsProd, x.shape[x.shape.length - 2],\n x.shape[x.shape.length - 1]\n ]),\n 0);\n const q2ds: Tensor2D[] = [];\n const r2ds: Tensor2D[] = [];\n x2ds.forEach(x2d => {\n const [q2d, r2d] = qr2d(x2d as Tensor2D, fullMatrices);\n q2ds.push(q2d);\n r2ds.push(r2d);\n });\n const q = stack(q2ds, 0).reshape(x.shape);\n const r = stack(r2ds, 0).reshape(x.shape);\n return [q, r];\n }\n}\n\nfunction qr2d(x: Tensor2D, fullMatrices = false): [Tensor2D, Tensor2D] {\n return ENV.engine.tidy(() => {\n if (x.shape.length !== 2) {\n throw new Error(\n `qr2d() requires a 2D Tensor, but got a ${x.shape.length}D Tensor.`);\n }\n\n const m = x.shape[0];\n const n = x.shape[1];\n\n let q = eye(m) as Tensor2D; // Orthogonal transform so far.\n let r = x.clone(); // Transformed matrix so far.\n\n const one2D = tensor2d([[1]], [1, 1]);\n let w: Tensor2D = one2D.clone();\n\n const iters = m >= n ? n : m;\n for (let j = 0; j < iters; ++j) {\n // This tidy within the for-loop ensures we clean up temporary\n // tensors as soon as they are no longer needed.\n const rTemp = r;\n const wTemp = w;\n const qTemp = q;\n [w, r, q] = ENV.engine.tidy((): [Tensor2D, Tensor2D, Tensor2D] => {\n // Find H = I - tau * w * w', to put zeros below R(j, j).\n const rjEnd1 = r.slice([j, j], [m - j, 1]);\n const normX = rjEnd1.norm();\n const rjj = r.slice([j, j], [1, 1]);\n const s = rjj.sign().neg() as Tensor2D;\n const u1 = rjj.sub(s.mul(normX)) as Tensor2D;\n const wPre = rjEnd1.div(u1);\n if (wPre.shape[0] === 1) {\n w = one2D.clone();\n } else {\n w = one2D.concat(\n wPre.slice([1, 0], [wPre.shape[0] - 1, wPre.shape[1]]), 0) as\n Tensor2D;\n }\n const tau = s.matMul(u1).div(normX).neg() as Tensor2D;\n\n // -- R := HR, Q := QH.\n const rjEndAll = r.slice([j, 0], [m - j, n]);\n const tauTimesW = tau.mul(w) as Tensor2D;\n if (j === 0) {\n r = rjEndAll.sub(tauTimesW.matMul(w.transpose().matMul(rjEndAll)));\n } else {\n r = r.slice([0, 0], [j, n])\n .concat(\n rjEndAll.sub(\n tauTimesW.matMul(w.transpose().matMul(rjEndAll))),\n 0) as Tensor2D;\n }\n const qAllJEnd = q.slice([0, j], [m, q.shape[1] - j]);\n if (j === 0) {\n q = qAllJEnd.sub(qAllJEnd.matMul(w).matMul(tauTimesW.transpose()));\n } else {\n q = q.slice([0, 0], [m, j])\n .concat(\n qAllJEnd.sub(\n qAllJEnd.matMul(w).matMul(tauTimesW.transpose())),\n 1) as Tensor2D;\n }\n return [w, r, q];\n });\n dispose([rTemp, wTemp, qTemp]);\n }\n\n if (!fullMatrices && m > n) {\n q = q.slice([0, 0], [m, n]);\n r = r.slice([0, 0], [n, n]);\n }\n\n return [q, r];\n }) as [Tensor2D, Tensor2D];\n}\n\nexport const gramSchmidt = op({gramSchmidt_});\nexport const qr = op({qr_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ForwardFunc} from '../engine';\nimport {ENV} from '../environment';\nimport {nonMaxSuppressionImpl} from '../kernels/non_max_suppression_impl';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\n\n/**\n * Bilinear resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n */\n/** @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} */\nfunction resizeBilinear_(\n images: T|TensorLike, size: [number, number], alignCorners = false): T {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert(\n $images.rank === 3 || $images.rank === 4,\n `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(\n size.length === 2,\n `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n\n let batchImages = $images as Tensor4D;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages =\n $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]);\n }\n\n const [newHeight, newWidth] = size;\n const forward: ForwardFunc = (backend, save) =>\n backend.resizeBilinear(batchImages, newHeight, newWidth, alignCorners);\n\n const backward = (dy: Tensor4D, saved: Tensor[]) => {\n return {\n batchImages: () => ENV.engine.runKernel(\n backend =>\n backend.resizeBilinearBackprop(dy, batchImages, alignCorners),\n {})\n };\n };\n\n const res = ENV.engine.runKernel(forward, {batchImages}, backward);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n */\n/** @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} */\nfunction resizeNearestNeighbor_(\n images: T|TensorLike, size: [number, number], alignCorners = false): T {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert(\n $images.rank === 3 || $images.rank === 4,\n `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(\n size.length === 2,\n `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(\n $images.dtype === 'float32' || $images.dtype === 'int32',\n '`images` must have `int32` or `float32` as dtype');\n\n let batchImages = $images as Tensor4D;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages =\n $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]);\n }\n const [newHeight, newWidth] = size;\n\n const forward: ForwardFunc = (backend, save) =>\n backend.resizeNearestNeighbor(\n batchImages, newHeight, newWidth, alignCorners);\n\n const backward = (dy: Tensor4D, saved: Tensor[]) => {\n return {\n batchImages: () => ENV.engine.runKernel(\n backend => backend.resizeNearestNeighborBackprop(\n dy, batchImages, alignCorners),\n {})\n };\n };\n\n const res = ENV.engine.runKernel(forward, {batchImages}, backward);\n\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Performs non maximum suppression of bounding boxes based on\n * iou (intersection over union)\n *\n * @param boxes a 2d tensor of shape `[numBoxes, 4]`. Each entry is\n * `[y1, x1, y2, x2]`, where `(y1, x1)` and `(y2, x2)` are the corners of\n * the bounding box.\n * @param scores a 1d tensor providing the box scores of shape `[numBoxes]`.\n * @param maxOutputSize The maximum number of boxes to be selected.\n * @param iouThreshold A float representing the threshold for deciding whether\n * boxes overlap too much with respect to IOU. Must be betwen [0, 1].\n * Defaults to 0.5 (50% box overlap).\n * @param scoreThreshold A threshold for deciding when to remove boxes based\n * on score. Defaults to -inf, which means any score is accepted.\n * @return A 1D tensor with the selected box indices.\n */\n/** @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} */\nfunction nonMaxSuppression_(\n boxes: Tensor2D|TensorLike, scores: Tensor1D|TensorLike,\n maxOutputSize: number, iouThreshold = 0.5,\n scoreThreshold = Number.NEGATIVE_INFINITY): Tensor1D {\n const $boxes = convertToTensor(boxes, 'boxes', 'nonMaxSuppression');\n const $scores = convertToTensor(scores, 'scores', 'nonMaxSuppression');\n\n const inputs = nonMaxSuppSanityCheck(\n $boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold);\n maxOutputSize = inputs.maxOutputSize;\n iouThreshold = inputs.iouThreshold;\n scoreThreshold = inputs.scoreThreshold;\n\n return ENV.engine.runKernel(\n b => b.nonMaxSuppression(\n $boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold),\n {$boxes});\n}\n\n/** This is the async version of `nonMaxSuppression` */\nasync function nonMaxSuppressionAsync_(\n boxes: Tensor2D|TensorLike, scores: Tensor1D|TensorLike,\n maxOutputSize: number, iouThreshold = 0.5,\n scoreThreshold = Number.NEGATIVE_INFINITY): Promise {\n const $boxes = convertToTensor(boxes, 'boxes', 'nonMaxSuppressionAsync');\n const $scores = convertToTensor(scores, 'scores', 'nonMaxSuppressionAsync');\n\n const inputs = nonMaxSuppSanityCheck(\n $boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold);\n maxOutputSize = inputs.maxOutputSize;\n iouThreshold = inputs.iouThreshold;\n scoreThreshold = inputs.scoreThreshold;\n\n const boxesVals = await $boxes.data();\n const scoresVals = await $scores.data();\n const res = nonMaxSuppressionImpl(\n boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold);\n if ($boxes !== boxes) {\n $boxes.dispose();\n }\n if ($scores !== scores) {\n $scores.dispose();\n }\n return res;\n}\n\nfunction nonMaxSuppSanityCheck(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number):\n {maxOutputSize: number, iouThreshold: number, scoreThreshold: number} {\n if (iouThreshold == null) {\n iouThreshold = 0.5;\n }\n if (scoreThreshold == null) {\n scoreThreshold = Number.NEGATIVE_INFINITY;\n }\n const numBoxes = boxes.shape[0];\n maxOutputSize = Math.min(maxOutputSize, numBoxes);\n\n util.assert(\n 0 <= iouThreshold && iouThreshold <= 1,\n `iouThreshold must be in [0, 1], but was '${iouThreshold}'`);\n util.assert(\n boxes.rank === 2,\n `boxes must be a 2D tensor, but was of rank '${boxes.rank}'`);\n util.assert(\n boxes.shape[1] === 4,\n `boxes must have 4 columns, but 2nd dimension was ${boxes.shape[1]}`);\n util.assert(scores.rank === 1, 'scores must be a 1D tensor');\n util.assert(\n scores.shape[0] === numBoxes,\n `scores has incompatible shape with boxes. Expected ${numBoxes}, ` +\n `but was ${scores.shape[0]}`);\n return {maxOutputSize, iouThreshold, scoreThreshold};\n}\n\nexport const resizeBilinear = op({resizeBilinear_});\nexport const resizeNearestNeighbor = op({resizeNearestNeighbor_});\nexport const nonMaxSuppression = op({nonMaxSuppression_});\nexport const nonMaxSuppressionAsync = nonMaxSuppressionAsync_;\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as seedrandom from 'seedrandom';\nimport {ENV} from '../environment';\nimport {warn} from '../log';\nimport * as array_ops_util from '../ops/array_ops_util';\nimport * as axis_util from '../ops/axis_util';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport * as concat_util from '../ops/concat_util';\nimport {Conv2DInfo} from '../ops/conv_util';\nimport * as erf_util from '../ops/erf_util';\nimport * as ops from '../ops/ops';\nimport {buffer, tensor3d, tensor4d} from '../ops/ops';\nimport * as selu_util from '../ops/selu_util';\nimport {getStridedSlicedInfo} from '../ops/slice_util';\nimport {DataId, setTensorTracker, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {DataType, DataTypeMap, Rank, ShapeMap, TypedArray, upcastType} from '../types';\nimport * as util from '../util';\nimport {now} from '../util';\nimport {BackendTimingInfo, KernelBackend} from './backend';\nimport * as backend_util from './backend_util';\nimport {nonMaxSuppressionImpl} from './non_max_suppression_impl';\nimport {topkImpl} from './topk_impl';\nimport {whereImpl} from './where_impl';\n\nexport class MathBackendCPU implements KernelBackend {\n private data = new WeakMap();\n private canvas: HTMLCanvasElement;\n private firstUse = true;\n\n constructor() {\n if (ENV.get('IS_BROWSER')) {\n this.canvas = document.createElement('canvas');\n }\n }\n\n register(dataId: DataId, shape: number[], dtype: DataType): void {\n if (this.firstUse) {\n this.firstUse = false;\n if (ENV.get('IS_NODE')) {\n warn(\n '\\n============================\\n' +\n 'Hi there 👋. Looks like you are running TensorFlow.js in ' +\n 'Node.js. To speed things up dramatically, install our node ' +\n 'backend, which binds to TensorFlow C++, by running ' +\n 'npm i @tensorflow/tfjs-node, ' +\n 'or npm i @tensorflow/tfjs-node-gpu if you have CUDA. ' +\n 'Then call require(\\'@tensorflow/tfjs-node\\'); (-gpu ' +\n 'suffix for CUDA) at the start of your program. ' +\n 'Visit https://github.com/tensorflow/tfjs-node for more details.' +\n '\\n============================\\n');\n }\n }\n if (this.data.has(dataId)) {\n throw new Error(`Data buffer is already registered`);\n }\n this.data.set(dataId, null);\n }\n write(dataId: DataId, values: TypedArray): void {\n if (values == null) {\n throw new Error('MathBackendCPU.write(): values can not be null');\n }\n this.throwIfNoData(dataId);\n this.data.set(dataId, values);\n }\n fromPixels(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels: number): Tensor3D {\n if (pixels == null) {\n throw new Error('pixels passed to tf.fromPixels() can not be null');\n }\n let vals: Uint8ClampedArray;\n // tslint:disable-next-line:no-any\n if (ENV.get('IS_NODE') && (pixels as any).getContext == null) {\n throw new Error(\n 'When running in node, pixels must be an HTMLCanvasElement ' +\n 'like the one returned by the `canvas` npm package');\n }\n // tslint:disable-next-line:no-any\n if ((pixels as any).getContext != null) {\n // tslint:disable-next-line:no-any\n vals = (pixels as any)\n .getContext('2d')\n .getImageData(0, 0, pixels.width, pixels.height)\n .data;\n } else if (pixels instanceof ImageData) {\n vals = pixels.data;\n } else if (\n pixels instanceof HTMLImageElement ||\n pixels instanceof HTMLVideoElement) {\n if (this.canvas == null) {\n throw new Error(\n 'Can\\'t read pixels from HTMLImageElement outside ' +\n 'the browser.');\n }\n this.canvas.width = pixels.width;\n this.canvas.height = pixels.height;\n this.canvas.getContext('2d').drawImage(\n pixels, 0, 0, pixels.width, pixels.height);\n vals = this.canvas.getContext('2d')\n .getImageData(0, 0, pixels.width, pixels.height)\n .data;\n } else {\n throw new Error(\n 'pixels passed to tf.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ` +\n `ImageData, but was ${(pixels as {}).constructor.name}`);\n }\n let values: Int32Array;\n if (numChannels === 4) {\n values = new Int32Array(vals);\n } else {\n const numPixels = pixels.width * pixels.height;\n values = new Int32Array(numPixels * numChannels);\n for (let i = 0; i < numPixels; i++) {\n for (let channel = 0; channel < numChannels; ++channel) {\n values[i * numChannels + channel] = vals[i * 4 + channel];\n }\n }\n }\n const outShape: [number, number, number] =\n [pixels.height, pixels.width, numChannels];\n return tensor3d(values, outShape, 'int32');\n }\n async read(dataId: DataId): Promise {\n return this.readSync(dataId);\n }\n readSync(dataId: DataId): TypedArray {\n this.throwIfNoData(dataId);\n return this.data.get(dataId);\n }\n\n disposeData(dataId: DataId): void {\n if (this.data.has(dataId)) {\n this.data.delete(dataId);\n }\n }\n\n async time(f: () => void): Promise {\n const start = now();\n f();\n const kernelMs = now() - start;\n return {kernelMs};\n }\n memory() {\n return {\n // Unreliable due to automatic gc. The numbers above are cumulative.\n unreliable: true\n };\n }\n\n private throwIfNoData(dataId: DataId) {\n if (!this.data.has(dataId)) {\n throw new Error(\n `CPU backend: No data found for this tensor. ` +\n `Did you change your backend in the middle of the program? ` +\n `New backends can't use Tensors created with previous backends`);\n }\n }\n\n slice(x: T, begin: number[], size: number[]): T {\n const buffer = ops.buffer(size, x.dtype);\n\n for (let i = 0; i < buffer.size; ++i) {\n const loc = buffer.indexToLoc(i);\n const xLoc = loc.map((idx, j) => idx + begin[j]);\n buffer.set(x.get(...xLoc), ...loc);\n }\n return buffer.toTensor() as T;\n }\n\n stridedSlice(\n x: T, begin: number[], end: number[], strides: number[],\n beginMask: number, endMask: number): T {\n const [beginIndex, size] =\n getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask);\n\n if (size.some(axis => axis === 0)) {\n return ops.tensor([], size) as T;\n }\n\n const buffer = ops.buffer(size, x.dtype);\n\n for (let i = 0; i < buffer.size; i++) {\n const loc = buffer.indexToLoc(i);\n\n const newLoc: number[] = new Array(loc.length);\n for (let j = 0; j < newLoc.length; j++) {\n newLoc[j] = loc[j] * strides[j] + beginIndex[j];\n }\n buffer.set(x.get(...newLoc), ...loc);\n }\n\n return buffer.toTensor() as T;\n }\n\n reverse(x: T, axis: number[]): T {\n const buffer = ops.buffer(x.shape, x.dtype);\n const xBuffer = x.buffer();\n\n for (let i = 0; i < buffer.size; i++) {\n const outLoc = buffer.indexToLoc(i);\n const inLoc = outLoc.slice();\n axis.forEach(ax => inLoc[ax] = x.shape[ax] - 1 - inLoc[ax]);\n buffer.set(xBuffer.get(...inLoc), ...outLoc);\n }\n\n return buffer.toTensor() as T;\n }\n\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n concat(a: Tensor2D, b: Tensor2D): Tensor2D {\n const outShape = concat_util.computeOutShape(\n a.shape, b.shape, 1 /* axis */) as [number, number];\n const buffer = ops.buffer(outShape, a.dtype);\n\n if (a.shape[0] === 1 && b.shape[0] === 1) {\n // Use built-in TypedArray.set() method for speed.\n const aVals = a.dataSync();\n const bVals = b.dataSync();\n const vals = buffer.values;\n vals.set(aVals, 0);\n vals.set(bVals, a.size);\n return buffer.toTensor();\n }\n\n for (let i = 0; i < outShape[0]; ++i) {\n for (let j = 0; j < a.shape[1]; ++j) {\n buffer.set(a.get(i, j), i, j);\n }\n for (let j = 0; j < b.shape[1]; ++j) {\n buffer.set(b.get(i, j), i, j + a.shape[1]);\n }\n }\n return buffer.toTensor();\n }\n\n neg(x: T): T {\n return this.multiply(ops.scalar(-1), x) as T;\n }\n\n add(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, upcastType(a.dtype, b.dtype),\n (aValue, bValue) => aValue + bValue) as Tensor;\n }\n\n addN(tensors: T[]): T {\n const vals = tensors.map(t => t.dataSync());\n const result = ops.buffer(tensors[0].shape, tensors[0].dtype);\n const resultVals = result.values;\n for (let i = 0; i < tensors.length; i++) {\n const currVals = vals[i];\n for (let j = 0; j < resultVals.length; j++) {\n resultVals[j] += currVals[j];\n }\n }\n return result.toTensor() as T;\n }\n\n subtract(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, upcastType(a.dtype, b.dtype),\n (aValue, bValue) => aValue - bValue) as Tensor;\n }\n\n pow(a: T, b: Tensor): T {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aValue, bValue) => Math.pow(aValue, bValue)) as\n T;\n }\n\n matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean):\n Tensor2D {\n const sharedDim = transposeA ? a.shape[0] : a.shape[1];\n const leftDim = transposeA ? a.shape[1] : a.shape[0];\n const rightDim = transposeB ? b.shape[0] : b.shape[1];\n\n const aValues = a.dataSync();\n const bValues = b.dataSync();\n\n const [aOuterStep, aInnerStep] =\n transposeA ? [1, a.strides[0]] : [a.strides[0], 1];\n const [bOuterStep, bInnerStep] =\n transposeB ? [b.strides[0], 1] : [1, b.strides[0]];\n\n const aOuterEnd = leftDim * aOuterStep;\n const bOuterEnd = rightDim * bOuterStep;\n\n const result = new Float32Array(leftDim * rightDim);\n let resultIndex = 0;\n\n for (let aOuter = 0; aOuter < aOuterEnd; aOuter += aOuterStep) {\n for (let bOuter = 0; bOuter < bOuterEnd; bOuter += bOuterStep) {\n let aInner = aOuter;\n let bInner = bOuter;\n let sum = 0;\n for (let k = 0; k < sharedDim; ++k) {\n sum += aValues[aInner] * bValues[bInner];\n aInner += aInnerStep;\n bInner += bInnerStep;\n }\n result[resultIndex++] = sum;\n }\n }\n return ops.tensor2d(result, [leftDim, rightDim]);\n }\n\n multiply(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, upcastType(a.dtype, b.dtype),\n (aValue, bValue) => aValue * bValue) as Tensor;\n }\n\n realDivide(a: Tensor, b: Tensor): Tensor {\n const op = (a: number, b: number) => a / b;\n const outputDtype = 'float32';\n return this.broadcastedBinaryOp(a, b, outputDtype, op) as Tensor;\n }\n\n floorDiv(a: Tensor, b: Tensor): Tensor {\n const op = (a: number, b: number) => Math.floor(a / b);\n const outputDtype = 'int32';\n return this.broadcastedBinaryOp(a, b, outputDtype, op) as Tensor;\n }\n\n sum(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('sum', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const resultDtype = upcastType(x.dtype, 'int32');\n const result = ops.zeros(outShape, resultDtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let sum = 0;\n for (let j = 0; j < reduceSize; ++j) {\n sum += aVals[offset + j];\n }\n vals[i] = sum;\n }\n return result;\n }\n\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): Tensor {\n const res = [];\n\n // Reshape the segment id's so that they can be broadcast with\n // x. The new shape should be [segmentIds.shape, 1, ..., 1]\n const numIters = x.rank - segmentIds.rank;\n for (let i = 0; i < numIters; ++i) {\n segmentIds = segmentIds.expandDims(i + 1);\n }\n\n for (let i = 0; i < numSegments; ++i) {\n const segmentId = ops.scalar(i, 'int32');\n const mask = ops.equal(segmentId, segmentIds).asType('float32');\n const sum = mask.mul(x).sum(0);\n res.push(sum);\n }\n\n return ops.stack(res);\n }\n\n argMin(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMin', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, 'int32');\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let min = aVals[offset];\n let minIndex = 0;\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value < min) {\n min = value;\n minIndex = j;\n }\n }\n vals[i] = minIndex;\n }\n return result;\n }\n\n argMax(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMax', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, 'int32');\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let max = aVals[offset];\n let maxIndex = 0;\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value > max) {\n max = value;\n maxIndex = j;\n }\n }\n vals[i] = maxIndex;\n }\n return result;\n }\n\n cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean):\n Tensor {\n if (axis !== x.rank - 1) {\n throw new Error(\n `backend.cumsum in CPU expects an inner-most axis=${x.rank - 1} ` +\n `but got axis=${axis}`);\n }\n const resultDtype = upcastType(x.dtype, 'int32');\n const result = ops.zeros(x.shape, resultDtype);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n const finalDim = x.shape[x.rank - 1];\n const indexAdjuster = reverse ?\n (i: number, j: number) => i + finalDim - j - 1 :\n (i: number, j: number) => i + j;\n for (let i = 0; i < aVals.length; i += finalDim) {\n for (let j = 0; j < finalDim; j++) {\n const idx = indexAdjuster(i, j);\n if (j === 0) {\n vals[idx] = exclusive ? 0 : aVals[idx];\n } else {\n const prevIdx = indexAdjuster(i, j - 1);\n vals[idx] = exclusive ? aVals[prevIdx] + vals[prevIdx] :\n aVals[idx] + vals[prevIdx];\n }\n }\n }\n return result;\n }\n\n equal(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal === bVal) ? 1 : 0;\n });\n }\n\n notEqual(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal !== bVal) ? 1 : 0;\n });\n }\n\n less(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal < bVal) ? 1 : 0;\n });\n }\n\n lessEqual(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal <= bVal) ? 1 : 0;\n });\n }\n\n greater(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal > bVal) ? 1 : 0;\n });\n }\n\n greaterEqual(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal >= bVal) ? 1 : 0;\n });\n }\n\n logicalNot(x: T): T {\n const values = x.dataSync();\n const newValues = new Int32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = values[i] ? 0 : 1;\n }\n return Tensor.make(x.shape, {values: newValues}, 'bool') as T;\n }\n\n logicalAnd(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return aVal && bVal;\n });\n }\n\n logicalOr(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return aVal || bVal;\n });\n }\n\n select(condition: Tensor, a: Tensor, b: Tensor): Tensor {\n const values = condition.dataSync();\n const aValues = a.dataSync();\n const bValues = b.dataSync();\n const result = ops.zeros(a.shape, upcastType(a.dtype, b.dtype));\n const newValues = result.dataSync();\n let index = 0;\n const offset = condition.rank === 0 || condition.rank > 1 || a.rank === 1 ?\n 1 :\n a.shape[1];\n\n for (let i = 0; i < values.length; i++) {\n for (let j = 0; j < offset; j++) {\n if (values[i] === 1) {\n newValues[index++] = aValues[i];\n } else {\n newValues[index++] = bValues[i];\n }\n }\n }\n return result;\n }\n\n where(condition: Tensor): Tensor2D {\n const condVals = condition.dataSync();\n return whereImpl(condition.shape, condVals);\n }\n\n topk(x: T, k: number, sorted: boolean): [T, T] {\n const xVals = x.dataSync();\n return topkImpl(xVals, x.shape, x.dtype, k, sorted);\n }\n\n min(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('min', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let min = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value < min) {\n min = value;\n }\n }\n vals[i] = min;\n }\n return result;\n }\n\n minimum(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aVal, bVal) => Math.min(aVal, bVal));\n }\n\n mod(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, a.dtype, (aVal, bVal) => {\n const rem = aVal % bVal;\n if ((aVal < 0 && bVal < 0) || (aVal >= 0 && bVal >= 0)) {\n return rem;\n } else {\n return (rem + bVal) % bVal;\n }\n });\n }\n\n max(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('max', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let max = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value > max) {\n max = value;\n }\n }\n vals[i] = max;\n }\n return result;\n }\n\n maximum(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aVal, bVal) => Math.max(aVal, bVal));\n }\n\n all(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('all', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let all = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n all = all && value;\n }\n vals[i] = all;\n }\n return result;\n }\n\n any(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('any', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let anyVal = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n anyVal = anyVal || value;\n }\n vals[i] = anyVal;\n }\n return result;\n }\n\n squaredDifference(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, a.dtype, (aVal, bVal) => {\n const diff = aVal - bVal;\n return diff * diff;\n });\n }\n\n ceil(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.ceil(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n floor(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.floor(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n sign(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n if (values[i] < 0) {\n newValues[i] = -1;\n } else if (values[i] > 0) {\n newValues[i] = 1;\n } else {\n newValues[i] = 0;\n }\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n round(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n // The algorithm is based on banker's rounding.\n const base = Math.floor(values[i]);\n if (values[i] - base < 0.5) {\n newValues[i] = Math.floor(values[i]);\n } else if (values[i] - base > 0.5) {\n newValues[i] = Math.ceil(values[i]);\n } else {\n if (base % 2.0 === 0.0) {\n newValues[i] = base;\n } else {\n newValues[i] = base + 1.0;\n }\n }\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n exp(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.exp(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n expm1(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.expm1(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n log(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = Math.log(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n log1p(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = Math.log1p(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n sqrt(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = Math.sqrt(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n rsqrt(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = 1 / Math.sqrt(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n square(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = value * value;\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n reciprocal(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = 1 / values[i];\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n relu(x: T): T {\n const res = ops.zeros(x.shape, x.dtype);\n const resVals = res.dataSync();\n const inVals = x.dataSync();\n for (let i = 0; i < inVals.length; ++i) {\n resVals[i] = Math.max(0, inVals[i]);\n }\n return res as T;\n }\n\n elu(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n if (v >= 0) {\n resultValues[i] = v;\n } else {\n resultValues[i] = (Math.exp(v) - 1);\n }\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n eluDer(dy: T, y: T): T {\n const resultValues = new Float32Array(y.size);\n const values = y.dataSync();\n const dyValues = dy.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n if (v >= 1) {\n resultValues[i] = dyValues[i];\n } else {\n resultValues[i] = dyValues[i] * (v + 1);\n }\n }\n return Tensor.make(y.shape, {values: resultValues}) as T;\n }\n\n selu(x: T): T {\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n const scaleAlpha = selu_util.SELU_SCALEALPHA;\n const scale = selu_util.SELU_SCALE;\n\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n if (v >= 0) {\n resultValues[i] = scale * v;\n } else {\n resultValues[i] = scaleAlpha * (Math.exp(v) - 1);\n }\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n clip(x: T, min: number, max: number): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.min(max, Math.max(min, values[i]));\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n abs(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.abs(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n int(x: T): T {\n const resultValues = new Int32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = values[i];\n }\n return Tensor.make(x.shape, {values: resultValues}, 'int32');\n }\n\n sigmoid(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = 1 / (1 + Math.exp(-values[i]));\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n softplus(x: T): T {\n // mirrors the implementation of tf.nn.softplus: https://goo.gl/vkcvwX\n\n // epsilon is the difference between 1.0 and the next representable float.\n // For a single precision 32 bit float this should be 2^-23, see:\n // https://math.byu.edu/~schow/work/IEEEFloatingPoint.htm\n const epsilon = 1.1920928955078125e-7;\n const threshold = Math.log(epsilon) + 2.0;\n\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n\n for (let i = 0; i < values.length; ++i) {\n // Value above which exp(x) may overflow, but softplus(x) == x\n // is within machine epsilon.\n const tooLarge = values[i] > -threshold;\n\n // Value below which exp(x) may underflow, but softplus(x) == exp(x)\n // is within machine epsilon.\n const tooSmall = values[i] < threshold;\n\n const expX = Math.exp(values[i]);\n let result;\n\n if (tooSmall) {\n result = expX;\n } else if (tooLarge) {\n result = values[i];\n } else {\n result = Math.log(1.0 + expX);\n }\n resultValues[i] = result;\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n sin(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.sin(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n cos(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.cos(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n tan(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.tan(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n asin(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.asin(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n acos(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.acos(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n atan(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.atan(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n atan2(a: T, b: T): T {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aValue, bValue) => Math.atan2(aValue, bValue)) as\n T;\n }\n\n sinh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.sinh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n cosh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.cosh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n tanh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = util.tanh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n asinh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.asinh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n acosh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.acosh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n atanh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.atanh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n erf(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n const p = erf_util.ERF_P;\n const a1 = erf_util.ERF_A1;\n const a2 = erf_util.ERF_A2;\n const a3 = erf_util.ERF_A3;\n const a4 = erf_util.ERF_A4;\n const a5 = erf_util.ERF_A5;\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n const t = 1.0 / (1.0 + p * v);\n resultValues[i] = 1.0 -\n (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t *\n Math.exp(-v * v);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n step(x: T, alpha = 0): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n if (isNaN(value)) {\n resultValues[i] = NaN;\n } else {\n resultValues[i] = value > 0 ? 1 : alpha;\n }\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const padLeft = convInfo.padInfo.left;\n const padTop = convInfo.padInfo.top;\n const y = ops.buffer(convInfo.outShape, x.dtype);\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d2 = 0; d2 < convInfo.outChannels; ++d2) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * convInfo.strideHeight - padLeft;\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * convInfo.strideWidth - padTop;\n\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; wR++) {\n const xR = xRCorner + wR * dilationHeight;\n\n if (xR < 0 || xR >= convInfo.inHeight) {\n continue;\n }\n\n for (let wC = 0; wC < filterWidth; wC++) {\n const xC = xCCorner + wC * dilationWidth;\n\n if (xC < 0 || xC >= convInfo.inWidth) {\n continue;\n }\n\n for (let d1 = 0; d1 < convInfo.inChannels; ++d1) {\n const pixel = x.get(b, xR, xC, d1);\n const weight = filter.get(wR, wC, d1, d2);\n dotProd += pixel * weight;\n }\n }\n }\n y.set(dotProd, b, yR, yC, d2);\n }\n }\n }\n }\n return y.toTensor();\n }\n\n conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const dx = ops.buffer(convInfo.inShape, 'float32');\n const dxValues = dx.values;\n const [dxS0, dxS1, dxS2] = dx.strides;\n const dyValues = dy.dataSync();\n const [dyS0, dyS1, dyS2] = dy.strides;\n const fltValues = filter.dataSync();\n const [fltS0, fltS1, fltS2] = filter.strides;\n const {\n batchSize,\n filterHeight,\n filterWidth,\n inChannels,\n inHeight,\n inWidth,\n outChannels,\n outHeight,\n outWidth,\n strideHeight,\n strideWidth\n } = convInfo;\n const topPad = filterHeight - 1 - convInfo.padInfo.top;\n const leftPad = filterWidth - 1 - convInfo.padInfo.left;\n\n for (let b = 0; b < batchSize; ++b) {\n for (let d1 = 0; d1 < inChannels; ++d1) {\n for (let xR = 0; xR < inHeight; ++xR) {\n const xRCorner = xR - topPad;\n const xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));\n const yRMax =\n Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);\n\n for (let xC = 0; xC < inWidth; ++xC) {\n const xCCorner = xC - leftPad;\n const xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));\n const yCMax =\n Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);\n\n let dotProd = 0;\n for (let yR = xRMin; yR < yRMax; ++yR) {\n const wR = yR * strideHeight - xRCorner;\n\n for (let yC = xCMin; yC < yCMax; ++yC) {\n const wC = yC * strideWidth - xCCorner;\n const dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC;\n const fltOffset = fltS0 * (filterHeight - 1 - wR) +\n fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;\n\n for (let d2 = 0; d2 < outChannels; ++d2) {\n const pixel = dyValues[dyOffset + d2];\n const weight = fltValues[fltOffset + d2];\n dotProd += pixel * weight;\n }\n }\n }\n dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd;\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n conv2dDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dW = ops.buffer(convInfo.filterShape, 'float32');\n\n const leftPad = convInfo.padInfo.left;\n const topPad = convInfo.padInfo.top;\n\n for (let wR = 0; wR < filterHeight; ++wR) {\n const yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));\n const yRMax = Math.min(\n convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);\n\n for (let wC = 0; wC < filterWidth; ++wC) {\n const yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));\n const yCMax = Math.min(\n convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);\n\n for (let d1 = 0; d1 < convInfo.inChannels; ++d1) {\n for (let d2 = 0; d2 < convInfo.outChannels; ++d2) {\n // Need to convolve.\n let dotProd = 0;\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let yR = yRMin; yR < yRMax; ++yR) {\n const xR = wR + yR * strideHeight - topPad;\n for (let yC = yCMin; yC < yCMax; ++yC) {\n const xC = wC + yC * strideWidth - leftPad;\n dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2);\n }\n }\n }\n dW.set(dotProd, wR, wC, d1, d2);\n }\n }\n }\n }\n return dW.toTensor();\n }\n\n depthwiseConv2D(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const padLeft = convInfo.padInfo.left;\n const padTop = convInfo.padInfo.top;\n const chMul = convInfo.outChannels / convInfo.inChannels;\n const y = ops.buffer(convInfo.outShape, x.dtype);\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d1 = 0; d1 < convInfo.inChannels; ++d1) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * convInfo.strideHeight - padLeft;\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * convInfo.strideWidth - padTop;\n for (let q = 0; q < chMul; ++q) {\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; ++wR) {\n const xR = xRCorner + wR * dilationHeight;\n\n if (xR < 0 || xR >= convInfo.inHeight) {\n continue;\n }\n\n for (let wC = 0; wC < filterWidth; ++wC) {\n const xC = xCCorner + wC * dilationWidth;\n\n if (xC < 0 || xC >= convInfo.inWidth) {\n continue;\n }\n\n const pixel = x.get(b, xR, xC, d1);\n const weight = filter.get(wR, wC, d1, q);\n dotProd += pixel * weight;\n }\n }\n y.set(dotProd, b, yR, yC, d1 * chMul + q);\n }\n }\n }\n }\n }\n\n return y.toTensor();\n }\n\n depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const dx = ops.buffer(convInfo.inShape, 'float32');\n const dxValues = dx.values;\n const [dxS0, dxS1, dxS2] = dx.strides;\n const dyValues = dy.dataSync();\n const [dyS0, dyS1, dyS2] = dy.strides;\n const fltValues = filter.dataSync();\n const [fltS0, fltS1, fltS2] = filter.strides;\n const {\n batchSize,\n filterHeight,\n filterWidth,\n inChannels,\n inHeight,\n inWidth,\n outChannels,\n outHeight,\n outWidth,\n strideHeight,\n strideWidth\n } = convInfo;\n const topPad = filterHeight - 1 - convInfo.padInfo.top;\n const leftPad = filterWidth - 1 - convInfo.padInfo.left;\n const chMul = outChannels / inChannels;\n\n for (let b = 0; b < batchSize; ++b) {\n for (let d1 = 0; d1 < inChannels; ++d1) {\n for (let xR = 0; xR < inHeight; ++xR) {\n const xRCorner = xR - topPad;\n const xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));\n const yRMax =\n Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);\n\n for (let xC = 0; xC < inWidth; ++xC) {\n const xCCorner = xC - leftPad;\n const xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));\n const yCMax =\n Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);\n\n let dotProd = 0;\n for (let yR = xRMin; yR < yRMax; ++yR) {\n const wR = yR * strideHeight - xRCorner;\n\n for (let yC = xCMin; yC < yCMax; ++yC) {\n const wC = yC * strideWidth - xCCorner;\n const dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC;\n const fltOffset = fltS0 * (filterHeight - 1 - wR) +\n fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;\n\n for (let dm = 0; dm < chMul; ++dm) {\n const d2 = d1 * chMul + dm;\n const pixel = dyValues[dyOffset + d2];\n const weight = fltValues[fltOffset + dm];\n dotProd += pixel * weight;\n }\n }\n }\n dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd;\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n depthwiseConv2DDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dW = ops.buffer(convInfo.filterShape, 'float32');\n\n const leftPad = convInfo.padInfo.left;\n const topPad = convInfo.padInfo.top;\n const chMul = convInfo.outChannels / convInfo.inChannels;\n\n for (let wR = 0; wR < filterHeight; ++wR) {\n const yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));\n const yRMax = Math.min(\n convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);\n\n for (let wC = 0; wC < filterWidth; ++wC) {\n const yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));\n const yCMax = Math.min(\n convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);\n\n for (let d2 = 0; d2 < convInfo.outChannels; ++d2) {\n const d1 = Math.trunc(d2 / chMul);\n const dm = d2 % chMul;\n\n let dotProd = 0;\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let yR = yRMin; yR < yRMax; ++yR) {\n const xR = wR + yR * strideHeight - topPad;\n for (let yC = yCMin; yC < yCMax; ++yC) {\n const xC = wC + yC * strideWidth - leftPad;\n dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2);\n }\n }\n }\n dW.set(dotProd, wR, wC, d1, dm);\n }\n }\n }\n return dW.toTensor();\n }\n\n tile(x: T, reps: number[]): T {\n const newShape: number[] = new Array(x.rank);\n for (let i = 0; i < newShape.length; i++) {\n newShape[i] = x.shape[i] * reps[i];\n }\n const result = ops.buffer(newShape, x.dtype);\n const xBuf = x.buffer();\n for (let i = 0; i < result.values.length; ++i) {\n const newLoc = result.indexToLoc(i);\n\n const originalLoc: number[] = new Array(x.rank);\n for (let i = 0; i < originalLoc.length; i++) {\n originalLoc[i] = newLoc[i] % x.shape[i];\n }\n\n const originalIndex = xBuf.locToIndex(originalLoc);\n\n result.values[i] = xBuf.values[originalIndex];\n }\n return result.toTensor() as T;\n }\n\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T {\n const outShape = paddings.map(\n (p, i) => p[0] /* beforePad */ + x.shape[i] + p[1] /* afterPad */);\n const start = paddings.map(p => p[0]);\n const xBuffer = x.buffer();\n const buffer = ops.buffer(outShape, x.dtype);\n if (constantValue !== 0) {\n buffer.values.fill(constantValue);\n }\n\n for (let i = 0; i < x.size; i++) {\n const coords = xBuffer.indexToLoc(i);\n const outCoords = coords.map((c, i) => c + start[i]);\n buffer.set(x.get(...coords), ...outCoords);\n }\n return buffer.toTensor() as T;\n }\n\n transpose(x: T, perm: number[]): T {\n const newShape: number[] = new Array(x.rank);\n for (let i = 0; i < newShape.length; i++) {\n newShape[i] = x.shape[perm[i]];\n }\n const values = x.dataSync();\n const result = buffer(newShape, x.dtype);\n\n const xBuf = x.buffer();\n for (let i = 0; i < x.size; ++i) {\n const loc = xBuf.indexToLoc(i);\n\n // Permute location.\n const newLoc: number[] = new Array(loc.length);\n for (let i = 0; i < newLoc.length; i++) {\n newLoc[i] = loc[perm[i]];\n }\n\n const newIndex = result.locToIndex(newLoc);\n result.values[newIndex] = values[i];\n }\n return result.toTensor() as T;\n }\n\n gather(x: T, indices: Tensor1D, axis: number): T {\n const newShape: number[] = x.shape.slice();\n const indicesValues = indices.dataSync();\n newShape[axis] = indicesValues.length;\n const result = buffer(newShape, x.dtype);\n const xBuf = x.buffer();\n\n for (let i = 0; i < result.size; ++i) {\n const newLoc = result.indexToLoc(i);\n\n const originalLoc: number[] = newLoc.slice();\n originalLoc[axis] = indicesValues[newLoc[axis]];\n\n const originalIndex = xBuf.locToIndex(originalLoc);\n result.values[i] = xBuf.values[originalIndex];\n }\n return result.toTensor() as T;\n }\n\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T {\n const prod = blockShape.reduce((a, b) => a * b);\n\n const reshaped = array_ops_util.getReshaped(x.shape, blockShape, prod);\n const permuted =\n array_ops_util.getPermuted(reshaped.length, blockShape.length);\n const reshapedPermuted =\n array_ops_util.getReshapedPermuted(x.shape, blockShape, prod);\n const sliceBeginCoords =\n array_ops_util.getSliceBeginCoords(crops, blockShape.length);\n const sliceSize =\n array_ops_util.getSliceSize(reshapedPermuted, crops, blockShape.length);\n\n return x.reshape(reshaped)\n .transpose(permuted)\n .reshape(reshapedPermuted)\n .slice(sliceBeginCoords, sliceSize) as T;\n }\n\n spaceToBatchND(\n x: T, blockShape: number[], paddings: Array<[number, number]>): T {\n const prod = blockShape.reduce((a, b) => a * b);\n\n const completePaddings: Array<[number, number]> = [[0, 0]];\n completePaddings.push(...paddings);\n for (let i = 1 + blockShape.length; i < x.shape.length; ++i) {\n completePaddings.push([0, 0]);\n }\n\n const paddedX = x.pad(completePaddings);\n\n const reshapedPaddedShape =\n array_ops_util.getReshaped(paddedX.shape, blockShape, prod, false);\n const permutedReshapedPaddedPermutation = array_ops_util.getPermuted(\n reshapedPaddedShape.length, blockShape.length, false);\n const flattenShape = array_ops_util.getReshapedPermuted(\n paddedX.shape, blockShape, prod, false);\n\n return paddedX.reshape(reshapedPaddedShape)\n .transpose(permutedReshapedPaddedPermutation)\n .reshape(flattenShape) as T;\n }\n\n private pool(x: Tensor4D, convInfo: Conv2DInfo, poolType: 'max'|'avg'):\n Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const y = ops.buffer(convInfo.outShape, 'float32');\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * strideHeight - padTop;\n const xRMin = Math.max(0, xRCorner);\n const xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner);\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * strideWidth - padLeft;\n const xCMin = Math.max(0, xCCorner);\n const xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner);\n\n let minMaxValue =\n (poolType === 'max' ? Number.NEGATIVE_INFINITY :\n Number.POSITIVE_INFINITY);\n let avgValue = 0;\n let count = 0;\n for (let xR = xRMin; xR < xRMax; ++xR) {\n for (let xC = xCMin; xC < xCMax; ++xC) {\n const pixel = x.get(b, xR, xC, d);\n if ((poolType === 'max' && pixel > minMaxValue)) {\n minMaxValue = pixel;\n } else if (poolType === 'avg') {\n avgValue += pixel;\n count++;\n }\n }\n if (isNaN(minMaxValue)) {\n break;\n }\n }\n y.set(\n poolType === 'avg' ? avgValue / count : minMaxValue, b, yR, yC,\n d);\n }\n }\n }\n }\n return y.toTensor();\n }\n\n maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return this.pool(x, convInfo, 'max');\n }\n\n private maxPoolPositions(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const maxPositions = ops.buffer(convInfo.outShape, 'int32');\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * strideHeight - padTop;\n const xRMin = Math.max(0, xRCorner);\n const xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner);\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * strideWidth - padLeft;\n const xCMin = Math.max(0, xCCorner);\n const xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner);\n let maxValue = Number.NEGATIVE_INFINITY;\n let maxPosition = -1;\n for (let xR = xRMin; xR < xRMax; ++xR) {\n const wR = xR - xRCorner;\n for (let xC = xCMin; xC < xCMax; ++xC) {\n const wC = xC - xCCorner;\n const pixel = x.get(b, xR, xC, d);\n if (pixel > maxValue) {\n maxValue = pixel;\n maxPosition = wR * filterWidth + wC;\n }\n }\n }\n maxPositions.set(maxPosition, b, yR, yC, d);\n }\n }\n }\n }\n return maxPositions.toTensor();\n }\n\n maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const maxPositions = this.maxPoolPositions(x, convInfo);\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const dx = ops.buffer(x.shape, 'float32');\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let dxR = 0; dxR < convInfo.inHeight; ++dxR) {\n for (let dxC = 0; dxC < convInfo.inWidth; ++dxC) {\n // Shader code begins.\n const dyRCorner = dxR - padTop;\n const dyCCorner = dxC - padLeft;\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; ++wR) {\n const dyR = (dyRCorner + wR) / strideHeight;\n if (dyR < 0 || dyR >= convInfo.outHeight ||\n Math.floor(dyR) !== dyR) {\n continue;\n }\n for (let wC = 0; wC < filterWidth; ++wC) {\n const dyC = (dyCCorner + wC) / strideWidth;\n if (dyC < 0 || dyC >= convInfo.outWidth ||\n Math.floor(dyC) !== dyC) {\n continue;\n }\n const maxPos = filterHeight * filterWidth - 1 -\n maxPositions.get(b, dyR, dyC, d);\n const curPos = wR * filterWidth + wC;\n\n const mask = maxPos === curPos ? 1 : 0;\n if (mask === 0) {\n continue;\n }\n\n const pixel = dy.get(b, dyR, dyC, d);\n dotProd += pixel * mask;\n }\n }\n dx.set(dotProd, b, dxR, dxC, d);\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const dx = ops.buffer(x.shape, 'float32');\n\n const avgMultiplier = 1 / (filterHeight * filterWidth);\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let dxR = 0; dxR < convInfo.inHeight; ++dxR) {\n for (let dxC = 0; dxC < convInfo.inWidth; ++dxC) {\n // Shader code begins.\n const dyRCorner = dxR - padTop;\n const dyCCorner = dxC - padLeft;\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; ++wR) {\n const dyR = (dyRCorner + wR) / strideHeight;\n if (dyR < 0 || dyR >= convInfo.outHeight ||\n Math.floor(dyR) !== dyR) {\n continue;\n }\n for (let wC = 0; wC < filterWidth; ++wC) {\n const dyC = (dyCCorner + wC) / strideWidth;\n if (dyC < 0 || dyC >= convInfo.outWidth ||\n Math.floor(dyC) !== dyC) {\n continue;\n }\n\n const pixel = dy.get(b, dyR, dyC, d);\n dotProd += pixel;\n }\n }\n dx.set(dotProd * avgMultiplier, b, dxR, dxC, d);\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n cast(x: T, dtype: DataType): T {\n return backend_util.castTensor(x, dtype, this);\n }\n\n reshape(x: Tensor, shape: ShapeMap[R]): Tensor {\n return backend_util.reshapeTensor(x, shape);\n }\n\n avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return this.pool(x, convInfo, 'avg').toFloat();\n }\n\n resizeBilinear(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const [batch, oldHeight, oldWidth, numChannels] = x.shape;\n const output =\n ops.buffer([batch, newHeight, newWidth, numChannels], x.dtype);\n\n const effectiveInputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < newHeight; r++) {\n for (let c = 0; c < newWidth; c++) {\n for (let d = 0; d < numChannels; d++) {\n // Begin shader.\n\n // Compute the fractional index of the source.\n const sourceFracRow =\n (effectiveInputSize[0]) * r / (effectiveOutputSize[0]);\n const sourceFracCol =\n (effectiveInputSize[1]) * c / (effectiveOutputSize[1]);\n\n const sourceRowFloor = Math.floor(sourceFracRow);\n const sourceRowCeil =\n Math.min(oldHeight - 1, Math.ceil(sourceFracRow));\n const sourceColFloor = Math.floor(sourceFracCol);\n const sourceColCeil =\n Math.min(oldWidth - 1, Math.ceil(sourceFracCol));\n\n const topLeft = x.get(b, sourceRowFloor, sourceColFloor, d);\n const bottomLeft = x.get(b, sourceRowCeil, sourceColFloor, d);\n const topRight = x.get(b, sourceRowFloor, sourceColCeil, d);\n const bottomRight = x.get(b, sourceRowCeil, sourceColCeil, d);\n\n const rowFrac = sourceFracRow - sourceRowFloor;\n const colFrac = sourceFracCol - sourceColFloor;\n\n const top = topLeft + (topRight - topLeft) * colFrac;\n const bottom = bottomLeft + (bottomRight - bottomLeft) * colFrac;\n const newValue = top + (bottom - top) * rowFrac;\n\n output.set(newValue, b, r, c, d);\n }\n }\n }\n }\n return output.toTensor();\n }\n\n resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n const [batch, xHeight, xWidth, depth] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n const output =\n ops.buffer([batch, xHeight, xWidth, depth], x.dtype);\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass and add the corresponding\n // coefficient from dy to the gradient (with some interpolation).\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n // Reference implementation\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/3039375c86a5bbc9610c7725dcaa95d635f87ba2/tensorflow/core/kernels/resize_bilinear_op.cc#L275\n\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < yHeight; r++) {\n const dxR = r * heightScale;\n const topDxRIndex = Math.floor(dxR);\n const bottomDxRIndex = Math.min(Math.ceil(dxR), xHeight - 1);\n const dxRLerp = dxR - topDxRIndex;\n const inverseDxRLerp = 1.0 - dxRLerp;\n\n for (let c = 0; c < yWidth; c++) {\n const dxC = c * widthScale;\n const leftDxCIndex = Math.floor(dxC);\n const rightDxCIndex = Math.min(Math.ceil(dxC), xWidth - 1);\n const dxCLerp = dxC - leftDxCIndex;\n const inverseDxCLerp = 1.0 - dxCLerp;\n\n for (let d = 0; d < depth; d++) {\n const dyVal = dy.get(b, r, c, d);\n\n let topLeft = output.get(b, topDxRIndex, leftDxCIndex, d);\n topLeft += dyVal * inverseDxRLerp * inverseDxCLerp;\n output.set(topLeft, b, topDxRIndex, leftDxCIndex, d);\n\n let topRight = output.get(b, topDxRIndex, rightDxCIndex, d);\n topRight += dyVal * inverseDxRLerp * dxCLerp;\n output.set(topRight, b, topDxRIndex, rightDxCIndex, d);\n\n let bottomLeft = output.get(b, bottomDxRIndex, leftDxCIndex, d);\n bottomLeft += dyVal * dxRLerp * inverseDxCLerp;\n output.set(bottomLeft, b, bottomDxRIndex, leftDxCIndex, d);\n\n let bottomRight = output.get(b, bottomDxRIndex, rightDxCIndex, d);\n bottomRight += dyVal * dxRLerp * dxCLerp;\n output.set(bottomRight, b, bottomDxRIndex, rightDxCIndex, d);\n }\n }\n }\n }\n\n return output.toTensor();\n }\n\n resizeNearestNeighbor(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const [batch, oldHeight, oldWidth, numChannels] = x.shape;\n const output =\n ops.buffer([batch, newHeight, newWidth, numChannels], x.dtype);\n\n const effectiveInputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < newHeight; r++) {\n for (let c = 0; c < newWidth; c++) {\n for (let d = 0; d < numChannels; d++) {\n // Begin shader.\n // Compute the fractional index of the source.\n const sourceFracRow =\n (effectiveInputSize[0]) * r / (effectiveOutputSize[0]);\n const sourceFracCol =\n (effectiveInputSize[1]) * c / (effectiveOutputSize[1]);\n const sourceNearestRow = Math.min(\n oldHeight - 1,\n alignCorners ? Math.round(sourceFracRow) :\n Math.floor(sourceFracRow));\n const sourceNearestCol = Math.min(\n oldWidth - 1,\n alignCorners ? Math.round(sourceFracCol) :\n Math.floor(sourceFracCol));\n const newValue = x.get(b, sourceNearestRow, sourceNearestCol, d);\n output.set(newValue, b, r, c, d);\n }\n }\n }\n }\n\n return output.toTensor();\n }\n\n resizeNearestNeighborBackprop(\n dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n const [batch, xHeight, xWidth, depth] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n const output =\n ops.buffer([batch, xHeight, xWidth, depth], x.dtype);\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n const invHeightScale = 1 / heightScale;\n const invWidthScale = 1 / widthScale;\n\n // This defines the size of the window of values around a particular\n // index in dy that we want to search for contributions to dx.\n const winHeight = (Math.ceil(invHeightScale) * 2) + 2;\n const winWidth = (Math.ceil(invWidthScale) * 2) + 2;\n\n // Loop over the output space.\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < xHeight; r++) {\n for (let c = 0; c < xWidth; c++) {\n // Compute bounds for where in dy we will look\n const startRLerp = Math.floor(r * invHeightScale);\n const startDyR = Math.floor(startRLerp - (winHeight / 2));\n\n const startCLerp = Math.floor(c * invWidthScale);\n const startDyC = Math.floor(startCLerp - (winWidth / 2));\n\n for (let d = 0; d < depth; d++) {\n let accum = 0;\n // loop over dy\n\n for (let dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n const dyR = dyROffset + startDyR;\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= yHeight) {\n continue;\n }\n\n for (let dyCOffSet = 0; dyCOffSet < winWidth; dyCOffSet++) {\n const dyC = dyCOffSet + startDyC;\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= yWidth) {\n continue;\n }\n\n const sourceFracRow =\n effectiveXSize[0] * (dyR / effectiveYSize[0]);\n const sourceFracCol =\n effectiveXSize[1] * (dyC / effectiveYSize[1]);\n\n const sourceNearestRow = Math.min(\n xHeight - 1,\n alignCorners ? Math.round(sourceFracRow) :\n Math.floor(sourceFracRow));\n\n const sourceNearestCol = Math.min(\n xWidth - 1,\n alignCorners ? Math.round(sourceFracCol) :\n Math.floor(sourceFracCol));\n\n if (r === sourceNearestRow && c === sourceNearestCol) {\n accum += dy.get(b, dyR, dyC, d);\n }\n }\n }\n\n output.set(accum, b, r, c, d);\n }\n }\n }\n }\n return output.toTensor();\n }\n\n batchNormalization(\n x: Tensor4D, mean: Tensor4D|Tensor1D, variance: Tensor4D|Tensor1D,\n varianceEpsilon: number, scale?: Tensor4D|Tensor1D,\n offset?: Tensor4D|Tensor1D): Tensor4D {\n const xValues = x.dataSync();\n const meanValues = mean.dataSync();\n const varianceValues = variance.dataSync();\n const scaleValues = scale ? scale.dataSync() : new Float32Array([1]);\n const offsetValues = offset ? offset.dataSync() : new Float32Array([0]);\n const outValues = new Float32Array(xValues.length);\n\n for (let i = 0; i < xValues.length; i++) {\n outValues[i] = offsetValues[i % offsetValues.length] +\n (xValues[i] - meanValues[i % meanValues.length]) *\n scaleValues[i % scaleValues.length] /\n Math.sqrt(\n varianceValues[i % varianceValues.length] + varianceEpsilon);\n }\n return tensor4d(outValues, x.shape);\n }\n\n localResponseNormalization4D(\n x: Tensor4D, radius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const output = ops.buffer(x.shape, 'float32');\n const rad = radius;\n const maxD = output.shape[3] - 1;\n\n function sumAcrossChannels(\n b: number, r: number, c: number, d: number): number {\n let sum = 0.0;\n for (let j = Math.max(0, d - rad); j <= Math.min(d + rad, maxD); j++) {\n const z = x.get(b, r, c, j);\n sum += z * z;\n }\n return sum;\n }\n\n for (let b = 0; b < output.shape[0]; b++) {\n for (let r = 0; r <= output.shape[1]; r++) {\n for (let c = 0; c < output.shape[2]; c++) {\n for (let d = 0; d < output.shape[3]; d++) {\n const sum = sumAcrossChannels(b, r, c, d);\n const val = x.get(b, r, c, d) * Math.pow(bias + alpha * sum, -beta);\n output.set(val, b, r, c, d);\n }\n }\n }\n }\n\n return output.toTensor();\n }\n\n LRNGrad(\n dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D,\n depthRadius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const batch = dy.shape[0];\n const rows = dy.shape[1];\n const cols = dy.shape[2];\n const depth = dy.shape[3];\n const output = ops.buffer([batch, rows, cols, depth], 'float32');\n\n for (let b = 0; b < batch; ++b) {\n for (let r = 0; r < rows; ++r) {\n for (let c = 0; c < cols; ++c) {\n for (let d = 0; d < depth; ++d) {\n const depthBegin = Math.max(0, d - depthRadius);\n const depthEnd = Math.min(depth, d + depthRadius + 1);\n\n let norm = 0;\n for (let k = depthBegin; k < depthEnd; ++k) {\n norm += inputImage.get(b, r, c, k) * inputImage.get(b, r, c, k);\n }\n norm = alpha * norm + bias;\n for (let k = depthBegin; k < depthEnd; ++k) {\n let dyi = -2 * alpha * beta * inputImage.get(b, r, c, k) *\n outputImage.get(b, r, c, d) / norm;\n if (d === k) {\n dyi += Math.pow(norm, -beta);\n }\n dyi *= dy.get(b, r, c, d);\n output.set(dyi + output.get(b, r, c, k), b, r, c, k);\n }\n }\n }\n }\n }\n return output.toTensor();\n }\n\n multinomial(\n logits: Tensor2D, normalized: boolean, numSamples: number,\n seed: number): Tensor2D {\n const probabilities = normalized ? logits : ops.softmax(logits);\n const batchSize = probabilities.shape[0];\n const numEvents = probabilities.shape[1];\n const res = ops.zeros([batchSize, numSamples], 'int32');\n const resVals = res.dataSync();\n const probVals = probabilities.dataSync();\n\n for (let b = 0; b < batchSize; ++b) {\n const offset = b * numEvents;\n // The cdf won't include the last event. It will be implicit if no other\n // event happened.\n const cdf = new Float32Array(numEvents - 1);\n cdf[0] = probVals[offset];\n for (let event = 1; event < cdf.length; ++event) {\n cdf[event] = cdf[event - 1] + probVals[offset + event];\n }\n\n const random = seedrandom.alea(seed.toString());\n const outOffset = b * numSamples;\n for (let sampleId = 0; sampleId < numSamples; ++sampleId) {\n const r = random();\n\n // Assume last event happened by default.\n resVals[outOffset + sampleId] = cdf.length;\n\n for (let event = 0; event < cdf.length; event++) {\n if (r < cdf[event]) {\n resVals[outOffset + sampleId] = event;\n break;\n }\n }\n }\n }\n return res;\n }\n\n oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number):\n Tensor2D {\n const res = new Float32Array(indices.size * depth);\n res.fill(offValue);\n\n for (let event = 0; event < indices.size; ++event) {\n if (indices.get(event) >= 0 && indices.get(event) < depth) {\n res[event * depth + indices.get(event)] = onValue;\n }\n }\n return ops.tensor2d(res, [indices.size, depth], 'int32');\n }\n\n nonMaxSuppression(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number): Tensor1D {\n const boxesVals = boxes.dataSync();\n const scoresVals = scores.dataSync();\n return nonMaxSuppressionImpl(\n boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold);\n }\n\n private broadcastedBinaryOp(\n a: Tensor, b: Tensor, dtype: DataType,\n op: (a: number, b: number) => number): Tensor {\n const newShape =\n broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const result = ops.buffer(newShape, dtype);\n const aValues = a.dataSync();\n const bValues = b.dataSync();\n\n const aBroadcastDims = broadcast_util.getBroadcastDims(a.shape, newShape);\n const bBroadcastDims = broadcast_util.getBroadcastDims(b.shape, newShape);\n\n const aBuf = a.buffer();\n const bBuf = b.buffer();\n for (let i = 0; i < result.values.length; ++i) {\n const loc = result.indexToLoc(i);\n\n const aLoc = loc.slice(-a.rank);\n aBroadcastDims.forEach(d => aLoc[d] = 0);\n const aIndex = aBuf.locToIndex(aLoc);\n\n const bLoc = loc.slice(-b.rank);\n bBroadcastDims.forEach(d => bLoc[d] = 0);\n const bIndex = bBuf.locToIndex(bLoc);\n\n result.values[i] = op(aValues[aIndex], bValues[bIndex]);\n }\n return result.toTensor();\n }\n dispose() {}\n}\n\nENV.registerBackend(\n 'cpu', () => new MathBackendCPU(), 1 /* priority */, setTensorTracker);\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nconst delayCallback = typeof requestAnimationFrame !== 'undefined' ?\n requestAnimationFrame : // Browsers\n setImmediate; // Node.js\n\n/**\n * Returns a promise that resolve when a requestAnimationFrame has completed.\n *\n * On Node.js this uses setImmediate instead of requestAnimationFrame.\n *\n * This is simply a sugar method so that users can do the following:\n * `await tf.nextFrame();`\n */\n/** @doc {heading: 'Performance', subheading: 'Timing'} */\nfunction nextFrame(): Promise {\n return new Promise(resolve => delayCallback(() => resolve()));\n}\n\nexport {nextFrame};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/* Type definitions for exporting and importing of models. */\n\n/**\n * A map from Tensor dtype to number of bytes per element of the Tensor.\n */\nexport const DTYPE_VALUE_SIZE_MAP: {[dtype: string]: number} = {\n 'float32': 4,\n 'int32': 4,\n 'uint16': 2,\n 'uint8': 1,\n 'bool': 1,\n};\n\n/**\n * A weight manifest.\n *\n * The weight manifest consists of an ordered list of weight-manifest groups.\n * Each weight-manifest group (\"group\" for short hereafter) consists of a\n * number of weight values stored in a number of paths.\n * See the documentation of `WeightManifestGroupConfig` below for more details.\n */\nexport declare type WeightsManifestConfig = WeightsManifestGroupConfig[];\n\n/**\n * A weight-manifest group.\n *\n * Consists of an ordered list of weight values encoded in binary format,\n * stored in an ordered list of paths.\n */\nexport declare interface WeightsManifestGroupConfig {\n /**\n * An ordered list of paths.\n *\n * Paths are intentionally abstract in order to be general. For example, they\n * can be relative URL paths or relative paths on the file system.\n */\n paths: string[];\n\n /**\n * Specifications of the weights stored in the paths.\n */\n weights: WeightsManifestEntry[];\n}\n\n/**\n * An entry in the weight manifest.\n *\n * The entry contains specification of a weight.\n */\nexport declare interface WeightsManifestEntry {\n /**\n * Name of the weight, e.g., 'Dense_1/bias'\n */\n name: string;\n\n /**\n * Shape of the weight.\n */\n shape: number[];\n\n /**\n * Data type of the weight.\n */\n dtype: 'float32'|'int32'|'bool';\n\n /**\n * Information for dequantization of the weight.\n */\n quantization?: {\n scale: number, // The scaling constant to multiply by.\n min: number, // The (possibly nudged) minimum weight to add.\n dtype: 'uint16'|'uint8' // The dtype of the quantized weights.\n };\n}\n\n/**\n * Options for saving a model.\n */\nexport interface SaveConfig {\n /**\n * Whether to save only the trainable weights of the model, ignoring the\n * untrainable ones.\n */\n trainableOnly?: boolean;\n}\n\n/**\n * Result of a saving operation.\n */\nexport interface SaveResult {\n /**\n * Information about the model artifacts saved.\n */\n modelArtifactsInfo: ModelArtifactsInfo;\n\n /**\n * HTTP responses from the server that handled the model-saving request (if\n * any). This is applicable only to server-based saving routes.\n */\n responses?: Response[];\n\n /**\n * Error messages and related data (if any).\n */\n errors?: Array<{}|string>;\n}\n\nexport declare interface ModelArtifactsInfo {\n /**\n * Timestamp for when the model is saved.\n */\n dateSaved: Date;\n\n /**\n * Type of the model topology\n *\n * Possible values:\n * - JSON: JSON config (human-readable, e.g., Keras JSON).\n * - GraphDef: TensorFlow\n * [GraphDef](https://www.tensorflow.org/extend/tool_developers/#graphdef)\n * protocal buffer (binary).\n */\n modelTopologyType: 'JSON'|'GraphDef';\n\n /**\n * Size of model topology (Keras JSON or GraphDef), in bytes.\n */\n modelTopologyBytes?: number;\n\n /**\n * Size of weight specification or manifest, in bytes.\n */\n weightSpecsBytes?: number;\n\n /**\n * Size of weight value data, in bytes.\n */\n weightDataBytes?: number;\n}\n\n/**\n * The serialized artifacts of a model, including topology and weights.\n *\n * The `modelTopology`, `weightSpecs` and `weightData` fields of this interface\n * are optional, in order to support topology- or weights-only saving and\n * loading.\n */\nexport declare interface ModelArtifacts {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `FrozenModel`), this is a binary buffer\n * carrying the `GraphDef` protocol buffer.\n */\n modelTopology?: {}|ArrayBuffer;\n\n /**\n * Weight specifications.\n *\n * This corresponds to the weightsData below.\n */\n weightSpecs?: WeightsManifestEntry[];\n\n /**\n * Binary buffer for all weight values concatenated in the order specified\n * by `weightSpecs`.\n */\n weightData?: ArrayBuffer;\n}\n\n/**\n * Type definition for handlers of loading operations.\n */\nexport type LoadHandler = () => Promise;\n\n/**\n * Type definition for handlers of saving operations.\n */\nexport type SaveHandler = (modelArtifact: ModelArtifacts) =>\n Promise;\n\n/**\n * Interface for a model import/export handler.\n *\n * The `save` and `load` handlers are both optional, in order to allow handlers\n * that support only saving or loading.\n */\n// tslint:disable-next-line:interface-name\nexport interface IOHandler {\n save?: SaveHandler;\n load?: LoadHandler;\n}\n\n/**\n * An interface for the manager of a model store.\n *\n * A model store is defined as a storage medium on which multiple models can\n * be stored. Each stored model has a unique `path` as its identifier.\n * A `ModelStoreManager` for the store allows actions including\n *\n * - Listing the models stored in the store.\n * - Deleting a model from the store.\n */\nexport interface ModelStoreManager {\n /**\n * List all models in the model store.\n *\n * @returns A dictionary mapping paths of existing models to their\n * model artifacts info. Model artifacts info include type of the model's\n * topology, byte sizes of the topology, weights, etc.\n */\n listModels(): Promise<{[path: string]: ModelArtifactsInfo}>;\n\n /**\n * Remove a model specified by `path`.\n *\n * @param path\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n removeModel(path: string): Promise;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensor} from '../ops/tensor_ops';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport {sizeFromShape} from '../util';\nimport {DTYPE_VALUE_SIZE_MAP, ModelArtifacts, ModelArtifactsInfo, WeightsManifestEntry} from './types';\n\n/**\n * Encode a map from names to weight values as an ArrayBuffer, along with an\n * `Array` of `WeightsManifestEntry` as specification of the encoded weights.\n *\n * This function does not perform sharding.\n *\n * This function is the reverse of `decodeWeights`.\n *\n * @param tensors A map (\"dict\") from names to tensors.\n * @returns A `Promise` of\n * - A flat `ArrayBuffer` with all the binary values of the `Tensor`s\n * concatenated.\n * - An `Array` of `WeightManifestEntry`s, carrying information including\n * tensor names, `dtype`s and shapes.\n * @throws Error: on unsupported tensor `dtype`.\n */\nexport async function encodeWeights(tensors: NamedTensorMap):\n Promise<{data: ArrayBuffer, specs: WeightsManifestEntry[]}> {\n // TODO(adarob, cais): Support quantization.\n const specs: WeightsManifestEntry[] = [];\n const dataPromises: Array> = [];\n for (const name in tensors) {\n const t = tensors[name];\n\n if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool') {\n throw new Error(`Unsupported dtype in weight '${name}': ${t.dtype}`);\n }\n specs.push({name, shape: t.shape, dtype: t.dtype});\n dataPromises.push(t.data());\n }\n const tensorValues = await Promise.all(dataPromises);\n return {data: concatenateTypedArrays(tensorValues), specs};\n}\n\n/**\n * Decode flat ArrayBuffer as weights.\n *\n * This function does not handle sharding.\n *\n * This function is the reverse of `encodeWeights`.\n *\n * @param buffer A flat ArrayBuffer carrying the binary values of the tensors\n * concatenated in the order specified in `specs`.\n * @param specs Specifications of the names, dtypes and shapes of the tensors\n * whose value are encoded by `buffer`.\n * @return A map from tensor name to tensor value, with the names corresponding\n * to names in `specs`.\n * @throws Error, if any of the tensors has unsupported dtype.\n */\nexport function decodeWeights(\n buffer: ArrayBuffer, specs: WeightsManifestEntry[]): NamedTensorMap {\n // TODO(adarob, cais): Support quantization.\n const out: NamedTensorMap = {};\n let offset = 0;\n for (const spec of specs) {\n const name = spec.name;\n const dtype = spec.dtype;\n const shape = spec.shape;\n\n if (spec.quantization != null) {\n throw new Error(\n `decodeWeights does not support quantization yet, but encountered ` +\n `weight '${name} with quantization.'`);\n }\n\n const size = sizeFromShape(shape);\n let value: Tensor;\n if (dtype === 'float32') {\n value = tensor(new Float32Array(buffer, offset, size), shape, 'float32');\n } else if (dtype === 'int32') {\n value = tensor(new Int32Array(buffer, offset, size), shape, 'int32');\n } else if (dtype === 'bool') {\n value = tensor(new Uint8Array(buffer, offset, size), shape, 'bool');\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n out[name] = value;\n\n offset += size * DTYPE_VALUE_SIZE_MAP[dtype];\n }\n return out;\n}\n\n/**\n * Concatenate TypedArrays into an ArrayBuffer.\n */\nexport function concatenateTypedArrays(xs: TypedArray[]): ArrayBuffer {\n // TODO(adarob, cais): Support quantization.\n if (xs === null) {\n throw new Error(`Invalid input value: ${JSON.stringify(xs)}`);\n }\n\n let totalByteLength = 0;\n\n // `normalizedXs` is here for this reason: a `TypedArray`'s `buffer'\n // can have a different byte length from that of the `TypedArray` itself,\n // for example, when the `TypedArray` is created from an offset in an\n // `ArrayBuffer`. `normliazedXs` holds `TypedArray`s whose `buffer`s match\n // the `TypedArray` in byte length. If an element of `xs` does not show\n // this property, a new `TypedArray` that satisfy this property will be\n // constructed and pushed into `normalizedXs`.\n const normalizedXs: TypedArray[] = [];\n xs.forEach((x: TypedArray) => {\n totalByteLength += x.byteLength;\n // tslint:disable:no-any\n normalizedXs.push(\n x.byteLength === x.buffer.byteLength ? x :\n new (x.constructor as any)(x));\n if (!(x as any instanceof Float32Array || x as any instanceof Int32Array ||\n x as any instanceof Uint8Array)) {\n throw new Error(`Unsupported TypedArray subtype: ${x.constructor.name}`);\n }\n // tslint:enable:no-any\n });\n\n const y = new Uint8Array(totalByteLength);\n let offset = 0;\n normalizedXs.forEach((x: TypedArray) => {\n y.set(new Uint8Array(x.buffer), offset);\n offset += x.byteLength;\n });\n\n return y.buffer;\n}\n\n// Use Buffer on Node.js instead of Blob/atob/btoa\nconst useNodeBuffer = typeof Buffer !== 'undefined' &&\n (typeof Blob === 'undefined' || typeof atob === 'undefined' ||\n typeof btoa === 'undefined');\n\n/**\n * Calculate the byte length of a JavaScript string.\n *\n * Note that a JavaScript string can contain wide characters, therefore the\n * length of the string is not necessarily equal to the byte length.\n *\n * @param str Input string.\n * @returns Byte length.\n */\nexport function stringByteLength(str: string): number {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}\n\n/**\n * Encode an ArrayBuffer as a base64 encoded string.\n *\n * @param buffer `ArrayBuffer` to be converted.\n * @returns A string that base64-encodes `buffer`.\n */\nexport function arrayBufferToBase64String(buffer: ArrayBuffer): string {\n if (useNodeBuffer) {\n return Buffer.from(buffer).toString('base64');\n }\n return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer)));\n}\n\n/**\n * Decode a base64 string as an ArrayBuffer.\n *\n * @param str Base64 string.\n * @returns Decoded `ArrayBuffer`.\n */\nexport function base64StringToArrayBuffer(str: string): ArrayBuffer {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}\n\n/**\n * Concatenate a number of ArrayBuffers into one.\n *\n * @param buffers A number of array buffers to concatenate.\n * @returns Result of concatenating `buffers` in order.\n */\nexport function concatenateArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer {\n let totalByteLength = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n totalByteLength += buffer.byteLength;\n });\n\n const temp = new Uint8Array(totalByteLength);\n let offset = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}\n\n/**\n * Get the basename of a path.\n *\n * Behaves in a way analogous to Linux's basename command.\n *\n * @param path\n */\nexport function basename(path: string): string {\n const SEPARATOR = '/';\n path = path.trim();\n while (path.endsWith(SEPARATOR)) {\n path = path.slice(0, path.length - 1);\n }\n const items = path.split(SEPARATOR);\n return items[items.length - 1];\n}\n\n/**\n * Populate ModelArtifactsInfo fields for a model with JSON topology.\n * @param modelArtifacts\n * @returns A ModelArtifactsInfo object.\n */\nexport function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts):\n ModelArtifactsInfo {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error('Expected JSON model topology, received ArrayBuffer.');\n }\n\n return {\n dateSaved: new Date(),\n modelTopologyType: 'JSON',\n modelTopologyBytes: modelArtifacts.modelTopology == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.modelTopology)),\n weightSpecsBytes: modelArtifacts.weightSpecs == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)),\n weightDataBytes: modelArtifacts.weightData == null ?\n 0 :\n modelArtifacts.weightData.byteLength,\n };\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {IOHandler} from './types';\n\nexport type IORouter = (url: string) => IOHandler;\n\nexport class IORouterRegistry {\n // Singleton instance.\n private static instance: IORouterRegistry;\n\n private saveRouters: IORouter[];\n private loadRouters: IORouter[];\n\n private constructor() {\n this.saveRouters = [];\n this.loadRouters = [];\n }\n\n private static getInstance(): IORouterRegistry {\n if (IORouterRegistry.instance == null) {\n IORouterRegistry.instance = new IORouterRegistry();\n }\n return IORouterRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerSaveRouter(saveRouter: IORouter) {\n IORouterRegistry.getInstance().saveRouters.push(saveRouter);\n }\n\n /**\n * Register a load-handler router.\n *\n * @param loadRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `load` method defined or `null`.\n */\n static registerLoadRouter(loadRouter: IORouter) {\n IORouterRegistry.getInstance().loadRouters.push(loadRouter);\n }\n\n /**\n * Look up IOHandler for saving, given a URL-like string.\n *\n * @param url\n * @returns If only one match is found, an instance of IOHandler with the\n * `save` method defined. If no match is found, `null`.\n * @throws Error, if more than one match is found.\n */\n static getSaveHandlers(url: string): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'save');\n }\n\n /**\n * Look up IOHandler for loading, given a URL-like string.\n *\n * @param url\n * @returns All valid handlers for `url`, given the currently registered\n * handler routers.\n */\n static getLoadHandlers(url: string): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'load');\n }\n\n private static getHandlers(url: string, handlerType: 'save'|'load'):\n IOHandler[] {\n const validHandlers: IOHandler[] = [];\n const routers = handlerType === 'load' ? this.getInstance().loadRouters :\n this.getInstance().saveRouters;\n routers.forEach(router => {\n const handler = router(url);\n if (handler !== null) {\n validHandlers.push(handler);\n }\n });\n return validHandlers;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Classes and functions for model management across multiple storage mediums.\n *\n * Supported client actions:\n * - Listing models on all registered storage mediums.\n * - Remove model by URL from any registered storage mediums, by using URL\n * string.\n * - Moving or copying model from one path to another in the same medium or from\n * one medium to another, by using URL strings.\n */\n\nimport {assert} from '../util';\n\nimport {IORouterRegistry} from './router_registry';\nimport {ModelArtifactsInfo, ModelStoreManager} from './types';\n\nconst URL_SCHEME_SUFFIX = '://';\n\nexport class ModelStoreManagerRegistry {\n // Singleton instance.\n private static instance: ModelStoreManagerRegistry;\n\n private managers: {[scheme: string]: ModelStoreManager};\n\n private constructor() {\n this.managers = {};\n }\n\n private static getInstance(): ModelStoreManagerRegistry {\n if (ModelStoreManagerRegistry.instance == null) {\n ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry();\n }\n return ModelStoreManagerRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerManager(scheme: string, manager: ModelStoreManager) {\n assert(scheme != null, 'scheme must not be undefined or null.');\n if (scheme.endsWith(URL_SCHEME_SUFFIX)) {\n scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX));\n }\n assert(scheme.length > 0, 'scheme must not be an empty string.');\n const registry = ModelStoreManagerRegistry.getInstance();\n assert(\n registry.managers[scheme] == null,\n `A model store manager is already registered for scheme '${scheme}'.`);\n registry.managers[scheme] = manager;\n }\n\n static getManager(scheme: string): ModelStoreManager {\n const manager = this.getInstance().managers[scheme];\n if (manager == null) {\n throw new Error(`Cannot find model manager for scheme '${scheme}'`);\n }\n return manager;\n }\n\n static getSchemes(): string[] {\n return Object.keys(this.getInstance().managers);\n }\n}\n\n/**\n * Helper method for parsing a URL string into a scheme and a path.\n *\n * @param url E.g., 'localstorage://my-model'\n * @returns A dictionary with two fields: scheme and path.\n * Scheme: e.g., 'localstorage' in the example above.\n * Path: e.g., 'my-model' in the example above.\n */\nfunction parseURL(url: string): {scheme: string, path: string} {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\n `The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}\n\nasync function cloneModelInternal(\n sourceURL: string, destURL: string,\n deleteSource = false): Promise {\n assert(\n sourceURL !== destURL,\n `Old path and new path are the same: '${sourceURL}'`);\n\n const loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL);\n assert(\n loadHandlers.length > 0,\n `Copying failed because no load handler is found for source URL ${\n sourceURL}.`);\n assert(\n loadHandlers.length < 2,\n `Copying failed because more than one (${loadHandlers.length}) ` +\n `load handlers for source URL ${sourceURL}.`);\n const loadHandler = loadHandlers[0];\n\n const saveHandlers = IORouterRegistry.getSaveHandlers(destURL);\n assert(\n saveHandlers.length > 0,\n `Copying failed because no save handler is found for destination URL ` +\n `${destURL}.`);\n assert(\n saveHandlers.length < 2,\n `Copying failed because more than one (${loadHandlers.length}) ` +\n `save handlers for destination URL ${destURL}.`);\n const saveHandler = saveHandlers[0];\n\n const sourceScheme = parseURL(sourceURL).scheme;\n const sourcePath = parseURL(sourceURL).path;\n const sameMedium = sourceScheme === parseURL(sourceURL).scheme;\n\n const modelArtifacts = await loadHandler.load();\n\n // If moving within the same storage medium, remove the old model as soon as\n // the loading is done. Without doing this, it is possible that the combined\n // size of the two models will cause the cloning to fail.\n if (deleteSource && sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n const saveResult = await saveHandler.save(modelArtifacts);\n\n // If moving between mediums, the deletion is done after the save succeeds.\n // This guards against the case in which saving to the destination medium\n // fails.\n if (deleteSource && !sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n return saveResult.modelArtifactsInfo;\n}\n\n/**\n * List all models stored in registered storage mediums.\n *\n * For a web browser environment, the registered mediums are Local Storage and\n * IndexedDB.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @returns A `Promise` of a dictionary mapping URLs of existing models to\n * their model artifacts info. URLs include medium-specific schemes, e.g.,\n * 'indexeddb://my/model/1'. Model artifacts info include type of the\n * model's topology, byte sizes of the topology, weights, etc.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function listModels(): Promise<{[url: string]: ModelArtifactsInfo}> {\n const schemes = ModelStoreManagerRegistry.getSchemes();\n const out: {[url: string]: ModelArtifactsInfo} = {};\n for (const scheme of schemes) {\n const schemeOut =\n await ModelStoreManagerRegistry.getManager(scheme).listModels();\n for (const path in schemeOut) {\n const url = scheme + URL_SCHEME_SUFFIX + path;\n out[url] = schemeOut[path];\n }\n }\n return out;\n}\n\n/**\n * Remove a model specified by URL from a reigstered storage medium.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @param url A URL to a stored model, with a scheme prefix, e.g.,\n * 'localstorage://my-model-1', 'indexeddb://my/model/2'.\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function removeModel(url: string): Promise {\n const schemeAndPath = parseURL(url);\n const manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme);\n return await manager.removeModel(schemeAndPath.path);\n}\n\n/**\n * Copy a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Copying within a storage medium, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Copying between two storage mediums, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Copy the model, from Local Storage to IndexedDB.\n * await tf.io.copyModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove both models.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of copying.\n * @param destURL Destination URL of copying.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if copying fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function copyModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = false;\n return await cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\n/**\n * Move a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Moving within a storage medium, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Moving between two storage mediums, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Move the model, from Local Storage to IndexedDB.\n * await tf.io.moveModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove the moved model.\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of moving.\n * @param destURL Destination URL of moving.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if moving fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function moveModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = true;\n return await cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\nexport {moveModel, copyModel, removeModel, listModels};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {getModelArtifactsInfoForJSON} from './io_utils';\nimport {ModelStoreManagerRegistry} from './model_management';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst DATABASE_NAME = 'tensorflowjs';\nconst DATABASE_VERSION = 1;\n\n// Model data and ModelArtifactsInfo (metadata) are stored in two separate\n// stores for efficient access of the list of stored models and their metadata.\n// 1. The object store for model data: topology, weights and weight manifests.\nconst MODEL_STORE_NAME = 'models_store';\n// 2. The object store for ModelArtifactsInfo, including meta-information such\n// as the type of topology (JSON vs binary), byte size of the topology, byte\n// size of the weights, etc.\nconst INFO_STORE_NAME = 'model_info_store';\n\n/**\n * Delete the entire database for tensorflow.js, including the models store.\n */\nexport async function deleteDatabase(): Promise {\n const idbFactory = getIndexedDBFactory();\n\n return new Promise((resolve, reject) => {\n const deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME);\n deleteRequest.onsuccess = () => resolve();\n deleteRequest.onerror = error => reject(error);\n });\n}\n\nfunction getIndexedDBFactory(): IDBFactory {\n if (!ENV.get('IS_BROWSER')) {\n // TODO(cais): Add more info about what IOHandler subtypes are available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'Failed to obtain IndexedDB factory because the current environment' +\n 'is not a web browser.');\n }\n // tslint:disable-next-line:no-any\n const theWindow: any = window;\n const factory = theWindow.indexedDB || theWindow.mozIndexedDB ||\n theWindow.webkitIndexedDB || theWindow.msIndexedDB ||\n theWindow.shimIndexedDB;\n if (factory == null) {\n throw new Error(\n 'The current browser does not appear to support IndexedDB.');\n }\n return factory;\n}\n\nfunction setUpDatabase(openRequest: IDBRequest) {\n const db = openRequest.result as IDBDatabase;\n db.createObjectStore(MODEL_STORE_NAME, {keyPath: 'modelPath'});\n db.createObjectStore(INFO_STORE_NAME, {keyPath: 'modelPath'});\n}\n\n/**\n * IOHandler subclass: Browser IndexedDB.\n *\n * See the doc string of `browserIndexedDB` for more details.\n */\nexport class BrowserIndexedDB implements IOHandler {\n protected readonly indexedDB: IDBFactory;\n protected readonly modelPath: string;\n\n static readonly URL_SCHEME = 'indexeddb://';\n\n constructor(modelPath: string) {\n this.indexedDB = getIndexedDBFactory();\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For IndexedDB, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n // TODO(cais): Support saving GraphDef models.\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n return this.databaseAction(this.modelPath, modelArtifacts) as\n Promise;\n }\n\n async load(): Promise {\n return this.databaseAction(this.modelPath) as Promise;\n }\n\n /**\n * Perform database action to put model artifacts into or read model artifacts\n * from IndexedDB object store.\n *\n * Whether the action is put or get depends on whether `modelArtifacts` is\n * specified. If it is specified, the action will be put; otherwise the action\n * will be get.\n *\n * @param modelPath A unique string path for the model.\n * @param modelArtifacts If specified, it will be the model artifacts to be\n * stored in IndexedDB.\n * @returns A `Promise` of `SaveResult`, if the action is put, or a `Promise`\n * of `ModelArtifacts`, if the action is get.\n */\n private databaseAction(modelPath: string, modelArtifacts?: ModelArtifacts):\n Promise {\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result as IDBDatabase;\n\n if (modelArtifacts == null) {\n // Read model out from object store.\n const modelTx = db.transaction(MODEL_STORE_NAME, 'readonly');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const getRequest = modelStore.get(this.modelPath);\n getRequest.onsuccess = () => {\n if (getRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${this.modelPath}' ` +\n `in IndexedDB.`));\n } else {\n resolve(getRequest.result.modelArtifacts);\n }\n };\n getRequest.onerror = error => {\n db.close();\n return reject(getRequest.error);\n };\n modelTx.oncomplete = () => db.close();\n } else {\n // Put model into object store.\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n // First, put ModelArtifactsInfo into info store.\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n let infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const putInfoRequest =\n infoStore.put({modelPath: this.modelPath, modelArtifactsInfo});\n let modelTx: IDBTransaction;\n putInfoRequest.onsuccess = () => {\n // Second, put model data into model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const putModelRequest = modelStore.put({\n modelPath: this.modelPath,\n modelArtifacts,\n modelArtifactsInfo\n });\n putModelRequest.onsuccess = () => resolve({modelArtifactsInfo});\n putModelRequest.onerror = error => {\n // If the put-model request fails, roll back the info entry as\n // well.\n infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const deleteInfoRequest = infoStore.delete(this.modelPath);\n deleteInfoRequest.onsuccess = () => {\n db.close();\n return reject(putModelRequest.error);\n };\n deleteInfoRequest.onerror = error => {\n db.close();\n return reject(putModelRequest.error);\n };\n };\n };\n putInfoRequest.onerror = error => {\n db.close();\n return reject(putInfoRequest.error);\n };\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n }\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nexport const indexedDBRouter: IORouter = (url: string) => {\n if (!ENV.get('IS_BROWSER')) {\n return null;\n } else {\n if (url.startsWith(BrowserIndexedDB.URL_SCHEME)) {\n return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(indexedDBRouter);\nIORouterRegistry.registerLoadRouter(indexedDBRouter);\n\n/**\n * Creates a browser IndexedDB IOHandler for saving and loading models.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save('indexeddb://MyModel'));\n * console.log(saveResult);\n * ```\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`),\n * which can be used with, e.g., `tf.Model.save`.\n */\nexport function browserIndexedDB(modelPath: string): IOHandler {\n return new BrowserIndexedDB(modelPath);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserIndexedDB.URL_SCHEME) ?\n key.slice(BrowserIndexedDB.URL_SCHEME.length) :\n key;\n}\n\nexport class BrowserIndexedDBManager implements ModelStoreManager {\n private indexedDB: IDBFactory;\n\n constructor() {\n this.indexedDB = getIndexedDBFactory();\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n return new Promise<{[path: string]: ModelArtifactsInfo}>(\n (resolve, reject) => {\n const openRequest =\n this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result as IDBDatabase;\n const tx = db.transaction(INFO_STORE_NAME, 'readonly');\n const store = tx.objectStore(INFO_STORE_NAME);\n // tslint:disable:max-line-length\n // Need to cast `store` as `any` here because TypeScript's DOM\n // library does not have the `getAll()` method even though the\n // method is supported in the latest version of most mainstream\n // browsers:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll\n // tslint:enable:max-line-length\n // tslint:disable-next-line:no-any\n const getAllInfoRequest = (store as any).getAll() as IDBRequest;\n getAllInfoRequest.onsuccess = () => {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n for (const item of getAllInfoRequest.result) {\n out[item.modelPath] = item.modelArtifactsInfo;\n }\n resolve(out);\n };\n getAllInfoRequest.onerror = error => {\n db.close();\n return reject(getAllInfoRequest.error);\n };\n tx.oncomplete = () => db.close();\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result as IDBDatabase;\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n const infoStore = infoTx.objectStore(INFO_STORE_NAME);\n\n const getInfoRequest = infoStore.get(path);\n let modelTx: IDBTransaction;\n getInfoRequest.onsuccess = () => {\n if (getInfoRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${path}' ` +\n `in IndexedDB.`));\n } else {\n // First, delete the entry in the info store.\n const deleteInfoRequest = infoStore.delete(path);\n const deleteModelData = () => {\n // Second, delete the entry in the model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const deleteModelRequest = modelStore.delete(path);\n deleteModelRequest.onsuccess = () =>\n resolve(getInfoRequest.result.modelArtifactsInfo);\n deleteModelRequest.onerror = error =>\n reject(getInfoRequest.error);\n };\n // Proceed with deleting model data regardless of whether deletion\n // of info data succeeds or not.\n deleteInfoRequest.onsuccess = deleteModelData;\n deleteInfoRequest.onerror = error => {\n deleteModelData();\n db.close();\n return reject(getInfoRequest.error);\n };\n }\n };\n getInfoRequest.onerror = error => {\n db.close();\n return reject(getInfoRequest.error);\n };\n\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nif (ENV.get('IS_BROWSER')) {\n // Wrap the construction and registration, to guard against browsers that\n // don't support Local Storage.\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager());\n } catch (err) {\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {assert} from '../util';\nimport {arrayBufferToBase64String, base64StringToArrayBuffer, getModelArtifactsInfoForJSON} from './io_utils';\nimport {ModelStoreManagerRegistry} from './model_management';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst PATH_SEPARATOR = '/';\nconst PATH_PREFIX = 'tensorflowjs_models';\nconst INFO_SUFFIX = 'info';\nconst MODEL_TOPOLOGY_SUFFIX = 'model_topology';\nconst WEIGHT_SPECS_SUFFIX = 'weight_specs';\nconst WEIGHT_DATA_SUFFIX = 'weight_data';\n\n/**\n * Purge all tensorflow.js-saved model artifacts from local storage.\n *\n * @returns Paths of the models purged.\n */\nexport function purgeLocalStorageArtifacts(): string[] {\n if (!ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') {\n throw new Error(\n 'purgeLocalStorageModels() cannot proceed because local storage is ' +\n 'unavailable in the current environment.');\n }\n const LS = window.localStorage;\n const purgedModelPaths: string[] = [];\n for (let i = 0; i < LS.length; ++i) {\n const key = LS.key(i);\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n if (key.startsWith(prefix) && key.length > prefix.length) {\n LS.removeItem(key);\n const modelName = getModelPathFromKey(key);\n if (purgedModelPaths.indexOf(modelName) === -1) {\n purgedModelPaths.push(modelName);\n }\n }\n }\n return purgedModelPaths;\n}\n\nfunction getModelKeys(path: string):\n {info: string, topology: string, weightSpecs: string, weightData: string} {\n return {\n info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR),\n topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR),\n weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR),\n weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR)\n };\n}\n\n/**\n * Get model path from a local-storage key.\n *\n * E.g., 'tensorflowjs_models/my/model/1/info' --> 'my/model/1'\n *\n * @param key\n */\nfunction getModelPathFromKey(key: string) {\n const items = key.split(PATH_SEPARATOR);\n if (items.length < 3) {\n throw new Error(`Invalid key format: ${key}`);\n }\n return items.slice(1, items.length - 1).join(PATH_SEPARATOR);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserLocalStorage.URL_SCHEME) ?\n key.slice(BrowserLocalStorage.URL_SCHEME.length) :\n key;\n}\n\n/**\n * IOHandler subclass: Browser Local Storage.\n *\n * See the doc string to `browserLocalStorage` for more details.\n */\nexport class BrowserLocalStorage implements IOHandler {\n protected readonly LS: Storage;\n protected readonly modelPath: string;\n protected readonly keys: {[key: string]: string};\n\n static readonly URL_SCHEME = 'localstorage://';\n\n constructor(modelPath: string) {\n if (!ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') {\n // TODO(cais): Add more info about what IOHandler subtypes are\n // available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'The current environment does not support local storage.');\n }\n this.LS = window.localStorage;\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For local storage, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n this.keys = getModelKeys(this.modelPath);\n }\n\n /**\n * Save model artifacts to browser local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @param modelArtifacts The model artifacts to be stored.\n * @returns An instance of SaveResult.\n */\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const topology = JSON.stringify(modelArtifacts.modelTopology);\n const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs);\n\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n\n try {\n this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo));\n this.LS.setItem(this.keys.topology, topology);\n this.LS.setItem(this.keys.weightSpecs, weightSpecs);\n this.LS.setItem(\n this.keys.weightData,\n arrayBufferToBase64String(modelArtifacts.weightData));\n\n return {modelArtifactsInfo};\n } catch (err) {\n // If saving failed, clean up all items saved so far.\n for (const key in this.keys) {\n this.LS.removeItem(this.keys[key]);\n }\n\n throw new Error(\n `Failed to save model '${this.modelPath}' to local storage: ` +\n `size quota being exceeded is a possible cause of this failure: ` +\n `modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, ` +\n `weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, ` +\n `weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`);\n }\n }\n }\n\n /**\n * Load a model from local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @returns The loaded model (if loading succeeds).\n */\n async load(): Promise {\n const info =\n JSON.parse(this.LS.getItem(this.keys.info)) as ModelArtifactsInfo;\n if (info == null) {\n throw new Error(\n `In local storage, there is no model with name '${this.modelPath}'`);\n }\n\n if (info.modelTopologyType !== 'JSON') {\n throw new Error(\n 'BrowserLocalStorage does not support loading non-JSON model ' +\n 'topology yet.');\n }\n\n const out: ModelArtifacts = {};\n\n // Load topology.\n const topology = JSON.parse(this.LS.getItem(this.keys.topology));\n if (topology == null) {\n throw new Error(\n `In local storage, the topology of model '${this.modelPath}' ` +\n `is missing.`);\n }\n out.modelTopology = topology;\n\n // Load weight specs.\n const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs));\n if (weightSpecs == null) {\n throw new Error(\n `In local storage, the weight specs of model '${this.modelPath}' ` +\n `are missing.`);\n }\n out.weightSpecs = weightSpecs;\n\n // Load weight data.\n const weightDataBase64 = this.LS.getItem(this.keys.weightData);\n if (weightDataBase64 == null) {\n throw new Error(\n `In local storage, the binary weight values of model ` +\n `'${this.modelPath}' are missing.`);\n }\n out.weightData = base64StringToArrayBuffer(weightDataBase64);\n\n return out;\n }\n}\n\nexport const localStorageRouter: IORouter = (url: string) => {\n if (!ENV.get('IS_BROWSER')) {\n return null;\n } else {\n if (url.startsWith(BrowserLocalStorage.URL_SCHEME)) {\n return browserLocalStorage(\n url.slice(BrowserLocalStorage.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(localStorageRouter);\nIORouterRegistry.registerLoadRouter(localStorageRouter);\n\n/**\n * Factory function for local storage IOHandler.\n *\n * This `IOHandler` supports both `save` and `load`.\n *\n * For each model's saved artifacts, four items are saved to local storage.\n * - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the\n * model, such as date saved, type of the topology, size in bytes, etc.\n * - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras-\n * style models, this is a stringized JSON.\n * - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the\n * model, can be used to decode the saved binary weight values (see\n * item below).\n * - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary\n * weight values, stored as a base64-encoded string.\n *\n * Saving may throw an `Error` if the total size of the artifacts exceed the\n * browser-specific quota.\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `IOHandler`, which can be used with, e.g.,\n * `tf.Model.save`.\n */\nexport function browserLocalStorage(modelPath: string): IOHandler {\n return new BrowserLocalStorage(modelPath);\n}\n\nexport class BrowserLocalStorageManager implements ModelStoreManager {\n private readonly LS: Storage;\n\n constructor() {\n assert(ENV.get('IS_BROWSER'), 'Current environment is not a web browser');\n assert(\n typeof window.localStorage !== 'undefined',\n 'Current browser does not appear to support localStorage');\n this.LS = window.localStorage;\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n const suffix = PATH_SEPARATOR + INFO_SUFFIX;\n for (let i = 0; i < this.LS.length; ++i) {\n const key = this.LS.key(i);\n if (key.startsWith(prefix) && key.endsWith(suffix)) {\n const modelPath = getModelPathFromKey(key);\n out[modelPath] = JSON.parse(this.LS.getItem(key)) as ModelArtifactsInfo;\n }\n }\n return out;\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n const keys = getModelKeys(path);\n if (this.LS.getItem(keys.info) == null) {\n throw new Error(`Cannot find model at path '${path}'`);\n }\n const info = JSON.parse(this.LS.getItem(keys.info)) as ModelArtifactsInfo;\n\n this.LS.removeItem(keys.info);\n this.LS.removeItem(keys.topology);\n this.LS.removeItem(keys.weightSpecs);\n this.LS.removeItem(keys.weightData);\n return info;\n }\n}\n\nif (ENV.get('IS_BROWSER')) {\n // Wrap the construction and registration, to guard against browsers that\n // don't support Local Storage.\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager());\n } catch (err) {\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers related to files, such as browser-triggered file downloads,\n * user-selected files in browser.\n */\n\nimport {ENV} from '../environment';\nimport {basename, concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\nconst DEFAULT_FILE_NAME_PREFIX = 'model';\nconst DEFAULT_JSON_EXTENSION_NAME = '.json';\nconst DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin';\n\nexport class BrowserDownloads implements IOHandler {\n private readonly modelTopologyFileName: string;\n private readonly weightDataFileName: string;\n private readonly jsonAnchor: HTMLAnchorElement;\n private readonly weightDataAnchor: HTMLAnchorElement;\n\n static readonly URL_SCHEME = 'downloads://';\n\n constructor(fileNamePrefix?: string) {\n if (!ENV.get('IS_BROWSER')) {\n // TODO(cais): Provide info on what IOHandlers are available under the\n // current environment.\n throw new Error(\n 'triggerDownloads() cannot proceed because the current environment ' +\n 'is not a browser.');\n }\n\n if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) {\n fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length);\n }\n if (fileNamePrefix == null || fileNamePrefix.length === 0) {\n fileNamePrefix = DEFAULT_FILE_NAME_PREFIX;\n }\n\n this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME;\n this.weightDataFileName =\n fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n const weightsURL = window.URL.createObjectURL(new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}));\n\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'DownloadTrigger.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./' + this.weightDataFileName],\n weights: modelArtifacts.weightSpecs\n }];\n const modelTopologyAndWeightManifest = {\n modelTopology: modelArtifacts.modelTopology,\n weightsManifest\n };\n const modelTopologyAndWeightManifestURL =\n window.URL.createObjectURL(new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: 'application/json'}));\n\n // If anchor elements are not provided, create them without attaching them\n // to parents, so that the downloaded file names can be controlled.\n const jsonAnchor = this.jsonAnchor == null ? document.createElement('a') :\n this.jsonAnchor;\n jsonAnchor.download = this.modelTopologyFileName;\n jsonAnchor.href = modelTopologyAndWeightManifestURL;\n // Trigger downloads by calling the `click` methods on the download\n // anchors.\n jsonAnchor.click();\n\n if (modelArtifacts.weightData != null) {\n const weightDataAnchor = this.weightDataAnchor == null ?\n document.createElement('a') :\n this.weightDataAnchor;\n weightDataAnchor.download = this.weightDataFileName;\n weightDataAnchor.href = weightsURL;\n weightDataAnchor.click();\n }\n\n return {modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts)};\n }\n }\n}\n\nclass BrowserFiles implements IOHandler {\n private readonly files: File[];\n\n constructor(files: File[]) {\n if (files == null || files.length < 1) {\n throw new Error(\n `When calling browserFiles, at least 1 file is required, ` +\n `but received ${files}`);\n }\n this.files = files;\n }\n\n async load(): Promise {\n const jsonFile = this.files[0];\n const weightFiles = this.files.slice(1);\n\n return new Promise((resolve, reject) => {\n const jsonReader = new FileReader();\n jsonReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const modelJSON = JSON.parse((event.target as any).result);\n const modelTopology = modelJSON.modelTopology as {};\n if (modelTopology == null) {\n reject(new Error(\n `modelTopology field is missing from file ${jsonFile.name}`));\n return;\n }\n\n if (weightFiles.length === 0) {\n resolve({modelTopology});\n }\n\n const weightsManifest =\n modelJSON.weightsManifest as WeightsManifestConfig;\n if (weightsManifest == null) {\n reject(new Error(\n `weightManifest field is missing from file ${jsonFile.name}`));\n return;\n }\n\n let pathToFile: {[path: string]: File};\n try {\n pathToFile =\n this.checkManifestAndWeightFiles(weightsManifest, weightFiles);\n } catch (err) {\n reject(err);\n return;\n }\n\n const weightSpecs: WeightsManifestEntry[] = [];\n const paths: string[] = [];\n const perFileBuffers: ArrayBuffer[] = [];\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n paths.push(path);\n perFileBuffers.push(null);\n });\n weightSpecs.push(...weightsGroup.weights);\n });\n\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n const weightFileReader = new FileReader();\n weightFileReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const weightData = (event.target as any).result as ArrayBuffer;\n const index = paths.indexOf(path);\n perFileBuffers[index] = weightData;\n if (perFileBuffers.indexOf(null) === -1) {\n resolve({\n modelTopology,\n weightSpecs,\n weightData: concatenateArrayBuffers(perFileBuffers),\n });\n }\n };\n weightFileReader.onerror = (error: FileReaderProgressEvent) => {\n reject(`Failed to weights data from file of path '${path}'.`);\n return;\n };\n weightFileReader.readAsArrayBuffer(pathToFile[path]);\n });\n });\n };\n jsonReader.onerror = (error: FileReaderProgressEvent) => {\n reject(\n `Failed to read model topology and weights manifest JSON ` +\n `from file '${jsonFile.name}'. BrowserFiles supports loading ` +\n `Keras-style tf.Model artifacts only.`);\n return;\n };\n jsonReader.readAsText(jsonFile);\n });\n }\n\n /**\n * Check the compatibility between weights manifest and weight files.\n */\n private checkManifestAndWeightFiles(\n manifest: WeightsManifestConfig, files: File[]): {[path: string]: File} {\n const basenames: string[] = [];\n const fileNames = files.map(file => basename(file.name));\n const pathToFile: {[path: string]: File} = {};\n for (const group of manifest) {\n group.paths.forEach(path => {\n const pathBasename = basename(path);\n if (basenames.indexOf(pathBasename) !== -1) {\n throw new Error(\n `Duplicate file basename found in weights manifest: ` +\n `'${pathBasename}'`);\n }\n basenames.push(pathBasename);\n if (fileNames.indexOf(pathBasename) === -1) {\n throw new Error(\n `Weight file with basename '${pathBasename}' is not provided.`);\n } else {\n pathToFile[path] = files[fileNames.indexOf(pathBasename)];\n }\n });\n }\n\n if (basenames.length !== files.length) {\n throw new Error(\n `Mismatch in the number of files in weights manifest ` +\n `(${basenames.length}) and the number of weight files provided ` +\n `(${files.length}).`);\n }\n return pathToFile;\n }\n}\n\nexport const browserDownloadsRouter: IORouter = (url: string) => {\n if (!ENV.get('IS_BROWSER')) {\n return null;\n } else {\n if (url.startsWith(BrowserDownloads.URL_SCHEME)) {\n return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(browserDownloadsRouter);\n\n/**\n * Creates an IOHandler that triggers file downloads from the browser.\n *\n * The returned `IOHandler` instance can be used as model exporting methods such\n * as `tf.Model.save` and supports only saving.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * const saveResult = await model.save('downloads://mymodel'));\n * // This will trigger downloading of two files:\n * // 'mymodel.json' and 'mymodel.weights.bin'.\n * console.log(saveResult);\n * ```\n *\n * @param fileNamePrefix Prefix name of the files to be downloaded. For use with\n * `tf.Model`, `fileNamePrefix` should follow either of the following two\n * formats:\n * 1. `null` or `undefined`, in which case the default file\n * names will be used:\n * - 'model.json' for the JSON file containing the model topology and\n * weights manifest.\n * - 'model.weights.bin' for the binary file containing the binary weight\n * values.\n * 2. A single string or an Array of a single string, as the file name prefix.\n * For example, if `'foo'` is provided, the downloaded JSON\n * file and binary weights file will be named 'foo.json' and\n * 'foo.weights.bin', respectively.\n * @param config Additional configuration for triggering downloads.\n * @returns An instance of `DownloadTrigger` `IOHandler`.\n */\nexport function browserDownloads(fileNamePrefix = 'model'): IOHandler {\n return new BrowserDownloads(fileNamePrefix);\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from user-selected files.\n *\n * This method can be used for loading from files such as user-selected files\n * in the browser.\n * When used in conjunction with `tf.loadModel`, an instance of `tf.Model`\n * (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * // Note: This code snippet won't run properly without the actual file input\n * // elements in the HTML DOM.\n *\n * // Suppose there are two HTML file input (``)\n * // elements.\n * const uploadJSONInput = document.getElementById('upload-json');\n * const uploadWeightsInput = document.getElementById('upload-weights');\n * const model = await tfl.loadModel(tf.io.browserFiles(\n * [uploadJSONInput.files[0], uploadWeightsInput.files[0]]));\n * ```\n *\n * @param files `File`s to load from. Currently, this function supports only\n * loading from files that contain Keras-style models (i.e., `tf.Model`s), for\n * which an `Array` of `File`s is expected (in that order):\n * - A JSON file containing the model topology and weight manifest.\n * - Optionally, One or more binary files containing the binary weights.\n * These files must have names that match the paths in the `weightsManifest`\n * contained by the aforementioned JSON file, or errors will be thrown\n * during loading. These weights files have the same format as the ones\n * generated by `tensorflowjs_converter` that comes with the `tensorflowjs`\n * Python PIP package. If no weights files are provided, only the model\n * topology will be loaded from the JSON file above.\n * @returns An instance of `Files` `IOHandler`.\n */\nexport function browserFiles(files: File[]): IOHandler {\n return new BrowserFiles(files);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensor} from '../ops/ops';\nimport {NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport * as util from '../util';\nimport {DTYPE_VALUE_SIZE_MAP, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\n/**\n * Reads binary weights data from a number of URLs.\n *\n * @param fetchURLs URLs to send the HTTP requests at, using `fetch` calls.\n * @param requestOptions RequestInit (options) for the HTTP requests.\n * @returns A `Promise` of an Array of `ArrayBuffer`. The Array has the same\n * length as `fetchURLs`.\n */\nexport async function loadWeightsAsArrayBuffer(\n fetchURLs: string[], requestOptions?: RequestInit): Promise {\n // Create the requests for all of the weights in parallel.\n const requests = fetchURLs.map(fetchURL => fetch(fetchURL, requestOptions));\n const responses = await Promise.all(requests);\n const buffers =\n await Promise.all(responses.map(response => response.arrayBuffer()));\n return buffers;\n}\n\n/**\n * Reads a weights manifest JSON configuration, fetches the weights and\n * returns them as `Tensor`s.\n *\n * @param manifest The weights manifest JSON.\n * @param filePathPrefix The path prefix for filenames given in the manifest.\n * Defaults to the empty string.\n * @param weightNames The names of the weights to be fetched.\n */\nexport async function loadWeights(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[],\n requestOptions?: RequestInit): Promise {\n // TODO(nsthorat): Groups are currently fetched atomically. If you need a\n // single weight from a group, the whole group will be fetched. At a future\n // date, we should support fetching only the individual shards within a\n // group that are needed to reconstruct the requested weight.\n // TODO(cais): Use `decodeWeights` for implementation.\n\n // Collect all the groups, weights, and their relative offsets to be\n // fetched.\n const groupIndicesToFetchMap = manifest.map(() => false);\n const groupWeightsToFetch: {\n [group: number]: Array<{\n manifestEntry: WeightsManifestEntry; groupOffset: number;\n sizeBytes: number;\n }>\n } = {};\n const weightsFound = weightNames != null ? weightNames.map(() => false) : [];\n const allManifestWeightNames: string[] = [];\n manifest.forEach((manifestGroupConfig, groupIndex) => {\n let groupOffset = 0;\n manifestGroupConfig.weights.forEach(weightsEntry => {\n const rawDtype = ('quantization' in weightsEntry) ?\n weightsEntry.quantization.dtype :\n weightsEntry.dtype;\n\n const weightsBytes = DTYPE_VALUE_SIZE_MAP[rawDtype] *\n util.sizeFromShape(weightsEntry.shape);\n\n const enqueueWeightsForFetchingFn = () => {\n groupIndicesToFetchMap[groupIndex] = true;\n if (groupWeightsToFetch[groupIndex] == null) {\n groupWeightsToFetch[groupIndex] = [];\n }\n\n groupWeightsToFetch[groupIndex].push({\n manifestEntry: weightsEntry,\n groupOffset,\n sizeBytes: weightsBytes\n });\n };\n\n if (weightNames != null) {\n weightNames.forEach((weightName, weightIndex) => {\n if (weightName === weightsEntry.name) {\n enqueueWeightsForFetchingFn();\n weightsFound[weightIndex] = true;\n }\n });\n } else {\n enqueueWeightsForFetchingFn();\n }\n\n allManifestWeightNames.push(weightsEntry.name);\n groupOffset += weightsBytes;\n });\n });\n\n if (!weightsFound.every(found => found)) {\n const weightsNotFound = weightNames.filter((weight, i) => !weightsFound[i]);\n throw new Error(\n `Could not find weights in manifest with names: ` +\n `${weightsNotFound.join(', ')}. \\n` +\n `Manifest JSON has weights with names: ` +\n `${allManifestWeightNames.join(', ')}.`);\n }\n\n // Convert the one-hot boolean groupId => shouldFetch map to a list of group\n // IDs.\n const groupIndicesToFetch =\n groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => {\n if (shouldFetch) {\n accumulator.push(i);\n }\n return accumulator;\n }, []);\n\n const fetchUrls: string[] = [];\n groupIndicesToFetch.forEach(i => {\n manifest[i].paths.forEach(filepath => {\n const fetchUrl = filePathPrefix +\n (!filePathPrefix.endsWith('/') ? '/' : '') + filepath;\n fetchUrls.push(fetchUrl);\n });\n });\n const buffers = await loadWeightsAsArrayBuffer(fetchUrls, requestOptions);\n\n const weightsTensorMap: NamedTensorMap = {};\n let bufferIndexOffset = 0;\n groupIndicesToFetch.forEach(i => {\n const numBuffers = manifest[i].paths.length;\n\n let groupBytes = 0;\n for (let i = 0; i < numBuffers; i++) {\n groupBytes += buffers[bufferIndexOffset + i].byteLength;\n }\n\n // Create a buffer for the whole group.\n const groupBuffer = new ArrayBuffer(groupBytes);\n const groupByteBuffer = new Uint8Array(groupBuffer);\n let groupBufferOffset = 0;\n for (let i = 0; i < numBuffers; i++) {\n const buffer = new Uint8Array(buffers[bufferIndexOffset + i]);\n groupByteBuffer.set(buffer, groupBufferOffset);\n groupBufferOffset += buffer.byteLength;\n }\n\n const weightsEntries = groupWeightsToFetch[i];\n\n weightsEntries.forEach(weightsEntry => {\n const byteBuffer = groupBuffer.slice(\n weightsEntry.groupOffset,\n weightsEntry.groupOffset + weightsEntry.sizeBytes);\n\n let typedArray: TypedArray;\n\n const dtype = weightsEntry.manifestEntry.dtype;\n\n if ('quantization' in weightsEntry.manifestEntry) {\n const quantization = weightsEntry.manifestEntry.quantization;\n if (quantization.dtype !== 'uint8' && quantization.dtype !== 'uint16') {\n throw new Error(\n `Weight ${weightsEntry.manifestEntry.name} has unknown ` +\n `quantization dtype ${quantization.dtype}.`);\n }\n const quantizedArray = (quantization.dtype === 'uint8') ?\n new Uint8Array(byteBuffer) :\n new Uint16Array(byteBuffer);\n if (dtype === 'float32') {\n typedArray = Float32Array.from(\n quantizedArray, v => v * quantization.scale + quantization.min);\n } else if (dtype === 'int32') {\n typedArray = Int32Array.from(\n quantizedArray,\n v => Math.round(v * quantization.scale + quantization.min));\n } else {\n throw new Error(\n `Weight ${weightsEntry.manifestEntry.name} has a dtype not ` +\n `supported by quantization: ${dtype}`);\n }\n } else {\n if (dtype === 'float32') {\n typedArray = new Float32Array(byteBuffer);\n } else if (dtype === 'int32') {\n typedArray = new Int32Array(byteBuffer);\n } else if (dtype === 'bool') {\n typedArray = new Uint8Array(byteBuffer);\n } else {\n throw new Error(\n `Weight ${weightsEntry.manifestEntry.name} has unknown dtype ` +\n `${dtype}.`);\n }\n }\n\n const weightName = weightsEntry.manifestEntry.name;\n if (weightsTensorMap[weightName] != null) {\n throw new Error(\n `Duplicate weight with name ${weightName}. ` +\n `Please make sure weights names are unique in the manifest JSON.`);\n }\n weightsTensorMap[weightName] = tensor(\n typedArray, weightsEntry.manifestEntry.shape,\n weightsEntry.manifestEntry.dtype);\n });\n\n bufferIndexOffset += numBuffers;\n });\n\n return weightsTensorMap;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandler implementations based on HTTP requests in the web browser.\n *\n * Uses [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n */\n\nimport {assert} from '../util';\nimport {concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeightsAsArrayBuffer} from './weights_loader';\n\nexport class BrowserHTTPRequest implements IOHandler {\n protected readonly path: string;\n protected readonly requestInit: RequestInit;\n\n readonly DEFAULT_METHOD = 'POST';\n\n static readonly URL_SCHEMES = ['http://', 'https://'];\n\n constructor(path: string, requestInit?: RequestInit) {\n if (typeof fetch === 'undefined') {\n throw new Error(\n // tslint:disable-next-line:max-line-length\n 'browserHTTPRequest is not supported outside the web browser without a fetch polyfill.');\n }\n\n assert(\n path != null && path.length > 0,\n 'URL path for browserHTTPRequest must not be null, undefined or ' +\n 'empty.');\n this.path = path;\n\n if (requestInit != null && requestInit.body != null) {\n throw new Error(\n 'requestInit is expected to have no pre-existing body, but has one.');\n }\n this.requestInit = requestInit || {};\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserHTTPRequest.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n const init = Object.assign({method: this.DEFAULT_METHOD}, this.requestInit);\n init.body = new FormData();\n\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./model.weights.bin'],\n weights: modelArtifacts.weightSpecs,\n }];\n const modelTopologyAndWeightManifest = {\n modelTopology: modelArtifacts.modelTopology,\n weightsManifest\n };\n\n init.body.append(\n 'model.json',\n new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: 'application/json'}),\n 'model.json');\n\n if (modelArtifacts.weightData != null) {\n init.body.append(\n 'model.weights.bin',\n new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}),\n 'model.weights.bin');\n }\n\n const response = await fetch(this.path, init);\n\n if (response.status === 200) {\n return {\n modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts),\n responses: [response],\n };\n } else {\n throw new Error(\n `BrowserHTTPRequest.save() failed due to HTTP response status ` +\n `${response.status}.`);\n }\n }\n\n /**\n * Load model artifacts via HTTP request(s).\n *\n * See the documentation to `browserHTTPRequest` for details on the saved\n * artifacts.\n *\n * @returns The loaded model artifacts (if loading succeeds).\n */\n async load(): Promise {\n const modelConfigRequest = await fetch(this.path, this.requestInit);\n const modelConfig = await modelConfigRequest.json();\n const modelTopology = modelConfig['modelTopology'];\n const weightsManifest = modelConfig['weightsManifest'];\n\n // We do not allow both modelTopology and weightsManifest to be missing.\n if (modelTopology == null && weightsManifest == null) {\n throw new Error(\n `The JSON from HTTP path ${this.path} contains neither model ` +\n `topology or manifest for weights.`);\n }\n\n let weightSpecs: WeightsManifestEntry[];\n let weightData: ArrayBuffer;\n if (weightsManifest != null) {\n const weightsManifest =\n modelConfig['weightsManifest'] as WeightsManifestConfig;\n weightSpecs = [];\n for (const entry of weightsManifest) {\n weightSpecs.push(...entry.weights);\n }\n\n let pathPrefix = this.path.substring(0, this.path.lastIndexOf('/'));\n if (!pathPrefix.endsWith('/')) {\n pathPrefix = pathPrefix + '/';\n }\n\n const fetchURLs: string[] = [];\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n fetchURLs.push(pathPrefix + path);\n });\n });\n weightData = concatenateArrayBuffers(\n await loadWeightsAsArrayBuffer(fetchURLs, this.requestInit));\n }\n\n return {modelTopology, weightSpecs, weightData};\n }\n}\n\nexport const httpRequestRouter: IORouter = (url: string) => {\n if (typeof fetch === 'undefined') {\n // browserHTTPRequest uses `fetch`, if one wants to use it in node.js\n // they have to setup a global fetch polyfill.\n return null;\n } else {\n for (const scheme of BrowserHTTPRequest.URL_SCHEMES) {\n if (url.startsWith(scheme)) {\n return browserHTTPRequest(url);\n }\n }\n return null;\n }\n};\nIORouterRegistry.registerSaveRouter(httpRequestRouter);\nIORouterRegistry.registerLoadRouter(httpRequestRouter);\n\n/**\n * Creates an IOHandler subtype that sends model artifacts to HTTP server.\n *\n * An HTTP request of the `multipart/form-data` mime type will be sent to the\n * `path` URL. The form data includes artifacts that represent the topology\n * and/or weights of the model. In the case of Keras-style `tf.Model`, two\n * blobs (files) exist in form-data:\n * - A JSON file consisting of `modelTopology` and `weightsManifest`.\n * - A binary weights file consisting of the concatenated weight values.\n * These files are in the same format as the one generated by\n * [tfjs_converter](https://js.tensorflow.org/tutorials/import-keras.html).\n *\n * The following code snippet exemplifies the client-side code that uses this\n * function:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save(tf.io.browserHTTPRequest(\n * 'http://model-server:5000/upload', {method: 'PUT'}));\n * console.log(saveResult);\n * ```\n *\n * If the default `POST` method is to be used, without any custom parameters\n * such as headers, you can simply pass an HTTP or HTTPS URL to `model.save`:\n *\n * ```js\n * const saveResult = await model.save('http://model-server:5000/upload');\n * ```\n *\n * The following Python code snippet based on the\n * [flask](https://github.com/pallets/flask) server framework implements a\n * server that can receive the request. Upon receiving the model artifacts\n * via the requst, this particular server reconsistutes instances of\n * [Keras Models](https://keras.io/models/model/) in memory.\n *\n * ```python\n * # pip install -U flask flask-cors tensorflow tensorflowjs\n *\n * from __future__ import absolute_import\n * from __future__ import division\n * from __future__ import print_function\n *\n * import io\n *\n * from flask import Flask, Response, request\n * from flask_cors import CORS, cross_origin\n * import tensorflow as tf\n * import tensorflowjs as tfjs\n * import werkzeug.formparser\n *\n *\n * class ModelReceiver(object):\n *\n * def __init__(self):\n * self._model = None\n * self._model_json_bytes = None\n * self._model_json_writer = None\n * self._weight_bytes = None\n * self._weight_writer = None\n *\n * @property\n * def model(self):\n * self._model_json_writer.flush()\n * self._weight_writer.flush()\n * self._model_json_writer.seek(0)\n * self._weight_writer.seek(0)\n *\n * json_content = self._model_json_bytes.read()\n * weights_content = self._weight_bytes.read()\n * return tfjs.converters.deserialize_keras_model(\n * json_content,\n * weight_data=[weights_content],\n * use_unique_name_scope=True)\n *\n * def stream_factory(self,\n * total_content_length,\n * content_type,\n * filename,\n * content_length=None):\n * # Note: this example code is *not* thread-safe.\n * if filename == 'model.json':\n * self._model_json_bytes = io.BytesIO()\n * self._model_json_writer = io.BufferedWriter(self._model_json_bytes)\n * return self._model_json_writer\n * elif filename == 'model.weights.bin':\n * self._weight_bytes = io.BytesIO()\n * self._weight_writer = io.BufferedWriter(self._weight_bytes)\n * return self._weight_writer\n *\n *\n * def main():\n * app = Flask('model-server')\n * CORS(app)\n * app.config['CORS_HEADER'] = 'Content-Type'\n *\n * model_receiver = ModelReceiver()\n *\n * @app.route('/upload', methods=['POST'])\n * @cross_origin()\n * def upload():\n * print('Handling request...')\n * werkzeug.formparser.parse_form_data(\n * request.environ, stream_factory=model_receiver.stream_factory)\n * print('Received model:')\n * with tf.Graph().as_default(), tf.Session():\n * model = model_receiver.model\n * model.summary()\n * # You can perform `model.predict()`, `model.fit()`,\n * # `model.evaluate()` etc. here.\n * return Response(status=200)\n *\n * app.run('localhost', 5000)\n *\n *\n * if __name__ == '__main__':\n * main()\n * ```\n *\n * @param path URL path. Can be an absolute HTTP path (e.g.,\n * 'http://localhost:8000/model-upload)') or a relative path (e.g.,\n * './model-upload').\n * @param requestInit Request configurations to be used when sending\n * HTTP request to server using `fetch`. It can contain fields such as\n * `method`, `credentials`, `headers`, `mode`, etc. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request\n * for more information. `requestInit` must not have a body, because the body\n * will be set by TensorFlow.js. File blobs representing\n * the model topology (filename: 'model.json') and the weights of the\n * model (filename: 'model.weights.bin') will be appended to the body.\n * If `requestInit` has a `body`, an Error will be thrown.\n * @returns An instance of `IOHandler`.\n */\nexport function browserHTTPRequest(\n path: string, requestInit?: RequestInit): IOHandler {\n return new BrowserHTTPRequest(path, requestInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers that pass through the in-memory ModelArtifacts format.\n */\n\nimport {IOHandler, ModelArtifacts, SaveResult, WeightsManifestEntry} from './types';\n\nclass PassthroughLoader implements IOHandler {\n constructor(\n private readonly modelTopology?: {}|ArrayBuffer,\n private readonly weightSpecs?: WeightsManifestEntry[],\n private readonly weightData?: ArrayBuffer) {}\n\n async load(): Promise {\n let result = {};\n if (this.modelTopology != null) {\n result = {modelTopology: this.modelTopology, ...result};\n }\n if (this.weightSpecs != null && this.weightSpecs.length > 0) {\n result = {weightSpecs: this.weightSpecs, ...result};\n }\n if (this.weightData != null && this.weightData.byteLength > 0) {\n result = {weightData: this.weightData, ...result};\n }\n return result;\n }\n}\n\nclass PassthroughSaver implements IOHandler {\n constructor(\n private readonly saveHandler: (artifacts: ModelArtifacts) => SaveResult) {\n }\n\n async save(modelArtifacts: ModelArtifacts) {\n return this.saveHandler(modelArtifacts);\n }\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from memory.\n *\n * When used in conjunction with `tf.loadModel`, an instance of `tf.Model`\n * (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * const model = await tf.loadModel(tf.io.fromMemory(\n * modelTopology, weightSpecs, weightData));\n * ```\n *\n * @param modelTopology a object containing model topology (i.e., parsed from\n * the JSON format).\n * @param weightSpecs An array of `WeightsManifestEntry` objects describing the\n * names, shapes, types, and quantization of the weight data.\n * @param weightData A single `ArrayBuffer` containing the weight data,\n * concatenated in the order described by the weightSpecs.\n *\n * @returns A passthrough `IOHandler` that simply loads the provided data.\n */\nexport function fromMemory(\n modelTopology: {}, weightSpecs?: WeightsManifestEntry[],\n weightData?: ArrayBuffer): IOHandler {\n return new PassthroughLoader(modelTopology, weightSpecs, weightData);\n}\n\n/**\n * Creates an IOHandler that passes saved model artifacts to a callback.\n *\n * ```js\n * function handleSave(artifacts) {\n * // ... do something with the artifacts ...\n * return {modelArtifactsInfo: {...}, ...};\n * }\n *\n * const saveResult = model.save(tf.io.withSaveHandler(handleSave));\n * ```\n *\n * @param saveHandler A function that accepts a `ModelArtifacts` and returns a\n * `SaveResult`.\n */\nexport function withSaveHandler(\n saveHandler: (artifacts: ModelArtifacts) => SaveResult): IOHandler {\n return new PassthroughSaver(saveHandler);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Importing local_storage and indexed_db is necessary for the routers to be\n// registered.\nimport './indexed_db';\nimport './local_storage';\n\nimport {browserFiles} from './browser_files';\nimport {browserHTTPRequest} from './browser_http';\nimport {concatenateArrayBuffers, decodeWeights, encodeWeights, getModelArtifactsInfoForJSON} from './io_utils';\nimport {fromMemory, withSaveHandler} from './passthrough';\nimport {IORouterRegistry} from './router_registry';\nimport {IOHandler, LoadHandler, ModelArtifacts, ModelStoreManager, SaveConfig, SaveHandler, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeights} from './weights_loader';\n\nconst registerSaveRouter = IORouterRegistry.registerSaveRouter;\nconst registerLoadRouter = IORouterRegistry.registerLoadRouter;\nconst getSaveHandlers = IORouterRegistry.getSaveHandlers;\nconst getLoadHandlers = IORouterRegistry.getLoadHandlers;\n\nexport {copyModel, listModels, moveModel, removeModel} from './model_management';\n\nexport {\n browserFiles,\n browserHTTPRequest,\n concatenateArrayBuffers,\n decodeWeights,\n encodeWeights,\n fromMemory,\n getLoadHandlers,\n getModelArtifactsInfoForJSON,\n getSaveHandlers,\n IOHandler,\n LoadHandler,\n loadWeights,\n ModelArtifacts,\n ModelStoreManager,\n registerLoadRouter,\n registerSaveRouter,\n SaveConfig,\n SaveHandler,\n SaveResult,\n WeightsManifestConfig,\n WeightsManifestEntry,\n withSaveHandler\n};\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Types to support JSON-esque data structures internally.\n *\n * Internally ConfigDict's use camelCase keys and values where the\n * values are class names to be instantiated. On the python side, these\n * will be snake_case. Internally we allow Enums into the values for better\n * type safety, but these need to be converted to raw primitives (usually\n * strings) for round-tripping with python.\n *\n * toConfig returns the TS-friendly representation. model.toJSON() returns\n * the pythonic version as that's the portable format. If you need to\n * python-ify a non-model level toConfig output, you'll need to use a\n * convertTsToPythonic from serialization_utils in -Layers.\n *\n */\nexport type ConfigDictValue =\n boolean|number|string|null|ConfigDictArray|ConfigDict;\nexport interface ConfigDict {\n [key: string]: ConfigDictValue;\n}\nexport interface ConfigDictArray extends Array {}\n\n/**\n * Type to represent the class-type of Serializable objects.\n *\n * Ie the class prototype with access to the constructor and any\n * static members/methods. Instance methods are not listed here.\n *\n * Source for this idea: https://stackoverflow.com/a/43607255\n */\nexport type SerializableConstructor = {\n // tslint:disable-next-line:no-any\n new (...args: any[]): T; className: string; fromConfig: FromConfigMethod;\n};\nexport type FromConfigMethod =\n (cls: SerializableConstructor, config: ConfigDict) => T;\n\n/**\n * Serializable defines the serialization contract.\n *\n * TFJS requires serializable classes to return their className when asked\n * to avoid issues with minification.\n */\nexport abstract class Serializable {\n /**\n * Return the class name for this class to use in serialization contexts.\n *\n * Generally speaking this will be the same thing that constructor.name\n * would have returned. However, the class name needs to be robust\n * against minification for serialization/deserialazation to work properly.\n *\n * There's also places such as initializers.VarianceScaling, where\n * implementation details between different languages led to different\n * class hierarchies and a non-leaf node is used for serialization purposes.\n */\n getClassName(): string {\n return (this.constructor as SerializableConstructor)\n .className;\n }\n\n /**\n * Return all the non-weight state needed to serialize this object.\n */\n abstract getConfig(): ConfigDict;\n\n /**\n * Creates an instance of T from a ConfigDict.\n *\n * This works for most descendants of serializable. A few need to\n * provide special handling.\n * @param cls A Constructor for the class to instantiate.\n * @param config The Configuration for the object.\n */\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config);\n }\n}\n\n/**\n * Maps string keys to class constructors.\n *\n * Used during (de)serialization from the cross-language JSON format, which\n * requires the class name in the serialization format matches the class\n * names as used in Python, should it exist.\n */\nexport class SerializationMap {\n private static instance: SerializationMap;\n classNameMap: {\n [className: string]:\n [\n SerializableConstructor, FromConfigMethod\n ]\n };\n\n private constructor() {\n this.classNameMap = {};\n }\n\n /**\n * Returns the singleton instance of the map.\n */\n static getMap(): SerializationMap {\n if (SerializationMap.instance == null) {\n SerializationMap.instance = new SerializationMap();\n }\n return SerializationMap.instance;\n }\n\n /**\n * Registers the class as serializable.\n */\n static register(cls: SerializableConstructor) {\n SerializationMap.getMap().classNameMap[cls.className] =\n [cls, cls.fromConfig];\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from './environment';\nimport {Features} from './environment_util';\nimport {Tensor} from './tensor';\nimport {TypedArray} from './types';\nimport * as util from './util';\n\n// TODO(smilkov): Move these constants to jasmine_util.\nexport const WEBGL_ENVS: Features = {\n 'HAS_WEBGL': true\n};\nexport const NODE_ENVS: Features = {\n 'IS_NODE': true\n};\nexport const CHROME_ENVS: Features = {\n 'IS_CHROME': true\n};\nexport const BROWSER_ENVS: Features = {\n 'IS_BROWSER': true\n};\nexport const CPU_ENVS: Features = {\n 'HAS_WEBGL': false\n};\nexport const ALL_ENVS: Features = {};\n\nexport function expectArraysClose(\n actual: Tensor|TypedArray|number[],\n expected: Tensor|TypedArray|number[]|boolean[], epsilon?: number) {\n if (epsilon == null) {\n epsilon = ENV.get('TEST_EPSILON');\n }\n if (!(actual instanceof Tensor) && !(expected instanceof Tensor)) {\n const aType = actual.constructor.name;\n const bType = expected.constructor.name;\n\n if (aType !== bType) {\n throw new Error(\n `Arrays are of different type actual: ${aType} ` +\n `vs expected: ${bType}`);\n }\n } else if (actual instanceof Tensor && expected instanceof Tensor) {\n if (actual.dtype !== expected.dtype) {\n throw new Error(\n `Arrays are of different type actual: ${actual.dtype} ` +\n `vs expected: ${expected.dtype}.`);\n }\n if (!util.arraysEqual(actual.shape, expected.shape)) {\n throw new Error(\n `Arrays are of different shape actual: ${actual.shape} ` +\n `vs expected: ${expected.shape}.`);\n }\n }\n\n let actualValues: TypedArray|number[];\n let expectedValues: TypedArray|number[]|boolean[];\n if (actual instanceof Tensor) {\n actualValues = actual.dataSync();\n } else {\n actualValues = actual;\n }\n if (expected instanceof Tensor) {\n expectedValues = expected.dataSync();\n } else {\n expectedValues = expected;\n }\n\n if (actualValues.length !== expectedValues.length) {\n throw new Error(\n `Arrays have different lengths actual: ${actualValues.length} vs ` +\n `expected: ${expectedValues.length}.\\n` +\n `Actual: ${actualValues}.\\n` +\n `Expected: ${expectedValues}.`);\n }\n for (let i = 0; i < expectedValues.length; ++i) {\n const a = actualValues[i];\n const e = expectedValues[i];\n\n if (!areClose(a, Number(e), epsilon)) {\n throw new Error(\n `Arrays differ: actual[${i}] = ${a}, expected[${i}] = ${e}.\\n` +\n `Actual: ${actualValues}.\\n` +\n `Expected: ${expectedValues}.`);\n }\n }\n}\n\nexport interface DoneFn {\n (): void;\n fail: (message?: Error|string) => void;\n}\n\nexport function expectPromiseToFail(fn: () => Promise<{}>, done: DoneFn): void {\n fn().then(() => done.fail(), () => done());\n}\n\nexport function expectArraysEqual(\n actual: Tensor|TypedArray|number[],\n expected: Tensor|TypedArray|number[]|boolean[]) {\n return expectArraysClose(actual, expected, 0);\n}\n\nexport function expectNumbersClose(a: number, e: number, epsilon?: number) {\n if (epsilon == null) {\n epsilon = ENV.get('TEST_EPSILON');\n }\n if (!areClose(a, e, epsilon)) {\n throw new Error(`Numbers differ: actual === ${a}, expected === ${e}`);\n }\n}\n\nfunction areClose(a: number, e: number, epsilon: number): boolean {\n if (isNaN(a) && isNaN(e)) {\n return true;\n }\n if (isNaN(a) || isNaN(e) || Math.abs(a - e) > epsilon) {\n return false;\n }\n return true;\n}\n\nexport function expectValuesInRange(\n actual: Tensor|TypedArray|number[], low: number, high: number) {\n let actualVals: TypedArray|number[];\n if (actual instanceof Tensor) {\n actualVals = actual.dataSync();\n } else {\n actualVals = actual;\n }\n for (let i = 0; i < actualVals.length; i++) {\n if (actualVals[i] < low || actualVals[i] > high) {\n throw new Error(\n `Value out of range:${actualVals[i]} low: ${low}, high: ${high}`);\n }\n }\n}\n\nexport function expectArrayBuffersEqual(\n actual: ArrayBuffer, expected: ArrayBuffer) {\n // Safari & Jasmine dont like comparing ArrayBuffers directly. Wrapping in\n // a Float32Array solves this issue.\n expect(new Float32Array(actual)).toEqual(new Float32Array(expected));\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '0.12.8';\nexport {version};\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {variableGrads} from '../globals';\nimport {Serializable} from '../serialization';\nimport {Scalar, Variable} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\n\n/** @doc {heading: 'Training', subheading: 'Classes', namespace: 'train'} */\nexport abstract class Optimizer extends Serializable {\n /**\n * Executes `f()` and minimizes the scalar output of `f()` by computing\n * gradients of y with respect to the list of trainable variables provided by\n * `varList`. If no list is provided, it defaults to all trainable variables.\n * @param f The function to execute and whose output to minimize.\n * @param returnCost Whether to return the scalar cost value produced by\n * executing `f()`.\n * @param varList An optional list of variables to update. If specified, only\n * the trainable variables in varList will be updated by minimize. Defaults to\n * all trainable variables.\n */\n /** @doc {heading: 'Training', subheading: 'Optimizers'} */\n minimize(f: () => Scalar, returnCost = false, varList?: Variable[]): Scalar\n |null {\n const {value, grads} = this.computeGradients(f, varList);\n\n this.applyGradients(grads);\n\n // Dispose gradients.\n const varNames = Object.keys(grads);\n varNames.forEach(varName => grads[varName].dispose());\n\n if (returnCost) {\n return value as Scalar;\n } else {\n value.dispose();\n return null;\n }\n }\n\n /**\n * Executes f() and computes the gradient of the scalar output of f() with\n * respect to the list of trainable variables provided by `varList`. If no\n * list is provided, it defaults to all trainable variables.\n * @param f The function to execute and whose output to use for computing\n * gradients with respect to variables.\n * @param varList An optional list of variables to compute gradients with\n * respect to. If specified, only the trainable variables in varList will have\n * gradients computed with respect to. Defaults to all trainable variables.\n */\n computeGradients(f: () => Scalar, varList?: Variable[]):\n {value: Scalar, grads: NamedTensorMap} {\n return variableGrads(f, varList);\n }\n\n /**\n * Updates variables by using the computed gradients.\n * @param variableGradients A mapping of variable name to its gradient value.\n */\n abstract applyGradients(variableGradients: NamedTensorMap): void;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENV} from '../environment';\n\nconst DEFAULT_FLOAT32_EPSILON = 1e-8;\nconst DEFAULT_FLOAT16_EPSILON = 1e-4;\n\nexport function getOptimizerDefaultEpsilonValue() {\n if (ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) {\n return DEFAULT_FLOAT32_EPSILON;\n }\n\n return DEFAULT_FLOAT16_EPSILON;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\n/** @doclink Optimizer */\nexport class AdadeltaOptimizer extends Optimizer {\n static className = 'AdadeltaOptimizer';\n private c: Scalar;\n private epsilonScalar: Scalar;\n private rhoScalar: Scalar;\n private oneMinusRho: Scalar;\n\n private accumulatedGrads: NamedVariableMap = {};\n private accumulatedUpdates: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected rho: number,\n protected epsilon: number = null) {\n super();\n\n this.c = keep(scalar(-learningRate));\n this.rhoScalar = keep(scalar(rho));\n this.oneMinusRho = keep(scalar(1 - rho));\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsilonScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedGrads[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedGrads[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n if (this.accumulatedUpdates[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedUpdates[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n\n const gradient = variableGradients[variableName];\n const accumulatedGrad = this.accumulatedGrads[variableName];\n const accumulatedUpdate = this.accumulatedUpdates[variableName];\n\n tidy(() => {\n const newAccumulatedGrad =\n this.rhoScalar.mul(accumulatedGrad)\n .add(this.oneMinusRho.mul(gradient.square()));\n\n const updates = accumulatedUpdate.add(this.epsilonScalar)\n .sqrt()\n .div(accumulatedGrad.add(this.epsilonScalar).sqrt())\n .mul(gradient);\n\n const newAccumulatedUpdate =\n this.rhoScalar.mul(accumulatedUpdate)\n .add(this.oneMinusRho.mul(updates.square()));\n\n this.accumulatedGrads[variableName].assign(newAccumulatedGrad);\n this.accumulatedUpdates[variableName].assign(newAccumulatedUpdate);\n\n const newValue = this.c.mul(updates).add(value);\n value.assign(newValue);\n });\n }\n }\n\n dispose() {\n this.c.dispose();\n this.epsilonScalar.dispose();\n this.rhoScalar.dispose();\n this.oneMinusRho.dispose();\n if (this.accumulatedUpdates != null) {\n Object.keys(this.accumulatedUpdates)\n .forEach(name => this.accumulatedUpdates[name].dispose());\n Object.keys(this.accumulatedGrads)\n .forEach(name => this.accumulatedGrads[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n rho: this.rho,\n epsilon: this.epsilon\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate, config.rho, config.epsilon);\n }\n}\nSerializationMap.register(AdadeltaOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {fill, scalar} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\n/** @doclink Optimizer */\nexport class AdagradOptimizer extends Optimizer {\n static className = 'AdagradOptimizer';\n private c: Scalar;\n private epsilon: Scalar;\n\n private accumulatedGrads: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, private initialAccumulatorValue = 0.1) {\n super();\n this.c = keep(scalar(-learningRate));\n\n const epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n this.epsilon = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedGrads[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedGrads[variableName] =\n fill(value.shape, this.initialAccumulatorValue)\n .variable(trainable);\n });\n }\n\n const gradient = variableGradients[variableName];\n const accumulatedGrad = this.accumulatedGrads[variableName];\n\n tidy(() => {\n const newAccumulatedGrad = accumulatedGrad.add(gradient.square());\n this.accumulatedGrads[variableName].assign(newAccumulatedGrad);\n\n const newValue =\n this.c\n .mul(gradient.div(newAccumulatedGrad.add(this.epsilon).sqrt()))\n .add(value);\n value.assign(newValue);\n });\n }\n }\n\n dispose() {\n this.epsilon.dispose();\n this.c.dispose();\n if (this.accumulatedGrads != null) {\n Object.keys(this.accumulatedGrads)\n .forEach(name => this.accumulatedGrads[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n initialAccumulatorValue: this.initialAccumulatorValue,\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate, config.initialAccumulatorValue);\n }\n}\nSerializationMap.register(AdagradOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar, Variable} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\nexport class AdamOptimizer extends Optimizer {\n static className = 'AdamOptimizer';\n private c: Scalar;\n private epsScalar: Scalar;\n private beta1Scalar: Scalar;\n private beta2Scalar: Scalar;\n private accBeta1: Variable;\n private accBeta2: Variable;\n private oneMinusBeta1: Scalar;\n private oneMinusBeta2: Scalar;\n private one: Scalar;\n\n private accumulatedFirstMoment: NamedVariableMap = {};\n private accumulatedSecondMoment: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected beta1: number,\n protected beta2: number, protected epsilon: number = null) {\n super();\n this.c = keep(scalar(-learningRate));\n // b1, b2 keep initial value of beta* hyperparameters.\n this.beta1Scalar = keep(scalar(beta1));\n this.beta2Scalar = keep(scalar(beta2));\n tidy(() => {\n // accB* will be updated by batch.\n this.accBeta1 = scalar(beta1).variable();\n this.accBeta2 = scalar(beta2).variable();\n });\n this.oneMinusBeta1 = keep(scalar(1 - beta1));\n this.oneMinusBeta2 = keep(scalar(1 - beta2));\n this.one = keep(scalar(1));\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n tidy(() => {\n const oneMinusAccBeta1 = this.one.sub(this.accBeta1);\n const oneMinusAccBeta2 = this.one.sub(this.accBeta2);\n\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedFirstMoment[variableName] == null) {\n const trainable = false;\n this.accumulatedFirstMoment[variableName] =\n zerosLike(value).variable(trainable);\n }\n if (this.accumulatedSecondMoment[variableName] == null) {\n const trainable = false;\n this.accumulatedSecondMoment[variableName] =\n zerosLike(value).variable(trainable);\n }\n\n const gradient = variableGradients[variableName];\n const firstMoment = this.accumulatedFirstMoment[variableName];\n const secondMoment = this.accumulatedSecondMoment[variableName];\n\n const newFirstMoment = this.beta1Scalar.mul(firstMoment)\n .add(this.oneMinusBeta1.mul(gradient));\n const newSecondMoment =\n this.beta2Scalar.mul(secondMoment)\n .add(this.oneMinusBeta2.mul(gradient.square()));\n\n const biasCorrectedFirstMoment = newFirstMoment.div(oneMinusAccBeta1);\n const biasCorrectedSecondMoment = newSecondMoment.div(oneMinusAccBeta2);\n\n this.accumulatedFirstMoment[variableName].assign(newFirstMoment);\n this.accumulatedSecondMoment[variableName].assign(newSecondMoment);\n\n const newValue =\n this.c\n .mul(biasCorrectedFirstMoment.div(\n this.epsScalar.add(biasCorrectedSecondMoment.sqrt())))\n .add(value);\n value.assign(newValue);\n }\n\n this.accBeta1.assign(this.accBeta1.mul(this.beta1Scalar));\n this.accBeta2.assign(this.accBeta2.mul(this.beta2Scalar));\n });\n }\n\n dispose() {\n this.c.dispose();\n this.epsScalar.dispose();\n this.beta1Scalar.dispose();\n this.beta2Scalar.dispose();\n this.accBeta1.dispose();\n this.accBeta2.dispose();\n this.oneMinusBeta1.dispose();\n this.oneMinusBeta2.dispose();\n this.one.dispose();\n\n if (this.accumulatedFirstMoment != null) {\n Object.keys(this.accumulatedFirstMoment)\n .forEach(name => this.accumulatedFirstMoment[name].dispose());\n }\n\n if (this.accumulatedSecondMoment != null) {\n Object.keys(this.accumulatedSecondMoment)\n .forEach(name => this.accumulatedSecondMoment[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n beta1: this.beta1,\n beta2: this.beta2,\n epsilon: this.epsilon,\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(\n config.learningRate, config.beta1, config.beta2, config.epsilon);\n }\n}\nSerializationMap.register(AdamOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar, Variable} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\nexport class AdamaxOptimizer extends Optimizer {\n static className = 'AdamaxOptimizer';\n private c: Scalar;\n private epsScalar: Scalar;\n private accBeta1: Variable;\n private beta1Scalar: Scalar;\n private beta2Scalar: Scalar;\n private decayScalar: Scalar;\n private oneMinusBeta1: Scalar;\n private one: Scalar;\n private iteration: Variable;\n\n private accumulatedFirstMoment: NamedVariableMap = {};\n private accumulatedWeightedInfNorm: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected beta1: number,\n protected beta2: number, protected epsilon: number = null,\n protected decay = 0.0) {\n super();\n this.c = keep(scalar(-learningRate));\n\n // b1, b2 keep initial value of beta* hyperparameters.\n this.beta1Scalar = keep(scalar(beta1));\n this.beta2Scalar = keep(scalar(beta2));\n\n this.decayScalar = keep(scalar(decay));\n\n tidy(() => {\n this.iteration = scalar(0).variable();\n this.accBeta1 = scalar(beta1).variable();\n });\n\n this.oneMinusBeta1 = keep(scalar(1 - beta1));\n this.one = keep(scalar(1));\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n tidy(() => {\n const oneMinusAccBeta1 = this.one.sub(this.accBeta1);\n const lr = this.c.div(this.one.add(this.decayScalar.mul(this.iteration)));\n\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedFirstMoment[variableName] == null) {\n const trainable = false;\n this.accumulatedFirstMoment[variableName] =\n zerosLike(value).variable(trainable);\n }\n if (this.accumulatedWeightedInfNorm[variableName] == null) {\n const trainable = false;\n this.accumulatedWeightedInfNorm[variableName] =\n zerosLike(value).variable(trainable);\n }\n\n const gradient = variableGradients[variableName];\n const firstMoment = this.accumulatedFirstMoment[variableName];\n const weightedInfNorm = this.accumulatedWeightedInfNorm[variableName];\n\n const newFirstMoment = this.beta1Scalar.mul(firstMoment)\n .add(this.oneMinusBeta1.mul(gradient));\n\n const ut0 = this.beta2Scalar.mul(weightedInfNorm);\n const ut1 = gradient.abs();\n\n const newWeightedInfNorm = ut0.maximum(ut1);\n\n this.accumulatedFirstMoment[variableName].assign(newFirstMoment);\n this.accumulatedWeightedInfNorm[variableName].assign(\n newWeightedInfNorm);\n\n const newValue =\n lr.div(oneMinusAccBeta1)\n .mul(newFirstMoment.div(this.epsScalar.add(newWeightedInfNorm)))\n .add(value);\n\n value.assign(newValue);\n }\n\n this.iteration.assign(this.iteration.add(this.one));\n this.accBeta1.assign(this.accBeta1.mul(this.beta1Scalar));\n });\n }\n\n dispose() {\n this.c.dispose();\n this.epsScalar.dispose();\n this.accBeta1.dispose();\n this.beta1Scalar.dispose();\n this.beta2Scalar.dispose();\n this.oneMinusBeta1.dispose();\n\n this.decayScalar.dispose();\n this.iteration.dispose();\n\n this.one.dispose();\n\n if (this.accumulatedFirstMoment != null) {\n Object.keys(this.accumulatedFirstMoment)\n .forEach(name => this.accumulatedFirstMoment[name].dispose());\n }\n\n if (this.accumulatedWeightedInfNorm != null) {\n Object.keys(this.accumulatedWeightedInfNorm)\n .forEach(name => this.accumulatedWeightedInfNorm[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n beta1: this.beta1,\n beta2: this.beta2,\n epsilon: this.epsilon,\n decay: this.decay\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(\n config.learningRate, config.beta1, config.beta2, config.epsilon,\n config.decay);\n }\n}\nSerializationMap.register(AdamaxOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\n\n/** @doclink Optimizer */\nexport class SGDOptimizer extends Optimizer {\n static className = 'SGDOptimizer';\n protected c: Scalar;\n\n constructor(protected learningRate: number) {\n super();\n this.setLearningRate(learningRate);\n }\n\n applyGradients(variableGradients: NamedTensorMap) {\n const varNames = Object.keys(variableGradients);\n varNames.forEach(varName => {\n const gradient = variableGradients[varName];\n const value = ENV.engine.registeredVariables[varName];\n\n tidy(() => {\n const newValue = this.c.mul(gradient).add(value);\n value.assign(newValue);\n });\n });\n }\n\n /**\n * Sets the learning rate of the optimizer.\n */\n setLearningRate(learningRate: number) {\n this.learningRate = learningRate;\n if (this.c != null) {\n this.c.dispose();\n }\n this.c = keep(scalar(-learningRate));\n }\n\n dispose() {\n this.c.dispose();\n }\n\n getConfig(): ConfigDict {\n return {learningRate: this.learningRate};\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate);\n }\n}\nSerializationMap.register(SGDOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar, Tensor} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {SGDOptimizer} from './sgd_optimizer';\n\n/** @doclink Optimizer */\nexport class MomentumOptimizer extends SGDOptimizer {\n static className = 'MomentumOptimizer';\n private m: Scalar;\n private accumulations: NamedVariableMap;\n\n constructor(\n protected learningRate: number, private momentum: number,\n private useNesterov = false) {\n super(learningRate);\n this.m = scalar(this.momentum);\n this.accumulations = {};\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulations[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulations[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n\n const accumulation = this.accumulations[variableName];\n const gradient = variableGradients[variableName];\n\n tidy(() => {\n let newValue: Tensor;\n const newAccumulation = this.m.mul(accumulation).add(gradient);\n if (this.useNesterov) {\n newValue =\n this.c.mul(gradient.add(newAccumulation.mul(this.m))).add(value);\n } else {\n newValue = this.c.mul(newAccumulation).add(value);\n }\n this.accumulations[variableName].assign(newAccumulation);\n value.assign(newValue);\n });\n }\n }\n\n dispose() {\n super.dispose();\n this.m.dispose();\n if (this.accumulations != null) {\n for (const variableName in this.accumulations) {\n this.accumulations[variableName].dispose();\n }\n }\n }\n\n /**\n * Sets the momentum of the optimizer.\n *\n * @param momentum\n */\n setMomentum(momentum: number) {\n this.momentum = momentum;\n }\n\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n momentum: this.momentum,\n useNesterov: this.useNesterov\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate, config.momentum, config.useNesterov);\n }\n}\nSerializationMap.register(MomentumOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\n/** @doclink Optimizer */\nexport class RMSPropOptimizer extends Optimizer {\n static className = 'RMSPropOptimizer';\n private c: Scalar;\n private epsilonScalar: Scalar;\n private decayScalar: Scalar;\n private momentumScalar: Scalar;\n private oneMinusDecay: Scalar;\n private centered: boolean;\n\n private accumulatedMeanSquares: NamedVariableMap = {};\n private accumulatedMeanGrads: NamedVariableMap = {};\n private accumulatedMoments: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected decay = 0.9,\n protected momentum = 0.0, protected epsilon: number = null,\n centered = false) {\n super();\n\n this.c = keep(scalar(learningRate));\n this.decayScalar = keep(scalar(decay));\n this.momentumScalar = keep(scalar(momentum));\n this.oneMinusDecay = keep(scalar(1 - decay));\n this.centered = centered;\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsilonScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedMeanSquares[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedMeanSquares[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n if (this.accumulatedMeanGrads[variableName] == null && this.centered) {\n const trainable = false;\n tidy(() => {\n this.accumulatedMeanGrads[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n if (this.accumulatedMoments[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedMoments[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n\n const accumulatedMeanSquare = this.accumulatedMeanSquares[variableName];\n const accumulatedMeanGrad = this.accumulatedMeanGrads[variableName];\n const accumulatedMoments = this.accumulatedMoments[variableName];\n const gradient = variableGradients[variableName];\n\n tidy(() => {\n const newAccumulatedMeanSquare =\n this.decayScalar.mul(accumulatedMeanSquare)\n .add(this.oneMinusDecay.mul(gradient.square()));\n\n if (this.centered) {\n // Centered gradient\n const newAccumulatedMeanGrad =\n this.decayScalar.mul(accumulatedMeanGrad)\n .add(this.oneMinusDecay.mul(gradient));\n\n const newAccumulatedMoments =\n this.momentumScalar.mul(accumulatedMoments)\n .add(this.c.mul(gradient).div(\n newAccumulatedMeanSquare\n .sub(newAccumulatedMeanGrad.square().add(\n this.epsilonScalar))\n .sqrt()));\n\n this.accumulatedMeanSquares[variableName].assign(\n newAccumulatedMeanSquare);\n this.accumulatedMeanGrads[variableName].assign(\n newAccumulatedMeanGrad);\n this.accumulatedMoments[variableName].assign(newAccumulatedMoments);\n\n const newValue = value.sub(newAccumulatedMoments);\n value.assign(newValue);\n } else {\n // Plain gradient\n const newAccumulatedMeanSquare =\n this.decayScalar.mul(accumulatedMeanSquare)\n .add(this.oneMinusDecay.mul(gradient.square()));\n\n const newAccumulatedMoments =\n this.momentumScalar.mul(accumulatedMoments)\n .add(this.c.mul(gradient).div(\n newAccumulatedMeanSquare.add(this.epsilonScalar).sqrt()));\n\n this.accumulatedMeanSquares[variableName].assign(\n newAccumulatedMeanSquare);\n this.accumulatedMoments[variableName].assign(newAccumulatedMoments);\n\n const newValue = value.sub(newAccumulatedMoments);\n value.assign(newValue);\n }\n });\n }\n }\n\n dispose() {\n this.c.dispose();\n this.epsilonScalar.dispose();\n this.decayScalar.dispose();\n this.momentumScalar.dispose();\n this.oneMinusDecay.dispose();\n if (this.accumulatedMeanSquares != null) {\n Object.keys(this.accumulatedMeanSquares)\n .forEach(name => this.accumulatedMeanSquares[name].dispose());\n }\n if (this.accumulatedMeanGrads != null && this.centered) {\n Object.keys(this.accumulatedMeanGrads)\n .forEach(name => this.accumulatedMeanGrads[name].dispose());\n }\n if (this.accumulatedMoments != null) {\n Object.keys(this.accumulatedMoments)\n .forEach(name => this.accumulatedMoments[name].dispose());\n }\n }\n\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n decay: this.decay,\n momentum: this.momentum,\n epsilon: this.epsilon,\n centered: this.centered\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(\n config.learningRate, config.decay, config.momentum, config.epsilon,\n config.centered);\n }\n}\nSerializationMap.register(RMSPropOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {AdadeltaOptimizer} from './adadelta_optimizer';\nimport {AdagradOptimizer} from './adagrad_optimizer';\nimport {AdamOptimizer} from './adam_optimizer';\nimport {AdamaxOptimizer} from './adamax_optimizer';\nimport {MomentumOptimizer} from './momentum_optimizer';\nimport {RMSPropOptimizer} from './rmsprop_optimizer';\nimport {SGDOptimizer} from './sgd_optimizer';\n\nexport class OptimizerConstructors {\n /**\n * Constructs a `SGDOptimizer` that uses stochastic gradient descent.\n *\n * ```js\n * // Fit a quadratic function by learning the coefficients a, b, c.\n * const xs = tf.tensor1d([0, 1, 2, 3]);\n * const ys = tf.tensor1d([1.1, 5.9, 16.8, 33.9]);\n *\n * const a = tf.scalar(Math.random()).variable();\n * const b = tf.scalar(Math.random()).variable();\n * const c = tf.scalar(Math.random()).variable();\n *\n * // y = a * x^2 + b * x + c.\n * const f = x => a.mul(x.square()).add(b.mul(x)).add(c);\n * const loss = (pred, label) => pred.sub(label).square().mean();\n *\n * const learningRate = 0.01;\n * const optimizer = tf.train.sgd(learningRate);\n *\n * // Train the model.\n * for (let i = 0; i < 10; i++) {\n * optimizer.minimize(() => loss(f(xs), ys));\n * }\n *\n * // Make predictions.\n * console.log(\n * `a: ${a.dataSync()}, b: ${b.dataSync()}, c: ${c.dataSync()}`);\n * const preds = f(xs).dataSync();\n * preds.forEach((pred, i) => {\n * console.log(`x: ${i}, pred: ${pred}`);\n * });\n * ```\n *\n * @param learningRate The learning rate to use for the SGD algorithm.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static sgd(learningRate: number): SGDOptimizer {\n return new SGDOptimizer(learningRate);\n }\n\n /**\n * Constructs a `MomentumOptimizer` that uses momentum gradient\n * descent.\n *\n * See\n * [http://proceedings.mlr.press/v28/sutskever13.pdf](\n * http://proceedings.mlr.press/v28/sutskever13.pdf)\n *\n * @param learningRate The learning rate to use for the Momentum gradient\n * descent algorithm.\n * @param momentum The momentum to use for the momentum gradient descent\n * algorithm.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static momentum(learningRate: number, momentum: number, useNesterov = false):\n MomentumOptimizer {\n return new MomentumOptimizer(learningRate, momentum, useNesterov);\n }\n\n /**\n * Constructs a `RMSPropOptimizer` that uses RMSProp gradient\n * descent. This implementation uses plain momentum and is not centered\n * version of RMSProp.\n *\n * See\n * [http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf](\n * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf)\n *\n * @param learningRate The learning rate to use for the RMSProp gradient\n * descent algorithm.\n * @param decay The discounting factor for the history/coming gradient.\n * @param momentum The momentum to use for the RMSProp gradient descent\n * algorithm.\n * @param epsilon Small value to avoid zero denominator.\n * @param centered If true, gradients are normalized by the estimated\n * variance of the gradient.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static rmsprop(\n learningRate: number, decay = .9, momentum = 0.0, epsilon: number = null,\n centered = false): RMSPropOptimizer {\n return new RMSPropOptimizer(\n learningRate, decay, momentum, epsilon, centered);\n }\n\n /**\n * Constructs a `AdamOptimizer` that uses the Adam algorithm.\n * See [https://arxiv.org/abs/1412.6980](https://arxiv.org/abs/1412.6980)\n *\n * @param learningRate The learning rate to use for the Adam gradient\n * descent algorithm.\n * @param beta1 The exponential decay rate for the 1st moment estimates.\n * @param beta2 The exponential decay rate for the 2nd moment estimates.\n * @param epsilon A small constant for numerical stability.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adam(\n learningRate = 0.001, beta1 = 0.9, beta2 = 0.999,\n epsilon: number = null): AdamOptimizer {\n return new AdamOptimizer(learningRate, beta1, beta2, epsilon);\n }\n\n /**\n * Constructs a `AdadeltaOptimizer` that uses the Adadelta algorithm.\n * See [https://arxiv.org/abs/1212.5701](https://arxiv.org/abs/1212.5701)\n *\n * @param learningRate The learning rate to use for the Adadelta gradient\n * descent algorithm.\n * @param rho The learning rate decay over each update.\n * @param epsilon A constant epsilon used to better condition the grad\n * update.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adadelta(learningRate = .001, rho = .95, epsilon: number = null):\n AdadeltaOptimizer {\n return new AdadeltaOptimizer(learningRate, rho, epsilon);\n }\n\n /**\n * Constructs a `AdamaxOptimizer` that uses the Adamax algorithm.\n * See [https://arxiv.org/abs/1412.6980](https://arxiv.org/abs/1412.6980)\n *\n * @param learningRate The learning rate to use for the Adamax gradient\n * descent algorithm.\n * @param beta1 The exponential decay rate for the 1st moment estimates.\n * @param beta2 The exponential decay rate for the 2nd moment estimates.\n * @param epsilon A small constant for numerical stability.\n * @param decay The learning rate decay over each update.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adamax(\n learningRate = 0.002, beta1 = 0.9, beta2 = 0.999, epsilon: number = null,\n decay = 0.0): AdamaxOptimizer {\n return new AdamaxOptimizer(learningRate, beta1, beta2, epsilon, decay);\n }\n\n /**\n * Constructs a `AdagradOptimizer` that uses the Adagrad algorithm.\n * See\n * [http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf](\n * http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf)\n * or\n * [http://ruder.io/optimizing-gradient-descent/index.html#adagrad](\n * http://ruder.io/optimizing-gradient-descent/index.html#adagrad)\n *\n * @param learningRate The learning rate to use for the Adagrad gradient\n * descent algorithm.\n * @param initialAccumulatorValue Starting value for the accumulators, must be\n * positive.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adagrad(learningRate: number, initialAccumulatorValue = 0.1):\n AdagradOptimizer {\n return new AdagradOptimizer(learningRate, initialAccumulatorValue);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// So typings can propagate.\nimport {AdadeltaOptimizer} from './optimizers/adadelta_optimizer';\nimport {AdagradOptimizer} from './optimizers/adagrad_optimizer';\nimport {AdamOptimizer} from './optimizers/adam_optimizer';\nimport {AdamaxOptimizer} from './optimizers/adamax_optimizer';\nimport {MomentumOptimizer} from './optimizers/momentum_optimizer';\nimport {OptimizerConstructors} from './optimizers/optimizer_constructors';\nimport {RMSPropOptimizer} from './optimizers/rmsprop_optimizer';\nimport {SGDOptimizer} from './optimizers/sgd_optimizer';\n\n// tslint:disable-next-line:no-unused-expression\n[MomentumOptimizer, SGDOptimizer, AdadeltaOptimizer, AdagradOptimizer,\n RMSPropOptimizer, AdamaxOptimizer, AdamOptimizer];\n\nexport const train = {\n sgd: OptimizerConstructors.sgd,\n momentum: OptimizerConstructors.momentum,\n adadelta: OptimizerConstructors.adadelta,\n adagrad: OptimizerConstructors.adagrad,\n rmsprop: OptimizerConstructors.rmsprop,\n adamax: OptimizerConstructors.adamax,\n adam: OptimizerConstructors.adam\n};\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// backend_cpu.ts and backend_webgl.ts are standalone files and should be\n// explicily included here. Below, there is an export from backend_webgl, but\n// that doesn't count since it's exporting a Typescript interface.\nimport './kernels/backend_webgl';\nimport './kernels/backend_cpu';\n\nimport {nextFrame} from './browser_util';\nimport * as environment from './environment';\nimport {Environment} from './environment';\n\n// Serialization.\nimport * as io from './io/io';\nimport * as serialization from './serialization';\nimport {setOpHandler} from './tensor';\nimport * as test_util from './test_util';\nimport * as util from './util';\nimport {version} from './version';\nimport * as webgl from './webgl';\n\nexport {InferenceModel, ModelPredictConfig} from './model_types';\n\n// Optimizers.\nexport {AdadeltaOptimizer} from './optimizers/adadelta_optimizer';\nexport {AdagradOptimizer} from './optimizers/adagrad_optimizer';\nexport {AdamOptimizer} from './optimizers/adam_optimizer';\nexport {AdamaxOptimizer} from './optimizers/adamax_optimizer';\nexport {MomentumOptimizer} from './optimizers/momentum_optimizer';\nexport {Optimizer} from './optimizers/optimizer';\nexport {RMSPropOptimizer} from './optimizers/rmsprop_optimizer';\nexport {SGDOptimizer} from './optimizers/sgd_optimizer';\nexport {Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorBuffer, variable, Variable} from './tensor';\nexport {NamedTensorMap} from './tensor_types';\nexport {DataType, Rank, ShapeMap} from './types';\n\nexport * from './ops/ops';\nexport {LSTMCellFunc} from './ops/lstm';\nexport {Reduction} from './ops/loss_ops';\n\nexport * from './train';\nexport * from './globals';\n\nexport {Features} from './environment_util';\nexport {TimingInfo} from './engine';\nexport {ENV, Environment} from './environment';\n\nexport const setBackend = Environment.setBackend;\nexport const getBackend = Environment.getBackend;\nexport const disposeVariables = Environment.disposeVariables;\nexport const memory = Environment.memory;\nexport {version as version_core};\n\nexport {nextFrame};\n\n// Second level exports.\nexport {environment, io, serialization, test_util, util, webgl};\n\n// Backend specific.\nexport {KernelBackend, BackendTimingInfo} from './kernels/backend';\n\nimport * as ops from './ops/ops';\nsetOpHandler(ops);\n"],"names":["util.checkComputationForNaN","util.rightPad","util.arraysEqual","util.sizeFromShape","util.assert","util.getTypedArrayFromDType","tslib_1.__extends","util.bytesPerElement","util.isFunction","device_util.isMobile","util.isInt","util.clamp","util.assertShapesMatch","variable","ones","Rank","broadcast_util.assertAndGetBroadcastShape","concat_util.computeOutShape","broadcast_util.getBroadcastDims","broadcast_util.broadcastDimsAreOuter","util.squeezeShape","util.sizeToSquarishShape","webgl_util.createWebGLRenderingContextFromCanvas","webgl_util.createWebGLRenderingContext","webgl_util.callAndCheck","webgl_util.createVertexShader","webgl_util.createStaticVertexBuffer","webgl_util.createStaticIndexBuffer","webgl_util.validateTextureSize","webgl_util.createTexture","webgl_util.bindVertexBufferToProgramAttribute","tex_util.getUnpackedArraySizeFromMatrixSize","tex_util.encodeMatrixToUnpackedArray","tex_util.getPackedRGBAArraySizeFromMatrixShape","tex_util.encodeMatrixToPackedRGBA","tex_util.decodeMatrixFromUnpackedArray","tex_util.decodeMatrixFromPackedRGBA","gpgpu_util.createWebGLContext","webgl_util.getExtensionOrThrow","gpgpu_util.createVertexBuffer","gpgpu_util.createIndexBuffer","webgl_util.createFramebuffer","gpgpu_util.getTextureConfig","webgl_util.enableDebugWebGLErrorChecking","gpgpu_util.createFloat32MatrixTexture","gpgpu_util.createFloat16MatrixTexture","gpgpu_util.createUnsignedBytesMatrixTexture","gpgpu_util.uploadPixelDataToTexture","gpgpu_util.createPackedMatrixTexture","webgl_util.unbindColorTextureFromFramebuffer","webgl_util.getNumChannels","gpgpu_util.uploadMatrixToTexture","gpgpu_util.uploadMatrixToPackedTexture","gpgpu_util.downloadFloat32MatrixFromOutputTexture","gpgpu_util.downloadByteEncodedFloatMatrixFromOutputTexture","gpgpu_util.downloadFloat32MatrixFromBuffer","gpgpu_util.maybeCreateBufferFromOutputTexture","gpgpu_util.downloadMatrixFromPackedOutputTexture","webgl_util.createFragmentShader","gpgpu_util.createVertexShader","webgl_util.createProgram","webgl_util.linkProgram","webgl_util.validateProgram","gpgpu_util.bindVertexProgramAttributeStreams","webgl_util.getProgramUniformLocationOrThrow","webgl_util.getProgramUniformLocation","webgl_util.bindTextureToProgramUniformSampler","webgl_util.validateFramebuffer","util.repeatedTry","webgl_util.bindColorTextureToFramebuffer","shader_compiler.makeShader","getCoords","getSourceCoords","CHECK_NAN_SNIPPET","selu_util.SELU_SCALEALPHA","selu_util.SELU_SCALE","erf_util.ERF_P","erf_util.ERF_A1","erf_util.ERF_A2","erf_util.ERF_A3","erf_util.ERF_A4","erf_util.ERF_A5","concat_util.assertParams","this","define","sr","seedrandom.alea","util.randUniform","util.inferFromImplicitShape","util.flatten","unary_op.NEG","binaryop_gpu.MUL","array_ops_util.getReshaped","array_ops_util.getPermuted","array_ops_util.getReshapedPermuted","array_ops_util.getSliceBeginCoords","array_ops_util.getSliceSize","reduce_util.computeOptimalWindowSize","axis_util.assertAxesAreInnerMostDims","axis_util.getAxesPermutation","axis_util.getInnerMostAxes","segment_util.computeOutShape","axis_util.getUndoAxesPermutation","segment_util.segOpComputeOptimalWindowSize","binaryop_gpu.EQUAL","binaryop_gpu.NOT_EQUAL","binaryop_gpu.LESS","binaryop_gpu.LESS_EQUAL","binaryop_gpu.GREATER","binaryop_gpu.GREATER_EQUAL","unary_op.LOGICAL_NOT","binaryop_gpu.LOGICAL_AND","binaryop_gpu.LOGICAL_OR","binaryop_gpu.MIN","binaryop_gpu.MOD","binaryop_gpu.MAX","binaryop_gpu.SQUARED_DIFFERENCE","binaryop_gpu.DIV","binaryop_gpu.INT_DIV","binaryop_gpu.ADD","binaryop_gpu.SUB","binaryop_gpu.POW","unary_op.CEIL","unary_op.FLOOR","unary_op.SIGN","unary_op.ROUND","unary_op.EXP","unary_op.EXPM1","unary_op.LOG","unary_op.LOG1P","unary_op.SQRT","unary_op.RSQRT","unary_op.SQUARE","unary_op.RECIPROCAL","unary_op.RELU","unary_op.ELU","binaryop_gpu.ELU_DER","unary_op.SELU","unary_op.TO_INT","unary_op.ABS","unary_op.SIGMOID","unary_op.SOFTPLUS","unary_op.SIN","unary_op.COS","unary_op.TAN","unary_op.ASIN","unary_op.ACOS","unary_op.ATAN","binaryop_gpu.ATAN2","unary_op.SINH","unary_op.COSH","unary_op.TANH","unary_op.ASINH","unary_op.ACOSH","unary_op.ATANH","unary_op.ERF","unary_op.STEP","backend_util.castTensor","backend_util.reshapeTensor","tensor","gpgpu_math.makeShaderKey","gpgpu_math.compileProgram","gpgpu_math.runProgram","webgl_util.getTextureShapeFromLogicalShape","log","tanh","conv_util.computeConv2DInfo","conv_util.computePool2DInfo","slice_util.assertParamsValid","axis_util.parseAxisParam","axis_util.expandShapeToKeepDim","axis_util.computeOutAndReduceShapes","broadcast_util.getReductionAxes","exp","Reduction","buffer","ops.buffer","ops.tensor","ops.scalar","sum","ops.tensor2d","op","ops.zeros","ops.equal","ops.stack","min","max","reverse","all","util.tanh","mean","norm","ops.softmax","maybeStripScheme","grads","optimizer_utils.getOptimizerDefaultEpsilonValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAmBE,IAAM,CAAC,GAAG,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,IAAK,MAAc,CAAC,K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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tf-core.min.js b/node_modules/@tensorflow/tfjs-core/dist/tf-core.min.js new file mode 100644 index 0000000..f7c3416 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tf-core.min.js @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.tf=t.tf||{})}(this,function(t){"use strict";var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function n(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0;)r=Math.random()*e|0,n=t[--e],t[e]=t[r],t[r]=n}function u(t,e,n){return Math.max(t,Math.min(e,n))}function s(t,e){return Math.random()*(e-t)+t}function l(t,e){if(!t)throw new Error("string"==typeof e?e:e())}function c(t,e,n){void 0===n&&(n=""),l(v(t,e),n+" Shapes "+t+" and "+e+" must match")}function h(t){l(null!=t,"The input to the tensor constructor must be a non-null value.")}function f(t,e){if(void 0===e&&(e=[]),Array.isArray(t))for(var n=0;n0,function(){return"Element arr["+r.join("][")+"] should be a primitive, but is an array of "+e.length+" elements"});l(e.length===n[0],function(){return"Element arr["+r.join("][")+"] should have "+n[0]+" elements, but has "+e.length+" elements"});var o=n.slice(1);for(var a=0;a1;--e)if(t%e==0)return[e,t/e];return[1,t]}function x(t,e){return e<=t.length?t:t+" ".repeat(e-t.length)}function b(t,e,n){return void 0===e&&(e=function(t){return 0}),new Promise(function(r,o){var a=0,i=function(){if(t())r();else{var u=e(++a);null!=n&&a>=n?o():setTimeout(i,u)}};i()})}function w(t,e){for(var n=1,r=-1,o=0;o0)n*=t[o];else if(-1===t[o]){if(-1!==r)throw Error("Shapes can only have 1 implicit size. Found - 1 at dim "+r+" and dim "+o);r=o}else if(t[o]<=0)throw Error("Shapes can not be <= 0. Found "+t[o]+" at dim "+o);if(-1===r){if(e>0&&e!==n)throw Error("Size("+e+") must match the product of shape "+t);return t}if(e%n!=0)throw Error("The implicit shape can't be a fractional number. Got "+e+" / "+n);var a=t.slice();return a[r]=e/n,a}function E(t,e){for(var n=[],r=[],o=0,a=0;a1)throw new Error("Can't squeeze axis "+a+" since its dim '"+t[a]+"' is not 1");(null==e[o]||e[o]>a)&&1===t[a]&&(n.push(t[a]),r.push(a)),e[o]<=a&&o++}t[a]>1&&(n.push(t[a]),r.push(a))}return{newShape:n,keptDims:r}}function S(t,e){var n=null;if(null==t||"float32"===t)n=new Float32Array(e);else if("int32"===t)n=new Int32Array(e);else{if("bool"!==t)throw new Error("Unknown data type "+t);n=new Uint8Array(e)}return n}function R(t,e,n){if("float32"===e)for(var r=0;r=0;--r)n[r]=n[r+1]*t[r+1];return n}function M(t,e,n){return function(t,e){return t instanceof Float32Array&&"float32"===e||t instanceof Int32Array&&"int32"===e||t instanceof Uint8Array&&"bool"===e}(t,e)?t:(Array.isArray(t)&&(t=f(t)),function(t,e,n){if(null==e||"float32"===e)return new Float32Array(t);if("int32"===e)return n&&C(t,e),new Int32Array(t);if("bool"===e){for(var r=new Uint8Array(t.length),o=0;o1)for(var i=0;iU){var s=Array.from(e.subarray(0,z)),l=Array.from(e.subarray(i-z,i));return["["+s.map(function(t,e){return G(t,o[e])}).join(", ")+", ..., "+l.map(function(t,e){return G(t,o[i-z+e])}).join(", ")+"]"]}return["["+Array.from(e).map(function(t,e){return G(t,o[e])}).join(", ")+"]"]}var c=n.slice(1);var h=r.slice(1);var f=r[0];var p=[];if(i>U){for(var d=0;d {...}) to avoid memory leaks.");return this.keepTensors.add(t.id),t},t.prototype.startScope=function(t,e){void 0===e&&(e=!1),e&&0===this.gradientScopeCount&&(this.activeTape=[]),e&&this.gradientScopeCount++;var n={track:[],name:"unnamed scope"};t&&(n.name=t),this.scopeStack.push(n),this.activeScope=n},t.prototype.endScope=function(t,e){var n=this;void 0===e&&(e=!1),e&&(this.gradientScopeCount--,0===this.gradientScopeCount&&(this.activeTape=null));var r=new Set(this.keepTensors),o=J(t);o.forEach(function(t){return r.add(t.id)});for(var a=0;a0,"gradients() received an empty list of xs."),this.tidy("gradients",function(){var a=t();l(a instanceof X,"The result y returned by f() must be a tensor.");var i=function(t,e,n){for(var r={},o={},a=0;a=0;a--){i=(v=t[a]).inputs;var p=[];for(p.push(v.output),c=0;c0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");var u,s,c={};return c[a.id]=null==n?(u=a.shape,s=_(d(u),"float32"),X.make(u,{values:s})):n,function(t,e){for(var n=e.length-1;n>=0;n--){var r=e[n],o=t[r.output.id];if(null==r.gradient)throw new Error("Cannot compute gradient: gradient function not found for "+r.name+".");var a=r.gradient(o);for(var i in r.inputs){if(!(i in a))throw new Error("Cannot backprop through input "+i+". Available gradients found: "+Object.keys(a)+".");var u=a[i](),s=r.inputs[i];if(!v(u.shape,s.shape))throw new Error("Error in gradient for op "+r.name+". The gradient of input '"+i+"' has shape '"+u.shape+"', which does not match the shape of the input '"+s.shape+"'");if(null==t[s.id])t[s.id]=u;else{var l=t[s.id];t[s.id]=l.add(u),l.dispose()}}}}(c,i),{value:a,grads:e.map(function(t){return c[t.id]})}},!0)},t.prototype.customGrad=function(t){var e=this;return l(A(t),"The f passed in customGrad(f) must be a function."),function(){for(var n,r,o=[],a=0;a {op();...}); to avoid memory leaks.");return this.activeScope.track.push(t),t},t}();!function(t){t[t.NUMBER=0]="NUMBER",t[t.BOOLEAN=1]="BOOLEAN",t[t.STRING=2]="STRING"}(Z||(Z={}));var et=[{name:"DEBUG",type:Z.BOOLEAN},{name:"IS_BROWSER",type:Z.BOOLEAN},{name:"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",type:Z.NUMBER},{name:"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",type:Z.BOOLEAN},{name:"WEBGL_VERSION",type:Z.NUMBER},{name:"WEBGL_RENDER_FLOAT32_ENABLED",type:Z.BOOLEAN},{name:"WEBGL_DOWNLOAD_FLOAT_ENABLED",type:Z.BOOLEAN},{name:"WEBGL_FENCE_API_ENABLED",type:Z.BOOLEAN},{name:"BACKEND",type:Z.STRING}];function nt(t,e){var n;try{n=it(t,e)}catch(t){return!1}return null!=n&&(ut(n),!0)}var rt="tfjsflags";function ot(){var t={};if("undefined"==typeof window||void 0===window.location)return t;var e,n,r=(e=window.location.search,n={},e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(t){for(var e=[],r=1;r0?0:function(t,e){if(0===t)return 0;var n,r=it(t,e);return n=at(r,"EXT_disjoint_timer_query_webgl2")&&2===t?2:at(r,"EXT_disjoint_timer_query")?1:0,null!=r&&ut(r),n}(e,this.get("IS_BROWSER"))}if("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE"===t)return this.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&(n=navigator.userAgent||navigator.vendor||window.opera,!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(n)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(n.substr(0,4))));if("HAS_WEBGL"===t)return this.get("WEBGL_VERSION")>0;if("WEBGL_VERSION"===t)return nt(2,this.get("IS_BROWSER"))?2:nt(1,this.get("IS_BROWSER"))?1:0;if("WEBGL_RENDER_FLOAT32_ENABLED"===t)return function(t,e){if(0===t)return!1;var n=it(t,e);if(1===t){if(!at(n,"OES_texture_float"))return!1}else if(!at(n,"EXT_color_buffer_float"))return!1;st(n,t);var r=n.checkFramebufferStatus(n.FRAMEBUFFER)===n.FRAMEBUFFER_COMPLETE;return ut(n),r}(this.get("WEBGL_VERSION"),this.get("IS_BROWSER"));if("WEBGL_DOWNLOAD_FLOAT_ENABLED"===t)return function(t,e){if(0===t)return!1;var n=it(t,e);if(1===t){if(!at(n,"OES_texture_float"))return!1}else if(!at(n,"EXT_color_buffer_float"))return!1;st(n,t),n.readPixels(0,0,1,1,n.RGBA,n.FLOAT,new Float32Array(4));var r=n.getError()===n.NO_ERROR;return ut(n),r}(this.get("WEBGL_VERSION"),this.get("IS_BROWSER"));if("WEBGL_FENCE_API_ENABLED"===t)return function(t,e){if(2!==t)return!1;var n=it(t,e),r=null!=n.fenceSync;return ut(n),r}(this.get("WEBGL_VERSION"),this.get("IS_BROWSER"));if("TEST_EPSILON"===t)return this.get("WEBGL_RENDER_FLOAT32_ENABLED")?.001:.1;var n;throw new Error("Unknown feature "+t+".")},t.prototype.setFeatures=function(t){this.features=Object.assign({},t)},t.prototype.reset=function(){this.features=ot(),null!=this.globalEngine&&(this.globalEngine=null)},t.prototype.initBackend=function(t,e){var n=this;void 0===e&&(e=!1),this.backendName=t,this.backend=this.findBackend(t),this.globalEngine=new tt(this.backend,e,function(){return n.get("DEBUG")})},t.prototype.findBackend=function(t){return t in this.registry?this.registry[t].backend:null},t.prototype.registerBackend=function(t,e,n,r){var o=this;if(void 0===n&&(n=1),t in this.registry)return console.warn(t+" backend was already registered. Reusing existing backend"),null!=r&&r(function(){return o.engine}),!1;try{var a=e();return this.registry[t]={backend:a,priority:n},!0}catch(e){return console.warn("Registration of backend "+t+" failed"),console.warn(e.stack||e.message),!1}},t.prototype.removeBackend=function(t){if(!(t in this.registry))throw new Error(t+" backend not found in registry");this.registry[t].backend.dispose(),delete this.registry[t]},Object.defineProperty(t.prototype,"engine",{get:function(){return this.initDefaultBackend(),this.globalEngine},enumerable:!0,configurable:!0}),t.prototype.initDefaultBackend=function(){null==this.globalEngine&&this.initBackend(this.get("BACKEND"),!1)},t}();var ct,ht=(null==(ct=function(){var t;if("undefined"!=typeof window)t=window;else{if("undefined"==typeof process)throw new Error("Could not find a global object");t=process}return t}()).ENV&&(ct.ENV=new lt(ot()),j(function(){return ct.ENV.engine})),ct.ENV),ft=Object.freeze({Environment:lt,ENV:ht});function pt(){for(var t=[],e=0;e=2*e+1||o%2==1?i.push(o):a.push(o);r.push.apply(r,a),r.push(0),r.push.apply(r,i)}return r}function mt(t,e,n,r){void 0===r&&(r=!0);var o=[];r?o.push(t[0]/n):o.push(t[0]*n);for(var a=1;a=-n&&t0?o>=u[e]:o<=u[e]);o+=r[e])n+=1;return n}),[i,l]}function Dt(t,e,n,r,o){var a=e[o];t&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var i=r[o];return a<0&&(a+=i),a=u(0,a,i-1)}function Nt(t,e,n,r,o){var a=e[o];t&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var i=r[o];return a<0&&(a+=i),a=n[o]>0?u(0,a,i):u(-1,a,i-1)}function Mt(t,e){if(l(A(t),"The f passed in variableGrads(f) must be a function"),l(null==e||Array.isArray(e)&&e.every(function(t){return t instanceof K}),"The varList passed in variableGrads(f, varList) must be an array of variables"),null==e)for(var n in e=[],ht.engine.registeredVariables)e.push(ht.engine.registeredVariables[n]);var r=e.length;l((e=e.filter(function(t){return t.trainable})).length>0,"variableGrads() expects at least one of the input variables to be trainable, but none of the "+r+" variables is trainable.");var o=ht.engine.gradients(t,e,null,!0),a=o.value,i=o.grads;l(i.some(function(t){return null!=t}),"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),l(0===a.rank,"The f passed in variableGrads(f) must return a scalar, but it returned a rank-"+a.rank+" tensor");var u={};return e.forEach(function(t,e){null!=i[e]&&(u[t.name]=i[e])}),{value:a,grads:u}}function _t(t){return ht.engine.customGrad(t)}function Ot(t){if(t.filter(function(t){return null==t}).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.")}function Ft(t,e,n,r){if(void 0===r&&(r="float32"),r=r||"float32",t instanceof X)return t;if(!T(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t)throw new Error("Argument '"+e+"' passed to '"+n+"' must be a Tensor or TensorLike, but got "+t.constructor.name);var o=p(t);return T(t)||Array.isArray(t)||(t=[t]),X.make(o,{values:M(t,r,ht.get("DEBUG"))},r)}function Lt(t,e,n){if(!Array.isArray(t))throw new Error("Argument "+e+" passed to "+n+" must be a `Tensor[]` or `TensorLike[]`");return t.map(function(t,r){return Ft(t,e+"["+r+"]",n)})}function Bt(t){var e=Object.keys(t);if(1!==e.length)throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with "+e.length+" keys.");var n=e[0],r=t[n];n.endsWith("_")&&(n=n.substring(0,n.length-1));var o=function(){for(var t=[],e=0;e1)return Xt([0],r);var o=O(Math.abs(Math.ceil((e-t)/n)),r);eo}).sort(function(t,e){return e.score-t.score}),i=[],u=0;u=0;--f){if(he(t,c,i[f])>=r){h=!0;break}}if(!h&&(i.push(c),i.length>=n))break}return Vt(i,"int32")}function he(t,e,n){var r=t.subarray(4*e,4*e+4),o=t.subarray(4*n,4*n+4),a=Math.min(r[0],r[2]),i=Math.min(r[1],r[3]),u=Math.max(r[0],r[2]),s=Math.max(r[1],r[3]),l=Math.min(o[0],o[2]),c=Math.min(o[1],o[3]),h=Math.max(o[0],o[2]),f=Math.max(o[1],o[3]),p=(u-a)*(s-i),d=(h-l)*(f-c);if(p<=0||d<=0)return 0;var v=Math.max(a,l),m=Math.max(i,c),g=Math.min(u,h),y=Math.min(s,f),x=Math.max(g-v,0)*Math.max(y-m,0);return x/(p+d-x)}function fe(t,e,n,r,o){for(var a=e[e.length-1],i=[t.length/a,a],u=i[0],s=i[1],l=S(n,u*r),c=S("int32",u*r),h=0;h":"<",s=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+r+";\n\n int bestIndex = 0;\n float bestValue = getA(batch, inOffset);\n\n for (int i = 0; i < "+r+"; i++) {\n int inIdx = "+s+";\n float candidate = getA(batch, inIdx);\n if (candidate "+u+" bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n "}}(),de=function(){return function(t){this.variableNames=["dy"],this.outputShape=t.inShape;var e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,o=t.strideWidth,a=e-1-t.padInfo.top,i=n-1-t.padInfo.left,u=1/(e*n);this.userCode="\n const ivec2 pads = ivec2("+a+", "+i+");\n const float avgMultiplier = float("+u+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+e+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+o+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n "}}();function ve(t,e){for(var n=t.length,r=[],o=0;o1&&1===i&&r.unshift(a)}return r}function me(t,e){for(var n=[],r=0;r1)&&n.unshift(a)}return n}function ge(t,e){for(var n=[],r="Operands could not be broadcast together with shapes "+t+" and "+e+".",o=Math.max(t.length,e.length),a=0;a1&&u>1&&i!==u)throw Error(r);n.unshift(Math.max(i,u))}return n}var ye=function(){return function(t,e,n,r,o,a){this.outputShape=[],this.supportsBroadcasting=!0,this.variableNames=["x","mean","variance"],ge(t,e),ge(t,n);var i="0.0";null!=r&&(ge(t,r),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");var u="1.0";null!=o&&(ge(t,o),this.variableNames.push("scale"),u="getScaleAtOutCoords()"),this.outputShape=t,this.userCode="\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = "+i+";\n float scale = "+u+";\n float inv = scale * inversesqrt(variance + float("+a+"));\n setOutput((x - mean) * inv + offset);\n }\n "}}(),xe=function(){function t(t,e,n){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.outputShape=ge(e,n),this.userCode="\n uniform float NAN;\n float binaryOperation(float a, float b) {\n "+t+"\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n "}return t.prototype.getCustomSetupFunc=function(){var t=this;return function(e,n){null==t.startLoc&&(t.startLoc=e.getUniformLocationNoThrow(n,"NAN"),null==t.startLoc)||e.gl.uniform1f(t.startLoc,NaN)}},t}(),be=function(){return function(t,e,n){this.variableNames=["A"],this.outputShape=t;var r=e.toFixed(20),o=n.toFixed(20);this.userCode="\n void main() {\n float value = getAAtOutCoords();\n if (isNaN(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, "+r+", "+o+"));\n }\n "}}();function we(t,e,n){l(t.length===e.length,"x1 and x2 should have the same rank.");var r=t.slice();return r[n]+=e[n],r}var Ee=function(){return function(t,e){this.variableNames=["A","B"],this.outputShape=[],this.outputShape=we(t,e,1),this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n float value = 0.0;\n if (yC < "+t[1]+") {\n value = getA(yR, yC);\n } else {\n yC -= "+t[1]+";\n value = getB(yR, yC);\n }\n\n setOutput(value);\n }\n "}}(),Se=function(){return function(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;var e=t.strideHeight,n=t.strideWidth,r=t.padInfo.top,o=t.padInfo.left;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < "+t.batchSize+"; b++) {\n for (int yR = 0; yR < "+t.outHeight+"; yR++) {\n int xR = wR + yR * "+e+" - "+r+";\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+t.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+o+";\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),Re=function(){return function(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;var e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,o=t.strideWidth,a=e-1-t.padInfo.top,i=n-1-t.padInfo.left;this.userCode="\n const ivec2 pads = ivec2("+a+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+e+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+e+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+o+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n for (int d2 = 0; d2 < "+t.outChannels+"; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),Ce=function(){return function(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;var e=t.strideHeight,n=t.strideWidth,r=t.padInfo.top,o=t.padInfo.left,a=t.outChannels/t.inChannels;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * "+a+" + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < "+t.batchSize+"; b++) {\n for (int yR = 0; yR < "+t.outHeight+"; yR++) {\n int xR = wR + yR * "+e+" - "+r+";\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+t.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+o+";\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),ke=function(){return function(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;var e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,o=t.strideWidth,a=e-1-t.padInfo.top,i=n-1-t.padInfo.left,u=t.outChannels/t.inChannels;this.userCode="\n const ivec2 pads = ivec2("+a+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < "+e+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+e+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+o+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < "+u+"; dm++) {\n int d2 = d1 * "+u+" + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),Te=function(){return function(t){this.variableNames=["x","W"],this.outputShape=t.outShape;var e=t.padInfo.top,n=t.padInfo.left,r=t.strideHeight,o=t.strideWidth,a=t.dilationHeight,i=t.dilationWidth,u=t.filterHeight,s=t.filterWidth,l=4*Math.floor(t.inChannels/4),c=t.inChannels%4;this.userCode="\n const ivec2 strides = ivec2("+r+", "+o+");\n const ivec2 pads = ivec2("+e+", "+n+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+u+"; wR++) {\n int xR = xRCorner + wR * "+a+";\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+s+"; wC++) {\n int xC = xCCorner + wC * "+i+";\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n for (int d1 = 0; d1 < "+l+"; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if ("+(1===c)+") {\n dotProd +=\n getX(batch, xR, xC, "+l+") *\n getW(wR, wC, "+l+", d2);\n } else if ("+(2===c)+") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, "+l+"),\n getX(batch, xR, xC, "+l+" + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, "+l+", d2),\n getW(wR, wC, "+l+" + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if ("+(3===c)+") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, "+l+"),\n getX(batch, xR, xC, "+l+" + 1),\n getX(batch, xR, xC, "+l+" + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, "+l+", d2),\n getW(wR, wC, "+l+" + 1, d2),\n getW(wR, wC, "+l+" + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n "}}(),Ie=function(){return function(t){this.variableNames=["x","W"],this.outputShape=t.outShape;var e=t.inHeight,n=t.inWidth,r=t.padInfo.top,o=t.padInfo.left,a=t.strideHeight,i=t.strideWidth,u=t.dilationHeight,s=t.dilationWidth,l=t.filterHeight,c=t.filterWidth,h=t.outChannels/t.inChannels;this.userCode="\n const ivec2 strides = ivec2("+a+", "+i+");\n const ivec2 pads = ivec2("+r+", "+o+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / "+h+";\n int q = d2 - d1 * "+h+";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < "+l+"; wR++) {\n int xR = xRCorner + wR * "+u+";\n\n if (xR < 0 || xR >= "+e+") {\n continue;\n }\n\n for (int wC = 0; wC < "+c+"; wC++) {\n int xC = xCCorner + wC * "+s+";\n\n if (xC < 0 || xC >= "+n+") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n "}}();function Ae(t,e,n,r){var o=t.map(function(t){var e=d(t.shapeInfo.logicalShape);return t.shapeInfo.isUniform?"uniform float "+t.name+(e>1?"["+e+"]":"")+";":"uniform sampler2D "+t.name+";"});o=o.join("\n");var a=t.map(function(t){return function(t,e,n){var r=function(t){var e=t.name,n="get"+e.charAt(0).toUpperCase()+e.slice(1)+"Flat",r=d(t.shapeInfo.logicalShape);if(t.shapeInfo.isUniform)return 1===r?"float "+n+"(int index) {return "+e+";}":"\n float "+n+"(int index) {\n for (int i = 0; i < "+r+"; i++) {\n if (i == index) {\n return "+e+"[i];\n }\n }\n }\n ";var o=t.shapeInfo.texShape,a=o[0],i=o[1];if(1===i&&1===a)return"\n float "+n+"(int index) {\n return sampleTexture("+e+", halfCR);\n }\n ";if(1===i)return"\n float "+n+"(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / "+a+".0);\n return sampleTexture("+e+", uv);\n }\n ";if(1===a)return"\n float "+n+"(int index) {\n vec2 uv = vec2((float(index) + 0.5) / "+i+".0, 0.5);\n return sampleTexture("+e+", uv);\n }\n ";return"\n float "+n+"(int index) {\n vec2 uv = UVfrom1D("+a+", "+i+", index);\n return sampleTexture("+e+", uv);\n }\n "}(t);r+=De(t),(n||v(t.shapeInfo.logicalShape,e.logicalShape))&&(r+=function(t,e,n){var r=t.name,o=r.charAt(0).toUpperCase()+r.slice(1),a="get"+o+"AtOutCoords",i=ve(t.shapeInfo.logicalShape,e.logicalShape),u=t.shapeInfo.logicalShape.length,s=e.logicalShape.length,l=n&&(s>u||i.length>0),c=function(t){for(var e=0;e=1?"coords = 0;":s.map(function(t){return"coords["+(t+l)+"] = 0;"}).join("\n");var c="";c=a<2&&o>0?"coords":t.shapeInfo.logicalShape.map(function(t,e){return"coords["+(e+l)+"]"}).join(", ");return"\n float "+r+"() {\n "+i+" coords = getOutputCoords();\n "+u+"\n return get"+n+"("+c+");\n }\n "}(t,e,o,a);var f=d(t.shapeInfo.logicalShape),p="";l&&c&&(p="\n int mainPart = index / "+f+";\n index -= mainPart * "+f+";\n ");var m=e.texShape;if(h)return 1===f?"float "+a+"() {return "+r+";}":"\n float "+a+"() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+m[0]+", "+m[1]+"));\n int index = resTexRC.x * "+m[1]+" + resTexRC.y;\n "+p+"\n return get"+o+"Flat(index);\n }\n ";var g=t.shapeInfo.texShape;if(v(g,m))return"\n float "+a+"() {\n return sampleTexture("+r+", resultUV);\n }\n ";return"\n float "+a+"() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+m[0]+", "+m[1]+"));\n int index = resTexRC.x * "+m[1]+" + resTexRC.y;\n "+p+"\n int texR = index / "+g[1]+";\n int texC = index - texR * "+g[1]+";\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+g[1]+".0, "+g[0]+".0);\n\n return sampleTexture("+r+", uv);\n }\n "}(t,e,n));return r}(t,e,r)}).join("\n"),i=e.texShape,u=function(t,e){switch(t.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(t,e){if(1===e[0])return"\n int getOutputCoords() {\n return int(resultUV.x * "+e[1]+".0);\n }\n ";if(1===e[1])return"\n int getOutputCoords() {\n return int(resultUV.y * "+e[0]+".0);\n }\n ";return"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n return resTexRC.x * "+e[1]+" + resTexRC.y;\n }\n "}(0,e);case 2:return function(t,e){if(v(t,e))return"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2("+e[0]+", "+e[1]+"));\n }\n ";if(1===t[1])return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n return ivec2(index, 0);\n }\n ";if(1===t[0])return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n return ivec2(0, index);\n }\n ";return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n int r = index / "+t[1]+";\n int c = index - r * "+t[1]+";\n return ivec2(r, c);\n }\n "}(t,e);case 3:return r=e,o=(n=t)[1]*n[2],a=n[2],"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+r[0]+", "+r[1]+"));\n int index = resTexRC.x * "+r[1]+" + resTexRC.y;\n int r = index / "+o+";\n index -= r * "+o+";\n int c = index / "+a+";\n int d = index - c * "+a+";\n return ivec3(r, c, d);\n }\n ";case 4:return function(t,e){var n=t[3],r=t[2]*n,o=t[1]*r;return"\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n\n int r = index / "+o+";\n index -= r * "+o+";\n\n int c = index / "+r+";\n index -= c * "+r+";\n\n int d = index / "+n+";\n int d2 = index - d * "+n+";\n\n return ivec4(r, c, d, d2);\n }\n "}(t,e);case 5:return function(t,e){var n=t[4],r=t[3]*n,o=t[2]*r,a=t[1]*o;return"\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2("+e[0]+",\n "+e[1]+"));\n\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n\n int r = index / "+a+";\n index -= r * "+a+";\n\n int c = index / "+o+";\n index -= c * "+o+";\n\n int d = index / "+r+";\n index -= d * "+r+";\n\n int d2 = index / "+n+";\n int d3 = index - d2 * "+n+";\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n "}(t,e);case 6:return function(t,e){var n=t[5],r=t[4]*n,o=t[3]*r,a=t[2]*o,i=t[1]*a;return"\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n\n int r = index / "+i+";\n index -= r * "+i+";\n\n int c = index / "+a+";\n index -= c * "+a+";\n\n int d = index / "+o+";\n index -= d * "+o+";\n\n int d2 = index / "+r+";\n index -= d2 * "+r+";\n\n int d3 = index / "+n+";\n int d4 = index - d3 * "+n+";\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n "}(t,e);default:throw new Error(t.length+"-D output sampling is not yet supported")}var n,r,o,a}(e.logicalShape,i);return[_e,Ne,Me,o,u,a,n].join("\n")}function De(t){var e,n,r=t.shapeInfo.logicalShape;switch(r.length){case 0:return function(t){var e=t.name,n="get"+e.charAt(0).toUpperCase()+e.slice(1);if(t.shapeInfo.isUniform)return"float "+n+"() {return "+e+";}";return"\n float "+n+"() {\n return sampleTexture("+e+", halfCR);\n }\n "}(t);case 1:return e=t.name,"\n float "+(n="get"+e.charAt(0).toUpperCase()+e.slice(1))+"(int index) {\n return "+n+"Flat(index);\n }\n ";case 2:return function(t){var e=t.shapeInfo.logicalShape,n=t.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),o=t.shapeInfo.texShape;if(null!=o&&v(e,o)){var a=o[0],i=o[1];return"\n float "+r+"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2("+i+".0, "+a+".0);\n return sampleTexture("+n+", uv);\n }\n "}var u=E(e),s=u.newShape,l=u.keptDims,c=s;if(c.length";this.userCode="\n int getIndex(int i) {\n "+(n?"return "+o+" -i - 1;":"return i;")+"\n }\n\n void main() {\n "+Oe(r)+" coords = getOutputCoords();\n int end = "+Pe(r,"coords")+";\n float val = 0.0;\n for (int i = "+o+" - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx "+a+" end) {\n continue;\n }\n if (idx == end && "+e+") {\n continue;\n }\n "+Pe(r,"coords")+" = idx;\n val += getX("+function(t,e){if(1===t)return""+e;if(2===t)return e+".x, "+e+".y";if(3===t)return e+".x, "+e+".y, "+e+".z";if(4===t)return e+".x, "+e+".y, "+e+".z, "+e+".w";throw Error("Cumulative sum for rank "+t+" is not yet supported")}(r,"coords")+");\n }\n setOutput(val);\n }\n "}}();function Pe(t,e){if(1===t)return""+e;if(2===t)return e+".y";if(3===t)return e+".z";if(4===t)return e+".w";throw Error("Cumulative sum for rank "+t+" is not yet supported")}var Ue,ze,Ve=function(){return function(t){this.variableNames=["A"],this.outputShape=t,this.userCode="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n gl_FragColor = encode_float(x);\n }\n "}}(),We=function(){return function(t){this.variableNames=["A"];var e=t[0],n=t[1];this.outputShape=t,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+n+".0, "+e+".0);\n\n vec4 values = texture2D(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n "}}(),Ge=function(){return function(t,e,n){this.variableNames=["A","indices"];var r=t.slice();r[n]=e,this.outputShape=r,this.rank=r.length;var o=Oe(this.rank),a=function(t,e){var n=t.length;if(n>4)throw Error("Gather for rank "+n+" is not yet supported");if(1===n)return"int(getIndices(resRC))";for(var r=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],a=0;a= "+r);for(var o=0,a=0;ar||n>r){o="["+e+"x"+n+"]";throw new Error("Requested texture size "+o+" greater than WebGL maximum on this browser / GPU "+("["+r+"x"+r+"]")+".")}}function gn(t){return Tn(t,function(){return t.createFramebuffer()},"Unable to create WebGLFramebuffer.")}function yn(t,e,n,r,o,a,i){var u=t.getAttribLocation(e,n);return-1!==u&&(Je(t,function(){return t.bindBuffer(t.ARRAY_BUFFER,r)}),Je(t,function(){return t.vertexAttribPointer(u,o,t.FLOAT,!1,a,i)}),Je(t,function(){return t.enableVertexAttribArray(u)}),!0)}function xn(t,e,n){In(t,n),Je(t,function(){return t.activeTexture(t.TEXTURE0+n)}),Je(t,function(){return t.bindTexture(t.TEXTURE_2D,e)})}function bn(t,e,n){return Tn(t,function(){return t.getUniformLocation(e,n)},'uniform "'+n+'" not present in program.')}function wn(t,e,n){return t.getUniformLocation(e,n)}function En(t,e,n,r,o){Je(t,function(){return xn(t,n,o)}),Je(t,function(){return t.uniform1i(r,o)})}function Sn(t,e,n){Je(t,function(){return t.bindFramebuffer(t.FRAMEBUFFER,n)}),Je(t,function(){return t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)})}function Rn(t,e){Je(t,function(){return t.bindFramebuffer(t.FRAMEBUFFER,e)}),Je(t,function(){return t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,null,0)})}function Cn(t){var e=t.checkFramebufferStatus(t.FRAMEBUFFER);if(e!==t.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+kn(t,e))}function kn(t,e){switch(e){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case t.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return"unknown error "+e}}function Tn(t,e,n){var r=Je(t,function(){return e()});if(null==r)throw new Error(n);return r}function In(t,e){var n=t.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=e+t.TEXTURE0;if(rn)throw new Error("textureUnit must be in "+("[gl.TEXTURE0, gl.TEXTURE"+n+"]")+".")}function An(t,e){2!==e.length&&(e=E(e).newShape);var n=pn(t),r=d(e);return e.length<=1&&r<=n?[r,1]:2===e.length&&e[0]<=n&&e[1]<=n?e:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?[e[0],e[1]*e[2]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n?[e[0],e[1]*e[2]*e[3]]:y(r)}var Dn=Object.freeze({createWebGLRenderingContext:Ye,createWebGLRenderingContextFromCanvas:Qe,callAndCheck:Je,enableDebugWebGLErrorChecking:tn,checkWebGLError:en,getWebGLErrorMessage:nn,getExtensionOrThrow:rn,createVertexShader:on,createFragmentShader:an,createProgram:sn,linkProgram:ln,validateProgram:cn,createStaticVertexBuffer:hn,createStaticIndexBuffer:fn,queryMaxTextureSize:pn,getNumChannels:dn,createTexture:vn,validateTextureSize:mn,createFramebuffer:gn,bindVertexBufferToProgramAttribute:yn,bindTextureUnit:xn,unbindTextureUnit:function(t,e){In(t,e),Je(t,function(){return t.activeTexture(t.TEXTURE0+e)}),Je(t,function(){return t.bindTexture(t.TEXTURE_2D,null)})},getProgramUniformLocationOrThrow:bn,getProgramUniformLocation:wn,bindTextureToProgramUniformSampler:En,bindCanvasToFramebuffer:function(t){Je(t,function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)}),Je(t,function(){return t.viewport(0,0,t.canvas.width,t.canvas.height)}),Je(t,function(){return t.scissor(0,0,t.canvas.width,t.canvas.height)})},bindColorTextureToFramebuffer:Sn,unbindColorTextureFromFramebuffer:Rn,validateFramebuffer:Cn,getFramebufferErrorMessage:kn,getTextureShapeFromLogicalShape:An});function Nn(){return{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0}}function Mn(t){var e,n={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};return Je(e=null!=t?Qe(t,n):Ye(n),function(){return e.disable(e.DEPTH_TEST)}),Je(e,function(){return e.disable(e.STENCIL_TEST)}),Je(e,function(){return e.disable(e.BLEND)}),Je(e,function(){return e.disable(e.DITHER)}),Je(e,function(){return e.disable(e.POLYGON_OFFSET_FILL)}),Je(e,function(){return e.disable(e.SAMPLE_COVERAGE)}),Je(e,function(){return e.enable(e.SCISSOR_TEST)}),Je(e,function(){return e.enable(e.CULL_FACE)}),Je(e,function(){return e.cullFace(e.BACK)}),e}function _n(t){return on(t,"\n precision highp float;\n attribute vec3 clipSpacePos;\n attribute vec2 uv;\n varying vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }")}function On(t){return hn(t,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function Fn(t){return fn(t,new Uint16Array([0,1,2,2,1,3]))}function Ln(t,e){var n,r,o,a,i,u,s,l=t;return 2===ht.get("WEBGL_VERSION")?(n=l.R32F,r=l.R16F,o=l.RGBA32F,a=l.RED,i=4,u=1,s=l.HALF_FLOAT):(n=t.RGBA,r=t.RGBA,o=l.RGBA,a=t.RGBA,i=4,u=4,s=null!=e?e.HALF_FLOAT_OES:null),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedFloat:o,textureFormatFloat:a,downloadTextureFormat:t.RGBA,downloadUnpackNumChannels:i,defaultNumChannels:u,textureTypeHalfFloat:s}}function Bn(t,e,n,r,o,a){mn(t,e,n);var i=vn(t),u=t.TEXTURE_2D;return Je(t,function(){return t.bindTexture(u,i)}),Je(t,function(){return t.texParameteri(u,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE)}),Je(t,function(){return t.texParameteri(u,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}),Je(t,function(){return t.texParameteri(u,t.TEXTURE_MIN_FILTER,t.NEAREST)}),Je(t,function(){return t.texParameteri(u,t.TEXTURE_MAG_FILTER,t.NEAREST)}),Je(t,function(){return t.texImage2D(u,0,r,e,n,0,o,a,null)}),Je(t,function(){return t.bindTexture(t.TEXTURE_2D,null)}),i}function Pn(t,e,n,r){var o=qe(e,n);return Bn(t,o[0],o[1],r.internalFormatFloat,r.textureFormatFloat,t.FLOAT)}function Un(t,e,n,r){var o=qe(e,n);return Bn(t,o[0],o[1],r.internalFormatFloat,r.textureFormatFloat,r.textureTypeHalfFloat)}function zn(t,e,n,r){var o=qe(e,n);return Bn(t,o[0],o[1],t.RGBA,t.RGBA,t.UNSIGNED_BYTE)}function Vn(t,e,n,r){var o=je(e,n);return Bn(t,o[0],o[1],r.internalFormatPackedFloat,t.RGBA,t.FLOAT)}function Wn(t,e,n){return Je(t,function(){return t.bindBuffer(t.ARRAY_BUFFER,n)}),yn(t,e,"clipSpacePos",n,3,20,0)&&yn(t,e,"uv",n,2,20,12)}function Gn(t,e,n){Je(t,function(){return t.bindTexture(t.TEXTURE_2D,e)}),Je(t,function(){return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n)}),Je(t,function(){return t.bindTexture(t.TEXTURE_2D,null)})}function qn(t,e,n,r,o,a){mn(t,n,r),Je(t,function(){return t.bindTexture(t.TEXTURE_2D,e)}),Je(t,function(){return t.texSubImage2D(t.TEXTURE_2D,0,0,0,n,r,a,t.FLOAT,o)}),Je(t,function(){return t.bindTexture(t.TEXTURE_2D,null)})}function Hn(t,e,n,r,o,a,i){var u,s=qe(n,r),l=s[0],c=s[1];1===i.defaultNumChannels?u=o:function(t,e,n){var r=He(t.length,n);if(e.length= "+r);for(var o=0,a=0;a= "+o);for(var a=je(e,n),i=a[0],u=a[1],s=n%2==1,l=e%2==1,c=Math.floor(n/2),h=Math.floor(e/2),f=s?4:0,p=n,d=0,v=0;v= "+o);for(var a=n%2==1,i=e%2==1,u=Math.floor(n/2),s=Math.floor(e/2),l=je(e,n),c=l[0],h=l[1],f=a?4:0,p=n+(a?1:0),d=0,v=0,m=n,g=0;g0?(e=this.beginQuery(),this.endQuery(),n=function(){return r.isQueryAvailable(e,ht.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}):n=function(){return!0};return{query:e,isFencePassed:n}},t.prototype.downloadMatrixFromPackedTexture=function(t,e,n){var r=this;return this.downloadMatrixDriver(t,function(){return Qn(r.gl,e,n,r.textureConfig)})},t.prototype.createProgram=function(t){this.throwIfDisposed();var e=this.gl,n=an(e,t),r=_n(e),o=sn(e);return Je(e,function(){return e.attachShader(o,r)}),Je(e,function(){return e.attachShader(o,n)}),ln(e,o),this.autoDebugValidate&&cn(e,o),this.vertexAttrsAreBound||(this.setProgram(o),this.vertexAttrsAreBound=Wn(e,this.program,this.vertexBuffer)),o},t.prototype.deleteProgram=function(t){var e=this;this.throwIfDisposed(),t===this.program&&(this.program=null),null!=t&&Je(this.gl,function(){return e.gl.deleteProgram(t)})},t.prototype.setProgram=function(t){var e=this;this.throwIfDisposed(),this.program=t,null!=this.program&&this.autoDebugValidate&&cn(this.gl,this.program),Je(this.gl,function(){return e.gl.useProgram(t)})},t.prototype.getUniformLocation=function(t,e,n){return void 0===n&&(n=!0),this.throwIfDisposed(),n?bn(this.gl,t,e):wn(this.gl,t,e)},t.prototype.getAttributeLocation=function(t,e){var n=this;return this.throwIfDisposed(),Je(this.gl,function(){return n.gl.getAttribLocation(t,e)})},t.prototype.getUniformLocationNoThrow=function(t,e){return this.throwIfDisposed(),this.gl.getUniformLocation(t,e)},t.prototype.setInputMatrixTexture=function(t,e,n){this.throwIfDisposed(),this.throwIfNoProgram(),En(this.gl,this.program,t,e,n)},t.prototype.setOutputMatrixTexture=function(t,e,n){this.setOutputMatrixTextureDriver(t,n,e)},t.prototype.setOutputPackedMatrixTexture=function(t,e,n){this.throwIfDisposed();var r=je(e,n),o=r[0],a=r[1];this.setOutputMatrixTextureDriver(t,o,a)},t.prototype.setOutputMatrixWriteRegion=function(t,e,n,r){this.setOutputMatrixWriteRegionDriver(n,t,r,e)},t.prototype.setOutputPackedMatrixWriteRegion=function(t,e,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")},t.prototype.debugValidate=function(){null!=this.program&&cn(this.gl,this.program),Cn(this.gl)},t.prototype.executeProgram=function(){this.throwIfDisposed(),this.throwIfNoProgram();var t=this.gl;this.autoDebugValidate&&this.debugValidate(),Je(t,function(){return t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0)})},t.prototype.blockUntilAllProgramsCompleted=function(){var t=this;this.throwIfDisposed(),Je(this.gl,function(){return t.gl.finish()})},t.prototype.getQueryTimerExtension=function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=rn(this.gl,2===ht.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension},t.prototype.getQueryTimerExtensionWebGL2=function(){return this.getQueryTimerExtension()},t.prototype.getQueryTimerExtensionWebGL1=function(){return this.getQueryTimerExtension()},t.prototype.beginQuery=function(){if(2===ht.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var t=this.gl,e=this.getQueryTimerExtensionWebGL2(),n=t.createQuery();return t.beginQuery(e.TIME_ELAPSED_EXT,n),n}var r=this.getQueryTimerExtensionWebGL1(),o=r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT,o),o},t.prototype.endQuery=function(){if(2!==ht.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var t=this.getQueryTimerExtensionWebGL1();t.endQueryEXT(t.TIME_ELAPSED_EXT)}else{var e=this.gl,n=this.getQueryTimerExtensionWebGL2();e.endQuery(n.TIME_ELAPSED_EXT)}},t.prototype.waitForQueryAndGetTime=function(t){return o(this,void 0,void 0,function(){var e=this;return a(this,function(n){switch(n.label){case 0:return[4,b(function(){return e.isQueryAvailable(t,ht.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))})];case 1:return n.sent(),[2,this.getQueryTime(t,ht.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))]}})})},t.prototype.getQueryTime=function(t,e){if(0===e)return null;if(2===e){var n=this.gl;return n.getQueryParameter(t,n.QUERY_RESULT)/1e6}var r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(t,r.QUERY_RESULT_EXT)/1e6},t.prototype.isQueryAvailable=function(t,e){if(0===e)return!0;if(2===e){var n=this.gl,r=this.getQueryTimerExtensionWebGL2(),o=n.getQueryParameter(t,n.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),o&&!this.disjoint}o=(r=this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(t,r.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),o&&!this.disjoint},t.prototype.pollFence=function(t){var e=this;return new Promise(function(n){e.addItemToPoll(function(){return t.isFencePassed()},function(){return n()})})},t.prototype.pollItems=function(){for(var t=function(t){var e=0,n=t.length-1,r=-1;for(;e<=n;){var o=e+n>>1,a=t[o]();a?(r=o,e=o+1):n=o-1}return r}(this.itemsToPoll.map(function(t){return t.isDoneFn})),e=0;e<=t;++e){(0,this.itemsToPoll[e].resolveFn)()}this.itemsToPoll=this.itemsToPoll.slice(t+1)},t.prototype.addItemToPoll=function(t,e){var n=this;this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1||b(function(){return n.pollItems(),0===n.itemsToPoll.length})},t.prototype.bindTextureToFrameBuffer=function(t){this.throwIfDisposed(),Sn(this.gl,t,this.framebuffer),this.autoDebugValidate&&Cn(this.gl)},t.prototype.unbindTextureToFrameBuffer=function(){null!=this.outputTexture?(Sn(this.gl,this.outputTexture,this.framebuffer),this.autoDebugValidate&&Cn(this.gl)):Rn(this.gl,this.framebuffer)},t.prototype.downloadMatrixDriver=function(t,e){this.bindTextureToFrameBuffer(t);var n=e();return this.unbindTextureToFrameBuffer(),n},t.prototype.setOutputMatrixTextureDriver=function(t,e,n){this.throwIfDisposed();var r=this.gl;Sn(r,t,this.framebuffer),this.autoDebugValidate&&Cn(r),this.outputTexture=t,Je(r,function(){return r.viewport(0,0,e,n)}),Je(r,function(){return r.scissor(0,0,e,n)})},t.prototype.setOutputMatrixWriteRegionDriver=function(t,e,n,r){var o=this;this.throwIfDisposed(),Je(this.gl,function(){return o.gl.scissor(t,e,n,r)})},t.prototype.throwIfDisposed=function(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")},t.prototype.throwIfNoProgram=function(){if(null==this.program)throw new Error("No GPU program is currently set.")},t}();function tr(t,e){if(t.length!==e.length)throw Error("Binary was compiled with "+t.length+" inputs, but was executed with "+e.length+" inputs");t.forEach(function(t,n){var r=t.logicalShape,o=e[n],a=o.tensor.shape;if(!v(r,a))throw Error("Binary was compiled with different shapes than the current args. Shapes "+r+" and "+a+" must match");if(!t.isUniform||!o.isUniform){var i=t.texShape,u=o.isUniform?null:o.texData.texShape;if(!v(i,u))throw Error("Binary was compiled with different texture shapes than the current args. Shape "+i+" and "+u+" must match")}})}var er=function(){return function(t,e,n,r,o){this.variableNames=["x"],this.outputShape=[];var a,i=e,u=t[3]-1;this.outputShape=t;var s="float("+n+") + float("+r+") * sum";a=.5===o?"inversesqrt("+s+")":1===o?"1.0/("+s+")":"exp(log("+s+") * float(-"+o+"));",this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -"+i+"; j <= "+i+"; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= "+u+") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * "+a+";\n setOutput(val);\n }\n "}}(),nr=function(){return function(t,e,n,r,o){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=t,this.depth=t[3],this.depthRadius=e,this.bias=n,this.alpha=r,this.beta=o,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < "+this.depth+"; ++d) {\n int depthBegin = int(max(0.0, float(d - "+e+")));\n int depthEnd = int(min(float("+this.depth+"),\n float(d + "+e+" + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = "+this.depth+";\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float("+r+") * norm + float("+n+");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float("+r+")\n * float("+o+")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * "+o+");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n "}}(),rr=function(){return function(t){this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;var e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,o=t.strideWidth,a=e-1-t.padInfo.top,i=n-1-t.padInfo.left,u=e*n-1;this.userCode="\n const ivec2 pads = ivec2("+a+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+e+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+o+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = "+u+" - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * "+n+" + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n "}}(),or=function(){return function(t,e,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1),this.variableNames=["matrixA","matrixB"];var o=n?t[1]:t[0],a=r?e[0]:e[1],i=n?t[0]:t[1];this.outputShape=[o,a];var u=function(t,e){return n?e+" + "+t+", aRow":"aRow, "+e+" + "+t},s=function(t,e){return r?"bCol, "+e+" + "+t:e+" + "+t+", bCol"},l=4*Math.floor(i/4),c=i%4;this.userCode=" float dotARowBCol(int aRow, int bCol) {\n float result = 0.0;\n for (int i = 0; i < "+l+"; i += 4) {\n vec4 a = vec4(\n getMatrixA("+u(0,"i")+"),\n getMatrixA("+u(1,"i")+"),\n getMatrixA("+u(2,"i")+"),\n getMatrixA("+u(3,"i")+")\n );\n vec4 b = vec4(\n getMatrixB("+s(0,"i")+"),\n getMatrixB("+s(1,"i")+"),\n getMatrixB("+s(2,"i")+"),\n getMatrixB("+s(3,"i")+")\n );\n\n result += dot(a, b);\n }\n\n if ("+(1===c)+") {\n result += getMatrixA("+u(0,l)+") *\n getMatrixB("+s(0,l)+");\n } else if ("+(2===c)+") {\n vec2 a = vec2(\n getMatrixA("+u(0,l)+"),\n getMatrixA("+u(1,l)+")\n );\n vec2 b = vec2(\n getMatrixB("+s(0,l)+"),\n getMatrixB("+s(1,l)+")\n );\n result += dot(a, b);\n } else if ("+(3===c)+") {\n vec3 a = vec3(\n getMatrixA("+u(0,l)+"),\n getMatrixA("+u(1,l)+"),\n getMatrixA("+u(2,l)+")\n );\n vec3 b = vec3(\n getMatrixB("+s(0,l)+"),\n getMatrixB("+s(1,l)+"),\n getMatrixB("+s(2,l)+")\n );\n result += dot(a, b);\n }\n\n return result;\n }\n\n void main() {\n ivec2 resRC = getOutputCoords();\n setOutput(dotARowBCol(resRC.x, resRC.y));\n }\n "}}(),ar=function(){function t(t,e,n){this.variableNames=["probs"],this.outputShape=[t,n],this.userCode="\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < "+(e-1)+"; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float("+(e-1)+"));\n }\n "}return t.prototype.getCustomSetupFunc=function(t){var e=this;return function(n,r){null==e.seedLoc&&(e.seedLoc=n.getUniformLocation(r,"seed")),n.gl.uniform1f(e.seedLoc,t)}},t}(),ir=function(){return function(t,e,n,r){this.variableNames=["indices"],this.outputShape=[t,e],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float("+r+"), float("+n+"),\n float(index == coords.y)));\n }\n "}}(),ur=function(){return function(t,e,n){this.variableNames=["x"],this.outputShape=e.map(function(e,n){return e[0]+t[n]+e[1]});var r=t.length,o=Oe(r),a=e.map(function(t){return t[0]}).join(","),i=e.map(function(e,n){return e[0]+t[n]}).join(","),u=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);this.userCode=1!==r?"\n "+o+" start = "+o+"("+a+");\n "+o+" end = "+o+"("+i+");\n\n void main() {\n "+o+" outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float("+n+"));\n } else {\n "+o+" coords = outC - start;\n setOutput(getX("+u+"));\n }\n }\n ":"\n int start = "+a+";\n int end = "+i+";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float("+n+"));\n } else {\n setOutput(getX(outC - start));\n }\n }\n "}}(),sr=function(){return function(t,e,n){if(this.variableNames=["x"],"avg"===e&&n)throw new Error("Cannot compute positions for average pool.");var r=t.filterHeight,o=t.filterWidth,a=t.strideHeight,i=t.strideWidth,u=t.padInfo.top,s=t.padInfo.left;this.outputShape=t.outShape;var l="avg"===e,c="0.0";if(l||(c="-1.0 / 0.0"),n)this.userCode="\n const ivec2 strides = ivec2("+a+", "+i+");\n const ivec2 pads = ivec2("+u+", "+s+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < "+r+"; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+o+"; wC++) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value >= currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * "+o+" + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ";else{var h=e+"("+e+"("+e+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===e&&(h="avgValue / count");var f=4*Math.floor(o/4),p=o%4,d="\n if ("+l+") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n ";this.userCode="\n const ivec2 strides = ivec2("+a+", "+i+");\n const ivec2 pads = ivec2("+u+", "+s+");\n const float initializationValue = "+c+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= "+t.inWidth+") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4("+c+");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < "+r+"; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+f+"; wC += 4) {\n int xC = xCCorner + wC;\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n getValue(batch, xR, xC + 3, d)\n );\n\n "+d+"\n }\n\n int xC = xCCorner + "+f+";\n if ("+(1===p)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+d+"\n } else if ("+(2===p)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n initializationValue,\n initializationValue\n );\n\n "+d+"\n } else if ("+(3===p)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n initializationValue\n );\n\n "+d+"\n }\n }\n setOutput("+h+");\n }\n "}}}(),lr=function(){return function(t,e){this.variableNames=["x"];var n=t.windowSize,r=t.batchSize,o=t.inSize,a=Math.ceil(o/n);this.outputShape=[r,a];var i="0.0",u="";"min"===e?(i="1.0 / 0.0",u="min"):"max"===e&&(i="-1.0 / 0.0",u="max");var s=e+"("+e+"("+e+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum"===e?s="sumValue":"all"===e?s="allValue":"any"===e&&(s="anyValue");var l=4*Math.floor(n/4),c=n%4,h="\n if ("+("sum"===e)+") {\n sumValue += dot(values, ones);\n } else {\n minMaxValue = "+u+"(values, minMaxValue);\n }\n ",f="vec4";"all"===e?(i="1.0",h="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",f="bvec4"):"any"===e&&(i="0.0",h="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",f="bvec4");var p="";o%n>0&&(p="\n if (inIdx < 0 || inIdx >= "+o+") {\n return initializationValue;\n }\n "),this.userCode="\n const float initializationValue = "+i+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n "+p+"\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+n+";\n\n vec4 minMaxValue = vec4("+i+");\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < "+l+"; i += 4) {\n int inIdx = inOffset + i;\n "+f+" values = "+f+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n "+h+"\n }\n\n int inIdx = inOffset + "+l+";\n if ("+(1===c)+") {\n "+f+" values = "+f+"(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+h+"\n } else if ("+(2===c)+") {\n "+f+" values = "+f+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n "+h+"\n } else if ("+(3===c)+") {\n "+f+" values = "+f+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n "+h+"\n }\n setOutput("+s+");\n }\n "}}(),cr=function(){return function(t,e,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e.shape;var r=e.shape,o=r[1],a=r[2],i=t.shape,u=i[1],s=i[2],l=[n&&u>1?o-1:o,n&&s>1?a-1:a],c=[n&&u>1?u-1:u,n&&s>1?s-1:s],h=l[0]/c[0],f=l[1]/c[1],p=1/h,d=1/f,v=2*Math.ceil(p)+2,m=2*Math.ceil(d)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+h+");\n const float widthScale = float("+f+");\n\n const float invHeightScale = float("+p+");\n const float invWidthScale = float("+d+");\n\n const int winHeight = int("+v+");\n const int winWidth = int("+m+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+u+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+s+") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), "+(o-1)+".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), "+(a-1)+".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "}}(),hr=function(){return function(t,e,n,r){this.variableNames=["A"],this.outputShape=[];var o=t[0],a=t[1],i=t[2],u=t[3];this.outputShape=[o,e,n,u];var s=[r&&e>1?a-1:a,r&&n>1?i-1:i],l=[r&&e>1?e-1:e,r&&n>1?n-1:n];this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+s[0]/l[0]+",\n "+s[1]/l[1]+");\n const vec2 inputShapeRC = vec2("+a+".0, "+i+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n "}}(),fr=function(){return function(t,e,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e.shape;var r=e.shape,o=r[1],a=r[2],i=t.shape,u=i[1],s=i[2],l=[n&&u>1?o-1:o,n&&s>1?a-1:a],c=[n&&u>1?u-1:u,n&&s>1?s-1:s],h=l[0]/c[0],f=l[1]/c[1],p=1/h,d=1/f,v=2*Math.ceil(p)+2,m=2*Math.ceil(d)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+h+");\n const float widthScale = float("+f+");\n\n const float invHeightScale = float("+p+");\n const float invWidthScale = float("+d+");\n\n const int winHeight = int("+v+");\n const int winWidth = int("+m+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+u+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+s+") {\n continue;\n }\n\n float sourceFracRow =\n float("+l[0]+") *\n (float(dyR) / float("+c[0]+"));\n\n float sourceFracCol =\n float("+l[1]+") *\n (float(dyC) / float("+c[1]+"));\n\n int sourceNearestRow = int(min(\n float(int("+o+") - 1),\n "+n+" ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int("+a+") - 1),\n "+n+" ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "}}(),pr=function(){return function(t,e,n,r){this.variableNames=["A"],this.outputShape=[];var o=t[0],a=t[1],i=t[2],u=t[3];this.outputShape=[o,e,n,u];var s=[r&&e>1?a-1:a,r&&n>1?i-1:i],l=[r&&e>1?e-1:e,r&&n>1?n-1:n],c=r?"0.5":"0.0";this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+s[0]/l[0]+",\n "+s[1]/l[1]+");\n const vec2 inputShapeRC = vec2("+a+".0, "+i+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + "+c+")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n "}}(),dr=function(){return function(t,e){this.variableNames=["x"];var n=t.length;if(n>4)throw new Error("WebGL backend: Reverse of rank-"+n+" tensor is not yet supported");if(this.outputShape=t,1!==n){var r=t.map(function(n,r){return function(n){return-1!==e.indexOf(n)&&1!==t[n]?t[n]+" - coords["+n+"] - 1":"coords["+n+"]"}(r)}).join(","),o=Oe(n);this.userCode="\n void main() {\n "+o+" coords = getOutputCoords();\n setOutput(getX("+r+"));\n }\n "}else this.userCode="\n void main() {\n int coord = getOutputCoords();\n setOutput(getX("+t[0]+" - coord - 1));\n }\n "}}(),vr=function(){return function(t,e){this.variableNames=["x","segmentIds"];var n=t.windowSize,r=t.batchSize,o=t.inSize,a=t.numSegments,i=a*Math.ceil(o/n);this.outputShape=[r,i];var u=4*Math.floor(n/4),s=n%4,l="\n sumValue += dot(values, filter);\n ",c="";o%n>0&&(c="\n if (inIdx < 0 || inIdx >= "+o+") {\n return initializationValue;\n }\n ");var h="";o%n>0&&(h="\n if (inIdx < 0 || inIdx >= "+o+") {\n return -1.0;\n }\n "),this.userCode="\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n "+c+"\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n "+h+"\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n "+a+")) * float("+n+"));\n int currentSeg = int(mod(float(outIdx), float("+a+")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < "+u+"; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n "+l+"\n }\n\n int inIdx = inOffset + "+u+";\n if ("+(1===s)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n "+l+"\n } else if ("+(2===s)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n "+l+"\n } else if ("+(3===s)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n "+l+"\n }\n setOutput(sumValue);\n }\n "}}(),mr=function(){return function(t,e,n){var r,o;if(this.variableNames=["c","a","b"],this.outputShape=e,n>4)throw Error("Where for rank "+n+" is not yet supported");if(1===n)o="resRC",r="resRC";else{for(var a=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],u=[],s=0;s= 1.0) {\n setOutput(getA("+o+"));\n } else {\n setOutput(getB("+o+"));\n }\n }\n "}}(),gr=function(){function t(t){this.variableNames=["source"],this.outputShape=t,this.rank=t.length;var e=Oe(this.rank),n=function(t){if(1===t)return"sourceLoc";if(2===t)return"sourceLoc.x, sourceLoc.y";if(3===t)return"sourceLoc.x, sourceLoc.y, sourceLoc.z";if(4===t)return"sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w";throw Error("Slicing for rank "+t+" is not yet supported")}(this.rank);this.userCode="\n uniform "+e+" start;\n\n void main() {\n "+e+" sourceLoc = start + getOutputCoords();\n setOutput(getSource("+n+"));\n }\n "}return t.prototype.getCustomSetupFunc=function(t){var e=this;if(t.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+t.length+")");return function(n,r){if(null!=e.startLoc||(e.startLoc=n.getUniformLocationNoThrow(r,"start"),null!=e.startLoc))if(1===e.rank)n.gl.uniform1i(e.startLoc,t[0]);else if(2===e.rank)n.gl.uniform2i(e.startLoc,t[0],t[1]);else if(3===e.rank)n.gl.uniform3i(e.startLoc,t[0],t[1],t[2]);else{if(4!==e.rank)throw Error("Slicing for rank "+e.rank+" is not yet supported");n.gl.uniform4i(e.startLoc,t[0],t[1],t[2],t[3])}}},t}();var yr=function(){return function(t,e,n){this.variableNames=["x"],this.outputShape=n,this.rank=n.length;var r=Oe(this.rank),o="";o=1===this.rank?"coords * strides + begin":n.map(function(t,e){return"coords["+e+"] * strides["+e+"] + begin["+e+"]"}).join(","),this.userCode="\n "+r+" begin = "+r+"("+t+");\n "+r+" strides = "+r+"("+e+");\n\n void main() {\n "+r+" coords = getOutputCoords();\n setOutput(getX("+o+"));\n }\n "}}(),xr=function(){function t(t){this.gpgpu=t,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return t.prototype.acquireTexture=function(t,e){var n,r=br(e),o=wr(t,r);if(o in this.freeTextures||(this.freeTextures[o]=[]),o in this.usedTextures||(this.usedTextures[o]=[]),this.freeTextures[o].length>0){this.numFreeTextures--,this.numUsedTextures++,this.log();var a=this.freeTextures[o].shift();return this.usedTextures[o].push(a),a}return this.numUsedTextures++,this.log(),r===ze.FLOAT32?n=this.gpgpu.createFloat32MatrixTexture(t[0],t[1]):r===ze.FLOAT16?n=this.gpgpu.createFloat16MatrixTexture(t[0],t[1]):r===ze.UNSIGNED_BYTE&&(n=this.gpgpu.createUnsignedBytesMatrixTexture(t[0],t[1])),this.usedTextures[o].push(n),n},t.prototype.releaseTexture=function(t,e,n){var r=wr(e,br(n));r in this.freeTextures||(this.freeTextures[r]=[]),this.freeTextures[r].push(t),this.numFreeTextures++,this.numUsedTextures--;var o=this.usedTextures[r],a=o.indexOf(t);if(a<0)throw new Error("Cannot release a texture that was never provided by this texture manager");o.splice(a,1),this.log()},t.prototype.log=function(){if(this.logEnabled){var t=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",this.numFreeTextures+" / "+this.numUsedTextures,"("+t+")")}},t.prototype.getNumUsedTextures=function(){return this.numUsedTextures},t.prototype.getNumFreeTextures=function(){return this.numFreeTextures},t.prototype.dispose=function(){var t=this;if(null!=this.freeTextures){for(var e in this.freeTextures)this.freeTextures[e].forEach(function(e){t.gpgpu.deleteMatrixTexture(e)});for(var e in this.usedTextures)this.usedTextures[e].forEach(function(e){t.gpgpu.deleteMatrixTexture(e)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0}},t}();function br(t){if(t===Ue.DOWNLOAD||t===Ue.PIXELS)return ze.UNSIGNED_BYTE;if(t===Ue.UPLOAD)return ze.FLOAT32;if(t===Ue.RENDER)return ht.get("WEBGL_RENDER_FLOAT32_ENABLED")?ze.FLOAT32:ze.FLOAT16;throw new Error("Unknown logical texture type "+t)}function wr(t,e){return t[0]+"_"+t[1]+"_"+e}var Er=function(){return function(t,e){this.variableNames=["A"];for(var n=new Array(t.length),r=0;r5)throw Error("Tile for rank "+e+" is not yet supported");if(1===e)return"imod(resRC, "+t[0]+")";for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[],o=0;o6)throw Error("Transpose for rank "+e+" is not yet supported");for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(e),o=0;o= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n";var Dr=Tr+"\n return sin(x);\n",Nr=Tr+"\n return cos(x);\n",Mr=Tr+"\n return atan(x);\n",_r=Tr+"\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));",Or=Tr+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;";function Fr(t,e,n){!function(t,e,n){var r=t.length,o=e.length;l(t.length===e.length,"Error in concat"+r+"D: rank of x1 ("+r+") and x2 ("+o+") must be the same."),l(n>=0&&n=1,"Pass at least one tensor to concat");var n=Lt(t,"tensors","concat"),r=n[0];if(1===n.length)return r;for(var o=Et(e,r.shape),a=1;a>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)});n.next=function(){var t=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=t-(n.c=0|t)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(t),n.s0<0&&(n.s0+=1),n.s1-=r(t),n.s1<0&&(n.s1+=1),n.s2-=r(t),n.s2<0&&(n.s2+=1),r=null}(t),o=e&&e.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+1.1102230246251565e-16*(2097152*a()|0)},a.quick=a,o&&("object"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}e&&e.exports?e.exports=o:n&&n.amd?n(function(){return o}):this.alea=o}(0,t,!1)}),Gr=Vr(function(t){!function(t,e,n){function r(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function o(t,e){var n=new function(t){var e=this,n="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:n+=t;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=n.next,a.quick=a,o&&("object"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}e&&e.exports?e.exports=o:n&&n.amd?n(function(){return o}):this.xor128=o}(0,t,!1)}),qr=Vr(function(t){!function(t,e,n){function r(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function o(t,e){var n=new function(t){var e=this,n="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:n+=t;for(var r=0;r>>4),e.next()}(t),o=e&&e.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=n.next,a.quick=a,o&&("object"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}e&&e.exports?e.exports=o:n&&n.amd?n(function(){return o}):this.xorwow=o}(0,t,!1)}),Hr=Vr(function(t){!function(t,e,n){function r(t,e){return e.x=t.x.slice(),e.i=t.i,e}function o(t,e){null==t&&(t=+new Date);var n=new function(t){var e=this;e.next=function(){var t,n,r=e.x,o=e.i;return t=r[o],n=(t^=t>>>7)^t<<24,n^=(t=r[o+1&7])^t>>>10,n^=(t=r[o+3&7])^t>>>3,n^=(t=r[o+4&7])^t<<7,t=r[o+7&7],n^=(t^=t<<13)^t<<9,r[o]=n,e.i=o+1&7,n},function(t,e){var n,r=[];if(e===(0|e))r[0]=e;else for(e=""+e,n=0;n0;--n)t.next()}(e,t)}(t),o=e&&e.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=n.next,a.quick=a,o&&(o.x&&r(o,n),a.state=function(){return r(n,{})}),a}e&&e.exports?e.exports=o:n&&n.amd?n(function(){return o}):this.xorshift7=o}(0,t,!1)}),$r=Vr(function(t){!function(t,e,n){function r(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function o(t,e){null==t&&(t=+new Date);var n=new function(t){var e=this;e.next=function(){var t,n,r=e.w,o=e.X,a=e.i;return e.w=r=r+1640531527|0,n=o[a+34&127],t=o[a=a+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,n=o[a]=n^t,e.i=a,n+(r^r>>>16)|0},function(t,e){var n,r,o,a,i,u=[],s=128;for(e===(0|e)?(r=e,e=null):(e+="\0",r=0,s=Math.max(s,e.length)),o=0,a=-32;a>>15,r^=r<<4,r^=r>>>13,a>=0&&(i=i+1640531527|0,o=0==(n=u[127&a]^=r+i)?o+1:0);for(o>=128&&(u[127&(e&&e.length||0)]=-1),o=127,a=512;a>0;--a)r=u[o+34&127],n=u[o=o+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,u[o]=r^n;t.w=i,t.X=u,t.i=o}(e,t)}(t),o=e&&e.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=n.next,a.quick=a,o&&(o.X&&r(o,n),a.state=function(){return r(n,{})}),a}e&&e.exports?e.exports=o:n&&n.amd?n(function(){return o}):this.xor4096=o}(0,t,!1)}),jr=Vr(function(t){!function(t,e,n){function r(t,e){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e}function o(t,e){var n=new function(t){var e=this,n="";e.next=function(){var t=e.b,n=e.c,r=e.d,o=e.a;return t=t<<25^t>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-t|0,e.b=t=t<<20^t>>>12^n,e.c=n=n-r|0,e.d=r<<16^n>>>16^o,e.a=o-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):n+=t;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=n.next,a.quick=a,o&&("object"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}e&&e.exports?e.exports=o:n&&n.amd?n(function(){return o}):this.tychei=o}(0,t,!1)}),Xr=Vr(function(t){!function(e,n){var r,o=this,a=256,i=6,u="random",s=n.pow(a,i),l=n.pow(2,52),c=2*l,h=a-1;function f(t,f,m){var g=[],y=d(function t(e,n){var r,o=[],a=typeof e;if(n&&"object"==a)for(r in e)try{o.push(t(e[r],n-1))}catch(t){}return o.length?o:"string"==a?e:e+"\0"}((f=1==f?{entropy:!0}:f||{}).entropy?[t,v(e)]:null==t?function(){try{var t;return r&&(t=r.randomBytes)?t=t(a):(t=new Uint8Array(a),(o.crypto||o.msCrypto).getRandomValues(t)),v(t)}catch(t){var n=o.navigator,i=n&&n.plugins;return[+new Date,o,i,o.screen,v(e)]}}():t,3),g),x=new function(t){var e,n=t.length,r=this,o=0,i=r.i=r.j=0,u=r.S=[];n||(t=[n++]);for(;o=c;)t/=2,e/=2,n>>>=1;return(t+n)/e};return b.int32=function(){return 0|x.g(4)},b.quick=function(){return x.g(4)/4294967296},b.double=b,d(v(x.S),e),(f.pass||m||function(t,e,r,o){return o&&(o.S&&p(o,x),t.state=function(){return p(x,{})}),r?(n[u]=t,e):t})(b,y,"global"in f?f.global:this==n,f.state)}function p(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function d(t,e){for(var n,r=t+"",o=0;o=1||0===i);var u=Math.sqrt(-2*Math.log(i)/i);e=this.mean+this.stdDev*o*u,n=this.mean+this.stdDev*a*u,this.truncated&&!this.isValidTruncated(e)||(r=!0)}return this.truncated&&!this.isValidTruncated(n)||(this.nextVal=this.convertValue(n)),this.convertValue(e)},t.prototype.convertValue=function(t){return null==this.dtype||"float32"===this.dtype?t:Math.round(t)},t.prototype.isValidTruncated=function(t){return t<=this.upper&&t>=this.lower},t}();function Qr(t,e){return o(this,void 0,void 0,function(){var n,r,o,i,u,s,l,c,h,f,p,d,v,m,g,y,x,b,w,E;return a(this,function(a){switch(a.label){case 0:if(2!==(n=Ft(t,"img","toPixels","int32")).rank&&3!==n.rank)throw new Error("toPixels only supports rank 2 or 3 tensors, got rank "+n.rank+".");if(r=n.shape.slice(0,2),o=r[0],i=r[1],(u=2===n.rank?1:n.shape[2])>4||2===u)throw new Error("toPixels only supports depth of size 1, 3 or 4 but got "+u);return s=n.min(),l=n.max(),[4,s.data()];case 1:return c=a.sent()[0],[4,l.data()];case 2:if(h=a.sent()[0],s.dispose(),l.dispose(),"float32"===n.dtype){if(c<0||h>1)throw new Error("Tensor values for a float32 Tensor must be in the range [0 - 1] but got range ["+c+" - "+h+"].")}else{if("int32"!==n.dtype)throw new Error("Unsupported type for toPixels: "+n.dtype+". Please use float32 or int32 tensors.");if(c<0||h>255)throw new Error("Tensor values for a int32 Tensor must be in the range [0 - 255] but got range ["+c+" - "+h+"].")}return[4,n.data()];case 3:for(f=a.sent(),p="float32"===n.dtype?255:1,d=new Uint8ClampedArray(i*o*4),v=0;v4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");return ht.engine.fromPixels(t,e)}}),io=Bt({multinomial_:function(t,e,n,r){void 0===r&&(r=!1);var o=Ft(t,"logits","multinomial"),a=o.size,i=o.rank;if(a<2)throw new Error("Error in multinomial: you need at least 2 outcomes, but got "+a+".");if(i>2)throw new Error("Rank of probabilities must be 1 or 2, but is "+i);n=n||Math.random();var u=1===i?o.as2D(1,-1):o,s=ht.engine.runKernel(function(t){return t.multinomial(u,r,e,n)},{logits2D:u});return 1===i?s.as1D():s}}),uo=Bt({oneHot_:function(t,e,n,r){void 0===n&&(n=1),void 0===r&&(r=0);var o=Ft(t,"indices","oneHot","int32");if(l("int32"===o.dtype,"Indices must be of dtype `int32`"),e<2)throw new Error("Error in oneHot: depth must be >=2, but it is "+e);return ht.engine.runKernel(function(t){return t.oneHot(o,e,n,r)},{$indices:o})}}),so=Bt({pad_:function(t,e,n){void 0===n&&(n=0);var r=Ft(t,"x","pad");if(0===r.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");var o=e.map(function(t){return t[0]});return ht.engine.runKernel(function(t){return t.pad(r,e,n)},{$x:r},function(t){return{$x:function(){return t.slice(o,r.shape)}}})}}),lo=Bt({pad1d_:function(t,e,n){return void 0===n&&(n=0),l(2===e.length,"Invalid number of paddings. Must be length of 2."),so(t,[e],n)}}),co=Bt({pad2d_:function(t,e,n){return void 0===n&&(n=0),l(2===e.length&&2===e[0].length&&2===e[1].length,"Invalid number of paddings. Must be length of 2 each."),so(t,e,n)}}),ho=Bt({pad3d_:function(t,e,n){return void 0===n&&(n=0),l(3===e.length&&2===e[0].length&&2===e[1].length&&2===e[2].length,"Invalid number of paddings. Must be length of 2 each."),so(t,e,n)}}),fo=Bt({pad4d_:function(t,e,n){return void 0===n&&(n=0),l(4===e.length&&2===e[0].length&&2===e[1].length&&2===e[2].length&&2===e[3].length,"Invalid number of paddings. Must be length of 2 each."),so(t,e,n)}}),po=Bt({rand_:function(t,e,n){var r=d(t),o=null;if(null==n||"float32"===n)o=new Float32Array(r);else if("int32"===n)o=new Int32Array(r);else{if("bool"!==n)throw new Error("Unknown data type "+n);o=new Uint8Array(r)}for(var a=0;a=1,"Pass at least one tensor to tf.stack"),1===n.length)return n[0].expandDims(e);var r=n[0].rank,o=n[0].shape,a=n[0].dtype;l(e<=r,"Axis must be <= rank of the tensor"),n.forEach(function(t){c(o,t.shape,"All tensors passed to stack must have matching shapes")}),n.forEach(function(t){l(a===t.dtype,"All tensors passed to stack must have matching dtypes")});var i=n.map(function(t){return t.expandDims(e)});return Lr(i,e)}}),wo=Bt({tile_:function(t,e){var n=Ft(t,"x","tile");return l(n.rank===e.length,"Error in transpose: rank of input "+n.rank+" must match length of reps "+e+"."),ht.engine.runKernel(function(t){return t.tile(n,e)},{$x:n},function(t){return{$x:function(){var r=oe(n);if(1===n.rank)for(var o=0;o=1+e.length,"input rank should be > than [blockShape] but got "+r.rank),l(n.length===e.length,"crops.shape[0] must be equal to [blockShape] but got "+n.length),l(r.shape[0]%o==0,"input tensor batch must be divisible by prod( blockShape )"),ht.engine.runKernel(function(t){return t.batchToSpaceND(r,e,n)},{})}}),Co=Bt({spaceToBatchND_:function(t,e,n){var r=Ft(t,"x","spaceToBatchND");return l(r.rank>=1+e.length,"input rank should be > than [blockShape] but got "+r.rank),l(n.length===e.length,"paddings.shape[0] must be equal to [blockShape], got "+n.length),l(r.shape.reduce(function(t,n,r){return r>0&&r<=e.length?t&&n%e[r-1]==0:t},!0),"input spatial dimensions must be divisible by blockShapes"),ht.engine.runKernel(function(t){return t.spaceToBatchND(r,e,n)},{})}});function ko(t,e){for(var n=[],r=0;r0?this.gpgpu.beginQuery():{startMs:performance.now(),endMs:null}},t.prototype.endTimer=function(t){return ht.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(this.gpgpu.endQuery(),t):(t.endMs=performance.now(),t)},t.prototype.getQueryTime=function(t){return o(this,void 0,void 0,function(){var e;return a(this,function(n){return ht.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?[2,this.gpgpu.waitForQueryAndGetTime(t)]:[2,(e=t).endMs-e.startMs]})})},t.prototype.disposeData=function(t){if(!this.pendingDisposal.has(t))if(this.pendingRead.has(t))this.pendingDisposal.add(t);else if(this.texData.has(t)){var e=this.texData.get(t),n=e.texture,r=e.texShape,o=e.usage;null!=n&&this.releaseTexture(t,n,r,o),this.texData.delete(t)}},t.prototype.getTexture=function(t){return this.uploadToGPU(t),this.texData.get(t).texture},t.prototype.getGPGPUContext=function(){return this.gpgpu},t.prototype.getCanvas=function(){return this.canvas},t.prototype.slice=function(t,e,n){var r=new gr(n),o=r.getCustomSetupFunc(e);return this.compileAndRun(r,[t],null,o)},t.prototype.stridedSlice=function(t,e,n,r,o,a){var i=At(t.shape,e,n,r,o,a),u=i[0],s=i[1];if(s.some(function(t){return 0===t}))return Ut([],s);var l=new yr(u,r,s);return this.compileAndRun(l,[t])},t.prototype.reverse=function(t,e){var n=new dr(t.shape,e);return this.compileAndRun(n,[t])},t.prototype.concat=function(t,e){var n=new Ee(t.shape,e.shape);return this.compileAndRun(n,[t,e])},t.prototype.neg=function(t){var e=new kr(t.shape,"return -x;");return this.compileAndRun(e,[t])},t.prototype.matMul=function(t,e,n,r){var o=new or(t.shape,e.shape,n,r);return this.compileAndRun(o,[t,e])},t.prototype.multiply=function(t,e){var n=new xe("return a * b;",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,ie(t.dtype,e.dtype));return this.compileAndRun(n,[t,e],r)},t.prototype.batchNormalization=function(t,e,n,r,o,a){var i=[t,e,n],u=null;null!=a&&(u=a.shape,i.push(a));var s=null;null!=o&&(s=o.shape,i.push(o));var l=new ye(t.shape,e.shape,n.shape,u,s,r);return this.compileAndRun(l,i)},t.prototype.localResponseNormalization4D=function(t,e,n,r,o){var a=new er(t.shape,e,n,r,o);return this.compileAndRun(a,[t])},t.prototype.LRNGrad=function(t,e,n,r,o,a,i){var u=new nr(e.shape,r,o,a,i);return this.compileAndRun(u,[e,n,t])},t.prototype.tile=function(t,e){var n=new Er(t.shape,e);return this.compileAndRun(n,[t])},t.prototype.pad=function(t,e,n){var r=new ur(t.shape,e,n);return this.compileAndRun(r,[t])},t.prototype.transpose=function(t,e){var n=new Sr(t.shape,e);return this.compileAndRun(n,[t])},t.prototype.gather=function(t,e,n){var r=new Ge(t.shape,e.size,n);return this.compileAndRun(r,[t,e])},t.prototype.batchToSpaceND=function(t,e,n){l(t.rank<=4,"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");var r=e.reduce(function(t,e){return t*e}),o=dt(t.shape,e,r),a=vt(o.length,e.length),i=mt(t.shape,e,r),u=gt(n,e.length),s=yt(i,n,e.length);return t.reshape(o).transpose(a).reshape(i).slice(u,s)},t.prototype.spaceToBatchND=function(t,e,n){l(t.rank<=4,"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");var r=e.reduce(function(t,e){return t*e}),o=[[0,0]];o.push.apply(o,n);for(var a=1+e.length;ae||n===t){r=!0;break}n=D(t,n+1)}return n}(i,o),s=new vr({windowSize:u,inSize:i,batchSize:a,numSegments:o},e),l=s.outputShape,c=l[0],h=l[1],f=this.makeOutputArray([c,h],r);return this.compileAndRun(s,[t,n],f),f.shape[1]===o?f:(n=Qt(0,o).tile([i/u]),this.segOpCompute(f,e,n,r,o))},t.prototype.argMin=function(t,e){var n=[e];St("argMin",n,t.rank);var r=bt(t.shape,n),o=r[0],a=d(r[1]),i=t.as2D(-1,a);return this.argReduce(i,"min").reshape(o)},t.prototype.argMax=function(t,e){var n=[e];St("argMax",n,t.rank);var r=bt(t.shape,n),o=r[0],a=d(r[1]),i=t.as2D(-1,a);return this.argReduce(i,"max").reshape(o)},t.prototype.cumsum=function(t,e,n,r){if(e!==t.rank-1)throw new Error("WebGL cumsum shader expects an inner-most axis="+(t.rank-1)+" but got axis="+e);var o=new Be(t.shape,n,r);return this.compileAndRun(o,[t])},t.prototype.equal=function(t,e){var n=new xe("return float(a == b);",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[t,e],r)},t.prototype.notEqual=function(t,e){var n=new xe("return float(a != b);",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[t,e],r)},t.prototype.less=function(t,e){var n=new xe("return float(a < b);",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[t,e],r)},t.prototype.lessEqual=function(t,e){var n=new xe("return float(a <= b);",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[t,e],r)},t.prototype.greater=function(t,e){var n=new xe("return float(a > b);",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[t,e],r)},t.prototype.greaterEqual=function(t,e){var n=new xe("return float(a >= b);",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[t,e],r)},t.prototype.logicalNot=function(t){var e=new kr(t.shape,"return float(!(x >= 1.0));");return this.compileAndRun(e,[t])},t.prototype.logicalAnd=function(t,e){var n=new xe("return float(a >= 1.0 && b >= 1.0);",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[t,e],r)},t.prototype.logicalOr=function(t,e){var n=new xe("return float(a >= 1.0 || b >= 1.0);",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[t,e],r)},t.prototype.select=function(t,e,n){var r=new mr(t.rank,e.shape,e.rank),o=this.makeOutputArray(r.outputShape,ie(e.dtype,n.dtype));return this.compileAndRun(r,[t,e,n],o)},t.prototype.where=function(t){pt("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");var e=t.dataSync();return ko(t.shape,e)},t.prototype.topk=function(t,e,n){return fe(t.dataSync(),t.shape,t.dtype,e)},t.prototype.min=function(t,e){St("min",e,t.rank);var n=bt(t.shape,e),r=n[0],o=d(n[1]),a=t.as2D(-1,o);return this.reduce(a,"min",a.dtype).reshape(r)},t.prototype.minimum=function(t,e){var n=new xe("\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n\n return min(a, b);\n",t.shape,e.shape);return this.compileAndRun(n,[t,e])},t.prototype.mod=function(t,e){var n=new xe("if (b == 0.0) return NAN;\n return mod(a, b);",t.shape,e.shape),r=n.getCustomSetupFunc();return this.compileAndRun(n,[t,e],null,r)},t.prototype.max=function(t,e){St("max",e,t.rank);var n=bt(t.shape,e),r=n[0],o=d(n[1]),a=t.as2D(-1,o);return this.reduce(a,"max",a.dtype).reshape(r)},t.prototype.maximum=function(t,e){var n=new xe("\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n\n return max(a, b);\n",t.shape,e.shape);return this.compileAndRun(n,[t,e])},t.prototype.all=function(t,e){St("all",e,t.rank);var n=bt(t.shape,e),r=n[0],o=d(n[1]),a=t.as2D(-1,o);return this.reduce(a,"all",a.dtype).reshape(r)},t.prototype.any=function(t,e){St("any",e,t.rank);var n=bt(t.shape,e),r=n[0],o=d(n[1]),a=t.as2D(-1,o);return this.reduce(a,"any",a.dtype).reshape(r)},t.prototype.squaredDifference=function(t,e){var n=new xe("return (a - b) * (a - b);",t.shape,e.shape);return this.compileAndRun(n,[t,e])},t.prototype.realDivide=function(t,e){var n=new xe("if (a == b) return 1.0;\n return a / b;",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"float32");return this.compileAndRun(n,[t,e],r)},t.prototype.floorDiv=function(t,e){var n=new xe("\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,"int32");return this.compileAndRun(n,[t,e],r)},t.prototype.add=function(t,e){var n=new xe("return a + b;",t.shape,e.shape),r=this.makeOutputArray(n.outputShape,ie(t.dtype,e.dtype));return this.compileAndRun(n,[t,e],r)},t.prototype.addN=function(t){for(var e=t[0],n=1;n 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n");return this.compileAndRun(e,[t])},t.prototype.exp=function(t){var e=new kr(t.shape,"return exp(x);");return this.compileAndRun(e,[t])},t.prototype.expm1=function(t){var e=new kr(t.shape,"return exp(x) - 1.0;");return this.compileAndRun(e,[t])},t.prototype.log=function(t){var e=new kr(t.shape,"if (x < 0.0) return NAN;\n return log(x);"),n=e.getCustomSetupFunc();return this.compileAndRun(e,[t],null,n)},t.prototype.log1p=function(t){var e=new kr(t.shape,"return log(1.0 + x);");return this.compileAndRun(e,[t])},t.prototype.sqrt=function(t){var e=new kr(t.shape,"return sqrt(x);");return this.compileAndRun(e,[t])},t.prototype.rsqrt=function(t){var e=new kr(t.shape,"return inversesqrt(x);");return this.compileAndRun(e,[t])},t.prototype.square=function(t){var e=new kr(t.shape,"return x * x;");return this.compileAndRun(e,[t])},t.prototype.reciprocal=function(t){var e=new kr(t.shape,"return 1.0 / x;");return this.compileAndRun(e,[t])},t.prototype.relu=function(t){var e=new kr(t.shape,Ir);return this.compileAndRun(e,[t])},t.prototype.elu=function(t){var e=new kr(t.shape,"return (x >= 0.0) ? x : (exp(x) - 1.0);");return this.compileAndRun(e,[t])},t.prototype.eluDer=function(t,e){var n=new xe("return (b >= 1.0) ? a : a * (b + 1.0);",t.shape,e.shape);return this.compileAndRun(n,[t,e])},t.prototype.selu=function(t){var e=new kr(t.shape,Ar);return this.compileAndRun(e,[t])},t.prototype.int=function(t){var e=new kr(t.shape,"return float(int(x));"),n=this.makeOutputArray(e.outputShape,"int32");return this.compileAndRun(e,[t],n)},t.prototype.clip=function(t,e,n){var r=new be(t.shape,e,n);return this.compileAndRun(r,[t])},t.prototype.abs=function(t){var e=new kr(t.shape,"return abs(x);");return this.compileAndRun(e,[t])},t.prototype.sigmoid=function(t){var e=new kr(t.shape,"return 1.0 / (1.0 + exp(-1.0 * x));");return this.compileAndRun(e,[t])},t.prototype.softplus=function(t){var e=new kr(t.shape,"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n");return this.compileAndRun(e,[t])},t.prototype.sin=function(t){var e=new kr(t.shape,Dr);return this.compileAndRun(e,[t])},t.prototype.cos=function(t){var e=new kr(t.shape,Nr);return this.compileAndRun(e,[t])},t.prototype.tan=function(t){var e=new kr(t.shape,"return tan(x);");return this.compileAndRun(e,[t])},t.prototype.asin=function(t){var e=new kr(t.shape,"return asin(x);");return this.compileAndRun(e,[t])},t.prototype.acos=function(t){var e=new kr(t.shape,"return acos(x);");return this.compileAndRun(e,[t])},t.prototype.atan=function(t){var e=new kr(t.shape,Mr);return this.compileAndRun(e,[t])},t.prototype.atan2=function(t,e){var n=new xe("\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n\n return atan(a, b);\n",t.shape,e.shape);return this.compileAndRun(n,[t,e])},t.prototype.sinh=function(t){var e=new kr(t.shape,"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n");return this.compileAndRun(e,[t])},t.prototype.cosh=function(t){var e=new kr(t.shape,"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n");return this.compileAndRun(e,[t])},t.prototype.tanh=function(t){var e=new kr(t.shape,"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n");return this.compileAndRun(e,[t])},t.prototype.asinh=function(t){var e=new kr(t.shape,"return log(x + sqrt(x * x + 1.0));");return this.compileAndRun(e,[t])},t.prototype.acosh=function(t){var e=new kr(t.shape,_r),n=e.getCustomSetupFunc();return this.compileAndRun(e,[t],null,n)},t.prototype.atanh=function(t){var e=new kr(t.shape,Or),n=e.getCustomSetupFunc();return this.compileAndRun(e,[t],null,n)},t.prototype.erf=function(t){var e=new kr(t.shape,'\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = 0.3275911;\n float a1 = 0.254829592;\n float a2 = -0.284496736;\n float a3 = 1.421413741;\n float a4 = -1.453152027;\n float a5 = 1.061405429;\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n');return this.compileAndRun(e,[t])},t.prototype.step=function(t,e){var n=new kr(t.shape,function(t){return void 0===t&&(t=0),Tr+"\n return x > 0.0 ? 1.0 : float("+t+");\n "}(e));return this.compileAndRun(n,[t])},t.prototype.conv2d=function(t,e,n){var r=new Te(n);return this.compileAndRun(r,[t,e])},t.prototype.conv2dDerInput=function(t,e,n){var r=new Re(n);return this.compileAndRun(r,[t,e])},t.prototype.conv2dDerFilter=function(t,e,n){var r=new Se(n);return this.compileAndRun(r,[t,e])},t.prototype.depthwiseConv2D=function(t,e,n){var r=new Ie(n);return this.compileAndRun(r,[t,e])},t.prototype.depthwiseConv2DDerInput=function(t,e,n){var r=new ke(n);return this.compileAndRun(r,[t,e])},t.prototype.depthwiseConv2DDerFilter=function(t,e,n){var r=new Ce(n);return this.compileAndRun(r,[t,e])},t.prototype.maxPool=function(t,e){var n=new sr(e,"max",!1),r=this.makeOutputArray(n.outputShape,t.dtype);return this.compileAndRun(n,[t],r)},t.prototype.avgPool=function(t,e){var n=new sr(e,"avg",!1),r=this.makeOutputArray(n.outputShape,"float32");return this.compileAndRun(n,[t],r)},t.prototype.maxPoolBackprop=function(t,e,n,r){var o=new sr(r,"max",!0),a=this.compileAndRun(o,[e]),i=new rr(r),u=this.makeOutputArray(i.outputShape,e.dtype),s=this.compileAndRun(i,[t,a],u);return a.dispose(),s},t.prototype.avgPoolBackprop=function(t,e,n){var r=new de(n),o=this.makeOutputArray(r.outputShape,e.dtype);return this.compileAndRun(r,[t],o)},t.prototype.cast=function(t,e){return se(t,e,this)},t.prototype.reshape=function(t,e){return le(t,e)},t.prototype.resizeBilinear=function(t,e,n,r){var o=new hr(t.shape,e,n,r);return this.compileAndRun(o,[t])},t.prototype.resizeBilinearBackprop=function(t,e,n){var r=new cr(t,e,n);return this.compileAndRun(r,[t])},t.prototype.resizeNearestNeighbor=function(t,e,n,r){var o=new pr(t.shape,e,n,r);return this.compileAndRun(o,[t])},t.prototype.resizeNearestNeighborBackprop=function(t,e,n){var r=new fr(t,e,n);return this.compileAndRun(r,[t])},t.prototype.multinomial=function(t,e,n,r){var o=e?t:Pt(t),a=o.shape[0],i=o.shape[1],u=new ar(a,i,n),s=this.makeOutputArray(u.outputShape,"int32"),l=u.getCustomSetupFunc(r);return this.compileAndRun(u,[o],s,l)},t.prototype.oneHot=function(t,e,n,r){var o=new ir(t.size,e,n,r);return this.compileAndRun(o,[t])},t.prototype.nonMaxSuppression=function(t,e,n,r,o){return pt("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"),ce(t.dataSync(),e.dataSync(),n,r,o)},t.prototype.makeOutputArray=function(t,e){return X.make(t,{},e)},t.prototype.compileAndRun=function(t,e,n,r,o){var a=this;void 0===o&&(o=!0),null==n&&(n=this.makeOutputArray(t.outputShape,e[0].dtype));var i=e.map(function(t){var e=a.texData.get(t.dataId);return null==e.texture&&t.size<=32?{tensor:t,texData:null,isUniform:!0}:(a.uploadToGPU(t.dataId),{tensor:t,texData:e,isUniform:!1})});this.uploadToGPU(n.dataId);var u,s={tensor:n,texData:this.texData.get(n.dataId),isUniform:!1},l=function(t,e,n){var r="";e.concat(n).forEach(function(t){r+=t.tensor.shape+"_"+(t.isUniform?"uniform":t.texData.texShape)});var o=t.userCode,a=(!0===t.supportsBroadcasting).toString(),i=t.constructor.name;return i+="_"+a+"_"+r+"_"+o}(t,i,s),c=this.getAndSaveBinary(l,function(){return function(t,e,n,r){for(var o=e.userCode,a=n.map(function(t,n){var r={logicalShape:t.tensor.shape,texShape:t.isUniform?null:t.texData.texShape,isUniform:t.isUniform};return{name:e.variableNames[n],shapeInfo:r}}),i=a.map(function(t){return t.shapeInfo}),u={logicalShape:r.tensor.shape,texShape:r.texData.texShape,isUniform:!1},s=Ae(a,u,o,!0===e.supportsBroadcasting),l=t.createProgram(s),c={},h=0;hthis.NUM_BYTES_BEFORE_PAGING)for(var f=this.numBytesInGPU-this.NUM_BYTES_BEFORE_PAGING;f>0&&this.lruDataGPU.length>0;){var p=this.lruDataGPU.shift(),d=this.texData.get(p),v=d.shape,m=d.dtype;f-=this.computeBytes(v,m),this.read(p)}return h&&(u=this.endTimer(u),this.activeTimers.push(this.getQueryTime(u))),n},t.prototype.getAndSaveBinary=function(t,e){return t in this.binaryCache||(this.binaryCache[t]=e()),this.binaryCache[t]},t.prototype.getTextureManager=function(){return this.textureManager},t.prototype.dispose=function(){if(!this.disposed){for(var t in this.binaryCache)this.gpgpu.deleteProgram(this.binaryCache[t].webGLProgram);this.textureManager.dispose(),this.canvas.remove(),null!=this.fromPixelsCanvas&&this.fromPixelsCanvas.remove(),this.gpgpuCreatedLocally&&this.gpgpu.dispose(),this.disposed=!0}},t.prototype.throwIfNoData=function(t){if(!this.texData.has(t))throw new Error("WebGL backend: No data found for this tensor. Did you change your backend in the middle of the program? New backends can't use Tensors created with previous backends")},t.prototype.uploadToGPU=function(t){this.throwIfNoData(t);var e=this.texData.get(t),n=e.shape,r=e.values,o=e.texture,a=(e.dtype,e.usage);if(null==o){var i,u=null!=this.activeTimers;u&&(i=performance.now());var s=An(this.gpgpu.gl,n);e.texShape=s;var l,c=this.acquireTexture(t,s,a);e.texture=c,null!=r&&(this.gpgpu.uploadMatrixToTexture(c,s[0],s[1],(l=r)instanceof Float32Array?l:new Float32Array(l)),e.values=null,u&&(this.uploadWaitMs+=performance.now()-i))}else{this.lruDataGPU.indexOf(t)>=0&&(this.lruDataGPU.splice(this.lruDataGPU.indexOf(t),1),this.lruDataGPU.push(t))}},t.prototype.cacheOnCPU=function(t,e){var n=this.delayedStorage,r=this.texData.get(t),o=r.texture,a=r.texShape,i=r.dtype,u=r.usage;n&&null!=o&&(this.releaseTexture(t,o,a,u),r.texture=null,r.texShape=null),null!=e&&(r.values=function(t,e){if("float32"===e)return t;if("int32"===e||"bool"===e){for(var n="int32"===e?new Int32Array(t.length):new Uint8Array(t.length),r=0;r=0&&this.lruDataGPU.splice(u,1),this.numBytesInGPU-=this.computeBytes(a,i),this.textureManager.releaseTexture(e,n,r)},t.prototype.acquireTexture=function(t,e,n){var r=this.texData.get(t),o=r.shape,a=r.dtype;return this.lruDataGPU.push(t),this.numBytesInGPU+=this.computeBytes(o,a),this.textureManager.acquireTexture(e,n)},t.prototype.computeBytes=function(t,e){return d(t)*I(e)},t}();ht.get("IS_BROWSER")&&ht.registerBackend("webgl",function(){return new Io},2,j);var Ao=Bt({abs_:function(t){var e=Ft(t,"x","abs");return ht.engine.runKernel(function(t){return t.abs(e)},{$x:e},function(t){return{$x:function(){return t.mulStrict(e.toFloat().step(-1))}}})}}),Do=Bt({acos_:function(t){var e=Ft(t,"x","acos");return ht.engine.runKernel(function(t){return t.acos(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(zt(1).sub(e.toFloat().square()).sqrt()).neg()}}})}}),No=Bt({acosh_:function(t){var e=Ft(t,"x","acosh");return ht.engine.runKernel(function(t){return t.acosh(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(e.toFloat().square().sub(zt(1)).sqrt())}}})}}),Mo=Bt({asin_:function(t){var e=Ft(t,"x","asin");return ht.engine.runKernel(function(t){return t.asin(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(zt(1).sub(e.toFloat().square()).sqrt())}}})}}),_o=Bt({asinh_:function(t){var e=Ft(t,"x","asinh");return ht.engine.runKernel(function(t){return t.asinh(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(zt(1).add(e.toFloat().square()).sqrt())}}})}}),Oo=Bt({atan_:function(t){var e=Ft(t,"x","atan");return ht.engine.runKernel(function(t){return t.atan(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(zt(1).add(e.toFloat().square()))}}})}}),Fo=Bt({atanh_:function(t){var e=Ft(t,"x","atanh");return ht.engine.runKernel(function(t){return t.atanh(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(zt(1).sub(e.toFloat().square()))}}})}}),Lo=Bt({ceil_:function(t){var e=Ft(t,"x","ceil");return ht.engine.runKernel(function(t){return t.ceil(e)},{$x:e},function(t){return{$x:function(){return oe(t)}}})}}),Bo=Bt({clipByValue_:function(t,e,n){var r=Ft(t,"x","clipByValue");return l(e<=n,"Error in clip: min ("+e+") must be less than or equal to max ("+n+")."),ht.engine.runKernel(function(t){return t.clip(r,e,n)},{$x:r},function(t){return{$x:function(){return t.where(r.greaterEqual(zt(e)).logicalAnd(r.lessEqual(zt(n))),oe(t))}}})}}),Po=Bt({cos_:function(t){var e=Ft(t,"x","cos");return ht.engine.runKernel(function(t){return t.cos(e)},{$x:e},function(t){return{$x:function(){return e.toFloat().sin().neg().mulStrict(t)}}})}}),Uo=Bt({cosh_:function(t){var e=Ft(t,"x","cosh");return ht.engine.runKernel(function(t){return t.cosh(e)},{$x:e},function(t){return{$x:function(){return e.toFloat().sinh().mulStrict(t)}}})}}),zo=Bt({erf_:function(t){var e=Ft(t,"x","erf");return l("int32"===e.dtype||"float32"===e.dtype,"Input dtype must be `int32` or `float32`."),"int32"===e.dtype&&(e=e.toFloat()),ht.engine.runKernel(function(t){return t.erf(e)},{$x:e},function(t){return{$x:function(){return t.mulStrict(zt(2/Math.sqrt(Math.PI)).mul(e.square().neg().exp()))}}})}}),Vo=Bt({exp_:function(t){var e=Ft(t,"x","exp");return ht.engine.runKernel(function(t,n){return n(t.exp(e))},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.mulStrict(n)}}})}}),Wo=Bt({expm1_:function(t){var e=Ft(t,"x","expm1");return ht.engine.runKernel(function(t){return t.expm1(e)},{$x:e},function(t){return{$x:function(){return t.mulStrict(e.exp())}}})}}),Go=Bt({floor_:function(t){var e=Ft(t,"x","floor");return ht.engine.runKernel(function(t){return t.floor(e)},{$x:e},function(t){return{$x:function(){return oe(t)}}})}}),qo=Bt({log_:function(t){var e=Ft(t,"x","log");return ht.engine.runKernel(function(t){return t.log(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(e.toFloat())}}})}}),Ho=Bt({log1p_:function(t){var e=Ft(t,"x","log1p");return ht.engine.runKernel(function(t){return t.log1p(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(e.add(zt(1)))}}})}}),$o=Bt({logSigmoid_:function(t){var e=Ft(t,"x","logSigmoid");return ht.engine.runKernel(function(t){return t.softplus(e.neg()).neg()},{$x:e},function(t){return{$x:function(){return t.mulStrict(e.neg().sigmoid())}}})}}),jo=Bt({neg_:function(t){var e=Ft(t,"x","neg");return ht.engine.runKernel(function(t){return t.neg(e)},{$x:e},function(t){return{$x:function(){return t.neg()}}})}}),Xo=Bt({reciprocal_:function(t){var e=Ft(t,"x","reciprocal");return ht.engine.runKernel(function(t){return t.reciprocal(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(e.square().neg())}}})}}),Ko=Bt({round_:function(t){var e=Ft(t,"x","round");return ht.engine.runKernel(function(t){return t.round(e)},{$x:e},function(t){return{$x:function(){return oe(t)}}})}}),Yo=Bt({rsqrt_:function(t){var e=Ft(t,"x","rsqrt");return ht.engine.runKernel(function(t){return t.rsqrt(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(e.pow(zt(1.5)).mul(zt(2))).neg()}}})}}),Qo=Bt({sigmoid_:function(t){var e=Ft(t,"x","sigmoid");return ht.engine.runKernel(function(t,n){return n(t.sigmoid(e))},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.mulStrict(n.mul(zt(1).sub(n)))}}})}}),Jo=Bt({sign_:function(t){var e=Ft(t,"x","sign");return ht.engine.runKernel(function(t){return t.sign(e)},{$x:e},function(t){return{$x:function(){return oe(t)}}})}}),Zo=Bt({sin_:function(t){var e=Ft(t,"x","sin");return ht.engine.runKernel(function(t){return t.sin(e)},{$x:e},function(t){return{$x:function(){return e.toFloat().cos().mulStrict(t)}}})}}),ta=Bt({sinh_:function(t){var e=Ft(t,"x","sinh");return ht.engine.runKernel(function(t){return t.sinh(e)},{$x:e},function(t){return{$x:function(){return e.toFloat().cosh().mulStrict(t)}}})}}),ea=Bt({softplus_:function(t){var e=Ft(t,"x","softplus");return ht.engine.runKernel(function(t){return t.softplus(e)},{$x:e},function(t){return{$x:function(){return t.mulStrict(e.sigmoid())}}})}}),na=Bt({sqrt_:function(t){var e=Ft(t,"x","sqrt");return ht.engine.runKernel(function(t){return t.sqrt(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(e.toFloat().sqrt().mul(zt(2)))}}})}}),ra=Bt({square_:function(t){var e=Ft(t,"x","square");return ht.engine.runKernel(function(t){return t.square(e)},{$x:e},function(t){return{$x:function(){return t.mulStrict(e.toFloat().mul(zt(2)))}}})}}),oa=Bt({step_:function(t,e){void 0===e&&(e=0);var n=Ft(t,"x","step");return ht.engine.runKernel(function(t){return t.step(n,e)},{$x:n},function(t){return{$x:function(){return oe(t)}}})}}),aa=Bt({tan_:function(t){var e=Ft(t,"x","tan");return ht.engine.runKernel(function(t){return t.tan(e)},{$x:e},function(t){return{$x:function(){return t.divStrict(e.cos().square())}}})}}),ia=Bt({tanh_:function(t){var e=Ft(t,"x","tanh");return ht.engine.runKernel(function(t,n){return n(t.tanh(e))},{$x:e},function(t,e){var n=e[0];return{$x:function(){return zt(1).sub(n.square()).mulStrict(t)}}})}});function ua(t){return null==t?null:0===t.rank?t.as1D():1===t.rank?t:2===t.rank?t.as4D(1,1,t.shape[0],t.shape[1]):3===t.rank?t.as4D(1,t.shape[0],t.shape[1],t.shape[2]):t}var sa=Bt({batchNormalization2d_:function(t,e,n,r,o,a){void 0===r&&(r=.001);var i,u,s=Ft(t,"x","batchNormalization"),c=Ft(e,"mean","batchNormalization"),h=Ft(n,"variance","batchNormalization");return null!=o&&(i=Ft(o,"scale","batchNormalization")),null!=a&&(u=Ft(a,"offset","batchNormalization")),l(2===s.rank,"Error in batchNormalization3D: x must be rank 3 but got rank "+s.rank+"."),l(2===c.rank||1===c.rank,"Error in batchNormalization2D: mean must be rank 2 or rank 1 but got rank "+c.rank+"."),l(2===h.rank||1===h.rank,"Error in batchNormalization2D: variance must be rank 2 or rank 1 but got rank "+h.rank+"."),null!=i&&l(2===i.rank||1===i.rank,"Error in batchNormalization2D: scale must be rank 2 or rank 1 but got rank "+i.rank+"."),null!=u&&l(2===u.rank||1===u.rank,"Error in batchNormalization2D: offset must be rank 2 or rank 1 but got rank "+u.rank+"."),ha(s,c,h,r,i,u)}}),la=Bt({batchNormalization3d_:function(t,e,n,r,o,a){void 0===r&&(r=.001);var i,u,s=Ft(t,"x","batchNormalization"),c=Ft(e,"mean","batchNormalization"),h=Ft(n,"variance","batchNormalization");return null!=o&&(i=Ft(o,"scale","batchNormalization")),null!=a&&(u=Ft(a,"offset","batchNormalization")),l(3===s.rank,"Error in batchNormalization3D: x must be rank 3 but got rank "+s.rank+"."),l(3===c.rank||1===c.rank,"Error in batchNormalization3D: mean must be rank 3 or rank 1 but got rank "+c.rank+"."),l(3===h.rank||1===h.rank,"Error in batchNormalization3D: variance must be rank 3 or rank 1 but got rank "+h.rank+"."),null!=i&&l(3===i.rank||1===i.rank,"Error in batchNormalization3D: scale must be rank 3 or rank 1 but got rank "+i.rank+"."),null!=u&&l(3===u.rank||1===u.rank,"Error in batchNormalization3D: offset must be rank 3 or rank 1 but got rank "+u.rank+"."),ha(s,c,h,r,i,u)}}),ca=Bt({batchNormalization4d_:function(t,e,n,r,o,a){void 0===r&&(r=.001);var i,u,s=Ft(t,"x","batchNormalization"),c=Ft(e,"mean","batchNormalization"),h=Ft(n,"variance","batchNormalization");return null!=o&&(i=Ft(o,"scale","batchNormalization")),null!=a&&(u=Ft(a,"offset","batchNormalization")),l(4===s.rank,"Error in batchNormalization4D: x must be rank 4 but got rank "+s.rank+"."),l(4===c.rank||1===c.rank,"Error in batchNormalization4D: mean must be rank 4 or rank 1 but got rank "+c.rank+"."),l(4===h.rank||1===h.rank,"Error in batchNormalization4D: variance must be rank 4 or rank 1 but got rank "+h.rank+"."),null!=i&&l(4===i.rank||1===i.rank,"Error in batchNormalization4D: scale must be rank 4 or rank 1 but got rank "+i.rank+"."),null!=u&&l(4===u.rank||1===u.rank,"Error in batchNormalization4D: offset must be rank 4 or rank 1 but got rank "+u.rank+"."),ha(s,c,h,r,i,u)}}),ha=Bt({batchNormalization_:function(t,e,n,r,o,a){void 0===r&&(r=.001);var i,u,s,c=Ft(t,"x","batchNormalization"),h=Ft(e,"mean","batchNormalization"),f=Ft(n,"variance","batchNormalization");return null!=o&&(i=Ft(o,"scale","batchNormalization")),null!=a&&(u=Ft(a,"offset","batchNormalization")),l(h.rank===f.rank,"Batch normalization gradient requires mean and variance to have equal ranks."),l(null==u||h.rank===u.rank,"Batch normalization gradient requires mean and offset to have equal ranks."),l(null==i||h.rank===i.rank,"Batch normalization gradient requires mean and scale to have equal ranks."),s=0===c.rank||1===c.rank?c.as4D(1,1,1,c.size):2===c.rank?c.as4D(1,1,c.shape[0],c.shape[1]):3===c.rank?c.as4D(1,c.shape[0],c.shape[1],c.shape[2]):c,ht.engine.runKernel(function(t){return t.batchNormalization(s,ua(h),ua(f),r,ua(i),ua(u))},{$x:c,$mean:h,$variance:f,$scale:i,$offset:u},function(t){var e=null==i?zt(1):i,n=me(h.shape,s.shape),o=[];if(1===h.rank){for(var a=0;a=0?t:(l(-1===t,"Bad value in size"),a.shape[e]-r[e])}),function(t,e,n){l(t.rank===e.length,"Error in slice"+t.rank+"D: Length of begin "+e+" must match the rank of the array ("+t.rank+")."),l(t.rank===n.length,"Error in slice"+t.rank+"D: Length of size "+n+" must match the rank of the array ("+t.rank+").");for(var r=0;r0&&(e=e.sum(r)),e.reshape(n.shape)},$b:function(){var e=t,n=me(r.shape,o);return n.length>0&&(e=e.sum(n)),e.reshape(r.shape)}}})}}),pi=Bt({addN_:function(t){l(Array.isArray(t),function(){return"The param passed to tf.addN() must be a list of tensors"}),l(t.length>=1,function(){return"Must pass at least one tensor to tf.addN(), but got "+t.length});var e=t.map(function(t,e){return Ft(t,"tensors"+e,"addN")}),n=e[0];e.forEach(function(t){if(t.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),e.forEach(function(t){if(!v(t.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});var r=e;return ht.engine.runKernel(function(t){return t.addN(e)},r,function(t){var n={};return e.forEach(function(e,r){n[r]=function(){return t.clone()}}),n})}}),di=Bt({addStrict_:function(t,e){return c(t.shape,e.shape,"Error in addStrict: "),t.add(e)}}),vi=Bt({atan2_:function(t,e){var n=Ft(t,"a","atan2"),r=Ft(e,"b","atan2");Q(n,r);var o=ge(n.shape,r.shape);return ht.engine.runKernel(function(t){return t.atan2(n,r)},{$a:n,$b:r},function(t){return{$a:function(){var e=fi(n.square(),r.square()),a=t.mul(r.div(e)),i=me(n.shape,o);return i.length>0&&(a=a.sum(i)),a.reshape(n.shape)},$b:function(){var e=fi(n.square(),r.square()),a=jo(t.mul(n.div(e))),i=me(r.shape,o);return i.length>0&&(a=a.sum(i)),a.reshape(r.shape)}}})}}),mi=Bt({div_:function(t,e){var n,r=Ft(t,"a","div"),o=Ft(e,"b","div");if(Q(r,o),"int32"===r.dtype&&"int32"===o.dtype)return yi(r,o);n=function(t){return t.realDivide(r,o)};var a=ge(r.shape,o.shape);return ht.engine.runKernel(n,{$a:r,$b:o},function(t){return{$a:function(){var e=t.div(o.toFloat()),n=me(r.shape,a);return n.length>0?e.sum(n).reshape(r.shape):e},$b:function(){var e=t.mul(r.toFloat()),n=me(o.shape,a);n.length>0&&(e=e.sum(n).reshape(o.shape));var i=o.square();return e.div(i.toFloat()).neg()}}})}}),gi=Bt({divStrict_:function(t,e){return c(t.shape,e.shape,"Error in divideStrict: "),t.div(e)}}),yi=Bt({floorDiv_:function(t,e){var n=Ft(t,"a","floorDiv"),r=Ft(e,"b","floorDiv");Q(n,r);var o=ge(n.shape,r.shape);return ht.engine.runKernel(function(t){return t.floorDiv(n,r)},{$a:n,$b:r},function(t){return{$a:function(){var e=t.div(r.toFloat()),a=me(n.shape,o);return a.length>0?e.sum(a).reshape(n.shape):e},$b:function(){var e=t.mul(n.toFloat()),a=me(r.shape,o);a.length>0&&(e=e.sum(a).reshape(r.shape));var i=r.square();return e.div(i.toFloat()).neg()}}})}}),xi=Bt({maximum_:function(t,e){var n=Ft(t,"a","maximum"),r=Ft(e,"b","maximum");return Q(n,r),"bool"===n.dtype&&(n=n.toInt()),"bool"===r.dtype&&(r=r.toInt()),ge(n.shape,r.shape),ht.engine.runKernel(function(t){return t.maximum(n,r)},{$a:n,$b:r},function(t){return{$a:function(){return t.mul(n.greaterEqual(r).toFloat())},$b:function(){return t.mul(n.less(r).toFloat())}}})}}),bi=Bt({maximumStrict_:function(t,e){return c(t.shape,e.shape,"Error in minimumStrict: "),t.maximum(e)}}),wi=Bt({minimum_:function(t,e){var n=Ft(t,"a","minimum"),r=Ft(e,"b","minimum");return Q(n,r),"bool"===n.dtype&&(n=n.toInt()),"bool"===r.dtype&&(r=r.toInt()),ge(n.shape,r.shape),ht.engine.runKernel(function(t){return t.minimum(n,r)},{$a:n,$b:r},function(t){return{$a:function(){return t.mul(n.lessEqual(r).toFloat())},$b:function(){return t.mul(n.greater(r).toFloat())}}})}}),Ei=Bt({minimumStrict_:function(t,e){return c(t.shape,e.shape,"Error in minimumStrict: "),t.minimum(e)}}),Si=Bt({mod_:function(t,e){var n=Ft(t,"a","mod"),r=Ft(e,"b","mod");Q(n,r);var o=ge(n.shape,r.shape);return ht.engine.runKernel(function(t){return t.mod(n,r)},{$a:n,$b:r},function(t){return{$a:function(){var e=me(n.shape,o);return e.length>0?t.sum(e).reshape(n.shape):t},$b:function(){var e=t.mul(n.div(r).floor().neg()),a=me(r.shape,o);return a.length>0?e.sum(a).reshape(r.shape):e}}})}}),Ri=Bt({modStrict_:function(t,e){return c(t.shape,e.shape,"Error in modStrict: "),t.mod(e)}}),Ci=Bt({mul_:function(t,e){var n=Ft(t,"a","mul"),r=Ft(e,"b","mul");Q(n,r);var o=ge(n.shape,r.shape);return ht.engine.runKernel(function(t){return t.multiply(n,r)},{$a:n,$b:r},function(t){return{$a:function(){var e=t.mul(r.toFloat()),a=me(n.shape,o);return a.length>0?e.sum(a).reshape(n.shape):e},$b:function(){var e=t.mul(n.toFloat()),a=me(r.shape,o);return a.length>0?e.sum(a).reshape(r.shape):e}}})}}),ki=Bt({mulStrict_:function(t,e){return c(t.shape,e.shape,"Error in multiplyStrict: "),t.mul(e)}}),Ti=Bt({pow_:function(t,e){var n=Ft(t,"base","pow"),r=Ft(e,"exp","pow"),o=ge(n.shape,r.shape);return t=n.cast(ie(n.dtype,r.dtype)),e=r.cast(ie(n.dtype,r.dtype)),ht.engine.runKernel(function(t,e){return e(t.pow(n,r))},{$base:n,$exp:r},function(t,e){var a=e[0];return{$base:function(){var e=t.mul(r.toFloat().mul(a.div(n))),i=me(n.shape,o);return i.length>0&&(e=e.sum(i)),e.reshape(n.shape)},$exp:function(){var e=t.mul(a.mul(n.log()).toFloat()),i=me(r.shape,o);return i.length>0&&(e=e.sum(i)),e.reshape(r.shape)}}})}}),Ii=Bt({powStrict_:function(t,e){return c(t.shape,e.shape,"Error in powStrict: "),t.pow(e)}}),Ai=Bt({squaredDifference_:function(t,e){var n=Ft(t,"a","squaredDifference"),r=Ft(e,"b","squaredDifference");return Q(n,r),ge(n.shape,r.shape),ht.engine.runKernel(function(t){return t.squaredDifference(n,r)},{$a:n,$b:r},function(t){var e=zt(2);return{$a:function(){return t.mul(n.sub(r).mul(e))},$b:function(){return t.mul(r.sub(n).mul(e))}}})}}),Di=Bt({squaredDifferenceStrict_:function(t,e){return c(t.shape,e.shape,"Error in squaredDifferenceStrict: "),t.squaredDifference(e)}}),Ni=Bt({sub_:function(t,e){var n=Ft(t,"a","sub"),r=Ft(e,"b","sub");Q(n,r);var o=ge(n.shape,r.shape);return ht.engine.runKernel(function(t){return t.subtract(n,r)},{$a:n,$b:r},function(t){return{$a:function(){var e=t,r=me(n.shape,o);return r.length>0&&(e=e.sum(r)),e.reshape(n.shape)},$b:function(){var e=t,n=me(r.shape,o);return n.length>0&&(e=e.sum(n)),e.neg().reshape(r.shape)}}})}}),Mi=Bt({subStrict_:function(t,e){return c(t.shape,e.shape,"Error in subStrict: "),t.sub(e)}});var _i=Bt({logicalAnd_:function(t,e){var n=Ft(t,"a","logicalAnd","bool"),r=Ft(e,"b","logicalAnd","bool");return l("bool"===n.dtype&&"bool"===r.dtype,"Error Array must be of type bool."),ge(n.shape,r.shape),ht.engine.runKernel(function(t){return t.logicalAnd(n,r)},{$a:n,$b:r})}}),Oi=Bt({logicalNot_:function(t){var e=Ft(t,"x","logicalNot","bool");return l("bool"===e.dtype,"Error Array must be of type bool."),ht.engine.runKernel(function(t){return t.logicalNot(e)},{$x:e})}}),Fi=Bt({logicalOr_:function(t,e){var n=Ft(t,"a","logicalOr","bool"),r=Ft(e,"b","logicalOr","bool");return l("bool"===n.dtype&&"bool"===r.dtype,"Error Array must be of type bool."),ge(n.shape,r.shape),ht.engine.runKernel(function(t){return t.logicalOr(n,r)},{$a:n,$b:r})}}),Li=Bt({logicalXor_:function(t,e){var n=Ft(t,"a","logicalXor","bool"),r=Ft(e,"b","logicalXor","bool");return l("bool"===n.dtype&&"bool"===r.dtype,"Error Array must be of type bool."),ge(n.shape,r.shape),Fi(t,e).logicalAnd(_i(t,e).logicalNot())}}),Bi=Bt({where_:function(t,e,n){var r=Ft(e,"a","where"),o=Ft(n,"b","where"),a=Ft(t,"condition","where","bool");return l("bool"===a.dtype,"Error Condition must be of type bool."),c(r.shape,o.shape,"Error in where: "),1===a.rank?l(a.shape[0]===r.shape[0],"The first dimension of `a` must match the size of `condition`."):c(a.shape,o.shape,"Error in where: "),ht.engine.runKernel(function(t){return t.select(a,r,o)},{$condition:a,$a:r,$b:o},function(t){return{$condition:function(){return oe(a)},$a:function(){return t.mul(a.cast(r.dtype))},$b:function(){return t.mul(a.logicalNot().cast(o.dtype))}}})}}),Pi=function(t){return o(this,void 0,void 0,function(){var e,n,r;return a(this,function(o){switch(o.label){case 0:return l("bool"===(e=Ft(t,"condition","where","bool")).dtype,"Condition must be of type bool."),[4,e.data()];case 1:return n=o.sent(),r=ko(e.shape,n),t!==e&&e.dispose(),[2,r]}})})};var Ui=Bt({elu_:function(t){var e=Ft(t,"x","elu");return ht.engine.runKernel(function(t,n){return n(t.elu(e))},{$x:e},function(t,e){var n=e[0];return{$x:function(){return ht.engine.runKernel(function(e){return e.eluDer(t,n)},{dy:t,y:n})}}})}}),zi=Bt({leakyRelu_:function(t,e){void 0===e&&(e=.2);var n=Ft(t,"x","leakyRelu");return xi(zt(e).mul(n),n)}}),Vi=Bt({prelu_:function(t,e){var n=Ft(t,"x","prelu"),r=Ft(e,"alpha","prelu"),o=zt(0);return xi(o,n).add(r.mul(wi(o,n)))}}),Wi=Bt({relu_:function(t){var e=Ft(t,"x","relu");return"bool"===e.dtype?e.toInt():ht.engine.runKernel(function(t){return t.relu(e)},{$x:e},function(t){var n=e.step();return{$x:function(){return t.mulStrict(n.toFloat())}}})}}),Gi=Bt({selu_:function(t){var e=Ft(t,"x","selu");return ht.engine.runKernel(function(t){return t.selu(e)},{$x:e},function(t){return{$x:function(){var n=e.greater(zt(0)),r=zt(Rr),o=zt(Cr),a=t.mul(o),i=t.mul(r).mul(e.toFloat().exp());return Bi(n,a,i)}}})}});var qi=Bt({transpose_:function(t,e){var n=Ft(t,"x","transpose");return null==e&&(e=n.shape.map(function(t,e){return e}).reverse()),l(n.rank===e.length,"Error in transpose: rank of input "+n.rank+" must match length of perm "+e+"."),e.forEach(function(t){l(t>=0&&to)throw new Error("'k' passed to topk() must be <= the last dimension ("+o+") but got "+e);var a=ht.engine.runKernel(function(t){return t.topk(r,e,n)},{$x:r});return{values:a[0],indices:a[1]}}});(eu=t.Reduction||(t.Reduction={}))[eu.NONE=0]="NONE",eu[eu.MEAN=1]="MEAN",eu[eu.SUM=2]="SUM",eu[eu.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS";var ru=Bt({absoluteDifference_:function(e,n,r,o){void 0===o&&(o=t.Reduction.SUM_BY_NONZERO_WEIGHTS);var a=Ft(e,"labels","absoluteDifference"),i=Ft(n,"predictions","absoluteDifference"),u=null;null!=r&&(u=Ft(r,"weights","absoluteDifference")),c(a.shape,i.shape,"Error in absoluteDifference: ");var s=a.sub(i).abs();return ou(s,u,o)}}),ou=Bt({computeWeightedLoss_:function(e,n,r){void 0===r&&(r=t.Reduction.SUM_BY_NONZERO_WEIGHTS);var o=Ft(e,"losses","computeWeightedLoss"),a=null;null!=n&&(a=Ft(n,"weights","computeWeightedLoss"));var i=null==a?o:o.mul(a);if(r===t.Reduction.NONE)return i;if(r===t.Reduction.SUM)return i.sum();if(r===t.Reduction.MEAN){if(null==a)return i.mean();var u=d(o.shape)/d(a.shape),s=i.sum().div(a.sum());return u>1?s.div(zt(u)):s}if(r===t.Reduction.SUM_BY_NONZERO_WEIGHTS){if(null==a)return i.sum().div(zt(o.size));var l=a.mul(jt(o.shape)).notEqual(zt(0)).sum().toFloat();return i.sum().div(l)}throw Error("Unknown reduction: "+r)}}),au=Bt({cosineDistance_:function(e,n,r,o,a){void 0===a&&(a=t.Reduction.SUM_BY_NONZERO_WEIGHTS);var i=Ft(e,"labels","cosineDistance"),u=Ft(n,"predictions","cosineDistance"),s=null;null!=o&&(s=Ft(o,"weights","cosineDistance")),c(i.shape,u.shape,"Error in cosineDistance: ");var l=zt(1).sub(i.mul(u).sum(r,!0));return ou(l,s,a)}}),iu=Bt({hingeLoss_:function(e,n,r,o){void 0===o&&(o=t.Reduction.SUM_BY_NONZERO_WEIGHTS);var a=Ft(e,"labels","hingeLoss"),i=Ft(n,"predictions","hingeLoss"),u=null;null!=r&&(u=Ft(r,"weights","hingeLoss")),c(a.shape,i.shape,"Error in hingeLoss: ");var s=zt(1);a=zt(2).mul(a).sub(s);var l=s.sub(a.mul(i)).relu();return ou(l,u,o)}}),uu=Bt({huberLoss_:function(e,n,r,o,a){void 0===o&&(o=1),void 0===a&&(a=t.Reduction.SUM_BY_NONZERO_WEIGHTS);var i=Ft(e,"labels","huberLoss"),u=Ft(n,"predictions","huberLoss"),s=null;null!=r&&(s=Ft(r,"weights","huberLoss")),c(i.shape,u.shape,"Error in huberLoss: ");var l=zt(o),h=u.sub(i).abs(),f=wi(h,l),p=h.sub(f),d=zt(.5).mul(f.square()).add(l.mul(p));return ou(d,s,a)}}),su=Bt({logLoss_:function(e,n,r,o,a){void 0===o&&(o=1e-7),void 0===a&&(a=t.Reduction.SUM_BY_NONZERO_WEIGHTS);var i=Ft(e,"labels","logLoss"),u=Ft(n,"predictions","logLoss"),s=null;null!=r&&(s=Ft(r,"weights","logLoss")),c(i.shape,u.shape,"Error in logLoss: ");var l=zt(1),h=zt(o),f=i.mul(u.add(h).log()).neg().sub(l.sub(i).mul(l.sub(u).add(h).log()));return ou(f,s,a)}}),lu=Bt({meanSquaredError_:function(e,n,r,o){void 0===o&&(o=t.Reduction.SUM_BY_NONZERO_WEIGHTS);var a=Ft(e,"labels","meanSquaredError"),i=Ft(n,"predictions","meanSquaredError"),u=null;null!=r&&(u=Ft(r,"weights","meanSquaredError")),c(a.shape,i.shape,"Error in meanSquaredError: ");var s=a.squaredDifference(i);return ou(s,u,o)}}),cu=Bt({sigmoidCrossEntropy_:function(e,n,r,o,a){void 0===o&&(o=0),void 0===a&&(a=t.Reduction.SUM_BY_NONZERO_WEIGHTS);var i=Ft(e,"multiClassLabels","sigmoidCrossEntropy"),u=Ft(n,"logits","sigmoidCrossEntropy"),s=null;if(null!=r&&(s=Ft(r,"weights","sigmoidCrossEntropy")),c(i.shape,u.shape,"Error in sigmoidCrossEntropy: "),o>0){var l=zt(o),h=zt(1),f=zt(.5);i=i.mul(h.sub(l)).add(f.mul(l))}var p=function(t,e){var n=Ft(t,"labels","sigmoidCrossEntropyWithLogits"),r=Ft(e,"logits","sigmoidCrossEntropyWithLogits");c(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");var o=r.relu(),a=r.mul(n),i=r.abs().neg().exp().log1p();return o.sub(a).add(i)}(i,u);return ou(p,s,a)}}),hu=Bt({softmaxCrossEntropy_:function(e,n,r,o,a){void 0===o&&(o=0),void 0===a&&(a=t.Reduction.SUM_BY_NONZERO_WEIGHTS);var i=Ft(e,"onehotLabels","softmaxCrossEntropy"),u=Ft(n,"logits","softmaxCrossEntropy"),s=null;if(null!=r&&(s=Ft(r,"weights","softmaxCrossEntropy")),c(i.shape,u.shape,"Error in softmaxCrossEntropy: "),o>0){var l=zt(o),h=zt(1),f=zt(i.shape[1]);i=i.mul(h.sub(l)).add(l.div(f))}var p=function(t,e,n){if(void 0===n&&(n=-1),-1===n&&(n=e.rank-1),n!==e.rank-1)throw Error("Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank "+e.rank+" and dim was "+n);return _t(function(t,e){var r=e.logSumExp([n],!0),o=e.toFloat().sub(r);return{value:o.mul(t).neg().sum([n]),gradFunc:function(e){var r=wt(e.shape,[n]);return[e.reshape(r).mul(t.toFloat().sub(o.exp())),e.reshape(r).mul(o.exp().sub(t.toFloat()))]}}})(t,e)}(i,u);return ou(p,s,a)}}),fu=Object.freeze({get Reduction(){return t.Reduction},absoluteDifference:ru,computeWeightedLoss:ou,cosineDistance:au,hingeLoss:iu,huberLoss:uu,logLoss:su,meanSquaredError:lu,sigmoidCrossEntropy:cu,softmaxCrossEntropy:hu});function pu(t,e){return void 0===e&&(e=!1),ht.engine.tidy(function(){if(2!==t.shape.length)throw new Error("qr2d() requires a 2D Tensor, but got a "+t.shape.length+"D Tensor.");for(var n=t.shape[0],r=t.shape[1],o=oo(n),a=t.clone(),i=Wt([[1]],[1,1]),u=i.clone(),s=n>=r?r:n,l=function(t){var e,s=a,l=u,c=o;e=ht.engine.tidy(function(){var e=a.slice([t,t],[n-t,1]),s=e.norm(),l=a.slice([t,t],[1,1]),c=l.sign().neg(),h=l.sub(c.mul(s)),f=e.div(h);u=1===f.shape[0]?i.clone():i.concat(f.slice([1,0],[f.shape[0]-1,f.shape[1]]),0);var p=c.matMul(h).div(s).neg(),d=a.slice([t,0],[n-t,r]),v=p.mul(u);a=0===t?d.sub(v.matMul(u.transpose().matMul(d))):a.slice([0,0],[t,r]).concat(d.sub(v.matMul(u.transpose().matMul(d))),0);var m=o.slice([0,t],[n,o.shape[1]-t]);return o=0===t?m.sub(m.matMul(u).matMul(v.transpose())):o.slice([0,0],[n,t]).concat(m.sub(m.matMul(u).matMul(v.transpose())),1),[u,a,o]}),u=e[0],a=e[1],o=e[2],Wa([s,l,c])},c=0;cr&&(o=o.slice([0,0],[n,r]),a=a.slice([0,0],[r,r])),[o,a]})}var du=Bt({gramSchmidt_:function(t){var e;if(Array.isArray(t)){e=!1,l(null!=t&&t.length>0,"Gram-Schmidt process: input must not be null, undefined, or empty");for(var n=t[0].shape[0],r=1;r0)for(var n=0;n= 2, but got rank "+t.rank);if(2===t.rank)return pu(t,e);var n=t.shape.slice(0,t.shape.length-2).reduce(function(t,e){return t*e}),r=[],o=[];return So(t.reshape([n,t.shape[t.shape.length-2],t.shape[t.shape.length-1]]),0).forEach(function(t){var n=pu(t,e),a=n[0],i=n[1];r.push(a),o.push(i)}),[bo(r,0).reshape(t.shape),bo(o,0).reshape(t.shape)]}}),mu=Object.freeze({gramSchmidt:du,qr:vu});function gu(t,e,n,r,o){null==r&&(r=.5),null==o&&(o=Number.NEGATIVE_INFINITY);var a=t.shape[0];return n=Math.min(n,a),l(0<=r&&r<=1,"iouThreshold must be in [0, 1], but was '"+r+"'"),l(2===t.rank,"boxes must be a 2D tensor, but was of rank '"+t.rank+"'"),l(4===t.shape[1],"boxes must have 4 columns, but 2nd dimension was "+t.shape[1]),l(1===e.rank,"scores must be a 1D tensor"),l(e.shape[0]===a,"scores has incompatible shape with boxes. Expected "+a+", but was "+e.shape[0]),{maxOutputSize:n,iouThreshold:r,scoreThreshold:o}}var yu=Bt({resizeBilinear_:function(t,e,n){void 0===n&&(n=!1);var r=Ft(t,"images","resizeBilinear");l(3===r.rank||4===r.rank,"Error in resizeBilinear: x must be rank 3 or 4, but got rank "+r.rank+"."),l(2===e.length,"Error in resizeBilinear: new shape must 2D, but got shape "+e+".");var o=r,a=!1;3===r.rank&&(a=!0,o=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var i=e[0],u=e[1],s=ht.engine.runKernel(function(t,e){return t.resizeBilinear(o,i,u,n)},{batchImages:o},function(t,e){return{batchImages:function(){return ht.engine.runKernel(function(e){return e.resizeBilinearBackprop(t,o,n)},{})}}});return a?s.as3D(s.shape[1],s.shape[2],s.shape[3]):s}}),xu=Bt({resizeNearestNeighbor_:function(t,e,n){void 0===n&&(n=!1);var r=Ft(t,"images","resizeNearestNeighbor");l(3===r.rank||4===r.rank,"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank "+r.rank+"."),l(2===e.length,"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+e+"."),l("float32"===r.dtype||"int32"===r.dtype,"`images` must have `int32` or `float32` as dtype");var o=r,a=!1;3===r.rank&&(a=!0,o=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var i=e[0],u=e[1],s=ht.engine.runKernel(function(t,e){return t.resizeNearestNeighbor(o,i,u,n)},{batchImages:o},function(t,e){return{batchImages:function(){return ht.engine.runKernel(function(e){return e.resizeNearestNeighborBackprop(t,o,n)},{})}}});return a?s.as3D(s.shape[1],s.shape[2],s.shape[3]):s}}),bu=Bt({nonMaxSuppression_:function(t,e,n,r,o){void 0===r&&(r=.5),void 0===o&&(o=Number.NEGATIVE_INFINITY);var a=Ft(t,"boxes","nonMaxSuppression"),i=Ft(e,"scores","nonMaxSuppression"),u=gu(a,i,n,r,o);return n=u.maxOutputSize,r=u.iouThreshold,o=u.scoreThreshold,ht.engine.runKernel(function(t){return t.nonMaxSuppression(a,i,n,r,o)},{$boxes:a})}}),wu=function(t,e,n,r,i){return void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY),o(this,void 0,void 0,function(){var o,u,s,l,c,h;return a(this,function(a){switch(a.label){case 0:return o=Ft(t,"boxes","nonMaxSuppressionAsync"),u=Ft(e,"scores","nonMaxSuppressionAsync"),s=gu(o,u,n,r,i),n=s.maxOutputSize,r=s.iouThreshold,i=s.scoreThreshold,[4,o.data()];case 1:return l=a.sent(),[4,u.data()];case 2:return c=a.sent(),h=ce(l,c,n,r,i),o!==t&&o.dispose(),u!==e&&u.dispose(),[2,h]}})})},Eu=Object.freeze({resizeBilinear:yu,resizeNearestNeighbor:xu,nonMaxSuppression:bu,nonMaxSuppressionAsync:wu}),Su=Object.freeze({image:Eu,linalg:mu,losses:fu,op:Bt,batchNormalization2d:sa,batchNormalization3d:la,batchNormalization4d:ca,batchNormalization:ha,concat:Lr,concat1d:Br,concat2d:Pr,concat3d:Ur,concat4d:zr,conv1d:ba,conv2d:wa,depthwiseConv2d:Ea,separableConv2d:Sa,conv2dTranspose:Ra,matMul:Ca,dot:ka,outerProduct:Ta,reverse:Ia,reverse1d:Aa,reverse2d:Da,reverse3d:Na,reverse4d:Ma,maxPool:_a,avgPool:Oa,slice:Fa,slice1d:La,slice2d:Ba,slice3d:Pa,slice4d:Ua,abs:Ao,acos:Do,acosh:No,asin:Mo,asinh:_o,atan:Oo,atanh:Fo,ceil:Lo,clipByValue:Bo,cos:Po,cosh:Uo,erf:zo,exp:Vo,expm1:Wo,floor:Go,log:qo,log1p:Ho,logSigmoid:$o,neg:jo,reciprocal:Xo,round:Ko,rsqrt:Yo,sigmoid:Qo,sign:Jo,sin:Zo,sinh:ta,softplus:ea,sqrt:na,square:ra,step:oa,tan:aa,tanh:ia,all:qa,any:Ha,argMax:$a,argMin:ja,logSumExp:Xa,max:Ka,mean:Ya,min:Qa,moments:Ja,sum:Za,equal:ti,equalStrict:ei,greater:ni,greaterEqual:ri,greaterEqualStrict:oi,greaterStrict:ai,less:ii,lessEqual:ui,lessEqualStrict:si,lessStrict:li,notEqual:ci,notEqualStrict:hi,add:fi,addN:pi,addStrict:di,atan2:vi,div:mi,divStrict:gi,floorDiv:yi,maximum:xi,maximumStrict:bi,minimum:wi,minimumStrict:Ei,mod:Si,modStrict:Ri,mul:Ci,mulStrict:ki,pow:Ti,powStrict:Ii,squaredDifference:Ai,squaredDifferenceStrict:Di,sub:Ni,subStrict:Mi,elu:Ui,leakyRelu:zi,prelu:Vi,relu:Wi,selu:Gi,logicalAnd:_i,logicalNot:Oi,logicalOr:Fi,logicalXor:Li,where:Bi,whereAsync:Pi,buffer:Jr,toPixels:Qr,print:Zr,cast:to,clone:eo,cumsum:no,expandDims:ro,eye:oo,fromPixels:ao,multinomial:io,oneHot:uo,pad:so,pad1d:lo,pad2d:co,pad3d:ho,pad4d:fo,rand:po,randomNormal:vo,randomUniform:mo,reshape:go,split:yo,squeeze:xo,stack:bo,tile:wo,truncatedNormal:Eo,unstack:So,batchToSpaceND:Ro,spaceToBatchND:Co,fill:Kt,linspace:Yt,ones:jt,range:Qt,scalar:zt,tensor:Ut,tensor1d:Vt,tensor2d:Wt,tensor3d:Gt,tensor4d:qt,tensor5d:Ht,tensor6d:$t,zeros:Xt,onesLike:re,zerosLike:oe,transpose:qi,softmax:Pt,localResponseNormalization:Hi,norm:$i,gather:Ki,unsortedSegmentSum:Yi,basicLSTMCell:Qi,multiRNNCell:Ji,movingAverage:Zi,stridedSlice:tu,topk:nu}),Ru=function(){function t(){this.data=new WeakMap,this.firstUse=!0,ht.get("IS_BROWSER")&&(this.canvas=document.createElement("canvas"))}return t.prototype.register=function(t,e,n){if(this.firstUse&&(this.firstUse=!1,ht.get("IS_NODE")&&pt("\n============================\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================\n")),this.data.has(t))throw new Error("Data buffer is already registered");this.data.set(t,null)},t.prototype.write=function(t,e){if(null==e)throw new Error("MathBackendCPU.write(): values can not be null");this.throwIfNoData(t),this.data.set(t,e)},t.prototype.fromPixels=function(t,e){if(null==t)throw new Error("pixels passed to tf.fromPixels() can not be null");var n,r;if(ht.get("IS_NODE")&&null==t.getContext)throw new Error("When running in node, pixels must be an HTMLCanvasElement like the one returned by the `canvas` npm package");if(null!=t.getContext)n=t.getContext("2d").getImageData(0,0,t.width,t.height).data;else if(t instanceof ImageData)n=t.data;else{if(!(t instanceof HTMLImageElement||t instanceof HTMLVideoElement))throw new Error("pixels passed to tf.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ImageData, but was "+t.constructor.name);if(null==this.canvas)throw new Error("Can't read pixels from HTMLImageElement outside the browser.");this.canvas.width=t.width,this.canvas.height=t.height,this.canvas.getContext("2d").drawImage(t,0,0,t.width,t.height),n=this.canvas.getContext("2d").getImageData(0,0,t.width,t.height).data}if(4===e)r=new Int32Array(n);else{var o=t.width*t.height;r=new Int32Array(o*e);for(var a=0;af&&(f=m,p=v)}s[c]=p}return i},t.prototype.cumsum=function(t,e,n,r){if(e!==t.rank-1)throw new Error("backend.cumsum in CPU expects an inner-most axis="+(t.rank-1)+" but got axis="+e);for(var o=ie(t.dtype,"int32"),a=Xt(t.shape,o),i=a.dataSync(),u=t.dataSync(),s=t.shape[t.rank-1],l=r?function(t,e){return t+s-e-1}:function(t,e){return t+e},c=0;ce?1:0})},t.prototype.greaterEqual=function(t,e){return this.broadcastedBinaryOp(t,e,"bool",function(t,e){return t>=e?1:0})},t.prototype.logicalNot=function(t){for(var e=t.dataSync(),n=new Int32Array(e.length),r=0;r1||1===e.rank?1:e.shape[1],c=0;c=0&&e>=0?n:(n+e)%e})},t.prototype.max=function(t,e){St("max",e,t.rank);for(var n=bt(t.shape,e),r=n[0],o=n[1],a=Xt(r,t.dtype),i=d(o),u=a.dataSync(),s=t.dataSync(),l=0;lh&&(h=p)}u[l]=h}return a},t.prototype.maximum=function(t,e){return this.broadcastedBinaryOp(t,e,t.dtype,function(t,e){return Math.max(t,e)})},t.prototype.all=function(t,e){St("all",e,t.rank);for(var n=bt(t.shape,e),r=n[0],o=n[1],a=Xt(r,t.dtype),i=d(o),u=a.dataSync(),s=t.dataSync(),l=0;l0?n[r]=1:n[r]=0;return X.make(t.shape,{values:n})},t.prototype.round=function(t){for(var e=t.dataSync(),n=new Float32Array(e.length),r=0;r.5?n[r]=Math.ceil(e[r]):n[r]=o%2==0?o:o+1}return X.make(t.shape,{values:n})},t.prototype.exp=function(t){for(var e=t.dataSync(),n=new Float32Array(e.length),r=0;r=0?o:Math.exp(o)-1}return X.make(t.shape,{values:e})},t.prototype.eluDer=function(t,e){for(var n=new Float32Array(e.size),r=e.dataSync(),o=t.dataSync(),a=0;a=1?o[a]:o[a]*(i+1)}return X.make(e.shape,{values:n})},t.prototype.selu=function(t){for(var e=Rr,n=Cr,r=new Float32Array(t.size),o=t.dataSync(),a=0;a=0?n*i:e*(Math.exp(i)-1)}return X.make(t.shape,{values:r})},t.prototype.clip=function(t,e,n){for(var r=new Float32Array(t.size),o=t.dataSync(),a=0;a-e,i=r[o]0?1:e}return X.make(t.shape,{values:n})},t.prototype.conv2d=function(t,e,n){for(var r=n.filterHeight,o=n.filterWidth,a=n.dilationHeight,i=n.dilationWidth,u=n.padInfo.left,s=n.padInfo.top,l=Jr(n.outShape,t.dtype),c=0;c=n.inHeight))for(var x=0;x=n.inWidth))for(var w=0;w=n.inHeight))for(var w=0;w=n.inWidth))y+=t.get(h,b,E,f)*e.get(x,w,f,g)}}c.set(y,h,p,v,f*l+g)}return c.toTensor()},t.prototype.depthwiseConv2DDerInput=function(t,e,n){for(var r=Jr(n.inShape,"float32"),o=r.values,a=r.strides,i=a[0],u=a[1],s=a[2],l=t.dataSync(),c=t.strides,h=c[0],f=c[1],p=c[2],d=e.dataSync(),v=e.strides,m=v[0],g=v[1],y=v[2],x=n.batchSize,b=n.filterHeight,w=n.filterWidth,E=n.inChannels,S=n.inHeight,R=n.inWidth,C=n.outChannels,k=n.outHeight,T=n.outWidth,I=n.strideHeight,A=n.strideWidth,D=b-1-n.padInfo.top,N=w-1-n.padInfo.left,M=C/E,_=0;_b?b=C:"avg"===n&&(w+=C,E++)}if(isNaN(b))break}u.set("avg"===n?w/E:b,c,f,m,h)}return u.toTensor()},t.prototype.maxPool=function(t,e){return this.pool(t,e,"max")},t.prototype.maxPoolPositions=function(t,e){for(var n=Jr(e.outShape,"int32"),r=e.strideHeight,o=e.strideWidth,a=e.filterHeight,i=e.filterWidth,u=e.padInfo.top,s=e.padInfo.left,l=0;lx&&(x=C,b=E*i+R)}n.set(b,l,h,v,c)}return n.toTensor()},t.prototype.maxPoolBackprop=function(t,e,n,r){for(var o=this.maxPoolPositions(e,r),a=r.strideHeight,i=r.strideWidth,u=r.filterHeight,s=r.filterWidth,l=s-1-r.padInfo.left,c=u-1-r.padInfo.top,h=Jr(e.shape,"float32"),f=0;f=r.outHeight||Math.floor(b)!==b))for(var w=0;w=r.outWidth||Math.floor(E)!==E)){var S=u*s-1-o.get(f,b,E,p)===x*s+w?1:0;if(0!==S)y+=t.get(f,b,E,p)*S}}}h.set(y,f,d,v,p)}return h.toTensor()},t.prototype.avgPoolBackprop=function(t,e,n){for(var r=n.strideHeight,o=n.strideWidth,a=n.filterHeight,i=n.filterWidth,u=i-1-n.padInfo.left,s=a-1-n.padInfo.top,l=Jr(e.shape,"float32"),c=1/(a*i),h=0;h=n.outHeight||Math.floor(x)!==x))for(var b=0;b=n.outWidth||Math.floor(w)!==w))g+=t.get(h,x,w,f)}}l.set(g*c,h,p,d,f)}return l.toTensor()},t.prototype.cast=function(t,e){return se(t,e,this)},t.prototype.reshape=function(t,e){return le(t,e)},t.prototype.avgPool=function(t,e){return this.pool(t,e,"avg").toFloat()},t.prototype.resizeBilinear=function(t,e,n,r){for(var o=t.shape,a=o[0],i=o[1],u=o[2],s=o[3],l=Jr([a,e,n,s],t.dtype),c=[r&&e>1?i-1:i,r&&n>1?u-1:u],h=[r&&e>1?e-1:e,r&&n>1?n-1:n],f=0;f1?a-1:a,n&&c>1?i-1:i],p=[n&&l>1?l-1:l,n&&c>1?c-1:c],d=f[0]/p[0],v=f[1]/p[1],m=0;m1?i-1:i,r&&n>1?u-1:u],h=[r&&e>1?e-1:e,r&&n>1?n-1:n],f=0;f1?a-1:a,n&&c>1?i-1:i],p=[n&&l>1?l-1:l,n&&c>1?c-1:c],d=1/(f[0]/p[0]),v=1/(f[1]/p[1]),m=2*Math.ceil(d)+2,g=2*Math.ceil(v)+2,y=0;y=l))for(var A=0;A=c)){var N=f[0]*(I/p[0]),M=f[1]*(D/p[1]),_=Math.min(a-1,n?Math.round(N):Math.floor(N)),O=Math.min(i-1,n?Math.round(M):Math.floor(M));x===_&&b===O&&(k+=t.get(y,I,D,C))}}}h.set(k,y,x,b,C)}return h.toTensor()},t.prototype.batchNormalization=function(t,e,n,r,o,a){for(var i=t.dataSync(),u=e.dataSync(),s=n.dataSync(),l=o?o.dataSync():new Float32Array([1]),c=a?a.dataSync():new Float32Array([0]),h=new Float32Array(i.length),f=0;f=0&&t.get(a)0,"scheme must not be an empty string.");var r=t.getInstance();l(null==r.managers[e],"A model store manager is already registered for scheme '"+e+"'."),r.managers[e]=n},t.getManager=function(t){var e=this.getInstance().managers[t];if(null==e)throw new Error("Cannot find model manager for scheme '"+t+"'");return e},t.getSchemes=function(){return Object.keys(this.getInstance().managers)},t}();function Fu(t){if(-1===t.indexOf(_u))throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+Ou.getSchemes().join(","));return{scheme:t.split(_u)[0],path:t.split(_u)[1]}}function Lu(t,e,n){return void 0===n&&(n=!1),o(this,void 0,void 0,function(){var r,o,i,u,s,c,h,f,p;return a(this,function(a){switch(a.label){case 0:return l(t!==e,"Old path and new path are the same: '"+t+"'"),l((r=Mu.getLoadHandlers(t)).length>0,"Copying failed because no load handler is found for source URL "+t+"."),l(r.length<2,"Copying failed because more than one ("+r.length+") load handlers for source URL "+t+"."),o=r[0],l((i=Mu.getSaveHandlers(e)).length>0,"Copying failed because no save handler is found for destination URL "+e+"."),l(i.length<2,"Copying failed because more than one ("+r.length+") save handlers for destination URL "+e+"."),u=i[0],s=Fu(t).scheme,c=Fu(t).path,h=s===Fu(t).scheme,[4,o.load()];case 1:return f=a.sent(),n&&h?[4,Ou.getManager(s).removeModel(c)]:[3,3];case 2:a.sent(),a.label=3;case 3:return[4,u.save(f)];case 4:return p=a.sent(),!n||h?[3,6]:[4,Ou.getManager(s).removeModel(c)];case 5:a.sent(),a.label=6;case 6:return[2,p.modelArtifactsInfo]}})})}var Bu="models_store",Pu="model_info_store";function Uu(){if(!ht.get("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");var t=window,e=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB||t.shimIndexedDB;if(null==e)throw new Error("The current browser does not appear to support IndexedDB.");return e}function zu(t){var e=t.result;e.createObjectStore(Bu,{keyPath:"modelPath"}),e.createObjectStore(Pu,{keyPath:"modelPath"})}var Vu=function(){function t(t){if(this.indexedDB=Uu(),null==t||!t)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=t}return t.prototype.save=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return[2,this.databaseAction(this.modelPath,t)]})})},t.prototype.load=function(){return o(this,void 0,void 0,function(){return a(this,function(t){return[2,this.databaseAction(this.modelPath)]})})},t.prototype.databaseAction=function(t,e){var n=this;return new Promise(function(t,r){var o=n.indexedDB.open("tensorflowjs",1);o.onupgradeneeded=function(){return zu(o)},o.onsuccess=function(){var a=o.result;if(null==e){var i=a.transaction(Bu,"readonly"),u=i.objectStore(Bu).get(n.modelPath);u.onsuccess=function(){if(null==u.result)return a.close(),r(new Error("Cannot find model with path '"+n.modelPath+"' in IndexedDB."));t(u.result.modelArtifacts)},u.onerror=function(t){return a.close(),r(u.error)},i.oncomplete=function(){return a.close()}}else{var s,l=Nu(e),c=a.transaction(Pu,"readwrite"),h=c.objectStore(Pu),f=h.put({modelPath:n.modelPath,modelArtifactsInfo:l});f.onsuccess=function(){var o=(s=a.transaction(Bu,"readwrite")).objectStore(Bu).put({modelPath:n.modelPath,modelArtifacts:e,modelArtifactsInfo:l});o.onsuccess=function(){return t({modelArtifactsInfo:l})},o.onerror=function(t){var e=(h=c.objectStore(Pu)).delete(n.modelPath);e.onsuccess=function(){return a.close(),r(o.error)},e.onerror=function(t){return a.close(),r(o.error)}}},f.onerror=function(t){return a.close(),r(f.error)},c.oncomplete=function(){null==s?a.close():s.oncomplete=function(){return a.close()}}}},o.onerror=function(t){return r(o.error)}})},t.URL_SCHEME="indexeddb://",t}(),Wu=function(t){return ht.get("IS_BROWSER")&&t.startsWith(Vu.URL_SCHEME)?(e=t.slice(Vu.URL_SCHEME.length),new Vu(e)):null;var e};Mu.registerSaveRouter(Wu),Mu.registerLoadRouter(Wu);var Gu=function(){function t(){this.indexedDB=Uu()}return t.prototype.listModels=function(){return o(this,void 0,void 0,function(){var t=this;return a(this,function(e){return[2,new Promise(function(e,n){var r=t.indexedDB.open("tensorflowjs",1);r.onupgradeneeded=function(){return zu(r)},r.onsuccess=function(){var t=r.result,o=t.transaction(Pu,"readonly"),a=o.objectStore(Pu).getAll();a.onsuccess=function(){for(var t={},n=0,r=a.result;n0,"URL path for browserHTTPRequest must not be null, undefined or empty."),this.path=t,null!=e&&null!=e.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=e||{}}return t.prototype.save=function(t){return o(this,void 0,void 0,function(){var e,n,r,o;return a(this,function(a){switch(a.label){case 0:if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");return(e=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,n=[{paths:["./model.weights.bin"],weights:t.weightSpecs}],r={modelTopology:t.modelTopology,weightsManifest:n},e.body.append("model.json",new Blob([JSON.stringify(r)],{type:"application/json"}),"model.json"),null!=t.weightData&&e.body.append("model.weights.bin",new Blob([t.weightData],{type:"application/octet-stream"}),"model.weights.bin"),[4,fetch(this.path,e)];case 1:if(200===(o=a.sent()).status)return[2,{modelArtifactsInfo:Nu(t),responses:[o]}];throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+o.status+".")}})})},t.prototype.load=function(){return o(this,void 0,void 0,function(){var t,e,n,r,o,i,u,s,l,c,h,f;return a(this,function(a){switch(a.label){case 0:return[4,fetch(this.path,this.requestInit)];case 1:return[4,a.sent().json()];case 2:if(t=a.sent(),e=t.modelTopology,n=t.weightsManifest,null==e&&null==n)throw new Error("The JSON from HTTP path "+this.path+" contains neither model topology or manifest for weights.");if(null==n)return[3,4];for(i=t.weightsManifest,r=[],u=0,s=i;u0&&(t=r({weightSpecs:this.weightSpecs},t)),null!=this.weightData&&this.weightData.byteLength>0&&(t=r({weightData:this.weightData},t)),[2,t]})})},t}(),hs=function(){function t(t){this.saveHandler=t}return t.prototype.save=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){return[2,this.saveHandler(t)]})})},t}();var fs=Mu.registerSaveRouter,ps=Mu.registerLoadRouter,ds=Mu.getSaveHandlers,vs=Mu.getLoadHandlers,ms=Object.freeze({browserFiles:function(t){return new as(t)},browserHTTPRequest:ls,concatenateArrayBuffers:Au,decodeWeights:function(t,e){for(var n={},r=0,o=0,a=e;on)}var Es=Object.freeze({WEBGL_ENVS:{HAS_WEBGL:!0},NODE_ENVS:{IS_NODE:!0},CHROME_ENVS:{IS_CHROME:!0},BROWSER_ENVS:{IS_BROWSER:!0},CPU_ENVS:{HAS_WEBGL:!1},ALL_ENVS:{},expectArraysClose:bs,expectPromiseToFail:function(t,e){t().then(function(){return e.fail()},function(){return e()})},expectArraysEqual:function(t,e){return bs(t,e,0)},expectNumbersClose:function(t,e,n){if(null==n&&(n=ht.get("TEST_EPSILON")),!ws(t,e,n))throw new Error("Numbers differ: actual === "+t+", expected === "+e)},expectValuesInRange:function(t,e,n){var r;r=t instanceof X?t.dataSync():t;for(var o=0;on)throw new Error("Value out of range:"+r[o]+" low: "+e+", high: "+n)},expectArrayBuffersEqual:function(t,e){expect(new Float32Array(t)).toEqual(new Float32Array(e))}}),Ss=Object.freeze({gpgpu_util:Jn,webgl_util:Dn,MathBackendWebGL:Io,GPGPUContext:Zn}),Rs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.minimize=function(t,e,n){void 0===e&&(e=!1);var r=this.computeGradients(t,n),o=r.value,a=r.grads;return this.applyGradients(a),Object.keys(a).forEach(function(t){return a[t].dispose()}),e?o:(o.dispose(),null)},e.prototype.computeGradients=function(t,e){return Mt(t,e)},e}(gs),Cs=1e-8,ks=1e-4;function Ts(){return ht.get("WEBGL_RENDER_FLOAT32_ENABLED")?Cs:ks}var Is=function(t){function e(e,n,r){void 0===r&&(r=null);var o=t.call(this)||this;return o.learningRate=e,o.rho=n,o.epsilon=r,o.accumulatedGrads={},o.accumulatedUpdates={},o.c=Va(zt(-e)),o.rhoScalar=Va(zt(n)),o.oneMinusRho=Va(zt(1-n)),null===r&&(r=Ts()),o.epsilonScalar=Va(zt(r)),o}return n(e,t),e.prototype.applyGradients=function(t){var e=this,n=function(n){var o=ht.engine.registeredVariables[n];if(null==r.accumulatedGrads[n]){za(function(){e.accumulatedGrads[n]=oe(o).variable(!1)})}if(null==r.accumulatedUpdates[n]){za(function(){e.accumulatedUpdates[n]=oe(o).variable(!1)})}var a=t[n],i=r.accumulatedGrads[n],u=r.accumulatedUpdates[n];za(function(){var t=e.rhoScalar.mul(i).add(e.oneMinusRho.mul(a.square())),r=u.add(e.epsilonScalar).sqrt().div(i.add(e.epsilonScalar).sqrt()).mul(a),s=e.rhoScalar.mul(u).add(e.oneMinusRho.mul(r.square()));e.accumulatedGrads[n].assign(t),e.accumulatedUpdates[n].assign(s);var l=e.c.mul(r).add(o);o.assign(l)})},r=this;for(var o in t)n(o)},e.prototype.dispose=function(){var t=this;this.c.dispose(),this.epsilonScalar.dispose(),this.rhoScalar.dispose(),this.oneMinusRho.dispose(),null!=this.accumulatedUpdates&&(Object.keys(this.accumulatedUpdates).forEach(function(e){return t.accumulatedUpdates[e].dispose()}),Object.keys(this.accumulatedGrads).forEach(function(e){return t.accumulatedGrads[e].dispose()}))},e.prototype.getConfig=function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}},e.fromConfig=function(t,e){return new t(e.learningRate,e.rho,e.epsilon)},e.className="AdadeltaOptimizer",e}(Rs);ys.register(Is);var As=function(t){function e(e,n){void 0===n&&(n=.1);var r=t.call(this)||this;r.learningRate=e,r.initialAccumulatorValue=n,r.accumulatedGrads={},r.c=Va(zt(-e));var o=Ts();return r.epsilon=Va(zt(o)),r}return n(e,t),e.prototype.applyGradients=function(t){var e=this,n=function(n){var o=ht.engine.registeredVariables[n];if(null==r.accumulatedGrads[n]){za(function(){e.accumulatedGrads[n]=Kt(o.shape,e.initialAccumulatorValue).variable(!1)})}var a=t[n],i=r.accumulatedGrads[n];za(function(){var t=i.add(a.square());e.accumulatedGrads[n].assign(t);var r=e.c.mul(a.div(t.add(e.epsilon).sqrt())).add(o);o.assign(r)})},r=this;for(var o in t)n(o)},e.prototype.dispose=function(){var t=this;this.epsilon.dispose(),this.c.dispose(),null!=this.accumulatedGrads&&Object.keys(this.accumulatedGrads).forEach(function(e){return t.accumulatedGrads[e].dispose()})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}},e.fromConfig=function(t,e){return new t(e.learningRate,e.initialAccumulatorValue)},e.className="AdagradOptimizer",e}(Rs);ys.register(As);var Ds=function(t){function e(e,n,r,o){void 0===o&&(o=null);var a=t.call(this)||this;return a.learningRate=e,a.beta1=n,a.beta2=r,a.epsilon=o,a.accumulatedFirstMoment={},a.accumulatedSecondMoment={},a.c=Va(zt(-e)),a.beta1Scalar=Va(zt(n)),a.beta2Scalar=Va(zt(r)),za(function(){a.accBeta1=zt(n).variable(),a.accBeta2=zt(r).variable()}),a.oneMinusBeta1=Va(zt(1-n)),a.oneMinusBeta2=Va(zt(1-r)),a.one=Va(zt(1)),null===o&&(o=Ts()),a.epsScalar=Va(zt(o)),a}return n(e,t),e.prototype.applyGradients=function(t){var e=this;za(function(){var n=e.one.sub(e.accBeta1),r=e.one.sub(e.accBeta2);for(var o in t){var a=ht.engine.registeredVariables[o];if(null==e.accumulatedFirstMoment[o]){var i=!1;e.accumulatedFirstMoment[o]=oe(a).variable(i)}if(null==e.accumulatedSecondMoment[o]){i=!1;e.accumulatedSecondMoment[o]=oe(a).variable(i)}var u=t[o],s=e.accumulatedFirstMoment[o],l=e.accumulatedSecondMoment[o],c=e.beta1Scalar.mul(s).add(e.oneMinusBeta1.mul(u)),h=e.beta2Scalar.mul(l).add(e.oneMinusBeta2.mul(u.square())),f=c.div(n),p=h.div(r);e.accumulatedFirstMoment[o].assign(c),e.accumulatedSecondMoment[o].assign(h);var d=e.c.mul(f.div(e.epsScalar.add(p.sqrt()))).add(a);a.assign(d)}e.accBeta1.assign(e.accBeta1.mul(e.beta1Scalar)),e.accBeta2.assign(e.accBeta2.mul(e.beta2Scalar))})},e.prototype.dispose=function(){var t=this;this.c.dispose(),this.epsScalar.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.accBeta1.dispose(),this.accBeta2.dispose(),this.oneMinusBeta1.dispose(),this.oneMinusBeta2.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(e){return t.accumulatedFirstMoment[e].dispose()}),null!=this.accumulatedSecondMoment&&Object.keys(this.accumulatedSecondMoment).forEach(function(e){return t.accumulatedSecondMoment[e].dispose()})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}},e.fromConfig=function(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon)},e.className="AdamOptimizer",e}(Rs);ys.register(Ds);var Ns=function(t){function e(e,n,r,o,a){void 0===o&&(o=null),void 0===a&&(a=0);var i=t.call(this)||this;return i.learningRate=e,i.beta1=n,i.beta2=r,i.epsilon=o,i.decay=a,i.accumulatedFirstMoment={},i.accumulatedWeightedInfNorm={},i.c=Va(zt(-e)),i.beta1Scalar=Va(zt(n)),i.beta2Scalar=Va(zt(r)),i.decayScalar=Va(zt(a)),za(function(){i.iteration=zt(0).variable(),i.accBeta1=zt(n).variable()}),i.oneMinusBeta1=Va(zt(1-n)),i.one=Va(zt(1)),null===o&&(o=Ts()),i.epsScalar=Va(zt(o)),i}return n(e,t),e.prototype.applyGradients=function(t){var e=this;za(function(){var n=e.one.sub(e.accBeta1),r=e.c.div(e.one.add(e.decayScalar.mul(e.iteration)));for(var o in t){var a=ht.engine.registeredVariables[o];if(null==e.accumulatedFirstMoment[o]){var i=!1;e.accumulatedFirstMoment[o]=oe(a).variable(i)}if(null==e.accumulatedWeightedInfNorm[o]){i=!1;e.accumulatedWeightedInfNorm[o]=oe(a).variable(i)}var u=t[o],s=e.accumulatedFirstMoment[o],l=e.accumulatedWeightedInfNorm[o],c=e.beta1Scalar.mul(s).add(e.oneMinusBeta1.mul(u)),h=e.beta2Scalar.mul(l),f=u.abs(),p=h.maximum(f);e.accumulatedFirstMoment[o].assign(c),e.accumulatedWeightedInfNorm[o].assign(p);var d=r.div(n).mul(c.div(e.epsScalar.add(p))).add(a);a.assign(d)}e.iteration.assign(e.iteration.add(e.one)),e.accBeta1.assign(e.accBeta1.mul(e.beta1Scalar))})},e.prototype.dispose=function(){var t=this;this.c.dispose(),this.epsScalar.dispose(),this.accBeta1.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.oneMinusBeta1.dispose(),this.decayScalar.dispose(),this.iteration.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(e){return t.accumulatedFirstMoment[e].dispose()}),null!=this.accumulatedWeightedInfNorm&&Object.keys(this.accumulatedWeightedInfNorm).forEach(function(e){return t.accumulatedWeightedInfNorm[e].dispose()})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}},e.fromConfig=function(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon,e.decay)},e.className="AdamaxOptimizer",e}(Rs);ys.register(Ns);var Ms=function(t){function e(e){var n=t.call(this)||this;return n.learningRate=e,n.setLearningRate(e),n}return n(e,t),e.prototype.applyGradients=function(t){var e=this;Object.keys(t).forEach(function(n){var r=t[n],o=ht.engine.registeredVariables[n];za(function(){var t=e.c.mul(r).add(o);o.assign(t)})})},e.prototype.setLearningRate=function(t){this.learningRate=t,null!=this.c&&this.c.dispose(),this.c=Va(zt(-t))},e.prototype.dispose=function(){this.c.dispose()},e.prototype.getConfig=function(){return{learningRate:this.learningRate}},e.fromConfig=function(t,e){return new t(e.learningRate)},e.className="SGDOptimizer",e}(Rs);ys.register(Ms);var _s=function(t){function e(e,n,r){void 0===r&&(r=!1);var o=t.call(this,e)||this;return o.learningRate=e,o.momentum=n,o.useNesterov=r,o.m=zt(o.momentum),o.accumulations={},o}return n(e,t),e.prototype.applyGradients=function(t){var e=this,n=function(n){var o=ht.engine.registeredVariables[n];if(null==r.accumulations[n]){za(function(){e.accumulations[n]=oe(o).variable(!1)})}var a=r.accumulations[n],i=t[n];za(function(){var t,r=e.m.mul(a).add(i);t=e.useNesterov?e.c.mul(i.add(r.mul(e.m))).add(o):e.c.mul(r).add(o),e.accumulations[n].assign(r),o.assign(t)})},r=this;for(var o in t)n(o)},e.prototype.dispose=function(){if(t.prototype.dispose.call(this),this.m.dispose(),null!=this.accumulations)for(var e in this.accumulations)this.accumulations[e].dispose()},e.prototype.setMomentum=function(t){this.momentum=t},e.prototype.getConfig=function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}},e.fromConfig=function(t,e){return new t(e.learningRate,e.momentum,e.useNesterov)},e.className="MomentumOptimizer",e}(Ms);ys.register(_s);var Os=function(t){function e(e,n,r,o,a){void 0===n&&(n=.9),void 0===r&&(r=0),void 0===o&&(o=null),void 0===a&&(a=!1);var i=t.call(this)||this;return i.learningRate=e,i.decay=n,i.momentum=r,i.epsilon=o,i.accumulatedMeanSquares={},i.accumulatedMeanGrads={},i.accumulatedMoments={},i.c=Va(zt(e)),i.decayScalar=Va(zt(n)),i.momentumScalar=Va(zt(r)),i.oneMinusDecay=Va(zt(1-n)),i.centered=a,null===o&&(o=Ts()),i.epsilonScalar=Va(zt(o)),i}return n(e,t),e.prototype.applyGradients=function(t){var e=this,n=function(n){var o=ht.engine.registeredVariables[n];if(null==r.accumulatedMeanSquares[n]){za(function(){e.accumulatedMeanSquares[n]=oe(o).variable(!1)})}if(null==r.accumulatedMeanGrads[n]&&r.centered){za(function(){e.accumulatedMeanGrads[n]=oe(o).variable(!1)})}if(null==r.accumulatedMoments[n]){za(function(){e.accumulatedMoments[n]=oe(o).variable(!1)})}var a=r.accumulatedMeanSquares[n],i=r.accumulatedMeanGrads[n],u=r.accumulatedMoments[n],s=t[n];za(function(){var t=e.decayScalar.mul(a).add(e.oneMinusDecay.mul(s.square()));if(e.centered){var r=e.decayScalar.mul(i).add(e.oneMinusDecay.mul(s)),l=e.momentumScalar.mul(u).add(e.c.mul(s).div(t.sub(r.square().add(e.epsilonScalar)).sqrt()));e.accumulatedMeanSquares[n].assign(t),e.accumulatedMeanGrads[n].assign(r),e.accumulatedMoments[n].assign(l);var c=o.sub(l);o.assign(c)}else{var h=e.decayScalar.mul(a).add(e.oneMinusDecay.mul(s.square()));l=e.momentumScalar.mul(u).add(e.c.mul(s).div(h.add(e.epsilonScalar).sqrt()));e.accumulatedMeanSquares[n].assign(h),e.accumulatedMoments[n].assign(l);c=o.sub(l);o.assign(c)}})},r=this;for(var o in t)n(o)},e.prototype.dispose=function(){var t=this;this.c.dispose(),this.epsilonScalar.dispose(),this.decayScalar.dispose(),this.momentumScalar.dispose(),this.oneMinusDecay.dispose(),null!=this.accumulatedMeanSquares&&Object.keys(this.accumulatedMeanSquares).forEach(function(e){return t.accumulatedMeanSquares[e].dispose()}),null!=this.accumulatedMeanGrads&&this.centered&&Object.keys(this.accumulatedMeanGrads).forEach(function(e){return t.accumulatedMeanGrads[e].dispose()}),null!=this.accumulatedMoments&&Object.keys(this.accumulatedMoments).forEach(function(e){return t.accumulatedMoments[e].dispose()})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}},e.fromConfig=function(t,e){return new t(e.learningRate,e.decay,e.momentum,e.epsilon,e.centered)},e.className="RMSPropOptimizer",e}(Rs);ys.register(Os);var Fs=function(){function t(){}return t.sgd=function(t){return new Ms(t)},t.momentum=function(t,e,n){return void 0===n&&(n=!1),new _s(t,e,n)},t.rmsprop=function(t,e,n,r,o){return void 0===e&&(e=.9),void 0===n&&(n=0),void 0===r&&(r=null),void 0===o&&(o=!1),new Os(t,e,n,r,o)},t.adam=function(t,e,n,r){return void 0===t&&(t=.001),void 0===e&&(e=.9),void 0===n&&(n=.999),void 0===r&&(r=null),new Ds(t,e,n,r)},t.adadelta=function(t,e,n){return void 0===t&&(t=.001),void 0===e&&(e=.95),void 0===n&&(n=null),new Is(t,e,n)},t.adamax=function(t,e,n,r,o){return void 0===t&&(t=.002),void 0===e&&(e=.9),void 0===n&&(n=.999),void 0===r&&(r=null),void 0===o&&(o=0),new Ns(t,e,n,r,o)},t.adagrad=function(t,e){return void 0===e&&(e=.1),new As(t,e)},t}(),Ls={sgd:Fs.sgd,momentum:Fs.momentum,adadelta:Fs.adadelta,adagrad:Fs.adagrad,rmsprop:Fs.rmsprop,adamax:Fs.adamax,adam:Fs.adam},Bs=lt.setBackend,Ps=lt.getBackend,Us=lt.disposeVariables,zs=lt.memory;$=Su,t.setBackend=Bs,t.getBackend=Ps,t.disposeVariables=Us,t.memory=zs,t.version_core="0.12.8",t.nextFrame=function(){return new Promise(function(t){return Cu(function(){return t()})})},t.environment=ft,t.io=ms,t.serialization=xs,t.test_util=Es,t.util=L,t.webgl=Ss,t.AdadeltaOptimizer=Is,t.AdagradOptimizer=As,t.AdamOptimizer=Ds,t.AdamaxOptimizer=Ns,t.MomentumOptimizer=_s,t.Optimizer=Rs,t.RMSPropOptimizer=Os,t.SGDOptimizer=Ms,t.Tensor=X,t.TensorBuffer=q,t.variable=Y,t.Variable=K,t.ENV=ht,t.Environment=lt,t.image=Eu,t.linalg=mu,t.losses=fu,t.op=Bt,t.batchNormalization2d=sa,t.batchNormalization3d=la,t.batchNormalization4d=ca,t.batchNormalization=ha,t.concat=Lr,t.concat1d=Br,t.concat2d=Pr,t.concat3d=Ur,t.concat4d=zr,t.conv1d=ba,t.conv2d=wa,t.depthwiseConv2d=Ea,t.separableConv2d=Sa,t.conv2dTranspose=Ra,t.matMul=Ca,t.dot=ka,t.outerProduct=Ta,t.reverse=Ia,t.reverse1d=Aa,t.reverse2d=Da,t.reverse3d=Na,t.reverse4d=Ma,t.maxPool=_a,t.avgPool=Oa,t.slice=Fa,t.slice1d=La,t.slice2d=Ba,t.slice3d=Pa,t.slice4d=Ua,t.abs=Ao,t.acos=Do,t.acosh=No,t.asin=Mo,t.asinh=_o,t.atan=Oo,t.atanh=Fo,t.ceil=Lo,t.clipByValue=Bo,t.cos=Po,t.cosh=Uo,t.erf=zo,t.exp=Vo,t.expm1=Wo,t.floor=Go,t.log=qo,t.log1p=Ho,t.logSigmoid=$o,t.neg=jo,t.reciprocal=Xo,t.round=Ko,t.rsqrt=Yo,t.sigmoid=Qo,t.sign=Jo,t.sin=Zo,t.sinh=ta,t.softplus=ea,t.sqrt=na,t.square=ra,t.step=oa,t.tan=aa,t.tanh=ia,t.all=qa,t.any=Ha,t.argMax=$a,t.argMin=ja,t.logSumExp=Xa,t.max=Ka,t.mean=Ya,t.min=Qa,t.moments=Ja,t.sum=Za,t.equal=ti,t.equalStrict=ei,t.greater=ni,t.greaterEqual=ri,t.greaterEqualStrict=oi,t.greaterStrict=ai,t.less=ii,t.lessEqual=ui,t.lessEqualStrict=si,t.lessStrict=li,t.notEqual=ci,t.notEqualStrict=hi,t.add=fi,t.addN=pi,t.addStrict=di,t.atan2=vi,t.div=mi,t.divStrict=gi,t.floorDiv=yi,t.maximum=xi,t.maximumStrict=bi,t.minimum=wi,t.minimumStrict=Ei,t.mod=Si,t.modStrict=Ri,t.mul=Ci,t.mulStrict=ki,t.pow=Ti,t.powStrict=Ii,t.squaredDifference=Ai,t.squaredDifferenceStrict=Di,t.sub=Ni,t.subStrict=Mi,t.elu=Ui,t.leakyRelu=zi,t.prelu=Vi,t.relu=Wi,t.selu=Gi,t.logicalAnd=_i,t.logicalNot=Oi,t.logicalOr=Fi,t.logicalXor=Li,t.where=Bi,t.whereAsync=Pi,t.buffer=Jr,t.toPixels=Qr,t.print=Zr,t.cast=to,t.clone=eo,t.cumsum=no,t.expandDims=ro,t.eye=oo,t.fromPixels=ao,t.multinomial=io,t.oneHot=uo,t.pad=so,t.pad1d=lo,t.pad2d=co,t.pad3d=ho,t.pad4d=fo,t.rand=po,t.randomNormal=vo,t.randomUniform=mo,t.reshape=go,t.split=yo,t.squeeze=xo,t.stack=bo,t.tile=wo,t.truncatedNormal=Eo,t.unstack=So,t.batchToSpaceND=Ro,t.spaceToBatchND=Co,t.fill=Kt,t.linspace=Yt,t.ones=jt,t.range=Qt,t.scalar=zt,t.tensor=Ut,t.tensor1d=Vt,t.tensor2d=Wt,t.tensor3d=Gt,t.tensor4d=qt,t.tensor5d=Ht,t.tensor6d=$t,t.zeros=Xt,t.onesLike=re,t.zerosLike=oe,t.transpose=qi,t.softmax=Pt,t.localResponseNormalization=Hi,t.norm=$i,t.gather=Ki,t.unsortedSegmentSum=Yi,t.basicLSTMCell=Qi,t.multiRNNCell=Ji,t.movingAverage=Zi,t.stridedSlice=tu,t.topk=nu,t.train=Ls,t.tidy=za,t.keep=Va,t.dispose=Wa,t.time=Ga,t.customGrad=_t,t.grad=function(t){return l(A(t),"The f passed in grad(f) must be a function"),function(e,n){return l(e instanceof X,"The x passed in grad(f)(x) must be a tensor"),l(null==n||n instanceof X,"The dy passed in grad(f)(x, dy) must be a tensor"),ht.engine.tidy(function(){var r=ht.engine.gradients(function(){return t(e)},[e],n),o=r.value,a=r.grads;return null!=n&&c(o.shape,n.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Ot(a),a[0]})}},t.grads=function(t){return l(A(t),"The f passed in grads(f) must be a function"),function(e,n){return l(Array.isArray(e)&&e.every(function(t){return t instanceof X}),"The args passed in grads(f)(args) must be an array of tensors"),l(null==n||n instanceof X,"The dy passed in grads(f)(args, dy) must be a tensor"),ht.engine.tidy(function(){var r=ht.engine.gradients(function(){return t.apply(void 0,e)},e,n),o=r.value,a=r.grads;return null!=n&&c(o.shape,n.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Ot(a),a})}},t.valueAndGrad=function(t){return l(A(t),"The f passed in valueAndGrad(f) must be a function"),function(e,n){l(e instanceof X,"The x passed in valueAndGrad(f)(x) must be a tensor"),l(null==n||n instanceof X,"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");var r=ht.engine.gradients(function(){return t(e)},[e],n),o=r.grads,a=r.value;return Ot(o),{grad:o[0],value:a}}},t.valueAndGrads=function(t){return l(A(t),"The f passed in valueAndGrads(f) must be a function"),function(e,n){l(Array.isArray(e)&&e.every(function(t){return t instanceof X}),"The args passed in valueAndGrads(f)(args) must be array of tensors"),l(null==n||n instanceof X,"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");var r=ht.engine.gradients(function(){return t.apply(void 0,e)},e,n);return null!=n&&c(r.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Ot(r.grads),r}},t.variableGrads=Mt,Object.defineProperty(t,"__esModule",{value:!0})}); +//# sourceMappingURL=tf-core.min.js.map diff --git a/node_modules/@tensorflow/tfjs-core/dist/tf-core.min.js.map b/node_modules/@tensorflow/tfjs-core/dist/tf-core.min.js.map new file mode 100644 index 0000000..121abaa --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tf-core.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tf-core.min.js","sources":["../src/util.ts","../src/profiler.ts","../src/tensor_format.ts","../src/tensor.ts","../src/tensor_util.ts","../src/engine.ts","../src/environment_util.ts","../src/tape.ts","../src/environment.ts","../src/device_util.ts","../src/log.ts","../src/ops/array_ops_util.ts","../src/ops/axis_util.ts","../src/ops/reduce_util.ts","../src/ops/slice_util.ts","../src/gradients.ts","../src/tensor_util_env.ts","../src/ops/operation.ts","../src/ops/softmax.ts","../src/ops/tensor_ops.ts","../src/types.ts","../src/kernels/backend_util.ts","../src/kernels/non_max_suppression_impl.ts","../src/kernels/topk_impl.ts","../src/kernels/webgl/argminmax_gpu.ts","../src/kernels/webgl/avg_pool_backprop_gpu.ts","../src/ops/broadcast_util.ts","../src/kernels/webgl/batchnorm_gpu.ts","../src/kernels/webgl/binaryop_gpu.ts","../src/kernels/webgl/clip_gpu.ts","../src/ops/concat_util.ts","../src/kernels/webgl/concat_gpu.ts","../src/kernels/webgl/conv_backprop_gpu.ts","../src/kernels/webgl/conv_backprop_gpu_depthwise.ts","../src/kernels/webgl/conv_gpu.ts","../src/kernels/webgl/conv_gpu_depthwise.ts","../src/kernels/webgl/shader_compiler.ts","../src/kernels/webgl/cumsum_gpu.ts","../src/kernels/webgl/encode_float_gpu.ts","../src/kernels/webgl/tex_util.ts","../src/kernels/webgl/from_pixels_gpu.ts","../src/kernels/webgl/gather_gpu.ts","../src/kernels/webgl/webgl_util.ts","../src/kernels/webgl/gpgpu_util.ts","../src/kernels/webgl/gpgpu_context.ts","../src/kernels/webgl/gpgpu_math.ts","../src/kernels/webgl/lrn_gpu.ts","../src/kernels/webgl/lrn_grad_gpu.ts","../src/kernels/webgl/max_pool_backprop_gpu.ts","../src/kernels/webgl/mulmat_gpu.ts","../src/kernels/webgl/multinomial_gpu.ts","../src/kernels/webgl/onehot_gpu.ts","../src/kernels/webgl/pad_gpu.ts","../src/kernels/webgl/pool_gpu.ts","../src/kernels/webgl/reduce_gpu.ts","../src/kernels/webgl/resize_bilinear_backprop_gpu.ts","../src/kernels/webgl/resize_bilinear_gpu.ts","../src/kernels/webgl/resize_nearest_neighbor_backprop_gpu.ts","../src/kernels/webgl/resize_nearest_neighbor_gpu.ts","../src/kernels/webgl/reverse_gpu.ts","../src/kernels/webgl/segment_gpu.ts","../src/kernels/webgl/select_gpu.ts","../src/kernels/webgl/slice_gpu.ts","../src/kernels/webgl/strided_slice_gpu.ts","../src/kernels/webgl/texture_manager.ts","../src/kernels/webgl/tile_gpu.ts","../src/kernels/webgl/transpose_gpu.ts","../src/ops/erf_util.ts","../src/ops/selu_util.ts","../src/kernels/webgl/unaryop_gpu.ts","../src/ops/concat.ts","../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/ops/rand.ts","../src/ops/array_ops.ts","../src/kernels/where_impl.ts","../src/kernels/backend_webgl.ts","../src/ops/segment_util.ts","../src/ops/unary_ops.ts","../src/ops/batchnorm.ts","../src/ops/conv_util.ts","../src/ops/conv.ts","../src/ops/matmul.ts","../src/ops/reverse.ts","../src/ops/pool.ts","../src/ops/slice.ts","../src/globals.ts","../src/ops/reduction_ops.ts","../src/ops/compare.ts","../src/ops/binary_ops.ts","../src/ops/logical_ops.ts","../src/ops/relu_ops.ts","../src/ops/transpose.ts","../src/ops/lrn.ts","../src/ops/norm.ts","../src/ops/segment_ops.ts","../src/ops/lstm.ts","../src/ops/moving_average.ts","../src/ops/strided_slice.ts","../src/ops/loss_ops.ts","../src/ops/topk.ts","../src/ops/linalg_ops.ts","../src/ops/image_ops.ts","../src/kernels/backend_cpu.ts","../src/browser_util.ts","../src/io/types.ts","../src/io/io_utils.ts","../src/io/router_registry.ts","../src/io/model_management.ts","../src/io/indexed_db.ts","../src/io/local_storage.ts","../src/io/browser_files.ts","../src/io/weights_loader.ts","../src/io/browser_http.ts","../src/io/passthrough.ts","../src/io/io.ts","../src/serialization.ts","../src/test_util.ts","../src/optimizers/optimizer.ts","../src/optimizers/optimizer_utils.ts","../src/optimizers/adadelta_optimizer.ts","../src/optimizers/adagrad_optimizer.ts","../src/optimizers/adam_optimizer.ts","../src/optimizers/adamax_optimizer.ts","../src/optimizers/sgd_optimizer.ts","../src/optimizers/momentum_optimizer.ts","../src/optimizers/rmsprop_optimizer.ts","../src/optimizers/optimizer_constructors.ts","../src/train.ts","../src/index.ts","../src/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ArrayData, DataType, DataTypeMap, FlatVector, RecursiveArray, RegularArray, TensorLike, TypedArray} from './types';\n\n/** Shuffles the array using Fisher-Yates algorithm. */\n// tslint:disable-next-line:no-any\nexport function shuffle(array: any[]|Uint32Array|Int32Array|\n Float32Array): void {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = (Math.random() * counter) | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}\n\n/** Clamps a value to a specified range. */\nexport function clamp(min: number, x: number, max: number): number {\n return Math.max(min, Math.min(x, max));\n}\n\n/** Returns a sample from a uniform [a, b] distribution. */\nexport function randUniform(a: number, b: number) {\n return Math.random() * (b - a) + a;\n}\n\n/** Returns squared eucledian distance between two vectors. */\nexport function distSquared(a: FlatVector, b: FlatVector): number {\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n const diff = Number(a[i]) - Number(b[i]);\n result += diff * diff;\n }\n return result;\n}\n\nexport function assert(expr: boolean, msg: string|(() => string)) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\n\nexport function assertShapesMatch(\n shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {\n assert(\n arraysEqual(shapeA, shapeB),\n errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);\n}\n\nexport function assertNonNull(a: TensorLike): void {\n assert(\n a != null,\n `The input to the tensor constructor must be a non-null value.`);\n}\n\n// NOTE: We explicitly type out what T extends instead of any so that\n// util.flatten on a nested array of number doesn't try to infer T as a\n// number[][], causing us to explicitly type util.flatten().\nexport function flatten>(\n arr: T|RecursiveArray, ret: T[] = []): T[] {\n if (Array.isArray(arr)) {\n for (let i = 0; i < arr.length; ++i) {\n flatten(arr[i], ret);\n }\n } else {\n ret.push(arr as T);\n }\n return ret;\n}\n\nexport function inferShape(val: TypedArray|number|boolean|RegularArray|\n RegularArray): number[] {\n let firstElem: typeof val = val;\n\n if (isTypedArray(val)) {\n return [(val as TypedArray).length];\n }\n if (!Array.isArray(val)) {\n return []; // Scalar.\n }\n const shape: number[] = [];\n\n while (firstElem instanceof Array) {\n shape.push(firstElem.length);\n firstElem = firstElem[0];\n }\n if (val instanceof Array) {\n deepAssertShapeConsistency(val, shape, []);\n }\n return shape;\n}\n\nfunction deepAssertShapeConsistency(\n val: number|boolean|RegularArray|RegularArray,\n shape: number[], indices?: number[]) {\n indices = indices || [];\n if (!(val instanceof Array)) {\n assert(\n shape.length === 0,\n () => `Element arr[${indices.join('][')}] is a primitive, ` +\n `but should be an array of ${shape[0]} elements`);\n return;\n }\n assert(\n shape.length > 0,\n () => `Element arr[${indices.join('][')}] should be a primitive, ` +\n `but is an array of ${val.length} elements`);\n assert(\n val.length === shape[0],\n () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` +\n `elements, but has ${val.length} elements`);\n const subShape = shape.slice(1);\n for (let i = 0; i < val.length; ++i) {\n deepAssertShapeConsistency(val[i], subShape, indices.concat(i));\n }\n}\n\nexport function sizeFromShape(shape: number[]): number {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\n\nexport function isScalarShape(shape: number[]): boolean {\n return shape.length === 0;\n}\n\nexport function arraysEqual(n1: FlatVector, n2: FlatVector) {\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n}\n\nexport function isInt(a: number): boolean {\n return a % 1 === 0;\n}\n\nexport function tanh(x: number): number {\n // tslint:disable-next-line:no-any\n if ((Math as any).tanh != null) {\n // tslint:disable-next-line:no-any\n return (Math as any).tanh(x);\n }\n if (x === Infinity) {\n return 1;\n } else if (x === -Infinity) {\n return -1;\n } else {\n const e2x = Math.exp(2 * x);\n return (e2x - 1) / (e2x + 1);\n }\n}\n\nexport function sizeToSquarishShape(size: number): [number, number] {\n for (let a = Math.floor(Math.sqrt(size)); a > 1; --a) {\n if (size % a === 0) {\n return [a, size / a];\n }\n }\n return [1, size];\n}\n\nexport function createShuffledIndices(n: number): Uint32Array {\n const shuffledIndices = new Uint32Array(n);\n for (let i = 0; i < n; ++i) {\n shuffledIndices[i] = i;\n }\n shuffle(shuffledIndices);\n return shuffledIndices;\n}\n\nexport function rightPad(a: string, size: number): string {\n if (size <= a.length) {\n return a;\n }\n return a + ' '.repeat(size - a.length);\n}\n\nexport function repeatedTry(\n checkFn: () => boolean, delayFn = (counter: number) => 0,\n maxCounter?: number): Promise {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n\n tryCount++;\n\n const nextBackoff = delayFn(tryCount);\n\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n\n tryFn();\n });\n}\n\n/**\n * Given the full size of the array and a shape that may contain -1 as the\n * implicit dimension, returns the inferred shape where -1 is replaced.\n * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].\n *\n * @param shape The shape, which may contain -1 in some dimension.\n * @param size The full size (number of elements) of the array.\n * @return The inferred shape where -1 is replaced with the inferred size.\n */\nexport function inferFromImplicitShape(\n shape: number[], size: number): number[] {\n let shapeProd = 1;\n let implicitIdx = -1;\n\n for (let i = 0; i < shape.length; ++i) {\n if (shape[i] > 0) {\n shapeProd *= shape[i];\n } else if (shape[i] === -1) {\n if (implicitIdx !== -1) {\n throw Error(\n `Shapes can only have 1 implicit size. ` +\n `Found - 1 at dim ${implicitIdx} and dim ${i}`);\n }\n implicitIdx = i;\n } else if (shape[i] <= 0) {\n throw Error(`Shapes can not be <= 0. Found ${shape[i]} at dim ${i}`);\n }\n }\n\n if (implicitIdx === -1) {\n if (size > 0 && size !== shapeProd) {\n throw Error(`Size(${size}) must match the product of shape ${shape}`);\n }\n return shape;\n }\n\n if (size % shapeProd !== 0) {\n throw Error(\n `The implicit shape can't be a fractional number. ` +\n `Got ${size} / ${shapeProd}`);\n }\n\n const newShape = shape.slice();\n newShape[implicitIdx] = size / shapeProd;\n return newShape;\n}\n\n/** Reduces the shape by removing all dimensions of shape 1. */\nexport function squeezeShape(shape: number[], axis?: number[]):\n {newShape: number[], keptDims: number[]} {\n const newShape: number[] = [];\n const keptDims: number[] = [];\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axis != null) {\n if (axis[j] === i && shape[i] > 1) {\n throw new Error(\n `Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axis[j] == null || axis[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axis[j] <= i) {\n j++;\n }\n }\n if (shape[i] > 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return {newShape, keptDims};\n}\n\nexport function getTypedArrayFromDType(\n dtype: D, size: number): DataTypeMap[D] {\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n return values;\n}\n\nexport function checkComputationForNaN(\n vals: DataTypeMap[D], dtype: D, name: string): void {\n if (dtype !== 'float32') {\n // Only floating point computations will generate NaN values\n return;\n }\n for (let i = 0; i < vals.length; i++) {\n if (isNaN(vals[i])) {\n throw Error(`The result of the '${name}' has NaNs.`);\n }\n }\n}\n\nexport function checkConversionForNaN(\n vals: DataTypeMap[D]|number[], dtype: D): void {\n if (dtype === 'float32') {\n // NaN is valid for floating point conversions\n return;\n }\n\n for (let i = 0; i < vals.length; i++) {\n if (isNaN(vals[i])) {\n throw Error(`NaN is not a valid value for dtype: '${dtype}'.`);\n }\n }\n}\n\n/**\n * Returns true if the new type can't encode the old type without loss of\n * precision.\n */\nexport function hasEncodingLoss(oldType: DataType, newType: DataType): boolean {\n if (newType === 'float32') {\n return false;\n }\n if (newType === 'int32' && oldType !== 'float32') {\n return false;\n }\n if (newType === 'bool' && oldType === 'bool') {\n return false;\n }\n return true;\n}\n\nfunction copyTypedArray(\n array: DataTypeMap[D]|number[]|boolean[], dtype: D,\n debugMode: boolean): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32') {\n return new Float32Array(array as number[]);\n } else if (dtype === 'int32') {\n if (debugMode) {\n checkConversionForNaN(array as number[], dtype);\n }\n return new Int32Array(array as number[]);\n } else if (dtype === 'bool') {\n const bool = new Uint8Array(array.length);\n for (let i = 0; i < bool.length; ++i) {\n if (Math.round(array[i] as number) !== 0) {\n bool[i] = 1;\n }\n }\n return bool;\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\nexport function isTypedArray(a: TypedArray|number|boolean|RegularArray|\n RegularArray): boolean {\n return a instanceof Float32Array || a instanceof Int32Array ||\n a instanceof Uint8Array;\n}\n\nexport function bytesPerElement(dtype: DataType): number {\n if (dtype === 'float32' || dtype === 'int32') {\n return 4;\n } else if (dtype === 'bool') {\n return 1;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\nexport function isFunction(f: Function) {\n return !!(f && f.constructor && f.call && f.apply);\n}\n\nexport function nearestDivisor(size: number, start: number): number {\n for (let i = start; i < size; ++i) {\n if (size % i === 0) {\n return i;\n }\n }\n return size;\n}\n\nexport function computeStrides(shape: number[]): number[] {\n const rank = shape.length;\n if (rank < 2) {\n return [];\n }\n\n // Last dimension has implicit stride of 1, thus having D-1 (instead of D)\n // strides.\n const strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n return strides;\n}\n\nexport function toTypedArray(\n a: ArrayData, dtype: D, debugMode: boolean): DataTypeMap[D] {\n if (noConversionNeeded(a, dtype)) {\n return a as DataTypeMap[D];\n }\n if (Array.isArray(a)) {\n a = flatten(a as number[]);\n }\n return copyTypedArray(a, dtype, debugMode);\n}\n\nfunction noConversionNeeded(\n a: ArrayData, dtype: D): boolean {\n return (a instanceof Float32Array && dtype === 'float32') ||\n (a instanceof Int32Array && dtype === 'int32') ||\n (a instanceof Uint8Array && dtype === 'bool');\n}\n\nexport function makeOnesTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n const array = makeZerosTypedArray(size, dtype);\n for (let i = 0; i < array.length; i++) {\n array[i] = 1;\n }\n return array;\n}\n\nexport function makeZerosTypedArray(\n size: number, dtype: D): DataTypeMap[D] {\n if (dtype == null || dtype === 'float32') {\n return new Float32Array(size);\n } else if (dtype === 'int32') {\n return new Int32Array(size);\n } else if (dtype === 'bool') {\n return new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n}\n\n/**\n * Returns the current high-resolution real time in milliseconds. It is\n * relative to an arbitrary time in the past.\n */\nexport function now(): number {\n if (typeof performance !== 'undefined') {\n return performance.now();\n } else if (typeof process !== 'undefined') {\n const time = process.hrtime();\n return time[0] * 1000 + time[1] / 1000000;\n } else {\n throw new Error(\n 'Can not measure time in this environment. You should run tf.js ' +\n 'in the browser or in Node.js');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimer} from './kernels/backend';\nimport {Tensor} from './tensor';\nimport {TypedArray} from './types';\nimport * as util from './util';\n\nexport class Profiler {\n constructor(private backendTimer: BackendTimer, private logger?: Logger) {\n if (logger == null) {\n this.logger = new Logger();\n }\n }\n\n profileKernel(name: string, f: () => T | Tensor[]):\n T {\n let result: T|Tensor[];\n const holdResultWrapperFn = () => {\n result = f();\n };\n const timer = this.backendTimer.time(holdResultWrapperFn);\n\n const results: Tensor[] =\n Array.isArray(result) ? result : [result] as Tensor[];\n results.forEach(r => {\n const vals = r.dataSync();\n util.checkComputationForNaN(vals, r.dtype, name);\n\n timer.then(timing => {\n this.logger.logKernelProfile(name, r, vals, timing.kernelMs);\n });\n });\n\n return result as T;\n }\n}\n\nexport class Logger {\n logKernelProfile(\n name: string, result: Tensor, vals: TypedArray, timeMs: number) {\n const time = util.rightPad(`${timeMs}ms`, 9);\n const paddedName = util.rightPad(name, 25);\n const rank = result.rank;\n const size = result.size;\n const shape = util.rightPad(result.shape.toString(), 14);\n console.log(\n `%c${paddedName}\\t%c${time}\\t%c${rank}D ${shape}\\t%c${size}`,\n 'font-weight:bold', 'color:red', 'color:blue', 'color: orange');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, TypedArray} from './types';\nimport {computeStrides, rightPad, sizeFromShape} from './util';\n\n// Maximum number of values before we decide to show ellipsis.\nconst FORMAT_LIMIT_NUM_VALS = 20;\n// Number of first and last values to show when displaying a, b,...,y, z.\nconst FORMAT_NUM_FIRST_LAST_VALS = 3;\n// Number of significant digits to show.\nconst FORMAT_NUM_SIG_DIGITS = 7;\n\nexport function tensorToString(\n vals: TypedArray, shape: number[], dtype: DataType, verbose: boolean) {\n const strides = computeStrides(shape);\n const padPerCol = computeMaxSizePerColumn(vals, shape, strides);\n const rank = shape.length;\n const valsLines = subTensorToString(vals, shape, strides, padPerCol);\n const lines = ['Tensor'];\n if (verbose) {\n lines.push(` dtype: ${dtype}`);\n lines.push(` rank: ${rank}`);\n lines.push(` shape: [${shape}]`);\n lines.push(` values:`);\n }\n lines.push(valsLines.map(l => ' ' + l).join('\\n'));\n return lines.join('\\n');\n}\n\nfunction computeMaxSizePerColumn(\n vals: TypedArray, shape: number[], strides: number[]): number[] {\n const n = sizeFromShape(shape);\n const numCols = strides[strides.length - 1];\n const padPerCol = new Array(numCols).fill(0);\n const rank = shape.length;\n if (rank > 1) {\n for (let row = 0; row < n / numCols; row++) {\n const offset = row * numCols;\n for (let j = 0; j < numCols; j++) {\n padPerCol[j] =\n Math.max(padPerCol[j], valToString(vals[offset + j], 0).length);\n }\n }\n }\n return padPerCol;\n}\n\nfunction valToString(val: number, pad: number) {\n return rightPad(\n parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(), pad);\n}\n\nfunction subTensorToString(\n vals: TypedArray, shape: number[], strides: number[], padPerCol: number[],\n isLast = true): string[] {\n const size = shape[0];\n const rank = shape.length;\n if (rank === 0) {\n return [vals[0].toString()];\n }\n\n if (rank === 1) {\n if (size > FORMAT_LIMIT_NUM_VALS) {\n const firstVals =\n Array.from(vals.subarray(0, FORMAT_NUM_FIRST_LAST_VALS));\n const lastVals =\n Array.from(vals.subarray(size - FORMAT_NUM_FIRST_LAST_VALS, size));\n return [\n '[' + firstVals.map((x, i) => valToString(x, padPerCol[i])).join(', ') +\n ', ..., ' +\n lastVals\n .map(\n (x, i) => valToString(\n x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i]))\n .join(', ') +\n ']'\n ];\n }\n return [\n '[' +\n Array.from(vals).map((x, i) => valToString(x, padPerCol[i])).join(', ') +\n ']'\n ];\n }\n\n // The array is rank 2 or more.\n const subshape = shape.slice(1);\n const substrides = strides.slice(1);\n const stride = strides[0];\n const lines: string[] = [];\n if (size > FORMAT_LIMIT_NUM_VALS) {\n for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.subarray(start, end), subshape, substrides, padPerCol,\n false /* isLast */));\n }\n lines.push('...');\n for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.subarray(start, end), subshape, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n } else {\n for (let i = 0; i < size; i++) {\n const start = i * stride;\n const end = start + stride;\n lines.push(...subTensorToString(\n vals.subarray(start, end), subshape, substrides, padPerCol,\n i === size - 1 /* isLast */));\n }\n }\n const sep = rank === 2 ? ',' : '';\n lines[0] = '[' + lines[0] + sep;\n for (let i = 1; i < lines.length - 1; i++) {\n lines[i] = ' ' + lines[i] + sep;\n }\n let newLineSep = ',\\n';\n for (let i = 2; i < rank; i++) {\n newLineSep += '\\n';\n }\n lines[lines.length - 1] =\n ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep);\n return lines;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensorToString} from './tensor_format';\nimport {DataType, Rank, ShapeMap, TypedArray} from './types';\nimport * as util from './util';\nimport {computeStrides} from './util';\n\n/** @hidden */\nexport interface TensorData {\n dataId?: DataId;\n values?: TypedArray;\n}\n\n/**\n * A mutable object, similar to `Tensor`, that allows users to set values\n * at locations before converting to an immutable `Tensor`.\n *\n * See `buffer` for creating a tensor buffer.\n */\n/** @doc {heading: 'Tensors', subheading: 'Classes'} */\nexport class TensorBuffer {\n size: number;\n shape: ShapeMap[R];\n strides: number[];\n values: TypedArray;\n\n constructor(shape: ShapeMap[R], public dtype: DataType, values: TypedArray) {\n if (values != null) {\n const n = values.length;\n const size = util.sizeFromShape(shape);\n util.assert(\n n === size,\n `Length of values '${n}' does not match the size ` +\n `inferred by the shape '${size}'`);\n }\n this.shape = shape.slice();\n this.values =\n values || util.getTypedArrayFromDType(dtype, util.sizeFromShape(shape));\n this.strides = computeStrides(shape);\n this.size = util.sizeFromShape(shape);\n }\n\n /**\n * Sets a value in the buffer at a given location.\n *\n * @param value The value to set.\n * @param locs The location indices.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n set(value: number, ...locs: number[]) {\n if (locs.length === 0) {\n locs = [0];\n }\n util.assert(\n locs.length === this.rank,\n `The number of provided coordinates (${locs.length}) must ` +\n `match the rank (${this.rank})`);\n const index = this.locToIndex(locs);\n this.values[index] = value;\n }\n\n /**\n * Returns the value in the buffer at the provided location.\n *\n * @param locs The location indices.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n get(...locs: number[]): number {\n if (locs.length === 0) {\n locs = [0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.values[index];\n }\n\n locToIndex(locs: number[]): number {\n if (this.rank === 0) {\n return 0;\n } else if (this.rank === 1) {\n return locs[0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return index;\n }\n\n indexToLoc(index: number): number[] {\n if (this.rank === 0) {\n return [];\n } else if (this.rank === 1) {\n return [index];\n }\n const locs: number[] = new Array(this.shape.length);\n for (let i = 0; i < locs.length - 1; ++i) {\n locs[i] = Math.floor(index / this.strides[i]);\n index -= locs[i] * this.strides[i];\n }\n locs[locs.length - 1] = index;\n return locs;\n }\n\n get rank() {\n return this.shape.length;\n }\n\n /**\n * Creates an immutable `Tensor` object from the buffer.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n toTensor(): Tensor {\n return Tensor.make(this.shape, {values: this.values}, this.dtype);\n }\n}\n\nexport interface TensorTracker {\n registerTensor(t: Tensor): void;\n disposeTensor(t: Tensor): void;\n write(dataId: DataId, values: TypedArray): void;\n read(dataId: DataId): Promise;\n readSync(dataId: DataId): TypedArray;\n registerVariable(v: Variable): void;\n}\n\n/**\n * The Tensor class calls into this handler to delegate chaining operations.\n */\nexport interface OpHandler {\n cast(x: T, dtype: DataType): T;\n buffer(\n shape: ShapeMap[R], dtype: DataType,\n values?: TypedArray): TensorBuffer;\n print(x: T, verbose: boolean): void;\n reshape(x: Tensor, shape: ShapeMap[R2]): Tensor;\n expandDims(x: Tensor, axis: number): Tensor;\n cumsum(\n x: Tensor, axis: number, exclusive: boolean, reverse: boolean): T;\n squeeze(x: Tensor, axis?: number[]): T;\n clone(x: T): T;\n tile(x: T, reps: number[]): T;\n gather(x: T, indices: Tensor1D, axis: number): T;\n matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean):\n Tensor2D;\n dot(t1: Tensor, t2: Tensor): Tensor;\n norm(\n x: Tensor, ord: number|'euclidean'|'fro', axis: number|number[],\n keepDims: boolean): Tensor;\n slice>(\n x: T, begin: number|number[], size?: number|number[]): T;\n reverse(x: T, axis?: number|number[]): T;\n concat(tensors: T[], axis: number): T;\n stack(tensors: T[], axis: number): Tensor;\n unstack(value: T, axis: number): Tensor[];\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T;\n batchNormalization(\n x: Tensor, mean: Tensor|Tensor1D, variance: Tensor|Tensor1D,\n varianceEpsilon: number, scale?: Tensor|Tensor1D,\n offset?: Tensor|Tensor1D): Tensor;\n all(x: Tensor, axis: number|number[], keepDims: boolean): T;\n any(x: Tensor, axis: number|number[], keepDims: boolean): T;\n logSumExp(\n x: Tensor, axis: number|number[], keepDims: boolean): T;\n sum(x: Tensor, axis: number|number[], keepDims: boolean): T;\n mean(x: Tensor, axis: number|number[], keepDims: boolean):\n T;\n min(x: Tensor, axis: number|number[], keepDims: boolean): T;\n max(x: Tensor, axis: number|number[], keepDims: boolean): T;\n argMin(x: Tensor, axis: number): T;\n argMax(x: Tensor, axis: number): T;\n add(a: Tensor, b: Tensor): T;\n addStrict(a: T, b: T): T;\n sub(a: Tensor, b: Tensor): T;\n subStrict(a: T, b: T): T;\n pow(base: T, exp: Tensor): T;\n powStrict(base: T, exp: Tensor): T;\n mul(a: Tensor, b: Tensor): T;\n mulStrict(a: T, b: T): T;\n div(a: Tensor, b: Tensor): T;\n floorDiv(a: Tensor, b: Tensor): T;\n divStrict(a: T, b: T): T;\n mod(a: Tensor, b: Tensor): T;\n modStrict(a: T, b: T): T;\n minimum(a: Tensor, b: Tensor): T;\n minimumStrict(a: T, b: T): T;\n maximum(a: Tensor, b: Tensor): T;\n maximumStrict(a: T, b: T): T;\n squaredDifference(a: Tensor, b: Tensor): T;\n squaredDifferenceStrict(a: T, b: T): T;\n transpose(x: T, perm?: number[]): T;\n logicalNot(x: T): T;\n logicalAnd(a: Tensor, b: Tensor): T;\n logicalOr(a: Tensor, b: Tensor): T;\n logicalXor(a: Tensor, b: Tensor): T;\n where(condition: Tensor, a: T, b: T): T;\n notEqual(a: Tensor, b: Tensor): T;\n notEqualStrict(a: T, b: T): T;\n less(a: Tensor, b: Tensor): T;\n lessStrict(a: T, b: T): T;\n equal(a: Tensor, b: Tensor): T;\n equalStrict(a: T, b: T): T;\n lessEqual(a: Tensor, b: Tensor): T;\n lessEqualStrict(a: T, b: T): T;\n greater(a: Tensor, b: Tensor): T;\n greaterStrict(a: T, b: T): T;\n greaterEqual(a: Tensor, b: Tensor): T;\n greaterEqualStrict(a: T, b: T): T;\n neg(x: T): T;\n ceil(x: T): T;\n floor(x: T): T;\n sign(x: T): T;\n round(x: T): T;\n exp(x: T): T;\n expm1(x: T): T;\n log(x: T): T;\n log1p(x: T): T;\n sqrt(x: T): T;\n rsqrt(x: T): T;\n square(x: T): T;\n reciprocal(x: T): T;\n abs(x: T): T;\n clipByValue(\n x: T, clipValueMin: number, clipValueMax: number): T;\n sigmoid(x: T): T;\n logSigmoid(x: T): T;\n softplus(x: T): T;\n sin(x: T): T;\n cos(x: T): T;\n tan(x: T): T;\n asin(x: T): T;\n acos(x: T): T;\n atan(x: T): T;\n sinh(x: T): T;\n cosh(x: T): T;\n tanh(x: T): T;\n asinh(x: T): T;\n acosh(x: T): T;\n atanh(x: T): T;\n erf(x: T): T;\n step(x: T, alpha: number): T;\n relu(x: T): T;\n elu(x: T): T;\n selu(x: T): T;\n leakyRelu(x: T, alpha: number): T;\n prelu(x: T, alpha: T): T;\n softmax(logits: T, dim: number): T;\n image: {\n resizeBilinear(\n images: T, size: [number, number], alignCorners: boolean): T;\n resizeNearestNeighbor(\n images: T, size: [number, number], alignCorners: boolean): T;\n };\n conv1d(\n x: T, filter: Tensor3D, stride: number, pad: 'valid'|'same'|number,\n dataFormat: 'NWC'|'NCW', dilation: number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n conv2d(\n x: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW',\n dilations: [number, number]|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n conv2dTranspose(\n x: T, filter: Tensor4D,\n outputShape: [number, number, number, number]|[number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n depthwiseConv2d(\n x: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW',\n dilations: [number, number]|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n maxPool(\n x: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n avgPool(\n x: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T;\n localResponseNormalization(\n x: T, depthRadius: number, bias: number, alpha: number, beta: number): T;\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): T;\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T;\n spaceToBatchND(\n x: T, blockShape: number[], paddings: number[][]): T;\n}\n\n// For tracking tensor creation and disposal.\nlet trackerFn: () => TensorTracker = null;\n// Used by chaining methods to call into ops.\nlet opHandler: OpHandler = null;\n\n/**\n * An external consumer can register itself as the tensor tracker. This way\n * the Tensor class can notify the tracker for every tensor created and\n * disposed.\n */\nexport function setTensorTracker(fn: () => TensorTracker) {\n trackerFn = fn;\n}\n\n/**\n * An external consumer can register itself as the op handler. This way the\n * Tensor class can have chaining methods that call into ops via the op handler.\n */\nexport function setOpHandler(handler: OpHandler) {\n opHandler = handler;\n}\n\n/**\n * We wrap data id since we use weak map to avoid memory leaks.\n * Since we have our own memory management, we have a reference counter\n * mapping a tensor to its data, so there is always a pointer (even if that\n * data is otherwise garbage collectable).\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/\n * Global_Objects/WeakMap\n */\nexport type DataId = object; // object instead of {} to force non-primitive.\n\n/**\n * A `Tensor` object represents an immutable, multidimensional array of numbers\n * that has a shape and a data type.\n *\n * See `tensor` for details on how to create a `Tensor`.\n */\n/** @doc {heading: 'Tensors', subheading: 'Classes'} */\nexport class Tensor {\n private static nextId = 0;\n\n /** Unique id of this tensor. */\n readonly id: number;\n /**\n * Id of the bucket holding the data for this tensor. Multiple arrays can\n * point to the same bucket (e.g. when calling array.reshape()).\n */\n dataId: DataId;\n /** The shape of the tensor. */\n readonly shape: ShapeMap[R];\n /** Number of elements in the tensor. */\n readonly size: number;\n /** The data type for the array. */\n readonly dtype: DataType;\n /** The rank type for the array (see `Rank` enum). */\n readonly rankType: R;\n\n /**\n * Number of elements to skip in each dimension when indexing. See\n * https://docs.scipy.org/doc/numpy/reference/generated/\\\n * numpy.ndarray.strides.html\n */\n readonly strides: number[];\n\n protected constructor(\n shape: ShapeMap[R], dtype: DataType, values?: TypedArray,\n dataId?: DataId) {\n this.size = util.sizeFromShape(shape);\n if (values != null) {\n util.assert(\n this.size === values.length,\n `Constructing tensor of shape (${this.size}) should match the ` +\n `length of values (${values.length})`);\n }\n this.shape = shape.slice();\n this.dtype = dtype || 'float32';\n this.strides = computeStrides(shape);\n this.dataId = dataId != null ? dataId : {};\n this.id = Tensor.nextId++;\n this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher') as R;\n trackerFn().registerTensor(this);\n if (values != null) {\n trackerFn().write(this.dataId, values);\n }\n }\n\n /**\n * Makes a new tensor with the provided shape and values. Values should be in\n * a flat array.\n */\n static make, D extends DataType = 'float32',\n R extends Rank = Rank>(\n shape: ShapeMap[R], data: TensorData, dtype?: D): T {\n return new Tensor(shape, dtype, data.values, data.dataId) as T;\n }\n\n /** Flatten a Tensor to a 1D array. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n flatten(): Tensor1D {\n this.throwIfDisposed();\n return this.as1D();\n }\n\n /** Converts a size-1 `Tensor` to a `Scalar`. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n asScalar(): Scalar {\n this.throwIfDisposed();\n util.assert(this.size === 1, 'The array must have only 1 element.');\n return this.reshape([]);\n }\n\n /** Converts a `Tensor` to a `Tensor1D`. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as1D(): Tensor1D {\n this.throwIfDisposed();\n return this.reshape([this.size]);\n }\n\n /**\n * Converts a `Tensor` to a `Tensor2D`.\n *\n * @param rows Number of rows in `Tensor2D`.\n * @param columns Number of columns in `Tensor2D`.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as2D(rows: number, columns: number): Tensor2D {\n this.throwIfDisposed();\n return this.reshape([rows, columns]);\n }\n\n /**\n * Converts a `Tensor` to a `Tensor3D`.\n *\n * @param rows Number of rows in `Tensor3D`.\n * @param columns Number of columns in `Tensor3D`.\n * @param depth Depth of `Tensor3D`.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as3D(rows: number, columns: number, depth: number): Tensor3D {\n this.throwIfDisposed();\n return this.reshape([rows, columns, depth]);\n }\n\n /**\n * Converts a `Tensor` to a `Tensor4D`.\n *\n * @param rows Number of rows in `Tensor4D`.\n * @param columns Number of columns in `Tensor4D`.\n * @param depth Depth of `Tensor4D`.\n * @param depth2 4th dimension of `Tensor4D`.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n as4D(rows: number, columns: number, depth: number, depth2: number): Tensor4D {\n this.throwIfDisposed();\n return this.reshape([rows, columns, depth, depth2]);\n }\n\n /**\n * Casts a `Tensor` to a specified dtype.\n *\n * @param dtype Data-type to cast the tensor to.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n asType(this: T, dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this, dtype) as T;\n }\n\n get rank(): number {\n return this.shape.length;\n }\n\n /**\n * Returns the value in the tensor at the provided location.\n * If using WebGL backend, this is a blocking call.\n * Prefer calling the `async data()[flatIndex]` method instead.\n *\n * @param locs The location indices.\n */\n get(...locs: number[]) {\n util.assert(\n locs.length === this.rank,\n 'Number of coordinates in get() must match the rank of the tensor');\n this.throwIfDisposed();\n if (locs.length === 0) {\n locs = [0];\n }\n let index = locs[locs.length - 1];\n for (let i = 0; i < locs.length - 1; ++i) {\n index += this.strides[i] * locs[i];\n }\n return this.dataSync()[index];\n }\n\n /** Returns a `TensorBuffer` that holds the underlying data. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n buffer(): TensorBuffer {\n return opHandler.buffer(this.shape, this.dtype, this.dataSync());\n }\n\n /**\n * Asynchronously downloads the values from the `Tensor`. Returns a promise of\n * `TypedArray` that resolves when the computation has finished.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n async data(): Promise {\n this.throwIfDisposed();\n return trackerFn().read(this.dataId);\n }\n\n /**\n * Synchronously downloads the values from the `Tensor`. This blocks the UI\n * thread until the values are ready, which can cause performance issues.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n dataSync(): TypedArray {\n this.throwIfDisposed();\n return trackerFn().readSync(this.dataId);\n }\n\n /**\n * Disposes `Tensor` from memory.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n trackerFn().disposeTensor(this);\n this.isDisposedInternal = true;\n }\n\n private isDisposedInternal = false;\n get isDisposed(): boolean {\n return this.isDisposedInternal;\n }\n\n private throwIfDisposed() {\n if (this.isDisposed) {\n throw new Error(`Tensor is disposed.`);\n }\n }\n\n /** Casts the array to type `float32` */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toFloat(this: T): T {\n return this.asType('float32');\n }\n\n /** Casts the array to type `int32` */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toInt() {\n return this.asType('int32');\n }\n\n /** Casts the array to type `bool` */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toBool() {\n return this.asType('bool');\n }\n\n /**\n * Prints the `Tensor`. See `print` for details.\n *\n * @param verbose Whether to print verbose information about the tensor,\n * including dtype and size.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n print(verbose = false): void {\n return opHandler.print(this, verbose);\n }\n\n /**\n * Reshapes the tensor into the provided shape.\n * See `reshape` for more details.\n *\n * @param newShape An array of integers defining the output tensor shape.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n reshape(newShape: ShapeMap[R2]): Tensor {\n this.throwIfDisposed();\n return opHandler.reshape(this, newShape);\n }\n\n /**\n * Reshapes the tensor into the shape of the provided tensor.\n *\n * @param x The tensor of required shape.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n reshapeAs(x: T): T {\n this.throwIfDisposed();\n return this.reshape(x.shape) as T;\n }\n\n /**\n * Returns a `Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape. See `expandDims` for details.\n *\n * @param axis The dimension index at which to insert shape of 1. Defaults to\n * 0 (the first dimension).\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n expandDims(axis = 0): Tensor {\n return opHandler.expandDims(this, axis);\n }\n\n /**\n * Returns the cumulative sum of the `Tensor` along `axis`.\n *\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Defaults to\n * false. If set to true then the sum of each tensor entry does not include\n * its own value, but only the values previous to it along the specified\n * axis.\n * @param reverse Whether to sum in the opposite direction. Defaults to\n * false.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n cumsum(axis = 0, exclusive = false, reverse = false): T {\n return opHandler.cumsum(this, axis, exclusive, reverse);\n }\n\n /**\n * Returns a `Tensor` with dimensions of size 1 removed from the shape.\n * See `squeeze` for more details.\n *\n * @param axis A list of numbers. If specified, only squeezes the\n * dimensions listed. The dimension index starts at 0. It is an error to\n * squeeze a dimension that is not 1.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n squeeze(axis?: number[]): T {\n this.throwIfDisposed();\n return opHandler.squeeze(this, axis);\n }\n\n /** Returns a copy of the tensor. See `clone` for details. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n clone(this: T): T {\n this.throwIfDisposed();\n return opHandler.clone(this);\n }\n\n /** Returns a human-readable description of the tensor. Useful for logging. */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n toString(verbose = false): string {\n const vals = this.dataSync();\n return tensorToString(vals, this.shape, this.dtype, verbose);\n }\n\n // Below is chain API that is not exposed to docs to avoid repetition. To\n // expose a method, move it above this comment and add @doc and jsdoc.\n\n tile(this: T, reps: number[]): T {\n this.throwIfDisposed();\n return opHandler.tile(this, reps) as T;\n }\n\n gather(this: T, indices: Tensor1D, axis = 0): T {\n this.throwIfDisposed();\n return opHandler.gather(this, indices, axis) as T;\n }\n\n matMul(b: Tensor2D, transposeA = false, transposeB = false): Tensor2D {\n this.throwIfDisposed();\n return opHandler.matMul(this as Tensor2D, b, transposeA, transposeB);\n }\n dot(b: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.dot(this, b);\n }\n norm(\n ord: number|'euclidean'|'fro' = 'euclidean', axis: number|number[] = null,\n keepDims = false): Tensor {\n this.throwIfDisposed();\n return opHandler.norm(this, ord, axis, keepDims);\n }\n slice>(\n this: T, begin: number|number[], size?: number|number[]): T {\n this.throwIfDisposed();\n return opHandler.slice(this, begin, size);\n }\n reverse(this: T, axis?: number|number[]): T {\n this.throwIfDisposed();\n return opHandler.reverse(this, axis);\n }\n concat(this: T, x: T, axis = 0): T {\n this.throwIfDisposed();\n return opHandler.concat([this, x], axis);\n }\n stack(x: Tensor, axis = 0): Tensor {\n return opHandler.stack([this, x], axis);\n }\n unstack(x: Tensor, axis = 0): Tensor[] {\n return opHandler.unstack(this, axis);\n }\n pad(\n this: T, paddings: Array<[number, number]>, constantValue = 0): T {\n return opHandler.pad(this, paddings, constantValue);\n }\n batchNormalization(\n mean: Tensor|Tensor1D, variance: Tensor|Tensor1D,\n varianceEpsilon = .001, scale?: Tensor|Tensor1D,\n offset?: Tensor|Tensor1D): Tensor {\n this.throwIfDisposed();\n return opHandler.batchNormalization(\n this, mean, variance, varianceEpsilon, scale, offset);\n }\n\n // Reduction ops.\n all(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.all(this, axis, keepDims);\n }\n any(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.any(this, axis, keepDims);\n }\n logSumExp(axis: number|number[] = null, keepDims = false):\n T {\n this.throwIfDisposed();\n return opHandler.logSumExp(this, axis, keepDims);\n }\n sum(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.sum(this, axis, keepDims);\n }\n mean(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.mean(this, axis, keepDims);\n }\n min(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.min(this, axis, keepDims);\n }\n max(axis: number|number[] = null, keepDims = false): T {\n this.throwIfDisposed();\n return opHandler.max(this, axis, keepDims);\n }\n argMin(axis: number = null): T {\n this.throwIfDisposed();\n return opHandler.argMin(this, axis);\n }\n argMax(axis: number = null): T {\n this.throwIfDisposed();\n return opHandler.argMax(this, axis);\n }\n\n // Transformations\n cast(dtype: DataType): T {\n this.throwIfDisposed();\n return opHandler.cast(this as T, dtype) as T;\n }\n\n // Binary ops.\n\n add(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.add(this, x);\n }\n addStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.addStrict(this, x) as T;\n }\n sub(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.sub(this, x);\n }\n subStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.subStrict(this, x) as T;\n }\n pow(this: T, exp: Tensor): T {\n this.throwIfDisposed();\n return opHandler.pow(this, exp);\n }\n powStrict(exp: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.powStrict(this, exp);\n }\n mul(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.mul(this, x);\n }\n mulStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.mulStrict(this, x) as T;\n }\n div(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.div(this, x);\n }\n floorDiv(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.floorDiv(this, x);\n }\n divStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.divStrict(this, x) as T;\n }\n minimum(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.minimum(this, x);\n }\n minimumStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.minimumStrict(this, x) as T;\n }\n maximum(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.maximum(this, x);\n }\n maximumStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.maximumStrict(this, x) as T;\n }\n mod(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.mod(this, x);\n }\n modStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.modStrict(this, x) as T;\n }\n squaredDifference(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.squaredDifference(this, x);\n }\n squaredDifferenceStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.squaredDifferenceStrict(this, x) as T;\n }\n transpose(this: T, perm?: number[]): T {\n this.throwIfDisposed();\n return opHandler.transpose(this, perm);\n }\n\n // Compare ops.\n\n notEqual(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.notEqual(this, x);\n }\n notEqualStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.notEqualStrict(this, x) as T;\n }\n less(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.less(this, x);\n }\n lessStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.lessStrict(this, x) as T;\n }\n equal(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.equal(this, x);\n }\n equalStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.equalStrict(this, x) as T;\n }\n lessEqual(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.lessEqual(this, x);\n }\n lessEqualStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.lessEqualStrict(this, x) as T;\n }\n greater(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.greater(this, x);\n }\n greaterStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.greaterStrict(this, x) as T;\n }\n greaterEqual(x: Tensor): T {\n this.throwIfDisposed();\n return opHandler.greaterEqual(this, x);\n }\n greaterEqualStrict(this: T, x: T): T {\n this.throwIfDisposed();\n return opHandler.greaterEqualStrict(this, x) as T;\n }\n\n // Compare ops.\n logicalAnd(x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.logicalAnd(this, x);\n }\n logicalOr(x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.logicalOr(this, x);\n }\n logicalNot(this: T): T {\n this.throwIfDisposed();\n return opHandler.logicalNot(this);\n }\n logicalXor(x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.logicalXor(this, x);\n }\n where(condition: Tensor, x: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.where(condition, this, x);\n }\n\n // Unary ops.\n neg(this: T): T {\n this.throwIfDisposed();\n return opHandler.neg(this);\n }\n ceil(this: T): T {\n this.throwIfDisposed();\n return opHandler.ceil(this);\n }\n floor(this: T): T {\n this.throwIfDisposed();\n return opHandler.floor(this);\n }\n sign(this: T): T {\n this.throwIfDisposed();\n return opHandler.sign(this);\n }\n exp(this: T): T {\n this.throwIfDisposed();\n return opHandler.exp(this);\n }\n expm1(this: T): T {\n this.throwIfDisposed();\n return opHandler.expm1(this);\n }\n log(this: T): T {\n this.throwIfDisposed();\n return opHandler.log(this);\n }\n log1p(this: T): T {\n this.throwIfDisposed();\n return opHandler.log1p(this);\n }\n sqrt(this: T): T {\n this.throwIfDisposed();\n return opHandler.sqrt(this);\n }\n rsqrt(this: T): T {\n this.throwIfDisposed();\n return opHandler.rsqrt(this);\n }\n square(this: T): T {\n this.throwIfDisposed();\n return opHandler.square(this);\n }\n reciprocal(this: T): T {\n this.throwIfDisposed();\n return opHandler.reciprocal(this);\n }\n abs(this: T): T {\n this.throwIfDisposed();\n return opHandler.abs(this);\n }\n clipByValue(min: number, max: number): Tensor {\n this.throwIfDisposed();\n return opHandler.clipByValue(this, min, max);\n }\n relu(this: T): T {\n this.throwIfDisposed();\n return opHandler.relu(this);\n }\n elu(this: T): T {\n this.throwIfDisposed();\n return opHandler.elu(this);\n }\n selu(this: T): T {\n this.throwIfDisposed();\n return opHandler.selu(this);\n }\n leakyRelu(alpha = 0.2): Tensor {\n this.throwIfDisposed();\n return opHandler.leakyRelu(this, alpha);\n }\n prelu(alpha: Tensor): Tensor {\n this.throwIfDisposed();\n return opHandler.prelu(this, alpha);\n }\n sigmoid(this: T): T {\n this.throwIfDisposed();\n return opHandler.sigmoid(this);\n }\n logSigmoid(this: T): T {\n this.throwIfDisposed();\n return opHandler.logSigmoid(this);\n }\n softplus(this: T): T {\n this.throwIfDisposed();\n return opHandler.softplus(this);\n }\n sin(this: T): T {\n this.throwIfDisposed();\n return opHandler.sin(this);\n }\n cos(this: T): T {\n this.throwIfDisposed();\n return opHandler.cos(this);\n }\n tan(this: T): T {\n this.throwIfDisposed();\n return opHandler.tan(this);\n }\n asin(this: T): T {\n this.throwIfDisposed();\n return opHandler.asin(this);\n }\n acos(this: T): T {\n this.throwIfDisposed();\n return opHandler.acos(this);\n }\n atan(this: T): T {\n this.throwIfDisposed();\n return opHandler.atan(this);\n }\n sinh(this: T): T {\n this.throwIfDisposed();\n return opHandler.sinh(this);\n }\n cosh(this: T): T {\n this.throwIfDisposed();\n return opHandler.cosh(this);\n }\n tanh(this: T): T {\n this.throwIfDisposed();\n return opHandler.tanh(this);\n }\n asinh(this: T): T {\n this.throwIfDisposed();\n return opHandler.asinh(this);\n }\n acosh(this: T): T {\n this.throwIfDisposed();\n return opHandler.acosh(this);\n }\n atanh(this: T): T {\n this.throwIfDisposed();\n return opHandler.atanh(this);\n }\n erf(this: T): T {\n this.throwIfDisposed();\n return opHandler.erf(this);\n }\n round(this: T): T {\n this.throwIfDisposed();\n return opHandler.round(this);\n }\n step(this: T, alpha = 0.0): T {\n this.throwIfDisposed();\n return opHandler.step(this, alpha);\n }\n softmax(this: T, dim = -1): T {\n this.throwIfDisposed();\n return opHandler.softmax(this, dim) as T;\n }\n\n // Image ops.\n resizeBilinear(\n this: T, newShape2D: [number, number], alignCorners = false): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.image.resizeBilinear(this, newShape2D, alignCorners);\n }\n\n resizeNearestNeighbor(\n this: T, newShape2D: [number, number], alignCorners = false): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.image.resizeNearestNeighbor(\n this, newShape2D, alignCorners);\n }\n\n // Convolutions.\n conv1d(\n this: T, filter: Tensor3D, stride: number, pad: 'valid'|'same'|number,\n dataFormat: 'NWC'|'NCW' = 'NWC', dilation = 1,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.conv1d(\n this, filter, stride, pad, dataFormat, dilation, dimRoundingMode);\n }\n conv2d(\n this: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.conv2d(\n this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n }\n conv2dTranspose(\n this: T, filter: Tensor4D,\n outputShape: [number, number, number, number]|[number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.conv2dTranspose(\n this, filter, outputShape, strides, pad, dimRoundingMode);\n }\n depthwiseConv2D(\n this: T, filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.depthwiseConv2d(\n this, filter, strides, pad, dataFormat, dilations, dimRoundingMode);\n }\n\n // Pooling.\n avgPool(\n this: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.avgPool(this, filterSize, strides, pad, dimRoundingMode);\n }\n maxPool(\n this: T, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n (this as Tensor).throwIfDisposed();\n return opHandler.maxPool(this, filterSize, strides, pad, dimRoundingMode);\n }\n localResponseNormalization(\n this: T, radius = 5, bias = 1, alpha = 1, beta = 0.5): T {\n return opHandler.localResponseNormalization(\n this, radius, bias, alpha, beta);\n }\n\n variable(trainable = true, name?: string, dtype?: DataType): Variable {\n this.throwIfDisposed();\n return Variable.variable(this, trainable, name, dtype);\n }\n\n unsortedSegmentSum(\n this: T, segmentIds: Tensor1D, numSegments: number): T {\n this.throwIfDisposed();\n return opHandler.unsortedSegmentSum(this, segmentIds, numSegments);\n }\n\n batchToSpaceND(\n this: T, blockShape: number[], crops: number[][]): T {\n this.throwIfDisposed();\n return opHandler.batchToSpaceND(this, blockShape, crops);\n }\n\n spaceToBatchND(\n this: T, blockShape: number[], paddings: number[][]): T {\n this.throwIfDisposed();\n return opHandler.spaceToBatchND(this, blockShape, paddings);\n }\n}\nObject.defineProperty(Tensor, Symbol.hasInstance, {\n value: (instance: Tensor) => {\n return !!instance && instance.shape != null && instance.dtype != null;\n }\n});\n\n/** @doclink Tensor */\nexport type Scalar = Tensor;\n/** @doclink Tensor */\nexport type Tensor1D = Tensor;\n/** @doclink Tensor */\nexport type Tensor2D = Tensor;\n/** @doclink Tensor */\nexport type Tensor3D = Tensor;\n/** @doclink Tensor */\nexport type Tensor4D = Tensor;\n/** @doclink Tensor */\nexport type Tensor5D = Tensor;\n/** @doclink Tensor */\nexport type Tensor6D = Tensor;\n\n/**\n * A mutable `Tensor`, useful for persisting state, e.g. for training.\n */\n/** @doc {heading: 'Tensors', subheading: 'Classes'} */\nexport class Variable extends Tensor {\n private static nextVarId = 0;\n name: string;\n\n /**\n * Private constructor since we can not add logic before calling `super()`.\n * Instead, we expose static `Variable.variable` method below, which will be\n * added to global namespace.\n */\n private constructor(\n initialValue: Tensor, public trainable = true, name?: string) {\n super(\n initialValue.shape, initialValue.dtype, null /* values */,\n initialValue.dataId);\n this.name = name;\n if (this.name == null) {\n this.name = Variable.nextVarId.toString();\n Variable.nextVarId++;\n }\n try {\n trackerFn().registerVariable(this);\n } catch (ex) {\n trackerFn().disposeTensor(this);\n throw ex;\n }\n }\n\n /**\n * Creates a new variable with the provided initial value.\n * ```js\n * const x = tf.variable(tf.tensor([1, 2, 3]));\n * x.assign(tf.tensor([4, 5, 6]));\n *\n * x.print();\n * ```\n *\n * @param initialValue Initial value for the tensor.\n * @param trainable If true, optimizers are allowed to update it.\n * @param name Name of the variable. Defaults to a unique id.\n * @param dtype If set, initialValue will be converted to the given type.\n */\n /** @doc {heading: 'Tensors', subheading: 'Creation'} */\n static variable(\n initialValue: Tensor, trainable = true, name?: string,\n dtype?: DataType): Variable {\n if (dtype != null && dtype !== initialValue.dtype) {\n initialValue = initialValue.asType(dtype) as Tensor;\n }\n return new Variable(initialValue, trainable, name);\n }\n\n /**\n * Assign a new `Tensor` to this variable. The new `Tensor` must have the\n * same shape and dtype as the old `Tensor`.\n *\n * @param newValue New tensor to be assigned to this variable.\n */\n /** @doc {heading: 'Tensors', subheading: 'Classes'} */\n assign(newValue: Tensor): void {\n if (newValue.dtype !== this.dtype) {\n throw new Error(\n `dtype of the new value (${newValue.dtype}) and ` +\n `previous value (${this.dtype}) must match`);\n }\n if (!util.arraysEqual(newValue.shape, this.shape)) {\n throw new Error(\n `shape of the new value (${newValue.shape}) and ` +\n `previous value (${this.shape}) must match`);\n }\n trackerFn().disposeTensor(this);\n this.dataId = newValue.dataId;\n trackerFn().registerTensor(this);\n }\n}\nObject.defineProperty(Variable, Symbol.hasInstance, {\n value: (instance: Variable) => {\n return instance instanceof Tensor && instance.assign != null &&\n instance.assign instanceof Function;\n }\n});\n\nconst variable = Variable.variable;\nexport {variable};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap, TensorContainer, TensorContainerArray} from './tensor_types';\nimport {assert} from './util';\n\nexport function assertTypesMatch(a: Tensor, b: Tensor): void {\n assert(\n a.dtype === b.dtype,\n ` The dtypes of the first(${a.dtype}) and` +\n ` second(${b.dtype}) input must match`);\n}\n\nexport function isTensorInList(tensor: Tensor, tensorList: Tensor[]): boolean {\n for (let i = 0; i < tensorList.length; i++) {\n if (tensorList[i].id === tensor.id) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenNameArrayMap(\n nameArrayMap: Tensor|NamedTensorMap, keys?: string[]): Tensor[] {\n const xs: Tensor[] = [];\n if (nameArrayMap instanceof Tensor) {\n xs.push(nameArrayMap);\n } else {\n const xMap = nameArrayMap as {[xName: string]: Tensor};\n for (let i = 0; i < keys.length; i++) {\n xs.push(xMap[keys[i]]);\n }\n }\n return xs;\n}\n\nexport function unflattenToNameArrayMap(\n keys: string[], flatArrays: Tensor[]): NamedTensorMap {\n if (keys.length !== flatArrays.length) {\n throw new Error(\n `Cannot unflatten Tensor[], keys and arrays are not of same length.`);\n }\n const result: NamedTensorMap = {};\n for (let i = 0; i < keys.length; i++) {\n result[keys[i]] = flatArrays[i];\n }\n return result;\n}\n\n/**\n * Extracts any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it\n * is safe to pass any object here, except that `Promise`s are not\n * supported.\n * @returns An array of `Tensors` found within the passed object. If the\n * argument is simply a `Tensor', a list containing that `Tensor` is\n * returned. If the object is not a `Tensor` or does not\n * contain `Tensors`, an empty list is returned.\n */\nexport function getTensorsInContainer(result: TensorContainer): Tensor[] {\n const list: Tensor[] = [];\n const seen = new Set<{}|void>();\n walkTensorContainer(result, list, seen);\n return list;\n}\n\nfunction walkTensorContainer(\n container: TensorContainer, list: Tensor[], seen: Set<{}|void>): void {\n if (container == null) {\n return;\n }\n if (container instanceof Tensor) {\n list.push(container);\n return;\n }\n if (!isIterable(container)) {\n return;\n }\n // Iteration over keys works also for arrays.\n const iterable = container as TensorContainerArray;\n for (const k in iterable) {\n const val = iterable[k];\n if (!seen.has(val)) {\n seen.add(val);\n walkTensorContainer(val, list, seen);\n }\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction isIterable(obj: any): boolean {\n return Array.isArray(obj) || typeof obj === 'object';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {BackendTimingInfo, KernelBackend} from './kernels/backend';\nimport {Profiler} from './profiler';\nimport {backpropagateGradients, getFilteredNodesXToY, NamedGradientMap, TapeNode} from './tape';\nimport {DataId, Tensor, Tensor3D, Variable} from './tensor';\nimport {NamedTensorMap, NamedVariableMap, TensorContainer} from './tensor_types';\nimport {getTensorsInContainer, isTensorInList} from './tensor_util';\nimport {TypedArray} from './types';\nimport * as util from './util';\nimport {makeOnesTypedArray, now, sizeFromShape} from './util';\n\n/**\n * A function that computes an output. The save function is for saving tensors\n * computed in the forward pass, that we need in the backwards pass.\n */\nexport type ForwardFunc =\n (backend: KernelBackend, save?: (tensor: S) => S) => T;\n\n/**\n * @docalias (a: Tensor, b: Tensor,...) => {\n * value: Tensor, * gradFunc: (dy: Tensor) => Tensor | Tensor[] * }\n */\nexport type CustomGradientFunc = (...args: Tensor[]) => {\n value: T, gradFunc: (dy: T) => Tensor | Tensor[];\n};\n\nexport type MemoryInfo = {\n numTensors: number; numDataBuffers: number; numBytes: number;\n unreliable?: boolean;\n};\n\nexport interface TimingInfo extends BackendTimingInfo {\n wallMs: number;\n}\n\n/** @docalias Function */\nexport type ScopeFn = () => T;\n\nexport interface TensorManager {\n registerTensor(a: Tensor): void;\n registerVariable(v: Variable): void;\n disposeTensor(a: Tensor): void;\n memory(): {numDataBuffers: number; numBytes: number;};\n}\n\ninterface ScopeState {\n track: Tensor[];\n name: string;\n}\n\nexport class Engine implements TensorManager {\n // Public since optimizers will use it.\n registeredVariables: NamedVariableMap = {};\n\n private refCounter = new WeakMap();\n private nextTapeNodeId = 0;\n private numBytes = 0;\n private numTensors = 0;\n private numDataBuffers = 0;\n\n private activeTape: TapeNode[];\n private gradientScopeCount = 0;\n private customGradientDepth = 0;\n\n // Keep Tensors that parallel the tapes.\n private activeScope: ScopeState;\n private scopeStack: ScopeState[];\n private keepTensors: Set = new Set();\n private profiler: Profiler;\n\n constructor(\n private backend: KernelBackend, public safeMode: boolean,\n private debugMode: () => boolean) {\n // Create a default outer scope.\n this.activeScope = {track: [], name: 'default scope'};\n this.scopeStack = [this.activeScope];\n this.profiler = new Profiler(backend);\n }\n\n tidy(\n nameOrFn: string|ScopeFn, fn?: ScopeFn, gradMode = false): T {\n // gradMode Primarily for internal use during backprop\n // If true, will start a tape if it is the outermost tidy.\n\n let name: string = null;\n if (fn == null) {\n // Called with only 1 argument.\n if (typeof nameOrFn !== 'function') {\n throw new Error('Please provide a function to tidy()');\n }\n fn = nameOrFn;\n } else {\n // Called with 2 arguments.\n if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {\n throw new Error(\n 'When calling with two arguments, the first argument ' +\n 'to tidy() must be a string');\n }\n if (typeof fn !== 'function') {\n throw new Error(\n 'When calling with two arguments, the 2nd argument ' +\n 'to tidy() must be a function');\n }\n name = nameOrFn as string;\n // TODO(nsthorat,smilkov): Do operation logging and performance\n // profiling.\n }\n let result: T;\n return this.scopedRun(\n () => this.startScope(name, gradMode),\n () => this.endScope(result, gradMode), () => {\n result = fn();\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n return result;\n });\n }\n\n private scopedRun(start: () => void, end: () => void, f: () => T): T {\n start();\n try {\n const res = f();\n end();\n return res;\n } catch (ex) {\n end();\n throw ex;\n }\n }\n\n runKernel(\n forwardFunc: ForwardFunc,\n inputs: I,\n backwardsFunc?: (dy: T, saved: Tensor[]) => {[P in keyof I]: () => I[P]},\n ): T {\n let result: T;\n const saved: Tensor[] = [];\n const saveFunc = (x: T): T => {\n saved.push(x);\n return x;\n };\n const scopeName = this.activeScope.name;\n\n // Stop recording to a tape when running a kernel.\n this.scopedRun(\n () => this.customGradientDepth++, () => this.customGradientDepth--,\n () => {\n if (!this.debugMode()) {\n result = forwardFunc(this.backend, saveFunc);\n } else {\n result = this.profiler.profileKernel(\n scopeName, () => forwardFunc(this.backend, saveFunc));\n }\n });\n\n if (this.shouldRecord()) {\n const tapeNode: TapeNode = {\n id: this.nextTapeNodeId++,\n name: scopeName,\n inputs,\n // Keep gradient records only for the first output.\n output: Array.isArray(result) ? result[0] : result\n };\n if (backwardsFunc != null) {\n tapeNode.gradient =\n ((dy: T) => backwardsFunc(dy, saved)) as (dy: Tensor) =>\n NamedGradientMap;\n }\n this.activeTape.push(tapeNode);\n }\n return result;\n }\n\n // TensorManager implementation.\n\n registerTensor(a: Tensor|Variable): void {\n const refCount =\n this.refCounter.has(a.dataId) ? this.refCounter.get(a.dataId) : 0;\n this.numTensors++;\n if (refCount === 0) {\n this.numDataBuffers++;\n this.numBytes +=\n util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype);\n this.backend.register(a.dataId, a.shape, a.dtype);\n }\n this.refCounter.set(a.dataId, refCount + 1);\n if (!(a instanceof Variable)) {\n this.track(a);\n }\n }\n\n registerVariable(v: Variable) {\n if (this.registeredVariables[v.name] != null) {\n throw new Error(`Variable with name ${v.name} was already registered`);\n }\n this.registeredVariables[v.name] = v;\n }\n\n disposeTensor(a: Tensor): void {\n if (!this.refCounter.has(a.dataId)) {\n return;\n }\n if (this.keepTensors.has(a.id)) {\n this.keepTensors.delete(a.id);\n }\n this.numTensors--;\n const refCount = this.refCounter.get(a.dataId);\n if (refCount <= 1) {\n this.refCounter.delete(a.dataId);\n this.backend.disposeData(a.dataId);\n this.numDataBuffers--;\n this.numBytes -=\n util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype);\n } else {\n this.refCounter.set(a.dataId, refCount - 1);\n }\n // TODO(nsthorat): Construct an error and save the stack trace for\n // debugging when in debug mode. Creating a stack trace is too expensive\n // to do unconditionally.\n }\n\n disposeVariables(): void {\n for (const varName in this.registeredVariables) {\n const v = this.registeredVariables[varName];\n this.disposeTensor(v);\n delete this.registeredVariables[varName];\n }\n }\n\n memory(): MemoryInfo {\n const info = this.backend.memory() as MemoryInfo;\n info.numTensors = this.numTensors;\n info.numDataBuffers = this.numDataBuffers;\n info.numBytes = this.numBytes;\n return info;\n }\n\n private shouldRecord(): boolean {\n return this.activeTape != null && this.customGradientDepth === 0;\n }\n\n private addTapeNode(\n inputs: Tensor[], result: Tensor,\n gradientsFunc: (dy: Tensor) => Tensor[]): void {\n const inputsMap: NamedTensorMap = {};\n inputs.forEach((input, idx) => {\n inputsMap[idx] = input;\n });\n\n const gradient = (dy: Tensor) => {\n const res = gradientsFunc(dy);\n const resMap: NamedGradientMap = {};\n res.forEach((r, idx) => {\n resMap[idx] = () => r;\n });\n return resMap;\n };\n\n const tapeNode: TapeNode = {\n id: this.nextTapeNodeId++,\n name: this.activeScope.name,\n inputs: inputsMap,\n output: result,\n gradient\n };\n this.activeTape.push(tapeNode);\n }\n\n keep(result: T): T {\n if (this.scopeStack.length === 1 && this.safeMode) {\n throw new Error(\n 'Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' +\n 'tf.tidy(() => {...}) to avoid memory leaks.');\n }\n this.keepTensors.add(result.id);\n return result;\n }\n\n /**\n * Start a scope. Use this with endScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n startScope(name?: string, gradientsMode = false) {\n if (gradientsMode && this.gradientScopeCount === 0) {\n this.activeTape = [];\n }\n if (gradientsMode) {\n this.gradientScopeCount++;\n }\n\n const scopeInfo: ScopeState = {track: [], name: 'unnamed scope'};\n if (name) {\n scopeInfo.name = name;\n }\n this.scopeStack.push(scopeInfo);\n this.activeScope = scopeInfo;\n }\n\n /**\n * End a scope. Use this with startScope() to achieve the same functionality\n * as scope() without the need for a function closure.\n */\n endScope(result?: TensorContainer, gradientsMode = false) {\n if (gradientsMode) {\n this.gradientScopeCount--;\n if (this.gradientScopeCount === 0) {\n this.activeTape = null;\n }\n }\n\n const tensorsToKeep = new Set(this.keepTensors);\n\n const tensorsToTrackInParent = getTensorsInContainer(result);\n tensorsToTrackInParent.forEach(tensor => tensorsToKeep.add(tensor.id));\n\n // Dispose the arrays tracked in this scope.\n for (let i = 0; i < this.activeScope.track.length; i++) {\n const tensor = this.activeScope.track[i];\n if (tensorsToKeep.has(tensor.id)) {\n continue;\n }\n\n if (this.activeTape != null) {\n tensorsToTrackInParent.push(tensor);\n } else {\n tensor.dispose();\n }\n }\n\n const oldScope = this.scopeStack.pop();\n this.activeScope = this.scopeStack.length === 0 ?\n {track: [], name: 'default scope'} :\n this.scopeStack[this.scopeStack.length - 1];\n\n // Track the current result in the parent scope.\n tensorsToTrackInParent.forEach(tensor => {\n // Only track the tensor if was allocated in the inner scope and is not\n // globally kept.\n if (!this.keepTensors.has(tensor.id) &&\n isTensorInList(tensor, oldScope.track)) {\n this.track(tensor);\n }\n });\n }\n\n /**\n * Returns gradients of `f` with respect to each of the `xs`. The gradients\n * returned are of the same length as `xs`, but some might be null if `f` was\n * not a function of that `x`. It also takes optional dy to multiply the\n * gradient, which defaults to `1`.\n */\n gradients(\n f: () => T, xs: Tensor[], dy?: T,\n allowNoGradients = false): {value: T, grads: Tensor[]} {\n util.assert(xs.length > 0, 'gradients() received an empty list of xs.');\n\n return this.tidy('gradients', () => {\n const y = f();\n util.assert(\n y instanceof Tensor,\n 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error(\n 'Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n\n const accumulatedGradientMap: {[tensorId: number]: Tensor} = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape);\n\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n return {value: y, grads};\n }, true /* gradientsMode */);\n }\n\n customGrad(f: CustomGradientFunc):\n (...args: Tensor[]) => T {\n util.assert(\n util.isFunction(f),\n 'The f passed in customGrad(f) must be a function.');\n return (...inputs: Tensor[]): T => {\n util.assert(\n inputs.every(t => t instanceof Tensor),\n 'The args passed in customGrad(f)(x1, x2,...) must all be tensors');\n\n let gradientsFunc: (dy: T) => Tensor | Tensor[];\n let result: T;\n this.scopedRun(\n () => this.customGradientDepth++, () => this.customGradientDepth--,\n () => {\n const gradientsMode = true;\n result = this.tidy(f.name, () => {\n const {value, gradFunc} = f(...inputs);\n util.assert(\n value instanceof Tensor,\n 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.value` is a tensor');\n util.assert(\n util.isFunction(gradFunc),\n 'The function f passed in customGrad(f) must return an ' +\n 'object where `obj.gradFunc` is a function.');\n gradientsFunc = gradFunc;\n return value;\n }, gradientsMode);\n });\n\n if (this.shouldRecord()) {\n const gradFunc = (dy: T): Tensor[] => {\n const res = gradientsFunc(dy);\n const grads: Tensor[] = Array.isArray(res) ? res : [res];\n util.assert(\n grads.length === inputs.length,\n 'The function f passed in customGrad(f) must return an object ' +\n 'where `obj.gradFunc` is a function that returns the same ' +\n 'number of tensors as inputs passed to f(...).');\n util.assert(\n grads.every(t => t instanceof Tensor),\n 'The function f passed in customGrad(f) must return an object ' +\n 'where `obj.gradFunc` is a function that returns a list of ' +\n 'only tensors.');\n return grads;\n };\n this.addTapeNode(inputs, result, gradFunc);\n }\n return result;\n };\n }\n\n // Forwarding to backend.\n write(dataId: DataId, values: TypedArray): void {\n this.backend.write(dataId, values);\n }\n readSync(dataId: DataId): TypedArray {\n return this.backend.readSync(dataId);\n }\n read(dataId: DataId): Promise {\n return this.backend.read(dataId);\n }\n fromPixels(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels: number): Tensor3D {\n return this.backend.fromPixels(pixels, numChannels);\n }\n async time(query: () => void): Promise {\n const start = now();\n const timingInfo = await this.backend.time(query) as TimingInfo;\n timingInfo.wallMs = now() - start;\n return timingInfo;\n }\n\n /**\n * Tracks a Tensor in the current scope to be automatically cleaned up\n * when the current scope ends, and returns the value.\n *\n * @param result The Tensor to track in the current scope.\n */\n private track(result: T): T {\n if (this.scopeStack.length === 1 && this.safeMode) {\n throw new Error(\n 'Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' +\n 'tf.tidy(() => {op();...}); to avoid memory leaks.');\n }\n this.activeScope.track.push(result);\n return result;\n }\n}\n\nfunction ones(shape: number[]): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), 'float32');\n return Tensor.make(shape, {values});\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport interface Features {\n // Whether to enable debug mode.\n 'DEBUG'?: boolean;\n // Whether we are in a browser (as versus, say, node.js) environment.\n 'IS_BROWSER'?: boolean;\n // Whether we are in the Node.js environment.\n 'IS_NODE'?: boolean;\n // The disjoint_query_timer extension version.\n // 0: disabled, 1: EXT_disjoint_timer_query, 2:\n // EXT_disjoint_timer_query_webgl2.\n // In Firefox with WebGL 2.0,\n // EXT_disjoint_timer_query_webgl2 is not available, so we must use the\n // WebGL 1.0 extension.\n 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'?: number;\n // Whether the timer object from the disjoint_query_timer extension gives\n // timing information that is reliable.\n 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE'?: boolean;\n // 0: No WebGL, 1: WebGL 1.0, 2: WebGL 2.0.\n 'WEBGL_VERSION'?: number;\n // True if WebGL is supported.\n 'HAS_WEBGL'?: boolean;\n // Whether rendering to float32 textures is enabled. If disabled, renders to\n // float16 textures.\n 'WEBGL_RENDER_FLOAT32_ENABLED'?: boolean;\n // Whether downloading float textures is enabled. If disabled, uses IEEE 754\n // encoding of the float32 values to 4 uint8 when downloading.\n 'WEBGL_DOWNLOAD_FLOAT_ENABLED'?: boolean;\n // Whether the fence API is available.\n 'WEBGL_FENCE_API_ENABLED'?: boolean;\n 'BACKEND'?: string;\n // Test precision for unit tests. This is decreased when we can't render\n // float32 textures.\n 'TEST_EPSILON'?: number;\n 'IS_CHROME'?: boolean;\n // True if running unit tests.\n 'IS_TEST'?: boolean;\n}\n\nexport enum Type {\n NUMBER,\n BOOLEAN,\n STRING\n}\n\nexport const URL_PROPERTIES: URLProperty[] = [\n {name: 'DEBUG', type: Type.BOOLEAN}, {name: 'IS_BROWSER', type: Type.BOOLEAN},\n {name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION', type: Type.NUMBER},\n {name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE', type: Type.BOOLEAN},\n {name: 'WEBGL_VERSION', type: Type.NUMBER},\n {name: 'WEBGL_RENDER_FLOAT32_ENABLED', type: Type.BOOLEAN},\n {name: 'WEBGL_DOWNLOAD_FLOAT_ENABLED', type: Type.BOOLEAN},\n {name: 'WEBGL_FENCE_API_ENABLED', type: Type.BOOLEAN},\n {name: 'BACKEND', type: Type.STRING}\n];\n\nexport interface URLProperty {\n name: keyof Features;\n type: Type;\n}\n\nexport function isWebGLVersionEnabled(webGLVersion: 1|2, isBrowser: boolean) {\n let gl;\n try {\n gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n } catch (e) {\n return false;\n }\n\n if (gl != null) {\n loseContext(gl);\n return true;\n }\n return false;\n}\n\nexport function getWebGLDisjointQueryTimerVersion(\n webGLVersion: number, isBrowser: boolean): number {\n if (webGLVersion === 0) {\n return 0;\n }\n\n let queryTimerVersion: number;\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n if (hasExtension(gl, 'EXT_disjoint_timer_query_webgl2') &&\n webGLVersion === 2) {\n queryTimerVersion = 2;\n } else if (hasExtension(gl, 'EXT_disjoint_timer_query')) {\n queryTimerVersion = 1;\n } else {\n queryTimerVersion = 0;\n }\n\n if (gl != null) {\n loseContext(gl);\n }\n return queryTimerVersion;\n}\n\nexport function isRenderToFloatTextureEnabled(\n webGLVersion: number, isBrowser: boolean): boolean {\n if (webGLVersion === 0) {\n return false;\n }\n\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n if (webGLVersion === 1) {\n if (!hasExtension(gl, 'OES_texture_float')) {\n return false;\n }\n } else {\n if (!hasExtension(gl, 'EXT_color_buffer_float')) {\n return false;\n }\n }\n\n createFloatTextureAndBindToFramebuffer(gl, webGLVersion);\n\n const isFrameBufferComplete =\n gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;\n\n loseContext(gl);\n return isFrameBufferComplete;\n}\n\nexport function isDownloadFloatTextureEnabled(\n webGLVersion: number, isBrowser: boolean): boolean {\n if (webGLVersion === 0) {\n return false;\n }\n\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n if (webGLVersion === 1) {\n if (!hasExtension(gl, 'OES_texture_float')) {\n return false;\n }\n } else {\n if (!hasExtension(gl, 'EXT_color_buffer_float')) {\n return false;\n }\n }\n\n createFloatTextureAndBindToFramebuffer(gl, webGLVersion);\n gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, new Float32Array(4));\n\n const readPixelsNoError = gl.getError() === gl.NO_ERROR;\n\n loseContext(gl);\n\n return readPixelsNoError;\n}\n\nexport function isWebGLFenceEnabled(webGLVersion: number, isBrowser: boolean) {\n if (webGLVersion !== 2) {\n return false;\n }\n const gl = getWebGLRenderingContext(webGLVersion, isBrowser);\n\n // tslint:disable-next-line:no-any\n const isEnabled = (gl as any).fenceSync != null;\n loseContext(gl);\n return isEnabled;\n}\n\nexport function isChrome() {\n return typeof navigator !== 'undefined' && navigator != null &&\n navigator.userAgent != null && /Chrome/.test(navigator.userAgent) &&\n /Google Inc/.test(navigator.vendor);\n}\n\n// Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true.\nconst TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';\nexport function getFeaturesFromURL(): Features {\n const features: Features = {};\n\n if (typeof window === 'undefined' || typeof window.location === 'undefined') {\n return features;\n }\n\n const urlParams = getQueryParams(window.location.search);\n if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {\n const urlFlags: {[key: string]: string} = {};\n\n const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');\n keyValues.forEach(keyValue => {\n const [key, value] = keyValue.split(':') as [string, string];\n urlFlags[key] = value;\n });\n\n URL_PROPERTIES.forEach(urlProperty => {\n if (urlProperty.name in urlFlags) {\n console.log(\n `Setting feature override from URL ${urlProperty.name}: ` +\n `${urlFlags[urlProperty.name]}`);\n if (urlProperty.type === Type.NUMBER) {\n features[urlProperty.name] = +urlFlags[urlProperty.name];\n } else if (urlProperty.type === Type.BOOLEAN) {\n features[urlProperty.name] = urlFlags[urlProperty.name] === 'true';\n } else if (urlProperty.type === Type.STRING) {\n // tslint:disable-next-line:no-any\n features[urlProperty.name] = urlFlags[urlProperty.name] as any;\n } else {\n console.warn(`Unknown URL param: ${urlProperty.name}.`);\n }\n }\n });\n }\n\n return features;\n}\n\nfunction hasExtension(gl: WebGLRenderingContext, extensionName: string) {\n const ext = gl.getExtension(extensionName);\n return ext != null;\n}\n\nfunction getWebGLRenderingContext(\n webGLVersion: number, isBrowser: boolean): WebGLRenderingContext {\n if (webGLVersion === 0 || !isBrowser) {\n throw new Error('Cannot get WebGL rendering context, WebGL is disabled.');\n }\n\n const tempCanvas = document.createElement('canvas');\n\n if (webGLVersion === 1) {\n return (tempCanvas.getContext('webgl') ||\n tempCanvas.getContext('experimental-webgl')) as\n WebGLRenderingContext;\n }\n return tempCanvas.getContext('webgl2') as WebGLRenderingContext;\n}\n\nfunction loseContext(gl: WebGLRenderingContext) {\n if (gl != null) {\n const loseContextExtension = gl.getExtension('WEBGL_lose_context');\n if (loseContextExtension == null) {\n throw new Error(\n 'Extension WEBGL_lose_context not supported on this browser.');\n }\n loseContextExtension.loseContext();\n }\n}\n\nfunction createFloatTextureAndBindToFramebuffer(\n gl: WebGLRenderingContext, webGLVersion: number) {\n const frameBuffer = gl.createFramebuffer();\n const texture = gl.createTexture();\n\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // tslint:disable-next-line:no-any\n const internalFormat = webGLVersion === 2 ? (gl as any).RGBA32F : gl.RGBA;\n gl.texImage2D(\n gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n}\n\nexport function getQueryParams(queryString: string): {[key: string]: string} {\n const params = {};\n queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => {\n decodeParam(params, t[0], t[1]);\n return t.join('=');\n });\n return params;\n}\n\nfunction decodeParam(\n params: {[key: string]: string}, name: string, value?: string) {\n params[decodeURIComponent(name)] = decodeURIComponent(value || '');\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from './tensor';\nimport {NamedTensorMap} from './tensor_types';\nimport * as util from './util';\n\nexport interface TapeNode {\n id: number;\n name: string;\n output: Tensor;\n inputs: NamedTensorMap;\n // Optional params, defined only for ops with gradient impl.\n gradient?: (dy: Tensor|NamedTensorMap) => NamedGradientMap;\n}\n\nexport type NamedGradientMap = {\n [inputName: string]: () => Tensor;\n};\n\n/**\n * Computes a list of TapeNodes that connect x to y, filtering everything else\n * out and preserving the order of the original tape elements.\n * @param tape The tape elements to filter.\n * @param xs The input Tensors.\n * @param y The output Tensor.\n */\nexport function getFilteredNodesXToY(\n tape: TapeNode[], xs: Tensor[], y: Tensor): TapeNode[] {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX: {[tensorId: number]: boolean} = {};\n const nodesFromX: {[nodeId: number]: boolean} = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n for (const inputName in nodeInputs) {\n const input = nodeInputs[inputName];\n\n let anyInputFromX = false;\n for (let j = 0; j < xs.length; j++) {\n if (tensorsFromX[input.id]) {\n tensorsFromX[node.output.id] = true;\n anyInputFromX = true;\n nodesFromX[node.id] = true;\n break;\n }\n }\n\n if (anyInputFromX) {\n break;\n }\n }\n }\n\n // Backwards pass to find all of the nodes and Tensors that lead to y.\n const tensorsLeadToY: {[tensorId: number]: boolean} = {};\n tensorsLeadToY[y.id] = true;\n const nodesToY: {[nodeId: number]: boolean} = {};\n\n for (let i = tape.length - 1; i >= 0; i--) {\n const node = tape[i];\n const nodeInputs = node.inputs;\n\n const outputs: Tensor[] = [];\n outputs.push(node.output);\n\n // If any of the outputs lead to y, mark all of the inputs as leading to y.\n for (let j = 0; j < outputs.length; j++) {\n if (tensorsLeadToY[outputs[j].id]) {\n for (const inputName in nodeInputs) {\n tensorsLeadToY[nodeInputs[inputName].id] = true;\n nodesToY[node.id] = true;\n }\n break;\n }\n }\n }\n\n // Return the paths that come from x and lead to y.\n const filteredTape: TapeNode[] = [];\n for (let i = 0; i < tape.length; i++) {\n const node = tape[i];\n\n if (nodesFromX[node.id] && nodesToY[node.id]) {\n // Prune the inputs from the node that aren't a function of x.\n const prunedInputs: {[inputName: string]: Tensor} = {};\n for (const inputName in node.inputs) {\n const nodeInput = node.inputs[inputName];\n if (tensorsFromX[nodeInput.id]) {\n prunedInputs[inputName] = nodeInput;\n }\n }\n\n // Copy the node and overwrite inputsAndArgs to the pruned version.\n const prunedNode = Object.assign({}, node) as TapeNode;\n prunedNode.inputs = prunedInputs;\n prunedNode.output = node.output;\n\n filteredTape.push(prunedNode);\n }\n }\n\n return filteredTape;\n}\n\n/**\n * Backpropagate gradients through the filtered TapeNodes.\n * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map\n * is mutated by this method.\n * @param filteredTape The filtered TapeNodes to backprop through.\n */\nexport function backpropagateGradients(\n tensorAccumulatedGradientMap: {[tensorId: number]: Tensor},\n filteredTape: TapeNode[]) {\n // Walk the tape backwards and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n\n const dy = tensorAccumulatedGradientMap[node.output.id];\n\n if (node.gradient == null) {\n throw new Error(\n `Cannot compute gradient: gradient function not found ` +\n `for ${node.name}.`);\n }\n\n // Backprop dy through this node and accumulate gradients over the inputs.\n const inputGradients = node.gradient(dy);\n for (const inputName in node.inputs) {\n if (!(inputName in inputGradients)) {\n throw new Error(\n `Cannot backprop through input ${inputName}. ` +\n `Available gradients found: ${Object.keys(inputGradients)}.`);\n }\n\n // Call the gradient function.\n const dx = inputGradients[inputName]();\n const x = node.inputs[inputName];\n if (!util.arraysEqual(dx.shape, x.shape)) {\n throw new Error(\n `Error in gradient for op ${node.name}. The gradient of input ` +\n `'${inputName}' has shape '${dx.shape}', which does not match ` +\n `the shape of the input '${x.shape}'`);\n }\n\n if (tensorAccumulatedGradientMap[x.id] == null) {\n tensorAccumulatedGradientMap[x.id] = dx;\n } else {\n const curGradient = tensorAccumulatedGradientMap[x.id];\n tensorAccumulatedGradientMap[x.id] = curGradient.add(dx);\n curGradient.dispose();\n }\n }\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as device_util from './device_util';\nimport {Engine, MemoryInfo, ScopeFn, TimingInfo} from './engine';\nimport {Features, getFeaturesFromURL, getWebGLDisjointQueryTimerVersion, isChrome, isDownloadFloatTextureEnabled, isRenderToFloatTextureEnabled, isWebGLFenceEnabled, isWebGLVersionEnabled} from './environment_util';\nimport {KernelBackend} from './kernels/backend';\nimport {setTensorTracker, Tensor, TensorTracker} from './tensor';\nimport {TensorContainer} from './tensor_types';\nimport {getTensorsInContainer} from './tensor_util';\n\nconst TEST_EPSILON_FLOAT32_ENABLED = 1e-3;\nconst TEST_EPSILON_FLOAT32_DISABLED = 1e-1;\n\nexport class Environment {\n private features: Features = {};\n private globalEngine: Engine;\n private registry:\n {[id: string]: {backend: KernelBackend, priority: number}} = {};\n backendName: string;\n backend: KernelBackend;\n\n constructor(features?: Features) {\n if (features != null) {\n this.features = features;\n }\n\n if (this.get('DEBUG')) {\n console.warn(\n 'Debugging mode is ON. The output of every math call will ' +\n 'be downloaded to CPU and checked for NaNs. ' +\n 'This significantly impacts performance.');\n }\n }\n\n /**\n * Sets the backend (cpu, webgl, etc) responsible for creating tensors and\n * executing operations on those tensors.\n *\n * Note this disposes the current backend, if any, as well as any tensors\n * associated with it. A new backend is initialized, even if it is of the\n * same type as the previous one.\n *\n * @param backendName The name of the backend. Currently supports\n * `'webgl'|'cpu'` in the browser, and `'tensorflow'` under node.js\n * (requires tfjs-node).\n * @param safeMode Defaults to false. In safe mode, you are forced to\n * construct tensors and call math operations inside a `tidy()` which\n * will automatically clean up intermediate tensors.\n */\n /** @doc {heading: 'Environment'} */\n static setBackend(backendName: string, safeMode = false) {\n if (!(backendName in ENV.registry)) {\n throw new Error(`Backend name '${backendName}' not found in registry`);\n }\n ENV.initBackend(backendName, safeMode);\n }\n\n /**\n * Returns the current backend name (cpu, webgl, etc). The backend is\n * responsible for creating tensors and executing operations on those tensors.\n */\n /** @doc {heading: 'Environment'} */\n static getBackend(): string {\n ENV.initDefaultBackend();\n return ENV.backendName;\n }\n\n /**\n * Dispose all variables kept in backend engine.\n */\n /** @doc {heading: 'Environment'} */\n static disposeVariables(): void {\n ENV.engine.disposeVariables();\n }\n\n /**\n * Returns memory info at the current time in the program. The result is an\n * object with the following properties:\n *\n * - `numBytes`: Number of bytes allocated (undisposed) at this time.\n * - `numTensors`: Number of unique tensors allocated.\n * - `numDataBuffers`: Number of unique data buffers allocated\n * (undisposed) at this time, which is ≤ the number of tensors\n * (e.g. `a.reshape(newShape)` makes a new Tensor that shares the same\n * data buffer with `a`).\n * - `unreliable`: `Optional` `boolean`:\n * - On WebGL, not present (always reliable).\n * - On CPU, true. Due to automatic garbage collection, these numbers\n * represent undisposed tensors, i.e. not wrapped in `tidy()`, or\n * lacking a call to `tensor.dispose()`.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static memory(): MemoryInfo {\n return ENV.engine.memory();\n }\n\n /**\n * Executes the provided function `fn` and after it is executed, cleans up all\n * intermediate tensors allocated by `fn` except those returned by `fn`.\n * `f` must not return a Promise (async functions not allowed).\n * The returned result can be a complex object, however tidy only walks the\n * top-level properties (depth 1) of that object to search for tensors, or\n * lists of tensors that need to be tracked in the parent scope.\n *\n * Using this method helps avoid memory leaks. In general, wrap calls to\n * operations in `tidy` for automatic memory cleanup.\n *\n * When in safe mode, you must enclose all `Tensor` creation and ops\n * inside a `tidy` to prevent memory leaks.\n *\n * ```js\n * // y = 2 ^ 2 + 1\n * const y = tf.tidy(() => {\n * // a, b, and one will be cleaned up when the tidy ends.\n * const one = tf.scalar(1);\n * const a = tf.scalar(2);\n * const b = a.square();\n *\n * console.log('numTensors (in tidy): ' + tf.memory().numTensors);\n *\n * // The value returned inside the tidy function will return\n * // through the tidy, in this case to the variable y.\n * return b.add(one);\n * });\n *\n * console.log('numTensors (outside tidy): ' + tf.memory().numTensors);\n * y.print();\n * ```\n *\n * @param nameOrFn The name of the closure, or the function to execute.\n * If a name is provided, the 2nd argument should be the function.\n * If debug mode is on, the timing and the memory usage of the function\n * will be tracked and displayed on the console using the provided name.\n * @param fn The function to execute.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static tidy(\n nameOrFn: string|ScopeFn, fn?: ScopeFn, gradMode = false): T {\n return ENV.engine.tidy(nameOrFn, fn, gradMode);\n }\n\n /**\n * Disposes any `Tensor`s found within the provided object.\n *\n * @param container an object that may be a `Tensor` or may directly contain\n * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. If the\n * object is not a `Tensor` or does not contain `Tensors`, nothing\n * happens. In general it is safe to pass any object here, except that\n * `Promise`s are not supported.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static dispose(container: TensorContainer) {\n const tensors = getTensorsInContainer(container);\n tensors.forEach(tensor => tensor.dispose());\n }\n\n /**\n * Keeps a `Tensor` generated inside a `tidy` from being disposed\n * automatically.\n *\n * ```js\n * let b;\n * const y = tf.tidy(() => {\n * const one = tf.scalar(1);\n * const a = tf.scalar(2);\n *\n * // b will not be cleaned up by the tidy. a and one will be cleaned up\n * // when the tidy ends.\n * b = tf.keep(a.square());\n *\n * console.log('numTensors (in tidy): ' + tf.memory().numTensors);\n *\n * // The value returned inside the tidy function will return\n * // through the tidy, in this case to the variable y.\n * return b.add(one);\n * });\n *\n * console.log('numTensors (outside tidy): ' + tf.memory().numTensors);\n * console.log('y:');\n * y.print();\n * console.log('b:');\n * b.print();\n * ```\n *\n * @param result The tensor to keep from being disposed.\n */\n /** @doc {heading: 'Performance', subheading: 'Memory'} */\n static keep(result: T): T {\n return ENV.engine.keep(result);\n }\n\n /**\n * Executes `f()` and returns a promise that resolves with timing\n * information.\n *\n * The result is an object with the following properties:\n *\n * - `wallMs`: Wall execution time.\n * - `kernelMs`: Kernel execution time, ignoring data transfer.\n * - On `WebGL` The following additional properties exist:\n * - `uploadWaitMs`: CPU blocking time on texture uploads.\n * - `downloadWaitMs`: CPU blocking time on texture downloads (readPixels).\n *\n * ```js\n * const x = tf.randomNormal([20, 20]);\n * const time = await tf.time(() => x.matMul(x));\n *\n * console.log(`kernelMs: ${time.kernelMs}, wallTimeMs: ${time.wallMs}`);\n * ```\n *\n * @param f The function to execute and time.\n */\n /** @doc {heading: 'Performance', subheading: 'Timing'} */\n static time(f: () => void): Promise {\n return ENV.engine.time(f);\n }\n\n get(feature: K): Features[K] {\n if (feature in this.features) {\n return this.features[feature];\n }\n\n this.features[feature] = this.evaluateFeature(feature);\n\n return this.features[feature];\n }\n\n getFeatures(): Features {\n return this.features;\n }\n\n set(feature: K, value: Features[K]): void {\n this.features[feature] = value;\n }\n\n private getBestBackendName(): string {\n if (Object.keys(this.registry).length === 0) {\n throw new Error('No backend found in registry.');\n }\n const sortedBackends = Object.keys(this.registry)\n .map(name => {\n return {name, entry: this.registry[name]};\n })\n .sort((a, b) => {\n // Highest priority comes first.\n return b.entry.priority - a.entry.priority;\n });\n return sortedBackends[0].name;\n }\n\n private evaluateFeature(feature: K): Features[K] {\n if (feature === 'DEBUG') {\n return false;\n } else if (feature === 'IS_BROWSER') {\n return typeof window !== 'undefined';\n } else if (feature === 'IS_NODE') {\n return (typeof process !== 'undefined') &&\n (typeof process.versions.node !== 'undefined');\n } else if (feature === 'IS_CHROME') {\n return isChrome();\n } else if (feature === 'IS_TEST') {\n return false;\n } else if (feature === 'BACKEND') {\n return this.getBestBackendName();\n } else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') {\n const webGLVersion = this.get('WEBGL_VERSION');\n\n if (webGLVersion === 0) {\n return 0;\n }\n // Remove this and reenable this extension when the\n // EXT_disjoint_query_timer extension is reenabled in chrome.\n // https://github.com/tensorflow/tfjs/issues/544\n if (webGLVersion > 0) {\n return 0;\n }\n return getWebGLDisjointQueryTimerVersion(\n webGLVersion, this.get('IS_BROWSER'));\n } else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE') {\n return this.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0 &&\n !device_util.isMobile();\n } else if (feature === 'HAS_WEBGL') {\n return this.get('WEBGL_VERSION') > 0;\n } else if (feature === 'WEBGL_VERSION') {\n if (isWebGLVersionEnabled(2, this.get('IS_BROWSER'))) {\n return 2;\n } else if (isWebGLVersionEnabled(1, this.get('IS_BROWSER'))) {\n return 1;\n }\n return 0;\n } else if (feature === 'WEBGL_RENDER_FLOAT32_ENABLED') {\n return isRenderToFloatTextureEnabled(\n this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));\n } else if (feature === 'WEBGL_DOWNLOAD_FLOAT_ENABLED') {\n return isDownloadFloatTextureEnabled(\n this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));\n } else if (feature === 'WEBGL_FENCE_API_ENABLED') {\n return isWebGLFenceEnabled(\n this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));\n } else if (feature === 'TEST_EPSILON') {\n if (this.get('WEBGL_RENDER_FLOAT32_ENABLED')) {\n return TEST_EPSILON_FLOAT32_ENABLED;\n }\n return TEST_EPSILON_FLOAT32_DISABLED;\n }\n throw new Error(`Unknown feature ${feature}.`);\n }\n\n setFeatures(features: Features) {\n this.features = Object.assign({}, features);\n }\n\n reset() {\n this.features = getFeaturesFromURL();\n if (this.globalEngine != null) {\n this.globalEngine = null;\n }\n }\n\n private initBackend(backendName?: string, safeMode = false) {\n this.backendName = backendName;\n this.backend = this.findBackend(backendName);\n this.globalEngine =\n new Engine(this.backend, safeMode, () => this.get('DEBUG'));\n }\n\n findBackend(name: string): KernelBackend {\n if (!(name in this.registry)) {\n return null;\n }\n return this.registry[name].backend;\n }\n\n /**\n * Registers a global backend. The registration should happen when importing\n * a module file (e.g. when importing `backend_webgl.ts`), and is used for\n * modular builds (e.g. custom tfjs bundle with only webgl support).\n *\n * @param factory: The backend factory function. When called, it should\n * return an instance of the backend.\n * @param priority The priority of the backend (higher = more important).\n * In case multiple backends are registered, the priority is used to find\n * the best backend. Defaults to 1.\n * @return False if the creation/registration failed. True otherwise.\n */\n registerBackend(\n name: string, factory: () => KernelBackend, priority = 1,\n setTensorTrackerFn?: (f: () => TensorTracker) => void): boolean {\n if (name in this.registry) {\n console.warn(\n `${name} backend was already registered. Reusing existing backend`);\n if (setTensorTrackerFn != null) {\n setTensorTrackerFn(() => this.engine);\n }\n return false;\n }\n try {\n const backend = factory();\n this.registry[name] = {backend, priority};\n return true;\n } catch (err) {\n console.warn(`Registration of backend ${name} failed`);\n console.warn(err.stack || err.message);\n return false;\n }\n }\n\n removeBackend(name: string): void {\n if (!(name in this.registry)) {\n throw new Error(`${name} backend not found in registry`);\n }\n this.registry[name].backend.dispose();\n delete this.registry[name];\n }\n\n get engine(): Engine {\n this.initDefaultBackend();\n return this.globalEngine;\n }\n\n private initDefaultBackend() {\n if (this.globalEngine == null) {\n this.initBackend(this.get('BACKEND'), false /* safeMode */);\n }\n }\n}\n\nfunction getGlobalNamespace(): {ENV: Environment} {\n // tslint:disable-next-line:no-any\n let ns: any;\n if (typeof (window) !== 'undefined') {\n ns = window;\n } else if (typeof (process) !== 'undefined') {\n ns = process;\n } else {\n throw new Error('Could not find a global object');\n }\n return ns;\n}\n\nfunction getOrMakeEnvironment(): Environment {\n const ns = getGlobalNamespace();\n if (ns.ENV == null) {\n ns.ENV = new Environment(getFeaturesFromURL());\n setTensorTracker(() => ns.ENV.engine);\n }\n return ns.ENV;\n}\n\nexport let ENV = getOrMakeEnvironment();\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport function isMobile(): boolean {\n // tslint:disable-next-line:no-any\n const a = navigator.userAgent || navigator.vendor || (window as any).opera;\n // tslint:disable-next-line:max-line-length\n return /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i\n .test(a) ||\n // tslint:disable-next-line:max-line-length\n /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i\n .test(a.substr(0, 4));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from './environment';\n\nexport function warn(...msg: Array<{}>): void {\n if (!ENV.get('IS_TEST')) {\n console.warn(...msg);\n }\n}\n\nexport function log(...msg: Array<{}>): void {\n if (!ENV.get('IS_TEST')) {\n console.log(...msg);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Gets the new shape of the input Tensor after it's been reshaped\n * to :\n * [blockShape[0], ..., blockShape[M-1], batch / prod(blockShape),\n * inputShape[1], ..., inputShape[N-1]]\n *\n * See step 1: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getReshaped(\n inputShape: number[], blockShape: number[], prod: number,\n batchToSpace = true): number[] {\n let reshaped: number[] = [];\n if (batchToSpace) {\n reshaped = reshaped.concat(blockShape.slice(0));\n reshaped.push(inputShape[0] / prod);\n reshaped = reshaped.concat(inputShape.slice(1));\n } else {\n reshaped = reshaped.concat(inputShape[0]);\n const spatialLength = blockShape.length;\n for (let i = 0; i < spatialLength; ++i) {\n reshaped =\n reshaped.concat([inputShape[i + 1] / blockShape[i], blockShape[i]]);\n }\n reshaped = reshaped.concat(inputShape.slice(spatialLength + 1));\n }\n return reshaped;\n}\n\n/**\n * Gets the permutation that will transpose the dimensions of the\n * reshaped tensor to shape:\n *\n * [batch / prod(block_shape),inputShape[1], blockShape[0], ...,\n * inputShape[M], blockShape[M-1],inputShape[M+1], ..., inputShape[N-1]]\n *\n * see step 2: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getPermuted(\n reshapedRank: number, blockShapeRank: number,\n batchToSpace = true): number[] {\n const permuted = [];\n if (batchToSpace) {\n permuted.push(blockShapeRank);\n for (let i = blockShapeRank + 1; i < reshapedRank; ++i) {\n if (i <= 2 * blockShapeRank) {\n permuted.push(i);\n permuted.push(i - (blockShapeRank + 1));\n } else {\n permuted.push(i);\n }\n }\n } else {\n const permutedBeforeBatch = [];\n const permutedAfterBatch = [];\n for (let i = 1; i < reshapedRank; ++i) {\n if (i >= blockShapeRank * 2 + 1 || i % 2 === 1) {\n permutedAfterBatch.push(i);\n } else {\n permutedBeforeBatch.push(i);\n }\n }\n permuted.push(...permutedBeforeBatch);\n permuted.push(0);\n permuted.push(...permutedAfterBatch);\n }\n return permuted;\n}\n\n/**\n * Gets the shape of the reshaped and permuted input Tensor before any cropping\n * is applied. The new shape will be:\n *\n * [batch / prod(blockShape),inputShape[1] * blockShape[0], ...,\n * inputShape[M] * blockShape[M-1],inputShape[M+1], ..., inputShape[N-1]]\n *\n * See step 3: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getReshapedPermuted(\n inputShape: number[], blockShape: number[], prod: number,\n batchToSpace = true): number[] {\n const reshapedPermuted = [];\n\n if (batchToSpace) {\n reshapedPermuted.push(inputShape[0] / prod);\n } else {\n reshapedPermuted.push(inputShape[0] * prod);\n }\n\n for (let i = 1; i < inputShape.length; ++i) {\n if (i <= blockShape.length) {\n if (batchToSpace) {\n reshapedPermuted.push(blockShape[i - 1] * inputShape[i]);\n } else {\n reshapedPermuted.push(inputShape[i] / blockShape[i - 1]);\n }\n } else {\n reshapedPermuted.push(inputShape[i]);\n }\n }\n\n return reshapedPermuted;\n}\n\n/**\n * Converts the crops argument into the beginning coordinates of a slice\n * operation\n */\nexport function getSliceBeginCoords(\n crops: number[][], blockShape: number): number[] {\n const sliceBeginCoords = [0];\n for (let i = 0; i < blockShape; ++i) {\n sliceBeginCoords.push(crops[i][0]);\n }\n return sliceBeginCoords;\n}\n\n/**\n * converts the crops argument into the size of a slice operation. When\n * combined with getSliceBeginCoords this function allows the reshaped and\n * permuted Tensor to be cropped to its final output shape of:\n *\n * inputShape[1] * blockShape[0] - crops[0,0] - crops[0,1], ...,\n * inputShape[M] * blockShape[M-1] -crops[M-1,0] -\n * crops[M-1,1],inputShape[M+1], ..., inputShape[N-1]]\n *\n * See step 4: https://www.tensorflow.org/api_docs/python/tf/batch_to_space_nd\n */\nexport function getSliceSize(\n uncroppedShape: number[], crops: number[][], blockShape: number): number[] {\n const sliceSize = uncroppedShape.slice(0, 1);\n for (let i = 0; i < blockShape; ++i) {\n sliceSize.push(uncroppedShape[i + 1] - crops[i][0] - crops[i][1]);\n }\n\n return sliceSize;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as util from '../util';\n\n/**\n * Returns true if the axis specifies the inner most dimensions of the\n * array.\n */\nexport function axesAreInnerMostDims(axes: number[], rank: number): boolean {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n}\n\nexport function combineLocations(\n outputLoc: number[], reduceLoc: number[], axes: number[]): number[] {\n const rank = outputLoc.length + reduceLoc.length;\n const loc = [];\n let outIdx = 0;\n let reduceIdx = 0;\n   for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n loc.push(outputLoc[outIdx++]);\n } else {\n loc.push(reduceLoc[reduceIdx++]);\n }\n }\n return loc;\n}\n\nexport function computeOutAndReduceShapes(\n aShape: number[], axes: number[]): [number[], number[]] {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outShape.push(aShape[dim]);\n }\n }\n const reduceShape = axes.map(dim => aShape[dim]);\n return [outShape, reduceShape];\n}\n\nexport function expandShapeToKeepDim(\n shape: number[], axes: number[]): number[] {\n const reduceSubShape = axes.map(x => 1);\n return combineLocations(shape, reduceSubShape, axes);\n}\n\nexport function parseAxisParam(\n axis: number|number[], shape: number[]): number[] {\n const rank = shape.length;\n\n // Normalize input\n axis = axis == null ? shape.map((s, i) => i) : [].concat(axis);\n\n // Check for valid range\n util.assert(\n axis.every(ax => ax >= -rank && ax < rank),\n `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n\n // Check for only integers\n util.assert(\n axis.every(ax => util.isInt(ax)),\n `All values in axis param must be integers but ` +\n `got axis ${axis}`);\n\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\n\nexport function assertAxesAreInnerMostDims(\n msg: string, axes: number[], rank: number): void {\n util.assert(\n axesAreInnerMostDims(axes, rank),\n `${msg} supports only inner-most axes for now. ` +\n `Got axes ${axes} and rank-${rank} input.`);\n}\n\n/**\n * Returns the axes permutation to be used with `tf.transpose`, if such\n * permutation is neccesary. Otherwise it returns null. This method is used by\n * operations that operate only on inner-most axes.\n */\nexport function getAxesPermutation(axes: number[], rank: number): number[]|\n null {\n if (axesAreInnerMostDims(axes, rank)) {\n return null;\n }\n const result: number[] = [];\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n result.push(i);\n }\n }\n axes.forEach(axis => result.push(axis));\n return result;\n}\n\n/** Returns the axes permutation that undoes the original permutation. */\nexport function getUndoAxesPermutation(axes: number[]): number[] {\n return axes.map((axis, i) => [i, axis])\n .sort((a, b) => a[1] - b[1])\n .map(x => x[0]);\n}\n\nexport function getInnerMostAxes(numAxes: number, rank: number): number[] {\n const res: number[] = [];\n for (let i = rank - numAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Inputs of size above this threshold will be parallelized by calling multiple\n * shader programs.\n */\nimport {nearestDivisor} from '../util';\n\nexport const PARALLELIZE_THRESHOLD = 30;\n\nexport interface ReduceInfo {\n windowSize: number;\n batchSize: number;\n inSize: number;\n}\n\nexport function computeOptimalWindowSize(inSize: number): number {\n if (inSize <= PARALLELIZE_THRESHOLD) {\n return inSize;\n }\n return nearestDivisor(inSize, Math.floor(Math.sqrt(inSize)));\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport * as util from '../util';\n\nexport function assertParamsValid(\n input: Tensor, begin: number[], size: number[]): void {\n util.assert(\n input.rank === begin.length,\n `Error in slice${input.rank}D: Length of begin ${begin} must ` +\n `match the rank of the array (${input.rank}).`);\n util.assert(\n input.rank === size.length,\n `Error in slice${input.rank}D: Length of size ${size} must ` +\n `match the rank of the array (${input.rank}).`);\n\n for (let i = 0; i < input.rank; ++i) {\n util.assert(\n begin[i] + size[i] <= input.shape[i],\n `Error in slice${input.rank}D: begin[${i}] + size[${i}] ` +\n `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${\n input.shape[i]})`);\n }\n}\n\n/**\n * Calculate the start index and output tensor shape for strided slice op.\n */\nexport function getStridedSlicedInfo(\n shape: number[], begin: number[], end: number[], strides: number[],\n beginMask = 0, endMask = 0): [number[], number[]] {\n // Note that the axis orders are reversed for runtime ops, so the indices,\n // strides and masks must be as well too.\n const startIndex: number[] = [];\n const endIndex: number[] = [];\n for (let i = 0; i < shape.length; i++) {\n startIndex[i] = startForAxis(beginMask, begin, strides, shape, i);\n endIndex[i] = stopForAxis(endMask, end, strides, shape, i);\n }\n\n let size = new Array(shape.length).fill(0);\n size = size.map((d, i) => {\n let count = 0;\n for (let start = startIndex[i];\n !(strides[i] > 0 ? start >= endIndex[i] : start <= endIndex[i]);\n start += strides[i]) {\n count += 1;\n }\n return count;\n });\n return [startIndex, size];\n}\n\nexport function startForAxis(\n beginMask: number, startIndices: number[], strides: number[],\n inputShape: number[], axis: number): number {\n // Begin with the specified index\n let start = startIndices[axis];\n\n // Check the axis bit from right of beginMask\n if (beginMask & 1 << axis) {\n if (strides[axis] > 0) {\n // Forward iteration - use the first element. These values will get\n // clamped below (Note: We could have set them to 0 and axis_size-1, but\n // use lowest() and max() to maintain symmetry with StopForAxis())\n start = Number.MIN_SAFE_INTEGER;\n } else {\n // Backward iteration - use the last element.\n start = Number.MAX_SAFE_INTEGER;\n }\n }\n\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (start < 0) {\n start += axisSize;\n }\n\n // Clamping\n start = util.clamp(0, start, axisSize - 1);\n\n return start;\n}\n\nexport function stopForAxis(\n endMask: number, stopIndices: number[], strides: number[],\n inputShape: number[], axis: number): number {\n // Begin with the specified index\n let stop = stopIndices[axis];\n\n // Check the axis bit from right of endMask\n if (endMask & (1 << axis)) {\n if (strides[axis] > 0) {\n // Forward iteration - use the last element. These values will get\n // clamped below\n stop = Number.MAX_SAFE_INTEGER;\n } else {\n // Backward iteration - use the first element.\n stop = Number.MIN_SAFE_INTEGER;\n }\n }\n\n // Handle negative indices\n const axisSize = inputShape[axis];\n if (stop < 0) {\n stop += axisSize;\n }\n\n // Clamping\n // Because the end index points one past the last element, we need slightly\n // different clamping ranges depending on the direction.\n if (strides[axis] > 0) {\n // Forward iteration\n stop = util.clamp(0, stop, axisSize);\n } else {\n // Backward iteration\n stop = util.clamp(-1, stop, axisSize - 1);\n }\n\n return stop;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {CustomGradientFunc, ScopeFn} from './engine';\nimport {ENV} from './environment';\nimport {Scalar, Tensor, Variable} from './tensor';\nimport {NamedTensorMap, TensorContainer} from './tensor_types';\nimport * as util from './util';\n\n/**\n * Create a new gradient scope. Similar to scope, but forces all inner scopes\n * to not clean up so that gradient operations can be used inside of this\n * scope.\n * @param nameOrScopeFn The name of the scope, or the function to execute.\n * If a name is provided, the 2nd argument should be the function.\n * If a name is provided, and debug mode is on, the timing and the memory\n * usage of the function will be tracked and displayed on the console\n * using the provided name.\n * @param scopeFn The function to execute.\n */\nfunction gradScope(\n nameOrScopeFn: string|ScopeFn, scopeFn?: ScopeFn): T {\n return ENV.engine.tidy(nameOrScopeFn, scopeFn, true /* gradScope */);\n}\n\n/**\n * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the\n * gradient of `f(x)` with respect to `x`.\n *\n * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to\n * `x` is computed instead. `f(x)` must take a single tensor `x` and return a\n * single tensor `y`. If `f()` takes multiple inputs, use `grads` instead.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.grad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * g(x).print();\n * ```\n *\n * ```js\n * // f(x) = x ^ 3\n * const f = x => x.pow(tf.scalar(3, 'int32'));\n * // f'(x) = 3x ^ 2\n * const g = tf.grad(f);\n * // f''(x) = 6x\n * const gg = tf.grad(g);\n *\n * const x = tf.tensor1d([2, 3]);\n * gg(x).print();\n * ```\n *\n * @param f The function f(x), to compute gradient for.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction grad(f: (x: I) => O): (\n x: I, dy?: O) => I {\n util.assert(util.isFunction(f), 'The f passed in grad(f) must be a function');\n return (x: I, dy?: O): I => {\n util.assert(\n x instanceof Tensor, 'The x passed in grad(f)(x) must be a tensor');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in grad(f)(x, dy) must be a tensor');\n return ENV.engine.tidy(() => {\n const {value, grads} = ENV.engine.gradients(() => f(x), [x], dy);\n if (dy != null) {\n util.assertShapesMatch(\n value.shape, dy.shape,\n 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +\n 'returned by f(x)');\n }\n checkGrads(grads);\n return grads[0] as I;\n });\n };\n}\n\n/**\n * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`,\n * which gives an array of gradients of `f()` with respect to each input\n * [`x1`,`x2`,...].\n *\n * If `dy` is passed when calling `g()`, the gradient of\n * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead.\n * The provided `f` must take one or more tensors and return a single tensor\n * `y`. If `f()` takes a single input, we recommend using `grad` instead.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df / da = b, df / db = a\n * const g = tf.grads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const [da, db] = g([a, b]);\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n *\n * @param f The function `f(x1, x2,...)` to compute gradients for.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction grads(f: (...args: Tensor[]) => O): (\n args: Tensor[], dy?: O) => Tensor[] {\n util.assert(\n util.isFunction(f), 'The f passed in grads(f) must be a function');\n return (args: Tensor[], dy?: O): Tensor[] => {\n util.assert(\n Array.isArray(args) && args.every(arg => arg instanceof Tensor),\n 'The args passed in grads(f)(args) must be an array of tensors');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in grads(f)(args, dy) must be a tensor');\n return ENV.engine.tidy(() => {\n const {value, grads} = ENV.engine.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(\n value.shape, dy.shape,\n 'The shape of dy passed in grads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(grads);\n return grads;\n });\n };\n}\n\n/**\n * Like `grad`, but also returns the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grad: The gradient of `f(x)` w.r.t `x` (result of `grad`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(x) = x ^ 2\n * const f = x => x.square();\n * // f'(x) = 2x\n * const g = tf.valueAndGrad(f);\n *\n * const x = tf.tensor1d([2, 3]);\n * const {value, grad} = g(x);\n *\n * console.log('value');\n * value.print();\n * console.log('grad');\n * grad.print();\n * ```\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction valueAndGrad(f: (x: I) => O): (\n x: I, dy?: O) => {\n value: O;\n grad: I;\n} {\n util.assert(\n util.isFunction(f), 'The f passed in valueAndGrad(f) must be a function');\n return (x: I, dy?: O) => {\n util.assert(\n x instanceof Tensor,\n 'The x passed in valueAndGrad(f)(x) must be a tensor');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');\n const {grads, value} = ENV.engine.gradients(() => f(x), [x], dy);\n checkGrads(grads);\n return {grad: grads[0] as I, value: value as O};\n };\n}\n\n/**\n * Like `grads`, but returns also the value of `f()`. Useful when `f()`\n * returns a metric you want to show.\n *\n * The result is a rich object with the following properties:\n * - grads: The gradients of `f()` w.r.t each input (result of `grads`).\n * - value: The value returned by `f(x)`.\n *\n * ```js\n * // f(a, b) = a * b\n * const f = (a, b) => a.mul(b);\n * // df/da = b, df/db = a\n * const g = tf.valueAndGrads(f);\n *\n * const a = tf.tensor1d([2, 3]);\n * const b = tf.tensor1d([-2, -3]);\n * const {value, grads} = g([a, b]);\n *\n * const [da, db] = grads;\n *\n * console.log('value');\n * value.print();\n *\n * console.log('da');\n * da.print();\n * console.log('db');\n * db.print();\n * ```\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction valueAndGrads(f: (...args: Tensor[]) => O): (\n args: Tensor[], dy?: O) => {\n grads: Tensor[];\n value: O;\n} {\n util.assert(\n util.isFunction(f),\n 'The f passed in valueAndGrads(f) must be a function');\n return (args: Tensor[], dy?: O) => {\n util.assert(\n Array.isArray(args) && args.every(arg => arg instanceof Tensor),\n 'The args passed in valueAndGrads(f)(args) must be array of tensors');\n util.assert(\n dy == null || dy instanceof Tensor,\n 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');\n const res = ENV.engine.gradients(() => f(...args), args, dy);\n if (dy != null) {\n util.assertShapesMatch(\n res.value.shape, dy.shape,\n 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +\n 'match the shape returned by f([x1,...])');\n }\n checkGrads(res.grads);\n return res;\n };\n}\n\n/**\n * Computes and returns the gradient of f(x) with respect to the list of\n * trainable variables provided by `varList`. If no list is provided, it\n * defaults to all trainable variables.\n *\n * ```js\n * const a = tf.variable(tf.tensor1d([3, 4]));\n * const b = tf.variable(tf.tensor1d([5, 6]));\n * const x = tf.tensor1d([1, 2]);\n *\n * // f(a, b) = a * x ^ 2 + b * x\n * const f = () => a.mul(x.square()).add(b.mul(x)).sum();\n * // df/da = x ^ 2, df/db = x\n * const {value, grads} = tf.variableGrads(f);\n *\n * Object.keys(grads).forEach(varName => grads[varName].print());\n * ```\n *\n * @param f The function to execute. f() should return a scalar.\n * @param varList The list of trainable variables. Defaults to all variables.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction variableGrads(f: () => Scalar, varList?: Variable[]):\n {value: Scalar, grads: NamedTensorMap} {\n util.assert(\n util.isFunction(f),\n 'The f passed in variableGrads(f) must be a function');\n util.assert(\n varList == null ||\n Array.isArray(varList) && varList.every(v => v instanceof Variable),\n 'The varList passed in variableGrads(f, varList) must be an array ' +\n 'of variables');\n if (varList == null) {\n // Get all of the trainable variables.\n varList = [];\n for (const varName in ENV.engine.registeredVariables) {\n varList.push(ENV.engine.registeredVariables[varName]);\n }\n }\n // Prune non-trainable variables.\n const originalVarCount = varList.length;\n varList = varList.filter(variable => variable.trainable);\n util.assert(\n varList.length > 0,\n `variableGrads() expects at least one of the input variables to be ` +\n `trainable, but none of the ${originalVarCount} variables is ` +\n `trainable.`);\n\n const allowNoGradients = true;\n const {value, grads} =\n ENV.engine.gradients(f, varList, null, allowNoGradients);\n\n util.assert(\n grads.some(g => g != null),\n 'Cannot find a connection between any variable and the result of the ' +\n 'loss function y=f(x). Please make sure the operations that use ' +\n 'variables are inside the function f passed to minimize().');\n util.assert(\n value.rank === 0,\n `The f passed in variableGrads(f) must return a scalar, but it ` +\n `returned a rank-${value.rank} tensor`);\n\n const namedGrads: NamedTensorMap = {};\n varList.forEach((v, i) => {\n if (grads[i] != null) {\n namedGrads[v.name] = grads[i];\n }\n });\n return {value, grads: namedGrads};\n}\n\n/**\n * Overrides the gradient computation of a function `f`.\n *\n * Takes a function\n * `f(...inputs) => {value: Tensor, gradFunc: dy => Tensor[]}` and returns\n * another function `g(...inputs)` which takes the same inputs as `f`. When\n * called, `g` returns `f().value`. In backward mode, custom gradients with\n * respect to each input of `f` are computed using `f().gradFunc`.\n *\n * ```js\n * const customOp = tf.customGrad(x => {\n * // Override gradient of our custom x ^ 2 op to be dy * abs(x);\n * return {value: x.square(), gradFunc: dy => [dy.mul(x.abs())]};\n * });\n *\n * const x = tf.tensor1d([-1, -2, 3]);\n * const dx = tf.grad(x => customOp(x));\n *\n * console.log(`f(x):`);\n * customOp(x).print();\n * console.log(`f'(x):`);\n * dx(x).print();\n * ```\n *\n * @param f The function to evaluate in forward mode, which should return\n * `{value: Tensor, gradFunc: (dy) => Tensor[]}`, where `gradFunc` returns\n * the custom gradients of `f` with respect to its inputs.\n */\n/** @doc {heading: 'Training', subheading: 'Gradients'} */\nfunction customGrad(f: CustomGradientFunc):\n (...args: Tensor[]) => T {\n return ENV.engine.customGrad(f);\n}\n\nfunction checkGrads(grads: Tensor[]) {\n const numNullGradients = grads.filter(g => g == null).length;\n if (numNullGradients > 0) {\n throw new Error(\n `Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`);\n }\n}\n\nexport {\n gradScope,\n customGrad,\n variableGrads,\n valueAndGrad,\n valueAndGrads,\n grad,\n grads,\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from './environment';\nimport {Tensor} from './tensor';\nimport {ArrayData, DataType, TensorLike} from './types';\nimport {inferShape, isTypedArray, toTypedArray} from './util';\n\nexport function convertToTensor(\n x: T|TensorLike, argName: string, functionName: string,\n dtype: DataType = 'float32'): T {\n dtype = dtype || 'float32';\n if (x instanceof Tensor) {\n return x;\n }\n if (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' &&\n typeof x !== 'boolean') {\n throw new Error(\n `Argument '${argName}' passed to '${functionName}' must be a ` +\n `Tensor or TensorLike, but got ${x.constructor.name}`);\n }\n const inferredShape = inferShape(x);\n if (!isTypedArray(x) && !Array.isArray(x)) {\n x = [x] as number[];\n }\n return Tensor.make(\n inferredShape,\n {values: toTypedArray(x as ArrayData, dtype, ENV.get('DEBUG'))},\n dtype);\n}\n\nexport function convertToTensorArray(\n arg: T[]|TensorLike[], argName: string, functionName: string): T[] {\n if (!Array.isArray(arg)) {\n throw new Error(\n `Argument ${argName} passed to ${functionName} must be a ` +\n '`Tensor[]` or `TensorLike[]`');\n }\n const tensors = arg as T[];\n return tensors.map(\n (t, i) => convertToTensor(t, `${argName}[${i}]`, functionName));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\n\n/**\n * Used for wrapping functions that perform math operations on\n * Tensors. The function will be wrapped in a named scope that cleans all\n * memory usage after the function is done.\n */\nexport function op(f: {[name: string]: T}): T {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(\n `Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n\n let opName = keys[0];\n const fn = f[opName];\n\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n\n // tslint:disable-next-line:no-any\n const f2 = (...args: any[]) => {\n ENV.engine.startScope(opName);\n try {\n const result = fn(...args);\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n ENV.engine.endScope(result);\n return result;\n } catch (ex) {\n ENV.engine.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', {value: opName, configurable: true});\n\n // tslint:disable-next-line:no-any\n return f2 as any as T;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {customGrad} from '../gradients';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * Computes the softmax normalized vector given the logits.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * ```js\n * const a = tf.tensor2d([2, 4, 6, 1, 2, 3], [2, 3]);\n *\n * a.softmax().print(); // or tf.softmax(a)\n * ```\n *\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction softmax_(logits: T|TensorLike, dim = -1): T {\n const $logits = convertToTensor(logits, 'logits', 'softmax');\n\n if (dim === -1) {\n dim = $logits.rank - 1;\n }\n if (dim !== $logits.rank - 1) {\n throw Error(\n 'Softmax along a non-last dimension is not yet supported. ' +\n `Logits was rank ${$logits.rank} and dim was ${dim}`);\n }\n\n const customOp = customGrad(logits => {\n // Do it in log space for numerical stability.\n // exp(X - logSumExp(X))\n const keepDims = true;\n const lse = logits.logSumExp([dim], keepDims);\n const logResult = logits.toFloat().sub(lse);\n const y = logResult.exp() as T;\n\n const gradFunc = (dy: T) => {\n const dyTimesY = dy.mul(y);\n const keepDims = true;\n return dyTimesY.sub(dyTimesY.sum([dim], keepDims).mul(y));\n };\n\n return {value: y, gradFunc};\n });\n\n return customOp($logits);\n}\n\nexport const softmax = op({softmax_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, Tensor6D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike, TensorLike1D, TensorLike2D, TensorLike3D, TensorLike4D, TensorLike5D, TensorLike6D} from '../types';\nimport {ArrayData, DataType, Rank, ShapeMap} from '../types';\nimport {assertNonNull, assertShapesMatch, getTypedArrayFromDType, inferShape, isTypedArray, makeOnesTypedArray, makeZerosTypedArray, sizeFromShape, toTypedArray} from '../util';\nimport {op} from './operation';\n\n/**\n * Creates a `Tensor` with the provided values, shape and dtype.\n *\n * ```js\n * // Pass an array of values to create a vector.\n * tf.tensor([1, 2, 3, 4]).print();\n * ```\n *\n * ```js\n * // Pass a nested array of values to make a matrix or a higher\n * // dimensional tensor.\n * tf.tensor([[1, 2], [3, 4]]).print();\n * ```\n *\n * ```js\n * // Pass a flat array and specify a shape yourself.\n * tf.tensor([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor(\n values: TensorLike, shape?: ShapeMap[R],\n dtype: DataType = 'float32'): Tensor {\n if (!isTypedArray(values) && !Array.isArray(values) &&\n typeof values !== 'number' && typeof values !== 'boolean') {\n throw new Error(\n 'values passed to tensor(values) must be an ' +\n 'array of numbers or booleans, or a TypedArray');\n }\n const inferredShape = inferShape(values);\n if (shape != null && inferredShape.length !== 1) {\n assertShapesMatch(\n shape, inferredShape,\n `Error creating a new Tensor. ` +\n `Inferred shape (${inferredShape}) does not match the ` +\n `provided shape (${shape}). `);\n }\n if (!isTypedArray(values) && !Array.isArray(values)) {\n values = [values] as number[];\n }\n shape = shape || inferredShape;\n return Tensor.make(\n shape, {\n values:\n toTypedArray(values as ArrayData, dtype, ENV.get('DEBUG'))\n },\n dtype);\n}\n\n/**\n * Creates rank-0 `Tensor` (scalar) with the provided value and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `scalar` as it makes the code more readable.\n *\n * ```js\n * tf.scalar(3.14).print();\n * ```\n *\n * @param value The value of the scalar.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction scalar(value: number|boolean, dtype: DataType = 'float32'): Scalar {\n if (isTypedArray(value) || Array.isArray(value)) {\n throw new Error(\n 'Error creating a new Scalar: value must be a primitive ' +\n '(number|boolean)');\n }\n return tensor(value, [], dtype);\n}\n\n/**\n * Creates rank-1 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor1d` as it makes the code more readable.\n *\n * ```js\n * tf.tensor1d([1, 2, 3]).print();\n * ```\n *\n * @param values The values of the tensor. Can be array of numbers,\n * or a `TypedArray`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor1d(values: TensorLike1D, dtype: DataType = 'float32'): Tensor1D {\n assertNonNull(values);\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 1) {\n throw new Error('tensor1d() requires values to be a flat/TypedArray');\n }\n return tensor(values, inferredShape as [number], dtype);\n}\n\n/**\n * Creates rank-2 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor2d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor2d([[1, 2], [3, 4]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. If not provided, it is inferred from\n * `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor2d(\n values: TensorLike2D, shape?: [number, number],\n dtype: DataType = 'float32'): Tensor2D {\n assertNonNull(values);\n if (shape != null && shape.length !== 2) {\n throw new Error('tensor2d() requires shape to have two numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 2 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor2d() requires values to be number[][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor2d() requires shape to be provided when `values` ' +\n 'are a flat/TypedArray');\n }\n shape = shape || inferredShape as [number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-3 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor3d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor3d([[[1], [2]], [[3], [4]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor3d([1, 2, 3, 4], [2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. If not provided, it is inferred from\n * `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor3d(\n values: TensorLike3D, shape?: [number, number, number],\n dtype: DataType = 'float32'): Tensor3D {\n assertNonNull(values);\n if (shape != null && shape.length !== 3) {\n throw new Error('tensor3d() requires shape to have three numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 3 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor3d() requires values to be number[][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor3d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape || inferredShape as [number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-4 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor4d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor4d([[[[1], [2]], [[3], [4]]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor4d(\n values: TensorLike4D, shape?: [number, number, number, number],\n dtype: DataType = 'float32'): Tensor4D {\n assertNonNull(values);\n if (shape != null && shape.length !== 4) {\n throw new Error('tensor4d() requires shape to have four numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 4 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor4d() requires values to be number[][][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor4d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape || inferredShape as [number, number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-5 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor5d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor5d([[[[[1], [2]], [[3], [4]]]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor5d([1, 2, 3, 4, 5, 6, 7, 8], [1, 2, 2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor5d(\n values: TensorLike5D, shape?: [number, number, number, number, number],\n dtype: DataType = 'float32'): Tensor5D {\n assertNonNull(values);\n if (shape != null && shape.length !== 5) {\n throw new Error('tensor5d() requires shape to have five numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 5 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor5d() requires values to be ' +\n 'number[][][][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor5d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape || inferredShape as [number, number, number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates rank-6 `Tensor` with the provided values, shape and dtype.\n *\n * The same functionality can be achieved with `tensor`, but in general\n * we recommend using `tensor6d` as it makes the code more readable.\n *\n * ```js\n * // Pass a nested array.\n * tf.tensor6d([[[[[[1],[2]],[[3],[4]]],[[[5],[6]],[[7],[8]]]]]]).print();\n * ```\n * ```js\n * // Pass a flat array and specify a shape.\n * tf.tensor6d([1, 2, 3, 4, 5, 6, 7, 8], [1, 1, 2, 2, 2, 1]).print();\n * ```\n *\n * @param values The values of the tensor. Can be nested array of numbers,\n * or a flat array, or a `TypedArray`.\n * @param shape The shape of the tensor. Optional. If not provided,\n * it is inferred from `values`.\n * @param dtype The data type.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction tensor6d(\n values: TensorLike6D,\n shape?: [number, number, number, number, number, number],\n dtype: DataType = 'float32'): Tensor6D {\n assertNonNull(values);\n if (shape != null && shape.length !== 6) {\n throw new Error('tensor6d() requires shape to have six numbers');\n }\n const inferredShape = inferShape(values);\n if (inferredShape.length !== 6 && inferredShape.length !== 1) {\n throw new Error(\n 'tensor6d() requires values to be number[][][][] or flat/TypedArray');\n }\n if (inferredShape.length === 1 && shape == null) {\n throw new Error(\n 'tensor6d() requires shape to be provided when `values` ' +\n 'are a flat array');\n }\n shape = shape ||\n inferredShape as [number, number, number, number, number, number];\n return tensor(values, shape, dtype);\n}\n\n/**\n * Creates a `Tensor` with all elements set to 1.\n *\n * ```js\n * tf.ones([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction ones(\n shape: ShapeMap[R], dtype: DataType = 'float32'): Tensor {\n const values = makeOnesTypedArray(sizeFromShape(shape), dtype);\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` with all elements set to 0.\n *\n * ```js\n * tf.zeros([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The type of an element in the resulting tensor. Can\n * be 'float32', 'int32' or 'bool'. Defaults to 'float'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction zeros(\n shape: ShapeMap[R], dtype: DataType = 'float32'): Tensor {\n const values = makeZerosTypedArray(sizeFromShape(shape), dtype);\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` filled with a scalar value.\n *\n * ```js\n * tf.fill([2, 2], 4).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param value The scalar value to fill the tensor with.\n * @param dtype The type of an element in the resulting tensor. Defaults to\n * 'float'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction fill(\n shape: ShapeMap[R], value: number, dtype: DataType = 'float32'): Tensor {\n const values = getTypedArrayFromDType(dtype, sizeFromShape(shape));\n values.fill(value);\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` with all elements set to 1 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.onesLike(x).print();\n * ```\n * @param x A tensor.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction onesLike_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'onesLike');\n return ones($x.shape, $x.dtype) as T;\n}\n\n/**\n * Creates a `Tensor` with all elements set to 0 with the same shape as the\n * given tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n * tf.zerosLike(x).print();\n * ```\n *\n * @param x The tensor of required shape.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction zerosLike_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'zerosLike');\n return zeros($x.shape, $x.dtype) as T;\n}\n\n/**\n * Return an evenly spaced sequence of numbers over the given interval.\n *\n * ```js\n * tf.linspace(0, 9, 10).print();\n * ```\n * @param start The start value of the sequence.\n * @param stop The end value of the sequence.\n * @param num The number of values to generate.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction linspace(start: number, stop: number, num: number): Tensor1D {\n if (num === 0) {\n throw new Error('Cannot request zero samples');\n }\n\n const step = (stop - start) / (num - 1);\n\n const values = makeZerosTypedArray(num, 'float32');\n values[0] = start;\n for (let i = 1; i < values.length; i++) {\n values[i] = values[i - 1] + step;\n }\n\n return tensor1d(values, 'float32');\n}\n\n/**\n * Creates a new `Tensor1D` filled with the numbers in the range provided.\n *\n * The tensor is a is half-open interval meaning it includes start, but\n * excludes stop. Decrementing ranges and negative step values are also\n * supported.\n *\n * ```js\n * tf.range(0, 9, 2).print();\n * ```\n *\n * @param start An integer start value\n * @param stop An integer stop value\n * @param step An integer increment (will default to 1 or -1)\n * @param dtype The data type of the output tensor. Defaults to 'float32'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction range(\n start: number, stop: number, step = 1,\n dtype: 'float32'|'int32' = 'float32'): Tensor1D {\n if (step === 0) {\n throw new Error('Cannot have a step of zero');\n }\n\n const sameStartStop = start === stop;\n const increasingRangeNegativeStep = start < stop && step < 0;\n const decreasingRangePositiveStep = stop < start && step > 1;\n\n if (sameStartStop || increasingRangeNegativeStep ||\n decreasingRangePositiveStep) {\n return zeros([0], dtype);\n }\n\n const numElements = Math.abs(Math.ceil((stop - start) / step));\n const values = makeZerosTypedArray(numElements, dtype);\n\n if (stop < start && step === 1) {\n // Auto adjust the step's sign if it hasn't been set\n // (or was set to 1)\n step = -1;\n }\n\n values[0] = start;\n for (let i = 1; i < values.length; i++) {\n values[i] = values[i - 1] + step;\n }\n\n return tensor1d(values, dtype);\n}\n\nexport {\n fill,\n linspace,\n ones,\n range,\n scalar,\n tensor,\n tensor1d,\n tensor2d,\n tensor3d,\n tensor4d,\n tensor5d,\n tensor6d,\n zeros\n};\n\nexport const onesLike = op({onesLike_});\nexport const zerosLike = op({zerosLike_});\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport enum DType {\n float32 = 'float32',\n int32 = 'int32',\n bool = 'bool'\n}\n\n/** @docalias number[] */\nexport interface ShapeMap {\n R0: number[];\n R1: [number];\n R2: [number, number];\n R3: [number, number, number];\n R4: [number, number, number, number];\n R5: [number, number, number, number, number];\n R6: [number, number, number, number, number, number];\n}\n\n/** @hidden */\nexport interface DataTypeMap {\n float32: Float32Array;\n int32: Int32Array;\n bool: Uint8Array;\n}\n/** @docalias 'float32'|'int32'|'bool' */\nexport type DataType = keyof DataTypeMap;\nexport type TypedArray = DataTypeMap[DataType];\n\nexport enum Rank {\n R0 = 'R0',\n R1 = 'R1',\n R2 = 'R2',\n R3 = 'R3',\n R4 = 'R4',\n R5 = 'R5',\n R6 = 'R6'\n}\n\nexport type FlatVector = boolean[]|number[]|TypedArray;\nexport type RegularArray =\n T[]|T[][]|T[][][]|T[][][][]|T[][][][][]|T[][][][][][];\nexport type ArrayData =\n DataTypeMap[D]|RegularArray|RegularArray;\n\n// tslint:disable-next-line:no-any\nexport interface RecursiveArray {\n [index: number]: T|RecursiveArray;\n}\n\nenum UpcastInt32AndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'int32'\n}\n\nenum UpcastBoolAndMap {\n 'float32' = 'float32',\n 'int32' = 'int32',\n 'bool' = 'bool'\n}\n\nenum UpcastFloat32AndMap {\n 'float32' = 'float32',\n 'int32' = 'float32',\n 'bool' = 'float32'\n}\n\nconst upcastTypeMap = {\n 'float32': UpcastFloat32AndMap,\n 'int32': UpcastInt32AndMap,\n 'bool': UpcastBoolAndMap\n};\n\nexport function upcastType(typeA: DataType, typeB: DataType): DataType {\n return upcastTypeMap[typeA][typeB];\n}\n\n/** Returns the output type after summation. */\nexport function sumOutType(type: DataType) {\n return upcastType(type, 'int32');\n}\n\n/** @docalias TypedArray|Array */\nexport type TensorLike =\n TypedArray|number|boolean|number[]|number[][]|number[][][]|number[][][][]|\n number[][][][][]|number[][][][][][]|boolean[]|boolean[][]|boolean[][][]|\n boolean[][][][]|boolean[][][][][]|boolean[][][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike1D = TypedArray|number[]|boolean[];\n/** @docalias TypedArray|Array */\nexport type TensorLike2D = TypedArray|number[]|number[][]|boolean[]|boolean[][];\n/** @docalias TypedArray|Array */\nexport type TensorLike3D =\n TypedArray|number[]|number[][][]|boolean[]|boolean[][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike4D =\n TypedArray|number[]|number[][][][]|boolean[]|boolean[][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike5D =\n TypedArray|number[]|number[][][][][]|boolean[]|boolean[][][][][];\n/** @docalias TypedArray|Array */\nexport type TensorLike6D =\n TypedArray|number[]|number[][][][][][]|boolean[]|boolean[][][][][][];\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {scalar} from '../ops/tensor_ops';\nimport {Tensor} from '../tensor';\nimport {Rank} from '../types';\nimport {DataType, ShapeMap} from '../types';\nimport {hasEncodingLoss} from '../util';\nimport {KernelBackend} from './backend';\n\nexport function castTensor(\n x: T, dtype: DataType, backend: KernelBackend): T {\n if (!hasEncodingLoss(x.dtype, dtype)) {\n // We don't change the underlying data, since we cast to higher\n // precision.\n return Tensor.make(x.shape, {dataId: x.dataId}, dtype) as T;\n }\n if (dtype === 'int32') {\n return backend.int(x);\n } else if (dtype === 'bool') {\n return backend.notEqual(x, scalar(0, x.dtype)) as T;\n } else {\n throw new Error(`Error in Cast: unknown dtype argument (${dtype})`);\n }\n}\n\nexport function reshapeTensor(\n x: T, shape: ShapeMap[R]): Tensor {\n return Tensor.make(shape, {dataId: x.dataId}, x.dtype);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Implementation of the NonMaxSuppression kernel shared between webgl and cpu.\n */\n\nimport {tensor1d} from '../ops/tensor_ops';\nimport {Tensor1D} from '../tensor';\nimport {TypedArray} from '../types';\n\nexport function nonMaxSuppressionImpl(\n boxes: TypedArray, scores: TypedArray, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number): Tensor1D {\n const candidates = Array.from(scores)\n .map((score, boxIndex) => ({score, boxIndex}))\n .filter(c => c.score > scoreThreshold)\n .sort((c1, c2) => c2.score - c1.score);\n\n const selected: number[] = [];\n\n for (let i = 0; i < candidates.length; i++) {\n const {score, boxIndex} = candidates[i];\n if (score < scoreThreshold) {\n break;\n }\n\n let ignoreCandidate = false;\n for (let j = selected.length - 1; j >= 0; --j) {\n const iou = intersectionOverUnion(boxes, boxIndex, selected[j]);\n if (iou >= iouThreshold) {\n ignoreCandidate = true;\n break;\n }\n }\n\n if (!ignoreCandidate) {\n selected.push(boxIndex);\n if (selected.length >= maxOutputSize) {\n break;\n }\n }\n }\n\n return tensor1d(selected, 'int32');\n}\n\nfunction intersectionOverUnion(boxes: TypedArray, i: number, j: number) {\n const iCoord = boxes.subarray(i * 4, i * 4 + 4);\n const jCoord = boxes.subarray(j * 4, j * 4 + 4);\n const yminI = Math.min(iCoord[0], iCoord[2]);\n const xminI = Math.min(iCoord[1], iCoord[3]);\n const ymaxI = Math.max(iCoord[0], iCoord[2]);\n const xmaxI = Math.max(iCoord[1], iCoord[3]);\n const yminJ = Math.min(jCoord[0], jCoord[2]);\n const xminJ = Math.min(jCoord[1], jCoord[3]);\n const ymaxJ = Math.max(jCoord[0], jCoord[2]);\n const xmaxJ = Math.max(jCoord[1], jCoord[3]);\n const areaI = (ymaxI - yminI) * (xmaxI - xminI);\n const areaJ = (ymaxJ - yminJ) * (xmaxJ - xminJ);\n if (areaI <= 0 || areaJ <= 0) {\n return 0.0;\n }\n const intersectionYmin = Math.max(yminI, yminJ);\n const intersectionXmin = Math.max(xminI, xminJ);\n const intersectionYmax = Math.min(ymaxI, ymaxJ);\n const intersectionXmax = Math.min(xmaxI, xmaxJ);\n const intersectionArea = Math.max(intersectionYmax - intersectionYmin, 0.0) *\n Math.max(intersectionXmax - intersectionXmin, 0.0);\n return intersectionArea / (areaI + areaJ - intersectionArea);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** An implementation of the TopK kernel shared between webgl and cpu. */\n\nimport {tensor} from '../ops/tensor_ops';\nimport {Tensor} from '../tensor';\nimport {DataType, TypedArray} from '../types';\nimport {getTypedArrayFromDType} from '../util';\n\nexport function topkImpl(\n x: TypedArray, xShape: number[], xDtype: DataType, k: number,\n sorted: boolean): [T, T] {\n // Reshape into a 2d tensor [batch, lastDim] and compute topk along lastDim.\n const lastDim = xShape[xShape.length - 1];\n const [batch, size] = [x.length / lastDim, lastDim];\n const allTopKVals = getTypedArrayFromDType(xDtype, batch * k);\n const allTopKIndices = getTypedArrayFromDType('int32', batch * k);\n\n for (let b = 0; b < batch; b++) {\n const offset = b * size;\n const vals = x.subarray(offset, offset + size);\n const valAndInd: Array<{value: number, index: number}> = [];\n for (let i = 0; i < vals.length; i++) {\n valAndInd.push({value: vals[i], index: i});\n }\n valAndInd.sort((a, b) => b.value - a.value);\n\n const outOffset = b * k;\n const topKVals = allTopKVals.subarray(outOffset, outOffset + k);\n const topKIndices = allTopKIndices.subarray(outOffset, outOffset + k);\n for (let i = 0; i < k; i++) {\n topKVals[i] = valAndInd[i].value;\n topKIndices[i] = valAndInd[i].index;\n }\n }\n // Reshape back to the original input shape, except that the last\n // dimension is k.\n const outputShape = xShape.slice();\n outputShape[outputShape.length - 1] = k;\n return [\n tensor(allTopKVals, outputShape, xDtype) as T,\n tensor(allTopKIndices, outputShape, 'int32') as T\n ];\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ReduceInfo} from '../../ops/reduce_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ArgMinMaxProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[];\n userCode: string;\n\n constructor(reduceInfo: ReduceInfo, op: 'max'|'min', firstPass: boolean) {\n const windowSize = reduceInfo.windowSize;\n const batchSize = reduceInfo.batchSize;\n const inSize = reduceInfo.inSize;\n const outSize = Math.ceil(inSize / windowSize);\n if (!firstPass) {\n this.variableNames.push('bestIndicesA');\n }\n this.outputShape = [batchSize, outSize];\n const compOp = (op === 'max') ? '>' : '<';\n const indexSnippet = firstPass ?\n 'inOffset + i;' :\n 'round(getBestIndicesA(batch, inOffset + i));';\n\n this.userCode = `\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${windowSize};\n\n int bestIndex = 0;\n float bestValue = getA(batch, inOffset);\n\n for (int i = 0; i < ${windowSize}; i++) {\n int inIdx = ${indexSnippet};\n float candidate = getA(batch, inIdx);\n if (candidate ${compOp} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class AvgPool2DBackpropProgram implements GPGPUProgram {\n variableNames = ['dy'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n\n const avgMultiplier = 1 / (filterHeight * filterWidth);\n\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n const float avgMultiplier = float(${avgMultiplier});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport function getBroadcastDims(\n inShape: number[], outShape: number[]): number[] {\n const inRank = inShape.length;\n const dims: number[] = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n}\n\n/**\n * Returns the axes in the output space that should be reduced to produce\n * the input space.\n */\nexport function getReductionAxes(\n inShape: number[], outShape: number[]): number[] {\n const result: number[] = [];\n for (let i = 0; i < outShape.length; i++) {\n const inDim = inShape[inShape.length - i - 1];\n const outAxis = outShape.length - i - 1;\n const outDim = outShape[outAxis];\n if (inDim == null || (inDim === 1 && outDim > 1)) {\n result.unshift(outAxis);\n }\n }\n return result;\n}\n\n/**\n * Given the output of `getBroadcastDims()`, returns true if the broadcasting\n * is along the outer-most dimensions of the input.\n */\nexport function broadcastDimsAreOuter(dims: number[]): boolean {\n for (let i = 0; i < dims.length; i++) {\n if (dims[i] !== i) {\n return false;\n }\n }\n return true;\n}\n\nexport function assertAndGetBroadcastShape(\n shapeA: number[], shapeB: number[]): number[] {\n const result: number[] = [];\n const errMsg = `Operands could not be broadcast together with shapes ` +\n `${shapeA} and ${shapeB}.`;\n const l = Math.max(shapeA.length, shapeB.length);\n\n for (let i = 0; i < l; i++) {\n const a = shapeA[shapeA.length - i - 1] || 1;\n const b = shapeB[shapeB.length - i - 1] || 1;\n if (a > 1 && b > 1 && a !== b) {\n throw Error(errMsg);\n }\n result.unshift(Math.max(a, b));\n }\n return result;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as broadcast_util from '../../ops/broadcast_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class BatchNormProgram implements GPGPUProgram {\n variableNames: string[];\n outputShape: number[] = [];\n userCode: string;\n supportsBroadcasting = true;\n\n constructor(\n xShape: number[], meanShape: number[], varianceShape: number[],\n offsetShape: number[]|null, scaleShape: number[]|null,\n varianceEpsilon: number) {\n this.variableNames = ['x', 'mean', 'variance'];\n broadcast_util.assertAndGetBroadcastShape(xShape, meanShape);\n broadcast_util.assertAndGetBroadcastShape(xShape, varianceShape);\n\n let offsetSnippet = '0.0';\n if (offsetShape != null) {\n broadcast_util.assertAndGetBroadcastShape(xShape, offsetShape);\n this.variableNames.push('offset');\n offsetSnippet = 'getOffsetAtOutCoords()';\n }\n\n let scaleSnippet = '1.0';\n if (scaleShape != null) {\n broadcast_util.assertAndGetBroadcastShape(xShape, scaleShape);\n this.variableNames.push('scale');\n scaleSnippet = 'getScaleAtOutCoords()';\n }\n\n this.outputShape = xShape;\n this.userCode = `\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${offsetSnippet};\n float scale = ${scaleSnippet};\n float inv = scale * inversesqrt(variance + float(${varianceEpsilon}));\n setOutput((x - mean) * inv + offset);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as broadcast_util from '../../ops/broadcast_util';\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {GPGPUProgram} from './gpgpu_math';\n\nconst CHECK_NAN_SNIPPET = `\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n`;\n\nexport const ADD = 'return a + b;';\nexport const SUB = 'return a - b;';\nexport const MUL = 'return a * b;';\nexport const DIV = `if (a == b) return 1.0;\n return a / b;`;\n\n// We use native integer division to deal with floating point imprecision. Since\n// we implement floor division and glsl implements truncated division, we\n// correct for this by subtracting 1 from result when the result is negative and\n// there is a remainder.\nexport const INT_DIV = `\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n`;\n\nexport const POW = `\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n`;\nexport const SQUARED_DIFFERENCE = 'return (a - b) * (a - b);';\n\nexport const EQUAL = `return float(a == b);`;\n\nexport const NOT_EQUAL = `return float(a != b);`;\n\nexport const LESS = `return float(a < b);`;\n\nexport const LESS_EQUAL = `return float(a <= b);`;\n\nexport const GREATER = `return float(a > b);`;\n\nexport const GREATER_EQUAL = `return float(a >= b);`;\n\nexport const LOGICAL_AND = `return float(a >= 1.0 && b >= 1.0);`;\n\nexport const LOGICAL_OR = `return float(a >= 1.0 || b >= 1.0);`;\n\nexport const MAX = CHECK_NAN_SNIPPET + `\n return max(a, b);\n`;\nexport const MIN = CHECK_NAN_SNIPPET + `\n return min(a, b);\n`;\nexport const MOD = `if (b == 0.0) return NAN;\n return mod(a, b);`;\n\nexport const ATAN2 = CHECK_NAN_SNIPPET + `\n return atan(a, b);\n`;\n\nexport const ELU_DER = `return (b >= 1.0) ? a : a * (b + 1.0);`;\n\nexport class BinaryOpProgram implements GPGPUProgram {\n variableNames = ['A', 'B'];\n outputShape: number[];\n userCode: string;\n supportsBroadcasting = true;\n\n // Caching uniform location for speed.\n startLoc: WebGLUniformLocation;\n\n constructor(op: string, aShape: number[], bShape: number[]) {\n this.outputShape =\n broadcast_util.assertAndGetBroadcastShape(aShape, bShape);\n this.userCode = `\n uniform float NAN;\n float binaryOperation(float a, float b) {\n ${op}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `;\n }\n\n getCustomSetupFunc() {\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.startLoc == null) {\n this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN');\n if (this.startLoc == null) {\n // This means the compiler has optimized and realized it doesn't need\n // the uniform.\n return;\n }\n }\n gpgpu.gl.uniform1f(this.startLoc, NaN);\n };\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ClipProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n constructor(aShape: number[], min: number, max: number) {\n this.outputShape = aShape;\n const minFixed = min.toFixed(20);\n const maxFixed = max.toFixed(20);\n this.userCode = `\n void main() {\n float value = getAAtOutCoords();\n if (isNaN(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, ${minFixed}, ${maxFixed}));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as util from '../util';\n\nexport function assertParams(aShape: number[], bShape: number[], axis: number) {\n const aRank = aShape.length;\n const bRank = bShape.length;\n util.assert(\n aShape.length === bShape.length,\n `Error in concat${aRank}D: rank of x1 (${aRank}) and x2 (${bRank}) ` +\n `must be the same.`);\n\n util.assert(\n axis >= 0 && axis < aRank,\n `Error in concat${aRank}D: axis must be ` +\n `between 0 and ${aRank - 1}.`);\n\n for (let i = 0; i < aRank; i++) {\n util.assert(\n (i === axis) || (aShape[i] === bShape[i]),\n `Error in concat${aRank}D: Shape (${aShape}) does not match ` +\n `(${bShape}) along the non-concatenated axis ${i}.`);\n }\n}\n\nexport function computeOutShape(\n x1Shape: number[], x2Shape: number[], axis: number): number[] {\n util.assert(\n x1Shape.length === x2Shape.length,\n 'x1 and x2 should have the same rank.');\n const outputShape = x1Shape.slice();\n outputShape[axis] += x2Shape[axis];\n return outputShape;\n}\n\nexport function computeGradientSliceShapes(\n aShape: [number, number], bShape: [number, number]) {\n return {\n aBegin: [0, 0] as [number, number],\n aSize: aShape,\n bBegin: [0, aShape[1]] as [number, number],\n bSize: bShape\n };\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as concat_util from '../../ops/concat_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ConcatProgram implements GPGPUProgram {\n variableNames = ['A', 'B'];\n outputShape: number[] = [];\n userCode: string;\n\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n constructor(aShape: [number, number], bShape: [number, number]) {\n this.outputShape =\n concat_util.computeOutShape(aShape, bShape, 1 /* axis */);\n\n this.userCode = `\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n float value = 0.0;\n if (yC < ${aShape[1]}) {\n value = getA(yR, yC);\n } else {\n yC -= ${aShape[1]};\n value = getB(yR, yC);\n }\n\n setOutput(value);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class Conv2DDerFilterProgram implements GPGPUProgram {\n variableNames = ['x', 'dy'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.filterShape;\n\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${convInfo.batchSize}; b++) {\n for (int yR = 0; yR < ${convInfo.outHeight}; yR++) {\n int xR = wR + yR * ${strideHeight} - ${padTop};\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${convInfo.outWidth}; yC++) {\n int xC = wC + yC * ${strideWidth} - ${padLeft};\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n\nexport class Conv2DDerInputProgram implements GPGPUProgram {\n variableNames = ['dy', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${filterHeight} - 1 - wR;\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${filterWidth} - 1 - wC;\n\n for (int d2 = 0; d2 < ${convInfo.outChannels}; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class DepthwiseConv2DDerFilterProgram implements GPGPUProgram {\n variableNames = ['x', 'dy'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.filterShape;\n\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n const channelMul = convInfo.outChannels / convInfo.inChannels;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${channelMul} + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < ${convInfo.batchSize}; b++) {\n for (int yR = 0; yR < ${convInfo.outHeight}; yR++) {\n int xR = wR + yR * ${strideHeight} - ${padTop};\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${convInfo.outWidth}; yC++) {\n int xC = wC + yC * ${strideWidth} - ${padLeft};\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n\nexport class DepthwiseConv2DDerInputProgram implements GPGPUProgram {\n variableNames = ['dy', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n const channelMul = convInfo.outChannels / convInfo.inChannels;\n\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${filterHeight} - 1 - wR;\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${filterWidth} - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < ${channelMul}; dm++) {\n int d2 = d1 * ${channelMul} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class Conv2DProgram implements GPGPUProgram {\n variableNames = ['x', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.outShape;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n\n const inputDepthNearestVec4 = Math.floor(convInfo.inChannels / 4) * 4;\n const inputDepthVec4Remainder = convInfo.inChannels % 4;\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR * ${dilationHeight};\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n int xC = xCCorner + wC * ${dilationWidth};\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${inputDepthNearestVec4}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${inputDepthVec4Remainder === 1}) {\n dotProd +=\n getX(batch, xR, xC, ${inputDepthNearestVec4}) *\n getW(wR, wC, ${inputDepthNearestVec4}, d2);\n } else if (${inputDepthVec4Remainder === 2}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${inputDepthNearestVec4}),\n getX(batch, xR, xC, ${inputDepthNearestVec4} + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, ${inputDepthNearestVec4}, d2),\n getW(wR, wC, ${inputDepthNearestVec4} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${inputDepthVec4Remainder === 3}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${inputDepthNearestVec4}),\n getX(batch, xR, xC, ${inputDepthNearestVec4} + 1),\n getX(batch, xR, xC, ${inputDepthNearestVec4} + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, ${inputDepthNearestVec4}, d2),\n getW(wR, wC, ${inputDepthNearestVec4} + 1, d2),\n getW(wR, wC, ${inputDepthNearestVec4} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class DepthwiseConv2DProgram implements GPGPUProgram {\n variableNames = ['x', 'W'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.outShape;\n\n const xNumRows = convInfo.inHeight;\n const xNumCols = convInfo.inWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const channelMul = convInfo.outChannels / convInfo.inChannels;\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${channelMul};\n int q = d2 - d1 * ${channelMul};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR * ${dilationHeight};\n\n if (xR < 0 || xR >= ${xNumRows}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n int xC = xCCorner + wC * ${dilationWidth};\n\n if (xC < 0 || xC >= ${xNumCols}) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport * as broadcast_util from '../../ops/broadcast_util';\nimport * as util from '../../util';\n\nexport type ShapeInfo = {\n logicalShape: number[],\n texShape: [number, number],\n isUniform: boolean\n};\n\nexport type InputInfo = {\n name: string,\n shapeInfo: ShapeInfo\n};\n\nexport function makeShader(\n inputsInfo: InputInfo[], outputShape: ShapeInfo, userCode: string,\n broadcast: boolean): string {\n let inputPrefixSnippet: string[]|string = inputsInfo.map(x => {\n const size = util.sizeFromShape(x.shapeInfo.logicalShape);\n if (x.shapeInfo.isUniform) {\n return `uniform float ${x.name}${size > 1 ? `[${size}]` : ''};`;\n }\n return `uniform sampler2D ${x.name};`;\n });\n inputPrefixSnippet = inputPrefixSnippet.join('\\n');\n const inputSamplingSnippet =\n inputsInfo.map(x => getInputSamplingSnippet(x, outputShape, broadcast))\n .join('\\n');\n const outTexShape = outputShape.texShape;\n const outputSamplingSnippet =\n getOutputSamplingSnippet(outputShape.logicalShape, outTexShape);\n const source = [\n SHADER_PREFIX, FLOAT_TEXTURE_SAMPLE_SNIPPET,\n FLOAT_TEXTURE_SETOUTPUT_SNIPPET, inputPrefixSnippet, outputSamplingSnippet,\n inputSamplingSnippet, userCode\n ].join('\\n');\n return source;\n}\n\nfunction getSamplerFromInInfo(inInfo: InputInfo): string {\n const shape = inInfo.shapeInfo.logicalShape;\n switch (shape.length) {\n case 0:\n return getSamplerScalar(inInfo);\n case 1:\n return getSampler1D(inInfo);\n case 2:\n return getSampler2D(inInfo);\n case 3:\n return getSampler3D(inInfo);\n case 4:\n return getSampler4D(inInfo);\n case 5:\n return getSampler5D(inInfo);\n case 6:\n return getSampler6D(inInfo);\n default:\n throw new Error(\n `${shape.length}-D input sampling` +\n ` is not yet supported`);\n }\n}\n\nfunction getInputSamplingSnippet(\n inInfo: InputInfo, outShapeInfo: ShapeInfo, broadcast: boolean): string {\n let res = getSamplerFlat(inInfo);\n res += getSamplerFromInInfo(inInfo);\n\n // If input and output have matching logical shapes, add\n // getTexNameAtOutCoord() method that samples the input\n // textureSampler using the output coordinates.\n if (broadcast ||\n util.arraysEqual(\n inInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape)) {\n res += getSamplerAtOutputCoords(inInfo, outShapeInfo, broadcast);\n }\n return res;\n}\n\nfunction getOutputSamplingSnippet(\n outShape: number[], outTexShape: [number, number]): string {\n switch (outShape.length) {\n case 0:\n return getOutputScalarCoords();\n case 1:\n return getOutput1DCoords(outShape as [number], outTexShape);\n case 2:\n return getOutput2DCoords(outShape as [number, number], outTexShape);\n case 3:\n return getOutput3DCoords(\n outShape as [number, number, number], outTexShape);\n case 4:\n return getOutput4DCoords(\n outShape as [number, number, number, number], outTexShape);\n case 5:\n return getOutput5DCoords(\n outShape as [number, number, number, number, number], outTexShape);\n case 6:\n return getOutput6DCoords(\n outShape as [number, number, number, number, number, number],\n outTexShape);\n default:\n throw new Error(\n `${outShape.length}-D output sampling is not yet supported`);\n }\n}\n\nconst SAMPLE_1D_SNIPPET = `\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_2D_SNIPPET = `\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\n int index = row * numC + col;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_3D_SNIPPET = `\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\n int stride1, int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_4D_SNIPPET = `\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int row, int col, int depth,\n int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_5D_SNIPPET = `\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int row, int col, int depth,\n int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2 * stride3 + depth3;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst SAMPLE_6D_SNIPPET = `\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int stride4,\n int row, int col, int depth, int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\n stride3 + depth3 * stride4 + depth4;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`;\n\nconst FLOAT_TEXTURE_SAMPLE_SNIPPET = `\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return texture2D(textureSampler, uv).r;\n }\n`;\n\nconst FLOAT_TEXTURE_SETOUTPUT_SNIPPET = `\n void setOutput(float val) {\n gl_FragColor = vec4(val, 0, 0, 0);\n }\n`;\n\nconst SHADER_PREFIX = `\n precision highp float;\n precision highp int;\n varying vec2 resultUV;\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n bool isNaN(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n bool hasNaN(vec4 values) {\n vec4 v1 = values * values;\n vec4 v2 = values * values;\n return any(notEqual(v1, v2));\n }\n\n float getNaN(vec4 values) {\n return dot(vec4(1), values);\n }\n\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${SAMPLE_1D_SNIPPET}\n ${SAMPLE_2D_SNIPPET}\n ${SAMPLE_3D_SNIPPET}\n ${SAMPLE_4D_SNIPPET}\n ${SAMPLE_5D_SNIPPET}\n ${SAMPLE_6D_SNIPPET}\n`;\n\nfunction getOutputScalarCoords() {\n return `\n int getOutputCoords() {\n return 0;\n }\n `;\n}\n\nfunction getOutput1DCoords(\n shape: [number], texShape: [number, number]): string {\n if (texShape[0] === 1) {\n return `\n int getOutputCoords() {\n return int(resultUV.x * ${texShape[1]}.0);\n }\n `;\n }\n if (texShape[1] === 1) {\n return `\n int getOutputCoords() {\n return int(resultUV.y * ${texShape[0]}.0);\n }\n `;\n }\n return `\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n return resTexRC.x * ${texShape[1]} + resTexRC.y;\n }\n `;\n}\n\nfunction getOutput3DCoords(\n shape: [number, number, number], texShape: [number, number]): string {\n const stride0 = shape[1] * shape[2];\n const stride1 = shape[2];\n return `\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n int r = index / ${stride0};\n index -= r * ${stride0};\n int c = index / ${stride1};\n int d = index - c * ${stride1};\n return ivec3(r, c, d);\n }\n `;\n}\n\nfunction getOutput4DCoords(\n shape: [number, number, number, number],\n texShape: [number, number]): string {\n const stride2 = shape[3];\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n return `\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n\n int r = index / ${stride0};\n index -= r * ${stride0};\n\n int c = index / ${stride1};\n index -= c * ${stride1};\n\n int d = index / ${stride2};\n int d2 = index - d * ${stride2};\n\n return ivec4(r, c, d, d2);\n }\n `;\n}\n\nfunction getOutput5DCoords(\n shape: [number, number, number, number, number],\n texShape: [number, number]): string {\n const stride3 = shape[4];\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n return `\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(${texShape[0]},\n ${texShape[1]}));\n\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n\n int r = index / ${stride0};\n index -= r * ${stride0};\n\n int c = index / ${stride1};\n index -= c * ${stride1};\n\n int d = index / ${stride2};\n index -= d * ${stride2};\n\n int d2 = index / ${stride3};\n int d3 = index - d2 * ${stride3};\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n `;\n}\n\nfunction getOutput6DCoords(\n shape: [number, number, number, number, number, number],\n texShape: [number, number]): string {\n const stride4 = shape[5];\n const stride3 = shape[4] * stride4;\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n return `\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n\n int r = index / ${stride0};\n index -= r * ${stride0};\n\n int c = index / ${stride1};\n index -= c * ${stride1};\n\n int d = index / ${stride2};\n index -= d * ${stride2};\n\n int d2 = index / ${stride3};\n index -= d2 * ${stride3};\n\n int d3 = index / ${stride4};\n int d4 = index - d3 * ${stride4};\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n `;\n}\n\nfunction getOutput2DCoords(\n shape: [number, number], texShape: [number, number]): string {\n if (util.arraysEqual(shape, texShape)) {\n return `\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(${texShape[0]}, ${texShape[1]}));\n }\n `;\n }\n if (shape[1] === 1) {\n return `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n return ivec2(index, 0);\n }\n `;\n }\n if (shape[0] === 1) {\n return `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n return ivec2(0, index);\n }\n `;\n }\n return `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.x * ${texShape[1]} + resTexRC.y;\n int r = index / ${shape[1]};\n int c = index - r * ${shape[1]};\n return ivec2(r, c);\n }\n `;\n}\n\nfunction getSamplerScalar(inputInfo: InputInfo): string {\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n if (inputInfo.shapeInfo.isUniform) {\n return `float ${funcName}() {return ${texName};}`;\n }\n return `\n float ${funcName}() {\n return sampleTexture(${texName}, halfCR);\n }\n `;\n}\n\nfunction getSampler1D(inputInfo: InputInfo): string {\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n\n return `\n float ${funcName}(int index) {\n return ${funcName}Flat(index);\n }\n `;\n}\n\nfunction getSampler2D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n\n const texShape = inputInfo.shapeInfo.texShape;\n if (texShape != null && util.arraysEqual(shape, texShape)) {\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n return `\n float ${funcName}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n const squeezedShape = newShape;\n if (squeezedShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, squeezedShape);\n const params = ['row', 'col'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col) {\n int index = row * ${shape[1]} + col;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === 1) {\n return `\n float ${funcName}(int row, int col) {\n int index = row * ${shape[1]} + col;\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (texNumR === 1) {\n return `\n float ${funcName}(int row, int col) {\n int index = row * ${shape[1]} + col;\n vec2 uv = vec2((float(index) + 0.5) / ${texNumC}.0, 0.5);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int row, int col) {\n vec2 uv = UVfrom2D(${texNumR}, ${texNumC}, ${shape[1]}, row, col);\n return sampleTexture(${texName}, uv);\n }\n`;\n}\n\nfunction getSampler3D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride0 = shape[1] * shape[2];\n const stride1 = shape[2];\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n const squeezedShape = newShape;\n if (squeezedShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, squeezedShape);\n const params = ['row', 'col', 'depth'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth) {\n int index = row * ${stride0} + col * ${stride1} + depth;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth) {\n int texR = row;\n int texC = col * ${stride1} + depth;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n if (texNumC === stride1) {\n return `\n float ${funcName}(int row, int col, int depth) {\n int texR = row * ${shape[1]} + col;\n int texC = depth;\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n return `\n float ${funcName}(int row, int col, int depth) {\n vec2 uv = UVfrom3D(\n ${texNumR}, ${texNumC}, ${stride0}, ${stride1}, row, col, depth);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSampler4D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride2 = shape[3];\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n if (newShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, newShape);\n const params = ['row', 'col', 'depth', 'depth2'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth, int depth2) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int index = row * ${stride0} + col * ${stride1} +\n depth * ${stride2} + depth2;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int texR = row;\n int texC = col * ${stride1} + depth * ${stride2} + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (texNumC === stride2) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int texR = row * ${shape[1] * shape[2]} + col * ${shape[2]} + depth;\n int texC = depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int row, int col, int depth, int depth2) {\n vec2 uv = UVfrom4D(${texNumR}, ${texNumC}, ${stride0}, ${stride1},\n ${stride2}, row, col, depth, depth2);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSampler5D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride3 = shape[4];\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n const {newShape, keptDims} = util.squeezeShape(shape);\n if (newShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, newShape);\n const params = ['row', 'col', 'depth', 'depth2', 'depth3'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int index = row * ${stride0} + col * ${stride1} +\n depth * ${stride2} + depth2 * ${stride3} + depth3;\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n int texC = col * ${stride1} + depth * ${stride2} +\n depth2 * ${stride3} + depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n if (texNumC === stride3) {\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int texR = row * ${shape[1] * shape[2]} + col * ${shape[2]} +\n depth * ${shape[3]} + depth2;\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n\n return `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n vec2 uv = UVfrom5D(${texNumR}, ${texNumC}, ${stride0}, ${stride1},\n ${stride2}, ${stride3}, row, col, depth, depth2, depth3);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSampler6D(inputInfo: InputInfo): string {\n const shape = inputInfo.shapeInfo.logicalShape;\n const texName = inputInfo.name;\n const funcName = 'get' + texName.charAt(0).toUpperCase() + texName.slice(1);\n const stride4 = shape[5];\n const stride3 = shape[4] * stride4;\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n const {newShape, keptDims} = util.squeezeShape(shape);\n if (newShape.length < shape.length) {\n const newInputInfo = squeezeInputInfo(inputInfo, newShape);\n const params = ['row', 'col', 'depth', 'depth2', 'depth3', 'depth4'];\n return `\n ${getSamplerFromInInfo(newInputInfo)}\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n }\n\n if (inputInfo.shapeInfo.isUniform) {\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * ${stride0} + col * ${stride1} +\n depth * ${stride2} + depth2 * ${stride3} + depth3 * ${stride3}\n + depth4\n return ${funcName}Flat(index);\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n if (texNumC === stride0) {\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n int texC = col * ${stride1} + depth * ${stride2} + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (texNumC === stride4) {\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row * ${shape[1] * shape[2]} + col * ${shape[2]} + depth;\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${texNumC}.0, ${texNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n vec2 uv = UVfrom6D(${texNumR}, ${texNumC}, ${stride0}, ${stride1},\n ${stride2}, ${stride3}, ${stride4}\n ,row, col, depth, depth2, depth3, depth4);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getSamplerFlat(inputInfo: InputInfo): string {\n const texName = inputInfo.name;\n const funcName =\n 'get' + texName.charAt(0).toUpperCase() + texName.slice(1) + 'Flat';\n const inSize = util.sizeFromShape(inputInfo.shapeInfo.logicalShape);\n\n if (inputInfo.shapeInfo.isUniform) {\n if (inSize === 1) {\n return `float ${funcName}(int index) {return ${texName};}`;\n }\n return `\n float ${funcName}(int index) {\n for (int i = 0; i < ${inSize}; i++) {\n if (i == index) {\n return ${texName}[i];\n }\n }\n }\n `;\n }\n\n const texShape = inputInfo.shapeInfo.texShape;\n const tNumR = texShape[0];\n const tNumC = texShape[1];\n if (tNumC === 1 && tNumR === 1) {\n return `\n float ${funcName}(int index) {\n return sampleTexture(${texName}, halfCR);\n }\n `;\n }\n if (tNumC === 1) {\n return `\n float ${funcName}(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${tNumR}.0);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n if (tNumR === 1) {\n return `\n float ${funcName}(int index) {\n vec2 uv = vec2((float(index) + 0.5) / ${tNumC}.0, 0.5);\n return sampleTexture(${texName}, uv);\n }\n `;\n }\n return `\n float ${funcName}(int index) {\n vec2 uv = UVfrom1D(${tNumR}, ${tNumC}, index);\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nfunction getBroadcastOutputCoordsSampler(\n inputInfo: InputInfo, outShapeInfo: ShapeInfo, texFuncSnippet: string,\n funcName: string): string {\n const inRank = inputInfo.shapeInfo.logicalShape.length;\n const outRank = outShapeInfo.logicalShape.length;\n\n let type = 'int';\n if (outRank === 2) {\n type = 'ivec2';\n } else if (outRank === 3) {\n type = 'ivec3';\n } else if (outRank === 4) {\n type = 'ivec4';\n }\n const broadcastDims = broadcast_util.getBroadcastDims(\n inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape);\n const rankDiff = outRank - inRank;\n let coordsSnippet: string;\n if (inRank === 0) {\n coordsSnippet = '';\n } else if (outRank < 2 && broadcastDims.length >= 1) {\n coordsSnippet = 'coords = 0;';\n } else {\n coordsSnippet =\n broadcastDims.map(d => `coords[${d + rankDiff}] = 0;`).join('\\n');\n }\n let unpackedCoordsSnippet = '';\n if (outRank < 2 && inRank > 0) {\n unpackedCoordsSnippet = 'coords';\n } else {\n unpackedCoordsSnippet = inputInfo.shapeInfo.logicalShape\n .map((s, i) => `coords[${i + rankDiff}]`)\n .join(', ');\n }\n return `\n float ${funcName}() {\n ${type} coords = getOutputCoords();\n ${coordsSnippet}\n return get${texFuncSnippet}(${unpackedCoordsSnippet});\n }\n `;\n}\n\nfunction getSamplerAtOutputCoords(\n inputInfo: InputInfo, outShapeInfo: ShapeInfo,\n supportsBroadcasting: boolean) {\n const texName = inputInfo.name;\n const texFuncSnippet = texName.charAt(0).toUpperCase() + texName.slice(1);\n const funcName = 'get' + texFuncSnippet + 'AtOutCoords';\n\n const broadcastDims = broadcast_util.getBroadcastDims(\n inputInfo.shapeInfo.logicalShape, outShapeInfo.logicalShape);\n const inRank = inputInfo.shapeInfo.logicalShape.length;\n const outRank = outShapeInfo.logicalShape.length;\n const doBroadcast =\n supportsBroadcasting && ((outRank > inRank) || broadcastDims.length > 0);\n const broadcastOverOuter =\n broadcast_util.broadcastDimsAreOuter(broadcastDims);\n const isUniform = inputInfo.shapeInfo.isUniform;\n\n if (doBroadcast && !broadcastOverOuter) {\n return getBroadcastOutputCoordsSampler(\n inputInfo, outShapeInfo, texFuncSnippet, funcName);\n }\n\n const inSize = util.sizeFromShape(inputInfo.shapeInfo.logicalShape);\n let broadcastSnippet = '';\n if (doBroadcast && broadcastOverOuter) {\n broadcastSnippet = `\n int mainPart = index / ${inSize};\n index -= mainPart * ${inSize};\n `;\n }\n\n const outTexShape = outShapeInfo.texShape;\n if (isUniform) {\n if (inSize === 1) {\n return `float ${funcName}() {return ${texName};}`;\n }\n return `\n float ${funcName}() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${outTexShape[0]}, ${outTexShape[1]}));\n int index = resTexRC.x * ${outTexShape[1]} + resTexRC.y;\n ${broadcastSnippet}\n return get${texFuncSnippet}Flat(index);\n }\n `;\n }\n\n // At this point, the input is not a uniform.\n const inTexShape = inputInfo.shapeInfo.texShape;\n if (util.arraysEqual(inTexShape, outTexShape)) {\n return `\n float ${funcName}() {\n return sampleTexture(${texName}, resultUV);\n }\n `;\n }\n\n return `\n float ${funcName}() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${outTexShape[0]}, ${outTexShape[1]}));\n int index = resTexRC.x * ${outTexShape[1]} + resTexRC.y;\n ${broadcastSnippet}\n int texR = index / ${inTexShape[1]};\n int texC = index - texR * ${inTexShape[1]};\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${inTexShape[1]}.0, ${inTexShape[0]}.0);\n\n return sampleTexture(${texName}, uv);\n }\n `;\n}\n\nexport function getCoordsDataType(rank: number): string {\n if (rank <= 1) {\n return 'int';\n } else if (rank === 2) {\n return 'ivec2';\n } else if (rank === 3) {\n return 'ivec3';\n } else if (rank === 4) {\n return 'ivec4';\n } else if (rank === 5) {\n return 'ivec5';\n } else if (rank === 6) {\n return 'ivec6';\n } else {\n throw Error(`GPU for rank ${rank} is not yet supported`);\n }\n}\n\n/** Returns a new input info (a copy) that has a squeezed logical shape. */\nfunction squeezeInputInfo(\n inInfo: InputInfo, squeezedShape: number[]): InputInfo {\n // Deep copy.\n const newInputInfo: InputInfo = JSON.parse(JSON.stringify(inInfo));\n newInputInfo.shapeInfo.logicalShape = squeezedShape;\n return newInputInfo;\n}\n\nfunction getSqueezedParams(params: string[], keptDims: number[]): string {\n return keptDims.map(d => params[d]).join(', ');\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class CumSumProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(shape: number[], exclusive: boolean, reverse: boolean) {\n this.outputShape = shape;\n const rank = shape.length;\n const finalDim = shape[shape.length - 1];\n const comparator = reverse ? '<' : '>';\n\n this.userCode = `\n int getIndex(int i) {\n ${reverse ? `return ${finalDim} -i - 1;` : 'return i;'}\n }\n\n void main() {\n ${getCoordsDataType(rank)} coords = getOutputCoords();\n int end = ${getFinalCoord(rank, 'coords')};\n float val = 0.0;\n for (int i = ${finalDim} - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx ${comparator} end) {\n continue;\n }\n if (idx == end && ${exclusive}) {\n continue;\n }\n ${getFinalCoord(rank, 'coords')} = idx;\n val += getX(${getCoords(rank, 'coords')});\n }\n setOutput(val);\n }\n `;\n }\n}\n\nfunction getCoords(rank: number, name: string): string {\n if (rank === 1) {\n return `${name}`;\n } else if (rank === 2) {\n return `${name}.x, ${name}.y`;\n } else if (rank === 3) {\n return `${name}.x, ${name}.y, ${name}.z`;\n } else if (rank === 4) {\n return `${name}.x, ${name}.y, ${name}.z, ${name}.w`;\n } else {\n throw Error(`Cumulative sum for rank ${rank} is not yet supported`);\n }\n}\n\nfunction getFinalCoord(rank: number, name: string): string {\n if (rank === 1) {\n return `${name}`;\n } else if (rank === 2) {\n return `${name}.y`;\n } else if (rank === 3) {\n return `${name}.z`;\n } else if (rank === 4) {\n return `${name}.w`;\n } else {\n throw Error(`Cumulative sum for rank ${rank} is not yet supported`);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class EncodeFloatProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n constructor(outputShape: number[]) {\n this.outputShape = outputShape;\n this.userCode = `\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n gl_FragColor = encode_float(x);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {DataType, DataTypeMap} from '../../types';\n\nexport enum TextureUsage {\n RENDER,\n UPLOAD,\n PIXELS,\n DOWNLOAD\n}\n\nexport enum PhysicalTextureType {\n FLOAT16,\n FLOAT32,\n UNSIGNED_BYTE\n}\n\nexport interface TextureData {\n texture: WebGLTexture;\n shape: number[];\n /** [rows, columns] shape of the texture. */\n texShape: [number, number];\n dtype: DataType;\n values: DataTypeMap[DataType];\n usage: TextureUsage;\n}\n\nexport function getUnpackedMatrixTextureShapeWidthHeight(\n rows: number, columns: number): [number, number] {\n return [columns, rows];\n}\n\nexport function getUnpackedArraySizeFromMatrixSize(\n matrixSize: number, channelsPerTexture: number): number {\n return matrixSize * channelsPerTexture;\n}\n\nexport function getColorMatrixTextureShapeWidthHeight(\n rows: number, columns: number): [number, number] {\n return [columns * 4, rows];\n}\n\nexport function getMatrixSizeFromUnpackedArraySize(\n unpackedSize: number, channelsPerTexture: number): number {\n if (unpackedSize % channelsPerTexture !== 0) {\n throw new Error(\n `unpackedSize (${unpackedSize}) must be a multiple of ` +\n `${channelsPerTexture}`);\n }\n return unpackedSize / channelsPerTexture;\n}\n\nexport type TypedArray = Float32Array|Uint8Array;\n\nexport function encodeMatrixToUnpackedArray(\n matrix: TypedArray, unpackedArray: TypedArray, channelsPerTexture: number) {\n const requiredSize =\n getUnpackedArraySizeFromMatrixSize(matrix.length, channelsPerTexture);\n if (unpackedArray.length < requiredSize) {\n throw new Error(\n `unpackedArray length (${unpackedArray.length}) must be >= ` +\n `${requiredSize}`);\n }\n let dst = 0;\n for (let src = 0; src < matrix.length; ++src) {\n unpackedArray[dst] = matrix[src];\n dst += channelsPerTexture;\n }\n}\n\nexport function decodeMatrixFromUnpackedArray(\n unpackedArray: Float32Array, matrix: Float32Array,\n channelsPerTexture: number) {\n const requiredSize = getMatrixSizeFromUnpackedArraySize(\n unpackedArray.length, channelsPerTexture);\n if (matrix.length < requiredSize) {\n throw new Error(\n `matrix length (${matrix.length}) must be >= ${requiredSize}`);\n }\n let dst = 0;\n for (let src = 0; src < unpackedArray.length; src += channelsPerTexture) {\n matrix[dst++] = unpackedArray[src];\n }\n}\n\nexport function decodeMatrixFromUnpackedColorRGBAArray(\n unpackedArray: Float32Array, matrix: Float32Array, channels: number) {\n const requiredSize = unpackedArray.length * channels / 4;\n if (matrix.length < requiredSize) {\n throw new Error(\n `matrix length (${matrix.length}) must be >= ${requiredSize}`);\n }\n let dst = 0;\n for (let src = 0; src < unpackedArray.length; src += 4) {\n for (let c = 0; c < channels; c++) {\n matrix[dst++] = unpackedArray[src + c];\n }\n }\n}\n\nexport function getPackedMatrixTextureShapeWidthHeight(\n rows: number, columns: number): [number, number] {\n return [Math.ceil(columns / 2), Math.ceil(rows / 2)];\n}\n\nexport function getPackedRGBAArraySizeFromMatrixShape(\n rows: number, columns: number): number {\n const [w, h] = getPackedMatrixTextureShapeWidthHeight(rows, columns);\n return w * h * 4;\n}\n\nexport function encodeMatrixToPackedRGBA(\n matrix: Float32Array, rows: number, columns: number,\n packedRGBA: Float32Array) {\n const requiredSize = getPackedRGBAArraySizeFromMatrixShape(rows, columns);\n if (packedRGBA.length < requiredSize) {\n throw new Error(\n `packedRGBA length (${packedRGBA.length}) must be >= ${requiredSize}`);\n }\n /*\n Unpacked matrix, row-major order in Float32Array[16]: A B C D\n E F G H\n I J K L\n M N O P\n\n Packed matrix, 2x2 RGBA32 texture (memory view): ABEF CDGH IJMN KLOP\n\n Packed matrix, 2x2 RGBA32 texture (matrix view): AB|CD\n EF|GH\n --+--\n IJ|KL\n MN|OP\n */\n const [textureWidth, textureHeight] =\n getPackedMatrixTextureShapeWidthHeight(rows, columns);\n const oddWidth = (columns % 2) === 1;\n const oddHeight = (rows % 2) === 1;\n const widthInFullBlocks = Math.floor(columns / 2);\n const heightInFullBlocks = Math.floor(rows / 2);\n\n // loop over full 2x2 blocks\n {\n const dstStride = (oddWidth ? 4 : 0);\n const oneRow = columns;\n let dst = 0;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n const matrixSrcRow = (blockY * 2 * columns);\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n const matrixSrcCol = blockX * 2;\n const src = matrixSrcRow + matrixSrcCol;\n packedRGBA[dst] = matrix[src];\n packedRGBA[dst + 1] = matrix[src + 1];\n packedRGBA[dst + 2] = matrix[src + oneRow];\n packedRGBA[dst + 3] = matrix[src + oneRow + 1];\n dst += 4;\n }\n dst += dstStride;\n }\n }\n\n // loop down final odd column\n if (oddWidth) {\n let src = columns - 1;\n let dst = (textureWidth - 1) * 4;\n const srcStride = 2 * columns;\n const dstStride = textureWidth * 4;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n packedRGBA[dst] = matrix[src];\n packedRGBA[dst + 2] = matrix[src + columns];\n src += srcStride;\n dst += dstStride;\n }\n }\n\n // loop across final row\n if (oddHeight) {\n let src = (rows - 1) * columns;\n let dst = (textureHeight - 1) * textureWidth * 4;\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n packedRGBA[dst++] = matrix[src++];\n packedRGBA[dst++] = matrix[src++];\n dst += 2;\n }\n }\n\n // fill in bottom-right texel\n if (oddWidth && oddHeight) {\n packedRGBA[packedRGBA.length - 4] = matrix[matrix.length - 1];\n }\n\n return packedRGBA;\n}\n\nexport function decodeMatrixFromPackedRGBA(\n packedRGBA: Float32Array, rows: number, columns: number,\n matrix: Float32Array): Float32Array {\n const requiredSize = rows * columns;\n if (requiredSize < matrix.length) {\n throw new Error(\n `matrix length (${matrix.length}) must be >= ${requiredSize}`);\n }\n const oddWidth = (columns % 2) === 1;\n const oddHeight = (rows % 2) === 1;\n const widthInFullBlocks = Math.floor(columns / 2);\n const heightInFullBlocks = Math.floor(rows / 2);\n const [textureWidth, textureHeight] =\n getPackedMatrixTextureShapeWidthHeight(rows, columns);\n\n // loop over full 2x2 blocks\n {\n const srcStride = oddWidth ? 4 : 0;\n const dstStride = columns + (oddWidth ? 1 : 0);\n let src = 0;\n let dstRow1 = 0;\n let dstRow2 = columns;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n matrix[dstRow1++] = packedRGBA[src++];\n matrix[dstRow1++] = packedRGBA[src++];\n matrix[dstRow2++] = packedRGBA[src++];\n matrix[dstRow2++] = packedRGBA[src++];\n }\n src += srcStride;\n dstRow1 += dstStride;\n dstRow2 += dstStride;\n }\n }\n\n // loop down final column\n if (oddWidth) {\n let src = (textureWidth - 1) * 4;\n let dst = columns - 1;\n const srcStride = textureWidth * 4;\n const dstStride = 2 * columns;\n for (let blockY = 0; blockY < heightInFullBlocks; ++blockY) {\n matrix[dst] = packedRGBA[src];\n matrix[dst + columns] = packedRGBA[src + 2];\n src += srcStride;\n dst += dstStride;\n }\n }\n\n // loop across final row\n if (oddHeight) {\n let src = (textureHeight - 1) * textureWidth * 4;\n let dst = (rows - 1) * columns;\n for (let blockX = 0; blockX < widthInFullBlocks; ++blockX) {\n matrix[dst++] = packedRGBA[src++];\n matrix[dst++] = packedRGBA[src++];\n src += 2;\n }\n }\n\n // fill in bottom-right cell\n if (oddWidth && oddHeight) {\n matrix[matrix.length - 1] = packedRGBA[packedRGBA.length - 4];\n }\n\n return matrix;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class FromPixelsProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n constructor(outputShape: number[]) {\n const [height, width, ] = outputShape;\n this.outputShape = outputShape;\n this.userCode = `\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${width}.0, ${height}.0);\n\n vec4 values = texture2D(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class GatherProgram implements GPGPUProgram {\n variableNames = ['A', 'indices'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(aShape: number[], indicesLength: number, axis: number) {\n const outputShape: number[] = aShape.slice();\n outputShape[axis] = indicesLength;\n this.outputShape = outputShape;\n this.rank = outputShape.length;\n const dtype = getCoordsDataType(this.rank);\n const sourceCoords = getSourceCoords(aShape, axis);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n setOutput(getA(${sourceCoords}));\n }\n `;\n }\n}\n\nfunction getSourceCoords(aShape: number[], axis: number): string {\n const rank = aShape.length;\n if (rank > 4) {\n throw Error(`Gather for rank ${rank} is not yet supported`);\n }\n if (rank === 1) {\n return `int(getIndices(resRC))`;\n }\n\n const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w'];\n\n const sourceCoords = [];\n for (let i = 0; i < aShape.length; i++) {\n if (i === axis) {\n sourceCoords.push(`int(getIndices(${currentCoords[i]}))`);\n } else {\n sourceCoords.push(`${currentCoords[i]}`);\n }\n }\n return sourceCoords.join();\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nlet MAX_TEXTURE_SIZE: number = null;\n\nimport * as util from '../../util';\nimport {ENV} from '../../environment';\n\nexport function createWebGLRenderingContext(attributes: WebGLContextAttributes):\n WebGLRenderingContext {\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return createWebGLRenderingContextFromCanvas(canvas, attributes);\n}\n\nexport function createWebGLRenderingContextFromCanvas(\n canvas: HTMLCanvasElement,\n attributes: WebGLContextAttributes): WebGLRenderingContext {\n let gl: WebGLRenderingContext;\n\n const webglVersion = ENV.get('WEBGL_VERSION');\n if (webglVersion === 2) {\n gl = canvas.getContext('webgl2', attributes) as WebGLRenderingContext;\n } else if (webglVersion === 1) {\n gl = (canvas.getContext('webgl', attributes) ||\n canvas.getContext('experimental-webgl', attributes)) as\n WebGLRenderingContext;\n }\n\n if (webglVersion === 0 || gl == null) {\n throw new Error('This browser does not support WebGL.');\n }\n return gl;\n}\n\nexport function callAndCheck(gl: WebGLRenderingContext, func: () => T): T {\n const returnValue = func();\n checkWebGLError(gl);\n return returnValue;\n}\n\nlet webGLDebugErrorCheckingEnabled = false;\n\nexport function enableDebugWebGLErrorChecking(enabled: boolean) {\n webGLDebugErrorCheckingEnabled = enabled;\n}\n\nexport function checkWebGLError(gl: WebGLRenderingContext) {\n if (webGLDebugErrorCheckingEnabled) {\n const error = gl.getError();\n if (error !== gl.NO_ERROR) {\n throw new Error('WebGL Error: ' + getWebGLErrorMessage(gl, error));\n }\n }\n}\n\nexport function getWebGLErrorMessage(\n gl: WebGLRenderingContext, status: number): string {\n switch (status) {\n case gl.NO_ERROR:\n return 'NO_ERROR';\n case gl.INVALID_ENUM:\n return 'INVALID_ENUM';\n case gl.INVALID_VALUE:\n return 'INVALID_VALUE';\n case gl.INVALID_OPERATION:\n return 'INVALID_OPERATION';\n case gl.INVALID_FRAMEBUFFER_OPERATION:\n return 'INVALID_FRAMEBUFFER_OPERATION';\n case gl.OUT_OF_MEMORY:\n return 'OUT_OF_MEMORY';\n case gl.CONTEXT_LOST_WEBGL:\n return 'CONTEXT_LOST_WEBGL';\n default:\n return `Unknown error code ${status}`;\n }\n}\n\nexport function getExtensionOrThrow(\n gl: WebGLRenderingContext, extensionName: string): {} {\n return throwIfNull<{}>(\n gl, () => gl.getExtension(extensionName),\n 'Extension \"' + extensionName + '\" not supported on this browser.');\n}\n\nexport function createVertexShader(\n gl: WebGLRenderingContext, vertexShaderSource: string): WebGLShader {\n const vertexShader: WebGLShader = throwIfNull(\n gl, () => gl.createShader(gl.VERTEX_SHADER),\n 'Unable to create vertex WebGLShader.');\n callAndCheck(gl, () => gl.shaderSource(vertexShader, vertexShaderSource));\n callAndCheck(gl, () => gl.compileShader(vertexShader));\n if (gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS) === false) {\n console.log(gl.getShaderInfoLog(vertexShader));\n throw new Error('Failed to compile vertex shader.');\n }\n return vertexShader;\n}\n\nexport function createFragmentShader(\n gl: WebGLRenderingContext, fragmentShaderSource: string): WebGLShader {\n const fragmentShader: WebGLShader = throwIfNull(\n gl, () => gl.createShader(gl.FRAGMENT_SHADER),\n 'Unable to create fragment WebGLShader.');\n callAndCheck(gl, () => gl.shaderSource(fragmentShader, fragmentShaderSource));\n callAndCheck(gl, () => gl.compileShader(fragmentShader));\n if (gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS) === false) {\n logShaderSourceAndInfoLog(\n fragmentShaderSource, gl.getShaderInfoLog(fragmentShader));\n throw new Error('Failed to compile fragment shader.');\n }\n return fragmentShader;\n}\n\nconst lineNumberRegex = /ERROR: [0-9]+:([0-9]+):/g;\nfunction logShaderSourceAndInfoLog(\n shaderSource: string, shaderInfoLog: string) {\n const lineNumberRegexResult = lineNumberRegex.exec(shaderInfoLog);\n if (lineNumberRegexResult == null) {\n console.log(`Couldn't parse line number in error: ${shaderInfoLog}`);\n console.log(shaderSource);\n return;\n }\n\n const lineNumber = +lineNumberRegexResult[1];\n\n const shaderLines = shaderSource.split('\\n');\n const pad = shaderLines.length.toString().length + 2;\n const linesWithLineNumbers = shaderLines.map(\n (line, lineNumber) =>\n util.rightPad((lineNumber + 1).toString(), pad) + line);\n let maxLineLength = 0;\n for (let i = 0; i < linesWithLineNumbers.length; i++) {\n maxLineLength = Math.max(linesWithLineNumbers[i].length, maxLineLength);\n }\n\n const beforeErrorLines = linesWithLineNumbers.slice(0, lineNumber - 1);\n const errorLine = linesWithLineNumbers.slice(lineNumber - 1, lineNumber);\n const afterErrorLines = linesWithLineNumbers.slice(lineNumber);\n\n console.log(beforeErrorLines.join('\\n'));\n console.log(shaderInfoLog.split('\\n')[0]);\n console.log(\n `%c ${util.rightPad(errorLine[0], maxLineLength)}`,\n 'border:1px solid red; background-color:#e3d2d2; color:#a61717');\n console.log(afterErrorLines.join('\\n'));\n}\n\nexport function createProgram(gl: WebGLRenderingContext): WebGLProgram {\n return throwIfNull(\n gl, () => gl.createProgram(), 'Unable to create WebGLProgram.');\n}\n\nexport function linkProgram(gl: WebGLRenderingContext, program: WebGLProgram) {\n callAndCheck(gl, () => gl.linkProgram(program));\n if (gl.getProgramParameter(program, gl.LINK_STATUS) === false) {\n console.log(gl.getProgramInfoLog(program));\n throw new Error('Failed to link vertex and fragment shaders.');\n }\n}\n\nexport function validateProgram(\n gl: WebGLRenderingContext, program: WebGLProgram) {\n callAndCheck(gl, () => gl.validateProgram(program));\n if (gl.getProgramParameter(program, gl.VALIDATE_STATUS) === false) {\n console.log(gl.getProgramInfoLog(program));\n throw new Error('Shader program validation failed.');\n }\n}\n\nexport function createStaticVertexBuffer(\n gl: WebGLRenderingContext, data: Float32Array): WebGLBuffer {\n const buffer: WebGLBuffer = throwIfNull(\n gl, () => gl.createBuffer(), 'Unable to create WebGLBuffer');\n callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer));\n callAndCheck(gl, () => gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW));\n return buffer;\n}\n\nexport function createStaticIndexBuffer(\n gl: WebGLRenderingContext, data: Uint16Array): WebGLBuffer {\n const buffer: WebGLBuffer = throwIfNull(\n gl, () => gl.createBuffer(), 'Unable to create WebGLBuffer');\n callAndCheck(gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer));\n callAndCheck(\n gl, () => gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, gl.STATIC_DRAW));\n return buffer;\n}\n\nexport function queryMaxTextureSize(gl: WebGLRenderingContext): number {\n if (MAX_TEXTURE_SIZE != null) {\n return MAX_TEXTURE_SIZE;\n }\n MAX_TEXTURE_SIZE =\n callAndCheck(gl, () => gl.getParameter(gl.MAX_TEXTURE_SIZE));\n return MAX_TEXTURE_SIZE;\n}\n\nexport function getNumChannels(): number {\n if (ENV.get('WEBGL_VERSION') === 2) {\n return 1;\n }\n return 4;\n}\n\nexport function createTexture(gl: WebGLRenderingContext): WebGLTexture {\n return throwIfNull(\n gl, () => gl.createTexture(), 'Unable to create WebGLTexture.');\n}\n\nexport function validateTextureSize(\n gl: WebGLRenderingContext, width: number, height: number) {\n const maxTextureSize: number = queryMaxTextureSize(gl);\n if ((width <= 0) || (height <= 0)) {\n const requested = `[${width}x${height}]`;\n throw new Error('Requested texture size ' + requested + ' is invalid.');\n }\n if ((width > maxTextureSize) || (height > maxTextureSize)) {\n const requested = `[${width}x${height}]`;\n const max = `[${maxTextureSize}x${maxTextureSize}]`;\n throw new Error(\n 'Requested texture size ' + requested +\n ' greater than WebGL maximum on this browser / GPU ' + max + '.');\n }\n}\n\nexport function createFramebuffer(gl: WebGLRenderingContext): WebGLFramebuffer {\n return throwIfNull(\n gl, () => gl.createFramebuffer(), 'Unable to create WebGLFramebuffer.');\n}\n\nexport function bindVertexBufferToProgramAttribute(\n gl: WebGLRenderingContext, program: WebGLProgram, attribute: string,\n buffer: WebGLBuffer, arrayEntriesPerItem: number, itemStrideInBytes: number,\n itemOffsetInBytes: number): boolean {\n const loc = gl.getAttribLocation(program, attribute);\n if (loc === -1) {\n // The GPU compiler decided to strip out this attribute because it's unused,\n // thus no need to bind.\n return false;\n }\n callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, buffer));\n callAndCheck(\n gl,\n () => gl.vertexAttribPointer(\n loc, arrayEntriesPerItem, gl.FLOAT, false, itemStrideInBytes,\n itemOffsetInBytes));\n callAndCheck(gl, () => gl.enableVertexAttribArray(loc));\n return true;\n}\n\nexport function bindTextureUnit(\n gl: WebGLRenderingContext, texture: WebGLTexture, textureUnit: number) {\n validateTextureUnit(gl, textureUnit);\n callAndCheck(gl, () => gl.activeTexture(gl.TEXTURE0 + textureUnit));\n callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture));\n}\n\nexport function unbindTextureUnit(\n gl: WebGLRenderingContext, textureUnit: number) {\n validateTextureUnit(gl, textureUnit);\n callAndCheck(gl, () => gl.activeTexture(gl.TEXTURE0 + textureUnit));\n callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n}\n\nexport function getProgramUniformLocationOrThrow(\n gl: WebGLRenderingContext, program: WebGLProgram,\n uniformName: string): WebGLUniformLocation {\n return throwIfNull(\n gl, () => gl.getUniformLocation(program, uniformName),\n 'uniform \"' + uniformName + '\" not present in program.');\n}\n\nexport function getProgramUniformLocation(\n gl: WebGLRenderingContext, program: WebGLProgram,\n uniformName: string): WebGLUniformLocation {\n return gl.getUniformLocation(program, uniformName);\n}\n\nexport function bindTextureToProgramUniformSampler(\n gl: WebGLRenderingContext, program: WebGLProgram, texture: WebGLTexture,\n uniformSamplerLocation: WebGLUniformLocation, textureUnit: number) {\n callAndCheck(gl, () => bindTextureUnit(gl, texture, textureUnit));\n callAndCheck(gl, () => gl.uniform1i(uniformSamplerLocation, textureUnit));\n}\n\nexport function bindCanvasToFramebuffer(gl: WebGLRenderingContext) {\n callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, null));\n callAndCheck(gl, () => gl.viewport(0, 0, gl.canvas.width, gl.canvas.height));\n callAndCheck(gl, () => gl.scissor(0, 0, gl.canvas.width, gl.canvas.height));\n}\n\nexport function bindColorTextureToFramebuffer(\n gl: WebGLRenderingContext, texture: WebGLTexture,\n framebuffer: WebGLFramebuffer) {\n callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer));\n callAndCheck(\n gl,\n () => gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0));\n}\n\nexport function unbindColorTextureFromFramebuffer(\n gl: WebGLRenderingContext, framebuffer: WebGLFramebuffer) {\n callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer));\n callAndCheck(\n gl,\n () => gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0));\n}\n\nexport function validateFramebuffer(gl: WebGLRenderingContext) {\n const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n if (status !== gl.FRAMEBUFFER_COMPLETE) {\n throw new Error(\n 'Error binding framebuffer: ' + getFramebufferErrorMessage(gl, status));\n }\n}\n\nexport function getFramebufferErrorMessage(\n gl: WebGLRenderingContext, status: number): string {\n switch (status) {\n case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:\n return 'FRAMEBUFFER_INCOMPLETE_ATTACHMENT';\n case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:\n return 'FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT';\n case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:\n return 'FRAMEBUFFER_INCOMPLETE_DIMENSIONS';\n case gl.FRAMEBUFFER_UNSUPPORTED:\n return 'FRAMEBUFFER_UNSUPPORTED';\n default:\n return `unknown error ${status}`;\n }\n}\n\nfunction throwIfNull(\n gl: WebGLRenderingContext, returnTOrNull: () => T | null,\n failureMessage: string): T {\n const tOrNull: T|null = callAndCheck(gl, () => returnTOrNull());\n if (tOrNull == null) {\n throw new Error(failureMessage);\n }\n return tOrNull as T;\n}\n\nfunction validateTextureUnit(gl: WebGLRenderingContext, textureUnit: number) {\n const maxTextureUnit = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1;\n const glTextureUnit = textureUnit + gl.TEXTURE0;\n if (glTextureUnit < gl.TEXTURE0 || glTextureUnit > maxTextureUnit) {\n const textureUnitRange = `[gl.TEXTURE0, gl.TEXTURE${maxTextureUnit}]`;\n throw new Error(`textureUnit must be in ${textureUnitRange}.`);\n }\n}\n\nexport function getTextureShapeFromLogicalShape(\n gl: WebGLRenderingContext, logShape: number[]): [number, number] {\n // If logical shape is 2, we don't squeeze, since we want to match physical.\n if (logShape.length !== 2) {\n const squeezeResult = util.squeezeShape(logShape);\n logShape = squeezeResult.newShape;\n }\n\n const maxTexSize = queryMaxTextureSize(gl);\n const size = util.sizeFromShape(logShape);\n if (logShape.length <= 1 && size <= maxTexSize) {\n return [size, 1];\n } else if (\n logShape.length === 2 && logShape[0] <= maxTexSize &&\n logShape[1] <= maxTexSize) {\n return logShape as [number, number];\n } else if (\n logShape.length === 3 && logShape[0] <= maxTexSize &&\n logShape[1] * logShape[2] <= maxTexSize) {\n return [logShape[0], logShape[1] * logShape[2]];\n } else if (\n logShape.length === 4 && logShape[0] <= maxTexSize &&\n logShape[1] * logShape[2] * logShape[3] <= maxTexSize) {\n return [logShape[0], logShape[1] * logShape[2] * logShape[3]];\n } else {\n return util.sizeToSquarishShape(size);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../../environment';\n\nimport * as tex_util from './tex_util';\nimport * as webgl_util from './webgl_util';\n\nexport function getWebGLContextAttributes(): WebGLContextAttributes {\n return {\n alpha: false,\n antialias: false,\n premultipliedAlpha: false,\n preserveDrawingBuffer: false,\n depth: false,\n stencil: false,\n failIfMajorPerformanceCaveat: true\n };\n}\n\nexport interface TextureConfig {\n internalFormatFloat: number;\n textureFormatFloat: number;\n internalFormatHalfFloat: number;\n internalFormatPackedFloat: number;\n\n // The format to use during a gl.readPixels call.\n downloadTextureFormat: number;\n // How many channels need to be unpacked after a gl.readPixels call.\n downloadUnpackNumChannels: number;\n\n defaultNumChannels: number;\n textureTypeHalfFloat: number;\n}\n\nexport function createWebGLContext(canvas?: HTMLCanvasElement) {\n const attributes = getWebGLContextAttributes();\n let gl: WebGLRenderingContext;\n if (canvas != null) {\n gl = webgl_util.createWebGLRenderingContextFromCanvas(canvas, attributes);\n } else {\n gl = webgl_util.createWebGLRenderingContext(attributes);\n }\n webgl_util.callAndCheck(gl, () => gl.disable(gl.DEPTH_TEST));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.STENCIL_TEST));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.BLEND));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.DITHER));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.POLYGON_OFFSET_FILL));\n webgl_util.callAndCheck(gl, () => gl.disable(gl.SAMPLE_COVERAGE));\n webgl_util.callAndCheck(gl, () => gl.enable(gl.SCISSOR_TEST));\n webgl_util.callAndCheck(gl, () => gl.enable(gl.CULL_FACE));\n webgl_util.callAndCheck(gl, () => gl.cullFace(gl.BACK));\n\n return gl;\n}\n\nexport function createVertexShader(gl: WebGLRenderingContext): WebGLShader {\n const vertexShaderSource = `\n precision highp float;\n attribute vec3 clipSpacePos;\n attribute vec2 uv;\n varying vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`;\n return webgl_util.createVertexShader(gl, vertexShaderSource);\n}\n\nexport function createVertexBuffer(gl: WebGLRenderingContext): WebGLBuffer {\n // [x y z u v] * [upper-left, lower-left, upper-right, lower-right]\n const vertexArray = new Float32Array(\n [-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0]);\n return webgl_util.createStaticVertexBuffer(gl, vertexArray);\n}\n\nexport function createIndexBuffer(gl: WebGLRenderingContext): WebGLBuffer {\n // OpenGL (and WebGL) have \"CCW == front\" winding\n const triangleVertexIndices = new Uint16Array([0, 1, 2, 2, 1, 3]);\n return webgl_util.createStaticIndexBuffer(gl, triangleVertexIndices);\n}\n\nexport function getTextureConfig(\n // tslint:disable-next-line:no-any\n gl: WebGLRenderingContext, textureHalfFloatExtension?: any): TextureConfig {\n // tslint:disable-next-line:no-any\n const glany = gl as any;\n\n let internalFormatFloat: number;\n let internalFormatHalfFloat: number;\n let internalFormatPackedFloat: number;\n let textureFormatFloat: number;\n\n let downloadTextureFormat: number;\n let downloadUnpackNumChannels: number;\n\n let defaultNumChannels: number;\n let textureTypeHalfFloat: number;\n\n if (ENV.get('WEBGL_VERSION') === 2) {\n internalFormatFloat = glany.R32F;\n internalFormatHalfFloat = glany.R16F;\n internalFormatPackedFloat = glany.RGBA32F;\n textureFormatFloat = glany.RED;\n downloadUnpackNumChannels = 4;\n defaultNumChannels = 1;\n textureTypeHalfFloat = glany.HALF_FLOAT;\n } else {\n internalFormatFloat = gl.RGBA;\n internalFormatHalfFloat = gl.RGBA;\n internalFormatPackedFloat = glany.RGBA;\n textureFormatFloat = gl.RGBA;\n downloadUnpackNumChannels = 4;\n defaultNumChannels = 4;\n textureTypeHalfFloat = textureHalfFloatExtension != null ?\n textureHalfFloatExtension.HALF_FLOAT_OES :\n null;\n }\n downloadTextureFormat = gl.RGBA;\n\n return {\n internalFormatFloat,\n internalFormatHalfFloat,\n internalFormatPackedFloat,\n textureFormatFloat,\n downloadTextureFormat,\n downloadUnpackNumChannels,\n defaultNumChannels,\n textureTypeHalfFloat\n };\n}\n\nfunction createAndConfigureTexture(\n gl: WebGLRenderingContext, width: number, height: number,\n internalFormat: number, textureFormat: number,\n textureType: number): WebGLTexture {\n webgl_util.validateTextureSize(gl, width, height);\n const texture = webgl_util.createTexture(gl);\n\n const tex2d = gl.TEXTURE_2D;\n webgl_util.callAndCheck(gl, () => gl.bindTexture(tex2d, texture));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_MIN_FILTER, gl.NEAREST));\n webgl_util.callAndCheck(\n gl, () => gl.texParameteri(tex2d, gl.TEXTURE_MAG_FILTER, gl.NEAREST));\n webgl_util.callAndCheck(\n gl,\n () => gl.texImage2D(\n tex2d, 0, internalFormat, width, height, 0, textureFormat,\n textureType, null));\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n return texture;\n}\n\nexport function createFloat32MatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, textureConfig.internalFormatFloat,\n textureConfig.textureFormatFloat, gl.FLOAT);\n}\n\nexport function createFloat16MatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, textureConfig.internalFormatFloat,\n textureConfig.textureFormatFloat, textureConfig.textureTypeHalfFloat);\n}\n\nexport function createUnsignedBytesMatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE);\n}\n\nexport function createPackedMatrixTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): WebGLTexture {\n const [width, height] =\n tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n return createAndConfigureTexture(\n gl, width, height, textureConfig.internalFormatPackedFloat, gl.RGBA,\n gl.FLOAT);\n}\n\nexport function bindVertexProgramAttributeStreams(\n gl: WebGLRenderingContext, program: WebGLProgram,\n vertexBuffer: WebGLBuffer): boolean {\n const posOffset = 0; // x is the first buffer element\n const uvOffset = 3 * 4; // uv comes after [x y z]\n const stride = (3 * 4) + (2 * 4); // xyz + uv, each entry is 4-byte float.\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer));\n const success = webgl_util.bindVertexBufferToProgramAttribute(\n gl, program, 'clipSpacePos', vertexBuffer, 3, stride, posOffset);\n return success &&\n webgl_util.bindVertexBufferToProgramAttribute(\n gl, program, 'uv', vertexBuffer, 2, stride, uvOffset);\n}\n\nexport function uploadPixelDataToTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture,\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement) {\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture));\n webgl_util.callAndCheck(\n gl,\n () => gl.texImage2D(\n gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, pixels));\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n}\n\nfunction uploadDataToTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, width: number,\n height: number, data: Float32Array, textureFormat: number) {\n webgl_util.validateTextureSize(gl, width, height);\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, texture));\n webgl_util.callAndCheck(\n gl,\n () => gl.texSubImage2D(\n gl.TEXTURE_2D, 0, 0, 0, width, height, textureFormat, gl.FLOAT,\n data));\n\n webgl_util.callAndCheck(gl, () => gl.bindTexture(gl.TEXTURE_2D, null));\n}\n\nexport function uploadMatrixToTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, rows: number,\n columns: number, matrix: Float32Array, numChannels: number,\n textureConfig: TextureConfig) {\n const [w, h] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n\n let unpackedArray: Float32Array;\n if (textureConfig.defaultNumChannels === 1) {\n // No need to allocate a temporary array.\n unpackedArray = matrix;\n } else {\n unpackedArray =\n new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(\n matrix.length, numChannels));\n tex_util.encodeMatrixToUnpackedArray(matrix, unpackedArray, numChannels);\n }\n\n uploadDataToTexture(\n gl, texture, w, h, unpackedArray, textureConfig.textureFormatFloat);\n}\n\nexport function uploadMatrixToPackedTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, rows: number,\n columns: number, matrix: Float32Array, textureConfig: TextureConfig) {\n const [w, h] = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n const packedRGBA = new Float32Array(\n tex_util.getPackedRGBAArraySizeFromMatrixShape(rows, columns));\n tex_util.encodeMatrixToPackedRGBA(matrix, rows, columns, packedRGBA);\n uploadDataToTexture(gl, texture, w, h, packedRGBA, gl.RGBA);\n}\n\nexport function maybeCreateBufferFromOutputTexture(\n gl: WebGLRenderingContext, texture: WebGLTexture, rows: number,\n columns: number, textureConfig: TextureConfig): WebGLBuffer|WebGLTexture {\n let bufferOrTexture: WebGLBuffer|WebGLTexture = texture;\n\n if (ENV.get('WEBGL_VERSION') === 2) {\n const gl2 = gl as WebGL2RenderingContext;\n\n // Create and bind the buffer.\n const buffer = gl2.createBuffer();\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl2.PIXEL_PACK_BUFFER, buffer));\n\n // Initialize the buffer to the size of the texture in bytes.\n const bytesPerFloat = 4;\n const bufferSizeBytes = bytesPerFloat *\n tex_util.getUnpackedArraySizeFromMatrixSize(\n rows * columns, textureConfig.downloadUnpackNumChannels);\n\n webgl_util.callAndCheck(\n gl,\n () => gl.bufferData(\n gl2.PIXEL_PACK_BUFFER, bufferSizeBytes, gl.STATIC_DRAW));\n\n // Enqueue a command on the GPU command queue to copy of texture into the\n // buffer.\n webgl_util.callAndCheck(\n gl, () => gl2.readPixels(0, 0, columns, rows, gl.RGBA, gl.FLOAT, 0));\n\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl2.PIXEL_PACK_BUFFER, null));\n\n bufferOrTexture = buffer;\n }\n\n return bufferOrTexture;\n}\n\nexport function downloadFloat32MatrixFromBuffer(\n gl: WebGLRenderingContext, buffer: WebGLBuffer, rows: number,\n columns: number, textureConfig: TextureConfig): Float32Array {\n const gl2 = gl as WebGL2RenderingContext;\n\n const downloadTarget =\n new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(\n rows * columns, textureConfig.downloadUnpackNumChannels));\n\n gl2.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl2.getBufferSubData(gl.ARRAY_BUFFER, 0, downloadTarget);\n gl2.bindBuffer(gl.ARRAY_BUFFER, null);\n\n const matrix = new Float32Array(rows * columns);\n tex_util.decodeMatrixFromUnpackedArray(\n downloadTarget as Float32Array, matrix,\n textureConfig.downloadUnpackNumChannels);\n\n return matrix;\n}\n\nexport function downloadFloat32MatrixFromOutputTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): Float32Array {\n const [w, h] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n\n const downloadTarget =\n new Float32Array(tex_util.getUnpackedArraySizeFromMatrixSize(\n rows * columns, textureConfig.downloadUnpackNumChannels));\n\n webgl_util.callAndCheck(\n gl,\n () => gl.readPixels(\n 0, 0, w, h, textureConfig.downloadTextureFormat, gl.FLOAT,\n downloadTarget));\n\n const matrix = new Float32Array(rows * columns);\n tex_util.decodeMatrixFromUnpackedArray(\n downloadTarget as Float32Array, matrix,\n textureConfig.downloadUnpackNumChannels);\n return matrix;\n}\n\nexport function downloadByteEncodedFloatMatrixFromOutputTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig) {\n const [w, h] =\n tex_util.getUnpackedMatrixTextureShapeWidthHeight(rows, columns);\n\n const numChannels = 4;\n const downloadTarget = new Uint8Array(\n tex_util.getUnpackedArraySizeFromMatrixSize(rows * columns, numChannels));\n\n webgl_util.callAndCheck(\n gl,\n () => gl.readPixels(\n 0, 0, w, h, textureConfig.downloadTextureFormat, gl.UNSIGNED_BYTE,\n downloadTarget));\n\n // By wrapping the buffer in a Float32Array, we use native browser IEEE 754\n // decoding of the 4 bytes that back each 32 bit float.\n return new Float32Array(downloadTarget.buffer);\n}\n\nexport function downloadMatrixFromPackedOutputTexture(\n gl: WebGLRenderingContext, rows: number, columns: number,\n textureConfig: TextureConfig): Float32Array {\n const [w, h] = tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n const packedRGBA = new Float32Array(\n tex_util.getPackedRGBAArraySizeFromMatrixShape(rows, columns));\n webgl_util.callAndCheck(\n gl, () => gl.readPixels(0, 0, w, h, gl.RGBA, gl.FLOAT, packedRGBA));\n const matrix = new Float32Array(rows * columns);\n return tex_util.decodeMatrixFromPackedRGBA(packedRGBA, rows, columns, matrix);\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../../environment';\nimport * as util from '../../util';\nimport * as gpgpu_util from './gpgpu_util';\nimport {TextureConfig} from './gpgpu_util';\nimport * as tex_util from './tex_util';\nimport {WebGL1DisjointQueryTimerExtension, WebGL2DisjointQueryTimerExtension} from './webgl_types';\nimport * as webgl_util from './webgl_util';\n\nexport interface FenceContext {\n query: WebGLQuery|WebGLSync;\n isFencePassed(): boolean;\n}\n\nexport class GPGPUContext {\n gl: WebGLRenderingContext;\n textureFloatExtension: {};\n textureHalfFloatExtension: {};\n colorBufferFloatExtension: {};\n colorBufferHalfFloatExtension: {};\n getBufferSubDataAsyncExtension: {};\n loseContextExtension: WebGLLoseContext;\n disjointQueryTimerExtension: WebGL2DisjointQueryTimerExtension|\n WebGL1DisjointQueryTimerExtension;\n vertexBuffer: WebGLBuffer;\n indexBuffer: WebGLBuffer;\n framebuffer: WebGLFramebuffer;\n outputTexture: WebGLTexture|null = null;\n program: WebGLProgram|null = null;\n private disposed = false;\n private autoDebugValidate = false;\n private disjoint: boolean;\n\n private textureConfig: TextureConfig;\n\n constructor(gl?: WebGLRenderingContext) {\n if (gl != null) {\n this.gl = gl;\n } else {\n this.gl = gpgpu_util.createWebGLContext();\n }\n // WebGL 2.0 enables texture floats without an extension.\n if (ENV.get('WEBGL_VERSION') === 1) {\n this.textureFloatExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'OES_texture_float');\n this.colorBufferFloatExtension =\n this.gl.getExtension('WEBGL_color_buffer_float');\n\n if (!ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) {\n this.textureHalfFloatExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'OES_texture_half_float');\n this.colorBufferHalfFloatExtension =\n this.gl.getExtension('EXT_color_buffer_half_float');\n }\n } else {\n this.colorBufferFloatExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'EXT_color_buffer_float');\n }\n\n this.loseContextExtension =\n webgl_util.getExtensionOrThrow(this.gl, 'WEBGL_lose_context') as\n WebGLLoseContext;\n\n this.vertexBuffer = gpgpu_util.createVertexBuffer(this.gl);\n this.indexBuffer = gpgpu_util.createIndexBuffer(this.gl);\n this.framebuffer = webgl_util.createFramebuffer(this.gl);\n\n this.textureConfig =\n gpgpu_util.getTextureConfig(this.gl, this.textureHalfFloatExtension);\n }\n\n public dispose() {\n if (this.disposed) {\n return;\n }\n if (this.program != null) {\n console.warn(\n 'Disposing a GPGPUContext that still has a bound WebGLProgram.' +\n ' This is probably a resource leak, delete the program with ' +\n 'GPGPUContext.deleteProgram before disposing.');\n }\n if (this.outputTexture != null) {\n console.warn(\n 'Disposing a GPGPUContext that still has a bound output matrix ' +\n 'texture. This is probably a resource leak, delete the output ' +\n 'matrix texture with GPGPUContext.deleteMatrixTexture before ' +\n 'disposing.');\n }\n const gl = this.gl;\n webgl_util.callAndCheck(gl, () => gl.finish());\n webgl_util.callAndCheck(gl, () => gl.bindFramebuffer(gl.FRAMEBUFFER, null));\n webgl_util.callAndCheck(gl, () => gl.deleteFramebuffer(this.framebuffer));\n webgl_util.callAndCheck(gl, () => gl.bindBuffer(gl.ARRAY_BUFFER, null));\n webgl_util.callAndCheck(gl, () => gl.deleteBuffer(this.vertexBuffer));\n webgl_util.callAndCheck(\n gl, () => gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null));\n webgl_util.callAndCheck(gl, () => gl.deleteBuffer(this.indexBuffer));\n this.loseContextExtension.loseContext();\n this.disposed = true;\n }\n\n public enableAutomaticDebugValidation(enabled: boolean) {\n this.autoDebugValidate = enabled;\n webgl_util.enableDebugWebGLErrorChecking(enabled);\n }\n\n public createFloat32MatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createFloat32MatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public createFloat16MatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createFloat16MatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public createUnsignedBytesMatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createUnsignedBytesMatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public uploadPixelDataToTexture(\n texture: WebGLTexture,\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement) {\n this.throwIfDisposed();\n gpgpu_util.uploadPixelDataToTexture(this.gl, texture, pixels);\n }\n\n public createPackedMatrixTexture(rows: number, columns: number):\n WebGLTexture {\n this.throwIfDisposed();\n return gpgpu_util.createPackedMatrixTexture(\n this.gl, rows, columns, this.textureConfig);\n }\n\n public deleteMatrixTexture(texture: WebGLTexture) {\n this.throwIfDisposed();\n if (this.outputTexture === texture) {\n webgl_util.unbindColorTextureFromFramebuffer(this.gl, this.framebuffer);\n this.outputTexture = null;\n }\n webgl_util.callAndCheck(this.gl, () => this.gl.deleteTexture(texture));\n }\n\n public uploadMatrixToTexture(\n texture: WebGLTexture, rows: number, columns: number,\n matrix: Float32Array) {\n this.throwIfDisposed();\n const numChannels = webgl_util.getNumChannels();\n return gpgpu_util.uploadMatrixToTexture(\n this.gl, texture, rows, columns, matrix, numChannels,\n this.textureConfig);\n }\n\n public uploadMatrixToPackedTexture(\n texture: WebGLTexture, rows: number, columns: number,\n matrix: Float32Array) {\n this.throwIfDisposed();\n return gpgpu_util.uploadMatrixToPackedTexture(\n this.gl, texture, rows, columns, matrix, this.textureConfig);\n }\n\n public downloadFloat32MatrixFromOutputTexture(\n texture: WebGLTexture, rows: number, columns: number): Float32Array {\n return this.downloadMatrixDriver(\n texture,\n () => gpgpu_util.downloadFloat32MatrixFromOutputTexture(\n this.gl, rows, columns, this.textureConfig));\n }\n\n public downloadByteEncodedFloatMatrixFromOutputTexture(\n texture: WebGLTexture, rows: number, columns: number): Float32Array {\n return this.downloadMatrixDriver(\n texture,\n () => gpgpu_util.downloadByteEncodedFloatMatrixFromOutputTexture(\n this.gl, rows, columns, this.textureConfig));\n }\n\n public downloadFloat32MatrixFromBuffer(\n buffer: WebGLBuffer, rows: number, columns: number): Float32Array {\n return gpgpu_util.downloadFloat32MatrixFromBuffer(\n this.gl, buffer, rows, columns, this.textureConfig);\n }\n\n public maybeCreateBufferFromTexture(\n texture: WebGLTexture, rows: number, columns: number): WebGLBuffer\n |WebGLTexture {\n this.bindTextureToFrameBuffer(texture);\n const result = gpgpu_util.maybeCreateBufferFromOutputTexture(\n this.gl, texture, rows, columns, this.textureConfig);\n this.unbindTextureToFrameBuffer();\n return result;\n }\n\n public createAndWaitForFence(): Promise {\n const fenceContext = this.createFence(this.gl);\n return this.pollFence(fenceContext);\n }\n\n private createFence(gl: WebGLRenderingContext): FenceContext {\n let query: WebGLQuery|WebGLSync;\n let isFencePassed: () => boolean;\n\n if (ENV.get('WEBGL_FENCE_API_ENABLED')) {\n const gl2 = gl as WebGL2RenderingContext;\n\n const sync = gl2.fenceSync(gl2.SYNC_GPU_COMMANDS_COMPLETE, 0);\n gl.flush();\n\n isFencePassed = () => {\n const status = gl2.clientWaitSync(sync, 0, 0);\n return status === gl2.ALREADY_SIGNALED ||\n status === gl2.CONDITION_SATISFIED;\n };\n\n query = sync;\n } else if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n query = this.beginQuery();\n this.endQuery();\n isFencePassed = () => this.isQueryAvailable(\n query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'));\n } else {\n // If we have no way to fence, return true immediately. This will fire in\n // WebGL 1.0 when there is no disjoint query timer. In this case, because\n // the fence passes immediately, we'll immediately ask for a download of\n // the texture, which will cause the UI thread to hang.\n isFencePassed = () => true;\n }\n\n return {query, isFencePassed};\n }\n\n public downloadMatrixFromPackedTexture(\n texture: WebGLTexture, rows: number, columns: number): Float32Array {\n return this.downloadMatrixDriver(\n texture,\n () => gpgpu_util.downloadMatrixFromPackedOutputTexture(\n this.gl, rows, columns, this.textureConfig));\n }\n\n private vertexAttrsAreBound = false;\n\n public createProgram(fragmentShaderSource: string): WebGLProgram {\n this.throwIfDisposed();\n const gl = this.gl;\n const fragmentShader: WebGLShader =\n webgl_util.createFragmentShader(gl, fragmentShaderSource);\n const vertexShader: WebGLShader = gpgpu_util.createVertexShader(gl);\n const program: WebGLProgram = webgl_util.createProgram(gl);\n webgl_util.callAndCheck(gl, () => gl.attachShader(program, vertexShader));\n webgl_util.callAndCheck(gl, () => gl.attachShader(program, fragmentShader));\n webgl_util.linkProgram(gl, program);\n if (this.autoDebugValidate) {\n webgl_util.validateProgram(gl, program);\n }\n if (!this.vertexAttrsAreBound) {\n this.setProgram(program);\n this.vertexAttrsAreBound = gpgpu_util.bindVertexProgramAttributeStreams(\n gl, this.program, this.vertexBuffer);\n }\n return program;\n }\n\n public deleteProgram(program: WebGLProgram) {\n this.throwIfDisposed();\n if (program === this.program) {\n this.program = null;\n }\n if (program != null) {\n webgl_util.callAndCheck(this.gl, () => this.gl.deleteProgram(program));\n }\n }\n\n public setProgram(program: WebGLProgram|null) {\n this.throwIfDisposed();\n this.program = program;\n if ((this.program != null) && this.autoDebugValidate) {\n webgl_util.validateProgram(this.gl, this.program);\n }\n webgl_util.callAndCheck(this.gl, () => this.gl.useProgram(program));\n }\n\n public getUniformLocation(\n program: WebGLProgram, uniformName: string,\n shouldThrow = true): WebGLUniformLocation {\n this.throwIfDisposed();\n if (shouldThrow) {\n return webgl_util.getProgramUniformLocationOrThrow(\n this.gl, program, uniformName);\n } else {\n return webgl_util.getProgramUniformLocation(\n this.gl, program, uniformName);\n }\n }\n\n public getAttributeLocation(program: WebGLProgram, attribute: string):\n number {\n this.throwIfDisposed();\n return webgl_util.callAndCheck(\n this.gl, () => this.gl.getAttribLocation(program, attribute));\n }\n\n public getUniformLocationNoThrow(program: WebGLProgram, uniformName: string):\n WebGLUniformLocation {\n this.throwIfDisposed();\n return this.gl.getUniformLocation(program, uniformName);\n }\n\n public setInputMatrixTexture(\n inputMatrixTexture: WebGLTexture, uniformLocation: WebGLUniformLocation,\n textureUnit: number) {\n this.throwIfDisposed();\n this.throwIfNoProgram();\n webgl_util.bindTextureToProgramUniformSampler(\n this.gl, this.program, inputMatrixTexture, uniformLocation,\n textureUnit);\n }\n\n public setOutputMatrixTexture(\n outputMatrixTexture: WebGLTexture, rows: number, columns: number) {\n this.setOutputMatrixTextureDriver(outputMatrixTexture, columns, rows);\n }\n\n public setOutputPackedMatrixTexture(\n outputPackedMatrixTexture: WebGLTexture, rows: number, columns: number) {\n this.throwIfDisposed();\n const [width, height] =\n tex_util.getPackedMatrixTextureShapeWidthHeight(rows, columns);\n this.setOutputMatrixTextureDriver(outputPackedMatrixTexture, width, height);\n }\n\n public setOutputMatrixWriteRegion(\n startRow: number, numRows: number, startColumn: number,\n numColumns: number) {\n this.setOutputMatrixWriteRegionDriver(\n startColumn, startRow, numColumns, numRows);\n }\n\n public setOutputPackedMatrixWriteRegion(\n startRow: number, numRows: number, startColumn: number,\n numColumns: number) {\n throw new Error('setOutputPackedMatrixWriteRegion not implemented.');\n }\n\n public debugValidate() {\n if (this.program != null) {\n webgl_util.validateProgram(this.gl, this.program);\n }\n webgl_util.validateFramebuffer(this.gl);\n }\n\n public executeProgram() {\n this.throwIfDisposed();\n this.throwIfNoProgram();\n const gl = this.gl;\n if (this.autoDebugValidate) {\n this.debugValidate();\n }\n webgl_util.callAndCheck(\n gl, () => gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0));\n }\n\n public blockUntilAllProgramsCompleted() {\n this.throwIfDisposed();\n webgl_util.callAndCheck(this.gl, () => this.gl.finish());\n }\n\n private getQueryTimerExtension(): WebGL1DisjointQueryTimerExtension\n |WebGL2DisjointQueryTimerExtension {\n if (this.disjointQueryTimerExtension == null) {\n this.disjointQueryTimerExtension =\n webgl_util.getExtensionOrThrow(\n this.gl,\n ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2 ?\n 'EXT_disjoint_timer_query_webgl2' :\n 'EXT_disjoint_timer_query') as\n WebGL1DisjointQueryTimerExtension |\n WebGL2DisjointQueryTimerExtension;\n }\n return this.disjointQueryTimerExtension;\n }\n\n private getQueryTimerExtensionWebGL2(): WebGL2DisjointQueryTimerExtension {\n return this.getQueryTimerExtension();\n }\n\n private getQueryTimerExtensionWebGL1(): WebGL1DisjointQueryTimerExtension {\n return this.getQueryTimerExtension() as WebGL1DisjointQueryTimerExtension;\n }\n\n beginQuery(): WebGLQuery {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.getQueryTimerExtensionWebGL2();\n\n const query = gl2.createQuery();\n gl2.beginQuery(ext.TIME_ELAPSED_EXT, query);\n return query;\n }\n const ext = this.getQueryTimerExtensionWebGL1();\n const query = ext.createQueryEXT();\n ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);\n return query;\n }\n\n endQuery() {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.getQueryTimerExtensionWebGL2();\n gl2.endQuery(ext.TIME_ELAPSED_EXT);\n return;\n }\n const ext = this.getQueryTimerExtensionWebGL1();\n ext.endQueryEXT(ext.TIME_ELAPSED_EXT);\n }\n\n public async waitForQueryAndGetTime(query: WebGLQuery): Promise {\n await util.repeatedTry(\n () => this.isQueryAvailable(\n query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')));\n return this.getQueryTime(\n query, ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'));\n }\n\n private getQueryTime(query: WebGLQuery, queryTimerVersion: number): number {\n if (queryTimerVersion === 0) {\n return null;\n }\n\n if (queryTimerVersion === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n\n const timeElapsedNanos = gl2.getQueryParameter(query, gl2.QUERY_RESULT);\n // Return milliseconds.\n return timeElapsedNanos / 1000000;\n } else {\n const ext = this.getQueryTimerExtensionWebGL1();\n\n const timeElapsedNanos =\n ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT);\n // Return milliseconds.\n return timeElapsedNanos / 1000000;\n }\n }\n\n private isQueryAvailable(query: WebGLQuery, queryTimerVersion: number):\n boolean {\n if (queryTimerVersion === 0) {\n return true;\n }\n\n if (queryTimerVersion === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.getQueryTimerExtensionWebGL2();\n\n const available =\n gl2.getQueryParameter(query, gl2.QUERY_RESULT_AVAILABLE);\n if (this.disjoint == null) {\n this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT);\n }\n\n return available && !this.disjoint;\n } else {\n const ext = this.getQueryTimerExtensionWebGL1();\n\n const available =\n ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT);\n if (this.disjoint == null) {\n this.disjoint = this.gl.getParameter(ext.GPU_DISJOINT_EXT);\n }\n\n return available && !this.disjoint;\n }\n }\n\n pollFence(fenceContext: FenceContext) {\n return new Promise(resolve => {\n this.addItemToPoll(() => fenceContext.isFencePassed(), () => resolve());\n });\n }\n\n private itemsToPoll: PollItem[] = [];\n\n pollItems(): void {\n // Find the last query that has finished using binary search.\n // All other queries before it are also done.\n const index = binSearchLastTrue(this.itemsToPoll.map(x => x.isDoneFn));\n for (let i = 0; i <= index; ++i) {\n const {resolveFn} = this.itemsToPoll[i];\n resolveFn();\n }\n this.itemsToPoll = this.itemsToPoll.slice(index + 1);\n }\n\n private addItemToPoll(isDoneFn: () => boolean, resolveFn: () => void) {\n this.itemsToPoll.push({isDoneFn, resolveFn});\n if (this.itemsToPoll.length > 1) {\n // We already have a running loop that polls.\n return;\n }\n // Start a new loop that polls.\n util.repeatedTry(() => {\n this.pollItems();\n // End the loop if no more items to poll.\n return this.itemsToPoll.length === 0;\n });\n }\n private bindTextureToFrameBuffer(texture: WebGLTexture) {\n this.throwIfDisposed();\n webgl_util.bindColorTextureToFramebuffer(\n this.gl, texture, this.framebuffer);\n if (this.autoDebugValidate) {\n webgl_util.validateFramebuffer(this.gl);\n }\n }\n\n private unbindTextureToFrameBuffer() {\n if (this.outputTexture != null) {\n webgl_util.bindColorTextureToFramebuffer(\n this.gl, this.outputTexture, this.framebuffer);\n if (this.autoDebugValidate) {\n webgl_util.validateFramebuffer(this.gl);\n }\n } else {\n webgl_util.unbindColorTextureFromFramebuffer(this.gl, this.framebuffer);\n }\n }\n\n private downloadMatrixDriver(\n texture: WebGLTexture,\n downloadAndDecode: () => Float32Array): Float32Array {\n this.bindTextureToFrameBuffer(texture);\n const result = downloadAndDecode();\n this.unbindTextureToFrameBuffer();\n\n return result;\n }\n\n private setOutputMatrixTextureDriver(\n outputMatrixTextureMaybePacked: WebGLTexture, width: number,\n height: number) {\n this.throwIfDisposed();\n const gl = this.gl;\n webgl_util.bindColorTextureToFramebuffer(\n gl, outputMatrixTextureMaybePacked, this.framebuffer);\n if (this.autoDebugValidate) {\n webgl_util.validateFramebuffer(gl);\n }\n this.outputTexture = outputMatrixTextureMaybePacked;\n webgl_util.callAndCheck(gl, () => gl.viewport(0, 0, width, height));\n webgl_util.callAndCheck(gl, () => gl.scissor(0, 0, width, height));\n }\n\n private setOutputMatrixWriteRegionDriver(\n x: number, y: number, width: number, height: number) {\n this.throwIfDisposed();\n webgl_util.callAndCheck(\n this.gl, () => this.gl.scissor(x, y, width, height));\n }\n\n private throwIfDisposed() {\n if (this.disposed) {\n throw new Error('Attempted to use disposed GPGPUContext.');\n }\n }\n\n private throwIfNoProgram() {\n if (this.program == null) {\n throw new Error('No GPU program is currently set.');\n }\n }\n}\n\ntype PollItem = {\n isDoneFn: () => boolean,\n resolveFn: () => void\n};\n\n/**\n * Finds the index of the last true element using binary search where\n * evaluation of an entry is expensive.\n */\nexport function binSearchLastTrue(arr: Array<() => boolean>): number {\n let start = 0;\n let end = arr.length - 1;\n let best = -1;\n while (start <= end) {\n const mid = (start + end) >> 1;\n const isDone = arr[mid]();\n if (isDone) {\n best = mid;\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n return best;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../../tensor';\nimport * as util from '../../util';\n\nimport {GPGPUContext} from './gpgpu_context';\nimport * as shader_compiler from './shader_compiler';\nimport {InputInfo, ShapeInfo} from './shader_compiler';\nimport {TextureData} from './tex_util';\n\nexport interface GPGPUProgram {\n variableNames: string[];\n outputShape: number[];\n userCode: string;\n supportsBroadcasting?: boolean;\n}\n\nexport interface GPGPUBinary {\n webGLProgram: WebGLProgram;\n program: GPGPUProgram;\n uniformLocations: {[name: string]: WebGLUniformLocation};\n gpgpu: GPGPUContext;\n source: string;\n inShapeInfos: ShapeInfo[];\n outShapeInfo: ShapeInfo;\n}\n\nexport interface TensorData {\n tensor: T;\n texData: TextureData;\n isUniform: boolean;\n}\n\nexport function compileProgram(\n gpgpu: GPGPUContext, program: GPGPUProgram, inputs: Array>,\n output: TensorData): GPGPUBinary {\n const userCode = program.userCode;\n const inputInfos: InputInfo[] = inputs.map((input, i) => {\n const shapeInfo = {\n logicalShape: input.tensor.shape,\n texShape: input.isUniform ? null : input.texData.texShape,\n isUniform: input.isUniform\n };\n return {name: program.variableNames[i], shapeInfo};\n });\n const inShapeInfos = inputInfos.map(x => x.shapeInfo);\n const outShapeInfo = {\n logicalShape: output.tensor.shape,\n texShape: output.texData.texShape,\n isUniform: false\n };\n const source = shader_compiler.makeShader(\n inputInfos, outShapeInfo, userCode,\n program.supportsBroadcasting === true);\n\n const webGLProgram = gpgpu.createProgram(source);\n\n const uniformLocations: {[name: string]: WebGLUniformLocation} = {};\n for (let i = 0; i < program.variableNames.length; i++) {\n const uniformName = program.variableNames[i];\n const shouldThrow = false;\n uniformLocations[uniformName] =\n gpgpu.getUniformLocation(webGLProgram, uniformName, shouldThrow);\n }\n\n return {\n program,\n source,\n webGLProgram,\n uniformLocations,\n gpgpu,\n inShapeInfos,\n outShapeInfo\n };\n}\n\nfunction validateBinaryAndProgram(\n shapeInfos: ShapeInfo[], inputs: Array>) {\n if (shapeInfos.length !== inputs.length) {\n throw Error(\n `Binary was compiled with ${shapeInfos.length} inputs, but ` +\n `was executed with ${inputs.length} inputs`);\n }\n\n shapeInfos.forEach((s, i) => {\n const shapeA = s.logicalShape;\n const input = inputs[i];\n const shapeB = input.tensor.shape;\n\n if (!util.arraysEqual(shapeA, shapeB)) {\n throw Error(\n `Binary was compiled with different shapes than ` +\n `the current args. Shapes ${shapeA} and ${shapeB} must match`);\n }\n // The input is uploaded as uniform.\n if (s.isUniform && input.isUniform) {\n return;\n }\n\n const texShapeA = s.texShape;\n const texShapeB = input.isUniform ? null : input.texData.texShape;\n if (!util.arraysEqual(texShapeA, texShapeB)) {\n throw Error(\n `Binary was compiled with different texture shapes than the` +\n ` current args. Shape ${texShapeA} and ${texShapeB} must match`);\n }\n });\n}\n\nexport function runProgram(\n binary: GPGPUBinary, inputs: Array>, output: TensorData,\n customSetup?: (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) =>\n void): void {\n validateBinaryAndProgram(binary.inShapeInfos, inputs);\n validateBinaryAndProgram([binary.outShapeInfo], [output]);\n\n const outTex = output.texData.texture;\n const outTexShape = output.texData.texShape;\n const gpgpu = binary.gpgpu;\n gpgpu.setOutputMatrixTexture(outTex, outTexShape[0], outTexShape[1]);\n gpgpu.setProgram(binary.webGLProgram);\n inputs.forEach((input, i) => {\n const variableName = binary.program.variableNames[i];\n const variableUniformLocation = binary.uniformLocations[variableName];\n if (variableUniformLocation != null) {\n if (input.isUniform) {\n if (input.tensor.size === 1) {\n gpgpu.gl.uniform1f(\n variableUniformLocation, input.tensor.dataSync()[0]);\n } else {\n let vals = input.tensor.dataSync();\n if (!(vals instanceof Float32Array)) {\n vals = new Float32Array(vals);\n }\n gpgpu.gl.uniform1fv(variableUniformLocation, vals);\n }\n return;\n }\n const tex = input.texData.texture;\n gpgpu.setInputMatrixTexture(tex, variableUniformLocation, i);\n }\n });\n\n if (customSetup != null) {\n customSetup(gpgpu, binary.webGLProgram);\n }\n gpgpu.executeProgram();\n}\n\nexport function makeShaderKey(\n program: GPGPUProgram, inputs: Array>,\n output: TensorData): string {\n let keyInputs = '';\n inputs.concat(output).forEach(x => {\n keyInputs +=\n `${x.tensor.shape}_${x.isUniform ? 'uniform' : x.texData.texShape}`;\n });\n const keyUserCode = program.userCode;\n const keyBroadcast = (program.supportsBroadcasting === true).toString();\n let key = program.constructor.name;\n // Fast string concat. See https://jsperf.com/string-concatenation/14.\n key += '_' + keyBroadcast + '_' + keyInputs + '_' + keyUserCode;\n return key;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class LRNProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(\n xShape: number[], radius: number, bias: number, alpha: number,\n beta: number) {\n const rad = radius;\n const maxD = xShape[3] - 1;\n this.outputShape = xShape;\n\n // optimize pow(bias + alpha * sum, -beta)\n // src: https://github.com/tensorflow/tensorflow/..\n // blob/26033a1644a9c4a5fbe3170ab2e864b6a4ccd4ca/..\n // tensorflow/core/kernels/mkl_lrn_op.cc#L320\n let powOperator;\n const basis = `float(${bias}) + float(${alpha}) * sum`;\n if (beta === 0.5) {\n powOperator = `inversesqrt(${basis})`;\n } else if (beta === 1.0) {\n powOperator = `1.0/(${basis})`;\n } else {\n powOperator = `exp(log(${basis}) * float(-${beta}));`;\n }\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${rad}; j <= ${rad}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${maxD}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${powOperator};\n setOutput(val);\n }\n `;\n }\n}\n","import {GPGPUProgram} from './gpgpu_math';\n\nexport class LRNGradProgram implements GPGPUProgram {\n variableNames = ['inputImage', 'outputImage', 'dy'];\n outputShape: number[] = [];\n userCode: string;\n depthRadius: number;\n bias: number;\n alpha: number;\n beta: number;\n depth: number;\n\n constructor(\n inputShape: number[], depthRadius: number, bias: number, alpha: number,\n beta: number) {\n this.outputShape = inputShape;\n this.depth = inputShape[3];\n this.depthRadius = depthRadius;\n this.bias = bias;\n this.alpha = alpha;\n this.beta = beta;\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${depthRadius})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${depthRadius} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${alpha}) * norm + float(${bias});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${alpha})\n * float(${beta})\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${beta});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class MaxPool2DBackpropProgram implements GPGPUProgram {\n variableNames = ['dy', 'maxPos'];\n outputShape: number[];\n userCode: string;\n\n constructor(convInfo: Conv2DInfo) {\n this.outputShape = convInfo.inShape;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n\n const lastIndex = filterHeight * filterWidth - 1;\n this.userCode = `\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n float dyR = float(dyRCorner + wR) / ${strideHeight}.0;\n\n if (dyR < 0.0 || dyR >= ${convInfo.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n float dyC = float(dyCCorner + wC) / ${strideWidth}.0;\n\n if (dyC < 0.0 || dyC >= ${convInfo.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${lastIndex} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${filterWidth} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class MatMulProgram implements GPGPUProgram {\n variableNames = ['matrixA', 'matrixB'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n aShape: [number, number], bShape: [number, number], transposeA = false,\n transposeB = false) {\n const outerShapeA = transposeA ? aShape[1] : aShape[0];\n const outerShapeB = transposeB ? bShape[0] : bShape[1];\n const sharedDim = transposeA ? aShape[0] : aShape[1];\n this.outputShape = [outerShapeA, outerShapeB];\n\n const aSnippetFromOffset = (vec4Offset: number, indexVar: string|number) =>\n transposeA ? `${indexVar} + ${vec4Offset}, aRow` :\n `aRow, ${indexVar} + ${vec4Offset}`;\n const bSnippetFromOffset = (vec4Offset: number, indexVar: string|number) =>\n transposeB ? `bCol, ${indexVar} + ${vec4Offset}` :\n `${indexVar} + ${vec4Offset}, bCol`;\n\n const sharedDimNearestVec4 = Math.floor(sharedDim / 4) * 4;\n const sharedDimVec4Remainder = sharedDim % 4;\n\n this.userCode = ` float dotARowBCol(int aRow, int bCol) {\n float result = 0.0;\n for (int i = 0; i < ${sharedDimNearestVec4}; i += 4) {\n vec4 a = vec4(\n getMatrixA(${aSnippetFromOffset(0, 'i')}),\n getMatrixA(${aSnippetFromOffset(1, 'i')}),\n getMatrixA(${aSnippetFromOffset(2, 'i')}),\n getMatrixA(${aSnippetFromOffset(3, 'i')})\n );\n vec4 b = vec4(\n getMatrixB(${bSnippetFromOffset(0, 'i')}),\n getMatrixB(${bSnippetFromOffset(1, 'i')}),\n getMatrixB(${bSnippetFromOffset(2, 'i')}),\n getMatrixB(${bSnippetFromOffset(3, 'i')})\n );\n\n result += dot(a, b);\n }\n\n if (${sharedDimVec4Remainder === 1}) {\n result += getMatrixA(${aSnippetFromOffset(0, sharedDimNearestVec4)}) *\n getMatrixB(${bSnippetFromOffset(0, sharedDimNearestVec4)});\n } else if (${sharedDimVec4Remainder === 2}) {\n vec2 a = vec2(\n getMatrixA(${aSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixA(${aSnippetFromOffset(1, sharedDimNearestVec4)})\n );\n vec2 b = vec2(\n getMatrixB(${bSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixB(${bSnippetFromOffset(1, sharedDimNearestVec4)})\n );\n result += dot(a, b);\n } else if (${sharedDimVec4Remainder === 3}) {\n vec3 a = vec3(\n getMatrixA(${aSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixA(${aSnippetFromOffset(1, sharedDimNearestVec4)}),\n getMatrixA(${aSnippetFromOffset(2, sharedDimNearestVec4)})\n );\n vec3 b = vec3(\n getMatrixB(${bSnippetFromOffset(0, sharedDimNearestVec4)}),\n getMatrixB(${bSnippetFromOffset(1, sharedDimNearestVec4)}),\n getMatrixB(${bSnippetFromOffset(2, sharedDimNearestVec4)})\n );\n result += dot(a, b);\n }\n\n return result;\n }\n\n void main() {\n ivec2 resRC = getOutputCoords();\n setOutput(dotARowBCol(resRC.x, resRC.y));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class MultinomialProgram implements GPGPUProgram {\n variableNames = ['probs'];\n outputShape: number[];\n userCode: string;\n\n // Caching uniform location for speed.\n seedLoc: WebGLUniformLocation;\n\n constructor(batchSize: number, numOutcomes: number, numSamples: number) {\n this.outputShape = [batchSize, numSamples];\n\n this.userCode = `\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${numOutcomes - 1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${numOutcomes - 1}));\n }\n `;\n }\n\n getCustomSetupFunc(seed: number) {\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.seedLoc == null) {\n this.seedLoc = gpgpu.getUniformLocation(webGLProgram, 'seed');\n }\n gpgpu.gl.uniform1f(this.seedLoc, seed);\n };\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class OneHotProgram implements GPGPUProgram {\n variableNames = ['indices'];\n outputShape: number[];\n userCode: string;\n\n // Caching uniform location for speed.\n seedLoc: WebGLUniformLocation;\n\n constructor(\n numIndices: number, depth: number, onValue: number, offValue: number) {\n this.outputShape = [numIndices, depth];\n\n this.userCode = `\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${offValue}), float(${onValue}),\n float(index == coords.y)));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class PadProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n xShape: number[], paddings: Array<[number, number]>,\n constantValue: number) {\n this.outputShape = paddings.map(\n (p, i) => p[0] /* beforePad */ + xShape[i] + p[1] /* afterPad */);\n const rank = xShape.length;\n const type = getCoordsDataType(rank);\n\n const start = paddings.map(p => p[0]).join(',');\n const end = paddings.map((p, i) => p[0] + xShape[i]).join(',');\n const unpackedCoords =\n ['coords[0]', 'coords[1]', 'coords[2]','coords[3]'].slice(0, rank);\n\n if (rank === 1) {\n this.userCode = `\n int start = ${start};\n int end = ${end};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float(${constantValue}));\n } else {\n setOutput(getX(outC - start));\n }\n }\n `;\n return;\n }\n this.userCode = `\n ${type} start = ${type}(${start});\n ${type} end = ${type}(${end});\n\n void main() {\n ${type} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float(${constantValue}));\n } else {\n ${type} coords = outC - start;\n setOutput(getX(${unpackedCoords}));\n }\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Conv2DInfo} from '../../ops/conv_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class Pool2DProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n convInfo: Conv2DInfo, poolType: 'max'|'avg', computePositions: boolean) {\n if (poolType === 'avg' && computePositions) {\n throw new Error('Cannot compute positions for average pool.');\n }\n\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n this.outputShape = convInfo.outShape;\n\n const isAvgPool = poolType === 'avg';\n\n let initializationValue = '0.0';\n if (!isAvgPool) {\n initializationValue = '-1.0 / 0.0';\n }\n\n if (computePositions) {\n const compareOp = '>=';\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidth}; wC++) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${compareOp} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * ${filterWidth} + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `;\n return;\n }\n\n const compareOp = 'max';\n\n let returnValue = `${poolType}(${poolType}(${poolType}(` +\n 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])';\n if (poolType === 'avg') {\n returnValue = `avgValue / count`;\n }\n\n const filterWidthNearestVec4 = Math.floor(filterWidth / 4) * 4;\n const filterWidthVec4Remainder = filterWidth % 4;\n\n const updateSnippet = `\n if (${isAvgPool}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ${compareOp}(values, minMaxValue);\n }\n `;\n\n this.userCode = `\n const ivec2 strides = ivec2(${strideHeight}, ${strideWidth});\n const ivec2 pads = ivec2(${padTop}, ${padLeft});\n const float initializationValue = ${initializationValue};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${convInfo.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${initializationValue});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${filterHeight}; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${convInfo.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${filterWidthNearestVec4}; wC += 4) {\n int xC = xCCorner + wC;\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n getValue(batch, xR, xC + 3, d)\n );\n\n ${updateSnippet}\n }\n\n int xC = xCCorner + ${filterWidthNearestVec4};\n if (${filterWidthVec4Remainder === 1}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${filterWidthVec4Remainder === 2}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${filterWidthVec4Remainder === 3}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n initializationValue\n );\n\n ${updateSnippet}\n }\n }\n setOutput(${returnValue});\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ReduceInfo} from '../../ops/reduce_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ReduceProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(\n reduceInfo: ReduceInfo, reduceType: 'all'|'any'|'max'|'min'|'sum') {\n const windowSize = reduceInfo.windowSize;\n const batchSize = reduceInfo.batchSize;\n const inSize = reduceInfo.inSize;\n const outSize = Math.ceil(inSize / windowSize);\n this.outputShape = [batchSize, outSize];\n\n let initializationValue = '0.0';\n let compareOp = ``;\n\n if (reduceType === 'min') {\n initializationValue = '1.0 / 0.0';\n compareOp = `min`;\n } else if (reduceType === 'max') {\n initializationValue = '-1.0 / 0.0';\n compareOp = `max`;\n }\n\n let returnValue = `${reduceType}(${reduceType}(${reduceType}(` +\n 'minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])';\n\n if (reduceType === 'sum') {\n returnValue = `sumValue`;\n } else if (reduceType === 'all') {\n returnValue = `allValue`;\n } else if (reduceType === 'any') {\n returnValue = `anyValue`;\n }\n\n const windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4;\n const windowSizeVec4Remainder = windowSize % 4;\n\n let updateSnippet = `\n if (${reduceType === 'sum'}) {\n sumValue += dot(values, ones);\n } else {\n minMaxValue = ${compareOp}(values, minMaxValue);\n }\n `;\n\n let vecType = `vec4`;\n\n if (reduceType === 'all') {\n initializationValue = '1.0';\n updateSnippet = `\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n `;\n vecType = `bvec4`;\n } else if (reduceType === 'any') {\n initializationValue = '0.0';\n updateSnippet = `\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n `;\n vecType = `bvec4`;\n }\n\n let checkOutOfBounds = '';\n if (inSize % windowSize > 0) {\n checkOutOfBounds = `\n if (inIdx < 0 || inIdx >= ${inSize}) {\n return initializationValue;\n }\n `;\n }\n this.userCode = `\n const float initializationValue = ${initializationValue};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${checkOutOfBounds}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${windowSize};\n\n vec4 minMaxValue = vec4(${initializationValue});\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${windowSizeNearestVec4}; i += 4) {\n int inIdx = inOffset + i;\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${updateSnippet}\n }\n\n int inIdx = inOffset + ${windowSizeNearestVec4};\n if (${windowSizeVec4Remainder === 1}) {\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 2}) {\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 3}) {\n ${vecType} values = ${vecType}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${updateSnippet}\n }\n setOutput(${returnValue});\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor4D} from '../../tensor';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeBilinearBackpropProgram implements GPGPUProgram {\n variableNames = ['dy'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n this.outputShape = x.shape;\n const [, xHeight, xWidth, ] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass and add the corresponding\n // coefficient from dy to the gradient (with some interpolation).\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n const invHeightScale = 1 / heightScale;\n const invWidthScale = 1 / widthScale;\n\n // This defines the size of the window of values around a particular\n // index in dy that we want to search for contributions to dx.\n const winHeight = (Math.ceil(invHeightScale) * 2) + 2;\n const winWidth = (Math.ceil(invWidthScale) * 2) + 2;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${heightScale});\n const float widthScale = float(${widthScale});\n\n const float invHeightScale = float(${invHeightScale});\n const float invWidthScale = float(${invWidthScale});\n\n const int winHeight = int(${winHeight});\n const int winWidth = int(${winWidth});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${yHeight}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${yWidth}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${xHeight - 1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${xWidth - 1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeBilinearProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(\n inputShape: [number, number, number, number], newHeight: number,\n newWidth: number, alignCorners: boolean) {\n const [batch, oldHeight, oldWidth, depth] = inputShape;\n this.outputShape = [batch, newHeight, newWidth, depth];\n\n const effectiveInSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n this.userCode = `\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${effectiveInSize[0] / effectiveOutSize[0]},\n ${effectiveInSize[1] / effectiveOutSize[1]});\n const vec2 inputShapeRC = vec2(${oldHeight}.0, ${oldWidth}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor4D} from '../../tensor';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeNearestNeigborBackpropProgram implements GPGPUProgram {\n variableNames = ['dy'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n this.outputShape = x.shape;\n const [, xHeight, xWidth, ] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass and add the corresponding\n // coefficient from dy to the gradient (with some interpolation).\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n const invHeightScale = 1 / heightScale;\n const invWidthScale = 1 / widthScale;\n\n // This defines the size of the window of values around a particular\n // index in dy that we want to search for contributions to dx.\n const winHeight = (Math.ceil(invHeightScale) * 2) + 2;\n const winWidth = (Math.ceil(invWidthScale) * 2) + 2;\n\n this.userCode = `\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${heightScale});\n const float widthScale = float(${widthScale});\n\n const float invHeightScale = float(${invHeightScale});\n const float invWidthScale = float(${invWidthScale});\n\n const int winHeight = int(${winHeight});\n const int winWidth = int(${winWidth});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${yHeight}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${yWidth}) {\n continue;\n }\n\n float sourceFracRow =\n float(${effectiveXSize[0]}) *\n (float(dyR) / float(${effectiveYSize[0]}));\n\n float sourceFracCol =\n float(${effectiveXSize[1]}) *\n (float(dyC) / float(${effectiveYSize[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${xHeight}) - 1),\n ${alignCorners} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${xWidth}) - 1),\n ${alignCorners} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class ResizeNearestNeighborProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[] = [];\n userCode: string;\n\n constructor(\n inputShape: [number, number, number, number], newHeight: number,\n newWidth: number, alignCorners: boolean) {\n const [batch, oldHeight, oldWidth, depth] = inputShape;\n this.outputShape = [batch, newHeight, newWidth, depth];\n\n const effectiveInSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n // When align corners is false, we rounds the value with floor.\n const roundBase = alignCorners ? '0.5' : '0.0';\n\n this.userCode = `\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${effectiveInSize[0] / effectiveOutSize[0]},\n ${effectiveInSize[1] / effectiveOutSize[1]});\n const vec2 inputShapeRC = vec2(${oldHeight}.0, ${oldWidth}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${roundBase})));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class ReverseProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n\n constructor(xShape: number[], axis: number[]) {\n const rank = xShape.length;\n if (rank > 4) {\n throw new Error(\n `WebGL backend: Reverse of rank-${rank} tensor is not yet supported`);\n }\n this.outputShape = xShape;\n\n if (rank === 1) {\n this.userCode = `\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${xShape[0]} - coord - 1));\n }\n `;\n return;\n }\n const getInCoord = (i: number) => {\n if (axis.indexOf(i) !== -1 && xShape[i] !== 1) {\n return `${xShape[i]} - coords[${i}] - 1`;\n }\n return `coords[${i}]`;\n };\n const inCoords = xShape.map((_, i) => getInCoord(i)).join(',');\n const type = getCoordsDataType(rank);\n\n this.userCode = `\n void main() {\n ${type} coords = getOutputCoords();\n setOutput(getX(${inCoords}));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {SegOpInfo} from '../../ops/segment_util';\nimport {GPGPUProgram} from './gpgpu_math';\n\nexport class SegmentOpProgram implements GPGPUProgram {\n variableNames = ['x', 'segmentIds'];\n outputShape: number[];\n userCode: string;\n\n constructor(segOpInfo: SegOpInfo, segOpType: 'unsortedSegmentSum') {\n const windowSize = segOpInfo.windowSize;\n const batchSize = segOpInfo.batchSize;\n const inSize = segOpInfo.inSize;\n const numSegments = segOpInfo.numSegments;\n const outSize = numSegments * Math.ceil(inSize / windowSize);\n this.outputShape = [batchSize, outSize];\n\n const initializationValue = '0.0';\n const returnValue = `sumValue`;\n\n const windowSizeNearestVec4 = Math.floor(windowSize / 4) * 4;\n const windowSizeVec4Remainder = windowSize % 4;\n\n const updateSnippet = `\n sumValue += dot(values, filter);\n `;\n\n let checkValueOutOfBounds = '';\n if (inSize % windowSize > 0) {\n checkValueOutOfBounds = `\n if (inIdx < 0 || inIdx >= ${inSize}) {\n return initializationValue;\n }\n `;\n }\n\n let checkSegmentIdOutOfBounds = '';\n if (inSize % windowSize > 0) {\n checkSegmentIdOutOfBounds = `\n if (inIdx < 0 || inIdx >= ${inSize}) {\n return -1.0;\n }\n `;\n }\n\n this.userCode = `\n const float initializationValue = ${initializationValue};\n\n float getValue(int batch, int inIdx) {\n ${checkValueOutOfBounds}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${checkSegmentIdOutOfBounds}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${numSegments})) * float(${windowSize}));\n int currentSeg = int(mod(float(outIdx), float(${numSegments})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${windowSizeNearestVec4}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${updateSnippet}\n }\n\n int inIdx = inOffset + ${windowSizeNearestVec4};\n if (${windowSizeVec4Remainder === 1}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 2}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${updateSnippet}\n } else if (${windowSizeVec4Remainder === 3}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${updateSnippet}\n }\n setOutput(${returnValue});\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class SelectProgram implements GPGPUProgram {\n variableNames = ['c', 'a', 'b'];\n outputShape: number[];\n userCode: string;\n\n constructor(cRank: number, shape: number[], rank: number) {\n this.outputShape = shape;\n\n let cCoords;\n let abCoords;\n if (rank > 4) {\n throw Error(`Where for rank ${rank} is not yet supported`);\n }\n\n if (rank === 1) {\n abCoords = `resRC`;\n cCoords = `resRC`;\n } else {\n const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w'];\n const cCoordVars = [];\n const abCoordVars = [];\n for (let i = 0; i < shape.length; i++) {\n abCoordVars.push(`${currentCoords[i]}`);\n if (i < cRank) {\n cCoordVars.push(`${currentCoords[i]}`);\n }\n }\n cCoords = cCoordVars.join();\n abCoords = abCoordVars.join();\n }\n\n const dtype = getCoordsDataType(rank);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n float cVal = getC(${cCoords});\n if (cVal >= 1.0) {\n setOutput(getA(${abCoords}));\n } else {\n setOutput(getB(${abCoords}));\n }\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class SliceProgram implements GPGPUProgram {\n variableNames = ['source'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n // Caching uniform location for speed.\n startLoc: WebGLUniformLocation;\n\n constructor(destSize: number[]) {\n this.outputShape = destSize;\n this.rank = destSize.length;\n\n const dtype = getCoordsDataType(this.rank);\n const sourceCoords = getCoords(this.rank);\n\n this.userCode = `\n uniform ${dtype} start;\n\n void main() {\n ${dtype} sourceLoc = start + getOutputCoords();\n setOutput(getSource(${sourceCoords}));\n }\n `;\n }\n\n getCustomSetupFunc(start: number[]) {\n if (start.length !== this.rank) {\n throw Error(\n `The rank (${this.rank}) of the program must match the ` +\n `length of start (${start.length})`);\n }\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.startLoc == null) {\n this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'start');\n if (this.startLoc == null) {\n // This means the compiler has optimized and realized it doesn't need\n // the uniform.\n return;\n }\n }\n if (this.rank === 1) {\n gpgpu.gl.uniform1i(this.startLoc, start[0]);\n } else if (this.rank === 2) {\n gpgpu.gl.uniform2i(this.startLoc, start[0], start[1]);\n } else if (this.rank === 3) {\n gpgpu.gl.uniform3i(this.startLoc, start[0], start[1], start[2]);\n } else if (this.rank === 4) {\n gpgpu.gl.uniform4i(\n this.startLoc, start[0], start[1], start[2], start[3]);\n } else {\n throw Error(`Slicing for rank ${this.rank} is not yet supported`);\n }\n };\n }\n}\n\nfunction getCoords(rank: number): string {\n if (rank === 1) {\n return 'sourceLoc';\n } else if (rank === 2) {\n return 'sourceLoc.x, sourceLoc.y';\n } else if (rank === 3) {\n return 'sourceLoc.x, sourceLoc.y, sourceLoc.z';\n } else if (rank === 4) {\n return 'sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w';\n } else {\n throw Error(`Slicing for rank ${rank} is not yet supported`);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class StridedSliceProgram implements GPGPUProgram {\n variableNames = ['x'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(begin: number[], strides: number[], shape: number[]) {\n this.outputShape = shape;\n this.rank = shape.length;\n const dtype = getCoordsDataType(this.rank);\n\n let newCoords = '';\n if (this.rank === 1) {\n newCoords = 'coords * strides + begin';\n } else {\n newCoords =\n shape.map((_, i) => `coords[${i}] * strides[${i}] + begin[${i}]`)\n .join(',');\n }\n\n this.userCode = `\n ${dtype} begin = ${dtype}(${begin});\n ${dtype} strides = ${dtype}(${strides});\n\n void main() {\n ${dtype} coords = getOutputCoords();\n setOutput(getX(${newCoords}));\n }\n `;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../../environment';\n\nimport {GPGPUContext} from './gpgpu_context';\nimport {PhysicalTextureType, TextureUsage} from './tex_util';\n\nexport class TextureManager {\n private numUsedTextures = 0;\n private numFreeTextures = 0;\n private freeTextures: {[shape: string]: WebGLTexture[]} = {};\n private logEnabled = false;\n private usedTextures: {[shape: string]: WebGLTexture[]} = {};\n\n constructor(private gpgpu: GPGPUContext) {}\n\n acquireTexture(shapeRC: [number, number], usage: TextureUsage): WebGLTexture {\n const physicalTexType = getPhysicalFromLogicalTextureType(usage);\n\n const shapeKey = getKeyFromTextureShape(shapeRC, physicalTexType);\n if (!(shapeKey in this.freeTextures)) {\n this.freeTextures[shapeKey] = [];\n }\n if (!(shapeKey in this.usedTextures)) {\n this.usedTextures[shapeKey] = [];\n }\n\n if (this.freeTextures[shapeKey].length > 0) {\n this.numFreeTextures--;\n this.numUsedTextures++;\n this.log();\n const newTexture = this.freeTextures[shapeKey].shift();\n this.usedTextures[shapeKey].push(newTexture);\n return newTexture;\n }\n this.numUsedTextures++;\n this.log();\n\n let newTexture: WebGLTexture;\n if (physicalTexType === PhysicalTextureType.FLOAT32) {\n newTexture =\n this.gpgpu.createFloat32MatrixTexture(shapeRC[0], shapeRC[1]);\n } else if (physicalTexType === PhysicalTextureType.FLOAT16) {\n newTexture =\n this.gpgpu.createFloat16MatrixTexture(shapeRC[0], shapeRC[1]);\n\n } else if (physicalTexType === PhysicalTextureType.UNSIGNED_BYTE) {\n newTexture =\n this.gpgpu.createUnsignedBytesMatrixTexture(shapeRC[0], shapeRC[1]);\n }\n this.usedTextures[shapeKey].push(newTexture);\n\n return newTexture;\n }\n\n releaseTexture(\n texture: WebGLTexture, shape: [number, number],\n logicalTexType: TextureUsage): void {\n const physicalTexType = getPhysicalFromLogicalTextureType(logicalTexType);\n const shapeKey = getKeyFromTextureShape(shape, physicalTexType);\n if (!(shapeKey in this.freeTextures)) {\n this.freeTextures[shapeKey] = [];\n }\n this.freeTextures[shapeKey].push(texture);\n this.numFreeTextures++;\n this.numUsedTextures--;\n const texList = this.usedTextures[shapeKey];\n const texIndex = texList.indexOf(texture);\n if (texIndex < 0) {\n throw new Error(\n 'Cannot release a texture that was never provided by this ' +\n 'texture manager');\n }\n texList.splice(texIndex, 1);\n this.log();\n }\n\n private log() {\n if (!this.logEnabled) {\n return;\n }\n const total = this.numFreeTextures + this.numUsedTextures;\n console.log(\n 'Free/Used', `${this.numFreeTextures} / ${this.numUsedTextures}`,\n `(${total})`);\n }\n\n getNumUsedTextures(): number {\n return this.numUsedTextures;\n }\n\n getNumFreeTextures(): number {\n return this.numFreeTextures;\n }\n\n dispose() {\n if (this.freeTextures == null) {\n // Already disposed.\n return;\n }\n for (const texShape in this.freeTextures) {\n this.freeTextures[texShape].forEach(tex => {\n this.gpgpu.deleteMatrixTexture(tex);\n });\n }\n for (const texShape in this.usedTextures) {\n this.usedTextures[texShape].forEach(tex => {\n this.gpgpu.deleteMatrixTexture(tex);\n });\n }\n this.freeTextures = null;\n this.usedTextures = null;\n this.numUsedTextures = 0;\n this.numFreeTextures = 0;\n }\n}\n\nfunction getPhysicalFromLogicalTextureType(logicalTexType: TextureUsage):\n PhysicalTextureType {\n if (logicalTexType === TextureUsage.DOWNLOAD ||\n logicalTexType === TextureUsage.PIXELS) {\n return PhysicalTextureType.UNSIGNED_BYTE;\n } else if (logicalTexType === TextureUsage.UPLOAD) {\n return PhysicalTextureType.FLOAT32;\n } else if (logicalTexType === TextureUsage.RENDER) {\n return ENV.get('WEBGL_RENDER_FLOAT32_ENABLED') ?\n PhysicalTextureType.FLOAT32 :\n PhysicalTextureType.FLOAT16;\n }\n throw new Error(`Unknown logical texture type ${logicalTexType}`);\n}\n\nfunction getKeyFromTextureShape(\n shapeRowsCol: [number, number],\n physicalTexType: PhysicalTextureType): string {\n return `${shapeRowsCol[0]}_${shapeRowsCol[1]}_${physicalTexType}`;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class TileProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(aShape: number[], reps: number[]) {\n const outputShape: number[] = new Array(aShape.length);\n for (let i = 0; i < outputShape.length; i++) {\n outputShape[i] = aShape[i] * reps[i];\n }\n this.outputShape = outputShape;\n this.rank = outputShape.length;\n const dtype = getCoordsDataType(this.rank);\n const sourceCoords = getSourceCoords(aShape);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n setOutput(getA(${sourceCoords}));\n }\n `;\n }\n}\n\nfunction getSourceCoords(aShape: number[]): string {\n const rank = aShape.length;\n if (rank > 5) {\n throw Error(`Tile for rank ${rank} is not yet supported`);\n }\n if (rank === 1) {\n return `imod(resRC, ${aShape[0]})`;\n }\n\n const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u'];\n\n const sourceCoords = [];\n for (let i = 0; i < aShape.length; i++) {\n sourceCoords.push(`imod(${currentCoords[i]}, ${aShape[i]})`);\n }\n return sourceCoords.join();\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {getCoordsDataType} from './shader_compiler';\n\nexport class TransposeProgram implements GPGPUProgram {\n variableNames = ['A'];\n outputShape: number[];\n userCode: string;\n rank: number;\n\n constructor(aShape: number[], newDim: number[]) {\n const outputShape: number[] = new Array(aShape.length);\n for (let i = 0; i < outputShape.length; i++) {\n outputShape[i] = aShape[newDim[i]];\n }\n this.outputShape = outputShape;\n this.rank = outputShape.length;\n const dtype = getCoordsDataType(this.rank);\n const switched = getSwitchedCoords(newDim);\n\n this.userCode = `\n void main() {\n ${dtype} resRC = getOutputCoords();\n setOutput(getA(${switched}));\n }\n `;\n }\n}\n\nfunction getSwitchedCoords(newDim: number[]): string {\n const rank = newDim.length;\n if (rank > 6) {\n throw Error(`Transpose for rank ${rank} is not yet supported`);\n }\n const originalOrder =\n ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w', 'resRC.u', 'resRC.v'];\n const switchedCoords = new Array(rank);\n for (let i = 0; i < newDim.length; i++) {\n switchedCoords[newDim[i]] = originalOrder[i];\n }\n return switchedCoords.join();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport const ERF_P = 0.3275911;\nexport const ERF_A1 = 0.254829592;\nexport const ERF_A2 = -0.284496736;\nexport const ERF_A3 = 1.421413741;\nexport const ERF_A4 = -1.453152027;\nexport const ERF_A5 = 1.061405429;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport const SELU_SCALEALPHA = 1.7580993408473768599402175208123;\nexport const SELU_SCALE = 1.0507009873554804934193349852946;\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as erf_util from '../../ops/erf_util';\nimport * as selu_util from '../../ops/selu_util';\n\nimport {GPGPUProgram} from './gpgpu_math';\nimport {GPGPUContext} from './gpgpu_context';\n\nexport class UnaryOpProgram implements GPGPUProgram {\n variableNames = ['A'];\n userCode: string;\n outputShape: number[];\n\n // Caching uniform location for speed.\n startLoc: WebGLUniformLocation;\n\n constructor(aShape: number[], opSnippet: string) {\n this.outputShape = aShape;\n this.userCode = `\n uniform float NAN;\n float unaryOperation(float x) {\n ${opSnippet}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `;\n }\n\n getCustomSetupFunc() {\n return (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => {\n if (this.startLoc == null) {\n this.startLoc = gpgpu.getUniformLocationNoThrow(webGLProgram, 'NAN');\n if (this.startLoc == null) {\n // This means the compiler has optimized and realized it doesn't need\n // the uniform.\n return;\n }\n }\n gpgpu.gl.uniform1f(this.startLoc, NaN);\n };\n }\n}\n\nconst CHECK_NAN_SNIPPET = `if (isNaN(x)) return x;`;\n\nexport const ABS = `return abs(x);`;\n\nexport const RELU = CHECK_NAN_SNIPPET + `\n return (x < 0.0) ? 0.0 : x;\n`;\n\nexport const ELU = `return (x >= 0.0) ? x : (exp(x) - 1.0);`;\n\nexport const SELU = `\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${selu_util.SELU_SCALEALPHA};\n float scale = ${selu_util.SELU_SCALE};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`;\n\nexport function STEP(alpha = 0.0) {\n return CHECK_NAN_SNIPPET + `\n return x > 0.0 ? 1.0 : float(${alpha});\n `;\n}\n\nexport const NEG = `return -x;`;\n\nexport const CEIL = `return ceil(x);`;\n\nexport const FLOOR = `return floor(x);`;\n\nexport const SIGN = `\n if (isNaN(x)) { return 0.0; }\n return sign(x);\n`;\n\nexport const ROUND = `\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n`;\n\nexport const EXP = `return exp(x);`;\n\nexport const EXPM1 = `return exp(x) - 1.0;`;\n\nexport const LOG = `if (x < 0.0) return NAN;\n return log(x);`;\n\nexport const LOG1P = `return log(1.0 + x);`;\n\nexport const SQRT = `return sqrt(x);`;\n\nexport const RSQRT = `return inversesqrt(x);`;\n\nexport const SIGMOID = `return 1.0 / (1.0 + exp(-1.0 * x));`;\n\n/**\n * mirrors the implementation of tf.nn.softplus: https://goo.gl/vkcvwX\n *\n * epsilon is the difference between 1.0 and the next representable\n * float. For a single precision 32 bit float this should be 2^-23, see:\n * https://math.byu.edu/~schow/work/IEEEFloatingPoint.htm\n *\n * too_large = (x > -threshold) is value above which exp(x) may overflow\n * but softplus(x) == x is within machine epsilon\n *\n * too_small = (x < threshold) is value below which exp(x) may underflow,\n * but softplus(x) == exp(x) is within machine epsilon.\n */\nexport const SOFTPLUS = `\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n`;\n\nexport const SIN = CHECK_NAN_SNIPPET + `\n return sin(x);\n`;\n\nexport const COS = CHECK_NAN_SNIPPET + `\n return cos(x);\n`;\n\nexport const TAN = `return tan(x);`;\n\nexport const ASIN = `return asin(x);`;\n\nexport const ACOS = `return acos(x);`;\n\nexport const ATAN = CHECK_NAN_SNIPPET + `\n return atan(x);\n`;\n\nexport const SINH = `\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n`;\n\nexport const COSH = `\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n`;\n\nexport const TANH = `\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n`;\n\nexport const ASINH = `return log(x + sqrt(x * x + 1.0));`;\n\nexport const ACOSH = CHECK_NAN_SNIPPET + `\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));`;\n\nexport const ATANH = CHECK_NAN_SNIPPET + `\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;`;\n\nexport const ERF = `\n // Error function is calculated approximately with elementary function.\n // See \"Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\n float p = ${erf_util.ERF_P};\n float a1 = ${erf_util.ERF_A1};\n float a2 = ${erf_util.ERF_A2};\n float a3 = ${erf_util.ERF_A3};\n float a4 = ${erf_util.ERF_A4};\n float a5 = ${erf_util.ERF_A5};\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n`;\n\nexport const SQUARE = `return x * x;`;\n\nexport const RECIPROCAL = `return 1.0 / x;`;\n\nexport const LOGICAL_NOT = `return float(!(x >= 1.0));`;\n\nexport const TO_INT = `return float(int(x));`;\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensorArray} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assert, sizeFromShape} from '../util';\nimport {parseAxisParam} from './axis_util';\nimport * as concat_util from './concat_util';\nimport {op} from './operation';\n\n/**\n * Concatenates a list of `Tensor1D`s along an axis. See `concat` for details.\n *\n * For example, if:\n * A: shape(3) = |r1, g1, b1|\n * B: shape(2) = |r2, g2|\n * C = tf.concat1d([A, B]) == |r1, g1, b1, r2, g2|\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @return The concatenated array.\n */\nfunction concat1d_(tensors: Tensor1D[]|TensorLike[]): Tensor1D {\n return concat(tensors, 0 /* axis */);\n}\n\n/**\n * Concatenates a list of `Tensor2D`s along an axis. See `concat` for details.\n *\n * For example, if:\n * A: shape(2, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n *\n * B: shape(2, 3) = | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * C = tf.concat2d([A, B], axis)\n *\n * if axis = 0:\n * C: shape(4, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n * | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * if axis = 1:\n * C = shape(2, 6) = | r1, g1, b1, r3, g3, b3 |\n * | r2, g2, b2, r4, g4, b4 |\n *\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @param axis The axis to concatenate along.\n * @return The concatenated array.\n */\nfunction concat2d_(tensors: Tensor2D[]|TensorLike[], axis: number): Tensor2D {\n return concat(tensors, axis);\n}\n\n/**\n * Concatenates a list of `Tensor3D`s along an axis. See `concat` for details.\n *\n * For example, if:\n * A: shape(2, 1, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n *\n * B: shape(2, 1, 3) = | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * C = tf.concat3d([A, B], axis)\n *\n * if axis = 0:\n * C: shape(4, 1, 3) = | r1, g1, b1 |\n * | r2, g2, b2 |\n * | r3, g3, b3 |\n * | r4, g4, b4 |\n *\n * if axis = 1:\n * C: shape(2, 2, 3) = | r1, g1, b1, r3, g3, b3 |\n * | r2, g2, b2, r4, g4, b4 |\n *\n * if axis = 2:\n * C = shape(2, 1, 6) = | r1, g1, b1, r3, g3, b3 |\n * | r2, g2, b2, r4, g4, b4 |\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @param axis The axis to concate along.\n * @return The concatenated array.\n */\nfunction concat3d_(tensors: Tensor3D[]|TensorLike[], axis: number): Tensor3D {\n return concat(tensors, axis);\n}\n\n/**\n * Concatenates a list of `Tensor4D`s along an axis. See `concat` for details.\n *\n * @param tensors A list of `Tensor`s to concatenate.\n * @param axis The axis to concate along.\n * @return The concatenated array.\n */\nfunction concat4d_(tensors: Tensor4D[]|TensorLike[], axis: number): Tensor4D {\n return concat(tensors, axis);\n}\n\n/**\n * Concatenates a list of `Tensor`s along a given axis.\n *\n * The tensors ranks and types must match, and their sizes must match in all\n * dimensions except `axis`.\n *\n * Also available are stricter rank-specific methods that assert that\n * `tensors` are of the given rank:\n * - `tf.concat1d`\n * - `tf.concat2d`\n * - `tf.concat3d`\n * - `tf.concat4d`\n *\n * Except `tf.concat1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * a.concat(b).print(); // or a.concat(b)\n * ```\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.concat([a, b, c]).print();\n * ```\n *\n * ```js\n * const a = tf.tensor2d([[1, 2], [10, 20]]);\n * const b = tf.tensor2d([[3, 4], [30, 40]]);\n * const axis = 1;\n * tf.concat([a, b], axis).print();\n * ```\n * @param tensors A list of tensors to concatenate.\n * @param axis The axis to concate along. Defaults to 0 (the first dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction concat_(tensors: T[]|TensorLike[], axis = 0): T {\n assert(tensors.length >= 1, 'Pass at least one tensor to concat');\n const $tensors = convertToTensorArray(tensors, 'tensors', 'concat');\n\n let result = $tensors[0] as T;\n if ($tensors.length === 1) {\n return result;\n }\n const axes = parseAxisParam(axis, result.shape);\n\n for (let i = 1; i < $tensors.length; ++i) {\n result = concat2Tensors(result, $tensors[i], axes[0]) as T;\n }\n return result;\n}\n\nfunction concat2Tensors(a: T, b: T, axis: number): T {\n concat_util.assertParams(a.shape, b.shape, axis);\n const outShape = concat_util.computeOutShape(a.shape, b.shape, axis);\n\n // Do the reshape.\n const a2D = a.as2D(-1, sizeFromShape(a.shape.slice(axis)));\n const b2D = b.as2D(-1, sizeFromShape(b.shape.slice(axis)));\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n const {aBegin, aSize, bBegin, bSize} =\n concat_util.computeGradientSliceShapes(a2D.shape, b2D.shape);\n const der = (dy: Tensor2D) => {\n return {a: () => dy.slice(aBegin, aSize), b: () => dy.slice(bBegin, bSize)};\n };\n const res = ENV.engine.runKernel(\n backend => backend.concat(a2D, b2D), {a: a2D, b: b2D}, der);\n return res.reshape(outShape) as T;\n}\n\nexport const concat = op({concat_});\nexport const concat1d = op({concat1d_});\nexport const concat2d = op({concat2d_});\nexport const concat3d = op({concat3d_});\nexport const concat4d = op({concat4d_});\n","// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as seedrandom from 'seedrandom';\n\nexport interface RandGauss {\n nextValue(): number;\n}\n\nexport interface RandNormalDataTypes {\n float32: Float32Array;\n int32: Int32Array;\n}\n\n// https://en.wikipedia.org/wiki/Marsaglia_polar_method\nexport class MPRandGauss implements RandGauss {\n private mean: number;\n private stdDev: number;\n private nextVal: number;\n private dtype?: keyof RandNormalDataTypes;\n private truncated?: boolean;\n private upper?: number;\n private lower?: number;\n private random: seedrandom.prng;\n\n constructor(\n mean: number, stdDeviation: number, dtype?: keyof RandNormalDataTypes,\n truncated?: boolean, seed?: number) {\n this.mean = mean;\n this.stdDev = stdDeviation;\n this.dtype = dtype;\n this.nextVal = NaN;\n this.truncated = truncated;\n if (this.truncated) {\n this.upper = this.mean + this.stdDev * 2;\n this.lower = this.mean - this.stdDev * 2;\n }\n const seedValue = seed ? seed : Math.random();\n this.random = seedrandom.alea(seedValue.toString());\n }\n\n /** Returns next sample from a gaussian distribution. */\n public nextValue(): number {\n if (!isNaN(this.nextVal)) {\n const value = this.nextVal;\n this.nextVal = NaN;\n return value;\n }\n\n let resultX: number, resultY: number;\n let isValid = false;\n while (!isValid) {\n let v1: number, v2: number, s: number;\n do {\n v1 = 2 * this.random() - 1;\n v2 = 2 * this.random() - 1;\n s = v1 * v1 + v2 * v2;\n } while (s >= 1 || s === 0);\n\n const mul = Math.sqrt(-2.0 * Math.log(s) / s);\n resultX = this.mean + this.stdDev * v1 * mul;\n resultY = this.mean + this.stdDev * v2 * mul;\n\n if (!this.truncated || this.isValidTruncated(resultX)) {\n isValid = true;\n }\n }\n\n if (!this.truncated || this.isValidTruncated(resultY)) {\n this.nextVal = this.convertValue(resultY);\n }\n return this.convertValue(resultX);\n }\n\n /** Handles proper rounding for non floating point numbers. */\n private convertValue(value: number): number {\n if (this.dtype == null || this.dtype === 'float32') {\n return value;\n }\n return Math.round(value);\n }\n\n /** Returns true if less than 2-standard-deviations from the mean. */\n private isValidTruncated(value: number): boolean {\n return value <= this.upper && value >= this.lower;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorBuffer} from '../tensor';\nimport {convertToTensor, convertToTensorArray} from '../tensor_util_env';\nimport {DataType, Rank, ShapeMap, TensorLike, TensorLike1D, TypedArray} from '../types';\nimport * as util from '../util';\nimport {getAxesPermutation, getInnerMostAxes, parseAxisParam} from './axis_util';\nimport {concat} from './concat';\nimport {op} from './operation';\nimport {MPRandGauss} from './rand';\nimport {zerosLike} from './tensor_ops';\n\n/**\n * Creates a new tensor with the same values and shape as the specified\n * tensor.\n *\n * ```js\n * const x = tf.tensor([1, 2]);\n *\n * x.clone().print();\n * ```\n *\n * @param x The tensor to clone.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction clone_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'clone');\n const der = (dy: T) => {\n return {$x: () => dy.toFloat()};\n };\n\n return ENV.engine.runKernel(\n backend =>\n Tensor.make($x.shape, {dataId: $x.dataId}, $x.dtype) as T,\n {$x}, der) as T;\n}\n\n/**\n * Create an identity matrix.\n *\n * @param numRows Number of rows.\n * @param numColumns Number of columns. Defaults to `numRows`.\n * @param batchShape If provided, will add the batch shape to the beginning\n * of the shape of the returned `Tensor` by repeating the identity\n * matrix.\n * @param dtype Data type.\n * @returns Identity matrix of the specified size and data type, possibly\n * with batch repetition if `batchShape` is specified.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction eye_(\n numRows: number, numColumns?: number,\n batchShape?:\n [\n number\n ]|[number,\n number]|[number, number, number]|[number, number, number, number],\n dtype: DataType = 'float32'): Tensor2D {\n if (numColumns == null) {\n numColumns = numRows;\n }\n const buff = buffer([numRows, numColumns], dtype);\n const n = numRows <= numColumns ? numRows : numColumns;\n for (let i = 0; i < n; ++i) {\n buff.set(1, i, i);\n }\n const out = buff.toTensor().as2D(numRows, numColumns);\n if (batchShape == null) {\n return out;\n } else {\n if (batchShape.length === 1) {\n return tile(expandDims(out, 0), [batchShape[0], 1, 1]);\n } else if (batchShape.length === 2) {\n return tile(\n expandDims(expandDims(out, 0), 0),\n [batchShape[0], batchShape[1], 1, 1]);\n } else if (batchShape.length === 3) {\n return tile(\n expandDims(expandDims(expandDims(out, 0), 0), 0),\n [batchShape[0], batchShape[1], batchShape[2], 1, 1]);\n } else {\n throw new Error(\n `eye() currently supports only 1D and 2D ` +\n // tslint:disable-next-line:no-any\n `batchShapes, but received ${(batchShape as any).length}D.`);\n }\n }\n}\n\n/**\n * Creates a `Tensor` with values sampled from a normal distribution.\n *\n * ```js\n * tf.randomNormal([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param mean The mean of the normal distribution.\n * @param stdDev The standard deviation of the normal distribution.\n * @param dtype The data type of the output.\n * @param seed The seed for the random number generator.\n */\n/** @doc {heading: 'Tensors', subheading: 'Random'} */\nfunction randomNormal_(\n shape: ShapeMap[R], mean = 0, stdDev = 1, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n if (dtype != null && (dtype as DataType) === 'bool') {\n throw new Error(`Unsupported data type ${dtype}`);\n }\n const randGauss =\n new MPRandGauss(mean, stdDev, dtype, false /* truncated */, seed);\n const res = buffer(shape, dtype);\n for (let i = 0; i < res.values.length; i++) {\n res.values[i] = randGauss.nextValue();\n }\n return res.toTensor();\n}\n\n/**\n * Creates a `Tensor` with values sampled from a truncated normal\n * distribution.\n *\n * ```js\n * tf.truncatedNormal([2, 2]).print();\n * ```\n *\n * The generated values follow a normal distribution with specified mean and\n * standard deviation, except that values whose magnitude is more than 2\n * standard deviations from the mean are dropped and re-picked.\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param mean The mean of the normal distribution.\n * @param stdDev The standard deviation of the normal distribution.\n * @param dtype The data type of the output tensor.\n * @param seed The seed for the random number generator.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction truncatedNormal_(\n shape: ShapeMap[R], mean = 0, stdDev = 1, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n if (dtype != null && (dtype as DataType) === 'bool') {\n throw new Error(`Unsupported data type ${dtype}`);\n }\n const randGauss =\n new MPRandGauss(mean, stdDev, dtype, true /* truncated */, seed);\n const res = buffer(shape, dtype);\n for (let i = 0; i < res.values.length; i++) {\n res.values[i] = randGauss.nextValue();\n }\n return res.toTensor();\n}\n\n/**\n * Creates a `Tensor` with values sampled from a uniform distribution.\n *\n * The generated values follow a uniform distribution in the range [minval,\n * maxval). The lower bound minval is included in the range, while the upper\n * bound maxval is excluded.\n *\n * ```js\n * tf.randomUniform([2, 2]).print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param minval The lower bound on the range of random values to generate.\n * Defaults to 0.\n * @param maxval The upper bound on the range of random values to generate.\n * Defaults to 1.\n * @param dtype The data type of the output tensor. Defaults to 'float32'.\n */\n/** @doc {heading: 'Tensors', subheading: 'Random'} */\nfunction randomUniform_(\n shape: ShapeMap[R], minval = 0, maxval = 1,\n dtype: DataType = 'float32'): Tensor {\n const res = buffer(shape, dtype);\n for (let i = 0; i < res.values.length; i++) {\n res.values[i] = util.randUniform(minval, maxval);\n }\n return res.toTensor();\n}\n\n/**\n * Creates a `Tensor` with values sampled from a random number generator\n * function defined by the user.\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param randFunction A random number generator function which is called\n * for each element in the output tensor.\n * @param dtype The data type of the output tensor. Defaults to 'float32'.\n */\nfunction rand_(\n shape: ShapeMap[R], randFunction: () => number,\n dtype?: DataType): Tensor {\n const size = util.sizeFromShape(shape);\n\n let values = null;\n if (dtype == null || dtype === 'float32') {\n values = new Float32Array(size);\n } else if (dtype === 'int32') {\n values = new Int32Array(size);\n } else if (dtype === 'bool') {\n values = new Uint8Array(size);\n } else {\n throw new Error(`Unknown data type ${dtype}`);\n }\n\n for (let i = 0; i < size; i++) {\n values[i] = randFunction();\n }\n return Tensor.make(shape, {values}, dtype);\n}\n\n/**\n * Creates a `Tensor` with values drawn from a multinomial distribution.\n *\n * ```js\n * const probs = tf.tensor([.75, .25]);\n * tf.multinomial(probs, 3).print();\n * ```\n *\n * @param logits 1D array with unnormalized log-probabilities, or\n * 2D array of shape `[batchSize, numOutcomes]`. See the `normalized`\n * parameter.\n * @param numSamples Number of samples to draw for each row slice.\n * @param seed The seed number.\n * @param normalized Whether the provided `logits` are normalized true\n * probabilities (sum to 1). Defaults to false.\n * @return 1D array of shape `[numSamples]`, or 2D array of shape\n * `[batchSize, numSamples]`, depending on the rank of the input.\n */\n/** @doc {heading: 'Tensors', subheading: 'Random'} */\nfunction multinomial_(\n logits: Tensor1D|Tensor2D|TensorLike, numSamples: number, seed?: number,\n normalized = false): Tensor1D|Tensor2D {\n const $logits = convertToTensor(logits, 'logits', 'multinomial');\n const numOutcomes = $logits.size;\n const origRank = $logits.rank;\n if (numOutcomes < 2) {\n throw new Error(\n `Error in multinomial: you need at least 2 outcomes, but got ` +\n `${numOutcomes}.`);\n }\n if (origRank > 2) {\n throw new Error(`Rank of probabilities must be 1 or 2, but is ${origRank}`);\n }\n seed = seed || Math.random();\n const logits2D = origRank === 1 ? $logits.as2D(1, -1) : $logits as Tensor2D;\n const res = ENV.engine.runKernel(\n backend => backend.multinomial(logits2D, normalized, numSamples, seed),\n {logits2D});\n\n return origRank === 1 ? res.as1D() : res;\n}\n\n/**\n * Creates a one-hot `Tensor`. The locations represented by `indices` take\n * value `onValue` (defaults to 1), while all other locations take value\n * `offValue` (defaults to 0).\n *\n * ```js\n * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();\n * ```\n *\n * @param indices `Tensor1D` of indices with dtype `int32`.\n * @param depth The depth of the one hot dimension.\n * @param onValue A number used to fill in output when the index matches\n * the location.\n * @param offValue A number used to fill in the output when the index does\n * not match the location.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction oneHot_(\n indices: Tensor1D|TensorLike1D, depth: number, onValue = 1,\n offValue = 0): Tensor2D {\n const $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32');\n util.assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`');\n\n if (depth < 2) {\n throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);\n }\n return ENV.engine.runKernel(\n backend => backend.oneHot($indices, depth, onValue, offValue),\n {$indices});\n}\n\n/**\n * Creates a `Tensor` from an image.\n *\n * ```js\n * const image = new ImageData(1, 1);\n * image.data[0] = 100;\n * image.data[1] = 150;\n * image.data[2] = 200;\n * image.data[3] = 255;\n *\n * tf.fromPixels(image).print();\n * ```\n *\n * @param pixels The input image to construct the tensor from. The\n * supported image types are all 4-channel.\n * @param numChannels The number of channels of the output tensor. A\n * numChannels value less than 4 allows you to ignore channels. Defaults to\n * 3 (ignores alpha channel of input image).\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction fromPixels_(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels = 3): Tensor3D {\n if (numChannels > 4) {\n throw new Error(\n 'Cannot construct Tensor with more than 4 channels from pixels.');\n }\n return ENV.engine.fromPixels(pixels, numChannels);\n}\n\n/**\n * Draws a `Tensor` of pixel values to a byte array or optionally a\n * canvas.\n *\n * When the dtype of the input is 'float32', we assume values in the range\n * [0-1]. Otherwise, when input is 'int32', we assume values in the range\n * [0-255].\n *\n * Returns a promise that resolves when the canvas has been drawn to.\n *\n * @param img A rank-2 or rank-3 tensor. If rank-2, draws grayscale. If\n * rank-3, must have depth of 1, 3 or 4. When depth of 1, draws\n * grayscale. When depth of 3, we draw with the first three components of\n * the depth dimension corresponding to r, g, b and alpha = 1. When depth of\n * 4, all four components of the depth dimension correspond to r, g, b, a.\n * @param canvas The canvas to draw to.\n */\n/** @doc {heading: 'Visualization'} */\nasync function toPixels(\n img: Tensor2D|Tensor3D|TensorLike,\n canvas?: HTMLCanvasElement): Promise {\n const $img = convertToTensor(img, 'img', 'toPixels', 'int32');\n if ($img.rank !== 2 && $img.rank !== 3) {\n throw new Error(\n `toPixels only supports rank 2 or 3 tensors, got rank ${$img.rank}.`);\n }\n const [height, width] = $img.shape.slice(0, 2);\n const depth = $img.rank === 2 ? 1 : $img.shape[2];\n\n if (depth > 4 || depth === 2) {\n throw new Error(\n `toPixels only supports depth of size ` +\n `1, 3 or 4 but got ${depth}`);\n }\n\n const minTensor = $img.min();\n const maxTensor = $img.max();\n const min = (await minTensor.data())[0];\n const max = (await maxTensor.data())[0];\n minTensor.dispose();\n maxTensor.dispose();\n if ($img.dtype === 'float32') {\n if (min < 0 || max > 1) {\n throw new Error(\n `Tensor values for a float32 Tensor must be in the ` +\n `range [0 - 1] but got range [${min} - ${max}].`);\n }\n } else if ($img.dtype === 'int32') {\n if (min < 0 || max > 255) {\n throw new Error(\n `Tensor values for a int32 Tensor must be in the ` +\n `range [0 - 255] but got range [${min} - ${max}].`);\n }\n } else {\n throw new Error(\n `Unsupported type for toPixels: ${$img.dtype}.` +\n ` Please use float32 or int32 tensors.`);\n }\n\n const data = await $img.data();\n const multiplier = $img.dtype === 'float32' ? 255 : 1;\n const bytes = new Uint8ClampedArray(width * height * 4);\n\n for (let i = 0; i < height * width; ++i) {\n let r, g, b, a;\n if (depth === 1) {\n r = data[i] * multiplier;\n g = data[i] * multiplier;\n b = data[i] * multiplier;\n a = 255;\n } else if (depth === 3) {\n r = data[i * 3] * multiplier;\n g = data[i * 3 + 1] * multiplier;\n b = data[i * 3 + 2] * multiplier;\n a = 255;\n } else if (depth === 4) {\n r = data[i * 4] * multiplier;\n g = data[i * 4 + 1] * multiplier;\n b = data[i * 4 + 2] * multiplier;\n a = data[i * 4 + 3] * multiplier;\n }\n\n const j = i * 4;\n bytes[j + 0] = Math.round(r);\n bytes[j + 1] = Math.round(g);\n bytes[j + 2] = Math.round(b);\n bytes[j + 3] = Math.round(a);\n }\n\n if (canvas != null) {\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d');\n const imageData = new ImageData(bytes, width, height);\n ctx.putImageData(imageData, 0, 0);\n }\n if ($img !== img) {\n $img.dispose();\n }\n return bytes;\n}\n\n/**\n * Reshapes a `Tensor` to a given shape.\n *\n * Given a input tensor, returns a new tensor with the same values as the\n * input tensor with shape `shape`.\n *\n * If one component of shape is the special value -1, the size of that\n * dimension is computed so that the total size remains constant. In\n * particular, a shape of [-1] flattens into 1-D. At most one component of\n * shape can be -1.\n *\n * If shape is 1-D or higher, then the operation returns a tensor with shape\n * shape filled with the values of tensor. In this case, the number of\n * elements implied by shape must be the same as the number of elements in\n * tensor.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.reshape([2, 2]).print();\n * ```\n *\n * @param x The input tensor to be reshaped.\n * @param shape An array of integers defining the output tensor shape.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction reshape_(\n x: Tensor|TensorLike, shape: ShapeMap[R2]): Tensor {\n const $x = convertToTensor(x, 'x', 'reshape');\n shape = util.inferFromImplicitShape(shape, $x.size);\n util.assert(\n $x.size === util.sizeFromShape(shape),\n 'new shape and old shape must have the same number of elements.');\n\n const grad = (dy: Tensor) => {\n return {$x: () => dy.reshape($x.shape)};\n };\n return ENV.engine.runKernel(\n backend => backend.reshape($x, shape), {$x}, grad);\n}\n\n/**\n * Removes dimensions of size 1 from the shape of a `Tensor`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);\n * x.squeeze().print();\n * ```\n *\n * @param x The input tensor to be squeezed.\n * @param axis An optional list of numbers. If specified, only\n * squeezes the dimensions listed. The dimension index starts at 0. It\n * is an error to squeeze a dimension that is not 1.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction squeeze_(x: Tensor|TensorLike, axis?: number[]): T {\n const $x = convertToTensor(x, 'x', 'squeeze');\n return reshape($x, util.squeezeShape($x.shape, axis).newShape) as T;\n}\n\n/**\n * Casts a `Tensor` to a new dtype.\n *\n * ```js\n * const x = tf.tensor1d([1.5, 2.5, 3]);\n * tf.cast(x, 'int32').print();\n * ```\n * @param x The input tensor to be casted.\n * @param dtype The dtype to cast the input tensor to.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction cast_(x: T|TensorLike, dtype: DataType): T {\n const $x = convertToTensor(x, 'x', 'cast');\n\n const grad = (dy: T) => {\n return {$x: () => dy.clone()};\n };\n return ENV.engine.runKernel(backend => backend.cast($x, dtype), {$x}, grad) as\n T;\n}\n\n/**\n * Construct an tensor by repeating it the number of times given by reps.\n *\n * This operation creates a new tensor by replicating `input` `reps`\n * times. The output tensor's i'th dimension has `input.shape[i] *\n * reps[i]` elements, and the values of `input` are replicated\n * `reps[i]` times along the i'th dimension. For example, tiling\n * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n *\n * a.tile([2]).print(); // or a.tile([2])\n * ```\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.tile([1, 2]).print(); // or a.tile([1, 2])\n * ```\n * @param x The tensor to tile.\n * @param reps Determines the number of replications per dimension.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction tile_(x: T|TensorLike, reps: number[]): T {\n const $x = convertToTensor(x, 'x', 'tile');\n\n util.assert(\n $x.rank === reps.length,\n `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of reps ${reps}.`);\n const grad = (dy: T) => {\n const derX = () => {\n let xGrad = zerosLike($x);\n // TODO(cais): Maybe reduce memory footprint by avoiding repeated\n // slicing.\n if ($x.rank === 1) {\n for (let i = 0; i < reps[0]; ++i) {\n xGrad = xGrad.add(dy.slice([i * $x.shape[0]], [$x.shape[0]]));\n }\n } else if ($x.rank === 2) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n xGrad = xGrad.add(dy.slice(\n [i * $x.shape[0], j * $x.shape[1]],\n [$x.shape[0], $x.shape[1]]));\n }\n }\n } else if ($x.rank === 3) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n xGrad = xGrad.add(dy.slice(\n [i * $x.shape[0], j * $x.shape[1], k * $x.shape[2]],\n [$x.shape[0], $x.shape[1], $x.shape[2]]));\n }\n }\n }\n } else if ($x.rank === 4) {\n for (let i = 0; i < reps[0]; ++i) {\n for (let j = 0; j < reps[1]; ++j) {\n for (let k = 0; k < reps[2]; ++k) {\n for (let l = 0; l < reps[3]; ++l) {\n xGrad = xGrad.add(dy.slice(\n [\n i * $x.shape[0], j * $x.shape[1], k * $x.shape[2],\n l * $x.shape[3]\n ],\n [$x.shape[0], $x.shape[1], $x.shape[2], $x.shape[3]]));\n }\n }\n }\n }\n } else {\n throw new Error(\n `Gradient for tile operation is not implemented for rank-` +\n `${$x.rank} tensors yet.`);\n }\n return xGrad;\n };\n return {$x: derX};\n };\n return ENV.engine.runKernel(backend => backend.tile($x, reps), {$x}, grad);\n}\n\n/**\n * Pads a `Tensor1D` with a given value and paddings. See `pad` for details.\n */\nfunction pad1d_(\n x: Tensor1D|TensorLike, paddings: [number, number],\n constantValue = 0): Tensor1D {\n util.assert(\n paddings.length === 2,\n 'Invalid number of paddings. Must be length of 2.');\n return pad(x, [paddings], constantValue);\n}\n\n/**\n * Pads a `Tensor2D` with a given value and paddings. See `pad` for details.\n */\nfunction pad2d_(\n x: Tensor2D|TensorLike, paddings: [[number, number], [number, number]],\n constantValue = 0): Tensor2D {\n util.assert(\n paddings.length === 2 && paddings[0].length === 2 &&\n paddings[1].length === 2,\n 'Invalid number of paddings. Must be length of 2 each.');\n return pad(x, paddings, constantValue);\n}\n\n/**\n * Pads a `Tensor3D` with a given value and paddings. See `pad` for details.\n */\nfunction pad3d_(\n x: Tensor3D|TensorLike,\n paddings: [[number, number], [number, number], [number, number]],\n constantValue = 0): Tensor3D {\n util.assert(\n paddings.length === 3 && paddings[0].length === 2 &&\n paddings[1].length === 2 && paddings[2].length === 2,\n 'Invalid number of paddings. Must be length of 2 each.');\n return pad(x, paddings, constantValue);\n}\n\n/**\n * Pads a `Tensor4D` with a given value and paddings. See `pad` for details.\n */\nfunction pad4d_(\n x: Tensor4D|TensorLike,\n paddings:\n [\n [number, number], [number, number], [number, number],\n [number, number]\n ],\n constantValue = 0): Tensor4D {\n util.assert(\n paddings.length === 4 && paddings[0].length === 2 &&\n paddings[1].length === 2 && paddings[2].length === 2 &&\n paddings[3].length === 2,\n 'Invalid number of paddings. Must be length of 2 each.');\n return pad(x, paddings, constantValue);\n}\n\n/**\n * Pads a `Tensor` with a given value and paddings.\n *\n * This operation currently only implements the `CONSTANT` mode.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `paddings` is of given length.\n * - `tf.pad1d`\n * - `tf.pad2d`\n * - `tf.pad3d`\n * - `tf.pad4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * x.pad([[1, 2]]).print();\n * ```\n * @param x The tensor to pad.\n * @param paddings An array of length `R` (the rank of the tensor), where\n * each element is a length-2 tuple of ints `[padBefore, padAfter]`,\n * specifying how much to pad along each dimension of the tensor.\n * @param constantValue The pad value to use. Defaults to 0.\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction pad_(\n x: T|TensorLike, paddings: Array<[number, number]>, constantValue = 0): T {\n const $x = convertToTensor(x, 'x', 'pad');\n\n if ($x.rank === 0) {\n throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');\n }\n // Pad introduces values around the original tensor, so the gradient\n // slices the original shape out of the gradient.\n const begin = paddings.map(p => p[0]);\n const grad = (dy: T) => {\n return {$x: () => dy.slice(begin, $x.shape)};\n };\n return ENV.engine.runKernel(\n backend => backend.pad($x, paddings, constantValue), {$x}, grad) as\n T;\n}\n\n/**\n * Stacks a list of rank-`R` `Tensor`s into one rank-`(R+1)` `Tensor`.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n * tf.stack([a, b, c]).print();\n * ```\n *\n * @param tensors A list of tensor objects with the same shape and dtype.\n * @param axis The axis to stack along. Defaults to 0 (the first dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction stack_(tensors: T[]|TensorLike[], axis = 0): Tensor {\n const $tensors = convertToTensorArray(tensors, 'tensors', 'stack');\n\n util.assert($tensors.length >= 1, 'Pass at least one tensor to tf.stack');\n if ($tensors.length === 1) {\n return $tensors[0].expandDims(axis);\n }\n const rank = $tensors[0].rank;\n const shape = $tensors[0].shape;\n const dtype = $tensors[0].dtype;\n\n util.assert(axis <= rank, 'Axis must be <= rank of the tensor');\n\n $tensors.forEach(t => {\n util.assertShapesMatch(\n shape, t.shape,\n 'All tensors passed to stack must have matching shapes');\n });\n\n $tensors.forEach(t => {\n util.assert(\n dtype === t.dtype,\n 'All tensors passed to stack must have matching dtypes');\n });\n const expandedTensors = $tensors.map(t => t.expandDims(axis));\n return concat(expandedTensors, axis);\n}\n\n/**\n * This operation reshapes the \"batch\" dimension 0 into `M + 1` dimensions of\n * shape `blockShape + [batch]`, interleaves these blocks back into the grid\n * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with\n * the same rank as the input. The spatial dimensions of this intermediate\n * result are then optionally cropped according to `crops` to produce the\n * output. This is the reverse of `spaceToBatchND`. See below for a precise\n * description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const crops = [[0, 0], [0, 0]];\n *\n * x.batchToSpaceND(blockShape, crops).print();\n * ```\n *\n * @param x A `Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M]`, all values must be >= 1.\n * @param crops A 2-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M, 2]`, all values must be >= 0. `crops[i] =\n * [cropStart, cropEnd]` specifies the amount to crop from input dimension `i\n * + 1`, which corresponds to spatial dimension `i`. It is required that\n * `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ...,\n * blockShape[M-1], batch / prod(blockShape), x.shape[1], ...,\n * x.shape[N-1]]`\n *\n * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch /\n * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M],\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] *\n * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]`\n *\n * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted`\n * according to `crops` to produce the output of shape: `[batch /\n * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1],\n * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] -\n * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]`\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction batchToSpaceND_(\n x: T|TensorLike, blockShape: number[], crops: number[][]): T {\n const $x = convertToTensor(x, 'x', 'batchToSpaceND');\n const prod = blockShape.reduce((a, b) => a * b);\n\n util.assert(\n $x.rank >= 1 + blockShape.length,\n `input rank should be > than [blockShape] but got ${$x.rank}`);\n\n util.assert(\n crops.length === blockShape.length,\n `crops.shape[0] must be equal to [blockShape] but got ${crops.length}`);\n\n util.assert(\n $x.shape[0] % prod === 0,\n `input tensor batch must be divisible by prod( blockShape )`);\n return ENV.engine.runKernel(\n backend => backend.batchToSpaceND($x, blockShape, crops), {});\n}\n\n/**\n * This operation divides \"spatial\" dimensions [1, ..., M] of the input into\n * a grid of blocks of shape block_shape, and interleaves these blocks with\n * the \"batch\" dimension (0) such that in the output, the spatial\n * dimensions [1, ..., M] correspond to the position within the grid,\n * and the batch dimension combines both the position within a spatial block\n * and the original batch position. Prior to division into blocks,\n * the spatial dimensions of the input are optionally zero padded\n * according to paddings. See below for a precise description.\n *\n * ```js\n * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]);\n * const blockShape = [2, 2];\n * const paddings = [[0, 0], [0, 0]];\n *\n * x.spaceToBatchND(blockShape, paddings).print();\n * ```\n *\n * @param x A `Tensor`. N-D with `x.shape` = `[batch] + spatialShape +\n * remainingShape`, where spatialShape has `M` dimensions.\n * @param blockShape A 1-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M]`, all values must be >= 1.\n * @param paddings A 2-D array. Must be one of the following types: `int32`,\n * `int64`. Must have shape `[M, 2]`, all values must be >= 0. `paddings[i] =\n * [padStart, padEnd]` specifies the amount to zero-pad from input dimension\n * `i + 1`, which corresponds to spatial dimension `i`.\n * It is required that\n * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`\n *\n * This operation is equivalent to the following steps:\n *\n * 1. Zero-pad the start and end of dimensions [1, ..., M] of the input\n * according to paddings to produce padded of shape padded_shape.\n *\n * 2. Reshape padded to reshaped_padded of shape:\n * [batch] + [padded_shape[1] / block_shape[0], block_shape[0], ...,\n * padded_shape[M] / block_shape[M-1], block_shape[M-1]] + remaining_shape\n *\n * 3. Permute dimensions of reshaped_padded to produce permuted_\n * reshaped_padded of shape:\n * block_shape + [batch] + [padded_shape[1] / block_shape[0], ...,\n * padded_shape[M] / block_shape[M-1]] + remaining_shape\n *\n * 4. Reshape permuted_reshaped_padded to flatten block_shape into the\n * batch dimension, producing an output tensor of shape:\n * [batch * prod(block_shape)] + [padded_shape[1] / block_shape[0], ...,\n * padded_shape[M] / block_shape[M-1]] + remaining_shape\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction spaceToBatchND_(\n x: T|TensorLike, blockShape: number[], paddings: number[][]): T {\n const $x = convertToTensor(x, 'x', 'spaceToBatchND');\n\n util.assert(\n $x.rank >= 1 + blockShape.length,\n `input rank should be > than [blockShape] but got ${$x.rank}`);\n\n util.assert(\n paddings.length === blockShape.length,\n `paddings.shape[0] must be equal to [blockShape], got ${\n paddings.length}`);\n\n util.assert($x.shape.reduce((a, b, i) => {\n if (i > 0 && i <= blockShape.length) {\n return a && (b % blockShape[i - 1] === 0);\n }\n return a;\n }, true), `input spatial dimensions must be divisible by blockShapes`);\n return ENV.engine.runKernel(\n backend => backend.spaceToBatchND($x, blockShape, paddings), {});\n}\n\n/**\n * Unstacks a `Tensor` of rank-`R` into a list of rank-`(R-1)` `Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * tf.unstack(a).forEach(tensor => tensor.print());\n * ```\n *\n * @param x A tensor object.\n * @param axis The axis to unstack along. Defaults to 0 (the first dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction unstack_(x: T|TensorLike, axis = 0): Tensor[] {\n const $x = convertToTensor(x, 'x', 'unstack');\n const num = $x.shape[axis];\n const outputShape: number[] = Array($x.rank - 1).fill(0);\n let outIndex = 0;\n for (let i = 0; i < $x.rank; i++) {\n if (i !== axis) {\n outputShape[outIndex] = $x.shape[i];\n outIndex++;\n }\n }\n\n let splitSizes: number[];\n splitSizes = Array(num).fill(1);\n const begin = Array($x.rank).fill(0);\n const size = $x.shape.slice();\n return splitSizes.map(s => {\n size[axis] = s;\n const slice = $x.slice(begin, size);\n begin[axis] += s;\n return slice.reshape(outputShape);\n });\n}\n\n/**\n * Splits a `Tensor` into sub tensors.\n *\n * If `numOrSizeSplits` is a number, splits `x` along dimension `axis`\n * into `numOrSizeSplits` smaller tensors.\n * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`.\n *\n * If `numOrSizeSplits` is a number array, splits `x` into\n * `(numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the\n * same size as `x` except along dimension `axis` where the size is\n * `numOrSizeSplits[i]`.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]);\n * const [a, b] = tf.split(x, 2, 1);\n * a.print();\n * b.print();\n *\n * const [c, d, e] = tf.split(x, [1, 2, 1], 1);\n * c.print();\n * d.print();\n * e.print();\n * ```\n *\n * @param x The input tensor to split.\n * @param numOrSizeSplits Either an integer indicating the number of\n * splits along the axis or an array of integers containing the sizes of\n * each output tensor along the axis. If a number then it must evenly divide\n * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`.\n * @param axis The dimension along which to split. Defaults to 0 (the first\n * dim).\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction split_(\n x: T|TensorLike, numOrSizeSplits: number[]|number, axis = 0): T[] {\n const $x = convertToTensor(x, 'x', 'split');\n\n axis = parseAxisParam(axis, $x.shape)[0];\n let splitSizes: number[];\n if (typeof (numOrSizeSplits) === 'number') {\n util.assert(\n $x.shape[axis] % numOrSizeSplits === 0,\n 'Number of splits must evenly divide the axis.');\n splitSizes = Array(numOrSizeSplits).fill($x.shape[axis] / numOrSizeSplits);\n } else {\n util.assert(\n $x.shape[axis] === numOrSizeSplits.reduce((a, b) => a + b),\n 'The sum of sizes must match the size of the axis dimension.');\n splitSizes = numOrSizeSplits;\n }\n const begin = Array($x.rank).fill(0);\n const size = $x.shape.slice();\n return splitSizes.map(s => {\n size[axis] = s;\n const slice = $x.slice(begin, size);\n begin[axis] += s;\n return slice;\n });\n}\n\n/**\n * Computes the cumulative sum of a `Tensor` along `axis`.\n *\n * ```js\n * const x = tf.tensor([1, 2, 3, 4]);\n * x.cumsum().print();\n * ```\n * ```js\n * const x = tf.tensor([[1, 2], [3, 4]]);\n * x.cumsum().print();\n * ```\n *\n * @param x The input tensor to be summed.\n * @param axis The axis along which to sum. Optional. Defaults to 0.\n * @param exclusive Whether to perform exclusive cumulative sum. Optional.\n * Defaults to false. If set to true then the sum of each tensor entry\n * does not include its own value, but only the values previous to it\n * along the specified axis.\n * @param reverse Whether to sum in the opposite direction. Optional.\n * Defaults to false.\n */\n/** @doc {heading: 'Operations', subheading: 'Scan'} */\nfunction cumsum_(\n x: Tensor|TensorLike, axis = 0, exclusive = false, reverse = false): T {\n const $x = convertToTensor(x, 'x', 'cumsum');\n\n axis = axis | 0;\n const permutation = getAxesPermutation([axis], $x.rank);\n let permutedX = $x;\n if (permutation != null) {\n permutedX = $x.transpose(permutation);\n }\n const permutedAxis = getInnerMostAxes(1, $x.rank)[0];\n\n const grad = (dy: T) => {\n return {permutedX: () => dy.cumsum(axis, exclusive, !reverse)};\n };\n let value = ENV.engine.runKernel(\n backend => backend.cumsum(\n permutedX, permutedAxis, exclusive, reverse),\n {permutedX}, grad) as T;\n\n if (permutation != null) {\n value = value.transpose(permutation);\n }\n return value;\n}\n\n/**\n * Returns a `Tensor` that has expanded rank, by inserting a dimension\n * into the tensor's shape.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const axis = 1;\n * x.expandDims(axis).print();\n * ```\n *\n * @param x The input tensor whose dimensions to be expanded.\n * @param axis The dimension index at which to insert shape of `1`. Defaults\n * to 0 (the first dimension).\n */\n/** @doc {heading: 'Tensors', subheading: 'Transformations'} */\nfunction expandDims_(\n x: Tensor|TensorLike, axis = 0): Tensor {\n const $x = convertToTensor(x, 'x', 'expandDims');\n\n util.assert(axis <= $x.rank, 'Axis must be <= rank of the tensor');\n const newShape = $x.shape.slice();\n if (axis < 0) {\n // Negative value is counted from the tail of rank.\n util.assert(\n -($x.rank + 1) <= axis,\n `Axis must be in the interval [${- ($x.rank + 1)}, ${$x.rank}]`);\n axis = $x.rank + axis + 1;\n }\n newShape.splice(axis, 0, 1);\n return reshape($x, newShape);\n}\n\n/**\n * Creates an empty `TensorBuffer` with the specified `shape` and `dtype`.\n *\n * The values are stored in cpu as `TypedArray`. Fill the buffer using\n * `buffer.set()`, or by modifying directly `buffer.values`.\n *\n * When done, call `buffer.toTensor()` to get an immutable `Tensor` with\n * those values.\n *\n * ```js\n * // Create a buffer and set values at particular indices.\n * const buffer = tf.buffer([2, 2]);\n * buffer.set(3, 0, 0);\n * buffer.set(5, 1, 0);\n *\n * // Convert the buffer back to a tensor.\n * buffer.toTensor().print();\n * ```\n *\n * @param shape An array of integers defining the output tensor shape.\n * @param dtype The dtype of the buffer. Defaults to 'float32'.\n * @param values The values of the buffer as `TypedArray`. Defaults to\n * zeros.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction buffer(\n shape: ShapeMap[R], dtype: DataType = 'float32',\n values?: TypedArray): TensorBuffer {\n return new TensorBuffer(shape, dtype, values);\n}\n\n/**\n * Prints information about the `Tensor` including its data.\n *\n * ```js\n * const verbose = true;\n * tf.tensor2d([1, 2, 3, 4], [2, 2]).print(verbose);\n * ```\n * @param x The tensor to be printed.\n * @param verbose Whether to print verbose information about the ` Tensor`,\n * including dtype and size.\n */\n/** @doc {heading: 'Tensors', subheading: 'Creation'} */\nfunction print(x: T, verbose = false): void {\n console.log(x.toString(verbose));\n}\n\nexport {\n buffer, // Not wrapped in op() since no tensors.\n toPixels, // Not wrapped in op() since async.\n print // Not wrapped in op() since no need to increase stack trace.\n};\n\nexport const cast = op({cast_});\nexport const clone = op({clone_});\nexport const cumsum = op({cumsum_});\nexport const expandDims = op({expandDims_});\nexport const eye = op({eye_});\nexport const fromPixels = op({fromPixels_});\nexport const multinomial = op({multinomial_});\nexport const oneHot = op({oneHot_});\nexport const pad = op({pad_});\nexport const pad1d = op({pad1d_});\nexport const pad2d = op({pad2d_});\nexport const pad3d = op({pad3d_});\nexport const pad4d = op({pad4d_});\nexport const rand = op({rand_});\nexport const randomNormal = op({randomNormal_});\nexport const randomUniform = op({randomUniform_});\nexport const reshape = op({reshape_});\nexport const split = op({split_});\nexport const squeeze = op({squeeze_});\nexport const stack = op({stack_});\nexport const tile = op({tile_});\nexport const truncatedNormal = op({truncatedNormal_});\nexport const unstack = op({unstack_});\nexport const batchToSpaceND = op({batchToSpaceND_});\nexport const spaceToBatchND = op({spaceToBatchND_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/** An implementation of the Where kernel shared between cpu and webgl */\n\nimport {buffer} from '../ops/array_ops';\nimport {Tensor2D} from '../tensor';\nimport {TypedArray} from '../types';\n\nexport function whereImpl(condShape: number[], condVals: TypedArray): Tensor2D {\n const indices = [];\n for (let i = 0; i < condVals.length; i++) {\n if (condVals[i]) {\n indices.push(i);\n }\n }\n\n const inBuffer = buffer(condShape, 'int32');\n\n const out = buffer([indices.length, condShape.length], 'int32');\n for (let i = 0; i < indices.length; i++) {\n const loc = inBuffer.indexToLoc(indices[i]);\n const offset = i * condShape.length;\n out.values.set(loc, offset);\n }\n return out.toTensor() as Tensor2D;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {MemoryInfo, TimingInfo} from '../engine';\nimport {ENV} from '../environment';\nimport {warn} from '../log';\nimport * as array_ops_util from '../ops/array_ops_util';\nimport * as axis_util from '../ops/axis_util';\nimport {Conv2DInfo} from '../ops/conv_util';\nimport * as reduce_util from '../ops/reduce_util';\nimport * as segment_util from '../ops/segment_util';\nimport {getStridedSlicedInfo} from '../ops/slice_util';\nimport {softmax} from '../ops/softmax';\nimport {range, tensor} from '../ops/tensor_ops';\nimport {DataId, setTensorTracker, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {DataType, DataTypeMap, Rank, RecursiveArray, ShapeMap, sumOutType, TypedArray, upcastType} from '../types';\nimport * as util from '../util';\n\nimport {KernelBackend} from './backend';\nimport * as backend_util from './backend_util';\nimport {nonMaxSuppressionImpl} from './non_max_suppression_impl';\nimport {topkImpl} from './topk_impl';\nimport {ArgMinMaxProgram} from './webgl/argminmax_gpu';\nimport {AvgPool2DBackpropProgram} from './webgl/avg_pool_backprop_gpu';\nimport {BatchNormProgram} from './webgl/batchnorm_gpu';\nimport * as binaryop_gpu from './webgl/binaryop_gpu';\nimport {BinaryOpProgram} from './webgl/binaryop_gpu';\nimport {ClipProgram} from './webgl/clip_gpu';\nimport {ConcatProgram} from './webgl/concat_gpu';\nimport {Conv2DDerFilterProgram, Conv2DDerInputProgram} from './webgl/conv_backprop_gpu';\nimport {DepthwiseConv2DDerFilterProgram, DepthwiseConv2DDerInputProgram} from './webgl/conv_backprop_gpu_depthwise';\nimport {Conv2DProgram} from './webgl/conv_gpu';\nimport {DepthwiseConv2DProgram} from './webgl/conv_gpu_depthwise';\nimport {CumSumProgram} from './webgl/cumsum_gpu';\nimport {EncodeFloatProgram} from './webgl/encode_float_gpu';\nimport {FromPixelsProgram} from './webgl/from_pixels_gpu';\nimport {GatherProgram} from './webgl/gather_gpu';\nimport {GPGPUContext} from './webgl/gpgpu_context';\nimport * as gpgpu_math from './webgl/gpgpu_math';\nimport {GPGPUBinary, GPGPUProgram, TensorData} from './webgl/gpgpu_math';\nimport * as gpgpu_util from './webgl/gpgpu_util';\nimport {LRNProgram} from './webgl/lrn_gpu';\nimport {LRNGradProgram} from './webgl/lrn_grad_gpu';\nimport {MaxPool2DBackpropProgram} from './webgl/max_pool_backprop_gpu';\nimport {MatMulProgram} from './webgl/mulmat_gpu';\nimport {MultinomialProgram} from './webgl/multinomial_gpu';\nimport {OneHotProgram} from './webgl/onehot_gpu';\nimport {PadProgram} from './webgl/pad_gpu';\nimport {Pool2DProgram} from './webgl/pool_gpu';\nimport {ReduceProgram} from './webgl/reduce_gpu';\nimport {ResizeBilinearBackpropProgram} from './webgl/resize_bilinear_backprop_gpu';\nimport {ResizeBilinearProgram} from './webgl/resize_bilinear_gpu';\nimport {ResizeNearestNeigborBackpropProgram} from './webgl/resize_nearest_neighbor_backprop_gpu';\nimport {ResizeNearestNeighborProgram} from './webgl/resize_nearest_neighbor_gpu';\nimport {ReverseProgram} from './webgl/reverse_gpu';\nimport {SegmentOpProgram} from './webgl/segment_gpu';\nimport {SelectProgram} from './webgl/select_gpu';\nimport {SliceProgram} from './webgl/slice_gpu';\nimport {StridedSliceProgram} from './webgl/strided_slice_gpu';\nimport {TextureData, TextureUsage} from './webgl/tex_util';\nimport {TextureManager} from './webgl/texture_manager';\nimport {TileProgram} from './webgl/tile_gpu';\nimport {TransposeProgram} from './webgl/transpose_gpu';\nimport * as unary_op from './webgl/unaryop_gpu';\nimport {UnaryOpProgram} from './webgl/unaryop_gpu';\nimport * as webgl_util from './webgl/webgl_util';\nimport {whereImpl} from './where_impl';\n\ntype TimerNode = RecursiveArray>|Promise;\nexport interface CPUTimerQuery {\n startMs: number;\n endMs?: number;\n}\n\nexport interface WebGLMemoryInfo extends MemoryInfo {\n numBytesInGPU: number;\n unreliable: boolean;\n}\n\nexport interface WebGLTimingInfo extends TimingInfo {\n uploadWaitMs: number;\n downloadWaitMs: number;\n}\n\n// Empirically determined constant used to decide the number of bytes on GPU\n// before we start paging. The bytes are this constant * screen area * dpi.\nconst BEFORE_PAGING_CONSTANT = 300;\n// Tensors with size <= than this will be uploaded as uniforms, not textures.\nexport const SIZE_UPLOAD_UNIFORM = 32;\n\nexport class MathBackendWebGL implements KernelBackend {\n private texData = new WeakMap();\n // Maps data ids that have a pending read operation, to list of subscribers.\n private pendingRead = new WeakMap void>>();\n // List of data ids that are scheduled for disposal, but are waiting on a\n // pending read operation.\n private pendingDisposal = new WeakSet();\n // List of data ids that are currently residing on gpu memory. Sorted with\n // least recently used being first.\n private lruDataGPU: DataId[] = [];\n private numBytesInGPU = 0;\n /**\n * Number of bytes allocated on the GPU before we start moving data to cpu.\n * Moving avoids gpu memory leaks and relies on JS's garbage collector.\n */\n private NUM_BYTES_BEFORE_PAGING: number;\n\n private canvas: HTMLCanvasElement;\n private fromPixelsCanvas: HTMLCanvasElement;\n\n private programTimersStack: TimerNode[];\n private activeTimers: TimerNode[];\n // Accumulated time spent (including blocking) in uploading data to webgl.\n private uploadWaitMs = 0;\n // Accumulated time spent (including blocking in downloading data from webgl.\n private downloadWaitMs = 0;\n\n register(dataId: DataId, shape: number[], dtype: DataType): void {\n if (this.texData.has(dataId)) {\n throw new Error('Data buffer is already registered');\n }\n this.texData.set(dataId, {\n shape,\n dtype,\n values: null,\n texture: null,\n texShape: null,\n usage: TextureUsage.RENDER\n });\n }\n fromPixels(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels: number): Tensor3D {\n if (pixels == null) {\n throw new Error('pixels passed to tf.fromPixels() can not be null');\n }\n const texShape: [number, number] = [pixels.height, pixels.width];\n const outShape = [pixels.height, pixels.width, numChannels];\n\n if (!(pixels instanceof HTMLVideoElement) &&\n !(pixels instanceof HTMLImageElement) &&\n !(pixels instanceof HTMLCanvasElement) &&\n !(pixels instanceof ImageData)) {\n throw new Error(\n 'pixels passed to tf.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ` +\n `ImageData, but was ${(pixels as {}).constructor.name}`);\n }\n if (pixels instanceof HTMLVideoElement) {\n if (this.fromPixelsCanvas == null) {\n if (!ENV.get('IS_BROWSER')) {\n throw new Error(\n 'Can\\'t read pixels from HTMLImageElement outside the browser.');\n }\n if (document.readyState !== 'complete') {\n throw new Error(\n 'The DOM is not ready yet. Please call tf.fromPixels() ' +\n 'once the DOM is ready. One way to do that is to add an event ' +\n 'listener for `DOMContentLoaded` on the document object');\n }\n this.fromPixelsCanvas = document.createElement('canvas');\n }\n this.fromPixelsCanvas.width = pixels.width;\n this.fromPixelsCanvas.height = pixels.height;\n this.fromPixelsCanvas.getContext('2d').drawImage(\n pixels, 0, 0, pixels.width, pixels.height);\n pixels = this.fromPixelsCanvas;\n }\n const tempPixelArray = Tensor.make(texShape, {}, 'int32');\n\n // This is a byte texture with pixels.\n this.texData.get(tempPixelArray.dataId).usage = TextureUsage.PIXELS;\n this.gpgpu.uploadPixelDataToTexture(\n this.getTexture(tempPixelArray.dataId), pixels);\n const program = new FromPixelsProgram(outShape);\n const res = this.compileAndRun(program, [tempPixelArray]);\n\n tempPixelArray.dispose();\n\n return res as Tensor3D;\n }\n write(dataId: DataId, values: TypedArray): void {\n if (values == null) {\n throw new Error('MathBackendWebGL.write(): values can not be null');\n }\n this.throwIfNoData(dataId);\n\n const texData = this.texData.get(dataId);\n const {texture, texShape, usage} = texData;\n if (texture != null) {\n // Release the old texture.\n this.releaseTexture(dataId, texture, texShape, usage);\n texData.texture = null;\n texData.texShape = null;\n }\n texData.usage = TextureUsage.UPLOAD;\n texData.values = values;\n\n if (!this.delayedStorage) {\n this.uploadToGPU(dataId);\n }\n }\n readSync(dataId: DataId): TypedArray {\n this.throwIfNoData(dataId);\n const texData = this.texData.get(dataId);\n const {shape, texture, values, texShape, dtype} = texData;\n if (values != null) {\n this.cacheOnCPU(dataId);\n return values;\n }\n const shouldTimeProgram = this.activeTimers != null;\n let start: number;\n if (shouldTimeProgram) {\n start = performance.now();\n }\n\n const float32Values =\n this.getValuesFromTexture(texture, dataId, dtype, texShape, shape);\n\n if (shouldTimeProgram) {\n this.downloadWaitMs += performance.now() - start;\n }\n this.cacheOnCPU(dataId, float32Values);\n return texData.values;\n }\n\n async read(dataId: DataId): Promise {\n if (this.pendingRead.has(dataId)) {\n const subscribers = this.pendingRead.get(dataId);\n return new Promise(resolve => subscribers.push(resolve));\n }\n this.throwIfNoData(dataId);\n const texData = this.texData.get(dataId);\n const {shape, texture, values, texShape, dtype} = texData;\n if (values != null) {\n this.cacheOnCPU(dataId);\n return values;\n }\n\n this.pendingRead.set(dataId, []);\n\n if (!ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED') &&\n ENV.get('WEBGL_VERSION') === 2) {\n throw new Error(\n `tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and ` +\n `WEBGL_VERSION=2 not yet supported.`);\n }\n\n // Possibly copy the texture into a buffer before inserting a fence.\n const bufferOrTexture = this.gpgpu.maybeCreateBufferFromTexture(\n texture, texShape[0], texShape[1]);\n\n // Create a fence and wait for it to resolve.\n await this.gpgpu.createAndWaitForFence();\n\n // Download the values from the GPU.\n let vals: Float32Array;\n if (bufferOrTexture instanceof WebGLTexture) {\n vals = this.getValuesFromTexture(texture, dataId, dtype, texShape, shape);\n } else {\n vals = this.gpgpu.downloadFloat32MatrixFromBuffer(\n bufferOrTexture, texShape[0], texShape[1]);\n }\n this.cacheOnCPU(dataId, vals);\n\n const subscribers = this.pendingRead.get(dataId);\n this.pendingRead.delete(dataId);\n\n // Notify all pending reads.\n subscribers.forEach(resolve => resolve(vals));\n if (this.pendingDisposal.has(dataId)) {\n this.pendingDisposal.delete(dataId);\n this.disposeData(dataId);\n }\n return vals;\n }\n\n private getValuesFromTexture(\n texture: WebGLTexture, dataId: DataId, dtype: DataType,\n texShape: [number, number], shape: number[]): Float32Array {\n if (ENV.get('WEBGL_DOWNLOAD_FLOAT_ENABLED')) {\n return this.gpgpu.downloadFloat32MatrixFromOutputTexture(\n texture, texShape[0], texShape[1]);\n }\n\n const tmpTarget = Tensor.make(shape, {});\n this.texData.get(tmpTarget.dataId).usage = TextureUsage.DOWNLOAD;\n\n const tmpInput = Tensor.make(shape, {dataId}, dtype);\n const program = new EncodeFloatProgram(shape);\n const pageToCpu = false;\n this.compileAndRun(program, [tmpInput], tmpTarget, null, pageToCpu);\n const tmpData = this.texData.get(tmpTarget.dataId);\n const vals = this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(\n tmpData.texture, tmpData.texShape[0], tmpData.texShape[1]);\n\n tmpInput.dispose();\n tmpTarget.dispose();\n\n return vals;\n }\n\n async time(f: () => void): Promise {\n const oldActiveTimers = this.activeTimers;\n const newActiveTimers: TimerNode[] = [];\n\n let outerMostTime = false;\n if (this.programTimersStack == null) {\n this.programTimersStack = newActiveTimers;\n outerMostTime = true;\n } else {\n this.activeTimers.push(newActiveTimers);\n }\n this.activeTimers = newActiveTimers;\n\n f();\n\n const flattenedActiveTimers = util.flatten(this.activeTimers);\n this.activeTimers = oldActiveTimers;\n\n if (outerMostTime) {\n this.programTimersStack = null;\n }\n\n const kernelMs = await Promise.all(flattenedActiveTimers).then(results => {\n let sum = 0;\n results.forEach(result => sum += result);\n return sum;\n });\n const res: WebGLTimingInfo = {\n uploadWaitMs: this.uploadWaitMs,\n downloadWaitMs: this.downloadWaitMs,\n kernelMs,\n wallMs: null // will be filled by the engine\n };\n this.uploadWaitMs = 0;\n this.downloadWaitMs = 0;\n return res;\n }\n memory(): WebGLMemoryInfo {\n return {unreliable: false, numBytesInGPU: this.numBytesInGPU} as\n WebGLMemoryInfo;\n }\n\n private startTimer(): WebGLQuery|CPUTimerQuery {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n return this.gpgpu.beginQuery();\n }\n return {startMs: performance.now(), endMs: null};\n }\n\n private endTimer(query: WebGLQuery|CPUTimerQuery): WebGLQuery|\n {startMs: number, endMs: number} {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n this.gpgpu.endQuery();\n return query;\n }\n (query as CPUTimerQuery).endMs = performance.now();\n return query;\n }\n\n private async getQueryTime(query: WebGLQuery|CPUTimerQuery): Promise {\n if (ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0) {\n return this.gpgpu.waitForQueryAndGetTime(query);\n }\n const timerQuery = query as CPUTimerQuery;\n return timerQuery.endMs - timerQuery.startMs;\n }\n\n disposeData(dataId: DataId): void {\n if (this.pendingDisposal.has(dataId)) {\n return;\n }\n if (this.pendingRead.has(dataId)) {\n this.pendingDisposal.add(dataId);\n return;\n }\n if (this.texData.has(dataId)) {\n const {texture, texShape, usage} = this.texData.get(dataId);\n if (texture != null) {\n this.releaseTexture(dataId, texture, texShape, usage);\n }\n this.texData.delete(dataId);\n }\n }\n\n getTexture(dataId: DataId): WebGLTexture {\n this.uploadToGPU(dataId);\n return this.texData.get(dataId).texture;\n }\n\n private textureManager: TextureManager;\n private binaryCache: {[key: string]: GPGPUBinary} = {};\n private gpgpuCreatedLocally: boolean;\n\n constructor(private gpgpu?: GPGPUContext, private delayedStorage = true) {\n if (ENV.get('WEBGL_VERSION') < 1) {\n throw new Error('WebGL is not supported on this device');\n }\n if (ENV.get('IS_BROWSER')) {\n this.canvas = document.createElement('canvas');\n }\n if (gpgpu == null) {\n this.gpgpu = new GPGPUContext(gpgpu_util.createWebGLContext(this.canvas));\n this.gpgpuCreatedLocally = true;\n } else {\n this.gpgpuCreatedLocally = false;\n }\n // Use the device screen's resolution as a heuristic to decide on the\n // maximum memory allocated on the GPU before starting to page.\n this.NUM_BYTES_BEFORE_PAGING =\n (window.screen.height * window.screen.width * window.devicePixelRatio) *\n BEFORE_PAGING_CONSTANT;\n this.textureManager = new TextureManager(this.gpgpu);\n }\n\n getGPGPUContext(): GPGPUContext {\n return this.gpgpu;\n }\n getCanvas(): HTMLCanvasElement {\n return this.canvas;\n }\n\n slice(x: T, begin: number[], size: number[]): T {\n const program = new SliceProgram(size);\n const customSetup = program.getCustomSetupFunc(begin);\n return this.compileAndRun(program, [x], null, customSetup);\n }\n\n stridedSlice(\n x: T, begin: number[], end: number[], strides: number[],\n beginMask: number, endMask: number): T {\n const [beginIndex, size] =\n getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask);\n\n if (size.some(axis => axis === 0)) {\n return tensor([], size) as T;\n }\n\n const program = new StridedSliceProgram(beginIndex, strides, size);\n return this.compileAndRun(program, [x]);\n }\n\n reverse(x: T, axis: number[]): T {\n const program = new ReverseProgram(x.shape, axis);\n return this.compileAndRun(program, [x]);\n }\n\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n concat(a: Tensor2D, b: Tensor2D): Tensor2D {\n const program = new ConcatProgram(a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n neg(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.NEG);\n return this.compileAndRun(program, [x]) as T;\n }\n\n matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean):\n Tensor2D {\n const program = new MatMulProgram(a.shape, b.shape, transposeA, transposeB);\n return this.compileAndRun(program, [a, b]);\n }\n\n multiply(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MUL, a.shape, b.shape);\n const output =\n this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as Tensor;\n return this.compileAndRun(program, [a, b], output) as Tensor;\n }\n\n batchNormalization(\n x: Tensor4D, mean: Tensor4D|Tensor1D, variance: Tensor4D|Tensor1D,\n varianceEpsilon: number, scale?: Tensor4D|Tensor1D,\n offset?: Tensor4D|Tensor1D): Tensor4D {\n const inputs = [x, mean, variance];\n\n let offsetShape = null;\n if (offset != null) {\n offsetShape = offset.shape;\n inputs.push(offset);\n }\n\n let scaleShape = null;\n if (scale != null) {\n scaleShape = scale.shape;\n inputs.push(scale);\n }\n\n const program = new BatchNormProgram(\n x.shape, mean.shape, variance.shape, offsetShape, scaleShape,\n varianceEpsilon);\n return this.compileAndRun(program, inputs);\n }\n\n localResponseNormalization4D(\n x: Tensor4D, radius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const program = new LRNProgram(x.shape, radius, bias, alpha, beta);\n return this.compileAndRun(program, [x]);\n }\n\n LRNGrad(\n dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D,\n depthRadius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const program =\n new LRNGradProgram(inputImage.shape, depthRadius, bias, alpha, beta);\n return this.compileAndRun(program, [inputImage, outputImage, dy]);\n }\n\n tile(x: T, reps: number[]): T {\n const program = new TileProgram(x.shape, reps);\n return this.compileAndRun(program, [x]);\n }\n\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T {\n const program = new PadProgram(x.shape, paddings, constantValue);\n return this.compileAndRun(program, [x]);\n }\n\n transpose(x: T, perm: number[]): T {\n const program = new TransposeProgram(x.shape, perm);\n return this.compileAndRun(program, [x]);\n }\n\n gather(x: T, indices: Tensor1D, axis: number): T {\n const program = new GatherProgram(x.shape, indices.size, axis);\n return this.compileAndRun(program, [x, indices]);\n }\n\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T {\n util.assert(\n x.rank <= 4,\n 'batchToSpaceND for rank > 4 with a WebGL backend not implemented yet');\n const prod = blockShape.reduce((a, b) => a * b);\n\n const reshaped = array_ops_util.getReshaped(x.shape, blockShape, prod);\n const permuted =\n array_ops_util.getPermuted(reshaped.length, blockShape.length);\n const reshapedPermuted =\n array_ops_util.getReshapedPermuted(x.shape, blockShape, prod);\n const sliceBeginCoords =\n array_ops_util.getSliceBeginCoords(crops, blockShape.length);\n const sliceSize =\n array_ops_util.getSliceSize(reshapedPermuted, crops, blockShape.length);\n\n return x.reshape(reshaped)\n .transpose(permuted)\n .reshape(reshapedPermuted)\n .slice(sliceBeginCoords, sliceSize) as T;\n }\n\n spaceToBatchND(\n x: T, blockShape: number[], paddings: Array<[number, number]>): T {\n util.assert(\n x.rank <= 4,\n 'spaceToBatchND for rank > 4 with a WebGL backend not implemented yet');\n\n const prod = blockShape.reduce((a, b) => a * b);\n\n const completePaddings: Array<[number, number]> = [[0, 0]];\n completePaddings.push(...paddings);\n for (let i = 1 + blockShape.length; i < x.shape.length; ++i) {\n completePaddings.push([0, 0]);\n }\n\n const paddedX = x.pad(completePaddings);\n\n const reshapedPaddedShape =\n array_ops_util.getReshaped(paddedX.shape, blockShape, prod, false);\n\n const permutedReshapedPaddedPermutation = array_ops_util.getPermuted(\n reshapedPaddedShape.length, blockShape.length, false);\n\n const flattenShape = array_ops_util.getReshapedPermuted(\n paddedX.shape, blockShape, prod, false);\n\n return paddedX.reshape(reshapedPaddedShape)\n .transpose(permutedReshapedPaddedPermutation)\n .reshape(flattenShape) as T;\n }\n\n private reduce(\n x: Tensor2D, reduceType: 'all'|'any'|'max'|'min'|'sum',\n dtype: DataType): Tensor2D {\n const batchSize = x.shape[0];\n const inSize = x.shape[1];\n const windowSize = reduce_util.computeOptimalWindowSize(inSize);\n const reduceInfo = {windowSize, inSize, batchSize};\n const program = new ReduceProgram(reduceInfo, reduceType);\n const [rows, cols] = program.outputShape;\n const output = this.makeOutputArray([rows, cols], dtype);\n this.compileAndRun(program, [x], output);\n // No need to run another GPGPU program.\n if (output.shape[1] === 1) {\n return output;\n }\n return this.reduce(output, reduceType, dtype);\n }\n\n private argReduce(\n x: Tensor2D, reduceType: 'max'|'min',\n bestIndicesA: Tensor2D = null): Tensor2D {\n let batchSize = x.shape[0];\n let inSize = x.shape[1];\n if (bestIndicesA != null) {\n batchSize = bestIndicesA.shape[0];\n inSize = bestIndicesA.shape[1];\n }\n const windowSize = reduce_util.computeOptimalWindowSize(inSize);\n const reduceInfo = {windowSize, inSize, batchSize};\n const program =\n new ArgMinMaxProgram(reduceInfo, reduceType, bestIndicesA == null);\n const [rows, cols] = program.outputShape;\n const output = this.makeOutputArray([rows, cols], 'int32');\n const inputs = [x];\n if (bestIndicesA != null) {\n inputs.push(bestIndicesA);\n }\n this.compileAndRun(program, inputs, output);\n // No need to run another GPGPU program.\n if (output.shape[1] === 1) {\n return output;\n }\n return this.argReduce(x, reduceType, output);\n }\n\n sum(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('sum', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n const outputDType = sumOutType(x.dtype);\n return this.reduce(a2D, 'sum', outputDType).reshape(outShape);\n }\n\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): Tensor {\n let axis = 0;\n const permutation = axis_util.getAxesPermutation([axis], x.rank);\n let permutedX = x;\n if (permutation != null) {\n permutedX = x.transpose(permutation);\n axis = axis_util.getInnerMostAxes(1, x.rank)[0];\n }\n\n const outShape =\n segment_util.computeOutShape(permutedX.shape, axis, numSegments);\n const inSize = util.sizeFromShape([permutedX.shape[axis]]);\n const a2D = permutedX.as2D(-1, inSize);\n const outputDType = sumOutType(x.dtype);\n let result =\n this.segOpCompute(\n a2D, 'unsortedSegmentSum', segmentIds, outputDType, numSegments)\n .reshape(outShape);\n if (permutation != null) {\n result = result.transpose(axis_util.getUndoAxesPermutation(permutation));\n }\n return result;\n }\n\n private segOpCompute(\n x: Tensor2D, segOpType: 'unsortedSegmentSum', segmentIds: Tensor1D,\n dtype: DataType, numSegments: number): Tensor2D {\n const batchSize = x.shape[0];\n const inSize = x.shape[1];\n const windowSize =\n segment_util.segOpComputeOptimalWindowSize(inSize, numSegments);\n const segOpInfo = {windowSize, inSize, batchSize, numSegments};\n const program = new SegmentOpProgram(segOpInfo, segOpType);\n const [rows, cols] = program.outputShape;\n const output = this.makeOutputArray([rows, cols], dtype);\n this.compileAndRun(program, [x, segmentIds], output);\n // No need to run another GPGPU program.\n if (output.shape[1] === numSegments) {\n return output;\n }\n segmentIds = range(0, numSegments).tile([inSize / windowSize]);\n return this.segOpCompute(output, segOpType, segmentIds, dtype, numSegments);\n }\n\n argMin(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMin', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.argReduce(a2D, 'min').reshape(outShape);\n }\n\n argMax(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMax', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.argReduce(a2D, 'max').reshape(outShape);\n }\n\n cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean):\n Tensor {\n if (axis !== x.rank - 1) {\n throw new Error(\n `WebGL cumsum shader expects an inner-most axis=${x.rank - 1} ` +\n `but got axis=${axis}`);\n }\n const program = new CumSumProgram(x.shape, exclusive, reverse);\n return this.compileAndRun(program, [x]);\n }\n\n equal(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n notEqual(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.NOT_EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n less(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.LESS, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n lessEqual(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.LESS_EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n greater(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.GREATER, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n greaterEqual(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.GREATER_EQUAL, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n logicalNot(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.LOGICAL_NOT);\n return this.compileAndRun(program, [x]) as T;\n }\n\n logicalAnd(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.LOGICAL_AND, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n logicalOr(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.LOGICAL_OR, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, 'bool');\n return this.compileAndRun(program, [a, b], output);\n }\n\n select(condition: Tensor, a: Tensor, b: Tensor): Tensor {\n const program = new SelectProgram(condition.rank, a.shape, a.rank);\n const output =\n this.makeOutputArray(program.outputShape, upcastType(a.dtype, b.dtype));\n return this.compileAndRun(program, [condition, a, b], output);\n }\n\n where(condition: Tensor): Tensor2D {\n warn(\n 'tf.where() in webgl locks the UI thread. ' +\n 'Call tf.whereAsync() instead');\n const condVals = condition.dataSync();\n return whereImpl(condition.shape, condVals);\n }\n\n topk(x: T, k: number, sorted: boolean): [T, T] {\n const xVals = x.dataSync();\n return topkImpl(xVals, x.shape, x.dtype, k, sorted);\n }\n\n min(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('min', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'min', a2D.dtype).reshape(outShape);\n }\n\n minimum(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MIN, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n mod(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MOD, a.shape, b.shape);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [a, b], null, customSetup);\n }\n\n max(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('max', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'max', a2D.dtype).reshape(outShape);\n }\n\n maximum(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.MAX, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n all(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('all', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'all', a2D.dtype).reshape(outShape);\n }\n\n any(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('any', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const inSize = util.sizeFromShape(reduceShape);\n const a2D = x.as2D(-1, inSize);\n return this.reduce(a2D, 'any', a2D.dtype).reshape(outShape);\n }\n\n squaredDifference(a: Tensor, b: Tensor): Tensor {\n const program =\n new BinaryOpProgram(binaryop_gpu.SQUARED_DIFFERENCE, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]);\n }\n\n realDivide(a: Tensor, b: Tensor): Tensor {\n const op = binaryop_gpu.DIV;\n const outputDtype = 'float32';\n const program = new BinaryOpProgram(op, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, outputDtype);\n return this.compileAndRun(program, [a, b], output);\n }\n\n floorDiv(a: Tensor, b: Tensor): Tensor {\n const op = binaryop_gpu.INT_DIV;\n const outputDtype = 'int32';\n const program = new BinaryOpProgram(op, a.shape, b.shape);\n const output = this.makeOutputArray(program.outputShape, outputDtype);\n return this.compileAndRun(program, [a, b], output);\n }\n\n add(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.ADD, a.shape, b.shape);\n const output =\n this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as Tensor;\n return this.compileAndRun(program, [a, b], output);\n }\n\n addN(tensors: T[]): T {\n let res = tensors[0];\n for (let i = 1; i < tensors.length; i++) {\n res = this.add(res, tensors[i]) as T;\n }\n return res;\n }\n\n subtract(a: Tensor, b: Tensor): Tensor {\n const program = new BinaryOpProgram(binaryop_gpu.SUB, a.shape, b.shape);\n const output =\n this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as Tensor;\n return this.compileAndRun(program, [a, b], output);\n }\n\n pow(a: T, b: Tensor): T {\n const program = new BinaryOpProgram(binaryop_gpu.POW, a.shape, b.shape);\n const customSetup = program.getCustomSetupFunc();\n const output = this.makeOutputArray(\n program.outputShape, upcastType(a.dtype, b.dtype)) as T;\n return this.compileAndRun(program, [a, b], output, customSetup);\n }\n\n ceil(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.CEIL);\n return this.compileAndRun(program, [x]) as T;\n }\n\n floor(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.FLOOR);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sign(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SIGN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n round(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ROUND);\n return this.compileAndRun(program, [x]) as T;\n }\n\n exp(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.EXP);\n return this.compileAndRun(program, [x]) as T;\n }\n\n expm1(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.EXPM1);\n return this.compileAndRun(program, [x]) as T;\n }\n\n log(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.LOG);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [x], null, customSetup) as T;\n }\n\n log1p(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.LOG1P);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sqrt(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SQRT);\n return this.compileAndRun(program, [x]) as T;\n }\n\n rsqrt(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.RSQRT);\n return this.compileAndRun(program, [x]) as T;\n }\n\n square(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SQUARE);\n return this.compileAndRun(program, [x]) as T;\n }\n\n reciprocal(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.RECIPROCAL);\n return this.compileAndRun(program, [x]) as T;\n }\n\n relu(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.RELU);\n return this.compileAndRun(program, [x]) as T;\n }\n\n elu(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ELU);\n return this.compileAndRun(program, [x]) as T;\n }\n\n eluDer(dy: T, y: T): T {\n const program =\n new BinaryOpProgram(binaryop_gpu.ELU_DER, dy.shape, y.shape);\n return this.compileAndRun(program, [dy, y]) as T;\n }\n\n selu(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SELU);\n return this.compileAndRun(program, [x]) as T;\n }\n\n int(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.TO_INT);\n const output = this.makeOutputArray(program.outputShape, 'int32');\n return this.compileAndRun(program, [x], output) as T;\n }\n\n clip(x: T, min: number, max: number): T {\n const program = new ClipProgram(x.shape, min, max);\n return this.compileAndRun(program, [x]) as T;\n }\n\n abs(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ABS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sigmoid(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SIGMOID);\n return this.compileAndRun(program, [x]) as T;\n }\n\n softplus(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SOFTPLUS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n sin(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SIN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n cos(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.COS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n tan(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.TAN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n asin(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ASIN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n acos(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ACOS);\n return this.compileAndRun(program, [x]) as T;\n }\n\n atan(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ATAN);\n return this.compileAndRun(program, [x]) as T;\n }\n\n atan2(a: T, b: T): T {\n const program = new BinaryOpProgram(binaryop_gpu.ATAN2, a.shape, b.shape);\n return this.compileAndRun(program, [a, b]) as T;\n }\n\n sinh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.SINH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n cosh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.COSH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n tanh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.TANH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n asinh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ASINH);\n return this.compileAndRun(program, [x]) as T;\n }\n\n acosh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ACOSH);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [x], null, customSetup) as T;\n }\n\n atanh(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ATANH);\n const customSetup = program.getCustomSetupFunc();\n return this.compileAndRun(program, [x], null, customSetup) as T;\n }\n\n erf(x: T): T {\n const program = new UnaryOpProgram(x.shape, unary_op.ERF);\n return this.compileAndRun(program, [x]) as T;\n }\n\n step(x: T, alpha: number): T {\n const program = new UnaryOpProgram(x.shape, unary_op.STEP(alpha));\n return this.compileAndRun(program, [x]) as T;\n }\n\n conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Conv2DProgram(convInfo);\n return this.compileAndRun(program, [x, filter]);\n }\n\n conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new Conv2DDerInputProgram(convInfo);\n return this.compileAndRun(program, [dy, filter]);\n }\n\n conv2dDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Conv2DDerFilterProgram(convInfo);\n return this.compileAndRun(program, [x, dy]);\n }\n\n depthwiseConv2D(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new DepthwiseConv2DProgram(convInfo);\n return this.compileAndRun(program, [x, filter]);\n }\n\n depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new DepthwiseConv2DDerInputProgram(convInfo);\n return this.compileAndRun(program, [dy, filter]);\n }\n\n depthwiseConv2DDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const program = new DepthwiseConv2DDerFilterProgram(convInfo);\n return this.compileAndRun(program, [x, dy]);\n }\n\n maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Pool2DProgram(convInfo, 'max', false);\n const output =\n this.makeOutputArray(program.outputShape, x.dtype) as Tensor4D;\n return this.compileAndRun(program, [x], output);\n }\n\n avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const program = new Pool2DProgram(convInfo, 'avg', false);\n const output = this.makeOutputArray(program.outputShape, 'float32');\n return this.compileAndRun(program, [x], output) as Tensor4D;\n }\n\n maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const getPositions = true;\n const maxPoolPositionsProgram =\n new Pool2DProgram(convInfo, 'max', getPositions);\n const maxPoolPositions: Tensor4D =\n this.compileAndRun(maxPoolPositionsProgram, [x]);\n\n const maxPoolBackPropProgram = new MaxPool2DBackpropProgram(convInfo);\n const output =\n this.makeOutputArray(maxPoolBackPropProgram.outputShape, x.dtype);\n const result = this.compileAndRun(\n maxPoolBackPropProgram, [dy, maxPoolPositions], output);\n maxPoolPositions.dispose();\n return result as Tensor4D;\n }\n\n avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const avgPoolBackpropProgram = new AvgPool2DBackpropProgram(convInfo);\n const output =\n this.makeOutputArray(avgPoolBackpropProgram.outputShape, x.dtype);\n return this.compileAndRun(avgPoolBackpropProgram, [dy], output) as Tensor4D;\n }\n\n cast(x: T, dtype: DataType): T {\n return backend_util.castTensor(x, dtype, this);\n }\n\n reshape(x: Tensor, shape: ShapeMap[R]): Tensor {\n return backend_util.reshapeTensor(x, shape);\n }\n\n resizeBilinear(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const program =\n new ResizeBilinearProgram(x.shape, newHeight, newWidth, alignCorners);\n return this.compileAndRun(program, [x]);\n }\n\n resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean):\n Tensor4D {\n const program = new ResizeBilinearBackpropProgram(dy, x, alignCorners);\n\n return this.compileAndRun(program, [dy]);\n }\n\n resizeNearestNeighbor(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const program = new ResizeNearestNeighborProgram(\n x.shape, newHeight, newWidth, alignCorners);\n return this.compileAndRun(program, [x]);\n }\n\n resizeNearestNeighborBackprop(\n dy: Tensor4D, x: Tensor4D, alignCorners: boolean): Tensor4D {\n const program =\n new ResizeNearestNeigborBackpropProgram(dy, x, alignCorners);\n return this.compileAndRun(program, [dy]);\n }\n\n multinomial(\n logits: Tensor2D, normalized: boolean, numSamples: number,\n seed: number): Tensor2D {\n const probs = normalized ? logits : softmax(logits);\n const batchSize = probs.shape[0];\n const numOutcomes = probs.shape[1];\n const program = new MultinomialProgram(batchSize, numOutcomes, numSamples);\n const output =\n this.makeOutputArray(program.outputShape, 'int32') as Tensor2D;\n const customSetup = program.getCustomSetupFunc(seed);\n return this.compileAndRun(program, [probs], output, customSetup);\n }\n\n oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number):\n Tensor2D {\n const program = new OneHotProgram(indices.size, depth, onValue, offValue);\n return this.compileAndRun(program, [indices]);\n }\n\n nonMaxSuppression(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number): Tensor1D {\n warn(\n 'tf.nonMaxSuppression() in webgl locks the UI thread. ' +\n 'Call tf.nonMaxSuppressionAsync() instead');\n const boxesVals = boxes.dataSync();\n const scoresVals = scores.dataSync();\n return nonMaxSuppressionImpl(\n boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold);\n }\n\n private makeOutputArray(shape: number[], dtype: DataType):\n T {\n return Tensor.make(shape, {}, dtype) as T;\n }\n\n private compileAndRun(\n program: GPGPUProgram, inputs: T[], output?: K,\n customSetup?: (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void,\n pageToCpu = true): K {\n if (output == null) {\n output = this.makeOutputArray(program.outputShape, inputs[0].dtype);\n }\n const inputsData: Array> = inputs.map(tensor => {\n const texData = this.texData.get(tensor.dataId);\n // Upload small tensors that live on the CPU as uniforms, not as\n // textures.\n if (texData.texture == null && tensor.size <= SIZE_UPLOAD_UNIFORM) {\n return {tensor, texData: null, isUniform: true};\n }\n this.uploadToGPU(tensor.dataId);\n return {tensor, texData, isUniform: false};\n });\n this.uploadToGPU(output.dataId);\n const outputData = {\n tensor: output,\n texData: this.texData.get(output.dataId),\n isUniform: false\n };\n const key = gpgpu_math.makeShaderKey(program, inputsData, outputData);\n const binary = this.getAndSaveBinary(key, () => {\n return gpgpu_math.compileProgram(\n this.gpgpu, program, inputsData, outputData);\n });\n const shouldTimeProgram = this.activeTimers != null;\n let query: WebGLQuery|CPUTimerQuery;\n if (shouldTimeProgram) {\n query = this.startTimer();\n }\n\n gpgpu_math.runProgram(binary, inputsData, outputData, customSetup);\n\n if (pageToCpu && this.numBytesInGPU > this.NUM_BYTES_BEFORE_PAGING) {\n let numBytesToPage = this.numBytesInGPU - this.NUM_BYTES_BEFORE_PAGING;\n while (numBytesToPage > 0 && this.lruDataGPU.length > 0) {\n const dataId = this.lruDataGPU.shift();\n const {shape, dtype} = this.texData.get(dataId);\n numBytesToPage -= this.computeBytes(shape, dtype);\n this.read(dataId);\n }\n }\n\n if (shouldTimeProgram) {\n query = this.endTimer(query);\n this.activeTimers.push(this.getQueryTime(query));\n }\n return output;\n }\n\n private getAndSaveBinary(key: string, getBinary: () => GPGPUBinary):\n GPGPUBinary {\n if (!(key in this.binaryCache)) {\n this.binaryCache[key] = getBinary();\n }\n return this.binaryCache[key];\n }\n\n getTextureManager(): TextureManager {\n return this.textureManager;\n }\n\n private disposed = false;\n\n dispose() {\n if (this.disposed) {\n return;\n }\n for (const key in this.binaryCache) {\n this.gpgpu.deleteProgram(this.binaryCache[key].webGLProgram);\n }\n this.textureManager.dispose();\n this.canvas.remove();\n if (this.fromPixelsCanvas != null) {\n this.fromPixelsCanvas.remove();\n }\n if (this.gpgpuCreatedLocally) {\n this.gpgpu.dispose();\n }\n this.disposed = true;\n }\n\n private throwIfNoData(dataId: DataId) {\n if (!this.texData.has(dataId)) {\n throw new Error(\n `WebGL backend: No data found for this tensor. ` +\n `Did you change your backend in the middle of the program? ` +\n `New backends can't use Tensors created with previous backends`);\n }\n }\n\n private uploadToGPU(dataId: DataId): void {\n this.throwIfNoData(dataId);\n const texData = this.texData.get(dataId);\n const {shape, values, texture, dtype, usage} = texData;\n if (texture != null) {\n // Array is already on GPU. No-op.\n // Touching the texture.\n const index = this.lruDataGPU.indexOf(dataId);\n if (index >= 0) {\n this.lruDataGPU.splice(this.lruDataGPU.indexOf(dataId), 1);\n this.lruDataGPU.push(dataId);\n }\n return;\n }\n const shouldTimeProgram = this.activeTimers != null;\n let start: number;\n if (shouldTimeProgram) {\n start = performance.now();\n }\n const texShape =\n webgl_util.getTextureShapeFromLogicalShape(this.gpgpu.gl, shape);\n texData.texShape = texShape;\n const newTexture = this.acquireTexture(dataId, texShape, usage);\n texData.texture = newTexture;\n if (values != null) {\n this.gpgpu.uploadMatrixToTexture(\n newTexture, texShape[0],\n // TODO(smilkov): Propagate the original typed array to gpgpu.\n texShape[1], typedArrayToFloat32(values, dtype));\n // Once uploaded, don't store the values on cpu.\n texData.values = null;\n if (shouldTimeProgram) {\n this.uploadWaitMs += performance.now() - start;\n }\n }\n }\n\n private cacheOnCPU(dataId: DataId, float32Values?: Float32Array) {\n // In delayed storage mode, when the user reads data, we don't keep a\n // copy on the gpu, to minimize likelihood of memory leak. We re-upload\n // to gpu the next time a gpgpu program needs the texture.\n const dontKeepCopyOnGPU = this.delayedStorage;\n const texData = this.texData.get(dataId);\n const {texture, texShape, dtype, usage} = texData;\n if (dontKeepCopyOnGPU && texture != null) {\n this.releaseTexture(dataId, texture, texShape, usage);\n texData.texture = null;\n texData.texShape = null;\n }\n if (float32Values != null) {\n texData.values = float32ToTypedArray(float32Values, dtype);\n }\n }\n\n private releaseTexture(\n dataId: DataId, texture: WebGLTexture, texShape: [number, number],\n texType: TextureUsage) {\n const {shape, dtype} = this.texData.get(dataId);\n const idx = this.lruDataGPU.indexOf(dataId);\n if (idx >= 0) {\n this.lruDataGPU.splice(idx, 1);\n }\n this.numBytesInGPU -= this.computeBytes(shape, dtype);\n this.textureManager.releaseTexture(texture, texShape, texType);\n }\n\n private acquireTexture(\n dataId: DataId, texShape: [number, number],\n texType: TextureUsage): WebGLTexture {\n const {shape, dtype} = this.texData.get(dataId);\n this.lruDataGPU.push(dataId);\n this.numBytesInGPU += this.computeBytes(shape, dtype);\n return this.textureManager.acquireTexture(texShape, texType);\n }\n\n private computeBytes(shape: number[], dtype: DataType) {\n return util.sizeFromShape(shape) * util.bytesPerElement(dtype);\n }\n}\n\nif (ENV.get('IS_BROWSER')) {\n ENV.registerBackend(\n 'webgl', () => new MathBackendWebGL(), 2 /* priority */,\n setTensorTracker);\n}\n\nfunction float32ToTypedArray(\n a: Float32Array, dtype: D): DataTypeMap[D] {\n if (dtype === 'float32') {\n return a;\n } else if (dtype === 'int32' || dtype === 'bool') {\n const result = (dtype === 'int32') ? new Int32Array(a.length) :\n new Uint8Array(a.length);\n for (let i = 0; i < result.length; ++i) {\n result[i] = Math.round(a[i]);\n }\n return result;\n } else {\n throw new Error(`Unknown dtype ${dtype}`);\n }\n}\n\nfunction typedArrayToFloat32(\n a: DataTypeMap[D], dtype: D): Float32Array {\n return (a instanceof Float32Array) ? a : new Float32Array(a);\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {nearestDivisor} from '../util';\nimport {PARALLELIZE_THRESHOLD} from './reduce_util';\n\nexport interface SegOpInfo {\n windowSize: number;\n batchSize: number;\n inSize: number;\n numSegments: number;\n}\n\nexport function segOpComputeOptimalWindowSize(\n inSize: number, numSegments: number): number {\n let done = false;\n let res;\n\n if (inSize <= PARALLELIZE_THRESHOLD) {\n res = inSize;\n done = true;\n } else {\n res = nearestDivisor(inSize, Math.floor(Math.sqrt(inSize)));\n }\n\n while (!done) {\n if (res > numSegments || res === inSize) {\n done = true;\n break;\n } else {\n res = nearestDivisor(inSize, res + 1);\n }\n }\n return res;\n}\n\nexport function computeOutShape(\n aShape: number[], axis: number, numSegments: number): number[] {\n const outShape = [];\n const rank = aShape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (dim !== axis) {\n outShape.push(aShape[dim]);\n } else {\n outShape.push(numSegments);\n }\n }\n return outShape;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {op} from './operation';\nimport {scalar, zerosLike} from './tensor_ops';\n\n/**\n * Computes `-1 * x` element-wise.\n *\n * ```js\n * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]);\n *\n * x.neg().print(); // or tf.neg(x)\n * ```\n *\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction neg_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'neg');\n\n const grad = (dy: T) => {\n return {$x: () => dy.neg()};\n };\n return ENV.engine.runKernel(backend => backend.neg($x), {$x}, grad);\n}\n\n/**\n * Computes ceiling of input `Tensor` element-wise: `ceil(x)`\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.ceil().print(); // or tf.ceil(x)\n * ```\n * @param x The input Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction ceil_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'ceil');\n\n // TODO(manrajgrover): Return null for gradients when backprop supports it.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.ceil($x), {$x}, grad);\n}\n\n/**\n * Computes floor of input `Tensor` element-wise: `floor(x)`.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.floor().print(); // or tf.floor(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction floor_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'floor');\n\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.floor($x), {$x}, grad);\n}\n\n/**\n * Returns an element-wise indication of the sign of a number.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]);\n *\n * x.sign().print(); // or tf.sign(x)\n * ```\n * @param x The input Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sign_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sign');\n\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.sign($x), {$x}, grad);\n}\n\n/**\n * Computes round of input `Tensor` element-wise: `round(x)`.\n * It implements banker's rounding.\n *\n * ```js\n * const x = tf.tensor1d([.6, 1.1, -3.3]);\n *\n * x.round().print(); // or tf.round(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction round_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'round');\n\n // TODO(nsthorat): Let gradients be null for cases where we want to stop\n // backpropgation.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.round($x), {$x}, grad);\n}\n\n/**\n * Computes exponential of the input `Tensor` element-wise. `e ^ x`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.exp().print(); // or tf.exp(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction exp_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'exp');\n\n const bck = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {$x: () => dy.mulStrict(y as T)};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.exp($x)), {$x}, bck);\n}\n\n/**\n * Computes exponential of the input `Tensor` minus one element-wise.\n * `e ^ x - 1`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, -3]);\n *\n * x.expm1().print(); // or tf.expm1(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction expm1_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'expm1');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.exp())};\n };\n return ENV.engine.runKernel(backend => backend.expm1($x), {$x}, grad);\n}\n\n/**\n * Computes natural logarithm of the input `Tensor` element-wise: `ln(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E]);\n *\n * x.log().print(); // or tf.log(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction log_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'log');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.toFloat())};\n };\n return ENV.engine.runKernel(backend => backend.log($x), {$x}, grad);\n}\n\n/**\n * Computes natural logarithm of the input `Tensor` plus one\n * element-wise: `ln(1 + x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.E - 1]);\n *\n * x.log1p().print(); // or tf.log1p(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction log1p_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'log1p');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.add(scalar(1)))};\n };\n return ENV.engine.runKernel(backend => backend.log1p($x), {$x}, grad);\n}\n\n/**\n * Computes square root of the input `Tensor` element-wise: `y = sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.sqrt().print(); // or tf.sqrt(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sqrt_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sqrt');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.toFloat().sqrt().mul(scalar(2)))};\n };\n return ENV.engine.runKernel(backend => backend.sqrt($x), {$x}, grad);\n}\n\n/**\n * Computes reciprocal of square root of the input `Tensor` element-wise:\n * `y = 1 / sqrt(x)`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 4, -1]);\n *\n * x.rsqrt().print(); // or tf.rsqrt(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction rsqrt_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'rsqrt');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.pow(scalar(1.5)).mul(scalar(2))).neg()};\n };\n return ENV.engine.runKernel(backend => backend.rsqrt($x), {$x}, grad);\n}\n\n/**\n * Computes square of `x` element-wise: `x ^ 2`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]);\n *\n * x.square().print(); // or tf.square(x)\n * ```\n * @param x The input Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction square_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'square');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.toFloat().mul(scalar(2)))};\n };\n return ENV.engine.runKernel(backend => backend.square($x), {$x}, grad);\n}\n\n/**\n * Computes reciprocal of x element-wise: `1 / x`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, 2]);\n *\n * x.reciprocal().print(); // or tf.reciprocal(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction reciprocal_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'reciprocal');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.square().neg())};\n };\n return ENV.engine.runKernel(backend => backend.reciprocal($x), {$x}, grad);\n}\n\n/**\n * Computes absolute value element-wise: `abs(x)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.abs().print(); // or tf.abs(x)\n * ```\n * @param x The input `Tensor`.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction abs_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'abs');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.toFloat().step(-1))};\n };\n return ENV.engine.runKernel(backend => backend.abs($x), {$x}, grad);\n}\n\n/**\n * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)\n * ```\n * @param x The input tensor.\n * @param clipValueMin Lower-bound of range to be clipped to.\n * @param clipValueMax Upper-bound of range to be clipped to.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction clipByValue_(\n x: T|TensorLike, clipValueMin: number, clipValueMax: number): T {\n const $x = convertToTensor(x, 'x', 'clipByValue');\n util.assert(\n (clipValueMin <= clipValueMax),\n `Error in clip: min (${clipValueMin}) must be ` +\n `less than or equal to max (${clipValueMax}).`);\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.where(\n $x.greaterEqual(scalar(clipValueMin))\n .logicalAnd($x.lessEqual(scalar(clipValueMax))),\n zerosLike(dy)) as T,\n };\n };\n return ENV.engine.runKernel(\n backend => backend.clip($x, clipValueMin, clipValueMax), {$x}, grad);\n}\n\n/**\n * Computes sigmoid element-wise, `1 / (1 + exp(-x))`\n *\n * ```js\n * const x = tf.tensor1d([0, -1, 2, -3]);\n *\n * x.sigmoid().print(); // or tf.sigmoid(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sigmoid_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sigmoid');\n\n const grad = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {$x: () => dy.mulStrict(y.mul(scalar(1).sub(y)))};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.sigmoid($x)), {$x}, grad);\n}\n\n/**\n * Computes log sigmoid of the input `Tensor` element-wise:\n * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`.\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.logSigmoid().print(); // or tf.logSigmoid(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction logSigmoid_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'logSigmoid');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.neg().sigmoid())};\n };\n return ENV.engine.runKernel(\n backend => backend.softplus($x.neg()).neg(), {$x}, grad);\n}\n\n/**\n * Computes softplus of the input `Tensor` element-wise: `log(exp(x) + 1)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.softplus().print(); // or tf.softplus(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction softplus_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'softplus');\n\n const grad = (dy: T) => {\n return {$x: () => dy.mulStrict($x.sigmoid())};\n };\n return ENV.engine.runKernel(backend => backend.softplus($x), {$x}, grad);\n}\n\n/**\n * Computes sin of the input Tensor element-wise: `sin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.sin().print(); // or tf.sin(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sin_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sin');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().cos().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.sin($x), {$x}, grad);\n}\n\n/**\n * Computes cos of the input `Tensor` element-wise: `cos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.cos().print(); // or tf.cos(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction cos_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'cos');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().sin().neg().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.cos($x), {$x}, grad);\n}\n\n/**\n * Computes tan of the input `Tensor` element-wise, `tan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]);\n *\n * x.tan().print(); // or tf.tan(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction tan_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'tan');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict($x.cos().square())};\n };\n return ENV.engine.runKernel(backend => backend.tan($x), {$x}, grad);\n}\n\n/**\n * Computes asin of the input `Tensor` element-wise: `asin(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asin().print(); // or tf.asin(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction asin_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'asin');\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.divStrict(scalar(1).sub($x.toFloat().square()).sqrt() as T)\n };\n };\n return ENV.engine.runKernel(backend => backend.asin($x), {$x}, grad);\n}\n\n/**\n * Computes acos of the input `Tensor` element-wise: `acos(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.acos().print(); // or tf.acos(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction acos_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'acos');\n\n const grad = (dy: T) => {\n return {\n $x: () =>\n dy.divStrict(scalar(1).sub($x.toFloat().square()).sqrt() as T).neg()\n };\n };\n return ENV.engine.runKernel(backend => backend.acos($x), {$x}, grad);\n}\n\n/**\n * Computes atan of the input `Tensor` element-wise: `atan(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.atan().print(); // or tf.atan(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction atan_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'atan');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict(scalar(1).add($x.toFloat().square()))};\n };\n return ENV.engine.runKernel(backend => backend.atan($x), {$x}, grad);\n}\n\n/**\n * Computes hyperbolic sin of the input `Tensor` element-wise: `sinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.sinh().print(); // or tf.sinh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction sinh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'sinh');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().cosh().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.sinh($x), {$x}, grad);\n}\n\n/**\n * Computes hyperbolic cos of the input `Tensor` element-wise: `cosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.cosh().print(); // or tf.cosh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction cosh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'cosh');\n\n const grad = (dy: T) => {\n return {$x: () => $x.toFloat().sinh().mulStrict(dy)};\n };\n return ENV.engine.runKernel(backend => backend.cosh($x), {$x}, grad);\n}\n\n/**\n * Computes hyperbolic tangent of the input `Tensor` element-wise: `tanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, 70]);\n *\n * x.tanh().print(); // or tf.tanh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction tanh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'tanh');\n\n const grad = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {$x: () => scalar(1).sub(y.square()).mulStrict(dy) as T};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.tanh($x)), {$x}, grad);\n}\n\n/**\n * Computes inverse hyperbolic sin of the input `Tensor` element-wise:\n * `asinh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, 1, -1, .7]);\n *\n * x.asinh().print(); // or tf.asinh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction asinh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'asinh');\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.divStrict(scalar(1).add($x.toFloat().square()).sqrt() as T)\n };\n };\n return ENV.engine.runKernel(backend => backend.asinh($x), {$x}, grad);\n}\n\n/**\n * Computes the inverse hyperbolic cos of the input `Tensor` element-wise:\n * `acosh(x)`\n *\n * ```js\n * const x = tf.tensor1d([10, 1, 3, 5.7]);\n *\n * x.acosh().print(); // or tf.acosh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction acosh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'acosh');\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.divStrict($x.toFloat().square().sub(scalar(1)).sqrt() as T)\n };\n };\n return ENV.engine.runKernel(backend => backend.acosh($x), {$x}, grad);\n}\n\n/**\n * Computes inverse hyperbolic tan of the input `Tensor` element-wise:\n * `atanh(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.atanh().print(); // or tf.atanh(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction atanh_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'atanh');\n\n const grad = (dy: T) => {\n return {$x: () => dy.divStrict(scalar(1).sub($x.toFloat().square()))};\n };\n return ENV.engine.runKernel(backend => backend.atanh($x), {$x}, grad);\n}\n\n/**\n * Computes gause error function of the input `Tensor` element-wise:\n * `erf(x)`\n *\n * ```js\n * const x = tf.tensor1d([0, .1, -.1, .7]);\n *\n * x.erf().print(); // or tf.erf(x);\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction erf_(x: T|TensorLike): T {\n let $x = convertToTensor(x, 'x', 'erf');\n util.assert(\n $x.dtype === 'int32' || $x.dtype === 'float32',\n 'Input dtype must be `int32` or `float32`.');\n\n if ($x.dtype === 'int32') {\n $x = $x.toFloat();\n }\n\n const grad = (dy: T) => {\n return {\n $x: () => dy.mulStrict(\n scalar(2 / Math.sqrt(Math.PI)).mul($x.square().neg().exp()))\n };\n };\n return ENV.engine.runKernel(backend => backend.erf($x), {$x}, grad);\n}\n\n/**\n * Computes step of the input `Tensor` element-wise: `x > 0 ? 1 : alpha * x`\n *\n * ```js\n * const x = tf.tensor1d([0, 2, -1, -3]);\n *\n * x.step(.5).print(); // or tf.step(x, .5)\n * ```\n * @param x The input tensor.\n * @param alpha The gradient when input is negative.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction step_(x: T|TensorLike, alpha = 0.0): T {\n const $x = convertToTensor(x, 'x', 'step');\n\n // TODO(manrajgrover): Return null for gradients when backprop supports\n // it.\n const grad = (dy: T) => {\n return {$x: () => zerosLike(dy)};\n };\n return ENV.engine.runKernel(backend => backend.step($x, alpha), {$x}, grad);\n}\n\nexport const abs = op({abs_});\nexport const acos = op({acos_});\nexport const acosh = op({acosh_});\nexport const asin = op({asin_});\nexport const asinh = op({asinh_});\nexport const atan = op({atan_});\nexport const atanh = op({atanh_});\nexport const ceil = op({ceil_});\nexport const clipByValue = op({clipByValue_});\nexport const cos = op({cos_});\nexport const cosh = op({cosh_});\nexport const erf = op({erf_});\nexport const exp = op({exp_});\nexport const expm1 = op({expm1_});\nexport const floor = op({floor_});\nexport const log = op({log_});\nexport const log1p = op({log1p_});\nexport const logSigmoid = op({logSigmoid_});\nexport const neg = op({neg_});\nexport const reciprocal = op({reciprocal_});\nexport const round = op({round_});\nexport const rsqrt = op({rsqrt_});\nexport const sigmoid = op({sigmoid_});\nexport const sign = op({sign_});\nexport const sin = op({sin_});\nexport const sinh = op({sinh_});\nexport const softplus = op({softplus_});\nexport const sqrt = op({sqrt_});\nexport const square = op({square_});\nexport const step = op({step_});\nexport const tan = op({tan_});\nexport const tanh = op({tanh_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {Rank, TensorLike} from '../types';\nimport * as util from '../util';\n\nimport {tile} from './array_ops';\nimport {getReductionAxes} from './broadcast_util';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\nimport {rsqrt} from './unary_ops';\n\n/**\n * Batch normalization, strictly for 2D. For the more relaxed version, see\n * `batchNormalization`.\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\nfunction batchNormalization2d_(\n x: Tensor2D|TensorLike, mean: Tensor2D|Tensor1D|TensorLike,\n variance: Tensor2D|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor2D|Tensor1D|TensorLike,\n offset?: Tensor2D|Tensor1D|TensorLike): Tensor2D {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor2D|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor2D|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n util.assert(\n $x.rank === 2,\n `Error in batchNormalization3D: x must be rank 3 but got rank ` +\n `${$x.rank}.`);\n util.assert(\n $mean.rank === 2 || $mean.rank === 1,\n `Error in batchNormalization2D: mean must be rank 2 or rank 1 but ` +\n `got rank ${$mean.rank}.`);\n util.assert(\n $variance.rank === 2 || $variance.rank === 1,\n `Error in batchNormalization2D: variance must be rank 2 or rank 1 ` +\n `but got rank ${$variance.rank}.`);\n if ($scale != null) {\n util.assert(\n $scale.rank === 2 || $scale.rank === 1,\n `Error in batchNormalization2D: scale must be rank 2 or rank 1 ` +\n `but got rank ${$scale.rank}.`);\n }\n if ($offset != null) {\n util.assert(\n $offset.rank === 2 || $offset.rank === 1,\n `Error in batchNormalization2D: offset must be rank 2 or rank 1 ` +\n `but got rank ${$offset.rank}.`);\n }\n\n return batchNormalization(\n $x, $mean, $variance, varianceEpsilon, $scale, $offset);\n}\n\n/**\n * Batch normalization, strictly for 3D. For the more relaxed version, see\n * `batchNormalization`.\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\nfunction batchNormalization3d_(\n x: Tensor3D|TensorLike, mean: Tensor3D|Tensor1D|TensorLike,\n variance: Tensor3D|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor3D|Tensor1D|TensorLike,\n offset?: Tensor3D|Tensor1D|TensorLike): Tensor3D {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor3D|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor3D|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n util.assert(\n $x.rank === 3,\n `Error in batchNormalization3D: x must be rank 3 but got rank ` +\n `${$x.rank}.`);\n util.assert(\n $mean.rank === 3 || $mean.rank === 1,\n `Error in batchNormalization3D: mean must be rank 3 or rank 1 but ` +\n `got rank ${$mean.rank}.`);\n util.assert(\n $variance.rank === 3 || $variance.rank === 1,\n `Error in batchNormalization3D: variance must be rank 3 or rank 1 ` +\n `but got rank ${$variance.rank}.`);\n if ($scale != null) {\n util.assert(\n $scale.rank === 3 || $scale.rank === 1,\n `Error in batchNormalization3D: scale must be rank 3 or rank 1 ` +\n `but got rank ${$scale.rank}.`);\n }\n if ($offset != null) {\n util.assert(\n $offset.rank === 3 || $offset.rank === 1,\n `Error in batchNormalization3D: offset must be rank 3 or rank 1 ` +\n `but got rank ${$offset.rank}.`);\n }\n\n return batchNormalization(\n $x, $mean, $variance, varianceEpsilon, $scale, $offset);\n}\n\n/**\n * Batch normalization, strictly for 4D. For the more relaxed version, see\n * `batchNormalization`.\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\nfunction batchNormalization4d_(\n x: Tensor4D|TensorLike, mean: Tensor4D|Tensor1D|TensorLike,\n variance: Tensor4D|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor4D|Tensor1D|TensorLike,\n offset?: Tensor4D|Tensor1D|TensorLike): Tensor4D {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor4D|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor4D|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n util.assert(\n $x.rank === 4,\n `Error in batchNormalization4D: x must be rank 4 but got rank ` +\n `${$x.rank}.`);\n util.assert(\n $mean.rank === 4 || $mean.rank === 1,\n `Error in batchNormalization4D: mean must be rank 4 or rank 1 but ` +\n `got rank ${$mean.rank}.`);\n util.assert(\n $variance.rank === 4 || $variance.rank === 1,\n `Error in batchNormalization4D: variance must be rank 4 or rank 1 ` +\n `but got rank ${$variance.rank}.`);\n if ($scale != null) {\n util.assert(\n $scale.rank === 4 || $scale.rank === 1,\n `Error in batchNormalization4D: scale must be rank 4 or rank 1 ` +\n `but got rank ${$scale.rank}.`);\n }\n if ($offset != null) {\n util.assert(\n $offset.rank === 4 || $offset.rank === 1,\n `Error in batchNormalization4D: offset must be rank 4 or rank 1 ` +\n `but got rank ${$offset.rank}.`);\n }\n return batchNormalization(\n $x, $mean, $variance, varianceEpsilon, $scale, $offset);\n}\n\n/**\n * Batch normalization.\n *\n * As described in\n * [http://arxiv.org/abs/1502.03167](http://arxiv.org/abs/1502.03167).\n *\n * Mean, variance, scale, and offset can be of two\n * shapes:\n * - The same shape as the input.\n * - In the common case, the depth dimension is the last dimension of x, so\n * the values would be an `Tensor1D` of shape [depth].\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that parameters passed are of given rank\n * - `tf.batchNormalization2d`\n * - `tf.batchNormalization3d`\n * - `tf.batchNormalization4d`\n *\n * @param x The input Tensor.\n * @param mean A mean Tensor.\n * @param variance A variance Tensor.\n * @param varianceEpsilon A small float number to avoid dividing by 0.\n * @param scale A scale Tensor.\n * @param offset An offset Tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction batchNormalization_(\n x: Tensor|Tensor1D|TensorLike, mean: Tensor|Tensor1D|TensorLike,\n variance: Tensor|Tensor1D|TensorLike, varianceEpsilon = .001,\n scale?: Tensor|Tensor1D|TensorLike,\n offset?: Tensor|Tensor1D|TensorLike): Tensor {\n const $x = convertToTensor(x, 'x', 'batchNormalization');\n const $mean = convertToTensor(mean, 'mean', 'batchNormalization');\n const $variance = convertToTensor(variance, 'variance', 'batchNormalization');\n let $scale: Tensor|Tensor1D;\n if (scale != null) {\n $scale = convertToTensor(scale, 'scale', 'batchNormalization');\n }\n let $offset: Tensor|Tensor1D;\n if (offset != null) {\n $offset = convertToTensor(offset, 'offset', 'batchNormalization');\n }\n\n util.assert(\n $mean.rank === $variance.rank,\n 'Batch normalization gradient requires mean and variance to have ' +\n 'equal ranks.');\n util.assert(\n $offset == null || $mean.rank === $offset.rank,\n 'Batch normalization gradient requires mean and offset to have ' +\n 'equal ranks.');\n util.assert(\n $scale == null || $mean.rank === $scale.rank,\n 'Batch normalization gradient requires mean and scale to have ' +\n 'equal ranks.');\n\n let x4D: Tensor4D;\n if ($x.rank === 0 || $x.rank === 1) {\n x4D = $x.as4D(1, 1, 1, $x.size);\n } else if ($x.rank === 2) {\n x4D = $x.as4D(1, 1, $x.shape[0], $x.shape[1]);\n } else if ($x.rank === 3) {\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]) as Tensor4D;\n } else {\n x4D = $x as Tensor4D;\n }\n\n const der = (dy: Tensor) => {\n const scaleValue = $scale == null ? scalar(1) : $scale;\n const reductionAxes = getReductionAxes($mean.shape, x4D.shape);\n const tileShape: number[] = [];\n if ($mean.rank === 1) {\n for (let i = 0; i < x4D.shape.length - 1; ++i) {\n tileShape.push(x4D.shape[i]);\n }\n tileShape.push(1);\n }\n\n const xMinusMean = $x.sub($mean);\n const dyTimesScaleValue = dy.mul(scaleValue);\n const oneOverSqrtVariance = rsqrt($variance.add(scalar(varianceEpsilon)));\n const minusHalfRCube = oneOverSqrtVariance.mul(oneOverSqrtVariance)\n .mul(oneOverSqrtVariance)\n .mul(scalar(-0.5));\n const derX = () => {\n if ($mean.rank === 1) {\n return dy\n .mul(tile(\n oneOverSqrtVariance.as4D(1, 1, 1, $mean.shape[0]), tileShape))\n .mul(scaleValue)\n .reshape($x.shape);\n } else {\n return dy.mul(oneOverSqrtVariance).mul(scaleValue).reshape($x.shape);\n }\n };\n const derMean = () => {\n let meanDer = oneOverSqrtVariance.mul(scalar(-1)).mul(dyTimesScaleValue);\n if ($mean.rank === 1) {\n meanDer = meanDer.sum(reductionAxes);\n }\n return meanDer.reshape($mean.shape);\n };\n const derVariance = () => {\n let varianceDer = minusHalfRCube.mul(xMinusMean).mul(dyTimesScaleValue);\n if ($mean.rank === 1) {\n varianceDer = varianceDer.sum(reductionAxes);\n }\n return varianceDer.reshape($mean.shape);\n };\n const derScale = () => {\n const xMinusMean2TimesRsqrt = xMinusMean.mul(oneOverSqrtVariance);\n let scaleDer = dy.mul(xMinusMean2TimesRsqrt);\n if ($mean.rank === 1) {\n scaleDer = scaleDer.sum(reductionAxes);\n }\n return scaleDer.reshape($mean.shape);\n };\n const derOffset = () => {\n let offsetDer = dy;\n if ($mean.rank === 1) {\n offsetDer = offsetDer.sum(reductionAxes);\n }\n return offsetDer.reshape($mean.shape);\n };\n return {\n $x: derX,\n $mean: derMean,\n $variance: derVariance,\n $scale: derScale,\n $offset: derOffset\n };\n };\n\n const res = ENV.engine.runKernel(\n backend => backend.batchNormalization(\n x4D, batchnormReshape4D($mean), batchnormReshape4D($variance),\n varianceEpsilon, batchnormReshape4D($scale),\n batchnormReshape4D($offset)),\n {$x, $mean, $variance, $scale, $offset}, der);\n return res.reshape($x.shape);\n}\n\nfunction batchnormReshape4D(x: Tensor): Tensor4D|Tensor1D {\n if (x == null) {\n return null;\n }\n if (x.rank === 0) {\n return x.as1D();\n } else if (x.rank === 1) {\n return x as Tensor1D;\n } else if (x.rank === 2) {\n return x.as4D(1, 1, x.shape[0], x.shape[1]);\n } else if (x.rank === 3) {\n return x.as4D(1, x.shape[0], x.shape[1], x.shape[2]);\n }\n return x as Tensor4D;\n}\n\nexport const batchNormalization2d = op({batchNormalization2d_});\nexport const batchNormalization3d = op({batchNormalization3d_});\nexport const batchNormalization4d = op({batchNormalization4d_});\nexport const batchNormalization = op({batchNormalization_});\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as util from '../util';\n\nexport type PadInfo = {\n top: number,\n left: number,\n right: number,\n bottom: number,\n type: string\n};\n\n/**\n * Information about the forward pass of a convolution/pooling operation.\n * It includes input and output shape, strides, filter size and padding\n * information.\n */\nexport type Conv2DInfo = {\n batchSize: number,\n inHeight: number,\n inWidth: number,\n inChannels: number,\n outHeight: number,\n outWidth: number,\n outChannels: number,\n dataFormat: 'channelsFirst'|'channelsLast',\n strideHeight: number,\n strideWidth: number,\n dilationHeight: number,\n dilationWidth: number,\n filterHeight: number,\n filterWidth: number,\n padInfo: PadInfo,\n inShape: [number, number, number, number],\n outShape: [number, number, number, number],\n filterShape: [number, number, number, number]\n};\n\nexport function computePool2DInfo(\n inShape: [number, number, number, number],\n filterSize: [number, number]|number, strides: number|[number, number],\n pad: 'same'|'valid'|number, roundingMode?: 'floor'|'round'|'ceil',\n dataFormat: 'channelsFirst'|'channelsLast' = 'channelsLast'): Conv2DInfo {\n const [filterHeight, filterWidth] = parseTupleParam(filterSize);\n\n let filterShape: [number, number, number, number];\n if (dataFormat === 'channelsLast') {\n filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]];\n } else if (dataFormat === 'channelsFirst') {\n filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]];\n } else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const dilations = 1;\n\n return computeConv2DInfo(\n inShape, filterShape, strides, dilations, pad, roundingMode, false,\n dataFormat);\n}\n\n/**\n * Computes the information for a forward pass of a convolution/pooling\n * operation.\n */\nexport function computeConv2DInfo(\n inShape: [number, number, number, number],\n filterShape: [number, number, number, number],\n strides: number|[number, number], dilations: number|[number, number],\n pad: 'same'|'valid'|number, roundingMode?: 'floor'|'round'|'ceil',\n depthwise = false,\n dataFormat: 'channelsFirst'|'channelsLast' = 'channelsLast'): Conv2DInfo {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n } else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n } else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n\n const effectiveFilterHeight =\n getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth =\n getEffectiveFilterSize(filterWidth, dilationWidth);\n const {padInfo, outHeight, outWidth} = getPadAndOutInfo(\n pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight,\n effectiveFilterWidth, roundingMode);\n\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n\n let outShape: [number, number, number, number];\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n } else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}\n\nfunction computeOutputShape3D(\n inShape: [number, number, number], fieldSize: number, outDepth: number,\n stride: number, zeroPad?: number,\n roundingMode?: 'floor'|'round'|'ceil'): [number, number, number] {\n if (zeroPad == null) {\n zeroPad = computeDefaultPad(inShape, fieldSize, stride);\n }\n const inputRows = inShape[0];\n const inputCols = inShape[1];\n\n const outputRows = conditionalRound(\n (inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n util.assert(\n util.isInt(outputRows),\n `The output # of rows (${outputRows}) must be an integer. Change the ` +\n `stride and/or zero pad parameters`);\n\n const outputCols = conditionalRound(\n (inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);\n util.assert(\n util.isInt(outputCols),\n `The output # of columns (${outputCols}) must be an integer. Change ` +\n `the stride and/or zero pad parameters`);\n\n return [outputRows, outputCols, outDepth];\n}\n\nexport function computeDefaultPad(\n inputShape: [number, number, number], fieldSize: number, stride: number,\n dilation = 1): number {\n const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation);\n return Math.floor(\n (inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2);\n}\n\nfunction parseTupleParam(param: number|[number, number]): [number, number] {\n return typeof param === 'number' ? [param, param] : param;\n}\n\n/* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d\n * Atrous convolution is equivalent to standard convolution with upsampled\n * filters with effective_filter_height =\n * filter_height + (filter_height - 1) * (dilation - 1)\n * and effective_filter_width =\n * filter_width + (filter_width - 1) * (dilation - 1),\n * produced by inserting dilation - 1 zeros along consecutive elements across\n * the filters' spatial dimensions.\n * When there is a dilation, this converts a filter dimension to the\n * effective filter dimension, so it can be used in a standard convolution.\n */\nfunction getEffectiveFilterSize(filterSize: number, dilation: number) {\n if (dilation <= 1) {\n return filterSize;\n }\n\n return filterSize + (filterSize - 1) * (dilation - 1);\n}\n\nfunction getPadAndOutInfo(\n pad: 'same'|'valid'|number, inHeight: number, inWidth: number,\n strideHeight: number, strideWidth: number, filterHeight: number,\n filterWidth: number, roundingMode?: 'floor'|'round'|'ceil'):\n {padInfo: PadInfo, outHeight: number, outWidth: number} {\n let padInfo: PadInfo;\n let outHeight: number;\n let outWidth: number;\n\n if (typeof pad === 'number') {\n const padType = (pad === 0) ? 'VALID' : 'NUMBER';\n padInfo = {top: pad, bottom: pad, left: pad, right: pad, type: padType};\n const outShape = computeOutputShape3D(\n [inHeight, inWidth, 1], filterHeight, 1, strideHeight, pad,\n roundingMode);\n outHeight = outShape[0];\n outWidth = outShape[1];\n } else if (pad === 'same') {\n outHeight = Math.ceil(inHeight / strideHeight);\n outWidth = Math.ceil(inWidth / strideWidth);\n const padAlongHeight =\n (outHeight - 1) * strideHeight + filterHeight - inHeight;\n const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth;\n const top = Math.floor(padAlongHeight / 2);\n const bottom = padAlongHeight - top;\n const left = Math.floor(padAlongWidth / 2);\n const right = padAlongWidth - left;\n padInfo = {top, bottom, left, right, type: 'SAME'};\n } else if (pad === 'valid') {\n padInfo = {top: 0, bottom: 0, left: 0, right: 0, type: 'VALID'};\n outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight);\n outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth);\n } else {\n throw Error(`Unknown padding parameter: ${pad}`);\n }\n return {padInfo, outHeight, outWidth};\n}\n\n/**\n * Rounds a value depending on the rounding mode\n * @param value\n * @param roundingMode\n */\nfunction conditionalRound(\n value: number, roundingMode?: 'floor'|'round'|'ceil') {\n if (!roundingMode) {\n return value;\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport {op} from './operation';\n\n/**\n * Computes a 1D convolution over the input x.\n *\n * @param x The input tensor, of rank 3 or rank 2, of shape\n * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.\n * @param filter The filter, rank 3, of shape\n * `[filterWidth, inDepth, outDepth]`.\n * @param stride The number of entries by which the filter is moved right at\n * each step.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat An optional string from \"NWC\", \"NCW\". Defaults to \"NWC\",\n * the data is stored in the order of [batch, in_width, in_channels]. Only\n * \"NWC\" is currently supported.\n * @param dilation The dilation rate in which we sample input values in\n * atrous convolution. Defaults to `1`. If it is greater than 1, then\n * stride must be `1`.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction conv1d_(\n x: T|TensorLike, filter: Tensor3D|TensorLike, stride: number,\n pad: 'valid'|'same'|number, dataFormat: 'NWC'|'NCW' = 'NWC', dilation = 1,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'conv1d');\n const $filter = convertToTensor(filter, 'filter', 'conv1d');\n\n let x3D = $x as Tensor3D;\n let reshapedTo3D = false;\n if ($x.rank === 2) {\n reshapedTo3D = true;\n x3D = $x.as3D(1, $x.shape[0], $x.shape[1]);\n }\n\n util.assert(\n x3D.rank === 3,\n `Error in conv1d: input must be rank 3, but got rank ${x3D.rank}.`);\n util.assert(\n $filter.rank === 3,\n `Error in conv1d: filter must be rank 3, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv1d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n util.assert(\n x3D.shape[2] === $filter.shape[1],\n `Error in conv1d: depth of input (${x3D.shape[2]}) must match ` +\n `input depth for filter ${$filter.shape[1]}.`);\n util.assert(\n eitherStridesOrDilationsAreOne(stride, dilation),\n 'Error in conv1D: Either stride or dilation must be 1. ' +\n `Got stride ${stride} and dilation '${dilation}'`);\n util.assert(\n dataFormat === 'NWC',\n `Error in conv1d: got dataFormat of ${\n dataFormat} but only NWC is currently supported.`);\n\n const filter4D =\n $filter.as4D(1, $filter.shape[0], $filter.shape[1], $filter.shape[2]);\n const input4D = x3D.as4D(x3D.shape[0], 1, x3D.shape[1], x3D.shape[2]);\n const strides: [number, number] = [1, stride];\n const dilations: [number, number] = [1, dilation];\n\n const conv2dDataFormat = 'NHWC';\n\n const res = conv2d(\n input4D, filter4D, strides, pad, conv2dDataFormat, dilations,\n dimRoundingMode);\n\n if (reshapedTo3D) {\n return res.as2D(res.shape[2], res.shape[3]) as T;\n }\n return res.as3D(res.shape[0], res.shape[2], res.shape[3]) as T;\n}\n\n/**\n * Computes a 2D convolution over the input x.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction conv2d_(\n x: T|TensorLike, filter: Tensor4D|TensorLike,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'conv2d');\n const $filter = convertToTensor(filter, 'filter', 'conv2d');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`);\n util.assert(\n $filter.rank === 4,\n `Error in conv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n util.assert(\n x4D.shape[3] === $filter.shape[2],\n `Error in conv2d: depth of input (${x4D.shape[3]}) must match ` +\n `input depth for filter ${$filter.shape[2]}.`);\n util.assert(\n eitherStridesOrDilationsAreOne(strides, dilations),\n 'Error in conv2D: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n util.assert(\n dataFormat === 'NHWC',\n `Error in conv2d: got dataFormat of ${\n dataFormat} but only NHWC is currently supported.`);\n\n const convInfo = conv_util.computeConv2DInfo(\n x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode);\n\n const grad = (dy: Tensor4D) => {\n util.assert(\n tupleValuesAreOne(dilations),\n 'Error in gradient of conv2D: dilation rates greater than 1 are not' +\n `yet supported in gradients. Got dilations '${dilations}'`);\n\n return {\n x: () => conv2dDerInput_(x4D.shape, dy, $filter, strides, pad),\n $filter: () => conv2dDerFilter_(x4D, dy, $filter.shape, strides, pad)\n };\n };\n\n const res = ENV.engine.runKernel(\n backend => backend.conv2d(x4D, $filter, convInfo), {x: x4D, $filter},\n grad);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the derivative of the input of a 2D convolution.\n *\n * @param xShape The shape of the input: [batch, height, width, inDepth].\n * If length of 3, batch of 1 is assumed.\n * @param dy The derivative of the output, of rank 4 or rank 3 of shape\n * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, inDepth, outDepth]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`.\n * @param pad The type of padding algorithm used:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\nfunction conv2dDerInput_(\n xShape: [number, number, number, number]|[number, number, number], dy: T,\n filter: Tensor4D, strides: [number, number]|number,\n pad: 'valid'|'same'|number, dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n util.assert(\n xShape.length === dy.rank,\n `Length of inShape ` +\n `(${xShape.length}) and rank of dy (${dy.rank}) must match`);\n\n let xShape4D = xShape as [number, number, number, number];\n let dy4D = dy as Tensor4D;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n xShape4D = [1, xShape[0], xShape[1], xShape[2]];\n }\n\n const inDepth = xShape4D[3];\n const outDepth = dy4D.shape[3];\n util.assert(\n xShape4D.length === 4,\n `Error in conv2dDerInput: inShape must be length 4, but got length ` +\n `${xShape4D.length}.`);\n util.assert(\n dy4D.rank === 4,\n `Error in conv2dDerInput: dy must be rank 4, but got ` +\n `rank ${dy4D.rank}`);\n util.assert(\n filter.rank === 4,\n `Error in conv2dDerInput: filter must be rank 4, but got ` +\n `rank ${filter.rank}`);\n util.assert(\n inDepth === filter.shape[2],\n `Error in conv2dDerInput: depth of input (${inDepth}) must ` +\n `match input depth for filter ${filter.shape[2]}.`);\n util.assert(\n outDepth === filter.shape[3],\n `Error in conv2dDerInput: depth of output (${outDepth}) must ` +\n `match output depth for filter ${filter.shape[3]}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv2dDerInput: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const dilations = 1;\n\n const convInfo = conv_util.computeConv2DInfo(\n xShape4D, filter.shape, strides, dilations, pad, dimRoundingMode);\n const res = ENV.engine.runKernel(\n backend => backend.conv2dDerInput(dy4D, filter, convInfo), {dy4D});\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the derivative of the filter of a 2D convolution.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.\n * @param dy The dy image, of rank 4 or rank 3, of shape\n * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed.\n * @param filterShape The shape of the filter, length 4,\n * [filterHeight, filterWidth, inDepth, outDepth].\n * @param strides The strides of the convolution: [strideHeight,\n * strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. The\n * rounding mode used when computing output dimensions if pad is a\n * number. If none is provided, it will not round and error if the output\n * is of fractional size.\n */\nfunction conv2dDerFilter_(\n x: T, dy: T, filterShape: [number, number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): Tensor4D {\n let x4D = x as Tensor4D;\n if (x.rank === 3) {\n x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]);\n }\n let dy4D = dy as Tensor4D;\n if (dy4D.rank === 3) {\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in conv2dDerFilter: input must be rank 4, but got shape ` +\n `${x4D.shape}.`);\n util.assert(\n dy4D.rank === 4,\n `Error in conv2dDerFilter: dy must be rank 4, but got shape ` +\n `${dy4D.shape}.`);\n util.assert(\n filterShape.length === 4,\n `Error in conv2dDerFilter: filterShape must be length 4, but got ` +\n `${filterShape}.`);\n util.assert(\n x4D.shape[3] === filterShape[2],\n `Error in conv2dDerFilter: depth of input ${x4D.shape[3]}) must ` +\n `match input depth in filter (${filterShape[2]}.`);\n util.assert(\n dy4D.shape[3] === filterShape[3],\n `Error in conv2dDerFilter: depth of dy (${dy4D.shape[3]}) must ` +\n `match output depth for filter (${filterShape[3]}).`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in conv2dDerFilter: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const dilations = 1;\n\n const convInfo = conv_util.computeConv2DInfo(\n x4D.shape, filterShape, strides, dilations, pad, dimRoundingMode);\n return ENV.engine.runKernel(\n backend => backend.conv2dDerFilter(x4D, dy4D, convInfo), {x4D, dy4D});\n}\n\n/**\n * Computes the transposed 2D convolution of an image, also known as a\n * deconvolution.\n *\n * @param x The input image, of rank 4 or rank 3, of shape\n * `[batch, height, width, inDepth]`. If rank 3, batch of 1 is assumed.\n * @param filter The filter, rank 4, of shape\n * `[filterHeight, filterWidth, outDepth, inDepth]`.\n * `inDepth` must match `inDepth` in `x`.\n * @param outputShape Output shape, of rank 4 or rank 3:\n * `[batch, height, width, outDepth]`. If rank 3, batch of 1 is assumed.\n * @param strides The strides of the original convolution:\n * `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm used in the non-transpose version\n * of the op.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction conv2dTranspose_(\n x: T|TensorLike, filter: Tensor4D|TensorLike,\n outputShape: [number, number, number, number]|[number, number, number],\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'conv2dTranspose');\n const $filter = convertToTensor(filter, 'filter', 'conv2dTranspose');\n\n return conv2dDerInput_(\n outputShape, $x, $filter, strides, pad, dimRoundingMode);\n}\n\n/**\n * Depthwise 2D convolution.\n *\n * Given a 4D `input` array and a `filter` array of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]` containing\n * `inChannels` convolutional filters of depth 1, this op applies a\n * different filter to each input channel (expanding from 1 channel to\n * `channelMultiplier` channels for each), then concatenates the results\n * together. The output has `inChannels * channelMultiplier` channels.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/depthwise_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param filter The filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction depthwiseConv2d_(\n x: T|TensorLike, filter: Tensor4D|TensorLike,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dataFormat: 'NHWC'|'NCHW' = 'NHWC',\n dilations: [number, number]|number = [1, 1],\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'depthwiseConv2d');\n const $filter = convertToTensor(filter, 'filter', 'depthwiseConv2d');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in depthwiseConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert(\n $filter.rank === 4,\n `Error in depthwiseConv2d: filter must be rank 4, but got rank ` +\n `${$filter.rank}.`);\n util.assert(\n x4D.shape[3] === $filter.shape[2],\n `Error in depthwiseConv2d: number of input channels ` +\n `(${x4D.shape[3]}) must match the inChannels dimension in ` +\n `filter ${$filter.shape[2]}.`);\n if (dilations == null) {\n dilations = [1, 1];\n }\n util.assert(\n eitherStridesOrDilationsAreOne(strides, dilations),\n 'Error in depthwiseConv2d: Either strides or dilations must be 1. ' +\n `Got strides ${strides} and dilations '${dilations}'`);\n\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in depthwiseConv2d: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const convInfo = conv_util.computeConv2DInfo(\n x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode,\n true /* depthwise */);\n\n const grad = (dy: Tensor4D) => {\n util.assert(\n tupleValuesAreOne(dilations),\n 'Error in gradient of depthwiseConv2d: dilation rates greater than ' +\n `1 are not yet supported. Got dilations '${dilations}'`);\n return {\n x: () => depthwiseConv2dDerInput(x4D.shape, dy, $filter, convInfo),\n $filter: () => depthwiseConv2dDerFilter(x4D, dy, $filter.shape, convInfo),\n };\n };\n\n const res = ENV.engine.runKernel(\n backend => backend.depthwiseConv2D(x4D, $filter, convInfo),\n {x: x4D, $filter}, grad);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * 2-D convolution with separable filters.\n *\n * Performs a depthwise convolution that acts separately on channels followed\n * by a pointwise convolution that mixes channels. Note that this is\n * separability between dimensions [1, 2] and 3, not spatial separability\n * between dimensions 1 and 2.\n *\n * See\n * [https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d](\n * https://www.tensorflow.org/api_docs/python/tf/nn/separable_conv2d)\n * for more details.\n *\n * @param x The input tensor, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is\n * assumed.\n * @param depthwiseFilter The depthwise filter tensor, rank 4, of shape\n * `[filterHeight, filterWidth, inChannels, channelMultiplier]`. This is\n * the filter used in the first step.\n * @param pointwiseFilter The pointwise filter tensor, rank 4, of shape\n * `[1, 1, inChannels * channelMultiplier, outChannels]`. This is\n * the filter used in the second step.\n * @param strides The strides of the convolution: `[strideHeight,\n * strideWidth]`. If strides is a single number, then `strideHeight ==\n * strideWidth`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`\n * in which we sample input values across the height and width dimensions\n * in atrous convolution. Defaults to `[1, 1]`. If `rate` is a single\n * number, then `dilationHeight == dilationWidth`. If it is greater than\n * 1, then all values of `strides` must be 1.\n * @param dataFormat: An optional string from: \"NHWC\", \"NCHW\". Defaults to\n * \"NHWC\". Specify the data format of the input and output data. With the\n * default format \"NHWC\", the data is stored in the order of: [batch,\n * height, width, channels]. Only \"NHWC\" is currently supported.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction separableConv2d_(\n x: T|TensorLike, depthwiseFilter: Tensor4D|TensorLike,\n pointwiseFilter: Tensor4D|TensorLike, strides: [number, number]|number,\n pad: 'valid'|'same', dilation: [number, number]|number = [1, 1],\n dataFormat: 'NHWC'|'NCHW' = 'NHWC'): T {\n const $x = convertToTensor(x, 'x', 'separableConv2d');\n const $depthwiseFilter =\n convertToTensor(depthwiseFilter, 'depthwiseFilter', 'separableConv2d');\n const $pointwiseFilter =\n convertToTensor(pointwiseFilter, 'pointwiseFilter', 'separableConv2d');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n\n if (dataFormat === 'NCHW') {\n throw new Error(\n 'separableConv2d currently does not support dataFormat NCHW; only ' +\n 'NHWC is supported');\n }\n\n util.assert(\n x4D.rank === 4,\n `Error in separableConv2d: input must be rank 4, but got ` +\n `rank ${x4D.rank}.`);\n util.assert(\n $depthwiseFilter.rank === 4,\n `Error in separableConv2d: depthwise filter must be rank 4, but got ` +\n `rank ${$depthwiseFilter.rank}.`);\n util.assert(\n $pointwiseFilter.rank === 4,\n `Error in separableConv2d: pointwise filter must be rank 4, but got ` +\n `rank ${$depthwiseFilter.rank}.`);\n util.assert(\n $pointwiseFilter.shape[0] === 1,\n `Error in separableConv2d: the first dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[0]}.`);\n util.assert(\n $pointwiseFilter.shape[1] === 1,\n `Error in separableConv2d: the second dimension of pointwise filter ` +\n ` must be 1, but got ${$pointwiseFilter.shape[1]}.`);\n\n const inChannels = $depthwiseFilter.shape[2];\n const channelMultiplier = $depthwiseFilter.shape[3];\n util.assert(\n $pointwiseFilter.shape[2] === inChannels * channelMultiplier,\n `Error in separableConv2d: the third dimension of pointwise filter ` +\n `must be ${inChannels * channelMultiplier}, ` +\n `but got ${$pointwiseFilter.shape[2]}.`);\n\n const depthwise = depthwiseConv2d(\n x4D, $depthwiseFilter, strides, pad, dataFormat, dilation);\n const pointwiseStride = 1;\n const res =\n conv2d(depthwise, $pointwiseFilter, pointwiseStride, 'valid', dataFormat);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\nfunction parseTupleParam(param: number|[number, number]): [number, number] {\n return typeof param === 'number' ? [param, param] : param;\n}\n\nfunction tupleValuesAreOne(param: number|[number, number]): boolean {\n const [dimA, dimB] = parseTupleParam(param);\n return dimA === 1 && dimB === 1;\n}\n\nfunction eitherStridesOrDilationsAreOne(\n strides: number|[number, number],\n dilations: number|[number, number]): boolean {\n return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations);\n}\n\nfunction depthwiseConv2dDerInput(\n xShape: [number, number, number, number]|[number, number, number], dy: T,\n filter: Tensor4D, convInfo: conv_util.Conv2DInfo): T {\n let dy4D = dy as Tensor4D;\n let reshapedTo4D = false;\n if (dy.rank === 3) {\n reshapedTo4D = true;\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n }\n const res = ENV.engine.runKernel(\n backend => backend.depthwiseConv2DDerInput(dy4D, filter, convInfo),\n {dy4D});\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\nfunction depthwiseConv2dDerFilter(\n x: T, dy: T, filterShape: [number, number, number, number],\n convInfo: conv_util.Conv2DInfo): Tensor4D {\n let x4D = x as Tensor4D;\n if (x.rank === 3) {\n x4D = x.as4D(1, x.shape[0], x.shape[1], x.shape[2]);\n }\n let dy4D = dy as Tensor4D;\n if (dy4D.rank === 3) {\n dy4D = dy.as4D(1, dy.shape[0], dy.shape[1], dy.shape[2]);\n }\n return ENV.engine.runKernel(\n backend => backend.depthwiseConv2DDerFilter(x4D, dy4D, convInfo),\n {x4D, dy4D});\n}\n\nexport const conv1d = op({conv1d_});\nexport const conv2d = op({conv2d_});\nexport const depthwiseConv2d = op({depthwiseConv2d_});\nexport const separableConv2d = op({separableConv2d_});\nexport const conv2dTranspose = op({conv2dTranspose_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\n\n/**\n * Computes the dot product of two matrices, A * B. These must be matrices.\n *\n * ```js\n * const a = tf.tensor2d([1, 2], [1, 2]);\n * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * a.matMul(b).print(); // or tf.matMul(a, b)\n * ```\n * @param a First matrix in dot product operation.\n * @param b Second matrix in dot product operation.\n * @param transposeA If true, `a` is transposed before multiplication.\n * @param transposeB If true, `b` is transposed before multiplication.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction matMul_(\n a: Tensor2D|TensorLike, b: Tensor2D|TensorLike, transposeA = false,\n transposeB = false): Tensor2D {\n const $a = convertToTensor(a, 'a', 'matMul');\n const $b = convertToTensor(b, 'b', 'matMul');\n\n const innerShapeA = transposeA ? $a.shape[0] : $a.shape[1];\n const innerShapeB = transposeB ? $b.shape[1] : $b.shape[0];\n\n util.assert(\n $a.rank === 2 && $b.rank === 2,\n `Error in matMul: inputs must be rank 2, got ranks ${$a.rank}` +\n ` and ${$b.rank}.`);\n\n util.assert(\n innerShapeA === innerShapeB,\n `Error in matMul: inner shapes (${innerShapeA}) and (` +\n `${innerShapeB}) of Tensors with shapes ${$a.shape} and ` +\n `${$b.shape} and transposeA=${transposeA}` +\n ` and transposeB=${transposeB} must match.`);\n\n const grad = (dy: Tensor2D) => {\n if (!transposeA && !transposeB) {\n return {\n $a: () => dy.matMul($b.toFloat(), false, true),\n $b: () => $a.toFloat().matMul(dy, true, false)\n };\n } else if (!transposeA && transposeB) {\n return {\n $a: () => dy.matMul($b.toFloat(), false, false),\n $b: () => dy.matMul($a.toFloat(), true, false)\n };\n } else if (transposeA && !transposeB) {\n return {\n $a: () => $b.toFloat().matMul(dy, false, true),\n $b: () => $a.toFloat().matMul(dy, false, false)\n };\n } else {\n return {\n $a: () => $b.toFloat().matMul(dy, true, true),\n $b: () => dy.matMul($a.toFloat(), true, true)\n };\n }\n };\n return ENV.engine.runKernel(\n backend => backend.matMul($a, $b, transposeA, transposeB), {$a, $b},\n grad);\n}\n\n/**\n * Computes the outer product of two vectors, v1 and v2.\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([3, 4, 5]);\n *\n * tf.outerProduct(a, b).print();\n * ```\n * @param v1 The first vector in the outer product operation.\n * @param v2 The second vector in the dot product operation.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction outerProduct_(\n v1: Tensor1D|TensorLike, v2: Tensor1D|TensorLike): Tensor2D {\n const $v1 = convertToTensor(v1, 'v1', 'outerProduct');\n const $v2 = convertToTensor(v2, 'v2', 'outerProduct');\n\n util.assert(\n $v1.rank === 1 && $v2.rank === 1,\n `Error in outerProduct: inputs must be rank 1, but got ranks ` +\n `${$v1.rank} and ${$v2.rank}.`);\n\n return $v1.as2D(-1, 1).matMul($v2.as2D(1, -1));\n}\n\n/**\n * Computes the dot product of two matrices and/or vectors, t1 and t2.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor2d([[1, 2], [3, 4]]);\n * const c = tf.tensor2d([[1, 2, 3], [4, 5, 6]]);\n *\n * a.dot(b).print(); // or tf.dot(a, b)\n * b.dot(a).print();\n * b.dot(c).print();\n * ```\n * @param t1 The first tensor in the dot operation.\n * @param t2 The second tensor in the dot operation.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction dot_(t1: Tensor|TensorLike, t2: Tensor|TensorLike): Tensor {\n const $t1 = convertToTensor(t1, 't1', 'dot');\n const $t2 = convertToTensor(t2, 't2', 'dot');\n util.assert(\n ($t1.rank === 1 || $t1.rank === 2) && ($t2.rank === 1 || $t2.rank === 2),\n `Error in dot: inputs must all be rank 1 or 2, but got ranks ` +\n `${$t1.rank} and ${$t2.rank}.`);\n\n const t1Inner = ($t1.rank === 1 ? $t1.size : $t1.shape[1]);\n const t2Inner = ($t2.rank === 1 ? $t2.size : $t2.shape[0]);\n\n util.assert(\n t1Inner === t2Inner,\n `Error in dot: inner dimensions of inputs must match, but got ` +\n `${t1Inner} and ${t2Inner}.`);\n\n if ($t1.rank === 1 && $t2.rank === 1) {\n return $t1.as2D(1, -1).matMul($t2.as2D(-1, 1)).asScalar();\n } else if ($t1.rank === 1 && $t2.rank === 2) {\n return $t1.as2D(1, -1).matMul($t2.as2D($t2.shape[0], $t2.shape[1])).as1D();\n } else if ($t1.rank === 2 && $t2.rank === 1) {\n return $t1.matMul($t2.as2D(-1, 1)).as1D();\n } else {\n return $t1.matMul($t2.as2D($t2.shape[0], $t2.shape[1]));\n }\n}\n\nexport const matMul = op({matMul_});\nexport const dot = op({dot_});\nexport const outerProduct = op({outerProduct_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {parseAxisParam} from './axis_util';\nimport {op} from './operation';\n\n/**\n * Reverses a `Tensor1D`.\n *\n * @param x The input tensor.\n */\nfunction reverse1d_(x: Tensor1D|TensorLike): Tensor1D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 1, `Error in reverse1D: x must be rank 1 but got\n rank ${$x.rank}.`);\n return reverse($x, 0);\n}\n\n/**\n * Reverses a `Tensor2D` along a specified axis\n *\n * @param x The input tensor.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\nfunction reverse2d_(x: Tensor2D|TensorLike, axis?: number|number[]): Tensor2D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 2, `Error in reverse2D: x must be rank 2 but got\n rank ${$x.rank}.`);\n return reverse($x, axis);\n}\n\n/**\n * Reverses a `Tensor3D` along a specified axis\n *\n * @param x The input tensor.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\nfunction reverse3d_(x: Tensor3D|TensorLike, axis?: number|number[]): Tensor3D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 3, `Error in reverse3D: x must be rank 3 but got\n rank ${$x.rank}.`);\n return reverse($x, axis);\n}\n\n/**\n * Reverses a `Tensor4D` along a specified axis\n *\n * @param x The input tensor.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\nfunction reverse4d_(x: Tensor4D|TensorLike, axis?: number|number[]): Tensor4D {\n const $x = convertToTensor(x, 'x', 'reverse');\n util.assert($x.rank === 4, `Error in reverse4D: x must be rank 4 but got\n rank ${$x.rank}.`);\n return reverse($x, axis);\n}\n\n/**\n * Reverses a `Tensor` along a specified axis.\n *\n * Also available are stricter rank-specific methods that assert that `x` is\n * of the given rank:\n * - `tf.reverse1d`\n * - `tf.reverse2d`\n * - `tf.reverse3d`\n * - `tf.reverse4d`\n *\n * Except `tf.reverse1d` (which does not have axis param), all methods have\n * same signature as this method.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.reverse().print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.reverse(axis).print();\n * ```\n * @param x The input tensor to be reversed.\n * @param axis The set of dimensions to reverse. Must be in the\n * range [-rank(x), rank(x)). Defaults to all axes.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction reverse_(\n x: T|TensorLike, axis?: number|number[]): T {\n const $x = convertToTensor(x, 'x', 'reverse');\n\n if ($x.rank === 0) {\n return $x.clone();\n }\n const axes = parseAxisParam(axis, $x.shape);\n const grad = (dy: T) => {\n return {$x: () => dy.reverse(axes)};\n };\n const res =\n ENV.engine.runKernel(backend => backend.reverse($x, axes), {$x}, grad);\n return res.reshapeAs($x);\n}\n\nexport const reverse = op({reverse_});\nexport const reverse1d = op({reverse1d_});\nexport const reverse2d = op({reverse2d_});\nexport const reverse3d = op({reverse3d_});\nexport const reverse4d = op({reverse4d_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as conv_util from './conv_util';\nimport {op} from './operation';\n\n/**\n * Computes the 2D max pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm.\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction maxPool_(\n x: T|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'maxPool');\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in maxPool: input must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in maxPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n const convInfo = conv_util.computePool2DInfo(\n x4D.shape, filterSize, strides, pad, dimRoundingMode);\n\n const grad = (dy: Tensor4D, saved: Tensor[]) => {\n const [y4D] = saved;\n return {\n x: () =>\n maxPoolBackprop(dy, x4D, y4D as Tensor4D, filterSize, strides, pad)\n };\n };\n\n const res = ENV.engine.runKernel(\n (backend, save) => save(backend.maxPool(x4D, convInfo)), {x: x4D}, grad);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the 2D average pooling of an image.\n *\n * @param x The input tensor, of rank 4 or rank 3 of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.\n * @param strides The strides of the pooling: `[strideHeight, strideWidth]`.\n * @param pad The type of padding algorithm:\n * - `same` and stride 1: output will be of same size as input,\n * regardless of filter size.\n * - `valid`: output will be smaller than input if filter is larger\n * than 1x1.\n * - For more info, see this guide:\n * [https://www.tensorflow.org/api_guides/python/nn#Convolution](\n * https://www.tensorflow.org/api_guides/python/nn#Convolution)\n * @param dimRoundingMode The rounding mode used when computing output\n * dimensions if pad is a number. If none is provided, it will not round\n * and error if the output is of fractional size.\n */\n/** @doc {heading: 'Operations', subheading: 'Convolution'} */\nfunction avgPool_(\n x: T|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): T {\n const $x = convertToTensor(x, 'x', 'avgPool');\n util.assert(\n $x.dtype === 'float32', 'The input dtype to avgPool must be float32');\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n util.assert(\n x4D.rank === 4,\n `Error in avgPool: x must be rank 4 but got rank ${x4D.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in avgPool: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const convInfo =\n conv_util.computePool2DInfo(x4D.shape, filterSize, strides, pad);\n\n const grad = (dy: Tensor4D) => {\n return {x: () => avgPoolBackprop(dy, x4D, filterSize, strides, pad)};\n };\n let res = ENV.engine.runKernel(\n backend => backend.avgPool(x4D, convInfo), {x: x4D}, grad);\n res = res.cast($x.dtype);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the backprop of a max pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The original input image, of rank 4, of shape\n * [batchSize, height, width, channels].\n * @param output The original output image, of rank 4, of shape\n * [batchSize, outHeight, outWidth, channels].\n * @param filterSize The filter size, a tuple [filterHeight, filterWidth].\n * @param strides The strides of the pooling: [strideHeight, strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. The\n * rounding mode used when computing output dimensions if pad is a\n * number. If none is provided, it will not round and error if the output\n * is of fractional size.\n */\nfunction maxPoolBackprop(\n dy: Tensor4D|TensorLike, input: Tensor4D|TensorLike,\n output: Tensor4D|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number,\n dimRoundingMode?: 'floor'|'round'|'ceil'): Tensor4D {\n const $dy = convertToTensor(dy, 'dy', 'maxPoolBackprop');\n const $input = convertToTensor(input, 'input', 'maxPoolBackprop');\n const $output = convertToTensor(output, 'output', 'maxPoolBackprop');\n util.assert(\n $input.rank === $dy.rank,\n `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n\n util.assert(\n $dy.rank === 4,\n `Error in maxPoolBackprop: dy must be rank 4 but got rank ` +\n `${$dy.rank}.`);\n util.assert(\n $input.rank === 4,\n `Error in maxPoolBackprop: input must be rank 4 but got rank ` +\n `${$input.rank}.`);\n if (dimRoundingMode != null) {\n util.assert(\n util.isInt(pad as number),\n `Error in maxPoolBackprop: pad must be an integer when using, ` +\n `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`);\n }\n\n const convInfo = conv_util.computePool2DInfo(\n $input.shape, filterSize, strides, pad, dimRoundingMode);\n const res = ENV.engine.runKernel(\n backend => backend.maxPoolBackprop($dy, $input, $output, convInfo),\n {$dy, $input});\n return res;\n}\n\n/**\n * Computes the backprop of an avg pool.\n *\n * @param dy The dy error, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param input The input image, of rank 4 or rank 3 of shape\n * [batchSize, height, width, channels]. If rank 3, batch of 1 is\n * assumed.\n * @param filterSize The filter size, a tuple [filterHeight, filterWidth].\n * @param strides The strides of the pooling: [strideHeight, strideWidth].\n * @param pad A string from: 'same', 'valid'. The type of padding algorithm\n * used in the forward prop of the op.\n */\nfunction avgPoolBackprop(\n dy: T|TensorLike, input: T|TensorLike, filterSize: [number, number]|number,\n strides: [number, number]|number, pad: 'valid'|'same'|number): T {\n const $dy = convertToTensor(dy, 'dy', 'avgPoolBackprop');\n const $input = convertToTensor(input, 'input', 'avgPoolBackprop');\n util.assert(\n $input.rank === $dy.rank,\n `Rank of input (${$input.rank}) does not match rank of dy (${$dy.rank})`);\n\n let input4D = $input as Tensor4D;\n let dy4D = $dy as Tensor4D;\n let reshapedTo4D = false;\n if ($input.rank === 3) {\n reshapedTo4D = true;\n input4D = $input.as4D(1, $input.shape[0], $input.shape[1], $input.shape[2]);\n dy4D = $dy.as4D(1, $dy.shape[0], $dy.shape[1], $dy.shape[2]);\n }\n\n util.assert(\n dy4D.rank === 4,\n `Error in avgPoolBackprop: dy must be rank 4 but got rank ` +\n `${dy4D.rank}.`);\n util.assert(\n input4D.rank === 4,\n `Error in avgPoolBackprop: input must be rank 4 but got rank ` +\n `${input4D.rank}.`);\n\n const convInfo =\n conv_util.computePool2DInfo(input4D.shape, filterSize, strides, pad);\n const res = ENV.engine.runKernel(\n backend => backend.avgPoolBackprop(dy4D, input4D, convInfo),\n {dy4D, input4D});\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\nexport const maxPool = op({maxPool_});\nexport const avgPool = op({avgPool_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {Rank, TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\nimport * as slice_util from './slice_util';\n\n/**\n * Extracts a 1D slice from 1D array starting at coordinates `begin` and is\n * of length `size`. See `slice` for details.\n */\nfunction slice1d_(\n x: Tensor1D|TensorLike, begin: number, size: number): Tensor1D {\n const $x = convertToTensor(x, 'x', 'slice1d');\n util.assert(\n $x.rank === 1,\n `slice1d expects a rank-1 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, [begin], [size]);\n}\n\n/**\n * Extracts a 2D slice from a 2D array starting at coordinates `begin` and\n * is of size `size`. See `slice` for details.\n */\nfunction slice2d_(\n x: Tensor2D|TensorLike, begin: [number, number],\n size: [number, number]): Tensor2D {\n const $x = convertToTensor(x, 'x', 'slice2d');\n util.assert(\n $x.rank === 2,\n `slice1d expects a rank-2 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, begin, size);\n}\n\n/**\n * Extracts a 3D slice from a 3D array starting at coordinates `begin` and\n * is of size `size`. See `slice` for details.\n */\nfunction slice3d_(\n x: Tensor3D|TensorLike, begin: [number, number, number],\n size: [number, number, number]): Tensor3D {\n const $x = convertToTensor(x, 'x', 'slice3d');\n util.assert(\n $x.rank === 3,\n `slice1d expects a rank-3 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, begin, size);\n}\n\n/**\n * Extracts a 4D slice from a 4D array starting at coordinates `begin` and\n * is of size `size`. See `slice` for details.\n */\nfunction slice4d_(\n x: Tensor4D|TensorLike, begin: [number, number, number, number],\n size: [number, number, number, number]): Tensor4D {\n const $x = convertToTensor(x, 'x', 'slice4d');\n util.assert(\n $x.rank === 4,\n `slice1d expects a rank-4 tensor, but got a rank-${$x.rank} tensor`);\n return slice($x, begin, size);\n}\n\n/**\n * Extracts a slice from a `Tensor` starting at coordinates `begin`\n * and is of size `size`.\n *\n * Also available are stricter rank-specific methods with the same signature\n * as this method that assert that `x` is of the given rank:\n * - `tf.slice1d`\n * - `tf.slice2d`\n * - `tf.slice3d`\n * - `tf.slice4d`\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.slice([1], [2]).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * x.slice([1, 0], [1, 2]).print();\n * ```\n * @param x The input `Tensor` to slice from.\n * @param begin The coordinates to start the slice from. The length can be\n * less than the rank of x - the rest of the axes will have implicit 0 as\n * start. Can also be a single number, in which case it specifies the\n * first axis.\n * @param size The size of the slice. The length can be less than the rank of\n * x - the rest of the axes will have implicit -1. A value of -1 requests\n * the rest of the dimensions in the axis. Can also be a single number,\n * in which case it specifies the size of the first axis.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction slice_>(\n x: T|TensorLike, begin: number|number[], size?: number|number[]): T {\n const $x = convertToTensor(x, 'x', 'slice');\n\n if ($x.rank === 0) {\n throw new Error('Slicing scalar is not possible');\n }\n // The following logic allows for more ergonomic calls.\n let begin_: number[];\n if (typeof begin === 'number') {\n begin_ = [begin, ...new Array($x.rank - 1).fill(0)];\n } else if (begin.length < $x.rank) {\n begin_ = begin.concat(new Array($x.rank - begin.length).fill(0));\n } else {\n begin_ = begin;\n }\n let size_: number[];\n if (size == null) {\n size_ = new Array($x.rank).fill(-1);\n } else if (typeof size === 'number') {\n size_ = [size, ...new Array($x.rank - 1).fill(-1)];\n } else if (size.length < $x.rank) {\n size_ = size.concat(new Array($x.rank - size.length).fill(-1));\n } else {\n size_ = size;\n }\n size_ = size_.map((d, i) => {\n if (d >= 0) {\n return d;\n } else {\n util.assert(d === -1, 'Bad value in size');\n return $x.shape[i] - begin_[i];\n }\n });\n slice_util.assertParamsValid($x, begin_, size_);\n const inputShape = $x.shape;\n const grad = (dy: T) => {\n // Create an Nx2 padding where the first column represents how many\n // zeros are prepended (at start) for each dimension, and the second\n // column indicates how many zeros are appended (at end).\n\n // The number of zeros to append is the shape of the input\n // elementwise-subtracted by both the begin vector and sizes vector.\n const paddings: Array<[number, number]> = [];\n for (let i = 0; i < dy.rank; i++) {\n paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]);\n }\n return {$x: () => dy.pad(paddings)};\n };\n return ENV.engine.runKernel(\n backend => backend.slice($x, begin_, size_), {$x}, grad) as T;\n}\n\nexport const slice = op({slice_});\nexport const slice1d = op({slice1d_});\nexport const slice2d = op({slice2d_});\nexport const slice3d = op({slice3d_});\nexport const slice4d = op({slice4d_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Environment} from './environment';\nexport {customGrad, grad, grads, valueAndGrad, valueAndGrads, variableGrads} from './gradients';\n\nexport const tidy = Environment.tidy;\nexport const keep = Environment.keep;\nexport const dispose = Environment.dispose;\nexport const time = Environment.time;\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {customGrad} from '../globals';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as axis_util from './axis_util';\nimport {op} from './operation';\nimport {ones, scalar} from './tensor_ops';\n\n/**\n * Computes the log(sum(exp(elements across the reduction dimensions)).\n *\n * Reduces the input along the dimensions given in `axis`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.logSumExp().print(); // or tf.logSumExp(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)\n * ```\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. If null (the default),\n * reduces all dimensions.\n * @param keepDims If true, retains reduced dimensions with length\n * of 1. Defaults to false.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction logSumExp_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n const $x = convertToTensor(x, 'x', 'logSumExp');\n\n const axes = axis_util.parseAxisParam(axis, $x.shape);\n const xMax = $x.max(axes, true /* keepDims */);\n const a = $x.sub(xMax);\n const b = a.exp();\n const c = b.sum(axes);\n const d = c.log();\n const res = xMax.reshape(d.shape).add(d);\n\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, axes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the sum of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If axes has no entries, all dimensions are reduced, and a `Tensor` with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.sum().print(); // or tf.sum(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.sum(axis).print(); // or tf.sum(x, axis)\n * ```\n *\n * @param x The input tensor to compute the sum over. If the dtype is `bool`\n * it will be converted to `int32` and the output dtype will be `int32`.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction sum_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'sum');\n\n if ($x.dtype === 'bool') {\n $x = $x.toInt();\n }\n const axes = axis_util.parseAxisParam(axis, $x.shape);\n\n // Use a custom gradient to bypass 2 gradient backprops since sum is used\n // extremely often.\n const customOp = customGrad(x => {\n const permutation = axis_util.getAxesPermutation(axes, x.rank);\n let reductionAxes = axes;\n let permutedX = x;\n if (permutation != null) {\n permutedX = x.transpose(permutation);\n reductionAxes = axis_util.getInnerMostAxes(reductionAxes.length, x.rank);\n }\n let value = ENV.engine.runKernel(\n backend => backend.sum(permutedX, reductionAxes), {permutedX});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(value.shape, axes);\n value = value.reshape(newShape);\n }\n\n const gradFunc = (dy: Tensor) => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = dy.reshape(expandedDyShape);\n const derX = expandedDy.mul(ones(x.shape, 'float32'));\n return derX;\n };\n return {value, gradFunc};\n });\n\n return customOp($x) as T;\n}\n\n/**\n * Computes the mean of elements across dimensions of a `Tensor`.\n *\n * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is\n * true, the rank of the `Tensor` is reduced by 1 for each entry in `axis`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axis` has no entries, all dimensions are reduced, and a `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.mean().print(); // or tf.mean(a)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.mean(axis).print(); // or tf.mean(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction mean_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n const $x = convertToTensor(x, 'x', 'mean');\n\n const axes = axis_util.parseAxisParam(axis, $x.shape);\n const shapes = axis_util.computeOutAndReduceShapes($x.shape, axes);\n const reduceShape = shapes[1];\n const reduceSize = util.sizeFromShape(reduceShape);\n\n // Use a custom gradient to bypass 2 gradient backprops since mean is used\n // extremely often.\n const customOp = customGrad(x => {\n const reduceSizeScalar = scalar(reduceSize);\n // Cast if needed.\n const xReduce =\n reduceSizeScalar.dtype === x.dtype ? x : x.cast(reduceSizeScalar.dtype);\n const res = xReduce.div(reduceSizeScalar);\n const value = res.sum(axis, keepDims);\n\n const gradFunc = (dy: Tensor) => {\n const expandedDyShape = x.shape.slice();\n axes.forEach(axis => {\n expandedDyShape[axis] = 1;\n });\n const expandedDy = dy.reshape(expandedDyShape);\n const derX =\n expandedDy.mul(ones(x.shape, 'float32')).div(reduceSizeScalar);\n return derX;\n };\n return {value, gradFunc};\n });\n\n return customOp($x) as T;\n}\n\n/**\n * Computes the minimum value from the input.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the array is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an array with a\n * single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.min().print(); // or tf.min(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.min(axis).print(); // or tf.min(x, axis)\n * ```\n *\n * @param x The input Tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction min_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'min');\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.min($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the maximum of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.max().print(); // or tf.max(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n *\n * const axis = 1;\n * x.max(axis).print(); // or tf.max(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction max_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'max');\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.max($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Returns the indices of the minimum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMin().print(); // or tf.argMin(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMin(axis).print(); // or tf.argMin(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n *\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction argMin_(x: Tensor|TensorLike, axis = 0): T {\n let $x = convertToTensor(x, 'x', 'argMin');\n\n if (axis == null) {\n axis = 0;\n }\n let axes = axis_util.parseAxisParam(axis, $x.shape);\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n return ENV.engine.runKernel(backend => backend.argMin($x, axes[0]), {$x}) as\n T;\n}\n\n/**\n * Returns the indices of the maximum values along an `axis`.\n *\n * The result has the same shape as `input` with the dimension along `axis`\n * removed.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3]);\n *\n * x.argMax().print(); // or tf.argMax(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);\n *\n * const axis = 1;\n * x.argMax(axis).print(); // or tf.argMax(x, axis)\n * ```\n *\n * @param x The input tensor.\n * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension).\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction argMax_(x: Tensor|TensorLike, axis = 0): T {\n let $x = convertToTensor(x, 'x', 'argMax');\n\n if (axis == null) {\n axis = 0;\n }\n let axes = axis_util.parseAxisParam(axis, $x.shape);\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n return ENV.engine.runKernel(backend => backend.argMax($x, axes[0]), {$x}) as\n T;\n}\n\n/**\n * Computes the logical and of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1]);\n *\n * x.all().print(); // or tf.all(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.all(axis).print(); // or tf.all(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction all_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'all', 'bool');\n util.assert(\n $x.dtype === 'bool',\n `Error Tensor must be of type bool. Got: ${$x.dtype}`);\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.all($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Computes the logical or of elements across dimensions of a `Tensor`.\n *\n * Reduces the input along the dimensions given in `axes`. Unless `keepDims`\n * is true, the rank of the `Tensor` is reduced by 1 for each entry in `axes`.\n * If `keepDims` is true, the reduced dimensions are retained with length 1.\n * If `axes` has no entries, all dimensions are reduced, and an `Tensor` with\n * a single element is returned.\n *\n * ```js\n * const x = tf.tensor1d([1, 1, 1]);\n *\n * x.any().print(); // or tf.any(x)\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool');\n *\n * const axis = 1;\n * x.any(axis).print(); // or tf.any(x, axis)\n * ```\n *\n * @param x The input tensor. Must be of dtype bool.\n * @param axis The dimension(s) to reduce. By default it reduces\n * all dimensions.\n * @param keepDims If true, retains reduced dimensions with size 1.\n */\n/** @doc {heading: 'Operations', subheading: 'Reduction'} */\nfunction any_(\n x: Tensor|TensorLike, axis: number|number[] = null, keepDims = false): T {\n let $x = convertToTensor(x, 'x', 'any', 'bool');\n util.assert(\n $x.dtype === 'bool',\n `Error Tensor must be of type bool. Got: ${$x.dtype}`);\n\n const origAxes = axis_util.parseAxisParam(axis, $x.shape);\n let axes = origAxes;\n const permutedAxes = axis_util.getAxesPermutation(axes, $x.rank);\n if (permutedAxes != null) {\n $x = $x.transpose(permutedAxes);\n axes = axis_util.getInnerMostAxes(axes.length, $x.rank);\n }\n const res = ENV.engine.runKernel(backend => backend.any($x, axes), {$x});\n if (keepDims) {\n const newShape = axis_util.expandShapeToKeepDim(res.shape, origAxes);\n return res.reshape(newShape) as T;\n }\n return res as T;\n}\n\n/**\n * Calculates the mean and variance of `x`. The mean and variance are\n * calculated by aggregating the contents of `x` across `axes`. If `x` is\n * 1-D and `axes = [0]` this is just the mean and variance of a vector.\n *\n * @param x The input tensor.\n * @param axis The dimension(s) along with to compute mean and\n * variance. By default it reduces all dimensions.\n * @param keepDims If true, the moments have the same dimensionality as the\n * input.\n * @return An object with two keys: `mean` and `variance`.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction moments_(\n x: Tensor|TensorLike, axis: number|number[] = null,\n keepDims = false): {mean: Tensor, variance: Tensor} {\n x = convertToTensor(x, 'x', 'moments');\n const axes = axis_util.parseAxisParam(axis, x.shape);\n const mean = x.mean(axes, keepDims);\n let keepDimsShape = mean.shape;\n if (!keepDims) {\n keepDimsShape = axis_util.expandShapeToKeepDim(mean.shape, axes);\n }\n const devSquared = x.toFloat().sub(mean.reshape(keepDimsShape)).square();\n const variance = devSquared.mean(axes, keepDims);\n return {mean, variance};\n}\n\nexport const all = op({all_});\n// tslint:disable-next-line:variable-name\nexport const any = op({any_});\nexport const argMax = op({argMax_});\nexport const argMin = op({argMin_});\nexport const logSumExp = op({logSumExp_});\nexport const max = op({max_});\nexport const mean = op({mean_});\nexport const min = op({min_});\nexport const moments = op({moments_});\nexport const sum = op({sum_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {assertTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assertShapesMatch} from '../util';\nimport {assertAndGetBroadcastShape} from './broadcast_util';\nimport {op} from './operation';\n\n/**\n * Returns the truth value of (a != b) element-wise. Supports broadcasting.\n *\n * We also expose `notEqualStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([0, 2, 3]);\n *\n * a.notEqual(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction notEqual_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'notEqual');\n const $b = convertToTensor(b, 'b', 'notEqual');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n return ENV.engine.runKernel(backend => backend.notEqual($a, $b), {$a, $b}) as\n T;\n}\n\n/**\n * Strict version of `notEqual` that forces `a` and `b` to be of the same\n * shape.\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same shape and dtype as\n * `a`.\n */\nfunction notEqualStrict_(\n a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'notEqualStrict');\n const $b = convertToTensor(b, 'b', 'notEqualStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in notEqualStrict: ');\n return $a.notEqual($b);\n}\n\n/**\n * Returns the truth value of (a < b) element-wise. Supports broadcasting.\n *\n * We also expose `lessStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.less(b).print();\n * ```\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction less_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'less');\n const $b = convertToTensor(b, 'b', 'less');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.less($a, $b), {$a, $b}) as T;\n}\n\n/**\n * Strict version of `less` that forces `a` and `b` to be of the same\n * shape.\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same shape and dtype as\n * `a`.\n */\nfunction lessStrict_(a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'lessStrict');\n const $b = convertToTensor(b, 'b', 'lessStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in lessStrict: ');\n return $a.less($b);\n}\n\n/**\n * Returns the truth value of (a == b) element-wise. Supports broadcasting.\n *\n * We also expose `equalStrict` which has the same signature as this op\n * and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.equal(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction equal_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'equal');\n const $b = convertToTensor(b, 'b', 'equal');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.equal($a, $b), {$a, $b}) as T;\n}\n\nfunction equalStrict_(a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'equalStrict');\n const $b = convertToTensor(b, 'b', 'equalStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in equalStrict: ');\n return $a.equal($b);\n}\n\n/**\n * Returns the truth value of (a <= b) element-wise. Supports broadcasting.\n *\n * We also expose `lessEqualStrict` which has the same signature as this op\n * and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.lessEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction lessEqual_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'lessEqual');\n const $b = convertToTensor(b, 'b', 'lessEqual');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.lessEqual($a, $b), {$a, $b}) as\n T;\n}\n\nfunction lessEqualStrict_(\n a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'lessEqualStrict');\n const $b = convertToTensor(b, 'b', 'lessEqualStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in lessEqualStrict: ');\n return $a.lessEqual($b);\n}\n\n/**\n * Returns the truth value of (a > b) element-wise. Supports broadcasting.\n *\n * We also expose `greaterStrict` which has the same signature as this\n * op and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greater(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction greater_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greater');\n const $b = convertToTensor(b, 'b', 'greater');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.greater($a, $b), {$a, $b}) as\n T;\n}\n\nfunction greaterStrict_(a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greaterStrict');\n const $b = convertToTensor(b, 'b', 'greaterStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in greaterStrict: ');\n return $a.greater($b);\n}\n\n/**\n * Returns the truth value of (a >= b) element-wise. Supports broadcasting.\n *\n * We also expose `greaterEqualStrict` which has the same signature as this\n * op and asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3]);\n * const b = tf.tensor1d([2, 2, 2]);\n *\n * a.greaterEqual(b).print();\n * ```\n *\n * @param a The first input tensor.\n * @param b The second input tensor. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction greaterEqual_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greaterEqual');\n const $b = convertToTensor(b, 'b', 'greaterEqual');\n assertTypesMatch($a, $b);\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(\n backend => backend.greaterEqual($a, $b), {$a, $b}) as T;\n}\n\nfunction greaterEqualStrict_(\n a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'greaterEqualStrict');\n const $b = convertToTensor(b, 'b', 'greaterEqualStrict');\n assertShapesMatch($a.shape, $b.shape, 'Error in greaterEqualStrict: ');\n return $a.greaterEqual($b);\n}\n\nexport const equal = op({equal_});\nexport const equalStrict = op({equalStrict_});\nexport const greater = op({greater_});\nexport const greaterEqual = op({greaterEqual_});\nexport const greaterEqualStrict = op({greaterEqualStrict_});\nexport const greaterStrict = op({greaterStrict_});\nexport const less = op({less_});\nexport const lessEqual = op({lessEqual_});\nexport const lessEqualStrict = op({lessEqualStrict_});\nexport const lessStrict = op({lessStrict_});\nexport const notEqual = op({notEqual_});\nexport const notEqualStrict = op({notEqualStrict_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {KernelBackend} from '../kernels/backend';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {assertTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike, upcastType} from '../types';\nimport * as util from '../util';\nimport * as broadcast_util from './broadcast_util';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\nimport {neg} from './unary_ops';\n\n/**\n * Adds two `Tensor`s element-wise, A + B. Supports broadcasting.\n *\n * We also expose `addStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n *\n * ```js\n * // Broadcast add a with b.\n * const a = tf.scalar(5);\n * const b = tf.tensor1d([10, 20, 30, 40]);\n *\n * a.add(b).print(); // or tf.add(a, b)\n * ```\n * @param a The first `Tensor` to add.\n * @param b The second `Tensor` to add. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction add_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'add');\n const $b = convertToTensor(b, 'b', 'add');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($b.shape);\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(backend => backend.add($a, $b), {$a, $b}, der) as\n T;\n}\n\n/**\n * Adds a list of `Tensor`s element-wise, each with the same shape and dtype.\n *\n * ```js\n * const a = tf.tensor1d([1, 2]);\n * const b = tf.tensor1d([3, 4]);\n * const c = tf.tensor1d([5, 6]);\n *\n * tf.addN([a, b, c]).print();\n * ```\n * @param tensors A list of tensors with the same shape and dtype.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction addN_(tensors: Array): T {\n util.assert(\n Array.isArray(tensors),\n () => 'The param passed to tf.addN() must be a list of tensors');\n util.assert(\n tensors.length >= 1,\n () => `Must pass at least one tensor to tf.addN(), but got ` +\n `${tensors.length}`);\n const $tensors =\n tensors.map((t, i) => convertToTensor(t, `tensors${i}`, 'addN'));\n const firstTensor = $tensors[0];\n $tensors.forEach(t => {\n if (t.dtype !== firstTensor.dtype) {\n throw new Error(\n 'All tensors passed to tf.addN() must have the same dtype');\n }\n });\n $tensors.forEach(t => {\n if (!util.arraysEqual(t.shape, firstTensor.shape)) {\n throw new Error(\n 'All tensors passed to tf.addN() must have the same shape');\n }\n });\n\n const der = (dy: T) => {\n const ders: {[key: string]: () => Tensor} = {};\n $tensors.forEach((t, i) => {\n ders[i] = () => dy.clone();\n });\n return ders;\n };\n const inputs: NamedTensorMap = $tensors as {} as NamedTensorMap;\n return ENV.engine.runKernel(backend => backend.addN($tensors), inputs, der);\n}\n\n/**\n * Adds two `Tensor`s element-wise, A + B.\n *\n * Inputs must be the same shape. For broadcasting support, use add() instead.\n *\n * @param a The first Tensor to add element-wise.\n * @param b The second Tensor to add element-wise.\n */\nfunction addStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in addStrict: ');\n return a.add(b);\n}\n\n/**\n * Subtracts two `Tensor`s element-wise, A - B. Supports broadcasting.\n *\n * We also expose `subStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n *\n * ```js\n * // Broadcast subtract a with b.\n * const a = tf.tensor1d([10, 20, 30, 40]);\n * const b = tf.scalar(5);\n *\n * a.sub(b).print(); // or tf.sub(a, b)\n * ```\n * @param a The first `Tensor` to subtract from.\n * @param b The second `Tensor` to be subtracted. Must have the same dtype as\n * `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction sub_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'sub');\n const $b = convertToTensor(b, 'b', 'sub');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($a.shape);\n };\n const derB = () => {\n let res = dy;\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.neg().reshape($b.shape);\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.subtract($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Subtracts two `Tensor`s element-wise, A - B. Inputs must\n * be the same shape.\n *\n * For broadcasting support, use sub() instead.\n *\n * @param a The first Tensor to subtract element-wise.\n * @param b The second Tensor to subtract element-wise.\n */\nfunction subStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in subStrict: ');\n return a.sub(b);\n}\n\n/**\n * Computes the power of one `Tensor` to another. Supports broadcasting.\n *\n * Given a `Tensor` x and a `Tensor` y, this operation computes x^y for\n * corresponding elements in x and y. The result's dtype will be the upcasted\n * type of the `base` and `exp` dtypes.\n *\n * ```js\n * const a = tf.tensor([[2, 3], [4, 5]])\n * const b = tf.tensor([[1, 2], [3, 0]]).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n *\n * ```js\n * const a = tf.tensor([[1, 2], [3, 4]])\n * const b = tf.tensor(2).toInt();\n *\n * a.pow(b).print(); // or tf.pow(a, b)\n * ```\n * We also expose `powStrict` which has the same signature as this op and\n * asserts that `base` and `exp` are the same shape (does not broadcast).\n *\n * @param base The base `Tensor` to pow element-wise.\n * @param exp The exponent `Tensor` to pow element-wise.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction pow_(base: T|TensorLike, exp: Tensor|TensorLike): T {\n const $base = convertToTensor(base, 'base', 'pow');\n const $exp = convertToTensor(exp, 'exp', 'pow');\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($base.shape, $exp.shape);\n base = $base.cast(upcastType($base.dtype, $exp.dtype));\n exp = $exp.cast(upcastType($base.dtype, $exp.dtype));\n const grad = (dy: Tensor, saved: Tensor[]) => {\n const [y] = saved;\n const derBase = () => {\n let res = dy.mul($exp.toFloat().mul(y.div($base)));\n const reduceAxes = broadcast_util.getReductionAxes($base.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($base.shape) as T;\n };\n const derExp = () => {\n let res = dy.mul(y.mul($base.log()).toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($exp.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($exp.shape);\n };\n return {$base: derBase, $exp: derExp};\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.pow($base, $exp)), {$base, $exp},\n grad) as T;\n}\n\n/**\n * Computes the power of one `Tensor` to another. Inputs must\n * be the same shape.\n *\n * For broadcasting support, use pow() instead.\n *\n * @param base The base tensor to pow element-wise.\n * @param exp The exponent tensor to pow element-wise.\n */\nfunction powStrict_(base: T, exp: Tensor): T {\n util.assertShapesMatch(base.shape, exp.shape, 'Error in powStrict: ');\n return base.pow(exp);\n}\n\n/**\n * Multiplies two `Tensor`s element-wise, A * B. Supports broadcasting.\n *\n * We also expose `mulStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.tensor1d([2, 3, 4, 5]);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n *\n * ```js\n * // Broadcast mul a with b.\n * const a = tf.tensor1d([1, 2, 3, 4]);\n * const b = tf.scalar(5);\n *\n * a.mul(b).print(); // or tf.mul(a, b)\n * ```\n * @param a The first tensor to multiply.\n * @param b The second tensor to multiply. Must have the same dtype as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction mul_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'mul');\n const $b = convertToTensor(b, 'b', 'mul');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n const res = dy.mul($b.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($a.shape);\n }\n return res;\n };\n const derB = () => {\n const res = dy.mul($a.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($b.shape);\n }\n return res;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.multiply($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Multiplies two `Tensor`s element-wise, A * B.\n *\n * Inputs must be the same shape. For broadcasting support, use mul().\n *\n * @param a The first tensor to multiply.\n * @param b The first tensor to multiply. Must have the same\n * dtype as `a`.\n */\nfunction mulStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in multiplyStrict: ');\n return a.mul(b) as T;\n}\n\n/**\n * Divides two `Tensor`s element-wise, A / B. Supports broadcasting.\n *\n * We also expose `divStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.div(b).print(); // or tf.div(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction div_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'div');\n const $b = convertToTensor(b, 'b', 'div');\n assertTypesMatch($a, $b);\n\n let forwardFunc: (backend: KernelBackend) => Tensor;\n if ($a.dtype === 'int32' && $b.dtype === 'int32') {\n return floorDiv($a, $b);\n } else {\n forwardFunc = (backend: KernelBackend) => backend.realDivide($a, $b);\n }\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => {\n const res = dy.div($b.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = dy.mul($a.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes).reshape($b.shape);\n }\n const tmp = $b.square() as Tensor;\n return res.div(tmp.toFloat()).neg() as Tensor;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(forwardFunc, {$a, $b}, der) as T;\n}\n\n/**\n * Divides two `Tensor`s element-wise, A / B. Supports broadcasting.\n * The result is rounded with floor function.\n *\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 9, 16]);\n * const b = tf.tensor1d([1, 2, 3, 4]);\n *\n * a.floorDiv(b).print(); // or tf.div(a, b)\n * ```\n *\n * ```js\n * // Broadcast div a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(2);\n *\n * a.floorDiv(b).print(); // or tf.floorDiv(a, b)\n * ```\n *\n * @param a The first tensor as the numerator.\n * @param b The second tensor as the denominator. Must have the same dtype as\n * `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction floorDiv_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'floorDiv');\n const $b = convertToTensor(b, 'b', 'floorDiv');\n assertTypesMatch($a, $b);\n\n const forwardFunc = (backend: KernelBackend) => backend.floorDiv($a, $b);\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => {\n const res = dy.div($b.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($a.shape);\n }\n return res;\n };\n const derB = () => {\n let res = dy.mul($a.toFloat());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes).reshape($b.shape);\n }\n const tmp = $b.square() as Tensor;\n return res.div(tmp.toFloat()).neg() as Tensor;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(forwardFunc, {$a, $b}, der) as T;\n}\n\n/**\n * Divides two `Tensor`s element-wise, A / B. Inputs must\n * be the same shape.\n *\n * @param a The first tensor as the numerator for element-wise division.\n * @param b The second tensor as the denominator for element-wise division.\n */\nfunction divStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in divideStrict: ');\n return a.div(b) as T;\n}\n\n/**\n * Returns the mod of a and b element-wise.\n * `floor(x / y) * y + mod(x, y) = x`\n * Supports broadcasting.\n *\n * We also expose `modStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * ```js\n * // Broadcast a mod b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.mod(b).print(); // or tf.mod(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction mod_(a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'mod');\n const $b = convertToTensor(b, 'b', 'mod');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => {\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n return dy.sum(reduceAxes).reshape($a.shape);\n }\n return dy;\n };\n const derB = () => {\n const res = dy.mul($a.div($b).floor().neg());\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n return res.sum(reduceAxes).reshape($b.shape);\n }\n return res;\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(backend => backend.mod($a, $b), {$a, $b}, der) as\n T;\n}\n\n/**\n * Returns the mod of a and b (`a < b ? a : b`) element-wise. Inputs must\n * be the same shape. For broadcasting support, use mod().\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n */\nfunction modStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in modStrict: ');\n return a.mod(b);\n}\n\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `minimumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * ```js\n * // Broadcast minimum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.minimum(b).print(); // or tf.minimum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction minimum_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n let $a = convertToTensor(a, 'a', 'minimum');\n let $b = convertToTensor(b, 'b', 'minimum');\n assertTypesMatch($a, $b);\n\n if ($a.dtype === 'bool') {\n $a = $a.toInt();\n }\n if ($b.dtype === 'bool') {\n $b = $b.toInt();\n }\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => dy.mul($a.lessEqual($b).toFloat());\n const derB = () => dy.mul($a.greater($b).toFloat());\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.minimum($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Returns the min of a and b (`a < b ? a : b`) element-wise. Inputs must\n * be the same shape. For broadcasting support, use minimum().\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n */\nfunction minimumStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: ');\n return a.minimum(b);\n}\n\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise.\n * Supports broadcasting.\n *\n * We also expose `maximumStrict` which has the same signature as this op and\n * asserts that `a` and `b` are the same shape (does not broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * ```js\n * // Broadcast maximum a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.maximum(b).print(); // or tf.maximum(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction maximum_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n let $a = convertToTensor(a, 'a', 'maximum');\n let $b = convertToTensor(b, 'b', 'maximum');\n assertTypesMatch($a, $b);\n\n if ($a.dtype === 'bool') {\n $a = $a.toInt();\n }\n if ($b.dtype === 'bool') {\n $b = $b.toInt();\n }\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const derA = () => dy.mul($a.greaterEqual($b).toFloat());\n const derB = () => dy.mul($a.less($b).toFloat());\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.maximum($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Returns the max of a and b (`a > b ? a : b`) element-wise. Inputs must\n * be the same shape. For broadcasting support, use maximum().\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n */\nfunction maximumStrict_(a: T, b: T): T {\n util.assertShapesMatch(a.shape, b.shape, 'Error in minimumStrict: ');\n return a.maximum(b);\n}\n\n/**\n * Returns (a - b) * (a - b) element-wise.\n * Supports broadcasting.\n *\n * We also expose `squaredDifferenceStrict` which has the same signature as\n * this op and asserts that `a` and `b` are the same shape (does not\n * broadcast).\n *\n * ```js\n * const a = tf.tensor1d([1, 4, 3, 16]);\n * const b = tf.tensor1d([1, 2, 9, 4]);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * ```js\n * // Broadcast squared difference a with b.\n * const a = tf.tensor1d([2, 4, 6, 8]);\n * const b = tf.scalar(5);\n *\n * a.squaredDifference(b).print(); // or tf.squaredDifference(a, b)\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */\nfunction squaredDifference_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'squaredDifference');\n const $b = convertToTensor(b, 'b', 'squaredDifference');\n assertTypesMatch($a, $b);\n\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n const der = (dy: Tensor) => {\n const two = scalar(2);\n const derA = () => dy.mul($a.sub($b).mul(two));\n const derB = () => dy.mul($b.sub($a).mul(two));\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.squaredDifference($a, $b), {$a, $b}, der) as T;\n}\n\n/**\n * Returns (a - b) * (a - b) element-wise.\n *\n * Inputs must be the same shape. For broadcasting support, use\n * squaredDifference() instead.\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same type as `a`.\n */\nfunction squaredDifferenceStrict_(a: T, b: T): T {\n util.assertShapesMatch(\n a.shape, b.shape, 'Error in squaredDifferenceStrict: ');\n return a.squaredDifference(b);\n}\n\n/**\n * Computes arctangent of `Tensor`s a / b element-wise: `atan2(a, b)`.\n * Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]);\n * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]);\n *\n * tf.atan2(a, b).print()\n * ```\n *\n * @param a The first tensor.\n * @param b The second tensor. Must have the same dtype as `a`.\n *\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction atan2_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'atan2');\n const $b = convertToTensor(b, 'b', 'atan2');\n assertTypesMatch($a, $b);\n\n const outShape =\n broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape);\n\n const der = (dy: Tensor) => {\n const derA = () => {\n const d = add($a.square(), $b.square());\n let res = dy.mul($b.div(d));\n const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($a.shape);\n };\n const derB = () => {\n const d = add($a.square(), $b.square()) as T;\n let res = neg(dy.mul($a.div(d)));\n const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape);\n if (reduceAxes.length > 0) {\n res = res.sum(reduceAxes);\n }\n return res.reshape($b.shape);\n };\n return {$a: derA, $b: derB};\n };\n return ENV.engine.runKernel(\n backend => backend.atan2($a, $b), {$a, $b}, der) as T;\n}\n\nexport const add = op({add_});\nexport const addN = op({addN_});\nexport const addStrict = op({addStrict_});\nexport const atan2 = op({atan2_});\nexport const div = op({div_});\nexport const divStrict = op({divStrict_});\nexport const floorDiv = op({floorDiv_});\nexport const maximum = op({maximum_});\nexport const maximumStrict = op({maximumStrict_});\nexport const minimum = op({minimum_});\nexport const minimumStrict = op({minimumStrict_});\nexport const mod = op({mod_});\nexport const modStrict = op({modStrict_});\nexport const mul = op({mul_});\nexport const mulStrict = op({mulStrict_});\nexport const pow = op({pow_});\nexport const powStrict = op({powStrict_});\nexport const squaredDifference = op({squaredDifference_});\nexport const squaredDifferenceStrict = op({squaredDifferenceStrict_});\nexport const sub = op({sub_});\nexport const subStrict = op({subStrict_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {whereImpl} from '../kernels/where_impl';\nimport {Tensor, Tensor2D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assert, assertShapesMatch} from '../util';\nimport {assertAndGetBroadcastShape} from './broadcast_util';\nimport {op} from './operation';\nimport {zerosLike} from './tensor_ops';\n\n/**\n * Returns the truth value of `NOT x` element-wise.\n *\n * ```js\n * const a = tf.tensor1d([false, true], 'bool');\n *\n * a.logicalNot().print();\n * ```\n *\n * @param x The input tensor. Must be of dtype 'bool'.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalNot_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'logicalNot', 'bool');\n assert($x.dtype === 'bool', 'Error Array must be of type bool.');\n\n return ENV.engine.runKernel(backend => backend.logicalNot($x), {$x});\n}\n\n/**\n * Returns the truth value of a AND b element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalAnd(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalAnd_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'logicalAnd', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalAnd', 'bool');\n assert(\n $a.dtype === 'bool' && $b.dtype === 'bool',\n 'Error Array must be of type bool.');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(\n backend => backend.logicalAnd($a, $b), {$a, $b}) as T;\n}\n\n/**\n * Returns the truth value of `a OR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalOr(b).print();\n * ```\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalOr_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'logicalOr', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalOr', 'bool');\n assert(\n $a.dtype === 'bool' && $b.dtype === 'bool',\n 'Error Array must be of type bool.');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n return ENV.engine.runKernel(backend => backend.logicalOr($a, $b), {$a, $b}) as\n T;\n}\n\n/**\n * Returns the truth value of `a XOR b` element-wise. Supports broadcasting.\n *\n * ```js\n * const a = tf.tensor1d([false, false, true, true], 'bool');\n * const b = tf.tensor1d([false, true, false, true], 'bool');\n *\n * a.logicalXor(b).print();\n * ```\n *\n * @param a The first input tensor. Must be of dtype bool.\n * @param b The second input tensor. Must be of dtype bool.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction logicalXor_(\n a: Tensor|TensorLike, b: Tensor|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'logicalXor', 'bool');\n const $b = convertToTensor(b, 'b', 'logicalXor', 'bool');\n assert(\n $a.dtype === 'bool' && $b.dtype === 'bool',\n 'Error Array must be of type bool.');\n assertAndGetBroadcastShape($a.shape, $b.shape);\n\n // x ^ y = (x | y) & ~(x & y)\n return logicalOr(a, b).logicalAnd(logicalAnd(a, b).logicalNot()) as T;\n}\n\n/**\n * Returns the elements, either `a` or `b` depending on the `condition`.\n *\n * If the condition is true, select from `a`, otherwise select from `b`.\n *\n * ```js\n * const cond = tf.tensor1d([false, false, true], 'bool');\n * const a = tf.tensor1d([1 , 2, 3]);\n * const b = tf.tensor1d([-1, -2, -3]);\n *\n * a.where(cond, b).print();\n * ```\n *\n * @param condition The input condition. Must be of dtype bool.\n * @param a If `condition` is rank 1, `a` may have a higher rank but\n * its first dimension must match the size of `condition`.\n * @param b A tensor with the same shape and type as `a`.\n */\n/** @doc {heading: 'Operations', subheading: 'Logical'} */\nfunction where_(\n condition: Tensor|TensorLike, a: T|TensorLike, b: T|TensorLike): T {\n const $a = convertToTensor(a, 'a', 'where');\n const $b = convertToTensor(b, 'b', 'where');\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n\n assert($condition.dtype === 'bool', 'Error Condition must be of type bool.');\n assertShapesMatch($a.shape, $b.shape, 'Error in where: ');\n\n if ($condition.rank === 1) {\n // If condition rank is 1, then the first dimension must match the size of\n // condition.\n assert(\n $condition.shape[0] === $a.shape[0],\n 'The first dimension of `a` must match the size of `condition`.');\n } else {\n // A must have the same shape as condition.\n assertShapesMatch($condition.shape, $b.shape, 'Error in where: ');\n }\n\n // TODO(julianoks): Return null for condition gradient\n // when backprop supports it.\n const grad = (dy: T) => ({\n $condition: () => zerosLike($condition),\n $a: () => dy.mul($condition.cast($a.dtype)) as T,\n $b: () => dy.mul($condition.logicalNot().cast($b.dtype)) as T\n });\n\n return ENV.engine.runKernel(\n backend => backend.select($condition, $a, $b),\n {$condition, $a, $b}, grad) as T;\n}\n\n/**\n * Returns the coordinates of true elements of condition.\n *\n * The coordinates are returned in a 2-D tensor where the first dimension (rows)\n * represents the number of true elements, and the second dimension (columns)\n * represents the coordinates of the true elements. Keep in mind, the shape of\n * the output tensor can vary depending on how many true values there are in\n * input. Indices are output in row-major order. The resulting tensor has the\n * shape `[numTrueElems, condition.rank]`.\n */\nasync function whereAsync_(condition: Tensor|TensorLike): Promise {\n const $condition = convertToTensor(condition, 'condition', 'where', 'bool');\n assert($condition.dtype === 'bool', 'Condition must be of type bool.');\n const vals = await $condition.data();\n const res = whereImpl($condition.shape, vals);\n if (condition !== $condition) {\n $condition.dispose();\n }\n return res;\n}\n\nexport const logicalAnd = op({logicalAnd_});\nexport const logicalNot = op({logicalNot_});\nexport const logicalOr = op({logicalOr_});\nexport const logicalXor = op({logicalXor_});\nexport const where = op({where_});\nexport const whereAsync = whereAsync_;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {maximum, minimum} from './binary_ops';\nimport {where} from './logical_ops';\nimport {op} from './operation';\nimport {SELU_SCALE, SELU_SCALEALPHA} from './selu_util';\nimport {scalar} from './tensor_ops';\n\n/**\n * Computes rectified linear element-wise: `max(x, 0)`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.relu().print(); // or tf.relu(x)\n * ```\n * @param x The input tensor. If the dtype is `bool`, the output dtype will be\n * `int32'.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction relu_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'relu');\n\n if ($x.dtype === 'bool') {\n return $x.toInt();\n }\n const grad = (dy: T) => {\n const stepRes = $x.step();\n return {$x: () => dy.mulStrict(stepRes.toFloat())};\n };\n return ENV.engine.runKernel(backend => backend.relu($x), {$x}, grad);\n}\n\n/**\n * Computes exponential linear element-wise, `x > 0 ? e ^ x - 1 : 0`\n *\n * ```js\n * const x = tf.tensor1d([-1, 1, -3, 2]);\n *\n * x.elu().print(); // or tf.elu(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction elu_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'elu');\n\n const grad = (dy: T, saved: Tensor[]) => {\n const [y] = saved;\n return {\n $x: () =>\n ENV.engine.runKernel(backend => backend.eluDer(dy, y), {dy, y}) as T\n };\n };\n return ENV.engine.runKernel(\n (backend, save) => save(backend.elu($x)), {$x}, grad);\n}\n\n/**\n * Computes scaled exponential linear element-wise.\n *\n * `x < 0 ? scale * alpha * (exp(x) - 1) : x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.selu().print(); // or tf.selu(x)\n * ```\n * @param x The input tensor.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction selu_(x: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'selu');\n\n const grad = (dy: T) => {\n return {\n $x: () => {\n const mask = $x.greater(scalar(0));\n\n const scaleAlpha = scalar(SELU_SCALEALPHA);\n const scale = scalar(SELU_SCALE);\n\n const greaterThanZeroDer = dy.mul(scale);\n const lessEqualZeroDer = dy.mul(scaleAlpha).mul($x.toFloat().exp());\n\n return where(mask, greaterThanZeroDer, lessEqualZeroDer) as T;\n }\n };\n };\n return ENV.engine.runKernel(backend => backend.selu($x), {$x}, grad);\n}\n\n/**\n * Computes leaky rectified linear element-wise.\n *\n * See\n * [http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf](\n * http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf)\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n *\n * x.leakyRelu(0.1).print(); // or tf.leakyRelu(x, 0.1)\n * ```\n * @param x The input tensor.\n * @param alpha The scaling factor for negative values, defaults to 0.2.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction leakyRelu_(x: T|TensorLike, alpha = 0.2): T {\n const $x = convertToTensor(x, 'x', 'leakyRelu');\n return maximum(scalar(alpha).mul($x), $x);\n}\n\n/**\n * Computes leaky rectified linear element-wise with parametric alphas.\n *\n * `x < 0 ? alpha * x : f(x) = x`\n *\n * ```js\n * const x = tf.tensor1d([-1, 2, -3, 4]);\n * const alpha = tf.scalar(0.1);\n *\n * x.prelu(alpha).print(); // or tf.prelu(x, alpha)\n * ```\n * @param x The input tensor.\n * @param alpha Scaling factor for negative values.\n */\n/** @doc {heading: 'Operations', subheading: 'Basic math'} */\nfunction prelu_(x: T|TensorLike, alpha: T|TensorLike): T {\n const $x = convertToTensor(x, 'x', 'prelu');\n const $alpha = convertToTensor(alpha, 'alpha', 'prelu');\n\n const zero = scalar(0);\n return maximum(zero, $x).add($alpha.mul(minimum(zero, $x)));\n}\n\nexport const elu = op({elu_});\nexport const leakyRelu = op({leakyRelu_});\nexport const prelu = op({prelu_});\nexport const relu = op({relu_});\nexport const selu = op({selu_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport * as axis_util from './axis_util';\nimport {op} from './operation';\n\n/**\n * Transposes the `Tensor`. Permutes the dimensions according to `perm`.\n *\n * The returned `Tensor`'s dimension `i` will correspond to the input\n * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`,\n * where `n` is the rank of the input `Tensor`. Hence by default, this\n * operation performs a regular matrix transpose on 2-D input `Tensor`s.\n *\n * ```js\n * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);\n *\n * a.transpose().print(); // or tf.transpose(a)\n * ```\n *\n * @param x The tensor to transpose.\n * @param perm The permutation of the dimensions of a.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction transpose_(x: T|TensorLike, perm?: number[]): T {\n const $x = convertToTensor(x, 'x', 'transpose');\n\n if (perm == null) {\n perm = $x.shape.map((s, i) => i).reverse();\n }\n util.assert(\n $x.rank === perm.length,\n `Error in transpose: rank of input ${$x.rank} ` +\n `must match length of perm ${perm}.`);\n perm.forEach(axis => {\n util.assert(\n axis >= 0 && axis < $x.rank,\n `All entries in 'perm' must be between 0 and ${$x.rank - 1}` +\n ` but got ${perm}`);\n });\n\n if ($x.rank <= 1) {\n return $x.clone();\n }\n\n const der = (dy: T) => {\n const undoPerm = axis_util.getUndoAxesPermutation(perm);\n return {$x: () => dy.transpose(undoPerm)};\n };\n return ENV.engine.runKernel(\n backend => backend.transpose($x, perm), {$x}, der);\n}\n\nexport const transpose = op({transpose_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\n\n/**\n * Normalizes the activation of a local neighborhood across or within\n * channels.\n *\n * @param x The input tensor. The 4-D input tensor is treated as a 3-D array\n * of 1D vectors (along the last dimension), and each vector is\n * normalized independently.\n * @param depthRadius The number of adjacent channels in the 1D normalization\n * window.\n * @param bias A constant bias term for the basis.\n * @param alpha A scale factor, usually positive.\n * @param beta An exponent.\n */\n/** @doc {heading: 'Operations', subheading: 'Normalization'} */\nfunction localResponseNormalization_(\n x: T|TensorLike, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5): T {\n const $x = convertToTensor(x, 'x', 'localResponseNormalization');\n util.assert(\n $x.rank === 4 || $x.rank === 3,\n `Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${$x.rank}.`);\n util.assert(\n util.isInt(depthRadius),\n `Error in localResponseNormalization: depthRadius must be an integer\n but got depthRadius ${depthRadius}.`);\n\n let x4D = $x as Tensor4D;\n let reshapedTo4D = false;\n if ($x.rank === 3) {\n reshapedTo4D = true;\n x4D = $x.as4D(1, $x.shape[0], $x.shape[1], $x.shape[2]);\n }\n const backward = (dy: Tensor4D, saved: Tensor[]) => {\n const [outputImage] = saved;\n return {\n x4D: () => ENV.engine.runKernel(\n backend => backend.LRNGrad(\n dy, x4D, outputImage as Tensor4D, depthRadius, bias, alpha, beta),\n {})\n };\n };\n const res = ENV.engine.runKernel(\n (backend, save) => save(backend.localResponseNormalization4D(\n x4D, depthRadius, bias, alpha, beta)),\n {x4D}, backward);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n } else {\n return res as T;\n }\n}\n\nexport const localResponseNormalization = op({localResponseNormalization_});","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as axis_util from './axis_util';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\n\n/**\n * Computes the norm of scalar, vectors, and matrices.\n * This function can compute several different vector norms (the 1-norm, the\n * Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0)\n * and matrix norms (Frobenius, 1-norm, and inf-norm).\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n *\n * x.norm().print(); // or tf.norm(x)\n * ```\n *\n * @param x The input array.\n * @param ord Optional. Order of the norm. Supported norm types are\n * following:\n *\n * | ord | norm for matrices | norm for vectors\n * |------------|---------------------------|---------------------\n * |'euclidean' |Frobenius norm |2-norm\n * |'fro' |Frobenius norm\t |\n * |Infinity |max(sum(abs(x), axis=1)) |max(abs(x))\n * |-Infinity |min(sum(abs(x), axis=1)) |min(abs(x))\n * |1 |max(sum(abs(x), axis=0)) |sum(abs(x))\n * |2 | |sum(abs(x)^2)^1/2*\n *\n * @param axis Optional. If axis is null (the default), the input is\n * considered a vector and a single vector norm is computed over the entire\n * set of values in the Tensor, i.e. norm(x, ord) is equivalent\n * to norm(x.reshape([-1]), ord). If axis is a integer, the input\n * is considered a batch of vectors, and axis determines the axis in x\n * over which to compute vector norms. If axis is a 2-tuple of integer it is\n * considered a batch of matrices and axis determines the axes in NDArray\n * over which to compute a matrix norm.\n * @param keepDims Optional. If true, the norm have the same dimensionality\n * as the input.\n */\n/** @doc {heading: 'Operations', subheading: 'Matrices'} */\nfunction norm_(\n x: Tensor|TensorLike, ord: number|'euclidean'|'fro' = 'euclidean',\n axis: number|number[] = null, keepDims = false): Tensor {\n x = convertToTensor(x, 'x', 'norm');\n\n const norm = normImpl(x, ord, axis);\n let keepDimsShape = norm.shape;\n if (keepDims) {\n const axes = axis_util.parseAxisParam(axis, x.shape);\n keepDimsShape = axis_util.expandShapeToKeepDim(norm.shape, axes);\n }\n return norm.reshape(keepDimsShape);\n}\n\nfunction normImpl(\n x: Tensor, p: number|string, axis: number|number[] = null): Tensor {\n if (x.rank === 0) {\n return x.abs();\n }\n\n // consider vector when no axis is specified\n if (x.rank !== 1 && axis === null) {\n return normImpl(x.reshape([-1]), p, axis);\n }\n\n // vector\n if (x.rank === 1 || typeof axis === 'number' ||\n axis instanceof Array && axis.length === 1) {\n if (p === 1) {\n return x.abs().sum(axis);\n }\n if (p === Infinity) {\n return x.abs().max(axis);\n }\n if (p === -Infinity) {\n return x.abs().min(axis);\n }\n if (p === 'euclidean' || p === 2) {\n // norm(x, 2) = sum(abs(xi) ^ 2) ^ 1/2\n return x.abs().pow(scalar(2, 'int32')).sum(axis).sqrt() as Tensor;\n }\n\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n\n // matrix (assumption axis[0] < axis[1])\n if (axis instanceof Array && axis.length === 2) {\n if (p === 1) {\n return x.abs().sum(axis[0]).max(axis[1] - 1);\n }\n if (p === Infinity) {\n return x.abs().sum(axis[1]).max(axis[0]);\n }\n if (p === -Infinity) {\n return x.abs().sum(axis[1]).min(axis[0]);\n }\n if (p === 'fro' || p === 'euclidean') {\n // norm(x) = sqrt(sum(pow(x, 2)))\n return x.square().sum(axis).sqrt();\n }\n\n throw new Error(`Error in norm: invalid ord value: ${p}`);\n }\n\n throw new Error(`Error in norm: invalid axis: ${axis}`);\n}\n\nexport const norm = op({norm_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor, Tensor1D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assert, isInt} from '../util';\nimport {expandDims} from './array_ops';\nimport {getUndoAxesPermutation, parseAxisParam} from './axis_util';\nimport {maximum} from './binary_ops';\nimport {greaterEqual} from './compare';\nimport {logicalAnd, where} from './logical_ops';\nimport {op} from './operation';\nimport {ones, scalar, zerosLike} from './tensor_ops';\n\n/**\n * Computes the sum along segments of a `Tensor`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');\n * const numSegments = 3;\n *\n * x.unsortedSegmentSum(segmentIds, numSegments).print()\n * //or tf.unsortedSegmentSum(x, segmentIds, numSegments)\n * ```\n * @param x The `Tensor` that will be summed along its segments\n * @param segmentIds A `Tensor1D` whose rank is equal to the rank of `x`'s\n * dimension along the `axis`. Maps each element of `x` to a segment.\n * @param numSegments The number of distinct `segmentIds`\n */\n/** @doc {heading: 'Operations', subheading: 'Segment'} */\nfunction unsortedSegmentSum_(\n x: T|TensorLike, segmentIds: Tensor1D|TensorLike, numSegments: number): T {\n const $x = convertToTensor(x, 'x', 'unsortedSegmentSum');\n const $segmentIds =\n convertToTensor(segmentIds, 'segmentIds', 'unsortedSegmentSum', 'int32');\n assert($segmentIds.dtype === 'int32', 'segmentIds must be of dtype `int32`');\n assert(isInt(numSegments), 'numSegments must be of dtype int');\n\n const gradFunc = (dy: T) => {\n const derX = () => {\n return gatherDropNegatives(dy, $segmentIds);\n };\n return {$x: derX};\n };\n return ENV.engine.runKernel(\n backend =>\n backend.unsortedSegmentSum($x, $segmentIds, numSegments),\n {$x}, gradFunc) as T;\n}\n\n/**\n * Gather slices from tensor `x`'s axis `axis` according to `indices`.\n *\n * ```js\n * const x = tf.tensor1d([1, 2, 3, 4]);\n * const indices = tf.tensor1d([1, 3, 3], 'int32');\n *\n * x.gather(indices).print();\n * ```\n *\n * ```js\n * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const indices = tf.tensor1d([1, 1, 0], 'int32');\n *\n * x.gather(indices).print();\n * ```\n * @param x The input tensor whose slices to be gathered.\n * @param indices The indices of the values to extract.\n * @param axis The axis over which to select values. Defaults to 0.\n */\n/** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */\nfunction gather_(\n x: T|TensorLike, indices: Tensor1D|TensorLike, axis = 0): T {\n const $x = convertToTensor(x, 'x', 'gather');\n const $indices = convertToTensor(indices, 'indices', 'gather', 'int32');\n\n assert($indices.dtype === 'int32', 'Indices must be of dtype `int32`');\n axis = parseAxisParam(axis, $x.shape)[0];\n const grad = (dy: T) => {\n const derX = () => {\n if (axis === 0) {\n return unsortedSegmentSum(dy, $indices, $x.shape[axis]);\n }\n const paramsShape = $x.shape;\n const indicesSize = $indices.size;\n\n const outerShape = paramsShape.slice(0, axis);\n const outerDims = outerShape.length;\n const innerShape = paramsShape.slice(axis, paramsShape.length).slice(1);\n const innerDims = innerShape.length;\n\n const outerAxesIndices = arrayRange(0, outerDims);\n const innerAxesIndices =\n arrayRange(outerDims + 1, outerDims + 1 + innerDims);\n\n const valuesShape = arrayConcat([outerShape, [indicesSize], innerShape]);\n\n const values = dy.reshape(valuesShape);\n const reshapedIndices = $indices.reshape([indicesSize]);\n\n const transposeDims =\n arrayConcat([[outerDims], outerAxesIndices, innerAxesIndices]);\n const valuesTranspose = values.transpose(transposeDims);\n\n let paramsGrad = unsortedSegmentSum(\n valuesTranspose, reshapedIndices as Tensor1D, $x.shape[axis]);\n\n const invertTransposeDims = getUndoAxesPermutation(transposeDims);\n paramsGrad = paramsGrad.transpose(invertTransposeDims);\n\n return paramsGrad as T;\n };\n return {$x: derX};\n };\n return ENV.engine.runKernel(\n backend => backend.gather($x, $indices as Tensor1D, axis), {$x},\n grad) as T;\n}\n\nfunction arrayRange(start: number, stop: number): number[] {\n const result = [];\n for (let i = start; i < stop; ++i) {\n result.push(i);\n }\n return result;\n}\n\nfunction arrayConcat(arrays: number[][]): number[] {\n const result = [];\n for (let i = 0; i < arrays.length; ++i) {\n for (let j = 0; j < arrays[i].length; ++j) {\n result.push(arrays[i][j]);\n }\n }\n return result;\n}\n\nfunction gatherDropNegatives(x: T, indices: Tensor1D) {\n // Helper function for unsorted segment ops. Gathers params for\n // positive segment ids and gathers 0 for inputs with negative segment id.\n // Mirrors _GatherDropNegatives from tensorflow/python/ops/math_grad.py\n const zeroClippedIndices = maximum(indices, zerosLike(indices));\n const gathered = gather(x, zeroClippedIndices as Tensor1D);\n let isPositive = greaterEqual(indices, scalar(0, 'int32'));\n const numIters = gathered.rank - isPositive.rank;\n for (let i = 0; i < numIters; ++i) {\n isPositive = expandDims(isPositive, i + 1);\n }\n isPositive = logicalAnd(isPositive, ones(gathered.shape, 'bool'));\n const zeroSlice = zerosLike(gathered);\n return where(isPositive, gathered, zeroSlice);\n}\n\nexport const gather = op({gather_});\nexport const unsortedSegmentSum = op({unsortedSegmentSum_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Scalar, Tensor1D, Tensor2D} from '../tensor';\nimport {convertToTensor, convertToTensorArray} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * @docalias (data: Tensor2D, c: Tensor2D, h: Tensor2D): [Tensor2D, Tensor2D]\n */\nexport type LSTMCellFunc = {\n (data: Tensor2D, c: Tensor2D, h: Tensor2D): [Tensor2D, Tensor2D];\n};\n\n/**\n * Computes the next states and outputs of a stack of LSTMCells.\n *\n * Each cell output is used as input to the next cell.\n *\n * Returns `[cellState, cellOutput]`.\n *\n * Derived from tf.contrib.rn.MultiRNNCell.\n *\n * @param lstmCells Array of LSTMCell functions.\n * @param data The input to the cell.\n * @param c Array of previous cell states.\n * @param h Array of previous cell outputs.\n */\n/** @doc {heading: 'Operations', subheading: 'RNN'} */\nfunction multiRNNCell_(\n lstmCells: LSTMCellFunc[], data: Tensor2D|TensorLike,\n c: Tensor2D[]|TensorLike[],\n h: Tensor2D[]|TensorLike[]): [Tensor2D[], Tensor2D[]] {\n const $data = convertToTensor(data, 'data', 'multiRNNCell');\n const $c = convertToTensorArray(c, 'c', 'multiRNNCell');\n const $h = convertToTensorArray(h, 'h', 'multiRNNCell');\n\n let input = $data;\n const newStates = [];\n for (let i = 0; i < lstmCells.length; i++) {\n const output = lstmCells[i](input, $c[i], $h[i]);\n newStates.push(output[0]);\n newStates.push(output[1]);\n input = output[1];\n }\n const newC: Tensor2D[] = [];\n const newH: Tensor2D[] = [];\n for (let i = 0; i < newStates.length; i += 2) {\n newC.push(newStates[i]);\n newH.push(newStates[i + 1]);\n }\n return [newC, newH];\n}\n\n/**\n * Computes the next state and output of a BasicLSTMCell.\n *\n * Returns `[newC, newH]`.\n *\n * Derived from tf.contrib.rnn.BasicLSTMCell.\n *\n * @param forgetBias Forget bias for the cell.\n * @param lstmKernel The weights for the cell.\n * @param lstmBias The bias for the cell.\n * @param data The input to the cell.\n * @param c Previous cell state.\n * @param h Previous cell output.\n */\n/** @doc {heading: 'Operations', subheading: 'RNN'} */\nfunction basicLSTMCell_(\n forgetBias: Scalar|TensorLike, lstmKernel: Tensor2D|TensorLike,\n lstmBias: Tensor1D|TensorLike, data: Tensor2D|TensorLike,\n c: Tensor2D|TensorLike, h: Tensor2D|TensorLike): [Tensor2D, Tensor2D] {\n const $forgetBias =\n convertToTensor(forgetBias, 'forgetBias', 'basicLSTMCell');\n const $lstmKernel =\n convertToTensor(lstmKernel, 'lstmKernel', 'basicLSTMCell');\n const $lstmBias = convertToTensor(lstmBias, 'lstmBias', 'basicLSTMCell');\n const $data = convertToTensor(data, 'data', 'basicLSTMCell');\n const $c = convertToTensor(c, 'c', 'basicLSTMCell');\n const $h = convertToTensor(h, 'h', 'basicLSTMCell');\n\n const combined = $data.concat($h, 1);\n const weighted = combined.matMul($lstmKernel);\n const res = weighted.add($lstmBias) as Tensor2D;\n\n // i = input_gate, j = new_input, f = forget_gate, o = output_gate\n const batchSize = res.shape[0];\n const sliceCols = res.shape[1] / 4;\n const sliceSize: [number, number] = [batchSize, sliceCols];\n const i = res.slice([0, 0], sliceSize);\n const j = res.slice([0, sliceCols], sliceSize);\n const f = res.slice([0, sliceCols * 2], sliceSize);\n const o = res.slice([0, sliceCols * 3], sliceSize);\n\n const newC = i.sigmoid().mulStrict(j.tanh()).addStrict(\n $c.mulStrict($forgetBias.add(f).sigmoid() as Tensor2D));\n const newH = newC.tanh().mulStrict(o.sigmoid());\n return [newC, newH];\n}\n\nexport const basicLSTMCell = op({basicLSTMCell_});\nexport const multiRNNCell = op({multiRNNCell_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {Scalar, Tensor} from '../tensor';\nimport {assertTypesMatch} from '../tensor_util';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {pow} from './binary_ops';\nimport {op} from './operation';\nimport {scalar} from './tensor_ops';\n\n/**\n * Compute the moving average of a variable.\n *\n * Without zeroDebias, the moving average operation is defined by:\n * `v += delta`\n * where\n * `delta = (1 - decay) * (x - v)`\n *\n * With zeroDebias (default), the `delta` term is scaled to debias the\n * effect of the (assumed) zero-initialization of `v`.\n * `delta /= (1 - decay ^ step)`\n *\n * For more details on the zero-debiasing algorithm, see:\n * https://arxiv.org/abs/1412.6980\n *\n * Note that this function is completely stateless and does not keep track of\n * step count. The step count needs to be maintained by the caller and passed\n * in as `step`.\n *\n * @param v The current moving average value.\n * @param x New input value, must have the same shape and dtype as `v`.\n * @param decay The decay factor. Typical values are 0.95 and 0.99.\n * @param step Step count.\n * @param zeroDebias: Whether zeroDebias is to be performed (default: `true`).\n * @returns The new moving average value.\n */\n/** @doc {heading: 'Operations', subheading: 'Moving Average'} */\nfunction movingAverage_(\n v: T|TensorLike, x: T|TensorLike, decay: number|Scalar,\n step?: number|Scalar, zeroDebias = true): T {\n const $v = convertToTensor(v, 'v', 'movingAverage');\n const $x = convertToTensor(x, 'x', 'movingAverage');\n const $decay = convertToTensor(decay, 'decay', 'movingAverage');\n\n assertTypesMatch($v, $x);\n util.assert(\n util.arraysEqual($v.shape, $x.shape), 'Shape mismatch in v and x');\n\n const one = scalar(1);\n const oneMinusDecay = one.sub($decay);\n\n let update = $x.sub($v).mul(oneMinusDecay);\n if (zeroDebias) {\n util.assert(step != null, 'When using zeroDebias: true, step is required.');\n const $step = convertToTensor(step, 'step', 'movingAverage');\n update = update.div(one.sub(pow($decay, $step)));\n }\n return $v.add(update);\n}\n\nexport const movingAverage = op({movingAverage_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * Extracts a strided slice of a tensor.\n *\n * Roughly speaking, this op extracts a slice of size (end-begin)/stride from\n * the given input_ tensor. Starting at the location specified by begin the\n * slice continues by adding stride to the index until all dimensions are not\n * less than end. Note that a stride can be negative, which causes a reverse\n * slice.\n *\n * ```js\n * t = tf.tensor3d([1, 1, 1 ,2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6],\n * [3, 2, 3]);\n * t.stridedSlice([1, 0, 0], [2, 1, 3], [1, 1, 1]).print() // [[[3, 3, 3]]]\n * t.stridedSlice([1, 0, 0], [2, 2, 3], [1, 1, 1]).print() // [[[3, 3, 3],\n * // [4, 4, 4]]]\n * t.stridedSlice([1, -1, 0], [2, -3, 3], [1, -1, 1]).print() // [[[4, 4, 4],\n * // [3, 3, 3]]]\n * ```\n *\n * @param x The tensor to stride slice.\n * @param begin The coordinates to start the slice from.\n * @param end: The coordinates to end the slice at.\n * @param strides: The size of the slice.\n * @param beginMask: If the ith bit of begin_mask is set, begin[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n * @param endMask: If the ith bit of end_mask is set, end[i] is ignored\n * and the fullest possible range in that dimension is used instead.\n */\n/** @doc {heading: 'Operations', subheading: 'Slicing and Joining'} */\nfunction stridedSlice_(\n x: T|TensorLike, begin: number[], end: number[], strides: number[],\n beginMask = 0, endMask = 0): T {\n const $x = convertToTensor(x, 'x', 'stridedSlice');\n return ENV.engine.runKernel(\n backend => backend.stridedSlice(\n $x, begin, end, strides, beginMask, endMask),\n {$x}) as T;\n}\n\nexport const stridedSlice = op({stridedSlice_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {customGrad} from '../globals';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {assertShapesMatch, sizeFromShape} from '../util';\n\nimport {expandShapeToKeepDim} from './axis_util';\n\nimport {minimum} from './binary_ops';\nimport {op} from './operation';\nimport {ones, scalar} from './tensor_ops';\n\nexport enum Reduction {\n NONE,\n MEAN,\n SUM,\n SUM_BY_NONZERO_WEIGHTS\n}\n\n/**\n * Computes the weighted loss between two tensors.\n *\n * @param losses Tensor of shape `[batch_size, d1, ... dN]`.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `losses`, and must be broadcastable to `losses` (i.e., all\n * dimensions must be either `1`, or the same as the corresponding\n * `losses` dimension).\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction computeWeightedLoss_(\n losses: T|TensorLike, weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $losses = convertToTensor(losses, 'losses', 'computeWeightedLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'computeWeightedLoss');\n }\n\n const weightedLoss = ($weights == null) ? $losses : $losses.mul($weights);\n\n if (reduction === Reduction.NONE) {\n return weightedLoss as O;\n }\n if (reduction === Reduction.SUM) {\n return weightedLoss.sum();\n }\n if (reduction === Reduction.MEAN) {\n if ($weights == null) {\n return weightedLoss.mean();\n } else {\n const broadcastFactor =\n sizeFromShape($losses.shape) / sizeFromShape($weights.shape);\n const result = weightedLoss.sum().div($weights.sum());\n return broadcastFactor > 1 ? result.div(scalar(broadcastFactor)) :\n result as O;\n }\n }\n if (reduction === Reduction.SUM_BY_NONZERO_WEIGHTS) {\n if ($weights == null) {\n return weightedLoss.sum().div(scalar($losses.size));\n } else {\n const broadcastedWeights = $weights.mul(ones($losses.shape));\n\n const numNonZeros =\n broadcastedWeights.notEqual(scalar(0)).sum().toFloat();\n return weightedLoss.sum().div(numNonZeros);\n }\n }\n\n throw Error(`Unknown reduction: ${reduction}`);\n}\n\n/**\n * Computes the absolute difference loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction absoluteDifference_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'absoluteDifference');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'absoluteDifference');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'absoluteDifference');\n }\n assertShapesMatch(\n $labels.shape, $predictions.shape, 'Error in absoluteDifference: ');\n\n const losses = $labels.sub($predictions).abs();\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the mean squared error between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction meanSquaredError_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'meanSquaredError');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'meanSquaredError');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'meanSquaredError');\n }\n assertShapesMatch(\n $labels.shape, $predictions.shape, 'Error in meanSquaredError: ');\n\n const losses = $labels.squaredDifference($predictions);\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the cosine distance loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param axis The dimension along which the cosine distance is computed.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction cosineDistance_(\n labels: T|TensorLike, predictions: T|TensorLike, axis: number,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'cosineDistance');\n const $predictions =\n convertToTensor(predictions, 'predictions', 'cosineDistance');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'cosineDistance');\n }\n assertShapesMatch(\n $labels.shape, $predictions.shape, 'Error in cosineDistance: ');\n\n const one = scalar(1);\n const losses = one.sub($labels.mul($predictions).sum(axis, true));\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the Hinge loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction hingeLoss_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n let $labels = convertToTensor(labels, 'labels', 'hingeLoss');\n const $predictions = convertToTensor(predictions, 'predictions', 'hingeLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'hingeLoss');\n }\n assertShapesMatch($labels.shape, $predictions.shape, 'Error in hingeLoss: ');\n\n const one = scalar(1);\n // Convert binary labels to (-1, 1)\n $labels = scalar(2).mul($labels).sub(one);\n const losses = one.sub($labels.mul($predictions)).relu();\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the log loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param epsilon A small increment to avoid taking log of zero\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction logLoss_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike, epsilon = 1e-7,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'logLoss');\n const $predictions = convertToTensor(predictions, 'predictions', 'logLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'logLoss');\n }\n assertShapesMatch($labels.shape, $predictions.shape, 'Error in logLoss: ');\n\n const one = scalar(1);\n const epsilonScalar = scalar(epsilon);\n const losses = $labels.mul($predictions.add(epsilonScalar).log())\n .neg()\n .sub(one.sub($labels).mul(\n one.sub($predictions).add(epsilonScalar).log()));\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\nfunction sigmoidCrossEntropyWithLogits_(\n labels: T|TensorLike, logits: T|TensorLike): O {\n const $labels =\n convertToTensor(labels, 'labels', 'sigmoidCrossEntropyWithLogits');\n const $logits =\n convertToTensor(logits, 'logits', 'sigmoidCrossEntropyWithLogits');\n assertShapesMatch(\n $labels.shape, $logits.shape, 'Error in sigmoidCrossEntropyWithLogits: ');\n\n /**\n * Implementation Details:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n *\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n *\n * Hence, to ensure stability and avoid overflow, the implementation uses\n * this equivalent formulation:\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n */\n const maxOutput = $logits.relu();\n const outputXTarget = $logits.mul($labels);\n const sigmoidOutput = $logits.abs().neg().exp().log1p();\n\n return maxOutput.sub(outputXTarget).add(sigmoidOutput);\n}\n\n/**\n * Computes the sigmoid cross entropy loss between two tensors.\n *\n * If labelSmoothing is nonzero, smooth the labels towards 1/2:\n *\n * newMulticlassLabels = multiclassLabels * (1 - labelSmoothing)\n * + 0.5 * labelSmoothing\n *\n * @param multiClassLabels The ground truth output tensor of shape\n * [batch_size, num_classes], same dimensions as 'predictions'.\n * @param logits The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param labelSmoothing If greater than 0, then smooth the labels.\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc { heading: 'Training', subheading: 'Losses', namespace: 'losses' } */\nfunction sigmoidCrossEntropy_(\n multiClassLabels: T|TensorLike, logits: T|TensorLike,\n weights?: Tensor|TensorLike, labelSmoothing = 0,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n let $multiClassLabels = convertToTensor(\n multiClassLabels, 'multiClassLabels', 'sigmoidCrossEntropy');\n const $logits = convertToTensor(logits, 'logits', 'sigmoidCrossEntropy');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'sigmoidCrossEntropy');\n }\n assertShapesMatch(\n $multiClassLabels.shape, $logits.shape, 'Error in sigmoidCrossEntropy: ');\n\n if (labelSmoothing > 0) {\n const labelSmoothingScalar = scalar(labelSmoothing);\n const one = scalar(1);\n const half = scalar(0.5);\n\n $multiClassLabels = $multiClassLabels.mul(one.sub(labelSmoothingScalar))\n .add(half.mul(labelSmoothingScalar));\n }\n const losses = sigmoidCrossEntropyWithLogits_($multiClassLabels, $logits);\n\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes the huber loss between two tensors.\n *\n * @param labels The ground truth output tensor, same dimensions as\n * 'predictions'.\n * @param predictions The predicted outputs.\n * @param weights Tensor whose rank is either 0, or the same rank as\n * `labels`, and must be broadcastable to `labels` (i.e., all dimensions\n * must be either `1`, or the same as the corresponding `losses`\n * dimension).\n * @param delta Point where huber loss changes from quadratic to linear.\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`.\n */\n/** @doc {heading: 'Training', subheading: 'Losses', namespace: 'losses'} */\nfunction huberLoss_(\n labels: T|TensorLike, predictions: T|TensorLike,\n weights?: Tensor|TensorLike, delta = 1.0,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n const $labels = convertToTensor(labels, 'labels', 'huberLoss');\n const $predictions = convertToTensor(predictions, 'predictions', 'huberLoss');\n let $weights: Tensor = null;\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'huberLoss');\n }\n assertShapesMatch($labels.shape, $predictions.shape, 'Error in huberLoss: ');\n\n const deltaScalar = scalar(delta);\n const error = $predictions.sub($labels).abs();\n const quadratic = minimum(error, deltaScalar);\n const linear = error.sub(quadratic);\n\n const losses =\n scalar(0.5).mul(quadratic.square()).add(deltaScalar.mul(linear));\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\n/**\n * Computes softmax cross entropy between logits and labels.\n *\n * Measures the probability error in discrete classification tasks in which\n * the classes are mutually exclusive (each entry is in exactly one class).\n * For example, each CIFAR-10 image is labeled with one and only one label: an\n * image can be a dog or a truck, but not both.\n *\n * `NOTE`: While the classes are mutually exclusive, their probabilities need\n * not be. All that is required is that each row of labels is a valid\n * probability distribution. If they are not, the computation of the gradient\n * will be incorrect.\n *\n * `WARNING`: This op expects unscaled logits, since it performs a softmax on\n * logits internally for efficiency. Do not call this op with the output of\n * softmax, as it will produce incorrect results.\n *\n * logits and labels must have the same shape, e.g. [batch_size, num_classes]\n * and the same dtype.\n * @param labels The labels array.\n * @param logits The logits array.\n * @param dim The dimension softmax would be performed on. Defaults to `-1`\n * which indicates the last dimension.\n */\nfunction softmaxCrossEntropyWithLogits_(\n labels: T, logits: T, dim = -1): O {\n if (dim === -1) {\n dim = logits.rank - 1;\n }\n\n if (dim !== logits.rank - 1) {\n throw Error(\n `Softmax cross entropy along a non-last dimension is not yet ` +\n `supported. Labels / logits was rank ${logits.rank} ` +\n `and dim was ${dim}`);\n }\n // Use a custom gradient for numerical stability.\n const customOp = customGrad((labels, logits) => {\n // Reference:\n // 1. http://cs231n.github.io/linear-classify/#softmax\n // 2. https://blog.feedly.com/tricks-of-the-trade-logsumexp/\n const keepDims = true;\n const lse = logits.logSumExp([dim], keepDims);\n\n const logResult = logits.toFloat().sub(lse);\n const costVector = logResult.mul(labels).neg();\n\n const value = costVector.sum([dim]) as O;\n\n const gradFunc = (dy: O) => {\n const dyShape = expandShapeToKeepDim(dy.shape, [dim]);\n return [\n dy.reshape(dyShape).mul(labels.toFloat().sub(logResult.exp())),\n dy.reshape(dyShape).mul(logResult.exp().sub(labels.toFloat())),\n ];\n };\n return {value, gradFunc};\n });\n\n return customOp(labels, logits);\n}\n\n/**\n * Computes the softmax cross entropy loss between two tensors.\n *\n * If labelSmoothing is nonzero, smooth the labels towards 1/2:\n *\n * newOnehotLabels = onehotLabels * (1 - labelSmoothing)\n * + labelSmoothing / numClasses\n *\n * @param onehotLabels One hot encoded labels\n * [batch_size, num_classes], same dimensions as 'predictions'.\n * @param logits The predicted outputs.\n * @param weights Tensor whose rank is either 0, or 1, and must be\n * broadcastable to `loss` of shape [batch_size]\n * @param labelSmoothing If greater than 0, then smooth the labels.\n * @param reduction Type of reduction to apply to loss. Should be of type\n * `Reduction`\n */\n/** @doc { heading: 'Training', subheading: 'Losses', namespace: 'losses' } */\nfunction softmaxCrossEntropy_(\n onehotLabels: T|TensorLike, logits: T|TensorLike,\n weights?: Tensor|TensorLike, labelSmoothing = 0,\n reduction = Reduction.SUM_BY_NONZERO_WEIGHTS): O {\n let $onehotLabels =\n convertToTensor(onehotLabels, 'onehotLabels', 'softmaxCrossEntropy');\n const $logits = convertToTensor(logits, 'logits', 'softmaxCrossEntropy');\n let $weights: Tensor = null;\n\n if (weights != null) {\n $weights = convertToTensor(weights, 'weights', 'softmaxCrossEntropy');\n }\n\n assertShapesMatch(\n $onehotLabels.shape, $logits.shape, 'Error in softmaxCrossEntropy: ');\n\n if (labelSmoothing > 0) {\n const labelSmoothingScalar = scalar(labelSmoothing);\n const one = scalar(1);\n const numClasses = scalar($onehotLabels.shape[1]);\n\n $onehotLabels = $onehotLabels.mul(one.sub(labelSmoothingScalar))\n .add(labelSmoothingScalar.div(numClasses));\n }\n\n const losses = softmaxCrossEntropyWithLogits_($onehotLabels, $logits);\n\n return computeWeightedLoss(losses, $weights, reduction);\n}\n\nexport const absoluteDifference = op({absoluteDifference_});\nexport const computeWeightedLoss = op({computeWeightedLoss_});\nexport const cosineDistance = op({cosineDistance_});\nexport const hingeLoss = op({hingeLoss_});\nexport const huberLoss = op({huberLoss_});\nexport const logLoss = op({logLoss_});\nexport const meanSquaredError = op({meanSquaredError_});\nexport const sigmoidCrossEntropy = op({sigmoidCrossEntropy_});\nexport const softmaxCrossEntropy = op({softmaxCrossEntropy_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {Tensor} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport {op} from './operation';\n\n/**\n * Finds the values and indices of the `k` largest entries along the last\n * dimension.\n *\n * If the input is a vector (rank=1), finds the k largest entries in the vector\n * and outputs their values and indices as vectors. Thus values[j] is the j-th\n * largest entry in input, and its index is indices[j].\n * For higher rank inputs, computes the top k entries along the last dimension.\n *\n * If two elements are equal, the lower-index element appears first.\n *\n * ```js\n * const a = tensor2d([[1, 5], [4, 3]]);\n * const {values, indices} = tf.topk(a);\n * values.print();\n * indices.print();\n * ```\n * @param x 1-D or higher `Tensor` with last dimension being at least `k`.\n * @param k Number of top elements to look for along the last dimension.\n * @param sorted If true, the resulting `k` elements will be sorted by the\n * values in descending order.\n */\n/** @doc {heading: 'Operations', subheading: 'Evaluation'} */\nfunction topk_(\n x: T|TensorLike, k = 1, sorted = true): {values: T, indices: T} {\n const $x = convertToTensor(x, 'x', 'topk');\n if ($x.rank === 0) {\n throw new Error('topk() expects the input to be of rank 1 or higher');\n }\n const lastDim = $x.shape[$x.shape.length - 1];\n if (k > lastDim) {\n throw new Error(\n `'k' passed to topk() must be <= the last dimension (${lastDim}) ` +\n `but got ${k}`);\n }\n\n const [values, indices] =\n ENV.engine.runKernel(b => b.topk($x, k, sorted), {$x});\n return {values, indices};\n}\n\nexport const topk = op({topk_});\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Linear algebra ops.\n */\n\nimport {ENV} from '../environment';\nimport {dispose} from '../globals';\nimport {Tensor, Tensor1D, Tensor2D} from '../tensor';\nimport {assert} from '../util';\nimport {eye, split, squeeze, stack, unstack} from './array_ops';\nimport {norm} from './norm';\nimport {op} from './operation';\nimport {sum} from './reduction_ops';\nimport {tensor2d} from './tensor_ops';\n\n/**\n * Gram-Schmidt orthogonalization.\n *\n * @param xs The vectors to be orthogonalized, in one of the two following\n * formats:\n * - An Array of `Tensor1D`.\n * - A `Tensor2D`, i.e., a matrix, in which case the vectors are the rows\n * of `xs`.\n * In each case, all the vectors must have the same length and the length\n * must be greater than or equal to the number of vectors.\n * @returns The orthogonalized and normalized vectors or matrix.\n * Orthogonalization means that the vectors or the rows of the matrix\n * are orthogonal (zero inner products). Normalization means that each\n * vector or each row of the matrix has an L2 norm that equals `1`.\n */\n/** @doc {heading: 'Operations', subheading: 'Linear Algebra'} */\nfunction gramSchmidt_(xs: Tensor1D[]|Tensor2D): Tensor1D[]|Tensor2D {\n let inputIsTensor2D: boolean;\n if (Array.isArray(xs)) {\n inputIsTensor2D = false;\n assert(\n xs != null && xs.length > 0,\n 'Gram-Schmidt process: input must not be null, undefined, or empty');\n const dim = xs[0].shape[0];\n for (let i = 1; i < xs.length; ++i) {\n assert(\n xs[i].shape[0] === dim,\n 'Gram-Schmidt: Non-unique lengths found in the input vectors: ' +\n `(${xs[i].shape[0]} vs. ${dim})`);\n }\n } else {\n inputIsTensor2D = true;\n xs = split(xs, xs.shape[0], 0).map(x => squeeze(x, [0]));\n }\n\n assert(\n xs.length <= xs[0].shape[0],\n `Gram-Schmidt: Number of vectors (${xs.length}) exceeds ` +\n `number of dimensions (${xs[0].shape[0]}).`);\n\n const ys: Tensor1D[] = [];\n const xs1d = xs as Tensor1D[];\n for (let i = 0; i < xs.length; ++i) {\n ys.push(ENV.engine.tidy(() => {\n let x = xs1d[i];\n if (i > 0) {\n for (let j = 0; j < i; ++j) {\n const proj = sum(ys[j].mulStrict(x)).mul(ys[j]);\n x = x.sub(proj);\n }\n }\n return x.div(norm(x, 'euclidean'));\n }));\n }\n\n if (inputIsTensor2D) {\n return stack(ys, 0) as Tensor2D;\n } else {\n return ys;\n }\n}\n\n/**\n * Compute QR decomposition of m-by-n matrix using Householder transformation.\n *\n * Implementation based on\n * [http://www.cs.cornell.edu/~bindel/class/cs6210-f09/lec18.pdf]\n * (http://www.cs.cornell.edu/~bindel/class/cs6210-f09/lec18.pdf)\n *\n * @param x The `Tensor` to be QR-decomposed. Must have rank >= 2. Suppose\n * it has the shape `[..., M, N]`.\n * @param fullMatrices An optional boolean parameter. Defaults to `false`.\n * If `true`, compute full-sized `Q`. If `false` (the default),\n * compute only the leading N columns of `Q` and `R`.\n * @return An `Array` of two `Tensor`s: `[Q, R]`. `Q` is a unitary matrix,\n * i.e., its columns all have unit norm and are mutually orthogonal.\n * If `M >= N`,\n * If `fullMatrices` is `false` (default),\n * - `Q` has a shape of `[..., M, N]`,\n * - `R` has a shape of `[..., N, N]`.\n * If `fullMatrices` is `true` (default),\n * - `Q` has a shape of `[..., M, M]`,\n * - `R` has a shape of `[..., M, N]`.\n * If `M < N`,\n * - `Q` has a shape of `[..., M, M]`,\n * - `R` has a shape of `[..., M, N]`.\n * @throws If the rank of `x` is less than 2.\n */\n/** @doc {heading: 'Operations', subheading: 'Linear Algebra'} */\nfunction qr_(x: Tensor, fullMatrices = false): [Tensor, Tensor] {\n if (x.rank < 2) {\n throw new Error(\n `qr() requires input tensor to have a rank >= 2, but got rank ${\n x.rank}`);\n } else if (x.rank === 2) {\n return qr2d(x as Tensor2D, fullMatrices);\n } else {\n // Rank > 2.\n // TODO(cais): Below we split the input into individual 2D tensors,\n // perform QR decomposition on them and then stack the results back\n // together. We should explore whether this can be parallelized.\n const outerDimsProd = x.shape.slice(0, x.shape.length - 2)\n .reduce((value, prev) => value * prev);\n const x2ds = unstack(\n x.reshape([\n outerDimsProd, x.shape[x.shape.length - 2],\n x.shape[x.shape.length - 1]\n ]),\n 0);\n const q2ds: Tensor2D[] = [];\n const r2ds: Tensor2D[] = [];\n x2ds.forEach(x2d => {\n const [q2d, r2d] = qr2d(x2d as Tensor2D, fullMatrices);\n q2ds.push(q2d);\n r2ds.push(r2d);\n });\n const q = stack(q2ds, 0).reshape(x.shape);\n const r = stack(r2ds, 0).reshape(x.shape);\n return [q, r];\n }\n}\n\nfunction qr2d(x: Tensor2D, fullMatrices = false): [Tensor2D, Tensor2D] {\n return ENV.engine.tidy(() => {\n if (x.shape.length !== 2) {\n throw new Error(\n `qr2d() requires a 2D Tensor, but got a ${x.shape.length}D Tensor.`);\n }\n\n const m = x.shape[0];\n const n = x.shape[1];\n\n let q = eye(m) as Tensor2D; // Orthogonal transform so far.\n let r = x.clone(); // Transformed matrix so far.\n\n const one2D = tensor2d([[1]], [1, 1]);\n let w: Tensor2D = one2D.clone();\n\n const iters = m >= n ? n : m;\n for (let j = 0; j < iters; ++j) {\n // This tidy within the for-loop ensures we clean up temporary\n // tensors as soon as they are no longer needed.\n const rTemp = r;\n const wTemp = w;\n const qTemp = q;\n [w, r, q] = ENV.engine.tidy((): [Tensor2D, Tensor2D, Tensor2D] => {\n // Find H = I - tau * w * w', to put zeros below R(j, j).\n const rjEnd1 = r.slice([j, j], [m - j, 1]);\n const normX = rjEnd1.norm();\n const rjj = r.slice([j, j], [1, 1]);\n const s = rjj.sign().neg() as Tensor2D;\n const u1 = rjj.sub(s.mul(normX)) as Tensor2D;\n const wPre = rjEnd1.div(u1);\n if (wPre.shape[0] === 1) {\n w = one2D.clone();\n } else {\n w = one2D.concat(\n wPre.slice([1, 0], [wPre.shape[0] - 1, wPre.shape[1]]), 0) as\n Tensor2D;\n }\n const tau = s.matMul(u1).div(normX).neg() as Tensor2D;\n\n // -- R := HR, Q := QH.\n const rjEndAll = r.slice([j, 0], [m - j, n]);\n const tauTimesW = tau.mul(w) as Tensor2D;\n if (j === 0) {\n r = rjEndAll.sub(tauTimesW.matMul(w.transpose().matMul(rjEndAll)));\n } else {\n r = r.slice([0, 0], [j, n])\n .concat(\n rjEndAll.sub(\n tauTimesW.matMul(w.transpose().matMul(rjEndAll))),\n 0) as Tensor2D;\n }\n const qAllJEnd = q.slice([0, j], [m, q.shape[1] - j]);\n if (j === 0) {\n q = qAllJEnd.sub(qAllJEnd.matMul(w).matMul(tauTimesW.transpose()));\n } else {\n q = q.slice([0, 0], [m, j])\n .concat(\n qAllJEnd.sub(\n qAllJEnd.matMul(w).matMul(tauTimesW.transpose())),\n 1) as Tensor2D;\n }\n return [w, r, q];\n });\n dispose([rTemp, wTemp, qTemp]);\n }\n\n if (!fullMatrices && m > n) {\n q = q.slice([0, 0], [m, n]);\n r = r.slice([0, 0], [n, n]);\n }\n\n return [q, r];\n }) as [Tensor2D, Tensor2D];\n}\n\nexport const gramSchmidt = op({gramSchmidt_});\nexport const qr = op({qr_});\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ForwardFunc} from '../engine';\nimport {ENV} from '../environment';\nimport {nonMaxSuppressionImpl} from '../kernels/non_max_suppression_impl';\nimport {Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {convertToTensor} from '../tensor_util_env';\nimport {TensorLike} from '../types';\nimport * as util from '../util';\nimport {op} from './operation';\n\n/**\n * Bilinear resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n */\n/** @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} */\nfunction resizeBilinear_(\n images: T|TensorLike, size: [number, number], alignCorners = false): T {\n const $images = convertToTensor(images, 'images', 'resizeBilinear');\n util.assert(\n $images.rank === 3 || $images.rank === 4,\n `Error in resizeBilinear: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(\n size.length === 2,\n `Error in resizeBilinear: new shape must 2D, but got shape ` +\n `${size}.`);\n\n let batchImages = $images as Tensor4D;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages =\n $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]);\n }\n\n const [newHeight, newWidth] = size;\n const forward: ForwardFunc = (backend, save) =>\n backend.resizeBilinear(batchImages, newHeight, newWidth, alignCorners);\n\n const backward = (dy: Tensor4D, saved: Tensor[]) => {\n return {\n batchImages: () => ENV.engine.runKernel(\n backend =>\n backend.resizeBilinearBackprop(dy, batchImages, alignCorners),\n {})\n };\n };\n\n const res = ENV.engine.runKernel(forward, {batchImages}, backward);\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * NearestNeighbor resize a batch of 3D images to a new shape.\n *\n * @param images The images, of rank 4 or rank 3, of shape\n * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.\n * @param size The new shape `[newHeight, newWidth]` to resize the\n * images to. Each channel is resized individually.\n * @param alignCorners Defaults to False. If true, rescale\n * input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4\n * corners of images and resized images. If false, rescale by\n * `new_height / height`. Treat similarly the width dimension.\n */\n/** @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} */\nfunction resizeNearestNeighbor_(\n images: T|TensorLike, size: [number, number], alignCorners = false): T {\n const $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');\n util.assert(\n $images.rank === 3 || $images.rank === 4,\n `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got ` +\n `rank ${$images.rank}.`);\n util.assert(\n size.length === 2,\n `Error in resizeNearestNeighbor: new shape must 2D, but got shape ` +\n `${size}.`);\n util.assert(\n $images.dtype === 'float32' || $images.dtype === 'int32',\n '`images` must have `int32` or `float32` as dtype');\n\n let batchImages = $images as Tensor4D;\n let reshapedTo4D = false;\n if ($images.rank === 3) {\n reshapedTo4D = true;\n batchImages =\n $images.as4D(1, $images.shape[0], $images.shape[1], $images.shape[2]);\n }\n const [newHeight, newWidth] = size;\n\n const forward: ForwardFunc = (backend, save) =>\n backend.resizeNearestNeighbor(\n batchImages, newHeight, newWidth, alignCorners);\n\n const backward = (dy: Tensor4D, saved: Tensor[]) => {\n return {\n batchImages: () => ENV.engine.runKernel(\n backend => backend.resizeNearestNeighborBackprop(\n dy, batchImages, alignCorners),\n {})\n };\n };\n\n const res = ENV.engine.runKernel(forward, {batchImages}, backward);\n\n if (reshapedTo4D) {\n return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;\n }\n return res as T;\n}\n\n/**\n * Performs non maximum suppression of bounding boxes based on\n * iou (intersection over union)\n *\n * @param boxes a 2d tensor of shape `[numBoxes, 4]`. Each entry is\n * `[y1, x1, y2, x2]`, where `(y1, x1)` and `(y2, x2)` are the corners of\n * the bounding box.\n * @param scores a 1d tensor providing the box scores of shape `[numBoxes]`.\n * @param maxOutputSize The maximum number of boxes to be selected.\n * @param iouThreshold A float representing the threshold for deciding whether\n * boxes overlap too much with respect to IOU. Must be betwen [0, 1].\n * Defaults to 0.5 (50% box overlap).\n * @param scoreThreshold A threshold for deciding when to remove boxes based\n * on score. Defaults to -inf, which means any score is accepted.\n * @return A 1D tensor with the selected box indices.\n */\n/** @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} */\nfunction nonMaxSuppression_(\n boxes: Tensor2D|TensorLike, scores: Tensor1D|TensorLike,\n maxOutputSize: number, iouThreshold = 0.5,\n scoreThreshold = Number.NEGATIVE_INFINITY): Tensor1D {\n const $boxes = convertToTensor(boxes, 'boxes', 'nonMaxSuppression');\n const $scores = convertToTensor(scores, 'scores', 'nonMaxSuppression');\n\n const inputs = nonMaxSuppSanityCheck(\n $boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold);\n maxOutputSize = inputs.maxOutputSize;\n iouThreshold = inputs.iouThreshold;\n scoreThreshold = inputs.scoreThreshold;\n\n return ENV.engine.runKernel(\n b => b.nonMaxSuppression(\n $boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold),\n {$boxes});\n}\n\n/** This is the async version of `nonMaxSuppression` */\nasync function nonMaxSuppressionAsync_(\n boxes: Tensor2D|TensorLike, scores: Tensor1D|TensorLike,\n maxOutputSize: number, iouThreshold = 0.5,\n scoreThreshold = Number.NEGATIVE_INFINITY): Promise {\n const $boxes = convertToTensor(boxes, 'boxes', 'nonMaxSuppressionAsync');\n const $scores = convertToTensor(scores, 'scores', 'nonMaxSuppressionAsync');\n\n const inputs = nonMaxSuppSanityCheck(\n $boxes, $scores, maxOutputSize, iouThreshold, scoreThreshold);\n maxOutputSize = inputs.maxOutputSize;\n iouThreshold = inputs.iouThreshold;\n scoreThreshold = inputs.scoreThreshold;\n\n const boxesVals = await $boxes.data();\n const scoresVals = await $scores.data();\n const res = nonMaxSuppressionImpl(\n boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold);\n if ($boxes !== boxes) {\n $boxes.dispose();\n }\n if ($scores !== scores) {\n $scores.dispose();\n }\n return res;\n}\n\nfunction nonMaxSuppSanityCheck(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number):\n {maxOutputSize: number, iouThreshold: number, scoreThreshold: number} {\n if (iouThreshold == null) {\n iouThreshold = 0.5;\n }\n if (scoreThreshold == null) {\n scoreThreshold = Number.NEGATIVE_INFINITY;\n }\n const numBoxes = boxes.shape[0];\n maxOutputSize = Math.min(maxOutputSize, numBoxes);\n\n util.assert(\n 0 <= iouThreshold && iouThreshold <= 1,\n `iouThreshold must be in [0, 1], but was '${iouThreshold}'`);\n util.assert(\n boxes.rank === 2,\n `boxes must be a 2D tensor, but was of rank '${boxes.rank}'`);\n util.assert(\n boxes.shape[1] === 4,\n `boxes must have 4 columns, but 2nd dimension was ${boxes.shape[1]}`);\n util.assert(scores.rank === 1, 'scores must be a 1D tensor');\n util.assert(\n scores.shape[0] === numBoxes,\n `scores has incompatible shape with boxes. Expected ${numBoxes}, ` +\n `but was ${scores.shape[0]}`);\n return {maxOutputSize, iouThreshold, scoreThreshold};\n}\n\nexport const resizeBilinear = op({resizeBilinear_});\nexport const resizeNearestNeighbor = op({resizeNearestNeighbor_});\nexport const nonMaxSuppression = op({nonMaxSuppression_});\nexport const nonMaxSuppressionAsync = nonMaxSuppressionAsync_;\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as seedrandom from 'seedrandom';\nimport {ENV} from '../environment';\nimport {warn} from '../log';\nimport * as array_ops_util from '../ops/array_ops_util';\nimport * as axis_util from '../ops/axis_util';\nimport * as broadcast_util from '../ops/broadcast_util';\nimport * as concat_util from '../ops/concat_util';\nimport {Conv2DInfo} from '../ops/conv_util';\nimport * as erf_util from '../ops/erf_util';\nimport * as ops from '../ops/ops';\nimport {buffer, tensor3d, tensor4d} from '../ops/ops';\nimport * as selu_util from '../ops/selu_util';\nimport {getStridedSlicedInfo} from '../ops/slice_util';\nimport {DataId, setTensorTracker, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D} from '../tensor';\nimport {DataType, DataTypeMap, Rank, ShapeMap, TypedArray, upcastType} from '../types';\nimport * as util from '../util';\nimport {now} from '../util';\nimport {BackendTimingInfo, KernelBackend} from './backend';\nimport * as backend_util from './backend_util';\nimport {nonMaxSuppressionImpl} from './non_max_suppression_impl';\nimport {topkImpl} from './topk_impl';\nimport {whereImpl} from './where_impl';\n\nexport class MathBackendCPU implements KernelBackend {\n private data = new WeakMap();\n private canvas: HTMLCanvasElement;\n private firstUse = true;\n\n constructor() {\n if (ENV.get('IS_BROWSER')) {\n this.canvas = document.createElement('canvas');\n }\n }\n\n register(dataId: DataId, shape: number[], dtype: DataType): void {\n if (this.firstUse) {\n this.firstUse = false;\n if (ENV.get('IS_NODE')) {\n warn(\n '\\n============================\\n' +\n 'Hi there 👋. Looks like you are running TensorFlow.js in ' +\n 'Node.js. To speed things up dramatically, install our node ' +\n 'backend, which binds to TensorFlow C++, by running ' +\n 'npm i @tensorflow/tfjs-node, ' +\n 'or npm i @tensorflow/tfjs-node-gpu if you have CUDA. ' +\n 'Then call require(\\'@tensorflow/tfjs-node\\'); (-gpu ' +\n 'suffix for CUDA) at the start of your program. ' +\n 'Visit https://github.com/tensorflow/tfjs-node for more details.' +\n '\\n============================\\n');\n }\n }\n if (this.data.has(dataId)) {\n throw new Error(`Data buffer is already registered`);\n }\n this.data.set(dataId, null);\n }\n write(dataId: DataId, values: TypedArray): void {\n if (values == null) {\n throw new Error('MathBackendCPU.write(): values can not be null');\n }\n this.throwIfNoData(dataId);\n this.data.set(dataId, values);\n }\n fromPixels(\n pixels: ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement,\n numChannels: number): Tensor3D {\n if (pixels == null) {\n throw new Error('pixels passed to tf.fromPixels() can not be null');\n }\n let vals: Uint8ClampedArray;\n // tslint:disable-next-line:no-any\n if (ENV.get('IS_NODE') && (pixels as any).getContext == null) {\n throw new Error(\n 'When running in node, pixels must be an HTMLCanvasElement ' +\n 'like the one returned by the `canvas` npm package');\n }\n // tslint:disable-next-line:no-any\n if ((pixels as any).getContext != null) {\n // tslint:disable-next-line:no-any\n vals = (pixels as any)\n .getContext('2d')\n .getImageData(0, 0, pixels.width, pixels.height)\n .data;\n } else if (pixels instanceof ImageData) {\n vals = pixels.data;\n } else if (\n pixels instanceof HTMLImageElement ||\n pixels instanceof HTMLVideoElement) {\n if (this.canvas == null) {\n throw new Error(\n 'Can\\'t read pixels from HTMLImageElement outside ' +\n 'the browser.');\n }\n this.canvas.width = pixels.width;\n this.canvas.height = pixels.height;\n this.canvas.getContext('2d').drawImage(\n pixels, 0, 0, pixels.width, pixels.height);\n vals = this.canvas.getContext('2d')\n .getImageData(0, 0, pixels.width, pixels.height)\n .data;\n } else {\n throw new Error(\n 'pixels passed to tf.fromPixels() must be either an ' +\n `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ` +\n `ImageData, but was ${(pixels as {}).constructor.name}`);\n }\n let values: Int32Array;\n if (numChannels === 4) {\n values = new Int32Array(vals);\n } else {\n const numPixels = pixels.width * pixels.height;\n values = new Int32Array(numPixels * numChannels);\n for (let i = 0; i < numPixels; i++) {\n for (let channel = 0; channel < numChannels; ++channel) {\n values[i * numChannels + channel] = vals[i * 4 + channel];\n }\n }\n }\n const outShape: [number, number, number] =\n [pixels.height, pixels.width, numChannels];\n return tensor3d(values, outShape, 'int32');\n }\n async read(dataId: DataId): Promise {\n return this.readSync(dataId);\n }\n readSync(dataId: DataId): TypedArray {\n this.throwIfNoData(dataId);\n return this.data.get(dataId);\n }\n\n disposeData(dataId: DataId): void {\n if (this.data.has(dataId)) {\n this.data.delete(dataId);\n }\n }\n\n async time(f: () => void): Promise {\n const start = now();\n f();\n const kernelMs = now() - start;\n return {kernelMs};\n }\n memory() {\n return {\n // Unreliable due to automatic gc. The numbers above are cumulative.\n unreliable: true\n };\n }\n\n private throwIfNoData(dataId: DataId) {\n if (!this.data.has(dataId)) {\n throw new Error(\n `CPU backend: No data found for this tensor. ` +\n `Did you change your backend in the middle of the program? ` +\n `New backends can't use Tensors created with previous backends`);\n }\n }\n\n slice(x: T, begin: number[], size: number[]): T {\n const buffer = ops.buffer(size, x.dtype);\n\n for (let i = 0; i < buffer.size; ++i) {\n const loc = buffer.indexToLoc(i);\n const xLoc = loc.map((idx, j) => idx + begin[j]);\n buffer.set(x.get(...xLoc), ...loc);\n }\n return buffer.toTensor() as T;\n }\n\n stridedSlice(\n x: T, begin: number[], end: number[], strides: number[],\n beginMask: number, endMask: number): T {\n const [beginIndex, size] =\n getStridedSlicedInfo(x.shape, begin, end, strides, beginMask, endMask);\n\n if (size.some(axis => axis === 0)) {\n return ops.tensor([], size) as T;\n }\n\n const buffer = ops.buffer(size, x.dtype);\n\n for (let i = 0; i < buffer.size; i++) {\n const loc = buffer.indexToLoc(i);\n\n const newLoc: number[] = new Array(loc.length);\n for (let j = 0; j < newLoc.length; j++) {\n newLoc[j] = loc[j] * strides[j] + beginIndex[j];\n }\n buffer.set(x.get(...newLoc), ...loc);\n }\n\n return buffer.toTensor() as T;\n }\n\n reverse(x: T, axis: number[]): T {\n const buffer = ops.buffer(x.shape, x.dtype);\n const xBuffer = x.buffer();\n\n for (let i = 0; i < buffer.size; i++) {\n const outLoc = buffer.indexToLoc(i);\n const inLoc = outLoc.slice();\n axis.forEach(ax => inLoc[ax] = x.shape[ax] - 1 - inLoc[ax]);\n buffer.set(xBuffer.get(...inLoc), ...outLoc);\n }\n\n return buffer.toTensor() as T;\n }\n\n // Concats 2d tensors along axis=1. See comments in MathBackend.concat().\n concat(a: Tensor2D, b: Tensor2D): Tensor2D {\n const outShape = concat_util.computeOutShape(\n a.shape, b.shape, 1 /* axis */) as [number, number];\n const buffer = ops.buffer(outShape, a.dtype);\n\n if (a.shape[0] === 1 && b.shape[0] === 1) {\n // Use built-in TypedArray.set() method for speed.\n const aVals = a.dataSync();\n const bVals = b.dataSync();\n const vals = buffer.values;\n vals.set(aVals, 0);\n vals.set(bVals, a.size);\n return buffer.toTensor();\n }\n\n for (let i = 0; i < outShape[0]; ++i) {\n for (let j = 0; j < a.shape[1]; ++j) {\n buffer.set(a.get(i, j), i, j);\n }\n for (let j = 0; j < b.shape[1]; ++j) {\n buffer.set(b.get(i, j), i, j + a.shape[1]);\n }\n }\n return buffer.toTensor();\n }\n\n neg(x: T): T {\n return this.multiply(ops.scalar(-1), x) as T;\n }\n\n add(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, upcastType(a.dtype, b.dtype),\n (aValue, bValue) => aValue + bValue) as Tensor;\n }\n\n addN(tensors: T[]): T {\n const vals = tensors.map(t => t.dataSync());\n const result = ops.buffer(tensors[0].shape, tensors[0].dtype);\n const resultVals = result.values;\n for (let i = 0; i < tensors.length; i++) {\n const currVals = vals[i];\n for (let j = 0; j < resultVals.length; j++) {\n resultVals[j] += currVals[j];\n }\n }\n return result.toTensor() as T;\n }\n\n subtract(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, upcastType(a.dtype, b.dtype),\n (aValue, bValue) => aValue - bValue) as Tensor;\n }\n\n pow(a: T, b: Tensor): T {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aValue, bValue) => Math.pow(aValue, bValue)) as\n T;\n }\n\n matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean):\n Tensor2D {\n const sharedDim = transposeA ? a.shape[0] : a.shape[1];\n const leftDim = transposeA ? a.shape[1] : a.shape[0];\n const rightDim = transposeB ? b.shape[0] : b.shape[1];\n\n const aValues = a.dataSync();\n const bValues = b.dataSync();\n\n const [aOuterStep, aInnerStep] =\n transposeA ? [1, a.strides[0]] : [a.strides[0], 1];\n const [bOuterStep, bInnerStep] =\n transposeB ? [b.strides[0], 1] : [1, b.strides[0]];\n\n const aOuterEnd = leftDim * aOuterStep;\n const bOuterEnd = rightDim * bOuterStep;\n\n const result = new Float32Array(leftDim * rightDim);\n let resultIndex = 0;\n\n for (let aOuter = 0; aOuter < aOuterEnd; aOuter += aOuterStep) {\n for (let bOuter = 0; bOuter < bOuterEnd; bOuter += bOuterStep) {\n let aInner = aOuter;\n let bInner = bOuter;\n let sum = 0;\n for (let k = 0; k < sharedDim; ++k) {\n sum += aValues[aInner] * bValues[bInner];\n aInner += aInnerStep;\n bInner += bInnerStep;\n }\n result[resultIndex++] = sum;\n }\n }\n return ops.tensor2d(result, [leftDim, rightDim]);\n }\n\n multiply(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, upcastType(a.dtype, b.dtype),\n (aValue, bValue) => aValue * bValue) as Tensor;\n }\n\n realDivide(a: Tensor, b: Tensor): Tensor {\n const op = (a: number, b: number) => a / b;\n const outputDtype = 'float32';\n return this.broadcastedBinaryOp(a, b, outputDtype, op) as Tensor;\n }\n\n floorDiv(a: Tensor, b: Tensor): Tensor {\n const op = (a: number, b: number) => Math.floor(a / b);\n const outputDtype = 'int32';\n return this.broadcastedBinaryOp(a, b, outputDtype, op) as Tensor;\n }\n\n sum(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('sum', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const resultDtype = upcastType(x.dtype, 'int32');\n const result = ops.zeros(outShape, resultDtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let sum = 0;\n for (let j = 0; j < reduceSize; ++j) {\n sum += aVals[offset + j];\n }\n vals[i] = sum;\n }\n return result;\n }\n\n unsortedSegmentSum(\n x: T, segmentIds: Tensor1D, numSegments: number): Tensor {\n const res = [];\n\n // Reshape the segment id's so that they can be broadcast with\n // x. The new shape should be [segmentIds.shape, 1, ..., 1]\n const numIters = x.rank - segmentIds.rank;\n for (let i = 0; i < numIters; ++i) {\n segmentIds = segmentIds.expandDims(i + 1);\n }\n\n for (let i = 0; i < numSegments; ++i) {\n const segmentId = ops.scalar(i, 'int32');\n const mask = ops.equal(segmentId, segmentIds).asType('float32');\n const sum = mask.mul(x).sum(0);\n res.push(sum);\n }\n\n return ops.stack(res);\n }\n\n argMin(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMin', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, 'int32');\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let min = aVals[offset];\n let minIndex = 0;\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value < min) {\n min = value;\n minIndex = j;\n }\n }\n vals[i] = minIndex;\n }\n return result;\n }\n\n argMax(x: Tensor, axis: number): Tensor {\n const axes = [axis];\n axis_util.assertAxesAreInnerMostDims('argMax', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, 'int32');\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let max = aVals[offset];\n let maxIndex = 0;\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value > max) {\n max = value;\n maxIndex = j;\n }\n }\n vals[i] = maxIndex;\n }\n return result;\n }\n\n cumsum(x: Tensor, axis: number, exclusive: boolean, reverse: boolean):\n Tensor {\n if (axis !== x.rank - 1) {\n throw new Error(\n `backend.cumsum in CPU expects an inner-most axis=${x.rank - 1} ` +\n `but got axis=${axis}`);\n }\n const resultDtype = upcastType(x.dtype, 'int32');\n const result = ops.zeros(x.shape, resultDtype);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n const finalDim = x.shape[x.rank - 1];\n const indexAdjuster = reverse ?\n (i: number, j: number) => i + finalDim - j - 1 :\n (i: number, j: number) => i + j;\n for (let i = 0; i < aVals.length; i += finalDim) {\n for (let j = 0; j < finalDim; j++) {\n const idx = indexAdjuster(i, j);\n if (j === 0) {\n vals[idx] = exclusive ? 0 : aVals[idx];\n } else {\n const prevIdx = indexAdjuster(i, j - 1);\n vals[idx] = exclusive ? aVals[prevIdx] + vals[prevIdx] :\n aVals[idx] + vals[prevIdx];\n }\n }\n }\n return result;\n }\n\n equal(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal === bVal) ? 1 : 0;\n });\n }\n\n notEqual(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal !== bVal) ? 1 : 0;\n });\n }\n\n less(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal < bVal) ? 1 : 0;\n });\n }\n\n lessEqual(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal <= bVal) ? 1 : 0;\n });\n }\n\n greater(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal > bVal) ? 1 : 0;\n });\n }\n\n greaterEqual(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return (aVal >= bVal) ? 1 : 0;\n });\n }\n\n logicalNot(x: T): T {\n const values = x.dataSync();\n const newValues = new Int32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = values[i] ? 0 : 1;\n }\n return Tensor.make(x.shape, {values: newValues}, 'bool') as T;\n }\n\n logicalAnd(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return aVal && bVal;\n });\n }\n\n logicalOr(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, 'bool', (aVal, bVal) => {\n return aVal || bVal;\n });\n }\n\n select(condition: Tensor, a: Tensor, b: Tensor): Tensor {\n const values = condition.dataSync();\n const aValues = a.dataSync();\n const bValues = b.dataSync();\n const result = ops.zeros(a.shape, upcastType(a.dtype, b.dtype));\n const newValues = result.dataSync();\n let index = 0;\n const offset = condition.rank === 0 || condition.rank > 1 || a.rank === 1 ?\n 1 :\n a.shape[1];\n\n for (let i = 0; i < values.length; i++) {\n for (let j = 0; j < offset; j++) {\n if (values[i] === 1) {\n newValues[index++] = aValues[i];\n } else {\n newValues[index++] = bValues[i];\n }\n }\n }\n return result;\n }\n\n where(condition: Tensor): Tensor2D {\n const condVals = condition.dataSync();\n return whereImpl(condition.shape, condVals);\n }\n\n topk(x: T, k: number, sorted: boolean): [T, T] {\n const xVals = x.dataSync();\n return topkImpl(xVals, x.shape, x.dtype, k, sorted);\n }\n\n min(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('min', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let min = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value < min) {\n min = value;\n }\n }\n vals[i] = min;\n }\n return result;\n }\n\n minimum(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aVal, bVal) => Math.min(aVal, bVal));\n }\n\n mod(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, a.dtype, (aVal, bVal) => {\n const rem = aVal % bVal;\n if ((aVal < 0 && bVal < 0) || (aVal >= 0 && bVal >= 0)) {\n return rem;\n } else {\n return (rem + bVal) % bVal;\n }\n });\n }\n\n max(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('max', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let max = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n if (value > max) {\n max = value;\n }\n }\n vals[i] = max;\n }\n return result;\n }\n\n maximum(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aVal, bVal) => Math.max(aVal, bVal));\n }\n\n all(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('all', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let all = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n all = all && value;\n }\n vals[i] = all;\n }\n return result;\n }\n\n any(x: Tensor, axes: number[]): Tensor {\n axis_util.assertAxesAreInnerMostDims('any', axes, x.rank);\n const [outShape, reduceShape] =\n axis_util.computeOutAndReduceShapes(x.shape, axes);\n const result = ops.zeros(outShape, x.dtype);\n const reduceSize = util.sizeFromShape(reduceShape);\n const vals = result.dataSync();\n\n const aVals = x.dataSync();\n for (let i = 0; i < vals.length; ++i) {\n const offset = i * reduceSize;\n let anyVal = aVals[offset];\n for (let j = 0; j < reduceSize; ++j) {\n const value = aVals[offset + j];\n anyVal = anyVal || value;\n }\n vals[i] = anyVal;\n }\n return result;\n }\n\n squaredDifference(a: Tensor, b: Tensor): Tensor {\n return this.broadcastedBinaryOp(a, b, a.dtype, (aVal, bVal) => {\n const diff = aVal - bVal;\n return diff * diff;\n });\n }\n\n ceil(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.ceil(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n floor(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.floor(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n sign(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n if (values[i] < 0) {\n newValues[i] = -1;\n } else if (values[i] > 0) {\n newValues[i] = 1;\n } else {\n newValues[i] = 0;\n }\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n round(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n // The algorithm is based on banker's rounding.\n const base = Math.floor(values[i]);\n if (values[i] - base < 0.5) {\n newValues[i] = Math.floor(values[i]);\n } else if (values[i] - base > 0.5) {\n newValues[i] = Math.ceil(values[i]);\n } else {\n if (base % 2.0 === 0.0) {\n newValues[i] = base;\n } else {\n newValues[i] = base + 1.0;\n }\n }\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n exp(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.exp(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n expm1(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = Math.expm1(values[i]);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n log(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = Math.log(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n log1p(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = Math.log1p(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n sqrt(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = Math.sqrt(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n rsqrt(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = 1 / Math.sqrt(value);\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n square(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n newValues[i] = value * value;\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n reciprocal(x: T): T {\n const values = x.dataSync();\n const newValues = new Float32Array(values.length);\n for (let i = 0; i < values.length; ++i) {\n newValues[i] = 1 / values[i];\n }\n return Tensor.make(x.shape, {values: newValues}) as T;\n }\n\n relu(x: T): T {\n const res = ops.zeros(x.shape, x.dtype);\n const resVals = res.dataSync();\n const inVals = x.dataSync();\n for (let i = 0; i < inVals.length; ++i) {\n resVals[i] = Math.max(0, inVals[i]);\n }\n return res as T;\n }\n\n elu(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n if (v >= 0) {\n resultValues[i] = v;\n } else {\n resultValues[i] = (Math.exp(v) - 1);\n }\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n eluDer(dy: T, y: T): T {\n const resultValues = new Float32Array(y.size);\n const values = y.dataSync();\n const dyValues = dy.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n if (v >= 1) {\n resultValues[i] = dyValues[i];\n } else {\n resultValues[i] = dyValues[i] * (v + 1);\n }\n }\n return Tensor.make(y.shape, {values: resultValues}) as T;\n }\n\n selu(x: T): T {\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n const scaleAlpha = selu_util.SELU_SCALEALPHA;\n const scale = selu_util.SELU_SCALE;\n\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n if (v >= 0) {\n resultValues[i] = scale * v;\n } else {\n resultValues[i] = scaleAlpha * (Math.exp(v) - 1);\n }\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n clip(x: T, min: number, max: number): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.min(max, Math.max(min, values[i]));\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n abs(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.abs(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n int(x: T): T {\n const resultValues = new Int32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = values[i];\n }\n return Tensor.make(x.shape, {values: resultValues}, 'int32');\n }\n\n sigmoid(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = 1 / (1 + Math.exp(-values[i]));\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n softplus(x: T): T {\n // mirrors the implementation of tf.nn.softplus: https://goo.gl/vkcvwX\n\n // epsilon is the difference between 1.0 and the next representable float.\n // For a single precision 32 bit float this should be 2^-23, see:\n // https://math.byu.edu/~schow/work/IEEEFloatingPoint.htm\n const epsilon = 1.1920928955078125e-7;\n const threshold = Math.log(epsilon) + 2.0;\n\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n\n for (let i = 0; i < values.length; ++i) {\n // Value above which exp(x) may overflow, but softplus(x) == x\n // is within machine epsilon.\n const tooLarge = values[i] > -threshold;\n\n // Value below which exp(x) may underflow, but softplus(x) == exp(x)\n // is within machine epsilon.\n const tooSmall = values[i] < threshold;\n\n const expX = Math.exp(values[i]);\n let result;\n\n if (tooSmall) {\n result = expX;\n } else if (tooLarge) {\n result = values[i];\n } else {\n result = Math.log(1.0 + expX);\n }\n resultValues[i] = result;\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n sin(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.sin(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n cos(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.cos(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n tan(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.tan(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n asin(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.asin(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n acos(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.acos(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n atan(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.atan(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n atan2(a: T, b: T): T {\n return this.broadcastedBinaryOp(\n a, b, a.dtype, (aValue, bValue) => Math.atan2(aValue, bValue)) as\n T;\n }\n\n sinh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.sinh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n cosh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.cosh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n tanh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = util.tanh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n asinh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.asinh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n acosh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.acosh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n atanh(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n resultValues[i] = Math.atanh(values[i]);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n erf(x: T): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n const p = erf_util.ERF_P;\n const a1 = erf_util.ERF_A1;\n const a2 = erf_util.ERF_A2;\n const a3 = erf_util.ERF_A3;\n const a4 = erf_util.ERF_A4;\n const a5 = erf_util.ERF_A5;\n for (let i = 0; i < values.length; ++i) {\n const v = values[i];\n const t = 1.0 / (1.0 + p * v);\n resultValues[i] = 1.0 -\n (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t *\n Math.exp(-v * v);\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n step(x: T, alpha = 0): T {\n const resultValues = new Float32Array(x.size);\n const values = x.dataSync();\n for (let i = 0; i < values.length; ++i) {\n const value = values[i];\n if (isNaN(value)) {\n resultValues[i] = NaN;\n } else {\n resultValues[i] = value > 0 ? 1 : alpha;\n }\n }\n return Tensor.make(x.shape, {values: resultValues}) as T;\n }\n\n conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const padLeft = convInfo.padInfo.left;\n const padTop = convInfo.padInfo.top;\n const y = ops.buffer(convInfo.outShape, x.dtype);\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d2 = 0; d2 < convInfo.outChannels; ++d2) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * convInfo.strideHeight - padLeft;\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * convInfo.strideWidth - padTop;\n\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; wR++) {\n const xR = xRCorner + wR * dilationHeight;\n\n if (xR < 0 || xR >= convInfo.inHeight) {\n continue;\n }\n\n for (let wC = 0; wC < filterWidth; wC++) {\n const xC = xCCorner + wC * dilationWidth;\n\n if (xC < 0 || xC >= convInfo.inWidth) {\n continue;\n }\n\n for (let d1 = 0; d1 < convInfo.inChannels; ++d1) {\n const pixel = x.get(b, xR, xC, d1);\n const weight = filter.get(wR, wC, d1, d2);\n dotProd += pixel * weight;\n }\n }\n }\n y.set(dotProd, b, yR, yC, d2);\n }\n }\n }\n }\n return y.toTensor();\n }\n\n conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const dx = ops.buffer(convInfo.inShape, 'float32');\n const dxValues = dx.values;\n const [dxS0, dxS1, dxS2] = dx.strides;\n const dyValues = dy.dataSync();\n const [dyS0, dyS1, dyS2] = dy.strides;\n const fltValues = filter.dataSync();\n const [fltS0, fltS1, fltS2] = filter.strides;\n const {\n batchSize,\n filterHeight,\n filterWidth,\n inChannels,\n inHeight,\n inWidth,\n outChannels,\n outHeight,\n outWidth,\n strideHeight,\n strideWidth\n } = convInfo;\n const topPad = filterHeight - 1 - convInfo.padInfo.top;\n const leftPad = filterWidth - 1 - convInfo.padInfo.left;\n\n for (let b = 0; b < batchSize; ++b) {\n for (let d1 = 0; d1 < inChannels; ++d1) {\n for (let xR = 0; xR < inHeight; ++xR) {\n const xRCorner = xR - topPad;\n const xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));\n const yRMax =\n Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);\n\n for (let xC = 0; xC < inWidth; ++xC) {\n const xCCorner = xC - leftPad;\n const xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));\n const yCMax =\n Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);\n\n let dotProd = 0;\n for (let yR = xRMin; yR < yRMax; ++yR) {\n const wR = yR * strideHeight - xRCorner;\n\n for (let yC = xCMin; yC < yCMax; ++yC) {\n const wC = yC * strideWidth - xCCorner;\n const dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC;\n const fltOffset = fltS0 * (filterHeight - 1 - wR) +\n fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;\n\n for (let d2 = 0; d2 < outChannels; ++d2) {\n const pixel = dyValues[dyOffset + d2];\n const weight = fltValues[fltOffset + d2];\n dotProd += pixel * weight;\n }\n }\n }\n dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd;\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n conv2dDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dW = ops.buffer(convInfo.filterShape, 'float32');\n\n const leftPad = convInfo.padInfo.left;\n const topPad = convInfo.padInfo.top;\n\n for (let wR = 0; wR < filterHeight; ++wR) {\n const yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));\n const yRMax = Math.min(\n convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);\n\n for (let wC = 0; wC < filterWidth; ++wC) {\n const yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));\n const yCMax = Math.min(\n convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);\n\n for (let d1 = 0; d1 < convInfo.inChannels; ++d1) {\n for (let d2 = 0; d2 < convInfo.outChannels; ++d2) {\n // Need to convolve.\n let dotProd = 0;\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let yR = yRMin; yR < yRMax; ++yR) {\n const xR = wR + yR * strideHeight - topPad;\n for (let yC = yCMin; yC < yCMax; ++yC) {\n const xC = wC + yC * strideWidth - leftPad;\n dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2);\n }\n }\n }\n dW.set(dotProd, wR, wC, d1, d2);\n }\n }\n }\n }\n return dW.toTensor();\n }\n\n depthwiseConv2D(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dilationHeight = convInfo.dilationHeight;\n const dilationWidth = convInfo.dilationWidth;\n const padLeft = convInfo.padInfo.left;\n const padTop = convInfo.padInfo.top;\n const chMul = convInfo.outChannels / convInfo.inChannels;\n const y = ops.buffer(convInfo.outShape, x.dtype);\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d1 = 0; d1 < convInfo.inChannels; ++d1) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * convInfo.strideHeight - padLeft;\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * convInfo.strideWidth - padTop;\n for (let q = 0; q < chMul; ++q) {\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; ++wR) {\n const xR = xRCorner + wR * dilationHeight;\n\n if (xR < 0 || xR >= convInfo.inHeight) {\n continue;\n }\n\n for (let wC = 0; wC < filterWidth; ++wC) {\n const xC = xCCorner + wC * dilationWidth;\n\n if (xC < 0 || xC >= convInfo.inWidth) {\n continue;\n }\n\n const pixel = x.get(b, xR, xC, d1);\n const weight = filter.get(wR, wC, d1, q);\n dotProd += pixel * weight;\n }\n }\n y.set(dotProd, b, yR, yC, d1 * chMul + q);\n }\n }\n }\n }\n }\n\n return y.toTensor();\n }\n\n depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const dx = ops.buffer(convInfo.inShape, 'float32');\n const dxValues = dx.values;\n const [dxS0, dxS1, dxS2] = dx.strides;\n const dyValues = dy.dataSync();\n const [dyS0, dyS1, dyS2] = dy.strides;\n const fltValues = filter.dataSync();\n const [fltS0, fltS1, fltS2] = filter.strides;\n const {\n batchSize,\n filterHeight,\n filterWidth,\n inChannels,\n inHeight,\n inWidth,\n outChannels,\n outHeight,\n outWidth,\n strideHeight,\n strideWidth\n } = convInfo;\n const topPad = filterHeight - 1 - convInfo.padInfo.top;\n const leftPad = filterWidth - 1 - convInfo.padInfo.left;\n const chMul = outChannels / inChannels;\n\n for (let b = 0; b < batchSize; ++b) {\n for (let d1 = 0; d1 < inChannels; ++d1) {\n for (let xR = 0; xR < inHeight; ++xR) {\n const xRCorner = xR - topPad;\n const xRMin = Math.max(0, Math.ceil(xRCorner / strideHeight));\n const yRMax =\n Math.min(outHeight, (filterHeight + xRCorner) / strideHeight);\n\n for (let xC = 0; xC < inWidth; ++xC) {\n const xCCorner = xC - leftPad;\n const xCMin = Math.max(0, Math.ceil(xCCorner / strideWidth));\n const yCMax =\n Math.min(outWidth, (filterWidth + xCCorner) / strideWidth);\n\n let dotProd = 0;\n for (let yR = xRMin; yR < yRMax; ++yR) {\n const wR = yR * strideHeight - xRCorner;\n\n for (let yC = xCMin; yC < yCMax; ++yC) {\n const wC = yC * strideWidth - xCCorner;\n const dyOffset = dyS0 * b + dyS1 * yR + dyS2 * yC;\n const fltOffset = fltS0 * (filterHeight - 1 - wR) +\n fltS1 * (filterWidth - 1 - wC) + fltS2 * d1;\n\n for (let dm = 0; dm < chMul; ++dm) {\n const d2 = d1 * chMul + dm;\n const pixel = dyValues[dyOffset + d2];\n const weight = fltValues[fltOffset + dm];\n dotProd += pixel * weight;\n }\n }\n }\n dxValues[dxS0 * b + dxS1 * xR + dxS2 * xC + d1] = dotProd;\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n depthwiseConv2DDerFilter(x: Tensor4D, dy: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const dW = ops.buffer(convInfo.filterShape, 'float32');\n\n const leftPad = convInfo.padInfo.left;\n const topPad = convInfo.padInfo.top;\n const chMul = convInfo.outChannels / convInfo.inChannels;\n\n for (let wR = 0; wR < filterHeight; ++wR) {\n const yRMin = Math.max(0, Math.ceil((topPad - wR) / strideHeight));\n const yRMax = Math.min(\n convInfo.outHeight, (convInfo.inHeight + topPad - wR) / strideHeight);\n\n for (let wC = 0; wC < filterWidth; ++wC) {\n const yCMin = Math.max(0, Math.ceil((leftPad - wC) / strideWidth));\n const yCMax = Math.min(\n convInfo.outWidth, (convInfo.inWidth + leftPad - wC) / strideWidth);\n\n for (let d2 = 0; d2 < convInfo.outChannels; ++d2) {\n const d1 = Math.trunc(d2 / chMul);\n const dm = d2 % chMul;\n\n let dotProd = 0;\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let yR = yRMin; yR < yRMax; ++yR) {\n const xR = wR + yR * strideHeight - topPad;\n for (let yC = yCMin; yC < yCMax; ++yC) {\n const xC = wC + yC * strideWidth - leftPad;\n dotProd += x.get(b, xR, xC, d1) * dy.get(b, yR, yC, d2);\n }\n }\n }\n dW.set(dotProd, wR, wC, d1, dm);\n }\n }\n }\n return dW.toTensor();\n }\n\n tile(x: T, reps: number[]): T {\n const newShape: number[] = new Array(x.rank);\n for (let i = 0; i < newShape.length; i++) {\n newShape[i] = x.shape[i] * reps[i];\n }\n const result = ops.buffer(newShape, x.dtype);\n const xBuf = x.buffer();\n for (let i = 0; i < result.values.length; ++i) {\n const newLoc = result.indexToLoc(i);\n\n const originalLoc: number[] = new Array(x.rank);\n for (let i = 0; i < originalLoc.length; i++) {\n originalLoc[i] = newLoc[i] % x.shape[i];\n }\n\n const originalIndex = xBuf.locToIndex(originalLoc);\n\n result.values[i] = xBuf.values[originalIndex];\n }\n return result.toTensor() as T;\n }\n\n pad(\n x: T, paddings: Array<[number, number]>, constantValue: number): T {\n const outShape = paddings.map(\n (p, i) => p[0] /* beforePad */ + x.shape[i] + p[1] /* afterPad */);\n const start = paddings.map(p => p[0]);\n const xBuffer = x.buffer();\n const buffer = ops.buffer(outShape, x.dtype);\n if (constantValue !== 0) {\n buffer.values.fill(constantValue);\n }\n\n for (let i = 0; i < x.size; i++) {\n const coords = xBuffer.indexToLoc(i);\n const outCoords = coords.map((c, i) => c + start[i]);\n buffer.set(x.get(...coords), ...outCoords);\n }\n return buffer.toTensor() as T;\n }\n\n transpose(x: T, perm: number[]): T {\n const newShape: number[] = new Array(x.rank);\n for (let i = 0; i < newShape.length; i++) {\n newShape[i] = x.shape[perm[i]];\n }\n const values = x.dataSync();\n const result = buffer(newShape, x.dtype);\n\n const xBuf = x.buffer();\n for (let i = 0; i < x.size; ++i) {\n const loc = xBuf.indexToLoc(i);\n\n // Permute location.\n const newLoc: number[] = new Array(loc.length);\n for (let i = 0; i < newLoc.length; i++) {\n newLoc[i] = loc[perm[i]];\n }\n\n const newIndex = result.locToIndex(newLoc);\n result.values[newIndex] = values[i];\n }\n return result.toTensor() as T;\n }\n\n gather(x: T, indices: Tensor1D, axis: number): T {\n const newShape: number[] = x.shape.slice();\n const indicesValues = indices.dataSync();\n newShape[axis] = indicesValues.length;\n const result = buffer(newShape, x.dtype);\n const xBuf = x.buffer();\n\n for (let i = 0; i < result.size; ++i) {\n const newLoc = result.indexToLoc(i);\n\n const originalLoc: number[] = newLoc.slice();\n originalLoc[axis] = indicesValues[newLoc[axis]];\n\n const originalIndex = xBuf.locToIndex(originalLoc);\n result.values[i] = xBuf.values[originalIndex];\n }\n return result.toTensor() as T;\n }\n\n batchToSpaceND(\n x: T, blockShape: number[], crops: number[][]): T {\n const prod = blockShape.reduce((a, b) => a * b);\n\n const reshaped = array_ops_util.getReshaped(x.shape, blockShape, prod);\n const permuted =\n array_ops_util.getPermuted(reshaped.length, blockShape.length);\n const reshapedPermuted =\n array_ops_util.getReshapedPermuted(x.shape, blockShape, prod);\n const sliceBeginCoords =\n array_ops_util.getSliceBeginCoords(crops, blockShape.length);\n const sliceSize =\n array_ops_util.getSliceSize(reshapedPermuted, crops, blockShape.length);\n\n return x.reshape(reshaped)\n .transpose(permuted)\n .reshape(reshapedPermuted)\n .slice(sliceBeginCoords, sliceSize) as T;\n }\n\n spaceToBatchND(\n x: T, blockShape: number[], paddings: Array<[number, number]>): T {\n const prod = blockShape.reduce((a, b) => a * b);\n\n const completePaddings: Array<[number, number]> = [[0, 0]];\n completePaddings.push(...paddings);\n for (let i = 1 + blockShape.length; i < x.shape.length; ++i) {\n completePaddings.push([0, 0]);\n }\n\n const paddedX = x.pad(completePaddings);\n\n const reshapedPaddedShape =\n array_ops_util.getReshaped(paddedX.shape, blockShape, prod, false);\n const permutedReshapedPaddedPermutation = array_ops_util.getPermuted(\n reshapedPaddedShape.length, blockShape.length, false);\n const flattenShape = array_ops_util.getReshapedPermuted(\n paddedX.shape, blockShape, prod, false);\n\n return paddedX.reshape(reshapedPaddedShape)\n .transpose(permutedReshapedPaddedPermutation)\n .reshape(flattenShape) as T;\n }\n\n private pool(x: Tensor4D, convInfo: Conv2DInfo, poolType: 'max'|'avg'):\n Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const y = ops.buffer(convInfo.outShape, 'float32');\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * strideHeight - padTop;\n const xRMin = Math.max(0, xRCorner);\n const xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner);\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * strideWidth - padLeft;\n const xCMin = Math.max(0, xCCorner);\n const xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner);\n\n let minMaxValue =\n (poolType === 'max' ? Number.NEGATIVE_INFINITY :\n Number.POSITIVE_INFINITY);\n let avgValue = 0;\n let count = 0;\n for (let xR = xRMin; xR < xRMax; ++xR) {\n for (let xC = xCMin; xC < xCMax; ++xC) {\n const pixel = x.get(b, xR, xC, d);\n if ((poolType === 'max' && pixel > minMaxValue)) {\n minMaxValue = pixel;\n } else if (poolType === 'avg') {\n avgValue += pixel;\n count++;\n }\n }\n if (isNaN(minMaxValue)) {\n break;\n }\n }\n y.set(\n poolType === 'avg' ? avgValue / count : minMaxValue, b, yR, yC,\n d);\n }\n }\n }\n }\n return y.toTensor();\n }\n\n maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return this.pool(x, convInfo, 'max');\n }\n\n private maxPoolPositions(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const maxPositions = ops.buffer(convInfo.outShape, 'int32');\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const padTop = convInfo.padInfo.top;\n const padLeft = convInfo.padInfo.left;\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let yR = 0; yR < convInfo.outHeight; ++yR) {\n const xRCorner = yR * strideHeight - padTop;\n const xRMin = Math.max(0, xRCorner);\n const xRMax = Math.min(convInfo.inHeight, filterHeight + xRCorner);\n for (let yC = 0; yC < convInfo.outWidth; ++yC) {\n const xCCorner = yC * strideWidth - padLeft;\n const xCMin = Math.max(0, xCCorner);\n const xCMax = Math.min(convInfo.inWidth, filterWidth + xCCorner);\n let maxValue = Number.NEGATIVE_INFINITY;\n let maxPosition = -1;\n for (let xR = xRMin; xR < xRMax; ++xR) {\n const wR = xR - xRCorner;\n for (let xC = xCMin; xC < xCMax; ++xC) {\n const wC = xC - xCCorner;\n const pixel = x.get(b, xR, xC, d);\n if (pixel > maxValue) {\n maxValue = pixel;\n maxPosition = wR * filterWidth + wC;\n }\n }\n }\n maxPositions.set(maxPosition, b, yR, yC, d);\n }\n }\n }\n }\n return maxPositions.toTensor();\n }\n\n maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo):\n Tensor4D {\n const maxPositions = this.maxPoolPositions(x, convInfo);\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const dx = ops.buffer(x.shape, 'float32');\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let dxR = 0; dxR < convInfo.inHeight; ++dxR) {\n for (let dxC = 0; dxC < convInfo.inWidth; ++dxC) {\n // Shader code begins.\n const dyRCorner = dxR - padTop;\n const dyCCorner = dxC - padLeft;\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; ++wR) {\n const dyR = (dyRCorner + wR) / strideHeight;\n if (dyR < 0 || dyR >= convInfo.outHeight ||\n Math.floor(dyR) !== dyR) {\n continue;\n }\n for (let wC = 0; wC < filterWidth; ++wC) {\n const dyC = (dyCCorner + wC) / strideWidth;\n if (dyC < 0 || dyC >= convInfo.outWidth ||\n Math.floor(dyC) !== dyC) {\n continue;\n }\n const maxPos = filterHeight * filterWidth - 1 -\n maxPositions.get(b, dyR, dyC, d);\n const curPos = wR * filterWidth + wC;\n\n const mask = maxPos === curPos ? 1 : 0;\n if (mask === 0) {\n continue;\n }\n\n const pixel = dy.get(b, dyR, dyC, d);\n dotProd += pixel * mask;\n }\n }\n dx.set(dotProd, b, dxR, dxC, d);\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n const strideHeight = convInfo.strideHeight;\n const strideWidth = convInfo.strideWidth;\n const filterHeight = convInfo.filterHeight;\n const filterWidth = convInfo.filterWidth;\n const padLeft = filterWidth - 1 - convInfo.padInfo.left;\n const padTop = filterHeight - 1 - convInfo.padInfo.top;\n const dx = ops.buffer(x.shape, 'float32');\n\n const avgMultiplier = 1 / (filterHeight * filterWidth);\n\n for (let b = 0; b < convInfo.batchSize; ++b) {\n for (let d = 0; d < convInfo.inChannels; ++d) {\n for (let dxR = 0; dxR < convInfo.inHeight; ++dxR) {\n for (let dxC = 0; dxC < convInfo.inWidth; ++dxC) {\n // Shader code begins.\n const dyRCorner = dxR - padTop;\n const dyCCorner = dxC - padLeft;\n let dotProd = 0;\n for (let wR = 0; wR < filterHeight; ++wR) {\n const dyR = (dyRCorner + wR) / strideHeight;\n if (dyR < 0 || dyR >= convInfo.outHeight ||\n Math.floor(dyR) !== dyR) {\n continue;\n }\n for (let wC = 0; wC < filterWidth; ++wC) {\n const dyC = (dyCCorner + wC) / strideWidth;\n if (dyC < 0 || dyC >= convInfo.outWidth ||\n Math.floor(dyC) !== dyC) {\n continue;\n }\n\n const pixel = dy.get(b, dyR, dyC, d);\n dotProd += pixel;\n }\n }\n dx.set(dotProd * avgMultiplier, b, dxR, dxC, d);\n }\n }\n }\n }\n return dx.toTensor();\n }\n\n cast(x: T, dtype: DataType): T {\n return backend_util.castTensor(x, dtype, this);\n }\n\n reshape(x: Tensor, shape: ShapeMap[R]): Tensor {\n return backend_util.reshapeTensor(x, shape);\n }\n\n avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D {\n return this.pool(x, convInfo, 'avg').toFloat();\n }\n\n resizeBilinear(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const [batch, oldHeight, oldWidth, numChannels] = x.shape;\n const output =\n ops.buffer([batch, newHeight, newWidth, numChannels], x.dtype);\n\n const effectiveInputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < newHeight; r++) {\n for (let c = 0; c < newWidth; c++) {\n for (let d = 0; d < numChannels; d++) {\n // Begin shader.\n\n // Compute the fractional index of the source.\n const sourceFracRow =\n (effectiveInputSize[0]) * r / (effectiveOutputSize[0]);\n const sourceFracCol =\n (effectiveInputSize[1]) * c / (effectiveOutputSize[1]);\n\n const sourceRowFloor = Math.floor(sourceFracRow);\n const sourceRowCeil =\n Math.min(oldHeight - 1, Math.ceil(sourceFracRow));\n const sourceColFloor = Math.floor(sourceFracCol);\n const sourceColCeil =\n Math.min(oldWidth - 1, Math.ceil(sourceFracCol));\n\n const topLeft = x.get(b, sourceRowFloor, sourceColFloor, d);\n const bottomLeft = x.get(b, sourceRowCeil, sourceColFloor, d);\n const topRight = x.get(b, sourceRowFloor, sourceColCeil, d);\n const bottomRight = x.get(b, sourceRowCeil, sourceColCeil, d);\n\n const rowFrac = sourceFracRow - sourceRowFloor;\n const colFrac = sourceFracCol - sourceColFloor;\n\n const top = topLeft + (topRight - topLeft) * colFrac;\n const bottom = bottomLeft + (bottomRight - bottomLeft) * colFrac;\n const newValue = top + (bottom - top) * rowFrac;\n\n output.set(newValue, b, r, c, d);\n }\n }\n }\n }\n return output.toTensor();\n }\n\n resizeBilinearBackprop(dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n const [batch, xHeight, xWidth, depth] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n const output =\n ops.buffer([batch, xHeight, xWidth, depth], x.dtype);\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass and add the corresponding\n // coefficient from dy to the gradient (with some interpolation).\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n // Reference implementation\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/3039375c86a5bbc9610c7725dcaa95d635f87ba2/tensorflow/core/kernels/resize_bilinear_op.cc#L275\n\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < yHeight; r++) {\n const dxR = r * heightScale;\n const topDxRIndex = Math.floor(dxR);\n const bottomDxRIndex = Math.min(Math.ceil(dxR), xHeight - 1);\n const dxRLerp = dxR - topDxRIndex;\n const inverseDxRLerp = 1.0 - dxRLerp;\n\n for (let c = 0; c < yWidth; c++) {\n const dxC = c * widthScale;\n const leftDxCIndex = Math.floor(dxC);\n const rightDxCIndex = Math.min(Math.ceil(dxC), xWidth - 1);\n const dxCLerp = dxC - leftDxCIndex;\n const inverseDxCLerp = 1.0 - dxCLerp;\n\n for (let d = 0; d < depth; d++) {\n const dyVal = dy.get(b, r, c, d);\n\n let topLeft = output.get(b, topDxRIndex, leftDxCIndex, d);\n topLeft += dyVal * inverseDxRLerp * inverseDxCLerp;\n output.set(topLeft, b, topDxRIndex, leftDxCIndex, d);\n\n let topRight = output.get(b, topDxRIndex, rightDxCIndex, d);\n topRight += dyVal * inverseDxRLerp * dxCLerp;\n output.set(topRight, b, topDxRIndex, rightDxCIndex, d);\n\n let bottomLeft = output.get(b, bottomDxRIndex, leftDxCIndex, d);\n bottomLeft += dyVal * dxRLerp * inverseDxCLerp;\n output.set(bottomLeft, b, bottomDxRIndex, leftDxCIndex, d);\n\n let bottomRight = output.get(b, bottomDxRIndex, rightDxCIndex, d);\n bottomRight += dyVal * dxRLerp * dxCLerp;\n output.set(bottomRight, b, bottomDxRIndex, rightDxCIndex, d);\n }\n }\n }\n }\n\n return output.toTensor();\n }\n\n resizeNearestNeighbor(\n x: Tensor4D, newHeight: number, newWidth: number,\n alignCorners: boolean): Tensor4D {\n const [batch, oldHeight, oldWidth, numChannels] = x.shape;\n const output =\n ops.buffer([batch, newHeight, newWidth, numChannels], x.dtype);\n\n const effectiveInputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? oldHeight - 1 : oldHeight,\n (alignCorners && newWidth > 1) ? oldWidth - 1 : oldWidth\n ];\n\n const effectiveOutputSize: [number, number] = [\n (alignCorners && newHeight > 1) ? newHeight - 1 : newHeight,\n (alignCorners && newWidth > 1) ? newWidth - 1 : newWidth\n ];\n\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < newHeight; r++) {\n for (let c = 0; c < newWidth; c++) {\n for (let d = 0; d < numChannels; d++) {\n // Begin shader.\n // Compute the fractional index of the source.\n const sourceFracRow =\n (effectiveInputSize[0]) * r / (effectiveOutputSize[0]);\n const sourceFracCol =\n (effectiveInputSize[1]) * c / (effectiveOutputSize[1]);\n const sourceNearestRow = Math.min(\n oldHeight - 1,\n alignCorners ? Math.round(sourceFracRow) :\n Math.floor(sourceFracRow));\n const sourceNearestCol = Math.min(\n oldWidth - 1,\n alignCorners ? Math.round(sourceFracCol) :\n Math.floor(sourceFracCol));\n const newValue = x.get(b, sourceNearestRow, sourceNearestCol, d);\n output.set(newValue, b, r, c, d);\n }\n }\n }\n }\n\n return output.toTensor();\n }\n\n resizeNearestNeighborBackprop(\n dy: Tensor4D, x: Tensor4D, alignCorners: boolean) {\n const [batch, xHeight, xWidth, depth] = x.shape;\n const [, yHeight, yWidth] = dy.shape;\n\n const output =\n ops.buffer([batch, xHeight, xWidth, depth], x.dtype);\n\n // In the backwards pass, we want to find the pixels that were generated for\n // each pixel in the input image the forward pass\n\n const effectiveXSize: [number, number] = [\n (alignCorners && yHeight > 1) ? xHeight - 1 : xHeight,\n (alignCorners && yWidth > 1) ? xWidth - 1 : xWidth\n ];\n\n const effectiveYSize: [number, number] = [\n (alignCorners && yHeight > 1) ? yHeight - 1 : yHeight,\n (alignCorners && yWidth > 1) ? yWidth - 1 : yWidth\n ];\n\n const heightScale = effectiveXSize[0] / effectiveYSize[0];\n const widthScale = effectiveXSize[1] / effectiveYSize[1];\n\n const invHeightScale = 1 / heightScale;\n const invWidthScale = 1 / widthScale;\n\n // This defines the size of the window of values around a particular\n // index in dy that we want to search for contributions to dx.\n const winHeight = (Math.ceil(invHeightScale) * 2) + 2;\n const winWidth = (Math.ceil(invWidthScale) * 2) + 2;\n\n // Loop over the output space.\n for (let b = 0; b < batch; b++) {\n for (let r = 0; r < xHeight; r++) {\n for (let c = 0; c < xWidth; c++) {\n // Compute bounds for where in dy we will look\n const startRLerp = Math.floor(r * invHeightScale);\n const startDyR = Math.floor(startRLerp - (winHeight / 2));\n\n const startCLerp = Math.floor(c * invWidthScale);\n const startDyC = Math.floor(startCLerp - (winWidth / 2));\n\n for (let d = 0; d < depth; d++) {\n let accum = 0;\n // loop over dy\n\n for (let dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n const dyR = dyROffset + startDyR;\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= yHeight) {\n continue;\n }\n\n for (let dyCOffSet = 0; dyCOffSet < winWidth; dyCOffSet++) {\n const dyC = dyCOffSet + startDyC;\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= yWidth) {\n continue;\n }\n\n const sourceFracRow =\n effectiveXSize[0] * (dyR / effectiveYSize[0]);\n const sourceFracCol =\n effectiveXSize[1] * (dyC / effectiveYSize[1]);\n\n const sourceNearestRow = Math.min(\n xHeight - 1,\n alignCorners ? Math.round(sourceFracRow) :\n Math.floor(sourceFracRow));\n\n const sourceNearestCol = Math.min(\n xWidth - 1,\n alignCorners ? Math.round(sourceFracCol) :\n Math.floor(sourceFracCol));\n\n if (r === sourceNearestRow && c === sourceNearestCol) {\n accum += dy.get(b, dyR, dyC, d);\n }\n }\n }\n\n output.set(accum, b, r, c, d);\n }\n }\n }\n }\n return output.toTensor();\n }\n\n batchNormalization(\n x: Tensor4D, mean: Tensor4D|Tensor1D, variance: Tensor4D|Tensor1D,\n varianceEpsilon: number, scale?: Tensor4D|Tensor1D,\n offset?: Tensor4D|Tensor1D): Tensor4D {\n const xValues = x.dataSync();\n const meanValues = mean.dataSync();\n const varianceValues = variance.dataSync();\n const scaleValues = scale ? scale.dataSync() : new Float32Array([1]);\n const offsetValues = offset ? offset.dataSync() : new Float32Array([0]);\n const outValues = new Float32Array(xValues.length);\n\n for (let i = 0; i < xValues.length; i++) {\n outValues[i] = offsetValues[i % offsetValues.length] +\n (xValues[i] - meanValues[i % meanValues.length]) *\n scaleValues[i % scaleValues.length] /\n Math.sqrt(\n varianceValues[i % varianceValues.length] + varianceEpsilon);\n }\n return tensor4d(outValues, x.shape);\n }\n\n localResponseNormalization4D(\n x: Tensor4D, radius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const output = ops.buffer(x.shape, 'float32');\n const rad = radius;\n const maxD = output.shape[3] - 1;\n\n function sumAcrossChannels(\n b: number, r: number, c: number, d: number): number {\n let sum = 0.0;\n for (let j = Math.max(0, d - rad); j <= Math.min(d + rad, maxD); j++) {\n const z = x.get(b, r, c, j);\n sum += z * z;\n }\n return sum;\n }\n\n for (let b = 0; b < output.shape[0]; b++) {\n for (let r = 0; r <= output.shape[1]; r++) {\n for (let c = 0; c < output.shape[2]; c++) {\n for (let d = 0; d < output.shape[3]; d++) {\n const sum = sumAcrossChannels(b, r, c, d);\n const val = x.get(b, r, c, d) * Math.pow(bias + alpha * sum, -beta);\n output.set(val, b, r, c, d);\n }\n }\n }\n }\n\n return output.toTensor();\n }\n\n LRNGrad(\n dy: Tensor4D, inputImage: Tensor4D, outputImage: Tensor4D,\n depthRadius: number, bias: number, alpha: number,\n beta: number): Tensor4D {\n const batch = dy.shape[0];\n const rows = dy.shape[1];\n const cols = dy.shape[2];\n const depth = dy.shape[3];\n const output = ops.buffer([batch, rows, cols, depth], 'float32');\n\n for (let b = 0; b < batch; ++b) {\n for (let r = 0; r < rows; ++r) {\n for (let c = 0; c < cols; ++c) {\n for (let d = 0; d < depth; ++d) {\n const depthBegin = Math.max(0, d - depthRadius);\n const depthEnd = Math.min(depth, d + depthRadius + 1);\n\n let norm = 0;\n for (let k = depthBegin; k < depthEnd; ++k) {\n norm += inputImage.get(b, r, c, k) * inputImage.get(b, r, c, k);\n }\n norm = alpha * norm + bias;\n for (let k = depthBegin; k < depthEnd; ++k) {\n let dyi = -2 * alpha * beta * inputImage.get(b, r, c, k) *\n outputImage.get(b, r, c, d) / norm;\n if (d === k) {\n dyi += Math.pow(norm, -beta);\n }\n dyi *= dy.get(b, r, c, d);\n output.set(dyi + output.get(b, r, c, k), b, r, c, k);\n }\n }\n }\n }\n }\n return output.toTensor();\n }\n\n multinomial(\n logits: Tensor2D, normalized: boolean, numSamples: number,\n seed: number): Tensor2D {\n const probabilities = normalized ? logits : ops.softmax(logits);\n const batchSize = probabilities.shape[0];\n const numEvents = probabilities.shape[1];\n const res = ops.zeros([batchSize, numSamples], 'int32');\n const resVals = res.dataSync();\n const probVals = probabilities.dataSync();\n\n for (let b = 0; b < batchSize; ++b) {\n const offset = b * numEvents;\n // The cdf won't include the last event. It will be implicit if no other\n // event happened.\n const cdf = new Float32Array(numEvents - 1);\n cdf[0] = probVals[offset];\n for (let event = 1; event < cdf.length; ++event) {\n cdf[event] = cdf[event - 1] + probVals[offset + event];\n }\n\n const random = seedrandom.alea(seed.toString());\n const outOffset = b * numSamples;\n for (let sampleId = 0; sampleId < numSamples; ++sampleId) {\n const r = random();\n\n // Assume last event happened by default.\n resVals[outOffset + sampleId] = cdf.length;\n\n for (let event = 0; event < cdf.length; event++) {\n if (r < cdf[event]) {\n resVals[outOffset + sampleId] = event;\n break;\n }\n }\n }\n }\n return res;\n }\n\n oneHot(indices: Tensor1D, depth: number, onValue: number, offValue: number):\n Tensor2D {\n const res = new Float32Array(indices.size * depth);\n res.fill(offValue);\n\n for (let event = 0; event < indices.size; ++event) {\n if (indices.get(event) >= 0 && indices.get(event) < depth) {\n res[event * depth + indices.get(event)] = onValue;\n }\n }\n return ops.tensor2d(res, [indices.size, depth], 'int32');\n }\n\n nonMaxSuppression(\n boxes: Tensor2D, scores: Tensor1D, maxOutputSize: number,\n iouThreshold: number, scoreThreshold: number): Tensor1D {\n const boxesVals = boxes.dataSync();\n const scoresVals = scores.dataSync();\n return nonMaxSuppressionImpl(\n boxesVals, scoresVals, maxOutputSize, iouThreshold, scoreThreshold);\n }\n\n private broadcastedBinaryOp(\n a: Tensor, b: Tensor, dtype: DataType,\n op: (a: number, b: number) => number): Tensor {\n const newShape =\n broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape);\n const result = ops.buffer(newShape, dtype);\n const aValues = a.dataSync();\n const bValues = b.dataSync();\n\n const aBroadcastDims = broadcast_util.getBroadcastDims(a.shape, newShape);\n const bBroadcastDims = broadcast_util.getBroadcastDims(b.shape, newShape);\n\n const aBuf = a.buffer();\n const bBuf = b.buffer();\n for (let i = 0; i < result.values.length; ++i) {\n const loc = result.indexToLoc(i);\n\n const aLoc = loc.slice(-a.rank);\n aBroadcastDims.forEach(d => aLoc[d] = 0);\n const aIndex = aBuf.locToIndex(aLoc);\n\n const bLoc = loc.slice(-b.rank);\n bBroadcastDims.forEach(d => bLoc[d] = 0);\n const bIndex = bBuf.locToIndex(bLoc);\n\n result.values[i] = op(aValues[aIndex], bValues[bIndex]);\n }\n return result.toTensor();\n }\n dispose() {}\n}\n\nENV.registerBackend(\n 'cpu', () => new MathBackendCPU(), 1 /* priority */, setTensorTracker);\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nconst delayCallback = typeof requestAnimationFrame !== 'undefined' ?\n requestAnimationFrame : // Browsers\n setImmediate; // Node.js\n\n/**\n * Returns a promise that resolve when a requestAnimationFrame has completed.\n *\n * On Node.js this uses setImmediate instead of requestAnimationFrame.\n *\n * This is simply a sugar method so that users can do the following:\n * `await tf.nextFrame();`\n */\n/** @doc {heading: 'Performance', subheading: 'Timing'} */\nfunction nextFrame(): Promise {\n return new Promise(resolve => delayCallback(() => resolve()));\n}\n\nexport {nextFrame};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/* Type definitions for exporting and importing of models. */\n\n/**\n * A map from Tensor dtype to number of bytes per element of the Tensor.\n */\nexport const DTYPE_VALUE_SIZE_MAP: {[dtype: string]: number} = {\n 'float32': 4,\n 'int32': 4,\n 'uint16': 2,\n 'uint8': 1,\n 'bool': 1,\n};\n\n/**\n * A weight manifest.\n *\n * The weight manifest consists of an ordered list of weight-manifest groups.\n * Each weight-manifest group (\"group\" for short hereafter) consists of a\n * number of weight values stored in a number of paths.\n * See the documentation of `WeightManifestGroupConfig` below for more details.\n */\nexport declare type WeightsManifestConfig = WeightsManifestGroupConfig[];\n\n/**\n * A weight-manifest group.\n *\n * Consists of an ordered list of weight values encoded in binary format,\n * stored in an ordered list of paths.\n */\nexport declare interface WeightsManifestGroupConfig {\n /**\n * An ordered list of paths.\n *\n * Paths are intentionally abstract in order to be general. For example, they\n * can be relative URL paths or relative paths on the file system.\n */\n paths: string[];\n\n /**\n * Specifications of the weights stored in the paths.\n */\n weights: WeightsManifestEntry[];\n}\n\n/**\n * An entry in the weight manifest.\n *\n * The entry contains specification of a weight.\n */\nexport declare interface WeightsManifestEntry {\n /**\n * Name of the weight, e.g., 'Dense_1/bias'\n */\n name: string;\n\n /**\n * Shape of the weight.\n */\n shape: number[];\n\n /**\n * Data type of the weight.\n */\n dtype: 'float32'|'int32'|'bool';\n\n /**\n * Information for dequantization of the weight.\n */\n quantization?: {\n scale: number, // The scaling constant to multiply by.\n min: number, // The (possibly nudged) minimum weight to add.\n dtype: 'uint16'|'uint8' // The dtype of the quantized weights.\n };\n}\n\n/**\n * Options for saving a model.\n */\nexport interface SaveConfig {\n /**\n * Whether to save only the trainable weights of the model, ignoring the\n * untrainable ones.\n */\n trainableOnly?: boolean;\n}\n\n/**\n * Result of a saving operation.\n */\nexport interface SaveResult {\n /**\n * Information about the model artifacts saved.\n */\n modelArtifactsInfo: ModelArtifactsInfo;\n\n /**\n * HTTP responses from the server that handled the model-saving request (if\n * any). This is applicable only to server-based saving routes.\n */\n responses?: Response[];\n\n /**\n * Error messages and related data (if any).\n */\n errors?: Array<{}|string>;\n}\n\nexport declare interface ModelArtifactsInfo {\n /**\n * Timestamp for when the model is saved.\n */\n dateSaved: Date;\n\n /**\n * Type of the model topology\n *\n * Possible values:\n * - JSON: JSON config (human-readable, e.g., Keras JSON).\n * - GraphDef: TensorFlow\n * [GraphDef](https://www.tensorflow.org/extend/tool_developers/#graphdef)\n * protocal buffer (binary).\n */\n modelTopologyType: 'JSON'|'GraphDef';\n\n /**\n * Size of model topology (Keras JSON or GraphDef), in bytes.\n */\n modelTopologyBytes?: number;\n\n /**\n * Size of weight specification or manifest, in bytes.\n */\n weightSpecsBytes?: number;\n\n /**\n * Size of weight value data, in bytes.\n */\n weightDataBytes?: number;\n}\n\n/**\n * The serialized artifacts of a model, including topology and weights.\n *\n * The `modelTopology`, `weightSpecs` and `weightData` fields of this interface\n * are optional, in order to support topology- or weights-only saving and\n * loading.\n */\nexport declare interface ModelArtifacts {\n /**\n * Model topology.\n *\n * For Keras-style `tf.Model`s, this is a JSON object.\n * For TensorFlow-style models (e.g., `FrozenModel`), this is a binary buffer\n * carrying the `GraphDef` protocol buffer.\n */\n modelTopology?: {}|ArrayBuffer;\n\n /**\n * Weight specifications.\n *\n * This corresponds to the weightsData below.\n */\n weightSpecs?: WeightsManifestEntry[];\n\n /**\n * Binary buffer for all weight values concatenated in the order specified\n * by `weightSpecs`.\n */\n weightData?: ArrayBuffer;\n}\n\n/**\n * Type definition for handlers of loading operations.\n */\nexport type LoadHandler = () => Promise;\n\n/**\n * Type definition for handlers of saving operations.\n */\nexport type SaveHandler = (modelArtifact: ModelArtifacts) =>\n Promise;\n\n/**\n * Interface for a model import/export handler.\n *\n * The `save` and `load` handlers are both optional, in order to allow handlers\n * that support only saving or loading.\n */\n// tslint:disable-next-line:interface-name\nexport interface IOHandler {\n save?: SaveHandler;\n load?: LoadHandler;\n}\n\n/**\n * An interface for the manager of a model store.\n *\n * A model store is defined as a storage medium on which multiple models can\n * be stored. Each stored model has a unique `path` as its identifier.\n * A `ModelStoreManager` for the store allows actions including\n *\n * - Listing the models stored in the store.\n * - Deleting a model from the store.\n */\nexport interface ModelStoreManager {\n /**\n * List all models in the model store.\n *\n * @returns A dictionary mapping paths of existing models to their\n * model artifacts info. Model artifacts info include type of the model's\n * topology, byte sizes of the topology, weights, etc.\n */\n listModels(): Promise<{[path: string]: ModelArtifactsInfo}>;\n\n /**\n * Remove a model specified by `path`.\n *\n * @param path\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n removeModel(path: string): Promise;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensor} from '../ops/tensor_ops';\nimport {Tensor} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport {sizeFromShape} from '../util';\nimport {DTYPE_VALUE_SIZE_MAP, ModelArtifacts, ModelArtifactsInfo, WeightsManifestEntry} from './types';\n\n/**\n * Encode a map from names to weight values as an ArrayBuffer, along with an\n * `Array` of `WeightsManifestEntry` as specification of the encoded weights.\n *\n * This function does not perform sharding.\n *\n * This function is the reverse of `decodeWeights`.\n *\n * @param tensors A map (\"dict\") from names to tensors.\n * @returns A `Promise` of\n * - A flat `ArrayBuffer` with all the binary values of the `Tensor`s\n * concatenated.\n * - An `Array` of `WeightManifestEntry`s, carrying information including\n * tensor names, `dtype`s and shapes.\n * @throws Error: on unsupported tensor `dtype`.\n */\nexport async function encodeWeights(tensors: NamedTensorMap):\n Promise<{data: ArrayBuffer, specs: WeightsManifestEntry[]}> {\n // TODO(adarob, cais): Support quantization.\n const specs: WeightsManifestEntry[] = [];\n const dataPromises: Array> = [];\n for (const name in tensors) {\n const t = tensors[name];\n\n if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool') {\n throw new Error(`Unsupported dtype in weight '${name}': ${t.dtype}`);\n }\n specs.push({name, shape: t.shape, dtype: t.dtype});\n dataPromises.push(t.data());\n }\n const tensorValues = await Promise.all(dataPromises);\n return {data: concatenateTypedArrays(tensorValues), specs};\n}\n\n/**\n * Decode flat ArrayBuffer as weights.\n *\n * This function does not handle sharding.\n *\n * This function is the reverse of `encodeWeights`.\n *\n * @param buffer A flat ArrayBuffer carrying the binary values of the tensors\n * concatenated in the order specified in `specs`.\n * @param specs Specifications of the names, dtypes and shapes of the tensors\n * whose value are encoded by `buffer`.\n * @return A map from tensor name to tensor value, with the names corresponding\n * to names in `specs`.\n * @throws Error, if any of the tensors has unsupported dtype.\n */\nexport function decodeWeights(\n buffer: ArrayBuffer, specs: WeightsManifestEntry[]): NamedTensorMap {\n // TODO(adarob, cais): Support quantization.\n const out: NamedTensorMap = {};\n let offset = 0;\n for (const spec of specs) {\n const name = spec.name;\n const dtype = spec.dtype;\n const shape = spec.shape;\n\n if (spec.quantization != null) {\n throw new Error(\n `decodeWeights does not support quantization yet, but encountered ` +\n `weight '${name} with quantization.'`);\n }\n\n const size = sizeFromShape(shape);\n let value: Tensor;\n if (dtype === 'float32') {\n value = tensor(new Float32Array(buffer, offset, size), shape, 'float32');\n } else if (dtype === 'int32') {\n value = tensor(new Int32Array(buffer, offset, size), shape, 'int32');\n } else if (dtype === 'bool') {\n value = tensor(new Uint8Array(buffer, offset, size), shape, 'bool');\n } else {\n throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`);\n }\n out[name] = value;\n\n offset += size * DTYPE_VALUE_SIZE_MAP[dtype];\n }\n return out;\n}\n\n/**\n * Concatenate TypedArrays into an ArrayBuffer.\n */\nexport function concatenateTypedArrays(xs: TypedArray[]): ArrayBuffer {\n // TODO(adarob, cais): Support quantization.\n if (xs === null) {\n throw new Error(`Invalid input value: ${JSON.stringify(xs)}`);\n }\n\n let totalByteLength = 0;\n\n // `normalizedXs` is here for this reason: a `TypedArray`'s `buffer'\n // can have a different byte length from that of the `TypedArray` itself,\n // for example, when the `TypedArray` is created from an offset in an\n // `ArrayBuffer`. `normliazedXs` holds `TypedArray`s whose `buffer`s match\n // the `TypedArray` in byte length. If an element of `xs` does not show\n // this property, a new `TypedArray` that satisfy this property will be\n // constructed and pushed into `normalizedXs`.\n const normalizedXs: TypedArray[] = [];\n xs.forEach((x: TypedArray) => {\n totalByteLength += x.byteLength;\n // tslint:disable:no-any\n normalizedXs.push(\n x.byteLength === x.buffer.byteLength ? x :\n new (x.constructor as any)(x));\n if (!(x as any instanceof Float32Array || x as any instanceof Int32Array ||\n x as any instanceof Uint8Array)) {\n throw new Error(`Unsupported TypedArray subtype: ${x.constructor.name}`);\n }\n // tslint:enable:no-any\n });\n\n const y = new Uint8Array(totalByteLength);\n let offset = 0;\n normalizedXs.forEach((x: TypedArray) => {\n y.set(new Uint8Array(x.buffer), offset);\n offset += x.byteLength;\n });\n\n return y.buffer;\n}\n\n// Use Buffer on Node.js instead of Blob/atob/btoa\nconst useNodeBuffer = typeof Buffer !== 'undefined' &&\n (typeof Blob === 'undefined' || typeof atob === 'undefined' ||\n typeof btoa === 'undefined');\n\n/**\n * Calculate the byte length of a JavaScript string.\n *\n * Note that a JavaScript string can contain wide characters, therefore the\n * length of the string is not necessarily equal to the byte length.\n *\n * @param str Input string.\n * @returns Byte length.\n */\nexport function stringByteLength(str: string): number {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}\n\n/**\n * Encode an ArrayBuffer as a base64 encoded string.\n *\n * @param buffer `ArrayBuffer` to be converted.\n * @returns A string that base64-encodes `buffer`.\n */\nexport function arrayBufferToBase64String(buffer: ArrayBuffer): string {\n if (useNodeBuffer) {\n return Buffer.from(buffer).toString('base64');\n }\n return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer)));\n}\n\n/**\n * Decode a base64 string as an ArrayBuffer.\n *\n * @param str Base64 string.\n * @returns Decoded `ArrayBuffer`.\n */\nexport function base64StringToArrayBuffer(str: string): ArrayBuffer {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}\n\n/**\n * Concatenate a number of ArrayBuffers into one.\n *\n * @param buffers A number of array buffers to concatenate.\n * @returns Result of concatenating `buffers` in order.\n */\nexport function concatenateArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer {\n let totalByteLength = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n totalByteLength += buffer.byteLength;\n });\n\n const temp = new Uint8Array(totalByteLength);\n let offset = 0;\n buffers.forEach((buffer: ArrayBuffer) => {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}\n\n/**\n * Get the basename of a path.\n *\n * Behaves in a way analogous to Linux's basename command.\n *\n * @param path\n */\nexport function basename(path: string): string {\n const SEPARATOR = '/';\n path = path.trim();\n while (path.endsWith(SEPARATOR)) {\n path = path.slice(0, path.length - 1);\n }\n const items = path.split(SEPARATOR);\n return items[items.length - 1];\n}\n\n/**\n * Populate ModelArtifactsInfo fields for a model with JSON topology.\n * @param modelArtifacts\n * @returns A ModelArtifactsInfo object.\n */\nexport function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts):\n ModelArtifactsInfo {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error('Expected JSON model topology, received ArrayBuffer.');\n }\n\n return {\n dateSaved: new Date(),\n modelTopologyType: 'JSON',\n modelTopologyBytes: modelArtifacts.modelTopology == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.modelTopology)),\n weightSpecsBytes: modelArtifacts.weightSpecs == null ?\n 0 :\n stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)),\n weightDataBytes: modelArtifacts.weightData == null ?\n 0 :\n modelArtifacts.weightData.byteLength,\n };\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {IOHandler} from './types';\n\nexport type IORouter = (url: string) => IOHandler;\n\nexport class IORouterRegistry {\n // Singleton instance.\n private static instance: IORouterRegistry;\n\n private saveRouters: IORouter[];\n private loadRouters: IORouter[];\n\n private constructor() {\n this.saveRouters = [];\n this.loadRouters = [];\n }\n\n private static getInstance(): IORouterRegistry {\n if (IORouterRegistry.instance == null) {\n IORouterRegistry.instance = new IORouterRegistry();\n }\n return IORouterRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerSaveRouter(saveRouter: IORouter) {\n IORouterRegistry.getInstance().saveRouters.push(saveRouter);\n }\n\n /**\n * Register a load-handler router.\n *\n * @param loadRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `load` method defined or `null`.\n */\n static registerLoadRouter(loadRouter: IORouter) {\n IORouterRegistry.getInstance().loadRouters.push(loadRouter);\n }\n\n /**\n * Look up IOHandler for saving, given a URL-like string.\n *\n * @param url\n * @returns If only one match is found, an instance of IOHandler with the\n * `save` method defined. If no match is found, `null`.\n * @throws Error, if more than one match is found.\n */\n static getSaveHandlers(url: string): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'save');\n }\n\n /**\n * Look up IOHandler for loading, given a URL-like string.\n *\n * @param url\n * @returns All valid handlers for `url`, given the currently registered\n * handler routers.\n */\n static getLoadHandlers(url: string): IOHandler[] {\n return IORouterRegistry.getHandlers(url, 'load');\n }\n\n private static getHandlers(url: string, handlerType: 'save'|'load'):\n IOHandler[] {\n const validHandlers: IOHandler[] = [];\n const routers = handlerType === 'load' ? this.getInstance().loadRouters :\n this.getInstance().saveRouters;\n routers.forEach(router => {\n const handler = router(url);\n if (handler !== null) {\n validHandlers.push(handler);\n }\n });\n return validHandlers;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Classes and functions for model management across multiple storage mediums.\n *\n * Supported client actions:\n * - Listing models on all registered storage mediums.\n * - Remove model by URL from any registered storage mediums, by using URL\n * string.\n * - Moving or copying model from one path to another in the same medium or from\n * one medium to another, by using URL strings.\n */\n\nimport {assert} from '../util';\n\nimport {IORouterRegistry} from './router_registry';\nimport {ModelArtifactsInfo, ModelStoreManager} from './types';\n\nconst URL_SCHEME_SUFFIX = '://';\n\nexport class ModelStoreManagerRegistry {\n // Singleton instance.\n private static instance: ModelStoreManagerRegistry;\n\n private managers: {[scheme: string]: ModelStoreManager};\n\n private constructor() {\n this.managers = {};\n }\n\n private static getInstance(): ModelStoreManagerRegistry {\n if (ModelStoreManagerRegistry.instance == null) {\n ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry();\n }\n return ModelStoreManagerRegistry.instance;\n }\n\n /**\n * Register a save-handler router.\n *\n * @param saveRouter A function that maps a URL-like string onto an instance\n * of `IOHandler` with the `save` method defined or `null`.\n */\n static registerManager(scheme: string, manager: ModelStoreManager) {\n assert(scheme != null, 'scheme must not be undefined or null.');\n if (scheme.endsWith(URL_SCHEME_SUFFIX)) {\n scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX));\n }\n assert(scheme.length > 0, 'scheme must not be an empty string.');\n const registry = ModelStoreManagerRegistry.getInstance();\n assert(\n registry.managers[scheme] == null,\n `A model store manager is already registered for scheme '${scheme}'.`);\n registry.managers[scheme] = manager;\n }\n\n static getManager(scheme: string): ModelStoreManager {\n const manager = this.getInstance().managers[scheme];\n if (manager == null) {\n throw new Error(`Cannot find model manager for scheme '${scheme}'`);\n }\n return manager;\n }\n\n static getSchemes(): string[] {\n return Object.keys(this.getInstance().managers);\n }\n}\n\n/**\n * Helper method for parsing a URL string into a scheme and a path.\n *\n * @param url E.g., 'localstorage://my-model'\n * @returns A dictionary with two fields: scheme and path.\n * Scheme: e.g., 'localstorage' in the example above.\n * Path: e.g., 'my-model' in the example above.\n */\nfunction parseURL(url: string): {scheme: string, path: string} {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\n `The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}\n\nasync function cloneModelInternal(\n sourceURL: string, destURL: string,\n deleteSource = false): Promise {\n assert(\n sourceURL !== destURL,\n `Old path and new path are the same: '${sourceURL}'`);\n\n const loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL);\n assert(\n loadHandlers.length > 0,\n `Copying failed because no load handler is found for source URL ${\n sourceURL}.`);\n assert(\n loadHandlers.length < 2,\n `Copying failed because more than one (${loadHandlers.length}) ` +\n `load handlers for source URL ${sourceURL}.`);\n const loadHandler = loadHandlers[0];\n\n const saveHandlers = IORouterRegistry.getSaveHandlers(destURL);\n assert(\n saveHandlers.length > 0,\n `Copying failed because no save handler is found for destination URL ` +\n `${destURL}.`);\n assert(\n saveHandlers.length < 2,\n `Copying failed because more than one (${loadHandlers.length}) ` +\n `save handlers for destination URL ${destURL}.`);\n const saveHandler = saveHandlers[0];\n\n const sourceScheme = parseURL(sourceURL).scheme;\n const sourcePath = parseURL(sourceURL).path;\n const sameMedium = sourceScheme === parseURL(sourceURL).scheme;\n\n const modelArtifacts = await loadHandler.load();\n\n // If moving within the same storage medium, remove the old model as soon as\n // the loading is done. Without doing this, it is possible that the combined\n // size of the two models will cause the cloning to fail.\n if (deleteSource && sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n const saveResult = await saveHandler.save(modelArtifacts);\n\n // If moving between mediums, the deletion is done after the save succeeds.\n // This guards against the case in which saving to the destination medium\n // fails.\n if (deleteSource && !sameMedium) {\n await ModelStoreManagerRegistry.getManager(sourceScheme)\n .removeModel(sourcePath);\n }\n\n return saveResult.modelArtifactsInfo;\n}\n\n/**\n * List all models stored in registered storage mediums.\n *\n * For a web browser environment, the registered mediums are Local Storage and\n * IndexedDB.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @returns A `Promise` of a dictionary mapping URLs of existing models to\n * their model artifacts info. URLs include medium-specific schemes, e.g.,\n * 'indexeddb://my/model/1'. Model artifacts info include type of the\n * model's topology, byte sizes of the topology, weights, etc.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function listModels(): Promise<{[url: string]: ModelArtifactsInfo}> {\n const schemes = ModelStoreManagerRegistry.getSchemes();\n const out: {[url: string]: ModelArtifactsInfo} = {};\n for (const scheme of schemes) {\n const schemeOut =\n await ModelStoreManagerRegistry.getManager(scheme).listModels();\n for (const path in schemeOut) {\n const url = scheme + URL_SCHEME_SUFFIX + path;\n out[url] = schemeOut[path];\n }\n }\n return out;\n}\n\n/**\n * Remove a model specified by URL from a reigstered storage medium.\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Delete the model.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n * ```\n *\n * @param url A URL to a stored model, with a scheme prefix, e.g.,\n * 'localstorage://my-model-1', 'indexeddb://my/model/2'.\n * @returns ModelArtifactsInfo of the deleted model (if and only if deletion\n * is successful).\n * @throws Error if deletion fails, e.g., if no model exists at `path`.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function removeModel(url: string): Promise {\n const schemeAndPath = parseURL(url);\n const manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme);\n return await manager.removeModel(schemeAndPath.path);\n}\n\n/**\n * Copy a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Copying within a storage medium, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Copying between two storage mediums, e.g.,\n * `tf.io.copyModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Copy the model, from Local Storage to IndexedDB.\n * await tf.io.copyModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove both models.\n * await tf.io.removeModel('localstorage://demo/management/model1');\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of copying.\n * @param destURL Destination URL of copying.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if copying fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function copyModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = false;\n return await cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\n/**\n * Move a model from one URL to another.\n *\n * This function supports:\n *\n * 1. Moving within a storage medium, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')`\n * 2. Moving between two storage mediums, e.g.,\n * `tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')`\n *\n * ```js\n * // First create and save a model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * await model.save('localstorage://demo/management/model1');\n *\n * // Then list existing models.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Move the model, from Local Storage to IndexedDB.\n * await tf.io.moveModel(\n * 'localstorage://demo/management/model1',\n * 'indexeddb://demo/management/model1');\n *\n * // List models again.\n * console.log(JSON.stringify(await tf.io.listModels()));\n *\n * // Remove the moved model.\n * await tf.io.removeModel('indexeddb://demo/management/model1');\n * ```\n *\n * @param sourceURL Source URL of moving.\n * @param destURL Destination URL of moving.\n * @returns ModelArtifactsInfo of the copied model (if and only if copying\n * is successful).\n * @throws Error if moving fails, e.g., if no model exists at `sourceURL`, or\n * if `oldPath` and `newPath` are identical.\n */\n/** @doc {heading: 'Models', subheading: 'Management', namespace: 'io'} */\nasync function moveModel(\n sourceURL: string, destURL: string): Promise {\n const deleteSource = true;\n return await cloneModelInternal(sourceURL, destURL, deleteSource);\n}\n\nexport {moveModel, copyModel, removeModel, listModels};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {getModelArtifactsInfoForJSON} from './io_utils';\nimport {ModelStoreManagerRegistry} from './model_management';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst DATABASE_NAME = 'tensorflowjs';\nconst DATABASE_VERSION = 1;\n\n// Model data and ModelArtifactsInfo (metadata) are stored in two separate\n// stores for efficient access of the list of stored models and their metadata.\n// 1. The object store for model data: topology, weights and weight manifests.\nconst MODEL_STORE_NAME = 'models_store';\n// 2. The object store for ModelArtifactsInfo, including meta-information such\n// as the type of topology (JSON vs binary), byte size of the topology, byte\n// size of the weights, etc.\nconst INFO_STORE_NAME = 'model_info_store';\n\n/**\n * Delete the entire database for tensorflow.js, including the models store.\n */\nexport async function deleteDatabase(): Promise {\n const idbFactory = getIndexedDBFactory();\n\n return new Promise((resolve, reject) => {\n const deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME);\n deleteRequest.onsuccess = () => resolve();\n deleteRequest.onerror = error => reject(error);\n });\n}\n\nfunction getIndexedDBFactory(): IDBFactory {\n if (!ENV.get('IS_BROWSER')) {\n // TODO(cais): Add more info about what IOHandler subtypes are available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'Failed to obtain IndexedDB factory because the current environment' +\n 'is not a web browser.');\n }\n // tslint:disable-next-line:no-any\n const theWindow: any = window;\n const factory = theWindow.indexedDB || theWindow.mozIndexedDB ||\n theWindow.webkitIndexedDB || theWindow.msIndexedDB ||\n theWindow.shimIndexedDB;\n if (factory == null) {\n throw new Error(\n 'The current browser does not appear to support IndexedDB.');\n }\n return factory;\n}\n\nfunction setUpDatabase(openRequest: IDBRequest) {\n const db = openRequest.result as IDBDatabase;\n db.createObjectStore(MODEL_STORE_NAME, {keyPath: 'modelPath'});\n db.createObjectStore(INFO_STORE_NAME, {keyPath: 'modelPath'});\n}\n\n/**\n * IOHandler subclass: Browser IndexedDB.\n *\n * See the doc string of `browserIndexedDB` for more details.\n */\nexport class BrowserIndexedDB implements IOHandler {\n protected readonly indexedDB: IDBFactory;\n protected readonly modelPath: string;\n\n static readonly URL_SCHEME = 'indexeddb://';\n\n constructor(modelPath: string) {\n this.indexedDB = getIndexedDBFactory();\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For IndexedDB, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n // TODO(cais): Support saving GraphDef models.\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n return this.databaseAction(this.modelPath, modelArtifacts) as\n Promise;\n }\n\n async load(): Promise {\n return this.databaseAction(this.modelPath) as Promise;\n }\n\n /**\n * Perform database action to put model artifacts into or read model artifacts\n * from IndexedDB object store.\n *\n * Whether the action is put or get depends on whether `modelArtifacts` is\n * specified. If it is specified, the action will be put; otherwise the action\n * will be get.\n *\n * @param modelPath A unique string path for the model.\n * @param modelArtifacts If specified, it will be the model artifacts to be\n * stored in IndexedDB.\n * @returns A `Promise` of `SaveResult`, if the action is put, or a `Promise`\n * of `ModelArtifacts`, if the action is get.\n */\n private databaseAction(modelPath: string, modelArtifacts?: ModelArtifacts):\n Promise {\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result as IDBDatabase;\n\n if (modelArtifacts == null) {\n // Read model out from object store.\n const modelTx = db.transaction(MODEL_STORE_NAME, 'readonly');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const getRequest = modelStore.get(this.modelPath);\n getRequest.onsuccess = () => {\n if (getRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${this.modelPath}' ` +\n `in IndexedDB.`));\n } else {\n resolve(getRequest.result.modelArtifacts);\n }\n };\n getRequest.onerror = error => {\n db.close();\n return reject(getRequest.error);\n };\n modelTx.oncomplete = () => db.close();\n } else {\n // Put model into object store.\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n // First, put ModelArtifactsInfo into info store.\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n let infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const putInfoRequest =\n infoStore.put({modelPath: this.modelPath, modelArtifactsInfo});\n let modelTx: IDBTransaction;\n putInfoRequest.onsuccess = () => {\n // Second, put model data into model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const putModelRequest = modelStore.put({\n modelPath: this.modelPath,\n modelArtifacts,\n modelArtifactsInfo\n });\n putModelRequest.onsuccess = () => resolve({modelArtifactsInfo});\n putModelRequest.onerror = error => {\n // If the put-model request fails, roll back the info entry as\n // well.\n infoStore = infoTx.objectStore(INFO_STORE_NAME);\n const deleteInfoRequest = infoStore.delete(this.modelPath);\n deleteInfoRequest.onsuccess = () => {\n db.close();\n return reject(putModelRequest.error);\n };\n deleteInfoRequest.onerror = error => {\n db.close();\n return reject(putModelRequest.error);\n };\n };\n };\n putInfoRequest.onerror = error => {\n db.close();\n return reject(putInfoRequest.error);\n };\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n }\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nexport const indexedDBRouter: IORouter = (url: string) => {\n if (!ENV.get('IS_BROWSER')) {\n return null;\n } else {\n if (url.startsWith(BrowserIndexedDB.URL_SCHEME)) {\n return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(indexedDBRouter);\nIORouterRegistry.registerLoadRouter(indexedDBRouter);\n\n/**\n * Creates a browser IndexedDB IOHandler for saving and loading models.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save('indexeddb://MyModel'));\n * console.log(saveResult);\n * ```\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`),\n * which can be used with, e.g., `tf.Model.save`.\n */\nexport function browserIndexedDB(modelPath: string): IOHandler {\n return new BrowserIndexedDB(modelPath);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserIndexedDB.URL_SCHEME) ?\n key.slice(BrowserIndexedDB.URL_SCHEME.length) :\n key;\n}\n\nexport class BrowserIndexedDBManager implements ModelStoreManager {\n private indexedDB: IDBFactory;\n\n constructor() {\n this.indexedDB = getIndexedDBFactory();\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n return new Promise<{[path: string]: ModelArtifactsInfo}>(\n (resolve, reject) => {\n const openRequest =\n this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result as IDBDatabase;\n const tx = db.transaction(INFO_STORE_NAME, 'readonly');\n const store = tx.objectStore(INFO_STORE_NAME);\n // tslint:disable:max-line-length\n // Need to cast `store` as `any` here because TypeScript's DOM\n // library does not have the `getAll()` method even though the\n // method is supported in the latest version of most mainstream\n // browsers:\n // https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll\n // tslint:enable:max-line-length\n // tslint:disable-next-line:no-any\n const getAllInfoRequest = (store as any).getAll() as IDBRequest;\n getAllInfoRequest.onsuccess = () => {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n for (const item of getAllInfoRequest.result) {\n out[item.modelPath] = item.modelArtifactsInfo;\n }\n resolve(out);\n };\n getAllInfoRequest.onerror = error => {\n db.close();\n return reject(getAllInfoRequest.error);\n };\n tx.oncomplete = () => db.close();\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n return new Promise((resolve, reject) => {\n const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n openRequest.onupgradeneeded = () => setUpDatabase(openRequest);\n\n openRequest.onsuccess = () => {\n const db = openRequest.result as IDBDatabase;\n const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');\n const infoStore = infoTx.objectStore(INFO_STORE_NAME);\n\n const getInfoRequest = infoStore.get(path);\n let modelTx: IDBTransaction;\n getInfoRequest.onsuccess = () => {\n if (getInfoRequest.result == null) {\n db.close();\n return reject(new Error(\n `Cannot find model with path '${path}' ` +\n `in IndexedDB.`));\n } else {\n // First, delete the entry in the info store.\n const deleteInfoRequest = infoStore.delete(path);\n const deleteModelData = () => {\n // Second, delete the entry in the model store.\n modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');\n const modelStore = modelTx.objectStore(MODEL_STORE_NAME);\n const deleteModelRequest = modelStore.delete(path);\n deleteModelRequest.onsuccess = () =>\n resolve(getInfoRequest.result.modelArtifactsInfo);\n deleteModelRequest.onerror = error =>\n reject(getInfoRequest.error);\n };\n // Proceed with deleting model data regardless of whether deletion\n // of info data succeeds or not.\n deleteInfoRequest.onsuccess = deleteModelData;\n deleteInfoRequest.onerror = error => {\n deleteModelData();\n db.close();\n return reject(getInfoRequest.error);\n };\n }\n };\n getInfoRequest.onerror = error => {\n db.close();\n return reject(getInfoRequest.error);\n };\n\n infoTx.oncomplete = () => {\n if (modelTx == null) {\n db.close();\n } else {\n modelTx.oncomplete = () => db.close();\n }\n };\n };\n openRequest.onerror = error => reject(openRequest.error);\n });\n }\n}\n\nif (ENV.get('IS_BROWSER')) {\n // Wrap the construction and registration, to guard against browsers that\n // don't support Local Storage.\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager());\n } catch (err) {\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {assert} from '../util';\nimport {arrayBufferToBase64String, base64StringToArrayBuffer, getModelArtifactsInfoForJSON} from './io_utils';\nimport {ModelStoreManagerRegistry} from './model_management';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult} from './types';\n\nconst PATH_SEPARATOR = '/';\nconst PATH_PREFIX = 'tensorflowjs_models';\nconst INFO_SUFFIX = 'info';\nconst MODEL_TOPOLOGY_SUFFIX = 'model_topology';\nconst WEIGHT_SPECS_SUFFIX = 'weight_specs';\nconst WEIGHT_DATA_SUFFIX = 'weight_data';\n\n/**\n * Purge all tensorflow.js-saved model artifacts from local storage.\n *\n * @returns Paths of the models purged.\n */\nexport function purgeLocalStorageArtifacts(): string[] {\n if (!ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') {\n throw new Error(\n 'purgeLocalStorageModels() cannot proceed because local storage is ' +\n 'unavailable in the current environment.');\n }\n const LS = window.localStorage;\n const purgedModelPaths: string[] = [];\n for (let i = 0; i < LS.length; ++i) {\n const key = LS.key(i);\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n if (key.startsWith(prefix) && key.length > prefix.length) {\n LS.removeItem(key);\n const modelName = getModelPathFromKey(key);\n if (purgedModelPaths.indexOf(modelName) === -1) {\n purgedModelPaths.push(modelName);\n }\n }\n }\n return purgedModelPaths;\n}\n\nfunction getModelKeys(path: string):\n {info: string, topology: string, weightSpecs: string, weightData: string} {\n return {\n info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR),\n topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR),\n weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR),\n weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR)\n };\n}\n\n/**\n * Get model path from a local-storage key.\n *\n * E.g., 'tensorflowjs_models/my/model/1/info' --> 'my/model/1'\n *\n * @param key\n */\nfunction getModelPathFromKey(key: string) {\n const items = key.split(PATH_SEPARATOR);\n if (items.length < 3) {\n throw new Error(`Invalid key format: ${key}`);\n }\n return items.slice(1, items.length - 1).join(PATH_SEPARATOR);\n}\n\nfunction maybeStripScheme(key: string) {\n return key.startsWith(BrowserLocalStorage.URL_SCHEME) ?\n key.slice(BrowserLocalStorage.URL_SCHEME.length) :\n key;\n}\n\n/**\n * IOHandler subclass: Browser Local Storage.\n *\n * See the doc string to `browserLocalStorage` for more details.\n */\nexport class BrowserLocalStorage implements IOHandler {\n protected readonly LS: Storage;\n protected readonly modelPath: string;\n protected readonly keys: {[key: string]: string};\n\n static readonly URL_SCHEME = 'localstorage://';\n\n constructor(modelPath: string) {\n if (!ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') {\n // TODO(cais): Add more info about what IOHandler subtypes are\n // available.\n // Maybe point to a doc page on the web and/or automatically determine\n // the available IOHandlers and print them in the error message.\n throw new Error(\n 'The current environment does not support local storage.');\n }\n this.LS = window.localStorage;\n\n if (modelPath == null || !modelPath) {\n throw new Error(\n 'For local storage, modelPath must not be null, undefined or empty.');\n }\n this.modelPath = modelPath;\n this.keys = getModelKeys(this.modelPath);\n }\n\n /**\n * Save model artifacts to browser local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @param modelArtifacts The model artifacts to be stored.\n * @returns An instance of SaveResult.\n */\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserLocalStorage.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const topology = JSON.stringify(modelArtifacts.modelTopology);\n const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs);\n\n const modelArtifactsInfo: ModelArtifactsInfo =\n getModelArtifactsInfoForJSON(modelArtifacts);\n\n try {\n this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo));\n this.LS.setItem(this.keys.topology, topology);\n this.LS.setItem(this.keys.weightSpecs, weightSpecs);\n this.LS.setItem(\n this.keys.weightData,\n arrayBufferToBase64String(modelArtifacts.weightData));\n\n return {modelArtifactsInfo};\n } catch (err) {\n // If saving failed, clean up all items saved so far.\n for (const key in this.keys) {\n this.LS.removeItem(this.keys[key]);\n }\n\n throw new Error(\n `Failed to save model '${this.modelPath}' to local storage: ` +\n `size quota being exceeded is a possible cause of this failure: ` +\n `modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, ` +\n `weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, ` +\n `weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`);\n }\n }\n }\n\n /**\n * Load a model from local storage.\n *\n * See the documentation to `browserLocalStorage` for details on the saved\n * artifacts.\n *\n * @returns The loaded model (if loading succeeds).\n */\n async load(): Promise {\n const info =\n JSON.parse(this.LS.getItem(this.keys.info)) as ModelArtifactsInfo;\n if (info == null) {\n throw new Error(\n `In local storage, there is no model with name '${this.modelPath}'`);\n }\n\n if (info.modelTopologyType !== 'JSON') {\n throw new Error(\n 'BrowserLocalStorage does not support loading non-JSON model ' +\n 'topology yet.');\n }\n\n const out: ModelArtifacts = {};\n\n // Load topology.\n const topology = JSON.parse(this.LS.getItem(this.keys.topology));\n if (topology == null) {\n throw new Error(\n `In local storage, the topology of model '${this.modelPath}' ` +\n `is missing.`);\n }\n out.modelTopology = topology;\n\n // Load weight specs.\n const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs));\n if (weightSpecs == null) {\n throw new Error(\n `In local storage, the weight specs of model '${this.modelPath}' ` +\n `are missing.`);\n }\n out.weightSpecs = weightSpecs;\n\n // Load weight data.\n const weightDataBase64 = this.LS.getItem(this.keys.weightData);\n if (weightDataBase64 == null) {\n throw new Error(\n `In local storage, the binary weight values of model ` +\n `'${this.modelPath}' are missing.`);\n }\n out.weightData = base64StringToArrayBuffer(weightDataBase64);\n\n return out;\n }\n}\n\nexport const localStorageRouter: IORouter = (url: string) => {\n if (!ENV.get('IS_BROWSER')) {\n return null;\n } else {\n if (url.startsWith(BrowserLocalStorage.URL_SCHEME)) {\n return browserLocalStorage(\n url.slice(BrowserLocalStorage.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(localStorageRouter);\nIORouterRegistry.registerLoadRouter(localStorageRouter);\n\n/**\n * Factory function for local storage IOHandler.\n *\n * This `IOHandler` supports both `save` and `load`.\n *\n * For each model's saved artifacts, four items are saved to local storage.\n * - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the\n * model, such as date saved, type of the topology, size in bytes, etc.\n * - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras-\n * style models, this is a stringized JSON.\n * - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the\n * model, can be used to decode the saved binary weight values (see\n * item below).\n * - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary\n * weight values, stored as a base64-encoded string.\n *\n * Saving may throw an `Error` if the total size of the artifacts exceed the\n * browser-specific quota.\n *\n * @param modelPath A unique identifier for the model to be saved. Must be a\n * non-empty string.\n * @returns An instance of `IOHandler`, which can be used with, e.g.,\n * `tf.Model.save`.\n */\nexport function browserLocalStorage(modelPath: string): IOHandler {\n return new BrowserLocalStorage(modelPath);\n}\n\nexport class BrowserLocalStorageManager implements ModelStoreManager {\n private readonly LS: Storage;\n\n constructor() {\n assert(ENV.get('IS_BROWSER'), 'Current environment is not a web browser');\n assert(\n typeof window.localStorage !== 'undefined',\n 'Current browser does not appear to support localStorage');\n this.LS = window.localStorage;\n }\n\n async listModels(): Promise<{[path: string]: ModelArtifactsInfo}> {\n const out: {[path: string]: ModelArtifactsInfo} = {};\n const prefix = PATH_PREFIX + PATH_SEPARATOR;\n const suffix = PATH_SEPARATOR + INFO_SUFFIX;\n for (let i = 0; i < this.LS.length; ++i) {\n const key = this.LS.key(i);\n if (key.startsWith(prefix) && key.endsWith(suffix)) {\n const modelPath = getModelPathFromKey(key);\n out[modelPath] = JSON.parse(this.LS.getItem(key)) as ModelArtifactsInfo;\n }\n }\n return out;\n }\n\n async removeModel(path: string): Promise {\n path = maybeStripScheme(path);\n const keys = getModelKeys(path);\n if (this.LS.getItem(keys.info) == null) {\n throw new Error(`Cannot find model at path '${path}'`);\n }\n const info = JSON.parse(this.LS.getItem(keys.info)) as ModelArtifactsInfo;\n\n this.LS.removeItem(keys.info);\n this.LS.removeItem(keys.topology);\n this.LS.removeItem(keys.weightSpecs);\n this.LS.removeItem(keys.weightData);\n return info;\n }\n}\n\nif (ENV.get('IS_BROWSER')) {\n // Wrap the construction and registration, to guard against browsers that\n // don't support Local Storage.\n try {\n ModelStoreManagerRegistry.registerManager(\n BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager());\n } catch (err) {\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers related to files, such as browser-triggered file downloads,\n * user-selected files in browser.\n */\n\nimport {ENV} from '../environment';\nimport {basename, concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\nconst DEFAULT_FILE_NAME_PREFIX = 'model';\nconst DEFAULT_JSON_EXTENSION_NAME = '.json';\nconst DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin';\n\nexport class BrowserDownloads implements IOHandler {\n private readonly modelTopologyFileName: string;\n private readonly weightDataFileName: string;\n private readonly jsonAnchor: HTMLAnchorElement;\n private readonly weightDataAnchor: HTMLAnchorElement;\n\n static readonly URL_SCHEME = 'downloads://';\n\n constructor(fileNamePrefix?: string) {\n if (!ENV.get('IS_BROWSER')) {\n // TODO(cais): Provide info on what IOHandlers are available under the\n // current environment.\n throw new Error(\n 'triggerDownloads() cannot proceed because the current environment ' +\n 'is not a browser.');\n }\n\n if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) {\n fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length);\n }\n if (fileNamePrefix == null || fileNamePrefix.length === 0) {\n fileNamePrefix = DEFAULT_FILE_NAME_PREFIX;\n }\n\n this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME;\n this.weightDataFileName =\n fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME;\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n const weightsURL = window.URL.createObjectURL(new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}));\n\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'DownloadTrigger.save() does not support saving model topology ' +\n 'in binary formats yet.');\n } else {\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./' + this.weightDataFileName],\n weights: modelArtifacts.weightSpecs\n }];\n const modelTopologyAndWeightManifest = {\n modelTopology: modelArtifacts.modelTopology,\n weightsManifest\n };\n const modelTopologyAndWeightManifestURL =\n window.URL.createObjectURL(new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: 'application/json'}));\n\n // If anchor elements are not provided, create them without attaching them\n // to parents, so that the downloaded file names can be controlled.\n const jsonAnchor = this.jsonAnchor == null ? document.createElement('a') :\n this.jsonAnchor;\n jsonAnchor.download = this.modelTopologyFileName;\n jsonAnchor.href = modelTopologyAndWeightManifestURL;\n // Trigger downloads by calling the `click` methods on the download\n // anchors.\n jsonAnchor.click();\n\n if (modelArtifacts.weightData != null) {\n const weightDataAnchor = this.weightDataAnchor == null ?\n document.createElement('a') :\n this.weightDataAnchor;\n weightDataAnchor.download = this.weightDataFileName;\n weightDataAnchor.href = weightsURL;\n weightDataAnchor.click();\n }\n\n return {modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts)};\n }\n }\n}\n\nclass BrowserFiles implements IOHandler {\n private readonly files: File[];\n\n constructor(files: File[]) {\n if (files == null || files.length < 1) {\n throw new Error(\n `When calling browserFiles, at least 1 file is required, ` +\n `but received ${files}`);\n }\n this.files = files;\n }\n\n async load(): Promise {\n const jsonFile = this.files[0];\n const weightFiles = this.files.slice(1);\n\n return new Promise((resolve, reject) => {\n const jsonReader = new FileReader();\n jsonReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const modelJSON = JSON.parse((event.target as any).result);\n const modelTopology = modelJSON.modelTopology as {};\n if (modelTopology == null) {\n reject(new Error(\n `modelTopology field is missing from file ${jsonFile.name}`));\n return;\n }\n\n if (weightFiles.length === 0) {\n resolve({modelTopology});\n }\n\n const weightsManifest =\n modelJSON.weightsManifest as WeightsManifestConfig;\n if (weightsManifest == null) {\n reject(new Error(\n `weightManifest field is missing from file ${jsonFile.name}`));\n return;\n }\n\n let pathToFile: {[path: string]: File};\n try {\n pathToFile =\n this.checkManifestAndWeightFiles(weightsManifest, weightFiles);\n } catch (err) {\n reject(err);\n return;\n }\n\n const weightSpecs: WeightsManifestEntry[] = [];\n const paths: string[] = [];\n const perFileBuffers: ArrayBuffer[] = [];\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n paths.push(path);\n perFileBuffers.push(null);\n });\n weightSpecs.push(...weightsGroup.weights);\n });\n\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n const weightFileReader = new FileReader();\n weightFileReader.onload = (event: Event) => {\n // tslint:disable-next-line:no-any\n const weightData = (event.target as any).result as ArrayBuffer;\n const index = paths.indexOf(path);\n perFileBuffers[index] = weightData;\n if (perFileBuffers.indexOf(null) === -1) {\n resolve({\n modelTopology,\n weightSpecs,\n weightData: concatenateArrayBuffers(perFileBuffers),\n });\n }\n };\n weightFileReader.onerror = (error: FileReaderProgressEvent) => {\n reject(`Failed to weights data from file of path '${path}'.`);\n return;\n };\n weightFileReader.readAsArrayBuffer(pathToFile[path]);\n });\n });\n };\n jsonReader.onerror = (error: FileReaderProgressEvent) => {\n reject(\n `Failed to read model topology and weights manifest JSON ` +\n `from file '${jsonFile.name}'. BrowserFiles supports loading ` +\n `Keras-style tf.Model artifacts only.`);\n return;\n };\n jsonReader.readAsText(jsonFile);\n });\n }\n\n /**\n * Check the compatibility between weights manifest and weight files.\n */\n private checkManifestAndWeightFiles(\n manifest: WeightsManifestConfig, files: File[]): {[path: string]: File} {\n const basenames: string[] = [];\n const fileNames = files.map(file => basename(file.name));\n const pathToFile: {[path: string]: File} = {};\n for (const group of manifest) {\n group.paths.forEach(path => {\n const pathBasename = basename(path);\n if (basenames.indexOf(pathBasename) !== -1) {\n throw new Error(\n `Duplicate file basename found in weights manifest: ` +\n `'${pathBasename}'`);\n }\n basenames.push(pathBasename);\n if (fileNames.indexOf(pathBasename) === -1) {\n throw new Error(\n `Weight file with basename '${pathBasename}' is not provided.`);\n } else {\n pathToFile[path] = files[fileNames.indexOf(pathBasename)];\n }\n });\n }\n\n if (basenames.length !== files.length) {\n throw new Error(\n `Mismatch in the number of files in weights manifest ` +\n `(${basenames.length}) and the number of weight files provided ` +\n `(${files.length}).`);\n }\n return pathToFile;\n }\n}\n\nexport const browserDownloadsRouter: IORouter = (url: string) => {\n if (!ENV.get('IS_BROWSER')) {\n return null;\n } else {\n if (url.startsWith(BrowserDownloads.URL_SCHEME)) {\n return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length));\n } else {\n return null;\n }\n }\n};\nIORouterRegistry.registerSaveRouter(browserDownloadsRouter);\n\n/**\n * Creates an IOHandler that triggers file downloads from the browser.\n *\n * The returned `IOHandler` instance can be used as model exporting methods such\n * as `tf.Model.save` and supports only saving.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense(\n * {units: 1, inputShape: [10], activation: 'sigmoid'}));\n * const saveResult = await model.save('downloads://mymodel'));\n * // This will trigger downloading of two files:\n * // 'mymodel.json' and 'mymodel.weights.bin'.\n * console.log(saveResult);\n * ```\n *\n * @param fileNamePrefix Prefix name of the files to be downloaded. For use with\n * `tf.Model`, `fileNamePrefix` should follow either of the following two\n * formats:\n * 1. `null` or `undefined`, in which case the default file\n * names will be used:\n * - 'model.json' for the JSON file containing the model topology and\n * weights manifest.\n * - 'model.weights.bin' for the binary file containing the binary weight\n * values.\n * 2. A single string or an Array of a single string, as the file name prefix.\n * For example, if `'foo'` is provided, the downloaded JSON\n * file and binary weights file will be named 'foo.json' and\n * 'foo.weights.bin', respectively.\n * @param config Additional configuration for triggering downloads.\n * @returns An instance of `DownloadTrigger` `IOHandler`.\n */\nexport function browserDownloads(fileNamePrefix = 'model'): IOHandler {\n return new BrowserDownloads(fileNamePrefix);\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from user-selected files.\n *\n * This method can be used for loading from files such as user-selected files\n * in the browser.\n * When used in conjunction with `tf.loadModel`, an instance of `tf.Model`\n * (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * // Note: This code snippet won't run properly without the actual file input\n * // elements in the HTML DOM.\n *\n * // Suppose there are two HTML file input (``)\n * // elements.\n * const uploadJSONInput = document.getElementById('upload-json');\n * const uploadWeightsInput = document.getElementById('upload-weights');\n * const model = await tfl.loadModel(tf.io.browserFiles(\n * [uploadJSONInput.files[0], uploadWeightsInput.files[0]]));\n * ```\n *\n * @param files `File`s to load from. Currently, this function supports only\n * loading from files that contain Keras-style models (i.e., `tf.Model`s), for\n * which an `Array` of `File`s is expected (in that order):\n * - A JSON file containing the model topology and weight manifest.\n * - Optionally, One or more binary files containing the binary weights.\n * These files must have names that match the paths in the `weightsManifest`\n * contained by the aforementioned JSON file, or errors will be thrown\n * during loading. These weights files have the same format as the ones\n * generated by `tensorflowjs_converter` that comes with the `tensorflowjs`\n * Python PIP package. If no weights files are provided, only the model\n * topology will be loaded from the JSON file above.\n * @returns An instance of `Files` `IOHandler`.\n */\nexport function browserFiles(files: File[]): IOHandler {\n return new BrowserFiles(files);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {tensor} from '../ops/ops';\nimport {NamedTensorMap} from '../tensor_types';\nimport {TypedArray} from '../types';\nimport * as util from '../util';\nimport {DTYPE_VALUE_SIZE_MAP, WeightsManifestConfig, WeightsManifestEntry} from './types';\n\n/**\n * Reads binary weights data from a number of URLs.\n *\n * @param fetchURLs URLs to send the HTTP requests at, using `fetch` calls.\n * @param requestOptions RequestInit (options) for the HTTP requests.\n * @returns A `Promise` of an Array of `ArrayBuffer`. The Array has the same\n * length as `fetchURLs`.\n */\nexport async function loadWeightsAsArrayBuffer(\n fetchURLs: string[], requestOptions?: RequestInit): Promise {\n // Create the requests for all of the weights in parallel.\n const requests = fetchURLs.map(fetchURL => fetch(fetchURL, requestOptions));\n const responses = await Promise.all(requests);\n const buffers =\n await Promise.all(responses.map(response => response.arrayBuffer()));\n return buffers;\n}\n\n/**\n * Reads a weights manifest JSON configuration, fetches the weights and\n * returns them as `Tensor`s.\n *\n * @param manifest The weights manifest JSON.\n * @param filePathPrefix The path prefix for filenames given in the manifest.\n * Defaults to the empty string.\n * @param weightNames The names of the weights to be fetched.\n */\nexport async function loadWeights(\n manifest: WeightsManifestConfig, filePathPrefix = '',\n weightNames?: string[],\n requestOptions?: RequestInit): Promise {\n // TODO(nsthorat): Groups are currently fetched atomically. If you need a\n // single weight from a group, the whole group will be fetched. At a future\n // date, we should support fetching only the individual shards within a\n // group that are needed to reconstruct the requested weight.\n // TODO(cais): Use `decodeWeights` for implementation.\n\n // Collect all the groups, weights, and their relative offsets to be\n // fetched.\n const groupIndicesToFetchMap = manifest.map(() => false);\n const groupWeightsToFetch: {\n [group: number]: Array<{\n manifestEntry: WeightsManifestEntry; groupOffset: number;\n sizeBytes: number;\n }>\n } = {};\n const weightsFound = weightNames != null ? weightNames.map(() => false) : [];\n const allManifestWeightNames: string[] = [];\n manifest.forEach((manifestGroupConfig, groupIndex) => {\n let groupOffset = 0;\n manifestGroupConfig.weights.forEach(weightsEntry => {\n const rawDtype = ('quantization' in weightsEntry) ?\n weightsEntry.quantization.dtype :\n weightsEntry.dtype;\n\n const weightsBytes = DTYPE_VALUE_SIZE_MAP[rawDtype] *\n util.sizeFromShape(weightsEntry.shape);\n\n const enqueueWeightsForFetchingFn = () => {\n groupIndicesToFetchMap[groupIndex] = true;\n if (groupWeightsToFetch[groupIndex] == null) {\n groupWeightsToFetch[groupIndex] = [];\n }\n\n groupWeightsToFetch[groupIndex].push({\n manifestEntry: weightsEntry,\n groupOffset,\n sizeBytes: weightsBytes\n });\n };\n\n if (weightNames != null) {\n weightNames.forEach((weightName, weightIndex) => {\n if (weightName === weightsEntry.name) {\n enqueueWeightsForFetchingFn();\n weightsFound[weightIndex] = true;\n }\n });\n } else {\n enqueueWeightsForFetchingFn();\n }\n\n allManifestWeightNames.push(weightsEntry.name);\n groupOffset += weightsBytes;\n });\n });\n\n if (!weightsFound.every(found => found)) {\n const weightsNotFound = weightNames.filter((weight, i) => !weightsFound[i]);\n throw new Error(\n `Could not find weights in manifest with names: ` +\n `${weightsNotFound.join(', ')}. \\n` +\n `Manifest JSON has weights with names: ` +\n `${allManifestWeightNames.join(', ')}.`);\n }\n\n // Convert the one-hot boolean groupId => shouldFetch map to a list of group\n // IDs.\n const groupIndicesToFetch =\n groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => {\n if (shouldFetch) {\n accumulator.push(i);\n }\n return accumulator;\n }, []);\n\n const fetchUrls: string[] = [];\n groupIndicesToFetch.forEach(i => {\n manifest[i].paths.forEach(filepath => {\n const fetchUrl = filePathPrefix +\n (!filePathPrefix.endsWith('/') ? '/' : '') + filepath;\n fetchUrls.push(fetchUrl);\n });\n });\n const buffers = await loadWeightsAsArrayBuffer(fetchUrls, requestOptions);\n\n const weightsTensorMap: NamedTensorMap = {};\n let bufferIndexOffset = 0;\n groupIndicesToFetch.forEach(i => {\n const numBuffers = manifest[i].paths.length;\n\n let groupBytes = 0;\n for (let i = 0; i < numBuffers; i++) {\n groupBytes += buffers[bufferIndexOffset + i].byteLength;\n }\n\n // Create a buffer for the whole group.\n const groupBuffer = new ArrayBuffer(groupBytes);\n const groupByteBuffer = new Uint8Array(groupBuffer);\n let groupBufferOffset = 0;\n for (let i = 0; i < numBuffers; i++) {\n const buffer = new Uint8Array(buffers[bufferIndexOffset + i]);\n groupByteBuffer.set(buffer, groupBufferOffset);\n groupBufferOffset += buffer.byteLength;\n }\n\n const weightsEntries = groupWeightsToFetch[i];\n\n weightsEntries.forEach(weightsEntry => {\n const byteBuffer = groupBuffer.slice(\n weightsEntry.groupOffset,\n weightsEntry.groupOffset + weightsEntry.sizeBytes);\n\n let typedArray: TypedArray;\n\n const dtype = weightsEntry.manifestEntry.dtype;\n\n if ('quantization' in weightsEntry.manifestEntry) {\n const quantization = weightsEntry.manifestEntry.quantization;\n if (quantization.dtype !== 'uint8' && quantization.dtype !== 'uint16') {\n throw new Error(\n `Weight ${weightsEntry.manifestEntry.name} has unknown ` +\n `quantization dtype ${quantization.dtype}.`);\n }\n const quantizedArray = (quantization.dtype === 'uint8') ?\n new Uint8Array(byteBuffer) :\n new Uint16Array(byteBuffer);\n if (dtype === 'float32') {\n typedArray = Float32Array.from(\n quantizedArray, v => v * quantization.scale + quantization.min);\n } else if (dtype === 'int32') {\n typedArray = Int32Array.from(\n quantizedArray,\n v => Math.round(v * quantization.scale + quantization.min));\n } else {\n throw new Error(\n `Weight ${weightsEntry.manifestEntry.name} has a dtype not ` +\n `supported by quantization: ${dtype}`);\n }\n } else {\n if (dtype === 'float32') {\n typedArray = new Float32Array(byteBuffer);\n } else if (dtype === 'int32') {\n typedArray = new Int32Array(byteBuffer);\n } else if (dtype === 'bool') {\n typedArray = new Uint8Array(byteBuffer);\n } else {\n throw new Error(\n `Weight ${weightsEntry.manifestEntry.name} has unknown dtype ` +\n `${dtype}.`);\n }\n }\n\n const weightName = weightsEntry.manifestEntry.name;\n if (weightsTensorMap[weightName] != null) {\n throw new Error(\n `Duplicate weight with name ${weightName}. ` +\n `Please make sure weights names are unique in the manifest JSON.`);\n }\n weightsTensorMap[weightName] = tensor(\n typedArray, weightsEntry.manifestEntry.shape,\n weightsEntry.manifestEntry.dtype);\n });\n\n bufferIndexOffset += numBuffers;\n });\n\n return weightsTensorMap;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandler implementations based on HTTP requests in the web browser.\n *\n * Uses [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n */\n\nimport {assert} from '../util';\nimport {concatenateArrayBuffers, getModelArtifactsInfoForJSON} from './io_utils';\nimport {IORouter, IORouterRegistry} from './router_registry';\nimport {IOHandler, ModelArtifacts, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeightsAsArrayBuffer} from './weights_loader';\n\nexport class BrowserHTTPRequest implements IOHandler {\n protected readonly path: string;\n protected readonly requestInit: RequestInit;\n\n readonly DEFAULT_METHOD = 'POST';\n\n static readonly URL_SCHEMES = ['http://', 'https://'];\n\n constructor(path: string, requestInit?: RequestInit) {\n if (typeof fetch === 'undefined') {\n throw new Error(\n // tslint:disable-next-line:max-line-length\n 'browserHTTPRequest is not supported outside the web browser without a fetch polyfill.');\n }\n\n assert(\n path != null && path.length > 0,\n 'URL path for browserHTTPRequest must not be null, undefined or ' +\n 'empty.');\n this.path = path;\n\n if (requestInit != null && requestInit.body != null) {\n throw new Error(\n 'requestInit is expected to have no pre-existing body, but has one.');\n }\n this.requestInit = requestInit || {};\n }\n\n async save(modelArtifacts: ModelArtifacts): Promise {\n if (modelArtifacts.modelTopology instanceof ArrayBuffer) {\n throw new Error(\n 'BrowserHTTPRequest.save() does not support saving model topology ' +\n 'in binary formats yet.');\n }\n\n const init = Object.assign({method: this.DEFAULT_METHOD}, this.requestInit);\n init.body = new FormData();\n\n const weightsManifest: WeightsManifestConfig = [{\n paths: ['./model.weights.bin'],\n weights: modelArtifacts.weightSpecs,\n }];\n const modelTopologyAndWeightManifest = {\n modelTopology: modelArtifacts.modelTopology,\n weightsManifest\n };\n\n init.body.append(\n 'model.json',\n new Blob(\n [JSON.stringify(modelTopologyAndWeightManifest)],\n {type: 'application/json'}),\n 'model.json');\n\n if (modelArtifacts.weightData != null) {\n init.body.append(\n 'model.weights.bin',\n new Blob(\n [modelArtifacts.weightData], {type: 'application/octet-stream'}),\n 'model.weights.bin');\n }\n\n const response = await fetch(this.path, init);\n\n if (response.status === 200) {\n return {\n modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts),\n responses: [response],\n };\n } else {\n throw new Error(\n `BrowserHTTPRequest.save() failed due to HTTP response status ` +\n `${response.status}.`);\n }\n }\n\n /**\n * Load model artifacts via HTTP request(s).\n *\n * See the documentation to `browserHTTPRequest` for details on the saved\n * artifacts.\n *\n * @returns The loaded model artifacts (if loading succeeds).\n */\n async load(): Promise {\n const modelConfigRequest = await fetch(this.path, this.requestInit);\n const modelConfig = await modelConfigRequest.json();\n const modelTopology = modelConfig['modelTopology'];\n const weightsManifest = modelConfig['weightsManifest'];\n\n // We do not allow both modelTopology and weightsManifest to be missing.\n if (modelTopology == null && weightsManifest == null) {\n throw new Error(\n `The JSON from HTTP path ${this.path} contains neither model ` +\n `topology or manifest for weights.`);\n }\n\n let weightSpecs: WeightsManifestEntry[];\n let weightData: ArrayBuffer;\n if (weightsManifest != null) {\n const weightsManifest =\n modelConfig['weightsManifest'] as WeightsManifestConfig;\n weightSpecs = [];\n for (const entry of weightsManifest) {\n weightSpecs.push(...entry.weights);\n }\n\n let pathPrefix = this.path.substring(0, this.path.lastIndexOf('/'));\n if (!pathPrefix.endsWith('/')) {\n pathPrefix = pathPrefix + '/';\n }\n\n const fetchURLs: string[] = [];\n weightsManifest.forEach(weightsGroup => {\n weightsGroup.paths.forEach(path => {\n fetchURLs.push(pathPrefix + path);\n });\n });\n weightData = concatenateArrayBuffers(\n await loadWeightsAsArrayBuffer(fetchURLs, this.requestInit));\n }\n\n return {modelTopology, weightSpecs, weightData};\n }\n}\n\nexport const httpRequestRouter: IORouter = (url: string) => {\n if (typeof fetch === 'undefined') {\n // browserHTTPRequest uses `fetch`, if one wants to use it in node.js\n // they have to setup a global fetch polyfill.\n return null;\n } else {\n for (const scheme of BrowserHTTPRequest.URL_SCHEMES) {\n if (url.startsWith(scheme)) {\n return browserHTTPRequest(url);\n }\n }\n return null;\n }\n};\nIORouterRegistry.registerSaveRouter(httpRequestRouter);\nIORouterRegistry.registerLoadRouter(httpRequestRouter);\n\n/**\n * Creates an IOHandler subtype that sends model artifacts to HTTP server.\n *\n * An HTTP request of the `multipart/form-data` mime type will be sent to the\n * `path` URL. The form data includes artifacts that represent the topology\n * and/or weights of the model. In the case of Keras-style `tf.Model`, two\n * blobs (files) exist in form-data:\n * - A JSON file consisting of `modelTopology` and `weightsManifest`.\n * - A binary weights file consisting of the concatenated weight values.\n * These files are in the same format as the one generated by\n * [tfjs_converter](https://js.tensorflow.org/tutorials/import-keras.html).\n *\n * The following code snippet exemplifies the client-side code that uses this\n * function:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'}));\n *\n * const saveResult = await model.save(tf.io.browserHTTPRequest(\n * 'http://model-server:5000/upload', {method: 'PUT'}));\n * console.log(saveResult);\n * ```\n *\n * If the default `POST` method is to be used, without any custom parameters\n * such as headers, you can simply pass an HTTP or HTTPS URL to `model.save`:\n *\n * ```js\n * const saveResult = await model.save('http://model-server:5000/upload');\n * ```\n *\n * The following Python code snippet based on the\n * [flask](https://github.com/pallets/flask) server framework implements a\n * server that can receive the request. Upon receiving the model artifacts\n * via the requst, this particular server reconsistutes instances of\n * [Keras Models](https://keras.io/models/model/) in memory.\n *\n * ```python\n * # pip install -U flask flask-cors tensorflow tensorflowjs\n *\n * from __future__ import absolute_import\n * from __future__ import division\n * from __future__ import print_function\n *\n * import io\n *\n * from flask import Flask, Response, request\n * from flask_cors import CORS, cross_origin\n * import tensorflow as tf\n * import tensorflowjs as tfjs\n * import werkzeug.formparser\n *\n *\n * class ModelReceiver(object):\n *\n * def __init__(self):\n * self._model = None\n * self._model_json_bytes = None\n * self._model_json_writer = None\n * self._weight_bytes = None\n * self._weight_writer = None\n *\n * @property\n * def model(self):\n * self._model_json_writer.flush()\n * self._weight_writer.flush()\n * self._model_json_writer.seek(0)\n * self._weight_writer.seek(0)\n *\n * json_content = self._model_json_bytes.read()\n * weights_content = self._weight_bytes.read()\n * return tfjs.converters.deserialize_keras_model(\n * json_content,\n * weight_data=[weights_content],\n * use_unique_name_scope=True)\n *\n * def stream_factory(self,\n * total_content_length,\n * content_type,\n * filename,\n * content_length=None):\n * # Note: this example code is *not* thread-safe.\n * if filename == 'model.json':\n * self._model_json_bytes = io.BytesIO()\n * self._model_json_writer = io.BufferedWriter(self._model_json_bytes)\n * return self._model_json_writer\n * elif filename == 'model.weights.bin':\n * self._weight_bytes = io.BytesIO()\n * self._weight_writer = io.BufferedWriter(self._weight_bytes)\n * return self._weight_writer\n *\n *\n * def main():\n * app = Flask('model-server')\n * CORS(app)\n * app.config['CORS_HEADER'] = 'Content-Type'\n *\n * model_receiver = ModelReceiver()\n *\n * @app.route('/upload', methods=['POST'])\n * @cross_origin()\n * def upload():\n * print('Handling request...')\n * werkzeug.formparser.parse_form_data(\n * request.environ, stream_factory=model_receiver.stream_factory)\n * print('Received model:')\n * with tf.Graph().as_default(), tf.Session():\n * model = model_receiver.model\n * model.summary()\n * # You can perform `model.predict()`, `model.fit()`,\n * # `model.evaluate()` etc. here.\n * return Response(status=200)\n *\n * app.run('localhost', 5000)\n *\n *\n * if __name__ == '__main__':\n * main()\n * ```\n *\n * @param path URL path. Can be an absolute HTTP path (e.g.,\n * 'http://localhost:8000/model-upload)') or a relative path (e.g.,\n * './model-upload').\n * @param requestInit Request configurations to be used when sending\n * HTTP request to server using `fetch`. It can contain fields such as\n * `method`, `credentials`, `headers`, `mode`, etc. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request\n * for more information. `requestInit` must not have a body, because the body\n * will be set by TensorFlow.js. File blobs representing\n * the model topology (filename: 'model.json') and the weights of the\n * model (filename: 'model.weights.bin') will be appended to the body.\n * If `requestInit` has a `body`, an Error will be thrown.\n * @returns An instance of `IOHandler`.\n */\nexport function browserHTTPRequest(\n path: string, requestInit?: RequestInit): IOHandler {\n return new BrowserHTTPRequest(path, requestInit);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * IOHandlers that pass through the in-memory ModelArtifacts format.\n */\n\nimport {IOHandler, ModelArtifacts, SaveResult, WeightsManifestEntry} from './types';\n\nclass PassthroughLoader implements IOHandler {\n constructor(\n private readonly modelTopology?: {}|ArrayBuffer,\n private readonly weightSpecs?: WeightsManifestEntry[],\n private readonly weightData?: ArrayBuffer) {}\n\n async load(): Promise {\n let result = {};\n if (this.modelTopology != null) {\n result = {modelTopology: this.modelTopology, ...result};\n }\n if (this.weightSpecs != null && this.weightSpecs.length > 0) {\n result = {weightSpecs: this.weightSpecs, ...result};\n }\n if (this.weightData != null && this.weightData.byteLength > 0) {\n result = {weightData: this.weightData, ...result};\n }\n return result;\n }\n}\n\nclass PassthroughSaver implements IOHandler {\n constructor(\n private readonly saveHandler: (artifacts: ModelArtifacts) => SaveResult) {\n }\n\n async save(modelArtifacts: ModelArtifacts) {\n return this.saveHandler(modelArtifacts);\n }\n}\n\n/**\n * Creates an IOHandler that loads model artifacts from memory.\n *\n * When used in conjunction with `tf.loadModel`, an instance of `tf.Model`\n * (Keras-style) can be constructed from the loaded artifacts.\n *\n * ```js\n * const model = await tf.loadModel(tf.io.fromMemory(\n * modelTopology, weightSpecs, weightData));\n * ```\n *\n * @param modelTopology a object containing model topology (i.e., parsed from\n * the JSON format).\n * @param weightSpecs An array of `WeightsManifestEntry` objects describing the\n * names, shapes, types, and quantization of the weight data.\n * @param weightData A single `ArrayBuffer` containing the weight data,\n * concatenated in the order described by the weightSpecs.\n *\n * @returns A passthrough `IOHandler` that simply loads the provided data.\n */\nexport function fromMemory(\n modelTopology: {}, weightSpecs?: WeightsManifestEntry[],\n weightData?: ArrayBuffer): IOHandler {\n return new PassthroughLoader(modelTopology, weightSpecs, weightData);\n}\n\n/**\n * Creates an IOHandler that passes saved model artifacts to a callback.\n *\n * ```js\n * function handleSave(artifacts) {\n * // ... do something with the artifacts ...\n * return {modelArtifactsInfo: {...}, ...};\n * }\n *\n * const saveResult = model.save(tf.io.withSaveHandler(handleSave));\n * ```\n *\n * @param saveHandler A function that accepts a `ModelArtifacts` and returns a\n * `SaveResult`.\n */\nexport function withSaveHandler(\n saveHandler: (artifacts: ModelArtifacts) => SaveResult): IOHandler {\n return new PassthroughSaver(saveHandler);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// Importing local_storage and indexed_db is necessary for the routers to be\n// registered.\nimport './indexed_db';\nimport './local_storage';\n\nimport {browserFiles} from './browser_files';\nimport {browserHTTPRequest} from './browser_http';\nimport {concatenateArrayBuffers, decodeWeights, encodeWeights, getModelArtifactsInfoForJSON} from './io_utils';\nimport {fromMemory, withSaveHandler} from './passthrough';\nimport {IORouterRegistry} from './router_registry';\nimport {IOHandler, LoadHandler, ModelArtifacts, ModelStoreManager, SaveConfig, SaveHandler, SaveResult, WeightsManifestConfig, WeightsManifestEntry} from './types';\nimport {loadWeights} from './weights_loader';\n\nconst registerSaveRouter = IORouterRegistry.registerSaveRouter;\nconst registerLoadRouter = IORouterRegistry.registerLoadRouter;\nconst getSaveHandlers = IORouterRegistry.getSaveHandlers;\nconst getLoadHandlers = IORouterRegistry.getLoadHandlers;\n\nexport {copyModel, listModels, moveModel, removeModel} from './model_management';\n\nexport {\n browserFiles,\n browserHTTPRequest,\n concatenateArrayBuffers,\n decodeWeights,\n encodeWeights,\n fromMemory,\n getLoadHandlers,\n getModelArtifactsInfoForJSON,\n getSaveHandlers,\n IOHandler,\n LoadHandler,\n loadWeights,\n ModelArtifacts,\n ModelStoreManager,\n registerLoadRouter,\n registerSaveRouter,\n SaveConfig,\n SaveHandler,\n SaveResult,\n WeightsManifestConfig,\n WeightsManifestEntry,\n withSaveHandler\n};\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n/**\n * Types to support JSON-esque data structures internally.\n *\n * Internally ConfigDict's use camelCase keys and values where the\n * values are class names to be instantiated. On the python side, these\n * will be snake_case. Internally we allow Enums into the values for better\n * type safety, but these need to be converted to raw primitives (usually\n * strings) for round-tripping with python.\n *\n * toConfig returns the TS-friendly representation. model.toJSON() returns\n * the pythonic version as that's the portable format. If you need to\n * python-ify a non-model level toConfig output, you'll need to use a\n * convertTsToPythonic from serialization_utils in -Layers.\n *\n */\nexport type ConfigDictValue =\n boolean|number|string|null|ConfigDictArray|ConfigDict;\nexport interface ConfigDict {\n [key: string]: ConfigDictValue;\n}\nexport interface ConfigDictArray extends Array {}\n\n/**\n * Type to represent the class-type of Serializable objects.\n *\n * Ie the class prototype with access to the constructor and any\n * static members/methods. Instance methods are not listed here.\n *\n * Source for this idea: https://stackoverflow.com/a/43607255\n */\nexport type SerializableConstructor = {\n // tslint:disable-next-line:no-any\n new (...args: any[]): T; className: string; fromConfig: FromConfigMethod;\n};\nexport type FromConfigMethod =\n (cls: SerializableConstructor, config: ConfigDict) => T;\n\n/**\n * Serializable defines the serialization contract.\n *\n * TFJS requires serializable classes to return their className when asked\n * to avoid issues with minification.\n */\nexport abstract class Serializable {\n /**\n * Return the class name for this class to use in serialization contexts.\n *\n * Generally speaking this will be the same thing that constructor.name\n * would have returned. However, the class name needs to be robust\n * against minification for serialization/deserialazation to work properly.\n *\n * There's also places such as initializers.VarianceScaling, where\n * implementation details between different languages led to different\n * class hierarchies and a non-leaf node is used for serialization purposes.\n */\n getClassName(): string {\n return (this.constructor as SerializableConstructor)\n .className;\n }\n\n /**\n * Return all the non-weight state needed to serialize this object.\n */\n abstract getConfig(): ConfigDict;\n\n /**\n * Creates an instance of T from a ConfigDict.\n *\n * This works for most descendants of serializable. A few need to\n * provide special handling.\n * @param cls A Constructor for the class to instantiate.\n * @param config The Configuration for the object.\n */\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config);\n }\n}\n\n/**\n * Maps string keys to class constructors.\n *\n * Used during (de)serialization from the cross-language JSON format, which\n * requires the class name in the serialization format matches the class\n * names as used in Python, should it exist.\n */\nexport class SerializationMap {\n private static instance: SerializationMap;\n classNameMap: {\n [className: string]:\n [\n SerializableConstructor, FromConfigMethod\n ]\n };\n\n private constructor() {\n this.classNameMap = {};\n }\n\n /**\n * Returns the singleton instance of the map.\n */\n static getMap(): SerializationMap {\n if (SerializationMap.instance == null) {\n SerializationMap.instance = new SerializationMap();\n }\n return SerializationMap.instance;\n }\n\n /**\n * Registers the class as serializable.\n */\n static register(cls: SerializableConstructor) {\n SerializationMap.getMap().classNameMap[cls.className] =\n [cls, cls.fromConfig];\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from './environment';\nimport {Features} from './environment_util';\nimport {Tensor} from './tensor';\nimport {TypedArray} from './types';\nimport * as util from './util';\n\n// TODO(smilkov): Move these constants to jasmine_util.\nexport const WEBGL_ENVS: Features = {\n 'HAS_WEBGL': true\n};\nexport const NODE_ENVS: Features = {\n 'IS_NODE': true\n};\nexport const CHROME_ENVS: Features = {\n 'IS_CHROME': true\n};\nexport const BROWSER_ENVS: Features = {\n 'IS_BROWSER': true\n};\nexport const CPU_ENVS: Features = {\n 'HAS_WEBGL': false\n};\nexport const ALL_ENVS: Features = {};\n\nexport function expectArraysClose(\n actual: Tensor|TypedArray|number[],\n expected: Tensor|TypedArray|number[]|boolean[], epsilon?: number) {\n if (epsilon == null) {\n epsilon = ENV.get('TEST_EPSILON');\n }\n if (!(actual instanceof Tensor) && !(expected instanceof Tensor)) {\n const aType = actual.constructor.name;\n const bType = expected.constructor.name;\n\n if (aType !== bType) {\n throw new Error(\n `Arrays are of different type actual: ${aType} ` +\n `vs expected: ${bType}`);\n }\n } else if (actual instanceof Tensor && expected instanceof Tensor) {\n if (actual.dtype !== expected.dtype) {\n throw new Error(\n `Arrays are of different type actual: ${actual.dtype} ` +\n `vs expected: ${expected.dtype}.`);\n }\n if (!util.arraysEqual(actual.shape, expected.shape)) {\n throw new Error(\n `Arrays are of different shape actual: ${actual.shape} ` +\n `vs expected: ${expected.shape}.`);\n }\n }\n\n let actualValues: TypedArray|number[];\n let expectedValues: TypedArray|number[]|boolean[];\n if (actual instanceof Tensor) {\n actualValues = actual.dataSync();\n } else {\n actualValues = actual;\n }\n if (expected instanceof Tensor) {\n expectedValues = expected.dataSync();\n } else {\n expectedValues = expected;\n }\n\n if (actualValues.length !== expectedValues.length) {\n throw new Error(\n `Arrays have different lengths actual: ${actualValues.length} vs ` +\n `expected: ${expectedValues.length}.\\n` +\n `Actual: ${actualValues}.\\n` +\n `Expected: ${expectedValues}.`);\n }\n for (let i = 0; i < expectedValues.length; ++i) {\n const a = actualValues[i];\n const e = expectedValues[i];\n\n if (!areClose(a, Number(e), epsilon)) {\n throw new Error(\n `Arrays differ: actual[${i}] = ${a}, expected[${i}] = ${e}.\\n` +\n `Actual: ${actualValues}.\\n` +\n `Expected: ${expectedValues}.`);\n }\n }\n}\n\nexport interface DoneFn {\n (): void;\n fail: (message?: Error|string) => void;\n}\n\nexport function expectPromiseToFail(fn: () => Promise<{}>, done: DoneFn): void {\n fn().then(() => done.fail(), () => done());\n}\n\nexport function expectArraysEqual(\n actual: Tensor|TypedArray|number[],\n expected: Tensor|TypedArray|number[]|boolean[]) {\n return expectArraysClose(actual, expected, 0);\n}\n\nexport function expectNumbersClose(a: number, e: number, epsilon?: number) {\n if (epsilon == null) {\n epsilon = ENV.get('TEST_EPSILON');\n }\n if (!areClose(a, e, epsilon)) {\n throw new Error(`Numbers differ: actual === ${a}, expected === ${e}`);\n }\n}\n\nfunction areClose(a: number, e: number, epsilon: number): boolean {\n if (isNaN(a) && isNaN(e)) {\n return true;\n }\n if (isNaN(a) || isNaN(e) || Math.abs(a - e) > epsilon) {\n return false;\n }\n return true;\n}\n\nexport function expectValuesInRange(\n actual: Tensor|TypedArray|number[], low: number, high: number) {\n let actualVals: TypedArray|number[];\n if (actual instanceof Tensor) {\n actualVals = actual.dataSync();\n } else {\n actualVals = actual;\n }\n for (let i = 0; i < actualVals.length; i++) {\n if (actualVals[i] < low || actualVals[i] > high) {\n throw new Error(\n `Value out of range:${actualVals[i]} low: ${low}, high: ${high}`);\n }\n }\n}\n\nexport function expectArrayBuffersEqual(\n actual: ArrayBuffer, expected: ArrayBuffer) {\n // Safari & Jasmine dont like comparing ArrayBuffers directly. Wrapping in\n // a Float32Array solves this issue.\n expect(new Float32Array(actual)).toEqual(new Float32Array(expected));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {variableGrads} from '../globals';\nimport {Serializable} from '../serialization';\nimport {Scalar, Variable} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\n\n/** @doc {heading: 'Training', subheading: 'Classes', namespace: 'train'} */\nexport abstract class Optimizer extends Serializable {\n /**\n * Executes `f()` and minimizes the scalar output of `f()` by computing\n * gradients of y with respect to the list of trainable variables provided by\n * `varList`. If no list is provided, it defaults to all trainable variables.\n * @param f The function to execute and whose output to minimize.\n * @param returnCost Whether to return the scalar cost value produced by\n * executing `f()`.\n * @param varList An optional list of variables to update. If specified, only\n * the trainable variables in varList will be updated by minimize. Defaults to\n * all trainable variables.\n */\n /** @doc {heading: 'Training', subheading: 'Optimizers'} */\n minimize(f: () => Scalar, returnCost = false, varList?: Variable[]): Scalar\n |null {\n const {value, grads} = this.computeGradients(f, varList);\n\n this.applyGradients(grads);\n\n // Dispose gradients.\n const varNames = Object.keys(grads);\n varNames.forEach(varName => grads[varName].dispose());\n\n if (returnCost) {\n return value as Scalar;\n } else {\n value.dispose();\n return null;\n }\n }\n\n /**\n * Executes f() and computes the gradient of the scalar output of f() with\n * respect to the list of trainable variables provided by `varList`. If no\n * list is provided, it defaults to all trainable variables.\n * @param f The function to execute and whose output to use for computing\n * gradients with respect to variables.\n * @param varList An optional list of variables to compute gradients with\n * respect to. If specified, only the trainable variables in varList will have\n * gradients computed with respect to. Defaults to all trainable variables.\n */\n computeGradients(f: () => Scalar, varList?: Variable[]):\n {value: Scalar, grads: NamedTensorMap} {\n return variableGrads(f, varList);\n }\n\n /**\n * Updates variables by using the computed gradients.\n * @param variableGradients A mapping of variable name to its gradient value.\n */\n abstract applyGradients(variableGradients: NamedTensorMap): void;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport {ENV} from '../environment';\n\nconst DEFAULT_FLOAT32_EPSILON = 1e-8;\nconst DEFAULT_FLOAT16_EPSILON = 1e-4;\n\nexport function getOptimizerDefaultEpsilonValue() {\n if (ENV.get('WEBGL_RENDER_FLOAT32_ENABLED')) {\n return DEFAULT_FLOAT32_EPSILON;\n }\n\n return DEFAULT_FLOAT16_EPSILON;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\n/** @doclink Optimizer */\nexport class AdadeltaOptimizer extends Optimizer {\n static className = 'AdadeltaOptimizer';\n private c: Scalar;\n private epsilonScalar: Scalar;\n private rhoScalar: Scalar;\n private oneMinusRho: Scalar;\n\n private accumulatedGrads: NamedVariableMap = {};\n private accumulatedUpdates: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected rho: number,\n protected epsilon: number = null) {\n super();\n\n this.c = keep(scalar(-learningRate));\n this.rhoScalar = keep(scalar(rho));\n this.oneMinusRho = keep(scalar(1 - rho));\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsilonScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedGrads[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedGrads[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n if (this.accumulatedUpdates[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedUpdates[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n\n const gradient = variableGradients[variableName];\n const accumulatedGrad = this.accumulatedGrads[variableName];\n const accumulatedUpdate = this.accumulatedUpdates[variableName];\n\n tidy(() => {\n const newAccumulatedGrad =\n this.rhoScalar.mul(accumulatedGrad)\n .add(this.oneMinusRho.mul(gradient.square()));\n\n const updates = accumulatedUpdate.add(this.epsilonScalar)\n .sqrt()\n .div(accumulatedGrad.add(this.epsilonScalar).sqrt())\n .mul(gradient);\n\n const newAccumulatedUpdate =\n this.rhoScalar.mul(accumulatedUpdate)\n .add(this.oneMinusRho.mul(updates.square()));\n\n this.accumulatedGrads[variableName].assign(newAccumulatedGrad);\n this.accumulatedUpdates[variableName].assign(newAccumulatedUpdate);\n\n const newValue = this.c.mul(updates).add(value);\n value.assign(newValue);\n });\n }\n }\n\n dispose() {\n this.c.dispose();\n this.epsilonScalar.dispose();\n this.rhoScalar.dispose();\n this.oneMinusRho.dispose();\n if (this.accumulatedUpdates != null) {\n Object.keys(this.accumulatedUpdates)\n .forEach(name => this.accumulatedUpdates[name].dispose());\n Object.keys(this.accumulatedGrads)\n .forEach(name => this.accumulatedGrads[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n rho: this.rho,\n epsilon: this.epsilon\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate, config.rho, config.epsilon);\n }\n}\nSerializationMap.register(AdadeltaOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {fill, scalar} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\n/** @doclink Optimizer */\nexport class AdagradOptimizer extends Optimizer {\n static className = 'AdagradOptimizer';\n private c: Scalar;\n private epsilon: Scalar;\n\n private accumulatedGrads: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, private initialAccumulatorValue = 0.1) {\n super();\n this.c = keep(scalar(-learningRate));\n\n const epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n this.epsilon = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedGrads[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedGrads[variableName] =\n fill(value.shape, this.initialAccumulatorValue)\n .variable(trainable);\n });\n }\n\n const gradient = variableGradients[variableName];\n const accumulatedGrad = this.accumulatedGrads[variableName];\n\n tidy(() => {\n const newAccumulatedGrad = accumulatedGrad.add(gradient.square());\n this.accumulatedGrads[variableName].assign(newAccumulatedGrad);\n\n const newValue =\n this.c\n .mul(gradient.div(newAccumulatedGrad.add(this.epsilon).sqrt()))\n .add(value);\n value.assign(newValue);\n });\n }\n }\n\n dispose() {\n this.epsilon.dispose();\n this.c.dispose();\n if (this.accumulatedGrads != null) {\n Object.keys(this.accumulatedGrads)\n .forEach(name => this.accumulatedGrads[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n initialAccumulatorValue: this.initialAccumulatorValue,\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate, config.initialAccumulatorValue);\n }\n}\nSerializationMap.register(AdagradOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar, Variable} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\nexport class AdamOptimizer extends Optimizer {\n static className = 'AdamOptimizer';\n private c: Scalar;\n private epsScalar: Scalar;\n private beta1Scalar: Scalar;\n private beta2Scalar: Scalar;\n private accBeta1: Variable;\n private accBeta2: Variable;\n private oneMinusBeta1: Scalar;\n private oneMinusBeta2: Scalar;\n private one: Scalar;\n\n private accumulatedFirstMoment: NamedVariableMap = {};\n private accumulatedSecondMoment: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected beta1: number,\n protected beta2: number, protected epsilon: number = null) {\n super();\n this.c = keep(scalar(-learningRate));\n // b1, b2 keep initial value of beta* hyperparameters.\n this.beta1Scalar = keep(scalar(beta1));\n this.beta2Scalar = keep(scalar(beta2));\n tidy(() => {\n // accB* will be updated by batch.\n this.accBeta1 = scalar(beta1).variable();\n this.accBeta2 = scalar(beta2).variable();\n });\n this.oneMinusBeta1 = keep(scalar(1 - beta1));\n this.oneMinusBeta2 = keep(scalar(1 - beta2));\n this.one = keep(scalar(1));\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n tidy(() => {\n const oneMinusAccBeta1 = this.one.sub(this.accBeta1);\n const oneMinusAccBeta2 = this.one.sub(this.accBeta2);\n\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedFirstMoment[variableName] == null) {\n const trainable = false;\n this.accumulatedFirstMoment[variableName] =\n zerosLike(value).variable(trainable);\n }\n if (this.accumulatedSecondMoment[variableName] == null) {\n const trainable = false;\n this.accumulatedSecondMoment[variableName] =\n zerosLike(value).variable(trainable);\n }\n\n const gradient = variableGradients[variableName];\n const firstMoment = this.accumulatedFirstMoment[variableName];\n const secondMoment = this.accumulatedSecondMoment[variableName];\n\n const newFirstMoment = this.beta1Scalar.mul(firstMoment)\n .add(this.oneMinusBeta1.mul(gradient));\n const newSecondMoment =\n this.beta2Scalar.mul(secondMoment)\n .add(this.oneMinusBeta2.mul(gradient.square()));\n\n const biasCorrectedFirstMoment = newFirstMoment.div(oneMinusAccBeta1);\n const biasCorrectedSecondMoment = newSecondMoment.div(oneMinusAccBeta2);\n\n this.accumulatedFirstMoment[variableName].assign(newFirstMoment);\n this.accumulatedSecondMoment[variableName].assign(newSecondMoment);\n\n const newValue =\n this.c\n .mul(biasCorrectedFirstMoment.div(\n this.epsScalar.add(biasCorrectedSecondMoment.sqrt())))\n .add(value);\n value.assign(newValue);\n }\n\n this.accBeta1.assign(this.accBeta1.mul(this.beta1Scalar));\n this.accBeta2.assign(this.accBeta2.mul(this.beta2Scalar));\n });\n }\n\n dispose() {\n this.c.dispose();\n this.epsScalar.dispose();\n this.beta1Scalar.dispose();\n this.beta2Scalar.dispose();\n this.accBeta1.dispose();\n this.accBeta2.dispose();\n this.oneMinusBeta1.dispose();\n this.oneMinusBeta2.dispose();\n this.one.dispose();\n\n if (this.accumulatedFirstMoment != null) {\n Object.keys(this.accumulatedFirstMoment)\n .forEach(name => this.accumulatedFirstMoment[name].dispose());\n }\n\n if (this.accumulatedSecondMoment != null) {\n Object.keys(this.accumulatedSecondMoment)\n .forEach(name => this.accumulatedSecondMoment[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n beta1: this.beta1,\n beta2: this.beta2,\n epsilon: this.epsilon,\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(\n config.learningRate, config.beta1, config.beta2, config.epsilon);\n }\n}\nSerializationMap.register(AdamOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar, Variable} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\nexport class AdamaxOptimizer extends Optimizer {\n static className = 'AdamaxOptimizer';\n private c: Scalar;\n private epsScalar: Scalar;\n private accBeta1: Variable;\n private beta1Scalar: Scalar;\n private beta2Scalar: Scalar;\n private decayScalar: Scalar;\n private oneMinusBeta1: Scalar;\n private one: Scalar;\n private iteration: Variable;\n\n private accumulatedFirstMoment: NamedVariableMap = {};\n private accumulatedWeightedInfNorm: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected beta1: number,\n protected beta2: number, protected epsilon: number = null,\n protected decay = 0.0) {\n super();\n this.c = keep(scalar(-learningRate));\n\n // b1, b2 keep initial value of beta* hyperparameters.\n this.beta1Scalar = keep(scalar(beta1));\n this.beta2Scalar = keep(scalar(beta2));\n\n this.decayScalar = keep(scalar(decay));\n\n tidy(() => {\n this.iteration = scalar(0).variable();\n this.accBeta1 = scalar(beta1).variable();\n });\n\n this.oneMinusBeta1 = keep(scalar(1 - beta1));\n this.one = keep(scalar(1));\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n tidy(() => {\n const oneMinusAccBeta1 = this.one.sub(this.accBeta1);\n const lr = this.c.div(this.one.add(this.decayScalar.mul(this.iteration)));\n\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedFirstMoment[variableName] == null) {\n const trainable = false;\n this.accumulatedFirstMoment[variableName] =\n zerosLike(value).variable(trainable);\n }\n if (this.accumulatedWeightedInfNorm[variableName] == null) {\n const trainable = false;\n this.accumulatedWeightedInfNorm[variableName] =\n zerosLike(value).variable(trainable);\n }\n\n const gradient = variableGradients[variableName];\n const firstMoment = this.accumulatedFirstMoment[variableName];\n const weightedInfNorm = this.accumulatedWeightedInfNorm[variableName];\n\n const newFirstMoment = this.beta1Scalar.mul(firstMoment)\n .add(this.oneMinusBeta1.mul(gradient));\n\n const ut0 = this.beta2Scalar.mul(weightedInfNorm);\n const ut1 = gradient.abs();\n\n const newWeightedInfNorm = ut0.maximum(ut1);\n\n this.accumulatedFirstMoment[variableName].assign(newFirstMoment);\n this.accumulatedWeightedInfNorm[variableName].assign(\n newWeightedInfNorm);\n\n const newValue =\n lr.div(oneMinusAccBeta1)\n .mul(newFirstMoment.div(this.epsScalar.add(newWeightedInfNorm)))\n .add(value);\n\n value.assign(newValue);\n }\n\n this.iteration.assign(this.iteration.add(this.one));\n this.accBeta1.assign(this.accBeta1.mul(this.beta1Scalar));\n });\n }\n\n dispose() {\n this.c.dispose();\n this.epsScalar.dispose();\n this.accBeta1.dispose();\n this.beta1Scalar.dispose();\n this.beta2Scalar.dispose();\n this.oneMinusBeta1.dispose();\n\n this.decayScalar.dispose();\n this.iteration.dispose();\n\n this.one.dispose();\n\n if (this.accumulatedFirstMoment != null) {\n Object.keys(this.accumulatedFirstMoment)\n .forEach(name => this.accumulatedFirstMoment[name].dispose());\n }\n\n if (this.accumulatedWeightedInfNorm != null) {\n Object.keys(this.accumulatedWeightedInfNorm)\n .forEach(name => this.accumulatedWeightedInfNorm[name].dispose());\n }\n }\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n beta1: this.beta1,\n beta2: this.beta2,\n epsilon: this.epsilon,\n decay: this.decay\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(\n config.learningRate, config.beta1, config.beta2, config.epsilon,\n config.decay);\n }\n}\nSerializationMap.register(AdamaxOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedTensorMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\n\n/** @doclink Optimizer */\nexport class SGDOptimizer extends Optimizer {\n static className = 'SGDOptimizer';\n protected c: Scalar;\n\n constructor(protected learningRate: number) {\n super();\n this.setLearningRate(learningRate);\n }\n\n applyGradients(variableGradients: NamedTensorMap) {\n const varNames = Object.keys(variableGradients);\n varNames.forEach(varName => {\n const gradient = variableGradients[varName];\n const value = ENV.engine.registeredVariables[varName];\n\n tidy(() => {\n const newValue = this.c.mul(gradient).add(value);\n value.assign(newValue);\n });\n });\n }\n\n /**\n * Sets the learning rate of the optimizer.\n */\n setLearningRate(learningRate: number) {\n this.learningRate = learningRate;\n if (this.c != null) {\n this.c.dispose();\n }\n this.c = keep(scalar(-learningRate));\n }\n\n dispose() {\n this.c.dispose();\n }\n\n getConfig(): ConfigDict {\n return {learningRate: this.learningRate};\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate);\n }\n}\nSerializationMap.register(SGDOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar, Tensor} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {SGDOptimizer} from './sgd_optimizer';\n\n/** @doclink Optimizer */\nexport class MomentumOptimizer extends SGDOptimizer {\n static className = 'MomentumOptimizer';\n private m: Scalar;\n private accumulations: NamedVariableMap;\n\n constructor(\n protected learningRate: number, private momentum: number,\n private useNesterov = false) {\n super(learningRate);\n this.m = scalar(this.momentum);\n this.accumulations = {};\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulations[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulations[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n\n const accumulation = this.accumulations[variableName];\n const gradient = variableGradients[variableName];\n\n tidy(() => {\n let newValue: Tensor;\n const newAccumulation = this.m.mul(accumulation).add(gradient);\n if (this.useNesterov) {\n newValue =\n this.c.mul(gradient.add(newAccumulation.mul(this.m))).add(value);\n } else {\n newValue = this.c.mul(newAccumulation).add(value);\n }\n this.accumulations[variableName].assign(newAccumulation);\n value.assign(newValue);\n });\n }\n }\n\n dispose() {\n super.dispose();\n this.m.dispose();\n if (this.accumulations != null) {\n for (const variableName in this.accumulations) {\n this.accumulations[variableName].dispose();\n }\n }\n }\n\n /**\n * Sets the momentum of the optimizer.\n *\n * @param momentum\n */\n setMomentum(momentum: number) {\n this.momentum = momentum;\n }\n\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n momentum: this.momentum,\n useNesterov: this.useNesterov\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(config.learningRate, config.momentum, config.useNesterov);\n }\n}\nSerializationMap.register(MomentumOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {ENV} from '../environment';\nimport {keep, tidy} from '../globals';\nimport {scalar, zerosLike} from '../ops/ops';\nimport {ConfigDict, Serializable, SerializableConstructor, SerializationMap} from '../serialization';\nimport {Scalar} from '../tensor';\nimport {NamedVariableMap} from '../tensor_types';\nimport {Optimizer} from './optimizer';\nimport * as optimizer_utils from './optimizer_utils';\n\n/** @doclink Optimizer */\nexport class RMSPropOptimizer extends Optimizer {\n static className = 'RMSPropOptimizer';\n private c: Scalar;\n private epsilonScalar: Scalar;\n private decayScalar: Scalar;\n private momentumScalar: Scalar;\n private oneMinusDecay: Scalar;\n private centered: boolean;\n\n private accumulatedMeanSquares: NamedVariableMap = {};\n private accumulatedMeanGrads: NamedVariableMap = {};\n private accumulatedMoments: NamedVariableMap = {};\n\n constructor(\n protected learningRate: number, protected decay = 0.9,\n protected momentum = 0.0, protected epsilon: number = null,\n centered = false) {\n super();\n\n this.c = keep(scalar(learningRate));\n this.decayScalar = keep(scalar(decay));\n this.momentumScalar = keep(scalar(momentum));\n this.oneMinusDecay = keep(scalar(1 - decay));\n this.centered = centered;\n\n if (epsilon === null) {\n epsilon = optimizer_utils.getOptimizerDefaultEpsilonValue();\n }\n\n this.epsilonScalar = keep(scalar(epsilon));\n }\n\n applyGradients(variableGradients: NamedVariableMap) {\n for (const variableName in variableGradients) {\n const value = ENV.engine.registeredVariables[variableName];\n if (this.accumulatedMeanSquares[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedMeanSquares[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n if (this.accumulatedMeanGrads[variableName] == null && this.centered) {\n const trainable = false;\n tidy(() => {\n this.accumulatedMeanGrads[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n if (this.accumulatedMoments[variableName] == null) {\n const trainable = false;\n tidy(() => {\n this.accumulatedMoments[variableName] =\n zerosLike(value).variable(trainable);\n });\n }\n\n const accumulatedMeanSquare = this.accumulatedMeanSquares[variableName];\n const accumulatedMeanGrad = this.accumulatedMeanGrads[variableName];\n const accumulatedMoments = this.accumulatedMoments[variableName];\n const gradient = variableGradients[variableName];\n\n tidy(() => {\n const newAccumulatedMeanSquare =\n this.decayScalar.mul(accumulatedMeanSquare)\n .add(this.oneMinusDecay.mul(gradient.square()));\n\n if (this.centered) {\n // Centered gradient\n const newAccumulatedMeanGrad =\n this.decayScalar.mul(accumulatedMeanGrad)\n .add(this.oneMinusDecay.mul(gradient));\n\n const newAccumulatedMoments =\n this.momentumScalar.mul(accumulatedMoments)\n .add(this.c.mul(gradient).div(\n newAccumulatedMeanSquare\n .sub(newAccumulatedMeanGrad.square().add(\n this.epsilonScalar))\n .sqrt()));\n\n this.accumulatedMeanSquares[variableName].assign(\n newAccumulatedMeanSquare);\n this.accumulatedMeanGrads[variableName].assign(\n newAccumulatedMeanGrad);\n this.accumulatedMoments[variableName].assign(newAccumulatedMoments);\n\n const newValue = value.sub(newAccumulatedMoments);\n value.assign(newValue);\n } else {\n // Plain gradient\n const newAccumulatedMeanSquare =\n this.decayScalar.mul(accumulatedMeanSquare)\n .add(this.oneMinusDecay.mul(gradient.square()));\n\n const newAccumulatedMoments =\n this.momentumScalar.mul(accumulatedMoments)\n .add(this.c.mul(gradient).div(\n newAccumulatedMeanSquare.add(this.epsilonScalar).sqrt()));\n\n this.accumulatedMeanSquares[variableName].assign(\n newAccumulatedMeanSquare);\n this.accumulatedMoments[variableName].assign(newAccumulatedMoments);\n\n const newValue = value.sub(newAccumulatedMoments);\n value.assign(newValue);\n }\n });\n }\n }\n\n dispose() {\n this.c.dispose();\n this.epsilonScalar.dispose();\n this.decayScalar.dispose();\n this.momentumScalar.dispose();\n this.oneMinusDecay.dispose();\n if (this.accumulatedMeanSquares != null) {\n Object.keys(this.accumulatedMeanSquares)\n .forEach(name => this.accumulatedMeanSquares[name].dispose());\n }\n if (this.accumulatedMeanGrads != null && this.centered) {\n Object.keys(this.accumulatedMeanGrads)\n .forEach(name => this.accumulatedMeanGrads[name].dispose());\n }\n if (this.accumulatedMoments != null) {\n Object.keys(this.accumulatedMoments)\n .forEach(name => this.accumulatedMoments[name].dispose());\n }\n }\n\n getConfig(): ConfigDict {\n return {\n learningRate: this.learningRate,\n decay: this.decay,\n momentum: this.momentum,\n epsilon: this.epsilon,\n centered: this.centered\n };\n }\n static fromConfig(\n cls: SerializableConstructor, config: ConfigDict): T {\n return new cls(\n config.learningRate, config.decay, config.momentum, config.epsilon,\n config.centered);\n }\n}\nSerializationMap.register(RMSPropOptimizer);\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport {AdadeltaOptimizer} from './adadelta_optimizer';\nimport {AdagradOptimizer} from './adagrad_optimizer';\nimport {AdamOptimizer} from './adam_optimizer';\nimport {AdamaxOptimizer} from './adamax_optimizer';\nimport {MomentumOptimizer} from './momentum_optimizer';\nimport {RMSPropOptimizer} from './rmsprop_optimizer';\nimport {SGDOptimizer} from './sgd_optimizer';\n\nexport class OptimizerConstructors {\n /**\n * Constructs a `SGDOptimizer` that uses stochastic gradient descent.\n *\n * ```js\n * // Fit a quadratic function by learning the coefficients a, b, c.\n * const xs = tf.tensor1d([0, 1, 2, 3]);\n * const ys = tf.tensor1d([1.1, 5.9, 16.8, 33.9]);\n *\n * const a = tf.scalar(Math.random()).variable();\n * const b = tf.scalar(Math.random()).variable();\n * const c = tf.scalar(Math.random()).variable();\n *\n * // y = a * x^2 + b * x + c.\n * const f = x => a.mul(x.square()).add(b.mul(x)).add(c);\n * const loss = (pred, label) => pred.sub(label).square().mean();\n *\n * const learningRate = 0.01;\n * const optimizer = tf.train.sgd(learningRate);\n *\n * // Train the model.\n * for (let i = 0; i < 10; i++) {\n * optimizer.minimize(() => loss(f(xs), ys));\n * }\n *\n * // Make predictions.\n * console.log(\n * `a: ${a.dataSync()}, b: ${b.dataSync()}, c: ${c.dataSync()}`);\n * const preds = f(xs).dataSync();\n * preds.forEach((pred, i) => {\n * console.log(`x: ${i}, pred: ${pred}`);\n * });\n * ```\n *\n * @param learningRate The learning rate to use for the SGD algorithm.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static sgd(learningRate: number): SGDOptimizer {\n return new SGDOptimizer(learningRate);\n }\n\n /**\n * Constructs a `MomentumOptimizer` that uses momentum gradient\n * descent.\n *\n * See\n * [http://proceedings.mlr.press/v28/sutskever13.pdf](\n * http://proceedings.mlr.press/v28/sutskever13.pdf)\n *\n * @param learningRate The learning rate to use for the Momentum gradient\n * descent algorithm.\n * @param momentum The momentum to use for the momentum gradient descent\n * algorithm.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static momentum(learningRate: number, momentum: number, useNesterov = false):\n MomentumOptimizer {\n return new MomentumOptimizer(learningRate, momentum, useNesterov);\n }\n\n /**\n * Constructs a `RMSPropOptimizer` that uses RMSProp gradient\n * descent. This implementation uses plain momentum and is not centered\n * version of RMSProp.\n *\n * See\n * [http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf](\n * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf)\n *\n * @param learningRate The learning rate to use for the RMSProp gradient\n * descent algorithm.\n * @param decay The discounting factor for the history/coming gradient.\n * @param momentum The momentum to use for the RMSProp gradient descent\n * algorithm.\n * @param epsilon Small value to avoid zero denominator.\n * @param centered If true, gradients are normalized by the estimated\n * variance of the gradient.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static rmsprop(\n learningRate: number, decay = .9, momentum = 0.0, epsilon: number = null,\n centered = false): RMSPropOptimizer {\n return new RMSPropOptimizer(\n learningRate, decay, momentum, epsilon, centered);\n }\n\n /**\n * Constructs a `AdamOptimizer` that uses the Adam algorithm.\n * See [https://arxiv.org/abs/1412.6980](https://arxiv.org/abs/1412.6980)\n *\n * @param learningRate The learning rate to use for the Adam gradient\n * descent algorithm.\n * @param beta1 The exponential decay rate for the 1st moment estimates.\n * @param beta2 The exponential decay rate for the 2nd moment estimates.\n * @param epsilon A small constant for numerical stability.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adam(\n learningRate = 0.001, beta1 = 0.9, beta2 = 0.999,\n epsilon: number = null): AdamOptimizer {\n return new AdamOptimizer(learningRate, beta1, beta2, epsilon);\n }\n\n /**\n * Constructs a `AdadeltaOptimizer` that uses the Adadelta algorithm.\n * See [https://arxiv.org/abs/1212.5701](https://arxiv.org/abs/1212.5701)\n *\n * @param learningRate The learning rate to use for the Adadelta gradient\n * descent algorithm.\n * @param rho The learning rate decay over each update.\n * @param epsilon A constant epsilon used to better condition the grad\n * update.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adadelta(learningRate = .001, rho = .95, epsilon: number = null):\n AdadeltaOptimizer {\n return new AdadeltaOptimizer(learningRate, rho, epsilon);\n }\n\n /**\n * Constructs a `AdamaxOptimizer` that uses the Adamax algorithm.\n * See [https://arxiv.org/abs/1412.6980](https://arxiv.org/abs/1412.6980)\n *\n * @param learningRate The learning rate to use for the Adamax gradient\n * descent algorithm.\n * @param beta1 The exponential decay rate for the 1st moment estimates.\n * @param beta2 The exponential decay rate for the 2nd moment estimates.\n * @param epsilon A small constant for numerical stability.\n * @param decay The learning rate decay over each update.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adamax(\n learningRate = 0.002, beta1 = 0.9, beta2 = 0.999, epsilon: number = null,\n decay = 0.0): AdamaxOptimizer {\n return new AdamaxOptimizer(learningRate, beta1, beta2, epsilon, decay);\n }\n\n /**\n * Constructs a `AdagradOptimizer` that uses the Adagrad algorithm.\n * See\n * [http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf](\n * http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf)\n * or\n * [http://ruder.io/optimizing-gradient-descent/index.html#adagrad](\n * http://ruder.io/optimizing-gradient-descent/index.html#adagrad)\n *\n * @param learningRate The learning rate to use for the Adagrad gradient\n * descent algorithm.\n * @param initialAccumulatorValue Starting value for the accumulators, must be\n * positive.\n */\n /**\n * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'}\n */\n static adagrad(learningRate: number, initialAccumulatorValue = 0.1):\n AdagradOptimizer {\n return new AdagradOptimizer(learningRate, initialAccumulatorValue);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// So typings can propagate.\nimport {AdadeltaOptimizer} from './optimizers/adadelta_optimizer';\nimport {AdagradOptimizer} from './optimizers/adagrad_optimizer';\nimport {AdamOptimizer} from './optimizers/adam_optimizer';\nimport {AdamaxOptimizer} from './optimizers/adamax_optimizer';\nimport {MomentumOptimizer} from './optimizers/momentum_optimizer';\nimport {OptimizerConstructors} from './optimizers/optimizer_constructors';\nimport {RMSPropOptimizer} from './optimizers/rmsprop_optimizer';\nimport {SGDOptimizer} from './optimizers/sgd_optimizer';\n\n// tslint:disable-next-line:no-unused-expression\n[MomentumOptimizer, SGDOptimizer, AdadeltaOptimizer, AdagradOptimizer,\n RMSPropOptimizer, AdamaxOptimizer, AdamOptimizer];\n\nexport const train = {\n sgd: OptimizerConstructors.sgd,\n momentum: OptimizerConstructors.momentum,\n adadelta: OptimizerConstructors.adadelta,\n adagrad: OptimizerConstructors.adagrad,\n rmsprop: OptimizerConstructors.rmsprop,\n adamax: OptimizerConstructors.adamax,\n adam: OptimizerConstructors.adam\n};\n","/**\n * @license\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\n// backend_cpu.ts and backend_webgl.ts are standalone files and should be\n// explicily included here. Below, there is an export from backend_webgl, but\n// that doesn't count since it's exporting a Typescript interface.\nimport './kernels/backend_webgl';\nimport './kernels/backend_cpu';\n\nimport {nextFrame} from './browser_util';\nimport * as environment from './environment';\nimport {Environment} from './environment';\n\n// Serialization.\nimport * as io from './io/io';\nimport * as serialization from './serialization';\nimport {setOpHandler} from './tensor';\nimport * as test_util from './test_util';\nimport * as util from './util';\nimport {version} from './version';\nimport * as webgl from './webgl';\n\nexport {InferenceModel, ModelPredictConfig} from './model_types';\n\n// Optimizers.\nexport {AdadeltaOptimizer} from './optimizers/adadelta_optimizer';\nexport {AdagradOptimizer} from './optimizers/adagrad_optimizer';\nexport {AdamOptimizer} from './optimizers/adam_optimizer';\nexport {AdamaxOptimizer} from './optimizers/adamax_optimizer';\nexport {MomentumOptimizer} from './optimizers/momentum_optimizer';\nexport {Optimizer} from './optimizers/optimizer';\nexport {RMSPropOptimizer} from './optimizers/rmsprop_optimizer';\nexport {SGDOptimizer} from './optimizers/sgd_optimizer';\nexport {Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorBuffer, variable, Variable} from './tensor';\nexport {NamedTensorMap} from './tensor_types';\nexport {DataType, Rank, ShapeMap} from './types';\n\nexport * from './ops/ops';\nexport {LSTMCellFunc} from './ops/lstm';\nexport {Reduction} from './ops/loss_ops';\n\nexport * from './train';\nexport * from './globals';\n\nexport {Features} from './environment_util';\nexport {TimingInfo} from './engine';\nexport {ENV, Environment} from './environment';\n\nexport const setBackend = Environment.setBackend;\nexport const getBackend = Environment.getBackend;\nexport const disposeVariables = Environment.disposeVariables;\nexport const memory = Environment.memory;\nexport {version as version_core};\n\nexport {nextFrame};\n\n// Second level exports.\nexport {environment, io, serialization, test_util, util, webgl};\n\n// Backend specific.\nexport {KernelBackend, BackendTimingInfo} from './kernels/backend';\n\nimport * as ops from './ops/ops';\nsetOpHandler(ops);\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '0.12.8';\nexport {version};\n"],"names":["array","counter","length","temp","index","Math","random","min","x","max","a","b","expr","msg","Error","shapeA","shapeB","errorMessagePrefix","assert","arraysEqual","arr","ret","Array","isArray","i","flatten","push","val","firstElem","isTypedArray","shape","indices","join","subShape","slice","deepAssertShapeConsistency","concat","size","n1","n2","tanh","Infinity","e2x","exp","floor","sqrt","repeat","checkFn","delayFn","maxCounter","Promise","resolve","reject","tryCount","tryFn","nextBackoff","setTimeout","shapeProd","implicitIdx","newShape","axis","keptDims","j","dtype","values","Float32Array","Int32Array","Uint8Array","vals","name","isNaN","oldType","newType","f","constructor","call","apply","start","rank","strides","debugMode","noConversionNeeded","checkConversionForNaN","bool","round","copyTypedArray","makeZerosTypedArray","performance","now","process","time","hrtime","result","diff","Number","n","shuffledIndices","Uint32Array","shuffle","backendTimer","logger","this","Logger","Profiler","timer","forEach","r","dataSync","util.checkComputationForNaN","then","timing","_this","logKernelProfile","kernelMs","timeMs","util.rightPad","paddedName","toString","console","log","FORMAT_LIMIT_NUM_VALS","FORMAT_NUM_FIRST_LAST_VALS","FORMAT_NUM_SIG_DIGITS","verbose","computeStrides","padPerCol","sizeFromShape","numCols","fill","row","offset","valToString","computeMaxSizePerColumn","valsLines","isLast","firstVals","from","subarray","lastVals","map","subshape","substrides","stride","lines","end","subTensorToString","sep","newLineSep","l","pad","rightPad","parseFloat","toFixed","util.sizeFromShape","util.assert","util.getTypedArrayFromDType","TensorBuffer","value","_i","locs","locToIndex","Object","Tensor","make","trackerFn","opHandler","fn","dataId","id","nextId","rankType","registerTensor","write","data","throwIfDisposed","as1D","reshape","rows","columns","depth","depth2","cast","buffer","read","readSync","isDisposed","disposeTensor","isDisposedInternal","asType","print","expandDims","exclusive","reverse","cumsum","squeeze","clone","tensorToString","reps","tile","gather","transposeA","transposeB","matMul","dot","ord","keepDims","norm","begin","stack","unstack","paddings","constantValue","mean","variance","varianceEpsilon","scale","batchNormalization","all","any","logSumExp","sum","argMin","argMax","add","addStrict","sub","subStrict","pow","powStrict","mul","mulStrict","div","floorDiv","divStrict","minimum","minimumStrict","maximum","maximumStrict","mod","modStrict","squaredDifference","squaredDifferenceStrict","perm","transpose","notEqual","notEqualStrict","less","lessStrict","equal","equalStrict","lessEqual","lessEqualStrict","greater","greaterStrict","greaterEqual","greaterEqualStrict","logicalAnd","logicalOr","logicalNot","logicalXor","condition","where","neg","ceil","sign","expm1","log1p","rsqrt","square","reciprocal","abs","clipByValue","relu","elu","selu","alpha","leakyRelu","prelu","sigmoid","logSigmoid","softplus","sin","cos","tan","asin","acos","atan","sinh","cosh","asinh","acosh","atanh","erf","step","dim","softmax","newShape2D","alignCorners","image","resizeBilinear","resizeNearestNeighbor","filter","dataFormat","dilation","dimRoundingMode","conv1d","dilations","conv2d","outputShape","conv2dTranspose","depthwiseConv2d","filterSize","avgPool","maxPool","radius","bias","beta","localResponseNormalization","trainable","Variable","variable","segmentIds","numSegments","unsortedSegmentSum","blockShape","crops","batchToSpaceND","spaceToBatchND","defineProperty","Symbol","hasInstance","instance","initialValue","_super","nextVarId","registerVariable","ex","tslib_1.__extends","newValue","util.arraysEqual","assign","Function","list","container","seen","obj","iterable","k","has","walkTensorContainer","Set","Type","backend","safeMode","WeakMap","activeScope","track","scopeStack","profiler","Engine","nameOrFn","gradMode","String","scopedRun","startScope","endScope","error","res","forwardFunc","inputs","backwardsFunc","saved","saveFunc","scopeName","customGradientDepth","profileKernel","shouldRecord","tapeNode","nextTapeNodeId","output","gradient","dy","activeTape","refCount","refCounter","get","numTensors","numDataBuffers","numBytes","util.bytesPerElement","register","set","v","registeredVariables","keepTensors","delete","disposeData","varName","info","memory","gradientsFunc","inputsMap","input","idx","resMap","gradientsMode","gradientScopeCount","scopeInfo","tensorsToKeep","tensorsToTrackInParent","getTensorsInContainer","tensor","dispose","oldScope","pop","tensorList","isTensorInList","xs","allowNoGradients","tidy","y","filteredTape","tape","tensorsFromX","nodesFromX","nodeInputs","node","inputName","anyInputFromX","tensorsLeadToY","nodesToY","outputs","prunedInputs","nodeInput","prunedNode","getFilteredNodesXToY","accumulatedGradientMap","makeOnesTypedArray","tensorAccumulatedGradientMap","inputGradients","keys","dx","curGradient","backpropagateGradients","grads","util.isFunction","every","t","_a","gradFunc","addTapeNode","pixels","numChannels","fromPixels","query","timingInfo","wallMs","URL_PROPERTIES","type","BOOLEAN","NUMBER","STRING","webGLVersion","isBrowser","gl","getWebGLRenderingContext","e","loseContext","TENSORFLOWJS_FLAGS_PREFIX","features","window","location","queryString","params","urlParams","search","replace","s","decodeURIComponent","decodeParam","urlFlags_1","split","keyValue","key","urlProperty","warn","extensionName","getExtension","tempCanvas","document","createElement","getContext","loseContextExtension","frameBuffer","createFramebuffer","texture","createTexture","bindTexture","TEXTURE_2D","internalFormat","RGBA32F","RGBA","texImage2D","FLOAT","bindFramebuffer","FRAMEBUFFER","framebufferTexture2D","COLOR_ATTACHMENT0","Environment","backendName","ENV","registry","initBackend","initDefaultBackend","engine","disposeVariables","keep","feature","evaluateFeature","entry","sort","priority","versions","navigator","userAgent","test","vendor","getBestBackendName","queryTimerVersion","hasExtension","getWebGLDisjointQueryTimerVersion","opera","substr","isWebGLVersionEnabled","createFloatTextureAndBindToFramebuffer","isFrameBufferComplete","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","isRenderToFloatTextureEnabled","readPixels","readPixelsNoError","getError","NO_ERROR","isDownloadFloatTextureEnabled","isEnabled","fenceSync","isWebGLFenceEnabled","getFeaturesFromURL","globalEngine","findBackend","factory","setTensorTrackerFn","err","message","ns","getGlobalNamespace","setTensorTracker","inputShape","prod","batchToSpace","reshaped","spatialLength","reshapedRank","blockShapeRank","permuted","permutedBeforeBatch","permutedAfterBatch","reshapedPermuted","sliceBeginCoords","uncroppedShape","sliceSize","axes","aShape","outShape","indexOf","outputLoc","reduceLoc","loc","outIdx","reduceIdx","combineLocations","ax","util.isInt","axesAreInnerMostDims","numAxes","PARALLELIZE_THRESHOLD","inSize","nearestDivisor","beginMask","endMask","startIndex","endIndex","startForAxis","stopForAxis","d","count","startIndices","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","axisSize","util.clamp","stopIndices","stop","varList","originalVarCount","some","g","namedGrads","customGrad","argName","functionName","inferredShape","inferShape","toTypedArray","arg","convertToTensor","opName","endsWith","substring","f2","args","configurable","op","softmax_","logits","$logits","lse","toFloat","dyTimesY","customOp","assertShapesMatch","assertNonNull","getTypedArrayFromDType","num","tensor1d","zeros","DType","Rank","UpcastInt32AndMap","UpcastBoolAndMap","UpcastFloat32AndMap","onesLike","onesLike_","$x","ones","zerosLike","zerosLike_","upcastTypeMap","float32","int32","typeA","typeB","upcastType","hasEncodingLoss","int","scalar","boxes","scores","maxOutputSize","iouThreshold","scoreThreshold","candidates","score","boxIndex","c","c1","c2","selected","ignoreCandidate","intersectionOverUnion","iCoord","jCoord","yminI","xminI","ymaxI","xmaxI","yminJ","xminJ","ymaxJ","xmaxJ","areaI","areaJ","intersectionYmin","intersectionXmin","intersectionYmax","intersectionXmax","intersectionArea","xShape","xDtype","sorted","lastDim","batch","allTopKVals","allTopKIndices","valAndInd","outOffset","topKVals","topKIndices","reduceInfo","firstPass","windowSize","batchSize","outSize","variableNames","compOp","indexSnippet","userCode","convInfo","inShape","filterHeight","filterWidth","strideHeight","strideWidth","padTop","padInfo","top","padLeft","left","avgMultiplier","outHeight","outWidth","inRank","dims","unshift","inDim","outAxis","outDim","errMsg","meanShape","varianceShape","offsetShape","scaleShape","broadcast_util.assertAndGetBroadcastShape","offsetSnippet","scaleSnippet","bShape","BinaryOpProgram","gpgpu","webGLProgram","startLoc","getUniformLocationNoThrow","uniform1f","NaN","minFixed","maxFixed","x1Shape","x2Shape","concat_util.computeOutShape","filterShape","inHeight","inWidth","outChannels","channelMul","inChannels","dilationHeight","dilationWidth","inputDepthNearestVec4","inputDepthVec4Remainder","xNumRows","xNumCols","inputsInfo","broadcast","inputPrefixSnippet","shapeInfo","logicalShape","isUniform","inputSamplingSnippet","inInfo","outShapeInfo","inputInfo","texName","funcName","charAt","toUpperCase","texShape","tNumR","tNumC","getSamplerFlat","getSamplerFromInInfo","supportsBroadcasting","texFuncSnippet","broadcastDims","broadcast_util.getBroadcastDims","outRank","doBroadcast","broadcastOverOuter","broadcast_util.broadcastDimsAreOuter","coordsSnippet","rankDiff","unpackedCoordsSnippet","getBroadcastOutputCoordsSampler","broadcastSnippet","outTexShape","inTexShape","getSamplerAtOutputCoords","getInputSamplingSnippet","outputSamplingSnippet","getOutput1DCoords","getOutput2DCoords","stride0","stride1","stride2","getOutput4DCoords","stride3","getOutput5DCoords","stride4","getOutput6DCoords","getOutputSamplingSnippet","SHADER_PREFIX","FLOAT_TEXTURE_SAMPLE_SNIPPET","FLOAT_TEXTURE_SETOUTPUT_SNIPPET","getSamplerScalar","texNumR_1","texNumC_1","squeezedShape","newInputInfo","squeezeInputInfo","getSqueezedParams","texNumR","texNumC","getSampler2D","getSampler3D","getSampler4D","getSampler5D","getSampler6D","JSON","parse","stringify","finalDim","comparator","getCoordsDataType","getFinalCoord","getCoords","TextureUsage","PhysicalTextureType","height","width","indicesLength","sourceCoords","currentCoords","getSourceCoords","matrixSize","channelsPerTexture","unpackedArray","matrix","requiredSize","unpackedSize","getMatrixSizeFromUnpackedArraySize","dst","src","MAX_TEXTURE_SIZE","attributes","canvas","createWebGLRenderingContextFromCanvas","webglVersion","func","returnValue","checkWebGLError","webGLDebugErrorCheckingEnabled","enabled","getWebGLErrorMessage","status","INVALID_ENUM","INVALID_VALUE","INVALID_OPERATION","INVALID_FRAMEBUFFER_OPERATION","OUT_OF_MEMORY","CONTEXT_LOST_WEBGL","throwIfNull","vertexShaderSource","vertexShader","createShader","VERTEX_SHADER","callAndCheck","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","fragmentShaderSource","fragmentShader","FRAGMENT_SHADER","shaderInfoLog","lineNumberRegexResult","lineNumberRegex","exec","lineNumber","shaderLines","linesWithLineNumbers","line","maxLineLength","beforeErrorLines","errorLine","afterErrorLines","logShaderSourceAndInfoLog","createProgram","program","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","validateProgram","VALIDATE_STATUS","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","ELEMENT_ARRAY_BUFFER","getParameter","maxTextureSize","queryMaxTextureSize","requested","attribute","arrayEntriesPerItem","itemStrideInBytes","itemOffsetInBytes","getAttribLocation","vertexAttribPointer","enableVertexAttribArray","textureUnit","validateTextureUnit","activeTexture","TEXTURE0","uniformName","getUniformLocation","uniformSamplerLocation","bindTextureUnit","uniform1i","framebuffer","getFramebufferErrorMessage","FRAMEBUFFER_INCOMPLETE_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_DIMENSIONS","FRAMEBUFFER_UNSUPPORTED","returnTOrNull","failureMessage","tOrNull","maxTextureUnit","MAX_COMBINED_TEXTURE_IMAGE_UNITS","glTextureUnit","logShape","util.squeezeShape","maxTexSize","util.sizeToSquarishShape","viewport","scissor","antialias","premultipliedAlpha","preserveDrawingBuffer","stencil","failIfMajorPerformanceCaveat","webgl_util.callAndCheck","webgl_util.createWebGLRenderingContextFromCanvas","webgl_util.createWebGLRenderingContext","disable","DEPTH_TEST","STENCIL_TEST","BLEND","DITHER","POLYGON_OFFSET_FILL","SAMPLE_COVERAGE","enable","SCISSOR_TEST","CULL_FACE","cullFace","BACK","webgl_util.createVertexShader","webgl_util.createStaticVertexBuffer","webgl_util.createStaticIndexBuffer","Uint16Array","textureHalfFloatExtension","internalFormatFloat","internalFormatHalfFloat","internalFormatPackedFloat","textureFormatFloat","downloadUnpackNumChannels","defaultNumChannels","textureTypeHalfFloat","glany","R32F","R16F","RED","HALF_FLOAT","HALF_FLOAT_OES","downloadTextureFormat","textureFormat","textureType","webgl_util.validateTextureSize","webgl_util.createTexture","tex2d","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","textureConfig","createAndConfigureTexture","UNSIGNED_BYTE","vertexBuffer","webgl_util.bindVertexBufferToProgramAttribute","texSubImage2D","w","h","getUnpackedArraySizeFromMatrixSize","tex_util.encodeMatrixToUnpackedArray","tex_util.getUnpackedArraySizeFromMatrixSize","uploadDataToTexture","packedRGBA","tex_util.getPackedRGBAArraySizeFromMatrixShape","getPackedRGBAArraySizeFromMatrixShape","textureWidth","textureHeight","oddWidth","oddHeight","widthInFullBlocks","heightInFullBlocks","dstStride","oneRow","blockY","matrixSrcRow","blockX","srcStride","tex_util.encodeMatrixToPackedRGBA","bufferOrTexture","gl2_1","buffer_1","PIXEL_PACK_BUFFER","bufferSizeBytes_1","gl2","downloadTarget","getBufferSubData","tex_util.decodeMatrixFromUnpackedArray","dstRow1","dstRow2","tex_util.decodeMatrixFromPackedRGBA","gpgpu_util.createWebGLContext","textureFloatExtension","webgl_util.getExtensionOrThrow","colorBufferFloatExtension","colorBufferHalfFloatExtension","gpgpu_util.createVertexBuffer","indexBuffer","gpgpu_util.createIndexBuffer","webgl_util.createFramebuffer","gpgpu_util.getTextureConfig","GPGPUContext","disposed","outputTexture","finish","deleteFramebuffer","deleteBuffer","autoDebugValidate","webgl_util.enableDebugWebGLErrorChecking","gpgpu_util.createFloat32MatrixTexture","gpgpu_util.createFloat16MatrixTexture","gpgpu_util.createUnsignedBytesMatrixTexture","gpgpu_util.uploadPixelDataToTexture","gpgpu_util.createPackedMatrixTexture","webgl_util.unbindColorTextureFromFramebuffer","deleteTexture","webgl_util.getNumChannels","gpgpu_util.uploadMatrixToTexture","gpgpu_util.uploadMatrixToPackedTexture","downloadMatrixDriver","gpgpu_util.downloadFloat32MatrixFromOutputTexture","gpgpu_util.downloadByteEncodedFloatMatrixFromOutputTexture","gpgpu_util.downloadFloat32MatrixFromBuffer","bindTextureToFrameBuffer","gpgpu_util.maybeCreateBufferFromOutputTexture","unbindTextureToFrameBuffer","fenceContext","createFence","pollFence","isFencePassed","sync_1","SYNC_GPU_COMMANDS_COMPLETE","flush","clientWaitSync","ALREADY_SIGNALED","CONDITION_SATISFIED","beginQuery","endQuery","isQueryAvailable","gpgpu_util.downloadMatrixFromPackedOutputTexture","webgl_util.createFragmentShader","gpgpu_util.createVertexShader","webgl_util.createProgram","attachShader","webgl_util.linkProgram","webgl_util.validateProgram","vertexAttrsAreBound","setProgram","gpgpu_util.bindVertexProgramAttributeStreams","deleteProgram","useProgram","shouldThrow","webgl_util.getProgramUniformLocationOrThrow","webgl_util.getProgramUniformLocation","inputMatrixTexture","uniformLocation","throwIfNoProgram","webgl_util.bindTextureToProgramUniformSampler","outputMatrixTexture","setOutputMatrixTextureDriver","outputPackedMatrixTexture","startRow","numRows","startColumn","numColumns","setOutputMatrixWriteRegionDriver","webgl_util.validateFramebuffer","debugValidate","drawElements","TRIANGLES","UNSIGNED_SHORT","disjointQueryTimerExtension","getQueryTimerExtension","ext_1","getQueryTimerExtensionWebGL2","query_1","createQuery","TIME_ELAPSED_EXT","ext","getQueryTimerExtensionWebGL1","createQueryEXT","beginQueryEXT","endQueryEXT","ext_2","util.repeatedTry","getQueryTime","getQueryParameter","QUERY_RESULT","getQueryObjectEXT","QUERY_RESULT_EXT","available","QUERY_RESULT_AVAILABLE","disjoint","GPU_DISJOINT_EXT","QUERY_RESULT_AVAILABLE_EXT","addItemToPoll","best","mid","isDone","binSearchLastTrue","itemsToPoll","isDoneFn","resolveFn","pollItems","webgl_util.bindColorTextureToFramebuffer","downloadAndDecode","outputMatrixTextureMaybePacked","shapeInfos","texShapeA","texShapeB","texData","powOperator","rad","maxD","basis","depthRadius","lastIndex","outerShapeA","outerShapeB","sharedDim","aSnippetFromOffset","vec4Offset","indexVar","bSnippetFromOffset","sharedDimNearestVec4","sharedDimVec4Remainder","numOutcomes","numSamples","MultinomialProgram","seed","seedLoc","numIndices","onValue","offValue","p","unpackedCoords","poolType","computePositions","isAvgPool","initializationValue","filterWidthNearestVec4","filterWidthVec4Remainder","updateSnippet","reduceType","compareOp","windowSizeNearestVec4","windowSizeVec4Remainder","vecType","checkOutOfBounds","xHeight","xWidth","_b","yHeight","yWidth","effectiveXSize","effectiveYSize","heightScale","widthScale","invHeightScale","invWidthScale","winHeight","winWidth","newHeight","newWidth","oldHeight","oldWidth","effectiveInSize","effectiveOutSize","roundBase","inCoords","_","getInCoord","segOpInfo","segOpType","checkValueOutOfBounds","checkSegmentIdOutOfBounds","cRank","cCoords","abCoords","cCoordVars","abCoordVars","destSize","SliceProgram","uniform2i","uniform3i","uniform4i","newCoords","TextureManager","shapeRC","usage","newTexture","physicalTexType","getPhysicalFromLogicalTextureType","shapeKey","getKeyFromTextureShape","freeTextures","usedTextures","numFreeTextures","numUsedTextures","newTexture_1","shift","FLOAT32","createFloat32MatrixTexture","FLOAT16","createFloat16MatrixTexture","createUnsignedBytesMatrixTexture","logicalTexType","texList","texIndex","splice","logEnabled","total","tex","deleteMatrixTexture","DOWNLOAD","PIXELS","UPLOAD","RENDER","shapeRowsCol","newDim","switched","originalOrder","switchedCoords","getSwitchedCoords","SELU_SCALEALPHA","SELU_SCALE","opSnippet","UnaryOpProgram","CHECK_NAN_SNIPPET","RELU","SELU","selu_util.SELU_SCALEALPHA","selu_util.SELU_SCALE","SIN","COS","ATAN","ACOSH","ATANH","aRank","bRank","concat_util.assertParams","a2D","as2D","b2D","aBegin","aSize","bBegin","bSize","runKernel","concat_","tensors","$tensors","convertToTensorArray","parseAxisParam","concat2Tensors","concat1d","concat1d_","concat2d","concat2d_","concat3d","concat3d_","concat4d","concat4d_","global","module","define","copy","s0","s1","s2","impl","opts","xg","me","mash","charCodeAt","next","state","prng","double","quick","exports","amd","alea","z","strseed","xor128","xorwow","Date","X","init","xorshift7","limit","xor4096","tychei","pool","math","nodecrypto","chunks","rngname","startdenom","significance","overflow","mask","seedrandom","options","callback","shortseed","mixkey","prop","typ","entropy","tostring","out","randomBytes","crypto","msCrypto","getRandomValues","browser","plugins","screen","autoseed","arc4","keylen","S","pass","is_math_call","smear","stringseed","fromCharCode","require","sr","stdDeviation","truncated","stdDev","nextVal","upper","lower","seedValue","seedrandom.alea","MPRandGauss","resultX","resultY","isValid","v1","v2","isValidTruncated","convertValue","img","$img","minTensor","maxTensor","multiplier","bytes","Uint8ClampedArray","ctx","imageData","ImageData","putImageData","cast_","clone_","cumsum_","permutation","getAxesPermutation","permutedX","permutedAxis","getInnerMostAxes","expandDims_","eye","eye_","batchShape","buff","toTensor","fromPixels_","multinomial","multinomial_","normalized","origRank","logits2D","oneHot","oneHot_","$indices","pad_","pad1d","pad1d_","pad2d","pad2d_","pad3d","pad3d_","pad4d","pad4d_","rand","rand_","randFunction","randomNormal","randomNormal_","randGauss","nextValue","randomUniform","randomUniform_","minval","maxval","util.randUniform","reshape_","util.inferFromImplicitShape","split_","numOrSizeSplits","splitSizes","reduce","squeeze_","stack_","util.assertShapesMatch","expandedTensors","tile_","xGrad","truncatedNormal","truncatedNormal_","unstack_","outIndex","batchToSpaceND_","spaceToBatchND_","condShape","condVals","inBuffer","indexToLoc","BEFORE_PAGING_CONSTANT","delayedStorage","WeakSet","gpgpuCreatedLocally","NUM_BYTES_BEFORE_PAGING","devicePixelRatio","textureManager","MathBackendWebGL","HTMLVideoElement","HTMLImageElement","HTMLCanvasElement","fromPixelsCanvas","readyState","drawImage","tempPixelArray","uploadPixelDataToTexture","getTexture","FromPixelsProgram","compileAndRun","throwIfNoData","releaseTexture","uploadToGPU","cacheOnCPU","shouldTimeProgram","activeTimers","float32Values","getValuesFromTexture","downloadWaitMs","pendingRead","subscribers_1","maybeCreateBufferFromTexture","createAndWaitForFence","WebGLTexture","downloadFloat32MatrixFromBuffer","subscribers","pendingDisposal","downloadFloat32MatrixFromOutputTexture","tmpTarget","tmpInput","EncodeFloatProgram","tmpData","downloadByteEncodedFloatMatrixFromOutputTexture","oldActiveTimers","newActiveTimers","outerMostTime","programTimersStack","flattenedActiveTimers","util.flatten","results","uploadWaitMs","unreliable","numBytesInGPU","startMs","endMs","waitForQueryAndGetTime","timerQuery","customSetup","getCustomSetupFunc","beginIndex","StridedSliceProgram","ReverseProgram","ConcatProgram","MatMulProgram","makeOutputArray","BatchNormProgram","LRNProgram","inputImage","outputImage","LRNGradProgram","TileProgram","PadProgram","TransposeProgram","GatherProgram","array_ops_util.getReshaped","array_ops_util.getPermuted","array_ops_util.getReshapedPermuted","array_ops_util.getSliceBeginCoords","array_ops_util.getSliceSize","completePaddings","paddedX","reshapedPaddedShape","permutedReshapedPaddedPermutation","flattenShape","reduce_util.computeOptimalWindowSize","ReduceProgram","cols","bestIndicesA","ArgMinMaxProgram","argReduce","axis_util.assertAxesAreInnerMostDims","outputDType","sumOutType","axis_util.getAxesPermutation","axis_util.getInnerMostAxes","segment_util.computeOutShape","segOpCompute","axis_util.getUndoAxesPermutation","done","segment_util.segOpComputeOptimalWindowSize","SegmentOpProgram","range","CumSumProgram","SelectProgram","whereImpl","topkImpl","unary_op.RELU","unary_op.SELU","ClipProgram","unary_op.SIN","unary_op.COS","unary_op.ATAN","unary_op.ACOSH","unary_op.ATANH","unary_op.STEP","Conv2DProgram","Conv2DDerInputProgram","Conv2DDerFilterProgram","DepthwiseConv2DProgram","DepthwiseConv2DDerInputProgram","DepthwiseConv2DDerFilterProgram","Pool2DProgram","maxPoolPositionsProgram","maxPoolPositions","maxPoolBackPropProgram","MaxPool2DBackpropProgram","avgPoolBackpropProgram","AvgPool2DBackpropProgram","backend_util.castTensor","backend_util.reshapeTensor","ResizeBilinearProgram","ResizeBilinearBackpropProgram","ResizeNearestNeighborProgram","ResizeNearestNeigborBackpropProgram","probs","OneHotProgram","nonMaxSuppressionImpl","pageToCpu","inputsData","outputData","keyInputs","keyUserCode","keyBroadcast","gpgpu_math.makeShaderKey","binary","getAndSaveBinary","inputInfos","inShapeInfos","source","shader_compiler.makeShader","uniformLocations","gpgpu_math.compileProgram","startTimer","validateBinaryAndProgram","outTex","setOutputMatrixTexture","variableName","variableUniformLocation","uniform1fv","setInputMatrixTexture","executeProgram","gpgpu_math.runProgram","numBytesToPage","lruDataGPU","computeBytes","endTimer","getBinary","binaryCache","remove","webgl_util.getTextureShapeFromLogicalShape","acquireTexture","uploadMatrixToTexture","dontKeepCopyOnGPU","float32ToTypedArray","texType","registerBackend","abs_","acos_","acosh_","asin_","asinh_","atan_","atanh_","ceil_","clipByValue_","clipValueMin","clipValueMax","clip","cos_","cosh_","erf_","PI","exp_","save","expm1_","floor_","log_","log1p_","logSigmoid_","neg_","reciprocal_","round_","rsqrt_","sigmoid_","sign_","sin_","sinh_","softplus_","sqrt_","square_","step_","tan_","tanh_","as4D","batchNormalization2d","batchNormalization2d_","$scale","$offset","$mean","$variance","batchNormalization3d","batchNormalization3d_","batchNormalization4d","batchNormalization4d_","batchNormalization_","x4D","batchnormReshape4D","scaleValue","reductionAxes","getReductionAxes","tileShape","xMinusMean","dyTimesScaleValue","oneOverSqrtVariance","minusHalfRCube","meanDer","varianceDer","xMinusMean2TimesRsqrt","scaleDer","offsetDer","roundingMode","computeConv2DInfo","depthwise","filterChannels","_c","_d","padType","bottom","right","fieldSize","outDepth","zeroPad","effectiveFieldSize","getEffectiveFilterSize","computeDefaultPad","inputRows","inputCols","outputRows","conditionalRound","outputCols","computeOutputShape3D","padAlongHeight","padAlongWidth","top_1","param","xShape4D","dy4D","reshapedTo4D","inDepth","conv_util.computeConv2DInfo","conv2dDerInput","as3D","dimA","dimB","tupleValuesAreOne","conv1d_","$filter","x3D","reshapedTo3D","eitherStridesOrDilationsAreOne","filter4D","input4D","conv2d_","conv2dDerInput_","conv2dDerFilter","conv2dDerFilter_","depthwiseConv2d_","depthwiseConv2D","depthwiseConv2DDerInput","depthwiseConv2dDerInput","depthwiseConv2DDerFilter","depthwiseConv2dDerFilter","separableConv2d","separableConv2d_","depthwiseFilter","pointwiseFilter","$depthwiseFilter","$pointwiseFilter","channelMultiplier","conv2dTranspose_","matMul_","$a","$b","innerShapeA","innerShapeB","dot_","t1","t2","$t1","$t2","t1Inner","t2Inner","asScalar","outerProduct","outerProduct_","$v1","$v2","reverse_","reshapeAs","reverse1d","reverse1d_","reverse2d","reverse2d_","reverse3d","reverse3d_","reverse4d","reverse4d_","maxPool_","conv_util.computePool2DInfo","y4D","$dy","$input","$output","maxPoolBackprop","avgPool_","avgPoolBackprop","slice_","begin_","size_","slice_util.assertParamsValid","slice1d","slice1d_","slice2d","slice2d_","slice3d","slice3d_","slice4d","slice4d_","all_","origAxes","axis_util.parseAxisParam","permutedAxes","axis_util.expandShapeToKeepDim","any_","argMax_","argMin_","logSumExp_","xMax","max_","mean_","reduceSize","axis_util.computeOutAndReduceShapes","reduceSizeScalar","expandedDyShape","min_","moments","moments_","keepDimsShape","sum_","toInt","equal_","assertTypesMatch","assertAndGetBroadcastShape","equalStrict_","greater_","greaterEqual_","greaterEqualStrict_","greaterStrict_","less_","lessEqual_","lessEqualStrict_","lessStrict_","notEqual_","notEqualStrict_","add_","reduceAxes","broadcast_util.getReductionAxes","addN","addN_","firstTensor","ders","addStrict_","atan2","atan2_","div_","realDivide","tmp","divStrict_","floorDiv_","maximum_","maximumStrict_","minimum_","minimumStrict_","mod_","modStrict_","mul_","multiply","mulStrict_","pow_","base","$base","$exp","powStrict_","squaredDifference_","two","squaredDifferenceStrict_","sub_","subtract","subStrict_","logicalAnd_","logicalNot_","logicalOr_","logicalXor_","where_","$condition","select","whereAsync","elu_","eluDer","leakyRelu_","prelu_","$alpha","zero","relu_","stepRes","selu_","scaleAlpha","greaterThanZeroDer","lessEqualZeroDer","transpose_","undoPerm","localResponseNormalization_","localResponseNormalization4D","LRNGrad","norm_","normImpl","arrays","gather_","paramsShape","indicesSize","outerShape","outerDims","innerShape","innerDims","outerAxesIndices","arrayRange","innerAxesIndices","valuesShape","arrayConcat","reshapedIndices","transposeDims","valuesTranspose","paramsGrad","invertTransposeDims","getUndoAxesPermutation","unsortedSegmentSum_","$segmentIds","isInt","zeroClippedIndices","gathered","isPositive","numIters","zeroSlice","gatherDropNegatives","basicLSTMCell","basicLSTMCell_","forgetBias","lstmKernel","lstmBias","$forgetBias","$lstmKernel","$lstmBias","$data","$c","$h","sliceCols","o","newC","multiRNNCell","multiRNNCell_","lstmCells","newStates","newH","movingAverage","movingAverage_","decay","zeroDebias","$v","$decay","one","oneMinusDecay","update","$step","stridedSlice","stridedSlice_","Reduction","topk","topk_","absoluteDifference","absoluteDifference_","labels","predictions","weights","reduction","SUM_BY_NONZERO_WEIGHTS","$labels","$predictions","$weights","losses","computeWeightedLoss","computeWeightedLoss_","$losses","weightedLoss","NONE","SUM","MEAN","broadcastFactor","numNonZeros","cosineDistance","cosineDistance_","hingeLoss","hingeLoss_","huberLoss","huberLoss_","delta","deltaScalar","quadratic","linear","logLoss","logLoss_","epsilon","epsilonScalar","meanSquaredError","meanSquaredError_","sigmoidCrossEntropy","sigmoidCrossEntropy_","multiClassLabels","labelSmoothing","$multiClassLabels","labelSmoothingScalar","half","maxOutput","outputXTarget","sigmoidOutput","sigmoidCrossEntropyWithLogits_","softmaxCrossEntropy","softmaxCrossEntropy_","onehotLabels","$onehotLabels","numClasses","logResult","dyShape","expandShapeToKeepDim","softmaxCrossEntropyWithLogits_","fullMatrices","m","q","one2D","tensor2d","iters","rTemp","wTemp","qTemp","gramSchmidt","gramSchmidt_","inputIsTensor2D","ys","xs1d","proj","qr","qr_","qr2d","outerDimsProd","prev","q2ds_1","r2ds_1","x2d","q2d","r2d","NEGATIVE_INFINITY","numBoxes","resizeBilinear_","images","$images","batchImages","resizeBilinearBackprop","resizeNearestNeighbor_","resizeNearestNeighborBackprop","nonMaxSuppression","nonMaxSuppression_","$boxes","$scores","nonMaxSuppSanityCheck","nonMaxSuppressionAsync","boxesVals","scoresVals","MathBackendCPU","firstUse","getImageData","numPixels","channel","tensor3d","ops.buffer","xLoc","ops.tensor","newLoc","xBuffer","outLoc","inLoc","aVals","bVals","ops.scalar","broadcastedBinaryOp","aValue","bValue","resultVals","currVals","leftDim","rightDim","aValues","bValues","aOuterStep","aInnerStep","bOuterStep","bInnerStep","aOuterEnd","bOuterEnd","resultIndex","aOuter","bOuter","aInner","bInner","ops.tensor2d","reduceShape","ops.zeros","segmentId","ops.equal","ops.stack","minIndex","maxIndex","resultDtype","indexAdjuster","prevIdx","aVal","bVal","newValues","rem","anyVal","resVals","inVals","resultValues","dyValues","threshold","tooLarge","tooSmall","expX","util.tanh","d2","yR","xRCorner","yC","xCCorner","dotProd","wR","xR","wC","xC","d1","dxValues","dxS0","dxS1","dxS2","dyS0","dyS1","dyS2","fltValues","fltS0","fltS1","fltS2","topPad","leftPad","xRMin","yRMax","xCMin","yCMax","dyOffset","fltOffset","dW","yRMin","yCMin","chMul","dm","trunc","xBuf","originalLoc","i_1","originalIndex","coords","outCoords","i_2","newIndex","indicesValues","xRMax","xCMax","minMaxValue","POSITIVE_INFINITY","avgValue","pixel","maxPositions","maxValue","maxPosition","dxR","dxC","dyRCorner","dyCCorner","dyR","dyC","effectiveInputSize","effectiveOutputSize","sourceFracRow","sourceFracCol","sourceRowFloor","sourceRowCeil","sourceColFloor","sourceColCeil","topLeft","bottomLeft","colFrac","topDxRIndex","bottomDxRIndex","dxRLerp","inverseDxRLerp","leftDxCIndex","rightDxCIndex","dxCLerp","inverseDxCLerp","dyVal","topRight","bottomRight","sourceNearestRow","sourceNearestCol","startRLerp","startDyR","startCLerp","startDyC","accum","dyROffset","dyCOffSet","xValues","meanValues","varianceValues","scaleValues","offsetValues","outValues","tensor4d","sumAcrossChannels","depthBegin","depthEnd","dyi","probabilities","ops.softmax","numEvents","probVals","cdf","event_1","sampleId","event_2","event_3","aBroadcastDims","bBroadcastDims","aBuf","bBuf","aLoc","aIndex","bLoc","bIndex","delayCallback","requestAnimationFrame","setImmediate","DTYPE_VALUE_SIZE_MAP","uint16","uint8","useNodeBuffer","Buffer","Blob","atob","btoa","str","byteLength","buffers","totalByteLength","path","trim","items","modelArtifacts","modelTopology","ArrayBuffer","dateSaved","modelTopologyType","modelTopologyBytes","stringByteLength","weightSpecsBytes","weightSpecs","weightDataBytes","weightData","saveRouters","loadRouters","IORouterRegistry","saveRouter","getInstance","loadRouter","url","getHandlers","handlerType","validHandlers","router","handler","URL_SCHEME_SUFFIX","managers","ModelStoreManagerRegistry","scheme","manager","getSchemes","sourceURL","destURL","deleteSource","loadHandlers","getLoadHandlers","loadHandler","saveHandlers","getSaveHandlers","saveHandler","sourceScheme","parseURL","sourcePath","sameMedium","load","getManager","removeModel","saveResult","modelArtifactsInfo","MODEL_STORE_NAME","INFO_STORE_NAME","theWindow","indexedDB","mozIndexedDB","webkitIndexedDB","msIndexedDB","shimIndexedDB","openRequest","db","createObjectStore","keyPath","modelPath","getIndexedDBFactory","BrowserIndexedDB","databaseAction","open","onupgradeneeded","setUpDatabase","onsuccess","modelTx","transaction","getRequest_1","objectStore","close","onerror","oncomplete","modelTx_1","modelArtifactsInfo_1","getModelArtifactsInfoForJSON","infoTx_1","infoStore_1","putInfoRequest_1","put","putModelRequest","deleteInfoRequest","indexedDBRouter","startsWith","URL_SCHEME","registerSaveRouter","registerLoadRouter","BrowserIndexedDBManager","tx","getAllInfoRequest","getAll","item","infoTx","infoStore","getInfoRequest","deleteModelData_1","deleteModelRequest","registerManager","PATH_SEPARATOR","PATH_PREFIX","INFO_SUFFIX","MODEL_TOPOLOGY_SUFFIX","WEIGHT_SPECS_SUFFIX","WEIGHT_DATA_SUFFIX","topology","localStorage","LS","getModelKeys","BrowserLocalStorage","setItem","removeItem","getItem","weightDataBase64","buf","byteOffset","base64StringToArrayBuffer","localStorageRouter","BrowserLocalStorageManager","prefix","suffix","getModelPathFromKey","DEFAULT_FILE_NAME_PREFIX","DEFAULT_JSON_EXTENSION_NAME","DEFAULT_WEIGHT_DATA_EXTENSION_NAME","fileNamePrefix","BrowserDownloads","modelTopologyFileName","weightDataFileName","weightsURL","URL","createObjectURL","weightsManifest","paths","modelTopologyAndWeightManifest","modelTopologyAndWeightManifestURL","jsonAnchor","download","href","click","weightDataAnchor","files","BrowserFiles","jsonFile","weightFiles","jsonReader","FileReader","onload","event","modelJSON","target","pathToFile","checkManifestAndWeightFiles","perFileBuffers","weightsGroup","weightFileReader","concatenateArrayBuffers","readAsArrayBuffer","readAsText","manifest","basenames","fileNames","file","basename","manifest_1","pathBasename","fetchURLs","requestOptions","requests","fetchURL","fetch","responses","response","arrayBuffer","requestInit","body","BrowserHTTPRequest","method","DEFAULT_METHOD","FormData","append","json","modelConfig","weightsManifest_2","weightsManifest_1","pathPrefix_1","lastIndexOf","fetchURLs_1","loadWeightsAsArrayBuffer","httpRequestRouter","URL_SCHEMES","browserHTTPRequest","PassthroughLoader","PassthroughSaver","specs","specs_1","spec","name_2","quantization","name_1","dataPromises","normalizedXs","concatenateTypedArrays","filePathPrefix","weightNames","groupIndicesToFetchMap","groupWeightsToFetch","weightsFound","allManifestWeightNames","manifestGroupConfig","groupIndex","groupOffset","weightsEntry","rawDtype","weightsBytes","enqueueWeightsForFetchingFn","manifestEntry","sizeBytes","weightName","weightIndex","found","weightsNotFound","weight","groupIndicesToFetch","accumulator","shouldFetch","fetchUrls","filepath","fetchUrl","weightsTensorMap","bufferIndexOffset","numBuffers","groupBytes","groupBuffer","groupByteBuffer","groupBufferOffset","typedArray","byteBuffer","quantization_1","quantizedArray","cloneModelInternal","schemes","schemes_1","listModels","schemeOut","schemeAndPath","Serializable","className","cls","config","classNameMap","SerializationMap","getMap","fromConfig","actual","expected","aType","bType","actualValues","expectedValues","areClose","HAS_WEBGL","IS_NODE","IS_CHROME","IS_BROWSER","fail","expectArraysClose","low","high","actualVals","expect","toEqual","Optimizer","returnCost","applyGradients","variableGrads","DEFAULT_FLOAT32_EPSILON","DEFAULT_FLOAT16_EPSILON","learningRate","rho","rhoScalar","oneMinusRho","optimizer_utils.getOptimizerDefaultEpsilonValue","AdadeltaOptimizer","variableGradients","this_1","accumulatedGrads","accumulatedUpdates","accumulatedGrad","accumulatedUpdate","newAccumulatedGrad","updates","newAccumulatedUpdate","initialAccumulatorValue","AdagradOptimizer","beta1","beta2","beta1Scalar","beta2Scalar","accBeta1","accBeta2","oneMinusBeta1","oneMinusBeta2","epsScalar","AdamOptimizer","oneMinusAccBeta1","oneMinusAccBeta2","accumulatedFirstMoment","accumulatedSecondMoment","firstMoment","secondMoment","newFirstMoment","newSecondMoment","biasCorrectedFirstMoment","biasCorrectedSecondMoment","decayScalar","iteration","AdamaxOptimizer","lr","accumulatedWeightedInfNorm","weightedInfNorm","ut0","ut1","newWeightedInfNorm","setLearningRate","SGDOptimizer","momentum","useNesterov","accumulations","MomentumOptimizer","accumulation","newAccumulation","centered","momentumScalar","RMSPropOptimizer","accumulatedMeanSquares","accumulatedMeanGrads","accumulatedMoments","accumulatedMeanSquare","accumulatedMeanGrad","newAccumulatedMeanSquare","newAccumulatedMeanGrad","newAccumulatedMoments","newAccumulatedMeanSquare_1","OptimizerConstructors","train","sgd","adadelta","adagrad","rmsprop","adamax","adam","setBackend","getBackend","ops","checkGrads","grad","gradients"],"mappings":";;;;;;;;;;;;;;;;86DAqBwBA,GAMtB,IAJA,IAAIC,EAAUD,EAAME,OAChBC,EAAO,EACPC,EAAQ,EAELH,EAAU,GAEfG,EAASC,KAAKC,SAAWL,EAAW,EAIpCE,EAAOH,IAFPC,GAGAD,EAAMC,GAAWD,EAAMI,GACvBJ,EAAMI,GAASD,aAKGI,EAAaC,EAAWC,GAC5C,OAAOJ,KAAKI,IAAIF,E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AAc3N,EAC5B,wDACG4V,GAAII,OAAO/F,KAAK,WACf,IAAA6B,gEAACnS,UAAO+R,UAQd,OAPU,MAAN/D,GACFqjC,EACIrxC,EAAM/H,MAAO+V,EAAG/V,MAChB,iGAGNwiF,GAAW1oE,GACJA,qBA6Bb,SAA0DnX,GAOxD,OAFAiF,EACImS,EAAgBpX,GAAI,sDACjB,SAACjE,EAAMqX,GACZnO,EACIlJ,aAAa0J,EACb,uDACJR,EACU,MAANmO,GAAcA,aAAc3N,EAC5B,4DACE,IAAA8R,qDAACJ,UAAO/R,UAEd,OADAy6E,GAAW1oE,IACH2oE,KAAM3oE,EAAM,GAAS/R,MAAOA,qBAkCxC,SAAyCpF,GAQvC,OAHAiF,EACImS,EAAgBpX,GAChB,uDACG,SAACmiB,EAAgB/O,GACtBnO,EACIpI,MAAMC,QAAQqlB,IAASA,EAAK9K,MAAM,SAAAwK,GAAO,OAAAA,aAAepc,IACxD,sEACJR,EACU,MAANmO,GAAcA,aAAc3N,EAC5B,gEACJ,IAAM6M,EAAM+I,GAAII,OAAOskE,UAAU,WAAM,OAAA//E,eAAKmiB,IAAOA,EAAM/O,GAQzD,OAPU,MAANA,GACFqjC,EACInkC,EAAIlN,MAAM/H,MAAO+V,EAAG/V,MACpB,yGAGNwiF,GAAWvtE,EAAI6E,OACR7E"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tracking_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/tracking_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tracking_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/tracking_test.js b/node_modules/@tensorflow/tfjs-core/dist/tracking_test.js new file mode 100644 index 0000000..dc4a31c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tracking_test.js @@ -0,0 +1,300 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var jasmine_util_1 = require("./jasmine_util"); +var test_util_1 = require("./test_util"); +jasmine_util_1.describeWithFlags('time webgl', test_util_1.WEBGL_ENVS, function () { + it('upload + compute', function () { return __awaiter(_this, void 0, void 0, function () { + var a, time; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + a = tf.zeros([10, 10]); + return [4, tf.time(function () { return a.square(); })]; + case 1: + time = _a.sent(); + expect(time.uploadWaitMs > 0); + expect(time.downloadWaitMs === 0); + expect(time.kernelMs > 0); + expect(time.wallMs >= time.kernelMs); + return [2]; + } + }); + }); }); + it('upload + compute + dataSync', function () { return __awaiter(_this, void 0, void 0, function () { + var a, time; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + a = tf.zeros([10, 10]); + return [4, tf.time(function () { return a.square().dataSync(); })]; + case 1: + time = _a.sent(); + expect(time.uploadWaitMs > 0); + expect(time.downloadWaitMs > 0); + expect(time.kernelMs > 0); + expect(time.wallMs >= time.kernelMs); + return [2]; + } + }); + }); }); + it('upload + compute + data', function () { return __awaiter(_this, void 0, void 0, function () { + var a, time; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + a = tf.zeros([10, 10]); + return [4, tf.time(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4, a.square().data()]; + case 1: return [2, _a.sent()]; + } + }); }); })]; + case 1: + time = _a.sent(); + expect(time.uploadWaitMs > 0); + expect(time.downloadWaitMs > 0); + expect(time.kernelMs > 0); + expect(time.wallMs >= time.kernelMs); + return [2]; + } + }); + }); }); + it('preupload (not included) + compute + data', function () { return __awaiter(_this, void 0, void 0, function () { + var a, time; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + a = tf.zeros([10, 10]); + a.square(); + return [4, tf.time(function () { return a.sqrt(); })]; + case 1: + time = _a.sent(); + expect(time.uploadWaitMs === 0); + expect(time.downloadWaitMs === 0); + expect(time.kernelMs > 0); + expect(time.wallMs >= time.kernelMs); + return [2]; + } + }); + }); }); +}); +jasmine_util_1.describeWithFlags('time cpu', test_util_1.NODE_ENVS, function () { + it('simple upload', function () { return __awaiter(_this, void 0, void 0, function () { + var a, time; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + a = tf.zeros([10, 10]); + return [4, tf.time(function () { return a.square(); })]; + case 1: + time = _a.sent(); + expect(time.kernelMs > 0); + expect(time.wallMs >= time.kernelMs); + return [2]; + } + }); + }); }); +}); +jasmine_util_1.describeWithFlags('tidy', test_util_1.ALL_ENVS, function () { + it('returns Tensor', function () { + tf.tidy(function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([0, 0, 0]); + expect(tf.memory().numTensors).toBe(2); + tf.tidy(function () { + var result = tf.tidy(function () { + b = tf.addStrict(a, b); + b = tf.addStrict(a, b); + b = tf.addStrict(a, b); + return tf.add(a, b); + }); + expect(tf.memory().numTensors).toBe(2 + 1); + test_util_1.expectArraysClose(result, [4, 8, 12]); + }); + expect(tf.memory().numTensors).toBe(2); + }); + expect(tf.memory().numTensors).toBe(0); + }); + it('multiple disposes does not affect num arrays', function () { + expect(tf.memory().numTensors).toBe(0); + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([1, 2, 3]); + expect(tf.memory().numTensors).toBe(2); + a.dispose(); + a.dispose(); + expect(tf.memory().numTensors).toBe(1); + b.dispose(); + expect(tf.memory().numTensors).toBe(0); + }); + it('allows primitive types', function () { + var a = tf.tidy(function () { return 5; }); + expect(a).toBe(5); + var b = tf.tidy(function () { return 'hello'; }); + expect(b).toBe('hello'); + }); + it('allows complex types', function () { + var res = tf.tidy(function () { + return { a: tf.scalar(1), b: 'hello', c: [tf.scalar(2), 'world'] }; + }); + test_util_1.expectArraysClose(res.a, [1]); + test_util_1.expectArraysClose(res.c[0], [2]); + }); + it('returns Tensor[]', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([0, -1, 1]); + expect(tf.memory().numTensors).toBe(2); + tf.tidy(function () { + var result = tf.tidy(function () { + tf.add(a, b); + return [tf.add(a, b), tf.sub(a, b)]; + }); + expect(tf.memory().numTensors).toBe(4); + test_util_1.expectArraysClose(result[0], [1, 1, 4]); + test_util_1.expectArraysClose(result[1], [1, 3, 2]); + expect(tf.memory().numTensors).toBe(4); + }); + expect(tf.memory().numTensors).toBe(2); + a.dispose(); + b.dispose(); + expect(tf.memory().numTensors).toBe(0); + }); + it('basic usage without return', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([0, 0, 0]); + expect(tf.memory().numTensors).toBe(2); + tf.tidy(function () { + b = tf.addStrict(a, b); + b = tf.addStrict(a, b); + b = tf.addStrict(a, b); + tf.add(a, b); + }); + expect(tf.memory().numTensors).toBe(2); + }); + it('nested usage', function () { + var a = tf.tensor1d([1, 2, 3]); + var b = tf.tensor1d([0, 0, 0]); + expect(tf.memory().numTensors).toBe(2); + tf.tidy(function () { + var result = tf.tidy(function () { + b = tf.addStrict(a, b); + b = tf.tidy(function () { + b = tf.tidy(function () { + return tf.addStrict(a, b); + }); + expect(tf.memory().numTensors).toBe(4); + tf.tidy(function () { + tf.addStrict(a, b); + }); + expect(tf.memory().numTensors).toBe(4); + return tf.addStrict(a, b); + }); + expect(tf.memory().numTensors).toBe(4); + return tf.addStrict(a, b); + }); + expect(tf.memory().numTensors).toBe(3); + test_util_1.expectArraysClose(result, [4, 8, 12]); + }); + expect(tf.memory().numTensors).toBe(2); + }); + it('nested usage returns tensor created from outside scope', function () { + var x = tf.scalar(1); + tf.tidy(function () { + tf.tidy(function () { + return x; + }); + }); + expect(x.isDisposed).toBe(false); + }); + it('nested usage with keep works', function () { + var b; + tf.tidy(function () { + var a = tf.scalar(1); + tf.tidy(function () { + b = tf.keep(a); + }); + }); + expect(b.isDisposed).toBe(false); + b.dispose(); + }); + it('single argument', function () { + var hasRan = false; + tf.tidy(function () { + hasRan = true; + }); + expect(hasRan).toBe(true); + }); + it('single argument, but not a function throws error', function () { + expect(function () { + tf.tidy('asdf'); + }).toThrowError(); + }); + it('2 arguments, first is string', function () { + var hasRan = false; + tf.tidy('name', function () { + hasRan = true; + }); + expect(hasRan).toBe(true); + }); + it('2 arguments, but first is not string throws error', function () { + expect(function () { + tf.tidy(4, function () { }); + }).toThrowError(); + }); + it('2 arguments, but second is not a function throws error', function () { + expect(function () { + tf.tidy('name', 'another name'); + }).toThrowError(); + }); + it('works with arbitrary depth of result', function () { + tf.tidy(function () { + var res = tf.tidy(function () { + return [tf.scalar(1), [[tf.scalar(2)]], { list: [tf.scalar(3)] }]; + }); + test_util_1.expectArraysEqual(res[0], [1]); + test_util_1.expectArraysEqual(res[1][0][0], [2]); + test_util_1.expectArraysEqual(res[2].list[0], [3]); + expect(tf.memory().numTensors).toBe(3); + return res[0]; + }); + expect(tf.memory().numTensors).toBe(1); + }); +}); +//# sourceMappingURL=tracking_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/tracking_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/tracking_test.js.map new file mode 100644 index 0000000..47faf5a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/tracking_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tracking_test.js","sourceRoot":"","sources":["../src/tracking_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBA0QA;;AA1QA,4BAA8B;AAC9B,+CAAiD;AACjD,yCAAkG;AAElG,gCAAiB,CAAC,YAAY,EAAE,sBAAU,EAAE;IAC1C,EAAE,CAAC,kBAAkB,EAAE;;;;;oBACf,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;oBAChB,WAAM,EAAE,CAAC,IAAI,CAAC,cAAM,OAAA,CAAC,CAAC,MAAM,EAAE,EAAV,CAAU,CAAC,EAAA;;oBAAtC,IAAI,GAAG,SAA2D;oBACxE,MAAM,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;oBAC9B,MAAM,CAAC,IAAI,CAAC,cAAc,K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,CAAC;YAClE,CAAC,CAAC,CAAC;YACH,6BAAiB,CAAC,GAAG,CAAC,CAAC,CAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAE5C,6BAAiB,CAAE,GAAG,CAAC,CAAC,CAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAE9C,6BAAiB,CAAE,GAAG,CAAC,CAAC,CAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAChD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACvC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/train.d.ts b/node_modules/@tensorflow/tfjs-core/dist/train.d.ts new file mode 100644 index 0000000..6410d67 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/train.d.ts @@ -0,0 +1,10 @@ +import { OptimizerConstructors } from './optimizers/optimizer_constructors'; +export declare const train: { + sgd: typeof OptimizerConstructors.sgd; + momentum: typeof OptimizerConstructors.momentum; + adadelta: typeof OptimizerConstructors.adadelta; + adagrad: typeof OptimizerConstructors.adagrad; + rmsprop: typeof OptimizerConstructors.rmsprop; + adamax: typeof OptimizerConstructors.adamax; + adam: typeof OptimizerConstructors.adam; +}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/train.js b/node_modules/@tensorflow/tfjs-core/dist/train.js new file mode 100644 index 0000000..4f2dd40 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/train.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var adadelta_optimizer_1 = require("./optimizers/adadelta_optimizer"); +var adagrad_optimizer_1 = require("./optimizers/adagrad_optimizer"); +var adam_optimizer_1 = require("./optimizers/adam_optimizer"); +var adamax_optimizer_1 = require("./optimizers/adamax_optimizer"); +var momentum_optimizer_1 = require("./optimizers/momentum_optimizer"); +var optimizer_constructors_1 = require("./optimizers/optimizer_constructors"); +var rmsprop_optimizer_1 = require("./optimizers/rmsprop_optimizer"); +var sgd_optimizer_1 = require("./optimizers/sgd_optimizer"); +[momentum_optimizer_1.MomentumOptimizer, sgd_optimizer_1.SGDOptimizer, adadelta_optimizer_1.AdadeltaOptimizer, adagrad_optimizer_1.AdagradOptimizer, + rmsprop_optimizer_1.RMSPropOptimizer, adamax_optimizer_1.AdamaxOptimizer, adam_optimizer_1.AdamOptimizer]; +exports.train = { + sgd: optimizer_constructors_1.OptimizerConstructors.sgd, + momentum: optimizer_constructors_1.OptimizerConstructors.momentum, + adadelta: optimizer_constructors_1.OptimizerConstructors.adadelta, + adagrad: optimizer_constructors_1.OptimizerConstructors.adagrad, + rmsprop: optimizer_constructors_1.OptimizerConstructors.rmsprop, + adamax: optimizer_constructors_1.OptimizerConstructors.adamax, + adam: optimizer_constructors_1.OptimizerConstructors.adam +}; +//# sourceMappingURL=train.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/train.js.map b/node_modules/@tensorflow/tfjs-core/dist/train.js.map new file mode 100644 index 0000000..94b2e3b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/train.js.map @@ -0,0 +1 @@ +{"version":3,"file":"train.js","sourceRoot":"","sources":["../src/train.ts"],"names":[],"mappings":";;AAkBA,sEAAkE;AAClE,oEAAgE;AAChE,8DAA0D;AAC1D,kEAA8D;AAC9D,sEAAkE;AAClE,8EAA0E;AAC1E,oEAAgE;AAChE,4DAAwD;AAGxD,CAAC,sCAAiB,EAAE,4BAAY,EAAE,sCAAiB,EAAE,oCAAgB;IACpE,oCAAgB,EAAE,kCAAe,EAAE,8BAAa,CAAC,CAAC;AAEtC,QAAA,KAAK,GAAG;IACnB,GAAG,EAAE,8CAAqB,CAAC,GAAG;IAC9B,QAAQ,EAAE,8CAAqB,CAAC,QAAQ;IACxC,QAAQ,EAAE,8CAAqB,CAAC,QAAQ;IACxC,OAAO,EAAE,8CAAqB,CAAC,OAAO;IACtC,OAAO,EAAE,8CAAqB,CAAC,OAAO;IACtC,MAAM,EAAE,8CAAqB,CAAC,MAAM;IACpC,IAAI,EAAE,8CAAqB,CAAC,IAAI;CACjC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/types.d.ts b/node_modules/@tensorflow/tfjs-core/dist/types.d.ts new file mode 100644 index 0000000..af3e336 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/types.d.ts @@ -0,0 +1,45 @@ +export declare enum DType { + float32 = "float32", + int32 = "int32", + bool = "bool" +} +export interface ShapeMap { + R0: number[]; + R1: [number]; + R2: [number, number]; + R3: [number, number, number]; + R4: [number, number, number, number]; + R5: [number, number, number, number, number]; + R6: [number, number, number, number, number, number]; +} +export interface DataTypeMap { + float32: Float32Array; + int32: Int32Array; + bool: Uint8Array; +} +export declare type DataType = keyof DataTypeMap; +export declare type TypedArray = DataTypeMap[DataType]; +export declare enum Rank { + R0 = "R0", + R1 = "R1", + R2 = "R2", + R3 = "R3", + R4 = "R4", + R5 = "R5", + R6 = "R6" +} +export declare type FlatVector = boolean[] | number[] | TypedArray; +export declare type RegularArray = T[] | T[][] | T[][][] | T[][][][] | T[][][][][] | T[][][][][][]; +export declare type ArrayData = DataTypeMap[D] | RegularArray | RegularArray; +export interface RecursiveArray { + [index: number]: T | RecursiveArray; +} +export declare function upcastType(typeA: DataType, typeB: DataType): DataType; +export declare function sumOutType(type: DataType): "float32" | "int32" | "bool"; +export declare type TensorLike = TypedArray | number | boolean | number[] | number[][] | number[][][] | number[][][][] | number[][][][][] | number[][][][][][] | boolean[] | boolean[][] | boolean[][][] | boolean[][][][] | boolean[][][][][] | boolean[][][][][][]; +export declare type TensorLike1D = TypedArray | number[] | boolean[]; +export declare type TensorLike2D = TypedArray | number[] | number[][] | boolean[] | boolean[][]; +export declare type TensorLike3D = TypedArray | number[] | number[][][] | boolean[] | boolean[][][]; +export declare type TensorLike4D = TypedArray | number[] | number[][][][] | boolean[] | boolean[][][][]; +export declare type TensorLike5D = TypedArray | number[] | number[][][][][] | boolean[] | boolean[][][][][]; +export declare type TensorLike6D = TypedArray | number[] | number[][][][][][] | boolean[] | boolean[][][][][][]; diff --git a/node_modules/@tensorflow/tfjs-core/dist/types.js b/node_modules/@tensorflow/tfjs-core/dist/types.js new file mode 100644 index 0000000..d0b869e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/types.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var DType; +(function (DType) { + DType["float32"] = "float32"; + DType["int32"] = "int32"; + DType["bool"] = "bool"; +})(DType = exports.DType || (exports.DType = {})); +var Rank; +(function (Rank) { + Rank["R0"] = "R0"; + Rank["R1"] = "R1"; + Rank["R2"] = "R2"; + Rank["R3"] = "R3"; + Rank["R4"] = "R4"; + Rank["R5"] = "R5"; + Rank["R6"] = "R6"; +})(Rank = exports.Rank || (exports.Rank = {})); +var UpcastInt32AndMap; +(function (UpcastInt32AndMap) { + UpcastInt32AndMap["float32"] = "float32"; + UpcastInt32AndMap["int32"] = "int32"; + UpcastInt32AndMap["bool"] = "int32"; +})(UpcastInt32AndMap || (UpcastInt32AndMap = {})); +var UpcastBoolAndMap; +(function (UpcastBoolAndMap) { + UpcastBoolAndMap["float32"] = "float32"; + UpcastBoolAndMap["int32"] = "int32"; + UpcastBoolAndMap["bool"] = "bool"; +})(UpcastBoolAndMap || (UpcastBoolAndMap = {})); +var UpcastFloat32AndMap; +(function (UpcastFloat32AndMap) { + UpcastFloat32AndMap["float32"] = "float32"; + UpcastFloat32AndMap["int32"] = "float32"; + UpcastFloat32AndMap["bool"] = "float32"; +})(UpcastFloat32AndMap || (UpcastFloat32AndMap = {})); +var upcastTypeMap = { + 'float32': UpcastFloat32AndMap, + 'int32': UpcastInt32AndMap, + 'bool': UpcastBoolAndMap +}; +function upcastType(typeA, typeB) { + return upcastTypeMap[typeA][typeB]; +} +exports.upcastType = upcastType; +function sumOutType(type) { + return upcastType(type, 'int32'); +} +exports.sumOutType = sumOutType; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/types.js.map b/node_modules/@tensorflow/tfjs-core/dist/types.js.map new file mode 100644 index 0000000..5c92718 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AAiBA,IAAY,KAIX;AAJD,WAAY,KAAK;IACf,4BAAmB,CAAA;IACnB,wBAAe,CAAA;IACf,sBAAa,CAAA;AACf,CAAC,EAJW,KAAK,GAAL,aAAK,KAAL,aAAK,QAIhB;AAuBD,IAAY,IAQX;AARD,WAAY,IAAI;IACd,iBAAS,CAAA;IACT,iBAAS,CAAA;IACT,iBAAS,CAAA;IACT,iBAAS,CAAA;IACT,iBAAS,CAAA;IACT,iBAAS,CAAA;IACT,iBAAS,CAAA;AACX,CAAC,EARW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAQf;AAaD,IAAK,iBAIJ;AAJD,WAAK,iBAAiB;IACpB,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;IACjB,mCAAgB,CAAA;AAClB,CAAC,EAJI,iBAAiB,KAAjB,iBAAiB,QAIrB;AAED,IAAK,gBAIJ;AAJD,WAAK,gBAAgB;IACnB,uCAAqB,CAAA;IACrB,mCAAiB,CAAA;IACjB,iCAAe,CAAA;AACjB,CAAC,EAJI,gBAAgB,KAAhB,gBAAgB,QAIpB;AAED,IAAK,mBAIJ;AAJD,WAAK,mBAAmB;IACtB,0CAAqB,CAAA;IACrB,wCAAmB,CAAA;IACnB,uCAAkB,CAAA;AACpB,CAAC,EAJI,mBAAmB,KAAnB,mBAAmB,QAIvB;AAED,IAAM,aAAa,GAAG;IACpB,SAAS,EAAE,mBAAmB;IAC9B,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,gBAAgB;CACzB,CAAC;AAEF,oBAA2B,KAAe,EAAE,KAAe;IACzD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC;AAFD,gCAEC;AAGD,oBAA2B,IAAc;IACvC,OAAO,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/util.d.ts new file mode 100644 index 0000000..e543830 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/util.d.ts @@ -0,0 +1,37 @@ +import { ArrayData, DataType, DataTypeMap, FlatVector, RecursiveArray, RegularArray, TensorLike, TypedArray } from './types'; +export declare function shuffle(array: any[] | Uint32Array | Int32Array | Float32Array): void; +export declare function clamp(min: number, x: number, max: number): number; +export declare function randUniform(a: number, b: number): number; +export declare function distSquared(a: FlatVector, b: FlatVector): number; +export declare function assert(expr: boolean, msg: string | (() => string)): void; +export declare function assertShapesMatch(shapeA: number[], shapeB: number[], errorMessagePrefix?: string): void; +export declare function assertNonNull(a: TensorLike): void; +export declare function flatten>(arr: T | RecursiveArray, ret?: T[]): T[]; +export declare function inferShape(val: TypedArray | number | boolean | RegularArray | RegularArray): number[]; +export declare function sizeFromShape(shape: number[]): number; +export declare function isScalarShape(shape: number[]): boolean; +export declare function arraysEqual(n1: FlatVector, n2: FlatVector): boolean; +export declare function isInt(a: number): boolean; +export declare function tanh(x: number): number; +export declare function sizeToSquarishShape(size: number): [number, number]; +export declare function createShuffledIndices(n: number): Uint32Array; +export declare function rightPad(a: string, size: number): string; +export declare function repeatedTry(checkFn: () => boolean, delayFn?: (counter: number) => number, maxCounter?: number): Promise; +export declare function inferFromImplicitShape(shape: number[], size: number): number[]; +export declare function squeezeShape(shape: number[], axis?: number[]): { + newShape: number[]; + keptDims: number[]; +}; +export declare function getTypedArrayFromDType(dtype: D, size: number): DataTypeMap[D]; +export declare function checkComputationForNaN(vals: DataTypeMap[D], dtype: D, name: string): void; +export declare function checkConversionForNaN(vals: DataTypeMap[D] | number[], dtype: D): void; +export declare function hasEncodingLoss(oldType: DataType, newType: DataType): boolean; +export declare function isTypedArray(a: TypedArray | number | boolean | RegularArray | RegularArray): boolean; +export declare function bytesPerElement(dtype: DataType): number; +export declare function isFunction(f: Function): boolean; +export declare function nearestDivisor(size: number, start: number): number; +export declare function computeStrides(shape: number[]): number[]; +export declare function toTypedArray(a: ArrayData, dtype: D, debugMode: boolean): DataTypeMap[D]; +export declare function makeOnesTypedArray(size: number, dtype: D): DataTypeMap[D]; +export declare function makeZerosTypedArray(size: number, dtype: D): DataTypeMap[D]; +export declare function now(): number; diff --git a/node_modules/@tensorflow/tfjs-core/dist/util.js b/node_modules/@tensorflow/tfjs-core/dist/util.js new file mode 100644 index 0000000..303576a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/util.js @@ -0,0 +1,417 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function shuffle(array) { + var counter = array.length; + var temp = 0; + var index = 0; + while (counter > 0) { + index = (Math.random() * counter) | 0; + counter--; + temp = array[counter]; + array[counter] = array[index]; + array[index] = temp; + } +} +exports.shuffle = shuffle; +function clamp(min, x, max) { + return Math.max(min, Math.min(x, max)); +} +exports.clamp = clamp; +function randUniform(a, b) { + return Math.random() * (b - a) + a; +} +exports.randUniform = randUniform; +function distSquared(a, b) { + var result = 0; + for (var i = 0; i < a.length; i++) { + var diff = Number(a[i]) - Number(b[i]); + result += diff * diff; + } + return result; +} +exports.distSquared = distSquared; +function assert(expr, msg) { + if (!expr) { + throw new Error(typeof msg === 'string' ? msg : msg()); + } +} +exports.assert = assert; +function assertShapesMatch(shapeA, shapeB, errorMessagePrefix) { + if (errorMessagePrefix === void 0) { errorMessagePrefix = ''; } + assert(arraysEqual(shapeA, shapeB), errorMessagePrefix + (" Shapes " + shapeA + " and " + shapeB + " must match")); +} +exports.assertShapesMatch = assertShapesMatch; +function assertNonNull(a) { + assert(a != null, "The input to the tensor constructor must be a non-null value."); +} +exports.assertNonNull = assertNonNull; +function flatten(arr, ret) { + if (ret === void 0) { ret = []; } + if (Array.isArray(arr)) { + for (var i = 0; i < arr.length; ++i) { + flatten(arr[i], ret); + } + } + else { + ret.push(arr); + } + return ret; +} +exports.flatten = flatten; +function inferShape(val) { + var firstElem = val; + if (isTypedArray(val)) { + return [val.length]; + } + if (!Array.isArray(val)) { + return []; + } + var shape = []; + while (firstElem instanceof Array) { + shape.push(firstElem.length); + firstElem = firstElem[0]; + } + if (val instanceof Array) { + deepAssertShapeConsistency(val, shape, []); + } + return shape; +} +exports.inferShape = inferShape; +function deepAssertShapeConsistency(val, shape, indices) { + indices = indices || []; + if (!(val instanceof Array)) { + assert(shape.length === 0, function () { return "Element arr[" + indices.join('][') + "] is a primitive, " + + ("but should be an array of " + shape[0] + " elements"); }); + return; + } + assert(shape.length > 0, function () { return "Element arr[" + indices.join('][') + "] should be a primitive, " + + ("but is an array of " + val.length + " elements"); }); + assert(val.length === shape[0], function () { return "Element arr[" + indices.join('][') + "] should have " + shape[0] + " " + + ("elements, but has " + val.length + " elements"); }); + var subShape = shape.slice(1); + for (var i = 0; i < val.length; ++i) { + deepAssertShapeConsistency(val[i], subShape, indices.concat(i)); + } +} +function sizeFromShape(shape) { + if (shape.length === 0) { + return 1; + } + var size = shape[0]; + for (var i = 1; i < shape.length; i++) { + size *= shape[i]; + } + return size; +} +exports.sizeFromShape = sizeFromShape; +function isScalarShape(shape) { + return shape.length === 0; +} +exports.isScalarShape = isScalarShape; +function arraysEqual(n1, n2) { + if (n1.length !== n2.length) { + return false; + } + for (var i = 0; i < n1.length; i++) { + if (n1[i] !== n2[i]) { + return false; + } + } + return true; +} +exports.arraysEqual = arraysEqual; +function isInt(a) { + return a % 1 === 0; +} +exports.isInt = isInt; +function tanh(x) { + if (Math.tanh != null) { + return Math.tanh(x); + } + if (x === Infinity) { + return 1; + } + else if (x === -Infinity) { + return -1; + } + else { + var e2x = Math.exp(2 * x); + return (e2x - 1) / (e2x + 1); + } +} +exports.tanh = tanh; +function sizeToSquarishShape(size) { + for (var a = Math.floor(Math.sqrt(size)); a > 1; --a) { + if (size % a === 0) { + return [a, size / a]; + } + } + return [1, size]; +} +exports.sizeToSquarishShape = sizeToSquarishShape; +function createShuffledIndices(n) { + var shuffledIndices = new Uint32Array(n); + for (var i = 0; i < n; ++i) { + shuffledIndices[i] = i; + } + shuffle(shuffledIndices); + return shuffledIndices; +} +exports.createShuffledIndices = createShuffledIndices; +function rightPad(a, size) { + if (size <= a.length) { + return a; + } + return a + ' '.repeat(size - a.length); +} +exports.rightPad = rightPad; +function repeatedTry(checkFn, delayFn, maxCounter) { + if (delayFn === void 0) { delayFn = function (counter) { return 0; }; } + return new Promise(function (resolve, reject) { + var tryCount = 0; + var tryFn = function () { + if (checkFn()) { + resolve(); + return; + } + tryCount++; + var nextBackoff = delayFn(tryCount); + if (maxCounter != null && tryCount >= maxCounter) { + reject(); + return; + } + setTimeout(tryFn, nextBackoff); + }; + tryFn(); + }); +} +exports.repeatedTry = repeatedTry; +function inferFromImplicitShape(shape, size) { + var shapeProd = 1; + var implicitIdx = -1; + for (var i = 0; i < shape.length; ++i) { + if (shape[i] > 0) { + shapeProd *= shape[i]; + } + else if (shape[i] === -1) { + if (implicitIdx !== -1) { + throw Error("Shapes can only have 1 implicit size. " + + ("Found - 1 at dim " + implicitIdx + " and dim " + i)); + } + implicitIdx = i; + } + else if (shape[i] <= 0) { + throw Error("Shapes can not be <= 0. Found " + shape[i] + " at dim " + i); + } + } + if (implicitIdx === -1) { + if (size > 0 && size !== shapeProd) { + throw Error("Size(" + size + ") must match the product of shape " + shape); + } + return shape; + } + if (size % shapeProd !== 0) { + throw Error("The implicit shape can't be a fractional number. " + + ("Got " + size + " / " + shapeProd)); + } + var newShape = shape.slice(); + newShape[implicitIdx] = size / shapeProd; + return newShape; +} +exports.inferFromImplicitShape = inferFromImplicitShape; +function squeezeShape(shape, axis) { + var newShape = []; + var keptDims = []; + var j = 0; + for (var i = 0; i < shape.length; ++i) { + if (axis != null) { + if (axis[j] === i && shape[i] > 1) { + throw new Error("Can't squeeze axis " + i + " since its dim '" + shape[i] + "' is not 1"); + } + if ((axis[j] == null || axis[j] > i) && shape[i] === 1) { + newShape.push(shape[i]); + keptDims.push(i); + } + if (axis[j] <= i) { + j++; + } + } + if (shape[i] > 1) { + newShape.push(shape[i]); + keptDims.push(i); + } + } + return { newShape: newShape, keptDims: keptDims }; +} +exports.squeezeShape = squeezeShape; +function getTypedArrayFromDType(dtype, size) { + var values = null; + if (dtype == null || dtype === 'float32') { + values = new Float32Array(size); + } + else if (dtype === 'int32') { + values = new Int32Array(size); + } + else if (dtype === 'bool') { + values = new Uint8Array(size); + } + else { + throw new Error("Unknown data type " + dtype); + } + return values; +} +exports.getTypedArrayFromDType = getTypedArrayFromDType; +function checkComputationForNaN(vals, dtype, name) { + if (dtype !== 'float32') { + return; + } + for (var i = 0; i < vals.length; i++) { + if (isNaN(vals[i])) { + throw Error("The result of the '" + name + "' has NaNs."); + } + } +} +exports.checkComputationForNaN = checkComputationForNaN; +function checkConversionForNaN(vals, dtype) { + if (dtype === 'float32') { + return; + } + for (var i = 0; i < vals.length; i++) { + if (isNaN(vals[i])) { + throw Error("NaN is not a valid value for dtype: '" + dtype + "'."); + } + } +} +exports.checkConversionForNaN = checkConversionForNaN; +function hasEncodingLoss(oldType, newType) { + if (newType === 'float32') { + return false; + } + if (newType === 'int32' && oldType !== 'float32') { + return false; + } + if (newType === 'bool' && oldType === 'bool') { + return false; + } + return true; +} +exports.hasEncodingLoss = hasEncodingLoss; +function copyTypedArray(array, dtype, debugMode) { + if (dtype == null || dtype === 'float32') { + return new Float32Array(array); + } + else if (dtype === 'int32') { + if (debugMode) { + checkConversionForNaN(array, dtype); + } + return new Int32Array(array); + } + else if (dtype === 'bool') { + var bool = new Uint8Array(array.length); + for (var i = 0; i < bool.length; ++i) { + if (Math.round(array[i]) !== 0) { + bool[i] = 1; + } + } + return bool; + } + else { + throw new Error("Unknown data type " + dtype); + } +} +function isTypedArray(a) { + return a instanceof Float32Array || a instanceof Int32Array || + a instanceof Uint8Array; +} +exports.isTypedArray = isTypedArray; +function bytesPerElement(dtype) { + if (dtype === 'float32' || dtype === 'int32') { + return 4; + } + else if (dtype === 'bool') { + return 1; + } + else { + throw new Error("Unknown dtype " + dtype); + } +} +exports.bytesPerElement = bytesPerElement; +function isFunction(f) { + return !!(f && f.constructor && f.call && f.apply); +} +exports.isFunction = isFunction; +function nearestDivisor(size, start) { + for (var i = start; i < size; ++i) { + if (size % i === 0) { + return i; + } + } + return size; +} +exports.nearestDivisor = nearestDivisor; +function computeStrides(shape) { + var rank = shape.length; + if (rank < 2) { + return []; + } + var strides = new Array(rank - 1); + strides[rank - 2] = shape[rank - 1]; + for (var i = rank - 3; i >= 0; --i) { + strides[i] = strides[i + 1] * shape[i + 1]; + } + return strides; +} +exports.computeStrides = computeStrides; +function toTypedArray(a, dtype, debugMode) { + if (noConversionNeeded(a, dtype)) { + return a; + } + if (Array.isArray(a)) { + a = flatten(a); + } + return copyTypedArray(a, dtype, debugMode); +} +exports.toTypedArray = toTypedArray; +function noConversionNeeded(a, dtype) { + return (a instanceof Float32Array && dtype === 'float32') || + (a instanceof Int32Array && dtype === 'int32') || + (a instanceof Uint8Array && dtype === 'bool'); +} +function makeOnesTypedArray(size, dtype) { + var array = makeZerosTypedArray(size, dtype); + for (var i = 0; i < array.length; i++) { + array[i] = 1; + } + return array; +} +exports.makeOnesTypedArray = makeOnesTypedArray; +function makeZerosTypedArray(size, dtype) { + if (dtype == null || dtype === 'float32') { + return new Float32Array(size); + } + else if (dtype === 'int32') { + return new Int32Array(size); + } + else if (dtype === 'bool') { + return new Uint8Array(size); + } + else { + throw new Error("Unknown data type " + dtype); + } +} +exports.makeZerosTypedArray = makeZerosTypedArray; +function now() { + if (typeof performance !== 'undefined') { + return performance.now(); + } + else if (typeof process !== 'undefined') { + var time = process.hrtime(); + return time[0] * 1000 + time[1] / 1000000; + } + else { + throw new Error('Can not measure time in this environment. You should run tf.js ' + + 'in the browser or in Node.js'); + } +} +exports.now = now; +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/util.js.map b/node_modules/@tensorflow/tfjs-core/dist/util.js.map new file mode 100644 index 0000000..9aa13dc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;AAqBA,iBAAwB,KACY;IAClC,IAAI,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;IAC3B,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,OAAO,OAAO,GAAG,CAAC,EAAE;QAElB,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAEtC,OAAO,EAAE,CAAC;QAEV,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtB,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;KACrB;AACH,CAAC;AAhBD,0BAgBC;AAGD,eAAsB,GAAW,EAAE,CAAS,EAAE,GAAW;IACvD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACzC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OAAO,CAAC;KAC3C;SAAM;QACL,MAAM,IAAI,KAAK,CACX,iEAAiE;YACjE,8BAA8B,CAAC,CAAC;KACrC;AACH,CAAC;AAXD,kBAWC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/util_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/util_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/util_test.js b/node_modules/@tensorflow/tfjs-core/dist/util_test.js new file mode 100644 index 0000000..1739995 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/util_test.js @@ -0,0 +1,199 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util = require("./util"); +describe('Util', function () { + it('Flatten arrays', function () { + expect(util.flatten([[1, 2, 3], [4, 5, 6]])).toEqual([1, 2, 3, 4, 5, 6]); + expect(util.flatten([[[1, 2], [3, 4], [5, 6], [7, 8]]])).toEqual([ + 1, 2, 3, 4, 5, 6, 7, 8 + ]); + expect(util.flatten([1, 2, 3, 4, 5, 6])).toEqual([1, 2, 3, 4, 5, 6]); + }); + it('Correctly gets size from shape', function () { + expect(util.sizeFromShape([1, 2, 3, 4])).toEqual(24); + }); + it('Correctly identifies scalars', function () { + expect(util.isScalarShape([])).toBe(true); + expect(util.isScalarShape([1, 2])).toBe(false); + expect(util.isScalarShape([1])).toBe(false); + }); + it('Number arrays equal', function () { + expect(util.arraysEqual([1, 2, 3, 6], [1, 2, 3, 6])).toBe(true); + expect(util.arraysEqual([1, 2], [1, 2, 3])).toBe(false); + expect(util.arraysEqual([1, 2, 5], [1, 2])).toBe(false); + }); + it('Is integer', function () { + expect(util.isInt(0.5)).toBe(false); + expect(util.isInt(1)).toBe(true); + }); + it('Size to squarish shape (perfect square)', function () { + expect(util.sizeToSquarishShape(9)).toEqual([3, 3]); + }); + it('Size to squarish shape (prime number)', function () { + expect(util.sizeToSquarishShape(11)).toEqual([1, 11]); + }); + it('Size to squarish shape (almost square)', function () { + expect(util.sizeToSquarishShape(35)).toEqual([5, 7]); + }); + it('Size of 1 to squarish shape', function () { + expect(util.sizeToSquarishShape(1)).toEqual([1, 1]); + }); + it('infer shape single number', function () { + expect(util.inferShape(4)).toEqual([]); + }); + it('infer shape 1d array', function () { + expect(util.inferShape([1, 2, 5])).toEqual([3]); + }); + it('infer shape 2d array', function () { + expect(util.inferShape([[1, 2, 5], [5, 4, 1]])).toEqual([2, 3]); + }); + it('infer shape 3d array', function () { + var a = [[[1, 2], [2, 3], [5, 6]], [[5, 6], [4, 5], [1, 2]]]; + expect(util.inferShape(a)).toEqual([2, 3, 2]); + }); + it('infer shape 4d array', function () { + var a = [ + [[[1], [2]], [[2], [3]], [[5], [6]]], + [[[5], [6]], [[4], [5]], [[1], [2]]] + ]; + expect(util.inferShape(a)).toEqual([2, 3, 2, 1]); + }); + it('infer shape of typed array', function () { + var a = new Float32Array([1, 2, 3, 4, 5]); + expect(util.inferShape(a)).toEqual([5]); + }); +}); +describe('util.repeatedTry', function () { + it('resolves', function (doneFn) { + var counter = 0; + var checkFn = function () { + counter++; + if (counter === 2) { + return true; + } + return false; + }; + util.repeatedTry(checkFn).then(doneFn).catch(function () { + throw new Error('Rejected backoff.'); + }); + }); + it('rejects', function (doneFn) { + var checkFn = function () { return false; }; + util.repeatedTry(checkFn, function () { return 0; }, 5) + .then(function () { + throw new Error('Backoff resolved'); + }) + .catch(doneFn); + }); +}); +describe('util.inferFromImplicitShape', function () { + it('empty shape', function () { + var result = util.inferFromImplicitShape([], 0); + expect(result).toEqual([]); + }); + it('[2, 3, 4] -> [2, 3, 4]', function () { + var result = util.inferFromImplicitShape([2, 3, 4], 24); + expect(result).toEqual([2, 3, 4]); + }); + it('[2, -1, 4] -> [2, 3, 4], size=24', function () { + var result = util.inferFromImplicitShape([2, -1, 4], 24); + expect(result).toEqual([2, 3, 4]); + }); + it('[-1, 3, 4] -> [2, 3, 4], size=24', function () { + var result = util.inferFromImplicitShape([-1, 3, 4], 24); + expect(result).toEqual([2, 3, 4]); + }); + it('[2, 3, -1] -> [2, 3, 4], size=24', function () { + var result = util.inferFromImplicitShape([2, 3, -1], 24); + expect(result).toEqual([2, 3, 4]); + }); + it('[2, -1, -1] throws error', function () { + expect(function () { return util.inferFromImplicitShape([2, -1, -1], 24); }).toThrowError(); + }); + it('[2, 3, -1] size=13 throws error', function () { + expect(function () { return util.inferFromImplicitShape([2, 3, -1], 13); }).toThrowError(); + }); + it('[2, 3, 4] size=25 (should be 24) throws error', function () { + expect(function () { return util.inferFromImplicitShape([2, 3, 4], 25); }).toThrowError(); + }); +}); +describe('util.squeezeShape', function () { + it('scalar', function () { + var _a = util.squeezeShape([]), newShape = _a.newShape, keptDims = _a.keptDims; + expect(newShape).toEqual([]); + expect(keptDims).toEqual([]); + }); + it('1x1 reduced to scalar', function () { + var _a = util.squeezeShape([1, 1]), newShape = _a.newShape, keptDims = _a.keptDims; + expect(newShape).toEqual([]); + expect(keptDims).toEqual([]); + }); + it('1x3x1 reduced to [3]', function () { + var _a = util.squeezeShape([1, 3, 1]), newShape = _a.newShape, keptDims = _a.keptDims; + expect(newShape).toEqual([3]); + expect(keptDims).toEqual([1]); + }); + it('1x1x4 reduced to [4]', function () { + var _a = util.squeezeShape([1, 1, 4]), newShape = _a.newShape, keptDims = _a.keptDims; + expect(newShape).toEqual([4]); + expect(keptDims).toEqual([2]); + }); + it('2x3x4 not reduction', function () { + var _a = util.squeezeShape([2, 3, 4]), newShape = _a.newShape, keptDims = _a.keptDims; + expect(newShape).toEqual([2, 3, 4]); + expect(keptDims).toEqual([0, 1, 2]); + }); + describe('with axis', function () { + it('should only reduce dimensions specified by axis', function () { + var _a = util.squeezeShape([1, 1, 1, 1, 4], [1, 2]), newShape = _a.newShape, keptDims = _a.keptDims; + expect(newShape).toEqual([1, 1, 4]); + expect(keptDims).toEqual([0, 3, 4]); + }); + it('throws error when specified axis is not squeezable', function () { + expect(function () { return util.squeezeShape([1, 1, 2, 1, 4], [1, 2]); }).toThrowError(); + }); + }); +}); +describe('util.checkComputationForNaN', function () { + it('Float32Array has NaN', function () { + expect(function () { return util.checkComputationForNaN(new Float32Array([1, 2, 3, NaN, 4, 255]), 'float32', ''); }) + .toThrowError(); + }); + it('Float32Array no NaN', function () { + expect(function () { return util.checkComputationForNaN(new Float32Array([1, 2, 3, 4, -1, 255]), 'float32', ''); }) + .not.toThrowError(); + }); +}); +describe('util.checkConversionForNaN', function () { + it('Float32Array has NaN', function () { + expect(function () { return util.checkConversionForNaN(new Float32Array([1, 2, 3, NaN, 4, 255]), 'float32'); }) + .not.toThrowError(); + }); + it('Int32Array has NaN', function () { + expect(function () { return util.checkConversionForNaN([1, 2, 3, 4, NaN], 'int32'); }) + .toThrowError(); + }); +}); +describe('util.hasEncodingLoss', function () { + it('any to float32', function () { + expect(util.hasEncodingLoss('bool', 'float32')).toBe(false); + expect(util.hasEncodingLoss('int32', 'float32')).toBe(false); + expect(util.hasEncodingLoss('float32', 'float32')).toBe(false); + }); + it('float32 to any', function () { + expect(util.hasEncodingLoss('float32', 'float32')).toBe(false); + expect(util.hasEncodingLoss('float32', 'int32')).toBe(true); + expect(util.hasEncodingLoss('float32', 'bool')).toBe(true); + }); + it('int32 to lower', function () { + expect(util.hasEncodingLoss('int32', 'int32')).toBe(false); + expect(util.hasEncodingLoss('int32', 'bool')).toBe(true); + }); + it('lower to int32', function () { + expect(util.hasEncodingLoss('bool', 'int32')).toBe(false); + }); + it('bool to bool', function () { + expect(util.hasEncodingLoss('bool', 'bool')).toBe(false); + }); +}); +//# sourceMappingURL=util_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/util_test.js.map new file mode 100644 index 0000000..3a3e31a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/util_test.js.map @@ -0,0 +1 @@ +{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AC,CAAC;QAC3D,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE;QACnB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,cAAc,EAAE;QACjB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/variable_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/variable_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/variable_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/variable_test.js b/node_modules/@tensorflow/tfjs-core/dist/variable_test.js new file mode 100644 index 0000000..c98e1c3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/variable_test.js @@ -0,0 +1,137 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("./index"); +var jasmine_util_1 = require("./jasmine_util"); +var tensor_1 = require("./tensor"); +var test_util_1 = require("./test_util"); +jasmine_util_1.describeWithFlags('variable', test_util_1.ALL_ENVS, function () { + it('simple assign', function () { + var v = tensor_1.variable(tf.tensor1d([1, 2, 3])); + test_util_1.expectArraysClose(v, [1, 2, 3]); + v.assign(tf.tensor1d([4, 5, 6])); + test_util_1.expectArraysClose(v, [4, 5, 6]); + }); + it('simple chain assign', function () { + var v = tf.tensor1d([1, 2, 3]).variable(); + test_util_1.expectArraysClose(v, [1, 2, 3]); + v.assign(tf.tensor1d([4, 5, 6])); + test_util_1.expectArraysClose(v, [4, 5, 6]); + }); + it('default names are unique', function () { + var v = tensor_1.variable(tf.tensor1d([1, 2, 3])); + expect(v.name).not.toBeNull(); + var v2 = tensor_1.variable(tf.tensor1d([1, 2, 3])); + expect(v2.name).not.toBeNull(); + expect(v.name).not.toBe(v2.name); + }); + it('user provided name', function () { + var v = tensor_1.variable(tf.tensor1d([1, 2, 3]), true, 'myName'); + expect(v.name).toBe('myName'); + }); + it('if name already used, throw error', function () { + tensor_1.variable(tf.tensor1d([1, 2, 3]), true, 'myName'); + expect(function () { return tensor_1.variable(tf.tensor1d([1, 2, 3]), true, 'myName'); }) + .toThrowError(); + }); + it('ops can take variables', function () { + var value = tf.tensor1d([1, 2, 3]); + var v = tensor_1.variable(value); + var res = tf.sum(v); + test_util_1.expectArraysClose(res, [6]); + }); + it('chained variables works', function () { + var v = tf.tensor1d([1, 2, 3]).variable(); + var res = tf.sum(v); + test_util_1.expectArraysClose(res, [6]); + }); + it('variables are not affected by tidy', function () { + var v; + expect(tf.memory().numTensors).toBe(0); + tf.tidy(function () { + var value = tf.tensor1d([1, 2, 3], 'float32'); + expect(tf.memory().numTensors).toBe(1); + v = tensor_1.variable(value); + expect(tf.memory().numTensors).toBe(2); + }); + expect(tf.memory().numTensors).toBe(1); + test_util_1.expectArraysClose(v, [1, 2, 3]); + v.dispose(); + expect(tf.memory().numTensors).toBe(0); + }); + it('constructor does not dispose', function () { + var a = tf.scalar(2); + var v = tf.variable(a); + expect(tf.memory().numTensors).toBe(2); + expect(tf.memory().numDataBuffers).toBe(1); + test_util_1.expectArraysClose(v, [2]); + test_util_1.expectArraysClose(a, [2]); + }); + it('variables are assignable to tensors', function () { + var x0 = null; + var y0 = x0; + expect(y0).toBeNull(); + var x1 = null; + var y1 = x1; + expect(y1).toBeNull(); + var x2 = null; + var y2 = x2; + expect(y2).toBeNull(); + var x3 = null; + var y3 = x3; + expect(y3).toBeNull(); + var x4 = null; + var y4 = x4; + expect(y4).toBeNull(); + var xh = null; + var yh = xh; + expect(yh).toBeNull(); + }); + it('assign does not dispose old data', function () { + var v; + v = tensor_1.variable(tf.tensor1d([1, 2, 3])); + expect(tf.memory().numTensors).toBe(2); + expect(tf.memory().numDataBuffers).toBe(1); + test_util_1.expectArraysClose(v, [1, 2, 3]); + var secondArray = tf.tensor1d([4, 5, 6]); + expect(tf.memory().numTensors).toBe(3); + expect(tf.memory().numDataBuffers).toBe(2); + v.assign(secondArray); + test_util_1.expectArraysClose(v, [4, 5, 6]); + expect(tf.memory().numTensors).toBe(3); + expect(tf.memory().numDataBuffers).toBe(2); + v.dispose(); + expect(tf.memory().numTensors).toBe(2); + expect(tf.memory().numDataBuffers).toBe(2); + }); + it('shape must match', function () { + var v = tensor_1.variable(tf.tensor1d([1, 2, 3])); + expect(function () { return v.assign(tf.tensor1d([1, 2])); }).toThrowError(); + expect(function () { return v.assign(tf.tensor2d([3, 4], [1, 2])); }).toThrowError(); + }); + it('dtype must match', function () { + var v = tensor_1.variable(tf.tensor1d([1, 2, 3])); + expect(function () { return v.assign(tf.tensor1d([1, 1, 1], 'int32')); }) + .toThrowError(); + expect(function () { return v.assign(tf.tensor1d([true, false, true], 'bool')); }) + .toThrowError(); + }); +}); +jasmine_util_1.describeWithFlags('x instanceof Variable', test_util_1.ALL_ENVS, function () { + it('x: Variable', function () { + var t = tf.variable(tf.scalar(1)); + expect(t instanceof tensor_1.Variable).toBe(true); + }); + it('x: Variable-like', function () { + var t = { assign: function () { }, shape: [2], dtype: 'float32' }; + expect(t instanceof tensor_1.Variable).toBe(true); + }); + it('x: other object, fails', function () { + var t = { something: 'else' }; + expect(t instanceof tensor_1.Variable).toBe(false); + }); + it('x: Tensor, fails', function () { + var t = tf.scalar(1); + expect(t instanceof tensor_1.Variable).toBe(false); + }); +}); +//# sourceMappingURL=variable_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/variable_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/variable_test.js.map new file mode 100644 index 0000000..25118c9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/variable_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"variable_test.js","sourceRoot":"","sources":["../src/variable_test.ts"],"names":[],"mappings":";;AAiBA,4BAA8B;AAC9B,+CAAiD;AACjD,mCAAoG;AACpG,yCAAwD;AAGxD,gCAAiB,CAAC,UAAU,EAAE,oBAAQ,EAAE;IACtC,EAAE,CAAC,eAAe,EAAE;QAClB,IAAM,CAAC,GAAG,iBAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,6BAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEhC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,6BAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE;QACxB,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC5C,6BAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEhC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,6BAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CA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AAC,CAAC;IAEH,EAAE,CAAC,kBAAkB,EAAE;QACrB,IAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,CAAC,CAAC,YAAY,iBAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/version.d.ts b/node_modules/@tensorflow/tfjs-core/dist/version.d.ts new file mode 100644 index 0000000..77e0ff7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/version.d.ts @@ -0,0 +1,2 @@ +declare const version = "0.12.8"; +export { version }; diff --git a/node_modules/@tensorflow/tfjs-core/dist/version.js b/node_modules/@tensorflow/tfjs-core/dist/version.js new file mode 100644 index 0000000..a5e3ce8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/version.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var version = '0.12.8'; +exports.version = version; +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/version.js.map b/node_modules/@tensorflow/tfjs-core/dist/version.js.map new file mode 100644 index 0000000..71e4f86 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAGA,IAAM,OAAO,GAAG,QAAQ,CAAC;AACjB,0BAAO"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/version_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/version_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/version_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs-core/dist/version_test.js b/node_modules/@tensorflow/tfjs-core/dist/version_test.js new file mode 100644 index 0000000..deb40b6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/version_test.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var index_1 = require("./index"); +describe('version', function () { + it('version is contained', function () { + var expected = require('../package.json').version; + expect(index_1.version_core).toBe(expected); + }); +}); +//# sourceMappingURL=version_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/version_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/version_test.js.map new file mode 100644 index 0000000..5a33330 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/version_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version_test.js","sourceRoot":"","sources":["../src/version_test.ts"],"names":[],"mappings":";;AAiBA,iCAAqC;AAErC,QAAQ,CAAC,SAAS,EAAE;IAClB,EAAE,CAAC,sBAAsB,EAAE;QAEzB,IAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;QACpD,MAAM,CAAC,oBAAY,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/webgl.d.ts b/node_modules/@tensorflow/tfjs-core/dist/webgl.d.ts new file mode 100644 index 0000000..4317d1b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/webgl.d.ts @@ -0,0 +1,5 @@ +import * as gpgpu_util from './kernels/webgl/gpgpu_util'; +import * as webgl_util from './kernels/webgl/webgl_util'; +export { MathBackendWebGL, WebGLMemoryInfo, WebGLTimingInfo } from './kernels/backend_webgl'; +export { GPGPUContext } from './kernels/webgl/gpgpu_context'; +export { gpgpu_util, webgl_util }; diff --git a/node_modules/@tensorflow/tfjs-core/dist/webgl.js b/node_modules/@tensorflow/tfjs-core/dist/webgl.js new file mode 100644 index 0000000..318be41 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/webgl.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var gpgpu_util = require("./kernels/webgl/gpgpu_util"); +exports.gpgpu_util = gpgpu_util; +var webgl_util = require("./kernels/webgl/webgl_util"); +exports.webgl_util = webgl_util; +var backend_webgl_1 = require("./kernels/backend_webgl"); +exports.MathBackendWebGL = backend_webgl_1.MathBackendWebGL; +var gpgpu_context_1 = require("./kernels/webgl/gpgpu_context"); +exports.GPGPUContext = gpgpu_context_1.GPGPUContext; +//# sourceMappingURL=webgl.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/dist/webgl.js.map b/node_modules/@tensorflow/tfjs-core/dist/webgl.js.map new file mode 100644 index 0000000..99aad60 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/dist/webgl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"webgl.js","sourceRoot":"","sources":["../src/webgl.ts"],"names":[],"mappings":";;AAiBA,uDAAyD;AAKjD,gCAAU;AAJlB,uDAAyD;AAIrC,gCAAU;AAH9B,yDAA2F;AAAnF,2CAAA,gBAAgB,CAAA;AACxB,+DAA2D;AAAnD,uCAAA,YAAY,CAAA"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-core/package.json b/node_modules/@tensorflow/tfjs-core/package.json new file mode 100644 index 0000000..e8be992 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-core/package.json @@ -0,0 +1,90 @@ +{ + "_from": "@tensorflow/tfjs-core@0.12.8", + "_id": "@tensorflow/tfjs-core@0.12.8", + "_inBundle": false, + "_integrity": "sha512-Rm3HgjZ0hMbWz8Vj/s9wLtP4ddp+1mi7SyrAbcQ9dU/jnjGupiXBWnAUjiSsID5FtBpVYvvlIxSegmWQxcXorg==", + "_location": "/@tensorflow/tfjs-core", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@tensorflow/tfjs-core@0.12.8", + "name": "@tensorflow/tfjs-core", + "escapedName": "@tensorflow%2ftfjs-core", + "scope": "@tensorflow", + "rawSpec": "0.12.8", + "saveSpec": null, + "fetchSpec": "0.12.8" + }, + "_requiredBy": [ + "/@tensorflow/tfjs" + ], + "_resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-0.12.8.tgz", + "_shasum": "d7bb5fb17da080374a4918aa5cd423378c0cdc0c", + "_spec": "@tensorflow/tfjs-core@0.12.8", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs", + "bugs": { + "url": "https://github.com/tensorflow/tfjs-core/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@types/seedrandom": "~2.4.27", + "@types/webgl-ext": "~0.0.29", + "@types/webgl2": "~0.0.4", + "seedrandom": "~2.4.3" + }, + "deprecated": false, + "description": "Hardware-accelerated JavaScript library for machine intelligence", + "devDependencies": { + "@types/jasmine": "~2.5.53", + "@types/node": "~9.6.0", + "clang-format": "~1.2.2", + "jasmine": "~3.1.0", + "jasmine-core": "~3.1.0", + "karma": "~2.0.2", + "karma-browserstack-launcher": "~1.3.0", + "karma-chrome-launcher": "~2.2.0", + "karma-jasmine": "~1.1.0", + "karma-typescript": "~3.0.12", + "npm-run-all": "~4.1.3", + "rimraf": "~2.6.2", + "rollup": "~0.58.2", + "rollup-plugin-commonjs": "~9.1.3", + "rollup-plugin-node-resolve": "~3.3.0", + "rollup-plugin-typescript2": "~0.13.0", + "rollup-plugin-uglify": "~3.0.0", + "shelljs": "~0.7.8", + "ts-node": "~7.0.0", + "tslint": "~5.11.0", + "tslint-no-circular-imports": "~0.5.0", + "typescript": "2.9.2", + "yalc": "~1.0.0-pre.21" + }, + "homepage": "https://github.com/tensorflow/tfjs-core#readme", + "jsdelivr": "dist/tf-core.min.js", + "jsnext:main": "dist/tf-core.esm.js", + "license": "Apache-2.0", + "main": "dist/index.js", + "module": "dist/tf-core.esm.js", + "name": "@tensorflow/tfjs-core", + "private": false, + "repository": { + "type": "git", + "url": "git+https://github.com/tensorflow/tfjs-core.git" + }, + "scripts": { + "build": "tsc", + "build-npm": "./scripts/build-npm.sh", + "coverage": "KARMA_COVERAGE=1 karma start --browsers='Chrome' --singleRun", + "link-local": "yalc link", + "lint": "tslint -p . -t verbose", + "publish-local": "yarn build-npm && yalc push", + "test": "karma start", + "test-all": "./scripts/test-all.sh", + "test-node": "ts-node src/test_node.ts", + "test-travis": "karma start --singleRun --reporters='dots,karma-typescript,BrowserStack' --hostname='bs-local.com'" + }, + "types": "dist/index.d.ts", + "unpkg": "dist/tf-core.min.js", + "version": "0.12.8" +} diff --git a/node_modules/@tensorflow/tfjs-layers/LICENSE b/node_modules/@tensorflow/tfjs-layers/LICENSE new file mode 100644 index 0000000..d6da748 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/LICENSE @@ -0,0 +1,249 @@ +TensorFlow.js Layers is licensed under both the MIT and the Apache 2.0 licenses. + +================================================================================ +COPYRIGHT + +All contributions by François Chollet: +Copyright (c) 2015 - 2018, François Chollet. +All rights reserved. + +All contributions by Google: +Copyright (c) 2015 - 2018, Google LLC. +All rights reserved. + +All contributions by Microsoft: +Copyright (c) 2017 - 2018, Microsoft, Inc. +All rights reserved. + +All other contributions: +Copyright (c) 2015 - 2018, the respective contributors. +All rights reserved. + +Each contributor holds copyright over their respective contributions. +The project versioning (Git) records all such contribution source information. + +LICENSE + +The MIT License (MIT) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +================================================================================ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@tensorflow/tfjs-layers/README.md b/node_modules/@tensorflow/tfjs-layers/README.md new file mode 100644 index 0000000..2a24fbc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/README.md @@ -0,0 +1,96 @@ +[![Build Status](https://travis-ci.org/tensorflow/tfjs-layers.svg?branch=master)](https://travis-ci.org/tensorflow/tfjs-layers) + +# TensorFlow.js Layers: High-Level Machine Learning Model API + +A part of the TensorFlow.js ecosystem, TensorFlow.js Layers is a high-level +API built on [TensorFlow.js Core](https://github.com/tensorflow/tfjs-core), +enabling users to build, train and execute deep learning models in the browser. +TensorFlow.js Layers is modeled after +[Keras](https://keras.io/) and +[tf.keras](https://www.tensorflow.org/api_docs/python/tf/keras) and can +load models saved from those libraries. + +## Importing + +There are three ways to import TensorFlow.js Layers + +1. You can access TensorFlow.js Layers through the union package + between the TensorFlow.js Core and Layers: + [@tensorflow/tfjs](https://www.npmjs.com/package/@tensorflow/tfjs) +2. You can get [TensorFlow.js] Layers as a module: + [@tensorflow/tfjs-layers](https://www.npmjs.com/package/@tensorflow/tfjs-layers). + Note that `tfjs-layers` has peer dependency on tfjs-core, so if you import + `@tensorflow/tfjs-layers`, you also need to import + `@tensorflow/tfjs-core`. +3. As a standalone through [unpkg](https://unpkg.com/). + +Option 1 is the most convenient, but leads to a larger bundle size (we will be +adding more packages to it in the future). Use option 2 if you care about bundle +size. + +## Getting started + +### Building, training and executing a model + +The following example shows how to build a toy model with only one `dense` layer +to perform linear regression. + +```js +import * as tf from '@tensorflow/tfjs'; + +// A sequential model is a container which you can add layers to. +const model = tf.sequential(); + +// Add a dense layer with 1 output unit. +model.add(tf.layers.dense({units: 1, inputShape: [1]})); + +// Specify the loss type and optimizer for training. +model.compile({loss: 'meanSquaredError', optimizer: 'SGD'}); + +// Generate some synthetic data for training. +const xs = tf.tensor2d([[1], [2], [3], [4]], [4, 1]); +const ys = tf.tensor2d([[1], [3], [5], [7]], [4, 1]); + +// Train the model. +await model.fit(xs, ys, {epochs: 500}); + +// Ater the training, perform inference. +const output = model.predict(tf.tensor2d([[5]], [1, 1])); +output.print(); +``` + +### Loading a pretrained Keras model + +You can also load a model previously trained and saved from elsewhere (e.g., +from Python Keras) and use it for inference or transfer learning in the browser. + +For example, in Python, save your Keras model using +[tensorflowjs](https://pypi.org/project/tensorflowjs/), +which can be installed using `pip install tensorflowjs`. + + +```python +import tensorflowjs as tfjs + +# ... Create and train your Keras model. + +# Save your Keras model in TensorFlow.js format. +tfjs.converters.save_keras_model(model, '/path/to/tfjs_artifacts/') + +# Then use your favorite web server to serve the directory at a URL, say +# http://foo.bar/tfjs_artifacts/model.json +``` + +To load the model with TensorFlow.js Layers: + +```js +import * as tf from '@tensorflow/tfjs'; + +const model = await tf.loadModel('http://foo.bar/tfjs_artifacts/model.json'); +// Now the model is ready for inference, evaluation or re-training. +``` + +## For more information + +- [TensorFlow.js API documentation](https://js.tensorflow.org/api/index.html) +- [TensorFlow.js Tutorials](https://js.tensorflow.org/tutorials/) diff --git a/node_modules/@tensorflow/tfjs-layers/dist/activations.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/activations.d.ts new file mode 100644 index 0000000..063383a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/activations.d.ts @@ -0,0 +1,53 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +export declare abstract class Activation extends serialization.Serializable { + abstract apply(tensor: Tensor, axis?: number): Tensor; + getConfig(): serialization.ConfigDict; +} +export declare type ActivationIdentifier = 'elu' | 'hardSigmoid' | 'linear' | 'relu' | 'relu6' | 'selu' | 'sigmoid' | 'softmax' | 'softplus' | 'softsign' | 'tanh' | string; +export declare class Elu extends Activation { + static readonly className: string; + apply(x: Tensor, alpha?: number): Tensor; +} +export declare class Selu extends Activation { + static readonly className: string; + apply(x: Tensor): Tensor; +} +export declare class Relu extends Activation { + static readonly className: string; + apply(x: Tensor): Tensor; +} +export declare class Relu6 extends Activation { + static readonly className: string; + apply(x: Tensor): Tensor; +} +export declare class Linear extends Activation { + static readonly className: string; + apply(x: Tensor): Tensor; +} +export declare class Sigmoid extends Activation { + static readonly className: string; + apply(x: Tensor): Tensor; +} +export declare class HardSigmoid extends Activation { + static readonly className: string; + apply(x: Tensor): Tensor; +} +export declare class Softplus extends Activation { + static readonly className: string; + apply(x: Tensor): Tensor; +} +export declare class Softsign extends Activation { + static readonly className: string; + apply(x: Tensor): Tensor; +} +export declare class Tanh extends Activation { + static readonly className: string; + apply(x: Tensor): Tensor; +} +export declare class Softmax extends Activation { + static readonly className: string; + apply(x: Tensor, axis?: number): Tensor; +} +export declare function serializeActivation(activation: Activation): string; +export declare function deserializeActivation(config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): Activation; +export declare function getActivation(identifier: ActivationIdentifier | serialization.ConfigDict | Activation): Activation; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/activations.js b/node_modules/@tensorflow/tfjs-layers/dist/activations.js new file mode 100644 index 0000000..c1520e3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/activations.js @@ -0,0 +1,200 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var K = require("./backend/tfjs_backend"); +var state_1 = require("./backend/state"); +var generic_utils_1 = require("./utils/generic_utils"); +var Activation = (function (_super) { + __extends(Activation, _super); + function Activation() { + return _super !== null && _super.apply(this, arguments) || this; + } + Activation.prototype.getConfig = function () { + return {}; + }; + return Activation; +}(tfjs_core_1.serialization.Serializable)); +exports.Activation = Activation; +var Elu = (function (_super) { + __extends(Elu, _super); + function Elu() { + return _super !== null && _super.apply(this, arguments) || this; + } + Elu.prototype.apply = function (x, alpha) { + if (alpha === void 0) { alpha = 1; } + return K.elu(x, alpha); + }; + Elu.className = 'elu'; + return Elu; +}(Activation)); +exports.Elu = Elu; +tfjs_core_1.serialization.SerializationMap.register(Elu); +var Selu = (function (_super) { + __extends(Selu, _super); + function Selu() { + return _super !== null && _super.apply(this, arguments) || this; + } + Selu.prototype.apply = function (x) { + return tfc.selu(x); + }; + Selu.className = 'selu'; + return Selu; +}(Activation)); +exports.Selu = Selu; +tfjs_core_1.serialization.SerializationMap.register(Selu); +var Relu = (function (_super) { + __extends(Relu, _super); + function Relu() { + return _super !== null && _super.apply(this, arguments) || this; + } + Relu.prototype.apply = function (x) { + return tfc.relu(x); + }; + Relu.className = 'relu'; + return Relu; +}(Activation)); +exports.Relu = Relu; +tfjs_core_1.serialization.SerializationMap.register(Relu); +var Relu6 = (function (_super) { + __extends(Relu6, _super); + function Relu6() { + return _super !== null && _super.apply(this, arguments) || this; + } + Relu6.prototype.apply = function (x) { + return tfjs_core_1.tidy(function () { return tfc.minimum(state_1.getScalar(6.0), tfc.relu(x)); }); + }; + Relu6.className = 'relu6'; + return Relu6; +}(Activation)); +exports.Relu6 = Relu6; +tfjs_core_1.serialization.SerializationMap.register(Relu6); +var Linear = (function (_super) { + __extends(Linear, _super); + function Linear() { + return _super !== null && _super.apply(this, arguments) || this; + } + Linear.prototype.apply = function (x) { + return x; + }; + Linear.className = 'linear'; + return Linear; +}(Activation)); +exports.Linear = Linear; +tfjs_core_1.serialization.SerializationMap.register(Linear); +var Sigmoid = (function (_super) { + __extends(Sigmoid, _super); + function Sigmoid() { + return _super !== null && _super.apply(this, arguments) || this; + } + Sigmoid.prototype.apply = function (x) { + return tfc.sigmoid(x); + }; + Sigmoid.className = 'sigmoid'; + return Sigmoid; +}(Activation)); +exports.Sigmoid = Sigmoid; +tfjs_core_1.serialization.SerializationMap.register(Sigmoid); +var HardSigmoid = (function (_super) { + __extends(HardSigmoid, _super); + function HardSigmoid() { + return _super !== null && _super.apply(this, arguments) || this; + } + HardSigmoid.prototype.apply = function (x) { + return K.hardSigmoid(x); + }; + HardSigmoid.className = 'hardSigmoid'; + return HardSigmoid; +}(Activation)); +exports.HardSigmoid = HardSigmoid; +tfjs_core_1.serialization.SerializationMap.register(HardSigmoid); +var Softplus = (function (_super) { + __extends(Softplus, _super); + function Softplus() { + return _super !== null && _super.apply(this, arguments) || this; + } + Softplus.prototype.apply = function (x) { + return tfc.softplus(x); + }; + Softplus.className = 'softplus'; + return Softplus; +}(Activation)); +exports.Softplus = Softplus; +tfjs_core_1.serialization.SerializationMap.register(Softplus); +var Softsign = (function (_super) { + __extends(Softsign, _super); + function Softsign() { + return _super !== null && _super.apply(this, arguments) || this; + } + Softsign.prototype.apply = function (x) { + return K.softsign(x); + }; + Softsign.className = 'softsign'; + return Softsign; +}(Activation)); +exports.Softsign = Softsign; +tfjs_core_1.serialization.SerializationMap.register(Softsign); +var Tanh = (function (_super) { + __extends(Tanh, _super); + function Tanh() { + return _super !== null && _super.apply(this, arguments) || this; + } + Tanh.prototype.apply = function (x) { + return tfc.tanh(x); + }; + Tanh.className = 'tanh'; + return Tanh; +}(Activation)); +exports.Tanh = Tanh; +tfjs_core_1.serialization.SerializationMap.register(Tanh); +var Softmax = (function (_super) { + __extends(Softmax, _super); + function Softmax() { + return _super !== null && _super.apply(this, arguments) || this; + } + Softmax.prototype.apply = function (x, axis) { + if (axis === void 0) { axis = (-1); } + return tfc.softmax(x, axis); + }; + Softmax.className = 'softmax'; + return Softmax; +}(Activation)); +exports.Softmax = Softmax; +tfjs_core_1.serialization.SerializationMap.register(Softmax); +function serializeActivation(activation) { + return activation.getClassName(); +} +exports.serializeActivation = serializeActivation; +function deserializeActivation(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return generic_utils_1.deserializeKerasObject(config, tfjs_core_1.serialization.SerializationMap.getMap().classNameMap, customObjects, 'activation'); +} +exports.deserializeActivation = deserializeActivation; +function getActivation(identifier) { + if (identifier == null) { + var config = { className: 'linear', config: {} }; + return deserializeActivation(config); + } + if (typeof identifier === 'string') { + var config = { className: identifier, config: {} }; + return deserializeActivation(config); + } + else if (identifier instanceof Activation) { + return identifier; + } + else { + return deserializeActivation(identifier); + } +} +exports.getActivation = getActivation; +//# sourceMappingURL=activations.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/activations.js.map b/node_modules/@tensorflow/tfjs-layers/dist/activations.js.map new file mode 100644 index 0000000..72ba7db --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/activations.js.map @@ -0,0 +1 @@ +{"version":3,"file":"activations.js","sourceRoot":"","sources":["../src/activations.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA,2CAA6C;AAC7C,mDAAkE;AAElE,0CAA4C;AAC5C,yCAA0C;AAC1C,uDAA6D;AAS7D;IAAyC,8BAA0B;IAAnE;;IAKA,CAAC;IAH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AA4C;IAC9C,OAAO,sCAAsB,CACzB,MAAM,EAAE,yBAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,YAAY,EAC5D,aAAa,EAAE,YAAY,CAAC,CAAC;AACnC,CAAC;AAND,sDAMC;AAED,uBAA8B,UACmC;IAC/D,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,IAAM,MAAM,GAAG,EAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;QACjD,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;KACtC;IACD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,IAAM,MAAM,GAAG,EAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;QACnD,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;KACtC;SAAM,IAAI,UAAU,YAAY,UAAU,EAAE;QAC3C,OAAO,UAAU,CAAC;KACnB;SAAM;QACL,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAC;KAC1C;AACH,CAAC;AAdD,sCAcC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/activations_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/activations_test.js.map new file mode 100644 index 0000000..34cbfe1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/activations_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"activations_test.js","sourceRoot":"","sources":["../src/activations_test.ts"],"names":[],"mappings":";;AAcA,mDAA2E;AAE3E,6CAAsH;AACtH,iDAAoG;AAIpG,kCAAqB,CAAC,mBAAmB,EAAE;IACzC,IAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,IAAM,YAAY,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,E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AC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,eAAe,EAAE;QAClB,IAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAChD,IAAM,KAAK,GAAG,oBAAQ,CAAC,QAAQ,CAAC,CAAC;QACjC,kCAAqB,CAAC,cAAM,OAAA,OAAO,CAAC,KAAK,CAAC,EAAd,CAAc,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/common.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/backend/common.d.ts new file mode 100644 index 0000000..56af0f6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/common.d.ts @@ -0,0 +1,4 @@ +import { DataFormat } from '../common'; +export declare function epsilon(): number; +export declare function setEpsilon(e: number): void; +export declare function imageDataFormat(): DataFormat; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js b/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js new file mode 100644 index 0000000..8117ed6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var _epsilon = 1e-7; +function epsilon() { + return _epsilon; +} +exports.epsilon = epsilon; +function setEpsilon(e) { + _epsilon = e; +} +exports.setEpsilon = setEpsilon; +function imageDataFormat() { + return 'channelsLast'; +} +exports.imageDataFormat = imageDataFormat; +//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js.map b/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js.map new file mode 100644 index 0000000..bb59add --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/common.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/backend/common.ts"],"names":[],"mappings":";;AAYA,IAAI,QAAQ,GAAG,IAAI,CAAC;AAKpB;IACE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAFD,0BAEC;AAMD,oBAA2B,CAAS;IAClC,QAAQ,GAAG,CAAC,CAAC;AACf,CAAC;AAFD,gCAEC;AAKD;IACE,OAAO,cAAc,CAAC;AACxB,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/state.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/backend/state.d.ts new file mode 100644 index 0000000..324988a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/state.d.ts @@ -0,0 +1,5 @@ +import { DataType, Scalar } from '@tensorflow/tfjs-core'; +export declare function getNextUniqueTensorId(): number; +export declare function getUid(prefix?: string): string; +export declare function getScalar(value: number, dtype?: DataType): Scalar; +export declare function disposeScalarCache(): void; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js b/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js new file mode 100644 index 0000000..46f7289 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var _nextUniqueTensorId = 0; +function getNextUniqueTensorId() { + return _nextUniqueTensorId++; +} +exports.getNextUniqueTensorId = getNextUniqueTensorId; +var _uidPrefixes = {}; +function getUid(prefix) { + if (prefix === void 0) { prefix = ''; } + if (!(prefix in _uidPrefixes)) { + _uidPrefixes[prefix] = 0; + } + _uidPrefixes[prefix] += 1; + return prefix + _uidPrefixes[prefix].toString(); +} +exports.getUid = getUid; +var scalarCache = { + float32: {}, + int32: {} +}; +var DEFAULT_DTYPE = 'float32'; +function getScalar(value, dtype) { + if (dtype === undefined) { + dtype = DEFAULT_DTYPE; + } + if (scalarCache[dtype][value] == null) { + scalarCache[dtype][value] = tfjs_core_1.scalar(value, dtype); + tfjs_core_1.keep(scalarCache[dtype][value]); + } + return scalarCache[dtype][value]; +} +exports.getScalar = getScalar; +function disposeScalarCache() { + for (var typeKey in scalarCache) { + for (var key in scalarCache[typeKey]) { + scalarCache[typeKey][key].dispose(); + delete scalarCache[typeKey][key]; + } + } +} +exports.disposeScalarCache = disposeScalarCache; +//# sourceMappingURL=state.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js.map b/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js.map new file mode 100644 index 0000000..98e146c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/state.js.map @@ -0,0 +1 @@ +{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/backend/state.ts"],"names":[],"mappings":";;AAcA,mDAAqE;AAOrE,IAAI,mBAAmB,GAAG,CAAC,CAAC;AAE5B;IACE,OAAO,mBAAmB,EAAE,CAAC;AAC/B,CAAC;AAFD,sDAEC;AAED,IAAM,YAAY,GAA+B,EAAE,CAAC;AAOpD,gBAAuB,MAAW;IAAX,uBAAA,EAAA,WAAW;IAChC,IAAI,CAAC,CAAC,MAAM,IAAI,YAAY,CAAC,EAAE;QAC7B,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAC1B;IACD,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;AAClD,CAAC;AAND,wBAMC;AAED,IAAM,WAAW,GAAiD;IAChE,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;CACV,CAAC;AAEF,IAAM,aAAa,GAAa,SAAS,CAAC;AAK1C,mBAA0B,KAAa,EAAE,KAAgB;IACvD,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,KAAK,GAAG,aAAa,CAAC;KACvB;IACD,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE;QACrC,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,kBAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACjD,gBAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;KACjC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AATD,8BASC;AAED;IACE,KAAK,IAAM,OAAO,IAAI,WAAW,EAAE;QACjC,KAAK,IAAM,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE;YACtC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;YACpC,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;SAClC;KACF;AACH,CAAC;AAPD,gDAOC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/state_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/backend/state_test.js.map new file mode 100644 index 0000000..719b257 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/state_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"state_test.js","sourceRoot":"","sources":["../../src/backend/state_test.ts"],"names":[],"mappings":";;AAUA,0CAAwC;AAExC,QAAQ,CAAC,SAAS,EAAE;IAClB,EAAE,CAAC,0BAA0B,EAAE;QAC7B,IAAM,IAAI,GAAG,KAAK,CAAC;QACnB,IAAM,QAAQ,GAAG,cAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAM,SAAS,GAAG,cAAM,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE;QACrD,IAAM,QAAQ,GAAG,cAAM,EAAE,CAAC;QAC1B,IAAM,SAAS,GAAG,cAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.d.ts new file mode 100644 index 0000000..dfa1367 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.d.ts @@ -0,0 +1,31 @@ +import { Scalar, Tensor, Tensor1D } from '@tensorflow/tfjs-core'; +import { DataFormat } from '../common'; +import { HasShape, Shape } from '../types'; +export declare function setBackend(requestedBackend: 'cpu' | 'webgl'): void; +export declare function getBackend(): 'cpu' | 'webgl'; +export declare function isBackendSymbolic(): boolean; +export declare function countParams(x: HasShape): number; +export declare function cast(x: Tensor, dtype: 'float32' | 'int32' | 'bool'): Tensor; +export declare function expandDims(x: Tensor, axis?: number): Tensor; +export declare function repeat(x: Tensor, n: number): Tensor; +export declare function flatten(x: Tensor): Tensor; +export declare function batchFlatten(x: Tensor): Tensor; +export declare function sliceAlongFirstAxis(array: Tensor, start: number, size: number): Tensor; +export declare function sliceAlongLastAxis(array: Tensor, start: number, size: number): Tensor; +export declare function sliceAlongAxis(array: Tensor, start: number, size: number, axis: number): Tensor; +export declare function concatenate(tensors: Tensor[], axis?: number): Tensor; +export declare function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor; +export declare function tile(x: Tensor, n: number | number[]): Tensor; +export declare function randomNormal(shape: Shape, mean?: number, stddev?: number, dtype?: 'float32' | 'int32', seed?: number): Tensor; +export declare function dot(x: Tensor, y: Tensor): Tensor; +export declare function sign(x: Tensor): Tensor; +export declare function oneHot(indices: Tensor, numClasses: number): Tensor; +export declare function gather(reference: Tensor, indices: number[] | Tensor1D, axis?: number): Tensor; +export declare function square(x: Tensor): Tensor; +export declare function pow(x: Tensor, a: Tensor | number): Tensor; +export declare function biasAdd(x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor; +export declare function elu(x: Tensor, alpha?: number): Tensor; +export declare function softsign(x: Tensor): Tensor; +export declare function dropout(x: Tensor, level: Scalar, noiseShape?: number[], seed?: number): Tensor; +export declare function hardSigmoid(x: Tensor): Tensor; +export declare function inTrainPhase(x: () => T, alt: () => T, training?: boolean): T; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js b/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js new file mode 100644 index 0000000..b09ca9c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js @@ -0,0 +1,396 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("../backend/state"); +var common_1 = require("../common"); +var errors_1 = require("../errors"); +var math_utils = require("../utils/math_utils"); +var common_2 = require("./common"); +var backend = 'webgl'; +function setBackend(requestedBackend) { + tfc.setBackend(requestedBackend); + backend = requestedBackend; + state_1.disposeScalarCache(); +} +exports.setBackend = setBackend; +function getBackend() { + return backend; +} +exports.getBackend = getBackend; +function isBackendSymbolic() { + return false; +} +exports.isBackendSymbolic = isBackendSymbolic; +function countParams(x) { + var shape = x.shape; + if (shape.length > 0) { + return shape.reduce(function (a, b) { return a * b; }); + } + else { + return 1; + } +} +exports.countParams = countParams; +function cast(x, dtype) { + return x.asType(dtype); +} +exports.cast = cast; +function expandDims(x, axis) { + if (axis === void 0) { axis = -1; } + var outShape = x.shape.slice(); + if (axis < 0) { + axis = outShape.length + axis + 1; + } + outShape.splice(axis, 0, 1); + return x.reshape(outShape); +} +exports.expandDims = expandDims; +function repeat(x, n) { + return tfjs_core_1.tidy(function () { + if (x.shape.length !== 2) { + throw new errors_1.ValueError("repeat() expects a rank-2 tensor, but received a " + + ("rank-" + x.shape.length + " tensor.")); + } + var y = expandDims(x, 1); + return tile(y, [1, n, 1]); + }); +} +exports.repeat = repeat; +function flatten(x) { + var newShape = [math_utils.arrayProd(x.shape)]; + return x.reshape(newShape); +} +exports.flatten = flatten; +function batchFlatten(x) { + if (x.rank <= 1) { + throw new errors_1.ValueError("batchFlatten requires a minimum rank of 2. Got rank: " + x.rank + "."); + } + var newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)]; + return x.reshape(newShape); +} +exports.batchFlatten = batchFlatten; +function sliceAlongFirstAxis(array, start, size) { + return tfjs_core_1.tidy(function () { + switch (array.rank) { + case 1: + return tfc.slice1d(array, start, size); + case 2: + return tfc.slice2d(array, [start, 0], [size, array.shape[1]]); + case 3: + return tfc.slice3d(array, [start, 0, 0], [size, array.shape[1], array.shape[2]]); + case 4: + return tfc.slice4d(array, [start, 0, 0, 0], [size, array.shape[1], array.shape[2], array.shape[3]]); + default: + throw new errors_1.ValueError("sliceAlongFirstAxis() received an unsupported tensor rank: " + + ("" + array.rank)); + } + }); +} +exports.sliceAlongFirstAxis = sliceAlongFirstAxis; +function sliceAlongLastAxis(array, start, size) { + return tfjs_core_1.tidy(function () { + switch (array.rank) { + case 1: + return tfc.slice1d(array, start, size); + case 2: + return tfc.slice2d(array, [0, start], [array.shape[0], size]); + case 3: + return tfc.slice3d(array, [0, 0, start], [array.shape[0], array.shape[1], size]); + case 4: + return tfc.slice4d(array, [0, 0, 0, start], [array.shape[0], array.shape[1], array.shape[2], size]); + default: + throw new errors_1.ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + + ("" + array.rank)); + } + }); +} +exports.sliceAlongLastAxis = sliceAlongLastAxis; +function sliceAlongAxis(array, start, size, axis) { + return tfjs_core_1.tidy(function () { + switch (array.rank) { + case 1: + return tfc.slice1d(array, start, size); + case 2: + switch (axis) { + case 1: + return sliceAlongFirstAxis(array, start, size); + case 2: + return sliceAlongLastAxis(array, start, size); + default: + throw new errors_1.ValueError("The axis is not within the rank of the tensor " + + ("" + axis)); + } + case 3: + switch (axis) { + case 1: + return sliceAlongFirstAxis(array, start, size); + case 2: + return tfc.slice3d(array, [0, start, 0], [array.shape[0], size, array.shape[2]]); + case 3: + return sliceAlongLastAxis(array, start, size); + default: + throw new errors_1.ValueError("The axis is not within the rank of the tensor " + + ("" + axis)); + } + case 4: + switch (axis) { + case 1: + return sliceAlongFirstAxis(array, start, size); + case 2: + return tfc.slice4d(array, [0, start, 0, 0], [array.shape[0], size, array.shape[2], array.shape[3]]); + case 3: + return tfc.slice4d(array, [0, 0, start, 0], [array.shape[0], array.shape[1], size, array.shape[3]]); + case 4: + return sliceAlongLastAxis(array, start, size); + default: + throw new errors_1.ValueError("The axis is not within the rank of the tensor " + + ("" + axis)); + } + default: + throw new errors_1.ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + + ("" + array.rank)); + } + }); +} +exports.sliceAlongAxis = sliceAlongAxis; +function concatenate(tensors, axis) { + if (axis === void 0) { axis = -1; } + var rank; + if (axis < 0) { + rank = tensors[0].rank; + if (rank !== 0) { + axis = rank; + } + else { + axis = 0; + } + } + if (axis === tensors[0].rank) { + axis = -1; + } + return tfc.concat(tensors, axis); +} +exports.concatenate = concatenate; +function concatAlongFirstAxis(a, b) { + switch (a.rank) { + case 1: + return tfc.concat1d([a, b]); + case 2: + return tfc.concat2d([a, b], 0); + case 3: + return tfc.concat3d([a, b], 0); + case 4: + return tfc.concat4d([a, b], 0); + default: + throw new errors_1.ValueError('concatAlongFirstAxis() received an unsupported tensor rank: ' + + a.rank); + } +} +exports.concatAlongFirstAxis = concatAlongFirstAxis; +function tile(x, n) { + if (!Array.isArray(n)) { + n = [n]; + } + if (x.rank !== n.length) { + throw new errors_1.ValueError("The length of input n (" + n.length + ") does not match " + + ("the number of dimensions in input x (" + x.rank + ")")); + } + return tfc.tile(x, n); +} +exports.tile = tile; +function randomNormal(shape, mean, stddev, dtype, seed) { + if (mean === void 0) { mean = 0.0; } + if (stddev === void 0) { stddev = 1.0; } + return tfc.randomNormal(shape, mean, stddev, dtype, seed); +} +exports.randomNormal = randomNormal; +function dot(x, y) { + if (y.rank !== 2) { + throw new errors_1.NotImplementedError("dot support for y other than rank 2 is not yet implemented: " + + ("y shape = " + y.shape)); + } + else { + if (x.rank === 2) { + return tfc.matMul(x, y); + } + else if (x.rank === 3) { + var xShape0 = x.shape[0]; + var xShape1 = x.shape[1]; + var xShape2 = x.shape[2]; + x = x.reshape([xShape0 * xShape1, xShape2]); + return tfc.matMul(x, y).reshape([ + xShape0, xShape1, y.shape[1] + ]); + } + else { + throw new errors_1.NotImplementedError("dot support for x of rank " + x.rank + " is not yet implemented: " + + ("x shape = " + x.shape)); + } + } +} +exports.dot = dot; +function sign(x) { + return tfjs_core_1.tidy(function () { + var zerosLikeX = tfjs_core_1.zerosLike(x); + var onesLikeX = tfjs_core_1.onesLike(x); + return tfjs_core_1.where(tfc.equal(x, zerosLikeX), zerosLikeX, tfjs_core_1.where(tfc.greater(x, tfjs_core_1.zerosLike(x)), onesLikeX, tfc.mul(state_1.getScalar(-1), onesLikeX))); + }); +} +exports.sign = sign; +function oneHot(indices, numClasses) { + return tfjs_core_1.tidy(function () { + if (indices.rank !== 1) { + throw new Error('Only 1D one-hot tensors are supported in the ' + + 'deeplearn backend, at present.'); + } + indices = indices.toInt(); + return tfc.oneHot(indices, numClasses).toFloat(); + }); +} +exports.oneHot = oneHot; +function gather(reference, indices, axis) { + return tfjs_core_1.tidy(function () { + if (Array.isArray(indices)) { + indices = tfjs_core_1.tensor1d(indices, 'int32'); + } + else { + indices = indices.toInt(); + } + return tfc.gather(reference, indices, axis); + }); +} +exports.gather = gather; +function square(x) { + return tfc.mulStrict(x, x); +} +exports.square = square; +function pow(x, a) { + return tfjs_core_1.tidy(function () { + if (typeof (a) === 'number') { + a = tfjs_core_1.scalar(Math.round(a), 'int32'); + } + if (a.dtype !== 'int32') { + throw new errors_1.NotImplementedError("Non-int32 dtype (" + a.dtype + ") is not supported by pow() yet"); + } + return tfc.pow(x, a); + }); +} +exports.pow = pow; +function biasAdd(x, bias, dataFormat) { + return tfjs_core_1.tidy(function () { + if (dataFormat == null) { + dataFormat = common_2.imageDataFormat(); + } + common_1.checkDataFormat(dataFormat); + if (bias.rank !== 1 && bias.rank !== x.rank) { + throw new errors_1.ValueError('Unexpected bias dimensions: ' + bias.rank + + '; expected it to be 1 or ' + x.rank); + } + var biasShape = bias.shape; + var y; + if (x.rank === 5) { + if (dataFormat === 'channelsFirst') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, biasShape[0], 1, 1, 1])); + } + else { + y = x.add(bias.reshape([1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]])); + } + } + else if (dataFormat === 'channelsLast') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, 1, 1, 1, biasShape[0]])); + } + else { + y = x.add(bias.reshape([1].concat(biasShape))); + } + } + } + else if (x.rank === 4) { + if (dataFormat === 'channelsFirst') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, biasShape[0], 1, 1])); + } + else { + y = x.add(bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]])); + } + } + else if (dataFormat === 'channelsLast') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, 1, 1, biasShape[0]])); + } + else { + y = x.add(bias.reshape([1].concat(biasShape))); + } + } + } + else if (x.rank === 3) { + if (dataFormat === 'channelsFirst') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, biasShape[0], 1])); + } + else { + y = x.add(bias.reshape([1, biasShape[1], biasShape[0]])); + } + } + else if (dataFormat === 'channelsLast') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, 1, biasShape[0]])); + } + else { + y = x.add(bias.reshape([1].concat(biasShape))); + } + } + } + else if (x.rank < 3) { + y = x.add(bias); + } + else { + throw new errors_1.ValueError("Unsupported input rank by biasAdd: " + x.rank); + } + return y; + }); +} +exports.biasAdd = biasAdd; +function elu(x, alpha) { + if (alpha === void 0) { alpha = 1; } + if (alpha !== 1) { + throw new errors_1.NotImplementedError("Support for alpha values other than 1 (" + alpha + ") is not implemented " + + "yet."); + } + return tfc.elu(x); +} +exports.elu = elu; +function softsign(x) { + return tfjs_core_1.tidy(function () { return tfc.div(x, tfc.add(state_1.getScalar(1), tfc.abs(x))); }); +} +exports.softsign = softsign; +function dropout(x, level, noiseShape, seed) { + return tfjs_core_1.tidy(function () { + if (noiseShape != null && !tfjs_core_1.util.arraysEqual(x.shape, noiseShape)) { + throw new errors_1.NotImplementedError('Non-default noise shape is not implemented yet: ' + + JSON.stringify(noiseShape)); + } + if (seed != null) { + throw new errors_1.NotImplementedError('seed is not implemented for dropout yet.'); + } + var multiplier = tfc.step(tfc.add(tfc.neg(level), tfc.randomUniform(x.shape, 0, 1, 'float32'))); + multiplier = tfc.mul(tfc.div(state_1.getScalar(1), tfc.sub(state_1.getScalar(1), level)), multiplier); + return tfc.mul(x, multiplier); + }); +} +exports.dropout = dropout; +function hardSigmoid(x) { + return tfjs_core_1.tidy(function () { + var y = tfc.add(state_1.getScalar(0.5), tfc.mul(state_1.getScalar(0.2), x)); + return tfc.clipByValue(y, 0, 1); + }); +} +exports.hardSigmoid = hardSigmoid; +function inTrainPhase(x, alt, training) { + if (training === void 0) { training = false; } + return training ? x() : alt(); +} +exports.inTrainPhase = inTrainPhase; +//# sourceMappingURL=tfjs_backend.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js.map b/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js.map new file mode 100644 index 0000000..b3e781d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tfjs_backend.js","sourceRoot":"","sources":["../../src/backend/tfjs_backend.ts"],"names":[],"mappings":";;AAeA,2CAA6C;AAC7C,mDAAwL;AAExL,0CAA+D;AAC/D,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AC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9D,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC;AALD,kCAKC;AAcD,sBAAgC,CAAU,EAAE,GAAY,EAAE,QAAgB;IAAhB,yBAAA,EAAA,gBAAgB;IACxE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAChC,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend_test.js.map new file mode 100644 index 0000000..2d8067c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/backend/tfjs_backend_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tfjs_backend_test.js","sourceRoot":"","sources":["../../src/backend/tfjs_backend_test.ts"],"names":[],"mappings":";;AAeA,2CAA6C;AAC7C,mDAAsG;AAEtG,+CAAkD;AAClD,kDAA0C;AAC1C,kDAAsH;AACtH,0CAA2C;AAE3C,kCAAoC;AAIpC,QAAQ,CAAC,YAAY,EAAE;IACrB,EAAE,CAAC,6BAA6B,EAAE;QAEhC,IAAM,eAAe,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC;QACvC,MAAM,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEzC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,OAAO,EAAE;IAChB,EAAE,CAAC,+BAA+B,EAAE;QAClC,IAAM,CAAC,GAAG,iBAAK,CAAC,CAAC,CAAC,C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ist/base_callbacks.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.d.ts new file mode 100644 index 0000000..a584155 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.d.ts @@ -0,0 +1,73 @@ +import { Tensor } from '@tensorflow/tfjs-core'; +import { Container } from './engine/container'; +import { Logs, UnresolvedLogs } from './logs'; +export declare type Params = { + [key: string]: number | string | boolean | number[] | string[] | boolean[]; +}; +export declare abstract class BaseCallback { + validationData: Tensor | Tensor[]; + params: Params; + setParams(params: Params): void; + onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise; + onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; + onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise; + onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise; + onTrainBegin(logs?: UnresolvedLogs): Promise; + onTrainEnd(logs?: UnresolvedLogs): Promise; + setModel(model: Container): void; +} +export declare class CallbackList { + callbacks: BaseCallback[]; + queueLength: number; + constructor(callbacks?: BaseCallback[], queueLength?: number); + append(callback: BaseCallback): void; + setParams(params: Params): void; + setModel(model: Container): void; + onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise; + onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; + onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise; + onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise; + onTrainBegin(logs?: UnresolvedLogs): Promise; + onTrainEnd(logs?: UnresolvedLogs): Promise; +} +export declare class BaseLogger extends BaseCallback { + private seen; + private totals; + constructor(); + onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise; + onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise; + onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; +} +export declare class History extends BaseCallback { + epoch: number[]; + history: { + [key: string]: Array; + }; + onTrainBegin(logs?: UnresolvedLogs): Promise; + onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; + syncData(): Promise; +} +export interface CustomCallbackConfig { + onTrainBegin?: (logs?: Logs) => Promise; + onTrainEnd?: (logs?: Logs) => Promise; + onEpochBegin?: (epoch: number, logs?: Logs) => Promise; + onEpochEnd?: (epoch: number, logs?: Logs) => Promise; + onBatchBegin?: (batch: number, logs?: Logs) => Promise; + onBatchEnd?: (batch: number, logs?: Logs) => Promise; +} +export declare class CustomCallback extends BaseCallback { + protected readonly trainBegin: (logs?: Logs) => Promise; + protected readonly trainEnd: (logs?: Logs) => Promise; + protected readonly epochBegin: (epoch: number, logs?: Logs) => Promise; + protected readonly epochEnd: (epoch: number, logs?: Logs) => Promise; + protected readonly batchBegin: (batch: number, logs?: Logs) => Promise; + protected readonly batchEnd: (batch: number, logs?: Logs) => Promise; + constructor(config: CustomCallbackConfig); + onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise; + onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise; + onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise; + onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise; + onTrainBegin(logs?: UnresolvedLogs): Promise; + onTrainEnd(logs?: UnresolvedLogs): Promise; +} +export declare function standardizeCallbacks(callbacks: BaseCallback | BaseCallback[] | CustomCallbackConfig | CustomCallbackConfig[]): BaseCallback[]; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js b/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js new file mode 100644 index 0000000..2698fc5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js @@ -0,0 +1,570 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("./backend/state"); +var logs_1 = require("./logs"); +var generic_utils = require("./utils/generic_utils"); +var BaseCallback = (function () { + function BaseCallback() { + this.validationData = null; + } + BaseCallback.prototype.setParams = function (params) { + this.params = params; + }; + BaseCallback.prototype.onEpochBegin = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onBatchBegin = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onBatchEnd = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onTrainBegin = function (logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onTrainEnd = function (logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.setModel = function (model) { + }; + return BaseCallback; +}()); +exports.BaseCallback = BaseCallback; +var CallbackList = (function () { + function CallbackList(callbacks, queueLength) { + if (queueLength === void 0) { queueLength = 10; } + if (callbacks == null) { + callbacks = []; + } + this.callbacks = callbacks; + this.queueLength = queueLength; + } + CallbackList.prototype.append = function (callback) { + this.callbacks.push(callback); + }; + CallbackList.prototype.setParams = function (params) { + for (var _i = 0, _a = this.callbacks; _i < _a.length; _i++) { + var callback = _a[_i]; + callback.setParams(params); + } + }; + CallbackList.prototype.setModel = function (model) { + for (var _i = 0, _a = this.callbacks; _i < _a.length; _i++) { + var callback = _a[_i]; + callback.setModel(model); + } + }; + CallbackList.prototype.onEpochBegin = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onEpochBegin(epoch, logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onEpochEnd(epoch, logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onBatchBegin = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onBatchBegin(batch, logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onBatchEnd = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onBatchEnd(batch, logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onTrainBegin = function (logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onTrainBegin(logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onTrainEnd = function (logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onTrainEnd(logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + return CallbackList; +}()); +exports.CallbackList = CallbackList; +var BaseLogger = (function (_super) { + __extends(BaseLogger, _super); + function BaseLogger() { + return _super.call(this) || this; + } + BaseLogger.prototype.onEpochBegin = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + this.seen = 0; + this.totals = {}; + return [2]; + }); + }); + }; + BaseLogger.prototype.onBatchEnd = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var batchSize, _loop_1, this_1, key; + return __generator(this, function (_a) { + if (logs == null) { + logs = {}; + } + batchSize = logs['size'] == null ? 0 : logs['size']; + this.seen += batchSize; + _loop_1 = function (key) { + var value = logs[key]; + if (typeof value === 'number') { + if (!this_1.totals.hasOwnProperty(key)) { + this_1.totals[key] = 0; + } + this_1.totals[key] = this_1.totals[key] + value * batchSize; + } + else { + var oldTotalsToDispose = void 0; + if (key in this_1.totals) { + oldTotalsToDispose = this_1.totals[key]; + } + else { + this_1.totals[key] = state_1.getScalar(0); + } + this_1.totals[key] = tfjs_core_1.tidy(function () { return tfjs_core_1.add(_this.totals[key], tfjs_core_1.mul(value, state_1.getScalar(batchSize))); }); + if (oldTotalsToDispose != null) { + oldTotalsToDispose.dispose(); + } + } + }; + this_1 = this; + for (key in logs) { + _loop_1(key); + } + return [2]; + }); + }); + }; + BaseLogger.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var _loop_2, this_2, _i, _a, key; + return __generator(this, function (_b) { + if (logs != null) { + _loop_2 = function (key) { + if (this_2.totals[key] == null) { + return "continue"; + } + if (typeof this_2.totals[key] === 'number') { + logs[key] = this_2.totals[key] / this_2.seen; + } + else { + tfjs_core_1.tidy(function () { + logs[key] = tfjs_core_1.mul(tfjs_core_1.div(state_1.getScalar(1), state_1.getScalar(_this.seen)), _this.totals[key]); + _this.totals[key].dispose(); + tfjs_core_1.keep(logs[key]); + }); + } + }; + this_2 = this; + for (_i = 0, _a = this.params['metrics']; _i < _a.length; _i++) { + key = _a[_i]; + _loop_2(key); + } + } + return [2]; + }); + }); + }; + return BaseLogger; +}(BaseCallback)); +exports.BaseLogger = BaseLogger; +var History = (function (_super) { + __extends(History, _super); + function History() { + return _super !== null && _super.apply(this, arguments) || this; + } + History.prototype.onTrainBegin = function (logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + this.epoch = []; + this.history = {}; + return [2]; + }); + }); + }; + History.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + var key; + return __generator(this, function (_a) { + if (logs == null) { + logs = {}; + } + this.epoch.push(epoch); + for (key in logs) { + if (this.history[key] == null) { + this.history[key] = []; + } + this.history[key].push(logs[key]); + } + return [2]; + }); + }); + }; + History.prototype.syncData = function () { + return __awaiter(this, void 0, void 0, function () { + var promises, keys, indices, key, valueArray, i, valueScalar, values, n, tensorToDispose; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + promises = []; + keys = []; + indices = []; + for (key in this.history) { + valueArray = this.history[key]; + for (i = 0; i < valueArray.length; ++i) { + if (typeof valueArray[i] !== 'number') { + valueScalar = valueArray[i]; + promises.push(valueScalar.data()); + keys.push(key); + indices.push(i); + } + } + } + return [4, Promise.all(promises)]; + case 1: + values = _a.sent(); + for (n = 0; n < values.length; ++n) { + tensorToDispose = this.history[keys[n]][indices[n]]; + tensorToDispose.dispose(); + this.history[keys[n]][indices[n]] = values[n][0]; + } + return [2]; + } + }); + }); + }; + return History; +}(BaseCallback)); +exports.History = History; +var CustomCallback = (function (_super) { + __extends(CustomCallback, _super); + function CustomCallback(config) { + var _this = _super.call(this) || this; + _this.trainBegin = config.onTrainBegin; + _this.trainEnd = config.onTrainEnd; + _this.epochBegin = config.onEpochBegin; + _this.epochEnd = config.onEpochEnd; + _this.batchBegin = config.onBatchBegin; + _this.batchEnd = config.onBatchEnd; + return _this; + } + CustomCallback.prototype.onEpochBegin = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.epochBegin != null)) return [3, 3]; + return [4, logs_1.resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.epochBegin(epoch, logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.epochEnd != null)) return [3, 3]; + return [4, logs_1.resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.epochEnd(epoch, logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onBatchBegin = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.batchBegin != null)) return [3, 3]; + return [4, logs_1.resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.batchBegin(batch, logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onBatchEnd = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.batchEnd != null)) return [3, 3]; + return [4, logs_1.resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.batchEnd(batch, logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onTrainBegin = function (logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.trainBegin != null)) return [3, 3]; + return [4, logs_1.resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.trainBegin(logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onTrainEnd = function (logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.trainEnd != null)) return [3, 3]; + return [4, logs_1.resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.trainEnd(logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + return CustomCallback; +}(BaseCallback)); +exports.CustomCallback = CustomCallback; +function standardizeCallbacks(callbacks) { + if (callbacks == null) { + return null; + } + if (callbacks instanceof BaseCallback) { + return [callbacks]; + } + if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) { + return callbacks; + } + var callbackConfigs = generic_utils.toList(callbacks); + return callbackConfigs.map(function (callbackConfig) { return new CustomCallback(callbackConfig); }); +} +exports.standardizeCallbacks = standardizeCallbacks; +//# sourceMappingURL=base_callbacks.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js.map b/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js.map new file mode 100644 index 0000000..40924e6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"base_callbacks.js","sourceRoot":"","sources":["../src/base_callbacks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AI,EAAE;QACrB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,SAAS,YAAY,YAAY,EAAE;QACrC,OAAO,CAAC,SAAyB,CAAC,CAAC;KACpC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,YAAY,YAAY,EAAE;QACpE,OAAO,SAA2B,CAAC;KACpC;IAED,IAAM,eAAe,GACjB,aAAa,CAAC,MAAM,CAAC,SAAS,CAA2B,CAAC;IAC9D,OAAO,eAAe,CAAC,GAAG,CACtB,UAAA,cAAc,IAAI,OAAA,IAAI,cAAc,CAAC,cAAc,CAAC,EAAlC,CAAkC,CAAC,CAAC;AAC5D,CAAC;AAjBD,oDAiBC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks_test.js.map new file mode 100644 index 0000000..f78eba8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/base_callbacks_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"base_callbacks_test.js","sourceRoot":"","sources":["../src/base_callbacks_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,iBA+MA;;AA/MA,mDAA6C;AAE7C,mDAAmE;AACnE,yCAAqC;AACrC,8CAAwC;AACxC,+BAAkF;AAClF,iDAAyD;AAIzD,QAAQ,CAAC,qBAAqB,EAAE;IAC9B,EAAE,CAAC,yCAAyC,EAAE,UAAM,IAAI;;;;;oBAChD,UAAU,GAAG,IAAI,2BAAU,EAAE,CAAC;oBACpC,UAAU,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,EAAC,CAAC,CAAC;oBACtD,WAAM,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,EAAA;;oBAAhC,SAAgC,CAAC;oBACjC,WAAM,UAAU,CAAC,YAAY,CA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,IAAM,aAAa,GAAG,IAAI,YAAY,EAAE,CAAC;QACzC,IAAM,YAAY,GAAG,IAAI,6BAAY,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC;QACtE,IAAM,KAAK,GAAG,IAAI,SAAS,CAAC,YAAY,CAAC,CAAC;QAC1C,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3C,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/callbacks.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/callbacks.d.ts new file mode 100644 index 0000000..115d7ca --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/callbacks.d.ts @@ -0,0 +1,7 @@ +import { BaseCallback } from './base_callbacks'; +import { Container } from './engine/container'; +import { Model } from './engine/training'; +export declare abstract class Callback extends BaseCallback { + model: Model; + setModel(model: Container): void; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js b/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js new file mode 100644 index 0000000..59a42d7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js @@ -0,0 +1,31 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var base_callbacks_1 = require("./base_callbacks"); +var training_1 = require("./engine/training"); +var Callback = (function (_super) { + __extends(Callback, _super); + function Callback() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.model = null; + return _this; + } + Callback.prototype.setModel = function (model) { + if (!(model instanceof training_1.Model)) { + throw new Error('model must be a Model, not some other Container'); + } + this.model = model; + }; + return Callback; +}(base_callbacks_1.BaseCallback)); +exports.Callback = Callback; +//# sourceMappingURL=callbacks.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js.map b/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js.map new file mode 100644 index 0000000..a92ad7a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/callbacks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"callbacks.js","sourceRoot":"","sources":["../src/callbacks.ts"],"names":[],"mappings":";;;;;;;;;;;;AAYA,mDAA8C;AAE9C,8CAAwC;AAExC;IAAuC,4BAAY;IAAnD;QAAA,qEAUC;QARC,WAAK,GAAU,IAAI,CAAC;;IAQtB,CAAC;IANC,2BAAQ,GAAR,UAAS,KAAgB;QACvB,IAAI,CAAC,CAAC,KAAK,YAAY,gBAAK,CAAC,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;SACpE;QACD,IAAI,CAAC,KAAK,GAAG,KAAc,CAAC;IAC9B,CAAC;IACH,eAAC;AAAD,CAAC,AAVD,CAAuC,6BAAY,GAUlD;AAVqB,4BAAQ"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/common.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/common.d.ts new file mode 100644 index 0000000..54cad85 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/common.d.ts @@ -0,0 +1,13 @@ +export declare type DataFormat = 'channelsFirst' | 'channelsLast'; +export declare const VALID_DATA_FORMAT_VALUES: string[]; +export declare function checkDataFormat(value?: string): void; +export declare type PaddingMode = 'valid' | 'same' | 'causal'; +export declare const VALID_PADDING_MODE_VALUES: string[]; +export declare function checkPaddingMode(value?: string): void; +export declare type PoolMode = 'max' | 'avg'; +export declare const VALID_POOL_MODE_VALUES: string[]; +export declare function checkPoolMode(value?: string): void; +export declare function nameScope(name: string, fn: () => T): T; +export declare function getScopedTensorName(tensorName: string): string; +export declare function getUniqueTensorName(scopedName: string): string; +export declare function isValidTensorName(name: string): boolean; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/common.js b/node_modules/@tensorflow/tfjs-layers/dist/common.js new file mode 100644 index 0000000..d75d92b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/common.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var generic_utils_1 = require("./utils/generic_utils"); +var nameMap = new Map(); +exports.VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast']; +function checkDataFormat(value) { + generic_utils_1.checkStringTypeUnionValue(exports.VALID_DATA_FORMAT_VALUES, 'DataFormat', value); +} +exports.checkDataFormat = checkDataFormat; +exports.VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal']; +function checkPaddingMode(value) { + generic_utils_1.checkStringTypeUnionValue(exports.VALID_PADDING_MODE_VALUES, 'PaddingMode', value); +} +exports.checkPaddingMode = checkPaddingMode; +exports.VALID_POOL_MODE_VALUES = ['max', 'avg']; +function checkPoolMode(value) { + generic_utils_1.checkStringTypeUnionValue(exports.VALID_POOL_MODE_VALUES, 'PoolMode', value); +} +exports.checkPoolMode = checkPoolMode; +var _nameScopeStack = []; +var _nameScopeDivider = '/'; +function nameScope(name, fn) { + _nameScopeStack.push(name); + try { + var val = fn(); + _nameScopeStack.pop(); + return val; + } + catch (e) { + _nameScopeStack.pop(); + throw e; + } +} +exports.nameScope = nameScope; +function currentNameScopePrefix() { + if (_nameScopeStack.length === 0) { + return ''; + } + else { + return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider; + } +} +function getScopedTensorName(tensorName) { + if (!isValidTensorName(tensorName)) { + throw new Error('Not a valid tensor name: \'' + tensorName + '\''); + } + return currentNameScopePrefix() + tensorName; +} +exports.getScopedTensorName = getScopedTensorName; +function getUniqueTensorName(scopedName) { + if (!isValidTensorName(scopedName)) { + throw new Error('Not a valid tensor name: \'' + scopedName + '\''); + } + if (!nameMap.has(scopedName)) { + nameMap.set(scopedName, 0); + } + var index = nameMap.get(scopedName); + nameMap.set(scopedName, nameMap.get(scopedName) + 1); + if (index > 0) { + var result = scopedName + '_' + index; + nameMap.set(result, 1); + return result; + } + else { + return scopedName; + } +} +exports.getUniqueTensorName = getUniqueTensorName; +var tensorNameRegex = new RegExp(/^[A-Za-z][A-Za-z0-9\._\/]*$/); +function isValidTensorName(name) { + return name.match(tensorNameRegex) ? true : false; +} +exports.isValidTensorName = isValidTensorName; +//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/common.js.map b/node_modules/@tensorflow/tfjs-layers/dist/common.js.map new file mode 100644 index 0000000..41afc3b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/common.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAaA,uDAAgE;AAIhE,IAAM,OAAO,GAAwB,IAAI,GAAG,EAAkB,CAAC;AAMlD,QAAA,wBAAwB,GAAG,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;AAC1E,yBAAgC,KAAc;IAC5C,yCAAyB,CAAC,gCAAwB,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;AAC3E,CAAC;AAFD,0CAEC;AAIY,QAAA,yBAAyB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AACrE,0BAAiC,KAAc;IAC7C,yCAAyB,CAAC,iCAAyB,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;AAC7E,CAAC;AAFD,4CAEC;AAIY,QAAA,sBAAsB,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC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CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAErD,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,IAAM,MAAM,GAAG,UAAU,GAAG,GAAG,GAAG,KAAK,CAAC;QAGxC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;KACf;SAAM;QACL,OAAO,UAAU,CAAC;KACnB;AACH,CAAC;AAnBD,kDAmBC;AAED,IAAM,eAAe,GAAG,IAAI,MAAM,CAAC,6BAA6B,CAAC,CAAC;AAOlE,2BAAkC,IAAY;IAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC;AAFD,8CAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/common_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/common_test.js.map new file mode 100644 index 0000000..19e0ed7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/common_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common_test.js","sourceRoot":"","sources":["../src/common_test.ts"],"names":[],"mappings":";;AAeA,mCAA+L;AAI/L,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,cAAc,EAAE;QACjB,IAAM,cAAc,GAAG,iCAAwB,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;QAC1E,KAAyB,UAAc,EAAd,iCAAc,EAAd,4BAAc,EAAd,IAAc;YAAlC,IAAM,UAAU,uBAAA;YAEnB,wBAAe,CAAC,UAAU,CAAC,CAAC;SAC7B;IACH,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gBAAgB,EAAE;QAEnB,MAAM,CAAC,cAAM,OAAA,wBAAe,CAAC,KAAK,CAAC,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AC,MAAM,CAAC,CAAC;QAClD,MAAM,CAAC,4BAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,CAAC,4BAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,CAAC,4BAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,CAAC,4BAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,CAAC,4BAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,CAAC,4BAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/constraints.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/constraints.d.ts new file mode 100644 index 0000000..7591604 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/constraints.d.ts @@ -0,0 +1,61 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +export declare abstract class Constraint extends serialization.Serializable { + abstract apply(w: Tensor): Tensor; + getConfig(): serialization.ConfigDict; +} +export interface MaxNormConfig { + maxValue?: number; + axis?: number; +} +export declare class MaxNorm extends Constraint { + static readonly className: string; + private maxValue; + private axis; + private readonly defaultMaxValue; + private readonly defaultAxis; + constructor(config: MaxNormConfig); + apply(w: Tensor): Tensor; + getConfig(): serialization.ConfigDict; +} +export interface UnitNormConfig { + axis?: number; +} +export declare class UnitNorm extends Constraint { + static readonly className: string; + private axis; + private readonly defaultAxis; + constructor(config: UnitNormConfig); + apply(w: Tensor): Tensor; + getConfig(): serialization.ConfigDict; +} +export declare class NonNeg extends Constraint { + static readonly className: string; + apply(w: Tensor): Tensor; +} +export interface MinMaxNormConfig { + minValue?: number; + maxValue?: number; + axis?: number; + rate?: number; +} +export declare class MinMaxNorm extends Constraint { + static readonly className: string; + private minValue; + private maxValue; + private rate; + private axis; + private readonly defaultMinValue; + private readonly defaultMaxValue; + private readonly defaultRate; + private readonly defaultAxis; + constructor(config: MinMaxNormConfig); + apply(w: Tensor): Tensor; + getConfig(): serialization.ConfigDict; +} +export declare type ConstraintIdentifier = 'maxNorm' | 'minMaxNorm' | 'nonNeg' | 'unitNorm' | string; +export declare const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP: { + [identifier in ConstraintIdentifier]: string; +}; +export declare function serializeConstraint(constraint: Constraint): serialization.ConfigDictValue; +export declare function deserializeConstraint(config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): Constraint; +export declare function getConstraint(identifier: ConstraintIdentifier | serialization.ConfigDict | Constraint): Constraint; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/constraints.js b/node_modules/@tensorflow/tfjs-layers/dist/constraints.js new file mode 100644 index 0000000..d7f13ab --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/constraints.js @@ -0,0 +1,163 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var common_1 = require("./backend/common"); +var state_1 = require("./backend/state"); +var generic_utils_1 = require("./utils/generic_utils"); +function calcL2Norms(w, axis) { + return tfjs_core_1.tidy(function () { return tfc.sqrt(tfc.sum(tfc.mulStrict(w, w), axis, true)); }); +} +var Constraint = (function (_super) { + __extends(Constraint, _super); + function Constraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + Constraint.prototype.getConfig = function () { + return {}; + }; + return Constraint; +}(tfjs_core_1.serialization.Serializable)); +exports.Constraint = Constraint; +var MaxNorm = (function (_super) { + __extends(MaxNorm, _super); + function MaxNorm(config) { + var _this = _super.call(this) || this; + _this.defaultMaxValue = 2; + _this.defaultAxis = 0; + _this.maxValue = + config.maxValue != null ? config.maxValue : _this.defaultMaxValue; + _this.axis = config.axis != null ? config.axis : _this.defaultAxis; + return _this; + } + MaxNorm.prototype.apply = function (w) { + var _this = this; + return tfjs_core_1.tidy(function () { + var norms = calcL2Norms(w, _this.axis); + var desired = tfc.clipByValue(norms, 0, _this.maxValue); + return tfc.mul(w, tfc.div(desired, tfc.add(state_1.getScalar(common_1.epsilon()), norms))); + }); + }; + MaxNorm.prototype.getConfig = function () { + return { maxValue: this.maxValue, axis: this.axis }; + }; + MaxNorm.className = 'MaxNorm'; + return MaxNorm; +}(Constraint)); +exports.MaxNorm = MaxNorm; +tfjs_core_1.serialization.SerializationMap.register(MaxNorm); +var UnitNorm = (function (_super) { + __extends(UnitNorm, _super); + function UnitNorm(config) { + var _this = _super.call(this) || this; + _this.defaultAxis = 0; + _this.axis = config.axis != null ? config.axis : _this.defaultAxis; + return _this; + } + UnitNorm.prototype.apply = function (w) { + var _this = this; + return tfjs_core_1.tidy(function () { return tfc.div(w, tfc.add(state_1.getScalar(common_1.epsilon()), calcL2Norms(w, _this.axis))); }); + }; + UnitNorm.prototype.getConfig = function () { + return { axis: this.axis }; + }; + UnitNorm.className = 'UnitNorm'; + return UnitNorm; +}(Constraint)); +exports.UnitNorm = UnitNorm; +tfjs_core_1.serialization.SerializationMap.register(UnitNorm); +var NonNeg = (function (_super) { + __extends(NonNeg, _super); + function NonNeg() { + return _super !== null && _super.apply(this, arguments) || this; + } + NonNeg.prototype.apply = function (w) { + return tfc.relu(w); + }; + NonNeg.className = 'NonNeg'; + return NonNeg; +}(Constraint)); +exports.NonNeg = NonNeg; +tfjs_core_1.serialization.SerializationMap.register(NonNeg); +var MinMaxNorm = (function (_super) { + __extends(MinMaxNorm, _super); + function MinMaxNorm(config) { + var _this = _super.call(this) || this; + _this.defaultMinValue = 0.0; + _this.defaultMaxValue = 1.0; + _this.defaultRate = 1.0; + _this.defaultAxis = 0; + _this.minValue = + config.minValue != null ? config.minValue : _this.defaultMinValue; + _this.maxValue = + config.maxValue != null ? config.maxValue : _this.defaultMaxValue; + _this.rate = config.rate != null ? config.rate : _this.defaultRate; + _this.axis = config.axis != null ? config.axis : _this.defaultAxis; + return _this; + } + MinMaxNorm.prototype.apply = function (w) { + var _this = this; + return tfjs_core_1.tidy(function () { + var norms = calcL2Norms(w, _this.axis); + var desired = tfc.add(tfc.mul(state_1.getScalar(_this.rate), tfc.clipByValue(norms, _this.minValue, _this.maxValue)), tfc.mul(state_1.getScalar(1.0 - _this.rate), norms)); + return tfc.mul(w, tfc.div(desired, tfc.add(state_1.getScalar(common_1.epsilon()), norms))); + }); + }; + MinMaxNorm.prototype.getConfig = function () { + return { + minValue: this.minValue, + maxValue: this.maxValue, + rate: this.rate, + axis: this.axis + }; + }; + MinMaxNorm.className = 'MinMaxNorm'; + return MinMaxNorm; +}(Constraint)); +exports.MinMaxNorm = MinMaxNorm; +tfjs_core_1.serialization.SerializationMap.register(MinMaxNorm); +exports.CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP = { + 'maxNorm': 'MaxNorm', + 'minMaxNorm': 'MinMaxNorm', + 'nonNeg': 'NonNeg', + 'unitNorm': 'UnitNorm' +}; +function serializeConstraint(constraint) { + return generic_utils_1.serializeKerasObject(constraint); +} +exports.serializeConstraint = serializeConstraint; +function deserializeConstraint(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return generic_utils_1.deserializeKerasObject(config, tfjs_core_1.serialization.SerializationMap.getMap().classNameMap, customObjects, 'constraint'); +} +exports.deserializeConstraint = deserializeConstraint; +function getConstraint(identifier) { + if (identifier == null) { + return null; + } + if (typeof identifier === 'string') { + var className = identifier in exports.CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ? + exports.CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : + identifier; + var config = { className: className, config: {} }; + return deserializeConstraint(config); + } + else if (identifier instanceof Constraint) { + return identifier; + } + else { + return deserializeConstraint(identifier); + } +} +exports.getConstraint = getConstraint; +//# sourceMappingURL=constraints.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/constraints.js.map b/node_modules/@tensorflow/tfjs-layers/dist/constraints.js.map new file mode 100644 index 0000000..46465f3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/constraints.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constraints.js","sourceRoot":"","sources":["../src/constraints.ts"],"names":[],"mappings":";;;;;;;;;;;;AAaA,2CAA6C;AAC7C,mDAAkE;AAElE,2CAAyC;AACzC,yCAA0C;AAC1C,uDAAmF;AAMnF,qBAAqB,CAAS,EAAE,IAAY;IAC1C,OAAO,gBAAI,CAAC,cAAM,OAAA,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAlD,CAAkD,CAAC,CAAC;AACxE,CAAC;AAYD;IAAyC,8BAA0B;IAAnE;;IAMA,CAAC;IAHC,8BAAS,GAAT;QACE,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,iBAAC;AAAD,CAAC,AAND,CAAyC,yBAAa,CAAC,YAAY,GAMlE;AANqB,gCAAU;AAyChC;IAA6B,2BAAU;IAOrC,iBAAY,MAAqB;QAAjC,YACE,iBAAO,SAIR;QARgB,qBAAe,GAAG,CAAC,CAAC;QACpB,iBAAW,GAAG,CAAC,CAAC;QAI/B,KAAI,CAAC,QAAQ;YACT,M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modules/@tensorflow/tfjs-layers/dist/constraints_test.js.map new file mode 100644 index 0000000..8acfad6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/constraints_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constraints_test.js","sourceRoot":"","sources":["../src/constraints_test.ts"],"names":[],"mappings":";;AAaA,mDAAwE;AAExE,6CAA8G;AAC9G,6BAA+B;AAC/B,iDAA8F;AAI9F,4BAAe,CAAC,sBAAsB,EAAE;IACtC,IAAI,QAAkB,CAAC;IACvB,UAAU,CAAC;QACT,QAAQ,GAAG,oBAAQ,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,QAAQ,EAAE;QACX,IAAM,UAAU,GAAG,2BAAa,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAClD,+BAAkB,CACd,cAAc,EAAE,oBAAQ,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,kCAAqB,CAAC,cAAM,OAAA,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,EAA1B,CAA0B,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,SAAS,EAAE;QACZ,IAAM,UAAU,GAAG,2BAAa,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAClD,+BAAkB,CAAC,cAAc,EAAE,oBAAQ,CAAC,IAAI,YAAY,CAAC;YACxC,CAAC,YAAY,EAAE,YAAY,EAAE,C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MAAM,EAAE,CAAC;QAChD,MAAM,CAAC,2BAAa,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gBAAgB,EAAE;QACnB,IAAM,cAAc,GAAG,GAAG,CAAC,WAAW,CAAC,UAAU,CAC7C,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QAClD,IAAM,UAAU,GAAG,2BAAa,CAC5B,iCAAmB,CAAC,cAAc,CAA6B,CAAC,CAAC;QACrE,MAAM,CAAC,iCAAmB,CAAC,UAAU,CAAC,CAAC;aAClC,OAAO,CAAC,iCAAmB,CAAC,cAAc,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,2BAA2B,EAAE;IACpC,EAAE,CAAC,WAAW,EAAE;QAEd,IAAM,WAAW,GAA2B;YAC1C,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ;YAClE,UAAU,EAAE,YAAY;SACzB,CAAC;QACF,KAAmB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;YAAzB,IAAM,MAAI,oBAAA;YACb,IAAM,UAAU,GAAG,2BAAa,CAAC,MAAI,CAAC,CAAC;YACvC,IAAM,MAAM,GACR,iCAAmB,CAAC,UAAU,CAA6B,CAAC;YAChE,IAAM,aAAa,GAAG,mCAAqB,CAAC,MAAM,CAAC,CAAC;YACpD,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/container.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/engine/container.d.ts new file mode 100644 index 0000000..7c29564 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/container.d.ts @@ -0,0 +1,53 @@ +import { Scalar, serialization, Tensor } from '@tensorflow/tfjs-core'; +import { JsonDict, Kwargs, NamedTensorMap, Shape } from '../types'; +import { LayerVariable } from '../variables'; +import { Layer, Node, SymbolicTensor } from './topology'; +export declare function loadWeightsFromJson(weightsJSON: JsonDict, layers: Layer[], skipMismatch?: boolean): void; +export declare function loadWeightsFromNamedTensorMap(weights: NamedTensorMap, layers: Layer[]): void; +export interface ContainerConfig { + inputs: SymbolicTensor | SymbolicTensor[]; + outputs: SymbolicTensor | SymbolicTensor[]; + name?: string; +} +export declare abstract class Container extends Layer { + inputs: SymbolicTensor[]; + outputs: SymbolicTensor[]; + inputLayers: Layer[]; + inputLayersNodeIndices: number[]; + inputLayersTensorIndices: number[]; + outputLayers: Layer[]; + outputLayersNodeIndices: number[]; + outputLayersTensorIndices: number[]; + layers: Layer[]; + layersByDepth: { + [depth: string]: Layer[]; + }; + nodesByDepth: { + [depth: string]: Node[]; + }; + containerNodes: Set; + inputNames: string[]; + outputNames: string[]; + feedInputShapes: Shape[]; + protected internalInputShapes: Shape[]; + protected internalOutputShapes: Shape[]; + protected feedInputNames: string[]; + protected feedOutputNames: string[]; + constructor(config: ContainerConfig); + readonly trainableWeights: LayerVariable[]; + readonly nonTrainableWeights: LayerVariable[]; + readonly weights: LayerVariable[]; + loadWeights(weightsJSON: JsonDict | NamedTensorMap, skipMismatch?: boolean, isNamedTensorMap?: boolean): void; + private updatedConfig(); + toJSON(unused?: any, returnString?: boolean): string | JsonDict; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor | Tensor[]; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]): [Tensor[], Tensor[], Shape[]]; + private buildNodeConversionMap(layers); + getLayer(name?: string, index?: number): Layer; + calculateLosses(): Scalar[]; + getConfig(): serialization.ConfigDict; + static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; + readonly stateful: boolean; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js b/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js new file mode 100644 index 0000000..a25306a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js @@ -0,0 +1,895 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("../backend/state"); +var errors_1 = require("../errors"); +var serialization_1 = require("../layers/serialization"); +var generic_utils = require("../utils/generic_utils"); +var serialization_utils_1 = require("../utils/serialization_utils"); +var types_utils = require("../utils/types_utils"); +var variables_1 = require("../variables"); +var version_1 = require("../version"); +var input_layer_1 = require("./input_layer"); +var topology_1 = require("./topology"); +function preprocessWeightsForLoading(layer, weights, originalKerasVersion, originalBackend) { + if (!originalKerasVersion.startsWith('2.')) { + throw new errors_1.ValueError('Unsupported Keras version in weights being loaded: ' + + originalKerasVersion); + } + return weights; +} +function loadTensor(dtype, shape, value) { + var dataType = generic_utils.stringToDType(dtype); + return tfjs_core_1.Tensor.make(shape, { values: shape.length === 0 ? value : tfjs_core_1.util.flatten(value) }, dataType); +} +function loadWeightsFromJson(weightsJSON, layers, skipMismatch) { + if (skipMismatch === void 0) { skipMismatch = false; } + var originalKerasVersion = weightsJSON['keras_version']; + var originalBackend = weightsJSON['backend']; + var layerNames = layers.map(function (layer) { return layer.name; }); + var index = {}; + for (var _i = 0, layers_1 = layers; _i < layers_1.length; _i++) { + var layer = layers_1[_i]; + if (layer.name != null) { + if (index[layer.name] == null) { + index[layer.name] = []; + } + index[layer.name].push(layer); + } + } + var nameToWeights = weightsJSON['weights']; + var weightValueTuples = []; + for (var k = 0; k < layerNames.length; ++k) { + var name_1 = layerNames[k]; + var layerWeights = nameToWeights[name_1]; + if (layerWeights == null) { + layerWeights = []; + } + var weightValues = []; + for (var n = 0; n < layerWeights.length; ++n) { + var weightEntry = layerWeights[n]; + weightValues.push(new variables_1.LayerVariable(loadTensor(weightEntry['dtype'], weightEntry['shape'], weightEntry['value']))); + } + for (var _a = 0, _b = index[name_1]; _a < _b.length; _a++) { + var layer = _b[_a]; + var symbolicWeights = layer.weights; + weightValues = preprocessWeightsForLoading(layer, weightValues, originalKerasVersion, originalBackend); + if (weightValues.length !== symbolicWeights.length) { + if (skipMismatch) { + console.warn("Skipping loading of weights of layer " + layer.name + " " + + ("due to mismatch in number of weights: (" + weightValues.length + " ") + + ("vs " + symbolicWeights.length + ").")); + } + else { + throw new errors_1.ValueError("Layer #" + k + " (named \"" + layer.name + "\") expects " + + (symbolicWeights.length + " weight(s), but the saved weights ") + + ("have " + weightValues.length + " element(s).")); + } + } + for (var i = 0; i < weightValues.length; ++i) { + if (skipMismatch) { + if (!tfjs_core_1.util.arraysEqual(symbolicWeights[i].shape, weightValues[i].shape)) { + console.warn("Skipping loading of weights for layer " + layer.name + " due " + + ("to mismatch in shape (" + symbolicWeights[i].shape + " vs ") + + (weightValues[i].shape + ")")); + continue; + } + } + weightValueTuples.push([symbolicWeights[i], weightValues[i].read()]); + } + } + } + variables_1.batchSetValue(weightValueTuples); +} +exports.loadWeightsFromJson = loadWeightsFromJson; +function loadWeightsFromNamedTensorMap(weights, layers) { + var nameToWeight = {}; + var totalWeightsCount = 0; + for (var _i = 0, layers_2 = layers; _i < layers_2.length; _i++) { + var layer = layers_2[_i]; + for (var _a = 0, _b = layer.weights; _a < _b.length; _a++) { + var weight = _b[_a]; + if (nameToWeight[weight.originalName] != null) { + throw new errors_1.ValueError("Duplicate weight name: " + weight.originalName); + } + nameToWeight[weight.originalName] = weight; + totalWeightsCount++; + } + } + var weightValueTuples = []; + for (var name_2 in weights) { + weightValueTuples.push([nameToWeight[name_2], weights[name_2]]); + delete nameToWeight[name_2]; + } + var unsetNames = []; + for (var name_3 in nameToWeight) { + unsetNames.push(name_3); + } + if (unsetNames.length > 0) { + throw new errors_1.ValueError(unsetNames.length + " of " + totalWeightsCount + " weights are not set: " + + ("" + unsetNames)); + } + variables_1.batchSetValue(weightValueTuples); +} +exports.loadWeightsFromNamedTensorMap = loadWeightsFromNamedTensorMap; +var Container = (function (_super) { + __extends(Container, _super); + function Container(config) { + var _this = _super.call(this, {}) || this; + _this.containerNodes = new Set(); + _this.name = config.name; + if (_this.name == null) { + var prefix = _this.getClassName().toLowerCase(); + _this.name = state_1.getUid(prefix); + } + _this.supportsMasking = false; + _this.trainable = true; + _this.updatable = true; + if (Array.isArray(config.inputs)) { + _this.inputs = config.inputs.slice(); + } + else { + _this.inputs = [config.inputs]; + } + if (Array.isArray(config.outputs)) { + _this.outputs = config.outputs.slice(); + } + else { + _this.outputs = [config.outputs]; + } + if (generic_utils.unique(_this.inputs).length !== _this.inputs.length) { + throw new errors_1.ValueError('The list of inputs passed to the model is ' + + 'redundant. All inputs should only appear once. Found: ' + + _this.inputs.map(function (x) { return x.name; })); + } + if (generic_utils.unique(_this.outputs).length !== _this.outputs.length) { + console.warn('The list of outputs passed to the model is redundant. ' + + 'All outputs should only appear once. Found: ' + + _this.outputs.map(function (x) { return x.name; })); + } + _this.inputLayers = []; + _this.inputLayersNodeIndices = []; + _this.inputLayersTensorIndices = []; + _this.outputLayers = []; + _this.outputLayersNodeIndices = []; + _this.outputLayersTensorIndices = []; + _this.layers = []; + for (var _i = 0, _a = _this.outputs; _i < _a.length; _i++) { + var x = _a[_i]; + var layer = x.sourceLayer; + var nodeIndex = x.nodeIndex; + var tensorIndex = x.tensorIndex; + _this.outputLayers.push(layer); + _this.outputLayersNodeIndices.push(nodeIndex); + _this.outputLayersTensorIndices.push(tensorIndex); + } + for (var _b = 0, _c = _this.inputs; _b < _c.length; _b++) { + var x = _c[_b]; + var layer = x.sourceLayer; + var nodeIndex = x.nodeIndex; + var tensorIndex = x.tensorIndex; + generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes'); + generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors'); + _this.inputLayers.push(layer); + _this.inputLayersNodeIndices.push(nodeIndex); + _this.inputLayersTensorIndices.push(tensorIndex); + } + _this.inputNames = []; + _this.outputNames = []; + _this.feedInputShapes = []; + _this.feedInputNames = []; + _this.feedOutputNames = []; + for (var i = 0; i < _this.inputLayers.length; i++) { + var layer = _this.inputLayers[i]; + if (!(layer instanceof input_layer_1.InputLayer)) { + throw new TypeError('Input layers to a Model must be InputLayer objects. ' + + ("Received inputs: " + config.inputs + ". ") + + ("Input " + i + " (0-based) originates ") + + ("from layer type " + layer.getClassName() + ".")); + } + _this.inputNames.push(layer.name); + _this.feedInputShapes.push(layer.batchInputShape); + _this.feedInputNames.push(layer.name); + } + for (var _d = 0, _e = _this.outputLayers; _d < _e.length; _d++) { + var layer = _e[_d]; + _this.outputNames.push(layer.name); + } + _this.internalInputShapes = _this.inputs.map(function (x) { return x.shape; }); + _this.internalOutputShapes = _this.outputs.map(function (x) { return x.shape; }); + var nodesDepths = {}; + var nodeIDToNode = {}; + var layersDepths = {}; + var layerIDToLayer = {}; + var layerIndices = {}; + var nodesInDecreasingDepth = []; + var buildMapOfGraph = function (tensor, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex) { + if (layer == null || nodeIndex == null || tensorIndex == null) { + layer = tensor.sourceLayer; + nodeIndex = tensor.nodeIndex; + tensorIndex = tensor.tensorIndex; + } + var node = layer.inboundNodes[nodeIndex]; + if (nodesInProgress.indexOf(node) !== -1) { + throw new errors_1.RuntimeError("The tensor " + tensor.name + " at layer \"" + layer.name + "\" " + + 'is part of a cycle.'); + } + if (finishedNodes.indexOf(node) !== -1) { + return; + } + _this.containerNodes.add(Container.nodeKey(layer, nodeIndex)); + if (!(layer.id in layerIndices)) { + layerIndices[layer.id] = Object.keys(layerIndices).length; + } + if (nodesInProgress.indexOf(node) === -1) { + nodesInProgress.push(node); + } + var numInboundLayers = node.inboundLayers.length; + for (var i = 0; i < numInboundLayers; i++) { + var x = node.inputTensors[i]; + var layer_1 = node.inboundLayers[i]; + var nodeIndex_1 = node.nodeIndices[i]; + var tensorIndex_1 = node.tensorIndices[i]; + buildMapOfGraph(x, finishedNodes, nodesInProgress, layer_1, nodeIndex_1, tensorIndex_1); + } + finishedNodes.push(node); + while (nodesInProgress.indexOf(node) >= 0) { + nodesInProgress.splice(nodesInProgress.indexOf(node), 1); + } + nodesInDecreasingDepth.push(node); + }; + var finishedNodes = []; + var nodesInProgress = []; + for (var _f = 0, _g = _this.outputs; _f < _g.length; _f++) { + var x = _g[_f]; + buildMapOfGraph(x, finishedNodes, nodesInProgress); + } + var reversedNodesInDecreasingDepth = nodesInDecreasingDepth.slice().reverse(); + for (var _h = 0, reversedNodesInDecreasingDepth_1 = reversedNodesInDecreasingDepth; _h < reversedNodesInDecreasingDepth_1.length; _h++) { + var node = reversedNodesInDecreasingDepth_1[_h]; + nodeIDToNode[node.id] = node; + if (!(node.id in nodesDepths)) { + nodesDepths[node.id] = 0; + } + var depth = nodesDepths[node.id]; + var previousDepth = (layersDepths[node.outboundLayer.id] == null ? + 0 : + layersDepths[node.outboundLayer.id]); + depth = Math.max(depth, previousDepth); + layersDepths[node.outboundLayer.id] = depth; + layerIDToLayer[node.outboundLayer.id] = node.outboundLayer; + nodesDepths[node.id] = depth; + for (var i = 0; i < node.inboundLayers.length; i++) { + var inboundLayer = node.inboundLayers[i]; + var nodeIndex = node.nodeIndices[i]; + var inboundNode = inboundLayer.inboundNodes[nodeIndex]; + var previousDepth_1 = (nodesDepths[inboundNode.id] == null ? 0 : + nodesDepths[inboundNode.id]); + nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth_1); + nodeIDToNode[inboundNode.id] = inboundNode; + } + } + var nodesByDepth = {}; + for (var nodeID in nodesDepths) { + var depth = nodesDepths[nodeID]; + if (!(depth in nodesByDepth)) { + nodesByDepth[depth] = []; + } + nodesByDepth[depth].push(nodeIDToNode[nodeID]); + } + var layersByDepth = {}; + for (var layerID in layersDepths) { + var depth = layersDepths[layerID]; + if (!(depth in layersByDepth)) { + layersByDepth[depth] = []; + } + layersByDepth[depth].push(layerIDToLayer[layerID]); + } + var depthKeys = Object.keys(layersByDepth) + .map(function (x) { return parseInt(x, 10); }) + .sort(generic_utils.reverseNumberCompare); + _this.layers = []; + for (var _j = 0, depthKeys_1 = depthKeys; _j < depthKeys_1.length; _j++) { + var depth = depthKeys_1[_j]; + var layersForDepth = layersByDepth[depth]; + layersForDepth.sort(function (a, b) { + var aIndex = layerIndices[a.id]; + var bIndex = layerIndices[b.id]; + if (aIndex < bIndex) { + return -1; + } + if (aIndex > bIndex) { + return 1; + } + return 0; + }); + for (var _k = 0, layersForDepth_1 = layersForDepth; _k < layersForDepth_1.length; _k++) { + var layer = layersForDepth_1[_k]; + _this.layers.push(layer); + } + } + _this.layersByDepth = layersByDepth; + depthKeys = Object.keys(nodesByDepth) + .map(function (x) { return parseInt(x, 10); }) + .sort(generic_utils.reverseNumberCompare); + var computableTensors = _this.inputs.slice(); + var layersWithCompleteInput = []; + for (var _l = 0, depthKeys_2 = depthKeys; _l < depthKeys_2.length; _l++) { + var depth = depthKeys_2[_l]; + for (var _m = 0, _o = nodesByDepth[depth]; _m < _o.length; _m++) { + var node = _o[_m]; + var layer = node.outboundLayer; + if (layer != null) { + for (var _p = 0, _q = node.inputTensors; _p < _q.length; _p++) { + var x = _q[_p]; + if (computableTensors.indexOf(x) === -1) { + throw new errors_1.RuntimeError("Graph disconnected: cannot obtain value for tensor " + x + + (" at layer \"" + layer.name + "\". ") + + 'The following previous layers were accessed without ' + + ("issue: " + layersWithCompleteInput)); + } + } + for (var _r = 0, _s = node.outputTensors; _r < _s.length; _r++) { + var x = _s[_r]; + computableTensors.push(x); + } + layersWithCompleteInput.push(layer.name); + } + } + } + _this.nodesByDepth = nodesByDepth; + var allNames = _this.layers.map(function (x) { return x.name; }); + var _loop_1 = function (name_4) { + var numOccurrences = allNames.filter(function (x) { return x === name_4; }).length; + if (numOccurrences !== 1) { + throw new errors_1.RuntimeError("The name \"" + name_4 + "\" is used " + numOccurrences + " times " + + 'in the model. All layer names should be unique. Layer names: ' + + JSON.stringify(allNames)); + } + }; + for (var _t = 0, allNames_1 = allNames; _t < allNames_1.length; _t++) { + var name_4 = allNames_1[_t]; + _loop_1(name_4); + } + _this.outboundNodes = []; + _this.inboundNodes = []; + new topology_1.Node({ + outboundLayer: _this, + inboundLayers: [], + nodeIndices: [], + tensorIndices: [], + inputTensors: _this.inputs, + outputTensors: _this.outputs, + inputMasks: _this.inputs.map(function (x) { return null; }), + outputMasks: _this.outputs.map(function (x) { return null; }), + inputShapes: _this.inputs.map(function (x) { return x.shape; }), + outputShapes: _this.outputs.map(function (x) { return x.shape; }) + }); + _this.built = true; + return _this; + } + Object.defineProperty(Container.prototype, "trainableWeights", { + get: function () { + if (this._trainableWeights.length > 0) { + throw new errors_1.ValueError('Container instance unexpectedly contains _trainableWeights.' + + 'The trainable weights of a Container are a union of the ' + + 'trainable weights of its consituent Layers. Its own ' + + '_trainableWeights must remain an empty Array.'); + } + if (!this.trainable) { + return []; + } + var weights = []; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + weights = weights.concat(layer.trainableWeights); + } + return weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Container.prototype, "nonTrainableWeights", { + get: function () { + var weights = []; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + weights.push.apply(weights, layer.nonTrainableWeights); + } + if (!this.trainable) { + var trainableWeights = []; + for (var _b = 0, _c = this.layers; _b < _c.length; _b++) { + var layer = _c[_b]; + trainableWeights.push.apply(trainableWeights, layer.trainableWeights); + } + return trainableWeights.concat(weights); + } + return weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Container.prototype, "weights", { + get: function () { + return this.trainableWeights.concat(this.nonTrainableWeights); + }, + enumerable: true, + configurable: true + }); + Container.prototype.loadWeights = function (weightsJSON, skipMismatch, isNamedTensorMap) { + if (skipMismatch === void 0) { skipMismatch = false; } + if (isNamedTensorMap === void 0) { isNamedTensorMap = false; } + if (isNamedTensorMap) { + loadWeightsFromNamedTensorMap(weightsJSON, this.layers); + } + else { + loadWeightsFromJson(weightsJSON, this.layers, skipMismatch); + } + }; + Container.prototype.updatedConfig = function () { + var theConfig = this.getConfig(); + var modelConfig = { + className: this.getClassName(), + config: theConfig, + kerasVersion: "tfjs-layers " + version_1.version, + backend: 'TensorFlow.js' + }; + return modelConfig; + }; + Container.prototype.toJSON = function (unused, returnString) { + if (returnString === void 0) { returnString = true; } + var modelConfig = serialization_utils_1.convertTsToPythonic(this.updatedConfig()); + return returnString ? JSON.stringify(modelConfig) : modelConfig; + }; + Container.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = generic_utils.toList(inputs); + var masks; + if ('mask' in kwargs) { + masks = generic_utils.toList(kwargs['mask']); + } + else { + masks = generic_utils.pyListRepeat(null, inputs.length); + } + return _this.runInternalGraph(inputs, masks)[0]; + }); + }; + Container.prototype.computeMask = function (inputs, mask) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = generic_utils.toList(inputs); + var masks; + if (mask == null) { + masks = generic_utils.pyListRepeat(null, inputs.length); + } + else { + masks = generic_utils.toList(mask); + } + return _this.runInternalGraph(inputs, masks)[1]; + }); + }; + Container.prototype.computeOutputShape = function (inputShape) { + var inputShapes = types_utils.normalizeShapeList(inputShape); + if (inputShapes.length !== this.inputLayers.length) { + throw new errors_1.ValueError("Invalid inputShape argument " + inputShape + ": " + + ("model has " + this.inputLayers.length + " tensor inputs.")); + } + var layersToOutputShapes = {}; + for (var i = 0; i < inputShapes.length; i++) { + var layer = this.inputLayers[i]; + var inputShape_1 = inputShapes[i]; + var shapeKey = layer.name + '_0_0'; + layersToOutputShapes[shapeKey] = inputShape_1; + } + var depthKeys = Object.keys(this.nodesByDepth) + .map(function (x) { return parseInt(x, 10); }) + .sort(generic_utils.reverseNumberCompare); + if (depthKeys.length > 1) { + for (var _i = 0, depthKeys_3 = depthKeys; _i < depthKeys_3.length; _i++) { + var depth = depthKeys_3[_i]; + var nodes = this.nodesByDepth[depth]; + for (var _a = 0, nodes_1 = nodes; _a < nodes_1.length; _a++) { + var node = nodes_1[_a]; + var layer = node.outboundLayer; + if (this.inputLayers.map(function (x) { return x.id; }).indexOf(layer.id) !== -1) { + continue; + } + var inputShapes_1 = []; + for (var j = 0; j < node.inboundLayers.length; j++) { + var inboundLayer = node.inboundLayers[j]; + var nodeIndex_2 = node.nodeIndices[j]; + var tensorIndex = node.tensorIndices[j]; + var shapeKey = inboundLayer.name + "_" + nodeIndex_2 + "_" + tensorIndex; + var inputShape_2 = layersToOutputShapes[shapeKey]; + inputShapes_1.push(inputShape_2); + } + var outputShape = layer.computeOutputShape(generic_utils.singletonOrArray(inputShapes_1)); + var outputShapes_1 = types_utils.normalizeShapeList(outputShape); + var nodeIndex = layer.inboundNodes.indexOf(node); + for (var j = 0; j < outputShapes_1.length; j++) { + var shapeKey = layer.name + "_" + nodeIndex + "_" + j; + layersToOutputShapes[shapeKey] = outputShapes_1[j]; + } + } + } + } + var outputShapes = []; + var outputShapeKeys = []; + for (var i = 0; i < this.outputLayers.length; i++) { + var layer = this.outputLayers[i]; + var nodeIndex = this.outputLayersNodeIndices[i]; + var tensorIndex = this.outputLayersTensorIndices[i]; + var shapeKey = layer.name + "_" + nodeIndex + "_" + tensorIndex; + outputShapeKeys.push(shapeKey); + } + for (var i = 0; i < outputShapeKeys.length; i++) { + var key = outputShapeKeys[i]; + generic_utils.assert(key in layersToOutputShapes); + outputShapes.push(layersToOutputShapes[key]); + } + return generic_utils.singletonOrArray(outputShapes); + }; + Container.prototype.runInternalGraph = function (inputs, masks) { + if (masks == null) { + masks = generic_utils.pyListRepeat(null, inputs.length); + } + var tensorMap = {}; + for (var i = 0; i < this.inputs.length; ++i) { + var x = this.inputs[i]; + var y = inputs[i]; + var mask = masks[i]; + tensorMap[x.id] = [y, mask]; + } + var depthKeys = Object.keys(this.nodesByDepth) + .map(function (x) { return parseInt(x, 10); }) + .sort(generic_utils.reverseNumberCompare); + for (var _i = 0, depthKeys_4 = depthKeys; _i < depthKeys_4.length; _i++) { + var depth = depthKeys_4[_i]; + var nodes = this.nodesByDepth[depth]; + for (var _a = 0, nodes_2 = nodes; _a < nodes_2.length; _a++) { + var node = nodes_2[_a]; + var layer = node.outboundLayer; + var referenceInputTensors = node.inputTensors; + var referenceOutputTensors = node.outputTensors; + var computedData = new Array(); + for (var _b = 0, referenceInputTensors_1 = referenceInputTensors; _b < referenceInputTensors_1.length; _b++) { + var x = referenceInputTensors_1[_b]; + if (x.id in tensorMap) { + computedData.push(tensorMap[x.id]); + } + } + if (computedData.length === referenceInputTensors.length) { + var kwargs = {}; + var computedTensors = void 0; + var computedMasks = void 0; + var outputTensors_1 = void 0; + var outputMasks_1 = void 0; + if (node.callArgs != null) { + kwargs = node.callArgs; + } + if (computedData.length === 1) { + var _c = computedData[0], computedTensor = _c[0], computedMask = _c[1]; + if (kwargs.mask == null) { + kwargs['mask'] = computedMask; + } + outputTensors_1 = + generic_utils.toList(layer.call(computedTensor, kwargs)); + outputMasks_1 = generic_utils.toList(layer.computeMask(computedTensor, computedMask)); + computedTensors = [computedTensor]; + computedMasks = [computedMask]; + } + else { + computedTensors = computedData.map(function (x) { return x[0]; }); + computedMasks = computedData.map(function (x) { return x[1]; }); + if (kwargs.mask == null) { + kwargs['mask'] = computedMasks; + } + outputTensors_1 = + generic_utils.toList(layer.call(computedTensors, kwargs)); + outputMasks_1 = generic_utils.toList(layer.computeMask(computedTensors, computedMasks)); + } + if (layer.activityRegularizer) { + throw new errors_1.NotImplementedError('Model invocation with concrete Tensor value(s) in the ' + + 'presence of activity regularizer(s) is not supported yet.'); + } + for (var i = 0; i < referenceOutputTensors.length; ++i) { + var x = referenceOutputTensors[i]; + var y = outputTensors_1[i]; + var mask = outputMasks_1[i]; + tensorMap[x.id] = [y, mask]; + } + } + } + } + var outputTensors = []; + var outputMasks = []; + var outputShapes = []; + for (var _d = 0, _e = this.outputs; _d < _e.length; _d++) { + var x = _e[_d]; + generic_utils.assert(x.id in tensorMap, "Could not compute output " + x.name + " : " + x.id); + var _f = tensorMap[x.id], tensor = _f[0], mask = _f[1]; + outputShapes.push(tensor.shape); + outputTensors.push(tensor); + outputMasks.push(mask); + } + return [outputTensors, outputMasks, outputShapes]; + }; + Container.prototype.buildNodeConversionMap = function (layers) { + var nodeConversionMap = {}; + var keptNodes; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + keptNodes = layer instanceof Container ? 1 : 0; + for (var originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { + var nodeKey = Container.nodeKey(layer, originalNodeIndex); + if (nodeKey in this.containerNodes) { + nodeConversionMap[nodeKey] = keptNodes; + keptNodes += 1; + } + } + } + return nodeConversionMap; + }; + Container.prototype.getLayer = function (name, index) { + if (index != null) { + if (this.layers.length <= index) { + throw new errors_1.ValueError("Was asked to retrieve layer at index " + index + ", but model only " + + ("has " + this.layers.length + " layer(s).")); + } + else { + return this.layers[index]; + } + } + else { + if (name == null) { + throw new errors_1.ValueError('Provide either a layer name or layer index'); + } + } + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + if (layer.name === name) { + return layer; + } + } + throw new errors_1.ValueError("No such layer: " + name); + }; + Container.prototype.calculateLosses = function () { + var _this = this; + return tfjs_core_1.tidy(function () { + var losses = []; + for (var _i = 0, _a = _this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + for (var nodeIndex = 0; nodeIndex < layer.inboundNodes.length; ++nodeIndex) { + var nodeKey = Container.nodeKey(layer, nodeIndex); + if (_this.containerNodes.has(nodeKey)) { + losses.push.apply(losses, layer.calculateLosses()); + } + } + } + return losses; + }); + }; + Container.prototype.getConfig = function () { + var config = { name: this.name }; + var nodeConversionMap = this.buildNodeConversionMap(this.layers); + var layerConfigs = []; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + var layerClassName = layer.getClassName(); + var layerConfig = layer.getConfig(); + var filteredInboundNodes = []; + for (var originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { + var node = layer.inboundNodes[originalNodeIndex]; + var nodeKey = Container.nodeKey(layer, originalNodeIndex); + var kwargs = {}; + if (this.containerNodes.has(nodeKey)) { + if (node.callArgs) { + try { + JSON.stringify(node.callArgs); + kwargs = node.callArgs; + } + catch (err) { + console.warn("Layer " + layer.name + " was passed " + + "non-serializable keyword arguments: " + + (node.callArgs + ". They will not be included ") + + "in the serialized model (and thus will be " + + "missing at deserialization time)."); + kwargs = {}; + } + } + if (node.inboundLayers.length > 0) { + var nodeData = []; + for (var i = 0; i < node.inboundLayers.length; i++) { + var inboundLayer = node.inboundLayers[i]; + var nodeIndex = node.nodeIndices[i]; + var tensorIndex = node.tensorIndices[i]; + var nodeKey_1 = Container.nodeKey(inboundLayer, nodeIndex); + var newNodeIndex = nodeConversionMap[nodeKey_1]; + if (newNodeIndex === null || newNodeIndex === undefined) { + newNodeIndex = 0; + } + nodeData.push([inboundLayer.name, newNodeIndex, tensorIndex, kwargs]); + } + filteredInboundNodes.push(nodeData); + } + } + } + layerConfigs.push({ + name: layer.name, + className: layerClassName, + config: layerConfig, + inboundNodes: filteredInboundNodes + }); + } + config['layers'] = layerConfigs; + var modelInputs = []; + for (var i = 0; i < this.inputLayers.length; i++) { + var layer = this.inputLayers[i]; + var nodeIndex = this.inputLayersNodeIndices[i]; + var nodeKey = Container.nodeKey(layer, nodeIndex); + if (!this.containerNodes.has(nodeKey)) { + continue; + } + var newNodeIndex = nodeConversionMap[nodeKey]; + if (newNodeIndex === null || newNodeIndex === undefined) { + newNodeIndex = 0; + } + var tensorIndex = this.inputLayersTensorIndices[i]; + modelInputs.push([layer.name, newNodeIndex, tensorIndex]); + } + config['inputLayers'] = modelInputs; + var modelOutputs = []; + for (var i = 0; i < this.outputLayers.length; i++) { + var layer = this.outputLayers[i]; + var nodeIndex = this.outputLayersNodeIndices[i]; + var nodeKey = Container.nodeKey(layer, nodeIndex); + if (!this.containerNodes.has(nodeKey)) { + continue; + } + var newNodeIndex = nodeConversionMap[nodeKey]; + if (newNodeIndex === null || newNodeIndex === undefined) { + newNodeIndex = 0; + } + var tensorIndex = this.outputLayersTensorIndices[i]; + modelOutputs.push([layer.name, newNodeIndex, tensorIndex]); + } + config['outputLayers'] = modelOutputs; + return config; + }; + Container.fromConfig = function (cls, config) { + var createdLayers = {}; + var unprocessedNodes = {}; + function addUnprocessedNode(layer, nodeData) { + if (!(layer.name in unprocessedNodes)) { + unprocessedNodes[layer.name] = [nodeData]; + } + else { + unprocessedNodes[layer.name].push(nodeData); + } + } + function processNode(layer, nodeData) { + var inputTensors = []; + var kwargs; + for (var _i = 0, nodeData_1 = nodeData; _i < nodeData_1.length; _i++) { + var inputData = nodeData_1[_i]; + var inboundLayerName = inputData[0]; + var inboundNodeIndex = inputData[1]; + var inboundTensorIndex = inputData[2]; + if (inputData.length === 3) { + kwargs = {}; + } + else if (inputData.length === 4) { + kwargs = inputData[3]; + } + else { + throw new errors_1.ValueError("Improperly formatted model config for layer " + JSON.stringify(layer) + ": " + JSON.stringify(inputData)); + } + if (!(inboundLayerName in createdLayers)) { + addUnprocessedNode(layer, nodeData); + return; + } + var inboundLayer = createdLayers[inboundLayerName]; + if (inboundLayer.inboundNodes.length <= inboundNodeIndex) { + addUnprocessedNode(layer, nodeData); + return; + } + var inboundNode = inboundLayer.inboundNodes[inboundNodeIndex]; + inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]); + } + if (inputTensors.length > 0) { + layer.apply(generic_utils.singletonOrArray(inputTensors), kwargs); + } + } + function processLayer(layerData) { + var layerName = layerData.name; + var layer = serialization_1.deserialize(layerData, config.customObjects != null ? + config.customObjects : + {}); + createdLayers[layerName] = layer; + var inboundNodesData = layerData.inboundNodes; + for (var _i = 0, inboundNodesData_1 = inboundNodesData; _i < inboundNodesData_1.length; _i++) { + var nodeData = inboundNodesData_1[_i]; + if (!(nodeData instanceof Array)) { + throw new errors_1.ValueError("Corrupted configuration, expected array for nodeData: " + nodeData); + } + addUnprocessedNode(layer, nodeData); + } + } + var name = config.name; + var layersFromConfig = config.layers; + for (var _i = 0, layersFromConfig_1 = layersFromConfig; _i < layersFromConfig_1.length; _i++) { + var layerData = layersFromConfig_1[_i]; + processLayer(layerData); + } + while (!generic_utils.isObjectEmpty(unprocessedNodes)) { + for (var _a = 0, layersFromConfig_2 = layersFromConfig; _a < layersFromConfig_2.length; _a++) { + var layerData = layersFromConfig_2[_a]; + var layer = createdLayers[layerData.name]; + if (layer.name in unprocessedNodes) { + for (var _b = 0, _c = unprocessedNodes[layer.name]; _b < _c.length; _b++) { + var nodeData = _c[_b]; + processNode(layer, nodeData); + } + delete unprocessedNodes[layer.name]; + } + } + } + var inputTensors = []; + var outputTensors = []; + var inputLayersFromConfig = config.inputLayers; + for (var _d = 0, inputLayersFromConfig_1 = inputLayersFromConfig; _d < inputLayersFromConfig_1.length; _d++) { + var layerData = inputLayersFromConfig_1[_d]; + var layerName = layerData[0]; + var nodeIndex = layerData[1]; + var tensorIndex = layerData[2]; + generic_utils.assert(layerName in createdLayers); + var layer = createdLayers[layerName]; + var layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; + inputTensors.push(layerOutputTensors[tensorIndex]); + } + var outputLayersFromConfig = config.outputLayers; + for (var _e = 0, outputLayersFromConfig_1 = outputLayersFromConfig; _e < outputLayersFromConfig_1.length; _e++) { + var layerData = outputLayersFromConfig_1[_e]; + var layerName = layerData[0]; + var nodeIndex = layerData[1]; + var tensorIndex = layerData[2]; + generic_utils.assert(layerName in createdLayers); + var layer = createdLayers[layerName]; + var layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; + outputTensors.push(layerOutputTensors[tensorIndex]); + } + return new cls({ inputs: inputTensors, outputs: outputTensors, name: name }); + }; + Object.defineProperty(Container.prototype, "stateful", { + get: function () { + if (this._stateful) { + throw new errors_1.ValueError('Container instance unexpectedly has _stateful = true. The ' + + 'statefulness of a Container is determined by the Layers it ' + + 'contains. Its _stateful property must remain the default false.'); + } + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + if (layer.stateful) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + return Container; +}(topology_1.Layer)); +exports.Container = Container; +//# sourceMappingURL=container.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js.map new file mode 100644 index 0000000..ff1b553 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/container.js.map @@ -0,0 +1 @@ +{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/engine/container.ts"],"names":[],"mappings":";;;;;;;;;;;;AAaA,mDAAgF;AAEhF,0CAAwC;AACxC,oCAAwE;AACxE,yDAAwE;AAExE,sDAAwD;AACxD,oEAAiE;AACjE,kDAAoD;AACpD,0CAA0D;AAC1D,sCAAoD;AAEpD,6CAAyC;AACzC,uCAAuD;AAiBvD,qCACI,KAAY,EAAE,OAAwB,EAAE,oBAA6B,EACrE,eAAwB;IAC1B,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAC1C,MAAM,IAAI,mBAAU,CAChB,qDAAqD;YACrD,oBAAoB,CAAC,CAAC;KAC3B;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAWD,oBAAoB,KA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AS,GAAG,SAAS,CAAC,CAAC,CAAW,CAAC;YACzC,IAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAW,CAAC;YACzC,IAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAW,CAAC;YAC3C,aAAa,CAAC,MAAM,CAAC,SAAS,IAAI,aAAa,CAAC,CAAC;YACjD,IAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;YACvC,IAAM,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC;YACvE,aAAa,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;SACrD;QACD,OAAO,IAAI,GAAG,CAAC,EAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,MAAA,EAAC,CAAC,CAAC;IACvE,CAAC;IAQD,sBAAI,+BAAQ;aAAZ;YAGE,IAAI,IAAI,CAAC,SAAS,EAAE;gBAClB,MAAM,IAAI,mBAAU,CAChB,4DAA4D;oBAC5D,6DAA6D;oBAC7D,iEAAiE,CAAC,CAAC;aACxE;YACD,KAAoB,UAAW,EAAX,KAAA,IAAI,CAAC,MAAM,EAAX,cAAW,EAAX,IAAW;gBAA1B,IAAM,KAAK,SAAA;gBACd,IAAI,KAAK,CAAC,QAAQ,EAAE;oBAClB,OAAO,IAAI,CAAC;iBACb;aACF;YACD,OAAO,KAAK,CAAC;QACf,CAAC;;;OAAA;IACH,gBAAC;AAAD,CAAC,AA3nCD,CAAwC,gBAAK,GA2nC5C;AA3nCqB,8BAAS"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/container_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/container_test.js.map new file mode 100644 index 0000000..ae2c9c6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/container_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"container_test.js","sourceRoot":"","sources":["../../src/engine/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AAW,CAAC,CAAuB,CAAC;QAClE,MAAM,CAAC,0BAAe,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE;QACvB,IAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC;QAC9D,IAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC;QAC9D,IAAM,KAAK,GAAG,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;QACnC,IAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAuB,CAAC;QAC1D,IAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAuB,CAAC;QAC1D,MAAM,CAAC,0BAAe,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,0BAAe,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.d.ts new file mode 100644 index 0000000..95dc946 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.d.ts @@ -0,0 +1,16 @@ +import { Tensor } from '@tensorflow/tfjs-core'; +import { Kwargs } from '../types'; +import { SymbolicTensor } from './topology'; +export interface Feed { + key: SymbolicTensor; + value: Tensor; +} +export declare class FeedDict { + private id2Value; + constructor(feeds?: Feed[] | FeedDict); + add(key: SymbolicTensor, value: Tensor): FeedDict; + addFeed(feed: Feed): void; + hasKey(key: SymbolicTensor): boolean; + getValue(key: SymbolicTensor): Tensor; +} +export declare function execute(fetches: SymbolicTensor | SymbolicTensor[], feedDict: FeedDict, kwargs?: Kwargs): Tensor | Tensor[] | [Tensor | Tensor[]]; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js b/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js new file mode 100644 index 0000000..31a2d53 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js @@ -0,0 +1,133 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var errors_1 = require("../errors"); +var input_layer_1 = require("./input_layer"); +function assertFeedCompatibility(key, val) { + if (key.shape != null) { + if (key.shape.length !== val.shape.length) { + throw new errors_1.ValueError("The rank of feed (" + val.shape.length + ") does not match the rank of " + + ("the key (" + key.shape.length + ").")); + } + for (var i = 0; i < key.shape.length; ++i) { + if (key.shape[i] != null && key.shape[i] !== val.shape[i]) { + throw new errors_1.ValueError("The " + i + "-th dimension of the feed (" + val.shape[i] + ") is " + + ("incompatible with that of the key (" + key.shape[i] + ").")); + } + } + } + if (key.dtype == null || key.dtype === val.dtype) { + return val; + } + try { + return tfjs_core_1.cast(val, key.dtype); + } + catch (err) { + throw new errors_1.ValueError("The dtype of the feed (" + val.dtype + ") can not be cast to the dtype " + + ("of the key '" + key.name + "' (" + key.dtype + ").")); + } +} +var FeedDict = (function () { + function FeedDict(feeds) { + this.id2Value = {}; + if (feeds instanceof FeedDict) { + for (var id in feeds.id2Value) { + this.id2Value[id] = feeds.id2Value[id]; + } + } + else { + if (feeds == null) { + return; + } + for (var _i = 0, feeds_1 = feeds; _i < feeds_1.length; _i++) { + var feed = feeds_1[_i]; + this.add(feed.key, feed.value); + } + } + } + FeedDict.prototype.add = function (key, value) { + if (this.id2Value[key.id] == null) { + this.id2Value[key.id] = assertFeedCompatibility(key, value); + } + else { + throw new errors_1.ValueError("Duplicate key: name=" + key.name + ", id=" + key.id); + } + return this; + }; + FeedDict.prototype.addFeed = function (feed) { + this.add(feed.key, feed.value); + }; + FeedDict.prototype.hasKey = function (key) { + return this.id2Value[key.id] != null; + }; + FeedDict.prototype.getValue = function (key) { + if (this.id2Value[key.id] == null) { + throw new errors_1.ValueError("Nonexistent key: " + JSON.stringify(key)); + } + else { + return this.id2Value[key.id]; + } + }; + return FeedDict; +}()); +exports.FeedDict = FeedDict; +function execute(fetches, feedDict, kwargs) { + var arrayFetches = Array.isArray(fetches); + var fetchArray = arrayFetches ? fetches : [fetches]; + var outputs = []; + var internalFeedDict = new FeedDict(feedDict); + for (var _i = 0, fetchArray_1 = fetchArray; _i < fetchArray_1.length; _i++) { + var fetch_1 = fetchArray_1[_i]; + outputs.push(executeInternal(fetch_1, internalFeedDict, kwargs)); + } + return arrayFetches ? outputs : outputs[0]; +} +exports.execute = execute; +function executeInternal(fetch, internalFeedDict, kwargs) { + if (internalFeedDict.hasKey(fetch)) { + return internalFeedDict.getValue(fetch); + } + if (fetch.sourceLayer instanceof input_layer_1.InputLayer) { + throw new errors_1.ValueError("Missing a feed value for SymbolicTensor from InputLayer " + + ("'" + input_layer_1.InputLayer.name + "'")); + } + var inputs = fetch.inputs; + var inputValues = []; + for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) { + var input = inputs_1[_i]; + var inputVal = executeInternal(input, internalFeedDict, kwargs); + inputValues.push(inputVal); + } + var output = fetch.sourceLayer.apply(inputValues, kwargs); + if (!Array.isArray(output)) { + output = [output]; + } + var layerOutputs = getNodeOutputs(fetch); + var outputSymbolicTensors = Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs]; + for (var i = 0; i < outputSymbolicTensors.length; ++i) { + internalFeedDict.add(outputSymbolicTensors[i], output[i]); + } + return output.length === 1 ? output[0] : output[fetch.outputTensorIndex]; +} +function getNodeOutputs(fetch) { + var layerOutputs; + if (fetch.sourceLayer.inboundNodes.length === 1) { + layerOutputs = fetch.sourceLayer.output; + } + else { + var nodeIndex = null; + for (var i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) { + for (var _i = 0, _a = fetch.sourceLayer.inboundNodes[i] + .outputTensors; _i < _a.length; _i++) { + var outputTensor = _a[_i]; + if (outputTensor.id === fetch.id) { + nodeIndex = i; + break; + } + } + } + layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex); + } + return layerOutputs; +} +//# sourceMappingURL=executor.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js.map new file mode 100644 index 0000000..0854310 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/executor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/engine/executor.ts"],"names":[],"mappings":";;AAcA,mDAAmD;AAEnD,oCAAqC;AAGrC,6CAAyC;AAMzC,iCAAiC,GAAmB,EAAE,GAAW;IAE/D,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI,EAAE;QACrB,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE;YACzC,MAAM,IAAI,mBAAU,CAChB,uBAAqB,GAAG,CAAC,KAAK,CAAC,MAAM,kCAA+B;iBACpE,cAAY,GAAG,CAAC,KAAK,CAAC,MAAM,OAAI,CAAA,CAAC,CAAC;SACvC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACzC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACzD,MAA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K,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,qBAAqB,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACrD,gBAAgB,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3D;IACD,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAC3E,CAAC;AAQD,wBAAwB,KAAqB;IAE3C,IAAI,YAA6C,CAAC;IAClD,IAAI,KAAK,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/C,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;KACzC;SAAM;QACL,IAAI,SAAS,GAAW,IAAI,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YAC9D,KAA2B,UACJ,EADI,KAAA,KAAK,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;iBAClD,aAAa,EADI,cACJ,EADI,IACJ;gBADlB,IAAM,YAAY,SAAA;gBAErB,IAAI,YAAY,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,EAAE;oBAChC,SAAS,GAAG,CAAC,CAAC;oBACd,MAAM;iBACP;aACF;SACF;QACD,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KACzD;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/executor_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/executor_test.js.map new file mode 100644 index 0000000..ba39397 --- /dev/null +++ b/node_modules/@tensorflow/tfjs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AAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAM,QAAQ,GAAG,IAAI,mBAAQ,CAAC,CAAC,EAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAC,CAAC,CAAC,CAAC;YACzD,IAAI,WAAW,GAAG,CAAC,CAAC;YACpB,WAAW,CAAC,WAAW,CAAC;gBACtB,WAAW,EAAE,CAAC;YAChB,CAAC,CAAC,CAAC;YAEH,IAAM,OAAO,GAAG,kBAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAa,CAAC;YACxD,+BAAkB,CACd,OAAO,CAAC,CAAC,CAAC,EAAE,oBAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,+BAAkB,CACd,OAAO,CAAC,CAAC,CAAC,EAAE,oBAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.d.ts new file mode 100644 index 0000000..584aaf7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.d.ts @@ -0,0 +1,26 @@ +import { DataType, serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Kwargs, Shape } from '../types'; +import { Layer, SymbolicTensor } from './topology'; +export interface InputLayerConfig { + inputShape?: Shape; + batchSize?: number; + batchInputShape?: Shape; + dtype?: DataType; + sparse?: boolean; + name?: string; +} +export declare class InputLayer extends Layer { + static readonly className: string; + sparse: boolean; + constructor(config: InputLayerConfig); + apply(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], kwargs?: Kwargs): Tensor | Tensor[] | SymbolicTensor; + getConfig(): serialization.ConfigDict; +} +export interface InputConfig { + shape?: Shape; + batchShape?: Shape; + name?: string; + dtype?: DataType; + sparse?: boolean; +} +export declare function Input(config: InputConfig): SymbolicTensor; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js b/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js new file mode 100644 index 0000000..8fb69e3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js @@ -0,0 +1,120 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("../backend/state"); +var errors_1 = require("../errors"); +var topology_1 = require("./topology"); +var InputLayer = (function (_super) { + __extends(InputLayer, _super); + function InputLayer(config) { + var _this = _super.call(this, { + dtype: config.dtype, + name: config.name != null ? config.name : state_1.getUid('input').toString() + }) || this; + if (config.batchSize == null) { + config.batchSize = null; + } + if (config.sparse == null) { + config.sparse = false; + } + _this.trainable = false; + _this.built = true; + _this.sparse = config.sparse; + if (config.inputShape != null && config.batchInputShape != null) { + throw new errors_1.ValueError('Only provide the inputShape OR ' + + 'batchInputShape argument to inputLayer, not both at the same time.'); + } + var batchInputShape = config.batchInputShape; + if (batchInputShape == null) { + if (config.inputShape == null) { + throw new errors_1.ValueError('An InputLayer should be passed either a ' + + '`batchInputShape` or an `inputShape`.'); + } + else { + batchInputShape = [config.batchSize].concat(config.inputShape); + } + } + else { + if (config.batchSize != null) { + throw new errors_1.ValueError('Cannot specify batchSize if batchInputShape is' + + 'specified when creating an InputLayer.'); + } + } + var dtype = config.dtype || 'float32'; + _this.batchInputShape = batchInputShape; + _this.dtype = dtype; + _this.inputSpec = [{ shape: batchInputShape }]; + var inputTensor = new topology_1.SymbolicTensor(_this.dtype, _this.batchInputShape, _this, [], {}, _this.name); + inputTensor.nodeIndex = 0; + inputTensor.tensorIndex = 0; + new topology_1.Node({ + outboundLayer: _this, + inboundLayers: [], + nodeIndices: [], + tensorIndices: [], + inputTensors: [inputTensor], + outputTensors: [inputTensor], + inputMasks: [null], + outputMasks: [null], + inputShapes: [batchInputShape], + outputShapes: [batchInputShape] + }); + return _this; + } + InputLayer.prototype.apply = function (inputs, kwargs) { + throw new errors_1.ValueError('Cannot pass any input to an ' + + ("InputLayer's apply() method. InputLayer name: " + this.name)); + }; + InputLayer.prototype.getConfig = function () { + return { + batchInputShape: this.batchInputShape, + dtype: this.dtype, + sparse: this.sparse, + name: this.name + }; + }; + InputLayer.className = 'InputLayer'; + return InputLayer; +}(topology_1.Layer)); +exports.InputLayer = InputLayer; +tfjs_core_1.serialization.SerializationMap.register(InputLayer); +function Input(config) { + if (config.batchShape == null && config.shape == null) { + throw new Error('Please provide to Input either a `shape`' + + ' or a `batchShape` argument. Note that ' + + '`shape` does not include the batch ' + + 'dimension.'); + } + if (config.batchShape != null && config.shape != null) { + throw new errors_1.ValueError('Please provide either a `shape` or `batchShape` ' + + 'argument to Input, but not both.'); + } + var batchShape = config.batchShape; + if (config.shape != null && batchShape == null) { + batchShape = [null].concat(config.shape); + } + var dtype = config.dtype; + if (dtype == null) { + dtype = 'float32'; + } + var inputLayer = new InputLayer({ + batchInputShape: batchShape, + name: config.name, + dtype: dtype, + sparse: config.sparse + }); + var outputs = inputLayer.inboundNodes[0].outputTensors; + return outputs[0]; +} +exports.Input = Input; +//# sourceMappingURL=input_layer.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js.map new file mode 100644 index 0000000..dc67374 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"input_layer.js","sourceRoot":"","sources":["../../src/engine/input_layer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAUA,mDAAsE;AAEtE,0CAAwC;AACxC,oCAAqC;AAGrC,uCAAuD;AA4CvD;IAAgC,8BAAK;IAGnC,oBAAY,MAAwB;QAApC,YACE,kBAAM;YACJ,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,cAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;SACrE,CAAC,SA+DH;QA7DC,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE;YAC5B,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;SACzB;QACD,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;YACzB,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC;SACvB;QAED,KAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAE5B,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,MAAM,CAAC,eAAe,IAAI,IAAI,EAAE;YAC/D,MAAM,IAAI,mBAAU,CAChB,iCAAiC;gBACjC,oEAAoE,CAAC,CAAC;SAC3E;QACD,IAAI,eAAe,GAAG,MAA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;KACnB;IAED,IAAM,UAAU,GAAG,IAAI,UAAU,CAAC;QAChC,eAAe,EAAE,UAAU;QAC3B,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,OAAA;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;IAEH,IAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;IACzD,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAjCD,sBAiCC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer_test.js.map new file mode 100644 index 0000000..0ac33e9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"input_layer_test.js","sourceRoot":"","sources":["../../src/engine/input_layer_test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAUA,mDAA2C;AAE3C,8BAAgC;AAChC,kDAAoD;AAEpD,6CAAgD;AAGhD,4BAAe,CAAC,YAAY,EAAE;IAC5B,EAAE,CAAC,sDAAsD,EAAE;QACzD,MAAM,CAAC,cAAM,OAAA,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,EAAzB,CAAyB,CAAC;aAClC,YAAY,CAAC,oCAAoC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,qCAAqC,EAAE;QAC9C,IAAM,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;QACvB,IAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAC,UAAU,YAAA,EAAC,CAAe,CAAC;QAErE,EAAE,CAAC,mBAAmB,EAAE;YACtB,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH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,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8DAA8D,EAAE;QACjE,MAAM,CAAC,cAAM,OAAA,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,KAAK,OAAA,EAAE,UAAU,YAAA,EAAC,CAAC,EAArC,CAAqC,CAAC;aAC9C,YAAY,CAAC,iCAAiC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE;QAChD,IAAM,WAAW,GAAG,mBAAK,CAAC,EAAC,KAAK,OAAA,EAAE,IAAI,MAAA,EAAC,CAAC,CAAC;QACzC,IAAM,UAAU,GAAG,IAAI,YAAY,CAAC,EAAC,IAAI,EAAE,YAAY,EAAC,CAAC,CAAC;QAC1D,IAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAuB,CAAC;QACnE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.d.ts new file mode 100644 index 0000000..278d9a3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.d.ts @@ -0,0 +1,139 @@ +import { DataType, Scalar, serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Constraint } from '../constraints'; +import { Initializer } from '../initializers'; +import { Regularizer } from '../regularizers'; +import { Kwargs, RegularizerFn, Shape } from '../types'; +import { LayerVariable } from '../variables'; +export declare type Op = (x: LayerVariable) => LayerVariable; +export interface InputSpecConfig { + dtype?: DataType; + shape?: Shape; + ndim?: number; + maxNDim?: number; + minNDim?: number; + axes?: { + [axis: number]: number; + }; +} +export declare class InputSpec { + dtype?: DataType; + shape?: Shape; + ndim?: number; + maxNDim?: number; + minNDim?: number; + axes?: { + [axis: number]: number; + }; + constructor(config: InputSpecConfig); +} +export declare class SymbolicTensor { + readonly dtype: DataType; + readonly shape: Shape; + sourceLayer: Layer; + readonly inputs: SymbolicTensor[]; + readonly callArgs: Kwargs; + readonly outputTensorIndex: number; + readonly id: number; + readonly name: string; + readonly originalName?: string; + readonly rank: number; + nodeIndex: number; + tensorIndex: number; + constructor(dtype: DataType, shape: Shape, sourceLayer: Layer, inputs: SymbolicTensor[], callArgs: Kwargs, name?: string, outputTensorIndex?: number); +} +export interface NodeConfig { + outboundLayer: Layer; + inboundLayers: Layer[]; + nodeIndices: number[]; + tensorIndices: number[]; + inputTensors: SymbolicTensor[]; + outputTensors: SymbolicTensor[]; + inputMasks: Tensor[]; + outputMasks: Tensor[]; + inputShapes: Shape | Shape[]; + outputShapes: Shape | Shape[]; +} +export declare class Node { + callArgs: Kwargs; + outboundLayer: Layer; + inboundLayers: Layer[]; + nodeIndices: number[]; + tensorIndices: number[]; + inputTensors: SymbolicTensor[]; + outputTensors: SymbolicTensor[]; + inputMasks: Tensor[]; + outputMasks: Tensor[]; + inputShapes: Shape | Shape[]; + outputShapes: Shape | Shape[]; + readonly id: number; + constructor(config: NodeConfig, callArgs?: Kwargs); + getConfig(): serialization.ConfigDict; +} +export interface LayerConfig { + inputShape?: Shape; + batchInputShape?: Shape; + batchSize?: number; + dtype?: DataType; + name?: string; + trainable?: boolean; + updatable?: boolean; + weights?: Tensor[]; + inputDType?: DataType; +} +export declare type CallHook = (inputs: Tensor | Tensor[], kwargs: Kwargs) => void; +export declare abstract class Layer extends serialization.Serializable { + name: string; + inputSpec: InputSpec[]; + supportsMasking: boolean; + trainable: boolean; + updatable: boolean; + batchInputShape: Shape; + dtype: DataType; + initialWeights: Tensor[]; + inboundNodes: Node[]; + outboundNodes: Node[]; + activityRegularizer: Regularizer; + protected _trainableWeights: LayerVariable[]; + private _nonTrainableWeights; + private _losses; + private _updates; + private _built; + private _callHook; + private _addedWeightNames; + readonly id: number; + protected _stateful: boolean; + constructor(config: LayerConfig); + protected static nodeKey(layer: Layer, nodeIndex: number): string; + private getNodeAtIndex(nodeIndex, attrName); + getInputAt(nodeIndex: number): SymbolicTensor | SymbolicTensor[]; + getOutputAt(nodeIndex: number): SymbolicTensor | SymbolicTensor[]; + readonly input: SymbolicTensor | SymbolicTensor[]; + readonly output: SymbolicTensor | SymbolicTensor[]; + readonly losses: RegularizerFn[]; + calculateLosses(): Scalar[]; + readonly updates: Tensor[]; + built: boolean; + trainableWeights: LayerVariable[]; + nonTrainableWeights: LayerVariable[]; + readonly weights: LayerVariable[]; + readonly stateful: boolean; + protected assertInputCompatibility(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + protected invokeCallHook(inputs: Tensor | Tensor[], kwargs: Kwargs): void; + setCallHook(callHook: CallHook): void; + clearCallHook(): void; + apply(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], kwargs?: Kwargs): Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[]; + protected warnOnIncompatibleInputShape(inputShape: Shape): void; + readonly outputShape: Shape | Shape[]; + countParams(): number; + build(inputShape: Shape | Shape[]): void; + getWeights(trainableOnly?: boolean): Tensor[]; + setWeights(weights: Tensor[]): void; + protected addWeight(name: string, shape: Shape, dtype?: DataType, initializer?: Initializer, regularizer?: Regularizer, trainable?: boolean, constraint?: Constraint): LayerVariable; + addLoss(losses: RegularizerFn | RegularizerFn[]): void; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor | Tensor[]; + private addInboundNode(inputTensors, outputTensors, inputMasks, outputMasks, inputShapes, outputShapes, kwargs?); + getConfig(): serialization.ConfigDict; +} +export declare function getSourceInputs(tensor: SymbolicTensor, layer?: Layer, nodeIndex?: number): SymbolicTensor[]; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js b/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js new file mode 100644 index 0000000..7e22609 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js @@ -0,0 +1,701 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("../backend/state"); +var common_1 = require("../common"); +var errors_1 = require("../errors"); +var generic_utils = require("../utils/generic_utils"); +var types_utils = require("../utils/types_utils"); +var variable_utils = require("../utils/variable_utils"); +var variables_1 = require("../variables"); +var InputSpec = (function () { + function InputSpec(config) { + this.dtype = config.dtype; + this.shape = config.shape; + if (config.shape != null) { + this.ndim = config.shape.length; + } + else { + this.ndim = config.ndim; + } + this.maxNDim = config.maxNDim; + this.minNDim = config.minNDim; + this.axes = config.axes || {}; + } + return InputSpec; +}()); +exports.InputSpec = InputSpec; +var SymbolicTensor = (function () { + function SymbolicTensor(dtype, shape, sourceLayer, inputs, callArgs, name, outputTensorIndex) { + this.dtype = dtype; + this.shape = shape; + this.sourceLayer = sourceLayer; + this.inputs = inputs; + this.callArgs = callArgs; + this.outputTensorIndex = outputTensorIndex; + this.id = state_1.getNextUniqueTensorId(); + if (name != null) { + this.originalName = common_1.getScopedTensorName(name); + this.name = common_1.getUniqueTensorName(this.originalName); + } + this.rank = shape.length; + } + return SymbolicTensor; +}()); +exports.SymbolicTensor = SymbolicTensor; +var _nextNodeID = 0; +var Node = (function () { + function Node(config, callArgs) { + this.callArgs = callArgs; + this.id = _nextNodeID++; + this.outboundLayer = config.outboundLayer; + this.inboundLayers = config.inboundLayers; + this.nodeIndices = config.nodeIndices; + this.tensorIndices = config.tensorIndices; + this.inputTensors = config.inputTensors; + this.outputTensors = config.outputTensors; + this.inputMasks = config.inputMasks; + this.outputMasks = config.outputMasks; + this.inputShapes = config.inputShapes; + this.outputShapes = config.outputShapes; + for (var _i = 0, _a = config.inboundLayers; _i < _a.length; _i++) { + var layer = _a[_i]; + if (layer != null) { + layer.outboundNodes.push(this); + } + } + config.outboundLayer.inboundNodes.push(this); + } + Node.prototype.getConfig = function () { + var inboundNames = []; + for (var _i = 0, _a = this.inboundLayers; _i < _a.length; _i++) { + var layer = _a[_i]; + if (layer != null) { + inboundNames.push(layer.name); + } + else { + inboundNames.push(null); + } + } + return { + outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, + inboundLayers: inboundNames, + nodeIndices: this.nodeIndices, + tensorIndices: this.tensorIndices + }; + }; + return Node; +}()); +exports.Node = Node; +var _nextLayerID = 0; +var Layer = (function (_super) { + __extends(Layer, _super); + function Layer(config) { + var _this = _super.call(this) || this; + _this._callHook = null; + _this._addedWeightNames = []; + _this._stateful = false; + _this.id = _nextLayerID++; + _this.activityRegularizer = null; + _this.inputSpec = null; + _this.supportsMasking = false; + _this._trainableWeights = []; + _this._nonTrainableWeights = []; + _this._losses = []; + _this._updates = []; + _this._built = false; + _this.inboundNodes = []; + _this.outboundNodes = []; + var name = config.name; + if (!name) { + var prefix = _this.getClassName(); + name = generic_utils.toSnakeCase(prefix) + '_' + state_1.getUid(prefix); + } + _this.name = name; + _this.trainable = config.trainable == null ? true : config.trainable; + _this.updatable = config.updatable == null ? true : config.updatable; + if (config.inputShape != null || config.batchInputShape != null) { + var batchInputShape = void 0; + if (config.batchInputShape != null) { + batchInputShape = config.batchInputShape; + } + else if (config.inputShape != null) { + var batchSize = null; + if (config.batchSize != null) { + batchSize = config.batchSize; + } + batchInputShape = [batchSize].concat(config.inputShape); + } + _this.batchInputShape = batchInputShape; + var dtype = config.dtype; + if (dtype == null) { + dtype = config.inputDType; + } + if (dtype == null) { + dtype = 'float32'; + } + _this.dtype = dtype; + } + if (config.weights != null) { + _this.initialWeights = config.weights; + } + else { + _this.initialWeights = null; + } + return _this; + } + Layer.nodeKey = function (layer, nodeIndex) { + return layer.name + '_ib-' + nodeIndex.toString(); + }; + Layer.prototype.getNodeAtIndex = function (nodeIndex, attrName) { + if (this.inboundNodes.length === 0) { + throw new errors_1.RuntimeError('The layer has never been called ' + + ("and thus has no defined " + attrName + ".")); + } + if (this.inboundNodes.length <= nodeIndex) { + throw new errors_1.ValueError("Asked to get " + attrName + " at node " + nodeIndex + ", " + + ("but the layer has only " + this.inboundNodes.length + " inbound nodes.")); + } + return this.inboundNodes[nodeIndex]; + }; + Layer.prototype.getInputAt = function (nodeIndex) { + return generic_utils.singletonOrArray(this.getNodeAtIndex(nodeIndex, 'input').inputTensors); + }; + Layer.prototype.getOutputAt = function (nodeIndex) { + return generic_utils.singletonOrArray(this.getNodeAtIndex(nodeIndex, 'output').outputTensors); + }; + Object.defineProperty(Layer.prototype, "input", { + get: function () { + if (this.inboundNodes.length > 1) { + throw new errors_1.AttributeError("Layer " + this.name + + ' has multiple inbound nodes, ' + + 'hence the notion of "layer input" ' + + 'is ill-defined. ' + + 'Use `getInputAt(nodeIndex)` instead.'); + } + else if (this.inboundNodes.length === 0) { + throw new errors_1.AttributeError("Layer " + this.name + + ' is not connected, no input to return.'); + } + return generic_utils.singletonOrArray(this.getNodeAtIndex(0, 'input').inputTensors); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "output", { + get: function () { + if (this.inboundNodes.length === 0) { + throw new errors_1.AttributeError("Layer " + this.name + + ' has no inbound nodes.'); + } + if (this.inboundNodes.length > 1) { + throw new errors_1.AttributeError("Layer " + this.name + + ' has multiple inbound nodes, ' + + 'hence the notion of "layer output" ' + + 'is ill-defined. ' + + 'Use `getOutputAt(nodeIndex)` instead.'); + } + return generic_utils.singletonOrArray(this.getNodeAtIndex(0, 'output').outputTensors); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "losses", { + get: function () { + return this._losses; + }, + enumerable: true, + configurable: true + }); + Layer.prototype.calculateLosses = function () { + return this.losses.map(function (lossFn) { return lossFn(); }); + }; + Object.defineProperty(Layer.prototype, "updates", { + get: function () { + return this._updates; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "built", { + get: function () { + return this._built; + }, + set: function (built) { + this._built = built; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "trainableWeights", { + get: function () { + if (this.trainable) { + return this._trainableWeights; + } + else { + return []; + } + }, + set: function (weights) { + this._trainableWeights = weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "nonTrainableWeights", { + get: function () { + if (!this.trainable) { + return this._trainableWeights.concat(this._nonTrainableWeights); + } + else { + return this._nonTrainableWeights; + } + }, + set: function (weights) { + this._nonTrainableWeights = weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "weights", { + get: function () { + return this.trainableWeights.concat(this.nonTrainableWeights); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "stateful", { + get: function () { + return this._stateful; + }, + enumerable: true, + configurable: true + }); + Layer.prototype.assertInputCompatibility = function (inputs) { + inputs = generic_utils.toList(inputs); + if (this.inputSpec == null || this.inputSpec.length === 0) { + return; + } + var inputSpec = generic_utils.toList(this.inputSpec); + if (inputs.length !== inputSpec.length) { + throw new errors_1.ValueError("Layer " + this.name + " expects " + inputSpec.length + " inputs, " + + ("but it received " + inputs.length + " input tensors. ") + + ("Input received: " + inputs)); + } + for (var inputIndex = 0; inputIndex < inputs.length; inputIndex++) { + var x = inputs[inputIndex]; + var spec = inputSpec[inputIndex]; + if (spec == null) { + continue; + } + var ndim = x.rank; + if (spec.ndim != null) { + if (ndim !== spec.ndim) { + throw new errors_1.ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + ": " + + ("expected ndim=" + spec.ndim + ", found ndim=" + ndim)); + } + } + if (spec.maxNDim != null) { + if (ndim > spec.maxNDim) { + throw new errors_1.ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + + (": expected max_ndim=" + spec.maxNDim + ", found ndim=" + ndim)); + } + } + if (spec.minNDim != null) { + if (ndim < spec.minNDim) { + throw new errors_1.ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + + (": expected min_ndim=" + spec.minNDim + ", found ndim=" + ndim + ".")); + } + } + if (spec.dtype != null) { + if (x.dtype !== spec.dtype) { + throw new errors_1.ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + " " + + (": expected dtype=" + spec.dtype + ", found dtype=" + x.dtype + ".")); + } + } + if (spec.axes) { + var xShape = x.shape; + for (var key in spec.axes) { + var axis = Number(key); + var value = spec.axes[key]; + var xShapeAtAxis = axis >= 0 ? xShape[axis] : xShape[xShape.length + axis]; + if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) { + throw new errors_1.ValueError("Input " + inputIndex + " is incompatible with layer " + + (this.name + ": expected axis " + axis + " of input shape to ") + + ("have value " + value + " but got shape " + xShape + ".")); + } + } + } + if (spec.shape != null) { + for (var i = 0; i < spec.shape.length; ++i) { + var specDim = spec.shape[i]; + var dim = x.shape[i]; + if (specDim != null && dim != null) { + if (specDim !== dim) { + throw new errors_1.ValueError("Input " + inputIndex + " is incompatible with layer " + + (this.name + ": expected shape=" + spec.shape + ", ") + + 'found shape=${xShape}.'); + } + } + } + } + } + }; + Layer.prototype.call = function (inputs, kwargs) { + return inputs; + }; + Layer.prototype.invokeCallHook = function (inputs, kwargs) { + if (this._callHook != null) { + this._callHook(inputs, kwargs); + } + }; + Layer.prototype.setCallHook = function (callHook) { + this._callHook = callHook; + }; + Layer.prototype.clearCallHook = function () { + this._callHook = null; + }; + Layer.prototype.apply = function (inputs, kwargs) { + var _this = this; + kwargs = kwargs || {}; + var inputsList = generic_utils.toList(inputs); + var allAreSymbolic = true; + for (var _i = 0, inputsList_1 = inputsList; _i < inputsList_1.length; _i++) { + var input = inputsList_1[_i]; + if (!(input instanceof SymbolicTensor)) { + allAreSymbolic = false; + break; + } + } + var noneAreSymbolic = true; + for (var _a = 0, inputsList_2 = inputsList; _a < inputsList_2.length; _a++) { + var input = inputsList_2[_a]; + if (input instanceof SymbolicTensor) { + noneAreSymbolic = false; + break; + } + } + if (allAreSymbolic === noneAreSymbolic) { + throw new errors_1.ValueError('Arguments to apply() must be all ' + + 'SymbolicTensors or all Tensors'); + } + return common_1.nameScope(this.name, function () { + if (!_this.built) { + _this.assertInputCompatibility(inputs); + var inputShapes = []; + for (var _i = 0, _a = generic_utils.toList(inputs); _i < _a.length; _i++) { + var xElem = _a[_i]; + inputShapes.push(xElem.shape); + } + _this.build(generic_utils.singletonOrArray(inputShapes)); + _this.built = true; + if (_this.initialWeights) { + _this.setWeights(_this.initialWeights); + } + } + _this.assertInputCompatibility(inputs); + if (noneAreSymbolic) { + var output = _this.call(inputs, kwargs); + var outputList = generic_utils.toList(output); + var outputListCopy = []; + for (var _b = 0, outputList_1 = outputList; _b < outputList_1.length; _b++) { + var x = outputList_1[_b]; + if (inputsList.indexOf(x) !== -1) { + x = x.clone(); + } + outputListCopy.push(x); + } + output = generic_utils.singletonOrArray(outputListCopy); + if (_this.activityRegularizer != null) { + throw new errors_1.NotImplementedError('Layer invocation in the presence of activity ' + + 'regularizer(s) is not supported yet.'); + } + return output; + } + else { + var inputShape = collectInputShape(inputs); + var outputShape = _this.computeOutputShape(inputShape); + var output = void 0; + var outputDType_1 = guessOutputDType(inputs); + _this.warnOnIncompatibleInputShape(Array.isArray(inputs) ? inputShape[0] : + inputShape); + if (outputShape != null && outputShape.length > 0 && + Array.isArray(outputShape[0])) { + output = outputShape + .map(function (shape, index) { return new SymbolicTensor(outputDType_1, shape, _this, generic_utils.toList(inputs), kwargs, _this.name, index); }); + } + else { + output = new SymbolicTensor(outputDType_1, outputShape, _this, generic_utils.toList(inputs), kwargs, _this.name); + } + _this.addInboundNode(inputs, output, null, null, inputShape, outputShape, kwargs); + if (_this.activityRegularizer != null) { + throw new errors_1.NotImplementedError('Layer invocation in the presence of activity ' + + 'regularizer(s) is not supported yet.'); + } + return output; + } + }); + }; + Layer.prototype.warnOnIncompatibleInputShape = function (inputShape) { + if (this.batchInputShape == null) { + return; + } + else if (inputShape.length !== this.batchInputShape.length) { + console.warn("The rank of the input tensor provided (shape: " + + (JSON.stringify(inputShape) + ") does not match that of the ") + + ("batchInputShape (" + JSON.stringify(this.batchInputShape) + ") ") + + ("of the layer " + this.name)); + } + else { + var dimMismatch_1 = false; + this.batchInputShape.forEach(function (dimension, i) { + if (dimension != null && inputShape[i] != null && + inputShape[i] !== dimension) { + dimMismatch_1 = true; + } + }); + if (dimMismatch_1) { + console.warn("The shape of the input tensor " + + ("(" + JSON.stringify(inputShape) + ") does not ") + + ("match the expectation of layer " + this.name + ": ") + + ("" + JSON.stringify(this.batchInputShape))); + } + } + }; + Object.defineProperty(Layer.prototype, "outputShape", { + get: function () { + if (this.inboundNodes == null || this.inboundNodes.length === 0) { + throw new errors_1.AttributeError("The layer " + this.name + " has never been called and thus has no " + + "defined output shape."); + } + var allOutputShapes = []; + for (var _i = 0, _a = this.inboundNodes; _i < _a.length; _i++) { + var node = _a[_i]; + var shapeString = JSON.stringify(node.outputShapes); + if (allOutputShapes.indexOf(shapeString) === -1) { + allOutputShapes.push(shapeString); + } + } + if (allOutputShapes.length === 1) { + var outputShapes = this.inboundNodes[0].outputShapes; + if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) && + outputShapes.length === 1) { + return outputShapes[0]; + } + else { + return outputShapes; + } + } + else { + throw new errors_1.AttributeError("The layer " + this.name + " has multiple inbound nodes with different " + + "output shapes. Hence the notion of \"outut shape\" is ill-defined " + + "for the layer."); + } + }, + enumerable: true, + configurable: true + }); + Layer.prototype.countParams = function () { + if (!this.built) { + throw new errors_1.RuntimeError("You tried to call countParams() on " + this.name + ", " + + "but the layer is not built yet. Build it first by calling " + + "build(batchInputShape)."); + } + return variable_utils.countParamsInWeights(this.weights); + }; + Layer.prototype.build = function (inputShape) { + this.built = true; + }; + Layer.prototype.getWeights = function (trainableOnly) { + if (trainableOnly === void 0) { trainableOnly = false; } + return variables_1.batchGetValue(trainableOnly ? this.trainableWeights : this.weights); + }; + Layer.prototype.setWeights = function (weights) { + var _this = this; + tfjs_core_1.tidy(function () { + var params = _this.weights; + if (params.length !== weights.length) { + throw new errors_1.ValueError("You called setWeights(weights) on layer \"" + _this.name + "\" " + + ("with a weight list of length " + weights.length + ", ") + + ("but the layer was expecting " + params.length + " weights. ") + + ("Provided weights: " + weights + "...")); + } + if (params.length === 0) { + return; + } + var weightValueTuples = []; + var paramValues = variables_1.batchGetValue(params); + for (var i = 0; i < paramValues.length; ++i) { + var pv = paramValues[i]; + var p = params[i]; + var w = weights[i]; + if (!tfjs_core_1.util.arraysEqual(pv.shape, w.shape)) { + throw new errors_1.ValueError("Layer weight shape " + pv.shape + " " + + ("not compatible with provided weight shape " + w.shape)); + } + weightValueTuples.push([p, w]); + } + variables_1.batchSetValue(weightValueTuples); + }); + }; + Layer.prototype.addWeight = function (name, shape, dtype, initializer, regularizer, trainable, constraint) { + if (this._addedWeightNames.indexOf(name) !== -1) { + throw new errors_1.ValueError("Duplicate weight name " + name + " for layer " + this.name); + } + this._addedWeightNames.push(name); + if (dtype == null) { + dtype = 'float32'; + } + var weight = new variables_1.LayerVariable(initializer.apply(shape, dtype), dtype, name, trainable, constraint); + if (regularizer != null) { + this.addLoss(function () { return regularizer.apply(weight.read()); }); + } + if (trainable == null) { + trainable = true; + } + if (trainable) { + this._trainableWeights.push(weight); + } + else { + this._nonTrainableWeights.push(weight); + } + return weight; + }; + Layer.prototype.addLoss = function (losses) { + if (losses == null || Array.isArray(losses) && losses.length === 0) { + return; + } + losses = generic_utils.toList(losses); + if (this._losses !== undefined && this._losses !== null) { + (_a = this.losses).push.apply(_a, losses); + } + var _a; + }; + Layer.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + Layer.prototype.computeMask = function (inputs, mask) { + var _this = this; + if (!this.supportsMasking) { + if (mask != null) { + if (Array.isArray(mask)) { + mask.forEach(function (maskElement) { + if (maskElement != null) { + throw new TypeError("Layer " + _this.name + " does not support masking," + + 'but was passed an inputMask.'); + } + }); + } + else { + throw new TypeError("Layer " + this.name + " does not support masking," + + 'but was passed an inputMask.'); + } + } + return null; + } + return mask; + }; + Layer.prototype.addInboundNode = function (inputTensors, outputTensors, inputMasks, outputMasks, inputShapes, outputShapes, kwargs) { + if (kwargs === void 0) { kwargs = null; } + var inputTensorList = generic_utils.toList(inputTensors); + outputTensors = generic_utils.toList(outputTensors); + inputMasks = generic_utils.toList(inputMasks); + outputMasks = generic_utils.toList(outputMasks); + inputShapes = types_utils.normalizeShapeList(inputShapes); + outputShapes = types_utils.normalizeShapeList(outputShapes); + var inboundLayers = []; + var nodeIndices = []; + var tensorIndices = []; + for (var _i = 0, inputTensorList_1 = inputTensorList; _i < inputTensorList_1.length; _i++) { + var x = inputTensorList_1[_i]; + inboundLayers.push(x.sourceLayer); + nodeIndices.push(x.nodeIndex); + tensorIndices.push(x.tensorIndex); + } + new Node({ + outboundLayer: this, + inboundLayers: inboundLayers, + nodeIndices: nodeIndices, + tensorIndices: tensorIndices, + inputTensors: inputTensorList, + outputTensors: outputTensors, + inputMasks: inputMasks, + outputMasks: outputMasks, + inputShapes: inputShapes, + outputShapes: outputShapes + }, kwargs); + for (var i = 0; i < outputTensors.length; i++) { + outputTensors[i].sourceLayer = this; + outputTensors[i].nodeIndex = this.inboundNodes.length - 1; + outputTensors[i].tensorIndex = i; + } + }; + Layer.prototype.getConfig = function () { + var config = { name: this.name, trainable: this.trainable }; + if (this.batchInputShape != null) { + config['batchInputShape'] = this.batchInputShape; + } + if (this.dtype != null) { + config['dtype'] = this.dtype; + } + return config; + }; + return Layer; +}(tfjs_core_1.serialization.Serializable)); +exports.Layer = Layer; +function collectInputShape(inputTensors) { + inputTensors = + generic_utils.toList(inputTensors); + var shapes = []; + for (var _i = 0, inputTensors_1 = inputTensors; _i < inputTensors_1.length; _i++) { + var x = inputTensors_1[_i]; + shapes.push(x.shape); + } + return generic_utils.singletonOrArray(shapes); +} +function guessOutputDType(inputTensors) { + return 'float32'; +} +function getSourceInputs(tensor, layer, nodeIndex) { + if (layer == null || (nodeIndex != null && nodeIndex > 0)) { + layer = tensor.sourceLayer; + nodeIndex = tensor.nodeIndex; + } + if (layer.inboundNodes.length === 0) { + return [tensor]; + } + else { + var node = layer.inboundNodes[nodeIndex]; + if (node.inboundLayers.length === 0) { + return node.inputTensors; + } + else { + var sourceTensors = []; + for (var i = 0; i < node.inboundLayers.length; i++) { + var x = node.inputTensors[i]; + var layer_1 = node.inboundLayers[i]; + var nodeIndex_1 = node.nodeIndices[i]; + var previousSources = getSourceInputs(x, layer_1, nodeIndex_1); + for (var _i = 0, previousSources_1 = previousSources; _i < previousSources_1.length; _i++) { + var x_1 = previousSources_1[_i]; + if (sourceTensors.indexOf(x_1) === -1) { + sourceTensors.push(x_1); + } + } + } + return sourceTensors; + } + } +} +exports.getSourceInputs = getSourceInputs; +//# sourceMappingURL=topology.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js.map new file mode 100644 index 0000000..e1e9d8c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/topology.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topology.js","sourceRoot":"","sources":["../../src/engine/topology.ts"],"names":[],"mappings":";;;;;;;;;;;;AAaA,mDAA0F;AAE1F,0CAA+D;AAC/D,oCAA8E;AAE9E,oCAAwF;AAIxF,sDAAwD;AACxD,kDAAoD;AACpD,wDAA0D;AAC1D,0CAAyE;AAiCzE;IAcE,mBAAY,MAAuB;QACjC,IAAI,CAAC,KAAK,GAAG,M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SAAS,GAAG,CAAC,CAAC,EAAE;QACzD,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC;QAC3B,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;KAC9B;IACD,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QACnC,OAAO,CAAC,MAAM,CAAC,CAAC;KACjB;SAAM;QACL,IAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;YACnC,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;aAAM;YACL,IAAM,aAAa,GAAqB,EAAE,CAAC;YAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAClD,IAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBAC/B,IAAM,OAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;gBACpC,IAAM,WAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBACtC,IAAM,eAAe,GAAG,eAAe,CAAC,CAAC,EAAE,OAAK,EAAE,WAAS,CAAC,CAAC;gBAE7D,KAAgB,UAAe,EAAf,mCAAe,EAAf,6BAAe,EAAf,IAAe;oBAA1B,IAAM,GAAC,wBAAA;oBACV,IAAI,aAAa,CAAC,OAAO,CAAC,GAAC,CAAC,KAAK,CAAC,CAAC,EAAE;wBACnC,aAAa,CAAC,IAAI,CAAC,GAAC,CAAC,CAAC;qBACvB;iBACF;aACF;YACD,OAAO,aAAa,CAAC;SACtB;KACF;AACH,CAAC;AA9BD,0CA8BC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/topology_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/topology_test.js.map new file mode 100644 index 0000000..1a77b6a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/topology_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topology_test.js","sourceRoot":"","sources":["../../src/engine/topology_test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA,mDAAmF;AACnF,8BAAgC;AAChC,8CAAgD;AAEhD,kDAA+F;AAC/F,0CAAwE;AAExE,yCAA+E;AAC/E,uCAA+D;AAG/D;IAA2B,gCAAgB;IAEzC,sBAAY,MAAmB;eAC7B,kBAAM,MAAM,CAAC;IACf,CAAC;IAHM,sBAAS,GAAG,cAAc,CAAC;IAIpC,mBAAC;CAAA,AALD,CAA2B,GAAG,CAAC,MAAM,CAAC,KAAK,GAK1C;AAED,QAAQ,CAAC,WAAW,EAAE;IACpB,EAAE,CAAC,2CAA2C,EAAE;QAC9C,IAAM,SAAS,GAAG,IAAI,oBAAS,CAAC,EAAE,CAAC,CAAC;QACpC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,CAAC;QACxC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,CAAC;QACxC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;QACvC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC;QAC1C,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC;QAC1C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yEAAyE,EACzE;QACE,IAAM,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACxB,IAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;QACnC,IAAM,SAAS,GAAG,IAAI,oBAAS,CAAC,EAAC,KAAK,EAAE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,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,oBAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACxE,+BAAkB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,oBAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,UAAU,GACZ,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAC,CAAC,CAAC;QACrE,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC9B,IAAM,eAAe,GAAmB,EAAE,CAAC;QAC3C,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;YAC/C,oBAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,cAAM,OAAA,yCAA6B,CAAC,eAAe,EAAE,CAAC,UAAU,CAAC,CAAC,EAA5D,CAA4D,CAAC;aACrE,YAAY,CAAC,sCAAsC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/training.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/engine/training.d.ts new file mode 100644 index 0000000..a53369f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/training.d.ts @@ -0,0 +1,108 @@ +import * as tfc from '@tensorflow/tfjs-core'; +import { io, ModelPredictConfig, Optimizer, Scalar, Tensor, Tensor1D } from '@tensorflow/tfjs-core'; +import { BaseCallback, CustomCallbackConfig, History } from '../base_callbacks'; +import { LossOrMetricFn, NamedTensorMap, Shape } from '../types'; +import { Container, ContainerConfig } from './container'; +export declare function isDataTensor(x: Tensor | Tensor[] | { + [inputName: string]: Tensor; +} | { + [inputName: string]: Tensor[]; +}): boolean; +export declare function isDataArray(x: Tensor | Tensor[] | { + [inputName: string]: Tensor; +}): boolean; +export declare function isDataDict(x: Tensor | Tensor[] | { + [inputName: string]: Tensor; +}): boolean; +export declare function standardizeInputData(data: Tensor | Tensor[] | { + [inputName: string]: Tensor; +}, names: string[], shapes?: Shape[], checkBatchAxis?: boolean, exceptionPrefix?: string): Tensor[]; +export declare function checkArrayLengths(inputs: Tensor[], targets: Tensor[], weights?: Tensor[]): void; +export declare function makeBatches(size: number, batchSize: number): Array<[number, number]>; +export declare function sliceArraysByIndices(arrays: Tensor | Tensor[], indices: Tensor1D): Tensor | Tensor[]; +export declare enum ModelLoggingVerbosity { + SILENT = 0, + VERBOSE = 1, +} +export interface ModelEvaluateConfig { + batchSize?: number; + verbose?: ModelLoggingVerbosity; + sampleWeight?: Tensor; + steps?: number; +} +export interface ModelFitConfig { + batchSize?: number; + epochs?: number; + verbose?: ModelLoggingVerbosity; + callbacks?: BaseCallback[] | CustomCallbackConfig | CustomCallbackConfig[]; + validationSplit?: number; + validationData?: [Tensor | Tensor[], Tensor | Tensor[]] | [Tensor | Tensor[], Tensor | Tensor[], Tensor | Tensor[]]; + shuffle?: boolean; + classWeight?: { + [classIndex: string]: number; + }; + sampleWeight?: Tensor; + initialEpoch?: number; + stepsPerEpoch?: number; + validationSteps?: number; + yieldEvery?: 'batch' | 'epoch' | 'never'; +} +export interface ModelCompileConfig { + optimizer: string | Optimizer; + loss: string | string[] | { + [outputName: string]: string; + } | LossOrMetricFn | LossOrMetricFn[] | { + [outputName: string]: LossOrMetricFn; + }; + metrics?: string[] | { + [outputName: string]: string; + }; +} +export declare class Model extends Container implements tfc.InferenceModel { + static className: string; + optimizer: Optimizer; + loss: string | string[] | { + [outputName: string]: string; + } | LossOrMetricFn | LossOrMetricFn[] | { + [outputName: string]: LossOrMetricFn; + }; + lossFunctions: LossOrMetricFn[]; + private feedOutputShapes; + private feedLossFns; + private collectedTrainableWeights; + private testFunction; + history: History; + stopTraining: boolean; + metrics: string[] | { + [outputName: string]: string; + }; + metricsNames: string[]; + metricsTensors: Array<[LossOrMetricFn, number]>; + constructor(config: ContainerConfig); + summary(lineLength?: number, positions?: number[], printFn?: (message?: any, ...optionalParams: any[]) => void): void; + compile(config: ModelCompileConfig): void; + private checkTrainableWeightsConsistency(); + evaluate(x: Tensor | Tensor[], y: Tensor | Tensor[], config?: ModelEvaluateConfig): Scalar | Scalar[]; + private checkNumSamples(ins, batchSize?, steps?, stepsName?); + execute(inputs: Tensor | Tensor[] | NamedTensorMap, outputs: string | string[]): Tensor | Tensor[]; + private retrieveSymbolicTensors(symbolicTensorNames); + private predictLoop(ins, batchSize?, verbose?); + predict(x: Tensor | Tensor[], config?: ModelPredictConfig): Tensor | Tensor[]; + predictOnBatch(x: Tensor): Tensor | Tensor[]; + protected standardizeUserData(x: Tensor | Tensor[] | { + [inputName: string]: Tensor; + }, y: Tensor | Tensor[] | { + [inputName: string]: Tensor; + }, checkBatchAxis?: boolean, batchSize?: number): [Tensor[], Tensor[], Tensor[]]; + private fitLoop(f, ins, outLabels?, batchSize?, epochs?, verbose?, callbacks?, valF?, valIns?, shuffle?, callbackMetrics?, initialEpoch?, stepsPerEpoch?, validationSteps?); + private testLoop(f, ins, batchSize?, verbose?, steps?); + private getDedupedMetricsNames(); + private makeTestFunction(); + fit(x: Tensor | Tensor[] | { + [inputName: string]: Tensor; + }, y: Tensor | Tensor[] | { + [inputName: string]: Tensor; + }, config?: ModelFitConfig): Promise; + protected getNamedWeights(config?: io.SaveConfig): NamedTensorMap; + save(handlerOrURL: io.IOHandler | string, config?: io.SaveConfig): Promise; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js b/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js new file mode 100644 index 0000000..7d80c41 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js @@ -0,0 +1,1158 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("../backend/state"); +var K = require("../backend/tfjs_backend"); +var base_callbacks_1 = require("../base_callbacks"); +var common_1 = require("../common"); +var errors_1 = require("../errors"); +var logs_1 = require("../logs"); +var losses = require("../losses"); +var Metrics = require("../metrics"); +var optimizers = require("../optimizers"); +var generic_utils_1 = require("../utils/generic_utils"); +var layer_utils_1 = require("../utils/layer_utils"); +var math_utils_1 = require("../utils/math_utils"); +var container_1 = require("./container"); +var executor_1 = require("./executor"); +function isDataTensor(x) { + return x instanceof tfjs_core_1.Tensor; +} +exports.isDataTensor = isDataTensor; +function isDataArray(x) { + return Array.isArray(x); +} +exports.isDataArray = isDataArray; +function isDataDict(x) { + return !isDataTensor(x) && !isDataArray(x); +} +exports.isDataDict = isDataDict; +function standardizeInputData(data, names, shapes, checkBatchAxis, exceptionPrefix) { + if (checkBatchAxis === void 0) { checkBatchAxis = true; } + if (exceptionPrefix === void 0) { exceptionPrefix = ''; } + if (names == null || names.length === 0) { + if (data != null) { + var gotUnexpectedData = false; + if (isDataArray(data) && data.length > 0) { + gotUnexpectedData = true; + } + else if (isDataDict(data)) { + for (var key in data) { + if (data.hasOwnProperty(key)) { + gotUnexpectedData = true; + break; + } + } + } + else { + gotUnexpectedData = true; + } + if (gotUnexpectedData) { + throw new errors_1.ValueError("Error when checking model " + exceptionPrefix + " expected no data, " + + ("but got " + data)); + } + } + return []; + } + if (data == null) { + return names.map(function (name) { return null; }); + } + var arrays; + if (isDataDict(data)) { + data = data; + arrays = []; + for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { + var name_1 = names_1[_i]; + if (data[name_1] == null) { + throw new errors_1.ValueError("No data provided for \"" + name_1 + "\". Need data for each key in: " + + ("" + names)); + } + arrays.push(data[name_1]); + } + } + else if (isDataArray(data)) { + data = data; + if (data.length !== names.length) { + throw new errors_1.ValueError("Error when checking model " + exceptionPrefix + ": the Array of " + + "Tensors that you are passing to your model is not the size the " + + ("model expected. Expected to see " + names.length + " Tensor(s), but ") + + ("instead got the following list of Tensor(s): " + data)); + } + arrays = data; + } + else { + data = data; + if (names.length > 1) { + throw new errors_1.ValueError("The model " + exceptionPrefix + " expects " + names.length + " Tensor(s), " + + ("but only received one Tensor. Found: Tensor with shape " + data.shape)); + } + arrays = [data]; + } + for (var i = 0; i < names.length; ++i) { + var array = arrays[i]; + if (array.shape.length === 1) { + arrays[i] = K.expandDims(array, 1); + } + } + if (shapes != null) { + for (var i = 0; i < names.length; ++i) { + if (shapes[i] == null) { + continue; + } + var array = arrays[i]; + if (array.shape.length !== shapes[i].length) { + throw new errors_1.ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + + ("to have " + shapes[i].length + " dimension(s). but got array with ") + + ("shape " + array.shape)); + } + for (var j = 0; j < shapes[i].length; ++j) { + if (j === 0 && !checkBatchAxis) { + continue; + } + var dim = array.shape[j]; + var refDim = shapes[i][j]; + if (refDim != null && refDim >= 0 && dim !== refDim) { + throw new errors_1.ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + + ("to have shape [" + shapes[i] + "], but got array with shape ") + + ("[" + array.shape + "].")); + } + } + } + } + return arrays; +} +exports.standardizeInputData = standardizeInputData; +function checkArrayLengths(inputs, targets, weights) { + var setX = generic_utils_1.unique(inputs.map(function (input) { return input.shape[0]; })); + setX.sort(); + var setY = generic_utils_1.unique(targets.map(function (target) { return target.shape[0]; })); + setY.sort(); + if (setX.length > 1) { + throw new errors_1.ValueError("All input Tensors (x) should have the same number of samples. " + + "Got array shapes: " + + ("" + JSON.stringify(inputs.map(function (input) { return input.shape; })))); + } + if (setY.length > 1) { + throw new errors_1.ValueError("All target Tensors (y) should have the same number of samples. " + + "Got array shapes: " + + ("" + JSON.stringify(targets.map(function (target) { return target.shape; })))); + } + if (setX.length > 0 && setY.length > 0 && !tfjs_core_1.util.arraysEqual(setX, setY)) { + throw new errors_1.ValueError("Input Tensors should have the same number of samples as target " + + ("Tensors. Found " + setX[0] + " input sample(s) and " + setY[0] + " target ") + + "sample(s)."); + } +} +exports.checkArrayLengths = checkArrayLengths; +function checkLossAndTargetCompatibility(targets, lossFns, outputShapes) { + var keyLosses = [ + losses.meanSquaredError, losses.binaryCrossentropy, + losses.categoricalCrossentropy + ]; + for (var i = 0; i < targets.length; ++i) { + var y = targets[i]; + var loss = lossFns[i]; + var shape = outputShapes[i]; + if (loss == null) { + continue; + } + if (loss === losses.categoricalCrossentropy) { + if (y.shape[y.shape.length - 1] === 1) { + throw new errors_1.ValueError("You are passing a target array of shape " + y.shape + " while using " + + "a loss 'categorical_crossentropy'. 'categorical_crossentropy'" + + "expects targets to be binary matrices (1s and 0s) of shape " + + "[samples, classes]."); + } + } + if (keyLosses.indexOf(loss) !== -1) { + var slicedYShape = y.shape.slice(1); + var slicedShape = shape.slice(1); + for (var j = 0; j < slicedYShape.length; ++j) { + var targetDim = slicedYShape[j]; + var outDim = slicedShape[j]; + if (outDim != null && targetDim !== outDim) { + throw new errors_1.ValueError("A target Tensor with shape " + y.shape + " was passed for an " + + ("output of shape " + shape + ", while using a loss function that ") + + "expects targets to have the same shape as the output."); + } + } + } + } +} +function makeBatches(size, batchSize) { + var output = []; + var batchStart = 0; + var batchEnd = null; + while (batchStart < size) { + batchEnd = batchStart + batchSize; + if (batchEnd >= size) { + batchEnd = size; + } + output.push([batchStart, batchEnd]); + batchStart = batchEnd; + } + return output; +} +exports.makeBatches = makeBatches; +function sliceArrays(arrays, start, stop) { + if (arrays == null) { + return [null]; + } + else if (Array.isArray(arrays)) { + return arrays.map(function (array) { return K.sliceAlongFirstAxis(array, start, stop - start); }); + } + else { + return K.sliceAlongFirstAxis(arrays, start, stop - start); + } +} +function sliceArraysByIndices(arrays, indices) { + return tfc.tidy(function () { + if (arrays == null) { + return null; + } + else if (Array.isArray(arrays)) { + return arrays.map(function (array) { return sliceArraysByIndices(array, indices); }); + } + else { + return K.gather(arrays, indices.dtype === 'int32' ? indices : indices.toInt()); + } + }); +} +exports.sliceArraysByIndices = sliceArraysByIndices; +function checkInputData(data, names, shapes, checkBatchAxis, exceptionPrefix) { + if (checkBatchAxis === void 0) { checkBatchAxis = true; } + if (exceptionPrefix === void 0) { exceptionPrefix = ''; } + var arrays; + if (Array.isArray(data)) { + if (data.length !== names.length) { + throw new errors_1.ValueError("Error when checking model " + exceptionPrefix + ": the Array of " + + "Tensors that you are passing to your model is not the size the " + + ("the model expected. Expected to see " + names.length + " Tensor(s),") + + (" but instead got " + data.length + " Tensors(s).")); + } + arrays = data; + } + else { + if (names.length > 1) { + throw new errors_1.ValueError("The model expects " + names.length + " " + exceptionPrefix + " Tensors, " + + "but only received one Tensor. Found: array with shape " + + (JSON.stringify(data.shape) + ".")); + } + arrays = [data]; + } + if (shapes != null) { + for (var i = 0; i < names.length; ++i) { + if (shapes[i] == null) { + continue; + } + var array = arrays[i]; + if (array.shape.length !== shapes[i].length) { + throw new errors_1.ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + + ("to have " + shapes[i].length + " dimension(s), but got array with ") + + ("shape " + JSON.stringify(array.shape))); + } + for (var j = 0; j < shapes[i].length; ++j) { + if (j === 0 && !checkBatchAxis) { + continue; + } + var dim = array.shape[j]; + var refDim = shapes[i][j]; + if (refDim != null) { + if (refDim !== dim) { + throw new errors_1.ValueError("Error when checking " + exceptionPrefix + ": expected " + + (names[i] + " to have shape " + JSON.stringify(shapes[i]) + " but ") + + ("got array with shape " + JSON.stringify(array.shape) + ".")); + } + } + } + } + } +} +function collectMetrics(metrics, outputNames) { + if (metrics == null || Array.isArray(metrics) && metrics.length === 0) { + return outputNames.map(function (name) { return []; }); + } + if (Array.isArray(metrics)) { + return outputNames.map(function (name) { return metrics; }); + } + else if (metrics != null) { + var nestedMetrics = []; + for (var _i = 0, outputNames_1 = outputNames; _i < outputNames_1.length; _i++) { + var name_2 = outputNames_1[_i]; + var outputMetrics = metrics.hasOwnProperty(name_2) ? metrics[name_2] : []; + if (!Array.isArray(outputMetrics)) { + outputMetrics = [outputMetrics]; + } + nestedMetrics.push(outputMetrics); + } + return nestedMetrics; + } + else { + throw new TypeError('Type of metrics argument not understood. Expected an Array or ' + + 'Object, found: ' + metrics); + } +} +var ModelLoggingVerbosity; +(function (ModelLoggingVerbosity) { + ModelLoggingVerbosity[ModelLoggingVerbosity["SILENT"] = 0] = "SILENT"; + ModelLoggingVerbosity[ModelLoggingVerbosity["VERBOSE"] = 1] = "VERBOSE"; +})(ModelLoggingVerbosity = exports.ModelLoggingVerbosity || (exports.ModelLoggingVerbosity = {})); +var Model = (function (_super) { + __extends(Model, _super); + function Model(config) { + return _super.call(this, config) || this; + } + Model.prototype.summary = function (lineLength, positions, printFn) { + if (printFn === void 0) { printFn = console.log; } + if (!this.built) { + throw new errors_1.ValueError("This model has never been called, thus its weights have not been " + + "created yet. So no summary can be displayed. Build the model " + + "first (e.g., by calling it on some test data)."); + } + layer_utils_1.printSummary(this, lineLength, positions, printFn); + }; + Model.prototype.compile = function (config) { + var _this = this; + if (config.loss == null) { + config.loss = []; + } + this.loss = config.loss; + if (typeof config.optimizer === 'string') { + this.optimizer = optimizers.getOptimizer(config.optimizer); + } + else { + if (!(config.optimizer instanceof tfjs_core_1.Optimizer)) { + throw new errors_1.ValueError("User-defined optimizer must be an instance of tf.Optimizer."); + } + this.optimizer = config.optimizer; + } + var lossFunctions = []; + if (!Array.isArray(config.loss) && typeof config.loss !== 'string' && + typeof config.loss !== 'function') { + config.loss = config.loss; + for (var name_3 in config.loss) { + if (this.outputNames.indexOf(name_3) === -1) { + throw new errors_1.ValueError("Unknown entry in loss dictionary: \"" + name_3 + "\". Only expect the " + + ("following keys: " + this.outputNames)); + } + } + for (var name_4 in this.outputNames) { + if (config.loss[name_4] == null) { + console.warn("Output \"" + name_4 + "\" is missing from loss dictionary. We assume " + + "this was done on purpose, and we will not be expecting data " + + ("to be passed to " + name_4 + " during training")); + } + lossFunctions.push(losses.get(config.loss[name_4])); + } + } + else if (Array.isArray(config.loss)) { + if (config.loss.length !== this.outputs.length) { + throw new errors_1.ValueError("When passing an Array as loss, it should have one entry per " + + ("model output. The model has " + this.outputs.length + " output(s), ") + + ("but you passed loss=" + config.loss + ".")); + } + var theLosses = config.loss; + lossFunctions = theLosses.map(function (l) { return losses.get(l); }); + } + else { + var lossFunction_1 = losses.get(config.loss); + this.outputs.map(function (layer) { + lossFunctions.push(lossFunction_1); + }); + } + this.lossFunctions = lossFunctions; + this.feedOutputNames = []; + this.feedOutputShapes = []; + this.feedLossFns = []; + for (var i = 0; i < this.outputs.length; ++i) { + var shape = this.internalOutputShapes[i]; + var name_5 = this.outputNames[i]; + this.feedOutputNames.push(name_5); + this.feedOutputShapes.push(shape); + this.feedLossFns.push(this.lossFunctions[i]); + } + var skipTargetIndices = []; + this.metrics = config.metrics; + this.metricsNames = ['loss']; + this.metricsTensors = []; + common_1.nameScope('loss', function () { + for (var i = 0; i < _this.outputs.length; ++i) { + if (skipTargetIndices.indexOf(i) !== -1) { + continue; + } + var weightedLoss = _this.lossFunctions[i]; + if (_this.outputs.length > 1) { + _this.metricsTensors.push([weightedLoss, i]); + _this.metricsNames.push(_this.outputNames[i] + '_loss'); + } + } + }); + var nestedMetrics = collectMetrics(config.metrics, this.outputNames); + var appendMetric = function (outputIndex, metricName, metricTensor) { + if (_this.outputNames.length > 1) { + metricName = _this.outputNames[outputIndex] + '_' + metricName; + } + _this.metricsNames.push(metricName); + _this.metricsTensors.push([metricTensor, outputIndex]); + }; + common_1.nameScope('metric', function () { + var _loop_1 = function (i) { + if (skipTargetIndices.indexOf(i) !== -1) { + return "continue"; + } + var outputMetrics = nestedMetrics[i]; + var handleMetrics = function (metrics) { + var metricNamePrefix = ''; + var metricName; + var accFn; + var weightedMetricFn; + var _loop_2 = function (metric) { + if (['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !== + -1) { + var outputShape = _this.internalOutputShapes[i]; + if (outputShape[outputShape.length - 1] === 1 || + _this.lossFunctions[i] === losses.binaryCrossentropy) { + if (['accuracy', 'acc'].indexOf(metric) !== -1) { + accFn = Metrics.binaryAccuracy; + } + else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { + accFn = Metrics.binaryCrossentropy; + } + } + else if (_this.lossFunctions[i] === + losses.sparseCategoricalCrossentropy) { + if (['accuracy', 'acc'].indexOf(metric) !== -1) { + accFn = Metrics.sparseCategoricalAccuracy; + } + else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { + accFn = Metrics.sparseCategoricalCrossentropy; + } + } + else { + if (['accuracy', 'acc'].indexOf(metric) !== -1) { + accFn = Metrics.categoricalAccuracy; + } + else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { + accFn = Metrics.categoricalCrossentropy; + } + } + var suffix = void 0; + if (['accuracy', 'acc'].indexOf(metric) !== -1) { + suffix = 'acc'; + } + else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { + suffix = 'ce'; + } + weightedMetricFn = accFn; + metricName = metricNamePrefix + suffix; + } + else { + var metricFn = Metrics.get(metric); + weightedMetricFn = metricFn; + metricName = metricNamePrefix + metric; + } + var metricResult; + common_1.nameScope(metricName, function () { + metricResult = weightedMetricFn; + }); + appendMetric(i, metricName, metricResult); + }; + for (var _i = 0, metrics_1 = metrics; _i < metrics_1.length; _i++) { + var metric = metrics_1[_i]; + _loop_2(metric); + } + }; + handleMetrics(outputMetrics); + }; + for (var i = 0; i < _this.outputs.length; ++i) { + _loop_1(i); + } + }); + this.collectedTrainableWeights = this.trainableWeights; + }; + Model.prototype.checkTrainableWeightsConsistency = function () { + if (this.collectedTrainableWeights == null) { + return; + } + if (this.trainableWeights.length !== + this.collectedTrainableWeights.length) { + console.warn('Discrepancy between trainableweights and collected trainable ' + + 'weights. Did you set `model.trainable` without calling ' + + '`model.compile()` afterwards?'); + } + }; + Model.prototype.evaluate = function (x, y, config) { + if (config === void 0) { config = {}; } + var batchSize = config.batchSize == null ? 32 : config.batchSize; + var standardizedOuts = this.standardizeUserData(x, y, true, batchSize); + var ins = standardizedOuts[0].concat(standardizedOuts[1]); + this.makeTestFunction(); + var f = this.testFunction; + var testOuts = this.testLoop(f, ins, batchSize, config.verbose, config.steps); + return generic_utils_1.singletonOrArray(testOuts); + }; + Model.prototype.checkNumSamples = function (ins, batchSize, steps, stepsName) { + if (stepsName === void 0) { stepsName = 'steps'; } + var numSamples; + if (steps != null) { + numSamples = null; + if (batchSize != null) { + throw new errors_1.ValueError("If " + stepsName + " is set, batchSize must be null or undefined." + + ("Got batchSize = " + batchSize)); + } + } + else if (ins != null) { + if (Array.isArray(ins)) { + numSamples = ins[0].shape[0]; + } + else { + numSamples = ins.shape[0]; + } + } + else { + throw new errors_1.ValueError("Either the input data should have a defined shape, or " + + (stepsName + " shoud be specified.")); + } + return numSamples; + }; + Model.prototype.execute = function (inputs, outputs) { + if (Array.isArray(outputs) && outputs.length === 0) { + throw new errors_1.ValueError('`outputs` is an empty Array, which is not allowed.'); + } + var outputsIsArray = Array.isArray(outputs); + var outputNames = (outputsIsArray ? outputs : + [outputs]); + var outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames); + var feedDict = new executor_1.FeedDict(); + if (inputs instanceof tfjs_core_1.Tensor) { + inputs = [inputs]; + } + if (Array.isArray(inputs)) { + if (inputs.length !== this.inputs.length) { + throw new errors_1.ValueError("The number of inputs provided (" + inputs.length + ") " + + "does not match the number of inputs of this model " + + ("(" + this.inputs.length + ").")); + } + for (var i = 0; i < this.inputs.length; ++i) { + feedDict.add(this.inputs[i], inputs[i]); + } + } + else { + for (var _i = 0, _a = this.inputs; _i < _a.length; _i++) { + var input = _a[_i]; + var tensorValue = inputs[input.name]; + if (tensorValue == null) { + throw new errors_1.ValueError("No value is provided for the model's input " + input.name); + } + feedDict.add(input, tensorValue); + } + } + var executeOutputs = executor_1.execute(outputSymbolicTensors, feedDict); + return outputsIsArray ? executeOutputs : executeOutputs[0]; + }; + Model.prototype.retrieveSymbolicTensors = function (symbolicTensorNames) { + var outputSymbolicTensors = generic_utils_1.pyListRepeat(null, symbolicTensorNames.length); + var outputsRemaining = symbolicTensorNames.length; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + var layerOutputs = Array.isArray(layer.output) ? + layer.output : + [layer.output]; + var layerOutputNames = layerOutputs.map(function (output) { return output.name; }); + for (var i = 0; i < symbolicTensorNames.length; ++i) { + var index = layerOutputNames.indexOf(symbolicTensorNames[i]); + if (index !== -1) { + outputSymbolicTensors[i] = layerOutputs[index]; + outputsRemaining--; + } + if (outputsRemaining === 0) { + break; + } + } + if (outputsRemaining === 0) { + break; + } + } + if (outputsRemaining > 0) { + var remainingNames_1 = []; + outputSymbolicTensors.forEach(function (tensor, i) { + if (tensor == null) { + remainingNames_1.push(symbolicTensorNames[i]); + } + }); + throw new errors_1.ValueError("Cannot find SymbolicTensors for output name(s): " + + ("" + JSON.stringify(remainingNames_1))); + } + return outputSymbolicTensors; + }; + Model.prototype.predictLoop = function (ins, batchSize, verbose) { + var _this = this; + if (batchSize === void 0) { batchSize = 32; } + if (verbose === void 0) { verbose = false; } + return tfc.tidy(function () { + var numSamples = _this.checkNumSamples(ins); + if (verbose) { + throw new errors_1.NotImplementedError('Verbose predictLoop() is not implemented yet.'); + } + var batches = makeBatches(numSamples, batchSize); + var outs = []; + var _loop_3 = function (batchIndex) { + var batchOuts = tfc.tidy(function () { + var batchStart = batches[batchIndex][0]; + var batchEnd = batches[batchIndex][1]; + var insBatch = sliceArrays(ins, batchStart, batchEnd); + var feeds = []; + if (Array.isArray(insBatch)) { + for (var i = 0; i < insBatch.length; ++i) { + feeds.push({ key: _this.inputs[i], value: insBatch[i] }); + } + } + else { + feeds.push({ key: _this.inputs[0], value: insBatch }); + } + var feedDict = new executor_1.FeedDict(feeds); + return executor_1.execute(_this.outputs, feedDict); + }); + if (batchIndex === 0) { + for (var _i = 0, batchOuts_1 = batchOuts; _i < batchOuts_1.length; _i++) { + var batchOut = batchOuts_1[_i]; + outs.push(batchOut); + } + } + else { + for (var i = 0; i < batchOuts.length; ++i) { + outs[i] = K.concatAlongFirstAxis(outs[i], batchOuts[i]); + } + } + }; + for (var batchIndex = 0; batchIndex < batches.length; ++batchIndex) { + _loop_3(batchIndex); + } + return generic_utils_1.singletonOrArray(outs); + }); + }; + Model.prototype.predict = function (x, config) { + if (config === void 0) { config = {}; } + checkInputData(x, this.inputNames, this.feedInputShapes, false); + var batchSize = config.batchSize == null ? 32 : config.batchSize; + return this.predictLoop(x, batchSize); + }; + Model.prototype.predictOnBatch = function (x) { + checkInputData(x, this.inputNames, this.feedInputShapes, true); + return this.predictLoop(x, x.shape[0]); + }; + Model.prototype.standardizeUserData = function (x, y, checkBatchAxis, batchSize) { + if (checkBatchAxis === void 0) { checkBatchAxis = true; } + if (this.optimizer == null) { + throw new errors_1.RuntimeError('You must compile a model before training/testing. Use ' + + 'Model.compile(modelCompileConfig).'); + } + var outputShapes = []; + for (var i = 0; i < this.feedOutputShapes.length; ++i) { + var outputShape = this.feedOutputShapes[i]; + var lossFn = this.feedLossFns[i]; + if (lossFn === losses.sparseCategoricalCrossentropy) { + outputShapes.push(outputShape.slice(0, outputShape.length - 1).concat([1])); + } + else { + outputShapes.push(outputShape); + } + } + x = standardizeInputData(x, this.feedInputNames, this.feedInputShapes, false, 'input'); + y = standardizeInputData(y, this.feedOutputNames, outputShapes, false, 'target'); + checkArrayLengths(x, y, null); + checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes); + if (this.stateful && batchSize != null && batchSize > 0) { + if (x[0].shape[0] % batchSize !== 0) { + throw new errors_1.ValueError("In a stateful network, you should only pass inputs with a " + + "number of samples that is divisible by the batch size " + + (batchSize + ". Found: " + x[0].shape[0] + " sample(s).")); + } + } + return [x, y, null]; + }; + Model.prototype.fitLoop = function (f, ins, outLabels, batchSize, epochs, verbose, callbacks, valF, valIns, shuffle, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var doValidation, numTrainSamples, indexArray, callbackList, _loop_4, this_1, epoch, state_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (batchSize == null) { + batchSize = 32; + } + if (epochs == null) { + epochs = 1; + } + if (shuffle == null) { + shuffle = true; + } + if (initialEpoch == null) { + initialEpoch = 0; + } + doValidation = false; + if (valF != null && valIns != null) { + doValidation = true; + } + if (validationSteps != null) { + doValidation = true; + if (stepsPerEpoch == null) { + throw new errors_1.ValueError('Can only use `validationSteps` when doing step-wise training, ' + + 'i.e., `stepsPerEpoch` must be set.'); + } + } + numTrainSamples = this.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch'); + if (numTrainSamples != null) { + indexArray = math_utils_1.range(0, numTrainSamples); + } + this.history = new base_callbacks_1.History(); + if (callbacks == null) { + callbacks = [new base_callbacks_1.BaseLogger()]; + } + else { + callbacks = [new base_callbacks_1.BaseLogger()].concat(callbacks); + } + callbacks = callbacks.concat([this.history]); + if (verbose > 0) { + throw new errors_1.NotImplementedError('Verbose mode is not implemented yet.'); + } + callbackList = new base_callbacks_1.CallbackList(callbacks); + callbackList.setModel(this); + callbackList.setParams({ + epochs: epochs, + initialEpoch: initialEpoch, + steps: stepsPerEpoch, + verbose: verbose, + doValidation: doValidation, + metrics: callbackMetrics, + }); + return [4, callbackList.onTrainBegin()]; + case 1: + _a.sent(); + this.stopTraining = false; + _loop_4 = function (epoch) { + var epochLogs, epochIndexArray1D_1, batches_1, _loop_5, batchIndex, state_3; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4, callbackList.onEpochBegin(epoch)]; + case 1: + _a.sent(); + epochLogs = {}; + if (!(stepsPerEpoch != null)) return [3, 2]; + throw new errors_1.NotImplementedError('stepsPerEpoch mode is not implemented yet.'); + case 2: + if (shuffle === 'batch') { + throw new errors_1.NotImplementedError('batch shuffling is not implemneted yet'); + } + else if (shuffle) { + tfjs_core_1.util.shuffle(indexArray); + } + epochIndexArray1D_1 = tfjs_core_1.tensor1d(indexArray); + batches_1 = makeBatches(numTrainSamples, batchSize); + _loop_5 = function (batchIndex) { + var batchLogs; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + batchLogs = {}; + return [4, callbackList.onBatchBegin(batchIndex, batchLogs)]; + case 1: + _a.sent(); + tfc.tidy(function () { + var batchStart = batches_1[batchIndex][0]; + var batchEnd = batches_1[batchIndex][1]; + var batchIds = K.sliceAlongFirstAxis(epochIndexArray1D_1, batchStart, batchEnd - batchStart); + batchLogs['batch'] = batchIndex; + batchLogs['size'] = batchEnd - batchStart; + var insBatch = sliceArraysByIndices(ins, batchIds); + var outs = f(insBatch); + for (var i = 0; i < outLabels.length; ++i) { + var label = outLabels[i]; + var out = outs[i]; + batchLogs[label] = out; + tfc.keep(out); + } + if (batchIndex === batches_1.length - 1) { + if (doValidation) { + var valOuts = _this.testLoop(valF, valIns, batchSize); + for (var i = 0; i < outLabels.length; ++i) { + var label = outLabels[i]; + var out = valOuts[i]; + tfc.keep(out); + epochLogs['val_' + label] = out; + } + } + } + }); + return [4, callbackList.onBatchEnd(batchIndex, batchLogs)]; + case 2: + _a.sent(); + logs_1.disposeTensorsInLogs(batchLogs); + if (this_1.stopTraining) { + return [2, "break"]; + } + return [2]; + } + }); + }; + batchIndex = 0; + _a.label = 3; + case 3: + if (!(batchIndex < batches_1.length)) return [3, 6]; + return [5, _loop_5(batchIndex)]; + case 4: + state_3 = _a.sent(); + if (state_3 === "break") + return [3, 6]; + _a.label = 5; + case 5: + ++batchIndex; + return [3, 3]; + case 6: + epochIndexArray1D_1.dispose(); + _a.label = 7; + case 7: return [4, callbackList.onEpochEnd(epoch, epochLogs)]; + case 8: + _a.sent(); + if (this_1.stopTraining) { + return [2, "break"]; + } + return [2]; + } + }); + }; + this_1 = this; + epoch = initialEpoch; + _a.label = 2; + case 2: + if (!(epoch < epochs)) return [3, 5]; + return [5, _loop_4(epoch)]; + case 3: + state_2 = _a.sent(); + if (state_2 === "break") + return [3, 5]; + _a.label = 4; + case 4: + ++epoch; + return [3, 2]; + case 5: return [4, callbackList.onTrainEnd()]; + case 6: + _a.sent(); + return [4, this.history.syncData()]; + case 7: + _a.sent(); + return [2, this.history]; + } + }); + }); + }; + Model.prototype.testLoop = function (f, ins, batchSize, verbose, steps) { + var _this = this; + if (verbose === void 0) { verbose = 0; } + return tfc.tidy(function () { + var numSamples = _this.checkNumSamples(ins, batchSize, steps, 'steps'); + var outs = []; + if (verbose === 1) { + throw new errors_1.NotImplementedError('Verbose mode is not implemented yet.'); + } + if (steps != null) { + throw new errors_1.NotImplementedError('steps mode in testLoop() is not implemented yet'); + } + else { + var batches = makeBatches(numSamples, batchSize); + var indexArray = tfjs_core_1.tensor1d(math_utils_1.range(0, numSamples)); + for (var batchIndex = 0; batchIndex < batches.length; ++batchIndex) { + var batchStart = batches[batchIndex][0]; + var batchEnd = batches[batchIndex][1]; + var batchIds = K.sliceAlongFirstAxis(indexArray, batchStart, batchEnd - batchStart); + var insBatch = sliceArraysByIndices(ins, batchIds); + var batchOuts = f(insBatch); + if (batchIndex === 0) { + for (var i = 0; i < batchOuts.length; ++i) { + outs.push(state_1.getScalar(0)); + } + } + for (var i = 0; i < batchOuts.length; ++i) { + var batchOut = batchOuts[i]; + outs[i] = + tfc.add(outs[i], tfc.mul(state_1.getScalar(batchEnd - batchStart), batchOut)); + } + } + for (var i = 0; i < outs.length; ++i) { + outs[i] = tfc.div(outs[i], state_1.getScalar(numSamples)); + } + } + return outs; + }); + }; + Model.prototype.getDedupedMetricsNames = function () { + var outLabels = this.metricsNames; + var dedupedOutLabels = []; + for (var i = 0; i < outLabels.length; ++i) { + var label = outLabels[i]; + var newLabel = label; + if (generic_utils_1.count(outLabels, label) > 1) { + var dupIndex = generic_utils_1.count(outLabels.slice(0, i), label); + newLabel += "_" + dupIndex; + } + dedupedOutLabels.push(newLabel); + } + return dedupedOutLabels; + }; + Model.prototype.makeTestFunction = function () { + var _this = this; + this.testFunction = function (data) { + return tfc.tidy(function () { + var valOutputs = []; + var totalLoss; + var inputs = data.slice(0, _this.inputs.length); + var targets = data.slice(_this.inputs.length, _this.inputs.length + _this.outputs.length); + var feeds = []; + for (var i = 0; i < _this.inputs.length; ++i) { + feeds.push({ key: _this.inputs[i], value: inputs[i] }); + } + var feedDict = new executor_1.FeedDict(feeds); + var outputs = executor_1.execute(_this.outputs, feedDict); + for (var i = 0; i < _this.lossFunctions.length; ++i) { + var lossFunction = _this.lossFunctions[i]; + var loss = tfc.mean(lossFunction(targets[i], outputs[i])); + if (i === 0) { + totalLoss = loss; + } + else { + totalLoss = tfc.add(totalLoss, loss); + } + valOutputs.push(totalLoss); + } + for (var i = 0; i < _this.metricsTensors.length; ++i) { + var metric = _this.metricsTensors[i][0]; + var outputIndex = _this.metricsTensors[i][1]; + var meanMetric = tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); + valOutputs.push(meanMetric); + } + return valOutputs; + }); + }; + }; + Model.prototype.fit = function (x, y, config) { + if (config === void 0) { config = {}; } + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var batchSize, standardizedOuts, inputs, targets, doValidation, valX, valY, valIns, needValidationDisposal, valStandardized, splitAt, originalBatchSize, ins, trainFunction, outLabels, valFunction, callbackMetrics, callbacks, out; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + batchSize = config.batchSize == null ? 32 : config.batchSize; + standardizedOuts = this.standardizeUserData(x, y, false, batchSize); + inputs = standardizedOuts[0]; + targets = standardizedOuts[1]; + doValidation = false; + needValidationDisposal = false; + if (config.validationData != null && config.validationData.length > 0) { + doValidation = true; + if (config.validationData.length === 2) { + valX = config.validationData[0]; + valY = config.validationData[1]; + } + else if (config.validationData.length === 3) { + throw new errors_1.NotImplementedError('validationData including sample weights is not supported yet.'); + } + else { + throw new errors_1.ValueError("When passing validation data, it must contain 2 (valX, valY) " + + "or 3 (valX, valY, valSampleWeight) items; " + + (config.validationData + " is invalid.")); + } + valStandardized = this.standardizeUserData(valX, valY, true, batchSize); + valX = valStandardized[0]; + valY = valStandardized[1]; + valIns = valX.concat(valY); + } + else if (config.validationSplit != null && config.validationSplit > 0 && + config.validationSplit < 1) { + doValidation = true; + splitAt = Math.floor(inputs[0].shape[0] * (1 - config.validationSplit)); + originalBatchSize = inputs[0].shape[0]; + valX = sliceArrays(inputs, splitAt, originalBatchSize); + inputs = sliceArrays(inputs, 0, splitAt); + valY = sliceArrays(targets, splitAt, originalBatchSize); + targets = sliceArrays(targets, 0, splitAt); + needValidationDisposal = true; + valIns = valX.concat(valY); + } + else if (config.validationSteps != null) { + doValidation = true; + } + ins = inputs.concat(targets); + this.checkTrainableWeightsConsistency(); + trainFunction = function (data) { + var losses = []; + var lossValues = []; + var inputs = data.slice(0, _this.inputs.length); + var targets = data.slice(_this.inputs.length, _this.inputs.length + _this.outputs.length); + var metricsValues = []; + var totalLossFunction = function () { + var feeds = []; + for (var i = 0; i < _this.inputs.length; ++i) { + feeds.push({ key: _this.inputs[i], value: inputs[i] }); + } + var feedDict = new executor_1.FeedDict(feeds); + var outputs = executor_1.execute(_this.outputs, feedDict, { 'training': true }); + var totalLoss; + for (var i = 0; i < _this.lossFunctions.length; ++i) { + var lossFunction = _this.lossFunctions[i]; + var loss = lossFunction(targets[i], outputs[i]); + losses.push(loss); + var meanLoss = tfc.mean(loss); + lossValues.push(meanLoss); + if (i === 0) { + totalLoss = loss; + } + else { + totalLoss = tfc.add(totalLoss, loss); + } + } + for (var i = 0; i < _this.metricsTensors.length; ++i) { + var metric = _this.metricsTensors[i][0]; + var outputIndex = _this.metricsTensors[i][1]; + var meanMetric = tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); + tfc.keep(meanMetric); + metricsValues.push(meanMetric); + } + totalLoss = tfc.mean(totalLoss); + _this.calculateLosses().forEach(function (regularizerLoss) { + totalLoss = tfc.add(totalLoss, regularizerLoss); + }); + return totalLoss; + }; + var variables = _this.collectedTrainableWeights.map(function (param) { return param.read(); }); + var returnCost = true; + var totalLossValue = _this.optimizer.minimize(totalLossFunction, returnCost, variables); + return [totalLossValue].concat(metricsValues); + }; + outLabels = this.getDedupedMetricsNames(); + if (doValidation) { + this.makeTestFunction(); + valFunction = this.testFunction; + callbackMetrics = + outLabels.slice().concat(outLabels.map(function (n) { return 'val_' + n; })); + } + else { + valFunction = null; + valIns = []; + callbackMetrics = outLabels.slice(); + } + callbacks = base_callbacks_1.standardizeCallbacks(config.callbacks); + return [4, this.fitLoop(trainFunction, ins, outLabels, batchSize, config.epochs, config.verbose, callbacks, valFunction, valIns, config.shuffle, callbackMetrics, config.initialEpoch, null, null)]; + case 1: + out = _a.sent(); + if (needValidationDisposal) { + valIns.forEach(function (tensor) { return tensor.dispose(); }); + inputs.forEach(function (tensor) { return tensor.dispose(); }); + targets.forEach(function (tensor) { return tensor.dispose(); }); + } + return [2, out]; + } + }); + }); + }; + Model.prototype.getNamedWeights = function (config) { + var namedWeights = {}; + var trainableOnly = config != null && config.trainableOnly; + var weights = trainableOnly ? this.trainableWeights : this.weights; + var weightValues = this.getWeights(trainableOnly); + for (var i = 0; i < weights.length; ++i) { + if (trainableOnly && !weights[i].trainable) { + continue; + } + namedWeights[weights[i].originalName] = weightValues[i]; + } + return namedWeights; + }; + Model.prototype.save = function (handlerOrURL, config) { + return __awaiter(this, void 0, void 0, function () { + var handlers, weightDataAndSpecs, returnString, unusedArg, modelConfig; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (typeof handlerOrURL === 'string') { + handlers = tfjs_core_1.io.getSaveHandlers(handlerOrURL); + if (handlers.length === 0) { + throw new errors_1.ValueError("Cannot find any save handlers for URL '" + handlerOrURL + "'"); + } + else if (handlers.length > 1) { + throw new errors_1.ValueError("Found more than one (" + handlers.length + ") save handlers for " + + ("URL '" + handlerOrURL + "'")); + } + handlerOrURL = handlers[0]; + } + if (handlerOrURL.save == null) { + throw new errors_1.ValueError('Model.save() cannot proceed because the IOHandler provided does ' + + 'not have the `save` attribute defined.'); + } + return [4, tfjs_core_1.io.encodeWeights(this.getNamedWeights(config))]; + case 1: + weightDataAndSpecs = _a.sent(); + returnString = false; + unusedArg = null; + modelConfig = this.toJSON(unusedArg, returnString); + return [2, handlerOrURL.save({ + modelTopology: modelConfig, + weightData: weightDataAndSpecs.data, + weightSpecs: weightDataAndSpecs.specs + })]; + } + }); + }); + }; + Model.className = 'Model'; + return Model; +}(container_1.Container)); +exports.Model = Model; +tfjs_core_1.serialization.SerializationMap.register(Model); +//# sourceMappingURL=training.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js.map new file mode 100644 index 0000000..402deba --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/training.js.map @@ -0,0 +1 @@ +{"version":3,"file":"training.js","sourceRoot":"","sources":["../../src/engine/training.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,2CAA6C;AAC7C,mDAAiI;AAEjI,0CAA2C;AAC3C,2CAA6C;AAC7C,oDAA8H;AAC9H,oCAAoC;AACpC,oCAAwE;AACxE,gCAA6D;AAC7D,kCAAoC;AACpC,oCAAsC;AACtC,0CAA4C;AAE5C,wDAAqF;AACrF,oDAAkD;AAClD,kDAA0C;AAG1C,yCAAuD;AACvD,uCAA6C;AAQ7C,sBAA6B,CAC+B;IAC1D,OAAO,CAAC,YAAY,kBAAM,CAAC;AAC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,GAAO,IAAI,CAAC;wBACrB,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;wBAEzD,WAAO,YAAY,CAAC,IAAI,CAAC;gCACvB,aAAa,EAAE,WAAW;gCAC1B,UAAU,EAAE,kBAAkB,CAAC,IAAI;gCACnC,WAAW,EAAE,kBAAkB,CAAC,KAAK;6BACtC,CAAC,EAAC;;;;KACJ;IA7yCM,eAAS,GAAG,OAAO,CAAC;IA8yC7B,YAAC;CAAA,AA/yCD,CAA2B,qBAAS,GA+yCnC;AA/yCY,sBAAK;AAizClB,yBAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/engine/training_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/engine/training_test.js.map new file mode 100644 index 0000000..529d301 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/engine/training_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"training_test.js","sourceRoot":"","sources":["../../src/engine/training_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,iBA40DA;;AA50DA,mDAAyK;AAEzK,2CAA6C;AAC7C,oDAAuE;AACvE,8BAAgC;AAIhC,wDAA0E;AAC1E,kDAA+F;AAI/F,uCAA6I;AAI7I,4BAAe,CAAC,cAAc,EAAE;IAC9B,EAAE,CAAC,eAAe,EAAE;QAClB,MAAM,CAAC,uBAAY,CAAC,kBAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gBAAgB,EAAE;QACnB,MAAM,CAAC,uBAAY,CAAC,CAAC,kBAAM,CAAC,IAAI,CAAC,EAAE,kBAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC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,CAAC,MAAM,EAAE,iBAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/errors.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/errors.d.ts new file mode 100644 index 0000000..6b1d87f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/errors.d.ts @@ -0,0 +1,18 @@ +export declare class AttributeError extends Error { + constructor(message?: string); +} +export declare class RuntimeError extends Error { + constructor(message?: string); +} +export declare class ValueError extends Error { + constructor(message?: string); +} +export declare class NotImplementedError extends Error { + constructor(message?: string); +} +export declare class AssertionError extends Error { + constructor(message?: string); +} +export declare class IndexError extends Error { + constructor(message?: string); +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/errors.js b/node_modules/@tensorflow/tfjs-layers/dist/errors.js new file mode 100644 index 0000000..7a9af3d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/errors.js @@ -0,0 +1,73 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var AttributeError = (function (_super) { + __extends(AttributeError, _super); + function AttributeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, AttributeError.prototype); + return _this; + } + return AttributeError; +}(Error)); +exports.AttributeError = AttributeError; +var RuntimeError = (function (_super) { + __extends(RuntimeError, _super); + function RuntimeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, RuntimeError.prototype); + return _this; + } + return RuntimeError; +}(Error)); +exports.RuntimeError = RuntimeError; +var ValueError = (function (_super) { + __extends(ValueError, _super); + function ValueError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, ValueError.prototype); + return _this; + } + return ValueError; +}(Error)); +exports.ValueError = ValueError; +var NotImplementedError = (function (_super) { + __extends(NotImplementedError, _super); + function NotImplementedError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, NotImplementedError.prototype); + return _this; + } + return NotImplementedError; +}(Error)); +exports.NotImplementedError = NotImplementedError; +var AssertionError = (function (_super) { + __extends(AssertionError, _super); + function AssertionError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, AssertionError.prototype); + return _this; + } + return AssertionError; +}(Error)); +exports.AssertionError = AssertionError; +var IndexError = (function (_super) { + __extends(IndexError, _super); + function IndexError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, IndexError.prototype); + return _this; + } + return IndexError; +}(Error)); +exports.IndexError = IndexError; +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/errors.js.map b/node_modules/@tensorflow/tfjs-layers/dist/errors.js.map new file mode 100644 index 0000000..aff48ea --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;AAwBA;IAAoC,kCAAK;IACvC,wBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAGf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;;IACxD,CAAC;IACH,qBAAC;AAAD,CAAC,AAND,CAAoC,KAAK,GAMxC;AANY,wCAAc;AAW3B;IAAkC,gCAAK;IACrC,sBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAGf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;;IACtD,CAAC;IACH,mBAAC;AAAD,CAAC,AAND,CAAkC,KAAK,GAMtC;AANY,oCAAY;AAWzB;IAAgC,8BAAK;IACnC,oBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAGf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;;IACpD,CAAC;IACH,iBAAC;AAAD,CAAC,AAND,CAAgC,KAAK,GAMpC;AANY,gCAAU;AAWvB;IAAyC,uCAAK;IAC5C,6BAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAGf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;;IAC7D,CAAC;IACH,0BAAC;AAAD,CAAC,AAND,CAAyC,KAAK,GAM7C;AANY,kDAAmB;AAWhC;IAAoC,kCAAK;IACvC,wBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAGf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;;IACxD,CAAC;IACH,qBAAC;AAAD,CAAC,AAND,CAAoC,KAAK,GAMxC;AANY,wCAAc;AAW3B;IAAgC,8BAAK;IACnC,oBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAGf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;;IACpD,CAAC;IACH,iBAAC;AAAD,CAAC,AAND,CAAgC,KAAK,GAMpC;AANY,gCAAU"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/errors_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/errors_test.js.map new file mode 100644 index 0000000..5ab7867 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/errors_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors_test.js","sourceRoot":"","sources":["../src/errors_test.ts"],"names":[],"mappings":";;AAUA,mCAAkE;AAElE,QAAQ,CAAC,eAAe,EAAE;4BAEb,SAAS;QAClB,EAAE,CAAC,wBAAwB,EAAE;YAC3B,IAAM,GAAG,GAAG,cAAc,CAAC;YAC3B,IAAM,CAAC,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC;YAC7B,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC/B,MAAM,CAAC,CAAC,YAAY,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;IAPD,KAAwB,UAA0C,EAA1C,MAAC,uBAAc,EAAE,qBAAY,EAAE,mBAAU,CAAC,EAA1C,cAA0C,EAA1C,IAA0C;QAA7D,IAAM,SAAS,SAAA;gBAAT,SAAS;KAOnB;AACH,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/exports.d.ts new file mode 100644 index 0000000..e3d0482 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports.d.ts @@ -0,0 +1,10 @@ +import { io } from '@tensorflow/tfjs-core'; +import { ContainerConfig } from './engine/container'; +import { InputConfig } from './engine/input_layer'; +import { SymbolicTensor } from './engine/topology'; +import { Model } from './engine/training'; +import { Sequential, SequentialConfig } from './models'; +export declare function model(config: ContainerConfig): Model; +export declare function sequential(config?: SequentialConfig): Sequential; +export declare function loadModel(pathOrIOHandler: string | io.IOHandler): Promise; +export declare function input(config: InputConfig): SymbolicTensor; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports.js b/node_modules/@tensorflow/tfjs-layers/dist/exports.js new file mode 100644 index 0000000..bb75ef3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var input_layer_1 = require("./engine/input_layer"); +var training_1 = require("./engine/training"); +var models_1 = require("./models"); +function model(config) { + return new training_1.Model(config); +} +exports.model = model; +function sequential(config) { + return new models_1.Sequential(config); +} +exports.sequential = sequential; +function loadModel(pathOrIOHandler) { + return models_1.loadModelInternal(pathOrIOHandler); +} +exports.loadModel = loadModel; +function input(config) { + return input_layer_1.Input(config); +} +exports.input = input; +//# sourceMappingURL=exports.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports.js.map b/node_modules/@tensorflow/tfjs-layers/dist/exports.js.map new file mode 100644 index 0000000..ebbc39e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":";;AAkBA,oDAAyD;AAEzD,8CAAwC;AACxC,mCAAyE;AAmDzE,eAAsB,MAAuB;IAC3C,OAAO,IAAI,gBAAK,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAFD,sBAEC;AA8DD,oBAA2B,MAAyB;IAClD,OAAO,IAAI,mBAAU,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAFD,gCAEC;AASD,mBAA0B,eACY;IACpC,OAAO,0BAAiB,CAAC,eAAe,CAAC,CAAC;AAC5C,CAAC;AAHD,8BAGC;AAUD,eAAsB,MAAmB;IACvC,OAAO,mBAAK,CAAC,MAAM,CAAC,CAAC;AACvB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.d.ts new file mode 100644 index 0000000..b6f53db --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.d.ts @@ -0,0 +1,5 @@ +import { Constraint, MaxNormConfig, MinMaxNormConfig, UnitNormConfig } from './constraints'; +export declare function maxNorm(config: MaxNormConfig): Constraint; +export declare function unitNorm(config: UnitNormConfig): Constraint; +export declare function nonNeg(): Constraint; +export declare function minMaxNorm(config: MinMaxNormConfig): Constraint; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js b/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js new file mode 100644 index 0000000..356397c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var constraints_1 = require("./constraints"); +function maxNorm(config) { + return new constraints_1.MaxNorm(config); +} +exports.maxNorm = maxNorm; +function unitNorm(config) { + return new constraints_1.UnitNorm(config); +} +exports.unitNorm = unitNorm; +function nonNeg() { + return new constraints_1.NonNeg(); +} +exports.nonNeg = nonNeg; +function minMaxNorm(config) { + return new constraints_1.MinMaxNorm(config); +} +exports.minMaxNorm = minMaxNorm; +//# sourceMappingURL=exports_constraints.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js.map b/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js.map new file mode 100644 index 0000000..a9d2a5f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_constraints.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exports_constraints.js","sourceRoot":"","sources":["../src/exports_constraints.ts"],"names":[],"mappings":";;AAUA,6CAAiI;AAUjI,iBAAwB,MAAqB;IAC3C,OAAO,IAAI,qBAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC;AAFD,0BAEC;AAUD,kBAAyB,MAAsB;IAC7C,OAAO,IAAI,sBAAQ,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAFD,4BAEC;AASD;IACE,OAAO,IAAI,oBAAM,EAAE,CAAC;AACtB,CAAC;AAFD,wBAEC;AAUD,oBAA2B,MAAwB;IACjD,OAAO,IAAI,wBAAU,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.d.ts new file mode 100644 index 0000000..7844d02 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.d.ts @@ -0,0 +1,14 @@ +import { ConstantConfig, IdentityConfig, Initializer, OrthogonalConfig, RandomNormalConfig, RandomUniformConfig, SeedOnlyInitializerConfig, TruncatedNormalConfig, VarianceScalingConfig, Zeros } from './initializers'; +export declare function zeros(): Zeros; +export declare function ones(): Initializer; +export declare function constant(config: ConstantConfig): Initializer; +export declare function randomUniform(config: RandomUniformConfig): Initializer; +export declare function randomNormal(config: RandomNormalConfig): Initializer; +export declare function truncatedNormal(config: TruncatedNormalConfig): Initializer; +export declare function identity(config: IdentityConfig): Initializer; +export declare function varianceScaling(config: VarianceScalingConfig): Initializer; +export declare function glorotUniform(config: SeedOnlyInitializerConfig): Initializer; +export declare function glorotNormal(config: SeedOnlyInitializerConfig): Initializer; +export declare function heNormal(config: SeedOnlyInitializerConfig): Initializer; +export declare function leCunNormal(config: SeedOnlyInitializerConfig): Initializer; +export declare function orthogonal(config: OrthogonalConfig): Initializer; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js b/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js new file mode 100644 index 0000000..da38050 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var initializers_1 = require("./initializers"); +function zeros() { + return new initializers_1.Zeros(); +} +exports.zeros = zeros; +function ones() { + return new initializers_1.Ones(); +} +exports.ones = ones; +function constant(config) { + return new initializers_1.Constant(config); +} +exports.constant = constant; +function randomUniform(config) { + return new initializers_1.RandomUniform(config); +} +exports.randomUniform = randomUniform; +function randomNormal(config) { + return new initializers_1.RandomNormal(config); +} +exports.randomNormal = randomNormal; +function truncatedNormal(config) { + return new initializers_1.TruncatedNormal(config); +} +exports.truncatedNormal = truncatedNormal; +function identity(config) { + return new initializers_1.Identity(config); +} +exports.identity = identity; +function varianceScaling(config) { + return new initializers_1.VarianceScaling(config); +} +exports.varianceScaling = varianceScaling; +function glorotUniform(config) { + return new initializers_1.GlorotUniform(config); +} +exports.glorotUniform = glorotUniform; +function glorotNormal(config) { + return new initializers_1.GlorotNormal(config); +} +exports.glorotNormal = glorotNormal; +function heNormal(config) { + return new initializers_1.HeNormal(config); +} +exports.heNormal = heNormal; +function leCunNormal(config) { + return new initializers_1.LeCunNormal(config); +} +exports.leCunNormal = leCunNormal; +function orthogonal(config) { + return new initializers_1.Orthogonal(config); +} +exports.orthogonal = orthogonal; +//# sourceMappingURL=exports_initializers.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js.map b/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js.map new file mode 100644 index 0000000..df375a5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_initializers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exports_initializers.js","sourceRoot":"","sources":["../src/exports_initializers.ts"],"names":[],"mappings":";;AAUA,+CAA+W;AAS/W;IACE,OAAO,IAAI,oBAAK,EAAE,CAAC;AACrB,CAAC;AAFD,sBAEC;AASD;IACE,OAAO,IAAI,mBAAI,EAAE,CAAC;AACpB,CAAC;AAFD,oBAEC;AAUD,kBAAyB,MAAsB;IAC7C,OAAO,IAAI,uBAAQ,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAFD,4BAEC;AAUD,uBAA8B,MAA2B;IACvD,OAAO,IAAI,4BAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAFD,sCAEC;AAUD,sBAA6B,MAA0B;IACrD,OAAO,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAFD,oCAEC;AAUD,yBAAgC,MAA6B;IAC3D,OAAO,IAAI,8BAAe,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAFD,0CAEC;AAUD,kBAAyB,MAAsB;IAC7C,OAAO,IAAI,uBAAQ,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAFD,4BAEC;AAUD,yBAAgC,MAA6B;IAC3D,OAAO,IAAI,8BAAe,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAFD,0CAEC;AAUD,uBAA8B,MAAiC;IAC7D,OAAO,IAAI,4BAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAFD,sCAEC;AAUD,sBAA6B,MAAiC;IAC5D,OAAO,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAFD,oCAEC;AAUD,kBAAyB,MAAiC;IACxD,OAAO,IAAI,uBAAQ,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAFD,4BAEC;AAUD,qBAA4B,MAAiC;IAC3D,OAAO,IAAI,0BAAW,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAFD,kCAEC;AAUD,oBAA2B,MAAwB;IACjD,OAAO,IAAI,yBAAU,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.d.ts new file mode 100644 index 0000000..ac64c89 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.d.ts @@ -0,0 +1,68 @@ +import { InputLayerConfig } from './engine/input_layer'; +import { Layer, LayerConfig } from './engine/topology'; +import { input } from './exports'; +import { ELULayerConfig, LeakyReLULayerConfig, SoftmaxLayerConfig, ThresholdedReLULayerConfig } from './layers/advanced_activations'; +import { ConvLayerConfig, Cropping2DLayerConfig, SeparableConvLayerConfig, UpSampling2DLayerConfig } from './layers/convolutional'; +import { DepthwiseConv2DLayerConfig } from './layers/convolutional_depthwise'; +import { ActivationLayerConfig, DenseLayerConfig, DropoutLayerConfig, RepeatVectorLayerConfig, ReshapeLayerConfig } from './layers/core'; +import { EmbeddingLayerConfig } from './layers/embeddings'; +import { ConcatenateLayerConfig } from './layers/merge'; +import { BatchNormalizationLayerConfig } from './layers/normalization'; +import { ZeroPadding2DLayerConfig } from './layers/padding'; +import { GlobalPooling2DLayerConfig, Pooling1DLayerConfig, Pooling2DLayerConfig } from './layers/pooling'; +import { GRUCellLayerConfig, GRULayerConfig, LSTMCellLayerConfig, LSTMLayerConfig, RNNCell, RNNLayerConfig, SimpleRNNCellLayerConfig, SimpleRNNLayerConfig, StackedRNNCellsConfig } from './layers/recurrent'; +import { BidirectionalLayerConfig, Wrapper, WrapperLayerConfig } from './layers/wrappers'; +export declare function inputLayer(config: InputLayerConfig): Layer; +export declare function elu(config?: ELULayerConfig): Layer; +export declare function leakyReLU(config?: LeakyReLULayerConfig): Layer; +export declare function softmax(config?: SoftmaxLayerConfig): Layer; +export declare function thresholdedReLU(config?: ThresholdedReLULayerConfig): Layer; +export declare function conv1d(config: ConvLayerConfig): Layer; +export declare function conv2d(config: ConvLayerConfig): Layer; +export declare function conv2dTranspose(config: ConvLayerConfig): Layer; +export declare function separableConv2d(config: SeparableConvLayerConfig): Layer; +export declare function cropping2D(config: Cropping2DLayerConfig): Layer; +export declare function upSampling2d(config: UpSampling2DLayerConfig): Layer; +export declare function depthwiseConv2d(config: DepthwiseConv2DLayerConfig): Layer; +export declare function activation(config: ActivationLayerConfig): Layer; +export declare function dense(config: DenseLayerConfig): Layer; +export declare function dropout(config: DropoutLayerConfig): Layer; +export declare function flatten(config?: LayerConfig): Layer; +export declare function repeatVector(config: RepeatVectorLayerConfig): Layer; +export declare function reshape(config: ReshapeLayerConfig): Layer; +export declare function embedding(config: EmbeddingLayerConfig): Layer; +export declare function add(config?: LayerConfig): Layer; +export declare function average(config?: LayerConfig): Layer; +export declare function concatenate(config?: ConcatenateLayerConfig): Layer; +export declare function maximum(config?: LayerConfig): Layer; +export declare function minimum(config?: LayerConfig): Layer; +export declare function multiply(config?: LayerConfig): Layer; +export declare function batchNormalization(config: BatchNormalizationLayerConfig): Layer; +export declare function zeroPadding2d(config?: ZeroPadding2DLayerConfig): Layer; +export declare function averagePooling1d(config: Pooling1DLayerConfig): Layer; +export declare function avgPool1d(config: Pooling1DLayerConfig): Layer; +export declare function avgPooling1d(config: Pooling1DLayerConfig): Layer; +export declare function averagePooling2d(config: Pooling2DLayerConfig): Layer; +export declare function avgPool2d(config: Pooling2DLayerConfig): Layer; +export declare function avgPooling2d(config: Pooling2DLayerConfig): Layer; +export declare function globalAveragePooling1d(config: LayerConfig): Layer; +export declare function globalAveragePooling2d(config: GlobalPooling2DLayerConfig): Layer; +export declare function globalMaxPooling1d(config: LayerConfig): Layer; +export declare function globalMaxPooling2d(config: GlobalPooling2DLayerConfig): Layer; +export declare function maxPooling1d(config: Pooling1DLayerConfig): Layer; +export declare function maxPooling2d(config: Pooling2DLayerConfig): Layer; +export declare function gru(config: GRULayerConfig): Layer; +export declare function gruCell(config: GRUCellLayerConfig): RNNCell; +export declare function lstm(config: LSTMLayerConfig): Layer; +export declare function lstmCell(config: LSTMCellLayerConfig): RNNCell; +export declare function simpleRNN(config: SimpleRNNLayerConfig): Layer; +export declare function simpleRNNCell(config: SimpleRNNCellLayerConfig): RNNCell; +export declare function rnn(config: RNNLayerConfig): Layer; +export declare function stackedRNNCells(config: StackedRNNCellsConfig): RNNCell; +export declare function bidirectional(config: BidirectionalLayerConfig): Wrapper; +export declare function timeDistributed(config: WrapperLayerConfig): Layer; +export declare const globalMaxPool1d: typeof globalMaxPooling1d; +export declare const globalMaxPool2d: typeof globalMaxPooling2d; +export declare const maxPool1d: typeof maxPooling1d; +export declare const maxPool2d: typeof maxPooling2d; +export { Layer, input }; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js b/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js new file mode 100644 index 0000000..ac769dd --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js @@ -0,0 +1,219 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var input_layer_1 = require("./engine/input_layer"); +var topology_1 = require("./engine/topology"); +exports.Layer = topology_1.Layer; +var exports_1 = require("./exports"); +exports.input = exports_1.input; +var advanced_activations_1 = require("./layers/advanced_activations"); +var convolutional_1 = require("./layers/convolutional"); +var convolutional_depthwise_1 = require("./layers/convolutional_depthwise"); +var core_1 = require("./layers/core"); +var embeddings_1 = require("./layers/embeddings"); +var merge_1 = require("./layers/merge"); +var normalization_1 = require("./layers/normalization"); +var padding_1 = require("./layers/padding"); +var pooling_1 = require("./layers/pooling"); +var recurrent_1 = require("./layers/recurrent"); +var wrappers_1 = require("./layers/wrappers"); +function inputLayer(config) { + return new input_layer_1.InputLayer(config); +} +exports.inputLayer = inputLayer; +function elu(config) { + return new advanced_activations_1.ELU(config); +} +exports.elu = elu; +function leakyReLU(config) { + return new advanced_activations_1.LeakyReLU(config); +} +exports.leakyReLU = leakyReLU; +function softmax(config) { + return new advanced_activations_1.Softmax(config); +} +exports.softmax = softmax; +function thresholdedReLU(config) { + return new advanced_activations_1.ThresholdedReLU(config); +} +exports.thresholdedReLU = thresholdedReLU; +function conv1d(config) { + return new convolutional_1.Conv1D(config); +} +exports.conv1d = conv1d; +function conv2d(config) { + return new convolutional_1.Conv2D(config); +} +exports.conv2d = conv2d; +function conv2dTranspose(config) { + return new convolutional_1.Conv2DTranspose(config); +} +exports.conv2dTranspose = conv2dTranspose; +function separableConv2d(config) { + return new convolutional_1.SeparableConv2D(config); +} +exports.separableConv2d = separableConv2d; +function cropping2D(config) { + return new convolutional_1.Cropping2D(config); +} +exports.cropping2D = cropping2D; +function upSampling2d(config) { + return new convolutional_1.UpSampling2D(config); +} +exports.upSampling2d = upSampling2d; +function depthwiseConv2d(config) { + return new convolutional_depthwise_1.DepthwiseConv2D(config); +} +exports.depthwiseConv2d = depthwiseConv2d; +function activation(config) { + return new core_1.Activation(config); +} +exports.activation = activation; +function dense(config) { + return new core_1.Dense(config); +} +exports.dense = dense; +function dropout(config) { + return new core_1.Dropout(config); +} +exports.dropout = dropout; +function flatten(config) { + return new core_1.Flatten(config); +} +exports.flatten = flatten; +function repeatVector(config) { + return new core_1.RepeatVector(config); +} +exports.repeatVector = repeatVector; +function reshape(config) { + return new core_1.Reshape(config); +} +exports.reshape = reshape; +function embedding(config) { + return new embeddings_1.Embedding(config); +} +exports.embedding = embedding; +function add(config) { + return new merge_1.Add(config); +} +exports.add = add; +function average(config) { + return new merge_1.Average(config); +} +exports.average = average; +function concatenate(config) { + return new merge_1.Concatenate(config); +} +exports.concatenate = concatenate; +function maximum(config) { + return new merge_1.Maximum(config); +} +exports.maximum = maximum; +function minimum(config) { + return new merge_1.Minimum(config); +} +exports.minimum = minimum; +function multiply(config) { + return new merge_1.Multiply(config); +} +exports.multiply = multiply; +function batchNormalization(config) { + return new normalization_1.BatchNormalization(config); +} +exports.batchNormalization = batchNormalization; +function zeroPadding2d(config) { + return new padding_1.ZeroPadding2D(config); +} +exports.zeroPadding2d = zeroPadding2d; +function averagePooling1d(config) { + return new pooling_1.AveragePooling1D(config); +} +exports.averagePooling1d = averagePooling1d; +function avgPool1d(config) { + return averagePooling1d(config); +} +exports.avgPool1d = avgPool1d; +function avgPooling1d(config) { + return averagePooling1d(config); +} +exports.avgPooling1d = avgPooling1d; +function averagePooling2d(config) { + return new pooling_1.AveragePooling2D(config); +} +exports.averagePooling2d = averagePooling2d; +function avgPool2d(config) { + return averagePooling2d(config); +} +exports.avgPool2d = avgPool2d; +function avgPooling2d(config) { + return averagePooling2d(config); +} +exports.avgPooling2d = avgPooling2d; +function globalAveragePooling1d(config) { + return new pooling_1.GlobalAveragePooling1D(config); +} +exports.globalAveragePooling1d = globalAveragePooling1d; +function globalAveragePooling2d(config) { + return new pooling_1.GlobalAveragePooling2D(config); +} +exports.globalAveragePooling2d = globalAveragePooling2d; +function globalMaxPooling1d(config) { + return new pooling_1.GlobalMaxPooling1D(config); +} +exports.globalMaxPooling1d = globalMaxPooling1d; +function globalMaxPooling2d(config) { + return new pooling_1.GlobalMaxPooling2D(config); +} +exports.globalMaxPooling2d = globalMaxPooling2d; +function maxPooling1d(config) { + return new pooling_1.MaxPooling1D(config); +} +exports.maxPooling1d = maxPooling1d; +function maxPooling2d(config) { + return new pooling_1.MaxPooling2D(config); +} +exports.maxPooling2d = maxPooling2d; +function gru(config) { + return new recurrent_1.GRU(config); +} +exports.gru = gru; +function gruCell(config) { + return new recurrent_1.GRUCell(config); +} +exports.gruCell = gruCell; +function lstm(config) { + return new recurrent_1.LSTM(config); +} +exports.lstm = lstm; +function lstmCell(config) { + return new recurrent_1.LSTMCell(config); +} +exports.lstmCell = lstmCell; +function simpleRNN(config) { + return new recurrent_1.SimpleRNN(config); +} +exports.simpleRNN = simpleRNN; +function simpleRNNCell(config) { + return new recurrent_1.SimpleRNNCell(config); +} +exports.simpleRNNCell = simpleRNNCell; +function rnn(config) { + return new recurrent_1.RNN(config); +} +exports.rnn = rnn; +function stackedRNNCells(config) { + return new recurrent_1.StackedRNNCells(config); +} +exports.stackedRNNCells = stackedRNNCells; +function bidirectional(config) { + return new wrappers_1.Bidirectional(config); +} +exports.bidirectional = bidirectional; +function timeDistributed(config) { + return new wrappers_1.TimeDistributed(config); +} +exports.timeDistributed = timeDistributed; +exports.globalMaxPool1d = globalMaxPooling1d; +exports.globalMaxPool2d = globalMaxPooling2d; +exports.maxPool1d = maxPooling1d; +exports.maxPool2d = maxPooling2d; +//# sourceMappingURL=exports_layers.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js.map b/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js.map new file mode 100644 index 0000000..30c2468 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_layers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exports_layers.js","sourceRoot":"","sources":["../src/exports_layers.ts"],"names":[],"mappings":";;AAWA,oDAAkE;AAClE,8CAAq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AO,IAAI,0BAAe,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAFD,0CAEC;AAGY,QAAA,eAAe,GAAG,kBAAkB,CAAC;AACrC,QAAA,eAAe,GAAG,kBAAkB,CAAC;AACrC,QAAA,SAAS,GAAG,YAAY,CAAC;AACzB,QAAA,SAAS,GAAG,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.d.ts new file mode 100644 index 0000000..e2c2009 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.d.ts @@ -0,0 +1,13 @@ +import { Tensor } from '@tensorflow/tfjs-core'; +export declare function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function meanAbsolutePercentageError(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function MAPE(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function mape(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function MSE(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function mse(yTrue: Tensor, yPred: Tensor): Tensor; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js b/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js new file mode 100644 index 0000000..2b0aca0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var losses = require("./losses"); +var metrics = require("./metrics"); +function binaryAccuracy(yTrue, yPred) { + return metrics.binaryAccuracy(yTrue, yPred); +} +exports.binaryAccuracy = binaryAccuracy; +function binaryCrossentropy(yTrue, yPred) { + return metrics.binaryCrossentropy(yTrue, yPred); +} +exports.binaryCrossentropy = binaryCrossentropy; +function categoricalAccuracy(yTrue, yPred) { + return metrics.categoricalAccuracy(yTrue, yPred); +} +exports.categoricalAccuracy = categoricalAccuracy; +function categoricalCrossentropy(yTrue, yPred) { + return metrics.categoricalCrossentropy(yTrue, yPred); +} +exports.categoricalCrossentropy = categoricalCrossentropy; +function cosineProximity(yTrue, yPred) { + return losses.cosineProximity(yTrue, yPred); +} +exports.cosineProximity = cosineProximity; +function meanAbsoluteError(yTrue, yPred) { + return losses.meanAbsoluteError(yTrue, yPred); +} +exports.meanAbsoluteError = meanAbsoluteError; +function meanAbsolutePercentageError(yTrue, yPred) { + return losses.meanAbsolutePercentageError(yTrue, yPred); +} +exports.meanAbsolutePercentageError = meanAbsolutePercentageError; +function MAPE(yTrue, yPred) { + return losses.meanAbsolutePercentageError(yTrue, yPred); +} +exports.MAPE = MAPE; +function mape(yTrue, yPred) { + return losses.meanAbsolutePercentageError(yTrue, yPred); +} +exports.mape = mape; +function meanSquaredError(yTrue, yPred) { + return losses.meanSquaredError(yTrue, yPred); +} +exports.meanSquaredError = meanSquaredError; +function MSE(yTrue, yPred) { + return losses.meanSquaredError(yTrue, yPred); +} +exports.MSE = MSE; +function mse(yTrue, yPred) { + return losses.meanSquaredError(yTrue, yPred); +} +exports.mse = mse; +//# sourceMappingURL=exports_metrics.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js.map b/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js.map new file mode 100644 index 0000000..ea2dbb6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_metrics.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exports_metrics.js","sourceRoot":"","sources":["../src/exports_metrics.ts"],"names":[],"m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CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAFD,4CAEC;AAED,aAAoB,KAAa,EAAE,KAAa;IAC9C,OAAO,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAFD,kBAEC;AAED,aAAoB,KAAa,EAAE,KAAa;IAC9C,OAAO,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAFD,kBAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.d.ts new file mode 100644 index 0000000..0e499b3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.d.ts @@ -0,0 +1,4 @@ +import { L1Config, L1L2Config, L2Config, Regularizer } from './regularizers'; +export declare function l1l2(config?: L1L2Config): Regularizer; +export declare function l1(config?: L1Config): Regularizer; +export declare function l2(config?: L2Config): Regularizer; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js b/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js new file mode 100644 index 0000000..7d48d77 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var regularizers = require("./regularizers"); +var regularizers_1 = require("./regularizers"); +function l1l2(config) { + return new regularizers_1.L1L2(config); +} +exports.l1l2 = l1l2; +function l1(config) { + return regularizers.l1(config); +} +exports.l1 = l1; +function l2(config) { + return regularizers.l2(config); +} +exports.l2 = l2; +//# sourceMappingURL=exports_regularizers.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js.map b/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js.map new file mode 100644 index 0000000..c1b9059 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/exports_regularizers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exports_regularizers.js","sourceRoot":"","sources":["../src/exports_regularizers.ts"],"names":[],"mappings":";;AASA,6CAA+C;AAE/C,+CAAiF;AAUjF,cAAqB,MAAmB;IACtC,OAAO,IAAI,mBAAI,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC;AAFD,oBAEC;AAUD,YAAmB,MAAiB;IAClC,OAAO,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAFD,gBAEC;AAUD,YAAmB,MAAiB;IAClC,OAAO,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAFD,gBAEC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/index.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/index.d.ts new file mode 100644 index 0000000..3403504 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/index.d.ts @@ -0,0 +1,17 @@ +import * as constraints from './exports_constraints'; +import * as initializers from './exports_initializers'; +import * as layers from './exports_layers'; +import * as metrics from './exports_metrics'; +import * as regularizers from './exports_regularizers'; +export { CallbackList, CustomCallback, CustomCallbackConfig } from './base_callbacks'; +export { Callback } from './callbacks'; +export { SymbolicTensor } from './engine/topology'; +export { Model, ModelCompileConfig, ModelEvaluateConfig, ModelFitConfig } from './engine/training'; +export { input, loadModel, model, sequential } from './exports'; +export { GRUCellLayerConfig, GRULayerConfig, LSTMCellLayerConfig, LSTMLayerConfig, RNN, RNNLayerConfig, SimpleRNNCellLayerConfig, SimpleRNNLayerConfig } from './layers/recurrent'; +export { Logs } from './logs'; +export { ModelAndWeightsConfig, Sequential, SequentialConfig } from './models'; +export { Shape } from './types'; +export { LayerVariable } from './variables'; +export { version as version_layers } from './version'; +export { constraints, initializers, layers, metrics, regularizers }; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/index.js b/node_modules/@tensorflow/tfjs-layers/dist/index.js new file mode 100644 index 0000000..fc516e2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/index.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var constraints = require("./exports_constraints"); +exports.constraints = constraints; +var initializers = require("./exports_initializers"); +exports.initializers = initializers; +var layers = require("./exports_layers"); +exports.layers = layers; +var metrics = require("./exports_metrics"); +exports.metrics = metrics; +var regularizers = require("./exports_regularizers"); +exports.regularizers = regularizers; +var base_callbacks_1 = require("./base_callbacks"); +exports.CallbackList = base_callbacks_1.CallbackList; +exports.CustomCallback = base_callbacks_1.CustomCallback; +var callbacks_1 = require("./callbacks"); +exports.Callback = callbacks_1.Callback; +var topology_1 = require("./engine/topology"); +exports.SymbolicTensor = topology_1.SymbolicTensor; +var training_1 = require("./engine/training"); +exports.Model = training_1.Model; +var exports_1 = require("./exports"); +exports.input = exports_1.input; +exports.loadModel = exports_1.loadModel; +exports.model = exports_1.model; +exports.sequential = exports_1.sequential; +var recurrent_1 = require("./layers/recurrent"); +exports.RNN = recurrent_1.RNN; +var models_1 = require("./models"); +exports.Sequential = models_1.Sequential; +var variables_1 = require("./variables"); +exports.LayerVariable = variables_1.LayerVariable; +var version_1 = require("./version"); +exports.version_layers = version_1.version; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/index.js.map b/node_modules/@tensorflow/tfjs-layers/dist/index.js.map new file mode 100644 index 0000000..9d90053 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAaA,mDAAqD;AAoB7C,kCAAW;AAnBnB,qDAAuD;AAmBlC,oCAAY;AAlBjC,yCAA2C;AAkBR,wBAAM;AAjBzC,2CAA6C;AAiBF,0BAAO;AAhBlD,qDAAuD;AAgBH,oCAAY;AAdhE,mDAAoF;AAA5E,wCAAA,YAAY,CAAA;AAAE,0CAAA,cAAc,CAAA;AACpC,yCAAqC;AAA7B,+BAAA,QAAQ,CAAA;AAChB,8CAAiD;AAAzC,oCAAA,cAAc,CAAA;AACtB,8CAAiG;AAAzF,2BAAA,KAAK,CAAA;AAGb,qCAA8D;AAAtD,0BAAA,KAAK,CAAA;AAAE,8BAAA,SAAS,CAAA;AAAE,0BAAA,KAAK,CAAA;AAAE,+BAAA,UAAU,CAAA;AAE3C,gDAAiL;AAA/F,0BAAA,GAAG,CAAA;AAErF,mCAA6E;AAA9C,8BAAA,UAAU,CAAA;AAEzC,yCAA0C;AAAlC,oCAAA,aAAa,CAAA;AACrB,qCAAoD;AAA5C,mCAAA,OAAO,CAAkB"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/initializers.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/initializers.d.ts new file mode 100644 index 0000000..253c206 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/initializers.d.ts @@ -0,0 +1,142 @@ +import { DataType, serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Shape } from './types'; +export declare type FanMode = 'fanIn' | 'fanOut' | 'fanAvg'; +export declare const VALID_FAN_MODE_VALUES: string[]; +export declare function checkFanMode(value?: string): void; +export declare type Distribution = 'normal' | 'uniform'; +export declare const VALID_DISTRIBUTION_VALUES: string[]; +export declare function checkDistribution(value?: string): void; +export declare abstract class Initializer extends serialization.Serializable { + fromConfigUsesCustomObjects(): boolean; + abstract apply(shape: Shape, dtype?: DataType): Tensor; + getConfig(): serialization.ConfigDict; +} +export declare class Zeros extends Initializer { + static className: string; + apply(shape: Shape, dtype?: DataType): Tensor; +} +export declare class Ones extends Initializer { + static className: string; + apply(shape: Shape, dtype?: DataType): Tensor; +} +export interface ConstantConfig { + value: number; +} +export declare class Constant extends Initializer { + static className: string; + private value; + constructor(config: ConstantConfig); + apply(shape: Shape, dtype?: DataType): Tensor; + getConfig(): serialization.ConfigDict; +} +export interface RandomUniformConfig { + minval?: number; + maxval?: number; + seed?: number; +} +export declare class RandomUniform extends Initializer { + static className: string; + readonly DEFAULT_MINVAL: number; + readonly DEFAULT_MAXVAL: number; + private minval; + private maxval; + private seed; + constructor(config: RandomUniformConfig); + apply(shape: Shape, dtype?: DataType): Tensor; + getConfig(): serialization.ConfigDict; +} +export interface RandomNormalConfig { + mean?: number; + stddev?: number; + seed?: number; +} +export declare class RandomNormal extends Initializer { + static className: string; + readonly DEFAULT_MEAN: number; + readonly DEFAULT_STDDEV: number; + private mean; + private stddev; + private seed; + constructor(config: RandomNormalConfig); + apply(shape: Shape, dtype?: DataType): Tensor; + getConfig(): serialization.ConfigDict; +} +export interface TruncatedNormalConfig { + mean?: number; + stddev?: number; + seed?: number; +} +export declare class TruncatedNormal extends Initializer { + static className: string; + readonly DEFAULT_MEAN: number; + readonly DEFAULT_STDDEV: number; + private mean; + private stddev; + private seed; + constructor(config: TruncatedNormalConfig); + apply(shape: Shape, dtype?: DataType): Tensor; + getConfig(): serialization.ConfigDict; +} +export interface IdentityConfig { + gain?: number; +} +export declare class Identity extends Initializer { + static className: string; + private gain; + constructor(config: IdentityConfig); + apply(shape: Shape, dtype?: DataType): Tensor; + getConfig(): serialization.ConfigDict; +} +export interface VarianceScalingConfig { + scale: number; + mode: FanMode; + distribution: Distribution; + seed?: number; +} +export declare class VarianceScaling extends Initializer { + static className: string; + private scale; + private mode; + private distribution; + private seed; + constructor(config: VarianceScalingConfig); + apply(shape: Shape, dtype?: DataType): Tensor; + getConfig(): serialization.ConfigDict; +} +export interface SeedOnlyInitializerConfig { + seed?: number; +} +export declare class GlorotUniform extends VarianceScaling { + constructor(config?: SeedOnlyInitializerConfig); + getClassName(): string; +} +export declare class GlorotNormal extends VarianceScaling { + constructor(config?: SeedOnlyInitializerConfig); + getClassName(): string; +} +export declare class HeNormal extends VarianceScaling { + constructor(config?: SeedOnlyInitializerConfig); + getClassName(): string; +} +export declare class LeCunNormal extends VarianceScaling { + constructor(config?: SeedOnlyInitializerConfig); + getClassName(): string; +} +export interface OrthogonalConfig extends SeedOnlyInitializerConfig { + gain?: number; +} +export declare class Orthogonal extends Initializer { + static className: string; + readonly DEFAULT_GAIN: number; + protected readonly gain: number; + protected readonly seed: number; + constructor(config?: OrthogonalConfig); + apply(shape: Shape, dtype?: DataType): Tensor; + getConfig(): serialization.ConfigDict; +} +export declare type InitializerIdentifier = 'constant' | 'glorotNormal' | 'glorotUniform' | 'heNormal' | 'identity' | 'leCunNormal' | 'ones' | 'orthogonal' | 'randomNormal' | 'randomUniform' | 'truncatedNormal' | 'varianceScaling' | 'zeros' | string; +export declare const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP: { + [identifier in InitializerIdentifier]: string; +}; +export declare function serializeInitializer(initializer: Initializer): serialization.ConfigDictValue; +export declare function getInitializer(identifier: InitializerIdentifier | Initializer | serialization.ConfigDict): Initializer; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/initializers.js b/node_modules/@tensorflow/tfjs-layers/dist/initializers.js new file mode 100644 index 0000000..f209141 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/initializers.js @@ -0,0 +1,438 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("./backend/state"); +var K = require("./backend/tfjs_backend"); +var common_1 = require("./common"); +var errors_1 = require("./errors"); +var generic_utils_1 = require("./utils/generic_utils"); +var math_utils_1 = require("./utils/math_utils"); +exports.VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg']; +function checkFanMode(value) { + generic_utils_1.checkStringTypeUnionValue(exports.VALID_FAN_MODE_VALUES, 'FanMode', value); +} +exports.checkFanMode = checkFanMode; +exports.VALID_DISTRIBUTION_VALUES = ['normal', 'uniform']; +function checkDistribution(value) { + generic_utils_1.checkStringTypeUnionValue(exports.VALID_DISTRIBUTION_VALUES, 'Distribution', value); +} +exports.checkDistribution = checkDistribution; +var Initializer = (function (_super) { + __extends(Initializer, _super); + function Initializer() { + return _super !== null && _super.apply(this, arguments) || this; + } + Initializer.prototype.fromConfigUsesCustomObjects = function () { + return false; + }; + Initializer.prototype.getConfig = function () { + return {}; + }; + return Initializer; +}(tfjs_core_1.serialization.Serializable)); +exports.Initializer = Initializer; +var Zeros = (function (_super) { + __extends(Zeros, _super); + function Zeros() { + return _super !== null && _super.apply(this, arguments) || this; + } + Zeros.prototype.apply = function (shape, dtype) { + return tfjs_core_1.zeros(shape, dtype); + }; + Zeros.className = 'Zeros'; + return Zeros; +}(Initializer)); +exports.Zeros = Zeros; +tfjs_core_1.serialization.SerializationMap.register(Zeros); +var Ones = (function (_super) { + __extends(Ones, _super); + function Ones() { + return _super !== null && _super.apply(this, arguments) || this; + } + Ones.prototype.apply = function (shape, dtype) { + return tfjs_core_1.ones(shape, dtype); + }; + Ones.className = 'Ones'; + return Ones; +}(Initializer)); +exports.Ones = Ones; +tfjs_core_1.serialization.SerializationMap.register(Ones); +var Constant = (function (_super) { + __extends(Constant, _super); + function Constant(config) { + var _this = _super.call(this) || this; + if (typeof config !== 'object') { + throw new errors_1.ValueError("Expected argument of type ConstantConfig but got " + config); + } + if (config.value === undefined) { + throw new errors_1.ValueError("config must have value set but got " + config); + } + _this.value = config.value; + return _this; + } + Constant.prototype.apply = function (shape, dtype) { + var _this = this; + return tfjs_core_1.tidy(function () { return tfjs_core_1.mul(tfjs_core_1.scalar(_this.value), tfjs_core_1.ones(shape, dtype)); }); + }; + Constant.prototype.getConfig = function () { + return { + value: this.value, + }; + }; + Constant.className = 'Constant'; + return Constant; +}(Initializer)); +exports.Constant = Constant; +tfjs_core_1.serialization.SerializationMap.register(Constant); +var RandomUniform = (function (_super) { + __extends(RandomUniform, _super); + function RandomUniform(config) { + var _this = _super.call(this) || this; + _this.DEFAULT_MINVAL = -0.05; + _this.DEFAULT_MAXVAL = 0.05; + _this.minval = config.minval || _this.DEFAULT_MINVAL; + _this.maxval = config.maxval || _this.DEFAULT_MAXVAL; + _this.seed = config.seed; + return _this; + } + RandomUniform.prototype.apply = function (shape, dtype) { + return tfjs_core_1.randomUniform(shape, this.minval, this.maxval, dtype); + }; + RandomUniform.prototype.getConfig = function () { + return { minval: this.minval, maxval: this.maxval, seed: this.seed }; + }; + RandomUniform.className = 'RandomUniform'; + return RandomUniform; +}(Initializer)); +exports.RandomUniform = RandomUniform; +tfjs_core_1.serialization.SerializationMap.register(RandomUniform); +var RandomNormal = (function (_super) { + __extends(RandomNormal, _super); + function RandomNormal(config) { + var _this = _super.call(this) || this; + _this.DEFAULT_MEAN = 0.; + _this.DEFAULT_STDDEV = 0.05; + _this.mean = config.mean || _this.DEFAULT_MEAN; + _this.stddev = config.stddev || _this.DEFAULT_STDDEV; + _this.seed = config.seed; + return _this; + } + RandomNormal.prototype.apply = function (shape, dtype) { + if (dtype === 'bool') { + throw new errors_1.NotImplementedError("randomNormal does not support dType bool."); + } + return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed); + }; + RandomNormal.prototype.getConfig = function () { + return { mean: this.mean, stddev: this.stddev, seed: this.seed }; + }; + RandomNormal.className = 'RandomNormal'; + return RandomNormal; +}(Initializer)); +exports.RandomNormal = RandomNormal; +tfjs_core_1.serialization.SerializationMap.register(RandomNormal); +var TruncatedNormal = (function (_super) { + __extends(TruncatedNormal, _super); + function TruncatedNormal(config) { + var _this = _super.call(this) || this; + _this.DEFAULT_MEAN = 0.; + _this.DEFAULT_STDDEV = 0.05; + _this.mean = config.mean || _this.DEFAULT_MEAN; + _this.stddev = config.stddev || _this.DEFAULT_STDDEV; + _this.seed = config.seed; + return _this; + } + TruncatedNormal.prototype.apply = function (shape, dtype) { + if (dtype === 'bool') { + throw new errors_1.NotImplementedError("truncatedNormal does not support dType bool."); + } + return tfjs_core_1.truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed); + }; + TruncatedNormal.prototype.getConfig = function () { + return { mean: this.mean, stddev: this.stddev, seed: this.seed }; + }; + TruncatedNormal.className = 'TruncatedNormal'; + return TruncatedNormal; +}(Initializer)); +exports.TruncatedNormal = TruncatedNormal; +tfjs_core_1.serialization.SerializationMap.register(TruncatedNormal); +var Identity = (function (_super) { + __extends(Identity, _super); + function Identity(config) { + var _this = _super.call(this) || this; + _this.gain = config.gain != null ? tfjs_core_1.scalar(config.gain) : state_1.getScalar(1.0); + return _this; + } + Identity.prototype.apply = function (shape, dtype) { + var _this = this; + return tfjs_core_1.tidy(function () { + if (shape.length !== 2 || shape[0] !== shape[1]) { + throw new errors_1.ValueError('Identity matrix initializer can only be used for' + + ' 2D square matrices.'); + } + else { + return tfjs_core_1.mul(_this.gain, tfjs_core_1.eye(shape[0])); + } + }); + }; + Identity.prototype.getConfig = function () { + return { gain: this.gain.get() }; + }; + Identity.className = 'Identity'; + return Identity; +}(Initializer)); +exports.Identity = Identity; +tfjs_core_1.serialization.SerializationMap.register(Identity); +function computeFans(shape, dataFormat) { + if (dataFormat === void 0) { dataFormat = 'channelsLast'; } + var fanIn; + var fanOut; + common_1.checkDataFormat(dataFormat); + if (shape.length === 2) { + fanIn = shape[0]; + fanOut = shape[1]; + } + else if ([3, 4, 5].indexOf(shape.length) !== -1) { + if (dataFormat === 'channelsFirst') { + var receptiveFieldSize = math_utils_1.arrayProd(shape, 2); + fanIn = shape[1] * receptiveFieldSize; + fanOut = shape[0] * receptiveFieldSize; + } + else if (dataFormat === 'channelsLast') { + var receptiveFieldSize = math_utils_1.arrayProd(shape, 0, shape.length - 2); + fanIn = shape[shape.length - 2] * receptiveFieldSize; + fanOut = shape[shape.length - 1] * receptiveFieldSize; + } + } + else { + var shapeProd = math_utils_1.arrayProd(shape); + fanIn = Math.sqrt(shapeProd); + fanOut = Math.sqrt(shapeProd); + } + return [fanIn, fanOut]; +} +var VarianceScaling = (function (_super) { + __extends(VarianceScaling, _super); + function VarianceScaling(config) { + var _this = _super.call(this) || this; + if (config.scale < 0.0) { + throw new errors_1.ValueError("scale must be a positive float. Got: " + config.scale); + } + _this.scale = config.scale == null ? 1.0 : config.scale; + _this.mode = config.mode; + checkFanMode(_this.mode); + _this.distribution = config.distribution; + checkDistribution(_this.distribution); + _this.seed = config.seed; + return _this; + } + VarianceScaling.prototype.apply = function (shape, dtype) { + var fans = computeFans(shape); + var fanIn = fans[0]; + var fanOut = fans[1]; + var scale = this.scale; + if (this.mode === 'fanIn') { + scale /= Math.max(1, fanIn); + } + else if (this.mode === 'fanOut') { + scale /= Math.max(1, fanOut); + } + else { + scale /= Math.max(1, (fanIn + fanOut) / 2); + } + if (this.distribution === 'normal') { + var stddev = Math.sqrt(scale); + if (dtype === 'bool') { + throw new errors_1.NotImplementedError(this.getClassName() + " does not support dType bool."); + } + return tfjs_core_1.truncatedNormal(shape, 0, stddev, dtype, this.seed); + } + else { + var limit = Math.sqrt(3 * scale); + return tfjs_core_1.randomUniform(shape, -limit, limit, dtype); + } + }; + VarianceScaling.prototype.getConfig = function () { + return { + scale: this.scale, + mode: this.mode, + distribution: this.distribution, + seed: this.seed + }; + }; + VarianceScaling.className = 'VarianceScaling'; + return VarianceScaling; +}(Initializer)); +exports.VarianceScaling = VarianceScaling; +tfjs_core_1.serialization.SerializationMap.register(VarianceScaling); +var GlorotUniform = (function (_super) { + __extends(GlorotUniform, _super); + function GlorotUniform(config) { + return _super.call(this, { + scale: 1.0, + mode: 'fanAvg', + distribution: 'uniform', + seed: config == null ? null : config.seed + }) || this; + } + GlorotUniform.prototype.getClassName = function () { + return VarianceScaling.className; + }; + return GlorotUniform; +}(VarianceScaling)); +exports.GlorotUniform = GlorotUniform; +var GlorotNormal = (function (_super) { + __extends(GlorotNormal, _super); + function GlorotNormal(config) { + return _super.call(this, { + scale: 1.0, + mode: 'fanAvg', + distribution: 'normal', + seed: config == null ? null : config.seed + }) || this; + } + GlorotNormal.prototype.getClassName = function () { + return VarianceScaling.className; + }; + return GlorotNormal; +}(VarianceScaling)); +exports.GlorotNormal = GlorotNormal; +var HeNormal = (function (_super) { + __extends(HeNormal, _super); + function HeNormal(config) { + return _super.call(this, { + scale: 2.0, + mode: 'fanIn', + distribution: 'normal', + seed: config == null ? null : config.seed + }) || this; + } + HeNormal.prototype.getClassName = function () { + return VarianceScaling.className; + }; + return HeNormal; +}(VarianceScaling)); +exports.HeNormal = HeNormal; +var LeCunNormal = (function (_super) { + __extends(LeCunNormal, _super); + function LeCunNormal(config) { + return _super.call(this, { + scale: 1.0, + mode: 'fanIn', + distribution: 'normal', + seed: config == null ? null : config.seed + }) || this; + } + LeCunNormal.prototype.getClassName = function () { + return VarianceScaling.className; + }; + return LeCunNormal; +}(VarianceScaling)); +exports.LeCunNormal = LeCunNormal; +var Orthogonal = (function (_super) { + __extends(Orthogonal, _super); + function Orthogonal(config) { + var _this = _super.call(this) || this; + _this.DEFAULT_GAIN = 1; + _this.gain = config.gain == null ? _this.DEFAULT_GAIN : config.gain; + _this.seed = config.seed; + if (_this.seed != null) { + throw new errors_1.NotImplementedError('Random seed is not implemented for Orthogonal Initializer yet.'); + } + return _this; + } + Orthogonal.prototype.apply = function (shape, dtype) { + var _this = this; + return tfjs_core_1.tidy(function () { + if (shape.length !== 2) { + throw new errors_1.NotImplementedError('The Orthogonal Initializer does not support non-2D shapes yet.'); + } + if (shape[0] * shape[1] > 2000) { + console.warn("Orthogonal initializer is being called on a matrix with more " + + ("than 2000 (" + shape[0] * shape[1] + ") elements: ") + + "Slowness may result."); + } + var normalizedShape = shape[0] > shape[1] ? [shape[1], shape[0]] : shape; + var a = K.randomNormal(normalizedShape, 0, 1, 'float32'); + var q = tfjs_core_1.linalg.gramSchmidt(a); + if (shape[0] > shape[1]) { + q = q.transpose(); + } + return tfjs_core_1.mul(state_1.getScalar(_this.gain), q); + }); + }; + Orthogonal.prototype.getConfig = function () { + return { + gain: this.gain, + seed: this.seed, + }; + }; + Orthogonal.className = 'Orthogonal'; + return Orthogonal; +}(Initializer)); +exports.Orthogonal = Orthogonal; +tfjs_core_1.serialization.SerializationMap.register(Orthogonal); +exports.INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { + 'constant': 'Constant', + 'glorotNormal': 'GlorotNormal', + 'glorotUniform': 'GlorotUniform', + 'heNormal': 'HeNormal', + 'identity': 'Identity', + 'leCunNormal': 'LeCunNormal', + 'ones': 'Ones', + 'orthogonal': 'Orthogonal', + 'randomNormal': 'RandomNormal', + 'randomUniform': 'RandomUniform', + 'truncatedNormal': 'TruncatedNormal', + 'varianceScaling': 'VarianceScaling', + 'zeros': 'Zeros' +}; +function deserializeInitializer(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return generic_utils_1.deserializeKerasObject(config, tfjs_core_1.serialization.SerializationMap.getMap().classNameMap, customObjects, 'initializer'); +} +function serializeInitializer(initializer) { + return generic_utils_1.serializeKerasObject(initializer); +} +exports.serializeInitializer = serializeInitializer; +function getInitializer(identifier) { + if (typeof identifier === 'string') { + var className = identifier in exports.INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? + exports.INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : + identifier; + if (className === 'GlorotUniform') { + return new GlorotUniform(); + } + else if (className === 'GlorotNormal') { + return new GlorotNormal(); + } + else if (className === 'HeNormal') { + return new HeNormal(); + } + else if (className === 'LeCunNormal') { + return new LeCunNormal(); + } + else { + var config = { className: className, config: {} }; + return deserializeInitializer(config); + } + } + else if (identifier instanceof Initializer) { + return identifier; + } + else { + return deserializeInitializer(identifier); + } +} +exports.getInitializer = getInitializer; +//# sourceMappingURL=initializers.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/initializers.js.map b/node_modules/@tensorflow/tfjs-layers/dist/initializers.js.map new file mode 100644 index 0000000..03cec76 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/initializers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"initializers.js","sourceRoot":"","sources":["../src/initializers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA,mDAAqK;AAErK,yCAA0C;AAC1C,0CAA4C;AAC5C,mCAAqD;AACrD,mCAAyD;AAEzD,uDAA8G;AAC9G,iDAA6C;AAMhC,QAAA,qBAAqB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACnE,sBAA6B,KAAc;IACzC,yCAAyB,CAAC,6BAAqB,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AACrE,CAAC;AAFD,oCAEC;AAIY,QAAA,yBAAyB,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAC/D,2BAAkC,KAAc;IAC9C,yCAAyB,CAAC,iCAAyB,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;AAC9E,CAAC;AAFD,8CAEC;AAQD;IAA0C,+BAA0B;IAApE;;IAeA,CAAC;IAdQ,iDAA2B,GAAlC;QACE,OAAO,KAAK,CAAC;IACf,CAAC;IASD,+BAAS,GAAT;QACE,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,kBAAC;AAAD,CAAC,AAfD,CAA0C,yBAAa,CAAC,YAAY,GAenE;AAfqB,kCAAW;AAoBjC;IAA2B,yBAAW;IAAtC;;IAMA,CAAC;IAHC,qBAAK,GAAL,UAAM,KAAY,EAAE,KAAgB;QAClC,OAAO,iBAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;IAJM,eAAS,GAAG,OAAO,CAAC;IAK7B,YAAC;CAAA,AAND,CAA2B,WAAW,GAMrC;AANY,sBAAK;AAOlB,yBAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAK/C;IAA0B,wBAAW;IAArC;;IAMA,CAAC;IAHC,oBAAK,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AAe,EAAE;YACjC,OAAO,IAAI,aAAa,EAAE,CAAC;SAC5B;aAAM,IAAI,SAAS,KAAK,cAAc,EAAE;YACvC,OAAO,IAAI,YAAY,EAAE,CAAC;SAC3B;aAAM,IAAI,SAAS,KAAK,UAAU,EAAE;YACnC,OAAO,IAAI,QAAQ,EAAE,CAAC;SACvB;aAAM,IAAI,SAAS,KAAK,aAAa,EAAE;YACtC,OAAO,IAAI,WAAW,EAAE,CAAC;SAC1B;aAAM;YACL,IAAM,MAAM,GAAG,EAAC,SAAS,WAAA,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;YACvC,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC;SACvC;KACF;SAAM,IAAI,UAAU,YAAY,WAAW,EAAE;QAC5C,OAAO,UAAU,CAAC;KACnB;SAAM;QACL,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAC;KAC3C;AACH,CAAC;AA1BD,wCA0BC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/initializers_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/initializers_test.js.map new file mode 100644 index 0000000..a95edca --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/initializers_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"initializers_test.js","sourceRoot":"","sources":["../src/initializers_test.ts"],"names":[],"mappings":";;AAeA,mDAA6E;AAE7E,6BAA+B;AAC/B,+CAAwK;AACxK,+CAAiD;AACjD,iDAAiJ;AAIjJ,4BAAe,CAAC,mBAAmB,EAAE;IACnC,EAAE,CAAC,IAAI,EAAE;QACP,IAAM,IAAI,GAAG,6BAAc,CAAC,OAAO,CAAC,CAAC;QACrC,IAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QAC3C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CA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AC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEnC,+BAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,eAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,eAAe,EAAE;QAClB,IAAM,IAAI,GAAG,6BAAc,CAAC,YAAY,CAAC,CAAC;QAC1C,kCAAqB,CAAC,cAAM,OAAA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAlB,CAAkB,EAAE,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activation_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activation_test.js.map new file mode 100644 index 0000000..f1c428a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activation_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"advanced_activation_test.js","sourceRoot":"","sources":["../../src/layers/advanced_activation_test.ts"],"names":[],"mappings":";;AAeA,mDAAuD;AAEvD,8BAAgC;AAChC,kDAA+F;AAG/F,4BAAe,CAAC,qBAAqB,EAAE;IACrC,EAAE,CAAC,sBAAsB,EAAE;QACzB,IAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,EAAC,KAAK,EAAE,GAAG,EAAC,CAAC,CAAC;QACjD,IAAM,CAAC,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACzE,IAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAuB,CAAC;QAC/C,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,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CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.d.ts new file mode 100644 index 0000000..ad7b2ca --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.d.ts @@ -0,0 +1,53 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Layer, LayerConfig } from '../engine/topology'; +import { Kwargs, Shape } from '../types'; +export interface LeakyReLULayerConfig extends LayerConfig { + alpha?: number; +} +export declare class LeakyReLU extends Layer { + static className: string; + readonly alpha: number; + readonly DEFAULT_ALPHA: number; + constructor(config?: LeakyReLULayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + getConfig(): serialization.ConfigDict; +} +export interface ELULayerConfig extends LayerConfig { + alpha?: number; +} +export declare class ELU extends Layer { + static className: string; + readonly alpha: number; + readonly DEFAULT_ALPHA: number; + constructor(config?: ELULayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + getConfig(): serialization.ConfigDict; +} +export interface ThresholdedReLULayerConfig extends LayerConfig { + theta?: number; +} +export declare class ThresholdedReLU extends Layer { + static className: string; + readonly theta: number; + private readonly thetaTensor; + readonly DEFAULT_THETA: number; + constructor(config?: ThresholdedReLULayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + getConfig(): serialization.ConfigDict; +} +export interface SoftmaxLayerConfig extends LayerConfig { + axis?: number; +} +export declare class Softmax extends Layer { + static className: string; + readonly axis: number; + readonly softmax: (t: Tensor, a?: number) => Tensor; + readonly DEFAULT_AXIS: number; + constructor(config?: SoftmaxLayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + getConfig(): serialization.ConfigDict; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js new file mode 100644 index 0000000..cb7b439 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js @@ -0,0 +1,142 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var activations_1 = require("../activations"); +var tfjs_backend_1 = require("../backend/tfjs_backend"); +var topology_1 = require("../engine/topology"); +var state_1 = require("../backend/state"); +var errors_1 = require("../errors"); +var types_utils_1 = require("../utils/types_utils"); +var LeakyReLU = (function (_super) { + __extends(LeakyReLU, _super); + function LeakyReLU(config) { + var _this = _super.call(this, config == null ? {} : config) || this; + _this.DEFAULT_ALPHA = 0.3; + if (config == null) { + config = {}; + } + _this.alpha = config.alpha == null ? _this.DEFAULT_ALPHA : config.alpha; + return _this; + } + LeakyReLU.prototype.call = function (inputs, kwargs) { + var x = types_utils_1.getExactlyOneTensor(inputs); + return tfjs_core_1.leakyRelu(x, this.alpha); + }; + LeakyReLU.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + LeakyReLU.prototype.getConfig = function () { + var config = { alpha: this.alpha }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + LeakyReLU.className = 'LeakyReLU'; + return LeakyReLU; +}(topology_1.Layer)); +exports.LeakyReLU = LeakyReLU; +tfjs_core_1.serialization.SerializationMap.register(LeakyReLU); +var ELU = (function (_super) { + __extends(ELU, _super); + function ELU(config) { + var _this = _super.call(this, config == null ? {} : config) || this; + _this.DEFAULT_ALPHA = 1.0; + if (config == null) { + config = {}; + } + if (config.alpha != null && config.alpha !== _this.DEFAULT_ALPHA) { + throw new errors_1.NotImplementedError("Non-default alpha value (" + config.alpha + ") is not supported by the " + + "ELU layer yet."); + } + _this.alpha = config.alpha == null ? _this.DEFAULT_ALPHA : config.alpha; + return _this; + } + ELU.prototype.call = function (inputs, kwargs) { + var x = types_utils_1.getExactlyOneTensor(inputs); + return tfjs_core_1.elu(x); + }; + ELU.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + ELU.prototype.getConfig = function () { + var config = { alpha: this.alpha }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + ELU.className = 'ELU'; + return ELU; +}(topology_1.Layer)); +exports.ELU = ELU; +tfjs_core_1.serialization.SerializationMap.register(ELU); +var ThresholdedReLU = (function (_super) { + __extends(ThresholdedReLU, _super); + function ThresholdedReLU(config) { + var _this = _super.call(this, config == null ? {} : config) || this; + _this.DEFAULT_THETA = 1.0; + if (config == null) { + config = {}; + } + _this.theta = config.theta == null ? _this.DEFAULT_THETA : config.theta; + _this.thetaTensor = state_1.getScalar(_this.theta); + return _this; + } + ThresholdedReLU.prototype.call = function (inputs, kwargs) { + var x = types_utils_1.getExactlyOneTensor(inputs); + return x.mul(tfjs_backend_1.cast(x.greater(this.thetaTensor), 'float32')); + }; + ThresholdedReLU.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + ThresholdedReLU.prototype.getConfig = function () { + var config = { theta: this.theta }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + ThresholdedReLU.className = 'ThresholdedReLU'; + return ThresholdedReLU; +}(topology_1.Layer)); +exports.ThresholdedReLU = ThresholdedReLU; +tfjs_core_1.serialization.SerializationMap.register(ThresholdedReLU); +var Softmax = (function (_super) { + __extends(Softmax, _super); + function Softmax(config) { + var _this = _super.call(this, config == null ? {} : config) || this; + _this.DEFAULT_AXIS = 1.0; + if (config == null) { + config = {}; + } + _this.softmax = new activations_1.Softmax().apply; + _this.axis = config.axis == null ? _this.DEFAULT_AXIS : config.axis; + return _this; + } + Softmax.prototype.call = function (inputs, kwargs) { + var x = types_utils_1.getExactlyOneTensor(inputs); + return this.softmax(x, this.axis); + }; + Softmax.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + Softmax.prototype.getConfig = function () { + var config = { axis: this.axis }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Softmax.className = 'Softmax'; + return Softmax; +}(topology_1.Layer)); +exports.Softmax = Softmax; +tfjs_core_1.serialization.SerializationMap.register(Softmax); +//# sourceMappingURL=advanced_activations.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js.map new file mode 100644 index 0000000..2ce7fed --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/advanced_activations.js.map @@ -0,0 +1 @@ +{"version":3,"file":"advanced_activations.js","sourceRoot":"","sources":["../../src/layers/advanced_activations.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,mDAA4E;AAE5E,8CAA4D;AAC5D,wDAA6C;AAC7C,+CAAsD;AACtD,0CAA2C;AAC3C,oCAA8C;AAE9C,oDAAyD;AAuBzD;IAA+B,6BAAK;IAMlC,mBAAY,MAA6B;QAAzC,YACE,kBAAM,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM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IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,KAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;;IACpE,CAAC;IAED,sBAAI,GAAJ,UAAK,MAAuB,EAAE,MAAc;QAC1C,IAAM,CAAC,GAAG,iCAAmB,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,oCAAkB,GAAlB,UAAmB,UAAyB;QAC1C,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,2BAAS,GAAT;QACE,IAAM,MAAM,GAA6B,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC;QAC3D,IAAM,UAAU,GAAG,iBAAM,SAAS,WAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;IA5BM,iBAAS,GAAG,SAAS,CAAC;IA6B/B,cAAC;CAAA,AA9BD,CAA6B,gBAAK,GA8BjC;AA9BY,0BAAO;AA+BpB,yBAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.d.ts new file mode 100644 index 0000000..dc1624b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.d.ts @@ -0,0 +1,144 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Activation } from '../activations'; +import { DataFormat, PaddingMode } from '../common'; +import { Constraint, ConstraintIdentifier } from '../constraints'; +import { InputSpec, Layer, LayerConfig } from '../engine/topology'; +import { Initializer, InitializerIdentifier } from '../initializers'; +import { Regularizer, RegularizerIdentifier } from '../regularizers'; +import { Kwargs, Shape } from '../types'; +import { LayerVariable } from '../variables'; +export declare function preprocessConv2DInput(x: Tensor, dataFormat: DataFormat): Tensor; +export declare function conv1dWithBias(x: Tensor, kernel: Tensor, bias: Tensor, strides?: number, padding?: string, dataFormat?: DataFormat, dilationRate?: number): Tensor; +export declare function conv1d(x: Tensor, kernel: Tensor, strides?: number, padding?: string, dataFormat?: DataFormat, dilationRate?: number): Tensor; +export declare function conv2d(x: Tensor, kernel: Tensor, strides?: number[], padding?: string, dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor; +export declare function conv2dWithBias(x: Tensor, kernel: Tensor, bias: Tensor, strides?: number[], padding?: string, dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor; +export interface BaseConvLayerConfig extends LayerConfig { + kernelSize: number | number[]; + strides?: number | number[]; + padding?: PaddingMode; + dataFormat?: DataFormat; + dilationRate?: number | [number] | [number, number]; + activation?: string; + useBias?: boolean; + kernelInitializer?: InitializerIdentifier | Initializer; + biasInitializer?: InitializerIdentifier | Initializer; + kernelConstraint?: ConstraintIdentifier | Constraint; + biasConstraint?: ConstraintIdentifier | Constraint; + kernelRegularizer?: RegularizerIdentifier | Regularizer; + biasRegularizer?: RegularizerIdentifier | Regularizer; + activityRegularizer?: RegularizerIdentifier | Regularizer; +} +export interface ConvLayerConfig extends BaseConvLayerConfig { + filters: number; +} +export declare abstract class BaseConv extends Layer { + protected readonly rank: number; + protected readonly kernelSize: number[]; + protected readonly strides: number[]; + protected readonly padding: PaddingMode; + protected readonly dataFormat: DataFormat; + protected readonly activation: Activation; + protected readonly useBias: boolean; + protected readonly dilationRate: number[]; + protected readonly biasInitializer?: Initializer; + protected readonly biasConstraint?: Constraint; + protected readonly biasRegularizer?: Regularizer; + protected bias: LayerVariable; + readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier; + readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier; + constructor(rank: number, config: BaseConvLayerConfig); + protected static verifyConfig(config: BaseConvLayerConfig): void; + getConfig(): serialization.ConfigDict; +} +export declare abstract class Conv extends BaseConv { + protected readonly filters: number; + protected kernel: LayerVariable; + protected readonly kernelInitializer?: Initializer; + protected readonly kernelConstraint?: Constraint; + protected readonly kernelRegularizer?: Regularizer; + constructor(rank: number, config: ConvLayerConfig); + build(inputShape: Shape | Shape[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + getConfig(): serialization.ConfigDict; + protected static verifyConfig(config: ConvLayerConfig): void; +} +export declare class Conv2D extends Conv { + static className: string; + constructor(config: ConvLayerConfig); + getConfig(): serialization.ConfigDict; + protected static verifyConfig(config: ConvLayerConfig): void; +} +export declare class Conv2DTranspose extends Conv2D { + static className: string; + inputSpec: InputSpec[]; + constructor(config: ConvLayerConfig); + build(inputShape: Shape | Shape[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + getConfig(): serialization.ConfigDict; +} +export interface SeparableConvLayerConfig extends ConvLayerConfig { + depthMultiplier?: number; + depthwiseInitializer?: InitializerIdentifier | Initializer; + pointwiseInitializer?: InitializerIdentifier | Initializer; + depthwiseRegularizer?: RegularizerIdentifier | Regularizer; + pointwiseRegularizer?: RegularizerIdentifier | Regularizer; + depthwiseConstraint?: ConstraintIdentifier | Constraint; + pointwiseConstraint?: ConstraintIdentifier | Constraint; +} +export declare class SeparableConv extends Conv { + static className: string; + readonly depthMultiplier: number; + protected readonly depthwiseInitializer?: Initializer; + protected readonly depthwiseRegularizer?: Regularizer; + protected readonly depthwiseConstraint?: Constraint; + protected readonly pointwiseInitializer?: Initializer; + protected readonly pointwiseRegularizer?: Regularizer; + protected readonly pointwiseConstraint?: Constraint; + readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier; + readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier; + protected depthwiseKernel: LayerVariable; + protected pointwiseKernel: LayerVariable; + constructor(rank: number, config?: SeparableConvLayerConfig); + build(inputShape: Shape | Shape[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export declare class SeparableConv2D extends SeparableConv { + static className: string; + constructor(config?: SeparableConvLayerConfig); +} +export declare class Conv1D extends Conv { + static className: string; + constructor(config: ConvLayerConfig); + getConfig(): serialization.ConfigDict; + static verifyConfig(config: ConvLayerConfig): void; +} +export interface Cropping2DLayerConfig extends LayerConfig { + cropping: number | [number, number] | [[number, number], [number, number]]; + dataFormat?: DataFormat; +} +export declare class Cropping2D extends Layer { + static className: string; + protected readonly cropping: [[number, number], [number, number]]; + protected readonly dataFormat: DataFormat; + constructor(config: Cropping2DLayerConfig); + computeOutputShape(inputShape: Shape): Shape; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export interface UpSampling2DLayerConfig extends LayerConfig { + size?: number[]; + dataFormat?: DataFormat; +} +export declare class UpSampling2D extends Layer { + static className: string; + protected readonly DEFAULT_SIZE: number[]; + protected readonly size: number[]; + protected readonly dataFormat: DataFormat; + constructor(config: UpSampling2DLayerConfig); + computeOutputShape(inputShape: Shape): Shape; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js new file mode 100644 index 0000000..deb55b1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js @@ -0,0 +1,696 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var activations_1 = require("../activations"); +var common_1 = require("../backend/common"); +var K = require("../backend/tfjs_backend"); +var common_2 = require("../common"); +var constraints_1 = require("../constraints"); +var topology_1 = require("../engine/topology"); +var errors_1 = require("../errors"); +var initializers_1 = require("../initializers"); +var regularizers_1 = require("../regularizers"); +var conv_utils_1 = require("../utils/conv_utils"); +var generic_utils = require("../utils/generic_utils"); +var types_utils_1 = require("../utils/types_utils"); +function preprocessConv2DInput(x, dataFormat) { + return tfjs_core_1.tidy(function () { + common_2.checkDataFormat(dataFormat); + if (dataFormat === 'channelsFirst') { + return tfc.transpose(x, [0, 2, 3, 1]); + } + else { + return x; + } + }); +} +exports.preprocessConv2DInput = preprocessConv2DInput; +function conv1dWithBias(x, kernel, bias, strides, padding, dataFormat, dilationRate) { + if (strides === void 0) { strides = 1; } + if (padding === void 0) { padding = 'valid'; } + if (dilationRate === void 0) { dilationRate = 1; } + return tfjs_core_1.tidy(function () { + if (dataFormat == null) { + dataFormat = common_1.imageDataFormat(); + } + common_2.checkDataFormat(dataFormat); + if (x.shape.length !== 3) { + throw new errors_1.ValueError("The input of a conv1dWithBias operation should be 3, but is " + + (x.shape.length + " instead.")); + } + if (kernel.shape.length !== 3) { + throw new errors_1.ValueError("The kernel for a conv1dWithBias operation should be 3, but is " + + (kernel.shape.length + " instead")); + } + if (bias != null && bias.shape.length !== 1) { + throw new errors_1.ValueError("The bias for a conv1dWithBias operation should be 1, but is " + + (kernel.shape.length + " instead")); + } + if (dataFormat === 'channelsFirst') { + x = tfc.transpose(x, [0, 2, 1]); + } + if (padding === 'causal') { + throw new errors_1.NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + + 'implemented yet.'); + } + var y = tfc.conv1d(x, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate); + if (bias != null) { + y = K.biasAdd(y, bias); + } + return y; + }); +} +exports.conv1dWithBias = conv1dWithBias; +function conv1d(x, kernel, strides, padding, dataFormat, dilationRate) { + if (strides === void 0) { strides = 1; } + if (padding === void 0) { padding = 'valid'; } + if (dilationRate === void 0) { dilationRate = 1; } + return tfjs_core_1.tidy(function () { + common_2.checkDataFormat(dataFormat); + return conv1dWithBias(x, kernel, null, strides, padding, dataFormat, dilationRate); + }); +} +exports.conv1d = conv1d; +function conv2d(x, kernel, strides, padding, dataFormat, dilationRate) { + if (strides === void 0) { strides = [1, 1]; } + if (padding === void 0) { padding = 'valid'; } + return tfjs_core_1.tidy(function () { + common_2.checkDataFormat(dataFormat); + return conv2dWithBias(x, kernel, null, strides, padding, dataFormat, dilationRate); + }); +} +exports.conv2d = conv2d; +function conv2dWithBias(x, kernel, bias, strides, padding, dataFormat, dilationRate) { + if (strides === void 0) { strides = [1, 1]; } + if (padding === void 0) { padding = 'valid'; } + return tfjs_core_1.tidy(function () { + if (dataFormat == null) { + dataFormat = common_1.imageDataFormat(); + } + common_2.checkDataFormat(dataFormat); + if (x.rank !== 3 && x.rank !== 4) { + throw new errors_1.ValueError("conv2dWithBias expects input to be of rank 3 or 4, but received " + + (x.rank + ".")); + } + if (kernel.rank !== 3 && kernel.rank !== 4) { + throw new errors_1.ValueError("conv2dWithBias expects kernel to be of rank 3 or 4, but received " + + (x.rank + ".")); + } + var y = preprocessConv2DInput(x, dataFormat); + if (padding === 'causal') { + throw new errors_1.NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + + 'implemented yet.'); + } + y = tfc.conv2d(y, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); + if (bias != null) { + y = K.biasAdd(y, bias); + } + if (dataFormat === 'channelsFirst') { + y = tfc.transpose(y, [0, 3, 1, 2]); + } + return y; + }); +} +exports.conv2dWithBias = conv2dWithBias; +var BaseConv = (function (_super) { + __extends(BaseConv, _super); + function BaseConv(rank, config) { + var _this = _super.call(this, config) || this; + _this.bias = null; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + BaseConv.verifyConfig(config); + _this.rank = rank; + if (_this.rank !== 1 && _this.rank !== 2) { + throw new errors_1.NotImplementedError("Convolution layer for rank other than 1 or 2 (" + _this.rank + ") is " + + "not implemented yet."); + } + _this.kernelSize = conv_utils_1.normalizeArray(config.kernelSize, rank, 'kernelSize'); + _this.strides = conv_utils_1.normalizeArray(config.strides == null ? 1 : config.strides, rank, 'strides'); + _this.padding = config.padding == null ? 'valid' : config.padding; + common_2.checkPaddingMode(_this.padding); + _this.dataFormat = + config.dataFormat == null ? 'channelsLast' : config.dataFormat; + common_2.checkDataFormat(_this.dataFormat); + _this.activation = activations_1.getActivation(config.activation); + _this.useBias = config.useBias == null ? true : config.useBias; + _this.biasInitializer = + initializers_1.getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.biasConstraint = constraints_1.getConstraint(config.biasConstraint); + _this.biasRegularizer = regularizers_1.getRegularizer(config.biasRegularizer); + _this.activityRegularizer = regularizers_1.getRegularizer(config.activityRegularizer); + _this.dilationRate = conv_utils_1.normalizeArray(config.dilationRate == null ? 1 : config.dilationRate, rank, 'dilationRate'); + if (_this.rank === 1 && + (Array.isArray(_this.dilationRate) && + _this.dilationRate.length !== 1)) { + throw new errors_1.ValueError("dilationRate must be a number or an array of a single number " + + "for 1D convolution, but received " + + ("" + JSON.stringify(_this.dilationRate))); + } + if (_this.rank === 2) { + if (typeof _this.dilationRate === 'number') { + _this.dilationRate = [_this.dilationRate, _this.dilationRate]; + } + else if (_this.dilationRate.length !== 2) { + throw new errors_1.ValueError("dilationRate must be a number or array of two numbers for 2D " + + ("convolution, but received " + JSON.stringify(_this.dilationRate))); + } + } + return _this; + } + BaseConv.verifyConfig = function (config) { + generic_utils.assert('kernelSize' in config, "required key 'kernelSize' not in config"); + if (typeof config.kernelSize !== 'number' && + !generic_utils.checkArrayTypeAndLength(config.kernelSize, 'number', 1, 2)) + throw new errors_1.ValueError("BaseConv expects config.kernelSize to be number or number[] with " + + ("length 1 or 2, but received " + JSON.stringify(config.kernelSize) + ".")); + }; + BaseConv.prototype.getConfig = function () { + var config = { + kernelSize: this.kernelSize, + strides: this.strides, + padding: this.padding, + dataFormat: this.dataFormat, + dilationRate: this.dilationRate, + activation: activations_1.serializeActivation(this.activation), + useBias: this.useBias, + biasInitializer: initializers_1.serializeInitializer(this.biasInitializer), + biasRegularizer: regularizers_1.serializeRegularizer(this.biasRegularizer), + activityRegularizer: regularizers_1.serializeRegularizer(this.activityRegularizer), + biasConstraint: constraints_1.serializeConstraint(this.biasConstraint) + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + return BaseConv; +}(topology_1.Layer)); +exports.BaseConv = BaseConv; +var Conv = (function (_super) { + __extends(Conv, _super); + function Conv(rank, config) { + var _this = _super.call(this, rank, config) || this; + _this.kernel = null; + Conv.verifyConfig(config); + _this.filters = config.filters; + _this.kernelInitializer = initializers_1.getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.kernelConstraint = constraints_1.getConstraint(config.kernelConstraint); + _this.kernelRegularizer = regularizers_1.getRegularizer(config.kernelRegularizer); + return _this; + } + Conv.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null) { + throw new errors_1.ValueError("The channel dimension of the input should be defined. " + + ("Found " + inputShape[channelAxis])); + } + var inputDim = inputShape[channelAxis]; + var kernelShape = this.kernelSize.concat([inputDim, this.filters]); + this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.filters], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + this.inputSpec = [{ ndim: this.rank + 2, axes: (_a = {}, _a[channelAxis] = inputDim, _a) }]; + this.built = true; + var _a; + }; + Conv.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = types_utils_1.getExactlyOneTensor(inputs); + var outputs; + var biasValue = _this.bias == null ? null : _this.bias.read(); + if (_this.rank === 1) { + outputs = conv1dWithBias(inputs, _this.kernel.read(), biasValue, _this.strides[0], _this.padding, _this.dataFormat, _this.dilationRate[0]); + } + else if (_this.rank === 2) { + outputs = conv2dWithBias(inputs, _this.kernel.read(), biasValue, _this.strides, _this.padding, _this.dataFormat, _this.dilationRate); + } + else if (_this.rank === 3) { + throw new errors_1.NotImplementedError('3D convolution is not implemented yet.'); + } + if (_this.activation != null) { + outputs = _this.activation.apply(outputs); + } + return outputs; + }); + }; + Conv.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var newSpace = []; + var space = (this.dataFormat === 'channelsLast') ? + inputShape.slice(1, inputShape.length - 1) : + inputShape.slice(2); + for (var i = 0; i < space.length; ++i) { + var newDim = conv_utils_1.convOutputLength(space[i], this.kernelSize[i], this.padding, this.strides[i], typeof this.dilationRate === 'number' ? this.dilationRate : + this.dilationRate[i]); + newSpace.push(newDim); + } + var outputShape = [inputShape[0]]; + if (this.dataFormat === 'channelsLast') { + outputShape = outputShape.concat(newSpace); + outputShape.push(this.filters); + } + else { + outputShape.push(this.filters); + outputShape = outputShape.concat(newSpace); + } + return outputShape; + }; + Conv.prototype.getConfig = function () { + var config = { + filters: this.filters, + kernelInitializer: initializers_1.serializeInitializer(this.kernelInitializer), + kernelRegularizer: regularizers_1.serializeRegularizer(this.kernelRegularizer), + kernelConstraint: constraints_1.serializeConstraint(this.kernelConstraint) + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Conv.verifyConfig = function (config) { + if (!('filters' in config) || typeof config.filters !== 'number' || + config.filters < 1) { + throw new errors_1.ValueError("Convolution layer expected config.filters to be a 'number' > 0 " + + ("but got " + JSON.stringify(config.filters))); + } + }; + return Conv; +}(BaseConv)); +exports.Conv = Conv; +var Conv2D = (function (_super) { + __extends(Conv2D, _super); + function Conv2D(config) { + var _this = _super.call(this, 2, config) || this; + Conv2D.verifyConfig(config); + return _this; + } + Conv2D.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + delete config['rank']; + return config; + }; + Conv2D.verifyConfig = function (config) { + if ((typeof config.kernelSize !== 'number') && + !generic_utils.checkArrayTypeAndLength(config.kernelSize, 'number', 1, 2)) + throw new errors_1.ValueError("Conv2D expects config.kernelSize to be number or number[] with " + + ("length 1 or 2, but received " + JSON.stringify(config.kernelSize) + ".")); + }; + Conv2D.className = 'Conv2D'; + return Conv2D; +}(Conv)); +exports.Conv2D = Conv2D; +tfjs_core_1.serialization.SerializationMap.register(Conv2D); +var Conv2DTranspose = (function (_super) { + __extends(Conv2DTranspose, _super); + function Conv2DTranspose(config) { + var _this = _super.call(this, config) || this; + _this.inputSpec = [new topology_1.InputSpec({ ndim: 4 })]; + if (_this.padding !== 'same' && _this.padding !== 'valid') { + throw new errors_1.ValueError("Conv2DTranspose currently supports only padding modes 'same' " + + ("and 'valid', but received padding mode " + _this.padding)); + } + return _this; + } + Conv2DTranspose.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + if (inputShape.length !== 4) { + throw new errors_1.ValueError('Input should have rank 4; Received input shape: ' + + JSON.stringify(inputShape)); + } + var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null) { + throw new errors_1.ValueError('The channel dimension of the inputs should be defined. ' + + 'Found `None`.'); + } + var inputDim = inputShape[channelAxis]; + var kernelShape = this.kernelSize.concat([this.filters, inputDim]); + this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + this.inputSpec = + [new topology_1.InputSpec({ ndim: 4, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; + this.built = true; + var _a; + }; + Conv2DTranspose.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + var input = types_utils_1.getExactlyOneTensor(inputs); + if (input.shape.length !== 4) { + throw new errors_1.ValueError("Conv2DTranspose.call() expects input tensor to be rank-4, but " + + ("received a tensor of rank-" + input.shape.length)); + } + var inputShape = input.shape; + var batchSize = inputShape[0]; + var hAxis; + var wAxis; + if (_this.dataFormat === 'channelsFirst') { + hAxis = 2; + wAxis = 3; + } + else { + hAxis = 1; + wAxis = 2; + } + var height = inputShape[hAxis]; + var width = inputShape[wAxis]; + var kernelH = _this.kernelSize[0]; + var kernelW = _this.kernelSize[1]; + var strideH = _this.strides[0]; + var strideW = _this.strides[1]; + var outHeight = conv_utils_1.deconvLength(height, strideH, kernelH, _this.padding); + var outWidth = conv_utils_1.deconvLength(width, strideW, kernelW, _this.padding); + var outputShape = [batchSize, outHeight, outWidth, _this.filters]; + if (_this.dataFormat !== 'channelsLast') { + input = tfc.transpose(input, [0, 2, 3, 1]); + } + var outputs = tfc.conv2dTranspose(input, _this.kernel.read(), outputShape, _this.strides, _this.padding); + if (_this.dataFormat !== 'channelsLast') { + outputs = tfc.transpose(outputs, [0, 3, 1, 2]); + } + if (_this.bias != null) { + outputs = + K.biasAdd(outputs, _this.bias.read(), _this.dataFormat); + } + if (_this.activation != null) { + outputs = _this.activation.apply(outputs); + } + return outputs; + }); + }; + Conv2DTranspose.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var outputShape = inputShape.slice(); + var channelAxis; + var heightAxis; + var widthAxis; + if (this.dataFormat === 'channelsFirst') { + channelAxis = 1; + heightAxis = 2; + widthAxis = 3; + } + else { + channelAxis = 3; + heightAxis = 1; + widthAxis = 2; + } + var kernelH = this.kernelSize[0]; + var kernelW = this.kernelSize[1]; + var strideH = this.strides[0]; + var strideW = this.strides[1]; + outputShape[channelAxis] = this.filters; + outputShape[heightAxis] = + conv_utils_1.deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); + outputShape[widthAxis] = + conv_utils_1.deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); + return outputShape; + }; + Conv2DTranspose.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + delete config['dilationRate']; + return config; + }; + Conv2DTranspose.className = 'Conv2DTranspose'; + return Conv2DTranspose; +}(Conv2D)); +exports.Conv2DTranspose = Conv2DTranspose; +tfjs_core_1.serialization.SerializationMap.register(Conv2DTranspose); +var SeparableConv = (function (_super) { + __extends(SeparableConv, _super); + function SeparableConv(rank, config) { + var _this = _super.call(this, rank, config) || this; + _this.DEFAULT_DEPTHWISE_INITIALIZER = 'glorotUniform'; + _this.DEFAULT_POINTWISE_INITIALIZER = 'glorotUniform'; + _this.depthwiseKernel = null; + _this.pointwiseKernel = null; + if (config.filters == null) { + throw new errors_1.ValueError('The `filters` configuration field is required by SeparableConv, ' + + 'but is unspecified.'); + } + if (config.kernelInitializer != null || config.kernelRegularizer != null || + config.kernelConstraint != null) { + throw new errors_1.ValueError('Fields kernelInitializer, kernelRegularizer and kernelConstraint ' + + 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' + + 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' + + 'pointwiseRegularizer and pointwiseConstraint instead.'); + } + if (config.padding != null && config.padding !== 'same' && + config.padding !== 'valid') { + throw new errors_1.ValueError("SeparableConv" + _this.rank + "D supports only padding modes: " + + ("'same' and 'valid', but received " + JSON.stringify(config.padding))); + } + _this.depthMultiplier = + config.depthMultiplier == null ? 1 : config.depthMultiplier; + _this.depthwiseInitializer = initializers_1.getInitializer(config.depthwiseInitializer || _this.DEFAULT_DEPTHWISE_INITIALIZER); + _this.depthwiseRegularizer = regularizers_1.getRegularizer(config.depthwiseRegularizer); + _this.depthwiseConstraint = constraints_1.getConstraint(config.depthwiseConstraint); + _this.pointwiseInitializer = initializers_1.getInitializer(config.depthwiseInitializer || _this.DEFAULT_POINTWISE_INITIALIZER); + _this.pointwiseRegularizer = regularizers_1.getRegularizer(config.pointwiseRegularizer); + _this.pointwiseConstraint = constraints_1.getConstraint(config.pointwiseConstraint); + return _this; + } + SeparableConv.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + if (inputShape.length < this.rank + 2) { + throw new errors_1.ValueError("Inputs to SeparableConv" + this.rank + "D should have rank " + + (this.rank + 2 + ", but received input shape: ") + + ("" + JSON.stringify(inputShape))); + } + var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { + throw new errors_1.ValueError("The channel dimension of the inputs should be defined, " + + ("but found " + JSON.stringify(inputShape[channelAxis]))); + } + var inputDim = inputShape[channelAxis]; + var depthwiseKernelShape = this.kernelSize.concat([inputDim, this.depthMultiplier]); + var pointwiseKernelShape = []; + for (var i = 0; i < this.rank; ++i) { + pointwiseKernelShape.push(1); + } + pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters); + var trainable = true; + this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, 'float32', this.depthwiseInitializer, this.depthwiseRegularizer, trainable, this.depthwiseConstraint); + this.pointwiseKernel = this.addWeight('pointwise_kernel', pointwiseKernelShape, 'float32', this.pointwiseInitializer, this.pointwiseRegularizer, trainable, this.pointwiseConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, trainable, this.biasConstraint); + } + else { + this.bias = null; + } + this.inputSpec = + [new topology_1.InputSpec({ ndim: this.rank + 2, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; + this.built = true; + var _a; + }; + SeparableConv.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = types_utils_1.getExactlyOneTensor(inputs); + var output; + if (_this.rank === 1) { + throw new errors_1.NotImplementedError('1D separable convolution is not implemented yet.'); + } + else if (_this.rank === 2) { + if (_this.dataFormat === 'channelsFirst') { + inputs = tfc.transpose(inputs, [0, 2, 3, 1]); + } + output = tfc.separableConv2d(inputs, _this.depthwiseKernel.read(), _this.pointwiseKernel.read(), _this.strides, _this.padding, _this.dilationRate, 'NHWC'); + } + if (_this.useBias) { + output = K.biasAdd(output, _this.bias.read(), _this.dataFormat); + } + if (_this.activation != null) { + output = _this.activation.apply(output); + } + if (_this.dataFormat === 'channelsFirst') { + output = tfc.transpose(output, [0, 3, 1, 2]); + } + return output; + }); + }; + SeparableConv.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + delete config['rank']; + delete config['kernelInitializer']; + delete config['kernelRegularizer']; + delete config['kernelConstraint']; + config['depthwiseInitializer'] = + initializers_1.serializeInitializer(this.depthwiseInitializer); + config['pointwiseInitializer'] = + initializers_1.serializeInitializer(this.pointwiseInitializer); + config['depthwiseRegularizer'] = + regularizers_1.serializeRegularizer(this.depthwiseRegularizer); + config['pointwiseRegularizer'] = + regularizers_1.serializeRegularizer(this.pointwiseRegularizer); + config['depthwiseConstraint'] = + constraints_1.serializeConstraint(this.depthwiseConstraint); + config['pointwiseConstraint'] = + constraints_1.serializeConstraint(this.pointwiseConstraint); + return config; + }; + SeparableConv.className = 'SeparableConv'; + return SeparableConv; +}(Conv)); +exports.SeparableConv = SeparableConv; +var SeparableConv2D = (function (_super) { + __extends(SeparableConv2D, _super); + function SeparableConv2D(config) { + return _super.call(this, 2, config) || this; + } + SeparableConv2D.className = 'SeparableConv2D'; + return SeparableConv2D; +}(SeparableConv)); +exports.SeparableConv2D = SeparableConv2D; +tfjs_core_1.serialization.SerializationMap.register(SeparableConv2D); +var Conv1D = (function (_super) { + __extends(Conv1D, _super); + function Conv1D(config) { + var _this = _super.call(this, 1, config) || this; + Conv1D.verifyConfig(config); + _this.inputSpec = [{ ndim: 3 }]; + return _this; + } + Conv1D.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + delete config['rank']; + delete config['dataFormat']; + return config; + }; + Conv1D.verifyConfig = function (config) { + if (typeof config.kernelSize !== 'number' && + !generic_utils.checkArrayTypeAndLength(config.kernelSize, 'number', 1, 1)) + throw new errors_1.ValueError("Conv1D expects config.kernelSize to be number or number[] with " + + ("length 1, but received " + JSON.stringify(config.kernelSize) + ".")); + }; + Conv1D.className = 'Conv1D'; + return Conv1D; +}(Conv)); +exports.Conv1D = Conv1D; +tfjs_core_1.serialization.SerializationMap.register(Conv1D); +var Cropping2D = (function (_super) { + __extends(Cropping2D, _super); + function Cropping2D(config) { + var _this = _super.call(this, config) || this; + if (typeof config.cropping === 'number') + _this.cropping = [ + [config.cropping, config.cropping], [config.cropping, config.cropping] + ]; + else if (typeof config.cropping[0] === 'number') + _this.cropping = [ + [config.cropping[0], config.cropping[0]], + [config.cropping[1], config.cropping[1]] + ]; + else + _this.cropping = config.cropping; + _this.dataFormat = + config.dataFormat === undefined ? 'channelsLast' : config.dataFormat; + _this.inputSpec = [{ ndim: 4 }]; + return _this; + } + Cropping2D.prototype.computeOutputShape = function (inputShape) { + if (this.dataFormat === 'channelsFirst') + return [ + inputShape[0], inputShape[1], + inputShape[2] - this.cropping[0][0] - this.cropping[0][1], + inputShape[2] - this.cropping[1][0] - this.cropping[1][1] + ]; + else + return [ + inputShape[0], + inputShape[1] - this.cropping[0][0] - this.cropping[0][1], + inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3] + ]; + }; + Cropping2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = types_utils_1.getExactlyOneTensor(inputs); + if (_this.dataFormat === 'channelsLast') { + var hSliced = K.sliceAlongAxis(inputs, _this.cropping[0][0], inputs.shape[1] - _this.cropping[0][0] - _this.cropping[0][1], 2); + return K.sliceAlongAxis(hSliced, _this.cropping[1][0], inputs.shape[2] - _this.cropping[1][1] - _this.cropping[1][0], 3); + } + else { + var hSliced = K.sliceAlongAxis(inputs, _this.cropping[0][0], inputs.shape[2] - _this.cropping[0][0] - _this.cropping[0][1], 3); + return K.sliceAlongAxis(hSliced, _this.cropping[1][0], inputs.shape[3] - _this.cropping[1][1] - _this.cropping[1][0], 4); + } + }); + }; + Cropping2D.prototype.getConfig = function () { + var config = { cropping: this.cropping, dataFormat: this.dataFormat }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Cropping2D.className = 'Cropping2D'; + return Cropping2D; +}(topology_1.Layer)); +exports.Cropping2D = Cropping2D; +tfjs_core_1.serialization.SerializationMap.register(Cropping2D); +var UpSampling2D = (function (_super) { + __extends(UpSampling2D, _super); + function UpSampling2D(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_SIZE = [2, 2]; + _this.inputSpec = [{ ndim: 4 }]; + _this.size = config.size == null ? _this.DEFAULT_SIZE : config.size; + _this.dataFormat = + config.dataFormat == null ? 'channelsLast' : config.dataFormat; + return _this; + } + UpSampling2D.prototype.computeOutputShape = function (inputShape) { + if (this.dataFormat === 'channelsFirst') { + var height = inputShape[2] == null ? null : this.size[0] * inputShape[2]; + var width = inputShape[3] == null ? null : this.size[1] * inputShape[3]; + return [inputShape[0], inputShape[1], height, width]; + } + else { + var height = inputShape[1] == null ? null : this.size[0] * inputShape[1]; + var width = inputShape[2] == null ? null : this.size[1] * inputShape[2]; + return [inputShape[0], height, width, inputShape[3]]; + } + }; + UpSampling2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + var input = types_utils_1.getExactlyOneTensor(inputs); + var inputShape = input.shape; + if (_this.dataFormat === 'channelsFirst') { + input = tfc.transpose(input, [0, 2, 3, 1]); + var height = _this.size[0] * inputShape[2]; + var width = _this.size[1] * inputShape[3]; + var resized = input.resizeNearestNeighbor([height, width]); + return tfc.transpose(resized, [0, 3, 1, 2]); + } + else { + var height = _this.size[0] * inputShape[1]; + var width = _this.size[1] * inputShape[2]; + return input.resizeNearestNeighbor([height, width]); + } + }); + }; + UpSampling2D.prototype.getConfig = function () { + var config = { size: this.size, dataFormat: this.dataFormat }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + UpSampling2D.className = 'UpSampling2D'; + return UpSampling2D; +}(topology_1.Layer)); +exports.UpSampling2D = UpSampling2D; +tfjs_core_1.serialization.SerializationMap.register(UpSampling2D); +//# sourceMappingURL=convolutional.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js.map new file mode 100644 index 0000000..8a6a7a1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional.js.map @@ -0,0 +1 @@ +{"version":3,"file":"convolutional.js","sourceRoot":"","sources":["../../src/layers/convolutional.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,2CAA6C;AAC7C,mDAA0G;AAE1G,8CAA8E;AAC9E,4CAAkD;AAClD,2CAA6C;AAC7C,oCAAqF;AACrF,8CAAoG;AACpG,+CAAiE;AACjE,oCAA0D;AAC1D,gDAAyG;AACzG,gDAAyG;AAEzG,kDAAmF;AACnF,sDAAwD;AACxD,oDAA6E;AAS7E,+BACI,CAAS,EAAE,UAAsB;IAEnC,OAAO,gBAAI,CAAC;QACV,wBAAe,CAAC,UAAU,CAAC,CAAC;QAC5B,IAAI,UAAU,KAAK,eAAe,EAAE;YAClC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SACvC;aAAM;YACL,OAAO,CAAC,CAAC;SACV;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAXD,sDAWC;AAkBD,wBACI,CAAS,EAAE,MAAc,EAAE,IAAY,EAAE,OAAW,EAAE,OAAiB,EACvE,UAAuB,EAAE,YAAgB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/tfjs-layers/dist/layers/convolutional_depthwise.d.ts new file mode 100644 index 0000000..e29a2ce --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.d.ts @@ -0,0 +1,28 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { DataFormat } from '../common'; +import { Constraint, ConstraintIdentifier } from '../constraints'; +import { Initializer, InitializerIdentifier } from '../initializers'; +import { Regularizer, RegularizerIdentifier } from '../regularizers'; +import { Kwargs, Shape } from '../types'; +import { BaseConv, BaseConvLayerConfig } from './convolutional'; +export declare function depthwiseConv2d(x: Tensor, depthwiseKernel: Tensor, strides?: [number, number], padding?: string, dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor; +export interface DepthwiseConv2DLayerConfig extends BaseConvLayerConfig { + kernelSize: number | [number, number]; + depthMultiplier?: number; + depthwiseInitializer?: InitializerIdentifier | Initializer; + depthwiseConstraint?: ConstraintIdentifier | Constraint; + depthwiseRegularizer?: RegularizerIdentifier | Regularizer; +} +export declare class DepthwiseConv2D extends BaseConv { + static className: string; + private readonly depthMultiplier; + private readonly depthwiseInitializer; + private readonly depthwiseConstraint; + private readonly depthwiseRegularizer; + private depthwiseKernel; + constructor(config: DepthwiseConv2DLayerConfig); + build(inputShape: Shape | Shape[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + getConfig(): serialization.ConfigDict; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js new file mode 100644 index 0000000..89013ef --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js @@ -0,0 +1,132 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var common_1 = require("../backend/common"); +var K = require("../backend/tfjs_backend"); +var common_2 = require("../common"); +var constraints_1 = require("../constraints"); +var errors_1 = require("../errors"); +var initializers_1 = require("../initializers"); +var regularizers_1 = require("../regularizers"); +var conv_utils_1 = require("../utils/conv_utils"); +var types_utils_1 = require("../utils/types_utils"); +var convolutional_1 = require("./convolutional"); +function depthwiseConv2d(x, depthwiseKernel, strides, padding, dataFormat, dilationRate) { + if (strides === void 0) { strides = [1, 1]; } + if (padding === void 0) { padding = 'valid'; } + return tfjs_core_1.tidy(function () { + if (dataFormat == null) { + dataFormat = common_1.imageDataFormat(); + } + common_2.checkDataFormat(dataFormat); + var y = convolutional_1.preprocessConv2DInput(x, dataFormat); + if (x.rank !== 4) { + throw new errors_1.ValueError("Input for depthwiseConv2d is required to be 4-D, but is instead " + + (x.rank + "-D")); + } + if (depthwiseKernel.rank !== 4) { + throw new errors_1.ValueError("depthwiseKernel is required to be 4-D, but is instead " + + (depthwiseKernel.rank + "-D")); + } + y = tfc.depthwiseConv2d(y, depthwiseKernel, strides, padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); + if (dataFormat === 'channelsFirst') { + y = tfc.transpose(y, [0, 3, 1, 2]); + } + return y; + }); +} +exports.depthwiseConv2d = depthwiseConv2d; +var DepthwiseConv2D = (function (_super) { + __extends(DepthwiseConv2D, _super); + function DepthwiseConv2D(config) { + var _this = _super.call(this, 2, config) || this; + _this.depthwiseKernel = null; + _this.depthMultiplier = + config.depthMultiplier == null ? 1 : config.depthMultiplier; + _this.depthwiseInitializer = initializers_1.getInitializer(config.depthwiseInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.depthwiseConstraint = constraints_1.getConstraint(config.depthwiseConstraint); + _this.depthwiseRegularizer = regularizers_1.getRegularizer(config.depthwiseRegularizer); + return _this; + } + DepthwiseConv2D.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + if (inputShape.length < 4) { + throw new errors_1.ValueError("Inputs to DepthwiseConv2D should have rank 4. " + + ("Received input shape: " + JSON.stringify(inputShape) + ".")); + } + var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3; + if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { + throw new errors_1.ValueError('The channel dimension of the inputs to DepthwiseConv2D should ' + + ("be defined, but is not (" + inputShape[channelAxis] + ").")); + } + var inputDim = inputShape[channelAxis]; + var depthwiseKernelShape = [ + this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier + ]; + this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, null, this.depthwiseInitializer, this.depthwiseRegularizer, true, this.depthwiseConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [inputDim * this.depthMultiplier], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + else { + this.bias = null; + } + this.built = true; + }; + DepthwiseConv2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = types_utils_1.getExactlyOneTensor(inputs); + var outputs = depthwiseConv2d(inputs, _this.depthwiseKernel.read(), _this.strides, _this.padding, _this.dataFormat, null); + if (_this.useBias) { + outputs = K.biasAdd(outputs, _this.bias.read(), _this.dataFormat); + } + if (_this.activation != null) { + outputs = _this.activation.apply(outputs); + } + return outputs; + }); + }; + DepthwiseConv2D.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; + var cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; + var outFilters = this.dataFormat === 'channelsFirst' ? + inputShape[1] * this.depthMultiplier : + inputShape[3] * this.depthMultiplier; + var outRows = conv_utils_1.convOutputLength(rows, this.kernelSize[0], this.padding, this.strides[0]); + var outCols = conv_utils_1.convOutputLength(cols, this.kernelSize[1], this.padding, this.strides[1]); + if (this.dataFormat === 'channelsFirst') { + return [inputShape[0], outFilters, outRows, outCols]; + } + else { + return [inputShape[0], outRows, outCols, outFilters]; + } + }; + DepthwiseConv2D.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + config['depthMultiplier'] = this.depthMultiplier; + config['depthwiseInitializer'] = + initializers_1.serializeInitializer(this.depthwiseInitializer); + config['depthwiseRegularizer'] = + regularizers_1.serializeRegularizer(this.depthwiseRegularizer); + config['depthwiseConstraint'] = + constraints_1.serializeConstraint(this.depthwiseRegularizer); + return config; + }; + DepthwiseConv2D.className = 'DepthwiseConv2D'; + return DepthwiseConv2D; +}(convolutional_1.BaseConv)); +exports.DepthwiseConv2D = DepthwiseConv2D; +tfjs_core_1.serialization.SerializationMap.register(DepthwiseConv2D); +//# sourceMappingURL=convolutional_depthwise.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js.map new file mode 100644 index 0000000..e396a98 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"convolutional_depthwise.js","sourceRoot":"","sources":["../../src/layers/convolutional_depthwise.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,2CAA6C;AAC7C,mDAA4E;AAE5E,4CAAkD;AAElD,2CAA6C;AAC7C,oCAAsD;AACtD,8CAAoG;AACpG,oCAAqC;AACrC,gDAAyG;AACzG,gDAAyG;AAEzG,kDAAqD;AACrD,oDAA6E;AAG7E,iDAAsG;AAgBtG,yBACI,CAAS,EAAE,eAAuB,EAAE,OAAkC,EACtE,OAAiB,EAAE,UAAuB,E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;QACpD,MAAM,CAAC,sBAAsB,CAAC;YAC1B,mCAAoB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACpD,MAAM,CAAC,qBAAqB,CAAC;YACzB,iCAAmB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACnD,OAAO,MAAM,CAAC;IAChB,CAAC;IAlGM,yBAAS,GAAG,iBAAiB,CAAC;IAmGvC,sBAAC;CAAA,AApGD,CAAqC,wBAAQ,GAoG5C;AApGY,0CAAe;AAqG5B,yBAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise_test.js.map new file mode 100644 index 0000000..cf2ef6e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_depthwise_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"convolutional_depthwise_test.js","sourceRoot":"","sources":["../../src/layers/convolutional_depthwise_test.ts"],"names":[],"mappings":";;AAeA,2CAA6C;AAC7C,mDAAiE;AAGjE,8BAAgC;AAEhC,oEAAsF;AACtF,kDAA+F;AAE/F,qEAA0D;AAG1D,kCAAqB,CAAC,iBAAiB,EAAE;IACvC,IAAM,SAAS,GAAG,CAAC,CAAC;gBAClB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;gBACxD,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;aACrB,CAAC,CAAC,CAAC;IAEJ,IAAM,WAAW,GACb,CAAC,SAAS,EAAE,eAAe,EAAE,cAAc,CA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C,EAAE;QAC3C,MAAM,CAEF,cAAM,OAAA,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,EAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAQ,CAAC,EAApD,CAAoD,CAAC;aAC1D,YAAY,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_test.js.map new file mode 100644 index 0000000..6ba2ae5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/convolutional_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"convolutional_test.js","sourceRoot":"","sources":["../../src/layers/convolutional_test.ts"],"names":[],"mappings":";;AAeA,2CAA6C;AAC7C,mDAAmG;AAGnG,8BAAgC;AAGhC,kDAAgH;AAEhH,iDAA+E;AAI/E,kCAAqB,CAAC,gBAAgB,EAAE;IACtC,IAAM,YAAY,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACtC,IAAM,iBAAiB,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,IAAM,cAAc,GAAG,GAAG,CAAC;IAM3B,IAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChC,IAAM,WAAW,GACb,CAAC,SAAS,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;IACjD,IAAM,YAAY,GAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACjE,IAAM,MAAM,GAAG,CAAC,CAAC;4BAEN,WAAW;gCACT,UAAU;oCACR,WAAW;gBACpB,IAAM,SAAS,GAAG,iBAAe,WAAW,iBAAY,MAAM,OAAI;qBAC3D,WAAW,UAAK,UAAY,CAAA,CAAC;gBACpC,EAAE,CAAC,SAAS,EAAE;oBACZ,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tfjs-layers/dist/layers/core.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/core.d.ts new file mode 100644 index 0000000..cc5513e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/core.d.ts @@ -0,0 +1,97 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Activation as ActivationFn, ActivationIdentifier } from '../activations'; +import { Constraint, ConstraintIdentifier } from '../constraints'; +import { Layer, LayerConfig } from '../engine/topology'; +import { Initializer, InitializerIdentifier } from '../initializers'; +import { Regularizer, RegularizerIdentifier } from '../regularizers'; +import { Kwargs, Shape } from '../types'; +export interface DropoutLayerConfig extends LayerConfig { + rate: number; + noiseShape?: number[]; + seed?: number; +} +export declare class Dropout extends Layer { + static className: string; + private readonly rate; + private readonly rateScalar; + private readonly noiseShape; + private readonly seed; + constructor(config: DropoutLayerConfig); + private getNoiseShape(input); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export interface DenseLayerConfig extends LayerConfig { + units: number; + activation?: ActivationIdentifier; + useBias?: boolean; + kernelInitializer?: InitializerIdentifier | Initializer; + biasInitializer?: InitializerIdentifier | Initializer; + inputDim?: number; + kernelConstraint?: ConstraintIdentifier | Constraint; + biasConstraint?: ConstraintIdentifier | Constraint; + kernelRegularizer?: RegularizerIdentifier | Regularizer; + biasRegularizer?: RegularizerIdentifier | Regularizer; + activityRegularizer?: RegularizerIdentifier | Regularizer; +} +export declare class Dense extends Layer { + static className: string; + private units; + private activation; + private useBias; + private kernelInitializer; + private biasInitializer; + private kernel; + private bias; + readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier; + readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier; + private readonly kernelConstraint?; + private readonly biasConstraint?; + private readonly kernelRegularizer?; + private readonly biasRegularizer?; + constructor(config: DenseLayerConfig); + build(inputShape: Shape | Shape[]): void; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export declare class Flatten extends Layer { + static className: string; + constructor(config?: LayerConfig); + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; +} +export interface ActivationLayerConfig extends LayerConfig { + activation: ActivationIdentifier; +} +export declare class Activation extends Layer { + static className: string; + activation: ActivationFn; + constructor(config: ActivationLayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export interface ReshapeLayerConfig extends LayerConfig { + targetShape: Shape; +} +export interface RepeatVectorLayerConfig extends LayerConfig { + n: number; +} +export declare class RepeatVector extends Layer { + static className: string; + readonly n: number; + constructor(config: RepeatVectorLayerConfig); + computeOutputShape(inputShape: Shape): Shape; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export declare class Reshape extends Layer { + static className: string; + private targetShape; + constructor(config: ReshapeLayerConfig); + private isUnknown(dim); + private fixUnknownDimension(inputShape, outputShape); + computeOutputShape(inputShape: Shape): Shape; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js new file mode 100644 index 0000000..bec84f6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js @@ -0,0 +1,348 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var activations_1 = require("../activations"); +var K = require("../backend/tfjs_backend"); +var constraints_1 = require("../constraints"); +var topology_1 = require("../engine/topology"); +var state_1 = require("../backend/state"); +var errors_1 = require("../errors"); +var initializers_1 = require("../initializers"); +var regularizers_1 = require("../regularizers"); +var math_utils = require("../utils/math_utils"); +var types_utils_1 = require("../utils/types_utils"); +var Dropout = (function (_super) { + __extends(Dropout, _super); + function Dropout(config) { + var _this = _super.call(this, config) || this; + _this.rate = Math.max(Math.min(config.rate, 1), 0); + _this.rateScalar = state_1.getScalar(_this.rate); + _this.noiseShape = config.noiseShape; + _this.seed = config.seed; + if (_this.seed != null) { + throw new errors_1.NotImplementedError('Non-default seed is not implemented in Dropout layer yet: ' + + _this.seed); + } + _this.supportsMasking = true; + return _this; + } + Dropout.prototype.getNoiseShape = function (input) { + if (this.noiseShape == null) { + return this.noiseShape; + } + var inputShape = input.shape; + var noiseShape = []; + for (var i = 0; i < this.noiseShape.length; ++i) { + noiseShape.push(this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); + } + return noiseShape; + }; + Dropout.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = types_utils_1.getExactlyOneTensor(inputs); + if (_this.noiseShape != null && + !tfjs_core_1.util.arraysEqual(input.shape, _this.noiseShape)) { + throw new errors_1.NotImplementedError('Non-default noise shape is not implemented in Dropout ' + + 'layer yet: ' + JSON.stringify(_this.noiseShape)); + } + if (0 < _this.rate && _this.rate < 1) { + var training = kwargs['training'] == null ? false : kwargs['training']; + var noiseShape_1 = _this.getNoiseShape(input); + var output = K.inTrainPhase(function () { return K.dropout(input, _this.rateScalar, noiseShape_1, _this.seed); }, function () { return input; }, training); + return output; + } + return inputs; + }); + }; + Dropout.prototype.getConfig = function () { + var config = { + rate: this.rate, + noiseShape: this.noiseShape, + seed: this.seed, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Dropout.className = 'Dropout'; + return Dropout; +}(topology_1.Layer)); +exports.Dropout = Dropout; +tfjs_core_1.serialization.SerializationMap.register(Dropout); +var Dense = (function (_super) { + __extends(Dense, _super); + function Dense(config) { + var _this = _super.call(this, config) || this; + _this.activation = null; + _this.useBias = true; + _this.kernel = null; + _this.bias = null; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + if (config.batchInputShape == null && config.inputShape == null && + config.inputDim != null) { + var batchSize = null; + if (config.batchSize != null) { + batchSize = config.batchSize; + } + _this.batchInputShape = [batchSize, config.inputDim]; + } + _this.units = config.units; + _this.activation = activations_1.getActivation(config.activation); + if (config.useBias != null) { + _this.useBias = config.useBias; + } + _this.kernelInitializer = initializers_1.getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.biasInitializer = + initializers_1.getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.kernelConstraint = constraints_1.getConstraint(config.kernelConstraint); + _this.biasConstraint = constraints_1.getConstraint(config.biasConstraint); + _this.kernelRegularizer = regularizers_1.getRegularizer(config.kernelRegularizer); + _this.biasRegularizer = regularizers_1.getRegularizer(config.biasRegularizer); + _this.activityRegularizer = regularizers_1.getRegularizer(config.activityRegularizer); + _this.inputSpec = [{ minNDim: 2 }]; + return _this; + } + Dense.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var inputLastDim = inputShape[inputShape.length - 1]; + if (this.kernel == null) { + this.kernel = this.addWeight('kernel', [inputLastDim, this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + } + this.inputSpec = [{ minNDim: 2, axes: (_a = {}, _a[-1] = inputLastDim, _a) }]; + this.built = true; + var _a; + }; + Dense.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var outputShape = inputShape.slice(); + outputShape[outputShape.length - 1] = this.units; + return outputShape; + }; + Dense.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = types_utils_1.getExactlyOneTensor(inputs); + var output = K.dot(input, _this.kernel.read()); + if (_this.bias != null) { + output = K.biasAdd(output, _this.bias.read()); + } + if (_this.activation != null) { + output = _this.activation.apply(output); + } + return output; + }); + }; + Dense.prototype.getConfig = function () { + var config = { + units: this.units, + activation: activations_1.serializeActivation(this.activation), + useBias: this.useBias, + kernelInitializer: initializers_1.serializeInitializer(this.kernelInitializer), + biasInitializer: initializers_1.serializeInitializer(this.biasInitializer), + kernelRegularizer: regularizers_1.serializeRegularizer(this.kernelRegularizer), + biasRegularizer: regularizers_1.serializeRegularizer(this.biasRegularizer), + activityRegularizer: regularizers_1.serializeRegularizer(this.activityRegularizer), + kernelConstraint: constraints_1.serializeConstraint(this.kernelConstraint), + biasConstraint: constraints_1.serializeConstraint(this.biasConstraint) + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Dense.className = 'Dense'; + return Dense; +}(topology_1.Layer)); +exports.Dense = Dense; +tfjs_core_1.serialization.SerializationMap.register(Dense); +var Flatten = (function (_super) { + __extends(Flatten, _super); + function Flatten(config) { + var _this = _super.call(this, config || {}) || this; + _this.inputSpec = [{ minNDim: 3 }]; + return _this; + } + Flatten.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + for (var _i = 0, _a = inputShape.slice(1); _i < _a.length; _i++) { + var dim = _a[_i]; + if (dim == null) { + throw new errors_1.ValueError("The shape of the input to \"Flatten\" is not fully defined " + + ("(got " + inputShape.slice(1) + "). Make sure to pass a complete ") + + "\"input_shape\" or \"batch_input_shape\" argument to the first " + + "layer in your model."); + } + } + return [inputShape[0], math_utils.arrayProd(inputShape, 1)]; + }; + Flatten.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + return K.batchFlatten(types_utils_1.getExactlyOneTensor(inputs)); + }); + }; + Flatten.className = 'Flatten'; + return Flatten; +}(topology_1.Layer)); +exports.Flatten = Flatten; +tfjs_core_1.serialization.SerializationMap.register(Flatten); +var Activation = (function (_super) { + __extends(Activation, _super); + function Activation(config) { + var _this = _super.call(this, config) || this; + _this.supportsMasking = true; + _this.activation = activations_1.getActivation(config.activation); + return _this; + } + Activation.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = types_utils_1.getExactlyOneTensor(inputs); + return _this.activation.apply(input); + }); + }; + Activation.prototype.getConfig = function () { + var config = { activation: activations_1.serializeActivation(this.activation) }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Activation.className = 'Activation'; + return Activation; +}(topology_1.Layer)); +exports.Activation = Activation; +tfjs_core_1.serialization.SerializationMap.register(Activation); +var RepeatVector = (function (_super) { + __extends(RepeatVector, _super); + function RepeatVector(config) { + var _this = _super.call(this, config) || this; + _this.n = config.n; + _this.inputSpec = [{ ndim: 2 }]; + return _this; + } + RepeatVector.prototype.computeOutputShape = function (inputShape) { + return [inputShape[0], this.n, inputShape[1]]; + }; + RepeatVector.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = types_utils_1.getExactlyOneTensor(inputs); + return K.repeat(inputs, _this.n); + }); + }; + RepeatVector.prototype.getConfig = function () { + var config = { + n: this.n, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + RepeatVector.className = 'RepeatVector'; + return RepeatVector; +}(topology_1.Layer)); +exports.RepeatVector = RepeatVector; +tfjs_core_1.serialization.SerializationMap.register(RepeatVector); +var Reshape = (function (_super) { + __extends(Reshape, _super); + function Reshape(config) { + var _this = _super.call(this, config) || this; + _this.targetShape = config.targetShape; + for (var i = 0; i < _this.targetShape.length; ++i) { + if (_this.isUnknown(_this.targetShape[i])) { + _this.targetShape[i] = null; + } + } + return _this; + } + Reshape.prototype.isUnknown = function (dim) { + return dim < 0 || dim == null; + }; + Reshape.prototype.fixUnknownDimension = function (inputShape, outputShape) { + var errorMsg = 'Total size of new array must be unchanged.'; + var finalShape = outputShape.slice(); + var known = 1; + var unknown = null; + for (var i = 0; i < finalShape.length; ++i) { + var dim = finalShape[i]; + if (this.isUnknown(dim)) { + if (unknown === null) { + unknown = i; + } + else { + throw new errors_1.ValueError('Can only specifiy one unknown dimension.'); + } + } + else { + known *= dim; + } + } + var originalSize = math_utils.arrayProd(inputShape); + if (unknown !== null) { + if (known === 0 || originalSize % known !== 0) { + throw new errors_1.ValueError(errorMsg); + } + finalShape[unknown] = originalSize / known; + } + else if (originalSize !== known) { + throw new errors_1.ValueError(errorMsg); + } + return finalShape; + }; + Reshape.prototype.computeOutputShape = function (inputShape) { + var anyUnknownDims = false; + for (var i = 0; i < inputShape.length; ++i) { + if (this.isUnknown(inputShape[i])) { + anyUnknownDims = true; + break; + } + } + if (anyUnknownDims) { + return inputShape.slice(0, 1).concat(this.targetShape); + } + else { + return inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); + } + }; + Reshape.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = types_utils_1.getExactlyOneTensor(inputs); + var inputShape = input.shape; + var outputShape = inputShape.slice(0, 1).concat(_this.fixUnknownDimension(inputShape.slice(1), _this.targetShape)); + return input.reshape(outputShape); + }); + }; + Reshape.prototype.getConfig = function () { + var config = { + targetShape: this.targetShape, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Reshape.className = 'Reshape'; + return Reshape; +}(topology_1.Layer)); +exports.Reshape = Reshape; +tfjs_core_1.serialization.SerializationMap.register(Reshape); +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js.map new file mode 100644 index 0000000..601ae57 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/layers/core.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,mDAAgF;AAGhF,8CAAoH;AACpH,2CAA6C;AAC7C,8CAAoG;AACpG,+CAAsD;AACtD,0CAA2C;AAC3C,oCAA0D;AAC1D,gDAAyG;AACzG,gDAAyG;AAEzG,gDAAkD;AAClD,oDAA6E;AA+B7E;IAA6B,2BAAK;IAOhC,iBAAY,MAA0B;QAAtC,YACE,kBAAM,MAAM,CAAC,SAYd;QAXC,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClD,KAAI,CAAC,UAAU,GAAG,iBAAS,CAAC,KAAI,CAAC,IAAI,CAAC,CAAC;QAEvC,KAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,KAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,KAAI,CAAC,IAAI,IAAI,IAAI,EAAE;YACrB,MAAM,IAAI,4BAAmB,CACzB,4DAA4D;gBAC5D,KAAI,CAAC,IAAI,CAAC,CAAC;SAChB;QACD,KAAI,CAAC,eAAe,GAAG,IAAI,CAAC;;IAC9B,CAAC;IAEO,+BAAa,GAArB,UAAsB,KAAa;QACjC,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YAC3B,OAAO,IAAI,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S,CAAC;IAoG/B,cAAC;CAAA,AArGD,CAA6B,gBAAK,GAqGjC;AArGY,0BAAO;AAsGpB,yBAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/core_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/core_test.js.map new file mode 100644 index 0000000..9830646 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/core_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core_test.js","sourceRoot":"","sources":["../../src/layers/core_test.ts"],"names":[],"mappings":";;AAeA,mDAAqG;AAGrG,2CAA6C;AAC7C,8BAAgC;AAEhC,wDAAoD;AACpD,kDAA8C;AAC9C,oEAAsF;AACtF,kDAA+F;AAE/F,+BAAyD;AAGzD,QAAQ,CAAC,yBAAyB,EAAE;IAClC,IAAM,YAAY,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9B,IAAM,cAAc,GAAG;QACrB,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC;QAC1D,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC;QAC9D,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC;KAC7D,CAAC;4BAES,IAAI;gCACF,aAAa;YACtB,IAAM,SAAS,GAAG,iBAAe,IAAI,OAAI;iBACrC,iBAAe,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAG,CAAA,CAAC;YACzD,EAAE,CAAC,SAAS,EAAE;gBACZ,IAAM,YAAY,GAAG,GAA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IAAM,YAAY,GAAG,IAAI,cAAO,CAAC,EAAC,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAC,CAAC,CAAC;QAC9D,IAAM,CAAC,GACH,oBAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1E,MAAM,CAAC,cAAM,OAAA,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,EAA3B,CAA2B,CAAC;aACpC,YAAY,CAAC,yCAAyC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.d.ts new file mode 100644 index 0000000..8f053e9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.d.ts @@ -0,0 +1,35 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Constraint, ConstraintIdentifier } from '../constraints'; +import { Layer, LayerConfig } from '../engine/topology'; +import { Initializer, InitializerIdentifier } from '../initializers'; +import { Regularizer, RegularizerIdentifier } from '../regularizers'; +import { Kwargs, Shape } from '../types'; +export interface EmbeddingLayerConfig extends LayerConfig { + inputDim: number; + outputDim: number; + embeddingsInitializer?: InitializerIdentifier | Initializer; + embeddingsRegularizer?: RegularizerIdentifier | Regularizer; + activityRegularizer?: RegularizerIdentifier | Regularizer; + embeddingsConstraint?: ConstraintIdentifier | Constraint; + maskZero?: boolean; + inputLength?: number | number[]; +} +export declare class Embedding extends Layer { + static className: string; + private inputDim; + private outputDim; + private embeddingsInitializer; + private maskZero; + private inputLength; + private embeddings; + readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier; + private readonly embeddingsRegularizer?; + private readonly embeddingsConstraint?; + constructor(config: EmbeddingLayerConfig); + build(inputShape: Shape | Shape[]): void; + protected warnOnIncompatibleInputShape(inputShape: Shape): void; + computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js new file mode 100644 index 0000000..d0c38c5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js @@ -0,0 +1,118 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var K = require("../backend/tfjs_backend"); +var constraints_1 = require("../constraints"); +var topology_1 = require("../engine/topology"); +var errors_1 = require("../errors"); +var initializers_1 = require("../initializers"); +var regularizers_1 = require("../regularizers"); +var generic_utils = require("../utils/generic_utils"); +var types_utils_1 = require("../utils/types_utils"); +var Embedding = (function (_super) { + __extends(Embedding, _super); + function Embedding(config) { + var _this = _super.call(this, config) || this; + _this.embeddings = null; + _this.DEFAULT_EMBEDDINGS_INITIALIZER = 'randomUniform'; + if (config.batchInputShape == null && config.inputShape == null) { + var batchSize = null; + if (config.batchSize != null) { + batchSize = config.batchSize; + } + if (config.inputLength == null) { + _this.batchInputShape = [batchSize, null]; + } + else { + _this.batchInputShape = + [batchSize].concat(generic_utils.toList(config.inputLength)); + } + } + _this.inputDim = config.inputDim; + _this.outputDim = config.outputDim; + _this.embeddingsInitializer = initializers_1.getInitializer(config.embeddingsInitializer || _this.DEFAULT_EMBEDDINGS_INITIALIZER); + _this.embeddingsRegularizer = regularizers_1.getRegularizer(config.embeddingsRegularizer); + _this.activityRegularizer = regularizers_1.getRegularizer(config.activityRegularizer); + _this.embeddingsConstraint = constraints_1.getConstraint(config.embeddingsConstraint); + _this.maskZero = config.maskZero; + _this.inputLength = config.inputLength; + return _this; + } + Embedding.prototype.build = function (inputShape) { + this.embeddings = this.addWeight('embeddings', [this.inputDim, this.outputDim], this.dtype, this.embeddingsInitializer, this.embeddingsRegularizer, true, this.embeddingsConstraint); + this.built = true; + }; + Embedding.prototype.warnOnIncompatibleInputShape = function (inputShape) { }; + Embedding.prototype.computeMask = function (inputs, mask) { + throw new errors_1.NotImplementedError('computeMask has not been implemented for Embedding yet'); + }; + Embedding.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + if (this.inputLength == null) { + return inputShape.concat([this.outputDim]); + } + var inLens = generic_utils.toList(this.inputLength); + if (inLens.length !== inputShape.length - 1) { + throw new errors_1.ValueError("\"inputLength\" is " + this.inputLength + ", but received " + + ("input shape has shape " + inputShape)); + } + else { + var i = 0; + for (var k = 0; k < inLens.length; ++k) { + var s1 = inLens[k]; + var s2 = inputShape[k + 1]; + if ((s1 != null) && (s2 != null) && (s1 !== s2)) { + throw new errors_1.ValueError("\"inputLength\" is " + this.inputLength + ", but received " + + ("input shape has shape " + inputShape)); + } + else if (s1 == null) { + inLens[i] = s2; + } + i++; + } + } + return [inputShape[0]].concat(inLens, [this.outputDim]); + }; + Embedding.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = types_utils_1.getExactlyOneTensor(inputs); + if (input.dtype !== 'int32') { + input = K.cast(input, 'int32'); + } + var output = K.gather(_this.embeddings.read(), input.as1D()); + return output.reshape(types_utils_1.getExactlyOneShape(_this.computeOutputShape(input.shape))); + }); + }; + Embedding.prototype.getConfig = function () { + var config = { + inputDim: this.inputDim, + outputDim: this.outputDim, + embeddingsInitializer: initializers_1.serializeInitializer(this.embeddingsInitializer), + embeddingsRegularizer: regularizers_1.serializeRegularizer(this.embeddingsRegularizer), + activityRegularizer: regularizers_1.serializeRegularizer(this.activityRegularizer), + embeddingsConstraint: constraints_1.serializeConstraint(this.embeddingsConstraint), + maskZero: this.maskZero, + inputLength: this.inputLength + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Embedding.className = 'Embedding'; + return Embedding; +}(topology_1.Layer)); +exports.Embedding = Embedding; +tfjs_core_1.serialization.SerializationMap.register(Embedding); +//# sourceMappingURL=embeddings.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js.map new file mode 100644 index 0000000..ec5e01d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings.js.map @@ -0,0 +1 @@ +{"version":3,"file":"embeddings.js","sourceRoot":"","sources":["../../src/layers/embeddings.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,mDAAkE;AAGlE,2CAA6C;AAC7C,8CAAoG;AACpG,+CAAsD;AACtD,oCAA0D;AAC1D,gDAAyG;AACzG,gDAAyG;AAEzG,sDAAwD;AACxD,oDAA6E;AA4D7E;IAA+B,6BAAK;IAelC,mBAAY,MAA4B;QAAxC,YACE,kBAAM,MAAM,CAAC,SA8Bd;QAtCO,gBAAU,GAAkB,IAAI,CAAC;QAEhC,oCAA8B,GACnC,eAAe,CAAC;QAMlB,IAAI,MAAM,CAAC,eAAe,IAAI,IAAI,IAAI,MAAM,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,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;QACF,IAAM,UAAU,GAAG,iBAAM,SAAS,WAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;IAzHM,mBAAS,GAAG,WAAW,CAAC;IA0HjC,gBAAC;CAAA,AA3HD,CAA+B,gBAAK,GA2HnC;AA3HY,8BAAS;AA6HtB,yBAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings_test.js.map new file mode 100644 index 0000000..6733646 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/embeddings_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"embeddings_test.js","sourceRoot":"","sources":["../../src/layers/embeddings_test.ts"],"names":[],"mappings":";;AAeA,mDAAsF;AAEtF,8BAAgC;AAChC,kDAAoD;AAEpD,IAAM,iBAAiB,GAAG,qBAAS,CAAC,iBAAiB,CAAC;AAItD,4BAAe,CAAC,wCAAwC,EAAE;IACxD,IAAM,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,IAAM,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9B,IAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,IAAM,QAAQ,GAAG,GAAG,CAAC;4BACV,UAAU;gCACR,SAAS;YAClB,IAAM,SAAS,GAAG,gBAAc,UAAU,oBAAe,SAAW,CAAC;YACrE,EAAE,CAAC,SAAS,EAAE;gBACZ,IAAM,cAAc,GAAG,GAAG,CAAC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,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CACvC,EAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,qBAAqB,EAAE,eAAe,EAAC,CAAC,CAAC;YACzE,IAAM,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,CAAW,CAAC;YAE5C,IAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;YACxD,IAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;YACxD,IAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;YAExD,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAElC,MAAM,CAAC;gBACL,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IAlBD,KAAoB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;QAArB,IAAM,KAAK,eAAA;gBAAL,KAAK;KAkBf;AACH,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.d.ts new file mode 100644 index 0000000..d2019d4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.d.ts @@ -0,0 +1,56 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Layer, LayerConfig, SymbolicTensor } from '../engine/topology'; +import { Kwargs, Shape } from '../types'; +export declare abstract class Merge extends Layer { + protected reshapeRequired: boolean; + constructor(config?: LayerConfig); + protected mergeFunction(inputs: Tensor[]): Tensor; + private computeElementwiseOpOutputShape(shape1, shape2); + build(inputShape: Shape | Shape[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; +} +export declare class Add extends Merge { + static className: string; + constructor(config?: LayerConfig); + protected mergeFunction(inputs: Tensor[]): Tensor; +} +export declare function add(config?: SymbolicTensor[] | Tensor[] | LayerConfig): Layer | SymbolicTensor | Tensor; +export declare class Multiply extends Merge { + static className: string; + constructor(config?: LayerConfig); + protected mergeFunction(inputs: Tensor[]): Tensor; +} +export declare function multiply(config?: SymbolicTensor[] | Tensor[] | LayerConfig): Layer | SymbolicTensor | Tensor; +export declare class Average extends Merge { + static className: string; + constructor(config?: LayerConfig); + protected mergeFunction(inputs: Tensor[]): Tensor; +} +export declare function average(config?: SymbolicTensor[] | Tensor[] | LayerConfig): Layer | SymbolicTensor | Tensor; +export declare class Maximum extends Merge { + static className: string; + constructor(config?: LayerConfig); + protected mergeFunction(inputs: Tensor[]): Tensor; +} +export declare function maximum(config?: SymbolicTensor[] | Tensor[] | LayerConfig): Layer | SymbolicTensor | Tensor; +export declare class Minimum extends Merge { + static className: string; + constructor(config?: LayerConfig); + protected mergeFunction(inputs: Tensor[]): Tensor; +} +export declare function minimum(config?: SymbolicTensor[] | Tensor[] | LayerConfig): Layer | SymbolicTensor | Tensor; +export interface ConcatenateLayerConfig extends LayerConfig { + axis?: number; +} +export declare class Concatenate extends Merge { + static className: string; + readonly DEFAULT_AXIS: number; + private readonly axis; + constructor(config?: ConcatenateLayerConfig); + build(inputShape: Shape | Shape[]): void; + protected mergeFunction(inputs: Tensor[]): Tensor; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + getConfig(): serialization.ConfigDict; +} +export declare function concatenate(config?: SymbolicTensor[] | Tensor[] | ConcatenateLayerConfig): Layer | SymbolicTensor | Tensor; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js new file mode 100644 index 0000000..7215ef5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js @@ -0,0 +1,446 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var K = require("../backend/tfjs_backend"); +var topology_1 = require("../engine/topology"); +var state_1 = require("../backend/state"); +var errors_1 = require("../errors"); +var generic_utils = require("../utils/generic_utils"); +var mathUtils = require("../utils/math_utils"); +var types_utils_1 = require("../utils/types_utils"); +var Merge = (function (_super) { + __extends(Merge, _super); + function Merge(config) { + var _this = _super.call(this, config || {}) || this; + _this.supportsMasking = true; + return _this; + } + Merge.prototype.mergeFunction = function (inputs) { + throw new errors_1.NotImplementedError(); + }; + Merge.prototype.computeElementwiseOpOutputShape = function (shape1, shape2) { + if (shape1 == null || shape2 == null) { + return null; + } + else if (shape1.length < shape2.length) { + return this.computeElementwiseOpOutputShape(shape2, shape1); + } + else if (shape2.length === 0) { + return shape1; + } + var outputShape = shape1.slice(0, shape1.length - shape2.length); + for (var k = 0; k < shape2.length; ++k) { + var i = shape1[shape1.length - shape2.length + k]; + var j = shape2[k]; + if (i == null || j == null || i < 0 || j < 0) { + outputShape.push(null); + } + else if (i === 1) { + outputShape.push(j); + } + else if (j === 1) { + outputShape.push(i); + } + else { + if (i !== j) { + throw new errors_1.ValueError('Operands could not be broadcast together with shapes ' + + JSON.stringify(shape1) + ' ' + JSON.stringify(shape2)); + } + outputShape.push(i); + } + } + return outputShape; + }; + Merge.prototype.build = function (inputShape) { + if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) { + inputShape = [types_utils_1.getExactlyOneShape(inputShape)]; + } + inputShape = inputShape; + if (inputShape.length < 2) { + throw new errors_1.ValueError('A merge layer should be called on an Array of at least 2 inputs.' + + (" Got " + inputShape.length + " input(s).")); + } + var batchSizes = []; + for (var _i = 0, inputShape_1 = inputShape; _i < inputShape_1.length; _i++) { + var shape = inputShape_1[_i]; + if (shape != null && shape[0] !== null) { + batchSizes.push(shape[0]); + } + } + batchSizes = generic_utils.unique(batchSizes); + if (batchSizes.length > 1) { + throw new errors_1.ValueError("Can not merge tensors with different batch sizes. " + + ("Got tensors with shapes: " + JSON.stringify(inputShape) + ".")); + } + var outputShape = inputShape[0] == null ? null : inputShape[0].slice(1); + for (var i = 1; i < inputShape.length; ++i) { + var shape = inputShape[i] == null ? null : inputShape[i].slice(1); + outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); + } + var allRanks = inputShape.map(function (shape) { return shape.length; }); + if (inputShape.indexOf(null) === -1 && + generic_utils.unique(allRanks).length === 1) { + this.reshapeRequired = false; + } + else { + this.reshapeRequired = true; + } + }; + Merge.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = inputs; + if (_this.reshapeRequired) { + var reshapedInputs = []; + var inputDims = inputs.map(function (input) { return input.rank; }); + if (inputDims.indexOf(null) === -1) { + var maxNDim = mathUtils.max(inputDims); + for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) { + var x = inputs_1[_i]; + var xNDim = x.rank; + for (var k = 0; k < maxNDim - xNDim; ++k) { + x = K.expandDims(x, 1); + } + reshapedInputs.push(x); + } + return _this.mergeFunction(reshapedInputs); + } + else { + var transposed = false; + for (var _a = 0, inputs_2 = inputs; _a < inputs_2.length; _a++) { + var x = inputs_2[_a]; + var xNDim = x.rank; + if (xNDim == null) { + var xShape = x.shape; + var batchSize = xShape[0]; + var newShape = xShape.slice(1).concat([batchSize]); + var xTransposed = x.reshape([batchSize].concat(mathUtils.arrayProd(xShape.slice(1)))); + xTransposed = tfc.transpose(xTransposed, [1, 0]); + xTransposed = xTransposed.reshape(newShape); + reshapedInputs.push(xTransposed); + transposed = true; + } + else if (xNDim > 1) { + var dims = mathUtils.range(1, xNDim).concat([0]); + reshapedInputs.push(tfc.transpose(x, dims)); + transposed = true; + } + else { + reshapedInputs.push(x); + } + } + var y = _this.mergeFunction(reshapedInputs); + var yNDim = y.rank; + if (transposed) { + if (yNDim == null) { + var yShape = y.shape; + var yNDim_1 = yShape.length; + var batchSize = yShape[yNDim_1 - 1]; + var newShape = [batchSize].concat(yShape.slice(0, yShape.length - 1)); + y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0]) + .reshape(newShape); + } + else if (yNDim > 1) { + var dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1)); + y = tfc.transpose(y, dims); + } + } + return y; + } + } + else { + return _this.mergeFunction(inputs); + } + }); + }; + Merge.prototype.computeOutputShape = function (inputShape) { + inputShape = inputShape; + var outputShape; + if (inputShape[0] == null) { + outputShape = null; + } + else { + outputShape = inputShape[0].slice(1); + } + for (var i = 1; i < inputShape.length; ++i) { + var shape = inputShape[i] == null ? null : inputShape[i].slice(1); + outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); + } + var batchSizes = []; + for (var _i = 0, inputShape_2 = inputShape; _i < inputShape_2.length; _i++) { + var shape = inputShape_2[_i]; + if (shape != null && shape[0] !== null) { + batchSizes.push(shape[0]); + } + } + batchSizes = generic_utils.unique(batchSizes); + if (batchSizes.length === 1) { + outputShape = batchSizes.concat(outputShape); + } + else { + outputShape = [null].concat(outputShape); + } + return outputShape; + }; + return Merge; +}(topology_1.Layer)); +exports.Merge = Merge; +var Add = (function (_super) { + __extends(Add, _super); + function Add(config) { + return _super.call(this, config) || this; + } + Add.prototype.mergeFunction = function (inputs) { + return tfjs_core_1.tidy(function () { + var output = tfc.zeros(inputs[0].shape); + for (var _i = 0, inputs_3 = inputs; _i < inputs_3.length; _i++) { + var input = inputs_3[_i]; + output = tfc.add(output, input); + } + return output; + }); + }; + Add.className = 'Add'; + return Add; +}(Merge)); +exports.Add = Add; +tfjs_core_1.serialization.SerializationMap.register(Add); +function add(config) { + if (Array.isArray(config)) { + var layer = new Add({}); + return layer.apply(config); + } + else { + return new Add(config); + } +} +exports.add = add; +var Multiply = (function (_super) { + __extends(Multiply, _super); + function Multiply(config) { + return _super.call(this, config) || this; + } + Multiply.prototype.mergeFunction = function (inputs) { + return tfjs_core_1.tidy(function () { + var output = tfc.ones(inputs[0].shape); + for (var _i = 0, inputs_4 = inputs; _i < inputs_4.length; _i++) { + var input = inputs_4[_i]; + output = tfc.mul(output, input); + } + return output; + }); + }; + Multiply.className = 'Multiply'; + return Multiply; +}(Merge)); +exports.Multiply = Multiply; +tfjs_core_1.serialization.SerializationMap.register(Multiply); +function multiply(config) { + if (Array.isArray(config)) { + var layer = new Multiply({}); + return layer.apply(config); + } + else { + return new Multiply(config); + } +} +exports.multiply = multiply; +var Average = (function (_super) { + __extends(Average, _super); + function Average(config) { + return _super.call(this, config) || this; + } + Average.prototype.mergeFunction = function (inputs) { + return tfjs_core_1.tidy(function () { + var output = tfc.zeros(inputs[0].shape); + for (var _i = 0, inputs_5 = inputs; _i < inputs_5.length; _i++) { + var input = inputs_5[_i]; + output = tfc.add(output, input); + } + return tfc.mul(state_1.getScalar(1 / inputs.length), output); + }); + }; + Average.className = 'Average'; + return Average; +}(Merge)); +exports.Average = Average; +tfjs_core_1.serialization.SerializationMap.register(Average); +function average(config) { + if (Array.isArray(config)) { + var layer = new Average({}); + return layer.apply(config); + } + else { + return new Average(config); + } +} +exports.average = average; +var Maximum = (function (_super) { + __extends(Maximum, _super); + function Maximum(config) { + return _super.call(this, config) || this; + } + Maximum.prototype.mergeFunction = function (inputs) { + return tfjs_core_1.tidy(function () { + var output = inputs[0]; + for (var i = 1; i < inputs.length; ++i) { + output = tfc.maximum(output, inputs[i]); + } + return output; + }); + }; + Maximum.className = 'Maximum'; + return Maximum; +}(Merge)); +exports.Maximum = Maximum; +tfjs_core_1.serialization.SerializationMap.register(Maximum); +function maximum(config) { + if (Array.isArray(config)) { + var layer = new Maximum({}); + return layer.apply(config); + } + else { + return new Maximum(config); + } +} +exports.maximum = maximum; +var Minimum = (function (_super) { + __extends(Minimum, _super); + function Minimum(config) { + return _super.call(this, config) || this; + } + Minimum.prototype.mergeFunction = function (inputs) { + return tfjs_core_1.tidy(function () { + var output = inputs[0]; + for (var i = 1; i < inputs.length; ++i) { + output = tfc.minimum(output, inputs[i]); + } + return output; + }); + }; + Minimum.className = 'Minimum'; + return Minimum; +}(Merge)); +exports.Minimum = Minimum; +tfjs_core_1.serialization.SerializationMap.register(Minimum); +function minimum(config) { + if (Array.isArray(config)) { + var layer = new Minimum({}); + return layer.apply(config); + } + else { + return new Minimum(config); + } +} +exports.minimum = minimum; +var Concatenate = (function (_super) { + __extends(Concatenate, _super); + function Concatenate(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_AXIS = -1; + if (config == null) { + config = {}; + } + _this.axis = config.axis == null ? _this.DEFAULT_AXIS : config.axis; + _this.supportsMasking = true; + _this.reshapeRequired = false; + return _this; + } + Concatenate.prototype.build = function (inputShape) { + if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) || + inputShape.length === 1) { + throw new errors_1.ValueError('A `Concatenate` layer should be called on a list of at least 2 ' + + 'inputs'); + } + inputShape = inputShape; + var allNoneShape = true; + for (var _i = 0, inputShape_3 = inputShape; _i < inputShape_3.length; _i++) { + var shape = inputShape_3[_i]; + if (shape != null) { + allNoneShape = false; + break; + } + } + if (allNoneShape) { + return; + } + var shapeSet = []; + for (var i = 0; i < inputShape.length; ++i) { + var shapeWithoutConcatAxis = inputShape[i].slice(); + shapeWithoutConcatAxis.splice(this.axis, 1); + var exists = false; + for (var _a = 0, shapeSet_1 = shapeSet; _a < shapeSet_1.length; _a++) { + var shape = shapeSet_1[_a]; + if (tfjs_core_1.util.arraysEqual(shape, shapeWithoutConcatAxis)) { + exists = true; + break; + } + } + if (!exists) { + shapeSet.push(shapeWithoutConcatAxis); + } + } + if (shapeSet.length > 1) { + throw new errors_1.ValueError('A `Concatenate` layer requires inputs with matching shapes ' + + 'except for the concat axis. Got input shapes: ' + + JSON.stringify(inputShape)); + } + }; + Concatenate.prototype.mergeFunction = function (inputs) { + var _this = this; + return tfjs_core_1.tidy(function () { + return K.concatenate(inputs, _this.axis); + }); + }; + Concatenate.prototype.computeOutputShape = function (inputShape) { + if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) { + throw new errors_1.ValueError('A `Concatenate` layer should be called on a list of inputs.'); + } + var inputShapes = inputShape; + var outputShape = inputShapes[0].slice(); + var axis = this.axis < 0 ? outputShape.length + this.axis : this.axis; + for (var _i = 0, _a = inputShapes.slice(1); _i < _a.length; _i++) { + var shape = _a[_i]; + if (outputShape[axis] == null || shape[axis] == null) { + outputShape[axis] = null; + break; + } + outputShape[axis] += shape[axis]; + } + return outputShape; + }; + Concatenate.prototype.getConfig = function () { + var config = { + 'axis': this.axis, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Concatenate.className = 'Concatenate'; + return Concatenate; +}(Merge)); +exports.Concatenate = Concatenate; +tfjs_core_1.serialization.SerializationMap.register(Concatenate); +function concatenate(config) { + if (Array.isArray(config)) { + var layer = new Concatenate({}); + return layer.apply(config); + } + else { + return new Concatenate(config); + } +} +exports.concatenate = concatenate; +//# sourceMappingURL=merge.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js.map new file mode 100644 index 0000000..0371d11 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/merge.js.map @@ -0,0 +1 @@ +{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/layers/merge.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,2CAA6C;AAC7C,mDAAwE;AAExE,2CAA6C;AAC7C,+CAAsE;AACtE,0CAA2C;AAC3C,oCAA0D;AAE1D,sDAAwD;AACxD,+CAAiD;AACjD,oDAAwD;AAOxD;IAAoC,yBAAK;IAGvC,eAAY,MAAoB;QAAhC,YACE,kBAAM,MAAM,IAAI,EAAE,CAAC,SAEpB;QADC,KAAI,CAAC,eAAe,GAAG,IAAI,CAAC;;IAC9B,CAAC;IAMS,6BAAa,GAAvB,UAAwB,MAAgB;QACtC,MAAM,IAAI,4BAAmB,EAAE,CAAC;IAClC,CAAC;IAYO,+CAA+B,GAAvC,UAAwC,MAAa,EAAE,MAAa;QAClE,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,EAAE;YACpC,OAAO,IAAI,CAAC;SACb;aAAM,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE;YACxC,OAAO,IAAI,CAAC,+BAA+B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC7D;aAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,OAAO,MAAM,CAAC;SACf;QACD,IAAM,WAAW,GAAU,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAC1E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACtC,IAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACpD,IAAM,CA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C,MAAM,CAAC,EAAE;QACzB,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;QAClC,OAAO,KAAK,CAAC,KAAK,CAAC,MAAqC,CAE9C,CAAC;KACZ;SAAM;QACL,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;KAChC;AACH,CAAC;AAXD,kCAWC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/merge_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/merge_test.js.map new file mode 100644 index 0000000..bbd57ea --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/merge_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"merge_test.js","sourceRoot":"","sources":["../../src/layers/merge_test.ts"],"names":[],"mappings":";;AAeA,mDAAgG;AAGhG,8BAAgC;AAChC,yDAAoD;AAEpD,oEAAsF;AACtF,kDAA+F;AAE/F,iCAA8E;AAI9E,4BAAe,CAAC,2CAA2C,EAAE;IAC3D,IAAM,MAAM,GAAG,CAAC,WAAG,EAAE,eAAO,EAAE,gBAAQ,EAAE,eAAO,EAAE,eAAO,CAAC,CAAC;IAC1D,IAAM,mBAAmB,GAAY;QACnC,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;KACX,CAAC;IACF,IAAM,cAAc,GAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;4BAE7B,KAAK;gCACH,UAAU;oCACR,SAAS;gBAClB,IAAM,SAAS,GACX,WAAS,KAAK,CAAC,IAAI,qBAAgB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,OAAI;qBACjE,eAAa,SAAW,CAAA,CAAC;gBAC7B,EAAE,CAAC,SAAS,EAAE;oBACZ,IAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAC,CAAC,CAAC;oBAC/C,IAAM,cAAc,GAAyB,EA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AE,CAAC,CAAC,CAAC;gBAC1C,MAAM,EAAE,SAAS;aAClB;YACD,SAAS,EAAE,YAAY;SACxB,CAAC;QAEF,IAAM,QAAQ,GACV,yCAAmB,CAAC,kBAAkB,CAA6B,CAAC;QACxE,IAAM,KAAK,GAAG,2BAAW,CAAC,QAAQ,CAAc,CAAC;QACjD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,mBAAW,CAAC,CAAC;QAC/C,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.d.ts new file mode 100644 index 0000000..a5cbfa0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.d.ts @@ -0,0 +1,48 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Constraint, ConstraintIdentifier } from '../constraints'; +import { Layer, LayerConfig } from '../engine/topology'; +import { Initializer, InitializerIdentifier } from '../initializers'; +import { Regularizer, RegularizerIdentifier } from '../regularizers'; +import { Kwargs, Shape } from '../types'; +export declare function batchNormalization(x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor, epsilon?: number): Tensor; +export declare function normalizeBatchInTraining(x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[], epsilon?: number): [Tensor, Tensor, Tensor]; +export interface BatchNormalizationLayerConfig extends LayerConfig { + axis?: number; + momentum?: number; + epsilon?: number; + center?: boolean; + scale?: boolean; + betaInitializer?: InitializerIdentifier | Initializer; + gammaInitializer?: InitializerIdentifier | Initializer; + movingMeanInitializer?: InitializerIdentifier | Initializer; + movingVarianceInitializer?: InitializerIdentifier | Initializer; + betaConstraint?: ConstraintIdentifier | Constraint; + gammaConstraint?: ConstraintIdentifier | Constraint; + betaRegularizer?: RegularizerIdentifier | Regularizer; + gammaRegularizer?: RegularizerIdentifier | Regularizer; +} +export declare class BatchNormalization extends Layer { + static className: string; + private readonly axis; + private readonly momentum; + private readonly epsilon; + private readonly center; + private readonly scale; + private readonly betaInitializer; + private readonly gammaInitializer; + private readonly movingMeanInitializer; + private readonly movingVarianceInitializer; + private readonly betaConstraint; + private readonly gammaConstraint; + private readonly betaRegularizer; + private readonly gammaRegularizer; + private gamma; + private beta; + private movingMean; + private movingVariance; + private stepCount; + constructor(config: BatchNormalizationLayerConfig); + build(inputShape: Shape | Shape[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js new file mode 100644 index 0000000..00b3793 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js @@ -0,0 +1,202 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var constraints_1 = require("../constraints"); +var topology_1 = require("../engine/topology"); +var state_1 = require("../backend/state"); +var errors_1 = require("../errors"); +var initializers_1 = require("../initializers"); +var regularizers_1 = require("../regularizers"); +var generic_utils = require("../utils/generic_utils"); +var math_utils = require("../utils/math_utils"); +var types_utils_1 = require("../utils/types_utils"); +function batchNormalization(x, mean, variance, beta, gamma, epsilon) { + if (epsilon === void 0) { epsilon = 1e-3; } + var out; + if (x.rank === 2) { + out = tfc.batchNormalization2d(x, mean, variance, epsilon, gamma, beta); + } + else if (x.rank === 3) { + out = tfc.batchNormalization3d(x, mean, variance, epsilon, gamma, beta); + } + else if (x.rank === 4) { + out = tfc.batchNormalization4d(x, mean, variance, epsilon, gamma, beta); + } + else { + throw new errors_1.NotImplementedError("batchNormalization is not implememnted for array of rank " + x.rank + " " + + "yet"); + } + return out; +} +exports.batchNormalization = batchNormalization; +function regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { + if (epsilon === void 0) { epsilon = 1e-3; } + return tfjs_core_1.tidy(function () { + var meanAndVariance = tfc.moments(x, reductionAxes); + var mean = meanAndVariance.mean; + var variance = meanAndVariance.variance; + var normed = batchNormalization(x, mean, variance, beta, gamma, epsilon); + return [normed, mean, variance]; + }); +} +function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { + if (epsilon === void 0) { epsilon = 1e-3; } + return tfjs_core_1.tidy(function () { + var meanAndVariance = tfc.moments(x, reductionAxes); + var mean = meanAndVariance.mean; + var variance = meanAndVariance.variance; + var targetShape = []; + for (var _i = 0, _a = math_utils.range(0, x.rank); _i < _a.length; _i++) { + var axis = _a[_i]; + if (reductionAxes.indexOf(axis) !== -1) { + targetShape.push(1); + } + else { + targetShape.push(x.shape[axis]); + } + } + var broadcastMean = mean.reshape(targetShape); + var broadcastVariance = variance.reshape(targetShape); + var broadcastGamma = gamma == null ? null : gamma.reshape(targetShape); + var broadcastBeta = beta == null ? null : beta.reshape(targetShape); + var normed = batchNormalization(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon); + return [normed, mean, variance]; + }); +} +function normalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { + if (epsilon === void 0) { epsilon = 1e-3; } + if (tfjs_core_1.util.arraysEqual(reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) { + return regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); + } + else { + return broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); + } +} +exports.normalizeBatchInTraining = normalizeBatchInTraining; +var BatchNormalization = (function (_super) { + __extends(BatchNormalization, _super); + function BatchNormalization(config) { + var _this = _super.call(this, config) || this; + _this.supportsMasking = true; + _this.axis = config.axis == null ? -1 : config.axis; + _this.momentum = config.momentum == null ? 0.99 : config.momentum; + _this.epsilon = config.epsilon == null ? 1e-3 : config.epsilon; + _this.center = config.center == null ? true : config.center; + _this.scale = config.scale == null ? true : config.scale; + _this.betaInitializer = initializers_1.getInitializer(config.betaInitializer || 'zeros'); + _this.gammaInitializer = initializers_1.getInitializer(config.gammaInitializer || 'ones'); + _this.movingMeanInitializer = + initializers_1.getInitializer(config.movingMeanInitializer || 'zeros'); + _this.movingVarianceInitializer = + initializers_1.getInitializer(config.movingVarianceInitializer || 'ones'); + _this.betaConstraint = constraints_1.getConstraint(config.betaConstraint); + _this.gammaConstraint = constraints_1.getConstraint(config.gammaConstraint); + _this.betaRegularizer = regularizers_1.getRegularizer(config.betaRegularizer); + _this.gammaRegularizer = regularizers_1.getRegularizer(config.gammaRegularizer); + _this.stepCount = 0; + return _this; + } + BatchNormalization.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length); + var dim = inputShape[axis]; + if (dim == null) { + throw new errors_1.ValueError("Axis " + axis + " of input tensor should have a defined dimension but " + + "the layer received an input with shape " + + (JSON.stringify(inputShape) + ".")); + } + this.inputSpec = + [new topology_1.InputSpec({ ndim: inputShape.length, axes: (_a = {}, _a[axis] = dim, _a) })]; + var shape = [dim]; + if (this.scale) { + this.gamma = this.addWeight('gamma', shape, null, this.gammaInitializer, this.gammaRegularizer, true, this.gammaConstraint); + } + if (this.center) { + this.beta = this.addWeight('beta', shape, null, this.betaInitializer, this.betaRegularizer, true, this.betaConstraint); + } + this.movingMean = this.addWeight('moving_mean', shape, null, this.movingMeanInitializer, null, false); + this.movingVariance = this.addWeight('moving_variance', shape, null, this.movingVarianceInitializer, null, false); + this.built = true; + var _a; + }; + BatchNormalization.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + var training = kwargs['training'] == null ? false : kwargs['training']; + var input = types_utils_1.getExactlyOneTensor(inputs); + var inputShape = input.shape; + var ndim = inputShape.length; + var reductionAxes = math_utils.range(0, ndim); + var axis = _this.axis >= 0 ? _this.axis : (_this.axis + ndim); + reductionAxes.splice(axis, 1); + var broadcastShape = generic_utils.pyListRepeat(1, ndim); + broadcastShape[axis] = inputShape[axis]; + var sortedReductionAxes = reductionAxes.slice(); + sortedReductionAxes.sort(); + var needsBroadcasting = !tfjs_core_1.util.arraysEqual(sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1)); + var normalizeInference = function () { + if (needsBroadcasting) { + var broadcastMovingMean = _this.movingMean.read().reshape(broadcastShape); + var broadcastMovingVariance = _this.movingVariance.read().reshape(broadcastShape); + var broadcastBeta = _this.center ? _this.beta.read().reshape(broadcastShape) : null; + var broadcastGamma = _this.scale ? _this.gamma.read().reshape(broadcastShape) : null; + return batchNormalization(input, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, _this.epsilon); + } + else { + return batchNormalization(input, _this.movingMean.read(), _this.movingVariance.read(), _this.beta == null ? null : _this.beta.read(), _this.gamma == null ? null : _this.gamma.read(), _this.epsilon); + } + }; + if (!training) { + return normalizeInference(); + } + var _a = normalizeBatchInTraining(input, _this.gamma.read(), _this.beta.read(), reductionAxes, _this.epsilon), normedTraining = _a[0], mean = _a[1], variance = _a[2]; + var sampleSize = math_utils.arrayProd(reductionAxes.map(function (axis) { return input.shape[axis]; })); + var varianceDebiased = variance.mul(state_1.getScalar(sampleSize / (sampleSize - (1 + _this.epsilon)))); + var updateMovingMeanAndVariance = function () { + _this.stepCount++; + var newMovingMean = tfc.movingAverage(_this.movingMean.read(), mean, _this.momentum, _this.stepCount); + _this.movingMean.write(newMovingMean); + var newMovingVariance = tfc.movingAverage(_this.movingVariance.read(), varianceDebiased, _this.momentum, _this.stepCount); + _this.movingVariance.write(newMovingVariance); + }; + updateMovingMeanAndVariance(); + return normedTraining; + }); + }; + BatchNormalization.prototype.getConfig = function () { + var config = { + axis: this.axis, + momentum: this.momentum, + epsilon: this.epsilon, + center: this.center, + scale: this.scale, + betaInitializer: initializers_1.serializeInitializer(this.betaInitializer), + gammaInitializer: initializers_1.serializeInitializer(this.gammaInitializer), + movingMeanInitializer: initializers_1.serializeInitializer(this.movingMeanInitializer), + movingVarianceInitializer: initializers_1.serializeInitializer(this.movingVarianceInitializer), + betaRegularizer: regularizers_1.serializeRegularizer(this.betaRegularizer), + gammaRegularizer: regularizers_1.serializeRegularizer(this.gammaRegularizer), + betaConstraint: constraints_1.serializeConstraint(this.betaConstraint), + gammaConstraint: constraints_1.serializeConstraint(this.gammaConstraint) + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + BatchNormalization.className = 'BatchNormalization'; + return BatchNormalization; +}(topology_1.Layer)); +exports.BatchNormalization = BatchNormalization; +tfjs_core_1.serialization.SerializationMap.register(BatchNormalization); +//# sourceMappingURL=normalization.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js.map new file mode 100644 index 0000000..b7686d7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization.js.map @@ -0,0 +1 @@ +{"version":3,"file":"normalization.js","sourceRoot":"","sources":["../../src/layers/normalization.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,2CAA6C;AAC7C,mDAAgH;AAEhH,8CAAoG;AACpG,+CAAiE;AACjE,0CAA2C;AAC3C,oCAA0D;AAC1D,gDAAyG;AACzG,gDAAyG;AAEzG,sDAAwD;AACxD,gDAAkD;AAClD,oDAA6E;AAmB7E,4BACI,CAAS,EAAE,IAAY,EAAE,QAAgB,EAAE,IAAa,EAAE,KAAc,EACxE,OAAc;IAAd,wBAAA,EAAA,cAAc;IAChB,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE;QAChB,GAAG,GAAG,GAAG,CAAC,oBAAoB,CAC1B,CAAa,EAAE,IAA2B,EAC1C,QAA+B,EAAE,OAAO,EAAE,KAA4B,EACtE,IAA2B,CAAC,CAAC;KAClC;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE;QAEvB,GAAG,GAAG,GAAG,CAAC,oBAAoB,CAC1B,CAAa,EAAE,IAA2B,EAC1C,QAA+B,EAAE,OAAO,EAAE,KAA4B,EACtE,IAA2B,CAAC,CAAC;KAClC;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE;QACvB,GAAG,GAAG,GAAG,CAAC,oBAAoB,CAC1B,CAAa,EAAE,IAA2B,EAC1C,QAA+B,EAAE,OAAO,EAAE,KAA4B,EACtE,IAA2B,CAAC,CAA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tensorflow/tfjs-layers/dist/layers/normalization_test.js.map new file mode 100644 index 0000000..967a39e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/normalization_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"normalization_test.js","sourceRoot":"","sources":["../../src/layers/normalization_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,iBAkiBA;;AAliBA,mDAAwH;AAExH,8BAAgC;AAChC,+CAAkD;AAClD,kDAA+F;AAC/F,iDAA6E;AAI7E,kCAAqB,CAAC,0BAA0B,EAAE;IAqBhD,EAAE,CAAC,qBAAqB,EAAE;QACxB,IAAM,CAAC,GAAG,oBAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1E,IAAM,KAAK,GAAG,oBAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,IAAM,IAAI,GAAG,oBAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACpC,IAAM,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC;QACpB,IAAA,4EACqD,EADpD,cAAM,EAAE,YAAI,EAAE,gBAAQ,CAC+B;QAC5D,+BAAkB,CACd,MAAM,EACN,oBAAQ,CACJ;YACE,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC;YAC/C,CAAC,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;YACjD,CAAC,SAAS,E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AAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;gBAChE,IAAI,EAAE,CAAC;YACT,CAAC,CAAC;iBACD,KAAK,CAAC,UAAA,GAAG;gBACR,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;;;SACR,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.d.ts new file mode 100644 index 0000000..28a16c5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.d.ts @@ -0,0 +1,19 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { DataFormat } from '../common'; +import { Layer, LayerConfig } from '../engine/topology'; +import { Kwargs, Shape } from '../types'; +export declare function temporalPadding(x: Tensor, padding?: [number, number]): Tensor; +export declare function spatial2dPadding(x: Tensor, padding?: [[number, number], [number, number]], dataFormat?: DataFormat): Tensor; +export interface ZeroPadding2DLayerConfig extends LayerConfig { + padding?: number | [number, number] | [[number, number], [number, number]]; + dataFormat?: DataFormat; +} +export declare class ZeroPadding2D extends Layer { + static className: string; + readonly dataFormat: DataFormat; + readonly padding: [[number, number], [number, number]]; + constructor(config?: ZeroPadding2DLayerConfig); + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js new file mode 100644 index 0000000..d5a651d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js @@ -0,0 +1,171 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var common_1 = require("../backend/common"); +var topology_1 = require("../engine/topology"); +var errors_1 = require("../errors"); +var types_utils_1 = require("../utils/types_utils"); +function temporalPadding(x, padding) { + return tfjs_core_1.tidy(function () { + if (x.rank !== 3) { + throw new errors_1.ValueError("temporalPadding expects input tensor to be 3-D, but received a " + + (x.rank + "-D tensor.")); + } + if (padding == null) { + padding = [1, 1]; + } + if (padding.length !== 2) { + throw new errors_1.ValueError("temporalPadding expects input padding pattern to be a length-2 " + + ("array, but received a length-" + padding.length + " array.")); + } + var pattern = [[0, 0], padding, [0, 0]]; + return tfc.pad(x, pattern); + }); +} +exports.temporalPadding = temporalPadding; +function spatial2dPadding(x, padding, dataFormat) { + return tfjs_core_1.tidy(function () { + if (x.rank !== 4) { + throw new errors_1.ValueError("temporalPadding expects input tensor to be 4-D, but received a " + + (x.rank + "-D tensor.")); + } + if (padding == null) { + padding = [[1, 1], [1, 1]]; + } + if (padding.length !== 2 || padding[0].length !== 2 || + padding[1].length !== 2) { + throw new errors_1.ValueError('spatial2dPadding expects `padding` to be an Array of two Arrays, ' + + 'each of which is an Array of two integers.'); + } + if (dataFormat == null) { + dataFormat = common_1.imageDataFormat(); + } + if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') { + throw new errors_1.ValueError("Unknown data format: " + dataFormat + ". " + + "Supported data formats are 'channelsLast' and 'channelsFirst."); + } + var pattern; + if (dataFormat === 'channelsFirst') { + pattern = [[0, 0], [0, 0], padding[0], padding[1]]; + } + else { + pattern = [[0, 0], padding[0], padding[1], [0, 0]]; + } + return tfc.pad(x, pattern); + }); +} +exports.spatial2dPadding = spatial2dPadding; +var ZeroPadding2D = (function (_super) { + __extends(ZeroPadding2D, _super); + function ZeroPadding2D(config) { + var _this = this; + if (config == null) { + config = {}; + } + _this = _super.call(this, config) || this; + _this.dataFormat = + config.dataFormat == null ? common_1.imageDataFormat() : config.dataFormat; + if (config.padding == null) { + _this.padding = [[1, 1], [1, 1]]; + } + else if (typeof config.padding === 'number') { + _this.padding = + [[config.padding, config.padding], [config.padding, config.padding]]; + } + else { + config.padding = config.padding; + if (config.padding.length !== 2) { + throw new errors_1.ValueError("ZeroPadding2D expects padding to be a length-2 array, but " + + ("received a length-" + config.padding.length + " array.")); + } + var heightPadding = void 0; + var widthPadding = void 0; + if (typeof config.padding[0] === 'number') { + heightPadding = + [config.padding[0], config.padding[0]]; + widthPadding = + [config.padding[1], config.padding[1]]; + } + else { + config.padding = config.padding; + if (config.padding[0].length !== 2) { + throw new errors_1.ValueError("ZeroPadding2D expects height padding to be a length-2 array, " + + ("but received a length-" + config.padding[0].length + " array.")); + } + heightPadding = config.padding[0]; + if (config.padding[1].length !== 2) { + throw new errors_1.ValueError("ZeroPadding2D expects width padding to be a length-2 array, " + + ("but received a length-" + config.padding[1].length + " array.")); + } + widthPadding = config.padding[1]; + } + _this.padding = [heightPadding, widthPadding]; + } + _this.inputSpec = [new topology_1.InputSpec({ ndim: 4 })]; + return _this; + } + ZeroPadding2D.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var rows; + var cols; + if (this.dataFormat === 'channelsFirst') { + if (inputShape[2] != null && inputShape[2] >= 0) { + rows = inputShape[2] + this.padding[0][0] + this.padding[0][1]; + } + else { + rows = null; + } + if (inputShape[3] != null && inputShape[3] >= 0) { + cols = inputShape[3] + this.padding[1][0] + this.padding[1][1]; + } + else { + cols = null; + } + return [inputShape[0], inputShape[1], rows, cols]; + } + else { + if (inputShape[1] != null && inputShape[1] >= 0) { + rows = inputShape[1] + this.padding[0][0] + this.padding[0][1]; + } + else { + rows = null; + } + if (inputShape[2] != null && inputShape[2] >= 0) { + cols = inputShape[2] + this.padding[1][0] + this.padding[1][1]; + } + else { + cols = null; + } + return [inputShape[0], rows, cols, inputShape[3]]; + } + }; + ZeroPadding2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { return spatial2dPadding(types_utils_1.getExactlyOneTensor(inputs), _this.padding, _this.dataFormat); }); + }; + ZeroPadding2D.prototype.getConfig = function () { + var config = { + padding: this.padding, + dataFormat: this.dataFormat, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + ZeroPadding2D.className = 'ZeroPadding2D'; + return ZeroPadding2D; +}(topology_1.Layer)); +exports.ZeroPadding2D = ZeroPadding2D; +tfjs_core_1.serialization.SerializationMap.register(ZeroPadding2D); +//# sourceMappingURL=padding.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js.map new file mode 100644 index 0000000..d278899 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/padding.js.map @@ -0,0 +1 @@ +{"version":3,"file":"padding.js","sourceRoot":"","sources":["../../src/layers/padding.ts"],"names":[],"mappings":";;;;;;;;;;;;AAkBA,2CAA6C;AAC7C,mDAAkE;AAElE,4CAAkD;AAElD,+CAAiE;AACjE,oCAAqC;AAErC,oDAA6E;AAY7E,yBAAgC,CAAS,EAAE,OAA0B;IACnE,OAAO,gBAAI,CAAC;QACV,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE;YAChB,MAAM,IAAI,mBAAU,CAChB,iEAAiE;iBAC9D,CAAC,CAAC,IAAI,eAAY,CAAA,CAAC,CAAC;SAC5B;QAED,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAClB;QACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;Y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a/node_modules/@tensorflow/tfjs-layers/dist/layers/padding_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/padding_test.js.map new file mode 100644 index 0000000..e77e70f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/padding_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"padding_test.js","sourceRoot":"","sources":["../../src/layers/padding_test.ts"],"names":[],"mappings":";;AAeA,2CAA6C;AAC7C,mDAAuD;AAGvD,+CAAkD;AAClD,8BAAgC;AAChC,oEAAsF;AACtF,kDAA+F;AAE/F,qCAAqG;AAIrG,kCAAqB,CAAC,iBAAiB,EAAE;IACvC,EAAE,CAAC,qBAAqB,EAAE;QACxB,IAAM,CAAC,GAAG,oBAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,IAAM,CAAC,GAAG,yBAAe,CAAC,CAAC,CAAC,CAAC;QAC7B,+BAAkB,CAAC,CAAC,EAAE,oBAAQ,CAAC;YACV,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACrC,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,oBAAoB,EAAE;QACvB,IAAM,CAAC,GAAG,oBAAQ,CAAC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CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.d.ts new file mode 100644 index 0000000..ede7914 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.d.ts @@ -0,0 +1,90 @@ +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { DataFormat, PaddingMode, PoolMode } from '../common'; +import { Layer, LayerConfig } from '../engine/topology'; +import { Kwargs, Shape } from '../types'; +export declare function pool2d(x: Tensor, poolSize: [number, number], strides?: [number, number], padding?: PaddingMode, dataFormat?: DataFormat, poolMode?: PoolMode): Tensor; +export interface Pooling1DLayerConfig extends LayerConfig { + poolSize?: number; + strides?: number; + padding?: PaddingMode; +} +export declare abstract class Pooling1D extends Layer { + protected readonly poolSize: [number]; + protected readonly strides: [number]; + protected readonly padding: PaddingMode; + constructor(config: Pooling1DLayerConfig); + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + protected abstract poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export declare class MaxPooling1D extends Pooling1D { + static className: string; + constructor(config: Pooling1DLayerConfig); + protected poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; +} +export declare class AveragePooling1D extends Pooling1D { + static className: string; + constructor(config: Pooling1DLayerConfig); + protected poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; +} +export interface Pooling2DLayerConfig extends LayerConfig { + poolSize?: number | [number, number]; + strides?: number | [number, number]; + padding?: PaddingMode; + dataFormat?: DataFormat; +} +export declare abstract class Pooling2D extends Layer { + protected readonly poolSize: [number, number]; + protected readonly strides: [number, number]; + protected readonly padding: PaddingMode; + protected readonly dataFormat: DataFormat; + constructor(config: Pooling2DLayerConfig); + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + protected abstract poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export declare class MaxPooling2D extends Pooling2D { + static className: string; + constructor(config: Pooling2DLayerConfig); + protected poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; +} +export declare class AveragePooling2D extends Pooling2D { + static className: string; + constructor(config: Pooling2DLayerConfig); + protected poolingFunction(inputs: Tensor, poolSize: [number, number], strides: [number, number], padding: PaddingMode, dataFormat: DataFormat): Tensor; +} +export declare abstract class GlobalPooling1D extends Layer { + constructor(config: LayerConfig); + computeOutputShape(inputShape: Shape): Shape; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; +} +export declare class GlobalAveragePooling1D extends GlobalPooling1D { + static className: string; + constructor(config: LayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; +} +export declare class GlobalMaxPooling1D extends GlobalPooling1D { + static className: string; + constructor(config: LayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; +} +export interface GlobalPooling2DLayerConfig extends LayerConfig { + dataFormat?: DataFormat; +} +export declare abstract class GlobalPooling2D extends Layer { + protected dataFormat: DataFormat; + constructor(config: GlobalPooling2DLayerConfig); + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export declare class GlobalAveragePooling2D extends GlobalPooling2D { + static className: string; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; +} +export declare class GlobalMaxPooling2D extends GlobalPooling2D { + static className: string; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js new file mode 100644 index 0000000..dda6337 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js @@ -0,0 +1,380 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var common_1 = require("../backend/common"); +var K = require("../backend/tfjs_backend"); +var common_2 = require("../common"); +var topology_1 = require("../engine/topology"); +var topology_2 = require("../engine/topology"); +var errors_1 = require("../errors"); +var conv_utils_1 = require("../utils/conv_utils"); +var types_utils_1 = require("../utils/types_utils"); +var convolutional_1 = require("./convolutional"); +function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { + return tfjs_core_1.tidy(function () { + common_2.checkDataFormat(dataFormat); + common_2.checkPoolMode(poolMode); + common_2.checkPaddingMode(padding); + if (strides == null) { + strides = [1, 1]; + } + if (padding == null) { + padding = 'valid'; + } + if (dataFormat == null) { + dataFormat = common_1.imageDataFormat(); + } + if (poolMode == null) { + poolMode = 'max'; + } + x = convolutional_1.preprocessConv2DInput(x, dataFormat); + var y; + var paddingString = (padding === 'same') ? 'same' : 'valid'; + if (poolMode === 'max') { + y = tfc.maxPool(x, poolSize, strides, paddingString); + } + else { + y = tfc.avgPool(x, poolSize, strides, paddingString); + } + if (dataFormat === 'channelsFirst') { + y = tfc.transpose(y, [0, 3, 1, 2]); + } + return y; + }); +} +exports.pool2d = pool2d; +var Pooling1D = (function (_super) { + __extends(Pooling1D, _super); + function Pooling1D(config) { + var _this = this; + if (config.poolSize == null) { + config.poolSize = 2; + } + _this = _super.call(this, config) || this; + if (typeof config.poolSize === 'number') { + _this.poolSize = [config.poolSize]; + } + else if (Array.isArray(config.poolSize) && + config.poolSize.length === 1 && + typeof config.poolSize[0] === 'number') { + _this.poolSize = config.poolSize; + } + else { + throw new errors_1.ValueError("poolSize for 1D convolutional layer must be a number or an " + + "Array of a single number, but received " + + ("" + JSON.stringify(config.poolSize))); + } + if (config.strides == null) { + _this.strides = _this.poolSize; + } + else { + if (typeof config.strides === 'number') { + _this.strides = [config.strides]; + } + else if (Array.isArray(config.strides) && + config.strides.length === 1 && + typeof config.strides[0] === 'number') { + _this.strides = config.strides; + } + else { + throw new errors_1.ValueError("strides for 1D convolutional layer must be a number or an " + + "Array of a single number, but received " + + ("" + JSON.stringify(config.strides))); + } + } + _this.padding = config.padding == null ? 'valid' : config.padding; + common_2.checkPaddingMode(_this.padding); + _this.inputSpec = [new topology_1.InputSpec({ ndim: 3 })]; + return _this; + } + Pooling1D.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var length = conv_utils_1.convOutputLength(inputShape[1], this.poolSize[0], this.padding, this.strides[0]); + return [inputShape[0], length, inputShape[2]]; + }; + Pooling1D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + inputs = K.expandDims(types_utils_1.getExactlyOneTensor(inputs), 2); + var output = _this.poolingFunction(types_utils_1.getExactlyOneTensor(inputs), [_this.poolSize[0], 1], [_this.strides[0], 1], _this.padding, 'channelsLast'); + return tfc.squeeze(output, [2]); + }); + }; + Pooling1D.prototype.getConfig = function () { + var config = { + poolSize: this.poolSize, + padding: this.padding, + strides: this.strides, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + return Pooling1D; +}(topology_2.Layer)); +exports.Pooling1D = Pooling1D; +var MaxPooling1D = (function (_super) { + __extends(MaxPooling1D, _super); + function MaxPooling1D(config) { + return _super.call(this, config) || this; + } + MaxPooling1D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { + common_2.checkDataFormat(dataFormat); + common_2.checkPaddingMode(padding); + return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); + }; + MaxPooling1D.className = 'MaxPooling1D'; + return MaxPooling1D; +}(Pooling1D)); +exports.MaxPooling1D = MaxPooling1D; +tfjs_core_1.serialization.SerializationMap.register(MaxPooling1D); +var AveragePooling1D = (function (_super) { + __extends(AveragePooling1D, _super); + function AveragePooling1D(config) { + return _super.call(this, config) || this; + } + AveragePooling1D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { + common_2.checkDataFormat(dataFormat); + common_2.checkPaddingMode(padding); + return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); + }; + AveragePooling1D.className = 'AveragePooling1D'; + return AveragePooling1D; +}(Pooling1D)); +exports.AveragePooling1D = AveragePooling1D; +tfjs_core_1.serialization.SerializationMap.register(AveragePooling1D); +var Pooling2D = (function (_super) { + __extends(Pooling2D, _super); + function Pooling2D(config) { + var _this = this; + if (config.poolSize == null) { + config.poolSize = [2, 2]; + } + _this = _super.call(this, config) || this; + _this.poolSize = Array.isArray(config.poolSize) ? + config.poolSize : + [config.poolSize, config.poolSize]; + if (config.strides == null) { + _this.strides = _this.poolSize; + } + else if (Array.isArray(config.strides)) { + if (config.strides.length !== 2) { + throw new errors_1.ValueError("If the strides property of a 2D pooling layer is an Array, " + + "it is expected to have a length of 2, but received length " + + (config.strides.length + ".")); + } + _this.strides = config.strides; + } + else { + _this.strides = [config.strides, config.strides]; + } + _this.padding = config.padding == null ? 'valid' : config.padding; + _this.dataFormat = + config.dataFormat == null ? 'channelsLast' : config.dataFormat; + common_2.checkDataFormat(_this.dataFormat); + common_2.checkPaddingMode(_this.padding); + _this.inputSpec = [new topology_1.InputSpec({ ndim: 4 })]; + return _this; + } + Pooling2D.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; + var cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; + rows = + conv_utils_1.convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]); + cols = + conv_utils_1.convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]); + if (this.dataFormat === 'channelsFirst') { + return [inputShape[0], inputShape[1], rows, cols]; + } + else { + return [inputShape[0], rows, cols, inputShape[3]]; + } + }; + Pooling2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + return _this.poolingFunction(types_utils_1.getExactlyOneTensor(inputs), _this.poolSize, _this.strides, _this.padding, _this.dataFormat); + }); + }; + Pooling2D.prototype.getConfig = function () { + var config = { + poolSize: this.poolSize, + padding: this.padding, + strides: this.strides, + dataFormat: this.dataFormat + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + return Pooling2D; +}(topology_2.Layer)); +exports.Pooling2D = Pooling2D; +var MaxPooling2D = (function (_super) { + __extends(MaxPooling2D, _super); + function MaxPooling2D(config) { + return _super.call(this, config) || this; + } + MaxPooling2D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { + common_2.checkDataFormat(dataFormat); + common_2.checkPaddingMode(padding); + return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); + }; + MaxPooling2D.className = 'MaxPooling2D'; + return MaxPooling2D; +}(Pooling2D)); +exports.MaxPooling2D = MaxPooling2D; +tfjs_core_1.serialization.SerializationMap.register(MaxPooling2D); +var AveragePooling2D = (function (_super) { + __extends(AveragePooling2D, _super); + function AveragePooling2D(config) { + return _super.call(this, config) || this; + } + AveragePooling2D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { + common_2.checkDataFormat(dataFormat); + common_2.checkPaddingMode(padding); + return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); + }; + AveragePooling2D.className = 'AveragePooling2D'; + return AveragePooling2D; +}(Pooling2D)); +exports.AveragePooling2D = AveragePooling2D; +tfjs_core_1.serialization.SerializationMap.register(AveragePooling2D); +var GlobalPooling1D = (function (_super) { + __extends(GlobalPooling1D, _super); + function GlobalPooling1D(config) { + var _this = _super.call(this, config) || this; + _this.inputSpec = [new topology_1.InputSpec({ ndim: 3 })]; + return _this; + } + GlobalPooling1D.prototype.computeOutputShape = function (inputShape) { + return [inputShape[0], inputShape[2]]; + }; + GlobalPooling1D.prototype.call = function (inputs, kwargs) { + throw new errors_1.NotImplementedError(); + }; + return GlobalPooling1D; +}(topology_2.Layer)); +exports.GlobalPooling1D = GlobalPooling1D; +var GlobalAveragePooling1D = (function (_super) { + __extends(GlobalAveragePooling1D, _super); + function GlobalAveragePooling1D(config) { + return _super.call(this, config) || this; + } + GlobalAveragePooling1D.prototype.call = function (inputs, kwargs) { + return tfjs_core_1.tidy(function () { + var input = types_utils_1.getExactlyOneTensor(inputs); + return tfc.mean(input, 1); + }); + }; + GlobalAveragePooling1D.className = 'GlobalAveragePooling1D'; + return GlobalAveragePooling1D; +}(GlobalPooling1D)); +exports.GlobalAveragePooling1D = GlobalAveragePooling1D; +tfjs_core_1.serialization.SerializationMap.register(GlobalAveragePooling1D); +var GlobalMaxPooling1D = (function (_super) { + __extends(GlobalMaxPooling1D, _super); + function GlobalMaxPooling1D(config) { + return _super.call(this, config) || this; + } + GlobalMaxPooling1D.prototype.call = function (inputs, kwargs) { + return tfjs_core_1.tidy(function () { + var input = types_utils_1.getExactlyOneTensor(inputs); + return tfc.max(input, 1); + }); + }; + GlobalMaxPooling1D.className = 'GlobalMaxPooling1D'; + return GlobalMaxPooling1D; +}(GlobalPooling1D)); +exports.GlobalMaxPooling1D = GlobalMaxPooling1D; +tfjs_core_1.serialization.SerializationMap.register(GlobalMaxPooling1D); +var GlobalPooling2D = (function (_super) { + __extends(GlobalPooling2D, _super); + function GlobalPooling2D(config) { + var _this = _super.call(this, config) || this; + _this.dataFormat = + config.dataFormat == null ? 'channelsLast' : config.dataFormat; + common_2.checkDataFormat(_this.dataFormat); + _this.inputSpec = [new topology_1.InputSpec({ ndim: 4 })]; + return _this; + } + GlobalPooling2D.prototype.computeOutputShape = function (inputShape) { + inputShape = inputShape; + if (this.dataFormat === 'channelsLast') { + return [inputShape[0], inputShape[3]]; + } + else { + return [inputShape[0], inputShape[1]]; + } + }; + GlobalPooling2D.prototype.call = function (inputs, kwargs) { + throw new errors_1.NotImplementedError(); + }; + GlobalPooling2D.prototype.getConfig = function () { + var config = { dataFormat: this.dataFormat }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + return GlobalPooling2D; +}(topology_2.Layer)); +exports.GlobalPooling2D = GlobalPooling2D; +var GlobalAveragePooling2D = (function (_super) { + __extends(GlobalAveragePooling2D, _super); + function GlobalAveragePooling2D() { + return _super !== null && _super.apply(this, arguments) || this; + } + GlobalAveragePooling2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + var input = types_utils_1.getExactlyOneTensor(inputs); + if (_this.dataFormat === 'channelsLast') { + return tfc.mean(input, [1, 2]); + } + else { + return tfc.mean(input, [2, 3]); + } + }); + }; + GlobalAveragePooling2D.className = 'GlobalAveragePooling2D'; + return GlobalAveragePooling2D; +}(GlobalPooling2D)); +exports.GlobalAveragePooling2D = GlobalAveragePooling2D; +tfjs_core_1.serialization.SerializationMap.register(GlobalAveragePooling2D); +var GlobalMaxPooling2D = (function (_super) { + __extends(GlobalMaxPooling2D, _super); + function GlobalMaxPooling2D() { + return _super !== null && _super.apply(this, arguments) || this; + } + GlobalMaxPooling2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + var input = types_utils_1.getExactlyOneTensor(inputs); + if (_this.dataFormat === 'channelsLast') { + return tfc.max(input, [1, 2]); + } + else { + return tfc.max(input, [2, 3]); + } + }); + }; + GlobalMaxPooling2D.className = 'GlobalMaxPooling2D'; + return GlobalMaxPooling2D; +}(GlobalPooling2D)); +exports.GlobalMaxPooling2D = GlobalMaxPooling2D; +tfjs_core_1.serialization.SerializationMap.register(GlobalMaxPooling2D); +//# sourceMappingURL=pooling.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js.map new file mode 100644 index 0000000..7f4df15 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pooling.js","sourceRoot":"","sources":["../../src/layers/pooling.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,2CAA6C;AAC7C,mDAAsF;AAEtF,4CAAkD;AAClD,2CAA6C;AAC7C,oCAA8G;AAC9G,+CAA6C;AAC7C,+CAAsD;AACtD,oCAA0D;AAE1D,kDAAqD;AACrD,oDAA6E;AAE7E,iDAAsD;AActD,gBACI,CAAS,EAAE,QAA0B,EAAE,OAA0B,EACjE,OAAqB,EAAE,UAAuB,EAC9C,QAAmB;IACrB,OAAO,gBAAI,CAAC;QACV,wBAAe,CAAC,UAAU,CAAC,CAAC;QAC5B,sBAAa,CAAC,QAAQ,CAAC,CAAC;QACxB,yBAAgB,CAAC,OAAO,CAAC,CAAC;QAC1B,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAClB;QACD,IAAI,OAAO,IAAI,I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AAvD;;IAaA,CAAC;IAVC,iCAAI,GAAJ,UAAK,MAAuB,EAAE,MAAc;QAA5C,iBASC;QARC,OAAO,gBAAI,CAAC;YACV,IAAM,KAAK,GAAG,iCAAmB,CAAC,MAAM,CAAC,CAAC;YAC1C,IAAI,KAAI,CAAC,UAAU,KAAK,cAAc,EAAE;gBACtC,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aAC/B;iBAAM;gBACL,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aAC/B;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAXM,4BAAS,GAAG,oBAAoB,CAAC;IAY1C,yBAAC;CAAA,AAbD,CAAwC,eAAe,GAatD;AAbY,gDAAkB;AAc/B,yBAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling_test.js.map new file mode 100644 index 0000000..79a19e5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/pooling_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pooling_test.js","sourceRoot":"","sources":["../../src/layers/pooling_test.ts"],"names":[],"mappings":";;AAeA,2CAA6C;AAC7C,mDAAqG;AAGrG,+CAAkD;AAClD,8BAAgC;AAChC,kDAAqD;AACrD,kDAA8E;AAE9E,qCAAiC;AAGjC,kCAAqB,CAAC,QAAQ,EAAE;IAC9B,IAAM,SAAS,GAAG,CAAC,CAAC;gBAClB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CA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cAAc,GAAG,oBAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;qBACvD;yBAAM;wBACL,cAAc,GAAG,oBAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;qBACzD;iBACF;gBACD,+BAAkB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;gBAC3C,IAAM,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;gBACjC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;QACL,CAAC;QA1BD,KAAyB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;YAA/B,IAAM,UAAU,oBAAA;qBAAV,UAAU;SA0BpB;IACH,CAAC;IA5BD,KAAiC,UAAmB,EAAnB,2CAAmB,EAAnB,iCAAmB,EAAnB,IAAmB;QAA/C,IAAM,kBAAkB,4BAAA;iBAAlB,kBAAkB;KA4B5B;AACH,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.d.ts new file mode 100644 index 0000000..8818eee --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.d.ts @@ -0,0 +1,286 @@ +import * as tfc from '@tensorflow/tfjs-core'; +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Activation, ActivationIdentifier } from '../activations'; +import { Constraint, ConstraintIdentifier } from '../constraints'; +import { InputSpec, SymbolicTensor } from '../engine/topology'; +import { Layer, LayerConfig } from '../engine/topology'; +import { Initializer, InitializerIdentifier } from '../initializers'; +import { Regularizer, RegularizerIdentifier } from '../regularizers'; +import { Kwargs, RnnStepFunction, Shape } from '../types'; +import { LayerVariable } from '../variables'; +export declare function standardizeArgs(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], initialState: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], constants: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], numConstants?: number): { + inputs: Tensor | SymbolicTensor; + initialState: Tensor[] | SymbolicTensor[]; + constants: Tensor[] | SymbolicTensor[]; +}; +export declare function rnn(stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[], goBackwards?: boolean, mask?: Tensor, constants?: Tensor[], unroll?: boolean, inputLength?: number): [Tensor, Tensor, Tensor[]]; +export interface BaseRNNLayerConfig extends LayerConfig { + cell?: RNNCell | RNNCell[]; + returnSequences?: boolean; + returnState?: boolean; + goBackwards?: boolean; + stateful?: boolean; + unroll?: boolean; + inputDim?: number; + inputLength?: number; +} +export interface RNNLayerConfig extends BaseRNNLayerConfig { + cell: RNNCell | RNNCell[]; +} +export declare class RNN extends Layer { + static className: string; + readonly cell: RNNCell; + readonly returnSequences: boolean; + readonly returnState: boolean; + readonly goBackwards: boolean; + readonly unroll: boolean; + stateSpec: InputSpec[]; + states: Tensor[]; + private numConstants; + constructor(config: RNNLayerConfig); + getStates(): Tensor[]; + setStates(states: Tensor[]): void; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + computeMask(inputs: Tensor | Tensor[], mask?: Tensor | Tensor[]): Tensor; + build(inputShape: Shape | Shape[]): void; + resetStates(states?: Tensor | Tensor[]): void; + apply(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], kwargs?: Kwargs): Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[]; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getInitialState(inputs: Tensor): Tensor[]; + readonly trainableWeights: LayerVariable[]; + readonly nonTrainableWeights: LayerVariable[]; + getConfig(): serialization.ConfigDict; +} +export declare abstract class RNNCell extends Layer { + stateSize: number | number[]; + dropoutMask: Tensor | Tensor[]; + recurrentDropoutMask: Tensor | Tensor[]; +} +export interface SimpleRNNCellLayerConfig extends LayerConfig { + units: number; + activation?: ActivationIdentifier; + useBias?: boolean; + kernelInitializer?: InitializerIdentifier | Initializer; + recurrentInitializer?: InitializerIdentifier | Initializer; + biasInitializer?: InitializerIdentifier | Initializer; + kernelRegularizer?: RegularizerIdentifier | Regularizer; + recurrentRegularizer?: RegularizerIdentifier | Regularizer; + biasRegularizer?: RegularizerIdentifier | Regularizer; + kernelConstraint?: ConstraintIdentifier | Constraint; + recurrentConstraint?: ConstraintIdentifier | Constraint; + biasConstraint?: ConstraintIdentifier | Constraint; + dropout?: number; + recurrentDropout?: number; +} +export declare class SimpleRNNCell extends RNNCell { + static className: string; + readonly units: number; + readonly activation: Activation; + readonly useBias: boolean; + readonly kernelInitializer: Initializer; + readonly recurrentInitializer: Initializer; + readonly biasInitializer: Initializer; + readonly kernelConstraint: Constraint; + readonly recurrentConstraint: Constraint; + readonly biasConstraint: Constraint; + readonly kernelRegularizer: Regularizer; + readonly recurrentRegularizer: Regularizer; + readonly biasRegularizer: Regularizer; + readonly dropout: number; + readonly recurrentDropout: number; + readonly stateSize: number; + kernel: LayerVariable; + recurrentKernel: LayerVariable; + bias: LayerVariable; + readonly DEFAULT_ACTIVATION: string; + readonly DEFAULT_KERNEL_INITIALIZER: string; + readonly DEFAULT_RECURRENT_INITIALIZER: string; + readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier; + constructor(config: SimpleRNNCellLayerConfig); + build(inputShape: Shape | Shape[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export interface SimpleRNNLayerConfig extends BaseRNNLayerConfig { + units: number; + activation?: ActivationIdentifier; + useBias?: boolean; + kernelInitializer?: InitializerIdentifier | Initializer; + recurrentInitializer?: InitializerIdentifier | Initializer; + biasInitializer?: InitializerIdentifier | Initializer; + kernelRegularizer?: RegularizerIdentifier | Regularizer; + recurrentRegularizer?: RegularizerIdentifier | Regularizer; + biasRegularizer?: RegularizerIdentifier | Regularizer; + kernelConstraint?: ConstraintIdentifier | Constraint; + recurrentConstraint?: ConstraintIdentifier | Constraint; + biasConstraint?: ConstraintIdentifier | Constraint; + dropout?: number; + recurrentDropout?: number; +} +export declare class SimpleRNN extends RNN { + static className: string; + constructor(config: SimpleRNNLayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + readonly units: number; + readonly activation: Activation; + readonly useBias: boolean; + readonly kernelInitializer: Initializer; + readonly recurrentInitializer: Initializer; + readonly biasInitializer: Initializer; + readonly kernelRegularizer: Regularizer; + readonly recurrentRegularizer: Regularizer; + readonly biasRegularizer: Regularizer; + readonly kernelConstraint: Constraint; + readonly recurrentConstraint: Constraint; + readonly biasConstraint: Constraint; + readonly dropout: number; + readonly recurrentDropout: number; + getConfig(): serialization.ConfigDict; +} +export interface GRUCellLayerConfig extends SimpleRNNCellLayerConfig { + recurrentActivation?: string; + implementation?: number; +} +export declare class GRUCell extends RNNCell { + static className: string; + readonly units: number; + readonly activation: Activation; + readonly recurrentActivation: Activation; + readonly useBias: boolean; + readonly kernelInitializer: Initializer; + readonly recurrentInitializer: Initializer; + readonly biasInitializer: Initializer; + readonly kernelRegularizer: Regularizer; + readonly recurrentRegularizer: Regularizer; + readonly biasRegularizer: Regularizer; + readonly kernelConstraint: Constraint; + readonly recurrentConstraint: Constraint; + readonly biasConstraint: Constraint; + readonly dropout: number; + readonly recurrentDropout: number; + readonly stateSize: number; + readonly implementation: number; + readonly DEFAULT_ACTIVATION: string; + readonly DEFAULT_RECURRENT_ACTIVATION: string; + readonly DEFAULT_KERNEL_INITIALIZER: string; + readonly DEFAULT_RECURRENT_INITIALIZER: string; + readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier; + kernel: LayerVariable; + recurrentKernel: LayerVariable; + bias: LayerVariable; + constructor(config: GRUCellLayerConfig); + build(inputShape: Shape | Shape[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export interface GRULayerConfig extends SimpleRNNLayerConfig { + recurrentActivation?: string; + implementation?: number; +} +export declare class GRU extends RNN { + static className: string; + constructor(config: GRULayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + readonly units: number; + readonly activation: Activation; + readonly recurrentActivation: Activation; + readonly useBias: boolean; + readonly kernelInitializer: Initializer; + readonly recurrentInitializer: Initializer; + readonly biasInitializer: Initializer; + readonly kernelRegularizer: Regularizer; + readonly recurrentRegularizer: Regularizer; + readonly biasRegularizer: Regularizer; + readonly kernelConstraint: Constraint; + readonly recurrentConstraint: Constraint; + readonly biasConstraint: Constraint; + readonly dropout: number; + readonly recurrentDropout: number; + readonly implementation: number; + getConfig(): serialization.ConfigDict; + static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; +} +export interface LSTMCellLayerConfig extends SimpleRNNCellLayerConfig { + recurrentActivation?: ActivationIdentifier; + unitForgetBias?: boolean; + implementation?: 1 | 2; +} +export declare class LSTMCell extends RNNCell { + static className: string; + readonly units: number; + readonly activation: Activation; + readonly recurrentActivation: Activation; + readonly useBias: boolean; + readonly kernelInitializer: Initializer; + readonly recurrentInitializer: Initializer; + readonly biasInitializer: Initializer; + readonly unitForgetBias: boolean; + readonly kernelConstraint: Constraint; + readonly recurrentConstraint: Constraint; + readonly biasConstraint: Constraint; + readonly kernelRegularizer: Regularizer; + readonly recurrentRegularizer: Regularizer; + readonly biasRegularizer: Regularizer; + readonly dropout: number; + readonly recurrentDropout: number; + readonly stateSize: number[]; + readonly implementation: number; + readonly DEFAULT_ACTIVATION: string; + readonly DEFAULT_RECURRENT_ACTIVATION: string; + readonly DEFAULT_KERNEL_INITIALIZER: string; + readonly DEFAULT_RECURRENT_INITIALIZER: string; + readonly DEFAULT_BIAS_INITIALIZER: string; + kernel: LayerVariable; + recurrentKernel: LayerVariable; + bias: LayerVariable; + constructor(config: LSTMCellLayerConfig); + build(inputShape: Shape | Shape[]): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + getConfig(): serialization.ConfigDict; +} +export interface LSTMLayerConfig extends SimpleRNNLayerConfig { + recurrentActivation?: string; + unitForgetBias?: boolean; + implementation?: 1 | 2; +} +export declare class LSTM extends RNN { + static className: string; + constructor(config: LSTMLayerConfig); + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + readonly units: number; + readonly activation: Activation; + readonly recurrentActivation: Activation; + readonly useBias: boolean; + readonly kernelInitializer: Initializer; + readonly recurrentInitializer: Initializer; + readonly biasInitializer: Initializer; + readonly unitForgetBias: boolean; + readonly kernelRegularizer: Regularizer; + readonly recurrentRegularizer: Regularizer; + readonly biasRegularizer: Regularizer; + readonly kernelConstraint: Constraint; + readonly recurrentConstraint: Constraint; + readonly biasConstraint: Constraint; + readonly dropout: number; + readonly recurrentDropout: number; + readonly implementation: number; + getConfig(): serialization.ConfigDict; + static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; +} +export interface StackedRNNCellsConfig extends LayerConfig { + cells: RNNCell[]; +} +export declare class StackedRNNCells extends RNNCell { + static className: string; + protected cells: RNNCell[]; + constructor(config: StackedRNNCellsConfig); + readonly stateSize: number[]; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + build(inputShape: Shape | Shape[]): void; + getConfig(): serialization.ConfigDict; + static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict, customObjects?: tfc.serialization.ConfigDict): T; + readonly trainableWeights: LayerVariable[]; + readonly nonTrainableWeights: LayerVariable[]; + getWeights(): Tensor[]; + setWeights(weights: Tensor[]): void; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js new file mode 100644 index 0000000..f0c6246 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js @@ -0,0 +1,1628 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var activations_1 = require("../activations"); +var state_1 = require("../backend/state"); +var K = require("../backend/tfjs_backend"); +var constraints_1 = require("../constraints"); +var topology_1 = require("../engine/topology"); +var topology_2 = require("../engine/topology"); +var errors_1 = require("../errors"); +var initializers_1 = require("../initializers"); +var regularizers_1 = require("../regularizers"); +var math_utils = require("../utils/math_utils"); +var types_utils_1 = require("../utils/types_utils"); +var variables_1 = require("../variables"); +var serialization_1 = require("./serialization"); +function standardizeArgs(inputs, initialState, constants, numConstants) { + if (Array.isArray(inputs)) { + if (initialState != null || constants != null) { + throw new errors_1.ValueError('When inputs is an array, neither initialState or constants ' + + 'should be provided'); + } + if (numConstants != null) { + constants = inputs.slice(inputs.length - numConstants, inputs.length); + inputs = inputs.slice(0, inputs.length - numConstants); + } + if (inputs.length > 1) { + initialState = inputs.slice(1, inputs.length); + } + inputs = inputs[0]; + } + function toListOrNull(x) { + if (x == null || Array.isArray(x)) { + return x; + } + else { + return [x]; + } + } + initialState = toListOrNull(initialState); + constants = toListOrNull(constants); + return { inputs: inputs, initialState: initialState, constants: constants }; +} +exports.standardizeArgs = standardizeArgs; +function rnn(stepFunction, inputs, initialStates, goBackwards, mask, constants, unroll, inputLength) { + if (goBackwards === void 0) { goBackwards = false; } + if (unroll === void 0) { unroll = false; } + var ndim = inputs.shape.length; + if (ndim < 3) { + throw new errors_1.ValueError("Input should be at least 3D, but is " + ndim + "D."); + } + var axes = [1, 0].concat(math_utils.range(2, ndim)); + inputs = tfc.transpose(inputs, axes); + if (mask != null) { + throw new errors_1.NotImplementedError('The rnn() function of the deeplearn.js backend does not support ' + + 'masking yet.'); + } + if (constants != null) { + throw new errors_1.NotImplementedError('The rnn() functoin of the deeplearn.js backend does not support ' + + 'constants yet.'); + } + if (unroll) { + console.warn('Backend rnn(): the unroll = true option is not applicable to the ' + + 'imperative deeplearn.js backend.'); + } + if (goBackwards) { + inputs = tfc.reverse(inputs, 0); + } + var outputs; + var lastOutput; + var states = initialStates; + var timeSteps = inputs.shape[0]; + for (var t = 0; t < timeSteps; ++t) { + var currentInput = K.sliceAlongFirstAxis(inputs, t, 1); + currentInput = currentInput.reshape(currentInput.shape.slice(1)); + var stepOutputs = stepFunction(currentInput, states); + lastOutput = stepOutputs[0]; + if (t === 0) { + outputs = lastOutput.reshape([1].concat(lastOutput.shape)); + } + else { + outputs = K.concatAlongFirstAxis(outputs, lastOutput.reshape([1].concat(lastOutput.shape))); + } + states = stepOutputs[1]; + } + return [ + lastOutput, + tfc.transpose(outputs, [1, 0].concat(math_utils.range(2, outputs.shape.length))), + states + ]; +} +exports.rnn = rnn; +var RNN = (function (_super) { + __extends(RNN, _super); + function RNN(config) { + var _this = _super.call(this, config) || this; + var cell; + if (config.cell == null) { + throw new errors_1.ValueError('cell property is missing for the constructor of RNN.'); + } + else if (Array.isArray(config.cell)) { + cell = new StackedRNNCells({ cells: config.cell }); + } + else { + cell = config.cell; + } + if (cell.stateSize == null) { + throw new errors_1.ValueError('The RNN cell should have an attribute `stateSize` (tuple of ' + + 'integers, one integer per RNN state).'); + } + _this.cell = cell; + _this.returnSequences = + config.returnSequences == null ? false : config.returnSequences; + _this.returnState = config.returnState == null ? false : config.returnState; + _this.goBackwards = config.goBackwards == null ? false : config.goBackwards; + _this._stateful = config.stateful == null ? false : config.stateful; + _this.unroll = config.unroll == null ? false : config.unroll; + _this.supportsMasking = true; + _this.inputSpec = [new topology_1.InputSpec({ ndim: 3 })]; + _this.stateSpec = null; + _this.states = null; + _this.numConstants = null; + return _this; + } + RNN.prototype.getStates = function () { + if (this.states == null) { + var numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; + return math_utils.range(0, numStates).map(function (x) { return null; }); + } + else { + return this.states; + } + }; + RNN.prototype.setStates = function (states) { + this.states = states; + }; + RNN.prototype.computeOutputShape = function (inputShape) { + if (types_utils_1.isArrayOfShapes(inputShape)) { + inputShape = inputShape[0]; + } + inputShape = inputShape; + var stateSize = this.cell.stateSize; + if (!Array.isArray(stateSize)) { + stateSize = [stateSize]; + } + var outputDim = stateSize[0]; + var outputShape; + if (this.returnSequences) { + outputShape = [inputShape[0], inputShape[1], outputDim]; + } + else { + outputShape = [inputShape[0], outputDim]; + } + if (this.returnState) { + var stateShape = []; + for (var _i = 0, stateSize_1 = stateSize; _i < stateSize_1.length; _i++) { + var dim = stateSize_1[_i]; + stateShape.push([inputShape[0], dim]); + } + return [outputShape].concat(stateShape); + } + else { + return outputShape; + } + }; + RNN.prototype.computeMask = function (inputs, mask) { + throw new errors_1.NotImplementedError('computeMask has not been implemented for RNN yet'); + }; + RNN.prototype.build = function (inputShape) { + var constantShape = null; + if (this.numConstants != null) { + throw new errors_1.NotImplementedError('Constants support is not implemented in RNN yet.'); + } + if (types_utils_1.isArrayOfShapes(inputShape)) { + inputShape = inputShape[0]; + } + inputShape = inputShape; + var batchSize = this.stateful ? inputShape[0] : null; + var inputDim = inputShape[inputShape.length - 1]; + this.inputSpec[0] = new topology_1.InputSpec({ shape: [batchSize, null, inputDim] }); + var stepInputShape = [inputShape[0]].concat(inputShape.slice(2)); + if (constantShape != null) { + throw new errors_1.NotImplementedError('Constants support is not implemented in RNN yet.'); + } + else { + this.cell.build(stepInputShape); + } + var stateSize; + if (Array.isArray(this.cell.stateSize)) { + stateSize = this.cell.stateSize; + } + else { + stateSize = [this.cell.stateSize]; + } + if (this.stateSpec != null) { + if (!tfjs_core_1.util.arraysEqual(this.stateSpec.map(function (spec) { return spec.shape[spec.shape.length - 1]; }), stateSize)) { + throw new errors_1.ValueError("An initialState was passed that is not compatible with " + + ("cell.stateSize. Received stateSpec=" + this.stateSpec + "; ") + + ("However cell.stateSize is " + this.cell.stateSize)); + } + } + else { + this.stateSpec = + stateSize.map(function (dim) { return new topology_1.InputSpec({ shape: [null, dim] }); }); + } + if (this.stateful) { + throw new errors_1.NotImplementedError('stateful RNN layer is not implemented yet'); + } + }; + RNN.prototype.resetStates = function (states) { + var _this = this; + tfjs_core_1.tidy(function () { + if (!_this.stateful) { + throw new errors_1.AttributeError('Cannot call resetState() on an RNN Layer that is not stateful.'); + } + var batchSize = _this.inputSpec[0].shape[0]; + if (batchSize == null) { + throw new errors_1.ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + + 'the batch size of your input tensors: \n' + + '- If using a Sequential model, specify the batch size by ' + + 'passing a `batchInputShape` option to your first layer.\n' + + '- If using the functional API, specify the batch size by ' + + 'passing a `batchShape` option to your Input layer.'); + } + if (_this.states == null) { + if (Array.isArray(_this.cell.stateSize)) { + _this.states = + _this.cell.stateSize.map(function (dim) { return tfc.zeros([batchSize, dim]); }); + } + else { + _this.states = [tfc.zeros([batchSize, _this.cell.stateSize])]; + } + } + else if (states == null) { + if (Array.isArray(_this.cell.stateSize)) { + _this.states = + _this.cell.stateSize.map(function (dim) { return tfc.zeros([batchSize, dim]); }); + } + else { + _this.states[0] = tfc.zeros([batchSize, _this.cell.stateSize]); + } + } + else { + if (!Array.isArray(states)) { + states = [states]; + } + if (states.length !== _this.states.length) { + throw new errors_1.ValueError("Layer " + _this.name + " expects " + _this.states.length + " state(s), " + + ("but it received " + states.length + " state value(s). Input ") + + ("received: " + states)); + } + for (var index = 0; index < _this.states.length; ++index) { + var value = states[index]; + var dim = Array.isArray(_this.cell.stateSize) ? + _this.cell.stateSize[index] : + _this.cell.stateSize; + var expectedShape = [batchSize, dim]; + if (!tfjs_core_1.util.arraysEqual(value.shape, expectedShape)) { + throw new errors_1.ValueError("State " + index + " is incompatible with layer " + _this.name + ": " + + ("expected shape=" + expectedShape + ", received shape=" + value.shape)); + } + _this.states[index] = value; + } + } + }); + }; + RNN.prototype.apply = function (inputs, kwargs) { + var initialState = kwargs == null ? null : kwargs['initialState']; + var constants = kwargs == null ? null : kwargs['constants']; + if (kwargs == null) { + kwargs = {}; + } + var standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); + inputs = standardized.inputs; + initialState = standardized.initialState; + constants = standardized.constants; + var additionalInputs = []; + var additionalSpecs = []; + if (initialState != null) { + kwargs['initialState'] = initialState; + additionalInputs = additionalInputs.concat(initialState); + this.stateSpec = []; + for (var _i = 0, initialState_1 = initialState; _i < initialState_1.length; _i++) { + var state = initialState_1[_i]; + this.stateSpec.push(new topology_1.InputSpec({ shape: state.shape })); + } + additionalSpecs = additionalSpecs.concat(this.stateSpec); + } + if (constants != null) { + kwargs['constants'] = constants; + additionalInputs = additionalInputs.concat(constants); + this.numConstants = constants.length; + } + var isTensor = additionalInputs[0] instanceof topology_1.SymbolicTensor; + if (isTensor) { + var fullInput = [inputs].concat(additionalInputs); + var fullInputSpec = this.inputSpec.concat(additionalSpecs); + var originalInputSpec = this.inputSpec; + this.inputSpec = fullInputSpec; + var output = _super.prototype.apply.call(this, fullInput, kwargs); + this.inputSpec = originalInputSpec; + return output; + } + else { + return _super.prototype.apply.call(this, inputs, kwargs); + } + }; + RNN.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + var mask = kwargs == null ? null : kwargs['mask']; + var training = kwargs == null ? null : kwargs['training']; + var initialState = kwargs == null ? null : kwargs['initialState']; + inputs = types_utils_1.getExactlyOneTensor(inputs); + if (initialState == null) { + if (_this.stateful) { + throw new errors_1.NotImplementedError('stateful RNN layer is not implemented yet.'); + } + else { + initialState = _this.getInitialState(inputs); + } + } + if (mask != null) { + throw new errors_1.NotImplementedError('Masking is not implemented for RNN yet'); + } + var numStates = Array.isArray(_this.cell.stateSize) ? _this.cell.stateSize.length : 1; + if (initialState.length !== numStates) { + throw new errors_1.ValueError("RNN Layer has " + numStates + " state(s) but was passed " + + (initialState.length + " initial state(s).")); + } + var inputShape = inputs.shape; + var timesteps = inputShape[1]; + if (_this.unroll) { + console.warn('Ignoring unroll = true for RNN layer, due to imperative backend.'); + } + var cellCallKwargs = { training: training }; + var step = function (inputs, states) { + var outputs = _this.cell.call([inputs].concat(states), cellCallKwargs); + return [outputs[0], outputs.slice(1)]; + }; + var rnnOutputs = rnn(step, inputs, initialState, _this.goBackwards, null, null, _this.unroll, timesteps); + var lastOutput = rnnOutputs[0]; + var outputs = rnnOutputs[1]; + var states = rnnOutputs[2]; + if (_this.stateful) { + throw new errors_1.NotImplementedError('stateful RNN layer is not implemented yet'); + } + var output = _this.returnSequences ? outputs : lastOutput; + if (_this.returnState) { + return [output].concat(states); + } + else { + return output; + } + }); + }; + RNN.prototype.getInitialState = function (inputs) { + var _this = this; + return tfjs_core_1.tidy(function () { + var initialState = tfc.zeros(inputs.shape); + initialState = tfc.sum(initialState, [1, 2]); + initialState = K.expandDims(initialState); + if (Array.isArray(_this.cell.stateSize)) { + return _this.cell.stateSize.map(function (dim) { return dim > 1 ? K.tile(initialState, [1, dim]) : initialState; }); + } + else { + return _this.cell.stateSize > 1 ? + [K.tile(initialState, [1, _this.cell.stateSize])] : + [initialState]; + } + }); + }; + Object.defineProperty(RNN.prototype, "trainableWeights", { + get: function () { + if (!this.trainable) { + return []; + } + return this.cell.trainableWeights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RNN.prototype, "nonTrainableWeights", { + get: function () { + if (!this.trainable) { + return this.cell.weights; + } + return this.cell.nonTrainableWeights; + }, + enumerable: true, + configurable: true + }); + RNN.prototype.getConfig = function () { + var config = { + returnSequences: this.returnSequences, + returnState: this.returnState, + goBackwards: this.goBackwards, + stateful: this.stateful, + unroll: this.unroll, + }; + if (this.numConstants != null) { + config.numConstants = this.numConstants; + } + var cellConfig = this.cell.getConfig(); + config.cell = { + className: this.cell.getClassName(), + config: cellConfig, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + RNN.className = 'RNN'; + return RNN; +}(topology_2.Layer)); +exports.RNN = RNN; +tfjs_core_1.serialization.SerializationMap.register(RNN); +var RNNCell = (function (_super) { + __extends(RNNCell, _super); + function RNNCell() { + return _super !== null && _super.apply(this, arguments) || this; + } + return RNNCell; +}(topology_2.Layer)); +exports.RNNCell = RNNCell; +var SimpleRNNCell = (function (_super) { + __extends(SimpleRNNCell, _super); + function SimpleRNNCell(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_ACTIVATION = 'tanh'; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + _this.units = config.units; + _this.activation = activations_1.getActivation(config.activation == null ? _this.DEFAULT_ACTIVATION : + config.activation); + _this.useBias = config.useBias == null ? true : config.useBias; + _this.kernelInitializer = initializers_1.getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.recurrentInitializer = initializers_1.getInitializer(config.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); + _this.biasInitializer = + initializers_1.getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.kernelRegularizer = regularizers_1.getRegularizer(config.kernelRegularizer); + _this.recurrentRegularizer = regularizers_1.getRegularizer(config.recurrentRegularizer); + _this.biasRegularizer = regularizers_1.getRegularizer(config.biasRegularizer); + _this.kernelConstraint = constraints_1.getConstraint(config.kernelConstraint); + _this.recurrentConstraint = constraints_1.getConstraint(config.recurrentConstraint); + _this.biasConstraint = constraints_1.getConstraint(config.biasConstraint); + _this.dropout = math_utils.min([1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]); + _this.recurrentDropout = math_utils.min([ + 1, + math_utils.max([0, config.recurrentDropout == null ? 0 : config.recurrentDropout]) + ]); + _this.stateSize = _this.units; + _this.dropoutMask = null; + _this.recurrentDropoutMask = null; + return _this; + } + SimpleRNNCell.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + this.kernel = this.addWeight('kernel', [inputShape[inputShape.length - 1], this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + else { + this.bias = null; + } + this.built = true; + }; + SimpleRNNCell.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = inputs; + if (inputs.length !== 2) { + throw new errors_1.ValueError("SimpleRNNCell expects 2 input Tensors, got " + inputs.length + "."); + } + var prevOutput = inputs[1]; + inputs = inputs[0]; + var training = kwargs['training'] == null ? false : kwargs['training']; + if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { + _this.dropoutMask = generateDropoutMask(function () { return tfc.onesLike(inputs); }, _this.dropout, training); + } + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && + _this.recurrentDropoutMask == null) { + _this.recurrentDropoutMask = + generateDropoutMask(function () { return tfc.onesLike(prevOutput); }, _this.recurrentDropout, training); + } + var h; + var dpMask = _this.dropoutMask; + var recDpMask = _this.recurrentDropoutMask; + if (dpMask != null) { + h = K.dot(tfc.mul(inputs, dpMask), _this.kernel.read()); + } + else { + h = K.dot(inputs, _this.kernel.read()); + } + if (_this.bias != null) { + h = K.biasAdd(h, _this.bias.read()); + } + if (recDpMask != null) { + prevOutput = tfc.mul(prevOutput, recDpMask); + } + var output = tfc.add(h, K.dot(prevOutput, _this.recurrentKernel.read())); + if (_this.activation != null) { + output = _this.activation.apply(output); + } + return [output, output]; + }); + }; + SimpleRNNCell.prototype.getConfig = function () { + var config = { + units: this.units, + activation: activations_1.serializeActivation(this.activation), + useBias: this.useBias, + kernelInitializer: initializers_1.serializeInitializer(this.kernelInitializer), + recurrentInitializer: initializers_1.serializeInitializer(this.recurrentInitializer), + biasInitializer: initializers_1.serializeInitializer(this.biasInitializer), + kernelRegularizer: regularizers_1.serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: regularizers_1.serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: regularizers_1.serializeRegularizer(this.biasRegularizer), + activityRegularizer: regularizers_1.serializeRegularizer(this.activityRegularizer), + kernelConstraint: constraints_1.serializeConstraint(this.kernelConstraint), + recurrentConstraint: constraints_1.serializeConstraint(this.recurrentConstraint), + biasConstraint: constraints_1.serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + SimpleRNNCell.className = 'SimpleRNNCell'; + return SimpleRNNCell; +}(RNNCell)); +exports.SimpleRNNCell = SimpleRNNCell; +tfjs_core_1.serialization.SerializationMap.register(SimpleRNNCell); +var SimpleRNN = (function (_super) { + __extends(SimpleRNN, _super); + function SimpleRNN(config) { + var _this = this; + config.cell = new SimpleRNNCell(config); + _this = _super.call(this, config) || this; + return _this; + } + SimpleRNN.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + if (_this.cell.dropoutMask != null) { + tfc.dispose(_this.cell.dropoutMask); + _this.cell.dropoutMask = null; + } + if (_this.cell.recurrentDropoutMask != null) { + tfc.dispose(_this.cell.recurrentDropoutMask); + _this.cell.recurrentDropoutMask = null; + } + var mask = kwargs == null ? null : kwargs['mask']; + var training = kwargs == null ? null : kwargs['training']; + var initialState = kwargs == null ? null : kwargs['initialState']; + return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); + }); + }; + Object.defineProperty(SimpleRNN.prototype, "units", { + get: function () { + return this.cell.units; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "activation", { + get: function () { + return this.cell.activation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "useBias", { + get: function () { + return this.cell.useBias; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "kernelInitializer", { + get: function () { + return this.cell.kernelInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "recurrentInitializer", { + get: function () { + return this.cell.recurrentInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "biasInitializer", { + get: function () { + return this.cell.biasInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "kernelRegularizer", { + get: function () { + return this.cell.kernelRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "recurrentRegularizer", { + get: function () { + return this.cell.recurrentRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "biasRegularizer", { + get: function () { + return this.cell.biasRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "kernelConstraint", { + get: function () { + return this.cell.kernelConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "recurrentConstraint", { + get: function () { + return this.cell.recurrentConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "biasConstraint", { + get: function () { + return this.cell.biasConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "dropout", { + get: function () { + return this.cell.dropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "recurrentDropout", { + get: function () { + return this.cell.recurrentDropout; + }, + enumerable: true, + configurable: true + }); + SimpleRNN.prototype.getConfig = function () { + var config = { + units: this.units, + activation: activations_1.serializeActivation(this.activation), + useBias: this.useBias, + kernelInitializer: initializers_1.serializeInitializer(this.kernelInitializer), + recurrentInitializer: initializers_1.serializeInitializer(this.recurrentInitializer), + biasInitializer: initializers_1.serializeInitializer(this.biasInitializer), + kernelRegularizer: regularizers_1.serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: regularizers_1.serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: regularizers_1.serializeRegularizer(this.biasRegularizer), + activityRegularizer: regularizers_1.serializeRegularizer(this.activityRegularizer), + kernelConstraint: constraints_1.serializeConstraint(this.kernelConstraint), + recurrentConstraint: constraints_1.serializeConstraint(this.recurrentConstraint), + biasConstraint: constraints_1.serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + }; + var baseConfig = _super.prototype.getConfig.call(this); + delete baseConfig['cell']; + Object.assign(config, baseConfig); + return config; + }; + SimpleRNN.className = 'SimpleRNN'; + return SimpleRNN; +}(RNN)); +exports.SimpleRNN = SimpleRNN; +tfjs_core_1.serialization.SerializationMap.register(SimpleRNN); +var GRUCell = (function (_super) { + __extends(GRUCell, _super); + function GRUCell(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_ACTIVATION = 'tanh'; + _this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + _this.units = config.units; + _this.activation = activations_1.getActivation(config.activation === undefined ? _this.DEFAULT_ACTIVATION : + config.activation); + _this.recurrentActivation = activations_1.getActivation(config.recurrentActivation === undefined ? + _this.DEFAULT_RECURRENT_ACTIVATION : + config.recurrentActivation); + _this.useBias = config.useBias == null ? true : config.useBias; + _this.kernelInitializer = initializers_1.getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.recurrentInitializer = initializers_1.getInitializer(config.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); + _this.biasInitializer = + initializers_1.getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.kernelRegularizer = regularizers_1.getRegularizer(config.kernelRegularizer); + _this.recurrentRegularizer = regularizers_1.getRegularizer(config.recurrentRegularizer); + _this.biasRegularizer = regularizers_1.getRegularizer(config.biasRegularizer); + _this.kernelConstraint = constraints_1.getConstraint(config.kernelConstraint); + _this.recurrentConstraint = constraints_1.getConstraint(config.recurrentConstraint); + _this.biasConstraint = constraints_1.getConstraint(config.biasConstraint); + _this.dropout = math_utils.min([1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]); + _this.recurrentDropout = math_utils.min([ + 1, + math_utils.max([0, config.recurrentDropout == null ? 0 : config.recurrentDropout]) + ]); + _this.implementation = config.implementation; + _this.stateSize = _this.units; + _this.dropoutMask = null; + _this.recurrentDropoutMask = null; + return _this; + } + GRUCell.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var inputDim = inputShape[inputShape.length - 1]; + this.kernel = this.addWeight('kernel', [inputDim, this.units * 3], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 3], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.units * 3], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + else { + this.bias = null; + } + this.built = true; + }; + GRUCell.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = inputs; + if (inputs.length !== 2) { + throw new errors_1.ValueError("GRUCell expects 2 input Tensors (inputs, h, c), got " + + (inputs.length + ".")); + } + var training = kwargs['training'] == null ? false : kwargs['training']; + var hTMinus1 = inputs[1]; + inputs = inputs[0]; + if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { + _this.dropoutMask = generateDropoutMask(function () { return tfc.onesLike(inputs); }, _this.dropout, training, 3); + } + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && + _this.recurrentDropoutMask == null) { + _this.recurrentDropoutMask = + generateDropoutMask(function () { return tfc.onesLike(hTMinus1); }, _this.recurrentDropout, training, 3); + } + var dpMask = _this.dropoutMask; + var recDpMask = _this.recurrentDropoutMask; + var z; + var r; + var hh; + if (_this.implementation === 1) { + var kernelZ = K.sliceAlongLastAxis(_this.kernel.read(), 0, _this.units); + var kernelR = K.sliceAlongLastAxis(_this.kernel.read(), _this.units, _this.units); + var kernelH = K.sliceAlongLastAxis(_this.kernel.read(), _this.units * 2, _this.units); + var recurrentKernelZ = K.sliceAlongLastAxis(_this.recurrentKernel.read(), 0, _this.units); + var recurrentKernelR = K.sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units, _this.units); + var recurrentKernelH = K.sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units * 2, _this.units); + var inputsZ = void 0, inputsR = void 0, inputsH = void 0; + if (0 < _this.dropout && _this.dropout < 1) { + inputsZ = tfc.mul(inputs, dpMask[0]); + inputsR = tfc.mul(inputs, dpMask[1]); + inputsH = tfc.mul(inputs, dpMask[2]); + } + else { + inputsZ = inputs; + inputsR = inputs; + inputsH = inputs; + } + var xZ = K.dot(inputsZ, kernelZ); + var xR = K.dot(inputsR, kernelR); + var xH = K.dot(inputsH, kernelH); + if (_this.useBias) { + var biasZ = K.sliceAlongFirstAxis(_this.bias.read(), 0, _this.units); + var biasR = K.sliceAlongFirstAxis(_this.bias.read(), _this.units, _this.units); + var biasH = K.sliceAlongFirstAxis(_this.bias.read(), _this.units * 2, _this.units); + xZ = K.biasAdd(xZ, biasZ); + xR = K.biasAdd(xR, biasR); + xH = K.biasAdd(xH, biasH); + } + var hTMinus1Z = void 0; + var hTMinus1R = void 0; + var hTMinus1H = void 0; + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { + hTMinus1Z = tfc.mul(hTMinus1, recDpMask[0]); + hTMinus1R = tfc.mul(hTMinus1, recDpMask[1]); + hTMinus1H = tfc.mul(hTMinus1, recDpMask[2]); + } + else { + hTMinus1Z = hTMinus1; + hTMinus1R = hTMinus1; + hTMinus1H = hTMinus1; + } + z = _this.recurrentActivation.apply(tfc.add(xZ, K.dot(hTMinus1Z, recurrentKernelZ))); + r = _this.recurrentActivation.apply(tfc.add(xR, K.dot(hTMinus1R, recurrentKernelR))); + hh = _this.activation.apply(tfc.add(xH, K.dot(tfc.mul(r, hTMinus1H), recurrentKernelH))); + } + else { + if (0 < _this.dropout && _this.dropout < 1) { + inputs = tfc.mul(inputs, dpMask[0]); + } + var matrixX = K.dot(inputs, _this.kernel.read()); + if (_this.useBias) { + matrixX = K.biasAdd(matrixX, _this.bias.read()); + } + if (0 < _this.dropout && _this.dropout < 1) { + hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); + } + var matrixInner = K.dot(hTMinus1, K.sliceAlongLastAxis(_this.recurrentKernel.read(), 0, 2 * _this.units)); + var xZ = K.sliceAlongLastAxis(matrixX, 0, _this.units); + var xR = K.sliceAlongLastAxis(matrixX, _this.units, _this.units); + var recurrentZ = K.sliceAlongLastAxis(matrixInner, 0, _this.units); + var recurrentR = K.sliceAlongLastAxis(matrixInner, _this.units, _this.units); + z = _this.recurrentActivation.apply(tfc.add(xZ, recurrentZ)); + r = _this.recurrentActivation.apply(tfc.add(xR, recurrentR)); + var xH = K.sliceAlongLastAxis(matrixX, 2 * _this.units, _this.units); + var recurrentH = K.dot(tfc.mul(r, hTMinus1), K.sliceAlongLastAxis(_this.recurrentKernel.read(), 2 * _this.units, _this.units)); + hh = _this.activation.apply(tfc.add(xH, recurrentH)); + } + var h = tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(state_1.getScalar(1), tfc.neg(z)), hh)); + return [h, h]; + }); + }; + GRUCell.prototype.getConfig = function () { + var config = { + units: this.units, + activation: activations_1.serializeActivation(this.activation), + recurrentActivation: activations_1.serializeActivation(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: initializers_1.serializeInitializer(this.kernelInitializer), + recurrentInitializer: initializers_1.serializeInitializer(this.recurrentInitializer), + biasInitializer: initializers_1.serializeInitializer(this.biasInitializer), + kernelRegularizer: regularizers_1.serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: regularizers_1.serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: regularizers_1.serializeRegularizer(this.biasRegularizer), + activityRegularizer: regularizers_1.serializeRegularizer(this.activityRegularizer), + kernelConstraint: constraints_1.serializeConstraint(this.kernelConstraint), + recurrentConstraint: constraints_1.serializeConstraint(this.recurrentConstraint), + biasConstraint: constraints_1.serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + GRUCell.className = 'GRUCell'; + return GRUCell; +}(RNNCell)); +exports.GRUCell = GRUCell; +tfjs_core_1.serialization.SerializationMap.register(GRUCell); +var GRU = (function (_super) { + __extends(GRU, _super); + function GRU(config) { + var _this = this; + if (config.implementation === 0) { + console.warn('`implementation=0` has been deprecated, and now defaults to ' + + '`implementation=1`. Please update your layer call.'); + } + config.cell = new GRUCell(config); + _this = _super.call(this, config) || this; + return _this; + } + GRU.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + if (_this.cell.dropoutMask != null) { + tfc.dispose(_this.cell.dropoutMask); + _this.cell.dropoutMask = null; + } + if (_this.cell.recurrentDropoutMask != null) { + tfc.dispose(_this.cell.recurrentDropoutMask); + _this.cell.recurrentDropoutMask = null; + } + var mask = kwargs == null ? null : kwargs['mask']; + var training = kwargs == null ? null : kwargs['training']; + var initialState = kwargs == null ? null : kwargs['initialState']; + return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); + }); + }; + Object.defineProperty(GRU.prototype, "units", { + get: function () { + return this.cell.units; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "activation", { + get: function () { + return this.cell.activation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentActivation", { + get: function () { + return this.cell.recurrentActivation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "useBias", { + get: function () { + return this.cell.useBias; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "kernelInitializer", { + get: function () { + return this.cell.kernelInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentInitializer", { + get: function () { + return this.cell.recurrentInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "biasInitializer", { + get: function () { + return this.cell.biasInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "kernelRegularizer", { + get: function () { + return this.cell.kernelRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentRegularizer", { + get: function () { + return this.cell.recurrentRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "biasRegularizer", { + get: function () { + return this.cell.biasRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "kernelConstraint", { + get: function () { + return this.cell.kernelConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentConstraint", { + get: function () { + return this.cell.recurrentConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "biasConstraint", { + get: function () { + return this.cell.biasConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "dropout", { + get: function () { + return this.cell.dropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentDropout", { + get: function () { + return this.cell.recurrentDropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "implementation", { + get: function () { + return this.cell.implementation; + }, + enumerable: true, + configurable: true + }); + GRU.prototype.getConfig = function () { + var config = { + units: this.units, + activation: activations_1.serializeActivation(this.activation), + recurrentActivation: activations_1.serializeActivation(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: initializers_1.serializeInitializer(this.kernelInitializer), + recurrentInitializer: initializers_1.serializeInitializer(this.recurrentInitializer), + biasInitializer: initializers_1.serializeInitializer(this.biasInitializer), + kernelRegularizer: regularizers_1.serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: regularizers_1.serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: regularizers_1.serializeRegularizer(this.biasRegularizer), + activityRegularizer: regularizers_1.serializeRegularizer(this.activityRegularizer), + kernelConstraint: constraints_1.serializeConstraint(this.kernelConstraint), + recurrentConstraint: constraints_1.serializeConstraint(this.recurrentConstraint), + biasConstraint: constraints_1.serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation, + }; + var baseConfig = _super.prototype.getConfig.call(this); + delete baseConfig['cell']; + Object.assign(config, baseConfig); + return config; + }; + GRU.fromConfig = function (cls, config) { + if (config['implmentation'] === 0) { + config['implementation'] = 1; + } + return new cls(config); + }; + GRU.className = 'GRU'; + return GRU; +}(RNN)); +exports.GRU = GRU; +tfjs_core_1.serialization.SerializationMap.register(GRU); +var LSTMCell = (function (_super) { + __extends(LSTMCell, _super); + function LSTMCell(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_ACTIVATION = 'tanh'; + _this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + _this.units = config.units; + _this.activation = activations_1.getActivation(config.activation === undefined ? _this.DEFAULT_ACTIVATION : + config.activation); + _this.recurrentActivation = activations_1.getActivation(config.recurrentActivation === undefined ? + _this.DEFAULT_RECURRENT_ACTIVATION : + config.recurrentActivation); + _this.useBias = config.useBias == null ? true : config.useBias; + _this.kernelInitializer = initializers_1.getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.recurrentInitializer = initializers_1.getInitializer(config.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); + _this.biasInitializer = + initializers_1.getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.unitForgetBias = config.unitForgetBias; + _this.kernelRegularizer = regularizers_1.getRegularizer(config.kernelRegularizer); + _this.recurrentRegularizer = regularizers_1.getRegularizer(config.recurrentRegularizer); + _this.biasRegularizer = regularizers_1.getRegularizer(config.biasRegularizer); + _this.kernelConstraint = constraints_1.getConstraint(config.kernelConstraint); + _this.recurrentConstraint = constraints_1.getConstraint(config.recurrentConstraint); + _this.biasConstraint = constraints_1.getConstraint(config.biasConstraint); + _this.dropout = math_utils.min([1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]); + _this.recurrentDropout = math_utils.min([ + 1, + math_utils.max([0, config.recurrentDropout == null ? 0 : config.recurrentDropout]) + ]); + _this.implementation = config.implementation; + _this.stateSize = [_this.units, _this.units]; + _this.dropoutMask = null; + _this.recurrentDropoutMask = null; + return _this; + } + LSTMCell.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var inputDim = inputShape[inputShape.length - 1]; + this.kernel = this.addWeight('kernel', [inputDim, this.units * 4], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 4], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + var biasInitializer; + if (this.useBias) { + if (this.unitForgetBias) { + var capturedBiasInit_1 = this.biasInitializer; + var capturedUnits_1 = this.units; + biasInitializer = new (_a = (function (_super) { + __extends(CustomInit, _super); + function CustomInit() { + return _super !== null && _super.apply(this, arguments) || this; + } + CustomInit.prototype.apply = function (shape, dtype) { + var bI = capturedBiasInit_1.apply([capturedUnits_1]); + var bF = (new initializers_1.Ones()).apply([capturedUnits_1]); + var bCAndH = capturedBiasInit_1.apply([capturedUnits_1 * 2]); + return K.concatAlongFirstAxis(K.concatAlongFirstAxis(bI, bF), bCAndH); + }; + return CustomInit; + }(initializers_1.Initializer)), + _a.className = 'CustomInit', + _a)(); + } + else { + biasInitializer = this.biasInitializer; + } + this.bias = this.addWeight('bias', [this.units * 4], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + else { + this.bias = null; + } + this.built = true; + var _a; + }; + LSTMCell.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + var training = kwargs['training'] == null ? false : kwargs['training']; + inputs = inputs; + if (inputs.length !== 3) { + throw new errors_1.ValueError("LSTMCell expects 3 input Tensors (inputs, h, c), got " + + (inputs.length + ".")); + } + var hTMinus1 = inputs[1]; + var cTMinus1 = inputs[2]; + inputs = inputs[0]; + if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { + _this.dropoutMask = generateDropoutMask(function () { return tfc.onesLike(inputs); }, _this.dropout, training, 4); + } + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && + _this.recurrentDropoutMask == null) { + _this.recurrentDropoutMask = + generateDropoutMask(function () { return tfc.onesLike(hTMinus1); }, _this.recurrentDropout, training, 4); + } + var dpMask = _this.dropoutMask; + var recDpMask = _this.recurrentDropoutMask; + var i; + var f; + var c; + var o; + if (_this.implementation === 1) { + var kernelI = K.sliceAlongLastAxis(_this.kernel.read(), 0, _this.units); + var kernelF = K.sliceAlongLastAxis(_this.kernel.read(), _this.units, _this.units); + var kernelC = K.sliceAlongLastAxis(_this.kernel.read(), _this.units * 2, _this.units); + var kernelO = K.sliceAlongLastAxis(_this.kernel.read(), _this.units * 3, _this.units); + var recurrentKernelI = K.sliceAlongLastAxis(_this.recurrentKernel.read(), 0, _this.units); + var recurrentKernelF = K.sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units, _this.units); + var recurrentKernelC = K.sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units * 2, _this.units); + var recurrentKernelO = K.sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units * 3, _this.units); + var inputsI = void 0, inputsF = void 0, inputsC = void 0, inputsO = void 0; + if (0 < _this.dropout && _this.dropout < 1) { + inputsI = tfc.mul(inputs, dpMask[0]); + inputsF = tfc.mul(inputs, dpMask[1]); + inputsC = tfc.mul(inputs, dpMask[2]); + inputsO = tfc.mul(inputs, dpMask[3]); + } + else { + inputsI = inputs; + inputsF = inputs; + inputsC = inputs; + inputsO = inputs; + } + var xI = K.dot(inputsI, kernelI); + var xF = K.dot(inputsF, kernelF); + var xC = K.dot(inputsC, kernelC); + var xO = K.dot(inputsO, kernelO); + if (_this.useBias) { + var biasI = K.sliceAlongFirstAxis(_this.bias.read(), 0, _this.units); + var biasF = K.sliceAlongFirstAxis(_this.bias.read(), _this.units, _this.units); + var biasC = K.sliceAlongFirstAxis(_this.bias.read(), _this.units * 2, _this.units); + var biasO = K.sliceAlongFirstAxis(_this.bias.read(), _this.units * 3, _this.units); + xI = K.biasAdd(xI, biasI); + xF = K.biasAdd(xF, biasF); + xC = K.biasAdd(xC, biasC); + xO = K.biasAdd(xO, biasO); + } + var hTMinus1I = void 0, hTMinus1F = void 0, hTMinus1C = void 0, hTMinus1O = void 0; + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { + hTMinus1I = tfc.mul(hTMinus1, recDpMask[0]); + hTMinus1F = tfc.mul(hTMinus1, recDpMask[1]); + hTMinus1C = tfc.mul(hTMinus1, recDpMask[2]); + hTMinus1O = tfc.mul(hTMinus1, recDpMask[3]); + } + else { + hTMinus1I = hTMinus1; + hTMinus1F = hTMinus1; + hTMinus1C = hTMinus1; + hTMinus1O = hTMinus1; + } + i = _this.recurrentActivation.apply(tfc.add(xI, K.dot(hTMinus1I, recurrentKernelI))); + f = _this.recurrentActivation.apply(tfc.add(xF, K.dot(hTMinus1F, recurrentKernelF))); + c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, _this.activation.apply(tfc.add(xC, K.dot(hTMinus1C, recurrentKernelC))))); + o = _this.recurrentActivation.apply(tfc.add(xO, K.dot(hTMinus1O, recurrentKernelO))); + } + else { + if (0 < _this.dropout && _this.dropout < 1) { + inputs = tfc.mul(inputs, dpMask[0]); + } + var z = K.dot(inputs, _this.kernel.read()); + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { + hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); + } + z = tfc.add(z, K.dot(hTMinus1, _this.recurrentKernel.read())); + if (_this.useBias) { + z = K.biasAdd(z, _this.bias.read()); + } + var z0 = K.sliceAlongLastAxis(z, 0, _this.units); + var z1 = K.sliceAlongLastAxis(z, _this.units, _this.units); + var z2 = K.sliceAlongLastAxis(z, _this.units * 2, _this.units); + var z3 = K.sliceAlongLastAxis(z, _this.units * 3, _this.units); + i = _this.recurrentActivation.apply(z0); + f = _this.recurrentActivation.apply(z1); + c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, _this.activation.apply(z2))); + o = _this.recurrentActivation.apply(z3); + } + var h = tfc.mul(o, _this.activation.apply(c)); + return [h, h, c]; + }); + }; + LSTMCell.prototype.getConfig = function () { + var config = { + units: this.units, + activation: activations_1.serializeActivation(this.activation), + recurrentActivation: activations_1.serializeActivation(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: initializers_1.serializeInitializer(this.kernelInitializer), + recurrentInitializer: initializers_1.serializeInitializer(this.recurrentInitializer), + biasInitializer: initializers_1.serializeInitializer(this.biasInitializer), + unitForgetBias: this.unitForgetBias, + kernelRegularizer: regularizers_1.serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: regularizers_1.serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: regularizers_1.serializeRegularizer(this.biasRegularizer), + activityRegularizer: regularizers_1.serializeRegularizer(this.activityRegularizer), + kernelConstraint: constraints_1.serializeConstraint(this.kernelConstraint), + recurrentConstraint: constraints_1.serializeConstraint(this.recurrentConstraint), + biasConstraint: constraints_1.serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + LSTMCell.className = 'LSTMCell'; + return LSTMCell; +}(RNNCell)); +exports.LSTMCell = LSTMCell; +tfjs_core_1.serialization.SerializationMap.register(LSTMCell); +var LSTM = (function (_super) { + __extends(LSTM, _super); + function LSTM(config) { + var _this = this; + if (config.implementation === 0) { + console.warn('`implementation=0` has been deprecated, and now defaults to ' + + '`implementation=1`. Please update your layer call.'); + } + config.cell = new LSTMCell(config); + _this = _super.call(this, config) || this; + return _this; + } + LSTM.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + if (_this.cell.dropoutMask != null) { + tfc.dispose(_this.cell.dropoutMask); + _this.cell.dropoutMask = null; + } + if (_this.cell.recurrentDropoutMask != null) { + tfc.dispose(_this.cell.recurrentDropoutMask); + _this.cell.recurrentDropoutMask = null; + } + var mask = kwargs == null ? null : kwargs['mask']; + var training = kwargs == null ? null : kwargs['training']; + var initialState = kwargs == null ? null : kwargs['initialState']; + return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); + }); + }; + Object.defineProperty(LSTM.prototype, "units", { + get: function () { + return this.cell.units; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "activation", { + get: function () { + return this.cell.activation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentActivation", { + get: function () { + return this.cell.recurrentActivation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "useBias", { + get: function () { + return this.cell.useBias; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "kernelInitializer", { + get: function () { + return this.cell.kernelInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentInitializer", { + get: function () { + return this.cell.recurrentInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "biasInitializer", { + get: function () { + return this.cell.biasInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "unitForgetBias", { + get: function () { + return this.cell.unitForgetBias; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "kernelRegularizer", { + get: function () { + return this.cell.kernelRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentRegularizer", { + get: function () { + return this.cell.recurrentRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "biasRegularizer", { + get: function () { + return this.cell.biasRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "kernelConstraint", { + get: function () { + return this.cell.kernelConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentConstraint", { + get: function () { + return this.cell.recurrentConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "biasConstraint", { + get: function () { + return this.cell.biasConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "dropout", { + get: function () { + return this.cell.dropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentDropout", { + get: function () { + return this.cell.recurrentDropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "implementation", { + get: function () { + return this.cell.implementation; + }, + enumerable: true, + configurable: true + }); + LSTM.prototype.getConfig = function () { + var config = { + units: this.units, + activation: activations_1.serializeActivation(this.activation), + recurrentActivation: activations_1.serializeActivation(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: initializers_1.serializeInitializer(this.kernelInitializer), + recurrentInitializer: initializers_1.serializeInitializer(this.recurrentInitializer), + biasInitializer: initializers_1.serializeInitializer(this.biasInitializer), + unitForgetBias: this.unitForgetBias, + kernelRegularizer: regularizers_1.serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: regularizers_1.serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: regularizers_1.serializeRegularizer(this.biasRegularizer), + activityRegularizer: regularizers_1.serializeRegularizer(this.activityRegularizer), + kernelConstraint: constraints_1.serializeConstraint(this.kernelConstraint), + recurrentConstraint: constraints_1.serializeConstraint(this.recurrentConstraint), + biasConstraint: constraints_1.serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation, + }; + var baseConfig = _super.prototype.getConfig.call(this); + delete baseConfig['cell']; + Object.assign(config, baseConfig); + return config; + }; + LSTM.fromConfig = function (cls, config) { + if (config['implmentation'] === 0) { + config['implementation'] = 1; + } + return new cls(config); + }; + LSTM.className = 'LSTM'; + return LSTM; +}(RNN)); +exports.LSTM = LSTM; +tfjs_core_1.serialization.SerializationMap.register(LSTM); +var StackedRNNCells = (function (_super) { + __extends(StackedRNNCells, _super); + function StackedRNNCells(config) { + var _this = _super.call(this, config) || this; + _this.cells = config.cells; + return _this; + } + Object.defineProperty(StackedRNNCells.prototype, "stateSize", { + get: function () { + var stateSize = []; + for (var _i = 0, _a = this.cells.slice().reverse(); _i < _a.length; _i++) { + var cell = _a[_i]; + if (Array.isArray(cell.stateSize)) { + stateSize.push.apply(stateSize, cell.stateSize); + } + else { + stateSize.push(cell.stateSize); + } + } + return stateSize; + }, + enumerable: true, + configurable: true + }); + StackedRNNCells.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = inputs; + var states = inputs.slice(1); + var nestedStates = []; + for (var _i = 0, _a = _this.cells.slice().reverse(); _i < _a.length; _i++) { + var cell = _a[_i]; + if (Array.isArray(cell.stateSize)) { + nestedStates.push(states.splice(0, cell.stateSize.length)); + } + else { + nestedStates.push(states.splice(0, 1)); + } + } + nestedStates.reverse(); + var newNestedStates = []; + var callInputs; + for (var i = 0; i < _this.cells.length; ++i) { + var cell = _this.cells[i]; + states = nestedStates[i]; + if (i === 0) { + callInputs = [inputs[0]].concat(states); + } + else { + callInputs = [callInputs[0]].concat(states); + } + callInputs = cell.call(callInputs, kwargs); + newNestedStates.push(callInputs.slice(1)); + } + states = []; + for (var _b = 0, _c = newNestedStates.slice().reverse(); _b < _c.length; _b++) { + var cellStates = _c[_b]; + states.push.apply(states, cellStates); + } + return [callInputs[0]].concat(states); + }); + }; + StackedRNNCells.prototype.build = function (inputShape) { + if (types_utils_1.isArrayOfShapes(inputShape)) { + inputShape = inputShape[0]; + } + inputShape = inputShape; + var outputDim; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + cell.build(inputShape); + if (Array.isArray(cell.stateSize)) { + outputDim = cell.stateSize[0]; + } + else { + outputDim = cell.stateSize; + } + inputShape = [inputShape[0], outputDim]; + } + this.built = true; + }; + StackedRNNCells.prototype.getConfig = function () { + var cellConfigs = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + cellConfigs.push({ + 'className': this.getClassName(), + 'config': cell.getConfig(), + }); + } + var config = { 'cells': cellConfigs }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + StackedRNNCells.fromConfig = function (cls, config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + var cells = []; + for (var _i = 0, _a = config['cells']; _i < _a.length; _i++) { + var cellConfig = _a[_i]; + cells.push(serialization_1.deserialize(cellConfig, customObjects)); + } + return new cls({ cells: cells }); + }; + Object.defineProperty(StackedRNNCells.prototype, "trainableWeights", { + get: function () { + if (!this.trainable) { + return []; + } + var weights = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + weights.push.apply(weights, cell.trainableWeights); + } + return weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StackedRNNCells.prototype, "nonTrainableWeights", { + get: function () { + var weights = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + weights.push.apply(weights, cell.nonTrainableWeights); + } + if (!this.trainable) { + var trainableWeights = []; + for (var _b = 0, _c = this.cells; _b < _c.length; _b++) { + var cell = _c[_b]; + trainableWeights.push.apply(trainableWeights, cell.trainableWeights); + } + return trainableWeights.concat(weights); + } + return weights; + }, + enumerable: true, + configurable: true + }); + StackedRNNCells.prototype.getWeights = function () { + var weights = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + weights.push.apply(weights, cell.weights); + } + return variables_1.batchGetValue(weights); + }; + StackedRNNCells.prototype.setWeights = function (weights) { + var tuples = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + var numParams = cell.weights.length; + var inputWeights = weights.splice(numParams); + for (var i = 0; i < cell.weights.length; ++i) { + tuples.push([cell.weights[i], inputWeights[i]]); + } + } + variables_1.batchSetValue(tuples); + }; + StackedRNNCells.className = 'StackedRNNCells'; + return StackedRNNCells; +}(RNNCell)); +exports.StackedRNNCells = StackedRNNCells; +tfjs_core_1.serialization.SerializationMap.register(StackedRNNCells); +function generateDropoutMask(ones, rate, training, count) { + if (training === void 0) { training = null; } + if (count === void 0) { count = 1; } + function droppedInputs() { + return K.dropout(ones(), state_1.getScalar(rate)); + } + if (count > 1) { + var mask = []; + for (var i = 0; i < count; i++) { + mask.push(K.inTrainPhase(droppedInputs, ones, training)); + } + mask.forEach(function (m) { return tfc.keep(m); }); + return mask; + } + else { + return tfc.keep(K.inTrainPhase(droppedInputs, ones, training)); + } +} +//# sourceMappingURL=recurrent.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js.map new file mode 100644 index 0000000..d8cb70b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"recurrent.js","sourceRoot":"","sources":["../../src/layers/recurrent.ts"],"names":[],"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AAI,KAAK,GAAG,CAAC,EAAE;QACb,IAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAC9B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;SAC1D;QACD,IAAI,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAX,CAAW,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC;KACb;SAAM;QACL,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;KAChE;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent_test.js.map new file mode 100644 index 0000000..2784ae7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/recurrent_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"recurrent_test.js","sourceRoot":"","sources":["../../src/layers/recurrent_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,iBA0vDA;;AA1vDA,2CAA6C;AAC7C,mDAAyG;AAEzG,2CAA6C;AAC7C,8BAAgC;AAChC,oCAAsC;AACtC,oCAA+D;AAE/D,oEAAsF;AACtF,kDAAgH;AAEhH,yCAAyD;AAazD,wBAAwB,MAAc,EAAE,MAAgB;IACtD,IAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAW,CAAC;IACxC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,GAAG,CAAC,GAAG,CAAC,IAAI,EAA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 No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.d.ts new file mode 100644 index 0000000..377f7e4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.d.ts @@ -0,0 +1,2 @@ +import { serialization } from '@tensorflow/tfjs-core'; +export declare function deserialize(config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): serialization.Serializable; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js new file mode 100644 index 0000000..4d9fa00 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var generic_utils_1 = require("../utils/generic_utils"); +function deserialize(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return generic_utils_1.deserializeKerasObject(config, tfjs_core_1.serialization.SerializationMap.getMap().classNameMap, customObjects, 'layer'); +} +exports.deserialize = deserialize; +//# sourceMappingURL=serialization.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js.map new file mode 100644 index 0000000..68c2410 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../src/layers/serialization.ts"],"names":[],"mappings":";;AAWA,mDAAoD;AAEpD,wDAA8D;AAS9D,qBACI,MAAgC,EAChC,aAC4B;IAD5B,8BAAA,EAAA,gBAAgB,EACY;IAC9B,OAAO,sCAAsB,CACzB,MAAM,EAAE,yBAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,YAAY,EAC5D,aAAa,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC;AAPD,kCAOC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization_test.js.map new file mode 100644 index 0000000..22d4a51 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/serialization_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serialization_test.js","sourceRoot":"","sources":["../../src/layers/serialization_test.ts"],"names":[],"mappings":";;AAYA,gDAAyD;AACzD,iDAA4C;AAE5C,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,kBAAkB,EAAE;QACrB,IAAM,MAAM,GAA6B,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;QAC1E,IAAM,WAAW,GAAU,2BAAW,CAAC,MAAM,CAAgB,CAAC;QAC9D,MAAM,CAAC,WAAW,YAAY,CAAC,oBAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,iBAAiB,EAAE;QACpB,IAAM,MAAM,GAA6B,EAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;QACzE,IAAM,WAAW,GAAS,2BAAW,CAAC,MAAM,CAAgB,CAAC;QAC7D,MAAM,CAAC,WAAW,YAAY,CAAC,mBAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.d.ts new file mode 100644 index 0000000..8145c2f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.d.ts @@ -0,0 +1,61 @@ +import * as tfc from '@tensorflow/tfjs-core'; +import { serialization, Tensor } from '@tensorflow/tfjs-core'; +import { Layer, LayerConfig, SymbolicTensor } from '../engine/topology'; +import { Kwargs, Shape } from '../types'; +import { RegularizerFn } from '../types'; +import { LayerVariable } from '../variables'; +import { RNN } from './recurrent'; +export interface WrapperLayerConfig extends LayerConfig { + layer: Layer; +} +export declare abstract class Wrapper extends Layer { + readonly layer: Layer; + constructor(config: WrapperLayerConfig); + build(inputShape: Shape | Shape[]): void; + trainable: boolean; + readonly trainableWeights: LayerVariable[]; + readonly nonTrainableWeights: LayerVariable[]; + readonly updates: Tensor[]; + readonly losses: RegularizerFn[]; + getWeights(): Tensor[]; + setWeights(weights: Tensor[]): void; + getConfig(): serialization.ConfigDict; + static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict, customObjects?: tfc.serialization.ConfigDict): T; +} +export declare class TimeDistributed extends Wrapper { + static className: string; + constructor(config: WrapperLayerConfig); + build(inputShape: Shape | Shape[]): void; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; +} +export declare type BidirectionalMergeMode = 'sum' | 'mul' | 'concat' | 'ave'; +export declare const VALID_BIDIRECTIONAL_MERGE_MODES: string[]; +export declare function checkBidirectionalMergeMode(value?: string): void; +export interface BidirectionalLayerConfig extends WrapperLayerConfig { + layer: RNN; + mergeMode?: BidirectionalMergeMode; +} +export declare class Bidirectional extends Wrapper { + static className: string; + private forwardLayer; + private backwardLayer; + private mergeMode; + private returnSequences; + private returnState; + private numConstants?; + private _trainable; + constructor(config: BidirectionalLayerConfig); + trainable: boolean; + getWeights(): Tensor[]; + setWeights(weights: Tensor[]): void; + computeOutputShape(inputShape: Shape | Shape[]): Shape | Shape[]; + apply(inputs: Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[], kwargs?: Kwargs): Tensor | Tensor[] | SymbolicTensor | SymbolicTensor[]; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + resetStates(states?: Tensor | Tensor[]): void; + build(inputShape: Shape | Shape[]): void; + readonly trainableWeights: LayerVariable[]; + readonly nonTrainableWeights: LayerVariable[]; + getConfig(): serialization.ConfigDict; + static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js b/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js new file mode 100644 index 0000000..f6c2db1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js @@ -0,0 +1,416 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("../backend/state"); +var K = require("../backend/tfjs_backend"); +var common_1 = require("../common"); +var topology_1 = require("../engine/topology"); +var errors_1 = require("../errors"); +var generic_utils = require("../utils/generic_utils"); +var types_utils_1 = require("../utils/types_utils"); +var recurrent_1 = require("./recurrent"); +var serialization_1 = require("./serialization"); +var Wrapper = (function (_super) { + __extends(Wrapper, _super); + function Wrapper(config) { + var _this = _super.call(this, config) || this; + _this.layer = config.layer; + return _this; + } + Wrapper.prototype.build = function (inputShape) { + this.built = true; + }; + Object.defineProperty(Wrapper.prototype, "trainable", { + get: function () { + if (this.layer != null) { + return this.layer.trainable; + } + else { + return false; + } + }, + set: function (value) { + if (this.layer != null) { + this.layer.trainable = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Wrapper.prototype, "trainableWeights", { + get: function () { + return this.layer.trainableWeights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Wrapper.prototype, "nonTrainableWeights", { + get: function () { + return this.layer.nonTrainableWeights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Wrapper.prototype, "updates", { + get: function () { + return this.layer._updates; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Wrapper.prototype, "losses", { + get: function () { + return this.layer.losses; + }, + enumerable: true, + configurable: true + }); + Wrapper.prototype.getWeights = function () { + return this.layer.getWeights(); + }; + Wrapper.prototype.setWeights = function (weights) { + this.layer.setWeights(weights); + }; + Wrapper.prototype.getConfig = function () { + var config = { + 'layer': { + 'className': this.layer.getClassName(), + 'config': this.layer.getConfig(), + } + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Wrapper.fromConfig = function (cls, config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + var layerConfig = config['layer']; + var layer = serialization_1.deserialize(layerConfig, customObjects); + delete config['layer']; + var newConfig = { layer: layer }; + Object.assign(newConfig, config); + return new cls(newConfig); + }; + return Wrapper; +}(topology_1.Layer)); +exports.Wrapper = Wrapper; +var TimeDistributed = (function (_super) { + __extends(TimeDistributed, _super); + function TimeDistributed(config) { + var _this = _super.call(this, config) || this; + _this.supportsMasking = true; + return _this; + } + TimeDistributed.prototype.build = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + if (inputShape.length < 3) { + throw new errors_1.ValueError("TimeDistributed layer expects an input shape >= 3D, but received " + + ("input shape " + JSON.stringify(inputShape))); + } + this.inputSpec = [{ shape: inputShape }]; + var childInputShape = [inputShape[0]].concat(inputShape.slice(2)); + if (!this.layer.built) { + this.layer.build(childInputShape); + this.layer.built = true; + } + _super.prototype.build.call(this, inputShape); + }; + TimeDistributed.prototype.computeOutputShape = function (inputShape) { + inputShape = types_utils_1.getExactlyOneShape(inputShape); + var childInputShape = [inputShape[0]].concat(inputShape.slice(2)); + var childOutputShape = this.layer.computeOutputShape(childInputShape); + var timesteps = inputShape[1]; + return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1)); + }; + TimeDistributed.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + inputs = types_utils_1.getExactlyOneTensor(inputs); + var step = function (inputs, states) { + var output = _this.layer.call(inputs, kwargs); + return [output, []]; + }; + var rnnOutputs = recurrent_1.rnn(step, inputs, [], false, null, null, false, inputs.shape[1]); + var y = rnnOutputs[1]; + return y; + }); + }; + TimeDistributed.className = 'TimeDistributed'; + return TimeDistributed; +}(Wrapper)); +exports.TimeDistributed = TimeDistributed; +tfjs_core_1.serialization.SerializationMap.register(TimeDistributed); +exports.VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave']; +function checkBidirectionalMergeMode(value) { + generic_utils.checkStringTypeUnionValue(exports.VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value); +} +exports.checkBidirectionalMergeMode = checkBidirectionalMergeMode; +var Bidirectional = (function (_super) { + __extends(Bidirectional, _super); + function Bidirectional(config) { + var _this = _super.call(this, config) || this; + var layerConfig = config.layer.getConfig(); + _this.forwardLayer = + serialization_1.deserialize({ className: config.layer.getClassName(), config: layerConfig }); + layerConfig['goBackwards'] = + layerConfig['goBackwards'] === true ? false : true; + _this.backwardLayer = + serialization_1.deserialize({ className: config.layer.getClassName(), config: layerConfig }); + _this.forwardLayer.name = 'forward_' + _this.forwardLayer.name; + _this.backwardLayer.name = 'backward_' + _this.backwardLayer.name; + checkBidirectionalMergeMode(config.mergeMode); + _this.mergeMode = config.mergeMode; + if (config.weights) { + throw new errors_1.NotImplementedError('weights support is not implemented for Bidirectional layer yet.'); + } + _this._stateful = config.layer.stateful; + _this.returnSequences = config.layer.returnSequences; + _this.returnState = config.layer.returnState; + _this.supportsMasking = true; + _this._trainable = true; + _this.inputSpec = config.layer.inputSpec; + _this.numConstants = null; + return _this; + } + Object.defineProperty(Bidirectional.prototype, "trainable", { + get: function () { + return this._trainable; + }, + set: function (value) { + this._trainable = value; + if (this.forwardLayer != null) { + this.forwardLayer.trainable = value; + } + if (this.backwardLayer != null) { + this.backwardLayer.trainable = value; + } + }, + enumerable: true, + configurable: true + }); + Bidirectional.prototype.getWeights = function () { + return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights()); + }; + Bidirectional.prototype.setWeights = function (weights) { + var numWeights = weights.length; + var numeightsOver2 = Math.floor(numWeights / 2); + this.forwardLayer.setWeights(weights.slice(0, numeightsOver2)); + this.backwardLayer.setWeights(weights.slice(numeightsOver2)); + }; + Bidirectional.prototype.computeOutputShape = function (inputShape) { + var layerShapes = this.forwardLayer.computeOutputShape(inputShape); + if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) { + layerShapes = [layerShapes]; + } + layerShapes = layerShapes; + var outputShape; + var outputShapes; + var stateShape; + if (this.returnState) { + stateShape = layerShapes.slice(1); + outputShape = layerShapes[0]; + } + else { + outputShape = layerShapes[0]; + } + outputShape = outputShape; + if (this.mergeMode === 'concat') { + outputShape[outputShape.length - 1] *= 2; + outputShapes = [outputShape]; + } + else if (this.mergeMode == null) { + outputShapes = [outputShape, outputShape.slice()]; + } + else { + outputShapes = [outputShape]; + } + if (this.returnState) { + if (this.mergeMode == null) { + return outputShapes.concat(stateShape).concat(stateShape.slice()); + } + return [outputShape].concat(stateShape).concat(stateShape.slice()); + } + return generic_utils.singletonOrArray(outputShapes); + }; + Bidirectional.prototype.apply = function (inputs, kwargs) { + var initialState = kwargs == null ? null : kwargs['initialState']; + var constants = kwargs == null ? null : kwargs['constants']; + if (kwargs == null) { + kwargs = {}; + } + var standardized = recurrent_1.standardizeArgs(inputs, initialState, constants, this.numConstants); + inputs = standardized.inputs; + initialState = standardized.initialState; + constants = standardized.constants; + if (Array.isArray(inputs)) { + initialState = inputs.slice(1); + inputs = inputs[0]; + } + if ((initialState == null || initialState.length === 0) && + constants == null) { + return _super.prototype.apply.call(this, inputs, kwargs); + } + var additionalInputs = []; + var additionalSpecs = []; + if (initialState != null) { + var numStates = initialState.length; + if (numStates % 2 > 0) { + throw new errors_1.ValueError('When passing `initialState` to a Bidrectional RNN, ' + + 'the state should be an Array containing the states of ' + + 'the underlying RNNs.'); + } + kwargs['initialState'] = initialState; + additionalInputs.push.apply(additionalInputs, initialState); + var stateSpecs = initialState + .map(function (state) { return new topology_1.InputSpec({ shape: state.shape }); }); + this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2); + this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2); + additionalSpecs.push.apply(additionalSpecs, stateSpecs); + } + if (constants != null) { + throw new errors_1.NotImplementedError('Support for constants in Bidirectional layers is not ' + + 'implemented yet.'); + } + var isSymbolicTensor = additionalInputs[0] instanceof topology_1.SymbolicTensor; + for (var _i = 0, additionalInputs_1 = additionalInputs; _i < additionalInputs_1.length; _i++) { + var tensor = additionalInputs_1[_i]; + if (tensor instanceof topology_1.SymbolicTensor !== isSymbolicTensor) { + throw new errors_1.ValueError('The initial state of a Bidirectional layer cannot be ' + + 'specified as a mix of symbolic and non-symbolic tensors'); + } + } + if (isSymbolicTensor) { + var fullInput = [inputs].concat(additionalInputs); + var fullInputSpec = this.inputSpec.concat(additionalSpecs); + var originalInputSpec = this.inputSpec; + this.inputSpec = fullInputSpec; + var output = _super.prototype.apply.call(this, fullInput, kwargs); + this.inputSpec = originalInputSpec; + return output; + } + else { + return _super.prototype.apply.call(this, inputs, kwargs); + } + }; + Bidirectional.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfjs_core_1.tidy(function () { + if (kwargs['mask'] != null) { + throw new errors_1.NotImplementedError('The support for masking is not implemented for ' + + 'Bidirectional layers yet.'); + } + var initialState = kwargs['initialState']; + var y; + var yRev; + if (initialState == null) { + y = _this.forwardLayer.call(inputs, kwargs); + yRev = _this.backwardLayer.call(inputs, kwargs); + } + else { + var forwardState = initialState.slice(0, initialState.length / 2); + var backwardState = initialState.slice(initialState.length / 2); + y = _this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: forwardState })); + yRev = _this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: backwardState })); + } + var states; + if (_this.returnState) { + if (Array.isArray(y)) { + states = y.slice(1).concat(yRev.slice(1)); + } + else { + } + y = y[0]; + yRev = yRev[0]; + } + if (_this.returnSequences) { + yRev = tfc.reverse(yRev, 1); + } + var output; + if (_this.mergeMode === 'concat') { + output = K.concatenate([y, yRev]); + } + else if (_this.mergeMode === 'sum') { + output = tfc.add(y, yRev); + } + else if (_this.mergeMode === 'ave') { + output = tfc.mul(state_1.getScalar(0.5), tfc.add(y, yRev)); + } + else if (_this.mergeMode === 'mul') { + output = tfc.mul(y, yRev); + } + else if (_this.mergeMode == null) { + output = [y, yRev]; + } + if (_this.returnState) { + if (_this.mergeMode == null) { + return output.concat(states); + } + return [output].concat(states); + } + return output; + }); + }; + Bidirectional.prototype.resetStates = function (states) { + this.forwardLayer.resetStates(); + this.backwardLayer.resetStates(); + }; + Bidirectional.prototype.build = function (inputShape) { + var _this = this; + common_1.nameScope(this.forwardLayer.name, function () { + _this.forwardLayer.build(inputShape); + }); + common_1.nameScope(this.backwardLayer.name, function () { + _this.backwardLayer.build(inputShape); + }); + this.built = true; + }; + Object.defineProperty(Bidirectional.prototype, "trainableWeights", { + get: function () { + return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bidirectional.prototype, "nonTrainableWeights", { + get: function () { + return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights); + }, + enumerable: true, + configurable: true + }); + Bidirectional.prototype.getConfig = function () { + var config = { + 'mergeMode': this.mergeMode, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Bidirectional.fromConfig = function (cls, config) { + var rnnLayer = serialization_1.deserialize(config['layer']); + delete config['layer']; + if (config['numConstants'] != null) { + throw new errors_1.NotImplementedError("Deserialization of a Bidirectional layer with numConstants " + + "present is not supported yet."); + } + var newConfig = config; + newConfig['layer'] = rnnLayer; + return new cls(newConfig); + }; + Bidirectional.className = 'Bidirectional'; + return Bidirectional; +}(Wrapper)); +exports.Bidirectional = Bidirectional; +tfjs_core_1.serialization.SerializationMap.register(Bidirectional); +//# sourceMappingURL=wrappers.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js.map new file mode 100644 index 0000000..8996dd0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src/layers/wrappers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,2CAA6C;AAC7C,mDAAkE;AAElE,0CAA2C;AAC3C,2CAA6C;AAC7C,oCAAoC;AACpC,+CAAiF;AACjF,oCAA0D;AAG1D,sDAAwD;AACxD,oDAA6E;AAG7E,yCAAsD;AACtD,iDAA4C;AAkB5C;IAAsC,2BAAK;IAGzC,iBAAY,MAA0B;QAAtC,YAQE,kBAAM,MAAM,CAAC,SAEd;QADC,KAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;;IAC5B,CAAC;IAED,uBAAK,GAAL,UAAM,UAAyB;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAID,sBAAI,8BAAS;aAAb;YAIE,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE;gBACtB,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;aAC7B;iBAAM;gBACL,OAAO,KAAK,CAAC;aACd;QACH,CAAC;aAED,UAAc,KAAc;YAI1B,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;aAC9B;QACH,CAAC;;;OATA;IAWD,sBAAI,qCAAgB;aAApB;YACE,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CA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U,GAAjB,UACI,GAA6C,EAC7C,MAAgC;QAClC,IAAM,QAAQ,GACV,2BAAW,CAAC,MAAM,CAAC,OAAO,CAA6B,CAAQ,CAAC;QACpE,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;QAEvB,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE;YAClC,MAAM,IAAI,4BAAmB,CACzB,6DAA6D;gBAC7D,+BAA+B,CAAC,CAAC;SACtC;QAED,IAAM,SAAS,GAAyB,MAAM,CAAC;QAC/C,SAAS,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;QAC9B,OAAO,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAvTM,uBAAS,GAAG,eAAe,CAAC;IAwTrC,oBAAC;CAAA,AAzTD,CAAmC,OAAO,GAyTzC;AAzTY,sCAAa;AA0T1B,yBAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers_test.js.map new file mode 100644 index 0000000..00e7af2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/layers/wrappers_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wrappers_test.js","sourceRoot":"","sources":["../../src/layers/wrappers_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,iBAqfA;;AArfA,mDAAwG;AAIxG,8BAAgC;AAChC,oEAAiE;AACjE,kDAA+F;AAE/F,+BAAsC;AACtC,yCAA2C;AAC3C,iDAA4C;AAC5C,uCAAgJ;AAIhJ,4BAAe,CAAC,iCAAiC,EAAE;IACjD,EAAE,CAAC,iBAAiB,EAAE;QACpB,IAAM,KAAK,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,C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CAAC,cAAc,CAAC,EAAC,CAAC,CAAC;QACxD,IAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAC,CAAC,CAAC;QACzD,IAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC;YACpC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;gBACpB,KAAK,EAAE,cAAc;aACtB,CAAQ;YACT,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;QACH,MAAM,CAAC,cAAM,OAAA,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;YACzB,YAAY,EAAE,CAAC,UAAU,CAAC;SAC3B,CAAC,EAFW,CAEX,CAAC,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/logs.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/logs.d.ts new file mode 100644 index 0000000..c997c55 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/logs.d.ts @@ -0,0 +1,9 @@ +import { Scalar } from '@tensorflow/tfjs-core'; +export declare type UnresolvedLogs = { + [key: string]: number | Scalar; +}; +export declare function resolveScalarsInLogs(logs: UnresolvedLogs): Promise; +export declare function disposeTensorsInLogs(logs: UnresolvedLogs): void; +export declare type Logs = { + [key: string]: number; +}; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/logs.js b/node_modules/@tensorflow/tfjs-layers/dist/logs.js new file mode 100644 index 0000000..6954c11 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/logs.js @@ -0,0 +1,85 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +function resolveScalarsInLogs(logs) { + return __awaiter(this, void 0, void 0, function () { + var promises, keys, scalarsToDispose, key, value, valueScalar, values, i; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (logs == null) { + return [2]; + } + promises = []; + keys = []; + scalarsToDispose = []; + for (key in logs) { + value = logs[key]; + if (typeof value !== 'number') { + valueScalar = value; + promises.push(valueScalar.data()); + keys.push(key); + scalarsToDispose.push(valueScalar); + } + } + return [4, Promise.all(promises)]; + case 1: + values = _a.sent(); + for (i = 0; i < values.length; ++i) { + logs[keys[i]] = values[i][0]; + } + tfjs_core_1.dispose(scalarsToDispose); + return [2]; + } + }); + }); +} +exports.resolveScalarsInLogs = resolveScalarsInLogs; +function disposeTensorsInLogs(logs) { + if (logs == null) { + return; + } + for (var key in logs) { + var value = logs[key]; + if (typeof value !== 'number') { + value.dispose(); + } + } +} +exports.disposeTensorsInLogs = disposeTensorsInLogs; +//# sourceMappingURL=logs.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/logs.js.map b/node_modules/@tensorflow/tfjs-layers/dist/logs.js.map new file mode 100644 index 0000000..2773560 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/logs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"logs.js","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,mDAAsD;AAgBtD,8BAA2C,IAAoB;;;;;;oBAC7D,IAAI,IAAI,IAAI,IAAI,EAAE;wBAChB,WAAO;qBACR;oBACK,QAAQ,GAAuD,EAAE,CAAC;oBAClE,IAAI,GAAa,EAAE,CAAC;oBACpB,gBAAgB,GAAa,EAAE,CAAC;oBACtC,KAAW,GAAG,IAAI,IAAI,EAAE;wBAChB,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;wBACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;4BACvB,WAAW,GAAG,KAAe,CAAC;4BACpC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;4BAClC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;4BACf,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;yBACpC;qBACF;oBACc,WAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAA;;oBAApC,MAAM,GAAG,SAA2B;oBAC1C,KAAS,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;wBACtC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;qBAC9B;oBAGD,mBAAO,CAAC,gBAAgB,CAAC,CAAC;;;;;CAC3B;AAvBD,oDAuBC;AAQD,8BAAqC,IAAoB;IACvD,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO;KACR;IACD,KAAK,IAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,KAAK,CAAC,OAAO,EAAE,CAAC;SACjB;KACF;AACH,CAAC;AAVD,oDAUC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/losses.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/losses.d.ts new file mode 100644 index 0000000..10d7f45 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/losses.d.ts @@ -0,0 +1,30 @@ +import { Tensor } from '@tensorflow/tfjs-core'; +import { LossOrMetricFn } from './types'; +export declare function l2Normalize(x: Tensor, axis?: number): Tensor; +export declare function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function meanAbsolutePercentageError(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function meanSquaredLogarithmicError(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function hinge(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function logcosh(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function categoricalCrossentropy(target: Tensor, output: Tensor, fromLogits?: boolean): Tensor; +export declare function sparseCategoricalCrossentropy(target: Tensor, output: Tensor, fromLogits?: boolean): Tensor; +export declare function sigmoidCrossEntropyWithLogits(target: Tensor, output: Tensor): Tensor; +export declare function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function kullbackLeiblerDivergence(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function poisson(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor; +export declare const mse: typeof meanSquaredError; +export declare const MSE: typeof meanSquaredError; +export declare const mae: typeof meanAbsoluteError; +export declare const MAE: typeof meanAbsoluteError; +export declare const mape: typeof meanAbsolutePercentageError; +export declare const MAPE: typeof meanAbsolutePercentageError; +export declare const msle: typeof meanSquaredLogarithmicError; +export declare const MSLE: typeof meanSquaredLogarithmicError; +export declare const kld: typeof kullbackLeiblerDivergence; +export declare const KLD: typeof kullbackLeiblerDivergence; +export declare const cosine: typeof cosineProximity; +export declare function get(identifierOrFn: string | LossOrMetricFn): LossOrMetricFn; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/losses.js b/node_modules/@tensorflow/tfjs-layers/dist/losses.js new file mode 100644 index 0000000..b9eae9a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/losses.js @@ -0,0 +1,191 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var common_1 = require("./backend/common"); +var K = require("./backend/tfjs_backend"); +var state_1 = require("./backend/state"); +var errors_1 = require("./errors"); +function l2Normalize(x, axis) { + return tfjs_core_1.tidy(function () { + var squareSum = tfc.sum(K.square(x), axis, true); + var epsilonTensor = tfc.mul(tfjs_core_1.scalar(common_1.epsilon()), tfc.onesLike(x)); + var norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor)); + return tfc.div(x, norm); + }); +} +exports.l2Normalize = l2Normalize; +function meanSquaredError(yTrue, yPred) { + return tfjs_core_1.tidy(function () { return tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1); }); +} +exports.meanSquaredError = meanSquaredError; +function meanAbsoluteError(yTrue, yPred) { + return tfjs_core_1.tidy(function () { return tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1); }); +} +exports.meanAbsoluteError = meanAbsoluteError; +function meanAbsolutePercentageError(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var diff = tfc.sub(yTrue, yPred); + var clippedTrue = tfc.clipByValue(tfc.abs(yTrue), common_1.epsilon(), Number.MAX_VALUE); + var absResult = tfc.abs(tfc.div(diff, clippedTrue)); + return tfc.mul(state_1.getScalar(100.0), tfc.mean(absResult, -1)); + }); +} +exports.meanAbsolutePercentageError = meanAbsolutePercentageError; +function meanSquaredLogarithmicError(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var one = state_1.getScalar(1.0); + var clippedPred = tfc.clipByValue(yPred, common_1.epsilon(), Number.MAX_VALUE); + var firstLog = tfc.log(tfc.add(one, clippedPred)); + var clippedTrue = tfc.clipByValue(yTrue, common_1.epsilon(), Number.MAX_VALUE); + var secondLog = tfc.log(tfc.add(one, clippedTrue)); + return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1); + }); +} +exports.meanSquaredLogarithmicError = meanSquaredLogarithmicError; +function squaredHinge(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var zeroTensor = state_1.getScalar(0.0); + var one = state_1.getScalar(1.0); + var maxResult = tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred))); + return tfc.mean(K.square(maxResult), -1); + }); +} +exports.squaredHinge = squaredHinge; +function hinge(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var zeroTensor = state_1.getScalar(0.0); + var one = state_1.getScalar(1.0); + var maxResult = tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred))); + return tfc.mean(maxResult, -1); + }); +} +exports.hinge = hinge; +function categoricalHinge(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var zeroTensor = state_1.getScalar(0.0); + var one = state_1.getScalar(1.0); + var pos = tfc.sum(tfc.mul(yTrue, yPred), -1); + var neg = tfc.max(tfc.mul(tfc.sub(one, yTrue), yPred), -1); + return tfc.maximum(zeroTensor, tfc.add(one, tfc.sub(neg, pos))); + }); +} +exports.categoricalHinge = categoricalHinge; +function logcosh(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var log2 = state_1.getScalar(Math.log(2.0)); + var predictionDiff = tfc.sub(yPred, yTrue); + var logcoshResult = tfc.sub(tfc.add(predictionDiff, tfc.softplus(tfc.mul(state_1.getScalar(-2.0), predictionDiff))), log2); + return tfc.mean(logcoshResult, -1); + }); +} +exports.logcosh = logcosh; +function categoricalCrossentropy(target, output, fromLogits) { + if (fromLogits === void 0) { fromLogits = false; } + return tfjs_core_1.tidy(function () { + if (fromLogits) { + output = tfc.softmax(output); + } + else { + var outputSum = tfc.sum(output, output.shape.length - 1, true); + output = tfc.div(output, outputSum); + } + output = tfc.clipByValue(output, common_1.epsilon(), 1 - common_1.epsilon()); + return tfc.neg(tfc.sum(tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1)); + }); +} +exports.categoricalCrossentropy = categoricalCrossentropy; +function sparseCategoricalCrossentropy(target, output, fromLogits) { + if (fromLogits === void 0) { fromLogits = false; } + return tfjs_core_1.tidy(function () { + var flatTarget = tfc.floor(K.flatten(target)).toInt(); + var outputShape = output.shape; + var oneHotTarget = tfc.oneHot(flatTarget, outputShape[outputShape.length - 1]) + .reshape(outputShape); + return categoricalCrossentropy(oneHotTarget, output, fromLogits); + }); +} +exports.sparseCategoricalCrossentropy = sparseCategoricalCrossentropy; +function sigmoidCrossEntropyWithLogits(target, output) { + return tfjs_core_1.tidy(function () { + var maxOutput = tfc.maximum(output, tfc.zerosLike(output)); + var outputXTarget = tfc.mul(output, target); + var sigmoidOutput = tfc.log(tfc.add(state_1.getScalar(1), tfc.exp(tfc.neg(tfc.abs(output))))); + var result = tfc.add(tfc.sub(maxOutput, outputXTarget), sigmoidOutput); + return result; + }); +} +exports.sigmoidCrossEntropyWithLogits = sigmoidCrossEntropyWithLogits; +function binaryCrossentropy(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var y; + y = tfc.clipByValue(yPred, common_1.epsilon(), 1 - common_1.epsilon()); + y = tfc.log(tfc.div(y, tfc.sub(tfc.onesLike(y), y))); + return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1); + }); +} +exports.binaryCrossentropy = binaryCrossentropy; +function kullbackLeiblerDivergence(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var clippedTrue = tfc.clipByValue(yTrue, common_1.epsilon(), 1); + var clippedPred = tfc.clipByValue(yPred, common_1.epsilon(), 1); + return tfc.sum(tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1); + }); +} +exports.kullbackLeiblerDivergence = kullbackLeiblerDivergence; +function poisson(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var logPred = tfc.log(tfc.add(state_1.getScalar(common_1.epsilon()), yPred)); + return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1); + }); +} +exports.poisson = poisson; +function cosineProximity(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var trueNormalized = l2Normalize(yTrue, -1); + var predNormalized = l2Normalize(yPred, -1); + var trueXPred = tfc.mul(trueNormalized, predNormalized); + return tfc.neg(tfc.sum(trueXPred, -1)); + }); +} +exports.cosineProximity = cosineProximity; +exports.mse = meanSquaredError; +exports.MSE = meanSquaredError; +exports.mae = meanAbsoluteError; +exports.MAE = meanAbsoluteError; +exports.mape = meanAbsolutePercentageError; +exports.MAPE = meanAbsolutePercentageError; +exports.msle = meanSquaredLogarithmicError; +exports.MSLE = meanSquaredLogarithmicError; +exports.kld = kullbackLeiblerDivergence; +exports.KLD = kullbackLeiblerDivergence; +exports.cosine = cosineProximity; +function get(identifierOrFn) { + var lossesMap = { + meanSquaredError: meanSquaredError, + meanAbsoluteError: meanAbsoluteError, + meanAbsolutePercentageError: meanAbsolutePercentageError, + meanSquaredLogarithmicError: meanSquaredLogarithmicError, + squaredHinge: squaredHinge, + hinge: hinge, + categoricalHinge: categoricalHinge, + logcosh: logcosh, + categoricalCrossentropy: categoricalCrossentropy, + sparseCategoricalCrossentropy: sparseCategoricalCrossentropy, + binaryCrossentropy: binaryCrossentropy, + kullbackLeiblerDivergence: kullbackLeiblerDivergence, + poisson: poisson, + cosineProximity: cosineProximity + }; + if (typeof identifierOrFn === 'string') { + if (identifierOrFn in lossesMap) { + return lossesMap[identifierOrFn]; + } + throw new errors_1.ValueError("Unknown loss " + identifierOrFn); + } + else { + return identifierOrFn; + } +} +exports.get = get; +//# sourceMappingURL=losses.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/losses.js.map b/node_modules/@tensorflow/tfjs-layers/dist/losses.js.map new file mode 100644 index 0000000..f83c16a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/losses.js.map @@ -0,0 +1 @@ +{"version":3,"file":"losses.js","sourceRoot":"","sources":["../src/losses.ts"],"names":[],"mappings":";;AAWA,2CAA6C;AAC7C,mDAAqE;AAErE,2CAAyC;AACzC,0CAA4C;AAC5C,yCAA0C;AAC1C,mCAAoC;AASpC,qBAA4B,CAAS,EAAE,IAAa;IAClD,OAAO,gBAAI,CAAC;QACV,IAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACnD,IAAM,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,kBAAM,CAAC,gBAAO,EAAE,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAClE,IAA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B,+BAAA;QAC7B,kBAAkB,oBAAA;QAClB,yBAAyB,2BAAA;QACzB,OAAO,SAAA;QACP,eAAe,iBAAA;KAChB,CAAC;IACF,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QACtC,IAAI,cAAc,IAAI,SAAS,EAAE;YAC/B,OAAO,SAAS,CAAC,cAAc,CAAC,CAAC;SAClC;QACD,MAAM,IAAI,mBAAU,CAAC,kBAAgB,cAAgB,CAAC,CAAC;KACxD;SAAM;QACL,OAAO,cAAc,CAAC;KACvB;AACH,CAAC;AAzBD,kBAyBC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/losses_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/losses_test.js.map new file mode 100644 index 0000000..310a87b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/losses_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"losses_test.js","sourceRoot":"","sources":["../src/losses_test.ts"],"names":[],"mappings":";;AAcA,2CAA6C;AAC7C,mDAAyE;AAEzE,2CAAyC;AACzC,iCAAmC;AACnC,iDAA6E;AAE7E,kCAAqB,CAAC,kBAAkB,EAAE;IACxC,EAAE,CAAC,IAAI,EAAE;QACP,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAM,KAAK,GAAG,oBAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,IAAM,WAAW,GAAG,kBAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACxD,IAAM,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACrD,+BAAkB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC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C,CAAC,CAAC,CAAC;QACzC,+BAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE;QAC3B,IAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACrC,+BAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/metrics.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/metrics.d.ts new file mode 100644 index 0000000..0c00736 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/metrics.d.ts @@ -0,0 +1,19 @@ +import { Tensor } from '@tensorflow/tfjs-core'; +import { categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss } from './losses'; +import { LossOrMetricFn } from './types'; +export declare function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function sparseCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare function sparseTopKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor; +export declare const mse: typeof meanSquaredError; +export declare const MSE: typeof meanSquaredError; +export declare const mae: typeof meanAbsoluteError; +export declare const MAE: typeof meanAbsoluteError; +export declare const mape: typeof meanAbsolutePercentageError; +export declare const MAPE: typeof meanAbsolutePercentageError; +export declare const categoricalCrossentropy: typeof categoricalCrossentropyLoss; +export declare const cosine: typeof cosineProximity; +export declare const sparseCategoricalCrossentropy: typeof sparseCategoricalCrossentropyLoss; +export declare function get(identifier: string | LossOrMetricFn): LossOrMetricFn; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/metrics.js b/node_modules/@tensorflow/tfjs-layers/dist/metrics.js new file mode 100644 index 0000000..91e03f3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/metrics.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var K = require("./backend/tfjs_backend"); +var state_1 = require("./backend/state"); +var errors_1 = require("./errors"); +var losses_1 = require("./losses"); +var losses_2 = require("./losses"); +function binaryAccuracy(yTrue, yPred) { + return tfjs_core_1.tidy(function () { + var threshold = tfc.mul(state_1.getScalar(0.5), tfc.onesLike(yPred)); + var yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype); + return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1); + }); +} +exports.binaryAccuracy = binaryAccuracy; +function categoricalAccuracy(yTrue, yPred) { + return tfjs_core_1.tidy(function () { return K.cast(tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'); }); +} +exports.categoricalAccuracy = categoricalAccuracy; +function binaryCrossentropy(yTrue, yPred) { + return losses_2.binaryCrossentropy(yTrue, yPred); +} +exports.binaryCrossentropy = binaryCrossentropy; +function sparseCategoricalAccuracy(yTrue, yPred) { + throw new errors_1.NotImplementedError(); +} +exports.sparseCategoricalAccuracy = sparseCategoricalAccuracy; +function topKCategoricalAccuracy(yTrue, yPred) { + throw new errors_1.NotImplementedError(); +} +exports.topKCategoricalAccuracy = topKCategoricalAccuracy; +function sparseTopKCategoricalAccuracy(yTrue, yPred) { + throw new errors_1.NotImplementedError(); +} +exports.sparseTopKCategoricalAccuracy = sparseTopKCategoricalAccuracy; +exports.mse = losses_1.meanSquaredError; +exports.MSE = losses_1.meanSquaredError; +exports.mae = losses_1.meanAbsoluteError; +exports.MAE = losses_1.meanAbsoluteError; +exports.mape = losses_1.meanAbsolutePercentageError; +exports.MAPE = losses_1.meanAbsolutePercentageError; +exports.categoricalCrossentropy = losses_1.categoricalCrossentropy; +exports.cosine = losses_1.cosineProximity; +exports.sparseCategoricalCrossentropy = losses_1.sparseCategoricalCrossentropy; +function get(identifier) { + var metricsMap = { + binaryAccuracy: binaryAccuracy, + categoricalAccuracy: categoricalAccuracy, + categoricalCrossentropy: exports.categoricalCrossentropy, + sparseCategoricalCrossentropy: exports.sparseCategoricalCrossentropy, + mse: exports.mse, + MSE: exports.MSE, + mae: exports.mae, + MAE: exports.MAE, + mape: exports.mape, + MAPE: exports.MAPE, + cosine: exports.cosine, + }; + if (typeof identifier === 'string' && identifier in metricsMap) { + return metricsMap[identifier]; + } + else if (typeof identifier !== 'string' && identifier != null) { + return identifier; + } + else { + throw new errors_1.ValueError("Unknown metric " + identifier); + } +} +exports.get = get; +//# sourceMappingURL=metrics.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/metrics.js.map b/node_modules/@tensorflow/tfjs-layers/dist/metrics.js.map new file mode 100644 index 0000000..f3c4d65 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/metrics.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":";;AAeA,2CAA6C;AAC7C,mDAAmD;AAEnD,0CAA4C;AAC5C,yCAA0C;AAC1C,mCAAyD;AACzD,mCAAuO;AACvO,mCAAsE;AA+BtE,wBAA+B,KAAa,EAAE,KAAa;IACzD,OAAO,gBAAI,CAAC;QACV,IAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,iBAAS,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/D,IAAM,gBA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AA,uBAAuB,GAAG,gCAA2B,CAAC;AACtD,QAAA,MAAM,GAAG,wBAAe,CAAC;AACzB,QAAA,6BAA6B,GAAG,sCAAiC,CAAC;AAI/E,aAAoB,UAAiC;IACnD,IAAM,UAAU,GAA6C;QAC3D,cAAc,gBAAA;QACd,mBAAmB,qBAAA;QACnB,uBAAuB,iCAAA;QACvB,6BAA6B,uCAAA;QAC7B,GAAG,aAAA;QACH,GAAG,aAAA;QACH,GAAG,aAAA;QACH,GAAG,aAAA;QACH,IAAI,cAAA;QACJ,IAAI,cAAA;QACJ,MAAM,gBAAA;KACP,CAAC;IACF,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,IAAI,UAAU,EAAE;QAC9D,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;KAC/B;SAAM,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,IAAI,IAAI,EAAE;QAC/D,OAAO,UAAU,CAAC;KACnB;SAAM;QACL,MAAM,IAAI,mBAAU,CAAC,oBAAkB,UAAY,CAAC,CAAC;KACtD;AACH,CAAC;AArBD,kBAqBC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/metrics_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/metrics_test.js.map new file mode 100644 index 0000000..63ff7f3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/metrics_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metrics_test.js","sourceRoot":"","sources":["../src/metrics_test.ts"],"names":[],"mappings":";;AAcA,mDAAiE;AAEjE,6BAA+B;AAC/B,qCAAmE;AACnE,iDAA6E;AAE7E,kCAAqB,CAAC,gBAAgB,EAAE;IACtC,EAAE,CAAC,UAAU,EAAE;QACb,IAAM,CAAC,GAAG,oBAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C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wBAAc,CAAC,CAAC;QACpD,MAAM,CAAC,aAAG,CAAC,6BAAmB,CAAC,CAAC,CAAC,OAAO,CAAC,6BAAmB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/model_save_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/model_save_test.js.map new file mode 100644 index 0000000..cc070aa --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/model_save_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"model_save_test.js","sourceRoot":"","sources":["../src/model_save_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,iBA4TA;;AA5TA,mDAA+D;AAE/D,6BAA+B;AAG/B,iDAA8F;AAE9F,kCAAqB,CAAC,YAAY,EAAE;IAClC;QAAA;QAOA,CAAC;QAJO,+BAAI,GAAV,UAAW,cAAiC;;;oBAC1C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;oBACrC,WAAO,EAAC,kBAAkB,EAAE,IAAI,EAAC,EAAC;;;SACnC;QACH,uBAAC;IAAD,CAAC,AAPD,IAOC;IAED;QAAA;QAA8C,CAAC;QAAD,qBAAC;IAAD,CAAC,AAA/C,IAA+C;IAE/C,EAAE,CAAC,6BAA6B,EAAE,UAAM,IAAI;;;YACpC,KAAK,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;YAC/B,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;YACnD,OAAO,GAAG,IAAI,gBAAgB,EAAE,CAAC;YAEvC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;iBACd,IAAI,CAAC,UAAA,UAAU;gBACd,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,aAAa,CA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C,CAAC,EAC5C,EAAC,MAAM,EAAE,CAAC,EAAC,CAAC;qBACf,IAAI,CAAC,UAAA,OAAO;oBACX,IAAI,EAAE,CAAC;gBACT,CAAC,CAAC;qBACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;YAC1C,CAAC,CAAC;iBACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;QAC1C,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/model_summary_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/model_summary_test.js.map new file mode 100644 index 0000000..157222a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/model_summary_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"model_summary_test.js","sourceRoot":"","sources":["../src/model_summary_test.ts"],"names":[],"mappings":";;AAYA,6BAA+B;AAC/B,iDAAmD;AAEnD,mCAAmC,MAAW;IAAX,uBAAA,EAAA,WAAW;IAC5C,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,4BAAe,CAAC,eAAe,EAAE;IAC/B,IAAI,iBAA2B,CAAC;IAEhC,UAAU,CAAC;QACT,iBAAiB,GAAG,EAAE,CAAC;QACvB,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAC,OAAgB;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E,SAAS,EAAC,CAAC;aAC/D,KAAK,CAAC,MAAM,CAAyB,CAAC;QAC/C,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,SAAA,EAAC,CAAC,CAAC;QACnD,IAAM,UAAU,GAAG,EAAE,CAAC;QACtB,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC1B,MAAM,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;YAChC,wEAAwE;YACxE,wEAAwE;YACxE,wEAAwE;YACrE,SAAS,+DAA4D;YACxE,wEAAwE;YACrE,SAAS,+DAA4D;YACxE,wEAAwE;YACxE,kBAAkB,EAAE,sBAAsB,EAAE,yBAAyB;YACrE,wEAAwE;SACzE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/models.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/models.d.ts new file mode 100644 index 0000000..17b16bc --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/models.d.ts @@ -0,0 +1,47 @@ +import { io, Scalar, serialization, Tensor } from '@tensorflow/tfjs-core'; +import { History } from './base_callbacks'; +import { Layer } from './engine/topology'; +import { Model, ModelCompileConfig, ModelEvaluateConfig, ModelFitConfig } from './engine/training'; +import { Kwargs, Shape } from './types'; +import { JsonDict } from './types'; +export declare function modelFromJSON(modelAndWeightsConfig: ModelAndWeightsConfig, customObjects?: serialization.ConfigDict): Promise; +export interface ModelAndWeightsConfig { + modelTopology: JsonDict; + weightsManifest?: io.WeightsManifestConfig; + pathPrefix?: string; +} +export interface ModelPredictConfig { + batchSize?: number; + verbose?: boolean; +} +export declare function loadModelInternal(pathOrIOHandler: string | io.IOHandler): Promise; +export declare function loadModelFromIOHandler(handler: io.IOHandler, customObjects?: serialization.ConfigDict): Promise; +export interface SequentialConfig { + layers?: Layer[]; + name?: string; +} +export declare class Sequential extends Model { + static className: string; + private model; + private _updatable; + constructor(config?: SequentialConfig); + add(layer: Layer): void; + pop(): void; + call(inputs: Tensor | Tensor[], kwargs: Kwargs): Tensor | Tensor[]; + build(inputShape?: Shape | Shape[]): void; + countParams(): number; + summary(lineLength?: number, positions?: number[], printFn?: (message?: any, ...optionalParams: any[]) => void): void; + setWeights(weights: Tensor[]): void; + updatable: boolean; + evaluate(x: Tensor | Tensor[], y: Tensor | Tensor[], config?: ModelEvaluateConfig): Scalar | Scalar[]; + predict(x: Tensor | Tensor[], config?: ModelPredictConfig): Tensor | Tensor[]; + predictOnBatch(x: Tensor): Tensor | Tensor[]; + compile(config: ModelCompileConfig): void; + fit(x: Tensor | Tensor[] | { + [inputName: string]: Tensor; + }, y: Tensor | Tensor[] | { + [inputName: string]: Tensor; + }, config?: ModelFitConfig): Promise; + static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; + getConfig(): any; +} diff --git a/node_modules/@tensorflow/tfjs-layers/dist/models.js b/node_modules/@tensorflow/tfjs-layers/dist/models.js new file mode 100644 index 0000000..dcce67e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/models.js @@ -0,0 +1,397 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("./backend/state"); +var input_layer_1 = require("./engine/input_layer"); +var topology_1 = require("./engine/topology"); +var training_1 = require("./engine/training"); +var errors_1 = require("./errors"); +var serialization_1 = require("./layers/serialization"); +var generic_utils = require("./utils/generic_utils"); +var serialization_utils_1 = require("./utils/serialization_utils"); +var types_utils_1 = require("./utils/types_utils"); +function modelFromJSON(modelAndWeightsConfig, customObjects) { + return __awaiter(this, void 0, void 0, function () { + var modelTopology, tsConfig, model, weightValues, uniqueWeightValues, _i, _a, weight, skipMismatches, isNamedTensorMap; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + modelTopology = modelAndWeightsConfig.modelTopology; + if (modelTopology['model_config'] != null) { + modelTopology = modelTopology['model_config']; + } + tsConfig = serialization_utils_1.convertPythonicToTs(modelTopology); + model = serialization_1.deserialize(tsConfig, customObjects); + if (!(modelAndWeightsConfig.weightsManifest != null)) return [3, 2]; + return [4, tfjs_core_1.io.loadWeights(modelAndWeightsConfig.weightsManifest, modelAndWeightsConfig.pathPrefix, model.weights.map(function (weight) { return weight.originalName; }))]; + case 1: + weightValues = _b.sent(); + uniqueWeightValues = {}; + for (_i = 0, _a = model.weights; _i < _a.length; _i++) { + weight = _a[_i]; + uniqueWeightValues[weight.originalName] = + weightValues[weight.originalName]; + } + skipMismatches = null; + isNamedTensorMap = true; + model.loadWeights(uniqueWeightValues, skipMismatches, isNamedTensorMap); + _b.label = 2; + case 2: return [2, model]; + } + }); + }); +} +exports.modelFromJSON = modelFromJSON; +function loadModelInternal(pathOrIOHandler) { + return __awaiter(this, void 0, void 0, function () { + var handlers; + return __generator(this, function (_a) { + if (typeof pathOrIOHandler === 'string') { + handlers = tfjs_core_1.io.getLoadHandlers(pathOrIOHandler); + if (handlers.length === 0) { + handlers.push(tfjs_core_1.io.browserHTTPRequest(pathOrIOHandler)); + } + else if (handlers.length > 1) { + throw new errors_1.ValueError("Found more than one (" + handlers.length + ") load handlers for " + + ("URL '" + pathOrIOHandler + "'")); + } + pathOrIOHandler = handlers[0]; + } + return [2, loadModelFromIOHandler(pathOrIOHandler)]; + }); + }); +} +exports.loadModelInternal = loadModelInternal; +function loadModelFromIOHandler(handler, customObjects) { + return __awaiter(this, void 0, void 0, function () { + var artifacts, modelTopology, model, skipMismatch, isNamedTensorMap; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (handler.load == null) { + throw new errors_1.ValueError('Cannot proceed with model loading because the IOHandler provided ' + + 'does not have the `load` method implemented.'); + } + return [4, handler.load()]; + case 1: + artifacts = _a.sent(); + modelTopology = artifacts.modelTopology; + if (modelTopology['model_config'] != null) { + modelTopology = modelTopology['model_config']; + } + model = serialization_1.deserialize(serialization_utils_1.convertPythonicToTs(modelTopology), customObjects); + if (artifacts.weightData != null) { + if (artifacts.weightSpecs == null) { + throw new errors_1.ValueError('Model artifacts contains weight data, but not weight specs. ' + + 'Therefore loading of weights cannot proceed.'); + } + skipMismatch = false; + isNamedTensorMap = true; + model.loadWeights(tfjs_core_1.io.decodeWeights(artifacts.weightData, artifacts.weightSpecs), skipMismatch, isNamedTensorMap); + } + return [2, model]; + } + }); + }); +} +exports.loadModelFromIOHandler = loadModelFromIOHandler; +var Sequential = (function (_super) { + __extends(Sequential, _super); + function Sequential(config) { + var _this = _super.call(this, { inputs: [], outputs: [] }) || this; + config = config || {}; + _this.trainable = true; + _this._updatable = true; + _this.built = false; + _this.name = (config.name != null) ? config.name : state_1.getUid('sequential_'); + if (config.layers != null) { + for (var _i = 0, _a = config.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + _this.add(layer); + } + } + return _this; + } + Sequential.prototype.add = function (layer) { + var isLayerModelInstance = layer instanceof Sequential || layer instanceof training_1.Model; + var modelLayer; + if (isLayerModelInstance) { + modelLayer = layer; + if (modelLayer.outputs.length !== 1) { + throw new errors_1.ValueError('All layers in a Sequential model ' + + 'should have a single output tensor. ' + + 'For multi-output layers, ' + + 'use the functional API.'); + } + if (modelLayer.inputs.length !== 1) { + throw new errors_1.ValueError('All layers in a Sequential model ' + + 'should have a single input tensor. ' + + 'For multi-input layers, ' + + 'use the functional API.'); + } + } + if (this.outputs.length === 0) { + if (layer.inboundNodes.length === 0) { + if (layer.batchInputShape == null) { + throw new errors_1.ValueError('The first layer in a Sequential model must ' + + 'get an `inputShape` or `batchInputShape` argument.'); + } + var x = input_layer_1.Input({ + batchShape: layer.batchInputShape, + dtype: layer.dtype, + name: layer.name + '_input' + }); + layer.apply(x); + } + if (isLayerModelInstance) { + this.outputs = modelLayer.outputs; + this.inputs = modelLayer.inputs; + } + else { + if (layer.inboundNodes.length !== 1) { + throw new errors_1.ValueError('A layer added to a Sequential model must not already be ' + + ("connected somewhere else. Model received layer " + layer.name + " ") + + ("which has " + layer.inboundNodes.length + " pre-existing inbound ") + + 'connections.'); + } + if (layer.inboundNodes[0].outputTensors.length !== 1) { + throw new errors_1.ValueError('All layers in a Sequential model ' + + 'should have a single output tensor. ' + + 'For multi-output layers, ' + + 'use the functional API.'); + } + this.outputs = [layer.inboundNodes[0].outputTensors[0]]; + this.inputs = topology_1.getSourceInputs(this.outputs[0]); + } + this.inboundNodes = []; + new topology_1.Node({ + outboundLayer: this, + inboundLayers: [], + nodeIndices: [], + tensorIndices: [], + inputTensors: this.inputs, + outputTensors: this.outputs, + inputMasks: generic_utils.pyListRepeat(null, this.inputs.length), + outputMasks: [null], + inputShapes: this.inputs.map(function (x) { return x.shape; }), + outputShapes: this.outputs[0].shape + }); + } + else { + var outputTensor = layer.apply(this.outputs[0]); + if (Array.isArray(outputTensor)) { + throw new TypeError('All layers in a Sequential model ' + + 'should have a single output tensor. ' + + 'For multi-output layers, ' + + 'use the functional API.'); + } + this.outputs = [outputTensor]; + this.inboundNodes[0].outputTensors = this.outputs; + this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; + } + this.layers.push(layer); + this.built = false; + }; + Sequential.prototype.pop = function () { + if (this.layers.length === 0) { + throw new TypeError('There are no layers in the model.'); + } + this.layers.pop(); + if (this.layers.length === 0) { + this.outputs = []; + this.inboundNodes = []; + this.outboundNodes = []; + } + else { + var lastLayerIndex = this.layers.length - 1; + this.layers[lastLayerIndex].outboundNodes = []; + this.outputs = [this.layers[lastLayerIndex].output]; + this.inboundNodes[0].outputTensors = this.outputs; + this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; + } + }; + Sequential.prototype.call = function (inputs, kwargs) { + if (this.model == null) { + this.build(); + } + return this.model.call(inputs, kwargs); + }; + Sequential.prototype.build = function (inputShape) { + types_utils_1.getExactlyOneShape(inputShape); + if (this.inputs.length === 0 || this.outputs.length === 0) { + throw new TypeError('Sequential model cannot be built: model is empty.' + + ' Add some layers first.'); + } + this.model = new training_1.Model({ + inputs: this.inputs, + outputs: this.outputs[0], + name: this.name + '_model' + }); + this.model.trainable = this.trainable; + this.model.updatable = this.updatable; + this.supportsMasking = this.model.supportsMasking; + this.inputLayers = this.model.inputLayers; + this.inputLayersNodeIndices = this.model.inputLayersNodeIndices; + this.inputLayersTensorIndices = this.model.inputLayersTensorIndices; + this.outputLayers = this.model.outputLayers; + this.outputLayersNodeIndices = this.model.outputLayersNodeIndices; + this.outputLayersTensorIndices = this.model.outputLayersTensorIndices; + this.nodesByDepth = this.model.nodesByDepth; + this.containerNodes = this.model.containerNodes; + this.outputNames = this.model.outputNames; + this.inputNames = this.model.inputNames; + this.built = true; + }; + Sequential.prototype.countParams = function () { + if (!this.built) { + this.build(); + } + return _super.prototype.countParams.call(this); + }; + Sequential.prototype.summary = function (lineLength, positions, printFn) { + if (printFn === void 0) { printFn = console.log; } + if (!this.built) { + this.build(); + } + _super.prototype.summary.call(this, lineLength, positions, printFn); + }; + Sequential.prototype.setWeights = function (weights) { + if (this.model == null) { + this.build(); + } + this.model.setWeights(weights); + }; + Object.defineProperty(Sequential.prototype, "updatable", { + get: function () { + return this._updatable; + }, + set: function (value) { + if (this.built) { + this.model.updatable = value; + } + this._updatable = value; + }, + enumerable: true, + configurable: true + }); + Sequential.prototype.evaluate = function (x, y, config) { + if (config === void 0) { config = {}; } + if (!this.built) { + throw new errors_1.RuntimeError('The model needs to be compiled before being used.'); + } + return this.model.evaluate(x, y, config); + }; + Sequential.prototype.predict = function (x, config) { + if (config === void 0) { config = {}; } + if (this.model == null) { + this.build(); + } + return this.model.predict(x, config); + }; + Sequential.prototype.predictOnBatch = function (x) { + if (this.model == null) { + this.build(); + } + return this.model.predictOnBatch(x); + }; + Sequential.prototype.compile = function (config) { + this.build(); + this.model.compile(config); + this.optimizer = this.model.optimizer; + this.loss = this.model.loss; + this.metrics = this.model.metrics; + this.metricsTensors = this.model.metricsTensors; + this.metricsNames = this.model.metricsNames; + }; + Sequential.prototype.fit = function (x, y, config) { + if (config === void 0) { config = {}; } + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (!this.built) { + throw new errors_1.RuntimeError('The model needs to be compiled before ' + + 'being used.'); + } + return [2, this.model.fit(x, y, config)]; + }); + }); + }; + Sequential.fromConfig = function (cls, config) { + var model = new cls({}); + if (!(model instanceof Sequential)) { + throw new errors_1.ValueError("Sequential.fromConfig called on non-Sequential input: " + model); + } + if (!(config instanceof Array)) { + throw new errors_1.ValueError("Sequential.fromConfig called without an array of configs"); + } + if (!(config[0].className != null) || config[0]['className'] === 'Merge') { + throw new errors_1.ValueError('Legacy serialization format not supported yet.'); + } + for (var _i = 0, _a = config; _i < _a.length; _i++) { + var conf = _a[_i]; + var layer = serialization_1.deserialize(conf); + model.add(layer); + } + return model; + }; + Sequential.prototype.getConfig = function () { + var config = []; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + config.push({ + className: layer.getClassName(), + config: layer.getConfig(), + }); + } + return config; + }; + Sequential.className = 'Sequential'; + return Sequential; +}(training_1.Model)); +exports.Sequential = Sequential; +tfjs_core_1.serialization.SerializationMap.register(Sequential); +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/models.js.map b/node_modules/@tensorflow/tfjs-layers/dist/models.js.map new file mode 100644 index 0000000..dbd25b1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/models.js.map @@ -0,0 +1 @@ +{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,mDAAwE;AAExE,yCAAuC;AAEvC,oDAA2C;AAC3C,8CAA+E;AAC/E,8CAAi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,iBAAC;CAAA,AA/dD,CAAgC,gBAAK,GA+dpC;AA/dY,gCAAU;AAgevB,yBAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/models_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/models_test.js.map new file mode 100644 index 0000000..b90ca22 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/models_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"models_test.js","sourceRoot":"","sources":["../src/models_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,iBA88DA;;AA98DA,mDAA8I;AAG9I,6BAA+B;AAC/B,sCAAsC;AACtC,wDAAmD;AACnD,mCAAiF;AAEjF,mEAAgE;AAChE,iDAA8F;AAC9F,qCAAmD;AAInD,4BAAe,CAAC,uBAAuB,EAAE;IACvC,EAAE,CAAC,oDAAoD,EAAE,UAAA,IAAI;QAC3D,IAAM,WAAW,GAAG,GAAG,CAAC,UAAU,CAC9B,EAAC,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,EAAC,CAAC,CAAC;QAC/D,IAAM,CAAC,GAAG,gBAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACvB,IAAM,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAW,CAAC;QAE3C,IAAM,WAAW,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;QACrC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC7B,+BAAkB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAW,EAAE,CAAC,CAAC,CAAC;QAExD,IAAM,WAAW,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;QACrC,WA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;oBAC7C,QAAQ,EAAE;wBACR,UAAU,EAAE,IAAI;wBAChB,kBAAkB,EAAE,IAAI;wBACxB,oBAAoB,EAAE;4BACpB,YAAY,EAAE,iBAAiB;4BAC/B,QAAQ,EAAE;gCACR,cAAc,EAAE,SAAS;gCACzB,OAAO,EAAE,GAAG;gCACZ,MAAM,EAAE,SAAS;gCACjB,MAAM,EAAE,IAAI;6BACb;yBACF;wBACD,kBAAkB,EAAE,EAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAC;wBACzD,mBAAmB,EAAE,IAAI;wBACzB,iBAAiB,EAAE,IAAI;wBACvB,oBAAoB,EAAE,IAAI;wBAC1B,YAAY,EAAE,SAAS;wBACvB,MAAM,EAAE,UAAU;wBAClB,sBAAsB,EAAE,IAAI;wBAC5B,WAAW,EAAE,IAAI;wBACjB,OAAO,EAAE,EAAE;qBACZ;iBACF;aACF;YACD,cAAc,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SACpC;KACF;CACF,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/optimizers.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/optimizers.d.ts new file mode 100644 index 0000000..9f944a5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/optimizers.d.ts @@ -0,0 +1,2 @@ +import { Optimizer } from '@tensorflow/tfjs-core'; +export declare function getOptimizer(identifier: string): Optimizer; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js b/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js new file mode 100644 index 0000000..264270b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var common_1 = require("./backend/common"); +var errors_1 = require("./errors"); +function getOptimizer(identifier) { + var optimizerMap = { + 'Adagrad': function () { return tfjs_core_1.train.adagrad(0.01); }, + 'Adadelta': function () { return tfjs_core_1.train.adadelta(1, 0.95, common_1.epsilon()); }, + 'Adam': function () { return tfjs_core_1.train.adam(0.001, 0.9, 0.999, common_1.epsilon()); }, + 'Adamax': function () { return tfjs_core_1.train.adamax(0.002, 0.9, 0.999, common_1.epsilon(), 0); }, + 'RMSProp': function () { return tfjs_core_1.train.rmsprop(0.001, 0.9, 0, common_1.epsilon()); }, + 'SGD': function () { return tfjs_core_1.train.sgd(0.01); } + }; + optimizerMap['adagrad'] = optimizerMap['Adagrad']; + optimizerMap['adadelta'] = optimizerMap['Adadelta']; + optimizerMap['adam'] = optimizerMap['Adam']; + optimizerMap['adamax'] = optimizerMap['Adamax']; + optimizerMap['rmsprop'] = optimizerMap['RMSProp']; + optimizerMap['sgd'] = optimizerMap['SGD']; + if (identifier in optimizerMap) { + return optimizerMap[identifier](); + } + throw new errors_1.ValueError("Unknown Optimizer " + identifier); +} +exports.getOptimizer = getOptimizer; +//# sourceMappingURL=optimizers.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js.map b/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js.map new file mode 100644 index 0000000..0a887c7 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/optimizers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"optimizers.js","sourceRoot":"","sources":["../src/optimizers.ts"],"names":[],"mappings":";;AAeA,mDAAuD;AAEvD,2CAAyC;AAGzC,mCAAoC;AAMpC,sBAA6B,UAAkB;IAC7C,IAAM,YAAY,GAA+C;QAC/D,SAAS,EAAE,cAAM,OAAA,iBAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAnB,CAAmB;QACpC,UAAU,EAAE,cAAM,OAAA,iBAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAO,EAAE,CAAC,EAAlC,CAAkC;QACpD,MAAM,EAAE,cAAM,OAAA,iBAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,gBAAO,EAAE,CAAC,EAAxC,CAAwC;QACtD,QAAQ,EAAE,cAAM,OAAA,iBAAK,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,gBAAO,EAAE,EAAE,CAAC,CAAC,EAA7C,CAA6C;QAC7D,SAAS,EAAE,cAAM,OAAA,iBAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,gBAAO,EAAE,CAAC,EAAvC,CAAuC;QACxD,KAAK,EAAE,cAAM,OAAA,iBAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAf,CAAe;KAC7B,CAAC;IACF,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAClD,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IACpD,YAAY,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5C,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChD,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAClD,YAAY,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAE1C,IAAI,UAAU,IAAI,YAAY,EAAE;QAC9B,OAAO,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;KACnC;IACD,MAAM,IAAI,mBAAU,CAAC,uBAAqB,UAAY,CAAC,CAAC;AAC1D,CAAC;AApBD,oCAoBC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/optimizers_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/optimizers_test.js.map new file mode 100644 index 0000000..2c1bb0d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/optimizers_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"optimizers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C,mCAAmC,EAAE;QACtC,MAAM,CAAC,cAAM,OAAA,yBAAY,CAAC,kBAAkB,CAAC,EAAhC,CAAgC,CAAC;aAC3C,YAAY,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/regularizers.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/regularizers.d.ts new file mode 100644 index 0000000..f3c6bc0 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/regularizers.d.ts @@ -0,0 +1,34 @@ +import { Scalar, serialization, Tensor } from '@tensorflow/tfjs-core'; +export declare abstract class Regularizer extends serialization.Serializable { + abstract apply(x: Tensor): Scalar; +} +export interface L1L2Config { + l1?: number; + l2?: number; +} +export interface L1Config { + l1: number; +} +export interface L2Config { + l2: number; +} +export declare class L1L2 extends Regularizer { + static className: string; + private readonly l1; + private readonly l2; + private readonly hasL1; + private readonly hasL2; + constructor(config?: L1L2Config); + apply(x: Tensor): Scalar; + getConfig(): serialization.ConfigDict; + static fromConfig(cls: serialization.SerializableConstructor, config: serialization.ConfigDict): T; +} +export declare function l1(config?: L1Config): L1L2; +export declare function l2(config: L2Config): L1L2; +export declare type RegularizerIdentifier = 'l1l2' | string; +export declare const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP: { + [identifier in RegularizerIdentifier]: string; +}; +export declare function serializeRegularizer(constraint: Regularizer): serialization.ConfigDictValue; +export declare function deserializeRegularizer(config: serialization.ConfigDict, customObjects?: serialization.ConfigDict): Regularizer; +export declare function getRegularizer(identifier: RegularizerIdentifier | serialization.ConfigDict | Regularizer): Regularizer; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js b/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js new file mode 100644 index 0000000..cf6694b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js @@ -0,0 +1,102 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("./backend/state"); +var K = require("./backend/tfjs_backend"); +var generic_utils_1 = require("./utils/generic_utils"); +var Regularizer = (function (_super) { + __extends(Regularizer, _super); + function Regularizer() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Regularizer; +}(tfjs_core_1.serialization.Serializable)); +exports.Regularizer = Regularizer; +var L1L2 = (function (_super) { + __extends(L1L2, _super); + function L1L2(config) { + var _this = _super.call(this) || this; + var l1 = config == null || config.l1 == null ? 0.01 : config.l1; + var l2 = config == null || config.l2 == null ? 0.01 : config.l2; + _this.hasL1 = l1 !== 0; + _this.hasL2 = l2 !== 0; + _this.l1 = state_1.getScalar(l1); + _this.l2 = state_1.getScalar(l2); + return _this; + } + L1L2.prototype.apply = function (x) { + var _this = this; + return tfjs_core_1.tidy(function () { + var regularization = tfjs_core_1.zeros([1]); + if (_this.hasL1) { + regularization = tfjs_core_1.add(regularization, tfjs_core_1.sum(tfc.mul(_this.l1, tfjs_core_1.abs(x)))); + } + if (_this.hasL2) { + regularization = + tfjs_core_1.add(regularization, tfjs_core_1.sum(tfc.mul(_this.l2, K.square(x)))); + } + return regularization.asScalar(); + }); + }; + L1L2.prototype.getConfig = function () { + return { 'l1': this.l1.dataSync()[0], 'l2': this.l2.dataSync()[0] }; + }; + L1L2.fromConfig = function (cls, config) { + return new cls({ l1: config.l1, l2: config.l2 }); + }; + L1L2.className = 'L1L2'; + return L1L2; +}(Regularizer)); +exports.L1L2 = L1L2; +tfjs_core_1.serialization.SerializationMap.register(L1L2); +function l1(config) { + return new L1L2({ l1: config != null ? config.l1 : null, l2: 0 }); +} +exports.l1 = l1; +function l2(config) { + return new L1L2({ l2: config != null ? config.l2 : null, l1: 0 }); +} +exports.l2 = l2; +exports.REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { + 'l1l2': 'L1L2' +}; +function serializeRegularizer(constraint) { + return generic_utils_1.serializeKerasObject(constraint); +} +exports.serializeRegularizer = serializeRegularizer; +function deserializeRegularizer(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return generic_utils_1.deserializeKerasObject(config, tfjs_core_1.serialization.SerializationMap.getMap().classNameMap, customObjects, 'regularizer'); +} +exports.deserializeRegularizer = deserializeRegularizer; +function getRegularizer(identifier) { + if (identifier == null) { + return null; + } + if (typeof identifier === 'string') { + var className = identifier in exports.REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? + exports.REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : + identifier; + var config = { className: className, config: {} }; + return deserializeRegularizer(config); + } + else if (identifier instanceof Regularizer) { + return identifier; + } + else { + return deserializeRegularizer(identifier); + } +} +exports.getRegularizer = getRegularizer; +//# sourceMappingURL=regularizers.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js.map b/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js.map new file mode 100644 index 0000000..b197c0b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/regularizers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regularizers.js","sourceRoot":"","sources":["../src/regularizers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAaA,2CAA6C;AAC7C,mDAAgG;AAEhG,yCAA0C;AAC1C,0CAA4C;AAC5C,uDAAmF;AAMnF;IAA0C,+BAA0B;IAApE;;IAEA,CAAC;IAAD,kBAAC;AAAD,CAAC,AAFD,CAA0C,yBAAa,CAAC,YAAY,GAEnE;A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AAgB,CAAC,MAAM,EAAE,CAAC,YAAY,EAC5D,aAAa,EAAE,aAAa,CAAC,CAAC;AACpC,CAAC;AAND,wDAMC;AAED,wBAA+B,UAEW;IACxC,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,IAAM,SAAS,GAAG,UAAU,IAAI,kDAA0C,CAAC,CAAC;YACxE,kDAA0C,CAAC,UAAU,CAAC,CAAC,CAAC;YACxD,UAAU,CAAC;QACf,IAAM,MAAM,GAAG,EAAC,SAAS,WAAA,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC;QACvC,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC;KACvC;SAAM,IAAI,UAAU,YAAY,WAAW,EAAE;QAC5C,OAAO,UAAU,CAAC;KACnB;SAAM;QACL,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAC;KAC3C;AACH,CAAC;AAjBD,wCAiBC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/regularizers_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/regularizers_test.js.map new file mode 100644 index 0000000..7a2569a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/regularizers_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regularizers_test.js","sourceRoot":"","sources":["../src/regularizers_test.ts"],"names":[],"mappings":";;AAYA,mDAA8E;AAE9E,6BAA+B;AAE/B,+CAA4F;AAC5F,iDAAuE;AAIvE,4BAAe,CAAC,uBAAuB,EAAE;IACvC,EAAE,CAAC,OAAO,EAAE;QACV,IAAM,CAAC,GAAG,oBAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,IAAM,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QAC5C,IAAM,KAAK,GAAG,WAAW,CAAC,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AAC;QACnC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.esm.js b/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.esm.js new file mode 100644 index 0000000..51103da --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.esm.js @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +import{keep,scalar,tidy,onesLike,tensor1d,util,zerosLike,train,cast,serialization,add,mul,div,Tensor,Optimizer,mean,io,transpose,reverse,zeros,sum,dispose,neg,variable,ones,eye,randomUniform,truncatedNormal,randomNormal,sub,sqrt,mulStrict,clipByValue,relu,linalg,leakyRelu,elu,conv1d,conv2d,conv2dTranspose,separableConv2d,depthwiseConv2d,maximum,minimum,batchNormalization2d,batchNormalization3d,batchNormalization4d,moments,movingAverage,pad,maxPool,avgPool,squeeze,max,abs,log,softplus,softmax,floor,oneHot,exp,greater,equal,argMax,slice1d,slice2d,slice3d,slice4d,concat,concat1d,concat2d,concat3d,concat4d,tile,matMul,gather,step,min,selu,sigmoid,tanh}from"@tensorflow/tfjs-core";var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]t?1:0}function reverseNumberCompare(e,t){return-1*numberCompare(e,t)}function stringToDType(e){switch(e){case"float32":return"float32";default:throw new ValueError("Invalid dtype: "+e)}}function unique(e){if(null==e)return e;for(var t=[],n=0,r=e;n=0),assert(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every(function(e){return typeof e===t})}function calcL2Norms(e,t){return tidy(function(){return sqrt(sum(mulStrict(e,e),t,!0))})}var Constraint=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getConfig=function(){return{}},t}(serialization.Serializable),MaxNorm=function(e){function t(t){var n=e.call(this)||this;return n.defaultMaxValue=2,n.defaultAxis=0,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return __extends(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){var n=calcL2Norms(e,t.axis),r=clipByValue(n,0,t.maxValue);return mul(e,div(r,add(getScalar(epsilon()),n)))})},t.prototype.getConfig=function(){return{maxValue:this.maxValue,axis:this.axis}},t.className="MaxNorm",t}(Constraint);serialization.SerializationMap.register(MaxNorm);var UnitNorm=function(e){function t(t){var n=e.call(this)||this;return n.defaultAxis=0,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return __extends(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){return div(e,add(getScalar(epsilon()),calcL2Norms(e,t.axis)))})},t.prototype.getConfig=function(){return{axis:this.axis}},t.className="UnitNorm",t}(Constraint);serialization.SerializationMap.register(UnitNorm);var NonNeg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.apply=function(e){return relu(e)},t.className="NonNeg",t}(Constraint);serialization.SerializationMap.register(NonNeg);var MinMaxNorm=function(e){function t(t){var n=e.call(this)||this;return n.defaultMinValue=0,n.defaultMaxValue=1,n.defaultRate=1,n.defaultAxis=0,n.minValue=null!=t.minValue?t.minValue:n.defaultMinValue,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.rate=null!=t.rate?t.rate:n.defaultRate,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return __extends(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){var n=calcL2Norms(e,t.axis),r=add(mul(getScalar(t.rate),clipByValue(n,t.minValue,t.maxValue)),mul(getScalar(1-t.rate),n));return mul(e,div(r,add(getScalar(epsilon()),n)))})},t.prototype.getConfig=function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}},t.className="MinMaxNorm",t}(Constraint);serialization.SerializationMap.register(MinMaxNorm);var CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function serializeConstraint(e){return serializeKerasObject(e)}function deserializeConstraint(e,t){return void 0===t&&(t={}),deserializeKerasObject(e,serialization.SerializationMap.getMap().classNameMap,t,"constraint")}function getConstraint(e){return null==e?null:"string"==typeof e?deserializeConstraint({className:e in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP?CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[e]:e,config:{}}):e instanceof Constraint?e:deserializeConstraint(e)}function maxNorm(e){return new MaxNorm(e)}function unitNorm(e){return new UnitNorm(e)}function nonNeg(){return new NonNeg}function minMaxNorm(e){return new MinMaxNorm(e)}var exports_constraints=Object.freeze({maxNorm:maxNorm,unitNorm:unitNorm,nonNeg:nonNeg,minMaxNorm:minMaxNorm}),nameMap=new Map,VALID_DATA_FORMAT_VALUES=["channelsFirst","channelsLast"];function checkDataFormat(e){checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES,"DataFormat",e)}var VALID_PADDING_MODE_VALUES=["valid","same","causal"];function checkPaddingMode(e){checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES,"PaddingMode",e)}var VALID_POOL_MODE_VALUES=["max","avg"];function checkPoolMode(e){checkStringTypeUnionValue(VALID_POOL_MODE_VALUES,"PoolMode",e)}var _nameScopeStack=[],_nameScopeDivider="/";function nameScope(e,t){_nameScopeStack.push(e);try{var n=t();return _nameScopeStack.pop(),n}catch(e){throw _nameScopeStack.pop(),e}}function currentNameScopePrefix(){return 0===_nameScopeStack.length?"":_nameScopeStack.join(_nameScopeDivider)+_nameScopeDivider}function getScopedTensorName(e){if(!isValidTensorName(e))throw new Error("Not a valid tensor name: '"+e+"'");return currentNameScopePrefix()+e}function getUniqueTensorName(e){if(!isValidTensorName(e))throw new Error("Not a valid tensor name: '"+e+"'");nameMap.has(e)||nameMap.set(e,0);var t=nameMap.get(e);if(nameMap.set(e,nameMap.get(e)+1),t>0){var n=e+"_"+t;return nameMap.set(n,1),n}return e}var tensorNameRegex=new RegExp(/^[A-Za-z][A-Za-z0-9\._\/]*$/);function isValidTensorName(e){return!!e.match(tensorNameRegex)}function isInteger(e){return e===parseInt(e.toString(),10)}function arrayProd(e,t,n){null==t&&(t=0),null==n&&(n=e.length);for(var r=1,i=t;i2e3&&console.warn("Orthogonal initializer is being called on a matrix with more than 2000 ("+e[0]*e[1]+") elements: Slowness may result.");var t=randomNormal$1(e[0]>e[1]?[e[1],e[0]]:e,0,1,"float32"),r=linalg.gramSchmidt(t);return e[0]>e[1]&&(r=r.transpose()),mul(getScalar(n.gain),r)})},t.prototype.getConfig=function(){return{gain:this.gain,seed:this.seed}},t.className="Orthogonal",t}(Initializer);serialization.SerializationMap.register(Orthogonal);var INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",identity:"Identity",leCunNormal:"LeCunNormal",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function deserializeInitializer(e,t){return void 0===t&&(t={}),deserializeKerasObject(e,serialization.SerializationMap.getMap().classNameMap,t,"initializer")}function serializeInitializer(e){return serializeKerasObject(e)}function getInitializer(e){if("string"==typeof e){var t=e in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP?INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[e]:e;return"GlorotUniform"===t?new GlorotUniform:"GlorotNormal"===t?new GlorotNormal:"HeNormal"===t?new HeNormal:"LeCunNormal"===t?new LeCunNormal:deserializeInitializer({className:t,config:{}})}return e instanceof Initializer?e:deserializeInitializer(e)}function zeros$1(){return new Zeros}function ones$1(){return new Ones}function constant(e){return new Constant(e)}function randomUniform$1(e){return new RandomUniform(e)}function randomNormal$2(e){return new RandomNormal(e)}function truncatedNormal$1(e){return new TruncatedNormal(e)}function identity(e){return new Identity(e)}function varianceScaling(e){return new VarianceScaling(e)}function glorotUniform(e){return new GlorotUniform(e)}function glorotNormal(e){return new GlorotNormal(e)}function heNormal(e){return new HeNormal(e)}function leCunNormal(e){return new LeCunNormal(e)}function orthogonal(e){return new Orthogonal(e)}var exports_initializers=Object.freeze({zeros:zeros$1,ones:ones$1,constant:constant,randomUniform:randomUniform$1,randomNormal:randomNormal$2,truncatedNormal:truncatedNormal$1,identity:identity,varianceScaling:varianceScaling,glorotUniform:glorotUniform,glorotNormal:glorotNormal,heNormal:heNormal,leCunNormal:leCunNormal,orthogonal:orthogonal});function isArrayOfShapes(e){return Array.isArray(e)&&Array.isArray(e[0])}function normalizeShapeList(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function getExactlyOneTensor(e){var t;if(Array.isArray(e)){if(1!==e.length)throw new ValueError("Expected Tensor length to be 1; got "+e.length);t=e[0]}else t=e;return t}function getExactlyOneShape(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return(e=e)[0];throw new ValueError("Expected exactly 1 Shape; got "+e.length)}return e}function countParamsInWeights(e){for(var t=0,n=0,r=e;n1)throw new AttributeError("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new AttributeError("Layer "+this.name+" is not connected, no input to return.");return singletonOrArray(this.getNodeAtIndex(0,"input").inputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){if(0===this.inboundNodes.length)throw new AttributeError("Layer "+this.name+" has no inbound nodes.");if(this.inboundNodes.length>1)throw new AttributeError("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return singletonOrArray(this.getNodeAtIndex(0,"output").outputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"losses",{get:function(){return this._losses},enumerable:!0,configurable:!0}),t.prototype.calculateLosses=function(){return this.losses.map(function(e){return e()})},Object.defineProperty(t.prototype,"updates",{get:function(){return this._updates},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"built",{get:function(){return this._built},set:function(e){this._built=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.trainable?this._trainableWeights:[]},set:function(e){this._trainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this._nonTrainableWeights:this._trainableWeights.concat(this._nonTrainableWeights)},set:function(e){this._nonTrainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"weights",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stateful",{get:function(){return this._stateful},enumerable:!0,configurable:!0}),t.prototype.assertInputCompatibility=function(e){if(e=toList(e),null!=this.inputSpec&&0!==this.inputSpec.length){var t=toList(this.inputSpec);if(e.length!==t.length)throw new ValueError("Layer "+this.name+" expects "+t.length+" inputs, but it received "+e.length+" input tensors. Input received: "+e);for(var n=0;n=0?o[l]:o[o.length+l];if(null!=u&&-1===[u,null].indexOf(c))throw new ValueError("Input "+n+" is incompatible with layer "+this.name+": expected axis "+l+" of input shape to have value "+u+" but got shape "+o+".")}}if(null!=i.shape)for(var p=0;p0&&Array.isArray(g[0])?g.map(function(r,i){return new SymbolicTensor(m,r,n,toList(e),t,n.name,i)}):new SymbolicTensor(m,g,n,toList(e),t,n.name),n.addInboundNode(e,f,null,null,d,g,t),null!=n.activityRegularizer)throw new NotImplementedError("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return f})},t.prototype.warnOnIncompatibleInputShape=function(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn("The rank of the input tensor provided (shape: "+JSON.stringify(e)+") does not match that of the batchInputShape ("+JSON.stringify(this.batchInputShape)+") of the layer "+this.name);else{var t=!1;this.batchInputShape.forEach(function(n,r){null!=n&&null!=e[r]&&e[r]!==n&&(t=!0)}),t&&console.warn("The shape of the input tensor ("+JSON.stringify(e)+") does not match the expectation of layer "+this.name+": "+JSON.stringify(this.batchInputShape))}},Object.defineProperty(t.prototype,"outputShape",{get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new AttributeError("The layer "+this.name+" has never been called and thus has no defined output shape.");for(var e=[],t=0,n=this.inboundNodes;t0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];var r=t.inboundNodes[n];if(0===r.inboundLayers.length)return r.inputTensors;for(var i=[],a=0;a1||1===s.length&&s[0].inboundLayers.length>1){t=!1;break}r.push.apply(r,s)}if(t)for(var l=0,u=e.layers;l0&&(r=r.slice(0,r.length-1)+" "),r=(r+=e[i]).slice(0,t[i]),r+=" ".repeat(t[i]-r.length);n(r)}function printLayerSummary(e,t,n){var r;try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}printRow([e.name+" ("+e.getClassName()+")",r,e.countParams().toString()],t,n)}function printLayerSummaryWithConnections(e,t,n,r){var i;try{i=JSON.stringify(e.outputShape)}catch(e){i="multiple"}for(var a=[],o=0,s=e.inboundNodes;o0&&-1===n.indexOf(l)))for(var u=0;u0)throw new ValueError(p.length+" of "+r+" weights are not set: "+p);batchSetValue(u)}var Container=function(e){function t(n){var r=e.call(this,{})||this;if(r.containerNodes=new Set,r.name=n.name,null==r.name){var i=r.getClassName().toLowerCase();r.name=getUid(i)}if(r.supportsMasking=!1,r.trainable=!0,r.updatable=!0,Array.isArray(n.inputs)?r.inputs=n.inputs.slice():r.inputs=[n.inputs],Array.isArray(n.outputs)?r.outputs=n.outputs.slice():r.outputs=[n.outputs],unique(r.inputs).length!==r.inputs.length)throw new ValueError("The list of inputs passed to the model is redundant. All inputs should only appear once. Found: "+r.inputs.map(function(e){return e.name}));unique(r.outputs).length!==r.outputs.length&&console.warn("The list of outputs passed to the model is redundant. All outputs should only appear once. Found: "+r.outputs.map(function(e){return e.name})),r.inputLayers=[],r.inputLayersNodeIndices=[],r.inputLayersTensorIndices=[],r.outputLayers=[],r.outputLayersNodeIndices=[],r.outputLayersTensorIndices=[],r.layers=[];for(var a=0,o=r.outputs;a1 nodes"),assert(0===u,"input layer has >1 tensors"),r.inputLayers.push(s),r.inputLayersNodeIndices.push(l),r.inputLayersTensorIndices.push(u)}r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var h=0;h=0;)i.splice(i.indexOf(l),1);z.push(l)}},S=[],A=[],I=0,N=r.outputs;Ir?1:0});for(var j=0,W=U;j0)throw new ValueError("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];for(var e=[],t=0,n=this.layers;t1)for(var s=0,l=o;s0){for(var d=[],g=0;g0&&e.apply(singletonOrArray(a),r)}function o(e){var r=e.name,a=deserialize(e,null!=t.customObjects?t.customObjects:{});n[r]=a;for(var o=0,s=e.inboundNodes;o0)a=!0;else if(isDataDict(e)){for(var o in e)if(e.hasOwnProperty(o)){a=!0;break}}else a=!0;if(a)throw new ValueError("Error when checking model "+i+" expected no data, but got "+e)}return[]}if(null==e)return t.map(function(e){return null});var s;if(isDataDict(e)){e=e,s=[];for(var l=0,u=t;l1)throw new ValueError("The model "+i+" expects "+t.length+" Tensor(s), but only received one Tensor. Found: Tensor with shape "+e.shape);s=[e]}for(var p=0;p=0&&g!==f)throw new ValueError("Error when checking "+i+": expected "+t[p]+" to have shape ["+n[p]+"], but got array with shape ["+h.shape+"].")}}return s}function checkArrayLengths(e,t,n){var r=unique(e.map(function(e){return e.shape[0]}));r.sort();var i=unique(t.map(function(e){return e.shape[0]}));if(i.sort(),r.length>1)throw new ValueError("All input Tensors (x) should have the same number of samples. Got array shapes: "+JSON.stringify(e.map(function(e){return e.shape})));if(i.length>1)throw new ValueError("All target Tensors (y) should have the same number of samples. Got array shapes: "+JSON.stringify(t.map(function(e){return e.shape})));if(r.length>0&&i.length>0&&!util.arraysEqual(r,i))throw new ValueError("Input Tensors should have the same number of samples as target Tensors. Found "+r[0]+" input sample(s) and "+i[0]+" target sample(s).")}function checkLossAndTargetCompatibility(e,t,n){for(var r=[meanSquaredError,binaryCrossentropy,categoricalCrossentropy],i=0;i=e&&(i=e),n.push([r,i]),r=i;return n}function sliceArrays(e,t,n){return null==e?[null]:Array.isArray(e)?e.map(function(e){return sliceAlongFirstAxis(e,t,n-t)}):sliceAlongFirstAxis(e,t,n-t)}function sliceArraysByIndices(e,t){return tidy(function(){return null==e?null:Array.isArray(e)?e.map(function(e){return sliceArraysByIndices(e,t)}):gather$1(e,"int32"===t.dtype?t:t.toInt())})}function checkInputData(e,t,n,r,i){var a;if(void 0===r&&(r=!0),void 0===i&&(i=""),Array.isArray(e)){if(e.length!==t.length)throw new ValueError("Error when checking model "+i+": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see "+t.length+" Tensor(s), but instead got "+e.length+" Tensors(s).");a=e}else{if(t.length>1)throw new ValueError("The model expects "+t.length+" "+i+" Tensors, but only received one Tensor. Found: array with shape "+JSON.stringify(e.shape)+".");a=[e]}if(null!=n)for(var o=0;o1&&(t.metricsTensors.push([n,e]),t.metricsNames.push(t.outputNames[e]+"_loss"))}});var p=collectMetrics(e.metrics,this.outputNames);nameScope("metric",function(){for(var e=function(e){if(-1!==c.indexOf(e))return"continue";!function(n){for(var r,i,a,o=function(n){if(-1!==["accuracy","acc","crossentropy","ce"].indexOf(n)){var o=t.internalOutputShapes[e];1===o[o.length-1]||t.lossFunctions[e]===binaryCrossentropy?-1!==["accuracy","acc"].indexOf(n)?i=binaryAccuracy:-1!==["crossentropy","ce"].indexOf(n)&&(i=binaryCrossentropy$1):t.lossFunctions[e]===sparseCategoricalCrossentropy?-1!==["accuracy","acc"].indexOf(n)?i=sparseCategoricalAccuracy:-1!==["crossentropy","ce"].indexOf(n)&&(i=sparseCategoricalCrossentropy$1):-1!==["accuracy","acc"].indexOf(n)?i=categoricalAccuracy:-1!==["crossentropy","ce"].indexOf(n)&&(i=categoricalCrossentropy$1);var s=void 0;-1!==["accuracy","acc"].indexOf(n)?s="acc":-1!==["crossentropy","ce"].indexOf(n)&&(s="ce"),a=i,r=""+s}else{var l=get$1(n);a=l,r=""+n}var u;nameScope(r,function(){u=a}),function(e,n,r){t.outputNames.length>1&&(n=t.outputNames[e]+"_"+n),t.metricsNames.push(n),t.metricsTensors.push([r,e])}(e,r,u)},s=0,l=n;s0){var c=[];throw t.forEach(function(t,n){null==t&&c.push(e[n])}),new ValueError("Cannot find SymbolicTensors for output name(s): "+JSON.stringify(c))}return t},t.prototype.predictLoop=function(e,t,n){var r=this;return void 0===t&&(t=32),void 0===n&&(n=!1),tidy(function(){var i=r.checkNumSamples(e);if(n)throw new NotImplementedError("Verbose predictLoop() is not implemented yet.");for(var a=makeBatches(i,t),o=[],s=function(t){var n=tidy(function(){var n=a[t][0],i=a[t][1],o=sliceArrays(e,n,i),s=[];if(Array.isArray(o))for(var l=0;l0&&e[0].shape[0]%r!=0)throw new ValueError("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size "+r+". Found: "+e[0].shape[0]+" sample(s).");return[e,t,null]},t.prototype.fitLoop=function(e,t,n,r,i,a,o,s,l,u,c,p,h,d){return __awaiter(this,void 0,void 0,function(){var g,f,m,y,v,b,z,w=this;return __generator(this,function(S){switch(S.label){case 0:if(null==r&&(r=32),null==i&&(i=1),null==u&&(u=!0),null==p&&(p=0),g=!1,null!=s&&null!=l&&(g=!0),null!=d&&(g=!0,null==h))throw new ValueError("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");if(null!=(f=this.checkNumSamples(t,r,h,"steps_per_epoch"))&&(m=range(0,f)),this.history=new History,o=(o=null==o?[new BaseLogger]:[new BaseLogger].concat(o)).concat([this.history]),a>0)throw new NotImplementedError("Verbose mode is not implemented yet.");return(y=new CallbackList(o)).setModel(this),y.setParams({epochs:i,initialEpoch:p,steps:h,verbose:a,doValidation:g,metrics:c}),[4,y.onTrainBegin()];case 1:S.sent(),this.stopTraining=!1,v=function(i){var a,o,c,p,d;return __generator(this,function(v){switch(v.label){case 0:return[4,y.onEpochBegin(i)];case 1:if(v.sent(),a={},null==h)return[3,2];throw new NotImplementedError("stepsPerEpoch mode is not implemented yet.");case 2:if("batch"===u)throw new NotImplementedError("batch shuffling is not implemneted yet");u&&util.shuffle(m),o=tensor1d(m),c=makeBatches(f,r),p=function(i){var u;return __generator(this,function(p){switch(p.label){case 0:return u={},[4,y.onBatchBegin(i,u)];case 1:return p.sent(),tidy(function(){var p=c[i][0],h=c[i][1],d=sliceAlongFirstAxis(o,p,h-p);u.batch=i,u.size=h-p;for(var f=sliceArraysByIndices(t,d),m=e(f),y=0;y1)i+="_"+count(e.slice(0,n),r);t.push(i)}return t},t.prototype.makeTestFunction=function(){var e=this;this.testFunction=function(t){return tidy(function(){for(var n,r=[],i=t.slice(0,e.inputs.length),a=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),o=[],s=0;s0){if(s=!0,2!==n.validationData.length)throw 3===n.validationData.length?new NotImplementedError("validationData including sample weights is not supported yet."):new ValueError("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; "+n.validationData+" is invalid.");l=n.validationData[0],u=n.validationData[1],h=this.standardizeUserData(l,u,!0,r),l=h[0],u=h[1],c=l.concat(u)}else null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1?(s=!0,d=Math.floor(a[0].shape[0]*(1-n.validationSplit)),g=a[0].shape[0],l=sliceArrays(a,d,g),a=sliceArrays(a,0,d),u=sliceArrays(o,d,g),o=sliceArrays(o,0,d),p=!0,c=l.concat(u)):null!=n.validationSteps&&(s=!0);return f=a.concat(o),this.checkTrainableWeightsConsistency(),m=function(e){var t=e.slice(0,S.inputs.length),n=e.slice(S.inputs.length,S.inputs.length+S.outputs.length),r=[],i=S.collectedTrainableWeights.map(function(e){return e.read()});return[S.optimizer.minimize(function(){for(var e=[],i=0;i1)throw new ValueError("Found more than one ("+n.length+") save handlers for URL '"+e+"'");e=n[0]}if(null==e.save)throw new ValueError("Model.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return[4,io.encodeWeights(this.getNamedWeights(t))];case 1:return r=s.sent(),i=!1,a=null,o=this.toJSON(a,i),[2,e.save({modelTopology:o,weightData:r.data,weightSpecs:r.specs})]}})})},t.className="Model",t}(Container);function loadModelInternal(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){if("string"==typeof e){if(0===(t=io.getLoadHandlers(e)).length)t.push(io.browserHTTPRequest(e));else if(t.length>1)throw new ValueError("Found more than one ("+t.length+") load handlers for URL '"+e+"'");e=t[0]}return[2,loadModelFromIOHandler(e)]})})}function loadModelFromIOHandler(e,t){return __awaiter(this,void 0,void 0,function(){var n,r,i,a,o;return __generator(this,function(s){switch(s.label){case 0:if(null==e.load)throw new ValueError("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");return[4,e.load()];case 1:if(n=s.sent(),null!=(r=n.modelTopology).model_config&&(r=r.model_config),i=deserialize(convertPythonicToTs(r),t),null!=n.weightData){if(null==n.weightSpecs)throw new ValueError("Model artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");a=!1,o=!0,i.loadWeights(io.decodeWeights(n.weightData,n.weightSpecs),a,o)}return[2,i]}})})}serialization.SerializationMap.register(Model);var Sequential=function(e){function t(t){var n=e.call(this,{inputs:[],outputs:[]})||this;if(t=t||{},n.trainable=!0,n._updatable=!0,n.built=!1,n.name=null!=t.name?t.name:getUid("sequential_"),null!=t.layers)for(var r=0,i=t.layers;r 0 but got "+JSON.stringify(e.filters))},t}(BaseConv),Conv2D=function(e){function t(n){var r=e.call(this,2,n)||this;return t.verifyConfig(n),r}return __extends(t,e),t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.rank,t},t.verifyConfig=function(e){if("number"!=typeof e.kernelSize&&!checkArrayTypeAndLength(e.kernelSize,"number",1,2))throw new ValueError("Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received "+JSON.stringify(e.kernelSize)+".")},t.className="Conv2D",t}(Conv);serialization.SerializationMap.register(Conv2D);var Conv2DTranspose=function(e){function t(t){var n=e.call(this,t)||this;if(n.inputSpec=[new InputSpec({ndim:4})],"same"!==n.padding&&"valid"!==n.padding)throw new ValueError("Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode "+n.padding);return n}return __extends(t,e),t.prototype.build=function(e){if(4!==(e=getExactlyOneShape(e)).length)throw new ValueError("Input should have rank 4; Received input shape: "+JSON.stringify(e));var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ValueError("The channel dimension of the inputs should be defined. Found `None`.");var n,r=e[t],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new InputSpec({ndim:4,axes:(n={},n[t]=r,n)})],this.built=!0},t.prototype.call=function(e,t){var n=this;return tidy(function(){var t=getExactlyOneTensor(e);if(4!==t.shape.length)throw new ValueError("Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-"+t.shape.length);var r,i,a=t.shape,o=a[0];"channelsFirst"===n.dataFormat?(r=2,i=3):(r=1,i=2);var s=a[r],l=a[i],u=n.kernelSize[0],c=n.kernelSize[1],p=n.strides[0],h=n.strides[1],d=[o,deconvLength(s,p,u,n.padding),deconvLength(l,h,c,n.padding),n.filters];"channelsLast"!==n.dataFormat&&(t=transpose(t,[0,2,3,1]));var g=conv2dTranspose(t,n.kernel.read(),d,n.strides,n.padding);return"channelsLast"!==n.dataFormat&&(g=transpose(g,[0,3,1,2])),null!=n.bias&&(g=biasAdd(g,n.bias.read(),n.dataFormat)),null!=n.activation&&(g=n.activation.apply(g)),g})},t.prototype.computeOutputShape=function(e){var t,n,r,i=(e=getExactlyOneShape(e)).slice();"channelsFirst"===this.dataFormat?(t=1,n=2,r=3):(t=3,n=1,r=2);var a=this.kernelSize[0],o=this.kernelSize[1],s=this.strides[0],l=this.strides[1];return i[t]=this.filters,i[n]=deconvLength(i[n],s,a,this.padding),i[r]=deconvLength(i[r],l,o,this.padding),i},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.dilationRate,t},t.className="Conv2DTranspose",t}(Conv2D);serialization.SerializationMap.register(Conv2DTranspose);var SeparableConv=function(e){function t(t,n){var r=e.call(this,t,n)||this;if(r.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",r.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",r.depthwiseKernel=null,r.pointwiseKernel=null,null==n.filters)throw new ValueError("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=n.kernelInitializer||null!=n.kernelRegularizer||null!=n.kernelConstraint)throw new ValueError("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=n.padding&&"same"!==n.padding&&"valid"!==n.padding)throw new ValueError("SeparableConv"+r.rank+"D supports only padding modes: 'same' and 'valid', but received "+JSON.stringify(n.padding));return r.depthMultiplier=null==n.depthMultiplier?1:n.depthMultiplier,r.depthwiseInitializer=getInitializer(n.depthwiseInitializer||r.DEFAULT_DEPTHWISE_INITIALIZER),r.depthwiseRegularizer=getRegularizer(n.depthwiseRegularizer),r.depthwiseConstraint=getConstraint(n.depthwiseConstraint),r.pointwiseInitializer=getInitializer(n.depthwiseInitializer||r.DEFAULT_POINTWISE_INITIALIZER),r.pointwiseRegularizer=getRegularizer(n.pointwiseRegularizer),r.pointwiseConstraint=getConstraint(n.pointwiseConstraint),r}return __extends(t,e),t.prototype.build=function(e){if((e=getExactlyOneShape(e)).length1)throw new ValueError("Can not merge tensors with different batch sizes. Got tensors with shapes: "+JSON.stringify(e)+".");for(var i=null==e[0]?null:e[0].slice(1),a=1;a1){var y=range(1,s).concat([0]);t.push(transpose(h,y)),u=!0}else t.push(h)}var v=n.mergeFunction(t),b=v.rank;if(u)if(null==b){var z=v.shape;f=[g=z[z.length-1]].concat(z.slice(0,z.length-1));v=transpose(v.reshape([-1,g]),[1,0]).reshape(f)}else if(b>1){y=[b-1].concat(range(0,b-1));v=transpose(v,y)}return v}return n.mergeFunction(e)})},t.prototype.computeOutputShape=function(e){var t;t=null==(e=e)[0]?null:e[0].slice(1);for(var n=1;n1)throw new ValueError("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}},t.prototype.mergeFunction=function(e){var t=this;return tidy(function(){return concatenate(e,t.axis)})},t.prototype.computeOutputShape=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new ValueError("A `Concatenate` layer should be called on a list of inputs.");for(var t=e,n=t[0].slice(),r=this.axis<0?n.length+this.axis:this.axis,i=0,a=t.slice(1);i=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new ValueError("Axis "+t+" of input tensor should have a defined dimension but the layer received an input with shape "+JSON.stringify(e)+".");this.inputSpec=[new InputSpec({ndim:e.length,axes:(r={},r[t]=n,r)})];var r,i=[n];this.scale&&(this.gamma=this.addWeight("gamma",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",i,null,this.movingVarianceInitializer,null,!1),this.built=!0},t.prototype.call=function(e,t){var n=this;return tidy(function(){var r=null!=t.training&&t.training,i=getExactlyOneTensor(e),a=i.shape,o=a.length,s=range(0,o),l=n.axis>=0?n.axis:n.axis+o;s.splice(l,1);var u=pyListRepeat(1,o);u[l]=a[l];var c=s.slice();c.sort();var p=!util.arraysEqual(c,range(0,o).slice(0,o-1));if(!r)return function(){if(p){var e=n.movingMean.read().reshape(u),t=n.movingVariance.read().reshape(u),r=n.center?n.beta.read().reshape(u):null,a=n.scale?n.gamma.read().reshape(u):null;return batchNormalization(i,e,t,r,a,n.epsilon)}return batchNormalization(i,n.movingMean.read(),n.movingVariance.read(),null==n.beta?null:n.beta.read(),null==n.gamma?null:n.gamma.read(),n.epsilon)}();var h=normalizeBatchInTraining(i,n.gamma.read(),n.beta.read(),s,n.epsilon),d=h[0],g=h[1],f=h[2],m=arrayProd(s.map(function(e){return i.shape[e]})),y=f.mul(getScalar(m/(m-(1+n.epsilon))));return function(){n.stepCount++;var e=movingAverage(n.movingMean.read(),g,n.momentum,n.stepCount);n.movingMean.write(e);var t=movingAverage(n.movingVariance.read(),y,n.momentum,n.stepCount);n.movingVariance.write(t)}(),d})},t.prototype.getConfig=function(){var t={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:serializeInitializer(this.betaInitializer),gammaInitializer:serializeInitializer(this.gammaInitializer),movingMeanInitializer:serializeInitializer(this.movingMeanInitializer),movingVarianceInitializer:serializeInitializer(this.movingVarianceInitializer),betaRegularizer:serializeRegularizer(this.betaRegularizer),gammaRegularizer:serializeRegularizer(this.gammaRegularizer),betaConstraint:serializeConstraint(this.betaConstraint),gammaConstraint:serializeConstraint(this.gammaConstraint)},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="BatchNormalization",t}(Layer);function spatial2dPadding(e,t,n){return tidy(function(){if(4!==e.rank)throw new ValueError("temporalPadding expects input tensor to be 4-D, but received a "+e.rank+"-D tensor.");if(null==t&&(t=[[1,1],[1,1]]),2!==t.length||2!==t[0].length||2!==t[1].length)throw new ValueError("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==n&&(n=imageDataFormat()),"channelsLast"!==n&&"channelsFirst"!==n)throw new ValueError("Unknown data format: "+n+". Supported data formats are 'channelsLast' and 'channelsFirst.");var r;return r="channelsFirst"===n?[[0,0],[0,0],t[0],t[1]]:[[0,0],t[0],t[1],[0,0]],pad(e,r)})}serialization.SerializationMap.register(BatchNormalization);var ZeroPadding2D=function(e){function t(t){var n=this;if(null==t&&(t={}),(n=e.call(this,t)||this).dataFormat=null==t.dataFormat?imageDataFormat():t.dataFormat,null==t.padding)n.padding=[[1,1],[1,1]];else if("number"==typeof t.padding)n.padding=[[t.padding,t.padding],[t.padding,t.padding]];else{if(t.padding=t.padding,2!==t.padding.length)throw new ValueError("ZeroPadding2D expects padding to be a length-2 array, but received a length-"+t.padding.length+" array.");var r=void 0,i=void 0;if("number"==typeof t.padding[0])r=[t.padding[0],t.padding[0]],i=[t.padding[1],t.padding[1]];else{if(t.padding=t.padding,2!==t.padding[0].length)throw new ValueError("ZeroPadding2D expects height padding to be a length-2 array, but received a length-"+t.padding[0].length+" array.");if(r=t.padding[0],2!==t.padding[1].length)throw new ValueError("ZeroPadding2D expects width padding to be a length-2 array, but received a length-"+t.padding[1].length+" array.");i=t.padding[1]}n.padding=[r,i]}return n.inputSpec=[new InputSpec({ndim:4})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){var t,n;return e=getExactlyOneShape(e),"channelsFirst"===this.dataFormat?(t=null!=e[2]&&e[2]>=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])},t.prototype.call=function(e,t){var n=this;return tidy(function(){return spatial2dPadding(getExactlyOneTensor(e),n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={padding:this.padding,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="ZeroPadding2D",t}(Layer);function pool2d(e,t,n,r,i,a){return tidy(function(){var o;checkDataFormat(i),checkPoolMode(a),checkPaddingMode(r),null==n&&(n=[1,1]),null==r&&(r="valid"),null==i&&(i=imageDataFormat()),null==a&&(a="max"),e=preprocessConv2DInput(e,i);var s="same"===r?"same":"valid";return o="max"===a?maxPool(e,t,n,s):avgPool(e,t,n,s),"channelsFirst"===i&&(o=transpose(o,[0,3,1,2])),o})}serialization.SerializationMap.register(ZeroPadding2D);var Pooling1D=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=2),n=e.call(this,t)||this,"number"==typeof t.poolSize)n.poolSize=[t.poolSize];else{if(!Array.isArray(t.poolSize)||1!==t.poolSize.length||"number"!=typeof t.poolSize[0])throw new ValueError("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(t.poolSize));n.poolSize=t.poolSize}if(null==t.strides)n.strides=n.poolSize;else if("number"==typeof t.strides)n.strides=[t.strides];else{if(!Array.isArray(t.strides)||1!==t.strides.length||"number"!=typeof t.strides[0])throw new ValueError("strides for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(t.strides));n.strides=t.strides}return n.padding=null==t.padding?"valid":t.padding,checkPaddingMode(n.padding),n.inputSpec=[new InputSpec({ndim:3})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){var t=convOutputLength((e=getExactlyOneShape(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]},t.prototype.call=function(e,t){var n=this;return tidy(function(){n.invokeCallHook(e,t),e=expandDims(getExactlyOneTensor(e),2);var r=n.poolingFunction(getExactlyOneTensor(e),[n.poolSize[0],1],[n.strides[0],1],n.padding,"channelsLast");return squeeze(r,[2])})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(Layer),MaxPooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,"max")},t.className="MaxPooling1D",t}(Pooling1D);serialization.SerializationMap.register(MaxPooling1D);var AveragePooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,"avg")},t.className="AveragePooling1D",t}(Pooling1D);serialization.SerializationMap.register(AveragePooling1D);var Pooling2D=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=[2,2]),(n=e.call(this,t)||this).poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize],null==t.strides)n.strides=n.poolSize;else if(Array.isArray(t.strides)){if(2!==t.strides.length)throw new ValueError("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length "+t.strides.length+".");n.strides=t.strides}else n.strides=[t.strides,t.strides];return n.padding=null==t.padding?"valid":t.padding,n.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,checkDataFormat(n.dataFormat),checkPaddingMode(n.padding),n.inputSpec=[new InputSpec({ndim:4})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){e=getExactlyOneShape(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=convOutputLength(t,this.poolSize[0],this.padding,this.strides[0]),n=convOutputLength(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]},t.prototype.call=function(e,t){var n=this;return tidy(function(){return n.invokeCallHook(e,t),n.poolingFunction(getExactlyOneTensor(e),n.poolSize,n.strides,n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(Layer),MaxPooling2D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,"max")},t.className="MaxPooling2D",t}(Pooling2D);serialization.SerializationMap.register(MaxPooling2D);var AveragePooling2D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,"avg")},t.className="AveragePooling2D",t}(Pooling2D);serialization.SerializationMap.register(AveragePooling2D);var GlobalPooling1D=function(e){function t(t){var n=e.call(this,t)||this;return n.inputSpec=[new InputSpec({ndim:3})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){return[e[0],e[2]]},t.prototype.call=function(e,t){throw new NotImplementedError},t}(Layer),GlobalAveragePooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.call=function(e,t){return tidy(function(){var t=getExactlyOneTensor(e);return mean(t,1)})},t.className="GlobalAveragePooling1D",t}(GlobalPooling1D);serialization.SerializationMap.register(GlobalAveragePooling1D);var GlobalMaxPooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.call=function(e,t){return tidy(function(){var t=getExactlyOneTensor(e);return max(t,1)})},t.className="GlobalMaxPooling1D",t}(GlobalPooling1D);serialization.SerializationMap.register(GlobalMaxPooling1D);var GlobalPooling2D=function(e){function t(t){var n=e.call(this,t)||this;return n.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,checkDataFormat(n.dataFormat),n.inputSpec=[new InputSpec({ndim:4})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){return e=e,"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]},t.prototype.call=function(e,t){throw new NotImplementedError},t.prototype.getConfig=function(){var t={dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(Layer),GlobalAveragePooling2D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.call=function(e,t){var n=this;return tidy(function(){var t=getExactlyOneTensor(e);return"channelsLast"===n.dataFormat?mean(t,[1,2]):mean(t,[2,3])})},t.className="GlobalAveragePooling2D",t}(GlobalPooling2D);serialization.SerializationMap.register(GlobalAveragePooling2D);var GlobalMaxPooling2D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.call=function(e,t){var n=this;return tidy(function(){var t=getExactlyOneTensor(e);return"channelsLast"===n.dataFormat?max(t,[1,2]):max(t,[2,3])})},t.className="GlobalMaxPooling2D",t}(GlobalPooling2D);function standardizeArgs(e,t,n,r){if(Array.isArray(e)){if(null!=t||null!=n)throw new ValueError("When inputs is an array, neither initialState or constants should be provided");null!=r&&(n=e.slice(e.length-r,e.length),e=e.slice(0,e.length-r)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function i(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=i(t),constants:n=i(n)}}function rnn(e,t,n,r,i,a,o,s){void 0===r&&(r=!1),void 0===o&&(o=!1);var l=t.shape.length;if(l<3)throw new ValueError("Input should be at least 3D, but is "+l+"D.");var u,c,p=[1,0].concat(range(2,l));if(t=transpose(t,p),null!=i)throw new NotImplementedError("The rnn() function of the deeplearn.js backend does not support masking yet.");if(null!=a)throw new NotImplementedError("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),r&&(t=reverse(t,0));for(var h=n,d=t.shape[0],g=0;g1?tile$1(n,[1,e]):n}):t.cell.stateSize>1?[tile$1(n,[1,t.cell.stateSize])]:[n]})},Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),t.prototype.getConfig=function(){var t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);var n=this.cell.getConfig();t.cell={className:this.cell.getClassName(),config:n};var r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t.className="RNN",t}(Layer);serialization.SerializationMap.register(RNN);var RNNCell=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(Layer),SimpleRNNCell=function(e){function t(t){var n=e.call(this,t)||this;return n.DEFAULT_ACTIVATION="tanh",n.DEFAULT_KERNEL_INITIALIZER="glorotNormal",n.DEFAULT_RECURRENT_INITIALIZER="orthogonal",n.DEFAULT_BIAS_INITIALIZER="zeros",n.units=t.units,n.activation=getActivation(null==t.activation?n.DEFAULT_ACTIVATION:t.activation),n.useBias=null==t.useBias||t.useBias,n.kernelInitializer=getInitializer(t.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=getInitializer(t.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=getInitializer(t.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelRegularizer=getRegularizer(t.kernelRegularizer),n.recurrentRegularizer=getRegularizer(t.recurrentRegularizer),n.biasRegularizer=getRegularizer(t.biasRegularizer),n.kernelConstraint=getConstraint(t.kernelConstraint),n.recurrentConstraint=getConstraint(t.recurrentConstraint),n.biasConstraint=getConstraint(t.biasConstraint),n.dropout=min$1([1,max$1([0,null==t.dropout?0:t.dropout])]),n.recurrentDropout=min$1([1,max$1([0,null==t.recurrentDropout?0:t.recurrentDropout])]),n.stateSize=n.units,n.dropoutMask=null,n.recurrentDropoutMask=null,n}return __extends(t,e),t.prototype.build=function(e){e=getExactlyOneShape(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},t.prototype.call=function(e,t){var n=this;return tidy(function(){if(2!==(e=e).length)throw new ValueError("SimpleRNNCell expects 2 input Tensors, got "+e.length+".");var r=e[1];e=e[0];var i,a=null!=t.training&&t.training;01){for(var a=[],o=0;o= 3D, but received input shape "+JSON.stringify(t));this.inputSpec=[{shape:t}];var n=[t[0]].concat(t.slice(2));this.layer.built||(this.layer.build(n),this.layer.built=!0),e.prototype.build.call(this,t)},t.prototype.computeOutputShape=function(e){var t=[(e=getExactlyOneShape(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))},t.prototype.call=function(e,t){var n=this;return tidy(function(){return rnn(function(e,r){return[n.layer.call(e,t),[]]},e=getExactlyOneTensor(e),[],!1,null,null,!1,e.shape[1])[1]})},t.className="TimeDistributed",t}(Wrapper);serialization.SerializationMap.register(TimeDistributed);var VALID_BIDIRECTIONAL_MERGE_MODES=["sum","mul","concat","ave"];function checkBidirectionalMergeMode(e){checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES,"BidirectionalMergeMode",e)}var Bidirectional=function(e){function t(t){var n=e.call(this,t)||this,r=t.layer.getConfig();if(n.forwardLayer=deserialize({className:t.layer.getClassName(),config:r}),r.goBackwards=!0!==r.goBackwards,n.backwardLayer=deserialize({className:t.layer.getClassName(),config:r}),n.forwardLayer.name="forward_"+n.forwardLayer.name,n.backwardLayer.name="backward_"+n.backwardLayer.name,checkBidirectionalMergeMode(t.mergeMode),n.mergeMode=t.mergeMode,t.weights)throw new NotImplementedError("weights support is not implemented for Bidirectional layer yet.");return n._stateful=t.layer.stateful,n.returnSequences=t.layer.returnSequences,n.returnState=t.layer.returnState,n.supportsMasking=!0,n._trainable=!0,n.inputSpec=t.layer.inputSpec,n.numConstants=null,n}return __extends(t,e),Object.defineProperty(t.prototype,"trainable",{get:function(){return this._trainable},set:function(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)},enumerable:!0,configurable:!0}),t.prototype.getWeights=function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())},t.prototype.setWeights=function(e){var t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))},t.prototype.computeOutputShape=function(e){var t,n,r,i=this.forwardLayer.computeOutputShape(e);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(r=i.slice(1),t=i[0]):t=i[0],t=t,"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[t].concat(r).concat(r.slice()):singletonOrArray(n)},t.prototype.apply=function(t,n){var r=null==n?null:n.initialState,i=null==n?null:n.constants;null==n&&(n={});var a=standardizeArgs(t,r,i,this.numConstants);if(t=a.inputs,r=a.initialState,i=a.constants,Array.isArray(t)&&(r=t.slice(1),t=t[0]),(null==r||0===r.length)&&null==i)return e.prototype.apply.call(this,t,n);var o=[],s=[];if(null!=r){var l=r.length;if(l%2>0)throw new ValueError("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");n.initialState=r,o.push.apply(o,r);var u=r.map(function(e){return new InputSpec({shape:e.shape})});this.forwardLayer.stateSpec=u.slice(0,l/2),this.backwardLayer.stateSpec=u.slice(l/2),s.push.apply(s,u)}if(null!=i)throw new NotImplementedError("Support for constants in Bidirectional layers is not implemented yet.");for(var c=o[0]instanceof SymbolicTensor,p=0,h=o;p(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = retVal + Math.abs(obj.id);\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n return {className: instance.getClassName(), config: instance.getConfig()};\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object'): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(`Unknown ${printableModuleName}: ${identifier}`);\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config.className == null || config.config == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config.className as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects.get(className);\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS.className;\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(`Unknown ${printableModuleName}: ${className}`);\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config.config as config.config.customObjects. Objects can use it, if\n // they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config.config as serialization.ConfigDict;\n nestedConfig.customObjects = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n const returnObj = fromConfig(cls, config.config);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config.config);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport {getScalar} from './backend/state';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n// tslint:enable:max-line-length\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mulStrict(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n */\n/**\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormConfig {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n */\nexport class MaxNorm extends Constraint {\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(config: MaxNormConfig) {\n super();\n this.maxValue =\n config.maxValue != null ? config.maxValue : this.defaultMaxValue;\n this.axis = config.axis != null ? config.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(getScalar(epsilon()), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.SerializationMap.register(MaxNorm);\n\nexport interface UnitNormConfig {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n */\nexport class UnitNorm extends Constraint {\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(config: UnitNormConfig) {\n super();\n this.axis = config.axis != null ? config.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(\n w, tfc.add(getScalar(epsilon()), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.SerializationMap.register(UnitNorm);\n\n/**\n * Constains the weight to be non-negative.\n */\nexport class NonNeg extends Constraint {\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.SerializationMap.register(NonNeg);\n\nexport interface MinMaxNormConfig {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(config: MinMaxNormConfig) {\n super();\n this.minValue =\n config.minValue != null ? config.minValue : this.defaultMinValue;\n this.maxValue =\n config.maxValue != null ? config.maxValue : this.defaultMaxValue;\n this.rate = config.rate != null ? config.rate : this.defaultRate;\n this.axis = config.axis != null ? config.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n getScalar(this.rate),\n tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(getScalar(1.0 - this.rate), norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(getScalar(epsilon()), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.SerializationMap.register(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormConfig, MinMaxNorm, MinMaxNormConfig, NonNeg, UnitNorm, UnitNormConfig} from './constraints';\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'MaxNorm',\n * configParamIndices: [0]\n * }\n */\nexport function maxNorm(config: MaxNormConfig): Constraint {\n return new MaxNorm(config);\n}\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'UnitNorm',\n * configParamIndices: [0]\n * }\n */\nexport function unitNorm(config: UnitNormConfig): Constraint {\n return new UnitNorm(config);\n}\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'NonNeg'\n * }\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'MinMaxNormConfig',\n * configParamIndices: [0]\n * }\n */\nexport function minMaxNorm(config: MinMaxNormConfig): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\n// TODO(cais): Perhaps move the enums to a more suitable place, e.g.,\n// constants.ts.\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = scopedName + '_' + index;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z][A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return name.match(tensorNameRegex) ? true : false;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mulStrict(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, inclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, Scalar, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, tidy, util, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\n\nimport {disposeScalarCache, getScalar} from '../backend/state';\nimport {checkDataFormat, DataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {HasShape, Shape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n disposeScalarCache();\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: 'float32'|'int32'|'bool'): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten an Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `Tensor` to concatenate.\n * @param b The 2nd `Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n 'concatAlongFirstAxis() received an unsupported tensor rank: ' +\n a.rank);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`).\n *\n * @param x A tensor of at least rank 2.\n * @param y A tensor of at least rank 2.\n * @return Result of the dot operation.\n */\nexport function dot(x: Tensor, y: Tensor): Tensor {\n if (y.rank !== 2) {\n throw new NotImplementedError(\n `dot support for y other than rank 2 is not yet implemented: ` +\n `y shape = ${y.shape}`);\n } else {\n if (x.rank === 2) {\n return tfc.matMul(x as Tensor2D, y as Tensor2D);\n } else if (x.rank === 3) {\n const xShape0 = x.shape[0];\n const xShape1 = x.shape[1];\n const xShape2 = x.shape[2];\n x = x.reshape([xShape0 * xShape1, xShape2]);\n return tfc.matMul(x as Tensor2D, y as Tensor2D).reshape([\n xShape0, xShape1, y.shape[1]\n ]);\n } else {\n throw new NotImplementedError(\n `dot support for x of rank ${x.rank} is not yet implemented: ` +\n `x shape = ${x.shape}`);\n }\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `Tensor` that are === 0 are mapped to 0.\n * Elements of the input `Tensor` that are > 0 are mapped to 1.\n * Elements of the input `Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `Tensor`.\n * @return The sign `Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(getScalar(-1), onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mulStrict(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic conversion\n * to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a as Tensor);\n });\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n if (bias.rank !== 1 && bias.rank !== x.rank) {\n throw new ValueError(\n 'Unexpected bias dimensions: ' + bias.rank +\n '; expected it to be 1 or ' + x.rank);\n }\n const biasShape = bias.shape;\n\n let y: Tensor;\n if (x.rank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, biasShape[0], 1, 1, 1]));\n } else {\n y = x.add(bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]));\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, 1, 1, 1, biasShape[0]]));\n } else {\n y = x.add(bias.reshape([1].concat(biasShape)));\n }\n }\n } else if (x.rank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, biasShape[0], 1, 1]));\n } else {\n y = x.add(\n bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]));\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, 1, 1, biasShape[0]]));\n } else {\n y = x.add(bias.reshape([1].concat(biasShape)));\n }\n }\n } else if (x.rank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, biasShape[0], 1]));\n } else {\n y = x.add(bias.reshape([1, biasShape[1], biasShape[0]]));\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, 1, biasShape[0]]));\n } else {\n y = x.add(bias.reshape([1].concat(biasShape)));\n }\n }\n } else if (x.rank < 3) {\n y = x.add(bias);\n } else {\n throw new ValueError(`Unsupported input rank by biasAdd: ${x.rank}`);\n }\n return y;\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.add(getScalar(1), tfc.abs(x))));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`.\n * @param seed random seed to ensure determinism.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: Scalar, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => {\n // TODO(cais): Switch to deeplearn.js implementation of dropout when it\n // becomes avaialable.\n if (noiseShape != null && !util.arraysEqual(x.shape, noiseShape)) {\n throw new NotImplementedError(\n 'Non-default noise shape is not implemented yet: ' +\n JSON.stringify(noiseShape));\n }\n if (seed != null) {\n throw new NotImplementedError('seed is not implemented for dropout yet.');\n }\n let multiplier = tfc.step(tfc.add(\n tfc.neg(level) as Scalar, tfc.randomUniform(x.shape, 0, 1, 'float32')));\n // Scale the kept elements, so the expected sum is unchanged.\n multiplier = tfc.mul(\n tfc.div(getScalar(1), tfc.sub(getScalar(1), level)) as Scalar,\n multiplier);\n return tfc.mul(x, multiplier);\n });\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(getScalar(0.5), tfc.mul(getScalar(0.2), x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training` boolean\n * flag here, because there is no such thing in the TF.js imperative backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// tslint:disable:max-line-length\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, Scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from './backend/state';\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat, DataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {Shape} from './types';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\n// tslint:enable:max-line-length\n\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform';\nexport const VALID_DISTRIBUTION_VALUES = ['normal', 'uniform'];\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Initializer that generates tensors initialized to 0.\n */\nexport class Zeros extends Initializer {\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.SerializationMap.register(Zeros);\n\n/**\n * Initializer that generates tensors initialized to 1.\n */\nexport class Ones extends Initializer {\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.SerializationMap.register(Ones);\n\nexport interface ConstantConfig {\n /** The value for each element in the variable. */\n value: number;\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n */\nexport class Constant extends Initializer {\n static className = 'Constant';\n private value: number;\n constructor(config: ConstantConfig) {\n super();\n if (typeof config !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${config}`);\n }\n if (config.value === undefined) {\n throw new ValueError(`config must have value set but got ${config}`);\n }\n this.value = config.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.SerializationMap.register(Constant);\n\nexport interface RandomUniformConfig {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n */\nexport class RandomUniform extends Initializer {\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(config: RandomUniformConfig) {\n super();\n this.minval = config.minval || this.DEFAULT_MINVAL;\n this.maxval = config.maxval || this.DEFAULT_MAXVAL;\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.SerializationMap.register(RandomUniform);\n\nexport interface RandomNormalConfig {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n */\nexport class RandomNormal extends Initializer {\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(config: RandomNormalConfig) {\n super();\n this.mean = config.mean || this.DEFAULT_MEAN;\n this.stddev = config.stddev || this.DEFAULT_STDDEV;\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `randomNormal does not support dType bool.`);\n }\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.SerializationMap.register(RandomNormal);\n\nexport interface TruncatedNormalConfig {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n */\nexport class TruncatedNormal extends Initializer {\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(config: TruncatedNormalConfig) {\n super();\n this.mean = config.mean || this.DEFAULT_MEAN;\n this.stddev = config.stddev || this.DEFAULT_STDDEV;\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType bool.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.SerializationMap.register(TruncatedNormal);\n\nexport interface IdentityConfig {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n */\nexport class Identity extends Initializer {\n static className = 'Identity';\n private gain: Scalar;\n constructor(config: IdentityConfig) {\n super();\n this.gain = config.gain != null ? scalar(config.gain) : getScalar(1.0);\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain.get()};\n }\n}\nserialization.SerializationMap.register(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingConfig {\n /** Scaling factor (positive float). */\n scale: number;\n\n /** Fanning mode for inputs and outputs. */\n mode: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n */\nexport class VarianceScaling extends Initializer {\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(config: VarianceScalingConfig) {\n super();\n if (config.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${config.scale}`);\n }\n this.scale = config.scale == null ? 1.0 : config.scale;\n this.mode = config.mode;\n checkFanMode(this.mode);\n this.distribution = config.distribution;\n checkDistribution(this.distribution);\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType bool.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.SerializationMap.register(VarianceScaling);\n\nexport interface SeedOnlyInitializerConfig {\n /** Random number generator seed. */\n seed?: number;\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n */\nexport class GlorotUniform extends VarianceScaling {\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n */\nexport class GlorotNormal extends VarianceScaling {\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n */\nexport class HeNormal extends VarianceScaling {\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n */\nexport class LeCunNormal extends VarianceScaling {\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\nexport interface OrthogonalConfig extends SeedOnlyInitializerConfig {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n */\nexport class Orthogonal extends Initializer {\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(config?: OrthogonalConfig) {\n super();\n this.gain = config.gain == null ? this.DEFAULT_GAIN : config.gain;\n this.seed = config.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2) {\n throw new NotImplementedError(\n 'The Orthogonal Initializer does not support non-2D shapes yet.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(getScalar(this.gain), q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.SerializationMap.register(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier = 'constant'|'glorotNormal'|'glorotUniform'|\n 'heNormal'|'identity'|'leCunNormal'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else {\n const config = {className, config: {}};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantConfig, GlorotNormal, GlorotUniform, HeNormal, Identity, IdentityConfig, Initializer, LeCunNormal, Ones, Orthogonal, OrthogonalConfig, RandomNormal, RandomNormalConfig, RandomUniform, RandomUniformConfig, SeedOnlyInitializerConfig, TruncatedNormal, TruncatedNormalConfig, VarianceScaling, VarianceScalingConfig, Zeros} from './initializers';\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Zeros'\n * }\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Ones'\n * }\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Constant',\n * configParamIndices: [0]\n * }\n */\nexport function constant(config: ConstantConfig): Initializer {\n return new Constant(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'RandomUniform',\n * configParamIndices: [0]\n * }\n */\nexport function randomUniform(config: RandomUniformConfig): Initializer {\n return new RandomUniform(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'RandomNormal',\n * configParamIndices: [0]\n * }\n */\nexport function randomNormal(config: RandomNormalConfig): Initializer {\n return new RandomNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'TruncatedNormal',\n * configParamIndices: [0]\n * }\n */\nexport function truncatedNormal(config: TruncatedNormalConfig): Initializer {\n return new TruncatedNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Identity',\n * configParamIndices: [0]\n * }\n */\nexport function identity(config: IdentityConfig): Initializer {\n return new Identity(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'VarianceScaling',\n * configParamIndices: [0]\n * }\n */\nexport function varianceScaling(config: VarianceScalingConfig): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'GlorotUniform',\n * configParamIndices: [0]\n * }\n */\nexport function glorotUniform(config: SeedOnlyInitializerConfig): Initializer {\n return new GlorotUniform(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'GlorotNormal',\n * configParamIndices: [0]\n * }\n */\nexport function glorotNormal(config: SeedOnlyInitializerConfig): Initializer {\n return new GlorotNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'HeNormal',\n * configParamIndices: [0]\n * }\n */\nexport function heNormal(config: SeedOnlyInitializerConfig): Initializer {\n return new HeNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'LeCunNormal',\n * configParamIndices: [0]\n * }\n */\nexport function leCunNormal(config: SeedOnlyInitializerConfig): Initializer {\n return new LeCunNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Orthogonal',\n * configParamIndices: [0]\n * }\n */\nexport function orthogonal(config: OrthogonalConfig): Initializer {\n return new Orthogonal(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\n// tslint:disable:max-line-length\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../types';\n// tslint:enable\n\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `Tensor` or an `Array` of `Tensor`s.\n * @return A single `Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs as Tensor;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {HasShape, Shape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `LayerVariable` is similar to a `Tensor` in that it has a dtype and shape,\n * but its value is mutable. The value is itself represented as a `Tensor`, and\n * can be read with the `read()` method and updated with the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n readonly trainable: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a Tensor.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n checkShapesMatch(this.val, newVal);\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n return this;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n if (dtype === 'bool') {\n throw new NotImplementedError(`randomNormal does not support dType bool.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType bool.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of `Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.map((variableAndValue) => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\n// tslint:disable:max-line-length\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n// tslint:enable:max-line-length\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecConfig {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(config: InputSpecConfig) {\n this.dtype = config.dtype;\n this.shape = config.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (config.shape != null) {\n this.ndim = config.shape.length;\n } else {\n this.ndim = config.ndim;\n }\n this.maxNDim = config.maxNDim;\n this.minNDim = config.minNDim;\n this.axes = config.axes || {};\n }\n}\n\n/**\n * `SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `Model` and the input data's shape, but not values are known.\n */\n/** @doc {heading: 'Models', 'subheading': 'Classes'} */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeConfig {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n config: NodeConfig,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = config.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = config.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = config.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = config.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = config.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = config.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = config.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = config.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = config.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = config.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of config.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n config.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport interface LayerConfig {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specifiedd,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /** Whether this layer is trainable. Defaults to true. */\n trainable?: boolean;\n /** Whether the weights of this layer are updatable by `fit`. */\n updatable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `Model`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n */\n/** @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n trainable: boolean;\n updatable: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n constructor(config: LayerConfig) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = config.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable = config.trainable == null ? true : config.trainable;\n this.updatable = config.updatable == null ? true : config.updatable;\n\n if (config.inputShape != null || config.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (config.batchInputShape != null) {\n batchInputShape = config.batchInputShape;\n } else if (config.inputShape != null) {\n let batchSize: number = null;\n if (config.batchSize != null) {\n batchSize = config.batchSize;\n }\n batchInputShape = [batchSize].concat(config.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = config.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (config.weights != null) {\n this.initialWeights = config.weights;\n } else {\n this.initialWeights = null;\n }\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights;\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n } else {\n return this._nonTrainableWeights;\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n 'found shape=${xShape}.');\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `SymbolicTensor`s are typically used during the\n * building of non-`Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `Tensor` or `SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n */\n // Porting Note: This is a replacement for __call__() in Python.\n /** @doc {heading: 'Models', 'subheading': 'Classes'} */\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"outut shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `Tensor`s.\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n const weight = new LayerVariable(\n initializer.apply(shape, dtype), dtype, name, trainable, constraint);\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking,` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking,` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer as Layer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `Tensor`s or `SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\n\nimport {Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport interface InputLayerConfig {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\n/**\n * An input layer is an entry point into a `Model`.\n *\n * `InputLayer` is generated automatically for `Sequential` models by specifying\n * the `inputshape` or `batchInputShape` for the first layer. It should not be\n * specified explicitly.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const inputA = tf.input({shape: [3]});\n * const inputB = tf.input({shape: [3]});\n * const sum = tf.layers.add().apply([inputA, inputB]);\n * const model = tf.model({inputs: [inputA, inputB], outputs: sum});\n * const batchSize = 2;\n * model.predict([tf.ones([batchSize, 3]), tf.ones([batchSize, 3])]).print();\n * ```\n */\nexport class InputLayer extends Layer {\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(config: InputLayerConfig) {\n super({\n dtype: config.dtype,\n name: config.name != null ? config.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (config.batchSize == null) {\n config.batchSize = null;\n }\n if (config.sparse == null) {\n config.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = config.sparse;\n\n if (config.inputShape != null && config.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = config.batchInputShape;\n if (batchInputShape == null) {\n if (config.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [config.batchSize].concat(config.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (config.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = config.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.SerializationMap.register(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\n/**\n * Used to instantiate an input to a model as a `SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n */\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value as Scalar;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `Tensor`s in\n * places where the values can be `Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, Scalar, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from './backend/state';\nimport {Container} from './engine/container';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // Model needs to call Callback.setModel(), but cannot actually depend on\n // Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way Model can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of Model) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a Model.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every Model.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = getScalar(0);\n }\n\n this.totals[key] = tidy(\n () => add((this.totals[key] as Scalar),\n mul(value, getScalar(batchSize))) as Scalar);\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n logs[key] = mul(div(getScalar(1), getScalar(this.seen)) as Scalar,\n this.totals[key] as Scalar) as Scalar;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object gets\n * returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackConfig {\n onTrainBegin?: (logs?: Logs) => Promise;\n onTrainEnd?: (logs?: Logs) => Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => Promise;\n protected readonly trainEnd: (logs?: Logs) => Promise;\n protected readonly epochBegin: (epoch: number, logs?: Logs) => Promise;\n protected readonly epochEnd: (epoch: number, logs?: Logs) => Promise;\n protected readonly batchBegin: (batch: number, logs?: Logs) => Promise;\n protected readonly batchEnd: (batch: number, logs?: Logs) => Promise;\n\n constructor(config: CustomCallbackConfig) {\n super();\n this.trainBegin = config.onTrainBegin;\n this.trainEnd = config.onTrainEnd;\n this.epochBegin = config.onEpochBegin;\n this.epochEnd = config.onEpochEnd;\n this.batchBegin = config.onBatchBegin;\n this.batchEnd = config.onBatchEnd;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.epochEnd(epoch, logs as Logs);\n }\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.batchEnd(batch, logs as Logs);\n }\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(callbacks: BaseCallback|BaseCallback[]|\n CustomCallbackConfig|\n CustomCallbackConfig[]): BaseCallback[] {\n if (callbacks == null) {\n return null;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks as BaseCallback];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackConfig[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor, Tensor1D, tidy} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {getScalar} from './backend/state';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.mul(scalar(epsilon()), tfc.onesLike(x));\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(getScalar(100.0), tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const one = getScalar(1.0);\n\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(one, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(one, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const zeroTensor = getScalar(0.0);\n const one = getScalar(1.0);\n const maxResult =\n tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const zeroTensor = getScalar(0.0);\n const one = getScalar(1.0);\n const maxResult =\n tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const zeroTensor = getScalar(0.0);\n const one = getScalar(1.0);\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(one, yTrue), yPred), -1);\n return tfc.maximum(zeroTensor, tfc.add(one, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = getScalar(Math.log(2.0));\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(\n predictionDiff,\n tfc.softplus(tfc.mul(getScalar(-2.0), predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param target The labels.\n * @param output The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n target: Tensor, output: Tensor): Tensor {\n return tidy(() => {\n const maxOutput = tfc.maximum(output, tfc.zerosLike(output));\n const outputXTarget = tfc.mul(output, target);\n const sigmoidOutput =\n tfc.log(tfc.add(getScalar(1), tfc.exp(tfc.neg(tfc.abs(output)))));\n const result = tfc.add(tfc.sub(maxOutput, outputXTarget), sigmoidOutput);\n return result;\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(tfc.onesLike(y), y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(getScalar(epsilon()), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n };\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n throw new ValueError(`Unknown loss ${identifierOrFn}`);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {getScalar} from './backend/state';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {LossOrMetricFn} from './types';\n// tslint:enable:max-line-length\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tfl.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(getScalar(0.5), tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tensor2d([[0], [1], [1], [1]]);\n * const y = tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine,\n };\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\n// tslint:disable:max-line-length\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n// tslint:enable:max-line-length\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a Model object.\n *\n * @param model tf.Model instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config: dict of the form {class_name: str, config: dict}\n * @param custom_objects: dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @returns Layer instance (may be Model, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as\n serialization.ConfigDict): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer');\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\n// tslint:disable:max-line-length\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {JsonValue} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a Model or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: JsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of Model and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): JsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of Model and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '0.7.2';\nexport {version};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\n// tslint:disable:max-line-length\nimport {Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {JsonDict, Kwargs, NamedTensorMap, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {InputLayer} from './input_layer';\nimport {Layer, Node, SymbolicTensor} from './topology';\n// tslint:enable:max-line-length\n\n/**\n * Converts layers weights to a format suitable for TensorFlow.js Layers.\n *\n * Porting Note: The function `preprocess_weights_for_loading()` in PyKeras\n * performs conversion from Keras 1 to Keras 2. But in TypeScript, we\n * require Keras version to be 2. Thus this conversion is not applicable. We\n * simply check the Keras version and pass the weights through.\n *\n * @param layer Layer instance.\n * @param weights Input weights.\n * @param originalKerasVersion Keras version for the weights.\n * @param originalBackend Keras backend the weights were trained with.\n * @returns Output weights as Tensors.\n */\nfunction preprocessWeightsForLoading(\n layer: Layer, weights: LayerVariable[], originalKerasVersion?: string,\n originalBackend?: string): LayerVariable[] {\n if (!originalKerasVersion.startsWith('2.')) {\n throw new ValueError(\n 'Unsupported Keras version in weights being loaded: ' +\n originalKerasVersion);\n }\n return weights;\n}\n\n/**\n * Create an Tensor from info about dtype, shape and values.\n * @param dtype DType string.\n * @param shape Shape.\n * @param value Values of the array, as a scalar or nested Array of proper\n * shape.\n * @returns An Tensor instance.\n */\n// tslint:disable-next-line:no-any\nfunction loadTensor(dtype: string, shape: Shape, value: any): Tensor {\n const dataType = generic_utils.stringToDType(dtype);\n return Tensor.make(\n shape, {values: shape.length === 0 ? value : util.flatten(value)},\n dataType);\n}\n\n// TODO(cais): Maybe remove the following (b/74015805).\n/**\n * Load weights from a weights JSON object to an array of layers.\n *\n * Porting Note: This is ported from the Python function\n * load_weights_from_hdf5_group_by_name()\n *\n * @param weightsJSON. The input JSON object represent the weights from a\n * trained Keras model. See scripts/pykeras.py for more details.\n * @param layers An array of target layers.\n * @param skipMismatch Whether to skip loading of layers where there is a\n * mismatch in the number of weights, or a mismatch in the shape of the\n * weights.\n */\nexport function loadWeightsFromJson(\n weightsJSON: JsonDict, layers: Layer[], skipMismatch = false): void {\n const originalKerasVersion = weightsJSON['keras_version'] as string;\n const originalBackend = weightsJSON['backend'] as string;\n const layerNames = layers.map(layer => layer.name);\n\n // Reverse index of layer name to list of layers with name.\n const index: {[layerName: string]: Layer[]} = {};\n for (const layer of layers) {\n if (layer.name != null) {\n if (index[layer.name] == null) {\n index[layer.name] = [];\n }\n index[layer.name].push(layer);\n }\n }\n\n // tslint:disable-next-line:no-any\n const nameToWeights = weightsJSON['weights'] as {[name: string]: any};\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (let k = 0; k < layerNames.length; ++k) {\n const name = layerNames[k];\n let layerWeights = nameToWeights[name];\n if (layerWeights == null) {\n layerWeights = [];\n }\n\n let weightValues: LayerVariable[] = [];\n for (let n = 0; n < layerWeights.length; ++n) {\n // tslint:disable:no-any\n const weightEntry =\n layerWeights[n] as {[key: string]: string | Shape | any};\n // tslint:enable\n weightValues.push(new LayerVariable(loadTensor(\n weightEntry['dtype'], weightEntry['shape'] as Shape,\n weightEntry['value'])));\n }\n for (const layer of index[name]) {\n const symbolicWeights = layer.weights;\n weightValues = preprocessWeightsForLoading(\n layer, weightValues, originalKerasVersion, originalBackend);\n if (weightValues.length !== symbolicWeights.length) {\n if (skipMismatch) {\n console.warn(\n `Skipping loading of weights of layer ${layer.name} ` +\n `due to mismatch in number of weights: (${weightValues.length} ` +\n `vs ${symbolicWeights.length}).`);\n } else {\n throw new ValueError(\n `Layer #${k} (named \"${layer.name}\") expects ` +\n `${symbolicWeights.length} weight(s), but the saved weights ` +\n `have ${weightValues.length} element(s).`);\n }\n }\n\n // Set values.\n for (let i = 0; i < weightValues.length; ++i) {\n if (skipMismatch) {\n if (!util.arraysEqual(\n symbolicWeights[i].shape, weightValues[i].shape)) {\n console.warn(\n `Skipping loading of weights for layer ${layer.name} due ` +\n `to mismatch in shape (${symbolicWeights[i].shape} vs ` +\n `${weightValues[i].shape})`);\n continue;\n }\n }\n weightValueTuples.push([symbolicWeights[i], weightValues[i].read()]);\n }\n }\n }\n batchSetValue(weightValueTuples);\n}\n\n/**\n * Load weights from a named tensor map.\n *\n * Porting Note: This is ported from the Python function\n * load_weights_from_hdf5_group_by_name()\n *\n * @param weights The named tensor map mapping names of weights to weight\n * values.\n * @param layers An array of target layers.\n */\nexport function loadWeightsFromNamedTensorMap(\n weights: NamedTensorMap, layers: Layer[]): void {\n // Make a dictionary mapping weight name to weight.\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n weightValueTuples.push([nameToWeight[name], weights[name]]);\n delete nameToWeight[name];\n }\n\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n\n batchSetValue(weightValueTuples);\n}\n\n/** Constructor config for Container. */\nexport interface ContainerConfig {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A Model\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(config: ContainerConfig) {\n // No args passed to super's constructor.\n super({});\n this.name = config.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable = true;\n this.updatable = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(config.inputs)) {\n this.inputs = config.inputs.slice();\n } else {\n this.inputs = [config.inputs];\n }\n if (Array.isArray(config.outputs)) {\n this.outputs = config.outputs.slice();\n } else {\n this.outputs = [config.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n this.inputs.map(x => x.name));\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n this.outputs.map(x => x.name));\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer as Layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer as Layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a Model must be InputLayer objects. ' +\n `Received inputs: ${config.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer as Layer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weightsJSON A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `Tensor` objects.\n * @param skipMismatch Whether to skip loading of layers where there is a\n * mismatch in the number of weights, or a mismatch in the shape of the\n * weight (only valid when `by_name`=True).\n * @param isNamedTensorMap Whether the 1st argument (`weightsJSON`) is a\n * `NamedTensorMap`.\n */\n loadWeights(\n weightsJSON: JsonDict|NamedTensorMap, skipMismatch = false,\n isNamedTensorMap = false) {\n // TODO(cais): Maybe the JsonDict support should be removed after serving\n // weights from XHR is working. If so, the `loadWeightsFromJson` flag\n // should be removed as well. (b/74015805)\n // TODO(cais): See if we can use smarter type resolution to avoid sending\n // the type info as a separate arg (isNamedTensormap).\n if (isNamedTensorMap) {\n loadWeightsFromNamedTensorMap(weightsJSON as NamedTensorMap, this.layers);\n } else {\n loadWeightsFromJson(weightsJSON as JsonDict, this.layers, skipMismatch);\n }\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns Model config with Keras version information added.\n */\n private updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {\n className: this.getClassName(),\n config: theConfig,\n kerasVersion: `tfjs-layers ${layersVersion}`,\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n backend: 'TensorFlow.js'\n };\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|JsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as JsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n\n if ('mask' in kwargs) {\n masks = generic_utils.toList(kwargs['mask']);\n } else {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n // TODO(michaelterry): Add support for caching.\n return this.runInternalGraph(inputs, masks)[0];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs.mask == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs.mask == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'Model invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (nodeKey in this.containerNodes) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n */\n /**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['Model']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n layerConfigs.push({\n name: layer.name,\n className: layerClassName,\n config: layerConfig,\n inboundNodes: filteredInboundNodes\n });\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a Model from its config (output of `get_config()`).\n * @param cls: the class to create\n * @param config: Model config dictionary.\n * @returns A model instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes:\n {[layer: string]: serialization.ConfigDict[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: serialization.ConfigDict[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: serialization.ConfigDict[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0] as string;\n const inboundNodeIndex = inputData[1] as number;\n const inboundTensorIndex = inputData[2] as number;\n if (inputData.length === 3) {\n kwargs = {};\n } else if (inputData.length === 4) {\n kwargs = inputData[3] as serialization.ConfigDict;\n } else {\n throw new ValueError(`Improperly formatted model config for layer ${\n JSON.stringify(layer)}: ${JSON.stringify(inputData)}`);\n }\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData.name as string;\n // Instantiate layer.\n const layer = deserializeLayer(\n layerData,\n config.customObjects != null ?\n config.customObjects as serialization.ConfigDict :\n {}) as Layer;\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData.inboundNodes as serialization.ConfigDict[];\n for (const nodeData of inboundNodesData) {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n }\n }\n\n // First, we create all layers and enqueue nodes to be processed\n const name = config.name;\n const layersFromConfig = config.layers as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData.name as string];\n if (layer.name in unprocessedNodes) {\n for (const nodeData of unprocessedNodes[layer.name]) {\n processNode(layer, nodeData);\n }\n delete unprocessedNodes[layer.name];\n }\n }\n }\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config.inputLayers as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config.outputLayers as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, Tensor} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // 1. Check shape compatibility. If shapes are not compatible, error.\n if (key.shape != null) {\n if (key.shape.length !== val.shape.length) {\n throw new ValueError(\n `The rank of feed (${val.shape.length}) does not match the rank of ` +\n `the key (${key.shape.length}).`);\n }\n\n for (let i = 0; i < key.shape.length; ++i) {\n if (key.shape[i] != null && key.shape[i] !== val.shape[i]) {\n throw new ValueError(\n `The ${i}-th dimension of the feed (${val.shape[i]}) is ` +\n `incompatible with that of the key (${key.shape[i]}).`);\n }\n }\n }\n // 2. Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // 2a. If types match, return val tensor as is.\n return val;\n }\n try {\n // 2b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // 2c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n * @param key The key of the feed.\n * @param value The value of the feed.\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get the feed value for given key.\n * @param key\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor): Tensor {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${JSON.stringify(key)}`);\n } else {\n return this.id2Value[key.id];\n }\n }\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the inputs\n * obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs): Tensor|Tensor[]|[Tensor | Tensor[]] {\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputs: Tensor[] = [];\n const internalFeedDict = new FeedDict(feedDict);\n\n for (const fetch of fetchArray) {\n outputs.push(executeInternal(fetch, internalFeedDict, kwargs) as Tensor);\n }\n return arrayFetches ? outputs : outputs[0];\n}\n\nfunction executeInternal(\n fetch: SymbolicTensor, internalFeedDict: FeedDict,\n kwargs?: Kwargs): Tensor {\n if (internalFeedDict.hasKey(fetch)) {\n return internalFeedDict.getValue(fetch);\n }\n if (fetch.sourceLayer instanceof InputLayer) {\n throw new ValueError(\n `Missing a feed value for SymbolicTensor from InputLayer ` +\n `'${InputLayer.name}'`);\n }\n\n const inputs = fetch.inputs;\n const inputValues: Tensor[] = [];\n for (const input of inputs) {\n // Recursive call.\n const inputVal = executeInternal(input, internalFeedDict, kwargs) as Tensor;\n inputValues.push(inputVal);\n }\n\n let output =\n fetch.sourceLayer.apply(inputValues, kwargs) as Tensor | Tensor[];\n if (!Array.isArray(output)) {\n output = [output];\n }\n const layerOutputs = getNodeOutputs(fetch);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n internalFeedDict.add(outputSymbolicTensors[i], output[i]);\n }\n return output.length === 1 ? output[0] : output[fetch.outputTensorIndex];\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig, Optimizer, Scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from '../backend/state';\nimport * as K from '../backend/tfjs_backend';\nimport {BaseCallback, BaseLogger, CallbackList, CustomCallbackConfig, History, standardizeCallbacks} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensorMap, Shape} from '../types';\nimport {count, pyListRepeat, singletonOrArray, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {LayerVariable} from '../variables';\n\nimport {Container, ContainerConfig} from './container';\nimport {execute, FeedDict} from './executor';\nimport {SymbolicTensor} from './topology';\n\n// tslint:enable:max-line-length\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < names.length; ++i) {\n const array = arrays[i];\n if (array.shape.length === 1) {\n arrays[i] = K.expandDims(array, 1);\n }\n }\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `Tensor`s for inputs.\n * @param targets `Array` of `Tensor`s for targets.\n * @param weights Optional `Array` of `Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Slice an Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nfunction sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => K.sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return K.sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice an Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `Tensor` or `Array` of `Tensor`s to slice.\n * If an `Array` of `Tensor`s, all `Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return K.gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `Tensor` or an Array of `Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An `Array` or dict (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: if `null` or `undefined` value is provided.\n */\nfunction collectMetrics(\n metrics: string[]|{[outputName: string]: string | string[]},\n outputNames: string[]): string[][] {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n if (Array.isArray(metrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(name => metrics);\n } else if (metrics != null) {\n // In this case, metrics is a dict.\n const nestedMetrics: string[][] = [];\n for (const name of outputNames) {\n let outputMetrics: string|string[] =\n metrics.hasOwnProperty(name) ? metrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics as string[]);\n }\n return nestedMetrics;\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an Array or ' +\n 'Object, found: ' + metrics);\n }\n}\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\nexport interface ModelEvaluateConfig {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Interface for specifying data to fit a model to data.\n */\nexport interface ModelFitConfig {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /** The number of times to iterate over the training data arrays. */\n epochs?: number;\n\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can consist of one or more of the following fields: `onTrainBegin`,\n * `onTrainEnd`, `onEpochBegin`, `onEpochEnd`, `onBatchBegin`, `onBatchEnd`.\n */\n callbacks?: BaseCallback[]|CustomCallbackConfig|CustomCallbackConfig[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional dictionary mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n */\n classWeight?: {[classIndex: string]: number};\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run).\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n *\n */\n yieldEvery?: 'batch'|'epoch'|'never';\n}\n\n/**\n * Configuration for calls to `Model.compile()`.\n */\nexport interface ModelCompileConfig {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string[]|{[outputName: string]: string};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\n/**\n * A `Model` is a directed, acyclic graph of `Layer`s plus methods for\n * training, evaluation, prediction and saving.\n *\n * `Model` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `Model`, use `model`.\n *\n * See also:\n * `Sequential`, `loadModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Model extends Container implements tfc.InferenceModel {\n static className = 'Model';\n optimizer: Optimizer;\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n stopTraining: boolean;\n\n metrics: string[]|{[outputName: string]: string};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the Model\n // a metric belongs to. This is unlike `metrics_tensors` in PyKeras,\n // which is a `list` of symbolic tensors, each of which has implicit\n // \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n constructor(config: ContainerConfig) {\n super(config);\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param config a `ModelCompileConfig` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [0]}\n */\n compile(config: ModelCompileConfig): void {\n if (config.loss == null) {\n config.loss = [];\n }\n this.loss = config.loss;\n\n if (typeof config.optimizer === 'string') {\n this.optimizer = optimizers.getOptimizer(config.optimizer);\n } else {\n if (!(config.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer = config.optimizer;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(config.loss) && typeof config.loss !== 'string' &&\n typeof config.loss !== 'function') {\n config.loss = config.loss as {[outputName: string]: string};\n for (const name in config.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". Only expect the ` +\n `following keys: ${this.outputNames}`);\n }\n }\n for (const name in this.outputNames) {\n if (config.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(config.loss[name]));\n }\n } else if (Array.isArray(config.loss)) {\n if (config.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${config.loss}.`);\n }\n const theLosses = config.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(config.loss);\n this.outputs.map(layer => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for weighted losses.\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = config.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(config.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: string[]) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName = metricNamePrefix + metric;\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n private checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `Tensor` of test data, or an `Array` of `Tensor`s if the model has\n * multiple inputs.\n * @param y `Tensor` of target data, or an `Array` of `Tensor`s if the model\n * has multiple outputs.\n * @param config A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n config: ModelEvaluateConfig = {}): Scalar|Scalar[] {\n const batchSize = config.batchSize == null ? 32 : config.batchSize;\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const standardizedOuts = this.standardizeUserData(x, y, true, batchSize);\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element of\n // the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, config.verbose, config.steps);\n return singletonOrArray(testOuts);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before declaring\n * loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute intrenal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames = (outputsIsArray ? outputs as string[] :\n [outputs as string]) as string[];\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs as Tensor];\n }\n if (Array.isArray(inputs)) {\n if ((inputs as Tensor[]).length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${(inputs as Tensor[]).length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], (inputs as Tensor[])[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = (inputs as NamedTensorMap)[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] = Array.isArray(layer.output) ?\n layer.output as SymbolicTensor[] :\n [layer.output as SymbolicTensor];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `Tensor` (if a single output) or an `Array` of\n * `Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outs: Tensor[] = [];\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n if (batchIndex === 0) {\n // Pre-allocate.\n for (const batchOut of batchOuts) {\n outs.push(batchOut);\n }\n } else {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs[i] = K.concatAlongFirstAxis(outs[i], batchOuts[i]);\n }\n }\n }\n return singletonOrArray(outs);\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as an Tensor, or an `Array` of `Tensor`s if\n * the model has multiple inputs.\n * @param config A `ModelPredictConfig` object containing optional fields.\n *\n * @return Prediction results as a `Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [1]}\n */\n predict(x: Tensor|Tensor[], config: ModelPredictConfig = {}): Tensor\n |Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, false);\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = config.batchSize == null ? 32 : config.batchSize;\n return this.predictLoop(x, batchSize);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as an Tensor\n * @return Tensor(s) of predictions\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n return this.predictLoop(x, x.shape[0]);\n }\n\n protected standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'Model.compile(modelCompileConfig).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input') as\n Tensor[];\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target') as Tensor[];\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n // TODO(cais): Deal with the case of model.stateful == true.\n return [x, y, null];\n }\n\n /**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown.\n * @param epochs Number of times to iterate over the data.\n * @param verbose Verbosity mode: 0, 1, or 2.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run).\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\n private async fitLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], outLabels?: string[],\n batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n this.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n this.history = new History();\n if (callbacks == null) {\n callbacks = [new BaseLogger()];\n } else {\n callbacks = ([new BaseLogger()] as BaseCallback[]).concat(callbacks);\n }\n callbacks = callbacks.concat([this.history]);\n\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n const callbackList = new CallbackList(callbacks);\n\n // TODO(cais): Figure out when this Model instance can have a dynamically\n // set property called 'callback_model' as in PyKeras.\n callbackList.setModel(this);\n callbackList.setParams({\n epochs,\n initialEpoch,\n steps: stepsPerEpoch,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n await callbackList.onTrainBegin();\n this.stopTraining = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError(\n 'batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = K.sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = this.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (this.stopTraining) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (this.stopTraining) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await this.history.syncData();\n return this.history;\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before declaring\n * test finished. Ignored with the default value of `null` / `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose === 1) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(getScalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(\n outs[i],\n tfc.mul(getScalar(batchEnd - batchStart), batchOut)) as\n Scalar;\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], getScalar(numSamples)) as Scalar;\n }\n }\n return outs;\n });\n }\n\n private getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer shared\n // among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss = tfc.mean(lossFunction(targets[i], outputs[i])) as Scalar;\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss) as Scalar;\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0]; // TODO(cais): Restore.\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `Tensor` of training data, or an array of `Tensor`s if the model\n * has multiple inputs. If all inputs in the model are named, you can also\n * pass a dictionary mapping input names to `Tensor`s.\n * @param y `Tensor` of target (label) data, or an array of `Tensor`s if the\n * model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `Tensor`s.\n * @param config A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n config: ModelFitConfig = {}): Promise {\n const batchSize = config.batchSize == null ? 32 : config.batchSize;\n\n // Validate user data.\n // TODO(cais): Add sampleWeight and classWeight.\n const standardizedOuts = this.standardizeUserData(x, y, false, batchSize);\n let inputs = standardizedOuts[0];\n let targets = standardizedOuts[1];\n // TODO(cais): Make use of sampleWeights in standardizedOuts[2] when\n // available.\n\n // Prepare validation data.\n let doValidation = false;\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let valIns: Tensor[];\n // A flag to keep track of whether `valIns`, `inputs` and `targets` need\n // to be memory-disposed prior to returning from this method. This is the\n // case if `config.validationSplit` is set to a number between 0 and 1, in\n // which case the input `x` and `y` tensors will be sliced, leading to\n // allocation of new tensor memory.\n let needValidationDisposal = false;\n if (config.validationData != null && config.validationData.length > 0) {\n doValidation = true;\n if (config.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n valX = config.validationData[0];\n valY = config.validationData[1];\n } else if (config.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${config.validationData} is invalid.`);\n }\n\n const valStandardized =\n this.standardizeUserData(valX, valY, true, batchSize);\n valX = valStandardized[0] as Tensor[];\n valY = valStandardized[1] as Tensor[];\n // TODO(cais): Use validation sample weights in valStandardized[2] once\n // it becomes available.\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n config.validationSplit != null && config.validationSplit > 0 &&\n config.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always an Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - config.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n needValidationDisposal = true;\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (config.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets);\n\n this.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the training\n // process. Instead, we define a function that performs the training\n // action.\n // In PyKeras, the data (inputs and targets) are fed through graph\n // placeholders. In tfjs-layers, the data are fed as function arguments.\n // Since the function are defined below in the scope, we don't have\n // equivalents of PyKeras's `_make_train_funciton`.\n\n // Creat a function that performs the following actions:\n // 1) computes the losses,\n // 2) add them to get the total loss,\n // 3) call the optimizer computes the gradients of the Model's trainable\n // weights w.r.t. the total loss and update the variables.\n // 4) calculate the metrics\n // 5) return the values of the losses and metrics.\n const trainFunction = (data: Tensor[]) => {\n const losses: Tensor[] = [];\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the inputs.\n // This function is used for obtaining gradients through backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n const loss = lossFunction(targets[i], outputs[i]);\n losses.push(loss);\n // TODO(cais): push Scalar instead.\n const meanLoss = tfc.mean(loss) as Scalar;\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex])) as\n Scalar;\n tfc.keep(meanMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(meanMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n\n const outLabels = this.getDedupedMetricsNames();\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n this.makeTestFunction();\n valFunction = this.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(config.callbacks);\n const out = await this.fitLoop(\n trainFunction, ins, outLabels, batchSize, config.epochs, config.verbose,\n callbacks, valFunction, valIns, config.shuffle, callbackMetrics,\n config.initialEpoch, null, null);\n if (needValidationDisposal) {\n valIns.forEach(tensor => tensor.dispose());\n inputs.forEach(tensor => tensor.dispose());\n targets.forEach(tensor => tensor.dispose());\n }\n return out;\n // TODO(cais): Add value to outLabels.\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensorMap {\n const namedWeights: NamedTensorMap = {};\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights[weights[i].originalName] = weightValues[i];\n }\n return namedWeights;\n }\n\n // tslint:disable:max-line-length\n /**\n * Save the configuration and/or weights of the Model.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or transmission\n * of serialized data (\"artifacts\") that represent the model's topology and\n * weights onto or via a specific medium, such as file downloads, local\n * storage, IndexedDB in the web browser and HTTP requests to a server.\n * TensorFlow.js provides `IOHandler` implementations for a number of\n * frequently used saving mediums, such as `tf.io.browserDownloads` and\n * `tf.io.browserLocalStorage`. See `tf.io` for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s as\n * URL-like string shortcuts, such as 'localstorage://' and 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.browserHTTPRequests` for more details\n * including specifying request parameters and implementation of the server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of the\n * saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [1]}\n */\n // tslint:enable:max-line-length\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'Model.save() cannot proceed because the IOHandler provided does ' +\n 'not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n\n return handlerOrURL.save({\n modelTopology: modelConfig,\n weightData: weightDataAndSpecs.data,\n weightSpecs: weightDataAndSpecs.specs\n });\n }\n}\n\nserialization.SerializationMap.register(Model);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\n// tslint:disable:max-line-length\nimport {io, Scalar, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {Model, ModelCompileConfig, ModelEvaluateConfig, ModelFitConfig} from './engine/training';\nimport {RuntimeError, ValueError} from './errors';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensorMap, Shape} from './types';\nimport {JsonDict} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n// tslint:enable:max-line-length\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `Model` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig,\n customObjects?: serialization.ConfigDict): Promise {\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as JsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as Model;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues =\n await io.loadWeights(\n modelAndWeightsConfig.weightsManifest,\n modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName)) as NamedTensorMap;\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n const skipMismatches: boolean = null;\n const isNamedTensorMap = true;\n model.loadWeights(uniqueWeightValues, skipMismatches, isNamedTensorMap);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: JsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictConfig {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n// tslint:disable:max-line-length\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json')\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n *\n * @returns A `Promise` of `Model`, with the topology and weights loaded.\n */\n// tslint:enable:max-line-length\nexport async function loadModelInternal(pathOrIOHandler: string|\n io.IOHandler): Promise {\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadModelFromIOHandler(pathOrIOHandler as io.IOHandler);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n */\nexport async function loadModelFromIOHandler(\n handler: io.IOHandler,\n customObjects?: serialization.ConfigDict): Promise {\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as JsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as JsonDict;\n }\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects) as Model;\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'Model artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const skipMismatch = false;\n const isNamedTensorMap = true;\n model.loadWeights(\n io.decodeWeights(artifacts.weightData, artifacts.weightSpecs),\n skipMismatch, isNamedTensorMap);\n }\n return model;\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialConfig {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `sequential` is a factory function that creates an instance of\n * `Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Sequential extends Model {\n static className = 'Sequential';\n private model: Model;\n private _updatable: boolean;\n constructor(config?: SequentialConfig) {\n super({inputs: [], outputs: []});\n config = config || {};\n\n this.trainable = true;\n this._updatable = true;\n this.built = false;\n\n // Set model name.\n this.name = (config.name != null) ? config.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (config.layers != null) {\n for (const layer of config.layers) {\n this.add(layer);\n }\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its input\n * shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof Model;\n let modelLayer: Model;\n if (isLayerModelInstance) {\n modelLayer = layer as Model;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. Model received layer ${layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new Model({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n this.model.updatable = this.updatable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n get updatable(): boolean {\n return this._updatable;\n }\n\n set updatable(value: boolean) {\n if (this.built) {\n this.model.updatable = value;\n }\n this._updatable = value;\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `Tensor` of test data, or an `Array` of `Tensor`s if the model\n * has multiple inputs.\n * @param y `Tensor` of target data, or an `Array` of `Tensor`s if the model\n * has multiple outputs.\n * @param config A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n config: ModelEvaluateConfig = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, config);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as an Tensor, or an `Array` of `Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [1]}\n */\n predict(x: Tensor|Tensor[], config: ModelPredictConfig = {}): Tensor\n |Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, config);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as an Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `Model.compile`.\n *\n * @param config\n */\n compile(config: ModelCompileConfig): void {\n this.build();\n this.model.compile(config);\n this.optimizer = this.model.optimizer;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `Tensor` of training data, or an array of `Tensor`s if the model\n * has multiple inputs. If all inputs in the model are named, you can also\n * pass a dictionary mapping input names to `Tensor`s.\n * @param y `Tensor` of target (label) data, or an array of `Tensor`s if the\n * model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `Tensor`s.\n * @param config A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n config: ModelFitConfig = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, config);\n }\n\n /* See parent class for JsDoc */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const model = new cls({});\n if (!(model instanceof Sequential)) {\n throw new ValueError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n if (!(config instanceof Array)) {\n throw new ValueError(\n `Sequential.fromConfig called without an array of configs`);\n }\n if (!(config[0].className != null) || config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n for (const conf of config as serialization.ConfigDictArray) {\n const layer = deserialize(conf as serialization.ConfigDict) as Layer;\n model.add(layer);\n }\n return model;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const config: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n config.push({\n className: layer.getClassName(),\n config: layer.getConfig(),\n });\n }\n return config;\n }\n}\nserialization.SerializationMap.register(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\n// tslint:disable:max-line-length\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {ContainerConfig} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {Model} from './engine/training';\nimport {loadModelInternal, Sequential, SequentialConfig} from './models';\n\n// tslint:enable:max-line-length\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Model and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `model` and `sequential` is that `model`\n * is more generic, supporting an arbitrary graph (without cycles) of layers.\n * `sequential` is less generic and supports only a linear stack of layers.\n *\n * When creating a `Model`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 2, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `sequential`, `loadModel`.\n */\n\n/**\n * @doc {heading: 'Models', subheading: 'Creation', configParamIndices: [0]}\n */\nexport function model(config: ContainerConfig): Model {\n return new Model(config);\n}\n\n/**\n * Creates a `Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a Sequential model should have a\n * defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `model` and `sequential` is that `sequential`\n * is less generic, supporting only a linear stack of layers. `model` is\n * more generic and supports an arbitrary graph (without cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n */\n/**\n * @doc {heading: 'Models', subheading: 'Creation', configParamIndices: [0]}\n */\nexport function sequential(config?: SequentialConfig): Sequential {\n return new Sequential(config);\n}\n\n/**\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * useDocsFrom: 'loadModelInternal'\n * }\n */\nexport function loadModel(pathOrIOHandler: string|\n io.IOHandler): Promise {\n return loadModelInternal(pathOrIOHandler);\n}\n\n/**\n * @doc {\n * heading: 'Models',\n * subheading: 'Inputs',\n * useDocsFrom: 'Input',\n * configParamIndices: [0]\n * }\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {getScalar} from './backend/state';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/** @docinline */\nexport type ActivationIdentifier = 'elu'|'hardSigmoid'|'linear'|'relu'|'relu6'|\n 'selu'|'sigmoid'|'softmax'|'softplus'|'softsign'|'tanh'|string;\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.SerializationMap.register(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.SerializationMap.register(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.SerializationMap.register(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(getScalar(6.0), tfc.relu(x)));\n }\n}\nserialization.SerializationMap.register(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.SerializationMap.register(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.SerializationMap.register(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.SerializationMap.register(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.SerializationMap.register(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.SerializationMap.register(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.SerializationMap.register(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.SerializationMap.register(Softmax);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config = {className: 'linear', config: {}};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config = {className: identifier, config: {}};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {elu, leakyRelu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {getExactlyOneTensor} from '../utils/types_utils';\n\nexport interface LeakyReLULayerConfig extends LayerConfig {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n */\nexport class LeakyReLU extends Layer {\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(config?: LeakyReLULayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n\n this.alpha = config.alpha == null ? this.DEFAULT_ALPHA : config.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(LeakyReLU);\n\n// TODO(cais): Implement PReLU\n\nexport interface ELULayerConfig extends LayerConfig {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n */\nexport class ELU extends Layer {\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(config?: ELULayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n\n if (config.alpha != null && config.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${config.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = config.alpha == null ? this.DEFAULT_ALPHA : config.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(ELU);\n\nexport interface ThresholdedReLULayerConfig extends LayerConfig {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n */\nexport class ThresholdedReLU extends Layer {\n static className = 'ThresholdedReLU';\n readonly theta: number;\n private readonly thetaTensor: Tensor;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(config?: ThresholdedReLULayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n\n this.theta = config.theta == null ? this.DEFAULT_THETA : config.theta;\n this.thetaTensor = getScalar(this.theta);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.thetaTensor), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(ThresholdedReLU);\n\nexport interface SoftmaxLayerConfig extends LayerConfig {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n */\nexport class Softmax extends Layer {\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(config?: SoftmaxLayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = config.axis == null ? this.DEFAULT_AXIS : config.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from './backend/state';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n// tslint:enable:max-line-length\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Config {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Config {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Config {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n */\n/** @doc {heading: 'Regularizers', namespace: 'regularizers'} */\nexport class L1L2 extends Regularizer {\n static className = 'L1L2';\n\n private readonly l1: Scalar;\n private readonly l2: Scalar;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(config?: L1L2Config) {\n super();\n\n const l1 = config == null || config.l1 == null ? 0.01 : config.l1;\n const l2 = config == null || config.l2 == null ? 0.01 : config.l2;\n this.hasL1 = l1 !== 0;\n this.hasL2 = l2 !== 0;\n\n this.l1 = getScalar(l1);\n this.l2 = getScalar(l2);\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1.dataSync()[0], 'l2': this.l2.dataSync()[0]};\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config.l1 as number, l2: config.l2 as number});\n }\n}\nserialization.SerializationMap.register(L1L2);\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param config l1 config.\n */\nexport function l1(config?: L1Config) {\n return new L1L2({l1: config != null ? config.l1 : null, l2: 0});\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param config l2 config.\n */\nexport function l2(config: L2Config) {\n return new L1L2({l2: config != null ? config.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {PaddingMode} from '../common';\nimport {ValueError} from '../errors';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be a tuple of ${n} integers. Received: ` +\n `${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be a tuple of ${\n n} integers. Received: ` +\n `${JSON.stringify(value)} including a non-integer number ` +\n `${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, DataFormat, PaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerConfig} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n// tslint:enable:max-line-length\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBias expects input to be of rank 3 or 4, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBias expects kernel to be of rank 3 or 4, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv2d(\n y as Tensor3D | Tensor4D, kernel as Tensor4D,\n strides as [number, number], padding === 'same' ? 'same' : 'valid',\n 'NHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport interface BaseConvLayerConfig extends LayerConfig {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: string;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D).\n */\nexport interface ConvLayerConfig extends BaseConvLayerConfig {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, config: BaseConvLayerConfig) {\n super(config as LayerConfig);\n BaseConv.verifyConfig(config);\n this.rank = rank;\n if (this.rank !== 1 && this.rank !== 2) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1 or 2 (${this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(config.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n config.strides == null ? 1 : config.strides, rank, 'strides');\n this.padding = config.padding == null ? 'valid' : config.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(config.activation);\n this.useBias = config.useBias == null ? true : config.useBias;\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(config.biasConstraint);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n this.activityRegularizer = getRegularizer(config.activityRegularizer);\n this.dilationRate = normalizeArray(\n config.dilationRate == null ? 1 : config.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) &&\n (this.dilationRate as number[]).length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n }\n if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyConfig(config: BaseConvLayerConfig) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in config, `required key 'kernelSize' not in config`);\n if (typeof config.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n config.kernelSize, 'number', 1, 2))\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(config.kernelSize)}.`);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, config: ConvLayerConfig) {\n super(rank, config as BaseConvLayerConfig);\n Conv.verifyConfig(config);\n this.filters = config.filters;\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n throw new NotImplementedError('3D convolution is not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyConfig(config: ConvLayerConfig) {\n // Check config.filters type, shape, and value.\n if (!('filters' in config) || typeof config.filters !== 'number' ||\n config.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(config.filters)}`);\n }\n }\n}\n\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n */\nexport class Conv2D extends Conv {\n static className = 'Conv2D';\n constructor(config: ConvLayerConfig) {\n super(2, config);\n Conv2D.verifyConfig(config);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyConfig(config: ConvLayerConfig) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof config.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n config.kernelSize, 'number', 1, 2))\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(config.kernelSize)}.`);\n }\n}\nserialization.SerializationMap.register(Conv2D);\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n */\nexport class Conv2DTranspose extends Conv2D {\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(config: ConvLayerConfig) {\n super(config);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]) as Tensor4D;\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.SerializationMap.register(Conv2DTranspose);\n\n\nexport interface SeparableConvLayerConfig extends ConvLayerConfig {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\n\nexport class SeparableConv extends Conv {\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerConfig) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n */\nexport class SeparableConv2D extends SeparableConv {\n static className = 'SeparableConv2D';\n constructor(config?: SeparableConvLayerConfig) {\n super(2, config);\n }\n}\nserialization.SerializationMap.register(SeparableConv2D);\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n */\nexport class Conv1D extends Conv {\n static className = 'Conv1D';\n constructor(config: ConvLayerConfig) {\n super(1, config);\n Conv1D.verifyConfig(config);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n static verifyConfig(config: ConvLayerConfig) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof config.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n config.kernelSize, 'number', 1, 1))\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(config.kernelSize)}.`);\n }\n}\nserialization.SerializationMap.register(Conv1D);\n\nexport interface Cropping2DLayerConfig extends LayerConfig {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n */\nexport class Cropping2D extends Layer {\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(config: Cropping2DLayerConfig) {\n super(config);\n if (typeof config.cropping === 'number')\n this.cropping = [\n [config.cropping, config.cropping], [config.cropping, config.cropping]\n ];\n else if (typeof config.cropping[0] === 'number')\n this.cropping = [\n [config.cropping[0] as number, config.cropping[0] as number],\n [config.cropping[1] as number, config.cropping[1] as number]\n ];\n else\n this.cropping = config.cropping as [[number, number], [number, number]];\n this.dataFormat =\n config.dataFormat === undefined ? 'channelsLast' : config.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst')\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1]\n ];\n else\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Cropping2D);\n\nexport interface UpSampling2DLayerConfig extends LayerConfig {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n */\nexport class UpSampling2D extends Layer {\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n\n constructor(config: UpSampling2DLayerConfig) {\n super(config);\n this.inputSpec = [{ndim: 4}];\n this.size = config.size == null ? this.DEFAULT_SIZE : config.size;\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n const resized = input.resizeNearestNeighbor([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return input.resizeNearestNeighbor([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\n// tslint:disable:max-line-length\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, DataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerConfig, ConvLayerConfig, preprocessConv2DInput} from './convolutional';\n\n// tslint:enable:max-line-length\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport interface DepthwiseConv2DLayerConfig extends BaseConvLayerConfig {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n */\nexport class DepthwiseConv2D extends BaseConv {\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(config: DepthwiseConv2DLayerConfig) {\n super(2, config as ConvLayerConfig);\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.SerializationMap.register(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\n// tslint:disable:max-line-length\nimport {Activation as ActivationFn, ActivationIdentifier, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n// tslint:enable:max-line-length\n\nexport interface DropoutLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n */\nexport class Dropout extends Layer {\n static className = 'Dropout';\n private readonly rate: number;\n private readonly rateScalar: Scalar;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(config: DropoutLayerConfig) {\n super(config);\n this.rate = Math.max(Math.min(config.rate, 1), 0);\n this.rateScalar = getScalar(this.rate);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = config.noiseShape;\n this.seed = config.seed;\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Non-default seed is not implemented in Dropout layer yet: ' +\n this.seed);\n }\n this.supportsMasking = true;\n }\n\n private getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (this.noiseShape != null &&\n !util.arraysEqual(input.shape, this.noiseShape)) {\n throw new NotImplementedError(\n 'Non-default noise shape is not implemented in Dropout ' +\n 'layer yet: ' + JSON.stringify(this.noiseShape));\n }\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output =\n K.inTrainPhase(\n () => K.dropout(input, this.rateScalar, noiseShape, this.seed),\n () => input, training) as Tensor;\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Dropout);\n\nexport interface DenseLayerConfig extends LayerConfig {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n */\nexport class Dense extends Layer {\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(config: DenseLayerConfig) {\n super(config);\n if (config.batchInputShape == null && config.inputShape == null &&\n config.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (config.batchSize != null) {\n batchSize = config.batchSize;\n }\n this.batchInputShape = [batchSize, config.inputDim];\n }\n\n this.units = config.units;\n this.activation = getActivation(config.activation);\n if (config.useBias != null) {\n this.useBias = config.useBias;\n }\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n this.activityRegularizer = getRegularizer(config.activityRegularizer);\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n let output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Dense);\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n */\nexport class Flatten extends Layer {\n static className = 'Flatten';\n constructor(config?: LayerConfig) {\n super(config || {});\n this.inputSpec = [{minNDim: 3}];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], math_utils.arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return K.batchFlatten(getExactlyOneTensor(inputs));\n });\n }\n}\nserialization.SerializationMap.register(Flatten);\n\nexport interface ActivationLayerConfig extends LayerConfig {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n */\nexport class Activation extends Layer {\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(config: ActivationLayerConfig) {\n super(config);\n this.supportsMasking = true;\n this.activation = getActivation(config.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Activation);\n\nexport interface ReshapeLayerConfig extends LayerConfig {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport interface RepeatVectorLayerConfig extends LayerConfig {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n */\nexport class RepeatVector extends Layer {\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(config: RepeatVectorLayerConfig) {\n super(config);\n this.n = config.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(RepeatVector);\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary: although all dimensions in the input shape must be fixed.\n * Use the ReshapeLayerConfig field `input_shape` when using this layer\n * as the first layer in a model.\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n */\nexport class Reshape extends Layer {\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(config: ReshapeLayerConfig) {\n super(config);\n this.targetShape = config.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = math_utils.arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Reshape);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\n// tslint:disable:max-line-length\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n// tslint:enable:max-line-length\n\nexport interface EmbeddingLayerConfig extends LayerConfig {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n */\nexport class Embedding extends Layer {\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(config: EmbeddingLayerConfig) {\n super(config);\n if (config.batchInputShape == null && config.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (config.batchSize != null) {\n batchSize = config.batchSize;\n }\n if (config.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(config.inputLength));\n }\n }\n this.inputDim = config.inputDim;\n this.outputDim = config.outputDim;\n this.embeddingsInitializer = getInitializer(\n config.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(config.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(config.activityRegularizer);\n this.embeddingsConstraint = getConstraint(config.embeddingsConstraint);\n this.maskZero = config.maskZero;\n this.inputLength = config.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n throw new NotImplementedError(\n 'computeMask has not been implemented for Embedding yet');\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nserialization.SerializationMap.register(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerConfig, SymbolicTensor} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(config?: LayerConfig) {\n super(config || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n // TODO(cais): Implement computeMask();\n}\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Add extends Merge {\n static className = 'Add';\n constructor(config?: LayerConfig) {\n super(config as LayerConfig);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = tfc.zeros(inputs[0].shape);\n for (const input of inputs) {\n output = tfc.add(output, input);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Add(config);\n }\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n */\nexport class Multiply extends Merge {\n static className = 'Multiply';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = tfc.ones(inputs[0].shape);\n for (const input of inputs) {\n output = tfc.mul(output, input);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Average extends Merge {\n static className = 'Average';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = tfc.zeros(inputs[0].shape);\n for (const input of inputs) {\n output = tfc.add(output, input);\n }\n return tfc.mul(getScalar(1 / inputs.length), output);\n });\n }\n}\nserialization.SerializationMap.register(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Average(config);\n }\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Maximum extends Merge {\n static className = 'Maximum';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Minimum extends Merge {\n static className = 'Minimum';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport interface ConcatenateLayerConfig extends LayerConfig {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n */\nexport class Concatenate extends Merge {\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(config?: ConcatenateLayerConfig) {\n super(config);\n if (config == null) {\n config = {};\n }\n this.axis = config.axis == null ? this.DEFAULT_AXIS : config.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n // TODO(cais): Implement computeMask();\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerConfig): Layer|SymbolicTensor|\n Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\n// TODO(cais): Add class Dot.\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerConfig} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n// tslint:enable:max-line-length\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNormalization2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, epsilon, gamma as Tensor2D | Tensor1D,\n beta as Tensor2D | Tensor1D);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNormalization3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, epsilon, gamma as Tensor3D | Tensor1D,\n beta as Tensor3D | Tensor1D);\n } else if (x.rank === 4) {\n out = tfc.batchNormalization4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, epsilon, gamma as Tensor4D | Tensor1D,\n beta as Tensor4D | Tensor1D);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implememnted for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport interface BatchNormalizationLayerConfig extends LayerConfig {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n */\nexport class BatchNormalization extends Layer {\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n private stepCount: number;\n\n constructor(config: BatchNormalizationLayerConfig) {\n super(config);\n this.supportsMasking = true;\n this.axis = config.axis == null ? -1 : config.axis;\n this.momentum = config.momentum == null ? 0.99 : config.momentum;\n this.epsilon = config.epsilon == null ? 1e-3 : config.epsilon;\n this.center = config.center == null ? true : config.center;\n this.scale = config.scale == null ? true : config.scale;\n this.betaInitializer = getInitializer(config.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(config.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(config.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(config.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(config.betaConstraint);\n this.gammaConstraint = getConstraint(config.gammaConstraint);\n this.betaRegularizer = getRegularizer(config.betaRegularizer);\n this.gammaRegularizer = getRegularizer(config.gammaRegularizer);\n this.stepCount = 0;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n // Debias variance.\n const sampleSize =\n math_utils.arrayProd(reductionAxes.map(axis => input.shape[axis]));\n const varianceDebiased = variance.mul(\n getScalar(sampleSize / (sampleSize - (1 + this.epsilon))));\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n this.stepCount++;\n const newMovingMean = tfc.movingAverage(\n this.movingMean.read(), mean, this.momentum, this.stepCount);\n this.movingMean.write(newMovingMean);\n const newMovingVariance = tfc.movingAverage(\n this.movingVariance.read(), varianceDebiased, this.momentum,\n this.stepCount);\n this.movingVariance.write(newMovingVariance);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(BatchNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {DataFormat} from '../common';\nimport {InputSpec, Layer, LayerConfig} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n// tslint:enable:max-line-length\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport interface ZeroPadding2DLayerConfig extends LayerConfig {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n */\nexport class ZeroPadding2D extends Layer {\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(config?: ZeroPadding2DLayerConfig) {\n if (config == null) {\n config = {};\n }\n super(config);\n\n this.dataFormat =\n config.dataFormat == null ? imageDataFormat() : config.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (config.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof config.padding === 'number') {\n this.padding =\n [[config.padding, config.padding], [config.padding, config.padding]];\n } else {\n config.padding = config.padding as [number, number] |\n [[number, number], [number, number]];\n if (config.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${config.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof config.padding[0] === 'number') {\n heightPadding =\n [config.padding[0] as number, config.padding[0] as number];\n widthPadding =\n [config.padding[1] as number, config.padding[1] as number];\n } else {\n config.padding = config.padding as [[number, number], [number, number]];\n\n if (config.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${config.padding[0].length} array.`);\n }\n heightPadding = config.padding[0] as [number, number];\n\n if (config.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${config.padding[1].length} array.`);\n }\n widthPadding = config.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode, DataFormat, PaddingMode, PoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput} from './convolutional';\n\n// tslint:enable:max-line-length\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n\nexport interface Pooling1DLayerConfig extends LayerConfig {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number;\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number;\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param config Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(config: Pooling1DLayerConfig) {\n if (config.poolSize == null) {\n config.poolSize = 2;\n }\n super(config);\n if (typeof config.poolSize === 'number') {\n this.poolSize = [config.poolSize];\n } else if (\n Array.isArray(config.poolSize) &&\n (config.poolSize as number[]).length === 1 &&\n typeof (config.poolSize as number[])[0] === 'number') {\n this.poolSize = config.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(config.poolSize)}`);\n }\n if (config.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof config.strides === 'number') {\n this.strides = [config.strides];\n } else if (\n Array.isArray(config.strides) &&\n (config.strides as number[]).length === 1 &&\n typeof (config.strides as number[])[0] === 'number') {\n this.strides = config.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(config.strides)}`);\n }\n }\n\n this.padding = config.padding == null ? 'valid' : config.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n */\nexport class MaxPooling1D extends Pooling1D {\n static className = 'MaxPooling1D';\n constructor(config: Pooling1DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.SerializationMap.register(MaxPooling1D);\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n */\nexport class AveragePooling1D extends Pooling1D {\n static className = 'AveragePooling1D';\n constructor(config: Pooling1DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.SerializationMap.register(AveragePooling1D);\n\nexport interface Pooling2DLayerConfig extends LayerConfig {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(config: Pooling2DLayerConfig) {\n if (config.poolSize == null) {\n config.poolSize = [2, 2];\n }\n super(config);\n this.poolSize = Array.isArray(config.poolSize) ?\n config.poolSize :\n [config.poolSize, config.poolSize];\n if (config.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(config.strides)) {\n if (config.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${config.strides.length}.`);\n }\n this.strides = config.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [config.strides, config.strides];\n }\n this.padding = config.padding == null ? 'valid' : config.padding;\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n */\nexport class MaxPooling2D extends Pooling2D {\n static className = 'MaxPooling2D';\n constructor(config: Pooling2DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.SerializationMap.register(MaxPooling2D);\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n */\nexport class AveragePooling2D extends Pooling2D {\n static className = 'AveragePooling2D';\n constructor(config: Pooling2DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.SerializationMap.register(AveragePooling2D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(config: LayerConfig) {\n super(config);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n */\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n static className = 'GlobalAveragePooling1D';\n constructor(config: LayerConfig) {\n super(config);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.SerializationMap.register(GlobalAveragePooling1D);\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n */\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n static className = 'GlobalMaxPooling1D';\n constructor(config: LayerConfig) {\n super(config);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.SerializationMap.register(GlobalMaxPooling1D);\n\nexport interface GlobalPooling2DLayerConfig extends LayerConfig {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(config: GlobalPooling2DLayerConfig) {\n super(config);\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n */\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.SerializationMap.register(GlobalAveragePooling2D);\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n */\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.SerializationMap.register(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, ActivationIdentifier, getActivation, serializeActivation} from '../activations';\nimport {getScalar} from '../backend/state';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction, Shape} from '../types';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\nimport {deserialize} from './serialization';\n\n// tslint:enable:max-line-length\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param inputLength Not relevant in this deeplearn.js backend.\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n inputLength?: number): [Tensor, Tensor, Tensor[]] {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (mask != null) {\n throw new NotImplementedError(\n 'The rnn() function of the deeplearn.js backend does not support ' +\n 'masking yet.');\n }\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n // TODO(cais): Determine in what exact way the learning phase information\n // will be passed.\n\n let outputs: Tensor;\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n for (let t = 0; t < timeSteps; ++t) {\n let currentInput = K.sliceAlongFirstAxis(inputs, t, 1);\n currentInput = currentInput.reshape(currentInput.shape.slice(1));\n const stepOutputs = stepFunction(currentInput, states);\n lastOutput = stepOutputs[0];\n if (t === 0) {\n outputs = lastOutput.reshape([1].concat(lastOutput.shape));\n } else {\n outputs = K.concatAlongFirstAxis(\n outputs, lastOutput.reshape([1].concat(lastOutput.shape)));\n }\n // TODO(soergel): Call K.concatenate() to perform only one concatenation\n // at the end, once the backend function is available.\n states = stepOutputs[1];\n }\n\n return [\n lastOutput,\n tfc.transpose(\n outputs, [1, 0].concat(math_utils.range(2, outputs.shape.length))),\n states\n ];\n}\n\n\nexport interface BaseRNNLayerConfig extends LayerConfig {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n */\n stateful?: boolean;\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer sbutypes.\n */\nexport interface RNNLayerConfig extends BaseRNNLayerConfig {\n cell: RNNCell|RNNCell[];\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.reset_states()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n */\nexport class RNN extends Layer {\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n public states: Tensor[];\n\n private numConstants: number;\n\n constructor(config: RNNLayerConfig) {\n super(config);\n let cell: RNNCell;\n if (config.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(config.cell)) {\n cell = new StackedRNNCells({cells: config.cell});\n } else {\n cell = config.cell;\n }\n if ((cell as RNNCell).stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n config.returnSequences == null ? false : config.returnSequences;\n this.returnState = config.returnState == null ? false : config.returnState;\n this.goBackwards = config.goBackwards == null ? false : config.goBackwards;\n this._stateful = config.stateful == null ? false : config.stateful;\n this.unroll = config.unroll == null ? false : config.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n throw new NotImplementedError(\n 'computeMask has not been implemented for RNN yet');\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape[inputShape.length - 1];\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray((this.cell as RNNCell).stateSize)) {\n stateSize = this.cell.stateSize as number[];\n } else {\n stateSize = [this.cell.stateSize as number];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n throw new NotImplementedError(\n 'stateful RNN layer is not implemented yet');\n // TODO(cais): Uncomment the following line once stateful = true is\n // implemented.\n // this.resetStates();\n }\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetState() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n for (let index = 0; index < this.states.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states[index] = value;\n }\n }\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `SymbolicTensor`s, then add them to the inputs and temporarily modify the\n // input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n throw new NotImplementedError(\n 'stateful RNN layer is not implemented yet.');\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n if (mask != null) {\n throw new NotImplementedError('Masking is not implemented for RNN yet');\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n const inputShape = inputs.shape;\n const timesteps = inputShape[1];\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n // TODO(cais): Add support for masks.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, null, null,\n this.unroll, timesteps);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n throw new NotImplementedError(\n 'stateful RNN layer is not implemented yet');\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n if (this.numConstants != null) {\n config.numConstants = this.numConstants;\n }\n const cellConfig = this.cell.getConfig();\n config.cell = {\n className: this.cell.getClassName(),\n config: cellConfig,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(RNN);\n\n/**\n * An RNNCell layer.\n */\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/** @doc {heading: 'Layers', subheading: 'Classes'} */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n public stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport interface SimpleRNNCellLayerConfig extends LayerConfig {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n */\nexport class SimpleRNNCell extends RNNCell {\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(config: SimpleRNNCellLayerConfig) {\n super(config);\n this.units = config.units;\n this.activation = getActivation(\n config.activation == null ? this.DEFAULT_ACTIVATION :\n config.activation);\n this.useBias = config.useBias == null ? true : config.useBias;\n\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n config.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.recurrentConstraint = getConstraint(config.recurrentConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, config.recurrentDropout == null ? 0 : config.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask(\n () => tfc.onesLike(inputs as Tensor),\n this.dropout, training) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask =\n generateDropoutMask(\n () => tfc.onesLike(prevOutput), this.recurrentDropout,\n training) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(SimpleRNNCell);\n\nexport interface SimpleRNNLayerConfig extends BaseRNNLayerConfig {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n */\nexport class SimpleRNN extends RNN {\n static className = 'SimpleRNN';\n constructor(config: SimpleRNNLayerConfig) {\n config.cell = new SimpleRNNCell(config);\n super(config as RNNLayerConfig);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n // TODO(cais): Research possibility of refactoring out the tedious all\n // the getters that delegate to `this.cell` below.\n get units(): number {\n return (this.cell as SimpleRNNCell).units;\n }\n\n get activation(): Activation {\n return (this.cell as SimpleRNNCell).activation;\n }\n\n get useBias(): boolean {\n return (this.cell as SimpleRNNCell).useBias;\n }\n\n get kernelInitializer(): Initializer {\n return (this.cell as SimpleRNNCell).kernelInitializer;\n }\n\n get recurrentInitializer(): Initializer {\n return (this.cell as SimpleRNNCell).recurrentInitializer;\n }\n\n get biasInitializer(): Initializer {\n return (this.cell as SimpleRNNCell).biasInitializer;\n }\n\n get kernelRegularizer(): Regularizer {\n return (this.cell as SimpleRNNCell).kernelRegularizer;\n }\n\n get recurrentRegularizer(): Regularizer {\n return (this.cell as SimpleRNNCell).recurrentRegularizer;\n }\n\n get biasRegularizer(): Regularizer {\n return (this.cell as SimpleRNNCell).biasRegularizer;\n }\n\n get kernelConstraint(): Constraint {\n return (this.cell as SimpleRNNCell).kernelConstraint;\n }\n\n get recurrentConstraint(): Constraint {\n return (this.cell as SimpleRNNCell).recurrentConstraint;\n }\n\n get biasConstraint(): Constraint {\n return (this.cell as SimpleRNNCell).biasConstraint;\n }\n\n get dropout(): number {\n return (this.cell as SimpleRNNCell).dropout;\n }\n\n get recurrentDropout(): number {\n return (this.cell as SimpleRNNCell).recurrentDropout;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n const baseConfig = super.getConfig();\n delete baseConfig['cell'];\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport interface GRUCellLayerConfig extends SimpleRNNCellLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: string;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: number;\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n */\nexport class GRUCell extends RNNCell {\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(config: GRUCellLayerConfig) {\n super(config);\n\n this.units = config.units;\n this.activation = getActivation(\n config.activation === undefined ? this.DEFAULT_ACTIVATION :\n config.activation);\n this.recurrentActivation = getActivation(\n config.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n config.recurrentActivation);\n this.useBias = config.useBias == null ? true : config.useBias;\n\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n config.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.recurrentConstraint = getConstraint(config.recurrentConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, config.recurrentDropout == null ? 0 : config.recurrentDropout])\n ]);\n this.implementation = config.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask(\n () => tfc.onesLike(inputs as Tensor),\n this.dropout, training, 3) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask =\n generateDropoutMask(\n () => tfc.onesLike(hTMinus1), this.recurrentDropout, training,\n 3) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n if (this.implementation === 1) {\n const kernelZ = K.sliceAlongLastAxis(this.kernel.read(), 0, this.units);\n const kernelR =\n K.sliceAlongLastAxis(this.kernel.read(), this.units, this.units);\n const kernelH = K.sliceAlongLastAxis(\n this.kernel.read(), this.units * 2, this.units);\n const recurrentKernelZ =\n K.sliceAlongLastAxis(this.recurrentKernel.read(), 0, this.units);\n const recurrentKernelR = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units, this.units);\n const recurrentKernelH = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units * 2, this.units);\n\n let inputsZ: Tensor, inputsR: Tensor, inputsH: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputsZ = tfc.mul(inputs, dpMask[0]);\n inputsR = tfc.mul(inputs, dpMask[1]);\n inputsH = tfc.mul(inputs, dpMask[2]);\n } else {\n inputsZ = inputs;\n inputsR = inputs;\n inputsH = inputs;\n }\n\n let xZ = K.dot(inputsZ, kernelZ);\n let xR = K.dot(inputsR, kernelR);\n let xH = K.dot(inputsH, kernelH);\n if (this.useBias) {\n const biasZ = K.sliceAlongFirstAxis(this.bias.read(), 0, this.units);\n const biasR =\n K.sliceAlongFirstAxis(this.bias.read(), this.units, this.units);\n const biasH = K.sliceAlongFirstAxis(\n this.bias.read(), this.units * 2, this.units);\n xZ = K.biasAdd(xZ, biasZ);\n xR = K.biasAdd(xR, biasR);\n xH = K.biasAdd(xH, biasH);\n }\n\n let hTMinus1Z: Tensor;\n let hTMinus1R: Tensor;\n let hTMinus1H: Tensor;\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1Z = tfc.mul(hTMinus1, recDpMask[0]);\n hTMinus1R = tfc.mul(hTMinus1, recDpMask[1]);\n hTMinus1H = tfc.mul(hTMinus1, recDpMask[2]);\n } else {\n hTMinus1Z = hTMinus1;\n hTMinus1R = hTMinus1;\n hTMinus1H = hTMinus1;\n }\n z = this.recurrentActivation.apply(\n tfc.add(xZ, K.dot(hTMinus1Z, recurrentKernelZ)));\n r = this.recurrentActivation.apply(\n tfc.add(xR, K.dot(hTMinus1R, recurrentKernelR)));\n hh = this.activation.apply(\n tfc.add(xH, K.dot(tfc.mul(r, hTMinus1H), recurrentKernelH)));\n } else {\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.dropout && this.dropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n const matrixInner = K.dot(\n hTMinus1,\n K.sliceAlongLastAxis(\n this.recurrentKernel.read(), 0, 2 * this.units));\n\n const xZ = K.sliceAlongLastAxis(matrixX, 0, this.units);\n const xR = K.sliceAlongLastAxis(matrixX, this.units, this.units);\n const recurrentZ = K.sliceAlongLastAxis(matrixInner, 0, this.units);\n const recurrentR =\n K.sliceAlongLastAxis(matrixInner, this.units, this.units);\n\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const xH = K.sliceAlongLastAxis(matrixX, 2 * this.units, this.units);\n const recurrentH = K.dot(\n tfc.mul(r, hTMinus1),\n K.sliceAlongLastAxis(\n this.recurrentKernel.read(), 2 * this.units, this.units));\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n }\n\n const h = tfc.add(\n tfc.mul(z, hTMinus1), tfc.mul(tfc.add(getScalar(1), tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport interface GRULayerConfig extends SimpleRNNLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: string;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: number;\n}\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n */\nexport class GRU extends RNN {\n static className = 'GRU';\n constructor(config: GRULayerConfig) {\n if (config.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n config.cell = new GRUCell(config);\n super(config as RNNLayerConfig);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n get units(): number {\n return (this.cell as GRUCell).units;\n }\n\n get activation(): Activation {\n return (this.cell as GRUCell).activation;\n }\n\n get recurrentActivation(): Activation {\n return (this.cell as GRUCell).recurrentActivation;\n }\n\n get useBias(): boolean {\n return (this.cell as GRUCell).useBias;\n }\n\n get kernelInitializer(): Initializer {\n return (this.cell as GRUCell).kernelInitializer;\n }\n\n get recurrentInitializer(): Initializer {\n return (this.cell as GRUCell).recurrentInitializer;\n }\n\n get biasInitializer(): Initializer {\n return (this.cell as GRUCell).biasInitializer;\n }\n\n get kernelRegularizer(): Regularizer {\n return (this.cell as GRUCell).kernelRegularizer;\n }\n\n get recurrentRegularizer(): Regularizer {\n return (this.cell as GRUCell).recurrentRegularizer;\n }\n\n get biasRegularizer(): Regularizer {\n return (this.cell as GRUCell).biasRegularizer;\n }\n\n get kernelConstraint(): Constraint {\n return (this.cell as GRUCell).kernelConstraint;\n }\n\n get recurrentConstraint(): Constraint {\n return (this.cell as GRUCell).recurrentConstraint;\n }\n\n get biasConstraint(): Constraint {\n return (this.cell as GRUCell).biasConstraint;\n }\n\n get dropout(): number {\n return (this.cell as GRUCell).dropout;\n }\n\n get recurrentDropout(): number {\n return (this.cell as GRUCell).recurrentDropout;\n }\n\n get implementation(): number {\n return (this.cell as GRUCell).implementation;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n delete baseConfig['cell'];\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.SerializationMap.register(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport interface LSTMCellLayerConfig extends SimpleRNNCellLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: 1|2;\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n */\nexport class LSTMCell extends RNNCell {\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(config: LSTMCellLayerConfig) {\n super(config);\n\n this.units = config.units;\n this.activation = getActivation(\n config.activation === undefined ? this.DEFAULT_ACTIVATION :\n config.activation);\n this.recurrentActivation = getActivation(\n config.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n config.recurrentActivation);\n this.useBias = config.useBias == null ? true : config.useBias;\n\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n config.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = config.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.recurrentConstraint = getConstraint(config.recurrentConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, config.recurrentDropout == null ? 0 : config.recurrentDropout])\n ]);\n this.implementation = config.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask(\n () => tfc.onesLike(inputs as Tensor),\n this.dropout, training, 4) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask =\n generateDropoutMask(\n () => tfc.onesLike(hTMinus1), this.recurrentDropout, training,\n 4) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (this.implementation === 1) {\n const kernelI = K.sliceAlongLastAxis(this.kernel.read(), 0, this.units);\n const kernelF =\n K.sliceAlongLastAxis(this.kernel.read(), this.units, this.units);\n const kernelC = K.sliceAlongLastAxis(\n this.kernel.read(), this.units * 2, this.units);\n const kernelO = K.sliceAlongLastAxis(\n this.kernel.read(), this.units * 3, this.units);\n const recurrentKernelI =\n K.sliceAlongLastAxis(this.recurrentKernel.read(), 0, this.units);\n const recurrentKernelF = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units, this.units);\n const recurrentKernelC = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units * 2, this.units);\n const recurrentKernelO = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units * 3, this.units);\n\n let inputsI: Tensor, inputsF: Tensor, inputsC: Tensor, inputsO: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputsI = tfc.mul(inputs, dpMask[0]);\n inputsF = tfc.mul(inputs, dpMask[1]);\n inputsC = tfc.mul(inputs, dpMask[2]);\n inputsO = tfc.mul(inputs, dpMask[3]);\n } else {\n inputsI = inputs;\n inputsF = inputs;\n inputsC = inputs;\n inputsO = inputs;\n }\n\n let xI = K.dot(inputsI, kernelI);\n let xF = K.dot(inputsF, kernelF);\n let xC = K.dot(inputsC, kernelC);\n let xO = K.dot(inputsO, kernelO);\n if (this.useBias) {\n const biasI = K.sliceAlongFirstAxis(this.bias.read(), 0, this.units);\n const biasF =\n K.sliceAlongFirstAxis(this.bias.read(), this.units, this.units);\n const biasC = K.sliceAlongFirstAxis(\n this.bias.read(), this.units * 2, this.units);\n const biasO = K.sliceAlongFirstAxis(\n this.bias.read(), this.units * 3, this.units);\n xI = K.biasAdd(xI, biasI);\n xF = K.biasAdd(xF, biasF);\n xC = K.biasAdd(xC, biasC);\n xO = K.biasAdd(xO, biasO);\n }\n\n let hTMinus1I: Tensor, hTMinus1F: Tensor, hTMinus1C: Tensor,\n hTMinus1O: Tensor;\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1I = tfc.mul(hTMinus1, recDpMask[0]);\n hTMinus1F = tfc.mul(hTMinus1, recDpMask[1]);\n hTMinus1C = tfc.mul(hTMinus1, recDpMask[2]);\n hTMinus1O = tfc.mul(hTMinus1, recDpMask[3]);\n } else {\n hTMinus1I = hTMinus1;\n hTMinus1F = hTMinus1;\n hTMinus1C = hTMinus1;\n hTMinus1O = hTMinus1;\n }\n i = this.recurrentActivation.apply(\n tfc.add(xI, K.dot(hTMinus1I, recurrentKernelI)));\n f = this.recurrentActivation.apply(\n tfc.add(xF, K.dot(hTMinus1F, recurrentKernelF)));\n c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(\n i,\n this.activation.apply(\n tfc.add(xC, K.dot(hTMinus1C, recurrentKernelC)))));\n o = this.recurrentActivation.apply(\n tfc.add(xO, K.dot(hTMinus1O, recurrentKernelO)));\n } else {\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const z0 = K.sliceAlongLastAxis(z, 0, this.units);\n const z1 = K.sliceAlongLastAxis(z, this.units, this.units);\n const z2 = K.sliceAlongLastAxis(z, this.units * 2, this.units);\n const z3 = K.sliceAlongLastAxis(z, this.units * 3, this.units);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(\n tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n }\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport interface LSTMLayerConfig extends SimpleRNNLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: string;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: 1|2;\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n */\nexport class LSTM extends RNN {\n static className = 'LSTM';\n constructor(config: LSTMLayerConfig) {\n if (config.implementation as number === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n config.cell = new LSTMCell(config);\n super(config as RNNLayerConfig);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n get units(): number {\n return (this.cell as LSTMCell).units;\n }\n\n get activation(): Activation {\n return (this.cell as LSTMCell).activation;\n }\n\n get recurrentActivation(): Activation {\n return (this.cell as LSTMCell).recurrentActivation;\n }\n\n get useBias(): boolean {\n return (this.cell as LSTMCell).useBias;\n }\n\n get kernelInitializer(): Initializer {\n return (this.cell as LSTMCell).kernelInitializer;\n }\n\n get recurrentInitializer(): Initializer {\n return (this.cell as LSTMCell).recurrentInitializer;\n }\n\n get biasInitializer(): Initializer {\n return (this.cell as LSTMCell).biasInitializer;\n }\n\n get unitForgetBias(): boolean {\n return (this.cell as LSTMCell).unitForgetBias;\n }\n\n get kernelRegularizer(): Regularizer {\n return (this.cell as LSTMCell).kernelRegularizer;\n }\n\n get recurrentRegularizer(): Regularizer {\n return (this.cell as LSTMCell).recurrentRegularizer;\n }\n\n get biasRegularizer(): Regularizer {\n return (this.cell as LSTMCell).biasRegularizer;\n }\n\n get kernelConstraint(): Constraint {\n return (this.cell as LSTMCell).kernelConstraint;\n }\n\n get recurrentConstraint(): Constraint {\n return (this.cell as LSTMCell).recurrentConstraint;\n }\n\n get biasConstraint(): Constraint {\n return (this.cell as LSTMCell).biasConstraint;\n }\n\n get dropout(): number {\n return (this.cell as LSTMCell).dropout;\n }\n\n get recurrentDropout(): number {\n return (this.cell as LSTMCell).recurrentDropout;\n }\n\n get implementation(): number {\n return (this.cell as LSTMCell).implementation;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n delete baseConfig['cell'];\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.SerializationMap.register(LSTM);\n\nexport interface StackedRNNCellsConfig extends LayerConfig {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n */\nexport class StackedRNNCells extends RNNCell {\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(config: StackedRNNCellsConfig) {\n super(config);\n this.cells = config.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n for (const cell of this.cells) {\n // TODO(cais): Take care of input constants.\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim];\n }\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const cellConfigs: serialization.ConfigDict[] = [];\n for (const cell of this.cells) {\n cellConfigs.push({\n 'className': this.getClassName(),\n 'config': cell.getConfig(),\n });\n }\n const config: serialization.ConfigDict = {'cells': cellConfigs};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `Tensor`s with shapes and types matching the\n * output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.SerializationMap.register(StackedRNNCells);\n\nfunction generateDropoutMask(\n ones: () => Tensor, rate: number, training: boolean = null,\n count = 1): Tensor|Tensor[] {\n function droppedInputs(): Tensor {\n return K.dropout(ones(), getScalar(rate));\n }\n if (count > 1) {\n const mask: Tensor[] = [];\n for (let i = 0; i < count; i++) {\n mask.push(K.inTrainPhase(droppedInputs, ones, training));\n }\n mask.forEach(m => tfc.keep(m));\n return mask;\n } else {\n return tfc.keep(K.inTrainPhase(droppedInputs, ones, training));\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from '../backend/state';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerConfig, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\n// tslint:enable:max-line-length\n\nexport interface WrapperLayerConfig extends LayerConfig {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(config: WrapperLayerConfig) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(config);\n this.layer = config.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n */\nexport class TimeDistributed extends Wrapper {\n static className = 'TimeDistributed';\n constructor(config: WrapperLayerConfig) {\n super(config);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n const output = this.layer.call(inputs, kwargs) as Tensor;\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false, null, null, false, inputs.shape[1]);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n}\nserialization.SerializationMap.register(TimeDistributed);\n\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport interface BidirectionalLayerConfig extends WrapperLayerConfig {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are combinied.\n * If `null` or `undefined`, the output will not be combined, they will be\n * returned as an `Array`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nexport class Bidirectional extends Wrapper {\n static className = 'Bidirectional';\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private mergeMode: BidirectionalMergeMode;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(config: BidirectionalLayerConfig) {\n super(config);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call `getConfig()`\n // followed by `deserialize()`. Without this cloning, the layer names\n // saved during serialization will incorrectly contain the 'forward_'\n // prefix.\n // In Python Keras, this is done using `copy.copy` (shallow copy), which\n // does not have a simple equivalent in JavaScript. JavaScript's\n // `Object.assign()` does not copy methods.\n const layerConfig = config.layer.getConfig();\n this.forwardLayer =\n deserialize(\n {className: config.layer.getClassName(), config: layerConfig}) as\n RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n this.backwardLayer =\n deserialize(\n {className: config.layer.getClassName(), config: layerConfig}) as\n RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n checkBidirectionalMergeMode(config.mergeMode);\n this.mergeMode = config.mergeMode;\n if (config.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = config.layer.stateful;\n this.returnSequences = config.layer.returnSequences;\n this.returnState = config.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = config.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape as Shape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs as Tensor | SymbolicTensor;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to this\n // method differ in how the initial states are passed. For symbolic calls,\n // the initial states are passed in the first arg, as an Array of\n // SymbolicTensors; for non-symbolic calls, they are passed in the second\n // arg as a part of the kwargs. Hence the need to temporarily modify\n // inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (kwargs['mask'] != null) {\n throw new NotImplementedError(\n 'The support for masking is not implemented for ' +\n 'Bidirectional layers yet.');\n }\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = (y as Tensor[]).slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(getScalar(0.5), tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n // TODO(cais): Implement computeMask().\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.SerializationMap.register(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable:max-line-length\n\nimport {InputLayer, InputLayerConfig} from './engine/input_layer';\nimport {Layer, LayerConfig} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerConfig, LeakyReLU, LeakyReLULayerConfig, Softmax, SoftmaxLayerConfig, ThresholdedReLU, ThresholdedReLULayerConfig} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, ConvLayerConfig, Cropping2D, Cropping2DLayerConfig, SeparableConv2D, SeparableConvLayerConfig, UpSampling2D, UpSampling2DLayerConfig} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerConfig} from './layers/convolutional_depthwise';\nimport {Activation, ActivationLayerConfig, Dense, DenseLayerConfig, Dropout, DropoutLayerConfig, Flatten, RepeatVector, RepeatVectorLayerConfig, Reshape, ReshapeLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerConfig} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerConfig, Maximum, Minimum, Multiply} from './layers/merge';\nimport {BatchNormalization, BatchNormalizationLayerConfig} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerConfig} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerConfig, MaxPooling1D, MaxPooling2D, Pooling1DLayerConfig, Pooling2DLayerConfig} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerConfig, GRULayerConfig, LSTM, LSTMCell, LSTMCellLayerConfig, LSTMLayerConfig, RNN, RNNCell, RNNLayerConfig, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerConfig, SimpleRNNLayerConfig, StackedRNNCells, StackedRNNCellsConfig} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerConfig, TimeDistributed, Wrapper, WrapperLayerConfig} from './layers/wrappers';\n\n\n// tslint:enable:max-line-length\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Inputs',\n * namespace: 'layers',\n * useDocsFrom: 'InputLayer',\n * configParamIndices: [0]\n * }\n */\nexport function inputLayer(config: InputLayerConfig): Layer {\n return new InputLayer(config);\n}\n\n// Advanced Activation Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'ELU',\n * configParamIndices: [0]\n * }\n */\nexport function elu(config?: ELULayerConfig): Layer {\n return new ELU(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'LeakyReLU',\n * configParamIndices: [0]\n * }\n */\nexport function leakyReLU(config?: LeakyReLULayerConfig): Layer {\n return new LeakyReLU(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'Softmax',\n * configParamIndices: [0]\n * }\n */\nexport function softmax(config?: SoftmaxLayerConfig): Layer {\n return new Softmax(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'ThresholdedReLU',\n * configParamIndices: [0]\n * }\n */\nexport function thresholdedReLU(config?: ThresholdedReLULayerConfig): Layer {\n return new ThresholdedReLU(config);\n}\n\n// Convolutional Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Conv1D',\n * configParamIndices: [0]\n * }\n */\nexport function conv1d(config: ConvLayerConfig): Layer {\n return new Conv1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Conv2D',\n * configParamIndices: [0]\n * }\n */\nexport function conv2d(config: ConvLayerConfig): Layer {\n return new Conv2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Conv2DTranspose',\n * configParamIndices: [0]\n * }\n */\nexport function conv2dTranspose(config: ConvLayerConfig): Layer {\n return new Conv2DTranspose(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'SeparableConv2D',\n * configParamIndices: [0]\n * }\n */\nexport function separableConv2d(config: SeparableConvLayerConfig): Layer {\n return new SeparableConv2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Cropping2D',\n * configParamIndices: [0]\n * }\n */\nexport function cropping2D(config: Cropping2DLayerConfig): Layer {\n return new Cropping2D(config);\n}\n\n/**\n * @doc{\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'UpSampling2D',\n * configParamIndices: [0]\n * }\n */\nexport function upSampling2d(config: UpSampling2DLayerConfig): Layer {\n return new UpSampling2D(config);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'DepthwiseConv2D',\n * configParamIndices: [0]\n * }\n */\n\nexport function depthwiseConv2d(config: DepthwiseConv2DLayerConfig): Layer {\n return new DepthwiseConv2D(config);\n}\n\n// Basic Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Activation',\n * configParamIndices: [0]\n * }\n */\nexport function activation(config: ActivationLayerConfig): Layer {\n return new Activation(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Dense',\n * configParamIndices: [0]\n * }\n */\nexport function dense(config: DenseLayerConfig): Layer {\n return new Dense(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Dropout',\n * configParamIndices: [0]\n * }\n */\nexport function dropout(config: DropoutLayerConfig): Layer {\n return new Dropout(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Flatten',\n * configParamIndices: [0]\n * }\n */\nexport function flatten(config?: LayerConfig): Layer {\n return new Flatten(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'RepeatVector',\n * configParamIndices: [0]\n * }\n */\nexport function repeatVector(config: RepeatVectorLayerConfig): Layer {\n return new RepeatVector(config);\n}\n\n/**\n * @doc{\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Reshape',\n * configParamIndices: [0]\n * }\n */\nexport function reshape(config: ReshapeLayerConfig): Layer {\n return new Reshape(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Embedding',\n * configParamIndices: [0]\n * }\n */\nexport function embedding(config: EmbeddingLayerConfig): Layer {\n return new Embedding(config);\n}\n\n// Merge Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Add',\n * configParamIndices: [0]\n * }\n */\nexport function add(config?: LayerConfig): Layer {\n return new Add(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Average',\n * configParamIndices: [0]\n * }\n */\nexport function average(config?: LayerConfig): Layer {\n return new Average(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Concatenate',\n * configParamIndices: [0]\n * }\n */\nexport function concatenate(config?: ConcatenateLayerConfig): Layer {\n return new Concatenate(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Maximum',\n * configParamIndices: [0]\n * }\n */\nexport function maximum(config?: LayerConfig): Layer {\n return new Maximum(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Minimum',\n * configParamIndices: [0]\n * }\n */\nexport function minimum(config?: LayerConfig): Layer {\n return new Minimum(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Multiply',\n * configParamIndices: [0]\n * }\n */\nexport function multiply(config?: LayerConfig): Layer {\n return new Multiply(config);\n}\n\n// Normalization Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Normalization',\n * namespace: 'layers',\n * useDocsFrom: 'BatchNormalization',\n * configParamIndices: [0]\n * }\n */\nexport function batchNormalization(config: BatchNormalizationLayerConfig):\n Layer {\n return new BatchNormalization(config);\n}\n\n// Padding Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Padding',\n * namespace: 'layers',\n * useDocsFrom: 'ZeroPadding2D',\n * configParamIndices: [0]\n * }\n */\nexport function zeroPadding2d(config?: ZeroPadding2DLayerConfig): Layer {\n return new ZeroPadding2D(config);\n}\n\n// Pooling Layers.\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'AveragePooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function averagePooling1d(config: Pooling1DLayerConfig): Layer {\n return new AveragePooling1D(config);\n}\nexport function avgPool1d(config: Pooling1DLayerConfig): Layer {\n return averagePooling1d(config);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(config: Pooling1DLayerConfig): Layer {\n return averagePooling1d(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'AveragePooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function averagePooling2d(config: Pooling2DLayerConfig): Layer {\n return new AveragePooling2D(config);\n}\nexport function avgPool2d(config: Pooling2DLayerConfig): Layer {\n return averagePooling2d(config);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(config: Pooling2DLayerConfig): Layer {\n return averagePooling2d(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalAveragePooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function globalAveragePooling1d(config: LayerConfig): Layer {\n return new GlobalAveragePooling1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalAveragePooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function globalAveragePooling2d(config: GlobalPooling2DLayerConfig):\n Layer {\n return new GlobalAveragePooling2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalMaxPooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function globalMaxPooling1d(config: LayerConfig): Layer {\n return new GlobalMaxPooling1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalMaxPooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function globalMaxPooling2d(config: GlobalPooling2DLayerConfig): Layer {\n return new GlobalMaxPooling2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'MaxPooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function maxPooling1d(config: Pooling1DLayerConfig): Layer {\n return new MaxPooling1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'MaxPooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function maxPooling2d(config: Pooling2DLayerConfig): Layer {\n return new MaxPooling2D(config);\n}\n\n// Recurrent Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'GRU',\n * configParamIndices: [0]\n * }\n */\nexport function gru(config: GRULayerConfig): Layer {\n return new GRU(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'GRUCell',\n * configParamIndices: [0]\n * }\n */\nexport function gruCell(config: GRUCellLayerConfig): RNNCell {\n return new GRUCell(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'LSTM',\n * configParamIndices: [0]\n * }\n */\nexport function lstm(config: LSTMLayerConfig): Layer {\n return new LSTM(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'LSTMCell',\n * configParamIndices: [0]\n * }\n */\nexport function lstmCell(config: LSTMCellLayerConfig): RNNCell {\n return new LSTMCell(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'SimpleRNN',\n * configParamIndices: [0]\n * }\n */\nexport function simpleRNN(config: SimpleRNNLayerConfig): Layer {\n return new SimpleRNN(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'SimpleRNNCell',\n * configParamIndices: [0]\n * }\n */\nexport function simpleRNNCell(config: SimpleRNNCellLayerConfig): RNNCell {\n return new SimpleRNNCell(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'RNN',\n * configParamIndices: [0]\n * }\n */\nexport function rnn(config: RNNLayerConfig): Layer {\n return new RNN(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'RNN',\n * configParamIndices: [0]\n * }\n */\nexport function stackedRNNCells(config: StackedRNNCellsConfig): RNNCell {\n return new StackedRNNCells(config);\n}\n\n// Wrapper Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Wrapper',\n * namespace: 'layers',\n * useDocsFrom: 'Bidirectional',\n * configParamIndices: [0]\n * }\n */\nexport function bidirectional(config: BidirectionalLayerConfig): Wrapper {\n return new Bidirectional(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Wrapper',\n * namespace: 'layers',\n * useDocsFrom: 'TimeDistributed',\n * configParamIndices: [0]\n * }\n */\nexport function timeDistributed(config: WrapperLayerConfig): Layer {\n return new TimeDistributed(config);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, input /* alias for tf.input */};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'binaryAccuracy'\n * }\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'binaryCrossentropy'\n * }\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'categoricalAccuracy'\n * }\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'categoricalCrossentropy'\n * }\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'cosineProximity'\n * }\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'meanAbsoluteError'\n * }\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'meanAbsolutePercentageError'\n * }\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'meanSquaredError'\n * }\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Config, L1L2, L1L2Config, L2Config, Regularizer} from './regularizers';\n\n/**\n * @doc {\n * heading: 'Regularizers',\n * namespace: 'regularizers',\n * useDocsFrom: 'L1L2',\n * configParamIndices: [0]\n * }\n */\nexport function l1l2(config?: L1L2Config): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * @doc {\n * heading: 'Regularizers',\n * namespace: 'regularizers',\n * useDocsFrom: 'L1L2',\n * configParamIndices: [0]\n * }\n */\nexport function l1(config?: L1Config): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * @doc {\n * heading: 'Regularizers',\n * namespace: 'regularizers',\n * useDocsFrom: 'L1L2',\n * configParamIndices: [0]\n * }\n */\nexport function l2(config?: L2Config): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {Model} from './engine/training';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: Model = null;\n\n setModel(model: Container): void {\n if (!(model instanceof Model)) {\n throw new Error('model must be a Model, not some other Container');\n }\n this.model = model as Model;\n }\n}\n"],"names":["_epsilon","_nextUniqueTensorId","_uidPrefixes","prefix","toString","scalarCache","float32","int32","DEFAULT_DTYPE","value","dtype","undefined","scalar","keep","message","_super","Object","setPrototypeOf","_this","AttributeError","prototype","tslib_1.__extends","Error","RuntimeError","ValueError","NotImplementedError","AssertionError","IndexError","numValues","Array","isArray","newArray","i","concat","fill","val","array","refernce","counter","array_1","_i","xs","length","x","name","insecure","replace","toLowerCase","identifier","indexOf","m","p1","toUpperCase","_GLOBAL_CUSTOM_OBJECTS","instance","className","getClassName","config","getConfig","moduleObjects","customObjects","printableModuleName","functionName","fn","JSON","stringify","cls","fromConfig","_a","_b","_c","customObjectsCombined","_d","keys","key","_f","_e","backupCustomObjects","_h","_g","returnObj","_k","_j","a","b","numberCompare","out","xs_1","push","obj","hasOwnProperty","values","label","expectedType","minLength","maxLength","assert","every","e","w","axis","tidy","tfc.sqrt","tfc.sum","tfc.mulStrict","Constraint","serialization","Serializable","maxValue","defaultMaxValue","defaultAxis","MaxNorm","norms","calcL2Norms","desired","tfc.clipByValue","tfc.mul","tfc.div","tfc.add","getScalar","epsilon","this","SerializationMap","register","UnitNorm","NonNeg","tfc.relu","minValue","defaultMinValue","rate","defaultRate","MinMaxNorm","CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP","maxNorm","minMaxNorm","nonNeg","unitNorm","constraint","serializeKerasObject","deserializeKerasObject","getMap","classNameMap","deserializeConstraint","nameMap","Map","VALID_DATA_FORMAT_VALUES","checkStringTypeUnionValue","VALID_PADDING_MODE_VALUES","VALID_POOL_MODE_VALUES","_nameScopeStack","_nameScopeDivider","pop","join","tensorName","isValidTensorName","currentNameScopePrefix","scopedName","has","set","index","get","result","tensorNameRegex","RegExp","match","parseInt","begin","end","prod","Float32Array","tensor1d","tfc.min","toArray1D","dataSync","tfc.max","asType","outShape","shape","slice","splice","reshape","n","tile","expandDims","newShape","math_utils.arrayProd","rank","start","size","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","sliceAlongFirstAxis","sliceAlongLastAxis","tensors","tfc.concat","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","mean","stddev","seed","tfc.randomNormal","y","tfc.matMul","xShape0","xShape1","xShape2","reference","indices","toInt","tfc.gather","bias","dataFormat","imageDataFormat","checkDataFormat","biasShape","add","alpha","tfc.elu","tfc.abs","level","noiseShape","util","arraysEqual","multiplier","tfc.step","tfc.neg","tfc.randomUniform","tfc.sub","alt","training","VALID_FAN_MODE_VALUES","VALID_DISTRIBUTION_VALUES","Initializer","Zeros","zeros","Ones","ones","Constant","mul","minval","DEFAULT_MINVAL","maxval","DEFAULT_MAXVAL","RandomUniform","randomUniform","DEFAULT_MEAN","DEFAULT_STDDEV","RandomNormal","K.randomNormal","TruncatedNormal","truncatedNormal","gain","Identity","eye","fanIn","fanOut","receptiveFieldSize","arrayProd","shapeProd","Math","sqrt","scale","mode","checkFanMode","distribution","checkDistribution","VarianceScaling","fans","computeFans","max","limit","GlorotUniform","GlorotNormal","HeNormal","LeCunNormal","DEFAULT_GAIN","Orthogonal","console","warn","q","linalg","gramSchmidt","transpose","INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","constant","glorotNormal","glorotUniform","heNormal","identity","leCunNormal","orthogonal","randomNormal","varianceScaling","initializer","deserializeInitializer","shapes","weights","count","weights_1","weight","reduce","DEFAULT_VARIABLE_NAME_PREFIX","trainable","id","getNextUniqueTensorId","originalName","getScopedTensorName","getUniqueTensorName","tfc.variable","LayerVariable","newVal","checkShapesMatch","assign","apply","map","read","variablesAndValues","variableAndValue","write","ndim","maxNDim","minNDim","axes","sourceLayer","inputs","callArgs","outputTensorIndex","_nextNodeID","outboundLayer","inboundLayers","nodeIndices","tensorIndices","inputTensors","outputTensors","inputMasks","outputMasks","inputShapes","outputShapes","layer","outboundNodes","inboundNodes","Node","inboundNames","_nextLayerID","activityRegularizer","inputSpec","supportsMasking","_trainableWeights","_nonTrainableWeights","_losses","_updates","_built","generic_utils.toSnakeCase","getUid","updatable","inputShape","batchInputShape","batchSize","inputDType","initialWeights","Layer","nodeIndex","attrName","generic_utils.singletonOrArray","getNodeAtIndex","losses","lossFn","built","trainableWeights","nonTrainableWeights","_stateful","generic_utils.toList","inputIndex","spec","xShape","Number","xShapeAtAxis","specDim","dim","kwargs","_callHook","callHook","inputsList","allAreSymbolic","inputsList_1","SymbolicTensor","noneAreSymbolic","inputsList_2","nameScope","assertInputCompatibility","xElem","build","setWeights","outputListCopy","outputList_1","output","call","clone","collectInputShape","outputShape","computeOutputShape","outputDType_1","guessOutputDType","warnOnIncompatibleInputShape","addInboundNode","dimMismatch_1","forEach","dimension","allOutputShapes","node","shapeString","variable_utils.countParamsInWeights","trainableOnly","batchGetValue","params","weightValueTuples","paramValues","pv","p","batchSetValue","regularizer","_addedWeightNames","addLoss","mask","TypeError","maskElement","inputTensorList","types_utils.normalizeShapeList","inputTensorList_1","tensorIndex","inputTensors_1","tensor","sourceTensors","previousSources_1","getSourceInputs","x_1","sparse","inputTensor","InputLayer","batchShape","logs","promises","scalarsToDispose","valueScalar","data","Promise","all","dispose","BaseCallback","epoch","batch","model","callbacks","queueLength","CallbackList","callback","setParams","setModel","onEpochBegin","onEpochEnd","onBatchBegin","onBatchEnd","onTrainBegin","onTrainEnd","BaseLogger","seen","totals","this_1","oldTotalsToDispose","this_2","div","History","history","valueArray","trainBegin","trainEnd","epochBegin","epochEnd","batchBegin","batchEnd","CustomCallback","resolveScalarsInLogs","callbackConfig","squareSum","K.square","epsilonTensor","tfc.onesLike","norm","tfc.maximum","yTrue","yPred","tfc.mean","diff","clippedTrue","MAX_VALUE","absResult","one","clippedPred","firstLog","tfc.log","secondLog","zeroTensor","maxResult","pos","neg","log2","log","predictionDiff","logcoshResult","tfc.softplus","target","fromLogits","tfc.softmax","outputSum","toFloat","flatTarget","tfc.floor","K.flatten","categoricalCrossentropy","tfc.oneHot","maxOutput","tfc.zerosLike","outputXTarget","sigmoidOutput","tfc.exp","sigmoidCrossEntropyWithLogits","logPred","trueNormalized","l2Normalize","predNormalized","trueXPred","identifierOrFn","lossesMap","meanSquaredError","meanAbsoluteError","meanAbsolutePercentageError","meanSquaredLogarithmicError","squaredHinge","hinge","categoricalHinge","logcosh","sparseCategoricalCrossentropy","binaryCrossentropy","kullbackLeiblerDivergence","poisson","cosineProximity","threshold","yPredThresholded","K.cast","tfc.greater","tfc.equal","tfc.argMax","lossBinaryCrossentropy","mse","MSE","mae","MAE","mape","MAPE","categoricalCrossentropyLoss","cosine","sparseCategoricalCrossentropyLoss","metricsMap","binaryAccuracy","categoricalAccuracy","optimizerMap","Adagrad","train","adagrad","Adadelta","adadelta","Adam","adam","Adamax","adamax","RMSProp","rmsprop","SGD","sgd","lineLength","positions","printFn","relevantNodes","sequentialLike","isModelSequentialLike","toDisplay","floor","depth","nodesByDepth","repeat","printRow","trainableCount","layers","printLayerSummary","printLayerSummaryWithConnections","checkTrainableWeightsConsistency","collectedTrainableWeights","countParamsInWeights","nonTrainableCount","nodes","nodesByDepth_1","depthNodes","flag","fields","line","err","countParams","connections","inboundLayer","inboundLayerIndex","inboundTensorIndex","firstConnection","pythonicConfig","generic_utils.toCamelCase","tsArray","arrayLength","item","isArrayItemInputOrOutputName","convertPythonicToTs","tsDict","pythonicKey","pythonicValue","tsKey","tsConfig","pyArray","convertTsToPythonic","pyDict","tsValue","pyKey","version","originalKerasVersion","originalBackend","startsWith","dataType","generic_utils.stringToDType","Tensor","make","flatten","weightsJSON","skipMismatch","layerNames","layers_1","nameToWeights","k","name_1","layerWeights","weightValues","weightEntry","loadTensor","symbolicWeights","preprocessWeightsForLoading","nameToWeight","totalWeightsCount","layers_2","name_2","unsetNames","name_3","Set","outputs","generic_utils.unique","inputLayers","inputLayersNodeIndices","inputLayersTensorIndices","outputLayers","outputLayersNodeIndices","outputLayersTensorIndices","generic_utils.assert","inputNames","outputNames","feedInputShapes","feedInputNames","feedOutputNames","internalInputShapes","internalOutputShapes","nodesDepths","nodeIDToNode","layersDepths","layerIDToLayer","layerIndices","nodesInDecreasingDepth","buildMapOfGraph","finishedNodes","nodesInProgress","containerNodes","Container","nodeKey","numInboundLayers","layer_1","nodeIndex_1","tensorIndex_1","reversedNodesInDecreasingDepth_1","reverse","previousDepth","inboundNode","previousDepth_1","nodeID","layersByDepth","layerID","depthKeys","sort","generic_utils.reverseNumberCompare","depthKeys_1","layersForDepth","aIndex","bIndex","layersForDepth_1","computableTensors","layersWithCompleteInput","depthKeys_2","_l","_o","_m","_q","_p","_s","_r","allNames","name_4","numOccurrences","filter","allNames_1","_t","isNamedTensorMap","loadWeightsFromNamedTensorMap","loadWeightsFromJson","theConfig","kerasVersion","layersVersion","backend","unused","returnString","modelConfig","updatedConfig","masks","generic_utils.pyListRepeat","runInternalGraph","layersToOutputShapes","inputShape_1","shapeKey","depthKeys_3","nodes_1","inputShapes_1","j","nodeIndex_2","inputShape_2","outputShapes_1","outputShapeKeys","tensorMap","depthKeys_4","nodes_2","referenceInputTensors","referenceOutputTensors","computedData","referenceInputTensors_1","computedTensors","computedMasks","outputTensors_1","outputMasks_1","computedTensor","computedMask","computeMask","keptNodes","nodeConversionMap","originalNodeIndex","calculateLosses","buildNodeConversionMap","layerConfigs","layerClassName","layerConfig","filteredInboundNodes","nodeData","newNodeIndex","modelInputs","modelOutputs","createdLayers","unprocessedNodes","nodeData_1","inputData","inboundLayerName","inboundNodeIndex","addUnprocessedNode","layerData","layerName","deserializeLayer","inboundNodesData_1","layersFromConfig","layersFromConfig_1","processLayer","generic_utils.isObjectEmpty","layersFromConfig_2","processNode","inputLayersFromConfig_1","layerOutputTensors","outputLayersFromConfig_1","stateful","cast","ModelLoggingVerbosity","feeds","FeedDict","id2Value","feeds_1","feed","assertFeedCompatibility","fetches","feedDict","arrayFetches","fetchArray","internalFeedDict","fetchArray_1","fetch_1","executeInternal","fetch","hasKey","getValue","inputValues","inputs_1","inputVal","layerOutputs","getNodeOutputs","outputSymbolicTensors","getOutputAt","isDataTensor","isDataArray","names","checkBatchAxis","exceptionPrefix","gotUnexpectedData","isDataDict","arrays","names_1","K.expandDims","refDim","targets","setX","unique","input","setY","lossFns","keyLosses","losses.meanSquaredError","losses.binaryCrossentropy","losses.categoricalCrossentropy","loss","slicedYShape","slicedShape","targetDim","outDim","batchStart","stop","K.sliceAlongFirstAxis","tfc.tidy","sliceArraysByIndices","K.gather","metrics","nestedMetrics","outputNames_1","outputMetrics","Model","printSummary","optimizer","optimizers.getOptimizer","Optimizer","lossFunctions","theLosses","l","losses.get","lossFunction_1","feedOutputShapes","feedLossFns","name_5","skipTargetIndices","metricsNames","metricsTensors","weightedLoss","collectMetrics","metricName","accFn","weightedMetricFn","metric","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","suffix","metricFn","Metrics.get","metricResult","outputIndex","metricTensor","appendMetric","metrics_1","handleMetrics","standardizedOuts","standardizeUserData","ins","makeTestFunction","f","testFunction","singletonOrArray","testLoop","verbose","steps","stepsName","numSamples","outputsIsArray","retrieveSymbolicTensors","tensorValue","executeOutputs","execute","symbolicTensorNames","pyListRepeat","outputsRemaining","layerOutputNames","remainingNames_1","checkNumSamples","batches","makeBatches","outs","batchIndex","batchOuts","insBatch","sliceArrays","batchOuts_1","batchOut","K.concatAlongFirstAxis","checkInputData","predictLoop","checkArrayLengths","standardizeInputData","checkLossAndTargetCompatibility","outLabels","epochs","valF","valIns","shuffle","callbackMetrics","initialEpoch","stepsPerEpoch","validationSteps","doValidation","numTrainSamples","indexArray","range","callbackList","stopTraining","epochLogs","epochIndexArray1D_1","batches_1","batchLogs","batchIds","tfc.keep","valOuts","disposeTensorsInLogs","syncData","dedupedOutLabels","newLabel","totalLoss","valOutputs","lossFunction","meanMetric","needValidationDisposal","validationData","valX","valY","valStandardized","validationSplit","splitAt","originalBatchSize","trainFunction","metricsValues","variables","param","minimize","regularizerLoss","getDedupedMetricsNames","valFunction","standardizeCallbacks","fitLoop","namedWeights","getWeights","handlerOrURL","handlers","io","getSaveHandlers","save","encodeWeights","getNamedWeights","weightDataAndSpecs","unusedArg","toJSON","modelTopology","weightData","weightSpecs","specs","pathOrIOHandler","getLoadHandlers","browserHTTPRequest","loadModelFromIOHandler","handler","load","artifacts","deserialize","loadWeights","decodeWeights","_updatable","Sequential","modelLayer","isLayerModelInstance","Input","outputTensor","lastLayerIndex","getExactlyOneShape","summary","evaluate","predict","predictOnBatch","compile","fit","loadModelInternal","Activation","Elu","K.elu","Selu","tfc.selu","Relu","Relu6","tfc.minimum","Linear","Sigmoid","tfc.sigmoid","HardSigmoid","K.hardSigmoid","Softplus","Softsign","K.softsign","Tanh","tfc.tanh","Softmax","activation","deserializeActivation","DEFAULT_ALPHA","LeakyReLU","getExactlyOneTensor","leakyRelu","baseConfig","ELU","elu","theta","DEFAULT_THETA","thetaTensor","ThresholdedReLU","greater","softmax","softmaxActivation","DEFAULT_AXIS","l1","l2","hasL1","hasL2","L1L2","regularization","sum","abs","asScalar","Regularizer","REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","l1l2","deserializeRegularizer","singleValue","isInteger","inputLength","filterSize","padding","stride","dilation","outputLength","dimSize","strideSize","kernelSize","tfc.transpose","kernel","strides","dilationRate","tfc.conv1d","K.biasAdd","preprocessConv2DInput","tfc.conv2d","BaseConv","verifyConfig","normalizeArray","checkPaddingMode","getActivation","useBias","biasInitializer","getInitializer","DEFAULT_BIAS_INITIALIZER","biasConstraint","getConstraint","biasRegularizer","getRegularizer","generic_utils.checkArrayTypeAndLength","serializeActivation","serializeInitializer","serializeRegularizer","serializeConstraint","Conv","filters","kernelInitializer","DEFAULT_KERNEL_INITIALIZER","kernelConstraint","kernelRegularizer","channelAxis","inputDim","kernelShape","addWeight","biasValue","conv1dWithBias","conv2dWithBias","newSpace","space","newDim","convOutputLength","Conv2D","InputSpec","Conv2DTranspose","hAxis","wAxis","height","width","kernelH","kernelW","strideH","strideW","deconvLength","tfc.conv2dTranspose","heightAxis","widthAxis","depthMultiplier","depthwiseInitializer","DEFAULT_DEPTHWISE_INITIALIZER","depthwiseRegularizer","depthwiseConstraint","pointwiseInitializer","DEFAULT_POINTWISE_INITIALIZER","pointwiseRegularizer","pointwiseConstraint","SeparableConv","depthwiseKernelShape","pointwiseKernelShape","depthwiseKernel","pointwiseKernel","tfc.separableConv2d","SeparableConv2D","Conv1D","cropping","Cropping2D","K.sliceAlongAxis","DEFAULT_SIZE","UpSampling2D","resized","resizeNearestNeighbor","tfc.depthwiseConv2d","DepthwiseConv2D","depthwiseConv2d","rows","cols","outFilters","outRows","outCols","min","rateScalar","Dropout","invokeCallHook","noiseShape_1","getNoiseShape","K.inTrainPhase","K.dropout","units","Dense","inputLastDim","K.dot","Flatten","K.batchFlatten","RepeatVector","K.repeat","targetShape","isUnknown","Reshape","errorMsg","finalShape","known","unknown","originalSize","anyUnknownDims","fixUnknownDimension","outputDim","embeddingsInitializer","DEFAULT_EMBEDDINGS_INITIALIZER","embeddingsRegularizer","embeddingsConstraint","maskZero","Embedding","embeddings","inLens","s1","s2","as1D","Merge","shape1","shape2","computeElementwiseOpOutputShape","batchSizes","allRanks","reshapeRequired","reshapedInputs","inputDims","mathUtils.max","xNDim","mergeFunction","transposed","inputs_2","xTransposed","mathUtils.arrayProd","dims","mathUtils.range","yNDim","yShape","Add","tfc.zeros","inputs_3","Multiply","tfc.ones","inputs_4","Average","inputs_5","Maximum","Minimum","Concatenate","allNoneShape","inputShape_3","shapeSet","shapeWithoutConcatAxis","exists","shapeSet_1","K.concatenate","variance","beta","gamma","tfc.batchNormalization2d","tfc.batchNormalization3d","tfc.batchNormalization4d","reductionAxes","meanAndVariance","tfc.moments","batchNormalization","math_utils.range","broadcastMean","broadcastVariance","broadcastGamma","broadcastBeta","regularNormalizeBatchInTraining","broadcastNormalizeBatchInTraining","momentum","center","betaInitializer","gammaInitializer","movingMeanInitializer","movingVarianceInitializer","betaConstraint","gammaConstraint","betaRegularizer","gammaRegularizer","stepCount","BatchNormalization","movingMean","movingVariance","broadcastShape","sortedReductionAxes","needsBroadcasting","broadcastMovingMean","broadcastMovingVariance","normalizeInference","normedTraining","sampleSize","varianceDebiased","newMovingMean","tfc.movingAverage","newMovingVariance","updateMovingMeanAndVariance","pattern","tfc.pad","heightPadding","widthPadding","ZeroPadding2D","spatial2dPadding","poolSize","poolMode","checkPoolMode","paddingString","tfc.maxPool","tfc.avgPool","Pooling1D","poolingFunction","tfc.squeeze","MaxPooling1D","pool2d","AveragePooling1D","Pooling2D","MaxPooling2D","AveragePooling2D","GlobalPooling1D","GlobalAveragePooling1D","GlobalMaxPooling1D","GlobalPooling2D","GlobalAveragePooling2D","GlobalMaxPooling2D","initialState","constants","numConstants","toListOrNull","stepFunction","initialStates","goBackwards","unroll","lastOutput","tfc.reverse","states","timeSteps","t","currentInput","stepOutputs","cell","StackedRNNCells","cells","stateSize","returnSequences","returnState","stateSpec","RNN","isArrayOfShapes","stateShape","stateSize_1","stepInputShape","expectedShape","standardized","standardizeArgs","additionalInputs","additionalSpecs","initialState_1","state","fullInput","fullInputSpec","originalInputSpec","getInitialState","numStates","timesteps","cellCallKwargs","rnnOutputs","rnn","K.tile","cellConfig","DEFAULT_ACTIVATION","recurrentInitializer","DEFAULT_RECURRENT_INITIALIZER","recurrentRegularizer","recurrentConstraint","dropout","math_utils.min","math_utils.max","recurrentDropout","dropoutMask","recurrentDropoutMask","SimpleRNNCell","recurrentKernel","prevOutput","h","generateDropoutMask","dpMask","recDpMask","RNNCell","SimpleRNN","tfc.dispose","recurrentActivation","DEFAULT_RECURRENT_ACTIVATION","implementation","GRUCell","hTMinus1","z","r","hh","kernelZ","K.sliceAlongLastAxis","kernelR","recurrentKernelZ","recurrentKernelR","recurrentKernelH","inputsZ","inputsR","inputsH","xZ","xR","xH","biasZ","biasR","biasH","hTMinus1Z","hTMinus1R","hTMinus1H","matrixX","matrixInner","recurrentZ","recurrentR","recurrentH","GRU","unitForgetBias","LSTMCell","capturedBiasInit_1","capturedUnits_1","CustomInit","bI","bF","bCAndH","cTMinus1","c","o","kernelI","kernelF","kernelC","kernelO","recurrentKernelI","recurrentKernelF","recurrentKernelC","recurrentKernelO","inputsI","inputsF","inputsC","inputsO","xI","xF","xC","xO","biasI","biasF","biasC","biasO","hTMinus1I","hTMinus1F","hTMinus1C","hTMinus1O","z0","z1","z2","z3","LSTM","nestedStates","callInputs","newNestedStates","cellStates","cellConfigs","tuples","numParams","inputWeights","droppedInputs","Wrapper","newConfig","TimeDistributed","childInputShape","childOutputShape","VALID_BIDIRECTIONAL_MERGE_MODES","generic_utils.checkStringTypeUnionValue","forwardLayer","backwardLayer","checkBidirectionalMergeMode","mergeMode","_trainable","Bidirectional","numWeights","numeightsOver2","layerShapes","stateSpecs","isSymbolicTensor","additionalInputs_1","yRev","forwardState","backwardState","resetStates","rnnLayer","averagePooling1d","averagePooling2d","globalMaxPool1d","globalMaxPooling1d","globalMaxPool2d","globalMaxPooling2d","maxPool1d","maxPooling1d","maxPool2d","maxPooling2d","metrics.binaryAccuracy","metrics.binaryCrossentropy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","losses.cosineProximity","losses.meanAbsoluteError","losses.meanAbsolutePercentageError","regularizers.l1","regularizers.l2","Callback"],"mappings":";;;;;;;;;;;;;;;;86EAYA,IAAIA,SAAW,KAKf,mBACE,OAAOA,SAOT,2BAQE,MAAO,eCZT,IAAIC,oBAAsB,EAE1B,iCACE,OAAOA,sBAGT,IAAMC,gBAON,gBAAuBC,GAKrB,oBALqBA,MACfA,KAAUD,eACdA,aAAaC,GAAU,GAEzBD,aAAaC,IAAW,EACjBA,EAASD,aAAaC,GAAQC,WAGvC,IAAMC,aACJC,WACAC,UAGIC,cAA0B,UAKhC,mBAA0BC,EAAeC,GAQvC,YAPcC,IAAVD,IACFA,EAAQF,eAEuB,MAA7BH,YAAYK,GAAOD,KACrBJ,YAAYK,GAAOD,GAASG,OAAOH,EAAOC,GAC1CG,KAAKR,YAAYK,GAAOD,KAEnBJ,YAAYK,GAAOD,GCpC5B,+BACE,WAAYK,GAAZ,MACEC,YAAMD,gBAENE,OAAOC,eAAeC,EAAMC,EAAeC,aAE/C,OANoCC,kBAAAC,gCAYlC,WAAYR,GAAZ,MACEC,YAAMD,gBAENE,OAAOC,eAAeC,EAAMK,EAAaH,aAE7C,OANkCC,kBAAAC,8BAYhC,WAAYR,GAAZ,MACEC,YAAMD,gBAENE,OAAOC,eAAeC,EAAMM,EAAWJ,aAE3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BA,GACjB,OAAO+6C,GAAgB/6C,GAWzB,cAAmBA,GACjB,OAAOg7C,GAAgBh7C,4FC9BzB,aAAA,qDAEEvC,QAAe,OAQjB,OAVuCG,eAIrCq9C,qBAAA,SAASliC,GACP,KAAMA,aAAiBsZ,OACrB,MAAM,IAAIx0B,MAAM,mDAElBmG,KAAK+U,MAAQA,MARsBH"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js b/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js new file mode 100644 index 0000000..5cdb935 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js @@ -0,0 +1,10592 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core')) : + typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core'], factory) : + (factory((global.tf = global.tf || {}),global.tf)); +}(this, (function (exports,tfc) { 'use strict'; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + var _epsilon = 1e-7; + function epsilon() { + return _epsilon; + } + function imageDataFormat() { + return 'channelsLast'; + } + + var _nextUniqueTensorId = 0; + function getNextUniqueTensorId() { + return _nextUniqueTensorId++; + } + var _uidPrefixes = {}; + function getUid(prefix) { + if (prefix === void 0) { prefix = ''; } + if (!(prefix in _uidPrefixes)) { + _uidPrefixes[prefix] = 0; + } + _uidPrefixes[prefix] += 1; + return prefix + _uidPrefixes[prefix].toString(); + } + var scalarCache = { + float32: {}, + int32: {} + }; + var DEFAULT_DTYPE = 'float32'; + function getScalar(value, dtype) { + if (dtype === undefined) { + dtype = DEFAULT_DTYPE; + } + if (scalarCache[dtype][value] == null) { + scalarCache[dtype][value] = tfc.scalar(value, dtype); + tfc.keep(scalarCache[dtype][value]); + } + return scalarCache[dtype][value]; + } + + var AttributeError = (function (_super) { + __extends(AttributeError, _super); + function AttributeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, AttributeError.prototype); + return _this; + } + return AttributeError; + }(Error)); + var RuntimeError = (function (_super) { + __extends(RuntimeError, _super); + function RuntimeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, RuntimeError.prototype); + return _this; + } + return RuntimeError; + }(Error)); + var ValueError = (function (_super) { + __extends(ValueError, _super); + function ValueError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, ValueError.prototype); + return _this; + } + return ValueError; + }(Error)); + var NotImplementedError = (function (_super) { + __extends(NotImplementedError, _super); + function NotImplementedError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, NotImplementedError.prototype); + return _this; + } + return NotImplementedError; + }(Error)); + var AssertionError = (function (_super) { + __extends(AssertionError, _super); + function AssertionError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, AssertionError.prototype); + return _this; + } + return AssertionError; + }(Error)); + var IndexError = (function (_super) { + __extends(IndexError, _super); + function IndexError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, IndexError.prototype); + return _this; + } + return IndexError; + }(Error)); + + function pyListRepeat(value, numValues) { + if (Array.isArray(value)) { + var newArray = []; + for (var i = 0; i < numValues; i++) { + newArray = newArray.concat(value); + } + return newArray; + } + else { + var newArray = new Array(numValues); + newArray.fill(value); + return newArray; + } + } + function assert(val, message) { + if (!val) { + throw new AssertionError(message); + } + } + function count(array, refernce) { + var counter = 0; + for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { + var item = array_1[_i]; + if (item === refernce) { + counter++; + } + } + return counter; + } + function singletonOrArray(xs) { + if (xs.length === 1) { + return xs[0]; + } + return xs; + } + function toList(x) { + if (Array.isArray(x)) { + return x; + } + return [x]; + } + function toSnakeCase(name) { + var intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2'); + var insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(); + if (insecure[0] !== '_') { + return insecure; + } + return 'private' + insecure; + } + function toCamelCase(identifier) { + if (identifier.length <= 1) { + return identifier; + } + if (identifier.indexOf('_') === -1) { + return identifier; + } + return identifier.replace(/[_]+(\w|$)/g, function (m, p1) { return p1.toUpperCase(); }); + } + var _GLOBAL_CUSTOM_OBJECTS = {}; + function serializeKerasObject(instance) { + if (instance === null || instance === undefined) { + return null; + } + return { className: instance.getClassName(), config: instance.getConfig() }; + } + function deserializeKerasObject(identifier, moduleObjects, customObjects, printableModuleName) { + if (moduleObjects === void 0) { moduleObjects = {}; } + if (customObjects === void 0) { customObjects = {}; } + if (printableModuleName === void 0) { printableModuleName = 'object'; } + if (typeof identifier === 'string') { + var functionName = identifier; + var fn = void 0; + if (functionName in customObjects) { + fn = customObjects[functionName]; + } + else if (functionName in _GLOBAL_CUSTOM_OBJECTS) { + fn = _GLOBAL_CUSTOM_OBJECTS[functionName]; + } + else { + fn = moduleObjects[functionName]; + if (fn == null) { + throw new ValueError("Unknown " + printableModuleName + ": " + identifier); + } + } + return fn; + } + else { + var config = identifier; + if (config.className == null || config.config == null) { + throw new ValueError(printableModuleName + ": Improper config format: " + + (JSON.stringify(config) + ".\n") + + "'className' and 'config' must set."); + } + var className = config.className; + var cls = void 0, fromConfig = void 0; + if (className in customObjects) { + _a = customObjects.get(className), cls = _a[0], fromConfig = _a[1]; + } + else if (className in _GLOBAL_CUSTOM_OBJECTS) { + _b = _GLOBAL_CUSTOM_OBJECTS.className, cls = _b[0], fromConfig = _b[1]; + } + else if (className in moduleObjects) { + _c = moduleObjects[className], cls = _c[0], fromConfig = _c[1]; + } + if (cls == null) { + throw new ValueError("Unknown " + printableModuleName + ": " + className); + } + if (fromConfig != null) { + var customObjectsCombined = {}; + for (var _i = 0, _d = Object.keys(_GLOBAL_CUSTOM_OBJECTS); _i < _d.length; _i++) { + var key = _d[_i]; + customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key]; + } + for (var _e = 0, _f = Object.keys(customObjects); _e < _f.length; _e++) { + var key = _f[_e]; + customObjectsCombined[key] = customObjects[key]; + } + var nestedConfig = config.config; + nestedConfig.customObjects = customObjectsCombined; + var backupCustomObjects = __assign({}, _GLOBAL_CUSTOM_OBJECTS); + for (var _g = 0, _h = Object.keys(customObjects); _g < _h.length; _g++) { + var key = _h[_g]; + _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; + } + var returnObj = fromConfig(cls, config.config); + _GLOBAL_CUSTOM_OBJECTS = __assign({}, backupCustomObjects); + return returnObj; + } + else { + var backupCustomObjects = __assign({}, _GLOBAL_CUSTOM_OBJECTS); + for (var _j = 0, _k = Object.keys(customObjects); _j < _k.length; _j++) { + var key = _k[_j]; + _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; + } + var returnObj = new cls(config.config); + _GLOBAL_CUSTOM_OBJECTS = __assign({}, backupCustomObjects); + return returnObj; + } + } + var _a, _b, _c; + } + function numberCompare(a, b) { + return (a < b) ? -1 : ((a > b) ? 1 : 0); + } + function reverseNumberCompare(a, b) { + return -1 * numberCompare(a, b); + } + function stringToDType(dtype) { + switch (dtype) { + case 'float32': + return 'float32'; + default: + throw new ValueError("Invalid dtype: " + dtype); + } + } + function unique(xs) { + if (xs == null) { + return xs; + } + var out = []; + for (var _i = 0, xs_1 = xs; _i < xs_1.length; _i++) { + var x = xs_1[_i]; + if (out.indexOf(x) === -1) { + out.push(x); + } + } + return out; + } + function isObjectEmpty(obj) { + if (obj == null) { + throw new ValueError("Invalid value in obj: " + JSON.stringify(obj)); + } + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + return false; + } + } + return true; + } + function checkStringTypeUnionValue(values, label, value) { + if (value == null) { + return; + } + if (values.indexOf(value) < 0) { + throw new ValueError(value + " is not a valid " + label + ". Valid values are " + values + " or null/undefined."); + } + } + function checkArrayTypeAndLength(x, expectedType, minLength, maxLength) { + if (minLength === void 0) { minLength = 0; } + if (maxLength === void 0) { maxLength = Infinity; } + assert(minLength >= 0); + assert(maxLength >= minLength); + return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength && + x.every(function (e) { return typeof e === expectedType; })); + } + + function calcL2Norms(w, axis) { + return tfc.tidy(function () { return tfc.sqrt(tfc.sum(tfc.mulStrict(w, w), axis, true)); }); + } + var Constraint = (function (_super) { + __extends(Constraint, _super); + function Constraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + Constraint.prototype.getConfig = function () { + return {}; + }; + return Constraint; + }(tfc.serialization.Serializable)); + var MaxNorm = (function (_super) { + __extends(MaxNorm, _super); + function MaxNorm(config) { + var _this = _super.call(this) || this; + _this.defaultMaxValue = 2; + _this.defaultAxis = 0; + _this.maxValue = + config.maxValue != null ? config.maxValue : _this.defaultMaxValue; + _this.axis = config.axis != null ? config.axis : _this.defaultAxis; + return _this; + } + MaxNorm.prototype.apply = function (w) { + var _this = this; + return tfc.tidy(function () { + var norms = calcL2Norms(w, _this.axis); + var desired = tfc.clipByValue(norms, 0, _this.maxValue); + return tfc.mul(w, tfc.div(desired, tfc.add(getScalar(epsilon()), norms))); + }); + }; + MaxNorm.prototype.getConfig = function () { + return { maxValue: this.maxValue, axis: this.axis }; + }; + MaxNorm.className = 'MaxNorm'; + return MaxNorm; + }(Constraint)); + tfc.serialization.SerializationMap.register(MaxNorm); + var UnitNorm = (function (_super) { + __extends(UnitNorm, _super); + function UnitNorm(config) { + var _this = _super.call(this) || this; + _this.defaultAxis = 0; + _this.axis = config.axis != null ? config.axis : _this.defaultAxis; + return _this; + } + UnitNorm.prototype.apply = function (w) { + var _this = this; + return tfc.tidy(function () { return tfc.div(w, tfc.add(getScalar(epsilon()), calcL2Norms(w, _this.axis))); }); + }; + UnitNorm.prototype.getConfig = function () { + return { axis: this.axis }; + }; + UnitNorm.className = 'UnitNorm'; + return UnitNorm; + }(Constraint)); + tfc.serialization.SerializationMap.register(UnitNorm); + var NonNeg = (function (_super) { + __extends(NonNeg, _super); + function NonNeg() { + return _super !== null && _super.apply(this, arguments) || this; + } + NonNeg.prototype.apply = function (w) { + return tfc.relu(w); + }; + NonNeg.className = 'NonNeg'; + return NonNeg; + }(Constraint)); + tfc.serialization.SerializationMap.register(NonNeg); + var MinMaxNorm = (function (_super) { + __extends(MinMaxNorm, _super); + function MinMaxNorm(config) { + var _this = _super.call(this) || this; + _this.defaultMinValue = 0.0; + _this.defaultMaxValue = 1.0; + _this.defaultRate = 1.0; + _this.defaultAxis = 0; + _this.minValue = + config.minValue != null ? config.minValue : _this.defaultMinValue; + _this.maxValue = + config.maxValue != null ? config.maxValue : _this.defaultMaxValue; + _this.rate = config.rate != null ? config.rate : _this.defaultRate; + _this.axis = config.axis != null ? config.axis : _this.defaultAxis; + return _this; + } + MinMaxNorm.prototype.apply = function (w) { + var _this = this; + return tfc.tidy(function () { + var norms = calcL2Norms(w, _this.axis); + var desired = tfc.add(tfc.mul(getScalar(_this.rate), tfc.clipByValue(norms, _this.minValue, _this.maxValue)), tfc.mul(getScalar(1.0 - _this.rate), norms)); + return tfc.mul(w, tfc.div(desired, tfc.add(getScalar(epsilon()), norms))); + }); + }; + MinMaxNorm.prototype.getConfig = function () { + return { + minValue: this.minValue, + maxValue: this.maxValue, + rate: this.rate, + axis: this.axis + }; + }; + MinMaxNorm.className = 'MinMaxNorm'; + return MinMaxNorm; + }(Constraint)); + tfc.serialization.SerializationMap.register(MinMaxNorm); + var CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP = { + 'maxNorm': 'MaxNorm', + 'minMaxNorm': 'MinMaxNorm', + 'nonNeg': 'NonNeg', + 'unitNorm': 'UnitNorm' + }; + function serializeConstraint(constraint) { + return serializeKerasObject(constraint); + } + function deserializeConstraint(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'constraint'); + } + function getConstraint(identifier) { + if (identifier == null) { + return null; + } + if (typeof identifier === 'string') { + var className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ? + CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : + identifier; + var config = { className: className, config: {} }; + return deserializeConstraint(config); + } + else if (identifier instanceof Constraint) { + return identifier; + } + else { + return deserializeConstraint(identifier); + } + } + + function maxNorm(config) { + return new MaxNorm(config); + } + function unitNorm(config) { + return new UnitNorm(config); + } + function nonNeg() { + return new NonNeg(); + } + function minMaxNorm(config) { + return new MinMaxNorm(config); + } + + var exports_constraints = /*#__PURE__*/Object.freeze({ + maxNorm: maxNorm, + unitNorm: unitNorm, + nonNeg: nonNeg, + minMaxNorm: minMaxNorm + }); + + var nameMap = new Map(); + var VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast']; + function checkDataFormat(value) { + checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value); + } + var VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal']; + function checkPaddingMode(value) { + checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value); + } + var VALID_POOL_MODE_VALUES = ['max', 'avg']; + function checkPoolMode(value) { + checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value); + } + var _nameScopeStack = []; + var _nameScopeDivider = '/'; + function nameScope(name, fn) { + _nameScopeStack.push(name); + try { + var val = fn(); + _nameScopeStack.pop(); + return val; + } + catch (e) { + _nameScopeStack.pop(); + throw e; + } + } + function currentNameScopePrefix() { + if (_nameScopeStack.length === 0) { + return ''; + } + else { + return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider; + } + } + function getScopedTensorName(tensorName) { + if (!isValidTensorName(tensorName)) { + throw new Error('Not a valid tensor name: \'' + tensorName + '\''); + } + return currentNameScopePrefix() + tensorName; + } + function getUniqueTensorName(scopedName) { + if (!isValidTensorName(scopedName)) { + throw new Error('Not a valid tensor name: \'' + scopedName + '\''); + } + if (!nameMap.has(scopedName)) { + nameMap.set(scopedName, 0); + } + var index = nameMap.get(scopedName); + nameMap.set(scopedName, nameMap.get(scopedName) + 1); + if (index > 0) { + var result = scopedName + '_' + index; + nameMap.set(result, 1); + return result; + } + else { + return scopedName; + } + } + var tensorNameRegex = new RegExp(/^[A-Za-z][A-Za-z0-9\._\/]*$/); + function isValidTensorName(name) { + return name.match(tensorNameRegex) ? true : false; + } + + function isInteger(x) { + return x === parseInt(x.toString(), 10); + } + function arrayProd(array, begin, end) { + if (begin == null) { + begin = 0; + } + if (end == null) { + end = array.length; + } + var prod = 1; + for (var i = begin; i < end; ++i) { + prod *= array[i]; + } + return prod; + } + function toArray1D(array) { + array = Array.isArray(array) ? new Float32Array(array) : array; + return tfc.tensor1d(array); + } + function min(array) { + return tfc.min(toArray1D(array)).dataSync()[0]; + } + function max(array) { + return tfc.max(toArray1D(array)).dataSync()[0]; + } + function range(begin, end) { + if (end < begin) { + throw new ValueError("end (" + end + ") < begin (" + begin + ") is forbidden."); + } + var out = []; + for (var i = begin; i < end; ++i) { + out.push(i); + } + return out; + } + + function cast(x, dtype) { + return x.asType(dtype); + } + function expandDims(x, axis) { + if (axis === void 0) { axis = -1; } + var outShape = x.shape.slice(); + if (axis < 0) { + axis = outShape.length + axis + 1; + } + outShape.splice(axis, 0, 1); + return x.reshape(outShape); + } + function repeat(x, n) { + return tfc.tidy(function () { + if (x.shape.length !== 2) { + throw new ValueError("repeat() expects a rank-2 tensor, but received a " + + ("rank-" + x.shape.length + " tensor.")); + } + var y = expandDims(x, 1); + return tile(y, [1, n, 1]); + }); + } + function flatten(x) { + var newShape = [arrayProd(x.shape)]; + return x.reshape(newShape); + } + function batchFlatten(x) { + if (x.rank <= 1) { + throw new ValueError("batchFlatten requires a minimum rank of 2. Got rank: " + x.rank + "."); + } + var newShape = [x.shape[0], arrayProd(x.shape, 1)]; + return x.reshape(newShape); + } + function sliceAlongFirstAxis(array, start, size) { + return tfc.tidy(function () { + switch (array.rank) { + case 1: + return tfc.slice1d(array, start, size); + case 2: + return tfc.slice2d(array, [start, 0], [size, array.shape[1]]); + case 3: + return tfc.slice3d(array, [start, 0, 0], [size, array.shape[1], array.shape[2]]); + case 4: + return tfc.slice4d(array, [start, 0, 0, 0], [size, array.shape[1], array.shape[2], array.shape[3]]); + default: + throw new ValueError("sliceAlongFirstAxis() received an unsupported tensor rank: " + + ("" + array.rank)); + } + }); + } + function sliceAlongLastAxis(array, start, size) { + return tfc.tidy(function () { + switch (array.rank) { + case 1: + return tfc.slice1d(array, start, size); + case 2: + return tfc.slice2d(array, [0, start], [array.shape[0], size]); + case 3: + return tfc.slice3d(array, [0, 0, start], [array.shape[0], array.shape[1], size]); + case 4: + return tfc.slice4d(array, [0, 0, 0, start], [array.shape[0], array.shape[1], array.shape[2], size]); + default: + throw new ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + + ("" + array.rank)); + } + }); + } + function sliceAlongAxis(array, start, size, axis) { + return tfc.tidy(function () { + switch (array.rank) { + case 1: + return tfc.slice1d(array, start, size); + case 2: + switch (axis) { + case 1: + return sliceAlongFirstAxis(array, start, size); + case 2: + return sliceAlongLastAxis(array, start, size); + default: + throw new ValueError("The axis is not within the rank of the tensor " + + ("" + axis)); + } + case 3: + switch (axis) { + case 1: + return sliceAlongFirstAxis(array, start, size); + case 2: + return tfc.slice3d(array, [0, start, 0], [array.shape[0], size, array.shape[2]]); + case 3: + return sliceAlongLastAxis(array, start, size); + default: + throw new ValueError("The axis is not within the rank of the tensor " + + ("" + axis)); + } + case 4: + switch (axis) { + case 1: + return sliceAlongFirstAxis(array, start, size); + case 2: + return tfc.slice4d(array, [0, start, 0, 0], [array.shape[0], size, array.shape[2], array.shape[3]]); + case 3: + return tfc.slice4d(array, [0, 0, start, 0], [array.shape[0], array.shape[1], size, array.shape[3]]); + case 4: + return sliceAlongLastAxis(array, start, size); + default: + throw new ValueError("The axis is not within the rank of the tensor " + + ("" + axis)); + } + default: + throw new ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + + ("" + array.rank)); + } + }); + } + function concatenate(tensors, axis) { + if (axis === void 0) { axis = -1; } + var rank; + if (axis < 0) { + rank = tensors[0].rank; + if (rank !== 0) { + axis = rank; + } + else { + axis = 0; + } + } + if (axis === tensors[0].rank) { + axis = -1; + } + return tfc.concat(tensors, axis); + } + function concatAlongFirstAxis(a, b) { + switch (a.rank) { + case 1: + return tfc.concat1d([a, b]); + case 2: + return tfc.concat2d([a, b], 0); + case 3: + return tfc.concat3d([a, b], 0); + case 4: + return tfc.concat4d([a, b], 0); + default: + throw new ValueError('concatAlongFirstAxis() received an unsupported tensor rank: ' + + a.rank); + } + } + function tile(x, n) { + if (!Array.isArray(n)) { + n = [n]; + } + if (x.rank !== n.length) { + throw new ValueError("The length of input n (" + n.length + ") does not match " + + ("the number of dimensions in input x (" + x.rank + ")")); + } + return tfc.tile(x, n); + } + function randomNormal(shape, mean$$1, stddev, dtype, seed) { + if (mean$$1 === void 0) { mean$$1 = 0.0; } + if (stddev === void 0) { stddev = 1.0; } + return tfc.randomNormal(shape, mean$$1, stddev, dtype, seed); + } + function dot(x, y) { + if (y.rank !== 2) { + throw new NotImplementedError("dot support for y other than rank 2 is not yet implemented: " + + ("y shape = " + y.shape)); + } + else { + if (x.rank === 2) { + return tfc.matMul(x, y); + } + else if (x.rank === 3) { + var xShape0 = x.shape[0]; + var xShape1 = x.shape[1]; + var xShape2 = x.shape[2]; + x = x.reshape([xShape0 * xShape1, xShape2]); + return tfc.matMul(x, y).reshape([ + xShape0, xShape1, y.shape[1] + ]); + } + else { + throw new NotImplementedError("dot support for x of rank " + x.rank + " is not yet implemented: " + + ("x shape = " + x.shape)); + } + } + } + function gather(reference, indices, axis) { + return tfc.tidy(function () { + if (Array.isArray(indices)) { + indices = tfc.tensor1d(indices, 'int32'); + } + else { + indices = indices.toInt(); + } + return tfc.gather(reference, indices, axis); + }); + } + function square(x) { + return tfc.mulStrict(x, x); + } + function biasAdd(x, bias, dataFormat) { + return tfc.tidy(function () { + if (dataFormat == null) { + dataFormat = imageDataFormat(); + } + checkDataFormat(dataFormat); + if (bias.rank !== 1 && bias.rank !== x.rank) { + throw new ValueError('Unexpected bias dimensions: ' + bias.rank + + '; expected it to be 1 or ' + x.rank); + } + var biasShape = bias.shape; + var y; + if (x.rank === 5) { + if (dataFormat === 'channelsFirst') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, biasShape[0], 1, 1, 1])); + } + else { + y = x.add(bias.reshape([1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]])); + } + } + else if (dataFormat === 'channelsLast') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, 1, 1, 1, biasShape[0]])); + } + else { + y = x.add(bias.reshape([1].concat(biasShape))); + } + } + } + else if (x.rank === 4) { + if (dataFormat === 'channelsFirst') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, biasShape[0], 1, 1])); + } + else { + y = x.add(bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]])); + } + } + else if (dataFormat === 'channelsLast') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, 1, 1, biasShape[0]])); + } + else { + y = x.add(bias.reshape([1].concat(biasShape))); + } + } + } + else if (x.rank === 3) { + if (dataFormat === 'channelsFirst') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, biasShape[0], 1])); + } + else { + y = x.add(bias.reshape([1, biasShape[1], biasShape[0]])); + } + } + else if (dataFormat === 'channelsLast') { + if (biasShape.length === 1) { + y = x.add(bias.reshape([1, 1, biasShape[0]])); + } + else { + y = x.add(bias.reshape([1].concat(biasShape))); + } + } + } + else if (x.rank < 3) { + y = x.add(bias); + } + else { + throw new ValueError("Unsupported input rank by biasAdd: " + x.rank); + } + return y; + }); + } + function elu(x, alpha) { + if (alpha === void 0) { alpha = 1; } + if (alpha !== 1) { + throw new NotImplementedError("Support for alpha values other than 1 (" + alpha + ") is not implemented " + + "yet."); + } + return tfc.elu(x); + } + function softsign(x) { + return tfc.tidy(function () { return tfc.div(x, tfc.add(getScalar(1), tfc.abs(x))); }); + } + function dropout(x, level, noiseShape, seed) { + return tfc.tidy(function () { + if (noiseShape != null && !tfc.util.arraysEqual(x.shape, noiseShape)) { + throw new NotImplementedError('Non-default noise shape is not implemented yet: ' + + JSON.stringify(noiseShape)); + } + if (seed != null) { + throw new NotImplementedError('seed is not implemented for dropout yet.'); + } + var multiplier = tfc.step(tfc.add(tfc.neg(level), tfc.randomUniform(x.shape, 0, 1, 'float32'))); + multiplier = tfc.mul(tfc.div(getScalar(1), tfc.sub(getScalar(1), level)), multiplier); + return tfc.mul(x, multiplier); + }); + } + function hardSigmoid(x) { + return tfc.tidy(function () { + var y = tfc.add(getScalar(0.5), tfc.mul(getScalar(0.2), x)); + return tfc.clipByValue(y, 0, 1); + }); + } + function inTrainPhase(x, alt, training) { + if (training === void 0) { training = false; } + return training ? x() : alt(); + } + + var VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg']; + function checkFanMode(value) { + checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value); + } + var VALID_DISTRIBUTION_VALUES = ['normal', 'uniform']; + function checkDistribution(value) { + checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value); + } + var Initializer = (function (_super) { + __extends(Initializer, _super); + function Initializer() { + return _super !== null && _super.apply(this, arguments) || this; + } + Initializer.prototype.fromConfigUsesCustomObjects = function () { + return false; + }; + Initializer.prototype.getConfig = function () { + return {}; + }; + return Initializer; + }(tfc.serialization.Serializable)); + var Zeros = (function (_super) { + __extends(Zeros, _super); + function Zeros() { + return _super !== null && _super.apply(this, arguments) || this; + } + Zeros.prototype.apply = function (shape, dtype) { + return tfc.zeros(shape, dtype); + }; + Zeros.className = 'Zeros'; + return Zeros; + }(Initializer)); + tfc.serialization.SerializationMap.register(Zeros); + var Ones = (function (_super) { + __extends(Ones, _super); + function Ones() { + return _super !== null && _super.apply(this, arguments) || this; + } + Ones.prototype.apply = function (shape, dtype) { + return tfc.ones(shape, dtype); + }; + Ones.className = 'Ones'; + return Ones; + }(Initializer)); + tfc.serialization.SerializationMap.register(Ones); + var Constant = (function (_super) { + __extends(Constant, _super); + function Constant(config) { + var _this = _super.call(this) || this; + if (typeof config !== 'object') { + throw new ValueError("Expected argument of type ConstantConfig but got " + config); + } + if (config.value === undefined) { + throw new ValueError("config must have value set but got " + config); + } + _this.value = config.value; + return _this; + } + Constant.prototype.apply = function (shape, dtype) { + var _this = this; + return tfc.tidy(function () { return tfc.mul(tfc.scalar(_this.value), tfc.ones(shape, dtype)); }); + }; + Constant.prototype.getConfig = function () { + return { + value: this.value, + }; + }; + Constant.className = 'Constant'; + return Constant; + }(Initializer)); + tfc.serialization.SerializationMap.register(Constant); + var RandomUniform = (function (_super) { + __extends(RandomUniform, _super); + function RandomUniform(config) { + var _this = _super.call(this) || this; + _this.DEFAULT_MINVAL = -0.05; + _this.DEFAULT_MAXVAL = 0.05; + _this.minval = config.minval || _this.DEFAULT_MINVAL; + _this.maxval = config.maxval || _this.DEFAULT_MAXVAL; + _this.seed = config.seed; + return _this; + } + RandomUniform.prototype.apply = function (shape, dtype) { + return tfc.randomUniform(shape, this.minval, this.maxval, dtype); + }; + RandomUniform.prototype.getConfig = function () { + return { minval: this.minval, maxval: this.maxval, seed: this.seed }; + }; + RandomUniform.className = 'RandomUniform'; + return RandomUniform; + }(Initializer)); + tfc.serialization.SerializationMap.register(RandomUniform); + var RandomNormal = (function (_super) { + __extends(RandomNormal, _super); + function RandomNormal(config) { + var _this = _super.call(this) || this; + _this.DEFAULT_MEAN = 0.; + _this.DEFAULT_STDDEV = 0.05; + _this.mean = config.mean || _this.DEFAULT_MEAN; + _this.stddev = config.stddev || _this.DEFAULT_STDDEV; + _this.seed = config.seed; + return _this; + } + RandomNormal.prototype.apply = function (shape, dtype) { + if (dtype === 'bool') { + throw new NotImplementedError("randomNormal does not support dType bool."); + } + return randomNormal(shape, this.mean, this.stddev, dtype, this.seed); + }; + RandomNormal.prototype.getConfig = function () { + return { mean: this.mean, stddev: this.stddev, seed: this.seed }; + }; + RandomNormal.className = 'RandomNormal'; + return RandomNormal; + }(Initializer)); + tfc.serialization.SerializationMap.register(RandomNormal); + var TruncatedNormal = (function (_super) { + __extends(TruncatedNormal, _super); + function TruncatedNormal(config) { + var _this = _super.call(this) || this; + _this.DEFAULT_MEAN = 0.; + _this.DEFAULT_STDDEV = 0.05; + _this.mean = config.mean || _this.DEFAULT_MEAN; + _this.stddev = config.stddev || _this.DEFAULT_STDDEV; + _this.seed = config.seed; + return _this; + } + TruncatedNormal.prototype.apply = function (shape, dtype) { + if (dtype === 'bool') { + throw new NotImplementedError("truncatedNormal does not support dType bool."); + } + return tfc.truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed); + }; + TruncatedNormal.prototype.getConfig = function () { + return { mean: this.mean, stddev: this.stddev, seed: this.seed }; + }; + TruncatedNormal.className = 'TruncatedNormal'; + return TruncatedNormal; + }(Initializer)); + tfc.serialization.SerializationMap.register(TruncatedNormal); + var Identity = (function (_super) { + __extends(Identity, _super); + function Identity(config) { + var _this = _super.call(this) || this; + _this.gain = config.gain != null ? tfc.scalar(config.gain) : getScalar(1.0); + return _this; + } + Identity.prototype.apply = function (shape, dtype) { + var _this = this; + return tfc.tidy(function () { + if (shape.length !== 2 || shape[0] !== shape[1]) { + throw new ValueError('Identity matrix initializer can only be used for' + + ' 2D square matrices.'); + } + else { + return tfc.mul(_this.gain, tfc.eye(shape[0])); + } + }); + }; + Identity.prototype.getConfig = function () { + return { gain: this.gain.get() }; + }; + Identity.className = 'Identity'; + return Identity; + }(Initializer)); + tfc.serialization.SerializationMap.register(Identity); + function computeFans(shape, dataFormat) { + if (dataFormat === void 0) { dataFormat = 'channelsLast'; } + var fanIn; + var fanOut; + checkDataFormat(dataFormat); + if (shape.length === 2) { + fanIn = shape[0]; + fanOut = shape[1]; + } + else if ([3, 4, 5].indexOf(shape.length) !== -1) { + if (dataFormat === 'channelsFirst') { + var receptiveFieldSize = arrayProd(shape, 2); + fanIn = shape[1] * receptiveFieldSize; + fanOut = shape[0] * receptiveFieldSize; + } + else if (dataFormat === 'channelsLast') { + var receptiveFieldSize = arrayProd(shape, 0, shape.length - 2); + fanIn = shape[shape.length - 2] * receptiveFieldSize; + fanOut = shape[shape.length - 1] * receptiveFieldSize; + } + } + else { + var shapeProd = arrayProd(shape); + fanIn = Math.sqrt(shapeProd); + fanOut = Math.sqrt(shapeProd); + } + return [fanIn, fanOut]; + } + var VarianceScaling = (function (_super) { + __extends(VarianceScaling, _super); + function VarianceScaling(config) { + var _this = _super.call(this) || this; + if (config.scale < 0.0) { + throw new ValueError("scale must be a positive float. Got: " + config.scale); + } + _this.scale = config.scale == null ? 1.0 : config.scale; + _this.mode = config.mode; + checkFanMode(_this.mode); + _this.distribution = config.distribution; + checkDistribution(_this.distribution); + _this.seed = config.seed; + return _this; + } + VarianceScaling.prototype.apply = function (shape, dtype) { + var fans = computeFans(shape); + var fanIn = fans[0]; + var fanOut = fans[1]; + var scale = this.scale; + if (this.mode === 'fanIn') { + scale /= Math.max(1, fanIn); + } + else if (this.mode === 'fanOut') { + scale /= Math.max(1, fanOut); + } + else { + scale /= Math.max(1, (fanIn + fanOut) / 2); + } + if (this.distribution === 'normal') { + var stddev = Math.sqrt(scale); + if (dtype === 'bool') { + throw new NotImplementedError(this.getClassName() + " does not support dType bool."); + } + return tfc.truncatedNormal(shape, 0, stddev, dtype, this.seed); + } + else { + var limit = Math.sqrt(3 * scale); + return tfc.randomUniform(shape, -limit, limit, dtype); + } + }; + VarianceScaling.prototype.getConfig = function () { + return { + scale: this.scale, + mode: this.mode, + distribution: this.distribution, + seed: this.seed + }; + }; + VarianceScaling.className = 'VarianceScaling'; + return VarianceScaling; + }(Initializer)); + tfc.serialization.SerializationMap.register(VarianceScaling); + var GlorotUniform = (function (_super) { + __extends(GlorotUniform, _super); + function GlorotUniform(config) { + return _super.call(this, { + scale: 1.0, + mode: 'fanAvg', + distribution: 'uniform', + seed: config == null ? null : config.seed + }) || this; + } + GlorotUniform.prototype.getClassName = function () { + return VarianceScaling.className; + }; + return GlorotUniform; + }(VarianceScaling)); + var GlorotNormal = (function (_super) { + __extends(GlorotNormal, _super); + function GlorotNormal(config) { + return _super.call(this, { + scale: 1.0, + mode: 'fanAvg', + distribution: 'normal', + seed: config == null ? null : config.seed + }) || this; + } + GlorotNormal.prototype.getClassName = function () { + return VarianceScaling.className; + }; + return GlorotNormal; + }(VarianceScaling)); + var HeNormal = (function (_super) { + __extends(HeNormal, _super); + function HeNormal(config) { + return _super.call(this, { + scale: 2.0, + mode: 'fanIn', + distribution: 'normal', + seed: config == null ? null : config.seed + }) || this; + } + HeNormal.prototype.getClassName = function () { + return VarianceScaling.className; + }; + return HeNormal; + }(VarianceScaling)); + var LeCunNormal = (function (_super) { + __extends(LeCunNormal, _super); + function LeCunNormal(config) { + return _super.call(this, { + scale: 1.0, + mode: 'fanIn', + distribution: 'normal', + seed: config == null ? null : config.seed + }) || this; + } + LeCunNormal.prototype.getClassName = function () { + return VarianceScaling.className; + }; + return LeCunNormal; + }(VarianceScaling)); + var Orthogonal = (function (_super) { + __extends(Orthogonal, _super); + function Orthogonal(config) { + var _this = _super.call(this) || this; + _this.DEFAULT_GAIN = 1; + _this.gain = config.gain == null ? _this.DEFAULT_GAIN : config.gain; + _this.seed = config.seed; + if (_this.seed != null) { + throw new NotImplementedError('Random seed is not implemented for Orthogonal Initializer yet.'); + } + return _this; + } + Orthogonal.prototype.apply = function (shape, dtype) { + var _this = this; + return tfc.tidy(function () { + if (shape.length !== 2) { + throw new NotImplementedError('The Orthogonal Initializer does not support non-2D shapes yet.'); + } + if (shape[0] * shape[1] > 2000) { + console.warn("Orthogonal initializer is being called on a matrix with more " + + ("than 2000 (" + shape[0] * shape[1] + ") elements: ") + + "Slowness may result."); + } + var normalizedShape = shape[0] > shape[1] ? [shape[1], shape[0]] : shape; + var a = randomNormal(normalizedShape, 0, 1, 'float32'); + var q = tfc.linalg.gramSchmidt(a); + if (shape[0] > shape[1]) { + q = q.transpose(); + } + return tfc.mul(getScalar(_this.gain), q); + }); + }; + Orthogonal.prototype.getConfig = function () { + return { + gain: this.gain, + seed: this.seed, + }; + }; + Orthogonal.className = 'Orthogonal'; + return Orthogonal; + }(Initializer)); + tfc.serialization.SerializationMap.register(Orthogonal); + var INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { + 'constant': 'Constant', + 'glorotNormal': 'GlorotNormal', + 'glorotUniform': 'GlorotUniform', + 'heNormal': 'HeNormal', + 'identity': 'Identity', + 'leCunNormal': 'LeCunNormal', + 'ones': 'Ones', + 'orthogonal': 'Orthogonal', + 'randomNormal': 'RandomNormal', + 'randomUniform': 'RandomUniform', + 'truncatedNormal': 'TruncatedNormal', + 'varianceScaling': 'VarianceScaling', + 'zeros': 'Zeros' + }; + function deserializeInitializer(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'initializer'); + } + function serializeInitializer(initializer) { + return serializeKerasObject(initializer); + } + function getInitializer(identifier) { + if (typeof identifier === 'string') { + var className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? + INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : + identifier; + if (className === 'GlorotUniform') { + return new GlorotUniform(); + } + else if (className === 'GlorotNormal') { + return new GlorotNormal(); + } + else if (className === 'HeNormal') { + return new HeNormal(); + } + else if (className === 'LeCunNormal') { + return new LeCunNormal(); + } + else { + var config = { className: className, config: {} }; + return deserializeInitializer(config); + } + } + else if (identifier instanceof Initializer) { + return identifier; + } + else { + return deserializeInitializer(identifier); + } + } + + function zeros() { + return new Zeros(); + } + function ones() { + return new Ones(); + } + function constant(config) { + return new Constant(config); + } + function randomUniform(config) { + return new RandomUniform(config); + } + function randomNormal$1(config) { + return new RandomNormal(config); + } + function truncatedNormal(config) { + return new TruncatedNormal(config); + } + function identity(config) { + return new Identity(config); + } + function varianceScaling(config) { + return new VarianceScaling(config); + } + function glorotUniform(config) { + return new GlorotUniform(config); + } + function glorotNormal(config) { + return new GlorotNormal(config); + } + function heNormal(config) { + return new HeNormal(config); + } + function leCunNormal(config) { + return new LeCunNormal(config); + } + function orthogonal(config) { + return new Orthogonal(config); + } + + var exports_initializers = /*#__PURE__*/Object.freeze({ + zeros: zeros, + ones: ones, + constant: constant, + randomUniform: randomUniform, + randomNormal: randomNormal$1, + truncatedNormal: truncatedNormal, + identity: identity, + varianceScaling: varianceScaling, + glorotUniform: glorotUniform, + glorotNormal: glorotNormal, + heNormal: heNormal, + leCunNormal: leCunNormal, + orthogonal: orthogonal + }); + + function isArrayOfShapes(x) { + return Array.isArray(x) && Array.isArray(x[0]); + } + function normalizeShapeList(x) { + if (x.length === 0) { + return []; + } + if (!Array.isArray(x[0])) { + return [x]; + } + return x; + } + function getExactlyOneTensor(xs) { + var x; + if (Array.isArray(xs)) { + if (xs.length !== 1) { + throw new ValueError("Expected Tensor length to be 1; got " + xs.length); + } + x = xs[0]; + } + else { + x = xs; + } + return x; + } + function getExactlyOneShape(shapes) { + if (Array.isArray(shapes) && Array.isArray(shapes[0])) { + if (shapes.length === 1) { + shapes = shapes; + return shapes[0]; + } + else { + throw new ValueError("Expected exactly 1 Shape; got " + shapes.length); + } + } + else { + return shapes; + } + } + + function countParamsInWeights(weights) { + var count = 0; + for (var _i = 0, weights_1 = weights; _i < weights_1.length; _i++) { + var weight = weights_1[_i]; + if (weight.shape.length === 0) { + count += 1; + } + else { + count += weight.shape.reduce(function (a, b) { return a * b; }); + } + } + return count; + } + + var DEFAULT_VARIABLE_NAME_PREFIX = 'Variable'; + var LayerVariable = (function () { + function LayerVariable(val, dtype, name, trainable, constraint) { + if (dtype === void 0) { dtype = 'float32'; } + if (name === void 0) { name = DEFAULT_VARIABLE_NAME_PREFIX; } + if (trainable === void 0) { trainable = true; } + if (constraint === void 0) { constraint = null; } + this.dtype = dtype == null ? 'float32' : dtype; + this.shape = val.shape; + this.id = getNextUniqueTensorId(); + name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name; + this.originalName = getScopedTensorName(name); + this.name = getUniqueTensorName(this.originalName); + this.trainable = trainable; + this.constraint = constraint; + this.val = tfc.variable(val, this.trainable, this.name, this.dtype); + } + LayerVariable.prototype.read = function () { + return this.val; + }; + LayerVariable.prototype.write = function (newVal) { + checkShapesMatch(this.val, newVal); + this.val.assign(newVal); + if (this.constraint != null) { + this.val.assign(this.constraint.apply(this.val)); + } + return this; + }; + return LayerVariable; + }()); + function checkShapesMatch(x, y) { + if (x.shape.toString() !== y.shape.toString()) { + throw new Error('Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' + + JSON.stringify(y.shape)); + } + } + function batchGetValue(xs) { + return xs.map(function (x) { return x.read(); }); + } + function batchSetValue(variablesAndValues) { + variablesAndValues.map(function (variableAndValue) { + var variable = variableAndValue[0]; + variable.write(variableAndValue[1]); + }); + } + + var InputSpec = (function () { + function InputSpec(config) { + this.dtype = config.dtype; + this.shape = config.shape; + if (config.shape != null) { + this.ndim = config.shape.length; + } + else { + this.ndim = config.ndim; + } + this.maxNDim = config.maxNDim; + this.minNDim = config.minNDim; + this.axes = config.axes || {}; + } + return InputSpec; + }()); + var SymbolicTensor = (function () { + function SymbolicTensor(dtype, shape, sourceLayer, inputs, callArgs, name, outputTensorIndex) { + this.dtype = dtype; + this.shape = shape; + this.sourceLayer = sourceLayer; + this.inputs = inputs; + this.callArgs = callArgs; + this.outputTensorIndex = outputTensorIndex; + this.id = getNextUniqueTensorId(); + if (name != null) { + this.originalName = getScopedTensorName(name); + this.name = getUniqueTensorName(this.originalName); + } + this.rank = shape.length; + } + return SymbolicTensor; + }()); + var _nextNodeID = 0; + var Node = (function () { + function Node(config, callArgs) { + this.callArgs = callArgs; + this.id = _nextNodeID++; + this.outboundLayer = config.outboundLayer; + this.inboundLayers = config.inboundLayers; + this.nodeIndices = config.nodeIndices; + this.tensorIndices = config.tensorIndices; + this.inputTensors = config.inputTensors; + this.outputTensors = config.outputTensors; + this.inputMasks = config.inputMasks; + this.outputMasks = config.outputMasks; + this.inputShapes = config.inputShapes; + this.outputShapes = config.outputShapes; + for (var _i = 0, _a = config.inboundLayers; _i < _a.length; _i++) { + var layer = _a[_i]; + if (layer != null) { + layer.outboundNodes.push(this); + } + } + config.outboundLayer.inboundNodes.push(this); + } + Node.prototype.getConfig = function () { + var inboundNames = []; + for (var _i = 0, _a = this.inboundLayers; _i < _a.length; _i++) { + var layer = _a[_i]; + if (layer != null) { + inboundNames.push(layer.name); + } + else { + inboundNames.push(null); + } + } + return { + outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, + inboundLayers: inboundNames, + nodeIndices: this.nodeIndices, + tensorIndices: this.tensorIndices + }; + }; + return Node; + }()); + var _nextLayerID = 0; + var Layer = (function (_super) { + __extends(Layer, _super); + function Layer(config) { + var _this = _super.call(this) || this; + _this._callHook = null; + _this._addedWeightNames = []; + _this._stateful = false; + _this.id = _nextLayerID++; + _this.activityRegularizer = null; + _this.inputSpec = null; + _this.supportsMasking = false; + _this._trainableWeights = []; + _this._nonTrainableWeights = []; + _this._losses = []; + _this._updates = []; + _this._built = false; + _this.inboundNodes = []; + _this.outboundNodes = []; + var name = config.name; + if (!name) { + var prefix = _this.getClassName(); + name = toSnakeCase(prefix) + '_' + getUid(prefix); + } + _this.name = name; + _this.trainable = config.trainable == null ? true : config.trainable; + _this.updatable = config.updatable == null ? true : config.updatable; + if (config.inputShape != null || config.batchInputShape != null) { + var batchInputShape = void 0; + if (config.batchInputShape != null) { + batchInputShape = config.batchInputShape; + } + else if (config.inputShape != null) { + var batchSize = null; + if (config.batchSize != null) { + batchSize = config.batchSize; + } + batchInputShape = [batchSize].concat(config.inputShape); + } + _this.batchInputShape = batchInputShape; + var dtype = config.dtype; + if (dtype == null) { + dtype = config.inputDType; + } + if (dtype == null) { + dtype = 'float32'; + } + _this.dtype = dtype; + } + if (config.weights != null) { + _this.initialWeights = config.weights; + } + else { + _this.initialWeights = null; + } + return _this; + } + Layer.nodeKey = function (layer, nodeIndex) { + return layer.name + '_ib-' + nodeIndex.toString(); + }; + Layer.prototype.getNodeAtIndex = function (nodeIndex, attrName) { + if (this.inboundNodes.length === 0) { + throw new RuntimeError('The layer has never been called ' + + ("and thus has no defined " + attrName + ".")); + } + if (this.inboundNodes.length <= nodeIndex) { + throw new ValueError("Asked to get " + attrName + " at node " + nodeIndex + ", " + + ("but the layer has only " + this.inboundNodes.length + " inbound nodes.")); + } + return this.inboundNodes[nodeIndex]; + }; + Layer.prototype.getInputAt = function (nodeIndex) { + return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'input').inputTensors); + }; + Layer.prototype.getOutputAt = function (nodeIndex) { + return singletonOrArray(this.getNodeAtIndex(nodeIndex, 'output').outputTensors); + }; + Object.defineProperty(Layer.prototype, "input", { + get: function () { + if (this.inboundNodes.length > 1) { + throw new AttributeError("Layer " + this.name + + ' has multiple inbound nodes, ' + + 'hence the notion of "layer input" ' + + 'is ill-defined. ' + + 'Use `getInputAt(nodeIndex)` instead.'); + } + else if (this.inboundNodes.length === 0) { + throw new AttributeError("Layer " + this.name + + ' is not connected, no input to return.'); + } + return singletonOrArray(this.getNodeAtIndex(0, 'input').inputTensors); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "output", { + get: function () { + if (this.inboundNodes.length === 0) { + throw new AttributeError("Layer " + this.name + + ' has no inbound nodes.'); + } + if (this.inboundNodes.length > 1) { + throw new AttributeError("Layer " + this.name + + ' has multiple inbound nodes, ' + + 'hence the notion of "layer output" ' + + 'is ill-defined. ' + + 'Use `getOutputAt(nodeIndex)` instead.'); + } + return singletonOrArray(this.getNodeAtIndex(0, 'output').outputTensors); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "losses", { + get: function () { + return this._losses; + }, + enumerable: true, + configurable: true + }); + Layer.prototype.calculateLosses = function () { + return this.losses.map(function (lossFn) { return lossFn(); }); + }; + Object.defineProperty(Layer.prototype, "updates", { + get: function () { + return this._updates; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "built", { + get: function () { + return this._built; + }, + set: function (built) { + this._built = built; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "trainableWeights", { + get: function () { + if (this.trainable) { + return this._trainableWeights; + } + else { + return []; + } + }, + set: function (weights) { + this._trainableWeights = weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "nonTrainableWeights", { + get: function () { + if (!this.trainable) { + return this._trainableWeights.concat(this._nonTrainableWeights); + } + else { + return this._nonTrainableWeights; + } + }, + set: function (weights) { + this._nonTrainableWeights = weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "weights", { + get: function () { + return this.trainableWeights.concat(this.nonTrainableWeights); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Layer.prototype, "stateful", { + get: function () { + return this._stateful; + }, + enumerable: true, + configurable: true + }); + Layer.prototype.assertInputCompatibility = function (inputs) { + inputs = toList(inputs); + if (this.inputSpec == null || this.inputSpec.length === 0) { + return; + } + var inputSpec = toList(this.inputSpec); + if (inputs.length !== inputSpec.length) { + throw new ValueError("Layer " + this.name + " expects " + inputSpec.length + " inputs, " + + ("but it received " + inputs.length + " input tensors. ") + + ("Input received: " + inputs)); + } + for (var inputIndex = 0; inputIndex < inputs.length; inputIndex++) { + var x = inputs[inputIndex]; + var spec = inputSpec[inputIndex]; + if (spec == null) { + continue; + } + var ndim = x.rank; + if (spec.ndim != null) { + if (ndim !== spec.ndim) { + throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + ": " + + ("expected ndim=" + spec.ndim + ", found ndim=" + ndim)); + } + } + if (spec.maxNDim != null) { + if (ndim > spec.maxNDim) { + throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + + (": expected max_ndim=" + spec.maxNDim + ", found ndim=" + ndim)); + } + } + if (spec.minNDim != null) { + if (ndim < spec.minNDim) { + throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + + (": expected min_ndim=" + spec.minNDim + ", found ndim=" + ndim + ".")); + } + } + if (spec.dtype != null) { + if (x.dtype !== spec.dtype) { + throw new ValueError("Input " + inputIndex + " is incompatible with layer " + this.name + " " + + (": expected dtype=" + spec.dtype + ", found dtype=" + x.dtype + ".")); + } + } + if (spec.axes) { + var xShape = x.shape; + for (var key in spec.axes) { + var axis = Number(key); + var value = spec.axes[key]; + var xShapeAtAxis = axis >= 0 ? xShape[axis] : xShape[xShape.length + axis]; + if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) { + throw new ValueError("Input " + inputIndex + " is incompatible with layer " + + (this.name + ": expected axis " + axis + " of input shape to ") + + ("have value " + value + " but got shape " + xShape + ".")); + } + } + } + if (spec.shape != null) { + for (var i = 0; i < spec.shape.length; ++i) { + var specDim = spec.shape[i]; + var dim = x.shape[i]; + if (specDim != null && dim != null) { + if (specDim !== dim) { + throw new ValueError("Input " + inputIndex + " is incompatible with layer " + + (this.name + ": expected shape=" + spec.shape + ", ") + + 'found shape=${xShape}.'); + } + } + } + } + } + }; + Layer.prototype.call = function (inputs, kwargs) { + return inputs; + }; + Layer.prototype.invokeCallHook = function (inputs, kwargs) { + if (this._callHook != null) { + this._callHook(inputs, kwargs); + } + }; + Layer.prototype.setCallHook = function (callHook) { + this._callHook = callHook; + }; + Layer.prototype.clearCallHook = function () { + this._callHook = null; + }; + Layer.prototype.apply = function (inputs, kwargs) { + var _this = this; + kwargs = kwargs || {}; + var inputsList = toList(inputs); + var allAreSymbolic = true; + for (var _i = 0, inputsList_1 = inputsList; _i < inputsList_1.length; _i++) { + var input = inputsList_1[_i]; + if (!(input instanceof SymbolicTensor)) { + allAreSymbolic = false; + break; + } + } + var noneAreSymbolic = true; + for (var _a = 0, inputsList_2 = inputsList; _a < inputsList_2.length; _a++) { + var input = inputsList_2[_a]; + if (input instanceof SymbolicTensor) { + noneAreSymbolic = false; + break; + } + } + if (allAreSymbolic === noneAreSymbolic) { + throw new ValueError('Arguments to apply() must be all ' + + 'SymbolicTensors or all Tensors'); + } + return nameScope(this.name, function () { + if (!_this.built) { + _this.assertInputCompatibility(inputs); + var inputShapes = []; + for (var _i = 0, _a = toList(inputs); _i < _a.length; _i++) { + var xElem = _a[_i]; + inputShapes.push(xElem.shape); + } + _this.build(singletonOrArray(inputShapes)); + _this.built = true; + if (_this.initialWeights) { + _this.setWeights(_this.initialWeights); + } + } + _this.assertInputCompatibility(inputs); + if (noneAreSymbolic) { + var output = _this.call(inputs, kwargs); + var outputList = toList(output); + var outputListCopy = []; + for (var _b = 0, outputList_1 = outputList; _b < outputList_1.length; _b++) { + var x = outputList_1[_b]; + if (inputsList.indexOf(x) !== -1) { + x = x.clone(); + } + outputListCopy.push(x); + } + output = singletonOrArray(outputListCopy); + if (_this.activityRegularizer != null) { + throw new NotImplementedError('Layer invocation in the presence of activity ' + + 'regularizer(s) is not supported yet.'); + } + return output; + } + else { + var inputShape = collectInputShape(inputs); + var outputShape = _this.computeOutputShape(inputShape); + var output = void 0; + var outputDType_1 = guessOutputDType(inputs); + _this.warnOnIncompatibleInputShape(Array.isArray(inputs) ? inputShape[0] : + inputShape); + if (outputShape != null && outputShape.length > 0 && + Array.isArray(outputShape[0])) { + output = outputShape + .map(function (shape, index) { return new SymbolicTensor(outputDType_1, shape, _this, toList(inputs), kwargs, _this.name, index); }); + } + else { + output = new SymbolicTensor(outputDType_1, outputShape, _this, toList(inputs), kwargs, _this.name); + } + _this.addInboundNode(inputs, output, null, null, inputShape, outputShape, kwargs); + if (_this.activityRegularizer != null) { + throw new NotImplementedError('Layer invocation in the presence of activity ' + + 'regularizer(s) is not supported yet.'); + } + return output; + } + }); + }; + Layer.prototype.warnOnIncompatibleInputShape = function (inputShape) { + if (this.batchInputShape == null) { + return; + } + else if (inputShape.length !== this.batchInputShape.length) { + console.warn("The rank of the input tensor provided (shape: " + + (JSON.stringify(inputShape) + ") does not match that of the ") + + ("batchInputShape (" + JSON.stringify(this.batchInputShape) + ") ") + + ("of the layer " + this.name)); + } + else { + var dimMismatch_1 = false; + this.batchInputShape.forEach(function (dimension, i) { + if (dimension != null && inputShape[i] != null && + inputShape[i] !== dimension) { + dimMismatch_1 = true; + } + }); + if (dimMismatch_1) { + console.warn("The shape of the input tensor " + + ("(" + JSON.stringify(inputShape) + ") does not ") + + ("match the expectation of layer " + this.name + ": ") + + ("" + JSON.stringify(this.batchInputShape))); + } + } + }; + Object.defineProperty(Layer.prototype, "outputShape", { + get: function () { + if (this.inboundNodes == null || this.inboundNodes.length === 0) { + throw new AttributeError("The layer " + this.name + " has never been called and thus has no " + + "defined output shape."); + } + var allOutputShapes = []; + for (var _i = 0, _a = this.inboundNodes; _i < _a.length; _i++) { + var node = _a[_i]; + var shapeString = JSON.stringify(node.outputShapes); + if (allOutputShapes.indexOf(shapeString) === -1) { + allOutputShapes.push(shapeString); + } + } + if (allOutputShapes.length === 1) { + var outputShapes = this.inboundNodes[0].outputShapes; + if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) && + outputShapes.length === 1) { + return outputShapes[0]; + } + else { + return outputShapes; + } + } + else { + throw new AttributeError("The layer " + this.name + " has multiple inbound nodes with different " + + "output shapes. Hence the notion of \"outut shape\" is ill-defined " + + "for the layer."); + } + }, + enumerable: true, + configurable: true + }); + Layer.prototype.countParams = function () { + if (!this.built) { + throw new RuntimeError("You tried to call countParams() on " + this.name + ", " + + "but the layer is not built yet. Build it first by calling " + + "build(batchInputShape)."); + } + return countParamsInWeights(this.weights); + }; + Layer.prototype.build = function (inputShape) { + this.built = true; + }; + Layer.prototype.getWeights = function (trainableOnly) { + if (trainableOnly === void 0) { trainableOnly = false; } + return batchGetValue(trainableOnly ? this.trainableWeights : this.weights); + }; + Layer.prototype.setWeights = function (weights) { + var _this = this; + tfc.tidy(function () { + var params = _this.weights; + if (params.length !== weights.length) { + throw new ValueError("You called setWeights(weights) on layer \"" + _this.name + "\" " + + ("with a weight list of length " + weights.length + ", ") + + ("but the layer was expecting " + params.length + " weights. ") + + ("Provided weights: " + weights + "...")); + } + if (params.length === 0) { + return; + } + var weightValueTuples = []; + var paramValues = batchGetValue(params); + for (var i = 0; i < paramValues.length; ++i) { + var pv = paramValues[i]; + var p = params[i]; + var w = weights[i]; + if (!tfc.util.arraysEqual(pv.shape, w.shape)) { + throw new ValueError("Layer weight shape " + pv.shape + " " + + ("not compatible with provided weight shape " + w.shape)); + } + weightValueTuples.push([p, w]); + } + batchSetValue(weightValueTuples); + }); + }; + Layer.prototype.addWeight = function (name, shape, dtype, initializer, regularizer, trainable, constraint) { + if (this._addedWeightNames.indexOf(name) !== -1) { + throw new ValueError("Duplicate weight name " + name + " for layer " + this.name); + } + this._addedWeightNames.push(name); + if (dtype == null) { + dtype = 'float32'; + } + var weight = new LayerVariable(initializer.apply(shape, dtype), dtype, name, trainable, constraint); + if (regularizer != null) { + this.addLoss(function () { return regularizer.apply(weight.read()); }); + } + if (trainable == null) { + trainable = true; + } + if (trainable) { + this._trainableWeights.push(weight); + } + else { + this._nonTrainableWeights.push(weight); + } + return weight; + }; + Layer.prototype.addLoss = function (losses) { + if (losses == null || Array.isArray(losses) && losses.length === 0) { + return; + } + losses = toList(losses); + if (this._losses !== undefined && this._losses !== null) { + (_a = this.losses).push.apply(_a, losses); + } + var _a; + }; + Layer.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + Layer.prototype.computeMask = function (inputs, mask) { + var _this = this; + if (!this.supportsMasking) { + if (mask != null) { + if (Array.isArray(mask)) { + mask.forEach(function (maskElement) { + if (maskElement != null) { + throw new TypeError("Layer " + _this.name + " does not support masking," + + 'but was passed an inputMask.'); + } + }); + } + else { + throw new TypeError("Layer " + this.name + " does not support masking," + + 'but was passed an inputMask.'); + } + } + return null; + } + return mask; + }; + Layer.prototype.addInboundNode = function (inputTensors, outputTensors, inputMasks, outputMasks, inputShapes, outputShapes, kwargs) { + if (kwargs === void 0) { kwargs = null; } + var inputTensorList = toList(inputTensors); + outputTensors = toList(outputTensors); + inputMasks = toList(inputMasks); + outputMasks = toList(outputMasks); + inputShapes = normalizeShapeList(inputShapes); + outputShapes = normalizeShapeList(outputShapes); + var inboundLayers = []; + var nodeIndices = []; + var tensorIndices = []; + for (var _i = 0, inputTensorList_1 = inputTensorList; _i < inputTensorList_1.length; _i++) { + var x = inputTensorList_1[_i]; + inboundLayers.push(x.sourceLayer); + nodeIndices.push(x.nodeIndex); + tensorIndices.push(x.tensorIndex); + } + new Node({ + outboundLayer: this, + inboundLayers: inboundLayers, + nodeIndices: nodeIndices, + tensorIndices: tensorIndices, + inputTensors: inputTensorList, + outputTensors: outputTensors, + inputMasks: inputMasks, + outputMasks: outputMasks, + inputShapes: inputShapes, + outputShapes: outputShapes + }, kwargs); + for (var i = 0; i < outputTensors.length; i++) { + outputTensors[i].sourceLayer = this; + outputTensors[i].nodeIndex = this.inboundNodes.length - 1; + outputTensors[i].tensorIndex = i; + } + }; + Layer.prototype.getConfig = function () { + var config = { name: this.name, trainable: this.trainable }; + if (this.batchInputShape != null) { + config['batchInputShape'] = this.batchInputShape; + } + if (this.dtype != null) { + config['dtype'] = this.dtype; + } + return config; + }; + return Layer; + }(tfc.serialization.Serializable)); + function collectInputShape(inputTensors) { + inputTensors = + toList(inputTensors); + var shapes = []; + for (var _i = 0, inputTensors_1 = inputTensors; _i < inputTensors_1.length; _i++) { + var x = inputTensors_1[_i]; + shapes.push(x.shape); + } + return singletonOrArray(shapes); + } + function guessOutputDType(inputTensors) { + return 'float32'; + } + function getSourceInputs(tensor, layer, nodeIndex) { + if (layer == null || (nodeIndex != null && nodeIndex > 0)) { + layer = tensor.sourceLayer; + nodeIndex = tensor.nodeIndex; + } + if (layer.inboundNodes.length === 0) { + return [tensor]; + } + else { + var node = layer.inboundNodes[nodeIndex]; + if (node.inboundLayers.length === 0) { + return node.inputTensors; + } + else { + var sourceTensors = []; + for (var i = 0; i < node.inboundLayers.length; i++) { + var x = node.inputTensors[i]; + var layer_1 = node.inboundLayers[i]; + var nodeIndex_1 = node.nodeIndices[i]; + var previousSources = getSourceInputs(x, layer_1, nodeIndex_1); + for (var _i = 0, previousSources_1 = previousSources; _i < previousSources_1.length; _i++) { + var x_1 = previousSources_1[_i]; + if (sourceTensors.indexOf(x_1) === -1) { + sourceTensors.push(x_1); + } + } + } + return sourceTensors; + } + } + } + + var InputLayer = (function (_super) { + __extends(InputLayer, _super); + function InputLayer(config) { + var _this = _super.call(this, { + dtype: config.dtype, + name: config.name != null ? config.name : getUid('input').toString() + }) || this; + if (config.batchSize == null) { + config.batchSize = null; + } + if (config.sparse == null) { + config.sparse = false; + } + _this.trainable = false; + _this.built = true; + _this.sparse = config.sparse; + if (config.inputShape != null && config.batchInputShape != null) { + throw new ValueError('Only provide the inputShape OR ' + + 'batchInputShape argument to inputLayer, not both at the same time.'); + } + var batchInputShape = config.batchInputShape; + if (batchInputShape == null) { + if (config.inputShape == null) { + throw new ValueError('An InputLayer should be passed either a ' + + '`batchInputShape` or an `inputShape`.'); + } + else { + batchInputShape = [config.batchSize].concat(config.inputShape); + } + } + else { + if (config.batchSize != null) { + throw new ValueError('Cannot specify batchSize if batchInputShape is' + + 'specified when creating an InputLayer.'); + } + } + var dtype = config.dtype || 'float32'; + _this.batchInputShape = batchInputShape; + _this.dtype = dtype; + _this.inputSpec = [{ shape: batchInputShape }]; + var inputTensor = new SymbolicTensor(_this.dtype, _this.batchInputShape, _this, [], {}, _this.name); + inputTensor.nodeIndex = 0; + inputTensor.tensorIndex = 0; + new Node({ + outboundLayer: _this, + inboundLayers: [], + nodeIndices: [], + tensorIndices: [], + inputTensors: [inputTensor], + outputTensors: [inputTensor], + inputMasks: [null], + outputMasks: [null], + inputShapes: [batchInputShape], + outputShapes: [batchInputShape] + }); + return _this; + } + InputLayer.prototype.apply = function (inputs, kwargs) { + throw new ValueError('Cannot pass any input to an ' + + ("InputLayer's apply() method. InputLayer name: " + this.name)); + }; + InputLayer.prototype.getConfig = function () { + return { + batchInputShape: this.batchInputShape, + dtype: this.dtype, + sparse: this.sparse, + name: this.name + }; + }; + InputLayer.className = 'InputLayer'; + return InputLayer; + }(Layer)); + tfc.serialization.SerializationMap.register(InputLayer); + function Input(config) { + if (config.batchShape == null && config.shape == null) { + throw new Error('Please provide to Input either a `shape`' + + ' or a `batchShape` argument. Note that ' + + '`shape` does not include the batch ' + + 'dimension.'); + } + if (config.batchShape != null && config.shape != null) { + throw new ValueError('Please provide either a `shape` or `batchShape` ' + + 'argument to Input, but not both.'); + } + var batchShape = config.batchShape; + if (config.shape != null && batchShape == null) { + batchShape = [null].concat(config.shape); + } + var dtype = config.dtype; + if (dtype == null) { + dtype = 'float32'; + } + var inputLayer = new InputLayer({ + batchInputShape: batchShape, + name: config.name, + dtype: dtype, + sparse: config.sparse + }); + var outputs = inputLayer.inboundNodes[0].outputTensors; + return outputs[0]; + } + + function resolveScalarsInLogs(logs) { + return __awaiter(this, void 0, void 0, function () { + var promises, keys, scalarsToDispose, key, value, valueScalar, values, i; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (logs == null) { + return [2]; + } + promises = []; + keys = []; + scalarsToDispose = []; + for (key in logs) { + value = logs[key]; + if (typeof value !== 'number') { + valueScalar = value; + promises.push(valueScalar.data()); + keys.push(key); + scalarsToDispose.push(valueScalar); + } + } + return [4, Promise.all(promises)]; + case 1: + values = _a.sent(); + for (i = 0; i < values.length; ++i) { + logs[keys[i]] = values[i][0]; + } + tfc.dispose(scalarsToDispose); + return [2]; + } + }); + }); + } + function disposeTensorsInLogs(logs) { + if (logs == null) { + return; + } + for (var key in logs) { + var value = logs[key]; + if (typeof value !== 'number') { + value.dispose(); + } + } + } + + var BaseCallback = (function () { + function BaseCallback() { + this.validationData = null; + } + BaseCallback.prototype.setParams = function (params) { + this.params = params; + }; + BaseCallback.prototype.onEpochBegin = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onBatchBegin = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onBatchEnd = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onTrainBegin = function (logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.onTrainEnd = function (logs) { + return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2]; + }); }); + }; + BaseCallback.prototype.setModel = function (model) { + }; + return BaseCallback; + }()); + var CallbackList = (function () { + function CallbackList(callbacks, queueLength) { + if (queueLength === void 0) { queueLength = 10; } + if (callbacks == null) { + callbacks = []; + } + this.callbacks = callbacks; + this.queueLength = queueLength; + } + CallbackList.prototype.append = function (callback) { + this.callbacks.push(callback); + }; + CallbackList.prototype.setParams = function (params) { + for (var _i = 0, _a = this.callbacks; _i < _a.length; _i++) { + var callback = _a[_i]; + callback.setParams(params); + } + }; + CallbackList.prototype.setModel = function (model) { + for (var _i = 0, _a = this.callbacks; _i < _a.length; _i++) { + var callback = _a[_i]; + callback.setModel(model); + } + }; + CallbackList.prototype.onEpochBegin = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onEpochBegin(epoch, logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onEpochEnd(epoch, logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onBatchBegin = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onBatchBegin(batch, logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onBatchEnd = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onBatchEnd(batch, logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onTrainBegin = function (logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onTrainBegin(logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + CallbackList.prototype.onTrainEnd = function (logs) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, callback; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (logs == null) { + logs = {}; + } + _i = 0, _a = this.callbacks; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + callback = _a[_i]; + return [4, callback.onTrainEnd(logs)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: return [2]; + } + }); + }); + }; + return CallbackList; + }()); + var BaseLogger = (function (_super) { + __extends(BaseLogger, _super); + function BaseLogger() { + return _super.call(this) || this; + } + BaseLogger.prototype.onEpochBegin = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + this.seen = 0; + this.totals = {}; + return [2]; + }); + }); + }; + BaseLogger.prototype.onBatchEnd = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var batchSize, _loop_1, this_1, key; + return __generator(this, function (_a) { + if (logs == null) { + logs = {}; + } + batchSize = logs['size'] == null ? 0 : logs['size']; + this.seen += batchSize; + _loop_1 = function (key) { + var value = logs[key]; + if (typeof value === 'number') { + if (!this_1.totals.hasOwnProperty(key)) { + this_1.totals[key] = 0; + } + this_1.totals[key] = this_1.totals[key] + value * batchSize; + } + else { + var oldTotalsToDispose = void 0; + if (key in this_1.totals) { + oldTotalsToDispose = this_1.totals[key]; + } + else { + this_1.totals[key] = getScalar(0); + } + this_1.totals[key] = tfc.tidy(function () { return tfc.add(_this.totals[key], tfc.mul(value, getScalar(batchSize))); }); + if (oldTotalsToDispose != null) { + oldTotalsToDispose.dispose(); + } + } + }; + this_1 = this; + for (key in logs) { + _loop_1(key); + } + return [2]; + }); + }); + }; + BaseLogger.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var _loop_2, this_2, _i, _a, key; + return __generator(this, function (_b) { + if (logs != null) { + _loop_2 = function (key) { + if (this_2.totals[key] == null) { + return "continue"; + } + if (typeof this_2.totals[key] === 'number') { + logs[key] = this_2.totals[key] / this_2.seen; + } + else { + tfc.tidy(function () { + logs[key] = tfc.mul(tfc.div(getScalar(1), getScalar(_this.seen)), _this.totals[key]); + _this.totals[key].dispose(); + tfc.keep(logs[key]); + }); + } + }; + this_2 = this; + for (_i = 0, _a = this.params['metrics']; _i < _a.length; _i++) { + key = _a[_i]; + _loop_2(key); + } + } + return [2]; + }); + }); + }; + return BaseLogger; + }(BaseCallback)); + var History = (function (_super) { + __extends(History, _super); + function History() { + return _super !== null && _super.apply(this, arguments) || this; + } + History.prototype.onTrainBegin = function (logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + this.epoch = []; + this.history = {}; + return [2]; + }); + }); + }; + History.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + var key; + return __generator(this, function (_a) { + if (logs == null) { + logs = {}; + } + this.epoch.push(epoch); + for (key in logs) { + if (this.history[key] == null) { + this.history[key] = []; + } + this.history[key].push(logs[key]); + } + return [2]; + }); + }); + }; + History.prototype.syncData = function () { + return __awaiter(this, void 0, void 0, function () { + var promises, keys, indices, key, valueArray, i, valueScalar, values, n, tensorToDispose; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + promises = []; + keys = []; + indices = []; + for (key in this.history) { + valueArray = this.history[key]; + for (i = 0; i < valueArray.length; ++i) { + if (typeof valueArray[i] !== 'number') { + valueScalar = valueArray[i]; + promises.push(valueScalar.data()); + keys.push(key); + indices.push(i); + } + } + } + return [4, Promise.all(promises)]; + case 1: + values = _a.sent(); + for (n = 0; n < values.length; ++n) { + tensorToDispose = this.history[keys[n]][indices[n]]; + tensorToDispose.dispose(); + this.history[keys[n]][indices[n]] = values[n][0]; + } + return [2]; + } + }); + }); + }; + return History; + }(BaseCallback)); + var CustomCallback = (function (_super) { + __extends(CustomCallback, _super); + function CustomCallback(config) { + var _this = _super.call(this) || this; + _this.trainBegin = config.onTrainBegin; + _this.trainEnd = config.onTrainEnd; + _this.epochBegin = config.onEpochBegin; + _this.epochEnd = config.onEpochEnd; + _this.batchBegin = config.onBatchBegin; + _this.batchEnd = config.onBatchEnd; + return _this; + } + CustomCallback.prototype.onEpochBegin = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.epochBegin != null)) return [3, 3]; + return [4, resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.epochBegin(epoch, logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onEpochEnd = function (epoch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.epochEnd != null)) return [3, 3]; + return [4, resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.epochEnd(epoch, logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onBatchBegin = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.batchBegin != null)) return [3, 3]; + return [4, resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.batchBegin(batch, logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onBatchEnd = function (batch, logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.batchEnd != null)) return [3, 3]; + return [4, resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.batchEnd(batch, logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onTrainBegin = function (logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.trainBegin != null)) return [3, 3]; + return [4, resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.trainBegin(logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + CustomCallback.prototype.onTrainEnd = function (logs) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(this.trainEnd != null)) return [3, 3]; + return [4, resolveScalarsInLogs(logs)]; + case 1: + _a.sent(); + return [4, this.trainEnd(logs)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: return [2]; + } + }); + }); + }; + return CustomCallback; + }(BaseCallback)); + function standardizeCallbacks(callbacks) { + if (callbacks == null) { + return null; + } + if (callbacks instanceof BaseCallback) { + return [callbacks]; + } + if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) { + return callbacks; + } + var callbackConfigs = toList(callbacks); + return callbackConfigs.map(function (callbackConfig) { return new CustomCallback(callbackConfig); }); + } + + function l2Normalize(x, axis) { + return tfc.tidy(function () { + var squareSum = tfc.sum(square(x), axis, true); + var epsilonTensor = tfc.mul(tfc.scalar(epsilon()), tfc.onesLike(x)); + var norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor)); + return tfc.div(x, norm); + }); + } + function meanSquaredError(yTrue, yPred) { + return tfc.tidy(function () { return tfc.mean(square(tfc.sub(yPred, yTrue)), -1); }); + } + function meanAbsoluteError(yTrue, yPred) { + return tfc.tidy(function () { return tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1); }); + } + function meanAbsolutePercentageError(yTrue, yPred) { + return tfc.tidy(function () { + var diff = tfc.sub(yTrue, yPred); + var clippedTrue = tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE); + var absResult = tfc.abs(tfc.div(diff, clippedTrue)); + return tfc.mul(getScalar(100.0), tfc.mean(absResult, -1)); + }); + } + function meanSquaredLogarithmicError(yTrue, yPred) { + return tfc.tidy(function () { + var one = getScalar(1.0); + var clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE); + var firstLog = tfc.log(tfc.add(one, clippedPred)); + var clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE); + var secondLog = tfc.log(tfc.add(one, clippedTrue)); + return tfc.mean(square(tfc.sub(firstLog, secondLog)), -1); + }); + } + function squaredHinge(yTrue, yPred) { + return tfc.tidy(function () { + var zeroTensor = getScalar(0.0); + var one = getScalar(1.0); + var maxResult = tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred))); + return tfc.mean(square(maxResult), -1); + }); + } + function hinge(yTrue, yPred) { + return tfc.tidy(function () { + var zeroTensor = getScalar(0.0); + var one = getScalar(1.0); + var maxResult = tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred))); + return tfc.mean(maxResult, -1); + }); + } + function categoricalHinge(yTrue, yPred) { + return tfc.tidy(function () { + var zeroTensor = getScalar(0.0); + var one = getScalar(1.0); + var pos = tfc.sum(tfc.mul(yTrue, yPred), -1); + var neg = tfc.max(tfc.mul(tfc.sub(one, yTrue), yPred), -1); + return tfc.maximum(zeroTensor, tfc.add(one, tfc.sub(neg, pos))); + }); + } + function logcosh(yTrue, yPred) { + return tfc.tidy(function () { + var log2 = getScalar(Math.log(2.0)); + var predictionDiff = tfc.sub(yPred, yTrue); + var logcoshResult = tfc.sub(tfc.add(predictionDiff, tfc.softplus(tfc.mul(getScalar(-2.0), predictionDiff))), log2); + return tfc.mean(logcoshResult, -1); + }); + } + function categoricalCrossentropy(target, output, fromLogits) { + if (fromLogits === void 0) { fromLogits = false; } + return tfc.tidy(function () { + if (fromLogits) { + output = tfc.softmax(output); + } + else { + var outputSum = tfc.sum(output, output.shape.length - 1, true); + output = tfc.div(output, outputSum); + } + output = tfc.clipByValue(output, epsilon(), 1 - epsilon()); + return tfc.neg(tfc.sum(tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1)); + }); + } + function sparseCategoricalCrossentropy(target, output, fromLogits) { + if (fromLogits === void 0) { fromLogits = false; } + return tfc.tidy(function () { + var flatTarget = tfc.floor(flatten(target)).toInt(); + var outputShape = output.shape; + var oneHotTarget = tfc.oneHot(flatTarget, outputShape[outputShape.length - 1]) + .reshape(outputShape); + return categoricalCrossentropy(oneHotTarget, output, fromLogits); + }); + } + function sigmoidCrossEntropyWithLogits(target, output) { + return tfc.tidy(function () { + var maxOutput = tfc.maximum(output, tfc.zerosLike(output)); + var outputXTarget = tfc.mul(output, target); + var sigmoidOutput = tfc.log(tfc.add(getScalar(1), tfc.exp(tfc.neg(tfc.abs(output))))); + var result = tfc.add(tfc.sub(maxOutput, outputXTarget), sigmoidOutput); + return result; + }); + } + function binaryCrossentropy(yTrue, yPred) { + return tfc.tidy(function () { + var y; + y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon()); + y = tfc.log(tfc.div(y, tfc.sub(tfc.onesLike(y), y))); + return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1); + }); + } + function kullbackLeiblerDivergence(yTrue, yPred) { + return tfc.tidy(function () { + var clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1); + var clippedPred = tfc.clipByValue(yPred, epsilon(), 1); + return tfc.sum(tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1); + }); + } + function poisson(yTrue, yPred) { + return tfc.tidy(function () { + var logPred = tfc.log(tfc.add(getScalar(epsilon()), yPred)); + return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1); + }); + } + function cosineProximity(yTrue, yPred) { + return tfc.tidy(function () { + var trueNormalized = l2Normalize(yTrue, -1); + var predNormalized = l2Normalize(yPred, -1); + var trueXPred = tfc.mul(trueNormalized, predNormalized); + return tfc.neg(tfc.sum(trueXPred, -1)); + }); + } + function get(identifierOrFn) { + var lossesMap = { + meanSquaredError: meanSquaredError, + meanAbsoluteError: meanAbsoluteError, + meanAbsolutePercentageError: meanAbsolutePercentageError, + meanSquaredLogarithmicError: meanSquaredLogarithmicError, + squaredHinge: squaredHinge, + hinge: hinge, + categoricalHinge: categoricalHinge, + logcosh: logcosh, + categoricalCrossentropy: categoricalCrossentropy, + sparseCategoricalCrossentropy: sparseCategoricalCrossentropy, + binaryCrossentropy: binaryCrossentropy, + kullbackLeiblerDivergence: kullbackLeiblerDivergence, + poisson: poisson, + cosineProximity: cosineProximity + }; + if (typeof identifierOrFn === 'string') { + if (identifierOrFn in lossesMap) { + return lossesMap[identifierOrFn]; + } + throw new ValueError("Unknown loss " + identifierOrFn); + } + else { + return identifierOrFn; + } + } + + function binaryAccuracy(yTrue, yPred) { + return tfc.tidy(function () { + var threshold = tfc.mul(getScalar(0.5), tfc.onesLike(yPred)); + var yPredThresholded = cast(tfc.greater(yPred, threshold), yTrue.dtype); + return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1); + }); + } + function categoricalAccuracy(yTrue, yPred) { + return tfc.tidy(function () { return cast(tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'); }); + } + function binaryCrossentropy$1(yTrue, yPred) { + return binaryCrossentropy(yTrue, yPred); + } + function sparseCategoricalAccuracy(yTrue, yPred) { + throw new NotImplementedError(); + } + var mse$1 = meanSquaredError; + var MSE$1 = meanSquaredError; + var mae$1 = meanAbsoluteError; + var MAE$1 = meanAbsoluteError; + var mape$1 = meanAbsolutePercentageError; + var MAPE$1 = meanAbsolutePercentageError; + var categoricalCrossentropy$1 = categoricalCrossentropy; + var cosine$1 = cosineProximity; + var sparseCategoricalCrossentropy$1 = sparseCategoricalCrossentropy; + function get$1(identifier) { + var metricsMap = { + binaryAccuracy: binaryAccuracy, + categoricalAccuracy: categoricalAccuracy, + categoricalCrossentropy: categoricalCrossentropy$1, + sparseCategoricalCrossentropy: sparseCategoricalCrossentropy$1, + mse: mse$1, + MSE: MSE$1, + mae: mae$1, + MAE: MAE$1, + mape: mape$1, + MAPE: MAPE$1, + cosine: cosine$1, + }; + if (typeof identifier === 'string' && identifier in metricsMap) { + return metricsMap[identifier]; + } + else if (typeof identifier !== 'string' && identifier != null) { + return identifier; + } + else { + throw new ValueError("Unknown metric " + identifier); + } + } + + function getOptimizer(identifier) { + var optimizerMap = { + 'Adagrad': function () { return tfc.train.adagrad(0.01); }, + 'Adadelta': function () { return tfc.train.adadelta(1, 0.95, epsilon()); }, + 'Adam': function () { return tfc.train.adam(0.001, 0.9, 0.999, epsilon()); }, + 'Adamax': function () { return tfc.train.adamax(0.002, 0.9, 0.999, epsilon(), 0); }, + 'RMSProp': function () { return tfc.train.rmsprop(0.001, 0.9, 0, epsilon()); }, + 'SGD': function () { return tfc.train.sgd(0.01); } + }; + optimizerMap['adagrad'] = optimizerMap['Adagrad']; + optimizerMap['adadelta'] = optimizerMap['Adadelta']; + optimizerMap['adam'] = optimizerMap['Adam']; + optimizerMap['adamax'] = optimizerMap['Adamax']; + optimizerMap['rmsprop'] = optimizerMap['RMSProp']; + optimizerMap['sgd'] = optimizerMap['SGD']; + if (identifier in optimizerMap) { + return optimizerMap[identifier](); + } + throw new ValueError("Unknown Optimizer " + identifier); + } + + function printSummary(model, lineLength, positions, printFn) { + if (printFn === void 0) { printFn = console.log; } + var sequentialLike = isModelSequentialLike(model); + var toDisplay = ['Layer (type)', 'Output shape', 'Param #']; + if (sequentialLike) { + lineLength = lineLength || 65; + positions = positions || [0.45, 0.85, 1]; + } + else { + lineLength = lineLength || 98; + positions = positions || [0.33, 0.55, 0.67, 1]; + } + if (positions[positions.length - 1] <= 1) { + positions = positions.map(function (p) { return Math.floor(lineLength * p); }); + } + var relevantNodes; + if (!sequentialLike) { + toDisplay.push('Receives inputs'); + relevantNodes = []; + for (var depth in model.nodesByDepth) { + relevantNodes.push.apply(relevantNodes, model.nodesByDepth[depth]); + } + } + printFn('_'.repeat(lineLength)); + printRow(toDisplay, positions, printFn); + printFn('='.repeat(lineLength)); + var layers = model.layers; + for (var i = 0; i < layers.length; ++i) { + if (sequentialLike) { + printLayerSummary(layers[i], positions, printFn); + } + else { + printLayerSummaryWithConnections(layers[i], positions, relevantNodes, printFn); + } + printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength)); + } + model.checkTrainableWeightsConsistency(); + var trainableCount; + if (model.collectedTrainableWeights != null) { + trainableCount = + countParamsInWeights(model.collectedTrainableWeights); + } + else { + trainableCount = countParamsInWeights(model.trainableWeights); + } + var nonTrainableCount = countParamsInWeights(model.nonTrainableWeights); + printFn("Total params: " + (trainableCount + nonTrainableCount)); + printFn("Trainable params: " + trainableCount); + printFn("Non-trainable params: " + nonTrainableCount); + printFn('_'.repeat(lineLength)); + } + function isModelSequentialLike(model) { + var sequentialLike = true; + var nodesByDepth = []; + var nodes = []; + for (var depth in model.nodesByDepth) { + nodesByDepth.push(model.nodesByDepth[depth]); + } + for (var _i = 0, nodesByDepth_1 = nodesByDepth; _i < nodesByDepth_1.length; _i++) { + var depthNodes = nodesByDepth_1[_i]; + if (depthNodes.length > 1 || + depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) { + sequentialLike = false; + break; + } + nodes.push.apply(nodes, depthNodes); + } + if (sequentialLike) { + for (var _a = 0, _b = model.layers; _a < _b.length; _a++) { + var layer = _b[_a]; + var flag = false; + for (var _c = 0, _d = layer.inboundNodes; _c < _d.length; _c++) { + var node = _d[_c]; + if (nodes.indexOf(node) !== -1) { + if (flag) { + sequentialLike = false; + break; + } + else { + flag = true; + } + } + } + if (!sequentialLike) { + break; + } + } + } + return sequentialLike; + } + function printRow(fields, positions, printFn) { + if (printFn === void 0) { printFn = console.log; } + var line = ''; + for (var i = 0; i < fields.length; ++i) { + if (i > 0) { + line = line.slice(0, line.length - 1) + ' '; + } + line += fields[i]; + line = line.slice(0, positions[i]); + line += ' '.repeat(positions[i] - line.length); + } + printFn(line); + } + function printLayerSummary(layer, positions, printFn) { + var outputShape; + try { + outputShape = JSON.stringify(layer.outputShape); + } + catch (err) { + outputShape = 'multiple'; + } + var name = layer.name; + var className = layer.getClassName(); + var fields = [name + " (" + className + ")", outputShape, layer.countParams().toString()]; + printRow(fields, positions, printFn); + } + function printLayerSummaryWithConnections(layer, positions, relevantNodes, printFn) { + var outputShape; + try { + outputShape = JSON.stringify(layer.outputShape); + } + catch (err) { + outputShape = 'multiple'; + } + var connections = []; + for (var _i = 0, _a = layer.inboundNodes; _i < _a.length; _i++) { + var node = _a[_i]; + if (relevantNodes != null && relevantNodes.length > 0 && + relevantNodes.indexOf(node) === -1) { + continue; + } + for (var i = 0; i < node.inboundLayers.length; ++i) { + var inboundLayer = node.inboundLayers[i].name; + var inboundLayerIndex = node.nodeIndices[i]; + var inboundTensorIndex = node.tensorIndices[i]; + connections.push(inboundLayer + "[" + inboundLayerIndex + "][" + inboundTensorIndex + "]"); + } + } + var name = layer.name; + var className = layer.getClassName(); + var firstConnection = connections.length === 0 ? '' : connections[0]; + var fields = [ + name + " (" + className + ")", outputShape, layer.countParams().toString(), + firstConnection + ]; + printRow(fields, positions, printFn); + for (var i = 1; i < connections.length; ++i) { + printRow(['', '', '', connections[i]], positions, printFn); + } + } + + function deserialize(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'layer'); + } + + function isArrayItemInputOrOutputName(key, index, value) { + return (key === 'inboundNodes' || key === 'outputLayers' || + key === 'inputLayers') && + index === 0 && typeof value === 'string'; + } + function convertPythonicToTs(pythonicConfig, key) { + if (pythonicConfig === null) { + return null; + } + else if (typeof pythonicConfig === 'string') { + return toCamelCase(pythonicConfig); + } + else if ((typeof pythonicConfig === 'number') || + (typeof pythonicConfig === 'boolean')) { + return pythonicConfig; + } + else if (pythonicConfig instanceof Array) { + var tsArray = []; + var arrayLength = pythonicConfig.length; + for (var i = 0; i < arrayLength; ++i) { + var item = pythonicConfig[i]; + if (isArrayItemInputOrOutputName(key, i, item)) { + tsArray.push(item); + } + else { + tsArray.push(convertPythonicToTs(item, key)); + } + } + return tsArray; + } + else { + var tsDict = {}; + for (var _i = 0, _a = Object.keys(pythonicConfig); _i < _a.length; _i++) { + var pythonicKey = _a[_i]; + var pythonicValue = pythonicConfig[pythonicKey]; + if (pythonicKey === 'name' && typeof pythonicValue === 'string') { + tsDict[pythonicKey] = pythonicValue; + } + else { + var tsKey = toCamelCase(pythonicKey); + tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey); + } + } + return tsDict; + } + } + function convertTsToPythonic(tsConfig, key) { + if (tsConfig === null || tsConfig === undefined) { + return null; + } + else if (typeof tsConfig === 'string') { + return toSnakeCase(tsConfig); + } + else if ((typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) { + return tsConfig; + } + else if (tsConfig instanceof Array) { + var pyArray = []; + var arrayLength = tsConfig.length; + for (var i = 0; i < arrayLength; ++i) { + var item = tsConfig[i]; + if (isArrayItemInputOrOutputName(key, i, item)) { + pyArray.push(item); + } + else { + pyArray.push(convertTsToPythonic(item, key)); + } + } + return pyArray; + } + else { + var pyDict = {}; + for (var _i = 0, _a = Object.keys(tsConfig); _i < _a.length; _i++) { + var tsKey = _a[_i]; + var tsValue = tsConfig[tsKey]; + var pyKey = toSnakeCase(tsKey); + if ((tsKey === 'name' || tsKey === 'className') && + typeof tsValue === 'string') { + pyDict[pyKey] = tsValue; + } + else { + pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey); + } + } + return pyDict; + } + } + + var version = '0.7.2'; + + function preprocessWeightsForLoading(layer, weights, originalKerasVersion, originalBackend) { + if (!originalKerasVersion.startsWith('2.')) { + throw new ValueError('Unsupported Keras version in weights being loaded: ' + + originalKerasVersion); + } + return weights; + } + function loadTensor(dtype, shape, value) { + var dataType = stringToDType(dtype); + return tfc.Tensor.make(shape, { values: shape.length === 0 ? value : tfc.util.flatten(value) }, dataType); + } + function loadWeightsFromJson(weightsJSON, layers, skipMismatch) { + if (skipMismatch === void 0) { skipMismatch = false; } + var originalKerasVersion = weightsJSON['keras_version']; + var originalBackend = weightsJSON['backend']; + var layerNames = layers.map(function (layer) { return layer.name; }); + var index = {}; + for (var _i = 0, layers_1 = layers; _i < layers_1.length; _i++) { + var layer = layers_1[_i]; + if (layer.name != null) { + if (index[layer.name] == null) { + index[layer.name] = []; + } + index[layer.name].push(layer); + } + } + var nameToWeights = weightsJSON['weights']; + var weightValueTuples = []; + for (var k = 0; k < layerNames.length; ++k) { + var name_1 = layerNames[k]; + var layerWeights = nameToWeights[name_1]; + if (layerWeights == null) { + layerWeights = []; + } + var weightValues = []; + for (var n = 0; n < layerWeights.length; ++n) { + var weightEntry = layerWeights[n]; + weightValues.push(new LayerVariable(loadTensor(weightEntry['dtype'], weightEntry['shape'], weightEntry['value']))); + } + for (var _a = 0, _b = index[name_1]; _a < _b.length; _a++) { + var layer = _b[_a]; + var symbolicWeights = layer.weights; + weightValues = preprocessWeightsForLoading(layer, weightValues, originalKerasVersion, originalBackend); + if (weightValues.length !== symbolicWeights.length) { + if (skipMismatch) { + console.warn("Skipping loading of weights of layer " + layer.name + " " + + ("due to mismatch in number of weights: (" + weightValues.length + " ") + + ("vs " + symbolicWeights.length + ").")); + } + else { + throw new ValueError("Layer #" + k + " (named \"" + layer.name + "\") expects " + + (symbolicWeights.length + " weight(s), but the saved weights ") + + ("have " + weightValues.length + " element(s).")); + } + } + for (var i = 0; i < weightValues.length; ++i) { + if (skipMismatch) { + if (!tfc.util.arraysEqual(symbolicWeights[i].shape, weightValues[i].shape)) { + console.warn("Skipping loading of weights for layer " + layer.name + " due " + + ("to mismatch in shape (" + symbolicWeights[i].shape + " vs ") + + (weightValues[i].shape + ")")); + continue; + } + } + weightValueTuples.push([symbolicWeights[i], weightValues[i].read()]); + } + } + } + batchSetValue(weightValueTuples); + } + function loadWeightsFromNamedTensorMap(weights, layers) { + var nameToWeight = {}; + var totalWeightsCount = 0; + for (var _i = 0, layers_2 = layers; _i < layers_2.length; _i++) { + var layer = layers_2[_i]; + for (var _a = 0, _b = layer.weights; _a < _b.length; _a++) { + var weight = _b[_a]; + if (nameToWeight[weight.originalName] != null) { + throw new ValueError("Duplicate weight name: " + weight.originalName); + } + nameToWeight[weight.originalName] = weight; + totalWeightsCount++; + } + } + var weightValueTuples = []; + for (var name_2 in weights) { + weightValueTuples.push([nameToWeight[name_2], weights[name_2]]); + delete nameToWeight[name_2]; + } + var unsetNames = []; + for (var name_3 in nameToWeight) { + unsetNames.push(name_3); + } + if (unsetNames.length > 0) { + throw new ValueError(unsetNames.length + " of " + totalWeightsCount + " weights are not set: " + + ("" + unsetNames)); + } + batchSetValue(weightValueTuples); + } + var Container = (function (_super) { + __extends(Container, _super); + function Container(config) { + var _this = _super.call(this, {}) || this; + _this.containerNodes = new Set(); + _this.name = config.name; + if (_this.name == null) { + var prefix = _this.getClassName().toLowerCase(); + _this.name = getUid(prefix); + } + _this.supportsMasking = false; + _this.trainable = true; + _this.updatable = true; + if (Array.isArray(config.inputs)) { + _this.inputs = config.inputs.slice(); + } + else { + _this.inputs = [config.inputs]; + } + if (Array.isArray(config.outputs)) { + _this.outputs = config.outputs.slice(); + } + else { + _this.outputs = [config.outputs]; + } + if (unique(_this.inputs).length !== _this.inputs.length) { + throw new ValueError('The list of inputs passed to the model is ' + + 'redundant. All inputs should only appear once. Found: ' + + _this.inputs.map(function (x) { return x.name; })); + } + if (unique(_this.outputs).length !== _this.outputs.length) { + console.warn('The list of outputs passed to the model is redundant. ' + + 'All outputs should only appear once. Found: ' + + _this.outputs.map(function (x) { return x.name; })); + } + _this.inputLayers = []; + _this.inputLayersNodeIndices = []; + _this.inputLayersTensorIndices = []; + _this.outputLayers = []; + _this.outputLayersNodeIndices = []; + _this.outputLayersTensorIndices = []; + _this.layers = []; + for (var _i = 0, _a = _this.outputs; _i < _a.length; _i++) { + var x = _a[_i]; + var layer = x.sourceLayer; + var nodeIndex = x.nodeIndex; + var tensorIndex = x.tensorIndex; + _this.outputLayers.push(layer); + _this.outputLayersNodeIndices.push(nodeIndex); + _this.outputLayersTensorIndices.push(tensorIndex); + } + for (var _b = 0, _c = _this.inputs; _b < _c.length; _b++) { + var x = _c[_b]; + var layer = x.sourceLayer; + var nodeIndex = x.nodeIndex; + var tensorIndex = x.tensorIndex; + assert(nodeIndex === 0, 'input layer has >1 nodes'); + assert(tensorIndex === 0, 'input layer has >1 tensors'); + _this.inputLayers.push(layer); + _this.inputLayersNodeIndices.push(nodeIndex); + _this.inputLayersTensorIndices.push(tensorIndex); + } + _this.inputNames = []; + _this.outputNames = []; + _this.feedInputShapes = []; + _this.feedInputNames = []; + _this.feedOutputNames = []; + for (var i = 0; i < _this.inputLayers.length; i++) { + var layer = _this.inputLayers[i]; + if (!(layer instanceof InputLayer)) { + throw new TypeError('Input layers to a Model must be InputLayer objects. ' + + ("Received inputs: " + config.inputs + ". ") + + ("Input " + i + " (0-based) originates ") + + ("from layer type " + layer.getClassName() + ".")); + } + _this.inputNames.push(layer.name); + _this.feedInputShapes.push(layer.batchInputShape); + _this.feedInputNames.push(layer.name); + } + for (var _d = 0, _e = _this.outputLayers; _d < _e.length; _d++) { + var layer = _e[_d]; + _this.outputNames.push(layer.name); + } + _this.internalInputShapes = _this.inputs.map(function (x) { return x.shape; }); + _this.internalOutputShapes = _this.outputs.map(function (x) { return x.shape; }); + var nodesDepths = {}; + var nodeIDToNode = {}; + var layersDepths = {}; + var layerIDToLayer = {}; + var layerIndices = {}; + var nodesInDecreasingDepth = []; + var buildMapOfGraph = function (tensor, finishedNodes, nodesInProgress, layer, nodeIndex, tensorIndex) { + if (layer == null || nodeIndex == null || tensorIndex == null) { + layer = tensor.sourceLayer; + nodeIndex = tensor.nodeIndex; + tensorIndex = tensor.tensorIndex; + } + var node = layer.inboundNodes[nodeIndex]; + if (nodesInProgress.indexOf(node) !== -1) { + throw new RuntimeError("The tensor " + tensor.name + " at layer \"" + layer.name + "\" " + + 'is part of a cycle.'); + } + if (finishedNodes.indexOf(node) !== -1) { + return; + } + _this.containerNodes.add(Container.nodeKey(layer, nodeIndex)); + if (!(layer.id in layerIndices)) { + layerIndices[layer.id] = Object.keys(layerIndices).length; + } + if (nodesInProgress.indexOf(node) === -1) { + nodesInProgress.push(node); + } + var numInboundLayers = node.inboundLayers.length; + for (var i = 0; i < numInboundLayers; i++) { + var x = node.inputTensors[i]; + var layer_1 = node.inboundLayers[i]; + var nodeIndex_1 = node.nodeIndices[i]; + var tensorIndex_1 = node.tensorIndices[i]; + buildMapOfGraph(x, finishedNodes, nodesInProgress, layer_1, nodeIndex_1, tensorIndex_1); + } + finishedNodes.push(node); + while (nodesInProgress.indexOf(node) >= 0) { + nodesInProgress.splice(nodesInProgress.indexOf(node), 1); + } + nodesInDecreasingDepth.push(node); + }; + var finishedNodes = []; + var nodesInProgress = []; + for (var _f = 0, _g = _this.outputs; _f < _g.length; _f++) { + var x = _g[_f]; + buildMapOfGraph(x, finishedNodes, nodesInProgress); + } + var reversedNodesInDecreasingDepth = nodesInDecreasingDepth.slice().reverse(); + for (var _h = 0, reversedNodesInDecreasingDepth_1 = reversedNodesInDecreasingDepth; _h < reversedNodesInDecreasingDepth_1.length; _h++) { + var node = reversedNodesInDecreasingDepth_1[_h]; + nodeIDToNode[node.id] = node; + if (!(node.id in nodesDepths)) { + nodesDepths[node.id] = 0; + } + var depth = nodesDepths[node.id]; + var previousDepth = (layersDepths[node.outboundLayer.id] == null ? + 0 : + layersDepths[node.outboundLayer.id]); + depth = Math.max(depth, previousDepth); + layersDepths[node.outboundLayer.id] = depth; + layerIDToLayer[node.outboundLayer.id] = node.outboundLayer; + nodesDepths[node.id] = depth; + for (var i = 0; i < node.inboundLayers.length; i++) { + var inboundLayer = node.inboundLayers[i]; + var nodeIndex = node.nodeIndices[i]; + var inboundNode = inboundLayer.inboundNodes[nodeIndex]; + var previousDepth_1 = (nodesDepths[inboundNode.id] == null ? 0 : + nodesDepths[inboundNode.id]); + nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth_1); + nodeIDToNode[inboundNode.id] = inboundNode; + } + } + var nodesByDepth = {}; + for (var nodeID in nodesDepths) { + var depth = nodesDepths[nodeID]; + if (!(depth in nodesByDepth)) { + nodesByDepth[depth] = []; + } + nodesByDepth[depth].push(nodeIDToNode[nodeID]); + } + var layersByDepth = {}; + for (var layerID in layersDepths) { + var depth = layersDepths[layerID]; + if (!(depth in layersByDepth)) { + layersByDepth[depth] = []; + } + layersByDepth[depth].push(layerIDToLayer[layerID]); + } + var depthKeys = Object.keys(layersByDepth) + .map(function (x) { return parseInt(x, 10); }) + .sort(reverseNumberCompare); + _this.layers = []; + for (var _j = 0, depthKeys_1 = depthKeys; _j < depthKeys_1.length; _j++) { + var depth = depthKeys_1[_j]; + var layersForDepth = layersByDepth[depth]; + layersForDepth.sort(function (a, b) { + var aIndex = layerIndices[a.id]; + var bIndex = layerIndices[b.id]; + if (aIndex < bIndex) { + return -1; + } + if (aIndex > bIndex) { + return 1; + } + return 0; + }); + for (var _k = 0, layersForDepth_1 = layersForDepth; _k < layersForDepth_1.length; _k++) { + var layer = layersForDepth_1[_k]; + _this.layers.push(layer); + } + } + _this.layersByDepth = layersByDepth; + depthKeys = Object.keys(nodesByDepth) + .map(function (x) { return parseInt(x, 10); }) + .sort(reverseNumberCompare); + var computableTensors = _this.inputs.slice(); + var layersWithCompleteInput = []; + for (var _l = 0, depthKeys_2 = depthKeys; _l < depthKeys_2.length; _l++) { + var depth = depthKeys_2[_l]; + for (var _m = 0, _o = nodesByDepth[depth]; _m < _o.length; _m++) { + var node = _o[_m]; + var layer = node.outboundLayer; + if (layer != null) { + for (var _p = 0, _q = node.inputTensors; _p < _q.length; _p++) { + var x = _q[_p]; + if (computableTensors.indexOf(x) === -1) { + throw new RuntimeError("Graph disconnected: cannot obtain value for tensor " + x + + (" at layer \"" + layer.name + "\". ") + + 'The following previous layers were accessed without ' + + ("issue: " + layersWithCompleteInput)); + } + } + for (var _r = 0, _s = node.outputTensors; _r < _s.length; _r++) { + var x = _s[_r]; + computableTensors.push(x); + } + layersWithCompleteInput.push(layer.name); + } + } + } + _this.nodesByDepth = nodesByDepth; + var allNames = _this.layers.map(function (x) { return x.name; }); + var _loop_1 = function (name_4) { + var numOccurrences = allNames.filter(function (x) { return x === name_4; }).length; + if (numOccurrences !== 1) { + throw new RuntimeError("The name \"" + name_4 + "\" is used " + numOccurrences + " times " + + 'in the model. All layer names should be unique. Layer names: ' + + JSON.stringify(allNames)); + } + }; + for (var _t = 0, allNames_1 = allNames; _t < allNames_1.length; _t++) { + var name_4 = allNames_1[_t]; + _loop_1(name_4); + } + _this.outboundNodes = []; + _this.inboundNodes = []; + new Node({ + outboundLayer: _this, + inboundLayers: [], + nodeIndices: [], + tensorIndices: [], + inputTensors: _this.inputs, + outputTensors: _this.outputs, + inputMasks: _this.inputs.map(function (x) { return null; }), + outputMasks: _this.outputs.map(function (x) { return null; }), + inputShapes: _this.inputs.map(function (x) { return x.shape; }), + outputShapes: _this.outputs.map(function (x) { return x.shape; }) + }); + _this.built = true; + return _this; + } + Object.defineProperty(Container.prototype, "trainableWeights", { + get: function () { + if (this._trainableWeights.length > 0) { + throw new ValueError('Container instance unexpectedly contains _trainableWeights.' + + 'The trainable weights of a Container are a union of the ' + + 'trainable weights of its consituent Layers. Its own ' + + '_trainableWeights must remain an empty Array.'); + } + if (!this.trainable) { + return []; + } + var weights = []; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + weights = weights.concat(layer.trainableWeights); + } + return weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Container.prototype, "nonTrainableWeights", { + get: function () { + var weights = []; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + weights.push.apply(weights, layer.nonTrainableWeights); + } + if (!this.trainable) { + var trainableWeights = []; + for (var _b = 0, _c = this.layers; _b < _c.length; _b++) { + var layer = _c[_b]; + trainableWeights.push.apply(trainableWeights, layer.trainableWeights); + } + return trainableWeights.concat(weights); + } + return weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Container.prototype, "weights", { + get: function () { + return this.trainableWeights.concat(this.nonTrainableWeights); + }, + enumerable: true, + configurable: true + }); + Container.prototype.loadWeights = function (weightsJSON, skipMismatch, isNamedTensorMap) { + if (skipMismatch === void 0) { skipMismatch = false; } + if (isNamedTensorMap === void 0) { isNamedTensorMap = false; } + if (isNamedTensorMap) { + loadWeightsFromNamedTensorMap(weightsJSON, this.layers); + } + else { + loadWeightsFromJson(weightsJSON, this.layers, skipMismatch); + } + }; + Container.prototype.updatedConfig = function () { + var theConfig = this.getConfig(); + var modelConfig = { + className: this.getClassName(), + config: theConfig, + kerasVersion: "tfjs-layers " + version, + backend: 'TensorFlow.js' + }; + return modelConfig; + }; + Container.prototype.toJSON = function (unused, returnString) { + if (returnString === void 0) { returnString = true; } + var modelConfig = convertTsToPythonic(this.updatedConfig()); + return returnString ? JSON.stringify(modelConfig) : modelConfig; + }; + Container.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = toList(inputs); + var masks; + if ('mask' in kwargs) { + masks = toList(kwargs['mask']); + } + else { + masks = pyListRepeat(null, inputs.length); + } + return _this.runInternalGraph(inputs, masks)[0]; + }); + }; + Container.prototype.computeMask = function (inputs, mask) { + var _this = this; + return tfc.tidy(function () { + inputs = toList(inputs); + var masks; + if (mask == null) { + masks = pyListRepeat(null, inputs.length); + } + else { + masks = toList(mask); + } + return _this.runInternalGraph(inputs, masks)[1]; + }); + }; + Container.prototype.computeOutputShape = function (inputShape) { + var inputShapes = normalizeShapeList(inputShape); + if (inputShapes.length !== this.inputLayers.length) { + throw new ValueError("Invalid inputShape argument " + inputShape + ": " + + ("model has " + this.inputLayers.length + " tensor inputs.")); + } + var layersToOutputShapes = {}; + for (var i = 0; i < inputShapes.length; i++) { + var layer = this.inputLayers[i]; + var inputShape_1 = inputShapes[i]; + var shapeKey = layer.name + '_0_0'; + layersToOutputShapes[shapeKey] = inputShape_1; + } + var depthKeys = Object.keys(this.nodesByDepth) + .map(function (x) { return parseInt(x, 10); }) + .sort(reverseNumberCompare); + if (depthKeys.length > 1) { + for (var _i = 0, depthKeys_3 = depthKeys; _i < depthKeys_3.length; _i++) { + var depth = depthKeys_3[_i]; + var nodes = this.nodesByDepth[depth]; + for (var _a = 0, nodes_1 = nodes; _a < nodes_1.length; _a++) { + var node = nodes_1[_a]; + var layer = node.outboundLayer; + if (this.inputLayers.map(function (x) { return x.id; }).indexOf(layer.id) !== -1) { + continue; + } + var inputShapes_1 = []; + for (var j = 0; j < node.inboundLayers.length; j++) { + var inboundLayer = node.inboundLayers[j]; + var nodeIndex_2 = node.nodeIndices[j]; + var tensorIndex = node.tensorIndices[j]; + var shapeKey = inboundLayer.name + "_" + nodeIndex_2 + "_" + tensorIndex; + var inputShape_2 = layersToOutputShapes[shapeKey]; + inputShapes_1.push(inputShape_2); + } + var outputShape = layer.computeOutputShape(singletonOrArray(inputShapes_1)); + var outputShapes_1 = normalizeShapeList(outputShape); + var nodeIndex = layer.inboundNodes.indexOf(node); + for (var j = 0; j < outputShapes_1.length; j++) { + var shapeKey = layer.name + "_" + nodeIndex + "_" + j; + layersToOutputShapes[shapeKey] = outputShapes_1[j]; + } + } + } + } + var outputShapes = []; + var outputShapeKeys = []; + for (var i = 0; i < this.outputLayers.length; i++) { + var layer = this.outputLayers[i]; + var nodeIndex = this.outputLayersNodeIndices[i]; + var tensorIndex = this.outputLayersTensorIndices[i]; + var shapeKey = layer.name + "_" + nodeIndex + "_" + tensorIndex; + outputShapeKeys.push(shapeKey); + } + for (var i = 0; i < outputShapeKeys.length; i++) { + var key = outputShapeKeys[i]; + assert(key in layersToOutputShapes); + outputShapes.push(layersToOutputShapes[key]); + } + return singletonOrArray(outputShapes); + }; + Container.prototype.runInternalGraph = function (inputs, masks) { + if (masks == null) { + masks = pyListRepeat(null, inputs.length); + } + var tensorMap = {}; + for (var i = 0; i < this.inputs.length; ++i) { + var x = this.inputs[i]; + var y = inputs[i]; + var mask = masks[i]; + tensorMap[x.id] = [y, mask]; + } + var depthKeys = Object.keys(this.nodesByDepth) + .map(function (x) { return parseInt(x, 10); }) + .sort(reverseNumberCompare); + for (var _i = 0, depthKeys_4 = depthKeys; _i < depthKeys_4.length; _i++) { + var depth = depthKeys_4[_i]; + var nodes = this.nodesByDepth[depth]; + for (var _a = 0, nodes_2 = nodes; _a < nodes_2.length; _a++) { + var node = nodes_2[_a]; + var layer = node.outboundLayer; + var referenceInputTensors = node.inputTensors; + var referenceOutputTensors = node.outputTensors; + var computedData = new Array(); + for (var _b = 0, referenceInputTensors_1 = referenceInputTensors; _b < referenceInputTensors_1.length; _b++) { + var x = referenceInputTensors_1[_b]; + if (x.id in tensorMap) { + computedData.push(tensorMap[x.id]); + } + } + if (computedData.length === referenceInputTensors.length) { + var kwargs = {}; + var computedTensors = void 0; + var computedMasks = void 0; + var outputTensors_1 = void 0; + var outputMasks_1 = void 0; + if (node.callArgs != null) { + kwargs = node.callArgs; + } + if (computedData.length === 1) { + var _c = computedData[0], computedTensor = _c[0], computedMask = _c[1]; + if (kwargs.mask == null) { + kwargs['mask'] = computedMask; + } + outputTensors_1 = + toList(layer.call(computedTensor, kwargs)); + outputMasks_1 = toList(layer.computeMask(computedTensor, computedMask)); + computedTensors = [computedTensor]; + computedMasks = [computedMask]; + } + else { + computedTensors = computedData.map(function (x) { return x[0]; }); + computedMasks = computedData.map(function (x) { return x[1]; }); + if (kwargs.mask == null) { + kwargs['mask'] = computedMasks; + } + outputTensors_1 = + toList(layer.call(computedTensors, kwargs)); + outputMasks_1 = toList(layer.computeMask(computedTensors, computedMasks)); + } + if (layer.activityRegularizer) { + throw new NotImplementedError('Model invocation with concrete Tensor value(s) in the ' + + 'presence of activity regularizer(s) is not supported yet.'); + } + for (var i = 0; i < referenceOutputTensors.length; ++i) { + var x = referenceOutputTensors[i]; + var y = outputTensors_1[i]; + var mask = outputMasks_1[i]; + tensorMap[x.id] = [y, mask]; + } + } + } + } + var outputTensors = []; + var outputMasks = []; + var outputShapes = []; + for (var _d = 0, _e = this.outputs; _d < _e.length; _d++) { + var x = _e[_d]; + assert(x.id in tensorMap, "Could not compute output " + x.name + " : " + x.id); + var _f = tensorMap[x.id], tensor = _f[0], mask = _f[1]; + outputShapes.push(tensor.shape); + outputTensors.push(tensor); + outputMasks.push(mask); + } + return [outputTensors, outputMasks, outputShapes]; + }; + Container.prototype.buildNodeConversionMap = function (layers) { + var nodeConversionMap = {}; + var keptNodes; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + keptNodes = layer instanceof Container ? 1 : 0; + for (var originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { + var nodeKey = Container.nodeKey(layer, originalNodeIndex); + if (nodeKey in this.containerNodes) { + nodeConversionMap[nodeKey] = keptNodes; + keptNodes += 1; + } + } + } + return nodeConversionMap; + }; + Container.prototype.getLayer = function (name, index) { + if (index != null) { + if (this.layers.length <= index) { + throw new ValueError("Was asked to retrieve layer at index " + index + ", but model only " + + ("has " + this.layers.length + " layer(s).")); + } + else { + return this.layers[index]; + } + } + else { + if (name == null) { + throw new ValueError('Provide either a layer name or layer index'); + } + } + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + if (layer.name === name) { + return layer; + } + } + throw new ValueError("No such layer: " + name); + }; + Container.prototype.calculateLosses = function () { + var _this = this; + return tfc.tidy(function () { + var losses = []; + for (var _i = 0, _a = _this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + for (var nodeIndex = 0; nodeIndex < layer.inboundNodes.length; ++nodeIndex) { + var nodeKey = Container.nodeKey(layer, nodeIndex); + if (_this.containerNodes.has(nodeKey)) { + losses.push.apply(losses, layer.calculateLosses()); + } + } + } + return losses; + }); + }; + Container.prototype.getConfig = function () { + var config = { name: this.name }; + var nodeConversionMap = this.buildNodeConversionMap(this.layers); + var layerConfigs = []; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + var layerClassName = layer.getClassName(); + var layerConfig = layer.getConfig(); + var filteredInboundNodes = []; + for (var originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) { + var node = layer.inboundNodes[originalNodeIndex]; + var nodeKey = Container.nodeKey(layer, originalNodeIndex); + var kwargs = {}; + if (this.containerNodes.has(nodeKey)) { + if (node.callArgs) { + try { + JSON.stringify(node.callArgs); + kwargs = node.callArgs; + } + catch (err) { + console.warn("Layer " + layer.name + " was passed " + + "non-serializable keyword arguments: " + + (node.callArgs + ". They will not be included ") + + "in the serialized model (and thus will be " + + "missing at deserialization time)."); + kwargs = {}; + } + } + if (node.inboundLayers.length > 0) { + var nodeData = []; + for (var i = 0; i < node.inboundLayers.length; i++) { + var inboundLayer = node.inboundLayers[i]; + var nodeIndex = node.nodeIndices[i]; + var tensorIndex = node.tensorIndices[i]; + var nodeKey_1 = Container.nodeKey(inboundLayer, nodeIndex); + var newNodeIndex = nodeConversionMap[nodeKey_1]; + if (newNodeIndex === null || newNodeIndex === undefined) { + newNodeIndex = 0; + } + nodeData.push([inboundLayer.name, newNodeIndex, tensorIndex, kwargs]); + } + filteredInboundNodes.push(nodeData); + } + } + } + layerConfigs.push({ + name: layer.name, + className: layerClassName, + config: layerConfig, + inboundNodes: filteredInboundNodes + }); + } + config['layers'] = layerConfigs; + var modelInputs = []; + for (var i = 0; i < this.inputLayers.length; i++) { + var layer = this.inputLayers[i]; + var nodeIndex = this.inputLayersNodeIndices[i]; + var nodeKey = Container.nodeKey(layer, nodeIndex); + if (!this.containerNodes.has(nodeKey)) { + continue; + } + var newNodeIndex = nodeConversionMap[nodeKey]; + if (newNodeIndex === null || newNodeIndex === undefined) { + newNodeIndex = 0; + } + var tensorIndex = this.inputLayersTensorIndices[i]; + modelInputs.push([layer.name, newNodeIndex, tensorIndex]); + } + config['inputLayers'] = modelInputs; + var modelOutputs = []; + for (var i = 0; i < this.outputLayers.length; i++) { + var layer = this.outputLayers[i]; + var nodeIndex = this.outputLayersNodeIndices[i]; + var nodeKey = Container.nodeKey(layer, nodeIndex); + if (!this.containerNodes.has(nodeKey)) { + continue; + } + var newNodeIndex = nodeConversionMap[nodeKey]; + if (newNodeIndex === null || newNodeIndex === undefined) { + newNodeIndex = 0; + } + var tensorIndex = this.outputLayersTensorIndices[i]; + modelOutputs.push([layer.name, newNodeIndex, tensorIndex]); + } + config['outputLayers'] = modelOutputs; + return config; + }; + Container.fromConfig = function (cls, config) { + var createdLayers = {}; + var unprocessedNodes = {}; + function addUnprocessedNode(layer, nodeData) { + if (!(layer.name in unprocessedNodes)) { + unprocessedNodes[layer.name] = [nodeData]; + } + else { + unprocessedNodes[layer.name].push(nodeData); + } + } + function processNode(layer, nodeData) { + var inputTensors = []; + var kwargs; + for (var _i = 0, nodeData_1 = nodeData; _i < nodeData_1.length; _i++) { + var inputData = nodeData_1[_i]; + var inboundLayerName = inputData[0]; + var inboundNodeIndex = inputData[1]; + var inboundTensorIndex = inputData[2]; + if (inputData.length === 3) { + kwargs = {}; + } + else if (inputData.length === 4) { + kwargs = inputData[3]; + } + else { + throw new ValueError("Improperly formatted model config for layer " + JSON.stringify(layer) + ": " + JSON.stringify(inputData)); + } + if (!(inboundLayerName in createdLayers)) { + addUnprocessedNode(layer, nodeData); + return; + } + var inboundLayer = createdLayers[inboundLayerName]; + if (inboundLayer.inboundNodes.length <= inboundNodeIndex) { + addUnprocessedNode(layer, nodeData); + return; + } + var inboundNode = inboundLayer.inboundNodes[inboundNodeIndex]; + inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]); + } + if (inputTensors.length > 0) { + layer.apply(singletonOrArray(inputTensors), kwargs); + } + } + function processLayer(layerData) { + var layerName = layerData.name; + var layer = deserialize(layerData, config.customObjects != null ? + config.customObjects : + {}); + createdLayers[layerName] = layer; + var inboundNodesData = layerData.inboundNodes; + for (var _i = 0, inboundNodesData_1 = inboundNodesData; _i < inboundNodesData_1.length; _i++) { + var nodeData = inboundNodesData_1[_i]; + if (!(nodeData instanceof Array)) { + throw new ValueError("Corrupted configuration, expected array for nodeData: " + nodeData); + } + addUnprocessedNode(layer, nodeData); + } + } + var name = config.name; + var layersFromConfig = config.layers; + for (var _i = 0, layersFromConfig_1 = layersFromConfig; _i < layersFromConfig_1.length; _i++) { + var layerData = layersFromConfig_1[_i]; + processLayer(layerData); + } + while (!isObjectEmpty(unprocessedNodes)) { + for (var _a = 0, layersFromConfig_2 = layersFromConfig; _a < layersFromConfig_2.length; _a++) { + var layerData = layersFromConfig_2[_a]; + var layer = createdLayers[layerData.name]; + if (layer.name in unprocessedNodes) { + for (var _b = 0, _c = unprocessedNodes[layer.name]; _b < _c.length; _b++) { + var nodeData = _c[_b]; + processNode(layer, nodeData); + } + delete unprocessedNodes[layer.name]; + } + } + } + var inputTensors = []; + var outputTensors = []; + var inputLayersFromConfig = config.inputLayers; + for (var _d = 0, inputLayersFromConfig_1 = inputLayersFromConfig; _d < inputLayersFromConfig_1.length; _d++) { + var layerData = inputLayersFromConfig_1[_d]; + var layerName = layerData[0]; + var nodeIndex = layerData[1]; + var tensorIndex = layerData[2]; + assert(layerName in createdLayers); + var layer = createdLayers[layerName]; + var layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; + inputTensors.push(layerOutputTensors[tensorIndex]); + } + var outputLayersFromConfig = config.outputLayers; + for (var _e = 0, outputLayersFromConfig_1 = outputLayersFromConfig; _e < outputLayersFromConfig_1.length; _e++) { + var layerData = outputLayersFromConfig_1[_e]; + var layerName = layerData[0]; + var nodeIndex = layerData[1]; + var tensorIndex = layerData[2]; + assert(layerName in createdLayers); + var layer = createdLayers[layerName]; + var layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors; + outputTensors.push(layerOutputTensors[tensorIndex]); + } + return new cls({ inputs: inputTensors, outputs: outputTensors, name: name }); + }; + Object.defineProperty(Container.prototype, "stateful", { + get: function () { + if (this._stateful) { + throw new ValueError('Container instance unexpectedly has _stateful = true. The ' + + 'statefulness of a Container is determined by the Layers it ' + + 'contains. Its _stateful property must remain the default false.'); + } + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + if (layer.stateful) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + return Container; + }(Layer)); + + function assertFeedCompatibility(key, val) { + if (key.shape != null) { + if (key.shape.length !== val.shape.length) { + throw new ValueError("The rank of feed (" + val.shape.length + ") does not match the rank of " + + ("the key (" + key.shape.length + ").")); + } + for (var i = 0; i < key.shape.length; ++i) { + if (key.shape[i] != null && key.shape[i] !== val.shape[i]) { + throw new ValueError("The " + i + "-th dimension of the feed (" + val.shape[i] + ") is " + + ("incompatible with that of the key (" + key.shape[i] + ").")); + } + } + } + if (key.dtype == null || key.dtype === val.dtype) { + return val; + } + try { + return tfc.cast(val, key.dtype); + } + catch (err) { + throw new ValueError("The dtype of the feed (" + val.dtype + ") can not be cast to the dtype " + + ("of the key '" + key.name + "' (" + key.dtype + ").")); + } + } + var FeedDict = (function () { + function FeedDict(feeds) { + this.id2Value = {}; + if (feeds instanceof FeedDict) { + for (var id in feeds.id2Value) { + this.id2Value[id] = feeds.id2Value[id]; + } + } + else { + if (feeds == null) { + return; + } + for (var _i = 0, feeds_1 = feeds; _i < feeds_1.length; _i++) { + var feed = feeds_1[_i]; + this.add(feed.key, feed.value); + } + } + } + FeedDict.prototype.add = function (key, value) { + if (this.id2Value[key.id] == null) { + this.id2Value[key.id] = assertFeedCompatibility(key, value); + } + else { + throw new ValueError("Duplicate key: name=" + key.name + ", id=" + key.id); + } + return this; + }; + FeedDict.prototype.addFeed = function (feed) { + this.add(feed.key, feed.value); + }; + FeedDict.prototype.hasKey = function (key) { + return this.id2Value[key.id] != null; + }; + FeedDict.prototype.getValue = function (key) { + if (this.id2Value[key.id] == null) { + throw new ValueError("Nonexistent key: " + JSON.stringify(key)); + } + else { + return this.id2Value[key.id]; + } + }; + return FeedDict; + }()); + function execute(fetches, feedDict, kwargs) { + var arrayFetches = Array.isArray(fetches); + var fetchArray = arrayFetches ? fetches : [fetches]; + var outputs = []; + var internalFeedDict = new FeedDict(feedDict); + for (var _i = 0, fetchArray_1 = fetchArray; _i < fetchArray_1.length; _i++) { + var fetch_1 = fetchArray_1[_i]; + outputs.push(executeInternal(fetch_1, internalFeedDict, kwargs)); + } + return arrayFetches ? outputs : outputs[0]; + } + function executeInternal(fetch, internalFeedDict, kwargs) { + if (internalFeedDict.hasKey(fetch)) { + return internalFeedDict.getValue(fetch); + } + if (fetch.sourceLayer instanceof InputLayer) { + throw new ValueError("Missing a feed value for SymbolicTensor from InputLayer " + + ("'" + InputLayer.name + "'")); + } + var inputs = fetch.inputs; + var inputValues = []; + for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) { + var input = inputs_1[_i]; + var inputVal = executeInternal(input, internalFeedDict, kwargs); + inputValues.push(inputVal); + } + var output = fetch.sourceLayer.apply(inputValues, kwargs); + if (!Array.isArray(output)) { + output = [output]; + } + var layerOutputs = getNodeOutputs(fetch); + var outputSymbolicTensors = Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs]; + for (var i = 0; i < outputSymbolicTensors.length; ++i) { + internalFeedDict.add(outputSymbolicTensors[i], output[i]); + } + return output.length === 1 ? output[0] : output[fetch.outputTensorIndex]; + } + function getNodeOutputs(fetch) { + var layerOutputs; + if (fetch.sourceLayer.inboundNodes.length === 1) { + layerOutputs = fetch.sourceLayer.output; + } + else { + var nodeIndex = null; + for (var i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) { + for (var _i = 0, _a = fetch.sourceLayer.inboundNodes[i] + .outputTensors; _i < _a.length; _i++) { + var outputTensor = _a[_i]; + if (outputTensor.id === fetch.id) { + nodeIndex = i; + break; + } + } + } + layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex); + } + return layerOutputs; + } + + function isDataTensor(x) { + return x instanceof tfc.Tensor; + } + function isDataArray(x) { + return Array.isArray(x); + } + function isDataDict(x) { + return !isDataTensor(x) && !isDataArray(x); + } + function standardizeInputData(data, names, shapes, checkBatchAxis, exceptionPrefix) { + if (checkBatchAxis === void 0) { checkBatchAxis = true; } + if (exceptionPrefix === void 0) { exceptionPrefix = ''; } + if (names == null || names.length === 0) { + if (data != null) { + var gotUnexpectedData = false; + if (isDataArray(data) && data.length > 0) { + gotUnexpectedData = true; + } + else if (isDataDict(data)) { + for (var key in data) { + if (data.hasOwnProperty(key)) { + gotUnexpectedData = true; + break; + } + } + } + else { + gotUnexpectedData = true; + } + if (gotUnexpectedData) { + throw new ValueError("Error when checking model " + exceptionPrefix + " expected no data, " + + ("but got " + data)); + } + } + return []; + } + if (data == null) { + return names.map(function (name) { return null; }); + } + var arrays; + if (isDataDict(data)) { + data = data; + arrays = []; + for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { + var name_1 = names_1[_i]; + if (data[name_1] == null) { + throw new ValueError("No data provided for \"" + name_1 + "\". Need data for each key in: " + + ("" + names)); + } + arrays.push(data[name_1]); + } + } + else if (isDataArray(data)) { + data = data; + if (data.length !== names.length) { + throw new ValueError("Error when checking model " + exceptionPrefix + ": the Array of " + + "Tensors that you are passing to your model is not the size the " + + ("model expected. Expected to see " + names.length + " Tensor(s), but ") + + ("instead got the following list of Tensor(s): " + data)); + } + arrays = data; + } + else { + data = data; + if (names.length > 1) { + throw new ValueError("The model " + exceptionPrefix + " expects " + names.length + " Tensor(s), " + + ("but only received one Tensor. Found: Tensor with shape " + data.shape)); + } + arrays = [data]; + } + for (var i = 0; i < names.length; ++i) { + var array = arrays[i]; + if (array.shape.length === 1) { + arrays[i] = expandDims(array, 1); + } + } + if (shapes != null) { + for (var i = 0; i < names.length; ++i) { + if (shapes[i] == null) { + continue; + } + var array = arrays[i]; + if (array.shape.length !== shapes[i].length) { + throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + + ("to have " + shapes[i].length + " dimension(s). but got array with ") + + ("shape " + array.shape)); + } + for (var j = 0; j < shapes[i].length; ++j) { + if (j === 0 && !checkBatchAxis) { + continue; + } + var dim = array.shape[j]; + var refDim = shapes[i][j]; + if (refDim != null && refDim >= 0 && dim !== refDim) { + throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + + ("to have shape [" + shapes[i] + "], but got array with shape ") + + ("[" + array.shape + "].")); + } + } + } + } + return arrays; + } + function checkArrayLengths(inputs, targets, weights) { + var setX = unique(inputs.map(function (input) { return input.shape[0]; })); + setX.sort(); + var setY = unique(targets.map(function (target) { return target.shape[0]; })); + setY.sort(); + if (setX.length > 1) { + throw new ValueError("All input Tensors (x) should have the same number of samples. " + + "Got array shapes: " + + ("" + JSON.stringify(inputs.map(function (input) { return input.shape; })))); + } + if (setY.length > 1) { + throw new ValueError("All target Tensors (y) should have the same number of samples. " + + "Got array shapes: " + + ("" + JSON.stringify(targets.map(function (target) { return target.shape; })))); + } + if (setX.length > 0 && setY.length > 0 && !tfc.util.arraysEqual(setX, setY)) { + throw new ValueError("Input Tensors should have the same number of samples as target " + + ("Tensors. Found " + setX[0] + " input sample(s) and " + setY[0] + " target ") + + "sample(s)."); + } + } + function checkLossAndTargetCompatibility(targets, lossFns, outputShapes) { + var keyLosses = [ + meanSquaredError, binaryCrossentropy, + categoricalCrossentropy + ]; + for (var i = 0; i < targets.length; ++i) { + var y = targets[i]; + var loss = lossFns[i]; + var shape = outputShapes[i]; + if (loss == null) { + continue; + } + if (loss === categoricalCrossentropy) { + if (y.shape[y.shape.length - 1] === 1) { + throw new ValueError("You are passing a target array of shape " + y.shape + " while using " + + "a loss 'categorical_crossentropy'. 'categorical_crossentropy'" + + "expects targets to be binary matrices (1s and 0s) of shape " + + "[samples, classes]."); + } + } + if (keyLosses.indexOf(loss) !== -1) { + var slicedYShape = y.shape.slice(1); + var slicedShape = shape.slice(1); + for (var j = 0; j < slicedYShape.length; ++j) { + var targetDim = slicedYShape[j]; + var outDim = slicedShape[j]; + if (outDim != null && targetDim !== outDim) { + throw new ValueError("A target Tensor with shape " + y.shape + " was passed for an " + + ("output of shape " + shape + ", while using a loss function that ") + + "expects targets to have the same shape as the output."); + } + } + } + } + } + function makeBatches(size, batchSize) { + var output = []; + var batchStart = 0; + var batchEnd = null; + while (batchStart < size) { + batchEnd = batchStart + batchSize; + if (batchEnd >= size) { + batchEnd = size; + } + output.push([batchStart, batchEnd]); + batchStart = batchEnd; + } + return output; + } + function sliceArrays(arrays, start, stop) { + if (arrays == null) { + return [null]; + } + else if (Array.isArray(arrays)) { + return arrays.map(function (array) { return sliceAlongFirstAxis(array, start, stop - start); }); + } + else { + return sliceAlongFirstAxis(arrays, start, stop - start); + } + } + function sliceArraysByIndices(arrays, indices) { + return tfc.tidy(function () { + if (arrays == null) { + return null; + } + else if (Array.isArray(arrays)) { + return arrays.map(function (array) { return sliceArraysByIndices(array, indices); }); + } + else { + return gather(arrays, indices.dtype === 'int32' ? indices : indices.toInt()); + } + }); + } + function checkInputData(data, names, shapes, checkBatchAxis, exceptionPrefix) { + if (checkBatchAxis === void 0) { checkBatchAxis = true; } + if (exceptionPrefix === void 0) { exceptionPrefix = ''; } + var arrays; + if (Array.isArray(data)) { + if (data.length !== names.length) { + throw new ValueError("Error when checking model " + exceptionPrefix + ": the Array of " + + "Tensors that you are passing to your model is not the size the " + + ("the model expected. Expected to see " + names.length + " Tensor(s),") + + (" but instead got " + data.length + " Tensors(s).")); + } + arrays = data; + } + else { + if (names.length > 1) { + throw new ValueError("The model expects " + names.length + " " + exceptionPrefix + " Tensors, " + + "but only received one Tensor. Found: array with shape " + + (JSON.stringify(data.shape) + ".")); + } + arrays = [data]; + } + if (shapes != null) { + for (var i = 0; i < names.length; ++i) { + if (shapes[i] == null) { + continue; + } + var array = arrays[i]; + if (array.shape.length !== shapes[i].length) { + throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + names[i] + " " + + ("to have " + shapes[i].length + " dimension(s), but got array with ") + + ("shape " + JSON.stringify(array.shape))); + } + for (var j = 0; j < shapes[i].length; ++j) { + if (j === 0 && !checkBatchAxis) { + continue; + } + var dim = array.shape[j]; + var refDim = shapes[i][j]; + if (refDim != null) { + if (refDim !== dim) { + throw new ValueError("Error when checking " + exceptionPrefix + ": expected " + + (names[i] + " to have shape " + JSON.stringify(shapes[i]) + " but ") + + ("got array with shape " + JSON.stringify(array.shape) + ".")); + } + } + } + } + } + } + function collectMetrics(metrics, outputNames) { + if (metrics == null || Array.isArray(metrics) && metrics.length === 0) { + return outputNames.map(function (name) { return []; }); + } + if (Array.isArray(metrics)) { + return outputNames.map(function (name) { return metrics; }); + } + else if (metrics != null) { + var nestedMetrics = []; + for (var _i = 0, outputNames_1 = outputNames; _i < outputNames_1.length; _i++) { + var name_2 = outputNames_1[_i]; + var outputMetrics = metrics.hasOwnProperty(name_2) ? metrics[name_2] : []; + if (!Array.isArray(outputMetrics)) { + outputMetrics = [outputMetrics]; + } + nestedMetrics.push(outputMetrics); + } + return nestedMetrics; + } + else { + throw new TypeError('Type of metrics argument not understood. Expected an Array or ' + + 'Object, found: ' + metrics); + } + } + var ModelLoggingVerbosity; + (function (ModelLoggingVerbosity) { + ModelLoggingVerbosity[ModelLoggingVerbosity["SILENT"] = 0] = "SILENT"; + ModelLoggingVerbosity[ModelLoggingVerbosity["VERBOSE"] = 1] = "VERBOSE"; + })(ModelLoggingVerbosity || (ModelLoggingVerbosity = {})); + var Model = (function (_super) { + __extends(Model, _super); + function Model(config) { + return _super.call(this, config) || this; + } + Model.prototype.summary = function (lineLength, positions, printFn) { + if (printFn === void 0) { printFn = console.log; } + if (!this.built) { + throw new ValueError("This model has never been called, thus its weights have not been " + + "created yet. So no summary can be displayed. Build the model " + + "first (e.g., by calling it on some test data)."); + } + printSummary(this, lineLength, positions, printFn); + }; + Model.prototype.compile = function (config) { + var _this = this; + if (config.loss == null) { + config.loss = []; + } + this.loss = config.loss; + if (typeof config.optimizer === 'string') { + this.optimizer = getOptimizer(config.optimizer); + } + else { + if (!(config.optimizer instanceof tfc.Optimizer)) { + throw new ValueError("User-defined optimizer must be an instance of tf.Optimizer."); + } + this.optimizer = config.optimizer; + } + var lossFunctions = []; + if (!Array.isArray(config.loss) && typeof config.loss !== 'string' && + typeof config.loss !== 'function') { + config.loss = config.loss; + for (var name_3 in config.loss) { + if (this.outputNames.indexOf(name_3) === -1) { + throw new ValueError("Unknown entry in loss dictionary: \"" + name_3 + "\". Only expect the " + + ("following keys: " + this.outputNames)); + } + } + for (var name_4 in this.outputNames) { + if (config.loss[name_4] == null) { + console.warn("Output \"" + name_4 + "\" is missing from loss dictionary. We assume " + + "this was done on purpose, and we will not be expecting data " + + ("to be passed to " + name_4 + " during training")); + } + lossFunctions.push(get(config.loss[name_4])); + } + } + else if (Array.isArray(config.loss)) { + if (config.loss.length !== this.outputs.length) { + throw new ValueError("When passing an Array as loss, it should have one entry per " + + ("model output. The model has " + this.outputs.length + " output(s), ") + + ("but you passed loss=" + config.loss + ".")); + } + var theLosses = config.loss; + lossFunctions = theLosses.map(function (l) { return get(l); }); + } + else { + var lossFunction_1 = get(config.loss); + this.outputs.map(function (layer) { + lossFunctions.push(lossFunction_1); + }); + } + this.lossFunctions = lossFunctions; + this.feedOutputNames = []; + this.feedOutputShapes = []; + this.feedLossFns = []; + for (var i = 0; i < this.outputs.length; ++i) { + var shape = this.internalOutputShapes[i]; + var name_5 = this.outputNames[i]; + this.feedOutputNames.push(name_5); + this.feedOutputShapes.push(shape); + this.feedLossFns.push(this.lossFunctions[i]); + } + var skipTargetIndices = []; + this.metrics = config.metrics; + this.metricsNames = ['loss']; + this.metricsTensors = []; + nameScope('loss', function () { + for (var i = 0; i < _this.outputs.length; ++i) { + if (skipTargetIndices.indexOf(i) !== -1) { + continue; + } + var weightedLoss = _this.lossFunctions[i]; + if (_this.outputs.length > 1) { + _this.metricsTensors.push([weightedLoss, i]); + _this.metricsNames.push(_this.outputNames[i] + '_loss'); + } + } + }); + var nestedMetrics = collectMetrics(config.metrics, this.outputNames); + var appendMetric = function (outputIndex, metricName, metricTensor) { + if (_this.outputNames.length > 1) { + metricName = _this.outputNames[outputIndex] + '_' + metricName; + } + _this.metricsNames.push(metricName); + _this.metricsTensors.push([metricTensor, outputIndex]); + }; + nameScope('metric', function () { + var _loop_1 = function (i) { + if (skipTargetIndices.indexOf(i) !== -1) { + return "continue"; + } + var outputMetrics = nestedMetrics[i]; + var handleMetrics = function (metrics) { + var metricNamePrefix = ''; + var metricName; + var accFn; + var weightedMetricFn; + var _loop_2 = function (metric) { + if (['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !== + -1) { + var outputShape = _this.internalOutputShapes[i]; + if (outputShape[outputShape.length - 1] === 1 || + _this.lossFunctions[i] === binaryCrossentropy) { + if (['accuracy', 'acc'].indexOf(metric) !== -1) { + accFn = binaryAccuracy; + } + else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { + accFn = binaryCrossentropy$1; + } + } + else if (_this.lossFunctions[i] === + sparseCategoricalCrossentropy) { + if (['accuracy', 'acc'].indexOf(metric) !== -1) { + accFn = sparseCategoricalAccuracy; + } + else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { + accFn = sparseCategoricalCrossentropy$1; + } + } + else { + if (['accuracy', 'acc'].indexOf(metric) !== -1) { + accFn = categoricalAccuracy; + } + else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { + accFn = categoricalCrossentropy$1; + } + } + var suffix = void 0; + if (['accuracy', 'acc'].indexOf(metric) !== -1) { + suffix = 'acc'; + } + else if (['crossentropy', 'ce'].indexOf(metric) !== -1) { + suffix = 'ce'; + } + weightedMetricFn = accFn; + metricName = metricNamePrefix + suffix; + } + else { + var metricFn = get$1(metric); + weightedMetricFn = metricFn; + metricName = metricNamePrefix + metric; + } + var metricResult; + nameScope(metricName, function () { + metricResult = weightedMetricFn; + }); + appendMetric(i, metricName, metricResult); + }; + for (var _i = 0, metrics_1 = metrics; _i < metrics_1.length; _i++) { + var metric = metrics_1[_i]; + _loop_2(metric); + } + }; + handleMetrics(outputMetrics); + }; + for (var i = 0; i < _this.outputs.length; ++i) { + _loop_1(i); + } + }); + this.collectedTrainableWeights = this.trainableWeights; + }; + Model.prototype.checkTrainableWeightsConsistency = function () { + if (this.collectedTrainableWeights == null) { + return; + } + if (this.trainableWeights.length !== + this.collectedTrainableWeights.length) { + console.warn('Discrepancy between trainableweights and collected trainable ' + + 'weights. Did you set `model.trainable` without calling ' + + '`model.compile()` afterwards?'); + } + }; + Model.prototype.evaluate = function (x, y, config) { + if (config === void 0) { config = {}; } + var batchSize = config.batchSize == null ? 32 : config.batchSize; + var standardizedOuts = this.standardizeUserData(x, y, true, batchSize); + var ins = standardizedOuts[0].concat(standardizedOuts[1]); + this.makeTestFunction(); + var f = this.testFunction; + var testOuts = this.testLoop(f, ins, batchSize, config.verbose, config.steps); + return singletonOrArray(testOuts); + }; + Model.prototype.checkNumSamples = function (ins, batchSize, steps, stepsName) { + if (stepsName === void 0) { stepsName = 'steps'; } + var numSamples; + if (steps != null) { + numSamples = null; + if (batchSize != null) { + throw new ValueError("If " + stepsName + " is set, batchSize must be null or undefined." + + ("Got batchSize = " + batchSize)); + } + } + else if (ins != null) { + if (Array.isArray(ins)) { + numSamples = ins[0].shape[0]; + } + else { + numSamples = ins.shape[0]; + } + } + else { + throw new ValueError("Either the input data should have a defined shape, or " + + (stepsName + " shoud be specified.")); + } + return numSamples; + }; + Model.prototype.execute = function (inputs, outputs) { + if (Array.isArray(outputs) && outputs.length === 0) { + throw new ValueError('`outputs` is an empty Array, which is not allowed.'); + } + var outputsIsArray = Array.isArray(outputs); + var outputNames = (outputsIsArray ? outputs : + [outputs]); + var outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames); + var feedDict = new FeedDict(); + if (inputs instanceof tfc.Tensor) { + inputs = [inputs]; + } + if (Array.isArray(inputs)) { + if (inputs.length !== this.inputs.length) { + throw new ValueError("The number of inputs provided (" + inputs.length + ") " + + "does not match the number of inputs of this model " + + ("(" + this.inputs.length + ").")); + } + for (var i = 0; i < this.inputs.length; ++i) { + feedDict.add(this.inputs[i], inputs[i]); + } + } + else { + for (var _i = 0, _a = this.inputs; _i < _a.length; _i++) { + var input = _a[_i]; + var tensorValue = inputs[input.name]; + if (tensorValue == null) { + throw new ValueError("No value is provided for the model's input " + input.name); + } + feedDict.add(input, tensorValue); + } + } + var executeOutputs = execute(outputSymbolicTensors, feedDict); + return outputsIsArray ? executeOutputs : executeOutputs[0]; + }; + Model.prototype.retrieveSymbolicTensors = function (symbolicTensorNames) { + var outputSymbolicTensors = pyListRepeat(null, symbolicTensorNames.length); + var outputsRemaining = symbolicTensorNames.length; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + var layerOutputs = Array.isArray(layer.output) ? + layer.output : + [layer.output]; + var layerOutputNames = layerOutputs.map(function (output) { return output.name; }); + for (var i = 0; i < symbolicTensorNames.length; ++i) { + var index = layerOutputNames.indexOf(symbolicTensorNames[i]); + if (index !== -1) { + outputSymbolicTensors[i] = layerOutputs[index]; + outputsRemaining--; + } + if (outputsRemaining === 0) { + break; + } + } + if (outputsRemaining === 0) { + break; + } + } + if (outputsRemaining > 0) { + var remainingNames_1 = []; + outputSymbolicTensors.forEach(function (tensor, i) { + if (tensor == null) { + remainingNames_1.push(symbolicTensorNames[i]); + } + }); + throw new ValueError("Cannot find SymbolicTensors for output name(s): " + + ("" + JSON.stringify(remainingNames_1))); + } + return outputSymbolicTensors; + }; + Model.prototype.predictLoop = function (ins, batchSize, verbose) { + var _this = this; + if (batchSize === void 0) { batchSize = 32; } + if (verbose === void 0) { verbose = false; } + return tfc.tidy(function () { + var numSamples = _this.checkNumSamples(ins); + if (verbose) { + throw new NotImplementedError('Verbose predictLoop() is not implemented yet.'); + } + var batches = makeBatches(numSamples, batchSize); + var outs = []; + var _loop_3 = function (batchIndex) { + var batchOuts = tfc.tidy(function () { + var batchStart = batches[batchIndex][0]; + var batchEnd = batches[batchIndex][1]; + var insBatch = sliceArrays(ins, batchStart, batchEnd); + var feeds = []; + if (Array.isArray(insBatch)) { + for (var i = 0; i < insBatch.length; ++i) { + feeds.push({ key: _this.inputs[i], value: insBatch[i] }); + } + } + else { + feeds.push({ key: _this.inputs[0], value: insBatch }); + } + var feedDict = new FeedDict(feeds); + return execute(_this.outputs, feedDict); + }); + if (batchIndex === 0) { + for (var _i = 0, batchOuts_1 = batchOuts; _i < batchOuts_1.length; _i++) { + var batchOut = batchOuts_1[_i]; + outs.push(batchOut); + } + } + else { + for (var i = 0; i < batchOuts.length; ++i) { + outs[i] = concatAlongFirstAxis(outs[i], batchOuts[i]); + } + } + }; + for (var batchIndex = 0; batchIndex < batches.length; ++batchIndex) { + _loop_3(batchIndex); + } + return singletonOrArray(outs); + }); + }; + Model.prototype.predict = function (x, config) { + if (config === void 0) { config = {}; } + checkInputData(x, this.inputNames, this.feedInputShapes, false); + var batchSize = config.batchSize == null ? 32 : config.batchSize; + return this.predictLoop(x, batchSize); + }; + Model.prototype.predictOnBatch = function (x) { + checkInputData(x, this.inputNames, this.feedInputShapes, true); + return this.predictLoop(x, x.shape[0]); + }; + Model.prototype.standardizeUserData = function (x, y, checkBatchAxis, batchSize) { + if (checkBatchAxis === void 0) { checkBatchAxis = true; } + if (this.optimizer == null) { + throw new RuntimeError('You must compile a model before training/testing. Use ' + + 'Model.compile(modelCompileConfig).'); + } + var outputShapes = []; + for (var i = 0; i < this.feedOutputShapes.length; ++i) { + var outputShape = this.feedOutputShapes[i]; + var lossFn = this.feedLossFns[i]; + if (lossFn === sparseCategoricalCrossentropy) { + outputShapes.push(outputShape.slice(0, outputShape.length - 1).concat([1])); + } + else { + outputShapes.push(outputShape); + } + } + x = standardizeInputData(x, this.feedInputNames, this.feedInputShapes, false, 'input'); + y = standardizeInputData(y, this.feedOutputNames, outputShapes, false, 'target'); + checkArrayLengths(x, y, null); + checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes); + if (this.stateful && batchSize != null && batchSize > 0) { + if (x[0].shape[0] % batchSize !== 0) { + throw new ValueError("In a stateful network, you should only pass inputs with a " + + "number of samples that is divisible by the batch size " + + (batchSize + ". Found: " + x[0].shape[0] + " sample(s).")); + } + } + return [x, y, null]; + }; + Model.prototype.fitLoop = function (f, ins, outLabels, batchSize, epochs, verbose, callbacks, valF, valIns, shuffle, callbackMetrics, initialEpoch, stepsPerEpoch, validationSteps) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var doValidation, numTrainSamples, indexArray, callbackList, _loop_4, this_1, epoch, state_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (batchSize == null) { + batchSize = 32; + } + if (epochs == null) { + epochs = 1; + } + if (shuffle == null) { + shuffle = true; + } + if (initialEpoch == null) { + initialEpoch = 0; + } + doValidation = false; + if (valF != null && valIns != null) { + doValidation = true; + } + if (validationSteps != null) { + doValidation = true; + if (stepsPerEpoch == null) { + throw new ValueError('Can only use `validationSteps` when doing step-wise training, ' + + 'i.e., `stepsPerEpoch` must be set.'); + } + } + numTrainSamples = this.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch'); + if (numTrainSamples != null) { + indexArray = range(0, numTrainSamples); + } + this.history = new History(); + if (callbacks == null) { + callbacks = [new BaseLogger()]; + } + else { + callbacks = [new BaseLogger()].concat(callbacks); + } + callbacks = callbacks.concat([this.history]); + if (verbose > 0) { + throw new NotImplementedError('Verbose mode is not implemented yet.'); + } + callbackList = new CallbackList(callbacks); + callbackList.setModel(this); + callbackList.setParams({ + epochs: epochs, + initialEpoch: initialEpoch, + steps: stepsPerEpoch, + verbose: verbose, + doValidation: doValidation, + metrics: callbackMetrics, + }); + return [4, callbackList.onTrainBegin()]; + case 1: + _a.sent(); + this.stopTraining = false; + _loop_4 = function (epoch) { + var epochLogs, epochIndexArray1D_1, batches_1, _loop_5, batchIndex, state_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4, callbackList.onEpochBegin(epoch)]; + case 1: + _a.sent(); + epochLogs = {}; + if (!(stepsPerEpoch != null)) return [3, 2]; + throw new NotImplementedError('stepsPerEpoch mode is not implemented yet.'); + case 2: + if (shuffle === 'batch') { + throw new NotImplementedError('batch shuffling is not implemneted yet'); + } + else if (shuffle) { + tfc.util.shuffle(indexArray); + } + epochIndexArray1D_1 = tfc.tensor1d(indexArray); + batches_1 = makeBatches(numTrainSamples, batchSize); + _loop_5 = function (batchIndex) { + var batchLogs; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + batchLogs = {}; + return [4, callbackList.onBatchBegin(batchIndex, batchLogs)]; + case 1: + _a.sent(); + tfc.tidy(function () { + var batchStart = batches_1[batchIndex][0]; + var batchEnd = batches_1[batchIndex][1]; + var batchIds = sliceAlongFirstAxis(epochIndexArray1D_1, batchStart, batchEnd - batchStart); + batchLogs['batch'] = batchIndex; + batchLogs['size'] = batchEnd - batchStart; + var insBatch = sliceArraysByIndices(ins, batchIds); + var outs = f(insBatch); + for (var i = 0; i < outLabels.length; ++i) { + var label = outLabels[i]; + var out = outs[i]; + batchLogs[label] = out; + tfc.keep(out); + } + if (batchIndex === batches_1.length - 1) { + if (doValidation) { + var valOuts = _this.testLoop(valF, valIns, batchSize); + for (var i = 0; i < outLabels.length; ++i) { + var label = outLabels[i]; + var out = valOuts[i]; + tfc.keep(out); + epochLogs['val_' + label] = out; + } + } + } + }); + return [4, callbackList.onBatchEnd(batchIndex, batchLogs)]; + case 2: + _a.sent(); + disposeTensorsInLogs(batchLogs); + if (this_1.stopTraining) { + return [2, "break"]; + } + return [2]; + } + }); + }; + batchIndex = 0; + _a.label = 3; + case 3: + if (!(batchIndex < batches_1.length)) return [3, 6]; + return [5, _loop_5(batchIndex)]; + case 4: + state_2 = _a.sent(); + if (state_2 === "break") + return [3, 6]; + _a.label = 5; + case 5: + ++batchIndex; + return [3, 3]; + case 6: + epochIndexArray1D_1.dispose(); + _a.label = 7; + case 7: return [4, callbackList.onEpochEnd(epoch, epochLogs)]; + case 8: + _a.sent(); + if (this_1.stopTraining) { + return [2, "break"]; + } + return [2]; + } + }); + }; + this_1 = this; + epoch = initialEpoch; + _a.label = 2; + case 2: + if (!(epoch < epochs)) return [3, 5]; + return [5, _loop_4(epoch)]; + case 3: + state_1 = _a.sent(); + if (state_1 === "break") + return [3, 5]; + _a.label = 4; + case 4: + ++epoch; + return [3, 2]; + case 5: return [4, callbackList.onTrainEnd()]; + case 6: + _a.sent(); + return [4, this.history.syncData()]; + case 7: + _a.sent(); + return [2, this.history]; + } + }); + }); + }; + Model.prototype.testLoop = function (f, ins, batchSize, verbose, steps) { + var _this = this; + if (verbose === void 0) { verbose = 0; } + return tfc.tidy(function () { + var numSamples = _this.checkNumSamples(ins, batchSize, steps, 'steps'); + var outs = []; + if (verbose === 1) { + throw new NotImplementedError('Verbose mode is not implemented yet.'); + } + if (steps != null) { + throw new NotImplementedError('steps mode in testLoop() is not implemented yet'); + } + else { + var batches = makeBatches(numSamples, batchSize); + var indexArray = tfc.tensor1d(range(0, numSamples)); + for (var batchIndex = 0; batchIndex < batches.length; ++batchIndex) { + var batchStart = batches[batchIndex][0]; + var batchEnd = batches[batchIndex][1]; + var batchIds = sliceAlongFirstAxis(indexArray, batchStart, batchEnd - batchStart); + var insBatch = sliceArraysByIndices(ins, batchIds); + var batchOuts = f(insBatch); + if (batchIndex === 0) { + for (var i = 0; i < batchOuts.length; ++i) { + outs.push(getScalar(0)); + } + } + for (var i = 0; i < batchOuts.length; ++i) { + var batchOut = batchOuts[i]; + outs[i] = + tfc.add(outs[i], tfc.mul(getScalar(batchEnd - batchStart), batchOut)); + } + } + for (var i = 0; i < outs.length; ++i) { + outs[i] = tfc.div(outs[i], getScalar(numSamples)); + } + } + return outs; + }); + }; + Model.prototype.getDedupedMetricsNames = function () { + var outLabels = this.metricsNames; + var dedupedOutLabels = []; + for (var i = 0; i < outLabels.length; ++i) { + var label = outLabels[i]; + var newLabel = label; + if (count(outLabels, label) > 1) { + var dupIndex = count(outLabels.slice(0, i), label); + newLabel += "_" + dupIndex; + } + dedupedOutLabels.push(newLabel); + } + return dedupedOutLabels; + }; + Model.prototype.makeTestFunction = function () { + var _this = this; + this.testFunction = function (data) { + return tfc.tidy(function () { + var valOutputs = []; + var totalLoss; + var inputs = data.slice(0, _this.inputs.length); + var targets = data.slice(_this.inputs.length, _this.inputs.length + _this.outputs.length); + var feeds = []; + for (var i = 0; i < _this.inputs.length; ++i) { + feeds.push({ key: _this.inputs[i], value: inputs[i] }); + } + var feedDict = new FeedDict(feeds); + var outputs = execute(_this.outputs, feedDict); + for (var i = 0; i < _this.lossFunctions.length; ++i) { + var lossFunction = _this.lossFunctions[i]; + var loss = tfc.mean(lossFunction(targets[i], outputs[i])); + if (i === 0) { + totalLoss = loss; + } + else { + totalLoss = tfc.add(totalLoss, loss); + } + valOutputs.push(totalLoss); + } + for (var i = 0; i < _this.metricsTensors.length; ++i) { + var metric = _this.metricsTensors[i][0]; + var outputIndex = _this.metricsTensors[i][1]; + var meanMetric = tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); + valOutputs.push(meanMetric); + } + return valOutputs; + }); + }; + }; + Model.prototype.fit = function (x, y, config) { + if (config === void 0) { config = {}; } + return __awaiter(this, void 0, void 0, function () { + var _this = this; + var batchSize, standardizedOuts, inputs, targets, doValidation, valX, valY, valIns, needValidationDisposal, valStandardized, splitAt, originalBatchSize, ins, trainFunction, outLabels, valFunction, callbackMetrics, callbacks, out; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + batchSize = config.batchSize == null ? 32 : config.batchSize; + standardizedOuts = this.standardizeUserData(x, y, false, batchSize); + inputs = standardizedOuts[0]; + targets = standardizedOuts[1]; + doValidation = false; + needValidationDisposal = false; + if (config.validationData != null && config.validationData.length > 0) { + doValidation = true; + if (config.validationData.length === 2) { + valX = config.validationData[0]; + valY = config.validationData[1]; + } + else if (config.validationData.length === 3) { + throw new NotImplementedError('validationData including sample weights is not supported yet.'); + } + else { + throw new ValueError("When passing validation data, it must contain 2 (valX, valY) " + + "or 3 (valX, valY, valSampleWeight) items; " + + (config.validationData + " is invalid.")); + } + valStandardized = this.standardizeUserData(valX, valY, true, batchSize); + valX = valStandardized[0]; + valY = valStandardized[1]; + valIns = valX.concat(valY); + } + else if (config.validationSplit != null && config.validationSplit > 0 && + config.validationSplit < 1) { + doValidation = true; + splitAt = Math.floor(inputs[0].shape[0] * (1 - config.validationSplit)); + originalBatchSize = inputs[0].shape[0]; + valX = sliceArrays(inputs, splitAt, originalBatchSize); + inputs = sliceArrays(inputs, 0, splitAt); + valY = sliceArrays(targets, splitAt, originalBatchSize); + targets = sliceArrays(targets, 0, splitAt); + needValidationDisposal = true; + valIns = valX.concat(valY); + } + else if (config.validationSteps != null) { + doValidation = true; + } + ins = inputs.concat(targets); + this.checkTrainableWeightsConsistency(); + trainFunction = function (data) { + var inputs = data.slice(0, _this.inputs.length); + var targets = data.slice(_this.inputs.length, _this.inputs.length + _this.outputs.length); + var metricsValues = []; + var totalLossFunction = function () { + var feeds = []; + for (var i = 0; i < _this.inputs.length; ++i) { + feeds.push({ key: _this.inputs[i], value: inputs[i] }); + } + var feedDict = new FeedDict(feeds); + var outputs = execute(_this.outputs, feedDict, { 'training': true }); + var totalLoss; + for (var i = 0; i < _this.lossFunctions.length; ++i) { + var lossFunction = _this.lossFunctions[i]; + var loss = lossFunction(targets[i], outputs[i]); + var meanLoss = tfc.mean(loss); + if (i === 0) { + totalLoss = loss; + } + else { + totalLoss = tfc.add(totalLoss, loss); + } + } + for (var i = 0; i < _this.metricsTensors.length; ++i) { + var metric = _this.metricsTensors[i][0]; + var outputIndex = _this.metricsTensors[i][1]; + var meanMetric = tfc.mean(metric(targets[outputIndex], outputs[outputIndex])); + tfc.keep(meanMetric); + metricsValues.push(meanMetric); + } + totalLoss = tfc.mean(totalLoss); + _this.calculateLosses().forEach(function (regularizerLoss) { + totalLoss = tfc.add(totalLoss, regularizerLoss); + }); + return totalLoss; + }; + var variables = _this.collectedTrainableWeights.map(function (param) { return param.read(); }); + var returnCost = true; + var totalLossValue = _this.optimizer.minimize(totalLossFunction, returnCost, variables); + return [totalLossValue].concat(metricsValues); + }; + outLabels = this.getDedupedMetricsNames(); + if (doValidation) { + this.makeTestFunction(); + valFunction = this.testFunction; + callbackMetrics = + outLabels.slice().concat(outLabels.map(function (n) { return 'val_' + n; })); + } + else { + valFunction = null; + valIns = []; + callbackMetrics = outLabels.slice(); + } + callbacks = standardizeCallbacks(config.callbacks); + return [4, this.fitLoop(trainFunction, ins, outLabels, batchSize, config.epochs, config.verbose, callbacks, valFunction, valIns, config.shuffle, callbackMetrics, config.initialEpoch, null, null)]; + case 1: + out = _a.sent(); + if (needValidationDisposal) { + valIns.forEach(function (tensor) { return tensor.dispose(); }); + inputs.forEach(function (tensor) { return tensor.dispose(); }); + targets.forEach(function (tensor) { return tensor.dispose(); }); + } + return [2, out]; + } + }); + }); + }; + Model.prototype.getNamedWeights = function (config) { + var namedWeights = {}; + var trainableOnly = config != null && config.trainableOnly; + var weights = trainableOnly ? this.trainableWeights : this.weights; + var weightValues = this.getWeights(trainableOnly); + for (var i = 0; i < weights.length; ++i) { + if (trainableOnly && !weights[i].trainable) { + continue; + } + namedWeights[weights[i].originalName] = weightValues[i]; + } + return namedWeights; + }; + Model.prototype.save = function (handlerOrURL, config) { + return __awaiter(this, void 0, void 0, function () { + var handlers, weightDataAndSpecs, returnString, unusedArg, modelConfig; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (typeof handlerOrURL === 'string') { + handlers = tfc.io.getSaveHandlers(handlerOrURL); + if (handlers.length === 0) { + throw new ValueError("Cannot find any save handlers for URL '" + handlerOrURL + "'"); + } + else if (handlers.length > 1) { + throw new ValueError("Found more than one (" + handlers.length + ") save handlers for " + + ("URL '" + handlerOrURL + "'")); + } + handlerOrURL = handlers[0]; + } + if (handlerOrURL.save == null) { + throw new ValueError('Model.save() cannot proceed because the IOHandler provided does ' + + 'not have the `save` attribute defined.'); + } + return [4, tfc.io.encodeWeights(this.getNamedWeights(config))]; + case 1: + weightDataAndSpecs = _a.sent(); + returnString = false; + unusedArg = null; + modelConfig = this.toJSON(unusedArg, returnString); + return [2, handlerOrURL.save({ + modelTopology: modelConfig, + weightData: weightDataAndSpecs.data, + weightSpecs: weightDataAndSpecs.specs + })]; + } + }); + }); + }; + Model.className = 'Model'; + return Model; + }(Container)); + tfc.serialization.SerializationMap.register(Model); + + function loadModelInternal(pathOrIOHandler) { + return __awaiter(this, void 0, void 0, function () { + var handlers; + return __generator(this, function (_a) { + if (typeof pathOrIOHandler === 'string') { + handlers = tfc.io.getLoadHandlers(pathOrIOHandler); + if (handlers.length === 0) { + handlers.push(tfc.io.browserHTTPRequest(pathOrIOHandler)); + } + else if (handlers.length > 1) { + throw new ValueError("Found more than one (" + handlers.length + ") load handlers for " + + ("URL '" + pathOrIOHandler + "'")); + } + pathOrIOHandler = handlers[0]; + } + return [2, loadModelFromIOHandler(pathOrIOHandler)]; + }); + }); + } + function loadModelFromIOHandler(handler, customObjects) { + return __awaiter(this, void 0, void 0, function () { + var artifacts, modelTopology, model, skipMismatch, isNamedTensorMap; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (handler.load == null) { + throw new ValueError('Cannot proceed with model loading because the IOHandler provided ' + + 'does not have the `load` method implemented.'); + } + return [4, handler.load()]; + case 1: + artifacts = _a.sent(); + modelTopology = artifacts.modelTopology; + if (modelTopology['model_config'] != null) { + modelTopology = modelTopology['model_config']; + } + model = deserialize(convertPythonicToTs(modelTopology), customObjects); + if (artifacts.weightData != null) { + if (artifacts.weightSpecs == null) { + throw new ValueError('Model artifacts contains weight data, but not weight specs. ' + + 'Therefore loading of weights cannot proceed.'); + } + skipMismatch = false; + isNamedTensorMap = true; + model.loadWeights(tfc.io.decodeWeights(artifacts.weightData, artifacts.weightSpecs), skipMismatch, isNamedTensorMap); + } + return [2, model]; + } + }); + }); + } + var Sequential = (function (_super) { + __extends(Sequential, _super); + function Sequential(config) { + var _this = _super.call(this, { inputs: [], outputs: [] }) || this; + config = config || {}; + _this.trainable = true; + _this._updatable = true; + _this.built = false; + _this.name = (config.name != null) ? config.name : getUid('sequential_'); + if (config.layers != null) { + for (var _i = 0, _a = config.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + _this.add(layer); + } + } + return _this; + } + Sequential.prototype.add = function (layer) { + var isLayerModelInstance = layer instanceof Sequential || layer instanceof Model; + var modelLayer; + if (isLayerModelInstance) { + modelLayer = layer; + if (modelLayer.outputs.length !== 1) { + throw new ValueError('All layers in a Sequential model ' + + 'should have a single output tensor. ' + + 'For multi-output layers, ' + + 'use the functional API.'); + } + if (modelLayer.inputs.length !== 1) { + throw new ValueError('All layers in a Sequential model ' + + 'should have a single input tensor. ' + + 'For multi-input layers, ' + + 'use the functional API.'); + } + } + if (this.outputs.length === 0) { + if (layer.inboundNodes.length === 0) { + if (layer.batchInputShape == null) { + throw new ValueError('The first layer in a Sequential model must ' + + 'get an `inputShape` or `batchInputShape` argument.'); + } + var x = Input({ + batchShape: layer.batchInputShape, + dtype: layer.dtype, + name: layer.name + '_input' + }); + layer.apply(x); + } + if (isLayerModelInstance) { + this.outputs = modelLayer.outputs; + this.inputs = modelLayer.inputs; + } + else { + if (layer.inboundNodes.length !== 1) { + throw new ValueError('A layer added to a Sequential model must not already be ' + + ("connected somewhere else. Model received layer " + layer.name + " ") + + ("which has " + layer.inboundNodes.length + " pre-existing inbound ") + + 'connections.'); + } + if (layer.inboundNodes[0].outputTensors.length !== 1) { + throw new ValueError('All layers in a Sequential model ' + + 'should have a single output tensor. ' + + 'For multi-output layers, ' + + 'use the functional API.'); + } + this.outputs = [layer.inboundNodes[0].outputTensors[0]]; + this.inputs = getSourceInputs(this.outputs[0]); + } + this.inboundNodes = []; + new Node({ + outboundLayer: this, + inboundLayers: [], + nodeIndices: [], + tensorIndices: [], + inputTensors: this.inputs, + outputTensors: this.outputs, + inputMasks: pyListRepeat(null, this.inputs.length), + outputMasks: [null], + inputShapes: this.inputs.map(function (x) { return x.shape; }), + outputShapes: this.outputs[0].shape + }); + } + else { + var outputTensor = layer.apply(this.outputs[0]); + if (Array.isArray(outputTensor)) { + throw new TypeError('All layers in a Sequential model ' + + 'should have a single output tensor. ' + + 'For multi-output layers, ' + + 'use the functional API.'); + } + this.outputs = [outputTensor]; + this.inboundNodes[0].outputTensors = this.outputs; + this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; + } + this.layers.push(layer); + this.built = false; + }; + Sequential.prototype.pop = function () { + if (this.layers.length === 0) { + throw new TypeError('There are no layers in the model.'); + } + this.layers.pop(); + if (this.layers.length === 0) { + this.outputs = []; + this.inboundNodes = []; + this.outboundNodes = []; + } + else { + var lastLayerIndex = this.layers.length - 1; + this.layers[lastLayerIndex].outboundNodes = []; + this.outputs = [this.layers[lastLayerIndex].output]; + this.inboundNodes[0].outputTensors = this.outputs; + this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; + } + }; + Sequential.prototype.call = function (inputs, kwargs) { + if (this.model == null) { + this.build(); + } + return this.model.call(inputs, kwargs); + }; + Sequential.prototype.build = function (inputShape) { + getExactlyOneShape(inputShape); + if (this.inputs.length === 0 || this.outputs.length === 0) { + throw new TypeError('Sequential model cannot be built: model is empty.' + + ' Add some layers first.'); + } + this.model = new Model({ + inputs: this.inputs, + outputs: this.outputs[0], + name: this.name + '_model' + }); + this.model.trainable = this.trainable; + this.model.updatable = this.updatable; + this.supportsMasking = this.model.supportsMasking; + this.inputLayers = this.model.inputLayers; + this.inputLayersNodeIndices = this.model.inputLayersNodeIndices; + this.inputLayersTensorIndices = this.model.inputLayersTensorIndices; + this.outputLayers = this.model.outputLayers; + this.outputLayersNodeIndices = this.model.outputLayersNodeIndices; + this.outputLayersTensorIndices = this.model.outputLayersTensorIndices; + this.nodesByDepth = this.model.nodesByDepth; + this.containerNodes = this.model.containerNodes; + this.outputNames = this.model.outputNames; + this.inputNames = this.model.inputNames; + this.built = true; + }; + Sequential.prototype.countParams = function () { + if (!this.built) { + this.build(); + } + return _super.prototype.countParams.call(this); + }; + Sequential.prototype.summary = function (lineLength, positions, printFn) { + if (printFn === void 0) { printFn = console.log; } + if (!this.built) { + this.build(); + } + _super.prototype.summary.call(this, lineLength, positions, printFn); + }; + Sequential.prototype.setWeights = function (weights) { + if (this.model == null) { + this.build(); + } + this.model.setWeights(weights); + }; + Object.defineProperty(Sequential.prototype, "updatable", { + get: function () { + return this._updatable; + }, + set: function (value) { + if (this.built) { + this.model.updatable = value; + } + this._updatable = value; + }, + enumerable: true, + configurable: true + }); + Sequential.prototype.evaluate = function (x, y, config) { + if (config === void 0) { config = {}; } + if (!this.built) { + throw new RuntimeError('The model needs to be compiled before being used.'); + } + return this.model.evaluate(x, y, config); + }; + Sequential.prototype.predict = function (x, config) { + if (config === void 0) { config = {}; } + if (this.model == null) { + this.build(); + } + return this.model.predict(x, config); + }; + Sequential.prototype.predictOnBatch = function (x) { + if (this.model == null) { + this.build(); + } + return this.model.predictOnBatch(x); + }; + Sequential.prototype.compile = function (config) { + this.build(); + this.model.compile(config); + this.optimizer = this.model.optimizer; + this.loss = this.model.loss; + this.metrics = this.model.metrics; + this.metricsTensors = this.model.metricsTensors; + this.metricsNames = this.model.metricsNames; + }; + Sequential.prototype.fit = function (x, y, config) { + if (config === void 0) { config = {}; } + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (!this.built) { + throw new RuntimeError('The model needs to be compiled before ' + + 'being used.'); + } + return [2, this.model.fit(x, y, config)]; + }); + }); + }; + Sequential.fromConfig = function (cls, config) { + var model = new cls({}); + if (!(model instanceof Sequential)) { + throw new ValueError("Sequential.fromConfig called on non-Sequential input: " + model); + } + if (!(config instanceof Array)) { + throw new ValueError("Sequential.fromConfig called without an array of configs"); + } + if (!(config[0].className != null) || config[0]['className'] === 'Merge') { + throw new ValueError('Legacy serialization format not supported yet.'); + } + for (var _i = 0, _a = config; _i < _a.length; _i++) { + var conf = _a[_i]; + var layer = deserialize(conf); + model.add(layer); + } + return model; + }; + Sequential.prototype.getConfig = function () { + var config = []; + for (var _i = 0, _a = this.layers; _i < _a.length; _i++) { + var layer = _a[_i]; + config.push({ + className: layer.getClassName(), + config: layer.getConfig(), + }); + } + return config; + }; + Sequential.className = 'Sequential'; + return Sequential; + }(Model)); + tfc.serialization.SerializationMap.register(Sequential); + + function model(config) { + return new Model(config); + } + function sequential(config) { + return new Sequential(config); + } + function loadModel(pathOrIOHandler) { + return loadModelInternal(pathOrIOHandler); + } + function input(config) { + return Input(config); + } + + var Activation = (function (_super) { + __extends(Activation, _super); + function Activation() { + return _super !== null && _super.apply(this, arguments) || this; + } + Activation.prototype.getConfig = function () { + return {}; + }; + return Activation; + }(tfc.serialization.Serializable)); + var Elu = (function (_super) { + __extends(Elu, _super); + function Elu() { + return _super !== null && _super.apply(this, arguments) || this; + } + Elu.prototype.apply = function (x, alpha) { + if (alpha === void 0) { alpha = 1; } + return elu(x, alpha); + }; + Elu.className = 'elu'; + return Elu; + }(Activation)); + tfc.serialization.SerializationMap.register(Elu); + var Selu = (function (_super) { + __extends(Selu, _super); + function Selu() { + return _super !== null && _super.apply(this, arguments) || this; + } + Selu.prototype.apply = function (x) { + return tfc.selu(x); + }; + Selu.className = 'selu'; + return Selu; + }(Activation)); + tfc.serialization.SerializationMap.register(Selu); + var Relu = (function (_super) { + __extends(Relu, _super); + function Relu() { + return _super !== null && _super.apply(this, arguments) || this; + } + Relu.prototype.apply = function (x) { + return tfc.relu(x); + }; + Relu.className = 'relu'; + return Relu; + }(Activation)); + tfc.serialization.SerializationMap.register(Relu); + var Relu6 = (function (_super) { + __extends(Relu6, _super); + function Relu6() { + return _super !== null && _super.apply(this, arguments) || this; + } + Relu6.prototype.apply = function (x) { + return tfc.tidy(function () { return tfc.minimum(getScalar(6.0), tfc.relu(x)); }); + }; + Relu6.className = 'relu6'; + return Relu6; + }(Activation)); + tfc.serialization.SerializationMap.register(Relu6); + var Linear = (function (_super) { + __extends(Linear, _super); + function Linear() { + return _super !== null && _super.apply(this, arguments) || this; + } + Linear.prototype.apply = function (x) { + return x; + }; + Linear.className = 'linear'; + return Linear; + }(Activation)); + tfc.serialization.SerializationMap.register(Linear); + var Sigmoid = (function (_super) { + __extends(Sigmoid, _super); + function Sigmoid() { + return _super !== null && _super.apply(this, arguments) || this; + } + Sigmoid.prototype.apply = function (x) { + return tfc.sigmoid(x); + }; + Sigmoid.className = 'sigmoid'; + return Sigmoid; + }(Activation)); + tfc.serialization.SerializationMap.register(Sigmoid); + var HardSigmoid = (function (_super) { + __extends(HardSigmoid, _super); + function HardSigmoid() { + return _super !== null && _super.apply(this, arguments) || this; + } + HardSigmoid.prototype.apply = function (x) { + return hardSigmoid(x); + }; + HardSigmoid.className = 'hardSigmoid'; + return HardSigmoid; + }(Activation)); + tfc.serialization.SerializationMap.register(HardSigmoid); + var Softplus = (function (_super) { + __extends(Softplus, _super); + function Softplus() { + return _super !== null && _super.apply(this, arguments) || this; + } + Softplus.prototype.apply = function (x) { + return tfc.softplus(x); + }; + Softplus.className = 'softplus'; + return Softplus; + }(Activation)); + tfc.serialization.SerializationMap.register(Softplus); + var Softsign = (function (_super) { + __extends(Softsign, _super); + function Softsign() { + return _super !== null && _super.apply(this, arguments) || this; + } + Softsign.prototype.apply = function (x) { + return softsign(x); + }; + Softsign.className = 'softsign'; + return Softsign; + }(Activation)); + tfc.serialization.SerializationMap.register(Softsign); + var Tanh = (function (_super) { + __extends(Tanh, _super); + function Tanh() { + return _super !== null && _super.apply(this, arguments) || this; + } + Tanh.prototype.apply = function (x) { + return tfc.tanh(x); + }; + Tanh.className = 'tanh'; + return Tanh; + }(Activation)); + tfc.serialization.SerializationMap.register(Tanh); + var Softmax = (function (_super) { + __extends(Softmax, _super); + function Softmax() { + return _super !== null && _super.apply(this, arguments) || this; + } + Softmax.prototype.apply = function (x, axis) { + if (axis === void 0) { axis = (-1); } + return tfc.softmax(x, axis); + }; + Softmax.className = 'softmax'; + return Softmax; + }(Activation)); + tfc.serialization.SerializationMap.register(Softmax); + function serializeActivation(activation) { + return activation.getClassName(); + } + function deserializeActivation(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'activation'); + } + function getActivation(identifier) { + if (identifier == null) { + var config = { className: 'linear', config: {} }; + return deserializeActivation(config); + } + if (typeof identifier === 'string') { + var config = { className: identifier, config: {} }; + return deserializeActivation(config); + } + else if (identifier instanceof Activation) { + return identifier; + } + else { + return deserializeActivation(identifier); + } + } + + var LeakyReLU = (function (_super) { + __extends(LeakyReLU, _super); + function LeakyReLU(config) { + var _this = _super.call(this, config == null ? {} : config) || this; + _this.DEFAULT_ALPHA = 0.3; + if (config == null) { + config = {}; + } + _this.alpha = config.alpha == null ? _this.DEFAULT_ALPHA : config.alpha; + return _this; + } + LeakyReLU.prototype.call = function (inputs, kwargs) { + var x = getExactlyOneTensor(inputs); + return tfc.leakyRelu(x, this.alpha); + }; + LeakyReLU.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + LeakyReLU.prototype.getConfig = function () { + var config = { alpha: this.alpha }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + LeakyReLU.className = 'LeakyReLU'; + return LeakyReLU; + }(Layer)); + tfc.serialization.SerializationMap.register(LeakyReLU); + var ELU = (function (_super) { + __extends(ELU, _super); + function ELU(config) { + var _this = _super.call(this, config == null ? {} : config) || this; + _this.DEFAULT_ALPHA = 1.0; + if (config == null) { + config = {}; + } + if (config.alpha != null && config.alpha !== _this.DEFAULT_ALPHA) { + throw new NotImplementedError("Non-default alpha value (" + config.alpha + ") is not supported by the " + + "ELU layer yet."); + } + _this.alpha = config.alpha == null ? _this.DEFAULT_ALPHA : config.alpha; + return _this; + } + ELU.prototype.call = function (inputs, kwargs) { + var x = getExactlyOneTensor(inputs); + return tfc.elu(x); + }; + ELU.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + ELU.prototype.getConfig = function () { + var config = { alpha: this.alpha }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + ELU.className = 'ELU'; + return ELU; + }(Layer)); + tfc.serialization.SerializationMap.register(ELU); + var ThresholdedReLU = (function (_super) { + __extends(ThresholdedReLU, _super); + function ThresholdedReLU(config) { + var _this = _super.call(this, config == null ? {} : config) || this; + _this.DEFAULT_THETA = 1.0; + if (config == null) { + config = {}; + } + _this.theta = config.theta == null ? _this.DEFAULT_THETA : config.theta; + _this.thetaTensor = getScalar(_this.theta); + return _this; + } + ThresholdedReLU.prototype.call = function (inputs, kwargs) { + var x = getExactlyOneTensor(inputs); + return x.mul(cast(x.greater(this.thetaTensor), 'float32')); + }; + ThresholdedReLU.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + ThresholdedReLU.prototype.getConfig = function () { + var config = { theta: this.theta }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + ThresholdedReLU.className = 'ThresholdedReLU'; + return ThresholdedReLU; + }(Layer)); + tfc.serialization.SerializationMap.register(ThresholdedReLU); + var Softmax$1 = (function (_super) { + __extends(Softmax$$1, _super); + function Softmax$$1(config) { + var _this = _super.call(this, config == null ? {} : config) || this; + _this.DEFAULT_AXIS = 1.0; + if (config == null) { + config = {}; + } + _this.softmax = new Softmax().apply; + _this.axis = config.axis == null ? _this.DEFAULT_AXIS : config.axis; + return _this; + } + Softmax$$1.prototype.call = function (inputs, kwargs) { + var x = getExactlyOneTensor(inputs); + return this.softmax(x, this.axis); + }; + Softmax$$1.prototype.computeOutputShape = function (inputShape) { + return inputShape; + }; + Softmax$$1.prototype.getConfig = function () { + var config = { axis: this.axis }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Softmax$$1.className = 'Softmax'; + return Softmax$$1; + }(Layer)); + tfc.serialization.SerializationMap.register(Softmax$1); + + var Regularizer = (function (_super) { + __extends(Regularizer, _super); + function Regularizer() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Regularizer; + }(tfc.serialization.Serializable)); + var L1L2 = (function (_super) { + __extends(L1L2, _super); + function L1L2(config) { + var _this = _super.call(this) || this; + var l1 = config == null || config.l1 == null ? 0.01 : config.l1; + var l2 = config == null || config.l2 == null ? 0.01 : config.l2; + _this.hasL1 = l1 !== 0; + _this.hasL2 = l2 !== 0; + _this.l1 = getScalar(l1); + _this.l2 = getScalar(l2); + return _this; + } + L1L2.prototype.apply = function (x) { + var _this = this; + return tfc.tidy(function () { + var regularization = tfc.zeros([1]); + if (_this.hasL1) { + regularization = tfc.add(regularization, tfc.sum(tfc.mul(_this.l1, tfc.abs(x)))); + } + if (_this.hasL2) { + regularization = + tfc.add(regularization, tfc.sum(tfc.mul(_this.l2, square(x)))); + } + return regularization.asScalar(); + }); + }; + L1L2.prototype.getConfig = function () { + return { 'l1': this.l1.dataSync()[0], 'l2': this.l2.dataSync()[0] }; + }; + L1L2.fromConfig = function (cls, config) { + return new cls({ l1: config.l1, l2: config.l2 }); + }; + L1L2.className = 'L1L2'; + return L1L2; + }(Regularizer)); + tfc.serialization.SerializationMap.register(L1L2); + function l1(config) { + return new L1L2({ l1: config != null ? config.l1 : null, l2: 0 }); + } + function l2(config) { + return new L1L2({ l2: config != null ? config.l2 : null, l1: 0 }); + } + var REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { + 'l1l2': 'L1L2' + }; + function serializeRegularizer(constraint) { + return serializeKerasObject(constraint); + } + function deserializeRegularizer(config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + return deserializeKerasObject(config, tfc.serialization.SerializationMap.getMap().classNameMap, customObjects, 'regularizer'); + } + function getRegularizer(identifier) { + if (identifier == null) { + return null; + } + if (typeof identifier === 'string') { + var className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? + REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] : + identifier; + var config = { className: className, config: {} }; + return deserializeRegularizer(config); + } + else if (identifier instanceof Regularizer) { + return identifier; + } + else { + return deserializeRegularizer(identifier); + } + } + + function normalizeArray(value, n, name) { + if (typeof value === 'number') { + return pyListRepeat(value, n); + } + else { + if (value.length !== n) { + throw new ValueError("The " + name + " argument must be a tuple of " + n + " integers. Received: " + + (value.length + " elements.")); + } + for (var i = 0; i < n; ++i) { + var singleValue = value[i]; + if (!isInteger(singleValue)) { + throw new ValueError("The " + name + " argument must be a tuple of " + n + " integers. Received: " + + (JSON.stringify(value) + " including a non-integer number ") + + ("" + singleValue)); + } + } + return value; + } + } + function convOutputLength(inputLength, filterSize, padding, stride, dilation) { + if (dilation === void 0) { dilation = 1; } + if (inputLength == null) { + return inputLength; + } + var dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); + var outputLength; + if (padding === 'same') { + outputLength = inputLength; + } + else { + outputLength = inputLength - dilatedFilterSize + 1; + } + return Math.floor((outputLength + stride - 1) / stride); + } + function deconvLength(dimSize, strideSize, kernelSize, padding) { + if (dimSize == null) { + return null; + } + if (padding === 'valid') { + dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]); + } + else if (padding === 'same') { + dimSize = dimSize * strideSize; + } + else { + throw new ValueError("Unsupport padding mode: " + padding + "."); + } + return dimSize; + } + + function preprocessConv2DInput(x, dataFormat) { + return tfc.tidy(function () { + checkDataFormat(dataFormat); + if (dataFormat === 'channelsFirst') { + return tfc.transpose(x, [0, 2, 3, 1]); + } + else { + return x; + } + }); + } + function conv1dWithBias(x, kernel, bias, strides, padding, dataFormat, dilationRate) { + if (strides === void 0) { strides = 1; } + if (padding === void 0) { padding = 'valid'; } + if (dilationRate === void 0) { dilationRate = 1; } + return tfc.tidy(function () { + if (dataFormat == null) { + dataFormat = imageDataFormat(); + } + checkDataFormat(dataFormat); + if (x.shape.length !== 3) { + throw new ValueError("The input of a conv1dWithBias operation should be 3, but is " + + (x.shape.length + " instead.")); + } + if (kernel.shape.length !== 3) { + throw new ValueError("The kernel for a conv1dWithBias operation should be 3, but is " + + (kernel.shape.length + " instead")); + } + if (bias != null && bias.shape.length !== 1) { + throw new ValueError("The bias for a conv1dWithBias operation should be 1, but is " + + (kernel.shape.length + " instead")); + } + if (dataFormat === 'channelsFirst') { + x = tfc.transpose(x, [0, 2, 1]); + } + if (padding === 'causal') { + throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + + 'implemented yet.'); + } + var y = tfc.conv1d(x, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate); + if (bias != null) { + y = biasAdd(y, bias); + } + return y; + }); + } + function conv2dWithBias(x, kernel, bias, strides, padding, dataFormat, dilationRate) { + if (strides === void 0) { strides = [1, 1]; } + if (padding === void 0) { padding = 'valid'; } + return tfc.tidy(function () { + if (dataFormat == null) { + dataFormat = imageDataFormat(); + } + checkDataFormat(dataFormat); + if (x.rank !== 3 && x.rank !== 4) { + throw new ValueError("conv2dWithBias expects input to be of rank 3 or 4, but received " + + (x.rank + ".")); + } + if (kernel.rank !== 3 && kernel.rank !== 4) { + throw new ValueError("conv2dWithBias expects kernel to be of rank 3 or 4, but received " + + (x.rank + ".")); + } + var y = preprocessConv2DInput(x, dataFormat); + if (padding === 'causal') { + throw new NotImplementedError('The support for CAUSAL padding mode in conv1dWithBias is not ' + + 'implemented yet.'); + } + y = tfc.conv2d(y, kernel, strides, padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); + if (bias != null) { + y = biasAdd(y, bias); + } + if (dataFormat === 'channelsFirst') { + y = tfc.transpose(y, [0, 3, 1, 2]); + } + return y; + }); + } + var BaseConv = (function (_super) { + __extends(BaseConv, _super); + function BaseConv(rank, config) { + var _this = _super.call(this, config) || this; + _this.bias = null; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + BaseConv.verifyConfig(config); + _this.rank = rank; + if (_this.rank !== 1 && _this.rank !== 2) { + throw new NotImplementedError("Convolution layer for rank other than 1 or 2 (" + _this.rank + ") is " + + "not implemented yet."); + } + _this.kernelSize = normalizeArray(config.kernelSize, rank, 'kernelSize'); + _this.strides = normalizeArray(config.strides == null ? 1 : config.strides, rank, 'strides'); + _this.padding = config.padding == null ? 'valid' : config.padding; + checkPaddingMode(_this.padding); + _this.dataFormat = + config.dataFormat == null ? 'channelsLast' : config.dataFormat; + checkDataFormat(_this.dataFormat); + _this.activation = getActivation(config.activation); + _this.useBias = config.useBias == null ? true : config.useBias; + _this.biasInitializer = + getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.biasConstraint = getConstraint(config.biasConstraint); + _this.biasRegularizer = getRegularizer(config.biasRegularizer); + _this.activityRegularizer = getRegularizer(config.activityRegularizer); + _this.dilationRate = normalizeArray(config.dilationRate == null ? 1 : config.dilationRate, rank, 'dilationRate'); + if (_this.rank === 1 && + (Array.isArray(_this.dilationRate) && + _this.dilationRate.length !== 1)) { + throw new ValueError("dilationRate must be a number or an array of a single number " + + "for 1D convolution, but received " + + ("" + JSON.stringify(_this.dilationRate))); + } + if (_this.rank === 2) { + if (typeof _this.dilationRate === 'number') { + _this.dilationRate = [_this.dilationRate, _this.dilationRate]; + } + else if (_this.dilationRate.length !== 2) { + throw new ValueError("dilationRate must be a number or array of two numbers for 2D " + + ("convolution, but received " + JSON.stringify(_this.dilationRate))); + } + } + return _this; + } + BaseConv.verifyConfig = function (config) { + assert('kernelSize' in config, "required key 'kernelSize' not in config"); + if (typeof config.kernelSize !== 'number' && + !checkArrayTypeAndLength(config.kernelSize, 'number', 1, 2)) + throw new ValueError("BaseConv expects config.kernelSize to be number or number[] with " + + ("length 1 or 2, but received " + JSON.stringify(config.kernelSize) + ".")); + }; + BaseConv.prototype.getConfig = function () { + var config = { + kernelSize: this.kernelSize, + strides: this.strides, + padding: this.padding, + dataFormat: this.dataFormat, + dilationRate: this.dilationRate, + activation: serializeActivation(this.activation), + useBias: this.useBias, + biasInitializer: serializeInitializer(this.biasInitializer), + biasRegularizer: serializeRegularizer(this.biasRegularizer), + activityRegularizer: serializeRegularizer(this.activityRegularizer), + biasConstraint: serializeConstraint(this.biasConstraint) + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + return BaseConv; + }(Layer)); + var Conv = (function (_super) { + __extends(Conv, _super); + function Conv(rank, config) { + var _this = _super.call(this, rank, config) || this; + _this.kernel = null; + Conv.verifyConfig(config); + _this.filters = config.filters; + _this.kernelInitializer = getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.kernelConstraint = getConstraint(config.kernelConstraint); + _this.kernelRegularizer = getRegularizer(config.kernelRegularizer); + return _this; + } + Conv.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null) { + throw new ValueError("The channel dimension of the input should be defined. " + + ("Found " + inputShape[channelAxis])); + } + var inputDim = inputShape[channelAxis]; + var kernelShape = this.kernelSize.concat([inputDim, this.filters]); + this.kernel = this.addWeight('kernel', kernelShape, null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.filters], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + this.inputSpec = [{ ndim: this.rank + 2, axes: (_a = {}, _a[channelAxis] = inputDim, _a) }]; + this.built = true; + var _a; + }; + Conv.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = getExactlyOneTensor(inputs); + var outputs; + var biasValue = _this.bias == null ? null : _this.bias.read(); + if (_this.rank === 1) { + outputs = conv1dWithBias(inputs, _this.kernel.read(), biasValue, _this.strides[0], _this.padding, _this.dataFormat, _this.dilationRate[0]); + } + else if (_this.rank === 2) { + outputs = conv2dWithBias(inputs, _this.kernel.read(), biasValue, _this.strides, _this.padding, _this.dataFormat, _this.dilationRate); + } + else if (_this.rank === 3) { + throw new NotImplementedError('3D convolution is not implemented yet.'); + } + if (_this.activation != null) { + outputs = _this.activation.apply(outputs); + } + return outputs; + }); + }; + Conv.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var newSpace = []; + var space = (this.dataFormat === 'channelsLast') ? + inputShape.slice(1, inputShape.length - 1) : + inputShape.slice(2); + for (var i = 0; i < space.length; ++i) { + var newDim = convOutputLength(space[i], this.kernelSize[i], this.padding, this.strides[i], typeof this.dilationRate === 'number' ? this.dilationRate : + this.dilationRate[i]); + newSpace.push(newDim); + } + var outputShape = [inputShape[0]]; + if (this.dataFormat === 'channelsLast') { + outputShape = outputShape.concat(newSpace); + outputShape.push(this.filters); + } + else { + outputShape.push(this.filters); + outputShape = outputShape.concat(newSpace); + } + return outputShape; + }; + Conv.prototype.getConfig = function () { + var config = { + filters: this.filters, + kernelInitializer: serializeInitializer(this.kernelInitializer), + kernelRegularizer: serializeRegularizer(this.kernelRegularizer), + kernelConstraint: serializeConstraint(this.kernelConstraint) + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Conv.verifyConfig = function (config) { + if (!('filters' in config) || typeof config.filters !== 'number' || + config.filters < 1) { + throw new ValueError("Convolution layer expected config.filters to be a 'number' > 0 " + + ("but got " + JSON.stringify(config.filters))); + } + }; + return Conv; + }(BaseConv)); + var Conv2D = (function (_super) { + __extends(Conv2D, _super); + function Conv2D(config) { + var _this = _super.call(this, 2, config) || this; + Conv2D.verifyConfig(config); + return _this; + } + Conv2D.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + delete config['rank']; + return config; + }; + Conv2D.verifyConfig = function (config) { + if ((typeof config.kernelSize !== 'number') && + !checkArrayTypeAndLength(config.kernelSize, 'number', 1, 2)) + throw new ValueError("Conv2D expects config.kernelSize to be number or number[] with " + + ("length 1 or 2, but received " + JSON.stringify(config.kernelSize) + ".")); + }; + Conv2D.className = 'Conv2D'; + return Conv2D; + }(Conv)); + tfc.serialization.SerializationMap.register(Conv2D); + var Conv2DTranspose = (function (_super) { + __extends(Conv2DTranspose, _super); + function Conv2DTranspose(config) { + var _this = _super.call(this, config) || this; + _this.inputSpec = [new InputSpec({ ndim: 4 })]; + if (_this.padding !== 'same' && _this.padding !== 'valid') { + throw new ValueError("Conv2DTranspose currently supports only padding modes 'same' " + + ("and 'valid', but received padding mode " + _this.padding)); + } + return _this; + } + Conv2DTranspose.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + if (inputShape.length !== 4) { + throw new ValueError('Input should have rank 4; Received input shape: ' + + JSON.stringify(inputShape)); + } + var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null) { + throw new ValueError('The channel dimension of the inputs should be defined. ' + + 'Found `None`.'); + } + var inputDim = inputShape[channelAxis]; + var kernelShape = this.kernelSize.concat([this.filters, inputDim]); + this.kernel = this.addWeight('kernel', kernelShape, 'float32', this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + this.inputSpec = + [new InputSpec({ ndim: 4, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; + this.built = true; + var _a; + }; + Conv2DTranspose.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + var input = getExactlyOneTensor(inputs); + if (input.shape.length !== 4) { + throw new ValueError("Conv2DTranspose.call() expects input tensor to be rank-4, but " + + ("received a tensor of rank-" + input.shape.length)); + } + var inputShape = input.shape; + var batchSize = inputShape[0]; + var hAxis; + var wAxis; + if (_this.dataFormat === 'channelsFirst') { + hAxis = 2; + wAxis = 3; + } + else { + hAxis = 1; + wAxis = 2; + } + var height = inputShape[hAxis]; + var width = inputShape[wAxis]; + var kernelH = _this.kernelSize[0]; + var kernelW = _this.kernelSize[1]; + var strideH = _this.strides[0]; + var strideW = _this.strides[1]; + var outHeight = deconvLength(height, strideH, kernelH, _this.padding); + var outWidth = deconvLength(width, strideW, kernelW, _this.padding); + var outputShape = [batchSize, outHeight, outWidth, _this.filters]; + if (_this.dataFormat !== 'channelsLast') { + input = tfc.transpose(input, [0, 2, 3, 1]); + } + var outputs = tfc.conv2dTranspose(input, _this.kernel.read(), outputShape, _this.strides, _this.padding); + if (_this.dataFormat !== 'channelsLast') { + outputs = tfc.transpose(outputs, [0, 3, 1, 2]); + } + if (_this.bias != null) { + outputs = + biasAdd(outputs, _this.bias.read(), _this.dataFormat); + } + if (_this.activation != null) { + outputs = _this.activation.apply(outputs); + } + return outputs; + }); + }; + Conv2DTranspose.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var outputShape = inputShape.slice(); + var channelAxis; + var heightAxis; + var widthAxis; + if (this.dataFormat === 'channelsFirst') { + channelAxis = 1; + heightAxis = 2; + widthAxis = 3; + } + else { + channelAxis = 3; + heightAxis = 1; + widthAxis = 2; + } + var kernelH = this.kernelSize[0]; + var kernelW = this.kernelSize[1]; + var strideH = this.strides[0]; + var strideW = this.strides[1]; + outputShape[channelAxis] = this.filters; + outputShape[heightAxis] = + deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding); + outputShape[widthAxis] = + deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding); + return outputShape; + }; + Conv2DTranspose.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + delete config['dilationRate']; + return config; + }; + Conv2DTranspose.className = 'Conv2DTranspose'; + return Conv2DTranspose; + }(Conv2D)); + tfc.serialization.SerializationMap.register(Conv2DTranspose); + var SeparableConv = (function (_super) { + __extends(SeparableConv, _super); + function SeparableConv(rank, config) { + var _this = _super.call(this, rank, config) || this; + _this.DEFAULT_DEPTHWISE_INITIALIZER = 'glorotUniform'; + _this.DEFAULT_POINTWISE_INITIALIZER = 'glorotUniform'; + _this.depthwiseKernel = null; + _this.pointwiseKernel = null; + if (config.filters == null) { + throw new ValueError('The `filters` configuration field is required by SeparableConv, ' + + 'but is unspecified.'); + } + if (config.kernelInitializer != null || config.kernelRegularizer != null || + config.kernelConstraint != null) { + throw new ValueError('Fields kernelInitializer, kernelRegularizer and kernelConstraint ' + + 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' + + 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' + + 'pointwiseRegularizer and pointwiseConstraint instead.'); + } + if (config.padding != null && config.padding !== 'same' && + config.padding !== 'valid') { + throw new ValueError("SeparableConv" + _this.rank + "D supports only padding modes: " + + ("'same' and 'valid', but received " + JSON.stringify(config.padding))); + } + _this.depthMultiplier = + config.depthMultiplier == null ? 1 : config.depthMultiplier; + _this.depthwiseInitializer = getInitializer(config.depthwiseInitializer || _this.DEFAULT_DEPTHWISE_INITIALIZER); + _this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); + _this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); + _this.pointwiseInitializer = getInitializer(config.depthwiseInitializer || _this.DEFAULT_POINTWISE_INITIALIZER); + _this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer); + _this.pointwiseConstraint = getConstraint(config.pointwiseConstraint); + return _this; + } + SeparableConv.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + if (inputShape.length < this.rank + 2) { + throw new ValueError("Inputs to SeparableConv" + this.rank + "D should have rank " + + (this.rank + 2 + ", but received input shape: ") + + ("" + JSON.stringify(inputShape))); + } + var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1; + if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { + throw new ValueError("The channel dimension of the inputs should be defined, " + + ("but found " + JSON.stringify(inputShape[channelAxis]))); + } + var inputDim = inputShape[channelAxis]; + var depthwiseKernelShape = this.kernelSize.concat([inputDim, this.depthMultiplier]); + var pointwiseKernelShape = []; + for (var i = 0; i < this.rank; ++i) { + pointwiseKernelShape.push(1); + } + pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters); + var trainable = true; + this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, 'float32', this.depthwiseInitializer, this.depthwiseRegularizer, trainable, this.depthwiseConstraint); + this.pointwiseKernel = this.addWeight('pointwise_kernel', pointwiseKernelShape, 'float32', this.pointwiseInitializer, this.pointwiseRegularizer, trainable, this.pointwiseConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.filters], 'float32', this.biasInitializer, this.biasRegularizer, trainable, this.biasConstraint); + } + else { + this.bias = null; + } + this.inputSpec = + [new InputSpec({ ndim: this.rank + 2, axes: (_a = {}, _a[channelAxis] = inputDim, _a) })]; + this.built = true; + var _a; + }; + SeparableConv.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = getExactlyOneTensor(inputs); + var output; + if (_this.rank === 1) { + throw new NotImplementedError('1D separable convolution is not implemented yet.'); + } + else if (_this.rank === 2) { + if (_this.dataFormat === 'channelsFirst') { + inputs = tfc.transpose(inputs, [0, 2, 3, 1]); + } + output = tfc.separableConv2d(inputs, _this.depthwiseKernel.read(), _this.pointwiseKernel.read(), _this.strides, _this.padding, _this.dilationRate, 'NHWC'); + } + if (_this.useBias) { + output = biasAdd(output, _this.bias.read(), _this.dataFormat); + } + if (_this.activation != null) { + output = _this.activation.apply(output); + } + if (_this.dataFormat === 'channelsFirst') { + output = tfc.transpose(output, [0, 3, 1, 2]); + } + return output; + }); + }; + SeparableConv.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + delete config['rank']; + delete config['kernelInitializer']; + delete config['kernelRegularizer']; + delete config['kernelConstraint']; + config['depthwiseInitializer'] = + serializeInitializer(this.depthwiseInitializer); + config['pointwiseInitializer'] = + serializeInitializer(this.pointwiseInitializer); + config['depthwiseRegularizer'] = + serializeRegularizer(this.depthwiseRegularizer); + config['pointwiseRegularizer'] = + serializeRegularizer(this.pointwiseRegularizer); + config['depthwiseConstraint'] = + serializeConstraint(this.depthwiseConstraint); + config['pointwiseConstraint'] = + serializeConstraint(this.pointwiseConstraint); + return config; + }; + SeparableConv.className = 'SeparableConv'; + return SeparableConv; + }(Conv)); + var SeparableConv2D = (function (_super) { + __extends(SeparableConv2D, _super); + function SeparableConv2D(config) { + return _super.call(this, 2, config) || this; + } + SeparableConv2D.className = 'SeparableConv2D'; + return SeparableConv2D; + }(SeparableConv)); + tfc.serialization.SerializationMap.register(SeparableConv2D); + var Conv1D = (function (_super) { + __extends(Conv1D, _super); + function Conv1D(config) { + var _this = _super.call(this, 1, config) || this; + Conv1D.verifyConfig(config); + _this.inputSpec = [{ ndim: 3 }]; + return _this; + } + Conv1D.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + delete config['rank']; + delete config['dataFormat']; + return config; + }; + Conv1D.verifyConfig = function (config) { + if (typeof config.kernelSize !== 'number' && + !checkArrayTypeAndLength(config.kernelSize, 'number', 1, 1)) + throw new ValueError("Conv1D expects config.kernelSize to be number or number[] with " + + ("length 1, but received " + JSON.stringify(config.kernelSize) + ".")); + }; + Conv1D.className = 'Conv1D'; + return Conv1D; + }(Conv)); + tfc.serialization.SerializationMap.register(Conv1D); + var Cropping2D = (function (_super) { + __extends(Cropping2D, _super); + function Cropping2D(config) { + var _this = _super.call(this, config) || this; + if (typeof config.cropping === 'number') + _this.cropping = [ + [config.cropping, config.cropping], [config.cropping, config.cropping] + ]; + else if (typeof config.cropping[0] === 'number') + _this.cropping = [ + [config.cropping[0], config.cropping[0]], + [config.cropping[1], config.cropping[1]] + ]; + else + _this.cropping = config.cropping; + _this.dataFormat = + config.dataFormat === undefined ? 'channelsLast' : config.dataFormat; + _this.inputSpec = [{ ndim: 4 }]; + return _this; + } + Cropping2D.prototype.computeOutputShape = function (inputShape) { + if (this.dataFormat === 'channelsFirst') + return [ + inputShape[0], inputShape[1], + inputShape[2] - this.cropping[0][0] - this.cropping[0][1], + inputShape[2] - this.cropping[1][0] - this.cropping[1][1] + ]; + else + return [ + inputShape[0], + inputShape[1] - this.cropping[0][0] - this.cropping[0][1], + inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3] + ]; + }; + Cropping2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = getExactlyOneTensor(inputs); + if (_this.dataFormat === 'channelsLast') { + var hSliced = sliceAlongAxis(inputs, _this.cropping[0][0], inputs.shape[1] - _this.cropping[0][0] - _this.cropping[0][1], 2); + return sliceAlongAxis(hSliced, _this.cropping[1][0], inputs.shape[2] - _this.cropping[1][1] - _this.cropping[1][0], 3); + } + else { + var hSliced = sliceAlongAxis(inputs, _this.cropping[0][0], inputs.shape[2] - _this.cropping[0][0] - _this.cropping[0][1], 3); + return sliceAlongAxis(hSliced, _this.cropping[1][0], inputs.shape[3] - _this.cropping[1][1] - _this.cropping[1][0], 4); + } + }); + }; + Cropping2D.prototype.getConfig = function () { + var config = { cropping: this.cropping, dataFormat: this.dataFormat }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Cropping2D.className = 'Cropping2D'; + return Cropping2D; + }(Layer)); + tfc.serialization.SerializationMap.register(Cropping2D); + var UpSampling2D = (function (_super) { + __extends(UpSampling2D, _super); + function UpSampling2D(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_SIZE = [2, 2]; + _this.inputSpec = [{ ndim: 4 }]; + _this.size = config.size == null ? _this.DEFAULT_SIZE : config.size; + _this.dataFormat = + config.dataFormat == null ? 'channelsLast' : config.dataFormat; + return _this; + } + UpSampling2D.prototype.computeOutputShape = function (inputShape) { + if (this.dataFormat === 'channelsFirst') { + var height = inputShape[2] == null ? null : this.size[0] * inputShape[2]; + var width = inputShape[3] == null ? null : this.size[1] * inputShape[3]; + return [inputShape[0], inputShape[1], height, width]; + } + else { + var height = inputShape[1] == null ? null : this.size[0] * inputShape[1]; + var width = inputShape[2] == null ? null : this.size[1] * inputShape[2]; + return [inputShape[0], height, width, inputShape[3]]; + } + }; + UpSampling2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + var input = getExactlyOneTensor(inputs); + var inputShape = input.shape; + if (_this.dataFormat === 'channelsFirst') { + input = tfc.transpose(input, [0, 2, 3, 1]); + var height = _this.size[0] * inputShape[2]; + var width = _this.size[1] * inputShape[3]; + var resized = input.resizeNearestNeighbor([height, width]); + return tfc.transpose(resized, [0, 3, 1, 2]); + } + else { + var height = _this.size[0] * inputShape[1]; + var width = _this.size[1] * inputShape[2]; + return input.resizeNearestNeighbor([height, width]); + } + }); + }; + UpSampling2D.prototype.getConfig = function () { + var config = { size: this.size, dataFormat: this.dataFormat }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + UpSampling2D.className = 'UpSampling2D'; + return UpSampling2D; + }(Layer)); + tfc.serialization.SerializationMap.register(UpSampling2D); + + function depthwiseConv2d(x, depthwiseKernel, strides, padding, dataFormat, dilationRate) { + if (strides === void 0) { strides = [1, 1]; } + if (padding === void 0) { padding = 'valid'; } + return tfc.tidy(function () { + if (dataFormat == null) { + dataFormat = imageDataFormat(); + } + checkDataFormat(dataFormat); + var y = preprocessConv2DInput(x, dataFormat); + if (x.rank !== 4) { + throw new ValueError("Input for depthwiseConv2d is required to be 4-D, but is instead " + + (x.rank + "-D")); + } + if (depthwiseKernel.rank !== 4) { + throw new ValueError("depthwiseKernel is required to be 4-D, but is instead " + + (depthwiseKernel.rank + "-D")); + } + y = tfc.depthwiseConv2d(y, depthwiseKernel, strides, padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate); + if (dataFormat === 'channelsFirst') { + y = tfc.transpose(y, [0, 3, 1, 2]); + } + return y; + }); + } + var DepthwiseConv2D = (function (_super) { + __extends(DepthwiseConv2D, _super); + function DepthwiseConv2D(config) { + var _this = _super.call(this, 2, config) || this; + _this.depthwiseKernel = null; + _this.depthMultiplier = + config.depthMultiplier == null ? 1 : config.depthMultiplier; + _this.depthwiseInitializer = getInitializer(config.depthwiseInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); + _this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); + return _this; + } + DepthwiseConv2D.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + if (inputShape.length < 4) { + throw new ValueError("Inputs to DepthwiseConv2D should have rank 4. " + + ("Received input shape: " + JSON.stringify(inputShape) + ".")); + } + var channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3; + if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) { + throw new ValueError('The channel dimension of the inputs to DepthwiseConv2D should ' + + ("be defined, but is not (" + inputShape[channelAxis] + ").")); + } + var inputDim = inputShape[channelAxis]; + var depthwiseKernelShape = [ + this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier + ]; + this.depthwiseKernel = this.addWeight('depthwise_kernel', depthwiseKernelShape, null, this.depthwiseInitializer, this.depthwiseRegularizer, true, this.depthwiseConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [inputDim * this.depthMultiplier], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + else { + this.bias = null; + } + this.built = true; + }; + DepthwiseConv2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = getExactlyOneTensor(inputs); + var outputs = depthwiseConv2d(inputs, _this.depthwiseKernel.read(), _this.strides, _this.padding, _this.dataFormat, null); + if (_this.useBias) { + outputs = biasAdd(outputs, _this.bias.read(), _this.dataFormat); + } + if (_this.activation != null) { + outputs = _this.activation.apply(outputs); + } + return outputs; + }); + }; + DepthwiseConv2D.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; + var cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; + var outFilters = this.dataFormat === 'channelsFirst' ? + inputShape[1] * this.depthMultiplier : + inputShape[3] * this.depthMultiplier; + var outRows = convOutputLength(rows, this.kernelSize[0], this.padding, this.strides[0]); + var outCols = convOutputLength(cols, this.kernelSize[1], this.padding, this.strides[1]); + if (this.dataFormat === 'channelsFirst') { + return [inputShape[0], outFilters, outRows, outCols]; + } + else { + return [inputShape[0], outRows, outCols, outFilters]; + } + }; + DepthwiseConv2D.prototype.getConfig = function () { + var config = _super.prototype.getConfig.call(this); + config['depthMultiplier'] = this.depthMultiplier; + config['depthwiseInitializer'] = + serializeInitializer(this.depthwiseInitializer); + config['depthwiseRegularizer'] = + serializeRegularizer(this.depthwiseRegularizer); + config['depthwiseConstraint'] = + serializeConstraint(this.depthwiseRegularizer); + return config; + }; + DepthwiseConv2D.className = 'DepthwiseConv2D'; + return DepthwiseConv2D; + }(BaseConv)); + tfc.serialization.SerializationMap.register(DepthwiseConv2D); + + var Dropout = (function (_super) { + __extends(Dropout, _super); + function Dropout(config) { + var _this = _super.call(this, config) || this; + _this.rate = Math.max(Math.min(config.rate, 1), 0); + _this.rateScalar = getScalar(_this.rate); + _this.noiseShape = config.noiseShape; + _this.seed = config.seed; + if (_this.seed != null) { + throw new NotImplementedError('Non-default seed is not implemented in Dropout layer yet: ' + + _this.seed); + } + _this.supportsMasking = true; + return _this; + } + Dropout.prototype.getNoiseShape = function (input) { + if (this.noiseShape == null) { + return this.noiseShape; + } + var inputShape = input.shape; + var noiseShape = []; + for (var i = 0; i < this.noiseShape.length; ++i) { + noiseShape.push(this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]); + } + return noiseShape; + }; + Dropout.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = getExactlyOneTensor(inputs); + if (_this.noiseShape != null && + !tfc.util.arraysEqual(input.shape, _this.noiseShape)) { + throw new NotImplementedError('Non-default noise shape is not implemented in Dropout ' + + 'layer yet: ' + JSON.stringify(_this.noiseShape)); + } + if (0 < _this.rate && _this.rate < 1) { + var training = kwargs['training'] == null ? false : kwargs['training']; + var noiseShape_1 = _this.getNoiseShape(input); + var output = inTrainPhase(function () { return dropout(input, _this.rateScalar, noiseShape_1, _this.seed); }, function () { return input; }, training); + return output; + } + return inputs; + }); + }; + Dropout.prototype.getConfig = function () { + var config = { + rate: this.rate, + noiseShape: this.noiseShape, + seed: this.seed, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Dropout.className = 'Dropout'; + return Dropout; + }(Layer)); + tfc.serialization.SerializationMap.register(Dropout); + var Dense = (function (_super) { + __extends(Dense, _super); + function Dense(config) { + var _this = _super.call(this, config) || this; + _this.activation = null; + _this.useBias = true; + _this.kernel = null; + _this.bias = null; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + if (config.batchInputShape == null && config.inputShape == null && + config.inputDim != null) { + var batchSize = null; + if (config.batchSize != null) { + batchSize = config.batchSize; + } + _this.batchInputShape = [batchSize, config.inputDim]; + } + _this.units = config.units; + _this.activation = getActivation(config.activation); + if (config.useBias != null) { + _this.useBias = config.useBias; + } + _this.kernelInitializer = getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.biasInitializer = + getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.kernelConstraint = getConstraint(config.kernelConstraint); + _this.biasConstraint = getConstraint(config.biasConstraint); + _this.kernelRegularizer = getRegularizer(config.kernelRegularizer); + _this.biasRegularizer = getRegularizer(config.biasRegularizer); + _this.activityRegularizer = getRegularizer(config.activityRegularizer); + _this.inputSpec = [{ minNDim: 2 }]; + return _this; + } + Dense.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var inputLastDim = inputShape[inputShape.length - 1]; + if (this.kernel == null) { + this.kernel = this.addWeight('kernel', [inputLastDim, this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + } + this.inputSpec = [{ minNDim: 2, axes: (_a = {}, _a[-1] = inputLastDim, _a) }]; + this.built = true; + var _a; + }; + Dense.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var outputShape = inputShape.slice(); + outputShape[outputShape.length - 1] = this.units; + return outputShape; + }; + Dense.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = getExactlyOneTensor(inputs); + var output = dot(input, _this.kernel.read()); + if (_this.bias != null) { + output = biasAdd(output, _this.bias.read()); + } + if (_this.activation != null) { + output = _this.activation.apply(output); + } + return output; + }); + }; + Dense.prototype.getConfig = function () { + var config = { + units: this.units, + activation: serializeActivation(this.activation), + useBias: this.useBias, + kernelInitializer: serializeInitializer(this.kernelInitializer), + biasInitializer: serializeInitializer(this.biasInitializer), + kernelRegularizer: serializeRegularizer(this.kernelRegularizer), + biasRegularizer: serializeRegularizer(this.biasRegularizer), + activityRegularizer: serializeRegularizer(this.activityRegularizer), + kernelConstraint: serializeConstraint(this.kernelConstraint), + biasConstraint: serializeConstraint(this.biasConstraint) + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Dense.className = 'Dense'; + return Dense; + }(Layer)); + tfc.serialization.SerializationMap.register(Dense); + var Flatten = (function (_super) { + __extends(Flatten, _super); + function Flatten(config) { + var _this = _super.call(this, config || {}) || this; + _this.inputSpec = [{ minNDim: 3 }]; + return _this; + } + Flatten.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + for (var _i = 0, _a = inputShape.slice(1); _i < _a.length; _i++) { + var dim = _a[_i]; + if (dim == null) { + throw new ValueError("The shape of the input to \"Flatten\" is not fully defined " + + ("(got " + inputShape.slice(1) + "). Make sure to pass a complete ") + + "\"input_shape\" or \"batch_input_shape\" argument to the first " + + "layer in your model."); + } + } + return [inputShape[0], arrayProd(inputShape, 1)]; + }; + Flatten.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + return batchFlatten(getExactlyOneTensor(inputs)); + }); + }; + Flatten.className = 'Flatten'; + return Flatten; + }(Layer)); + tfc.serialization.SerializationMap.register(Flatten); + var Activation$1 = (function (_super) { + __extends(Activation$$1, _super); + function Activation$$1(config) { + var _this = _super.call(this, config) || this; + _this.supportsMasking = true; + _this.activation = getActivation(config.activation); + return _this; + } + Activation$$1.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = getExactlyOneTensor(inputs); + return _this.activation.apply(input); + }); + }; + Activation$$1.prototype.getConfig = function () { + var config = { activation: serializeActivation(this.activation) }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Activation$$1.className = 'Activation'; + return Activation$$1; + }(Layer)); + tfc.serialization.SerializationMap.register(Activation$1); + var RepeatVector = (function (_super) { + __extends(RepeatVector, _super); + function RepeatVector(config) { + var _this = _super.call(this, config) || this; + _this.n = config.n; + _this.inputSpec = [{ ndim: 2 }]; + return _this; + } + RepeatVector.prototype.computeOutputShape = function (inputShape) { + return [inputShape[0], this.n, inputShape[1]]; + }; + RepeatVector.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = getExactlyOneTensor(inputs); + return repeat(inputs, _this.n); + }); + }; + RepeatVector.prototype.getConfig = function () { + var config = { + n: this.n, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + RepeatVector.className = 'RepeatVector'; + return RepeatVector; + }(Layer)); + tfc.serialization.SerializationMap.register(RepeatVector); + var Reshape = (function (_super) { + __extends(Reshape, _super); + function Reshape(config) { + var _this = _super.call(this, config) || this; + _this.targetShape = config.targetShape; + for (var i = 0; i < _this.targetShape.length; ++i) { + if (_this.isUnknown(_this.targetShape[i])) { + _this.targetShape[i] = null; + } + } + return _this; + } + Reshape.prototype.isUnknown = function (dim) { + return dim < 0 || dim == null; + }; + Reshape.prototype.fixUnknownDimension = function (inputShape, outputShape) { + var errorMsg = 'Total size of new array must be unchanged.'; + var finalShape = outputShape.slice(); + var known = 1; + var unknown = null; + for (var i = 0; i < finalShape.length; ++i) { + var dim = finalShape[i]; + if (this.isUnknown(dim)) { + if (unknown === null) { + unknown = i; + } + else { + throw new ValueError('Can only specifiy one unknown dimension.'); + } + } + else { + known *= dim; + } + } + var originalSize = arrayProd(inputShape); + if (unknown !== null) { + if (known === 0 || originalSize % known !== 0) { + throw new ValueError(errorMsg); + } + finalShape[unknown] = originalSize / known; + } + else if (originalSize !== known) { + throw new ValueError(errorMsg); + } + return finalShape; + }; + Reshape.prototype.computeOutputShape = function (inputShape) { + var anyUnknownDims = false; + for (var i = 0; i < inputShape.length; ++i) { + if (this.isUnknown(inputShape[i])) { + anyUnknownDims = true; + break; + } + } + if (anyUnknownDims) { + return inputShape.slice(0, 1).concat(this.targetShape); + } + else { + return inputShape.slice(0, 1).concat(this.fixUnknownDimension(inputShape.slice(1), this.targetShape)); + } + }; + Reshape.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = getExactlyOneTensor(inputs); + var inputShape = input.shape; + var outputShape = inputShape.slice(0, 1).concat(_this.fixUnknownDimension(inputShape.slice(1), _this.targetShape)); + return input.reshape(outputShape); + }); + }; + Reshape.prototype.getConfig = function () { + var config = { + targetShape: this.targetShape, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Reshape.className = 'Reshape'; + return Reshape; + }(Layer)); + tfc.serialization.SerializationMap.register(Reshape); + + var Embedding = (function (_super) { + __extends(Embedding, _super); + function Embedding(config) { + var _this = _super.call(this, config) || this; + _this.embeddings = null; + _this.DEFAULT_EMBEDDINGS_INITIALIZER = 'randomUniform'; + if (config.batchInputShape == null && config.inputShape == null) { + var batchSize = null; + if (config.batchSize != null) { + batchSize = config.batchSize; + } + if (config.inputLength == null) { + _this.batchInputShape = [batchSize, null]; + } + else { + _this.batchInputShape = + [batchSize].concat(toList(config.inputLength)); + } + } + _this.inputDim = config.inputDim; + _this.outputDim = config.outputDim; + _this.embeddingsInitializer = getInitializer(config.embeddingsInitializer || _this.DEFAULT_EMBEDDINGS_INITIALIZER); + _this.embeddingsRegularizer = getRegularizer(config.embeddingsRegularizer); + _this.activityRegularizer = getRegularizer(config.activityRegularizer); + _this.embeddingsConstraint = getConstraint(config.embeddingsConstraint); + _this.maskZero = config.maskZero; + _this.inputLength = config.inputLength; + return _this; + } + Embedding.prototype.build = function (inputShape) { + this.embeddings = this.addWeight('embeddings', [this.inputDim, this.outputDim], this.dtype, this.embeddingsInitializer, this.embeddingsRegularizer, true, this.embeddingsConstraint); + this.built = true; + }; + Embedding.prototype.warnOnIncompatibleInputShape = function (inputShape) { }; + Embedding.prototype.computeMask = function (inputs, mask) { + throw new NotImplementedError('computeMask has not been implemented for Embedding yet'); + }; + Embedding.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + if (this.inputLength == null) { + return inputShape.concat([this.outputDim]); + } + var inLens = toList(this.inputLength); + if (inLens.length !== inputShape.length - 1) { + throw new ValueError("\"inputLength\" is " + this.inputLength + ", but received " + + ("input shape has shape " + inputShape)); + } + else { + var i = 0; + for (var k = 0; k < inLens.length; ++k) { + var s1 = inLens[k]; + var s2 = inputShape[k + 1]; + if ((s1 != null) && (s2 != null) && (s1 !== s2)) { + throw new ValueError("\"inputLength\" is " + this.inputLength + ", but received " + + ("input shape has shape " + inputShape)); + } + else if (s1 == null) { + inLens[i] = s2; + } + i++; + } + } + return [inputShape[0]].concat(inLens, [this.outputDim]); + }; + Embedding.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + var input = getExactlyOneTensor(inputs); + if (input.dtype !== 'int32') { + input = cast(input, 'int32'); + } + var output = gather(_this.embeddings.read(), input.as1D()); + return output.reshape(getExactlyOneShape(_this.computeOutputShape(input.shape))); + }); + }; + Embedding.prototype.getConfig = function () { + var config = { + inputDim: this.inputDim, + outputDim: this.outputDim, + embeddingsInitializer: serializeInitializer(this.embeddingsInitializer), + embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer), + activityRegularizer: serializeRegularizer(this.activityRegularizer), + embeddingsConstraint: serializeConstraint(this.embeddingsConstraint), + maskZero: this.maskZero, + inputLength: this.inputLength + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Embedding.className = 'Embedding'; + return Embedding; + }(Layer)); + tfc.serialization.SerializationMap.register(Embedding); + + var Merge = (function (_super) { + __extends(Merge, _super); + function Merge(config) { + var _this = _super.call(this, config || {}) || this; + _this.supportsMasking = true; + return _this; + } + Merge.prototype.mergeFunction = function (inputs) { + throw new NotImplementedError(); + }; + Merge.prototype.computeElementwiseOpOutputShape = function (shape1, shape2) { + if (shape1 == null || shape2 == null) { + return null; + } + else if (shape1.length < shape2.length) { + return this.computeElementwiseOpOutputShape(shape2, shape1); + } + else if (shape2.length === 0) { + return shape1; + } + var outputShape = shape1.slice(0, shape1.length - shape2.length); + for (var k = 0; k < shape2.length; ++k) { + var i = shape1[shape1.length - shape2.length + k]; + var j = shape2[k]; + if (i == null || j == null || i < 0 || j < 0) { + outputShape.push(null); + } + else if (i === 1) { + outputShape.push(j); + } + else if (j === 1) { + outputShape.push(i); + } + else { + if (i !== j) { + throw new ValueError('Operands could not be broadcast together with shapes ' + + JSON.stringify(shape1) + ' ' + JSON.stringify(shape2)); + } + outputShape.push(i); + } + } + return outputShape; + }; + Merge.prototype.build = function (inputShape) { + if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) { + inputShape = [getExactlyOneShape(inputShape)]; + } + inputShape = inputShape; + if (inputShape.length < 2) { + throw new ValueError('A merge layer should be called on an Array of at least 2 inputs.' + + (" Got " + inputShape.length + " input(s).")); + } + var batchSizes = []; + for (var _i = 0, inputShape_1 = inputShape; _i < inputShape_1.length; _i++) { + var shape = inputShape_1[_i]; + if (shape != null && shape[0] !== null) { + batchSizes.push(shape[0]); + } + } + batchSizes = unique(batchSizes); + if (batchSizes.length > 1) { + throw new ValueError("Can not merge tensors with different batch sizes. " + + ("Got tensors with shapes: " + JSON.stringify(inputShape) + ".")); + } + var outputShape = inputShape[0] == null ? null : inputShape[0].slice(1); + for (var i = 1; i < inputShape.length; ++i) { + var shape = inputShape[i] == null ? null : inputShape[i].slice(1); + outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); + } + var allRanks = inputShape.map(function (shape) { return shape.length; }); + if (inputShape.indexOf(null) === -1 && + unique(allRanks).length === 1) { + this.reshapeRequired = false; + } + else { + this.reshapeRequired = true; + } + }; + Merge.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = inputs; + if (_this.reshapeRequired) { + var reshapedInputs = []; + var inputDims = inputs.map(function (input) { return input.rank; }); + if (inputDims.indexOf(null) === -1) { + var maxNDim = max(inputDims); + for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) { + var x = inputs_1[_i]; + var xNDim = x.rank; + for (var k = 0; k < maxNDim - xNDim; ++k) { + x = expandDims(x, 1); + } + reshapedInputs.push(x); + } + return _this.mergeFunction(reshapedInputs); + } + else { + var transposed = false; + for (var _a = 0, inputs_2 = inputs; _a < inputs_2.length; _a++) { + var x = inputs_2[_a]; + var xNDim = x.rank; + if (xNDim == null) { + var xShape = x.shape; + var batchSize = xShape[0]; + var newShape = xShape.slice(1).concat([batchSize]); + var xTransposed = x.reshape([batchSize].concat(arrayProd(xShape.slice(1)))); + xTransposed = tfc.transpose(xTransposed, [1, 0]); + xTransposed = xTransposed.reshape(newShape); + reshapedInputs.push(xTransposed); + transposed = true; + } + else if (xNDim > 1) { + var dims = range(1, xNDim).concat([0]); + reshapedInputs.push(tfc.transpose(x, dims)); + transposed = true; + } + else { + reshapedInputs.push(x); + } + } + var y = _this.mergeFunction(reshapedInputs); + var yNDim = y.rank; + if (transposed) { + if (yNDim == null) { + var yShape = y.shape; + var yNDim_1 = yShape.length; + var batchSize = yShape[yNDim_1 - 1]; + var newShape = [batchSize].concat(yShape.slice(0, yShape.length - 1)); + y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0]) + .reshape(newShape); + } + else if (yNDim > 1) { + var dims = [yNDim - 1].concat(range(0, yNDim - 1)); + y = tfc.transpose(y, dims); + } + } + return y; + } + } + else { + return _this.mergeFunction(inputs); + } + }); + }; + Merge.prototype.computeOutputShape = function (inputShape) { + inputShape = inputShape; + var outputShape; + if (inputShape[0] == null) { + outputShape = null; + } + else { + outputShape = inputShape[0].slice(1); + } + for (var i = 1; i < inputShape.length; ++i) { + var shape = inputShape[i] == null ? null : inputShape[i].slice(1); + outputShape = this.computeElementwiseOpOutputShape(outputShape, shape); + } + var batchSizes = []; + for (var _i = 0, inputShape_2 = inputShape; _i < inputShape_2.length; _i++) { + var shape = inputShape_2[_i]; + if (shape != null && shape[0] !== null) { + batchSizes.push(shape[0]); + } + } + batchSizes = unique(batchSizes); + if (batchSizes.length === 1) { + outputShape = batchSizes.concat(outputShape); + } + else { + outputShape = [null].concat(outputShape); + } + return outputShape; + }; + return Merge; + }(Layer)); + var Add = (function (_super) { + __extends(Add, _super); + function Add(config) { + return _super.call(this, config) || this; + } + Add.prototype.mergeFunction = function (inputs) { + return tfc.tidy(function () { + var output = tfc.zeros(inputs[0].shape); + for (var _i = 0, inputs_3 = inputs; _i < inputs_3.length; _i++) { + var input = inputs_3[_i]; + output = tfc.add(output, input); + } + return output; + }); + }; + Add.className = 'Add'; + return Add; + }(Merge)); + tfc.serialization.SerializationMap.register(Add); + var Multiply = (function (_super) { + __extends(Multiply, _super); + function Multiply(config) { + return _super.call(this, config) || this; + } + Multiply.prototype.mergeFunction = function (inputs) { + return tfc.tidy(function () { + var output = tfc.ones(inputs[0].shape); + for (var _i = 0, inputs_4 = inputs; _i < inputs_4.length; _i++) { + var input = inputs_4[_i]; + output = tfc.mul(output, input); + } + return output; + }); + }; + Multiply.className = 'Multiply'; + return Multiply; + }(Merge)); + tfc.serialization.SerializationMap.register(Multiply); + var Average = (function (_super) { + __extends(Average, _super); + function Average(config) { + return _super.call(this, config) || this; + } + Average.prototype.mergeFunction = function (inputs) { + return tfc.tidy(function () { + var output = tfc.zeros(inputs[0].shape); + for (var _i = 0, inputs_5 = inputs; _i < inputs_5.length; _i++) { + var input = inputs_5[_i]; + output = tfc.add(output, input); + } + return tfc.mul(getScalar(1 / inputs.length), output); + }); + }; + Average.className = 'Average'; + return Average; + }(Merge)); + tfc.serialization.SerializationMap.register(Average); + var Maximum = (function (_super) { + __extends(Maximum, _super); + function Maximum(config) { + return _super.call(this, config) || this; + } + Maximum.prototype.mergeFunction = function (inputs) { + return tfc.tidy(function () { + var output = inputs[0]; + for (var i = 1; i < inputs.length; ++i) { + output = tfc.maximum(output, inputs[i]); + } + return output; + }); + }; + Maximum.className = 'Maximum'; + return Maximum; + }(Merge)); + tfc.serialization.SerializationMap.register(Maximum); + var Minimum = (function (_super) { + __extends(Minimum, _super); + function Minimum(config) { + return _super.call(this, config) || this; + } + Minimum.prototype.mergeFunction = function (inputs) { + return tfc.tidy(function () { + var output = inputs[0]; + for (var i = 1; i < inputs.length; ++i) { + output = tfc.minimum(output, inputs[i]); + } + return output; + }); + }; + Minimum.className = 'Minimum'; + return Minimum; + }(Merge)); + tfc.serialization.SerializationMap.register(Minimum); + var Concatenate = (function (_super) { + __extends(Concatenate, _super); + function Concatenate(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_AXIS = -1; + if (config == null) { + config = {}; + } + _this.axis = config.axis == null ? _this.DEFAULT_AXIS : config.axis; + _this.supportsMasking = true; + _this.reshapeRequired = false; + return _this; + } + Concatenate.prototype.build = function (inputShape) { + if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) || + inputShape.length === 1) { + throw new ValueError('A `Concatenate` layer should be called on a list of at least 2 ' + + 'inputs'); + } + inputShape = inputShape; + var allNoneShape = true; + for (var _i = 0, inputShape_3 = inputShape; _i < inputShape_3.length; _i++) { + var shape = inputShape_3[_i]; + if (shape != null) { + allNoneShape = false; + break; + } + } + if (allNoneShape) { + return; + } + var shapeSet = []; + for (var i = 0; i < inputShape.length; ++i) { + var shapeWithoutConcatAxis = inputShape[i].slice(); + shapeWithoutConcatAxis.splice(this.axis, 1); + var exists = false; + for (var _a = 0, shapeSet_1 = shapeSet; _a < shapeSet_1.length; _a++) { + var shape = shapeSet_1[_a]; + if (tfc.util.arraysEqual(shape, shapeWithoutConcatAxis)) { + exists = true; + break; + } + } + if (!exists) { + shapeSet.push(shapeWithoutConcatAxis); + } + } + if (shapeSet.length > 1) { + throw new ValueError('A `Concatenate` layer requires inputs with matching shapes ' + + 'except for the concat axis. Got input shapes: ' + + JSON.stringify(inputShape)); + } + }; + Concatenate.prototype.mergeFunction = function (inputs) { + var _this = this; + return tfc.tidy(function () { + return concatenate(inputs, _this.axis); + }); + }; + Concatenate.prototype.computeOutputShape = function (inputShape) { + if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) { + throw new ValueError('A `Concatenate` layer should be called on a list of inputs.'); + } + var inputShapes = inputShape; + var outputShape = inputShapes[0].slice(); + var axis = this.axis < 0 ? outputShape.length + this.axis : this.axis; + for (var _i = 0, _a = inputShapes.slice(1); _i < _a.length; _i++) { + var shape = _a[_i]; + if (outputShape[axis] == null || shape[axis] == null) { + outputShape[axis] = null; + break; + } + outputShape[axis] += shape[axis]; + } + return outputShape; + }; + Concatenate.prototype.getConfig = function () { + var config = { + 'axis': this.axis, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Concatenate.className = 'Concatenate'; + return Concatenate; + }(Merge)); + tfc.serialization.SerializationMap.register(Concatenate); + + function batchNormalization(x, mean$$1, variance$$1, beta, gamma, epsilon) { + if (epsilon === void 0) { epsilon = 1e-3; } + var out; + if (x.rank === 2) { + out = tfc.batchNormalization2d(x, mean$$1, variance$$1, epsilon, gamma, beta); + } + else if (x.rank === 3) { + out = tfc.batchNormalization3d(x, mean$$1, variance$$1, epsilon, gamma, beta); + } + else if (x.rank === 4) { + out = tfc.batchNormalization4d(x, mean$$1, variance$$1, epsilon, gamma, beta); + } + else { + throw new NotImplementedError("batchNormalization is not implememnted for array of rank " + x.rank + " " + + "yet"); + } + return out; + } + function regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { + if (epsilon === void 0) { epsilon = 1e-3; } + return tfc.tidy(function () { + var meanAndVariance = tfc.moments(x, reductionAxes); + var mean$$1 = meanAndVariance.mean; + var variance$$1 = meanAndVariance.variance; + var normed = batchNormalization(x, mean$$1, variance$$1, beta, gamma, epsilon); + return [normed, mean$$1, variance$$1]; + }); + } + function broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { + if (epsilon === void 0) { epsilon = 1e-3; } + return tfc.tidy(function () { + var meanAndVariance = tfc.moments(x, reductionAxes); + var mean$$1 = meanAndVariance.mean; + var variance$$1 = meanAndVariance.variance; + var targetShape = []; + for (var _i = 0, _a = range(0, x.rank); _i < _a.length; _i++) { + var axis = _a[_i]; + if (reductionAxes.indexOf(axis) !== -1) { + targetShape.push(1); + } + else { + targetShape.push(x.shape[axis]); + } + } + var broadcastMean = mean$$1.reshape(targetShape); + var broadcastVariance = variance$$1.reshape(targetShape); + var broadcastGamma = gamma == null ? null : gamma.reshape(targetShape); + var broadcastBeta = beta == null ? null : beta.reshape(targetShape); + var normed = batchNormalization(x, broadcastMean, broadcastVariance, broadcastBeta, broadcastGamma, epsilon); + return [normed, mean$$1, variance$$1]; + }); + } + function normalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon) { + if (epsilon === void 0) { epsilon = 1e-3; } + if (tfc.util.arraysEqual(reductionAxes.slice().sort(), range(0, x.rank - 1))) { + return regularNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); + } + else { + return broadcastNormalizeBatchInTraining(x, gamma, beta, reductionAxes, epsilon); + } + } + var BatchNormalization = (function (_super) { + __extends(BatchNormalization, _super); + function BatchNormalization(config) { + var _this = _super.call(this, config) || this; + _this.supportsMasking = true; + _this.axis = config.axis == null ? -1 : config.axis; + _this.momentum = config.momentum == null ? 0.99 : config.momentum; + _this.epsilon = config.epsilon == null ? 1e-3 : config.epsilon; + _this.center = config.center == null ? true : config.center; + _this.scale = config.scale == null ? true : config.scale; + _this.betaInitializer = getInitializer(config.betaInitializer || 'zeros'); + _this.gammaInitializer = getInitializer(config.gammaInitializer || 'ones'); + _this.movingMeanInitializer = + getInitializer(config.movingMeanInitializer || 'zeros'); + _this.movingVarianceInitializer = + getInitializer(config.movingVarianceInitializer || 'ones'); + _this.betaConstraint = getConstraint(config.betaConstraint); + _this.gammaConstraint = getConstraint(config.gammaConstraint); + _this.betaRegularizer = getRegularizer(config.betaRegularizer); + _this.gammaRegularizer = getRegularizer(config.gammaRegularizer); + _this.stepCount = 0; + return _this; + } + BatchNormalization.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length); + var dim = inputShape[axis]; + if (dim == null) { + throw new ValueError("Axis " + axis + " of input tensor should have a defined dimension but " + + "the layer received an input with shape " + + (JSON.stringify(inputShape) + ".")); + } + this.inputSpec = + [new InputSpec({ ndim: inputShape.length, axes: (_a = {}, _a[axis] = dim, _a) })]; + var shape = [dim]; + if (this.scale) { + this.gamma = this.addWeight('gamma', shape, null, this.gammaInitializer, this.gammaRegularizer, true, this.gammaConstraint); + } + if (this.center) { + this.beta = this.addWeight('beta', shape, null, this.betaInitializer, this.betaRegularizer, true, this.betaConstraint); + } + this.movingMean = this.addWeight('moving_mean', shape, null, this.movingMeanInitializer, null, false); + this.movingVariance = this.addWeight('moving_variance', shape, null, this.movingVarianceInitializer, null, false); + this.built = true; + var _a; + }; + BatchNormalization.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + var training = kwargs['training'] == null ? false : kwargs['training']; + var input = getExactlyOneTensor(inputs); + var inputShape = input.shape; + var ndim = inputShape.length; + var reductionAxes = range(0, ndim); + var axis = _this.axis >= 0 ? _this.axis : (_this.axis + ndim); + reductionAxes.splice(axis, 1); + var broadcastShape = pyListRepeat(1, ndim); + broadcastShape[axis] = inputShape[axis]; + var sortedReductionAxes = reductionAxes.slice(); + sortedReductionAxes.sort(); + var needsBroadcasting = !tfc.util.arraysEqual(sortedReductionAxes, range(0, ndim).slice(0, ndim - 1)); + var normalizeInference = function () { + if (needsBroadcasting) { + var broadcastMovingMean = _this.movingMean.read().reshape(broadcastShape); + var broadcastMovingVariance = _this.movingVariance.read().reshape(broadcastShape); + var broadcastBeta = _this.center ? _this.beta.read().reshape(broadcastShape) : null; + var broadcastGamma = _this.scale ? _this.gamma.read().reshape(broadcastShape) : null; + return batchNormalization(input, broadcastMovingMean, broadcastMovingVariance, broadcastBeta, broadcastGamma, _this.epsilon); + } + else { + return batchNormalization(input, _this.movingMean.read(), _this.movingVariance.read(), _this.beta == null ? null : _this.beta.read(), _this.gamma == null ? null : _this.gamma.read(), _this.epsilon); + } + }; + if (!training) { + return normalizeInference(); + } + var _a = normalizeBatchInTraining(input, _this.gamma.read(), _this.beta.read(), reductionAxes, _this.epsilon), normedTraining = _a[0], mean$$1 = _a[1], variance$$1 = _a[2]; + var sampleSize = arrayProd(reductionAxes.map(function (axis) { return input.shape[axis]; })); + var varianceDebiased = variance$$1.mul(getScalar(sampleSize / (sampleSize - (1 + _this.epsilon)))); + var updateMovingMeanAndVariance = function () { + _this.stepCount++; + var newMovingMean = tfc.movingAverage(_this.movingMean.read(), mean$$1, _this.momentum, _this.stepCount); + _this.movingMean.write(newMovingMean); + var newMovingVariance = tfc.movingAverage(_this.movingVariance.read(), varianceDebiased, _this.momentum, _this.stepCount); + _this.movingVariance.write(newMovingVariance); + }; + updateMovingMeanAndVariance(); + return normedTraining; + }); + }; + BatchNormalization.prototype.getConfig = function () { + var config = { + axis: this.axis, + momentum: this.momentum, + epsilon: this.epsilon, + center: this.center, + scale: this.scale, + betaInitializer: serializeInitializer(this.betaInitializer), + gammaInitializer: serializeInitializer(this.gammaInitializer), + movingMeanInitializer: serializeInitializer(this.movingMeanInitializer), + movingVarianceInitializer: serializeInitializer(this.movingVarianceInitializer), + betaRegularizer: serializeRegularizer(this.betaRegularizer), + gammaRegularizer: serializeRegularizer(this.gammaRegularizer), + betaConstraint: serializeConstraint(this.betaConstraint), + gammaConstraint: serializeConstraint(this.gammaConstraint) + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + BatchNormalization.className = 'BatchNormalization'; + return BatchNormalization; + }(Layer)); + tfc.serialization.SerializationMap.register(BatchNormalization); + + function spatial2dPadding(x, padding, dataFormat) { + return tfc.tidy(function () { + if (x.rank !== 4) { + throw new ValueError("temporalPadding expects input tensor to be 4-D, but received a " + + (x.rank + "-D tensor.")); + } + if (padding == null) { + padding = [[1, 1], [1, 1]]; + } + if (padding.length !== 2 || padding[0].length !== 2 || + padding[1].length !== 2) { + throw new ValueError('spatial2dPadding expects `padding` to be an Array of two Arrays, ' + + 'each of which is an Array of two integers.'); + } + if (dataFormat == null) { + dataFormat = imageDataFormat(); + } + if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') { + throw new ValueError("Unknown data format: " + dataFormat + ". " + + "Supported data formats are 'channelsLast' and 'channelsFirst."); + } + var pattern; + if (dataFormat === 'channelsFirst') { + pattern = [[0, 0], [0, 0], padding[0], padding[1]]; + } + else { + pattern = [[0, 0], padding[0], padding[1], [0, 0]]; + } + return tfc.pad(x, pattern); + }); + } + var ZeroPadding2D = (function (_super) { + __extends(ZeroPadding2D, _super); + function ZeroPadding2D(config) { + var _this = this; + if (config == null) { + config = {}; + } + _this = _super.call(this, config) || this; + _this.dataFormat = + config.dataFormat == null ? imageDataFormat() : config.dataFormat; + if (config.padding == null) { + _this.padding = [[1, 1], [1, 1]]; + } + else if (typeof config.padding === 'number') { + _this.padding = + [[config.padding, config.padding], [config.padding, config.padding]]; + } + else { + config.padding = config.padding; + if (config.padding.length !== 2) { + throw new ValueError("ZeroPadding2D expects padding to be a length-2 array, but " + + ("received a length-" + config.padding.length + " array.")); + } + var heightPadding = void 0; + var widthPadding = void 0; + if (typeof config.padding[0] === 'number') { + heightPadding = + [config.padding[0], config.padding[0]]; + widthPadding = + [config.padding[1], config.padding[1]]; + } + else { + config.padding = config.padding; + if (config.padding[0].length !== 2) { + throw new ValueError("ZeroPadding2D expects height padding to be a length-2 array, " + + ("but received a length-" + config.padding[0].length + " array.")); + } + heightPadding = config.padding[0]; + if (config.padding[1].length !== 2) { + throw new ValueError("ZeroPadding2D expects width padding to be a length-2 array, " + + ("but received a length-" + config.padding[1].length + " array.")); + } + widthPadding = config.padding[1]; + } + _this.padding = [heightPadding, widthPadding]; + } + _this.inputSpec = [new InputSpec({ ndim: 4 })]; + return _this; + } + ZeroPadding2D.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var rows; + var cols; + if (this.dataFormat === 'channelsFirst') { + if (inputShape[2] != null && inputShape[2] >= 0) { + rows = inputShape[2] + this.padding[0][0] + this.padding[0][1]; + } + else { + rows = null; + } + if (inputShape[3] != null && inputShape[3] >= 0) { + cols = inputShape[3] + this.padding[1][0] + this.padding[1][1]; + } + else { + cols = null; + } + return [inputShape[0], inputShape[1], rows, cols]; + } + else { + if (inputShape[1] != null && inputShape[1] >= 0) { + rows = inputShape[1] + this.padding[0][0] + this.padding[0][1]; + } + else { + rows = null; + } + if (inputShape[2] != null && inputShape[2] >= 0) { + cols = inputShape[2] + this.padding[1][0] + this.padding[1][1]; + } + else { + cols = null; + } + return [inputShape[0], rows, cols, inputShape[3]]; + } + }; + ZeroPadding2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { return spatial2dPadding(getExactlyOneTensor(inputs), _this.padding, _this.dataFormat); }); + }; + ZeroPadding2D.prototype.getConfig = function () { + var config = { + padding: this.padding, + dataFormat: this.dataFormat, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + ZeroPadding2D.className = 'ZeroPadding2D'; + return ZeroPadding2D; + }(Layer)); + tfc.serialization.SerializationMap.register(ZeroPadding2D); + + function pool2d(x, poolSize, strides, padding, dataFormat, poolMode) { + return tfc.tidy(function () { + checkDataFormat(dataFormat); + checkPoolMode(poolMode); + checkPaddingMode(padding); + if (strides == null) { + strides = [1, 1]; + } + if (padding == null) { + padding = 'valid'; + } + if (dataFormat == null) { + dataFormat = imageDataFormat(); + } + if (poolMode == null) { + poolMode = 'max'; + } + x = preprocessConv2DInput(x, dataFormat); + var y; + var paddingString = (padding === 'same') ? 'same' : 'valid'; + if (poolMode === 'max') { + y = tfc.maxPool(x, poolSize, strides, paddingString); + } + else { + y = tfc.avgPool(x, poolSize, strides, paddingString); + } + if (dataFormat === 'channelsFirst') { + y = tfc.transpose(y, [0, 3, 1, 2]); + } + return y; + }); + } + var Pooling1D = (function (_super) { + __extends(Pooling1D, _super); + function Pooling1D(config) { + var _this = this; + if (config.poolSize == null) { + config.poolSize = 2; + } + _this = _super.call(this, config) || this; + if (typeof config.poolSize === 'number') { + _this.poolSize = [config.poolSize]; + } + else if (Array.isArray(config.poolSize) && + config.poolSize.length === 1 && + typeof config.poolSize[0] === 'number') { + _this.poolSize = config.poolSize; + } + else { + throw new ValueError("poolSize for 1D convolutional layer must be a number or an " + + "Array of a single number, but received " + + ("" + JSON.stringify(config.poolSize))); + } + if (config.strides == null) { + _this.strides = _this.poolSize; + } + else { + if (typeof config.strides === 'number') { + _this.strides = [config.strides]; + } + else if (Array.isArray(config.strides) && + config.strides.length === 1 && + typeof config.strides[0] === 'number') { + _this.strides = config.strides; + } + else { + throw new ValueError("strides for 1D convolutional layer must be a number or an " + + "Array of a single number, but received " + + ("" + JSON.stringify(config.strides))); + } + } + _this.padding = config.padding == null ? 'valid' : config.padding; + checkPaddingMode(_this.padding); + _this.inputSpec = [new InputSpec({ ndim: 3 })]; + return _this; + } + Pooling1D.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var length = convOutputLength(inputShape[1], this.poolSize[0], this.padding, this.strides[0]); + return [inputShape[0], length, inputShape[2]]; + }; + Pooling1D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + inputs = expandDims(getExactlyOneTensor(inputs), 2); + var output = _this.poolingFunction(getExactlyOneTensor(inputs), [_this.poolSize[0], 1], [_this.strides[0], 1], _this.padding, 'channelsLast'); + return tfc.squeeze(output, [2]); + }); + }; + Pooling1D.prototype.getConfig = function () { + var config = { + poolSize: this.poolSize, + padding: this.padding, + strides: this.strides, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + return Pooling1D; + }(Layer)); + var MaxPooling1D = (function (_super) { + __extends(MaxPooling1D, _super); + function MaxPooling1D(config) { + return _super.call(this, config) || this; + } + MaxPooling1D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { + checkDataFormat(dataFormat); + checkPaddingMode(padding); + return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); + }; + MaxPooling1D.className = 'MaxPooling1D'; + return MaxPooling1D; + }(Pooling1D)); + tfc.serialization.SerializationMap.register(MaxPooling1D); + var AveragePooling1D = (function (_super) { + __extends(AveragePooling1D, _super); + function AveragePooling1D(config) { + return _super.call(this, config) || this; + } + AveragePooling1D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { + checkDataFormat(dataFormat); + checkPaddingMode(padding); + return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); + }; + AveragePooling1D.className = 'AveragePooling1D'; + return AveragePooling1D; + }(Pooling1D)); + tfc.serialization.SerializationMap.register(AveragePooling1D); + var Pooling2D = (function (_super) { + __extends(Pooling2D, _super); + function Pooling2D(config) { + var _this = this; + if (config.poolSize == null) { + config.poolSize = [2, 2]; + } + _this = _super.call(this, config) || this; + _this.poolSize = Array.isArray(config.poolSize) ? + config.poolSize : + [config.poolSize, config.poolSize]; + if (config.strides == null) { + _this.strides = _this.poolSize; + } + else if (Array.isArray(config.strides)) { + if (config.strides.length !== 2) { + throw new ValueError("If the strides property of a 2D pooling layer is an Array, " + + "it is expected to have a length of 2, but received length " + + (config.strides.length + ".")); + } + _this.strides = config.strides; + } + else { + _this.strides = [config.strides, config.strides]; + } + _this.padding = config.padding == null ? 'valid' : config.padding; + _this.dataFormat = + config.dataFormat == null ? 'channelsLast' : config.dataFormat; + checkDataFormat(_this.dataFormat); + checkPaddingMode(_this.padding); + _this.inputSpec = [new InputSpec({ ndim: 4 })]; + return _this; + } + Pooling2D.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var rows = this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1]; + var cols = this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2]; + rows = + convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]); + cols = + convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]); + if (this.dataFormat === 'channelsFirst') { + return [inputShape[0], inputShape[1], rows, cols]; + } + else { + return [inputShape[0], rows, cols, inputShape[3]]; + } + }; + Pooling2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + _this.invokeCallHook(inputs, kwargs); + return _this.poolingFunction(getExactlyOneTensor(inputs), _this.poolSize, _this.strides, _this.padding, _this.dataFormat); + }); + }; + Pooling2D.prototype.getConfig = function () { + var config = { + poolSize: this.poolSize, + padding: this.padding, + strides: this.strides, + dataFormat: this.dataFormat + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + return Pooling2D; + }(Layer)); + var MaxPooling2D = (function (_super) { + __extends(MaxPooling2D, _super); + function MaxPooling2D(config) { + return _super.call(this, config) || this; + } + MaxPooling2D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { + checkDataFormat(dataFormat); + checkPaddingMode(padding); + return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max'); + }; + MaxPooling2D.className = 'MaxPooling2D'; + return MaxPooling2D; + }(Pooling2D)); + tfc.serialization.SerializationMap.register(MaxPooling2D); + var AveragePooling2D = (function (_super) { + __extends(AveragePooling2D, _super); + function AveragePooling2D(config) { + return _super.call(this, config) || this; + } + AveragePooling2D.prototype.poolingFunction = function (inputs, poolSize, strides, padding, dataFormat) { + checkDataFormat(dataFormat); + checkPaddingMode(padding); + return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg'); + }; + AveragePooling2D.className = 'AveragePooling2D'; + return AveragePooling2D; + }(Pooling2D)); + tfc.serialization.SerializationMap.register(AveragePooling2D); + var GlobalPooling1D = (function (_super) { + __extends(GlobalPooling1D, _super); + function GlobalPooling1D(config) { + var _this = _super.call(this, config) || this; + _this.inputSpec = [new InputSpec({ ndim: 3 })]; + return _this; + } + GlobalPooling1D.prototype.computeOutputShape = function (inputShape) { + return [inputShape[0], inputShape[2]]; + }; + GlobalPooling1D.prototype.call = function (inputs, kwargs) { + throw new NotImplementedError(); + }; + return GlobalPooling1D; + }(Layer)); + var GlobalAveragePooling1D = (function (_super) { + __extends(GlobalAveragePooling1D, _super); + function GlobalAveragePooling1D(config) { + return _super.call(this, config) || this; + } + GlobalAveragePooling1D.prototype.call = function (inputs, kwargs) { + return tfc.tidy(function () { + var input = getExactlyOneTensor(inputs); + return tfc.mean(input, 1); + }); + }; + GlobalAveragePooling1D.className = 'GlobalAveragePooling1D'; + return GlobalAveragePooling1D; + }(GlobalPooling1D)); + tfc.serialization.SerializationMap.register(GlobalAveragePooling1D); + var GlobalMaxPooling1D = (function (_super) { + __extends(GlobalMaxPooling1D, _super); + function GlobalMaxPooling1D(config) { + return _super.call(this, config) || this; + } + GlobalMaxPooling1D.prototype.call = function (inputs, kwargs) { + return tfc.tidy(function () { + var input = getExactlyOneTensor(inputs); + return tfc.max(input, 1); + }); + }; + GlobalMaxPooling1D.className = 'GlobalMaxPooling1D'; + return GlobalMaxPooling1D; + }(GlobalPooling1D)); + tfc.serialization.SerializationMap.register(GlobalMaxPooling1D); + var GlobalPooling2D = (function (_super) { + __extends(GlobalPooling2D, _super); + function GlobalPooling2D(config) { + var _this = _super.call(this, config) || this; + _this.dataFormat = + config.dataFormat == null ? 'channelsLast' : config.dataFormat; + checkDataFormat(_this.dataFormat); + _this.inputSpec = [new InputSpec({ ndim: 4 })]; + return _this; + } + GlobalPooling2D.prototype.computeOutputShape = function (inputShape) { + inputShape = inputShape; + if (this.dataFormat === 'channelsLast') { + return [inputShape[0], inputShape[3]]; + } + else { + return [inputShape[0], inputShape[1]]; + } + }; + GlobalPooling2D.prototype.call = function (inputs, kwargs) { + throw new NotImplementedError(); + }; + GlobalPooling2D.prototype.getConfig = function () { + var config = { dataFormat: this.dataFormat }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + return GlobalPooling2D; + }(Layer)); + var GlobalAveragePooling2D = (function (_super) { + __extends(GlobalAveragePooling2D, _super); + function GlobalAveragePooling2D() { + return _super !== null && _super.apply(this, arguments) || this; + } + GlobalAveragePooling2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + var input = getExactlyOneTensor(inputs); + if (_this.dataFormat === 'channelsLast') { + return tfc.mean(input, [1, 2]); + } + else { + return tfc.mean(input, [2, 3]); + } + }); + }; + GlobalAveragePooling2D.className = 'GlobalAveragePooling2D'; + return GlobalAveragePooling2D; + }(GlobalPooling2D)); + tfc.serialization.SerializationMap.register(GlobalAveragePooling2D); + var GlobalMaxPooling2D = (function (_super) { + __extends(GlobalMaxPooling2D, _super); + function GlobalMaxPooling2D() { + return _super !== null && _super.apply(this, arguments) || this; + } + GlobalMaxPooling2D.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + var input = getExactlyOneTensor(inputs); + if (_this.dataFormat === 'channelsLast') { + return tfc.max(input, [1, 2]); + } + else { + return tfc.max(input, [2, 3]); + } + }); + }; + GlobalMaxPooling2D.className = 'GlobalMaxPooling2D'; + return GlobalMaxPooling2D; + }(GlobalPooling2D)); + tfc.serialization.SerializationMap.register(GlobalMaxPooling2D); + + function standardizeArgs(inputs, initialState, constants, numConstants) { + if (Array.isArray(inputs)) { + if (initialState != null || constants != null) { + throw new ValueError('When inputs is an array, neither initialState or constants ' + + 'should be provided'); + } + if (numConstants != null) { + constants = inputs.slice(inputs.length - numConstants, inputs.length); + inputs = inputs.slice(0, inputs.length - numConstants); + } + if (inputs.length > 1) { + initialState = inputs.slice(1, inputs.length); + } + inputs = inputs[0]; + } + function toListOrNull(x) { + if (x == null || Array.isArray(x)) { + return x; + } + else { + return [x]; + } + } + initialState = toListOrNull(initialState); + constants = toListOrNull(constants); + return { inputs: inputs, initialState: initialState, constants: constants }; + } + function rnn(stepFunction, inputs, initialStates, goBackwards, mask, constants, unroll, inputLength) { + if (goBackwards === void 0) { goBackwards = false; } + if (unroll === void 0) { unroll = false; } + var ndim = inputs.shape.length; + if (ndim < 3) { + throw new ValueError("Input should be at least 3D, but is " + ndim + "D."); + } + var axes = [1, 0].concat(range(2, ndim)); + inputs = tfc.transpose(inputs, axes); + if (mask != null) { + throw new NotImplementedError('The rnn() function of the deeplearn.js backend does not support ' + + 'masking yet.'); + } + if (constants != null) { + throw new NotImplementedError('The rnn() functoin of the deeplearn.js backend does not support ' + + 'constants yet.'); + } + if (unroll) { + console.warn('Backend rnn(): the unroll = true option is not applicable to the ' + + 'imperative deeplearn.js backend.'); + } + if (goBackwards) { + inputs = tfc.reverse(inputs, 0); + } + var outputs; + var lastOutput; + var states = initialStates; + var timeSteps = inputs.shape[0]; + for (var t = 0; t < timeSteps; ++t) { + var currentInput = sliceAlongFirstAxis(inputs, t, 1); + currentInput = currentInput.reshape(currentInput.shape.slice(1)); + var stepOutputs = stepFunction(currentInput, states); + lastOutput = stepOutputs[0]; + if (t === 0) { + outputs = lastOutput.reshape([1].concat(lastOutput.shape)); + } + else { + outputs = concatAlongFirstAxis(outputs, lastOutput.reshape([1].concat(lastOutput.shape))); + } + states = stepOutputs[1]; + } + return [ + lastOutput, + tfc.transpose(outputs, [1, 0].concat(range(2, outputs.shape.length))), + states + ]; + } + var RNN = (function (_super) { + __extends(RNN, _super); + function RNN(config) { + var _this = _super.call(this, config) || this; + var cell; + if (config.cell == null) { + throw new ValueError('cell property is missing for the constructor of RNN.'); + } + else if (Array.isArray(config.cell)) { + cell = new StackedRNNCells({ cells: config.cell }); + } + else { + cell = config.cell; + } + if (cell.stateSize == null) { + throw new ValueError('The RNN cell should have an attribute `stateSize` (tuple of ' + + 'integers, one integer per RNN state).'); + } + _this.cell = cell; + _this.returnSequences = + config.returnSequences == null ? false : config.returnSequences; + _this.returnState = config.returnState == null ? false : config.returnState; + _this.goBackwards = config.goBackwards == null ? false : config.goBackwards; + _this._stateful = config.stateful == null ? false : config.stateful; + _this.unroll = config.unroll == null ? false : config.unroll; + _this.supportsMasking = true; + _this.inputSpec = [new InputSpec({ ndim: 3 })]; + _this.stateSpec = null; + _this.states = null; + _this.numConstants = null; + return _this; + } + RNN.prototype.getStates = function () { + if (this.states == null) { + var numStates = Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1; + return range(0, numStates).map(function (x) { return null; }); + } + else { + return this.states; + } + }; + RNN.prototype.setStates = function (states) { + this.states = states; + }; + RNN.prototype.computeOutputShape = function (inputShape) { + if (isArrayOfShapes(inputShape)) { + inputShape = inputShape[0]; + } + inputShape = inputShape; + var stateSize = this.cell.stateSize; + if (!Array.isArray(stateSize)) { + stateSize = [stateSize]; + } + var outputDim = stateSize[0]; + var outputShape; + if (this.returnSequences) { + outputShape = [inputShape[0], inputShape[1], outputDim]; + } + else { + outputShape = [inputShape[0], outputDim]; + } + if (this.returnState) { + var stateShape = []; + for (var _i = 0, stateSize_1 = stateSize; _i < stateSize_1.length; _i++) { + var dim = stateSize_1[_i]; + stateShape.push([inputShape[0], dim]); + } + return [outputShape].concat(stateShape); + } + else { + return outputShape; + } + }; + RNN.prototype.computeMask = function (inputs, mask) { + throw new NotImplementedError('computeMask has not been implemented for RNN yet'); + }; + RNN.prototype.build = function (inputShape) { + var constantShape = null; + if (this.numConstants != null) { + throw new NotImplementedError('Constants support is not implemented in RNN yet.'); + } + if (isArrayOfShapes(inputShape)) { + inputShape = inputShape[0]; + } + inputShape = inputShape; + var batchSize = this.stateful ? inputShape[0] : null; + var inputDim = inputShape[inputShape.length - 1]; + this.inputSpec[0] = new InputSpec({ shape: [batchSize, null, inputDim] }); + var stepInputShape = [inputShape[0]].concat(inputShape.slice(2)); + if (constantShape != null) { + throw new NotImplementedError('Constants support is not implemented in RNN yet.'); + } + else { + this.cell.build(stepInputShape); + } + var stateSize; + if (Array.isArray(this.cell.stateSize)) { + stateSize = this.cell.stateSize; + } + else { + stateSize = [this.cell.stateSize]; + } + if (this.stateSpec != null) { + if (!tfc.util.arraysEqual(this.stateSpec.map(function (spec) { return spec.shape[spec.shape.length - 1]; }), stateSize)) { + throw new ValueError("An initialState was passed that is not compatible with " + + ("cell.stateSize. Received stateSpec=" + this.stateSpec + "; ") + + ("However cell.stateSize is " + this.cell.stateSize)); + } + } + else { + this.stateSpec = + stateSize.map(function (dim) { return new InputSpec({ shape: [null, dim] }); }); + } + if (this.stateful) { + throw new NotImplementedError('stateful RNN layer is not implemented yet'); + } + }; + RNN.prototype.resetStates = function (states) { + var _this = this; + tfc.tidy(function () { + if (!_this.stateful) { + throw new AttributeError('Cannot call resetState() on an RNN Layer that is not stateful.'); + } + var batchSize = _this.inputSpec[0].shape[0]; + if (batchSize == null) { + throw new ValueError('If an RNN is stateful, it needs to know its batch size. Specify ' + + 'the batch size of your input tensors: \n' + + '- If using a Sequential model, specify the batch size by ' + + 'passing a `batchInputShape` option to your first layer.\n' + + '- If using the functional API, specify the batch size by ' + + 'passing a `batchShape` option to your Input layer.'); + } + if (_this.states == null) { + if (Array.isArray(_this.cell.stateSize)) { + _this.states = + _this.cell.stateSize.map(function (dim) { return tfc.zeros([batchSize, dim]); }); + } + else { + _this.states = [tfc.zeros([batchSize, _this.cell.stateSize])]; + } + } + else if (states == null) { + if (Array.isArray(_this.cell.stateSize)) { + _this.states = + _this.cell.stateSize.map(function (dim) { return tfc.zeros([batchSize, dim]); }); + } + else { + _this.states[0] = tfc.zeros([batchSize, _this.cell.stateSize]); + } + } + else { + if (!Array.isArray(states)) { + states = [states]; + } + if (states.length !== _this.states.length) { + throw new ValueError("Layer " + _this.name + " expects " + _this.states.length + " state(s), " + + ("but it received " + states.length + " state value(s). Input ") + + ("received: " + states)); + } + for (var index = 0; index < _this.states.length; ++index) { + var value = states[index]; + var dim = Array.isArray(_this.cell.stateSize) ? + _this.cell.stateSize[index] : + _this.cell.stateSize; + var expectedShape = [batchSize, dim]; + if (!tfc.util.arraysEqual(value.shape, expectedShape)) { + throw new ValueError("State " + index + " is incompatible with layer " + _this.name + ": " + + ("expected shape=" + expectedShape + ", received shape=" + value.shape)); + } + _this.states[index] = value; + } + } + }); + }; + RNN.prototype.apply = function (inputs, kwargs) { + var initialState = kwargs == null ? null : kwargs['initialState']; + var constants = kwargs == null ? null : kwargs['constants']; + if (kwargs == null) { + kwargs = {}; + } + var standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); + inputs = standardized.inputs; + initialState = standardized.initialState; + constants = standardized.constants; + var additionalInputs = []; + var additionalSpecs = []; + if (initialState != null) { + kwargs['initialState'] = initialState; + additionalInputs = additionalInputs.concat(initialState); + this.stateSpec = []; + for (var _i = 0, initialState_1 = initialState; _i < initialState_1.length; _i++) { + var state = initialState_1[_i]; + this.stateSpec.push(new InputSpec({ shape: state.shape })); + } + additionalSpecs = additionalSpecs.concat(this.stateSpec); + } + if (constants != null) { + kwargs['constants'] = constants; + additionalInputs = additionalInputs.concat(constants); + this.numConstants = constants.length; + } + var isTensor = additionalInputs[0] instanceof SymbolicTensor; + if (isTensor) { + var fullInput = [inputs].concat(additionalInputs); + var fullInputSpec = this.inputSpec.concat(additionalSpecs); + var originalInputSpec = this.inputSpec; + this.inputSpec = fullInputSpec; + var output = _super.prototype.apply.call(this, fullInput, kwargs); + this.inputSpec = originalInputSpec; + return output; + } + else { + return _super.prototype.apply.call(this, inputs, kwargs); + } + }; + RNN.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + var mask = kwargs == null ? null : kwargs['mask']; + var training = kwargs == null ? null : kwargs['training']; + var initialState = kwargs == null ? null : kwargs['initialState']; + inputs = getExactlyOneTensor(inputs); + if (initialState == null) { + if (_this.stateful) { + throw new NotImplementedError('stateful RNN layer is not implemented yet.'); + } + else { + initialState = _this.getInitialState(inputs); + } + } + if (mask != null) { + throw new NotImplementedError('Masking is not implemented for RNN yet'); + } + var numStates = Array.isArray(_this.cell.stateSize) ? _this.cell.stateSize.length : 1; + if (initialState.length !== numStates) { + throw new ValueError("RNN Layer has " + numStates + " state(s) but was passed " + + (initialState.length + " initial state(s).")); + } + var inputShape = inputs.shape; + var timesteps = inputShape[1]; + if (_this.unroll) { + console.warn('Ignoring unroll = true for RNN layer, due to imperative backend.'); + } + var cellCallKwargs = { training: training }; + var step = function (inputs, states) { + var outputs = _this.cell.call([inputs].concat(states), cellCallKwargs); + return [outputs[0], outputs.slice(1)]; + }; + var rnnOutputs = rnn(step, inputs, initialState, _this.goBackwards, null, null, _this.unroll, timesteps); + var lastOutput = rnnOutputs[0]; + var outputs = rnnOutputs[1]; + var states = rnnOutputs[2]; + if (_this.stateful) { + throw new NotImplementedError('stateful RNN layer is not implemented yet'); + } + var output = _this.returnSequences ? outputs : lastOutput; + if (_this.returnState) { + return [output].concat(states); + } + else { + return output; + } + }); + }; + RNN.prototype.getInitialState = function (inputs) { + var _this = this; + return tfc.tidy(function () { + var initialState = tfc.zeros(inputs.shape); + initialState = tfc.sum(initialState, [1, 2]); + initialState = expandDims(initialState); + if (Array.isArray(_this.cell.stateSize)) { + return _this.cell.stateSize.map(function (dim) { return dim > 1 ? tile(initialState, [1, dim]) : initialState; }); + } + else { + return _this.cell.stateSize > 1 ? + [tile(initialState, [1, _this.cell.stateSize])] : + [initialState]; + } + }); + }; + Object.defineProperty(RNN.prototype, "trainableWeights", { + get: function () { + if (!this.trainable) { + return []; + } + return this.cell.trainableWeights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RNN.prototype, "nonTrainableWeights", { + get: function () { + if (!this.trainable) { + return this.cell.weights; + } + return this.cell.nonTrainableWeights; + }, + enumerable: true, + configurable: true + }); + RNN.prototype.getConfig = function () { + var config = { + returnSequences: this.returnSequences, + returnState: this.returnState, + goBackwards: this.goBackwards, + stateful: this.stateful, + unroll: this.unroll, + }; + if (this.numConstants != null) { + config.numConstants = this.numConstants; + } + var cellConfig = this.cell.getConfig(); + config.cell = { + className: this.cell.getClassName(), + config: cellConfig, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + RNN.className = 'RNN'; + return RNN; + }(Layer)); + tfc.serialization.SerializationMap.register(RNN); + var RNNCell = (function (_super) { + __extends(RNNCell, _super); + function RNNCell() { + return _super !== null && _super.apply(this, arguments) || this; + } + return RNNCell; + }(Layer)); + var SimpleRNNCell = (function (_super) { + __extends(SimpleRNNCell, _super); + function SimpleRNNCell(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_ACTIVATION = 'tanh'; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + _this.units = config.units; + _this.activation = getActivation(config.activation == null ? _this.DEFAULT_ACTIVATION : + config.activation); + _this.useBias = config.useBias == null ? true : config.useBias; + _this.kernelInitializer = getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.recurrentInitializer = getInitializer(config.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); + _this.biasInitializer = + getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.kernelRegularizer = getRegularizer(config.kernelRegularizer); + _this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer); + _this.biasRegularizer = getRegularizer(config.biasRegularizer); + _this.kernelConstraint = getConstraint(config.kernelConstraint); + _this.recurrentConstraint = getConstraint(config.recurrentConstraint); + _this.biasConstraint = getConstraint(config.biasConstraint); + _this.dropout = min([1, max([0, config.dropout == null ? 0 : config.dropout])]); + _this.recurrentDropout = min([ + 1, + max([0, config.recurrentDropout == null ? 0 : config.recurrentDropout]) + ]); + _this.stateSize = _this.units; + _this.dropoutMask = null; + _this.recurrentDropoutMask = null; + return _this; + } + SimpleRNNCell.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + this.kernel = this.addWeight('kernel', [inputShape[inputShape.length - 1], this.units], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.units], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + else { + this.bias = null; + } + this.built = true; + }; + SimpleRNNCell.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = inputs; + if (inputs.length !== 2) { + throw new ValueError("SimpleRNNCell expects 2 input Tensors, got " + inputs.length + "."); + } + var prevOutput = inputs[1]; + inputs = inputs[0]; + var training = kwargs['training'] == null ? false : kwargs['training']; + if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { + _this.dropoutMask = generateDropoutMask(function () { return tfc.onesLike(inputs); }, _this.dropout, training); + } + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && + _this.recurrentDropoutMask == null) { + _this.recurrentDropoutMask = + generateDropoutMask(function () { return tfc.onesLike(prevOutput); }, _this.recurrentDropout, training); + } + var h; + var dpMask = _this.dropoutMask; + var recDpMask = _this.recurrentDropoutMask; + if (dpMask != null) { + h = dot(tfc.mul(inputs, dpMask), _this.kernel.read()); + } + else { + h = dot(inputs, _this.kernel.read()); + } + if (_this.bias != null) { + h = biasAdd(h, _this.bias.read()); + } + if (recDpMask != null) { + prevOutput = tfc.mul(prevOutput, recDpMask); + } + var output = tfc.add(h, dot(prevOutput, _this.recurrentKernel.read())); + if (_this.activation != null) { + output = _this.activation.apply(output); + } + return [output, output]; + }); + }; + SimpleRNNCell.prototype.getConfig = function () { + var config = { + units: this.units, + activation: serializeActivation(this.activation), + useBias: this.useBias, + kernelInitializer: serializeInitializer(this.kernelInitializer), + recurrentInitializer: serializeInitializer(this.recurrentInitializer), + biasInitializer: serializeInitializer(this.biasInitializer), + kernelRegularizer: serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: serializeRegularizer(this.biasRegularizer), + activityRegularizer: serializeRegularizer(this.activityRegularizer), + kernelConstraint: serializeConstraint(this.kernelConstraint), + recurrentConstraint: serializeConstraint(this.recurrentConstraint), + biasConstraint: serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + SimpleRNNCell.className = 'SimpleRNNCell'; + return SimpleRNNCell; + }(RNNCell)); + tfc.serialization.SerializationMap.register(SimpleRNNCell); + var SimpleRNN = (function (_super) { + __extends(SimpleRNN, _super); + function SimpleRNN(config) { + var _this = this; + config.cell = new SimpleRNNCell(config); + _this = _super.call(this, config) || this; + return _this; + } + SimpleRNN.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + if (_this.cell.dropoutMask != null) { + tfc.dispose(_this.cell.dropoutMask); + _this.cell.dropoutMask = null; + } + if (_this.cell.recurrentDropoutMask != null) { + tfc.dispose(_this.cell.recurrentDropoutMask); + _this.cell.recurrentDropoutMask = null; + } + var mask = kwargs == null ? null : kwargs['mask']; + var training = kwargs == null ? null : kwargs['training']; + var initialState = kwargs == null ? null : kwargs['initialState']; + return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); + }); + }; + Object.defineProperty(SimpleRNN.prototype, "units", { + get: function () { + return this.cell.units; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "activation", { + get: function () { + return this.cell.activation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "useBias", { + get: function () { + return this.cell.useBias; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "kernelInitializer", { + get: function () { + return this.cell.kernelInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "recurrentInitializer", { + get: function () { + return this.cell.recurrentInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "biasInitializer", { + get: function () { + return this.cell.biasInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "kernelRegularizer", { + get: function () { + return this.cell.kernelRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "recurrentRegularizer", { + get: function () { + return this.cell.recurrentRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "biasRegularizer", { + get: function () { + return this.cell.biasRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "kernelConstraint", { + get: function () { + return this.cell.kernelConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "recurrentConstraint", { + get: function () { + return this.cell.recurrentConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "biasConstraint", { + get: function () { + return this.cell.biasConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "dropout", { + get: function () { + return this.cell.dropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SimpleRNN.prototype, "recurrentDropout", { + get: function () { + return this.cell.recurrentDropout; + }, + enumerable: true, + configurable: true + }); + SimpleRNN.prototype.getConfig = function () { + var config = { + units: this.units, + activation: serializeActivation(this.activation), + useBias: this.useBias, + kernelInitializer: serializeInitializer(this.kernelInitializer), + recurrentInitializer: serializeInitializer(this.recurrentInitializer), + biasInitializer: serializeInitializer(this.biasInitializer), + kernelRegularizer: serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: serializeRegularizer(this.biasRegularizer), + activityRegularizer: serializeRegularizer(this.activityRegularizer), + kernelConstraint: serializeConstraint(this.kernelConstraint), + recurrentConstraint: serializeConstraint(this.recurrentConstraint), + biasConstraint: serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + }; + var baseConfig = _super.prototype.getConfig.call(this); + delete baseConfig['cell']; + Object.assign(config, baseConfig); + return config; + }; + SimpleRNN.className = 'SimpleRNN'; + return SimpleRNN; + }(RNN)); + tfc.serialization.SerializationMap.register(SimpleRNN); + var GRUCell = (function (_super) { + __extends(GRUCell, _super); + function GRUCell(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_ACTIVATION = 'tanh'; + _this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + _this.units = config.units; + _this.activation = getActivation(config.activation === undefined ? _this.DEFAULT_ACTIVATION : + config.activation); + _this.recurrentActivation = getActivation(config.recurrentActivation === undefined ? + _this.DEFAULT_RECURRENT_ACTIVATION : + config.recurrentActivation); + _this.useBias = config.useBias == null ? true : config.useBias; + _this.kernelInitializer = getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.recurrentInitializer = getInitializer(config.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); + _this.biasInitializer = + getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.kernelRegularizer = getRegularizer(config.kernelRegularizer); + _this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer); + _this.biasRegularizer = getRegularizer(config.biasRegularizer); + _this.kernelConstraint = getConstraint(config.kernelConstraint); + _this.recurrentConstraint = getConstraint(config.recurrentConstraint); + _this.biasConstraint = getConstraint(config.biasConstraint); + _this.dropout = min([1, max([0, config.dropout == null ? 0 : config.dropout])]); + _this.recurrentDropout = min([ + 1, + max([0, config.recurrentDropout == null ? 0 : config.recurrentDropout]) + ]); + _this.implementation = config.implementation; + _this.stateSize = _this.units; + _this.dropoutMask = null; + _this.recurrentDropoutMask = null; + return _this; + } + GRUCell.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var inputDim = inputShape[inputShape.length - 1]; + this.kernel = this.addWeight('kernel', [inputDim, this.units * 3], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 3], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + if (this.useBias) { + this.bias = this.addWeight('bias', [this.units * 3], null, this.biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + else { + this.bias = null; + } + this.built = true; + }; + GRUCell.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = inputs; + if (inputs.length !== 2) { + throw new ValueError("GRUCell expects 2 input Tensors (inputs, h, c), got " + + (inputs.length + ".")); + } + var training = kwargs['training'] == null ? false : kwargs['training']; + var hTMinus1 = inputs[1]; + inputs = inputs[0]; + if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { + _this.dropoutMask = generateDropoutMask(function () { return tfc.onesLike(inputs); }, _this.dropout, training, 3); + } + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && + _this.recurrentDropoutMask == null) { + _this.recurrentDropoutMask = + generateDropoutMask(function () { return tfc.onesLike(hTMinus1); }, _this.recurrentDropout, training, 3); + } + var dpMask = _this.dropoutMask; + var recDpMask = _this.recurrentDropoutMask; + var z; + var r; + var hh; + if (_this.implementation === 1) { + var kernelZ = sliceAlongLastAxis(_this.kernel.read(), 0, _this.units); + var kernelR = sliceAlongLastAxis(_this.kernel.read(), _this.units, _this.units); + var kernelH = sliceAlongLastAxis(_this.kernel.read(), _this.units * 2, _this.units); + var recurrentKernelZ = sliceAlongLastAxis(_this.recurrentKernel.read(), 0, _this.units); + var recurrentKernelR = sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units, _this.units); + var recurrentKernelH = sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units * 2, _this.units); + var inputsZ = void 0, inputsR = void 0, inputsH = void 0; + if (0 < _this.dropout && _this.dropout < 1) { + inputsZ = tfc.mul(inputs, dpMask[0]); + inputsR = tfc.mul(inputs, dpMask[1]); + inputsH = tfc.mul(inputs, dpMask[2]); + } + else { + inputsZ = inputs; + inputsR = inputs; + inputsH = inputs; + } + var xZ = dot(inputsZ, kernelZ); + var xR = dot(inputsR, kernelR); + var xH = dot(inputsH, kernelH); + if (_this.useBias) { + var biasZ = sliceAlongFirstAxis(_this.bias.read(), 0, _this.units); + var biasR = sliceAlongFirstAxis(_this.bias.read(), _this.units, _this.units); + var biasH = sliceAlongFirstAxis(_this.bias.read(), _this.units * 2, _this.units); + xZ = biasAdd(xZ, biasZ); + xR = biasAdd(xR, biasR); + xH = biasAdd(xH, biasH); + } + var hTMinus1Z = void 0; + var hTMinus1R = void 0; + var hTMinus1H = void 0; + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { + hTMinus1Z = tfc.mul(hTMinus1, recDpMask[0]); + hTMinus1R = tfc.mul(hTMinus1, recDpMask[1]); + hTMinus1H = tfc.mul(hTMinus1, recDpMask[2]); + } + else { + hTMinus1Z = hTMinus1; + hTMinus1R = hTMinus1; + hTMinus1H = hTMinus1; + } + z = _this.recurrentActivation.apply(tfc.add(xZ, dot(hTMinus1Z, recurrentKernelZ))); + r = _this.recurrentActivation.apply(tfc.add(xR, dot(hTMinus1R, recurrentKernelR))); + hh = _this.activation.apply(tfc.add(xH, dot(tfc.mul(r, hTMinus1H), recurrentKernelH))); + } + else { + if (0 < _this.dropout && _this.dropout < 1) { + inputs = tfc.mul(inputs, dpMask[0]); + } + var matrixX = dot(inputs, _this.kernel.read()); + if (_this.useBias) { + matrixX = biasAdd(matrixX, _this.bias.read()); + } + if (0 < _this.dropout && _this.dropout < 1) { + hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); + } + var matrixInner = dot(hTMinus1, sliceAlongLastAxis(_this.recurrentKernel.read(), 0, 2 * _this.units)); + var xZ = sliceAlongLastAxis(matrixX, 0, _this.units); + var xR = sliceAlongLastAxis(matrixX, _this.units, _this.units); + var recurrentZ = sliceAlongLastAxis(matrixInner, 0, _this.units); + var recurrentR = sliceAlongLastAxis(matrixInner, _this.units, _this.units); + z = _this.recurrentActivation.apply(tfc.add(xZ, recurrentZ)); + r = _this.recurrentActivation.apply(tfc.add(xR, recurrentR)); + var xH = sliceAlongLastAxis(matrixX, 2 * _this.units, _this.units); + var recurrentH = dot(tfc.mul(r, hTMinus1), sliceAlongLastAxis(_this.recurrentKernel.read(), 2 * _this.units, _this.units)); + hh = _this.activation.apply(tfc.add(xH, recurrentH)); + } + var h = tfc.add(tfc.mul(z, hTMinus1), tfc.mul(tfc.add(getScalar(1), tfc.neg(z)), hh)); + return [h, h]; + }); + }; + GRUCell.prototype.getConfig = function () { + var config = { + units: this.units, + activation: serializeActivation(this.activation), + recurrentActivation: serializeActivation(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: serializeInitializer(this.kernelInitializer), + recurrentInitializer: serializeInitializer(this.recurrentInitializer), + biasInitializer: serializeInitializer(this.biasInitializer), + kernelRegularizer: serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: serializeRegularizer(this.biasRegularizer), + activityRegularizer: serializeRegularizer(this.activityRegularizer), + kernelConstraint: serializeConstraint(this.kernelConstraint), + recurrentConstraint: serializeConstraint(this.recurrentConstraint), + biasConstraint: serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + GRUCell.className = 'GRUCell'; + return GRUCell; + }(RNNCell)); + tfc.serialization.SerializationMap.register(GRUCell); + var GRU = (function (_super) { + __extends(GRU, _super); + function GRU(config) { + var _this = this; + if (config.implementation === 0) { + console.warn('`implementation=0` has been deprecated, and now defaults to ' + + '`implementation=1`. Please update your layer call.'); + } + config.cell = new GRUCell(config); + _this = _super.call(this, config) || this; + return _this; + } + GRU.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + if (_this.cell.dropoutMask != null) { + tfc.dispose(_this.cell.dropoutMask); + _this.cell.dropoutMask = null; + } + if (_this.cell.recurrentDropoutMask != null) { + tfc.dispose(_this.cell.recurrentDropoutMask); + _this.cell.recurrentDropoutMask = null; + } + var mask = kwargs == null ? null : kwargs['mask']; + var training = kwargs == null ? null : kwargs['training']; + var initialState = kwargs == null ? null : kwargs['initialState']; + return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); + }); + }; + Object.defineProperty(GRU.prototype, "units", { + get: function () { + return this.cell.units; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "activation", { + get: function () { + return this.cell.activation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentActivation", { + get: function () { + return this.cell.recurrentActivation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "useBias", { + get: function () { + return this.cell.useBias; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "kernelInitializer", { + get: function () { + return this.cell.kernelInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentInitializer", { + get: function () { + return this.cell.recurrentInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "biasInitializer", { + get: function () { + return this.cell.biasInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "kernelRegularizer", { + get: function () { + return this.cell.kernelRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentRegularizer", { + get: function () { + return this.cell.recurrentRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "biasRegularizer", { + get: function () { + return this.cell.biasRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "kernelConstraint", { + get: function () { + return this.cell.kernelConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentConstraint", { + get: function () { + return this.cell.recurrentConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "biasConstraint", { + get: function () { + return this.cell.biasConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "dropout", { + get: function () { + return this.cell.dropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "recurrentDropout", { + get: function () { + return this.cell.recurrentDropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GRU.prototype, "implementation", { + get: function () { + return this.cell.implementation; + }, + enumerable: true, + configurable: true + }); + GRU.prototype.getConfig = function () { + var config = { + units: this.units, + activation: serializeActivation(this.activation), + recurrentActivation: serializeActivation(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: serializeInitializer(this.kernelInitializer), + recurrentInitializer: serializeInitializer(this.recurrentInitializer), + biasInitializer: serializeInitializer(this.biasInitializer), + kernelRegularizer: serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: serializeRegularizer(this.biasRegularizer), + activityRegularizer: serializeRegularizer(this.activityRegularizer), + kernelConstraint: serializeConstraint(this.kernelConstraint), + recurrentConstraint: serializeConstraint(this.recurrentConstraint), + biasConstraint: serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation, + }; + var baseConfig = _super.prototype.getConfig.call(this); + delete baseConfig['cell']; + Object.assign(config, baseConfig); + return config; + }; + GRU.fromConfig = function (cls, config) { + if (config['implmentation'] === 0) { + config['implementation'] = 1; + } + return new cls(config); + }; + GRU.className = 'GRU'; + return GRU; + }(RNN)); + tfc.serialization.SerializationMap.register(GRU); + var LSTMCell = (function (_super) { + __extends(LSTMCell, _super); + function LSTMCell(config) { + var _this = _super.call(this, config) || this; + _this.DEFAULT_ACTIVATION = 'tanh'; + _this.DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid'; + _this.DEFAULT_KERNEL_INITIALIZER = 'glorotNormal'; + _this.DEFAULT_RECURRENT_INITIALIZER = 'orthogonal'; + _this.DEFAULT_BIAS_INITIALIZER = 'zeros'; + _this.units = config.units; + _this.activation = getActivation(config.activation === undefined ? _this.DEFAULT_ACTIVATION : + config.activation); + _this.recurrentActivation = getActivation(config.recurrentActivation === undefined ? + _this.DEFAULT_RECURRENT_ACTIVATION : + config.recurrentActivation); + _this.useBias = config.useBias == null ? true : config.useBias; + _this.kernelInitializer = getInitializer(config.kernelInitializer || _this.DEFAULT_KERNEL_INITIALIZER); + _this.recurrentInitializer = getInitializer(config.recurrentInitializer || _this.DEFAULT_RECURRENT_INITIALIZER); + _this.biasInitializer = + getInitializer(config.biasInitializer || _this.DEFAULT_BIAS_INITIALIZER); + _this.unitForgetBias = config.unitForgetBias; + _this.kernelRegularizer = getRegularizer(config.kernelRegularizer); + _this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer); + _this.biasRegularizer = getRegularizer(config.biasRegularizer); + _this.kernelConstraint = getConstraint(config.kernelConstraint); + _this.recurrentConstraint = getConstraint(config.recurrentConstraint); + _this.biasConstraint = getConstraint(config.biasConstraint); + _this.dropout = min([1, max([0, config.dropout == null ? 0 : config.dropout])]); + _this.recurrentDropout = min([ + 1, + max([0, config.recurrentDropout == null ? 0 : config.recurrentDropout]) + ]); + _this.implementation = config.implementation; + _this.stateSize = [_this.units, _this.units]; + _this.dropoutMask = null; + _this.recurrentDropoutMask = null; + return _this; + } + LSTMCell.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var inputDim = inputShape[inputShape.length - 1]; + this.kernel = this.addWeight('kernel', [inputDim, this.units * 4], null, this.kernelInitializer, this.kernelRegularizer, true, this.kernelConstraint); + this.recurrentKernel = this.addWeight('recurrent_kernel', [this.units, this.units * 4], null, this.recurrentInitializer, this.recurrentRegularizer, true, this.recurrentConstraint); + var biasInitializer; + if (this.useBias) { + if (this.unitForgetBias) { + var capturedBiasInit_1 = this.biasInitializer; + var capturedUnits_1 = this.units; + biasInitializer = new (_a = (function (_super) { + __extends(CustomInit, _super); + function CustomInit() { + return _super !== null && _super.apply(this, arguments) || this; + } + CustomInit.prototype.apply = function (shape, dtype) { + var bI = capturedBiasInit_1.apply([capturedUnits_1]); + var bF = (new Ones()).apply([capturedUnits_1]); + var bCAndH = capturedBiasInit_1.apply([capturedUnits_1 * 2]); + return concatAlongFirstAxis(concatAlongFirstAxis(bI, bF), bCAndH); + }; + return CustomInit; + }(Initializer)), + _a.className = 'CustomInit', + _a)(); + } + else { + biasInitializer = this.biasInitializer; + } + this.bias = this.addWeight('bias', [this.units * 4], null, biasInitializer, this.biasRegularizer, true, this.biasConstraint); + } + else { + this.bias = null; + } + this.built = true; + var _a; + }; + LSTMCell.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + var training = kwargs['training'] == null ? false : kwargs['training']; + inputs = inputs; + if (inputs.length !== 3) { + throw new ValueError("LSTMCell expects 3 input Tensors (inputs, h, c), got " + + (inputs.length + ".")); + } + var hTMinus1 = inputs[1]; + var cTMinus1 = inputs[2]; + inputs = inputs[0]; + if (0 < _this.dropout && _this.dropout < 1 && _this.dropoutMask == null) { + _this.dropoutMask = generateDropoutMask(function () { return tfc.onesLike(inputs); }, _this.dropout, training, 4); + } + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1 && + _this.recurrentDropoutMask == null) { + _this.recurrentDropoutMask = + generateDropoutMask(function () { return tfc.onesLike(hTMinus1); }, _this.recurrentDropout, training, 4); + } + var dpMask = _this.dropoutMask; + var recDpMask = _this.recurrentDropoutMask; + var i; + var f; + var c; + var o; + if (_this.implementation === 1) { + var kernelI = sliceAlongLastAxis(_this.kernel.read(), 0, _this.units); + var kernelF = sliceAlongLastAxis(_this.kernel.read(), _this.units, _this.units); + var kernelC = sliceAlongLastAxis(_this.kernel.read(), _this.units * 2, _this.units); + var kernelO = sliceAlongLastAxis(_this.kernel.read(), _this.units * 3, _this.units); + var recurrentKernelI = sliceAlongLastAxis(_this.recurrentKernel.read(), 0, _this.units); + var recurrentKernelF = sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units, _this.units); + var recurrentKernelC = sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units * 2, _this.units); + var recurrentKernelO = sliceAlongLastAxis(_this.recurrentKernel.read(), _this.units * 3, _this.units); + var inputsI = void 0, inputsF = void 0, inputsC = void 0, inputsO = void 0; + if (0 < _this.dropout && _this.dropout < 1) { + inputsI = tfc.mul(inputs, dpMask[0]); + inputsF = tfc.mul(inputs, dpMask[1]); + inputsC = tfc.mul(inputs, dpMask[2]); + inputsO = tfc.mul(inputs, dpMask[3]); + } + else { + inputsI = inputs; + inputsF = inputs; + inputsC = inputs; + inputsO = inputs; + } + var xI = dot(inputsI, kernelI); + var xF = dot(inputsF, kernelF); + var xC = dot(inputsC, kernelC); + var xO = dot(inputsO, kernelO); + if (_this.useBias) { + var biasI = sliceAlongFirstAxis(_this.bias.read(), 0, _this.units); + var biasF = sliceAlongFirstAxis(_this.bias.read(), _this.units, _this.units); + var biasC = sliceAlongFirstAxis(_this.bias.read(), _this.units * 2, _this.units); + var biasO = sliceAlongFirstAxis(_this.bias.read(), _this.units * 3, _this.units); + xI = biasAdd(xI, biasI); + xF = biasAdd(xF, biasF); + xC = biasAdd(xC, biasC); + xO = biasAdd(xO, biasO); + } + var hTMinus1I = void 0, hTMinus1F = void 0, hTMinus1C = void 0, hTMinus1O = void 0; + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { + hTMinus1I = tfc.mul(hTMinus1, recDpMask[0]); + hTMinus1F = tfc.mul(hTMinus1, recDpMask[1]); + hTMinus1C = tfc.mul(hTMinus1, recDpMask[2]); + hTMinus1O = tfc.mul(hTMinus1, recDpMask[3]); + } + else { + hTMinus1I = hTMinus1; + hTMinus1F = hTMinus1; + hTMinus1C = hTMinus1; + hTMinus1O = hTMinus1; + } + i = _this.recurrentActivation.apply(tfc.add(xI, dot(hTMinus1I, recurrentKernelI))); + f = _this.recurrentActivation.apply(tfc.add(xF, dot(hTMinus1F, recurrentKernelF))); + c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, _this.activation.apply(tfc.add(xC, dot(hTMinus1C, recurrentKernelC))))); + o = _this.recurrentActivation.apply(tfc.add(xO, dot(hTMinus1O, recurrentKernelO))); + } + else { + if (0 < _this.dropout && _this.dropout < 1) { + inputs = tfc.mul(inputs, dpMask[0]); + } + var z = dot(inputs, _this.kernel.read()); + if (0 < _this.recurrentDropout && _this.recurrentDropout < 1) { + hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]); + } + z = tfc.add(z, dot(hTMinus1, _this.recurrentKernel.read())); + if (_this.useBias) { + z = biasAdd(z, _this.bias.read()); + } + var z0 = sliceAlongLastAxis(z, 0, _this.units); + var z1 = sliceAlongLastAxis(z, _this.units, _this.units); + var z2 = sliceAlongLastAxis(z, _this.units * 2, _this.units); + var z3 = sliceAlongLastAxis(z, _this.units * 3, _this.units); + i = _this.recurrentActivation.apply(z0); + f = _this.recurrentActivation.apply(z1); + c = tfc.add(tfc.mul(f, cTMinus1), tfc.mul(i, _this.activation.apply(z2))); + o = _this.recurrentActivation.apply(z3); + } + var h = tfc.mul(o, _this.activation.apply(c)); + return [h, h, c]; + }); + }; + LSTMCell.prototype.getConfig = function () { + var config = { + units: this.units, + activation: serializeActivation(this.activation), + recurrentActivation: serializeActivation(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: serializeInitializer(this.kernelInitializer), + recurrentInitializer: serializeInitializer(this.recurrentInitializer), + biasInitializer: serializeInitializer(this.biasInitializer), + unitForgetBias: this.unitForgetBias, + kernelRegularizer: serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: serializeRegularizer(this.biasRegularizer), + activityRegularizer: serializeRegularizer(this.activityRegularizer), + kernelConstraint: serializeConstraint(this.kernelConstraint), + recurrentConstraint: serializeConstraint(this.recurrentConstraint), + biasConstraint: serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + LSTMCell.className = 'LSTMCell'; + return LSTMCell; + }(RNNCell)); + tfc.serialization.SerializationMap.register(LSTMCell); + var LSTM = (function (_super) { + __extends(LSTM, _super); + function LSTM(config) { + var _this = this; + if (config.implementation === 0) { + console.warn('`implementation=0` has been deprecated, and now defaults to ' + + '`implementation=1`. Please update your layer call.'); + } + config.cell = new LSTMCell(config); + _this = _super.call(this, config) || this; + return _this; + } + LSTM.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + if (_this.cell.dropoutMask != null) { + tfc.dispose(_this.cell.dropoutMask); + _this.cell.dropoutMask = null; + } + if (_this.cell.recurrentDropoutMask != null) { + tfc.dispose(_this.cell.recurrentDropoutMask); + _this.cell.recurrentDropoutMask = null; + } + var mask = kwargs == null ? null : kwargs['mask']; + var training = kwargs == null ? null : kwargs['training']; + var initialState = kwargs == null ? null : kwargs['initialState']; + return _super.prototype.call.call(_this, inputs, { mask: mask, training: training, initialState: initialState }); + }); + }; + Object.defineProperty(LSTM.prototype, "units", { + get: function () { + return this.cell.units; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "activation", { + get: function () { + return this.cell.activation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentActivation", { + get: function () { + return this.cell.recurrentActivation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "useBias", { + get: function () { + return this.cell.useBias; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "kernelInitializer", { + get: function () { + return this.cell.kernelInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentInitializer", { + get: function () { + return this.cell.recurrentInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "biasInitializer", { + get: function () { + return this.cell.biasInitializer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "unitForgetBias", { + get: function () { + return this.cell.unitForgetBias; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "kernelRegularizer", { + get: function () { + return this.cell.kernelRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentRegularizer", { + get: function () { + return this.cell.recurrentRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "biasRegularizer", { + get: function () { + return this.cell.biasRegularizer; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "kernelConstraint", { + get: function () { + return this.cell.kernelConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentConstraint", { + get: function () { + return this.cell.recurrentConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "biasConstraint", { + get: function () { + return this.cell.biasConstraint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "dropout", { + get: function () { + return this.cell.dropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "recurrentDropout", { + get: function () { + return this.cell.recurrentDropout; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(LSTM.prototype, "implementation", { + get: function () { + return this.cell.implementation; + }, + enumerable: true, + configurable: true + }); + LSTM.prototype.getConfig = function () { + var config = { + units: this.units, + activation: serializeActivation(this.activation), + recurrentActivation: serializeActivation(this.recurrentActivation), + useBias: this.useBias, + kernelInitializer: serializeInitializer(this.kernelInitializer), + recurrentInitializer: serializeInitializer(this.recurrentInitializer), + biasInitializer: serializeInitializer(this.biasInitializer), + unitForgetBias: this.unitForgetBias, + kernelRegularizer: serializeRegularizer(this.kernelRegularizer), + recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), + biasRegularizer: serializeRegularizer(this.biasRegularizer), + activityRegularizer: serializeRegularizer(this.activityRegularizer), + kernelConstraint: serializeConstraint(this.kernelConstraint), + recurrentConstraint: serializeConstraint(this.recurrentConstraint), + biasConstraint: serializeConstraint(this.biasConstraint), + dropout: this.dropout, + recurrentDropout: this.recurrentDropout, + implementation: this.implementation, + }; + var baseConfig = _super.prototype.getConfig.call(this); + delete baseConfig['cell']; + Object.assign(config, baseConfig); + return config; + }; + LSTM.fromConfig = function (cls, config) { + if (config['implmentation'] === 0) { + config['implementation'] = 1; + } + return new cls(config); + }; + LSTM.className = 'LSTM'; + return LSTM; + }(RNN)); + tfc.serialization.SerializationMap.register(LSTM); + var StackedRNNCells = (function (_super) { + __extends(StackedRNNCells, _super); + function StackedRNNCells(config) { + var _this = _super.call(this, config) || this; + _this.cells = config.cells; + return _this; + } + Object.defineProperty(StackedRNNCells.prototype, "stateSize", { + get: function () { + var stateSize = []; + for (var _i = 0, _a = this.cells.slice().reverse(); _i < _a.length; _i++) { + var cell = _a[_i]; + if (Array.isArray(cell.stateSize)) { + stateSize.push.apply(stateSize, cell.stateSize); + } + else { + stateSize.push(cell.stateSize); + } + } + return stateSize; + }, + enumerable: true, + configurable: true + }); + StackedRNNCells.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = inputs; + var states = inputs.slice(1); + var nestedStates = []; + for (var _i = 0, _a = _this.cells.slice().reverse(); _i < _a.length; _i++) { + var cell = _a[_i]; + if (Array.isArray(cell.stateSize)) { + nestedStates.push(states.splice(0, cell.stateSize.length)); + } + else { + nestedStates.push(states.splice(0, 1)); + } + } + nestedStates.reverse(); + var newNestedStates = []; + var callInputs; + for (var i = 0; i < _this.cells.length; ++i) { + var cell = _this.cells[i]; + states = nestedStates[i]; + if (i === 0) { + callInputs = [inputs[0]].concat(states); + } + else { + callInputs = [callInputs[0]].concat(states); + } + callInputs = cell.call(callInputs, kwargs); + newNestedStates.push(callInputs.slice(1)); + } + states = []; + for (var _b = 0, _c = newNestedStates.slice().reverse(); _b < _c.length; _b++) { + var cellStates = _c[_b]; + states.push.apply(states, cellStates); + } + return [callInputs[0]].concat(states); + }); + }; + StackedRNNCells.prototype.build = function (inputShape) { + if (isArrayOfShapes(inputShape)) { + inputShape = inputShape[0]; + } + inputShape = inputShape; + var outputDim; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + cell.build(inputShape); + if (Array.isArray(cell.stateSize)) { + outputDim = cell.stateSize[0]; + } + else { + outputDim = cell.stateSize; + } + inputShape = [inputShape[0], outputDim]; + } + this.built = true; + }; + StackedRNNCells.prototype.getConfig = function () { + var cellConfigs = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + cellConfigs.push({ + 'className': this.getClassName(), + 'config': cell.getConfig(), + }); + } + var config = { 'cells': cellConfigs }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + StackedRNNCells.fromConfig = function (cls, config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + var cells = []; + for (var _i = 0, _a = config['cells']; _i < _a.length; _i++) { + var cellConfig = _a[_i]; + cells.push(deserialize(cellConfig, customObjects)); + } + return new cls({ cells: cells }); + }; + Object.defineProperty(StackedRNNCells.prototype, "trainableWeights", { + get: function () { + if (!this.trainable) { + return []; + } + var weights = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + weights.push.apply(weights, cell.trainableWeights); + } + return weights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StackedRNNCells.prototype, "nonTrainableWeights", { + get: function () { + var weights = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + weights.push.apply(weights, cell.nonTrainableWeights); + } + if (!this.trainable) { + var trainableWeights = []; + for (var _b = 0, _c = this.cells; _b < _c.length; _b++) { + var cell = _c[_b]; + trainableWeights.push.apply(trainableWeights, cell.trainableWeights); + } + return trainableWeights.concat(weights); + } + return weights; + }, + enumerable: true, + configurable: true + }); + StackedRNNCells.prototype.getWeights = function () { + var weights = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + weights.push.apply(weights, cell.weights); + } + return batchGetValue(weights); + }; + StackedRNNCells.prototype.setWeights = function (weights) { + var tuples = []; + for (var _i = 0, _a = this.cells; _i < _a.length; _i++) { + var cell = _a[_i]; + var numParams = cell.weights.length; + var inputWeights = weights.splice(numParams); + for (var i = 0; i < cell.weights.length; ++i) { + tuples.push([cell.weights[i], inputWeights[i]]); + } + } + batchSetValue(tuples); + }; + StackedRNNCells.className = 'StackedRNNCells'; + return StackedRNNCells; + }(RNNCell)); + tfc.serialization.SerializationMap.register(StackedRNNCells); + function generateDropoutMask(ones, rate, training, count) { + if (training === void 0) { training = null; } + if (count === void 0) { count = 1; } + function droppedInputs() { + return dropout(ones(), getScalar(rate)); + } + if (count > 1) { + var mask = []; + for (var i = 0; i < count; i++) { + mask.push(inTrainPhase(droppedInputs, ones, training)); + } + mask.forEach(function (m) { return tfc.keep(m); }); + return mask; + } + else { + return tfc.keep(inTrainPhase(droppedInputs, ones, training)); + } + } + + var Wrapper = (function (_super) { + __extends(Wrapper, _super); + function Wrapper(config) { + var _this = _super.call(this, config) || this; + _this.layer = config.layer; + return _this; + } + Wrapper.prototype.build = function (inputShape) { + this.built = true; + }; + Object.defineProperty(Wrapper.prototype, "trainable", { + get: function () { + if (this.layer != null) { + return this.layer.trainable; + } + else { + return false; + } + }, + set: function (value) { + if (this.layer != null) { + this.layer.trainable = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Wrapper.prototype, "trainableWeights", { + get: function () { + return this.layer.trainableWeights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Wrapper.prototype, "nonTrainableWeights", { + get: function () { + return this.layer.nonTrainableWeights; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Wrapper.prototype, "updates", { + get: function () { + return this.layer._updates; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Wrapper.prototype, "losses", { + get: function () { + return this.layer.losses; + }, + enumerable: true, + configurable: true + }); + Wrapper.prototype.getWeights = function () { + return this.layer.getWeights(); + }; + Wrapper.prototype.setWeights = function (weights) { + this.layer.setWeights(weights); + }; + Wrapper.prototype.getConfig = function () { + var config = { + 'layer': { + 'className': this.layer.getClassName(), + 'config': this.layer.getConfig(), + } + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Wrapper.fromConfig = function (cls, config, customObjects) { + if (customObjects === void 0) { customObjects = {}; } + var layerConfig = config['layer']; + var layer = deserialize(layerConfig, customObjects); + delete config['layer']; + var newConfig = { layer: layer }; + Object.assign(newConfig, config); + return new cls(newConfig); + }; + return Wrapper; + }(Layer)); + var TimeDistributed = (function (_super) { + __extends(TimeDistributed, _super); + function TimeDistributed(config) { + var _this = _super.call(this, config) || this; + _this.supportsMasking = true; + return _this; + } + TimeDistributed.prototype.build = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + if (inputShape.length < 3) { + throw new ValueError("TimeDistributed layer expects an input shape >= 3D, but received " + + ("input shape " + JSON.stringify(inputShape))); + } + this.inputSpec = [{ shape: inputShape }]; + var childInputShape = [inputShape[0]].concat(inputShape.slice(2)); + if (!this.layer.built) { + this.layer.build(childInputShape); + this.layer.built = true; + } + _super.prototype.build.call(this, inputShape); + }; + TimeDistributed.prototype.computeOutputShape = function (inputShape) { + inputShape = getExactlyOneShape(inputShape); + var childInputShape = [inputShape[0]].concat(inputShape.slice(2)); + var childOutputShape = this.layer.computeOutputShape(childInputShape); + var timesteps = inputShape[1]; + return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1)); + }; + TimeDistributed.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + inputs = getExactlyOneTensor(inputs); + var step = function (inputs, states) { + var output = _this.layer.call(inputs, kwargs); + return [output, []]; + }; + var rnnOutputs = rnn(step, inputs, [], false, null, null, false, inputs.shape[1]); + var y = rnnOutputs[1]; + return y; + }); + }; + TimeDistributed.className = 'TimeDistributed'; + return TimeDistributed; + }(Wrapper)); + tfc.serialization.SerializationMap.register(TimeDistributed); + var VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave']; + function checkBidirectionalMergeMode(value) { + checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value); + } + var Bidirectional = (function (_super) { + __extends(Bidirectional, _super); + function Bidirectional(config) { + var _this = _super.call(this, config) || this; + var layerConfig = config.layer.getConfig(); + _this.forwardLayer = + deserialize({ className: config.layer.getClassName(), config: layerConfig }); + layerConfig['goBackwards'] = + layerConfig['goBackwards'] === true ? false : true; + _this.backwardLayer = + deserialize({ className: config.layer.getClassName(), config: layerConfig }); + _this.forwardLayer.name = 'forward_' + _this.forwardLayer.name; + _this.backwardLayer.name = 'backward_' + _this.backwardLayer.name; + checkBidirectionalMergeMode(config.mergeMode); + _this.mergeMode = config.mergeMode; + if (config.weights) { + throw new NotImplementedError('weights support is not implemented for Bidirectional layer yet.'); + } + _this._stateful = config.layer.stateful; + _this.returnSequences = config.layer.returnSequences; + _this.returnState = config.layer.returnState; + _this.supportsMasking = true; + _this._trainable = true; + _this.inputSpec = config.layer.inputSpec; + _this.numConstants = null; + return _this; + } + Object.defineProperty(Bidirectional.prototype, "trainable", { + get: function () { + return this._trainable; + }, + set: function (value) { + this._trainable = value; + if (this.forwardLayer != null) { + this.forwardLayer.trainable = value; + } + if (this.backwardLayer != null) { + this.backwardLayer.trainable = value; + } + }, + enumerable: true, + configurable: true + }); + Bidirectional.prototype.getWeights = function () { + return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights()); + }; + Bidirectional.prototype.setWeights = function (weights) { + var numWeights = weights.length; + var numeightsOver2 = Math.floor(numWeights / 2); + this.forwardLayer.setWeights(weights.slice(0, numeightsOver2)); + this.backwardLayer.setWeights(weights.slice(numeightsOver2)); + }; + Bidirectional.prototype.computeOutputShape = function (inputShape) { + var layerShapes = this.forwardLayer.computeOutputShape(inputShape); + if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) { + layerShapes = [layerShapes]; + } + layerShapes = layerShapes; + var outputShape; + var outputShapes; + var stateShape; + if (this.returnState) { + stateShape = layerShapes.slice(1); + outputShape = layerShapes[0]; + } + else { + outputShape = layerShapes[0]; + } + outputShape = outputShape; + if (this.mergeMode === 'concat') { + outputShape[outputShape.length - 1] *= 2; + outputShapes = [outputShape]; + } + else if (this.mergeMode == null) { + outputShapes = [outputShape, outputShape.slice()]; + } + else { + outputShapes = [outputShape]; + } + if (this.returnState) { + if (this.mergeMode == null) { + return outputShapes.concat(stateShape).concat(stateShape.slice()); + } + return [outputShape].concat(stateShape).concat(stateShape.slice()); + } + return singletonOrArray(outputShapes); + }; + Bidirectional.prototype.apply = function (inputs, kwargs) { + var initialState = kwargs == null ? null : kwargs['initialState']; + var constants = kwargs == null ? null : kwargs['constants']; + if (kwargs == null) { + kwargs = {}; + } + var standardized = standardizeArgs(inputs, initialState, constants, this.numConstants); + inputs = standardized.inputs; + initialState = standardized.initialState; + constants = standardized.constants; + if (Array.isArray(inputs)) { + initialState = inputs.slice(1); + inputs = inputs[0]; + } + if ((initialState == null || initialState.length === 0) && + constants == null) { + return _super.prototype.apply.call(this, inputs, kwargs); + } + var additionalInputs = []; + var additionalSpecs = []; + if (initialState != null) { + var numStates = initialState.length; + if (numStates % 2 > 0) { + throw new ValueError('When passing `initialState` to a Bidrectional RNN, ' + + 'the state should be an Array containing the states of ' + + 'the underlying RNNs.'); + } + kwargs['initialState'] = initialState; + additionalInputs.push.apply(additionalInputs, initialState); + var stateSpecs = initialState + .map(function (state) { return new InputSpec({ shape: state.shape }); }); + this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2); + this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2); + additionalSpecs.push.apply(additionalSpecs, stateSpecs); + } + if (constants != null) { + throw new NotImplementedError('Support for constants in Bidirectional layers is not ' + + 'implemented yet.'); + } + var isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor; + for (var _i = 0, additionalInputs_1 = additionalInputs; _i < additionalInputs_1.length; _i++) { + var tensor = additionalInputs_1[_i]; + if (tensor instanceof SymbolicTensor !== isSymbolicTensor) { + throw new ValueError('The initial state of a Bidirectional layer cannot be ' + + 'specified as a mix of symbolic and non-symbolic tensors'); + } + } + if (isSymbolicTensor) { + var fullInput = [inputs].concat(additionalInputs); + var fullInputSpec = this.inputSpec.concat(additionalSpecs); + var originalInputSpec = this.inputSpec; + this.inputSpec = fullInputSpec; + var output = _super.prototype.apply.call(this, fullInput, kwargs); + this.inputSpec = originalInputSpec; + return output; + } + else { + return _super.prototype.apply.call(this, inputs, kwargs); + } + }; + Bidirectional.prototype.call = function (inputs, kwargs) { + var _this = this; + return tfc.tidy(function () { + if (kwargs['mask'] != null) { + throw new NotImplementedError('The support for masking is not implemented for ' + + 'Bidirectional layers yet.'); + } + var initialState = kwargs['initialState']; + var y; + var yRev; + if (initialState == null) { + y = _this.forwardLayer.call(inputs, kwargs); + yRev = _this.backwardLayer.call(inputs, kwargs); + } + else { + var forwardState = initialState.slice(0, initialState.length / 2); + var backwardState = initialState.slice(initialState.length / 2); + y = _this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: forwardState })); + yRev = _this.forwardLayer.call(inputs, Object.assign(kwargs, { initialState: backwardState })); + } + var states; + if (_this.returnState) { + if (Array.isArray(y)) { + states = y.slice(1).concat(yRev.slice(1)); + } + y = y[0]; + yRev = yRev[0]; + } + if (_this.returnSequences) { + yRev = tfc.reverse(yRev, 1); + } + var output; + if (_this.mergeMode === 'concat') { + output = concatenate([y, yRev]); + } + else if (_this.mergeMode === 'sum') { + output = tfc.add(y, yRev); + } + else if (_this.mergeMode === 'ave') { + output = tfc.mul(getScalar(0.5), tfc.add(y, yRev)); + } + else if (_this.mergeMode === 'mul') { + output = tfc.mul(y, yRev); + } + else if (_this.mergeMode == null) { + output = [y, yRev]; + } + if (_this.returnState) { + if (_this.mergeMode == null) { + return output.concat(states); + } + return [output].concat(states); + } + return output; + }); + }; + Bidirectional.prototype.resetStates = function (states) { + this.forwardLayer.resetStates(); + this.backwardLayer.resetStates(); + }; + Bidirectional.prototype.build = function (inputShape) { + var _this = this; + nameScope(this.forwardLayer.name, function () { + _this.forwardLayer.build(inputShape); + }); + nameScope(this.backwardLayer.name, function () { + _this.backwardLayer.build(inputShape); + }); + this.built = true; + }; + Object.defineProperty(Bidirectional.prototype, "trainableWeights", { + get: function () { + return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bidirectional.prototype, "nonTrainableWeights", { + get: function () { + return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights); + }, + enumerable: true, + configurable: true + }); + Bidirectional.prototype.getConfig = function () { + var config = { + 'mergeMode': this.mergeMode, + }; + var baseConfig = _super.prototype.getConfig.call(this); + Object.assign(config, baseConfig); + return config; + }; + Bidirectional.fromConfig = function (cls, config) { + var rnnLayer = deserialize(config['layer']); + delete config['layer']; + if (config['numConstants'] != null) { + throw new NotImplementedError("Deserialization of a Bidirectional layer with numConstants " + + "present is not supported yet."); + } + var newConfig = config; + newConfig['layer'] = rnnLayer; + return new cls(newConfig); + }; + Bidirectional.className = 'Bidirectional'; + return Bidirectional; + }(Wrapper)); + tfc.serialization.SerializationMap.register(Bidirectional); + + function inputLayer(config) { + return new InputLayer(config); + } + function elu$1(config) { + return new ELU(config); + } + function leakyReLU(config) { + return new LeakyReLU(config); + } + function softmax(config) { + return new Softmax$1(config); + } + function thresholdedReLU(config) { + return new ThresholdedReLU(config); + } + function conv1d$1(config) { + return new Conv1D(config); + } + function conv2d$1(config) { + return new Conv2D(config); + } + function conv2dTranspose(config) { + return new Conv2DTranspose(config); + } + function separableConv2d(config) { + return new SeparableConv2D(config); + } + function cropping2D(config) { + return new Cropping2D(config); + } + function upSampling2d(config) { + return new UpSampling2D(config); + } + function depthwiseConv2d$1(config) { + return new DepthwiseConv2D(config); + } + function activation(config) { + return new Activation$1(config); + } + function dense(config) { + return new Dense(config); + } + function dropout$1(config) { + return new Dropout(config); + } + function flatten$1(config) { + return new Flatten(config); + } + function repeatVector(config) { + return new RepeatVector(config); + } + function reshape(config) { + return new Reshape(config); + } + function embedding(config) { + return new Embedding(config); + } + function add$1(config) { + return new Add(config); + } + function average$1(config) { + return new Average(config); + } + function concatenate$2(config) { + return new Concatenate(config); + } + function maximum$1(config) { + return new Maximum(config); + } + function minimum$1(config) { + return new Minimum(config); + } + function multiply$1(config) { + return new Multiply(config); + } + function batchNormalization$1(config) { + return new BatchNormalization(config); + } + function zeroPadding2d(config) { + return new ZeroPadding2D(config); + } + function averagePooling1d(config) { + return new AveragePooling1D(config); + } + function avgPool1d(config) { + return averagePooling1d(config); + } + function avgPooling1d(config) { + return averagePooling1d(config); + } + function averagePooling2d(config) { + return new AveragePooling2D(config); + } + function avgPool2d(config) { + return averagePooling2d(config); + } + function avgPooling2d(config) { + return averagePooling2d(config); + } + function globalAveragePooling1d(config) { + return new GlobalAveragePooling1D(config); + } + function globalAveragePooling2d(config) { + return new GlobalAveragePooling2D(config); + } + function globalMaxPooling1d(config) { + return new GlobalMaxPooling1D(config); + } + function globalMaxPooling2d(config) { + return new GlobalMaxPooling2D(config); + } + function maxPooling1d(config) { + return new MaxPooling1D(config); + } + function maxPooling2d(config) { + return new MaxPooling2D(config); + } + function gru(config) { + return new GRU(config); + } + function gruCell(config) { + return new GRUCell(config); + } + function lstm(config) { + return new LSTM(config); + } + function lstmCell(config) { + return new LSTMCell(config); + } + function simpleRNN(config) { + return new SimpleRNN(config); + } + function simpleRNNCell(config) { + return new SimpleRNNCell(config); + } + function rnn$1(config) { + return new RNN(config); + } + function stackedRNNCells(config) { + return new StackedRNNCells(config); + } + function bidirectional(config) { + return new Bidirectional(config); + } + function timeDistributed(config) { + return new TimeDistributed(config); + } + var globalMaxPool1d = globalMaxPooling1d; + var globalMaxPool2d = globalMaxPooling2d; + var maxPool1d = maxPooling1d; + var maxPool2d = maxPooling2d; + + var exports_layers = /*#__PURE__*/Object.freeze({ + inputLayer: inputLayer, + elu: elu$1, + leakyReLU: leakyReLU, + softmax: softmax, + thresholdedReLU: thresholdedReLU, + conv1d: conv1d$1, + conv2d: conv2d$1, + conv2dTranspose: conv2dTranspose, + separableConv2d: separableConv2d, + cropping2D: cropping2D, + upSampling2d: upSampling2d, + depthwiseConv2d: depthwiseConv2d$1, + activation: activation, + dense: dense, + dropout: dropout$1, + flatten: flatten$1, + repeatVector: repeatVector, + reshape: reshape, + embedding: embedding, + add: add$1, + average: average$1, + concatenate: concatenate$2, + maximum: maximum$1, + minimum: minimum$1, + multiply: multiply$1, + batchNormalization: batchNormalization$1, + zeroPadding2d: zeroPadding2d, + averagePooling1d: averagePooling1d, + avgPool1d: avgPool1d, + avgPooling1d: avgPooling1d, + averagePooling2d: averagePooling2d, + avgPool2d: avgPool2d, + avgPooling2d: avgPooling2d, + globalAveragePooling1d: globalAveragePooling1d, + globalAveragePooling2d: globalAveragePooling2d, + globalMaxPooling1d: globalMaxPooling1d, + globalMaxPooling2d: globalMaxPooling2d, + maxPooling1d: maxPooling1d, + maxPooling2d: maxPooling2d, + gru: gru, + gruCell: gruCell, + lstm: lstm, + lstmCell: lstmCell, + simpleRNN: simpleRNN, + simpleRNNCell: simpleRNNCell, + rnn: rnn$1, + stackedRNNCells: stackedRNNCells, + bidirectional: bidirectional, + timeDistributed: timeDistributed, + globalMaxPool1d: globalMaxPool1d, + globalMaxPool2d: globalMaxPool2d, + maxPool1d: maxPool1d, + maxPool2d: maxPool2d, + Layer: Layer, + input: input + }); + + function binaryAccuracy$1(yTrue, yPred) { + return binaryAccuracy(yTrue, yPred); + } + function binaryCrossentropy$2(yTrue, yPred) { + return binaryCrossentropy$1(yTrue, yPred); + } + function categoricalAccuracy$1(yTrue, yPred) { + return categoricalAccuracy(yTrue, yPred); + } + function categoricalCrossentropy$2(yTrue, yPred) { + return categoricalCrossentropy$1(yTrue, yPred); + } + function cosineProximity$1(yTrue, yPred) { + return cosineProximity(yTrue, yPred); + } + function meanAbsoluteError$1(yTrue, yPred) { + return meanAbsoluteError(yTrue, yPred); + } + function meanAbsolutePercentageError$1(yTrue, yPred) { + return meanAbsolutePercentageError(yTrue, yPred); + } + function MAPE$2(yTrue, yPred) { + return meanAbsolutePercentageError(yTrue, yPred); + } + function mape$2(yTrue, yPred) { + return meanAbsolutePercentageError(yTrue, yPred); + } + function meanSquaredError$1(yTrue, yPred) { + return meanSquaredError(yTrue, yPred); + } + function MSE$2(yTrue, yPred) { + return meanSquaredError(yTrue, yPred); + } + function mse$2(yTrue, yPred) { + return meanSquaredError(yTrue, yPred); + } + + var exports_metrics = /*#__PURE__*/Object.freeze({ + binaryAccuracy: binaryAccuracy$1, + binaryCrossentropy: binaryCrossentropy$2, + categoricalAccuracy: categoricalAccuracy$1, + categoricalCrossentropy: categoricalCrossentropy$2, + cosineProximity: cosineProximity$1, + meanAbsoluteError: meanAbsoluteError$1, + meanAbsolutePercentageError: meanAbsolutePercentageError$1, + MAPE: MAPE$2, + mape: mape$2, + meanSquaredError: meanSquaredError$1, + MSE: MSE$2, + mse: mse$2 + }); + + function l1l2(config) { + return new L1L2(config); + } + function l1$1(config) { + return l1(config); + } + function l2$1(config) { + return l2(config); + } + + var exports_regularizers = /*#__PURE__*/Object.freeze({ + l1l2: l1l2, + l1: l1$1, + l2: l2$1 + }); + + var Callback = (function (_super) { + __extends(Callback, _super); + function Callback() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.model = null; + return _this; + } + Callback.prototype.setModel = function (model) { + if (!(model instanceof Model)) { + throw new Error('model must be a Model, not some other Container'); + } + this.model = model; + }; + return Callback; + }(BaseCallback)); + + exports.constraints = exports_constraints; + exports.initializers = exports_initializers; + exports.layers = exports_layers; + exports.metrics = exports_metrics; + exports.regularizers = exports_regularizers; + exports.CallbackList = CallbackList; + exports.CustomCallback = CustomCallback; + exports.Callback = Callback; + exports.SymbolicTensor = SymbolicTensor; + exports.Model = Model; + exports.input = input; + exports.loadModel = loadModel; + exports.model = model; + exports.sequential = sequential; + exports.RNN = RNN; + exports.Sequential = Sequential; + exports.LayerVariable = LayerVariable; + exports.version_layers = version; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=tf-layers.js.map diff --git a/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js.map b/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js.map new file mode 100644 index 0000000..5f6fd7e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tf-layers.js","sources":["../src/backend/common.ts","../src/backend/state.ts","../src/errors.ts","../src/utils/generic_utils.ts","../src/constraints.ts","../src/exports_constraints.ts","../src/common.ts","../src/utils/math_utils.ts","../src/backend/tfjs_backend.ts","../src/initializers.ts","../src/exports_initializers.ts","../src/utils/types_utils.ts","../src/utils/variable_utils.ts","../src/variables.ts","../src/engine/topology.ts","../src/engine/input_layer.ts","../src/logs.ts","../src/base_callbacks.ts","../src/losses.ts","../src/metrics.ts","../src/optimizers.ts","../src/utils/layer_utils.ts","../src/layers/serialization.ts","../src/utils/serialization_utils.ts","../src/version.ts","../src/engine/container.ts","../src/engine/executor.ts","../src/engine/training.ts","../src/models.ts","../src/exports.ts","../src/activations.ts","../src/layers/advanced_activations.ts","../src/regularizers.ts","../src/utils/conv_utils.ts","../src/layers/convolutional.ts","../src/layers/convolutional_depthwise.ts","../src/layers/core.ts","../src/layers/embeddings.ts","../src/layers/merge.ts","../src/layers/normalization.ts","../src/layers/padding.ts","../src/layers/pooling.ts","../src/layers/recurrent.ts","../src/layers/wrappers.ts","../src/exports_layers.ts","../src/exports_metrics.ts","../src/exports_regularizers.ts","../src/callbacks.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataFormat} from '../common';\n\nlet _epsilon = 1e-7;\n\n/**\n * Returns the value of the fuzz factor used in numeric expressions.\n */\nexport function epsilon() {\n return _epsilon;\n}\n\n/**\n * Sets the value of the fuzz factor used in numeric expressions.\n * @param e New value of epsilon.\n */\nexport function setEpsilon(e: number) {\n _epsilon = e;\n}\n\n/**\n * Returns the default image data format convention.\n */\nexport function imageDataFormat(): DataFormat {\n return 'channelsLast';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Utilities related to persistent state in the backend.\n */\n\nimport {DataType, keep, Scalar, scalar} from '@tensorflow/tfjs-core';\n\n/**\n * An ID to track `SymbolicTensor`s and derived classes.\n * Required in different places in engine/topology.ts to identify unique\n * tensors.\n */\nlet _nextUniqueTensorId = 0;\n\nexport function getNextUniqueTensorId(): number {\n return _nextUniqueTensorId++;\n}\n\nconst _uidPrefixes: {[prefix: string]: number} = {};\n\n/**\n * Provides a unique UID given a string prefix.\n *\n * @param prefix\n */\nexport function getUid(prefix = ''): string {\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}\n\nconst scalarCache: {[typeKey: string]: {[key: number]: Scalar}} = {\n float32: {},\n int32: {}\n};\n\nconst DEFAULT_DTYPE: DataType = 'float32';\n\n/**\n * Get scalar, with caching.\n */\nexport function getScalar(value: number, dtype?: DataType): Scalar {\n if (dtype === undefined) {\n dtype = DEFAULT_DTYPE;\n }\n if (scalarCache[dtype][value] == null) {\n scalarCache[dtype][value] = scalar(value, dtype);\n keep(scalarCache[dtype][value]);\n }\n return scalarCache[dtype][value];\n}\n\nexport function disposeScalarCache() {\n for (const typeKey in scalarCache) {\n for (const key in scalarCache[typeKey]) {\n scalarCache[typeKey][key].dispose();\n delete scalarCache[typeKey][key];\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// tslint:disable:max-line-length\n/**\n * Explicit error types.\n *\n * See the following link for more information about why the code includes\n * calls to setPrototypeOf:\n *\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n// tslint:enable\n\n/**\n * Equivalent of Python's AttributeError.\n */\nexport class AttributeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AttributeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's RuntimeError.\n */\nexport class RuntimeError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RuntimeError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's ValueError.\n */\nexport class ValueError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ValueError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's NotImplementedError.\n */\nexport class NotImplementedError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotImplementedError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's AssertionError.\n */\nexport class AssertionError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, AssertionError.prototype);\n }\n}\n\n/**\n * Equivalent of Python's IndexError.\n */\nexport class IndexError extends Error {\n constructor(message?: string) {\n super(message);\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, IndexError.prototype);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\n// tslint:disable:max-line-length\nimport {DataType, serialization} from '@tensorflow/tfjs-core';\n\nimport {AssertionError, ValueError} from '../errors';\n// tslint:enable\n\n/**\n * If `value` is an Array, equivalent to Python's `value * numValues`.\n * If `value` is not an Array, equivalent to Python's `[value] * numValues`\n */\n// tslint:disable-next-line:no-any\nexport function pyListRepeat(value: any, numValues: number): any[] {\n if (Array.isArray(value)) {\n // tslint:disable-next-line:no-any\n let newArray: any[] = [];\n for (let i = 0; i < numValues; i++) {\n newArray = newArray.concat(value);\n }\n return newArray;\n } else {\n const newArray = new Array(numValues);\n newArray.fill(value);\n return newArray;\n }\n}\n\nexport function assert(val: boolean, message?: string): void {\n if (!val) {\n throw new AssertionError(message);\n }\n}\n\n/**\n * Count the number of elements of the `array` that are equal to `reference`.\n */\nexport function count(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = retVal + Math.abs(obj.id);\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n return {className: instance.getClassName(), config: instance.getConfig()};\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object'): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(`Unknown ${printableModuleName}: ${identifier}`);\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config.className == null || config.config == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config.className as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects.get(className);\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS.className;\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(`Unknown ${printableModuleName}: ${className}`);\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config.config as config.config.customObjects. Objects can use it, if\n // they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config.config as serialization.ConfigDict;\n nestedConfig.customObjects = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n const returnObj = fromConfig(cls, config.config);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config.config);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport {getScalar} from './backend/state';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n// tslint:enable:max-line-length\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mulStrict(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n */\n/**\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormConfig {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n */\nexport class MaxNorm extends Constraint {\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(config: MaxNormConfig) {\n super();\n this.maxValue =\n config.maxValue != null ? config.maxValue : this.defaultMaxValue;\n this.axis = config.axis != null ? config.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(getScalar(epsilon()), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.SerializationMap.register(MaxNorm);\n\nexport interface UnitNormConfig {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n */\nexport class UnitNorm extends Constraint {\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(config: UnitNormConfig) {\n super();\n this.axis = config.axis != null ? config.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(\n w, tfc.add(getScalar(epsilon()), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.SerializationMap.register(UnitNorm);\n\n/**\n * Constains the weight to be non-negative.\n */\nexport class NonNeg extends Constraint {\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.SerializationMap.register(NonNeg);\n\nexport interface MinMaxNormConfig {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(config: MinMaxNormConfig) {\n super();\n this.minValue =\n config.minValue != null ? config.minValue : this.defaultMinValue;\n this.maxValue =\n config.maxValue != null ? config.maxValue : this.defaultMaxValue;\n this.rate = config.rate != null ? config.rate : this.defaultRate;\n this.axis = config.axis != null ? config.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n getScalar(this.rate),\n tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(getScalar(1.0 - this.rate), norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(getScalar(epsilon()), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.SerializationMap.register(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormConfig, MinMaxNorm, MinMaxNormConfig, NonNeg, UnitNorm, UnitNormConfig} from './constraints';\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'MaxNorm',\n * configParamIndices: [0]\n * }\n */\nexport function maxNorm(config: MaxNormConfig): Constraint {\n return new MaxNorm(config);\n}\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'UnitNorm',\n * configParamIndices: [0]\n * }\n */\nexport function unitNorm(config: UnitNormConfig): Constraint {\n return new UnitNorm(config);\n}\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'NonNeg'\n * }\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'MinMaxNormConfig',\n * configParamIndices: [0]\n * }\n */\nexport function minMaxNorm(config: MinMaxNormConfig): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\n// TODO(cais): Perhaps move the enums to a more suitable place, e.g.,\n// constants.ts.\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = scopedName + '_' + index;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z][A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return name.match(tensorNameRegex) ? true : false;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mulStrict(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, inclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, Scalar, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, tidy, util, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\n\nimport {disposeScalarCache, getScalar} from '../backend/state';\nimport {checkDataFormat, DataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {HasShape, Shape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n disposeScalarCache();\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: 'float32'|'int32'|'bool'): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten an Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `Tensor` to concatenate.\n * @param b The 2nd `Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n 'concatAlongFirstAxis() received an unsupported tensor rank: ' +\n a.rank);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`).\n *\n * @param x A tensor of at least rank 2.\n * @param y A tensor of at least rank 2.\n * @return Result of the dot operation.\n */\nexport function dot(x: Tensor, y: Tensor): Tensor {\n if (y.rank !== 2) {\n throw new NotImplementedError(\n `dot support for y other than rank 2 is not yet implemented: ` +\n `y shape = ${y.shape}`);\n } else {\n if (x.rank === 2) {\n return tfc.matMul(x as Tensor2D, y as Tensor2D);\n } else if (x.rank === 3) {\n const xShape0 = x.shape[0];\n const xShape1 = x.shape[1];\n const xShape2 = x.shape[2];\n x = x.reshape([xShape0 * xShape1, xShape2]);\n return tfc.matMul(x as Tensor2D, y as Tensor2D).reshape([\n xShape0, xShape1, y.shape[1]\n ]);\n } else {\n throw new NotImplementedError(\n `dot support for x of rank ${x.rank} is not yet implemented: ` +\n `x shape = ${x.shape}`);\n }\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `Tensor` that are === 0 are mapped to 0.\n * Elements of the input `Tensor` that are > 0 are mapped to 1.\n * Elements of the input `Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `Tensor`.\n * @return The sign `Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(getScalar(-1), onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mulStrict(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic conversion\n * to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a as Tensor);\n });\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n if (bias.rank !== 1 && bias.rank !== x.rank) {\n throw new ValueError(\n 'Unexpected bias dimensions: ' + bias.rank +\n '; expected it to be 1 or ' + x.rank);\n }\n const biasShape = bias.shape;\n\n let y: Tensor;\n if (x.rank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, biasShape[0], 1, 1, 1]));\n } else {\n y = x.add(bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]));\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, 1, 1, 1, biasShape[0]]));\n } else {\n y = x.add(bias.reshape([1].concat(biasShape)));\n }\n }\n } else if (x.rank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, biasShape[0], 1, 1]));\n } else {\n y = x.add(\n bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]));\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, 1, 1, biasShape[0]]));\n } else {\n y = x.add(bias.reshape([1].concat(biasShape)));\n }\n }\n } else if (x.rank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, biasShape[0], 1]));\n } else {\n y = x.add(bias.reshape([1, biasShape[1], biasShape[0]]));\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, 1, biasShape[0]]));\n } else {\n y = x.add(bias.reshape([1].concat(biasShape)));\n }\n }\n } else if (x.rank < 3) {\n y = x.add(bias);\n } else {\n throw new ValueError(`Unsupported input rank by biasAdd: ${x.rank}`);\n }\n return y;\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.add(getScalar(1), tfc.abs(x))));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`.\n * @param seed random seed to ensure determinism.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: Scalar, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => {\n // TODO(cais): Switch to deeplearn.js implementation of dropout when it\n // becomes avaialable.\n if (noiseShape != null && !util.arraysEqual(x.shape, noiseShape)) {\n throw new NotImplementedError(\n 'Non-default noise shape is not implemented yet: ' +\n JSON.stringify(noiseShape));\n }\n if (seed != null) {\n throw new NotImplementedError('seed is not implemented for dropout yet.');\n }\n let multiplier = tfc.step(tfc.add(\n tfc.neg(level) as Scalar, tfc.randomUniform(x.shape, 0, 1, 'float32')));\n // Scale the kept elements, so the expected sum is unchanged.\n multiplier = tfc.mul(\n tfc.div(getScalar(1), tfc.sub(getScalar(1), level)) as Scalar,\n multiplier);\n return tfc.mul(x, multiplier);\n });\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(getScalar(0.5), tfc.mul(getScalar(0.2), x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training` boolean\n * flag here, because there is no such thing in the TF.js imperative backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// tslint:disable:max-line-length\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, Scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from './backend/state';\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat, DataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {Shape} from './types';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\n// tslint:enable:max-line-length\n\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform';\nexport const VALID_DISTRIBUTION_VALUES = ['normal', 'uniform'];\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Initializer that generates tensors initialized to 0.\n */\nexport class Zeros extends Initializer {\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.SerializationMap.register(Zeros);\n\n/**\n * Initializer that generates tensors initialized to 1.\n */\nexport class Ones extends Initializer {\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.SerializationMap.register(Ones);\n\nexport interface ConstantConfig {\n /** The value for each element in the variable. */\n value: number;\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n */\nexport class Constant extends Initializer {\n static className = 'Constant';\n private value: number;\n constructor(config: ConstantConfig) {\n super();\n if (typeof config !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${config}`);\n }\n if (config.value === undefined) {\n throw new ValueError(`config must have value set but got ${config}`);\n }\n this.value = config.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.SerializationMap.register(Constant);\n\nexport interface RandomUniformConfig {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n */\nexport class RandomUniform extends Initializer {\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(config: RandomUniformConfig) {\n super();\n this.minval = config.minval || this.DEFAULT_MINVAL;\n this.maxval = config.maxval || this.DEFAULT_MAXVAL;\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.SerializationMap.register(RandomUniform);\n\nexport interface RandomNormalConfig {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n */\nexport class RandomNormal extends Initializer {\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(config: RandomNormalConfig) {\n super();\n this.mean = config.mean || this.DEFAULT_MEAN;\n this.stddev = config.stddev || this.DEFAULT_STDDEV;\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `randomNormal does not support dType bool.`);\n }\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.SerializationMap.register(RandomNormal);\n\nexport interface TruncatedNormalConfig {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n */\nexport class TruncatedNormal extends Initializer {\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(config: TruncatedNormalConfig) {\n super();\n this.mean = config.mean || this.DEFAULT_MEAN;\n this.stddev = config.stddev || this.DEFAULT_STDDEV;\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType bool.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.SerializationMap.register(TruncatedNormal);\n\nexport interface IdentityConfig {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n */\nexport class Identity extends Initializer {\n static className = 'Identity';\n private gain: Scalar;\n constructor(config: IdentityConfig) {\n super();\n this.gain = config.gain != null ? scalar(config.gain) : getScalar(1.0);\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain.get()};\n }\n}\nserialization.SerializationMap.register(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingConfig {\n /** Scaling factor (positive float). */\n scale: number;\n\n /** Fanning mode for inputs and outputs. */\n mode: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n */\nexport class VarianceScaling extends Initializer {\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(config: VarianceScalingConfig) {\n super();\n if (config.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${config.scale}`);\n }\n this.scale = config.scale == null ? 1.0 : config.scale;\n this.mode = config.mode;\n checkFanMode(this.mode);\n this.distribution = config.distribution;\n checkDistribution(this.distribution);\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType bool.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.SerializationMap.register(VarianceScaling);\n\nexport interface SeedOnlyInitializerConfig {\n /** Random number generator seed. */\n seed?: number;\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n */\nexport class GlorotUniform extends VarianceScaling {\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n */\nexport class GlorotNormal extends VarianceScaling {\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n */\nexport class HeNormal extends VarianceScaling {\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n */\nexport class LeCunNormal extends VarianceScaling {\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\nexport interface OrthogonalConfig extends SeedOnlyInitializerConfig {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n */\nexport class Orthogonal extends Initializer {\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(config?: OrthogonalConfig) {\n super();\n this.gain = config.gain == null ? this.DEFAULT_GAIN : config.gain;\n this.seed = config.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2) {\n throw new NotImplementedError(\n 'The Orthogonal Initializer does not support non-2D shapes yet.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(getScalar(this.gain), q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.SerializationMap.register(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier = 'constant'|'glorotNormal'|'glorotUniform'|\n 'heNormal'|'identity'|'leCunNormal'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else {\n const config = {className, config: {}};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantConfig, GlorotNormal, GlorotUniform, HeNormal, Identity, IdentityConfig, Initializer, LeCunNormal, Ones, Orthogonal, OrthogonalConfig, RandomNormal, RandomNormalConfig, RandomUniform, RandomUniformConfig, SeedOnlyInitializerConfig, TruncatedNormal, TruncatedNormalConfig, VarianceScaling, VarianceScalingConfig, Zeros} from './initializers';\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Zeros'\n * }\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Ones'\n * }\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Constant',\n * configParamIndices: [0]\n * }\n */\nexport function constant(config: ConstantConfig): Initializer {\n return new Constant(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'RandomUniform',\n * configParamIndices: [0]\n * }\n */\nexport function randomUniform(config: RandomUniformConfig): Initializer {\n return new RandomUniform(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'RandomNormal',\n * configParamIndices: [0]\n * }\n */\nexport function randomNormal(config: RandomNormalConfig): Initializer {\n return new RandomNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'TruncatedNormal',\n * configParamIndices: [0]\n * }\n */\nexport function truncatedNormal(config: TruncatedNormalConfig): Initializer {\n return new TruncatedNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Identity',\n * configParamIndices: [0]\n * }\n */\nexport function identity(config: IdentityConfig): Initializer {\n return new Identity(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'VarianceScaling',\n * configParamIndices: [0]\n * }\n */\nexport function varianceScaling(config: VarianceScalingConfig): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'GlorotUniform',\n * configParamIndices: [0]\n * }\n */\nexport function glorotUniform(config: SeedOnlyInitializerConfig): Initializer {\n return new GlorotUniform(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'GlorotNormal',\n * configParamIndices: [0]\n * }\n */\nexport function glorotNormal(config: SeedOnlyInitializerConfig): Initializer {\n return new GlorotNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'HeNormal',\n * configParamIndices: [0]\n * }\n */\nexport function heNormal(config: SeedOnlyInitializerConfig): Initializer {\n return new HeNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'LeCunNormal',\n * configParamIndices: [0]\n * }\n */\nexport function leCunNormal(config: SeedOnlyInitializerConfig): Initializer {\n return new LeCunNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Orthogonal',\n * configParamIndices: [0]\n * }\n */\nexport function orthogonal(config: OrthogonalConfig): Initializer {\n return new Orthogonal(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\n// tslint:disable:max-line-length\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../types';\n// tslint:enable\n\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `Tensor` or an `Array` of `Tensor`s.\n * @return A single `Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs as Tensor;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {HasShape, Shape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `LayerVariable` is similar to a `Tensor` in that it has a dtype and shape,\n * but its value is mutable. The value is itself represented as a `Tensor`, and\n * can be read with the `read()` method and updated with the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n readonly trainable: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a Tensor.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n checkShapesMatch(this.val, newVal);\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n return this;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n if (dtype === 'bool') {\n throw new NotImplementedError(`randomNormal does not support dType bool.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType bool.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of `Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.map((variableAndValue) => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\n// tslint:disable:max-line-length\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n// tslint:enable:max-line-length\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecConfig {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(config: InputSpecConfig) {\n this.dtype = config.dtype;\n this.shape = config.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (config.shape != null) {\n this.ndim = config.shape.length;\n } else {\n this.ndim = config.ndim;\n }\n this.maxNDim = config.maxNDim;\n this.minNDim = config.minNDim;\n this.axes = config.axes || {};\n }\n}\n\n/**\n * `SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `Model` and the input data's shape, but not values are known.\n */\n/** @doc {heading: 'Models', 'subheading': 'Classes'} */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeConfig {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n config: NodeConfig,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = config.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = config.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = config.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = config.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = config.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = config.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = config.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = config.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = config.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = config.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of config.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n config.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport interface LayerConfig {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specifiedd,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /** Whether this layer is trainable. Defaults to true. */\n trainable?: boolean;\n /** Whether the weights of this layer are updatable by `fit`. */\n updatable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `Model`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n */\n/** @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n trainable: boolean;\n updatable: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n constructor(config: LayerConfig) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = config.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable = config.trainable == null ? true : config.trainable;\n this.updatable = config.updatable == null ? true : config.updatable;\n\n if (config.inputShape != null || config.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (config.batchInputShape != null) {\n batchInputShape = config.batchInputShape;\n } else if (config.inputShape != null) {\n let batchSize: number = null;\n if (config.batchSize != null) {\n batchSize = config.batchSize;\n }\n batchInputShape = [batchSize].concat(config.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = config.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (config.weights != null) {\n this.initialWeights = config.weights;\n } else {\n this.initialWeights = null;\n }\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights;\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n } else {\n return this._nonTrainableWeights;\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n 'found shape=${xShape}.');\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `SymbolicTensor`s are typically used during the\n * building of non-`Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `Tensor` or `SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n */\n // Porting Note: This is a replacement for __call__() in Python.\n /** @doc {heading: 'Models', 'subheading': 'Classes'} */\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"outut shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `Tensor`s.\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n const weight = new LayerVariable(\n initializer.apply(shape, dtype), dtype, name, trainable, constraint);\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking,` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking,` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer as Layer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `Tensor`s or `SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\n\nimport {Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport interface InputLayerConfig {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\n/**\n * An input layer is an entry point into a `Model`.\n *\n * `InputLayer` is generated automatically for `Sequential` models by specifying\n * the `inputshape` or `batchInputShape` for the first layer. It should not be\n * specified explicitly.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const inputA = tf.input({shape: [3]});\n * const inputB = tf.input({shape: [3]});\n * const sum = tf.layers.add().apply([inputA, inputB]);\n * const model = tf.model({inputs: [inputA, inputB], outputs: sum});\n * const batchSize = 2;\n * model.predict([tf.ones([batchSize, 3]), tf.ones([batchSize, 3])]).print();\n * ```\n */\nexport class InputLayer extends Layer {\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(config: InputLayerConfig) {\n super({\n dtype: config.dtype,\n name: config.name != null ? config.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (config.batchSize == null) {\n config.batchSize = null;\n }\n if (config.sparse == null) {\n config.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = config.sparse;\n\n if (config.inputShape != null && config.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = config.batchInputShape;\n if (batchInputShape == null) {\n if (config.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [config.batchSize].concat(config.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (config.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = config.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.SerializationMap.register(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\n/**\n * Used to instantiate an input to a model as a `SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n */\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value as Scalar;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `Tensor`s in\n * places where the values can be `Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, Scalar, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from './backend/state';\nimport {Container} from './engine/container';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // Model needs to call Callback.setModel(), but cannot actually depend on\n // Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way Model can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of Model) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a Model.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every Model.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = getScalar(0);\n }\n\n this.totals[key] = tidy(\n () => add((this.totals[key] as Scalar),\n mul(value, getScalar(batchSize))) as Scalar);\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n logs[key] = mul(div(getScalar(1), getScalar(this.seen)) as Scalar,\n this.totals[key] as Scalar) as Scalar;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object gets\n * returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackConfig {\n onTrainBegin?: (logs?: Logs) => Promise;\n onTrainEnd?: (logs?: Logs) => Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => Promise;\n protected readonly trainEnd: (logs?: Logs) => Promise;\n protected readonly epochBegin: (epoch: number, logs?: Logs) => Promise;\n protected readonly epochEnd: (epoch: number, logs?: Logs) => Promise;\n protected readonly batchBegin: (batch: number, logs?: Logs) => Promise;\n protected readonly batchEnd: (batch: number, logs?: Logs) => Promise;\n\n constructor(config: CustomCallbackConfig) {\n super();\n this.trainBegin = config.onTrainBegin;\n this.trainEnd = config.onTrainEnd;\n this.epochBegin = config.onEpochBegin;\n this.epochEnd = config.onEpochEnd;\n this.batchBegin = config.onBatchBegin;\n this.batchEnd = config.onBatchEnd;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.epochEnd(epoch, logs as Logs);\n }\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.batchEnd(batch, logs as Logs);\n }\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(callbacks: BaseCallback|BaseCallback[]|\n CustomCallbackConfig|\n CustomCallbackConfig[]): BaseCallback[] {\n if (callbacks == null) {\n return null;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks as BaseCallback];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackConfig[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor, Tensor1D, tidy} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {getScalar} from './backend/state';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.mul(scalar(epsilon()), tfc.onesLike(x));\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(getScalar(100.0), tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const one = getScalar(1.0);\n\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(one, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(one, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const zeroTensor = getScalar(0.0);\n const one = getScalar(1.0);\n const maxResult =\n tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const zeroTensor = getScalar(0.0);\n const one = getScalar(1.0);\n const maxResult =\n tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const zeroTensor = getScalar(0.0);\n const one = getScalar(1.0);\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(one, yTrue), yPred), -1);\n return tfc.maximum(zeroTensor, tfc.add(one, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = getScalar(Math.log(2.0));\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(\n predictionDiff,\n tfc.softplus(tfc.mul(getScalar(-2.0), predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param target The labels.\n * @param output The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n target: Tensor, output: Tensor): Tensor {\n return tidy(() => {\n const maxOutput = tfc.maximum(output, tfc.zerosLike(output));\n const outputXTarget = tfc.mul(output, target);\n const sigmoidOutput =\n tfc.log(tfc.add(getScalar(1), tfc.exp(tfc.neg(tfc.abs(output)))));\n const result = tfc.add(tfc.sub(maxOutput, outputXTarget), sigmoidOutput);\n return result;\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(tfc.onesLike(y), y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(getScalar(epsilon()), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n };\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n throw new ValueError(`Unknown loss ${identifierOrFn}`);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {getScalar} from './backend/state';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {LossOrMetricFn} from './types';\n// tslint:enable:max-line-length\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tfl.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(getScalar(0.5), tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tensor2d([[0], [1], [1], [1]]);\n * const y = tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine,\n };\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\n// tslint:disable:max-line-length\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n// tslint:enable:max-line-length\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a Model object.\n *\n * @param model tf.Model instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config: dict of the form {class_name: str, config: dict}\n * @param custom_objects: dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @returns Layer instance (may be Model, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as\n serialization.ConfigDict): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer');\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\n// tslint:disable:max-line-length\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {JsonValue} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a Model or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: JsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of Model and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): JsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of Model and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '0.7.2';\nexport {version};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\n// tslint:disable:max-line-length\nimport {Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {JsonDict, Kwargs, NamedTensorMap, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {InputLayer} from './input_layer';\nimport {Layer, Node, SymbolicTensor} from './topology';\n// tslint:enable:max-line-length\n\n/**\n * Converts layers weights to a format suitable for TensorFlow.js Layers.\n *\n * Porting Note: The function `preprocess_weights_for_loading()` in PyKeras\n * performs conversion from Keras 1 to Keras 2. But in TypeScript, we\n * require Keras version to be 2. Thus this conversion is not applicable. We\n * simply check the Keras version and pass the weights through.\n *\n * @param layer Layer instance.\n * @param weights Input weights.\n * @param originalKerasVersion Keras version for the weights.\n * @param originalBackend Keras backend the weights were trained with.\n * @returns Output weights as Tensors.\n */\nfunction preprocessWeightsForLoading(\n layer: Layer, weights: LayerVariable[], originalKerasVersion?: string,\n originalBackend?: string): LayerVariable[] {\n if (!originalKerasVersion.startsWith('2.')) {\n throw new ValueError(\n 'Unsupported Keras version in weights being loaded: ' +\n originalKerasVersion);\n }\n return weights;\n}\n\n/**\n * Create an Tensor from info about dtype, shape and values.\n * @param dtype DType string.\n * @param shape Shape.\n * @param value Values of the array, as a scalar or nested Array of proper\n * shape.\n * @returns An Tensor instance.\n */\n// tslint:disable-next-line:no-any\nfunction loadTensor(dtype: string, shape: Shape, value: any): Tensor {\n const dataType = generic_utils.stringToDType(dtype);\n return Tensor.make(\n shape, {values: shape.length === 0 ? value : util.flatten(value)},\n dataType);\n}\n\n// TODO(cais): Maybe remove the following (b/74015805).\n/**\n * Load weights from a weights JSON object to an array of layers.\n *\n * Porting Note: This is ported from the Python function\n * load_weights_from_hdf5_group_by_name()\n *\n * @param weightsJSON. The input JSON object represent the weights from a\n * trained Keras model. See scripts/pykeras.py for more details.\n * @param layers An array of target layers.\n * @param skipMismatch Whether to skip loading of layers where there is a\n * mismatch in the number of weights, or a mismatch in the shape of the\n * weights.\n */\nexport function loadWeightsFromJson(\n weightsJSON: JsonDict, layers: Layer[], skipMismatch = false): void {\n const originalKerasVersion = weightsJSON['keras_version'] as string;\n const originalBackend = weightsJSON['backend'] as string;\n const layerNames = layers.map(layer => layer.name);\n\n // Reverse index of layer name to list of layers with name.\n const index: {[layerName: string]: Layer[]} = {};\n for (const layer of layers) {\n if (layer.name != null) {\n if (index[layer.name] == null) {\n index[layer.name] = [];\n }\n index[layer.name].push(layer);\n }\n }\n\n // tslint:disable-next-line:no-any\n const nameToWeights = weightsJSON['weights'] as {[name: string]: any};\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (let k = 0; k < layerNames.length; ++k) {\n const name = layerNames[k];\n let layerWeights = nameToWeights[name];\n if (layerWeights == null) {\n layerWeights = [];\n }\n\n let weightValues: LayerVariable[] = [];\n for (let n = 0; n < layerWeights.length; ++n) {\n // tslint:disable:no-any\n const weightEntry =\n layerWeights[n] as {[key: string]: string | Shape | any};\n // tslint:enable\n weightValues.push(new LayerVariable(loadTensor(\n weightEntry['dtype'], weightEntry['shape'] as Shape,\n weightEntry['value'])));\n }\n for (const layer of index[name]) {\n const symbolicWeights = layer.weights;\n weightValues = preprocessWeightsForLoading(\n layer, weightValues, originalKerasVersion, originalBackend);\n if (weightValues.length !== symbolicWeights.length) {\n if (skipMismatch) {\n console.warn(\n `Skipping loading of weights of layer ${layer.name} ` +\n `due to mismatch in number of weights: (${weightValues.length} ` +\n `vs ${symbolicWeights.length}).`);\n } else {\n throw new ValueError(\n `Layer #${k} (named \"${layer.name}\") expects ` +\n `${symbolicWeights.length} weight(s), but the saved weights ` +\n `have ${weightValues.length} element(s).`);\n }\n }\n\n // Set values.\n for (let i = 0; i < weightValues.length; ++i) {\n if (skipMismatch) {\n if (!util.arraysEqual(\n symbolicWeights[i].shape, weightValues[i].shape)) {\n console.warn(\n `Skipping loading of weights for layer ${layer.name} due ` +\n `to mismatch in shape (${symbolicWeights[i].shape} vs ` +\n `${weightValues[i].shape})`);\n continue;\n }\n }\n weightValueTuples.push([symbolicWeights[i], weightValues[i].read()]);\n }\n }\n }\n batchSetValue(weightValueTuples);\n}\n\n/**\n * Load weights from a named tensor map.\n *\n * Porting Note: This is ported from the Python function\n * load_weights_from_hdf5_group_by_name()\n *\n * @param weights The named tensor map mapping names of weights to weight\n * values.\n * @param layers An array of target layers.\n */\nexport function loadWeightsFromNamedTensorMap(\n weights: NamedTensorMap, layers: Layer[]): void {\n // Make a dictionary mapping weight name to weight.\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n weightValueTuples.push([nameToWeight[name], weights[name]]);\n delete nameToWeight[name];\n }\n\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n\n batchSetValue(weightValueTuples);\n}\n\n/** Constructor config for Container. */\nexport interface ContainerConfig {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A Model\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(config: ContainerConfig) {\n // No args passed to super's constructor.\n super({});\n this.name = config.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable = true;\n this.updatable = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(config.inputs)) {\n this.inputs = config.inputs.slice();\n } else {\n this.inputs = [config.inputs];\n }\n if (Array.isArray(config.outputs)) {\n this.outputs = config.outputs.slice();\n } else {\n this.outputs = [config.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n this.inputs.map(x => x.name));\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n this.outputs.map(x => x.name));\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer as Layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer as Layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a Model must be InputLayer objects. ' +\n `Received inputs: ${config.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer as Layer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weightsJSON A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `Tensor` objects.\n * @param skipMismatch Whether to skip loading of layers where there is a\n * mismatch in the number of weights, or a mismatch in the shape of the\n * weight (only valid when `by_name`=True).\n * @param isNamedTensorMap Whether the 1st argument (`weightsJSON`) is a\n * `NamedTensorMap`.\n */\n loadWeights(\n weightsJSON: JsonDict|NamedTensorMap, skipMismatch = false,\n isNamedTensorMap = false) {\n // TODO(cais): Maybe the JsonDict support should be removed after serving\n // weights from XHR is working. If so, the `loadWeightsFromJson` flag\n // should be removed as well. (b/74015805)\n // TODO(cais): See if we can use smarter type resolution to avoid sending\n // the type info as a separate arg (isNamedTensormap).\n if (isNamedTensorMap) {\n loadWeightsFromNamedTensorMap(weightsJSON as NamedTensorMap, this.layers);\n } else {\n loadWeightsFromJson(weightsJSON as JsonDict, this.layers, skipMismatch);\n }\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns Model config with Keras version information added.\n */\n private updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {\n className: this.getClassName(),\n config: theConfig,\n kerasVersion: `tfjs-layers ${layersVersion}`,\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n backend: 'TensorFlow.js'\n };\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|JsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as JsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n\n if ('mask' in kwargs) {\n masks = generic_utils.toList(kwargs['mask']);\n } else {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n // TODO(michaelterry): Add support for caching.\n return this.runInternalGraph(inputs, masks)[0];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs.mask == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs.mask == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'Model invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (nodeKey in this.containerNodes) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n */\n /**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['Model']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n layerConfigs.push({\n name: layer.name,\n className: layerClassName,\n config: layerConfig,\n inboundNodes: filteredInboundNodes\n });\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a Model from its config (output of `get_config()`).\n * @param cls: the class to create\n * @param config: Model config dictionary.\n * @returns A model instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes:\n {[layer: string]: serialization.ConfigDict[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: serialization.ConfigDict[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: serialization.ConfigDict[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0] as string;\n const inboundNodeIndex = inputData[1] as number;\n const inboundTensorIndex = inputData[2] as number;\n if (inputData.length === 3) {\n kwargs = {};\n } else if (inputData.length === 4) {\n kwargs = inputData[3] as serialization.ConfigDict;\n } else {\n throw new ValueError(`Improperly formatted model config for layer ${\n JSON.stringify(layer)}: ${JSON.stringify(inputData)}`);\n }\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData.name as string;\n // Instantiate layer.\n const layer = deserializeLayer(\n layerData,\n config.customObjects != null ?\n config.customObjects as serialization.ConfigDict :\n {}) as Layer;\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData.inboundNodes as serialization.ConfigDict[];\n for (const nodeData of inboundNodesData) {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n }\n }\n\n // First, we create all layers and enqueue nodes to be processed\n const name = config.name;\n const layersFromConfig = config.layers as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData.name as string];\n if (layer.name in unprocessedNodes) {\n for (const nodeData of unprocessedNodes[layer.name]) {\n processNode(layer, nodeData);\n }\n delete unprocessedNodes[layer.name];\n }\n }\n }\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config.inputLayers as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config.outputLayers as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, Tensor} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // 1. Check shape compatibility. If shapes are not compatible, error.\n if (key.shape != null) {\n if (key.shape.length !== val.shape.length) {\n throw new ValueError(\n `The rank of feed (${val.shape.length}) does not match the rank of ` +\n `the key (${key.shape.length}).`);\n }\n\n for (let i = 0; i < key.shape.length; ++i) {\n if (key.shape[i] != null && key.shape[i] !== val.shape[i]) {\n throw new ValueError(\n `The ${i}-th dimension of the feed (${val.shape[i]}) is ` +\n `incompatible with that of the key (${key.shape[i]}).`);\n }\n }\n }\n // 2. Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // 2a. If types match, return val tensor as is.\n return val;\n }\n try {\n // 2b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // 2c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n * @param key The key of the feed.\n * @param value The value of the feed.\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get the feed value for given key.\n * @param key\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor): Tensor {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${JSON.stringify(key)}`);\n } else {\n return this.id2Value[key.id];\n }\n }\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the inputs\n * obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs): Tensor|Tensor[]|[Tensor | Tensor[]] {\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputs: Tensor[] = [];\n const internalFeedDict = new FeedDict(feedDict);\n\n for (const fetch of fetchArray) {\n outputs.push(executeInternal(fetch, internalFeedDict, kwargs) as Tensor);\n }\n return arrayFetches ? outputs : outputs[0];\n}\n\nfunction executeInternal(\n fetch: SymbolicTensor, internalFeedDict: FeedDict,\n kwargs?: Kwargs): Tensor {\n if (internalFeedDict.hasKey(fetch)) {\n return internalFeedDict.getValue(fetch);\n }\n if (fetch.sourceLayer instanceof InputLayer) {\n throw new ValueError(\n `Missing a feed value for SymbolicTensor from InputLayer ` +\n `'${InputLayer.name}'`);\n }\n\n const inputs = fetch.inputs;\n const inputValues: Tensor[] = [];\n for (const input of inputs) {\n // Recursive call.\n const inputVal = executeInternal(input, internalFeedDict, kwargs) as Tensor;\n inputValues.push(inputVal);\n }\n\n let output =\n fetch.sourceLayer.apply(inputValues, kwargs) as Tensor | Tensor[];\n if (!Array.isArray(output)) {\n output = [output];\n }\n const layerOutputs = getNodeOutputs(fetch);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n internalFeedDict.add(outputSymbolicTensors[i], output[i]);\n }\n return output.length === 1 ? output[0] : output[fetch.outputTensorIndex];\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig, Optimizer, Scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from '../backend/state';\nimport * as K from '../backend/tfjs_backend';\nimport {BaseCallback, BaseLogger, CallbackList, CustomCallbackConfig, History, standardizeCallbacks} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensorMap, Shape} from '../types';\nimport {count, pyListRepeat, singletonOrArray, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {LayerVariable} from '../variables';\n\nimport {Container, ContainerConfig} from './container';\nimport {execute, FeedDict} from './executor';\nimport {SymbolicTensor} from './topology';\n\n// tslint:enable:max-line-length\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < names.length; ++i) {\n const array = arrays[i];\n if (array.shape.length === 1) {\n arrays[i] = K.expandDims(array, 1);\n }\n }\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `Tensor`s for inputs.\n * @param targets `Array` of `Tensor`s for targets.\n * @param weights Optional `Array` of `Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Slice an Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nfunction sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => K.sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return K.sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice an Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `Tensor` or `Array` of `Tensor`s to slice.\n * If an `Array` of `Tensor`s, all `Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return K.gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `Tensor` or an Array of `Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An `Array` or dict (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: if `null` or `undefined` value is provided.\n */\nfunction collectMetrics(\n metrics: string[]|{[outputName: string]: string | string[]},\n outputNames: string[]): string[][] {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n if (Array.isArray(metrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(name => metrics);\n } else if (metrics != null) {\n // In this case, metrics is a dict.\n const nestedMetrics: string[][] = [];\n for (const name of outputNames) {\n let outputMetrics: string|string[] =\n metrics.hasOwnProperty(name) ? metrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics as string[]);\n }\n return nestedMetrics;\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an Array or ' +\n 'Object, found: ' + metrics);\n }\n}\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\nexport interface ModelEvaluateConfig {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Interface for specifying data to fit a model to data.\n */\nexport interface ModelFitConfig {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /** The number of times to iterate over the training data arrays. */\n epochs?: number;\n\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can consist of one or more of the following fields: `onTrainBegin`,\n * `onTrainEnd`, `onEpochBegin`, `onEpochEnd`, `onBatchBegin`, `onBatchEnd`.\n */\n callbacks?: BaseCallback[]|CustomCallbackConfig|CustomCallbackConfig[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional dictionary mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n */\n classWeight?: {[classIndex: string]: number};\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run).\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n *\n */\n yieldEvery?: 'batch'|'epoch'|'never';\n}\n\n/**\n * Configuration for calls to `Model.compile()`.\n */\nexport interface ModelCompileConfig {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string[]|{[outputName: string]: string};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\n/**\n * A `Model` is a directed, acyclic graph of `Layer`s plus methods for\n * training, evaluation, prediction and saving.\n *\n * `Model` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `Model`, use `model`.\n *\n * See also:\n * `Sequential`, `loadModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Model extends Container implements tfc.InferenceModel {\n static className = 'Model';\n optimizer: Optimizer;\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n stopTraining: boolean;\n\n metrics: string[]|{[outputName: string]: string};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the Model\n // a metric belongs to. This is unlike `metrics_tensors` in PyKeras,\n // which is a `list` of symbolic tensors, each of which has implicit\n // \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n constructor(config: ContainerConfig) {\n super(config);\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param config a `ModelCompileConfig` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [0]}\n */\n compile(config: ModelCompileConfig): void {\n if (config.loss == null) {\n config.loss = [];\n }\n this.loss = config.loss;\n\n if (typeof config.optimizer === 'string') {\n this.optimizer = optimizers.getOptimizer(config.optimizer);\n } else {\n if (!(config.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer = config.optimizer;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(config.loss) && typeof config.loss !== 'string' &&\n typeof config.loss !== 'function') {\n config.loss = config.loss as {[outputName: string]: string};\n for (const name in config.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". Only expect the ` +\n `following keys: ${this.outputNames}`);\n }\n }\n for (const name in this.outputNames) {\n if (config.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(config.loss[name]));\n }\n } else if (Array.isArray(config.loss)) {\n if (config.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${config.loss}.`);\n }\n const theLosses = config.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(config.loss);\n this.outputs.map(layer => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for weighted losses.\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = config.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(config.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: string[]) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName = metricNamePrefix + metric;\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n private checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `Tensor` of test data, or an `Array` of `Tensor`s if the model has\n * multiple inputs.\n * @param y `Tensor` of target data, or an `Array` of `Tensor`s if the model\n * has multiple outputs.\n * @param config A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n config: ModelEvaluateConfig = {}): Scalar|Scalar[] {\n const batchSize = config.batchSize == null ? 32 : config.batchSize;\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const standardizedOuts = this.standardizeUserData(x, y, true, batchSize);\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element of\n // the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, config.verbose, config.steps);\n return singletonOrArray(testOuts);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before declaring\n * loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute intrenal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames = (outputsIsArray ? outputs as string[] :\n [outputs as string]) as string[];\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs as Tensor];\n }\n if (Array.isArray(inputs)) {\n if ((inputs as Tensor[]).length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${(inputs as Tensor[]).length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], (inputs as Tensor[])[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = (inputs as NamedTensorMap)[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] = Array.isArray(layer.output) ?\n layer.output as SymbolicTensor[] :\n [layer.output as SymbolicTensor];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `Tensor` (if a single output) or an `Array` of\n * `Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outs: Tensor[] = [];\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n if (batchIndex === 0) {\n // Pre-allocate.\n for (const batchOut of batchOuts) {\n outs.push(batchOut);\n }\n } else {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs[i] = K.concatAlongFirstAxis(outs[i], batchOuts[i]);\n }\n }\n }\n return singletonOrArray(outs);\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as an Tensor, or an `Array` of `Tensor`s if\n * the model has multiple inputs.\n * @param config A `ModelPredictConfig` object containing optional fields.\n *\n * @return Prediction results as a `Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [1]}\n */\n predict(x: Tensor|Tensor[], config: ModelPredictConfig = {}): Tensor\n |Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, false);\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = config.batchSize == null ? 32 : config.batchSize;\n return this.predictLoop(x, batchSize);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as an Tensor\n * @return Tensor(s) of predictions\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n return this.predictLoop(x, x.shape[0]);\n }\n\n protected standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'Model.compile(modelCompileConfig).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input') as\n Tensor[];\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target') as Tensor[];\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n // TODO(cais): Deal with the case of model.stateful == true.\n return [x, y, null];\n }\n\n /**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown.\n * @param epochs Number of times to iterate over the data.\n * @param verbose Verbosity mode: 0, 1, or 2.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run).\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\n private async fitLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], outLabels?: string[],\n batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n this.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n this.history = new History();\n if (callbacks == null) {\n callbacks = [new BaseLogger()];\n } else {\n callbacks = ([new BaseLogger()] as BaseCallback[]).concat(callbacks);\n }\n callbacks = callbacks.concat([this.history]);\n\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n const callbackList = new CallbackList(callbacks);\n\n // TODO(cais): Figure out when this Model instance can have a dynamically\n // set property called 'callback_model' as in PyKeras.\n callbackList.setModel(this);\n callbackList.setParams({\n epochs,\n initialEpoch,\n steps: stepsPerEpoch,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n await callbackList.onTrainBegin();\n this.stopTraining = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError(\n 'batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = K.sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = this.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (this.stopTraining) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (this.stopTraining) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await this.history.syncData();\n return this.history;\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before declaring\n * test finished. Ignored with the default value of `null` / `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose === 1) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(getScalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(\n outs[i],\n tfc.mul(getScalar(batchEnd - batchStart), batchOut)) as\n Scalar;\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], getScalar(numSamples)) as Scalar;\n }\n }\n return outs;\n });\n }\n\n private getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer shared\n // among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss = tfc.mean(lossFunction(targets[i], outputs[i])) as Scalar;\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss) as Scalar;\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0]; // TODO(cais): Restore.\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `Tensor` of training data, or an array of `Tensor`s if the model\n * has multiple inputs. If all inputs in the model are named, you can also\n * pass a dictionary mapping input names to `Tensor`s.\n * @param y `Tensor` of target (label) data, or an array of `Tensor`s if the\n * model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `Tensor`s.\n * @param config A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n config: ModelFitConfig = {}): Promise {\n const batchSize = config.batchSize == null ? 32 : config.batchSize;\n\n // Validate user data.\n // TODO(cais): Add sampleWeight and classWeight.\n const standardizedOuts = this.standardizeUserData(x, y, false, batchSize);\n let inputs = standardizedOuts[0];\n let targets = standardizedOuts[1];\n // TODO(cais): Make use of sampleWeights in standardizedOuts[2] when\n // available.\n\n // Prepare validation data.\n let doValidation = false;\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let valIns: Tensor[];\n // A flag to keep track of whether `valIns`, `inputs` and `targets` need\n // to be memory-disposed prior to returning from this method. This is the\n // case if `config.validationSplit` is set to a number between 0 and 1, in\n // which case the input `x` and `y` tensors will be sliced, leading to\n // allocation of new tensor memory.\n let needValidationDisposal = false;\n if (config.validationData != null && config.validationData.length > 0) {\n doValidation = true;\n if (config.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n valX = config.validationData[0];\n valY = config.validationData[1];\n } else if (config.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${config.validationData} is invalid.`);\n }\n\n const valStandardized =\n this.standardizeUserData(valX, valY, true, batchSize);\n valX = valStandardized[0] as Tensor[];\n valY = valStandardized[1] as Tensor[];\n // TODO(cais): Use validation sample weights in valStandardized[2] once\n // it becomes available.\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n config.validationSplit != null && config.validationSplit > 0 &&\n config.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always an Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - config.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n needValidationDisposal = true;\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (config.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets);\n\n this.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the training\n // process. Instead, we define a function that performs the training\n // action.\n // In PyKeras, the data (inputs and targets) are fed through graph\n // placeholders. In tfjs-layers, the data are fed as function arguments.\n // Since the function are defined below in the scope, we don't have\n // equivalents of PyKeras's `_make_train_funciton`.\n\n // Creat a function that performs the following actions:\n // 1) computes the losses,\n // 2) add them to get the total loss,\n // 3) call the optimizer computes the gradients of the Model's trainable\n // weights w.r.t. the total loss and update the variables.\n // 4) calculate the metrics\n // 5) return the values of the losses and metrics.\n const trainFunction = (data: Tensor[]) => {\n const losses: Tensor[] = [];\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the inputs.\n // This function is used for obtaining gradients through backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n const loss = lossFunction(targets[i], outputs[i]);\n losses.push(loss);\n // TODO(cais): push Scalar instead.\n const meanLoss = tfc.mean(loss) as Scalar;\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex])) as\n Scalar;\n tfc.keep(meanMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(meanMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n\n const outLabels = this.getDedupedMetricsNames();\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n this.makeTestFunction();\n valFunction = this.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(config.callbacks);\n const out = await this.fitLoop(\n trainFunction, ins, outLabels, batchSize, config.epochs, config.verbose,\n callbacks, valFunction, valIns, config.shuffle, callbackMetrics,\n config.initialEpoch, null, null);\n if (needValidationDisposal) {\n valIns.forEach(tensor => tensor.dispose());\n inputs.forEach(tensor => tensor.dispose());\n targets.forEach(tensor => tensor.dispose());\n }\n return out;\n // TODO(cais): Add value to outLabels.\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensorMap {\n const namedWeights: NamedTensorMap = {};\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights[weights[i].originalName] = weightValues[i];\n }\n return namedWeights;\n }\n\n // tslint:disable:max-line-length\n /**\n * Save the configuration and/or weights of the Model.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or transmission\n * of serialized data (\"artifacts\") that represent the model's topology and\n * weights onto or via a specific medium, such as file downloads, local\n * storage, IndexedDB in the web browser and HTTP requests to a server.\n * TensorFlow.js provides `IOHandler` implementations for a number of\n * frequently used saving mediums, such as `tf.io.browserDownloads` and\n * `tf.io.browserLocalStorage`. See `tf.io` for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s as\n * URL-like string shortcuts, such as 'localstorage://' and 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.browserHTTPRequests` for more details\n * including specifying request parameters and implementation of the server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of the\n * saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [1]}\n */\n // tslint:enable:max-line-length\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'Model.save() cannot proceed because the IOHandler provided does ' +\n 'not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n\n return handlerOrURL.save({\n modelTopology: modelConfig,\n weightData: weightDataAndSpecs.data,\n weightSpecs: weightDataAndSpecs.specs\n });\n }\n}\n\nserialization.SerializationMap.register(Model);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\n// tslint:disable:max-line-length\nimport {io, Scalar, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {Model, ModelCompileConfig, ModelEvaluateConfig, ModelFitConfig} from './engine/training';\nimport {RuntimeError, ValueError} from './errors';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensorMap, Shape} from './types';\nimport {JsonDict} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n// tslint:enable:max-line-length\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `Model` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig,\n customObjects?: serialization.ConfigDict): Promise {\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as JsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as Model;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues =\n await io.loadWeights(\n modelAndWeightsConfig.weightsManifest,\n modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName)) as NamedTensorMap;\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n const skipMismatches: boolean = null;\n const isNamedTensorMap = true;\n model.loadWeights(uniqueWeightValues, skipMismatches, isNamedTensorMap);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: JsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictConfig {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n// tslint:disable:max-line-length\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json')\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n *\n * @returns A `Promise` of `Model`, with the topology and weights loaded.\n */\n// tslint:enable:max-line-length\nexport async function loadModelInternal(pathOrIOHandler: string|\n io.IOHandler): Promise {\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadModelFromIOHandler(pathOrIOHandler as io.IOHandler);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n */\nexport async function loadModelFromIOHandler(\n handler: io.IOHandler,\n customObjects?: serialization.ConfigDict): Promise {\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as JsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as JsonDict;\n }\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects) as Model;\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'Model artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const skipMismatch = false;\n const isNamedTensorMap = true;\n model.loadWeights(\n io.decodeWeights(artifacts.weightData, artifacts.weightSpecs),\n skipMismatch, isNamedTensorMap);\n }\n return model;\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialConfig {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `sequential` is a factory function that creates an instance of\n * `Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Sequential extends Model {\n static className = 'Sequential';\n private model: Model;\n private _updatable: boolean;\n constructor(config?: SequentialConfig) {\n super({inputs: [], outputs: []});\n config = config || {};\n\n this.trainable = true;\n this._updatable = true;\n this.built = false;\n\n // Set model name.\n this.name = (config.name != null) ? config.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (config.layers != null) {\n for (const layer of config.layers) {\n this.add(layer);\n }\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its input\n * shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof Model;\n let modelLayer: Model;\n if (isLayerModelInstance) {\n modelLayer = layer as Model;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. Model received layer ${layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new Model({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n this.model.updatable = this.updatable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n get updatable(): boolean {\n return this._updatable;\n }\n\n set updatable(value: boolean) {\n if (this.built) {\n this.model.updatable = value;\n }\n this._updatable = value;\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `Tensor` of test data, or an `Array` of `Tensor`s if the model\n * has multiple inputs.\n * @param y `Tensor` of target data, or an `Array` of `Tensor`s if the model\n * has multiple outputs.\n * @param config A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n config: ModelEvaluateConfig = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, config);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as an Tensor, or an `Array` of `Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [1]}\n */\n predict(x: Tensor|Tensor[], config: ModelPredictConfig = {}): Tensor\n |Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, config);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as an Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `Model.compile`.\n *\n * @param config\n */\n compile(config: ModelCompileConfig): void {\n this.build();\n this.model.compile(config);\n this.optimizer = this.model.optimizer;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `Tensor` of training data, or an array of `Tensor`s if the model\n * has multiple inputs. If all inputs in the model are named, you can also\n * pass a dictionary mapping input names to `Tensor`s.\n * @param y `Tensor` of target (label) data, or an array of `Tensor`s if the\n * model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `Tensor`s.\n * @param config A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n config: ModelFitConfig = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, config);\n }\n\n /* See parent class for JsDoc */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const model = new cls({});\n if (!(model instanceof Sequential)) {\n throw new ValueError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n if (!(config instanceof Array)) {\n throw new ValueError(\n `Sequential.fromConfig called without an array of configs`);\n }\n if (!(config[0].className != null) || config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n for (const conf of config as serialization.ConfigDictArray) {\n const layer = deserialize(conf as serialization.ConfigDict) as Layer;\n model.add(layer);\n }\n return model;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const config: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n config.push({\n className: layer.getClassName(),\n config: layer.getConfig(),\n });\n }\n return config;\n }\n}\nserialization.SerializationMap.register(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\n// tslint:disable:max-line-length\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {ContainerConfig} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {Model} from './engine/training';\nimport {loadModelInternal, Sequential, SequentialConfig} from './models';\n\n// tslint:enable:max-line-length\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Model and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `model` and `sequential` is that `model`\n * is more generic, supporting an arbitrary graph (without cycles) of layers.\n * `sequential` is less generic and supports only a linear stack of layers.\n *\n * When creating a `Model`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 2, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `sequential`, `loadModel`.\n */\n\n/**\n * @doc {heading: 'Models', subheading: 'Creation', configParamIndices: [0]}\n */\nexport function model(config: ContainerConfig): Model {\n return new Model(config);\n}\n\n/**\n * Creates a `Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a Sequential model should have a\n * defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `model` and `sequential` is that `sequential`\n * is less generic, supporting only a linear stack of layers. `model` is\n * more generic and supports an arbitrary graph (without cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n */\n/**\n * @doc {heading: 'Models', subheading: 'Creation', configParamIndices: [0]}\n */\nexport function sequential(config?: SequentialConfig): Sequential {\n return new Sequential(config);\n}\n\n/**\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * useDocsFrom: 'loadModelInternal'\n * }\n */\nexport function loadModel(pathOrIOHandler: string|\n io.IOHandler): Promise {\n return loadModelInternal(pathOrIOHandler);\n}\n\n/**\n * @doc {\n * heading: 'Models',\n * subheading: 'Inputs',\n * useDocsFrom: 'Input',\n * configParamIndices: [0]\n * }\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {getScalar} from './backend/state';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/** @docinline */\nexport type ActivationIdentifier = 'elu'|'hardSigmoid'|'linear'|'relu'|'relu6'|\n 'selu'|'sigmoid'|'softmax'|'softplus'|'softsign'|'tanh'|string;\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.SerializationMap.register(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.SerializationMap.register(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.SerializationMap.register(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(getScalar(6.0), tfc.relu(x)));\n }\n}\nserialization.SerializationMap.register(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.SerializationMap.register(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.SerializationMap.register(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.SerializationMap.register(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.SerializationMap.register(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.SerializationMap.register(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.SerializationMap.register(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.SerializationMap.register(Softmax);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config = {className: 'linear', config: {}};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config = {className: identifier, config: {}};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {elu, leakyRelu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {getExactlyOneTensor} from '../utils/types_utils';\n\nexport interface LeakyReLULayerConfig extends LayerConfig {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n */\nexport class LeakyReLU extends Layer {\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(config?: LeakyReLULayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n\n this.alpha = config.alpha == null ? this.DEFAULT_ALPHA : config.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(LeakyReLU);\n\n// TODO(cais): Implement PReLU\n\nexport interface ELULayerConfig extends LayerConfig {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n */\nexport class ELU extends Layer {\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(config?: ELULayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n\n if (config.alpha != null && config.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${config.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = config.alpha == null ? this.DEFAULT_ALPHA : config.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(ELU);\n\nexport interface ThresholdedReLULayerConfig extends LayerConfig {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n */\nexport class ThresholdedReLU extends Layer {\n static className = 'ThresholdedReLU';\n readonly theta: number;\n private readonly thetaTensor: Tensor;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(config?: ThresholdedReLULayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n\n this.theta = config.theta == null ? this.DEFAULT_THETA : config.theta;\n this.thetaTensor = getScalar(this.theta);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.thetaTensor), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(ThresholdedReLU);\n\nexport interface SoftmaxLayerConfig extends LayerConfig {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n */\nexport class Softmax extends Layer {\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(config?: SoftmaxLayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = config.axis == null ? this.DEFAULT_AXIS : config.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from './backend/state';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n// tslint:enable:max-line-length\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Config {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Config {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Config {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n */\n/** @doc {heading: 'Regularizers', namespace: 'regularizers'} */\nexport class L1L2 extends Regularizer {\n static className = 'L1L2';\n\n private readonly l1: Scalar;\n private readonly l2: Scalar;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(config?: L1L2Config) {\n super();\n\n const l1 = config == null || config.l1 == null ? 0.01 : config.l1;\n const l2 = config == null || config.l2 == null ? 0.01 : config.l2;\n this.hasL1 = l1 !== 0;\n this.hasL2 = l2 !== 0;\n\n this.l1 = getScalar(l1);\n this.l2 = getScalar(l2);\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1.dataSync()[0], 'l2': this.l2.dataSync()[0]};\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config.l1 as number, l2: config.l2 as number});\n }\n}\nserialization.SerializationMap.register(L1L2);\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param config l1 config.\n */\nexport function l1(config?: L1Config) {\n return new L1L2({l1: config != null ? config.l1 : null, l2: 0});\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param config l2 config.\n */\nexport function l2(config: L2Config) {\n return new L1L2({l2: config != null ? config.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {PaddingMode} from '../common';\nimport {ValueError} from '../errors';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be a tuple of ${n} integers. Received: ` +\n `${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be a tuple of ${\n n} integers. Received: ` +\n `${JSON.stringify(value)} including a non-integer number ` +\n `${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, DataFormat, PaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerConfig} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n// tslint:enable:max-line-length\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBias expects input to be of rank 3 or 4, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBias expects kernel to be of rank 3 or 4, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv2d(\n y as Tensor3D | Tensor4D, kernel as Tensor4D,\n strides as [number, number], padding === 'same' ? 'same' : 'valid',\n 'NHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport interface BaseConvLayerConfig extends LayerConfig {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: string;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D).\n */\nexport interface ConvLayerConfig extends BaseConvLayerConfig {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, config: BaseConvLayerConfig) {\n super(config as LayerConfig);\n BaseConv.verifyConfig(config);\n this.rank = rank;\n if (this.rank !== 1 && this.rank !== 2) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1 or 2 (${this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(config.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n config.strides == null ? 1 : config.strides, rank, 'strides');\n this.padding = config.padding == null ? 'valid' : config.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(config.activation);\n this.useBias = config.useBias == null ? true : config.useBias;\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(config.biasConstraint);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n this.activityRegularizer = getRegularizer(config.activityRegularizer);\n this.dilationRate = normalizeArray(\n config.dilationRate == null ? 1 : config.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) &&\n (this.dilationRate as number[]).length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n }\n if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyConfig(config: BaseConvLayerConfig) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in config, `required key 'kernelSize' not in config`);\n if (typeof config.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n config.kernelSize, 'number', 1, 2))\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(config.kernelSize)}.`);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, config: ConvLayerConfig) {\n super(rank, config as BaseConvLayerConfig);\n Conv.verifyConfig(config);\n this.filters = config.filters;\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n throw new NotImplementedError('3D convolution is not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyConfig(config: ConvLayerConfig) {\n // Check config.filters type, shape, and value.\n if (!('filters' in config) || typeof config.filters !== 'number' ||\n config.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(config.filters)}`);\n }\n }\n}\n\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n */\nexport class Conv2D extends Conv {\n static className = 'Conv2D';\n constructor(config: ConvLayerConfig) {\n super(2, config);\n Conv2D.verifyConfig(config);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyConfig(config: ConvLayerConfig) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof config.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n config.kernelSize, 'number', 1, 2))\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(config.kernelSize)}.`);\n }\n}\nserialization.SerializationMap.register(Conv2D);\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n */\nexport class Conv2DTranspose extends Conv2D {\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(config: ConvLayerConfig) {\n super(config);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]) as Tensor4D;\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.SerializationMap.register(Conv2DTranspose);\n\n\nexport interface SeparableConvLayerConfig extends ConvLayerConfig {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\n\nexport class SeparableConv extends Conv {\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerConfig) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n */\nexport class SeparableConv2D extends SeparableConv {\n static className = 'SeparableConv2D';\n constructor(config?: SeparableConvLayerConfig) {\n super(2, config);\n }\n}\nserialization.SerializationMap.register(SeparableConv2D);\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n */\nexport class Conv1D extends Conv {\n static className = 'Conv1D';\n constructor(config: ConvLayerConfig) {\n super(1, config);\n Conv1D.verifyConfig(config);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n static verifyConfig(config: ConvLayerConfig) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof config.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n config.kernelSize, 'number', 1, 1))\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(config.kernelSize)}.`);\n }\n}\nserialization.SerializationMap.register(Conv1D);\n\nexport interface Cropping2DLayerConfig extends LayerConfig {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n */\nexport class Cropping2D extends Layer {\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(config: Cropping2DLayerConfig) {\n super(config);\n if (typeof config.cropping === 'number')\n this.cropping = [\n [config.cropping, config.cropping], [config.cropping, config.cropping]\n ];\n else if (typeof config.cropping[0] === 'number')\n this.cropping = [\n [config.cropping[0] as number, config.cropping[0] as number],\n [config.cropping[1] as number, config.cropping[1] as number]\n ];\n else\n this.cropping = config.cropping as [[number, number], [number, number]];\n this.dataFormat =\n config.dataFormat === undefined ? 'channelsLast' : config.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst')\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1]\n ];\n else\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Cropping2D);\n\nexport interface UpSampling2DLayerConfig extends LayerConfig {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n */\nexport class UpSampling2D extends Layer {\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n\n constructor(config: UpSampling2DLayerConfig) {\n super(config);\n this.inputSpec = [{ndim: 4}];\n this.size = config.size == null ? this.DEFAULT_SIZE : config.size;\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n const resized = input.resizeNearestNeighbor([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return input.resizeNearestNeighbor([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\n// tslint:disable:max-line-length\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, DataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerConfig, ConvLayerConfig, preprocessConv2DInput} from './convolutional';\n\n// tslint:enable:max-line-length\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport interface DepthwiseConv2DLayerConfig extends BaseConvLayerConfig {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n */\nexport class DepthwiseConv2D extends BaseConv {\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(config: DepthwiseConv2DLayerConfig) {\n super(2, config as ConvLayerConfig);\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.SerializationMap.register(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\n// tslint:disable:max-line-length\nimport {Activation as ActivationFn, ActivationIdentifier, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n// tslint:enable:max-line-length\n\nexport interface DropoutLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n */\nexport class Dropout extends Layer {\n static className = 'Dropout';\n private readonly rate: number;\n private readonly rateScalar: Scalar;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(config: DropoutLayerConfig) {\n super(config);\n this.rate = Math.max(Math.min(config.rate, 1), 0);\n this.rateScalar = getScalar(this.rate);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = config.noiseShape;\n this.seed = config.seed;\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Non-default seed is not implemented in Dropout layer yet: ' +\n this.seed);\n }\n this.supportsMasking = true;\n }\n\n private getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (this.noiseShape != null &&\n !util.arraysEqual(input.shape, this.noiseShape)) {\n throw new NotImplementedError(\n 'Non-default noise shape is not implemented in Dropout ' +\n 'layer yet: ' + JSON.stringify(this.noiseShape));\n }\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output =\n K.inTrainPhase(\n () => K.dropout(input, this.rateScalar, noiseShape, this.seed),\n () => input, training) as Tensor;\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Dropout);\n\nexport interface DenseLayerConfig extends LayerConfig {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n */\nexport class Dense extends Layer {\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(config: DenseLayerConfig) {\n super(config);\n if (config.batchInputShape == null && config.inputShape == null &&\n config.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (config.batchSize != null) {\n batchSize = config.batchSize;\n }\n this.batchInputShape = [batchSize, config.inputDim];\n }\n\n this.units = config.units;\n this.activation = getActivation(config.activation);\n if (config.useBias != null) {\n this.useBias = config.useBias;\n }\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n this.activityRegularizer = getRegularizer(config.activityRegularizer);\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n let output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Dense);\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n */\nexport class Flatten extends Layer {\n static className = 'Flatten';\n constructor(config?: LayerConfig) {\n super(config || {});\n this.inputSpec = [{minNDim: 3}];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], math_utils.arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return K.batchFlatten(getExactlyOneTensor(inputs));\n });\n }\n}\nserialization.SerializationMap.register(Flatten);\n\nexport interface ActivationLayerConfig extends LayerConfig {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n */\nexport class Activation extends Layer {\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(config: ActivationLayerConfig) {\n super(config);\n this.supportsMasking = true;\n this.activation = getActivation(config.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Activation);\n\nexport interface ReshapeLayerConfig extends LayerConfig {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport interface RepeatVectorLayerConfig extends LayerConfig {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n */\nexport class RepeatVector extends Layer {\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(config: RepeatVectorLayerConfig) {\n super(config);\n this.n = config.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(RepeatVector);\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary: although all dimensions in the input shape must be fixed.\n * Use the ReshapeLayerConfig field `input_shape` when using this layer\n * as the first layer in a model.\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n */\nexport class Reshape extends Layer {\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(config: ReshapeLayerConfig) {\n super(config);\n this.targetShape = config.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = math_utils.arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Reshape);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\n// tslint:disable:max-line-length\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n// tslint:enable:max-line-length\n\nexport interface EmbeddingLayerConfig extends LayerConfig {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n */\nexport class Embedding extends Layer {\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(config: EmbeddingLayerConfig) {\n super(config);\n if (config.batchInputShape == null && config.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (config.batchSize != null) {\n batchSize = config.batchSize;\n }\n if (config.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(config.inputLength));\n }\n }\n this.inputDim = config.inputDim;\n this.outputDim = config.outputDim;\n this.embeddingsInitializer = getInitializer(\n config.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(config.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(config.activityRegularizer);\n this.embeddingsConstraint = getConstraint(config.embeddingsConstraint);\n this.maskZero = config.maskZero;\n this.inputLength = config.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n throw new NotImplementedError(\n 'computeMask has not been implemented for Embedding yet');\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nserialization.SerializationMap.register(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerConfig, SymbolicTensor} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(config?: LayerConfig) {\n super(config || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n // TODO(cais): Implement computeMask();\n}\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Add extends Merge {\n static className = 'Add';\n constructor(config?: LayerConfig) {\n super(config as LayerConfig);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = tfc.zeros(inputs[0].shape);\n for (const input of inputs) {\n output = tfc.add(output, input);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Add(config);\n }\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n */\nexport class Multiply extends Merge {\n static className = 'Multiply';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = tfc.ones(inputs[0].shape);\n for (const input of inputs) {\n output = tfc.mul(output, input);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Average extends Merge {\n static className = 'Average';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = tfc.zeros(inputs[0].shape);\n for (const input of inputs) {\n output = tfc.add(output, input);\n }\n return tfc.mul(getScalar(1 / inputs.length), output);\n });\n }\n}\nserialization.SerializationMap.register(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Average(config);\n }\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Maximum extends Merge {\n static className = 'Maximum';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Minimum extends Merge {\n static className = 'Minimum';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport interface ConcatenateLayerConfig extends LayerConfig {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n */\nexport class Concatenate extends Merge {\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(config?: ConcatenateLayerConfig) {\n super(config);\n if (config == null) {\n config = {};\n }\n this.axis = config.axis == null ? this.DEFAULT_AXIS : config.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n // TODO(cais): Implement computeMask();\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerConfig): Layer|SymbolicTensor|\n Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\n// TODO(cais): Add class Dot.\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerConfig} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n// tslint:enable:max-line-length\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNormalization2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, epsilon, gamma as Tensor2D | Tensor1D,\n beta as Tensor2D | Tensor1D);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNormalization3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, epsilon, gamma as Tensor3D | Tensor1D,\n beta as Tensor3D | Tensor1D);\n } else if (x.rank === 4) {\n out = tfc.batchNormalization4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, epsilon, gamma as Tensor4D | Tensor1D,\n beta as Tensor4D | Tensor1D);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implememnted for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport interface BatchNormalizationLayerConfig extends LayerConfig {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n */\nexport class BatchNormalization extends Layer {\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n private stepCount: number;\n\n constructor(config: BatchNormalizationLayerConfig) {\n super(config);\n this.supportsMasking = true;\n this.axis = config.axis == null ? -1 : config.axis;\n this.momentum = config.momentum == null ? 0.99 : config.momentum;\n this.epsilon = config.epsilon == null ? 1e-3 : config.epsilon;\n this.center = config.center == null ? true : config.center;\n this.scale = config.scale == null ? true : config.scale;\n this.betaInitializer = getInitializer(config.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(config.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(config.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(config.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(config.betaConstraint);\n this.gammaConstraint = getConstraint(config.gammaConstraint);\n this.betaRegularizer = getRegularizer(config.betaRegularizer);\n this.gammaRegularizer = getRegularizer(config.gammaRegularizer);\n this.stepCount = 0;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n // Debias variance.\n const sampleSize =\n math_utils.arrayProd(reductionAxes.map(axis => input.shape[axis]));\n const varianceDebiased = variance.mul(\n getScalar(sampleSize / (sampleSize - (1 + this.epsilon))));\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n this.stepCount++;\n const newMovingMean = tfc.movingAverage(\n this.movingMean.read(), mean, this.momentum, this.stepCount);\n this.movingMean.write(newMovingMean);\n const newMovingVariance = tfc.movingAverage(\n this.movingVariance.read(), varianceDebiased, this.momentum,\n this.stepCount);\n this.movingVariance.write(newMovingVariance);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(BatchNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {DataFormat} from '../common';\nimport {InputSpec, Layer, LayerConfig} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n// tslint:enable:max-line-length\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport interface ZeroPadding2DLayerConfig extends LayerConfig {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n */\nexport class ZeroPadding2D extends Layer {\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(config?: ZeroPadding2DLayerConfig) {\n if (config == null) {\n config = {};\n }\n super(config);\n\n this.dataFormat =\n config.dataFormat == null ? imageDataFormat() : config.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (config.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof config.padding === 'number') {\n this.padding =\n [[config.padding, config.padding], [config.padding, config.padding]];\n } else {\n config.padding = config.padding as [number, number] |\n [[number, number], [number, number]];\n if (config.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${config.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof config.padding[0] === 'number') {\n heightPadding =\n [config.padding[0] as number, config.padding[0] as number];\n widthPadding =\n [config.padding[1] as number, config.padding[1] as number];\n } else {\n config.padding = config.padding as [[number, number], [number, number]];\n\n if (config.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${config.padding[0].length} array.`);\n }\n heightPadding = config.padding[0] as [number, number];\n\n if (config.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${config.padding[1].length} array.`);\n }\n widthPadding = config.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode, DataFormat, PaddingMode, PoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput} from './convolutional';\n\n// tslint:enable:max-line-length\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n\nexport interface Pooling1DLayerConfig extends LayerConfig {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number;\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number;\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param config Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(config: Pooling1DLayerConfig) {\n if (config.poolSize == null) {\n config.poolSize = 2;\n }\n super(config);\n if (typeof config.poolSize === 'number') {\n this.poolSize = [config.poolSize];\n } else if (\n Array.isArray(config.poolSize) &&\n (config.poolSize as number[]).length === 1 &&\n typeof (config.poolSize as number[])[0] === 'number') {\n this.poolSize = config.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(config.poolSize)}`);\n }\n if (config.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof config.strides === 'number') {\n this.strides = [config.strides];\n } else if (\n Array.isArray(config.strides) &&\n (config.strides as number[]).length === 1 &&\n typeof (config.strides as number[])[0] === 'number') {\n this.strides = config.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(config.strides)}`);\n }\n }\n\n this.padding = config.padding == null ? 'valid' : config.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n */\nexport class MaxPooling1D extends Pooling1D {\n static className = 'MaxPooling1D';\n constructor(config: Pooling1DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.SerializationMap.register(MaxPooling1D);\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n */\nexport class AveragePooling1D extends Pooling1D {\n static className = 'AveragePooling1D';\n constructor(config: Pooling1DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.SerializationMap.register(AveragePooling1D);\n\nexport interface Pooling2DLayerConfig extends LayerConfig {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(config: Pooling2DLayerConfig) {\n if (config.poolSize == null) {\n config.poolSize = [2, 2];\n }\n super(config);\n this.poolSize = Array.isArray(config.poolSize) ?\n config.poolSize :\n [config.poolSize, config.poolSize];\n if (config.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(config.strides)) {\n if (config.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${config.strides.length}.`);\n }\n this.strides = config.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [config.strides, config.strides];\n }\n this.padding = config.padding == null ? 'valid' : config.padding;\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n */\nexport class MaxPooling2D extends Pooling2D {\n static className = 'MaxPooling2D';\n constructor(config: Pooling2DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.SerializationMap.register(MaxPooling2D);\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n */\nexport class AveragePooling2D extends Pooling2D {\n static className = 'AveragePooling2D';\n constructor(config: Pooling2DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.SerializationMap.register(AveragePooling2D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(config: LayerConfig) {\n super(config);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n */\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n static className = 'GlobalAveragePooling1D';\n constructor(config: LayerConfig) {\n super(config);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.SerializationMap.register(GlobalAveragePooling1D);\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n */\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n static className = 'GlobalMaxPooling1D';\n constructor(config: LayerConfig) {\n super(config);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.SerializationMap.register(GlobalMaxPooling1D);\n\nexport interface GlobalPooling2DLayerConfig extends LayerConfig {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(config: GlobalPooling2DLayerConfig) {\n super(config);\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n */\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.SerializationMap.register(GlobalAveragePooling2D);\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n */\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.SerializationMap.register(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, ActivationIdentifier, getActivation, serializeActivation} from '../activations';\nimport {getScalar} from '../backend/state';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction, Shape} from '../types';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\nimport {deserialize} from './serialization';\n\n// tslint:enable:max-line-length\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param inputLength Not relevant in this deeplearn.js backend.\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n inputLength?: number): [Tensor, Tensor, Tensor[]] {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (mask != null) {\n throw new NotImplementedError(\n 'The rnn() function of the deeplearn.js backend does not support ' +\n 'masking yet.');\n }\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n // TODO(cais): Determine in what exact way the learning phase information\n // will be passed.\n\n let outputs: Tensor;\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n for (let t = 0; t < timeSteps; ++t) {\n let currentInput = K.sliceAlongFirstAxis(inputs, t, 1);\n currentInput = currentInput.reshape(currentInput.shape.slice(1));\n const stepOutputs = stepFunction(currentInput, states);\n lastOutput = stepOutputs[0];\n if (t === 0) {\n outputs = lastOutput.reshape([1].concat(lastOutput.shape));\n } else {\n outputs = K.concatAlongFirstAxis(\n outputs, lastOutput.reshape([1].concat(lastOutput.shape)));\n }\n // TODO(soergel): Call K.concatenate() to perform only one concatenation\n // at the end, once the backend function is available.\n states = stepOutputs[1];\n }\n\n return [\n lastOutput,\n tfc.transpose(\n outputs, [1, 0].concat(math_utils.range(2, outputs.shape.length))),\n states\n ];\n}\n\n\nexport interface BaseRNNLayerConfig extends LayerConfig {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n */\n stateful?: boolean;\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer sbutypes.\n */\nexport interface RNNLayerConfig extends BaseRNNLayerConfig {\n cell: RNNCell|RNNCell[];\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.reset_states()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n */\nexport class RNN extends Layer {\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n public states: Tensor[];\n\n private numConstants: number;\n\n constructor(config: RNNLayerConfig) {\n super(config);\n let cell: RNNCell;\n if (config.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(config.cell)) {\n cell = new StackedRNNCells({cells: config.cell});\n } else {\n cell = config.cell;\n }\n if ((cell as RNNCell).stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n config.returnSequences == null ? false : config.returnSequences;\n this.returnState = config.returnState == null ? false : config.returnState;\n this.goBackwards = config.goBackwards == null ? false : config.goBackwards;\n this._stateful = config.stateful == null ? false : config.stateful;\n this.unroll = config.unroll == null ? false : config.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n throw new NotImplementedError(\n 'computeMask has not been implemented for RNN yet');\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape[inputShape.length - 1];\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray((this.cell as RNNCell).stateSize)) {\n stateSize = this.cell.stateSize as number[];\n } else {\n stateSize = [this.cell.stateSize as number];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n throw new NotImplementedError(\n 'stateful RNN layer is not implemented yet');\n // TODO(cais): Uncomment the following line once stateful = true is\n // implemented.\n // this.resetStates();\n }\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetState() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n for (let index = 0; index < this.states.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states[index] = value;\n }\n }\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `SymbolicTensor`s, then add them to the inputs and temporarily modify the\n // input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n throw new NotImplementedError(\n 'stateful RNN layer is not implemented yet.');\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n if (mask != null) {\n throw new NotImplementedError('Masking is not implemented for RNN yet');\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n const inputShape = inputs.shape;\n const timesteps = inputShape[1];\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n // TODO(cais): Add support for masks.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, null, null,\n this.unroll, timesteps);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n throw new NotImplementedError(\n 'stateful RNN layer is not implemented yet');\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n if (this.numConstants != null) {\n config.numConstants = this.numConstants;\n }\n const cellConfig = this.cell.getConfig();\n config.cell = {\n className: this.cell.getClassName(),\n config: cellConfig,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(RNN);\n\n/**\n * An RNNCell layer.\n */\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/** @doc {heading: 'Layers', subheading: 'Classes'} */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n public stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport interface SimpleRNNCellLayerConfig extends LayerConfig {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n */\nexport class SimpleRNNCell extends RNNCell {\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(config: SimpleRNNCellLayerConfig) {\n super(config);\n this.units = config.units;\n this.activation = getActivation(\n config.activation == null ? this.DEFAULT_ACTIVATION :\n config.activation);\n this.useBias = config.useBias == null ? true : config.useBias;\n\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n config.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.recurrentConstraint = getConstraint(config.recurrentConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, config.recurrentDropout == null ? 0 : config.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask(\n () => tfc.onesLike(inputs as Tensor),\n this.dropout, training) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask =\n generateDropoutMask(\n () => tfc.onesLike(prevOutput), this.recurrentDropout,\n training) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(SimpleRNNCell);\n\nexport interface SimpleRNNLayerConfig extends BaseRNNLayerConfig {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n */\nexport class SimpleRNN extends RNN {\n static className = 'SimpleRNN';\n constructor(config: SimpleRNNLayerConfig) {\n config.cell = new SimpleRNNCell(config);\n super(config as RNNLayerConfig);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n // TODO(cais): Research possibility of refactoring out the tedious all\n // the getters that delegate to `this.cell` below.\n get units(): number {\n return (this.cell as SimpleRNNCell).units;\n }\n\n get activation(): Activation {\n return (this.cell as SimpleRNNCell).activation;\n }\n\n get useBias(): boolean {\n return (this.cell as SimpleRNNCell).useBias;\n }\n\n get kernelInitializer(): Initializer {\n return (this.cell as SimpleRNNCell).kernelInitializer;\n }\n\n get recurrentInitializer(): Initializer {\n return (this.cell as SimpleRNNCell).recurrentInitializer;\n }\n\n get biasInitializer(): Initializer {\n return (this.cell as SimpleRNNCell).biasInitializer;\n }\n\n get kernelRegularizer(): Regularizer {\n return (this.cell as SimpleRNNCell).kernelRegularizer;\n }\n\n get recurrentRegularizer(): Regularizer {\n return (this.cell as SimpleRNNCell).recurrentRegularizer;\n }\n\n get biasRegularizer(): Regularizer {\n return (this.cell as SimpleRNNCell).biasRegularizer;\n }\n\n get kernelConstraint(): Constraint {\n return (this.cell as SimpleRNNCell).kernelConstraint;\n }\n\n get recurrentConstraint(): Constraint {\n return (this.cell as SimpleRNNCell).recurrentConstraint;\n }\n\n get biasConstraint(): Constraint {\n return (this.cell as SimpleRNNCell).biasConstraint;\n }\n\n get dropout(): number {\n return (this.cell as SimpleRNNCell).dropout;\n }\n\n get recurrentDropout(): number {\n return (this.cell as SimpleRNNCell).recurrentDropout;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n const baseConfig = super.getConfig();\n delete baseConfig['cell'];\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport interface GRUCellLayerConfig extends SimpleRNNCellLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: string;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: number;\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n */\nexport class GRUCell extends RNNCell {\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(config: GRUCellLayerConfig) {\n super(config);\n\n this.units = config.units;\n this.activation = getActivation(\n config.activation === undefined ? this.DEFAULT_ACTIVATION :\n config.activation);\n this.recurrentActivation = getActivation(\n config.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n config.recurrentActivation);\n this.useBias = config.useBias == null ? true : config.useBias;\n\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n config.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.recurrentConstraint = getConstraint(config.recurrentConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, config.recurrentDropout == null ? 0 : config.recurrentDropout])\n ]);\n this.implementation = config.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask(\n () => tfc.onesLike(inputs as Tensor),\n this.dropout, training, 3) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask =\n generateDropoutMask(\n () => tfc.onesLike(hTMinus1), this.recurrentDropout, training,\n 3) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n if (this.implementation === 1) {\n const kernelZ = K.sliceAlongLastAxis(this.kernel.read(), 0, this.units);\n const kernelR =\n K.sliceAlongLastAxis(this.kernel.read(), this.units, this.units);\n const kernelH = K.sliceAlongLastAxis(\n this.kernel.read(), this.units * 2, this.units);\n const recurrentKernelZ =\n K.sliceAlongLastAxis(this.recurrentKernel.read(), 0, this.units);\n const recurrentKernelR = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units, this.units);\n const recurrentKernelH = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units * 2, this.units);\n\n let inputsZ: Tensor, inputsR: Tensor, inputsH: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputsZ = tfc.mul(inputs, dpMask[0]);\n inputsR = tfc.mul(inputs, dpMask[1]);\n inputsH = tfc.mul(inputs, dpMask[2]);\n } else {\n inputsZ = inputs;\n inputsR = inputs;\n inputsH = inputs;\n }\n\n let xZ = K.dot(inputsZ, kernelZ);\n let xR = K.dot(inputsR, kernelR);\n let xH = K.dot(inputsH, kernelH);\n if (this.useBias) {\n const biasZ = K.sliceAlongFirstAxis(this.bias.read(), 0, this.units);\n const biasR =\n K.sliceAlongFirstAxis(this.bias.read(), this.units, this.units);\n const biasH = K.sliceAlongFirstAxis(\n this.bias.read(), this.units * 2, this.units);\n xZ = K.biasAdd(xZ, biasZ);\n xR = K.biasAdd(xR, biasR);\n xH = K.biasAdd(xH, biasH);\n }\n\n let hTMinus1Z: Tensor;\n let hTMinus1R: Tensor;\n let hTMinus1H: Tensor;\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1Z = tfc.mul(hTMinus1, recDpMask[0]);\n hTMinus1R = tfc.mul(hTMinus1, recDpMask[1]);\n hTMinus1H = tfc.mul(hTMinus1, recDpMask[2]);\n } else {\n hTMinus1Z = hTMinus1;\n hTMinus1R = hTMinus1;\n hTMinus1H = hTMinus1;\n }\n z = this.recurrentActivation.apply(\n tfc.add(xZ, K.dot(hTMinus1Z, recurrentKernelZ)));\n r = this.recurrentActivation.apply(\n tfc.add(xR, K.dot(hTMinus1R, recurrentKernelR)));\n hh = this.activation.apply(\n tfc.add(xH, K.dot(tfc.mul(r, hTMinus1H), recurrentKernelH)));\n } else {\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.dropout && this.dropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n const matrixInner = K.dot(\n hTMinus1,\n K.sliceAlongLastAxis(\n this.recurrentKernel.read(), 0, 2 * this.units));\n\n const xZ = K.sliceAlongLastAxis(matrixX, 0, this.units);\n const xR = K.sliceAlongLastAxis(matrixX, this.units, this.units);\n const recurrentZ = K.sliceAlongLastAxis(matrixInner, 0, this.units);\n const recurrentR =\n K.sliceAlongLastAxis(matrixInner, this.units, this.units);\n\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const xH = K.sliceAlongLastAxis(matrixX, 2 * this.units, this.units);\n const recurrentH = K.dot(\n tfc.mul(r, hTMinus1),\n K.sliceAlongLastAxis(\n this.recurrentKernel.read(), 2 * this.units, this.units));\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n }\n\n const h = tfc.add(\n tfc.mul(z, hTMinus1), tfc.mul(tfc.add(getScalar(1), tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport interface GRULayerConfig extends SimpleRNNLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: string;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: number;\n}\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n */\nexport class GRU extends RNN {\n static className = 'GRU';\n constructor(config: GRULayerConfig) {\n if (config.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n config.cell = new GRUCell(config);\n super(config as RNNLayerConfig);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n get units(): number {\n return (this.cell as GRUCell).units;\n }\n\n get activation(): Activation {\n return (this.cell as GRUCell).activation;\n }\n\n get recurrentActivation(): Activation {\n return (this.cell as GRUCell).recurrentActivation;\n }\n\n get useBias(): boolean {\n return (this.cell as GRUCell).useBias;\n }\n\n get kernelInitializer(): Initializer {\n return (this.cell as GRUCell).kernelInitializer;\n }\n\n get recurrentInitializer(): Initializer {\n return (this.cell as GRUCell).recurrentInitializer;\n }\n\n get biasInitializer(): Initializer {\n return (this.cell as GRUCell).biasInitializer;\n }\n\n get kernelRegularizer(): Regularizer {\n return (this.cell as GRUCell).kernelRegularizer;\n }\n\n get recurrentRegularizer(): Regularizer {\n return (this.cell as GRUCell).recurrentRegularizer;\n }\n\n get biasRegularizer(): Regularizer {\n return (this.cell as GRUCell).biasRegularizer;\n }\n\n get kernelConstraint(): Constraint {\n return (this.cell as GRUCell).kernelConstraint;\n }\n\n get recurrentConstraint(): Constraint {\n return (this.cell as GRUCell).recurrentConstraint;\n }\n\n get biasConstraint(): Constraint {\n return (this.cell as GRUCell).biasConstraint;\n }\n\n get dropout(): number {\n return (this.cell as GRUCell).dropout;\n }\n\n get recurrentDropout(): number {\n return (this.cell as GRUCell).recurrentDropout;\n }\n\n get implementation(): number {\n return (this.cell as GRUCell).implementation;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n delete baseConfig['cell'];\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.SerializationMap.register(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport interface LSTMCellLayerConfig extends SimpleRNNCellLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: 1|2;\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n */\nexport class LSTMCell extends RNNCell {\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(config: LSTMCellLayerConfig) {\n super(config);\n\n this.units = config.units;\n this.activation = getActivation(\n config.activation === undefined ? this.DEFAULT_ACTIVATION :\n config.activation);\n this.recurrentActivation = getActivation(\n config.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n config.recurrentActivation);\n this.useBias = config.useBias == null ? true : config.useBias;\n\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n config.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = config.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.recurrentConstraint = getConstraint(config.recurrentConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, config.recurrentDropout == null ? 0 : config.recurrentDropout])\n ]);\n this.implementation = config.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask(\n () => tfc.onesLike(inputs as Tensor),\n this.dropout, training, 4) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask =\n generateDropoutMask(\n () => tfc.onesLike(hTMinus1), this.recurrentDropout, training,\n 4) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (this.implementation === 1) {\n const kernelI = K.sliceAlongLastAxis(this.kernel.read(), 0, this.units);\n const kernelF =\n K.sliceAlongLastAxis(this.kernel.read(), this.units, this.units);\n const kernelC = K.sliceAlongLastAxis(\n this.kernel.read(), this.units * 2, this.units);\n const kernelO = K.sliceAlongLastAxis(\n this.kernel.read(), this.units * 3, this.units);\n const recurrentKernelI =\n K.sliceAlongLastAxis(this.recurrentKernel.read(), 0, this.units);\n const recurrentKernelF = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units, this.units);\n const recurrentKernelC = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units * 2, this.units);\n const recurrentKernelO = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units * 3, this.units);\n\n let inputsI: Tensor, inputsF: Tensor, inputsC: Tensor, inputsO: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputsI = tfc.mul(inputs, dpMask[0]);\n inputsF = tfc.mul(inputs, dpMask[1]);\n inputsC = tfc.mul(inputs, dpMask[2]);\n inputsO = tfc.mul(inputs, dpMask[3]);\n } else {\n inputsI = inputs;\n inputsF = inputs;\n inputsC = inputs;\n inputsO = inputs;\n }\n\n let xI = K.dot(inputsI, kernelI);\n let xF = K.dot(inputsF, kernelF);\n let xC = K.dot(inputsC, kernelC);\n let xO = K.dot(inputsO, kernelO);\n if (this.useBias) {\n const biasI = K.sliceAlongFirstAxis(this.bias.read(), 0, this.units);\n const biasF =\n K.sliceAlongFirstAxis(this.bias.read(), this.units, this.units);\n const biasC = K.sliceAlongFirstAxis(\n this.bias.read(), this.units * 2, this.units);\n const biasO = K.sliceAlongFirstAxis(\n this.bias.read(), this.units * 3, this.units);\n xI = K.biasAdd(xI, biasI);\n xF = K.biasAdd(xF, biasF);\n xC = K.biasAdd(xC, biasC);\n xO = K.biasAdd(xO, biasO);\n }\n\n let hTMinus1I: Tensor, hTMinus1F: Tensor, hTMinus1C: Tensor,\n hTMinus1O: Tensor;\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1I = tfc.mul(hTMinus1, recDpMask[0]);\n hTMinus1F = tfc.mul(hTMinus1, recDpMask[1]);\n hTMinus1C = tfc.mul(hTMinus1, recDpMask[2]);\n hTMinus1O = tfc.mul(hTMinus1, recDpMask[3]);\n } else {\n hTMinus1I = hTMinus1;\n hTMinus1F = hTMinus1;\n hTMinus1C = hTMinus1;\n hTMinus1O = hTMinus1;\n }\n i = this.recurrentActivation.apply(\n tfc.add(xI, K.dot(hTMinus1I, recurrentKernelI)));\n f = this.recurrentActivation.apply(\n tfc.add(xF, K.dot(hTMinus1F, recurrentKernelF)));\n c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(\n i,\n this.activation.apply(\n tfc.add(xC, K.dot(hTMinus1C, recurrentKernelC)))));\n o = this.recurrentActivation.apply(\n tfc.add(xO, K.dot(hTMinus1O, recurrentKernelO)));\n } else {\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const z0 = K.sliceAlongLastAxis(z, 0, this.units);\n const z1 = K.sliceAlongLastAxis(z, this.units, this.units);\n const z2 = K.sliceAlongLastAxis(z, this.units * 2, this.units);\n const z3 = K.sliceAlongLastAxis(z, this.units * 3, this.units);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(\n tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n }\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport interface LSTMLayerConfig extends SimpleRNNLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: string;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: 1|2;\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n */\nexport class LSTM extends RNN {\n static className = 'LSTM';\n constructor(config: LSTMLayerConfig) {\n if (config.implementation as number === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n config.cell = new LSTMCell(config);\n super(config as RNNLayerConfig);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n get units(): number {\n return (this.cell as LSTMCell).units;\n }\n\n get activation(): Activation {\n return (this.cell as LSTMCell).activation;\n }\n\n get recurrentActivation(): Activation {\n return (this.cell as LSTMCell).recurrentActivation;\n }\n\n get useBias(): boolean {\n return (this.cell as LSTMCell).useBias;\n }\n\n get kernelInitializer(): Initializer {\n return (this.cell as LSTMCell).kernelInitializer;\n }\n\n get recurrentInitializer(): Initializer {\n return (this.cell as LSTMCell).recurrentInitializer;\n }\n\n get biasInitializer(): Initializer {\n return (this.cell as LSTMCell).biasInitializer;\n }\n\n get unitForgetBias(): boolean {\n return (this.cell as LSTMCell).unitForgetBias;\n }\n\n get kernelRegularizer(): Regularizer {\n return (this.cell as LSTMCell).kernelRegularizer;\n }\n\n get recurrentRegularizer(): Regularizer {\n return (this.cell as LSTMCell).recurrentRegularizer;\n }\n\n get biasRegularizer(): Regularizer {\n return (this.cell as LSTMCell).biasRegularizer;\n }\n\n get kernelConstraint(): Constraint {\n return (this.cell as LSTMCell).kernelConstraint;\n }\n\n get recurrentConstraint(): Constraint {\n return (this.cell as LSTMCell).recurrentConstraint;\n }\n\n get biasConstraint(): Constraint {\n return (this.cell as LSTMCell).biasConstraint;\n }\n\n get dropout(): number {\n return (this.cell as LSTMCell).dropout;\n }\n\n get recurrentDropout(): number {\n return (this.cell as LSTMCell).recurrentDropout;\n }\n\n get implementation(): number {\n return (this.cell as LSTMCell).implementation;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n delete baseConfig['cell'];\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.SerializationMap.register(LSTM);\n\nexport interface StackedRNNCellsConfig extends LayerConfig {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n */\nexport class StackedRNNCells extends RNNCell {\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(config: StackedRNNCellsConfig) {\n super(config);\n this.cells = config.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n for (const cell of this.cells) {\n // TODO(cais): Take care of input constants.\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim];\n }\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const cellConfigs: serialization.ConfigDict[] = [];\n for (const cell of this.cells) {\n cellConfigs.push({\n 'className': this.getClassName(),\n 'config': cell.getConfig(),\n });\n }\n const config: serialization.ConfigDict = {'cells': cellConfigs};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `Tensor`s with shapes and types matching the\n * output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.SerializationMap.register(StackedRNNCells);\n\nfunction generateDropoutMask(\n ones: () => Tensor, rate: number, training: boolean = null,\n count = 1): Tensor|Tensor[] {\n function droppedInputs(): Tensor {\n return K.dropout(ones(), getScalar(rate));\n }\n if (count > 1) {\n const mask: Tensor[] = [];\n for (let i = 0; i < count; i++) {\n mask.push(K.inTrainPhase(droppedInputs, ones, training));\n }\n mask.forEach(m => tfc.keep(m));\n return mask;\n } else {\n return tfc.keep(K.inTrainPhase(droppedInputs, ones, training));\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from '../backend/state';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerConfig, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\n// tslint:enable:max-line-length\n\nexport interface WrapperLayerConfig extends LayerConfig {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(config: WrapperLayerConfig) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(config);\n this.layer = config.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n */\nexport class TimeDistributed extends Wrapper {\n static className = 'TimeDistributed';\n constructor(config: WrapperLayerConfig) {\n super(config);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n const output = this.layer.call(inputs, kwargs) as Tensor;\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false, null, null, false, inputs.shape[1]);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n}\nserialization.SerializationMap.register(TimeDistributed);\n\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport interface BidirectionalLayerConfig extends WrapperLayerConfig {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are combinied.\n * If `null` or `undefined`, the output will not be combined, they will be\n * returned as an `Array`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nexport class Bidirectional extends Wrapper {\n static className = 'Bidirectional';\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private mergeMode: BidirectionalMergeMode;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(config: BidirectionalLayerConfig) {\n super(config);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call `getConfig()`\n // followed by `deserialize()`. Without this cloning, the layer names\n // saved during serialization will incorrectly contain the 'forward_'\n // prefix.\n // In Python Keras, this is done using `copy.copy` (shallow copy), which\n // does not have a simple equivalent in JavaScript. JavaScript's\n // `Object.assign()` does not copy methods.\n const layerConfig = config.layer.getConfig();\n this.forwardLayer =\n deserialize(\n {className: config.layer.getClassName(), config: layerConfig}) as\n RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n this.backwardLayer =\n deserialize(\n {className: config.layer.getClassName(), config: layerConfig}) as\n RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n checkBidirectionalMergeMode(config.mergeMode);\n this.mergeMode = config.mergeMode;\n if (config.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = config.layer.stateful;\n this.returnSequences = config.layer.returnSequences;\n this.returnState = config.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = config.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape as Shape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs as Tensor | SymbolicTensor;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to this\n // method differ in how the initial states are passed. For symbolic calls,\n // the initial states are passed in the first arg, as an Array of\n // SymbolicTensors; for non-symbolic calls, they are passed in the second\n // arg as a part of the kwargs. Hence the need to temporarily modify\n // inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (kwargs['mask'] != null) {\n throw new NotImplementedError(\n 'The support for masking is not implemented for ' +\n 'Bidirectional layers yet.');\n }\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = (y as Tensor[]).slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(getScalar(0.5), tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n // TODO(cais): Implement computeMask().\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.SerializationMap.register(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable:max-line-length\n\nimport {InputLayer, InputLayerConfig} from './engine/input_layer';\nimport {Layer, LayerConfig} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerConfig, LeakyReLU, LeakyReLULayerConfig, Softmax, SoftmaxLayerConfig, ThresholdedReLU, ThresholdedReLULayerConfig} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, ConvLayerConfig, Cropping2D, Cropping2DLayerConfig, SeparableConv2D, SeparableConvLayerConfig, UpSampling2D, UpSampling2DLayerConfig} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerConfig} from './layers/convolutional_depthwise';\nimport {Activation, ActivationLayerConfig, Dense, DenseLayerConfig, Dropout, DropoutLayerConfig, Flatten, RepeatVector, RepeatVectorLayerConfig, Reshape, ReshapeLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerConfig} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerConfig, Maximum, Minimum, Multiply} from './layers/merge';\nimport {BatchNormalization, BatchNormalizationLayerConfig} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerConfig} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerConfig, MaxPooling1D, MaxPooling2D, Pooling1DLayerConfig, Pooling2DLayerConfig} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerConfig, GRULayerConfig, LSTM, LSTMCell, LSTMCellLayerConfig, LSTMLayerConfig, RNN, RNNCell, RNNLayerConfig, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerConfig, SimpleRNNLayerConfig, StackedRNNCells, StackedRNNCellsConfig} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerConfig, TimeDistributed, Wrapper, WrapperLayerConfig} from './layers/wrappers';\n\n\n// tslint:enable:max-line-length\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Inputs',\n * namespace: 'layers',\n * useDocsFrom: 'InputLayer',\n * configParamIndices: [0]\n * }\n */\nexport function inputLayer(config: InputLayerConfig): Layer {\n return new InputLayer(config);\n}\n\n// Advanced Activation Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'ELU',\n * configParamIndices: [0]\n * }\n */\nexport function elu(config?: ELULayerConfig): Layer {\n return new ELU(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'LeakyReLU',\n * configParamIndices: [0]\n * }\n */\nexport function leakyReLU(config?: LeakyReLULayerConfig): Layer {\n return new LeakyReLU(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'Softmax',\n * configParamIndices: [0]\n * }\n */\nexport function softmax(config?: SoftmaxLayerConfig): Layer {\n return new Softmax(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'ThresholdedReLU',\n * configParamIndices: [0]\n * }\n */\nexport function thresholdedReLU(config?: ThresholdedReLULayerConfig): Layer {\n return new ThresholdedReLU(config);\n}\n\n// Convolutional Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Conv1D',\n * configParamIndices: [0]\n * }\n */\nexport function conv1d(config: ConvLayerConfig): Layer {\n return new Conv1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Conv2D',\n * configParamIndices: [0]\n * }\n */\nexport function conv2d(config: ConvLayerConfig): Layer {\n return new Conv2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Conv2DTranspose',\n * configParamIndices: [0]\n * }\n */\nexport function conv2dTranspose(config: ConvLayerConfig): Layer {\n return new Conv2DTranspose(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'SeparableConv2D',\n * configParamIndices: [0]\n * }\n */\nexport function separableConv2d(config: SeparableConvLayerConfig): Layer {\n return new SeparableConv2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Cropping2D',\n * configParamIndices: [0]\n * }\n */\nexport function cropping2D(config: Cropping2DLayerConfig): Layer {\n return new Cropping2D(config);\n}\n\n/**\n * @doc{\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'UpSampling2D',\n * configParamIndices: [0]\n * }\n */\nexport function upSampling2d(config: UpSampling2DLayerConfig): Layer {\n return new UpSampling2D(config);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'DepthwiseConv2D',\n * configParamIndices: [0]\n * }\n */\n\nexport function depthwiseConv2d(config: DepthwiseConv2DLayerConfig): Layer {\n return new DepthwiseConv2D(config);\n}\n\n// Basic Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Activation',\n * configParamIndices: [0]\n * }\n */\nexport function activation(config: ActivationLayerConfig): Layer {\n return new Activation(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Dense',\n * configParamIndices: [0]\n * }\n */\nexport function dense(config: DenseLayerConfig): Layer {\n return new Dense(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Dropout',\n * configParamIndices: [0]\n * }\n */\nexport function dropout(config: DropoutLayerConfig): Layer {\n return new Dropout(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Flatten',\n * configParamIndices: [0]\n * }\n */\nexport function flatten(config?: LayerConfig): Layer {\n return new Flatten(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'RepeatVector',\n * configParamIndices: [0]\n * }\n */\nexport function repeatVector(config: RepeatVectorLayerConfig): Layer {\n return new RepeatVector(config);\n}\n\n/**\n * @doc{\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Reshape',\n * configParamIndices: [0]\n * }\n */\nexport function reshape(config: ReshapeLayerConfig): Layer {\n return new Reshape(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Embedding',\n * configParamIndices: [0]\n * }\n */\nexport function embedding(config: EmbeddingLayerConfig): Layer {\n return new Embedding(config);\n}\n\n// Merge Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Add',\n * configParamIndices: [0]\n * }\n */\nexport function add(config?: LayerConfig): Layer {\n return new Add(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Average',\n * configParamIndices: [0]\n * }\n */\nexport function average(config?: LayerConfig): Layer {\n return new Average(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Concatenate',\n * configParamIndices: [0]\n * }\n */\nexport function concatenate(config?: ConcatenateLayerConfig): Layer {\n return new Concatenate(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Maximum',\n * configParamIndices: [0]\n * }\n */\nexport function maximum(config?: LayerConfig): Layer {\n return new Maximum(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Minimum',\n * configParamIndices: [0]\n * }\n */\nexport function minimum(config?: LayerConfig): Layer {\n return new Minimum(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Multiply',\n * configParamIndices: [0]\n * }\n */\nexport function multiply(config?: LayerConfig): Layer {\n return new Multiply(config);\n}\n\n// Normalization Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Normalization',\n * namespace: 'layers',\n * useDocsFrom: 'BatchNormalization',\n * configParamIndices: [0]\n * }\n */\nexport function batchNormalization(config: BatchNormalizationLayerConfig):\n Layer {\n return new BatchNormalization(config);\n}\n\n// Padding Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Padding',\n * namespace: 'layers',\n * useDocsFrom: 'ZeroPadding2D',\n * configParamIndices: [0]\n * }\n */\nexport function zeroPadding2d(config?: ZeroPadding2DLayerConfig): Layer {\n return new ZeroPadding2D(config);\n}\n\n// Pooling Layers.\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'AveragePooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function averagePooling1d(config: Pooling1DLayerConfig): Layer {\n return new AveragePooling1D(config);\n}\nexport function avgPool1d(config: Pooling1DLayerConfig): Layer {\n return averagePooling1d(config);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(config: Pooling1DLayerConfig): Layer {\n return averagePooling1d(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'AveragePooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function averagePooling2d(config: Pooling2DLayerConfig): Layer {\n return new AveragePooling2D(config);\n}\nexport function avgPool2d(config: Pooling2DLayerConfig): Layer {\n return averagePooling2d(config);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(config: Pooling2DLayerConfig): Layer {\n return averagePooling2d(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalAveragePooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function globalAveragePooling1d(config: LayerConfig): Layer {\n return new GlobalAveragePooling1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalAveragePooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function globalAveragePooling2d(config: GlobalPooling2DLayerConfig):\n Layer {\n return new GlobalAveragePooling2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalMaxPooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function globalMaxPooling1d(config: LayerConfig): Layer {\n return new GlobalMaxPooling1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalMaxPooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function globalMaxPooling2d(config: GlobalPooling2DLayerConfig): Layer {\n return new GlobalMaxPooling2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'MaxPooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function maxPooling1d(config: Pooling1DLayerConfig): Layer {\n return new MaxPooling1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'MaxPooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function maxPooling2d(config: Pooling2DLayerConfig): Layer {\n return new MaxPooling2D(config);\n}\n\n// Recurrent Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'GRU',\n * configParamIndices: [0]\n * }\n */\nexport function gru(config: GRULayerConfig): Layer {\n return new GRU(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'GRUCell',\n * configParamIndices: [0]\n * }\n */\nexport function gruCell(config: GRUCellLayerConfig): RNNCell {\n return new GRUCell(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'LSTM',\n * configParamIndices: [0]\n * }\n */\nexport function lstm(config: LSTMLayerConfig): Layer {\n return new LSTM(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'LSTMCell',\n * configParamIndices: [0]\n * }\n */\nexport function lstmCell(config: LSTMCellLayerConfig): RNNCell {\n return new LSTMCell(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'SimpleRNN',\n * configParamIndices: [0]\n * }\n */\nexport function simpleRNN(config: SimpleRNNLayerConfig): Layer {\n return new SimpleRNN(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'SimpleRNNCell',\n * configParamIndices: [0]\n * }\n */\nexport function simpleRNNCell(config: SimpleRNNCellLayerConfig): RNNCell {\n return new SimpleRNNCell(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'RNN',\n * configParamIndices: [0]\n * }\n */\nexport function rnn(config: RNNLayerConfig): Layer {\n return new RNN(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'RNN',\n * configParamIndices: [0]\n * }\n */\nexport function stackedRNNCells(config: StackedRNNCellsConfig): RNNCell {\n return new StackedRNNCells(config);\n}\n\n// Wrapper Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Wrapper',\n * namespace: 'layers',\n * useDocsFrom: 'Bidirectional',\n * configParamIndices: [0]\n * }\n */\nexport function bidirectional(config: BidirectionalLayerConfig): Wrapper {\n return new Bidirectional(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Wrapper',\n * namespace: 'layers',\n * useDocsFrom: 'TimeDistributed',\n * configParamIndices: [0]\n * }\n */\nexport function timeDistributed(config: WrapperLayerConfig): Layer {\n return new TimeDistributed(config);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, input /* alias for tf.input */};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'binaryAccuracy'\n * }\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'binaryCrossentropy'\n * }\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'categoricalAccuracy'\n * }\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'categoricalCrossentropy'\n * }\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'cosineProximity'\n * }\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'meanAbsoluteError'\n * }\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'meanAbsolutePercentageError'\n * }\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'meanSquaredError'\n * }\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Config, L1L2, L1L2Config, L2Config, Regularizer} from './regularizers';\n\n/**\n * @doc {\n * heading: 'Regularizers',\n * namespace: 'regularizers',\n * useDocsFrom: 'L1L2',\n * configParamIndices: [0]\n * }\n */\nexport function l1l2(config?: L1L2Config): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * @doc {\n * heading: 'Regularizers',\n * namespace: 'regularizers',\n * useDocsFrom: 'L1L2',\n * configParamIndices: [0]\n * }\n */\nexport function l1(config?: L1Config): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * @doc {\n * heading: 'Regularizers',\n * namespace: 'regularizers',\n * useDocsFrom: 'L1L2',\n * configParamIndices: [0]\n * }\n */\nexport function l2(config?: L2Config): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {Model} from './engine/training';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: Model = null;\n\n setModel(model: Container): void {\n if (!(model instanceof Model)) {\n throw new Error('model must be a Model, not some other Container');\n }\n this.model = model as Model;\n }\n}\n"],"names":["scalar","keep","tslib_1.__extends","tidy","tfc.sqrt","tfc.sum","tfc.mulStrict","serialization","tfc.clipByValue","tfc.mul","tfc.div","tfc.add","tfc.relu","tensor1d","tfc.min","tfc.max","math_utils.arrayProd","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","tfc.concat","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","tfc.tile","mean","tfc.randomNormal","tfc.matMul","tfc.gather","tfc.elu","tfc.abs","util","tfc.step","tfc.neg","tfc.randomUniform","tfc.sub","zeros","ones","mul","randomUniform","K.randomNormal","truncatedNormal","eye","linalg","tfc.variable","generic_utils.toSnakeCase","generic_utils.singletonOrArray","generic_utils.toList","variable_utils.countParamsInWeights","types_utils.normalizeShapeList","dispose","add","div","K.square","tfc.onesLike","tfc.maximum","tfc.mean","tfc.log","tfc.softplus","tfc.softmax","tfc.floor","K.flatten","tfc.oneHot","tfc.zerosLike","tfc.exp","K.cast","tfc.greater","tfc.equal","tfc.argMax","lossBinaryCrossentropy","mse","MSE","mae","MAE","mape","MAPE","categoricalCrossentropy","categoricalCrossentropyLoss","cosine","sparseCategoricalCrossentropy","sparseCategoricalCrossentropyLoss","train","generic_utils.toCamelCase","generic_utils.stringToDType","Tensor","generic_utils.unique","generic_utils.assert","generic_utils.reverseNumberCompare","layersVersion","generic_utils.pyListRepeat","deserializeLayer","generic_utils.isObjectEmpty","cast","K.expandDims","losses.meanSquaredError","losses.binaryCrossentropy","losses.categoricalCrossentropy","K.sliceAlongFirstAxis","tfc.tidy","K.gather","optimizers.getOptimizer","Optimizer","losses.get","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","Metrics.get","K.concatAlongFirstAxis","tfc.keep","io","K.elu","tfc.selu","tfc.minimum","tfc.sigmoid","K.hardSigmoid","K.softsign","tfc.tanh","leakyRelu","elu","softmaxActivation","Softmax","sum","abs","tfc.transpose","tfc.conv1d","K.biasAdd","tfc.conv2d","generic_utils.checkArrayTypeAndLength","tfc.conv2dTranspose","tfc.separableConv2d","K.sliceAlongAxis","tfc.depthwiseConv2d","K.inTrainPhase","K.dropout","K.dot","K.batchFlatten","Activation","K.repeat","mathUtils.max","mathUtils.arrayProd","mathUtils.range","tfc.zeros","tfc.ones","K.concatenate","variance","tfc.batchNormalization2d","tfc.batchNormalization3d","tfc.batchNormalization4d","tfc.moments","math_utils.range","tfc.movingAverage","tfc.pad","tfc.maxPool","tfc.avgPool","tfc.squeeze","tfc.reverse","K.tile","math_utils.min","math_utils.max","tfc.dispose","K.sliceAlongLastAxis","generic_utils.checkStringTypeUnionValue","metrics.binaryAccuracy","metrics.binaryCrossentropy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","losses.cosineProximity","losses.meanAbsoluteError","losses.meanAbsolutePercentageError","regularizers.l1","regularizers.l2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C/C,CAAC;AAED,mBAAoB,KAAa,EAAE,KAAa;QAC9C,OAAOA,gBAAuB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;;;;;;;;;;;;;;;;;kBChGoB,MAAmB;QACtC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;AAUD,kBAAmB,MAAiB;QAClC,OAAO+E,EAAe,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;AAUD,kBAAmB,MAAiB;QAClC,OAAOC,EAAe,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;;;;;;;;;QC/BsC9K,4BAAY;QAAnD;YAAA,qEAUC;YARC,WAAK,GAAU,IAAI,CAAC;;SAQrB;QANC,2BAAQ,GAAR,UAAS,KAAgB;YACvB,IAAI,EAAE,KAAK,YAAY,KAAK,CAAC,EAAE;gBAC7B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;aACpE;YACD,IAAI,CAAC,KAAK,GAAG,KAAc,CAAC;SAC7B;QACH,eAAC;IAAD,CAAC,CAVsC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js b/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js new file mode 100644 index 0000000..5f1e83f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.min.js @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tensorflow/tfjs-core")):"function"==typeof define&&define.amd?define(["exports","@tensorflow/tfjs-core"],e):e(t.tf=t.tf||{},t.tf)}(this,function(t,e){"use strict";var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function r(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]e?1:0}(t,e)}function M(t){if(null==t)return t;for(var e=[],n=0,r=t;n=0),S(r>=n),Array.isArray(t)&&t.length>=n&&t.length<=r&&t.every(function(t){return typeof t===e})}function F(t,n){return e.tidy(function(){return e.sqrt(e.sum(e.mulStrict(t,t),n,!0))})}var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getConfig=function(){return{}},e}(e.serialization.Serializable),B=function(t){function n(e){var n=t.call(this)||this;return n.defaultMaxValue=2,n.defaultAxis=0,n.maxValue=null!=e.maxValue?e.maxValue:n.defaultMaxValue,n.axis=null!=e.axis?e.axis:n.defaultAxis,n}return r(n,t),n.prototype.apply=function(t){var n=this;return e.tidy(function(){var r=F(t,n.axis),i=e.clipByValue(r,0,n.maxValue);return e.mul(t,e.div(i,e.add(g(u()),r)))})},n.prototype.getConfig=function(){return{maxValue:this.maxValue,axis:this.axis}},n.className="MaxNorm",n}(_);e.serialization.SerializationMap.register(B);var P=function(t){function n(e){var n=t.call(this)||this;return n.defaultAxis=0,n.axis=null!=e.axis?e.axis:n.defaultAxis,n}return r(n,t),n.prototype.apply=function(t){var n=this;return e.tidy(function(){return e.div(t,e.add(g(u()),F(t,n.axis)))})},n.prototype.getConfig=function(){return{axis:this.axis}},n.className="UnitNorm",n}(_);e.serialization.SerializationMap.register(P);var j=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.apply=function(t){return e.relu(t)},n.className="NonNeg",n}(_);e.serialization.SerializationMap.register(j);var U=function(t){function n(e){var n=t.call(this)||this;return n.defaultMinValue=0,n.defaultMaxValue=1,n.defaultRate=1,n.defaultAxis=0,n.minValue=null!=e.minValue?e.minValue:n.defaultMinValue,n.maxValue=null!=e.maxValue?e.maxValue:n.defaultMaxValue,n.rate=null!=e.rate?e.rate:n.defaultRate,n.axis=null!=e.axis?e.axis:n.defaultAxis,n}return r(n,t),n.prototype.apply=function(t){var n=this;return e.tidy(function(){var r=F(t,n.axis),i=e.add(e.mul(g(n.rate),e.clipByValue(r,n.minValue,n.maxValue)),e.mul(g(1-n.rate),r));return e.mul(t,e.div(i,e.add(g(u()),r)))})},n.prototype.getConfig=function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}},n.className="MinMaxNorm",n}(_);e.serialization.SerializationMap.register(U);var W={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function V(t){return T(t)}function q(t,n){return void 0===n&&(n={}),O(t,e.serialization.SerializationMap.getMap().classNameMap,n,"constraint")}function Z(t){return null==t?null:"string"==typeof t?q({className:t in W?W[t]:t,config:{}}):t instanceof _?t:q(t)}var J=Object.freeze({maxNorm:function(t){return new B(t)},unitNorm:function(t){return new P(t)},nonNeg:function(){return new j},minMaxNorm:function(t){return new U(t)}}),K=new Map,H=["channelsFirst","channelsLast"];function G(t){E(H,"DataFormat",t)}var X=["valid","same","causal"];function $(t){E(X,"PaddingMode",t)}var Y=["max","avg"];var Q=[],tt="/";function et(t,e){Q.push(t);try{var n=e();return Q.pop(),n}catch(t){throw Q.pop(),t}}function nt(t){if(!at(t))throw new Error("Not a valid tensor name: '"+t+"'");return(0===Q.length?"":Q.join(tt)+tt)+t}function rt(t){if(!at(t))throw new Error("Not a valid tensor name: '"+t+"'");K.has(t)||K.set(t,0);var e=K.get(t);if(K.set(t,K.get(t)+1),e>0){var n=t+"_"+e;return K.set(n,1),n}return t}var it=new RegExp(/^[A-Za-z][A-Za-z0-9\._\/]*$/);function at(t){return!!t.match(it)}function ot(t,e,n){null==e&&(e=0),null==n&&(n=t.length);for(var r=1,i=e;i2e3&&console.warn("Orthogonal initializer is being called on a matrix with more than 2000 ("+t[0]*t[1]+") elements: Slowness may result.");var n=bt(t[0]>t[1]?[t[1],t[0]]:t,0,1,"float32"),i=e.linalg.gramSchmidt(n);return t[0]>t[1]&&(i=i.transpose()),e.mul(g(r.gain),i)})},n.prototype.getConfig=function(){return{gain:this.gain,seed:this.seed}},n.className="Orthogonal",n}(Lt);e.serialization.SerializationMap.register(Ut);var Wt={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",identity:"Identity",leCunNormal:"LeCunNormal",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function Vt(t,n){return void 0===n&&(n={}),O(t,e.serialization.SerializationMap.getMap().classNameMap,n,"initializer")}function qt(t){return T(t)}function Zt(t){if("string"==typeof t){var e=t in Wt?Wt[t]:t;return"GlorotUniform"===e?new _t:"GlorotNormal"===e?new Bt:"HeNormal"===e?new Pt:"LeCunNormal"===e?new jt:Vt({className:e,config:{}})}return t instanceof Lt?t:Vt(t)}var Jt=Object.freeze({zeros:function(){return new Tt},ones:function(){return new Ot},constant:function(t){return new Rt(t)},randomUniform:function(t){return new Mt(t)},randomNormal:function(t){return new xt(t)},truncatedNormal:function(t){return new Et(t)},identity:function(t){return new Dt(t)},varianceScaling:function(t){return new Ft(t)},glorotUniform:function(t){return new _t(t)},glorotNormal:function(t){return new Bt(t)},heNormal:function(t){return new Pt(t)},leCunNormal:function(t){return new jt(t)},orthogonal:function(t){return new Ut(t)}});function Kt(t){return Array.isArray(t)&&Array.isArray(t[0])}function Ht(t){return 0===t.length?[]:Array.isArray(t[0])?t:[t]}function Gt(t){var e;if(Array.isArray(t)){if(1!==t.length)throw new v("Expected Tensor length to be 1; got "+t.length);e=t[0]}else e=t;return e}function Xt(t){if(Array.isArray(t)&&Array.isArray(t[0])){if(1===t.length)return(t=t)[0];throw new v("Expected exactly 1 Shape; got "+t.length)}return t}function $t(t){for(var e=0,n=0,r=t;n1)throw new y("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new y("Layer "+this.name+" is not connected, no input to return.");return I(this.getNodeAtIndex(0,"input").inputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"output",{get:function(){if(0===this.inboundNodes.length)throw new y("Layer "+this.name+" has no inbound nodes.");if(this.inboundNodes.length>1)throw new y("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return I(this.getNodeAtIndex(0,"output").outputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"losses",{get:function(){return this._losses},enumerable:!0,configurable:!0}),n.prototype.calculateLosses=function(){return this.losses.map(function(t){return t()})},Object.defineProperty(n.prototype,"updates",{get:function(){return this._updates},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"built",{get:function(){return this._built},set:function(t){this._built=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trainableWeights",{get:function(){return this.trainable?this._trainableWeights:[]},set:function(t){this._trainableWeights=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this._nonTrainableWeights:this._trainableWeights.concat(this._nonTrainableWeights)},set:function(t){this._nonTrainableWeights=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"weights",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"stateful",{get:function(){return this._stateful},enumerable:!0,configurable:!0}),n.prototype.assertInputCompatibility=function(t){if(t=N(t),null!=this.inputSpec&&0!==this.inputSpec.length){var e=N(this.inputSpec);if(t.length!==e.length)throw new v("Layer "+this.name+" expects "+e.length+" inputs, but it received "+t.length+" input tensors. Input received: "+t);for(var n=0;n=0?o[u]:o[o.length+u];if(null!=l&&-1===[l,null].indexOf(h))throw new v("Input "+n+" is incompatible with layer "+this.name+": expected axis "+u+" of input shape to have value "+l+" but got shape "+o+".")}}if(null!=i.shape)for(var p=0;p0&&Array.isArray(d[0])?d.map(function(r,i){return new re("float32",r,n,N(t),e,n.name,i)}):new re("float32",d,n,N(t),e,n.name),n.addInboundNode(t,g,null,null,f,d,e),null!=n.activityRegularizer)throw new b("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return g})},n.prototype.warnOnIncompatibleInputShape=function(t){if(null!=this.batchInputShape)if(t.length!==this.batchInputShape.length)console.warn("The rank of the input tensor provided (shape: "+JSON.stringify(t)+") does not match that of the batchInputShape ("+JSON.stringify(this.batchInputShape)+") of the layer "+this.name);else{var e=!1;this.batchInputShape.forEach(function(n,r){null!=n&&null!=t[r]&&t[r]!==n&&(e=!0)}),e&&console.warn("The shape of the input tensor ("+JSON.stringify(t)+") does not match the expectation of layer "+this.name+": "+JSON.stringify(this.batchInputShape))}},Object.defineProperty(n.prototype,"outputShape",{get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new y("The layer "+this.name+" has never been called and thus has no defined output shape.");for(var t=[],e=0,n=this.inboundNodes;e0&&(r=r.slice(0,r.length-1)+" "),r=(r+=t[i]).slice(0,e[i]),r+=" ".repeat(e[i]-r.length);n(r)}function Je(t,e,n){var r;try{r=JSON.stringify(t.outputShape)}catch(t){r="multiple"}Ze([t.name+" ("+t.getClassName()+")",r,t.countParams().toString()],e,n)}function Ke(t,e,n,r){var i;try{i=JSON.stringify(t.outputShape)}catch(t){i="multiple"}for(var a=[],o=0,s=t.inboundNodes;o0&&-1===n.indexOf(u)))for(var l=0;l1 nodes"),S(0===l,"input layer has >1 tensors"),r.inputLayers.push(s),r.inputLayersNodeIndices.push(u),r.inputLayersTensorIndices.push(l)}r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var f=0;f=0;)i.splice(i.indexOf(u),1);I.push(u)}},A=[],C=[],L=0,T=r.outputs;Lr?1:0});for(var H=0,G=K;H0)throw new v("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];for(var t=[],e=0,n=this.layers;e0)throw new v(p.length+" of "+r+" weights are not set: "+p);ee(l)}(t,this.layers):function(t,n,r){void 0===r&&(r=!1);for(var i=t.keras_version,a=(t.backend,n.map(function(t){return t.name})),o={},s=0,u=n;s1)for(var s=0,u=o;s0){for(var f=[],d=0;d0&&t.apply(I(a),r)}function o(t){var r=t.name,a=He(t,null!=e.customObjects?e.customObjects:{});n[r]=a;for(var o=0,s=t.inboundNodes;o0)a=!0;else if(an(t)){for(var o in t)if(t.hasOwnProperty(o)){a=!0;break}}else a=!0;if(a)throw new v("Error when checking model "+i+" expected no data, but got "+t)}return[]}if(null==t)return e.map(function(t){return null});var s;if(an(t)){t=t,s=[];for(var u=0,l=e;u1)throw new v("The model "+i+" expects "+e.length+" Tensor(s), but only received one Tensor. Found: Tensor with shape "+t.shape);s=[t]}for(var p=0;p=0&&d!==g)throw new v("Error when checking "+i+": expected "+e[p]+" to have shape ["+n[p]+"], but got array with shape ["+c.shape+"].")}}return s}function sn(t,e){for(var n=[],r=0,i=null;r=t&&(i=t),n.push([r,i]),r=i;return n}function un(t,e,n){return null==t?[null]:Array.isArray(t)?t.map(function(t){return ft(t,e,n-e)}):ft(t,e,n-e)}function ln(t,n){return e.tidy(function(){return null==t?null:Array.isArray(t)?t.map(function(t){return ln(t,n)}):zt(t,"int32"===n.dtype?n:n.toInt())})}function hn(t,e,n,r,i){var a;if(void 0===r&&(r=!0),void 0===i&&(i=""),Array.isArray(t)){if(t.length!==e.length)throw new v("Error when checking model "+i+": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see "+e.length+" Tensor(s), but instead got "+t.length+" Tensors(s).");a=t}else{if(e.length>1)throw new v("The model expects "+e.length+" "+i+" Tensors, but only received one Tensor. Found: array with shape "+JSON.stringify(t.shape)+".");a=[t]}if(null!=n)for(var o=0;o1||1===s.length&&s[0].inboundLayers.length>1){e=!1;break}r.push.apply(r,s)}if(e)for(var u=0,l=t.layers;u1&&(n.metricsTensors.push([e,t]),n.metricsNames.push(n.outputNames[t]+"_loss"))}});var f=function(t,e){if(null==t||Array.isArray(t)&&0===t.length)return e.map(function(t){return[]});if(Array.isArray(t))return e.map(function(e){return t});if(null!=t){for(var n=[],r=0,i=e;r1&&(e=n.outputNames[t]+"_"+e),n.metricsNames.push(e),n.metricsTensors.push([r,t])}(t,r,l)},s=0,u=e;s0){var h=[];throw e.forEach(function(e,n){null==e&&h.push(t[n])}),new v("Cannot find SymbolicTensors for output name(s): "+JSON.stringify(h))}return e},n.prototype.predictLoop=function(t,n,r){var i=this;return void 0===n&&(n=32),void 0===r&&(r=!1),e.tidy(function(){var a=i.checkNumSamples(t);if(r)throw new b("Verbose predictLoop() is not implemented yet.");for(var o=sn(a,n),s=[],u=function(n){var r=e.tidy(function(){var e=o[n][0],r=o[n][1],a=un(t,e,r),s=[];if(Array.isArray(a))for(var u=0;u1)throw new v("All input Tensors (x) should have the same number of samples. Got array shapes: "+JSON.stringify(t.map(function(t){return t.shape})));if(a.length>1)throw new v("All target Tensors (y) should have the same number of samples. Got array shapes: "+JSON.stringify(n.map(function(t){return t.shape})));if(i.length>0&&a.length>0&&!e.util.arraysEqual(i,a))throw new v("Input Tensors should have the same number of samples as target Tensors. Found "+i[0]+" input sample(s) and "+a[0]+" target sample(s).")}(t=on(t,this.feedInputNames,this.feedInputShapes,!1,"input"),n=on(n,this.feedOutputNames,a,!1,"target")),function(t,e,n){for(var r=[me,Ce,Ne],i=0;i0&&t[0].shape[0]%i!=0)throw new v("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size "+i+". Found: "+t[0].shape[0]+" sample(s).");return[t,n,null]},n.prototype.fitLoop=function(t,n,r,i,s,u,l,h,p,c,f,d,g,y){return a(this,void 0,void 0,function(){var a,m,w,z,S,k,I,N=this;return o(this,function(A){switch(A.label){case 0:if(null==i&&(i=32),null==s&&(s=1),null==c&&(c=!0),null==d&&(d=0),a=!1,null!=h&&null!=p&&(a=!0),null!=y&&(a=!0,null==g))throw new v("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");if(null!=(m=this.checkNumSamples(n,i,g,"steps_per_epoch"))&&(w=ht(0,m)),this.history=new de,l=(l=null==l?[new fe]:[new fe].concat(l)).concat([this.history]),u>0)throw new b("Verbose mode is not implemented yet.");return(z=new ce(l)).setModel(this),z.setParams({epochs:s,initialEpoch:d,steps:g,verbose:u,doValidation:a,metrics:f}),[4,z.onTrainBegin()];case 1:A.sent(),this.stopTraining=!1,S=function(s){var u,l,f,d,y;return o(this,function(v){switch(v.label){case 0:return[4,z.onEpochBegin(s)];case 1:if(v.sent(),u={},null==g)return[3,2];throw new b("stepsPerEpoch mode is not implemented yet.");case 2:if("batch"===c)throw new b("batch shuffling is not implemneted yet");c&&e.util.shuffle(w),l=e.tensor1d(w),f=sn(m,i),d=function(s){var c;return o(this,function(o){switch(o.label){case 0:return c={},[4,z.onBatchBegin(s,c)];case 1:return o.sent(),e.tidy(function(){var o=f[s][0],d=f[s][1],g=ft(l,o,d-o);c.batch=s,c.size=d-o;for(var y=ln(n,g),m=t(y),v=0;v1)i+="_"+k(t.slice(0,n),r);e.push(i)}return e},n.prototype.makeTestFunction=function(){var t=this;this.testFunction=function(n){return e.tidy(function(){for(var r,i=[],a=n.slice(0,t.inputs.length),o=n.slice(t.inputs.length,t.inputs.length+t.outputs.length),s=[],u=0;u0){if(l=!0,2!==r.validationData.length)throw 3===r.validationData.length?new b("validationData including sample weights is not supported yet."):new v("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; "+r.validationData+" is invalid.");h=r.validationData[0],p=r.validationData[1],d=this.standardizeUserData(h,p,!0,i),h=d[0],p=d[1],c=h.concat(p)}else null!=r.validationSplit&&r.validationSplit>0&&r.validationSplit<1?(l=!0,g=Math.floor(s[0].shape[0]*(1-r.validationSplit)),y=s[0].shape[0],h=un(s,g,y),s=un(s,0,g),p=un(u,g,y),u=un(u,0,g),f=!0,c=h.concat(p)):null!=r.validationSteps&&(l=!0);return m=s.concat(u),this.checkTrainableWeightsConsistency(),w=function(t){var n=t.slice(0,C.inputs.length),r=t.slice(C.inputs.length,C.inputs.length+C.outputs.length),i=[],a=C.collectedTrainableWeights.map(function(t){return t.read()});return[C.optimizer.minimize(function(){for(var t=[],a=0;a1)throw new v("Found more than one ("+r.length+") save handlers for URL '"+t+"'");t=r[0]}if(null==t.save)throw new v("Model.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return[4,e.io.encodeWeights(this.getNamedWeights(n))];case 1:return i=o.sent(),a=!1,s=null,u=this.toJSON(s,a),[2,t.save({modelTopology:u,weightData:i.data,weightSpecs:i.specs})]}})})},n.className="Model",n}(Ye);function cn(t){return a(this,void 0,void 0,function(){var n;return o(this,function(r){if("string"==typeof t){if(0===(n=e.io.getLoadHandlers(t)).length)n.push(e.io.browserHTTPRequest(t));else if(n.length>1)throw new v("Found more than one ("+n.length+") load handlers for URL '"+t+"'");t=n[0]}return[2,function(t,n){return a(this,void 0,void 0,function(){var r,i,a,s,u;return o(this,function(o){switch(o.label){case 0:if(null==t.load)throw new v("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");return[4,t.load()];case 1:if(r=o.sent(),null!=(i=r.modelTopology).model_config&&(i=i.model_config),a=He(function t(e,n){if(null===e)return null;if("string"==typeof e)return C(e);if("number"==typeof e||"boolean"==typeof e)return e;if(e instanceof Array){for(var r=[],i=e.length,a=0;a0)&&(n=e.sourceLayer,r=e.nodeIndex),0===n.inboundNodes.length)return[e];var i=n.inboundNodes[r];if(0===i.inboundLayers.length)return i.inputTensors;for(var a=[],o=0;o 0 but got "+JSON.stringify(t.filters))},n}(qn),Jn=function(t){function e(n){var r=t.call(this,2,n)||this;return e.verifyConfig(n),r}return r(e,t),e.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.rank,e},e.verifyConfig=function(t){if("number"!=typeof t.kernelSize&&!D(t.kernelSize,"number",1,2))throw new v("Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received "+JSON.stringify(t.kernelSize)+".")},e.className="Conv2D",e}(Zn);e.serialization.SerializationMap.register(Jn);var Kn=function(t){function n(e){var n=t.call(this,e)||this;if(n.inputSpec=[new ne({ndim:4})],"same"!==n.padding&&"valid"!==n.padding)throw new v("Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode "+n.padding);return n}return r(n,t),n.prototype.build=function(t){if(4!==(t=Xt(t)).length)throw new v("Input should have rank 4; Received input shape: "+JSON.stringify(t));var e="channelsFirst"===this.dataFormat?1:t.length-1;if(null==t[e])throw new v("The channel dimension of the inputs should be defined. Found `None`.");var n,r=t[e],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new ne({ndim:4,axes:(n={},n[e]=r,n)})],this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy(function(){var n=Gt(t);if(4!==n.shape.length)throw new v("Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-"+n.shape.length);var i,a,o=n.shape,s=o[0];"channelsFirst"===r.dataFormat?(i=2,a=3):(i=1,a=2);var u=o[i],l=o[a],h=r.kernelSize[0],p=r.kernelSize[1],c=r.strides[0],f=r.strides[1],d=[s,Wn(u,c,h,r.padding),Wn(l,f,p,r.padding),r.filters];"channelsLast"!==r.dataFormat&&(n=e.transpose(n,[0,2,3,1]));var g=e.conv2dTranspose(n,r.kernel.read(),d,r.strides,r.padding);return"channelsLast"!==r.dataFormat&&(g=e.transpose(g,[0,3,1,2])),null!=r.bias&&(g=kt(g,r.bias.read(),r.dataFormat)),null!=r.activation&&(g=r.activation.apply(g)),g})},n.prototype.computeOutputShape=function(t){var e,n,r,i=(t=Xt(t)).slice();"channelsFirst"===this.dataFormat?(e=1,n=2,r=3):(e=3,n=1,r=2);var a=this.kernelSize[0],o=this.kernelSize[1],s=this.strides[0],u=this.strides[1];return i[e]=this.filters,i[n]=Wn(i[n],s,a,this.padding),i[r]=Wn(i[r],u,o,this.padding),i},n.prototype.getConfig=function(){var e=t.prototype.getConfig.call(this);return delete e.dilationRate,e},n.className="Conv2DTranspose",n}(Jn);e.serialization.SerializationMap.register(Kn);var Hn=function(t){function e(e){return t.call(this,2,e)||this}return r(e,t),e.className="SeparableConv2D",e}(function(t){function n(e,n){var r=t.call(this,e,n)||this;if(r.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",r.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",r.depthwiseKernel=null,r.pointwiseKernel=null,null==n.filters)throw new v("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=n.kernelInitializer||null!=n.kernelRegularizer||null!=n.kernelConstraint)throw new v("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=n.padding&&"same"!==n.padding&&"valid"!==n.padding)throw new v("SeparableConv"+r.rank+"D supports only padding modes: 'same' and 'valid', but received "+JSON.stringify(n.padding));return r.depthMultiplier=null==n.depthMultiplier?1:n.depthMultiplier,r.depthwiseInitializer=Zt(n.depthwiseInitializer||r.DEFAULT_DEPTHWISE_INITIALIZER),r.depthwiseRegularizer=Pn(n.depthwiseRegularizer),r.depthwiseConstraint=Z(n.depthwiseConstraint),r.pointwiseInitializer=Zt(n.depthwiseInitializer||r.DEFAULT_POINTWISE_INITIALIZER),r.pointwiseRegularizer=Pn(n.pointwiseRegularizer),r.pointwiseConstraint=Z(n.pointwiseConstraint),r}return r(n,t),n.prototype.build=function(t){if((t=Xt(t)).length1)throw new v("Can not merge tensors with different batch sizes. Got tensors with shapes: "+JSON.stringify(t)+".");for(var i=null==t[0]?null:t[0].slice(1),a=1;a1){var v=ht(1,u).concat([0]);n.push(e.transpose(f,v)),h=!0}else n.push(f)}var b=r.mergeFunction(n),w=b.rank;if(h)if(null==w){var z=b.shape;y=[g=z[z.length-1]].concat(z.slice(0,z.length-1));b=e.transpose(b.reshape([-1,g]),[1,0]).reshape(y)}else if(w>1){v=[w-1].concat(ht(0,w-1));b=e.transpose(b,v)}return b}return r.mergeFunction(t)})},n.prototype.computeOutputShape=function(t){var e;e=null==(t=t)[0]?null:t[0].slice(1);for(var n=1;n1)throw new v("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(t))}},n.prototype.mergeFunction=function(t){var n=this;return e.tidy(function(){return yt(t,n.axis)})},n.prototype.computeOutputShape=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))throw new v("A `Concatenate` layer should be called on a list of inputs.");for(var e=t,n=e[0].slice(),r=this.axis<0?n.length+this.axis:this.axis,i=0,a=e.slice(1);i=0?this.axis:this.axis+t.length,n=t[e];if(null==n)throw new v("Axis "+e+" of input tensor should have a defined dimension but the layer received an input with shape "+JSON.stringify(t)+".");this.inputSpec=[new ne({ndim:t.length,axes:(r={},r[e]=n,r)})];var r,i=[n];this.scale&&(this.gamma=this.addWeight("gamma",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",i,null,this.movingVarianceInitializer,null,!1),this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy(function(){var i=null!=n.training&&n.training,a=Gt(t),o=a.shape,s=o.length,u=ht(0,s),l=r.axis>=0?r.axis:r.axis+s;u.splice(l,1);var h=z(1,s);h[l]=o[l];var p=u.slice();p.sort();var c=!e.util.arraysEqual(p,ht(0,s).slice(0,s-1));if(!i)return function(){if(c){var t=r.movingMean.read().reshape(h),e=r.movingVariance.read().reshape(h),n=r.center?r.beta.read().reshape(h):null,i=r.scale?r.gamma.read().reshape(h):null;return fr(a,t,e,n,i,r.epsilon)}return fr(a,r.movingMean.read(),r.movingVariance.read(),null==r.beta?null:r.beta.read(),null==r.gamma?null:r.gamma.read(),r.epsilon)}();var f=dr(a,r.gamma.read(),r.beta.read(),u,r.epsilon),d=f[0],y=f[1],m=f[2],v=ot(u.map(function(t){return a.shape[t]})),b=m.mul(g(v/(v-(1+r.epsilon))));return function(){r.stepCount++;var t=e.movingAverage(r.movingMean.read(),y,r.momentum,r.stepCount);r.movingMean.write(t);var n=e.movingAverage(r.movingVariance.read(),b,r.momentum,r.stepCount);r.movingVariance.write(n)}(),d})},n.prototype.getConfig=function(){var e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:qt(this.betaInitializer),gammaInitializer:qt(this.gammaInitializer),movingMeanInitializer:qt(this.movingMeanInitializer),movingVarianceInitializer:qt(this.movingVarianceInitializer),betaRegularizer:_n(this.betaRegularizer),gammaRegularizer:_n(this.gammaRegularizer),betaConstraint:V(this.betaConstraint),gammaConstraint:V(this.gammaConstraint)},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n.className="BatchNormalization",n}(se);e.serialization.SerializationMap.register(gr);var yr=function(t){function n(e){var n=this;if(null==e&&(e={}),(n=t.call(this,e)||this).dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,null==e.padding)n.padding=[[1,1],[1,1]];else if("number"==typeof e.padding)n.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,2!==e.padding.length)throw new v("ZeroPadding2D expects padding to be a length-2 array, but received a length-"+e.padding.length+" array.");var r=void 0,i=void 0;if("number"==typeof e.padding[0])r=[e.padding[0],e.padding[0]],i=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,2!==e.padding[0].length)throw new v("ZeroPadding2D expects height padding to be a length-2 array, but received a length-"+e.padding[0].length+" array.");if(r=e.padding[0],2!==e.padding[1].length)throw new v("ZeroPadding2D expects width padding to be a length-2 array, but received a length-"+e.padding[1].length+" array.");i=e.padding[1]}n.padding=[r,i]}return n.inputSpec=[new ne({ndim:4})],n}return r(n,t),n.prototype.computeOutputShape=function(t){var e,n;return t=Xt(t),"channelsFirst"===this.dataFormat?(e=null!=t[2]&&t[2]>=0?t[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[3]&&t[3]>=0?t[3]+this.padding[1][0]+this.padding[1][1]:null,[t[0],t[1],e,n]):(e=null!=t[1]&&t[1]>=0?t[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=t[2]&&t[2]>=0?t[2]+this.padding[1][0]+this.padding[1][1]:null,[t[0],e,n,t[3]])},n.prototype.call=function(t,n){var r=this;return e.tidy(function(){return n=Gt(t),i=r.padding,a=r.dataFormat,e.tidy(function(){if(4!==n.rank)throw new v("temporalPadding expects input tensor to be 4-D, but received a "+n.rank+"-D tensor.");if(null==i&&(i=[[1,1],[1,1]]),2!==i.length||2!==i[0].length||2!==i[1].length)throw new v("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==a&&(a="channelsLast"),"channelsLast"!==a&&"channelsFirst"!==a)throw new v("Unknown data format: "+a+". Supported data formats are 'channelsLast' and 'channelsFirst.");var t;return t="channelsFirst"===a?[[0,0],[0,0],i[0],i[1]]:[[0,0],i[0],i[1],[0,0]],e.pad(n,t)});var n,i,a})},n.prototype.getConfig=function(){var e={padding:this.padding,dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n.className="ZeroPadding2D",n}(se);function mr(t,n,r,i,a,o){return e.tidy(function(){var s;G(a),E(Y,"PoolMode",o),$(i),null==r&&(r=[1,1]),null==i&&(i="valid"),null==a&&(a="channelsLast"),null==o&&(o="max"),t=Vn(t,a);var u="same"===i?"same":"valid";return s="max"===o?e.maxPool(t,n,r,u):e.avgPool(t,n,r,u),"channelsFirst"===a&&(s=e.transpose(s,[0,3,1,2])),s})}e.serialization.SerializationMap.register(yr);var vr=function(t){function n(e){var n=this;if(null==e.poolSize&&(e.poolSize=2),n=t.call(this,e)||this,"number"==typeof e.poolSize)n.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!=typeof e.poolSize[0])throw new v("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(e.poolSize));n.poolSize=e.poolSize}if(null==e.strides)n.strides=n.poolSize;else if("number"==typeof e.strides)n.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!=typeof e.strides[0])throw new v("strides for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(e.strides));n.strides=e.strides}return n.padding=null==e.padding?"valid":e.padding,$(n.padding),n.inputSpec=[new ne({ndim:3})],n}return r(n,t),n.prototype.computeOutputShape=function(t){var e=Un((t=Xt(t))[1],this.poolSize[0],this.padding,this.strides[0]);return[t[0],e,t[2]]},n.prototype.call=function(t,n){var r=this;return e.tidy(function(){r.invokeCallHook(t,n),t=ct(Gt(t),2);var i=r.poolingFunction(Gt(t),[r.poolSize[0],1],[r.strides[0],1],r.padding,"channelsLast");return e.squeeze(i,[2])})},n.prototype.getConfig=function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n}(se),br=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return G(i),$(r),mr(t,e,n,r,i,"max")},e.className="MaxPooling1D",e}(vr);e.serialization.SerializationMap.register(br);var wr=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return G(i),$(r),mr(t,e,n,r,i,"avg")},e.className="AveragePooling1D",e}(vr);e.serialization.SerializationMap.register(wr);var zr=function(t){function n(e){var n=this;if(null==e.poolSize&&(e.poolSize=[2,2]),(n=t.call(this,e)||this).poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)n.strides=n.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new v("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length "+e.strides.length+".");n.strides=e.strides}else n.strides=[e.strides,e.strides];return n.padding=null==e.padding?"valid":e.padding,n.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,G(n.dataFormat),$(n.padding),n.inputSpec=[new ne({ndim:4})],n}return r(n,t),n.prototype.computeOutputShape=function(t){t=Xt(t);var e="channelsFirst"===this.dataFormat?t[2]:t[1],n="channelsFirst"===this.dataFormat?t[3]:t[2];return e=Un(e,this.poolSize[0],this.padding,this.strides[0]),n=Un(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[t[0],t[1],e,n]:[t[0],e,n,t[3]]},n.prototype.call=function(t,n){var r=this;return e.tidy(function(){return r.invokeCallHook(t,n),r.poolingFunction(Gt(t),r.poolSize,r.strides,r.padding,r.dataFormat)})},n.prototype.getConfig=function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},n}(se),Sr=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return G(i),$(r),mr(t,e,n,r,i,"max")},e.className="MaxPooling2D",e}(zr);e.serialization.SerializationMap.register(Sr);var kr=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.poolingFunction=function(t,e,n,r,i){return G(i),$(r),mr(t,e,n,r,i,"avg")},e.className="AveragePooling2D",e}(zr);e.serialization.SerializationMap.register(kr);var Ir=function(t){function e(e){var n=t.call(this,e)||this;return n.inputSpec=[new ne({ndim:3})],n}return r(e,t),e.prototype.computeOutputShape=function(t){return[t[0],t[2]]},e.prototype.call=function(t,e){throw new b},e}(se),Nr=function(t){function n(e){return t.call(this,e)||this}return r(n,t),n.prototype.call=function(t,n){return e.tidy(function(){var n=Gt(t);return e.mean(n,1)})},n.className="GlobalAveragePooling1D",n}(Ir);e.serialization.SerializationMap.register(Nr);var Ar=function(t){function n(e){return t.call(this,e)||this}return r(n,t),n.prototype.call=function(t,n){return e.tidy(function(){var n=Gt(t);return e.max(n,1)})},n.className="GlobalMaxPooling1D",n}(Ir);e.serialization.SerializationMap.register(Ar);var Cr=function(t){function e(e){var n=t.call(this,e)||this;return n.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,G(n.dataFormat),n.inputSpec=[new ne({ndim:4})],n}return r(e,t),e.prototype.computeOutputShape=function(t){return t=t,"channelsLast"===this.dataFormat?[t[0],t[3]]:[t[0],t[1]]},e.prototype.call=function(t,e){throw new b},e.prototype.getConfig=function(){var e={dataFormat:this.dataFormat},n=t.prototype.getConfig.call(this);return Object.assign(e,n),e},e}(se),Lr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.call=function(t,n){var r=this;return e.tidy(function(){var n=Gt(t);return"channelsLast"===r.dataFormat?e.mean(n,[1,2]):e.mean(n,[2,3])})},n.className="GlobalAveragePooling2D",n}(Cr);e.serialization.SerializationMap.register(Lr);var Tr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.call=function(t,n){var r=this;return e.tidy(function(){var n=Gt(t);return"channelsLast"===r.dataFormat?e.max(n,[1,2]):e.max(n,[2,3])})},n.className="GlobalMaxPooling2D",n}(Cr);function Or(t,e,n,r){if(Array.isArray(t)){if(null!=e||null!=n)throw new v("When inputs is an array, neither initialState or constants should be provided");null!=r&&(n=t.slice(t.length-r,t.length),t=t.slice(0,t.length-r)),t.length>1&&(e=t.slice(1,t.length)),t=t[0]}function i(t){return null==t||Array.isArray(t)?t:[t]}return{inputs:t,initialState:e=i(e),constants:n=i(n)}}function Rr(t,n,r,i,a,o,s,u){void 0===i&&(i=!1),void 0===s&&(s=!1);var l=n.shape.length;if(l<3)throw new v("Input should be at least 3D, but is "+l+"D.");var h,p,c=[1,0].concat(ht(2,l));if(n=e.transpose(n,c),null!=a)throw new b("The rnn() function of the deeplearn.js backend does not support masking yet.");if(null!=o)throw new b("The rnn() functoin of the deeplearn.js backend does not support constants yet.");s&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),i&&(n=e.reverse(n,0));for(var f=r,d=n.shape[0],g=0;g1?vt(r,[1,t]):r}):n.cell.stateSize>1?[vt(r,[1,n.cell.stateSize])]:[r]})},Object.defineProperty(n.prototype,"trainableWeights",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),n.prototype.getConfig=function(){var e={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(e.numConstants=this.numConstants);var n=this.cell.getConfig();e.cell={className:this.cell.getClassName(),config:n};var r=t.prototype.getConfig.call(this);return Object.assign(e,r),e},n.className="RNN",n}(se);e.serialization.SerializationMap.register(Mr);var xr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(se),Er=function(t){function n(e){var n=t.call(this,e)||this;return n.DEFAULT_ACTIVATION="tanh",n.DEFAULT_KERNEL_INITIALIZER="glorotNormal",n.DEFAULT_RECURRENT_INITIALIZER="orthogonal",n.DEFAULT_BIAS_INITIALIZER="zeros",n.units=e.units,n.activation=Tn(null==e.activation?n.DEFAULT_ACTIVATION:e.activation),n.useBias=null==e.useBias||e.useBias,n.kernelInitializer=Zt(e.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=Zt(e.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=Zt(e.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelRegularizer=Pn(e.kernelRegularizer),n.recurrentRegularizer=Pn(e.recurrentRegularizer),n.biasRegularizer=Pn(e.biasRegularizer),n.kernelConstraint=Z(e.kernelConstraint),n.recurrentConstraint=Z(e.recurrentConstraint),n.biasConstraint=Z(e.biasConstraint),n.dropout=ut([1,lt([0,null==e.dropout?0:e.dropout])]),n.recurrentDropout=ut([1,lt([0,null==e.recurrentDropout?0:e.recurrentDropout])]),n.stateSize=n.units,n.dropoutMask=null,n.recurrentDropoutMask=null,n}return r(n,t),n.prototype.build=function(t){t=Xt(t),this.kernel=this.addWeight("kernel",[t[t.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},n.prototype.call=function(t,n){var r=this;return e.tidy(function(){if(2!==(t=t).length)throw new v("SimpleRNNCell expects 2 input Tensors, got "+t.length+".");var i=t[1];t=t[0];var a,o=null!=n.training&&n.training;01){for(var o=[],s=0;s= 3D, but received input shape "+JSON.stringify(e));this.inputSpec=[{shape:e}];var n=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(n),this.layer.built=!0),t.prototype.build.call(this,e)},n.prototype.computeOutputShape=function(t){var e=[(t=Xt(t))[0]].concat(t.slice(2)),n=this.layer.computeOutputShape(e),r=t[1];return[n[0],r].concat(n.slice(1))},n.prototype.call=function(t,n){var r=this;return e.tidy(function(){return Rr(function(t,e){return[r.layer.call(t,n),[]]},t=Gt(t),[],!1,null,null,!1,t.shape[1])[1]})},n.className="TimeDistributed",n}(Wr);e.serialization.SerializationMap.register(Vr);var qr=["sum","mul","concat","ave"];var Zr=function(t){function n(e){var n,r=t.call(this,e)||this,i=e.layer.getConfig();if(r.forwardLayer=He({className:e.layer.getClassName(),config:i}),i.goBackwards=!0!==i.goBackwards,r.backwardLayer=He({className:e.layer.getClassName(),config:i}),r.forwardLayer.name="forward_"+r.forwardLayer.name,r.backwardLayer.name="backward_"+r.backwardLayer.name,n=e.mergeMode,E(qr,"BidirectionalMergeMode",n),r.mergeMode=e.mergeMode,e.weights)throw new b("weights support is not implemented for Bidirectional layer yet.");return r._stateful=e.layer.stateful,r.returnSequences=e.layer.returnSequences,r.returnState=e.layer.returnState,r.supportsMasking=!0,r._trainable=!0,r.inputSpec=e.layer.inputSpec,r.numConstants=null,r}return r(n,t),Object.defineProperty(n.prototype,"trainable",{get:function(){return this._trainable},set:function(t){this._trainable=t,null!=this.forwardLayer&&(this.forwardLayer.trainable=t),null!=this.backwardLayer&&(this.backwardLayer.trainable=t)},enumerable:!0,configurable:!0}),n.prototype.getWeights=function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())},n.prototype.setWeights=function(t){var e=t.length,n=Math.floor(e/2);this.forwardLayer.setWeights(t.slice(0,n)),this.backwardLayer.setWeights(t.slice(n))},n.prototype.computeOutputShape=function(t){var e,n,r,i=this.forwardLayer.computeOutputShape(t);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(r=i.slice(1),e=i[0]):e=i[0],e=e,"concat"===this.mergeMode?(e[e.length-1]*=2,n=[e]):n=null==this.mergeMode?[e,e.slice()]:[e],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[e].concat(r).concat(r.slice()):I(n)},n.prototype.apply=function(e,n){var r=null==n?null:n.initialState,i=null==n?null:n.constants;null==n&&(n={});var a=Or(e,r,i,this.numConstants);if(e=a.inputs,r=a.initialState,i=a.constants,Array.isArray(e)&&(r=e.slice(1),e=e[0]),(null==r||0===r.length)&&null==i)return t.prototype.apply.call(this,e,n);var o=[],s=[];if(null!=r){var u=r.length;if(u%2>0)throw new v("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");n.initialState=r,o.push.apply(o,r);var l=r.map(function(t){return new ne({shape:t.shape})});this.forwardLayer.stateSpec=l.slice(0,u/2),this.backwardLayer.stateSpec=l.slice(u/2),s.push.apply(s,l)}if(null!=i)throw new b("Support for constants in Bidirectional layers is not implemented yet.");for(var h=o[0]instanceof re,p=0,c=o;p(array: T[], refernce: T) {\n let counter = 0;\n for (const item of array) {\n if (item === refernce) {\n counter++;\n }\n }\n return counter;\n}\n\n/**\n * If an array is of length 1, just return the first element. Otherwise, return\n * the full array.\n * @param tensors\n */\nexport function singletonOrArray(xs: T[]): T|T[] {\n if (xs.length === 1) {\n return xs[0];\n }\n return xs;\n}\n\n/**\n * Normalizes a list/tensor into a list.\n *\n * If a tensor is passed, we return\n * a list of size 1 containing the tensor.\n *\n * @param x target object to be normalized.\n */\n// tslint:disable-next-line:no-any\nexport function toList(x: any): any[] {\n if (Array.isArray(x)) {\n return x;\n }\n return [x];\n}\n\n/**\n * Generate a UID for a list\n */\n// tslint:disable-next-line:no-any\nexport function objectListUid(objs: any|any[]): string {\n const objectList = toList(objs);\n let retVal = '';\n for (const obj of objectList) {\n if (obj.id == null) {\n throw new ValueError(\n `Object ${obj} passed to objectListUid without an id`);\n }\n if (retVal !== '') {\n retVal = retVal + ', ';\n }\n retVal = retVal + Math.abs(obj.id);\n }\n return retVal;\n}\n/**\n * Converts string to snake-case.\n * @param name\n */\nexport function toSnakeCase(name: string): string {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure =\n intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}\n\nexport function toCamelCase(identifier: string): string {\n // quick return for empty string or single character strings\n if (identifier.length <= 1) {\n return identifier;\n }\n // Check for the underscore indicating snake_case\n if (identifier.indexOf('_') === -1) {\n return identifier;\n }\n return identifier.replace(/[_]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n}\n\n// tslint:disable-next-line:no-any\nlet _GLOBAL_CUSTOM_OBJECTS = {} as {[objName: string]: any};\n\nexport function serializeKerasObject(instance: serialization.Serializable):\n serialization.ConfigDictValue {\n if (instance === null || instance === undefined) {\n return null;\n }\n return {className: instance.getClassName(), config: instance.getConfig()};\n}\n\n/**\n * Deserialize a saved Keras Object\n * @param identifier either a string ID or a saved Keras dictionary\n * @param moduleObjects a list of Python class names to object constructors\n * @param customObjects a list of Python class names to object constructors\n * @param printableModuleName debug text for the object being reconstituted\n * @returns a TensorFlow.js Layers object\n */\n// tslint:disable:no-any\nexport function deserializeKerasObject(\n identifier: string|serialization.ConfigDict,\n moduleObjects = {} as {[objName: string]: any},\n customObjects = {} as {[objName: string]: any},\n printableModuleName = 'object'): any {\n // tslint:enable\n if (typeof identifier === 'string') {\n const functionName = identifier;\n let fn;\n if (functionName in customObjects) {\n fn = customObjects[functionName];\n } else if (functionName in _GLOBAL_CUSTOM_OBJECTS) {\n fn = _GLOBAL_CUSTOM_OBJECTS[functionName];\n } else {\n fn = moduleObjects[functionName];\n if (fn == null) {\n throw new ValueError(`Unknown ${printableModuleName}: ${identifier}`);\n }\n }\n return fn;\n } else {\n // In this case we are dealing with a Keras config dictionary.\n const config = identifier;\n if (config.className == null || config.config == null) {\n throw new ValueError(\n `${printableModuleName}: Improper config format: ` +\n `${JSON.stringify(config)}.\\n` +\n `'className' and 'config' must set.`);\n }\n const className = config.className as string;\n let cls, fromConfig;\n if (className in customObjects) {\n [cls, fromConfig] = customObjects.get(className);\n } else if (className in _GLOBAL_CUSTOM_OBJECTS) {\n [cls, fromConfig] = _GLOBAL_CUSTOM_OBJECTS.className;\n } else if (className in moduleObjects) {\n [cls, fromConfig] = moduleObjects[className];\n }\n if (cls == null) {\n throw new ValueError(`Unknown ${printableModuleName}: ${className}`);\n }\n if (fromConfig != null) {\n // Porting notes: Instead of checking to see whether fromConfig accepts\n // customObjects, we create a customObjects dictionary and tack it on to\n // config.config as config.config.customObjects. Objects can use it, if\n // they want.\n\n // tslint:disable-next-line:no-any\n const customObjectsCombined = {} as {[objName: string]: any};\n for (const key of Object.keys(_GLOBAL_CUSTOM_OBJECTS)) {\n customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key];\n }\n for (const key of Object.keys(customObjects)) {\n customObjectsCombined[key] = customObjects[key];\n }\n // Add the customObjects to config\n const nestedConfig = config.config as serialization.ConfigDict;\n nestedConfig.customObjects = customObjectsCombined;\n\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n const returnObj = fromConfig(cls, config.config);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n\n return returnObj;\n } else {\n // Then `cls` may be a function returning a class.\n // In this case by convention `config` holds\n // the kwargs of the function.\n const backupCustomObjects = {..._GLOBAL_CUSTOM_OBJECTS};\n for (const key of Object.keys(customObjects)) {\n _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key];\n }\n // In python this is **config['config'], for tfjs-layers we require\n // classes that use this fall-through construction method to take\n // a config interface that mimics the expansion of named parameters.\n const returnObj = new cls(config.config);\n _GLOBAL_CUSTOM_OBJECTS = {...backupCustomObjects};\n return returnObj;\n }\n }\n}\n\n/**\n * Compares two numbers for sorting.\n * @param a\n * @param b\n */\nexport function numberCompare(a: number, b: number) {\n return (a < b) ? -1 : ((a > b) ? 1 : 0);\n}\n\n/**\n * Comparison of two numbers for reverse sorting.\n * @param a\n * @param b\n */\nexport function reverseNumberCompare(a: number, b: number) {\n return -1 * numberCompare(a, b);\n}\n\n/**\n * Convert a string into the corresponding DType.\n * @param dtype\n * @returns An instance of DType.\n */\nexport function stringToDType(dtype: string): DataType {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new ValueError(`Invalid dtype: ${dtype}`);\n }\n}\n\n/**\n * Test the element-by-element equality of two Arrays of strings.\n * @param xs First array of strings.\n * @param ys Second array of strings.\n * @returns Wether the two arrays are all equal, element by element.\n */\nexport function stringsEqual(xs: string[], ys: string[]): boolean {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n if (xs.length !== ys.length) {\n return false;\n }\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Get the unique elements of an array.\n * @param xs Array.\n * @returns An Array consisting of the unique elements in `xs`.\n */\nexport function unique(xs: T[]): T[] {\n if (xs == null) {\n return xs;\n }\n const out: T[] = [];\n // TODO(cais): Maybe improve performance by sorting.\n for (const x of xs) {\n if (out.indexOf(x) === -1) {\n out.push(x);\n }\n }\n return out;\n}\n\n/**\n * Determine if an Object is empty (i.e., does not have own properties).\n * @param obj Object\n * @returns Whether the Object is empty.\n * @throws ValueError: If object is `null` or `undefined`.\n */\nexport function isObjectEmpty(obj: {}): boolean {\n if (obj == null) {\n throw new ValueError(`Invalid value in obj: ${JSON.stringify(obj)}`);\n }\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Helper function used to build type union/enum run-time checkers.\n * @param values The list of allowed values.\n * @param label A string name for the type\n * @param value The value to test.\n * @throws ValueError: If the value is not in values nor `undefined`/`null`.\n */\nexport function checkStringTypeUnionValue(\n values: string[], label: string, value: string): void {\n if (value == null) {\n return;\n }\n if (values.indexOf(value) < 0) {\n throw new ValueError(`${value} is not a valid ${label}. Valid values are ${\n values} or null/undefined.`);\n }\n}\n\n/**\n * Helper function for verifying the types of inputs.\n *\n * Ensures that the elements of `x` are all of type `expectedType`.\n * Also verifies that the length of `x` is within bounds.\n *\n * @param x Object to test.\n * @param expectedType The string expected type of all of the elements in the\n * Array.\n * @param minLength Return false if x.length is less than this.\n * @param maxLength Return false if x.length is greater than this.\n * @returns true if and only if `x` is an `Array` with\n * length >= `minLength` and <= `maxLength`.\n */\n// tslint:disable:no-any\nexport function checkArrayTypeAndLength(\n x: any, expectedType: string, minLength = 0,\n maxLength = Infinity): boolean {\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (\n Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(e => typeof e === expectedType));\n}\n// tslint:enable:no-any\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/contraints.py */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport {getScalar} from './backend/state';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n// tslint:enable:max-line-length\n\n/**\n * Helper function used by many of the Constraints to find the L2Norms.\n */\nfunction calcL2Norms(w: Tensor, axis: number): Tensor {\n return tidy(() => tfc.sqrt(tfc.sum(tfc.mulStrict(w, w), axis, true)));\n}\n\n/**\n * Base class for functions that impose constraints on weight values\n */\n/**\n * @doc {\n * heading: 'Constraints',\n * subheading: 'Classes',\n * namespace: 'constraints'\n * }\n */\nexport abstract class Constraint extends serialization.Serializable {\n /* Porting note: was __call__, apply chosen to match other similar choices */\n abstract apply(w: Tensor): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\nexport interface MaxNormConfig {\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\n/**\n * MaxNorm weight constraint.\n *\n * Constrains the weights incident to each hidden unit\n * to have a norm less than or equal to a desired value.\n *\n * References\n * - [Dropout: A Simple Way to Prevent Neural Networks from Overfitting\n * Srivastava, Hinton, et al.\n * 2014](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf)\n */\nexport class MaxNorm extends Constraint {\n static readonly className = 'MaxNorm';\n private maxValue: number;\n private axis: number;\n private readonly defaultMaxValue = 2;\n private readonly defaultAxis = 0;\n\n constructor(config: MaxNormConfig) {\n super();\n this.maxValue =\n config.maxValue != null ? config.maxValue : this.defaultMaxValue;\n this.axis = config.axis != null ? config.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.clipByValue(norms, 0, this.maxValue);\n return tfc.mul(w, tfc.div(desired, tfc.add(getScalar(epsilon()), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {maxValue: this.maxValue, axis: this.axis};\n }\n}\nserialization.SerializationMap.register(MaxNorm);\n\nexport interface UnitNormConfig {\n /**\n * Axis along which to calculate norms.\n *\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * [rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n}\n\n/**\n * Constrains the weights incident to each hidden unit to have unit norm.\n */\nexport class UnitNorm extends Constraint {\n static readonly className = 'UnitNorm';\n private axis: number;\n private readonly defaultAxis = 0;\n constructor(config: UnitNormConfig) {\n super();\n this.axis = config.axis != null ? config.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(\n () => tfc.div(\n w, tfc.add(getScalar(epsilon()), calcL2Norms(w, this.axis))));\n }\n\n getConfig(): serialization.ConfigDict {\n return {axis: this.axis};\n }\n}\nserialization.SerializationMap.register(UnitNorm);\n\n/**\n * Constains the weight to be non-negative.\n */\nexport class NonNeg extends Constraint {\n static readonly className = 'NonNeg';\n\n apply(w: Tensor): Tensor {\n return tfc.relu(w);\n }\n}\nserialization.SerializationMap.register(NonNeg);\n\nexport interface MinMaxNormConfig {\n /**\n * Minimum norm for incoming weights\n */\n minValue?: number;\n /**\n * Maximum norm for incoming weights\n */\n maxValue?: number;\n /**\n * Axis along which to calculate norms.\n * For instance, in a `Dense` layer the weight matrix\n * has shape `[inputDim, outputDim]`,\n * set `axis` to `0` to constrain each weight vector\n * of length `[inputDim,]`.\n * In a `Conv2D` layer with `dataFormat=\"channels_last\"`,\n * the weight tensor has shape\n * `[rows, cols, inputDepth, outputDepth]`,\n * set `axis` to `[0, 1, 2]`\n * to constrain the weights of each filter tensor of size\n * `[rows, cols, inputDepth]`.\n */\n axis?: number;\n /**\n * Rate for enforcing the constraint: weights will be rescaled to yield:\n * `(1 - rate) * norm + rate * norm.clip(minValue, maxValue)`.\n * Effectively, this means that rate=1.0 stands for strict\n * enforcement of the constraint, while rate<1.0 means that\n * weights will be rescaled at each step to slowly move\n * towards a value inside the desired interval.\n */\n rate?: number;\n}\n\nexport class MinMaxNorm extends Constraint {\n static readonly className = 'MinMaxNorm';\n private minValue: number;\n private maxValue: number;\n private rate: number;\n private axis: number;\n private readonly defaultMinValue = 0.0;\n private readonly defaultMaxValue = 1.0;\n private readonly defaultRate = 1.0;\n private readonly defaultAxis = 0;\n\n constructor(config: MinMaxNormConfig) {\n super();\n this.minValue =\n config.minValue != null ? config.minValue : this.defaultMinValue;\n this.maxValue =\n config.maxValue != null ? config.maxValue : this.defaultMaxValue;\n this.rate = config.rate != null ? config.rate : this.defaultRate;\n this.axis = config.axis != null ? config.axis : this.defaultAxis;\n }\n\n apply(w: Tensor): Tensor {\n return tidy(() => {\n const norms = calcL2Norms(w, this.axis);\n const desired = tfc.add(\n tfc.mul(\n getScalar(this.rate),\n tfc.clipByValue(norms, this.minValue, this.maxValue)),\n tfc.mul(getScalar(1.0 - this.rate), norms));\n return tfc.mul(w, tfc.div(desired, tfc.add(getScalar(epsilon()), norms)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n minValue: this.minValue,\n maxValue: this.maxValue,\n rate: this.rate,\n axis: this.axis\n };\n }\n}\nserialization.SerializationMap.register(MinMaxNorm);\n\n/** @docinline */\nexport type ConstraintIdentifier =\n 'maxNorm'|'minMaxNorm'|'nonNeg'|'unitNorm'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in ConstraintIdentifier]: string} = {\n 'maxNorm': 'MaxNorm',\n 'minMaxNorm': 'MinMaxNorm',\n 'nonNeg': 'NonNeg',\n 'unitNorm': 'UnitNorm'\n };\n\nexport function serializeConstraint(constraint: Constraint):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeConstraint(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Constraint {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'constraint');\n}\n\nexport function getConstraint(identifier: ConstraintIdentifier|\n serialization.ConfigDict|Constraint): Constraint {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeConstraint(config);\n } else if (identifier instanceof Constraint) {\n return identifier;\n } else {\n return deserializeConstraint(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constraint, MaxNorm, MaxNormConfig, MinMaxNorm, MinMaxNormConfig, NonNeg, UnitNorm, UnitNormConfig} from './constraints';\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'MaxNorm',\n * configParamIndices: [0]\n * }\n */\nexport function maxNorm(config: MaxNormConfig): Constraint {\n return new MaxNorm(config);\n}\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'UnitNorm',\n * configParamIndices: [0]\n * }\n */\nexport function unitNorm(config: UnitNormConfig): Constraint {\n return new UnitNorm(config);\n}\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'NonNeg'\n * }\n */\nexport function nonNeg(): Constraint {\n return new NonNeg();\n}\n\n/**\n * @doc {\n * heading: 'Constraints',\n * namespace: 'constraints',\n * useDocsFrom: 'MinMaxNormConfig',\n * configParamIndices: [0]\n * }\n */\nexport function minMaxNorm(config: MinMaxNormConfig): Constraint {\n return new MinMaxNorm(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Common functions for TensorFlow.js Layers.\n */\nimport {checkStringTypeUnionValue} from './utils/generic_utils';\n// A map from the requested scoped name of a Tensor to the number of Tensors\n// wanting that name so far. This allows enforcing name uniqueness by appending\n// an incrementing index, e.g. scope/name, scope/name_1, scope/name_2, etc.\nconst nameMap: Map = new Map();\n\n// TODO(cais): Perhaps move the enums to a more suitable place, e.g.,\n// constants.ts.\n/** @docinline */\nexport type DataFormat = 'channelsFirst'|'channelsLast';\nexport const VALID_DATA_FORMAT_VALUES = ['channelsFirst', 'channelsLast'];\nexport function checkDataFormat(value?: string): void {\n checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, 'DataFormat', value);\n}\n\n/** @docinline */\nexport type PaddingMode = 'valid'|'same'|'causal';\nexport const VALID_PADDING_MODE_VALUES = ['valid', 'same', 'causal'];\nexport function checkPaddingMode(value?: string): void {\n checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, 'PaddingMode', value);\n}\n\n/** @docinline */\nexport type PoolMode = 'max'|'avg';\nexport const VALID_POOL_MODE_VALUES = ['max', 'avg'];\nexport function checkPoolMode(value?: string): void {\n checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, 'PoolMode', value);\n}\n\nconst _nameScopeStack: string[] = [];\nconst _nameScopeDivider = '/';\n\n/**\n * Enter namescope, which can be nested.\n */\nexport function nameScope(name: string, fn: () => T): T {\n _nameScopeStack.push(name);\n try {\n const val: T = fn();\n _nameScopeStack.pop();\n return val;\n } catch (e) {\n _nameScopeStack.pop();\n throw e;\n }\n}\n\n/**\n * Get the current namescope as a flat, concatenated string.\n */\nfunction currentNameScopePrefix(): string {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}\n\n/**\n * Get the name a Tensor (or Variable) would have if not uniqueified.\n * @param tensorName\n * @return Scoped name string.\n */\nexport function getScopedTensorName(tensorName: string): string {\n if (!isValidTensorName(tensorName)) {\n throw new Error('Not a valid tensor name: \\'' + tensorName + '\\'');\n }\n return currentNameScopePrefix() + tensorName;\n}\n\n/**\n * Get unique names for Tensors and Variables.\n * @param scopedName The fully-qualified name of the Tensor, i.e. as produced by\n * `getScopedTensorName()`.\n * @return A unique version of the given fully scoped name.\n * If this is the first time that the scoped name is seen in this session,\n * then the given `scopedName` is returned unaltered. If the same name is\n * seen again (producing a collision), an incrementing suffix is added to the\n * end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.\n */\nexport function getUniqueTensorName(scopedName: string): string {\n if (!isValidTensorName(scopedName)) {\n throw new Error('Not a valid tensor name: \\'' + scopedName + '\\'');\n }\n if (!nameMap.has(scopedName)) {\n nameMap.set(scopedName, 0);\n }\n const index = nameMap.get(scopedName);\n nameMap.set(scopedName, nameMap.get(scopedName) + 1);\n\n if (index > 0) {\n const result = scopedName + '_' + index;\n // Mark the composed name as used in case someone wants\n // to call getUniqueTensorName(\"name_1\").\n nameMap.set(result, 1);\n return result;\n } else {\n return scopedName;\n }\n}\n\nconst tensorNameRegex = new RegExp(/^[A-Za-z][A-Za-z0-9\\._\\/]*$/);\n\n/**\n * Determine whether a string is a valid tensor name.\n * @param name\n * @returns A Boolean indicating whether `name` is a valid tensor name.\n */\nexport function isValidTensorName(name: string): boolean {\n return name.match(tensorNameRegex) ? true : false;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Math utility functions.\n *\n * This file contains some frequently used math function that operates on\n * number[] or Float32Array and return a number. Many of these functions are\n * not-so-thick wrappers around TF.js Core functions. But they offer the\n * convenience of\n * 1) not having to convert the inputs into Tensors,\n * 2) not having to convert the returned Tensors to numbers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor1D, tensor1d} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\n\nexport type ArrayTypes = Uint8Array|Int32Array|Float32Array;\n\n/**\n * Determine if a number is an integer.\n */\nexport function isInteger(x: number): boolean {\n return x === parseInt(x.toString(), 10);\n}\n\n/**\n * Calculate the product of an array of numbers.\n * @param array The array to calculate the product over.\n * @param begin Beginning index, inclusive.\n * @param end Ending index, exclusive.\n * @return The product.\n */\nexport function arrayProd(\n array: number[]|ArrayTypes, begin?: number, end?: number): number {\n if (begin == null) {\n begin = 0;\n }\n if (end == null) {\n end = array.length;\n }\n\n let prod = 1;\n for (let i = begin; i < end; ++i) {\n prod *= array[i];\n }\n return prod;\n}\n\n/**\n * A helper function transforms the two input types to an instance of Tensor1D,\n * so the return value can be fed directly into various TF.js Core functions.\n * @param array\n */\nfunction toArray1D(array: number[]|Float32Array): Tensor1D {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return tensor1d(array);\n}\n\n/**\n * Compute minimum value.\n * @param array\n * @return minimum value.\n */\nexport function min(array: number[]|Float32Array): number {\n return tfc.min(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute maximum value.\n * @param array\n * @return maximum value\n */\nexport function max(array: number[]|Float32Array): number {\n return tfc.max(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute sum of array.\n * @param array\n * @return The sum.\n */\nexport function sum(array: number[]|Float32Array): number {\n return tfc.sum(toArray1D(array)).dataSync()[0];\n}\n\n/**\n * Compute mean of array.\n * @param array\n * @return The mean.\n */\nexport function mean(array: number[]|Float32Array): number {\n return sum(array) / array.length;\n}\n\n/**\n * Compute variance of array.\n * @param array\n * @return The variance.\n */\nexport function variance(array: number[]|Float32Array): number {\n const demeaned = tfc.sub(toArray1D(array), scalar(mean(array)));\n const sumSquare = tfc.sum(tfc.mulStrict(demeaned, demeaned)).dataSync()[0];\n return sumSquare / array.length;\n}\n\n/**\n * Compute median of array.\n * @param array\n * @return The median value.\n */\nexport function median(array: number[]|Float32Array): number {\n const arraySorted = array.slice().sort((a, b) => a - b);\n const lowIdx = Math.floor((arraySorted.length - 1) / 2);\n const highIdx = Math.ceil((arraySorted.length - 1) / 2);\n if (lowIdx === highIdx) {\n return arraySorted[lowIdx];\n }\n return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2;\n}\n\n/**\n * Generate an array of integers in [begin, end).\n * @param begin Beginning integer, inclusive.\n * @param end Ending integer, inclusive.\n * @returns Range array.\n * @throws ValueError, iff `end` < `begin`.\n */\nexport function range(begin: number, end: number): number[] {\n if (end < begin) {\n throw new ValueError(`end (${end}) < begin (${begin}) is forbidden.`);\n }\n const out: number[] = [];\n for (let i = begin; i < end; ++i) {\n out.push(i);\n }\n return out;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * deeplearn.js backend.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {onesLike as coreOnesLike, Scalar, scalar, Tensor, Tensor1D, tensor1d, Tensor2D, Tensor3D, Tensor4D, tidy, util, where, zerosLike as coreZerosLike} from '@tensorflow/tfjs-core';\n\nimport {disposeScalarCache, getScalar} from '../backend/state';\nimport {checkDataFormat, DataFormat} from '../common';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {HasShape, Shape} from '../types';\nimport * as math_utils from '../utils/math_utils';\n\nimport {imageDataFormat} from './common';\n\n// tslint:enable\n\n/* Setting and getting backend from deeplearn.js. */\n\n// Default deeplearn.js backend is WebGL (GPU).\nlet backend: 'cpu'|'webgl' = 'webgl';\n\nexport function setBackend(requestedBackend: 'cpu'|'webgl') {\n tfc.setBackend(requestedBackend);\n backend = requestedBackend;\n disposeScalarCache();\n}\n\nexport function getBackend(): 'cpu'|'webgl' {\n return backend;\n}\n\n/**\n * Indicates whether the backend is operating symbolically.\n *\n * This function will be used to determine how to interpret user code. If\n * it returns true, calls to the backend construct a symbolic graph; if\n * it returns false, calls to the backend execute immediately.\n */\nexport function isBackendSymbolic(): boolean {\n return false;\n}\n\n/**\n * Get the number of elements in a Tensor.\n * @param x The Tensor.\n * @return Number of elements in `x`.\n */\nexport function countParams(x: HasShape): number {\n const shape = x.shape;\n if (shape.length > 0) {\n return shape.reduce((a: number, b: number) => a * b);\n } else {\n // Scalar.\n return 1;\n }\n}\n\n/**\n * Casts a tensor to a different dtype and returns it.\n * @param x Input tensor.\n * @param dtype String: 'float32'|'int32'|'bool'.\n * @returns Tensor of the specified `dtype`.\n */\nexport function cast(x: Tensor, dtype: 'float32'|'int32'|'bool'): Tensor {\n return x.asType(dtype);\n}\n\n/**\n * Adds a 1-sized dimension at index \"axis\".\n * @param x Input tensor.\n * @param axis Position where to add the new axis.\n * @returns Result of the dimension expansion.\n */\nexport function expandDims(x: Tensor, axis = -1): Tensor {\n const outShape = x.shape.slice();\n if (axis < 0) {\n axis = outShape.length + axis + 1;\n }\n outShape.splice(axis, 0, 1);\n return x.reshape(outShape);\n}\n\n/**\n * Repeats a 2D tensor.\n *\n * If `x` has shape `[samples, dim]` and `n` is 2, for example, the output\n * will have shape `[samples, 2, dim]`.\n *\n * @param x Input tensor.\n * @param n Integer, number of times to repeat.\n * @returns The result of the repeat operation.\n * @throws ValueError: If input tensor is not 2D.\n */\nexport function repeat(x: Tensor, n: number): Tensor {\n return tidy(() => {\n if (x.shape.length !== 2) {\n throw new ValueError(\n `repeat() expects a rank-2 tensor, but received a ` +\n `rank-${x.shape.length} tensor.`);\n }\n const y = expandDims(x, 1);\n return tile(y, [1, n, 1]);\n });\n}\n\n/**\n * Flatten an Tensor into 1D.\n * @param x Input tensor.\n * @return The result of the flattening `x`.\n */\nexport function flatten(x: Tensor): Tensor {\n const newShape = [math_utils.arrayProd(x.shape)];\n return x.reshape(newShape);\n}\n\n/**\n * Turn a nD tensor into a 2D tensor with same 0th dimension.\n * In other words, it flattens each data samples of a batch.\n *\n * @param x The tensor to flatten. The rank of this tensor is required to be 2\n * or higher.\n * @return The result of the flattening.\n */\nexport function batchFlatten(x: Tensor): Tensor {\n if (x.rank <= 1) {\n throw new ValueError(\n `batchFlatten requires a minimum rank of 2. Got rank: ${x.rank}.`);\n }\n const newShape = [x.shape[0], math_utils.arrayProd(x.shape, 1)];\n return x.reshape(newShape);\n}\n\n/**\n * Do slicing along the first axis.\n * @param array input `Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the first axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `Tensor`.\n */\nexport function sliceAlongFirstAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [start, 0], [size, array.shape[1]]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [start, 0, 0],\n [size, array.shape[1], array.shape[2]]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [start, 0, 0, 0],\n [size, array.shape[1], array.shape[2], array.shape[3]]);\n default:\n throw new ValueError(\n `sliceAlongFirstAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the last axis.\n * @param array input `Tensor`.\n * @param start starting index, inclusive.\n * @param size size of the slice along the last axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `Tensor`.\n */\nexport function sliceAlongLastAxis(\n array: Tensor, start: number, size: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n return tfc.slice2d(\n array as Tensor2D, [0, start], [array.shape[0], size]);\n case 3:\n return tfc.slice3d(\n array as Tensor3D, [0, 0, start],\n [array.shape[0], array.shape[1], size]);\n case 4:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, 0, start],\n [array.shape[0], array.shape[1], array.shape[2], size]);\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Do slicing along the sepcified axis.\n * @param array input `Tensor`.\n * @param start starting index, inclusive.\n * @param size of the slice along the chosen axis.\n * @param choose an axis.\n * @returns result of the slicing.\n * @throws ValueError: If `array` is of an unsupported subtype of `Tensor`.\n */\nexport function sliceAlongAxis(\n array: Tensor, start: number, size: number, axis: number): Tensor {\n return tidy(() => {\n switch (array.rank) {\n case 1:\n return tfc.slice1d(array as Tensor1D, start, size);\n case 2:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 3:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice3d(\n array as Tensor3D, [0, start, 0],\n [array.shape[0], size, array.shape[2]]);\n case 3:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n case 4:\n switch (axis) {\n case 1:\n return sliceAlongFirstAxis(array, start, size);\n case 2:\n return tfc.slice4d(\n array as Tensor4D, [0, start, 0, 0],\n [array.shape[0], size, array.shape[2], array.shape[3]]);\n case 3:\n return tfc.slice4d(\n array as Tensor4D, [0, 0, start, 0],\n [array.shape[0], array.shape[1], size, array.shape[3]]);\n case 4:\n return sliceAlongLastAxis(array, start, size);\n default:\n throw new ValueError(\n `The axis is not within the rank of the tensor ` +\n `${axis}`);\n }\n default:\n throw new ValueError(\n `sliceAlongLastAxis() received an unsupported tensor rank: ` +\n `${array.rank}`);\n }\n });\n}\n\n/**\n * Concatenates a list of tensors alongside the specified axis.\n * @param tensors `Array` of tensors to concatenate.\n * @param axis Concatenation axis.\n * @returns The result of the concatenation.\n */\nexport function concatenate(tensors: Tensor[], axis = -1): Tensor {\n let rank: number;\n if (axis < 0) {\n rank = tensors[0].rank;\n if (rank !== 0) {\n axis = rank;\n } else {\n axis = 0;\n }\n }\n if (axis === tensors[0].rank) {\n // Porting Note: This is necessary because tfc.concat() requires axis to be\n // in the interval [-rank, rank).\n axis = -1;\n }\n // Porting Note: Sparse concat is not supported yet.\n return tfc.concat(tensors, axis);\n}\n\n/**\n * Concatenate two arrays along the first dimension.\n * @param a The 1st `Tensor` to concatenate.\n * @param b The 2nd `Tensor` to concatenate.\n * @returns Result of the concatenation.\n * @throws ValueError: If `a` is of an unsupported subtype of `Tensor`.\n */\nexport function concatAlongFirstAxis(a: Tensor, b: Tensor): Tensor {\n switch (a.rank) {\n case 1:\n return tfc.concat1d([a as Tensor1D, b as Tensor1D]);\n case 2:\n return tfc.concat2d([a as Tensor2D, b as Tensor2D], 0);\n case 3:\n return tfc.concat3d([a as Tensor3D, b as Tensor3D], 0);\n case 4:\n return tfc.concat4d([a as Tensor4D, b as Tensor4D], 0);\n default:\n throw new ValueError(\n 'concatAlongFirstAxis() received an unsupported tensor rank: ' +\n a.rank);\n }\n}\n\n/**\n * Creates a tensor by tiling `x` by `n`.\n * @param x A tensor.\n * @param n An Array of integers or a single integer. If an Array, the length\n * must be the same as the number of dimensions in `x`. If a single integer,\n * it will be treated as an Array of length 1.\n */\nexport function tile(x: Tensor, n: number|number[]): Tensor {\n if (!Array.isArray(n)) {\n n = [n];\n }\n if (x.rank !== n.length) {\n throw new ValueError(\n `The length of input n (${n.length}) does not match ` +\n `the number of dimensions in input x (${x.rank})`);\n }\n return tfc.tile(x, n);\n}\n\n/* Creation of random tensors. */\n\n\n/**\n * Get a tensor with normal distribution of values.\n *\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @return The normal tensor.\n */\nexport function randomNormal(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: 'float32'|'int32',\n seed?: number): Tensor {\n return tfc.randomNormal(shape, mean, stddev, dtype, seed);\n}\n\n/* Linear Algebra */\n\n/**\n * Multiply two tensors and returns the result as a tensor.\n *\n * For 2D tensors, this is equivalent to matrix multiplication (matMul).\n * For tensors of higher ranks, it follows the Theano behavior,\n * (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`).\n *\n * @param x A tensor of at least rank 2.\n * @param y A tensor of at least rank 2.\n * @return Result of the dot operation.\n */\nexport function dot(x: Tensor, y: Tensor): Tensor {\n if (y.rank !== 2) {\n throw new NotImplementedError(\n `dot support for y other than rank 2 is not yet implemented: ` +\n `y shape = ${y.shape}`);\n } else {\n if (x.rank === 2) {\n return tfc.matMul(x as Tensor2D, y as Tensor2D);\n } else if (x.rank === 3) {\n const xShape0 = x.shape[0];\n const xShape1 = x.shape[1];\n const xShape2 = x.shape[2];\n x = x.reshape([xShape0 * xShape1, xShape2]);\n return tfc.matMul(x as Tensor2D, y as Tensor2D).reshape([\n xShape0, xShape1, y.shape[1]\n ]);\n } else {\n throw new NotImplementedError(\n `dot support for x of rank ${x.rank} is not yet implemented: ` +\n `x shape = ${x.shape}`);\n }\n }\n}\n\n/**\n * Compute the sign Tensor of an input Tensor.\n *\n * Elements of the input `Tensor` that are === 0 are mapped to 0.\n * Elements of the input `Tensor` that are > 0 are mapped to 1.\n * Elements of the input `Tensor` that are < 0 are mapped to -1.\n *\n * @param x Input `Tensor`.\n * @return The sign `Tensor`.\n */\nexport function sign(x: Tensor): Tensor {\n // TODO(cais): Move to the core.\n return tidy(() => {\n const zerosLikeX = coreZerosLike(x);\n const onesLikeX = coreOnesLike(x);\n return where(\n tfc.equal(x, zerosLikeX), zerosLikeX,\n where(\n tfc.greater(x, coreZerosLike(x)), onesLikeX,\n tfc.mul(getScalar(-1), onesLikeX)));\n });\n}\n\n/**\n * Computes the one-hot representation of an integer tensor.\n * @param indices nD integer tensor of shape\n * `(batch_size, dim1, dim2, ... dim(n-1))`\n * @param numClasses Integer, number of classes to consider.\n * @returns (n + 1)D one hot representation of the input\n * with shape `(batch_size, dim1, dim2, ... dim(n-1), num_classes)`\n */\nexport function oneHot(indices: Tensor, numClasses: number): Tensor {\n return tidy(() => {\n if (indices.rank !== 1) {\n throw new Error(\n 'Only 1D one-hot tensors are supported in the ' +\n 'deeplearn backend, at present.');\n }\n indices = indices.toInt();\n return tfc.oneHot(indices as Tensor1D, numClasses).toFloat();\n });\n}\n\n/* Elementary math functions. */\n\n/**\n * Retrieves the elements of indices `indices` in the tensor `reference`.\n * @param reference A tensor.\n * @param indices An integer tensor of indices or an `Array` of integers.\n * @param axis Axis along which to perform the gather operation.\n * @returns The result of the gathering as a tensor.\n */\nexport function gather(\n reference: Tensor, indices: number[]|Tensor1D, axis?: number): Tensor {\n return tidy(() => {\n if (Array.isArray(indices)) {\n indices = tensor1d(indices, 'int32');\n } else {\n indices = indices.toInt();\n }\n return tfc.gather(reference, indices, axis);\n });\n}\n\n/**\n * Element-wise square.\n * @param x Input tensor.\n * @return element-wise x^2\n */\nexport function square(x: Tensor): Tensor {\n return tfc.mulStrict(x, x);\n}\n\n/**\n * Element-wise exponentiation.\n *\n * Porting Note: In PyKeras, `a` (the exponent) is a Python integer, which\n * takes advatnage of the backend's (e.g., TensorFlow's) automatic conversion\n * to tensor. Here we allow `a` to be either a number or a tensor.\n *\n * @param x The base tensor.\n * @param a The exponent, tensor or number. If a number, it is rounded to the\n * nearest integer and converted to a tensor.\n * @returns A tensor of the same shape as `x`.\n */\nexport function pow(x: Tensor, a: Tensor|number): Tensor {\n return tidy(() => {\n if (typeof (a) === 'number') {\n a = scalar(Math.round(a), 'int32');\n }\n if (a.dtype !== 'int32') {\n throw new NotImplementedError(\n `Non-int32 dtype (${a.dtype}) is not supported by pow() yet`);\n }\n return tfc.pow(x, a as Tensor);\n });\n}\n\n/* Neural-network operations. */\n\n/**\n * Add a bias to a tensor.\n *\n * @param x The tensor to add the bias to.\n * @param bias The bias to add to `x`. Must be 1D or the same rank as `x`.\n * @return Result of the bias adding.\n * @throws ValueError: If the rank of `bias` is incorrect.\n */\nexport function biasAdd(\n x: Tensor, bias: Tensor, dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n\n if (bias.rank !== 1 && bias.rank !== x.rank) {\n throw new ValueError(\n 'Unexpected bias dimensions: ' + bias.rank +\n '; expected it to be 1 or ' + x.rank);\n }\n const biasShape = bias.shape;\n\n let y: Tensor;\n if (x.rank === 5) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, biasShape[0], 1, 1, 1]));\n } else {\n y = x.add(bias.reshape(\n [1, biasShape[3], biasShape[0], biasShape[1], biasShape[2]]));\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, 1, 1, 1, biasShape[0]]));\n } else {\n y = x.add(bias.reshape([1].concat(biasShape)));\n }\n }\n } else if (x.rank === 4) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, biasShape[0], 1, 1]));\n } else {\n y = x.add(\n bias.reshape([1, biasShape[2], biasShape[0], biasShape[1]]));\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, 1, 1, biasShape[0]]));\n } else {\n y = x.add(bias.reshape([1].concat(biasShape)));\n }\n }\n } else if (x.rank === 3) {\n if (dataFormat === 'channelsFirst') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, biasShape[0], 1]));\n } else {\n y = x.add(bias.reshape([1, biasShape[1], biasShape[0]]));\n }\n } else if (dataFormat === 'channelsLast') {\n if (biasShape.length === 1) {\n y = x.add(bias.reshape([1, 1, biasShape[0]]));\n } else {\n y = x.add(bias.reshape([1].concat(biasShape)));\n }\n }\n } else if (x.rank < 3) {\n y = x.add(bias);\n } else {\n throw new ValueError(`Unsupported input rank by biasAdd: ${x.rank}`);\n }\n return y;\n });\n}\n\n/**\n * Exponential linear unit (ELU).\n * @param x A tensor or variable to compute the activation function for.\n * @param alpha: A scalar, a scaling factor for the negative section.\n * @return Output of the ELU operation.\n */\nexport function elu(x: Tensor, alpha = 1): Tensor {\n // TODO(cais): Add support for alpha values other than 1.\n if (alpha !== 1) {\n throw new NotImplementedError(\n `Support for alpha values other than 1 (${alpha}) is not implemented ` +\n `yet.`);\n }\n return tfc.elu(x);\n}\n\n/**\n * Softsign of a tensor.\n *\n * Defined as x / (abs(x) + 1), element-wise.\n *\n * @param x: Input.\n * @returns Output.\n */\nexport function softsign(x: Tensor): Tensor {\n return tidy(() => tfc.div(x, tfc.add(getScalar(1), tfc.abs(x))));\n}\n\n/**\n * Sets entries in `x` to zero at random, while scaling the entire tensor.\n *\n * @param x input tensor.\n * @param level fraction of the entries in the tensor that will be set to 0.\n * @param noiseShape shape of randomly generated keep/drop flags, must be\n * broadcastable to the shape of `x`.\n * @param seed random seed to ensure determinism.\n * @returns Result of the dropout operation.\n */\nexport function dropout(\n x: Tensor, level: Scalar, noiseShape?: number[], seed?: number): Tensor {\n return tidy(() => {\n // TODO(cais): Switch to deeplearn.js implementation of dropout when it\n // becomes avaialable.\n if (noiseShape != null && !util.arraysEqual(x.shape, noiseShape)) {\n throw new NotImplementedError(\n 'Non-default noise shape is not implemented yet: ' +\n JSON.stringify(noiseShape));\n }\n if (seed != null) {\n throw new NotImplementedError('seed is not implemented for dropout yet.');\n }\n let multiplier = tfc.step(tfc.add(\n tfc.neg(level) as Scalar, tfc.randomUniform(x.shape, 0, 1, 'float32')));\n // Scale the kept elements, so the expected sum is unchanged.\n multiplier = tfc.mul(\n tfc.div(getScalar(1), tfc.sub(getScalar(1), level)) as Scalar,\n multiplier);\n return tfc.mul(x, multiplier);\n });\n}\n\n/**\n * Element-wise, segment-wise linear approximation of sigmoid.\n *\n * Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`.\n * In `-2.5 <= x <= 2.5`, returns `0.2 * x + 0.5`.\n *\n * @param x Input tensor.\n * @returns Output tensor.\n */\nexport function hardSigmoid(x: Tensor): Tensor {\n return tidy(() => {\n const y = tfc.add(getScalar(0.5), tfc.mul(getScalar(0.2), x));\n return tfc.clipByValue(y, 0, 1);\n });\n}\n\n/**\n * Invoke `x` in the training phase, and `alt` otherwise.\n *\n * Porting Note: We do not create placeholder tensors for the `training` boolean\n * flag here, because there is no such thing in the TF.js imperative backend.\n *\n * @param x The function to invoke iff `training` is `true`.\n * @param alt The function to invoke iff `training` is `false`.\n * @param training Boolean flag for whether training phase is active.\n * @returns The return value of `x()` if `training` is `true`, or the return\n * value of `alt()` if `training` is `false`.\n */\nexport function inTrainPhase(x: () => T, alt: () => T, training = false): T {\n return training ? x() : alt();\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// tslint:disable:max-line-length\nimport {DataType, eye, linalg, mul, ones, randomUniform, scalar, Scalar, serialization, Tensor, Tensor2D, tidy, truncatedNormal, zeros} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from './backend/state';\nimport * as K from './backend/tfjs_backend';\nimport {checkDataFormat, DataFormat} from './common';\nimport {NotImplementedError, ValueError} from './errors';\nimport {Shape} from './types';\nimport {checkStringTypeUnionValue, deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\nimport {arrayProd} from './utils/math_utils';\n\n// tslint:enable:max-line-length\n\n/** @docinline */\nexport type FanMode = 'fanIn'|'fanOut'|'fanAvg';\nexport const VALID_FAN_MODE_VALUES = ['fanIn', 'fanOut', 'fanAvg'];\nexport function checkFanMode(value?: string): void {\n checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, 'FanMode', value);\n}\n\n/** @docinline */\nexport type Distribution = 'normal'|'uniform';\nexport const VALID_DISTRIBUTION_VALUES = ['normal', 'uniform'];\nexport function checkDistribution(value?: string): void {\n checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, 'Distribution', value);\n}\n\n/**\n * Initializer base class.\n *\n * @doc {\n * heading: 'Initializers', subheading: 'Classes', namespace: 'initializers'}\n */\nexport abstract class Initializer extends serialization.Serializable {\n public fromConfigUsesCustomObjects(): boolean {\n return false;\n }\n /**\n * Generate an initial value.\n * @param shape\n * @param dtype\n * @return The init value.\n */\n abstract apply(shape: Shape, dtype?: DataType): Tensor;\n\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/**\n * Initializer that generates tensors initialized to 0.\n */\nexport class Zeros extends Initializer {\n static className = 'Zeros';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return zeros(shape, dtype);\n }\n}\nserialization.SerializationMap.register(Zeros);\n\n/**\n * Initializer that generates tensors initialized to 1.\n */\nexport class Ones extends Initializer {\n static className = 'Ones';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return ones(shape, dtype);\n }\n}\nserialization.SerializationMap.register(Ones);\n\nexport interface ConstantConfig {\n /** The value for each element in the variable. */\n value: number;\n}\n\n/**\n * Initializer that generates values initialized to some constant.\n */\nexport class Constant extends Initializer {\n static className = 'Constant';\n private value: number;\n constructor(config: ConstantConfig) {\n super();\n if (typeof config !== 'object') {\n throw new ValueError(\n `Expected argument of type ConstantConfig but got ${config}`);\n }\n if (config.value === undefined) {\n throw new ValueError(`config must have value set but got ${config}`);\n }\n this.value = config.value;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => mul(scalar(this.value), ones(shape, dtype)));\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n value: this.value,\n };\n }\n}\nserialization.SerializationMap.register(Constant);\n\nexport interface RandomUniformConfig {\n /** Lower bound of the range of random values to generate. */\n minval?: number;\n /** Upper bound of the range of random values to generate. */\n maxval?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\n/**\n * Initializer that generates random values initialized to a uniform\n * distribution.\n *\n * Values will be distributed uniformly between the configured minval and\n * maxval.\n */\nexport class RandomUniform extends Initializer {\n static className = 'RandomUniform';\n readonly DEFAULT_MINVAL = -0.05;\n readonly DEFAULT_MAXVAL = 0.05;\n private minval: number;\n private maxval: number;\n private seed: number;\n\n constructor(config: RandomUniformConfig) {\n super();\n this.minval = config.minval || this.DEFAULT_MINVAL;\n this.maxval = config.maxval || this.DEFAULT_MAXVAL;\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return randomUniform(shape, this.minval, this.maxval, dtype);\n }\n\n getConfig(): serialization.ConfigDict {\n return {minval: this.minval, maxval: this.maxval, seed: this.seed};\n }\n}\nserialization.SerializationMap.register(RandomUniform);\n\nexport interface RandomNormalConfig {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\n/**\n * Initializer that generates random values initialized to a normal\n * distribution.\n */\nexport class RandomNormal extends Initializer {\n static className = 'RandomNormal';\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(config: RandomNormalConfig) {\n super();\n this.mean = config.mean || this.DEFAULT_MEAN;\n this.stddev = config.stddev || this.DEFAULT_STDDEV;\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `randomNormal does not support dType bool.`);\n }\n return K.randomNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.SerializationMap.register(RandomNormal);\n\nexport interface TruncatedNormalConfig {\n /** Mean of the random values to generate. */\n mean?: number;\n /** Standard deviation of the random values to generate. */\n stddev?: number;\n /** Used to seed the random generator. */\n seed?: number;\n}\n\n/**\n * Initializer that generates random values initialized to a truncated normal.\n * distribution.\n *\n * These values are similar to values from a `RandomNormal` except that values\n * more than two standard deviations from the mean are discarded and re-drawn.\n * This is the recommended initializer for neural network weights and filters.\n */\nexport class TruncatedNormal extends Initializer {\n static className = 'TruncatedNormal';\n\n readonly DEFAULT_MEAN = 0.;\n readonly DEFAULT_STDDEV = 0.05;\n private mean: number;\n private stddev: number;\n private seed: number;\n\n constructor(config: TruncatedNormalConfig) {\n super();\n this.mean = config.mean || this.DEFAULT_MEAN;\n this.stddev = config.stddev || this.DEFAULT_STDDEV;\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `truncatedNormal does not support dType bool.`);\n }\n return truncatedNormal(shape, this.mean, this.stddev, dtype, this.seed);\n }\n\n getConfig(): serialization.ConfigDict {\n return {mean: this.mean, stddev: this.stddev, seed: this.seed};\n }\n}\nserialization.SerializationMap.register(TruncatedNormal);\n\nexport interface IdentityConfig {\n /**\n * Multiplicative factor to apply to the identity matrix.\n */\n gain?: number;\n}\n\n/**\n * Initializer that generates the identity matrix.\n * Only use for square 2D matrices.\n */\nexport class Identity extends Initializer {\n static className = 'Identity';\n private gain: Scalar;\n constructor(config: IdentityConfig) {\n super();\n this.gain = config.gain != null ? scalar(config.gain) : getScalar(1.0);\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2 || shape[0] !== shape[1]) {\n throw new ValueError(\n 'Identity matrix initializer can only be used for' +\n ' 2D square matrices.');\n } else {\n return mul(this.gain, eye(shape[0]));\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {gain: this.gain.get()};\n }\n}\nserialization.SerializationMap.register(Identity);\n\n/**\n * Computes the number of input and output units for a weight shape.\n * @param shape Shape of weight.\n * @param dataFormat data format to use for convolution kernels.\n * Note that all kernels in Keras are standardized on the\n * CHANNEL_LAST ordering (even when inputs are set to CHANNEL_FIRST).\n * @return An length-2 array: fanIn, fanOut.\n */\nfunction computeFans(\n shape: Shape, dataFormat: DataFormat = 'channelsLast'): number[] {\n let fanIn: number;\n let fanOut: number;\n checkDataFormat(dataFormat);\n if (shape.length === 2) {\n fanIn = shape[0];\n fanOut = shape[1];\n } else if ([3, 4, 5].indexOf(shape.length) !== -1) {\n if (dataFormat === 'channelsFirst') {\n const receptiveFieldSize = arrayProd(shape, 2);\n fanIn = shape[1] * receptiveFieldSize;\n fanOut = shape[0] * receptiveFieldSize;\n } else if (dataFormat === 'channelsLast') {\n const receptiveFieldSize = arrayProd(shape, 0, shape.length - 2);\n fanIn = shape[shape.length - 2] * receptiveFieldSize;\n fanOut = shape[shape.length - 1] * receptiveFieldSize;\n }\n } else {\n const shapeProd = arrayProd(shape);\n fanIn = Math.sqrt(shapeProd);\n fanOut = Math.sqrt(shapeProd);\n }\n\n return [fanIn, fanOut];\n}\n\nexport interface VarianceScalingConfig {\n /** Scaling factor (positive float). */\n scale: number;\n\n /** Fanning mode for inputs and outputs. */\n mode: FanMode;\n\n /** Probabilistic distribution of the values. */\n distribution: Distribution;\n\n /** Random number generator seed. */\n seed?: number;\n}\n\n\n/**\n * Initializer capable of adapting its scale to the shape of weights.\n * With distribution=NORMAL, samples are drawn from a truncated normal\n * distribution centered on zero, with `stddev = sqrt(scale / n)` where n is:\n * - number of input units in the weight tensor, if mode = FAN_IN.\n * - number of output units, if mode = FAN_OUT.\n * - average of the numbers of input and output units, if mode = FAN_AVG.\n * With distribution=UNIFORM,\n * samples are drawn from a uniform distribution\n * within [-limit, limit], with `limit = sqrt(3 * scale / n)`.\n */\nexport class VarianceScaling extends Initializer {\n static className = 'VarianceScaling';\n private scale: number;\n private mode: FanMode;\n private distribution: Distribution;\n private seed: number;\n\n /**\n * Constructor of VarianceScaling.\n * @throws ValueError for invalid value in scale.\n */\n constructor(config: VarianceScalingConfig) {\n super();\n if (config.scale < 0.0) {\n throw new ValueError(\n `scale must be a positive float. Got: ${config.scale}`);\n }\n this.scale = config.scale == null ? 1.0 : config.scale;\n this.mode = config.mode;\n checkFanMode(this.mode);\n this.distribution = config.distribution;\n checkDistribution(this.distribution);\n this.seed = config.seed;\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n const fans = computeFans(shape);\n const fanIn = fans[0];\n const fanOut = fans[1];\n let scale = this.scale;\n if (this.mode === 'fanIn') {\n scale /= Math.max(1, fanIn);\n } else if (this.mode === 'fanOut') {\n scale /= Math.max(1, fanOut);\n } else {\n scale /= Math.max(1, (fanIn + fanOut) / 2);\n }\n\n if (this.distribution === 'normal') {\n const stddev = Math.sqrt(scale);\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `${this.getClassName()} does not support dType bool.`);\n }\n return truncatedNormal(shape, 0, stddev, dtype, this.seed);\n } else {\n const limit = Math.sqrt(3 * scale);\n return randomUniform(shape, -limit, limit, dtype);\n }\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n scale: this.scale,\n mode: this.mode,\n distribution: this.distribution,\n seed: this.seed\n };\n }\n}\nserialization.SerializationMap.register(VarianceScaling);\n\nexport interface SeedOnlyInitializerConfig {\n /** Random number generator seed. */\n seed?: number;\n}\n\n/**\n * Glorot uniform initializer, also called Xavier uniform initializer.\n * It draws samples from a uniform distribution within [-limit, limit]\n * where `limit` is `sqrt(6 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf.\n */\nexport class GlorotUniform extends VarianceScaling {\n /**\n * Constructor of GlorotUniform\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'uniform',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotUniform is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\n/**\n * Glorot normal initializer, also called Xavier normal initializer.\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / (fan_in + fan_out))`\n * where `fan_in` is the number of input units in the weight tensor\n * and `fan_out` is the number of output units in the weight tensor.\n *\n * Reference:\n * Glorot & Bengio, AISTATS 2010\n * http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf\n */\nexport class GlorotNormal extends VarianceScaling {\n /**\n * Constructor of GlorotNormal.\n * @param scale\n * @param mode\n * @param distribution\n * @param seed\n */\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 1.0,\n mode: 'fanAvg',\n distribution: 'normal',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, GlorotNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\n/**\n * He normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(2 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * Reference:\n * He et al., http://arxiv.org/abs/1502.01852\n */\nexport class HeNormal extends VarianceScaling {\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 2.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, HeNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\n/**\n * LeCun normal initializer.\n *\n * It draws samples from a truncated normal distribution centered on 0\n * with `stddev = sqrt(1 / fanIn)`\n * where `fanIn` is the number of input units in the weight tensor.\n *\n * References:\n * [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)\n * [Efficient Backprop](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)\n */\nexport class LeCunNormal extends VarianceScaling {\n constructor(config?: SeedOnlyInitializerConfig) {\n super({\n scale: 1.0,\n mode: 'fanIn',\n distribution: 'normal',\n seed: config == null ? null : config.seed\n });\n }\n\n getClassName(): string {\n // In Python Keras, LeCunNormal is not a class, but a helper method\n // that creates a VarianceScaling object. Use 'VarianceScaling' as\n // class name to be compatible with that.\n return VarianceScaling.className;\n }\n}\n\nexport interface OrthogonalConfig extends SeedOnlyInitializerConfig {\n /**\n * Multiplicative factor to apply to the orthogonal matrix. Defaults to 1.\n */\n gain?: number;\n}\n\n/**\n * Initializer that generates a random orthogonal matrix.\n *\n * Reference:\n * [Saxe et al., http://arxiv.org/abs/1312.6120](http://arxiv.org/abs/1312.6120)\n */\nexport class Orthogonal extends Initializer {\n static className = 'Orthogonal';\n readonly DEFAULT_GAIN = 1;\n protected readonly gain: number;\n protected readonly seed: number;\n\n constructor(config?: OrthogonalConfig) {\n super();\n this.gain = config.gain == null ? this.DEFAULT_GAIN : config.gain;\n this.seed = config.seed;\n\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Random seed is not implemented for Orthogonal Initializer yet.');\n }\n }\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n return tidy(() => {\n if (shape.length !== 2) {\n throw new NotImplementedError(\n 'The Orthogonal Initializer does not support non-2D shapes yet.');\n }\n if (shape[0] * shape[1] > 2000) {\n console.warn(\n `Orthogonal initializer is being called on a matrix with more ` +\n `than 2000 (${shape[0] * shape[1]}) elements: ` +\n `Slowness may result.`);\n }\n\n // TODO(cais): Add seed support.\n const normalizedShape =\n shape[0] > shape[1] ? [shape[1], shape[0]] : shape;\n const a = K.randomNormal(normalizedShape, 0, 1, 'float32') as Tensor2D;\n let q = linalg.gramSchmidt(a) as Tensor2D;\n if (shape[0] > shape[1]) {\n q = q.transpose();\n }\n return mul(getScalar(this.gain), q);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n gain: this.gain,\n seed: this.seed,\n };\n }\n}\nserialization.SerializationMap.register(Orthogonal);\n\n/** @docinline */\nexport type InitializerIdentifier = 'constant'|'glorotNormal'|'glorotUniform'|\n 'heNormal'|'identity'|'leCunNormal'|'ones'|'orthogonal'|'randomNormal'|\n 'randomUniform'|'truncatedNormal'|'varianceScaling'|'zeros'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding registry\n// symbols.\nexport const INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in InitializerIdentifier]: string} = {\n 'constant': 'Constant',\n 'glorotNormal': 'GlorotNormal',\n 'glorotUniform': 'GlorotUniform',\n 'heNormal': 'HeNormal',\n 'identity': 'Identity',\n 'leCunNormal': 'LeCunNormal',\n 'ones': 'Ones',\n 'orthogonal': 'Orthogonal',\n 'randomNormal': 'RandomNormal',\n 'randomUniform': 'RandomUniform',\n 'truncatedNormal': 'TruncatedNormal',\n 'varianceScaling': 'VarianceScaling',\n 'zeros': 'Zeros'\n };\n\nfunction deserializeInitializer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Initializer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'initializer');\n}\n\nexport function serializeInitializer(initializer: Initializer):\n serialization.ConfigDictValue {\n return serializeKerasObject(initializer);\n}\n\nexport function getInitializer(identifier: InitializerIdentifier|Initializer|\n serialization.ConfigDict): Initializer {\n if (typeof identifier === 'string') {\n const className = identifier in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n /* We have four 'helper' classes for common initializers that\n all get serialized as 'VarianceScaling' and shouldn't go through\n the deserializeInitializer pathway. */\n if (className === 'GlorotUniform') {\n return new GlorotUniform();\n } else if (className === 'GlorotNormal') {\n return new GlorotNormal();\n } else if (className === 'HeNormal') {\n return new HeNormal();\n } else if (className === 'LeCunNormal') {\n return new LeCunNormal();\n } else {\n const config = {className, config: {}};\n return deserializeInitializer(config);\n }\n } else if (identifier instanceof Initializer) {\n return identifier;\n } else {\n return deserializeInitializer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable-next-line:max-line-length\nimport {Constant, ConstantConfig, GlorotNormal, GlorotUniform, HeNormal, Identity, IdentityConfig, Initializer, LeCunNormal, Ones, Orthogonal, OrthogonalConfig, RandomNormal, RandomNormalConfig, RandomUniform, RandomUniformConfig, SeedOnlyInitializerConfig, TruncatedNormal, TruncatedNormalConfig, VarianceScaling, VarianceScalingConfig, Zeros} from './initializers';\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Zeros'\n * }\n */\nexport function zeros(): Zeros {\n return new Zeros();\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Ones'\n * }\n */\nexport function ones(): Initializer {\n return new Ones();\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Constant',\n * configParamIndices: [0]\n * }\n */\nexport function constant(config: ConstantConfig): Initializer {\n return new Constant(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'RandomUniform',\n * configParamIndices: [0]\n * }\n */\nexport function randomUniform(config: RandomUniformConfig): Initializer {\n return new RandomUniform(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'RandomNormal',\n * configParamIndices: [0]\n * }\n */\nexport function randomNormal(config: RandomNormalConfig): Initializer {\n return new RandomNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'TruncatedNormal',\n * configParamIndices: [0]\n * }\n */\nexport function truncatedNormal(config: TruncatedNormalConfig): Initializer {\n return new TruncatedNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Identity',\n * configParamIndices: [0]\n * }\n */\nexport function identity(config: IdentityConfig): Initializer {\n return new Identity(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'VarianceScaling',\n * configParamIndices: [0]\n * }\n */\nexport function varianceScaling(config: VarianceScalingConfig): Initializer {\n return new VarianceScaling(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'GlorotUniform',\n * configParamIndices: [0]\n * }\n */\nexport function glorotUniform(config: SeedOnlyInitializerConfig): Initializer {\n return new GlorotUniform(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'GlorotNormal',\n * configParamIndices: [0]\n * }\n */\nexport function glorotNormal(config: SeedOnlyInitializerConfig): Initializer {\n return new GlorotNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'HeNormal',\n * configParamIndices: [0]\n * }\n */\nexport function heNormal(config: SeedOnlyInitializerConfig): Initializer {\n return new HeNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'LeCunNormal',\n * configParamIndices: [0]\n * }\n */\nexport function leCunNormal(config: SeedOnlyInitializerConfig): Initializer {\n return new LeCunNormal(config);\n}\n\n/**\n * @doc {\n * heading: 'Initializers',\n * namespace: 'initializers',\n * useDocsFrom: 'Orthogonal',\n * configParamIndices: [0]\n * }\n */\nexport function orthogonal(config: OrthogonalConfig): Initializer {\n return new Orthogonal(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: utils/generic_utils.py */\n\n// tslint:disable:max-line-length\nimport {Tensor} from '@tensorflow/tfjs-core';\nimport {ValueError} from '../errors';\nimport {Shape} from '../types';\n// tslint:enable\n\n\n/**\n * Determine whether the input is an Array of Shapes.\n */\nexport function isArrayOfShapes(x: Shape|Shape[]): boolean {\n return Array.isArray(x) && Array.isArray(x[0]);\n}\n\n/**\n * Special case of normalizing shapes to lists.\n *\n * @param x A shape or list of shapes to normalize into a list of Shapes.\n * @return A list of Shapes.\n */\nexport function normalizeShapeList(x: Shape|Shape[]): Shape[] {\n if (x.length === 0) {\n return [];\n }\n if (!Array.isArray(x[0])) {\n return [x] as Shape[];\n }\n return x as Shape[];\n}\n\n/**\n * Helper function to obtain exactly one Tensor.\n * @param xs: A single `Tensor` or an `Array` of `Tensor`s.\n * @return A single `Tensor`. If `xs` is an `Array`, return the first one.\n * @throws ValueError: If `xs` is an `Array` and its length is not 1.\n */\nexport function getExactlyOneTensor(xs: Tensor|Tensor[]): Tensor {\n let x: Tensor;\n if (Array.isArray(xs)) {\n if (xs.length !== 1) {\n throw new ValueError(`Expected Tensor length to be 1; got ${xs.length}`);\n }\n x = xs[0];\n } else {\n x = xs as Tensor;\n }\n return x;\n}\n\n/**\n * Helper function to obtain exactly on instance of Shape.\n *\n * @param shapes Input single `Shape` or Array of `Shape`s.\n * @returns If input is a single `Shape`, return it unchanged. If the input is\n * an `Array` containing exactly one instance of `Shape`, return the instance.\n * Otherwise, throw a `ValueError`.\n * @throws ValueError: If input is an `Array` of `Shape`s, and its length is not\n * 1.\n */\nexport function getExactlyOneShape(shapes: Shape|Shape[]): Shape {\n if (Array.isArray(shapes) && Array.isArray(shapes[0])) {\n if (shapes.length === 1) {\n shapes = shapes as Shape[];\n return shapes[0];\n } else {\n throw new ValueError(`Expected exactly 1 Shape; got ${shapes.length}`);\n }\n } else {\n return shapes as Shape;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {LayerVariable} from '../variables';\n\n/**\n * Count the elements in an Array of LayerVariables.\n *\n * @param weights: The LayerVariables of which the constituent numbers are to\n * be counted.\n * @returns A count of the elements in all the LayerVariables\n */\nexport function countParamsInWeights(weights: LayerVariable[]): number {\n let count = 0;\n for (const weight of weights) {\n if (weight.shape.length === 0) {\n count += 1;\n } else {\n count += weight.shape.reduce((a, b) => a * b);\n }\n }\n return count;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, Tensor, variableGrads} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId} from './backend/state';\nimport {getScopedTensorName, getUniqueTensorName} from './common';\nimport {Constraint} from './constraints';\nimport {NotImplementedError} from './errors';\nimport {HasShape, Shape} from './types';\n\nconst DEFAULT_VARIABLE_NAME_PREFIX = 'Variable';\n\n/**\n * A `LayerVariable` is similar to a `Tensor` in that it has a dtype and shape,\n * but its value is mutable. The value is itself represented as a `Tensor`, and\n * can be read with the `read()` method and updated with the `write()` method.\n */\nexport class LayerVariable {\n readonly dtype: DataType;\n readonly shape: Shape;\n\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName: string;\n readonly trainable: boolean;\n\n protected readonly val: tfc.Variable;\n readonly constraint: Constraint;\n /**\n * Construct Variable from a Tensor.\n *\n * If not explicitly named, the Variable will be given a name with the\n * prefix 'Variable'. Variable names are unique. In the case of name\n * collision, suffixies '_' will be added to the name.\n *\n * @param val Initial value of the Variable.\n * @param name Name of the variable. If `null` or `undefined` is provided, it\n * will default a name with the prefix 'Variable'.\n * @param constraint Optional, projection function to be applied to the\n * variable after optimize updates\n * @throws ValueError if `name` is `null` or `undefined`.\n */\n constructor(\n val: Tensor, dtype: DataType = 'float32',\n name = DEFAULT_VARIABLE_NAME_PREFIX, trainable = true,\n constraint: Constraint = null) {\n this.dtype = dtype == null ? 'float32' : dtype;\n this.shape = val.shape;\n this.id = getNextUniqueTensorId();\n\n name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name;\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n\n this.trainable = trainable;\n this.constraint = constraint;\n\n this.val = tfc.variable(val, this.trainable, this.name, this.dtype);\n }\n\n /**\n * Get a snapshot of the Variable's value.\n *\n * The returned value is a snapshot of the Variable's value at the time of\n * the invocation. Future mutations in the value of the tensor will only\n * be reflected by future calls to this method.\n */\n read(): Tensor {\n return this.val;\n }\n\n /**\n * Update the value of the Variable.\n *\n * @param newVal: The new value to update to. Must be consistent with the\n * dtype and shape of the Variable.\n * @return This Variable.\n */\n write(newVal: Tensor) {\n // TODO(cais): Once TF.js Core supports Tensor.dtype, check dtype match.\n checkShapesMatch(this.val, newVal);\n this.val.assign(newVal);\n if (this.constraint != null) {\n this.val.assign(this.constraint.apply(this.val));\n }\n return this;\n }\n}\n\nfunction checkShapesMatch(x: HasShape, y: HasShape): void {\n if (x.shape.toString() !== y.shape.toString()) {\n throw new Error(\n 'Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' +\n JSON.stringify(y.shape));\n }\n}\n\n/**\n * Create a Variable.\n * @param x The initial value of the `Variable`.\n * @param dtype optional, the type of the variable.\n * @param name optional, the name of the variable, default provided by\n * Variable.\n * @param constraint optional, a constraint to be applied after every update.\n * @return The newly instantiated `Variable`.\n */\nexport function variable(\n x: Tensor, dtype?: DataType, name?: string,\n constraint?: Constraint): LayerVariable {\n return new LayerVariable(x, dtype, name, true, constraint);\n}\n\n/**\n * Instantiates an all-zeros Variable and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-zero Variable.\n */\nexport function zerosVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n return new LayerVariable(tfc.zeros(shape), dtype, name);\n}\n\n/**\n * Instantiates an all-zeros tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function zerosLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.zerosLike(x), dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor and returns it.\n *\n * @param shape Shape of the tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return An all-ones Variable.\n */\nexport function onesVariable(\n shape: Shape, dtype?: DataType, name?: string): LayerVariable {\n // TODO(cais): Implement logic for dtype.\n const allocated = tfc.ones(shape);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiates an all-ones tensor of the same shape as another tensor.\n *\n * @param x The other tensor.\n * @param dtype DType of the tensor.\n * @param name Name of the tensor.\n * @return A newly instantiated Variable.\n */\nexport function onesLike(\n x: Tensor, dtype?: DataType, name?: string): LayerVariable {\n const allocated = tfc.onesLike(x);\n return new LayerVariable(allocated, dtype, name);\n}\n\n/**\n * Instantiate an identity matrix and returns it, as a Variable\n *\n * @param size Number of rows/columns.\n * @param dtype Data type of returned Variable.\n * @param name Name of returned Variable.\n * @return A Variable, an identity matrix.\n */\nexport function eyeVariable(\n size: number, dtype?: DataType, name?: string): LayerVariable {\n return new LayerVariable(tfc.eye(size), dtype, name);\n}\n\n/**\n * Get a Variable with uniform distribution of values.\n * @param shape Shape of the tensor.\n * @param minval Lower bound of the uniform distribution.\n * @param maxval Upper bound of the uniform distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The uniform-random Variable.\n */\nexport function randomUniformVariable(\n shape: Shape, minval: number, maxval: number, dtype?: DataType,\n seed?: number, name = 'randomUniform'): LayerVariable {\n return new LayerVariable(\n tfc.randomUniform(shape, minval, maxval, dtype), dtype, name);\n}\n\n/**\n * Get a Variable with truncated-normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function truncatedNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'truncatedNormal'): LayerVariable {\n // TODO(cais): Implement logic for dtype and seed once they are supported\n // by deeplearn.js.\n if (dtype === 'bool') {\n throw new NotImplementedError(`randomNormal does not support dType bool.`);\n }\n return new LayerVariable(\n tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n/**\n * Get a Variable with normal distribution of values.\n * @param shape Shape of the tensor.\n * @param mean mean value of the normal distribution.\n * @param stddev standard deviation of the normal distribution.\n * @param dtype\n * @param seed\n * @param name Optional name.\n * @return The truncated-normal-random Variable.\n */\nexport function randomNormalVariable(\n shape: Shape, mean = 0.0, stddev = 1.0, dtype?: DataType, seed?: number,\n name = 'randomNormal'): LayerVariable {\n if (dtype === 'bool') {\n throw new NotImplementedError(\n `randomNormalVariable does not support dType bool.`);\n }\n return new LayerVariable(\n tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name);\n}\n\n/**\n * Update the value of a Variable.\n * @param x The Variable to be updated.\n * @param xNew The new value to update to.\n * @return The Variable updated.\n */\nexport function update(x: LayerVariable, xNew: Tensor): LayerVariable {\n return x.write(xNew);\n}\n\n/**\n * Update the value of a Variable by adding an increment.\n * @param x The Variable to be updated.\n * @param increment The incrment to add to `x`.\n * @return The Variable updated.\n */\nexport function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable {\n return x.write(tfc.add(x.read(), increment));\n}\n\n/**\n * Update the value of a Variable by subtracting a decrement.\n * @param x The Variable to be updated.\n * @param decrement The decrement to subtract from `x`.\n * @return The Variable updated.\n */\nexport function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable {\n return x.write(tfc.sub(x.read(), decrement));\n}\n\n/**\n * Get the values of an array of Variables.\n *\n * @param tensors An `Array` of `Variable`s to get the values of.\n * @return The values of the inputs, as an `Array` of `Tensor`s.\n */\nexport function batchGetValue(xs: LayerVariable[]): Tensor[] {\n return xs.map(x => x.read());\n}\n\n/**\n * Update the value of multiple Variables at once.\n *\n * @param variablesAndValues An `Array`, each element is of type\n * [Variable, Tensor]. The first item is the\n * `Variable` of which the value is to be updated. The second item\n * carries the new value.\n */\nexport function batchSetValue(\n variablesAndValues: Array<[LayerVariable, Tensor]>): void {\n variablesAndValues.map((variableAndValue) => {\n const variable: LayerVariable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}\n\n/**\n * Returns the gradients of `variables` w.r.t. the return value of `lossFn`.\n * @param lossFn A function which returns a Scalar to be used as the function\n * value (i.e., numerator) for differentiation.\n * @param variables List of variables to be used as the independent variables\n * (i.e., denominator) for differentiation.\n * @returns An Array of gradients tensors.\n */\nexport function gradients(\n lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[] {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList =\n variables.map(variable => variable.read() as tfc.Variable);\n const valudAndGrads = variableGrads(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\n// tslint:disable:max-line-length\nimport {DataType, Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getNextUniqueTensorId, getUid} from '../backend/state';\nimport {getScopedTensorName, getUniqueTensorName, nameScope} from '../common';\nimport {Constraint} from '../constraints';\nimport {AttributeError, NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {Initializer} from '../initializers';\nimport {Regularizer} from '../regularizers';\nimport {Kwargs, RegularizerFn, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as types_utils from '../utils/types_utils';\nimport * as variable_utils from '../utils/variable_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n// tslint:enable:max-line-length\n\n// TODO(michaelterry): This is a stub until it's defined.\nexport type Op = (x: LayerVariable) => LayerVariable;\n\n/**\n * Constructor arguments for InputSpec.\n */\nexport interface InputSpecConfig {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n}\n\n/**\n * Specifies the ndim, dtype and shape of every input to a layer.\n *\n * Every layer should expose (if appropriate) an `inputSpec` attribute:\n * a list of instances of InputSpec (one per input tensor).\n *\n * A null entry in a shape is compatible with any dimension,\n * a null shape is compatible with any shape.\n */\nexport class InputSpec {\n /** Expected datatype of the input. */\n dtype?: DataType;\n /** Expected shape of the input (may include null for unchecked axes). */\n shape?: Shape;\n /** Expected rank of the input. */\n ndim?: number;\n /** Maximum rank of the input. */\n maxNDim?: number;\n /** Minimum rank of the input. */\n minNDim?: number;\n /** Dictionary mapping integer axes to a specific dimension value. */\n axes?: {[axis: number]: number};\n\n constructor(config: InputSpecConfig) {\n this.dtype = config.dtype;\n this.shape = config.shape;\n /*\n TODO(michaelterry): Could throw error if ndim and shape are both defined\n (then backport).\n */\n if (config.shape != null) {\n this.ndim = config.shape.length;\n } else {\n this.ndim = config.ndim;\n }\n this.maxNDim = config.maxNDim;\n this.minNDim = config.minNDim;\n this.axes = config.axes || {};\n }\n}\n\n/**\n * `SymbolicTensor` is a placeholder for a Tensor without any concrete value.\n *\n * They are most often encountered when building a graph of `Layer`s for a\n * a `Model` and the input data's shape, but not values are known.\n */\n/** @doc {heading: 'Models', 'subheading': 'Classes'} */\nexport class SymbolicTensor {\n /* A unique ID for the tensor to be able to differentiate tensors. */\n readonly id: number;\n // The fully scoped name of this Variable, including a unique suffix if needed\n readonly name: string;\n // The originally requested fully scoped name of this Variable, not including\n // any unique suffix. This may be needed when restoring weights because this\n // original name is used as a key.\n readonly originalName?: string;\n /**\n * Rank/dimensionality of the tensor.\n */\n readonly rank: number;\n /**\n * Replacement for _keras_history.\n */\n nodeIndex: number;\n /**\n * Replacement for _keras_history.\n */\n tensorIndex: number;\n\n /**\n *\n * @param dtype\n * @param shape\n * @param sourceLayer The Layer that produced this symbolic tensor.\n * @param inputs The inputs passed to sourceLayer's __call__() method.\n * @param nodeIndex\n * @param tensorIndex\n * @param callArgs The keyword arguments passed to the __call__() method.\n * @param name\n * @param outputTensorIndex The index of this tensor in the list of outputs\n * returned by apply().\n */\n constructor(\n readonly dtype: DataType, readonly shape: Shape,\n public sourceLayer: Layer, readonly inputs: SymbolicTensor[],\n readonly callArgs: Kwargs, name?: string,\n readonly outputTensorIndex?: number) {\n this.id = getNextUniqueTensorId();\n if (name != null) {\n this.originalName = getScopedTensorName(name);\n this.name = getUniqueTensorName(this.originalName);\n }\n this.rank = shape.length;\n }\n}\n\n/**\n * Constructor arguments for Node.\n */\nexport interface NodeConfig {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`.\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n}\n\nlet _nextNodeID = 0;\n\n/**\n * A `Node` describes the connectivity between two layers.\n *\n * Each time a layer is connected to some new input,\n * a node is added to `layer.inboundNodes`.\n *\n * Each time the output of a layer is used by another layer,\n * a node is added to `layer.outboundNodes`.\n *\n * `nodeIndices` and `tensorIndices` are basically fine-grained coordinates\n * describing the origin of the `inputTensors`, verifying the following:\n *\n * `inputTensors[i] ==\n * inboundLayers[i].inboundNodes[nodeIndices[i]].outputTensors[\n * tensorIndices[i]]`\n *\n * A node from layer A to layer B is added to:\n * A.outboundNodes\n * B.inboundNodes\n */\nexport class Node {\n /**\n * The layer that takes `inputTensors` and turns them into `outputTensors`\n * (the node gets created when the `call` method of the layer is called).\n */\n outboundLayer: Layer;\n /**\n * A list of layers, the same length as `inputTensors`, the layers from where\n * `inputTensors` originate.\n */\n inboundLayers: Layer[];\n /**\n * A list of integers, the same length as `inboundLayers`. `nodeIndices[i]` is\n * the origin node of `inputTensors[i]` (necessary since each inbound layer\n * might have several nodes, e.g. if the layer is being shared with a\n * different data stream).\n */\n nodeIndices: number[];\n /**\n * A list of integers, the same length as `inboundLayers`. `tensorIndices[i]`\n * is the index of `inputTensors[i]` within the output of the inbound layer\n * (necessary since each inbound layer might have multiple tensor outputs,\n * with each one being independently manipulable).\n */\n tensorIndices: number[];\n /** List of input tensors. */\n inputTensors: SymbolicTensor[];\n /** List of output tensors. */\n outputTensors: SymbolicTensor[];\n /** List of input masks (a mask can be a tensor, or null). */\n inputMasks: Tensor[];\n /** List of output masks (a mask can be a tensor, or null). */\n outputMasks: Tensor[];\n /** List of input shape tuples. */\n inputShapes: Shape|Shape[];\n /** List of output shape tuples. */\n outputShapes: Shape|Shape[];\n\n readonly id: number;\n\n constructor(\n config: NodeConfig,\n // TODO(michaelterry): Define actual type for this.\n public callArgs?: Kwargs) {\n this.id = _nextNodeID++;\n /*\n Layer instance (NOT a list).\n this is the layer that takes a list of input tensors\n and turns them into a list of output tensors.\n the current node will be added to\n the inboundNodes of outboundLayer.\n */\n this.outboundLayer = config.outboundLayer;\n\n /*\n The following 3 properties describe where\n the input tensors come from: which layers,\n and for each layer, which node and which\n tensor output of each node.\n */\n\n // List of layer instances.\n this.inboundLayers = config.inboundLayers;\n // List of integers, 1:1 mapping with inboundLayers.\n this.nodeIndices = config.nodeIndices;\n // List of integers, 1:1 mapping with inboundLayers.\n this.tensorIndices = config.tensorIndices;\n\n /*\n Following 2 properties:\n tensor inputs and outputs of outboundLayer.\n */\n\n // List of tensors. 1:1 mapping with inboundLayers.\n this.inputTensors = config.inputTensors;\n // List of tensors, created by outboundLayer.call().\n this.outputTensors = config.outputTensors;\n\n /*\n Following 2 properties: input and output masks.\n List of tensors, 1:1 mapping with inputTensor.\n */\n this.inputMasks = config.inputMasks;\n // List of tensors, created by outboundLayer.computeMask().\n this.outputMasks = config.outputMasks;\n\n // Following 2 properties: input and output shapes.\n\n // List of shape tuples, shapes of inputTensors.\n this.inputShapes = config.inputShapes;\n // List of shape tuples, shapes of outputTensors.\n this.outputShapes = config.outputShapes;\n\n // Add nodes to all layers involved.\n for (const layer of config.inboundLayers) {\n if (layer != null) {\n layer.outboundNodes.push(this);\n }\n }\n config.outboundLayer.inboundNodes.push(this);\n }\n\n getConfig(): serialization.ConfigDict {\n const inboundNames: string[] = [];\n for (const layer of this.inboundLayers) {\n if (layer != null) {\n inboundNames.push(layer.name);\n } else {\n inboundNames.push(null);\n }\n }\n return {\n outboundLayer: this.outboundLayer ? this.outboundLayer.name : null,\n inboundLayers: inboundNames,\n nodeIndices: this.nodeIndices,\n tensorIndices: this.tensorIndices\n };\n }\n}\n\n/** Constructor arguments for Layer. */\nexport interface LayerConfig {\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n inputShape?: Shape;\n /**\n * If defined, will be used to create an input layer to insert before this\n * layer. If both `inputShape` and `batchInputShape` are defined,\n * `batchInputShape` will be used. This argument is only applicable to input\n * layers (the first layer of a model).\n */\n batchInputShape?: Shape;\n /**\n * If `inputShape` is specified and `batchInputShape` is *not* specifiedd,\n * `batchSize` is used to construct the `batchInputShape`: `[batchSize,\n * ...inputShape]`\n */\n batchSize?: number;\n /**\n * The data-type for this layer. Defaults to 'float32'.\n * This argument is only applicable to input layers (the first layer of a\n * model).\n */\n dtype?: DataType;\n /** Name for this layer. */\n name?: string;\n /** Whether this layer is trainable. Defaults to true. */\n trainable?: boolean;\n /** Whether the weights of this layer are updatable by `fit`. */\n updatable?: boolean;\n /**\n * Initial weight values of the layer.\n */\n weights?: Tensor[];\n /** Legacy support. Do not use for new code. */\n inputDType?: DataType;\n}\n\n// If necessary, add `output` arguments to the CallHook function.\n// This is currently used for testing only, but may be used for debugger-related\n// purposes in the future.\nexport type CallHook = (inputs: Tensor|Tensor[], kwargs: Kwargs) => void;\n\nlet _nextLayerID = 0;\n\n/**\n * A layer is a grouping of operations and weights that can be composed to\n * create a `Model`.\n *\n * Layers are constructed by using the functions under the\n * [tf.layers](#Layers-Basic) namespace.\n */\n/** @doc {heading: 'Layers', subheading: 'Classes', namespace: 'layers'} */\nexport abstract class Layer extends serialization.Serializable {\n /** Name for this layer. Must be unique within a model. */\n name: string;\n /**\n * List of InputSpec class instances.\n *\n * Each entry describes one required input:\n * - ndim\n * - dtype\n * A layer with `n` input tensors must have an `inputSpec` of length `n`.\n */\n inputSpec: InputSpec[];\n supportsMasking: boolean;\n /** Whether the layer weights will be updated during training. */\n trainable: boolean;\n updatable: boolean;\n batchInputShape: Shape;\n dtype: DataType;\n initialWeights: Tensor[];\n\n inboundNodes: Node[];\n outboundNodes: Node[];\n\n activityRegularizer: Regularizer;\n\n protected _trainableWeights: LayerVariable[];\n private _nonTrainableWeights: LayerVariable[];\n private _losses: RegularizerFn[];\n // TODO(cais): _updates is currently unused.\n private _updates: Tensor[];\n private _built: boolean;\n private _callHook: CallHook = null;\n\n private _addedWeightNames: string[] = [];\n\n readonly id: number;\n\n // Porting Notes: PyKeras does not have this property in this base Layer\n // class. Instead lets Layer subclass set it dynamically and checks the\n // value with `hasattr`. In tfjs-layers, we let this be a member of this\n // base class.\n protected _stateful = false;\n\n constructor(config: LayerConfig) {\n super();\n this.id = _nextLayerID++;\n\n this.activityRegularizer = null;\n\n this.inputSpec = null;\n this.supportsMasking = false;\n\n // These properties will be set upon call of this.build()\n this._trainableWeights = [];\n this._nonTrainableWeights = [];\n this._losses = [];\n this._updates = [];\n this._built = false;\n\n /*\n These lists will be filled via successive calls\n to this.addInboundNode().\n */\n this.inboundNodes = [];\n this.outboundNodes = [];\n\n let name = config.name;\n if (!name) {\n const prefix = this.getClassName();\n name = generic_utils.toSnakeCase(prefix) + '_' + getUid(prefix);\n }\n this.name = name;\n\n this.trainable = config.trainable == null ? true : config.trainable;\n this.updatable = config.updatable == null ? true : config.updatable;\n\n if (config.inputShape != null || config.batchInputShape != null) {\n /*\n In this case we will later create an input layer\n to insert before the current layer\n */\n let batchInputShape: Shape;\n if (config.batchInputShape != null) {\n batchInputShape = config.batchInputShape;\n } else if (config.inputShape != null) {\n let batchSize: number = null;\n if (config.batchSize != null) {\n batchSize = config.batchSize;\n }\n batchInputShape = [batchSize].concat(config.inputShape);\n }\n this.batchInputShape = batchInputShape;\n\n // Set dtype.\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = config.inputDType;\n }\n if (dtype == null) {\n dtype = 'float32';\n }\n this.dtype = dtype;\n }\n\n if (config.weights != null) {\n this.initialWeights = config.weights;\n } else {\n this.initialWeights = null;\n }\n }\n\n /**\n * Converts a layer and its index to a unique (immutable type) name.\n * This function is used internally with `this.containerNodes`.\n * @param layer The layer.\n * @param nodeIndex The layer's position (e.g. via enumerate) in a list of\n * nodes.\n *\n * @returns The unique name.\n */\n protected static nodeKey(layer: Layer, nodeIndex: number) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }\n\n /**\n * Returns this.inboundNode at index nodeIndex.\n *\n * Porting note: This is a replacement for _get_node_attribute_at_index()\n * @param nodeIndex\n * @param attrName The name of the attribute related to request for this node.\n */\n private getNodeAtIndex(nodeIndex: number, attrName: string): Node {\n if (this.inboundNodes.length === 0) {\n throw new RuntimeError(\n 'The layer has never been called ' +\n `and thus has no defined ${attrName}.`);\n }\n if (this.inboundNodes.length <= nodeIndex) {\n throw new ValueError(\n `Asked to get ${attrName} at node ${nodeIndex}, ` +\n `but the layer has only ${this.inboundNodes.length} inbound nodes.`);\n }\n return this.inboundNodes[nodeIndex];\n }\n\n /**\n * Retrieves the input tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple inputs).\n */\n getInputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer at a given node.\n *\n * @param nodeIndex Integer, index of the node from which to retrieve the\n * attribute. E.g. `nodeIndex=0` will correspond to the first time the layer\n * was called.\n *\n * @return A tensor (or list of tensors if the layer has multiple outputs).\n */\n getOutputAt(nodeIndex: number): SymbolicTensor|SymbolicTensor[] {\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(nodeIndex, 'output').outputTensors);\n }\n\n // Properties\n\n /**\n * Retrieves the input tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Input tensor or list of input tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get input(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer input\" ' +\n 'is ill-defined. ' +\n 'Use `getInputAt(nodeIndex)` instead.');\n } else if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' is not connected, no input to return.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'input').inputTensors);\n }\n\n /**\n * Retrieves the output tensor(s) of a layer.\n *\n * Only applicable if the layer has exactly one inbound node,\n * i.e. if it is connected to one incoming layer.\n *\n * @return Output tensor or list of output tensors.\n *\n * @exception AttributeError if the layer is connected to more than one\n * incoming layers.\n */\n get output(): SymbolicTensor|SymbolicTensor[] {\n if (this.inboundNodes.length === 0) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has no inbound nodes.');\n }\n if (this.inboundNodes.length > 1) {\n throw new AttributeError(\n `Layer ${this.name}` +\n ' has multiple inbound nodes, ' +\n 'hence the notion of \"layer output\" ' +\n 'is ill-defined. ' +\n 'Use `getOutputAt(nodeIndex)` instead.');\n }\n return generic_utils.singletonOrArray(\n this.getNodeAtIndex(0, 'output').outputTensors);\n }\n\n get losses(): RegularizerFn[] {\n return this._losses;\n }\n\n /**\n * Retrieves the Layer's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Layer.loss in PyKeras.\n // In PyKeras, Layer.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return this.losses.map(lossFn => lossFn());\n }\n\n get updates(): Tensor[] {\n return this._updates;\n }\n\n get built(): boolean {\n return this._built;\n }\n\n set built(built: boolean) {\n this._built = built;\n }\n\n get trainableWeights(): LayerVariable[] {\n if (this.trainable) {\n return this._trainableWeights;\n } else {\n return [];\n }\n }\n\n set trainableWeights(weights: LayerVariable[]) {\n this._trainableWeights = weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return this._trainableWeights.concat(this._nonTrainableWeights);\n } else {\n return this._nonTrainableWeights;\n }\n }\n\n set nonTrainableWeights(weights: LayerVariable[]) {\n this._nonTrainableWeights = weights;\n }\n\n /**\n * The concatenation of the lists trainableWeights and nonTrainableWeights\n * (in this order).\n */\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n get stateful(): boolean {\n return this._stateful;\n }\n\n /**\n * Checks compatibility between the layer and provided inputs.\n *\n * This checks that the tensor(s) `input`\n * verify the input assumptions of the layer\n * (if any). If not, exceptions are raised.\n *\n * @param inputs Input tensor or list of input tensors.\n *\n * @exception ValueError in case of mismatch between\n * the provided inputs and the expectations of the layer.\n */\n protected assertInputCompatibility(inputs: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): void {\n inputs = generic_utils.toList(inputs);\n if (this.inputSpec == null || this.inputSpec.length === 0) {\n return;\n }\n const inputSpec = generic_utils.toList(this.inputSpec);\n if (inputs.length !== inputSpec.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${inputSpec.length} inputs, ` +\n `but it received ${inputs.length} input tensors. ` +\n `Input received: ${inputs}`);\n }\n for (let inputIndex = 0; inputIndex < inputs.length; inputIndex++) {\n const x = inputs[inputIndex];\n const spec: InputSpec = inputSpec[inputIndex];\n if (spec == null) {\n continue;\n }\n\n // Check ndim.\n const ndim = x.rank;\n if (spec.ndim != null) {\n if (ndim !== spec.ndim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}: ` +\n `expected ndim=${spec.ndim}, found ndim=${ndim}`);\n }\n }\n if (spec.maxNDim != null) {\n if (ndim > spec.maxNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected max_ndim=${spec.maxNDim}, found ndim=${ndim}`);\n }\n }\n if (spec.minNDim != null) {\n if (ndim < spec.minNDim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name}` +\n `: expected min_ndim=${spec.minNDim}, found ndim=${ndim}.`);\n }\n }\n\n // Check dtype.\n if (spec.dtype != null) {\n if (x.dtype !== spec.dtype) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ${this.name} ` +\n `: expected dtype=${spec.dtype}, found dtype=${x.dtype}.`);\n }\n }\n\n // Check specific shape axes.\n if (spec.axes) {\n const xShape = x.shape;\n for (const key in spec.axes) {\n const axis = Number(key);\n const value = spec.axes[key];\n // Perform Python-style slicing in case axis < 0;\n // TODO(cais): Use https://github.com/alvivi/typescript-underscore to\n // ensure type safety through Underscore calls.\n const xShapeAtAxis =\n axis >= 0 ? xShape[axis] : xShape[xShape.length + axis];\n if (value != null && [value, null].indexOf(xShapeAtAxis) === -1) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected axis ${axis} of input shape to ` +\n `have value ${value} but got shape ${xShape}.`);\n }\n }\n }\n\n // Check shape.\n if (spec.shape != null) {\n for (let i = 0; i < spec.shape.length; ++i) {\n const specDim = spec.shape[i];\n const dim = x.shape[i];\n if (specDim != null && dim != null) {\n if (specDim !== dim) {\n throw new ValueError(\n `Input ${inputIndex} is incompatible with layer ` +\n `${this.name}: expected shape=${spec.shape}, ` +\n 'found shape=${xShape}.');\n }\n }\n }\n }\n }\n }\n\n /**\n * This is where the layer's logic lives.\n *\n * @param inputs Input tensor, or list/tuple of input tensors.\n * @param kwargs Additional keyword arguments.\n *\n * @return A tensor or list/tuple of tensors.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return inputs;\n }\n\n protected invokeCallHook(inputs: Tensor|Tensor[], kwargs: Kwargs) {\n if (this._callHook != null) {\n this._callHook(inputs, kwargs);\n }\n }\n\n /**\n * Set call hook.\n * This is currently used for testing only.\n * @param callHook\n */\n setCallHook(callHook: CallHook) {\n this._callHook = callHook;\n }\n\n /**\n * Clear call hook.\n * This is currently used for testing only.\n */\n clearCallHook() {\n this._callHook = null;\n }\n\n /**\n * Builds or executes a `Layer's logic.\n *\n * When called with `Tensor`(s), execute the `Layer`s computation and\n * return Tensor(s). For example:\n *\n * ```js\n * const denseLayer = tf.layers.dense({\n * units: 1,\n * kernelInitializer: 'zeros',\n * useBias: false\n * });\n *\n * // Invoke the layer's apply() method with a `Tensor` (with concrete\n * // numeric values).\n * const input = tf.ones([2, 2]);\n * const output = denseLayer.apply(input);\n *\n * // The output's value is expected to be [[0], [0]], due to the fact that\n * // the dense layer has a kernel initialized to all-zeros and does not have\n * // a bias.\n * output.print();\n * ```\n *\n * When called with `SymbolicTensor`(s), this will prepare the layer for\n * future execution. This entails internal book-keeping on shapes of\n * expected Tensors, wiring layers together, and initializing weights.\n *\n * Calling `apply` with `SymbolicTensor`s are typically used during the\n * building of non-`Sequential` models. For example:\n *\n * ```js\n * const flattenLayer = tf.layers.flatten();\n * const denseLayer = tf.layers.dense({units: 1});\n *\n * // Use tf.layers.input() to obtain a SymbolicTensor as input to apply().\n * const input = tf.input({shape: [2, 2]});\n * const output1 = flattenLayer.apply(input);\n *\n * // output1.shape is [null, 4]. The first dimension is the undetermined\n * // batch size. The second dimension comes from flattening the [2, 2]\n * // shape.\n * console.log(JSON.stringify(output1.shape));\n *\n * // The output SymbolicTensor of the flatten layer can be used to call\n * // the apply() of the dense layer:\n * const output2 = denseLayer.apply(output1);\n *\n * // output2.shape is [null, 1]. The first dimension is the undetermined\n * // batch size. The second dimension matches the number of units of the\n * // dense layer.\n * console.log(JSON.stringify(output2.shape));\n *\n * // The input and output and be used to construct a model that consists\n * // of the flatten and dense layers.\n * const model = tf.model({inputs: input, outputs: output2});\n * ```\n *\n * @param inputs a `Tensor` or `SymbolicTensor` or an Array of them.\n * @param kwargs Additional keyword arguments to be passed to `call()`.\n *\n * @return Output of the layer's `call` method.\n *\n * @exception ValueError error in case the layer is missing shape information\n * for its `build` call.\n */\n // Porting Note: This is a replacement for __call__() in Python.\n /** @doc {heading: 'Models', 'subheading': 'Classes'} */\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n kwargs = kwargs || {};\n\n // Ensure inputs are all the same type.\n const inputsList = generic_utils.toList(inputs);\n\n let allAreSymbolic = true;\n for (const input of inputsList) {\n if (!(input instanceof SymbolicTensor)) {\n allAreSymbolic = false;\n break;\n }\n }\n let noneAreSymbolic = true;\n for (const input of inputsList) {\n if (input instanceof SymbolicTensor) {\n noneAreSymbolic = false;\n break;\n }\n }\n\n if (allAreSymbolic === noneAreSymbolic) {\n throw new ValueError(\n 'Arguments to apply() must be all ' +\n 'SymbolicTensors or all Tensors');\n }\n\n // TODO(michaelterry): nameScope() may not be necessary.\n return nameScope(this.name, () => {\n // Handle laying building (weight creating, input spec locking).\n if (!this.built) {\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec specified in the layer constructor.\n */\n this.assertInputCompatibility(inputs);\n\n // Collect input shapes to build layer.\n const inputShapes: Shape[] = [];\n for (const xElem of generic_utils.toList(inputs)) {\n inputShapes.push(xElem.shape);\n }\n this.build(generic_utils.singletonOrArray(inputShapes));\n this.built = true;\n\n // Load weights that were specified at layer instantiation.\n if (this.initialWeights) {\n this.setWeights(this.initialWeights);\n }\n }\n\n /*\n Throw exceptions in case the input is not compatible\n with the inputSpec set at build time.\n */\n this.assertInputCompatibility(inputs);\n\n // Handle mask propagation.\n // TODO(michaelterry): Mask propagation not currently implemented.\n\n // Actually call the layer, collecting output(s), mask(s), and shape(s).\n if (noneAreSymbolic) {\n let output = this.call(inputs as Tensor | Tensor[], kwargs);\n // TODO(michaelterry): Compute the outputMask\n\n // If the layer returns tensors from its inputs, unmodified,\n // we copy them to avoid loss of tensor metadata.\n const outputList: Tensor[] = generic_utils.toList(output);\n const outputListCopy: Tensor[] = [];\n // TODO(michaelterry): This copying may not be necessary given our eager\n // backend.\n for (let x of outputList) {\n if (inputsList.indexOf(x) !== -1) {\n x = x.clone();\n }\n outputListCopy.push(x);\n }\n output = generic_utils.singletonOrArray(outputListCopy);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n // TODO(michaelterry): Call addInboundNode()?\n return output;\n } else {\n const inputShape = collectInputShape(inputs);\n const outputShape = this.computeOutputShape(inputShape);\n let output: SymbolicTensor|SymbolicTensor[];\n const outputDType = guessOutputDType(inputs);\n this.warnOnIncompatibleInputShape(\n Array.isArray(inputs) ? inputShape[0] as Shape :\n inputShape as Shape);\n\n if (outputShape != null && outputShape.length > 0 &&\n Array.isArray(outputShape[0])) {\n // We have multiple output shapes. Create multiple output tensors.\n output = (outputShape as Shape[])\n .map(\n (shape, index) => new SymbolicTensor(\n outputDType, shape, this,\n generic_utils.toList(inputs), kwargs, this.name,\n index));\n } else {\n output = new SymbolicTensor(\n outputDType, outputShape as Shape, this,\n generic_utils.toList(inputs), kwargs, this.name);\n }\n\n /*\n Add an inbound node to the layer, so that it keeps track\n of the call and of all new variables created during the call.\n This also updates the layer history of the output tensor(s).\n If the input tensor(s) had no previous history,\n this does nothing.\n */\n this.addInboundNode(\n inputs as SymbolicTensor | SymbolicTensor[], output, null, null,\n inputShape, outputShape, kwargs);\n\n if (this.activityRegularizer != null) {\n throw new NotImplementedError(\n 'Layer invocation in the presence of activity ' +\n 'regularizer(s) is not supported yet.');\n }\n\n return output;\n }\n });\n }\n\n /**\n * Check compatibility between input shape and this layer's batchInputShape.\n *\n * Print warning if any incompatibility is found.\n *\n * @param inputShape Input shape to be checked.\n */\n protected warnOnIncompatibleInputShape(inputShape: Shape) {\n if (this.batchInputShape == null) {\n return;\n } else if (inputShape.length !== this.batchInputShape.length) {\n console.warn(\n `The rank of the input tensor provided (shape: ` +\n `${JSON.stringify(inputShape)}) does not match that of the ` +\n `batchInputShape (${JSON.stringify(this.batchInputShape)}) ` +\n `of the layer ${this.name}`);\n } else {\n let dimMismatch = false;\n this.batchInputShape.forEach((dimension, i) => {\n if (dimension != null && inputShape[i] != null &&\n inputShape[i] !== dimension) {\n dimMismatch = true;\n }\n });\n if (dimMismatch) {\n console.warn(\n `The shape of the input tensor ` +\n `(${JSON.stringify(inputShape)}) does not ` +\n `match the expectation of layer ${this.name}: ` +\n `${JSON.stringify(this.batchInputShape)}`);\n }\n }\n }\n\n /**\n * Retrieves the output shape(s) of a layer.\n *\n * Only applicable if the layer has only one inbound node, or if all inbound\n * nodes have the same output shape.\n *\n * @returns Output shape or shapes.\n * @throws AttributeError: if the layer is connected to more than one incoming\n * nodes.\n */\n get outputShape(): Shape|Shape[] {\n if (this.inboundNodes == null || this.inboundNodes.length === 0) {\n throw new AttributeError(\n `The layer ${this.name} has never been called and thus has no ` +\n `defined output shape.`);\n }\n const allOutputShapes: string[] = [];\n for (const node of this.inboundNodes) {\n const shapeString = JSON.stringify(node.outputShapes);\n if (allOutputShapes.indexOf(shapeString) === -1) {\n allOutputShapes.push(shapeString);\n }\n }\n if (allOutputShapes.length === 1) {\n const outputShapes = this.inboundNodes[0].outputShapes;\n if (Array.isArray(outputShapes) && Array.isArray(outputShapes[0]) &&\n outputShapes.length === 1) {\n return (outputShapes as Shape[])[0];\n } else {\n return outputShapes;\n }\n\n } else {\n throw new AttributeError(\n `The layer ${this.name} has multiple inbound nodes with different ` +\n `output shapes. Hence the notion of \"outut shape\" is ill-defined ` +\n `for the layer.`);\n // TODO(cais): Implement getOutputShapeAt().\n }\n }\n\n /**\n * Counts the total number of numbers (e.g., float32, int32) in the\n * weights.\n *\n * @returns An integer count.\n * @throws RuntimeError: If the layer is not built yet (in which case its\n * weights are not defined yet.)\n */\n countParams(): number {\n if (!this.built) {\n throw new RuntimeError(\n `You tried to call countParams() on ${this.name}, ` +\n `but the layer is not built yet. Build it first by calling ` +\n `build(batchInputShape).`);\n }\n return variable_utils.countParamsInWeights(this.weights);\n }\n\n /**\n * Creates the layer weights.\n *\n * Must be implemented on all layers that have weights.\n *\n * Called when apply() is called to construct the weights.\n *\n * @param inputShape A `Shape` or array of `Shape` (unused).\n */\n build(inputShape: Shape|Shape[]) {\n this.built = true;\n }\n\n /**\n * Returns the current values of the weights of the layer.\n *\n * @param trainableOnly Whether to get the values of only trainable weights.\n * @returns Weight values as an `Array` of `Tensor`s.\n */\n getWeights(trainableOnly = false): Tensor[] {\n return batchGetValue(trainableOnly ? this.trainableWeights : this.weights);\n }\n\n /**\n * Sets the weights of the layer, from Tensors.\n *\n * @param weights a list of Tensors. The number of arrays and their shape\n * must match number of the dimensions of the weights of the layer (i.e.\n * it should match the output of `getWeights`).\n *\n * @exception ValueError If the provided weights list does not match the\n * layer's specifications.\n */\n setWeights(weights: Tensor[]): void {\n tidy(() => {\n const params = this.weights;\n if (params.length !== weights.length) {\n // TODO(cais): Restore the following and use `providedWeights`, instead\n // of `weights` in the error message, once the deeplearn.js bug is\n // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const\n // providedWeights = JSON.stringify(weights).substr(0, 50);\n throw new ValueError(\n `You called setWeights(weights) on layer \"${this.name}\" ` +\n `with a weight list of length ${weights.length}, ` +\n `but the layer was expecting ${params.length} weights. ` +\n `Provided weights: ${weights}...`);\n }\n if (params.length === 0) {\n return;\n }\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n const paramValues = batchGetValue(params);\n for (let i = 0; i < paramValues.length; ++i) {\n const pv = paramValues[i];\n const p = params[i];\n const w = weights[i];\n if (!util.arraysEqual(pv.shape, w.shape)) {\n throw new ValueError(\n `Layer weight shape ${pv.shape} ` +\n `not compatible with provided weight shape ${w.shape}`);\n }\n weightValueTuples.push([p, w]);\n }\n batchSetValue(weightValueTuples);\n });\n }\n\n /**\n * Adds a weight variable to the layer.\n *\n * @param name Name of the new weight variable.\n * @param shape The shape of the weight.\n * @param dtype The dtype of the weight.\n * @param initializer An initializer instance.\n * @param regularizer A regularizer instance.\n * @param trainable Whether the weight should be trained via backprop or not\n * (assuming that the layer itself is also trainable).\n * @param constraint An optional trainable.\n * @return The created weight variable.\n */\n protected addWeight(\n name: string, shape: Shape, dtype?: DataType, initializer?: Initializer,\n regularizer?: Regularizer, trainable?: boolean,\n constraint?: Constraint): LayerVariable {\n // Reject duplicate weight names.\n if (this._addedWeightNames.indexOf(name) !== -1) {\n throw new ValueError(\n `Duplicate weight name ${name} for layer ${this.name}`);\n }\n this._addedWeightNames.push(name);\n\n if (dtype == null) {\n dtype = 'float32';\n }\n const weight = new LayerVariable(\n initializer.apply(shape, dtype), dtype, name, trainable, constraint);\n // Request backend not to dispose the weights of the model on scope() exit.\n if (regularizer != null) {\n this.addLoss(() => regularizer.apply(weight.read()));\n }\n if (trainable == null) {\n trainable = true;\n }\n if (trainable) {\n this._trainableWeights.push(weight);\n } else {\n this._nonTrainableWeights.push(weight);\n }\n return weight;\n }\n\n /**\n * Add losses to the layer.\n *\n * The loss may potentionally be conditional on some inputs tensors,\n * for instance activity losses are conditional on the layer's inputs.\n */\n addLoss(losses: RegularizerFn|RegularizerFn[]): void {\n if (losses == null || Array.isArray(losses) && losses.length === 0) {\n return;\n }\n // Update this.losses\n losses = generic_utils.toList(losses);\n if (this._losses !== undefined && this._losses !== null) {\n this.losses.push(...losses);\n }\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n if (!this.supportsMasking) {\n if (mask != null) {\n if (Array.isArray(mask)) {\n mask.forEach(maskElement => {\n if (maskElement != null) {\n throw new TypeError(\n `Layer ${this.name} does not support masking,` +\n 'but was passed an inputMask.');\n }\n });\n } else {\n throw new TypeError(\n `Layer ${this.name} does not support masking,` +\n 'but was passed an inputMask.');\n }\n }\n // masking not explicitly supported: return null as mask\n return null;\n }\n // if masking is explictly supported, by default\n // carry over the input mask\n return mask;\n }\n\n /**\n * Internal method to create an inbound node for the layer.\n *\n * @param inputTensors List of input tensors.\n * @param outputTensors List of output tensors.\n * @param inputMasks List of input masks (a mask can be a tensor, or null).\n * @param outputMasks List of output masks (a mask can be a tensor, or null).\n * @param inputShapes List of input shape tuples.\n * @param outputShapes List of output shape tuples.\n * @param kwargs Dictionary of keyword arguments that were passed to the\n * `call` method of the layer at the call that created the node.\n */\n private addInboundNode(\n inputTensors: SymbolicTensor|SymbolicTensor[],\n outputTensors: SymbolicTensor|SymbolicTensor[],\n inputMasks: Tensor|Tensor[], outputMasks: Tensor|Tensor[],\n inputShapes: Shape|Shape[], outputShapes: Shape|Shape[],\n kwargs: {} = null): void {\n const inputTensorList: SymbolicTensor[] =\n generic_utils.toList(inputTensors);\n outputTensors = generic_utils.toList(outputTensors);\n inputMasks = generic_utils.toList(inputMasks);\n outputMasks = generic_utils.toList(outputMasks);\n inputShapes = types_utils.normalizeShapeList(inputShapes);\n outputShapes = types_utils.normalizeShapeList(outputShapes);\n\n // Collect input tensor(s) coordinates.\n const inboundLayers: Layer[] = [];\n const nodeIndices: number[] = [];\n const tensorIndices: number[] = [];\n for (const x of inputTensorList) {\n /*\n * TODO(michaelterry): Keras adds this value to tensors; it's not\n * clear whether we'll use this or not.\n */\n inboundLayers.push(x.sourceLayer as Layer);\n nodeIndices.push(x.nodeIndex);\n tensorIndices.push(x.tensorIndex);\n }\n\n // Create node, add it to inbound nodes.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node(\n {\n outboundLayer: this,\n inboundLayers,\n nodeIndices,\n tensorIndices,\n inputTensors: inputTensorList,\n outputTensors,\n inputMasks,\n outputMasks,\n inputShapes,\n outputShapes\n },\n kwargs);\n\n // Update tensor history\n for (let i = 0; i < outputTensors.length; i++) {\n // TODO(michaelterry: _uses_learning_phase not tracked.\n outputTensors[i].sourceLayer = this;\n outputTensors[i].nodeIndex = this.inboundNodes.length - 1;\n outputTensors[i].tensorIndex = i;\n }\n }\n\n /**\n * Returns the config of the layer.\n *\n * A layer config is a TS dictionary (serializable)\n * containing the configuration of a layer.\n * The same layer can be reinstantiated later\n * (without its trained weights) from this configuration.\n *\n * The config of a layer does not include connectivity\n * information, nor the layer class name. These are handled\n * by 'Container' (one layer of abstraction above).\n *\n * Porting Note: The TS dictionary follows TS naming standrds for\n * keys, and uses tfjs-layers type-safe Enums. Serialization methods\n * should use a helper function to convert to the pythonic storage\n * standard. (see serialization_utils.convertTsToPythonic)\n *\n * @returns TS dictionary of configuration.\n */\n getConfig(): serialization.ConfigDict {\n const config:\n serialization.ConfigDict = {name: this.name, trainable: this.trainable};\n if (this.batchInputShape != null) {\n config['batchInputShape'] = this.batchInputShape;\n }\n if (this.dtype != null) {\n config['dtype'] = this.dtype;\n }\n return config;\n }\n}\n\n/**\n * Collects the input shape(s) of a list of `Tensor`s or `SymbolicTensor`s.\n *\n * TODO(michaelterry): Update PyKeras docs (backport).\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return List of shape tuples (or single tuple), one tuple per input.\n */\nfunction collectInputShape(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): Shape|Shape[] {\n inputTensors =\n generic_utils.toList(inputTensors) as SymbolicTensor[] | Tensor[];\n const shapes: Shape[] = [];\n for (const x of inputTensors) {\n shapes.push(x.shape);\n }\n return generic_utils.singletonOrArray(shapes);\n}\n\n/**\n * Guesses output dtype based on inputs.\n *\n * At present, just returns 'float32' for any input.\n *\n * @param inputTensors List of input tensors (or single input tensor).\n *\n * @return The guessed DType. At present, always returns 'float32'.\n */\nfunction guessOutputDType(inputTensors: SymbolicTensor|SymbolicTensor[]|Tensor|\n Tensor[]): DataType {\n return 'float32';\n}\n\n/**\n * Returns the list of input tensors necessary to compute `tensor`.\n *\n * Output will always be a list of tensors (potentially with 1 element).\n *\n * @param tensor The tensor to start from.\n * @param layer Origin layer of the tensor.\n * @param nodeIndex Origin node index of the tensor.\n *\n * @return Array of input tensors.\n */\nexport function getSourceInputs(\n tensor: SymbolicTensor, layer?: Layer,\n nodeIndex?: number): SymbolicTensor[] {\n if (layer == null || (nodeIndex != null && nodeIndex > 0)) {\n layer = tensor.sourceLayer;\n nodeIndex = tensor.nodeIndex;\n }\n if (layer.inboundNodes.length === 0) {\n return [tensor];\n } else {\n const node = layer.inboundNodes[nodeIndex];\n if (node.inboundLayers.length === 0) {\n return node.inputTensors;\n } else {\n const sourceTensors: SymbolicTensor[] = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const previousSources = getSourceInputs(x, layer, nodeIndex);\n // Avoid input redundancy.\n for (const x of previousSources) {\n if (sourceTensors.indexOf(x) === -1) {\n sourceTensors.push(x);\n }\n }\n }\n return sourceTensors;\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {DataType, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\n\nimport {Layer, Node, SymbolicTensor} from './topology';\n\n/**\n * Constructor arguments for InputLayer.\n *\n * Note: You should provide only inputShape or batchInputShape (not both).\n * If only inputShape is provided, then the batchInputShape is determined by\n * the batchSize argument and the inputShape: [batchSize].concat(inputShape).\n */\nexport interface InputLayerConfig {\n /** Input shape, not including the batch axis. */\n inputShape?: Shape;\n /** Optional input batch size (integer or null). */\n batchSize?: number;\n /** Batch input shape, including the batch axis. */\n batchInputShape?: Shape;\n /** Datatype of the input. */\n dtype?: DataType;\n /**\n * Whether the placeholder created is meant to be sparse.\n */\n sparse?: boolean; // TODO(michaelterry): Not clear whether we'll need this.\n\n /** Name of the layer. */\n name?: string;\n}\n\n/**\n * An input layer is an entry point into a `Model`.\n *\n * `InputLayer` is generated automatically for `Sequential` models by specifying\n * the `inputshape` or `batchInputShape` for the first layer. It should not be\n * specified explicitly.\n *\n * ```js\n * // Define a model which simply adds two inputs.\n * const inputA = tf.input({shape: [3]});\n * const inputB = tf.input({shape: [3]});\n * const sum = tf.layers.add().apply([inputA, inputB]);\n * const model = tf.model({inputs: [inputA, inputB], outputs: sum});\n * const batchSize = 2;\n * model.predict([tf.ones([batchSize, 3]), tf.ones([batchSize, 3])]).print();\n * ```\n */\nexport class InputLayer extends Layer {\n static readonly className = 'InputLayer';\n sparse: boolean;\n constructor(config: InputLayerConfig) {\n super({\n dtype: config.dtype,\n name: config.name != null ? config.name : getUid('input').toString()\n });\n // Normalize config.batchSize and config.sparse\n if (config.batchSize == null) {\n config.batchSize = null;\n }\n if (config.sparse == null) {\n config.sparse = false;\n }\n\n this.trainable = false;\n this.built = true;\n this.sparse = config.sparse;\n\n if (config.inputShape != null && config.batchInputShape != null) {\n throw new ValueError(\n 'Only provide the inputShape OR ' +\n 'batchInputShape argument to inputLayer, not both at the same time.');\n }\n let batchInputShape = config.batchInputShape;\n if (batchInputShape == null) {\n if (config.inputShape == null) {\n throw new ValueError(\n 'An InputLayer should be passed either a ' +\n '`batchInputShape` or an `inputShape`.');\n } else {\n batchInputShape = [config.batchSize].concat(config.inputShape);\n }\n } else {\n // TODO(michaelterry): Backport to PyKeras\n if (config.batchSize != null) {\n throw new ValueError(\n 'Cannot specify batchSize if batchInputShape is' +\n 'specified when creating an InputLayer.');\n }\n }\n\n const dtype = config.dtype || 'float32';\n\n this.batchInputShape = batchInputShape;\n this.dtype = dtype;\n // TODO(michaelterry): Backport this to PyKeras?\n this.inputSpec = [{shape: batchInputShape}];\n\n const inputTensor = new SymbolicTensor(\n this.dtype, this.batchInputShape, this, [], {}, this.name);\n inputTensor.nodeIndex = 0;\n inputTensor.tensorIndex = 0;\n\n // Create an input node to add to this.outboundNode.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: [inputTensor],\n outputTensors: [inputTensor],\n inputMasks: [null],\n outputMasks: [null],\n inputShapes: [batchInputShape],\n outputShapes: [batchInputShape]\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor {\n throw new ValueError(\n 'Cannot pass any input to an ' +\n `InputLayer's apply() method. InputLayer name: ${this.name}`);\n }\n\n getConfig(): serialization.ConfigDict {\n return {\n batchInputShape: this.batchInputShape,\n dtype: this.dtype,\n sparse: this.sparse,\n name: this.name\n };\n }\n}\nserialization.SerializationMap.register(InputLayer);\n\n/**\n * Config for the Input function.\n *\n * Note: You should provide only shape or batchShape (not both).\n * If only shape is provided, then the batchShape becomes\n * [null].concat(inputShape).\n */\nexport interface InputConfig {\n /**\n * A shape, not including the batch size. For instance, `shape=[32]`\n * indicates that the expected input will be batches of 32-dimensional\n * vectors.\n */\n shape?: Shape;\n /**\n * A shape tuple (integer), including the batch size. For instance,\n * `batchShape=[10, 32]` indicates that the expected input will be batches of\n * 10 32-dimensional vectors. `batchShape=[null, 32]` indicates batches of an\n * arbitrary number of 32-dimensional vectors.\n */\n batchShape?: Shape;\n /**\n * An optional name string for the layer. Should be unique in a model (do not\n * reuse the same name twice). It will be autogenerated if it isn't provided.\n */\n name?: string;\n dtype?: DataType;\n /**\n * A boolean specifying whether the placeholder to be created is sparse.\n */\n sparse?: boolean;\n}\n\n/**\n * Used to instantiate an input to a model as a `SymbolicTensor`.\n *\n * Users should call the `input` factory function for\n * consistency with other generator functions.\n *\n * Example:\n *\n * ```js\n * // Defines a simple logistic regression model with 32 dimensional input\n * // and 3 dimensional output.\n * const x = tf.input({shape: [32]});\n * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);\n * const model = tf.model({inputs: x, outputs: y});\n * model.predict(tf.ones([2, 32])).print();\n * ```\n *\n * Note: `input` is only necessary when using `model`. When using\n * `sequential`, specify `inputShape` for the first layer or use `inputLayer`\n * as the first layer.\n */\nexport function Input(config: InputConfig): SymbolicTensor {\n if (config.batchShape == null && config.shape == null) {\n throw new Error(\n 'Please provide to Input either a `shape`' +\n ' or a `batchShape` argument. Note that ' +\n '`shape` does not include the batch ' +\n 'dimension.');\n }\n if (config.batchShape != null && config.shape != null) {\n // TODO(michaelterry): Backport to PyKeras.\n throw new ValueError(\n 'Please provide either a `shape` or `batchShape` ' +\n 'argument to Input, but not both.');\n }\n let batchShape = config.batchShape;\n if (config.shape != null && batchShape == null) {\n batchShape = [null].concat(config.shape);\n }\n\n let dtype = config.dtype;\n if (dtype == null) {\n dtype = 'float32';\n }\n\n const inputLayer = new InputLayer({\n batchInputShape: batchShape,\n name: config.name,\n dtype,\n sparse: config.sparse\n });\n\n const outputs = inputLayer.inboundNodes[0].outputTensors;\n return outputs[0];\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {dispose, Scalar} from '@tensorflow/tfjs-core';\n\n/**\n * Logs in which values can be either numbers or Tensors (Scalars).\n *\n * Used internally.\n */\nexport type UnresolvedLogs = {\n [key: string]: number|Scalar;\n};\n\n/**\n * Turn any Scalar values in a Logs object into actual number values.\n *\n * @param logs The `Logs` object to be resolved in place.\n */\nexport async function resolveScalarsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n const promises: Array> = [];\n const keys: string[] = [];\n const scalarsToDispose: Scalar[] = [];\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n const valueScalar = value as Scalar;\n promises.push(valueScalar.data());\n keys.push(key);\n scalarsToDispose.push(valueScalar);\n }\n }\n const values = await Promise.all(promises);\n for (let i = 0; i < values.length; ++i) {\n logs[keys[i]] = values[i][0];\n }\n\n // Dispose the original scalar tensors.\n dispose(scalarsToDispose);\n}\n\n/**\n * Dispose all Tensors in an UnresolvedLogs object.\n *\n * @param logs An `UnresolvedLogs` object potentially containing `Tensor`s in\n * places where the values can be `Tensor` or `number`.\n */\nexport function disposeTensorsInLogs(logs: UnresolvedLogs) {\n if (logs == null) {\n return;\n }\n for (const key in logs) {\n const value = logs[key];\n if (typeof value !== 'number') {\n value.dispose();\n }\n }\n}\n\n/**\n * Logs in which values can only be numbers.\n *\n * Used when calling client-provided custom callbacks.\n */\nexport type Logs = {\n [key: string]: number;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {add, div, keep, mul, Scalar, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from './backend/state';\nimport {Container} from './engine/container';\nimport {Logs, resolveScalarsInLogs, UnresolvedLogs} from './logs';\nimport * as generic_utils from './utils/generic_utils';\n\n\nexport type Params = {\n [key: string]: number|string|boolean|number[]|string[]|boolean[];\n};\n\n/**\n * Abstract base class used to build new callbacks.\n *\n * The `logs` dictionary that callback methods take as argument will contain\n * keys for quantities relevant to the current batch or epoch.\n *\n * Currently, the `.fit()` method of the `Sequential` model class\n * will include the following quantities in the `logs` that\n * it passes to its callbacks:\n *\n * onEpochEnd: Logs include `acc` and `loss`, and optionally include `valLoss`\n * (if validation is enabled in `fit`), and `valAcc` (if validation and\n * accuracy monitoring are enabled).\n * onBatchBegin: Logs include `size`, the number of samples in the current\n * batch.\n * onBatchEnd: Logs include `loss`, and optionally `acc` (if accuracy monitoring\n * is enabled).\n */\nexport abstract class BaseCallback {\n // TODO(michaelterry): This type is a best guess.\n validationData: Tensor|Tensor[] = null;\n /**\n * Training parameters (eg. verbosity, batch size, number of epochs...).\n */\n params: Params;\n\n setParams(params: Params): void {\n this.params = params;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {}\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {}\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {}\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {}\n\n async onTrainBegin(logs?: UnresolvedLogs) {}\n\n async onTrainEnd(logs?: UnresolvedLogs) {}\n\n // Model needs to call Callback.setModel(), but cannot actually depend on\n // Callback because that creates a cyclic dependency. Providing this no-op\n // method on BaseCallback breaks the cycle: this way Model can depend on\n // BaseCallback but not on Callback. The argument is typed as `Container`\n // (the superclass of Model) to avoid recapitulating the cycle. Callback\n // overrides this method and enforces that the argument is really a Model.\n setModel(model: Container): void {\n // Do nothing. Use Callback instead of BaseCallback to track the model.\n }\n}\n\n/**\n * Container abstracting a list of callbacks.\n */\nexport class CallbackList {\n callbacks: BaseCallback[];\n queueLength: number;\n\n // TODO(cais): When the need arises, uncomment the following lines and\n // implement the queue for time values.\n // private deltaTBatch: number;\n // private deltaTsBatchBegin: Array;\n // private deltaTsBatchEnd: Array;\n\n /**\n * Constructor of CallbackList.\n * @param callbacks Array of `Callback` instances.\n * @param queueLength Queue length for keeping running statistics over\n * callback execution time.\n */\n constructor(callbacks?: BaseCallback[], queueLength = 10) {\n // TODO(cais): Make use of queueLength when implementing the queue for time\n // values.\n if (callbacks == null) {\n callbacks = [];\n }\n this.callbacks = callbacks;\n this.queueLength = queueLength;\n }\n\n append(callback: BaseCallback): void {\n this.callbacks.push(callback);\n }\n\n setParams(params: Params): void {\n for (const callback of this.callbacks) {\n callback.setParams(params);\n }\n }\n\n setModel(model: Container): void {\n for (const callback of this.callbacks) {\n callback.setModel(model);\n }\n }\n\n /**\n * Called at the start of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochBegin(epoch, logs);\n }\n }\n\n /**\n * Called at the end of an epoch.\n * @param epoch Index of epoch.\n * @param logs Dictionary of logs.\n */\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onEpochEnd(epoch, logs);\n }\n }\n\n /**\n * Called right before processing a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchBegin(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchBegin(batch, logs);\n }\n }\n\n /**\n * Called at the end of a batch.\n * @param batch Index of batch within the current epoch.\n * @param logs Dictionary of logs.\n */\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onBatchEnd(batch, logs);\n }\n }\n\n /**\n * Called at the beginning of training.\n * @param logs Dictionary of logs.\n */\n async onTrainBegin(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainBegin(logs);\n }\n }\n\n /**\n * Called at the end of training.\n * @param logs Dictionary of logs.\n */\n async onTrainEnd(logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n for (const callback of this.callbacks) {\n await callback.onTrainEnd(logs);\n }\n }\n}\n\n\n/**\n * Callback that accumulates epoch averages of metrics.\n *\n * This callback is automatically applied to every Model.\n */\nexport class BaseLogger extends BaseCallback {\n private seen: number;\n private totals: UnresolvedLogs;\n\n constructor() {\n super();\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs) {\n this.seen = 0;\n this.totals = {};\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n const batchSize = logs['size'] == null ? 0 : logs['size'] as number;\n this.seen += batchSize;\n for (const key in logs) {\n const value = logs[key];\n if (typeof value === 'number') {\n if (!this.totals.hasOwnProperty(key)) {\n this.totals[key] = 0;\n }\n this.totals[key] = this.totals[key] as number + value * batchSize;\n } else {\n let oldTotalsToDispose: Scalar;\n if (key in this.totals) {\n oldTotalsToDispose = this.totals[key] as Scalar;\n } else {\n this.totals[key] = getScalar(0);\n }\n\n this.totals[key] = tidy(\n () => add((this.totals[key] as Scalar),\n mul(value, getScalar(batchSize))) as Scalar);\n if (oldTotalsToDispose != null) {\n oldTotalsToDispose.dispose();\n }\n }\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs != null) {\n for (const key of this.params['metrics'] as string[]) {\n if (this.totals[key] == null) {\n continue;\n }\n if (typeof this.totals[key] === 'number') {\n logs[key] = this.totals[key] as number / this.seen;\n } else {\n tidy(() => {\n logs[key] = mul(div(getScalar(1), getScalar(this.seen)) as Scalar,\n this.totals[key] as Scalar) as Scalar;\n (this.totals[key] as Tensor).dispose();\n keep(logs[key] as Scalar);\n });\n }\n }\n }\n }\n}\n\n/**\n * Callback that records events into a `History` object. This callback is\n * automatically applied to every TF.js Layers model. The `History` object gets\n * returned by the `fit` method of models.\n */\nexport class History extends BaseCallback {\n epoch: number[];\n history: {[key: string]: Array};\n\n async onTrainBegin(logs?: UnresolvedLogs) {\n this.epoch = [];\n this.history = {};\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs) {\n if (logs == null) {\n logs = {};\n }\n this.epoch.push(epoch);\n for (const key in logs) {\n if (this.history[key] == null) {\n this.history[key] = [];\n }\n this.history[key].push(logs[key]);\n }\n }\n\n /**\n * Await the values of all losses and metrics.\n */\n async syncData() {\n const promises: Array> = [];\n const keys: string[] = [];\n const indices: number[] = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i] as Tensor;\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]] as Tensor;\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }\n}\n\nexport interface CustomCallbackConfig {\n onTrainBegin?: (logs?: Logs) => Promise;\n onTrainEnd?: (logs?: Logs) => Promise;\n onEpochBegin?: (epoch: number, logs?: Logs) => Promise;\n onEpochEnd?: (epoch: number, logs?: Logs) => Promise;\n onBatchBegin?: (batch: number, logs?: Logs) => Promise;\n onBatchEnd?: (batch: number, logs?: Logs) => Promise;\n}\n\n/**\n * Custom callback for training.\n */\nexport class CustomCallback extends BaseCallback {\n protected readonly trainBegin: (logs?: Logs) => Promise;\n protected readonly trainEnd: (logs?: Logs) => Promise;\n protected readonly epochBegin: (epoch: number, logs?: Logs) => Promise;\n protected readonly epochEnd: (epoch: number, logs?: Logs) => Promise;\n protected readonly batchBegin: (batch: number, logs?: Logs) => Promise;\n protected readonly batchEnd: (batch: number, logs?: Logs) => Promise;\n\n constructor(config: CustomCallbackConfig) {\n super();\n this.trainBegin = config.onTrainBegin;\n this.trainEnd = config.onTrainEnd;\n this.epochBegin = config.onEpochBegin;\n this.epochEnd = config.onEpochEnd;\n this.batchBegin = config.onBatchBegin;\n this.batchEnd = config.onBatchEnd;\n }\n\n async onEpochBegin(epoch: number, logs?: UnresolvedLogs): Promise {\n if (this.epochBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.epochBegin(epoch, logs as Logs);\n }\n }\n\n async onEpochEnd(epoch: number, logs?: UnresolvedLogs): Promise {\n if (this.epochEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.epochEnd(epoch, logs as Logs);\n }\n }\n\n async onBatchBegin(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.batchBegin(batch, logs as Logs);\n }\n }\n\n async onBatchEnd(batch: number, logs?: UnresolvedLogs): Promise {\n if (this.batchEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.batchEnd(batch, logs as Logs);\n }\n }\n\n async onTrainBegin(logs?: UnresolvedLogs): Promise {\n if (this.trainBegin != null) {\n await resolveScalarsInLogs(logs);\n await this.trainBegin(logs as Logs);\n }\n }\n\n async onTrainEnd(logs?: UnresolvedLogs): Promise {\n if (this.trainEnd != null) {\n await resolveScalarsInLogs(logs);\n await this.trainEnd(logs as Logs);\n }\n }\n}\n\n/**\n * Standardize callbacks or configurations of them to an Array of callbacks.\n */\nexport function standardizeCallbacks(callbacks: BaseCallback|BaseCallback[]|\n CustomCallbackConfig|\n CustomCallbackConfig[]): BaseCallback[] {\n if (callbacks == null) {\n return null;\n }\n if (callbacks instanceof BaseCallback) {\n return [callbacks as BaseCallback];\n }\n if (Array.isArray(callbacks) && callbacks[0] instanceof BaseCallback) {\n return callbacks as BaseCallback[];\n }\n // Convert custom callback configs to custom callback objects.\n const callbackConfigs =\n generic_utils.toList(callbacks) as CustomCallbackConfig[];\n return callbackConfigs.map(\n callbackConfig => new CustomCallback(callbackConfig));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: losses.py */\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {scalar, Tensor, Tensor1D, tidy} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\nimport * as K from './backend/tfjs_backend';\nimport {getScalar} from './backend/state';\nimport {ValueError} from './errors';\nimport {LossOrMetricFn} from './types';\n\n\n/**\n * Normalizes a tensor wrt the L2 norm alongside the specified axis.\n * @param x\n * @param axis Axis along which to perform normalization.\n */\nexport function l2Normalize(x: Tensor, axis?: number): Tensor {\n return tidy(() => {\n const squareSum = tfc.sum(K.square(x), axis, true);\n const epsilonTensor = tfc.mul(scalar(epsilon()), tfc.onesLike(x));\n const norm = tfc.sqrt(tfc.maximum(squareSum, epsilonTensor));\n return tfc.div(x, norm);\n });\n}\n\n/**\n * Loss or metric function: Mean squared error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [3, 4]]);\n * const yPred = tf.tensor2d([[0, 1], [-3, -4]]);\n * const mse = tf.metrics.meanSquaredError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MSE`, `tf.metrics.mse`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean squared error Tensor.\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(K.square(tfc.sub(yPred, yTrue)), -1));\n}\n\n/**\n * Loss or metric function: Mean absolute error.\n *\n * Mathematically, mean absolute error is defined as:\n * `mean(abs(yPred - yTrue))`,\n * wherein the `mean` is applied over feature dimensions.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [0, 0], [2, 3]]);\n * const yPred = tf.tensor2d([[0, 1], [0, 1], [-2, -3]]);\n * const mse = tf.metrics.meanAbsoluteError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute error Tensor.\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => tfc.mean(tfc.abs(tfc.sub(yPred, yTrue)), -1));\n}\n\n/**\n * Loss or metric function: Mean absolute percentage error.\n *\n * ```js\n * const yTrue = tf.tensor2d([[0, 1], [10, 20]]);\n * const yPred = tf.tensor2d([[0, 1], [11, 24]]);\n * const mse = tf.metrics.meanAbsolutePercentageError(yTrue, yPred);\n * mse.print();\n * ```\n *\n * Aliases: `tf.metrics.MAPE`, `tf.metrics.mape`.\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Mean absolute percentage error Tensor.\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const diff = tfc.sub(yTrue, yPred);\n const clippedTrue =\n tfc.clipByValue(tfc.abs(yTrue), epsilon(), Number.MAX_VALUE);\n const absResult = tfc.abs(tfc.div(diff, clippedTrue));\n return tfc.mul(getScalar(100.0), tfc.mean(absResult, -1));\n });\n}\n\nexport function meanSquaredLogarithmicError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const one = getScalar(1.0);\n\n const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE);\n const firstLog = tfc.log(tfc.add(one, clippedPred));\n\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE);\n const secondLog = tfc.log(tfc.add(one, clippedTrue));\n\n return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1);\n });\n}\n\nexport function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const zeroTensor = getScalar(0.0);\n const one = getScalar(1.0);\n const maxResult =\n tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred)));\n return tfc.mean(K.square(maxResult), -1);\n });\n}\n\nexport function hinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const zeroTensor = getScalar(0.0);\n const one = getScalar(1.0);\n const maxResult =\n tfc.maximum(zeroTensor, tfc.sub(one, tfc.mul(yTrue, yPred)));\n return tfc.mean(maxResult, -1);\n });\n}\n\nexport function categoricalHinge(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const zeroTensor = getScalar(0.0);\n const one = getScalar(1.0);\n const pos = tfc.sum(tfc.mul(yTrue, yPred), -1);\n const neg = tfc.max(tfc.mul(tfc.sub(one, yTrue), yPred), -1);\n return tfc.maximum(zeroTensor, tfc.add(one, tfc.sub(neg, pos)));\n });\n}\n\n/**\n * Logarithm of the hyperbolic cosine of the prediction error.\n *\n * `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and\n * to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly\n * like the mean squared error, but will not be so strongly affected by the\n * occasional wildly incorrect prediction.\n */\nexport function logcosh(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const log2 = getScalar(Math.log(2.0));\n const predictionDiff = tfc.sub(yPred, yTrue);\n const logcoshResult = tfc.sub(\n tfc.add(\n predictionDiff,\n tfc.softplus(tfc.mul(getScalar(-2.0), predictionDiff))),\n log2);\n return tfc.mean(logcoshResult, -1);\n });\n}\n\n/**\n * Categorical crossentropy between an output tensor and a target tensor.\n *\n * @param target A tensor of the same shape as `output`.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function categoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n if (fromLogits) {\n output = tfc.softmax(output);\n } else {\n // scale preds so that the class probabilities of each sample sum to 1.\n const outputSum = tfc.sum(output, output.shape.length - 1, true);\n output = tfc.div(output, outputSum);\n }\n output = tfc.clipByValue(output, epsilon(), 1 - epsilon());\n return tfc.neg(tfc.sum(\n tfc.mul(target.toFloat(), tfc.log(output)), output.shape.length - 1));\n });\n}\n\n/**\n * Categorical crossentropy with integer targets.\n *\n * @param target An integer tensor.\n * @param output A tensor resulting from a softmax (unless `fromLogits` is\n * `true`, in which case `output` is expected to be the logits).\n * @param fromLogits Boolean, whether `output` is the result of a softmax, or is\n * a tensor of logits.\n */\nexport function sparseCategoricalCrossentropy(\n target: Tensor, output: Tensor, fromLogits = false): Tensor {\n return tidy(() => {\n const flatTarget = tfc.floor(K.flatten(target)).toInt() as Tensor1D;\n const outputShape = output.shape;\n const oneHotTarget =\n tfc.oneHot(flatTarget, outputShape[outputShape.length - 1])\n .reshape(outputShape);\n return categoricalCrossentropy(oneHotTarget, output, fromLogits);\n });\n}\n\n/**\n * From TensorFlow's implementation in nn_impl.py:\n *\n * For brevity, let `x = logits`, `z = labels`. The logistic loss is\n * z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))\n * = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))\n * = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))\n * = (1 - z) * x + log(1 + exp(-x))\n * = x - x * z + log(1 + exp(-x))\n * For x < 0, to avoid overflow in exp(-x), we reformulate the above\n * x - x * z + log(1 + exp(-x))\n * = log(exp(x)) - x * z + log(1 + exp(-x))\n * = - x * z + log(1 + exp(x))\n * Hence, to ensure stability and avoid overflow, the implementation uses this\n * equivalent formulation\n * max(x, 0) - x * z + log(1 + exp(-abs(x)))\n *\n * @param target The labels.\n * @param output The logits.\n */\nexport function sigmoidCrossEntropyWithLogits(\n target: Tensor, output: Tensor): Tensor {\n return tidy(() => {\n const maxOutput = tfc.maximum(output, tfc.zerosLike(output));\n const outputXTarget = tfc.mul(output, target);\n const sigmoidOutput =\n tfc.log(tfc.add(getScalar(1), tfc.exp(tfc.neg(tfc.abs(output)))));\n const result = tfc.add(tfc.sub(maxOutput, outputXTarget), sigmoidOutput);\n return result;\n });\n}\n\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n let y: Tensor;\n y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon());\n y = tfc.log(tfc.div(y, tfc.sub(tfc.onesLike(y), y)));\n return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1);\n });\n}\n\nexport function kullbackLeiblerDivergence(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const clippedTrue = tfc.clipByValue(yTrue, epsilon(), 1);\n const clippedPred = tfc.clipByValue(yPred, epsilon(), 1);\n return tfc.sum(\n tfc.mul(yTrue, tfc.log(tfc.div(clippedTrue, clippedPred))), -1);\n });\n}\n\nexport function poisson(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const logPred = tfc.log(tfc.add(getScalar(epsilon()), yPred));\n return tfc.mean(tfc.sub(yPred, tfc.mul(yTrue, logPred)), -1);\n });\n}\n\n/**\n * Loss or metric function: Cosine proximity.\n *\n * Mathematically, cosine proximity is defined as:\n * `-sum(l2Normalize(yTrue) * l2Normalize(yPred))`,\n * wherein `l2Normalize()` normalizes the L2 norm of the input to 1 and `*`\n * represents element-wise multiplication.\n *\n * ```js\n * const yTrue = tf.tensor2d([[1, 0], [1, 0]]);\n * const yPred = tf.tensor2d([[1 / Math.sqrt(2), 1 / Math.sqrt(2)], [0, 1]]);\n * const proximity = tf.metrics.cosineProximity(yTrue, yPred);\n * proximity.print();\n * ```\n *\n * @param yTrue Truth Tensor.\n * @param yPred Prediction Tensor.\n * @return Cosine proximity Tensor.\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const trueNormalized = l2Normalize(yTrue, -1);\n const predNormalized = l2Normalize(yPred, -1);\n const trueXPred = tfc.mul(trueNormalized, predNormalized);\n return tfc.neg(tfc.sum(trueXPred, -1));\n });\n}\n\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const msle = meanSquaredLogarithmicError;\nexport const MSLE = meanSquaredLogarithmicError;\nexport const kld = kullbackLeiblerDivergence;\nexport const KLD = kullbackLeiblerDivergence;\nexport const cosine = cosineProximity;\n\n// TODO(michaelterry): Add deserialize() function.\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function get(identifierOrFn: string|LossOrMetricFn): LossOrMetricFn {\n const lossesMap: {[functionName: string]: LossOrMetricFn} = {\n meanSquaredError,\n meanAbsoluteError,\n meanAbsolutePercentageError,\n meanSquaredLogarithmicError,\n squaredHinge,\n hinge,\n categoricalHinge,\n logcosh,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n binaryCrossentropy,\n kullbackLeiblerDivergence,\n poisson,\n cosineProximity\n };\n if (typeof identifierOrFn === 'string') {\n if (identifierOrFn in lossesMap) {\n return lossesMap[identifierOrFn];\n }\n throw new ValueError(`Unknown loss ${identifierOrFn}`);\n } else {\n return identifierOrFn;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Built-in metrics.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {getScalar} from './backend/state';\nimport {NotImplementedError, ValueError} from './errors';\nimport {categoricalCrossentropy as categoricalCrossentropyLoss, cosineProximity, meanAbsoluteError, meanAbsolutePercentageError, meanSquaredError, sparseCategoricalCrossentropy as sparseCategoricalCrossentropyLoss} from './losses';\nimport {binaryCrossentropy as lossBinaryCrossentropy} from './losses';\nimport {LossOrMetricFn} from './types';\n// tslint:enable:max-line-length\n\n/**\n * Binary accuracy metric function.\n *\n * `yTrue` and `yPred` can have 0-1 values. Example:\n * ```js\n * const x = tensor2d([[1, 1, 1, 1], [0, 0, 0, 0]], [2, 4]);\n * const y = tensor2d([[1, 0, 1, 0], [0, 0, 0, 1]], [2, 4]);\n * const accuracy = tfl.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * `yTrue` and `yPred` can also have floating-number values between 0 and 1, in\n * which case the values will be thresholded at 0.5 to yield 0-1 values (i.e.,\n * a value >= 0.5 and <= 1.0 is interpreted as 1.\n * )\n * Example:\n * ```js\n * const x = tensor1d([1, 1, 1, 1, 0, 0, 0, 0]);\n * const y = tensor1d([0.2, 0.4, 0.6, 0.8, 0.2, 0.3, 0.4, 0.7]);\n * const accuracy = tf.metrics.binaryAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction.\n * @return Accuracy Tensor.\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(() => {\n const threshold = tfc.mul(getScalar(0.5), tfc.onesLike(yPred));\n const yPredThresholded = K.cast(tfc.greater(yPred, threshold), yTrue.dtype);\n return tfc.mean(tfc.equal(yTrue, yPredThresholded), -1);\n });\n}\n\n/**\n * Categorical accuracy metric function.\n *\n * Example:\n * ```js\n * const x = tensor2d([[0, 0, 0, 1], [0, 0, 0, 1]]);\n * const y = tensor2d([[0.1, 0.8, 0.05, 0.05], [0.1, 0.05, 0.05, 0.8]]);\n * const accuracy = tf.metrics.categoricalAccuracy(x, y);\n * accuracy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth: one-hot encoding of categories.\n * @param yPred Binary Tensor of prediction: probabilities or logits for the\n * same categories as in `yTrue`.\n * @return Accuracy Tensor.\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return tidy(\n () => K.cast(\n tfc.equal(tfc.argMax(yTrue, -1), tfc.argMax(yPred, -1)), 'float32'));\n}\n\n/**\n * Binary crossentropy metric function.\n *\n * Example:\n * ```js\n * const x = tensor2d([[0], [1], [1], [1]]);\n * const y = tensor2d([[0], [0], [0.5], [1]]);\n * const crossentropy = tf.metrics.binaryCrossentropy(x, y);\n * crossentropy.print();\n * ```\n *\n * @param yTrue Binary Tensor of truth.\n * @param yPred Binary Tensor of prediction, probabilities for the `1` case.\n * @return Accuracy Tensor.\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return lossBinaryCrossentropy(yTrue, yPred);\n}\n\nexport function sparseCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function topKCategoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\nexport function sparseTopKCategoricalAccuracy(\n yTrue: Tensor, yPred: Tensor): Tensor {\n throw new NotImplementedError();\n}\n\n// Aliases.\nexport const mse = meanSquaredError;\nexport const MSE = meanSquaredError;\nexport const mae = meanAbsoluteError;\nexport const MAE = meanAbsoluteError;\nexport const mape = meanAbsolutePercentageError;\nexport const MAPE = meanAbsolutePercentageError;\nexport const categoricalCrossentropy = categoricalCrossentropyLoss;\nexport const cosine = cosineProximity;\nexport const sparseCategoricalCrossentropy = sparseCategoricalCrossentropyLoss;\n\n// TODO(cais, nielsene): Add serialize().\n\nexport function get(identifier: string|LossOrMetricFn): LossOrMetricFn {\n const metricsMap: {[functionName: string]: LossOrMetricFn} = {\n binaryAccuracy,\n categoricalAccuracy,\n categoricalCrossentropy,\n sparseCategoricalCrossentropy,\n mse,\n MSE,\n mae,\n MAE,\n mape,\n MAPE,\n cosine,\n };\n if (typeof identifier === 'string' && identifier in metricsMap) {\n return metricsMap[identifier];\n } else if (typeof identifier !== 'string' && identifier != null) {\n return identifier;\n } else {\n throw new ValueError(`Unknown metric ${identifier}`);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {Container} from '../engine/container';\nimport {Layer, Node} from '../engine/topology';\nimport {countParamsInWeights} from './variable_utils';\n\n/**\n * Print the summary of a Model object.\n *\n * @param model tf.Model instance.\n * @param lineLength Total length of printed lines. Set this to adapt to the\n * display to different terminal or console sizes.\n * @param positions Relative or absolute positions of log elements in each\n * line. Each number corresponds to right-most (i.e., ending) position of a\n * column.\n * If not provided, defaults to `[0.45, 0.85, 1]` for sequential-like\n * models and `[0.33, 0.55, 0.67, 1]` for non-sequential like models.\n * @param printFn Print function to use.\n * It will be called on each line of the summary. You can provide a custom\n * function in order to capture the string summary. Defaults to `console.log`.\n */\nexport function printSummary(\n model: Container, lineLength?: number, positions?: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void =\n console.log): void {\n const sequentialLike = isModelSequentialLike(model);\n\n // Header names for different log elements.\n const toDisplay: string[] = ['Layer (type)', 'Output shape', 'Param #'];\n if (sequentialLike) {\n lineLength = lineLength || 65;\n positions = positions || [0.45, 0.85, 1];\n } else {\n lineLength = lineLength || 98;\n positions = positions || [0.33, 0.55, 0.67, 1];\n // Header names for different log elements.\n }\n\n if (positions[positions.length - 1] <= 1) {\n // `positions` is relative. Convert it to absolute positioning.\n positions = positions.map(p => Math.floor(lineLength * p));\n }\n\n let relevantNodes: Node[];\n if (!sequentialLike) {\n toDisplay.push('Receives inputs');\n relevantNodes = [];\n for (const depth in model.nodesByDepth) {\n relevantNodes.push(...model.nodesByDepth[depth]);\n }\n }\n\n printFn('_'.repeat(lineLength));\n printRow(toDisplay, positions, printFn);\n printFn('='.repeat(lineLength));\n\n const layers = model.layers;\n for (let i = 0; i < layers.length; ++i) {\n if (sequentialLike) {\n printLayerSummary(layers[i], positions, printFn);\n } else {\n printLayerSummaryWithConnections(\n layers[i], positions, relevantNodes, printFn);\n }\n printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength));\n }\n\n // tslint:disable-next-line:no-any\n (model as any).checkTrainableWeightsConsistency();\n let trainableCount: number;\n // tslint:disable:no-any\n if ((model as any).collectedTrainableWeights != null) {\n trainableCount =\n countParamsInWeights((model as any).collectedTrainableWeights);\n } else {\n trainableCount = countParamsInWeights(model.trainableWeights);\n }\n // tslint:enable:no-any\n const nonTrainableCount = countParamsInWeights(model.nonTrainableWeights);\n\n printFn(`Total params: ${trainableCount + nonTrainableCount}`);\n printFn(`Trainable params: ${trainableCount}`);\n printFn(`Non-trainable params: ${nonTrainableCount}`);\n printFn('_'.repeat(lineLength));\n}\n\nfunction isModelSequentialLike(model: Container): boolean {\n let sequentialLike = true;\n const nodesByDepth: Node[][] = [];\n const nodes: Node[] = [];\n for (const depth in model.nodesByDepth) {\n nodesByDepth.push(model.nodesByDepth[depth]);\n }\n for (const depthNodes of nodesByDepth) {\n if (depthNodes.length > 1 ||\n depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) {\n sequentialLike = false;\n break;\n }\n nodes.push(...depthNodes);\n }\n if (sequentialLike) {\n // Search for shared layers.\n for (const layer of model.layers) {\n let flag = false;\n for (const node of layer.inboundNodes) {\n if (nodes.indexOf(node) !== -1) {\n if (flag) {\n sequentialLike = false;\n break;\n } else {\n flag = true;\n }\n }\n }\n if (!sequentialLike) {\n break;\n }\n }\n }\n return sequentialLike;\n}\n\nfunction printRow(\n fields: string[], positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void = console.log) {\n let line = '';\n for (let i = 0; i < fields.length; ++i) {\n if (i > 0) {\n line = line.slice(0, line.length - 1) + ' ';\n }\n line += fields[i];\n line = line.slice(0, positions[i]);\n line += ' '.repeat(positions[i] - line.length);\n }\n printFn(line);\n}\n\n/**\n * Prints a summary for a single Layer, without connectivity information.\n *\n * @param layer: Layer instance to print.\n */\nfunction printLayerSummary(\n layer: Layer, positions: number[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const name = layer.name;\n const className = layer.getClassName();\n const fields: string[] =\n [`${name} (${className})`, outputShape, layer.countParams().toString()];\n printRow(fields, positions, printFn);\n}\n\n/**\n * Prints a summary for a single Layer, with connectivity information.\n */\nfunction printLayerSummaryWithConnections(\n layer: Layer, positions: number[], relevantNodes: Node[],\n // tslint:disable-next-line:no-any\n printFn: (message?: any, ...optionalParams: any[]) => void) {\n let outputShape: string;\n try {\n outputShape = JSON.stringify(layer.outputShape);\n } catch (err) {\n outputShape = 'multiple';\n }\n\n const connections: string[] = [];\n for (const node of layer.inboundNodes) {\n if (relevantNodes != null && relevantNodes.length > 0 &&\n relevantNodes.indexOf(node) === -1) {\n continue;\n }\n for (let i = 0; i < node.inboundLayers.length; ++i) {\n const inboundLayer = node.inboundLayers[i].name;\n const inboundLayerIndex = node.nodeIndices[i];\n const inboundTensorIndex = node.tensorIndices[i];\n connections.push(\n `${inboundLayer}[${inboundLayerIndex}][${inboundTensorIndex}]`);\n }\n }\n const name = layer.name;\n const className = layer.getClassName();\n const firstConnection = connections.length === 0 ? '' : connections[0];\n const fields: string[] = [\n `${name} (${className})`, outputShape, layer.countParams().toString(),\n firstConnection\n ];\n\n printRow(fields, positions, printFn);\n for (let i = 1; i < connections.length; ++i) {\n printRow(['', '', '', connections[i]], positions, printFn);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source layers/__init__.py */\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {deserializeKerasObject} from '../utils/generic_utils';\n\n/**\n * Instantiate a layer from a config dictionary.\n * @param config: dict of the form {class_name: str, config: dict}\n * @param custom_objects: dict mapping class names (or function names)\n * of custom (non-Keras) objects to class/functions\n * @returns Layer instance (may be Model, Sequential, Layer...)\n */\nexport function deserialize(\n config: serialization.ConfigDict,\n customObjects = {} as\n serialization.ConfigDict): serialization.Serializable {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'layer');\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Porting note: This file doesn't exist in PyKeras.\n// Its purpose here is to centralize the boundary layer between\n// tfjs-layers's internal Config TS-Centric format and PyKeras's\n// serialized Python Config format.\n\n// tslint:disable:max-line-length\nimport {serialization} from '@tensorflow/tfjs-core';\n\nimport {JsonValue} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\n// tslint:enable\n\n/**\n * Test whether a value in an array is the name of a Model or Layer.\n * @param key The key name that the value is found under. Note that the key\n * may not be at the level immediately above the value, if the value is in a\n * nested array.\n * @param index Index of the value in the Array that it is found in.\n * @param value The value object.\n * @returns A boolean indicating whether value is a name.\n */\nfunction isArrayItemInputOrOutputName(\n key: string, index: number, value: T): boolean {\n return (key === 'inboundNodes' || key === 'outputLayers' ||\n key === 'inputLayers') &&\n index === 0 && typeof value === 'string';\n}\n\n/**\n * Convert a Pythonic config object to TypeScript config object.\n * @param pythonicConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertPythonicToTs(\n pythonicConfig: JsonValue, key?: string): serialization.ConfigDictValue {\n if (pythonicConfig === null) {\n return null;\n } else if (typeof pythonicConfig === 'string') {\n return generic_utils.toCamelCase(pythonicConfig);\n } else if (\n (typeof pythonicConfig === 'number') ||\n (typeof pythonicConfig === 'boolean')) {\n return pythonicConfig;\n } else if (pythonicConfig instanceof Array) {\n const tsArray = [];\n const arrayLength = pythonicConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = pythonicConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n tsArray.push(item);\n } else {\n tsArray.push(convertPythonicToTs(item, key));\n }\n }\n return tsArray;\n } else {\n const tsDict: serialization.ConfigDict = {};\n for (const pythonicKey of Object.keys(pythonicConfig)) {\n const pythonicValue = pythonicConfig[pythonicKey];\n if (pythonicKey === 'name' && typeof pythonicValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of Model and Layer instances, should not undergo the\n // camel-case conversion.\n tsDict[pythonicKey] = pythonicValue;\n } else {\n const tsKey = generic_utils.toCamelCase(pythonicKey);\n tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey);\n }\n }\n return tsDict;\n }\n}\n\n/**\n * Convert a TypeScript config object to Python config object.\n * @param tsConfig The config object to convert.\n * @param key Optional key name of the object being converted.\n * @returns Result of the conversion.\n */\nexport function convertTsToPythonic(\n tsConfig: serialization.ConfigDictValue, key?: string): JsonValue {\n if (tsConfig === null || tsConfig === undefined) {\n return null;\n } else if (typeof tsConfig === 'string') {\n return generic_utils.toSnakeCase(tsConfig);\n } else if (\n (typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) {\n return tsConfig;\n } else if (tsConfig instanceof Array) {\n const pyArray = [];\n const arrayLength = tsConfig.length;\n for (let i = 0; i < arrayLength; ++i) {\n const item = tsConfig[i];\n if (isArrayItemInputOrOutputName(key, i, item)) {\n pyArray.push(item);\n } else {\n pyArray.push(convertTsToPythonic(item, key));\n }\n }\n return pyArray;\n } else {\n const pyDict: serialization.ConfigDict = {};\n for (const tsKey of Object.keys(tsConfig)) {\n const tsValue = tsConfig[tsKey];\n const pyKey = generic_utils.toSnakeCase(tsKey);\n if ((tsKey === 'name' || tsKey === 'className') &&\n typeof tsValue === 'string') {\n // Special case the 'name' key with a string value. Name values, such as\n // the names of Model and Layer instances, should not undergo the\n // snake-case conversion.\n pyDict[pyKey] = tsValue;\n } else {\n pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey);\n }\n }\n return pyDict;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/engine/topology.py */\n\n// tslint:disable:max-line-length\nimport {Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {getUid} from '../backend/state';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {deserialize as deserializeLayer} from '../layers/serialization';\nimport {JsonDict, Kwargs, NamedTensorMap, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {convertTsToPythonic} from '../utils/serialization_utils';\nimport * as types_utils from '../utils/types_utils';\nimport {batchSetValue, LayerVariable} from '../variables';\nimport {version as layersVersion} from '../version';\n\nimport {InputLayer} from './input_layer';\nimport {Layer, Node, SymbolicTensor} from './topology';\n// tslint:enable:max-line-length\n\n/**\n * Converts layers weights to a format suitable for TensorFlow.js Layers.\n *\n * Porting Note: The function `preprocess_weights_for_loading()` in PyKeras\n * performs conversion from Keras 1 to Keras 2. But in TypeScript, we\n * require Keras version to be 2. Thus this conversion is not applicable. We\n * simply check the Keras version and pass the weights through.\n *\n * @param layer Layer instance.\n * @param weights Input weights.\n * @param originalKerasVersion Keras version for the weights.\n * @param originalBackend Keras backend the weights were trained with.\n * @returns Output weights as Tensors.\n */\nfunction preprocessWeightsForLoading(\n layer: Layer, weights: LayerVariable[], originalKerasVersion?: string,\n originalBackend?: string): LayerVariable[] {\n if (!originalKerasVersion.startsWith('2.')) {\n throw new ValueError(\n 'Unsupported Keras version in weights being loaded: ' +\n originalKerasVersion);\n }\n return weights;\n}\n\n/**\n * Create an Tensor from info about dtype, shape and values.\n * @param dtype DType string.\n * @param shape Shape.\n * @param value Values of the array, as a scalar or nested Array of proper\n * shape.\n * @returns An Tensor instance.\n */\n// tslint:disable-next-line:no-any\nfunction loadTensor(dtype: string, shape: Shape, value: any): Tensor {\n const dataType = generic_utils.stringToDType(dtype);\n return Tensor.make(\n shape, {values: shape.length === 0 ? value : util.flatten(value)},\n dataType);\n}\n\n// TODO(cais): Maybe remove the following (b/74015805).\n/**\n * Load weights from a weights JSON object to an array of layers.\n *\n * Porting Note: This is ported from the Python function\n * load_weights_from_hdf5_group_by_name()\n *\n * @param weightsJSON. The input JSON object represent the weights from a\n * trained Keras model. See scripts/pykeras.py for more details.\n * @param layers An array of target layers.\n * @param skipMismatch Whether to skip loading of layers where there is a\n * mismatch in the number of weights, or a mismatch in the shape of the\n * weights.\n */\nexport function loadWeightsFromJson(\n weightsJSON: JsonDict, layers: Layer[], skipMismatch = false): void {\n const originalKerasVersion = weightsJSON['keras_version'] as string;\n const originalBackend = weightsJSON['backend'] as string;\n const layerNames = layers.map(layer => layer.name);\n\n // Reverse index of layer name to list of layers with name.\n const index: {[layerName: string]: Layer[]} = {};\n for (const layer of layers) {\n if (layer.name != null) {\n if (index[layer.name] == null) {\n index[layer.name] = [];\n }\n index[layer.name].push(layer);\n }\n }\n\n // tslint:disable-next-line:no-any\n const nameToWeights = weightsJSON['weights'] as {[name: string]: any};\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (let k = 0; k < layerNames.length; ++k) {\n const name = layerNames[k];\n let layerWeights = nameToWeights[name];\n if (layerWeights == null) {\n layerWeights = [];\n }\n\n let weightValues: LayerVariable[] = [];\n for (let n = 0; n < layerWeights.length; ++n) {\n // tslint:disable:no-any\n const weightEntry =\n layerWeights[n] as {[key: string]: string | Shape | any};\n // tslint:enable\n weightValues.push(new LayerVariable(loadTensor(\n weightEntry['dtype'], weightEntry['shape'] as Shape,\n weightEntry['value'])));\n }\n for (const layer of index[name]) {\n const symbolicWeights = layer.weights;\n weightValues = preprocessWeightsForLoading(\n layer, weightValues, originalKerasVersion, originalBackend);\n if (weightValues.length !== symbolicWeights.length) {\n if (skipMismatch) {\n console.warn(\n `Skipping loading of weights of layer ${layer.name} ` +\n `due to mismatch in number of weights: (${weightValues.length} ` +\n `vs ${symbolicWeights.length}).`);\n } else {\n throw new ValueError(\n `Layer #${k} (named \"${layer.name}\") expects ` +\n `${symbolicWeights.length} weight(s), but the saved weights ` +\n `have ${weightValues.length} element(s).`);\n }\n }\n\n // Set values.\n for (let i = 0; i < weightValues.length; ++i) {\n if (skipMismatch) {\n if (!util.arraysEqual(\n symbolicWeights[i].shape, weightValues[i].shape)) {\n console.warn(\n `Skipping loading of weights for layer ${layer.name} due ` +\n `to mismatch in shape (${symbolicWeights[i].shape} vs ` +\n `${weightValues[i].shape})`);\n continue;\n }\n }\n weightValueTuples.push([symbolicWeights[i], weightValues[i].read()]);\n }\n }\n }\n batchSetValue(weightValueTuples);\n}\n\n/**\n * Load weights from a named tensor map.\n *\n * Porting Note: This is ported from the Python function\n * load_weights_from_hdf5_group_by_name()\n *\n * @param weights The named tensor map mapping names of weights to weight\n * values.\n * @param layers An array of target layers.\n */\nexport function loadWeightsFromNamedTensorMap(\n weights: NamedTensorMap, layers: Layer[]): void {\n // Make a dictionary mapping weight name to weight.\n const nameToWeight: {[name: string]: LayerVariable} = {};\n let totalWeightsCount = 0;\n for (const layer of layers) {\n for (const weight of layer.weights) {\n if (nameToWeight[weight.originalName] != null) {\n throw new ValueError(`Duplicate weight name: ${weight.originalName}`);\n }\n nameToWeight[weight.originalName] = weight;\n totalWeightsCount++;\n }\n }\n\n const weightValueTuples: Array<[LayerVariable, Tensor]> = [];\n for (const name in weights) {\n weightValueTuples.push([nameToWeight[name], weights[name]]);\n delete nameToWeight[name];\n }\n\n // Check that all weights are set.\n const unsetNames: string[] = [];\n for (const name in nameToWeight) {\n unsetNames.push(name);\n }\n if (unsetNames.length > 0) {\n throw new ValueError(\n `${unsetNames.length} of ${totalWeightsCount} weights are not set: ` +\n `${unsetNames}`);\n }\n\n batchSetValue(weightValueTuples);\n}\n\n/** Constructor config for Container. */\nexport interface ContainerConfig {\n inputs: SymbolicTensor|SymbolicTensor[];\n outputs: SymbolicTensor|SymbolicTensor[];\n name?: string;\n}\n\n/**\n * A Container is a directed acyclic graph of layers.\n *\n * It is the topological form of a \"model\". A Model\n * is simply a Container with added training routines.\n *\n */\nexport abstract class Container extends Layer {\n inputs: SymbolicTensor[];\n outputs: SymbolicTensor[];\n\n inputLayers: Layer[];\n inputLayersNodeIndices: number[];\n inputLayersTensorIndices: number[];\n\n outputLayers: Layer[];\n outputLayersNodeIndices: number[];\n outputLayersTensorIndices: number[];\n\n layers: Layer[];\n layersByDepth: {[depth: string]: Layer[]};\n nodesByDepth: {[depth: string]: Node[]};\n\n containerNodes = new Set();\n\n // TODO(michaelterry): Add cache support\n // private outputMaskCache: any;\n // private outputTensorCache: any;\n // private outputShapeCache: any;\n\n inputNames: string[];\n outputNames: string[];\n feedInputShapes: Shape[];\n\n protected internalInputShapes: Shape[];\n protected internalOutputShapes: Shape[];\n // TODO(cais): Maybe 'feed' should not in the names of these variables,\n // due to the fact that our backend is not symbolic.\n protected feedInputNames: string[];\n protected feedOutputNames: string[];\n\n constructor(config: ContainerConfig) {\n // No args passed to super's constructor.\n super({});\n this.name = config.name;\n if (this.name == null) {\n const prefix = this.getClassName().toLowerCase();\n this.name = getUid(prefix);\n }\n\n this.supportsMasking = false;\n this.trainable = true;\n this.updatable = true;\n\n // TODO(michaelterry): Initialize perInputLosses/Updates here.\n\n // Container-specific properties.\n if (Array.isArray(config.inputs)) {\n this.inputs = config.inputs.slice();\n } else {\n this.inputs = [config.inputs];\n }\n if (Array.isArray(config.outputs)) {\n this.outputs = config.outputs.slice();\n } else {\n this.outputs = [config.outputs];\n }\n\n // Check for redundancy in inputs.\n if (generic_utils.unique(this.inputs).length !== this.inputs.length) {\n throw new ValueError(\n 'The list of inputs passed to the model is ' +\n 'redundant. All inputs should only appear once. Found: ' +\n this.inputs.map(x => x.name));\n }\n\n // Check for redundancy in outputs.\n if (generic_utils.unique(this.outputs).length !== this.outputs.length) {\n console.warn(\n 'The list of outputs passed to the model is redundant. ' +\n 'All outputs should only appear once. Found: ' +\n this.outputs.map(x => x.name));\n }\n\n /*\n List of initial layers (1 to 1 mapping with this.inputs, hence the same\n layer might appear twice)\n */\n this.inputLayers = [];\n this.inputLayersNodeIndices = [];\n this.inputLayersTensorIndices = [];\n /*\n List of layers (1 to 1 mapping with this.outputs, hence the same layer\n might appear twice)\n */\n this.outputLayers = [];\n this.outputLayersNodeIndices = [];\n this.outputLayersTensorIndices = [];\n /*\n All layers in order of horizontal graph traversal. Entries are unique.\n Includes input and output layers.\n */\n this.layers = [];\n\n // TODO(michaelterry): Determine if caching still needed with eager\n // backend.\n /*\n This is for performance optimization when calling the Container on new\n inputs. Every time the Container is called on a set on input tensors,\n we compute the output tensors, output masks and output shapes in one pass,\n then cache them here. When one of these outputs is queried later,\n we retrieve it from there instead of recomputing it.\n */\n // this.outputTensorCache = {};\n // this.outputShapeCache = {};\n\n // Build this.outputLayers:\n for (const x of this.outputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n this.outputLayers.push(layer as Layer);\n this.outputLayersNodeIndices.push(nodeIndex);\n this.outputLayersTensorIndices.push(tensorIndex);\n }\n\n // TODO(michaelterry): Add output mask cache code.\n\n // Build this.inputLayers:\n for (const x of this.inputs) {\n const layer = x.sourceLayer;\n const nodeIndex = x.nodeIndex;\n const tensorIndex = x.tensorIndex;\n /*\n It's supposed to be an input layer, so only one node\n and one tensor output.\n */\n generic_utils.assert(nodeIndex === 0, 'input layer has >1 nodes');\n generic_utils.assert(tensorIndex === 0, 'input layer has >1 tensors');\n this.inputLayers.push(layer as Layer);\n this.inputLayersNodeIndices.push(nodeIndex);\n this.inputLayersTensorIndices.push(tensorIndex);\n }\n\n // Build this.inputNames and this.outputNames.\n this.inputNames = [];\n this.outputNames = [];\n this.feedInputShapes = [];\n this.feedInputNames = [];\n this.feedOutputNames = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n // Check that layer is an InputLayer.\n if (!(layer instanceof InputLayer)) {\n throw new TypeError(\n 'Input layers to a Model must be InputLayer objects. ' +\n `Received inputs: ${config.inputs}. ` +\n `Input ${i} (0-based) originates ` +\n `from layer type ${layer.getClassName()}.`);\n }\n this.inputNames.push(layer.name);\n this.feedInputShapes.push(layer.batchInputShape);\n\n this.feedInputNames.push(layer.name);\n }\n for (const layer of this.outputLayers) {\n this.outputNames.push(layer.name);\n }\n\n this.internalInputShapes = this.inputs.map(x => x.shape);\n this.internalOutputShapes = this.outputs.map(x => x.shape);\n\n /*\n Container_nodes: set of nodes included in the graph (not all nodes\n included in the layers are relevant to the current graph).\n */\n // ids of all nodes relevant to the Container:\n const nodesDepths: {[nodeID: string]: number} = {};\n // To recover nodes from their ID.\n const nodeIDToNode: {[nodeID: string]: Node} = {};\n const layersDepths: {[layerID: string]: number} = {};\n // To layers from their ID.\n const layerIDToLayer: {[layerID: string]: Layer} = {};\n const layerIndices: {[layerID: string]: number} = {};\n const nodesInDecreasingDepth: Node[] = [];\n\n /**\n * Builds a map of the graph of layers.\n *\n * This recursively updates the map `layerIndices`,\n * the list `nodesInDecreasingDepth` and the set `containerNodes`.\n *\n * @param tensor Some tensor in a graph.\n * @param finishedNodes Set of nodes whose subgraphs have been traversed\n * completely. Useful to prevent duplicated work.\n * @param nodesInProgress Set of nodes that are currently active on the\n * recursion stack. Useful to detect cycles.\n * @param layer Layer from which `tensor` comes from. If not provided,\n * will be obtained from tensor.sourceLayer.\n * @param nodeIndex Node index from which `tensor` comes from.\n * @param tensorIndex TensorIndex from which `tensor` comes from.\n *\n * @exception RuntimeError if a cycle is detected.\n */\n const buildMapOfGraph =\n (tensor: SymbolicTensor, finishedNodes: Node[], nodesInProgress: Node[],\n layer?: Layer, nodeIndex?: number, tensorIndex?: number) => {\n if (layer == null || nodeIndex == null || tensorIndex == null) {\n layer = tensor.sourceLayer as Layer;\n nodeIndex = tensor.nodeIndex;\n tensorIndex = tensor.tensorIndex;\n }\n const node = layer.inboundNodes[nodeIndex];\n\n // Prevent cycles.\n if (nodesInProgress.indexOf(node) !== -1) {\n throw new RuntimeError(\n `The tensor ${tensor.name} at layer \"${layer.name}\" ` +\n 'is part of a cycle.');\n }\n\n // Don't repeat work for shared subgraphs\n if (finishedNodes.indexOf(node) !== -1) {\n return;\n }\n\n // Update containerNodes.\n this.containerNodes.add(Container.nodeKey(layer, nodeIndex));\n\n // Store the traversal order for layer sorting.\n if (!(layer.id in layerIndices)) {\n layerIndices[layer.id] = Object.keys(layerIndices).length;\n }\n\n if (nodesInProgress.indexOf(node) === -1) {\n nodesInProgress.push(node);\n }\n\n // Propagate to all previous tensors connected to this node.\n const numInboundLayers = node.inboundLayers.length;\n for (let i = 0; i < numInboundLayers; i++) {\n const x = node.inputTensors[i];\n const layer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n buildMapOfGraph(\n x, finishedNodes, nodesInProgress, layer, nodeIndex,\n tensorIndex);\n }\n finishedNodes.push(node);\n while (nodesInProgress.indexOf(node) >= 0) {\n nodesInProgress.splice(nodesInProgress.indexOf(node), 1);\n }\n nodesInDecreasingDepth.push(node);\n };\n\n const finishedNodes: Node[] = [];\n const nodesInProgress: Node[] = [];\n for (const x of this.outputs) {\n buildMapOfGraph(x, finishedNodes, nodesInProgress);\n }\n\n const reversedNodesInDecreasingDepth =\n nodesInDecreasingDepth.slice().reverse();\n for (const node of reversedNodesInDecreasingDepth) {\n nodeIDToNode[node.id] = node;\n // If the depth is not set, the node has no outbound nodes (depth 0).\n if (!(node.id in nodesDepths)) {\n nodesDepths[node.id] = 0;\n }\n let depth = nodesDepths[node.id];\n\n // Update the depth of the corresponding layer\n const previousDepth =\n (layersDepths[node.outboundLayer.id] == null ?\n 0 :\n layersDepths[node.outboundLayer.id]);\n\n /*\n If we've seen this layer before at a higher depth, we should use that\n depth instead of the node depth. This is necessary for shared layers\n that have inputs at different depth levels in the graph.\n */\n depth = Math.max(depth, previousDepth);\n layersDepths[node.outboundLayer.id] = depth;\n layerIDToLayer[node.outboundLayer.id] = node.outboundLayer;\n nodesDepths[node.id] = depth;\n\n // Update the depth of inbound nodes.\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const inboundNode = inboundLayer.inboundNodes[nodeIndex];\n const previousDepth =\n (nodesDepths[inboundNode.id] == null ? 0 :\n nodesDepths[inboundNode.id]);\n nodesDepths[inboundNode.id] = Math.max(depth + 1, previousDepth);\n nodeIDToNode[inboundNode.id] = inboundNode;\n }\n }\n\n // Build a dict {depth: list of nodes with this depth}\n const nodesByDepth: {[depth: string]: Node[]} = {};\n for (const nodeID in nodesDepths) {\n const depth = nodesDepths[nodeID];\n if (!(depth in nodesByDepth)) {\n nodesByDepth[depth] = [];\n }\n nodesByDepth[depth].push(nodeIDToNode[nodeID]);\n }\n\n // Build a dict {depth: list of layers with this depth}\n const layersByDepth: {[depth: string]: Layer[]} = {};\n for (const layerID in layersDepths) {\n const depth = layersDepths[layerID];\n if (!(depth in layersByDepth)) {\n layersByDepth[depth] = [];\n }\n layersByDepth[depth].push(layerIDToLayer[layerID]);\n }\n\n // Get sorted list of layer depths.\n let depthKeys = Object.keys(layersByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Set this.layers and this.layersByDepth.\n this.layers = [];\n for (const depth of depthKeys) {\n const layersForDepth = layersByDepth[depth];\n // Container.layers needs to have a deterministic order:\n // here we order them by traversal order.\n layersForDepth.sort((a, b) => {\n const aIndex = layerIndices[a.id];\n const bIndex = layerIndices[b.id];\n if (aIndex < bIndex) {\n return -1;\n }\n if (aIndex > bIndex) {\n return 1;\n }\n return 0;\n });\n for (const layer of layersForDepth) {\n this.layers.push(layer);\n }\n }\n this.layersByDepth = layersByDepth;\n\n // Get sorted list of node depths;\n depthKeys = Object.keys(nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n\n // Check that all tensors required are computable.\n // computable_tensors: all tensors in the graph\n // that can be computed from the inputs provided.\n const computableTensors = this.inputs.slice();\n\n // To provide a better error msg.\n const layersWithCompleteInput: string[] = [];\n for (const depth of depthKeys) {\n for (const node of nodesByDepth[depth]) {\n const layer = node.outboundLayer;\n if (layer != null) {\n for (const x of node.inputTensors) {\n if (computableTensors.indexOf(x) === -1) {\n throw new RuntimeError(\n `Graph disconnected: cannot obtain value for tensor ${x}` +\n ` at layer \"${layer.name}\". ` +\n 'The following previous layers were accessed without ' +\n `issue: ${layersWithCompleteInput}`);\n }\n }\n for (const x of node.outputTensors) {\n computableTensors.push(x);\n }\n layersWithCompleteInput.push(layer.name);\n }\n }\n }\n\n // Set this.containerNodes and this.nodesByDepth.\n this.nodesByDepth = nodesByDepth;\n\n // Ensure name unicity, which will be crucial for serialization\n // (since serialized nodes refer to layers by their name).\n const allNames = this.layers.map(x => x.name);\n for (const name of allNames) {\n const numOccurrences = allNames.filter(x => x === name).length;\n if (numOccurrences !== 1) {\n throw new RuntimeError(\n `The name \"${name}\" is used ${numOccurrences} times ` +\n 'in the model. All layer names should be unique. Layer names: ' +\n JSON.stringify(allNames));\n }\n }\n\n // Layer parameters.\n // The new container starts with a single inbound node\n // for its inputs, and no outbound nodes.\n // Will be appended to by future calls to apply().\n this.outboundNodes = [];\n // Will be appended to below, and by future calls to apply().\n this.inboundNodes = [];\n\n // Create the node linking internal inputs to internal outputs.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n inputMasks: this.inputs.map(x => null),\n outputMasks: this.outputs.map(x => null),\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs.map(x => x.shape)\n });\n this.built = true;\n }\n\n get trainableWeights(): LayerVariable[] {\n // Porting Note: This check below is to prevent errors where the\n // _trainableWeights inherited from the parent class (Layer) gets\n // inadvertently used.\n if (this._trainableWeights.length > 0) {\n throw new ValueError(\n 'Container instance unexpectedly contains _trainableWeights.' +\n 'The trainable weights of a Container are a union of the ' +\n 'trainable weights of its consituent Layers. Its own ' +\n '_trainableWeights must remain an empty Array.');\n }\n\n if (!this.trainable) {\n return [];\n }\n let weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights = weights.concat(layer.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const layer of this.layers) {\n weights.push(...layer.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const layer of this.layers) {\n trainableWeights.push(...layer.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n get weights(): LayerVariable[] {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }\n\n /**\n * Loads all layer weights from a JSON object.\n *\n * Porting Note: HDF5 weight files cannot be directly loaded in JavaScript /\n * TypeScript. The utility script at `scripts/pykeras.py` offers means\n * to convert them into JSON strings compatible with this method.\n * Porting Note: TensorFlow.js Layers supports only loading by name currently.\n *\n * @param weightsJSON A JSON mapping weight names to weight values as nested\n * arrays of numbers, or a `NamedTensorMap`, i.e., a JSON mapping weight\n * names to `Tensor` objects.\n * @param skipMismatch Whether to skip loading of layers where there is a\n * mismatch in the number of weights, or a mismatch in the shape of the\n * weight (only valid when `by_name`=True).\n * @param isNamedTensorMap Whether the 1st argument (`weightsJSON`) is a\n * `NamedTensorMap`.\n */\n loadWeights(\n weightsJSON: JsonDict|NamedTensorMap, skipMismatch = false,\n isNamedTensorMap = false) {\n // TODO(cais): Maybe the JsonDict support should be removed after serving\n // weights from XHR is working. If so, the `loadWeightsFromJson` flag\n // should be removed as well. (b/74015805)\n // TODO(cais): See if we can use smarter type resolution to avoid sending\n // the type info as a separate arg (isNamedTensormap).\n if (isNamedTensorMap) {\n loadWeightsFromNamedTensorMap(weightsJSON as NamedTensorMap, this.layers);\n } else {\n loadWeightsFromJson(weightsJSON as JsonDict, this.layers, skipMismatch);\n }\n }\n\n /**\n * Util shared between different serialization methods.\n * @returns Model config with Keras version information added.\n */\n private updatedConfig(): serialization.ConfigDict {\n const theConfig = this.getConfig();\n const modelConfig: serialization.ConfigDict = {\n className: this.getClassName(),\n config: theConfig,\n kerasVersion: `tfjs-layers ${layersVersion}`,\n // TODO(nielsene): Replace something like K.backend() once\n // possible.\n backend: 'TensorFlow.js'\n };\n return modelConfig;\n }\n\n /**\n * Returns a JSON string containing the network configuration.\n *\n * To load a network from a JSON save file, use\n * models.modelFromJSON(jsonString);\n * @param extraJsonArgs Unused in tfjs-layers, maintained for PyKeras\n * @param returnString Whether the return value should be stringified\n * (default: `true`).\n * @returns a JSON string if `returnString` (default), or a JSON object if\n * `!returnString`.\n */\n // tslint:disable-next-line:no-any\n toJSON(unused?: any, returnString = true): string|JsonDict {\n const modelConfig = convertTsToPythonic(this.updatedConfig()) as JsonDict;\n return returnString ? JSON.stringify(modelConfig) : modelConfig;\n }\n\n /**\n * Call the model on new inputs.\n *\n * In this case `call` just reapplies all ops in the graph to the new inputs\n * (e.g. build a new computational graph from the provided inputs).\n *\n * @param inputs A tensor or list of tensors.\n * @param mask A mask or list of masks. A mask can be either a tensor or null\n * (no mask).\n *\n * @return A tensor if there is a single output, or a list of tensors if there\n * are more than one outputs.\n */\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n\n if ('mask' in kwargs) {\n masks = generic_utils.toList(kwargs['mask']);\n } else {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n // TODO(michaelterry): Add support for caching.\n return this.runInternalGraph(inputs, masks)[0];\n });\n }\n\n /**\n * Computes an output mask tensor.\n *\n * @param inputs Tensor or list of tensors.\n * @param mask Tensor or list of tensors.\n *\n * @return null or a tensor (or list of tensors, one per output tensor of the\n * layer).\n */\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor\n |Tensor[] {\n return tidy(() => {\n inputs = generic_utils.toList(inputs);\n let masks: Tensor[];\n if (mask == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n } else {\n masks = generic_utils.toList(mask);\n }\n // TODO(michaelterry): Add support for mask caching.\n return this.runInternalGraph(inputs, masks)[1];\n });\n }\n\n /**\n * Computes the output shape of the layer.\n *\n * Assumes that the layer will be built to match that input shape provided.\n *\n * @param inputShape A shape (tuple of integers) or a list of shape tuples\n * (one per output tensor of the layer). Shape tuples can include null for\n * free dimensions, instead of an integer.\n */\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n const inputShapes = types_utils.normalizeShapeList(inputShape);\n if (inputShapes.length !== this.inputLayers.length) {\n throw new ValueError(\n `Invalid inputShape argument ${inputShape}: ` +\n `model has ${this.inputLayers.length} tensor inputs.`);\n }\n\n // TODO(michaelterry): Add caching\n const layersToOutputShapes: {[shapeKey: string]: Shape} = {};\n for (let i = 0; i < inputShapes.length; i++) {\n const layer = this.inputLayers[i];\n const inputShape = inputShapes[i];\n // It's an input layer: computeOutputShape is identity,\n // and there is only one node and one tensor output.\n const shapeKey = layer.name + '_0_0';\n layersToOutputShapes[shapeKey] = inputShape;\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n // Iterate over nodes, by depth level.\n if (depthKeys.length > 1) {\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n if (this.inputLayers.map(x => x.id).indexOf(layer.id) !== -1) {\n // We've already covered the input layers a few lines above.\n continue;\n }\n // Potentially redundant list, same size of node.inputTensors.\n const inputShapes: Shape[] = [];\n for (let j = 0; j < node.inboundLayers.length; j++) {\n const inboundLayer = node.inboundLayers[j];\n const nodeIndex = node.nodeIndices[j];\n const tensorIndex = node.tensorIndices[j];\n const shapeKey = `${inboundLayer.name}_${nodeIndex}_${tensorIndex}`;\n const inputShape = layersToOutputShapes[shapeKey];\n inputShapes.push(inputShape);\n }\n\n const outputShape = layer.computeOutputShape(\n generic_utils.singletonOrArray(inputShapes));\n\n const outputShapes = types_utils.normalizeShapeList(outputShape);\n const nodeIndex = layer.inboundNodes.indexOf(node);\n for (let j = 0; j < outputShapes.length; j++) {\n const shapeKey = `${layer.name}_${nodeIndex}_${j}`;\n layersToOutputShapes[shapeKey] = outputShapes[j];\n }\n }\n }\n }\n\n // Read final output shapes from layersToOutputShapes.\n const outputShapes: Shape[] = [];\n const outputShapeKeys: string[] = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n const tensorIndex = this.outputLayersTensorIndices[i];\n const shapeKey = `${layer.name}_${nodeIndex}_${tensorIndex}`;\n outputShapeKeys.push(shapeKey);\n }\n\n for (let i = 0; i < outputShapeKeys.length; i++) {\n const key = outputShapeKeys[i];\n generic_utils.assert(key in layersToOutputShapes);\n outputShapes.push(layersToOutputShapes[key]);\n }\n\n // TODO(michaelterry): Update cache\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n /**\n * Computes output tensors for new inputs.\n *\n * Note:\n * - Expects `inputs` to be a list (potentially with 1 element).\n *\n * @param inputs List of tensors\n * @param masks List of masks (tensors or null).\n * @return Three lists: outputTensors, outputMasks, outputShapes\n */\n protected runInternalGraph(inputs: Tensor[], masks?: Tensor[]):\n [Tensor[], Tensor[], Shape[]] {\n if (masks == null) {\n masks = generic_utils.pyListRepeat(null, inputs.length);\n }\n\n // Dictionary mapping reference tensors to tuples\n // (computed tensor, compute mask)\n // we assume a 1:1 mapping from tensor to mask\n // TODO: raise exception when a `.computeMask()` call\n // does not return a list the same size as `call`\n const tensorMap: {[tensorID: string]: [Tensor, Tensor]} = {};\n for (let i = 0; i < this.inputs.length; ++i) {\n const x = this.inputs[i];\n const y = inputs[i];\n const mask = masks[i];\n tensorMap[x.id] = [y, mask];\n }\n\n const depthKeys = Object.keys(this.nodesByDepth)\n .map(x => parseInt(x, 10))\n .sort(generic_utils.reverseNumberCompare);\n for (const depth of depthKeys) {\n const nodes = this.nodesByDepth[depth];\n for (const node of nodes) {\n // This is always a single layer, never a list.\n const layer = node.outboundLayer;\n const referenceInputTensors = node.inputTensors;\n const referenceOutputTensors = node.outputTensors;\n\n // If all previous input tensors are available in tensorMap,\n // then call node.inboundLayer on them.\n // List of tuples [input, mask]:\n const computedData = new Array<[Tensor, Tensor]>();\n for (const x of referenceInputTensors) {\n if (x.id in tensorMap) {\n computedData.push(tensorMap[x.id]);\n }\n }\n if (computedData.length === referenceInputTensors.length) {\n // TODO(michaelterry): Add K.name_scope here, if we need it.\n let kwargs: Kwargs = {};\n let computedTensors: Tensor[];\n let computedMasks: Tensor[];\n let outputTensors: Tensor[];\n let outputMasks: Tensor[];\n // call layer\n if (node.callArgs != null) {\n kwargs = node.callArgs;\n }\n if (computedData.length === 1) {\n const [computedTensor, computedMask] = computedData[0];\n if (kwargs.mask == null) {\n kwargs['mask'] = computedMask;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensor, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensor, computedMask));\n computedTensors = [computedTensor];\n computedMasks = [computedMask];\n } else {\n computedTensors = computedData.map(x => x[0]);\n computedMasks = computedData.map(x => x[1]);\n if (kwargs.mask == null) {\n kwargs['mask'] = computedMasks;\n }\n outputTensors =\n generic_utils.toList(layer.call(computedTensors, kwargs));\n outputMasks = generic_utils.toList(\n layer.computeMask(computedTensors, computedMasks));\n }\n\n if (layer.activityRegularizer) {\n throw new NotImplementedError(\n 'Model invocation with concrete Tensor value(s) in the ' +\n 'presence of activity regularizer(s) is not supported yet.');\n }\n // TODO(michaelterry): Add model updates and losses\n\n // Update tensor map.\n for (let i = 0; i < referenceOutputTensors.length; ++i) {\n const x = referenceOutputTensors[i];\n const y = outputTensors[i];\n const mask = outputMasks[i];\n tensorMap[x.id] = [y, mask];\n }\n }\n }\n }\n\n const outputTensors: Tensor[] = [];\n const outputMasks: Tensor[] = [];\n const outputShapes: Shape[] = [];\n for (const x of this.outputs) {\n generic_utils.assert(\n x.id in tensorMap, `Could not compute output ${x.name} : ${x.id}`);\n const [tensor, mask] = tensorMap[x.id];\n outputShapes.push(tensor.shape);\n outputTensors.push(tensor);\n outputMasks.push(mask);\n }\n\n // TODO(michaelterry): Add support for caches.\n return [outputTensors, outputMasks, outputShapes];\n }\n\n /**\n * Builds a map of internal node keys to node ordering.\n * Used in serializaion a node orderings may change as unused nodes are\n * dropped. Porting Note: This helper method was pulled out of getConfig to\n * improve readability.\n * @param layers An array of Layers in the model.\n * @returns Map of Node Keys to index order within the layer.\n */\n private buildNodeConversionMap(layers: Layer[]): {[nodeKey: string]: number} {\n const nodeConversionMap: {[nodeKey: string]: number} = {};\n let keptNodes: number;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (nodeKey in this.containerNodes) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }\n\n /**\n * Retrieves a layer based on either its name (unique) or index.\n *\n * Indices are based on order of horizontal graph traversal (bottom-up).\n *\n * If both `name` and `index` are specified, `index` takes precedence.\n *\n * @param name Name of layer.\n * @param index Index of layer.\n * @returns A Layer instance.\n * @throws ValueError: In case of invalid layer name or index.\n */\n /**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Classes',\n * namespace: 'layers',\n * subclasses: ['Model']\n * }\n */\n getLayer(name?: string, index?: number): Layer {\n if (index != null) {\n if (this.layers.length <= index) {\n throw new ValueError(\n `Was asked to retrieve layer at index ${index}, but model only ` +\n `has ${this.layers.length} layer(s).`);\n } else {\n return this.layers[index];\n }\n } else {\n if (name == null) {\n throw new ValueError('Provide either a layer name or layer index');\n }\n }\n\n for (const layer of this.layers) {\n if (layer.name === name) {\n return layer;\n }\n }\n throw new ValueError(`No such layer: ${name}`);\n }\n\n /**\n * Retrieves the Container's current loss values.\n *\n * Used for regularizers during training.\n */\n calculateLosses(): Scalar[] {\n // Porting Node: This is an augmentation to Container.loss in PyKeras.\n // In PyKeras, Container.loss returns symbolic tensors. Here a concrete\n // Tensor (specifically Scalar) values are returned. This is due to the\n // imperative backend.\n return tidy(() => {\n const losses: Scalar[] = [];\n for (const layer of this.layers) {\n for (let nodeIndex = 0; nodeIndex < layer.inboundNodes.length;\n ++nodeIndex) {\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n losses.push(...layer.calculateLosses());\n }\n }\n }\n // TODO(cais): Add any unconditional model-level losses?\n return losses;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {name: this.name};\n\n // Build a map from layer unique name (self._node_key)\n // to the index of the nodes that are saved in the config.\n // Only nodes in container_nodes are saved.\n const nodeConversionMap: {[nodeKey: string]: number} =\n this.buildNodeConversionMap(this.layers);\n\n // Serialize and save the layers in layerConfigs\n const layerConfigs = [];\n for (const layer of this.layers) {\n const layerClassName = layer.getClassName();\n const layerConfig = layer.getConfig();\n const filteredInboundNodes = [];\n for (let originalNodeIndex = 0;\n originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const node = layer.inboundNodes[originalNodeIndex];\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n let kwargs = {};\n if (this.containerNodes.has(nodeKey)) {\n // The node is relevant to the model:\n // add to filteredInboundNodes.\n if (node.callArgs) {\n try {\n JSON.stringify(node.callArgs);\n kwargs = node.callArgs;\n } catch (err) {\n console.warn(\n `Layer ${layer.name} was passed ` +\n `non-serializable keyword arguments: ` +\n `${node.callArgs}. They will not be included ` +\n `in the serialized model (and thus will be ` +\n `missing at deserialization time).`);\n kwargs = {};\n }\n }\n if (node.inboundLayers.length > 0) {\n const nodeData = [];\n for (let i = 0; i < node.inboundLayers.length; i++) {\n const inboundLayer = node.inboundLayers[i];\n const nodeIndex = node.nodeIndices[i];\n const tensorIndex = node.tensorIndices[i];\n const nodeKey = Container.nodeKey(inboundLayer, nodeIndex);\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n nodeData.push(\n [inboundLayer.name, newNodeIndex, tensorIndex, kwargs]);\n }\n filteredInboundNodes.push(nodeData);\n }\n }\n }\n layerConfigs.push({\n name: layer.name,\n className: layerClassName,\n config: layerConfig,\n inboundNodes: filteredInboundNodes\n });\n }\n config['layers'] = layerConfigs;\n // Gather info about inputs and outputs\n const modelInputs = [];\n for (let i = 0; i < this.inputLayers.length; i++) {\n const layer = this.inputLayers[i];\n const nodeIndex = this.inputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.inputLayersTensorIndices[i];\n modelInputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['inputLayers'] = modelInputs;\n\n const modelOutputs = [];\n for (let i = 0; i < this.outputLayers.length; i++) {\n const layer = this.outputLayers[i];\n const nodeIndex = this.outputLayersNodeIndices[i];\n\n const nodeKey = Container.nodeKey(layer, nodeIndex);\n if (!this.containerNodes.has(nodeKey)) {\n continue;\n }\n let newNodeIndex = nodeConversionMap[nodeKey];\n if (newNodeIndex === null || newNodeIndex === undefined) {\n newNodeIndex = 0;\n }\n const tensorIndex = this.outputLayersTensorIndices[i];\n modelOutputs.push([layer.name, newNodeIndex, tensorIndex]);\n }\n config['outputLayers'] = modelOutputs;\n return config;\n }\n\n /**\n * Instantiates a Model from its config (output of `get_config()`).\n * @param cls: the class to create\n * @param config: Model config dictionary.\n * @returns A model instance.\n * @throws ValueError: In case of improperly formatted config dict.\n */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n // Layer instances created during\n // the graph reconstruction process\n const createdLayers: {[layerName: string]: Layer} = {};\n\n // Dictionary mapping layer instances to\n // node data that specifies a layer call.\n // It acts as a queue that maintains any unprocessed\n // layer call until it becomes possible to process it\n // (i.e. until the input tensors to the call all exist).\n const unprocessedNodes:\n {[layer: string]: serialization.ConfigDict[][]} = {};\n function addUnprocessedNode(\n layer: Layer, nodeData: serialization.ConfigDict[]) {\n if (!(layer.name in unprocessedNodes)) {\n unprocessedNodes[layer.name] = [nodeData];\n } else {\n unprocessedNodes[layer.name].push(nodeData);\n }\n }\n\n function processNode(layer: Layer, nodeData: serialization.ConfigDict[]) {\n const inputTensors: SymbolicTensor[] = [];\n let kwargs;\n for (const inputData of nodeData) {\n const inboundLayerName = inputData[0] as string;\n const inboundNodeIndex = inputData[1] as number;\n const inboundTensorIndex = inputData[2] as number;\n if (inputData.length === 3) {\n kwargs = {};\n } else if (inputData.length === 4) {\n kwargs = inputData[3] as serialization.ConfigDict;\n } else {\n throw new ValueError(`Improperly formatted model config for layer ${\n JSON.stringify(layer)}: ${JSON.stringify(inputData)}`);\n }\n if (!(inboundLayerName in createdLayers)) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundLayer = createdLayers[inboundLayerName];\n if (inboundLayer.inboundNodes.length <= inboundNodeIndex) {\n addUnprocessedNode(layer, nodeData);\n return;\n }\n const inboundNode = inboundLayer.inboundNodes[inboundNodeIndex];\n inputTensors.push(inboundNode.outputTensors[inboundTensorIndex]);\n }\n // Call layer on its inputs, thus creating the node\n // and building the layer if needed.\n // Note: This has Eager vs Graph Implications.\n if (inputTensors.length > 0) {\n layer.apply(\n generic_utils.singletonOrArray(inputTensors),\n kwargs); // was ** kwargs\n }\n }\n\n /**\n * Deserialize a layer, then call it on appropriate inputs.\n * @param layerData: layer config dict.\n * @throws ValueError: In case of improperly formatted `layer_data`\n * dict.\n */\n function processLayer(layerData: serialization.ConfigDict|null) {\n const layerName = layerData.name as string;\n // Instantiate layer.\n const layer = deserializeLayer(\n layerData,\n config.customObjects != null ?\n config.customObjects as serialization.ConfigDict :\n {}) as Layer;\n createdLayers[layerName] = layer;\n // Gather layer inputs.\n const inboundNodesData =\n layerData.inboundNodes as serialization.ConfigDict[];\n for (const nodeData of inboundNodesData) {\n if (!(nodeData instanceof Array)) {\n throw new ValueError(\n `Corrupted configuration, expected array for nodeData: ${\n nodeData}`);\n }\n // We don't process nodes (i.e. make layer calls)\n // on the fly because the inbound node may not yet exist,\n // in case of layer shared at different topological depths\n // (e.g.a model such as A(B(A(B(x)))))\n addUnprocessedNode(layer, nodeData);\n }\n }\n\n // First, we create all layers and enqueue nodes to be processed\n const name = config.name;\n const layersFromConfig = config.layers as serialization.ConfigDict[];\n for (const layerData of layersFromConfig) {\n processLayer(layerData);\n }\n\n // Then we process nodes in order of layer depth.\n // Nodes that cannot yet be processed(if the inbound node\n // does not yet exist) are re - enqueued, and the process\n // is repeated until all nodes are processed.\n while (!generic_utils.isObjectEmpty(unprocessedNodes)) {\n for (const layerData of layersFromConfig) {\n const layer = createdLayers[layerData.name as string];\n if (layer.name in unprocessedNodes) {\n for (const nodeData of unprocessedNodes[layer.name]) {\n processNode(layer, nodeData);\n }\n delete unprocessedNodes[layer.name];\n }\n }\n }\n const inputTensors: SymbolicTensor[] = [];\n const outputTensors: SymbolicTensor[] = [];\n const inputLayersFromConfig =\n config.inputLayers as serialization.ConfigDict[];\n for (const layerData of inputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n inputTensors.push(layerOutputTensors[tensorIndex]);\n }\n const outputLayersFromConfig =\n config.outputLayers as serialization.ConfigDict[];\n for (const layerData of outputLayersFromConfig) {\n const layerName = layerData[0] as string;\n const nodeIndex = layerData[1] as number;\n const tensorIndex = layerData[2] as number;\n generic_utils.assert(layerName in createdLayers);\n const layer = createdLayers[layerName];\n const layerOutputTensors = layer.inboundNodes[nodeIndex].outputTensors;\n outputTensors.push(layerOutputTensors[tensorIndex]);\n }\n return new cls({inputs: inputTensors, outputs: outputTensors, name});\n }\n\n /**\n * Determine whether the container is stateful.\n *\n * Porting Note: this is the equivalent of the stateful @property of\n * the Container class in PyKeras.\n */\n get stateful(): boolean {\n // Porting Note: This check is to prevent inadvertent setting of the\n // _stateful property of the Container instance.\n if (this._stateful) {\n throw new ValueError(\n 'Container instance unexpectedly has _stateful = true. The ' +\n 'statefulness of a Container is determined by the Layers it ' +\n 'contains. Its _stateful property must remain the default false.');\n }\n for (const layer of this.layers) {\n if (layer.stateful) {\n return true;\n }\n }\n return false;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Executor: Evaluates SymbolicTensor based on feeds.\n */\n\nimport {cast, Tensor} from '@tensorflow/tfjs-core';\n\nimport {ValueError} from '../errors';\nimport {Kwargs} from '../types';\n\nimport {InputLayer} from './input_layer';\nimport {SymbolicTensor} from './topology';\n\n/**\n * Helper function to check the dtype and shape compatibility of a feed value.\n */\nfunction assertFeedCompatibility(key: SymbolicTensor, val: Tensor): Tensor {\n // 1. Check shape compatibility. If shapes are not compatible, error.\n if (key.shape != null) {\n if (key.shape.length !== val.shape.length) {\n throw new ValueError(\n `The rank of feed (${val.shape.length}) does not match the rank of ` +\n `the key (${key.shape.length}).`);\n }\n\n for (let i = 0; i < key.shape.length; ++i) {\n if (key.shape[i] != null && key.shape[i] !== val.shape[i]) {\n throw new ValueError(\n `The ${i}-th dimension of the feed (${val.shape[i]}) is ` +\n `incompatible with that of the key (${key.shape[i]}).`);\n }\n }\n }\n // 2. Check dtype compatibility.\n if (key.dtype == null || key.dtype === val.dtype) {\n // 2a. If types match, return val tensor as is.\n return val;\n }\n try {\n // 2b. Attempt to convert to expected type.\n return cast(val, key.dtype);\n } catch (err) {\n // 2c. If conversion fails, return helpful error.\n throw new ValueError(\n `The dtype of the feed (${val.dtype}) can not be cast to the dtype ` +\n `of the key '${key.name}' (${key.dtype}).`);\n }\n}\n\n/**\n * A concrete Tensor value for a symbolic tensor as the key.\n */\nexport interface Feed {\n key: SymbolicTensor;\n value: Tensor;\n}\n\n/**\n * FeedDict: A mapping from unique SymbolicTensors to feed values for them.\n * A feed value is a concrete value represented as an `Tensor`.\n */\nexport class FeedDict {\n private id2Value: {[id: number]: Tensor} = {};\n\n /**\n * Constructor, optionally does copy-construction.\n * @param feeds An Array of `Feed`s, or another `FeedDict`, in which case\n * copy-construction will be performed.\n */\n constructor(feeds?: Feed[]|FeedDict) {\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n }\n } else {\n if (feeds == null) {\n return;\n }\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }\n\n /**\n * Add a key-value pair to the FeedDict.\n * @param key The key of the feed.\n * @param value The value of the feed.\n * @returns This `FeedDict`.\n * @throws ValueError: If the key `SymbolicTensor` already exists in the\n * `FeedDict`.\n */\n add(key: SymbolicTensor, value: Tensor): FeedDict {\n if (this.id2Value[key.id] == null) {\n this.id2Value[key.id] = assertFeedCompatibility(key, value);\n } else {\n throw new ValueError(`Duplicate key: name=${key.name}, id=${key.id}`);\n }\n return this;\n }\n\n /**\n * Add a Feed to the FeedDict.\n * @param feed The new `Feed` to add.\n * @returns This `FeedDict`.\n */\n addFeed(feed: Feed) {\n this.add(feed.key, feed.value);\n }\n\n /**\n * Probe whether a key already exists in the FeedDict.\n * @param key\n */\n hasKey(key: SymbolicTensor): boolean {\n return this.id2Value[key.id] != null;\n }\n\n /**\n * Get the feed value for given key.\n * @param key\n * @returns If `key` exists, the corresponding feed value.\n * @throws ValueError: If `key` does not exist in this `FeedDict`.\n */\n getValue(key: SymbolicTensor): Tensor {\n if (this.id2Value[key.id] == null) {\n throw new ValueError(`Nonexistent key: ${JSON.stringify(key)}`);\n } else {\n return this.id2Value[key.id];\n }\n }\n}\n\n/**\n * Execute a SymbolicTensor by using concrete feed values.\n *\n * A `SymbolicTensor` object is a node in a computation graph of TF.js\n * Layers. The object is backed by a source layer and input\n * `SymbolicTensor`s to the source layer. This method evaluates\n * the `call()` method of the source layer, using concrete values of the inputs\n * obtained from either\n * * `feedDict`, if the input key exists in `feedDict`, or else,\n * * a recursive call to `execute()` itself.\n *\n * @param x: The `SymbolicTensor` to execute.\n * @param feedDict: The feed values, as base condition of the recursion.\n * execution.\n * @param kwargs: Optional keyword arguments.\n * @returns Result of the execution.\n * @throws ValueError: If any `SymbolicTensor`s from `InputLayer`s\n * encountered during the execution lacks a feed value in `feedDict`.\n */\nexport function execute(\n fetches: SymbolicTensor|SymbolicTensor[], feedDict: FeedDict,\n kwargs?: Kwargs): Tensor|Tensor[]|[Tensor | Tensor[]] {\n const arrayFetches = Array.isArray(fetches);\n const fetchArray: SymbolicTensor[] =\n arrayFetches ? fetches as SymbolicTensor[] : [fetches as SymbolicTensor];\n\n const outputs: Tensor[] = [];\n const internalFeedDict = new FeedDict(feedDict);\n\n for (const fetch of fetchArray) {\n outputs.push(executeInternal(fetch, internalFeedDict, kwargs) as Tensor);\n }\n return arrayFetches ? outputs : outputs[0];\n}\n\nfunction executeInternal(\n fetch: SymbolicTensor, internalFeedDict: FeedDict,\n kwargs?: Kwargs): Tensor {\n if (internalFeedDict.hasKey(fetch)) {\n return internalFeedDict.getValue(fetch);\n }\n if (fetch.sourceLayer instanceof InputLayer) {\n throw new ValueError(\n `Missing a feed value for SymbolicTensor from InputLayer ` +\n `'${InputLayer.name}'`);\n }\n\n const inputs = fetch.inputs;\n const inputValues: Tensor[] = [];\n for (const input of inputs) {\n // Recursive call.\n const inputVal = executeInternal(input, internalFeedDict, kwargs) as Tensor;\n inputValues.push(inputVal);\n }\n\n let output =\n fetch.sourceLayer.apply(inputValues, kwargs) as Tensor | Tensor[];\n if (!Array.isArray(output)) {\n output = [output];\n }\n const layerOutputs = getNodeOutputs(fetch);\n const outputSymbolicTensors =\n Array.isArray(layerOutputs) ? layerOutputs : [layerOutputs];\n for (let i = 0; i < outputSymbolicTensors.length; ++i) {\n internalFeedDict.add(outputSymbolicTensors[i], output[i]);\n }\n return output.length === 1 ? output[0] : output[fetch.outputTensorIndex];\n}\n\n/**\n * Get the symbolic output tensors of the node to which a given fetch belongs.\n * @param fetch The fetched symbolic tensor.\n * @returns The Array of symbolic tensors output by the node to which `fetch`\n * belongs.\n */\nfunction getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|\n SymbolicTensor[] {\n let layerOutputs: SymbolicTensor|SymbolicTensor[];\n if (fetch.sourceLayer.inboundNodes.length === 1) {\n layerOutputs = fetch.sourceLayer.output;\n } else {\n let nodeIndex: number = null;\n for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {\n for (const outputTensor of fetch.sourceLayer.inboundNodes[i]\n .outputTensors) {\n if (outputTensor.id === fetch.id) {\n nodeIndex = i;\n break;\n }\n }\n }\n layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);\n }\n return layerOutputs;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original Source: engine/training.py */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {io, ModelPredictConfig, Optimizer, Scalar, serialization, Tensor, Tensor1D, tensor1d, util} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from '../backend/state';\nimport * as K from '../backend/tfjs_backend';\nimport {BaseCallback, BaseLogger, CallbackList, CustomCallbackConfig, History, standardizeCallbacks} from '../base_callbacks';\nimport {nameScope} from '../common';\nimport {NotImplementedError, RuntimeError, ValueError} from '../errors';\nimport {disposeTensorsInLogs, UnresolvedLogs} from '../logs';\nimport * as losses from '../losses';\nimport * as Metrics from '../metrics';\nimport * as optimizers from '../optimizers';\nimport {LossOrMetricFn, NamedTensorMap, Shape} from '../types';\nimport {count, pyListRepeat, singletonOrArray, unique} from '../utils/generic_utils';\nimport {printSummary} from '../utils/layer_utils';\nimport {range} from '../utils/math_utils';\nimport {LayerVariable} from '../variables';\n\nimport {Container, ContainerConfig} from './container';\nimport {execute, FeedDict} from './executor';\nimport {SymbolicTensor} from './topology';\n\n// tslint:enable:max-line-length\n\n/**\n * Helper function for polymorphic input data: 1. singleton Tensor.\n */\nexport function isDataTensor(x: Tensor|Tensor[]|{[inputName: string]: Tensor}|\n {[inputName: string]: Tensor[]}): boolean {\n return x instanceof Tensor;\n}\n\n/**\n * Helper function for polymorphic input data: 2. Array of Tensor.\n */\nexport function isDataArray(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return Array.isArray(x);\n}\n\n/**\n * Helper function for polymorphic input data: 3. \"dict\" of Tensor.\n */\nexport function isDataDict(x: Tensor|Tensor[]|\n {[inputName: string]: Tensor}): boolean {\n return !isDataTensor(x) && !isDataArray(x);\n}\n\n/**\n * Normalizes inputs and targets provided by users.\n * @param data User-provided input data (polymorphic).\n * @param names An Array of expected Tensor names.\n * @param shapes Optional Array of expected Tensor shapes.\n * @param checkBatchAxis Whether to check that the batch axis of the arrays\n * match the expected value found in `shapes`.\n * @param exceptionPrefix String prefix used for exception formatting.\n * @returns List of standardized input Tensors (one Tensor per model input).\n * @throws ValueError: in case of improperly formatted user data.\n */\nexport function standardizeInputData(\n data: Tensor|Tensor[]|{[inputName: string]: Tensor}, names: string[],\n shapes?: Shape[], checkBatchAxis = true, exceptionPrefix = ''): Tensor[] {\n if (names == null || names.length === 0) {\n // Check for the case where the model expected no data, but some data got\n // sent.\n if (data != null) {\n let gotUnexpectedData = false;\n if (isDataArray(data) && (data as Tensor[]).length > 0) {\n gotUnexpectedData = true;\n } else if (isDataDict(data)) {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n gotUnexpectedData = true;\n break;\n }\n }\n } else {\n // `data` is a singleton Tensor in this case.\n gotUnexpectedData = true;\n }\n if (gotUnexpectedData) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix} expected no data, ` +\n `but got ${data}`);\n }\n }\n return [];\n }\n if (data == null) {\n return names.map(name => null);\n }\n\n let arrays: Tensor[];\n if (isDataDict(data)) {\n data = data as {[inputName: string]: Tensor};\n arrays = [];\n for (const name of names) {\n if (data[name] == null) {\n throw new ValueError(\n `No data provided for \"${name}\". Need data for each key in: ` +\n `${names}`);\n }\n arrays.push(data[name]);\n }\n } else if (isDataArray(data)) {\n data = data as Tensor[];\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `model expected. Expected to see ${names.length} Tensor(s), but ` +\n `instead got the following list of Tensor(s): ${data}`);\n }\n arrays = data;\n } else {\n data = data as Tensor;\n if (names.length > 1) {\n throw new ValueError(\n `The model ${exceptionPrefix} expects ${names.length} Tensor(s), ` +\n `but only received one Tensor. Found: Tensor with shape ${\n data.shape}`);\n }\n arrays = [data];\n }\n\n // Make Tensors at least 2D.\n for (let i = 0; i < names.length; ++i) {\n const array = arrays[i];\n if (array.shape.length === 1) {\n arrays[i] = K.expandDims(array, 1);\n }\n }\n\n // Check shape compatibility.\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s). but got array with ` +\n `shape ${array.shape}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n // Skip the first (batch) axis.\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null && refDim >= 0 && dim !== refDim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have shape [${shapes[i]}], but got array with shape ` +\n `[${array.shape}].`);\n }\n }\n }\n }\n return arrays;\n}\n\n/**\n * User input validation for Tensors.\n * @param inputs `Array` of `Tensor`s for inputs.\n * @param targets `Array` of `Tensor`s for targets.\n * @param weights Optional `Array` of `Tensor`s for sample weights.\n * @throws ValueError: in case of incorrectly formatted data.\n */\nexport function checkArrayLengths(\n inputs: Tensor[], targets: Tensor[], weights?: Tensor[]) {\n const setX = unique(inputs.map(input => input.shape[0]));\n setX.sort();\n const setY = unique(targets.map(target => target.shape[0]));\n setY.sort();\n // TODO(cais): Check `weights` as well.\n if (setX.length > 1) {\n throw new ValueError(\n `All input Tensors (x) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(inputs.map(input => input.shape))}`);\n }\n if (setY.length > 1) {\n throw new ValueError(\n `All target Tensors (y) should have the same number of samples. ` +\n `Got array shapes: ` +\n `${JSON.stringify(targets.map(target => target.shape))}`);\n }\n if (setX.length > 0 && setY.length > 0 && !util.arraysEqual(setX, setY)) {\n throw new ValueError(\n `Input Tensors should have the same number of samples as target ` +\n `Tensors. Found ${setX[0]} input sample(s) and ${setY[0]} target ` +\n `sample(s).`);\n }\n}\n\n/**\n * Validation on the compatibility of targes and loss functions.\n *\n * This helps prevent users from using loss functions incorrectly.\n *\n * @param targets `Array` of `Tensor`s of targets.\n * @param lossFns `Array` of loss functions.\n * @param outputShapes `Array` of shapes of model outputs.\n */\nfunction checkLossAndTargetCompatibility(\n targets: Tensor[], lossFns: LossOrMetricFn[], outputShapes: Shape[]) {\n // TODO(cais): Dedicated test coverage?\n const keyLosses = [\n losses.meanSquaredError, losses.binaryCrossentropy,\n losses.categoricalCrossentropy\n ];\n for (let i = 0; i < targets.length; ++i) {\n const y = targets[i];\n const loss = lossFns[i];\n const shape = outputShapes[i];\n if (loss == null) {\n continue;\n }\n if (loss === losses.categoricalCrossentropy) {\n if (y.shape[y.shape.length - 1] === 1) {\n throw new ValueError(\n `You are passing a target array of shape ${y.shape} while using ` +\n `a loss 'categorical_crossentropy'. 'categorical_crossentropy'` +\n `expects targets to be binary matrices (1s and 0s) of shape ` +\n `[samples, classes].`);\n // TODO(cais): Example code in error message.\n }\n }\n if (keyLosses.indexOf(loss) !== -1) {\n const slicedYShape = y.shape.slice(1);\n const slicedShape = shape.slice(1);\n for (let j = 0; j < slicedYShape.length; ++j) {\n const targetDim = slicedYShape[j];\n const outDim = slicedShape[j];\n if (outDim != null && targetDim !== outDim) {\n throw new ValueError(\n `A target Tensor with shape ${y.shape} was passed for an ` +\n `output of shape ${shape}, while using a loss function that ` +\n `expects targets to have the same shape as the output.`);\n }\n }\n }\n }\n}\n\n/**\n * Returns a list of batch indices (tuples of indices).\n * @param size: Integer, total size of the data to slice into batches.\n * @param batchSize: Integer, batch size.\n * @returns An Array of [batchStart, batchEnd] tuples. batchStart is\n * inclusive; batchEnd is exclusive. I.e., each batch consists of indices x\n * that satisfy batchStart <= x < batchEnd.\n */\nexport function makeBatches(\n size: number, batchSize: number): Array<[number, number]> {\n const output: Array<[number, number]> = [];\n let batchStart = 0;\n let batchEnd: number = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}\n\n/**\n * Slice an Tensor or an Array of Tensors, by start and stop indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArraysByIndices()` together.\n *\n * @param arrays: the input.\n * @param start: the starting index (inclusive).\n * @param stop: the stopping index (exclusive).\n * @returns The result of the slicing. If `arrays` is an `Array` of\n * `Tensor`s, the slicing will be applied to all elements of the `Array`\n * in the same way.\n */\nfunction sliceArrays(\n arrays: Tensor|Tensor[], start: number, stop: number): Tensor|Tensor[] {\n if (arrays == null) {\n return [null];\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => K.sliceAlongFirstAxis(array, start, stop - start));\n } else { // Tensor.\n return K.sliceAlongFirstAxis(arrays, start, stop - start);\n }\n}\n\n/**\n * Slice an Tensor or an Array of Tensors, by random-order indices.\n *\n * Porting Note: The `_slice_arrays` function in PyKeras is covered by this\n * function and `sliceArrays()` together.\n *\n * @param arrays The input `Tensor` or `Array` of `Tensor`s to slice.\n * If an `Array` of `Tensor`s, all `Tensor`s will be sliced in the\n * same fashion.\n * @param indices The indices to use for slicing along the first (batch)\n * dimension.\n * @returns Result(s) of the slicing.\n */\nexport function sliceArraysByIndices(\n arrays: Tensor|Tensor[], indices: Tensor1D): Tensor|Tensor[] {\n return tfc.tidy(() => {\n if (arrays == null) {\n return null;\n } else if (Array.isArray(arrays)) {\n return arrays.map(\n array => (sliceArraysByIndices(array, indices) as Tensor));\n } else {\n // TODO(cais): indices should be a pre-constructed Tensor1D to avoid\n // tensor1d() calls.\n return K.gather(\n arrays, indices.dtype === 'int32' ? indices : indices.toInt());\n }\n });\n}\n\n/**\n * Check inputs provided by the user.\n *\n * Porting Note: This corresponds to _standardize_input_data() in Python\n * Keras. Because of the strong typing in TF.js, we do not need to convert\n * the data. Specifically:\n * 1) in PyKeras, `data` can be `DataFrame` instances from pandas, for\n * example. We don't need to worry about that here because there is no\n * widely popular javascript/typesdcript equivalent of pandas (so far).\n * If one becomes available in the future, we can add support.\n * 2) in PyKeras, inputs can be Python dict. But here we are stipulating\n * that the data is either a single `Tensor` or an Array of `Tensor`s. We\n * may add support for `Object` data inputs in the future when the need\n * arises.\n *\n * Instead, we perform basic checks for number of parameters and shapes.\n *\n * @param data: The input data.\n * @param names: Name for the inputs, from the model.\n * @param shapes: Expected shapes for the input data, from the model.\n * @param checkBatchAxis: Whether the size along the batch axis (i.e., the\n * first dimension) will be checked for matching.\n * @param exceptionPrefix: Execption prefix message, used in generating error\n * messages.\n * @throws ValueError: on incorrect number of inputs or mismatches in shapes.\n */\nfunction checkInputData(\n data: Tensor|Tensor[], names: string[], shapes?: Shape[],\n checkBatchAxis = true, exceptionPrefix = '') {\n let arrays: Tensor[];\n if (Array.isArray(data)) {\n if (data.length !== names.length) {\n throw new ValueError(\n `Error when checking model ${exceptionPrefix}: the Array of ` +\n `Tensors that you are passing to your model is not the size the ` +\n `the model expected. Expected to see ${names.length} Tensor(s),` +\n ` but instead got ${data.length} Tensors(s).`);\n }\n arrays = data;\n } else {\n if (names.length > 1) {\n throw new ValueError(\n `The model expects ${names.length} ${exceptionPrefix} Tensors, ` +\n `but only received one Tensor. Found: array with shape ` +\n `${JSON.stringify(data.shape)}.`);\n }\n arrays = [data];\n }\n\n if (shapes != null) {\n for (let i = 0; i < names.length; ++i) {\n if (shapes[i] == null) {\n continue;\n }\n const array = arrays[i];\n if (array.shape.length !== shapes[i].length) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ${names[i]} ` +\n `to have ${shapes[i].length} dimension(s), but got array with ` +\n `shape ${JSON.stringify(array.shape)}`);\n }\n for (let j = 0; j < shapes[i].length; ++j) {\n if (j === 0 && !checkBatchAxis) {\n continue;\n }\n const dim = array.shape[j];\n const refDim = shapes[i][j];\n if (refDim != null) {\n if (refDim !== dim) {\n throw new ValueError(\n `Error when checking ${exceptionPrefix}: expected ` +\n `${names[i]} to have shape ${JSON.stringify(shapes[i])} but ` +\n `got array with shape ${JSON.stringify(array.shape)}.`);\n }\n }\n }\n }\n }\n}\n\n/**\n * Maps metric functions to model outputs.\n * @param metrics An `Array` or dict (`Object`) of metric functions.\n * @param outputNames An `Array` of the names of model outputs.\n * @returns An `Array` (one entry per model output) of `Array` of metric\n * functions. For instance, if the model has 2 outputs, and for the first\n * output we want to compute `binaryAccuracy` and `binaryCrossentropy`,\n * and just `binaryAccuracy` for the second output, the `Array` would look\n * like:\n * `[[binaryAccuracy, binaryCrossentropy], [binaryAccuracy]]`\n * @throws TypeError: if `null` or `undefined` value is provided.\n */\nfunction collectMetrics(\n metrics: string[]|{[outputName: string]: string | string[]},\n outputNames: string[]): string[][] {\n if (metrics == null || Array.isArray(metrics) && metrics.length === 0) {\n return outputNames.map(name => []);\n }\n if (Array.isArray(metrics)) {\n // We then apply all metrics to all outputs.\n return outputNames.map(name => metrics);\n } else if (metrics != null) {\n // In this case, metrics is a dict.\n const nestedMetrics: string[][] = [];\n for (const name of outputNames) {\n let outputMetrics: string|string[] =\n metrics.hasOwnProperty(name) ? metrics[name] : [];\n if (!Array.isArray(outputMetrics)) {\n outputMetrics = [outputMetrics];\n }\n nestedMetrics.push(outputMetrics as string[]);\n }\n return nestedMetrics;\n } else {\n throw new TypeError(\n 'Type of metrics argument not understood. Expected an Array or ' +\n 'Object, found: ' + metrics);\n }\n}\n\n/** Verbosity logging level when fitting a model. */\nexport enum ModelLoggingVerbosity {\n SILENT = 0,\n VERBOSE = 1\n}\n\nexport interface ModelEvaluateConfig {\n /**\n * Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Verbosity mode.\n */\n verbose?: ModelLoggingVerbosity;\n\n /**\n * Tensor of weights to weight the contribution of different samples to the\n * loss and metrics.\n */\n sampleWeight?: Tensor;\n\n /**\n * integer: total number of steps (batches of samples)\n * before declaring the evaluation round finished. Ignored with the default\n * value of `undefined`.\n */\n steps?: number;\n}\n\n/**\n * Interface for specifying data to fit a model to data.\n */\nexport interface ModelFitConfig {\n /**\n * Number of samples per gradient update. If unspecified, it\n * will default to 32.\n */\n batchSize?: number;\n\n /** The number of times to iterate over the training data arrays. */\n epochs?: number;\n\n verbose?: ModelLoggingVerbosity;\n\n /**\n * List of callbacks to be called during training.\n * Can consist of one or more of the following fields: `onTrainBegin`,\n * `onTrainEnd`, `onEpochBegin`, `onEpochEnd`, `onBatchBegin`, `onBatchEnd`.\n */\n callbacks?: BaseCallback[]|CustomCallbackConfig|CustomCallbackConfig[];\n\n /**\n * Float between 0 and 1: fraction of the training data\n * to be used as validation data. The model will set apart this fraction of\n * the training data, will not train on it, and will evaluate the loss and\n * any model metrics on this data at the end of each epoch.\n * The validation data is selected from the last samples in the `x` and `y`\n * data provided, before shuffling.\n */\n validationSplit?: number;\n\n /**\n * Data on which to evaluate the loss and any model\n * metrics at the end of each epoch. The model will not be trained on this\n * data. This could be a tuple [xVal, yVal] or a tuple [xVal, yVal,\n * valSampleWeights]. The model will not be trained on this data.\n * `validationData` will override `validationSplit`.\n */\n validationData?: [\n Tensor|Tensor[], Tensor|Tensor[]\n ]|[Tensor | Tensor[], Tensor|Tensor[], Tensor|Tensor[]];\n\n /**\n * Whether to shuffle the training data before each epoch. Has\n * no effect when `stepsPerEpoch` is not `null`.\n */\n shuffle?: boolean;\n\n /**\n * Optional dictionary mapping class indices (integers) to\n * a weight (float) to apply to the model's loss for the samples from this\n * class during training. This can be useful to tell the model to \"pay more\n * attention\" to samples from an under-represented class.\n */\n classWeight?: {[classIndex: string]: number};\n\n /**\n * Optional array of the same length as x, containing\n * weights to apply to the model's loss for each sample. In the case of\n * temporal data, you can pass a 2D array with shape (samples,\n * sequenceLength), to apply a different weight to every timestep of every\n * sample. In this case you should make sure to specify\n * sampleWeightMode=\"temporal\" in compile().\n */\n sampleWeight?: Tensor;\n\n /**\n * Epoch at which to start training (useful for resuming a previous training\n * run).\n */\n initialEpoch?: number;\n\n /**\n * Total number of steps (batches of samples) before\n * declaring one epoch finished and starting the next epoch. When training\n * with Input Tensors such as TensorFlow data tensors, the default `null` is\n * equal to the number of unique samples in your dataset divided by the\n * batch size, or 1 if that cannot be determined.\n */\n stepsPerEpoch?: number;\n\n /**\n * Only relevant if `stepsPerEpoch` is specified. Total number of steps\n * (batches of samples) to validate before stopping.\n */\n validationSteps?: number;\n\n /**\n *\n */\n yieldEvery?: 'batch'|'epoch'|'never';\n}\n\n/**\n * Configuration for calls to `Model.compile()`.\n */\nexport interface ModelCompileConfig {\n /**\n * An instance of `tf.train.Optimizer` or a string name for an Optimizer.\n */\n optimizer: string|Optimizer;\n\n /**\n * Object function(s) or name(s) of object function(s).\n * If the model has multiple outputs, you can use a different loss\n * on each output by passing a dictionary or an Array of losses.\n * The loss value that will be minimized by the model will then be the sum\n * of all individual losses.\n */\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n\n /**\n * List of metrics to be evaluated by the model during training and testing.\n * Typically you will use `metrics=['accuracy']`.\n * To specify different metrics for different outputs of a multi-output\n * model, you could also pass a dictionary.\n */\n metrics?: string[]|{[outputName: string]: string};\n\n // TODO(cais): Add lossWeights, sampleWeightMode, weightedMetrics, and\n // targetTensors.\n}\n\n/**\n * A `Model` is a directed, acyclic graph of `Layer`s plus methods for\n * training, evaluation, prediction and saving.\n *\n * `Model` is the basic unit of training, inference and evaluation in\n * TensorFlow.js. To create a `Model`, use `model`.\n *\n * See also:\n * `Sequential`, `loadModel`.\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Model extends Container implements tfc.InferenceModel {\n static className = 'Model';\n optimizer: Optimizer;\n loss: string|string[]|{[outputName: string]: string}|LossOrMetricFn|\n LossOrMetricFn[]|{[outputName: string]: LossOrMetricFn};\n lossFunctions: LossOrMetricFn[];\n\n // TODO(cais): These private variables should probably not have the string\n // 'feed' in their names, because we are not dealing with a symbolic\n // backend.\n private feedOutputShapes: Shape[];\n private feedLossFns: LossOrMetricFn[];\n private collectedTrainableWeights: LayerVariable[];\n private testFunction: (data: Tensor[]) => Scalar[];\n history: History;\n\n // A public property that can be set by Callbacks to order early stopping\n // during `fit()` calls.\n stopTraining: boolean;\n\n metrics: string[]|{[outputName: string]: string};\n metricsNames: string[];\n // Porting Note: `metrics_tensors` in PyKeras is a symbolic tensor. But given\n // the imperative nature of tfjs-core, `metricsTensors` is a\n // TypeScript function here.\n // Also note that due to the imperative nature of tfjs-core, `metricsTensor`\n // here needs an output index to keep track of which output of the Model\n // a metric belongs to. This is unlike `metrics_tensors` in PyKeras,\n // which is a `list` of symbolic tensors, each of which has implicit\n // \"knowledge\" of the outputs it depends on.\n metricsTensors: Array<[LossOrMetricFn, number]>;\n\n constructor(config: ContainerConfig) {\n super(config);\n }\n\n /**\n * Print a text summary of the model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - If the model has non-sequential-like topology, the inputs each layer\n * receives\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const input1 = tf.input({shape: [10]});\n * const input2 = tf.input({shape: [20]});\n * const dense1 = tf.layers.dense({units: 4}).apply(input1);\n * const dense2 = tf.layers.dense({units: 8}).apply(input2);\n * const concat = tf.layers.concatenate().apply([dense1, dense2]);\n * const output =\n * tf.layers.dense({units: 3, activation: 'softmax'}).apply(concat);\n *\n * const model = tf.model({inputs: [input1, input2], outputs: output});\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n throw new ValueError(\n `This model has never been called, thus its weights have not been ` +\n `created yet. So no summary can be displayed. Build the model ` +\n `first (e.g., by calling it on some test data).`);\n }\n printSummary(this, lineLength, positions, printFn);\n }\n\n /**\n * Configures and prepares the model for training and evaluation. Compiling\n * outfits the model with an optimizer, loss, and/or metrics. Calling `fit`\n * or `evaluate` on an un-compiled model will throw an error.\n *\n * @param config a `ModelCompileConfig` specifying the loss, optimizer, and\n * metrics to be used for fitting and evaluating this model.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [0]}\n */\n compile(config: ModelCompileConfig): void {\n if (config.loss == null) {\n config.loss = [];\n }\n this.loss = config.loss;\n\n if (typeof config.optimizer === 'string') {\n this.optimizer = optimizers.getOptimizer(config.optimizer);\n } else {\n if (!(config.optimizer instanceof Optimizer)) {\n throw new ValueError(\n `User-defined optimizer must be an instance of tf.Optimizer.`);\n }\n this.optimizer = config.optimizer;\n }\n\n // TODO(cais): Add lossWeights.\n // TODO(cais): Add sampleWeightMode.\n\n // Prepare loss functions.\n let lossFunctions: LossOrMetricFn[] = [];\n if (!Array.isArray(config.loss) && typeof config.loss !== 'string' &&\n typeof config.loss !== 'function') {\n config.loss = config.loss as {[outputName: string]: string};\n for (const name in config.loss) {\n if (this.outputNames.indexOf(name) === -1) {\n throw new ValueError(\n `Unknown entry in loss dictionary: \"${name}\". Only expect the ` +\n `following keys: ${this.outputNames}`);\n }\n }\n for (const name in this.outputNames) {\n if (config.loss[name] == null) {\n console.warn(\n `Output \"${name}\" is missing from loss dictionary. We assume ` +\n `this was done on purpose, and we will not be expecting data ` +\n `to be passed to ${name} during training`);\n }\n lossFunctions.push(losses.get(config.loss[name]));\n }\n } else if (Array.isArray(config.loss)) {\n if (config.loss.length !== this.outputs.length) {\n throw new ValueError(\n `When passing an Array as loss, it should have one entry per ` +\n `model output. The model has ${this.outputs.length} output(s), ` +\n `but you passed loss=${config.loss}.`);\n }\n const theLosses = config.loss as Array;\n lossFunctions = theLosses.map(l => losses.get(l));\n } else {\n const lossFunction = losses.get(config.loss);\n this.outputs.map(layer => {\n lossFunctions.push(lossFunction);\n });\n }\n\n this.lossFunctions = lossFunctions;\n\n this.feedOutputNames = [];\n this.feedOutputShapes = [];\n this.feedLossFns = [];\n for (let i = 0; i < this.outputs.length; ++i) {\n // TODO(cais): Logic for skipping target(s).\n const shape = this.internalOutputShapes[i];\n const name = this.outputNames[i];\n this.feedOutputNames.push(name);\n this.feedOutputShapes.push(shape);\n this.feedLossFns.push(this.lossFunctions[i]);\n }\n\n // TODO(cais): Add logic for weighted losses.\n // TODO(cais): Add logic for output masks.\n // TODO(cais): Add logic for sample weights.\n const skipTargetIndices: number[] = [];\n\n // Prepare metrics.\n this.metrics = config.metrics;\n // TODO(cais): Add weightedMetrics.\n this.metricsNames = ['loss'];\n this.metricsTensors = [];\n\n // Compute total loss.\n // Porting Note: In PyKeras, metrics_tensors are symbolic tensor objects.\n // Here, metricsTensors are TypeScript functions. This difference is due\n // to the difference in symbolic/imperative property of the backends.\n nameScope('loss', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n // TODO(cais): Add weightedLoss, sampleWeight and mask.\n // The following line should be weightedLoss\n const weightedLoss = this.lossFunctions[i];\n if (this.outputs.length > 1) {\n this.metricsTensors.push([weightedLoss, i]);\n this.metricsNames.push(this.outputNames[i] + '_loss');\n }\n }\n\n // Porting Note: Due to the imperative nature of the backend, we calculate\n // the regularizer penalties in the totalLossFunction, instead of here.\n });\n\n const nestedMetrics = collectMetrics(config.metrics, this.outputNames);\n // TODO(cais): Add nestedWeightedMetrics.\n\n /**\n * Helper function used in loop below.\n */\n const appendMetric =\n (outputIndex: number, metricName: string,\n metricTensor: LossOrMetricFn) => {\n if (this.outputNames.length > 1) {\n metricName = this.outputNames[outputIndex] + '_' + metricName;\n }\n this.metricsNames.push(metricName);\n this.metricsTensors.push([metricTensor, outputIndex]);\n };\n\n nameScope('metric', () => {\n for (let i = 0; i < this.outputs.length; ++i) {\n if (skipTargetIndices.indexOf(i) !== -1) {\n continue;\n }\n const outputMetrics = nestedMetrics[i];\n // TODO(cais): Add weights and outputWeightedMetrics.\n\n // TODO(cais): Add optional arg `weights` to the following function.\n const handleMetrics = (metrics: string[]) => {\n const metricNamePrefix = '';\n let metricName: string;\n let accFn: LossOrMetricFn;\n let weightedMetricFn: LossOrMetricFn;\n // TODO(cais): Use 'weights_' for weighted metrics.\n\n for (const metric of metrics) {\n if (['accuracy', 'acc', 'crossentropy', 'ce'].indexOf(metric) !==\n -1) {\n const outputShape = this.internalOutputShapes[i];\n\n if (outputShape[outputShape.length - 1] === 1 ||\n this.lossFunctions[i] === losses.binaryCrossentropy) {\n // case: binary accuracy/crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.binaryCrossentropy;\n }\n } else if (\n this.lossFunctions[i] ===\n losses.sparseCategoricalCrossentropy) {\n // case: categorical accuracy / crossentropy with sparse\n // targets.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.sparseCategoricalCrossentropy;\n }\n } else {\n // case: categorical accuracy / crossentropy.\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalAccuracy;\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n accFn = Metrics.categoricalCrossentropy;\n }\n }\n let suffix: string;\n if (['accuracy', 'acc'].indexOf(metric) !== -1) {\n suffix = 'acc';\n } else if (['crossentropy', 'ce'].indexOf(metric) !== -1) {\n suffix = 'ce';\n }\n // TODO(cais): Add weighting actually.\n weightedMetricFn = accFn;\n metricName = metricNamePrefix + suffix;\n } else {\n const metricFn = Metrics.get(metric);\n // TODO(cais): Add weighting actually.\n weightedMetricFn = metricFn;\n metricName = metricNamePrefix + metric;\n }\n\n // TODO(cais): Add weighting and masking to metricResult.\n let metricResult: LossOrMetricFn;\n nameScope(metricName, () => {\n metricResult = weightedMetricFn;\n });\n appendMetric(i, metricName, metricResult);\n }\n };\n\n handleMetrics(outputMetrics);\n // TODO(cais): Call handleMetrics with weights.\n }\n });\n\n // Porting Notes: Given the imperative backend of tfjs-core,\n // there is no need for constructing the symbolic graph and placeholders.\n this.collectedTrainableWeights = this.trainableWeights;\n }\n\n /**\n * Check trainable weights count consistency.\n *\n * This will raise a warning if `this.trainableWeights` and\n * `this.collectedTrainableWeights` are inconsistent (i.e., have different\n * numbers of parameters).\n * Inconsistency will typically arise when one modifies `model.trainable`\n * without calling `model.compile()` again.\n */\n private checkTrainableWeightsConsistency(): void {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn(\n 'Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(\n * tf.ones([8, 10]), tf.ones([8, 1]), {batchSize: 4});\n * result.print();\n * ```\n *\n * @param x `Tensor` of test data, or an `Array` of `Tensor`s if the model has\n * multiple inputs.\n * @param y `Tensor` of target data, or an `Array` of `Tensor`s if the model\n * has multiple outputs.\n * @param config A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n config: ModelEvaluateConfig = {}): Scalar|Scalar[] {\n const batchSize = config.batchSize == null ? 32 : config.batchSize;\n\n // TODO(cais): Standardize `config.sampleWeights` as well.\n // Validate user data.\n const standardizedOuts = this.standardizeUserData(x, y, true, batchSize);\n // TODO(cais): If uses `useLearningPhase`, set the corresponding element of\n // the input to 0.\n const ins = standardizedOuts[0].concat(standardizedOuts[1]);\n this.makeTestFunction();\n const f = this.testFunction;\n const testOuts =\n this.testLoop(f, ins, batchSize, config.verbose, config.steps);\n return singletonOrArray(testOuts);\n }\n\n /**\n * Get number of samples provided for training, evaluation or prediction.\n *\n * @param ins Input `Tensor`.\n * @param batchSize Integer batch size, optional.\n * @param steps Total number of steps (batches of samples) before declaring\n * loop finished. Optional.\n * @param stepsName The public API's parameter name for `steps`.\n * @returns Number of samples provided.\n */\n private checkNumSamples(\n ins: Tensor|Tensor[], batchSize?: number, steps?: number,\n stepsName = 'steps'): number {\n let numSamples: number;\n if (steps != null) {\n numSamples = null;\n if (batchSize != null) {\n throw new ValueError(\n `If ${stepsName} is set, batchSize must be null or undefined.` +\n `Got batchSize = ${batchSize}`);\n }\n } else if (ins != null) {\n if (Array.isArray(ins)) {\n numSamples = ins[0].shape[0];\n } else {\n numSamples = ins.shape[0];\n }\n } else {\n throw new ValueError(\n `Either the input data should have a defined shape, or ` +\n `${stepsName} shoud be specified.`);\n }\n return numSamples;\n }\n\n /**\n * Execute intrenal tensors of the model with input data feed.\n * @param inputs Input data feed. Must match the inputs of the model.\n * @param outputs Names of the output tensors to be fetched. Must match\n * names of the SymbolicTensors that belong to the graph.\n * @returns Fetched values for `outputs`.\n */\n execute(inputs: Tensor|Tensor[]|NamedTensorMap, outputs: string|string[]):\n Tensor|Tensor[] {\n if (Array.isArray(outputs) && outputs.length === 0) {\n throw new ValueError(\n '`outputs` is an empty Array, which is not allowed.');\n }\n\n const outputsIsArray = Array.isArray(outputs);\n const outputNames = (outputsIsArray ? outputs as string[] :\n [outputs as string]) as string[];\n const outputSymbolicTensors = this.retrieveSymbolicTensors(outputNames);\n\n // Format the input into a FeedDict.\n const feedDict = new FeedDict();\n if (inputs instanceof Tensor) {\n inputs = [inputs as Tensor];\n }\n if (Array.isArray(inputs)) {\n if ((inputs as Tensor[]).length !== this.inputs.length) {\n throw new ValueError(\n `The number of inputs provided (${(inputs as Tensor[]).length}) ` +\n `does not match the number of inputs of this model ` +\n `(${this.inputs.length}).`);\n }\n for (let i = 0; i < this.inputs.length; ++i) {\n feedDict.add(this.inputs[i], (inputs as Tensor[])[i]);\n }\n } else {\n for (const input of this.inputs) {\n const tensorValue = (inputs as NamedTensorMap)[input.name];\n if (tensorValue == null) {\n throw new ValueError(\n `No value is provided for the model's input ${input.name}`);\n }\n feedDict.add(input, tensorValue);\n }\n }\n\n // Run execution.\n const executeOutputs = execute(outputSymbolicTensors, feedDict) as Tensor[];\n return outputsIsArray ? executeOutputs : executeOutputs[0];\n }\n\n /**\n * Retrieve the model's internal symbolic tensors from symbolic-tensor names.\n */\n private retrieveSymbolicTensors(symbolicTensorNames: string[]):\n SymbolicTensor[] {\n const outputSymbolicTensors: SymbolicTensor[] =\n pyListRepeat(null, symbolicTensorNames.length);\n let outputsRemaining = symbolicTensorNames.length;\n for (const layer of this.layers) {\n const layerOutputs: SymbolicTensor[] = Array.isArray(layer.output) ?\n layer.output as SymbolicTensor[] :\n [layer.output as SymbolicTensor];\n const layerOutputNames = layerOutputs.map(output => output.name);\n for (let i = 0; i < symbolicTensorNames.length; ++i) {\n const index = layerOutputNames.indexOf(symbolicTensorNames[i]);\n if (index !== -1) {\n outputSymbolicTensors[i] = layerOutputs[index];\n outputsRemaining--;\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n if (outputsRemaining === 0) {\n break;\n }\n }\n\n if (outputsRemaining > 0) {\n const remainingNames: string[] = [];\n outputSymbolicTensors.forEach((tensor, i) => {\n if (tensor == null) {\n remainingNames.push(symbolicTensorNames[i]);\n }\n });\n throw new ValueError(\n `Cannot find SymbolicTensors for output name(s): ` +\n `${JSON.stringify(remainingNames)}`);\n }\n return outputSymbolicTensors;\n }\n\n /**\n * Helper method to loop over some data in batches.\n *\n * Porting Note: Not using the functional approach in the Python equivalent\n * due to the imperative backend.\n * Porting Note: Does not support step mode currently.\n *\n * @param ins: input data\n * @param batchSize: integer batch size.\n * @param verbose: verbosity model\n * @returns: Predictions as `Tensor` (if a single output) or an `Array` of\n * `Tensor` (if multipe outputs).\n */\n private predictLoop(ins: Tensor|Tensor[], batchSize = 32, verbose = false):\n Tensor|Tensor[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins);\n if (verbose) {\n throw new NotImplementedError(\n 'Verbose predictLoop() is not implemented yet.');\n }\n\n // Sample-based predictions.\n // Porting Note: Tensor currently does not support sliced assignments as\n // in numpy, e.g., x[1:3] = y. Therefore we use concatenation while\n // iterating over the batches.\n\n const batches = makeBatches(numSamples, batchSize);\n const outs: Tensor[] = [];\n // TODO(cais): Can the scope() be pushed down inside the for loop?\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchOuts = tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n // TODO(cais): Take care of the case of the last element is a flag for\n // training/test.\n const insBatch = sliceArrays(ins, batchStart, batchEnd);\n\n // Construct the feeds for execute();\n const feeds = [];\n if (Array.isArray(insBatch)) {\n for (let i = 0; i < insBatch.length; ++i) {\n feeds.push({key: this.inputs[i], value: insBatch[i]});\n }\n } else {\n feeds.push({key: this.inputs[0], value: insBatch});\n }\n const feedDict = new FeedDict(feeds);\n return execute(this.outputs, feedDict) as Tensor[];\n });\n if (batchIndex === 0) {\n // Pre-allocate.\n for (const batchOut of batchOuts) {\n outs.push(batchOut);\n }\n } else {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs[i] = K.concatAlongFirstAxis(outs[i], batchOuts[i]);\n }\n }\n }\n return singletonOrArray(outs);\n });\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFlow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([8, 10]), {batchSize: 4}).print();\n * ```\n *\n * @param x The input data, as an Tensor, or an `Array` of `Tensor`s if\n * the model has multiple inputs.\n * @param config A `ModelPredictConfig` object containing optional fields.\n *\n * @return Prediction results as a `Tensor`(s).\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [1]}\n */\n predict(x: Tensor|Tensor[], config: ModelPredictConfig = {}): Tensor\n |Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, false);\n // TODO(cais): Take care of stateful models.\n // if (this.stateful) ...\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n const batchSize = config.batchSize == null ? 32 : config.batchSize;\n return this.predictLoop(x, batchSize);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predictOnBatch(tf.ones([8, 10])).print();\n * ```\n * @param x: Input samples, as an Tensor\n * @return Tensor(s) of predictions\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n checkInputData(x, this.inputNames, this.feedInputShapes, true);\n // TODO(cais): Take care of the learning_phase boolean flag.\n // if (this.useLearningPhase) ...\n return this.predictLoop(x, x.shape[0]);\n }\n\n protected standardizeUserData(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor}, checkBatchAxis = true,\n batchSize?: number): [Tensor[], Tensor[], Tensor[]] {\n // TODO(cais): Add sampleWeight, classWeight\n if (this.optimizer == null) {\n throw new RuntimeError(\n 'You must compile a model before training/testing. Use ' +\n 'Model.compile(modelCompileConfig).');\n }\n const outputShapes: Shape[] = [];\n for (let i = 0; i < this.feedOutputShapes.length; ++i) {\n const outputShape = this.feedOutputShapes[i];\n const lossFn = this.feedLossFns[i];\n if (lossFn === losses.sparseCategoricalCrossentropy) {\n outputShapes.push(\n outputShape.slice(0, outputShape.length - 1).concat([1]));\n } else {\n // Porting Note: Because of strong typing `lossFn` must be a function.\n outputShapes.push(outputShape);\n }\n }\n x = standardizeInputData(\n x, this.feedInputNames, this.feedInputShapes, false, 'input') as\n Tensor[];\n y = standardizeInputData(\n y, this.feedOutputNames, outputShapes, false, 'target') as Tensor[];\n // TODO(cais): Standardize sampleWeights & classWeights.\n checkArrayLengths(x, y, null);\n // TODO(cais): Check sampleWeights as well.\n checkLossAndTargetCompatibility(y, this.feedLossFns, this.feedOutputShapes);\n if (this.stateful && batchSize != null && batchSize > 0) {\n if (x[0].shape[0] % batchSize !== 0) {\n throw new ValueError(\n `In a stateful network, you should only pass inputs with a ` +\n `number of samples that is divisible by the batch size ` +\n `${batchSize}. Found: ${x[0].shape[0]} sample(s).`);\n }\n }\n // TODO(cais): Deal with the case of model.stateful == true.\n return [x, y, null];\n }\n\n /**\n * Abstract fit function for `f(ins)`.\n * @param f A Function returning a list of tensors. For training, this\n * function is expected to perform the updates to the variables.\n * @param ins List of tensors to be fed to `f`.\n * @param outLabels List of strings, display names of the outputs of `f`.\n * @param batchSize Integer batch size or `== null` if unknown.\n * @param epochs Number of times to iterate over the data.\n * @param verbose Verbosity mode: 0, 1, or 2.\n * @param callbacks List of callbacks to be called during training.\n * @param valF Function to call for validation.\n * @param valIns List of tensors to be fed to `valF`.\n * @param shuffle Whether to shuffle the data at the beginning of every\n * epoch.\n * @param callbackMetrics List of strings, the display names of the metrics\n * passed to the callbacks. They should be the concatenation of the\n * display names of the outputs of `f` and the list of display names\n * of the outputs of `valF`.\n * @param initialEpoch Epoch at which to start training (useful for\n * resuming a previous training run).\n * @param stepsPerEpoch Total number of steps (batches on samples) before\n * declaring one epoch finished and starting the next epoch. Ignored with\n * the default value of `undefined` or `null`.\n * @param validationSteps Number of steps to run validation for (only if\n * doing validation from data tensors). Not applicable for tfjs-layers.\n * @returns A `History` object.\n */\n private async fitLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], outLabels?: string[],\n batchSize?: number, epochs?: number, verbose?: number,\n callbacks?: BaseCallback[], valF?: (data: Tensor[]) => Scalar[],\n valIns?: Tensor[], shuffle?: boolean|string, callbackMetrics?: string[],\n initialEpoch?: number, stepsPerEpoch?: number,\n validationSteps?: number): Promise {\n if (batchSize == null) {\n batchSize = 32;\n }\n if (epochs == null) {\n epochs = 1;\n }\n if (shuffle == null) {\n shuffle = true;\n }\n if (initialEpoch == null) {\n initialEpoch = 0;\n }\n\n // TODO(cais): Change const to let below when implementing validation.\n let doValidation = false;\n if (valF != null && valIns != null) {\n doValidation = true;\n // TODO(cais): verbose message.\n }\n if (validationSteps != null) {\n doValidation = true;\n if (stepsPerEpoch == null) {\n throw new ValueError(\n 'Can only use `validationSteps` when doing step-wise training, ' +\n 'i.e., `stepsPerEpoch` must be set.');\n }\n }\n\n const numTrainSamples =\n this.checkNumSamples(ins, batchSize, stepsPerEpoch, 'steps_per_epoch');\n let indexArray: number[];\n if (numTrainSamples != null) {\n indexArray = range(0, numTrainSamples);\n }\n\n this.history = new History();\n if (callbacks == null) {\n callbacks = [new BaseLogger()];\n } else {\n callbacks = ([new BaseLogger()] as BaseCallback[]).concat(callbacks);\n }\n callbacks = callbacks.concat([this.history]);\n\n if (verbose > 0) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n const callbackList = new CallbackList(callbacks);\n\n // TODO(cais): Figure out when this Model instance can have a dynamically\n // set property called 'callback_model' as in PyKeras.\n callbackList.setModel(this);\n callbackList.setParams({\n epochs,\n initialEpoch,\n steps: stepsPerEpoch,\n verbose,\n doValidation,\n metrics: callbackMetrics,\n });\n await callbackList.onTrainBegin();\n this.stopTraining = false;\n // TODO(cais): Take care of callbacks.validation_data as in PyKeras.\n\n // TODO(cais): Pre-convert feeds for performance as in PyKeras.\n\n for (let epoch = initialEpoch; epoch < epochs; ++epoch) {\n await callbackList.onEpochBegin(epoch);\n const epochLogs: UnresolvedLogs = {};\n if (stepsPerEpoch != null) {\n throw new NotImplementedError(\n 'stepsPerEpoch mode is not implemented yet.');\n } else {\n if (shuffle === 'batch') {\n throw new NotImplementedError(\n 'batch shuffling is not implemneted yet');\n } else if (shuffle) {\n util.shuffle(indexArray);\n }\n // Convert the potentially shuffled indices to Tensor1D, to avoid the\n // cost of repeated creation of Array1Ds later on.\n const epochIndexArray1D = tensor1d(indexArray);\n\n const batches = makeBatches(numTrainSamples, batchSize);\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchLogs: UnresolvedLogs = {};\n await callbackList.onBatchBegin(batchIndex, batchLogs);\n\n tfc.tidy(() => {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds = K.sliceAlongFirstAxis(\n epochIndexArray1D, batchStart,\n batchEnd - batchStart) as Tensor1D;\n batchLogs['batch'] = batchIndex;\n batchLogs['size'] = batchEnd - batchStart;\n\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Tensor[];\n const outs = f(insBatch);\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = outs[i];\n batchLogs[label] = out;\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n }\n\n if (batchIndex === batches.length - 1) { // Last batch.\n if (doValidation) {\n const valOuts = this.testLoop(valF, valIns, batchSize);\n // Porting Notes: In tfjs-layers, valOuts is always an Array.\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n const out = valOuts[i];\n tfc.keep(out);\n // TODO(cais): Use scope() to avoid ownership.\n epochLogs['val_' + label] = out;\n }\n }\n }\n });\n\n await callbackList.onBatchEnd(batchIndex, batchLogs);\n disposeTensorsInLogs(batchLogs);\n\n if (this.stopTraining) {\n break;\n }\n // TODO(cais): return outs as list of Tensor.\n }\n\n epochIndexArray1D.dispose();\n }\n // TODO(cais): Run validation at the end of the epoch.\n await callbackList.onEpochEnd(epoch, epochLogs);\n if (this.stopTraining) {\n break;\n }\n }\n await callbackList.onTrainEnd();\n\n await this.history.syncData();\n return this.history;\n }\n\n /**\n * Loop over some test data in batches.\n * @param f A Function returning a list of tensors.\n * @param ins Array of tensors to be fed to `f`.\n * @param batchSize Integer batch size or `null` / `undefined`.\n * @param verbose verbosity mode.\n * @param steps Total number of steps (batches of samples) before declaring\n * test finished. Ignored with the default value of `null` / `undefined`.\n * @returns Array of Scalars.\n */\n private testLoop(\n f: (data: Tensor[]) => Scalar[], ins: Tensor[], batchSize?: number,\n verbose = 0, steps?: number): Scalar[] {\n return tfc.tidy(() => {\n const numSamples = this.checkNumSamples(ins, batchSize, steps, 'steps');\n const outs: Scalar[] = [];\n if (verbose === 1) {\n throw new NotImplementedError('Verbose mode is not implemented yet.');\n }\n // TODO(cais): Use `indicesForConversionToDense' to prevent slow down.\n if (steps != null) {\n throw new NotImplementedError(\n 'steps mode in testLoop() is not implemented yet');\n } else {\n const batches = makeBatches(numSamples, batchSize);\n const indexArray = tensor1d(range(0, numSamples));\n for (let batchIndex = 0; batchIndex < batches.length; ++batchIndex) {\n const batchStart = batches[batchIndex][0];\n const batchEnd = batches[batchIndex][1];\n const batchIds =\n K.sliceAlongFirstAxis(\n indexArray, batchStart, batchEnd - batchStart) as Tensor1D;\n // TODO(cais): In ins, train flag can be a number, instead of an\n // Tensor? Do we need to handle this in tfjs-layers?\n const insBatch = sliceArraysByIndices(ins, batchIds) as Scalar[];\n const batchOuts = f(insBatch);\n if (batchIndex === 0) {\n for (let i = 0; i < batchOuts.length; ++i) {\n outs.push(getScalar(0));\n }\n }\n for (let i = 0; i < batchOuts.length; ++i) {\n const batchOut = batchOuts[i];\n outs[i] =\n tfc.add(\n outs[i],\n tfc.mul(getScalar(batchEnd - batchStart), batchOut)) as\n Scalar;\n }\n }\n for (let i = 0; i < outs.length; ++i) {\n outs[i] = tfc.div(outs[i], getScalar(numSamples)) as Scalar;\n }\n }\n return outs;\n });\n }\n\n private getDedupedMetricsNames(): string[] {\n const outLabels = this.metricsNames;\n // Rename duplicated metrics names (can happen with an output layer shared\n // among multiple dataflows).\n const dedupedOutLabels = [];\n for (let i = 0; i < outLabels.length; ++i) {\n const label = outLabels[i];\n let newLabel = label;\n if (count(outLabels, label) > 1) {\n const dupIndex = count(outLabels.slice(0, i), label);\n newLabel += `_${dupIndex}`;\n }\n dedupedOutLabels.push(newLabel);\n }\n return dedupedOutLabels;\n }\n\n private makeTestFunction() {\n this.testFunction = (data: Tensor[]) => {\n return tfc.tidy(() => {\n const valOutputs: Scalar[] = [];\n let totalLoss: Scalar;\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs = execute(this.outputs, feedDict) as Tensor[];\n // Compute total loss.\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n // TODO(cais): Add sample weighting and replace the simple\n // averaging.\n const loss = tfc.mean(lossFunction(targets[i], outputs[i])) as Scalar;\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss) as Scalar;\n }\n valOutputs.push(totalLoss);\n }\n // Compute the metrics.\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0]; // TODO(cais): Restore.\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex]));\n valOutputs.push(meanMetric as Scalar);\n }\n return valOutputs;\n });\n };\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * for (let i = 1; i < 5 ; ++i) {\n * const h = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(\"Loss after Epoch \" + i + \" : \" + h.history.loss[0]);\n * }\n * ```\n *\n * @param x `Tensor` of training data, or an array of `Tensor`s if the model\n * has multiple inputs. If all inputs in the model are named, you can also\n * pass a dictionary mapping input names to `Tensor`s.\n * @param y `Tensor` of target (label) data, or an array of `Tensor`s if the\n * model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `Tensor`s.\n * @param config A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n config: ModelFitConfig = {}): Promise {\n const batchSize = config.batchSize == null ? 32 : config.batchSize;\n\n // Validate user data.\n // TODO(cais): Add sampleWeight and classWeight.\n const standardizedOuts = this.standardizeUserData(x, y, false, batchSize);\n let inputs = standardizedOuts[0];\n let targets = standardizedOuts[1];\n // TODO(cais): Make use of sampleWeights in standardizedOuts[2] when\n // available.\n\n // Prepare validation data.\n let doValidation = false;\n let valX: Tensor|Tensor[];\n let valY: Tensor|Tensor[];\n let valIns: Tensor[];\n // A flag to keep track of whether `valIns`, `inputs` and `targets` need\n // to be memory-disposed prior to returning from this method. This is the\n // case if `config.validationSplit` is set to a number between 0 and 1, in\n // which case the input `x` and `y` tensors will be sliced, leading to\n // allocation of new tensor memory.\n let needValidationDisposal = false;\n if (config.validationData != null && config.validationData.length > 0) {\n doValidation = true;\n if (config.validationData.length === 2) {\n // config.validationData consists of valX and valY.\n valX = config.validationData[0];\n valY = config.validationData[1];\n } else if (config.validationData.length === 3) {\n throw new NotImplementedError(\n 'validationData including sample weights is not supported yet.');\n } else {\n throw new ValueError(\n `When passing validation data, it must contain 2 (valX, valY) ` +\n `or 3 (valX, valY, valSampleWeight) items; ` +\n `${config.validationData} is invalid.`);\n }\n\n const valStandardized =\n this.standardizeUserData(valX, valY, true, batchSize);\n valX = valStandardized[0] as Tensor[];\n valY = valStandardized[1] as Tensor[];\n // TODO(cais): Use validation sample weights in valStandardized[2] once\n // it becomes available.\n valIns = valX.concat(valY);\n // TODO(cais): Add useLearningPhase data properly.\n } else if (\n config.validationSplit != null && config.validationSplit > 0 &&\n config.validationSplit < 1) {\n doValidation = true;\n // Porting Note: In tfjs-layers, inputs[0] is always an Tensor.\n const splitAt =\n Math.floor(inputs[0].shape[0] * (1 - config.validationSplit));\n const originalBatchSize = inputs[0].shape[0];\n valX = sliceArrays(inputs, splitAt, originalBatchSize) as Tensor[];\n inputs = sliceArrays(inputs, 0, splitAt) as Tensor[];\n valY = sliceArrays(targets, splitAt, originalBatchSize) as Tensor[];\n targets = sliceArrays(targets, 0, splitAt) as Tensor[];\n needValidationDisposal = true;\n // TODO(cais): Once sampleWeights becomes available, slice it to get\n // valSampleWeights.\n valIns = valX.concat(valY);\n\n // TODO(cais): Add useLearningPhase data properly.\n } else if (config.validationSteps != null) {\n doValidation = true;\n // TODO(cais): Add useLearningPhase.\n }\n\n const ins = inputs.concat(targets);\n\n this.checkTrainableWeightsConsistency();\n\n // TODO(cais): Handle use_learning_phase and learning_phase?\n\n // Porting Note: Here we see a key deviation of tfjs-layers from Keras.\n // Due to the imperative nature of tfjs-layers' backend (tfjs-core),\n // we do not construct symbolic computation graphs to embody the training\n // process. Instead, we define a function that performs the training\n // action.\n // In PyKeras, the data (inputs and targets) are fed through graph\n // placeholders. In tfjs-layers, the data are fed as function arguments.\n // Since the function are defined below in the scope, we don't have\n // equivalents of PyKeras's `_make_train_funciton`.\n\n // Creat a function that performs the following actions:\n // 1) computes the losses,\n // 2) add them to get the total loss,\n // 3) call the optimizer computes the gradients of the Model's trainable\n // weights w.r.t. the total loss and update the variables.\n // 4) calculate the metrics\n // 5) return the values of the losses and metrics.\n const trainFunction = (data: Tensor[]) => {\n const losses: Tensor[] = [];\n const lossValues: Scalar[] = [];\n\n const inputs = data.slice(0, this.inputs.length);\n const targets = data.slice(\n this.inputs.length, this.inputs.length + this.outputs.length);\n\n const metricsValues: Scalar[] = [];\n\n // Create a function that computes the total loss based on the inputs.\n // This function is used for obtaining gradients through backprop.\n const totalLossFunction = () => {\n const feeds = [];\n for (let i = 0; i < this.inputs.length; ++i) {\n feeds.push({key: this.inputs[i], value: inputs[i]});\n }\n const feedDict = new FeedDict(feeds);\n const outputs =\n execute(this.outputs, feedDict, {'training': true}) as Tensor[];\n // TODO(cais): Take care of the case of multiple outputs from a\n // single layer?\n\n let totalLoss: Tensor;\n for (let i = 0; i < this.lossFunctions.length; ++i) {\n const lossFunction = this.lossFunctions[i];\n const loss = lossFunction(targets[i], outputs[i]);\n losses.push(loss);\n // TODO(cais): push Scalar instead.\n const meanLoss = tfc.mean(loss) as Scalar;\n // TODO(cais): Use a scope() instead, to avoid ownership.\n lossValues.push(meanLoss);\n if (i === 0) {\n totalLoss = loss;\n } else {\n totalLoss = tfc.add(totalLoss, loss);\n }\n }\n\n // Compute the metrics.\n // TODO(cais): These should probably be calculated outside\n // totalLossFunction to benefit speed?\n for (let i = 0; i < this.metricsTensors.length; ++i) {\n const metric = this.metricsTensors[i][0];\n const outputIndex = this.metricsTensors[i][1];\n // TODO(cais): Replace K.mean() with a proper weighting function.\n const meanMetric =\n tfc.mean(metric(targets[outputIndex], outputs[outputIndex])) as\n Scalar;\n tfc.keep(meanMetric);\n // TODO(cais): Use a scope() instead, to avoid ownership.\n metricsValues.push(meanMetric);\n }\n\n totalLoss = tfc.mean(totalLoss);\n\n // Add regularizer penalties.\n this.calculateLosses().forEach(regularizerLoss => {\n totalLoss = tfc.add(totalLoss, regularizerLoss);\n });\n\n return totalLoss as Scalar;\n };\n\n const variables = this.collectedTrainableWeights.map(\n param => param.read() as tfc.Variable);\n const returnCost = true;\n const totalLossValue =\n this.optimizer.minimize(totalLossFunction, returnCost, variables);\n\n return [totalLossValue].concat(metricsValues);\n };\n\n const outLabels = this.getDedupedMetricsNames();\n\n let valFunction: (data: Tensor[]) => Scalar[];\n let callbackMetrics: string[];\n if (doValidation) {\n this.makeTestFunction();\n valFunction = this.testFunction;\n callbackMetrics =\n outLabels.slice().concat(outLabels.map(n => 'val_' + n));\n } else {\n valFunction = null;\n valIns = [];\n callbackMetrics = outLabels.slice();\n }\n\n const callbacks = standardizeCallbacks(config.callbacks);\n const out = await this.fitLoop(\n trainFunction, ins, outLabels, batchSize, config.epochs, config.verbose,\n callbacks, valFunction, valIns, config.shuffle, callbackMetrics,\n config.initialEpoch, null, null);\n if (needValidationDisposal) {\n valIns.forEach(tensor => tensor.dispose());\n inputs.forEach(tensor => tensor.dispose());\n targets.forEach(tensor => tensor.dispose());\n }\n return out;\n // TODO(cais): Add value to outLabels.\n }\n\n /**\n * Extract weight values of the model.\n *\n * @param config: An instance of `io.SaveConfig`, which specifies\n * model-saving options such as whether only trainable weights are to be\n * saved.\n * @returns A `NamedTensorMap` mapping original weight names (i.e.,\n * non-uniqueified weight names) to their values.\n */\n protected getNamedWeights(config?: io.SaveConfig): NamedTensorMap {\n const namedWeights: NamedTensorMap = {};\n\n const trainableOnly = config != null && config.trainableOnly;\n const weights = trainableOnly ? this.trainableWeights : this.weights;\n const weightValues = this.getWeights(trainableOnly);\n for (let i = 0; i < weights.length; ++i) {\n if (trainableOnly && !weights[i].trainable) {\n // Optionally skip non-trainable weights.\n continue;\n }\n namedWeights[weights[i].originalName] = weightValues[i];\n }\n return namedWeights;\n }\n\n // tslint:disable:max-line-length\n /**\n * Save the configuration and/or weights of the Model.\n *\n * An `IOHandler` is an object that has a `save` method of the proper\n * signature defined. The `save` method manages the storing or transmission\n * of serialized data (\"artifacts\") that represent the model's topology and\n * weights onto or via a specific medium, such as file downloads, local\n * storage, IndexedDB in the web browser and HTTP requests to a server.\n * TensorFlow.js provides `IOHandler` implementations for a number of\n * frequently used saving mediums, such as `tf.io.browserDownloads` and\n * `tf.io.browserLocalStorage`. See `tf.io` for more details.\n *\n * This method also allows you to refer to certain types of `IOHandler`s as\n * URL-like string shortcuts, such as 'localstorage://' and 'indexeddb://'.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Saving `model`'s topology and weights as two files\n * (`my-model-1.json` and `my-model-1.weights.bin`) downloaded from browser.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('downloads://my-model-1');\n * ```\n *\n * Example 4. Send `model`'s topology and weights to an HTTP server.\n * See the documentation of `tf.io.browserHTTPRequests` for more details\n * including specifying request parameters and implementation of the server.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * const saveResults = await model.save('http://my-server/model/upload');\n * ```\n *\n * @param handlerOrURL An instance of `IOHandler` or a URL-like,\n * scheme-based string shortcut for `IOHandler`.\n * @param config Options for saving the model.\n * @returns A `Promise` of `SaveResult`, which summarizes the result of the\n * saving, such as byte sizes of the saved artifacts for the model's\n * topology and weight values.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [1]}\n */\n // tslint:enable:max-line-length\n async save(handlerOrURL: io.IOHandler|string, config?: io.SaveConfig):\n Promise {\n if (typeof handlerOrURL === 'string') {\n const handlers = io.getSaveHandlers(handlerOrURL);\n if (handlers.length === 0) {\n throw new ValueError(\n `Cannot find any save handlers for URL '${handlerOrURL}'`);\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) save handlers for ` +\n `URL '${handlerOrURL}'`);\n }\n handlerOrURL = handlers[0];\n }\n if (handlerOrURL.save == null) {\n throw new ValueError(\n 'Model.save() cannot proceed because the IOHandler provided does ' +\n 'not have the `save` attribute defined.');\n }\n\n const weightDataAndSpecs =\n await io.encodeWeights(this.getNamedWeights(config));\n\n const returnString = false;\n const unusedArg: {} = null;\n const modelConfig = this.toJSON(unusedArg, returnString);\n\n return handlerOrURL.save({\n modelTopology: modelConfig,\n weightData: weightDataAndSpecs.data,\n weightSpecs: weightDataAndSpecs.specs\n });\n }\n}\n\nserialization.SerializationMap.register(Model);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Optimizers.\n */\n\n// tslint:disable:max-line-length\nimport {Optimizer, train} from '@tensorflow/tfjs-core';\n\nimport {epsilon} from './backend/common';\n// tslint:enable:max-line-length\n\nimport {ValueError} from './errors';\n\n// Add (de)serialize()\n\n// Porting note: This diverges from the PyKeras implementation and may need to\n// change based on (de)serialization requirements.\nexport function getOptimizer(identifier: string): Optimizer {\n const optimizerMap: {[optimizerName: string]: () => Optimizer} = {\n 'Adagrad': () => train.adagrad(0.01),\n 'Adadelta': () => train.adadelta(1, 0.95, epsilon()),\n 'Adam': () => train.adam(0.001, 0.9, 0.999, epsilon()),\n 'Adamax': () => train.adamax(0.002, 0.9, 0.999, epsilon(), 0),\n 'RMSProp': () => train.rmsprop(0.001, 0.9, 0, epsilon()),\n 'SGD': () => train.sgd(0.01)\n };\n optimizerMap['adagrad'] = optimizerMap['Adagrad'];\n optimizerMap['adadelta'] = optimizerMap['Adadelta'];\n optimizerMap['adam'] = optimizerMap['Adam'];\n optimizerMap['adamax'] = optimizerMap['Adamax'];\n optimizerMap['rmsprop'] = optimizerMap['RMSProp'];\n optimizerMap['sgd'] = optimizerMap['SGD'];\n\n if (identifier in optimizerMap) {\n return optimizerMap[identifier]();\n }\n throw new ValueError(`Unknown Optimizer ${identifier}`);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source keras/models.py */\n\n// tslint:disable:max-line-length\nimport {io, Scalar, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {getUid} from './backend/state';\nimport {History} from './base_callbacks';\nimport {Input} from './engine/input_layer';\nimport {getSourceInputs, Layer, Node, SymbolicTensor} from './engine/topology';\nimport {Model, ModelCompileConfig, ModelEvaluateConfig, ModelFitConfig} from './engine/training';\nimport {RuntimeError, ValueError} from './errors';\nimport {deserialize} from './layers/serialization';\nimport {Kwargs, NamedTensorMap, Shape} from './types';\nimport {JsonDict} from './types';\nimport * as generic_utils from './utils/generic_utils';\nimport {convertPythonicToTs} from './utils/serialization_utils';\nimport {getExactlyOneShape} from './utils/types_utils';\n// tslint:enable:max-line-length\n\n/**\n * Parses a JSON model configuration file and returns a model instance.\n * @param modelAndWeightsConfig JSON object or string encoding a model and\n * weights configuration.\n * @param custom_objects Optional dictionary mapping names\n * (strings) to custom classes or functions to be\n * considered during deserialization.\n * @returns A TensorFlow.js Layers `Model` instance (uncompiled).\n */\nexport async function modelFromJSON(\n modelAndWeightsConfig: ModelAndWeightsConfig,\n customObjects?: serialization.ConfigDict): Promise {\n let modelTopology = modelAndWeightsConfig.modelTopology;\n if (modelTopology['model_config'] != null) {\n // If the model-topology JSON contains a 'model_config' field, then it is\n // a full model JSON (e.g., from `keras.Model.save()`), which contains\n // not only the model's architecture in its 'model_config' field, but\n // additional information such as the model's optimizer. We use only the\n // 'model_config' field currently.\n modelTopology = modelTopology['model_config'] as JsonDict;\n }\n const tsConfig =\n convertPythonicToTs(modelTopology) as serialization.ConfigDict;\n const model = deserialize(tsConfig, customObjects) as Model;\n\n if (modelAndWeightsConfig.weightsManifest != null) {\n // Load the weight values keyed by the original tensor names in the model\n // file that was loaded. These should match the keys of the weight\n // manifest.\n const weightValues =\n await io.loadWeights(\n modelAndWeightsConfig.weightsManifest,\n modelAndWeightsConfig.pathPrefix,\n model.weights.map(weight => weight.originalName)) as NamedTensorMap;\n\n // Map the weights to the unique tensor names generated during model loading\n const uniqueWeightValues: NamedTensorMap = {};\n for (const weight of model.weights) {\n uniqueWeightValues[weight.originalName] =\n weightValues[weight.originalName];\n }\n\n const skipMismatches: boolean = null;\n const isNamedTensorMap = true;\n model.loadWeights(uniqueWeightValues, skipMismatches, isNamedTensorMap);\n }\n return model;\n}\n\n/**\n * Options for loading a saved mode in TensorFlow.js format.\n */\nexport interface ModelAndWeightsConfig {\n /**\n * A JSON object or JSON string containing the model config.\n *\n * This can be either of the following two formats:\n * - A model archiecture-only config, i.e., a format consistent with the\n * return value of`keras.Model.to_json()`.\n * - A full model config, containing not only model architecture, but also\n * training options and state, i.e., a format consistent with the return\n * value of `keras.models.save_model()`.\n */\n modelTopology: JsonDict;\n\n /**\n * A weights manifest in TensorFlow.js format.\n */\n weightsManifest?: io.WeightsManifestConfig;\n\n /**\n * Path to prepend to the paths in `weightManifest` before fetching.\n *\n * The path may optionally end in a slash ('/').\n */\n pathPrefix?: string;\n}\n\n// TODO(nielsene): Remove after: https://github.com/tensorflow/tfjs/issues/400\nexport interface ModelPredictConfig {\n /**\n * Optional. Batch size (Integer). If unspecified, it will default to 32.\n */\n batchSize?: number;\n\n /**\n * Optional. Verbosity mode. Defaults to false.\n */\n verbose?: boolean;\n}\n\n// tslint:disable:max-line-length\n/**\n * Load a model, including its topology and optionally weights. See the\n * Tutorial named \"How to import a Keras Model\" for usage examples.\n *\n * Example 1: Save `model`'s topology and weights to browser [local\n * storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('localstorage://my-model-1');\n *\n * const loadedModel = await tf.loadModel('localstorage://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 2. Saving `model`'s topology and weights to browser\n * [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API);\n * then load it back.\n *\n * ```js\n * const model = tf.sequential(\n * {layers: [tf.layers.dense({units: 1, inputShape: [3]})]});\n * console.log('Prediction from original model:');\n * model.predict(tf.ones([1, 3])).print();\n *\n * const saveResults = await model.save('indexeddb://my-model-1');\n *\n * const loadedModel = await tf.loadModel('indexeddb://my-model-1');\n * console.log('Prediction from loaded model:');\n * loadedModel.predict(tf.ones([1, 3])).print();\n * ```\n *\n * Example 3. Load a model from user-selected files from HTML\n * [file input\n * elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file).\n *\n * ```js\n * // Note: this code snippet will not work without the HTML elements in the\n * // page\n * const jsonUpload = document.getElementById('json-upload');\n * const weightsUpload = document.getElementById('weights-upload');\n *\n * const model = await tf.loadModel(\n * tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));\n * ```\n *\n * Example 4. Load a model from an HTTP server.\n *\n * ```js\n * const model = await\n * tf.loadModel('https://storage.googleapis.com/tfjs-models/tfjs/iris_v1/model.json')\n * ```\n *\n * @param pathOrIOHandler Can be either of the two formats\n * 1. A string path to the `ModelAndWeightsConfig` JSON describing\n * the model in the canonical TensorFlow.js format. This path will be\n * interpreted as a relative HTTP path, to which `fetch` will be used to\n * request the model topology and weight manifest JSON.\n * The content of the JSON file is assumed to be a JSON object with the\n * following fields and values:\n * - 'modelTopology': A JSON object that can be either of:\n * 1. a model architecture JSON consistent with the format of the return\n * value of `keras.Model.to_json()`\n * 2. a full model JSON in the format of `keras.models.save_model()`.\n * - 'weightsManifest': A TensorFlow.js weights manifest.\n * See the Python converter function `save_model()` for more details.\n * It is also assumed that model weights can be accessed from relative\n * paths described by the `paths` fields in weights manifest.\n * 2. An `tf.io.IOHandler` object that loads model artifacts with its `load`\n * method.\n *\n * @returns A `Promise` of `Model`, with the topology and weights loaded.\n */\n// tslint:enable:max-line-length\nexport async function loadModelInternal(pathOrIOHandler: string|\n io.IOHandler): Promise {\n if (typeof pathOrIOHandler === 'string') {\n const handlers = io.getLoadHandlers(pathOrIOHandler);\n if (handlers.length === 0) {\n // For backward compatibility: if no load handler can be found,\n // assume it is a relative http path.\n handlers.push(io.browserHTTPRequest(pathOrIOHandler));\n } else if (handlers.length > 1) {\n throw new ValueError(\n `Found more than one (${handlers.length}) load handlers for ` +\n `URL '${pathOrIOHandler}'`);\n }\n pathOrIOHandler = handlers[0];\n }\n return loadModelFromIOHandler(pathOrIOHandler as io.IOHandler);\n}\n\n/**\n * Load a model and optionally its weights, using an IOHandler object.\n */\nexport async function loadModelFromIOHandler(\n handler: io.IOHandler,\n customObjects?: serialization.ConfigDict): Promise {\n if (handler.load == null) {\n throw new ValueError(\n 'Cannot proceed with model loading because the IOHandler provided ' +\n 'does not have the `load` method implemented.');\n }\n const artifacts = await handler.load();\n let modelTopology = artifacts.modelTopology as JsonDict;\n if (modelTopology['model_config'] != null) {\n modelTopology = modelTopology['model_config'] as JsonDict;\n }\n const model =\n deserialize(\n convertPythonicToTs(modelTopology) as serialization.ConfigDict,\n customObjects) as Model;\n\n // If weightData is present, load the weights into the model.\n if (artifacts.weightData != null) {\n // Loading weights requires weightSpecs.\n if (artifacts.weightSpecs == null) {\n throw new ValueError(\n 'Model artifacts contains weight data, but not weight specs. ' +\n 'Therefore loading of weights cannot proceed.');\n }\n\n const skipMismatch = false;\n const isNamedTensorMap = true;\n model.loadWeights(\n io.decodeWeights(artifacts.weightData, artifacts.weightSpecs),\n skipMismatch, isNamedTensorMap);\n }\n return model;\n}\n\n/**\n * Configuration for a Sequential model.\n */\nexport interface SequentialConfig {\n /** Stack of layers for the model. */\n layers?: Layer[];\n\n /** The name of this model. */\n name?: string;\n}\n\n/**\n * A model with a stack of layers, feeding linearly from one to the next.\n *\n * `sequential` is a factory function that creates an instance of\n * `Sequential`.\n *\n * ```js\n * // Define a model for linear regression.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 1, inputShape: [1]}));\n *\n * // Prepare the model for training: Specify the loss and the optimizer.\n * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n *\n * // Generate some synthetic data for training.\n * const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\n * const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\n *\n * // Train the model using the data then do inference on a data point the\n * // model hasn't seen:\n * await model.fit(xs, ys);\n * model.predict(tf.tensor2d([5], [1, 1])).print();\n * ```\n */\n/** @doc {heading: 'Models', subheading: 'Classes'} */\nexport class Sequential extends Model {\n static className = 'Sequential';\n private model: Model;\n private _updatable: boolean;\n constructor(config?: SequentialConfig) {\n super({inputs: [], outputs: []});\n config = config || {};\n\n this.trainable = true;\n this._updatable = true;\n this.built = false;\n\n // Set model name.\n this.name = (config.name != null) ? config.name : getUid('sequential_');\n\n // Add to the model any layers passed to the constructor.\n if (config.layers != null) {\n for (const layer of config.layers) {\n this.add(layer);\n }\n }\n }\n\n /**\n * Adds a layer instance on top of the layer stack.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.dense({units: 8, inputShape: [1]}));\n * model.add(tf.layers.dense({units: 4, activation: 'relu6'}));\n * model.add(tf.layers.dense({units: 1, activation: 'relu6'}));\n * // Note that the untrained model is random at this point.\n * model.predict(tf.randomNormal([10, 1])).print();\n * ```\n * @param layer Layer instance.\n *\n * @exception ValueError In case the `layer` argument does not know its input\n * shape.\n * @exception ValueError In case the `layer` argument has multiple output\n * tensors, or is already connected somewhere else (forbidden in\n * `Sequential` models).\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n add(layer: Layer): void {\n const isLayerModelInstance =\n layer instanceof Sequential || layer instanceof Model;\n let modelLayer: Model;\n if (isLayerModelInstance) {\n modelLayer = layer as Model;\n if (modelLayer.outputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n if (modelLayer.inputs.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single input tensor. ' +\n 'For multi-input layers, ' +\n 'use the functional API.');\n }\n }\n\n if (this.outputs.length === 0) {\n // first layer in model: check that it is an input layer\n if (layer.inboundNodes.length === 0) {\n // create an input layer\n if (layer.batchInputShape == null) {\n throw new ValueError(\n 'The first layer in a Sequential model must ' +\n 'get an `inputShape` or `batchInputShape` argument.');\n }\n // Instantiate the input layer.\n const x = Input({\n batchShape: layer.batchInputShape,\n dtype: layer.dtype,\n name: layer.name + '_input'\n });\n // This will build the current layer and create the node connecting\n // the current layer to the input layer we just created.\n layer.apply(x);\n }\n\n if (isLayerModelInstance) {\n this.outputs = modelLayer.outputs;\n this.inputs = modelLayer.inputs;\n } else {\n if (layer.inboundNodes.length !== 1) {\n throw new ValueError(\n 'A layer added to a Sequential model must not already be ' +\n `connected somewhere else. Model received layer ${layer.name} ` +\n `which has ${layer.inboundNodes.length} pre-existing inbound ` +\n 'connections.');\n }\n\n if (layer.inboundNodes[0].outputTensors.length !== 1) {\n throw new ValueError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.outputs = [layer.inboundNodes[0].outputTensors[0]];\n this.inputs = getSourceInputs(this.outputs[0]);\n }\n\n this.inboundNodes = [];\n // We create an input node, which we will keep updated\n // as we add more layers.\n // (This call has side effects.)\n // tslint:disable-next-line:no-unused-expression\n new Node({\n outboundLayer: this,\n inboundLayers: [],\n nodeIndices: [],\n tensorIndices: [],\n inputTensors: this.inputs,\n outputTensors: this.outputs,\n // no model-level masking for now\n inputMasks: generic_utils.pyListRepeat(null, this.inputs.length),\n outputMasks: [null],\n inputShapes: this.inputs.map(x => x.shape),\n outputShapes: this.outputs[0].shape\n });\n } else {\n const outputTensor = layer.apply(this.outputs[0]);\n if (Array.isArray(outputTensor)) {\n throw new TypeError(\n 'All layers in a Sequential model ' +\n 'should have a single output tensor. ' +\n 'For multi-output layers, ' +\n 'use the functional API.');\n }\n this.outputs = [outputTensor as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n\n this.layers.push(layer);\n this.built = false;\n }\n\n /**\n * Removes the last layer in the model.\n *\n * @exception TypeError if there are no layers in the model.\n */\n pop(): void {\n if (this.layers.length === 0) {\n throw new TypeError('There are no layers in the model.');\n }\n\n this.layers.pop();\n if (this.layers.length === 0) {\n this.outputs = [];\n this.inboundNodes = [];\n this.outboundNodes = [];\n } else {\n const lastLayerIndex = this.layers.length - 1;\n this.layers[lastLayerIndex].outboundNodes = [];\n this.outputs = [this.layers[lastLayerIndex].output as SymbolicTensor];\n // update self.inbound_nodes\n this.inboundNodes[0].outputTensors = this.outputs;\n this.inboundNodes[0].outputShapes = [this.outputs[0].shape];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.call(inputs, kwargs);\n }\n\n build(inputShape?: Shape|Shape[]) {\n // Call `getExactlyOneShape` without using its return value,\n // to verify that exactly one input shape is provided.\n getExactlyOneShape(inputShape);\n\n if (this.inputs.length === 0 || this.outputs.length === 0) {\n throw new TypeError(\n 'Sequential model cannot be built: model is empty.' +\n ' Add some layers first.');\n }\n // actually create the model\n this.model = new Model({\n inputs: this.inputs,\n outputs: this.outputs[0],\n name: this.name + '_model'\n });\n this.model.trainable = this.trainable;\n this.model.updatable = this.updatable;\n\n // mirror model attributes\n this.supportsMasking = this.model.supportsMasking;\n // TODO(michaelterry): Add caches\n this.inputLayers = this.model.inputLayers;\n this.inputLayersNodeIndices = this.model.inputLayersNodeIndices;\n this.inputLayersTensorIndices = this.model.inputLayersTensorIndices;\n this.outputLayers = this.model.outputLayers;\n this.outputLayersNodeIndices = this.model.outputLayersNodeIndices;\n this.outputLayersTensorIndices = this.model.outputLayersTensorIndices;\n this.nodesByDepth = this.model.nodesByDepth;\n this.containerNodes = this.model.containerNodes;\n this.outputNames = this.model.outputNames;\n this.inputNames = this.model.inputNames;\n // TODO(michaelterry): Add feedInputNames, feedInputs, if needed.\n // TODO(michaelterry): Add callbackModel if needed.\n this.built = true;\n }\n\n countParams(): number {\n if (!this.built) {\n this.build();\n }\n return super.countParams();\n }\n\n /**\n * Print a text summary of the Sequential model's layers.\n *\n * The summary includes\n * - Name and type of all layers that comprise the model.\n * - Output shape(s) of the layers\n * - Number of weight parameters of each layer\n * - The total number of trainable and non-trainable parameters of the model.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(\n * tf.layers.dense({units: 100, inputShape: [10], activation: 'relu'}));\n * model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));\n *\n * model.summary();\n * ```\n *\n * @param lineLength Custom line length, in number of characters.\n * @param positions Custom widths of each of the columns, as either\n * fractions of `lineLength` (e.g., `[0.5, 0.75, 1]`) or absolute number\n * of characters (e.g., `[30, 50, 65]`). Each number corresponds to\n * right-most (i.e., ending) position of a column.\n * @param printFn Custom print function. Can be used to replace the default\n * `console.log`. For example, you can use `x => {}` to mute the printed\n * messages in the console.\n */\n /** @doc {heading: 'Models', subheading: 'Classes'} */\n summary(\n lineLength?: number, positions?: number[],\n printFn:\n // tslint:disable-next-line:no-any\n (message?: any, ...optionalParams: any[]) => void = console.log) {\n if (!this.built) {\n this.build();\n }\n super.summary(lineLength, positions, printFn);\n }\n\n /**\n * Sets the weights of the model.\n *\n * @param weights Should be a list of Tensors with shapes and types matching\n * the output of `model.getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n if (this.model == null) {\n this.build();\n }\n this.model.setWeights(weights);\n }\n\n get updatable(): boolean {\n return this._updatable;\n }\n\n set updatable(value: boolean) {\n if (this.built) {\n this.model.updatable = value;\n }\n this._updatable = value;\n }\n\n /**\n * Returns the loss value & metrics values for the model in test mode.\n *\n * Loss and metrics are specified during `compile()`, which needs to happen\n * before calls to `evaluate()`.\n *\n * Computation is done in batches.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const result = model.evaluate(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * });\n * result.print();\n * ```\n *\n * @param x `Tensor` of test data, or an `Array` of `Tensor`s if the model\n * has multiple inputs.\n * @param y `Tensor` of target data, or an `Array` of `Tensor`s if the model\n * has multiple outputs.\n * @param config A `ModelEvaluateConfig`, containing optional fields.\n *\n * @return `Scalar` test loss (if the model has a single output and no\n * metrics) or `Array` of `Scalar`s (if the model has multiple outputs\n * and/or metrics). The attribute `model.metricsNames`\n * will give you the display labels for the scalar outputs.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n evaluate(\n x: Tensor|Tensor[], y: Tensor|Tensor[],\n config: ModelEvaluateConfig = {}): Scalar|Scalar[] {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before being used.');\n }\n return this.model.evaluate(x, y, config);\n }\n\n /**\n * Generates output predictions for the input samples.\n *\n * Computation is done in batches.\n *\n * Note: the \"step\" mode of predict() is currently not supported.\n * This is because the TensorFow.js core backend is imperative only.\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.predict(tf.ones([2, 10])).print();\n * ```\n *\n * @param x The input data, as an Tensor, or an `Array` of `Tensor`s if\n * the model has multiple inputs.\n * @param conifg A `ModelPredictConfig` object containing optional fields.\n *\n * @return `Tensor`(s) of predictions.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and the model's expectations, or in case a stateful model receives a\n * number of samples that is not a multiple of the batch size.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [1]}\n */\n predict(x: Tensor|Tensor[], config: ModelPredictConfig = {}): Tensor\n |Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predict(x, config);\n }\n\n /**\n * Returns predictions for a single batch of samples.\n *\n * @param x: Input samples, as an Tensor, or list of Tensors (if the model\n * has multiple inputs).\n * @return Tensor(s) of predictions\n */\n predictOnBatch(x: Tensor): Tensor|Tensor[] {\n if (this.model == null) {\n this.build();\n }\n return this.model.predictOnBatch(x);\n }\n\n /**\n * See `Model.compile`.\n *\n * @param config\n */\n compile(config: ModelCompileConfig): void {\n this.build();\n this.model.compile(config);\n this.optimizer = this.model.optimizer;\n this.loss = this.model.loss;\n this.metrics = this.model.metrics;\n // TODO(cais): Add this.lossWeights, this.sampleWeightMode,\n // this.weightedMetrics, this.targets.\n this.metricsTensors = this.model.metricsTensors;\n this.metricsNames = this.model.metricsNames;\n // TODO(cais): Add sampleWeights.\n }\n\n /**\n * Trains the model for a fixed number of epochs (iterations on a dataset).\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 1, inputShape: [10]})]\n * });\n * model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});\n * const history = await model.fit(tf.ones([8, 10]), tf.ones([8, 1]), {\n * batchSize: 4,\n * epochs: 3\n * });\n * console.log(history.history.loss[0]);\n * ```\n *\n * @param x `Tensor` of training data, or an array of `Tensor`s if the model\n * has multiple inputs. If all inputs in the model are named, you can also\n * pass a dictionary mapping input names to `Tensor`s.\n * @param y `Tensor` of target (label) data, or an array of `Tensor`s if the\n * model has multiple outputs. If all outputs in the model are named, you\n * can also pass a dictionary mapping output names to `Tensor`s.\n * @param config A `ModelFitConfig`, containing optional fields.\n *\n * @return A `History` instance. Its `history` attribute contains all\n * information collected during training.\n *\n * @exception ValueError In case of mismatch between the provided input data\n * and what the model expects.\n */\n /**\n * @doc {heading: 'Models', subheading: 'Classes', configParamIndices: [2]}\n */\n async fit(\n x: Tensor|Tensor[]|{[inputName: string]: Tensor},\n y: Tensor|Tensor[]|{[inputName: string]: Tensor},\n config: ModelFitConfig = {}): Promise {\n if (!this.built) {\n throw new RuntimeError(\n 'The model needs to be compiled before ' +\n 'being used.');\n }\n return this.model.fit(x, y, config);\n }\n\n /* See parent class for JsDoc */\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const model = new cls({});\n if (!(model instanceof Sequential)) {\n throw new ValueError(\n `Sequential.fromConfig called on non-Sequential input: ${model}`);\n }\n if (!(config instanceof Array)) {\n throw new ValueError(\n `Sequential.fromConfig called without an array of configs`);\n }\n if (!(config[0].className != null) || config[0]['className'] === 'Merge') {\n throw new ValueError('Legacy serialization format not supported yet.');\n }\n for (const conf of config as serialization.ConfigDictArray) {\n const layer = deserialize(conf as serialization.ConfigDict) as Layer;\n model.add(layer);\n }\n return model;\n }\n\n // TODO(cais): Override get trainableWeights() here\n\n // tslint:disable-next-line:no-any\n getConfig(): any {\n // NOTE(cais): We override the return type of getConfig() to `any` here,\n // because the `Sequential` class is a special case among `Container`\n // subtypes in that its getConfig() method returns an Array (not a\n // dict).\n const config: serialization.ConfigDict[] = [];\n for (const layer of this.layers) {\n config.push({\n className: layer.getClassName(),\n config: layer.getConfig(),\n });\n }\n return config;\n }\n}\nserialization.SerializationMap.register(Sequential);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Exported functions.\n */\n\n// tslint:disable:max-line-length\nimport {io} from '@tensorflow/tfjs-core';\n\nimport {ContainerConfig} from './engine/container';\nimport {Input, InputConfig,} from './engine/input_layer';\nimport {SymbolicTensor} from './engine/topology';\nimport {Model} from './engine/training';\nimport {loadModelInternal, Sequential, SequentialConfig} from './models';\n\n// tslint:enable:max-line-length\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Model and related factory methods.\n\n/**\n * A model is a data structure that consists of `Layers` and defines inputs\n * and outputs.\n *\n * The key difference between `model` and `sequential` is that `model`\n * is more generic, supporting an arbitrary graph (without cycles) of layers.\n * `sequential` is less generic and supports only a linear stack of layers.\n *\n * When creating a `Model`, specify its input(s) and output(s). Layers\n * are used to wire input(s) to output(s).\n *\n * For example, the following code snippet defines a model consisting of\n * two `dense` layers, with 10 and 4 units, respectively.\n *\n * ```js\n * // Define input, which has a size of 5 (not including batch dimension).\n * const input = tf.input({shape: [5]});\n *\n * // First dense layer uses relu activation.\n * const denseLayer1 = tf.layers.dense({units: 10, activation: 'relu'});\n * // Second dense layer uses softmax activation.\n * const denseLayer2 = tf.layers.dense({units: 2, activation: 'softmax'});\n *\n * // Obtain the output symbolic tensor by applying the layers on the input.\n * const output = denseLayer2.apply(denseLayer1.apply(input));\n *\n * // Create the model based on the inputs.\n * const model = tf.model({inputs: input, outputs: output});\n *\n * // The model can be used for training, evaluation and prediction.\n * // For example, the following line runs prediction with the model on\n * // some fake data.\n * model.predict(tf.ones([2, 5])).print();\n * ```\n * See also:\n * `sequential`, `loadModel`.\n */\n\n/**\n * @doc {heading: 'Models', subheading: 'Creation', configParamIndices: [0]}\n */\nexport function model(config: ContainerConfig): Model {\n return new Model(config);\n}\n\n/**\n * Creates a `Sequential` model. A sequential model is any model where the\n * outputs of one layer are the inputs to the next layer, i.e. the model\n * topology is a simple 'stack' of layers, with no branching or skipping.\n *\n * This means that the first layer passed to a Sequential model should have a\n * defined input shape. What that means is that it should have received an\n * `inputShape` or `batchInputShape` argument, or for some type of layers\n * (recurrent, Dense...) an `inputDim` argument.\n *\n * The key difference between `model` and `sequential` is that `sequential`\n * is less generic, supporting only a linear stack of layers. `model` is\n * more generic and supports an arbitrary graph (without cycles) of layers.\n *\n * Examples:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have an input shape defined.\n * model.add(tf.layers.dense({units: 32, inputShape: [50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output, which equals\n * // `[null, 4]`. The 1st dimension is the undetermined batch dimension; the\n * // 2nd is the output size of the model's last layer.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * It is also possible to specify a batch size (with potentially undetermined\n * batch dimension, denoted by \"null\") for the first layer using the\n * `batchInputShape` key. The following example is equivalent to the above:\n *\n * ```js\n * const model = tf.sequential();\n *\n * // First layer must have a defined input shape\n * model.add(tf.layers.dense({units: 32, batchInputShape: [null, 50]}));\n * // Afterwards, TF.js does automatic shape inference.\n * model.add(tf.layers.dense({units: 4}));\n *\n * // Inspect the inferred shape of the model's output.\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n *\n * You can also use an `Array` of already-constructed `Layer`s to create\n * a `Sequential` model:\n *\n * ```js\n * const model = tf.sequential({\n * layers: [tf.layers.dense({units: 32, inputShape: [50]}),\n * tf.layers.dense({units: 4})]\n * });\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n */\n/**\n * @doc {heading: 'Models', subheading: 'Creation', configParamIndices: [0]}\n */\nexport function sequential(config?: SequentialConfig): Sequential {\n return new Sequential(config);\n}\n\n/**\n * @doc {\n * heading: 'Models',\n * subheading: 'Loading',\n * useDocsFrom: 'loadModelInternal'\n * }\n */\nexport function loadModel(pathOrIOHandler: string|\n io.IOHandler): Promise {\n return loadModelInternal(pathOrIOHandler);\n}\n\n/**\n * @doc {\n * heading: 'Models',\n * subheading: 'Inputs',\n * useDocsFrom: 'Input',\n * configParamIndices: [0]\n * }\n */\nexport function input(config: InputConfig): SymbolicTensor {\n return Input(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n// Layer activation functions\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport * as K from './backend/tfjs_backend';\nimport {getScalar} from './backend/state';\nimport {deserializeKerasObject} from './utils/generic_utils';\n\n/**\n * Base class for Activations.\n *\n * Special note: due to cross-language compatibility reasons, the\n * static readonly className field in this family of classes must be set to\n * the initialLowerCamelCase name of the activation.\n */\nexport abstract class Activation extends serialization.Serializable {\n abstract apply(tensor: Tensor, axis?: number): Tensor;\n getConfig(): serialization.ConfigDict {\n return {};\n }\n}\n\n/** @docinline */\nexport type ActivationIdentifier = 'elu'|'hardSigmoid'|'linear'|'relu'|'relu6'|\n 'selu'|'sigmoid'|'softmax'|'softplus'|'softsign'|'tanh'|string;\n\n/**\n * Exponential linear unit (ELU).\n * Reference: https://arxiv.org/abs/1511.07289\n */\nexport class Elu extends Activation {\n static readonly className = 'elu';\n /**\n * Calculate the activation function.\n *\n * @param x: Input.\n * @param alpha: Scaling factor the negative section.\n * @return Output of the ELU activation.\n */\n apply(x: Tensor, alpha = 1): Tensor {\n return K.elu(x, alpha);\n }\n}\nserialization.SerializationMap.register(Elu);\n\n/**\n * Scaled Exponential Linear Unit. (Klambauer et al., 2017).\n * Reference: Self-Normalizing Neural Networks, https://arxiv.org/abs/1706.02515\n * Notes:\n * - To be used together with the initialization \"lecunNormal\".\n * - To be used together with the dropout variant \"AlphaDropout\".\n */\nexport class Selu extends Activation {\n static readonly className = 'selu';\n apply(x: Tensor): Tensor {\n return tfc.selu(x);\n }\n}\nserialization.SerializationMap.register(Selu);\n\n/**\n * Rectified linear unit\n */\nexport class Relu extends Activation {\n static readonly className = 'relu';\n apply(x: Tensor): Tensor {\n return tfc.relu(x);\n }\n}\nserialization.SerializationMap.register(Relu);\n\n/**\n * Rectified linear unit activation maxing out at 6.0.\n */\nexport class Relu6 extends Activation {\n static readonly className = 'relu6';\n apply(x: Tensor): Tensor {\n return tidy(() => tfc.minimum(getScalar(6.0), tfc.relu(x)));\n }\n}\nserialization.SerializationMap.register(Relu6);\n\n//* Linear activation (no-op) */\nexport class Linear extends Activation {\n static readonly className = 'linear';\n apply(x: Tensor): Tensor {\n return x;\n }\n}\nserialization.SerializationMap.register(Linear);\n\n/**\n * Sigmoid activation function.\n */\nexport class Sigmoid extends Activation {\n static readonly className = 'sigmoid';\n apply(x: Tensor): Tensor {\n return tfc.sigmoid(x);\n }\n}\nserialization.SerializationMap.register(Sigmoid);\n\n/**\n * Segment-wise linear approximation of sigmoid.\n */\nexport class HardSigmoid extends Activation {\n static readonly className = 'hardSigmoid';\n apply(x: Tensor): Tensor {\n return K.hardSigmoid(x);\n }\n}\nserialization.SerializationMap.register(HardSigmoid);\n\n/**\n * Softplus activation function.\n */\nexport class Softplus extends Activation {\n static readonly className = 'softplus';\n apply(x: Tensor): Tensor {\n return tfc.softplus(x);\n }\n}\nserialization.SerializationMap.register(Softplus);\n\n/**\n * Softsign activation function.\n */\nexport class Softsign extends Activation {\n static readonly className = 'softsign';\n apply(x: Tensor): Tensor {\n return K.softsign(x);\n }\n}\nserialization.SerializationMap.register(Softsign);\n\n/**\n * Hyperbolic tangent function.\n */\nexport class Tanh extends Activation {\n static readonly className = 'tanh';\n apply(x: Tensor): Tensor {\n return tfc.tanh(x);\n }\n}\nserialization.SerializationMap.register(Tanh);\n\n/**\n * Softmax activation function\n */\nexport class Softmax extends Activation {\n static readonly className = 'softmax';\n /**\n * Calculate the activation function.\n *\n * @param x Tensor.\n * @param axis Integer, axis along which the softmax normalization is applied.\n * Invalid if < 2, as softmax across 1 (the batch dimension) is assumed to be\n * an error.\n *\n * @returns a Tensor of the same shape as x\n *\n * @throws ValueError: In case `dim(x) < 2`.\n */\n apply(x: Tensor, axis: number = (-1)): Tensor {\n return tfc.softmax(x, axis);\n }\n}\nserialization.SerializationMap.register(Softmax);\n\nexport function serializeActivation(activation: Activation): string {\n return activation.getClassName();\n}\n\nexport function deserializeActivation(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Activation {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'activation');\n}\n\nexport function getActivation(identifier: ActivationIdentifier|\n serialization.ConfigDict|Activation): Activation {\n if (identifier == null) {\n const config = {className: 'linear', config: {}};\n return deserializeActivation(config);\n }\n if (typeof identifier === 'string') {\n const config = {className: identifier, config: {}};\n return deserializeActivation(config);\n } else if (identifier instanceof Activation) {\n return identifier;\n } else {\n return deserializeActivation(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Advanced activation layers.\n */\n\nimport {elu, leakyRelu, serialization, Tensor} from '@tensorflow/tfjs-core';\n\nimport {Softmax as softmaxActivation} from '../activations';\nimport {cast} from '../backend/tfjs_backend';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {getExactlyOneTensor} from '../utils/types_utils';\n\nexport interface LeakyReLULayerConfig extends LayerConfig {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `0.3`.\n */\n alpha?: number;\n}\n\n/**\n * Leaky version of a rectified linear unit.\n *\n * It allows a small gradient when the unit is not active:\n * `f(x) = alpha * x for x < 0.`\n * `f(x) = x for x >= 0.`\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n */\nexport class LeakyReLU extends Layer {\n static className = 'LeakyReLU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 0.3;\n\n constructor(config?: LeakyReLULayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n\n this.alpha = config.alpha == null ? this.DEFAULT_ALPHA : config.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return leakyRelu(x, this.alpha);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(LeakyReLU);\n\n// TODO(cais): Implement PReLU\n\nexport interface ELULayerConfig extends LayerConfig {\n /**\n * Float `>= 0`. Negative slope coefficient. Defaults to `1.0`.\n */\n alpha?: number;\n}\n\n/**\n * Exponetial Linear Unit (ELU).\n *\n * It follows:\n * `f(x) = alpha * (exp(x) - 1.) for x < 0`,\n * `f(x) = x for x >= 0`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Fast and Accurate Deep Network Learning by Exponential Linear Units\n * (ELUs)](https://arxiv.org/abs/1511.07289v1)\n */\nexport class ELU extends Layer {\n static className = 'ELU';\n readonly alpha: number;\n\n readonly DEFAULT_ALPHA = 1.0;\n\n constructor(config?: ELULayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n\n if (config.alpha != null && config.alpha !== this.DEFAULT_ALPHA) {\n throw new NotImplementedError(\n `Non-default alpha value (${config.alpha}) is not supported by the ` +\n `ELU layer yet.`);\n }\n\n this.alpha = config.alpha == null ? this.DEFAULT_ALPHA : config.alpha;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return elu(x);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {alpha: this.alpha};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(ELU);\n\nexport interface ThresholdedReLULayerConfig extends LayerConfig {\n /**\n * Float >= 0. Threshold location of activation.\n */\n theta?: number;\n}\n\n/**\n * Thresholded Rectified Linear Unit.\n *\n * It follows:\n * `f(x) = x for x > theta`,\n * `f(x) = 0 otherwise`.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n *\n * References:\n * - [Zero-Bias Autoencoders and the Benefits of Co-Adapting\n * Features](http://arxiv.org/abs/1402.3337)\n */\nexport class ThresholdedReLU extends Layer {\n static className = 'ThresholdedReLU';\n readonly theta: number;\n private readonly thetaTensor: Tensor;\n\n readonly DEFAULT_THETA = 1.0;\n\n constructor(config?: ThresholdedReLULayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n\n this.theta = config.theta == null ? this.DEFAULT_THETA : config.theta;\n this.thetaTensor = getScalar(this.theta);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return x.mul(cast(x.greater(this.thetaTensor), 'float32'));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {theta: this.theta};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(ThresholdedReLU);\n\nexport interface SoftmaxLayerConfig extends LayerConfig {\n /**\n * Integer, axis along which the softmax normalization is applied.\n * Defaults to `-1` (i.e., the last axis).\n */\n axis?: number;\n}\n\n/**\n * Softmax activation layer.\n *\n * Input shape:\n * Arbitrary. Use the configuration `inputShape` when using this layer as the\n * first layer in a model.\n *\n * Output shape:\n * Same shape as the input.\n */\nexport class Softmax extends Layer {\n static className = 'Softmax';\n readonly axis: number;\n readonly softmax: (t: Tensor, a?: number) => Tensor;\n readonly DEFAULT_AXIS = 1.0;\n\n constructor(config?: SoftmaxLayerConfig) {\n super(config == null ? {} : config);\n if (config == null) {\n config = {};\n }\n this.softmax = new softmaxActivation().apply;\n this.axis = config.axis == null ? this.DEFAULT_AXIS : config.axis;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n const x = getExactlyOneTensor(inputs);\n return this.softmax(x, this.axis);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n return inputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {axis: this.axis};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Softmax);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* original source: keras/regularizers.py */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {abs, add, Scalar, serialization, sum, Tensor, tidy, zeros} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from './backend/state';\nimport * as K from './backend/tfjs_backend';\nimport {deserializeKerasObject, serializeKerasObject} from './utils/generic_utils';\n// tslint:enable:max-line-length\n\n/**\n * Regularizer base class.\n */\nexport abstract class Regularizer extends serialization.Serializable {\n abstract apply(x: Tensor): Scalar;\n}\n\nexport interface L1L2Config {\n /** L1 regularization rate. Defaults to 0.01. */\n l1?: number;\n /** L2 regularization rate. Defaults to 0.01. */\n l2?: number;\n}\n\nexport interface L1Config {\n /** L1 regularization rate. Defaults to 0.01. */\n l1: number;\n}\n\nexport interface L2Config {\n /** L2 regularization rate. Defaults to 0.01. */\n l2: number;\n}\n\n/**\n * Regularizer for L1 and L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x)) + sum(l2 * x^2)\n */\n/** @doc {heading: 'Regularizers', namespace: 'regularizers'} */\nexport class L1L2 extends Regularizer {\n static className = 'L1L2';\n\n private readonly l1: Scalar;\n private readonly l2: Scalar;\n private readonly hasL1: boolean;\n private readonly hasL2: boolean;\n constructor(config?: L1L2Config) {\n super();\n\n const l1 = config == null || config.l1 == null ? 0.01 : config.l1;\n const l2 = config == null || config.l2 == null ? 0.01 : config.l2;\n this.hasL1 = l1 !== 0;\n this.hasL2 = l2 !== 0;\n\n this.l1 = getScalar(l1);\n this.l2 = getScalar(l2);\n }\n\n /**\n * Porting note: Renamed from __call__.\n * @param x Variable of which to calculate the regularization score.\n */\n apply(x: Tensor): Scalar {\n return tidy(() => {\n let regularization: Tensor = zeros([1]);\n if (this.hasL1) {\n regularization = add(regularization, sum(tfc.mul(this.l1, abs(x))));\n }\n if (this.hasL2) {\n regularization =\n add(regularization, sum(tfc.mul(this.l2, K.square(x))));\n }\n return regularization.asScalar();\n });\n }\n\n getConfig(): serialization.ConfigDict {\n return {'l1': this.l1.dataSync()[0], 'l2': this.l2.dataSync()[0]};\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n return new cls({l1: config.l1 as number, l2: config.l2 as number});\n }\n}\nserialization.SerializationMap.register(L1L2);\n\n/**\n * Regularizer for L1 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l1 * abs(x))\n * @param config l1 config.\n */\nexport function l1(config?: L1Config) {\n return new L1L2({l1: config != null ? config.l1 : null, l2: 0});\n}\n\n/**\n * Regularizer for L2 regularization.\n *\n * Adds a term to the loss to penalize large weights:\n * loss += sum(l2 * x^2)\n * @param config l2 config.\n */\nexport function l2(config: L2Config) {\n return new L1L2({l2: config != null ? config.l2 : null, l1: 0});\n}\n\n/** @docinline */\nexport type RegularizerIdentifier = 'l1l2'|string;\n\n// Maps the JavaScript-like identifier keys to the corresponding keras symbols.\nexport const REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP:\n {[identifier in RegularizerIdentifier]: string} = {\n 'l1l2': 'L1L2'\n };\n\nexport function serializeRegularizer(constraint: Regularizer):\n serialization.ConfigDictValue {\n return serializeKerasObject(constraint);\n}\n\nexport function deserializeRegularizer(\n config: serialization.ConfigDict,\n customObjects: serialization.ConfigDict = {}): Regularizer {\n return deserializeKerasObject(\n config, serialization.SerializationMap.getMap().classNameMap,\n customObjects, 'regularizer');\n}\n\nexport function getRegularizer(identifier: RegularizerIdentifier|\n serialization.ConfigDict|\n Regularizer): Regularizer {\n if (identifier == null) {\n return null;\n }\n if (typeof identifier === 'string') {\n const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?\n REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :\n identifier;\n const config = {className, config: {}};\n return deserializeRegularizer(config);\n } else if (identifier instanceof Regularizer) {\n return identifier;\n } else {\n return deserializeRegularizer(identifier);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\nimport {PaddingMode} from '../common';\nimport {ValueError} from '../errors';\n\nimport {pyListRepeat} from './generic_utils';\nimport {isInteger, max} from './math_utils';\n\n/**\n * Transforms a single number of array of numbers into an array of numbers.\n * @param value\n * @param n: The size of the tuple to be returned.\n * @param name: Name of the parameter, used for generating error messages.\n * @returns An array of numbers.\n */\nexport function normalizeArray(\n value: number|number[], n: number, name: string): number[] {\n if (typeof value === 'number') {\n return pyListRepeat(value, n);\n } else {\n if (value.length !== n) {\n throw new ValueError(\n `The ${name} argument must be a tuple of ${n} integers. Received: ` +\n `${value.length} elements.`);\n }\n for (let i = 0; i < n; ++i) {\n const singleValue = value[i];\n if (!isInteger(singleValue)) {\n throw new ValueError(\n `The ${name} argument must be a tuple of ${\n n} integers. Received: ` +\n `${JSON.stringify(value)} including a non-integer number ` +\n `${singleValue}`);\n }\n }\n return value;\n }\n}\n\n/**\n * Determines output length of a convolution given input length.\n * @param inputLength\n * @param filterSize\n * @param padding\n * @param stride\n * @param dilation: dilation rate.\n */\nexport function convOutputLength(\n inputLength: number, filterSize: number, padding: PaddingMode,\n stride: number, dilation = 1): number {\n if (inputLength == null) {\n return inputLength;\n }\n const dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1);\n let outputLength: number;\n if (padding === 'same') {\n outputLength = inputLength;\n } else { // VALID\n outputLength = inputLength - dilatedFilterSize + 1;\n }\n return Math.floor((outputLength + stride - 1) / stride);\n}\n\nexport function deconvLength(\n dimSize: number, strideSize: number, kernelSize: number,\n padding: PaddingMode): number {\n if (dimSize == null) {\n return null;\n }\n\n if (padding === 'valid') {\n dimSize = dimSize * strideSize + max([kernelSize - strideSize, 0]);\n } else if (padding === 'same') {\n dimSize = dimSize * strideSize;\n } else {\n throw new ValueError(`Unsupport padding mode: ${padding}.`);\n }\n return dimSize;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Convolutional Layers\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {Activation, getActivation, serializeActivation} from '../activations';\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, DataFormat, PaddingMode} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerConfig} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport {convOutputLength, deconvLength, normalizeArray} from '../utils/conv_utils';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n// tslint:enable:max-line-length\n\n/**\n * Transpose and cast the input before the conv2d.\n * @param x Input image tensor.\n * @param dataFormat\n */\nexport function preprocessConv2DInput(\n x: Tensor, dataFormat: DataFormat): Tensor {\n // TODO(cais): Cast type to float32 if not.\n return tidy(() => {\n checkDataFormat(dataFormat);\n if (dataFormat === 'channelsFirst') {\n return tfc.transpose(x, [0, 2, 3, 1]); // NCHW -> NHWC.\n } else {\n return x;\n }\n });\n}\n\n/**\n * 1D-convolution with bias added.\n *\n * Porting Note: This function does not exist in the Python Keras backend.\n * It is exactly the same as `conv2d`, except the added `bias`.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.\n * @param bias Bias, rank-3, of shape `[outDepth]`.\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n // Check the ranks of x, kernel and bias.\n if (x.shape.length !== 3) {\n throw new ValueError(\n `The input of a conv1dWithBias operation should be 3, but is ` +\n `${x.shape.length} instead.`);\n }\n if (kernel.shape.length !== 3) {\n throw new ValueError(\n `The kernel for a conv1dWithBias operation should be 3, but is ` +\n `${kernel.shape.length} instead`);\n }\n if (bias != null && bias.shape.length !== 1) {\n throw new ValueError(\n `The bias for a conv1dWithBias operation should be 1, but is ` +\n `${kernel.shape.length} instead`);\n }\n // TODO(cais): Support CAUSAL padding mode.\n if (dataFormat === 'channelsFirst') {\n x = tfc.transpose(x, [0, 2, 1]); // NCW -> NWC.\n }\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n let y: Tensor = tfc.conv1d(\n x as Tensor2D | Tensor3D, kernel as Tensor3D, strides,\n padding === 'same' ? 'same' : 'valid', 'NWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias);\n }\n return y;\n });\n}\n\n/**\n * 1D-convolution.\n *\n * @param x Input tensor, rank-3, of shape `[batchSize, width, inChannels]`.\n * @param kernel Kernel, rank-3, of shape `[filterWidth, inDepth, outDepth]`.s\n * @param strides\n * @param padding Padding mode.\n * @param dataFormat Data format.\n * @param dilationRate\n * @returns The result of the 1D convolution.\n * @throws ValueError, if `x`, `kernel` or `bias` is not of the correct rank.\n */\nexport function conv1d(\n x: Tensor, kernel: Tensor, strides = 1, padding = 'valid',\n dataFormat?: DataFormat, dilationRate = 1): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv1dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution\n * @param x\n * @param kernel kernel of the convolution.\n * @param strides strides array.\n * @param padding padding mode. Default to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param dilationRate dilation rate array.\n * @returns Result of the 2D pooling.\n */\nexport function conv2d(\n x: Tensor, kernel: Tensor, strides = [1, 1], padding = 'valid',\n dataFormat?: DataFormat, dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n return conv2dWithBias(\n x, kernel, null, strides, padding, dataFormat, dilationRate);\n });\n}\n\n/**\n * 2D Convolution with an added bias.\n * Note: This function does not exist in the Python Keras Backend. This function\n * is exactly the same as `conv2d`, except the added `bias`.\n */\nexport function conv2dWithBias(\n x: Tensor, kernel: Tensor, bias: Tensor, strides = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n if (x.rank !== 3 && x.rank !== 4) {\n throw new ValueError(\n `conv2dWithBias expects input to be of rank 3 or 4, but received ` +\n `${x.rank}.`);\n }\n if (kernel.rank !== 3 && kernel.rank !== 4) {\n throw new ValueError(\n `conv2dWithBias expects kernel to be of rank 3 or 4, but received ` +\n `${x.rank}.`);\n }\n let y = preprocessConv2DInput(x, dataFormat);\n if (padding === 'causal') {\n throw new NotImplementedError(\n 'The support for CAUSAL padding mode in conv1dWithBias is not ' +\n 'implemented yet.');\n }\n y = tfc.conv2d(\n y as Tensor3D | Tensor4D, kernel as Tensor4D,\n strides as [number, number], padding === 'same' ? 'same' : 'valid',\n 'NHWC', dilationRate);\n if (bias != null) {\n y = K.biasAdd(y, bias as Tensor1D);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\n\n/**\n * Base LayerConfig for depthwise and non-depthwise convolutional layers.\n */\nexport interface BaseConvLayerConfig extends LayerConfig {\n /**\n * The dimensions of the convolution window. If kernelSize is a number, the\n * convolutional window will be square.\n */\n kernelSize: number|number[];\n\n /**\n * The strides of the convolution in each dimension. If strides is a number,\n * strides in both dimensions are equal.\n *\n * Specifying any stride value != 1 is incompatible with specifying any\n * `dilationRate` value != 1.\n */\n strides?: number|number[];\n\n /**\n * Padding mode.\n */\n padding?: PaddingMode;\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n\n /**\n * The dilation rate to use for the dilated convolution in each dimension.\n * Should be an integer or array of two integers.\n *\n * Currently, specifying any `dilationRate` value != 1 is incompatible with\n * specifying any `strides` value != 1.\n */\n dilationRate?: number|[number]|[number, number];\n\n /**\n * Activation function of the layer.\n *\n * If you don't specify the activation, none is applied.\n */\n activation?: string;\n\n /**\n * Whether the layer uses a bias vector. Defaults to `true`.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the convolutional kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the convolutional kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * LayerConfig for non-depthwise convolutional layers.\n * Applies to non-depthwise convolution of all ranks (e.g, Conv1D, Conv2D).\n */\nexport interface ConvLayerConfig extends BaseConvLayerConfig {\n /**\n * The dimensionality of the output space (i.e. the number of filters in the\n * convolution).\n */\n filters: number;\n}\n\n/**\n * Abstract convolution layer.\n */\nexport abstract class BaseConv extends Layer {\n protected readonly rank: number;\n protected readonly kernelSize: number[];\n protected readonly strides: number[];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n protected readonly activation: Activation;\n protected readonly useBias: boolean;\n protected readonly dilationRate: number[];\n\n // Bias-related members are here because all convolution subclasses use the\n // same configuration parmeters to control bias. Kernel-related members\n // are in subclass `Conv` because some subclasses use different parameters to\n // control kernel properties, for instance, `DepthwiseConv2D` uses\n // `depthwiseInitializer` instead of `kernelInitializer`.\n protected readonly biasInitializer?: Initializer;\n protected readonly biasConstraint?: Constraint;\n protected readonly biasRegularizer?: Regularizer;\n\n protected bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(rank: number, config: BaseConvLayerConfig) {\n super(config as LayerConfig);\n BaseConv.verifyConfig(config);\n this.rank = rank;\n if (this.rank !== 1 && this.rank !== 2) {\n throw new NotImplementedError(\n `Convolution layer for rank other than 1 or 2 (${this.rank}) is ` +\n `not implemented yet.`);\n }\n this.kernelSize = normalizeArray(config.kernelSize, rank, 'kernelSize');\n this.strides = normalizeArray(\n config.strides == null ? 1 : config.strides, rank, 'strides');\n this.padding = config.padding == null ? 'valid' : config.padding;\n checkPaddingMode(this.padding);\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n checkDataFormat(this.dataFormat);\n this.activation = getActivation(config.activation);\n this.useBias = config.useBias == null ? true : config.useBias;\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.biasConstraint = getConstraint(config.biasConstraint);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n this.activityRegularizer = getRegularizer(config.activityRegularizer);\n this.dilationRate = normalizeArray(\n config.dilationRate == null ? 1 : config.dilationRate, rank,\n 'dilationRate');\n if (this.rank === 1 &&\n (Array.isArray(this.dilationRate) &&\n (this.dilationRate as number[]).length !== 1)) {\n throw new ValueError(\n `dilationRate must be a number or an array of a single number ` +\n `for 1D convolution, but received ` +\n `${JSON.stringify(this.dilationRate)}`);\n }\n if (this.rank === 2) {\n if (typeof this.dilationRate === 'number') {\n this.dilationRate = [this.dilationRate, this.dilationRate];\n } else if (this.dilationRate.length !== 2) {\n throw new ValueError(\n `dilationRate must be a number or array of two numbers for 2D ` +\n `convolution, but received ${JSON.stringify(this.dilationRate)}`);\n }\n }\n }\n\n protected static verifyConfig(config: BaseConvLayerConfig) {\n // Check config.kernelSize type and shape.\n generic_utils.assert(\n 'kernelSize' in config, `required key 'kernelSize' not in config`);\n if (typeof config.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n config.kernelSize, 'number', 1, 2))\n throw new ValueError(\n `BaseConv expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(config.kernelSize)}.`);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n kernelSize: this.kernelSize,\n strides: this.strides,\n padding: this.padding,\n dataFormat: this.dataFormat,\n dilationRate: this.dilationRate,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n biasInitializer: serializeInitializer(this.biasInitializer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Abstract nD convolution layer. Ancestor of convolution layers which reduce\n * across channels, i.e., Conv1D and Conv2D, but not DepthwiseConv2D.\n */\nexport abstract class Conv extends BaseConv {\n protected readonly filters: number;\n\n protected kernel: LayerVariable = null;\n\n // Bias-related properties are stored in the superclass `BaseConv` because all\n // convolution subclasses use the same configuration parameters to control\n // bias. Kernel-related properties are defined here rather than in the\n // superclass because some convolution subclasses use different names and\n // configuration parameters for their internal kernel state.\n protected readonly kernelInitializer?: Initializer;\n protected readonly kernelConstraint?: Constraint;\n protected readonly kernelRegularizer?: Regularizer;\n\n constructor(rank: number, config: ConvLayerConfig) {\n super(rank, config as BaseConvLayerConfig);\n Conv.verifyConfig(config);\n this.filters = config.filters;\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n `The channel dimension of the input should be defined. ` +\n `Found ${inputShape[channelAxis]}`);\n }\n const inputDim = inputShape[channelAxis];\n\n const kernelShape = this.kernelSize.concat([inputDim, this.filters]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n this.inputSpec = [{ndim: this.rank + 2, axes: {[channelAxis]: inputDim}}];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs: Tensor;\n const biasValue = this.bias == null ? null : this.bias.read();\n\n if (this.rank === 1) {\n outputs = conv1dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides[0],\n this.padding, this.dataFormat, this.dilationRate[0]);\n } else if (this.rank === 2) {\n // TODO(cais): Move up to constructor.\n outputs = conv2dWithBias(\n inputs, this.kernel.read(), biasValue, this.strides, this.padding,\n this.dataFormat, this.dilationRate as [number, number]);\n } else if (this.rank === 3) {\n throw new NotImplementedError('3D convolution is not implemented yet.');\n }\n\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const newSpace: number[] = [];\n const space = (this.dataFormat === 'channelsLast') ?\n inputShape.slice(1, inputShape.length - 1) :\n inputShape.slice(2);\n for (let i = 0; i < space.length; ++i) {\n const newDim = convOutputLength(\n space[i], this.kernelSize[i], this.padding, this.strides[i],\n typeof this.dilationRate === 'number' ? this.dilationRate :\n this.dilationRate[i]);\n newSpace.push(newDim);\n }\n\n let outputShape = [inputShape[0]];\n if (this.dataFormat === 'channelsLast') {\n outputShape = outputShape.concat(newSpace);\n outputShape.push(this.filters);\n } else {\n outputShape.push(this.filters);\n outputShape = outputShape.concat(newSpace);\n }\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n filters: this.filters,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n protected static verifyConfig(config: ConvLayerConfig) {\n // Check config.filters type, shape, and value.\n if (!('filters' in config) || typeof config.filters !== 'number' ||\n config.filters < 1) {\n throw new ValueError(\n `Convolution layer expected config.filters to be a 'number' > 0 ` +\n `but got ${JSON.stringify(config.filters)}`);\n }\n }\n}\n\n\n/**\n * 2D convolution layer (e.g. spatial convolution over images).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input to produce a tensor of outputs.\n *\n * If `useBias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model,\n * provide the keyword argument `inputShape`\n * (Array of integers, does not include the sample axis),\n * e.g. `inputShape=[128, 128, 3]` for 128x128 RGB pictures\n * in `dataFormat='channelsLast'`.\n */\nexport class Conv2D extends Conv {\n static className = 'Conv2D';\n constructor(config: ConvLayerConfig) {\n super(2, config);\n Conv2D.verifyConfig(config);\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n return config;\n }\n\n protected static verifyConfig(config: ConvLayerConfig) {\n // config.kernelSize must be a number or array of numbers.\n if ((typeof config.kernelSize !== 'number') &&\n !generic_utils.checkArrayTypeAndLength(\n config.kernelSize, 'number', 1, 2))\n throw new ValueError(\n `Conv2D expects config.kernelSize to be number or number[] with ` +\n `length 1 or 2, but received ${JSON.stringify(config.kernelSize)}.`);\n }\n}\nserialization.SerializationMap.register(Conv2D);\n\n/**\n * Transposed convolutional layer (sometimes called Deconvolution).\n *\n * The need for transposed convolutions generally arises\n * from the desire to use a transformation going in the opposite direction of\n * a normal convolution, i.e., from something that has the shape of the output\n * of some convolution to something that has the shape of its input while\n * maintaining a connectivity pattern that is compatible with said\n * convolution.\n *\n * When using this layer as the first layer in a model, provide the\n * configuration `inputShape` (`Array` of integers, does not include the\n * sample axis), e.g., `inputShape: [128, 128, 3]` for 128x128 RGB pictures in\n * `dataFormat: 'channelsLast'`.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if `dataFormat` is `'channelsFirst'`.\n * or 4D tensor with shape\n * `[batch, rows, cols, channels]` if `dataFormat` is `'channelsLast`.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if `dataFormat` is\n * `'channelsFirst'`. or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if `dataFormat` is `'channelsLast'`.\n *\n * References:\n * - [A guide to convolution arithmetic for deep\n * learning](https://arxiv.org/abs/1603.07285v1)\n * - [Deconvolutional\n * Networks](http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf)\n */\nexport class Conv2DTranspose extends Conv2D {\n static className = 'Conv2DTranspose';\n inputSpec: InputSpec[];\n\n constructor(config: ConvLayerConfig) {\n super(config);\n this.inputSpec = [new InputSpec({ndim: 4})];\n\n if (this.padding !== 'same' && this.padding !== 'valid') {\n throw new ValueError(\n `Conv2DTranspose currently supports only padding modes 'same' ` +\n `and 'valid', but received padding mode ${this.padding}`);\n }\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n\n if (inputShape.length !== 4) {\n throw new ValueError(\n 'Input should have rank 4; Received input shape: ' +\n JSON.stringify(inputShape));\n }\n\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null) {\n throw new ValueError(\n 'The channel dimension of the inputs should be defined. ' +\n 'Found `None`.');\n }\n const inputDim = inputShape[channelAxis];\n const kernelShape = this.kernelSize.concat([this.filters, inputDim]);\n\n this.kernel = this.addWeight(\n 'kernel', kernelShape, 'float32', this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n\n // Set input spec.\n this.inputSpec =\n [new InputSpec({ndim: 4, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs);\n if (input.shape.length !== 4) {\n throw new ValueError(\n `Conv2DTranspose.call() expects input tensor to be rank-4, but ` +\n `received a tensor of rank-${input.shape.length}`);\n }\n\n const inputShape = input.shape;\n const batchSize = inputShape[0];\n\n let hAxis: number;\n let wAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n hAxis = 2;\n wAxis = 3;\n } else {\n hAxis = 1;\n wAxis = 2;\n }\n\n const height = inputShape[hAxis];\n const width = inputShape[wAxis];\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n // Infer the dynamic output shape.\n const outHeight = deconvLength(height, strideH, kernelH, this.padding);\n const outWidth = deconvLength(width, strideW, kernelW, this.padding);\n\n // Porting Note: We don't branch based on `this.dataFormat` here,\n // because\n // the tjfs-core function `conv2dTranspose` called below always\n // assumes channelsLast.\n const outputShape: [number, number, number, number] =\n [batchSize, outHeight, outWidth, this.filters];\n\n if (this.dataFormat !== 'channelsLast') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n }\n let outputs = tfc.conv2dTranspose(\n input as Tensor4D, this.kernel.read() as Tensor4D, outputShape,\n this.strides as [number, number], this.padding as 'same' | 'valid');\n if (this.dataFormat !== 'channelsLast') {\n outputs = tfc.transpose(outputs, [0, 3, 1, 2]) as Tensor4D;\n }\n\n if (this.bias != null) {\n outputs =\n K.biasAdd(outputs, this.bias.read(), this.dataFormat) as Tensor4D;\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs) as Tensor4D;\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n\n let channelAxis: number;\n let heightAxis: number;\n let widthAxis: number;\n if (this.dataFormat === 'channelsFirst') {\n channelAxis = 1;\n heightAxis = 2;\n widthAxis = 3;\n } else {\n channelAxis = 3;\n heightAxis = 1;\n widthAxis = 2;\n }\n\n const kernelH = this.kernelSize[0];\n const kernelW = this.kernelSize[1];\n const strideH = this.strides[0];\n const strideW = this.strides[1];\n\n outputShape[channelAxis] = this.filters;\n outputShape[heightAxis] =\n deconvLength(outputShape[heightAxis], strideH, kernelH, this.padding);\n outputShape[widthAxis] =\n deconvLength(outputShape[widthAxis], strideW, kernelW, this.padding);\n return outputShape;\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['dilationRate'];\n return config;\n }\n}\nserialization.SerializationMap.register(Conv2DTranspose);\n\n\nexport interface SeparableConvLayerConfig extends ConvLayerConfig {\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal\n * to `filtersIn * depthMultiplier`. Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the pointwise kernel matrix.\n */\n pointwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the pointwise kernel matrix.\n */\n pointwiseRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the pointwise kernel matrix.\n */\n pointwiseConstraint?: ConstraintIdentifier|Constraint;\n}\n\n\nexport class SeparableConv extends Conv {\n static className = 'SeparableConv';\n\n readonly depthMultiplier: number;\n\n protected readonly depthwiseInitializer?: Initializer;\n protected readonly depthwiseRegularizer?: Regularizer;\n protected readonly depthwiseConstraint?: Constraint;\n protected readonly pointwiseInitializer?: Initializer;\n protected readonly pointwiseRegularizer?: Regularizer;\n protected readonly pointwiseConstraint?: Constraint;\n\n readonly DEFAULT_DEPTHWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n readonly DEFAULT_POINTWISE_INITIALIZER: InitializerIdentifier =\n 'glorotUniform';\n\n protected depthwiseKernel: LayerVariable = null;\n protected pointwiseKernel: LayerVariable = null;\n\n constructor(rank: number, config?: SeparableConvLayerConfig) {\n super(rank, config);\n\n if (config.filters == null) {\n throw new ValueError(\n 'The `filters` configuration field is required by SeparableConv, ' +\n 'but is unspecified.');\n }\n if (config.kernelInitializer != null || config.kernelRegularizer != null ||\n config.kernelConstraint != null) {\n throw new ValueError(\n 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' +\n 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' +\n 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' +\n 'pointwiseRegularizer and pointwiseConstraint instead.');\n }\n if (config.padding != null && config.padding !== 'same' &&\n config.padding !== 'valid') {\n throw new ValueError(\n `SeparableConv${this.rank}D supports only padding modes: ` +\n `'same' and 'valid', but received ${JSON.stringify(config.padding)}`);\n }\n\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.pointwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER);\n this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer);\n this.pointwiseConstraint = getConstraint(config.pointwiseConstraint);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < this.rank + 2) {\n throw new ValueError(\n `Inputs to SeparableConv${this.rank}D should have rank ` +\n `${this.rank + 2}, but received input shape: ` +\n `${JSON.stringify(inputShape)}`);\n }\n const channelAxis =\n this.dataFormat === 'channelsFirst' ? 1 : inputShape.length - 1;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n `The channel dimension of the inputs should be defined, ` +\n `but found ${JSON.stringify(inputShape[channelAxis])}`);\n }\n\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape =\n this.kernelSize.concat([inputDim, this.depthMultiplier]);\n const pointwiseKernelShape = [];\n for (let i = 0; i < this.rank; ++i) {\n pointwiseKernelShape.push(1);\n }\n pointwiseKernelShape.push(inputDim * this.depthMultiplier, this.filters);\n\n const trainable = true;\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, 'float32',\n this.depthwiseInitializer, this.depthwiseRegularizer, trainable,\n this.depthwiseConstraint);\n this.pointwiseKernel = this.addWeight(\n 'pointwise_kernel', pointwiseKernelShape, 'float32',\n this.pointwiseInitializer, this.pointwiseRegularizer, trainable,\n this.pointwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.filters], 'float32', this.biasInitializer,\n this.biasRegularizer, trainable, this.biasConstraint);\n } else {\n this.bias = null;\n }\n\n this.inputSpec =\n [new InputSpec({ndim: this.rank + 2, axes: {[channelAxis]: inputDim}})];\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n let output: Tensor;\n if (this.rank === 1) {\n throw new NotImplementedError(\n '1D separable convolution is not implemented yet.');\n } else if (this.rank === 2) {\n if (this.dataFormat === 'channelsFirst') {\n inputs = tfc.transpose(inputs, [0, 2, 3, 1]); // NCHW -> NHWC.\n }\n\n output = tfc.separableConv2d(\n inputs as Tensor4D, this.depthwiseKernel.read() as Tensor4D,\n this.pointwiseKernel.read() as Tensor4D,\n this.strides as [number, number], this.padding as 'same' | 'valid',\n this.dilationRate as [number, number], 'NHWC');\n }\n\n if (this.useBias) {\n output = K.biasAdd(output, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n if (this.dataFormat === 'channelsFirst') {\n output = tfc.transpose(output, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['kernelInitializer'];\n delete config['kernelRegularizer'];\n delete config['kernelConstraint'];\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['pointwiseInitializer'] =\n serializeInitializer(this.pointwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['pointwiseRegularizer'] =\n serializeRegularizer(this.pointwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseConstraint);\n config['pointwiseConstraint'] =\n serializeConstraint(this.pointwiseConstraint);\n return config;\n }\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Separable convolution consists of first performing\n * a depthwise spatial convolution\n * (which acts on each input channel separately)\n * followed by a pointwise convolution which mixes together the resulting\n * output channels. The `depthMultiplier` argument controls how many\n * output channels are generated per input channel in the depthwise step.\n *\n * Intuitively, separable convolutions can be understood as\n * a way to factorize a convolution kernel into two smaller kernels,\n * or as an extreme version of an Inception block.\n *\n * Input shape:\n * 4D tensor with shape:\n * `[batch, channels, rows, cols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, rows, cols, channels]` if data_format='channelsLast'.\n *\n * Output shape:\n * 4D tensor with shape:\n * `[batch, filters, newRows, newCols]` if data_format='channelsFirst'\n * or 4D tensor with shape:\n * `[batch, newRows, newCols, filters]` if data_format='channelsLast'.\n * `rows` and `cols` values might have changed due to padding.\n */\nexport class SeparableConv2D extends SeparableConv {\n static className = 'SeparableConv2D';\n constructor(config?: SeparableConvLayerConfig) {\n super(2, config);\n }\n}\nserialization.SerializationMap.register(SeparableConv2D);\n\n/**\n * 1D convolution layer (e.g., temporal convolution).\n *\n * This layer creates a convolution kernel that is convolved\n * with the layer input over a single spatial (or temporal) dimension\n * to produce a tensor of outputs.\n *\n * If `use_bias` is True, a bias vector is created and added to the outputs.\n *\n * If `activation` is not `null`, it is applied to the outputs as well.\n *\n * When using this layer as the first layer in a model, provide an\n * `inputShape` argument `Array` or `null`.\n *\n * For example, `inputShape` would be:\n * - `[10, 128]` for sequences of 10 vectors of 128-dimensional vectors\n * - `[null, 128]` for variable-length sequences of 128-dimensional vectors.\n */\nexport class Conv1D extends Conv {\n static className = 'Conv1D';\n constructor(config: ConvLayerConfig) {\n super(1, config);\n Conv1D.verifyConfig(config);\n this.inputSpec = [{ndim: 3}];\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n delete config['rank'];\n delete config['dataFormat'];\n return config;\n }\n\n static verifyConfig(config: ConvLayerConfig) {\n // config.kernelSize must be a number or array of numbers.\n if (typeof config.kernelSize !== 'number' &&\n !generic_utils.checkArrayTypeAndLength(\n config.kernelSize, 'number', 1, 1))\n throw new ValueError(\n `Conv1D expects config.kernelSize to be number or number[] with ` +\n `length 1, but received ${JSON.stringify(config.kernelSize)}.`);\n }\n}\nserialization.SerializationMap.register(Conv1D);\n\nexport interface Cropping2DLayerConfig extends LayerConfig {\n /**\n * Dimension of the cropping along the width and the height.\n * - If integer: the same symmetric cropping\n * is applied to width and height.\n * - If list of 2 integers:\n * interpreted as two different\n * symmetric cropping values for height and width:\n * `[symmetric_height_crop, symmetric_width_crop]`.\n * - If a list of 2 list of 2 integers:\n * interpreted as\n * `[[top_crop, bottom_crop], [left_crop, right_crop]]`\n */\n cropping: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `channels_last` corresponds to inputs with shape\n * `(batch, ..., channels)`\n *\n * `channels_first` corresponds to inputs with shape `(batch, channels,\n * ...)`.\n *\n * Defaults to `channels_last`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Cropping layer for 2D input (e.g., image).\n *\n * This layer can crop an input\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, croppedRows, croppedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, croppedRows, croppedCols]`.\n *\n * Examples\n * ```js\n *\n * const model = tf.sequential();\n * model.add(tf.layers.cropping2D({cropping:[[2, 2], [2, 2]],\n * inputShape: [128, 128, 3]}));\n * //now output shape is [batch, 124, 124, 3]\n * ```\n */\nexport class Cropping2D extends Layer {\n static className = 'Cropping2D';\n protected readonly cropping: [[number, number], [number, number]];\n protected readonly dataFormat: DataFormat;\n\n constructor(config: Cropping2DLayerConfig) {\n super(config);\n if (typeof config.cropping === 'number')\n this.cropping = [\n [config.cropping, config.cropping], [config.cropping, config.cropping]\n ];\n else if (typeof config.cropping[0] === 'number')\n this.cropping = [\n [config.cropping[0] as number, config.cropping[0] as number],\n [config.cropping[1] as number, config.cropping[1] as number]\n ];\n else\n this.cropping = config.cropping as [[number, number], [number, number]];\n this.dataFormat =\n config.dataFormat === undefined ? 'channelsLast' : config.dataFormat;\n this.inputSpec = [{ndim: 4}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst')\n return [\n inputShape[0], inputShape[1],\n inputShape[2] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1]\n ];\n else\n return [\n inputShape[0],\n inputShape[1] - this.cropping[0][0] - this.cropping[0][1],\n inputShape[2] - this.cropping[1][0] - this.cropping[1][1], inputShape[3]\n ];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n\n if (this.dataFormat === 'channelsLast') {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[1] - this.cropping[0][0] - this.cropping[0][1], 2);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[2] - this.cropping[1][1] - this.cropping[1][0], 3);\n } else {\n const hSliced = K.sliceAlongAxis(\n inputs, this.cropping[0][0],\n inputs.shape[2] - this.cropping[0][0] - this.cropping[0][1], 3);\n return K.sliceAlongAxis(\n hSliced, this.cropping[1][0],\n inputs.shape[3] - this.cropping[1][1] - this.cropping[1][0], 4);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {cropping: this.cropping, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Cropping2D);\n\nexport interface UpSampling2DLayerConfig extends LayerConfig {\n /**\n * The upsampling factors for rows and columns.\n *\n * Defaults to `[2, 2]`.\n */\n size?: number[];\n /**\n * Format of the data, which determines the ordering of the dimensions in\n * the inputs.\n *\n * `\"channelsLast\"` corresponds to inputs with shape\n * `[batch, ..., channels]`\n *\n * `\"channelsFirst\"` corresponds to inputs with shape `[batch, channels,\n * ...]`.\n *\n * Defaults to `\"channelsLast\"`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Upsampling layer for 2D inputs.\n *\n * Repeats the rows and columns of the data\n * by size[0] and size[1] respectively.\n *\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, rows, cols]`\n *\n * Output shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, upsampledRows, upsampledCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, upsampledRows, upsampledCols]`\n *\n */\nexport class UpSampling2D extends Layer {\n static className = 'UpSampling2D';\n protected readonly DEFAULT_SIZE = [2, 2];\n protected readonly size: number[];\n protected readonly dataFormat: DataFormat;\n\n constructor(config: UpSampling2DLayerConfig) {\n super(config);\n this.inputSpec = [{ndim: 4}];\n this.size = config.size == null ? this.DEFAULT_SIZE : config.size;\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n if (this.dataFormat === 'channelsFirst') {\n const height =\n inputShape[2] == null ? null : this.size[0] * inputShape[2];\n const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];\n return [inputShape[0], inputShape[1], height, width];\n } else {\n const height =\n inputShape[1] == null ? null : this.size[0] * inputShape[1];\n const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];\n return [inputShape[0], height, width, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tfc.tidy(() => {\n let input = getExactlyOneTensor(inputs) as Tensor4D;\n const inputShape = input.shape;\n\n if (this.dataFormat === 'channelsFirst') {\n input = tfc.transpose(input, [0, 2, 3, 1]);\n const height = this.size[0] * inputShape[2];\n const width = this.size[1] * inputShape[3];\n const resized = input.resizeNearestNeighbor([height, width]);\n return tfc.transpose(resized, [0, 3, 1, 2]);\n } else {\n const height = this.size[0] * inputShape[1];\n const width = this.size[1] * inputShape[2];\n return input.resizeNearestNeighbor([height, width]);\n }\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {size: this.size, dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(UpSampling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Depthwise Convolutional Layers\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\n// tslint:disable:max-line-length\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, DataFormat} from '../common';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {BaseConv, BaseConvLayerConfig, ConvLayerConfig, preprocessConv2DInput} from './convolutional';\n\n// tslint:enable:max-line-length\n\n/**\n * 2D convolution with separable filters.\n * @param x Input tensor.\n * @param depthwiseKernel Convolution kernel for depthwise convolution.\n * @param strides Strides (Array of two integers).\n * @param padding Padding model.\n * @param dataFormat Data format.\n * @param dilationRate Array of two integers, dilation rates for the separable\n * convolution.\n * @returns Output tensor.\n * @throws ValueError If depthwiseKernel is not a 4D array.\n */\nexport function depthwiseConv2d(\n x: Tensor, depthwiseKernel: Tensor, strides: [number, number] = [1, 1],\n padding = 'valid', dataFormat?: DataFormat,\n dilationRate?: [number, number]): Tensor {\n return tidy(() => {\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n checkDataFormat(dataFormat);\n let y = preprocessConv2DInput(x, dataFormat);\n if (x.rank !== 4) {\n throw new ValueError(\n `Input for depthwiseConv2d is required to be 4-D, but is instead ` +\n `${x.rank}-D`);\n }\n if (depthwiseKernel.rank !== 4) {\n throw new ValueError(\n `depthwiseKernel is required to be 4-D, but is instead ` +\n `${depthwiseKernel.rank}-D`);\n }\n y = tfc.depthwiseConv2d(\n y as Tensor4D, depthwiseKernel as Tensor4D, strides,\n padding === 'same' ? 'same' : 'valid', 'NHWC', dilationRate);\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]);\n }\n return y;\n });\n}\n\nexport interface DepthwiseConv2DLayerConfig extends BaseConvLayerConfig {\n /**\n * An integer or Array of 2 integers, specifying the width and height of the\n * 2D convolution window. Can be a single integer to specify the same value\n * for all spatial dimensions.\n */\n kernelSize: number|[number, number];\n\n /**\n * The number of depthwise convolution output channels for each input\n * channel.\n * The total number of depthwise convolution output channels will be equal to\n * `filtersIn * depthMultiplier`.\n * Default: 1.\n */\n depthMultiplier?: number;\n\n /**\n * Initializer for the depthwise kernel matrix.\n * Default: GlorotNormal.\n */\n depthwiseInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the depthwise kernel matrix.\n */\n depthwiseConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regulzarizer function for the depthwise kernel matrix.\n */\n depthwiseRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * Depthwise separable 2D convolution.\n *\n * Depthwise Separable convolutions consists in performing just the first step\n * in a depthwise spatial convolution (which acts on each input channel\n * separately). The `depthMultplier` argument controls how many output channels\n * are generated per input channel in the depthwise step.\n */\nexport class DepthwiseConv2D extends BaseConv {\n static className = 'DepthwiseConv2D';\n private readonly depthMultiplier: number;\n private readonly depthwiseInitializer: Initializer;\n private readonly depthwiseConstraint: Constraint;\n private readonly depthwiseRegularizer: Regularizer;\n\n private depthwiseKernel: LayerVariable = null;\n\n constructor(config: DepthwiseConv2DLayerConfig) {\n super(2, config as ConvLayerConfig);\n this.depthMultiplier =\n config.depthMultiplier == null ? 1 : config.depthMultiplier;\n this.depthwiseInitializer = getInitializer(\n config.depthwiseInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.depthwiseConstraint = getConstraint(config.depthwiseConstraint);\n this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer);\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 4) {\n throw new ValueError(\n `Inputs to DepthwiseConv2D should have rank 4. ` +\n `Received input shape: ${JSON.stringify(inputShape)}.`);\n }\n const channelAxis = this.dataFormat === 'channelsFirst' ? 1 : 3;\n if (inputShape[channelAxis] == null || inputShape[channelAxis] < 0) {\n throw new ValueError(\n 'The channel dimension of the inputs to DepthwiseConv2D should ' +\n `be defined, but is not (${inputShape[channelAxis]}).`);\n }\n const inputDim = inputShape[channelAxis];\n const depthwiseKernelShape: Shape = [\n this.kernelSize[0], this.kernelSize[1], inputDim, this.depthMultiplier\n ];\n\n this.depthwiseKernel = this.addWeight(\n 'depthwise_kernel', depthwiseKernelShape, null,\n this.depthwiseInitializer, this.depthwiseRegularizer, true,\n this.depthwiseConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [inputDim * this.depthMultiplier], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n let outputs = depthwiseConv2d(\n inputs, this.depthwiseKernel.read(), this.strides as [number, number],\n this.padding, this.dataFormat, null);\n // TODO(cais): Add support for dilation.\n if (this.useBias) {\n outputs = K.biasAdd(outputs, this.bias.read(), this.dataFormat);\n }\n if (this.activation != null) {\n outputs = this.activation.apply(outputs);\n }\n return outputs;\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n const cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n const outFilters = this.dataFormat === 'channelsFirst' ?\n inputShape[1] * this.depthMultiplier :\n inputShape[3] * this.depthMultiplier;\n const outRows = convOutputLength(\n rows, this.kernelSize[0], this.padding, this.strides[0]);\n const outCols = convOutputLength(\n cols, this.kernelSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], outFilters, outRows, outCols];\n } else {\n // In this case, assume 'channelsLast'.\n return [inputShape[0], outRows, outCols, outFilters];\n }\n }\n\n getConfig(): serialization.ConfigDict {\n const config = super.getConfig();\n config['depthMultiplier'] = this.depthMultiplier;\n config['depthwiseInitializer'] =\n serializeInitializer(this.depthwiseInitializer);\n config['depthwiseRegularizer'] =\n serializeRegularizer(this.depthwiseRegularizer);\n config['depthwiseConstraint'] =\n serializeConstraint(this.depthwiseRegularizer);\n return config;\n }\n}\nserialization.SerializationMap.register(DepthwiseConv2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Basic Layers.\n */\n\nimport {Scalar, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\n// tslint:disable:max-line-length\nimport {Activation as ActivationFn, ActivationIdentifier, getActivation, serializeActivation} from '../activations';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n// tslint:enable:max-line-length\n\nexport interface DropoutLayerConfig extends LayerConfig {\n /** Float between 0 and 1. Fraction of the input units to drop. */\n rate: number;\n\n /**\n * Integer array representing the shape of the binary dropout mask that will\n * be multiplied with the input.\n *\n * For instance, if your inputs have shape `(batchSize, timesteps, features)`\n * and you want the dropout mask to be the same for all timesteps, you can use\n * `noise_shape=(batch_size, 1, features)`.\n */\n noiseShape?: number[];\n\n /** An integer to use as random seed. */\n seed?: number;\n}\n\n/**\n * Applies\n * [dropout](http://www.cs.toronto.edu/~rsalakhu/papers/srivastava14a.pdf) to\n * the input.\n *\n * Dropout consists in randomly setting a fraction `rate` of input units to 0 at\n * each update during training time, which helps prevent overfitting.\n */\nexport class Dropout extends Layer {\n static className = 'Dropout';\n private readonly rate: number;\n private readonly rateScalar: Scalar;\n private readonly noiseShape: number[];\n private readonly seed: number;\n\n constructor(config: DropoutLayerConfig) {\n super(config);\n this.rate = Math.max(Math.min(config.rate, 1), 0);\n this.rateScalar = getScalar(this.rate);\n // So that the scalar doesn't get tidied up between executions.\n this.noiseShape = config.noiseShape;\n this.seed = config.seed;\n if (this.seed != null) {\n throw new NotImplementedError(\n 'Non-default seed is not implemented in Dropout layer yet: ' +\n this.seed);\n }\n this.supportsMasking = true;\n }\n\n private getNoiseShape(input: Tensor): Shape {\n if (this.noiseShape == null) {\n return this.noiseShape;\n }\n const inputShape = input.shape;\n const noiseShape: Shape = [];\n for (let i = 0; i < this.noiseShape.length; ++i) {\n noiseShape.push(\n this.noiseShape[i] == null ? inputShape[i] : this.noiseShape[i]);\n }\n return noiseShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n if (this.noiseShape != null &&\n !util.arraysEqual(input.shape, this.noiseShape)) {\n throw new NotImplementedError(\n 'Non-default noise shape is not implemented in Dropout ' +\n 'layer yet: ' + JSON.stringify(this.noiseShape));\n }\n if (0 < this.rate && this.rate < 1) {\n const training =\n kwargs['training'] == null ? false : kwargs['training'];\n const noiseShape = this.getNoiseShape(input);\n const output =\n K.inTrainPhase(\n () => K.dropout(input, this.rateScalar, noiseShape, this.seed),\n () => input, training) as Tensor;\n return output;\n }\n return inputs;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n rate: this.rate,\n noiseShape: this.noiseShape,\n seed: this.seed,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Dropout);\n\nexport interface DenseLayerConfig extends LayerConfig {\n /** Positive integer, dimensionality of the output space. */\n units: number;\n /**\n * Activation function to use.\n *\n * If unspecified, no activation is applied.\n */\n activation?: ActivationIdentifier;\n /** Whether to apply a bias. */\n useBias?: boolean;\n /**\n * Initializer for the dense kernel weights matrix.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n /**\n * If specified, defines inputShape as `[inputDim]`.\n */\n inputDim?: number;\n\n /**\n * Constraint for the kernel weights.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer function applied to the dense kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n/**\n * Creates a dense (fully connected) layer.\n *\n * This layer implements the operation:\n * `output = activation(dot(input, kernel) + bias)`\n *\n * `activation` is the element-wise activation function\n * passed as the `activation` argument.\n *\n * `kernel` is a weights matrix created by the layer.\n *\n * `bias` is a bias vector created by the layer (only applicable if `useBias`\n * is `true`).\n *\n * **Input shape:**\n *\n * nD `Tensor` with shape: `(batchSize, ..., inputDim)`.\n *\n * The most common situation would be\n * a 2D input with shape `(batchSize, inputDim)`.\n *\n * **Output shape:**\n *\n * nD tensor with shape: `(batchSize, ..., units)`.\n *\n * For instance, for a 2D input with shape `(batchSize, inputDim)`,\n * the output would have shape `(batchSize, units)`.\n *\n * Note: if the input to the layer has a rank greater than 2, then it is\n * flattened prior to the initial dot product with the kernel.\n */\nexport class Dense extends Layer {\n static className = 'Dense';\n private units: number;\n // Default activation: Linear (none).\n private activation: ActivationFn = null;\n private useBias = true;\n private kernelInitializer: Initializer;\n private biasInitializer: Initializer;\n private kernel: LayerVariable = null;\n private bias: LayerVariable = null;\n\n readonly DEFAULT_KERNEL_INITIALIZER: InitializerIdentifier = 'glorotNormal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n private readonly kernelConstraint?: Constraint;\n private readonly biasConstraint?: Constraint;\n private readonly kernelRegularizer?: Regularizer;\n private readonly biasRegularizer?: Regularizer;\n\n constructor(config: DenseLayerConfig) {\n super(config);\n if (config.batchInputShape == null && config.inputShape == null &&\n config.inputDim != null) {\n // This logic is copied from Layer's constructor, since we can't\n // do exactly what the Python constructor does for Dense().\n let batchSize: number = null;\n if (config.batchSize != null) {\n batchSize = config.batchSize;\n }\n this.batchInputShape = [batchSize, config.inputDim];\n }\n\n this.units = config.units;\n this.activation = getActivation(config.activation);\n if (config.useBias != null) {\n this.useBias = config.useBias;\n }\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n this.activityRegularizer = getRegularizer(config.activityRegularizer);\n\n this.inputSpec = [{minNDim: 2}];\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputLastDim = inputShape[inputShape.length - 1];\n if (this.kernel == null) {\n this.kernel = this.addWeight(\n 'kernel', [inputLastDim, this.units], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n }\n }\n\n this.inputSpec = [{minNDim: 2, axes: {[-1]: inputLastDim}}];\n this.built = true;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const outputShape = inputShape.slice();\n outputShape[outputShape.length - 1] = this.units;\n return outputShape;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Dense layer accepts only a single input.\n const input = getExactlyOneTensor(inputs);\n let output = K.dot(input, this.kernel.read());\n if (this.bias != null) {\n output = K.biasAdd(output, this.bias.read());\n }\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n return output;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Dense);\n\n/**\n * Flattens the input. Does not affect the batch size.\n *\n * A `Flatten` layer flattens each batch in its inputs to 1D (making the output\n * 2D).\n *\n * For example:\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const flattenLayer = tf.layers.flatten();\n * // Inspect the inferred output shape of the flatten layer, which\n * // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the\n * // flattening. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(flattenLayer.apply(input).shape));\n * ```\n */\nexport class Flatten extends Layer {\n static className = 'Flatten';\n constructor(config?: LayerConfig) {\n super(config || {});\n this.inputSpec = [{minNDim: 3}];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n for (const dim of inputShape.slice(1)) {\n if (dim == null) {\n throw new ValueError(\n `The shape of the input to \"Flatten\" is not fully defined ` +\n `(got ${inputShape.slice(1)}). Make sure to pass a complete ` +\n `\"input_shape\" or \"batch_input_shape\" argument to the first ` +\n `layer in your model.`);\n }\n }\n return [inputShape[0], math_utils.arrayProd(inputShape, 1)];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return K.batchFlatten(getExactlyOneTensor(inputs));\n });\n }\n}\nserialization.SerializationMap.register(Flatten);\n\nexport interface ActivationLayerConfig extends LayerConfig {\n /**\n * Name of the activation function to use.\n */\n activation: ActivationIdentifier;\n}\n\n/**\n * Applies an activation function to an output.\n *\n * This layer applies element-wise activation function. Other layers, notably\n * `dense` can also apply activation functions. Use this isolated activation\n * function to extract the values before and after the\n * activation. For instance:\n *\n * ```js\n * const input = tf.input({shape: [5]});\n * const denseLayer = tf.layers.dense({units: 1});\n * const activationLayer = tf.layers.activation({activation: 'relu6'});\n *\n * // Obtain the output symbolic tensors by applying the layers in order.\n * const denseOutput = denseLayer.apply(input);\n * const activationOutput = activationLayer.apply(denseOutput);\n *\n * // Create the model based on the inputs.\n * const model = tf.model({\n * inputs: input,\n * outputs: [denseOutput, activationOutput]\n * });\n *\n * // Collect both outputs and print separately.\n * const [denseOut, activationOut] = model.predict(tf.randomNormal([6, 5]));\n * denseOut.print();\n * activationOut.print();\n * ```\n *\n */\nexport class Activation extends Layer {\n static className = 'Activation';\n activation: ActivationFn;\n\n constructor(config: ActivationLayerConfig) {\n super(config);\n this.supportsMasking = true;\n this.activation = getActivation(config.activation);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n return this.activation.apply(input);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {activation: serializeActivation(this.activation)};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Activation);\n\nexport interface ReshapeLayerConfig extends LayerConfig {\n /** The target shape. Does not include the batch axis. */\n targetShape: Shape;\n}\n\nexport interface RepeatVectorLayerConfig extends LayerConfig {\n /**\n * The integer number of times to repeat the input.\n */\n n: number;\n}\n\n/**\n * Repeats the input n times in a new dimension.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.repeatVector({n: 4, inputShape: [2]}));\n * const x = tf.tensor2d([[10, 20]]);\n * // Use the model to do inference on a data point the model hasn't see\n * model.predict(x).print();\n * // output shape is now [batch, 2, 4]\n * ```\n */\nexport class RepeatVector extends Layer {\n static className = 'RepeatVector';\n readonly n: number;\n\n constructor(config: RepeatVectorLayerConfig) {\n super(config);\n this.n = config.n;\n this.inputSpec = [{ndim: 2}];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], this.n, inputShape[1]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = getExactlyOneTensor(inputs);\n return K.repeat(inputs, this.n);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n n: this.n,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(RepeatVector);\n\n/**\n * Reshapes an input to a certain shape.\n *\n * ```js\n * const input = tf.input({shape: [4, 3]});\n * const reshapeLayer = tf.layers.reshape({targetShape: [2, 6]});\n * // Inspect the inferred output shape of the Reshape layer, which\n * // equals `[null, 2, 6]`. (The 1st dimension is the undermined batch size.)\n * console.log(JSON.stringify(reshapeLayer.apply(input).shape));\n * ```\n *\n * Input shape:\n * Arbitrary: although all dimensions in the input shape must be fixed.\n * Use the ReshapeLayerConfig field `input_shape` when using this layer\n * as the first layer in a model.\n *\n * Output shape:\n * [batchSize, targetShape[0], targetShape[1], ...,\n * targetShape[targetShape.length - 1]].\n */\nexport class Reshape extends Layer {\n static className = 'Reshape';\n private targetShape: Shape;\n\n constructor(config: ReshapeLayerConfig) {\n super(config);\n this.targetShape = config.targetShape;\n\n // Make sure that all unknown dimensions are represented as `null`.\n for (let i = 0; i < this.targetShape.length; ++i) {\n if (this.isUnknown(this.targetShape[i])) {\n this.targetShape[i] = null;\n }\n }\n }\n\n private isUnknown(dim: number): boolean {\n return dim < 0 || dim == null;\n }\n\n /**\n * Finds and replaces a missing dimension in output shape.\n *\n * This is a near direct port of the internal Numpy function\n * `_fix_unknown_dimension` in `numpy/core/src/multiarray/shape.c`.\n *\n * @param inputShape: Original shape of array begin reshape.\n * @param outputShape: Target shape of the array, with at most a single\n * `null` or negative number, which indicates an underdetermined dimension\n * that should be derived from `inputShape` and the known dimensions of\n * `outputShape`.\n * @returns: The output shape with `null` replaced with its computed value.\n * @throws: ValueError: If `inputShape` and `outputShape` do not match.\n */\n private fixUnknownDimension(inputShape: Shape, outputShape: Shape): Shape {\n const errorMsg = 'Total size of new array must be unchanged.';\n const finalShape = outputShape.slice();\n let known = 1;\n let unknown = null;\n for (let i = 0; i < finalShape.length; ++i) {\n const dim = finalShape[i];\n if (this.isUnknown(dim)) {\n if (unknown === null) {\n unknown = i;\n } else {\n throw new ValueError('Can only specifiy one unknown dimension.');\n }\n } else {\n known *= dim;\n }\n }\n\n const originalSize = math_utils.arrayProd(inputShape);\n if (unknown !== null) {\n if (known === 0 || originalSize % known !== 0) {\n throw new ValueError(errorMsg);\n }\n finalShape[unknown] = originalSize / known;\n } else if (originalSize !== known) {\n throw new ValueError(errorMsg);\n }\n\n return finalShape;\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n let anyUnknownDims = false;\n for (let i = 0; i < inputShape.length; ++i) {\n if (this.isUnknown(inputShape[i])) {\n anyUnknownDims = true;\n break;\n }\n }\n\n if (anyUnknownDims) {\n return inputShape.slice(0, 1).concat(this.targetShape);\n } else {\n return inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const outputShape = inputShape.slice(0, 1).concat(\n this.fixUnknownDimension(inputShape.slice(1), this.targetShape));\n return input.reshape(outputShape);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n targetShape: this.targetShape,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Reshape);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Embedding Layer.\n *\n * Original source: keras/constraints.py\n */\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\n// tslint:disable:max-line-length\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n// tslint:enable:max-line-length\n\nexport interface EmbeddingLayerConfig extends LayerConfig {\n /**\n * Integer > 0. Size of the vocabulary, i.e. maximum integer index + 1.\n */\n inputDim: number;\n /**\n * Integer >= 0. Dimension of the dense embedding.\n */\n outputDim: number;\n /**\n * Initializer for the `embeddings` matrix.\n */\n embeddingsInitializer?: InitializerIdentifier|Initializer;\n /**\n * Regularizer function applied to the `embeddings` matrix.\n */\n embeddingsRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Regularizer function applied to the activation.\n */\n activityRegularizer?: RegularizerIdentifier|Regularizer;\n /**\n * Constraint function applied to the `embeddings` matrix.\n */\n embeddingsConstraint?: ConstraintIdentifier|Constraint;\n /**\n * Whether the input value 0 is a special \"padding\" value that should be\n * masked out. This is useful when using recurrent layers which may take\n * variable length input.\n *\n * If this is `True` then all subsequent layers in the model need to support\n * masking or an exception will be raised. If maskZero is set to `True`, as a\n * consequence, index 0 cannot be used in the vocabulary (inputDim should\n * equal size of vocabulary + 1).\n */\n maskZero?: boolean;\n /**\n * Length of input sequences, when it is constant.\n *\n * This argument is required if you are going to connect `flatten` then\n * `dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed).\n */\n inputLength?: number|number[];\n}\n\n/**\n * Maps positive integers (indices) into dense vectors of fixed size.\n * eg. [[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]\n *\n * **Input shape:** 2D tensor with shape: `[batchSize, sequenceLength]`.\n *\n * **Output shape:** 3D tensor with shape: `[batchSize, sequenceLength,\n * outputDim]`.\n */\nexport class Embedding extends Layer {\n static className = 'Embedding';\n private inputDim: number;\n private outputDim: number;\n private embeddingsInitializer: Initializer;\n private maskZero: boolean;\n private inputLength: number|number[];\n\n private embeddings: LayerVariable = null;\n\n readonly DEFAULT_EMBEDDINGS_INITIALIZER: InitializerIdentifier =\n 'randomUniform';\n private readonly embeddingsRegularizer?: Regularizer;\n private readonly embeddingsConstraint?: Constraint;\n\n constructor(config: EmbeddingLayerConfig) {\n super(config);\n if (config.batchInputShape == null && config.inputShape == null) {\n // Porting Note: This logic is copied from Layer's constructor, since we\n // can't do exactly what the Python constructor does for Embedding().\n // Specifically, the super constructor can not be called after the\n // mutation of the `config` argument.\n let batchSize: number = null;\n if (config.batchSize != null) {\n batchSize = config.batchSize;\n }\n if (config.inputLength == null) {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (None, )\n this.batchInputShape = [batchSize, null];\n } else {\n // Fix super-constructor to what it would have done if\n // 'config.inputShape' were (config.inputLength, )\n this.batchInputShape =\n [batchSize].concat(generic_utils.toList(config.inputLength));\n }\n }\n this.inputDim = config.inputDim;\n this.outputDim = config.outputDim;\n this.embeddingsInitializer = getInitializer(\n config.embeddingsInitializer || this.DEFAULT_EMBEDDINGS_INITIALIZER);\n this.embeddingsRegularizer = getRegularizer(config.embeddingsRegularizer);\n this.activityRegularizer = getRegularizer(config.activityRegularizer);\n this.embeddingsConstraint = getConstraint(config.embeddingsConstraint);\n this.maskZero = config.maskZero;\n this.inputLength = config.inputLength;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n this.embeddings = this.addWeight(\n 'embeddings', [this.inputDim, this.outputDim], this.dtype,\n this.embeddingsInitializer, this.embeddingsRegularizer, true,\n this.embeddingsConstraint);\n this.built = true;\n }\n\n // Override warnOnIncompatibleInputShape because an embedding layer allows\n // the input to have varying ranks.\n protected warnOnIncompatibleInputShape(inputShape: Shape) {}\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n throw new NotImplementedError(\n 'computeMask has not been implemented for Embedding yet');\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n if (this.inputLength == null) {\n return [...inputShape, this.outputDim];\n }\n // inputLength can be an array if input is 3D or higher.\n const inLens: number[] = generic_utils.toList(this.inputLength);\n if (inLens.length !== inputShape.length - 1) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else {\n let i = 0;\n for (let k = 0; k < inLens.length; ++k) {\n const s1 = inLens[k];\n const s2 = inputShape[k + 1];\n if ((s1 != null) && (s2 != null) && (s1 !== s2)) {\n throw new ValueError(\n `\"inputLength\" is ${this.inputLength}, but received ` +\n `input shape has shape ${inputShape}`);\n } else if (s1 == null) {\n inLens[i] = s2;\n }\n i++;\n }\n }\n return [inputShape[0], ...inLens, this.outputDim];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Embedding layer accepts only a single input.\n let input = getExactlyOneTensor(inputs);\n if (input.dtype !== 'int32') {\n input = K.cast(input, 'int32');\n }\n const output = K.gather(this.embeddings.read(), input.as1D());\n return output.reshape(\n getExactlyOneShape(this.computeOutputShape(input.shape)));\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n inputDim: this.inputDim,\n outputDim: this.outputDim,\n embeddingsInitializer: serializeInitializer(this.embeddingsInitializer),\n embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n embeddingsConstraint: serializeConstraint(this.embeddingsConstraint),\n maskZero: this.maskZero,\n inputLength: this.inputLength\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\nserialization.SerializationMap.register(Embedding);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Merge Layers.\n */\n\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport * as K from '../backend/tfjs_backend';\nimport {Layer, LayerConfig, SymbolicTensor} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as mathUtils from '../utils/math_utils';\nimport {getExactlyOneShape} from '../utils/types_utils';\n\n/**\n * Generic Merge layer for element-wise merge functions.\n *\n * Used to implement `Sum`, `Average`, `Concatenate`, etc.\n */\nexport abstract class Merge extends Layer {\n protected reshapeRequired: boolean;\n\n constructor(config?: LayerConfig) {\n super(config || {});\n this.supportsMasking = true;\n }\n\n /**\n * Logic for merging multiple tensors, to be overridden by subclasses.\n * @param inputs\n */\n protected mergeFunction(inputs: Tensor[]): Tensor {\n throw new NotImplementedError();\n }\n\n /**\n * Computes the shape of the result of an elementwise operation.\n *\n * @param shape1: Shape of the first tensor.\n * @param shape2: Shape of the second tensor.\n * @returns Expected output shape when an elementwise operation is carried\n * out on 2 tensors with shapes `shape1` and `shape2`.\n * @throws ValueError: If `shape1` and `shape2` are not compatible for\n * element-wise operations.\n */\n private computeElementwiseOpOutputShape(shape1: Shape, shape2: Shape): Shape {\n if (shape1 == null || shape2 == null) {\n return null;\n } else if (shape1.length < shape2.length) {\n return this.computeElementwiseOpOutputShape(shape2, shape1);\n } else if (shape2.length === 0) {\n return shape1;\n }\n const outputShape: Shape = shape1.slice(0, shape1.length - shape2.length);\n for (let k = 0; k < shape2.length; ++k) {\n const i = shape1[shape1.length - shape2.length + k];\n const j = shape2[k];\n if (i == null || j == null || i < 0 || j < 0) {\n outputShape.push(null);\n } else if (i === 1) {\n outputShape.push(j);\n } else if (j === 1) {\n outputShape.push(i);\n } else {\n if (i !== j) {\n throw new ValueError(\n 'Operands could not be broadcast together with shapes ' +\n JSON.stringify(shape1) + ' ' + JSON.stringify(shape2));\n }\n outputShape.push(i);\n }\n }\n return outputShape;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.\n if (Array.isArray(inputShape) && !Array.isArray(inputShape[0])) {\n // Make sure that inputShape is an Array of shape.\n inputShape = [getExactlyOneShape(inputShape)];\n }\n inputShape = inputShape as Shape[];\n if (inputShape.length < 2) {\n throw new ValueError(\n 'A merge layer should be called on an Array of at least 2 inputs.' +\n ` Got ${inputShape.length} input(s).`);\n }\n\n // Make sure that there is at most one unique batch size among the input\n // shapes.\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length > 1) {\n throw new ValueError(\n `Can not merge tensors with different batch sizes. ` +\n `Got tensors with shapes: ${JSON.stringify(inputShape)}.`);\n }\n\n let outputShape: Shape =\n inputShape[0] == null ? null : inputShape[0].slice(1);\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n // If the inputs have different ranks, we have to reshape them to make them\n // broadcastable.\n const allRanks = inputShape.map(shape => shape.length);\n if (inputShape.indexOf(null) === -1 &&\n generic_utils.unique(allRanks).length === 1) {\n this.reshapeRequired = false;\n } else {\n this.reshapeRequired = true;\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (this.reshapeRequired) {\n const reshapedInputs: Tensor[] = [];\n const inputDims = inputs.map(input => input.rank);\n if (inputDims.indexOf(null) === -1) {\n // If ranks of all inputs are available, we simply expand each of them\n // at axis=1 until all of them have the same rank.\n const maxNDim = mathUtils.max(inputDims);\n for (let x of inputs) {\n const xNDim = x.rank;\n for (let k = 0; k < maxNDim - xNDim; ++k) {\n x = K.expandDims(x, 1);\n }\n reshapedInputs.push(x);\n }\n return this.mergeFunction(reshapedInputs);\n } else {\n // Transpose all inputs so that batch size is the last dimension.\n // [batchSize, dim1, dim2, ...] -> [dim1, dim2, ..., batchSize]\n let transposed = false;\n for (const x of inputs) {\n const xNDim = x.rank;\n if (xNDim == null) {\n const xShape = x.shape;\n const batchSize = xShape[0];\n const newShape = xShape.slice(1).concat([batchSize]);\n let xTransposed = x.reshape(\n [batchSize].concat(mathUtils.arrayProd(xShape.slice(1))));\n xTransposed = tfc.transpose(xTransposed, [1, 0]);\n xTransposed = xTransposed.reshape(newShape);\n reshapedInputs.push(xTransposed);\n transposed = true;\n } else if (xNDim > 1) {\n const dims = mathUtils.range(1, xNDim).concat([0]);\n reshapedInputs.push(tfc.transpose(x, dims));\n transposed = true;\n } else {\n // We don't transpose inputs if they are 1D vectors or scalars.\n reshapedInputs.push(x);\n }\n }\n let y = this.mergeFunction(reshapedInputs);\n const yNDim = y.rank;\n if (transposed) {\n // If inputs have been transposed, we have to transpose the output\n // too.\n if (yNDim == null) {\n const yShape = y.shape;\n const yNDim = yShape.length;\n const batchSize = yShape[yNDim - 1];\n const newShape =\n [batchSize].concat(yShape.slice(0, yShape.length - 1));\n y = tfc.transpose(y.reshape([-1, batchSize]), [1, 0])\n .reshape(newShape);\n } else if (yNDim > 1) {\n const dims = [yNDim - 1].concat(mathUtils.range(0, yNDim - 1));\n y = tfc.transpose(y, dims);\n }\n }\n return y;\n }\n } else {\n return this.mergeFunction(inputs);\n }\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape[];\n let outputShape: Shape;\n if (inputShape[0] == null) {\n outputShape = null;\n } else {\n outputShape = inputShape[0].slice(1);\n }\n for (let i = 1; i < inputShape.length; ++i) {\n const shape = inputShape[i] == null ? null : inputShape[i].slice(1);\n outputShape = this.computeElementwiseOpOutputShape(outputShape, shape);\n }\n\n let batchSizes: number[] = [];\n for (const shape of inputShape) {\n if (shape != null && shape[0] !== null) {\n batchSizes.push(shape[0]);\n }\n }\n batchSizes = generic_utils.unique(batchSizes);\n if (batchSizes.length === 1) {\n outputShape = batchSizes.concat(outputShape);\n } else {\n outputShape = [null].concat(outputShape);\n }\n return outputShape;\n }\n\n // TODO(cais): Implement computeMask();\n}\n\n/**\n * Layer that performs element-wise addition on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). The inputs are specified as an\n * `Array` when the `apply` method of the `Add` layer instance is called. For\n * example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const addLayer = tf.layers.add();\n * const sum = addLayer.apply([input1, input2]);\n * console.log(JSON.stringify(sum.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Add extends Merge {\n static className = 'Add';\n constructor(config?: LayerConfig) {\n super(config as LayerConfig);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = tfc.zeros(inputs[0].shape);\n for (const input of inputs) {\n output = tfc.add(output, input);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Add);\n\n/**\n * Calculate the element-wise sum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Add` layer, by using no input argument\n * or a single configuration argument. The resultant `Add` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const addLayer = tf.layers.add();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = addLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.add([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.add([input1, input2]).print();\n * // Gives [[11, 22], [33, 44]].\n *\n */\nexport function add(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Add({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Add(config);\n }\n}\n\n/**\n * Layer that multiplies (element-wise) an `Array` of inputs.\n *\n * It takes as input an Array of tensors, all of the same\n * shape, and returns a single tensor (also of the same shape).\n * For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const input3 = tf.input({shape: [2, 2]});\n * const multiplyLayer = tf.layers.multiply();\n * const product = multiplyLayer.apply([input1, input2, input3]);\n * console.log(product.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n */\nexport class Multiply extends Merge {\n static className = 'Multiply';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = tfc.ones(inputs[0].shape);\n for (const input of inputs) {\n output = tfc.mul(output, input);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Multiply);\n\n/**\n * Calculate the element-wise product of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Multiply` layer, by using no input argument\n * or a single configuration argument. The resultant `Multiply` layer can\n * then be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const multiplyLayer = tf.layers.multiply();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = multiplyLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.multiply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.multiply([input1, input2]).print();\n * // Gives [[10, 40], [90, 160]].\n *\n */\nexport function multiply(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Multiply({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Multiply(config);\n }\n}\n\n/**\n * Layer that performs element-wise averaging on an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape, and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const averageLayer = tf.layers.average();\n * const average = averageLayer.apply([input1, input2]);\n * console.log(JSON.stringify(average.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Average extends Merge {\n static className = 'Average';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = tfc.zeros(inputs[0].shape);\n for (const input of inputs) {\n output = tfc.add(output, input);\n }\n return tfc.mul(getScalar(1 / inputs.length), output);\n });\n }\n}\nserialization.SerializationMap.register(Average);\n\n/**\n * Calculate the element-wise arithmetic mean of inputs, which all have the same\n * shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Average` layer, by using no input argument\n * or a single configuration argument. The resultant `Average` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const averageLayer = tf.layers.average();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = averageLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.average([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 2, 3, 4], [2, 2]);\n * const input2 = tf.tensor2d([10, 20, 30, 40], [2, 2]);\n * tf.layers.average([input1, input2]).print();\n * // Gives [[5.5, 11], [16.5, 22]].\n *\n */\nexport function average(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Average({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Average(config);\n }\n}\n\n/**\n * Layer that computes the element-wise maximum an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const maxLayer = tf.layers.maximum();\n * const max = maxLayer.apply([input1, input2]);\n * console.log(JSON.stringify(max.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Maximum extends Merge {\n static className = 'Maximum';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.maximum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Maximum);\n\n/**\n * Calculate the element-wise maximum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Maximum` layer, by using no input argument\n * or a single configuration argument. The resultant `Maximum` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const maximumLayer = tf.layers.maximum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = maximumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.maximum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.maximum([input1, input2]).print();\n * // Gives [[10, 20], [30, 40]].\n *\n */\nexport function maximum(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Maximum({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Maximum(config);\n }\n}\n\n/**\n * Layer that computes the element-wise minimum of an `Array` of inputs.\n *\n * It takes as input a list of tensors, all of the same shape and returns a\n * single tensor (also of the same shape). For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const minLayer = tf.layers.minimum();\n * const min = minLayer.apply([input1, input2]);\n * console.log(JSON.stringify(min.shape));\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n */\nexport class Minimum extends Merge {\n static className = 'Minimum';\n constructor(config?: LayerConfig) {\n super(config);\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n let output = inputs[0];\n for (let i = 1; i < inputs.length; ++i) {\n output = tfc.minimum(output, inputs[i]);\n }\n return output;\n });\n }\n}\nserialization.SerializationMap.register(Minimum);\n\n/**\n * Calculate the element-wise minimum of inputs, which all have the same shape.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Minimum` layer, by using no input argument\n * or a single configuration argument. The resultant `Minimum` layer can then\n * be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const minimumLayer = tf.layers.minimum();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = minimumLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 2]});\n * const output = tf.layers.minimum([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([1, 20, 3, 40], [2, 2]);\n * const input2 = tf.tensor2d([10, 2, 30, 4], [2, 2]);\n * tf.layers.minimum([input1, input2]).print();\n * // Gives [[1, 2], [3, 4]].\n *\n */\nexport function minimum(config?: SymbolicTensor[]|Tensor[]|LayerConfig): Layer|\n SymbolicTensor|Tensor {\n if (Array.isArray(config)) {\n const layer = new Minimum({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Minimum(config);\n }\n}\n\nexport interface ConcatenateLayerConfig extends LayerConfig {\n /**\n * Axis along which to concatenate.\n */\n axis?: number;\n}\n\n/**\n * Layer that concatenates an `Array` of inputs.\n *\n * It takes a list of tensors, all of the same shape except for the\n * concatenation axis, and returns a single tensor, the concatenation\n * of all inputs. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 2]});\n * const input2 = tf.input({shape: [2, 3]});\n * const concatLayer = tf.layers.concatenate();\n * const output = concatLayer.apply([input1, input2]);\n * console.log(JSON.stringify(output.shape));\n * // You get [null, 2, 5], with the first dimension as the undetermined batch\n * // dimension. The last dimension (5) is the result of concatenating the\n * // last dimensions of the inputs (2 and 3).\n * ```\n */\nexport class Concatenate extends Merge {\n static className = 'Concatenate';\n readonly DEFAULT_AXIS = -1;\n private readonly axis: number;\n\n constructor(config?: ConcatenateLayerConfig) {\n super(config);\n if (config == null) {\n config = {};\n }\n this.axis = config.axis == null ? this.DEFAULT_AXIS : config.axis;\n this.supportsMasking = true;\n this.reshapeRequired = false;\n }\n\n build(inputShape: Shape|Shape[]): void {\n // Used purely for shape validation.]\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0])) ||\n inputShape.length === 1) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of at least 2 ' +\n 'inputs');\n }\n inputShape = inputShape as Shape[];\n\n let allNoneShape = true;\n for (const shape of inputShape) {\n if (shape != null) {\n allNoneShape = false;\n break;\n }\n }\n if (allNoneShape) {\n return;\n }\n\n const shapeSet: Shape[] = [];\n for (let i = 0; i < inputShape.length; ++i) {\n const shapeWithoutConcatAxis = inputShape[i].slice();\n shapeWithoutConcatAxis.splice(this.axis, 1);\n let exists = false;\n for (const shape of shapeSet) {\n if (util.arraysEqual(shape, shapeWithoutConcatAxis)) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n shapeSet.push(shapeWithoutConcatAxis);\n }\n }\n if (shapeSet.length > 1) {\n throw new ValueError(\n 'A `Concatenate` layer requires inputs with matching shapes ' +\n 'except for the concat axis. Got input shapes: ' +\n JSON.stringify(inputShape));\n }\n }\n\n protected mergeFunction(inputs: Tensor[]): Tensor {\n return tidy(() => {\n return K.concatenate(inputs, this.axis);\n });\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (!(Array.isArray(inputShape) && Array.isArray(inputShape[0]))) {\n throw new ValueError(\n 'A `Concatenate` layer should be called on a list of inputs.');\n }\n const inputShapes = inputShape as Shape[];\n const outputShape = inputShapes[0].slice();\n const axis = this.axis < 0 ? outputShape.length + this.axis : this.axis;\n // Porting Note: the line above is because TypeScript doesn't support\n // negative indices.\n for (const shape of inputShapes.slice(1)) {\n if (outputShape[axis] == null || shape[axis] == null) {\n outputShape[axis] = null;\n break;\n }\n outputShape[axis] += shape[axis];\n }\n return outputShape;\n }\n\n // TODO(cais): Implement computeMask();\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'axis': this.axis,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(Concatenate);\n\n/**\n * Concatenate an `Array` of inputs.\n *\n * This function can be invoked in three ways.\n *\n * 1. Construct an instance of `Concatenate` layer, by using no input argument\n * or a single configuration argument. The resultant `Concatenate` layer can\n * then be used on `SymbolicTensor`s or `Tensor`s. For example:\n *\n * ```js\n * const concatLayer = tf.layers.concatenate();\n *\n * // The layer can be applied to inputs.\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = concatLayer.apply([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 7], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 2. Invoke directly on an `Array` of `SymbolicTensor`s. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `SymbolicTensor`. For example:\n *\n * ```js\n * const input1 = tf.input({shape: [2, 3]});\n * const input2 = tf.input({shape: [2, 4]});\n * const output = tf.layers.concatenate([input1, input2]);\n * console.log(output.shape);\n * // You get [null, 2, 2], with the first dimension as the undetermined batch\n * // dimension and the last dimension as the result of concatenating the\n * // last dimensions of the two inputs.\n * ```\n *\n * 3. Invoke directly on `Tensor`s, i.e., concrete values. This constructs\n * an `Layer` object internally and calls its `apply` method on the inputs,\n * generating a new `Tensor` as the result of the computation. For example:\n *\n * ```js\n * const input1 = tf.tensor2d([[1, 2], [3, 4]], [2, 2]);\n * const input2 = tf.tensor2d([[10, 20], [30, 40]], [2, 2]);\n * tf.layers.concatenate([input1, input2]).print();\n * // Gives [[1, 2, 10, 20], [3, 4, 30, 40]].\n *\n */\nexport function concatenate(config?: SymbolicTensor[]|Tensor[]|\n ConcatenateLayerConfig): Layer|SymbolicTensor|\n Tensor {\n if (Array.isArray(config)) {\n const layer = new Concatenate({});\n return layer.apply(config as SymbolicTensor[] | Tensor[]) as\n SymbolicTensor |\n Tensor;\n } else {\n return new Concatenate(config);\n }\n}\n\n// TODO(cais): Add class Dot.\n\n// TODO(cais): Add functional interfaces for the merge layers.\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Normalization layers.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, Layer, LayerConfig} from '../engine/topology';\nimport {getScalar} from '../backend/state';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, Shape} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\n// tslint:enable:max-line-length\n\n/**\n * Applies batch normalization on x given mean, var, beta and gamma.\n *\n * I.e. returns:\n * `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`\n *\n * @param x Input tensor.\n * @param mean Mean of batch.\n * @param variance Variance of batch.\n * @param beta Tensor with which to center the input.\n * @param gamma Tensor by which to scale the input.\n * @param epsilon Fuzz factor.\n * @returns The result of the batch normalization.\n */\nexport function batchNormalization(\n x: Tensor, mean: Tensor, variance: Tensor, beta?: Tensor, gamma?: Tensor,\n epsilon = 1e-3): Tensor {\n let out: Tensor;\n if (x.rank === 2) {\n out = tfc.batchNormalization2d(\n x as Tensor2D, mean as Tensor2D | Tensor1D,\n variance as Tensor2D | Tensor1D, epsilon, gamma as Tensor2D | Tensor1D,\n beta as Tensor2D | Tensor1D);\n } else if (x.rank === 3) {\n // TODO(cais): Check rank; give proper error message.\n out = tfc.batchNormalization3d(\n x as Tensor3D, mean as Tensor3D | Tensor1D,\n variance as Tensor3D | Tensor1D, epsilon, gamma as Tensor3D | Tensor1D,\n beta as Tensor3D | Tensor1D);\n } else if (x.rank === 4) {\n out = tfc.batchNormalization4d(\n x as Tensor4D, mean as Tensor4D | Tensor1D,\n variance as Tensor4D | Tensor1D, epsilon, gamma as Tensor4D | Tensor1D,\n beta as Tensor4D | Tensor1D);\n } else {\n throw new NotImplementedError(\n `batchNormalization is not implememnted for array of rank ${x.rank} ` +\n `yet`);\n }\n return out;\n}\n\n/**\n * Non-broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction regularNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const normed =\n batchNormalization(x, mean, variance, beta, gamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Broadcasting batch normalization for use in training (not inference).\n *\n * The input is normalized to zero mean and unit variance along the\n * `reductionAxes`, followed by scaling with `gamma` and shifted by `beta`.\n * The result of that is returned as the first element\n * of the returned `Array`. The other two elements are the mean and variance,\n * respectively.\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nfunction broadcastNormalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n return tidy(() => {\n const meanAndVariance = tfc.moments(x, reductionAxes);\n const mean = meanAndVariance.mean;\n const variance = meanAndVariance.variance;\n const targetShape: number[] = [];\n for (const axis of math_utils.range(0, x.rank)) {\n if (reductionAxes.indexOf(axis) !== -1) {\n targetShape.push(1);\n } else {\n targetShape.push(x.shape[axis]);\n }\n }\n const broadcastMean = mean.reshape(targetShape);\n const broadcastVariance = variance.reshape(targetShape);\n const broadcastGamma =\n gamma == null ? null : gamma.reshape(targetShape);\n const broadcastBeta =\n beta == null ? null : beta.reshape(targetShape);\n const normed = batchNormalization(\n x, broadcastMean, broadcastVariance, broadcastBeta,\n broadcastGamma, epsilon);\n return [normed, mean, variance];\n }) as [Tensor, Tensor, Tensor];\n}\n\n/**\n * Batch normalization for use in training (not inference).\n *\n * @param x Input tensor to be normalized.\n * @param gamma Tensor by which to scale the input.\n * @param beta Tensor by which to center the input.\n * @param reductionAxes Axes over which to normalize.\n * @param epsilon Fuzz factor.\n * @returns An `Array` of three `Tensors`:\n * [normalized tensor, mean of input, variance of input].\n */\nexport function normalizeBatchInTraining(\n x: Tensor, gamma: Tensor, beta: Tensor, reductionAxes: number[],\n epsilon = 1e-3): [Tensor, Tensor, Tensor] {\n if (util.arraysEqual(\n reductionAxes.slice().sort(), math_utils.range(0, x.rank - 1))) {\n return regularNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n } else {\n return broadcastNormalizeBatchInTraining(\n x, gamma, beta, reductionAxes, epsilon);\n }\n}\n\nexport interface BatchNormalizationLayerConfig extends LayerConfig {\n /**\n * The integer axis that should be normalized (typically the features axis).\n * Defaults to -1.\n *\n * For instance, after a `Conv2D` layer with `data_format=\"channels_first\"`,\n * set `axis=1` in `batchNormalization`.\n */\n axis?: number;\n\n /**\n * Momentum of the moving average. Defaults to 0.99.\n */\n momentum?: number;\n\n /**\n * Small float added to the variance to avoid dividing by zero. Defaults to\n * 1e-3.\n */\n epsilon?: number;\n\n /**\n * If `true`, add offset of `beta` to normalized tensor.\n * If `false`, `beta` is ignored.\n * Defaults to `true`.\n */\n center?: boolean;\n\n /**\n * If `true`, multiply by `gamma`.\n * If `false`, `gamma` is not used.\n * When the next layer is linear (also e.g. `nn.relu`),\n * this can be disabled since the scaling will be done by the next layer.\n * Defaults to `true`.\n */\n scale?: boolean;\n\n /**\n * Initializer for the beta weight.\n * Defaults to 'zeros'.\n */\n betaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the gamma weight.\n * Defaults to `ones`.\n */\n gammaInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving mean.\n * Defaults to `zeros`\n */\n movingMeanInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the moving variance.\n * Defaults to 'Ones'.\n */\n movingVarianceInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Constraint for the beta weight.\n */\n betaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint for gamma weight.\n */\n gammaConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Regularizer for the beta weight.\n */\n betaRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer for the gamma weight.\n */\n gammaRegularizer?: RegularizerIdentifier|Regularizer;\n}\n\n\n/**\n * Batch normalization layer (Ioffe and Szegedy, 2014).\n *\n * Normalize the activations of the previous layer at each batch,\n * i.e. applies a transformation that maintains the mean activation\n * close to 0 and the activation standard deviation close to 1.\n *\n * Input shape:\n * Arbitrary. Use the keyword argument `inputShape` (Array of integers, does\n * not include the sample axis) when calling the constructor of this class,\n * if this layer is used as a first layer in a model.\n *\n * Output shape:\n * Same shape as input.\n *\n * References:\n * - [Batch Normalization: Accelerating Deep Network Training by Reducing\n * Internal Covariate Shift](https://arxiv.org/abs/1502.03167)\n */\nexport class BatchNormalization extends Layer {\n static className = 'BatchNormalization';\n private readonly axis: number;\n private readonly momentum: number;\n private readonly epsilon: number;\n private readonly center: boolean;\n private readonly scale: boolean;\n private readonly betaInitializer: Initializer;\n private readonly gammaInitializer: Initializer;\n private readonly movingMeanInitializer: Initializer;\n private readonly movingVarianceInitializer: Initializer;\n private readonly betaConstraint: Constraint;\n private readonly gammaConstraint: Constraint;\n private readonly betaRegularizer: Regularizer;\n private readonly gammaRegularizer: Regularizer;\n private gamma: LayerVariable;\n private beta: LayerVariable;\n private movingMean: LayerVariable;\n private movingVariance: LayerVariable;\n private stepCount: number;\n\n constructor(config: BatchNormalizationLayerConfig) {\n super(config);\n this.supportsMasking = true;\n this.axis = config.axis == null ? -1 : config.axis;\n this.momentum = config.momentum == null ? 0.99 : config.momentum;\n this.epsilon = config.epsilon == null ? 1e-3 : config.epsilon;\n this.center = config.center == null ? true : config.center;\n this.scale = config.scale == null ? true : config.scale;\n this.betaInitializer = getInitializer(config.betaInitializer || 'zeros');\n this.gammaInitializer = getInitializer(config.gammaInitializer || 'ones');\n this.movingMeanInitializer =\n getInitializer(config.movingMeanInitializer || 'zeros');\n this.movingVarianceInitializer =\n getInitializer(config.movingVarianceInitializer || 'ones');\n this.betaConstraint = getConstraint(config.betaConstraint);\n this.gammaConstraint = getConstraint(config.gammaConstraint);\n this.betaRegularizer = getRegularizer(config.betaRegularizer);\n this.gammaRegularizer = getRegularizer(config.gammaRegularizer);\n this.stepCount = 0;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const axis = this.axis >= 0 ? this.axis : (this.axis + inputShape.length);\n const dim = inputShape[axis];\n if (dim == null) {\n throw new ValueError(\n `Axis ${axis} of input tensor should have a defined dimension but ` +\n `the layer received an input with shape ` +\n `${JSON.stringify(inputShape)}.`);\n }\n this.inputSpec =\n [new InputSpec({ndim: inputShape.length, axes: {[axis]: dim}})];\n const shape = [dim];\n if (this.scale) {\n this.gamma = this.addWeight(\n 'gamma', shape, null, this.gammaInitializer, this.gammaRegularizer,\n true, this.gammaConstraint);\n }\n if (this.center) {\n this.beta = this.addWeight(\n 'beta', shape, null, this.betaInitializer, this.betaRegularizer, true,\n this.betaConstraint);\n }\n this.movingMean = this.addWeight(\n 'moving_mean', shape, null, this.movingMeanInitializer, null, false);\n this.movingVariance = this.addWeight(\n 'moving_variance', shape, null, this.movingVarianceInitializer, null,\n false);\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n const input = getExactlyOneTensor(inputs);\n const inputShape = input.shape;\n const ndim = inputShape.length;\n const reductionAxes = math_utils.range(0, ndim);\n const axis = this.axis >= 0 ? this.axis : (this.axis + ndim);\n reductionAxes.splice(axis, 1);\n const broadcastShape = generic_utils.pyListRepeat(1, ndim);\n broadcastShape[axis] = inputShape[axis];\n\n const sortedReductionAxes = reductionAxes.slice();\n sortedReductionAxes.sort();\n const needsBroadcasting = !util.arraysEqual(\n sortedReductionAxes, math_utils.range(0, ndim).slice(0, ndim - 1));\n\n const normalizeInference: () => Tensor = () => {\n if (needsBroadcasting) {\n const broadcastMovingMean =\n this.movingMean.read().reshape(broadcastShape);\n const broadcastMovingVariance =\n this.movingVariance.read().reshape(broadcastShape);\n const broadcastBeta =\n this.center ? this.beta.read().reshape(broadcastShape) : null;\n const broadcastGamma =\n this.scale ? this.gamma.read().reshape(broadcastShape) : null;\n return batchNormalization(\n input, broadcastMovingMean, broadcastMovingVariance,\n broadcastBeta, broadcastGamma, this.epsilon);\n } else {\n return batchNormalization(\n input, this.movingMean.read(), this.movingVariance.read(),\n this.beta == null ? null : this.beta.read(),\n this.gamma == null ? null : this.gamma.read(), this.epsilon);\n }\n };\n\n if (!training) {\n return normalizeInference();\n }\n\n const [normedTraining, mean, variance] = normalizeBatchInTraining(\n input, this.gamma.read(), this.beta.read(), reductionAxes,\n this.epsilon);\n\n // Debias variance.\n const sampleSize =\n math_utils.arrayProd(reductionAxes.map(axis => input.shape[axis]));\n const varianceDebiased = variance.mul(\n getScalar(sampleSize / (sampleSize - (1 + this.epsilon))));\n\n // Perform updates to moving mean and moving variance for training.\n // Porting Note: In PyKeras, these updates to `movingMean` and\n // `movingAverage` are done as a deferred Graph, added to the `Layer`'s\n // `update`s using the `add_update()` method. Here we do it imperatively\n // and encapsulate the updates in a function that is invoked\n // immediately.\n const updateMovingMeanAndVariance = () => {\n this.stepCount++;\n const newMovingMean = tfc.movingAverage(\n this.movingMean.read(), mean, this.momentum, this.stepCount);\n this.movingMean.write(newMovingMean);\n const newMovingVariance = tfc.movingAverage(\n this.movingVariance.read(), varianceDebiased, this.momentum,\n this.stepCount);\n this.movingVariance.write(newMovingVariance);\n };\n updateMovingMeanAndVariance();\n\n return normedTraining;\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n axis: this.axis,\n momentum: this.momentum,\n epsilon: this.epsilon,\n center: this.center,\n scale: this.scale,\n betaInitializer: serializeInitializer(this.betaInitializer),\n gammaInitializer: serializeInitializer(this.gammaInitializer),\n movingMeanInitializer: serializeInitializer(this.movingMeanInitializer),\n movingVarianceInitializer:\n serializeInitializer(this.movingVarianceInitializer),\n betaRegularizer: serializeRegularizer(this.betaRegularizer),\n gammaRegularizer: serializeRegularizer(this.gammaRegularizer),\n betaConstraint: serializeConstraint(this.betaConstraint),\n gammaConstraint: serializeConstraint(this.gammaConstraint)\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(BatchNormalization);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Padding Layers.\n */\n\n// Porting Note: In Python Keras, the padding layers are in convolutional.py,\n// but we decided to put them in a separate file (padding.ts) for clarity.\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport {DataFormat} from '../common';\nimport {InputSpec, Layer, LayerConfig} from '../engine/topology';\nimport {ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\n// tslint:enable:max-line-length\n\n/**\n * Pads the middle dimension of a 3D tensor.\n *\n * @param x Input `Tensor` to be padded.\n * @param padding `Array` of 2 integers, how many zeros to add at the start and\n * end of the middle dimension (i.e., dimension 1).\n * @return A padded 3D `Tensor`.\n */\nexport function temporalPadding(x: Tensor, padding?: [number, number]): Tensor {\n return tidy(() => {\n if (x.rank !== 3) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 3-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [1, 1];\n }\n if (padding.length !== 2) {\n throw new ValueError(\n `temporalPadding expects input padding pattern to be a length-2 ` +\n `array, but received a length-${padding.length} array.`);\n }\n\n const pattern: Array<[number, number]> = [[0, 0], padding, [0, 0]];\n return tfc.pad(x, pattern);\n });\n}\n\n/**\n * Pads the 2nd and 3rd dimensions of a 4D tensor.\n *\n * @param x Input `Tensor` to be padded.\n * @param padding `Array` of two `Array`s, each of which is an `Array` of two\n * integers. The amount of padding at the beginning and end of the 2nd and 3rd\n * dimensions, respectively.\n * @param dataFormat 'channelsLast' (default) or 'channelsFirst'.\n * @return Padded 4D `Tensor`.\n */\nexport function spatial2dPadding(\n x: Tensor, padding?: [[number, number], [number, number]],\n dataFormat?: DataFormat): Tensor {\n return tidy(() => {\n if (x.rank !== 4) {\n throw new ValueError(\n `temporalPadding expects input tensor to be 4-D, but received a ` +\n `${x.rank}-D tensor.`);\n }\n\n if (padding == null) {\n padding = [[1, 1], [1, 1]];\n }\n if (padding.length !== 2 || padding[0].length !== 2 ||\n padding[1].length !== 2) {\n throw new ValueError(\n 'spatial2dPadding expects `padding` to be an Array of two Arrays, ' +\n 'each of which is an Array of two integers.');\n }\n\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (dataFormat !== 'channelsLast' && dataFormat !== 'channelsFirst') {\n throw new ValueError(\n `Unknown data format: ${dataFormat}. ` +\n `Supported data formats are 'channelsLast' and 'channelsFirst.`);\n }\n\n let pattern: Array<[number, number]>;\n if (dataFormat === 'channelsFirst') {\n pattern = [[0, 0], [0, 0], padding[0], padding[1]];\n } else {\n pattern = [[0, 0], padding[0], padding[1], [0, 0]];\n }\n\n return tfc.pad(x, pattern);\n });\n}\n\nexport interface ZeroPadding2DLayerConfig extends LayerConfig {\n /**\n * Integer, or `Array` of 2 integers, or `Array` of 2 `Array`s, each of\n * which is an `Array` of 2 integers.\n * - If integer, the same symmetric padding is applied to width and height.\n * - If Array` of 2 integers, interpreted as two different symmetric values\n * for height and width:\n * `[symmetricHeightPad, symmetricWidthPad]`.\n * - If `Array` of 2 `Array`s, interpreted as:\n * `[[topPad, bottomPad], [leftPad, rightPad]]`.\n */\n padding?: number|[number, number]|[[number, number], [number, number]];\n\n /**\n * One of `'channelsLast'` (default) and `'channelsFirst'`.\n *\n * The ordering of the dimensions in the inputs.\n * `channelsLast` corresponds to inputs with shape\n * `[batch, height, width, channels]` while `channelsFirst`\n * corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Zero-padding layer for 2D input (e.g., image).\n *\n * This layer can add rows and columns of zeros\n * at the top, bottom, left and right side of an image tensor.\n *\n * Input shape:\n * 4D tensor with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, rows, cols, channels]`\n * - If `data_format` is `\"channels_first\"`:\n * `[batch, channels, rows, cols]`.\n *\n * Output shape:\n * 4D with shape:\n * - If `dataFormat` is `\"channelsLast\"`:\n * `[batch, paddedRows, paddedCols, channels]`\n * - If `dataFormat` is `\"channelsFirst\"`:\n * `[batch, channels, paddedRows, paddedCols]`.\n */\nexport class ZeroPadding2D extends Layer {\n static className = 'ZeroPadding2D';\n readonly dataFormat: DataFormat;\n readonly padding: [[number, number], [number, number]];\n\n constructor(config?: ZeroPadding2DLayerConfig) {\n if (config == null) {\n config = {};\n }\n super(config);\n\n this.dataFormat =\n config.dataFormat == null ? imageDataFormat() : config.dataFormat;\n // TODO(cais): Maybe refactor the following logic surrounding `padding`\n // into a helper method.\n if (config.padding == null) {\n this.padding = [[1, 1], [1, 1]];\n } else if (typeof config.padding === 'number') {\n this.padding =\n [[config.padding, config.padding], [config.padding, config.padding]];\n } else {\n config.padding = config.padding as [number, number] |\n [[number, number], [number, number]];\n if (config.padding.length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects padding to be a length-2 array, but ` +\n `received a length-${config.padding.length} array.`);\n }\n\n let heightPadding: [number, number];\n let widthPadding: [number, number];\n if (typeof config.padding[0] === 'number') {\n heightPadding =\n [config.padding[0] as number, config.padding[0] as number];\n widthPadding =\n [config.padding[1] as number, config.padding[1] as number];\n } else {\n config.padding = config.padding as [[number, number], [number, number]];\n\n if (config.padding[0].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects height padding to be a length-2 array, ` +\n `but received a length-${config.padding[0].length} array.`);\n }\n heightPadding = config.padding[0] as [number, number];\n\n if (config.padding[1].length !== 2) {\n throw new ValueError(\n `ZeroPadding2D expects width padding to be a length-2 array, ` +\n `but received a length-${config.padding[1].length} array.`);\n }\n widthPadding = config.padding[1] as [number, number];\n }\n this.padding = [heightPadding, widthPadding];\n }\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n\n let rows: number;\n let cols: number;\n if (this.dataFormat === 'channelsFirst') {\n if (inputShape[2] != null && inputShape[2] >= 0) {\n rows = inputShape[2] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[3] != null && inputShape[3] >= 0) {\n cols = inputShape[3] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n if (inputShape[1] != null && inputShape[1] >= 0) {\n rows = inputShape[1] + this.padding[0][0] + this.padding[0][1];\n } else {\n rows = null;\n }\n if (inputShape[2] != null && inputShape[2] >= 0) {\n cols = inputShape[2] + this.padding[1][0] + this.padding[1][1];\n } else {\n cols = null;\n }\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(\n () => spatial2dPadding(\n getExactlyOneTensor(inputs), this.padding, this.dataFormat));\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n padding: this.padding,\n dataFormat: this.dataFormat,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(ZeroPadding2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Pooling Layers.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, Tensor3D, Tensor4D, tidy} from '@tensorflow/tfjs-core';\n\nimport {imageDataFormat} from '../backend/common';\nimport * as K from '../backend/tfjs_backend';\nimport {checkDataFormat, checkPaddingMode, checkPoolMode, DataFormat, PaddingMode, PoolMode} from '../common';\nimport {InputSpec} from '../engine/topology';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {convOutputLength} from '../utils/conv_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\n\nimport {preprocessConv2DInput} from './convolutional';\n\n// tslint:enable:max-line-length\n\n/**\n * 2D pooling.\n * @param x\n * @param poolSize\n * @param stridesdes strides. Defaults to [1, 1].\n * @param padding padding. Defaults to 'valid'.\n * @param dataFormat data format. Defaults to 'channelsLast'.\n * @param poolMode Mode of pooling. Defaults to 'max'.\n * @returns Result of the 2D pooling.\n */\nexport function pool2d(\n x: Tensor, poolSize: [number, number], strides?: [number, number],\n padding?: PaddingMode, dataFormat?: DataFormat,\n poolMode?: PoolMode): Tensor {\n return tidy(() => {\n checkDataFormat(dataFormat);\n checkPoolMode(poolMode);\n checkPaddingMode(padding);\n if (strides == null) {\n strides = [1, 1];\n }\n if (padding == null) {\n padding = 'valid';\n }\n if (dataFormat == null) {\n dataFormat = imageDataFormat();\n }\n if (poolMode == null) {\n poolMode = 'max';\n }\n\n // TODO(cais): Remove the preprocessing step once deeplearn.js supports\n // dataFormat as an input argument.\n x = preprocessConv2DInput(x, dataFormat); // x is NHWC after preprocessing.\n let y: Tensor;\n const paddingString = (padding === 'same') ? 'same' : 'valid';\n if (poolMode === 'max') {\n // TODO(cais): Rank check?\n y = tfc.maxPool(x as Tensor4D, poolSize, strides, paddingString);\n } else { // 'avg'\n // TODO(cais): Check the dtype and rank of x and give clear error message\n // if those are incorrect.\n y = tfc.avgPool(\n // TODO(cais): Rank check?\n x as Tensor3D | Tensor4D, poolSize, strides, paddingString);\n }\n if (dataFormat === 'channelsFirst') {\n y = tfc.transpose(y, [0, 3, 1, 2]); // NHWC -> NCHW.\n }\n return y;\n });\n}\n\n\nexport interface Pooling1DLayerConfig extends LayerConfig {\n /**\n * Size of the window to pool over, should be an integer.\n */\n poolSize?: number;\n /**\n * Period at which to sample the pooled values.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number;\n /** How to fill in data that's not an integer multiple of poolSize. */\n padding?: PaddingMode;\n}\n\n/**\n * Abstract class for different pooling 1D layers.\n */\nexport abstract class Pooling1D extends Layer {\n protected readonly poolSize: [number];\n protected readonly strides: [number];\n protected readonly padding: PaddingMode;\n\n /**\n *\n * @param config Parameters for the Pooling layer.\n *\n * config.poolSize defaults to 2.\n */\n constructor(config: Pooling1DLayerConfig) {\n if (config.poolSize == null) {\n config.poolSize = 2;\n }\n super(config);\n if (typeof config.poolSize === 'number') {\n this.poolSize = [config.poolSize];\n } else if (\n Array.isArray(config.poolSize) &&\n (config.poolSize as number[]).length === 1 &&\n typeof (config.poolSize as number[])[0] === 'number') {\n this.poolSize = config.poolSize;\n } else {\n throw new ValueError(\n `poolSize for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(config.poolSize)}`);\n }\n if (config.strides == null) {\n this.strides = this.poolSize;\n } else {\n if (typeof config.strides === 'number') {\n this.strides = [config.strides];\n } else if (\n Array.isArray(config.strides) &&\n (config.strides as number[]).length === 1 &&\n typeof (config.strides as number[])[0] === 'number') {\n this.strides = config.strides;\n } else {\n throw new ValueError(\n `strides for 1D convolutional layer must be a number or an ` +\n `Array of a single number, but received ` +\n `${JSON.stringify(config.strides)}`);\n }\n }\n\n this.padding = config.padding == null ? 'valid' : config.padding;\n checkPaddingMode(this.padding);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const length = convOutputLength(\n inputShape[1], this.poolSize[0], this.padding, this.strides[0]);\n return [inputShape[0], length, inputShape[2]];\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n // Add dummy last dimension.\n inputs = K.expandDims(getExactlyOneTensor(inputs), 2);\n const output = this.poolingFunction(\n getExactlyOneTensor(inputs), [this.poolSize[0], 1],\n [this.strides[0], 1], this.padding, 'channelsLast');\n // Remove dummy last dimension.\n return tfc.squeeze(output, [2]);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Max pooling operation for temporal data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n */\nexport class MaxPooling1D extends Pooling1D {\n static className = 'MaxPooling1D';\n constructor(config: Pooling1DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.SerializationMap.register(MaxPooling1D);\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape: `[batchSize, inLength, channels]`\n *\n * Output shape: `[batchSize, pooledLength, channels]`\n *\n * `tf.avgPool1d` is an alias.\n */\nexport class AveragePooling1D extends Pooling1D {\n static className = 'AveragePooling1D';\n constructor(config: Pooling1DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.SerializationMap.register(AveragePooling1D);\n\nexport interface Pooling2DLayerConfig extends LayerConfig {\n /**\n * Factors by which to downscale in each dimension [vertical, horizontal].\n * Expects an integer or an array of 2 integers.\n *\n * For example, `[2, 2]` will halve the input in both spatial dimension.\n * If only one integer is specified, the same window length\n * will be used for both dimensions.\n */\n poolSize?: number|[number, number];\n\n /**\n * The size of the stride in each dimension of the pooling window. Expects\n * an integer or an array of 2 integers. Integer, tuple of 2 integers, or\n * None.\n *\n * If `null`, defaults to `poolSize`.\n */\n strides?: number|[number, number];\n\n /** The padding type to use for the pooling layer. */\n padding?: PaddingMode;\n /** The data format to use for the pooling layer. */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different pooling 2D layers.\n */\nexport abstract class Pooling2D extends Layer {\n protected readonly poolSize: [number, number];\n protected readonly strides: [number, number];\n protected readonly padding: PaddingMode;\n protected readonly dataFormat: DataFormat;\n\n constructor(config: Pooling2DLayerConfig) {\n if (config.poolSize == null) {\n config.poolSize = [2, 2];\n }\n super(config);\n this.poolSize = Array.isArray(config.poolSize) ?\n config.poolSize :\n [config.poolSize, config.poolSize];\n if (config.strides == null) {\n this.strides = this.poolSize;\n } else if (Array.isArray(config.strides)) {\n if (config.strides.length !== 2) {\n throw new ValueError(\n `If the strides property of a 2D pooling layer is an Array, ` +\n `it is expected to have a length of 2, but received length ` +\n `${config.strides.length}.`);\n }\n this.strides = config.strides;\n } else {\n // `config.strides` is a number.\n this.strides = [config.strides, config.strides];\n }\n this.padding = config.padding == null ? 'valid' : config.padding;\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n checkDataFormat(this.dataFormat);\n checkPaddingMode(this.padding);\n\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n let rows =\n this.dataFormat === 'channelsFirst' ? inputShape[2] : inputShape[1];\n let cols =\n this.dataFormat === 'channelsFirst' ? inputShape[3] : inputShape[2];\n rows =\n convOutputLength(rows, this.poolSize[0], this.padding, this.strides[0]);\n cols =\n convOutputLength(cols, this.poolSize[1], this.padding, this.strides[1]);\n if (this.dataFormat === 'channelsFirst') {\n return [inputShape[0], inputShape[1], rows, cols];\n } else {\n return [inputShape[0], rows, cols, inputShape[3]];\n }\n }\n\n protected abstract poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor;\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n this.invokeCallHook(inputs, kwargs);\n return this.poolingFunction(\n getExactlyOneTensor(inputs), this.poolSize, this.strides,\n this.padding, this.dataFormat);\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {\n poolSize: this.poolSize,\n padding: this.padding,\n strides: this.strides,\n dataFormat: this.dataFormat\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Max pooling operation for spatial data.\n *\n * Input shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat=CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat=CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n */\nexport class MaxPooling2D extends Pooling2D {\n static className = 'MaxPooling2D';\n constructor(config: Pooling2DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'max');\n }\n}\nserialization.SerializationMap.register(MaxPooling2D);\n\n/**\n * Average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, rows, cols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, rows, cols]`\n *\n * Output shape\n * - If `dataFormat === CHANNEL_LAST`:\n * 4D tensor with shape:\n * `[batchSize, pooleRows, pooledCols, channels]`\n * - If `dataFormat === CHANNEL_FIRST`:\n * 4D tensor with shape:\n * `[batchSize, channels, pooleRows, pooledCols]`\n *\n * `tf.avgPool2d` is an alias.\n */\nexport class AveragePooling2D extends Pooling2D {\n static className = 'AveragePooling2D';\n constructor(config: Pooling2DLayerConfig) {\n super(config);\n }\n\n protected poolingFunction(\n inputs: Tensor, poolSize: [number, number], strides: [number, number],\n padding: PaddingMode, dataFormat: DataFormat): Tensor {\n checkDataFormat(dataFormat);\n checkPaddingMode(padding);\n return pool2d(inputs, poolSize, strides, padding, dataFormat, 'avg');\n }\n}\nserialization.SerializationMap.register(AveragePooling2D);\n\n/**\n * Abstract class for different global pooling 1D layers.\n */\nexport abstract class GlobalPooling1D extends Layer {\n constructor(config: LayerConfig) {\n super(config);\n this.inputSpec = [new InputSpec({ndim: 3})];\n }\n\n computeOutputShape(inputShape: Shape): Shape {\n return [inputShape[0], inputShape[2]];\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n}\n\n/**\n * Global average pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n */\nexport class GlobalAveragePooling1D extends GlobalPooling1D {\n static className = 'GlobalAveragePooling1D';\n constructor(config: LayerConfig) {\n super(config);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.mean(input, 1);\n });\n }\n}\nserialization.SerializationMap.register(GlobalAveragePooling1D);\n\n/**\n * Global max pooling operation for temporal data.\n *\n * Input Shape: 3D tensor with shape: `[batchSize, steps, features]`.\n *\n * Output Shape:2D tensor with shape: `[batchSize, features]`.\n */\nexport class GlobalMaxPooling1D extends GlobalPooling1D {\n static className = 'GlobalMaxPooling1D';\n constructor(config: LayerConfig) {\n super(config);\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n return tfc.max(input, 1);\n });\n }\n}\nserialization.SerializationMap.register(GlobalMaxPooling1D);\n\nexport interface GlobalPooling2DLayerConfig extends LayerConfig {\n /**\n * One of `CHANNEL_LAST` (default) or `CHANNEL_FIRST`.\n *\n * The ordering of the dimensions in the inputs. `CHANNEL_LAST` corresponds\n * to inputs with shape `[batch, height, width, channels[` while\n * `CHANNEL_FIRST` corresponds to inputs with shape\n * `[batch, channels, height, width]`.\n */\n dataFormat?: DataFormat;\n}\n\n/**\n * Abstract class for different global pooling 2D layers.\n */\nexport abstract class GlobalPooling2D extends Layer {\n protected dataFormat: DataFormat;\n constructor(config: GlobalPooling2DLayerConfig) {\n super(config);\n this.dataFormat =\n config.dataFormat == null ? 'channelsLast' : config.dataFormat;\n checkDataFormat(this.dataFormat);\n this.inputSpec = [new InputSpec({ndim: 4})];\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = inputShape as Shape;\n if (this.dataFormat === 'channelsLast') {\n return [inputShape[0], inputShape[3]];\n } else {\n return [inputShape[0], inputShape[1]];\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n throw new NotImplementedError();\n }\n\n getConfig(): serialization.ConfigDict {\n const config = {dataFormat: this.dataFormat};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\n\n/**\n * Global average pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n */\nexport class GlobalAveragePooling2D extends GlobalPooling2D {\n static className = 'GlobalAveragePooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.mean(input, [1, 2]);\n } else {\n return tfc.mean(input, [2, 3]);\n }\n });\n }\n}\nserialization.SerializationMap.register(GlobalAveragePooling2D);\n\n/**\n * Global max pooling operation for spatial data.\n *\n * Input shape:\n * - If `dataFormat` is `CHANNEL_LAST`:\n * 4D tensor with shape: `[batchSize, rows, cols, channels]`.\n * - If `dataFormat` is `CHANNEL_FIRST`:\n * 4D tensor with shape: `[batchSize, channels, rows, cols]`.\n *\n * Output shape:\n * 2D tensor with shape: `[batchSize, channels]`.\n */\nexport class GlobalMaxPooling2D extends GlobalPooling2D {\n static className = 'GlobalMaxPooling2D';\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const input = getExactlyOneTensor(inputs);\n if (this.dataFormat === 'channelsLast') {\n return tfc.max(input, [1, 2]);\n } else {\n return tfc.max(input, [2, 3]);\n }\n });\n }\n}\nserialization.SerializationMap.register(GlobalMaxPooling2D);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * TensorFlow.js Layers: Recurrent Neural Network Layers.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {DataType, serialization, Tensor, tidy, util} from '@tensorflow/tfjs-core';\n\nimport {Activation, ActivationIdentifier, getActivation, serializeActivation} from '../activations';\nimport {getScalar} from '../backend/state';\nimport * as K from '../backend/tfjs_backend';\nimport {Constraint, ConstraintIdentifier, getConstraint, serializeConstraint} from '../constraints';\nimport {InputSpec, SymbolicTensor} from '../engine/topology';\nimport {Layer, LayerConfig} from '../engine/topology';\nimport {AttributeError, NotImplementedError, ValueError} from '../errors';\nimport {getInitializer, Initializer, InitializerIdentifier, Ones, serializeInitializer} from '../initializers';\nimport {getRegularizer, Regularizer, RegularizerIdentifier, serializeRegularizer} from '../regularizers';\nimport {Kwargs, RnnStepFunction, Shape} from '../types';\nimport * as math_utils from '../utils/math_utils';\nimport {getExactlyOneShape, getExactlyOneTensor, isArrayOfShapes} from '../utils/types_utils';\nimport {batchGetValue, batchSetValue, LayerVariable} from '../variables';\n\nimport {deserialize} from './serialization';\n\n// tslint:enable:max-line-length\n\n/**\n * Standardize `apply()` args to a single list of tensor inputs.\n *\n * When running a model loaded from file, the input tensors `initialState` and\n * `constants` are passed to `RNN.apply()` as part of `inputs` instead of the\n * dedicated kwargs fields. `inputs` consists of\n * `[inputs, initialState0, initialState1, ..., constant0, constant1]` in this\n * case.\n * This method makes sure that arguments are\n * separated and that `initialState` and `constants` are `Array`s of tensors\n * (or None).\n *\n * @param inputs Tensor or `Array` of tensors.\n * @param initialState Tensor or `Array` of tensors or `null`/`undefined`.\n * @param constants Tensor or `Array` of tensors or `null`/`undefined`.\n * @returns An object consisting of\n * inputs: A tensor.\n * initialState: `Array` of tensors or `null`.\n * constants: `Array` of tensors or `null`.\n * @throws ValueError, if `inputs` is an `Array` but either `initialState` or\n * `constants` is provided.\n */\nexport function standardizeArgs(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n initialState: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n constants: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n numConstants?: number): {\n inputs: Tensor|SymbolicTensor,\n initialState: Tensor[]|SymbolicTensor[],\n constants: Tensor[]|SymbolicTensor[]\n} {\n if (Array.isArray(inputs)) {\n if (initialState != null || constants != null) {\n throw new ValueError(\n 'When inputs is an array, neither initialState or constants ' +\n 'should be provided');\n }\n if (numConstants != null) {\n constants = inputs.slice(inputs.length - numConstants, inputs.length);\n inputs = inputs.slice(0, inputs.length - numConstants);\n }\n if (inputs.length > 1) {\n initialState = inputs.slice(1, inputs.length);\n }\n inputs = inputs[0];\n }\n\n function toListOrNull(x: Tensor|Tensor[]|SymbolicTensor|\n SymbolicTensor[]): Tensor[]|SymbolicTensor[] {\n if (x == null || Array.isArray(x)) {\n return x as Tensor[] | SymbolicTensor[];\n } else {\n return [x] as Tensor[] | SymbolicTensor[];\n }\n }\n\n initialState = toListOrNull(initialState);\n constants = toListOrNull(constants);\n\n return {inputs, initialState, constants};\n}\n\n/**\n * Iterates over the time dimension of a tensor.\n *\n * @param stepFunction RNN step function.\n * Parameters:\n * inputs: tensor with shape `[samples, ...]` (no time dimension),\n * representing input for the batch of samples at a certain time step.\n * states: an Array of tensors.\n * Returns:\n * outputs: tensor with shape `[samples, outputDim]` (no time dimension).\n * newStates: list of tensors, same length and shapes as `states`. The first\n * state in the list must be the output tensor at the previous timestep.\n * @param inputs Tensor of temporal data of shape `[samples, time, ...]` (at\n * least 3D).\n * @param initialStates Tensor with shape `[samples, outputDim]` (no time\n * dimension), containing the initial values of the states used in the step\n * function.\n * @param goBackwards If `true`, do the iteration over the time dimension in\n * reverse order and return the reversed sequence.\n * @param mask Binary tensor with shape `[sample, time, 1]`, with a zero for\n * every element that is masked.\n * @param constants An Array of constant values passed at each step.\n * @param unroll Whether to unroll the RNN or to use a symbolic loop. *Not*\n * applicable to this imperative deeplearn.js backend. Its value is ignored.\n * @param inputLength Not relevant in this deeplearn.js backend.\n * @returns An Array: `[lastOutput, outputs, newStates]`.\n * lastOutput: the lastest output of the RNN, of shape `[samples, ...]`.\n * outputs: tensor with shape `[samples, time, ...]` where each entry\n * `output[s, t]` is the output of the step function at time `t` for sample\n * `s`.\n * newStates: Array of tensors, latest states returned by the step function,\n * of shape `(samples, ...)`.\n * @throws ValueError If input dimension is less than 3.\n *\n * TODO(nielsene): This needs to be tidy-ed.\n */\nexport function rnn(\n stepFunction: RnnStepFunction, inputs: Tensor, initialStates: Tensor[],\n goBackwards = false, mask?: Tensor, constants?: Tensor[], unroll = false,\n inputLength?: number): [Tensor, Tensor, Tensor[]] {\n const ndim = inputs.shape.length;\n if (ndim < 3) {\n throw new ValueError(`Input should be at least 3D, but is ${ndim}D.`);\n }\n\n // Transpose to time-major, i.e., from [batch, time, ...] to [time, batch,\n // ...].\n const axes = [1, 0].concat(math_utils.range(2, ndim));\n inputs = tfc.transpose(inputs, axes);\n\n if (mask != null) {\n throw new NotImplementedError(\n 'The rnn() function of the deeplearn.js backend does not support ' +\n 'masking yet.');\n }\n\n if (constants != null) {\n throw new NotImplementedError(\n 'The rnn() functoin of the deeplearn.js backend does not support ' +\n 'constants yet.');\n }\n\n // Porting Note: the unroll option is ignored by the imperative backend.\n if (unroll) {\n console.warn(\n 'Backend rnn(): the unroll = true option is not applicable to the ' +\n 'imperative deeplearn.js backend.');\n }\n\n if (goBackwards) {\n inputs = tfc.reverse(inputs, 0);\n }\n\n // Porting Note: PyKeras with TensorFlow backend uses a symbolic loop\n // (tf.while_loop). But for the imperative deeplearn.js backend, we just\n // use the usual TypeScript control flow to iterate over the time steps in\n // the inputs.\n // Porting Note: PyKeras patches a \"_use_learning_phase\" attribute to\n // outputs.\n // This is not idiomatic in TypeScript. The info regarding whether we are\n // in a learning (i.e., training) phase for RNN is passed in a different\n // way.\n // TODO(cais): Determine in what exact way the learning phase information\n // will be passed.\n\n let outputs: Tensor;\n let lastOutput: Tensor;\n let states = initialStates;\n const timeSteps = inputs.shape[0];\n for (let t = 0; t < timeSteps; ++t) {\n let currentInput = K.sliceAlongFirstAxis(inputs, t, 1);\n currentInput = currentInput.reshape(currentInput.shape.slice(1));\n const stepOutputs = stepFunction(currentInput, states);\n lastOutput = stepOutputs[0];\n if (t === 0) {\n outputs = lastOutput.reshape([1].concat(lastOutput.shape));\n } else {\n outputs = K.concatAlongFirstAxis(\n outputs, lastOutput.reshape([1].concat(lastOutput.shape)));\n }\n // TODO(soergel): Call K.concatenate() to perform only one concatenation\n // at the end, once the backend function is available.\n states = stepOutputs[1];\n }\n\n return [\n lastOutput,\n tfc.transpose(\n outputs, [1, 0].concat(math_utils.range(2, outputs.shape.length))),\n states\n ];\n}\n\n\nexport interface BaseRNNLayerConfig extends LayerConfig {\n /**\n * A RNN cell instance. A RNN cell is a class that has:\n * - a `call()` method, which takes `[Tensor, Tensor]` as the\n * first input argument. The first item is the input at time t, and\n * second item is the cell state at time t.\n * The `call()` method returns `[outputAtT, statesAtTPlus1]`.\n * The `call()` method of the cell can also take the argument `constants`,\n * see section \"Note on passing external constants\" below.\n * Porting Node: PyKeras overrides the `call()` signature of RNN cells,\n * which are Layer subtypes, to accept two arguments. tfjs-layers does\n * not do such overriding. Instead we preseve the `call()` signature,\n * which due to its `Tensor|Tensor[]` argument and return value, is\n * flexible enough to handle the inputs and states.\n * - a `stateSize` attribute. This can be a single integer (single state)\n * in which case it is the size of the recurrent state (which should be\n * the same as the size of the cell output). This can also be an Array of\n * integers (one size per state). In this case, the first entry\n * (`stateSize[0]`) should be the same as the size of the cell output.\n * It is also possible for `cell` to be a list of RNN cell instances, in which\n * case the cells get stacked on after the other in the RNN, implementing an\n * efficient stacked RNN.\n */\n cell?: RNNCell|RNNCell[];\n\n /**\n * Whether to return the last output in the output sequence, or the full\n * sequence.\n */\n returnSequences?: boolean;\n\n /**\n * Whether to return the last state in addition to the output.\n */\n returnState?: boolean;\n\n /**\n * If `true`, process the input sequence backwards and return the reversed\n * sequence (default: `false`).\n */\n goBackwards?: boolean;\n\n /**\n * If `true`, the last state for each sample at index i in a batch will be\n * used as initial state of the sample of index i in the following batch\n * (default: `false`).\n */\n stateful?: boolean;\n\n /**\n * If `true`, the network will be unrolled, else a symbolic loop will be\n * used. Unrolling can speed-up a RNN, although it tends to be more memory-\n * intensive. Unrolling is only suitable for short sequences (default:\n * `false`).\n * Porting Note: tfjs-layers has an imperative backend. RNNs are executed with\n * normal TypeScript control flow. Hence this property is inapplicable and\n * ignored in tfjs-layers.\n */\n unroll?: boolean;\n\n /**\n * Dimensionality of the input (integer).\n * This option (or alternatively, the option `inputShape`) is required when\n * this layer is used as the first layer in a model.\n */\n inputDim?: number;\n\n /**\n * Length of the input sequences, to be specified when it is constant.\n * This argument is required if you are going to connect `Flatten` then\n * `Dense` layers upstream (without it, the shape of the dense outputs cannot\n * be computed). Note that if the recurrent layer is not the first layer in\n * your model, you would need to specify the input length at the level of the\n * first layer (e.g., via the `inputShape` option).\n */\n inputLength?: number;\n}\n\n/**\n * RNNLayerConfig is identical to BaseRNNLayerConfig, except it makes the\n * `cell` property required. This interface is to be used with constructors\n * of concrete RNN layer sbutypes.\n */\nexport interface RNNLayerConfig extends BaseRNNLayerConfig {\n cell: RNNCell|RNNCell[];\n}\n\n/**\n * Base class for recurrent layers.\n *\n * Input shape:\n * 3D tensor with shape `[batchSize, timeSteps, inputDim]`.\n *\n * Output shape:\n * - if `returnState`, an Array of tensors (i.e., `Tensor`s). The first\n * tensor is the output. The remaining tensors are the states at the\n * last time step, each with shape `[batchSize, units]`.\n * - if `returnSequences`, the output will have shape\n * `[batchSize, timeSteps, units]`.\n * - else, the output will have shape `[batchSize, units]`.\n *\n * Masking:\n * This layer supports masking for input data with a variable number\n * of timesteps. To introduce masks to your data,\n * use an embedding layer with the `mask_zero` parameter\n * set to `True`.\n *\n * Notes on using statefulness in RNNs:\n * You can set RNN layers to be 'stateful', which means that the states\n * computed for the samples in one batch will be reused as initial states\n * for the samples in the next batch. This assumes a one-to-one mapping\n * between samples in different successive batches.\n *\n * To enable statefulness:\n * - specify `stateful: true` in the layer constructor.\n * - specify a fixed batch size for your model, by passing\n * if sequential model:\n * `batchInputShape=[...]` to the first layer in your model.\n * else for functional model with 1 or more Input layers:\n * `batchShape=[...]` to all the first layers in your model.\n * This is the expected shape of your inputs *including the batch size*.\n * It should be a tuple of integers, e.g. `(32, 10, 100)`.\n * - specify `shuffle=False` when calling fit().\n *\n * To reset the states of your model, call `.reset_states()` on either\n * a specific layer, or on your entire model.\n *\n * Note on specifying the initial state of RNNs\n * You can specify the initial state of RNN layers symbolically by\n * calling them with the option `initialState`. The value of\n * `initialState` should be a tensor or list of tensors representing\n * the initial state of the RNN layer.\n *\n * You can specify the initial state of RNN layers numerically by\n * calling `resetStates` with the keyword argument `states`. The value of\n * `states` should be a numpy array or list of numpy arrays representing\n * the initial state of the RNN layer.\n *\n * Note on passing external constants to RNNs\n * You can pass \"external\" constants to the cell using the `constants`\n * keyword argument of `RNN.call` method. This requires that the `cell.call`\n * method accepts the same keyword argument `constants`. Such constants\n * can be used to conditon the cell transformation on additional static inputs\n * (not changing over time), a.k.a an attention mechanism.\n */\nexport class RNN extends Layer {\n static className = 'RNN';\n public readonly cell: RNNCell;\n public readonly returnSequences: boolean;\n public readonly returnState: boolean;\n public readonly goBackwards: boolean;\n public readonly unroll: boolean;\n\n public stateSpec: InputSpec[];\n public states: Tensor[];\n\n private numConstants: number;\n\n constructor(config: RNNLayerConfig) {\n super(config);\n let cell: RNNCell;\n if (config.cell == null) {\n throw new ValueError(\n 'cell property is missing for the constructor of RNN.');\n } else if (Array.isArray(config.cell)) {\n cell = new StackedRNNCells({cells: config.cell});\n } else {\n cell = config.cell;\n }\n if ((cell as RNNCell).stateSize == null) {\n throw new ValueError(\n 'The RNN cell should have an attribute `stateSize` (tuple of ' +\n 'integers, one integer per RNN state).');\n }\n this.cell = cell;\n this.returnSequences =\n config.returnSequences == null ? false : config.returnSequences;\n this.returnState = config.returnState == null ? false : config.returnState;\n this.goBackwards = config.goBackwards == null ? false : config.goBackwards;\n this._stateful = config.stateful == null ? false : config.stateful;\n this.unroll = config.unroll == null ? false : config.unroll;\n\n this.supportsMasking = true;\n this.inputSpec = [new InputSpec({ndim: 3})];\n this.stateSpec = null;\n this.states = null;\n // TODO(cais): Add constantsSpec and numConstants.\n this.numConstants = null;\n // TODO(cais): Look into the use of initial_state in the kwargs of the\n // constructor.\n }\n\n // Porting Note: This is the equivalent of `RNN.states` property getter in\n // PyKeras.\n getStates(): Tensor[] {\n if (this.states == null) {\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n return math_utils.range(0, numStates).map(x => null);\n } else {\n return this.states;\n }\n }\n\n // Porting Note: This is the equivalent of the `RNN.states` property setter in\n // PyKeras.\n setStates(states: Tensor[]): void {\n this.states = states;\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n // TODO(cais): Remove the casting once stacked RNN cells become supported.\n let stateSize = this.cell.stateSize;\n if (!Array.isArray(stateSize)) {\n stateSize = [stateSize];\n }\n const outputDim = stateSize[0];\n let outputShape: Shape|Shape[];\n if (this.returnSequences) {\n outputShape = [inputShape[0], inputShape[1], outputDim];\n } else {\n outputShape = [inputShape[0], outputDim];\n }\n\n if (this.returnState) {\n const stateShape: Shape[] = [];\n for (const dim of stateSize) {\n stateShape.push([inputShape[0], dim]);\n }\n return [outputShape].concat(stateShape);\n } else {\n return outputShape;\n }\n }\n\n computeMask(inputs: Tensor|Tensor[], mask?: Tensor|Tensor[]): Tensor {\n throw new NotImplementedError(\n 'computeMask has not been implemented for RNN yet');\n }\n\n public build(inputShape: Shape|Shape[]): void {\n // Note inputShape will be an Array of Shapes of initial states and\n // constants if these are passed in apply().\n const constantShape: Shape[] = null;\n if (this.numConstants != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n }\n\n if (isArrayOfShapes(inputShape)) {\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n\n const batchSize: number = this.stateful ? inputShape[0] : null;\n const inputDim = inputShape[inputShape.length - 1];\n this.inputSpec[0] = new InputSpec({shape: [batchSize, null, inputDim]});\n\n // Allow cell (if RNNCell Layer) to build before we set or validate\n // stateSpec.\n const stepInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (constantShape != null) {\n throw new NotImplementedError(\n 'Constants support is not implemented in RNN yet.');\n } else {\n this.cell.build(stepInputShape);\n }\n\n // Set or validate stateSpec.\n let stateSize: number[];\n if (Array.isArray((this.cell as RNNCell).stateSize)) {\n stateSize = this.cell.stateSize as number[];\n } else {\n stateSize = [this.cell.stateSize as number];\n }\n\n if (this.stateSpec != null) {\n if (!util.arraysEqual(\n this.stateSpec.map(spec => spec.shape[spec.shape.length - 1]),\n stateSize)) {\n throw new ValueError(\n `An initialState was passed that is not compatible with ` +\n `cell.stateSize. Received stateSpec=${this.stateSpec}; ` +\n `However cell.stateSize is ${this.cell.stateSize}`);\n }\n } else {\n this.stateSpec =\n stateSize.map(dim => new InputSpec({shape: [null, dim]}));\n }\n if (this.stateful) {\n throw new NotImplementedError(\n 'stateful RNN layer is not implemented yet');\n // TODO(cais): Uncomment the following line once stateful = true is\n // implemented.\n // this.resetStates();\n }\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n tidy(() => {\n if (!this.stateful) {\n throw new AttributeError(\n 'Cannot call resetState() on an RNN Layer that is not stateful.');\n }\n const batchSize = this.inputSpec[0].shape[0];\n if (batchSize == null) {\n throw new ValueError(\n 'If an RNN is stateful, it needs to know its batch size. Specify ' +\n 'the batch size of your input tensors: \\n' +\n '- If using a Sequential model, specify the batch size by ' +\n 'passing a `batchInputShape` option to your first layer.\\n' +\n '- If using the functional API, specify the batch size by ' +\n 'passing a `batchShape` option to your Input layer.');\n }\n // Initialize state if null.\n if (this.states == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states = [tfc.zeros([batchSize, this.cell.stateSize])];\n }\n } else if (states == null) {\n if (Array.isArray(this.cell.stateSize)) {\n this.states =\n this.cell.stateSize.map(dim => tfc.zeros([batchSize, dim]));\n } else {\n this.states[0] = tfc.zeros([batchSize, this.cell.stateSize]);\n }\n } else {\n if (!Array.isArray(states)) {\n states = [states];\n }\n if (states.length !== this.states.length) {\n throw new ValueError(\n `Layer ${this.name} expects ${this.states.length} state(s), ` +\n `but it received ${states.length} state value(s). Input ` +\n `received: ${states}`);\n }\n for (let index = 0; index < this.states.length; ++index) {\n const value = states[index];\n const dim = Array.isArray(this.cell.stateSize) ?\n this.cell.stateSize[index] :\n this.cell.stateSize;\n const expectedShape = [batchSize, dim];\n if (!util.arraysEqual(value.shape, expectedShape)) {\n throw new ValueError(\n `State ${index} is incompatible with layer ${this.name}: ` +\n `expected shape=${expectedShape}, received shape=${\n value.shape}`);\n }\n this.states[index] = value;\n }\n }\n });\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n // TODO(cais): Figure out whether initialState is in kwargs or inputs.\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n // If any of `initial_state` or `constants` are specified and are\n // `SymbolicTensor`s, then add them to the inputs and temporarily modify the\n // input_spec to include them.\n\n let additionalInputs: Array = [];\n let additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n kwargs['initialState'] = initialState;\n additionalInputs = additionalInputs.concat(initialState);\n this.stateSpec = [];\n for (const state of initialState) {\n this.stateSpec.push(new InputSpec({shape: state.shape}));\n }\n // TODO(cais): Use the following instead.\n // this.stateSpec = initialState.map(state => new InputSpec({shape:\n // state.shape}));\n additionalSpecs = additionalSpecs.concat(this.stateSpec);\n }\n if (constants != null) {\n kwargs['constants'] = constants;\n additionalInputs = additionalInputs.concat(constants);\n // TODO(cais): Add this.constantsSpec.\n this.numConstants = constants.length;\n }\n\n const isTensor = additionalInputs[0] instanceof SymbolicTensor;\n if (isTensor) {\n // Compute full input spec, including state and constants.\n const fullInput =\n [inputs].concat(additionalInputs) as Tensor[] | SymbolicTensor[];\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call with temporarily replaced inputSpec.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output = super.apply(fullInput, kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n // tslint:disable-next-line:no-any\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n // Input shape: `[samples, time (padded with zeros), input_dim]`.\n // Note that the .build() method of subclasses **must** define\n // this.inputSpec and this.stateSpec owith complete input shapes.\n return tidy(() => {\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n let initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n\n inputs = getExactlyOneTensor(inputs);\n if (initialState == null) {\n if (this.stateful) {\n throw new NotImplementedError(\n 'stateful RNN layer is not implemented yet.');\n } else {\n initialState = this.getInitialState(inputs);\n }\n }\n\n if (mask != null) {\n throw new NotImplementedError('Masking is not implemented for RNN yet');\n }\n\n const numStates =\n Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1;\n if (initialState.length !== numStates) {\n throw new ValueError(\n `RNN Layer has ${numStates} state(s) but was passed ` +\n `${initialState.length} initial state(s).`);\n }\n const inputShape = inputs.shape;\n const timesteps = inputShape[1];\n if (this.unroll) {\n console.warn(\n 'Ignoring unroll = true for RNN layer, due to imperative backend.');\n }\n\n const cellCallKwargs: Kwargs = {training};\n\n // TODO(cais): Add support for constants.\n const step = (inputs: Tensor, states: Tensor[]) => {\n // `inputs` and `states` are concatenated to form a single `Array` of\n // `Tensor`s as the input to `cell.call()`.\n const outputs =\n this.cell.call([inputs].concat(states), cellCallKwargs) as Tensor[];\n // Marshall the return value into output and new states.\n return [outputs[0], outputs.slice(1)] as [Tensor, Tensor[]];\n };\n\n // TODO(cais): Add support for constants.\n // TODO(cais): Add support for masks.\n\n const rnnOutputs =\n rnn(step, inputs, initialState, this.goBackwards, null, null,\n this.unroll, timesteps);\n const lastOutput = rnnOutputs[0];\n const outputs = rnnOutputs[1];\n const states = rnnOutputs[2];\n\n if (this.stateful) {\n throw new NotImplementedError(\n 'stateful RNN layer is not implemented yet');\n }\n\n const output = this.returnSequences ? outputs : lastOutput;\n\n // TODO(cais): Porperty set learning phase flag.\n\n if (this.returnState) {\n return [output].concat(states);\n } else {\n return output;\n }\n });\n }\n\n getInitialState(inputs: Tensor): Tensor[] {\n return tidy(() => {\n // Build an all-zero tensor of shape [samples, outputDim].\n // [Samples, timeSteps, inputDim].\n let initialState = tfc.zeros(inputs.shape);\n // [Samples].\n initialState = tfc.sum(initialState, [1, 2]);\n initialState = K.expandDims(initialState); // [Samples, 1].\n\n if (Array.isArray(this.cell.stateSize)) {\n return this.cell.stateSize.map(\n dim => dim > 1 ? K.tile(initialState, [1, dim]) : initialState);\n } else {\n return this.cell.stateSize > 1 ?\n [K.tile(initialState, [1, this.cell.stateSize])] :\n [initialState];\n }\n });\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n return this.cell.trainableWeights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n // Porting Note: In TypeScript, `this` is always an instance of `Layer`.\n if (!this.trainable) {\n return this.cell.weights;\n }\n return this.cell.nonTrainableWeights;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n returnSequences: this.returnSequences,\n returnState: this.returnState,\n goBackwards: this.goBackwards,\n stateful: this.stateful,\n unroll: this.unroll,\n };\n if (this.numConstants != null) {\n config.numConstants = this.numConstants;\n }\n const cellConfig = this.cell.getConfig();\n config.cell = {\n className: this.cell.getClassName(),\n config: cellConfig,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(RNN);\n\n/**\n * An RNNCell layer.\n */\n// Porting Note: This is a common parent class for RNN cells. There is no\n// equivalent of this in PyKeras. Having a common parent class forgoes the\n// need for `has_attr(cell, ...)` checks or its TypeScript equivalent.\n/** @doc {heading: 'Layers', subheading: 'Classes'} */\nexport abstract class RNNCell extends Layer {\n /**\n * Size(s) of the states.\n * For RNN cells with only a single state, this is a single integer.\n */\n public stateSize: number|number[];\n public dropoutMask: Tensor|Tensor[];\n public recurrentDropoutMask: Tensor|Tensor[];\n}\n\nexport interface SimpleRNNCellLayerConfig extends LayerConfig {\n /**\n * units: Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n * Default: hyperbolic tangent ('tanh').\n * If you pass `null`, 'linear' activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the `kernel` weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the `recurrent_kernel` weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the `kernel` weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the `recurrentKernel` weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraintfunction applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Float number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * Cell class for `SimpleRNN`.\n *\n * `SimpleRNNCell` is distinct from the `RNN` subclass `SimpleRNN` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `SimpleRNN` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.simpleRNNCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `SimpleRNNCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.simpleRNNCell({units: 4}),\n * tf.layers.simpleRNNCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `SimpleRNNCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `SimpleRNNCell`, use the\n * `tf.layers.simpleRNN`.\n */\nexport class SimpleRNNCell extends RNNCell {\n static className = 'SimpleRNNCell';\n readonly units: number;\n readonly activation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n constructor(config: SimpleRNNCellLayerConfig) {\n super(config);\n this.units = config.units;\n this.activation = getActivation(\n config.activation == null ? this.DEFAULT_ACTIVATION :\n config.activation);\n this.useBias = config.useBias == null ? true : config.useBias;\n\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n config.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.recurrentConstraint = getConstraint(config.recurrentConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, config.recurrentDropout == null ? 0 : config.recurrentDropout])\n ]);\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n // TODO(cais): Use regularizer.\n this.kernel = this.addWeight(\n 'kernel', [inputShape[inputShape.length - 1], this.units], null,\n this.kernelInitializer, this.kernelRegularizer, true,\n this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n this.built = true;\n }\n\n // Porting Note: PyKeras' equivalent of this method takes two tensor inputs:\n // `inputs` and `states`. Here, the two tensors are combined into an\n // `Tensor[]` Array as the first input argument.\n // Similarly, PyKeras' equivalent of this method returns two values:\n // `output` and `[output]`. Here the two are combined into one length-2\n // `Tensor[]`, consisting of `output` repeated.\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `SimpleRNNCell expects 2 input Tensors, got ${inputs.length}.`);\n }\n let prevOutput = inputs[1];\n inputs = inputs[0];\n const training = kwargs['training'] == null ? false : kwargs['training'];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask(\n () => tfc.onesLike(inputs as Tensor),\n this.dropout, training) as Tensor;\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask =\n generateDropoutMask(\n () => tfc.onesLike(prevOutput), this.recurrentDropout,\n training) as Tensor;\n }\n let h: Tensor;\n const dpMask: Tensor = this.dropoutMask as Tensor;\n const recDpMask: Tensor = this.recurrentDropoutMask as Tensor;\n if (dpMask != null) {\n h = K.dot(tfc.mul(inputs, dpMask), this.kernel.read());\n } else {\n h = K.dot(inputs, this.kernel.read());\n }\n if (this.bias != null) {\n h = K.biasAdd(h, this.bias.read());\n }\n if (recDpMask != null) {\n prevOutput = tfc.mul(prevOutput, recDpMask);\n }\n let output = tfc.add(h, K.dot(prevOutput, this.recurrentKernel.read()));\n if (this.activation != null) {\n output = this.activation.apply(output);\n }\n\n // TODO(cais): Properly set learning phase on output tensor?\n return [output, output];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(SimpleRNNCell);\n\nexport interface SimpleRNNLayerConfig extends BaseRNNLayerConfig {\n /**\n * Positive integer, dimensionality of the output space.\n */\n units: number;\n\n /**\n * Activation function to use.\n *\n * Defaults to hyperbolic tangent (`tanh`)\n *\n * If you pass `null`, no activation will be applied.\n */\n activation?: ActivationIdentifier;\n\n /**\n * Whether the layer uses a bias vector.\n */\n useBias?: boolean;\n\n /**\n * Initializer for the `kernel` weights matrix, used for the linear\n * transformation of the inputs.\n */\n kernelInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the `recurrentKernel` weights matrix, used for\n * linear transformation of the recurrent state.\n */\n recurrentInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Initializer for the bias vector.\n */\n biasInitializer?: InitializerIdentifier|Initializer;\n\n /**\n * Regularizer function applied to the kernel weights matrix.\n */\n kernelRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the recurrentKernel weights matrix.\n */\n recurrentRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Regularizer function applied to the bias vector.\n */\n biasRegularizer?: RegularizerIdentifier|Regularizer;\n\n /**\n * Constraint function applied to the kernel weights matrix.\n */\n kernelConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the recurrentKernel weights matrix.\n */\n recurrentConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Constraint function applied to the bias vector.\n */\n biasConstraint?: ConstraintIdentifier|Constraint;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the inputs.\n */\n dropout?: number;\n\n /**\n * Number between 0 and 1. Fraction of the units to drop for the linear\n * transformation of the recurrent state.\n */\n recurrentDropout?: number;\n}\n\n/**\n * Fully-connected RNN where the output is to be fed back to input.\n *\n * This is an `RNN` layer consisting of one `SimpleRNNCell`. However, unlike\n * the underlying `SimpleRNNCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.simpleRNN({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `SimpleRNNCell`'s number of units.\n * ```\n */\nexport class SimpleRNN extends RNN {\n static className = 'SimpleRNN';\n constructor(config: SimpleRNNLayerConfig) {\n config.cell = new SimpleRNNCell(config);\n super(config as RNNLayerConfig);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n // TODO(cais): Research possibility of refactoring out the tedious all\n // the getters that delegate to `this.cell` below.\n get units(): number {\n return (this.cell as SimpleRNNCell).units;\n }\n\n get activation(): Activation {\n return (this.cell as SimpleRNNCell).activation;\n }\n\n get useBias(): boolean {\n return (this.cell as SimpleRNNCell).useBias;\n }\n\n get kernelInitializer(): Initializer {\n return (this.cell as SimpleRNNCell).kernelInitializer;\n }\n\n get recurrentInitializer(): Initializer {\n return (this.cell as SimpleRNNCell).recurrentInitializer;\n }\n\n get biasInitializer(): Initializer {\n return (this.cell as SimpleRNNCell).biasInitializer;\n }\n\n get kernelRegularizer(): Regularizer {\n return (this.cell as SimpleRNNCell).kernelRegularizer;\n }\n\n get recurrentRegularizer(): Regularizer {\n return (this.cell as SimpleRNNCell).recurrentRegularizer;\n }\n\n get biasRegularizer(): Regularizer {\n return (this.cell as SimpleRNNCell).biasRegularizer;\n }\n\n get kernelConstraint(): Constraint {\n return (this.cell as SimpleRNNCell).kernelConstraint;\n }\n\n get recurrentConstraint(): Constraint {\n return (this.cell as SimpleRNNCell).recurrentConstraint;\n }\n\n get biasConstraint(): Constraint {\n return (this.cell as SimpleRNNCell).biasConstraint;\n }\n\n get dropout(): number {\n return (this.cell as SimpleRNNCell).dropout;\n }\n\n get recurrentDropout(): number {\n return (this.cell as SimpleRNNCell).recurrentDropout;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n };\n const baseConfig = super.getConfig();\n delete baseConfig['cell'];\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(SimpleRNN);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport interface GRUCellLayerConfig extends SimpleRNNCellLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: string;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: number;\n}\n\n/**\n * Cell class for `GRU`.\n *\n * `GRUCell` is distinct from the `RNN` subclass `GRU` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `GRU` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.gruCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `GRUCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.gruCell({units: 4}),\n * tf.layers.gruCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `gruCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `GRUCell`, use the\n * `tf.layers.gru`.\n */\nexport class GRUCell extends RNNCell {\n static className = 'GRUCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number;\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n readonly DEFAULT_BIAS_INITIALIZER: InitializerIdentifier = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(config: GRUCellLayerConfig) {\n super(config);\n\n this.units = config.units;\n this.activation = getActivation(\n config.activation === undefined ? this.DEFAULT_ACTIVATION :\n config.activation);\n this.recurrentActivation = getActivation(\n config.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n config.recurrentActivation);\n this.useBias = config.useBias == null ? true : config.useBias;\n\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n config.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.recurrentConstraint = getConstraint(config.recurrentConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, config.recurrentDropout == null ? 0 : config.recurrentDropout])\n ]);\n this.implementation = config.implementation;\n this.stateSize = this.units;\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 3], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 3], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n if (this.useBias) {\n this.bias = this.addWeight(\n 'bias', [this.units * 3], null, this.biasInitializer,\n this.biasRegularizer, true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n if (inputs.length !== 2) {\n throw new ValueError(\n `GRUCell expects 2 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n\n const training = kwargs['training'] == null ? false : kwargs['training'];\n let hTMinus1 = inputs[1]; // Previous memory state.\n inputs = inputs[0];\n\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask(\n () => tfc.onesLike(inputs as Tensor),\n this.dropout, training, 3) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask =\n generateDropoutMask(\n () => tfc.onesLike(hTMinus1), this.recurrentDropout, training,\n 3) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor];\n const recDpMask = this.recurrentDropoutMask as [Tensor, Tensor, Tensor];\n let z: Tensor;\n let r: Tensor;\n let hh: Tensor;\n if (this.implementation === 1) {\n const kernelZ = K.sliceAlongLastAxis(this.kernel.read(), 0, this.units);\n const kernelR =\n K.sliceAlongLastAxis(this.kernel.read(), this.units, this.units);\n const kernelH = K.sliceAlongLastAxis(\n this.kernel.read(), this.units * 2, this.units);\n const recurrentKernelZ =\n K.sliceAlongLastAxis(this.recurrentKernel.read(), 0, this.units);\n const recurrentKernelR = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units, this.units);\n const recurrentKernelH = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units * 2, this.units);\n\n let inputsZ: Tensor, inputsR: Tensor, inputsH: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputsZ = tfc.mul(inputs, dpMask[0]);\n inputsR = tfc.mul(inputs, dpMask[1]);\n inputsH = tfc.mul(inputs, dpMask[2]);\n } else {\n inputsZ = inputs;\n inputsR = inputs;\n inputsH = inputs;\n }\n\n let xZ = K.dot(inputsZ, kernelZ);\n let xR = K.dot(inputsR, kernelR);\n let xH = K.dot(inputsH, kernelH);\n if (this.useBias) {\n const biasZ = K.sliceAlongFirstAxis(this.bias.read(), 0, this.units);\n const biasR =\n K.sliceAlongFirstAxis(this.bias.read(), this.units, this.units);\n const biasH = K.sliceAlongFirstAxis(\n this.bias.read(), this.units * 2, this.units);\n xZ = K.biasAdd(xZ, biasZ);\n xR = K.biasAdd(xR, biasR);\n xH = K.biasAdd(xH, biasH);\n }\n\n let hTMinus1Z: Tensor;\n let hTMinus1R: Tensor;\n let hTMinus1H: Tensor;\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1Z = tfc.mul(hTMinus1, recDpMask[0]);\n hTMinus1R = tfc.mul(hTMinus1, recDpMask[1]);\n hTMinus1H = tfc.mul(hTMinus1, recDpMask[2]);\n } else {\n hTMinus1Z = hTMinus1;\n hTMinus1R = hTMinus1;\n hTMinus1H = hTMinus1;\n }\n z = this.recurrentActivation.apply(\n tfc.add(xZ, K.dot(hTMinus1Z, recurrentKernelZ)));\n r = this.recurrentActivation.apply(\n tfc.add(xR, K.dot(hTMinus1R, recurrentKernelR)));\n hh = this.activation.apply(\n tfc.add(xH, K.dot(tfc.mul(r, hTMinus1H), recurrentKernelH)));\n } else {\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let matrixX = K.dot(inputs, this.kernel.read());\n if (this.useBias) {\n matrixX = K.biasAdd(matrixX, this.bias.read());\n }\n if (0 < this.dropout && this.dropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n const matrixInner = K.dot(\n hTMinus1,\n K.sliceAlongLastAxis(\n this.recurrentKernel.read(), 0, 2 * this.units));\n\n const xZ = K.sliceAlongLastAxis(matrixX, 0, this.units);\n const xR = K.sliceAlongLastAxis(matrixX, this.units, this.units);\n const recurrentZ = K.sliceAlongLastAxis(matrixInner, 0, this.units);\n const recurrentR =\n K.sliceAlongLastAxis(matrixInner, this.units, this.units);\n\n z = this.recurrentActivation.apply(tfc.add(xZ, recurrentZ));\n r = this.recurrentActivation.apply(tfc.add(xR, recurrentR));\n\n const xH = K.sliceAlongLastAxis(matrixX, 2 * this.units, this.units);\n const recurrentH = K.dot(\n tfc.mul(r, hTMinus1),\n K.sliceAlongLastAxis(\n this.recurrentKernel.read(), 2 * this.units, this.units));\n hh = this.activation.apply(tfc.add(xH, recurrentH));\n }\n\n const h = tfc.add(\n tfc.mul(z, hTMinus1), tfc.mul(tfc.add(getScalar(1), tfc.neg(z)), hh));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(GRUCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport interface GRULayerConfig extends SimpleRNNLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: string;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: number;\n}\n\n/**\n * Gated Recurrent Unit - Cho et al. 2014.\n *\n * This is an `RNN` layer consisting of one `GRUCell`. However, unlike\n * the underlying `GRUCell`, the `apply` method of `SimpleRNN` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const rnn = tf.layers.gru({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `GRUCell`'s number of units.\n */\nexport class GRU extends RNN {\n static className = 'GRU';\n constructor(config: GRULayerConfig) {\n if (config.implementation === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n config.cell = new GRUCell(config);\n super(config as RNNLayerConfig);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n get units(): number {\n return (this.cell as GRUCell).units;\n }\n\n get activation(): Activation {\n return (this.cell as GRUCell).activation;\n }\n\n get recurrentActivation(): Activation {\n return (this.cell as GRUCell).recurrentActivation;\n }\n\n get useBias(): boolean {\n return (this.cell as GRUCell).useBias;\n }\n\n get kernelInitializer(): Initializer {\n return (this.cell as GRUCell).kernelInitializer;\n }\n\n get recurrentInitializer(): Initializer {\n return (this.cell as GRUCell).recurrentInitializer;\n }\n\n get biasInitializer(): Initializer {\n return (this.cell as GRUCell).biasInitializer;\n }\n\n get kernelRegularizer(): Regularizer {\n return (this.cell as GRUCell).kernelRegularizer;\n }\n\n get recurrentRegularizer(): Regularizer {\n return (this.cell as GRUCell).recurrentRegularizer;\n }\n\n get biasRegularizer(): Regularizer {\n return (this.cell as GRUCell).biasRegularizer;\n }\n\n get kernelConstraint(): Constraint {\n return (this.cell as GRUCell).kernelConstraint;\n }\n\n get recurrentConstraint(): Constraint {\n return (this.cell as GRUCell).recurrentConstraint;\n }\n\n get biasConstraint(): Constraint {\n return (this.cell as GRUCell).biasConstraint;\n }\n\n get dropout(): number {\n return (this.cell as GRUCell).dropout;\n }\n\n get recurrentDropout(): number {\n return (this.cell as GRUCell).recurrentDropout;\n }\n\n get implementation(): number {\n return (this.cell as GRUCell).implementation;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n delete baseConfig['cell'];\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.SerializationMap.register(GRU);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we extend\n// that interface instead of repeating the fields.\nexport interface LSTMCellLayerConfig extends SimpleRNNCellLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: ActivationIdentifier;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n *\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions.\n *\n * Mode 2 will batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: 1|2;\n}\n\n/**\n * Cell class for `LSTM`.\n *\n * `LSTMCell` is distinct from the `RNN` subclass `LSTM` in that its\n * `apply` method takes the input data of only a single time step and returns\n * the cell's output at the time step, while `LSTM` takes the input data\n * over a number of time steps. For example:\n *\n * ```js\n * const cell = tf.layers.lstmCell({units: 2});\n * const input = tf.input({shape: [10]});\n * const output = cell.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10]: This is the cell's output at a single time step. The 1st\n * // dimension is the unknown batch size.\n * ```\n *\n * Instance(s) of `LSTMCell` can be used to construct `RNN` layers. The\n * most typical use of this workflow is to combine a number of cells into a\n * stacked RNN cell (i.e., `StackedRNNCell` internally) and use it to create an\n * RNN. For example:\n *\n * ```js\n * const cells = [\n * tf.layers.lstmCell({units: 4}),\n * tf.layers.lstmCell({units: 8}),\n * ];\n * const rnn = tf.layers.rnn({cell: cells, returnSequences: true});\n *\n * // Create an input with 10 time steps and a length-20 vector at each step.\n * const input = tf.input({shape: [10, 20]});\n * const output = rnn.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the last `lstmCell`'s number of units.\n * ```\n *\n * To create an `RNN` consisting of only *one* `LSTMCell`, use the\n * `tf.layers.lstm`.\n */\nexport class LSTMCell extends RNNCell {\n static className = 'LSTMCell';\n readonly units: number;\n readonly activation: Activation;\n readonly recurrentActivation: Activation;\n readonly useBias: boolean;\n\n readonly kernelInitializer: Initializer;\n readonly recurrentInitializer: Initializer;\n readonly biasInitializer: Initializer;\n readonly unitForgetBias: boolean;\n\n readonly kernelConstraint: Constraint;\n readonly recurrentConstraint: Constraint;\n readonly biasConstraint: Constraint;\n\n readonly kernelRegularizer: Regularizer;\n readonly recurrentRegularizer: Regularizer;\n readonly biasRegularizer: Regularizer;\n\n readonly dropout: number;\n readonly recurrentDropout: number;\n\n readonly stateSize: number[];\n readonly implementation: number;\n\n readonly DEFAULT_ACTIVATION = 'tanh';\n readonly DEFAULT_RECURRENT_ACTIVATION = 'hardSigmoid';\n readonly DEFAULT_KERNEL_INITIALIZER = 'glorotNormal';\n readonly DEFAULT_RECURRENT_INITIALIZER = 'orthogonal';\n\n readonly DEFAULT_BIAS_INITIALIZER = 'zeros';\n\n kernel: LayerVariable;\n recurrentKernel: LayerVariable;\n bias: LayerVariable;\n\n constructor(config: LSTMCellLayerConfig) {\n super(config);\n\n this.units = config.units;\n this.activation = getActivation(\n config.activation === undefined ? this.DEFAULT_ACTIVATION :\n config.activation);\n this.recurrentActivation = getActivation(\n config.recurrentActivation === undefined ?\n this.DEFAULT_RECURRENT_ACTIVATION :\n config.recurrentActivation);\n this.useBias = config.useBias == null ? true : config.useBias;\n\n this.kernelInitializer = getInitializer(\n config.kernelInitializer || this.DEFAULT_KERNEL_INITIALIZER);\n this.recurrentInitializer = getInitializer(\n config.recurrentInitializer || this.DEFAULT_RECURRENT_INITIALIZER);\n\n this.biasInitializer =\n getInitializer(config.biasInitializer || this.DEFAULT_BIAS_INITIALIZER);\n this.unitForgetBias = config.unitForgetBias;\n\n this.kernelRegularizer = getRegularizer(config.kernelRegularizer);\n this.recurrentRegularizer = getRegularizer(config.recurrentRegularizer);\n this.biasRegularizer = getRegularizer(config.biasRegularizer);\n\n this.kernelConstraint = getConstraint(config.kernelConstraint);\n this.recurrentConstraint = getConstraint(config.recurrentConstraint);\n this.biasConstraint = getConstraint(config.biasConstraint);\n\n this.dropout = math_utils.min(\n [1, math_utils.max([0, config.dropout == null ? 0 : config.dropout])]);\n this.recurrentDropout = math_utils.min([\n 1,\n math_utils.max(\n [0, config.recurrentDropout == null ? 0 : config.recurrentDropout])\n ]);\n this.implementation = config.implementation;\n this.stateSize = [this.units, this.units];\n this.dropoutMask = null;\n this.recurrentDropoutMask = null;\n }\n\n public build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n const inputDim = inputShape[inputShape.length - 1];\n this.kernel = this.addWeight(\n 'kernel', [inputDim, this.units * 4], null, this.kernelInitializer,\n this.kernelRegularizer, true, this.kernelConstraint);\n this.recurrentKernel = this.addWeight(\n 'recurrent_kernel', [this.units, this.units * 4], null,\n this.recurrentInitializer, this.recurrentRegularizer, true,\n this.recurrentConstraint);\n let biasInitializer: Initializer;\n if (this.useBias) {\n if (this.unitForgetBias) {\n const capturedBiasInit = this.biasInitializer;\n const capturedUnits = this.units;\n biasInitializer = new (class CustomInit extends Initializer {\n static className = 'CustomInit';\n\n apply(shape: Shape, dtype?: DataType): Tensor {\n // TODO(cais): More informative variable names?\n const bI = capturedBiasInit.apply([capturedUnits]);\n const bF = (new Ones()).apply([capturedUnits]);\n const bCAndH = capturedBiasInit.apply([capturedUnits * 2]);\n return K.concatAlongFirstAxis(\n K.concatAlongFirstAxis(bI, bF), bCAndH);\n }\n })();\n } else {\n biasInitializer = this.biasInitializer;\n }\n this.bias = this.addWeight(\n 'bias', [this.units * 4], null, biasInitializer, this.biasRegularizer,\n true, this.biasConstraint);\n } else {\n this.bias = null;\n }\n // Porting Notes: Unlike the PyKeras implementation, we perform slicing\n // of the weights and bias in the call() method, at execution time.\n this.built = true;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n const training = kwargs['training'] == null ? false : kwargs['training'];\n inputs = inputs as Tensor[];\n if (inputs.length !== 3) {\n throw new ValueError(\n `LSTMCell expects 3 input Tensors (inputs, h, c), got ` +\n `${inputs.length}.`);\n }\n let hTMinus1 = inputs[1]; // Previous memory state.\n const cTMinus1 = inputs[2]; // Previous carry state.\n inputs = inputs[0];\n if (0 < this.dropout && this.dropout < 1 && this.dropoutMask == null) {\n this.dropoutMask = generateDropoutMask(\n () => tfc.onesLike(inputs as Tensor),\n this.dropout, training, 4) as Tensor[];\n }\n if (0 < this.recurrentDropout && this.recurrentDropout < 1 &&\n this.recurrentDropoutMask == null) {\n this.recurrentDropoutMask =\n generateDropoutMask(\n () => tfc.onesLike(hTMinus1), this.recurrentDropout, training,\n 4) as Tensor[];\n }\n const dpMask = this.dropoutMask as [Tensor, Tensor, Tensor, Tensor];\n const recDpMask =\n this.recurrentDropoutMask as [Tensor, Tensor, Tensor, Tensor];\n\n let i: Tensor;\n let f: Tensor;\n let c: Tensor;\n let o: Tensor;\n if (this.implementation === 1) {\n const kernelI = K.sliceAlongLastAxis(this.kernel.read(), 0, this.units);\n const kernelF =\n K.sliceAlongLastAxis(this.kernel.read(), this.units, this.units);\n const kernelC = K.sliceAlongLastAxis(\n this.kernel.read(), this.units * 2, this.units);\n const kernelO = K.sliceAlongLastAxis(\n this.kernel.read(), this.units * 3, this.units);\n const recurrentKernelI =\n K.sliceAlongLastAxis(this.recurrentKernel.read(), 0, this.units);\n const recurrentKernelF = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units, this.units);\n const recurrentKernelC = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units * 2, this.units);\n const recurrentKernelO = K.sliceAlongLastAxis(\n this.recurrentKernel.read(), this.units * 3, this.units);\n\n let inputsI: Tensor, inputsF: Tensor, inputsC: Tensor, inputsO: Tensor;\n if (0 < this.dropout && this.dropout < 1) {\n inputsI = tfc.mul(inputs, dpMask[0]);\n inputsF = tfc.mul(inputs, dpMask[1]);\n inputsC = tfc.mul(inputs, dpMask[2]);\n inputsO = tfc.mul(inputs, dpMask[3]);\n } else {\n inputsI = inputs;\n inputsF = inputs;\n inputsC = inputs;\n inputsO = inputs;\n }\n\n let xI = K.dot(inputsI, kernelI);\n let xF = K.dot(inputsF, kernelF);\n let xC = K.dot(inputsC, kernelC);\n let xO = K.dot(inputsO, kernelO);\n if (this.useBias) {\n const biasI = K.sliceAlongFirstAxis(this.bias.read(), 0, this.units);\n const biasF =\n K.sliceAlongFirstAxis(this.bias.read(), this.units, this.units);\n const biasC = K.sliceAlongFirstAxis(\n this.bias.read(), this.units * 2, this.units);\n const biasO = K.sliceAlongFirstAxis(\n this.bias.read(), this.units * 3, this.units);\n xI = K.biasAdd(xI, biasI);\n xF = K.biasAdd(xF, biasF);\n xC = K.biasAdd(xC, biasC);\n xO = K.biasAdd(xO, biasO);\n }\n\n let hTMinus1I: Tensor, hTMinus1F: Tensor, hTMinus1C: Tensor,\n hTMinus1O: Tensor;\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1I = tfc.mul(hTMinus1, recDpMask[0]);\n hTMinus1F = tfc.mul(hTMinus1, recDpMask[1]);\n hTMinus1C = tfc.mul(hTMinus1, recDpMask[2]);\n hTMinus1O = tfc.mul(hTMinus1, recDpMask[3]);\n } else {\n hTMinus1I = hTMinus1;\n hTMinus1F = hTMinus1;\n hTMinus1C = hTMinus1;\n hTMinus1O = hTMinus1;\n }\n i = this.recurrentActivation.apply(\n tfc.add(xI, K.dot(hTMinus1I, recurrentKernelI)));\n f = this.recurrentActivation.apply(\n tfc.add(xF, K.dot(hTMinus1F, recurrentKernelF)));\n c = tfc.add(\n tfc.mul(f, cTMinus1),\n tfc.mul(\n i,\n this.activation.apply(\n tfc.add(xC, K.dot(hTMinus1C, recurrentKernelC)))));\n o = this.recurrentActivation.apply(\n tfc.add(xO, K.dot(hTMinus1O, recurrentKernelO)));\n } else {\n if (0 < this.dropout && this.dropout < 1) {\n inputs = tfc.mul(inputs, dpMask[0]);\n }\n let z = K.dot(inputs, this.kernel.read());\n if (0 < this.recurrentDropout && this.recurrentDropout < 1) {\n hTMinus1 = tfc.mul(hTMinus1, recDpMask[0]);\n }\n z = tfc.add(z, K.dot(hTMinus1, this.recurrentKernel.read()));\n if (this.useBias) {\n z = K.biasAdd(z, this.bias.read());\n }\n\n const z0 = K.sliceAlongLastAxis(z, 0, this.units);\n const z1 = K.sliceAlongLastAxis(z, this.units, this.units);\n const z2 = K.sliceAlongLastAxis(z, this.units * 2, this.units);\n const z3 = K.sliceAlongLastAxis(z, this.units * 3, this.units);\n\n i = this.recurrentActivation.apply(z0);\n f = this.recurrentActivation.apply(z1);\n c = tfc.add(\n tfc.mul(f, cTMinus1), tfc.mul(i, this.activation.apply(z2)));\n o = this.recurrentActivation.apply(z3);\n }\n\n const h = tfc.mul(o, this.activation.apply(c));\n // TODO(cais): Add use_learning_phase flag properly.\n return [h, h, c];\n });\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n}\nserialization.SerializationMap.register(LSTMCell);\n\n// Porting Note: Since this is a superset of SimpleRNNLayerConfig, we inherit\n// from that interface instead of repeating the fields here.\nexport interface LSTMLayerConfig extends SimpleRNNLayerConfig {\n /**\n * Activation function to use for the recurrent step.\n *\n * Defaults to hard sigmoid (`hardSigomid`).\n *\n * If `null`, no activation is applied.\n */\n recurrentActivation?: string;\n\n /**\n * If `true`, add 1 to the bias of the forget gate at initialization.\n * Setting it to `true` will also force `biasInitializer = 'zeros'`.\n * This is recommended in\n * [Jozefowicz et\n * al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf).\n */\n unitForgetBias?: boolean;\n\n /**\n * Implementation mode, either 1 or 2.\n * Mode 1 will structure its operations as a larger number of\n * smaller dot products and additions, whereas mode 2 will\n * batch them into fewer, larger operations. These modes will\n * have different performance profiles on different hardware and\n * for different applications.\n */\n implementation?: 1|2;\n}\n\n/**\n * Long-Short Term Memory layer - Hochreiter 1997.\n *\n * This is an `RNN` layer consisting of one `LSTMCell`. However, unlike\n * the underlying `LSTMCell`, the `apply` method of `LSTM` operates\n * on a sequence of inputs. The shape of the input (not including the first,\n * batch dimension) needs to be at least 2-D, with the first dimension being\n * time steps. For example:\n *\n * ```js\n * const lstm = tf.layers.lstm({units: 8, returnSequences: true});\n *\n * // Create an input with 10 time steps.\n * const input = tf.input({shape: [10, 20]});\n * const output = lstm.apply(input);\n *\n * console.log(JSON.stringify(output.shape));\n * // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the\n * // same as the sequence length of `input`, due to `returnSequences`: `true`;\n * // 3rd dimension is the `LSTMCell`'s number of units.\n */\nexport class LSTM extends RNN {\n static className = 'LSTM';\n constructor(config: LSTMLayerConfig) {\n if (config.implementation as number === 0) {\n console.warn(\n '`implementation=0` has been deprecated, and now defaults to ' +\n '`implementation=1`. Please update your layer call.');\n }\n config.cell = new LSTMCell(config);\n super(config as RNNLayerConfig);\n // TODO(cais): Add activityRegularizer.\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (this.cell.dropoutMask != null) {\n tfc.dispose(this.cell.dropoutMask);\n this.cell.dropoutMask = null;\n }\n if (this.cell.recurrentDropoutMask != null) {\n tfc.dispose(this.cell.recurrentDropoutMask);\n this.cell.recurrentDropoutMask = null;\n }\n const mask = kwargs == null ? null : kwargs['mask'];\n const training = kwargs == null ? null : kwargs['training'];\n const initialState: Tensor[] =\n kwargs == null ? null : kwargs['initialState'];\n return super.call(inputs, {mask, training, initialState});\n });\n }\n\n get units(): number {\n return (this.cell as LSTMCell).units;\n }\n\n get activation(): Activation {\n return (this.cell as LSTMCell).activation;\n }\n\n get recurrentActivation(): Activation {\n return (this.cell as LSTMCell).recurrentActivation;\n }\n\n get useBias(): boolean {\n return (this.cell as LSTMCell).useBias;\n }\n\n get kernelInitializer(): Initializer {\n return (this.cell as LSTMCell).kernelInitializer;\n }\n\n get recurrentInitializer(): Initializer {\n return (this.cell as LSTMCell).recurrentInitializer;\n }\n\n get biasInitializer(): Initializer {\n return (this.cell as LSTMCell).biasInitializer;\n }\n\n get unitForgetBias(): boolean {\n return (this.cell as LSTMCell).unitForgetBias;\n }\n\n get kernelRegularizer(): Regularizer {\n return (this.cell as LSTMCell).kernelRegularizer;\n }\n\n get recurrentRegularizer(): Regularizer {\n return (this.cell as LSTMCell).recurrentRegularizer;\n }\n\n get biasRegularizer(): Regularizer {\n return (this.cell as LSTMCell).biasRegularizer;\n }\n\n get kernelConstraint(): Constraint {\n return (this.cell as LSTMCell).kernelConstraint;\n }\n\n get recurrentConstraint(): Constraint {\n return (this.cell as LSTMCell).recurrentConstraint;\n }\n\n get biasConstraint(): Constraint {\n return (this.cell as LSTMCell).biasConstraint;\n }\n\n get dropout(): number {\n return (this.cell as LSTMCell).dropout;\n }\n\n get recurrentDropout(): number {\n return (this.cell as LSTMCell).recurrentDropout;\n }\n\n get implementation(): number {\n return (this.cell as LSTMCell).implementation;\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n units: this.units,\n activation: serializeActivation(this.activation),\n recurrentActivation: serializeActivation(this.recurrentActivation),\n useBias: this.useBias,\n kernelInitializer: serializeInitializer(this.kernelInitializer),\n recurrentInitializer: serializeInitializer(this.recurrentInitializer),\n biasInitializer: serializeInitializer(this.biasInitializer),\n unitForgetBias: this.unitForgetBias,\n kernelRegularizer: serializeRegularizer(this.kernelRegularizer),\n recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer),\n biasRegularizer: serializeRegularizer(this.biasRegularizer),\n activityRegularizer: serializeRegularizer(this.activityRegularizer),\n kernelConstraint: serializeConstraint(this.kernelConstraint),\n recurrentConstraint: serializeConstraint(this.recurrentConstraint),\n biasConstraint: serializeConstraint(this.biasConstraint),\n dropout: this.dropout,\n recurrentDropout: this.recurrentDropout,\n implementation: this.implementation,\n };\n const baseConfig = super.getConfig();\n delete baseConfig['cell'];\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n if (config['implmentation'] === 0) {\n config['implementation'] = 1;\n }\n return new cls(config);\n }\n}\nserialization.SerializationMap.register(LSTM);\n\nexport interface StackedRNNCellsConfig extends LayerConfig {\n /**\n * A `Array` of `RNNCell` instances.\n */\n cells: RNNCell[];\n}\n\n/**\n * Wrapper allowing a stack of RNN cells to behave as a single cell.\n *\n * Used to implement efficient stacked RNNs.\n */\nexport class StackedRNNCells extends RNNCell {\n static className = 'StackedRNNCells';\n protected cells: RNNCell[];\n\n constructor(config: StackedRNNCellsConfig) {\n super(config);\n this.cells = config.cells;\n }\n\n get stateSize(): number[] {\n // States are a flat list in reverse order of the cell stack.\n // This allows perserving the requirement `stack.statesize[0] ===\n // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`,\n // assuming one LSTM has states `[h, c]`.\n const stateSize: number[] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n stateSize.push(...cell.stateSize);\n } else {\n stateSize.push(cell.stateSize);\n }\n }\n return stateSize;\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n inputs = inputs as Tensor[];\n let states = inputs.slice(1);\n\n // Recover per-cell states.\n const nestedStates: Tensor[][] = [];\n for (const cell of this.cells.slice().reverse()) {\n if (Array.isArray(cell.stateSize)) {\n nestedStates.push(states.splice(0, cell.stateSize.length));\n } else {\n nestedStates.push(states.splice(0, 1));\n }\n }\n nestedStates.reverse();\n\n // Call the cells in order and store the returned states.\n const newNestedStates: Tensor[][] = [];\n let callInputs: Tensor[];\n for (let i = 0; i < this.cells.length; ++i) {\n const cell = this.cells[i];\n states = nestedStates[i];\n // TODO(cais): Take care of constants.\n if (i === 0) {\n callInputs = [inputs[0]].concat(states);\n } else {\n callInputs = [callInputs[0]].concat(states);\n }\n callInputs = cell.call(callInputs, kwargs) as Tensor[];\n newNestedStates.push(callInputs.slice(1));\n }\n\n // Format the new states as a flat list in reverse cell order.\n states = [];\n for (const cellStates of newNestedStates.slice().reverse()) {\n states.push(...cellStates);\n }\n return [callInputs[0]].concat(states);\n });\n }\n\n public build(inputShape: Shape|Shape[]): void {\n if (isArrayOfShapes(inputShape)) {\n // TODO(cais): Take care of input constants.\n // const constantShape = inputShape.slice(1);\n inputShape = (inputShape as Shape[])[0];\n }\n inputShape = inputShape as Shape;\n let outputDim: number;\n for (const cell of this.cells) {\n // TODO(cais): Take care of input constants.\n cell.build(inputShape);\n if (Array.isArray(cell.stateSize)) {\n outputDim = cell.stateSize[0];\n } else {\n outputDim = cell.stateSize;\n }\n inputShape = [inputShape[0], outputDim];\n }\n this.built = true;\n }\n\n getConfig(): serialization.ConfigDict {\n const cellConfigs: serialization.ConfigDict[] = [];\n for (const cell of this.cells) {\n cellConfigs.push({\n 'className': this.getClassName(),\n 'config': cell.getConfig(),\n });\n }\n const config: serialization.ConfigDict = {'cells': cellConfigs};\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const cells: RNNCell[] = [];\n for (const cellConfig of (config['cells'] as serialization.ConfigDict[])) {\n cells.push(deserialize(cellConfig, customObjects) as RNNCell);\n }\n return new cls({cells});\n }\n\n get trainableWeights(): LayerVariable[] {\n if (!this.trainable) {\n return [];\n }\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.trainableWeights);\n }\n return weights;\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.nonTrainableWeights);\n }\n if (!this.trainable) {\n const trainableWeights: LayerVariable[] = [];\n for (const cell of this.cells) {\n trainableWeights.push(...cell.trainableWeights);\n }\n return trainableWeights.concat(weights);\n }\n return weights;\n }\n\n /**\n * Retrieve the weights of a the model.\n *\n * @returns A flat `Array` of `Tensor`s.\n */\n getWeights(): Tensor[] {\n const weights: LayerVariable[] = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }\n\n /**\n * Set the weights of the model.\n *\n * @param weights An `Array` of `Tensor`s with shapes and types matching the\n * output of `getWeights()`.\n */\n setWeights(weights: Tensor[]): void {\n const tuples: Array<[LayerVariable, Tensor]> = [];\n for (const cell of this.cells) {\n const numParams = cell.weights.length;\n const inputWeights = weights.splice(numParams);\n for (let i = 0; i < cell.weights.length; ++i) {\n tuples.push([cell.weights[i], inputWeights[i]]);\n }\n }\n batchSetValue(tuples);\n }\n\n // TODO(cais): Maybe implemnt `losses` and `getLossesFor`.\n}\nserialization.SerializationMap.register(StackedRNNCells);\n\nfunction generateDropoutMask(\n ones: () => Tensor, rate: number, training: boolean = null,\n count = 1): Tensor|Tensor[] {\n function droppedInputs(): Tensor {\n return K.dropout(ones(), getScalar(rate));\n }\n if (count > 1) {\n const mask: Tensor[] = [];\n for (let i = 0; i < count; i++) {\n mask.push(K.inTrainPhase(droppedInputs, ones, training));\n }\n mask.forEach(m => tfc.keep(m));\n return mask;\n } else {\n return tfc.keep(K.inTrainPhase(droppedInputs, ones, training));\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/**\n * Layers that augment the functionality of a base layer.\n */\n\n// tslint:disable:max-line-length\nimport * as tfc from '@tensorflow/tfjs-core';\nimport {serialization, Tensor, tidy} from '@tensorflow/tfjs-core';\n\nimport {getScalar} from '../backend/state';\nimport * as K from '../backend/tfjs_backend';\nimport {nameScope} from '../common';\nimport {InputSpec, Layer, LayerConfig, SymbolicTensor} from '../engine/topology';\nimport {NotImplementedError, ValueError} from '../errors';\nimport {Kwargs, Shape} from '../types';\nimport {RegularizerFn, RnnStepFunction} from '../types';\nimport * as generic_utils from '../utils/generic_utils';\nimport {getExactlyOneShape, getExactlyOneTensor} from '../utils/types_utils';\nimport {LayerVariable} from '../variables';\n\nimport {rnn, RNN, standardizeArgs} from './recurrent';\nimport {deserialize} from './serialization';\n\n// tslint:enable:max-line-length\n\nexport interface WrapperLayerConfig extends LayerConfig {\n /**\n * The layer to be wrapped.\n */\n layer: Layer;\n}\n\n/**\n * Abstract wrapper base class.\n *\n * Wrappers take another layer and augment it in various ways.\n * Do not use this class as a layer, it is only an abstract base class.\n * Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers.\n */\nexport abstract class Wrapper extends Layer {\n readonly layer: Layer;\n\n constructor(config: WrapperLayerConfig) {\n // Porting Note: In PyKeras, `self.layer` is set prior to the calling\n // `super()`. But we can't do that here due to TypeScript's restriction.\n // See: https://github.com/Microsoft/TypeScript/issues/8277\n // As a result, we have to add checks in `get trainable()` and\n // `set trainable()` below in order to prevent using `this.layer` when\n // its value is `undefined`. The super constructor does use the getter\n // and the setter of `this.layer`.\n super(config);\n this.layer = config.layer;\n }\n\n build(inputShape: Shape|Shape[]): void {\n this.built = true;\n }\n\n // TODO(cais): Implement activityRegularizer getter.\n\n get trainable(): boolean {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n return this.layer.trainable;\n } else {\n return false;\n }\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n if (this.layer != null) {\n this.layer.trainable = value;\n }\n }\n\n get trainableWeights(): LayerVariable[] {\n return this.layer.trainableWeights;\n }\n // TODO(cais): Implement setter for trainableWeights.\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.layer.nonTrainableWeights;\n }\n // TODO(cais): Implement setter for nonTrainableWeights.\n\n get updates(): Tensor[] {\n // tslint:disable-next-line:no-any\n return (this.layer as any)._updates;\n }\n\n // TODO(cais): Implement getUpdatesFor().\n\n get losses(): RegularizerFn[] {\n return this.layer.losses;\n }\n\n // TODO(cais): Implement getLossesFor().\n\n getWeights(): Tensor[] {\n return this.layer.getWeights();\n }\n\n setWeights(weights: Tensor[]): void {\n this.layer.setWeights(weights);\n }\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'layer': {\n 'className': this.layer.getClassName(),\n 'config': this.layer.getConfig(),\n }\n };\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict,\n customObjects = {} as serialization.ConfigDict): T {\n const layerConfig = config['layer'] as serialization.ConfigDict;\n const layer = deserialize(layerConfig, customObjects) as Layer;\n delete config['layer'];\n const newConfig = {layer};\n Object.assign(newConfig, config);\n return new cls(newConfig);\n }\n}\n\n/**\n * This wrapper applies a layer to every temporal slice of an input.\n *\n * The input should be at least 3D, and the dimension of the index `1` will be\n * considered to be the temporal dimension.\n *\n * Consider a batch of 32 samples, where each sample is a sequence of 10 vectors\n * of 16 dimensions. The batch input shape of the layer is then `[32, 10,\n * 16]`, and the `inputShape`, not including the sample dimension, is\n * `[10, 16]`.\n *\n * You can then use `TimeDistributed` to apply a `Dense` layer to each of the 10\n * timesteps, independently:\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.dense({units: 8}),\n * inputShape: [10, 16],\n * }));\n *\n * // Now model.outputShape = [null, 10, 8].\n * // The output will then have shape `[32, 10, 8]`.\n *\n * // In subsequent layers, there is no need for `inputShape`:\n * model.add(tf.layers.timeDistributed({layer: tf.layers.dense({units: 32})}));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * // Now model.outputShape = [null, 10, 32].\n * ```\n *\n * The output will then have shape `[32, 10, 32]`.\n *\n * `TimeDistributed` can be used with arbitrary layers, not just `Dense`, for\n * instance a `Conv2D` layer.\n *\n * ```js\n * const model = tf.sequential();\n * model.add(tf.layers.timeDistributed({\n * layer: tf.layers.conv2d({filters: 64, kernelSize: [3, 3]}),\n * inputShape: [10, 299, 299, 3],\n * }));\n * console.log(JSON.stringify(model.outputs[0].shape));\n * ```\n */\nexport class TimeDistributed extends Wrapper {\n static className = 'TimeDistributed';\n constructor(config: WrapperLayerConfig) {\n super(config);\n this.supportsMasking = true;\n }\n\n build(inputShape: Shape|Shape[]): void {\n inputShape = getExactlyOneShape(inputShape);\n if (inputShape.length < 3) {\n throw new ValueError(\n `TimeDistributed layer expects an input shape >= 3D, but received ` +\n `input shape ${JSON.stringify(inputShape)}`);\n }\n this.inputSpec = [{shape: inputShape}];\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n if (!this.layer.built) {\n this.layer.build(childInputShape);\n this.layer.built = true;\n }\n super.build(inputShape);\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n inputShape = getExactlyOneShape(inputShape);\n const childInputShape = [inputShape[0]].concat(inputShape.slice(2));\n const childOutputShape =\n this.layer.computeOutputShape(childInputShape) as Shape;\n const timesteps = inputShape[1];\n return [childOutputShape[0], timesteps].concat(childOutputShape.slice(1));\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n // TODO(cais): Add 'training' and 'useLearningPhase' to kwargs.\n inputs = getExactlyOneTensor(inputs);\n // Porting Note: In tfjs-layers, `inputs` are always concrete tensor\n // values. Hence the inputs can't have an undetermined first (batch)\n // dimension, which is why we always use the K.rnn approach here.\n const step: RnnStepFunction = (inputs: Tensor, states: Tensor[]) => {\n // TODO(cais): Add useLearningPhase.\n const output = this.layer.call(inputs, kwargs) as Tensor;\n return [output, []];\n };\n const rnnOutputs =\n rnn(step, inputs, [], false, null, null, false, inputs.shape[1]);\n const y = rnnOutputs[1];\n // TODO(cais): Add activity regularization.\n // TODO(cais): Add useLearningPhase.\n return y;\n });\n }\n}\nserialization.SerializationMap.register(TimeDistributed);\n\nexport type BidirectionalMergeMode = 'sum'|'mul'|'concat'|'ave';\nexport const VALID_BIDIRECTIONAL_MERGE_MODES = ['sum', 'mul', 'concat', 'ave'];\nexport function checkBidirectionalMergeMode(value?: string): void {\n generic_utils.checkStringTypeUnionValue(\n VALID_BIDIRECTIONAL_MERGE_MODES, 'BidirectionalMergeMode', value);\n}\n\nexport interface BidirectionalLayerConfig extends WrapperLayerConfig {\n /**\n * The instance of an `RNN` layer to be wrapped.\n */\n layer: RNN;\n\n /**\n * Mode by which outputs of the forward and backward RNNs are combinied.\n * If `null` or `undefined`, the output will not be combined, they will be\n * returned as an `Array`.\n */\n mergeMode?: BidirectionalMergeMode;\n}\n\nexport class Bidirectional extends Wrapper {\n static className = 'Bidirectional';\n private forwardLayer: RNN;\n private backwardLayer: RNN;\n private mergeMode: BidirectionalMergeMode;\n private returnSequences: boolean;\n private returnState: boolean;\n private numConstants?: number;\n private _trainable: boolean;\n\n constructor(config: BidirectionalLayerConfig) {\n super(config);\n\n // Note: When creating `this.forwardLayer`, the original Layer object\n // (`config.layer`) ought to be cloned. This is why we call `getConfig()`\n // followed by `deserialize()`. Without this cloning, the layer names\n // saved during serialization will incorrectly contain the 'forward_'\n // prefix.\n // In Python Keras, this is done using `copy.copy` (shallow copy), which\n // does not have a simple equivalent in JavaScript. JavaScript's\n // `Object.assign()` does not copy methods.\n const layerConfig = config.layer.getConfig();\n this.forwardLayer =\n deserialize(\n {className: config.layer.getClassName(), config: layerConfig}) as\n RNN;\n layerConfig['goBackwards'] =\n layerConfig['goBackwards'] === true ? false : true;\n this.backwardLayer =\n deserialize(\n {className: config.layer.getClassName(), config: layerConfig}) as\n RNN;\n this.forwardLayer.name = 'forward_' + this.forwardLayer.name;\n this.backwardLayer.name = 'backward_' + this.backwardLayer.name;\n checkBidirectionalMergeMode(config.mergeMode);\n this.mergeMode = config.mergeMode;\n if (config.weights) {\n throw new NotImplementedError(\n 'weights support is not implemented for Bidirectional layer yet.');\n }\n this._stateful = config.layer.stateful;\n this.returnSequences = config.layer.returnSequences;\n this.returnState = config.layer.returnState;\n this.supportsMasking = true;\n this._trainable = true;\n this.inputSpec = config.layer.inputSpec;\n this.numConstants = null;\n }\n\n get trainable(): boolean {\n return this._trainable;\n }\n\n set trainable(value: boolean) {\n // Porting Note: the check of `this.layer` here is necessary due to the\n // way the `constructor` of this class is written (see Porting Note\n // above).\n this._trainable = value;\n if (this.forwardLayer != null) {\n this.forwardLayer.trainable = value;\n }\n if (this.backwardLayer != null) {\n this.backwardLayer.trainable = value;\n }\n }\n\n getWeights(): Tensor[] {\n return this.forwardLayer.getWeights().concat(\n this.backwardLayer.getWeights());\n }\n\n setWeights(weights: Tensor[]): void {\n const numWeights = weights.length;\n const numeightsOver2 = Math.floor(numWeights / 2);\n this.forwardLayer.setWeights(weights.slice(0, numeightsOver2));\n this.backwardLayer.setWeights(weights.slice(numeightsOver2));\n }\n\n computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {\n let layerShapes: Shape|Shape[] =\n this.forwardLayer.computeOutputShape(inputShape);\n if (!(Array.isArray(layerShapes) && Array.isArray(layerShapes[0]))) {\n layerShapes = [layerShapes as Shape];\n }\n layerShapes = layerShapes as Shape[];\n\n let outputShape: Shape;\n let outputShapes: Shape[];\n let stateShape: Shape[];\n if (this.returnState) {\n stateShape = layerShapes.slice(1);\n outputShape = layerShapes[0];\n } else {\n outputShape = layerShapes[0];\n }\n outputShape = outputShape as Shape;\n if (this.mergeMode === 'concat') {\n outputShape[outputShape.length - 1] *= 2;\n outputShapes = [outputShape];\n } else if (this.mergeMode == null) {\n outputShapes = [outputShape, outputShape.slice()];\n } else {\n outputShapes = [outputShape];\n }\n\n if (this.returnState) {\n if (this.mergeMode == null) {\n return outputShapes.concat(stateShape).concat(stateShape.slice());\n }\n return [outputShape].concat(stateShape).concat(stateShape.slice());\n }\n return generic_utils.singletonOrArray(outputShapes);\n }\n\n apply(\n inputs: Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[],\n kwargs?: Kwargs): Tensor|Tensor[]|SymbolicTensor|SymbolicTensor[] {\n let initialState: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['initialState'];\n let constants: Tensor[]|SymbolicTensor[] =\n kwargs == null ? null : kwargs['constants'];\n if (kwargs == null) {\n kwargs = {};\n }\n const standardized =\n standardizeArgs(inputs, initialState, constants, this.numConstants);\n inputs = standardized.inputs as Tensor | SymbolicTensor;\n initialState = standardized.initialState;\n constants = standardized.constants;\n\n if (Array.isArray(inputs)) {\n initialState = (inputs as Tensor[] | SymbolicTensor[]).slice(1);\n inputs = (inputs as Tensor[] | SymbolicTensor[])[0];\n }\n\n if ((initialState == null || initialState.length === 0) &&\n constants == null) {\n return super.apply(inputs, kwargs);\n }\n const additionalInputs: Array = [];\n const additionalSpecs: InputSpec[] = [];\n if (initialState != null) {\n const numStates = initialState.length;\n if (numStates % 2 > 0) {\n throw new ValueError(\n 'When passing `initialState` to a Bidrectional RNN, ' +\n 'the state should be an Array containing the states of ' +\n 'the underlying RNNs.');\n }\n kwargs['initialState'] = initialState;\n additionalInputs.push(...initialState);\n const stateSpecs = (initialState as Array)\n .map(state => new InputSpec({shape: state.shape}));\n this.forwardLayer.stateSpec = stateSpecs.slice(0, numStates / 2);\n this.backwardLayer.stateSpec = stateSpecs.slice(numStates / 2);\n additionalSpecs.push(...stateSpecs);\n }\n if (constants != null) {\n throw new NotImplementedError(\n 'Support for constants in Bidirectional layers is not ' +\n 'implemented yet.');\n }\n\n const isSymbolicTensor = additionalInputs[0] instanceof SymbolicTensor;\n for (const tensor of additionalInputs) {\n if (tensor instanceof SymbolicTensor !== isSymbolicTensor) {\n throw new ValueError(\n 'The initial state of a Bidirectional layer cannot be ' +\n 'specified as a mix of symbolic and non-symbolic tensors');\n }\n }\n\n if (isSymbolicTensor) {\n // Compute the full input and specs, including the states.\n const fullInput = [inputs].concat(additionalInputs);\n const fullInputSpec = this.inputSpec.concat(additionalSpecs);\n // Perform the call temporarily and replace inputSpec.\n // Note: with initial states symbolic calls and non-symbolic calls to this\n // method differ in how the initial states are passed. For symbolic calls,\n // the initial states are passed in the first arg, as an Array of\n // SymbolicTensors; for non-symbolic calls, they are passed in the second\n // arg as a part of the kwargs. Hence the need to temporarily modify\n // inputSpec here.\n // TODO(cais): Make refactoring so that this hacky code below is no\n // longer needed.\n const originalInputSpec = this.inputSpec;\n this.inputSpec = fullInputSpec;\n const output =\n super.apply(fullInput as Tensor[] | SymbolicTensor[], kwargs);\n this.inputSpec = originalInputSpec;\n return output;\n } else {\n return super.apply(inputs, kwargs);\n }\n }\n\n call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {\n return tidy(() => {\n if (kwargs['mask'] != null) {\n throw new NotImplementedError(\n 'The support for masking is not implemented for ' +\n 'Bidirectional layers yet.');\n }\n const initialState = kwargs['initialState'];\n\n let y: Tensor|Tensor[];\n let yRev: Tensor|Tensor[];\n if (initialState == null) {\n y = this.forwardLayer.call(inputs, kwargs);\n yRev = this.backwardLayer.call(inputs, kwargs);\n } else {\n const forwardState = initialState.slice(0, initialState.length / 2);\n const backwardState = initialState.slice(initialState.length / 2);\n y = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: forwardState}));\n yRev = this.forwardLayer.call(\n inputs, Object.assign(kwargs, {initialState: backwardState}));\n }\n\n let states: Tensor[];\n if (this.returnState) {\n if (Array.isArray(y)) {\n states = (y as Tensor[]).slice(1).concat((yRev as Tensor[]).slice(1));\n } else {\n }\n y = (y as Tensor[])[0];\n yRev = (yRev as Tensor[])[0];\n }\n\n if (this.returnSequences) {\n yRev = tfc.reverse(yRev as Tensor, 1);\n }\n\n let output: Tensor|Tensor[];\n if (this.mergeMode === 'concat') {\n output = K.concatenate([y as Tensor, yRev as Tensor]);\n } else if (this.mergeMode === 'sum') {\n output = tfc.add(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode === 'ave') {\n output = tfc.mul(getScalar(0.5), tfc.add(y as Tensor, yRev as Tensor));\n } else if (this.mergeMode === 'mul') {\n output = tfc.mul(y as Tensor, yRev as Tensor);\n } else if (this.mergeMode == null) {\n output = [y as Tensor, yRev as Tensor];\n }\n\n // TODO(cais): Properly set learning phase.\n if (this.returnState) {\n if (this.mergeMode == null) {\n return (output as Tensor[]).concat(states);\n }\n return [output as Tensor].concat(states);\n }\n return output;\n });\n }\n\n resetStates(states?: Tensor|Tensor[]): void {\n this.forwardLayer.resetStates();\n this.backwardLayer.resetStates();\n }\n\n build(inputShape: Shape|Shape[]): void {\n nameScope(this.forwardLayer.name, () => {\n this.forwardLayer.build(inputShape);\n });\n nameScope(this.backwardLayer.name, () => {\n this.backwardLayer.build(inputShape);\n });\n this.built = true;\n }\n\n // TODO(cais): Implement computeMask().\n\n get trainableWeights(): LayerVariable[] {\n return this.forwardLayer.trainableWeights.concat(\n this.backwardLayer.trainableWeights);\n }\n\n get nonTrainableWeights(): LayerVariable[] {\n return this.forwardLayer.nonTrainableWeights.concat(\n this.backwardLayer.nonTrainableWeights);\n }\n\n // TODO(cais): Implement constraints().\n\n getConfig(): serialization.ConfigDict {\n const config: serialization.ConfigDict = {\n 'mergeMode': this.mergeMode,\n };\n // TODO(cais): Add logic for `numConstants` once the property is added.\n const baseConfig = super.getConfig();\n Object.assign(config, baseConfig);\n return config;\n }\n\n static fromConfig(\n cls: serialization.SerializableConstructor,\n config: serialization.ConfigDict): T {\n const rnnLayer =\n deserialize(config['layer'] as serialization.ConfigDict) as RNN;\n delete config['layer'];\n // TODO(cais): Add logic for `numConstants` once the property is added.\n if (config['numConstants'] != null) {\n throw new NotImplementedError(\n `Deserialization of a Bidirectional layer with numConstants ` +\n `present is not supported yet.`);\n }\n // tslint:disable-next-line:no-any\n const newConfig: {[key: string]: any} = config;\n newConfig['layer'] = rnnLayer;\n return new cls(newConfig);\n }\n}\nserialization.SerializationMap.register(Bidirectional);\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n// tslint:disable:max-line-length\n\nimport {InputLayer, InputLayerConfig} from './engine/input_layer';\nimport {Layer, LayerConfig} from './engine/topology';\nimport {input} from './exports';\nimport {ELU, ELULayerConfig, LeakyReLU, LeakyReLULayerConfig, Softmax, SoftmaxLayerConfig, ThresholdedReLU, ThresholdedReLULayerConfig} from './layers/advanced_activations';\nimport {Conv1D, Conv2D, Conv2DTranspose, ConvLayerConfig, Cropping2D, Cropping2DLayerConfig, SeparableConv2D, SeparableConvLayerConfig, UpSampling2D, UpSampling2DLayerConfig} from './layers/convolutional';\nimport {DepthwiseConv2D, DepthwiseConv2DLayerConfig} from './layers/convolutional_depthwise';\nimport {Activation, ActivationLayerConfig, Dense, DenseLayerConfig, Dropout, DropoutLayerConfig, Flatten, RepeatVector, RepeatVectorLayerConfig, Reshape, ReshapeLayerConfig} from './layers/core';\nimport {Embedding, EmbeddingLayerConfig} from './layers/embeddings';\nimport {Add, Average, Concatenate, ConcatenateLayerConfig, Maximum, Minimum, Multiply} from './layers/merge';\nimport {BatchNormalization, BatchNormalizationLayerConfig} from './layers/normalization';\nimport {ZeroPadding2D, ZeroPadding2DLayerConfig} from './layers/padding';\nimport {AveragePooling1D, AveragePooling2D, GlobalAveragePooling1D, GlobalAveragePooling2D, GlobalMaxPooling1D, GlobalMaxPooling2D, GlobalPooling2DLayerConfig, MaxPooling1D, MaxPooling2D, Pooling1DLayerConfig, Pooling2DLayerConfig} from './layers/pooling';\nimport {GRU, GRUCell, GRUCellLayerConfig, GRULayerConfig, LSTM, LSTMCell, LSTMCellLayerConfig, LSTMLayerConfig, RNN, RNNCell, RNNLayerConfig, SimpleRNN, SimpleRNNCell, SimpleRNNCellLayerConfig, SimpleRNNLayerConfig, StackedRNNCells, StackedRNNCellsConfig} from './layers/recurrent';\nimport {Bidirectional, BidirectionalLayerConfig, TimeDistributed, Wrapper, WrapperLayerConfig} from './layers/wrappers';\n\n\n// tslint:enable:max-line-length\n\n// TODO(cais): Add doc string to all the public static functions in this\n// class; include exectuable JavaScript code snippets where applicable\n// (b/74074458).\n\n// Input Layer.\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Inputs',\n * namespace: 'layers',\n * useDocsFrom: 'InputLayer',\n * configParamIndices: [0]\n * }\n */\nexport function inputLayer(config: InputLayerConfig): Layer {\n return new InputLayer(config);\n}\n\n// Advanced Activation Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'ELU',\n * configParamIndices: [0]\n * }\n */\nexport function elu(config?: ELULayerConfig): Layer {\n return new ELU(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'LeakyReLU',\n * configParamIndices: [0]\n * }\n */\nexport function leakyReLU(config?: LeakyReLULayerConfig): Layer {\n return new LeakyReLU(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'Softmax',\n * configParamIndices: [0]\n * }\n */\nexport function softmax(config?: SoftmaxLayerConfig): Layer {\n return new Softmax(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Advanced Activation',\n * namespace: 'layers',\n * useDocsFrom: 'ThresholdedReLU',\n * configParamIndices: [0]\n * }\n */\nexport function thresholdedReLU(config?: ThresholdedReLULayerConfig): Layer {\n return new ThresholdedReLU(config);\n}\n\n// Convolutional Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Conv1D',\n * configParamIndices: [0]\n * }\n */\nexport function conv1d(config: ConvLayerConfig): Layer {\n return new Conv1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Conv2D',\n * configParamIndices: [0]\n * }\n */\nexport function conv2d(config: ConvLayerConfig): Layer {\n return new Conv2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Conv2DTranspose',\n * configParamIndices: [0]\n * }\n */\nexport function conv2dTranspose(config: ConvLayerConfig): Layer {\n return new Conv2DTranspose(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'SeparableConv2D',\n * configParamIndices: [0]\n * }\n */\nexport function separableConv2d(config: SeparableConvLayerConfig): Layer {\n return new SeparableConv2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'Cropping2D',\n * configParamIndices: [0]\n * }\n */\nexport function cropping2D(config: Cropping2DLayerConfig): Layer {\n return new Cropping2D(config);\n}\n\n/**\n * @doc{\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'UpSampling2D',\n * configParamIndices: [0]\n * }\n */\nexport function upSampling2d(config: UpSampling2DLayerConfig): Layer {\n return new UpSampling2D(config);\n}\n\n// Convolutional(depthwise) Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Convolutional',\n * namespace: 'layers',\n * useDocsFrom: 'DepthwiseConv2D',\n * configParamIndices: [0]\n * }\n */\n\nexport function depthwiseConv2d(config: DepthwiseConv2DLayerConfig): Layer {\n return new DepthwiseConv2D(config);\n}\n\n// Basic Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Activation',\n * configParamIndices: [0]\n * }\n */\nexport function activation(config: ActivationLayerConfig): Layer {\n return new Activation(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Dense',\n * configParamIndices: [0]\n * }\n */\nexport function dense(config: DenseLayerConfig): Layer {\n return new Dense(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Dropout',\n * configParamIndices: [0]\n * }\n */\nexport function dropout(config: DropoutLayerConfig): Layer {\n return new Dropout(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Flatten',\n * configParamIndices: [0]\n * }\n */\nexport function flatten(config?: LayerConfig): Layer {\n return new Flatten(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'RepeatVector',\n * configParamIndices: [0]\n * }\n */\nexport function repeatVector(config: RepeatVectorLayerConfig): Layer {\n return new RepeatVector(config);\n}\n\n/**\n * @doc{\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Reshape',\n * configParamIndices: [0]\n * }\n */\nexport function reshape(config: ReshapeLayerConfig): Layer {\n return new Reshape(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Basic',\n * namespace: 'layers',\n * useDocsFrom: 'Embedding',\n * configParamIndices: [0]\n * }\n */\nexport function embedding(config: EmbeddingLayerConfig): Layer {\n return new Embedding(config);\n}\n\n// Merge Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Add',\n * configParamIndices: [0]\n * }\n */\nexport function add(config?: LayerConfig): Layer {\n return new Add(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Average',\n * configParamIndices: [0]\n * }\n */\nexport function average(config?: LayerConfig): Layer {\n return new Average(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Concatenate',\n * configParamIndices: [0]\n * }\n */\nexport function concatenate(config?: ConcatenateLayerConfig): Layer {\n return new Concatenate(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Maximum',\n * configParamIndices: [0]\n * }\n */\nexport function maximum(config?: LayerConfig): Layer {\n return new Maximum(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Minimum',\n * configParamIndices: [0]\n * }\n */\nexport function minimum(config?: LayerConfig): Layer {\n return new Minimum(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Merge',\n * namespace: 'layers',\n * useDocsFrom: 'Multiply',\n * configParamIndices: [0]\n * }\n */\nexport function multiply(config?: LayerConfig): Layer {\n return new Multiply(config);\n}\n\n// Normalization Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Normalization',\n * namespace: 'layers',\n * useDocsFrom: 'BatchNormalization',\n * configParamIndices: [0]\n * }\n */\nexport function batchNormalization(config: BatchNormalizationLayerConfig):\n Layer {\n return new BatchNormalization(config);\n}\n\n// Padding Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Padding',\n * namespace: 'layers',\n * useDocsFrom: 'ZeroPadding2D',\n * configParamIndices: [0]\n * }\n */\nexport function zeroPadding2d(config?: ZeroPadding2DLayerConfig): Layer {\n return new ZeroPadding2D(config);\n}\n\n// Pooling Layers.\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'AveragePooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function averagePooling1d(config: Pooling1DLayerConfig): Layer {\n return new AveragePooling1D(config);\n}\nexport function avgPool1d(config: Pooling1DLayerConfig): Layer {\n return averagePooling1d(config);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling1d(config: Pooling1DLayerConfig): Layer {\n return averagePooling1d(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'AveragePooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function averagePooling2d(config: Pooling2DLayerConfig): Layer {\n return new AveragePooling2D(config);\n}\nexport function avgPool2d(config: Pooling2DLayerConfig): Layer {\n return averagePooling2d(config);\n}\n// For backwards compatibility.\n// See https://github.com/tensorflow/tfjs/issues/152\nexport function avgPooling2d(config: Pooling2DLayerConfig): Layer {\n return averagePooling2d(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalAveragePooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function globalAveragePooling1d(config: LayerConfig): Layer {\n return new GlobalAveragePooling1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalAveragePooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function globalAveragePooling2d(config: GlobalPooling2DLayerConfig):\n Layer {\n return new GlobalAveragePooling2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalMaxPooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function globalMaxPooling1d(config: LayerConfig): Layer {\n return new GlobalMaxPooling1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'GlobalMaxPooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function globalMaxPooling2d(config: GlobalPooling2DLayerConfig): Layer {\n return new GlobalMaxPooling2D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'MaxPooling1D',\n * configParamIndices: [0]\n * }\n */\nexport function maxPooling1d(config: Pooling1DLayerConfig): Layer {\n return new MaxPooling1D(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Pooling',\n * namespace: 'layers',\n * useDocsFrom: 'MaxPooling2D',\n * configParamIndices: [0]\n * }\n */\nexport function maxPooling2d(config: Pooling2DLayerConfig): Layer {\n return new MaxPooling2D(config);\n}\n\n// Recurrent Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'GRU',\n * configParamIndices: [0]\n * }\n */\nexport function gru(config: GRULayerConfig): Layer {\n return new GRU(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'GRUCell',\n * configParamIndices: [0]\n * }\n */\nexport function gruCell(config: GRUCellLayerConfig): RNNCell {\n return new GRUCell(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'LSTM',\n * configParamIndices: [0]\n * }\n */\nexport function lstm(config: LSTMLayerConfig): Layer {\n return new LSTM(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'LSTMCell',\n * configParamIndices: [0]\n * }\n */\nexport function lstmCell(config: LSTMCellLayerConfig): RNNCell {\n return new LSTMCell(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'SimpleRNN',\n * configParamIndices: [0]\n * }\n */\nexport function simpleRNN(config: SimpleRNNLayerConfig): Layer {\n return new SimpleRNN(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'SimpleRNNCell',\n * configParamIndices: [0]\n * }\n */\nexport function simpleRNNCell(config: SimpleRNNCellLayerConfig): RNNCell {\n return new SimpleRNNCell(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'RNN',\n * configParamIndices: [0]\n * }\n */\nexport function rnn(config: RNNLayerConfig): Layer {\n return new RNN(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Recurrent',\n * namespace: 'layers',\n * useDocsFrom: 'RNN',\n * configParamIndices: [0]\n * }\n */\nexport function stackedRNNCells(config: StackedRNNCellsConfig): RNNCell {\n return new StackedRNNCells(config);\n}\n\n// Wrapper Layers.\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Wrapper',\n * namespace: 'layers',\n * useDocsFrom: 'Bidirectional',\n * configParamIndices: [0]\n * }\n */\nexport function bidirectional(config: BidirectionalLayerConfig): Wrapper {\n return new Bidirectional(config);\n}\n\n/**\n * @doc {\n * heading: 'Layers',\n * subheading: 'Wrapper',\n * namespace: 'layers',\n * useDocsFrom: 'TimeDistributed',\n * configParamIndices: [0]\n * }\n */\nexport function timeDistributed(config: WrapperLayerConfig): Layer {\n return new TimeDistributed(config);\n}\n\n// Aliases for pooling.\nexport const globalMaxPool1d = globalMaxPooling1d;\nexport const globalMaxPool2d = globalMaxPooling2d;\nexport const maxPool1d = maxPooling1d;\nexport const maxPool2d = maxPooling2d;\n\nexport {Layer, input /* alias for tf.input */};\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport {Tensor} from '@tensorflow/tfjs-core';\n\nimport * as losses from './losses';\nimport * as metrics from './metrics';\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'binaryAccuracy'\n * }\n */\nexport function binaryAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryAccuracy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'binaryCrossentropy'\n * }\n */\nexport function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.binaryCrossentropy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'categoricalAccuracy'\n * }\n */\nexport function categoricalAccuracy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalAccuracy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'categoricalCrossentropy'\n * }\n */\nexport function categoricalCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor {\n return metrics.categoricalCrossentropy(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'cosineProximity'\n * }\n */\nexport function cosineProximity(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.cosineProximity(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'meanAbsoluteError'\n * }\n */\nexport function meanAbsoluteError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsoluteError(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'meanAbsolutePercentageError'\n * }\n */\nexport function meanAbsolutePercentageError(\n yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function MAPE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\nexport function mape(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanAbsolutePercentageError(yTrue, yPred);\n}\n\n/**\n * @doc {\n * heading: 'Metrics',\n * namespace: 'metrics',\n * useDocsFrom: 'meanSquaredError'\n * }\n */\nexport function meanSquaredError(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function MSE(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n\nexport function mse(yTrue: Tensor, yPred: Tensor): Tensor {\n return losses.meanSquaredError(yTrue, yPred);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\nimport * as regularizers from './regularizers';\n// tslint:disable-next-line:max-line-length\nimport {L1Config, L1L2, L1L2Config, L2Config, Regularizer} from './regularizers';\n\n/**\n * @doc {\n * heading: 'Regularizers',\n * namespace: 'regularizers',\n * useDocsFrom: 'L1L2',\n * configParamIndices: [0]\n * }\n */\nexport function l1l2(config?: L1L2Config): Regularizer {\n return new L1L2(config);\n}\n\n/**\n * @doc {\n * heading: 'Regularizers',\n * namespace: 'regularizers',\n * useDocsFrom: 'L1L2',\n * configParamIndices: [0]\n * }\n */\nexport function l1(config?: L1Config): Regularizer {\n return regularizers.l1(config);\n}\n\n/**\n * @doc {\n * heading: 'Regularizers',\n * namespace: 'regularizers',\n * useDocsFrom: 'L1L2',\n * configParamIndices: [0]\n * }\n */\nexport function l2(config?: L2Config): Regularizer {\n return regularizers.l2(config);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Use of this source code is governed by an MIT-style\n * license that can be found in the LICENSE file or at\n * https://opensource.org/licenses/MIT.\n * =============================================================================\n */\n\n/* Original source: keras/callbacks.py */\n\nimport {BaseCallback} from './base_callbacks';\nimport {Container} from './engine/container';\nimport {Model} from './engine/training';\n\nexport abstract class Callback extends BaseCallback {\n /** Instance of `keras.models.Model`. Reference of the model being trained. */\n model: Model = null;\n\n setModel(model: Container): void {\n if (!(model instanceof Model)) {\n throw new Error('model must be a Model, not some other Container');\n }\n this.model = model as Model;\n }\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '0.7.2';\nexport {version};\n"],"names":["_epsilon","_nextUniqueTensorId","_uidPrefixes","prefix","toString","scalarCache","float32","int32","DEFAULT_DTYPE","value","dtype","undefined","scalar","keep","message","_super","Object","setPrototypeOf","_this","AttributeError","prototype","tslib_1.__extends","Error","RuntimeError","ValueError","NotImplementedError","AssertionError","IndexError","numValues","Array","isArray","newArray","i","concat","fill","val","array","refernce","counter","array_1","_i","xs","length","x","name","insecure","replace","toLowerCase","identifier","indexOf","m","p1","toUpperCase","_GLOBAL_CUSTOM_OBJECTS","instance","className","getClassName","config","getConfig","moduleObjects","customObjects","printableModuleName","functionName","fn","JSON","stringify","cls","fromConfig","_a","_b","_c","customObjectsCombined","_d","keys","key","_f","_e","backupCustomObjects","_h","_g","returnObj","_k","_j","a","b","numberCompare","out","xs_1","push","obj","hasOwnProperty","values","label","expectedType","minLength","maxLength","assert","every","e","w","axis","tidy","tfc.sqrt","tfc.sum","tfc.mulStrict","Constraint","serialization","Serializable","maxValue","defaultMaxValue","defaultAxis","MaxNorm","norms","calcL2Norms","desired","tfc.clipByValue","tfc.mul","tfc.div","tfc.add","getScalar","epsilon","this","SerializationMap","register","UnitNorm","NonNeg","tfc.relu","minValue","defaultMinValue","rate","defaultRate","MinMaxNorm","CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP","maxNorm","minMaxNorm","nonNeg","unitNorm","constraint","serializeKerasObject","deserializeKerasObject","getMap","classNameMap","deserializeConstraint","nameMap","Map","VALID_DATA_FORMAT_VALUES","checkStringTypeUnionValue","VALID_PADDING_MODE_VALUES","VALID_POOL_MODE_VALUES","_nameScopeStack","_nameScopeDivider","pop","tensorName","isValidTensorName","join","scopedName","has","set","index","get","result","tensorNameRegex","RegExp","match","begin","end","prod","Float32Array","tensor1d","tfc.min","toArray1D","dataSync","tfc.max","asType","outShape","shape","slice","splice","reshape","start","size","rank","tfc.slice1d","tfc.slice2d","tfc.slice3d","tfc.slice4d","sliceAlongFirstAxis","sliceAlongLastAxis","tensors","tfc.concat","tfc.concat1d","tfc.concat2d","tfc.concat3d","tfc.concat4d","n","tfc.tile","mean","stddev","seed","tfc.randomNormal","y","tfc.matMul","xShape0","xShape1","xShape2","reference","indices","toInt","tfc.gather","bias","dataFormat","checkDataFormat","biasShape","add","level","noiseShape","util","arraysEqual","multiplier","tfc.step","tfc.neg","tfc.randomUniform","tfc.sub","alt","training","VALID_FAN_MODE_VALUES","VALID_DISTRIBUTION_VALUES","Initializer","Zeros","zeros","Ones","ones","Constant","mul","minval","DEFAULT_MINVAL","maxval","DEFAULT_MAXVAL","RandomUniform","randomUniform","DEFAULT_MEAN","DEFAULT_STDDEV","RandomNormal","K.randomNormal","TruncatedNormal","truncatedNormal","gain","Identity","eye","scale","mode","distribution","checkDistribution","VarianceScaling","fans","fanIn","fanOut","receptiveFieldSize","arrayProd","shapeProd","Math","sqrt","computeFans","max","limit","GlorotUniform","GlorotNormal","HeNormal","LeCunNormal","DEFAULT_GAIN","Orthogonal","console","warn","q","linalg","gramSchmidt","transpose","INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","constant","glorotNormal","glorotUniform","heNormal","identity","leCunNormal","orthogonal","randomNormal","varianceScaling","initializer","deserializeInitializer","shapes","weights","count","weights_1","weight","reduce","DEFAULT_VARIABLE_NAME_PREFIX","trainable","id","getNextUniqueTensorId","originalName","getScopedTensorName","getUniqueTensorName","tfc.variable","LayerVariable","newVal","checkShapesMatch","assign","apply","map","read","variablesAndValues","variableAndValue","write","ndim","maxNDim","minNDim","axes","sourceLayer","inputs","callArgs","outputTensorIndex","_nextNodeID","outboundLayer","inboundLayers","nodeIndices","tensorIndices","inputTensors","outputTensors","inputMasks","outputMasks","inputShapes","outputShapes","layer","outboundNodes","inboundNodes","Node","inboundNames","_nextLayerID","activityRegularizer","inputSpec","supportsMasking","_trainableWeights","_nonTrainableWeights","_losses","_updates","_built","generic_utils.toSnakeCase","getUid","updatable","inputShape","batchInputShape","batchSize","inputDType","initialWeights","Layer","nodeIndex","attrName","generic_utils.singletonOrArray","getNodeAtIndex","losses","lossFn","built","trainableWeights","nonTrainableWeights","_stateful","generic_utils.toList","inputIndex","spec","xShape","Number","xShapeAtAxis","specDim","dim","kwargs","_callHook","callHook","inputsList","allAreSymbolic","inputsList_1","SymbolicTensor","noneAreSymbolic","inputsList_2","nameScope","assertInputCompatibility","xElem","build","setWeights","outputListCopy","outputList_1","output","call","clone","inputTensors_1","collectInputShape","outputShape","computeOutputShape","warnOnIncompatibleInputShape","addInboundNode","dimMismatch_1","forEach","dimension","allOutputShapes","node","shapeString","variable_utils.countParamsInWeights","trainableOnly","batchGetValue","params","weightValueTuples","paramValues","pv","p","batchSetValue","regularizer","_addedWeightNames","addLoss","mask","TypeError","maskElement","inputTensorList","types_utils.normalizeShapeList","inputTensorList_1","tensorIndex","sparse","inputTensor","InputLayer","batchShape","logs","promises","scalarsToDispose","valueScalar","data","Promise","all","dispose","BaseCallback","epoch","batch","model","callbacks","queueLength","CallbackList","callback","setParams","setModel","onEpochBegin","onEpochEnd","onBatchBegin","onBatchEnd","onTrainBegin","onTrainEnd","BaseLogger","seen","totals","this_1","oldTotalsToDispose","this_2","div","History","history","valueArray","trainBegin","trainEnd","epochBegin","epochEnd","batchBegin","batchEnd","CustomCallback","resolveScalarsInLogs","squareSum","K.square","epsilonTensor","tfc.onesLike","norm","tfc.maximum","yTrue","yPred","tfc.mean","tfc.abs","diff","clippedTrue","MAX_VALUE","absResult","one","clippedPred","firstLog","tfc.log","secondLog","zeroTensor","maxResult","pos","neg","log2","log","predictionDiff","logcoshResult","tfc.softplus","target","fromLogits","tfc.softmax","outputSum","toFloat","newShape","flatTarget","tfc.floor","math_utils.arrayProd","categoricalCrossentropy","tfc.oneHot","maxOutput","tfc.zerosLike","outputXTarget","sigmoidOutput","tfc.exp","logPred","trueNormalized","l2Normalize","predNormalized","trueXPred","identifierOrFn","lossesMap","meanSquaredError","meanAbsoluteError","meanAbsolutePercentageError","meanSquaredLogarithmicError","squaredHinge","hinge","categoricalHinge","logcosh","sparseCategoricalCrossentropy","binaryCrossentropy","kullbackLeiblerDivergence","poisson","cosineProximity","threshold","yPredThresholded","K.cast","tfc.greater","tfc.equal","tfc.argMax","lossBinaryCrossentropy","mse","MSE","mae","MAE","mape","MAPE","categoricalCrossentropyLoss","cosine","sparseCategoricalCrossentropyLoss","fields","positions","printFn","line","repeat","err","printRow","countParams","relevantNodes","connections","inboundLayer","inboundLayerIndex","inboundTensorIndex","firstConnection","originalKerasVersion","originalBackend","startsWith","dataType","generic_utils.stringToDType","Tensor","make","flatten","Set","outputs","generic_utils.unique","inputLayers","inputLayersNodeIndices","inputLayersTensorIndices","outputLayers","outputLayersNodeIndices","outputLayersTensorIndices","layers","generic_utils.assert","inputNames","outputNames","feedInputShapes","feedInputNames","feedOutputNames","internalInputShapes","internalOutputShapes","nodesDepths","nodeIDToNode","layersDepths","layerIDToLayer","layerIndices","nodesInDecreasingDepth","buildMapOfGraph","tensor","finishedNodes","nodesInProgress","containerNodes","Container","nodeKey","numInboundLayers","layer_1","nodeIndex_1","tensorIndex_1","reversedNodesInDecreasingDepth_1","reverse","depth","previousDepth","inboundNode","previousDepth_1","nodesByDepth","nodeID","layersByDepth","layerID","depthKeys","parseInt","sort","generic_utils.reverseNumberCompare","depthKeys_1","layersForDepth","aIndex","bIndex","layersForDepth_1","computableTensors","layersWithCompleteInput","depthKeys_2","_l","_o","_m","_q","_p","_s","_r","allNames","name_4","numOccurrences","filter","allNames_1","_t","weightsJSON","skipMismatch","isNamedTensorMap","nameToWeight","totalWeightsCount","layers_2","name_2","unsetNames","name_3","loadWeightsFromNamedTensorMap","layerNames","layers_1","nameToWeights","k","name_1","layerWeights","weightValues","weightEntry","loadTensor","symbolicWeights","preprocessWeightsForLoading","loadWeightsFromJson","theConfig","kerasVersion","backend","unused","returnString","modelConfig","tsConfig","pyArray","arrayLength","item","isArrayItemInputOrOutputName","convertTsToPythonic","pyDict","tsKey","tsValue","pyKey","updatedConfig","masks","generic_utils.pyListRepeat","runInternalGraph","layersToOutputShapes","inputShape_1","shapeKey","depthKeys_3","nodes_1","inputShapes_1","j","nodeIndex_2","inputShape_2","outputShapes_1","outputShapeKeys","tensorMap","depthKeys_4","nodes_2","referenceInputTensors","referenceOutputTensors","computedData","referenceInputTensors_1","computedTensors","computedMasks","outputTensors_1","outputMasks_1","computedTensor","computedMask","computeMask","keptNodes","nodeConversionMap","originalNodeIndex","calculateLosses","buildNodeConversionMap","layerConfigs","layerClassName","layerConfig","filteredInboundNodes","nodeData","newNodeIndex","modelInputs","modelOutputs","createdLayers","unprocessedNodes","nodeData_1","inputData","inboundLayerName","inboundNodeIndex","addUnprocessedNode","layerData","layerName","deserializeLayer","inboundNodesData_1","layersFromConfig","layersFromConfig_1","processLayer","generic_utils.isObjectEmpty","layersFromConfig_2","processNode","inputLayersFromConfig_1","layerOutputTensors","outputLayersFromConfig_1","stateful","ModelLoggingVerbosity","feeds","FeedDict","id2Value","feeds_1","feed","cast","assertFeedCompatibility","fetches","feedDict","arrayFetches","fetchArray","internalFeedDict","fetchArray_1","fetch_1","executeInternal","fetch","hasKey","getValue","inputValues","inputs_1","inputVal","layerOutputs","outputTensor","getOutputAt","getNodeOutputs","outputSymbolicTensors","isDataTensor","isDataArray","names","checkBatchAxis","exceptionPrefix","gotUnexpectedData","isDataDict","arrays","names_1","K.expandDims","refDim","batchStart","stop","K.sliceAlongFirstAxis","tfc.tidy","sliceArraysByIndices","K.gather","Model","lineLength","sequentialLike","nodes","nodesByDepth_1","depthNodes","flag","isModelSequentialLike","toDisplay","floor","trainableCount","printLayerSummary","printLayerSummaryWithConnections","checkTrainableWeightsConsistency","collectedTrainableWeights","countParamsInWeights","nonTrainableCount","printSummary","loss","optimizer","optimizerMap","Adagrad","train","adagrad","Adadelta","adadelta","Adam","adam","Adamax","adamax","RMSProp","rmsprop","SGD","sgd","optimizers.getOptimizer","Optimizer","lossFunctions","theLosses","l","losses.get","lossFunction_1","feedOutputShapes","feedLossFns","name_5","skipTargetIndices","metrics","metricsNames","metricsTensors","weightedLoss","nestedMetrics","outputNames_1","outputMetrics","collectMetrics","metricName","accFn","weightedMetricFn","metric","losses.binaryCrossentropy","Metrics.binaryAccuracy","Metrics.binaryCrossentropy","losses.sparseCategoricalCrossentropy","Metrics.sparseCategoricalAccuracy","Metrics.sparseCategoricalCrossentropy","Metrics.categoricalAccuracy","Metrics.categoricalCrossentropy","suffix","metricFn","metricsMap","binaryAccuracy","categoricalAccuracy","Metrics.get","metricResult","outputIndex","metricTensor","appendMetric","metrics_1","handleMetrics","standardizedOuts","standardizeUserData","ins","makeTestFunction","f","testFunction","singletonOrArray","testLoop","verbose","steps","stepsName","numSamples","outputsIsArray","retrieveSymbolicTensors","input","tensorValue","executeOutputs","execute","symbolicTensorNames","pyListRepeat","outputsRemaining","layerOutputNames","remainingNames_1","checkNumSamples","batches","makeBatches","outs","batchIndex","batchOuts","insBatch","sliceArrays","batchOuts_1","batchOut","K.concatAlongFirstAxis","checkInputData","predictLoop","targets","setX","unique","setY","checkArrayLengths","standardizeInputData","lossFns","keyLosses","losses.meanSquaredError","losses.categoricalCrossentropy","slicedYShape","slicedShape","targetDim","outDim","checkLossAndTargetCompatibility","outLabels","epochs","valF","valIns","shuffle","callbackMetrics","initialEpoch","stepsPerEpoch","validationSteps","doValidation","numTrainSamples","indexArray","range","callbackList","stopTraining","epochLogs","epochIndexArray1D_1","batches_1","batchLogs","batchIds","tfc.keep","valOuts","disposeTensorsInLogs","syncData","dedupedOutLabels","newLabel","totalLoss","valOutputs","lossFunction","meanMetric","needValidationDisposal","validationData","valX","valY","valStandardized","validationSplit","splitAt","originalBatchSize","trainFunction","metricsValues","variables","param","minimize","regularizerLoss","getDedupedMetricsNames","valFunction","callbackConfig","standardizeCallbacks","fitLoop","namedWeights","getWeights","handlerOrURL","handlers","io","getSaveHandlers","save","encodeWeights","getNamedWeights","weightDataAndSpecs","unusedArg","toJSON","modelTopology","weightData","weightSpecs","specs","pathOrIOHandler","getLoadHandlers","browserHTTPRequest","handler","load","artifacts","deserialize","pythonicConfig","generic_utils.toCamelCase","tsArray","convertPythonicToTs","tsDict","pythonicKey","pythonicValue","loadWeights","decodeWeights","loadModelFromIOHandler","_updatable","Sequential","modelLayer","isLayerModelInstance","Input","sourceTensors","previousSources_1","getSourceInputs","x_1","lastLayerIndex","getExactlyOneShape","summary","evaluate","predict","predictOnBatch","compile","fit","Activation","Elu","alpha","tfc.elu","K.elu","Selu","tfc.selu","Relu","Relu6","tfc.minimum","Linear","Sigmoid","tfc.sigmoid","HardSigmoid","K.hardSigmoid","Softplus","Softsign","K.softsign","Tanh","tfc.tanh","Softmax","activation","deserializeActivation","DEFAULT_ALPHA","LeakyReLU","getExactlyOneTensor","leakyRelu","baseConfig","ELU","elu","theta","DEFAULT_THETA","thetaTensor","ThresholdedReLU","greater","softmax","softmaxActivation","DEFAULT_AXIS","l1","l2","hasL1","hasL2","L1L2","regularization","sum","abs","asScalar","Regularizer","REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","l1l2","deserializeRegularizer","singleValue","inputLength","filterSize","padding","stride","dilation","outputLength","dimSize","strideSize","kernelSize","tfc.transpose","BaseConv","verifyConfig","normalizeArray","strides","checkPaddingMode","getActivation","useBias","biasInitializer","getInitializer","DEFAULT_BIAS_INITIALIZER","biasConstraint","getConstraint","biasRegularizer","getRegularizer","dilationRate","generic_utils.checkArrayTypeAndLength","serializeActivation","serializeInitializer","serializeRegularizer","serializeConstraint","Conv","filters","kernelInitializer","DEFAULT_KERNEL_INITIALIZER","kernelConstraint","kernelRegularizer","channelAxis","inputDim","kernelShape","kernel","addWeight","biasValue","tfc.conv1d","K.biasAdd","preprocessConv2DInput","tfc.conv2d","conv2dWithBias","newSpace","space","newDim","convOutputLength","Conv2D","InputSpec","Conv2DTranspose","hAxis","wAxis","height","width","kernelH","kernelW","strideH","strideW","deconvLength","tfc.conv2dTranspose","heightAxis","widthAxis","SeparableConv2D","depthMultiplier","depthwiseInitializer","DEFAULT_DEPTHWISE_INITIALIZER","depthwiseRegularizer","depthwiseConstraint","pointwiseInitializer","DEFAULT_POINTWISE_INITIALIZER","pointwiseRegularizer","pointwiseConstraint","SeparableConv","depthwiseKernelShape","pointwiseKernelShape","depthwiseKernel","pointwiseKernel","tfc.separableConv2d","Conv1D","cropping","Cropping2D","K.sliceAlongAxis","DEFAULT_SIZE","UpSampling2D","resized","resizeNearestNeighbor","DepthwiseConv2D","tfc.depthwiseConv2d","rows","cols","outFilters","outRows","outCols","min","rateScalar","Dropout","invokeCallHook","noiseShape_1","getNoiseShape","K.inTrainPhase","K.dropout","units","Dense","inputLastDim","K.dot","Flatten","K.batchFlatten","RepeatVector","tile","expandDims","targetShape","isUnknown","Reshape","errorMsg","finalShape","known","unknown","originalSize","anyUnknownDims","fixUnknownDimension","outputDim","embeddingsInitializer","DEFAULT_EMBEDDINGS_INITIALIZER","embeddingsRegularizer","embeddingsConstraint","maskZero","Embedding","embeddings","inLens","s1","s2","as1D","Merge","shape1","shape2","computeElementwiseOpOutputShape","batchSizes","allRanks","reshapeRequired","reshapedInputs","inputDims","mathUtils.max","xNDim","mergeFunction","transposed","inputs_2","xTransposed","mathUtils.arrayProd","dims","mathUtils.range","yNDim","yShape","Add","tfc.zeros","inputs_3","Multiply","tfc.ones","inputs_4","Average","inputs_5","Maximum","Minimum","Concatenate","allNoneShape","inputShape_3","shapeSet","shapeWithoutConcatAxis","exists","shapeSet_1","K.concatenate","variance","beta","gamma","tfc.batchNormalization2d","tfc.batchNormalization3d","tfc.batchNormalization4d","reductionAxes","math_utils.range","meanAndVariance","tfc.moments","batchNormalization","regularNormalizeBatchInTraining","broadcastMean","broadcastVariance","broadcastGamma","broadcastBeta","broadcastNormalizeBatchInTraining","momentum","center","betaInitializer","gammaInitializer","movingMeanInitializer","movingVarianceInitializer","betaConstraint","gammaConstraint","betaRegularizer","gammaRegularizer","stepCount","BatchNormalization","movingMean","movingVariance","broadcastShape","sortedReductionAxes","needsBroadcasting","broadcastMovingMean","broadcastMovingVariance","normalizeInference","normedTraining","sampleSize","varianceDebiased","newMovingMean","tfc.movingAverage","newMovingVariance","updateMovingMeanAndVariance","heightPadding","widthPadding","ZeroPadding2D","pattern","tfc.pad","poolSize","poolMode","paddingString","tfc.maxPool","tfc.avgPool","Pooling1D","poolingFunction","tfc.squeeze","MaxPooling1D","pool2d","AveragePooling1D","Pooling2D","MaxPooling2D","AveragePooling2D","GlobalPooling1D","GlobalAveragePooling1D","GlobalMaxPooling1D","GlobalPooling2D","GlobalAveragePooling2D","GlobalMaxPooling2D","initialState","constants","numConstants","toListOrNull","stepFunction","initialStates","goBackwards","unroll","lastOutput","tfc.reverse","states","timeSteps","t","currentInput","stepOutputs","cell","StackedRNNCells","cells","stateSize","returnSequences","returnState","stateSpec","RNN","isArrayOfShapes","stateShape","stateSize_1","stepInputShape","expectedShape","standardized","standardizeArgs","additionalInputs","additionalSpecs","initialState_1","state","fullInput","fullInputSpec","originalInputSpec","getInitialState","numStates","cellCallKwargs","rnnOutputs","rnn","K.tile","cellConfig","DEFAULT_ACTIVATION","recurrentInitializer","DEFAULT_RECURRENT_INITIALIZER","recurrentRegularizer","recurrentConstraint","dropout","math_utils.min","math_utils.max","recurrentDropout","dropoutMask","recurrentDropoutMask","SimpleRNNCell","recurrentKernel","prevOutput","h","generateDropoutMask","dpMask","recDpMask","RNNCell","SimpleRNN","tfc.dispose","recurrentActivation","DEFAULT_RECURRENT_ACTIVATION","implementation","GRUCell","hTMinus1","z","r","hh","kernelZ","K.sliceAlongLastAxis","kernelR","recurrentKernelZ","recurrentKernelR","recurrentKernelH","inputsZ","inputsR","inputsH","xZ","xR","xH","biasZ","biasR","biasH","hTMinus1Z","hTMinus1R","hTMinus1H","matrixX","matrixInner","recurrentZ","recurrentR","recurrentH","GRU","unitForgetBias","LSTMCell","capturedBiasInit_1","capturedUnits_1","CustomInit","bI","bF","bCAndH","cTMinus1","c","o","kernelI","kernelF","kernelC","kernelO","recurrentKernelI","recurrentKernelF","recurrentKernelC","recurrentKernelO","inputsI","inputsF","inputsC","inputsO","xI","xF","xC","xO","biasI","biasF","biasC","biasO","hTMinus1I","hTMinus1F","hTMinus1C","hTMinus1O","z0","z1","z2","z3","LSTM","nestedStates","callInputs","newNestedStates","cellStates","cellConfigs","tuples","numParams","inputWeights","droppedInputs","Wrapper","newConfig","TimeDistributed","childInputShape","childOutputShape","timesteps","VALID_BIDIRECTIONAL_MERGE_MODES","forwardLayer","backwardLayer","mergeMode","generic_utils.checkStringTypeUnionValue","_trainable","Bidirectional","numWeights","numeightsOver2","layerShapes","stateSpecs","isSymbolicTensor","additionalInputs_1","yRev","forwardState","backwardState","resetStates","rnnLayer","globalMaxPool1d","globalMaxPooling1d","globalMaxPool2d","globalMaxPooling2d","maxPool1d","maxPooling1d","maxPool2d","maxPooling2d","averagePooling1d","averagePooling2d","metrics.binaryAccuracy","metrics.binaryCrossentropy","metrics.categoricalAccuracy","metrics.categoricalCrossentropy","losses.cosineProximity","losses.meanAbsoluteError","losses.meanAbsolutePercentageError","regularizers.l1","regularizers.l2","Callback","loadModelInternal"],"mappings":";;;;;;;;;;;;;;;;o8DAYA,IAAIA,EAAW,kBAMb,OAAOA,ECGT,IAAIC,EAAsB,eAGxB,OAAOA,IAGT,IAAMC,gBAOiBC,GAKrB,oBALqBA,MACfA,KAAUD,IACdA,EAAaC,GAAU,GAEzBD,EAAaC,IAAW,EACjBA,EAASD,EAAaC,GAAQC,WAGvC,IAAMC,GACJC,WACAC,UAGIC,EAA0B,qBAKNC,EAAeC,GAQvC,YAPcC,IAAVD,IACFA,EAAQF,GAEuB,MAA7BH,EAAYK,GAAOD,KACrBJ,EAAYK,GAAOD,GAASG,SAAOH,EAAOC,GAC1CG,OAAKR,EAAYK,GAAOD,KAEnBJ,EAAYK,GAAOD,GCpC5B,kBACE,WAAYK,GAAZ,MACEC,YAAMD,gBAENE,OAAOC,eAAeC,EAAMC,EAAeC,aAE/C,OANoCC,UAAAC,qBAYlC,WAAYR,GAAZ,MACEC,YAAMD,gBAENE,OAAOC,eAAeC,EAAMK,EAAaH,aAE7C,OANkCC,UAAAC,qBAYhC,WAAYR,GAAZ,MACEC,YAAMD,gBAENE,OAAOC,eAAeC,EAAMM,EAAWJ,aAE3C,OANgCC,UAAAC,qBAY9B,WAAYR,GAAZ,MACEC,YAAMD,gBAENE,OAAOC,eAAeC,EAAMO,EAAoBL,aAEpD,OANyCC,UAAAC,qBAYvC,WAAYR,GAAZ,MACEC,YAAMD,gBAENE,OAAOC,eAAeC,EAAMQ,EAAeN,aAE/C,OANoCC,UAAAC,oBAYlC,WAAYR,GAAZ,M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C,0CC/FnBna,GACnB,OAAO,IAAIs+B,GAAKt+B,gBAWCA,GACjB,gBd0EiBA,GACjB,OAAO,IAAIs+B,IAAMJ,GAAc,MAAVl+B,EAAiBA,EAAOk+B,GAAK,KAAMC,GAAI,Ic3ErD2b,CAAgB95C,gBAWNA,GACjB,gBdyEiBA,GACjB,OAAO,IAAIs+B,IAAMH,GAAc,MAAVn+B,EAAiBA,EAAOm+B,GAAK,KAAMD,GAAI,Ic1ErD6b,CAAgB/5C,qBC9BzB,aAAA,qDAEEvC,QAAe,OAQjB,OAVuCG,OAIrCo8C,qBAAA,SAASniC,GACP,KAAMA,aAAiB4V,IACrB,MAAM,IAAI5vB,MAAM,mDAElBmG,KAAK6T,MAAQA,MARsBH,oMlBmIbgiB,GAExB,OAAOugB,GAAkBvgB,qBA7EL15B,GACpB,OAAO,IAAIytB,GAAMztB,0BA+DQA,GACzB,OAAO,IAAI46B,GAAW56B,iEmBtIR"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/types.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/types.d.ts new file mode 100644 index 0000000..ef6b29b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/types.d.ts @@ -0,0 +1,20 @@ +import { Scalar, Tensor } from '@tensorflow/tfjs-core'; +export declare type Shape = number[]; +export declare type HasShape = { + shape: Shape; +}; +export declare type LossOrMetricFn = (yTrue: Tensor, yPred: Tensor) => Tensor; +export declare type RegularizerFn = () => Scalar; +export declare type RnnStepFunction = (inputs: Tensor, states: Tensor[]) => [Tensor, Tensor[]]; +export declare type NamedTensorMap = { + [name: string]: Tensor; +}; +export declare type JsonValue = boolean | number | string | null | JsonArray | JsonDict; +export interface JsonDict { + [key: string]: JsonValue; +} +export interface JsonArray extends Array { +} +export declare type Kwargs = { + [key: string]: any; +}; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/types.js b/node_modules/@tensorflow/tfjs-layers/dist/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/types.js.map b/node_modules/@tensorflow/tfjs-layers/dist/types.js.map new file mode 100644 index 0000000..c768b79 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/types_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/types_test.js.map new file mode 100644 index 0000000..72e11c6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/types_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types_test.js","sourceRoot":"","sources":["../src/types_test.ts"],"names":[],"mappings":";;AAgBA,8CAAiD;AAOjD,QAAQ,CAAC,qBAAqB,EAAE;IAC9B,EAAE,CAAC,oCAAoC,EAAE;QACvC,IAAM,GAAG,GAAG,IAAI,yBAAc,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAChE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,mCAAmC,EAAE;QACtC,IAAM,MAAM,GAAG,IAAI,yBAAc,CAAC,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,C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C,MAAM,CAAC,cAAM,OAAA,IAAI,yBAAc,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,EAAxD,CAAwD,CAAC;aACjE,YAAY,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.d.ts new file mode 100644 index 0000000..79154a5 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.d.ts @@ -0,0 +1,4 @@ +import { PaddingMode } from '../common'; +export declare function normalizeArray(value: number | number[], n: number, name: string): number[]; +export declare function convOutputLength(inputLength: number, filterSize: number, padding: PaddingMode, stride: number, dilation?: number): number; +export declare function deconvLength(dimSize: number, strideSize: number, kernelSize: number, padding: PaddingMode): number; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js b/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js new file mode 100644 index 0000000..813d399 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var errors_1 = require("../errors"); +var generic_utils_1 = require("./generic_utils"); +var math_utils_1 = require("./math_utils"); +function normalizeArray(value, n, name) { + if (typeof value === 'number') { + return generic_utils_1.pyListRepeat(value, n); + } + else { + if (value.length !== n) { + throw new errors_1.ValueError("The " + name + " argument must be a tuple of " + n + " integers. Received: " + + (value.length + " elements.")); + } + for (var i = 0; i < n; ++i) { + var singleValue = value[i]; + if (!math_utils_1.isInteger(singleValue)) { + throw new errors_1.ValueError("The " + name + " argument must be a tuple of " + n + " integers. Received: " + + (JSON.stringify(value) + " including a non-integer number ") + + ("" + singleValue)); + } + } + return value; + } +} +exports.normalizeArray = normalizeArray; +function convOutputLength(inputLength, filterSize, padding, stride, dilation) { + if (dilation === void 0) { dilation = 1; } + if (inputLength == null) { + return inputLength; + } + var dilatedFilterSize = filterSize + (filterSize - 1) * (dilation - 1); + var outputLength; + if (padding === 'same') { + outputLength = inputLength; + } + else { + outputLength = inputLength - dilatedFilterSize + 1; + } + return Math.floor((outputLength + stride - 1) / stride); +} +exports.convOutputLength = convOutputLength; +function deconvLength(dimSize, strideSize, kernelSize, padding) { + if (dimSize == null) { + return null; + } + if (padding === 'valid') { + dimSize = dimSize * strideSize + math_utils_1.max([kernelSize - strideSize, 0]); + } + else if (padding === 'same') { + dimSize = dimSize * strideSize; + } + else { + throw new errors_1.ValueError("Unsupport padding mode: " + padding + "."); + } + return dimSize; +} +exports.deconvLength = deconvLength; +//# sourceMappingURL=conv_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js.map new file mode 100644 index 0000000..837b5e8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/conv_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"conv_utils.js","sourceRoot":"","sources":["../../src/utils/conv_utils.ts"],"names":[],"mappings":";;AAWA,oCAAqC;AAErC,iDAA6C;AAC7C,2CAA4C;AAS5C,wBACI,KAAsB,EAAE,CAAS,EAAE,IAAY;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,4BAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KAC/B;SAAM;QACL,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,MAAM,IAAI,mBAAU,CAChB,SAAO,IAAI,qCAAgC,CAAC,0BAAuB;iBAChE,KAAK,CAAC,MAAM,eAAY,CAAA,CAAC,CAAC;SAClC;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,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AO,GAAG,OAAO,GAAG,UAAU,CAAC;KAChC;SAAM;QACL,MAAM,IAAI,mBAAU,CAAC,6BAA2B,OAAO,MAAG,CAAC,CAAC;KAC7D;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAfD,oCAeC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.d.ts new file mode 100644 index 0000000..b1cd358 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.d.ts @@ -0,0 +1,23 @@ +import { DataType, serialization } from '@tensorflow/tfjs-core'; +export declare function pyListRepeat(value: any, numValues: number): any[]; +export declare function assert(val: boolean, message?: string): void; +export declare function count(array: T[], refernce: T): number; +export declare function singletonOrArray(xs: T[]): T | T[]; +export declare function toList(x: any): any[]; +export declare function objectListUid(objs: any | any[]): string; +export declare function toSnakeCase(name: string): string; +export declare function toCamelCase(identifier: string): string; +export declare function serializeKerasObject(instance: serialization.Serializable): serialization.ConfigDictValue; +export declare function deserializeKerasObject(identifier: string | serialization.ConfigDict, moduleObjects?: { + [objName: string]: any; +}, customObjects?: { + [objName: string]: any; +}, printableModuleName?: string): any; +export declare function numberCompare(a: number, b: number): 0 | 1 | -1; +export declare function reverseNumberCompare(a: number, b: number): number; +export declare function stringToDType(dtype: string): DataType; +export declare function stringsEqual(xs: string[], ys: string[]): boolean; +export declare function unique(xs: T[]): T[]; +export declare function isObjectEmpty(obj: {}): boolean; +export declare function checkStringTypeUnionValue(values: string[], label: string, value: string): void; +export declare function checkArrayTypeAndLength(x: any, expectedType: string, minLength?: number, maxLength?: number): boolean; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js b/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js new file mode 100644 index 0000000..491fa95 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js @@ -0,0 +1,254 @@ +"use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var errors_1 = require("../errors"); +function pyListRepeat(value, numValues) { + if (Array.isArray(value)) { + var newArray = []; + for (var i = 0; i < numValues; i++) { + newArray = newArray.concat(value); + } + return newArray; + } + else { + var newArray = new Array(numValues); + newArray.fill(value); + return newArray; + } +} +exports.pyListRepeat = pyListRepeat; +function assert(val, message) { + if (!val) { + throw new errors_1.AssertionError(message); + } +} +exports.assert = assert; +function count(array, refernce) { + var counter = 0; + for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { + var item = array_1[_i]; + if (item === refernce) { + counter++; + } + } + return counter; +} +exports.count = count; +function singletonOrArray(xs) { + if (xs.length === 1) { + return xs[0]; + } + return xs; +} +exports.singletonOrArray = singletonOrArray; +function toList(x) { + if (Array.isArray(x)) { + return x; + } + return [x]; +} +exports.toList = toList; +function objectListUid(objs) { + var objectList = toList(objs); + var retVal = ''; + for (var _i = 0, objectList_1 = objectList; _i < objectList_1.length; _i++) { + var obj = objectList_1[_i]; + if (obj.id == null) { + throw new errors_1.ValueError("Object " + obj + " passed to objectListUid without an id"); + } + if (retVal !== '') { + retVal = retVal + ', '; + } + retVal = retVal + Math.abs(obj.id); + } + return retVal; +} +exports.objectListUid = objectListUid; +function toSnakeCase(name) { + var intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2'); + var insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(); + if (insecure[0] !== '_') { + return insecure; + } + return 'private' + insecure; +} +exports.toSnakeCase = toSnakeCase; +function toCamelCase(identifier) { + if (identifier.length <= 1) { + return identifier; + } + if (identifier.indexOf('_') === -1) { + return identifier; + } + return identifier.replace(/[_]+(\w|$)/g, function (m, p1) { return p1.toUpperCase(); }); +} +exports.toCamelCase = toCamelCase; +var _GLOBAL_CUSTOM_OBJECTS = {}; +function serializeKerasObject(instance) { + if (instance === null || instance === undefined) { + return null; + } + return { className: instance.getClassName(), config: instance.getConfig() }; +} +exports.serializeKerasObject = serializeKerasObject; +function deserializeKerasObject(identifier, moduleObjects, customObjects, printableModuleName) { + if (moduleObjects === void 0) { moduleObjects = {}; } + if (customObjects === void 0) { customObjects = {}; } + if (printableModuleName === void 0) { printableModuleName = 'object'; } + if (typeof identifier === 'string') { + var functionName = identifier; + var fn = void 0; + if (functionName in customObjects) { + fn = customObjects[functionName]; + } + else if (functionName in _GLOBAL_CUSTOM_OBJECTS) { + fn = _GLOBAL_CUSTOM_OBJECTS[functionName]; + } + else { + fn = moduleObjects[functionName]; + if (fn == null) { + throw new errors_1.ValueError("Unknown " + printableModuleName + ": " + identifier); + } + } + return fn; + } + else { + var config = identifier; + if (config.className == null || config.config == null) { + throw new errors_1.ValueError(printableModuleName + ": Improper config format: " + + (JSON.stringify(config) + ".\n") + + "'className' and 'config' must set."); + } + var className = config.className; + var cls = void 0, fromConfig = void 0; + if (className in customObjects) { + _a = customObjects.get(className), cls = _a[0], fromConfig = _a[1]; + } + else if (className in _GLOBAL_CUSTOM_OBJECTS) { + _b = _GLOBAL_CUSTOM_OBJECTS.className, cls = _b[0], fromConfig = _b[1]; + } + else if (className in moduleObjects) { + _c = moduleObjects[className], cls = _c[0], fromConfig = _c[1]; + } + if (cls == null) { + throw new errors_1.ValueError("Unknown " + printableModuleName + ": " + className); + } + if (fromConfig != null) { + var customObjectsCombined = {}; + for (var _i = 0, _d = Object.keys(_GLOBAL_CUSTOM_OBJECTS); _i < _d.length; _i++) { + var key = _d[_i]; + customObjectsCombined[key] = _GLOBAL_CUSTOM_OBJECTS[key]; + } + for (var _e = 0, _f = Object.keys(customObjects); _e < _f.length; _e++) { + var key = _f[_e]; + customObjectsCombined[key] = customObjects[key]; + } + var nestedConfig = config.config; + nestedConfig.customObjects = customObjectsCombined; + var backupCustomObjects = __assign({}, _GLOBAL_CUSTOM_OBJECTS); + for (var _g = 0, _h = Object.keys(customObjects); _g < _h.length; _g++) { + var key = _h[_g]; + _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; + } + var returnObj = fromConfig(cls, config.config); + _GLOBAL_CUSTOM_OBJECTS = __assign({}, backupCustomObjects); + return returnObj; + } + else { + var backupCustomObjects = __assign({}, _GLOBAL_CUSTOM_OBJECTS); + for (var _j = 0, _k = Object.keys(customObjects); _j < _k.length; _j++) { + var key = _k[_j]; + _GLOBAL_CUSTOM_OBJECTS[key] = customObjects[key]; + } + var returnObj = new cls(config.config); + _GLOBAL_CUSTOM_OBJECTS = __assign({}, backupCustomObjects); + return returnObj; + } + } + var _a, _b, _c; +} +exports.deserializeKerasObject = deserializeKerasObject; +function numberCompare(a, b) { + return (a < b) ? -1 : ((a > b) ? 1 : 0); +} +exports.numberCompare = numberCompare; +function reverseNumberCompare(a, b) { + return -1 * numberCompare(a, b); +} +exports.reverseNumberCompare = reverseNumberCompare; +function stringToDType(dtype) { + switch (dtype) { + case 'float32': + return 'float32'; + default: + throw new errors_1.ValueError("Invalid dtype: " + dtype); + } +} +exports.stringToDType = stringToDType; +function stringsEqual(xs, ys) { + if (xs == null || ys == null) { + return xs === ys; + } + if (xs.length !== ys.length) { + return false; + } + for (var i = 0; i < xs.length; ++i) { + if (xs[i] !== ys[i]) { + return false; + } + } + return true; +} +exports.stringsEqual = stringsEqual; +function unique(xs) { + if (xs == null) { + return xs; + } + var out = []; + for (var _i = 0, xs_1 = xs; _i < xs_1.length; _i++) { + var x = xs_1[_i]; + if (out.indexOf(x) === -1) { + out.push(x); + } + } + return out; +} +exports.unique = unique; +function isObjectEmpty(obj) { + if (obj == null) { + throw new errors_1.ValueError("Invalid value in obj: " + JSON.stringify(obj)); + } + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + return false; + } + } + return true; +} +exports.isObjectEmpty = isObjectEmpty; +function checkStringTypeUnionValue(values, label, value) { + if (value == null) { + return; + } + if (values.indexOf(value) < 0) { + throw new errors_1.ValueError(value + " is not a valid " + label + ". Valid values are " + values + " or null/undefined."); + } +} +exports.checkStringTypeUnionValue = checkStringTypeUnionValue; +function checkArrayTypeAndLength(x, expectedType, minLength, maxLength) { + if (minLength === void 0) { minLength = 0; } + if (maxLength === void 0) { maxLength = Infinity; } + assert(minLength >= 0); + assert(maxLength >= minLength); + return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength && + x.every(function (e) { return typeof e === expectedType; })); +} +exports.checkArrayTypeAndLength = checkArrayTypeAndLength; +//# sourceMappingURL=generic_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js.map new file mode 100644 index 0000000..17ec9a2 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"generic_utils.js","sourceRoot":"","sources":["../../src/utils/generic_utils.ts"],"names":[],"mappings":";;;;;;;;;;AAeA,oCAAqD;AAQrD,sBAA6B,KAAU,EAAE,SAAiB;IACxD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAExB,IAAI,QAAQ,GAAU,EAAE,CAAC;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YAClC,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACnC;QACD,OAAO,QAAQ,CAAC;KACjB;SAAM;QACL,IAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,QAAQ,CAAC;KACjB;AACH,CAAC;AAbD,oCAaC;AAED,gBAAuB,GAAY,EAAE,OAAgB;IACnD,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,I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AC,IAAI,OAAA,OAAO,CAAC,KAAK,YAAY,EAAzB,CAAyB,CAAC,CAAC,CAAC;AAC/C,CAAC;AARD,0DAQC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils_test.js.map new file mode 100644 index 0000000..4f4bfac --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/generic_utils_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"generic_utils_test.js","sourceRoot":"","sources":["../../src/utils/generic_utils_test.ts"],"names":[],"mappings":";;AAUA,uCAAyC;AAEzC,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,wCAAwC,EAAE;QAC3C,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE;QAClD,IAAM,KAAK,GAAG,GAAG,CAAC;QAClB,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE;QACnD,IAAM,KAAK,GAAG,GAAG,CAAC;QAClB,IAAM,SAAS,GAAG,CAAC,CAAC;QACpB,IAAM,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC5C,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE;QAC1C,IAAM,MAAM,GAAG,cAAM,OAAA,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,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,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;aACjE,OAAO,CAAC,KAAK,CAAC,CAAC;QAEpB,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;aAClE,OAAO,CAAC,KAAK,CAAC,CAAC;QAEpB,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;aAC7D,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gCAAgC,EAAE;QACnC,MAAM,CAAC,cAAM,OAAA,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAtD,CAAsD,CAAC;aAC/D,YAAY,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,+BAA+B,EAAE;QAClC,MAAM,CAAC,cAAM,OAAA,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAA1D,CAA0D,CAAC;aACnE,YAAY,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.d.ts new file mode 100644 index 0000000..fa42483 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.d.ts @@ -0,0 +1,2 @@ +import { Container } from '../engine/container'; +export declare function printSummary(model: Container, lineLength?: number, positions?: number[], printFn?: (message?: any, ...optionalParams: any[]) => void): void; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js b/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js new file mode 100644 index 0000000..2ee52cb --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var variable_utils_1 = require("./variable_utils"); +function printSummary(model, lineLength, positions, printFn) { + if (printFn === void 0) { printFn = console.log; } + var sequentialLike = isModelSequentialLike(model); + var toDisplay = ['Layer (type)', 'Output shape', 'Param #']; + if (sequentialLike) { + lineLength = lineLength || 65; + positions = positions || [0.45, 0.85, 1]; + } + else { + lineLength = lineLength || 98; + positions = positions || [0.33, 0.55, 0.67, 1]; + } + if (positions[positions.length - 1] <= 1) { + positions = positions.map(function (p) { return Math.floor(lineLength * p); }); + } + var relevantNodes; + if (!sequentialLike) { + toDisplay.push('Receives inputs'); + relevantNodes = []; + for (var depth in model.nodesByDepth) { + relevantNodes.push.apply(relevantNodes, model.nodesByDepth[depth]); + } + } + printFn('_'.repeat(lineLength)); + printRow(toDisplay, positions, printFn); + printFn('='.repeat(lineLength)); + var layers = model.layers; + for (var i = 0; i < layers.length; ++i) { + if (sequentialLike) { + printLayerSummary(layers[i], positions, printFn); + } + else { + printLayerSummaryWithConnections(layers[i], positions, relevantNodes, printFn); + } + printFn((i === layers.length - 1 ? '=' : '_').repeat(lineLength)); + } + model.checkTrainableWeightsConsistency(); + var trainableCount; + if (model.collectedTrainableWeights != null) { + trainableCount = + variable_utils_1.countParamsInWeights(model.collectedTrainableWeights); + } + else { + trainableCount = variable_utils_1.countParamsInWeights(model.trainableWeights); + } + var nonTrainableCount = variable_utils_1.countParamsInWeights(model.nonTrainableWeights); + printFn("Total params: " + (trainableCount + nonTrainableCount)); + printFn("Trainable params: " + trainableCount); + printFn("Non-trainable params: " + nonTrainableCount); + printFn('_'.repeat(lineLength)); +} +exports.printSummary = printSummary; +function isModelSequentialLike(model) { + var sequentialLike = true; + var nodesByDepth = []; + var nodes = []; + for (var depth in model.nodesByDepth) { + nodesByDepth.push(model.nodesByDepth[depth]); + } + for (var _i = 0, nodesByDepth_1 = nodesByDepth; _i < nodesByDepth_1.length; _i++) { + var depthNodes = nodesByDepth_1[_i]; + if (depthNodes.length > 1 || + depthNodes.length === 1 && depthNodes[0].inboundLayers.length > 1) { + sequentialLike = false; + break; + } + nodes.push.apply(nodes, depthNodes); + } + if (sequentialLike) { + for (var _a = 0, _b = model.layers; _a < _b.length; _a++) { + var layer = _b[_a]; + var flag = false; + for (var _c = 0, _d = layer.inboundNodes; _c < _d.length; _c++) { + var node = _d[_c]; + if (nodes.indexOf(node) !== -1) { + if (flag) { + sequentialLike = false; + break; + } + else { + flag = true; + } + } + } + if (!sequentialLike) { + break; + } + } + } + return sequentialLike; +} +function printRow(fields, positions, printFn) { + if (printFn === void 0) { printFn = console.log; } + var line = ''; + for (var i = 0; i < fields.length; ++i) { + if (i > 0) { + line = line.slice(0, line.length - 1) + ' '; + } + line += fields[i]; + line = line.slice(0, positions[i]); + line += ' '.repeat(positions[i] - line.length); + } + printFn(line); +} +function printLayerSummary(layer, positions, printFn) { + var outputShape; + try { + outputShape = JSON.stringify(layer.outputShape); + } + catch (err) { + outputShape = 'multiple'; + } + var name = layer.name; + var className = layer.getClassName(); + var fields = [name + " (" + className + ")", outputShape, layer.countParams().toString()]; + printRow(fields, positions, printFn); +} +function printLayerSummaryWithConnections(layer, positions, relevantNodes, printFn) { + var outputShape; + try { + outputShape = JSON.stringify(layer.outputShape); + } + catch (err) { + outputShape = 'multiple'; + } + var connections = []; + for (var _i = 0, _a = layer.inboundNodes; _i < _a.length; _i++) { + var node = _a[_i]; + if (relevantNodes != null && relevantNodes.length > 0 && + relevantNodes.indexOf(node) === -1) { + continue; + } + for (var i = 0; i < node.inboundLayers.length; ++i) { + var inboundLayer = node.inboundLayers[i].name; + var inboundLayerIndex = node.nodeIndices[i]; + var inboundTensorIndex = node.tensorIndices[i]; + connections.push(inboundLayer + "[" + inboundLayerIndex + "][" + inboundTensorIndex + "]"); + } + } + var name = layer.name; + var className = layer.getClassName(); + var firstConnection = connections.length === 0 ? '' : connections[0]; + var fields = [ + name + " (" + className + ")", outputShape, layer.countParams().toString(), + firstConnection + ]; + printRow(fields, positions, printFn); + for (var i = 1; i < connections.length; ++i) { + printRow(['', '', '', connections[i]], positions, printFn); + } +} +//# sourceMappingURL=layer_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js.map new file mode 100644 index 0000000..eab0d8b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/layer_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"layer_utils.js","sourceRoot":"","sources":["../../src/utils/layer_utils.ts"],"names":[],"mappings":";;AAYA,mDAAsD;AAiBtD,sBACI,KAAgB,EAAE,UAAmB,EAAE,SAAoB,EAE3D,OACe;IADf,wBAAA,EAAA,UACI,OAAO,CAAC,GAAG;IACjB,IAAM,cAAc,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAGpD,IAAM,SAAS,GAAa,CAAC,cAAc,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IACxE,IAAI,cAAc,EAAE;QAClB,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;QAC9B,SAAS,GAAG,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;KAC1C;SAAM;QACL,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;QAC9B,SAAS,GAAG,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;KAEhD;IAED,IAAI,SAAS,CAAC,SAAS,CAAC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C;YAC9C,IAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YACjD,WAAW,CAAC,IAAI,CACT,YAAY,SAAI,iBAAiB,UAAK,kBAAkB,MAAG,CAAC,CAAC;SACrE;KACF;IACD,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,IAAM,SAAS,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;IACvC,IAAM,eAAe,GAAG,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACvE,IAAM,MAAM,GAAa;QACpB,IAAI,UAAK,SAAS,MAAG,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACrE,eAAe;KAChB,CAAC;IAEF,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QAC3C,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;KAC5D;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.d.ts new file mode 100644 index 0000000..656534c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.d.ts @@ -0,0 +1,10 @@ +export declare type ArrayTypes = Uint8Array | Int32Array | Float32Array; +export declare function isInteger(x: number): boolean; +export declare function arrayProd(array: number[] | ArrayTypes, begin?: number, end?: number): number; +export declare function min(array: number[] | Float32Array): number; +export declare function max(array: number[] | Float32Array): number; +export declare function sum(array: number[] | Float32Array): number; +export declare function mean(array: number[] | Float32Array): number; +export declare function variance(array: number[] | Float32Array): number; +export declare function median(array: number[] | Float32Array): number; +export declare function range(begin: number, end: number): number[]; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js b/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js new file mode 100644 index 0000000..75f8e74 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var errors_1 = require("../errors"); +function isInteger(x) { + return x === parseInt(x.toString(), 10); +} +exports.isInteger = isInteger; +function arrayProd(array, begin, end) { + if (begin == null) { + begin = 0; + } + if (end == null) { + end = array.length; + } + var prod = 1; + for (var i = begin; i < end; ++i) { + prod *= array[i]; + } + return prod; +} +exports.arrayProd = arrayProd; +function toArray1D(array) { + array = Array.isArray(array) ? new Float32Array(array) : array; + return tfjs_core_1.tensor1d(array); +} +function min(array) { + return tfc.min(toArray1D(array)).dataSync()[0]; +} +exports.min = min; +function max(array) { + return tfc.max(toArray1D(array)).dataSync()[0]; +} +exports.max = max; +function sum(array) { + return tfc.sum(toArray1D(array)).dataSync()[0]; +} +exports.sum = sum; +function mean(array) { + return sum(array) / array.length; +} +exports.mean = mean; +function variance(array) { + var demeaned = tfc.sub(toArray1D(array), tfjs_core_1.scalar(mean(array))); + var sumSquare = tfc.sum(tfc.mulStrict(demeaned, demeaned)).dataSync()[0]; + return sumSquare / array.length; +} +exports.variance = variance; +function median(array) { + var arraySorted = array.slice().sort(function (a, b) { return a - b; }); + var lowIdx = Math.floor((arraySorted.length - 1) / 2); + var highIdx = Math.ceil((arraySorted.length - 1) / 2); + if (lowIdx === highIdx) { + return arraySorted[lowIdx]; + } + return (arraySorted[lowIdx] + arraySorted[highIdx]) / 2; +} +exports.median = median; +function range(begin, end) { + if (end < begin) { + throw new errors_1.ValueError("end (" + end + ") < begin (" + begin + ") is forbidden."); + } + var out = []; + for (var i = begin; i < end; ++i) { + out.push(i); + } + return out; +} +exports.range = range; +//# sourceMappingURL=math_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js.map new file mode 100644 index 0000000..7c2930b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"math_utils.js","sourceRoot":"","sources":["../../src/utils/math_utils.ts"],"names":[],"mappings":";;AAqBA,2CAA6C;AAC7C,mDAAiE;AACjE,oCAAqC;AAOrC,mBAA0B,CAAS;IACjC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC;AAFD,8BAEC;AASD,mBACI,KAA0B,EAAE,KAAc,EAAE,GAAY;IAC1D,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,KAAK,GAAG,CAAC,CAAC;KACX;IACD,IAAI,GAAG,IAAI,IAAI,EAAE;QACf,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;KACpB;IAED,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;QAChC,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;KAClB;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAdD,8BAcC;AAOD,mBAAmB,KAA4B;IAC7C,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC/D,OAAO,oBAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAOD,aAAoB,KAA4B;IAC9C,OAAO,GAAG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,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,IAAI,MAAM,KAAK,OAAO,EAAE;QACtB,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;KAC5B;IACD,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AARD,wBAQC;AASD,eAAsB,KAAa,EAAE,GAAW;IAC9C,IAAI,GAAG,GAAG,KAAK,EAAE;QACf,MAAM,IAAI,mBAAU,CAAC,UAAQ,GAAG,mBAAc,KAAK,oBAAiB,CAAC,CAAC;KACvE;IACD,IAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;QAChC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACb;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AATD,sBASC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils_test.js.map new file mode 100644 index 0000000..ac1cf11 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/math_utils_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"math_utils_test.js","sourceRoot":"","sources":["../../src/utils/math_utils_test.ts"],"names":[],"mappings":";;AAcA,kEAAuE;AAEvE,yCAA2C;AAC3C,2CAA6C;AAE7C,QAAQ,CAAC,WAAW,EAAE;IACpB,EAAE,CAAC,YAAY,EAAE;QACf,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,I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EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC3C,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,0BAA0B,EAAE;QAC7B,MAAM,CAAC,cAAM,OAAA,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAvB,CAAuB,CAAC,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.d.ts new file mode 100644 index 0000000..3e9b076 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.d.ts @@ -0,0 +1,4 @@ +import { serialization } from '@tensorflow/tfjs-core'; +import { JsonValue } from '../types'; +export declare function convertPythonicToTs(pythonicConfig: JsonValue, key?: string): serialization.ConfigDictValue; +export declare function convertTsToPythonic(tsConfig: serialization.ConfigDictValue, key?: string): JsonValue; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js b/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js new file mode 100644 index 0000000..632a7b4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var generic_utils = require("../utils/generic_utils"); +function isArrayItemInputOrOutputName(key, index, value) { + return (key === 'inboundNodes' || key === 'outputLayers' || + key === 'inputLayers') && + index === 0 && typeof value === 'string'; +} +function convertPythonicToTs(pythonicConfig, key) { + if (pythonicConfig === null) { + return null; + } + else if (typeof pythonicConfig === 'string') { + return generic_utils.toCamelCase(pythonicConfig); + } + else if ((typeof pythonicConfig === 'number') || + (typeof pythonicConfig === 'boolean')) { + return pythonicConfig; + } + else if (pythonicConfig instanceof Array) { + var tsArray = []; + var arrayLength = pythonicConfig.length; + for (var i = 0; i < arrayLength; ++i) { + var item = pythonicConfig[i]; + if (isArrayItemInputOrOutputName(key, i, item)) { + tsArray.push(item); + } + else { + tsArray.push(convertPythonicToTs(item, key)); + } + } + return tsArray; + } + else { + var tsDict = {}; + for (var _i = 0, _a = Object.keys(pythonicConfig); _i < _a.length; _i++) { + var pythonicKey = _a[_i]; + var pythonicValue = pythonicConfig[pythonicKey]; + if (pythonicKey === 'name' && typeof pythonicValue === 'string') { + tsDict[pythonicKey] = pythonicValue; + } + else { + var tsKey = generic_utils.toCamelCase(pythonicKey); + tsDict[tsKey] = convertPythonicToTs(pythonicValue, tsKey); + } + } + return tsDict; + } +} +exports.convertPythonicToTs = convertPythonicToTs; +function convertTsToPythonic(tsConfig, key) { + if (tsConfig === null || tsConfig === undefined) { + return null; + } + else if (typeof tsConfig === 'string') { + return generic_utils.toSnakeCase(tsConfig); + } + else if ((typeof tsConfig === 'number') || (typeof tsConfig === 'boolean')) { + return tsConfig; + } + else if (tsConfig instanceof Array) { + var pyArray = []; + var arrayLength = tsConfig.length; + for (var i = 0; i < arrayLength; ++i) { + var item = tsConfig[i]; + if (isArrayItemInputOrOutputName(key, i, item)) { + pyArray.push(item); + } + else { + pyArray.push(convertTsToPythonic(item, key)); + } + } + return pyArray; + } + else { + var pyDict = {}; + for (var _i = 0, _a = Object.keys(tsConfig); _i < _a.length; _i++) { + var tsKey = _a[_i]; + var tsValue = tsConfig[tsKey]; + var pyKey = generic_utils.toSnakeCase(tsKey); + if ((tsKey === 'name' || tsKey === 'className') && + typeof tsValue === 'string') { + pyDict[pyKey] = tsValue; + } + else { + pyDict[pyKey] = convertTsToPythonic(tsValue, tsKey); + } + } + return pyDict; + } +} +exports.convertTsToPythonic = convertTsToPythonic; +//# sourceMappingURL=serialization_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js.map new file mode 100644 index 0000000..85d6fe4 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serialization_utils.js","sourceRoot":"","sources":["../../src/utils/serialization_utils.ts"],"names":[],"mappings":";;AAmBA,sDAAwD;AAYxD,sCACI,GAAW,EAAE,KAAa,EAAE,KAAQ;IACtC,OAAO,CAAC,GAAG,KAAK,cAAc,IAAI,GAAG,KAAK,cAAc;QAChD,GAAG,KAAK,aAAa,CAAC;QAC1B,KAAK,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AAC/C,CAAC;AAQD,6BACI,cAAyB,EAAE,GAAY;IACzC,IAAI,cAAc,KAAK,IAAI,EAAE;QAC3B,OAAO,IAAI,CAAC;KACb;SAAM,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QAC7C,OAAO,aAAa,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;KAClD;SAAM,IACH,CAAC,OAAO,cAAc,KAAK,QAAQ,CAAC;QACpC,CAAC,OAAO,cAAc,KAAK,SAAS,CAAC,EAAE;QACzC,OAAO,cAAc,CAAC;KACvB;SAAM,IAAI,cAAc,YAAY,KAAK,EAAE;QAC1C,IAAM,OAAO,GAAG,EAAE,CAAC;QACnB,IAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC;QAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,EAAE,CAAC,EAAE;YACpC,IAAM,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,4BAA4B,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE;gBAC9C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC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E,CAAC,GAAG,WAAW,EAAE,EAAE,CAAC,EAAE;YACpC,IAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACzB,IAAI,4BAA4B,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE;gBAC9C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACpB;iBAAM;gBACL,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;aAC9C;SACF;QACD,OAAO,OAAO,CAAC;KAChB;SAAM;QACL,IAAM,MAAM,GAA6B,EAAE,CAAC;QAC5C,KAAoB,UAAqB,EAArB,KAAA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAArB,cAAqB,EAArB,IAAqB;YAApC,IAAM,KAAK,SAAA;YACd,IAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChC,IAAM,KAAK,GAAG,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAC/C,IAAI,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,WAAW,CAAC;gBAC3C,OAAO,OAAO,KAAK,QAAQ,EAAE;gBAI/B,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;aACzB;iBAAM;gBACL,MAAM,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;aACrD;SACF;QACD,OAAO,MAAM,CAAC;KACf;AACH,CAAC;AAtCD,kDAsCC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils_test.js.map new file mode 100644 index 0000000..252121b --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/serialization_utils_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serialization_utils_test.js","sourceRoot":"","sources":["../../src/utils/serialization_utils_test.ts"],"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AC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.d.ts new file mode 100644 index 0000000..73eff56 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.d.ts @@ -0,0 +1,7 @@ +import { Tensor } from '@tensorflow/tfjs-core'; +export declare function expectTensorsClose(actual: Tensor | number[], expected: Tensor | number[], epsilon?: number): void; +export declare function expectTensorsValuesInRange(actual: Tensor, low: number, high: number): void; +export declare function describeMathCPUAndGPU(testName: string, tests: () => void): void; +export declare function describeMathCPU(testName: string, tests: () => void): void; +export declare function describeMathGPU(testName: string, tests: () => void): void; +export declare function expectNoLeakedTensors(testFunc: () => any, numNewTensors: number): void; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js b/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js new file mode 100644 index 0000000..1439838 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var jasmine_util_1 = require("@tensorflow/tfjs-core/dist/jasmine_util"); +var state_1 = require("../backend/state"); +var errors_1 = require("../errors"); +function expectTensorsClose(actual, expected, epsilon) { + if (actual == null) { + throw new errors_1.ValueError('First argument to expectTensorsClose() is not defined.'); + } + if (expected == null) { + throw new errors_1.ValueError('Second argument to expectTensorsClose() is not defined.'); + } + tfjs_core_1.test_util.expectArraysClose(actual, expected, epsilon); +} +exports.expectTensorsClose = expectTensorsClose; +function expectTensorsValuesInRange(actual, low, high) { + if (actual == null) { + throw new errors_1.ValueError('First argument to expectTensorsClose() is not defined.'); + } + tfjs_core_1.test_util.expectValuesInRange(actual.dataSync(), low, high); +} +exports.expectTensorsValuesInRange = expectTensorsValuesInRange; +function describeMathCPUAndGPU(testName, tests) { + jasmine_util_1.describeWithFlags(testName, tfjs_core_1.test_util.ALL_ENVS, function () { + beforeEach(function () { + state_1.disposeScalarCache(); + }); + tests(); + }); +} +exports.describeMathCPUAndGPU = describeMathCPUAndGPU; +function describeMathCPU(testName, tests) { + jasmine_util_1.describeWithFlags(testName, tfjs_core_1.test_util.CPU_ENVS, function () { + beforeEach(function () { + state_1.disposeScalarCache(); + }); + tests(); + }); +} +exports.describeMathCPU = describeMathCPU; +function describeMathGPU(testName, tests) { + jasmine_util_1.describeWithFlags(testName, tfjs_core_1.test_util.WEBGL_ENVS, function () { + beforeEach(function () { + state_1.disposeScalarCache(); + }); + tests(); + }); +} +exports.describeMathGPU = describeMathGPU; +function expectNoLeakedTensors(testFunc, numNewTensors) { + testFunc(); + var numTensorsBefore = tfjs_core_1.memory().numTensors; + testFunc(); + var numTensorsAfter = tfjs_core_1.memory().numTensors; + var actualNewTensors = numTensorsAfter - numTensorsBefore; + if (actualNewTensors !== numNewTensors) { + throw new errors_1.ValueError("Created an unexpected number of new " + + ("Tensors. Expected: " + numNewTensors + ", created : " + actualNewTensors + ". ") + + "Please investigate the discrepency and/or use tidy."); + } +} +exports.expectNoLeakedTensors = expectNoLeakedTensors; +//# sourceMappingURL=test_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js.map new file mode 100644 index 0000000..43e736e --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/test_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_utils.js","sourceRoot":"","sources":["../../src/utils/test_utils.ts"],"names":[],"mappings":";;AAeA,mDAAgE;AAChE,wEAA0E;AAE1E,0CAAoD;AACpD,oCAAqC;AASrC,4BACI,MAAuB,EAAE,QAAyB,EAAE,OAAgB;IACtE,IAAI,MAAM,IAAI,IAAI,EAAE;QAClB,MAAM,IAAI,mBAAU,CAChB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E,CAAC;IACX,IAAM,gBAAgB,GAAG,kBAAM,EAAE,CAAC,UAAU,CAAC;IAC7C,QAAQ,EAAE,CAAC;IACX,IAAM,eAAe,GAAG,kBAAM,EAAE,CAAC,UAAU,CAAC;IAC5C,IAAM,gBAAgB,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,IAAI,gBAAgB,KAAK,aAAa,EAAE;QACtC,MAAM,IAAI,mBAAU,CAChB,sCAAsC;aACtC,yBAAuB,aAAa,oBAChC,gBAAgB,OAAI,CAAA;YACxB,qDAAqD,CAAC,CAAC;KAC5D;AACH,CAAC;AAfD,sDAeC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.d.ts new file mode 100644 index 0000000..c247e68 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.d.ts @@ -0,0 +1,6 @@ +import { Tensor } from '@tensorflow/tfjs-core'; +import { Shape } from '../types'; +export declare function isArrayOfShapes(x: Shape | Shape[]): boolean; +export declare function normalizeShapeList(x: Shape | Shape[]): Shape[]; +export declare function getExactlyOneTensor(xs: Tensor | Tensor[]): Tensor; +export declare function getExactlyOneShape(shapes: Shape | Shape[]): Shape; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js b/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js new file mode 100644 index 0000000..1511fee --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var errors_1 = require("../errors"); +function isArrayOfShapes(x) { + return Array.isArray(x) && Array.isArray(x[0]); +} +exports.isArrayOfShapes = isArrayOfShapes; +function normalizeShapeList(x) { + if (x.length === 0) { + return []; + } + if (!Array.isArray(x[0])) { + return [x]; + } + return x; +} +exports.normalizeShapeList = normalizeShapeList; +function getExactlyOneTensor(xs) { + var x; + if (Array.isArray(xs)) { + if (xs.length !== 1) { + throw new errors_1.ValueError("Expected Tensor length to be 1; got " + xs.length); + } + x = xs[0]; + } + else { + x = xs; + } + return x; +} +exports.getExactlyOneTensor = getExactlyOneTensor; +function getExactlyOneShape(shapes) { + if (Array.isArray(shapes) && Array.isArray(shapes[0])) { + if (shapes.length === 1) { + shapes = shapes; + return shapes[0]; + } + else { + throw new errors_1.ValueError("Expected exactly 1 Shape; got " + shapes.length); + } + } + else { + return shapes; + } +} +exports.getExactlyOneShape = getExactlyOneShape; +//# sourceMappingURL=types_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js.map new file mode 100644 index 0000000..43c648f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types_utils.js","sourceRoot":"","sources":["../../src/utils/types_utils.ts"],"names":[],"mappings":";;AAcA,oCAAqC;AAQrC,yBAAgC,CAAgB;IAC9C,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,0CAEC;AAQD,4BAAmC,CAAgB;IACjD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAClB,OAAO,EAAE,CAAC;KACX;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACxB,OAAO,CAAC,CAAC,CAAY,CAAC;KACvB;IACD,OAAO,CAAY,CAAC;AACtB,CAAC;AARD,gDAQC;AAQD,6BAAoC,EAAmB;IACrD,IAAI,CAAS,CAAC;IACd,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACrB,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;YACnB,MAAM,IAAI,mBAAU,CAAC,yCAAuC,EAAE,CAAC,MAAQ,CAAC,CAAC;SAC1E;QACD,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;KACX;SAAM;QACL,CAAC,GAAG,EAAY,CAAC;KAClB;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAXD,kDAWC;AAYD,4BAAmC,MAAqB;IACtD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;QACrD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,MAAM,GAAG,MAAiB,CAAC;YAC3B,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;SAClB;aAAM;YACL,MAAM,IAAI,mBAAU,CAAC,mCAAiC,MAAM,CAAC,MAAQ,CAAC,CAAC;SACxE;KACF;SAAM;QACL,OAAO,MAAe,CAAC;KACxB;AACH,CAAC;AAXD,gDAWC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils_test.js.map new file mode 100644 index 0000000..faba6e1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/types_utils_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types_utils_test.js","sourceRoot":"","sources":["../../src/utils/types_utils_test.ts"],"names":[],"mappings":";;AAUA,2CAA6C;AAE7C,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,4CAA4C,EAAE;QAC/C,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,wCAAwC,EAAE;QAC3C,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,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,EAAE,CAAC,CAAC,CAAC;SACT,CAAC,EAFW,CAEX,CAAC,CAAC,YAAY,CAAC,iCAAiC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.d.ts new file mode 100644 index 0000000..9664dbf --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.d.ts @@ -0,0 +1,2 @@ +import { LayerVariable } from '../variables'; +export declare function countParamsInWeights(weights: LayerVariable[]): number; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js b/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js new file mode 100644 index 0000000..65222e9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function countParamsInWeights(weights) { + var count = 0; + for (var _i = 0, weights_1 = weights; _i < weights_1.length; _i++) { + var weight = weights_1[_i]; + if (weight.shape.length === 0) { + count += 1; + } + else { + count += weight.shape.reduce(function (a, b) { return a * b; }); + } + } + return count; +} +exports.countParamsInWeights = countParamsInWeights; +//# sourceMappingURL=variable_utils.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js.map new file mode 100644 index 0000000..bc31be3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"variable_utils.js","sourceRoot":"","sources":["../../src/utils/variable_utils.ts"],"names":[],"mappings":";;AAmBA,8BAAqC,OAAwB;IAC3D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAqB,UAAO,EAAP,mBAAO,EAAP,qBAAO,EAAP,IAAO;QAAvB,IAAM,MAAM,gBAAA;QACf,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YAC7B,KAAK,IAAI,CAAC,CAAC;SACZ;aAAM;YACL,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,GAAG,CAAC,EAAL,CAAK,CAAC,CAAC;SAC/C;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAVD,oDAUC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils_test.js.map new file mode 100644 index 0000000..d98306a --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/utils/variable_utils_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"variable_utils_test.js","sourceRoot":"","sources":["../../src/utils/variable_utils_test.ts"],"names":[],"mappings":";;AAUA,mDAAoD;AAEpD,0CAA2C;AAE3C,iDAAmD;AAEnD,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,EAAE,CAAC,cAAc,EAAE;QACjB,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE;QACvB,IAAM,OAAO,GAAG,IAAI,yBAAa,CAAC,iBAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE;QAC9B,IAAM,OAAO,GAAG,IAAI,yBAAa,CAAC,kBAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kBAAkB,EAAE;QACrB,IAAM,OAAO,GAAG,IAAI,yBAAa,CAAC,iBAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QACtE,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE;QACxC,IAAM,OAAO,GAAG,IAAI,yBAAa,CAAC,kBAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,IAAM,OAAO,GAAG,IAAI,yBAAa,CAAC,iBAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,IAAM,OAAO,GAAG,IAAI,yBAAa,CAAC,iBAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QACtE,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC;YACzC,OAAO,EAAE,OAAO,EAAE,OAAO;SAC1B,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/variables.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/variables.d.ts new file mode 100644 index 0000000..cf9988f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/variables.d.ts @@ -0,0 +1,32 @@ +import * as tfc from '@tensorflow/tfjs-core'; +import { DataType, Tensor } from '@tensorflow/tfjs-core'; +import { Constraint } from './constraints'; +import { Shape } from './types'; +export declare class LayerVariable { + readonly dtype: DataType; + readonly shape: Shape; + readonly id: number; + readonly name: string; + readonly originalName: string; + readonly trainable: boolean; + protected readonly val: tfc.Variable; + readonly constraint: Constraint; + constructor(val: Tensor, dtype?: DataType, name?: string, trainable?: boolean, constraint?: Constraint); + read(): Tensor; + write(newVal: Tensor): this; +} +export declare function variable(x: Tensor, dtype?: DataType, name?: string, constraint?: Constraint): LayerVariable; +export declare function zerosVariable(shape: Shape, dtype?: DataType, name?: string): LayerVariable; +export declare function zerosLike(x: Tensor, dtype?: DataType, name?: string): LayerVariable; +export declare function onesVariable(shape: Shape, dtype?: DataType, name?: string): LayerVariable; +export declare function onesLike(x: Tensor, dtype?: DataType, name?: string): LayerVariable; +export declare function eyeVariable(size: number, dtype?: DataType, name?: string): LayerVariable; +export declare function randomUniformVariable(shape: Shape, minval: number, maxval: number, dtype?: DataType, seed?: number, name?: string): LayerVariable; +export declare function truncatedNormalVariable(shape: Shape, mean?: number, stddev?: number, dtype?: DataType, seed?: number, name?: string): LayerVariable; +export declare function randomNormalVariable(shape: Shape, mean?: number, stddev?: number, dtype?: DataType, seed?: number, name?: string): LayerVariable; +export declare function update(x: LayerVariable, xNew: Tensor): LayerVariable; +export declare function updateAdd(x: LayerVariable, increment: Tensor): LayerVariable; +export declare function updateSub(x: LayerVariable, decrement: Tensor): LayerVariable; +export declare function batchGetValue(xs: LayerVariable[]): Tensor[]; +export declare function batchSetValue(variablesAndValues: Array<[LayerVariable, Tensor]>): void; +export declare function gradients(lossFn: () => tfc.Scalar, variables: LayerVariable[]): Tensor[]; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/variables.js b/node_modules/@tensorflow/tfjs-layers/dist/variables.js new file mode 100644 index 0000000..ae64f4c --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/variables.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfc = require("@tensorflow/tfjs-core"); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var state_1 = require("./backend/state"); +var common_1 = require("./common"); +var errors_1 = require("./errors"); +var DEFAULT_VARIABLE_NAME_PREFIX = 'Variable'; +var LayerVariable = (function () { + function LayerVariable(val, dtype, name, trainable, constraint) { + if (dtype === void 0) { dtype = 'float32'; } + if (name === void 0) { name = DEFAULT_VARIABLE_NAME_PREFIX; } + if (trainable === void 0) { trainable = true; } + if (constraint === void 0) { constraint = null; } + this.dtype = dtype == null ? 'float32' : dtype; + this.shape = val.shape; + this.id = state_1.getNextUniqueTensorId(); + name = name == null ? DEFAULT_VARIABLE_NAME_PREFIX : name; + this.originalName = common_1.getScopedTensorName(name); + this.name = common_1.getUniqueTensorName(this.originalName); + this.trainable = trainable; + this.constraint = constraint; + this.val = tfc.variable(val, this.trainable, this.name, this.dtype); + } + LayerVariable.prototype.read = function () { + return this.val; + }; + LayerVariable.prototype.write = function (newVal) { + checkShapesMatch(this.val, newVal); + this.val.assign(newVal); + if (this.constraint != null) { + this.val.assign(this.constraint.apply(this.val)); + } + return this; + }; + return LayerVariable; +}()); +exports.LayerVariable = LayerVariable; +function checkShapesMatch(x, y) { + if (x.shape.toString() !== y.shape.toString()) { + throw new Error('Shape mismatch: ' + JSON.stringify(x.shape) + ' vs. ' + + JSON.stringify(y.shape)); + } +} +function variable(x, dtype, name, constraint) { + return new LayerVariable(x, dtype, name, true, constraint); +} +exports.variable = variable; +function zerosVariable(shape, dtype, name) { + return new LayerVariable(tfc.zeros(shape), dtype, name); +} +exports.zerosVariable = zerosVariable; +function zerosLike(x, dtype, name) { + return new LayerVariable(tfc.zerosLike(x), dtype, name); +} +exports.zerosLike = zerosLike; +function onesVariable(shape, dtype, name) { + var allocated = tfc.ones(shape); + return new LayerVariable(allocated, dtype, name); +} +exports.onesVariable = onesVariable; +function onesLike(x, dtype, name) { + var allocated = tfc.onesLike(x); + return new LayerVariable(allocated, dtype, name); +} +exports.onesLike = onesLike; +function eyeVariable(size, dtype, name) { + return new LayerVariable(tfc.eye(size), dtype, name); +} +exports.eyeVariable = eyeVariable; +function randomUniformVariable(shape, minval, maxval, dtype, seed, name) { + if (name === void 0) { name = 'randomUniform'; } + return new LayerVariable(tfc.randomUniform(shape, minval, maxval, dtype), dtype, name); +} +exports.randomUniformVariable = randomUniformVariable; +function truncatedNormalVariable(shape, mean, stddev, dtype, seed, name) { + if (mean === void 0) { mean = 0.0; } + if (stddev === void 0) { stddev = 1.0; } + if (name === void 0) { name = 'truncatedNormal'; } + if (dtype === 'bool') { + throw new errors_1.NotImplementedError("randomNormal does not support dType bool."); + } + return new LayerVariable(tfc.truncatedNormal(shape, mean, stddev, dtype, seed), dtype, name); +} +exports.truncatedNormalVariable = truncatedNormalVariable; +function randomNormalVariable(shape, mean, stddev, dtype, seed, name) { + if (mean === void 0) { mean = 0.0; } + if (stddev === void 0) { stddev = 1.0; } + if (name === void 0) { name = 'randomNormal'; } + if (dtype === 'bool') { + throw new errors_1.NotImplementedError("randomNormalVariable does not support dType bool."); + } + return new LayerVariable(tfc.randomNormal(shape, mean, stddev, dtype, seed), dtype, name); +} +exports.randomNormalVariable = randomNormalVariable; +function update(x, xNew) { + return x.write(xNew); +} +exports.update = update; +function updateAdd(x, increment) { + return x.write(tfc.add(x.read(), increment)); +} +exports.updateAdd = updateAdd; +function updateSub(x, decrement) { + return x.write(tfc.sub(x.read(), decrement)); +} +exports.updateSub = updateSub; +function batchGetValue(xs) { + return xs.map(function (x) { return x.read(); }); +} +exports.batchGetValue = batchGetValue; +function batchSetValue(variablesAndValues) { + variablesAndValues.map(function (variableAndValue) { + var variable = variableAndValue[0]; + variable.write(variableAndValue[1]); + }); +} +exports.batchSetValue = batchSetValue; +function gradients(lossFn, variables) { + var variableList = variables.map(function (variable) { return variable.read(); }); + var valudAndGrads = tfjs_core_1.variableGrads(lossFn, variableList); + return variables.map(function (variable) { return valudAndGrads.grads[variable.name]; }); +} +exports.gradients = gradients; +//# sourceMappingURL=variables.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/variables.js.map b/node_modules/@tensorflow/tfjs-layers/dist/variables.js.map new file mode 100644 index 0000000..8b44878 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/variables.js.map @@ -0,0 +1 @@ +{"version":3,"file":"variables.js","sourceRoot":"","sources":["../src/variables.ts"],"names":[],"mappings":";;AAUA,2CAA6C;AAC7C,mDAAsE;AAEtE,yCAAsD;AACtD,mCAAkE;AAElE,mCAA6C;AAG7C,IAAM,4BAA4B,GAAG,UAAU,CAAC;AAOhD;IA6BE,uBACI,GAAW,EAAE,KAA2B,EACxC,IAAmC,EAAE,SAAgB,EACrD,UAA6B;QAFhB,sBAAA,EAAA,iBAA2B;QACxC,qBAAA,EAAA,mCAAmC;QAAE,0BAAA,EAAA,gBAAgB;QACrD,2BAAA,EAAA,iBAA6B;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,6BAAqB,EAAE,CAAC;QAElC,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1D,IAAI,CAAC,YAAY,GAAG,4BAAmB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,4BAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEnD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC;IASD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kB,CAAC,GAAG,CAAC,UAAC,gBAAgB;QACtC,IAAM,QAAQ,GAAkB,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACpD,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAND,sCAMC;AAUD,mBACI,MAAwB,EAAE,SAA0B;IAGtD,IAAM,YAAY,GACd,SAAS,CAAC,GAAG,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,EAAkB,EAA/B,CAA+B,CAAC,CAAC;IAC/D,IAAM,aAAa,GAAG,yBAAa,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1D,OAAO,SAAS,CAAC,GAAG,CAAC,UAAA,QAAQ,IAAI,OAAA,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAlC,CAAkC,CAAC,CAAC;AACvE,CAAC;AARD,8BAQC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/variables_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/variables_test.js.map new file mode 100644 index 0000000..21d90a8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/variables_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"variables_test.js","sourceRoot":"","sources":["../src/variables_test.ts"],"names":[],"mappings":";;AAeA,2CAA6C;AAC7C,mDAAuF;AAEvF,0CAA4C;AAC5C,mCAAmC;AACnC,6BAA+B;AAC/B,iDAA8F;AAC9F,+BAAiC;AAOjC,4BAAe,CAAC,UAAU,EAAE;IAC1B,EAAE,CAAC,wCAAwC,EAAE;QAC3C,IAAM,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa,CAAC,iBAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,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AAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAElE,+BAAkB,CAAC,oBAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/version.d.ts b/node_modules/@tensorflow/tfjs-layers/dist/version.d.ts new file mode 100644 index 0000000..0175964 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/version.d.ts @@ -0,0 +1,2 @@ +declare const version = "0.7.2"; +export { version }; diff --git a/node_modules/@tensorflow/tfjs-layers/dist/version.js b/node_modules/@tensorflow/tfjs-layers/dist/version.js new file mode 100644 index 0000000..dc52f77 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/version.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var version = '0.7.2'; +exports.version = version; +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/version.js.map b/node_modules/@tensorflow/tfjs-layers/dist/version.js.map new file mode 100644 index 0000000..dd346c9 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAGA,IAAM,OAAO,GAAG,OAAO,CAAC;AAChB,0BAAO"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/dist/version_test.js.map b/node_modules/@tensorflow/tfjs-layers/dist/version_test.js.map new file mode 100644 index 0000000..bfb586d --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/dist/version_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version_test.js","sourceRoot":"","sources":["../src/version_test.ts"],"names":[],"mappings":";;AAWA,IAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC/C,iCAAuC;AAEvC,QAAQ,CAAC,+BAA+B,EAAE;IACxC,EAAE,CAAC,gBAAgB,EAAE;QACnB,IAAM,qBAAqB,GACvB,WAAW,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC;QACzD,IAAM,sBAAsB,GACxB,WAAW,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;QAC1D,MAAM,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE;QAEvC,IAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;QACpD,MAAM,CAAC,sBAAc,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs-layers/package.json b/node_modules/@tensorflow/tfjs-layers/package.json new file mode 100644 index 0000000..3bdd845 --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/package.json @@ -0,0 +1,76 @@ +{ + "_from": "@tensorflow/tfjs-layers@0.7.2", + "_id": "@tensorflow/tfjs-layers@0.7.2", + "_inBundle": false, + "_integrity": "sha512-NwGmyYCrzV8cYycqA9fVfBWaz1zS1hqHP5MsRwU1m92TX/5lEhRClRmVCHJ4K8/GR+tYMl1PR/qCkeRjttwk7A==", + "_location": "/@tensorflow/tfjs-layers", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@tensorflow/tfjs-layers@0.7.2", + "name": "@tensorflow/tfjs-layers", + "escapedName": "@tensorflow%2ftfjs-layers", + "scope": "@tensorflow", + "rawSpec": "0.7.2", + "saveSpec": null, + "fetchSpec": "0.7.2" + }, + "_requiredBy": [ + "/@tensorflow/tfjs" + ], + "_resolved": "https://registry.npmjs.org/@tensorflow/tfjs-layers/-/tfjs-layers-0.7.2.tgz", + "_shasum": "3a8c083255c72da272245ae5b435c66af9573eb8", + "_spec": "@tensorflow/tfjs-layers@0.7.2", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs", + "bundleDependencies": false, + "deprecated": false, + "description": "TensorFlow layers API in JavaScript", + "devDependencies": { + "@tensorflow/tfjs-core": "~0.12.8", + "@types/jasmine": "~2.5.53", + "clang-format": "~1.2.2", + "http-server": "~0.10.0", + "jasmine-core": "~3.1.0", + "karma": "~2.0.0", + "karma-browserstack-launcher": "~1.3.0", + "karma-chrome-launcher": "~2.2.0", + "karma-firefox-launcher": "~1.1.0", + "karma-jasmine": "~1.1.1", + "karma-typescript": "^3.0.12", + "rimraf": "~2.6.2", + "rollup": "^0.58.2", + "rollup-plugin-commonjs": "9.1.3", + "rollup-plugin-node-resolve": "3.3.0", + "rollup-plugin-typescript2": "0.13.0", + "rollup-plugin-uglify": "~3.0.0", + "tslint": "~5.6.0", + "tslint-no-circular-imports": "^0.5.0", + "typescript": "2.8.3", + "yalc": "~1.0.0-pre.21" + }, + "jsdelivr": "dist/tf-layers.min.js", + "jsnext:main": "dist/tf-layers.esm.js", + "main": "dist/index.js", + "module": "dist/tf-layers.esm.js", + "name": "@tensorflow/tfjs-layers", + "peerDependencies": { + "@tensorflow/tfjs-core": "~0.12.8" + }, + "private": false, + "scripts": { + "build": "tsc", + "build-npm": "./scripts/build-npm.sh", + "format": "./tools/clang_format_ts.sh", + "link-local": "yalc link", + "lint": "tslint -p . --type-check -t verbose", + "publish-local": "yarn build-npm && yalc push", + "publish-npm": "./scripts/publish-npm.sh", + "test": "karma start", + "test-integ": "cd integration_tests/tfjs2keras && ./run-test.sh", + "test-travis": "karma start --browsers='bs_firefox_mac,bs_chrome_mac' --singleRun --reporters='dots,karma-typescript'" + }, + "types": "dist/index.d.ts", + "unpkg": "dist/tf-layers.min.js", + "version": "0.7.2" +} diff --git a/node_modules/@tensorflow/tfjs-layers/tsconfig.json b/node_modules/@tensorflow/tfjs-layers/tsconfig.json new file mode 100644 index 0000000..7709b7f --- /dev/null +++ b/node_modules/@tensorflow/tfjs-layers/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "noImplicitAny": true, + "sourceMap": true, + "removeComments": true, + "preserveConstEnums": true, + "declaration": true, + "target": "es5", + "lib": ["es2015", "dom"], + "outDir": "./dist", + "noUnusedLocals": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "alwaysStrict": true, + "noUnusedParameters": false, + "pretty": true, + "noFallthroughCasesInSwitch": true, + "allowUnreachableCode": false + }, + "include": ["src/"] +} diff --git a/node_modules/@tensorflow/tfjs/GALLERY.md b/node_modules/@tensorflow/tfjs/GALLERY.md new file mode 100644 index 0000000..8ddf750 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/GALLERY.md @@ -0,0 +1,74 @@ +# Gallery + +Welcome to the TensorFlow.js gallery! This is a collection of TensorFlow.js projects, tutorials, videos, and more. + +Please reach out to us if you'd like to put your project on the list. + +## Demos & Applications + +- [Move Mirror](https://experiments.withgoogle.com/collection/ai/move-mirror/view) - An AI Experiment with Pose Estimation in the Browser using TensorFlow.js +- [Emoji Scavenger Hunt](https://emojiscavengerhunt.withgoogle.com/) - Locate the emoji we show you in the real world with your phone’s camera. +- [Metacar](https://www.metacar-project.com/) - A reinforcement learning environment for self-driving cars in the browser. +- [Evolution Simulator](https://github.com/adityathebe/evolutionSimulator) - Evolution Simulator using NeuroEvolution +- [Play pong with webcam](https://ml4a.github.io/demos/tfjs/regression-pong.html) by Gene Kogan +- [Make music with PoseNet](https://ml4a.github.io/demos/tfjs/posenet-music.html) by Gene Kogan +- [Neural drum machine](https://codepen.io/teropa/pen/JLjXGK) by Tero Parviainen +- [Pose Music](https://codepen.io/teropa/pen/QxLrMp) by Tero Parviainen +- [Neural Arpeggiator](https://codepen.io/teropa/pen/ddqEwj) by Tero Parviainen +- [Neural Melody Autocompletion](https://codepen.io/teropa/pen/gvwwZL) by Tero Parviainen +- [Deep Roll](https://codepen.io/teropa/pen/zpbLOj) by Tero Parviainen +- [Latent Cycles](https://codepen.io/teropa/pen/rdoPbG) by Tero Parviainen +- [PoseNet + Pts.js](https://github.com/williamngan/pts/tree/master/demo/more/tfjs_posenet) - Visualizing pose with pts.js +- [Falling balls + DQN](http://web.sfc.keio.ac.jp/~t15704yn/falling/index.html) - A demo of a DQN agent that learns to dodge falling balls by seann999 +- [Tenori Off](https://tenori-off.glitch.me/) - An ML-powered music sequencer by Monica Dinculescu +- [Hello TensorFlow.js](https://hello-tensorflow.glitch.me/) - Polynomial Regression by Monica Dinculescu +- [Simple MNIST GAN](https://mwdchang.github.io/tfjs-gan/) by Daniel Chang +- [Complementary Color Prediction](http://stelling.cc/complementary-color-prediction/) by Roberto Stelling +- [Mars at Home](https://github.com/MarsAtHome/marsjs) - Mars@Home client for Firefox & Chrome - Labels image from Unsplash in browser +- [Nxt Word](https://github.com/rajveermalviya/language-modeling) - Next Word Predictor - by Rajveer Malviya + +## Tutorials + +These tutorials augment the [official tutorials](https://js.tensorflow.org/tutorials/). + +- [A gentle introduction to TensorFlow.js](https://medium.com/tensorflow/a-gentle-introduction-to-tensorflow-js-dba2e5257702) by Zaid Alyafeai +- [Train a model in tf.keras with Colab, and run it in the browser with TensorFlow.js](https://medium.com/tensorflow/train-on-google-colab-and-run-on-the-browser-a-case-study-8a45f9b1474e) by Zaid Alyafeai +- [Python Programming - Deep learning in the browser with TensorFlow.js](https://pythonprogramming.net/deep-learning-browser-introduction-tensorflowjs/) by Harrison Kinsley +- [Basic Tutorial with TensorFlow.js: Linear Regression](https://medium.com/@tristansokol/basic-tutorial-with-tensorflow-js-linear-regression-aa68b16e5b8e) by Tristan Sokol + +## Video tutorials +- [The Coding Train - TensorFlow.js Introduction](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YIeVA3dNxbR9PYj4wV31oQ) +- [The Coding Train - TensorFlow.js Color Classifier](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bmMRCIoTi72aNWHo7epX4L) +- [Siraj Raval - TensorFlow.js Explained](https://www.youtube.com/watch?v=Nc8kZABv-KE) +- [Siraj Raval - Financial Forecasting using TensorFlow.js](https://www.youtube.com/watch?v=5Uw1iSwvHH8) +- [Siraj Raval - Webcam tracking with TensorFlow.js](https://www.youtube.com/watch?v=9KqNk5keyCc) +- [Angular Firebase - TensorFlow.js Quickstart](https://www.youtube.com/watch?v=Y_XM3Bu-4yc) + +## Talks +- [TensorFlow dev summit](https://www.youtube.com/watch?v=YB-kfeNIPCE) - Official TensorFlow.js launch +- [Google I/O, Node.js binding launch](https://www.youtube.com/watch?v=OmofOvMApTU) - Official TensorFlow.js + Node.js launch +- [Deep Learning in JS - Ashi Krishnan - JSConf EU 2018](https://www.youtube.com/watch?v=SV-cgdobtTA) + +## Blog posts +- [Move Mirror](https://medium.com/tensorflow/move-mirror-an-ai-experiment-with-pose-estimation-in-the-browser-using-tensorflow-js-2f7b769f9b23?linkId=54484629) - An AI Experiment with Pose Estimation in the Browser using TensorFlow.js +- [Abstract art with ML](https://janhuenermann.com/blog/abstract-art-with-ml) by Jan Huenermann +- [Deep Overwatch with TensorFlow.js](https://medium.com/@farzatv/deepoverwatch-combining-tensorflow-js-overwatch-computer-vision-and-music-1a84d4598bc0) -  combining TensorFlow.js, Overwatch, Computer Vision, and Music by Farza +- [Real-time Human Pose Estimation in the Browser with TensorFlow.js](https://medium.com/tensorflow/real-time-human-pose-estimation-in-the-browser-with-tensorflow-js-7dd0bc881cd5) by Dan Oved +- [Getting Started with TensorFlow.js](https://medium.com/tensorflow/getting-started-with-tensorflow-js-50f6783489b2) by Laurence Moroney +- [Introducing TensorFlow.js](https://medium.com/tensorflow/introducing-tensorflow-js-machine-learning-in-javascript-bf3eab376db) by Josh Gordon and Sara Robinson +- [Solving the Chrome T-Rex Game with Neural Networks, Genetic Algorithms and TensorFlow.js (Chinese: 前端人工智能?TensorFlow.js 学会游戏通关)](https://zhuanlan.zhihu.com/p/35451395) by [@MagicCube](https://github.com/MagicCube) + +## Notebooks +- [Introduction to TensorFlow.js](https://beta.observablehq.com/@nsthorat/introduction-to-deeplearn-js) by Nikhil Thorat +- [How to build a Teachable Machine](https://beta.observablehq.com/@nsthorat/how-to-build-a-teachable-machine-with-tensorflow-js) by Nikhil Thorat +- [Smoothgrad in TensorFlow.js](https://beta.observablehq.com/@aman-tiwari/smoothgrad-in-tensorflow-js?linkId=53020429) by Aman Tiwari +- [Visualizing training using TensorFlow.js + MLB data](https://beta.observablehq.com/@nkreeger/visualizing-ml-training-using-tensorflow-js-and-baseball-d) by Nick Kreeger +- [Animation CPPNs](https://beta.observablehq.com/@emilyreif/animation-with-cppns) - by Emily Reif + +## Libraries using TensorFlow.js + +- [ML5](https://ml5js.org/) - Friendly machine learning for the web +- [magenta.js](https://magenta.tensorflow.org/js) - Music and Art Generation with Machine Intelligence in the Browser. +- [SeeClarke.js](https://github.com/labofoz/SeeClarke.js) - A library for adding face-controlled pointers to your site. +- [face-api.js](https://github.com/justadudewhohacks/face-api.js) - A JavaScript API for face detection and face recognition in the browser. +- [TensorFlow.js GPU-accelerated t-SNE](https://github.com/tensorflow/tfjs-tsne) - A linear t-SNE for the web. diff --git a/node_modules/@tensorflow/tfjs/LICENSE b/node_modules/@tensorflow/tfjs/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@tensorflow/tfjs/README.md b/node_modules/@tensorflow/tfjs/README.md new file mode 100644 index 0000000..1249811 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/README.md @@ -0,0 +1,145 @@ +[![Build Status](https://travis-ci.org/tensorflow/tfjs.svg?branch=master)](https://travis-ci.org/tensorflow/tfjs) +# TensorFlow.js + +TensorFlow.js is an open-source hardware-accelerated JavaScript library for +training and deploying machine learning models. + +**Develop ML in the Browser**
+Use flexible and intuitive APIs to build models from scratch using the low-level +JavaScript linear algebra library or the high-level layers API. + +**Run Existing models**
+Use TensorFlow.js model converters to run pre-existing TensorFlow models right +in the browser. + +**Retrain Existing models**
+Retrain pre-existing ML models using sensor data connected to the browser, or +other client-side data. + +## About this repo + +This repository contains the logic and scripts that combine +two packages: +- [TensorFlow.js Core](https://github.com/tensorflow/tfjs-core), + a flexible low-level API, formerly known as *deeplearn.js*. +- [TensorFlow.js Layers](https://github.com/tensorflow/tfjs-layers), + a high-level API which implements functionality similar to + [Keras](https://keras.io/). +- [TensorFlow.js Converter](https://github.com/tensorflow/tfjs-converter), + tools to import a TensorFlow SavedModel to TensorFlow.js + +If you care about bundle size, you can import those packages individually. + +## Examples + +Check out our +[examples repository](https://github.com/tensorflow/tfjs-examples) +and our [tutorials](https://js.tensorflow.org/tutorials/). + +## Gallery + +Be sure to check out [the gallery](GALLERY.md) of all projects related to TensorFlow.js. + +## Pre-trained models + +Be sure to also check out our [models repository](https://github.com/tensorflow/tfjs-models) where we host pretrained models +on NPM. + +## Getting started + +There are two main ways to get TensorFlow.js in your JavaScript project: +via script tags or by installing it from NPM +and using a build tool like Parcel, +WebPack, or Rollup. + +### via Script Tag + +Add the following code to an HTML file: + +```html + + + + + + + + + + + + +``` + +Open up that html file in your browser and the code should run! + +### via NPM + +Add TensorFlow.js to your project using yarn or npm. Note: Because +we use ES2017 syntax (such as `import`), this workflow assumes you are using a modern browser or a bundler/transpiler +to convert your code to something older browsers understand. See our +examples +to see how we use Parcel to build +our code. However you are free to use any build tool that you prefer. + + + +```js +import * as tf from '@tensorflow/tfjs'; + +// Define a model for linear regression. +const model = tf.sequential(); +model.add(tf.layers.dense({units: 1, inputShape: [1]})); + +// Prepare the model for training: Specify the loss and the optimizer. +model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); + +// Generate some synthetic data for training. +const xs = tf.tensor2d([1, 2, 3, 4], [4, 1]); +const ys = tf.tensor2d([1, 3, 5, 7], [4, 1]); + +// Train the model using the data. +model.fit(xs, ys).then(() => { + // Use the model to do inference on a data point the model hasn't seen before: + model.predict(tf.tensor2d([5], [1, 1])).print(); +}); +``` + +See our tutorials, examples +and documentation for more details. + +## Importing pre-trained models + +We support porting pre-trained models from: +- [TensorFlow SavedModel](https://github.com/tensorflow/tfjs-converter) +- [Keras](https://js.tensorflow.org/tutorials/import-keras.html) + +## Find out more + +[TensorFlow.js](https://js.tensorflow.org) is a part of the +[TensorFlow](https://www.tensorflow.org) ecosystem. For more info: +- [js.tensorflow.org](https://js.tensorflow.org) +- [Tutorials](https://js.tensorflow.org/tutorials) +- [API reference](https://js.tensorflow.org/api/latest/) +- [Help mailing list](https://groups.google.com/a/tensorflow.org/forum/#!forum/tfjs) diff --git a/node_modules/@tensorflow/tfjs/dist-es6/index.d.ts b/node_modules/@tensorflow/tfjs/dist-es6/index.d.ts new file mode 100644 index 0000000..1f8417d --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist-es6/index.d.ts @@ -0,0 +1,9 @@ +export * from '@tensorflow/tfjs-core'; +export * from '@tensorflow/tfjs-layers'; +export * from '@tensorflow/tfjs-converter'; +export declare const version: { + 'tfjs-core': string; + 'tfjs-layers': string; + 'tfjs-converter': string; + 'tfjs': string; +}; diff --git a/node_modules/@tensorflow/tfjs/dist-es6/index.js b/node_modules/@tensorflow/tfjs/dist-es6/index.js new file mode 100644 index 0000000..fbd9337 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist-es6/index.js @@ -0,0 +1,14 @@ +export * from '@tensorflow/tfjs-core'; +export * from '@tensorflow/tfjs-layers'; +export * from '@tensorflow/tfjs-converter'; +import { version_core } from '@tensorflow/tfjs-core'; +import { version_layers } from '@tensorflow/tfjs-layers'; +import { version_converter } from '@tensorflow/tfjs-converter'; +import { version as version_union } from './version'; +export var version = { + 'tfjs-core': version_core, + 'tfjs-layers': version_layers, + 'tfjs-converter': version_converter, + 'tfjs': version_union +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist-es6/index.js.map b/node_modules/@tensorflow/tfjs/dist-es6/index.js.map new file mode 100644 index 0000000..807e82b --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist-es6/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAG3C,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,WAAW,CAAC;AAEnD,MAAM,CAAC,IAAM,OAAO,GAAG;IACrB,WAAW,EAAE,YAAY;IACzB,aAAa,EAAE,cAAc;IAC7B,gBAAgB,EAAE,iBAAiB;IACnC,MAAM,EAAE,aAAa;CACtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist-es6/index_test.d.ts b/node_modules/@tensorflow/tfjs/dist-es6/index_test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist-es6/index_test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@tensorflow/tfjs/dist-es6/index_test.js b/node_modules/@tensorflow/tfjs/dist-es6/index_test.js new file mode 100644 index 0000000..5cff938 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist-es6/index_test.js @@ -0,0 +1,25 @@ +import * as tf from './index'; +describe('Union package', function () { + it('has core ops', function () { + expect(tf.matMul).not.toBeNull(); + expect(tf.tensor).not.toBeNull(); + expect(tf.scalar).not.toBeNull(); + expect(tf.square).not.toBeNull(); + }); + it('has layers', function () { + expect(tf.sequential).not.toBeNull(); + expect(tf.model).not.toBeNull(); + expect(tf.layers.dense).not.toBeNull(); + }); + it('has converter', function () { + expect(tf.FrozenModel).not.toBeNull(); + expect(tf.loadFrozenModel).not.toBeNull(); + }); + it('version', function () { + var expected = require('../package.json').version; + expect(tf.version.tfjs).toBe(expected); + expect(tf.version['tfjs-core']).not.toBeNull(); + expect(tf.version['tfjs-layers']).not.toBeNull(); + }); +}); +//# sourceMappingURL=index_test.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist-es6/index_test.js.map b/node_modules/@tensorflow/tfjs/dist-es6/index_test.js.map new file mode 100644 index 0000000..ab6f051 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist-es6/index_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index_test.js","sourceRoot":"","sources":["../src/index_test.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,QAAQ,CAAC,eAAe,EAAE;IACxB,EAAE,CAAC,cAAc,EAAE;QACjB,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjC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index 0000000..47054b3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist-es6/version.d.ts @@ -0,0 +1,2 @@ +declare const version = "0.11.5"; +export { version }; diff --git a/node_modules/@tensorflow/tfjs/dist-es6/version.js b/node_modules/@tensorflow/tfjs/dist-es6/version.js new file mode 100644 index 0000000..380ab1b --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist-es6/version.js @@ -0,0 +1,3 @@ +var version = '0.11.5'; +export { version }; +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist-es6/version.js.map b/node_modules/@tensorflow/tfjs/dist-es6/version.js.map new file mode 100644 index 0000000..cad7e50 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist-es6/version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAGA,IAAM,OAAO,GAAG,QAAQ,CAAC;AACzB,OAAO,EAAC,OAAO,EAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist/index.d.ts b/node_modules/@tensorflow/tfjs/dist/index.d.ts new file mode 100644 index 0000000..1f8417d --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/index.d.ts @@ -0,0 +1,9 @@ +export * from '@tensorflow/tfjs-core'; +export * from '@tensorflow/tfjs-layers'; +export * from '@tensorflow/tfjs-converter'; +export declare const version: { + 'tfjs-core': string; + 'tfjs-layers': string; + 'tfjs-converter': string; + 'tfjs': string; +}; diff --git a/node_modules/@tensorflow/tfjs/dist/index.js b/node_modules/@tensorflow/tfjs/dist/index.js new file mode 100644 index 0000000..f06a0c6 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/index.js @@ -0,0 +1,19 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@tensorflow/tfjs-core")); +__export(require("@tensorflow/tfjs-layers")); +__export(require("@tensorflow/tfjs-converter")); +var tfjs_core_1 = require("@tensorflow/tfjs-core"); +var tfjs_layers_1 = require("@tensorflow/tfjs-layers"); +var tfjs_converter_1 = require("@tensorflow/tfjs-converter"); +var version_1 = require("./version"); +exports.version = { + 'tfjs-core': tfjs_core_1.version_core, + 'tfjs-layers': tfjs_layers_1.version_layers, + 'tfjs-converter': tfjs_converter_1.version_converter, + 'tfjs': version_1.version +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist/index.js.map b/node_modules/@tensorflow/tfjs/dist/index.js.map new file mode 100644 index 0000000..5979797 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAiBA,2CAAsC;AACtC,6CAAwC;AACxC,gDAA2C;AAG3C,mDAAmD;AACnD,uDAAuD;AACvD,6DAA6D;AAC7D,qCAAmD;AAEtC,QAAA,OAAO,GAAG;IACrB,WAAW,EAAE,wBAAY;IACzB,aAAa,EAAE,4BAAc;IAC7B,gBAAgB,EAAE,kCAAiB;IACnC,MAAM,EAAE,iBAAa;CACtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist/index_test.js.map b/node_modules/@tensorflow/tfjs/dist/index_test.js.map new file mode 100644 index 0000000..3aac72d --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/index_test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index_test.js","sourceRoot":"","sources":["../src/index_test.ts"],"names":[],"mappings":";;AAiBA,4BAA8B;AAE9B,QAAQ,CAAC,eAAe,EAAE;IACxB,EAAE,CAAC,cAAc,EAAE;QACjB,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,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ode 100644 index 0000000..f8eb414 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/tf.esm.js @@ -0,0 +1,3 @@ +// @tensorflow/tfjs Copyright 2018 Google +import{version_core}from"@tensorflow/tfjs-core";export*from"@tensorflow/tfjs-core";import{version_layers}from"@tensorflow/tfjs-layers";export*from"@tensorflow/tfjs-layers";import{version_converter}from"@tensorflow/tfjs-converter";export*from"@tensorflow/tfjs-converter";var version="0.12.4",version$1={"tfjs-core":version_core,"tfjs-layers":version_layers,"tfjs-converter":version_converter,tfjs:version};export{version$1 as version}; +//# sourceMappingURL=tf.esm.js.map diff --git a/node_modules/@tensorflow/tfjs/dist/tf.esm.js.map b/node_modules/@tensorflow/tfjs/dist/tf.esm.js.map new file mode 100644 index 0000000..d9ced59 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/tf.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tf.esm.js","sources":["../src/version.ts","../src/index.ts"],"sourcesContent":["/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '0.12.4';\nexport {version};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport * from '@tensorflow/tfjs-core';\nexport * from '@tensorflow/tfjs-layers';\nexport * from '@tensorflow/tfjs-converter';\n\n// Import versions of all sub-packages.\nimport {version_core} from '@tensorflow/tfjs-core';\nimport {version_layers} from '@tensorflow/tfjs-layers';\nimport {version_converter} from '@tensorflow/tfjs-converter';\nimport {version as version_union} from './version';\n\nexport const version = {\n 'tfjs-core': version_core,\n 'tfjs-layers': version_layers,\n 'tfjs-converter': version_converter,\n 'tfjs': version_union\n};\n"],"names":["version","version_core","version_layers","version_converter","version_union"],"mappings":";8QAGA,IAAMA,QAAU,SCwBHA,uBACEC,2BACEC,gCACGC,uBACVC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist/tf.js b/node_modules/@tensorflow/tfjs/dist/tf.js new file mode 100644 index 0000000..432fd30 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/tf.js @@ -0,0 +1,11468 @@ +// @tensorflow/tfjs Copyright 2018 Google +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.tf = global.tf || {}))); +}(this, (function (exports) { 'use strict'; + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { + e.__proto__ = t; + } || function (e, t) { + for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); + };function __extends(e, t) { + function n() { + this.constructor = e; + }extendStatics(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n()); + }var __assign = Object.assign || function (e) { + for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);return e; + };function __awaiter(e, t, n, r) { + return new (n || (n = Promise))(function (o, a) { + function i(e) { + try { + u(r.next(e)); + } catch (e) { + a(e); + } + }function s(e) { + try { + u(r.throw(e)); + } catch (e) { + a(e); + } + }function u(e) { + e.done ? o(e.value) : new n(function (t) { + t(e.value); + }).then(i, s); + }u((r = r.apply(e, t || [])).next()); + }); + }function __generator(e, t) { + var n, + r, + o, + a, + i = { label: 0, sent: function () { + if (1 & o[0]) throw o[1];return o[1]; + }, trys: [], ops: [] };return a = { next: s(0), throw: s(1), return: s(2) }, "function" == typeof Symbol && (a[Symbol.iterator] = function () { + return this; + }), a;function s(a) { + return function (s) { + return function (a) { + if (n) throw new TypeError("Generator is already executing.");for (; i;) try { + if (n = 1, r && (o = 2 & a[0] ? r.return : a[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) && !(o = o.call(r, a[1])).done) return o;switch (r = 0, o && (a = [2 & a[0], o.value]), a[0]) {case 0:case 1: + o = a;break;case 4: + return i.label++, { value: a[1], done: !1 };case 5: + i.label++, r = a[1], a = [0];continue;case 7: + a = i.ops.pop(), i.trys.pop();continue;default: + if (!(o = (o = i.trys).length > 0 && o[o.length - 1]) && (6 === a[0] || 2 === a[0])) { + i = 0;continue; + }if (3 === a[0] && (!o || a[1] > o[0] && a[1] < o[3])) { + i.label = a[1];break; + }if (6 === a[0] && i.label < o[1]) { + i.label = o[1], o = a;break; + }if (o && i.label < o[2]) { + i.label = o[2], i.ops.push(a);break; + }o[2] && i.ops.pop(), i.trys.pop();continue;}a = t.call(e, i); + } catch (e) { + a = [6, e], r = 0; + } finally { + n = o = 0; + }if (5 & a[0]) throw a[1];return { value: a[0] ? a[1] : void 0, done: !0 }; + }([a, s]); + }; + } + }function isMobile() { + var e = navigator.userAgent || navigator.vendor || window.opera;return (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4)) + ); + }function shuffle(e) { + for (var t = e.length, n = 0, r = 0; t > 0;) r = Math.random() * t | 0, n = e[--t], e[t] = e[r], e[r] = n; + }function clamp(e, t, n) { + return Math.max(e, Math.min(t, n)); + }function randUniform(e, t) { + return Math.random() * (t - e) + e; + }function distSquared(e, t) { + for (var n = 0, r = 0; r < e.length; r++) { + var o = Number(e[r]) - Number(t[r]);n += o * o; + }return n; + }function assert(e, t) { + if (!e) throw new Error("string" == typeof t ? t : t()); + }function assertShapesMatch(e, t, n) { + void 0 === n && (n = ""), assert(arraysEqual(e, t), n + " Shapes " + e + " and " + t + " must match"); + }function assertNonNull(e) { + assert(null != e, "The input to the tensor constructor must be a non-null value."); + }function flatten(e, t) { + if (void 0 === t && (t = []), Array.isArray(e)) for (var n = 0; n < e.length; ++n) flatten(e[n], t);else t.push(e);return t; + }function inferShape(e) { + var t = e;if (isTypedArray(e)) return [e.length];if (!Array.isArray(e)) return [];for (var n = []; t instanceof Array;) n.push(t.length), t = t[0];return e instanceof Array && deepAssertShapeConsistency(e, n, []), n; + }function deepAssertShapeConsistency(e, t, n) { + if (n = n || [], e instanceof Array) { + assert(t.length > 0, function () { + return "Element arr[" + n.join("][") + "] should be a primitive, but is an array of " + e.length + " elements"; + }), assert(e.length === t[0], function () { + return "Element arr[" + n.join("][") + "] should have " + t[0] + " elements, but has " + e.length + " elements"; + });for (var r = t.slice(1), o = 0; o < e.length; ++o) deepAssertShapeConsistency(e[o], r, n.concat(o)); + } else assert(0 === t.length, function () { + return "Element arr[" + n.join("][") + "] is a primitive, but should be an array of " + t[0] + " elements"; + }); + }function sizeFromShape(e) { + if (0 === e.length) return 1;for (var t = e[0], n = 1; n < e.length; n++) t *= e[n];return t; + }function isScalarShape(e) { + return 0 === e.length; + }function arraysEqual(e, t) { + if (e.length !== t.length) return !1;for (var n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;return !0; + }function isInt(e) { + return e % 1 == 0; + }function tanh(e) { + if (null != Math.tanh) return Math.tanh(e);if (e === 1 / 0) return 1;if (e === -1 / 0) return -1;var t = Math.exp(2 * e);return (t - 1) / (t + 1); + }function sizeToSquarishShape(e) { + for (var t = Math.floor(Math.sqrt(e)); t > 1; --t) if (e % t == 0) return [t, e / t];return [1, e]; + }function createShuffledIndices(e) { + for (var t = new Uint32Array(e), n = 0; n < e; ++n) t[n] = n;return shuffle(t), t; + }function rightPad(e, t) { + return t <= e.length ? e : e + " ".repeat(t - e.length); + }function repeatedTry(e, t, n) { + return void 0 === t && (t = function (e) { + return 0; + }), new Promise(function (r, o) { + var a = 0, + i = function () { + if (e()) r();else { + var s = t(++a);null != n && a >= n ? o() : setTimeout(i, s); + } + };i(); + }); + }function inferFromImplicitShape(e, t) { + for (var n = 1, r = -1, o = 0; o < e.length; ++o) if (e[o] > 0) n *= e[o];else if (-1 === e[o]) { + if (-1 !== r) throw Error("Shapes can only have 1 implicit size. Found - 1 at dim " + r + " and dim " + o);r = o; + } else if (e[o] <= 0) throw Error("Shapes can not be <= 0. Found " + e[o] + " at dim " + o);if (-1 === r) { + if (t > 0 && t !== n) throw Error("Size(" + t + ") must match the product of shape " + e);return e; + }if (t % n != 0) throw Error("The implicit shape can't be a fractional number. Got " + t + " / " + n);var a = e.slice();return a[r] = t / n, a; + }function squeezeShape(e, t) { + for (var n = [], r = [], o = 0, a = 0; a < e.length; ++a) { + if (null != t) { + if (t[o] === a && e[a] > 1) throw new Error("Can't squeeze axis " + a + " since its dim '" + e[a] + "' is not 1");(null == t[o] || t[o] > a) && 1 === e[a] && (n.push(e[a]), r.push(a)), t[o] <= a && o++; + }e[a] > 1 && (n.push(e[a]), r.push(a)); + }return { newShape: n, keptDims: r }; + }function getTypedArrayFromDType(e, t) { + var n = null;if (null == e || "float32" === e) n = new Float32Array(t);else if ("int32" === e) n = new Int32Array(t);else { + if ("bool" !== e) throw new Error("Unknown data type " + e);n = new Uint8Array(t); + }return n; + }function checkComputationForNaN(e, t, n) { + if ("float32" === t) for (var r = 0; r < e.length; r++) if (isNaN(e[r])) throw Error("The result of the '" + n + "' has NaNs."); + }function checkConversionForNaN(e, t) { + if ("float32" !== t) for (var n = 0; n < e.length; n++) if (isNaN(e[n])) throw Error("NaN is not a valid value for dtype: '" + t + "'."); + }function hasEncodingLoss(e, t) { + return "float32" !== t && ("int32" !== t || "float32" === e) && ("bool" !== t || "bool" !== e); + }function copyTypedArray(e, t, n) { + if (null == t || "float32" === t) return new Float32Array(e);if ("int32" === t) return n && checkConversionForNaN(e, t), new Int32Array(e);if ("bool" === t) { + for (var r = new Uint8Array(e.length), o = 0; o < r.length; ++o) 0 !== Math.round(e[o]) && (r[o] = 1);return r; + }throw new Error("Unknown data type " + t); + }function isTypedArray(e) { + return e instanceof Float32Array || e instanceof Int32Array || e instanceof Uint8Array; + }function bytesPerElement(e) { + if ("float32" === e || "int32" === e) return 4;if ("bool" === e) return 1;throw new Error("Unknown dtype " + e); + }function isFunction(e) { + return !!(e && e.constructor && e.call && e.apply); + }function nearestDivisor(e, t) { + for (var n = t; n < e; ++n) if (e % n == 0) return n;return e; + }function computeStrides(e) { + var t = e.length;if (t < 2) return [];var n = new Array(t - 1);n[t - 2] = e[t - 1];for (var r = t - 3; r >= 0; --r) n[r] = n[r + 1] * e[r + 1];return n; + }function toTypedArray(e, t, n) { + return noConversionNeeded(e, t) ? e : (Array.isArray(e) && (e = flatten(e)), copyTypedArray(e, t, n)); + }function noConversionNeeded(e, t) { + return e instanceof Float32Array && "float32" === t || e instanceof Int32Array && "int32" === t || e instanceof Uint8Array && "bool" === t; + }function makeOnesTypedArray(e, t) { + for (var n = makeZerosTypedArray(e, t), r = 0; r < n.length; r++) n[r] = 1;return n; + }function makeZerosTypedArray(e, t) { + if (null == t || "float32" === t) return new Float32Array(e);if ("int32" === t) return new Int32Array(e);if ("bool" === t) return new Uint8Array(e);throw new Error("Unknown data type " + t); + }function now() { + if ("undefined" != typeof performance) return performance.now();if ("undefined" != typeof process) { + var e = process.hrtime();return 1e3 * e[0] + e[1] / 1e6; + }throw new Error("Can not measure time in this environment. You should run tf.js in the browser or in Node.js"); + }var util = Object.freeze({ shuffle: shuffle, clamp: clamp, randUniform: randUniform, distSquared: distSquared, assert: assert, assertShapesMatch: assertShapesMatch, assertNonNull: assertNonNull, flatten: flatten, inferShape: inferShape, sizeFromShape: sizeFromShape, isScalarShape: isScalarShape, arraysEqual: arraysEqual, isInt: isInt, tanh: tanh, sizeToSquarishShape: sizeToSquarishShape, createShuffledIndices: createShuffledIndices, rightPad: rightPad, repeatedTry: repeatedTry, inferFromImplicitShape: inferFromImplicitShape, squeezeShape: squeezeShape, getTypedArrayFromDType: getTypedArrayFromDType, checkComputationForNaN: checkComputationForNaN, checkConversionForNaN: checkConversionForNaN, hasEncodingLoss: hasEncodingLoss, isTypedArray: isTypedArray, bytesPerElement: bytesPerElement, isFunction: isFunction, nearestDivisor: nearestDivisor, computeStrides: computeStrides, toTypedArray: toTypedArray, makeOnesTypedArray: makeOnesTypedArray, makeZerosTypedArray: makeZerosTypedArray, now: now }), + Profiler = function () { + function e(e, t) { + this.backendTimer = e, this.logger = t, null == t && (this.logger = new Logger()); + }return e.prototype.profileKernel = function (e, t) { + var n, + r = this, + o = this.backendTimer.time(function () { + n = t(); + });return (Array.isArray(n) ? n : [n]).forEach(function (t) { + var n = t.dataSync();checkComputationForNaN(n, t.dtype, e), o.then(function (o) { + r.logger.logKernelProfile(e, t, n, o.kernelMs); + }); + }), n; + }, e; + }(), + Logger = function () { + function e() {}return e.prototype.logKernelProfile = function (e, t, n, r) { + var o = rightPad(r + "ms", 9), + a = rightPad(e, 25), + i = t.rank, + s = t.size, + u = rightPad(t.shape.toString(), 14);console.log("%c" + a + "\t%c" + o + "\t%c" + i + "D " + u + "\t%c" + s, "font-weight:bold", "color:red", "color:blue", "color: orange"); + }, e; + }();function getFilteredNodesXToY(e, t, n) { + for (var r = {}, o = {}, a = 0; a < t.length; a++) r[t[a].id] = !0;for (a = 0; a < e.length; a++) { + var i = (m = e[a]).inputs;for (var s in i) { + for (var u = i[s], l = !1, c = 0; c < t.length; c++) if (r[u.id]) { + r[m.output.id] = !0, l = !0, o[m.id] = !0;break; + }if (l) break; + } + }var p = {};p[n.id] = !0;var d = {};for (a = e.length - 1; a >= 0; a--) { + i = (m = e[a]).inputs;var h = [];h.push(m.output);for (c = 0; c < h.length; c++) if (p[h[c].id]) { + for (var s in i) p[i[s].id] = !0, d[m.id] = !0;break; + } + }var f = [];for (a = 0; a < e.length; a++) { + var m;if (o[(m = e[a]).id] && d[m.id]) { + var g = {};for (var s in m.inputs) { + var v = m.inputs[s];r[v.id] && (g[s] = v); + }var y = Object.assign({}, m);y.inputs = g, y.output = m.output, f.push(y); + } + }return f; + }function backpropagateGradients(e, t) { + for (var n = t.length - 1; n >= 0; n--) { + var r = t[n], + o = e[r.output.id];if (null == r.gradient) throw new Error("Cannot compute gradient: gradient function not found for " + r.name + ".");var a = r.gradient(o);for (var i in r.inputs) { + if (!(i in a)) throw new Error("Cannot backprop through input " + i + ". Available gradients found: " + Object.keys(a) + ".");var s = a[i](), + u = r.inputs[i];if (!arraysEqual(s.shape, u.shape)) throw new Error("Error in gradient for op " + r.name + ". The gradient of input '" + i + "' has shape '" + s.shape + "', which does not match the shape of the input '" + u.shape + "'");if (null == e[u.id]) e[u.id] = s;else { + var l = e[u.id];e[u.id] = l.add(s), l.dispose(); + } + } + } + }var FORMAT_LIMIT_NUM_VALS = 20, + FORMAT_NUM_FIRST_LAST_VALS = 3, + FORMAT_NUM_SIG_DIGITS = 7;function tensorToString(e, t, n, r) { + var o = computeStrides(t), + a = computeMaxSizePerColumn(e, t, o), + i = t.length, + s = subTensorToString(e, t, o, a), + u = ["Tensor"];return r && (u.push(" dtype: " + n), u.push(" rank: " + i), u.push(" shape: [" + t + "]"), u.push(" values:")), u.push(s.map(function (e) { + return " " + e; + }).join("\n")), u.join("\n"); + }function computeMaxSizePerColumn(e, t, n) { + var r = sizeFromShape(t), + o = n[n.length - 1], + a = new Array(o).fill(0);if (t.length > 1) for (var i = 0; i < r / o; i++) for (var s = i * o, u = 0; u < o; u++) a[u] = Math.max(a[u], valToString(e[s + u], 0).length);return a; + }function valToString(e, t) { + return rightPad(parseFloat(e.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(), t); + }function subTensorToString(e, t, n, r, o) { + void 0 === o && (o = !0);var a = t[0], + i = t.length;if (0 === i) return [e[0].toString()];if (1 === i) { + if (a > FORMAT_LIMIT_NUM_VALS) { + var s = Array.from(e.subarray(0, FORMAT_NUM_FIRST_LAST_VALS)), + u = Array.from(e.subarray(a - FORMAT_NUM_FIRST_LAST_VALS, a));return ["[" + s.map(function (e, t) { + return valToString(e, r[t]); + }).join(", ") + ", ..., " + u.map(function (e, t) { + return valToString(e, r[a - FORMAT_NUM_FIRST_LAST_VALS + t]); + }).join(", ") + "]"]; + }return ["[" + Array.from(e).map(function (e, t) { + return valToString(e, r[t]); + }).join(", ") + "]"]; + }var l = t.slice(1), + c = n.slice(1), + p = n[0], + d = [];if (a > FORMAT_LIMIT_NUM_VALS) { + for (var h = 0; h < FORMAT_NUM_FIRST_LAST_VALS; h++) { + var f = (m = h * p) + p;d.push.apply(d, subTensorToString(e.subarray(m, f), l, c, r, !1)); + }d.push("...");for (h = a - FORMAT_NUM_FIRST_LAST_VALS; h < a; h++) { + f = (m = h * p) + p;d.push.apply(d, subTensorToString(e.subarray(m, f), l, c, r, h === a - 1)); + } + } else for (h = 0; h < a; h++) { + var m;f = (m = h * p) + p;d.push.apply(d, subTensorToString(e.subarray(m, f), l, c, r, h === a - 1)); + }var g = 2 === i ? "," : "";d[0] = "[" + d[0] + g;for (h = 1; h < d.length - 1; h++) d[h] = " " + d[h] + g;var v = ",\n";for (h = 2; h < i; h++) v += "\n";return d[d.length - 1] = " " + d[d.length - 1] + "]" + (o ? "" : v), d; + }var TensorBuffer = function () { + function e(e, t, n) { + if (this.dtype = t, null != n) { + var r = n.length, + o = sizeFromShape(e);assert(r === o, "Length of values '" + r + "' does not match the size inferred by the shape '" + o + "'"); + }this.shape = e.slice(), this.values = n || getTypedArrayFromDType(t, sizeFromShape(e)), this.strides = computeStrides(e), this.size = sizeFromShape(e); + }return e.prototype.set = function (e) { + for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];0 === t.length && (t = [0]), assert(t.length === this.rank, "The number of provided coordinates (" + t.length + ") must match the rank (" + this.rank + ")");var r = this.locToIndex(t);this.values[r] = e; + }, e.prototype.get = function () { + for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];0 === e.length && (e = [0]);for (var n = e[e.length - 1], r = 0; r < e.length - 1; ++r) n += this.strides[r] * e[r];return this.values[n]; + }, e.prototype.locToIndex = function (e) { + if (0 === this.rank) return 0;if (1 === this.rank) return e[0];for (var t = e[e.length - 1], n = 0; n < e.length - 1; ++n) t += this.strides[n] * e[n];return t; + }, e.prototype.indexToLoc = function (e) { + if (0 === this.rank) return [];if (1 === this.rank) return [e];for (var t = new Array(this.shape.length), n = 0; n < t.length - 1; ++n) t[n] = Math.floor(e / this.strides[n]), e -= t[n] * this.strides[n];return t[t.length - 1] = e, t; + }, Object.defineProperty(e.prototype, "rank", { get: function () { + return this.shape.length; + }, enumerable: !0, configurable: !0 }), e.prototype.toTensor = function () { + return Tensor.make(this.shape, { values: this.values }, this.dtype); + }, e; + }(), + trackerFn = null, + opHandler = null;function setTensorTracker(e) { + trackerFn = e; + }function setOpHandler(e) { + opHandler = e; + }var Tensor = function () { + function e(t, n, r, o) { + this.isDisposedInternal = !1, this.size = sizeFromShape(t), null != r && assert(this.size === r.length, "Constructing tensor of shape (" + this.size + ") should match the length of values (" + r.length + ")"), this.shape = t.slice(), this.dtype = n || "float32", this.strides = computeStrides(t), this.dataId = null != o ? o : {}, this.id = e.nextId++, this.rankType = this.rank < 5 ? this.rank.toString() : "higher", trackerFn().registerTensor(this), null != r && trackerFn().write(this.dataId, r); + }return e.make = function (t, n, r) { + return new e(t, r, n.values, n.dataId); + }, e.prototype.flatten = function () { + return this.throwIfDisposed(), this.as1D(); + }, e.prototype.asScalar = function () { + return this.throwIfDisposed(), assert(1 === this.size, "The array must have only 1 element."), this.reshape([]); + }, e.prototype.as1D = function () { + return this.throwIfDisposed(), this.reshape([this.size]); + }, e.prototype.as2D = function (e, t) { + return this.throwIfDisposed(), this.reshape([e, t]); + }, e.prototype.as3D = function (e, t, n) { + return this.throwIfDisposed(), this.reshape([e, t, n]); + }, e.prototype.as4D = function (e, t, n, r) { + return this.throwIfDisposed(), this.reshape([e, t, n, r]); + }, e.prototype.asType = function (e) { + return this.throwIfDisposed(), opHandler.cast(this, e); + }, Object.defineProperty(e.prototype, "rank", { get: function () { + return this.shape.length; + }, enumerable: !0, configurable: !0 }), e.prototype.get = function () { + for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];assert(e.length === this.rank, "Number of coordinates in get() must match the rank of the tensor"), this.throwIfDisposed(), 0 === e.length && (e = [0]);for (var n = e[e.length - 1], r = 0; r < e.length - 1; ++r) n += this.strides[r] * e[r];return this.dataSync()[n]; + }, e.prototype.buffer = function () { + return opHandler.buffer(this.shape, this.dtype, this.dataSync()); + }, e.prototype.data = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (e) { + return this.throwIfDisposed(), [2, trackerFn().read(this.dataId)]; + }); + }); + }, e.prototype.dataSync = function () { + return this.throwIfDisposed(), trackerFn().readSync(this.dataId); + }, e.prototype.dispose = function () { + this.isDisposed || (trackerFn().disposeTensor(this), this.isDisposedInternal = !0); + }, Object.defineProperty(e.prototype, "isDisposed", { get: function () { + return this.isDisposedInternal; + }, enumerable: !0, configurable: !0 }), e.prototype.throwIfDisposed = function () { + if (this.isDisposed) throw new Error("Tensor is disposed."); + }, e.prototype.toFloat = function () { + return this.asType("float32"); + }, e.prototype.toInt = function () { + return this.asType("int32"); + }, e.prototype.toBool = function () { + return this.asType("bool"); + }, e.prototype.print = function (e) { + return void 0 === e && (e = !1), opHandler.print(this, e); + }, e.prototype.reshape = function (e) { + return this.throwIfDisposed(), opHandler.reshape(this, e); + }, e.prototype.reshapeAs = function (e) { + return this.throwIfDisposed(), this.reshape(e.shape); + }, e.prototype.expandDims = function (e) { + return void 0 === e && (e = 0), opHandler.expandDims(this, e); + }, e.prototype.cumsum = function (e, t, n) { + return void 0 === e && (e = 0), void 0 === t && (t = !1), void 0 === n && (n = !1), opHandler.cumsum(this, e, t, n); + }, e.prototype.squeeze = function (e) { + return this.throwIfDisposed(), opHandler.squeeze(this, e); + }, e.prototype.clone = function () { + return this.throwIfDisposed(), opHandler.clone(this); + }, e.prototype.toString = function (e) { + return void 0 === e && (e = !1), tensorToString(this.dataSync(), this.shape, this.dtype, e); + }, e.prototype.tile = function (e) { + return this.throwIfDisposed(), opHandler.tile(this, e); + }, e.prototype.gather = function (e, t) { + return void 0 === t && (t = 0), this.throwIfDisposed(), opHandler.gather(this, e, t); + }, e.prototype.matMul = function (e, t, n) { + return void 0 === t && (t = !1), void 0 === n && (n = !1), this.throwIfDisposed(), opHandler.matMul(this, e, t, n); + }, e.prototype.dot = function (e) { + return this.throwIfDisposed(), opHandler.dot(this, e); + }, e.prototype.norm = function (e, t, n) { + return void 0 === e && (e = "euclidean"), void 0 === t && (t = null), void 0 === n && (n = !1), this.throwIfDisposed(), opHandler.norm(this, e, t, n); + }, e.prototype.slice = function (e, t) { + return this.throwIfDisposed(), opHandler.slice(this, e, t); + }, e.prototype.reverse = function (e) { + return this.throwIfDisposed(), opHandler.reverse(this, e); + }, e.prototype.concat = function (e, t) { + return void 0 === t && (t = 0), this.throwIfDisposed(), opHandler.concat([this, e], t); + }, e.prototype.stack = function (e, t) { + return void 0 === t && (t = 0), opHandler.stack([this, e], t); + }, e.prototype.unstack = function (e, t) { + return void 0 === t && (t = 0), opHandler.unstack(this, t); + }, e.prototype.pad = function (e, t) { + return void 0 === t && (t = 0), opHandler.pad(this, e, t); + }, e.prototype.batchNormalization = function (e, t, n, r, o) { + return void 0 === n && (n = .001), this.throwIfDisposed(), opHandler.batchNormalization(this, e, t, n, r, o); + }, e.prototype.all = function (e, t) { + return void 0 === e && (e = null), void 0 === t && (t = !1), this.throwIfDisposed(), opHandler.all(this, e, t); + }, e.prototype.any = function (e, t) { + return void 0 === e && (e = null), void 0 === t && (t = !1), this.throwIfDisposed(), opHandler.any(this, e, t); + }, e.prototype.logSumExp = function (e, t) { + return void 0 === e && (e = null), void 0 === t && (t = !1), this.throwIfDisposed(), opHandler.logSumExp(this, e, t); + }, e.prototype.sum = function (e, t) { + return void 0 === e && (e = null), void 0 === t && (t = !1), this.throwIfDisposed(), opHandler.sum(this, e, t); + }, e.prototype.mean = function (e, t) { + return void 0 === e && (e = null), void 0 === t && (t = !1), this.throwIfDisposed(), opHandler.mean(this, e, t); + }, e.prototype.min = function (e, t) { + return void 0 === e && (e = null), void 0 === t && (t = !1), this.throwIfDisposed(), opHandler.min(this, e, t); + }, e.prototype.max = function (e, t) { + return void 0 === e && (e = null), void 0 === t && (t = !1), this.throwIfDisposed(), opHandler.max(this, e, t); + }, e.prototype.argMin = function (e) { + return void 0 === e && (e = null), this.throwIfDisposed(), opHandler.argMin(this, e); + }, e.prototype.argMax = function (e) { + return void 0 === e && (e = null), this.throwIfDisposed(), opHandler.argMax(this, e); + }, e.prototype.cast = function (e) { + return this.throwIfDisposed(), opHandler.cast(this, e); + }, e.prototype.add = function (e) { + return this.throwIfDisposed(), opHandler.add(this, e); + }, e.prototype.addStrict = function (e) { + return this.throwIfDisposed(), opHandler.addStrict(this, e); + }, e.prototype.sub = function (e) { + return this.throwIfDisposed(), opHandler.sub(this, e); + }, e.prototype.subStrict = function (e) { + return this.throwIfDisposed(), opHandler.subStrict(this, e); + }, e.prototype.pow = function (e) { + return this.throwIfDisposed(), opHandler.pow(this, e); + }, e.prototype.powStrict = function (e) { + return this.throwIfDisposed(), opHandler.powStrict(this, e); + }, e.prototype.mul = function (e) { + return this.throwIfDisposed(), opHandler.mul(this, e); + }, e.prototype.mulStrict = function (e) { + return this.throwIfDisposed(), opHandler.mulStrict(this, e); + }, e.prototype.div = function (e) { + return this.throwIfDisposed(), opHandler.div(this, e); + }, e.prototype.floorDiv = function (e) { + return this.throwIfDisposed(), opHandler.floorDiv(this, e); + }, e.prototype.divStrict = function (e) { + return this.throwIfDisposed(), opHandler.divStrict(this, e); + }, e.prototype.minimum = function (e) { + return this.throwIfDisposed(), opHandler.minimum(this, e); + }, e.prototype.minimumStrict = function (e) { + return this.throwIfDisposed(), opHandler.minimumStrict(this, e); + }, e.prototype.maximum = function (e) { + return this.throwIfDisposed(), opHandler.maximum(this, e); + }, e.prototype.maximumStrict = function (e) { + return this.throwIfDisposed(), opHandler.maximumStrict(this, e); + }, e.prototype.mod = function (e) { + return this.throwIfDisposed(), opHandler.mod(this, e); + }, e.prototype.modStrict = function (e) { + return this.throwIfDisposed(), opHandler.modStrict(this, e); + }, e.prototype.squaredDifference = function (e) { + return this.throwIfDisposed(), opHandler.squaredDifference(this, e); + }, e.prototype.squaredDifferenceStrict = function (e) { + return this.throwIfDisposed(), opHandler.squaredDifferenceStrict(this, e); + }, e.prototype.transpose = function (e) { + return this.throwIfDisposed(), opHandler.transpose(this, e); + }, e.prototype.notEqual = function (e) { + return this.throwIfDisposed(), opHandler.notEqual(this, e); + }, e.prototype.notEqualStrict = function (e) { + return this.throwIfDisposed(), opHandler.notEqualStrict(this, e); + }, e.prototype.less = function (e) { + return this.throwIfDisposed(), opHandler.less(this, e); + }, e.prototype.lessStrict = function (e) { + return this.throwIfDisposed(), opHandler.lessStrict(this, e); + }, e.prototype.equal = function (e) { + return this.throwIfDisposed(), opHandler.equal(this, e); + }, e.prototype.equalStrict = function (e) { + return this.throwIfDisposed(), opHandler.equalStrict(this, e); + }, e.prototype.lessEqual = function (e) { + return this.throwIfDisposed(), opHandler.lessEqual(this, e); + }, e.prototype.lessEqualStrict = function (e) { + return this.throwIfDisposed(), opHandler.lessEqualStrict(this, e); + }, e.prototype.greater = function (e) { + return this.throwIfDisposed(), opHandler.greater(this, e); + }, e.prototype.greaterStrict = function (e) { + return this.throwIfDisposed(), opHandler.greaterStrict(this, e); + }, e.prototype.greaterEqual = function (e) { + return this.throwIfDisposed(), opHandler.greaterEqual(this, e); + }, e.prototype.greaterEqualStrict = function (e) { + return this.throwIfDisposed(), opHandler.greaterEqualStrict(this, e); + }, e.prototype.logicalAnd = function (e) { + return this.throwIfDisposed(), opHandler.logicalAnd(this, e); + }, e.prototype.logicalOr = function (e) { + return this.throwIfDisposed(), opHandler.logicalOr(this, e); + }, e.prototype.logicalNot = function () { + return this.throwIfDisposed(), opHandler.logicalNot(this); + }, e.prototype.logicalXor = function (e) { + return this.throwIfDisposed(), opHandler.logicalXor(this, e); + }, e.prototype.where = function (e, t) { + return this.throwIfDisposed(), opHandler.where(e, this, t); + }, e.prototype.neg = function () { + return this.throwIfDisposed(), opHandler.neg(this); + }, e.prototype.ceil = function () { + return this.throwIfDisposed(), opHandler.ceil(this); + }, e.prototype.floor = function () { + return this.throwIfDisposed(), opHandler.floor(this); + }, e.prototype.sign = function () { + return this.throwIfDisposed(), opHandler.sign(this); + }, e.prototype.exp = function () { + return this.throwIfDisposed(), opHandler.exp(this); + }, e.prototype.expm1 = function () { + return this.throwIfDisposed(), opHandler.expm1(this); + }, e.prototype.log = function () { + return this.throwIfDisposed(), opHandler.log(this); + }, e.prototype.log1p = function () { + return this.throwIfDisposed(), opHandler.log1p(this); + }, e.prototype.sqrt = function () { + return this.throwIfDisposed(), opHandler.sqrt(this); + }, e.prototype.rsqrt = function () { + return this.throwIfDisposed(), opHandler.rsqrt(this); + }, e.prototype.square = function () { + return this.throwIfDisposed(), opHandler.square(this); + }, e.prototype.reciprocal = function () { + return this.throwIfDisposed(), opHandler.reciprocal(this); + }, e.prototype.abs = function () { + return this.throwIfDisposed(), opHandler.abs(this); + }, e.prototype.clipByValue = function (e, t) { + return this.throwIfDisposed(), opHandler.clipByValue(this, e, t); + }, e.prototype.relu = function () { + return this.throwIfDisposed(), opHandler.relu(this); + }, e.prototype.elu = function () { + return this.throwIfDisposed(), opHandler.elu(this); + }, e.prototype.selu = function () { + return this.throwIfDisposed(), opHandler.selu(this); + }, e.prototype.leakyRelu = function (e) { + return void 0 === e && (e = .2), this.throwIfDisposed(), opHandler.leakyRelu(this, e); + }, e.prototype.prelu = function (e) { + return this.throwIfDisposed(), opHandler.prelu(this, e); + }, e.prototype.sigmoid = function () { + return this.throwIfDisposed(), opHandler.sigmoid(this); + }, e.prototype.logSigmoid = function () { + return this.throwIfDisposed(), opHandler.logSigmoid(this); + }, e.prototype.softplus = function () { + return this.throwIfDisposed(), opHandler.softplus(this); + }, e.prototype.sin = function () { + return this.throwIfDisposed(), opHandler.sin(this); + }, e.prototype.cos = function () { + return this.throwIfDisposed(), opHandler.cos(this); + }, e.prototype.tan = function () { + return this.throwIfDisposed(), opHandler.tan(this); + }, e.prototype.asin = function () { + return this.throwIfDisposed(), opHandler.asin(this); + }, e.prototype.acos = function () { + return this.throwIfDisposed(), opHandler.acos(this); + }, e.prototype.atan = function () { + return this.throwIfDisposed(), opHandler.atan(this); + }, e.prototype.sinh = function () { + return this.throwIfDisposed(), opHandler.sinh(this); + }, e.prototype.cosh = function () { + return this.throwIfDisposed(), opHandler.cosh(this); + }, e.prototype.tanh = function () { + return this.throwIfDisposed(), opHandler.tanh(this); + }, e.prototype.asinh = function () { + return this.throwIfDisposed(), opHandler.asinh(this); + }, e.prototype.acosh = function () { + return this.throwIfDisposed(), opHandler.acosh(this); + }, e.prototype.atanh = function () { + return this.throwIfDisposed(), opHandler.atanh(this); + }, e.prototype.erf = function () { + return this.throwIfDisposed(), opHandler.erf(this); + }, e.prototype.round = function () { + return this.throwIfDisposed(), opHandler.round(this); + }, e.prototype.step = function (e) { + return void 0 === e && (e = 0), this.throwIfDisposed(), opHandler.step(this, e); + }, e.prototype.softmax = function (e) { + return void 0 === e && (e = -1), this.throwIfDisposed(), opHandler.softmax(this, e); + }, e.prototype.resizeBilinear = function (e, t) { + return void 0 === t && (t = !1), this.throwIfDisposed(), opHandler.image.resizeBilinear(this, e, t); + }, e.prototype.resizeNearestNeighbor = function (e, t) { + return void 0 === t && (t = !1), this.throwIfDisposed(), opHandler.image.resizeNearestNeighbor(this, e, t); + }, e.prototype.conv1d = function (e, t, n, r, o, a) { + return void 0 === r && (r = "NWC"), void 0 === o && (o = 1), this.throwIfDisposed(), opHandler.conv1d(this, e, t, n, r, o, a); + }, e.prototype.conv2d = function (e, t, n, r, o, a) { + return void 0 === r && (r = "NHWC"), void 0 === o && (o = [1, 1]), this.throwIfDisposed(), opHandler.conv2d(this, e, t, n, r, o, a); + }, e.prototype.conv2dTranspose = function (e, t, n, r, o) { + return this.throwIfDisposed(), opHandler.conv2dTranspose(this, e, t, n, r, o); + }, e.prototype.depthwiseConv2D = function (e, t, n, r, o, a) { + return void 0 === r && (r = "NHWC"), void 0 === o && (o = [1, 1]), this.throwIfDisposed(), opHandler.depthwiseConv2d(this, e, t, n, r, o, a); + }, e.prototype.avgPool = function (e, t, n, r) { + return this.throwIfDisposed(), opHandler.avgPool(this, e, t, n, r); + }, e.prototype.maxPool = function (e, t, n, r) { + return this.throwIfDisposed(), opHandler.maxPool(this, e, t, n, r); + }, e.prototype.localResponseNormalization = function (e, t, n, r) { + return void 0 === e && (e = 5), void 0 === t && (t = 1), void 0 === n && (n = 1), void 0 === r && (r = .5), opHandler.localResponseNormalization(this, e, t, n, r); + }, e.prototype.variable = function (e, t, n) { + return void 0 === e && (e = !0), this.throwIfDisposed(), Variable.variable(this, e, t, n); + }, e.prototype.unsortedSegmentSum = function (e, t) { + return this.throwIfDisposed(), opHandler.unsortedSegmentSum(this, e, t); + }, e.prototype.batchToSpaceND = function (e, t) { + return this.throwIfDisposed(), opHandler.batchToSpaceND(this, e, t); + }, e.prototype.spaceToBatchND = function (e, t) { + return this.throwIfDisposed(), opHandler.spaceToBatchND(this, e, t); + }, e.nextId = 0, e; + }();Object.defineProperty(Tensor, Symbol.hasInstance, { value: function (e) { + return !!e && null != e.shape && null != e.dtype; + } });var Variable = function (e) { + function t(n, r, o) { + void 0 === r && (r = !0);var a = e.call(this, n.shape, n.dtype, null, n.dataId) || this;a.trainable = r, a.name = o, null == a.name && (a.name = t.nextVarId.toString(), t.nextVarId++);try { + trackerFn().registerVariable(a); + } catch (e) { + throw trackerFn().disposeTensor(a), e; + }return a; + }return __extends(t, e), t.variable = function (e, n, r, o) { + return void 0 === n && (n = !0), null != o && o !== e.dtype && (e = e.asType(o)), new t(e, n, r); + }, t.prototype.assign = function (e) { + if (e.dtype !== this.dtype) throw new Error("dtype of the new value (" + e.dtype + ") and previous value (" + this.dtype + ") must match");if (!arraysEqual(e.shape, this.shape)) throw new Error("shape of the new value (" + e.shape + ") and previous value (" + this.shape + ") must match");trackerFn().disposeTensor(this), this.dataId = e.dataId, trackerFn().registerTensor(this); + }, t.nextVarId = 0, t; + }(Tensor);Object.defineProperty(Variable, Symbol.hasInstance, { value: function (e) { + return e instanceof Tensor && null != e.assign && e.assign instanceof Function; + } });var variable = Variable.variable;function assertTypesMatch(e, t) { + assert(e.dtype === t.dtype, " The dtypes of the first(" + e.dtype + ") and second(" + t.dtype + ") input must match"); + }function isTensorInList(e, t) { + for (var n = 0; n < t.length; n++) if (t[n].id === e.id) return !0;return !1; + }function getTensorsInContainer(e) { + var t = [];return walkTensorContainer(e, t, new Set()), t; + }function walkTensorContainer(e, t, n) { + if (null != e) if (e instanceof Tensor) t.push(e);else if (isIterable(e)) { + var r = e;for (var o in r) { + var a = r[o];n.has(a) || (n.add(a), walkTensorContainer(a, t, n)); + } + } + }function isIterable(e) { + return Array.isArray(e) || "object" == typeof e; + }var Type, + Engine = function () { + function e(e, t, n) { + this.backend = e, this.safeMode = t, this.debugMode = n, this.registeredVariables = {}, this.refCounter = new WeakMap(), this.nextTapeNodeId = 0, this.numBytes = 0, this.numTensors = 0, this.numDataBuffers = 0, this.gradientScopeCount = 0, this.customGradientDepth = 0, this.keepTensors = new Set(), this.activeScope = { track: [], name: "default scope" }, this.scopeStack = [this.activeScope], this.profiler = new Profiler(e); + }return e.prototype.tidy = function (e, t, n) { + var r = this;void 0 === n && (n = !1);var o, + a = null;if (null == t) { + if ("function" != typeof e) throw new Error("Please provide a function to tidy()");t = e; + } else { + if ("string" != typeof e && !(e instanceof String)) throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if ("function" != typeof t) throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");a = e; + }return this.scopedRun(function () { + return r.startScope(a, n); + }, function () { + return r.endScope(o, n); + }, function () { + return (o = t()) instanceof Promise && console.error("Cannot return a Promise inside of tidy."), o; + }); + }, e.prototype.scopedRun = function (e, t, n) { + e();try { + var r = n();return t(), r; + } catch (e) { + throw t(), e; + } + }, e.prototype.runKernel = function (e, t, n) { + var r, + o = this, + a = [], + i = function (e) { + return a.push(e), e; + }, + s = this.activeScope.name;if (this.scopedRun(function () { + return o.customGradientDepth++; + }, function () { + return o.customGradientDepth--; + }, function () { + r = o.debugMode() ? o.profiler.profileKernel(s, function () { + return e(o.backend, i); + }) : e(o.backend, i); + }), this.shouldRecord()) { + var u = { id: this.nextTapeNodeId++, name: s, inputs: t, output: Array.isArray(r) ? r[0] : r };null != n && (u.gradient = function (e) { + return n(e, a); + }), this.activeTape.push(u); + }return r; + }, e.prototype.registerTensor = function (e) { + var t = this.refCounter.has(e.dataId) ? this.refCounter.get(e.dataId) : 0;this.numTensors++, 0 === t && (this.numDataBuffers++, this.numBytes += sizeFromShape(e.shape) * bytesPerElement(e.dtype), this.backend.register(e.dataId, e.shape, e.dtype)), this.refCounter.set(e.dataId, t + 1), e instanceof Variable || this.track(e); + }, e.prototype.registerVariable = function (e) { + if (null != this.registeredVariables[e.name]) throw new Error("Variable with name " + e.name + " was already registered");this.registeredVariables[e.name] = e; + }, e.prototype.disposeTensor = function (e) { + if (this.refCounter.has(e.dataId)) { + this.keepTensors.has(e.id) && this.keepTensors.delete(e.id), this.numTensors--;var t = this.refCounter.get(e.dataId);t <= 1 ? (this.refCounter.delete(e.dataId), this.backend.disposeData(e.dataId), this.numDataBuffers--, this.numBytes -= sizeFromShape(e.shape) * bytesPerElement(e.dtype)) : this.refCounter.set(e.dataId, t - 1); + } + }, e.prototype.disposeVariables = function () { + for (var e in this.registeredVariables) { + var t = this.registeredVariables[e];this.disposeTensor(t), delete this.registeredVariables[e]; + } + }, e.prototype.memory = function () { + var e = this.backend.memory();return e.numTensors = this.numTensors, e.numDataBuffers = this.numDataBuffers, e.numBytes = this.numBytes, e; + }, e.prototype.shouldRecord = function () { + return null != this.activeTape && 0 === this.customGradientDepth; + }, e.prototype.addTapeNode = function (e, t, n) { + var r = {};e.forEach(function (e, t) { + r[t] = e; + });var o = { id: this.nextTapeNodeId++, name: this.activeScope.name, inputs: r, output: t, gradient: function (e) { + var t = {};return n(e).forEach(function (e, n) { + t[n] = function () { + return e; + }; + }), t; + } };this.activeTape.push(o); + }, e.prototype.keep = function (e) { + if (1 === this.scopeStack.length && this.safeMode) throw new Error("Safe mode is ON. Enclose all tensor operations inside tf.tidy(): tf.tidy(() => {...}) to avoid memory leaks.");return this.keepTensors.add(e.id), e; + }, e.prototype.startScope = function (e, t) { + void 0 === t && (t = !1), t && 0 === this.gradientScopeCount && (this.activeTape = []), t && this.gradientScopeCount++;var n = { track: [], name: "unnamed scope" };e && (n.name = e), this.scopeStack.push(n), this.activeScope = n; + }, e.prototype.endScope = function (e, t) { + var n = this;void 0 === t && (t = !1), t && (this.gradientScopeCount--, 0 === this.gradientScopeCount && (this.activeTape = null));var r = new Set(this.keepTensors), + o = getTensorsInContainer(e);o.forEach(function (e) { + return r.add(e.id); + });for (var a = 0; a < this.activeScope.track.length; a++) { + var i = this.activeScope.track[a];r.has(i.id) || (null != this.activeTape ? o.push(i) : i.dispose()); + }var s = this.scopeStack.pop();this.activeScope = 0 === this.scopeStack.length ? { track: [], name: "default scope" } : this.scopeStack[this.scopeStack.length - 1], o.forEach(function (e) { + !n.keepTensors.has(e.id) && isTensorInList(e, s.track) && n.track(e); + }); + }, e.prototype.gradients = function (e, t, n, r) { + var o = this;return void 0 === r && (r = !1), assert(t.length > 0, "gradients() received an empty list of xs."), this.tidy("gradients", function () { + var a = e();assert(a instanceof Tensor, "The result y returned by f() must be a tensor.");var i = getFilteredNodesXToY(o.activeTape, t, a);if (!r && 0 === i.length && t.length > 0) throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");var s = {};return s[a.id] = null == n ? ones(a.shape) : n, backpropagateGradients(s, i), { value: a, grads: t.map(function (e) { + return s[e.id]; + }) }; + }, !0); + }, e.prototype.customGrad = function (e) { + var t = this;return assert(isFunction(e), "The f passed in customGrad(f) must be a function."), function () { + for (var n, r, o = [], a = 0; a < arguments.length; a++) o[a] = arguments[a];if (assert(o.every(function (e) { + return e instanceof Tensor; + }), "The args passed in customGrad(f)(x1, x2,...) must all be tensors"), t.scopedRun(function () { + return t.customGradientDepth++; + }, function () { + return t.customGradientDepth--; + }, function () { + r = t.tidy(e.name, function () { + var t = e.apply(void 0, o), + r = t.value, + a = t.gradFunc;return assert(r instanceof Tensor, "The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"), assert(isFunction(a), "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."), n = a, r; + }, !0); + }), t.shouldRecord()) { + t.addTapeNode(o, r, function (e) { + var t = n(e), + r = Array.isArray(t) ? t : [t];return assert(r.length === o.length, "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."), assert(r.every(function (e) { + return e instanceof Tensor; + }), "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."), r; + }); + }return r; + }; + }, e.prototype.write = function (e, t) { + this.backend.write(e, t); + }, e.prototype.readSync = function (e) { + return this.backend.readSync(e); + }, e.prototype.read = function (e) { + return this.backend.read(e); + }, e.prototype.fromPixels = function (e, t) { + return this.backend.fromPixels(e, t); + }, e.prototype.time = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t, n;return __generator(this, function (r) { + switch (r.label) {case 0: + return t = now(), [4, this.backend.time(e)];case 1: + return (n = r.sent()).wallMs = now() - t, [2, n];} + }); + }); + }, e.prototype.track = function (e) { + if (1 === this.scopeStack.length && this.safeMode) throw new Error("Safe mode is ON. Enclose all tensor operations inside tf.tidy(): tf.tidy(() => {op();...}); to avoid memory leaks.");return this.activeScope.track.push(e), e; + }, e; + }();function ones(e) { + var t = makeOnesTypedArray(sizeFromShape(e), "float32");return Tensor.make(e, { values: t }); + }!function (e) { + e[e.NUMBER = 0] = "NUMBER", e[e.BOOLEAN = 1] = "BOOLEAN", e[e.STRING = 2] = "STRING"; + }(Type || (Type = {}));var URL_PROPERTIES = [{ name: "DEBUG", type: Type.BOOLEAN }, { name: "IS_BROWSER", type: Type.BOOLEAN }, { name: "WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION", type: Type.NUMBER }, { name: "WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE", type: Type.BOOLEAN }, { name: "WEBGL_VERSION", type: Type.NUMBER }, { name: "WEBGL_RENDER_FLOAT32_ENABLED", type: Type.BOOLEAN }, { name: "WEBGL_DOWNLOAD_FLOAT_ENABLED", type: Type.BOOLEAN }, { name: "WEBGL_FENCE_API_ENABLED", type: Type.BOOLEAN }, { name: "BACKEND", type: Type.STRING }];function isWebGLVersionEnabled(e, t) { + var n;try { + n = getWebGLRenderingContext(e, t); + } catch (e) { + return !1; + }return null != n && (loseContext(n), !0); + }function getWebGLDisjointQueryTimerVersion(e, t) { + if (0 === e) return 0;var n, + r = getWebGLRenderingContext(e, t);return n = hasExtension(r, "EXT_disjoint_timer_query_webgl2") && 2 === e ? 2 : hasExtension(r, "EXT_disjoint_timer_query") ? 1 : 0, null != r && loseContext(r), n; + }function isRenderToFloatTextureEnabled(e, t) { + if (0 === e) return !1;var n = getWebGLRenderingContext(e, t);if (1 === e) { + if (!hasExtension(n, "OES_texture_float")) return !1; + } else if (!hasExtension(n, "EXT_color_buffer_float")) return !1;createFloatTextureAndBindToFramebuffer(n, e);var r = n.checkFramebufferStatus(n.FRAMEBUFFER) === n.FRAMEBUFFER_COMPLETE;return loseContext(n), r; + }function isDownloadFloatTextureEnabled(e, t) { + if (0 === e) return !1;var n = getWebGLRenderingContext(e, t);if (1 === e) { + if (!hasExtension(n, "OES_texture_float")) return !1; + } else if (!hasExtension(n, "EXT_color_buffer_float")) return !1;createFloatTextureAndBindToFramebuffer(n, e), n.readPixels(0, 0, 1, 1, n.RGBA, n.FLOAT, new Float32Array(4));var r = n.getError() === n.NO_ERROR;return loseContext(n), r; + }function isWebGLFenceEnabled(e, t) { + if (2 !== e) return !1;var n = getWebGLRenderingContext(e, t), + r = null != n.fenceSync;return loseContext(n), r; + }function isChrome() { + return "undefined" != typeof navigator && null != navigator && null != navigator.userAgent && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); + }var TENSORFLOWJS_FLAGS_PREFIX = "tfjsflags";function getFeaturesFromURL() { + var e = {};if ("undefined" == typeof window || void 0 === window.location) return e;var t = getQueryParams(window.location.search);if (TENSORFLOWJS_FLAGS_PREFIX in t) { + var n = {};t[TENSORFLOWJS_FLAGS_PREFIX].split(",").forEach(function (e) { + var t = e.split(":"), + r = t[0], + o = t[1];n[r] = o; + }), URL_PROPERTIES.forEach(function (t) { + t.name in n && (console.log("Setting feature override from URL " + t.name + ": " + n[t.name]), t.type === Type.NUMBER ? e[t.name] = +n[t.name] : t.type === Type.BOOLEAN ? e[t.name] = "true" === n[t.name] : t.type === Type.STRING ? e[t.name] = n[t.name] : console.warn("Unknown URL param: " + t.name + ".")); + }); + }return e; + }function hasExtension(e, t) { + return null != e.getExtension(t); + }function getWebGLRenderingContext(e, t) { + if (0 === e || !t) throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");var n = document.createElement("canvas");return 1 === e ? n.getContext("webgl") || n.getContext("experimental-webgl") : n.getContext("webgl2"); + }function loseContext(e) { + if (null != e) { + var t = e.getExtension("WEBGL_lose_context");if (null == t) throw new Error("Extension WEBGL_lose_context not supported on this browser.");t.loseContext(); + } + }function createFloatTextureAndBindToFramebuffer(e, t) { + var n = e.createFramebuffer(), + r = e.createTexture();e.bindTexture(e.TEXTURE_2D, r);var o = 2 === t ? e.RGBA32F : e.RGBA;e.texImage2D(e.TEXTURE_2D, 0, o, 1, 1, 0, e.RGBA, e.FLOAT, null), e.bindFramebuffer(e.FRAMEBUFFER, n), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, r, 0); + }function getQueryParams(e) { + var t = {};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, function (e) { + for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];return decodeParam(t, n[0], n[1]), n.join("="); + }), t; + }function decodeParam(e, t, n) { + e[decodeURIComponent(t)] = decodeURIComponent(n || ""); + }var TEST_EPSILON_FLOAT32_ENABLED = .001, + TEST_EPSILON_FLOAT32_DISABLED = .1, + Environment = function () { + function e(e) { + this.features = {}, this.registry = {}, null != e && (this.features = e), this.get("DEBUG") && console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance."); + }return e.setBackend = function (e, t) { + if (void 0 === t && (t = !1), !(e in ENV.registry)) throw new Error("Backend name '" + e + "' not found in registry");ENV.initBackend(e, t); + }, e.getBackend = function () { + return ENV.initDefaultBackend(), ENV.backendName; + }, e.disposeVariables = function () { + ENV.engine.disposeVariables(); + }, e.memory = function () { + return ENV.engine.memory(); + }, e.tidy = function (e, t, n) { + return void 0 === n && (n = !1), ENV.engine.tidy(e, t, n); + }, e.dispose = function (e) { + getTensorsInContainer(e).forEach(function (e) { + return e.dispose(); + }); + }, e.keep = function (e) { + return ENV.engine.keep(e); + }, e.time = function (e) { + return ENV.engine.time(e); + }, e.prototype.get = function (e) { + return e in this.features ? this.features[e] : (this.features[e] = this.evaluateFeature(e), this.features[e]); + }, e.prototype.getFeatures = function () { + return this.features; + }, e.prototype.set = function (e, t) { + this.features[e] = t; + }, e.prototype.getBestBackendName = function () { + var e = this;if (0 === Object.keys(this.registry).length) throw new Error("No backend found in registry.");return Object.keys(this.registry).map(function (t) { + return { name: t, entry: e.registry[t] }; + }).sort(function (e, t) { + return t.entry.priority - e.entry.priority; + })[0].name; + }, e.prototype.evaluateFeature = function (e) { + if ("DEBUG" === e) return !1;if ("IS_BROWSER" === e) return "undefined" != typeof window;if ("IS_NODE" === e) return "undefined" != typeof process && void 0 !== process.versions.node;if ("IS_CHROME" === e) return isChrome();if ("IS_TEST" === e) return !1;if ("BACKEND" === e) return this.getBestBackendName();if ("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION" === e) { + var t = this.get("WEBGL_VERSION");return 0 === t ? 0 : t > 0 ? 0 : getWebGLDisjointQueryTimerVersion(t, this.get("IS_BROWSER")); + }if ("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE" === e) return this.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 && !isMobile();if ("HAS_WEBGL" === e) return this.get("WEBGL_VERSION") > 0;if ("WEBGL_VERSION" === e) return isWebGLVersionEnabled(2, this.get("IS_BROWSER")) ? 2 : isWebGLVersionEnabled(1, this.get("IS_BROWSER")) ? 1 : 0;if ("WEBGL_RENDER_FLOAT32_ENABLED" === e) return isRenderToFloatTextureEnabled(this.get("WEBGL_VERSION"), this.get("IS_BROWSER"));if ("WEBGL_DOWNLOAD_FLOAT_ENABLED" === e) return isDownloadFloatTextureEnabled(this.get("WEBGL_VERSION"), this.get("IS_BROWSER"));if ("WEBGL_FENCE_API_ENABLED" === e) return isWebGLFenceEnabled(this.get("WEBGL_VERSION"), this.get("IS_BROWSER"));if ("TEST_EPSILON" === e) return this.get("WEBGL_RENDER_FLOAT32_ENABLED") ? TEST_EPSILON_FLOAT32_ENABLED : TEST_EPSILON_FLOAT32_DISABLED;throw new Error("Unknown feature " + e + "."); + }, e.prototype.setFeatures = function (e) { + this.features = Object.assign({}, e); + }, e.prototype.reset = function () { + this.features = getFeaturesFromURL(), null != this.globalEngine && (this.globalEngine = null); + }, e.prototype.initBackend = function (e, t) { + var n = this;void 0 === t && (t = !1), this.backendName = e, this.backend = this.findBackend(e), this.globalEngine = new Engine(this.backend, t, function () { + return n.get("DEBUG"); + }); + }, e.prototype.findBackend = function (e) { + return e in this.registry ? this.registry[e].backend : null; + }, e.prototype.registerBackend = function (e, t, n, r) { + var o = this;if (void 0 === n && (n = 1), e in this.registry) return console.warn(e + " backend was already registered. Reusing existing backend"), null != r && r(function () { + return o.engine; + }), !1;try { + var a = t();return this.registry[e] = { backend: a, priority: n }, !0; + } catch (t) { + return console.warn("Registration of backend " + e + " failed"), console.warn(t.stack || t.message), !1; + } + }, e.prototype.removeBackend = function (e) { + if (!(e in this.registry)) throw new Error(e + " backend not found in registry");this.registry[e].backend.dispose(), delete this.registry[e]; + }, Object.defineProperty(e.prototype, "engine", { get: function () { + return this.initDefaultBackend(), this.globalEngine; + }, enumerable: !0, configurable: !0 }), e.prototype.initDefaultBackend = function () { + null == this.globalEngine && this.initBackend(this.get("BACKEND"), !1); + }, e; + }();function getGlobalNamespace() { + var e;if ("undefined" != typeof window) e = window;else { + if ("undefined" == typeof process) throw new Error("Could not find a global object");e = process; + }return e; + }function getOrMakeEnvironment() { + var e = getGlobalNamespace();return null == e.ENV && (e.ENV = new Environment(getFeaturesFromURL()), setTensorTracker(function () { + return e.ENV.engine; + })), e.ENV; + }var ENV = getOrMakeEnvironment(), + environment = Object.freeze({ Environment: Environment, ENV: ENV });function warn() { + for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];ENV.get("IS_TEST") || console.warn.apply(console, e); + }function getReshaped(e, t, n, r) { + void 0 === r && (r = !0);var o = [];if (r) (o = o.concat(t.slice(0))).push(e[0] / n), o = o.concat(e.slice(1));else { + o = o.concat(e[0]);for (var a = t.length, i = 0; i < a; ++i) o = o.concat([e[i + 1] / t[i], t[i]]);o = o.concat(e.slice(a + 1)); + }return o; + }function getPermuted(e, t, n) { + void 0 === n && (n = !0);var r = [];if (n) { + r.push(t);for (var o = t + 1; o < e; ++o) o <= 2 * t ? (r.push(o), r.push(o - (t + 1))) : r.push(o); + } else { + var a = [], + i = [];for (o = 1; o < e; ++o) o >= 2 * t + 1 || o % 2 == 1 ? i.push(o) : a.push(o);r.push.apply(r, a), r.push(0), r.push.apply(r, i); + }return r; + }function getReshapedPermuted(e, t, n, r) { + void 0 === r && (r = !0);var o = [];r ? o.push(e[0] / n) : o.push(e[0] * n);for (var a = 1; a < e.length; ++a) a <= t.length ? r ? o.push(t[a - 1] * e[a]) : o.push(e[a] / t[a - 1]) : o.push(e[a]);return o; + }function getSliceBeginCoords(e, t) { + for (var n = [0], r = 0; r < t; ++r) n.push(e[r][0]);return n; + }function getSliceSize(e, t, n) { + for (var r = e.slice(0, 1), o = 0; o < n; ++o) r.push(e[o + 1] - t[o][0] - t[o][1]);return r; + }function axesAreInnerMostDims(e, t) { + for (var n = 0; n < e.length; ++n) if (e[e.length - n - 1] !== t - 1 - n) return !1;return !0; + }function combineLocations(e, t, n) { + for (var r = e.length + t.length, o = [], a = 0, i = 0, s = 0; s < r; s++) -1 === n.indexOf(s) ? o.push(e[a++]) : o.push(t[i++]);return o; + }function computeOutAndReduceShapes(e, t) { + for (var n = [], r = e.length, o = 0; o < r; o++) -1 === t.indexOf(o) && n.push(e[o]);return [n, t.map(function (t) { + return e[t]; + })]; + }function expandShapeToKeepDim(e, t) { + return combineLocations(e, t.map(function (e) { + return 1; + }), t); + }function parseAxisParam(e, t) { + var n = t.length;return assert((e = null == e ? t.map(function (e, t) { + return t; + }) : [].concat(e)).every(function (e) { + return e >= -n && e < n; + }), "All values in axis param must be in range [-" + n + ", " + n + ") but got axis " + e), assert(e.every(function (e) { + return isInt(e); + }), "All values in axis param must be integers but got axis " + e), e.map(function (e) { + return e < 0 ? n + e : e; + }); + }function assertAxesAreInnerMostDims(e, t, n) { + assert(axesAreInnerMostDims(t, n), e + " supports only inner-most axes for now. Got axes " + t + " and rank-" + n + " input."); + }function getAxesPermutation(e, t) { + if (axesAreInnerMostDims(e, t)) return null;for (var n = [], r = 0; r < t; ++r) -1 === e.indexOf(r) && n.push(r);return e.forEach(function (e) { + return n.push(e); + }), n; + }function getUndoAxesPermutation(e) { + return e.map(function (e, t) { + return [t, e]; + }).sort(function (e, t) { + return e[1] - t[1]; + }).map(function (e) { + return e[0]; + }); + }function getInnerMostAxes(e, t) { + for (var n = [], r = t - e; r < t; ++r) n.push(r);return n; + }var PARALLELIZE_THRESHOLD = 30;function computeOptimalWindowSize(e) { + return e <= PARALLELIZE_THRESHOLD ? e : nearestDivisor(e, Math.floor(Math.sqrt(e))); + }function segOpComputeOptimalWindowSize(e, t) { + var n, + r = !1;for (e <= PARALLELIZE_THRESHOLD ? (n = e, r = !0) : n = nearestDivisor(e, Math.floor(Math.sqrt(e))); !r;) { + if (n > t || n === e) { + r = !0;break; + }n = nearestDivisor(e, n + 1); + }return n; + }function computeOutShape(e, t, n) { + for (var r = [], o = e.length, a = 0; a < o; a++) a !== t ? r.push(e[a]) : r.push(n);return r; + }function assertParamsValid(e, t, n) { + assert(e.rank === t.length, "Error in slice" + e.rank + "D: Length of begin " + t + " must match the rank of the array (" + e.rank + ")."), assert(e.rank === n.length, "Error in slice" + e.rank + "D: Length of size " + n + " must match the rank of the array (" + e.rank + ").");for (var r = 0; r < e.rank; ++r) assert(t[r] + n[r] <= e.shape[r], "Error in slice" + e.rank + "D: begin[" + r + "] + size[" + r + "] (" + (t[r] + n[r]) + ") would overflow input.shape[" + r + "] (" + e.shape[r] + ")"); + }function getStridedSlicedInfo(e, t, n, r, o, a) { + void 0 === o && (o = 0), void 0 === a && (a = 0);for (var i = [], s = [], u = 0; u < e.length; u++) i[u] = startForAxis(o, t, r, e, u), s[u] = stopForAxis(a, n, r, e, u);var l = new Array(e.length).fill(0);return l = l.map(function (e, t) { + for (var n = 0, o = i[t]; !(r[t] > 0 ? o >= s[t] : o <= s[t]); o += r[t]) n += 1;return n; + }), [i, l]; + }function startForAxis(e, t, n, r, o) { + var a = t[o];e & 1 << o && (a = n[o] > 0 ? Number.MIN_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);var i = r[o];return a < 0 && (a += i), a = clamp(0, a, i - 1); + }function stopForAxis(e, t, n, r, o) { + var a = t[o];e & 1 << o && (a = n[o] > 0 ? Number.MAX_SAFE_INTEGER : Number.MIN_SAFE_INTEGER);var i = r[o];return a < 0 && (a += i), a = n[o] > 0 ? clamp(0, a, i) : clamp(-1, a, i - 1); + }function grad(e) { + return assert(isFunction(e), "The f passed in grad(f) must be a function"), function (t, n) { + return assert(t instanceof Tensor, "The x passed in grad(f)(x) must be a tensor"), assert(null == n || n instanceof Tensor, "The dy passed in grad(f)(x, dy) must be a tensor"), ENV.engine.tidy(function () { + var r = ENV.engine.gradients(function () { + return e(t); + }, [t], n), + o = r.value, + a = r.grads;return null != n && assertShapesMatch(o.shape, n.shape, "The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"), checkGrads(a), a[0]; + }); + }; + }function grads(e) { + return assert(isFunction(e), "The f passed in grads(f) must be a function"), function (t, n) { + return assert(Array.isArray(t) && t.every(function (e) { + return e instanceof Tensor; + }), "The args passed in grads(f)(args) must be an array of tensors"), assert(null == n || n instanceof Tensor, "The dy passed in grads(f)(args, dy) must be a tensor"), ENV.engine.tidy(function () { + var r = ENV.engine.gradients(function () { + return e.apply(void 0, t); + }, t, n), + o = r.value, + a = r.grads;return null != n && assertShapesMatch(o.shape, n.shape, "The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), checkGrads(a), a; + }); + }; + }function valueAndGrad(e) { + return assert(isFunction(e), "The f passed in valueAndGrad(f) must be a function"), function (t, n) { + assert(t instanceof Tensor, "The x passed in valueAndGrad(f)(x) must be a tensor"), assert(null == n || n instanceof Tensor, "The dy passed in valueAndGrad(f)(x, dy) must be a tensor");var r = ENV.engine.gradients(function () { + return e(t); + }, [t], n), + o = r.grads, + a = r.value;return checkGrads(o), { grad: o[0], value: a }; + }; + }function valueAndGrads(e) { + return assert(isFunction(e), "The f passed in valueAndGrads(f) must be a function"), function (t, n) { + assert(Array.isArray(t) && t.every(function (e) { + return e instanceof Tensor; + }), "The args passed in valueAndGrads(f)(args) must be array of tensors"), assert(null == n || n instanceof Tensor, "The dy passed in valueAndGrads(f)(args, dy) must be a tensor");var r = ENV.engine.gradients(function () { + return e.apply(void 0, t); + }, t, n);return null != n && assertShapesMatch(r.value.shape, n.shape, "The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), checkGrads(r.grads), r; + }; + }function variableGrads(e, t) { + if (assert(isFunction(e), "The f passed in variableGrads(f) must be a function"), assert(null == t || Array.isArray(t) && t.every(function (e) { + return e instanceof Variable; + }), "The varList passed in variableGrads(f, varList) must be an array of variables"), null == t) for (var n in t = [], ENV.engine.registeredVariables) t.push(ENV.engine.registeredVariables[n]);var r = t.length;assert((t = t.filter(function (e) { + return e.trainable; + })).length > 0, "variableGrads() expects at least one of the input variables to be trainable, but none of the " + r + " variables is trainable.");var o = ENV.engine.gradients(e, t, null, !0), + a = o.value, + i = o.grads;assert(i.some(function (e) { + return null != e; + }), "Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."), assert(0 === a.rank, "The f passed in variableGrads(f) must return a scalar, but it returned a rank-" + a.rank + " tensor");var s = {};return t.forEach(function (e, t) { + null != i[t] && (s[e.name] = i[t]); + }), { value: a, grads: s }; + }function customGrad(e) { + return ENV.engine.customGrad(e); + }function checkGrads(e) { + if (e.filter(function (e) { + return null == e; + }).length > 0) throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y."); + }function convertToTensor(e, t, n, r) { + if (void 0 === r && (r = "float32"), r = r || "float32", e instanceof Tensor) return e;if (!isTypedArray(e) && !Array.isArray(e) && "number" != typeof e && "boolean" != typeof e) throw new Error("Argument '" + t + "' passed to '" + n + "' must be a Tensor or TensorLike, but got " + e.constructor.name);var o = inferShape(e);return isTypedArray(e) || Array.isArray(e) || (e = [e]), Tensor.make(o, { values: toTypedArray(e, r, ENV.get("DEBUG")) }, r); + }function convertToTensorArray(e, t, n) { + if (!Array.isArray(e)) throw new Error("Argument " + t + " passed to " + n + " must be a `Tensor[]` or `TensorLike[]`");return e.map(function (e, r) { + return convertToTensor(e, t + "[" + r + "]", n); + }); + }function op(e) { + var t = Object.keys(e);if (1 !== t.length) throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with " + t.length + " keys.");var n = t[0], + r = e[n];n.endsWith("_") && (n = n.substring(0, n.length - 1));var o = function () { + for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];ENV.engine.startScope(n);try { + var o = r.apply(void 0, e);return o instanceof Promise && console.error("Cannot return a Promise inside of tidy."), ENV.engine.endScope(o), o; + } catch (e) { + throw ENV.engine.endScope(null), e; + } + };return Object.defineProperty(o, "name", { value: n, configurable: !0 }), o; + }function softmax_(e, t) { + void 0 === t && (t = -1);var n = convertToTensor(e, "logits", "softmax");if (-1 === t && (t = n.rank - 1), t !== n.rank - 1) throw Error("Softmax along a non-last dimension is not yet supported. Logits was rank " + n.rank + " and dim was " + t);return customGrad(function (e) { + var n = e.logSumExp([t], !0), + r = e.toFloat().sub(n).exp();return { value: r, gradFunc: function (e) { + var n = e.mul(r);return n.sub(n.sum([t], !0).mul(r)); + } }; + })(n); + }var softmax = op({ softmax_: softmax_ });function tensor(e, t, n) { + if (void 0 === n && (n = "float32"), !isTypedArray(e) && !Array.isArray(e) && "number" != typeof e && "boolean" != typeof e) throw new Error("values passed to tensor(values) must be an array of numbers or booleans, or a TypedArray");var r = inferShape(e);return null != t && 1 !== r.length && assertShapesMatch(t, r, "Error creating a new Tensor. Inferred shape (" + r + ") does not match the provided shape (" + t + "). "), isTypedArray(e) || Array.isArray(e) || (e = [e]), t = t || r, Tensor.make(t, { values: toTypedArray(e, n, ENV.get("DEBUG")) }, n); + }function scalar(e, t) { + if (void 0 === t && (t = "float32"), isTypedArray(e) || Array.isArray(e)) throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean)");return tensor(e, [], t); + }function tensor1d(e, t) { + void 0 === t && (t = "float32"), assertNonNull(e);var n = inferShape(e);if (1 !== n.length) throw new Error("tensor1d() requires values to be a flat/TypedArray");return tensor(e, n, t); + }function tensor2d(e, t, n) { + if (void 0 === n && (n = "float32"), assertNonNull(e), null != t && 2 !== t.length) throw new Error("tensor2d() requires shape to have two numbers");var r = inferShape(e);if (2 !== r.length && 1 !== r.length) throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if (1 === r.length && null == t) throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return tensor(e, t = t || r, n); + }function tensor3d(e, t, n) { + if (void 0 === n && (n = "float32"), assertNonNull(e), null != t && 3 !== t.length) throw new Error("tensor3d() requires shape to have three numbers");var r = inferShape(e);if (3 !== r.length && 1 !== r.length) throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if (1 === r.length && null == t) throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return tensor(e, t = t || r, n); + }function tensor4d(e, t, n) { + if (void 0 === n && (n = "float32"), assertNonNull(e), null != t && 4 !== t.length) throw new Error("tensor4d() requires shape to have four numbers");var r = inferShape(e);if (4 !== r.length && 1 !== r.length) throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if (1 === r.length && null == t) throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return tensor(e, t = t || r, n); + }function tensor5d(e, t, n) { + if (void 0 === n && (n = "float32"), assertNonNull(e), null != t && 5 !== t.length) throw new Error("tensor5d() requires shape to have five numbers");var r = inferShape(e);if (5 !== r.length && 1 !== r.length) throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if (1 === r.length && null == t) throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return tensor(e, t = t || r, n); + }function tensor6d(e, t, n) { + if (void 0 === n && (n = "float32"), assertNonNull(e), null != t && 6 !== t.length) throw new Error("tensor6d() requires shape to have six numbers");var r = inferShape(e);if (6 !== r.length && 1 !== r.length) throw new Error("tensor6d() requires values to be number[][][][] or flat/TypedArray");if (1 === r.length && null == t) throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return tensor(e, t = t || r, n); + }function ones$1(e, t) { + void 0 === t && (t = "float32");var n = makeOnesTypedArray(sizeFromShape(e), t);return Tensor.make(e, { values: n }, t); + }function zeros(e, t) { + void 0 === t && (t = "float32");var n = makeZerosTypedArray(sizeFromShape(e), t);return Tensor.make(e, { values: n }, t); + }function fill(e, t, n) { + void 0 === n && (n = "float32");var r = getTypedArrayFromDType(n, sizeFromShape(e));return r.fill(t), Tensor.make(e, { values: r }, n); + }function onesLike_(e) { + var t = convertToTensor(e, "x", "onesLike");return ones$1(t.shape, t.dtype); + }function zerosLike_(e) { + var t = convertToTensor(e, "x", "zerosLike");return zeros(t.shape, t.dtype); + }function linspace(e, t, n) { + if (0 === n) throw new Error("Cannot request zero samples");var r = (t - e) / (n - 1), + o = makeZerosTypedArray(n, "float32");o[0] = e;for (var a = 1; a < o.length; a++) o[a] = o[a - 1] + r;return tensor1d(o, "float32"); + }function range(e, t, n, r) { + if (void 0 === n && (n = 1), void 0 === r && (r = "float32"), 0 === n) throw new Error("Cannot have a step of zero");if (e === t || e < t && n < 0 || t < e && n > 1) return zeros([0], r);var o = makeZerosTypedArray(Math.abs(Math.ceil((t - e) / n)), r);t < e && 1 === n && (n = -1), o[0] = e;for (var a = 1; a < o.length; a++) o[a] = o[a - 1] + n;return tensor1d(o, r); + }var DType, + UpcastInt32AndMap, + UpcastBoolAndMap, + UpcastFloat32AndMap, + onesLike = op({ onesLike_: onesLike_ }), + zerosLike = op({ zerosLike_: zerosLike_ });!function (e) { + e.float32 = "float32", e.int32 = "int32", e.bool = "bool"; + }(DType || (DType = {})), function (e) { + e.R0 = "R0", e.R1 = "R1", e.R2 = "R2", e.R3 = "R3", e.R4 = "R4", e.R5 = "R5", e.R6 = "R6"; + }(exports.Rank || (exports.Rank = {})), function (e) { + e.float32 = "float32", e.int32 = "int32", e.bool = "int32"; + }(UpcastInt32AndMap || (UpcastInt32AndMap = {})), function (e) { + e.float32 = "float32", e.int32 = "int32", e.bool = "bool"; + }(UpcastBoolAndMap || (UpcastBoolAndMap = {})), function (e) { + e.float32 = "float32", e.int32 = "float32", e.bool = "float32"; + }(UpcastFloat32AndMap || (UpcastFloat32AndMap = {}));var upcastTypeMap = { float32: UpcastFloat32AndMap, int32: UpcastInt32AndMap, bool: UpcastBoolAndMap };function upcastType(e, t) { + return upcastTypeMap[e][t]; + }function sumOutType(e) { + return upcastType(e, "int32"); + }function castTensor(e, t, n) { + if (!hasEncodingLoss(e.dtype, t)) return Tensor.make(e.shape, { dataId: e.dataId }, t);if ("int32" === t) return n.int(e);if ("bool" === t) return n.notEqual(e, scalar(0, e.dtype));throw new Error("Error in Cast: unknown dtype argument (" + t + ")"); + }function reshapeTensor(e, t) { + return Tensor.make(t, { dataId: e.dataId }, e.dtype); + }function nonMaxSuppressionImpl(e, t, n, r, o) { + for (var a = Array.from(t).map(function (e, t) { + return { score: e, boxIndex: t }; + }).filter(function (e) { + return e.score > o; + }).sort(function (e, t) { + return t.score - e.score; + }), i = [], s = 0; s < a.length; s++) { + var u = a[s], + l = u.score, + c = u.boxIndex;if (l < o) break;for (var p = !1, d = i.length - 1; d >= 0; --d) { + if (intersectionOverUnion(e, c, i[d]) >= r) { + p = !0;break; + } + }if (!p && (i.push(c), i.length >= n)) break; + }return tensor1d(i, "int32"); + }function intersectionOverUnion(e, t, n) { + var r = e.subarray(4 * t, 4 * t + 4), + o = e.subarray(4 * n, 4 * n + 4), + a = Math.min(r[0], r[2]), + i = Math.min(r[1], r[3]), + s = Math.max(r[0], r[2]), + u = Math.max(r[1], r[3]), + l = Math.min(o[0], o[2]), + c = Math.min(o[1], o[3]), + p = Math.max(o[0], o[2]), + d = Math.max(o[1], o[3]), + h = (s - a) * (u - i), + f = (p - l) * (d - c);if (h <= 0 || f <= 0) return 0;var m = Math.max(a, l), + g = Math.max(i, c), + v = Math.min(s, p), + y = Math.min(u, d), + x = Math.max(v - m, 0) * Math.max(y - g, 0);return x / (h + f - x); + }function topkImpl(e, t, n, r, o) { + for (var a = t[t.length - 1], i = [e.length / a, a], s = i[0], u = i[1], l = getTypedArrayFromDType(n, s * r), c = getTypedArrayFromDType("int32", s * r), p = 0; p < s; p++) { + for (var d = p * u, h = e.subarray(d, d + u), f = [], m = 0; m < h.length; m++) f.push({ value: h[m], index: m });f.sort(function (e, t) { + return t.value - e.value; + });var g = p * r, + v = l.subarray(g, g + r), + y = c.subarray(g, g + r);for (m = 0; m < r; m++) v[m] = f[m].value, y[m] = f[m].index; + }var x = t.slice();return x[x.length - 1] = r, [tensor(l, x, n), tensor(c, x, "int32")]; + }var ArgMinMaxProgram = function () { + return function (e, t, n) { + this.variableNames = ["A"];var r = e.windowSize, + o = e.batchSize, + a = e.inSize, + i = Math.ceil(a / r);n || this.variableNames.push("bestIndicesA"), this.outputShape = [o, i];var s = "max" === t ? ">" : "<", + u = n ? "inOffset + i;" : "round(getBestIndicesA(batch, inOffset + i));";this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * " + r + ";\n\n int bestIndex = 0;\n float bestValue = getA(batch, inOffset);\n\n for (int i = 0; i < " + r + "; i++) {\n int inIdx = " + u + ";\n float candidate = getA(batch, inIdx);\n if (candidate " + s + " bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n "; + }; + }(), + AvgPool2DBackpropProgram = function () { + return function (e) { + this.variableNames = ["dy"], this.outputShape = e.inShape;var t = e.filterHeight, + n = e.filterWidth, + r = e.strideHeight, + o = e.strideWidth, + a = t - 1 - e.padInfo.top, + i = n - 1 - e.padInfo.left, + s = 1 / (t * n);this.userCode = "\n const ivec2 pads = ivec2(" + a + ", " + i + ");\n const float avgMultiplier = float(" + s + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + t + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + r + ".0;\n\n if (dyR < 0.0 || dyR >= " + e.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < " + n + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + o + ".0;\n\n if (dyC < 0.0 || dyC >= " + e.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n "; + }; + }();function getBroadcastDims(e, t) { + for (var n = e.length, r = [], o = 0; o < n; o++) { + var a = n - 1 - o, + i = e[a] || 1;(t[t.length - 1 - o] || 1) > 1 && 1 === i && r.unshift(a); + }return r; + }function getReductionAxes(e, t) { + for (var n = [], r = 0; r < t.length; r++) { + var o = e[e.length - r - 1], + a = t.length - r - 1, + i = t[a];(null == o || 1 === o && i > 1) && n.unshift(a); + }return n; + }function broadcastDimsAreOuter(e) { + for (var t = 0; t < e.length; t++) if (e[t] !== t) return !1;return !0; + }function assertAndGetBroadcastShape(e, t) { + for (var n = [], r = "Operands could not be broadcast together with shapes " + e + " and " + t + ".", o = Math.max(e.length, t.length), a = 0; a < o; a++) { + var i = e[e.length - a - 1] || 1, + s = t[t.length - a - 1] || 1;if (i > 1 && s > 1 && i !== s) throw Error(r);n.unshift(Math.max(i, s)); + }return n; + }var BatchNormProgram = function () { + return function (e, t, n, r, o, a) { + this.outputShape = [], this.supportsBroadcasting = !0, this.variableNames = ["x", "mean", "variance"], assertAndGetBroadcastShape(e, t), assertAndGetBroadcastShape(e, n);var i = "0.0";null != r && (assertAndGetBroadcastShape(e, r), this.variableNames.push("offset"), i = "getOffsetAtOutCoords()");var s = "1.0";null != o && (assertAndGetBroadcastShape(e, o), this.variableNames.push("scale"), s = "getScaleAtOutCoords()"), this.outputShape = e, this.userCode = "\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = " + i + ";\n float scale = " + s + ";\n float inv = scale * inversesqrt(variance + float(" + a + "));\n setOutput((x - mean) * inv + offset);\n }\n "; + }; + }(), + CHECK_NAN_SNIPPET = "\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n", + ADD = "return a + b;", + SUB = "return a - b;", + MUL = "return a * b;", + DIV = "if (a == b) return 1.0;\n return a / b;", + INT_DIV = "\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n", + POW = "\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n", + SQUARED_DIFFERENCE = "return (a - b) * (a - b);", + EQUAL = "return float(a == b);", + NOT_EQUAL = "return float(a != b);", + LESS = "return float(a < b);", + LESS_EQUAL = "return float(a <= b);", + GREATER = "return float(a > b);", + GREATER_EQUAL = "return float(a >= b);", + LOGICAL_AND = "return float(a >= 1.0 && b >= 1.0);", + LOGICAL_OR = "return float(a >= 1.0 || b >= 1.0);", + MAX = CHECK_NAN_SNIPPET + "\n return max(a, b);\n", + MIN = CHECK_NAN_SNIPPET + "\n return min(a, b);\n", + MOD = "if (b == 0.0) return NAN;\n return mod(a, b);", + ATAN2 = CHECK_NAN_SNIPPET + "\n return atan(a, b);\n", + ELU_DER = "return (b >= 1.0) ? a : a * (b + 1.0);", + BinaryOpProgram = function () { + function e(e, t, n) { + this.variableNames = ["A", "B"], this.supportsBroadcasting = !0, this.outputShape = assertAndGetBroadcastShape(t, n), this.userCode = "\n uniform float NAN;\n float binaryOperation(float a, float b) {\n " + e + "\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n "; + }return e.prototype.getCustomSetupFunc = function () { + var e = this;return function (t, n) { + null == e.startLoc && (e.startLoc = t.getUniformLocationNoThrow(n, "NAN"), null == e.startLoc) || t.gl.uniform1f(e.startLoc, NaN); + }; + }, e; + }(), + ClipProgram = function () { + return function (e, t, n) { + this.variableNames = ["A"], this.outputShape = e;var r = t.toFixed(20), + o = n.toFixed(20);this.userCode = "\n void main() {\n float value = getAAtOutCoords();\n if (isNaN(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, " + r + ", " + o + "));\n }\n "; + }; + }();function assertParams(e, t, n) { + var r = e.length, + o = t.length;assert(e.length === t.length, "Error in concat" + r + "D: rank of x1 (" + r + ") and x2 (" + o + ") must be the same."), assert(n >= 0 && n < r, "Error in concat" + r + "D: axis must be between 0 and " + (r - 1) + ".");for (var a = 0; a < r; a++) assert(a === n || e[a] === t[a], "Error in concat" + r + "D: Shape (" + e + ") does not match (" + t + ") along the non-concatenated axis " + a + "."); + }function computeOutShape$1(e, t, n) { + assert(e.length === t.length, "x1 and x2 should have the same rank.");var r = e.slice();return r[n] += t[n], r; + }function computeGradientSliceShapes(e, t) { + return { aBegin: [0, 0], aSize: e, bBegin: [0, e[1]], bSize: t }; + }var ConcatProgram = function () { + return function (e, t) { + this.variableNames = ["A", "B"], this.outputShape = [], this.outputShape = computeOutShape$1(e, t, 1), this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n float value = 0.0;\n if (yC < " + e[1] + ") {\n value = getA(yR, yC);\n } else {\n yC -= " + e[1] + ";\n value = getB(yR, yC);\n }\n\n setOutput(value);\n }\n "; + }; + }(), + Conv2DDerFilterProgram = function () { + return function (e) { + this.variableNames = ["x", "dy"], this.outputShape = e.filterShape;var t = e.strideHeight, + n = e.strideWidth, + r = e.padInfo.top, + o = e.padInfo.left;this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < " + e.batchSize + "; b++) {\n for (int yR = 0; yR < " + e.outHeight + "; yR++) {\n int xR = wR + yR * " + t + " - " + r + ";\n\n if (xR < 0 || xR >= " + e.inHeight + ") {\n continue;\n }\n\n for (int yC = 0; yC < " + e.outWidth + "; yC++) {\n int xC = wC + yC * " + n + " - " + o + ";\n\n if (xC < 0 || xC >= " + e.inWidth + ") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "; + }; + }(), + Conv2DDerInputProgram = function () { + return function (e) { + this.variableNames = ["dy", "W"], this.outputShape = e.inShape;var t = e.filterHeight, + n = e.filterWidth, + r = e.strideHeight, + o = e.strideWidth, + a = t - 1 - e.padInfo.top, + i = n - 1 - e.padInfo.left;this.userCode = "\n const ivec2 pads = ivec2(" + a + ", " + i + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + t + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + r + ".0;\n\n if (dyR < 0.0 || dyR >= " + e.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = " + t + " - 1 - wR;\n\n for (int wC = 0; wC < " + n + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + o + ".0;\n\n if (dyC < 0.0 || dyC >= " + e.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = " + n + " - 1 - wC;\n\n for (int d2 = 0; d2 < " + e.outChannels + "; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "; + }; + }(), + DepthwiseConv2DDerFilterProgram = function () { + return function (e) { + this.variableNames = ["x", "dy"], this.outputShape = e.filterShape;var t = e.strideHeight, + n = e.strideWidth, + r = e.padInfo.top, + o = e.padInfo.left, + a = e.outChannels / e.inChannels;this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * " + a + " + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < " + e.batchSize + "; b++) {\n for (int yR = 0; yR < " + e.outHeight + "; yR++) {\n int xR = wR + yR * " + t + " - " + r + ";\n\n if (xR < 0 || xR >= " + e.inHeight + ") {\n continue;\n }\n\n for (int yC = 0; yC < " + e.outWidth + "; yC++) {\n int xC = wC + yC * " + n + " - " + o + ";\n\n if (xC < 0 || xC >= " + e.inWidth + ") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "; + }; + }(), + DepthwiseConv2DDerInputProgram = function () { + return function (e) { + this.variableNames = ["dy", "W"], this.outputShape = e.inShape;var t = e.filterHeight, + n = e.filterWidth, + r = e.strideHeight, + o = e.strideWidth, + a = t - 1 - e.padInfo.top, + i = n - 1 - e.padInfo.left, + s = e.outChannels / e.inChannels;this.userCode = "\n const ivec2 pads = ivec2(" + a + ", " + i + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < " + t + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + r + ".0;\n\n if (dyR < 0.0 || dyR >= " + e.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = " + t + " - 1 - wR;\n\n for (int wC = 0; wC < " + n + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + o + ".0;\n\n if (dyC < 0.0 || dyC >= " + e.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = " + n + " - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < " + s + "; dm++) {\n int d2 = d1 * " + s + " + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "; + }; + }(), + Conv2DProgram = function () { + return function (e) { + this.variableNames = ["x", "W"], this.outputShape = e.outShape;var t = e.padInfo.top, + n = e.padInfo.left, + r = e.strideHeight, + o = e.strideWidth, + a = e.dilationHeight, + i = e.dilationWidth, + s = e.filterHeight, + u = e.filterWidth, + l = 4 * Math.floor(e.inChannels / 4), + c = e.inChannels % 4;this.userCode = "\n const ivec2 strides = ivec2(" + r + ", " + o + ");\n const ivec2 pads = ivec2(" + t + ", " + n + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + s + "; wR++) {\n int xR = xRCorner + wR * " + a + ";\n\n if (xR < 0 || xR >= " + e.inHeight + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + u + "; wC++) {\n int xC = xCCorner + wC * " + i + ";\n\n if (xC < 0 || xC >= " + e.inWidth + ") {\n continue;\n }\n\n for (int d1 = 0; d1 < " + l + "; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (" + (1 === c) + ") {\n dotProd +=\n getX(batch, xR, xC, " + l + ") *\n getW(wR, wC, " + l + ", d2);\n } else if (" + (2 === c) + ") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, " + l + "),\n getX(batch, xR, xC, " + l + " + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, " + l + ", d2),\n getW(wR, wC, " + l + " + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (" + (3 === c) + ") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, " + l + "),\n getX(batch, xR, xC, " + l + " + 1),\n getX(batch, xR, xC, " + l + " + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, " + l + ", d2),\n getW(wR, wC, " + l + " + 1, d2),\n getW(wR, wC, " + l + " + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n "; + }; + }(), + DepthwiseConv2DProgram = function () { + return function (e) { + this.variableNames = ["x", "W"], this.outputShape = e.outShape;var t = e.inHeight, + n = e.inWidth, + r = e.padInfo.top, + o = e.padInfo.left, + a = e.strideHeight, + i = e.strideWidth, + s = e.dilationHeight, + u = e.dilationWidth, + l = e.filterHeight, + c = e.filterWidth, + p = e.outChannels / e.inChannels;this.userCode = "\n const ivec2 strides = ivec2(" + a + ", " + i + ");\n const ivec2 pads = ivec2(" + r + ", " + o + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / " + p + ";\n int q = d2 - d1 * " + p + ";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < " + l + "; wR++) {\n int xR = xRCorner + wR * " + s + ";\n\n if (xR < 0 || xR >= " + t + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + c + "; wC++) {\n int xC = xCCorner + wC * " + u + ";\n\n if (xC < 0 || xC >= " + n + ") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n "; + }; + }();function makeShader(e, t, n, r) { + var o = e.map(function (e) { + var t = sizeFromShape(e.shapeInfo.logicalShape);return e.shapeInfo.isUniform ? "uniform float " + e.name + (t > 1 ? "[" + t + "]" : "") + ";" : "uniform sampler2D " + e.name + ";"; + });o = o.join("\n");var a = e.map(function (e) { + return getInputSamplingSnippet(e, t, r); + }).join("\n"), + i = t.texShape, + s = getOutputSamplingSnippet(t.logicalShape, i);return [SHADER_PREFIX, FLOAT_TEXTURE_SAMPLE_SNIPPET, FLOAT_TEXTURE_SETOUTPUT_SNIPPET, o, s, a, n].join("\n"); + }function getSamplerFromInInfo(e) { + var t = e.shapeInfo.logicalShape;switch (t.length) {case 0: + return getSamplerScalar(e);case 1: + return getSampler1D(e);case 2: + return getSampler2D(e);case 3: + return getSampler3D(e);case 4: + return getSampler4D(e);case 5: + return getSampler5D(e);case 6: + return getSampler6D(e);default: + throw new Error(t.length + "-D input sampling is not yet supported");} + }function getInputSamplingSnippet(e, t, n) { + var r = getSamplerFlat(e);return r += getSamplerFromInInfo(e), (n || arraysEqual(e.shapeInfo.logicalShape, t.logicalShape)) && (r += getSamplerAtOutputCoords(e, t, n)), r; + }function getOutputSamplingSnippet(e, t) { + switch (e.length) {case 0: + return getOutputScalarCoords();case 1: + return getOutput1DCoords(e, t);case 2: + return getOutput2DCoords(e, t);case 3: + return getOutput3DCoords(e, t);case 4: + return getOutput4DCoords(e, t);case 5: + return getOutput5DCoords(e, t);case 6: + return getOutput6DCoords(e, t);default: + throw new Error(e.length + "-D output sampling is not yet supported");} + }var SAMPLE_1D_SNIPPET = "\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n", + SAMPLE_2D_SNIPPET = "\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\n int index = row * numC + col;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n", + SAMPLE_3D_SNIPPET = "\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\n int stride1, int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n", + SAMPLE_4D_SNIPPET = "\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int row, int col, int depth,\n int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n", + SAMPLE_5D_SNIPPET = "\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int row, int col, int depth,\n int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2 * stride3 + depth3;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n", + SAMPLE_6D_SNIPPET = "\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int stride4,\n int row, int col, int depth, int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\n stride3 + depth3 * stride4 + depth4;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n", + FLOAT_TEXTURE_SAMPLE_SNIPPET = "\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return texture2D(textureSampler, uv).r;\n }\n", + FLOAT_TEXTURE_SETOUTPUT_SNIPPET = "\n void setOutput(float val) {\n gl_FragColor = vec4(val, 0, 0, 0);\n }\n", + SHADER_PREFIX = "\n precision highp float;\n precision highp int;\n varying vec2 resultUV;\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n bool isNaN(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n bool hasNaN(vec4 values) {\n vec4 v1 = values * values;\n vec4 v2 = values * values;\n return any(notEqual(v1, v2));\n }\n\n float getNaN(vec4 values) {\n return dot(vec4(1), values);\n }\n\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n " + SAMPLE_1D_SNIPPET + "\n " + SAMPLE_2D_SNIPPET + "\n " + SAMPLE_3D_SNIPPET + "\n " + SAMPLE_4D_SNIPPET + "\n " + SAMPLE_5D_SNIPPET + "\n " + SAMPLE_6D_SNIPPET + "\n";function getOutputScalarCoords() { + return "\n int getOutputCoords() {\n return 0;\n }\n "; + }function getOutput1DCoords(e, t) { + return 1 === t[0] ? "\n int getOutputCoords() {\n return int(resultUV.x * " + t[1] + ".0);\n }\n " : 1 === t[1] ? "\n int getOutputCoords() {\n return int(resultUV.y * " + t[0] + ".0);\n }\n " : "\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + t[0] + ", " + t[1] + "));\n return resTexRC.x * " + t[1] + " + resTexRC.y;\n }\n "; + }function getOutput3DCoords(e, t) { + var n = e[1] * e[2], + r = e[2];return "\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + t[0] + ", " + t[1] + "));\n int index = resTexRC.x * " + t[1] + " + resTexRC.y;\n int r = index / " + n + ";\n index -= r * " + n + ";\n int c = index / " + r + ";\n int d = index - c * " + r + ";\n return ivec3(r, c, d);\n }\n "; + }function getOutput4DCoords(e, t) { + var n = e[3], + r = e[2] * n, + o = e[1] * r;return "\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + t[0] + ", " + t[1] + "));\n int index = resTexRC.x * " + t[1] + " + resTexRC.y;\n\n int r = index / " + o + ";\n index -= r * " + o + ";\n\n int c = index / " + r + ";\n index -= c * " + r + ";\n\n int d = index / " + n + ";\n int d2 = index - d * " + n + ";\n\n return ivec4(r, c, d, d2);\n }\n "; + }function getOutput5DCoords(e, t) { + var n = e[4], + r = e[3] * n, + o = e[2] * r, + a = e[1] * o;return "\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(" + t[0] + ",\n " + t[1] + "));\n\n int index = resTexRC.x * " + t[1] + " + resTexRC.y;\n\n int r = index / " + a + ";\n index -= r * " + a + ";\n\n int c = index / " + o + ";\n index -= c * " + o + ";\n\n int d = index / " + r + ";\n index -= d * " + r + ";\n\n int d2 = index / " + n + ";\n int d3 = index - d2 * " + n + ";\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n "; + }function getOutput6DCoords(e, t) { + var n = e[5], + r = e[4] * n, + o = e[3] * r, + a = e[2] * o, + i = e[1] * a;return "\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + t[0] + ", " + t[1] + "));\n int index = resTexRC.x * " + t[1] + " + resTexRC.y;\n\n int r = index / " + i + ";\n index -= r * " + i + ";\n\n int c = index / " + a + ";\n index -= c * " + a + ";\n\n int d = index / " + o + ";\n index -= d * " + o + ";\n\n int d2 = index / " + r + ";\n index -= d2 * " + r + ";\n\n int d3 = index / " + n + ";\n int d4 = index - d3 * " + n + ";\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n "; + }function getOutput2DCoords(e, t) { + return arraysEqual(e, t) ? "\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(" + t[0] + ", " + t[1] + "));\n }\n " : 1 === e[1] ? "\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + t[0] + ", " + t[1] + "));\n int index = resTexRC.x * " + t[1] + " + resTexRC.y;\n return ivec2(index, 0);\n }\n " : 1 === e[0] ? "\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + t[0] + ", " + t[1] + "));\n int index = resTexRC.x * " + t[1] + " + resTexRC.y;\n return ivec2(0, index);\n }\n " : "\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + t[0] + ", " + t[1] + "));\n int index = resTexRC.x * " + t[1] + " + resTexRC.y;\n int r = index / " + e[1] + ";\n int c = index - r * " + e[1] + ";\n return ivec2(r, c);\n }\n "; + }function getSamplerScalar(e) { + var t = e.name, + n = "get" + t.charAt(0).toUpperCase() + t.slice(1);return e.shapeInfo.isUniform ? "float " + n + "() {return " + t + ";}" : "\n float " + n + "() {\n return sampleTexture(" + t + ", halfCR);\n }\n "; + }function getSampler1D(e) { + var t = e.name, + n = "get" + t.charAt(0).toUpperCase() + t.slice(1);return "\n float " + n + "(int index) {\n return " + n + "Flat(index);\n }\n "; + }function getSampler2D(e) { + var t = e.shapeInfo.logicalShape, + n = e.name, + r = "get" + n.charAt(0).toUpperCase() + n.slice(1), + o = e.shapeInfo.texShape;if (null != o && arraysEqual(t, o)) { + var a = o[0];return "\n float " + r + "(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(" + o[1] + ".0, " + a + ".0);\n return sampleTexture(" + n + ", uv);\n }\n "; + }var i = squeezeShape(t), + s = i.newShape, + u = i.keptDims, + l = s;if (l.length < t.length) { + return "\n " + getSamplerFromInInfo(squeezeInputInfo(e, l)) + "\n float " + r + "(int row, int col) {\n return " + r + "(" + getSqueezedParams(["row", "col"], u) + ");\n }\n "; + }if (e.shapeInfo.isUniform) return "\n float " + r + "(int row, int col) {\n int index = row * " + t[1] + " + col;\n return " + r + "Flat(index);\n }\n ";var c = o[0], + p = o[1];return 1 === p ? "\n float " + r + "(int row, int col) {\n int index = row * " + t[1] + " + col;\n vec2 uv = vec2(0.5, (float(index) + 0.5) / " + c + ".0);\n return sampleTexture(" + n + ", uv);\n }\n " : 1 === c ? "\n float " + r + "(int row, int col) {\n int index = row * " + t[1] + " + col;\n vec2 uv = vec2((float(index) + 0.5) / " + p + ".0, 0.5);\n return sampleTexture(" + n + ", uv);\n }\n " : "\n float " + r + "(int row, int col) {\n vec2 uv = UVfrom2D(" + c + ", " + p + ", " + t[1] + ", row, col);\n return sampleTexture(" + n + ", uv);\n }\n"; + }function getSampler3D(e) { + var t = e.shapeInfo.logicalShape, + n = e.name, + r = "get" + n.charAt(0).toUpperCase() + n.slice(1), + o = t[1] * t[2], + a = t[2], + i = squeezeShape(t), + s = i.newShape, + u = i.keptDims, + l = s;if (l.length < t.length) { + return "\n " + getSamplerFromInInfo(squeezeInputInfo(e, l)) + "\n float " + r + "(int row, int col, int depth) {\n return " + r + "(" + getSqueezedParams(["row", "col", "depth"], u) + ");\n }\n "; + }if (e.shapeInfo.isUniform) return "\n float " + r + "(int row, int col, int depth) {\n int index = row * " + o + " + col * " + a + " + depth;\n return " + r + "Flat(index);\n }\n ";var c = e.shapeInfo.texShape, + p = c[0], + d = c[1];return d === o ? "\n float " + r + "(int row, int col, int depth) {\n int texR = row;\n int texC = col * " + a + " + depth;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + d + ".0, " + p + ".0);\n return sampleTexture(" + n + ", uv);\n }\n " : d === a ? "\n float " + r + "(int row, int col, int depth) {\n int texR = row * " + t[1] + " + col;\n int texC = depth;\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(" + d + ".0, " + p + ".0);\n return sampleTexture(" + n + ", uv);\n }\n " : "\n float " + r + "(int row, int col, int depth) {\n vec2 uv = UVfrom3D(\n " + p + ", " + d + ", " + o + ", " + a + ", row, col, depth);\n return sampleTexture(" + n + ", uv);\n }\n "; + }function getSampler4D(e) { + var t = e.shapeInfo.logicalShape, + n = e.name, + r = "get" + n.charAt(0).toUpperCase() + n.slice(1), + o = t[3], + a = t[2] * o, + i = t[1] * a, + s = squeezeShape(t), + u = s.newShape, + l = s.keptDims;if (u.length < t.length) { + return "\n " + getSamplerFromInInfo(squeezeInputInfo(e, u)) + "\n float " + r + "(int row, int col, int depth, int depth2) {\n return " + r + "(" + getSqueezedParams(["row", "col", "depth", "depth2"], l) + ");\n }\n "; + }if (e.shapeInfo.isUniform) return "\n float " + r + "(int row, int col, int depth, int depth2) {\n int index = row * " + i + " + col * " + a + " +\n depth * " + o + " + depth2;\n return " + r + "Flat(index);\n }\n ";var c = e.shapeInfo.texShape, + p = c[0], + d = c[1];return d === i ? "\n float " + r + "(int row, int col, int depth, int depth2) {\n int texR = row;\n int texC = col * " + a + " + depth * " + o + " + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + d + ".0, " + p + ".0);\n return sampleTexture(" + n + ", uv);\n }\n " : d === o ? "\n float " + r + "(int row, int col, int depth, int depth2) {\n int texR = row * " + t[1] * t[2] + " + col * " + t[2] + " + depth;\n int texC = depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + d + ".0, " + p + ".0);\n return sampleTexture(" + n + ", uv);\n }\n " : "\n float " + r + "(int row, int col, int depth, int depth2) {\n vec2 uv = UVfrom4D(" + p + ", " + d + ", " + i + ", " + a + ",\n " + o + ", row, col, depth, depth2);\n return sampleTexture(" + n + ", uv);\n }\n "; + }function getSampler5D(e) { + var t = e.shapeInfo.logicalShape, + n = e.name, + r = "get" + n.charAt(0).toUpperCase() + n.slice(1), + o = t[4], + a = t[3] * o, + i = t[2] * a, + s = t[1] * i, + u = squeezeShape(t), + l = u.newShape, + c = u.keptDims;if (l.length < t.length) { + return "\n " + getSamplerFromInInfo(squeezeInputInfo(e, l)) + "\n float " + r + "(int row, int col, int depth, int depth2, int depth3) {\n return " + r + "(" + getSqueezedParams(["row", "col", "depth", "depth2", "depth3"], c) + ");\n }\n "; + }if (e.shapeInfo.isUniform) return "\n float " + r + "(int row, int col, int depth, int depth2, int depth3) {\n int index = row * " + s + " + col * " + i + " +\n depth * " + a + " + depth2 * " + o + " + depth3;\n return " + r + "Flat(index);\n }\n ";var p = e.shapeInfo.texShape, + d = p[0], + h = p[1];return h === s ? "\n float " + r + "(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n int texC = col * " + i + " + depth * " + a + " +\n depth2 * " + o + " + depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + h + ".0, " + d + ".0);\n return sampleTexture(" + n + ", uv);\n }\n " : h === o ? "\n float " + r + "(int row, int col, int depth, int depth2, int depth3) {\n int texR = row * " + t[1] * t[2] + " + col * " + t[2] + " +\n depth * " + t[3] + " + depth2;\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + h + ".0, " + d + ".0);\n return sampleTexture(" + n + ", uv);\n }\n " : "\n float " + r + "(int row, int col, int depth, int depth2, int depth3) {\n vec2 uv = UVfrom5D(" + d + ", " + h + ", " + s + ", " + i + ",\n " + a + ", " + o + ", row, col, depth, depth2, depth3);\n return sampleTexture(" + n + ", uv);\n }\n "; + }function getSampler6D(e) { + var t = e.shapeInfo.logicalShape, + n = e.name, + r = "get" + n.charAt(0).toUpperCase() + n.slice(1), + o = t[5], + a = t[4] * o, + i = t[3] * a, + s = t[2] * i, + u = t[1] * s, + l = squeezeShape(t), + c = l.newShape, + p = l.keptDims;if (c.length < t.length) { + return "\n " + getSamplerFromInInfo(squeezeInputInfo(e, c)) + "\n float " + r + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return " + r + "(" + getSqueezedParams(["row", "col", "depth", "depth2", "depth3", "depth4"], p) + ");\n }\n "; + }if (e.shapeInfo.isUniform) return "\n float " + r + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * " + u + " + col * " + s + " +\n depth * " + i + " + depth2 * " + a + " + depth3 * " + a + "\n + depth4\n return " + r + "Flat(index);\n }\n ";var d = e.shapeInfo.texShape, + h = d[0], + f = d[1];return f === u ? "\n float " + r + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n int texC = col * " + s + " + depth * " + i + " + depth2;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + f + ".0, " + h + ".0);\n return sampleTexture(" + n + ", uv);\n }\n " : f === o ? "\n float " + r + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row * " + t[1] * t[2] + " + col * " + t[2] + " + depth;\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + f + ".0, " + h + ".0);\n return sampleTexture(" + n + ", uv);\n }\n " : "\n float " + r + "(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n vec2 uv = UVfrom6D(" + h + ", " + f + ", " + u + ", " + s + ",\n " + i + ", " + a + ", " + o + "\n ,row, col, depth, depth2, depth3, depth4);\n return sampleTexture(" + n + ", uv);\n }\n "; + }function getSamplerFlat(e) { + var t = e.name, + n = "get" + t.charAt(0).toUpperCase() + t.slice(1) + "Flat", + r = sizeFromShape(e.shapeInfo.logicalShape);if (e.shapeInfo.isUniform) return 1 === r ? "float " + n + "(int index) {return " + t + ";}" : "\n float " + n + "(int index) {\n for (int i = 0; i < " + r + "; i++) {\n if (i == index) {\n return " + t + "[i];\n }\n }\n }\n ";var o = e.shapeInfo.texShape, + a = o[0], + i = o[1];return 1 === i && 1 === a ? "\n float " + n + "(int index) {\n return sampleTexture(" + t + ", halfCR);\n }\n " : 1 === i ? "\n float " + n + "(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / " + a + ".0);\n return sampleTexture(" + t + ", uv);\n }\n " : 1 === a ? "\n float " + n + "(int index) {\n vec2 uv = vec2((float(index) + 0.5) / " + i + ".0, 0.5);\n return sampleTexture(" + t + ", uv);\n }\n " : "\n float " + n + "(int index) {\n vec2 uv = UVfrom1D(" + a + ", " + i + ", index);\n return sampleTexture(" + t + ", uv);\n }\n "; + }function getBroadcastOutputCoordsSampler(e, t, n, r) { + var o = e.shapeInfo.logicalShape.length, + a = t.logicalShape.length, + i = "int";2 === a ? i = "ivec2" : 3 === a ? i = "ivec3" : 4 === a && (i = "ivec4");var s = getBroadcastDims(e.shapeInfo.logicalShape, t.logicalShape), + u = a - o;return "\n float " + r + "() {\n " + i + " coords = getOutputCoords();\n " + (0 === o ? "" : a < 2 && s.length >= 1 ? "coords = 0;" : s.map(function (e) { + return "coords[" + (e + u) + "] = 0;"; + }).join("\n")) + "\n return get" + n + "(" + (a < 2 && o > 0 ? "coords" : e.shapeInfo.logicalShape.map(function (e, t) { + return "coords[" + (t + u) + "]"; + }).join(", ")) + ");\n }\n "; + }function getSamplerAtOutputCoords(e, t, n) { + var r = e.name, + o = r.charAt(0).toUpperCase() + r.slice(1), + a = "get" + o + "AtOutCoords", + i = getBroadcastDims(e.shapeInfo.logicalShape, t.logicalShape), + s = e.shapeInfo.logicalShape.length, + u = t.logicalShape.length, + l = n && (u > s || i.length > 0), + c = broadcastDimsAreOuter(i), + p = e.shapeInfo.isUniform;if (l && !c) return getBroadcastOutputCoordsSampler(e, t, o, a);var d = sizeFromShape(e.shapeInfo.logicalShape), + h = "";l && c && (h = "\n int mainPart = index / " + d + ";\n index -= mainPart * " + d + ";\n ");var f = t.texShape;if (p) return 1 === d ? "float " + a + "() {return " + r + ";}" : "\n float " + a + "() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + f[0] + ", " + f[1] + "));\n int index = resTexRC.x * " + f[1] + " + resTexRC.y;\n " + h + "\n return get" + o + "Flat(index);\n }\n ";var m = e.shapeInfo.texShape;return arraysEqual(m, f) ? "\n float " + a + "() {\n return sampleTexture(" + r + ", resultUV);\n }\n " : "\n float " + a + "() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(" + f[0] + ", " + f[1] + "));\n int index = resTexRC.x * " + f[1] + " + resTexRC.y;\n " + h + "\n int texR = index / " + m[1] + ";\n int texC = index - texR * " + m[1] + ";\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(" + m[1] + ".0, " + m[0] + ".0);\n\n return sampleTexture(" + r + ", uv);\n }\n "; + }function getCoordsDataType(e) { + if (e <= 1) return "int";if (2 === e) return "ivec2";if (3 === e) return "ivec3";if (4 === e) return "ivec4";if (5 === e) return "ivec5";if (6 === e) return "ivec6";throw Error("GPU for rank " + e + " is not yet supported"); + }function squeezeInputInfo(e, t) { + var n = JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape = t, n; + }function getSqueezedParams(e, t) { + return t.map(function (t) { + return e[t]; + }).join(", "); + }var CumSumProgram = function () { + return function (e, t, n) { + this.variableNames = ["x"], this.outputShape = e;var r = e.length, + o = e[e.length - 1], + a = n ? "<" : ">";this.userCode = "\n int getIndex(int i) {\n " + (n ? "return " + o + " -i - 1;" : "return i;") + "\n }\n\n void main() {\n " + getCoordsDataType(r) + " coords = getOutputCoords();\n int end = " + getFinalCoord(r, "coords") + ";\n float val = 0.0;\n for (int i = " + o + " - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx " + a + " end) {\n continue;\n }\n if (idx == end && " + t + ") {\n continue;\n }\n " + getFinalCoord(r, "coords") + " = idx;\n val += getX(" + getCoords(r, "coords") + ");\n }\n setOutput(val);\n }\n "; + }; + }();function getCoords(e, t) { + if (1 === e) return "" + t;if (2 === e) return t + ".x, " + t + ".y";if (3 === e) return t + ".x, " + t + ".y, " + t + ".z";if (4 === e) return t + ".x, " + t + ".y, " + t + ".z, " + t + ".w";throw Error("Cumulative sum for rank " + e + " is not yet supported"); + }function getFinalCoord(e, t) { + if (1 === e) return "" + t;if (2 === e) return t + ".y";if (3 === e) return t + ".z";if (4 === e) return t + ".w";throw Error("Cumulative sum for rank " + e + " is not yet supported"); + }var TextureUsage, + PhysicalTextureType, + EncodeFloatProgram = function () { + return function (e) { + this.variableNames = ["A"], this.outputShape = e, this.userCode = "\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n gl_FragColor = encode_float(x);\n }\n "; + }; + }(), + FromPixelsProgram = function () { + return function (e) { + this.variableNames = ["A"];var t = e[0], + n = e[1];this.outputShape = e, this.userCode = "\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(" + n + ".0, " + t + ".0);\n\n vec4 values = texture2D(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n "; + }; + }(), + GatherProgram = function () { + return function (e, t, n) { + this.variableNames = ["A", "indices"];var r = e.slice();r[n] = t, this.outputShape = r, this.rank = r.length;var o = getCoordsDataType(this.rank), + a = getSourceCoords(e, n);this.userCode = "\n void main() {\n " + o + " resRC = getOutputCoords();\n setOutput(getA(" + a + "));\n }\n "; + }; + }();function getSourceCoords(e, t) { + var n = e.length;if (n > 4) throw Error("Gather for rank " + n + " is not yet supported");if (1 === n) return "int(getIndices(resRC))";for (var r = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], o = [], a = 0; a < e.length; a++) a === t ? o.push("int(getIndices(" + r[a] + "))") : o.push("" + r[a]);return o.join(); + }function getUnpackedMatrixTextureShapeWidthHeight(e, t) { + return [t, e]; + }function getUnpackedArraySizeFromMatrixSize(e, t) { + return e * t; + }function getMatrixSizeFromUnpackedArraySize(e, t) { + if (e % t != 0) throw new Error("unpackedSize (" + e + ") must be a multiple of " + t);return e / t; + }function encodeMatrixToUnpackedArray(e, t, n) { + var r = getUnpackedArraySizeFromMatrixSize(e.length, n);if (t.length < r) throw new Error("unpackedArray length (" + t.length + ") must be >= " + r);for (var o = 0, a = 0; a < e.length; ++a) t[o] = e[a], o += n; + }function decodeMatrixFromUnpackedArray(e, t, n) { + var r = getMatrixSizeFromUnpackedArraySize(e.length, n);if (t.length < r) throw new Error("matrix length (" + t.length + ") must be >= " + r);for (var o = 0, a = 0; a < e.length; a += n) t[o++] = e[a]; + }function getPackedMatrixTextureShapeWidthHeight(e, t) { + return [Math.ceil(t / 2), Math.ceil(e / 2)]; + }function getPackedRGBAArraySizeFromMatrixShape(e, t) { + var n = getPackedMatrixTextureShapeWidthHeight(e, t);return n[0] * n[1] * 4; + }function encodeMatrixToPackedRGBA(e, t, n, r) { + var o = getPackedRGBAArraySizeFromMatrixShape(t, n);if (r.length < o) throw new Error("packedRGBA length (" + r.length + ") must be >= " + o);for (var a = getPackedMatrixTextureShapeWidthHeight(t, n), i = a[0], s = a[1], u = n % 2 == 1, l = t % 2 == 1, c = Math.floor(n / 2), p = Math.floor(t / 2), d = u ? 4 : 0, h = n, f = 0, m = 0; m < p; ++m) { + for (var g = 2 * m * n, v = 0; v < c; ++v) { + var y = g + 2 * v;r[f] = e[y], r[f + 1] = e[y + 1], r[f + 2] = e[y + h], r[f + 3] = e[y + h + 1], f += 4; + }f += d; + }if (u) { + y = n - 1, f = 4 * (i - 1);var x = 2 * n;for (d = 4 * i, m = 0; m < p; ++m) r[f] = e[y], r[f + 2] = e[y + n], y += x, f += d; + }if (l) for (y = (t - 1) * n, f = (s - 1) * i * 4, v = 0; v < c; ++v) r[f++] = e[y++], r[f++] = e[y++], f += 2;return u && l && (r[r.length - 4] = e[e.length - 1]), r; + }function decodeMatrixFromPackedRGBA(e, t, n, r) { + var o = t * n;if (o < r.length) throw new Error("matrix length (" + r.length + ") must be >= " + o);for (var a = n % 2 == 1, i = t % 2 == 1, s = Math.floor(n / 2), u = Math.floor(t / 2), l = getPackedMatrixTextureShapeWidthHeight(t, n), c = l[0], p = l[1], d = a ? 4 : 0, h = n + (a ? 1 : 0), f = 0, m = 0, g = n, v = 0; v < u; ++v) { + for (var y = 0; y < s; ++y) r[m++] = e[f++], r[m++] = e[f++], r[g++] = e[f++], r[g++] = e[f++];f += d, m += h, g += h; + }if (a) { + f = 4 * (c - 1);var x = n - 1;for (d = 4 * c, h = 2 * n, v = 0; v < u; ++v) r[x] = e[f], r[x + n] = e[f + 2], f += d, x += h; + }if (i) for (f = (p - 1) * c * 4, x = (t - 1) * n, y = 0; y < s; ++y) r[x++] = e[f++], r[x++] = e[f++], f += 2;return a && i && (r[r.length - 1] = e[e.length - 4]), r; + }!function (e) { + e[e.RENDER = 0] = "RENDER", e[e.UPLOAD = 1] = "UPLOAD", e[e.PIXELS = 2] = "PIXELS", e[e.DOWNLOAD = 3] = "DOWNLOAD"; + }(TextureUsage || (TextureUsage = {})), function (e) { + e[e.FLOAT16 = 0] = "FLOAT16", e[e.FLOAT32 = 1] = "FLOAT32", e[e.UNSIGNED_BYTE = 2] = "UNSIGNED_BYTE"; + }(PhysicalTextureType || (PhysicalTextureType = {}));var MAX_TEXTURE_SIZE = null;function createWebGLRenderingContext(e) { + var t = document.createElement("canvas");return t.width = 1, t.height = 1, createWebGLRenderingContextFromCanvas(t, e); + }function createWebGLRenderingContextFromCanvas(e, t) { + var n, + r = ENV.get("WEBGL_VERSION");if (2 === r ? n = e.getContext("webgl2", t) : 1 === r && (n = e.getContext("webgl", t) || e.getContext("experimental-webgl", t)), 0 === r || null == n) throw new Error("This browser does not support WebGL.");return n; + }function callAndCheck(e, t) { + var n = t();return checkWebGLError(e), n; + }var webGLDebugErrorCheckingEnabled = !1;function enableDebugWebGLErrorChecking(e) { + webGLDebugErrorCheckingEnabled = e; + }function checkWebGLError(e) { + if (webGLDebugErrorCheckingEnabled) { + var t = e.getError();if (t !== e.NO_ERROR) throw new Error("WebGL Error: " + getWebGLErrorMessage(e, t)); + } + }function getWebGLErrorMessage(e, t) { + switch (t) {case e.NO_ERROR: + return "NO_ERROR";case e.INVALID_ENUM: + return "INVALID_ENUM";case e.INVALID_VALUE: + return "INVALID_VALUE";case e.INVALID_OPERATION: + return "INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION: + return "INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY: + return "OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL: + return "CONTEXT_LOST_WEBGL";default: + return "Unknown error code " + t;} + }function getExtensionOrThrow(e, t) { + return throwIfNull(e, function () { + return e.getExtension(t); + }, 'Extension "' + t + '" not supported on this browser.'); + }function createVertexShader(e, t) { + var n = throwIfNull(e, function () { + return e.createShader(e.VERTEX_SHADER); + }, "Unable to create vertex WebGLShader.");if (callAndCheck(e, function () { + return e.shaderSource(n, t); + }), callAndCheck(e, function () { + return e.compileShader(n); + }), !1 === e.getShaderParameter(n, e.COMPILE_STATUS)) throw console.log(e.getShaderInfoLog(n)), new Error("Failed to compile vertex shader.");return n; + }function createFragmentShader(e, t) { + var n = throwIfNull(e, function () { + return e.createShader(e.FRAGMENT_SHADER); + }, "Unable to create fragment WebGLShader.");if (callAndCheck(e, function () { + return e.shaderSource(n, t); + }), callAndCheck(e, function () { + return e.compileShader(n); + }), !1 === e.getShaderParameter(n, e.COMPILE_STATUS)) throw logShaderSourceAndInfoLog(t, e.getShaderInfoLog(n)), new Error("Failed to compile fragment shader.");return n; + }var lineNumberRegex = /ERROR: [0-9]+:([0-9]+):/g;function logShaderSourceAndInfoLog(e, t) { + var n = lineNumberRegex.exec(t);if (null == n) return console.log("Couldn't parse line number in error: " + t), void console.log(e);for (var r = +n[1], o = e.split("\n"), a = o.length.toString().length + 2, i = o.map(function (e, t) { + return rightPad((t + 1).toString(), a) + e; + }), s = 0, u = 0; u < i.length; u++) s = Math.max(i[u].length, s);var l = i.slice(0, r - 1), + c = i.slice(r - 1, r), + p = i.slice(r);console.log(l.join("\n")), console.log(t.split("\n")[0]), console.log("%c " + rightPad(c[0], s), "border:1px solid red; background-color:#e3d2d2; color:#a61717"), console.log(p.join("\n")); + }function createProgram(e) { + return throwIfNull(e, function () { + return e.createProgram(); + }, "Unable to create WebGLProgram."); + }function linkProgram(e, t) { + if (callAndCheck(e, function () { + return e.linkProgram(t); + }), !1 === e.getProgramParameter(t, e.LINK_STATUS)) throw console.log(e.getProgramInfoLog(t)), new Error("Failed to link vertex and fragment shaders."); + }function validateProgram(e, t) { + if (callAndCheck(e, function () { + return e.validateProgram(t); + }), !1 === e.getProgramParameter(t, e.VALIDATE_STATUS)) throw console.log(e.getProgramInfoLog(t)), new Error("Shader program validation failed."); + }function createStaticVertexBuffer(e, t) { + var n = throwIfNull(e, function () { + return e.createBuffer(); + }, "Unable to create WebGLBuffer");return callAndCheck(e, function () { + return e.bindBuffer(e.ARRAY_BUFFER, n); + }), callAndCheck(e, function () { + return e.bufferData(e.ARRAY_BUFFER, t, e.STATIC_DRAW); + }), n; + }function createStaticIndexBuffer(e, t) { + var n = throwIfNull(e, function () { + return e.createBuffer(); + }, "Unable to create WebGLBuffer");return callAndCheck(e, function () { + return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, n); + }), callAndCheck(e, function () { + return e.bufferData(e.ELEMENT_ARRAY_BUFFER, t, e.STATIC_DRAW); + }), n; + }function queryMaxTextureSize(e) { + return null != MAX_TEXTURE_SIZE ? MAX_TEXTURE_SIZE : MAX_TEXTURE_SIZE = callAndCheck(e, function () { + return e.getParameter(e.MAX_TEXTURE_SIZE); + }); + }function getNumChannels() { + return 2 === ENV.get("WEBGL_VERSION") ? 1 : 4; + }function createTexture(e) { + return throwIfNull(e, function () { + return e.createTexture(); + }, "Unable to create WebGLTexture."); + }function validateTextureSize(e, t, n) { + var r = queryMaxTextureSize(e);if (t <= 0 || n <= 0) { + var o = "[" + t + "x" + n + "]";throw new Error("Requested texture size " + o + " is invalid."); + }if (t > r || n > r) { + o = "[" + t + "x" + n + "]";throw new Error("Requested texture size " + o + " greater than WebGL maximum on this browser / GPU " + ("[" + r + "x" + r + "]") + "."); + } + }function createFramebuffer(e) { + return throwIfNull(e, function () { + return e.createFramebuffer(); + }, "Unable to create WebGLFramebuffer."); + }function bindVertexBufferToProgramAttribute(e, t, n, r, o, a, i) { + var s = e.getAttribLocation(t, n);return -1 !== s && (callAndCheck(e, function () { + return e.bindBuffer(e.ARRAY_BUFFER, r); + }), callAndCheck(e, function () { + return e.vertexAttribPointer(s, o, e.FLOAT, !1, a, i); + }), callAndCheck(e, function () { + return e.enableVertexAttribArray(s); + }), !0); + }function bindTextureUnit(e, t, n) { + validateTextureUnit(e, n), callAndCheck(e, function () { + return e.activeTexture(e.TEXTURE0 + n); + }), callAndCheck(e, function () { + return e.bindTexture(e.TEXTURE_2D, t); + }); + }function unbindTextureUnit(e, t) { + validateTextureUnit(e, t), callAndCheck(e, function () { + return e.activeTexture(e.TEXTURE0 + t); + }), callAndCheck(e, function () { + return e.bindTexture(e.TEXTURE_2D, null); + }); + }function getProgramUniformLocationOrThrow(e, t, n) { + return throwIfNull(e, function () { + return e.getUniformLocation(t, n); + }, 'uniform "' + n + '" not present in program.'); + }function getProgramUniformLocation(e, t, n) { + return e.getUniformLocation(t, n); + }function bindTextureToProgramUniformSampler(e, t, n, r, o) { + callAndCheck(e, function () { + return bindTextureUnit(e, n, o); + }), callAndCheck(e, function () { + return e.uniform1i(r, o); + }); + }function bindCanvasToFramebuffer(e) { + callAndCheck(e, function () { + return e.bindFramebuffer(e.FRAMEBUFFER, null); + }), callAndCheck(e, function () { + return e.viewport(0, 0, e.canvas.width, e.canvas.height); + }), callAndCheck(e, function () { + return e.scissor(0, 0, e.canvas.width, e.canvas.height); + }); + }function bindColorTextureToFramebuffer(e, t, n) { + callAndCheck(e, function () { + return e.bindFramebuffer(e.FRAMEBUFFER, n); + }), callAndCheck(e, function () { + return e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, t, 0); + }); + }function unbindColorTextureFromFramebuffer(e, t) { + callAndCheck(e, function () { + return e.bindFramebuffer(e.FRAMEBUFFER, t); + }), callAndCheck(e, function () { + return e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, null, 0); + }); + }function validateFramebuffer(e) { + var t = e.checkFramebufferStatus(e.FRAMEBUFFER);if (t !== e.FRAMEBUFFER_COMPLETE) throw new Error("Error binding framebuffer: " + getFramebufferErrorMessage(e, t)); + }function getFramebufferErrorMessage(e, t) { + switch (t) {case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: + return "FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: + return "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: + return "FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED: + return "FRAMEBUFFER_UNSUPPORTED";default: + return "unknown error " + t;} + }function throwIfNull(e, t, n) { + var r = callAndCheck(e, function () { + return t(); + });if (null == r) throw new Error(n);return r; + }function validateTextureUnit(e, t) { + var n = e.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1, + r = t + e.TEXTURE0;if (r < e.TEXTURE0 || r > n) throw new Error("textureUnit must be in " + ("[gl.TEXTURE0, gl.TEXTURE" + n + "]") + "."); + }function getTextureShapeFromLogicalShape(e, t) { + 2 !== t.length && (t = squeezeShape(t).newShape);var n = queryMaxTextureSize(e), + r = sizeFromShape(t);return t.length <= 1 && r <= n ? [r, 1] : 2 === t.length && t[0] <= n && t[1] <= n ? t : 3 === t.length && t[0] <= n && t[1] * t[2] <= n ? [t[0], t[1] * t[2]] : 4 === t.length && t[0] <= n && t[1] * t[2] * t[3] <= n ? [t[0], t[1] * t[2] * t[3]] : sizeToSquarishShape(r); + }var webgl_util = Object.freeze({ createWebGLRenderingContext: createWebGLRenderingContext, createWebGLRenderingContextFromCanvas: createWebGLRenderingContextFromCanvas, callAndCheck: callAndCheck, enableDebugWebGLErrorChecking: enableDebugWebGLErrorChecking, checkWebGLError: checkWebGLError, getWebGLErrorMessage: getWebGLErrorMessage, getExtensionOrThrow: getExtensionOrThrow, createVertexShader: createVertexShader, createFragmentShader: createFragmentShader, createProgram: createProgram, linkProgram: linkProgram, validateProgram: validateProgram, createStaticVertexBuffer: createStaticVertexBuffer, createStaticIndexBuffer: createStaticIndexBuffer, queryMaxTextureSize: queryMaxTextureSize, getNumChannels: getNumChannels, createTexture: createTexture, validateTextureSize: validateTextureSize, createFramebuffer: createFramebuffer, bindVertexBufferToProgramAttribute: bindVertexBufferToProgramAttribute, bindTextureUnit: bindTextureUnit, unbindTextureUnit: unbindTextureUnit, getProgramUniformLocationOrThrow: getProgramUniformLocationOrThrow, getProgramUniformLocation: getProgramUniformLocation, bindTextureToProgramUniformSampler: bindTextureToProgramUniformSampler, bindCanvasToFramebuffer: bindCanvasToFramebuffer, bindColorTextureToFramebuffer: bindColorTextureToFramebuffer, unbindColorTextureFromFramebuffer: unbindColorTextureFromFramebuffer, validateFramebuffer: validateFramebuffer, getFramebufferErrorMessage: getFramebufferErrorMessage, getTextureShapeFromLogicalShape: getTextureShapeFromLogicalShape });function getWebGLContextAttributes() { + return { alpha: !1, antialias: !1, premultipliedAlpha: !1, preserveDrawingBuffer: !1, depth: !1, stencil: !1, failIfMajorPerformanceCaveat: !0 }; + }function createWebGLContext(e) { + var t, + n = getWebGLContextAttributes();return callAndCheck(t = null != e ? createWebGLRenderingContextFromCanvas(e, n) : createWebGLRenderingContext(n), function () { + return t.disable(t.DEPTH_TEST); + }), callAndCheck(t, function () { + return t.disable(t.STENCIL_TEST); + }), callAndCheck(t, function () { + return t.disable(t.BLEND); + }), callAndCheck(t, function () { + return t.disable(t.DITHER); + }), callAndCheck(t, function () { + return t.disable(t.POLYGON_OFFSET_FILL); + }), callAndCheck(t, function () { + return t.disable(t.SAMPLE_COVERAGE); + }), callAndCheck(t, function () { + return t.enable(t.SCISSOR_TEST); + }), callAndCheck(t, function () { + return t.enable(t.CULL_FACE); + }), callAndCheck(t, function () { + return t.cullFace(t.BACK); + }), t; + }function createVertexShader$1(e) { + return createVertexShader(e, "\n precision highp float;\n attribute vec3 clipSpacePos;\n attribute vec2 uv;\n varying vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }"); + }function createVertexBuffer(e) { + return createStaticVertexBuffer(e, new Float32Array([-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0])); + }function createIndexBuffer(e) { + return createStaticIndexBuffer(e, new Uint16Array([0, 1, 2, 2, 1, 3])); + }function getTextureConfig(e, t) { + var n, + r, + o, + a, + i, + s, + u, + l = e;return 2 === ENV.get("WEBGL_VERSION") ? (n = l.R32F, r = l.R16F, o = l.RGBA32F, a = l.RED, i = 4, s = 1, u = l.HALF_FLOAT) : (n = e.RGBA, r = e.RGBA, o = l.RGBA, a = e.RGBA, i = 4, s = 4, u = null != t ? t.HALF_FLOAT_OES : null), { internalFormatFloat: n, internalFormatHalfFloat: r, internalFormatPackedFloat: o, textureFormatFloat: a, downloadTextureFormat: e.RGBA, downloadUnpackNumChannels: i, defaultNumChannels: s, textureTypeHalfFloat: u }; + }function createAndConfigureTexture(e, t, n, r, o, a) { + validateTextureSize(e, t, n);var i = createTexture(e), + s = e.TEXTURE_2D;return callAndCheck(e, function () { + return e.bindTexture(s, i); + }), callAndCheck(e, function () { + return e.texParameteri(s, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE); + }), callAndCheck(e, function () { + return e.texParameteri(s, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE); + }), callAndCheck(e, function () { + return e.texParameteri(s, e.TEXTURE_MIN_FILTER, e.NEAREST); + }), callAndCheck(e, function () { + return e.texParameteri(s, e.TEXTURE_MAG_FILTER, e.NEAREST); + }), callAndCheck(e, function () { + return e.texImage2D(s, 0, r, t, n, 0, o, a, null); + }), callAndCheck(e, function () { + return e.bindTexture(e.TEXTURE_2D, null); + }), i; + }function createFloat32MatrixTexture(e, t, n, r) { + var o = getUnpackedMatrixTextureShapeWidthHeight(t, n);return createAndConfigureTexture(e, o[0], o[1], r.internalFormatFloat, r.textureFormatFloat, e.FLOAT); + }function createFloat16MatrixTexture(e, t, n, r) { + var o = getUnpackedMatrixTextureShapeWidthHeight(t, n);return createAndConfigureTexture(e, o[0], o[1], r.internalFormatFloat, r.textureFormatFloat, r.textureTypeHalfFloat); + }function createUnsignedBytesMatrixTexture(e, t, n, r) { + var o = getUnpackedMatrixTextureShapeWidthHeight(t, n);return createAndConfigureTexture(e, o[0], o[1], e.RGBA, e.RGBA, e.UNSIGNED_BYTE); + }function createPackedMatrixTexture(e, t, n, r) { + var o = getPackedMatrixTextureShapeWidthHeight(t, n);return createAndConfigureTexture(e, o[0], o[1], r.internalFormatPackedFloat, e.RGBA, e.FLOAT); + }function bindVertexProgramAttributeStreams(e, t, n) { + return callAndCheck(e, function () { + return e.bindBuffer(e.ARRAY_BUFFER, n); + }), bindVertexBufferToProgramAttribute(e, t, "clipSpacePos", n, 3, 20, 0) && bindVertexBufferToProgramAttribute(e, t, "uv", n, 2, 20, 12); + }function uploadPixelDataToTexture(e, t, n) { + callAndCheck(e, function () { + return e.bindTexture(e.TEXTURE_2D, t); + }), callAndCheck(e, function () { + return e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, n); + }), callAndCheck(e, function () { + return e.bindTexture(e.TEXTURE_2D, null); + }); + }function uploadDataToTexture(e, t, n, r, o, a) { + validateTextureSize(e, n, r), callAndCheck(e, function () { + return e.bindTexture(e.TEXTURE_2D, t); + }), callAndCheck(e, function () { + return e.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, n, r, a, e.FLOAT, o); + }), callAndCheck(e, function () { + return e.bindTexture(e.TEXTURE_2D, null); + }); + }function uploadMatrixToTexture(e, t, n, r, o, a, i) { + var s, + u = getUnpackedMatrixTextureShapeWidthHeight(n, r), + l = u[0], + c = u[1];1 === i.defaultNumChannels ? s = o : encodeMatrixToUnpackedArray(o, s = new Float32Array(getUnpackedArraySizeFromMatrixSize(o.length, a)), a), uploadDataToTexture(e, t, l, c, s, i.textureFormatFloat); + }function uploadMatrixToPackedTexture(e, t, n, r, o, a) { + var i = getPackedMatrixTextureShapeWidthHeight(n, r), + s = i[0], + u = i[1], + l = new Float32Array(getPackedRGBAArraySizeFromMatrixShape(n, r));encodeMatrixToPackedRGBA(o, n, r, l), uploadDataToTexture(e, t, s, u, l, e.RGBA); + }function maybeCreateBufferFromOutputTexture(e, t, n, r, o) { + var a = t;if (2 === ENV.get("WEBGL_VERSION")) { + var i = e, + s = i.createBuffer();callAndCheck(e, function () { + return e.bindBuffer(i.PIXEL_PACK_BUFFER, s); + });var u = 4 * getUnpackedArraySizeFromMatrixSize(n * r, o.downloadUnpackNumChannels);callAndCheck(e, function () { + return e.bufferData(i.PIXEL_PACK_BUFFER, u, e.STATIC_DRAW); + }), callAndCheck(e, function () { + return i.readPixels(0, 0, r, n, e.RGBA, e.FLOAT, 0); + }), callAndCheck(e, function () { + return e.bindBuffer(i.PIXEL_PACK_BUFFER, null); + }), a = s; + }return a; + }function downloadFloat32MatrixFromBuffer(e, t, n, r, o) { + var a = e, + i = new Float32Array(getUnpackedArraySizeFromMatrixSize(n * r, o.downloadUnpackNumChannels));a.bindBuffer(e.ARRAY_BUFFER, t), a.getBufferSubData(e.ARRAY_BUFFER, 0, i), a.bindBuffer(e.ARRAY_BUFFER, null);var s = new Float32Array(n * r);return decodeMatrixFromUnpackedArray(i, s, o.downloadUnpackNumChannels), s; + }function downloadFloat32MatrixFromOutputTexture(e, t, n, r) { + var o = getUnpackedMatrixTextureShapeWidthHeight(t, n), + a = o[0], + i = o[1], + s = new Float32Array(getUnpackedArraySizeFromMatrixSize(t * n, r.downloadUnpackNumChannels));callAndCheck(e, function () { + return e.readPixels(0, 0, a, i, r.downloadTextureFormat, e.FLOAT, s); + });var u = new Float32Array(t * n);return decodeMatrixFromUnpackedArray(s, u, r.downloadUnpackNumChannels), u; + }function downloadByteEncodedFloatMatrixFromOutputTexture(e, t, n, r) { + var o = getUnpackedMatrixTextureShapeWidthHeight(t, n), + a = o[0], + i = o[1], + s = new Uint8Array(getUnpackedArraySizeFromMatrixSize(t * n, 4));return callAndCheck(e, function () { + return e.readPixels(0, 0, a, i, r.downloadTextureFormat, e.UNSIGNED_BYTE, s); + }), new Float32Array(s.buffer); + }function downloadMatrixFromPackedOutputTexture(e, t, n, r) { + var o = getPackedMatrixTextureShapeWidthHeight(t, n), + a = o[0], + i = o[1], + s = new Float32Array(getPackedRGBAArraySizeFromMatrixShape(t, n));callAndCheck(e, function () { + return e.readPixels(0, 0, a, i, e.RGBA, e.FLOAT, s); + });var u = new Float32Array(t * n);return decodeMatrixFromPackedRGBA(s, t, n, u); + }var gpgpu_util = Object.freeze({ getWebGLContextAttributes: getWebGLContextAttributes, createWebGLContext: createWebGLContext, createVertexShader: createVertexShader$1, createVertexBuffer: createVertexBuffer, createIndexBuffer: createIndexBuffer, getTextureConfig: getTextureConfig, createFloat32MatrixTexture: createFloat32MatrixTexture, createFloat16MatrixTexture: createFloat16MatrixTexture, createUnsignedBytesMatrixTexture: createUnsignedBytesMatrixTexture, createPackedMatrixTexture: createPackedMatrixTexture, bindVertexProgramAttributeStreams: bindVertexProgramAttributeStreams, uploadPixelDataToTexture: uploadPixelDataToTexture, uploadMatrixToTexture: uploadMatrixToTexture, uploadMatrixToPackedTexture: uploadMatrixToPackedTexture, maybeCreateBufferFromOutputTexture: maybeCreateBufferFromOutputTexture, downloadFloat32MatrixFromBuffer: downloadFloat32MatrixFromBuffer, downloadFloat32MatrixFromOutputTexture: downloadFloat32MatrixFromOutputTexture, downloadByteEncodedFloatMatrixFromOutputTexture: downloadByteEncodedFloatMatrixFromOutputTexture, downloadMatrixFromPackedOutputTexture: downloadMatrixFromPackedOutputTexture }), + GPGPUContext = function () { + function e(e) { + this.outputTexture = null, this.program = null, this.disposed = !1, this.autoDebugValidate = !1, this.vertexAttrsAreBound = !1, this.itemsToPoll = [], this.gl = null != e ? e : createWebGLContext(), 1 === ENV.get("WEBGL_VERSION") ? (this.textureFloatExtension = getExtensionOrThrow(this.gl, "OES_texture_float"), this.colorBufferFloatExtension = this.gl.getExtension("WEBGL_color_buffer_float"), ENV.get("WEBGL_RENDER_FLOAT32_ENABLED") || (this.textureHalfFloatExtension = getExtensionOrThrow(this.gl, "OES_texture_half_float"), this.colorBufferHalfFloatExtension = this.gl.getExtension("EXT_color_buffer_half_float"))) : this.colorBufferFloatExtension = getExtensionOrThrow(this.gl, "EXT_color_buffer_float"), this.loseContextExtension = getExtensionOrThrow(this.gl, "WEBGL_lose_context"), this.vertexBuffer = createVertexBuffer(this.gl), this.indexBuffer = createIndexBuffer(this.gl), this.framebuffer = createFramebuffer(this.gl), this.textureConfig = getTextureConfig(this.gl, this.textureHalfFloatExtension); + }return e.prototype.dispose = function () { + var e = this;if (!this.disposed) { + null != this.program && console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."), null != this.outputTexture && console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");var t = this.gl;callAndCheck(t, function () { + return t.finish(); + }), callAndCheck(t, function () { + return t.bindFramebuffer(t.FRAMEBUFFER, null); + }), callAndCheck(t, function () { + return t.deleteFramebuffer(e.framebuffer); + }), callAndCheck(t, function () { + return t.bindBuffer(t.ARRAY_BUFFER, null); + }), callAndCheck(t, function () { + return t.deleteBuffer(e.vertexBuffer); + }), callAndCheck(t, function () { + return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, null); + }), callAndCheck(t, function () { + return t.deleteBuffer(e.indexBuffer); + }), this.loseContextExtension.loseContext(), this.disposed = !0; + } + }, e.prototype.enableAutomaticDebugValidation = function (e) { + this.autoDebugValidate = e, enableDebugWebGLErrorChecking(e); + }, e.prototype.createFloat32MatrixTexture = function (e, t) { + return this.throwIfDisposed(), createFloat32MatrixTexture(this.gl, e, t, this.textureConfig); + }, e.prototype.createFloat16MatrixTexture = function (e, t) { + return this.throwIfDisposed(), createFloat16MatrixTexture(this.gl, e, t, this.textureConfig); + }, e.prototype.createUnsignedBytesMatrixTexture = function (e, t) { + return this.throwIfDisposed(), createUnsignedBytesMatrixTexture(this.gl, e, t, this.textureConfig); + }, e.prototype.uploadPixelDataToTexture = function (e, t) { + this.throwIfDisposed(), uploadPixelDataToTexture(this.gl, e, t); + }, e.prototype.createPackedMatrixTexture = function (e, t) { + return this.throwIfDisposed(), createPackedMatrixTexture(this.gl, e, t, this.textureConfig); + }, e.prototype.deleteMatrixTexture = function (e) { + var t = this;this.throwIfDisposed(), this.outputTexture === e && (unbindColorTextureFromFramebuffer(this.gl, this.framebuffer), this.outputTexture = null), callAndCheck(this.gl, function () { + return t.gl.deleteTexture(e); + }); + }, e.prototype.uploadMatrixToTexture = function (e, t, n, r) { + this.throwIfDisposed();var o = getNumChannels();return uploadMatrixToTexture(this.gl, e, t, n, r, o, this.textureConfig); + }, e.prototype.uploadMatrixToPackedTexture = function (e, t, n, r) { + return this.throwIfDisposed(), uploadMatrixToPackedTexture(this.gl, e, t, n, r, this.textureConfig); + }, e.prototype.downloadFloat32MatrixFromOutputTexture = function (e, t, n) { + var r = this;return this.downloadMatrixDriver(e, function () { + return downloadFloat32MatrixFromOutputTexture(r.gl, t, n, r.textureConfig); + }); + }, e.prototype.downloadByteEncodedFloatMatrixFromOutputTexture = function (e, t, n) { + var r = this;return this.downloadMatrixDriver(e, function () { + return downloadByteEncodedFloatMatrixFromOutputTexture(r.gl, t, n, r.textureConfig); + }); + }, e.prototype.downloadFloat32MatrixFromBuffer = function (e, t, n) { + return downloadFloat32MatrixFromBuffer(this.gl, e, t, n, this.textureConfig); + }, e.prototype.maybeCreateBufferFromTexture = function (e, t, n) { + this.bindTextureToFrameBuffer(e);var r = maybeCreateBufferFromOutputTexture(this.gl, e, t, n, this.textureConfig);return this.unbindTextureToFrameBuffer(), r; + }, e.prototype.createAndWaitForFence = function () { + var e = this.createFence(this.gl);return this.pollFence(e); + }, e.prototype.createFence = function (e) { + var t, + n, + r = this;if (ENV.get("WEBGL_FENCE_API_ENABLED")) { + var o = e, + a = o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE, 0);e.flush(), n = function () { + var e = o.clientWaitSync(a, 0, 0);return e === o.ALREADY_SIGNALED || e === o.CONDITION_SATISFIED; + }, t = a; + } else ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 ? (t = this.beginQuery(), this.endQuery(), n = function () { + return r.isQueryAvailable(t, ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")); + }) : n = function () { + return !0; + };return { query: t, isFencePassed: n }; + }, e.prototype.downloadMatrixFromPackedTexture = function (e, t, n) { + var r = this;return this.downloadMatrixDriver(e, function () { + return downloadMatrixFromPackedOutputTexture(r.gl, t, n, r.textureConfig); + }); + }, e.prototype.createProgram = function (e) { + this.throwIfDisposed();var t = this.gl, + n = createFragmentShader(t, e), + r = createVertexShader$1(t), + o = createProgram(t);return callAndCheck(t, function () { + return t.attachShader(o, r); + }), callAndCheck(t, function () { + return t.attachShader(o, n); + }), linkProgram(t, o), this.autoDebugValidate && validateProgram(t, o), this.vertexAttrsAreBound || (this.setProgram(o), this.vertexAttrsAreBound = bindVertexProgramAttributeStreams(t, this.program, this.vertexBuffer)), o; + }, e.prototype.deleteProgram = function (e) { + var t = this;this.throwIfDisposed(), e === this.program && (this.program = null), null != e && callAndCheck(this.gl, function () { + return t.gl.deleteProgram(e); + }); + }, e.prototype.setProgram = function (e) { + var t = this;this.throwIfDisposed(), this.program = e, null != this.program && this.autoDebugValidate && validateProgram(this.gl, this.program), callAndCheck(this.gl, function () { + return t.gl.useProgram(e); + }); + }, e.prototype.getUniformLocation = function (e, t, n) { + return void 0 === n && (n = !0), this.throwIfDisposed(), n ? getProgramUniformLocationOrThrow(this.gl, e, t) : getProgramUniformLocation(this.gl, e, t); + }, e.prototype.getAttributeLocation = function (e, t) { + var n = this;return this.throwIfDisposed(), callAndCheck(this.gl, function () { + return n.gl.getAttribLocation(e, t); + }); + }, e.prototype.getUniformLocationNoThrow = function (e, t) { + return this.throwIfDisposed(), this.gl.getUniformLocation(e, t); + }, e.prototype.setInputMatrixTexture = function (e, t, n) { + this.throwIfDisposed(), this.throwIfNoProgram(), bindTextureToProgramUniformSampler(this.gl, this.program, e, t, n); + }, e.prototype.setOutputMatrixTexture = function (e, t, n) { + this.setOutputMatrixTextureDriver(e, n, t); + }, e.prototype.setOutputPackedMatrixTexture = function (e, t, n) { + this.throwIfDisposed();var r = getPackedMatrixTextureShapeWidthHeight(t, n), + o = r[0], + a = r[1];this.setOutputMatrixTextureDriver(e, o, a); + }, e.prototype.setOutputMatrixWriteRegion = function (e, t, n, r) { + this.setOutputMatrixWriteRegionDriver(n, e, r, t); + }, e.prototype.setOutputPackedMatrixWriteRegion = function (e, t, n, r) { + throw new Error("setOutputPackedMatrixWriteRegion not implemented."); + }, e.prototype.debugValidate = function () { + null != this.program && validateProgram(this.gl, this.program), validateFramebuffer(this.gl); + }, e.prototype.executeProgram = function () { + this.throwIfDisposed(), this.throwIfNoProgram();var e = this.gl;this.autoDebugValidate && this.debugValidate(), callAndCheck(e, function () { + return e.drawElements(e.TRIANGLES, 6, e.UNSIGNED_SHORT, 0); + }); + }, e.prototype.blockUntilAllProgramsCompleted = function () { + var e = this;this.throwIfDisposed(), callAndCheck(this.gl, function () { + return e.gl.finish(); + }); + }, e.prototype.getQueryTimerExtension = function () { + return null == this.disjointQueryTimerExtension && (this.disjointQueryTimerExtension = getExtensionOrThrow(this.gl, 2 === ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") ? "EXT_disjoint_timer_query_webgl2" : "EXT_disjoint_timer_query")), this.disjointQueryTimerExtension; + }, e.prototype.getQueryTimerExtensionWebGL2 = function () { + return this.getQueryTimerExtension(); + }, e.prototype.getQueryTimerExtensionWebGL1 = function () { + return this.getQueryTimerExtension(); + }, e.prototype.beginQuery = function () { + if (2 === ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")) { + var e = this.gl, + t = this.getQueryTimerExtensionWebGL2(), + n = e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT, n), n; + }var r = this.getQueryTimerExtensionWebGL1(), + o = r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT, o), o; + }, e.prototype.endQuery = function () { + if (2 !== ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")) { + var e = this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT); + } else { + var t = this.gl, + n = this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT); + } + }, e.prototype.waitForQueryAndGetTime = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t = this;return __generator(this, function (n) { + switch (n.label) {case 0: + return [4, repeatedTry(function () { + return t.isQueryAvailable(e, ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")); + })];case 1: + return n.sent(), [2, this.getQueryTime(e, ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))];} + }); + }); + }, e.prototype.getQueryTime = function (e, t) { + if (0 === t) return null;if (2 === t) { + var n = this.gl;return n.getQueryParameter(e, n.QUERY_RESULT) / 1e6; + }var r = this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(e, r.QUERY_RESULT_EXT) / 1e6; + }, e.prototype.isQueryAvailable = function (e, t) { + if (0 === t) return !0;if (2 === t) { + var n = this.gl, + r = this.getQueryTimerExtensionWebGL2(), + o = n.getQueryParameter(e, n.QUERY_RESULT_AVAILABLE);return null == this.disjoint && (this.disjoint = this.gl.getParameter(r.GPU_DISJOINT_EXT)), o && !this.disjoint; + }o = (r = this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(e, r.QUERY_RESULT_AVAILABLE_EXT);return null == this.disjoint && (this.disjoint = this.gl.getParameter(r.GPU_DISJOINT_EXT)), o && !this.disjoint; + }, e.prototype.pollFence = function (e) { + var t = this;return new Promise(function (n) { + t.addItemToPoll(function () { + return e.isFencePassed(); + }, function () { + return n(); + }); + }); + }, e.prototype.pollItems = function () { + for (var e = binSearchLastTrue(this.itemsToPoll.map(function (e) { + return e.isDoneFn; + })), t = 0; t <= e; ++t) { + (0, this.itemsToPoll[t].resolveFn)(); + }this.itemsToPoll = this.itemsToPoll.slice(e + 1); + }, e.prototype.addItemToPoll = function (e, t) { + var n = this;this.itemsToPoll.push({ isDoneFn: e, resolveFn: t }), this.itemsToPoll.length > 1 || repeatedTry(function () { + return n.pollItems(), 0 === n.itemsToPoll.length; + }); + }, e.prototype.bindTextureToFrameBuffer = function (e) { + this.throwIfDisposed(), bindColorTextureToFramebuffer(this.gl, e, this.framebuffer), this.autoDebugValidate && validateFramebuffer(this.gl); + }, e.prototype.unbindTextureToFrameBuffer = function () { + null != this.outputTexture ? (bindColorTextureToFramebuffer(this.gl, this.outputTexture, this.framebuffer), this.autoDebugValidate && validateFramebuffer(this.gl)) : unbindColorTextureFromFramebuffer(this.gl, this.framebuffer); + }, e.prototype.downloadMatrixDriver = function (e, t) { + this.bindTextureToFrameBuffer(e);var n = t();return this.unbindTextureToFrameBuffer(), n; + }, e.prototype.setOutputMatrixTextureDriver = function (e, t, n) { + this.throwIfDisposed();var r = this.gl;bindColorTextureToFramebuffer(r, e, this.framebuffer), this.autoDebugValidate && validateFramebuffer(r), this.outputTexture = e, callAndCheck(r, function () { + return r.viewport(0, 0, t, n); + }), callAndCheck(r, function () { + return r.scissor(0, 0, t, n); + }); + }, e.prototype.setOutputMatrixWriteRegionDriver = function (e, t, n, r) { + var o = this;this.throwIfDisposed(), callAndCheck(this.gl, function () { + return o.gl.scissor(e, t, n, r); + }); + }, e.prototype.throwIfDisposed = function () { + if (this.disposed) throw new Error("Attempted to use disposed GPGPUContext."); + }, e.prototype.throwIfNoProgram = function () { + if (null == this.program) throw new Error("No GPU program is currently set."); + }, e; + }();function binSearchLastTrue(e) { + for (var t = 0, n = e.length - 1, r = -1; t <= n;) { + var o = t + n >> 1;e[o]() ? (r = o, t = o + 1) : n = o - 1; + }return r; + }function compileProgram(e, t, n, r) { + for (var o = t.userCode, a = n.map(function (e, n) { + var r = { logicalShape: e.tensor.shape, texShape: e.isUniform ? null : e.texData.texShape, isUniform: e.isUniform };return { name: t.variableNames[n], shapeInfo: r }; + }), i = a.map(function (e) { + return e.shapeInfo; + }), s = { logicalShape: r.tensor.shape, texShape: r.texData.texShape, isUniform: !1 }, u = makeShader(a, s, o, !0 === t.supportsBroadcasting), l = e.createProgram(u), c = {}, p = 0; p < t.variableNames.length; p++) { + var d = t.variableNames[p];c[d] = e.getUniformLocation(l, d, !1); + }return { program: t, source: u, webGLProgram: l, uniformLocations: c, gpgpu: e, inShapeInfos: i, outShapeInfo: s }; + }function validateBinaryAndProgram(e, t) { + if (e.length !== t.length) throw Error("Binary was compiled with " + e.length + " inputs, but was executed with " + t.length + " inputs");e.forEach(function (e, n) { + var r = e.logicalShape, + o = t[n], + a = o.tensor.shape;if (!arraysEqual(r, a)) throw Error("Binary was compiled with different shapes than the current args. Shapes " + r + " and " + a + " must match");if (!e.isUniform || !o.isUniform) { + var i = e.texShape, + s = o.isUniform ? null : o.texData.texShape;if (!arraysEqual(i, s)) throw Error("Binary was compiled with different texture shapes than the current args. Shape " + i + " and " + s + " must match"); + } + }); + }function runProgram(e, t, n, r) { + validateBinaryAndProgram(e.inShapeInfos, t), validateBinaryAndProgram([e.outShapeInfo], [n]);var o = n.texData.texture, + a = n.texData.texShape, + i = e.gpgpu;i.setOutputMatrixTexture(o, a[0], a[1]), i.setProgram(e.webGLProgram), t.forEach(function (t, n) { + var r = e.program.variableNames[n], + o = e.uniformLocations[r];if (null != o) { + if (t.isUniform) { + if (1 === t.tensor.size) i.gl.uniform1f(o, t.tensor.dataSync()[0]);else { + var a = t.tensor.dataSync();a instanceof Float32Array || (a = new Float32Array(a)), i.gl.uniform1fv(o, a); + }return; + }var s = t.texData.texture;i.setInputMatrixTexture(s, o, n); + } + }), null != r && r(i, e.webGLProgram), i.executeProgram(); + }function makeShaderKey(e, t, n) { + var r = "";t.concat(n).forEach(function (e) { + r += e.tensor.shape + "_" + (e.isUniform ? "uniform" : e.texData.texShape); + });var o = e.userCode, + a = (!0 === e.supportsBroadcasting).toString(), + i = e.constructor.name;return i += "_" + a + "_" + r + "_" + o; + }var LRNProgram = function () { + return function (e, t, n, r, o) { + this.variableNames = ["x"], this.outputShape = [];var a, + i = t, + s = e[3] - 1;this.outputShape = e;var u = "float(" + n + ") + float(" + r + ") * sum";a = .5 === o ? "inversesqrt(" + u + ")" : 1 === o ? "1.0/(" + u + ")" : "exp(log(" + u + ") * float(-" + o + "));", this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -" + i + "; j <= " + i + "; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= " + s + ") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * " + a + ";\n setOutput(val);\n }\n "; + }; + }(), + LRNGradProgram = function () { + return function (e, t, n, r, o) { + this.variableNames = ["inputImage", "outputImage", "dy"], this.outputShape = [], this.outputShape = e, this.depth = e[3], this.depthRadius = t, this.bias = n, this.alpha = r, this.beta = o, this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < " + this.depth + "; ++d) {\n int depthBegin = int(max(0.0, float(d - " + t + ")));\n int depthEnd = int(min(float(" + this.depth + "),\n float(d + " + t + " + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = " + this.depth + ";\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(" + r + ") * norm + float(" + n + ");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(" + r + ")\n * float(" + o + ")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * " + o + ");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n "; + }; + }(), + MaxPool2DBackpropProgram = function () { + return function (e) { + this.variableNames = ["dy", "maxPos"], this.outputShape = e.inShape;var t = e.filterHeight, + n = e.filterWidth, + r = e.strideHeight, + o = e.strideWidth, + a = t - 1 - e.padInfo.top, + i = n - 1 - e.padInfo.left, + s = t * n - 1;this.userCode = "\n const ivec2 pads = ivec2(" + a + ", " + i + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < " + t + "; wR++) {\n float dyR = float(dyRCorner + wR) / " + r + ".0;\n\n if (dyR < 0.0 || dyR >= " + e.outHeight + ".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < " + n + "; wC++) {\n float dyC = float(dyCCorner + wC) / " + o + ".0;\n\n if (dyC < 0.0 || dyC >= " + e.outWidth + ".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = " + s + " - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * " + n + " + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n "; + }; + }(), + MatMulProgram = function () { + return function (e, t, n, r) { + void 0 === n && (n = !1), void 0 === r && (r = !1), this.variableNames = ["matrixA", "matrixB"];var o = n ? e[1] : e[0], + a = r ? t[0] : t[1], + i = n ? e[0] : e[1];this.outputShape = [o, a];var s = function (e, t) { + return n ? t + " + " + e + ", aRow" : "aRow, " + t + " + " + e; + }, + u = function (e, t) { + return r ? "bCol, " + t + " + " + e : t + " + " + e + ", bCol"; + }, + l = 4 * Math.floor(i / 4), + c = i % 4;this.userCode = " float dotARowBCol(int aRow, int bCol) {\n float result = 0.0;\n for (int i = 0; i < " + l + "; i += 4) {\n vec4 a = vec4(\n getMatrixA(" + s(0, "i") + "),\n getMatrixA(" + s(1, "i") + "),\n getMatrixA(" + s(2, "i") + "),\n getMatrixA(" + s(3, "i") + ")\n );\n vec4 b = vec4(\n getMatrixB(" + u(0, "i") + "),\n getMatrixB(" + u(1, "i") + "),\n getMatrixB(" + u(2, "i") + "),\n getMatrixB(" + u(3, "i") + ")\n );\n\n result += dot(a, b);\n }\n\n if (" + (1 === c) + ") {\n result += getMatrixA(" + s(0, l) + ") *\n getMatrixB(" + u(0, l) + ");\n } else if (" + (2 === c) + ") {\n vec2 a = vec2(\n getMatrixA(" + s(0, l) + "),\n getMatrixA(" + s(1, l) + ")\n );\n vec2 b = vec2(\n getMatrixB(" + u(0, l) + "),\n getMatrixB(" + u(1, l) + ")\n );\n result += dot(a, b);\n } else if (" + (3 === c) + ") {\n vec3 a = vec3(\n getMatrixA(" + s(0, l) + "),\n getMatrixA(" + s(1, l) + "),\n getMatrixA(" + s(2, l) + ")\n );\n vec3 b = vec3(\n getMatrixB(" + u(0, l) + "),\n getMatrixB(" + u(1, l) + "),\n getMatrixB(" + u(2, l) + ")\n );\n result += dot(a, b);\n }\n\n return result;\n }\n\n void main() {\n ivec2 resRC = getOutputCoords();\n setOutput(dotARowBCol(resRC.x, resRC.y));\n }\n "; + }; + }(), + MultinomialProgram = function () { + function e(e, t, n) { + this.variableNames = ["probs"], this.outputShape = [e, n], this.userCode = "\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < " + (t - 1) + "; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(" + (t - 1) + "));\n }\n "; + }return e.prototype.getCustomSetupFunc = function (e) { + var t = this;return function (n, r) { + null == t.seedLoc && (t.seedLoc = n.getUniformLocation(r, "seed")), n.gl.uniform1f(t.seedLoc, e); + }; + }, e; + }(), + OneHotProgram = function () { + return function (e, t, n, r) { + this.variableNames = ["indices"], this.outputShape = [e, t], this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(" + r + "), float(" + n + "),\n float(index == coords.y)));\n }\n "; + }; + }(), + PadProgram = function () { + return function (e, t, n) { + this.variableNames = ["x"], this.outputShape = t.map(function (t, n) { + return t[0] + e[n] + t[1]; + });var r = e.length, + o = getCoordsDataType(r), + a = t.map(function (e) { + return e[0]; + }).join(","), + i = t.map(function (t, n) { + return t[0] + e[n]; + }).join(","), + s = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, r);this.userCode = 1 !== r ? "\n " + o + " start = " + o + "(" + a + ");\n " + o + " end = " + o + "(" + i + ");\n\n void main() {\n " + o + " outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float(" + n + "));\n } else {\n " + o + " coords = outC - start;\n setOutput(getX(" + s + "));\n }\n }\n " : "\n int start = " + a + ";\n int end = " + i + ";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float(" + n + "));\n } else {\n setOutput(getX(outC - start));\n }\n }\n "; + }; + }(), + Pool2DProgram = function () { + return function (e, t, n) { + if (this.variableNames = ["x"], "avg" === t && n) throw new Error("Cannot compute positions for average pool.");var r = e.filterHeight, + o = e.filterWidth, + a = e.strideHeight, + i = e.strideWidth, + s = e.padInfo.top, + u = e.padInfo.left;this.outputShape = e.outShape;var l = "avg" === t, + c = "0.0";if (l || (c = "-1.0 / 0.0"), n) this.userCode = "\n const ivec2 strides = ivec2(" + a + ", " + i + ");\n const ivec2 pads = ivec2(" + s + ", " + u + ");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < " + r + "; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= " + e.inHeight + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + o + "; wC++) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= " + e.inWidth + ") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value >= currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * " + o + " + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ";else { + var p = t + "(" + t + "(" + t + "(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg" === t && (p = "avgValue / count");var d = 4 * Math.floor(o / 4), + h = o % 4, + f = "\n if (" + l + ") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n ";this.userCode = "\n const ivec2 strides = ivec2(" + a + ", " + i + ");\n const ivec2 pads = ivec2(" + s + ", " + u + ");\n const float initializationValue = " + c + ";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= " + e.inWidth + ") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(" + c + ");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < " + r + "; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= " + e.inHeight + ") {\n continue;\n }\n\n for (int wC = 0; wC < " + d + "; wC += 4) {\n int xC = xCCorner + wC;\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n getValue(batch, xR, xC + 3, d)\n );\n\n " + f + "\n }\n\n int xC = xCCorner + " + d + ";\n if (" + (1 === h) + ") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n " + f + "\n } else if (" + (2 === h) + ") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n initializationValue,\n initializationValue\n );\n\n " + f + "\n } else if (" + (3 === h) + ") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n initializationValue\n );\n\n " + f + "\n }\n }\n setOutput(" + p + ");\n }\n "; + } + }; + }(), + ReduceProgram = function () { + return function (e, t) { + this.variableNames = ["x"];var n = e.windowSize, + r = e.batchSize, + o = e.inSize, + a = Math.ceil(o / n);this.outputShape = [r, a];var i = "0.0", + s = "";"min" === t ? (i = "1.0 / 0.0", s = "min") : "max" === t && (i = "-1.0 / 0.0", s = "max");var u = t + "(" + t + "(" + t + "(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum" === t ? u = "sumValue" : "all" === t ? u = "allValue" : "any" === t && (u = "anyValue");var l = 4 * Math.floor(n / 4), + c = n % 4, + p = "\n if (" + ("sum" === t) + ") {\n sumValue += dot(values, ones);\n } else {\n minMaxValue = " + s + "(values, minMaxValue);\n }\n ", + d = "vec4";"all" === t ? (i = "1.0", p = "\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ", d = "bvec4") : "any" === t && (i = "0.0", p = "\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ", d = "bvec4");var h = "";o % n > 0 && (h = "\n if (inIdx < 0 || inIdx >= " + o + ") {\n return initializationValue;\n }\n "), this.userCode = "\n const float initializationValue = " + i + ";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n " + h + "\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * " + n + ";\n\n vec4 minMaxValue = vec4(" + i + ");\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < " + l + "; i += 4) {\n int inIdx = inOffset + i;\n " + d + " values = " + d + "(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n " + p + "\n }\n\n int inIdx = inOffset + " + l + ";\n if (" + (1 === c) + ") {\n " + d + " values = " + d + "(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n " + p + "\n } else if (" + (2 === c) + ") {\n " + d + " values = " + d + "(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n " + p + "\n } else if (" + (3 === c) + ") {\n " + d + " values = " + d + "(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n " + p + "\n }\n setOutput(" + u + ");\n }\n "; + }; + }(), + ResizeBilinearBackpropProgram = function () { + return function (e, t, n) { + this.variableNames = ["dy"], this.outputShape = [], this.outputShape = t.shape;var r = t.shape, + o = r[1], + a = r[2], + i = e.shape, + s = i[1], + u = i[2], + l = [n && s > 1 ? o - 1 : o, n && u > 1 ? a - 1 : a], + c = [n && s > 1 ? s - 1 : s, n && u > 1 ? u - 1 : u], + p = l[0] / c[0], + d = l[1] / c[1], + h = 1 / p, + f = 1 / d, + m = 2 * Math.ceil(h) + 2, + g = 2 * Math.ceil(f) + 2;this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(" + p + ");\n const float widthScale = float(" + d + ");\n\n const float invHeightScale = float(" + h + ");\n const float invWidthScale = float(" + f + ");\n\n const int winHeight = int(" + m + ");\n const int winWidth = int(" + g + ");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= " + s + ") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= " + u + ") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), " + (o - 1) + ".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), " + (a - 1) + ".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "; + }; + }(), + ResizeBilinearProgram = function () { + return function (e, t, n, r) { + this.variableNames = ["A"], this.outputShape = [];var o = e[0], + a = e[1], + i = e[2], + s = e[3];this.outputShape = [o, t, n, s];var u = [r && t > 1 ? a - 1 : a, r && n > 1 ? i - 1 : i], + l = [r && t > 1 ? t - 1 : t, r && n > 1 ? n - 1 : n];this.userCode = "\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n " + u[0] / l[0] + ",\n " + u[1] / l[1] + ");\n const vec2 inputShapeRC = vec2(" + a + ".0, " + i + ".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n "; + }; + }(), + ResizeNearestNeigborBackpropProgram = function () { + return function (e, t, n) { + this.variableNames = ["dy"], this.outputShape = [], this.outputShape = t.shape;var r = t.shape, + o = r[1], + a = r[2], + i = e.shape, + s = i[1], + u = i[2], + l = [n && s > 1 ? o - 1 : o, n && u > 1 ? a - 1 : a], + c = [n && s > 1 ? s - 1 : s, n && u > 1 ? u - 1 : u], + p = l[0] / c[0], + d = l[1] / c[1], + h = 1 / p, + f = 1 / d, + m = 2 * Math.ceil(h) + 2, + g = 2 * Math.ceil(f) + 2;this.userCode = "\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(" + p + ");\n const float widthScale = float(" + d + ");\n\n const float invHeightScale = float(" + h + ");\n const float invWidthScale = float(" + f + ");\n\n const int winHeight = int(" + m + ");\n const int winWidth = int(" + g + ");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= " + s + ") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= " + u + ") {\n continue;\n }\n\n float sourceFracRow =\n float(" + l[0] + ") *\n (float(dyR) / float(" + c[0] + "));\n\n float sourceFracCol =\n float(" + l[1] + ") *\n (float(dyC) / float(" + c[1] + "));\n\n int sourceNearestRow = int(min(\n float(int(" + o + ") - 1),\n " + n + " ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(" + a + ") - 1),\n " + n + " ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "; + }; + }(), + ResizeNearestNeighborProgram = function () { + return function (e, t, n, r) { + this.variableNames = ["A"], this.outputShape = [];var o = e[0], + a = e[1], + i = e[2], + s = e[3];this.outputShape = [o, t, n, s];var u = [r && t > 1 ? a - 1 : a, r && n > 1 ? i - 1 : i], + l = [r && t > 1 ? t - 1 : t, r && n > 1 ? n - 1 : n], + c = r ? "0.5" : "0.0";this.userCode = "\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n " + u[0] / l[0] + ",\n " + u[1] / l[1] + ");\n const vec2 inputShapeRC = vec2(" + a + ".0, " + i + ".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + " + c + ")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n "; + }; + }(), + ReverseProgram = function () { + return function (e, t) { + this.variableNames = ["x"];var n = e.length;if (n > 4) throw new Error("WebGL backend: Reverse of rank-" + n + " tensor is not yet supported");if (this.outputShape = e, 1 !== n) { + var r = e.map(function (n, r) { + return function (n) { + return -1 !== t.indexOf(n) && 1 !== e[n] ? e[n] + " - coords[" + n + "] - 1" : "coords[" + n + "]"; + }(r); + }).join(","), + o = getCoordsDataType(n);this.userCode = "\n void main() {\n " + o + " coords = getOutputCoords();\n setOutput(getX(" + r + "));\n }\n "; + } else this.userCode = "\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(" + e[0] + " - coord - 1));\n }\n "; + }; + }(), + SegmentOpProgram = function () { + return function (e, t) { + this.variableNames = ["x", "segmentIds"];var n = e.windowSize, + r = e.batchSize, + o = e.inSize, + a = e.numSegments, + i = a * Math.ceil(o / n);this.outputShape = [r, i];var s = 4 * Math.floor(n / 4), + u = n % 4, + l = "\n sumValue += dot(values, filter);\n ", + c = "";o % n > 0 && (c = "\n if (inIdx < 0 || inIdx >= " + o + ") {\n return initializationValue;\n }\n ");var p = "";o % n > 0 && (p = "\n if (inIdx < 0 || inIdx >= " + o + ") {\n return -1.0;\n }\n "), this.userCode = "\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n " + c + "\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n " + p + "\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n " + a + ")) * float(" + n + "));\n int currentSeg = int(mod(float(outIdx), float(" + a + ")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < " + s + "; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n " + l + "\n }\n\n int inIdx = inOffset + " + s + ";\n if (" + (1 === u) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n " + l + "\n } else if (" + (2 === u) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n " + l + "\n } else if (" + (3 === u) + ") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n " + l + "\n }\n setOutput(sumValue);\n }\n "; + }; + }(), + SelectProgram = function () { + return function (e, t, n) { + var r, o;if (this.variableNames = ["c", "a", "b"], this.outputShape = t, n > 4) throw Error("Where for rank " + n + " is not yet supported");if (1 === n) o = "resRC", r = "resRC";else { + for (var a = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], i = [], s = [], u = 0; u < t.length; u++) s.push("" + a[u]), u < e && i.push("" + a[u]);r = i.join(), o = s.join(); + }var l = getCoordsDataType(n);this.userCode = "\n void main() {\n " + l + " resRC = getOutputCoords();\n float cVal = getC(" + r + ");\n if (cVal >= 1.0) {\n setOutput(getA(" + o + "));\n } else {\n setOutput(getB(" + o + "));\n }\n }\n "; + }; + }(), + SliceProgram = function () { + function e(e) { + this.variableNames = ["source"], this.outputShape = e, this.rank = e.length;var t = getCoordsDataType(this.rank), + n = getCoords$1(this.rank);this.userCode = "\n uniform " + t + " start;\n\n void main() {\n " + t + " sourceLoc = start + getOutputCoords();\n setOutput(getSource(" + n + "));\n }\n "; + }return e.prototype.getCustomSetupFunc = function (e) { + var t = this;if (e.length !== this.rank) throw Error("The rank (" + this.rank + ") of the program must match the length of start (" + e.length + ")");return function (n, r) { + if (null != t.startLoc || (t.startLoc = n.getUniformLocationNoThrow(r, "start"), null != t.startLoc)) if (1 === t.rank) n.gl.uniform1i(t.startLoc, e[0]);else if (2 === t.rank) n.gl.uniform2i(t.startLoc, e[0], e[1]);else if (3 === t.rank) n.gl.uniform3i(t.startLoc, e[0], e[1], e[2]);else { + if (4 !== t.rank) throw Error("Slicing for rank " + t.rank + " is not yet supported");n.gl.uniform4i(t.startLoc, e[0], e[1], e[2], e[3]); + } + }; + }, e; + }();function getCoords$1(e) { + if (1 === e) return "sourceLoc";if (2 === e) return "sourceLoc.x, sourceLoc.y";if (3 === e) return "sourceLoc.x, sourceLoc.y, sourceLoc.z";if (4 === e) return "sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w";throw Error("Slicing for rank " + e + " is not yet supported"); + }var StridedSliceProgram = function () { + return function (e, t, n) { + this.variableNames = ["x"], this.outputShape = n, this.rank = n.length;var r = getCoordsDataType(this.rank), + o = "";o = 1 === this.rank ? "coords * strides + begin" : n.map(function (e, t) { + return "coords[" + t + "] * strides[" + t + "] + begin[" + t + "]"; + }).join(","), this.userCode = "\n " + r + " begin = " + r + "(" + e + ");\n " + r + " strides = " + r + "(" + t + ");\n\n void main() {\n " + r + " coords = getOutputCoords();\n setOutput(getX(" + o + "));\n }\n "; + }; + }(), + TextureManager = function () { + function e(e) { + this.gpgpu = e, this.numUsedTextures = 0, this.numFreeTextures = 0, this.freeTextures = {}, this.logEnabled = !1, this.usedTextures = {}; + }return e.prototype.acquireTexture = function (e, t) { + var n, + r = getPhysicalFromLogicalTextureType(t), + o = getKeyFromTextureShape(e, r);if (o in this.freeTextures || (this.freeTextures[o] = []), o in this.usedTextures || (this.usedTextures[o] = []), this.freeTextures[o].length > 0) { + this.numFreeTextures--, this.numUsedTextures++, this.log();var a = this.freeTextures[o].shift();return this.usedTextures[o].push(a), a; + }return this.numUsedTextures++, this.log(), r === PhysicalTextureType.FLOAT32 ? n = this.gpgpu.createFloat32MatrixTexture(e[0], e[1]) : r === PhysicalTextureType.FLOAT16 ? n = this.gpgpu.createFloat16MatrixTexture(e[0], e[1]) : r === PhysicalTextureType.UNSIGNED_BYTE && (n = this.gpgpu.createUnsignedBytesMatrixTexture(e[0], e[1])), this.usedTextures[o].push(n), n; + }, e.prototype.releaseTexture = function (e, t, n) { + var r = getKeyFromTextureShape(t, getPhysicalFromLogicalTextureType(n));r in this.freeTextures || (this.freeTextures[r] = []), this.freeTextures[r].push(e), this.numFreeTextures++, this.numUsedTextures--;var o = this.usedTextures[r], + a = o.indexOf(e);if (a < 0) throw new Error("Cannot release a texture that was never provided by this texture manager");o.splice(a, 1), this.log(); + }, e.prototype.log = function () { + if (this.logEnabled) { + var e = this.numFreeTextures + this.numUsedTextures;console.log("Free/Used", this.numFreeTextures + " / " + this.numUsedTextures, "(" + e + ")"); + } + }, e.prototype.getNumUsedTextures = function () { + return this.numUsedTextures; + }, e.prototype.getNumFreeTextures = function () { + return this.numFreeTextures; + }, e.prototype.dispose = function () { + var e = this;if (null != this.freeTextures) { + for (var t in this.freeTextures) this.freeTextures[t].forEach(function (t) { + e.gpgpu.deleteMatrixTexture(t); + });for (var t in this.usedTextures) this.usedTextures[t].forEach(function (t) { + e.gpgpu.deleteMatrixTexture(t); + });this.freeTextures = null, this.usedTextures = null, this.numUsedTextures = 0, this.numFreeTextures = 0; + } + }, e; + }();function getPhysicalFromLogicalTextureType(e) { + if (e === TextureUsage.DOWNLOAD || e === TextureUsage.PIXELS) return PhysicalTextureType.UNSIGNED_BYTE;if (e === TextureUsage.UPLOAD) return PhysicalTextureType.FLOAT32;if (e === TextureUsage.RENDER) return ENV.get("WEBGL_RENDER_FLOAT32_ENABLED") ? PhysicalTextureType.FLOAT32 : PhysicalTextureType.FLOAT16;throw new Error("Unknown logical texture type " + e); + }function getKeyFromTextureShape(e, t) { + return e[0] + "_" + e[1] + "_" + t; + }var TileProgram = function () { + return function (e, t) { + this.variableNames = ["A"];for (var n = new Array(e.length), r = 0; r < n.length; r++) n[r] = e[r] * t[r];this.outputShape = n, this.rank = n.length;var o = getCoordsDataType(this.rank), + a = getSourceCoords$1(e);this.userCode = "\n void main() {\n " + o + " resRC = getOutputCoords();\n setOutput(getA(" + a + "));\n }\n "; + }; + }();function getSourceCoords$1(e) { + var t = e.length;if (t > 5) throw Error("Tile for rank " + t + " is not yet supported");if (1 === t) return "imod(resRC, " + e[0] + ")";for (var n = ["resRC.x", "resRC.y", "resRC.z", "resRC.w", "resRC.u"], r = [], o = 0; o < e.length; o++) r.push("imod(" + n[o] + ", " + e[o] + ")");return r.join(); + }var TransposeProgram = function () { + return function (e, t) { + this.variableNames = ["A"];for (var n = new Array(e.length), r = 0; r < n.length; r++) n[r] = e[t[r]];this.outputShape = n, this.rank = n.length;var o = getCoordsDataType(this.rank), + a = getSwitchedCoords(t);this.userCode = "\n void main() {\n " + o + " resRC = getOutputCoords();\n setOutput(getA(" + a + "));\n }\n "; + }; + }();function getSwitchedCoords(e) { + var t = e.length;if (t > 6) throw Error("Transpose for rank " + t + " is not yet supported");for (var n = ["resRC.x", "resRC.y", "resRC.z", "resRC.w", "resRC.u", "resRC.v"], r = new Array(t), o = 0; o < e.length; o++) r[e[o]] = n[o];return r.join(); + }var ERF_P = .3275911, + ERF_A1 = .254829592, + ERF_A2 = -.284496736, + ERF_A3 = 1.421413741, + ERF_A4 = -1.453152027, + ERF_A5 = 1.061405429, + SELU_SCALEALPHA = 1.7580993408473768, + SELU_SCALE = 1.0507009873554805, + UnaryOpProgram = function () { + function e(e, t) { + this.variableNames = ["A"], this.outputShape = e, this.userCode = "\n uniform float NAN;\n float unaryOperation(float x) {\n " + t + "\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n "; + }return e.prototype.getCustomSetupFunc = function () { + var e = this;return function (t, n) { + null == e.startLoc && (e.startLoc = t.getUniformLocationNoThrow(n, "NAN"), null == e.startLoc) || t.gl.uniform1f(e.startLoc, NaN); + }; + }, e; + }(), + CHECK_NAN_SNIPPET$1 = "if (isNaN(x)) return x;", + ABS = "return abs(x);", + RELU = CHECK_NAN_SNIPPET$1 + "\n return (x < 0.0) ? 0.0 : x;\n", + ELU = "return (x >= 0.0) ? x : (exp(x) - 1.0);", + SELU = "\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = " + SELU_SCALEALPHA + ";\n float scale = " + SELU_SCALE + ";\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n";function STEP(e) { + return void 0 === e && (e = 0), CHECK_NAN_SNIPPET$1 + "\n return x > 0.0 ? 1.0 : float(" + e + ");\n "; + }var NEG = "return -x;", + CEIL = "return ceil(x);", + FLOOR = "return floor(x);", + SIGN = "\n if (isNaN(x)) { return 0.0; }\n return sign(x);\n", + ROUND = "\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n", + EXP = "return exp(x);", + EXPM1 = "return exp(x) - 1.0;", + LOG = "if (x < 0.0) return NAN;\n return log(x);", + LOG1P = "return log(1.0 + x);", + SQRT = "return sqrt(x);", + RSQRT = "return inversesqrt(x);", + SIGMOID = "return 1.0 / (1.0 + exp(-1.0 * x));", + SOFTPLUS = "\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n", + SIN = CHECK_NAN_SNIPPET$1 + "\n return sin(x);\n", + COS = CHECK_NAN_SNIPPET$1 + "\n return cos(x);\n", + TAN = "return tan(x);", + ASIN = "return asin(x);", + ACOS = "return acos(x);", + ATAN = CHECK_NAN_SNIPPET$1 + "\n return atan(x);\n", + SINH = "\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n", + COSH = "\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n", + TANH = "\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n", + ASINH = "return log(x + sqrt(x * x + 1.0));", + ACOSH = CHECK_NAN_SNIPPET$1 + "\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));", + ATANH = CHECK_NAN_SNIPPET$1 + "\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;", + ERF = '\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = ' + ERF_P + ";\n float a1 = " + ERF_A1 + ";\n float a2 = " + ERF_A2 + ";\n float a3 = " + ERF_A3 + ";\n float a4 = " + ERF_A4 + ";\n float a5 = " + ERF_A5 + ";\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n", + SQUARE = "return x * x;", + RECIPROCAL = "return 1.0 / x;", + LOGICAL_NOT = "return float(!(x >= 1.0));", + TO_INT = "return float(int(x));";function concat1d_(e) { + return concat(e, 0); + }function concat2d_(e, t) { + return concat(e, t); + }function concat3d_(e, t) { + return concat(e, t); + }function concat4d_(e, t) { + return concat(e, t); + }function concat_(e, t) { + void 0 === t && (t = 0), assert(e.length >= 1, "Pass at least one tensor to concat");var n = convertToTensorArray(e, "tensors", "concat"), + r = n[0];if (1 === n.length) return r;for (var o = parseAxisParam(t, r.shape), a = 1; a < n.length; ++a) r = concat2Tensors(r, n[a], o[0]);return r; + }function concat2Tensors(e, t, n) { + assertParams(e.shape, t.shape, n);var r = computeOutShape$1(e.shape, t.shape, n), + o = e.as2D(-1, sizeFromShape(e.shape.slice(n))), + a = t.as2D(-1, sizeFromShape(t.shape.slice(n))), + i = computeGradientSliceShapes(o.shape, a.shape), + s = i.aBegin, + u = i.aSize, + l = i.bBegin, + c = i.bSize;return ENV.engine.runKernel(function (e) { + return e.concat(o, a); + }, { a: o, b: a }, function (e) { + return { a: function () { + return e.slice(s, u); + }, b: function () { + return e.slice(l, c); + } }; + }).reshape(r); + }var concat = op({ concat_: concat_ }), + concat1d = op({ concat1d_: concat1d_ }), + concat2d = op({ concat2d_: concat2d_ }), + concat3d = op({ concat3d_: concat3d_ }), + concat4d = op({ concat4d_: concat4d_ }); + function createCommonjsModule(e, t) { + return e(t = { exports: {} }, t.exports), t.exports; + }var alea = createCommonjsModule(function (e) { + !function (e, t, n) { + function r(e, t) { + return t.c = e.c, t.s0 = e.s0, t.s1 = e.s1, t.s2 = e.s2, t; + }function o(e, t) { + var n = new function (e) { + var t, + n = this, + r = (t = 4022871197, function (e) { + e = e.toString();for (var n = 0; n < e.length; n++) { + var r = .02519603282416938 * (t += e.charCodeAt(n));r -= t = r >>> 0, t = (r *= t) >>> 0, t += 4294967296 * (r -= t); + }return 2.3283064365386963e-10 * (t >>> 0); + });n.next = function () { + var e = 2091639 * n.s0 + 2.3283064365386963e-10 * n.c;return n.s0 = n.s1, n.s1 = n.s2, n.s2 = e - (n.c = 0 | e); + }, n.c = 1, n.s0 = r(" "), n.s1 = r(" "), n.s2 = r(" "), n.s0 -= r(e), n.s0 < 0 && (n.s0 += 1), n.s1 -= r(e), n.s1 < 0 && (n.s1 += 1), n.s2 -= r(e), n.s2 < 0 && (n.s2 += 1), r = null; + }(e), + o = t && t.state, + a = n.next;return a.int32 = function () { + return 4294967296 * n.next() | 0; + }, a.double = function () { + return a() + 1.1102230246251565e-16 * (2097152 * a() | 0); + }, a.quick = a, o && ("object" == typeof o && r(o, n), a.state = function () { + return r(n, {}); + }), a; + }t && t.exports ? t.exports = o : n && n.amd ? n(function () { + return o; + }) : this.alea = o; + }(0, e, !1); + }), + xor128 = createCommonjsModule(function (e) { + !function (e, t, n) { + function r(e, t) { + return t.x = e.x, t.y = e.y, t.z = e.z, t.w = e.w, t; + }function o(e, t) { + var n = new function (e) { + var t = this, + n = "";t.x = 0, t.y = 0, t.z = 0, t.w = 0, t.next = function () { + var e = t.x ^ t.x << 11;return t.x = t.y, t.y = t.z, t.z = t.w, t.w ^= t.w >>> 19 ^ e ^ e >>> 8; + }, e === (0 | e) ? t.x = e : n += e;for (var r = 0; r < n.length + 64; r++) t.x ^= 0 | n.charCodeAt(r), t.next(); + }(e), + o = t && t.state, + a = function () { + return (n.next() >>> 0) / 4294967296; + };return a.double = function () { + do { + var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); + } while (0 === e);return e; + }, a.int32 = n.next, a.quick = a, o && ("object" == typeof o && r(o, n), a.state = function () { + return r(n, {}); + }), a; + }t && t.exports ? t.exports = o : n && n.amd ? n(function () { + return o; + }) : this.xor128 = o; + }(0, e, !1); + }), + xorwow = createCommonjsModule(function (e) { + !function (e, t, n) { + function r(e, t) { + return t.x = e.x, t.y = e.y, t.z = e.z, t.w = e.w, t.v = e.v, t.d = e.d, t; + }function o(e, t) { + var n = new function (e) { + var t = this, + n = "";t.next = function () { + var e = t.x ^ t.x >>> 2;return t.x = t.y, t.y = t.z, t.z = t.w, t.w = t.v, (t.d = t.d + 362437 | 0) + (t.v = t.v ^ t.v << 4 ^ e ^ e << 1) | 0; + }, t.x = 0, t.y = 0, t.z = 0, t.w = 0, t.v = 0, e === (0 | e) ? t.x = e : n += e;for (var r = 0; r < n.length + 64; r++) t.x ^= 0 | n.charCodeAt(r), r == n.length && (t.d = t.x << 10 ^ t.x >>> 4), t.next(); + }(e), + o = t && t.state, + a = function () { + return (n.next() >>> 0) / 4294967296; + };return a.double = function () { + do { + var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); + } while (0 === e);return e; + }, a.int32 = n.next, a.quick = a, o && ("object" == typeof o && r(o, n), a.state = function () { + return r(n, {}); + }), a; + }t && t.exports ? t.exports = o : n && n.amd ? n(function () { + return o; + }) : this.xorwow = o; + }(0, e, !1); + }), + xorshift7 = createCommonjsModule(function (e) { + !function (e, t, n) { + function r(e, t) { + return t.x = e.x.slice(), t.i = e.i, t; + }function o(e, t) { + null == e && (e = +new Date());var n = new function (e) { + var t = this;t.next = function () { + var e, + n, + r = t.x, + o = t.i;return e = r[o], n = (e ^= e >>> 7) ^ e << 24, n ^= (e = r[o + 1 & 7]) ^ e >>> 10, n ^= (e = r[o + 3 & 7]) ^ e >>> 3, n ^= (e = r[o + 4 & 7]) ^ e << 7, e = r[o + 7 & 7], n ^= (e ^= e << 13) ^ e << 9, r[o] = n, t.i = o + 1 & 7, n; + }, function (e, t) { + var n, + r = [];if (t === (0 | t)) r[0] = t;else for (t = "" + t, n = 0; n < t.length; ++n) r[7 & n] = r[7 & n] << 15 ^ t.charCodeAt(n) + r[n + 1 & 7] << 13;for (; r.length < 8;) r.push(0);for (n = 0; n < 8 && 0 === r[n]; ++n);for (8 == n ? r[7] = -1 : r[n], e.x = r, e.i = 0, n = 256; n > 0; --n) e.next(); + }(t, e); + }(e), + o = t && t.state, + a = function () { + return (n.next() >>> 0) / 4294967296; + };return a.double = function () { + do { + var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); + } while (0 === e);return e; + }, a.int32 = n.next, a.quick = a, o && (o.x && r(o, n), a.state = function () { + return r(n, {}); + }), a; + }t && t.exports ? t.exports = o : n && n.amd ? n(function () { + return o; + }) : this.xorshift7 = o; + }(0, e, !1); + }), + xor4096 = createCommonjsModule(function (e) { + !function (e, t, n) { + function r(e, t) { + return t.i = e.i, t.w = e.w, t.X = e.X.slice(), t; + }function o(e, t) { + null == e && (e = +new Date());var n = new function (e) { + var t = this;t.next = function () { + var e, + n, + r = t.w, + o = t.X, + a = t.i;return t.w = r = r + 1640531527 | 0, n = o[a + 34 & 127], e = o[a = a + 1 & 127], n ^= n << 13, e ^= e << 17, n ^= n >>> 15, e ^= e >>> 12, n = o[a] = n ^ e, t.i = a, n + (r ^ r >>> 16) | 0; + }, function (e, t) { + var n, + r, + o, + a, + i, + s = [], + u = 128;for (t === (0 | t) ? (r = t, t = null) : (t += "\0", r = 0, u = Math.max(u, t.length)), o = 0, a = -32; a < u; ++a) t && (r ^= t.charCodeAt((a + 32) % t.length)), 0 === a && (i = r), r ^= r << 10, r ^= r >>> 15, r ^= r << 4, r ^= r >>> 13, a >= 0 && (i = i + 1640531527 | 0, o = 0 == (n = s[127 & a] ^= r + i) ? o + 1 : 0);for (o >= 128 && (s[127 & (t && t.length || 0)] = -1), o = 127, a = 512; a > 0; --a) r = s[o + 34 & 127], n = s[o = o + 1 & 127], r ^= r << 13, n ^= n << 17, r ^= r >>> 15, n ^= n >>> 12, s[o] = r ^ n;e.w = i, e.X = s, e.i = o; + }(t, e); + }(e), + o = t && t.state, + a = function () { + return (n.next() >>> 0) / 4294967296; + };return a.double = function () { + do { + var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); + } while (0 === e);return e; + }, a.int32 = n.next, a.quick = a, o && (o.X && r(o, n), a.state = function () { + return r(n, {}); + }), a; + }t && t.exports ? t.exports = o : n && n.amd ? n(function () { + return o; + }) : this.xor4096 = o; + }(0, e, !1); + }), + tychei = createCommonjsModule(function (e) { + !function (e, t, n) { + function r(e, t) { + return t.a = e.a, t.b = e.b, t.c = e.c, t.d = e.d, t; + }function o(e, t) { + var n = new function (e) { + var t = this, + n = "";t.next = function () { + var e = t.b, + n = t.c, + r = t.d, + o = t.a;return e = e << 25 ^ e >>> 7 ^ n, n = n - r | 0, r = r << 24 ^ r >>> 8 ^ o, o = o - e | 0, t.b = e = e << 20 ^ e >>> 12 ^ n, t.c = n = n - r | 0, t.d = r << 16 ^ n >>> 16 ^ o, t.a = o - e | 0; + }, t.a = 0, t.b = 0, t.c = -1640531527, t.d = 1367130551, e === Math.floor(e) ? (t.a = e / 4294967296 | 0, t.b = 0 | e) : n += e;for (var r = 0; r < n.length + 20; r++) t.b ^= 0 | n.charCodeAt(r), t.next(); + }(e), + o = t && t.state, + a = function () { + return (n.next() >>> 0) / 4294967296; + };return a.double = function () { + do { + var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); + } while (0 === e);return e; + }, a.int32 = n.next, a.quick = a, o && ("object" == typeof o && r(o, n), a.state = function () { + return r(n, {}); + }), a; + }t && t.exports ? t.exports = o : n && n.amd ? n(function () { + return o; + }) : this.tychei = o; + }(0, e, !1); + }), + seedrandom = createCommonjsModule(function (e) { + !function (t, n) { + var r, + o = this, + a = 256, + i = 6, + s = "random", + u = n.pow(a, i), + l = n.pow(2, 52), + c = 2 * l, + p = a - 1;function d(e, d, g) { + var v = [], + y = f(function e(t, n) { + var r, + o = [], + a = typeof t;if (n && "object" == a) for (r in t) try { + o.push(e(t[r], n - 1)); + } catch (e) {}return o.length ? o : "string" == a ? t : t + "\0"; + }((d = 1 == d ? { entropy: !0 } : d || {}).entropy ? [e, m(t)] : null == e ? function () { + try { + var e;return r && (e = r.randomBytes) ? e = e(a) : (e = new Uint8Array(a), (o.crypto || o.msCrypto).getRandomValues(e)), m(e); + } catch (e) { + var n = o.navigator, + i = n && n.plugins;return [+new Date(), o, i, o.screen, m(t)]; + } + }() : e, 3), v), + x = new function (e) { + var t, + n = e.length, + r = this, + o = 0, + i = r.i = r.j = 0, + s = r.S = [];n || (e = [n++]);for (; o < a;) s[o] = o++;for (o = 0; o < a; o++) s[o] = s[i = p & i + e[o % n] + (t = s[o])], s[i] = t;(r.g = function (e) { + for (var t, n = 0, o = r.i, i = r.j, s = r.S; e--;) t = s[o = p & o + 1], n = n * a + s[p & (s[o] = s[i = p & i + t]) + (s[i] = t)];return r.i = o, r.j = i, n; + })(a); + }(v), + T = function () { + for (var e = x.g(i), t = u, n = 0; e < l;) e = (e + n) * a, t *= a, n = x.g(1);for (; e >= c;) e /= 2, t /= 2, n >>>= 1;return (e + n) / t; + };return T.int32 = function () { + return 0 | x.g(4); + }, T.quick = function () { + return x.g(4) / 4294967296; + }, T.double = T, f(m(x.S), t), (d.pass || g || function (e, t, r, o) { + return o && (o.S && h(o, x), e.state = function () { + return h(x, {}); + }), r ? (n[s] = e, t) : e; + })(T, y, "global" in d ? d.global : this == n, d.state); + }function h(e, t) { + return t.i = e.i, t.j = e.j, t.S = e.S.slice(), t; + }function f(e, t) { + for (var n, r = e + "", o = 0; o < r.length;) t[p & o] = p & (n ^= 19 * t[p & o]) + r.charCodeAt(o++);return m(t); + }function m(e) { + return String.fromCharCode.apply(0, e); + }if (n["seed" + s] = d, f(n.random(), t), e.exports) { + e.exports = d;try { + r = require("crypto"); + } catch (e) {} + } + }([], Math); + });seedrandom.alea = alea, seedrandom.xor128 = xor128, seedrandom.xorwow = xorwow, seedrandom.xorshift7 = xorshift7, seedrandom.xor4096 = xor4096, seedrandom.tychei = tychei;var seedrandom$1 = seedrandom, + seedrandom_1 = seedrandom$1.alea, + MPRandGauss = function () { + function e(e, t, n, r, o) { + this.mean = e, this.stdDev = t, this.dtype = n, this.nextVal = NaN, this.truncated = r, this.truncated && (this.upper = this.mean + 2 * this.stdDev, this.lower = this.mean - 2 * this.stdDev);var a = o || Math.random();this.random = seedrandom_1(a.toString()); + }return e.prototype.nextValue = function () { + if (!isNaN(this.nextVal)) { + var e = this.nextVal;return this.nextVal = NaN, e; + }for (var t, n, r = !1; !r;) { + var o = void 0, + a = void 0, + i = void 0;do { + i = (o = 2 * this.random() - 1) * o + (a = 2 * this.random() - 1) * a; + } while (i >= 1 || 0 === i);var s = Math.sqrt(-2 * Math.log(i) / i);t = this.mean + this.stdDev * o * s, n = this.mean + this.stdDev * a * s, this.truncated && !this.isValidTruncated(t) || (r = !0); + }return this.truncated && !this.isValidTruncated(n) || (this.nextVal = this.convertValue(n)), this.convertValue(t); + }, e.prototype.convertValue = function (e) { + return null == this.dtype || "float32" === this.dtype ? e : Math.round(e); + }, e.prototype.isValidTruncated = function (e) { + return e <= this.upper && e >= this.lower; + }, e; + }();function clone_(e) { + var t = convertToTensor(e, "x", "clone");return ENV.engine.runKernel(function (e) { + return Tensor.make(t.shape, { dataId: t.dataId }, t.dtype); + }, { $x: t }, function (e) { + return { $x: function () { + return e.toFloat(); + } }; + }); + }function eye_(e, t, n, r) { + void 0 === r && (r = "float32"), null == t && (t = e);for (var o = buffer([e, t], r), a = e <= t ? e : t, i = 0; i < a; ++i) o.set(1, i, i);var s = o.toTensor().as2D(e, t);if (null == n) return s;if (1 === n.length) return tile(expandDims(s, 0), [n[0], 1, 1]);if (2 === n.length) return tile(expandDims(expandDims(s, 0), 0), [n[0], n[1], 1, 1]);if (3 === n.length) return tile(expandDims(expandDims(expandDims(s, 0), 0), 0), [n[0], n[1], n[2], 1, 1]);throw new Error("eye() currently supports only 1D and 2D batchShapes, but received " + n.length + "D."); + }function randomNormal_(e, t, n, r, o) { + if (void 0 === t && (t = 0), void 0 === n && (n = 1), null != r && "bool" === r) throw new Error("Unsupported data type " + r);for (var a = new MPRandGauss(t, n, r, !1, o), i = buffer(e, r), s = 0; s < i.values.length; s++) i.values[s] = a.nextValue();return i.toTensor(); + }function truncatedNormal_(e, t, n, r, o) { + if (void 0 === t && (t = 0), void 0 === n && (n = 1), null != r && "bool" === r) throw new Error("Unsupported data type " + r);for (var a = new MPRandGauss(t, n, r, !0, o), i = buffer(e, r), s = 0; s < i.values.length; s++) i.values[s] = a.nextValue();return i.toTensor(); + }function randomUniform_(e, t, n, r) { + void 0 === t && (t = 0), void 0 === n && (n = 1), void 0 === r && (r = "float32");for (var o = buffer(e, r), a = 0; a < o.values.length; a++) o.values[a] = randUniform(t, n);return o.toTensor(); + }function rand_(e, t, n) { + var r = sizeFromShape(e), + o = null;if (null == n || "float32" === n) o = new Float32Array(r);else if ("int32" === n) o = new Int32Array(r);else { + if ("bool" !== n) throw new Error("Unknown data type " + n);o = new Uint8Array(r); + }for (var a = 0; a < r; a++) o[a] = t();return Tensor.make(e, { values: o }, n); + }function multinomial_(e, t, n, r) { + void 0 === r && (r = !1);var o = convertToTensor(e, "logits", "multinomial"), + a = o.size, + i = o.rank;if (a < 2) throw new Error("Error in multinomial: you need at least 2 outcomes, but got " + a + ".");if (i > 2) throw new Error("Rank of probabilities must be 1 or 2, but is " + i);n = n || Math.random();var s = 1 === i ? o.as2D(1, -1) : o, + u = ENV.engine.runKernel(function (e) { + return e.multinomial(s, r, t, n); + }, { logits2D: s });return 1 === i ? u.as1D() : u; + }function oneHot_(e, t, n, r) { + void 0 === n && (n = 1), void 0 === r && (r = 0);var o = convertToTensor(e, "indices", "oneHot", "int32");if (assert("int32" === o.dtype, "Indices must be of dtype `int32`"), t < 2) throw new Error("Error in oneHot: depth must be >=2, but it is " + t);return ENV.engine.runKernel(function (e) { + return e.oneHot(o, t, n, r); + }, { $indices: o }); + }function fromPixels_(e, t) { + if (void 0 === t && (t = 3), t > 4) throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");return ENV.engine.fromPixels(e, t); + }function toPixels(e, t) { + return __awaiter(this, void 0, void 0, function () { + var n, r, o, a, i, s, u, l, c, p, d, h, f, m, g, v, y, x, T, S;return __generator(this, function (b) { + switch (b.label) {case 0: + if (2 !== (n = convertToTensor(e, "img", "toPixels", "int32")).rank && 3 !== n.rank) throw new Error("toPixels only supports rank 2 or 3 tensors, got rank " + n.rank + ".");if (r = n.shape.slice(0, 2), o = r[0], a = r[1], (i = 2 === n.rank ? 1 : n.shape[2]) > 4 || 2 === i) throw new Error("toPixels only supports depth of size 1, 3 or 4 but got " + i);return s = n.min(), u = n.max(), [4, s.data()];case 1: + return l = b.sent()[0], [4, u.data()];case 2: + if (c = b.sent()[0], s.dispose(), u.dispose(), "float32" === n.dtype) { + if (l < 0 || c > 1) throw new Error("Tensor values for a float32 Tensor must be in the range [0 - 1] but got range [" + l + " - " + c + "]."); + } else { + if ("int32" !== n.dtype) throw new Error("Unsupported type for toPixels: " + n.dtype + ". Please use float32 or int32 tensors.");if (l < 0 || c > 255) throw new Error("Tensor values for a int32 Tensor must be in the range [0 - 255] but got range [" + l + " - " + c + "]."); + }return [4, n.data()];case 3: + for (p = b.sent(), d = "float32" === n.dtype ? 255 : 1, h = new Uint8ClampedArray(a * o * 4), f = 0; f < o * a; ++f) m = void 0, g = void 0, v = void 0, y = void 0, 1 === i ? (m = p[f] * d, g = p[f] * d, v = p[f] * d, y = 255) : 3 === i ? (m = p[3 * f] * d, g = p[3 * f + 1] * d, v = p[3 * f + 2] * d, y = 255) : 4 === i && (m = p[4 * f] * d, g = p[4 * f + 1] * d, v = p[4 * f + 2] * d, y = p[4 * f + 3] * d), h[(x = 4 * f) + 0] = Math.round(m), h[x + 1] = Math.round(g), h[x + 2] = Math.round(v), h[x + 3] = Math.round(y);return null != t && (t.width = a, t.height = o, T = t.getContext("2d"), S = new ImageData(h, a, o), T.putImageData(S, 0, 0)), n !== e && n.dispose(), [2, h];} + }); + }); + }function reshape_(e, t) { + var n = convertToTensor(e, "x", "reshape");t = inferFromImplicitShape(t, n.size), assert(n.size === sizeFromShape(t), "new shape and old shape must have the same number of elements.");return ENV.engine.runKernel(function (e) { + return e.reshape(n, t); + }, { $x: n }, function (e) { + return { $x: function () { + return e.reshape(n.shape); + } }; + }); + }function squeeze_(e, t) { + var n = convertToTensor(e, "x", "squeeze");return reshape(n, squeezeShape(n.shape, t).newShape); + }function cast_(e, t) { + var n = convertToTensor(e, "x", "cast");return ENV.engine.runKernel(function (e) { + return e.cast(n, t); + }, { $x: n }, function (e) { + return { $x: function () { + return e.clone(); + } }; + }); + }function tile_(e, t) { + var n = convertToTensor(e, "x", "tile");assert(n.rank === t.length, "Error in transpose: rank of input " + n.rank + " must match length of reps " + t + ".");return ENV.engine.runKernel(function (e) { + return e.tile(n, t); + }, { $x: n }, function (e) { + return { $x: function () { + var r = zerosLike(n);if (1 === n.rank) for (var o = 0; o < t[0]; ++o) r = r.add(e.slice([o * n.shape[0]], [n.shape[0]]));else if (2 === n.rank) for (o = 0; o < t[0]; ++o) for (var a = 0; a < t[1]; ++a) r = r.add(e.slice([o * n.shape[0], a * n.shape[1]], [n.shape[0], n.shape[1]]));else if (3 === n.rank) for (o = 0; o < t[0]; ++o) for (a = 0; a < t[1]; ++a) for (var i = 0; i < t[2]; ++i) r = r.add(e.slice([o * n.shape[0], a * n.shape[1], i * n.shape[2]], [n.shape[0], n.shape[1], n.shape[2]]));else { + if (4 !== n.rank) throw new Error("Gradient for tile operation is not implemented for rank-" + n.rank + " tensors yet.");for (o = 0; o < t[0]; ++o) for (a = 0; a < t[1]; ++a) for (i = 0; i < t[2]; ++i) for (var s = 0; s < t[3]; ++s) r = r.add(e.slice([o * n.shape[0], a * n.shape[1], i * n.shape[2], s * n.shape[3]], [n.shape[0], n.shape[1], n.shape[2], n.shape[3]])); + }return r; + } }; + }); + }function pad1d_(e, t, n) { + return void 0 === n && (n = 0), assert(2 === t.length, "Invalid number of paddings. Must be length of 2."), pad(e, [t], n); + }function pad2d_(e, t, n) { + return void 0 === n && (n = 0), assert(2 === t.length && 2 === t[0].length && 2 === t[1].length, "Invalid number of paddings. Must be length of 2 each."), pad(e, t, n); + }function pad3d_(e, t, n) { + return void 0 === n && (n = 0), assert(3 === t.length && 2 === t[0].length && 2 === t[1].length && 2 === t[2].length, "Invalid number of paddings. Must be length of 2 each."), pad(e, t, n); + }function pad4d_(e, t, n) { + return void 0 === n && (n = 0), assert(4 === t.length && 2 === t[0].length && 2 === t[1].length && 2 === t[2].length && 2 === t[3].length, "Invalid number of paddings. Must be length of 2 each."), pad(e, t, n); + }function pad_(e, t, n) { + void 0 === n && (n = 0);var r = convertToTensor(e, "x", "pad");if (0 === r.rank) throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");var o = t.map(function (e) { + return e[0]; + });return ENV.engine.runKernel(function (e) { + return e.pad(r, t, n); + }, { $x: r }, function (e) { + return { $x: function () { + return e.slice(o, r.shape); + } }; + }); + }function stack_(e, t) { + void 0 === t && (t = 0);var n = convertToTensorArray(e, "tensors", "stack");if (assert(n.length >= 1, "Pass at least one tensor to tf.stack"), 1 === n.length) return n[0].expandDims(t);var r = n[0].rank, + o = n[0].shape, + a = n[0].dtype;assert(t <= r, "Axis must be <= rank of the tensor"), n.forEach(function (e) { + assertShapesMatch(o, e.shape, "All tensors passed to stack must have matching shapes"); + }), n.forEach(function (e) { + assert(a === e.dtype, "All tensors passed to stack must have matching dtypes"); + });var i = n.map(function (e) { + return e.expandDims(t); + });return concat(i, t); + }function batchToSpaceND_(e, t, n) { + var r = convertToTensor(e, "x", "batchToSpaceND"), + o = t.reduce(function (e, t) { + return e * t; + });return assert(r.rank >= 1 + t.length, "input rank should be > than [blockShape] but got " + r.rank), assert(n.length === t.length, "crops.shape[0] must be equal to [blockShape] but got " + n.length), assert(r.shape[0] % o == 0, "input tensor batch must be divisible by prod( blockShape )"), ENV.engine.runKernel(function (e) { + return e.batchToSpaceND(r, t, n); + }, {}); + }function spaceToBatchND_(e, t, n) { + var r = convertToTensor(e, "x", "spaceToBatchND");return assert(r.rank >= 1 + t.length, "input rank should be > than [blockShape] but got " + r.rank), assert(n.length === t.length, "paddings.shape[0] must be equal to [blockShape], got " + n.length), assert(r.shape.reduce(function (e, n, r) { + return r > 0 && r <= t.length ? e && n % t[r - 1] == 0 : e; + }, !0), "input spatial dimensions must be divisible by blockShapes"), ENV.engine.runKernel(function (e) { + return e.spaceToBatchND(r, t, n); + }, {}); + }function unstack_(e, t) { + void 0 === t && (t = 0);for (var n, r = convertToTensor(e, "x", "unstack"), o = r.shape[t], a = Array(r.rank - 1).fill(0), i = 0, s = 0; s < r.rank; s++) s !== t && (a[i] = r.shape[s], i++);n = Array(o).fill(1);var u = Array(r.rank).fill(0), + l = r.shape.slice();return n.map(function (e) { + l[t] = e;var n = r.slice(u, l);return u[t] += e, n.reshape(a); + }); + }function split_(e, t, n) { + void 0 === n && (n = 0);var r, + o = convertToTensor(e, "x", "split");n = parseAxisParam(n, o.shape)[0], "number" == typeof t ? (assert(o.shape[n] % t == 0, "Number of splits must evenly divide the axis."), r = Array(t).fill(o.shape[n] / t)) : (assert(o.shape[n] === t.reduce(function (e, t) { + return e + t; + }), "The sum of sizes must match the size of the axis dimension."), r = t);var a = Array(o.rank).fill(0), + i = o.shape.slice();return r.map(function (e) { + i[n] = e;var t = o.slice(a, i);return a[n] += e, t; + }); + }function cumsum_(e, t, n, r) { + void 0 === t && (t = 0), void 0 === n && (n = !1), void 0 === r && (r = !1);var o = convertToTensor(e, "x", "cumsum"), + a = getAxesPermutation([t |= 0], o.rank), + i = o;null != a && (i = o.transpose(a));var s = getInnerMostAxes(1, o.rank)[0], + u = ENV.engine.runKernel(function (e) { + return e.cumsum(i, s, n, r); + }, { permutedX: i }, function (e) { + return { permutedX: function () { + return e.cumsum(t, n, !r); + } }; + });return null != a && (u = u.transpose(a)), u; + }function expandDims_(e, t) { + void 0 === t && (t = 0);var n = convertToTensor(e, "x", "expandDims");assert(t <= n.rank, "Axis must be <= rank of the tensor");var r = n.shape.slice();return t < 0 && (assert(-(n.rank + 1) <= t, "Axis must be in the interval [" + -(n.rank + 1) + ", " + n.rank + "]"), t = n.rank + t + 1), r.splice(t, 0, 1), reshape(n, r); + }function buffer(e, t, n) { + return void 0 === t && (t = "float32"), new TensorBuffer(e, t, n); + }function print(e, t) { + void 0 === t && (t = !1), console.log(e.toString(t)); + }var cast = op({ cast_: cast_ }), + clone = op({ clone_: clone_ }), + cumsum = op({ cumsum_: cumsum_ }), + expandDims = op({ expandDims_: expandDims_ }), + eye = op({ eye_: eye_ }), + fromPixels = op({ fromPixels_: fromPixels_ }), + multinomial = op({ multinomial_: multinomial_ }), + oneHot = op({ oneHot_: oneHot_ }), + pad = op({ pad_: pad_ }), + pad1d = op({ pad1d_: pad1d_ }), + pad2d = op({ pad2d_: pad2d_ }), + pad3d = op({ pad3d_: pad3d_ }), + pad4d = op({ pad4d_: pad4d_ }), + rand = op({ rand_: rand_ }), + randomNormal = op({ randomNormal_: randomNormal_ }), + randomUniform = op({ randomUniform_: randomUniform_ }), + reshape = op({ reshape_: reshape_ }), + split = op({ split_: split_ }), + squeeze = op({ squeeze_: squeeze_ }), + stack = op({ stack_: stack_ }), + tile = op({ tile_: tile_ }), + truncatedNormal = op({ truncatedNormal_: truncatedNormal_ }), + unstack = op({ unstack_: unstack_ }), + batchToSpaceND = op({ batchToSpaceND_: batchToSpaceND_ }), + spaceToBatchND = op({ spaceToBatchND_: spaceToBatchND_ });function whereImpl(e, t) { + for (var n = [], r = 0; r < t.length; r++) t[r] && n.push(r);var o = buffer(e, "int32"), + a = buffer([n.length, e.length], "int32");for (r = 0; r < n.length; r++) { + var i = o.indexToLoc(n[r]), + s = r * e.length;a.values.set(i, s); + }return a.toTensor(); + }var BEFORE_PAGING_CONSTANT = 300, + SIZE_UPLOAD_UNIFORM = 32, + MathBackendWebGL = function () { + function e(e, t) { + if (void 0 === t && (t = !0), this.gpgpu = e, this.delayedStorage = t, this.texData = new WeakMap(), this.pendingRead = new WeakMap(), this.pendingDisposal = new WeakSet(), this.lruDataGPU = [], this.numBytesInGPU = 0, this.uploadWaitMs = 0, this.downloadWaitMs = 0, this.binaryCache = {}, this.disposed = !1, ENV.get("WEBGL_VERSION") < 1) throw new Error("WebGL is not supported on this device");ENV.get("IS_BROWSER") && (this.canvas = document.createElement("canvas")), null == e ? (this.gpgpu = new GPGPUContext(createWebGLContext(this.canvas)), this.gpgpuCreatedLocally = !0) : this.gpgpuCreatedLocally = !1, this.NUM_BYTES_BEFORE_PAGING = window.screen.height * window.screen.width * window.devicePixelRatio * BEFORE_PAGING_CONSTANT, this.textureManager = new TextureManager(this.gpgpu); + }return e.prototype.register = function (e, t, n) { + if (this.texData.has(e)) throw new Error("Data buffer is already registered");this.texData.set(e, { shape: t, dtype: n, values: null, texture: null, texShape: null, usage: TextureUsage.RENDER }); + }, e.prototype.fromPixels = function (e, t) { + if (null == e) throw new Error("pixels passed to tf.fromPixels() can not be null");var n = [e.height, e.width], + r = [e.height, e.width, t];if (!(e instanceof HTMLVideoElement || e instanceof HTMLImageElement || e instanceof HTMLCanvasElement || e instanceof ImageData)) throw new Error("pixels passed to tf.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ImageData, but was " + e.constructor.name);if (e instanceof HTMLVideoElement) { + if (null == this.fromPixelsCanvas) { + if (!ENV.get("IS_BROWSER")) throw new Error("Can't read pixels from HTMLImageElement outside the browser.");if ("complete" !== document.readyState) throw new Error("The DOM is not ready yet. Please call tf.fromPixels() once the DOM is ready. One way to do that is to add an event listener for `DOMContentLoaded` on the document object");this.fromPixelsCanvas = document.createElement("canvas"); + }this.fromPixelsCanvas.width = e.width, this.fromPixelsCanvas.height = e.height, this.fromPixelsCanvas.getContext("2d").drawImage(e, 0, 0, e.width, e.height), e = this.fromPixelsCanvas; + }var o = Tensor.make(n, {}, "int32");this.texData.get(o.dataId).usage = TextureUsage.PIXELS, this.gpgpu.uploadPixelDataToTexture(this.getTexture(o.dataId), e);var a = new FromPixelsProgram(r), + i = this.compileAndRun(a, [o]);return o.dispose(), i; + }, e.prototype.write = function (e, t) { + if (null == t) throw new Error("MathBackendWebGL.write(): values can not be null");this.throwIfNoData(e);var n = this.texData.get(e), + r = n.texture, + o = n.texShape, + a = n.usage;null != r && (this.releaseTexture(e, r, o, a), n.texture = null, n.texShape = null), n.usage = TextureUsage.UPLOAD, n.values = t, this.delayedStorage || this.uploadToGPU(e); + }, e.prototype.readSync = function (e) { + this.throwIfNoData(e);var t = this.texData.get(e), + n = t.shape, + r = t.texture, + o = t.values, + a = t.texShape, + i = t.dtype;if (null != o) return this.cacheOnCPU(e), o;var s, + u = null != this.activeTimers;u && (s = performance.now());var l = this.getValuesFromTexture(r, e, i, a, n);return u && (this.downloadWaitMs += performance.now() - s), this.cacheOnCPU(e, l), t.values; + }, e.prototype.read = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t, n, r, o, a, i, s, u, l, c;return __generator(this, function (p) { + switch (p.label) {case 0: + if (this.pendingRead.has(e)) return t = this.pendingRead.get(e), [2, new Promise(function (e) { + return t.push(e); + })];if (this.throwIfNoData(e), n = this.texData.get(e), r = n.shape, o = n.texture, a = n.values, i = n.texShape, s = n.dtype, null != a) return this.cacheOnCPU(e), [2, a];if (this.pendingRead.set(e, []), !ENV.get("WEBGL_DOWNLOAD_FLOAT_ENABLED") && 2 === ENV.get("WEBGL_VERSION")) throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");return u = this.gpgpu.maybeCreateBufferFromTexture(o, i[0], i[1]), [4, this.gpgpu.createAndWaitForFence()];case 1: + return p.sent(), l = u instanceof WebGLTexture ? this.getValuesFromTexture(o, e, s, i, r) : this.gpgpu.downloadFloat32MatrixFromBuffer(u, i[0], i[1]), this.cacheOnCPU(e, l), c = this.pendingRead.get(e), this.pendingRead.delete(e), c.forEach(function (e) { + return e(l); + }), this.pendingDisposal.has(e) && (this.pendingDisposal.delete(e), this.disposeData(e)), [2, l];} + }); + }); + }, e.prototype.getValuesFromTexture = function (e, t, n, r, o) { + if (ENV.get("WEBGL_DOWNLOAD_FLOAT_ENABLED")) return this.gpgpu.downloadFloat32MatrixFromOutputTexture(e, r[0], r[1]);var a = Tensor.make(o, {});this.texData.get(a.dataId).usage = TextureUsage.DOWNLOAD;var i = Tensor.make(o, { dataId: t }, n), + s = new EncodeFloatProgram(o);this.compileAndRun(s, [i], a, null, !1);var u = this.texData.get(a.dataId), + l = this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(u.texture, u.texShape[0], u.texShape[1]);return i.dispose(), a.dispose(), l; + }, e.prototype.time = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t, n, r, o, a, i;return __generator(this, function (s) { + switch (s.label) {case 0: + return t = this.activeTimers, n = [], r = !1, null == this.programTimersStack ? (this.programTimersStack = n, r = !0) : this.activeTimers.push(n), this.activeTimers = n, e(), o = flatten(this.activeTimers), this.activeTimers = t, r && (this.programTimersStack = null), [4, Promise.all(o).then(function (e) { + var t = 0;return e.forEach(function (e) { + return t += e; + }), t; + })];case 1: + return a = s.sent(), i = { uploadWaitMs: this.uploadWaitMs, downloadWaitMs: this.downloadWaitMs, kernelMs: a, wallMs: null }, this.uploadWaitMs = 0, this.downloadWaitMs = 0, [2, i];} + }); + }); + }, e.prototype.memory = function () { + return { unreliable: !1, numBytesInGPU: this.numBytesInGPU }; + }, e.prototype.startTimer = function () { + return ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 ? this.gpgpu.beginQuery() : { startMs: performance.now(), endMs: null }; + }, e.prototype.endTimer = function (e) { + return ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 ? (this.gpgpu.endQuery(), e) : (e.endMs = performance.now(), e); + }, e.prototype.getQueryTime = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t;return __generator(this, function (n) { + return ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 ? [2, this.gpgpu.waitForQueryAndGetTime(e)] : [2, (t = e).endMs - t.startMs]; + }); + }); + }, e.prototype.disposeData = function (e) { + if (!this.pendingDisposal.has(e)) if (this.pendingRead.has(e)) this.pendingDisposal.add(e);else if (this.texData.has(e)) { + var t = this.texData.get(e), + n = t.texture, + r = t.texShape, + o = t.usage;null != n && this.releaseTexture(e, n, r, o), this.texData.delete(e); + } + }, e.prototype.getTexture = function (e) { + return this.uploadToGPU(e), this.texData.get(e).texture; + }, e.prototype.getGPGPUContext = function () { + return this.gpgpu; + }, e.prototype.getCanvas = function () { + return this.canvas; + }, e.prototype.slice = function (e, t, n) { + var r = new SliceProgram(n), + o = r.getCustomSetupFunc(t);return this.compileAndRun(r, [e], null, o); + }, e.prototype.stridedSlice = function (e, t, n, r, o, a) { + var i = getStridedSlicedInfo(e.shape, t, n, r, o, a), + s = i[0], + u = i[1];if (u.some(function (e) { + return 0 === e; + })) return tensor([], u);var l = new StridedSliceProgram(s, r, u);return this.compileAndRun(l, [e]); + }, e.prototype.reverse = function (e, t) { + var n = new ReverseProgram(e.shape, t);return this.compileAndRun(n, [e]); + }, e.prototype.concat = function (e, t) { + var n = new ConcatProgram(e.shape, t.shape);return this.compileAndRun(n, [e, t]); + }, e.prototype.neg = function (e) { + var t = new UnaryOpProgram(e.shape, NEG);return this.compileAndRun(t, [e]); + }, e.prototype.matMul = function (e, t, n, r) { + var o = new MatMulProgram(e.shape, t.shape, n, r);return this.compileAndRun(o, [e, t]); + }, e.prototype.multiply = function (e, t) { + var n = new BinaryOpProgram(MUL, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, upcastType(e.dtype, t.dtype));return this.compileAndRun(n, [e, t], r); + }, e.prototype.batchNormalization = function (e, t, n, r, o, a) { + var i = [e, t, n], + s = null;null != a && (s = a.shape, i.push(a));var u = null;null != o && (u = o.shape, i.push(o));var l = new BatchNormProgram(e.shape, t.shape, n.shape, s, u, r);return this.compileAndRun(l, i); + }, e.prototype.localResponseNormalization4D = function (e, t, n, r, o) { + var a = new LRNProgram(e.shape, t, n, r, o);return this.compileAndRun(a, [e]); + }, e.prototype.LRNGrad = function (e, t, n, r, o, a, i) { + var s = new LRNGradProgram(t.shape, r, o, a, i);return this.compileAndRun(s, [t, n, e]); + }, e.prototype.tile = function (e, t) { + var n = new TileProgram(e.shape, t);return this.compileAndRun(n, [e]); + }, e.prototype.pad = function (e, t, n) { + var r = new PadProgram(e.shape, t, n);return this.compileAndRun(r, [e]); + }, e.prototype.transpose = function (e, t) { + var n = new TransposeProgram(e.shape, t);return this.compileAndRun(n, [e]); + }, e.prototype.gather = function (e, t, n) { + var r = new GatherProgram(e.shape, t.size, n);return this.compileAndRun(r, [e, t]); + }, e.prototype.batchToSpaceND = function (e, t, n) { + assert(e.rank <= 4, "batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");var r = t.reduce(function (e, t) { + return e * t; + }), + o = getReshaped(e.shape, t, r), + a = getPermuted(o.length, t.length), + i = getReshapedPermuted(e.shape, t, r), + s = getSliceBeginCoords(n, t.length), + u = getSliceSize(i, n, t.length);return e.reshape(o).transpose(a).reshape(i).slice(s, u); + }, e.prototype.spaceToBatchND = function (e, t, n) { + assert(e.rank <= 4, "spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");var r = t.reduce(function (e, t) { + return e * t; + }), + o = [[0, 0]];o.push.apply(o, n);for (var a = 1 + t.length; a < e.shape.length; ++a) o.push([0, 0]);var i = e.pad(o), + s = getReshaped(i.shape, t, r, !1), + u = getPermuted(s.length, t.length, !1), + l = getReshapedPermuted(i.shape, t, r, !1);return i.reshape(s).transpose(u).reshape(l); + }, e.prototype.reduce = function (e, t, n) { + var r = e.shape[0], + o = e.shape[1], + a = computeOptimalWindowSize(o), + i = new ReduceProgram({ windowSize: a, inSize: o, batchSize: r }, t), + s = i.outputShape, + u = s[0], + l = s[1], + c = this.makeOutputArray([u, l], n);return this.compileAndRun(i, [e], c), 1 === c.shape[1] ? c : this.reduce(c, t, n); + }, e.prototype.argReduce = function (e, t, n) { + void 0 === n && (n = null);var r = e.shape[0], + o = e.shape[1];null != n && (r = n.shape[0], o = n.shape[1]);var a = computeOptimalWindowSize(o), + i = new ArgMinMaxProgram({ windowSize: a, inSize: o, batchSize: r }, t, null == n), + s = i.outputShape, + u = s[0], + l = s[1], + c = this.makeOutputArray([u, l], "int32"), + p = [e];return null != n && p.push(n), this.compileAndRun(i, p, c), 1 === c.shape[1] ? c : this.argReduce(e, t, c); + }, e.prototype.sum = function (e, t) { + assertAxesAreInnerMostDims("sum", t, e.rank);var n = computeOutAndReduceShapes(e.shape, t), + r = n[0], + o = sizeFromShape(n[1]), + a = e.as2D(-1, o), + i = sumOutType(e.dtype);return this.reduce(a, "sum", i).reshape(r); + }, e.prototype.unsortedSegmentSum = function (e, t, n) { + var r = 0, + o = getAxesPermutation([r], e.rank), + a = e;null != o && (a = e.transpose(o), r = getInnerMostAxes(1, e.rank)[0]);var i = computeOutShape(a.shape, r, n), + s = sizeFromShape([a.shape[r]]), + u = a.as2D(-1, s), + l = sumOutType(e.dtype), + c = this.segOpCompute(u, "unsortedSegmentSum", t, l, n).reshape(i);return null != o && (c = c.transpose(getUndoAxesPermutation(o))), c; + }, e.prototype.segOpCompute = function (e, t, n, r, o) { + var a = e.shape[0], + i = e.shape[1], + s = segOpComputeOptimalWindowSize(i, o), + u = new SegmentOpProgram({ windowSize: s, inSize: i, batchSize: a, numSegments: o }, t), + l = u.outputShape, + c = l[0], + p = l[1], + d = this.makeOutputArray([c, p], r);return this.compileAndRun(u, [e, n], d), d.shape[1] === o ? d : (n = range(0, o).tile([i / s]), this.segOpCompute(d, t, n, r, o)); + }, e.prototype.argMin = function (e, t) { + var n = [t];assertAxesAreInnerMostDims("argMin", n, e.rank);var r = computeOutAndReduceShapes(e.shape, n), + o = r[0], + a = sizeFromShape(r[1]), + i = e.as2D(-1, a);return this.argReduce(i, "min").reshape(o); + }, e.prototype.argMax = function (e, t) { + var n = [t];assertAxesAreInnerMostDims("argMax", n, e.rank);var r = computeOutAndReduceShapes(e.shape, n), + o = r[0], + a = sizeFromShape(r[1]), + i = e.as2D(-1, a);return this.argReduce(i, "max").reshape(o); + }, e.prototype.cumsum = function (e, t, n, r) { + if (t !== e.rank - 1) throw new Error("WebGL cumsum shader expects an inner-most axis=" + (e.rank - 1) + " but got axis=" + t);var o = new CumSumProgram(e.shape, n, r);return this.compileAndRun(o, [e]); + }, e.prototype.equal = function (e, t) { + var n = new BinaryOpProgram(EQUAL, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "bool");return this.compileAndRun(n, [e, t], r); + }, e.prototype.notEqual = function (e, t) { + var n = new BinaryOpProgram(NOT_EQUAL, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "bool");return this.compileAndRun(n, [e, t], r); + }, e.prototype.less = function (e, t) { + var n = new BinaryOpProgram(LESS, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "bool");return this.compileAndRun(n, [e, t], r); + }, e.prototype.lessEqual = function (e, t) { + var n = new BinaryOpProgram(LESS_EQUAL, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "bool");return this.compileAndRun(n, [e, t], r); + }, e.prototype.greater = function (e, t) { + var n = new BinaryOpProgram(GREATER, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "bool");return this.compileAndRun(n, [e, t], r); + }, e.prototype.greaterEqual = function (e, t) { + var n = new BinaryOpProgram(GREATER_EQUAL, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "bool");return this.compileAndRun(n, [e, t], r); + }, e.prototype.logicalNot = function (e) { + var t = new UnaryOpProgram(e.shape, LOGICAL_NOT);return this.compileAndRun(t, [e]); + }, e.prototype.logicalAnd = function (e, t) { + var n = new BinaryOpProgram(LOGICAL_AND, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "bool");return this.compileAndRun(n, [e, t], r); + }, e.prototype.logicalOr = function (e, t) { + var n = new BinaryOpProgram(LOGICAL_OR, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "bool");return this.compileAndRun(n, [e, t], r); + }, e.prototype.select = function (e, t, n) { + var r = new SelectProgram(e.rank, t.shape, t.rank), + o = this.makeOutputArray(r.outputShape, upcastType(t.dtype, n.dtype));return this.compileAndRun(r, [e, t, n], o); + }, e.prototype.where = function (e) { + warn("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");var t = e.dataSync();return whereImpl(e.shape, t); + }, e.prototype.topk = function (e, t, n) { + return topkImpl(e.dataSync(), e.shape, e.dtype, t, n); + }, e.prototype.min = function (e, t) { + assertAxesAreInnerMostDims("min", t, e.rank);var n = computeOutAndReduceShapes(e.shape, t), + r = n[0], + o = sizeFromShape(n[1]), + a = e.as2D(-1, o);return this.reduce(a, "min", a.dtype).reshape(r); + }, e.prototype.minimum = function (e, t) { + var n = new BinaryOpProgram(MIN, e.shape, t.shape);return this.compileAndRun(n, [e, t]); + }, e.prototype.mod = function (e, t) { + var n = new BinaryOpProgram(MOD, e.shape, t.shape), + r = n.getCustomSetupFunc();return this.compileAndRun(n, [e, t], null, r); + }, e.prototype.max = function (e, t) { + assertAxesAreInnerMostDims("max", t, e.rank);var n = computeOutAndReduceShapes(e.shape, t), + r = n[0], + o = sizeFromShape(n[1]), + a = e.as2D(-1, o);return this.reduce(a, "max", a.dtype).reshape(r); + }, e.prototype.maximum = function (e, t) { + var n = new BinaryOpProgram(MAX, e.shape, t.shape);return this.compileAndRun(n, [e, t]); + }, e.prototype.all = function (e, t) { + assertAxesAreInnerMostDims("all", t, e.rank);var n = computeOutAndReduceShapes(e.shape, t), + r = n[0], + o = sizeFromShape(n[1]), + a = e.as2D(-1, o);return this.reduce(a, "all", a.dtype).reshape(r); + }, e.prototype.any = function (e, t) { + assertAxesAreInnerMostDims("any", t, e.rank);var n = computeOutAndReduceShapes(e.shape, t), + r = n[0], + o = sizeFromShape(n[1]), + a = e.as2D(-1, o);return this.reduce(a, "any", a.dtype).reshape(r); + }, e.prototype.squaredDifference = function (e, t) { + var n = new BinaryOpProgram(SQUARED_DIFFERENCE, e.shape, t.shape);return this.compileAndRun(n, [e, t]); + }, e.prototype.realDivide = function (e, t) { + var n = new BinaryOpProgram(DIV, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "float32");return this.compileAndRun(n, [e, t], r); + }, e.prototype.floorDiv = function (e, t) { + var n = new BinaryOpProgram(INT_DIV, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, "int32");return this.compileAndRun(n, [e, t], r); + }, e.prototype.add = function (e, t) { + var n = new BinaryOpProgram(ADD, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, upcastType(e.dtype, t.dtype));return this.compileAndRun(n, [e, t], r); + }, e.prototype.addN = function (e) { + for (var t = e[0], n = 1; n < e.length; n++) t = this.add(t, e[n]);return t; + }, e.prototype.subtract = function (e, t) { + var n = new BinaryOpProgram(SUB, e.shape, t.shape), + r = this.makeOutputArray(n.outputShape, upcastType(e.dtype, t.dtype));return this.compileAndRun(n, [e, t], r); + }, e.prototype.pow = function (e, t) { + var n = new BinaryOpProgram(POW, e.shape, t.shape), + r = n.getCustomSetupFunc(), + o = this.makeOutputArray(n.outputShape, upcastType(e.dtype, t.dtype));return this.compileAndRun(n, [e, t], o, r); + }, e.prototype.ceil = function (e) { + var t = new UnaryOpProgram(e.shape, CEIL);return this.compileAndRun(t, [e]); + }, e.prototype.floor = function (e) { + var t = new UnaryOpProgram(e.shape, FLOOR);return this.compileAndRun(t, [e]); + }, e.prototype.sign = function (e) { + var t = new UnaryOpProgram(e.shape, SIGN);return this.compileAndRun(t, [e]); + }, e.prototype.round = function (e) { + var t = new UnaryOpProgram(e.shape, ROUND);return this.compileAndRun(t, [e]); + }, e.prototype.exp = function (e) { + var t = new UnaryOpProgram(e.shape, EXP);return this.compileAndRun(t, [e]); + }, e.prototype.expm1 = function (e) { + var t = new UnaryOpProgram(e.shape, EXPM1);return this.compileAndRun(t, [e]); + }, e.prototype.log = function (e) { + var t = new UnaryOpProgram(e.shape, LOG), + n = t.getCustomSetupFunc();return this.compileAndRun(t, [e], null, n); + }, e.prototype.log1p = function (e) { + var t = new UnaryOpProgram(e.shape, LOG1P);return this.compileAndRun(t, [e]); + }, e.prototype.sqrt = function (e) { + var t = new UnaryOpProgram(e.shape, SQRT);return this.compileAndRun(t, [e]); + }, e.prototype.rsqrt = function (e) { + var t = new UnaryOpProgram(e.shape, RSQRT);return this.compileAndRun(t, [e]); + }, e.prototype.square = function (e) { + var t = new UnaryOpProgram(e.shape, SQUARE);return this.compileAndRun(t, [e]); + }, e.prototype.reciprocal = function (e) { + var t = new UnaryOpProgram(e.shape, RECIPROCAL);return this.compileAndRun(t, [e]); + }, e.prototype.relu = function (e) { + var t = new UnaryOpProgram(e.shape, RELU);return this.compileAndRun(t, [e]); + }, e.prototype.elu = function (e) { + var t = new UnaryOpProgram(e.shape, ELU);return this.compileAndRun(t, [e]); + }, e.prototype.eluDer = function (e, t) { + var n = new BinaryOpProgram(ELU_DER, e.shape, t.shape);return this.compileAndRun(n, [e, t]); + }, e.prototype.selu = function (e) { + var t = new UnaryOpProgram(e.shape, SELU);return this.compileAndRun(t, [e]); + }, e.prototype.int = function (e) { + var t = new UnaryOpProgram(e.shape, TO_INT), + n = this.makeOutputArray(t.outputShape, "int32");return this.compileAndRun(t, [e], n); + }, e.prototype.clip = function (e, t, n) { + var r = new ClipProgram(e.shape, t, n);return this.compileAndRun(r, [e]); + }, e.prototype.abs = function (e) { + var t = new UnaryOpProgram(e.shape, ABS);return this.compileAndRun(t, [e]); + }, e.prototype.sigmoid = function (e) { + var t = new UnaryOpProgram(e.shape, SIGMOID);return this.compileAndRun(t, [e]); + }, e.prototype.softplus = function (e) { + var t = new UnaryOpProgram(e.shape, SOFTPLUS);return this.compileAndRun(t, [e]); + }, e.prototype.sin = function (e) { + var t = new UnaryOpProgram(e.shape, SIN);return this.compileAndRun(t, [e]); + }, e.prototype.cos = function (e) { + var t = new UnaryOpProgram(e.shape, COS);return this.compileAndRun(t, [e]); + }, e.prototype.tan = function (e) { + var t = new UnaryOpProgram(e.shape, TAN);return this.compileAndRun(t, [e]); + }, e.prototype.asin = function (e) { + var t = new UnaryOpProgram(e.shape, ASIN);return this.compileAndRun(t, [e]); + }, e.prototype.acos = function (e) { + var t = new UnaryOpProgram(e.shape, ACOS);return this.compileAndRun(t, [e]); + }, e.prototype.atan = function (e) { + var t = new UnaryOpProgram(e.shape, ATAN);return this.compileAndRun(t, [e]); + }, e.prototype.atan2 = function (e, t) { + var n = new BinaryOpProgram(ATAN2, e.shape, t.shape);return this.compileAndRun(n, [e, t]); + }, e.prototype.sinh = function (e) { + var t = new UnaryOpProgram(e.shape, SINH);return this.compileAndRun(t, [e]); + }, e.prototype.cosh = function (e) { + var t = new UnaryOpProgram(e.shape, COSH);return this.compileAndRun(t, [e]); + }, e.prototype.tanh = function (e) { + var t = new UnaryOpProgram(e.shape, TANH);return this.compileAndRun(t, [e]); + }, e.prototype.asinh = function (e) { + var t = new UnaryOpProgram(e.shape, ASINH);return this.compileAndRun(t, [e]); + }, e.prototype.acosh = function (e) { + var t = new UnaryOpProgram(e.shape, ACOSH), + n = t.getCustomSetupFunc();return this.compileAndRun(t, [e], null, n); + }, e.prototype.atanh = function (e) { + var t = new UnaryOpProgram(e.shape, ATANH), + n = t.getCustomSetupFunc();return this.compileAndRun(t, [e], null, n); + }, e.prototype.erf = function (e) { + var t = new UnaryOpProgram(e.shape, ERF);return this.compileAndRun(t, [e]); + }, e.prototype.step = function (e, t) { + var n = new UnaryOpProgram(e.shape, STEP(t));return this.compileAndRun(n, [e]); + }, e.prototype.conv2d = function (e, t, n) { + var r = new Conv2DProgram(n);return this.compileAndRun(r, [e, t]); + }, e.prototype.conv2dDerInput = function (e, t, n) { + var r = new Conv2DDerInputProgram(n);return this.compileAndRun(r, [e, t]); + }, e.prototype.conv2dDerFilter = function (e, t, n) { + var r = new Conv2DDerFilterProgram(n);return this.compileAndRun(r, [e, t]); + }, e.prototype.depthwiseConv2D = function (e, t, n) { + var r = new DepthwiseConv2DProgram(n);return this.compileAndRun(r, [e, t]); + }, e.prototype.depthwiseConv2DDerInput = function (e, t, n) { + var r = new DepthwiseConv2DDerInputProgram(n);return this.compileAndRun(r, [e, t]); + }, e.prototype.depthwiseConv2DDerFilter = function (e, t, n) { + var r = new DepthwiseConv2DDerFilterProgram(n);return this.compileAndRun(r, [e, t]); + }, e.prototype.maxPool = function (e, t) { + var n = new Pool2DProgram(t, "max", !1), + r = this.makeOutputArray(n.outputShape, e.dtype);return this.compileAndRun(n, [e], r); + }, e.prototype.avgPool = function (e, t) { + var n = new Pool2DProgram(t, "avg", !1), + r = this.makeOutputArray(n.outputShape, "float32");return this.compileAndRun(n, [e], r); + }, e.prototype.maxPoolBackprop = function (e, t, n, r) { + var o = new Pool2DProgram(r, "max", !0), + a = this.compileAndRun(o, [t]), + i = new MaxPool2DBackpropProgram(r), + s = this.makeOutputArray(i.outputShape, t.dtype), + u = this.compileAndRun(i, [e, a], s);return a.dispose(), u; + }, e.prototype.avgPoolBackprop = function (e, t, n) { + var r = new AvgPool2DBackpropProgram(n), + o = this.makeOutputArray(r.outputShape, t.dtype);return this.compileAndRun(r, [e], o); + }, e.prototype.cast = function (e, t) { + return castTensor(e, t, this); + }, e.prototype.reshape = function (e, t) { + return reshapeTensor(e, t); + }, e.prototype.resizeBilinear = function (e, t, n, r) { + var o = new ResizeBilinearProgram(e.shape, t, n, r);return this.compileAndRun(o, [e]); + }, e.prototype.resizeBilinearBackprop = function (e, t, n) { + var r = new ResizeBilinearBackpropProgram(e, t, n);return this.compileAndRun(r, [e]); + }, e.prototype.resizeNearestNeighbor = function (e, t, n, r) { + var o = new ResizeNearestNeighborProgram(e.shape, t, n, r);return this.compileAndRun(o, [e]); + }, e.prototype.resizeNearestNeighborBackprop = function (e, t, n) { + var r = new ResizeNearestNeigborBackpropProgram(e, t, n);return this.compileAndRun(r, [e]); + }, e.prototype.multinomial = function (e, t, n, r) { + var o = t ? e : softmax(e), + a = o.shape[0], + i = o.shape[1], + s = new MultinomialProgram(a, i, n), + u = this.makeOutputArray(s.outputShape, "int32"), + l = s.getCustomSetupFunc(r);return this.compileAndRun(s, [o], u, l); + }, e.prototype.oneHot = function (e, t, n, r) { + var o = new OneHotProgram(e.size, t, n, r);return this.compileAndRun(o, [e]); + }, e.prototype.nonMaxSuppression = function (e, t, n, r, o) { + return warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"), nonMaxSuppressionImpl(e.dataSync(), t.dataSync(), n, r, o); + }, e.prototype.makeOutputArray = function (e, t) { + return Tensor.make(e, {}, t); + }, e.prototype.compileAndRun = function (e, t, n, r, o) { + var a = this;void 0 === o && (o = !0), null == n && (n = this.makeOutputArray(e.outputShape, t[0].dtype));var i = t.map(function (e) { + var t = a.texData.get(e.dataId);return null == t.texture && e.size <= SIZE_UPLOAD_UNIFORM ? { tensor: e, texData: null, isUniform: !0 } : (a.uploadToGPU(e.dataId), { tensor: e, texData: t, isUniform: !1 }); + });this.uploadToGPU(n.dataId);var s, + u = { tensor: n, texData: this.texData.get(n.dataId), isUniform: !1 }, + l = makeShaderKey(e, i, u), + c = this.getAndSaveBinary(l, function () { + return compileProgram(a.gpgpu, e, i, u); + }), + p = null != this.activeTimers;if (p && (s = this.startTimer()), runProgram(c, i, u, r), o && this.numBytesInGPU > this.NUM_BYTES_BEFORE_PAGING) for (var d = this.numBytesInGPU - this.NUM_BYTES_BEFORE_PAGING; d > 0 && this.lruDataGPU.length > 0;) { + var h = this.lruDataGPU.shift(), + f = this.texData.get(h), + m = f.shape, + g = f.dtype;d -= this.computeBytes(m, g), this.read(h); + }return p && (s = this.endTimer(s), this.activeTimers.push(this.getQueryTime(s))), n; + }, e.prototype.getAndSaveBinary = function (e, t) { + return e in this.binaryCache || (this.binaryCache[e] = t()), this.binaryCache[e]; + }, e.prototype.getTextureManager = function () { + return this.textureManager; + }, e.prototype.dispose = function () { + if (!this.disposed) { + for (var e in this.binaryCache) this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram);this.textureManager.dispose(), this.canvas.remove(), null != this.fromPixelsCanvas && this.fromPixelsCanvas.remove(), this.gpgpuCreatedLocally && this.gpgpu.dispose(), this.disposed = !0; + } + }, e.prototype.throwIfNoData = function (e) { + if (!this.texData.has(e)) throw new Error("WebGL backend: No data found for this tensor. Did you change your backend in the middle of the program? New backends can't use Tensors created with previous backends"); + }, e.prototype.uploadToGPU = function (e) { + this.throwIfNoData(e);var t = this.texData.get(e), + n = t.shape, + r = t.values, + o = t.texture, + a = t.dtype, + i = t.usage;if (null == o) { + var s, + u = null != this.activeTimers;u && (s = performance.now());var l = getTextureShapeFromLogicalShape(this.gpgpu.gl, n);t.texShape = l;var c = this.acquireTexture(e, l, i);t.texture = c, null != r && (this.gpgpu.uploadMatrixToTexture(c, l[0], l[1], typedArrayToFloat32(r, a)), t.values = null, u && (this.uploadWaitMs += performance.now() - s)); + } else { + this.lruDataGPU.indexOf(e) >= 0 && (this.lruDataGPU.splice(this.lruDataGPU.indexOf(e), 1), this.lruDataGPU.push(e)); + } + }, e.prototype.cacheOnCPU = function (e, t) { + var n = this.delayedStorage, + r = this.texData.get(e), + o = r.texture, + a = r.texShape, + i = r.dtype, + s = r.usage;n && null != o && (this.releaseTexture(e, o, a, s), r.texture = null, r.texShape = null), null != t && (r.values = float32ToTypedArray(t, i)); + }, e.prototype.releaseTexture = function (e, t, n, r) { + var o = this.texData.get(e), + a = o.shape, + i = o.dtype, + s = this.lruDataGPU.indexOf(e);s >= 0 && this.lruDataGPU.splice(s, 1), this.numBytesInGPU -= this.computeBytes(a, i), this.textureManager.releaseTexture(t, n, r); + }, e.prototype.acquireTexture = function (e, t, n) { + var r = this.texData.get(e), + o = r.shape, + a = r.dtype;return this.lruDataGPU.push(e), this.numBytesInGPU += this.computeBytes(o, a), this.textureManager.acquireTexture(t, n); + }, e.prototype.computeBytes = function (e, t) { + return sizeFromShape(e) * bytesPerElement(t); + }, e; + }();function float32ToTypedArray(e, t) { + if ("float32" === t) return e;if ("int32" === t || "bool" === t) { + for (var n = "int32" === t ? new Int32Array(e.length) : new Uint8Array(e.length), r = 0; r < n.length; ++r) n[r] = Math.round(e[r]);return n; + }throw new Error("Unknown dtype " + t); + }function typedArrayToFloat32(e, t) { + return e instanceof Float32Array ? e : new Float32Array(e); + }function neg_(e) { + var t = convertToTensor(e, "x", "neg");return ENV.engine.runKernel(function (e) { + return e.neg(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.neg(); + } }; + }); + }function ceil_(e) { + var t = convertToTensor(e, "x", "ceil");return ENV.engine.runKernel(function (e) { + return e.ceil(t); + }, { $x: t }, function (e) { + return { $x: function () { + return zerosLike(e); + } }; + }); + }function floor_(e) { + var t = convertToTensor(e, "x", "floor");return ENV.engine.runKernel(function (e) { + return e.floor(t); + }, { $x: t }, function (e) { + return { $x: function () { + return zerosLike(e); + } }; + }); + }function sign_(e) { + var t = convertToTensor(e, "x", "sign");return ENV.engine.runKernel(function (e) { + return e.sign(t); + }, { $x: t }, function (e) { + return { $x: function () { + return zerosLike(e); + } }; + }); + }function round_(e) { + var t = convertToTensor(e, "x", "round");return ENV.engine.runKernel(function (e) { + return e.round(t); + }, { $x: t }, function (e) { + return { $x: function () { + return zerosLike(e); + } }; + }); + }function exp_(e) { + var t = convertToTensor(e, "x", "exp");return ENV.engine.runKernel(function (e, n) { + return n(e.exp(t)); + }, { $x: t }, function (e, t) { + var n = t[0];return { $x: function () { + return e.mulStrict(n); + } }; + }); + }function expm1_(e) { + var t = convertToTensor(e, "x", "expm1");return ENV.engine.runKernel(function (e) { + return e.expm1(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.mulStrict(t.exp()); + } }; + }); + }function log_(e) { + var t = convertToTensor(e, "x", "log");return ENV.engine.runKernel(function (e) { + return e.log(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(t.toFloat()); + } }; + }); + }function log1p_(e) { + var t = convertToTensor(e, "x", "log1p");return ENV.engine.runKernel(function (e) { + return e.log1p(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(t.add(scalar(1))); + } }; + }); + }function sqrt_(e) { + var t = convertToTensor(e, "x", "sqrt");return ENV.engine.runKernel(function (e) { + return e.sqrt(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(t.toFloat().sqrt().mul(scalar(2))); + } }; + }); + }function rsqrt_(e) { + var t = convertToTensor(e, "x", "rsqrt");return ENV.engine.runKernel(function (e) { + return e.rsqrt(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(t.pow(scalar(1.5)).mul(scalar(2))).neg(); + } }; + }); + }function square_(e) { + var t = convertToTensor(e, "x", "square");return ENV.engine.runKernel(function (e) { + return e.square(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.mulStrict(t.toFloat().mul(scalar(2))); + } }; + }); + }function reciprocal_(e) { + var t = convertToTensor(e, "x", "reciprocal");return ENV.engine.runKernel(function (e) { + return e.reciprocal(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(t.square().neg()); + } }; + }); + }function abs_(e) { + var t = convertToTensor(e, "x", "abs");return ENV.engine.runKernel(function (e) { + return e.abs(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.mulStrict(t.toFloat().step(-1)); + } }; + }); + }function clipByValue_(e, t, n) { + var r = convertToTensor(e, "x", "clipByValue");assert(t <= n, "Error in clip: min (" + t + ") must be less than or equal to max (" + n + ").");return ENV.engine.runKernel(function (e) { + return e.clip(r, t, n); + }, { $x: r }, function (e) { + return { $x: function () { + return e.where(r.greaterEqual(scalar(t)).logicalAnd(r.lessEqual(scalar(n))), zerosLike(e)); + } }; + }); + }function sigmoid_(e) { + var t = convertToTensor(e, "x", "sigmoid");return ENV.engine.runKernel(function (e, n) { + return n(e.sigmoid(t)); + }, { $x: t }, function (e, t) { + var n = t[0];return { $x: function () { + return e.mulStrict(n.mul(scalar(1).sub(n))); + } }; + }); + }function logSigmoid_(e) { + var t = convertToTensor(e, "x", "logSigmoid");return ENV.engine.runKernel(function (e) { + return e.softplus(t.neg()).neg(); + }, { $x: t }, function (e) { + return { $x: function () { + return e.mulStrict(t.neg().sigmoid()); + } }; + }); + }function softplus_(e) { + var t = convertToTensor(e, "x", "softplus");return ENV.engine.runKernel(function (e) { + return e.softplus(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.mulStrict(t.sigmoid()); + } }; + }); + }function sin_(e) { + var t = convertToTensor(e, "x", "sin");return ENV.engine.runKernel(function (e) { + return e.sin(t); + }, { $x: t }, function (e) { + return { $x: function () { + return t.toFloat().cos().mulStrict(e); + } }; + }); + }function cos_(e) { + var t = convertToTensor(e, "x", "cos");return ENV.engine.runKernel(function (e) { + return e.cos(t); + }, { $x: t }, function (e) { + return { $x: function () { + return t.toFloat().sin().neg().mulStrict(e); + } }; + }); + }function tan_(e) { + var t = convertToTensor(e, "x", "tan");return ENV.engine.runKernel(function (e) { + return e.tan(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(t.cos().square()); + } }; + }); + }function asin_(e) { + var t = convertToTensor(e, "x", "asin");return ENV.engine.runKernel(function (e) { + return e.asin(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(scalar(1).sub(t.toFloat().square()).sqrt()); + } }; + }); + }function acos_(e) { + var t = convertToTensor(e, "x", "acos");return ENV.engine.runKernel(function (e) { + return e.acos(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(scalar(1).sub(t.toFloat().square()).sqrt()).neg(); + } }; + }); + }function atan_(e) { + var t = convertToTensor(e, "x", "atan");return ENV.engine.runKernel(function (e) { + return e.atan(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(scalar(1).add(t.toFloat().square())); + } }; + }); + }function sinh_(e) { + var t = convertToTensor(e, "x", "sinh");return ENV.engine.runKernel(function (e) { + return e.sinh(t); + }, { $x: t }, function (e) { + return { $x: function () { + return t.toFloat().cosh().mulStrict(e); + } }; + }); + }function cosh_(e) { + var t = convertToTensor(e, "x", "cosh");return ENV.engine.runKernel(function (e) { + return e.cosh(t); + }, { $x: t }, function (e) { + return { $x: function () { + return t.toFloat().sinh().mulStrict(e); + } }; + }); + }function tanh_(e) { + var t = convertToTensor(e, "x", "tanh");return ENV.engine.runKernel(function (e, n) { + return n(e.tanh(t)); + }, { $x: t }, function (e, t) { + var n = t[0];return { $x: function () { + return scalar(1).sub(n.square()).mulStrict(e); + } }; + }); + }function asinh_(e) { + var t = convertToTensor(e, "x", "asinh");return ENV.engine.runKernel(function (e) { + return e.asinh(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(scalar(1).add(t.toFloat().square()).sqrt()); + } }; + }); + }function acosh_(e) { + var t = convertToTensor(e, "x", "acosh");return ENV.engine.runKernel(function (e) { + return e.acosh(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(t.toFloat().square().sub(scalar(1)).sqrt()); + } }; + }); + }function atanh_(e) { + var t = convertToTensor(e, "x", "atanh");return ENV.engine.runKernel(function (e) { + return e.atanh(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.divStrict(scalar(1).sub(t.toFloat().square())); + } }; + }); + }function erf_(e) { + var t = convertToTensor(e, "x", "erf");assert("int32" === t.dtype || "float32" === t.dtype, "Input dtype must be `int32` or `float32`."), "int32" === t.dtype && (t = t.toFloat());return ENV.engine.runKernel(function (e) { + return e.erf(t); + }, { $x: t }, function (e) { + return { $x: function () { + return e.mulStrict(scalar(2 / Math.sqrt(Math.PI)).mul(t.square().neg().exp())); + } }; + }); + }function step_(e, t) { + void 0 === t && (t = 0);var n = convertToTensor(e, "x", "step");return ENV.engine.runKernel(function (e) { + return e.step(n, t); + }, { $x: n }, function (e) { + return { $x: function () { + return zerosLike(e); + } }; + }); + }ENV.get("IS_BROWSER") && ENV.registerBackend("webgl", function () { + return new MathBackendWebGL(); + }, 2, setTensorTracker);var abs = op({ abs_: abs_ }), + acos = op({ acos_: acos_ }), + acosh = op({ acosh_: acosh_ }), + asin = op({ asin_: asin_ }), + asinh = op({ asinh_: asinh_ }), + atan = op({ atan_: atan_ }), + atanh = op({ atanh_: atanh_ }), + ceil = op({ ceil_: ceil_ }), + clipByValue = op({ clipByValue_: clipByValue_ }), + cos = op({ cos_: cos_ }), + cosh = op({ cosh_: cosh_ }), + erf = op({ erf_: erf_ }), + exp = op({ exp_: exp_ }), + expm1 = op({ expm1_: expm1_ }), + floor = op({ floor_: floor_ }), + log$1 = op({ log_: log_ }), + log1p = op({ log1p_: log1p_ }), + logSigmoid = op({ logSigmoid_: logSigmoid_ }), + neg = op({ neg_: neg_ }), + reciprocal = op({ reciprocal_: reciprocal_ }), + round = op({ round_: round_ }), + rsqrt = op({ rsqrt_: rsqrt_ }), + sigmoid = op({ sigmoid_: sigmoid_ }), + sign = op({ sign_: sign_ }), + sin = op({ sin_: sin_ }), + sinh = op({ sinh_: sinh_ }), + softplus = op({ softplus_: softplus_ }), + sqrt = op({ sqrt_: sqrt_ }), + square = op({ square_: square_ }), + step = op({ step_: step_ }), + tan = op({ tan_: tan_ }), + tanh$1 = op({ tanh_: tanh_ });function batchNormalization2d_(e, t, n, r, o, a) { + void 0 === r && (r = .001);var i, + s, + u = convertToTensor(e, "x", "batchNormalization"), + l = convertToTensor(t, "mean", "batchNormalization"), + c = convertToTensor(n, "variance", "batchNormalization");return null != o && (i = convertToTensor(o, "scale", "batchNormalization")), null != a && (s = convertToTensor(a, "offset", "batchNormalization")), assert(2 === u.rank, "Error in batchNormalization3D: x must be rank 3 but got rank " + u.rank + "."), assert(2 === l.rank || 1 === l.rank, "Error in batchNormalization2D: mean must be rank 2 or rank 1 but got rank " + l.rank + "."), assert(2 === c.rank || 1 === c.rank, "Error in batchNormalization2D: variance must be rank 2 or rank 1 but got rank " + c.rank + "."), null != i && assert(2 === i.rank || 1 === i.rank, "Error in batchNormalization2D: scale must be rank 2 or rank 1 but got rank " + i.rank + "."), null != s && assert(2 === s.rank || 1 === s.rank, "Error in batchNormalization2D: offset must be rank 2 or rank 1 but got rank " + s.rank + "."), batchNormalization(u, l, c, r, i, s); + }function batchNormalization3d_(e, t, n, r, o, a) { + void 0 === r && (r = .001);var i, + s, + u = convertToTensor(e, "x", "batchNormalization"), + l = convertToTensor(t, "mean", "batchNormalization"), + c = convertToTensor(n, "variance", "batchNormalization");return null != o && (i = convertToTensor(o, "scale", "batchNormalization")), null != a && (s = convertToTensor(a, "offset", "batchNormalization")), assert(3 === u.rank, "Error in batchNormalization3D: x must be rank 3 but got rank " + u.rank + "."), assert(3 === l.rank || 1 === l.rank, "Error in batchNormalization3D: mean must be rank 3 or rank 1 but got rank " + l.rank + "."), assert(3 === c.rank || 1 === c.rank, "Error in batchNormalization3D: variance must be rank 3 or rank 1 but got rank " + c.rank + "."), null != i && assert(3 === i.rank || 1 === i.rank, "Error in batchNormalization3D: scale must be rank 3 or rank 1 but got rank " + i.rank + "."), null != s && assert(3 === s.rank || 1 === s.rank, "Error in batchNormalization3D: offset must be rank 3 or rank 1 but got rank " + s.rank + "."), batchNormalization(u, l, c, r, i, s); + }function batchNormalization4d_(e, t, n, r, o, a) { + void 0 === r && (r = .001);var i, + s, + u = convertToTensor(e, "x", "batchNormalization"), + l = convertToTensor(t, "mean", "batchNormalization"), + c = convertToTensor(n, "variance", "batchNormalization");return null != o && (i = convertToTensor(o, "scale", "batchNormalization")), null != a && (s = convertToTensor(a, "offset", "batchNormalization")), assert(4 === u.rank, "Error in batchNormalization4D: x must be rank 4 but got rank " + u.rank + "."), assert(4 === l.rank || 1 === l.rank, "Error in batchNormalization4D: mean must be rank 4 or rank 1 but got rank " + l.rank + "."), assert(4 === c.rank || 1 === c.rank, "Error in batchNormalization4D: variance must be rank 4 or rank 1 but got rank " + c.rank + "."), null != i && assert(4 === i.rank || 1 === i.rank, "Error in batchNormalization4D: scale must be rank 4 or rank 1 but got rank " + i.rank + "."), null != s && assert(4 === s.rank || 1 === s.rank, "Error in batchNormalization4D: offset must be rank 4 or rank 1 but got rank " + s.rank + "."), batchNormalization(u, l, c, r, i, s); + }function batchNormalization_(e, t, n, r, o, a) { + void 0 === r && (r = .001);var i, + s, + u, + l = convertToTensor(e, "x", "batchNormalization"), + c = convertToTensor(t, "mean", "batchNormalization"), + p = convertToTensor(n, "variance", "batchNormalization");null != o && (i = convertToTensor(o, "scale", "batchNormalization")), null != a && (s = convertToTensor(a, "offset", "batchNormalization")), assert(c.rank === p.rank, "Batch normalization gradient requires mean and variance to have equal ranks."), assert(null == s || c.rank === s.rank, "Batch normalization gradient requires mean and offset to have equal ranks."), assert(null == i || c.rank === i.rank, "Batch normalization gradient requires mean and scale to have equal ranks."), u = 0 === l.rank || 1 === l.rank ? l.as4D(1, 1, 1, l.size) : 2 === l.rank ? l.as4D(1, 1, l.shape[0], l.shape[1]) : 3 === l.rank ? l.as4D(1, l.shape[0], l.shape[1], l.shape[2]) : l;return ENV.engine.runKernel(function (e) { + return e.batchNormalization(u, batchnormReshape4D(c), batchnormReshape4D(p), r, batchnormReshape4D(i), batchnormReshape4D(s)); + }, { $x: l, $mean: c, $variance: p, $scale: i, $offset: s }, function (e) { + var t = null == i ? scalar(1) : i, + n = getReductionAxes(c.shape, u.shape), + o = [];if (1 === c.rank) { + for (var a = 0; a < u.shape.length - 1; ++a) o.push(u.shape[a]);o.push(1); + }var s = l.sub(c), + d = e.mul(t), + h = rsqrt(p.add(scalar(r))), + f = h.mul(h).mul(h).mul(scalar(-.5));return { $x: function () { + return 1 === c.rank ? e.mul(tile(h.as4D(1, 1, 1, c.shape[0]), o)).mul(t).reshape(l.shape) : e.mul(h).mul(t).reshape(l.shape); + }, $mean: function () { + var e = h.mul(scalar(-1)).mul(d);return 1 === c.rank && (e = e.sum(n)), e.reshape(c.shape); + }, $variance: function () { + var e = f.mul(s).mul(d);return 1 === c.rank && (e = e.sum(n)), e.reshape(c.shape); + }, $scale: function () { + var t = s.mul(h), + r = e.mul(t);return 1 === c.rank && (r = r.sum(n)), r.reshape(c.shape); + }, $offset: function () { + var t = e;return 1 === c.rank && (t = t.sum(n)), t.reshape(c.shape); + } }; + }).reshape(l.shape); + }function batchnormReshape4D(e) { + return null == e ? null : 0 === e.rank ? e.as1D() : 1 === e.rank ? e : 2 === e.rank ? e.as4D(1, 1, e.shape[0], e.shape[1]) : 3 === e.rank ? e.as4D(1, e.shape[0], e.shape[1], e.shape[2]) : e; + }var batchNormalization2d = op({ batchNormalization2d_: batchNormalization2d_ }), + batchNormalization3d = op({ batchNormalization3d_: batchNormalization3d_ }), + batchNormalization4d = op({ batchNormalization4d_: batchNormalization4d_ }), + batchNormalization = op({ batchNormalization_: batchNormalization_ });function computePool2DInfo(e, t, n, r, o, a) { + void 0 === a && (a = "channelsLast");var i, + s = parseTupleParam(t), + u = s[0], + l = s[1];if ("channelsLast" === a) i = [u, l, e[3], e[3]];else { + if ("channelsFirst" !== a) throw new Error("Unknown dataFormat " + a);i = [u, l, e[1], e[1]]; + }return computeConv2DInfo(e, i, n, 1, r, o, !1, a); + }function computeConv2DInfo(e, t, n, r, o, a, i, s) { + void 0 === i && (i = !1), void 0 === s && (s = "channelsLast");var u = [-1, -1, -1, -1], + l = u[0], + c = u[1], + p = u[2], + d = u[3];if ("channelsLast" === s) l = e[0], c = e[1], p = e[2], d = e[3];else { + if ("channelsFirst" !== s) throw new Error("Unknown dataFormat " + s);l = e[0], d = e[1], c = e[2], p = e[3]; + }var h, + f = t[0], + m = t[1], + g = t[3], + v = parseTupleParam(n), + y = v[0], + x = v[1], + T = parseTupleParam(r), + S = T[0], + b = T[1], + E = getPadAndOutInfo(o, c, p, y, x, getEffectiveFilterSize(f, S), getEffectiveFilterSize(m, b), a), + w = E.padInfo, + _ = E.outHeight, + A = E.outWidth, + R = i ? g * d : g;return "channelsFirst" === s ? h = [l, R, _, A] : "channelsLast" === s && (h = [l, _, A, R]), { batchSize: l, dataFormat: s, inHeight: c, inWidth: p, inChannels: d, outHeight: _, outWidth: A, outChannels: R, padInfo: w, strideHeight: y, strideWidth: x, filterHeight: f, filterWidth: m, dilationHeight: S, dilationWidth: b, inShape: e, outShape: h, filterShape: t }; + }function computeOutputShape3D(e, t, n, r, o, a) { + null == o && (o = computeDefaultPad(e, t, r));var i = e[0], + s = e[1], + u = conditionalRound((i - t + 2 * o) / r + 1, a);assert(isInt(u), "The output # of rows (" + u + ") must be an integer. Change the stride and/or zero pad parameters");var l = conditionalRound((s - t + 2 * o) / r + 1, a);return assert(isInt(l), "The output # of columns (" + l + ") must be an integer. Change the stride and/or zero pad parameters"), [u, l, n]; + }function computeDefaultPad(e, t, n, r) { + void 0 === r && (r = 1);var o = getEffectiveFilterSize(t, r);return Math.floor((e[0] * (n - 1) - n + o) / 2); + }function parseTupleParam(e) { + return "number" == typeof e ? [e, e] : e; + }function getEffectiveFilterSize(e, t) { + return t <= 1 ? e : e + (e - 1) * (t - 1); + }function getPadAndOutInfo(e, t, n, r, o, a, i, s) { + var u, l, c;if ("number" == typeof e) { + u = { top: e, bottom: e, left: e, right: e, type: 0 === e ? "VALID" : "NUMBER" };var p = computeOutputShape3D([t, n, 1], a, 1, r, e, s);l = p[0], c = p[1]; + } else if ("same" === e) { + var d = ((l = Math.ceil(t / r)) - 1) * r + a - t, + h = ((c = Math.ceil(n / o)) - 1) * o + i - n, + f = Math.floor(d / 2), + m = d - f, + g = Math.floor(h / 2);u = { top: f, bottom: m, left: g, right: h - g, type: "SAME" }; + } else { + if ("valid" !== e) throw Error("Unknown padding parameter: " + e);u = { top: 0, bottom: 0, left: 0, right: 0, type: "VALID" }, l = Math.ceil((t - a + 1) / r), c = Math.ceil((n - i + 1) / o); + }return { padInfo: u, outHeight: l, outWidth: c }; + }function conditionalRound(e, t) { + if (!t) return e;switch (t) {case "round": + return Math.round(e);case "ceil": + return Math.ceil(e);case "floor": + return Math.floor(e);default: + throw new Error("Unknown roundingMode " + t);} + }function conv1d_(e, t, n, r, o, a, i) { + void 0 === o && (o = "NWC"), void 0 === a && (a = 1);var s = convertToTensor(e, "x", "conv1d"), + u = convertToTensor(t, "filter", "conv1d"), + l = s, + c = !1;2 === s.rank && (c = !0, l = s.as3D(1, s.shape[0], s.shape[1])), assert(3 === l.rank, "Error in conv1d: input must be rank 3, but got rank " + l.rank + "."), assert(3 === u.rank, "Error in conv1d: filter must be rank 3, but got rank " + u.rank + "."), null != i && assert(isInt(r), "Error in conv1d: pad must be an integer when using, dimRoundingMode " + i + " but got pad " + r + "."), assert(l.shape[2] === u.shape[1], "Error in conv1d: depth of input (" + l.shape[2] + ") must match input depth for filter " + u.shape[1] + "."), assert(eitherStridesOrDilationsAreOne(n, a), "Error in conv1D: Either stride or dilation must be 1. Got stride " + n + " and dilation '" + a + "'"), assert("NWC" === o, "Error in conv1d: got dataFormat of " + o + " but only NWC is currently supported.");var p = u.as4D(1, u.shape[0], u.shape[1], u.shape[2]), + d = l.as4D(l.shape[0], 1, l.shape[1], l.shape[2]), + h = conv2d(d, p, [1, n], r, "NHWC", [1, a], i);return c ? h.as2D(h.shape[2], h.shape[3]) : h.as3D(h.shape[0], h.shape[2], h.shape[3]); + }function conv2d_(e, t, n, r, o, a, i) { + void 0 === o && (o = "NHWC"), void 0 === a && (a = [1, 1]);var s = convertToTensor(e, "x", "conv2d"), + u = convertToTensor(t, "filter", "conv2d"), + l = s, + c = !1;3 === s.rank && (c = !0, l = s.as4D(1, s.shape[0], s.shape[1], s.shape[2])), assert(4 === l.rank, "Error in conv2d: input must be rank 4, but got rank " + l.rank + "."), assert(4 === u.rank, "Error in conv2d: filter must be rank 4, but got rank " + u.rank + "."), null != i && assert(isInt(r), "Error in conv2d: pad must be an integer when using, dimRoundingMode " + i + " but got pad " + r + "."), assert(l.shape[3] === u.shape[2], "Error in conv2d: depth of input (" + l.shape[3] + ") must match input depth for filter " + u.shape[2] + "."), assert(eitherStridesOrDilationsAreOne(n, a), "Error in conv2D: Either strides or dilations must be 1. Got strides " + n + " and dilations '" + a + "'"), assert("NHWC" === o, "Error in conv2d: got dataFormat of " + o + " but only NHWC is currently supported.");var p = computeConv2DInfo(l.shape, u.shape, n, a, r, i), + d = ENV.engine.runKernel(function (e) { + return e.conv2d(l, u, p); + }, { x: l, $filter: u }, function (e) { + return assert(tupleValuesAreOne(a), "Error in gradient of conv2D: dilation rates greater than 1 are notyet supported in gradients. Got dilations '" + a + "'"), { x: function () { + return conv2dDerInput_(l.shape, e, u, n, r); + }, $filter: function () { + return conv2dDerFilter_(l, e, u.shape, n, r); + } }; + });return c ? d.as3D(d.shape[1], d.shape[2], d.shape[3]) : d; + }function conv2dDerInput_(e, t, n, r, o, a) { + assert(e.length === t.rank, "Length of inShape (" + e.length + ") and rank of dy (" + t.rank + ") must match");var i = e, + s = t, + u = !1;3 === t.rank && (u = !0, s = t.as4D(1, t.shape[0], t.shape[1], t.shape[2]), i = [1, e[0], e[1], e[2]]);var l = i[3], + c = s.shape[3];assert(4 === i.length, "Error in conv2dDerInput: inShape must be length 4, but got length " + i.length + "."), assert(4 === s.rank, "Error in conv2dDerInput: dy must be rank 4, but got rank " + s.rank), assert(4 === n.rank, "Error in conv2dDerInput: filter must be rank 4, but got rank " + n.rank), assert(l === n.shape[2], "Error in conv2dDerInput: depth of input (" + l + ") must match input depth for filter " + n.shape[2] + "."), assert(c === n.shape[3], "Error in conv2dDerInput: depth of output (" + c + ") must match output depth for filter " + n.shape[3] + "."), null != a && assert(isInt(o), "Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode " + a + " but got pad " + o + ".");var p = computeConv2DInfo(i, n.shape, r, 1, o, a), + d = ENV.engine.runKernel(function (e) { + return e.conv2dDerInput(s, n, p); + }, { dy4D: s });return u ? d.as3D(d.shape[1], d.shape[2], d.shape[3]) : d; + }function conv2dDerFilter_(e, t, n, r, o, a) { + var i = e;3 === e.rank && (i = e.as4D(1, e.shape[0], e.shape[1], e.shape[2]));var s = t;3 === s.rank && (s = t.as4D(1, t.shape[0], t.shape[1], t.shape[2])), assert(4 === i.rank, "Error in conv2dDerFilter: input must be rank 4, but got shape " + i.shape + "."), assert(4 === s.rank, "Error in conv2dDerFilter: dy must be rank 4, but got shape " + s.shape + "."), assert(4 === n.length, "Error in conv2dDerFilter: filterShape must be length 4, but got " + n + "."), assert(i.shape[3] === n[2], "Error in conv2dDerFilter: depth of input " + i.shape[3] + ") must match input depth in filter (" + n[2] + "."), assert(s.shape[3] === n[3], "Error in conv2dDerFilter: depth of dy (" + s.shape[3] + ") must match output depth for filter (" + n[3] + ")."), null != a && assert(isInt(o), "Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode " + a + " but got pad " + o + ".");var u = computeConv2DInfo(i.shape, n, r, 1, o, a);return ENV.engine.runKernel(function (e) { + return e.conv2dDerFilter(i, s, u); + }, { x4D: i, dy4D: s }); + }function conv2dTranspose_(e, t, n, r, o, a) { + return conv2dDerInput_(n, convertToTensor(e, "x", "conv2dTranspose"), convertToTensor(t, "filter", "conv2dTranspose"), r, o, a); + }function depthwiseConv2d_(e, t, n, r, o, a, i) { + void 0 === o && (o = "NHWC"), void 0 === a && (a = [1, 1]);var s = convertToTensor(e, "x", "depthwiseConv2d"), + u = convertToTensor(t, "filter", "depthwiseConv2d"), + l = s, + c = !1;3 === s.rank && (c = !0, l = s.as4D(1, s.shape[0], s.shape[1], s.shape[2])), assert(4 === l.rank, "Error in depthwiseConv2d: input must be rank 4, but got rank " + l.rank + "."), assert(4 === u.rank, "Error in depthwiseConv2d: filter must be rank 4, but got rank " + u.rank + "."), assert(l.shape[3] === u.shape[2], "Error in depthwiseConv2d: number of input channels (" + l.shape[3] + ") must match the inChannels dimension in filter " + u.shape[2] + "."), null == a && (a = [1, 1]), assert(eitherStridesOrDilationsAreOne(n, a), "Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides " + n + " and dilations '" + a + "'"), null != i && assert(isInt(r), "Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode " + i + " but got pad " + r + ".");var p = computeConv2DInfo(l.shape, u.shape, n, a, r, i, !0), + d = ENV.engine.runKernel(function (e) { + return e.depthwiseConv2D(l, u, p); + }, { x: l, $filter: u }, function (e) { + return assert(tupleValuesAreOne(a), "Error in gradient of depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '" + a + "'"), { x: function () { + return depthwiseConv2dDerInput(l.shape, e, u, p); + }, $filter: function () { + return depthwiseConv2dDerFilter(l, e, u.shape, p); + } }; + });return c ? d.as3D(d.shape[1], d.shape[2], d.shape[3]) : d; + }function separableConv2d_(e, t, n, r, o, a, i) { + void 0 === a && (a = [1, 1]), void 0 === i && (i = "NHWC");var s = convertToTensor(e, "x", "separableConv2d"), + u = convertToTensor(t, "depthwiseFilter", "separableConv2d"), + l = convertToTensor(n, "pointwiseFilter", "separableConv2d"), + c = s, + p = !1;if (3 === s.rank && (p = !0, c = s.as4D(1, s.shape[0], s.shape[1], s.shape[2])), "NCHW" === i) throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");assert(4 === c.rank, "Error in separableConv2d: input must be rank 4, but got rank " + c.rank + "."), assert(4 === u.rank, "Error in separableConv2d: depthwise filter must be rank 4, but got rank " + u.rank + "."), assert(4 === l.rank, "Error in separableConv2d: pointwise filter must be rank 4, but got rank " + u.rank + "."), assert(1 === l.shape[0], "Error in separableConv2d: the first dimension of pointwise filter must be 1, but got " + l.shape[0] + "."), assert(1 === l.shape[1], "Error in separableConv2d: the second dimension of pointwise filter must be 1, but got " + l.shape[1] + ".");var d = u.shape[2], + h = u.shape[3];assert(l.shape[2] === d * h, "Error in separableConv2d: the third dimension of pointwise filter must be " + d * h + ", but got " + l.shape[2] + ".");var f = depthwiseConv2d(c, u, r, o, i, a), + m = conv2d(f, l, 1, "valid", i);return p ? m.as3D(m.shape[1], m.shape[2], m.shape[3]) : m; + }function parseTupleParam$1(e) { + return "number" == typeof e ? [e, e] : e; + }function tupleValuesAreOne(e) { + var t = parseTupleParam$1(e), + n = t[0], + r = t[1];return 1 === n && 1 === r; + }function eitherStridesOrDilationsAreOne(e, t) { + return tupleValuesAreOne(e) || tupleValuesAreOne(t); + }function depthwiseConv2dDerInput(e, t, n, r) { + var o = t, + a = !1;3 === t.rank && (a = !0, o = t.as4D(1, t.shape[0], t.shape[1], t.shape[2]));var i = ENV.engine.runKernel(function (e) { + return e.depthwiseConv2DDerInput(o, n, r); + }, { dy4D: o });return a ? i.as3D(i.shape[1], i.shape[2], i.shape[3]) : i; + }function depthwiseConv2dDerFilter(e, t, n, r) { + var o = e;3 === e.rank && (o = e.as4D(1, e.shape[0], e.shape[1], e.shape[2]));var a = t;return 3 === a.rank && (a = t.as4D(1, t.shape[0], t.shape[1], t.shape[2])), ENV.engine.runKernel(function (e) { + return e.depthwiseConv2DDerFilter(o, a, r); + }, { x4D: o, dy4D: a }); + }var conv1d = op({ conv1d_: conv1d_ }), + conv2d = op({ conv2d_: conv2d_ }), + depthwiseConv2d = op({ depthwiseConv2d_: depthwiseConv2d_ }), + separableConv2d = op({ separableConv2d_: separableConv2d_ }), + conv2dTranspose = op({ conv2dTranspose_: conv2dTranspose_ });function matMul_(e, t, n, r) { + void 0 === n && (n = !1), void 0 === r && (r = !1);var o = convertToTensor(e, "a", "matMul"), + a = convertToTensor(t, "b", "matMul"), + i = n ? o.shape[0] : o.shape[1], + s = r ? a.shape[1] : a.shape[0];assert(2 === o.rank && 2 === a.rank, "Error in matMul: inputs must be rank 2, got ranks " + o.rank + " and " + a.rank + "."), assert(i === s, "Error in matMul: inner shapes (" + i + ") and (" + s + ") of Tensors with shapes " + o.shape + " and " + a.shape + " and transposeA=" + n + " and transposeB=" + r + " must match.");return ENV.engine.runKernel(function (e) { + return e.matMul(o, a, n, r); + }, { $a: o, $b: a }, function (e) { + return n || r ? !n && r ? { $a: function () { + return e.matMul(a.toFloat(), !1, !1); + }, $b: function () { + return e.matMul(o.toFloat(), !0, !1); + } } : n && !r ? { $a: function () { + return a.toFloat().matMul(e, !1, !0); + }, $b: function () { + return o.toFloat().matMul(e, !1, !1); + } } : { $a: function () { + return a.toFloat().matMul(e, !0, !0); + }, $b: function () { + return e.matMul(o.toFloat(), !0, !0); + } } : { $a: function () { + return e.matMul(a.toFloat(), !1, !0); + }, $b: function () { + return o.toFloat().matMul(e, !0, !1); + } }; + }); + }function outerProduct_(e, t) { + var n = convertToTensor(e, "v1", "outerProduct"), + r = convertToTensor(t, "v2", "outerProduct");return assert(1 === n.rank && 1 === r.rank, "Error in outerProduct: inputs must be rank 1, but got ranks " + n.rank + " and " + r.rank + "."), n.as2D(-1, 1).matMul(r.as2D(1, -1)); + }function dot_(e, t) { + var n = convertToTensor(e, "t1", "dot"), + r = convertToTensor(t, "t2", "dot");assert(!(1 !== n.rank && 2 !== n.rank || 1 !== r.rank && 2 !== r.rank), "Error in dot: inputs must all be rank 1 or 2, but got ranks " + n.rank + " and " + r.rank + ".");var o = 1 === n.rank ? n.size : n.shape[1], + a = 1 === r.rank ? r.size : r.shape[0];return assert(o === a, "Error in dot: inner dimensions of inputs must match, but got " + o + " and " + a + "."), 1 === n.rank && 1 === r.rank ? n.as2D(1, -1).matMul(r.as2D(-1, 1)).asScalar() : 1 === n.rank && 2 === r.rank ? n.as2D(1, -1).matMul(r.as2D(r.shape[0], r.shape[1])).as1D() : 2 === n.rank && 1 === r.rank ? n.matMul(r.as2D(-1, 1)).as1D() : n.matMul(r.as2D(r.shape[0], r.shape[1])); + }var matMul = op({ matMul_: matMul_ }), + dot = op({ dot_: dot_ }), + outerProduct = op({ outerProduct_: outerProduct_ });function reverse1d_(e) { + var t = convertToTensor(e, "x", "reverse");return assert(1 === t.rank, "Error in reverse1D: x must be rank 1 but got\n rank " + t.rank + "."), reverse(t, 0); + }function reverse2d_(e, t) { + var n = convertToTensor(e, "x", "reverse");return assert(2 === n.rank, "Error in reverse2D: x must be rank 2 but got\n rank " + n.rank + "."), reverse(n, t); + }function reverse3d_(e, t) { + var n = convertToTensor(e, "x", "reverse");return assert(3 === n.rank, "Error in reverse3D: x must be rank 3 but got\n rank " + n.rank + "."), reverse(n, t); + }function reverse4d_(e, t) { + var n = convertToTensor(e, "x", "reverse");return assert(4 === n.rank, "Error in reverse4D: x must be rank 4 but got\n rank " + n.rank + "."), reverse(n, t); + }function reverse_(e, t) { + var n = convertToTensor(e, "x", "reverse");if (0 === n.rank) return n.clone();var r = parseAxisParam(t, n.shape);return ENV.engine.runKernel(function (e) { + return e.reverse(n, r); + }, { $x: n }, function (e) { + return { $x: function () { + return e.reverse(r); + } }; + }).reshapeAs(n); + }var reverse = op({ reverse_: reverse_ }), + reverse1d = op({ reverse1d_: reverse1d_ }), + reverse2d = op({ reverse2d_: reverse2d_ }), + reverse3d = op({ reverse3d_: reverse3d_ }), + reverse4d = op({ reverse4d_: reverse4d_ });function maxPool_(e, t, n, r, o) { + var a = convertToTensor(e, "x", "maxPool"), + i = a, + s = !1;3 === a.rank && (s = !0, i = a.as4D(1, a.shape[0], a.shape[1], a.shape[2])), assert(4 === i.rank, "Error in maxPool: input must be rank 4 but got rank " + i.rank + "."), null != o && assert(isInt(r), "Error in maxPool: pad must be an integer when using, dimRoundingMode " + o + " but got pad " + r + ".");var u = computePool2DInfo(i.shape, t, n, r, o), + l = ENV.engine.runKernel(function (e, t) { + return t(e.maxPool(i, u)); + }, { x: i }, function (e, o) { + var a = o[0];return { x: function () { + return maxPoolBackprop(e, i, a, t, n, r); + } }; + });return s ? l.as3D(l.shape[1], l.shape[2], l.shape[3]) : l; + }function avgPool_(e, t, n, r, o) { + var a = convertToTensor(e, "x", "avgPool");assert("float32" === a.dtype, "The input dtype to avgPool must be float32");var i = a, + s = !1;3 === a.rank && (s = !0, i = a.as4D(1, a.shape[0], a.shape[1], a.shape[2])), assert(4 === i.rank, "Error in avgPool: x must be rank 4 but got rank " + i.rank + "."), null != o && assert(isInt(r), "Error in avgPool: pad must be an integer when using, dimRoundingMode " + o + " but got pad " + r + ".");var u = computePool2DInfo(i.shape, t, n, r), + l = ENV.engine.runKernel(function (e) { + return e.avgPool(i, u); + }, { x: i }, function (e) { + return { x: function () { + return avgPoolBackprop(e, i, t, n, r); + } }; + });return l = l.cast(a.dtype), s ? l.as3D(l.shape[1], l.shape[2], l.shape[3]) : l; + }function maxPoolBackprop(e, t, n, r, o, a, i) { + var s = convertToTensor(e, "dy", "maxPoolBackprop"), + u = convertToTensor(t, "input", "maxPoolBackprop"), + l = convertToTensor(n, "output", "maxPoolBackprop");assert(u.rank === s.rank, "Rank of input (" + u.rank + ") does not match rank of dy (" + s.rank + ")"), assert(4 === s.rank, "Error in maxPoolBackprop: dy must be rank 4 but got rank " + s.rank + "."), assert(4 === u.rank, "Error in maxPoolBackprop: input must be rank 4 but got rank " + u.rank + "."), null != i && assert(isInt(a), "Error in maxPoolBackprop: pad must be an integer when using, dimRoundingMode " + i + " but got pad " + a + ".");var c = computePool2DInfo(u.shape, r, o, a, i);return ENV.engine.runKernel(function (e) { + return e.maxPoolBackprop(s, u, l, c); + }, { $dy: s, $input: u }); + }function avgPoolBackprop(e, t, n, r, o) { + var a = convertToTensor(e, "dy", "avgPoolBackprop"), + i = convertToTensor(t, "input", "avgPoolBackprop");assert(i.rank === a.rank, "Rank of input (" + i.rank + ") does not match rank of dy (" + a.rank + ")");var s = i, + u = a, + l = !1;3 === i.rank && (l = !0, s = i.as4D(1, i.shape[0], i.shape[1], i.shape[2]), u = a.as4D(1, a.shape[0], a.shape[1], a.shape[2])), assert(4 === u.rank, "Error in avgPoolBackprop: dy must be rank 4 but got rank " + u.rank + "."), assert(4 === s.rank, "Error in avgPoolBackprop: input must be rank 4 but got rank " + s.rank + ".");var c = computePool2DInfo(s.shape, n, r, o), + p = ENV.engine.runKernel(function (e) { + return e.avgPoolBackprop(u, s, c); + }, { dy4D: u, input4D: s });return l ? p.as3D(p.shape[1], p.shape[2], p.shape[3]) : p; + }var maxPool = op({ maxPool_: maxPool_ }), + avgPool = op({ avgPool_: avgPool_ });function slice1d_(e, t, n) { + var r = convertToTensor(e, "x", "slice1d");return assert(1 === r.rank, "slice1d expects a rank-1 tensor, but got a rank-" + r.rank + " tensor"), slice(r, [t], [n]); + }function slice2d_(e, t, n) { + var r = convertToTensor(e, "x", "slice2d");return assert(2 === r.rank, "slice1d expects a rank-2 tensor, but got a rank-" + r.rank + " tensor"), slice(r, t, n); + }function slice3d_(e, t, n) { + var r = convertToTensor(e, "x", "slice3d");return assert(3 === r.rank, "slice1d expects a rank-3 tensor, but got a rank-" + r.rank + " tensor"), slice(r, t, n); + }function slice4d_(e, t, n) { + var r = convertToTensor(e, "x", "slice4d");return assert(4 === r.rank, "slice1d expects a rank-4 tensor, but got a rank-" + r.rank + " tensor"), slice(r, t, n); + }function slice_(e, t, n) { + var r, + o, + a = convertToTensor(e, "x", "slice");if (0 === a.rank) throw new Error("Slicing scalar is not possible");r = "number" == typeof t ? [t].concat(new Array(a.rank - 1).fill(0)) : t.length < a.rank ? t.concat(new Array(a.rank - t.length).fill(0)) : t, o = (o = null == n ? new Array(a.rank).fill(-1) : "number" == typeof n ? [n].concat(new Array(a.rank - 1).fill(-1)) : n.length < a.rank ? n.concat(new Array(a.rank - n.length).fill(-1)) : n).map(function (e, t) { + return e >= 0 ? e : (assert(-1 === e, "Bad value in size"), a.shape[t] - r[t]); + }), assertParamsValid(a, r, o);var i = a.shape;return ENV.engine.runKernel(function (e) { + return e.slice(a, r, o); + }, { $x: a }, function (e) { + for (var t = [], n = 0; n < e.rank; n++) t.push([r[n], i[n] - r[n] - o[n]]);return { $x: function () { + return e.pad(t); + } }; + }); + }var slice = op({ slice_: slice_ }), + slice1d = op({ slice1d_: slice1d_ }), + slice2d = op({ slice2d_: slice2d_ }), + slice3d = op({ slice3d_: slice3d_ }), + slice4d = op({ slice4d_: slice4d_ }), + tidy = Environment.tidy, + keep = Environment.keep, + dispose = Environment.dispose, + time = Environment.time;function logSumExp_(e, t, n) { + void 0 === t && (t = null), void 0 === n && (n = !1);var r = convertToTensor(e, "x", "logSumExp"), + o = parseAxisParam(t, r.shape), + a = r.max(o, !0), + i = r.sub(a).exp().sum(o).log(), + s = a.reshape(i.shape).add(i);if (n) { + var u = expandShapeToKeepDim(s.shape, o);return s.reshape(u); + }return s; + }function sum_(e, t, n) { + void 0 === t && (t = null), void 0 === n && (n = !1);var r = convertToTensor(e, "x", "sum");"bool" === r.dtype && (r = r.toInt());var o = parseAxisParam(t, r.shape);return customGrad(function (e) { + var t = getAxesPermutation(o, e.rank), + r = o, + a = e;null != t && (a = e.transpose(t), r = getInnerMostAxes(r.length, e.rank));var i = ENV.engine.runKernel(function (e) { + return e.sum(a, r); + }, { permutedX: a });if (n) { + var s = expandShapeToKeepDim(i.shape, o);i = i.reshape(s); + }return { value: i, gradFunc: function (t) { + var n = e.shape.slice();return o.forEach(function (e) { + n[e] = 1; + }), t.reshape(n).mul(ones$1(e.shape, "float32")); + } }; + })(r); + }function mean_(e, t, n) { + void 0 === t && (t = null), void 0 === n && (n = !1);var r = convertToTensor(e, "x", "mean"), + o = parseAxisParam(t, r.shape), + a = sizeFromShape(computeOutAndReduceShapes(r.shape, o)[1]);return customGrad(function (e) { + var r = scalar(a);return { value: (r.dtype === e.dtype ? e : e.cast(r.dtype)).div(r).sum(t, n), gradFunc: function (t) { + var n = e.shape.slice();return o.forEach(function (e) { + n[e] = 1; + }), t.reshape(n).mul(ones$1(e.shape, "float32")).div(r); + } }; + })(r); + }function min_(e, t, n) { + void 0 === t && (t = null), void 0 === n && (n = !1);var r = convertToTensor(e, "x", "min"), + o = parseAxisParam(t, r.shape), + a = o, + i = getAxesPermutation(a, r.rank);null != i && (r = r.transpose(i), a = getInnerMostAxes(a.length, r.rank));var s = ENV.engine.runKernel(function (e) { + return e.min(r, a); + }, { $x: r });if (n) { + var u = expandShapeToKeepDim(s.shape, o);return s.reshape(u); + }return s; + }function max_(e, t, n) { + void 0 === t && (t = null), void 0 === n && (n = !1);var r = convertToTensor(e, "x", "max"), + o = parseAxisParam(t, r.shape), + a = o, + i = getAxesPermutation(a, r.rank);null != i && (r = r.transpose(i), a = getInnerMostAxes(a.length, r.rank));var s = ENV.engine.runKernel(function (e) { + return e.max(r, a); + }, { $x: r });if (n) { + var u = expandShapeToKeepDim(s.shape, o);return s.reshape(u); + }return s; + }function argMin_(e, t) { + void 0 === t && (t = 0);var n = convertToTensor(e, "x", "argMin");null == t && (t = 0);var r = parseAxisParam(t, n.shape), + o = getAxesPermutation(r, n.rank);return null != o && (n = n.transpose(o), r = getInnerMostAxes(r.length, n.rank)), ENV.engine.runKernel(function (e) { + return e.argMin(n, r[0]); + }, { $x: n }); + }function argMax_(e, t) { + void 0 === t && (t = 0);var n = convertToTensor(e, "x", "argMax");null == t && (t = 0);var r = parseAxisParam(t, n.shape), + o = getAxesPermutation(r, n.rank);return null != o && (n = n.transpose(o), r = getInnerMostAxes(r.length, n.rank)), ENV.engine.runKernel(function (e) { + return e.argMax(n, r[0]); + }, { $x: n }); + }function all_(e, t, n) { + void 0 === t && (t = null), void 0 === n && (n = !1);var r = convertToTensor(e, "x", "all", "bool");assert("bool" === r.dtype, "Error Tensor must be of type bool. Got: " + r.dtype);var o = parseAxisParam(t, r.shape), + a = o, + i = getAxesPermutation(a, r.rank);null != i && (r = r.transpose(i), a = getInnerMostAxes(a.length, r.rank));var s = ENV.engine.runKernel(function (e) { + return e.all(r, a); + }, { $x: r });if (n) { + var u = expandShapeToKeepDim(s.shape, o);return s.reshape(u); + }return s; + }function any_(e, t, n) { + void 0 === t && (t = null), void 0 === n && (n = !1);var r = convertToTensor(e, "x", "any", "bool");assert("bool" === r.dtype, "Error Tensor must be of type bool. Got: " + r.dtype);var o = parseAxisParam(t, r.shape), + a = o, + i = getAxesPermutation(a, r.rank);null != i && (r = r.transpose(i), a = getInnerMostAxes(a.length, r.rank));var s = ENV.engine.runKernel(function (e) { + return e.any(r, a); + }, { $x: r });if (n) { + var u = expandShapeToKeepDim(s.shape, o);return s.reshape(u); + }return s; + }function moments_(e, t, n) { + void 0 === t && (t = null), void 0 === n && (n = !1);var r = parseAxisParam(t, (e = convertToTensor(e, "x", "moments")).shape), + o = e.mean(r, n), + a = o.shape;return n || (a = expandShapeToKeepDim(o.shape, r)), { mean: o, variance: e.toFloat().sub(o.reshape(a)).square().mean(r, n) }; + }var all = op({ all_: all_ }), + any = op({ any_: any_ }), + argMax = op({ argMax_: argMax_ }), + argMin = op({ argMin_: argMin_ }), + logSumExp = op({ logSumExp_: logSumExp_ }), + max = op({ max_: max_ }), + mean = op({ mean_: mean_ }), + min = op({ min_: min_ }), + moments = op({ moments_: moments_ }), + sum = op({ sum_: sum_ });function notEqual_(e, t) { + var n = convertToTensor(e, "a", "notEqual"), + r = convertToTensor(t, "b", "notEqual");return assertTypesMatch(n, r), assertAndGetBroadcastShape(n.shape, r.shape), ENV.engine.runKernel(function (e) { + return e.notEqual(n, r); + }, { $a: n, $b: r }); + }function notEqualStrict_(e, t) { + var n = convertToTensor(e, "a", "notEqualStrict"), + r = convertToTensor(t, "b", "notEqualStrict");return assertShapesMatch(n.shape, r.shape, "Error in notEqualStrict: "), n.notEqual(r); + }function less_(e, t) { + var n = convertToTensor(e, "a", "less"), + r = convertToTensor(t, "b", "less");return assertTypesMatch(n, r), assertAndGetBroadcastShape(n.shape, r.shape), ENV.engine.runKernel(function (e) { + return e.less(n, r); + }, { $a: n, $b: r }); + }function lessStrict_(e, t) { + var n = convertToTensor(e, "a", "lessStrict"), + r = convertToTensor(t, "b", "lessStrict");return assertShapesMatch(n.shape, r.shape, "Error in lessStrict: "), n.less(r); + }function equal_(e, t) { + var n = convertToTensor(e, "a", "equal"), + r = convertToTensor(t, "b", "equal");return assertTypesMatch(n, r), assertAndGetBroadcastShape(n.shape, r.shape), ENV.engine.runKernel(function (e) { + return e.equal(n, r); + }, { $a: n, $b: r }); + }function equalStrict_(e, t) { + var n = convertToTensor(e, "a", "equalStrict"), + r = convertToTensor(t, "b", "equalStrict");return assertShapesMatch(n.shape, r.shape, "Error in equalStrict: "), n.equal(r); + }function lessEqual_(e, t) { + var n = convertToTensor(e, "a", "lessEqual"), + r = convertToTensor(t, "b", "lessEqual");return assertTypesMatch(n, r), assertAndGetBroadcastShape(n.shape, r.shape), ENV.engine.runKernel(function (e) { + return e.lessEqual(n, r); + }, { $a: n, $b: r }); + }function lessEqualStrict_(e, t) { + var n = convertToTensor(e, "a", "lessEqualStrict"), + r = convertToTensor(t, "b", "lessEqualStrict");return assertShapesMatch(n.shape, r.shape, "Error in lessEqualStrict: "), n.lessEqual(r); + }function greater_(e, t) { + var n = convertToTensor(e, "a", "greater"), + r = convertToTensor(t, "b", "greater");return assertTypesMatch(n, r), assertAndGetBroadcastShape(n.shape, r.shape), ENV.engine.runKernel(function (e) { + return e.greater(n, r); + }, { $a: n, $b: r }); + }function greaterStrict_(e, t) { + var n = convertToTensor(e, "a", "greaterStrict"), + r = convertToTensor(t, "b", "greaterStrict");return assertShapesMatch(n.shape, r.shape, "Error in greaterStrict: "), n.greater(r); + }function greaterEqual_(e, t) { + var n = convertToTensor(e, "a", "greaterEqual"), + r = convertToTensor(t, "b", "greaterEqual");return assertTypesMatch(n, r), assertAndGetBroadcastShape(n.shape, r.shape), ENV.engine.runKernel(function (e) { + return e.greaterEqual(n, r); + }, { $a: n, $b: r }); + }function greaterEqualStrict_(e, t) { + var n = convertToTensor(e, "a", "greaterEqualStrict"), + r = convertToTensor(t, "b", "greaterEqualStrict");return assertShapesMatch(n.shape, r.shape, "Error in greaterEqualStrict: "), n.greaterEqual(r); + }var equal = op({ equal_: equal_ }), + equalStrict = op({ equalStrict_: equalStrict_ }), + greater = op({ greater_: greater_ }), + greaterEqual = op({ greaterEqual_: greaterEqual_ }), + greaterEqualStrict = op({ greaterEqualStrict_: greaterEqualStrict_ }), + greaterStrict = op({ greaterStrict_: greaterStrict_ }), + less = op({ less_: less_ }), + lessEqual = op({ lessEqual_: lessEqual_ }), + lessEqualStrict = op({ lessEqualStrict_: lessEqualStrict_ }), + lessStrict = op({ lessStrict_: lessStrict_ }), + notEqual = op({ notEqual_: notEqual_ }), + notEqualStrict = op({ notEqualStrict_: notEqualStrict_ });function add_(e, t) { + var n = convertToTensor(e, "a", "add"), + r = convertToTensor(t, "b", "add");assertTypesMatch(n, r);var o = assertAndGetBroadcastShape(n.shape, r.shape);return ENV.engine.runKernel(function (e) { + return e.add(n, r); + }, { $a: n, $b: r }, function (e) { + return { $a: function () { + var t = e, + r = getReductionAxes(n.shape, o);return r.length > 0 && (t = t.sum(r)), t.reshape(n.shape); + }, $b: function () { + var t = e, + n = getReductionAxes(r.shape, o);return n.length > 0 && (t = t.sum(n)), t.reshape(r.shape); + } }; + }); + }function addN_(e) { + assert(Array.isArray(e), function () { + return "The param passed to tf.addN() must be a list of tensors"; + }), assert(e.length >= 1, function () { + return "Must pass at least one tensor to tf.addN(), but got " + e.length; + });var t = e.map(function (e, t) { + return convertToTensor(e, "tensors" + t, "addN"); + }), + n = t[0];t.forEach(function (e) { + if (e.dtype !== n.dtype) throw new Error("All tensors passed to tf.addN() must have the same dtype"); + }), t.forEach(function (e) { + if (!arraysEqual(e.shape, n.shape)) throw new Error("All tensors passed to tf.addN() must have the same shape"); + });var r = t;return ENV.engine.runKernel(function (e) { + return e.addN(t); + }, r, function (e) { + var n = {};return t.forEach(function (t, r) { + n[r] = function () { + return e.clone(); + }; + }), n; + }); + }function addStrict_(e, t) { + return assertShapesMatch(e.shape, t.shape, "Error in addStrict: "), e.add(t); + }function sub_(e, t) { + var n = convertToTensor(e, "a", "sub"), + r = convertToTensor(t, "b", "sub");assertTypesMatch(n, r);var o = assertAndGetBroadcastShape(n.shape, r.shape);return ENV.engine.runKernel(function (e) { + return e.subtract(n, r); + }, { $a: n, $b: r }, function (e) { + return { $a: function () { + var t = e, + r = getReductionAxes(n.shape, o);return r.length > 0 && (t = t.sum(r)), t.reshape(n.shape); + }, $b: function () { + var t = e, + n = getReductionAxes(r.shape, o);return n.length > 0 && (t = t.sum(n)), t.neg().reshape(r.shape); + } }; + }); + }function subStrict_(e, t) { + return assertShapesMatch(e.shape, t.shape, "Error in subStrict: "), e.sub(t); + }function pow_(e, t) { + var n = convertToTensor(e, "base", "pow"), + r = convertToTensor(t, "exp", "pow"), + o = assertAndGetBroadcastShape(n.shape, r.shape);e = n.cast(upcastType(n.dtype, r.dtype)), t = r.cast(upcastType(n.dtype, r.dtype));return ENV.engine.runKernel(function (e, t) { + return t(e.pow(n, r)); + }, { $base: n, $exp: r }, function (e, t) { + var a = t[0];return { $base: function () { + var t = e.mul(r.toFloat().mul(a.div(n))), + i = getReductionAxes(n.shape, o);return i.length > 0 && (t = t.sum(i)), t.reshape(n.shape); + }, $exp: function () { + var t = e.mul(a.mul(n.log()).toFloat()), + i = getReductionAxes(r.shape, o);return i.length > 0 && (t = t.sum(i)), t.reshape(r.shape); + } }; + }); + }function powStrict_(e, t) { + return assertShapesMatch(e.shape, t.shape, "Error in powStrict: "), e.pow(t); + }function mul_(e, t) { + var n = convertToTensor(e, "a", "mul"), + r = convertToTensor(t, "b", "mul");assertTypesMatch(n, r);var o = assertAndGetBroadcastShape(n.shape, r.shape);return ENV.engine.runKernel(function (e) { + return e.multiply(n, r); + }, { $a: n, $b: r }, function (e) { + return { $a: function () { + var t = e.mul(r.toFloat()), + a = getReductionAxes(n.shape, o);return a.length > 0 ? t.sum(a).reshape(n.shape) : t; + }, $b: function () { + var t = e.mul(n.toFloat()), + a = getReductionAxes(r.shape, o);return a.length > 0 ? t.sum(a).reshape(r.shape) : t; + } }; + }); + }function mulStrict_(e, t) { + return assertShapesMatch(e.shape, t.shape, "Error in multiplyStrict: "), e.mul(t); + }function div_(e, t) { + var n, + r = convertToTensor(e, "a", "div"), + o = convertToTensor(t, "b", "div");if (assertTypesMatch(r, o), "int32" === r.dtype && "int32" === o.dtype) return floorDiv(r, o);n = function (e) { + return e.realDivide(r, o); + };var a = assertAndGetBroadcastShape(r.shape, o.shape);return ENV.engine.runKernel(n, { $a: r, $b: o }, function (e) { + return { $a: function () { + var t = e.div(o.toFloat()), + n = getReductionAxes(r.shape, a);return n.length > 0 ? t.sum(n).reshape(r.shape) : t; + }, $b: function () { + var t = e.mul(r.toFloat()), + n = getReductionAxes(o.shape, a);n.length > 0 && (t = t.sum(n).reshape(o.shape));var i = o.square();return t.div(i.toFloat()).neg(); + } }; + }); + }function floorDiv_(e, t) { + var n = convertToTensor(e, "a", "floorDiv"), + r = convertToTensor(t, "b", "floorDiv");assertTypesMatch(n, r);var o = assertAndGetBroadcastShape(n.shape, r.shape);return ENV.engine.runKernel(function (e) { + return e.floorDiv(n, r); + }, { $a: n, $b: r }, function (e) { + return { $a: function () { + var t = e.div(r.toFloat()), + a = getReductionAxes(n.shape, o);return a.length > 0 ? t.sum(a).reshape(n.shape) : t; + }, $b: function () { + var t = e.mul(n.toFloat()), + a = getReductionAxes(r.shape, o);a.length > 0 && (t = t.sum(a).reshape(r.shape));var i = r.square();return t.div(i.toFloat()).neg(); + } }; + }); + }function divStrict_(e, t) { + return assertShapesMatch(e.shape, t.shape, "Error in divideStrict: "), e.div(t); + }function mod_(e, t) { + var n = convertToTensor(e, "a", "mod"), + r = convertToTensor(t, "b", "mod");assertTypesMatch(n, r);var o = assertAndGetBroadcastShape(n.shape, r.shape);return ENV.engine.runKernel(function (e) { + return e.mod(n, r); + }, { $a: n, $b: r }, function (e) { + return { $a: function () { + var t = getReductionAxes(n.shape, o);return t.length > 0 ? e.sum(t).reshape(n.shape) : e; + }, $b: function () { + var t = e.mul(n.div(r).floor().neg()), + a = getReductionAxes(r.shape, o);return a.length > 0 ? t.sum(a).reshape(r.shape) : t; + } }; + }); + }function modStrict_(e, t) { + return assertShapesMatch(e.shape, t.shape, "Error in modStrict: "), e.mod(t); + }function minimum_(e, t) { + var n = convertToTensor(e, "a", "minimum"), + r = convertToTensor(t, "b", "minimum");assertTypesMatch(n, r), "bool" === n.dtype && (n = n.toInt()), "bool" === r.dtype && (r = r.toInt()), assertAndGetBroadcastShape(n.shape, r.shape);return ENV.engine.runKernel(function (e) { + return e.minimum(n, r); + }, { $a: n, $b: r }, function (e) { + return { $a: function () { + return e.mul(n.lessEqual(r).toFloat()); + }, $b: function () { + return e.mul(n.greater(r).toFloat()); + } }; + }); + }function minimumStrict_(e, t) { + return assertShapesMatch(e.shape, t.shape, "Error in minimumStrict: "), e.minimum(t); + }function maximum_(e, t) { + var n = convertToTensor(e, "a", "maximum"), + r = convertToTensor(t, "b", "maximum");assertTypesMatch(n, r), "bool" === n.dtype && (n = n.toInt()), "bool" === r.dtype && (r = r.toInt()), assertAndGetBroadcastShape(n.shape, r.shape);return ENV.engine.runKernel(function (e) { + return e.maximum(n, r); + }, { $a: n, $b: r }, function (e) { + return { $a: function () { + return e.mul(n.greaterEqual(r).toFloat()); + }, $b: function () { + return e.mul(n.less(r).toFloat()); + } }; + }); + }function maximumStrict_(e, t) { + return assertShapesMatch(e.shape, t.shape, "Error in minimumStrict: "), e.maximum(t); + }function squaredDifference_(e, t) { + var n = convertToTensor(e, "a", "squaredDifference"), + r = convertToTensor(t, "b", "squaredDifference");assertTypesMatch(n, r), assertAndGetBroadcastShape(n.shape, r.shape);return ENV.engine.runKernel(function (e) { + return e.squaredDifference(n, r); + }, { $a: n, $b: r }, function (e) { + var t = scalar(2);return { $a: function () { + return e.mul(n.sub(r).mul(t)); + }, $b: function () { + return e.mul(r.sub(n).mul(t)); + } }; + }); + }function squaredDifferenceStrict_(e, t) { + return assertShapesMatch(e.shape, t.shape, "Error in squaredDifferenceStrict: "), e.squaredDifference(t); + }function atan2_(e, t) { + var n = convertToTensor(e, "a", "atan2"), + r = convertToTensor(t, "b", "atan2");assertTypesMatch(n, r);var o = assertAndGetBroadcastShape(n.shape, r.shape);return ENV.engine.runKernel(function (e) { + return e.atan2(n, r); + }, { $a: n, $b: r }, function (e) { + return { $a: function () { + var t = add(n.square(), r.square()), + a = e.mul(r.div(t)), + i = getReductionAxes(n.shape, o);return i.length > 0 && (a = a.sum(i)), a.reshape(n.shape); + }, $b: function () { + var t = add(n.square(), r.square()), + a = neg(e.mul(n.div(t))), + i = getReductionAxes(r.shape, o);return i.length > 0 && (a = a.sum(i)), a.reshape(r.shape); + } }; + }); + }var add = op({ add_: add_ }), + addN = op({ addN_: addN_ }), + addStrict = op({ addStrict_: addStrict_ }), + atan2 = op({ atan2_: atan2_ }), + div = op({ div_: div_ }), + divStrict = op({ divStrict_: divStrict_ }), + floorDiv = op({ floorDiv_: floorDiv_ }), + maximum = op({ maximum_: maximum_ }), + maximumStrict = op({ maximumStrict_: maximumStrict_ }), + minimum = op({ minimum_: minimum_ }), + minimumStrict = op({ minimumStrict_: minimumStrict_ }), + mod = op({ mod_: mod_ }), + modStrict = op({ modStrict_: modStrict_ }), + mul = op({ mul_: mul_ }), + mulStrict = op({ mulStrict_: mulStrict_ }), + pow = op({ pow_: pow_ }), + powStrict = op({ powStrict_: powStrict_ }), + squaredDifference = op({ squaredDifference_: squaredDifference_ }), + squaredDifferenceStrict = op({ squaredDifferenceStrict_: squaredDifferenceStrict_ }), + sub = op({ sub_: sub_ }), + subStrict = op({ subStrict_: subStrict_ });function logicalNot_(e) { + var t = convertToTensor(e, "x", "logicalNot", "bool");return assert("bool" === t.dtype, "Error Array must be of type bool."), ENV.engine.runKernel(function (e) { + return e.logicalNot(t); + }, { $x: t }); + }function logicalAnd_(e, t) { + var n = convertToTensor(e, "a", "logicalAnd", "bool"), + r = convertToTensor(t, "b", "logicalAnd", "bool");return assert("bool" === n.dtype && "bool" === r.dtype, "Error Array must be of type bool."), assertAndGetBroadcastShape(n.shape, r.shape), ENV.engine.runKernel(function (e) { + return e.logicalAnd(n, r); + }, { $a: n, $b: r }); + }function logicalOr_(e, t) { + var n = convertToTensor(e, "a", "logicalOr", "bool"), + r = convertToTensor(t, "b", "logicalOr", "bool");return assert("bool" === n.dtype && "bool" === r.dtype, "Error Array must be of type bool."), assertAndGetBroadcastShape(n.shape, r.shape), ENV.engine.runKernel(function (e) { + return e.logicalOr(n, r); + }, { $a: n, $b: r }); + }function logicalXor_(e, t) { + var n = convertToTensor(e, "a", "logicalXor", "bool"), + r = convertToTensor(t, "b", "logicalXor", "bool");return assert("bool" === n.dtype && "bool" === r.dtype, "Error Array must be of type bool."), assertAndGetBroadcastShape(n.shape, r.shape), logicalOr(e, t).logicalAnd(logicalAnd(e, t).logicalNot()); + }function where_(e, t, n) { + var r = convertToTensor(t, "a", "where"), + o = convertToTensor(n, "b", "where"), + a = convertToTensor(e, "condition", "where", "bool");assert("bool" === a.dtype, "Error Condition must be of type bool."), assertShapesMatch(r.shape, o.shape, "Error in where: "), 1 === a.rank ? assert(a.shape[0] === r.shape[0], "The first dimension of `a` must match the size of `condition`.") : assertShapesMatch(a.shape, o.shape, "Error in where: ");return ENV.engine.runKernel(function (e) { + return e.select(a, r, o); + }, { $condition: a, $a: r, $b: o }, function (e) { + return { $condition: function () { + return zerosLike(a); + }, $a: function () { + return e.mul(a.cast(r.dtype)); + }, $b: function () { + return e.mul(a.logicalNot().cast(o.dtype)); + } }; + }); + }function whereAsync_(e) { + return __awaiter(this, void 0, void 0, function () { + var t, n, r;return __generator(this, function (o) { + switch (o.label) {case 0: + return assert("bool" === (t = convertToTensor(e, "condition", "where", "bool")).dtype, "Condition must be of type bool."), [4, t.data()];case 1: + return n = o.sent(), r = whereImpl(t.shape, n), e !== t && t.dispose(), [2, r];} + }); + }); + }var logicalAnd = op({ logicalAnd_: logicalAnd_ }), + logicalNot = op({ logicalNot_: logicalNot_ }), + logicalOr = op({ logicalOr_: logicalOr_ }), + logicalXor = op({ logicalXor_: logicalXor_ }), + where = op({ where_: where_ }), + whereAsync = whereAsync_;function relu_(e) { + var t = convertToTensor(e, "x", "relu");if ("bool" === t.dtype) return t.toInt();return ENV.engine.runKernel(function (e) { + return e.relu(t); + }, { $x: t }, function (e) { + var n = t.step();return { $x: function () { + return e.mulStrict(n.toFloat()); + } }; + }); + }function elu_(e) { + var t = convertToTensor(e, "x", "elu");return ENV.engine.runKernel(function (e, n) { + return n(e.elu(t)); + }, { $x: t }, function (e, t) { + var n = t[0];return { $x: function () { + return ENV.engine.runKernel(function (t) { + return t.eluDer(e, n); + }, { dy: e, y: n }); + } }; + }); + }function selu_(e) { + var t = convertToTensor(e, "x", "selu");return ENV.engine.runKernel(function (e) { + return e.selu(t); + }, { $x: t }, function (e) { + return { $x: function () { + var n = t.greater(scalar(0)), + r = scalar(SELU_SCALEALPHA), + o = scalar(SELU_SCALE), + a = e.mul(o), + i = e.mul(r).mul(t.toFloat().exp());return where(n, a, i); + } }; + }); + }function leakyRelu_(e, t) { + void 0 === t && (t = .2);var n = convertToTensor(e, "x", "leakyRelu");return maximum(scalar(t).mul(n), n); + }function prelu_(e, t) { + var n = convertToTensor(e, "x", "prelu"), + r = convertToTensor(t, "alpha", "prelu"), + o = scalar(0);return maximum(o, n).add(r.mul(minimum(o, n))); + }var elu = op({ elu_: elu_ }), + leakyRelu = op({ leakyRelu_: leakyRelu_ }), + prelu = op({ prelu_: prelu_ }), + relu = op({ relu_: relu_ }), + selu = op({ selu_: selu_ });function transpose_(e, t) { + var n = convertToTensor(e, "x", "transpose");if (null == t && (t = n.shape.map(function (e, t) { + return t; + }).reverse()), assert(n.rank === t.length, "Error in transpose: rank of input " + n.rank + " must match length of perm " + t + "."), t.forEach(function (e) { + assert(e >= 0 && e < n.rank, "All entries in 'perm' must be between 0 and " + (n.rank - 1) + " but got " + t); + }), n.rank <= 1) return n.clone();return ENV.engine.runKernel(function (e) { + return e.transpose(n, t); + }, { $x: n }, function (e) { + var n = getUndoAxesPermutation(t);return { $x: function () { + return e.transpose(n); + } }; + }); + }var transpose = op({ transpose_: transpose_ });function localResponseNormalization_(e, t, n, r, o) { + void 0 === t && (t = 5), void 0 === n && (n = 1), void 0 === r && (r = 1), void 0 === o && (o = .5);var a = convertToTensor(e, "x", "localResponseNormalization");assert(4 === a.rank || 3 === a.rank, "Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank " + a.rank + "."), assert(isInt(t), "Error in localResponseNormalization: depthRadius must be an integer\n but got depthRadius " + t + ".");var i = a, + s = !1;3 === a.rank && (s = !0, i = a.as4D(1, a.shape[0], a.shape[1], a.shape[2]));var u = ENV.engine.runKernel(function (e, a) { + return a(e.localResponseNormalization4D(i, t, n, r, o)); + }, { x4D: i }, function (e, a) { + var s = a[0];return { x4D: function () { + return ENV.engine.runKernel(function (a) { + return a.LRNGrad(e, i, s, t, n, r, o); + }, {}); + } }; + });return s ? u.as3D(u.shape[1], u.shape[2], u.shape[3]) : u; + }var localResponseNormalization = op({ localResponseNormalization_: localResponseNormalization_ });function norm_(e, t, n, r) { + void 0 === t && (t = "euclidean"), void 0 === n && (n = null), void 0 === r && (r = !1);var o = normImpl(e = convertToTensor(e, "x", "norm"), t, n), + a = o.shape;if (r) { + var i = parseAxisParam(n, e.shape);a = expandShapeToKeepDim(o.shape, i); + }return o.reshape(a); + }function normImpl(e, t, n) { + if (void 0 === n && (n = null), 0 === e.rank) return e.abs();if (1 !== e.rank && null === n) return normImpl(e.reshape([-1]), t, n);if (1 === e.rank || "number" == typeof n || n instanceof Array && 1 === n.length) { + if (1 === t) return e.abs().sum(n);if (t === 1 / 0) return e.abs().max(n);if (t === -1 / 0) return e.abs().min(n);if ("euclidean" === t || 2 === t) return e.abs().pow(scalar(2, "int32")).sum(n).sqrt();throw new Error("Error in norm: invalid ord value: " + t); + }if (n instanceof Array && 2 === n.length) { + if (1 === t) return e.abs().sum(n[0]).max(n[1] - 1);if (t === 1 / 0) return e.abs().sum(n[1]).max(n[0]);if (t === -1 / 0) return e.abs().sum(n[1]).min(n[0]);if ("fro" === t || "euclidean" === t) return e.square().sum(n).sqrt();throw new Error("Error in norm: invalid ord value: " + t); + }throw new Error("Error in norm: invalid axis: " + n); + }var norm = op({ norm_: norm_ });function unsortedSegmentSum_(e, t, n) { + var r = convertToTensor(e, "x", "unsortedSegmentSum"), + o = convertToTensor(t, "segmentIds", "unsortedSegmentSum", "int32");assert("int32" === o.dtype, "segmentIds must be of dtype `int32`"), assert(isInt(n), "numSegments must be of dtype int");return ENV.engine.runKernel(function (e) { + return e.unsortedSegmentSum(r, o, n); + }, { $x: r }, function (e) { + return { $x: function () { + return gatherDropNegatives(e, o); + } }; + }); + }function gather_(e, t, n) { + void 0 === n && (n = 0);var r = convertToTensor(e, "x", "gather"), + o = convertToTensor(t, "indices", "gather", "int32");assert("int32" === o.dtype, "Indices must be of dtype `int32`"), n = parseAxisParam(n, r.shape)[0];return ENV.engine.runKernel(function (e) { + return e.gather(r, o, n); + }, { $x: r }, function (e) { + return { $x: function () { + if (0 === n) return unsortedSegmentSum(e, o, r.shape[n]);var t = r.shape, + a = o.size, + i = t.slice(0, n), + s = i.length, + u = t.slice(n, t.length).slice(1), + l = u.length, + c = arrayRange(0, s), + p = arrayRange(s + 1, s + 1 + l), + d = arrayConcat([i, [a], u]), + h = e.reshape(d), + f = o.reshape([a]), + m = arrayConcat([[s], c, p]), + g = h.transpose(m), + v = unsortedSegmentSum(g, f, r.shape[n]), + y = getUndoAxesPermutation(m);return v = v.transpose(y); + } }; + }); + }function arrayRange(e, t) { + for (var n = [], r = e; r < t; ++r) n.push(r);return n; + }function arrayConcat(e) { + for (var t = [], n = 0; n < e.length; ++n) for (var r = 0; r < e[n].length; ++r) t.push(e[n][r]);return t; + }function gatherDropNegatives(e, t) { + for (var n = maximum(t, zerosLike(t)), r = gather(e, n), o = greaterEqual(t, scalar(0, "int32")), a = r.rank - o.rank, i = 0; i < a; ++i) o = expandDims(o, i + 1);o = logicalAnd(o, ones$1(r.shape, "bool"));var s = zerosLike(r);return where(o, r, s); + }var gather = op({ gather_: gather_ }), + unsortedSegmentSum = op({ unsortedSegmentSum_: unsortedSegmentSum_ });function multiRNNCell_(e, t, n, r) { + for (var o = convertToTensor(t, "data", "multiRNNCell"), a = convertToTensorArray(n, "c", "multiRNNCell"), i = convertToTensorArray(r, "h", "multiRNNCell"), s = o, u = [], l = 0; l < e.length; l++) { + var c = e[l](s, a[l], i[l]);u.push(c[0]), u.push(c[1]), s = c[1]; + }var p = [], + d = [];for (l = 0; l < u.length; l += 2) p.push(u[l]), d.push(u[l + 1]);return [p, d]; + }function basicLSTMCell_(e, t, n, r, o, a) { + var i = convertToTensor(e, "forgetBias", "basicLSTMCell"), + s = convertToTensor(t, "lstmKernel", "basicLSTMCell"), + u = convertToTensor(n, "lstmBias", "basicLSTMCell"), + l = convertToTensor(r, "data", "basicLSTMCell"), + c = convertToTensor(o, "c", "basicLSTMCell"), + p = convertToTensor(a, "h", "basicLSTMCell"), + d = l.concat(p, 1).matMul(s).add(u), + h = d.shape[0], + f = d.shape[1] / 4, + m = [h, f], + g = d.slice([0, 0], m), + v = d.slice([0, f], m), + y = d.slice([0, 2 * f], m), + x = d.slice([0, 3 * f], m), + T = g.sigmoid().mulStrict(v.tanh()).addStrict(c.mulStrict(i.add(y).sigmoid()));return [T, T.tanh().mulStrict(x.sigmoid())]; + }var basicLSTMCell = op({ basicLSTMCell_: basicLSTMCell_ }), + multiRNNCell = op({ multiRNNCell_: multiRNNCell_ });function movingAverage_(e, t, n, r, o) { + void 0 === o && (o = !0);var a = convertToTensor(e, "v", "movingAverage"), + i = convertToTensor(t, "x", "movingAverage"), + s = convertToTensor(n, "decay", "movingAverage");assertTypesMatch(a, i), assert(arraysEqual(a.shape, i.shape), "Shape mismatch in v and x");var u = scalar(1), + l = u.sub(s), + c = i.sub(a).mul(l);if (o) { + assert(null != r, "When using zeroDebias: true, step is required.");var p = convertToTensor(r, "step", "movingAverage");c = c.div(u.sub(pow(s, p))); + }return a.add(c); + }var movingAverage = op({ movingAverage_: movingAverage_ });function stridedSlice_(e, t, n, r, o, a) { + void 0 === o && (o = 0), void 0 === a && (a = 0);var i = convertToTensor(e, "x", "stridedSlice");return ENV.engine.runKernel(function (e) { + return e.stridedSlice(i, t, n, r, o, a); + }, { $x: i }); + }var stridedSlice = op({ stridedSlice_: stridedSlice_ });function topk_(e, t, n) { + void 0 === t && (t = 1), void 0 === n && (n = !0);var r = convertToTensor(e, "x", "topk");if (0 === r.rank) throw new Error("topk() expects the input to be of rank 1 or higher");var o = r.shape[r.shape.length - 1];if (t > o) throw new Error("'k' passed to topk() must be <= the last dimension (" + o + ") but got " + t);var a = ENV.engine.runKernel(function (e) { + return e.topk(r, t, n); + }, { $x: r });return { values: a[0], indices: a[1] }; + }var topk = op({ topk_: topk_ });function computeWeightedLoss_(e, t, n) { + void 0 === n && (n = exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var r = convertToTensor(e, "losses", "computeWeightedLoss"), + o = null;null != t && (o = convertToTensor(t, "weights", "computeWeightedLoss"));var a = null == o ? r : r.mul(o);if (n === exports.Reduction.NONE) return a;if (n === exports.Reduction.SUM) return a.sum();if (n === exports.Reduction.MEAN) { + if (null == o) return a.mean();var i = sizeFromShape(r.shape) / sizeFromShape(o.shape), + s = a.sum().div(o.sum());return i > 1 ? s.div(scalar(i)) : s; + }if (n === exports.Reduction.SUM_BY_NONZERO_WEIGHTS) { + if (null == o) return a.sum().div(scalar(r.size));var u = o.mul(ones$1(r.shape)).notEqual(scalar(0)).sum().toFloat();return a.sum().div(u); + }throw Error("Unknown reduction: " + n); + }function absoluteDifference_(e, t, n, r) { + void 0 === r && (r = exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var o = convertToTensor(e, "labels", "absoluteDifference"), + a = convertToTensor(t, "predictions", "absoluteDifference"), + i = null;null != n && (i = convertToTensor(n, "weights", "absoluteDifference")), assertShapesMatch(o.shape, a.shape, "Error in absoluteDifference: ");var s = o.sub(a).abs();return computeWeightedLoss(s, i, r); + }function meanSquaredError_(e, t, n, r) { + void 0 === r && (r = exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var o = convertToTensor(e, "labels", "meanSquaredError"), + a = convertToTensor(t, "predictions", "meanSquaredError"), + i = null;null != n && (i = convertToTensor(n, "weights", "meanSquaredError")), assertShapesMatch(o.shape, a.shape, "Error in meanSquaredError: ");var s = o.squaredDifference(a);return computeWeightedLoss(s, i, r); + }function cosineDistance_(e, t, n, r, o) { + void 0 === o && (o = exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var a = convertToTensor(e, "labels", "cosineDistance"), + i = convertToTensor(t, "predictions", "cosineDistance"), + s = null;null != r && (s = convertToTensor(r, "weights", "cosineDistance")), assertShapesMatch(a.shape, i.shape, "Error in cosineDistance: ");var u = scalar(1).sub(a.mul(i).sum(n, !0));return computeWeightedLoss(u, s, o); + }function hingeLoss_(e, t, n, r) { + void 0 === r && (r = exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var o = convertToTensor(e, "labels", "hingeLoss"), + a = convertToTensor(t, "predictions", "hingeLoss"), + i = null;null != n && (i = convertToTensor(n, "weights", "hingeLoss")), assertShapesMatch(o.shape, a.shape, "Error in hingeLoss: ");var s = scalar(1);o = scalar(2).mul(o).sub(s);var u = s.sub(o.mul(a)).relu();return computeWeightedLoss(u, i, r); + }function logLoss_(e, t, n, r, o) { + void 0 === r && (r = 1e-7), void 0 === o && (o = exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var a = convertToTensor(e, "labels", "logLoss"), + i = convertToTensor(t, "predictions", "logLoss"), + s = null;null != n && (s = convertToTensor(n, "weights", "logLoss")), assertShapesMatch(a.shape, i.shape, "Error in logLoss: ");var u = scalar(1), + l = scalar(r), + c = a.mul(i.add(l).log()).neg().sub(u.sub(a).mul(u.sub(i).add(l).log()));return computeWeightedLoss(c, s, o); + }function sigmoidCrossEntropyWithLogits_(e, t) { + var n = convertToTensor(e, "labels", "sigmoidCrossEntropyWithLogits"), + r = convertToTensor(t, "logits", "sigmoidCrossEntropyWithLogits");assertShapesMatch(n.shape, r.shape, "Error in sigmoidCrossEntropyWithLogits: ");var o = r.relu(), + a = r.mul(n), + i = r.abs().neg().exp().log1p();return o.sub(a).add(i); + }function sigmoidCrossEntropy_(e, t, n, r, o) { + void 0 === r && (r = 0), void 0 === o && (o = exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var a = convertToTensor(e, "multiClassLabels", "sigmoidCrossEntropy"), + i = convertToTensor(t, "logits", "sigmoidCrossEntropy"), + s = null;if (null != n && (s = convertToTensor(n, "weights", "sigmoidCrossEntropy")), assertShapesMatch(a.shape, i.shape, "Error in sigmoidCrossEntropy: "), r > 0) { + var u = scalar(r), + l = scalar(1), + c = scalar(.5);a = a.mul(l.sub(u)).add(c.mul(u)); + }var p = sigmoidCrossEntropyWithLogits_(a, i);return computeWeightedLoss(p, s, o); + }function huberLoss_(e, t, n, r, o) { + void 0 === r && (r = 1), void 0 === o && (o = exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var a = convertToTensor(e, "labels", "huberLoss"), + i = convertToTensor(t, "predictions", "huberLoss"), + s = null;null != n && (s = convertToTensor(n, "weights", "huberLoss")), assertShapesMatch(a.shape, i.shape, "Error in huberLoss: ");var u = scalar(r), + l = i.sub(a).abs(), + c = minimum(l, u), + p = l.sub(c), + d = scalar(.5).mul(c.square()).add(u.mul(p));return computeWeightedLoss(d, s, o); + }function softmaxCrossEntropyWithLogits_(e, t, n) { + if (void 0 === n && (n = -1), -1 === n && (n = t.rank - 1), n !== t.rank - 1) throw Error("Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank " + t.rank + " and dim was " + n);return customGrad(function (e, t) { + var r = t.logSumExp([n], !0), + o = t.toFloat().sub(r);return { value: o.mul(e).neg().sum([n]), gradFunc: function (t) { + var r = expandShapeToKeepDim(t.shape, [n]);return [t.reshape(r).mul(e.toFloat().sub(o.exp())), t.reshape(r).mul(o.exp().sub(e.toFloat()))]; + } }; + })(e, t); + }function softmaxCrossEntropy_(e, t, n, r, o) { + void 0 === r && (r = 0), void 0 === o && (o = exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var a = convertToTensor(e, "onehotLabels", "softmaxCrossEntropy"), + i = convertToTensor(t, "logits", "softmaxCrossEntropy"), + s = null;if (null != n && (s = convertToTensor(n, "weights", "softmaxCrossEntropy")), assertShapesMatch(a.shape, i.shape, "Error in softmaxCrossEntropy: "), r > 0) { + var u = scalar(r), + l = scalar(1), + c = scalar(a.shape[1]);a = a.mul(l.sub(u)).add(u.div(c)); + }var p = softmaxCrossEntropyWithLogits_(a, i);return computeWeightedLoss(p, s, o); + }!function (e) { + e[e.NONE = 0] = "NONE", e[e.MEAN = 1] = "MEAN", e[e.SUM = 2] = "SUM", e[e.SUM_BY_NONZERO_WEIGHTS = 3] = "SUM_BY_NONZERO_WEIGHTS"; + }(exports.Reduction || (exports.Reduction = {}));var absoluteDifference = op({ absoluteDifference_: absoluteDifference_ }), + computeWeightedLoss = op({ computeWeightedLoss_: computeWeightedLoss_ }), + cosineDistance = op({ cosineDistance_: cosineDistance_ }), + hingeLoss = op({ hingeLoss_: hingeLoss_ }), + huberLoss = op({ huberLoss_: huberLoss_ }), + logLoss = op({ logLoss_: logLoss_ }), + meanSquaredError = op({ meanSquaredError_: meanSquaredError_ }), + sigmoidCrossEntropy = op({ sigmoidCrossEntropy_: sigmoidCrossEntropy_ }), + softmaxCrossEntropy = op({ softmaxCrossEntropy_: softmaxCrossEntropy_ }), + loss_ops = Object.freeze({ get Reduction() { + return exports.Reduction; + }, absoluteDifference: absoluteDifference, computeWeightedLoss: computeWeightedLoss, cosineDistance: cosineDistance, hingeLoss: hingeLoss, huberLoss: huberLoss, logLoss: logLoss, meanSquaredError: meanSquaredError, sigmoidCrossEntropy: sigmoidCrossEntropy, softmaxCrossEntropy: softmaxCrossEntropy });function gramSchmidt_(e) { + var t;if (Array.isArray(e)) { + t = !1, assert(null != e && e.length > 0, "Gram-Schmidt process: input must not be null, undefined, or empty");for (var n = e[0].shape[0], r = 1; r < e.length; ++r) assert(e[r].shape[0] === n, "Gram-Schmidt: Non-unique lengths found in the input vectors: (" + e[r].shape[0] + " vs. " + n + ")"); + } else t = !0, e = split(e, e.shape[0], 0).map(function (e) { + return squeeze(e, [0]); + });assert(e.length <= e[0].shape[0], "Gram-Schmidt: Number of vectors (" + e.length + ") exceeds number of dimensions (" + e[0].shape[0] + ").");var o = [], + a = e, + i = function (e) { + o.push(ENV.engine.tidy(function () { + var t = a[e];if (e > 0) for (var n = 0; n < e; ++n) { + var r = sum(o[n].mulStrict(t)).mul(o[n]);t = t.sub(r); + }return t.div(norm(t, "euclidean")); + })); + };for (r = 0; r < e.length; ++r) i(r);return t ? stack(o, 0) : o; + }function qr_(e, t) { + if (void 0 === t && (t = !1), e.rank < 2) throw new Error("qr() requires input tensor to have a rank >= 2, but got rank " + e.rank);if (2 === e.rank) return qr2d(e, t);var n = e.shape.slice(0, e.shape.length - 2).reduce(function (e, t) { + return e * t; + }), + r = [], + o = [];return unstack(e.reshape([n, e.shape[e.shape.length - 2], e.shape[e.shape.length - 1]]), 0).forEach(function (e) { + var n = qr2d(e, t), + a = n[0], + i = n[1];r.push(a), o.push(i); + }), [stack(r, 0).reshape(e.shape), stack(o, 0).reshape(e.shape)]; + }function qr2d(e, t) { + return void 0 === t && (t = !1), ENV.engine.tidy(function () { + if (2 !== e.shape.length) throw new Error("qr2d() requires a 2D Tensor, but got a " + e.shape.length + "D Tensor.");for (var n = e.shape[0], r = e.shape[1], o = eye(n), a = e.clone(), i = tensor2d([[1]], [1, 1]), s = i.clone(), u = n >= r ? r : n, l = function (e) { + var t, + u = a, + l = s, + c = o;t = ENV.engine.tidy(function () { + var t = a.slice([e, e], [n - e, 1]), + u = t.norm(), + l = a.slice([e, e], [1, 1]), + c = l.sign().neg(), + p = l.sub(c.mul(u)), + d = t.div(p);s = 1 === d.shape[0] ? i.clone() : i.concat(d.slice([1, 0], [d.shape[0] - 1, d.shape[1]]), 0);var h = c.matMul(p).div(u).neg(), + f = a.slice([e, 0], [n - e, r]), + m = h.mul(s);a = 0 === e ? f.sub(m.matMul(s.transpose().matMul(f))) : a.slice([0, 0], [e, r]).concat(f.sub(m.matMul(s.transpose().matMul(f))), 0);var g = o.slice([0, e], [n, o.shape[1] - e]);return o = 0 === e ? g.sub(g.matMul(s).matMul(m.transpose())) : o.slice([0, 0], [n, e]).concat(g.sub(g.matMul(s).matMul(m.transpose())), 1), [s, a, o]; + }), s = t[0], a = t[1], o = t[2], dispose([u, l, c]); + }, c = 0; c < u; ++c) l(c);return !t && n > r && (o = o.slice([0, 0], [n, r]), a = a.slice([0, 0], [r, r])), [o, a]; + }); + }var gramSchmidt = op({ gramSchmidt_: gramSchmidt_ }), + qr = op({ qr_: qr_ }), + linalg_ops = Object.freeze({ gramSchmidt: gramSchmidt, qr: qr });function resizeBilinear_(e, t, n) { + void 0 === n && (n = !1);var r = convertToTensor(e, "images", "resizeBilinear");assert(3 === r.rank || 4 === r.rank, "Error in resizeBilinear: x must be rank 3 or 4, but got rank " + r.rank + "."), assert(2 === t.length, "Error in resizeBilinear: new shape must 2D, but got shape " + t + ".");var o = r, + a = !1;3 === r.rank && (a = !0, o = r.as4D(1, r.shape[0], r.shape[1], r.shape[2]));var i = t[0], + s = t[1], + u = ENV.engine.runKernel(function (e, t) { + return e.resizeBilinear(o, i, s, n); + }, { batchImages: o }, function (e, t) { + return { batchImages: function () { + return ENV.engine.runKernel(function (t) { + return t.resizeBilinearBackprop(e, o, n); + }, {}); + } }; + });return a ? u.as3D(u.shape[1], u.shape[2], u.shape[3]) : u; + }function resizeNearestNeighbor_(e, t, n) { + void 0 === n && (n = !1);var r = convertToTensor(e, "images", "resizeNearestNeighbor");assert(3 === r.rank || 4 === r.rank, "Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank " + r.rank + "."), assert(2 === t.length, "Error in resizeNearestNeighbor: new shape must 2D, but got shape " + t + "."), assert("float32" === r.dtype || "int32" === r.dtype, "`images` must have `int32` or `float32` as dtype");var o = r, + a = !1;3 === r.rank && (a = !0, o = r.as4D(1, r.shape[0], r.shape[1], r.shape[2]));var i = t[0], + s = t[1], + u = ENV.engine.runKernel(function (e, t) { + return e.resizeNearestNeighbor(o, i, s, n); + }, { batchImages: o }, function (e, t) { + return { batchImages: function () { + return ENV.engine.runKernel(function (t) { + return t.resizeNearestNeighborBackprop(e, o, n); + }, {}); + } }; + });return a ? u.as3D(u.shape[1], u.shape[2], u.shape[3]) : u; + }function nonMaxSuppression_(e, t, n, r, o) { + void 0 === r && (r = .5), void 0 === o && (o = Number.NEGATIVE_INFINITY);var a = convertToTensor(e, "boxes", "nonMaxSuppression"), + i = convertToTensor(t, "scores", "nonMaxSuppression"), + s = nonMaxSuppSanityCheck(a, i, n, r, o);return n = s.maxOutputSize, r = s.iouThreshold, o = s.scoreThreshold, ENV.engine.runKernel(function (e) { + return e.nonMaxSuppression(a, i, n, r, o); + }, { $boxes: a }); + }function nonMaxSuppressionAsync_(e, t, n, r, o) { + return void 0 === r && (r = .5), void 0 === o && (o = Number.NEGATIVE_INFINITY), __awaiter(this, void 0, void 0, function () { + var a, i, s, u, l, c;return __generator(this, function (p) { + switch (p.label) {case 0: + return a = convertToTensor(e, "boxes", "nonMaxSuppressionAsync"), i = convertToTensor(t, "scores", "nonMaxSuppressionAsync"), s = nonMaxSuppSanityCheck(a, i, n, r, o), n = s.maxOutputSize, r = s.iouThreshold, o = s.scoreThreshold, [4, a.data()];case 1: + return u = p.sent(), [4, i.data()];case 2: + return l = p.sent(), c = nonMaxSuppressionImpl(u, l, n, r, o), a !== e && a.dispose(), i !== t && i.dispose(), [2, c];} + }); + }); + }function nonMaxSuppSanityCheck(e, t, n, r, o) { + null == r && (r = .5), null == o && (o = Number.NEGATIVE_INFINITY);var a = e.shape[0];return n = Math.min(n, a), assert(0 <= r && r <= 1, "iouThreshold must be in [0, 1], but was '" + r + "'"), assert(2 === e.rank, "boxes must be a 2D tensor, but was of rank '" + e.rank + "'"), assert(4 === e.shape[1], "boxes must have 4 columns, but 2nd dimension was " + e.shape[1]), assert(1 === t.rank, "scores must be a 1D tensor"), assert(t.shape[0] === a, "scores has incompatible shape with boxes. Expected " + a + ", but was " + t.shape[0]), { maxOutputSize: n, iouThreshold: r, scoreThreshold: o }; + }var resizeBilinear = op({ resizeBilinear_: resizeBilinear_ }), + resizeNearestNeighbor = op({ resizeNearestNeighbor_: resizeNearestNeighbor_ }), + nonMaxSuppression = op({ nonMaxSuppression_: nonMaxSuppression_ }), + nonMaxSuppressionAsync = nonMaxSuppressionAsync_, + image_ops = Object.freeze({ resizeBilinear: resizeBilinear, resizeNearestNeighbor: resizeNearestNeighbor, nonMaxSuppression: nonMaxSuppression, nonMaxSuppressionAsync: nonMaxSuppressionAsync }), + ops = Object.freeze({ image: image_ops, linalg: linalg_ops, losses: loss_ops, op: op, batchNormalization2d: batchNormalization2d, batchNormalization3d: batchNormalization3d, batchNormalization4d: batchNormalization4d, batchNormalization: batchNormalization, concat: concat, concat1d: concat1d, concat2d: concat2d, concat3d: concat3d, concat4d: concat4d, conv1d: conv1d, conv2d: conv2d, depthwiseConv2d: depthwiseConv2d, separableConv2d: separableConv2d, conv2dTranspose: conv2dTranspose, matMul: matMul, dot: dot, outerProduct: outerProduct, reverse: reverse, reverse1d: reverse1d, reverse2d: reverse2d, reverse3d: reverse3d, reverse4d: reverse4d, maxPool: maxPool, avgPool: avgPool, slice: slice, slice1d: slice1d, slice2d: slice2d, slice3d: slice3d, slice4d: slice4d, abs: abs, acos: acos, acosh: acosh, asin: asin, asinh: asinh, atan: atan, atanh: atanh, ceil: ceil, clipByValue: clipByValue, cos: cos, cosh: cosh, erf: erf, exp: exp, expm1: expm1, floor: floor, log: log$1, log1p: log1p, logSigmoid: logSigmoid, neg: neg, reciprocal: reciprocal, round: round, rsqrt: rsqrt, sigmoid: sigmoid, sign: sign, sin: sin, sinh: sinh, softplus: softplus, sqrt: sqrt, square: square, step: step, tan: tan, tanh: tanh$1, all: all, any: any, argMax: argMax, argMin: argMin, logSumExp: logSumExp, max: max, mean: mean, min: min, moments: moments, sum: sum, equal: equal, equalStrict: equalStrict, greater: greater, greaterEqual: greaterEqual, greaterEqualStrict: greaterEqualStrict, greaterStrict: greaterStrict, less: less, lessEqual: lessEqual, lessEqualStrict: lessEqualStrict, lessStrict: lessStrict, notEqual: notEqual, notEqualStrict: notEqualStrict, add: add, addN: addN, addStrict: addStrict, atan2: atan2, div: div, divStrict: divStrict, floorDiv: floorDiv, maximum: maximum, maximumStrict: maximumStrict, minimum: minimum, minimumStrict: minimumStrict, mod: mod, modStrict: modStrict, mul: mul, mulStrict: mulStrict, pow: pow, powStrict: powStrict, squaredDifference: squaredDifference, squaredDifferenceStrict: squaredDifferenceStrict, sub: sub, subStrict: subStrict, elu: elu, leakyRelu: leakyRelu, prelu: prelu, relu: relu, selu: selu, logicalAnd: logicalAnd, logicalNot: logicalNot, logicalOr: logicalOr, logicalXor: logicalXor, where: where, whereAsync: whereAsync, buffer: buffer, toPixels: toPixels, print: print, cast: cast, clone: clone, cumsum: cumsum, expandDims: expandDims, eye: eye, fromPixels: fromPixels, multinomial: multinomial, oneHot: oneHot, pad: pad, pad1d: pad1d, pad2d: pad2d, pad3d: pad3d, pad4d: pad4d, rand: rand, randomNormal: randomNormal, randomUniform: randomUniform, reshape: reshape, split: split, squeeze: squeeze, stack: stack, tile: tile, truncatedNormal: truncatedNormal, unstack: unstack, batchToSpaceND: batchToSpaceND, spaceToBatchND: spaceToBatchND, fill: fill, linspace: linspace, ones: ones$1, range: range, scalar: scalar, tensor: tensor, tensor1d: tensor1d, tensor2d: tensor2d, tensor3d: tensor3d, tensor4d: tensor4d, tensor5d: tensor5d, tensor6d: tensor6d, zeros: zeros, onesLike: onesLike, zerosLike: zerosLike, transpose: transpose, softmax: softmax, localResponseNormalization: localResponseNormalization, norm: norm, gather: gather, unsortedSegmentSum: unsortedSegmentSum, basicLSTMCell: basicLSTMCell, multiRNNCell: multiRNNCell, movingAverage: movingAverage, stridedSlice: stridedSlice, topk: topk }), + MathBackendCPU = function () { + function e() { + this.data = new WeakMap(), this.firstUse = !0, ENV.get("IS_BROWSER") && (this.canvas = document.createElement("canvas")); + }return e.prototype.register = function (e, t, n) { + if (this.firstUse && (this.firstUse = !1, ENV.get("IS_NODE") && warn("\n============================\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================\n")), this.data.has(e)) throw new Error("Data buffer is already registered");this.data.set(e, null); + }, e.prototype.write = function (e, t) { + if (null == t) throw new Error("MathBackendCPU.write(): values can not be null");this.throwIfNoData(e), this.data.set(e, t); + }, e.prototype.fromPixels = function (e, t) { + if (null == e) throw new Error("pixels passed to tf.fromPixels() can not be null");var n, r;if (ENV.get("IS_NODE") && null == e.getContext) throw new Error("When running in node, pixels must be an HTMLCanvasElement like the one returned by the `canvas` npm package");if (null != e.getContext) n = e.getContext("2d").getImageData(0, 0, e.width, e.height).data;else if (e instanceof ImageData) n = e.data;else { + if (!(e instanceof HTMLImageElement || e instanceof HTMLVideoElement)) throw new Error("pixels passed to tf.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ImageData, but was " + e.constructor.name);if (null == this.canvas) throw new Error("Can't read pixels from HTMLImageElement outside the browser.");this.canvas.width = e.width, this.canvas.height = e.height, this.canvas.getContext("2d").drawImage(e, 0, 0, e.width, e.height), n = this.canvas.getContext("2d").getImageData(0, 0, e.width, e.height).data; + }if (4 === t) r = new Int32Array(n);else { + var o = e.width * e.height;r = new Int32Array(o * t);for (var a = 0; a < o; a++) for (var i = 0; i < t; ++i) r[a * t + i] = n[4 * a + i]; + }return tensor3d(r, [e.height, e.width, t], "int32"); + }, e.prototype.read = function (e) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (t) { + return [2, this.readSync(e)]; + }); + }); + }, e.prototype.readSync = function (e) { + return this.throwIfNoData(e), this.data.get(e); + }, e.prototype.disposeData = function (e) { + this.data.has(e) && this.data.delete(e); + }, e.prototype.time = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t;return __generator(this, function (n) { + return t = now(), e(), [2, { kernelMs: now() - t }]; + }); + }); + }, e.prototype.memory = function () { + return { unreliable: !0 }; + }, e.prototype.throwIfNoData = function (e) { + if (!this.data.has(e)) throw new Error("CPU backend: No data found for this tensor. Did you change your backend in the middle of the program? New backends can't use Tensors created with previous backends"); + }, e.prototype.slice = function (e, t, n) { + for (var r = buffer(n, e.dtype), o = 0; o < r.size; ++o) { + var a = r.indexToLoc(o), + i = a.map(function (e, n) { + return e + t[n]; + });r.set.apply(r, [e.get.apply(e, i)].concat(a)); + }return r.toTensor(); + }, e.prototype.stridedSlice = function (e, t, n, r, o, a) { + var i = getStridedSlicedInfo(e.shape, t, n, r, o, a), + s = i[0], + u = i[1];if (u.some(function (e) { + return 0 === e; + })) return tensor([], u);for (var l = buffer(u, e.dtype), c = 0; c < l.size; c++) { + for (var p = l.indexToLoc(c), d = new Array(p.length), h = 0; h < d.length; h++) d[h] = p[h] * r[h] + s[h];l.set.apply(l, [e.get.apply(e, d)].concat(p)); + }return l.toTensor(); + }, e.prototype.reverse = function (e, t) { + for (var n = buffer(e.shape, e.dtype), r = e.buffer(), o = function (o) { + var a = n.indexToLoc(o), + i = a.slice();t.forEach(function (t) { + return i[t] = e.shape[t] - 1 - i[t]; + }), n.set.apply(n, [r.get.apply(r, i)].concat(a)); + }, a = 0; a < n.size; a++) o(a);return n.toTensor(); + }, e.prototype.concat = function (e, t) { + var n = computeOutShape$1(e.shape, t.shape, 1), + r = buffer(n, e.dtype);if (1 === e.shape[0] && 1 === t.shape[0]) { + var o = e.dataSync(), + a = t.dataSync(), + i = r.values;return i.set(o, 0), i.set(a, e.size), r.toTensor(); + }for (var s = 0; s < n[0]; ++s) { + for (var u = 0; u < e.shape[1]; ++u) r.set(e.get(s, u), s, u);for (u = 0; u < t.shape[1]; ++u) r.set(t.get(s, u), s, u + e.shape[1]); + }return r.toTensor(); + }, e.prototype.neg = function (e) { + return this.multiply(scalar(-1), e); + }, e.prototype.add = function (e, t) { + return this.broadcastedBinaryOp(e, t, upcastType(e.dtype, t.dtype), function (e, t) { + return e + t; + }); + }, e.prototype.addN = function (e) { + for (var t = e.map(function (e) { + return e.dataSync(); + }), n = buffer(e[0].shape, e[0].dtype), r = n.values, o = 0; o < e.length; o++) for (var a = t[o], i = 0; i < r.length; i++) r[i] += a[i];return n.toTensor(); + }, e.prototype.subtract = function (e, t) { + return this.broadcastedBinaryOp(e, t, upcastType(e.dtype, t.dtype), function (e, t) { + return e - t; + }); + }, e.prototype.pow = function (e, t) { + return this.broadcastedBinaryOp(e, t, e.dtype, function (e, t) { + return Math.pow(e, t); + }); + }, e.prototype.matMul = function (e, t, n, r) { + for (var o = n ? e.shape[0] : e.shape[1], a = n ? e.shape[1] : e.shape[0], i = r ? t.shape[0] : t.shape[1], s = e.dataSync(), u = t.dataSync(), l = n ? [1, e.strides[0]] : [e.strides[0], 1], c = l[0], p = l[1], d = r ? [t.strides[0], 1] : [1, t.strides[0]], h = d[0], f = d[1], m = a * c, g = i * h, v = new Float32Array(a * i), y = 0, x = 0; x < m; x += c) for (var T = 0; T < g; T += h) { + for (var S = x, b = T, E = 0, w = 0; w < o; ++w) E += s[S] * u[b], S += p, b += f;v[y++] = E; + }return tensor2d(v, [a, i]); + }, e.prototype.multiply = function (e, t) { + return this.broadcastedBinaryOp(e, t, upcastType(e.dtype, t.dtype), function (e, t) { + return e * t; + }); + }, e.prototype.realDivide = function (e, t) { + return this.broadcastedBinaryOp(e, t, "float32", function (e, t) { + return e / t; + }); + }, e.prototype.floorDiv = function (e, t) { + return this.broadcastedBinaryOp(e, t, "int32", function (e, t) { + return Math.floor(e / t); + }); + }, e.prototype.sum = function (e, t) { + assertAxesAreInnerMostDims("sum", t, e.rank);for (var n = computeOutAndReduceShapes(e.shape, t), r = n[0], o = n[1], a = zeros(r, upcastType(e.dtype, "int32")), i = sizeFromShape(o), s = a.dataSync(), u = e.dataSync(), l = 0; l < s.length; ++l) { + for (var c = l * i, p = 0, d = 0; d < i; ++d) p += u[c + d];s[l] = p; + }return a; + }, e.prototype.unsortedSegmentSum = function (e, t, n) { + for (var r = [], o = e.rank - t.rank, a = 0; a < o; ++a) t = t.expandDims(a + 1);for (a = 0; a < n; ++a) { + var i = scalar(a, "int32"), + s = equal(i, t).asType("float32").mul(e).sum(0);r.push(s); + }return stack(r); + }, e.prototype.argMin = function (e, t) { + var n = [t];assertAxesAreInnerMostDims("argMin", n, e.rank);for (var r = computeOutAndReduceShapes(e.shape, n), o = r[0], a = r[1], i = zeros(o, "int32"), s = sizeFromShape(a), u = i.dataSync(), l = e.dataSync(), c = 0; c < u.length; ++c) { + for (var p = c * s, d = l[p], h = 0, f = 0; f < s; ++f) { + var m = l[p + f];m < d && (d = m, h = f); + }u[c] = h; + }return i; + }, e.prototype.argMax = function (e, t) { + var n = [t];assertAxesAreInnerMostDims("argMax", n, e.rank);for (var r = computeOutAndReduceShapes(e.shape, n), o = r[0], a = r[1], i = zeros(o, "int32"), s = sizeFromShape(a), u = i.dataSync(), l = e.dataSync(), c = 0; c < u.length; ++c) { + for (var p = c * s, d = l[p], h = 0, f = 0; f < s; ++f) { + var m = l[p + f];m > d && (d = m, h = f); + }u[c] = h; + }return i; + }, e.prototype.cumsum = function (e, t, n, r) { + if (t !== e.rank - 1) throw new Error("backend.cumsum in CPU expects an inner-most axis=" + (e.rank - 1) + " but got axis=" + t);for (var o = upcastType(e.dtype, "int32"), a = zeros(e.shape, o), i = a.dataSync(), s = e.dataSync(), u = e.shape[e.rank - 1], l = r ? function (e, t) { + return e + u - t - 1; + } : function (e, t) { + return e + t; + }, c = 0; c < s.length; c += u) for (var p = 0; p < u; p++) { + var d = l(c, p);if (0 === p) i[d] = n ? 0 : s[d];else { + var h = l(c, p - 1);i[d] = n ? s[h] + i[h] : s[d] + i[h]; + } + }return a; + }, e.prototype.equal = function (e, t) { + return this.broadcastedBinaryOp(e, t, "bool", function (e, t) { + return e === t ? 1 : 0; + }); + }, e.prototype.notEqual = function (e, t) { + return this.broadcastedBinaryOp(e, t, "bool", function (e, t) { + return e !== t ? 1 : 0; + }); + }, e.prototype.less = function (e, t) { + return this.broadcastedBinaryOp(e, t, "bool", function (e, t) { + return e < t ? 1 : 0; + }); + }, e.prototype.lessEqual = function (e, t) { + return this.broadcastedBinaryOp(e, t, "bool", function (e, t) { + return e <= t ? 1 : 0; + }); + }, e.prototype.greater = function (e, t) { + return this.broadcastedBinaryOp(e, t, "bool", function (e, t) { + return e > t ? 1 : 0; + }); + }, e.prototype.greaterEqual = function (e, t) { + return this.broadcastedBinaryOp(e, t, "bool", function (e, t) { + return e >= t ? 1 : 0; + }); + }, e.prototype.logicalNot = function (e) { + for (var t = e.dataSync(), n = new Int32Array(t.length), r = 0; r < t.length; ++r) n[r] = t[r] ? 0 : 1;return Tensor.make(e.shape, { values: n }, "bool"); + }, e.prototype.logicalAnd = function (e, t) { + return this.broadcastedBinaryOp(e, t, "bool", function (e, t) { + return e && t; + }); + }, e.prototype.logicalOr = function (e, t) { + return this.broadcastedBinaryOp(e, t, "bool", function (e, t) { + return e || t; + }); + }, e.prototype.select = function (e, t, n) { + for (var r = e.dataSync(), o = t.dataSync(), a = n.dataSync(), i = zeros(t.shape, upcastType(t.dtype, n.dtype)), s = i.dataSync(), u = 0, l = 0 === e.rank || e.rank > 1 || 1 === t.rank ? 1 : t.shape[1], c = 0; c < r.length; c++) for (var p = 0; p < l; p++) 1 === r[c] ? s[u++] = o[c] : s[u++] = a[c];return i; + }, e.prototype.where = function (e) { + var t = e.dataSync();return whereImpl(e.shape, t); + }, e.prototype.topk = function (e, t, n) { + return topkImpl(e.dataSync(), e.shape, e.dtype, t, n); + }, e.prototype.min = function (e, t) { + assertAxesAreInnerMostDims("min", t, e.rank);for (var n = computeOutAndReduceShapes(e.shape, t), r = n[0], o = n[1], a = zeros(r, e.dtype), i = sizeFromShape(o), s = a.dataSync(), u = e.dataSync(), l = 0; l < s.length; ++l) { + for (var c = l * i, p = u[c], d = 0; d < i; ++d) { + var h = u[c + d];h < p && (p = h); + }s[l] = p; + }return a; + }, e.prototype.minimum = function (e, t) { + return this.broadcastedBinaryOp(e, t, e.dtype, function (e, t) { + return Math.min(e, t); + }); + }, e.prototype.mod = function (e, t) { + return this.broadcastedBinaryOp(e, t, e.dtype, function (e, t) { + var n = e % t;return e < 0 && t < 0 || e >= 0 && t >= 0 ? n : (n + t) % t; + }); + }, e.prototype.max = function (e, t) { + assertAxesAreInnerMostDims("max", t, e.rank);for (var n = computeOutAndReduceShapes(e.shape, t), r = n[0], o = n[1], a = zeros(r, e.dtype), i = sizeFromShape(o), s = a.dataSync(), u = e.dataSync(), l = 0; l < s.length; ++l) { + for (var c = l * i, p = u[c], d = 0; d < i; ++d) { + var h = u[c + d];h > p && (p = h); + }s[l] = p; + }return a; + }, e.prototype.maximum = function (e, t) { + return this.broadcastedBinaryOp(e, t, e.dtype, function (e, t) { + return Math.max(e, t); + }); + }, e.prototype.all = function (e, t) { + assertAxesAreInnerMostDims("all", t, e.rank);for (var n = computeOutAndReduceShapes(e.shape, t), r = n[0], o = n[1], a = zeros(r, e.dtype), i = sizeFromShape(o), s = a.dataSync(), u = e.dataSync(), l = 0; l < s.length; ++l) { + for (var c = l * i, p = u[c], d = 0; d < i; ++d) { + var h = u[c + d];p = p && h; + }s[l] = p; + }return a; + }, e.prototype.any = function (e, t) { + assertAxesAreInnerMostDims("any", t, e.rank);for (var n = computeOutAndReduceShapes(e.shape, t), r = n[0], o = n[1], a = zeros(r, e.dtype), i = sizeFromShape(o), s = a.dataSync(), u = e.dataSync(), l = 0; l < s.length; ++l) { + for (var c = l * i, p = u[c], d = 0; d < i; ++d) { + var h = u[c + d];p = p || h; + }s[l] = p; + }return a; + }, e.prototype.squaredDifference = function (e, t) { + return this.broadcastedBinaryOp(e, t, e.dtype, function (e, t) { + var n = e - t;return n * n; + }); + }, e.prototype.ceil = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) n[r] = Math.ceil(t[r]);return Tensor.make(e.shape, { values: n }); + }, e.prototype.floor = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) n[r] = Math.floor(t[r]);return Tensor.make(e.shape, { values: n }); + }, e.prototype.sign = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) t[r] < 0 ? n[r] = -1 : t[r] > 0 ? n[r] = 1 : n[r] = 0;return Tensor.make(e.shape, { values: n }); + }, e.prototype.round = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) { + var o = Math.floor(t[r]);t[r] - o < .5 ? n[r] = Math.floor(t[r]) : t[r] - o > .5 ? n[r] = Math.ceil(t[r]) : n[r] = o % 2 == 0 ? o : o + 1; + }return Tensor.make(e.shape, { values: n }); + }, e.prototype.exp = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) n[r] = Math.exp(t[r]);return Tensor.make(e.shape, { values: n }); + }, e.prototype.expm1 = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) n[r] = Math.expm1(t[r]);return Tensor.make(e.shape, { values: n }); + }, e.prototype.log = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) { + var o = t[r];n[r] = Math.log(o); + }return Tensor.make(e.shape, { values: n }); + }, e.prototype.log1p = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) { + var o = t[r];n[r] = Math.log1p(o); + }return Tensor.make(e.shape, { values: n }); + }, e.prototype.sqrt = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) { + var o = t[r];n[r] = Math.sqrt(o); + }return Tensor.make(e.shape, { values: n }); + }, e.prototype.rsqrt = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) { + var o = t[r];n[r] = 1 / Math.sqrt(o); + }return Tensor.make(e.shape, { values: n }); + }, e.prototype.square = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) { + var o = t[r];n[r] = o * o; + }return Tensor.make(e.shape, { values: n }); + }, e.prototype.reciprocal = function (e) { + for (var t = e.dataSync(), n = new Float32Array(t.length), r = 0; r < t.length; ++r) n[r] = 1 / t[r];return Tensor.make(e.shape, { values: n }); + }, e.prototype.relu = function (e) { + for (var t = zeros(e.shape, e.dtype), n = t.dataSync(), r = e.dataSync(), o = 0; o < r.length; ++o) n[o] = Math.max(0, r[o]);return t; + }, e.prototype.elu = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) { + var o = n[r];t[r] = o >= 0 ? o : Math.exp(o) - 1; + }return Tensor.make(e.shape, { values: t }); + }, e.prototype.eluDer = function (e, t) { + for (var n = new Float32Array(t.size), r = t.dataSync(), o = e.dataSync(), a = 0; a < r.length; ++a) { + var i = r[a];n[a] = i >= 1 ? o[a] : o[a] * (i + 1); + }return Tensor.make(t.shape, { values: n }); + }, e.prototype.selu = function (e) { + for (var t = SELU_SCALEALPHA, n = SELU_SCALE, r = new Float32Array(e.size), o = e.dataSync(), a = 0; a < o.length; ++a) { + var i = o[a];r[a] = i >= 0 ? n * i : t * (Math.exp(i) - 1); + }return Tensor.make(e.shape, { values: r }); + }, e.prototype.clip = function (e, t, n) { + for (var r = new Float32Array(e.size), o = e.dataSync(), a = 0; a < o.length; ++a) r[a] = Math.min(n, Math.max(t, o[a]));return Tensor.make(e.shape, { values: r }); + }, e.prototype.abs = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.abs(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.int = function (e) { + for (var t = new Int32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = n[r];return Tensor.make(e.shape, { values: t }, "int32"); + }, e.prototype.sigmoid = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = 1 / (1 + Math.exp(-n[r]));return Tensor.make(e.shape, { values: t }); + }, e.prototype.softplus = function (e) { + for (var t = Math.log(1.1920928955078125e-7) + 2, n = new Float32Array(e.size), r = e.dataSync(), o = 0; o < r.length; ++o) { + var a = r[o] > -t, + i = r[o] < t, + s = Math.exp(r[o]), + u = void 0;u = i ? s : a ? r[o] : Math.log(1 + s), n[o] = u; + }return Tensor.make(e.shape, { values: n }); + }, e.prototype.sin = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.sin(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.cos = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.cos(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.tan = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.tan(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.asin = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.asin(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.acos = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.acos(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.atan = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.atan(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.atan2 = function (e, t) { + return this.broadcastedBinaryOp(e, t, e.dtype, function (e, t) { + return Math.atan2(e, t); + }); + }, e.prototype.sinh = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.sinh(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.cosh = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.cosh(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.tanh = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = tanh(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.asinh = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.asinh(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.acosh = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.acosh(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.atanh = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = 0; r < n.length; ++r) t[r] = Math.atanh(n[r]);return Tensor.make(e.shape, { values: t }); + }, e.prototype.erf = function (e) { + for (var t = new Float32Array(e.size), n = e.dataSync(), r = ERF_P, o = ERF_A1, a = ERF_A2, i = ERF_A3, s = ERF_A4, u = ERF_A5, l = 0; l < n.length; ++l) { + var c = n[l], + p = 1 / (1 + r * c);t[l] = 1 - ((((u * p + s) * p + i) * p + a) * p + o) * p * Math.exp(-c * c); + }return Tensor.make(e.shape, { values: t }); + }, e.prototype.step = function (e, t) { + void 0 === t && (t = 0);for (var n = new Float32Array(e.size), r = e.dataSync(), o = 0; o < r.length; ++o) { + var a = r[o];isNaN(a) ? n[o] = NaN : n[o] = a > 0 ? 1 : t; + }return Tensor.make(e.shape, { values: n }); + }, e.prototype.conv2d = function (e, t, n) { + for (var r = n.filterHeight, o = n.filterWidth, a = n.dilationHeight, i = n.dilationWidth, s = n.padInfo.left, u = n.padInfo.top, l = buffer(n.outShape, e.dtype), c = 0; c < n.batchSize; ++c) for (var p = 0; p < n.outChannels; ++p) for (var d = 0; d < n.outHeight; ++d) for (var h = d * n.strideHeight - s, f = 0; f < n.outWidth; ++f) { + for (var m = f * n.strideWidth - u, g = 0, v = 0; v < r; v++) { + var y = h + v * a;if (!(y < 0 || y >= n.inHeight)) for (var x = 0; x < o; x++) { + var T = m + x * i;if (!(T < 0 || T >= n.inWidth)) for (var S = 0; S < n.inChannels; ++S) { + g += e.get(c, y, T, S) * t.get(v, x, S, p); + } + } + }l.set(g, c, d, f, p); + }return l.toTensor(); + }, e.prototype.conv2dDerInput = function (e, t, n) { + for (var r = buffer(n.inShape, "float32"), o = r.values, a = r.strides, i = a[0], s = a[1], u = a[2], l = e.dataSync(), c = e.strides, p = c[0], d = c[1], h = c[2], f = t.dataSync(), m = t.strides, g = m[0], v = m[1], y = m[2], x = n.batchSize, T = n.filterHeight, S = n.filterWidth, b = n.inChannels, E = n.inHeight, w = n.inWidth, _ = n.outChannels, A = n.outHeight, R = n.outWidth, C = n.strideHeight, N = n.strideWidth, k = T - 1 - n.padInfo.top, I = S - 1 - n.padInfo.left, D = 0; D < x; ++D) for (var M = 0; M < b; ++M) for (var O = 0; O < E; ++O) for (var F = O - k, P = Math.max(0, Math.ceil(F / C)), L = Math.min(A, (T + F) / C), B = 0; B < w; ++B) { + for (var U = B - I, V = Math.max(0, Math.ceil(U / N)), z = Math.min(R, (S + U) / N), G = 0, H = P; H < L; ++H) for (var W = H * C - F, q = V; q < z; ++q) for (var $ = p * D + d * H + h * q, X = g * (T - 1 - W) + v * (S - 1 - (q * N - U)) + y * M, j = 0; j < _; ++j) { + G += l[$ + j] * f[X + j]; + }o[i * D + s * O + u * B + M] = G; + }return r.toTensor(); + }, e.prototype.conv2dDerFilter = function (e, t, n) { + for (var r = n.strideHeight, o = n.strideWidth, a = n.filterHeight, i = n.filterWidth, s = buffer(n.filterShape, "float32"), u = n.padInfo.left, l = n.padInfo.top, c = 0; c < a; ++c) for (var p = Math.max(0, Math.ceil((l - c) / r)), d = Math.min(n.outHeight, (n.inHeight + l - c) / r), h = 0; h < i; ++h) for (var f = Math.max(0, Math.ceil((u - h) / o)), m = Math.min(n.outWidth, (n.inWidth + u - h) / o), g = 0; g < n.inChannels; ++g) for (var v = 0; v < n.outChannels; ++v) { + for (var y = 0, x = 0; x < n.batchSize; ++x) for (var T = p; T < d; ++T) for (var S = c + T * r - l, b = f; b < m; ++b) { + var E = h + b * o - u;y += e.get(x, S, E, g) * t.get(x, T, b, v); + }s.set(y, c, h, g, v); + }return s.toTensor(); + }, e.prototype.depthwiseConv2D = function (e, t, n) { + for (var r = n.filterHeight, o = n.filterWidth, a = n.dilationHeight, i = n.dilationWidth, s = n.padInfo.left, u = n.padInfo.top, l = n.outChannels / n.inChannels, c = buffer(n.outShape, e.dtype), p = 0; p < n.batchSize; ++p) for (var d = 0; d < n.inChannels; ++d) for (var h = 0; h < n.outHeight; ++h) for (var f = h * n.strideHeight - s, m = 0; m < n.outWidth; ++m) for (var g = m * n.strideWidth - u, v = 0; v < l; ++v) { + for (var y = 0, x = 0; x < r; ++x) { + var T = f + x * a;if (!(T < 0 || T >= n.inHeight)) for (var S = 0; S < o; ++S) { + var b = g + S * i;if (!(b < 0 || b >= n.inWidth)) y += e.get(p, T, b, d) * t.get(x, S, d, v); + } + }c.set(y, p, h, m, d * l + v); + }return c.toTensor(); + }, e.prototype.depthwiseConv2DDerInput = function (e, t, n) { + for (var r = buffer(n.inShape, "float32"), o = r.values, a = r.strides, i = a[0], s = a[1], u = a[2], l = e.dataSync(), c = e.strides, p = c[0], d = c[1], h = c[2], f = t.dataSync(), m = t.strides, g = m[0], v = m[1], y = m[2], x = n.batchSize, T = n.filterHeight, S = n.filterWidth, b = n.inChannels, E = n.inHeight, w = n.inWidth, _ = n.outChannels, A = n.outHeight, R = n.outWidth, C = n.strideHeight, N = n.strideWidth, k = T - 1 - n.padInfo.top, I = S - 1 - n.padInfo.left, D = _ / b, M = 0; M < x; ++M) for (var O = 0; O < b; ++O) for (var F = 0; F < E; ++F) for (var P = F - k, L = Math.max(0, Math.ceil(P / C)), B = Math.min(A, (T + P) / C), U = 0; U < w; ++U) { + for (var V = U - I, z = Math.max(0, Math.ceil(V / N)), G = Math.min(R, (S + V) / N), H = 0, W = L; W < B; ++W) for (var q = W * C - P, $ = z; $ < G; ++$) for (var X = p * M + d * W + h * $, j = g * (T - 1 - q) + v * (S - 1 - ($ * N - V)) + y * O, K = 0; K < D; ++K) { + H += l[X + (O * D + K)] * f[j + K]; + }o[i * M + s * F + u * U + O] = H; + }return r.toTensor(); + }, e.prototype.depthwiseConv2DDerFilter = function (e, t, n) { + for (var r = n.strideHeight, o = n.strideWidth, a = n.filterHeight, i = n.filterWidth, s = buffer(n.filterShape, "float32"), u = n.padInfo.left, l = n.padInfo.top, c = n.outChannels / n.inChannels, p = 0; p < a; ++p) for (var d = Math.max(0, Math.ceil((l - p) / r)), h = Math.min(n.outHeight, (n.inHeight + l - p) / r), f = 0; f < i; ++f) for (var m = Math.max(0, Math.ceil((u - f) / o)), g = Math.min(n.outWidth, (n.inWidth + u - f) / o), v = 0; v < n.outChannels; ++v) { + for (var y = Math.trunc(v / c), x = v % c, T = 0, S = 0; S < n.batchSize; ++S) for (var b = d; b < h; ++b) for (var E = p + b * r - l, w = m; w < g; ++w) { + var _ = f + w * o - u;T += e.get(S, E, _, y) * t.get(S, b, w, v); + }s.set(T, p, f, y, x); + }return s.toTensor(); + }, e.prototype.tile = function (e, t) { + for (var n = new Array(e.rank), r = 0; r < n.length; r++) n[r] = e.shape[r] * t[r];var o = buffer(n, e.dtype), + a = e.buffer();for (r = 0; r < o.values.length; ++r) { + for (var i = o.indexToLoc(r), s = new Array(e.rank), u = 0; u < s.length; u++) s[u] = i[u] % e.shape[u];var l = a.locToIndex(s);o.values[r] = a.values[l]; + }return o.toTensor(); + }, e.prototype.pad = function (e, t, n) { + var r = t.map(function (t, n) { + return t[0] + e.shape[n] + t[1]; + }), + o = t.map(function (e) { + return e[0]; + }), + a = e.buffer(), + i = buffer(r, e.dtype);0 !== n && i.values.fill(n);for (var s = 0; s < e.size; s++) { + var u = a.indexToLoc(s), + l = u.map(function (e, t) { + return e + o[t]; + });i.set.apply(i, [e.get.apply(e, u)].concat(l)); + }return i.toTensor(); + }, e.prototype.transpose = function (e, t) { + for (var n = new Array(e.rank), r = 0; r < n.length; r++) n[r] = e.shape[t[r]];var o = e.dataSync(), + a = buffer(n, e.dtype), + i = e.buffer();for (r = 0; r < e.size; ++r) { + for (var s = i.indexToLoc(r), u = new Array(s.length), l = 0; l < u.length; l++) u[l] = s[t[l]];var c = a.locToIndex(u);a.values[c] = o[r]; + }return a.toTensor(); + }, e.prototype.gather = function (e, t, n) { + var r = e.shape.slice(), + o = t.dataSync();r[n] = o.length;for (var a = buffer(r, e.dtype), i = e.buffer(), s = 0; s < a.size; ++s) { + var u = a.indexToLoc(s), + l = u.slice();l[n] = o[u[n]];var c = i.locToIndex(l);a.values[s] = i.values[c]; + }return a.toTensor(); + }, e.prototype.batchToSpaceND = function (e, t, n) { + var r = t.reduce(function (e, t) { + return e * t; + }), + o = getReshaped(e.shape, t, r), + a = getPermuted(o.length, t.length), + i = getReshapedPermuted(e.shape, t, r), + s = getSliceBeginCoords(n, t.length), + u = getSliceSize(i, n, t.length);return e.reshape(o).transpose(a).reshape(i).slice(s, u); + }, e.prototype.spaceToBatchND = function (e, t, n) { + var r = t.reduce(function (e, t) { + return e * t; + }), + o = [[0, 0]];o.push.apply(o, n);for (var a = 1 + t.length; a < e.shape.length; ++a) o.push([0, 0]);var i = e.pad(o), + s = getReshaped(i.shape, t, r, !1), + u = getPermuted(s.length, t.length, !1), + l = getReshapedPermuted(i.shape, t, r, !1);return i.reshape(s).transpose(u).reshape(l); + }, e.prototype.pool = function (e, t, n) { + for (var r = t.strideHeight, o = t.strideWidth, a = t.filterHeight, i = t.filterWidth, s = buffer(t.outShape, "float32"), u = t.padInfo.top, l = t.padInfo.left, c = 0; c < t.batchSize; ++c) for (var p = 0; p < t.inChannels; ++p) for (var d = 0; d < t.outHeight; ++d) for (var h = d * r - u, f = Math.max(0, h), m = Math.min(t.inHeight, a + h), g = 0; g < t.outWidth; ++g) { + for (var v = g * o - l, y = Math.max(0, v), x = Math.min(t.inWidth, i + v), T = "max" === n ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, S = 0, b = 0, E = f; E < m; ++E) { + for (var w = y; w < x; ++w) { + var _ = e.get(c, E, w, p);"max" === n && _ > T ? T = _ : "avg" === n && (S += _, b++); + }if (isNaN(T)) break; + }s.set("avg" === n ? S / b : T, c, d, g, p); + }return s.toTensor(); + }, e.prototype.maxPool = function (e, t) { + return this.pool(e, t, "max"); + }, e.prototype.maxPoolPositions = function (e, t) { + for (var n = buffer(t.outShape, "int32"), r = t.strideHeight, o = t.strideWidth, a = t.filterHeight, i = t.filterWidth, s = t.padInfo.top, u = t.padInfo.left, l = 0; l < t.batchSize; ++l) for (var c = 0; c < t.inChannels; ++c) for (var p = 0; p < t.outHeight; ++p) for (var d = p * r - s, h = Math.max(0, d), f = Math.min(t.inHeight, a + d), m = 0; m < t.outWidth; ++m) { + for (var g = m * o - u, v = Math.max(0, g), y = Math.min(t.inWidth, i + g), x = Number.NEGATIVE_INFINITY, T = -1, S = h; S < f; ++S) for (var b = S - d, E = v; E < y; ++E) { + var w = E - g, + _ = e.get(l, S, E, c);_ > x && (x = _, T = b * i + w); + }n.set(T, l, p, m, c); + }return n.toTensor(); + }, e.prototype.maxPoolBackprop = function (e, t, n, r) { + for (var o = this.maxPoolPositions(t, r), a = r.strideHeight, i = r.strideWidth, s = r.filterHeight, u = r.filterWidth, l = u - 1 - r.padInfo.left, c = s - 1 - r.padInfo.top, p = buffer(t.shape, "float32"), d = 0; d < r.batchSize; ++d) for (var h = 0; h < r.inChannels; ++h) for (var f = 0; f < r.inHeight; ++f) for (var m = 0; m < r.inWidth; ++m) { + for (var g = f - c, v = m - l, y = 0, x = 0; x < s; ++x) { + var T = (g + x) / a;if (!(T < 0 || T >= r.outHeight || Math.floor(T) !== T)) for (var S = 0; S < u; ++S) { + var b = (v + S) / i;if (!(b < 0 || b >= r.outWidth || Math.floor(b) !== b)) { + var E = s * u - 1 - o.get(d, T, b, h) === x * u + S ? 1 : 0;if (0 !== E) y += e.get(d, T, b, h) * E; + } + } + }p.set(y, d, f, m, h); + }return p.toTensor(); + }, e.prototype.avgPoolBackprop = function (e, t, n) { + for (var r = n.strideHeight, o = n.strideWidth, a = n.filterHeight, i = n.filterWidth, s = i - 1 - n.padInfo.left, u = a - 1 - n.padInfo.top, l = buffer(t.shape, "float32"), c = 1 / (a * i), p = 0; p < n.batchSize; ++p) for (var d = 0; d < n.inChannels; ++d) for (var h = 0; h < n.inHeight; ++h) for (var f = 0; f < n.inWidth; ++f) { + for (var m = h - u, g = f - s, v = 0, y = 0; y < a; ++y) { + var x = (m + y) / r;if (!(x < 0 || x >= n.outHeight || Math.floor(x) !== x)) for (var T = 0; T < i; ++T) { + var S = (g + T) / o;if (!(S < 0 || S >= n.outWidth || Math.floor(S) !== S)) v += e.get(p, x, S, d); + } + }l.set(v * c, p, h, f, d); + }return l.toTensor(); + }, e.prototype.cast = function (e, t) { + return castTensor(e, t, this); + }, e.prototype.reshape = function (e, t) { + return reshapeTensor(e, t); + }, e.prototype.avgPool = function (e, t) { + return this.pool(e, t, "avg").toFloat(); + }, e.prototype.resizeBilinear = function (e, t, n, r) { + for (var o = e.shape, a = o[0], i = o[1], s = o[2], u = o[3], l = buffer([a, t, n, u], e.dtype), c = [r && t > 1 ? i - 1 : i, r && n > 1 ? s - 1 : s], p = [r && t > 1 ? t - 1 : t, r && n > 1 ? n - 1 : n], d = 0; d < a; d++) for (var h = 0; h < t; h++) for (var f = 0; f < n; f++) for (var m = 0; m < u; m++) { + var g = c[0] * h / p[0], + v = c[1] * f / p[1], + y = Math.floor(g), + x = Math.min(i - 1, Math.ceil(g)), + T = Math.floor(v), + S = Math.min(s - 1, Math.ceil(v)), + b = e.get(d, y, T, m), + E = e.get(d, x, T, m), + w = v - T, + _ = b + (e.get(d, y, S, m) - b) * w, + A = _ + (E + (e.get(d, x, S, m) - E) * w - _) * (g - y);l.set(A, d, h, f, m); + }return l.toTensor(); + }, e.prototype.resizeBilinearBackprop = function (e, t, n) { + for (var r = t.shape, o = r[0], a = r[1], i = r[2], s = r[3], u = e.shape, l = u[1], c = u[2], p = buffer([o, a, i, s], t.dtype), d = [n && l > 1 ? a - 1 : a, n && c > 1 ? i - 1 : i], h = [n && l > 1 ? l - 1 : l, n && c > 1 ? c - 1 : c], f = d[0] / h[0], m = d[1] / h[1], g = 0; g < o; g++) for (var v = 0; v < l; v++) for (var y = v * f, x = Math.floor(y), T = Math.min(Math.ceil(y), a - 1), S = y - x, b = 1 - S, E = 0; E < c; E++) for (var w = E * m, _ = Math.floor(w), A = Math.min(Math.ceil(w), i - 1), R = w - _, C = 1 - R, N = 0; N < s; N++) { + var k = e.get(g, v, E, N), + I = p.get(g, x, _, N);I += k * b * C, p.set(I, g, x, _, N);var D = p.get(g, x, A, N);D += k * b * R, p.set(D, g, x, A, N);var M = p.get(g, T, _, N);M += k * S * C, p.set(M, g, T, _, N);var O = p.get(g, T, A, N);O += k * S * R, p.set(O, g, T, A, N); + }return p.toTensor(); + }, e.prototype.resizeNearestNeighbor = function (e, t, n, r) { + for (var o = e.shape, a = o[0], i = o[1], s = o[2], u = o[3], l = buffer([a, t, n, u], e.dtype), c = [r && t > 1 ? i - 1 : i, r && n > 1 ? s - 1 : s], p = [r && t > 1 ? t - 1 : t, r && n > 1 ? n - 1 : n], d = 0; d < a; d++) for (var h = 0; h < t; h++) for (var f = 0; f < n; f++) for (var m = 0; m < u; m++) { + var g = c[0] * h / p[0], + v = c[1] * f / p[1], + y = Math.min(i - 1, r ? Math.round(g) : Math.floor(g)), + x = Math.min(s - 1, r ? Math.round(v) : Math.floor(v)), + T = e.get(d, y, x, m);l.set(T, d, h, f, m); + }return l.toTensor(); + }, e.prototype.resizeNearestNeighborBackprop = function (e, t, n) { + for (var r = t.shape, o = r[0], a = r[1], i = r[2], s = r[3], u = e.shape, l = u[1], c = u[2], p = buffer([o, a, i, s], t.dtype), d = [n && l > 1 ? a - 1 : a, n && c > 1 ? i - 1 : i], h = [n && l > 1 ? l - 1 : l, n && c > 1 ? c - 1 : c], f = 1 / (d[0] / h[0]), m = 1 / (d[1] / h[1]), g = 2 * Math.ceil(f) + 2, v = 2 * Math.ceil(m) + 2, y = 0; y < o; y++) for (var x = 0; x < a; x++) for (var T = 0; T < i; T++) for (var S = Math.floor(x * f), b = Math.floor(S - g / 2), E = Math.floor(T * m), w = Math.floor(E - v / 2), _ = 0; _ < s; _++) { + for (var A = 0, R = 0; R < g; R++) { + var C = R + b;if (!(C < 0 || C >= l)) for (var N = 0; N < v; N++) { + var k = N + w;if (!(k < 0 || k >= c)) { + var I = d[0] * (C / h[0]), + D = d[1] * (k / h[1]), + M = Math.min(a - 1, n ? Math.round(I) : Math.floor(I)), + O = Math.min(i - 1, n ? Math.round(D) : Math.floor(D));x === M && T === O && (A += e.get(y, C, k, _)); + } + } + }p.set(A, y, x, T, _); + }return p.toTensor(); + }, e.prototype.batchNormalization = function (e, t, n, r, o, a) { + for (var i = e.dataSync(), s = t.dataSync(), u = n.dataSync(), l = o ? o.dataSync() : new Float32Array([1]), c = a ? a.dataSync() : new Float32Array([0]), p = new Float32Array(i.length), d = 0; d < i.length; d++) p[d] = c[d % c.length] + (i[d] - s[d % s.length]) * l[d % l.length] / Math.sqrt(u[d % u.length] + r);return tensor4d(p, e.shape); + }, e.prototype.localResponseNormalization4D = function (e, t, n, r, o) { + var a = buffer(e.shape, "float32"), + i = t, + s = a.shape[3] - 1;function u(t, n, r, o) { + for (var a = 0, u = Math.max(0, o - i); u <= Math.min(o + i, s); u++) { + var l = e.get(t, n, r, u);a += l * l; + }return a; + }for (var l = 0; l < a.shape[0]; l++) for (var c = 0; c <= a.shape[1]; c++) for (var p = 0; p < a.shape[2]; p++) for (var d = 0; d < a.shape[3]; d++) { + var h = u(l, c, p, d), + f = e.get(l, c, p, d) * Math.pow(n + r * h, -o);a.set(f, l, c, p, d); + }return a.toTensor(); + }, e.prototype.LRNGrad = function (e, t, n, r, o, a, i) { + for (var s = e.shape[0], u = e.shape[1], l = e.shape[2], c = e.shape[3], p = buffer([s, u, l, c], "float32"), d = 0; d < s; ++d) for (var h = 0; h < u; ++h) for (var f = 0; f < l; ++f) for (var m = 0; m < c; ++m) { + for (var g = Math.max(0, m - r), v = Math.min(c, m + r + 1), y = 0, x = g; x < v; ++x) y += t.get(d, h, f, x) * t.get(d, h, f, x);y = a * y + o;for (x = g; x < v; ++x) { + var T = -2 * a * i * t.get(d, h, f, x) * n.get(d, h, f, m) / y;m === x && (T += Math.pow(y, -i)), T *= e.get(d, h, f, m), p.set(T + p.get(d, h, f, x), d, h, f, x); + } + }return p.toTensor(); + }, e.prototype.multinomial = function (e, t, n, r) { + for (var o = t ? e : softmax(e), a = o.shape[0], i = o.shape[1], s = zeros([a, n], "int32"), u = s.dataSync(), l = o.dataSync(), c = 0; c < a; ++c) { + var p = c * i, + d = new Float32Array(i - 1);d[0] = l[p];for (var h = 1; h < d.length; ++h) d[h] = d[h - 1] + l[p + h];for (var f = seedrandom_1(r.toString()), m = c * n, g = 0; g < n; ++g) { + var v = f();u[m + g] = d.length;for (var y = 0; y < d.length; y++) if (v < d[y]) { + u[m + g] = y;break; + } + } + }return s; + }, e.prototype.oneHot = function (e, t, n, r) { + var o = new Float32Array(e.size * t);o.fill(r);for (var a = 0; a < e.size; ++a) e.get(a) >= 0 && e.get(a) < t && (o[a * t + e.get(a)] = n);return tensor2d(o, [e.size, t], "int32"); + }, e.prototype.nonMaxSuppression = function (e, t, n, r, o) { + return nonMaxSuppressionImpl(e.dataSync(), t.dataSync(), n, r, o); + }, e.prototype.broadcastedBinaryOp = function (e, t, n, r) { + for (var o = assertAndGetBroadcastShape(e.shape, t.shape), a = buffer(o, n), i = e.dataSync(), s = t.dataSync(), u = getBroadcastDims(e.shape, o), l = getBroadcastDims(t.shape, o), c = e.buffer(), p = t.buffer(), d = function (n) { + var o = a.indexToLoc(n), + d = o.slice(-e.rank);u.forEach(function (e) { + return d[e] = 0; + });var h = c.locToIndex(d), + f = o.slice(-t.rank);l.forEach(function (e) { + return f[e] = 0; + });var m = p.locToIndex(f);a.values[n] = r(i[h], s[m]); + }, h = 0; h < a.values.length; ++h) d(h);return a.toTensor(); + }, e.prototype.dispose = function () {}, e; + }();ENV.registerBackend("cpu", function () { + return new MathBackendCPU(); + }, 1, setTensorTracker);var delayCallback = "undefined" != typeof requestAnimationFrame ? requestAnimationFrame : setImmediate;function nextFrame() { + return new Promise(function (e) { + return delayCallback(function () { + return e(); + }); + }); + }var DTYPE_VALUE_SIZE_MAP = { float32: 4, int32: 4, uint16: 2, uint8: 1, bool: 1 };function encodeWeights(e) { + return __awaiter(this, void 0, void 0, function () { + var t, n, r, o;return __generator(this, function (a) { + switch (a.label) {case 0: + for (r in t = [], n = [], e) { + if ("float32" !== (o = e[r]).dtype && "int32" !== o.dtype && "bool" !== o.dtype) throw new Error("Unsupported dtype in weight '" + r + "': " + o.dtype);t.push({ name: r, shape: o.shape, dtype: o.dtype }), n.push(o.data()); + }return [4, Promise.all(n)];case 1: + return [2, { data: concatenateTypedArrays(a.sent()), specs: t }];} + }); + }); + }function decodeWeights(e, t) { + for (var n = {}, r = 0, o = 0, a = t; o < a.length; o++) { + var i = a[o], + s = i.name, + u = i.dtype, + l = i.shape;if (null != i.quantization) throw new Error("decodeWeights does not support quantization yet, but encountered weight '" + s + " with quantization.'");var c = sizeFromShape(l), + p = void 0;if ("float32" === u) p = tensor(new Float32Array(e, r, c), l, "float32");else if ("int32" === u) p = tensor(new Int32Array(e, r, c), l, "int32");else { + if ("bool" !== u) throw new Error("Unsupported dtype in weight '" + s + "': " + u);p = tensor(new Uint8Array(e, r, c), l, "bool"); + }n[s] = p, r += c * DTYPE_VALUE_SIZE_MAP[u]; + }return n; + }function concatenateTypedArrays(e) { + if (null === e) throw new Error("Invalid input value: " + JSON.stringify(e));var t = 0, + n = [];e.forEach(function (e) { + if (t += e.byteLength, n.push(e.byteLength === e.buffer.byteLength ? e : new e.constructor(e)), !(e instanceof Float32Array || e instanceof Int32Array || e instanceof Uint8Array)) throw new Error("Unsupported TypedArray subtype: " + e.constructor.name); + });var r = new Uint8Array(t), + o = 0;return n.forEach(function (e) { + r.set(new Uint8Array(e.buffer), o), o += e.byteLength; + }), r.buffer; + }var useNodeBuffer = "undefined" != typeof Buffer && ("undefined" == typeof Blob || "undefined" == typeof atob || "undefined" == typeof btoa);function stringByteLength(e) { + return useNodeBuffer ? Buffer.byteLength(e) : new Blob([e]).size; + }function arrayBufferToBase64String(e) { + return useNodeBuffer ? Buffer.from(e).toString("base64") : btoa(String.fromCharCode.apply(null, new Uint8Array(e))); + }function base64StringToArrayBuffer(e) { + if (useNodeBuffer) { + var t = Buffer.from(e, "base64");return t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength); + }for (var n = atob(e), r = new Uint8Array(n.length), o = 0; o < n.length; ++o) r.set([n.charCodeAt(o)], o);return r.buffer; + }function concatenateArrayBuffers(e) { + var t = 0;e.forEach(function (e) { + t += e.byteLength; + });var n = new Uint8Array(t), + r = 0;return e.forEach(function (e) { + n.set(new Uint8Array(e), r), r += e.byteLength; + }), n.buffer; + }function basename(e) { + for (e = e.trim(); e.endsWith("/");) e = e.slice(0, e.length - 1);var t = e.split("/");return t[t.length - 1]; + }function getModelArtifactsInfoForJSON(e) { + if (e.modelTopology instanceof ArrayBuffer) throw new Error("Expected JSON model topology, received ArrayBuffer.");return { dateSaved: new Date(), modelTopologyType: "JSON", modelTopologyBytes: null == e.modelTopology ? 0 : stringByteLength(JSON.stringify(e.modelTopology)), weightSpecsBytes: null == e.weightSpecs ? 0 : stringByteLength(JSON.stringify(e.weightSpecs)), weightDataBytes: null == e.weightData ? 0 : e.weightData.byteLength }; + }var IORouterRegistry = function () { + function e() { + this.saveRouters = [], this.loadRouters = []; + }return e.getInstance = function () { + return null == e.instance && (e.instance = new e()), e.instance; + }, e.registerSaveRouter = function (t) { + e.getInstance().saveRouters.push(t); + }, e.registerLoadRouter = function (t) { + e.getInstance().loadRouters.push(t); + }, e.getSaveHandlers = function (t) { + return e.getHandlers(t, "save"); + }, e.getLoadHandlers = function (t) { + return e.getHandlers(t, "load"); + }, e.getHandlers = function (e, t) { + var n = [];return ("load" === t ? this.getInstance().loadRouters : this.getInstance().saveRouters).forEach(function (t) { + var r = t(e);null !== r && n.push(r); + }), n; + }, e; + }(), + URL_SCHEME_SUFFIX = "://", + ModelStoreManagerRegistry = function () { + function e() { + this.managers = {}; + }return e.getInstance = function () { + return null == e.instance && (e.instance = new e()), e.instance; + }, e.registerManager = function (t, n) { + assert(null != t, "scheme must not be undefined or null."), t.endsWith(URL_SCHEME_SUFFIX) && (t = t.slice(0, t.indexOf(URL_SCHEME_SUFFIX))), assert(t.length > 0, "scheme must not be an empty string.");var r = e.getInstance();assert(null == r.managers[t], "A model store manager is already registered for scheme '" + t + "'."), r.managers[t] = n; + }, e.getManager = function (e) { + var t = this.getInstance().managers[e];if (null == t) throw new Error("Cannot find model manager for scheme '" + e + "'");return t; + }, e.getSchemes = function () { + return Object.keys(this.getInstance().managers); + }, e; + }();function parseURL(e) { + if (-1 === e.indexOf(URL_SCHEME_SUFFIX)) throw new Error("The url string provided does not contain a scheme. Supported schemes are: " + ModelStoreManagerRegistry.getSchemes().join(","));return { scheme: e.split(URL_SCHEME_SUFFIX)[0], path: e.split(URL_SCHEME_SUFFIX)[1] }; + }function cloneModelInternal(e, t, n) { + return void 0 === n && (n = !1), __awaiter(this, void 0, void 0, function () { + var r, o, a, i, s, u, l, c, p;return __generator(this, function (d) { + switch (d.label) {case 0: + return assert(e !== t, "Old path and new path are the same: '" + e + "'"), assert((r = IORouterRegistry.getLoadHandlers(e)).length > 0, "Copying failed because no load handler is found for source URL " + e + "."), assert(r.length < 2, "Copying failed because more than one (" + r.length + ") load handlers for source URL " + e + "."), o = r[0], assert((a = IORouterRegistry.getSaveHandlers(t)).length > 0, "Copying failed because no save handler is found for destination URL " + t + "."), assert(a.length < 2, "Copying failed because more than one (" + r.length + ") save handlers for destination URL " + t + "."), i = a[0], s = parseURL(e).scheme, u = parseURL(e).path, l = s === parseURL(e).scheme, [4, o.load()];case 1: + return c = d.sent(), n && l ? [4, ModelStoreManagerRegistry.getManager(s).removeModel(u)] : [3, 3];case 2: + d.sent(), d.label = 3;case 3: + return [4, i.save(c)];case 4: + return p = d.sent(), !n || l ? [3, 6] : [4, ModelStoreManagerRegistry.getManager(s).removeModel(u)];case 5: + d.sent(), d.label = 6;case 6: + return [2, p.modelArtifactsInfo];} + }); + }); + }function listModels() { + return __awaiter(this, void 0, void 0, function () { + var e, t, n, r, o, a, i;return __generator(this, function (s) { + switch (s.label) {case 0: + e = ModelStoreManagerRegistry.getSchemes(), t = {}, n = 0, r = e, s.label = 1;case 1: + return n < r.length ? (o = r[n], [4, ModelStoreManagerRegistry.getManager(o).listModels()]) : [3, 4];case 2: + for (i in a = s.sent()) t[o + URL_SCHEME_SUFFIX + i] = a[i];s.label = 3;case 3: + return n++, [3, 1];case 4: + return [2, t];} + }); + }); + }function removeModel(e) { + return __awaiter(this, void 0, void 0, function () { + var t;return __generator(this, function (n) { + switch (n.label) {case 0: + return t = parseURL(e), [4, ModelStoreManagerRegistry.getManager(t.scheme).removeModel(t.path)];case 1: + return [2, n.sent()];} + }); + }); + }function copyModel(e, t) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (n) { + switch (n.label) {case 0: + return [4, cloneModelInternal(e, t, !1)];case 1: + return [2, n.sent()];} + }); + }); + }function moveModel(e, t) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (n) { + switch (n.label) {case 0: + return [4, cloneModelInternal(e, t, !0)];case 1: + return [2, n.sent()];} + }); + }); + }var DATABASE_NAME = "tensorflowjs", + DATABASE_VERSION = 1, + MODEL_STORE_NAME = "models_store", + INFO_STORE_NAME = "model_info_store";function getIndexedDBFactory() { + if (!ENV.get("IS_BROWSER")) throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");var e = window, + t = e.indexedDB || e.mozIndexedDB || e.webkitIndexedDB || e.msIndexedDB || e.shimIndexedDB;if (null == t) throw new Error("The current browser does not appear to support IndexedDB.");return t; + }function setUpDatabase(e) { + var t = e.result;t.createObjectStore(MODEL_STORE_NAME, { keyPath: "modelPath" }), t.createObjectStore(INFO_STORE_NAME, { keyPath: "modelPath" }); + }var BrowserIndexedDB = function () { + function e(e) { + if (this.indexedDB = getIndexedDBFactory(), null == e || !e) throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath = e; + }return e.prototype.save = function (e) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (t) { + if (e.modelTopology instanceof ArrayBuffer) throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return [2, this.databaseAction(this.modelPath, e)]; + }); + }); + }, e.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (e) { + return [2, this.databaseAction(this.modelPath)]; + }); + }); + }, e.prototype.databaseAction = function (e, t) { + var n = this;return new Promise(function (e, r) { + var o = n.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);o.onupgradeneeded = function () { + return setUpDatabase(o); + }, o.onsuccess = function () { + var a = o.result;if (null == t) { + var i = a.transaction(MODEL_STORE_NAME, "readonly"), + s = i.objectStore(MODEL_STORE_NAME).get(n.modelPath);s.onsuccess = function () { + if (null == s.result) return a.close(), r(new Error("Cannot find model with path '" + n.modelPath + "' in IndexedDB."));e(s.result.modelArtifacts); + }, s.onerror = function (e) { + return a.close(), r(s.error); + }, i.oncomplete = function () { + return a.close(); + }; + } else { + var u, + l = getModelArtifactsInfoForJSON(t), + c = a.transaction(INFO_STORE_NAME, "readwrite"), + p = c.objectStore(INFO_STORE_NAME), + d = p.put({ modelPath: n.modelPath, modelArtifactsInfo: l });d.onsuccess = function () { + var o = (u = a.transaction(MODEL_STORE_NAME, "readwrite")).objectStore(MODEL_STORE_NAME).put({ modelPath: n.modelPath, modelArtifacts: t, modelArtifactsInfo: l });o.onsuccess = function () { + return e({ modelArtifactsInfo: l }); + }, o.onerror = function (e) { + var t = (p = c.objectStore(INFO_STORE_NAME)).delete(n.modelPath);t.onsuccess = function () { + return a.close(), r(o.error); + }, t.onerror = function (e) { + return a.close(), r(o.error); + }; + }; + }, d.onerror = function (e) { + return a.close(), r(d.error); + }, c.oncomplete = function () { + null == u ? a.close() : u.oncomplete = function () { + return a.close(); + }; + }; + } + }, o.onerror = function (e) { + return r(o.error); + }; + }); + }, e.URL_SCHEME = "indexeddb://", e; + }(), + indexedDBRouter = function (e) { + return ENV.get("IS_BROWSER") && e.startsWith(BrowserIndexedDB.URL_SCHEME) ? browserIndexedDB(e.slice(BrowserIndexedDB.URL_SCHEME.length)) : null; + };function browserIndexedDB(e) { + return new BrowserIndexedDB(e); + }function maybeStripScheme(e) { + return e.startsWith(BrowserIndexedDB.URL_SCHEME) ? e.slice(BrowserIndexedDB.URL_SCHEME.length) : e; + }IORouterRegistry.registerSaveRouter(indexedDBRouter), IORouterRegistry.registerLoadRouter(indexedDBRouter);var BrowserIndexedDBManager = function () { + function e() { + this.indexedDB = getIndexedDBFactory(); + }return e.prototype.listModels = function () { + return __awaiter(this, void 0, void 0, function () { + var e = this;return __generator(this, function (t) { + return [2, new Promise(function (t, n) { + var r = e.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);r.onupgradeneeded = function () { + return setUpDatabase(r); + }, r.onsuccess = function () { + var e = r.result, + o = e.transaction(INFO_STORE_NAME, "readonly"), + a = o.objectStore(INFO_STORE_NAME).getAll();a.onsuccess = function () { + for (var e = {}, n = 0, r = a.result; n < r.length; n++) { + var o = r[n];e[o.modelPath] = o.modelArtifactsInfo; + }t(e); + }, a.onerror = function (t) { + return e.close(), n(a.error); + }, o.oncomplete = function () { + return e.close(); + }; + }, r.onerror = function (e) { + return n(r.error); + }; + })]; + }); + }); + }, e.prototype.removeModel = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t = this;return __generator(this, function (n) { + return e = maybeStripScheme(e), [2, new Promise(function (n, r) { + var o = t.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);o.onupgradeneeded = function () { + return setUpDatabase(o); + }, o.onsuccess = function () { + var t, + a = o.result, + i = a.transaction(INFO_STORE_NAME, "readwrite"), + s = i.objectStore(INFO_STORE_NAME), + u = s.get(e);u.onsuccess = function () { + if (null == u.result) return a.close(), r(new Error("Cannot find model with path '" + e + "' in IndexedDB."));var o = s.delete(e), + i = function () { + var o = (t = a.transaction(MODEL_STORE_NAME, "readwrite")).objectStore(MODEL_STORE_NAME).delete(e);o.onsuccess = function () { + return n(u.result.modelArtifactsInfo); + }, o.onerror = function (e) { + return r(u.error); + }; + };o.onsuccess = i, o.onerror = function (e) { + return i(), a.close(), r(u.error); + }; + }, u.onerror = function (e) { + return a.close(), r(u.error); + }, i.oncomplete = function () { + null == t ? a.close() : t.oncomplete = function () { + return a.close(); + }; + }; + }, o.onerror = function (e) { + return r(o.error); + }; + })]; + }); + }); + }, e; + }();if (ENV.get("IS_BROWSER")) try { + ModelStoreManagerRegistry.registerManager(BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager()); + } catch (e) {}var PATH_SEPARATOR = "/", + PATH_PREFIX = "tensorflowjs_models", + INFO_SUFFIX = "info", + MODEL_TOPOLOGY_SUFFIX = "model_topology", + WEIGHT_SPECS_SUFFIX = "weight_specs", + WEIGHT_DATA_SUFFIX = "weight_data";function getModelKeys(e) { + return { info: [PATH_PREFIX, e, INFO_SUFFIX].join(PATH_SEPARATOR), topology: [PATH_PREFIX, e, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR), weightSpecs: [PATH_PREFIX, e, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR), weightData: [PATH_PREFIX, e, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR) }; + }function getModelPathFromKey(e) { + var t = e.split(PATH_SEPARATOR);if (t.length < 3) throw new Error("Invalid key format: " + e);return t.slice(1, t.length - 1).join(PATH_SEPARATOR); + }function maybeStripScheme$1(e) { + return e.startsWith(BrowserLocalStorage.URL_SCHEME) ? e.slice(BrowserLocalStorage.URL_SCHEME.length) : e; + }var BrowserLocalStorage = function () { + function e(e) { + if (!ENV.get("IS_BROWSER") || void 0 === window.localStorage) throw new Error("The current environment does not support local storage.");if (this.LS = window.localStorage, null == e || !e) throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath = e, this.keys = getModelKeys(this.modelPath); + }return e.prototype.save = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t, n, r, o;return __generator(this, function (a) { + if (e.modelTopology instanceof ArrayBuffer) throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");t = JSON.stringify(e.modelTopology), n = JSON.stringify(e.weightSpecs), r = getModelArtifactsInfoForJSON(e);try { + return this.LS.setItem(this.keys.info, JSON.stringify(r)), this.LS.setItem(this.keys.topology, t), this.LS.setItem(this.keys.weightSpecs, n), this.LS.setItem(this.keys.weightData, arrayBufferToBase64String(e.weightData)), [2, { modelArtifactsInfo: r }]; + } catch (e) { + for (o in this.keys) this.LS.removeItem(this.keys[o]);throw new Error("Failed to save model '" + this.modelPath + "' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=" + r.modelTopologyBytes + ", weightSpecsBytes=" + r.weightSpecsBytes + ", weightDataBytes=" + r.weightDataBytes + "."); + }return [2]; + }); + }); + }, e.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var e, t, n, r, o;return __generator(this, function (a) { + if (null == (e = JSON.parse(this.LS.getItem(this.keys.info)))) throw new Error("In local storage, there is no model with name '" + this.modelPath + "'");if ("JSON" !== e.modelTopologyType) throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");if (t = {}, null == (n = JSON.parse(this.LS.getItem(this.keys.topology)))) throw new Error("In local storage, the topology of model '" + this.modelPath + "' is missing.");if (t.modelTopology = n, null == (r = JSON.parse(this.LS.getItem(this.keys.weightSpecs)))) throw new Error("In local storage, the weight specs of model '" + this.modelPath + "' are missing.");if (t.weightSpecs = r, null == (o = this.LS.getItem(this.keys.weightData))) throw new Error("In local storage, the binary weight values of model '" + this.modelPath + "' are missing.");return t.weightData = base64StringToArrayBuffer(o), [2, t]; + }); + }); + }, e.URL_SCHEME = "localstorage://", e; + }(), + localStorageRouter = function (e) { + return ENV.get("IS_BROWSER") && e.startsWith(BrowserLocalStorage.URL_SCHEME) ? browserLocalStorage(e.slice(BrowserLocalStorage.URL_SCHEME.length)) : null; + };function browserLocalStorage(e) { + return new BrowserLocalStorage(e); + }IORouterRegistry.registerSaveRouter(localStorageRouter), IORouterRegistry.registerLoadRouter(localStorageRouter);var BrowserLocalStorageManager = function () { + function e() { + assert(ENV.get("IS_BROWSER"), "Current environment is not a web browser"), assert(void 0 !== window.localStorage, "Current browser does not appear to support localStorage"), this.LS = window.localStorage; + }return e.prototype.listModels = function () { + return __awaiter(this, void 0, void 0, function () { + var e, t, n, r, o, a;return __generator(this, function (i) { + for (e = {}, t = PATH_PREFIX + PATH_SEPARATOR, n = PATH_SEPARATOR + INFO_SUFFIX, r = 0; r < this.LS.length; ++r) (o = this.LS.key(r)).startsWith(t) && o.endsWith(n) && (a = getModelPathFromKey(o), e[a] = JSON.parse(this.LS.getItem(o)));return [2, e]; + }); + }); + }, e.prototype.removeModel = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t, n;return __generator(this, function (r) { + if (e = maybeStripScheme$1(e), t = getModelKeys(e), null == this.LS.getItem(t.info)) throw new Error("Cannot find model at path '" + e + "'");return n = JSON.parse(this.LS.getItem(t.info)), this.LS.removeItem(t.info), this.LS.removeItem(t.topology), this.LS.removeItem(t.weightSpecs), this.LS.removeItem(t.weightData), [2, n]; + }); + }); + }, e; + }();if (ENV.get("IS_BROWSER")) try { + ModelStoreManagerRegistry.registerManager(BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager()); + } catch (e) {}var DEFAULT_FILE_NAME_PREFIX = "model", + DEFAULT_JSON_EXTENSION_NAME = ".json", + DEFAULT_WEIGHT_DATA_EXTENSION_NAME = ".weights.bin", + BrowserDownloads = function () { + function e(t) { + if (!ENV.get("IS_BROWSER")) throw new Error("triggerDownloads() cannot proceed because the current environment is not a browser.");t.startsWith(e.URL_SCHEME) && (t = t.slice(e.URL_SCHEME.length)), null != t && 0 !== t.length || (t = DEFAULT_FILE_NAME_PREFIX), this.modelTopologyFileName = t + DEFAULT_JSON_EXTENSION_NAME, this.weightDataFileName = t + DEFAULT_WEIGHT_DATA_EXTENSION_NAME; + }return e.prototype.save = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t, n, r, o, a, i;return __generator(this, function (s) { + if (t = window.URL.createObjectURL(new Blob([e.weightData], { type: "application/octet-stream" })), e.modelTopology instanceof ArrayBuffer) throw new Error("DownloadTrigger.save() does not support saving model topology in binary formats yet.");return n = [{ paths: ["./" + this.weightDataFileName], weights: e.weightSpecs }], r = { modelTopology: e.modelTopology, weightsManifest: n }, o = window.URL.createObjectURL(new Blob([JSON.stringify(r)], { type: "application/json" })), (a = null == this.jsonAnchor ? document.createElement("a") : this.jsonAnchor).download = this.modelTopologyFileName, a.href = o, a.click(), null != e.weightData && ((i = null == this.weightDataAnchor ? document.createElement("a") : this.weightDataAnchor).download = this.weightDataFileName, i.href = t, i.click()), [2, { modelArtifactsInfo: getModelArtifactsInfoForJSON(e) }]; + }); + }); + }, e.URL_SCHEME = "downloads://", e; + }(), + BrowserFiles = function () { + function e(e) { + if (null == e || e.length < 1) throw new Error("When calling browserFiles, at least 1 file is required, but received " + e);this.files = e; + }return e.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var e, + t, + n = this;return __generator(this, function (r) { + return e = this.files[0], t = this.files.slice(1), [2, new Promise(function (r, o) { + var a = new FileReader();a.onload = function (a) { + var i = JSON.parse(a.target.result), + s = i.modelTopology;if (null != s) { + 0 === t.length && r({ modelTopology: s });var u = i.weightsManifest;if (null != u) { + var l;try { + l = n.checkManifestAndWeightFiles(u, t); + } catch (e) { + return void o(e); + }var c = [], + p = [], + d = [];u.forEach(function (e) { + e.paths.forEach(function (e) { + p.push(e), d.push(null); + }), c.push.apply(c, e.weights); + }), u.forEach(function (e) { + e.paths.forEach(function (e) { + var t = new FileReader();t.onload = function (t) { + var n = t.target.result, + o = p.indexOf(e);d[o] = n, -1 === d.indexOf(null) && r({ modelTopology: s, weightSpecs: c, weightData: concatenateArrayBuffers(d) }); + }, t.onerror = function (t) { + o("Failed to weights data from file of path '" + e + "'."); + }, t.readAsArrayBuffer(l[e]); + }); + }); + } else o(new Error("weightManifest field is missing from file " + e.name)); + } else o(new Error("modelTopology field is missing from file " + e.name)); + }, a.onerror = function (t) { + o("Failed to read model topology and weights manifest JSON from file '" + e.name + "'. BrowserFiles supports loading Keras-style tf.Model artifacts only."); + }, a.readAsText(e); + })]; + }); + }); + }, e.prototype.checkManifestAndWeightFiles = function (e, t) { + for (var n = [], r = t.map(function (e) { + return basename(e.name); + }), o = {}, a = 0, i = e; a < i.length; a++) { + i[a].paths.forEach(function (e) { + var a = basename(e);if (-1 !== n.indexOf(a)) throw new Error("Duplicate file basename found in weights manifest: '" + a + "'");if (n.push(a), -1 === r.indexOf(a)) throw new Error("Weight file with basename '" + a + "' is not provided.");o[e] = t[r.indexOf(a)]; + }); + }if (n.length !== t.length) throw new Error("Mismatch in the number of files in weights manifest (" + n.length + ") and the number of weight files provided (" + t.length + ").");return o; + }, e; + }(), + browserDownloadsRouter = function (e) { + return ENV.get("IS_BROWSER") && e.startsWith(BrowserDownloads.URL_SCHEME) ? browserDownloads(e.slice(BrowserDownloads.URL_SCHEME.length)) : null; + };function browserDownloads(e) { + return void 0 === e && (e = "model"), new BrowserDownloads(e); + }function browserFiles(e) { + return new BrowserFiles(e); + }function loadWeightsAsArrayBuffer(e, t) { + return __awaiter(this, void 0, void 0, function () { + var n, r;return __generator(this, function (o) { + switch (o.label) {case 0: + return n = e.map(function (e) { + return fetch(e, t); + }), [4, Promise.all(n)];case 1: + return r = o.sent(), [4, Promise.all(r.map(function (e) { + return e.arrayBuffer(); + }))];case 2: + return [2, o.sent()];} + }); + }); + }function loadWeights(e, t, n, r) { + return void 0 === t && (t = ""), __awaiter(this, void 0, void 0, function () { + var o, a, i, s, u, l, c, p, d, h;return __generator(this, function (f) { + switch (f.label) {case 0: + if (o = e.map(function () { + return !1; + }), a = {}, i = null != n ? n.map(function () { + return !1; + }) : [], s = [], e.forEach(function (e, t) { + var r = 0;e.weights.forEach(function (e) { + var u = "quantization" in e ? e.quantization.dtype : e.dtype, + l = DTYPE_VALUE_SIZE_MAP[u] * sizeFromShape(e.shape), + c = function () { + o[t] = !0, null == a[t] && (a[t] = []), a[t].push({ manifestEntry: e, groupOffset: r, sizeBytes: l }); + };null != n ? n.forEach(function (t, n) { + t === e.name && (c(), i[n] = !0); + }) : c(), s.push(e.name), r += l; + }); + }), !i.every(function (e) { + return e; + })) throw u = n.filter(function (e, t) { + return !i[t]; + }), new Error("Could not find weights in manifest with names: " + u.join(", ") + ". \nManifest JSON has weights with names: " + s.join(", ") + ".");return l = o.reduce(function (e, t, n) { + return t && e.push(n), e; + }, []), c = [], l.forEach(function (n) { + e[n].paths.forEach(function (e) { + var n = t + (t.endsWith("/") ? "" : "/") + e;c.push(n); + }); + }), [4, loadWeightsAsArrayBuffer(c, r)];case 1: + return p = f.sent(), d = {}, h = 0, l.forEach(function (t) { + for (var n = e[t].paths.length, r = 0, o = 0; o < n; o++) r += p[h + o].byteLength;for (var i = new ArrayBuffer(r), s = new Uint8Array(i), u = 0, l = 0; l < n; l++) { + var c = new Uint8Array(p[h + l]);s.set(c, u), u += c.byteLength; + }a[t].forEach(function (e) { + var t, + n = i.slice(e.groupOffset, e.groupOffset + e.sizeBytes), + r = e.manifestEntry.dtype;if ("quantization" in e.manifestEntry) { + var o = e.manifestEntry.quantization;if ("uint8" !== o.dtype && "uint16" !== o.dtype) throw new Error("Weight " + e.manifestEntry.name + " has unknown quantization dtype " + o.dtype + ".");var a = "uint8" === o.dtype ? new Uint8Array(n) : new Uint16Array(n);if ("float32" === r) t = Float32Array.from(a, function (e) { + return e * o.scale + o.min; + });else { + if ("int32" !== r) throw new Error("Weight " + e.manifestEntry.name + " has a dtype not supported by quantization: " + r);t = Int32Array.from(a, function (e) { + return Math.round(e * o.scale + o.min); + }); + } + } else if ("float32" === r) t = new Float32Array(n);else if ("int32" === r) t = new Int32Array(n);else { + if ("bool" !== r) throw new Error("Weight " + e.manifestEntry.name + " has unknown dtype " + r + ".");t = new Uint8Array(n); + }var s = e.manifestEntry.name;if (null != d[s]) throw new Error("Duplicate weight with name " + s + ". Please make sure weights names are unique in the manifest JSON.");d[s] = tensor(t, e.manifestEntry.shape, e.manifestEntry.dtype); + }), h += n; + }), [2, d];} + }); + }); + }IORouterRegistry.registerSaveRouter(browserDownloadsRouter);var BrowserHTTPRequest = function () { + function e(e, t) { + if (this.DEFAULT_METHOD = "POST", "undefined" == typeof fetch) throw new Error("browserHTTPRequest is not supported outside the web browser without a fetch polyfill.");if (assert(null != e && e.length > 0, "URL path for browserHTTPRequest must not be null, undefined or empty."), this.path = e, null != t && null != t.body) throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit = t || {}; + }return e.prototype.save = function (e) { + return __awaiter(this, void 0, void 0, function () { + var t, n, r, o;return __generator(this, function (a) { + switch (a.label) {case 0: + if (e.modelTopology instanceof ArrayBuffer) throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");return (t = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit)).body = new FormData(), n = [{ paths: ["./model.weights.bin"], weights: e.weightSpecs }], r = { modelTopology: e.modelTopology, weightsManifest: n }, t.body.append("model.json", new Blob([JSON.stringify(r)], { type: "application/json" }), "model.json"), null != e.weightData && t.body.append("model.weights.bin", new Blob([e.weightData], { type: "application/octet-stream" }), "model.weights.bin"), [4, fetch(this.path, t)];case 1: + if (200 === (o = a.sent()).status) return [2, { modelArtifactsInfo: getModelArtifactsInfoForJSON(e), responses: [o] }];throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status " + o.status + ".");} + }); + }); + }, e.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var e, t, n, r, o, a, i, s, u, l, c, p;return __generator(this, function (d) { + switch (d.label) {case 0: + return [4, fetch(this.path, this.requestInit)];case 1: + return [4, d.sent().json()];case 2: + if (e = d.sent(), t = e.modelTopology, n = e.weightsManifest, null == t && null == n) throw new Error("The JSON from HTTP path " + this.path + " contains neither model topology or manifest for weights.");if (null == n) return [3, 4];for (a = e.weightsManifest, r = [], i = 0, s = a; i < s.length; i++) u = s[i], r.push.apply(r, u.weights);return (l = this.path.substring(0, this.path.lastIndexOf("/"))).endsWith("/") || (l += "/"), c = [], a.forEach(function (e) { + e.paths.forEach(function (e) { + c.push(l + e); + }); + }), p = concatenateArrayBuffers, [4, loadWeightsAsArrayBuffer(c, this.requestInit)];case 3: + o = p.apply(void 0, [d.sent()]), d.label = 4;case 4: + return [2, { modelTopology: t, weightSpecs: r, weightData: o }];} + }); + }); + }, e.URL_SCHEMES = ["http://", "https://"], e; + }(), + httpRequestRouter = function (e) { + if ("undefined" == typeof fetch) return null;for (var t = 0, n = BrowserHTTPRequest.URL_SCHEMES; t < n.length; t++) { + var r = n[t];if (e.startsWith(r)) return browserHTTPRequest(e); + }return null; + };function browserHTTPRequest(e, t) { + return new BrowserHTTPRequest(e, t); + }IORouterRegistry.registerSaveRouter(httpRequestRouter), IORouterRegistry.registerLoadRouter(httpRequestRouter);var PassthroughLoader = function () { + function e(e, t, n) { + this.modelTopology = e, this.weightSpecs = t, this.weightData = n; + }return e.prototype.load = function () { + return __awaiter(this, void 0, void 0, function () { + var e;return __generator(this, function (t) { + return e = {}, null != this.modelTopology && (e = __assign({ modelTopology: this.modelTopology }, e)), null != this.weightSpecs && this.weightSpecs.length > 0 && (e = __assign({ weightSpecs: this.weightSpecs }, e)), null != this.weightData && this.weightData.byteLength > 0 && (e = __assign({ weightData: this.weightData }, e)), [2, e]; + }); + }); + }, e; + }(), + PassthroughSaver = function () { + function e(e) { + this.saveHandler = e; + }return e.prototype.save = function (e) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (t) { + return [2, this.saveHandler(e)]; + }); + }); + }, e; + }();function fromMemory(e, t, n) { + return new PassthroughLoader(e, t, n); + }function withSaveHandler(e) { + return new PassthroughSaver(e); + }var registerSaveRouter = IORouterRegistry.registerSaveRouter, + registerLoadRouter = IORouterRegistry.registerLoadRouter, + getSaveHandlers = IORouterRegistry.getSaveHandlers, + getLoadHandlers = IORouterRegistry.getLoadHandlers, + io = Object.freeze({ browserFiles: browserFiles, browserHTTPRequest: browserHTTPRequest, concatenateArrayBuffers: concatenateArrayBuffers, decodeWeights: decodeWeights, encodeWeights: encodeWeights, fromMemory: fromMemory, getLoadHandlers: getLoadHandlers, getModelArtifactsInfoForJSON: getModelArtifactsInfoForJSON, getSaveHandlers: getSaveHandlers, loadWeights: loadWeights, registerLoadRouter: registerLoadRouter, registerSaveRouter: registerSaveRouter, withSaveHandler: withSaveHandler, copyModel: copyModel, listModels: listModels, moveModel: moveModel, removeModel: removeModel }), + Serializable = function () { + function e() {}return e.prototype.getClassName = function () { + return this.constructor.className; + }, e.fromConfig = function (e, t) { + return new e(t); + }, e; + }(), + SerializationMap = function () { + function e() { + this.classNameMap = {}; + }return e.getMap = function () { + return null == e.instance && (e.instance = new e()), e.instance; + }, e.register = function (t) { + e.getMap().classNameMap[t.className] = [t, t.fromConfig]; + }, e; + }(), + serialization = Object.freeze({ Serializable: Serializable, SerializationMap: SerializationMap }), + WEBGL_ENVS = { HAS_WEBGL: !0 }, + NODE_ENVS = { IS_NODE: !0 }, + CHROME_ENVS = { IS_CHROME: !0 }, + BROWSER_ENVS = { IS_BROWSER: !0 }, + CPU_ENVS = { HAS_WEBGL: !1 }, + ALL_ENVS = {};function expectArraysClose(e, t, n) { + if (null == n && (n = ENV.get("TEST_EPSILON")), e instanceof Tensor || t instanceof Tensor) { + if (e instanceof Tensor && t instanceof Tensor) { + if (e.dtype !== t.dtype) throw new Error("Arrays are of different type actual: " + e.dtype + " vs expected: " + t.dtype + ".");if (!arraysEqual(e.shape, t.shape)) throw new Error("Arrays are of different shape actual: " + e.shape + " vs expected: " + t.shape + "."); + } + } else { + var r = e.constructor.name, + o = t.constructor.name;if (r !== o) throw new Error("Arrays are of different type actual: " + r + " vs expected: " + o); + }var a, i;if (a = e instanceof Tensor ? e.dataSync() : e, i = t instanceof Tensor ? t.dataSync() : t, a.length !== i.length) throw new Error("Arrays have different lengths actual: " + a.length + " vs expected: " + i.length + ".\nActual: " + a + ".\nExpected: " + i + ".");for (var s = 0; s < i.length; ++s) { + var u = a[s], + l = i[s];if (!areClose(u, Number(l), n)) throw new Error("Arrays differ: actual[" + s + "] = " + u + ", expected[" + s + "] = " + l + ".\nActual: " + a + ".\nExpected: " + i + "."); + } + }function expectPromiseToFail(e, t) { + e().then(function () { + return t.fail(); + }, function () { + return t(); + }); + }function expectArraysEqual(e, t) { + return expectArraysClose(e, t, 0); + }function expectNumbersClose(e, t, n) { + if (null == n && (n = ENV.get("TEST_EPSILON")), !areClose(e, t, n)) throw new Error("Numbers differ: actual === " + e + ", expected === " + t); + }function areClose(e, t, n) { + return !(!isNaN(e) || !isNaN(t)) || !(isNaN(e) || isNaN(t) || Math.abs(e - t) > n); + }function expectValuesInRange(e, t, n) { + var r;r = e instanceof Tensor ? e.dataSync() : e;for (var o = 0; o < r.length; o++) if (r[o] < t || r[o] > n) throw new Error("Value out of range:" + r[o] + " low: " + t + ", high: " + n); + }function expectArrayBuffersEqual(e, t) { + expect(new Float32Array(e)).toEqual(new Float32Array(t)); + }var test_util = Object.freeze({ WEBGL_ENVS: WEBGL_ENVS, NODE_ENVS: NODE_ENVS, CHROME_ENVS: CHROME_ENVS, BROWSER_ENVS: BROWSER_ENVS, CPU_ENVS: CPU_ENVS, ALL_ENVS: ALL_ENVS, expectArraysClose: expectArraysClose, expectPromiseToFail: expectPromiseToFail, expectArraysEqual: expectArraysEqual, expectNumbersClose: expectNumbersClose, expectValuesInRange: expectValuesInRange, expectArrayBuffersEqual: expectArrayBuffersEqual }), + version = "0.12.8", + webgl = Object.freeze({ gpgpu_util: gpgpu_util, webgl_util: webgl_util, MathBackendWebGL: MathBackendWebGL, GPGPUContext: GPGPUContext }), + Optimizer = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends(t, e), t.prototype.minimize = function (e, t, n) { + void 0 === t && (t = !1);var r = this.computeGradients(e, n), + o = r.value, + a = r.grads;return this.applyGradients(a), Object.keys(a).forEach(function (e) { + return a[e].dispose(); + }), t ? o : (o.dispose(), null); + }, t.prototype.computeGradients = function (e, t) { + return variableGrads(e, t); + }, t; + }(Serializable), + DEFAULT_FLOAT32_EPSILON = 1e-8, + DEFAULT_FLOAT16_EPSILON = 1e-4;function getOptimizerDefaultEpsilonValue() { + return ENV.get("WEBGL_RENDER_FLOAT32_ENABLED") ? DEFAULT_FLOAT32_EPSILON : DEFAULT_FLOAT16_EPSILON; + }var AdadeltaOptimizer = function (e) { + function t(t, n, r) { + void 0 === r && (r = null);var o = e.call(this) || this;return o.learningRate = t, o.rho = n, o.epsilon = r, o.accumulatedGrads = {}, o.accumulatedUpdates = {}, o.c = keep(scalar(-t)), o.rhoScalar = keep(scalar(n)), o.oneMinusRho = keep(scalar(1 - n)), null === r && (r = getOptimizerDefaultEpsilonValue()), o.epsilonScalar = keep(scalar(r)), o; + }return __extends(t, e), t.prototype.applyGradients = function (e) { + var t = this, + n = function (n) { + var o = ENV.engine.registeredVariables[n];if (null == r.accumulatedGrads[n]) { + tidy(function () { + t.accumulatedGrads[n] = zerosLike(o).variable(!1); + }); + }if (null == r.accumulatedUpdates[n]) { + tidy(function () { + t.accumulatedUpdates[n] = zerosLike(o).variable(!1); + }); + }var a = e[n], + i = r.accumulatedGrads[n], + s = r.accumulatedUpdates[n];tidy(function () { + var e = t.rhoScalar.mul(i).add(t.oneMinusRho.mul(a.square())), + r = s.add(t.epsilonScalar).sqrt().div(i.add(t.epsilonScalar).sqrt()).mul(a), + u = t.rhoScalar.mul(s).add(t.oneMinusRho.mul(r.square()));t.accumulatedGrads[n].assign(e), t.accumulatedUpdates[n].assign(u);var l = t.c.mul(r).add(o);o.assign(l); + }); + }, + r = this;for (var o in e) n(o); + }, t.prototype.dispose = function () { + var e = this;this.c.dispose(), this.epsilonScalar.dispose(), this.rhoScalar.dispose(), this.oneMinusRho.dispose(), null != this.accumulatedUpdates && (Object.keys(this.accumulatedUpdates).forEach(function (t) { + return e.accumulatedUpdates[t].dispose(); + }), Object.keys(this.accumulatedGrads).forEach(function (t) { + return e.accumulatedGrads[t].dispose(); + })); + }, t.prototype.getConfig = function () { + return { learningRate: this.learningRate, rho: this.rho, epsilon: this.epsilon }; + }, t.fromConfig = function (e, t) { + return new e(t.learningRate, t.rho, t.epsilon); + }, t.className = "AdadeltaOptimizer", t; + }(Optimizer);SerializationMap.register(AdadeltaOptimizer);var AdagradOptimizer = function (e) { + function t(t, n) { + void 0 === n && (n = .1);var r = e.call(this) || this;r.learningRate = t, r.initialAccumulatorValue = n, r.accumulatedGrads = {}, r.c = keep(scalar(-t));var o = getOptimizerDefaultEpsilonValue();return r.epsilon = keep(scalar(o)), r; + }return __extends(t, e), t.prototype.applyGradients = function (e) { + var t = this, + n = function (n) { + var o = ENV.engine.registeredVariables[n];if (null == r.accumulatedGrads[n]) { + tidy(function () { + t.accumulatedGrads[n] = fill(o.shape, t.initialAccumulatorValue).variable(!1); + }); + }var a = e[n], + i = r.accumulatedGrads[n];tidy(function () { + var e = i.add(a.square());t.accumulatedGrads[n].assign(e);var r = t.c.mul(a.div(e.add(t.epsilon).sqrt())).add(o);o.assign(r); + }); + }, + r = this;for (var o in e) n(o); + }, t.prototype.dispose = function () { + var e = this;this.epsilon.dispose(), this.c.dispose(), null != this.accumulatedGrads && Object.keys(this.accumulatedGrads).forEach(function (t) { + return e.accumulatedGrads[t].dispose(); + }); + }, t.prototype.getConfig = function () { + return { learningRate: this.learningRate, initialAccumulatorValue: this.initialAccumulatorValue }; + }, t.fromConfig = function (e, t) { + return new e(t.learningRate, t.initialAccumulatorValue); + }, t.className = "AdagradOptimizer", t; + }(Optimizer);SerializationMap.register(AdagradOptimizer);var AdamOptimizer = function (e) { + function t(t, n, r, o) { + void 0 === o && (o = null);var a = e.call(this) || this;return a.learningRate = t, a.beta1 = n, a.beta2 = r, a.epsilon = o, a.accumulatedFirstMoment = {}, a.accumulatedSecondMoment = {}, a.c = keep(scalar(-t)), a.beta1Scalar = keep(scalar(n)), a.beta2Scalar = keep(scalar(r)), tidy(function () { + a.accBeta1 = scalar(n).variable(), a.accBeta2 = scalar(r).variable(); + }), a.oneMinusBeta1 = keep(scalar(1 - n)), a.oneMinusBeta2 = keep(scalar(1 - r)), a.one = keep(scalar(1)), null === o && (o = getOptimizerDefaultEpsilonValue()), a.epsScalar = keep(scalar(o)), a; + }return __extends(t, e), t.prototype.applyGradients = function (e) { + var t = this;tidy(function () { + var n = t.one.sub(t.accBeta1), + r = t.one.sub(t.accBeta2);for (var o in e) { + var a = ENV.engine.registeredVariables[o];if (null == t.accumulatedFirstMoment[o]) { + var i = !1;t.accumulatedFirstMoment[o] = zerosLike(a).variable(i); + }if (null == t.accumulatedSecondMoment[o]) { + i = !1;t.accumulatedSecondMoment[o] = zerosLike(a).variable(i); + }var s = e[o], + u = t.accumulatedFirstMoment[o], + l = t.accumulatedSecondMoment[o], + c = t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)), + p = t.beta2Scalar.mul(l).add(t.oneMinusBeta2.mul(s.square())), + d = c.div(n), + h = p.div(r);t.accumulatedFirstMoment[o].assign(c), t.accumulatedSecondMoment[o].assign(p);var f = t.c.mul(d.div(t.epsScalar.add(h.sqrt()))).add(a);a.assign(f); + }t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar)), t.accBeta2.assign(t.accBeta2.mul(t.beta2Scalar)); + }); + }, t.prototype.dispose = function () { + var e = this;this.c.dispose(), this.epsScalar.dispose(), this.beta1Scalar.dispose(), this.beta2Scalar.dispose(), this.accBeta1.dispose(), this.accBeta2.dispose(), this.oneMinusBeta1.dispose(), this.oneMinusBeta2.dispose(), this.one.dispose(), null != this.accumulatedFirstMoment && Object.keys(this.accumulatedFirstMoment).forEach(function (t) { + return e.accumulatedFirstMoment[t].dispose(); + }), null != this.accumulatedSecondMoment && Object.keys(this.accumulatedSecondMoment).forEach(function (t) { + return e.accumulatedSecondMoment[t].dispose(); + }); + }, t.prototype.getConfig = function () { + return { learningRate: this.learningRate, beta1: this.beta1, beta2: this.beta2, epsilon: this.epsilon }; + }, t.fromConfig = function (e, t) { + return new e(t.learningRate, t.beta1, t.beta2, t.epsilon); + }, t.className = "AdamOptimizer", t; + }(Optimizer);SerializationMap.register(AdamOptimizer);var AdamaxOptimizer = function (e) { + function t(t, n, r, o, a) { + void 0 === o && (o = null), void 0 === a && (a = 0);var i = e.call(this) || this;return i.learningRate = t, i.beta1 = n, i.beta2 = r, i.epsilon = o, i.decay = a, i.accumulatedFirstMoment = {}, i.accumulatedWeightedInfNorm = {}, i.c = keep(scalar(-t)), i.beta1Scalar = keep(scalar(n)), i.beta2Scalar = keep(scalar(r)), i.decayScalar = keep(scalar(a)), tidy(function () { + i.iteration = scalar(0).variable(), i.accBeta1 = scalar(n).variable(); + }), i.oneMinusBeta1 = keep(scalar(1 - n)), i.one = keep(scalar(1)), null === o && (o = getOptimizerDefaultEpsilonValue()), i.epsScalar = keep(scalar(o)), i; + }return __extends(t, e), t.prototype.applyGradients = function (e) { + var t = this;tidy(function () { + var n = t.one.sub(t.accBeta1), + r = t.c.div(t.one.add(t.decayScalar.mul(t.iteration)));for (var o in e) { + var a = ENV.engine.registeredVariables[o];if (null == t.accumulatedFirstMoment[o]) { + var i = !1;t.accumulatedFirstMoment[o] = zerosLike(a).variable(i); + }if (null == t.accumulatedWeightedInfNorm[o]) { + i = !1;t.accumulatedWeightedInfNorm[o] = zerosLike(a).variable(i); + }var s = e[o], + u = t.accumulatedFirstMoment[o], + l = t.accumulatedWeightedInfNorm[o], + c = t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)), + p = t.beta2Scalar.mul(l), + d = s.abs(), + h = p.maximum(d);t.accumulatedFirstMoment[o].assign(c), t.accumulatedWeightedInfNorm[o].assign(h);var f = r.div(n).mul(c.div(t.epsScalar.add(h))).add(a);a.assign(f); + }t.iteration.assign(t.iteration.add(t.one)), t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar)); + }); + }, t.prototype.dispose = function () { + var e = this;this.c.dispose(), this.epsScalar.dispose(), this.accBeta1.dispose(), this.beta1Scalar.dispose(), this.beta2Scalar.dispose(), this.oneMinusBeta1.dispose(), this.decayScalar.dispose(), this.iteration.dispose(), this.one.dispose(), null != this.accumulatedFirstMoment && Object.keys(this.accumulatedFirstMoment).forEach(function (t) { + return e.accumulatedFirstMoment[t].dispose(); + }), null != this.accumulatedWeightedInfNorm && Object.keys(this.accumulatedWeightedInfNorm).forEach(function (t) { + return e.accumulatedWeightedInfNorm[t].dispose(); + }); + }, t.prototype.getConfig = function () { + return { learningRate: this.learningRate, beta1: this.beta1, beta2: this.beta2, epsilon: this.epsilon, decay: this.decay }; + }, t.fromConfig = function (e, t) { + return new e(t.learningRate, t.beta1, t.beta2, t.epsilon, t.decay); + }, t.className = "AdamaxOptimizer", t; + }(Optimizer);SerializationMap.register(AdamaxOptimizer);var SGDOptimizer = function (e) { + function t(t) { + var n = e.call(this) || this;return n.learningRate = t, n.setLearningRate(t), n; + }return __extends(t, e), t.prototype.applyGradients = function (e) { + var t = this;Object.keys(e).forEach(function (n) { + var r = e[n], + o = ENV.engine.registeredVariables[n];tidy(function () { + var e = t.c.mul(r).add(o);o.assign(e); + }); + }); + }, t.prototype.setLearningRate = function (e) { + this.learningRate = e, null != this.c && this.c.dispose(), this.c = keep(scalar(-e)); + }, t.prototype.dispose = function () { + this.c.dispose(); + }, t.prototype.getConfig = function () { + return { learningRate: this.learningRate }; + }, t.fromConfig = function (e, t) { + return new e(t.learningRate); + }, t.className = "SGDOptimizer", t; + }(Optimizer);SerializationMap.register(SGDOptimizer);var MomentumOptimizer = function (e) { + function t(t, n, r) { + void 0 === r && (r = !1);var o = e.call(this, t) || this;return o.learningRate = t, o.momentum = n, o.useNesterov = r, o.m = scalar(o.momentum), o.accumulations = {}, o; + }return __extends(t, e), t.prototype.applyGradients = function (e) { + var t = this, + n = function (n) { + var o = ENV.engine.registeredVariables[n];if (null == r.accumulations[n]) { + tidy(function () { + t.accumulations[n] = zerosLike(o).variable(!1); + }); + }var a = r.accumulations[n], + i = e[n];tidy(function () { + var e, + r = t.m.mul(a).add(i);e = t.useNesterov ? t.c.mul(i.add(r.mul(t.m))).add(o) : t.c.mul(r).add(o), t.accumulations[n].assign(r), o.assign(e); + }); + }, + r = this;for (var o in e) n(o); + }, t.prototype.dispose = function () { + if (e.prototype.dispose.call(this), this.m.dispose(), null != this.accumulations) for (var t in this.accumulations) this.accumulations[t].dispose(); + }, t.prototype.setMomentum = function (e) { + this.momentum = e; + }, t.prototype.getConfig = function () { + return { learningRate: this.learningRate, momentum: this.momentum, useNesterov: this.useNesterov }; + }, t.fromConfig = function (e, t) { + return new e(t.learningRate, t.momentum, t.useNesterov); + }, t.className = "MomentumOptimizer", t; + }(SGDOptimizer);SerializationMap.register(MomentumOptimizer);var RMSPropOptimizer = function (e) { + function t(t, n, r, o, a) { + void 0 === n && (n = .9), void 0 === r && (r = 0), void 0 === o && (o = null), void 0 === a && (a = !1);var i = e.call(this) || this;return i.learningRate = t, i.decay = n, i.momentum = r, i.epsilon = o, i.accumulatedMeanSquares = {}, i.accumulatedMeanGrads = {}, i.accumulatedMoments = {}, i.c = keep(scalar(t)), i.decayScalar = keep(scalar(n)), i.momentumScalar = keep(scalar(r)), i.oneMinusDecay = keep(scalar(1 - n)), i.centered = a, null === o && (o = getOptimizerDefaultEpsilonValue()), i.epsilonScalar = keep(scalar(o)), i; + }return __extends(t, e), t.prototype.applyGradients = function (e) { + var t = this, + n = function (n) { + var o = ENV.engine.registeredVariables[n];if (null == r.accumulatedMeanSquares[n]) { + tidy(function () { + t.accumulatedMeanSquares[n] = zerosLike(o).variable(!1); + }); + }if (null == r.accumulatedMeanGrads[n] && r.centered) { + tidy(function () { + t.accumulatedMeanGrads[n] = zerosLike(o).variable(!1); + }); + }if (null == r.accumulatedMoments[n]) { + tidy(function () { + t.accumulatedMoments[n] = zerosLike(o).variable(!1); + }); + }var a = r.accumulatedMeanSquares[n], + i = r.accumulatedMeanGrads[n], + s = r.accumulatedMoments[n], + u = e[n];tidy(function () { + var e = t.decayScalar.mul(a).add(t.oneMinusDecay.mul(u.square()));if (t.centered) { + var r = t.decayScalar.mul(i).add(t.oneMinusDecay.mul(u)), + l = t.momentumScalar.mul(s).add(t.c.mul(u).div(e.sub(r.square().add(t.epsilonScalar)).sqrt()));t.accumulatedMeanSquares[n].assign(e), t.accumulatedMeanGrads[n].assign(r), t.accumulatedMoments[n].assign(l);var c = o.sub(l);o.assign(c); + } else { + var p = t.decayScalar.mul(a).add(t.oneMinusDecay.mul(u.square()));l = t.momentumScalar.mul(s).add(t.c.mul(u).div(p.add(t.epsilonScalar).sqrt()));t.accumulatedMeanSquares[n].assign(p), t.accumulatedMoments[n].assign(l);c = o.sub(l);o.assign(c); + } + }); + }, + r = this;for (var o in e) n(o); + }, t.prototype.dispose = function () { + var e = this;this.c.dispose(), this.epsilonScalar.dispose(), this.decayScalar.dispose(), this.momentumScalar.dispose(), this.oneMinusDecay.dispose(), null != this.accumulatedMeanSquares && Object.keys(this.accumulatedMeanSquares).forEach(function (t) { + return e.accumulatedMeanSquares[t].dispose(); + }), null != this.accumulatedMeanGrads && this.centered && Object.keys(this.accumulatedMeanGrads).forEach(function (t) { + return e.accumulatedMeanGrads[t].dispose(); + }), null != this.accumulatedMoments && Object.keys(this.accumulatedMoments).forEach(function (t) { + return e.accumulatedMoments[t].dispose(); + }); + }, t.prototype.getConfig = function () { + return { learningRate: this.learningRate, decay: this.decay, momentum: this.momentum, epsilon: this.epsilon, centered: this.centered }; + }, t.fromConfig = function (e, t) { + return new e(t.learningRate, t.decay, t.momentum, t.epsilon, t.centered); + }, t.className = "RMSPropOptimizer", t; + }(Optimizer);SerializationMap.register(RMSPropOptimizer);var OptimizerConstructors = function () { + function e() {}return e.sgd = function (e) { + return new SGDOptimizer(e); + }, e.momentum = function (e, t, n) { + return void 0 === n && (n = !1), new MomentumOptimizer(e, t, n); + }, e.rmsprop = function (e, t, n, r, o) { + return void 0 === t && (t = .9), void 0 === n && (n = 0), void 0 === r && (r = null), void 0 === o && (o = !1), new RMSPropOptimizer(e, t, n, r, o); + }, e.adam = function (e, t, n, r) { + return void 0 === e && (e = .001), void 0 === t && (t = .9), void 0 === n && (n = .999), void 0 === r && (r = null), new AdamOptimizer(e, t, n, r); + }, e.adadelta = function (e, t, n) { + return void 0 === e && (e = .001), void 0 === t && (t = .95), void 0 === n && (n = null), new AdadeltaOptimizer(e, t, n); + }, e.adamax = function (e, t, n, r, o) { + return void 0 === e && (e = .002), void 0 === t && (t = .9), void 0 === n && (n = .999), void 0 === r && (r = null), void 0 === o && (o = 0), new AdamaxOptimizer(e, t, n, r, o); + }, e.adagrad = function (e, t) { + return void 0 === t && (t = .1), new AdagradOptimizer(e, t); + }, e; + }(), + train = { sgd: OptimizerConstructors.sgd, momentum: OptimizerConstructors.momentum, adadelta: OptimizerConstructors.adadelta, adagrad: OptimizerConstructors.adagrad, rmsprop: OptimizerConstructors.rmsprop, adamax: OptimizerConstructors.adamax, adam: OptimizerConstructors.adam }, + setBackend = Environment.setBackend, + getBackend = Environment.getBackend, + disposeVariables = Environment.disposeVariables, + memory = Environment.memory;setOpHandler(ops); + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var extendStatics$1 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (e, t) { + e.__proto__ = t; + } || function (e, t) { + for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); + };function __extends$1(e, t) { + function n() { + this.constructor = e; + }extendStatics$1(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n()); + }var __assign$1 = Object.assign || function (e) { + for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);return e; + };function __awaiter$1(e, t, n, r) { + return new (n || (n = Promise))(function (i, a) { + function o(e) { + try { + l(r.next(e)); + } catch (e) { + a(e); + } + }function s(e) { + try { + l(r.throw(e)); + } catch (e) { + a(e); + } + }function l(e) { + e.done ? i(e.value) : new n(function (t) { + t(e.value); + }).then(o, s); + }l((r = r.apply(e, t || [])).next()); + }); + }function __generator$1(e, t) { + var n, + r, + i, + a, + o = { label: 0, sent: function () { + if (1 & i[0]) throw i[1];return i[1]; + }, trys: [], ops: [] };return a = { next: s(0), throw: s(1), return: s(2) }, "function" == typeof Symbol && (a[Symbol.iterator] = function () { + return this; + }), a;function s(a) { + return function (s) { + return function (a) { + if (n) throw new TypeError("Generator is already executing.");for (; o;) try { + if (n = 1, r && (i = r[2 & a[0] ? "return" : a[0] ? "throw" : "next"]) && !(i = i.call(r, a[1])).done) return i;switch (r = 0, i && (a = [0, i.value]), a[0]) {case 0:case 1: + i = a;break;case 4: + return o.label++, { value: a[1], done: !1 };case 5: + o.label++, r = a[1], a = [0];continue;case 7: + a = o.ops.pop(), o.trys.pop();continue;default: + if (!(i = (i = o.trys).length > 0 && i[i.length - 1]) && (6 === a[0] || 2 === a[0])) { + o = 0;continue; + }if (3 === a[0] && (!i || a[1] > i[0] && a[1] < i[3])) { + o.label = a[1];break; + }if (6 === a[0] && o.label < i[1]) { + o.label = i[1], i = a;break; + }if (i && o.label < i[2]) { + o.label = i[2], o.ops.push(a);break; + }i[2] && o.ops.pop(), o.trys.pop();continue;}a = t.call(e, o); + } catch (e) { + a = [6, e], r = 0; + } finally { + n = i = 0; + }if (5 & a[0]) throw a[1];return { value: a[0] ? a[1] : void 0, done: !0 }; + }([a, s]); + }; + } + }var _epsilon = 1e-7;function epsilon() { + return _epsilon; + }function imageDataFormat() { + return "channelsLast"; + }var _nextUniqueTensorId = 0;function getNextUniqueTensorId() { + return _nextUniqueTensorId++; + }var _uidPrefixes = {};function getUid(e) { + return void 0 === e && (e = ""), e in _uidPrefixes || (_uidPrefixes[e] = 0), _uidPrefixes[e] += 1, e + _uidPrefixes[e].toString(); + }var scalarCache = { float32: {}, int32: {} }, + DEFAULT_DTYPE = "float32";function getScalar(e, t) { + return void 0 === t && (t = DEFAULT_DTYPE), null == scalarCache[t][e] && (scalarCache[t][e] = scalar(e, t), keep(scalarCache[t][e])), scalarCache[t][e]; + }var AttributeError = function (e) { + function t(n) { + var r = e.call(this, n) || this;return Object.setPrototypeOf(r, t.prototype), r; + }return __extends$1(t, e), t; + }(Error), + RuntimeError = function (e) { + function t(n) { + var r = e.call(this, n) || this;return Object.setPrototypeOf(r, t.prototype), r; + }return __extends$1(t, e), t; + }(Error), + ValueError = function (e) { + function t(n) { + var r = e.call(this, n) || this;return Object.setPrototypeOf(r, t.prototype), r; + }return __extends$1(t, e), t; + }(Error), + NotImplementedError = function (e) { + function t(n) { + var r = e.call(this, n) || this;return Object.setPrototypeOf(r, t.prototype), r; + }return __extends$1(t, e), t; + }(Error), + AssertionError = function (e) { + function t(n) { + var r = e.call(this, n) || this;return Object.setPrototypeOf(r, t.prototype), r; + }return __extends$1(t, e), t; + }(Error), + IndexError = function (e) { + function t(n) { + var r = e.call(this, n) || this;return Object.setPrototypeOf(r, t.prototype), r; + }return __extends$1(t, e), t; + }(Error);function pyListRepeat(e, t) { + if (Array.isArray(e)) { + for (var n = [], r = 0; r < t; r++) n = n.concat(e);return n; + }return (n = new Array(t)).fill(e), n; + }function assert$1(e, t) { + if (!e) throw new AssertionError(t); + }function count(e, t) { + for (var n = 0, r = 0, i = e; r < i.length; r++) { + i[r] === t && n++; + }return n; + }function singletonOrArray(e) { + return 1 === e.length ? e[0] : e; + }function toList(e) { + return Array.isArray(e) ? e : [e]; + }function toSnakeCase(e) { + var t = e.replace(/(.)([A-Z][a-z0-9]+)/g, "$1_$2").replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();return "_" !== t[0] ? t : "private" + t; + }function toCamelCase(e) { + return e.length <= 1 ? e : -1 === e.indexOf("_") ? e : e.replace(/[_]+(\w|$)/g, function (e, t) { + return t.toUpperCase(); + }); + }var _GLOBAL_CUSTOM_OBJECTS = {};function serializeKerasObject(e) { + return null === e || void 0 === e ? null : { className: e.getClassName(), config: e.getConfig() }; + }function deserializeKerasObject(e, t, n, r) { + if (void 0 === t && (t = {}), void 0 === n && (n = {}), void 0 === r && (r = "object"), "string" == typeof e) { + var i = e, + a = void 0;if (i in n) a = n[i];else if (i in _GLOBAL_CUSTOM_OBJECTS) a = _GLOBAL_CUSTOM_OBJECTS[i];else if (null == (a = t[i])) throw new ValueError("Unknown " + r + ": " + e);return a; + }var o = e;if (null == o.className || null == o.config) throw new ValueError(r + ": Improper config format: " + JSON.stringify(o) + ".\n'className' and 'config' must set.");var s = o.className, + l = void 0, + u = void 0;if (s in n ? (l = (S = n.get(s))[0], u = S[1]) : s in _GLOBAL_CUSTOM_OBJECTS ? (l = (A = _GLOBAL_CUSTOM_OBJECTS.className)[0], u = A[1]) : s in t && (l = (I = t[s])[0], u = I[1]), null == l) throw new ValueError("Unknown " + r + ": " + s);if (null != u) { + for (var c = {}, p = 0, h = Object.keys(_GLOBAL_CUSTOM_OBJECTS); p < h.length; p++) { + c[v = h[p]] = _GLOBAL_CUSTOM_OBJECTS[v]; + }for (var d = 0, g = Object.keys(n); d < g.length; d++) { + c[v = g[d]] = n[v]; + }o.config.customObjects = c;for (var f = __assign$1({}, _GLOBAL_CUSTOM_OBJECTS), m = 0, y = Object.keys(n); m < y.length; m++) { + var v = y[m];_GLOBAL_CUSTOM_OBJECTS[v] = n[v]; + }var b = u(l, o.config);return _GLOBAL_CUSTOM_OBJECTS = __assign$1({}, f), b; + }f = __assign$1({}, _GLOBAL_CUSTOM_OBJECTS);for (var z = 0, w = Object.keys(n); z < w.length; z++) { + v = w[z];_GLOBAL_CUSTOM_OBJECTS[v] = n[v]; + }var S, A, I;b = new l(o.config);return _GLOBAL_CUSTOM_OBJECTS = __assign$1({}, f), b; + }function numberCompare(e, t) { + return e < t ? -1 : e > t ? 1 : 0; + }function reverseNumberCompare(e, t) { + return -1 * numberCompare(e, t); + }function stringToDType(e) { + switch (e) {case "float32": + return "float32";default: + throw new ValueError("Invalid dtype: " + e);} + }function unique(e) { + if (null == e) return e;for (var t = [], n = 0, r = e; n < r.length; n++) { + var i = r[n];-1 === t.indexOf(i) && t.push(i); + }return t; + }function isObjectEmpty(e) { + if (null == e) throw new ValueError("Invalid value in obj: " + JSON.stringify(e));for (var t in e) if (e.hasOwnProperty(t)) return !1;return !0; + }function checkStringTypeUnionValue(e, t, n) { + if (null != n && e.indexOf(n) < 0) throw new ValueError(n + " is not a valid " + t + ". Valid values are " + e + " or null/undefined."); + }function checkArrayTypeAndLength(e, t, n, r) { + return void 0 === n && (n = 0), void 0 === r && (r = 1 / 0), assert$1(n >= 0), assert$1(r >= n), Array.isArray(e) && e.length >= n && e.length <= r && e.every(function (e) { + return typeof e === t; + }); + }function calcL2Norms(e, t) { + return tidy(function () { + return sqrt(sum(mulStrict(e, e), t, !0)); + }); + }var Constraint = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.getConfig = function () { + return {}; + }, t; + }(serialization.Serializable), + MaxNorm = function (e) { + function t(t) { + var n = e.call(this) || this;return n.defaultMaxValue = 2, n.defaultAxis = 0, n.maxValue = null != t.maxValue ? t.maxValue : n.defaultMaxValue, n.axis = null != t.axis ? t.axis : n.defaultAxis, n; + }return __extends$1(t, e), t.prototype.apply = function (e) { + var t = this;return tidy(function () { + var n = calcL2Norms(e, t.axis), + r = clipByValue(n, 0, t.maxValue);return mul(e, div(r, add(getScalar(epsilon()), n))); + }); + }, t.prototype.getConfig = function () { + return { maxValue: this.maxValue, axis: this.axis }; + }, t.className = "MaxNorm", t; + }(Constraint);serialization.SerializationMap.register(MaxNorm);var UnitNorm = function (e) { + function t(t) { + var n = e.call(this) || this;return n.defaultAxis = 0, n.axis = null != t.axis ? t.axis : n.defaultAxis, n; + }return __extends$1(t, e), t.prototype.apply = function (e) { + var t = this;return tidy(function () { + return div(e, add(getScalar(epsilon()), calcL2Norms(e, t.axis))); + }); + }, t.prototype.getConfig = function () { + return { axis: this.axis }; + }, t.className = "UnitNorm", t; + }(Constraint);serialization.SerializationMap.register(UnitNorm);var NonNeg = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return relu(e); + }, t.className = "NonNeg", t; + }(Constraint);serialization.SerializationMap.register(NonNeg);var MinMaxNorm = function (e) { + function t(t) { + var n = e.call(this) || this;return n.defaultMinValue = 0, n.defaultMaxValue = 1, n.defaultRate = 1, n.defaultAxis = 0, n.minValue = null != t.minValue ? t.minValue : n.defaultMinValue, n.maxValue = null != t.maxValue ? t.maxValue : n.defaultMaxValue, n.rate = null != t.rate ? t.rate : n.defaultRate, n.axis = null != t.axis ? t.axis : n.defaultAxis, n; + }return __extends$1(t, e), t.prototype.apply = function (e) { + var t = this;return tidy(function () { + var n = calcL2Norms(e, t.axis), + r = add(mul(getScalar(t.rate), clipByValue(n, t.minValue, t.maxValue)), mul(getScalar(1 - t.rate), n));return mul(e, div(r, add(getScalar(epsilon()), n))); + }); + }, t.prototype.getConfig = function () { + return { minValue: this.minValue, maxValue: this.maxValue, rate: this.rate, axis: this.axis }; + }, t.className = "MinMaxNorm", t; + }(Constraint);serialization.SerializationMap.register(MinMaxNorm);var CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP = { maxNorm: "MaxNorm", minMaxNorm: "MinMaxNorm", nonNeg: "NonNeg", unitNorm: "UnitNorm" };function serializeConstraint(e) { + return serializeKerasObject(e); + }function deserializeConstraint(e, t) { + return void 0 === t && (t = {}), deserializeKerasObject(e, serialization.SerializationMap.getMap().classNameMap, t, "constraint"); + }function getConstraint(e) { + return null == e ? null : "string" == typeof e ? deserializeConstraint({ className: e in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP ? CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[e] : e, config: {} }) : e instanceof Constraint ? e : deserializeConstraint(e); + }function maxNorm(e) { + return new MaxNorm(e); + }function unitNorm(e) { + return new UnitNorm(e); + }function nonNeg() { + return new NonNeg(); + }function minMaxNorm(e) { + return new MinMaxNorm(e); + }var exports_constraints = Object.freeze({ maxNorm: maxNorm, unitNorm: unitNorm, nonNeg: nonNeg, minMaxNorm: minMaxNorm }), + nameMap = new Map(), + VALID_DATA_FORMAT_VALUES = ["channelsFirst", "channelsLast"];function checkDataFormat(e) { + checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES, "DataFormat", e); + }var VALID_PADDING_MODE_VALUES = ["valid", "same", "causal"];function checkPaddingMode(e) { + checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES, "PaddingMode", e); + }var VALID_POOL_MODE_VALUES = ["max", "avg"];function checkPoolMode(e) { + checkStringTypeUnionValue(VALID_POOL_MODE_VALUES, "PoolMode", e); + }var _nameScopeStack = [], + _nameScopeDivider = "/";function nameScope(e, t) { + _nameScopeStack.push(e);try { + var n = t();return _nameScopeStack.pop(), n; + } catch (e) { + throw _nameScopeStack.pop(), e; + } + }function currentNameScopePrefix() { + return 0 === _nameScopeStack.length ? "" : _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider; + }function getScopedTensorName(e) { + if (!isValidTensorName(e)) throw new Error("Not a valid tensor name: '" + e + "'");return currentNameScopePrefix() + e; + }function getUniqueTensorName(e) { + if (!isValidTensorName(e)) throw new Error("Not a valid tensor name: '" + e + "'");nameMap.has(e) || nameMap.set(e, 0);var t = nameMap.get(e);if (nameMap.set(e, nameMap.get(e) + 1), t > 0) { + var n = e + "_" + t;return nameMap.set(n, 1), n; + }return e; + }var tensorNameRegex = new RegExp(/^[A-Za-z][A-Za-z0-9\._\/]*$/);function isValidTensorName(e) { + return !!e.match(tensorNameRegex); + }function isInteger(e) { + return e === parseInt(e.toString(), 10); + }function arrayProd(e, t, n) { + null == t && (t = 0), null == n && (n = e.length);for (var r = 1, i = t; i < n; ++i) r *= e[i];return r; + }function toArray1D(e) { + return e = Array.isArray(e) ? new Float32Array(e) : e, tensor1d(e); + }function min$1(e) { + return min(toArray1D(e)).dataSync()[0]; + }function max$1(e) { + return max(toArray1D(e)).dataSync()[0]; + }function range$1(e, t) { + if (t < e) throw new ValueError("end (" + t + ") < begin (" + e + ") is forbidden.");for (var n = [], r = e; r < t; ++r) n.push(r);return n; + }function cast$1(e, t) { + return e.asType(t); + }function expandDims$1(e, t) { + void 0 === t && (t = -1);var n = e.shape.slice();return t < 0 && (t = n.length + t + 1), n.splice(t, 0, 1), e.reshape(n); + }function repeat(e, t) { + return tidy(function () { + if (2 !== e.shape.length) throw new ValueError("repeat() expects a rank-2 tensor, but received a rank-" + e.shape.length + " tensor.");return tile$1(expandDims$1(e, 1), [1, t, 1]); + }); + }function flatten$1(e) { + var t = [arrayProd(e.shape)];return e.reshape(t); + }function batchFlatten(e) { + if (e.rank <= 1) throw new ValueError("batchFlatten requires a minimum rank of 2. Got rank: " + e.rank + ".");var t = [e.shape[0], arrayProd(e.shape, 1)];return e.reshape(t); + }function sliceAlongFirstAxis(e, t, n) { + return tidy(function () { + switch (e.rank) {case 1: + return slice1d(e, t, n);case 2: + return slice2d(e, [t, 0], [n, e.shape[1]]);case 3: + return slice3d(e, [t, 0, 0], [n, e.shape[1], e.shape[2]]);case 4: + return slice4d(e, [t, 0, 0, 0], [n, e.shape[1], e.shape[2], e.shape[3]]);default: + throw new ValueError("sliceAlongFirstAxis() received an unsupported tensor rank: " + e.rank);} + }); + }function sliceAlongLastAxis(e, t, n) { + return tidy(function () { + switch (e.rank) {case 1: + return slice1d(e, t, n);case 2: + return slice2d(e, [0, t], [e.shape[0], n]);case 3: + return slice3d(e, [0, 0, t], [e.shape[0], e.shape[1], n]);case 4: + return slice4d(e, [0, 0, 0, t], [e.shape[0], e.shape[1], e.shape[2], n]);default: + throw new ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + e.rank);} + }); + }function sliceAlongAxis(e, t, n, r) { + return tidy(function () { + switch (e.rank) {case 1: + return slice1d(e, t, n);case 2: + switch (r) {case 1: + return sliceAlongFirstAxis(e, t, n);case 2: + return sliceAlongLastAxis(e, t, n);default: + throw new ValueError("The axis is not within the rank of the tensor " + r);}case 3: + switch (r) {case 1: + return sliceAlongFirstAxis(e, t, n);case 2: + return slice3d(e, [0, t, 0], [e.shape[0], n, e.shape[2]]);case 3: + return sliceAlongLastAxis(e, t, n);default: + throw new ValueError("The axis is not within the rank of the tensor " + r);}case 4: + switch (r) {case 1: + return sliceAlongFirstAxis(e, t, n);case 2: + return slice4d(e, [0, t, 0, 0], [e.shape[0], n, e.shape[2], e.shape[3]]);case 3: + return slice4d(e, [0, 0, t, 0], [e.shape[0], e.shape[1], n, e.shape[3]]);case 4: + return sliceAlongLastAxis(e, t, n);default: + throw new ValueError("The axis is not within the rank of the tensor " + r);}default: + throw new ValueError("sliceAlongLastAxis() received an unsupported tensor rank: " + e.rank);} + }); + }function concatenate(e, t) { + var n;return void 0 === t && (t = -1), t < 0 && (t = 0 !== (n = e[0].rank) ? n : 0), t === e[0].rank && (t = -1), concat(e, t); + }function concatAlongFirstAxis(e, t) { + switch (e.rank) {case 1: + return concat1d([e, t]);case 2: + return concat2d([e, t], 0);case 3: + return concat3d([e, t], 0);case 4: + return concat4d([e, t], 0);default: + throw new ValueError("concatAlongFirstAxis() received an unsupported tensor rank: " + e.rank);} + }function tile$1(e, t) { + if (Array.isArray(t) || (t = [t]), e.rank !== t.length) throw new ValueError("The length of input n (" + t.length + ") does not match the number of dimensions in input x (" + e.rank + ")");return tile(e, t); + }function randomNormal$1(e, t, n, r, i) { + return void 0 === t && (t = 0), void 0 === n && (n = 1), randomNormal(e, t, n, r, i); + }function dot$1(e, t) { + if (2 !== t.rank) throw new NotImplementedError("dot support for y other than rank 2 is not yet implemented: y shape = " + t.shape);if (2 === e.rank) return matMul(e, t);if (3 === e.rank) { + var n = e.shape[0], + r = e.shape[1], + i = e.shape[2];return e = e.reshape([n * r, i]), matMul(e, t).reshape([n, r, t.shape[1]]); + }throw new NotImplementedError("dot support for x of rank " + e.rank + " is not yet implemented: x shape = " + e.shape); + }function gather$1(e, t, n) { + return tidy(function () { + return t = Array.isArray(t) ? tensor1d(t, "int32") : t.toInt(), gather(e, t, n); + }); + }function square$1(e) { + return mulStrict(e, e); + }function biasAdd(e, t, n) { + return tidy(function () { + if (null == n && (n = imageDataFormat()), checkDataFormat(n), 1 !== t.rank && t.rank !== e.rank) throw new ValueError("Unexpected bias dimensions: " + t.rank + "; expected it to be 1 or " + e.rank);var r, + i = t.shape;if (5 === e.rank) "channelsFirst" === n ? r = 1 === i.length ? e.add(t.reshape([1, i[0], 1, 1, 1])) : e.add(t.reshape([1, i[3], i[0], i[1], i[2]])) : "channelsLast" === n && (r = 1 === i.length ? e.add(t.reshape([1, 1, 1, 1, i[0]])) : e.add(t.reshape([1].concat(i))));else if (4 === e.rank) "channelsFirst" === n ? r = 1 === i.length ? e.add(t.reshape([1, i[0], 1, 1])) : e.add(t.reshape([1, i[2], i[0], i[1]])) : "channelsLast" === n && (r = 1 === i.length ? e.add(t.reshape([1, 1, 1, i[0]])) : e.add(t.reshape([1].concat(i))));else if (3 === e.rank) "channelsFirst" === n ? r = 1 === i.length ? e.add(t.reshape([1, i[0], 1])) : e.add(t.reshape([1, i[1], i[0]])) : "channelsLast" === n && (r = 1 === i.length ? e.add(t.reshape([1, 1, i[0]])) : e.add(t.reshape([1].concat(i))));else { + if (!(e.rank < 3)) throw new ValueError("Unsupported input rank by biasAdd: " + e.rank);r = e.add(t); + }return r; + }); + }function elu$1(e, t) { + if (void 0 === t && (t = 1), 1 !== t) throw new NotImplementedError("Support for alpha values other than 1 (" + t + ") is not implemented yet.");return elu(e); + }function softsign(e) { + return tidy(function () { + return div(e, add(getScalar(1), abs(e))); + }); + }function dropout(e, t, n, r) { + return tidy(function () { + if (null != n && !util.arraysEqual(e.shape, n)) throw new NotImplementedError("Non-default noise shape is not implemented yet: " + JSON.stringify(n));if (null != r) throw new NotImplementedError("seed is not implemented for dropout yet.");var i = step(add(neg(t), randomUniform(e.shape, 0, 1, "float32")));return i = mul(div(getScalar(1), sub(getScalar(1), t)), i), mul(e, i); + }); + }function hardSigmoid(e) { + return tidy(function () { + var t = add(getScalar(.5), mul(getScalar(.2), e));return clipByValue(t, 0, 1); + }); + }function inTrainPhase(e, t, n) { + return void 0 === n && (n = !1), n ? e() : t(); + }var VALID_FAN_MODE_VALUES = ["fanIn", "fanOut", "fanAvg"];function checkFanMode(e) { + checkStringTypeUnionValue(VALID_FAN_MODE_VALUES, "FanMode", e); + }var VALID_DISTRIBUTION_VALUES = ["normal", "uniform"];function checkDistribution(e) { + checkStringTypeUnionValue(VALID_DISTRIBUTION_VALUES, "Distribution", e); + }var Initializer = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.fromConfigUsesCustomObjects = function () { + return !1; + }, t.prototype.getConfig = function () { + return {}; + }, t; + }(serialization.Serializable), + Zeros = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + return zeros(e, t); + }, t.className = "Zeros", t; + }(Initializer);serialization.SerializationMap.register(Zeros);var Ones = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + return ones$1(e, t); + }, t.className = "Ones", t; + }(Initializer);serialization.SerializationMap.register(Ones);var Constant = function (e) { + function t(t) { + var n = e.call(this) || this;if ("object" != typeof t) throw new ValueError("Expected argument of type ConstantConfig but got " + t);if (void 0 === t.value) throw new ValueError("config must have value set but got " + t);return n.value = t.value, n; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + var n = this;return tidy(function () { + return mul(scalar(n.value), ones$1(e, t)); + }); + }, t.prototype.getConfig = function () { + return { value: this.value }; + }, t.className = "Constant", t; + }(Initializer);serialization.SerializationMap.register(Constant);var RandomUniform = function (e) { + function t(t) { + var n = e.call(this) || this;return n.DEFAULT_MINVAL = -.05, n.DEFAULT_MAXVAL = .05, n.minval = t.minval || n.DEFAULT_MINVAL, n.maxval = t.maxval || n.DEFAULT_MAXVAL, n.seed = t.seed, n; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + return randomUniform(e, this.minval, this.maxval, t); + }, t.prototype.getConfig = function () { + return { minval: this.minval, maxval: this.maxval, seed: this.seed }; + }, t.className = "RandomUniform", t; + }(Initializer);serialization.SerializationMap.register(RandomUniform);var RandomNormal = function (e) { + function t(t) { + var n = e.call(this) || this;return n.DEFAULT_MEAN = 0, n.DEFAULT_STDDEV = .05, n.mean = t.mean || n.DEFAULT_MEAN, n.stddev = t.stddev || n.DEFAULT_STDDEV, n.seed = t.seed, n; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + if ("bool" === t) throw new NotImplementedError("randomNormal does not support dType bool.");return randomNormal$1(e, this.mean, this.stddev, t, this.seed); + }, t.prototype.getConfig = function () { + return { mean: this.mean, stddev: this.stddev, seed: this.seed }; + }, t.className = "RandomNormal", t; + }(Initializer);serialization.SerializationMap.register(RandomNormal);var TruncatedNormal = function (e) { + function t(t) { + var n = e.call(this) || this;return n.DEFAULT_MEAN = 0, n.DEFAULT_STDDEV = .05, n.mean = t.mean || n.DEFAULT_MEAN, n.stddev = t.stddev || n.DEFAULT_STDDEV, n.seed = t.seed, n; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + if ("bool" === t) throw new NotImplementedError("truncatedNormal does not support dType bool.");return truncatedNormal(e, this.mean, this.stddev, t, this.seed); + }, t.prototype.getConfig = function () { + return { mean: this.mean, stddev: this.stddev, seed: this.seed }; + }, t.className = "TruncatedNormal", t; + }(Initializer);serialization.SerializationMap.register(TruncatedNormal);var Identity = function (e) { + function t(t) { + var n = e.call(this) || this;return n.gain = null != t.gain ? scalar(t.gain) : getScalar(1), n; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + var n = this;return tidy(function () { + if (2 !== e.length || e[0] !== e[1]) throw new ValueError("Identity matrix initializer can only be used for 2D square matrices.");return mul(n.gain, eye(e[0])); + }); + }, t.prototype.getConfig = function () { + return { gain: this.gain.get() }; + }, t.className = "Identity", t; + }(Initializer);function computeFans(e, t) { + var n, r;if (void 0 === t && (t = "channelsLast"), checkDataFormat(t), 2 === e.length) n = e[0], r = e[1];else if (-1 !== [3, 4, 5].indexOf(e.length)) { + if ("channelsFirst" === t) { + var i = arrayProd(e, 2);n = e[1] * i, r = e[0] * i; + } else if ("channelsLast" === t) { + i = arrayProd(e, 0, e.length - 2);n = e[e.length - 2] * i, r = e[e.length - 1] * i; + } + } else { + var a = arrayProd(e);n = Math.sqrt(a), r = Math.sqrt(a); + }return [n, r]; + }serialization.SerializationMap.register(Identity);var VarianceScaling = function (e) { + function t(t) { + var n = e.call(this) || this;if (t.scale < 0) throw new ValueError("scale must be a positive float. Got: " + t.scale);return n.scale = null == t.scale ? 1 : t.scale, n.mode = t.mode, checkFanMode(n.mode), n.distribution = t.distribution, checkDistribution(n.distribution), n.seed = t.seed, n; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + var n = computeFans(e), + r = n[0], + i = n[1], + a = this.scale;if ("fanIn" === this.mode ? a /= Math.max(1, r) : "fanOut" === this.mode ? a /= Math.max(1, i) : a /= Math.max(1, (r + i) / 2), "normal" === this.distribution) { + var o = Math.sqrt(a);if ("bool" === t) throw new NotImplementedError(this.getClassName() + " does not support dType bool.");return truncatedNormal(e, 0, o, t, this.seed); + }var s = Math.sqrt(3 * a);return randomUniform(e, -s, s, t); + }, t.prototype.getConfig = function () { + return { scale: this.scale, mode: this.mode, distribution: this.distribution, seed: this.seed }; + }, t.className = "VarianceScaling", t; + }(Initializer);serialization.SerializationMap.register(VarianceScaling);var GlorotUniform = function (e) { + function t(t) { + return e.call(this, { scale: 1, mode: "fanAvg", distribution: "uniform", seed: null == t ? null : t.seed }) || this; + }return __extends$1(t, e), t.prototype.getClassName = function () { + return VarianceScaling.className; + }, t; + }(VarianceScaling), + GlorotNormal = function (e) { + function t(t) { + return e.call(this, { scale: 1, mode: "fanAvg", distribution: "normal", seed: null == t ? null : t.seed }) || this; + }return __extends$1(t, e), t.prototype.getClassName = function () { + return VarianceScaling.className; + }, t; + }(VarianceScaling), + HeNormal = function (e) { + function t(t) { + return e.call(this, { scale: 2, mode: "fanIn", distribution: "normal", seed: null == t ? null : t.seed }) || this; + }return __extends$1(t, e), t.prototype.getClassName = function () { + return VarianceScaling.className; + }, t; + }(VarianceScaling), + LeCunNormal = function (e) { + function t(t) { + return e.call(this, { scale: 1, mode: "fanIn", distribution: "normal", seed: null == t ? null : t.seed }) || this; + }return __extends$1(t, e), t.prototype.getClassName = function () { + return VarianceScaling.className; + }, t; + }(VarianceScaling), + Orthogonal = function (e) { + function t(t) { + var n = e.call(this) || this;if (n.DEFAULT_GAIN = 1, n.gain = null == t.gain ? n.DEFAULT_GAIN : t.gain, n.seed = t.seed, null != n.seed) throw new NotImplementedError("Random seed is not implemented for Orthogonal Initializer yet.");return n; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + var n = this;return tidy(function () { + if (2 !== e.length) throw new NotImplementedError("The Orthogonal Initializer does not support non-2D shapes yet.");e[0] * e[1] > 2e3 && console.warn("Orthogonal initializer is being called on a matrix with more than 2000 (" + e[0] * e[1] + ") elements: Slowness may result.");var t = randomNormal$1(e[0] > e[1] ? [e[1], e[0]] : e, 0, 1, "float32"), + r = linalg_ops.gramSchmidt(t);return e[0] > e[1] && (r = r.transpose()), mul(getScalar(n.gain), r); + }); + }, t.prototype.getConfig = function () { + return { gain: this.gain, seed: this.seed }; + }, t.className = "Orthogonal", t; + }(Initializer);serialization.SerializationMap.register(Orthogonal);var INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { constant: "Constant", glorotNormal: "GlorotNormal", glorotUniform: "GlorotUniform", heNormal: "HeNormal", identity: "Identity", leCunNormal: "LeCunNormal", ones: "Ones", orthogonal: "Orthogonal", randomNormal: "RandomNormal", randomUniform: "RandomUniform", truncatedNormal: "TruncatedNormal", varianceScaling: "VarianceScaling", zeros: "Zeros" };function deserializeInitializer(e, t) { + return void 0 === t && (t = {}), deserializeKerasObject(e, serialization.SerializationMap.getMap().classNameMap, t, "initializer"); + }function serializeInitializer(e) { + return serializeKerasObject(e); + }function getInitializer(e) { + if ("string" == typeof e) { + var t = e in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[e] : e;return "GlorotUniform" === t ? new GlorotUniform() : "GlorotNormal" === t ? new GlorotNormal() : "HeNormal" === t ? new HeNormal() : "LeCunNormal" === t ? new LeCunNormal() : deserializeInitializer({ className: t, config: {} }); + }return e instanceof Initializer ? e : deserializeInitializer(e); + }function zeros$1() { + return new Zeros(); + }function ones$1$1() { + return new Ones(); + }function constant(e) { + return new Constant(e); + }function randomUniform$1(e) { + return new RandomUniform(e); + }function randomNormal$2(e) { + return new RandomNormal(e); + }function truncatedNormal$1(e) { + return new TruncatedNormal(e); + }function identity(e) { + return new Identity(e); + }function varianceScaling(e) { + return new VarianceScaling(e); + }function glorotUniform(e) { + return new GlorotUniform(e); + }function glorotNormal(e) { + return new GlorotNormal(e); + }function heNormal(e) { + return new HeNormal(e); + }function leCunNormal(e) { + return new LeCunNormal(e); + }function orthogonal(e) { + return new Orthogonal(e); + }var exports_initializers = Object.freeze({ zeros: zeros$1, ones: ones$1$1, constant: constant, randomUniform: randomUniform$1, randomNormal: randomNormal$2, truncatedNormal: truncatedNormal$1, identity: identity, varianceScaling: varianceScaling, glorotUniform: glorotUniform, glorotNormal: glorotNormal, heNormal: heNormal, leCunNormal: leCunNormal, orthogonal: orthogonal });function isArrayOfShapes(e) { + return Array.isArray(e) && Array.isArray(e[0]); + }function normalizeShapeList(e) { + return 0 === e.length ? [] : Array.isArray(e[0]) ? e : [e]; + }function getExactlyOneTensor(e) { + var t;if (Array.isArray(e)) { + if (1 !== e.length) throw new ValueError("Expected Tensor length to be 1; got " + e.length);t = e[0]; + } else t = e;return t; + }function getExactlyOneShape(e) { + if (Array.isArray(e) && Array.isArray(e[0])) { + if (1 === e.length) return (e = e)[0];throw new ValueError("Expected exactly 1 Shape; got " + e.length); + }return e; + }function countParamsInWeights(e) { + for (var t = 0, n = 0, r = e; n < r.length; n++) { + var i = r[n];0 === i.shape.length ? t += 1 : t += i.shape.reduce(function (e, t) { + return e * t; + }); + }return t; + }var DEFAULT_VARIABLE_NAME_PREFIX = "Variable", + LayerVariable = function () { + function e(e, t, n, r, i) { + void 0 === t && (t = "float32"), void 0 === n && (n = DEFAULT_VARIABLE_NAME_PREFIX), void 0 === r && (r = !0), void 0 === i && (i = null), this.dtype = null == t ? "float32" : t, this.shape = e.shape, this.id = getNextUniqueTensorId(), n = null == n ? DEFAULT_VARIABLE_NAME_PREFIX : n, this.originalName = getScopedTensorName(n), this.name = getUniqueTensorName(this.originalName), this.trainable = r, this.constraint = i, this.val = variable(e, this.trainable, this.name, this.dtype); + }return e.prototype.read = function () { + return this.val; + }, e.prototype.write = function (e) { + return checkShapesMatch(this.val, e), this.val.assign(e), null != this.constraint && this.val.assign(this.constraint.apply(this.val)), this; + }, e; + }();function checkShapesMatch(e, t) { + if (e.shape.toString() !== t.shape.toString()) throw new Error("Shape mismatch: " + JSON.stringify(e.shape) + " vs. " + JSON.stringify(t.shape)); + }function batchGetValue(e) { + return e.map(function (e) { + return e.read(); + }); + }function batchSetValue(e) { + e.map(function (e) { + e[0].write(e[1]); + }); + }var InputSpec = function () { + return function (e) { + this.dtype = e.dtype, this.shape = e.shape, null != e.shape ? this.ndim = e.shape.length : this.ndim = e.ndim, this.maxNDim = e.maxNDim, this.minNDim = e.minNDim, this.axes = e.axes || {}; + }; + }(), + SymbolicTensor = function () { + return function (e, t, n, r, i, a, o) { + this.dtype = e, this.shape = t, this.sourceLayer = n, this.inputs = r, this.callArgs = i, this.outputTensorIndex = o, this.id = getNextUniqueTensorId(), null != a && (this.originalName = getScopedTensorName(a), this.name = getUniqueTensorName(this.originalName)), this.rank = t.length; + }; + }(), + _nextNodeID = 0, + Node = function () { + function e(e, t) { + this.callArgs = t, this.id = _nextNodeID++, this.outboundLayer = e.outboundLayer, this.inboundLayers = e.inboundLayers, this.nodeIndices = e.nodeIndices, this.tensorIndices = e.tensorIndices, this.inputTensors = e.inputTensors, this.outputTensors = e.outputTensors, this.inputMasks = e.inputMasks, this.outputMasks = e.outputMasks, this.inputShapes = e.inputShapes, this.outputShapes = e.outputShapes;for (var n = 0, r = e.inboundLayers; n < r.length; n++) { + var i = r[n];null != i && i.outboundNodes.push(this); + }e.outboundLayer.inboundNodes.push(this); + }return e.prototype.getConfig = function () { + for (var e = [], t = 0, n = this.inboundLayers; t < n.length; t++) { + var r = n[t];null != r ? e.push(r.name) : e.push(null); + }return { outboundLayer: this.outboundLayer ? this.outboundLayer.name : null, inboundLayers: e, nodeIndices: this.nodeIndices, tensorIndices: this.tensorIndices }; + }, e; + }(), + _nextLayerID = 0, + Layer = function (e) { + function t(t) { + var n = e.call(this) || this;n._callHook = null, n._addedWeightNames = [], n._stateful = !1, n.id = _nextLayerID++, n.activityRegularizer = null, n.inputSpec = null, n.supportsMasking = !1, n._trainableWeights = [], n._nonTrainableWeights = [], n._losses = [], n._updates = [], n._built = !1, n.inboundNodes = [], n.outboundNodes = [];var r = t.name;if (!r) { + var i = n.getClassName();r = toSnakeCase(i) + "_" + getUid(i); + }if (n.name = r, n.trainable = null == t.trainable || t.trainable, n.updatable = null == t.updatable || t.updatable, null != t.inputShape || null != t.batchInputShape) { + var a = void 0;if (null != t.batchInputShape) a = t.batchInputShape;else if (null != t.inputShape) { + var o = null;null != t.batchSize && (o = t.batchSize), a = [o].concat(t.inputShape); + }n.batchInputShape = a;var s = t.dtype;null == s && (s = t.inputDType), null == s && (s = "float32"), n.dtype = s; + }return null != t.weights ? n.initialWeights = t.weights : n.initialWeights = null, n; + }return __extends$1(t, e), t.nodeKey = function (e, t) { + return e.name + "_ib-" + t.toString(); + }, t.prototype.getNodeAtIndex = function (e, t) { + if (0 === this.inboundNodes.length) throw new RuntimeError("The layer has never been called and thus has no defined " + t + ".");if (this.inboundNodes.length <= e) throw new ValueError("Asked to get " + t + " at node " + e + ", but the layer has only " + this.inboundNodes.length + " inbound nodes.");return this.inboundNodes[e]; + }, t.prototype.getInputAt = function (e) { + return singletonOrArray(this.getNodeAtIndex(e, "input").inputTensors); + }, t.prototype.getOutputAt = function (e) { + return singletonOrArray(this.getNodeAtIndex(e, "output").outputTensors); + }, Object.defineProperty(t.prototype, "input", { get: function () { + if (this.inboundNodes.length > 1) throw new AttributeError("Layer " + this.name + ' has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if (0 === this.inboundNodes.length) throw new AttributeError("Layer " + this.name + " is not connected, no input to return.");return singletonOrArray(this.getNodeAtIndex(0, "input").inputTensors); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "output", { get: function () { + if (0 === this.inboundNodes.length) throw new AttributeError("Layer " + this.name + " has no inbound nodes.");if (this.inboundNodes.length > 1) throw new AttributeError("Layer " + this.name + ' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return singletonOrArray(this.getNodeAtIndex(0, "output").outputTensors); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "losses", { get: function () { + return this._losses; + }, enumerable: !0, configurable: !0 }), t.prototype.calculateLosses = function () { + return this.losses.map(function (e) { + return e(); + }); + }, Object.defineProperty(t.prototype, "updates", { get: function () { + return this._updates; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "built", { get: function () { + return this._built; + }, set: function (e) { + this._built = e; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "trainableWeights", { get: function () { + return this.trainable ? this._trainableWeights : []; + }, set: function (e) { + this._trainableWeights = e; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "nonTrainableWeights", { get: function () { + return this.trainable ? this._nonTrainableWeights : this._trainableWeights.concat(this._nonTrainableWeights); + }, set: function (e) { + this._nonTrainableWeights = e; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "weights", { get: function () { + return this.trainableWeights.concat(this.nonTrainableWeights); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "stateful", { get: function () { + return this._stateful; + }, enumerable: !0, configurable: !0 }), t.prototype.assertInputCompatibility = function (e) { + if (e = toList(e), null != this.inputSpec && 0 !== this.inputSpec.length) { + var t = toList(this.inputSpec);if (e.length !== t.length) throw new ValueError("Layer " + this.name + " expects " + t.length + " inputs, but it received " + e.length + " input tensors. Input received: " + e);for (var n = 0; n < e.length; n++) { + var r = e[n], + i = t[n];if (null != i) { + var a = r.rank;if (null != i.ndim && a !== i.ndim) throw new ValueError("Input " + n + " is incompatible with layer " + this.name + ": expected ndim=" + i.ndim + ", found ndim=" + a);if (null != i.maxNDim && a > i.maxNDim) throw new ValueError("Input " + n + " is incompatible with layer " + this.name + ": expected max_ndim=" + i.maxNDim + ", found ndim=" + a);if (null != i.minNDim && a < i.minNDim) throw new ValueError("Input " + n + " is incompatible with layer " + this.name + ": expected min_ndim=" + i.minNDim + ", found ndim=" + a + ".");if (null != i.dtype && r.dtype !== i.dtype) throw new ValueError("Input " + n + " is incompatible with layer " + this.name + " : expected dtype=" + i.dtype + ", found dtype=" + r.dtype + ".");if (i.axes) { + var o = r.shape;for (var s in i.axes) { + var l = Number(s), + u = i.axes[s], + c = l >= 0 ? o[l] : o[o.length + l];if (null != u && -1 === [u, null].indexOf(c)) throw new ValueError("Input " + n + " is incompatible with layer " + this.name + ": expected axis " + l + " of input shape to have value " + u + " but got shape " + o + "."); + } + }if (null != i.shape) for (var p = 0; p < i.shape.length; ++p) { + var h = i.shape[p], + d = r.shape[p];if (null != h && null != d && h !== d) throw new ValueError("Input " + n + " is incompatible with layer " + this.name + ": expected shape=" + i.shape + ", found shape=${xShape}."); + } + } + } + } + }, t.prototype.call = function (e, t) { + return e; + }, t.prototype.invokeCallHook = function (e, t) { + null != this._callHook && this._callHook(e, t); + }, t.prototype.setCallHook = function (e) { + this._callHook = e; + }, t.prototype.clearCallHook = function () { + this._callHook = null; + }, t.prototype.apply = function (e, t) { + var n = this;t = t || {};for (var r = toList(e), i = !0, a = 0, o = r; a < o.length; a++) { + if (!(o[a] instanceof SymbolicTensor)) { + i = !1;break; + } + }for (var s = !0, l = 0, u = r; l < u.length; l++) { + if (u[l] instanceof SymbolicTensor) { + s = !1;break; + } + }if (i === s) throw new ValueError("Arguments to apply() must be all SymbolicTensors or all Tensors");return nameScope(this.name, function () { + if (!n.built) { + n.assertInputCompatibility(e);for (var i = [], a = 0, o = toList(e); a < o.length; a++) { + var l = o[a];i.push(l.shape); + }n.build(singletonOrArray(i)), n.built = !0, n.initialWeights && n.setWeights(n.initialWeights); + }if (n.assertInputCompatibility(e), s) { + for (var u = [], c = 0, p = toList(f = n.call(e, t)); c < p.length; c++) { + var h = p[c];-1 !== r.indexOf(h) && (h = h.clone()), u.push(h); + }if (f = singletonOrArray(u), null != n.activityRegularizer) throw new NotImplementedError("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return f; + }var d = collectInputShape(e), + g = n.computeOutputShape(d), + f = void 0, + m = guessOutputDType(e);if (n.warnOnIncompatibleInputShape(Array.isArray(e) ? d[0] : d), f = null != g && g.length > 0 && Array.isArray(g[0]) ? g.map(function (r, i) { + return new SymbolicTensor(m, r, n, toList(e), t, n.name, i); + }) : new SymbolicTensor(m, g, n, toList(e), t, n.name), n.addInboundNode(e, f, null, null, d, g, t), null != n.activityRegularizer) throw new NotImplementedError("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return f; + }); + }, t.prototype.warnOnIncompatibleInputShape = function (e) { + if (null != this.batchInputShape) if (e.length !== this.batchInputShape.length) console.warn("The rank of the input tensor provided (shape: " + JSON.stringify(e) + ") does not match that of the batchInputShape (" + JSON.stringify(this.batchInputShape) + ") of the layer " + this.name);else { + var t = !1;this.batchInputShape.forEach(function (n, r) { + null != n && null != e[r] && e[r] !== n && (t = !0); + }), t && console.warn("The shape of the input tensor (" + JSON.stringify(e) + ") does not match the expectation of layer " + this.name + ": " + JSON.stringify(this.batchInputShape)); + } + }, Object.defineProperty(t.prototype, "outputShape", { get: function () { + if (null == this.inboundNodes || 0 === this.inboundNodes.length) throw new AttributeError("The layer " + this.name + " has never been called and thus has no defined output shape.");for (var e = [], t = 0, n = this.inboundNodes; t < n.length; t++) { + var r = n[t], + i = JSON.stringify(r.outputShapes);-1 === e.indexOf(i) && e.push(i); + }if (1 === e.length) { + var a = this.inboundNodes[0].outputShapes;return Array.isArray(a) && Array.isArray(a[0]) && 1 === a.length ? a[0] : a; + }throw new AttributeError("The layer " + this.name + ' has multiple inbound nodes with different output shapes. Hence the notion of "outut shape" is ill-defined for the layer.'); + }, enumerable: !0, configurable: !0 }), t.prototype.countParams = function () { + if (!this.built) throw new RuntimeError("You tried to call countParams() on " + this.name + ", but the layer is not built yet. Build it first by calling build(batchInputShape).");return countParamsInWeights(this.weights); + }, t.prototype.build = function (e) { + this.built = !0; + }, t.prototype.getWeights = function (e) { + return void 0 === e && (e = !1), batchGetValue(e ? this.trainableWeights : this.weights); + }, t.prototype.setWeights = function (e) { + var t = this;tidy(function () { + var n = t.weights;if (n.length !== e.length) throw new ValueError('You called setWeights(weights) on layer "' + t.name + '" with a weight list of length ' + e.length + ", but the layer was expecting " + n.length + " weights. Provided weights: " + e + "...");if (0 !== n.length) { + for (var r = [], i = batchGetValue(n), a = 0; a < i.length; ++a) { + var o = i[a], + s = n[a], + l = e[a];if (!util.arraysEqual(o.shape, l.shape)) throw new ValueError("Layer weight shape " + o.shape + " not compatible with provided weight shape " + l.shape);r.push([s, l]); + }batchSetValue(r); + } + }); + }, t.prototype.addWeight = function (e, t, n, r, i, a, o) { + if (-1 !== this._addedWeightNames.indexOf(e)) throw new ValueError("Duplicate weight name " + e + " for layer " + this.name);this._addedWeightNames.push(e), null == n && (n = "float32");var s = new LayerVariable(r.apply(t, n), n, e, a, o);return null != i && this.addLoss(function () { + return i.apply(s.read()); + }), null == a && (a = !0), a ? this._trainableWeights.push(s) : this._nonTrainableWeights.push(s), s; + }, t.prototype.addLoss = function (e) { + var t;null == e || Array.isArray(e) && 0 === e.length || (e = toList(e), void 0 !== this._losses && null !== this._losses && (t = this.losses).push.apply(t, e)); + }, t.prototype.computeOutputShape = function (e) { + return e; + }, t.prototype.computeMask = function (e, t) { + var n = this;if (!this.supportsMasking) { + if (null != t) { + if (!Array.isArray(t)) throw new TypeError("Layer " + this.name + " does not support masking,but was passed an inputMask.");t.forEach(function (e) { + if (null != e) throw new TypeError("Layer " + n.name + " does not support masking,but was passed an inputMask."); + }); + }return null; + }return t; + }, t.prototype.addInboundNode = function (e, t, n, r, i, a, o) { + void 0 === o && (o = null);var s = toList(e);t = toList(t), n = toList(n), r = toList(r), i = normalizeShapeList(i), a = normalizeShapeList(a);for (var l = [], u = [], c = [], p = 0, h = s; p < h.length; p++) { + var d = h[p];l.push(d.sourceLayer), u.push(d.nodeIndex), c.push(d.tensorIndex); + }new Node({ outboundLayer: this, inboundLayers: l, nodeIndices: u, tensorIndices: c, inputTensors: s, outputTensors: t, inputMasks: n, outputMasks: r, inputShapes: i, outputShapes: a }, o);for (var g = 0; g < t.length; g++) t[g].sourceLayer = this, t[g].nodeIndex = this.inboundNodes.length - 1, t[g].tensorIndex = g; + }, t.prototype.getConfig = function () { + var e = { name: this.name, trainable: this.trainable };return null != this.batchInputShape && (e.batchInputShape = this.batchInputShape), null != this.dtype && (e.dtype = this.dtype), e; + }, t; + }(serialization.Serializable);function collectInputShape(e) { + for (var t = [], n = 0, r = e = toList(e); n < r.length; n++) { + var i = r[n];t.push(i.shape); + }return singletonOrArray(t); + }function guessOutputDType(e) { + return "float32"; + }function getSourceInputs(e, t, n) { + if ((null == t || null != n && n > 0) && (t = e.sourceLayer, n = e.nodeIndex), 0 === t.inboundNodes.length) return [e];var r = t.inboundNodes[n];if (0 === r.inboundLayers.length) return r.inputTensors;for (var i = [], a = 0; a < r.inboundLayers.length; a++) for (var o = 0, s = getSourceInputs(r.inputTensors[a], r.inboundLayers[a], r.nodeIndices[a]); o < s.length; o++) { + var l = s[o];-1 === i.indexOf(l) && i.push(l); + }return i; + }var InputLayer = function (e) { + function t(t) { + var n = e.call(this, { dtype: t.dtype, name: null != t.name ? t.name : getUid("input").toString() }) || this;if (null == t.batchSize && (t.batchSize = null), null == t.sparse && (t.sparse = !1), n.trainable = !1, n.built = !0, n.sparse = t.sparse, null != t.inputShape && null != t.batchInputShape) throw new ValueError("Only provide the inputShape OR batchInputShape argument to inputLayer, not both at the same time.");var r = t.batchInputShape;if (null == r) { + if (null == t.inputShape) throw new ValueError("An InputLayer should be passed either a `batchInputShape` or an `inputShape`.");r = [t.batchSize].concat(t.inputShape); + } else if (null != t.batchSize) throw new ValueError("Cannot specify batchSize if batchInputShape isspecified when creating an InputLayer.");var i = t.dtype || "float32";n.batchInputShape = r, n.dtype = i, n.inputSpec = [{ shape: r }];var a = new SymbolicTensor(n.dtype, n.batchInputShape, n, [], {}, n.name);return a.nodeIndex = 0, a.tensorIndex = 0, new Node({ outboundLayer: n, inboundLayers: [], nodeIndices: [], tensorIndices: [], inputTensors: [a], outputTensors: [a], inputMasks: [null], outputMasks: [null], inputShapes: [r], outputShapes: [r] }), n; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + throw new ValueError("Cannot pass any input to an InputLayer's apply() method. InputLayer name: " + this.name); + }, t.prototype.getConfig = function () { + return { batchInputShape: this.batchInputShape, dtype: this.dtype, sparse: this.sparse, name: this.name }; + }, t.className = "InputLayer", t; + }(Layer);function Input(e) { + if (null == e.batchShape && null == e.shape) throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension.");if (null != e.batchShape && null != e.shape) throw new ValueError("Please provide either a `shape` or `batchShape` argument to Input, but not both.");var t = e.batchShape;null != e.shape && null == t && (t = [null].concat(e.shape));var n = e.dtype;return null == n && (n = "float32"), new InputLayer({ batchInputShape: t, name: e.name, dtype: n, sparse: e.sparse }).inboundNodes[0].outputTensors[0]; + }function resolveScalarsInLogs(e) { + return __awaiter$1(this, void 0, void 0, function () { + var t, n, r, i, a, o, s, l;return __generator$1(this, function (u) { + switch (u.label) {case 0: + if (null == e) return [2];for (i in t = [], n = [], r = [], e) "number" != typeof (a = e[i]) && (o = a, t.push(o.data()), n.push(i), r.push(o));return [4, Promise.all(t)];case 1: + for (s = u.sent(), l = 0; l < s.length; ++l) e[n[l]] = s[l][0];return dispose(r), [2];} + }); + }); + }function disposeTensorsInLogs(e) { + if (null != e) for (var t in e) { + var n = e[t];"number" != typeof n && n.dispose(); + } + }serialization.SerializationMap.register(InputLayer);var BaseCallback = function () { + function e() { + this.validationData = null; + }return e.prototype.setParams = function (e) { + this.params = e; + }, e.prototype.onEpochBegin = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (e) { + return [2]; + }); + }); + }, e.prototype.onEpochEnd = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (e) { + return [2]; + }); + }); + }, e.prototype.onBatchBegin = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (e) { + return [2]; + }); + }); + }, e.prototype.onBatchEnd = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (e) { + return [2]; + }); + }); + }, e.prototype.onTrainBegin = function (e) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (e) { + return [2]; + }); + }); + }, e.prototype.onTrainEnd = function (e) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (e) { + return [2]; + }); + }); + }, e.prototype.setModel = function (e) {}, e; + }(), + CallbackList = function () { + function e(e, t) { + void 0 === t && (t = 10), null == e && (e = []), this.callbacks = e, this.queueLength = t; + }return e.prototype.append = function (e) { + this.callbacks.push(e); + }, e.prototype.setParams = function (e) { + for (var t = 0, n = this.callbacks; t < n.length; t++) { + n[t].setParams(e); + } + }, e.prototype.setModel = function (e) { + for (var t = 0, n = this.callbacks; t < n.length; t++) { + n[t].setModel(e); + } + }, e.prototype.onEpochBegin = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + var n, r;return __generator$1(this, function (i) { + switch (i.label) {case 0: + null == t && (t = {}), n = 0, r = this.callbacks, i.label = 1;case 1: + return n < r.length ? [4, r[n].onEpochBegin(e, t)] : [3, 4];case 2: + i.sent(), i.label = 3;case 3: + return n++, [3, 1];case 4: + return [2];} + }); + }); + }, e.prototype.onEpochEnd = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + var n, r;return __generator$1(this, function (i) { + switch (i.label) {case 0: + null == t && (t = {}), n = 0, r = this.callbacks, i.label = 1;case 1: + return n < r.length ? [4, r[n].onEpochEnd(e, t)] : [3, 4];case 2: + i.sent(), i.label = 3;case 3: + return n++, [3, 1];case 4: + return [2];} + }); + }); + }, e.prototype.onBatchBegin = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + var n, r;return __generator$1(this, function (i) { + switch (i.label) {case 0: + null == t && (t = {}), n = 0, r = this.callbacks, i.label = 1;case 1: + return n < r.length ? [4, r[n].onBatchBegin(e, t)] : [3, 4];case 2: + i.sent(), i.label = 3;case 3: + return n++, [3, 1];case 4: + return [2];} + }); + }); + }, e.prototype.onBatchEnd = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + var n, r;return __generator$1(this, function (i) { + switch (i.label) {case 0: + null == t && (t = {}), n = 0, r = this.callbacks, i.label = 1;case 1: + return n < r.length ? [4, r[n].onBatchEnd(e, t)] : [3, 4];case 2: + i.sent(), i.label = 3;case 3: + return n++, [3, 1];case 4: + return [2];} + }); + }); + }, e.prototype.onTrainBegin = function (e) { + return __awaiter$1(this, void 0, void 0, function () { + var t, n;return __generator$1(this, function (r) { + switch (r.label) {case 0: + null == e && (e = {}), t = 0, n = this.callbacks, r.label = 1;case 1: + return t < n.length ? [4, n[t].onTrainBegin(e)] : [3, 4];case 2: + r.sent(), r.label = 3;case 3: + return t++, [3, 1];case 4: + return [2];} + }); + }); + }, e.prototype.onTrainEnd = function (e) { + return __awaiter$1(this, void 0, void 0, function () { + var t, n;return __generator$1(this, function (r) { + switch (r.label) {case 0: + null == e && (e = {}), t = 0, n = this.callbacks, r.label = 1;case 1: + return t < n.length ? [4, n[t].onTrainEnd(e)] : [3, 4];case 2: + r.sent(), r.label = 3;case 3: + return t++, [3, 1];case 4: + return [2];} + }); + }); + }, e; + }(), + BaseLogger = function (e) { + function t() { + return e.call(this) || this; + }return __extends$1(t, e), t.prototype.onEpochBegin = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (e) { + return this.seen = 0, this.totals = {}, [2]; + }); + }); + }, t.prototype.onBatchEnd = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + var e, + n, + r, + i, + a = this;return __generator$1(this, function (o) { + for (i in null == t && (t = {}), e = null == t.size ? 0 : t.size, this.seen += e, n = function (n) { + var i = t[n];if ("number" == typeof i) r.totals.hasOwnProperty(n) || (r.totals[n] = 0), r.totals[n] = r.totals[n] + i * e;else { + var o = void 0;n in r.totals ? o = r.totals[n] : r.totals[n] = getScalar(0), r.totals[n] = tidy(function () { + return add(a.totals[n], mul(i, getScalar(e))); + }), null != o && o.dispose(); + } + }, r = this, t) n(i);return [2]; + }); + }); + }, t.prototype.onEpochEnd = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + var e, + n, + r, + i, + a, + o = this;return __generator$1(this, function (s) { + if (null != t) for (e = function (e) { + if (null == n.totals[e]) return "continue";"number" == typeof n.totals[e] ? t[e] = n.totals[e] / n.seen : tidy(function () { + t[e] = mul(div(getScalar(1), getScalar(o.seen)), o.totals[e]), o.totals[e].dispose(), keep(t[e]); + }); + }, n = this, r = 0, i = this.params.metrics; r < i.length; r++) a = i[r], e(a);return [2]; + }); + }); + }, t; + }(BaseCallback), + History = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.onTrainBegin = function (e) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (e) { + return this.epoch = [], this.history = {}, [2]; + }); + }); + }, t.prototype.onEpochEnd = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + var n;return __generator$1(this, function (r) { + for (n in null == t && (t = {}), this.epoch.push(e), t) null == this.history[n] && (this.history[n] = []), this.history[n].push(t[n]);return [2]; + }); + }); + }, t.prototype.syncData = function () { + return __awaiter$1(this, void 0, void 0, function () { + var e, t, n, r, i, a, o, s, l;return __generator$1(this, function (u) { + switch (u.label) {case 0: + for (r in e = [], t = [], n = [], this.history) for (i = this.history[r], a = 0; a < i.length; ++a) "number" != typeof i[a] && (o = i[a], e.push(o.data()), t.push(r), n.push(a));return [4, Promise.all(e)];case 1: + for (s = u.sent(), l = 0; l < s.length; ++l) this.history[t[l]][n[l]].dispose(), this.history[t[l]][n[l]] = s[l][0];return [2];} + }); + }); + }, t; + }(BaseCallback), + CustomCallback = function (e) { + function t(t) { + var n = e.call(this) || this;return n.trainBegin = t.onTrainBegin, n.trainEnd = t.onTrainEnd, n.epochBegin = t.onEpochBegin, n.epochEnd = t.onEpochEnd, n.batchBegin = t.onBatchBegin, n.batchEnd = t.onBatchEnd, n; + }return __extends$1(t, e), t.prototype.onEpochBegin = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (n) { + switch (n.label) {case 0: + return null == this.epochBegin ? [3, 3] : [4, resolveScalarsInLogs(t)];case 1: + return n.sent(), [4, this.epochBegin(e, t)];case 2: + n.sent(), n.label = 3;case 3: + return [2];} + }); + }); + }, t.prototype.onEpochEnd = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (n) { + switch (n.label) {case 0: + return null == this.epochEnd ? [3, 3] : [4, resolveScalarsInLogs(t)];case 1: + return n.sent(), [4, this.epochEnd(e, t)];case 2: + n.sent(), n.label = 3;case 3: + return [2];} + }); + }); + }, t.prototype.onBatchBegin = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (n) { + switch (n.label) {case 0: + return null == this.batchBegin ? [3, 3] : [4, resolveScalarsInLogs(t)];case 1: + return n.sent(), [4, this.batchBegin(e, t)];case 2: + n.sent(), n.label = 3;case 3: + return [2];} + }); + }); + }, t.prototype.onBatchEnd = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (n) { + switch (n.label) {case 0: + return null == this.batchEnd ? [3, 3] : [4, resolveScalarsInLogs(t)];case 1: + return n.sent(), [4, this.batchEnd(e, t)];case 2: + n.sent(), n.label = 3;case 3: + return [2];} + }); + }); + }, t.prototype.onTrainBegin = function (e) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (t) { + switch (t.label) {case 0: + return null == this.trainBegin ? [3, 3] : [4, resolveScalarsInLogs(e)];case 1: + return t.sent(), [4, this.trainBegin(e)];case 2: + t.sent(), t.label = 3;case 3: + return [2];} + }); + }); + }, t.prototype.onTrainEnd = function (e) { + return __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (t) { + switch (t.label) {case 0: + return null == this.trainEnd ? [3, 3] : [4, resolveScalarsInLogs(e)];case 1: + return t.sent(), [4, this.trainEnd(e)];case 2: + t.sent(), t.label = 3;case 3: + return [2];} + }); + }); + }, t; + }(BaseCallback);function standardizeCallbacks(e) { + return null == e ? null : e instanceof BaseCallback ? [e] : Array.isArray(e) && e[0] instanceof BaseCallback ? e : toList(e).map(function (e) { + return new CustomCallback(e); + }); + }function l2Normalize(e, t) { + return tidy(function () { + var n = sum(square$1(e), t, !0), + r = mul(scalar(epsilon()), onesLike(e)), + i = sqrt(maximum(n, r));return div(e, i); + }); + }function meanSquaredError$1(e, t) { + return tidy(function () { + return mean(square$1(sub(t, e)), -1); + }); + }function meanAbsoluteError(e, t) { + return tidy(function () { + return mean(abs(sub(t, e)), -1); + }); + }function meanAbsolutePercentageError(e, t) { + return tidy(function () { + var n = sub(e, t), + r = clipByValue(abs(e), epsilon(), Number.MAX_VALUE), + i = abs(div(n, r));return mul(getScalar(100), mean(i, -1)); + }); + }function meanSquaredLogarithmicError(e, t) { + return tidy(function () { + var n = getScalar(1), + r = clipByValue(t, epsilon(), Number.MAX_VALUE), + i = log$1(add(n, r)), + a = clipByValue(e, epsilon(), Number.MAX_VALUE), + o = log$1(add(n, a));return mean(square$1(sub(i, o)), -1); + }); + }function squaredHinge(e, t) { + return tidy(function () { + var n = getScalar(0), + r = getScalar(1), + i = maximum(n, sub(r, mul(e, t)));return mean(square$1(i), -1); + }); + }function hinge(e, t) { + return tidy(function () { + var n = getScalar(0), + r = getScalar(1), + i = maximum(n, sub(r, mul(e, t)));return mean(i, -1); + }); + }function categoricalHinge(e, t) { + return tidy(function () { + var n = getScalar(0), + r = getScalar(1), + i = sum(mul(e, t), -1), + a = max(mul(sub(r, e), t), -1);return maximum(n, add(r, sub(a, i))); + }); + }function logcosh(e, t) { + return tidy(function () { + var n = getScalar(Math.log(2)), + r = sub(t, e), + i = sub(add(r, softplus(mul(getScalar(-2), r))), n);return mean(i, -1); + }); + }function categoricalCrossentropy(e, t, n) { + return void 0 === n && (n = !1), tidy(function () { + if (n) t = softmax(t);else { + var r = sum(t, t.shape.length - 1, !0);t = div(t, r); + }return t = clipByValue(t, epsilon(), 1 - epsilon()), neg(sum(mul(e.toFloat(), log$1(t)), t.shape.length - 1)); + }); + }function sparseCategoricalCrossentropy(e, t, n) { + return void 0 === n && (n = !1), tidy(function () { + var r = floor(flatten$1(e)).toInt(), + i = t.shape;return categoricalCrossentropy(oneHot(r, i[i.length - 1]).reshape(i), t, n); + }); + }function sigmoidCrossEntropyWithLogits(e, t) { + return tidy(function () { + var n = maximum(t, zerosLike(t)), + r = mul(t, e), + i = log$1(add(getScalar(1), exp(neg(abs(t)))));return add(sub(n, r), i); + }); + }function binaryCrossentropy(e, t) { + return tidy(function () { + var n;return n = clipByValue(t, epsilon(), 1 - epsilon()), n = log$1(div(n, sub(onesLike(n), n))), mean(sigmoidCrossEntropyWithLogits(e, n), -1); + }); + }function kullbackLeiblerDivergence(e, t) { + return tidy(function () { + var n = clipByValue(e, epsilon(), 1), + r = clipByValue(t, epsilon(), 1);return sum(mul(e, log$1(div(n, r))), -1); + }); + }function poisson(e, t) { + return tidy(function () { + var n = log$1(add(getScalar(epsilon()), t));return mean(sub(t, mul(e, n)), -1); + }); + }function cosineProximity(e, t) { + return tidy(function () { + var n = l2Normalize(e, -1), + r = l2Normalize(t, -1), + i = mul(n, r);return neg(sum(i, -1)); + }); + }function get(e) { + var t = { meanSquaredError: meanSquaredError$1, meanAbsoluteError: meanAbsoluteError, meanAbsolutePercentageError: meanAbsolutePercentageError, meanSquaredLogarithmicError: meanSquaredLogarithmicError, squaredHinge: squaredHinge, hinge: hinge, categoricalHinge: categoricalHinge, logcosh: logcosh, categoricalCrossentropy: categoricalCrossentropy, sparseCategoricalCrossentropy: sparseCategoricalCrossentropy, binaryCrossentropy: binaryCrossentropy, kullbackLeiblerDivergence: kullbackLeiblerDivergence, poisson: poisson, cosineProximity: cosineProximity };if ("string" == typeof e) { + if (e in t) return t[e];throw new ValueError("Unknown loss " + e); + }return e; + }function binaryAccuracy(e, t) { + return tidy(function () { + var n = mul(getScalar(.5), onesLike(t)), + r = cast$1(greater(t, n), e.dtype);return mean(equal(e, r), -1); + }); + }function categoricalAccuracy(e, t) { + return tidy(function () { + return cast$1(equal(argMax(e, -1), argMax(t, -1)), "float32"); + }); + }function binaryCrossentropy$1(e, t) { + return binaryCrossentropy(e, t); + }function sparseCategoricalAccuracy(e, t) { + throw new NotImplementedError(); + }var mse$1 = meanSquaredError$1, + MSE$1 = meanSquaredError$1, + mae$1 = meanAbsoluteError, + MAE$1 = meanAbsoluteError, + mape$1 = meanAbsolutePercentageError, + MAPE$1 = meanAbsolutePercentageError, + categoricalCrossentropy$1 = categoricalCrossentropy, + cosine$1 = cosineProximity, + sparseCategoricalCrossentropy$1 = sparseCategoricalCrossentropy;function get$1(e) { + var t = { binaryAccuracy: binaryAccuracy, categoricalAccuracy: categoricalAccuracy, categoricalCrossentropy: categoricalCrossentropy$1, sparseCategoricalCrossentropy: sparseCategoricalCrossentropy$1, mse: mse$1, MSE: MSE$1, mae: mae$1, MAE: MAE$1, mape: mape$1, MAPE: MAPE$1, cosine: cosine$1 };if ("string" == typeof e && e in t) return t[e];if ("string" != typeof e && null != e) return e;throw new ValueError("Unknown metric " + e); + }function getOptimizer(e) { + var t = { Adagrad: function () { + return train.adagrad(.01); + }, Adadelta: function () { + return train.adadelta(1, .95, epsilon()); + }, Adam: function () { + return train.adam(.001, .9, .999, epsilon()); + }, Adamax: function () { + return train.adamax(.002, .9, .999, epsilon(), 0); + }, RMSProp: function () { + return train.rmsprop(.001, .9, 0, epsilon()); + }, SGD: function () { + return train.sgd(.01); + } };if (t.adagrad = t.Adagrad, t.adadelta = t.Adadelta, t.adam = t.Adam, t.adamax = t.Adamax, t.rmsprop = t.RMSProp, t.sgd = t.SGD, e in t) return t[e]();throw new ValueError("Unknown Optimizer " + e); + }function printSummary(e, t, n, r) { + void 0 === r && (r = console.log);var i, + a = isModelSequentialLike(e), + o = ["Layer (type)", "Output shape", "Param #"];if (a ? (t = t || 65, n = n || [.45, .85, 1]) : (t = t || 98, n = n || [.33, .55, .67, 1]), n[n.length - 1] <= 1 && (n = n.map(function (e) { + return Math.floor(t * e); + })), !a) for (var s in o.push("Receives inputs"), i = [], e.nodesByDepth) i.push.apply(i, e.nodesByDepth[s]);r("_".repeat(t)), printRow(o, n, r), r("=".repeat(t));for (var l, u = e.layers, c = 0; c < u.length; ++c) a ? printLayerSummary(u[c], n, r) : printLayerSummaryWithConnections(u[c], n, i, r), r((c === u.length - 1 ? "=" : "_").repeat(t));e.checkTrainableWeightsConsistency(), l = null != e.collectedTrainableWeights ? countParamsInWeights(e.collectedTrainableWeights) : countParamsInWeights(e.trainableWeights);var p = countParamsInWeights(e.nonTrainableWeights);r("Total params: " + (l + p)), r("Trainable params: " + l), r("Non-trainable params: " + p), r("_".repeat(t)); + }function isModelSequentialLike(e) { + var t = !0, + n = [], + r = [];for (var i in e.nodesByDepth) n.push(e.nodesByDepth[i]);for (var a = 0, o = n; a < o.length; a++) { + var s = o[a];if (s.length > 1 || 1 === s.length && s[0].inboundLayers.length > 1) { + t = !1;break; + }r.push.apply(r, s); + }if (t) for (var l = 0, u = e.layers; l < u.length; l++) { + for (var c = !1, p = 0, h = u[l].inboundNodes; p < h.length; p++) { + var d = h[p];if (-1 !== r.indexOf(d)) { + if (c) { + t = !1;break; + }c = !0; + } + }if (!t) break; + }return t; + }function printRow(e, t, n) { + void 0 === n && (n = console.log);for (var r = "", i = 0; i < e.length; ++i) i > 0 && (r = r.slice(0, r.length - 1) + " "), r = (r += e[i]).slice(0, t[i]), r += " ".repeat(t[i] - r.length);n(r); + }function printLayerSummary(e, t, n) { + var r;try { + r = JSON.stringify(e.outputShape); + } catch (e) { + r = "multiple"; + }printRow([e.name + " (" + e.getClassName() + ")", r, e.countParams().toString()], t, n); + }function printLayerSummaryWithConnections(e, t, n, r) { + var i;try { + i = JSON.stringify(e.outputShape); + } catch (e) { + i = "multiple"; + }for (var a = [], o = 0, s = e.inboundNodes; o < s.length; o++) { + var l = s[o];if (!(null != n && n.length > 0 && -1 === n.indexOf(l))) for (var u = 0; u < l.inboundLayers.length; ++u) { + var c = l.inboundLayers[u].name, + p = l.nodeIndices[u], + h = l.tensorIndices[u];a.push(c + "[" + p + "][" + h + "]"); + } + }var d = e.name, + g = e.getClassName(), + f = 0 === a.length ? "" : a[0];printRow([d + " (" + g + ")", i, e.countParams().toString(), f], t, r);for (u = 1; u < a.length; ++u) printRow(["", "", "", a[u]], t, r); + }function deserialize(e, t) { + return void 0 === t && (t = {}), deserializeKerasObject(e, serialization.SerializationMap.getMap().classNameMap, t, "layer"); + }function isArrayItemInputOrOutputName(e, t, n) { + return ("inboundNodes" === e || "outputLayers" === e || "inputLayers" === e) && 0 === t && "string" == typeof n; + }function convertPythonicToTs(e, t) { + if (null === e) return null;if ("string" == typeof e) return toCamelCase(e);if ("number" == typeof e || "boolean" == typeof e) return e;if (e instanceof Array) { + for (var n = [], r = e.length, i = 0; i < r; ++i) { + var a = e[i];isArrayItemInputOrOutputName(t, i, a) ? n.push(a) : n.push(convertPythonicToTs(a, t)); + }return n; + }for (var o = {}, s = 0, l = Object.keys(e); s < l.length; s++) { + var u = l[s], + c = e[u];if ("name" === u && "string" == typeof c) o[u] = c;else { + var p = toCamelCase(u);o[p] = convertPythonicToTs(c, p); + } + }return o; + }function convertTsToPythonic(e, t) { + if (null === e || void 0 === e) return null;if ("string" == typeof e) return toSnakeCase(e);if ("number" == typeof e || "boolean" == typeof e) return e;if (e instanceof Array) { + for (var n = [], r = e.length, i = 0; i < r; ++i) { + var a = e[i];isArrayItemInputOrOutputName(t, i, a) ? n.push(a) : n.push(convertTsToPythonic(a, t)); + }return n; + }for (var o = {}, s = 0, l = Object.keys(e); s < l.length; s++) { + var u = l[s], + c = e[u], + p = toSnakeCase(u);o[p] = "name" !== u && "className" !== u || "string" != typeof c ? convertTsToPythonic(c, u) : c; + }return o; + }var version$1 = "0.7.2";function preprocessWeightsForLoading(e, t, n, r) { + if (!n.startsWith("2.")) throw new ValueError("Unsupported Keras version in weights being loaded: " + n);return t; + }function loadTensor(e, t, n) { + var r = stringToDType(e);return Tensor.make(t, { values: 0 === t.length ? n : util.flatten(n) }, r); + }function loadWeightsFromJson(e, t, n) { + void 0 === n && (n = !1);for (var r = e.keras_version, i = e.backend, a = t.map(function (e) { + return e.name; + }), o = {}, s = 0, l = t; s < l.length; s++) { + null != (b = l[s]).name && (null == o[b.name] && (o[b.name] = []), o[b.name].push(b)); + }for (var u = e.weights, c = [], p = 0; p < a.length; ++p) { + var h = a[p], + d = u[h];null == d && (d = []);for (var g = [], f = 0; f < d.length; ++f) { + var m = d[f];g.push(new LayerVariable(loadTensor(m.dtype, m.shape, m.value))); + }for (var y = 0, v = o[h]; y < v.length; y++) { + var b, + z = (b = v[y]).weights;if ((g = preprocessWeightsForLoading(b, g, r, i)).length !== z.length) { + if (!n) throw new ValueError("Layer #" + p + ' (named "' + b.name + '") expects ' + z.length + " weight(s), but the saved weights have " + g.length + " element(s).");console.warn("Skipping loading of weights of layer " + b.name + " due to mismatch in number of weights: (" + g.length + " vs " + z.length + ")."); + }for (var w = 0; w < g.length; ++w) !n || util.arraysEqual(z[w].shape, g[w].shape) ? c.push([z[w], g[w].read()]) : console.warn("Skipping loading of weights for layer " + b.name + " due to mismatch in shape (" + z[w].shape + " vs " + g[w].shape + ")"); + } + }batchSetValue(c); + }function loadWeightsFromNamedTensorMap(e, t) { + for (var n = {}, r = 0, i = 0, a = t; i < a.length; i++) for (var o = 0, s = a[i].weights; o < s.length; o++) { + var l = s[o];if (null != n[l.originalName]) throw new ValueError("Duplicate weight name: " + l.originalName);n[l.originalName] = l, r++; + }var u = [];for (var c in e) u.push([n[c], e[c]]), delete n[c];var p = [];for (var h in n) p.push(h);if (p.length > 0) throw new ValueError(p.length + " of " + r + " weights are not set: " + p);batchSetValue(u); + }var Container = function (e) { + function t(n) { + var r = e.call(this, {}) || this;if (r.containerNodes = new Set(), r.name = n.name, null == r.name) { + var i = r.getClassName().toLowerCase();r.name = getUid(i); + }if (r.supportsMasking = !1, r.trainable = !0, r.updatable = !0, Array.isArray(n.inputs) ? r.inputs = n.inputs.slice() : r.inputs = [n.inputs], Array.isArray(n.outputs) ? r.outputs = n.outputs.slice() : r.outputs = [n.outputs], unique(r.inputs).length !== r.inputs.length) throw new ValueError("The list of inputs passed to the model is redundant. All inputs should only appear once. Found: " + r.inputs.map(function (e) { + return e.name; + }));unique(r.outputs).length !== r.outputs.length && console.warn("The list of outputs passed to the model is redundant. All outputs should only appear once. Found: " + r.outputs.map(function (e) { + return e.name; + })), r.inputLayers = [], r.inputLayersNodeIndices = [], r.inputLayersTensorIndices = [], r.outputLayers = [], r.outputLayersNodeIndices = [], r.outputLayersTensorIndices = [], r.layers = [];for (var a = 0, o = r.outputs; a < o.length; a++) { + var s = (E = o[a]).sourceLayer, + l = E.nodeIndex, + u = E.tensorIndex;r.outputLayers.push(s), r.outputLayersNodeIndices.push(l), r.outputLayersTensorIndices.push(u); + }for (var c = 0, p = r.inputs; c < p.length; c++) { + s = (E = p[c]).sourceLayer, l = E.nodeIndex, u = E.tensorIndex;assert$1(0 === l, "input layer has >1 nodes"), assert$1(0 === u, "input layer has >1 tensors"), r.inputLayers.push(s), r.inputLayersNodeIndices.push(l), r.inputLayersTensorIndices.push(u); + }r.inputNames = [], r.outputNames = [], r.feedInputShapes = [], r.feedInputNames = [], r.feedOutputNames = [];for (var h = 0; h < r.inputLayers.length; h++) { + if (!((s = r.inputLayers[h]) instanceof InputLayer)) throw new TypeError("Input layers to a Model must be InputLayer objects. Received inputs: " + n.inputs + ". Input " + h + " (0-based) originates from layer type " + s.getClassName() + ".");r.inputNames.push(s.name), r.feedInputShapes.push(s.batchInputShape), r.feedInputNames.push(s.name); + }for (var d = 0, g = r.outputLayers; d < g.length; d++) { + s = g[d];r.outputNames.push(s.name); + }r.internalInputShapes = r.inputs.map(function (e) { + return e.shape; + }), r.internalOutputShapes = r.outputs.map(function (e) { + return e.shape; + });for (var f = {}, m = {}, y = {}, v = {}, b = {}, z = [], w = function (e, n, i, a, o, s) { + null != a && null != o && null != s || (a = e.sourceLayer, o = e.nodeIndex, s = e.tensorIndex);var l = a.inboundNodes[o];if (-1 !== i.indexOf(l)) throw new RuntimeError("The tensor " + e.name + ' at layer "' + a.name + '" is part of a cycle.');if (-1 === n.indexOf(l)) { + r.containerNodes.add(t.nodeKey(a, o)), (a.id in b) || (b[a.id] = Object.keys(b).length), -1 === i.indexOf(l) && i.push(l);for (var u = l.inboundLayers.length, c = 0; c < u; c++) { + var p = l.inputTensors[c], + h = l.inboundLayers[c], + d = l.nodeIndices[c], + g = l.tensorIndices[c];w(p, n, i, h, d, g); + }for (n.push(l); i.indexOf(l) >= 0;) i.splice(i.indexOf(l), 1);z.push(l); + } + }, S = [], A = [], I = 0, N = r.outputs; I < N.length; I++) { + var E = N[I];w(E, S, A); + }for (var _ = 0, k = z.slice().reverse(); _ < k.length; _++) { + m[(H = k[_]).id] = H, H.id in f || (f[H.id] = 0);var C = f[H.id], + L = null == y[H.outboundLayer.id] ? 0 : y[H.outboundLayer.id];C = Math.max(C, L), y[H.outboundLayer.id] = C, v[H.outboundLayer.id] = H.outboundLayer, f[H.id] = C;for (h = 0; h < H.inboundLayers.length; h++) { + var x = H.inboundLayers[h], + T = (l = H.nodeIndices[h], x.inboundNodes[l]), + R = null == f[T.id] ? 0 : f[T.id];f[T.id] = Math.max(C + 1, R), m[T.id] = T; + } + }var O = {};for (var D in f) { + (C = f[D]) in O || (O[C] = []), O[C].push(m[D]); + }var M = {};for (var P in y) { + (C = y[P]) in M || (M[C] = []), M[C].push(v[P]); + }var F = Object.keys(M).map(function (e) { + return parseInt(e, 10); + }).sort(reverseNumberCompare);r.layers = [];for (var V = 0, B = F; V < B.length; V++) { + var U = M[C = B[V]];U.sort(function (e, t) { + var n = b[e.id], + r = b[t.id];return n < r ? -1 : n > r ? 1 : 0; + });for (var j = 0, W = U; j < W.length; j++) { + s = W[j];r.layers.push(s); + } + }r.layersByDepth = M, F = Object.keys(O).map(function (e) { + return parseInt(e, 10); + }).sort(reverseNumberCompare);for (var $ = r.inputs.slice(), q = [], G = 0, J = F; G < J.length; G++) for (var Z = 0, K = O[C = J[G]]; Z < K.length; Z++) { + var H;if (null != (s = (H = K[Z]).outboundLayer)) { + for (var Y = 0, X = H.inputTensors; Y < X.length; Y++) { + E = X[Y];if (-1 === $.indexOf(E)) throw new RuntimeError("Graph disconnected: cannot obtain value for tensor " + E + ' at layer "' + s.name + '". The following previous layers were accessed without issue: ' + q); + }for (var Q = 0, ee = H.outputTensors; Q < ee.length; Q++) { + E = ee[Q];$.push(E); + }q.push(s.name); + } + }r.nodesByDepth = O;for (var te = r.layers.map(function (e) { + return e.name; + }), ne = function (e) { + var t = te.filter(function (t) { + return t === e; + }).length;if (1 !== t) throw new RuntimeError('The name "' + e + '" is used ' + t + " times in the model. All layer names should be unique. Layer names: " + JSON.stringify(te)); + }, re = 0, ie = te; re < ie.length; re++) { + ne(ie[re]); + }return r.outboundNodes = [], r.inboundNodes = [], new Node({ outboundLayer: r, inboundLayers: [], nodeIndices: [], tensorIndices: [], inputTensors: r.inputs, outputTensors: r.outputs, inputMasks: r.inputs.map(function (e) { + return null; + }), outputMasks: r.outputs.map(function (e) { + return null; + }), inputShapes: r.inputs.map(function (e) { + return e.shape; + }), outputShapes: r.outputs.map(function (e) { + return e.shape; + }) }), r.built = !0, r; + }return __extends$1(t, e), Object.defineProperty(t.prototype, "trainableWeights", { get: function () { + if (this._trainableWeights.length > 0) throw new ValueError("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if (!this.trainable) return [];for (var e = [], t = 0, n = this.layers; t < n.length; t++) { + var r = n[t];e = e.concat(r.trainableWeights); + }return e; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "nonTrainableWeights", { get: function () { + for (var e = [], t = 0, n = this.layers; t < n.length; t++) { + var r = n[t];e.push.apply(e, r.nonTrainableWeights); + }if (!this.trainable) { + for (var i = [], a = 0, o = this.layers; a < o.length; a++) { + r = o[a];i.push.apply(i, r.trainableWeights); + }return i.concat(e); + }return e; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "weights", { get: function () { + return this.trainableWeights.concat(this.nonTrainableWeights); + }, enumerable: !0, configurable: !0 }), t.prototype.loadWeights = function (e, t, n) { + void 0 === t && (t = !1), void 0 === n && (n = !1), n ? loadWeightsFromNamedTensorMap(e, this.layers) : loadWeightsFromJson(e, this.layers, t); + }, t.prototype.updatedConfig = function () { + var e = this.getConfig();return { className: this.getClassName(), config: e, kerasVersion: "tfjs-layers " + version$1, backend: "TensorFlow.js" }; + }, t.prototype.toJSON = function (e, t) { + void 0 === t && (t = !0);var n = convertTsToPythonic(this.updatedConfig());return t ? JSON.stringify(n) : n; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var r;return e = toList(e), r = "mask" in t ? toList(t.mask) : pyListRepeat(null, e.length), n.runInternalGraph(e, r)[0]; + }); + }, t.prototype.computeMask = function (e, t) { + var n = this;return tidy(function () { + var r;return e = toList(e), r = null == t ? pyListRepeat(null, e.length) : toList(t), n.runInternalGraph(e, r)[1]; + }); + }, t.prototype.computeOutputShape = function (e) { + var t = normalizeShapeList(e);if (t.length !== this.inputLayers.length) throw new ValueError("Invalid inputShape argument " + e + ": model has " + this.inputLayers.length + " tensor inputs.");for (var n = {}, r = 0; r < t.length; r++) { + var i = this.inputLayers[r], + a = t[r];n[A = i.name + "_0_0"] = a; + }var o = Object.keys(this.nodesByDepth).map(function (e) { + return parseInt(e, 10); + }).sort(reverseNumberCompare);if (o.length > 1) for (var s = 0, l = o; s < l.length; s++) for (var u = l[s], c = 0, p = this.nodesByDepth[u]; c < p.length; c++) { + var h = p[c];i = h.outboundLayer;if (-1 === this.inputLayers.map(function (e) { + return e.id; + }).indexOf(i.id)) { + for (var d = [], g = 0; g < h.inboundLayers.length; g++) { + var f = h.inboundLayers[g], + m = h.nodeIndices[g], + y = h.tensorIndices[g], + v = n[A = f.name + "_" + m + "_" + y];d.push(v); + }var b = normalizeShapeList(i.computeOutputShape(singletonOrArray(d))), + z = i.inboundNodes.indexOf(h);for (g = 0; g < b.length; g++) { + n[A = i.name + "_" + z + "_" + g] = b[g]; + } + } + }var w = [], + S = [];for (r = 0; r < this.outputLayers.length; r++) { + i = this.outputLayers[r], z = this.outputLayersNodeIndices[r], y = this.outputLayersTensorIndices[r];var A = i.name + "_" + z + "_" + y;S.push(A); + }for (r = 0; r < S.length; r++) { + var I = S[r];assert$1(I in n), w.push(n[I]); + }return singletonOrArray(w); + }, t.prototype.runInternalGraph = function (e, t) { + null == t && (t = pyListRepeat(null, e.length));for (var n = {}, r = 0; r < this.inputs.length; ++r) { + var i = this.inputs[r], + a = e[r], + o = t[r];n[i.id] = [a, o]; + }for (var s = 0, l = Object.keys(this.nodesByDepth).map(function (e) { + return parseInt(e, 10); + }).sort(reverseNumberCompare); s < l.length; s++) for (var u = l[s], c = 0, p = this.nodesByDepth[u]; c < p.length; c++) { + for (var h = p[c], d = h.outboundLayer, g = h.inputTensors, f = h.outputTensors, m = new Array(), y = 0, v = g; y < v.length; y++) { + (i = v[y]).id in n && m.push(n[i.id]); + }if (m.length === g.length) { + var b = {}, + z = void 0, + w = void 0, + S = void 0, + A = void 0;if (null != h.callArgs && (b = h.callArgs), 1 === m.length) { + var I = m[0], + N = I[0], + E = I[1];null == b.mask && (b.mask = E), S = toList(d.call(N, b)), A = toList(d.computeMask(N, E)), z = [N], w = [E]; + } else z = m.map(function (e) { + return e[0]; + }), w = m.map(function (e) { + return e[1]; + }), null == b.mask && (b.mask = w), S = toList(d.call(z, b)), A = toList(d.computeMask(z, w));if (d.activityRegularizer) throw new NotImplementedError("Model invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for (r = 0; r < f.length; ++r) { + i = f[r], a = S[r], o = A[r];n[i.id] = [a, o]; + } + } + }for (var _ = [], k = [], C = [], L = 0, x = this.outputs; L < x.length; L++) { + assert$1((i = x[L]).id in n, "Could not compute output " + i.name + " : " + i.id);var T = n[i.id], + R = T[0];o = T[1];C.push(R.shape), _.push(R), k.push(o); + }return [_, k, C]; + }, t.prototype.buildNodeConversionMap = function (e) { + for (var n, r = {}, i = 0, a = this.layers; i < a.length; i++) { + var o = a[i];n = o instanceof t ? 1 : 0;for (var s = 0; s < o.inboundNodes.length; s++) { + var l = t.nodeKey(o, s);l in this.containerNodes && (r[l] = n, n += 1); + } + }return r; + }, t.prototype.getLayer = function (e, t) { + if (null != t) { + if (this.layers.length <= t) throw new ValueError("Was asked to retrieve layer at index " + t + ", but model only has " + this.layers.length + " layer(s).");return this.layers[t]; + }if (null == e) throw new ValueError("Provide either a layer name or layer index");for (var n = 0, r = this.layers; n < r.length; n++) { + var i = r[n];if (i.name === e) return i; + }throw new ValueError("No such layer: " + e); + }, t.prototype.calculateLosses = function () { + var e = this;return tidy(function () { + for (var n = [], r = 0, i = e.layers; r < i.length; r++) for (var a = i[r], o = 0; o < a.inboundNodes.length; ++o) { + var s = t.nodeKey(a, o);e.containerNodes.has(s) && n.push.apply(n, a.calculateLosses()); + }return n; + }); + }, t.prototype.getConfig = function () { + for (var e = { name: this.name }, n = this.buildNodeConversionMap(this.layers), r = [], i = 0, a = this.layers; i < a.length; i++) { + for (var o = (b = a[i]).getClassName(), s = b.getConfig(), l = [], u = 0; u < b.inboundNodes.length; u++) { + var c = b.inboundNodes[u], + p = t.nodeKey(b, u), + h = {};if (this.containerNodes.has(p)) { + if (c.callArgs) try { + JSON.stringify(c.callArgs), h = c.callArgs; + } catch (e) { + console.warn("Layer " + b.name + " was passed non-serializable keyword arguments: " + c.callArgs + ". They will not be included in the serialized model (and thus will be missing at deserialization time)."), h = {}; + }if (c.inboundLayers.length > 0) { + for (var d = [], g = 0; g < c.inboundLayers.length; g++) { + var f = c.inboundLayers[g], + m = c.nodeIndices[g], + y = c.tensorIndices[g];null !== (w = n[t.nodeKey(f, m)]) && void 0 !== w || (w = 0), d.push([f.name, w, y, h]); + }l.push(d); + } + } + }r.push({ name: b.name, className: o, config: s, inboundNodes: l }); + }e.layers = r;var v = [];for (g = 0; g < this.inputLayers.length; g++) { + var b = this.inputLayers[g];m = this.inputLayersNodeIndices[g], p = t.nodeKey(b, m);if (this.containerNodes.has(p)) { + null !== (w = n[p]) && void 0 !== w || (w = 0);y = this.inputLayersTensorIndices[g];v.push([b.name, w, y]); + } + }e.inputLayers = v;var z = [];for (g = 0; g < this.outputLayers.length; g++) { + b = this.outputLayers[g], m = this.outputLayersNodeIndices[g], p = t.nodeKey(b, m);if (this.containerNodes.has(p)) { + var w;null !== (w = n[p]) && void 0 !== w || (w = 0);y = this.outputLayersTensorIndices[g];z.push([b.name, w, y]); + } + }return e.outputLayers = z, e; + }, t.fromConfig = function (e, t) { + var n = {}, + r = {};function i(e, t) { + e.name in r ? r[e.name].push(t) : r[e.name] = [t]; + }function a(e, t) { + for (var r, a = [], o = 0, s = t; o < s.length; o++) { + var l = s[o], + u = l[0], + c = l[1], + p = l[2];if (3 === l.length) r = {};else { + if (4 !== l.length) throw new ValueError("Improperly formatted model config for layer " + JSON.stringify(e) + ": " + JSON.stringify(l));r = l[3]; + }if (!(u in n)) return void i(e, t);var h = n[u];if (h.inboundNodes.length <= c) return void i(e, t);var d = h.inboundNodes[c];a.push(d.outputTensors[p]); + }a.length > 0 && e.apply(singletonOrArray(a), r); + }function o(e) { + var r = e.name, + a = deserialize(e, null != t.customObjects ? t.customObjects : {});n[r] = a;for (var o = 0, s = e.inboundNodes; o < s.length; o++) { + var l = s[o];if (!(l instanceof Array)) throw new ValueError("Corrupted configuration, expected array for nodeData: " + l);i(a, l); + } + }for (var s = t.name, l = t.layers, u = 0, c = l; u < c.length; u++) { + o(d = c[u]); + }for (; !isObjectEmpty(r);) for (var p = 0, h = l; p < h.length; p++) { + var d = h[p];if ((E = n[d.name]).name in r) { + for (var g = 0, f = r[E.name]; g < f.length; g++) { + a(E, f[g]); + }delete r[E.name]; + } + }for (var m = [], y = [], v = 0, b = t.inputLayers; v < b.length; v++) { + var z = (d = b[v])[0], + w = d[1], + S = d[2];assert$1(z in n);var A = (E = n[z]).inboundNodes[w].outputTensors;m.push(A[S]); + }for (var I = 0, N = t.outputLayers; I < N.length; I++) { + z = (d = N[I])[0], w = d[1], S = d[2];assert$1(z in n);var E;A = (E = n[z]).inboundNodes[w].outputTensors;y.push(A[S]); + }return new e({ inputs: m, outputs: y, name: s }); + }, Object.defineProperty(t.prototype, "stateful", { get: function () { + if (this._stateful) throw new ValueError("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for (var e = 0, t = this.layers; e < t.length; e++) { + if (t[e].stateful) return !0; + }return !1; + }, enumerable: !0, configurable: !0 }), t; + }(Layer);function assertFeedCompatibility(e, t) { + if (null != e.shape) { + if (e.shape.length !== t.shape.length) throw new ValueError("The rank of feed (" + t.shape.length + ") does not match the rank of the key (" + e.shape.length + ").");for (var n = 0; n < e.shape.length; ++n) if (null != e.shape[n] && e.shape[n] !== t.shape[n]) throw new ValueError("The " + n + "-th dimension of the feed (" + t.shape[n] + ") is incompatible with that of the key (" + e.shape[n] + ")."); + }if (null == e.dtype || e.dtype === t.dtype) return t;try { + return cast(t, e.dtype); + } catch (n) { + throw new ValueError("The dtype of the feed (" + t.dtype + ") can not be cast to the dtype of the key '" + e.name + "' (" + e.dtype + ")."); + } + }var ModelLoggingVerbosity, + FeedDict = function () { + function e(t) { + if (this.id2Value = {}, t instanceof e) for (var n in t.id2Value) this.id2Value[n] = t.id2Value[n];else { + if (null == t) return;for (var r = 0, i = t; r < i.length; r++) { + var a = i[r];this.add(a.key, a.value); + } + } + }return e.prototype.add = function (e, t) { + if (null != this.id2Value[e.id]) throw new ValueError("Duplicate key: name=" + e.name + ", id=" + e.id);return this.id2Value[e.id] = assertFeedCompatibility(e, t), this; + }, e.prototype.addFeed = function (e) { + this.add(e.key, e.value); + }, e.prototype.hasKey = function (e) { + return null != this.id2Value[e.id]; + }, e.prototype.getValue = function (e) { + if (null == this.id2Value[e.id]) throw new ValueError("Nonexistent key: " + JSON.stringify(e));return this.id2Value[e.id]; + }, e; + }();function execute(e, t, n) { + for (var r = Array.isArray(e), i = r ? e : [e], a = [], o = new FeedDict(t), s = 0, l = i; s < l.length; s++) { + var u = l[s];a.push(executeInternal(u, o, n)); + }return r ? a : a[0]; + }function executeInternal(e, t, n) { + if (t.hasKey(e)) return t.getValue(e);if (e.sourceLayer instanceof InputLayer) throw new ValueError("Missing a feed value for SymbolicTensor from InputLayer '" + InputLayer.name + "'");for (var r = [], i = 0, a = e.inputs; i < a.length; i++) { + var o = executeInternal(a[i], t, n);r.push(o); + }var s = e.sourceLayer.apply(r, n);Array.isArray(s) || (s = [s]);for (var l = getNodeOutputs(e), u = Array.isArray(l) ? l : [l], c = 0; c < u.length; ++c) t.add(u[c], s[c]);return 1 === s.length ? s[0] : s[e.outputTensorIndex]; + }function getNodeOutputs(e) { + var t;if (1 === e.sourceLayer.inboundNodes.length) t = e.sourceLayer.output;else { + for (var n = null, r = 0; r < e.sourceLayer.inboundNodes.length; ++r) for (var i = 0, a = e.sourceLayer.inboundNodes[r].outputTensors; i < a.length; i++) { + if (a[i].id === e.id) { + n = r;break; + } + }t = e.sourceLayer.getOutputAt(n); + }return t; + }function isDataTensor(e) { + return e instanceof Tensor; + }function isDataArray(e) { + return Array.isArray(e); + }function isDataDict(e) { + return !isDataTensor(e) && !isDataArray(e); + }function standardizeInputData(e, t, n, r, i) { + if (void 0 === r && (r = !0), void 0 === i && (i = ""), null == t || 0 === t.length) { + if (null != e) { + var a = !1;if (isDataArray(e) && e.length > 0) a = !0;else if (isDataDict(e)) { + for (var o in e) if (e.hasOwnProperty(o)) { + a = !0;break; + } + } else a = !0;if (a) throw new ValueError("Error when checking model " + i + " expected no data, but got " + e); + }return []; + }if (null == e) return t.map(function (e) { + return null; + });var s;if (isDataDict(e)) { + e = e, s = [];for (var l = 0, u = t; l < u.length; l++) { + var c = u[l];if (null == e[c]) throw new ValueError('No data provided for "' + c + '". Need data for each key in: ' + t);s.push(e[c]); + } + } else if (isDataArray(e)) { + if ((e = e).length !== t.length) throw new ValueError("Error when checking model " + i + ": the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see " + t.length + " Tensor(s), but instead got the following list of Tensor(s): " + e);s = e; + } else { + if (e = e, t.length > 1) throw new ValueError("The model " + i + " expects " + t.length + " Tensor(s), but only received one Tensor. Found: Tensor with shape " + e.shape);s = [e]; + }for (var p = 0; p < t.length; ++p) { + 1 === (h = s[p]).shape.length && (s[p] = expandDims$1(h, 1)); + }if (null != n) for (p = 0; p < t.length; ++p) if (null != n[p]) { + var h;if ((h = s[p]).shape.length !== n[p].length) throw new ValueError("Error when checking " + i + ": expected " + t[p] + " to have " + n[p].length + " dimension(s). but got array with shape " + h.shape);for (var d = 0; d < n[p].length; ++d) if (0 !== d || r) { + var g = h.shape[d], + f = n[p][d];if (null != f && f >= 0 && g !== f) throw new ValueError("Error when checking " + i + ": expected " + t[p] + " to have shape [" + n[p] + "], but got array with shape [" + h.shape + "]."); + } + }return s; + }function checkArrayLengths(e, t, n) { + var r = unique(e.map(function (e) { + return e.shape[0]; + }));r.sort();var i = unique(t.map(function (e) { + return e.shape[0]; + }));if (i.sort(), r.length > 1) throw new ValueError("All input Tensors (x) should have the same number of samples. Got array shapes: " + JSON.stringify(e.map(function (e) { + return e.shape; + })));if (i.length > 1) throw new ValueError("All target Tensors (y) should have the same number of samples. Got array shapes: " + JSON.stringify(t.map(function (e) { + return e.shape; + })));if (r.length > 0 && i.length > 0 && !util.arraysEqual(r, i)) throw new ValueError("Input Tensors should have the same number of samples as target Tensors. Found " + r[0] + " input sample(s) and " + i[0] + " target sample(s)."); + }function checkLossAndTargetCompatibility(e, t, n) { + for (var r = [meanSquaredError$1, binaryCrossentropy, categoricalCrossentropy], i = 0; i < e.length; ++i) { + var a = e[i], + o = t[i], + s = n[i];if (null != o) { + if (o === categoricalCrossentropy && 1 === a.shape[a.shape.length - 1]) throw new ValueError("You are passing a target array of shape " + a.shape + " while using a loss 'categorical_crossentropy'. 'categorical_crossentropy'expects targets to be binary matrices (1s and 0s) of shape [samples, classes].");if (-1 !== r.indexOf(o)) for (var l = a.shape.slice(1), u = s.slice(1), c = 0; c < l.length; ++c) { + var p = l[c], + h = u[c];if (null != h && p !== h) throw new ValueError("A target Tensor with shape " + a.shape + " was passed for an output of shape " + s + ", while using a loss function that expects targets to have the same shape as the output."); + } + } + } + }function makeBatches(e, t) { + for (var n = [], r = 0, i = null; r < e;) (i = r + t) >= e && (i = e), n.push([r, i]), r = i;return n; + }function sliceArrays(e, t, n) { + return null == e ? [null] : Array.isArray(e) ? e.map(function (e) { + return sliceAlongFirstAxis(e, t, n - t); + }) : sliceAlongFirstAxis(e, t, n - t); + }function sliceArraysByIndices(e, t) { + return tidy(function () { + return null == e ? null : Array.isArray(e) ? e.map(function (e) { + return sliceArraysByIndices(e, t); + }) : gather$1(e, "int32" === t.dtype ? t : t.toInt()); + }); + }function checkInputData(e, t, n, r, i) { + var a;if (void 0 === r && (r = !0), void 0 === i && (i = ""), Array.isArray(e)) { + if (e.length !== t.length) throw new ValueError("Error when checking model " + i + ": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see " + t.length + " Tensor(s), but instead got " + e.length + " Tensors(s).");a = e; + } else { + if (t.length > 1) throw new ValueError("The model expects " + t.length + " " + i + " Tensors, but only received one Tensor. Found: array with shape " + JSON.stringify(e.shape) + ".");a = [e]; + }if (null != n) for (var o = 0; o < t.length; ++o) if (null != n[o]) { + var s = a[o];if (s.shape.length !== n[o].length) throw new ValueError("Error when checking " + i + ": expected " + t[o] + " to have " + n[o].length + " dimension(s), but got array with shape " + JSON.stringify(s.shape));for (var l = 0; l < n[o].length; ++l) if (0 !== l || r) { + var u = s.shape[l], + c = n[o][l];if (null != c && c !== u) throw new ValueError("Error when checking " + i + ": expected " + t[o] + " to have shape " + JSON.stringify(n[o]) + " but got array with shape " + JSON.stringify(s.shape) + "."); + } + } + }function collectMetrics(e, t) { + if (null == e || Array.isArray(e) && 0 === e.length) return t.map(function (e) { + return []; + });if (Array.isArray(e)) return t.map(function (t) { + return e; + });if (null != e) { + for (var n = [], r = 0, i = t; r < i.length; r++) { + var a = i[r], + o = e.hasOwnProperty(a) ? e[a] : [];Array.isArray(o) || (o = [o]), n.push(o); + }return n; + }throw new TypeError("Type of metrics argument not understood. Expected an Array or Object, found: " + e); + }!function (e) { + e[e.SILENT = 0] = "SILENT", e[e.VERBOSE = 1] = "VERBOSE"; + }(ModelLoggingVerbosity || (ModelLoggingVerbosity = {}));var Model = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.summary = function (e, t, n) { + if (void 0 === n && (n = console.log), !this.built) throw new ValueError("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");printSummary(this, e, t, n); + }, t.prototype.compile = function (e) { + var t = this;if (null == e.loss && (e.loss = []), this.loss = e.loss, "string" == typeof e.optimizer) this.optimizer = getOptimizer(e.optimizer);else { + if (!(e.optimizer instanceof Optimizer)) throw new ValueError("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer = e.optimizer; + }var n = [];if (Array.isArray(e.loss) || "string" == typeof e.loss || "function" == typeof e.loss) { + if (Array.isArray(e.loss)) { + if (e.loss.length !== this.outputs.length) throw new ValueError("When passing an Array as loss, it should have one entry per model output. The model has " + this.outputs.length + " output(s), but you passed loss=" + e.loss + ".");var r = e.loss;n = r.map(function (e) { + return get(e); + }); + } else { + var i = get(e.loss);this.outputs.map(function (e) { + n.push(i); + }); + } + } else { + for (var a in e.loss = e.loss, e.loss) if (-1 === this.outputNames.indexOf(a)) throw new ValueError('Unknown entry in loss dictionary: "' + a + '". Only expect the following keys: ' + this.outputNames);for (var o in this.outputNames) null == e.loss[o] && console.warn('Output "' + o + '" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ' + o + " during training"), n.push(get(e.loss[o])); + }this.lossFunctions = n, this.feedOutputNames = [], this.feedOutputShapes = [], this.feedLossFns = [];for (var s = 0; s < this.outputs.length; ++s) { + var l = this.internalOutputShapes[s], + u = this.outputNames[s];this.feedOutputNames.push(u), this.feedOutputShapes.push(l), this.feedLossFns.push(this.lossFunctions[s]); + }var c = [];this.metrics = e.metrics, this.metricsNames = ["loss"], this.metricsTensors = [], nameScope("loss", function () { + for (var e = 0; e < t.outputs.length; ++e) if (-1 === c.indexOf(e)) { + var n = t.lossFunctions[e];t.outputs.length > 1 && (t.metricsTensors.push([n, e]), t.metricsNames.push(t.outputNames[e] + "_loss")); + } + });var p = collectMetrics(e.metrics, this.outputNames);nameScope("metric", function () { + for (var e = function (e) { + if (-1 !== c.indexOf(e)) return "continue";!function (n) { + for (var r, i, a, o = function (n) { + if (-1 !== ["accuracy", "acc", "crossentropy", "ce"].indexOf(n)) { + var o = t.internalOutputShapes[e];1 === o[o.length - 1] || t.lossFunctions[e] === binaryCrossentropy ? -1 !== ["accuracy", "acc"].indexOf(n) ? i = binaryAccuracy : -1 !== ["crossentropy", "ce"].indexOf(n) && (i = binaryCrossentropy$1) : t.lossFunctions[e] === sparseCategoricalCrossentropy ? -1 !== ["accuracy", "acc"].indexOf(n) ? i = sparseCategoricalAccuracy : -1 !== ["crossentropy", "ce"].indexOf(n) && (i = sparseCategoricalCrossentropy$1) : -1 !== ["accuracy", "acc"].indexOf(n) ? i = categoricalAccuracy : -1 !== ["crossentropy", "ce"].indexOf(n) && (i = categoricalCrossentropy$1);var s = void 0;-1 !== ["accuracy", "acc"].indexOf(n) ? s = "acc" : -1 !== ["crossentropy", "ce"].indexOf(n) && (s = "ce"), a = i, r = "" + s; + } else { + var l = get$1(n);a = l, r = "" + n; + }var u;nameScope(r, function () { + u = a; + }), function (e, n, r) { + t.outputNames.length > 1 && (n = t.outputNames[e] + "_" + n), t.metricsNames.push(n), t.metricsTensors.push([r, e]); + }(e, r, u); + }, s = 0, l = n; s < l.length; s++) o(l[s]); + }(p[e]); + }, n = 0; n < t.outputs.length; ++n) e(n); + }), this.collectedTrainableWeights = this.trainableWeights; + }, t.prototype.checkTrainableWeightsConsistency = function () { + null != this.collectedTrainableWeights && this.trainableWeights.length !== this.collectedTrainableWeights.length && console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?"); + }, t.prototype.evaluate = function (e, t, n) { + void 0 === n && (n = {});var r = null == n.batchSize ? 32 : n.batchSize, + i = this.standardizeUserData(e, t, !0, r), + a = i[0].concat(i[1]);this.makeTestFunction();var o = this.testFunction;return singletonOrArray(this.testLoop(o, a, r, n.verbose, n.steps)); + }, t.prototype.checkNumSamples = function (e, t, n, r) { + var i;if (void 0 === r && (r = "steps"), null != n) { + if (i = null, null != t) throw new ValueError("If " + r + " is set, batchSize must be null or undefined.Got batchSize = " + t); + } else { + if (null == e) throw new ValueError("Either the input data should have a defined shape, or " + r + " shoud be specified.");i = Array.isArray(e) ? e[0].shape[0] : e.shape[0]; + }return i; + }, t.prototype.execute = function (e, t) { + if (Array.isArray(t) && 0 === t.length) throw new ValueError("`outputs` is an empty Array, which is not allowed.");var n = Array.isArray(t), + r = n ? t : [t], + i = this.retrieveSymbolicTensors(r), + a = new FeedDict();if (e instanceof Tensor && (e = [e]), Array.isArray(e)) { + if (e.length !== this.inputs.length) throw new ValueError("The number of inputs provided (" + e.length + ") does not match the number of inputs of this model (" + this.inputs.length + ").");for (var o = 0; o < this.inputs.length; ++o) a.add(this.inputs[o], e[o]); + } else for (var s = 0, l = this.inputs; s < l.length; s++) { + var u = l[s], + c = e[u.name];if (null == c) throw new ValueError("No value is provided for the model's input " + u.name);a.add(u, c); + }var p = execute(i, a);return n ? p : p[0]; + }, t.prototype.retrieveSymbolicTensors = function (e) { + for (var t = pyListRepeat(null, e.length), n = e.length, r = 0, i = this.layers; r < i.length; r++) { + for (var a = i[r], o = Array.isArray(a.output) ? a.output : [a.output], s = o.map(function (e) { + return e.name; + }), l = 0; l < e.length; ++l) { + var u = s.indexOf(e[l]);if (-1 !== u && (t[l] = o[u], n--), 0 === n) break; + }if (0 === n) break; + }if (n > 0) { + var c = [];throw t.forEach(function (t, n) { + null == t && c.push(e[n]); + }), new ValueError("Cannot find SymbolicTensors for output name(s): " + JSON.stringify(c)); + }return t; + }, t.prototype.predictLoop = function (e, t, n) { + var r = this;return void 0 === t && (t = 32), void 0 === n && (n = !1), tidy(function () { + var i = r.checkNumSamples(e);if (n) throw new NotImplementedError("Verbose predictLoop() is not implemented yet.");for (var a = makeBatches(i, t), o = [], s = function (t) { + var n = tidy(function () { + var n = a[t][0], + i = a[t][1], + o = sliceArrays(e, n, i), + s = [];if (Array.isArray(o)) for (var l = 0; l < o.length; ++l) s.push({ key: r.inputs[l], value: o[l] });else s.push({ key: r.inputs[0], value: o });var u = new FeedDict(s);return execute(r.outputs, u); + });if (0 === t) for (var i = 0, s = n; i < s.length; i++) { + var l = s[i];o.push(l); + } else for (var u = 0; u < n.length; ++u) o[u] = concatAlongFirstAxis(o[u], n[u]); + }, l = 0; l < a.length; ++l) s(l);return singletonOrArray(o); + }); + }, t.prototype.predict = function (e, t) { + void 0 === t && (t = {}), checkInputData(e, this.inputNames, this.feedInputShapes, !1);var n = null == t.batchSize ? 32 : t.batchSize;return this.predictLoop(e, n); + }, t.prototype.predictOnBatch = function (e) { + return checkInputData(e, this.inputNames, this.feedInputShapes, !0), this.predictLoop(e, e.shape[0]); + }, t.prototype.standardizeUserData = function (e, t, n, r) { + if (void 0 === n && (n = !0), null == this.optimizer) throw new RuntimeError("You must compile a model before training/testing. Use Model.compile(modelCompileConfig).");for (var i = [], a = 0; a < this.feedOutputShapes.length; ++a) { + var o = this.feedOutputShapes[a];this.feedLossFns[a] === sparseCategoricalCrossentropy ? i.push(o.slice(0, o.length - 1).concat([1])) : i.push(o); + }if (checkArrayLengths(e = standardizeInputData(e, this.feedInputNames, this.feedInputShapes, !1, "input"), t = standardizeInputData(t, this.feedOutputNames, i, !1, "target"), null), checkLossAndTargetCompatibility(t, this.feedLossFns, this.feedOutputShapes), this.stateful && null != r && r > 0 && e[0].shape[0] % r != 0) throw new ValueError("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size " + r + ". Found: " + e[0].shape[0] + " sample(s).");return [e, t, null]; + }, t.prototype.fitLoop = function (e, t, n, r, i, a, o, s, l, u, c, p, h, d) { + return __awaiter$1(this, void 0, void 0, function () { + var g, + f, + m, + y, + v, + b, + z, + w = this;return __generator$1(this, function (S) { + switch (S.label) {case 0: + if (null == r && (r = 32), null == i && (i = 1), null == u && (u = !0), null == p && (p = 0), g = !1, null != s && null != l && (g = !0), null != d && (g = !0, null == h)) throw new ValueError("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");if (null != (f = this.checkNumSamples(t, r, h, "steps_per_epoch")) && (m = range$1(0, f)), this.history = new History(), o = (o = null == o ? [new BaseLogger()] : [new BaseLogger()].concat(o)).concat([this.history]), a > 0) throw new NotImplementedError("Verbose mode is not implemented yet.");return (y = new CallbackList(o)).setModel(this), y.setParams({ epochs: i, initialEpoch: p, steps: h, verbose: a, doValidation: g, metrics: c }), [4, y.onTrainBegin()];case 1: + S.sent(), this.stopTraining = !1, v = function (i) { + var a, o, c, p, d;return __generator$1(this, function (v) { + switch (v.label) {case 0: + return [4, y.onEpochBegin(i)];case 1: + if (v.sent(), a = {}, null == h) return [3, 2];throw new NotImplementedError("stepsPerEpoch mode is not implemented yet.");case 2: + if ("batch" === u) throw new NotImplementedError("batch shuffling is not implemneted yet");u && util.shuffle(m), o = tensor1d(m), c = makeBatches(f, r), p = function (i) { + var u;return __generator$1(this, function (p) { + switch (p.label) {case 0: + return u = {}, [4, y.onBatchBegin(i, u)];case 1: + return p.sent(), tidy(function () { + var p = c[i][0], + h = c[i][1], + d = sliceAlongFirstAxis(o, p, h - p);u.batch = i, u.size = h - p;for (var f = sliceArraysByIndices(t, d), m = e(f), y = 0; y < n.length; ++y) { + var v = n[y], + b = m[y];u[v] = b, keep(b); + }if (i === c.length - 1 && g) { + var z = w.testLoop(s, l, r);for (y = 0; y < n.length; ++y) { + v = n[y], b = z[y];keep(b), a["val_" + v] = b; + } + } + }), [4, y.onBatchEnd(i, u)];case 2: + return p.sent(), disposeTensorsInLogs(u), b.stopTraining ? [2, "break"] : [2];} + }); + }, d = 0, v.label = 3;case 3: + return d < c.length ? [5, p(d)] : [3, 6];case 4: + if ("break" === v.sent()) return [3, 6];v.label = 5;case 5: + return ++d, [3, 3];case 6: + o.dispose(), v.label = 7;case 7: + return [4, y.onEpochEnd(i, a)];case 8: + return v.sent(), b.stopTraining ? [2, "break"] : [2];} + }); + }, b = this, z = p, S.label = 2;case 2: + return z < i ? [5, v(z)] : [3, 5];case 3: + if ("break" === S.sent()) return [3, 5];S.label = 4;case 4: + return ++z, [3, 2];case 5: + return [4, y.onTrainEnd()];case 6: + return S.sent(), [4, this.history.syncData()];case 7: + return S.sent(), [2, this.history];} + }); + }); + }, t.prototype.testLoop = function (e, t, n, r, i) { + var a = this;return void 0 === r && (r = 0), tidy(function () { + var o = a.checkNumSamples(t, n, i, "steps"), + s = [];if (1 === r) throw new NotImplementedError("Verbose mode is not implemented yet.");if (null != i) throw new NotImplementedError("steps mode in testLoop() is not implemented yet");for (var l = makeBatches(o, n), u = tensor1d(range$1(0, o)), c = 0; c < l.length; ++c) { + var p = l[c][0], + h = l[c][1], + d = sliceAlongFirstAxis(u, p, h - p), + g = sliceArraysByIndices(t, d), + f = e(g);if (0 === c) for (var m = 0; m < f.length; ++m) s.push(getScalar(0));for (m = 0; m < f.length; ++m) { + var y = f[m];s[m] = add(s[m], mul(getScalar(h - p), y)); + } + }for (m = 0; m < s.length; ++m) s[m] = div(s[m], getScalar(o));return s; + }); + }, t.prototype.getDedupedMetricsNames = function () { + for (var e = this.metricsNames, t = [], n = 0; n < e.length; ++n) { + var r = e[n], + i = r;if (count(e, r) > 1) i += "_" + count(e.slice(0, n), r);t.push(i); + }return t; + }, t.prototype.makeTestFunction = function () { + var e = this;this.testFunction = function (t) { + return tidy(function () { + for (var n, r = [], i = t.slice(0, e.inputs.length), a = t.slice(e.inputs.length, e.inputs.length + e.outputs.length), o = [], s = 0; s < e.inputs.length; ++s) o.push({ key: e.inputs[s], value: i[s] });var l = new FeedDict(o), + u = execute(e.outputs, l);for (s = 0; s < e.lossFunctions.length; ++s) { + var c = e.lossFunctions[s], + p = mean(c(a[s], u[s]));n = 0 === s ? p : add(n, p), r.push(n); + }for (s = 0; s < e.metricsTensors.length; ++s) { + var h = e.metricsTensors[s][0], + d = e.metricsTensors[s][1], + g = mean(h(a[d], u[d]));r.push(g); + }return r; + }); + }; + }, t.prototype.fit = function (e, t, n) { + return void 0 === n && (n = {}), __awaiter$1(this, void 0, void 0, function () { + var r, + i, + a, + o, + s, + l, + u, + c, + p, + h, + d, + g, + f, + m, + y, + v, + b, + z, + w, + S = this;return __generator$1(this, function (A) { + switch (A.label) {case 0: + if (r = null == n.batchSize ? 32 : n.batchSize, i = this.standardizeUserData(e, t, !1, r), a = i[0], o = i[1], s = !1, p = !1, null != n.validationData && n.validationData.length > 0) { + if (s = !0, 2 !== n.validationData.length) throw 3 === n.validationData.length ? new NotImplementedError("validationData including sample weights is not supported yet.") : new ValueError("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; " + n.validationData + " is invalid.");l = n.validationData[0], u = n.validationData[1], h = this.standardizeUserData(l, u, !0, r), l = h[0], u = h[1], c = l.concat(u); + } else null != n.validationSplit && n.validationSplit > 0 && n.validationSplit < 1 ? (s = !0, d = Math.floor(a[0].shape[0] * (1 - n.validationSplit)), g = a[0].shape[0], l = sliceArrays(a, d, g), a = sliceArrays(a, 0, d), u = sliceArrays(o, d, g), o = sliceArrays(o, 0, d), p = !0, c = l.concat(u)) : null != n.validationSteps && (s = !0);return f = a.concat(o), this.checkTrainableWeightsConsistency(), m = function (e) { + var t = e.slice(0, S.inputs.length), + n = e.slice(S.inputs.length, S.inputs.length + S.outputs.length), + r = [], + i = S.collectedTrainableWeights.map(function (e) { + return e.read(); + });return [S.optimizer.minimize(function () { + for (var e = [], i = 0; i < S.inputs.length; ++i) e.push({ key: S.inputs[i], value: t[i] });var a, + o = new FeedDict(e), + s = execute(S.outputs, o, { training: !0 });for (i = 0; i < S.lossFunctions.length; ++i) { + var l = (0, S.lossFunctions[i])(n[i], s[i]);mean(l), a = 0 === i ? l : add(a, l); + }for (i = 0; i < S.metricsTensors.length; ++i) { + var u = S.metricsTensors[i][0], + c = S.metricsTensors[i][1], + p = mean(u(n[c], s[c]));keep(p), r.push(p); + }return a = mean(a), S.calculateLosses().forEach(function (e) { + a = add(a, e); + }), a; + }, !0, i)].concat(r); + }, y = this.getDedupedMetricsNames(), s ? (this.makeTestFunction(), v = this.testFunction, b = y.slice().concat(y.map(function (e) { + return "val_" + e; + }))) : (v = null, c = [], b = y.slice()), z = standardizeCallbacks(n.callbacks), [4, this.fitLoop(m, f, y, r, n.epochs, n.verbose, z, v, c, n.shuffle, b, n.initialEpoch, null, null)];case 1: + return w = A.sent(), p && (c.forEach(function (e) { + return e.dispose(); + }), a.forEach(function (e) { + return e.dispose(); + }), o.forEach(function (e) { + return e.dispose(); + })), [2, w];} + }); + }); + }, t.prototype.getNamedWeights = function (e) { + for (var t = {}, n = null != e && e.trainableOnly, r = n ? this.trainableWeights : this.weights, i = this.getWeights(n), a = 0; a < r.length; ++a) n && !r[a].trainable || (t[r[a].originalName] = i[a]);return t; + }, t.prototype.save = function (e, t) { + return __awaiter$1(this, void 0, void 0, function () { + var n, r, i, a, o;return __generator$1(this, function (s) { + switch (s.label) {case 0: + if ("string" == typeof e) { + if (0 === (n = io.getSaveHandlers(e)).length) throw new ValueError("Cannot find any save handlers for URL '" + e + "'");if (n.length > 1) throw new ValueError("Found more than one (" + n.length + ") save handlers for URL '" + e + "'");e = n[0]; + }if (null == e.save) throw new ValueError("Model.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return [4, io.encodeWeights(this.getNamedWeights(t))];case 1: + return r = s.sent(), i = !1, a = null, o = this.toJSON(a, i), [2, e.save({ modelTopology: o, weightData: r.data, weightSpecs: r.specs })];} + }); + }); + }, t.className = "Model", t; + }(Container);function loadModelInternal(e) { + return __awaiter$1(this, void 0, void 0, function () { + var t;return __generator$1(this, function (n) { + if ("string" == typeof e) { + if (0 === (t = io.getLoadHandlers(e)).length) t.push(io.browserHTTPRequest(e));else if (t.length > 1) throw new ValueError("Found more than one (" + t.length + ") load handlers for URL '" + e + "'");e = t[0]; + }return [2, loadModelFromIOHandler(e)]; + }); + }); + }function loadModelFromIOHandler(e, t) { + return __awaiter$1(this, void 0, void 0, function () { + var n, r, i, a, o;return __generator$1(this, function (s) { + switch (s.label) {case 0: + if (null == e.load) throw new ValueError("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");return [4, e.load()];case 1: + if (n = s.sent(), null != (r = n.modelTopology).model_config && (r = r.model_config), i = deserialize(convertPythonicToTs(r), t), null != n.weightData) { + if (null == n.weightSpecs) throw new ValueError("Model artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");a = !1, o = !0, i.loadWeights(io.decodeWeights(n.weightData, n.weightSpecs), a, o); + }return [2, i];} + }); + }); + }serialization.SerializationMap.register(Model);var Sequential = function (e) { + function t(t) { + var n = e.call(this, { inputs: [], outputs: [] }) || this;if (t = t || {}, n.trainable = !0, n._updatable = !0, n.built = !1, n.name = null != t.name ? t.name : getUid("sequential_"), null != t.layers) for (var r = 0, i = t.layers; r < i.length; r++) { + var a = i[r];n.add(a); + }return n; + }return __extends$1(t, e), t.prototype.add = function (e) { + var n, + r = e instanceof t || e instanceof Model;if (r) { + if (1 !== (n = e).outputs.length) throw new ValueError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if (1 !== n.inputs.length) throw new ValueError("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API."); + }if (0 === this.outputs.length) { + if (0 === e.inboundNodes.length) { + if (null == e.batchInputShape) throw new ValueError("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");var i = Input({ batchShape: e.batchInputShape, dtype: e.dtype, name: e.name + "_input" });e.apply(i); + }if (r) this.outputs = n.outputs, this.inputs = n.inputs;else { + if (1 !== e.inboundNodes.length) throw new ValueError("A layer added to a Sequential model must not already be connected somewhere else. Model received layer " + e.name + " which has " + e.inboundNodes.length + " pre-existing inbound connections.");if (1 !== e.inboundNodes[0].outputTensors.length) throw new ValueError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.outputs = [e.inboundNodes[0].outputTensors[0]], this.inputs = getSourceInputs(this.outputs[0]); + }this.inboundNodes = [], new Node({ outboundLayer: this, inboundLayers: [], nodeIndices: [], tensorIndices: [], inputTensors: this.inputs, outputTensors: this.outputs, inputMasks: pyListRepeat(null, this.inputs.length), outputMasks: [null], inputShapes: this.inputs.map(function (e) { + return e.shape; + }), outputShapes: this.outputs[0].shape }); + } else { + var a = e.apply(this.outputs[0]);if (Array.isArray(a)) throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.outputs = [a], this.inboundNodes[0].outputTensors = this.outputs, this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; + }this.layers.push(e), this.built = !1; + }, t.prototype.pop = function () { + if (0 === this.layers.length) throw new TypeError("There are no layers in the model.");if (this.layers.pop(), 0 === this.layers.length) this.outputs = [], this.inboundNodes = [], this.outboundNodes = [];else { + var e = this.layers.length - 1;this.layers[e].outboundNodes = [], this.outputs = [this.layers[e].output], this.inboundNodes[0].outputTensors = this.outputs, this.inboundNodes[0].outputShapes = [this.outputs[0].shape]; + } + }, t.prototype.call = function (e, t) { + return null == this.model && this.build(), this.model.call(e, t); + }, t.prototype.build = function (e) { + if (getExactlyOneShape(e), 0 === this.inputs.length || 0 === this.outputs.length) throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model = new Model({ inputs: this.inputs, outputs: this.outputs[0], name: this.name + "_model" }), this.model.trainable = this.trainable, this.model.updatable = this.updatable, this.supportsMasking = this.model.supportsMasking, this.inputLayers = this.model.inputLayers, this.inputLayersNodeIndices = this.model.inputLayersNodeIndices, this.inputLayersTensorIndices = this.model.inputLayersTensorIndices, this.outputLayers = this.model.outputLayers, this.outputLayersNodeIndices = this.model.outputLayersNodeIndices, this.outputLayersTensorIndices = this.model.outputLayersTensorIndices, this.nodesByDepth = this.model.nodesByDepth, this.containerNodes = this.model.containerNodes, this.outputNames = this.model.outputNames, this.inputNames = this.model.inputNames, this.built = !0; + }, t.prototype.countParams = function () { + return this.built || this.build(), e.prototype.countParams.call(this); + }, t.prototype.summary = function (t, n, r) { + void 0 === r && (r = console.log), this.built || this.build(), e.prototype.summary.call(this, t, n, r); + }, t.prototype.setWeights = function (e) { + null == this.model && this.build(), this.model.setWeights(e); + }, Object.defineProperty(t.prototype, "updatable", { get: function () { + return this._updatable; + }, set: function (e) { + this.built && (this.model.updatable = e), this._updatable = e; + }, enumerable: !0, configurable: !0 }), t.prototype.evaluate = function (e, t, n) { + if (void 0 === n && (n = {}), !this.built) throw new RuntimeError("The model needs to be compiled before being used.");return this.model.evaluate(e, t, n); + }, t.prototype.predict = function (e, t) { + return void 0 === t && (t = {}), null == this.model && this.build(), this.model.predict(e, t); + }, t.prototype.predictOnBatch = function (e) { + return null == this.model && this.build(), this.model.predictOnBatch(e); + }, t.prototype.compile = function (e) { + this.build(), this.model.compile(e), this.optimizer = this.model.optimizer, this.loss = this.model.loss, this.metrics = this.model.metrics, this.metricsTensors = this.model.metricsTensors, this.metricsNames = this.model.metricsNames; + }, t.prototype.fit = function (e, t, n) { + return void 0 === n && (n = {}), __awaiter$1(this, void 0, void 0, function () { + return __generator$1(this, function (r) { + if (!this.built) throw new RuntimeError("The model needs to be compiled before being used.");return [2, this.model.fit(e, t, n)]; + }); + }); + }, t.fromConfig = function (e, n) { + var r = new e({});if (!(r instanceof t)) throw new ValueError("Sequential.fromConfig called on non-Sequential input: " + r);if (!(n instanceof Array)) throw new ValueError("Sequential.fromConfig called without an array of configs");if (null == n[0].className || "Merge" === n[0].className) throw new ValueError("Legacy serialization format not supported yet.");for (var i = 0, a = n; i < a.length; i++) { + var o = deserialize(a[i]);r.add(o); + }return r; + }, t.prototype.getConfig = function () { + for (var e = [], t = 0, n = this.layers; t < n.length; t++) { + var r = n[t];e.push({ className: r.getClassName(), config: r.getConfig() }); + }return e; + }, t.className = "Sequential", t; + }(Model);function model(e) { + return new Model(e); + }function sequential(e) { + return new Sequential(e); + }function loadModel(e) { + return loadModelInternal(e); + }function input(e) { + return Input(e); + }serialization.SerializationMap.register(Sequential);var Activation = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.getConfig = function () { + return {}; + }, t; + }(serialization.Serializable), + Elu = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + return void 0 === t && (t = 1), elu$1(e, t); + }, t.className = "elu", t; + }(Activation);serialization.SerializationMap.register(Elu);var Selu = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return selu(e); + }, t.className = "selu", t; + }(Activation);serialization.SerializationMap.register(Selu);var Relu = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return relu(e); + }, t.className = "relu", t; + }(Activation);serialization.SerializationMap.register(Relu);var Relu6 = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return tidy(function () { + return minimum(getScalar(6), relu(e)); + }); + }, t.className = "relu6", t; + }(Activation);serialization.SerializationMap.register(Relu6);var Linear = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return e; + }, t.className = "linear", t; + }(Activation);serialization.SerializationMap.register(Linear);var Sigmoid = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return sigmoid(e); + }, t.className = "sigmoid", t; + }(Activation);serialization.SerializationMap.register(Sigmoid);var HardSigmoid = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return hardSigmoid(e); + }, t.className = "hardSigmoid", t; + }(Activation);serialization.SerializationMap.register(HardSigmoid);var Softplus = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return softplus(e); + }, t.className = "softplus", t; + }(Activation);serialization.SerializationMap.register(Softplus);var Softsign = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return softsign(e); + }, t.className = "softsign", t; + }(Activation);serialization.SerializationMap.register(Softsign);var Tanh = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e) { + return tanh$1(e); + }, t.className = "tanh", t; + }(Activation);serialization.SerializationMap.register(Tanh);var Softmax = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + return void 0 === t && (t = -1), softmax(e, t); + }, t.className = "softmax", t; + }(Activation);function serializeActivation(e) { + return e.getClassName(); + }function deserializeActivation(e, t) { + return void 0 === t && (t = {}), deserializeKerasObject(e, serialization.SerializationMap.getMap().classNameMap, t, "activation"); + }function getActivation(e) { + return null == e ? deserializeActivation({ className: "linear", config: {} }) : "string" == typeof e ? deserializeActivation({ className: e, config: {} }) : e instanceof Activation ? e : deserializeActivation(e); + }serialization.SerializationMap.register(Softmax);var LeakyReLU = function (e) { + function t(t) { + var n = e.call(this, null == t ? {} : t) || this;return n.DEFAULT_ALPHA = .3, null == t && (t = {}), n.alpha = null == t.alpha ? n.DEFAULT_ALPHA : t.alpha, n; + }return __extends$1(t, e), t.prototype.call = function (e, t) { + var n = getExactlyOneTensor(e);return leakyRelu(n, this.alpha); + }, t.prototype.computeOutputShape = function (e) { + return e; + }, t.prototype.getConfig = function () { + var t = { alpha: this.alpha }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "LeakyReLU", t; + }(Layer);serialization.SerializationMap.register(LeakyReLU);var ELU$1 = function (e) { + function t(t) { + var n = e.call(this, null == t ? {} : t) || this;if (n.DEFAULT_ALPHA = 1, null == t && (t = {}), null != t.alpha && t.alpha !== n.DEFAULT_ALPHA) throw new NotImplementedError("Non-default alpha value (" + t.alpha + ") is not supported by the ELU layer yet.");return n.alpha = null == t.alpha ? n.DEFAULT_ALPHA : t.alpha, n; + }return __extends$1(t, e), t.prototype.call = function (e, t) { + var n = getExactlyOneTensor(e);return elu(n); + }, t.prototype.computeOutputShape = function (e) { + return e; + }, t.prototype.getConfig = function () { + var t = { alpha: this.alpha }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "ELU", t; + }(Layer);serialization.SerializationMap.register(ELU$1);var ThresholdedReLU = function (e) { + function t(t) { + var n = e.call(this, null == t ? {} : t) || this;return n.DEFAULT_THETA = 1, null == t && (t = {}), n.theta = null == t.theta ? n.DEFAULT_THETA : t.theta, n.thetaTensor = getScalar(n.theta), n; + }return __extends$1(t, e), t.prototype.call = function (e, t) { + var n = getExactlyOneTensor(e);return n.mul(cast$1(n.greater(this.thetaTensor), "float32")); + }, t.prototype.computeOutputShape = function (e) { + return e; + }, t.prototype.getConfig = function () { + var t = { theta: this.theta }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "ThresholdedReLU", t; + }(Layer);serialization.SerializationMap.register(ThresholdedReLU);var Softmax$1 = function (e) { + function t(t) { + var n = e.call(this, null == t ? {} : t) || this;return n.DEFAULT_AXIS = 1, null == t && (t = {}), n.softmax = new Softmax().apply, n.axis = null == t.axis ? n.DEFAULT_AXIS : t.axis, n; + }return __extends$1(t, e), t.prototype.call = function (e, t) { + var n = getExactlyOneTensor(e);return this.softmax(n, this.axis); + }, t.prototype.computeOutputShape = function (e) { + return e; + }, t.prototype.getConfig = function () { + var t = { axis: this.axis }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "Softmax", t; + }(Layer);serialization.SerializationMap.register(Softmax$1);var Regularizer = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t; + }(serialization.Serializable), + L1L2 = function (e) { + function t(t) { + var n = e.call(this) || this, + r = null == t || null == t.l1 ? .01 : t.l1, + i = null == t || null == t.l2 ? .01 : t.l2;return n.hasL1 = 0 !== r, n.hasL2 = 0 !== i, n.l1 = getScalar(r), n.l2 = getScalar(i), n; + }return __extends$1(t, e), t.prototype.apply = function (e) { + var t = this;return tidy(function () { + var n = zeros([1]);return t.hasL1 && (n = add(n, sum(mul(t.l1, abs(e))))), t.hasL2 && (n = add(n, sum(mul(t.l2, square$1(e))))), n.asScalar(); + }); + }, t.prototype.getConfig = function () { + return { l1: this.l1.dataSync()[0], l2: this.l2.dataSync()[0] }; + }, t.fromConfig = function (e, t) { + return new e({ l1: t.l1, l2: t.l2 }); + }, t.className = "L1L2", t; + }(Regularizer);function l1(e) { + return new L1L2({ l1: null != e ? e.l1 : null, l2: 0 }); + }function l2(e) { + return new L1L2({ l2: null != e ? e.l2 : null, l1: 0 }); + }serialization.SerializationMap.register(L1L2);var REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP = { l1l2: "L1L2" };function serializeRegularizer(e) { + return serializeKerasObject(e); + }function deserializeRegularizer(e, t) { + return void 0 === t && (t = {}), deserializeKerasObject(e, serialization.SerializationMap.getMap().classNameMap, t, "regularizer"); + }function getRegularizer(e) { + return null == e ? null : "string" == typeof e ? deserializeRegularizer({ className: e in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ? REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[e] : e, config: {} }) : e instanceof Regularizer ? e : deserializeRegularizer(e); + }function normalizeArray(e, t, n) { + if ("number" == typeof e) return pyListRepeat(e, t);if (e.length !== t) throw new ValueError("The " + n + " argument must be a tuple of " + t + " integers. Received: " + e.length + " elements.");for (var r = 0; r < t; ++r) { + var i = e[r];if (!isInteger(i)) throw new ValueError("The " + n + " argument must be a tuple of " + t + " integers. Received: " + JSON.stringify(e) + " including a non-integer number " + i); + }return e; + }function convOutputLength(e, t, n, r, i) { + return void 0 === i && (i = 1), null == e ? e : (a = "same" === n ? e : e - (t + (t - 1) * (i - 1)) + 1, Math.floor((a + r - 1) / r));var a; + }function deconvLength(e, t, n, r) { + if (null == e) return null;if ("valid" === r) e = e * t + max$1([n - t, 0]);else { + if ("same" !== r) throw new ValueError("Unsupport padding mode: " + r + ".");e *= t; + }return e; + }function preprocessConv2DInput(e, t) { + return tidy(function () { + return checkDataFormat(t), "channelsFirst" === t ? transpose(e, [0, 2, 3, 1]) : e; + }); + }function conv1dWithBias(e, t, n, r, i, a, o) { + return void 0 === r && (r = 1), void 0 === i && (i = "valid"), void 0 === o && (o = 1), tidy(function () { + if (null == a && (a = imageDataFormat()), checkDataFormat(a), 3 !== e.shape.length) throw new ValueError("The input of a conv1dWithBias operation should be 3, but is " + e.shape.length + " instead.");if (3 !== t.shape.length) throw new ValueError("The kernel for a conv1dWithBias operation should be 3, but is " + t.shape.length + " instead");if (null != n && 1 !== n.shape.length) throw new ValueError("The bias for a conv1dWithBias operation should be 1, but is " + t.shape.length + " instead");if ("channelsFirst" === a && (e = transpose(e, [0, 2, 1])), "causal" === i) throw new NotImplementedError("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");var s = conv1d(e, t, r, "same" === i ? "same" : "valid", "NWC", o);return null != n && (s = biasAdd(s, n)), s; + }); + }function conv2dWithBias(e, t, n, r, i, a, o) { + return void 0 === r && (r = [1, 1]), void 0 === i && (i = "valid"), tidy(function () { + if (null == a && (a = imageDataFormat()), checkDataFormat(a), 3 !== e.rank && 4 !== e.rank) throw new ValueError("conv2dWithBias expects input to be of rank 3 or 4, but received " + e.rank + ".");if (3 !== t.rank && 4 !== t.rank) throw new ValueError("conv2dWithBias expects kernel to be of rank 3 or 4, but received " + e.rank + ".");var s = preprocessConv2DInput(e, a);if ("causal" === i) throw new NotImplementedError("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return s = conv2d(s, t, r, "same" === i ? "same" : "valid", "NHWC", o), null != n && (s = biasAdd(s, n)), "channelsFirst" === a && (s = transpose(s, [0, 3, 1, 2])), s; + }); + }var BaseConv = function (e) { + function t(n, r) { + var i = e.call(this, r) || this;if (i.bias = null, i.DEFAULT_KERNEL_INITIALIZER = "glorotNormal", i.DEFAULT_BIAS_INITIALIZER = "zeros", t.verifyConfig(r), i.rank = n, 1 !== i.rank && 2 !== i.rank) throw new NotImplementedError("Convolution layer for rank other than 1 or 2 (" + i.rank + ") is not implemented yet.");if (i.kernelSize = normalizeArray(r.kernelSize, n, "kernelSize"), i.strides = normalizeArray(null == r.strides ? 1 : r.strides, n, "strides"), i.padding = null == r.padding ? "valid" : r.padding, checkPaddingMode(i.padding), i.dataFormat = null == r.dataFormat ? "channelsLast" : r.dataFormat, checkDataFormat(i.dataFormat), i.activation = getActivation(r.activation), i.useBias = null == r.useBias || r.useBias, i.biasInitializer = getInitializer(r.biasInitializer || i.DEFAULT_BIAS_INITIALIZER), i.biasConstraint = getConstraint(r.biasConstraint), i.biasRegularizer = getRegularizer(r.biasRegularizer), i.activityRegularizer = getRegularizer(r.activityRegularizer), i.dilationRate = normalizeArray(null == r.dilationRate ? 1 : r.dilationRate, n, "dilationRate"), 1 === i.rank && Array.isArray(i.dilationRate) && 1 !== i.dilationRate.length) throw new ValueError("dilationRate must be a number or an array of a single number for 1D convolution, but received " + JSON.stringify(i.dilationRate));if (2 === i.rank) if ("number" == typeof i.dilationRate) i.dilationRate = [i.dilationRate, i.dilationRate];else if (2 !== i.dilationRate.length) throw new ValueError("dilationRate must be a number or array of two numbers for 2D convolution, but received " + JSON.stringify(i.dilationRate));return i; + }return __extends$1(t, e), t.verifyConfig = function (e) { + if (assert$1("kernelSize" in e, "required key 'kernelSize' not in config"), "number" != typeof e.kernelSize && !checkArrayTypeAndLength(e.kernelSize, "number", 1, 2)) throw new ValueError("BaseConv expects config.kernelSize to be number or number[] with length 1 or 2, but received " + JSON.stringify(e.kernelSize) + "."); + }, t.prototype.getConfig = function () { + var t = { kernelSize: this.kernelSize, strides: this.strides, padding: this.padding, dataFormat: this.dataFormat, dilationRate: this.dilationRate, activation: serializeActivation(this.activation), useBias: this.useBias, biasInitializer: serializeInitializer(this.biasInitializer), biasRegularizer: serializeRegularizer(this.biasRegularizer), activityRegularizer: serializeRegularizer(this.activityRegularizer), biasConstraint: serializeConstraint(this.biasConstraint) }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t; + }(Layer), + Conv = function (e) { + function t(n, r) { + var i = e.call(this, n, r) || this;return i.kernel = null, t.verifyConfig(r), i.filters = r.filters, i.kernelInitializer = getInitializer(r.kernelInitializer || i.DEFAULT_KERNEL_INITIALIZER), i.kernelConstraint = getConstraint(r.kernelConstraint), i.kernelRegularizer = getRegularizer(r.kernelRegularizer), i; + }return __extends$1(t, e), t.prototype.build = function (e) { + e = getExactlyOneShape(e);var t = "channelsFirst" === this.dataFormat ? 1 : e.length - 1;if (null == e[t]) throw new ValueError("The channel dimension of the input should be defined. Found " + e[t]);var n, + r = e[t], + i = this.kernelSize.concat([r, this.filters]);this.kernel = this.addWeight("kernel", i, null, this.kernelInitializer, this.kernelRegularizer, !0, this.kernelConstraint), this.useBias && (this.bias = this.addWeight("bias", [this.filters], null, this.biasInitializer, this.biasRegularizer, !0, this.biasConstraint)), this.inputSpec = [{ ndim: this.rank + 2, axes: (n = {}, n[t] = r, n) }], this.built = !0; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var t;e = getExactlyOneTensor(e);var r = null == n.bias ? null : n.bias.read();if (1 === n.rank) t = conv1dWithBias(e, n.kernel.read(), r, n.strides[0], n.padding, n.dataFormat, n.dilationRate[0]);else if (2 === n.rank) t = conv2dWithBias(e, n.kernel.read(), r, n.strides, n.padding, n.dataFormat, n.dilationRate);else if (3 === n.rank) throw new NotImplementedError("3D convolution is not implemented yet.");return null != n.activation && (t = n.activation.apply(t)), t; + }); + }, t.prototype.computeOutputShape = function (e) { + e = getExactlyOneShape(e);for (var t = [], n = "channelsLast" === this.dataFormat ? e.slice(1, e.length - 1) : e.slice(2), r = 0; r < n.length; ++r) { + var i = convOutputLength(n[r], this.kernelSize[r], this.padding, this.strides[r], "number" == typeof this.dilationRate ? this.dilationRate : this.dilationRate[r]);t.push(i); + }var a = [e[0]];return "channelsLast" === this.dataFormat ? (a = a.concat(t)).push(this.filters) : (a.push(this.filters), a = a.concat(t)), a; + }, t.prototype.getConfig = function () { + var t = { filters: this.filters, kernelInitializer: serializeInitializer(this.kernelInitializer), kernelRegularizer: serializeRegularizer(this.kernelRegularizer), kernelConstraint: serializeConstraint(this.kernelConstraint) }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.verifyConfig = function (e) { + if (!("filters" in e) || "number" != typeof e.filters || e.filters < 1) throw new ValueError("Convolution layer expected config.filters to be a 'number' > 0 but got " + JSON.stringify(e.filters)); + }, t; + }(BaseConv), + Conv2D = function (e) { + function t(n) { + var r = e.call(this, 2, n) || this;return t.verifyConfig(n), r; + }return __extends$1(t, e), t.prototype.getConfig = function () { + var t = e.prototype.getConfig.call(this);return delete t.rank, t; + }, t.verifyConfig = function (e) { + if ("number" != typeof e.kernelSize && !checkArrayTypeAndLength(e.kernelSize, "number", 1, 2)) throw new ValueError("Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received " + JSON.stringify(e.kernelSize) + "."); + }, t.className = "Conv2D", t; + }(Conv);serialization.SerializationMap.register(Conv2D);var Conv2DTranspose = function (e) { + function t(t) { + var n = e.call(this, t) || this;if (n.inputSpec = [new InputSpec({ ndim: 4 })], "same" !== n.padding && "valid" !== n.padding) throw new ValueError("Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode " + n.padding);return n; + }return __extends$1(t, e), t.prototype.build = function (e) { + if (4 !== (e = getExactlyOneShape(e)).length) throw new ValueError("Input should have rank 4; Received input shape: " + JSON.stringify(e));var t = "channelsFirst" === this.dataFormat ? 1 : e.length - 1;if (null == e[t]) throw new ValueError("The channel dimension of the inputs should be defined. Found `None`.");var n, + r = e[t], + i = this.kernelSize.concat([this.filters, r]);this.kernel = this.addWeight("kernel", i, "float32", this.kernelInitializer, this.kernelRegularizer, !0, this.kernelConstraint), this.useBias && (this.bias = this.addWeight("bias", [this.filters], "float32", this.biasInitializer, this.biasRegularizer, !0, this.biasConstraint)), this.inputSpec = [new InputSpec({ ndim: 4, axes: (n = {}, n[t] = r, n) })], this.built = !0; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var t = getExactlyOneTensor(e);if (4 !== t.shape.length) throw new ValueError("Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-" + t.shape.length);var r, + i, + a = t.shape, + o = a[0];"channelsFirst" === n.dataFormat ? (r = 2, i = 3) : (r = 1, i = 2);var s = a[r], + l = a[i], + u = n.kernelSize[0], + c = n.kernelSize[1], + p = n.strides[0], + h = n.strides[1], + d = [o, deconvLength(s, p, u, n.padding), deconvLength(l, h, c, n.padding), n.filters];"channelsLast" !== n.dataFormat && (t = transpose(t, [0, 2, 3, 1]));var g = conv2dTranspose(t, n.kernel.read(), d, n.strides, n.padding);return "channelsLast" !== n.dataFormat && (g = transpose(g, [0, 3, 1, 2])), null != n.bias && (g = biasAdd(g, n.bias.read(), n.dataFormat)), null != n.activation && (g = n.activation.apply(g)), g; + }); + }, t.prototype.computeOutputShape = function (e) { + var t, + n, + r, + i = (e = getExactlyOneShape(e)).slice();"channelsFirst" === this.dataFormat ? (t = 1, n = 2, r = 3) : (t = 3, n = 1, r = 2);var a = this.kernelSize[0], + o = this.kernelSize[1], + s = this.strides[0], + l = this.strides[1];return i[t] = this.filters, i[n] = deconvLength(i[n], s, a, this.padding), i[r] = deconvLength(i[r], l, o, this.padding), i; + }, t.prototype.getConfig = function () { + var t = e.prototype.getConfig.call(this);return delete t.dilationRate, t; + }, t.className = "Conv2DTranspose", t; + }(Conv2D);serialization.SerializationMap.register(Conv2DTranspose);var SeparableConv = function (e) { + function t(t, n) { + var r = e.call(this, t, n) || this;if (r.DEFAULT_DEPTHWISE_INITIALIZER = "glorotUniform", r.DEFAULT_POINTWISE_INITIALIZER = "glorotUniform", r.depthwiseKernel = null, r.pointwiseKernel = null, null == n.filters) throw new ValueError("The `filters` configuration field is required by SeparableConv, but is unspecified.");if (null != n.kernelInitializer || null != n.kernelRegularizer || null != n.kernelConstraint) throw new ValueError("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if (null != n.padding && "same" !== n.padding && "valid" !== n.padding) throw new ValueError("SeparableConv" + r.rank + "D supports only padding modes: 'same' and 'valid', but received " + JSON.stringify(n.padding));return r.depthMultiplier = null == n.depthMultiplier ? 1 : n.depthMultiplier, r.depthwiseInitializer = getInitializer(n.depthwiseInitializer || r.DEFAULT_DEPTHWISE_INITIALIZER), r.depthwiseRegularizer = getRegularizer(n.depthwiseRegularizer), r.depthwiseConstraint = getConstraint(n.depthwiseConstraint), r.pointwiseInitializer = getInitializer(n.depthwiseInitializer || r.DEFAULT_POINTWISE_INITIALIZER), r.pointwiseRegularizer = getRegularizer(n.pointwiseRegularizer), r.pointwiseConstraint = getConstraint(n.pointwiseConstraint), r; + }return __extends$1(t, e), t.prototype.build = function (e) { + if ((e = getExactlyOneShape(e)).length < this.rank + 2) throw new ValueError("Inputs to SeparableConv" + this.rank + "D should have rank " + (this.rank + 2) + ", but received input shape: " + JSON.stringify(e));var t = "channelsFirst" === this.dataFormat ? 1 : e.length - 1;if (null == e[t] || e[t] < 0) throw new ValueError("The channel dimension of the inputs should be defined, but found " + JSON.stringify(e[t]));for (var n = e[t], r = this.kernelSize.concat([n, this.depthMultiplier]), i = [], a = 0; a < this.rank; ++a) i.push(1);i.push(n * this.depthMultiplier, this.filters);var o;this.depthwiseKernel = this.addWeight("depthwise_kernel", r, "float32", this.depthwiseInitializer, this.depthwiseRegularizer, !0, this.depthwiseConstraint), this.pointwiseKernel = this.addWeight("pointwise_kernel", i, "float32", this.pointwiseInitializer, this.pointwiseRegularizer, !0, this.pointwiseConstraint), this.useBias ? this.bias = this.addWeight("bias", [this.filters], "float32", this.biasInitializer, this.biasRegularizer, !0, this.biasConstraint) : this.bias = null, this.inputSpec = [new InputSpec({ ndim: this.rank + 2, axes: (o = {}, o[t] = n, o) })], this.built = !0; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var t;if (e = getExactlyOneTensor(e), 1 === n.rank) throw new NotImplementedError("1D separable convolution is not implemented yet.");return 2 === n.rank && ("channelsFirst" === n.dataFormat && (e = transpose(e, [0, 2, 3, 1])), t = separableConv2d(e, n.depthwiseKernel.read(), n.pointwiseKernel.read(), n.strides, n.padding, n.dilationRate, "NHWC")), n.useBias && (t = biasAdd(t, n.bias.read(), n.dataFormat)), null != n.activation && (t = n.activation.apply(t)), "channelsFirst" === n.dataFormat && (t = transpose(t, [0, 3, 1, 2])), t; + }); + }, t.prototype.getConfig = function () { + var t = e.prototype.getConfig.call(this);return delete t.rank, delete t.kernelInitializer, delete t.kernelRegularizer, delete t.kernelConstraint, t.depthwiseInitializer = serializeInitializer(this.depthwiseInitializer), t.pointwiseInitializer = serializeInitializer(this.pointwiseInitializer), t.depthwiseRegularizer = serializeRegularizer(this.depthwiseRegularizer), t.pointwiseRegularizer = serializeRegularizer(this.pointwiseRegularizer), t.depthwiseConstraint = serializeConstraint(this.depthwiseConstraint), t.pointwiseConstraint = serializeConstraint(this.pointwiseConstraint), t; + }, t.className = "SeparableConv", t; + }(Conv), + SeparableConv2D = function (e) { + function t(t) { + return e.call(this, 2, t) || this; + }return __extends$1(t, e), t.className = "SeparableConv2D", t; + }(SeparableConv);serialization.SerializationMap.register(SeparableConv2D);var Conv1D = function (e) { + function t(n) { + var r = e.call(this, 1, n) || this;return t.verifyConfig(n), r.inputSpec = [{ ndim: 3 }], r; + }return __extends$1(t, e), t.prototype.getConfig = function () { + var t = e.prototype.getConfig.call(this);return delete t.rank, delete t.dataFormat, t; + }, t.verifyConfig = function (e) { + if ("number" != typeof e.kernelSize && !checkArrayTypeAndLength(e.kernelSize, "number", 1, 1)) throw new ValueError("Conv1D expects config.kernelSize to be number or number[] with length 1, but received " + JSON.stringify(e.kernelSize) + "."); + }, t.className = "Conv1D", t; + }(Conv);serialization.SerializationMap.register(Conv1D);var Cropping2D = function (e) { + function t(t) { + var n = e.call(this, t) || this;return "number" == typeof t.cropping ? n.cropping = [[t.cropping, t.cropping], [t.cropping, t.cropping]] : "number" == typeof t.cropping[0] ? n.cropping = [[t.cropping[0], t.cropping[0]], [t.cropping[1], t.cropping[1]]] : n.cropping = t.cropping, n.dataFormat = void 0 === t.dataFormat ? "channelsLast" : t.dataFormat, n.inputSpec = [{ ndim: 4 }], n; + }return __extends$1(t, e), t.prototype.computeOutputShape = function (e) { + return "channelsFirst" === this.dataFormat ? [e[0], e[1], e[2] - this.cropping[0][0] - this.cropping[0][1], e[2] - this.cropping[1][0] - this.cropping[1][1]] : [e[0], e[1] - this.cropping[0][0] - this.cropping[0][1], e[2] - this.cropping[1][0] - this.cropping[1][1], e[3]]; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + return e = getExactlyOneTensor(e), "channelsLast" === n.dataFormat ? sliceAlongAxis(sliceAlongAxis(e, n.cropping[0][0], e.shape[1] - n.cropping[0][0] - n.cropping[0][1], 2), n.cropping[1][0], e.shape[2] - n.cropping[1][1] - n.cropping[1][0], 3) : sliceAlongAxis(sliceAlongAxis(e, n.cropping[0][0], e.shape[2] - n.cropping[0][0] - n.cropping[0][1], 3), n.cropping[1][0], e.shape[3] - n.cropping[1][1] - n.cropping[1][0], 4); + }); + }, t.prototype.getConfig = function () { + var t = { cropping: this.cropping, dataFormat: this.dataFormat }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "Cropping2D", t; + }(Layer);serialization.SerializationMap.register(Cropping2D);var UpSampling2D = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.DEFAULT_SIZE = [2, 2], n.inputSpec = [{ ndim: 4 }], n.size = null == t.size ? n.DEFAULT_SIZE : t.size, n.dataFormat = null == t.dataFormat ? "channelsLast" : t.dataFormat, n; + }return __extends$1(t, e), t.prototype.computeOutputShape = function (e) { + if ("channelsFirst" === this.dataFormat) { + var t = null == e[2] ? null : this.size[0] * e[2], + n = null == e[3] ? null : this.size[1] * e[3];return [e[0], e[1], t, n]; + }t = null == e[1] ? null : this.size[0] * e[1], n = null == e[2] ? null : this.size[1] * e[2];return [e[0], t, n, e[3]]; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var t = getExactlyOneTensor(e), + r = t.shape;if ("channelsFirst" === n.dataFormat) { + t = transpose(t, [0, 2, 3, 1]);var i = n.size[0] * r[2], + a = n.size[1] * r[3], + o = t.resizeNearestNeighbor([i, a]);return transpose(o, [0, 3, 1, 2]); + }i = n.size[0] * r[1], a = n.size[1] * r[2];return t.resizeNearestNeighbor([i, a]); + }); + }, t.prototype.getConfig = function () { + var t = { size: this.size, dataFormat: this.dataFormat }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "UpSampling2D", t; + }(Layer);function depthwiseConv2d$1(e, t, n, r, i, a) { + return void 0 === n && (n = [1, 1]), void 0 === r && (r = "valid"), tidy(function () { + null == i && (i = imageDataFormat()), checkDataFormat(i);var o = preprocessConv2DInput(e, i);if (4 !== e.rank) throw new ValueError("Input for depthwiseConv2d is required to be 4-D, but is instead " + e.rank + "-D");if (4 !== t.rank) throw new ValueError("depthwiseKernel is required to be 4-D, but is instead " + t.rank + "-D");return o = depthwiseConv2d(o, t, n, "same" === r ? "same" : "valid", "NHWC", a), "channelsFirst" === i && (o = transpose(o, [0, 3, 1, 2])), o; + }); + }serialization.SerializationMap.register(UpSampling2D);var DepthwiseConv2D = function (e) { + function t(t) { + var n = e.call(this, 2, t) || this;return n.depthwiseKernel = null, n.depthMultiplier = null == t.depthMultiplier ? 1 : t.depthMultiplier, n.depthwiseInitializer = getInitializer(t.depthwiseInitializer || n.DEFAULT_KERNEL_INITIALIZER), n.depthwiseConstraint = getConstraint(t.depthwiseConstraint), n.depthwiseRegularizer = getRegularizer(t.depthwiseRegularizer), n; + }return __extends$1(t, e), t.prototype.build = function (e) { + if ((e = getExactlyOneShape(e)).length < 4) throw new ValueError("Inputs to DepthwiseConv2D should have rank 4. Received input shape: " + JSON.stringify(e) + ".");var t = "channelsFirst" === this.dataFormat ? 1 : 3;if (null == e[t] || e[t] < 0) throw new ValueError("The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (" + e[t] + ").");var n = e[t], + r = [this.kernelSize[0], this.kernelSize[1], n, this.depthMultiplier];this.depthwiseKernel = this.addWeight("depthwise_kernel", r, null, this.depthwiseInitializer, this.depthwiseRegularizer, !0, this.depthwiseConstraint), this.useBias ? this.bias = this.addWeight("bias", [n * this.depthMultiplier], null, this.biasInitializer, this.biasRegularizer, !0, this.biasConstraint) : this.bias = null, this.built = !0; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var t = depthwiseConv2d$1(e = getExactlyOneTensor(e), n.depthwiseKernel.read(), n.strides, n.padding, n.dataFormat, null);return n.useBias && (t = biasAdd(t, n.bias.read(), n.dataFormat)), null != n.activation && (t = n.activation.apply(t)), t; + }); + }, t.prototype.computeOutputShape = function (e) { + e = getExactlyOneShape(e);var t = "channelsFirst" === this.dataFormat ? e[2] : e[1], + n = "channelsFirst" === this.dataFormat ? e[3] : e[2], + r = "channelsFirst" === this.dataFormat ? e[1] * this.depthMultiplier : e[3] * this.depthMultiplier, + i = convOutputLength(t, this.kernelSize[0], this.padding, this.strides[0]), + a = convOutputLength(n, this.kernelSize[1], this.padding, this.strides[1]);return "channelsFirst" === this.dataFormat ? [e[0], r, i, a] : [e[0], i, a, r]; + }, t.prototype.getConfig = function () { + var t = e.prototype.getConfig.call(this);return t.depthMultiplier = this.depthMultiplier, t.depthwiseInitializer = serializeInitializer(this.depthwiseInitializer), t.depthwiseRegularizer = serializeRegularizer(this.depthwiseRegularizer), t.depthwiseConstraint = serializeConstraint(this.depthwiseRegularizer), t; + }, t.className = "DepthwiseConv2D", t; + }(BaseConv);serialization.SerializationMap.register(DepthwiseConv2D);var Dropout = function (e) { + function t(t) { + var n = e.call(this, t) || this;if (n.rate = Math.max(Math.min(t.rate, 1), 0), n.rateScalar = getScalar(n.rate), n.noiseShape = t.noiseShape, n.seed = t.seed, null != n.seed) throw new NotImplementedError("Non-default seed is not implemented in Dropout layer yet: " + n.seed);return n.supportsMasking = !0, n; + }return __extends$1(t, e), t.prototype.getNoiseShape = function (e) { + if (null == this.noiseShape) return this.noiseShape;for (var t = e.shape, n = [], r = 0; r < this.noiseShape.length; ++r) n.push(null == this.noiseShape[r] ? t[r] : this.noiseShape[r]);return n; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + n.invokeCallHook(e, t);var r = getExactlyOneTensor(e);if (null != n.noiseShape && !util.arraysEqual(r.shape, n.noiseShape)) throw new NotImplementedError("Non-default noise shape is not implemented in Dropout layer yet: " + JSON.stringify(n.noiseShape));if (0 < n.rate && n.rate < 1) { + var i = null != t.training && t.training, + a = n.getNoiseShape(r);return inTrainPhase(function () { + return dropout(r, n.rateScalar, a, n.seed); + }, function () { + return r; + }, i); + }return e; + }); + }, t.prototype.getConfig = function () { + var t = { rate: this.rate, noiseShape: this.noiseShape, seed: this.seed }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "Dropout", t; + }(Layer);serialization.SerializationMap.register(Dropout);var Dense = function (e) { + function t(t) { + var n = e.call(this, t) || this;if (n.activation = null, n.useBias = !0, n.kernel = null, n.bias = null, n.DEFAULT_KERNEL_INITIALIZER = "glorotNormal", n.DEFAULT_BIAS_INITIALIZER = "zeros", null == t.batchInputShape && null == t.inputShape && null != t.inputDim) { + var r = null;null != t.batchSize && (r = t.batchSize), n.batchInputShape = [r, t.inputDim]; + }return n.units = t.units, n.activation = getActivation(t.activation), null != t.useBias && (n.useBias = t.useBias), n.kernelInitializer = getInitializer(t.kernelInitializer || n.DEFAULT_KERNEL_INITIALIZER), n.biasInitializer = getInitializer(t.biasInitializer || n.DEFAULT_BIAS_INITIALIZER), n.kernelConstraint = getConstraint(t.kernelConstraint), n.biasConstraint = getConstraint(t.biasConstraint), n.kernelRegularizer = getRegularizer(t.kernelRegularizer), n.biasRegularizer = getRegularizer(t.biasRegularizer), n.activityRegularizer = getRegularizer(t.activityRegularizer), n.inputSpec = [{ minNDim: 2 }], n; + }return __extends$1(t, e), t.prototype.build = function (e) { + var t, + n = (e = getExactlyOneShape(e))[e.length - 1];null == this.kernel && (this.kernel = this.addWeight("kernel", [n, this.units], null, this.kernelInitializer, this.kernelRegularizer, !0, this.kernelConstraint), this.useBias && (this.bias = this.addWeight("bias", [this.units], null, this.biasInitializer, this.biasRegularizer, !0, this.biasConstraint))), this.inputSpec = [{ minNDim: 2, axes: (t = {}, t[-1] = n, t) }], this.built = !0; + }, t.prototype.computeOutputShape = function (e) { + var t = (e = getExactlyOneShape(e)).slice();return t[t.length - 1] = this.units, t; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + n.invokeCallHook(e, t);var r = dot$1(getExactlyOneTensor(e), n.kernel.read());return null != n.bias && (r = biasAdd(r, n.bias.read())), null != n.activation && (r = n.activation.apply(r)), r; + }); + }, t.prototype.getConfig = function () { + var t = { units: this.units, activation: serializeActivation(this.activation), useBias: this.useBias, kernelInitializer: serializeInitializer(this.kernelInitializer), biasInitializer: serializeInitializer(this.biasInitializer), kernelRegularizer: serializeRegularizer(this.kernelRegularizer), biasRegularizer: serializeRegularizer(this.biasRegularizer), activityRegularizer: serializeRegularizer(this.activityRegularizer), kernelConstraint: serializeConstraint(this.kernelConstraint), biasConstraint: serializeConstraint(this.biasConstraint) }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "Dense", t; + }(Layer);serialization.SerializationMap.register(Dense);var Flatten = function (e) { + function t(t) { + var n = e.call(this, t || {}) || this;return n.inputSpec = [{ minNDim: 3 }], n; + }return __extends$1(t, e), t.prototype.computeOutputShape = function (e) { + for (var t = 0, n = (e = getExactlyOneShape(e)).slice(1); t < n.length; t++) { + if (null == n[t]) throw new ValueError('The shape of the input to "Flatten" is not fully defined (got ' + e.slice(1) + '). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.'); + }return [e[0], arrayProd(e, 1)]; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + return n.invokeCallHook(e, t), batchFlatten(getExactlyOneTensor(e)); + }); + }, t.className = "Flatten", t; + }(Layer);serialization.SerializationMap.register(Flatten);var Activation$1 = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.supportsMasking = !0, n.activation = getActivation(t.activation), n; + }return __extends$1(t, e), t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + n.invokeCallHook(e, t);var r = getExactlyOneTensor(e);return n.activation.apply(r); + }); + }, t.prototype.getConfig = function () { + var t = { activation: serializeActivation(this.activation) }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "Activation", t; + }(Layer);serialization.SerializationMap.register(Activation$1);var RepeatVector = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.n = t.n, n.inputSpec = [{ ndim: 2 }], n; + }return __extends$1(t, e), t.prototype.computeOutputShape = function (e) { + return [e[0], this.n, e[1]]; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + return repeat(e = getExactlyOneTensor(e), n.n); + }); + }, t.prototype.getConfig = function () { + var t = { n: this.n }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "RepeatVector", t; + }(Layer);serialization.SerializationMap.register(RepeatVector);var Reshape = function (e) { + function t(t) { + var n = e.call(this, t) || this;n.targetShape = t.targetShape;for (var r = 0; r < n.targetShape.length; ++r) n.isUnknown(n.targetShape[r]) && (n.targetShape[r] = null);return n; + }return __extends$1(t, e), t.prototype.isUnknown = function (e) { + return e < 0 || null == e; + }, t.prototype.fixUnknownDimension = function (e, t) { + for (var n = "Total size of new array must be unchanged.", r = t.slice(), i = 1, a = null, o = 0; o < r.length; ++o) { + var s = r[o];if (this.isUnknown(s)) { + if (null !== a) throw new ValueError("Can only specifiy one unknown dimension.");a = o; + } else i *= s; + }var l = arrayProd(e);if (null !== a) { + if (0 === i || l % i != 0) throw new ValueError(n);r[a] = l / i; + } else if (l !== i) throw new ValueError(n);return r; + }, t.prototype.computeOutputShape = function (e) { + for (var t = !1, n = 0; n < e.length; ++n) if (this.isUnknown(e[n])) { + t = !0;break; + }return t ? e.slice(0, 1).concat(this.targetShape) : e.slice(0, 1).concat(this.fixUnknownDimension(e.slice(1), this.targetShape)); + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + n.invokeCallHook(e, t);var r = getExactlyOneTensor(e), + i = r.shape, + a = i.slice(0, 1).concat(n.fixUnknownDimension(i.slice(1), n.targetShape));return r.reshape(a); + }); + }, t.prototype.getConfig = function () { + var t = { targetShape: this.targetShape }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "Reshape", t; + }(Layer);serialization.SerializationMap.register(Reshape);var Embedding = function (e) { + function t(t) { + var n = e.call(this, t) || this;if (n.embeddings = null, n.DEFAULT_EMBEDDINGS_INITIALIZER = "randomUniform", null == t.batchInputShape && null == t.inputShape) { + var r = null;null != t.batchSize && (r = t.batchSize), null == t.inputLength ? n.batchInputShape = [r, null] : n.batchInputShape = [r].concat(toList(t.inputLength)); + }return n.inputDim = t.inputDim, n.outputDim = t.outputDim, n.embeddingsInitializer = getInitializer(t.embeddingsInitializer || n.DEFAULT_EMBEDDINGS_INITIALIZER), n.embeddingsRegularizer = getRegularizer(t.embeddingsRegularizer), n.activityRegularizer = getRegularizer(t.activityRegularizer), n.embeddingsConstraint = getConstraint(t.embeddingsConstraint), n.maskZero = t.maskZero, n.inputLength = t.inputLength, n; + }return __extends$1(t, e), t.prototype.build = function (e) { + this.embeddings = this.addWeight("embeddings", [this.inputDim, this.outputDim], this.dtype, this.embeddingsInitializer, this.embeddingsRegularizer, !0, this.embeddingsConstraint), this.built = !0; + }, t.prototype.warnOnIncompatibleInputShape = function (e) {}, t.prototype.computeMask = function (e, t) { + throw new NotImplementedError("computeMask has not been implemented for Embedding yet"); + }, t.prototype.computeOutputShape = function (e) { + if (e = getExactlyOneShape(e), null == this.inputLength) return e.concat([this.outputDim]);var t = toList(this.inputLength);if (t.length !== e.length - 1) throw new ValueError('"inputLength" is ' + this.inputLength + ", but received input shape has shape " + e);for (var n = 0, r = 0; r < t.length; ++r) { + var i = t[r], + a = e[r + 1];if (null != i && null != a && i !== a) throw new ValueError('"inputLength" is ' + this.inputLength + ", but received input shape has shape " + e);null == i && (t[n] = a), n++; + }return [e[0]].concat(t, [this.outputDim]); + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + n.invokeCallHook(e, t);var r = getExactlyOneTensor(e);return "int32" !== r.dtype && (r = cast$1(r, "int32")), gather$1(n.embeddings.read(), r.as1D()).reshape(getExactlyOneShape(n.computeOutputShape(r.shape))); + }); + }, t.prototype.getConfig = function () { + var t = { inputDim: this.inputDim, outputDim: this.outputDim, embeddingsInitializer: serializeInitializer(this.embeddingsInitializer), embeddingsRegularizer: serializeRegularizer(this.embeddingsRegularizer), activityRegularizer: serializeRegularizer(this.activityRegularizer), embeddingsConstraint: serializeConstraint(this.embeddingsConstraint), maskZero: this.maskZero, inputLength: this.inputLength }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "Embedding", t; + }(Layer);serialization.SerializationMap.register(Embedding);var Merge = function (e) { + function t(t) { + var n = e.call(this, t || {}) || this;return n.supportsMasking = !0, n; + }return __extends$1(t, e), t.prototype.mergeFunction = function (e) { + throw new NotImplementedError(); + }, t.prototype.computeElementwiseOpOutputShape = function (e, t) { + if (null == e || null == t) return null;if (e.length < t.length) return this.computeElementwiseOpOutputShape(t, e);if (0 === t.length) return e;for (var n = e.slice(0, e.length - t.length), r = 0; r < t.length; ++r) { + var i = e[e.length - t.length + r], + a = t[r];if (null == i || null == a || i < 0 || a < 0) n.push(null);else if (1 === i) n.push(a);else if (1 === a) n.push(i);else { + if (i !== a) throw new ValueError("Operands could not be broadcast together with shapes " + JSON.stringify(e) + " " + JSON.stringify(t));n.push(i); + } + }return n; + }, t.prototype.build = function (e) { + if (Array.isArray(e) && !Array.isArray(e[0]) && (e = [getExactlyOneShape(e)]), (e = e).length < 2) throw new ValueError("A merge layer should be called on an Array of at least 2 inputs. Got " + e.length + " input(s).");for (var t = [], n = 0, r = e; n < r.length; n++) { + null != (o = r[n]) && null !== o[0] && t.push(o[0]); + }if ((t = unique(t)).length > 1) throw new ValueError("Can not merge tensors with different batch sizes. Got tensors with shapes: " + JSON.stringify(e) + ".");for (var i = null == e[0] ? null : e[0].slice(1), a = 1; a < e.length; ++a) { + var o = null == e[a] ? null : e[a].slice(1);i = this.computeElementwiseOpOutputShape(i, o); + }var s = e.map(function (e) { + return e.length; + });-1 === e.indexOf(null) && 1 === unique(s).length ? this.reshapeRequired = !1 : this.reshapeRequired = !0; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + if (e = e, n.reshapeRequired) { + var t = [], + r = e.map(function (e) { + return e.rank; + });if (-1 === r.indexOf(null)) { + for (var i = max$1(r), a = 0, o = e; a < o.length; a++) { + for (var s = (h = o[a]).rank, l = 0; l < i - s; ++l) h = expandDims$1(h, 1);t.push(h); + }return n.mergeFunction(t); + }for (var u = !1, c = 0, p = e; c < p.length; c++) { + var h;if (null == (s = (h = p[c]).rank)) { + var d = h.shape, + g = d[0], + f = d.slice(1).concat([g]), + m = h.reshape([g].concat(arrayProd(d.slice(1))));m = (m = transpose(m, [1, 0])).reshape(f), t.push(m), u = !0; + } else if (s > 1) { + var y = range$1(1, s).concat([0]);t.push(transpose(h, y)), u = !0; + } else t.push(h); + }var v = n.mergeFunction(t), + b = v.rank;if (u) if (null == b) { + var z = v.shape;f = [g = z[z.length - 1]].concat(z.slice(0, z.length - 1));v = transpose(v.reshape([-1, g]), [1, 0]).reshape(f); + } else if (b > 1) { + y = [b - 1].concat(range$1(0, b - 1));v = transpose(v, y); + }return v; + }return n.mergeFunction(e); + }); + }, t.prototype.computeOutputShape = function (e) { + var t;t = null == (e = e)[0] ? null : e[0].slice(1);for (var n = 1; n < e.length; ++n) { + var r = null == e[n] ? null : e[n].slice(1);t = this.computeElementwiseOpOutputShape(t, r); + }for (var i = [], a = 0, o = e; a < o.length; a++) { + null != (r = o[a]) && null !== r[0] && i.push(r[0]); + }return t = 1 === (i = unique(i)).length ? i.concat(t) : [null].concat(t); + }, t; + }(Layer), + Add = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.mergeFunction = function (e) { + return tidy(function () { + for (var t = zeros(e[0].shape), n = 0, r = e; n < r.length; n++) { + var i = r[n];t = add(t, i); + }return t; + }); + }, t.className = "Add", t; + }(Merge);serialization.SerializationMap.register(Add);var Multiply = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.mergeFunction = function (e) { + return tidy(function () { + for (var t = ones$1(e[0].shape), n = 0, r = e; n < r.length; n++) { + var i = r[n];t = mul(t, i); + }return t; + }); + }, t.className = "Multiply", t; + }(Merge);serialization.SerializationMap.register(Multiply);var Average = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.mergeFunction = function (e) { + return tidy(function () { + for (var t = zeros(e[0].shape), n = 0, r = e; n < r.length; n++) { + var i = r[n];t = add(t, i); + }return mul(getScalar(1 / e.length), t); + }); + }, t.className = "Average", t; + }(Merge);serialization.SerializationMap.register(Average);var Maximum = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.mergeFunction = function (e) { + return tidy(function () { + for (var t = e[0], n = 1; n < e.length; ++n) t = maximum(t, e[n]);return t; + }); + }, t.className = "Maximum", t; + }(Merge);serialization.SerializationMap.register(Maximum);var Minimum = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.mergeFunction = function (e) { + return tidy(function () { + for (var t = e[0], n = 1; n < e.length; ++n) t = minimum(t, e[n]);return t; + }); + }, t.className = "Minimum", t; + }(Merge);serialization.SerializationMap.register(Minimum);var Concatenate = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.DEFAULT_AXIS = -1, null == t && (t = {}), n.axis = null == t.axis ? n.DEFAULT_AXIS : t.axis, n.supportsMasking = !0, n.reshapeRequired = !1, n; + }return __extends$1(t, e), t.prototype.build = function (e) { + if (!Array.isArray(e) || !Array.isArray(e[0]) || 1 === e.length) throw new ValueError("A `Concatenate` layer should be called on a list of at least 2 inputs");for (var t = !0, n = 0, r = e = e; n < r.length; n++) { + if (null != (c = r[n])) { + t = !1;break; + } + }if (!t) { + for (var i = [], a = 0; a < e.length; ++a) { + var o = e[a].slice();o.splice(this.axis, 1);for (var s = !1, l = 0, u = i; l < u.length; l++) { + var c = u[l];if (util.arraysEqual(c, o)) { + s = !0;break; + } + }s || i.push(o); + }if (i.length > 1) throw new ValueError("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: " + JSON.stringify(e)); + } + }, t.prototype.mergeFunction = function (e) { + var t = this;return tidy(function () { + return concatenate(e, t.axis); + }); + }, t.prototype.computeOutputShape = function (e) { + if (!Array.isArray(e) || !Array.isArray(e[0])) throw new ValueError("A `Concatenate` layer should be called on a list of inputs.");for (var t = e, n = t[0].slice(), r = this.axis < 0 ? n.length + this.axis : this.axis, i = 0, a = t.slice(1); i < a.length; i++) { + var o = a[i];if (null == n[r] || null == o[r]) { + n[r] = null;break; + }n[r] += o[r]; + }return n; + }, t.prototype.getConfig = function () { + var t = { axis: this.axis }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "Concatenate", t; + }(Merge);function batchNormalization$1(e, t, n, r, i, a) { + var o;if (void 0 === a && (a = .001), 2 === e.rank) o = batchNormalization2d(e, t, n, a, i, r);else if (3 === e.rank) o = batchNormalization3d(e, t, n, a, i, r);else { + if (4 !== e.rank) throw new NotImplementedError("batchNormalization is not implememnted for array of rank " + e.rank + " yet");o = batchNormalization4d(e, t, n, a, i, r); + }return o; + }function regularNormalizeBatchInTraining(e, t, n, r, i) { + return void 0 === i && (i = .001), tidy(function () { + var a = moments(e, r), + o = a.mean, + s = a.variance;return [batchNormalization$1(e, o, s, n, t, i), o, s]; + }); + }function broadcastNormalizeBatchInTraining(e, t, n, r, i) { + return void 0 === i && (i = .001), tidy(function () { + for (var a = moments(e, r), o = a.mean, s = a.variance, l = [], u = 0, c = range$1(0, e.rank); u < c.length; u++) { + var p = c[u];-1 !== r.indexOf(p) ? l.push(1) : l.push(e.shape[p]); + }var h = o.reshape(l), + d = s.reshape(l), + g = null == t ? null : t.reshape(l), + f = null == n ? null : n.reshape(l);return [batchNormalization$1(e, h, d, f, g, i), o, s]; + }); + }function normalizeBatchInTraining(e, t, n, r, i) { + return void 0 === i && (i = .001), util.arraysEqual(r.slice().sort(), range$1(0, e.rank - 1)) ? regularNormalizeBatchInTraining(e, t, n, r, i) : broadcastNormalizeBatchInTraining(e, t, n, r, i); + }serialization.SerializationMap.register(Concatenate);var BatchNormalization = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.supportsMasking = !0, n.axis = null == t.axis ? -1 : t.axis, n.momentum = null == t.momentum ? .99 : t.momentum, n.epsilon = null == t.epsilon ? .001 : t.epsilon, n.center = null == t.center || t.center, n.scale = null == t.scale || t.scale, n.betaInitializer = getInitializer(t.betaInitializer || "zeros"), n.gammaInitializer = getInitializer(t.gammaInitializer || "ones"), n.movingMeanInitializer = getInitializer(t.movingMeanInitializer || "zeros"), n.movingVarianceInitializer = getInitializer(t.movingVarianceInitializer || "ones"), n.betaConstraint = getConstraint(t.betaConstraint), n.gammaConstraint = getConstraint(t.gammaConstraint), n.betaRegularizer = getRegularizer(t.betaRegularizer), n.gammaRegularizer = getRegularizer(t.gammaRegularizer), n.stepCount = 0, n; + }return __extends$1(t, e), t.prototype.build = function (e) { + e = getExactlyOneShape(e);var t = this.axis >= 0 ? this.axis : this.axis + e.length, + n = e[t];if (null == n) throw new ValueError("Axis " + t + " of input tensor should have a defined dimension but the layer received an input with shape " + JSON.stringify(e) + ".");this.inputSpec = [new InputSpec({ ndim: e.length, axes: (r = {}, r[t] = n, r) })];var r, + i = [n];this.scale && (this.gamma = this.addWeight("gamma", i, null, this.gammaInitializer, this.gammaRegularizer, !0, this.gammaConstraint)), this.center && (this.beta = this.addWeight("beta", i, null, this.betaInitializer, this.betaRegularizer, !0, this.betaConstraint)), this.movingMean = this.addWeight("moving_mean", i, null, this.movingMeanInitializer, null, !1), this.movingVariance = this.addWeight("moving_variance", i, null, this.movingVarianceInitializer, null, !1), this.built = !0; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var r = null != t.training && t.training, + i = getExactlyOneTensor(e), + a = i.shape, + o = a.length, + s = range$1(0, o), + l = n.axis >= 0 ? n.axis : n.axis + o;s.splice(l, 1);var u = pyListRepeat(1, o);u[l] = a[l];var c = s.slice();c.sort();var p = !util.arraysEqual(c, range$1(0, o).slice(0, o - 1));if (!r) return function () { + if (p) { + var e = n.movingMean.read().reshape(u), + t = n.movingVariance.read().reshape(u), + r = n.center ? n.beta.read().reshape(u) : null, + a = n.scale ? n.gamma.read().reshape(u) : null;return batchNormalization$1(i, e, t, r, a, n.epsilon); + }return batchNormalization$1(i, n.movingMean.read(), n.movingVariance.read(), null == n.beta ? null : n.beta.read(), null == n.gamma ? null : n.gamma.read(), n.epsilon); + }();var h = normalizeBatchInTraining(i, n.gamma.read(), n.beta.read(), s, n.epsilon), + d = h[0], + g = h[1], + f = h[2], + m = arrayProd(s.map(function (e) { + return i.shape[e]; + })), + y = f.mul(getScalar(m / (m - (1 + n.epsilon))));return function () { + n.stepCount++;var e = movingAverage(n.movingMean.read(), g, n.momentum, n.stepCount);n.movingMean.write(e);var t = movingAverage(n.movingVariance.read(), y, n.momentum, n.stepCount);n.movingVariance.write(t); + }(), d; + }); + }, t.prototype.getConfig = function () { + var t = { axis: this.axis, momentum: this.momentum, epsilon: this.epsilon, center: this.center, scale: this.scale, betaInitializer: serializeInitializer(this.betaInitializer), gammaInitializer: serializeInitializer(this.gammaInitializer), movingMeanInitializer: serializeInitializer(this.movingMeanInitializer), movingVarianceInitializer: serializeInitializer(this.movingVarianceInitializer), betaRegularizer: serializeRegularizer(this.betaRegularizer), gammaRegularizer: serializeRegularizer(this.gammaRegularizer), betaConstraint: serializeConstraint(this.betaConstraint), gammaConstraint: serializeConstraint(this.gammaConstraint) }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "BatchNormalization", t; + }(Layer);function spatial2dPadding(e, t, n) { + return tidy(function () { + if (4 !== e.rank) throw new ValueError("temporalPadding expects input tensor to be 4-D, but received a " + e.rank + "-D tensor.");if (null == t && (t = [[1, 1], [1, 1]]), 2 !== t.length || 2 !== t[0].length || 2 !== t[1].length) throw new ValueError("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if (null == n && (n = imageDataFormat()), "channelsLast" !== n && "channelsFirst" !== n) throw new ValueError("Unknown data format: " + n + ". Supported data formats are 'channelsLast' and 'channelsFirst.");var r;return r = "channelsFirst" === n ? [[0, 0], [0, 0], t[0], t[1]] : [[0, 0], t[0], t[1], [0, 0]], pad(e, r); + }); + }serialization.SerializationMap.register(BatchNormalization);var ZeroPadding2D = function (e) { + function t(t) { + var n = this;if (null == t && (t = {}), (n = e.call(this, t) || this).dataFormat = null == t.dataFormat ? imageDataFormat() : t.dataFormat, null == t.padding) n.padding = [[1, 1], [1, 1]];else if ("number" == typeof t.padding) n.padding = [[t.padding, t.padding], [t.padding, t.padding]];else { + if (t.padding = t.padding, 2 !== t.padding.length) throw new ValueError("ZeroPadding2D expects padding to be a length-2 array, but received a length-" + t.padding.length + " array.");var r = void 0, + i = void 0;if ("number" == typeof t.padding[0]) r = [t.padding[0], t.padding[0]], i = [t.padding[1], t.padding[1]];else { + if (t.padding = t.padding, 2 !== t.padding[0].length) throw new ValueError("ZeroPadding2D expects height padding to be a length-2 array, but received a length-" + t.padding[0].length + " array.");if (r = t.padding[0], 2 !== t.padding[1].length) throw new ValueError("ZeroPadding2D expects width padding to be a length-2 array, but received a length-" + t.padding[1].length + " array.");i = t.padding[1]; + }n.padding = [r, i]; + }return n.inputSpec = [new InputSpec({ ndim: 4 })], n; + }return __extends$1(t, e), t.prototype.computeOutputShape = function (e) { + var t, n;return e = getExactlyOneShape(e), "channelsFirst" === this.dataFormat ? (t = null != e[2] && e[2] >= 0 ? e[2] + this.padding[0][0] + this.padding[0][1] : null, n = null != e[3] && e[3] >= 0 ? e[3] + this.padding[1][0] + this.padding[1][1] : null, [e[0], e[1], t, n]) : (t = null != e[1] && e[1] >= 0 ? e[1] + this.padding[0][0] + this.padding[0][1] : null, n = null != e[2] && e[2] >= 0 ? e[2] + this.padding[1][0] + this.padding[1][1] : null, [e[0], t, n, e[3]]); + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + return spatial2dPadding(getExactlyOneTensor(e), n.padding, n.dataFormat); + }); + }, t.prototype.getConfig = function () { + var t = { padding: this.padding, dataFormat: this.dataFormat }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "ZeroPadding2D", t; + }(Layer);function pool2d(e, t, n, r, i, a) { + return tidy(function () { + var o;checkDataFormat(i), checkPoolMode(a), checkPaddingMode(r), null == n && (n = [1, 1]), null == r && (r = "valid"), null == i && (i = imageDataFormat()), null == a && (a = "max"), e = preprocessConv2DInput(e, i);var s = "same" === r ? "same" : "valid";return o = "max" === a ? maxPool(e, t, n, s) : avgPool(e, t, n, s), "channelsFirst" === i && (o = transpose(o, [0, 3, 1, 2])), o; + }); + }serialization.SerializationMap.register(ZeroPadding2D);var Pooling1D = function (e) { + function t(t) { + var n = this;if (null == t.poolSize && (t.poolSize = 2), n = e.call(this, t) || this, "number" == typeof t.poolSize) n.poolSize = [t.poolSize];else { + if (!Array.isArray(t.poolSize) || 1 !== t.poolSize.length || "number" != typeof t.poolSize[0]) throw new ValueError("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received " + JSON.stringify(t.poolSize));n.poolSize = t.poolSize; + }if (null == t.strides) n.strides = n.poolSize;else if ("number" == typeof t.strides) n.strides = [t.strides];else { + if (!Array.isArray(t.strides) || 1 !== t.strides.length || "number" != typeof t.strides[0]) throw new ValueError("strides for 1D convolutional layer must be a number or an Array of a single number, but received " + JSON.stringify(t.strides));n.strides = t.strides; + }return n.padding = null == t.padding ? "valid" : t.padding, checkPaddingMode(n.padding), n.inputSpec = [new InputSpec({ ndim: 3 })], n; + }return __extends$1(t, e), t.prototype.computeOutputShape = function (e) { + var t = convOutputLength((e = getExactlyOneShape(e))[1], this.poolSize[0], this.padding, this.strides[0]);return [e[0], t, e[2]]; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + n.invokeCallHook(e, t), e = expandDims$1(getExactlyOneTensor(e), 2);var r = n.poolingFunction(getExactlyOneTensor(e), [n.poolSize[0], 1], [n.strides[0], 1], n.padding, "channelsLast");return squeeze(r, [2]); + }); + }, t.prototype.getConfig = function () { + var t = { poolSize: this.poolSize, padding: this.padding, strides: this.strides }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t; + }(Layer), + MaxPooling1D = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.poolingFunction = function (e, t, n, r, i) { + return checkDataFormat(i), checkPaddingMode(r), pool2d(e, t, n, r, i, "max"); + }, t.className = "MaxPooling1D", t; + }(Pooling1D);serialization.SerializationMap.register(MaxPooling1D);var AveragePooling1D = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.poolingFunction = function (e, t, n, r, i) { + return checkDataFormat(i), checkPaddingMode(r), pool2d(e, t, n, r, i, "avg"); + }, t.className = "AveragePooling1D", t; + }(Pooling1D);serialization.SerializationMap.register(AveragePooling1D);var Pooling2D = function (e) { + function t(t) { + var n = this;if (null == t.poolSize && (t.poolSize = [2, 2]), (n = e.call(this, t) || this).poolSize = Array.isArray(t.poolSize) ? t.poolSize : [t.poolSize, t.poolSize], null == t.strides) n.strides = n.poolSize;else if (Array.isArray(t.strides)) { + if (2 !== t.strides.length) throw new ValueError("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length " + t.strides.length + ".");n.strides = t.strides; + } else n.strides = [t.strides, t.strides];return n.padding = null == t.padding ? "valid" : t.padding, n.dataFormat = null == t.dataFormat ? "channelsLast" : t.dataFormat, checkDataFormat(n.dataFormat), checkPaddingMode(n.padding), n.inputSpec = [new InputSpec({ ndim: 4 })], n; + }return __extends$1(t, e), t.prototype.computeOutputShape = function (e) { + e = getExactlyOneShape(e);var t = "channelsFirst" === this.dataFormat ? e[2] : e[1], + n = "channelsFirst" === this.dataFormat ? e[3] : e[2];return t = convOutputLength(t, this.poolSize[0], this.padding, this.strides[0]), n = convOutputLength(n, this.poolSize[1], this.padding, this.strides[1]), "channelsFirst" === this.dataFormat ? [e[0], e[1], t, n] : [e[0], t, n, e[3]]; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + return n.invokeCallHook(e, t), n.poolingFunction(getExactlyOneTensor(e), n.poolSize, n.strides, n.padding, n.dataFormat); + }); + }, t.prototype.getConfig = function () { + var t = { poolSize: this.poolSize, padding: this.padding, strides: this.strides, dataFormat: this.dataFormat }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t; + }(Layer), + MaxPooling2D = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.poolingFunction = function (e, t, n, r, i) { + return checkDataFormat(i), checkPaddingMode(r), pool2d(e, t, n, r, i, "max"); + }, t.className = "MaxPooling2D", t; + }(Pooling2D);serialization.SerializationMap.register(MaxPooling2D);var AveragePooling2D = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.poolingFunction = function (e, t, n, r, i) { + return checkDataFormat(i), checkPaddingMode(r), pool2d(e, t, n, r, i, "avg"); + }, t.className = "AveragePooling2D", t; + }(Pooling2D);serialization.SerializationMap.register(AveragePooling2D);var GlobalPooling1D = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.inputSpec = [new InputSpec({ ndim: 3 })], n; + }return __extends$1(t, e), t.prototype.computeOutputShape = function (e) { + return [e[0], e[2]]; + }, t.prototype.call = function (e, t) { + throw new NotImplementedError(); + }, t; + }(Layer), + GlobalAveragePooling1D = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.call = function (e, t) { + return tidy(function () { + var t = getExactlyOneTensor(e);return mean(t, 1); + }); + }, t.className = "GlobalAveragePooling1D", t; + }(GlobalPooling1D);serialization.SerializationMap.register(GlobalAveragePooling1D);var GlobalMaxPooling1D = function (e) { + function t(t) { + return e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.call = function (e, t) { + return tidy(function () { + var t = getExactlyOneTensor(e);return max(t, 1); + }); + }, t.className = "GlobalMaxPooling1D", t; + }(GlobalPooling1D);serialization.SerializationMap.register(GlobalMaxPooling1D);var GlobalPooling2D = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.dataFormat = null == t.dataFormat ? "channelsLast" : t.dataFormat, checkDataFormat(n.dataFormat), n.inputSpec = [new InputSpec({ ndim: 4 })], n; + }return __extends$1(t, e), t.prototype.computeOutputShape = function (e) { + return e = e, "channelsLast" === this.dataFormat ? [e[0], e[3]] : [e[0], e[1]]; + }, t.prototype.call = function (e, t) { + throw new NotImplementedError(); + }, t.prototype.getConfig = function () { + var t = { dataFormat: this.dataFormat }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t; + }(Layer), + GlobalAveragePooling2D = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var t = getExactlyOneTensor(e);return "channelsLast" === n.dataFormat ? mean(t, [1, 2]) : mean(t, [2, 3]); + }); + }, t.className = "GlobalAveragePooling2D", t; + }(GlobalPooling2D);serialization.SerializationMap.register(GlobalAveragePooling2D);var GlobalMaxPooling2D = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var t = getExactlyOneTensor(e);return "channelsLast" === n.dataFormat ? max(t, [1, 2]) : max(t, [2, 3]); + }); + }, t.className = "GlobalMaxPooling2D", t; + }(GlobalPooling2D);function standardizeArgs(e, t, n, r) { + if (Array.isArray(e)) { + if (null != t || null != n) throw new ValueError("When inputs is an array, neither initialState or constants should be provided");null != r && (n = e.slice(e.length - r, e.length), e = e.slice(0, e.length - r)), e.length > 1 && (t = e.slice(1, e.length)), e = e[0]; + }function i(e) { + return null == e || Array.isArray(e) ? e : [e]; + }return { inputs: e, initialState: t = i(t), constants: n = i(n) }; + }function rnn(e, t, n, r, i, a, o, s) { + void 0 === r && (r = !1), void 0 === o && (o = !1);var l = t.shape.length;if (l < 3) throw new ValueError("Input should be at least 3D, but is " + l + "D.");var u, + c, + p = [1, 0].concat(range$1(2, l));if (t = transpose(t, p), null != i) throw new NotImplementedError("The rnn() function of the deeplearn.js backend does not support masking yet.");if (null != a) throw new NotImplementedError("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o && console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."), r && (t = reverse(t, 0));for (var h = n, d = t.shape[0], g = 0; g < d; ++g) { + var f = sliceAlongFirstAxis(t, g, 1), + m = e(f = f.reshape(f.shape.slice(1)), h);c = m[0], u = 0 === g ? c.reshape([1].concat(c.shape)) : concatAlongFirstAxis(u, c.reshape([1].concat(c.shape))), h = m[1]; + }return [c, transpose(u, [1, 0].concat(range$1(2, u.shape.length))), h]; + }serialization.SerializationMap.register(GlobalMaxPooling2D);var RNN = function (e) { + function t(t) { + var n, + r = e.call(this, t) || this;if (null == t.cell) throw new ValueError("cell property is missing for the constructor of RNN.");if (null == (n = Array.isArray(t.cell) ? new StackedRNNCells({ cells: t.cell }) : t.cell).stateSize) throw new ValueError("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");return r.cell = n, r.returnSequences = null != t.returnSequences && t.returnSequences, r.returnState = null != t.returnState && t.returnState, r.goBackwards = null != t.goBackwards && t.goBackwards, r._stateful = null != t.stateful && t.stateful, r.unroll = null != t.unroll && t.unroll, r.supportsMasking = !0, r.inputSpec = [new InputSpec({ ndim: 3 })], r.stateSpec = null, r.states = null, r.numConstants = null, r; + }return __extends$1(t, e), t.prototype.getStates = function () { + return null == this.states ? range$1(0, Array.isArray(this.cell.stateSize) ? this.cell.stateSize.length : 1).map(function (e) { + return null; + }) : this.states; + }, t.prototype.setStates = function (e) { + this.states = e; + }, t.prototype.computeOutputShape = function (e) { + isArrayOfShapes(e) && (e = e[0]), e = e;var t = this.cell.stateSize;Array.isArray(t) || (t = [t]);var n, + r = t[0];if (n = this.returnSequences ? [e[0], e[1], r] : [e[0], r], this.returnState) { + for (var i = [], a = 0, o = t; a < o.length; a++) { + var s = o[a];i.push([e[0], s]); + }return [n].concat(i); + }return n; + }, t.prototype.computeMask = function (e, t) { + throw new NotImplementedError("computeMask has not been implemented for RNN yet"); + }, t.prototype.build = function (e) { + if (null != this.numConstants) throw new NotImplementedError("Constants support is not implemented in RNN yet.");isArrayOfShapes(e) && (e = e[0]), e = e;var t = this.stateful ? e[0] : null, + n = e[e.length - 1];this.inputSpec[0] = new InputSpec({ shape: [t, null, n] });var r, + i = [e[0]].concat(e.slice(2));if (this.cell.build(i), r = Array.isArray(this.cell.stateSize) ? this.cell.stateSize : [this.cell.stateSize], null != this.stateSpec) { + if (!util.arraysEqual(this.stateSpec.map(function (e) { + return e.shape[e.shape.length - 1]; + }), r)) throw new ValueError("An initialState was passed that is not compatible with cell.stateSize. Received stateSpec=" + this.stateSpec + "; However cell.stateSize is " + this.cell.stateSize); + } else this.stateSpec = r.map(function (e) { + return new InputSpec({ shape: [null, e] }); + });if (this.stateful) throw new NotImplementedError("stateful RNN layer is not implemented yet"); + }, t.prototype.resetStates = function (e) { + var t = this;tidy(function () { + if (!t.stateful) throw new AttributeError("Cannot call resetState() on an RNN Layer that is not stateful.");var n = t.inputSpec[0].shape[0];if (null == n) throw new ValueError("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if (null == t.states) Array.isArray(t.cell.stateSize) ? t.states = t.cell.stateSize.map(function (e) { + return zeros([n, e]); + }) : t.states = [zeros([n, t.cell.stateSize])];else if (null == e) Array.isArray(t.cell.stateSize) ? t.states = t.cell.stateSize.map(function (e) { + return zeros([n, e]); + }) : t.states[0] = zeros([n, t.cell.stateSize]);else { + if (Array.isArray(e) || (e = [e]), e.length !== t.states.length) throw new ValueError("Layer " + t.name + " expects " + t.states.length + " state(s), but it received " + e.length + " state value(s). Input received: " + e);for (var r = 0; r < t.states.length; ++r) { + var i = e[r], + a = Array.isArray(t.cell.stateSize) ? t.cell.stateSize[r] : t.cell.stateSize, + o = [n, a];if (!util.arraysEqual(i.shape, o)) throw new ValueError("State " + r + " is incompatible with layer " + t.name + ": expected shape=" + o + ", received shape=" + i.shape);t.states[r] = i; + } + } + }); + }, t.prototype.apply = function (t, n) { + var r = null == n ? null : n.initialState, + i = null == n ? null : n.constants;null == n && (n = {});var a = standardizeArgs(t, r, i, this.numConstants);t = a.inputs, r = a.initialState, i = a.constants;var o = [], + s = [];if (null != r) { + n.initialState = r, o = o.concat(r), this.stateSpec = [];for (var l = 0, u = r; l < u.length; l++) { + var c = u[l];this.stateSpec.push(new InputSpec({ shape: c.shape })); + }s = s.concat(this.stateSpec); + }if (null != i && (n.constants = i, o = o.concat(i), this.numConstants = i.length), o[0] instanceof SymbolicTensor) { + var p = [t].concat(o), + h = this.inputSpec.concat(s), + d = this.inputSpec;this.inputSpec = h;var g = e.prototype.apply.call(this, p, n);return this.inputSpec = d, g; + }return e.prototype.apply.call(this, t, n); + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var r = null == t ? null : t.mask, + i = null == t ? null : t.training, + a = null == t ? null : t.initialState;if (e = getExactlyOneTensor(e), null == a) { + if (n.stateful) throw new NotImplementedError("stateful RNN layer is not implemented yet.");a = n.getInitialState(e); + }if (null != r) throw new NotImplementedError("Masking is not implemented for RNN yet");var o = Array.isArray(n.cell.stateSize) ? n.cell.stateSize.length : 1;if (a.length !== o) throw new ValueError("RNN Layer has " + o + " state(s) but was passed " + a.length + " initial state(s).");var s = e.shape[1];n.unroll && console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");var l = { training: i }, + u = rnn(function (e, t) { + var r = n.cell.call([e].concat(t), l);return [r[0], r.slice(1)]; + }, e, a, n.goBackwards, null, null, n.unroll, s), + c = u[0], + p = u[1], + h = u[2];if (n.stateful) throw new NotImplementedError("stateful RNN layer is not implemented yet");var d = n.returnSequences ? p : c;return n.returnState ? [d].concat(h) : d; + }); + }, t.prototype.getInitialState = function (e) { + var t = this;return tidy(function () { + var n = zeros(e.shape);return n = expandDims$1(n = sum(n, [1, 2])), Array.isArray(t.cell.stateSize) ? t.cell.stateSize.map(function (e) { + return e > 1 ? tile$1(n, [1, e]) : n; + }) : t.cell.stateSize > 1 ? [tile$1(n, [1, t.cell.stateSize])] : [n]; + }); + }, Object.defineProperty(t.prototype, "trainableWeights", { get: function () { + return this.trainable ? this.cell.trainableWeights : []; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "nonTrainableWeights", { get: function () { + return this.trainable ? this.cell.nonTrainableWeights : this.cell.weights; + }, enumerable: !0, configurable: !0 }), t.prototype.getConfig = function () { + var t = { returnSequences: this.returnSequences, returnState: this.returnState, goBackwards: this.goBackwards, stateful: this.stateful, unroll: this.unroll };null != this.numConstants && (t.numConstants = this.numConstants);var n = this.cell.getConfig();t.cell = { className: this.cell.getClassName(), config: n };var r = e.prototype.getConfig.call(this);return Object.assign(t, r), t; + }, t.className = "RNN", t; + }(Layer);serialization.SerializationMap.register(RNN);var RNNCell = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t; + }(Layer), + SimpleRNNCell = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.DEFAULT_ACTIVATION = "tanh", n.DEFAULT_KERNEL_INITIALIZER = "glorotNormal", n.DEFAULT_RECURRENT_INITIALIZER = "orthogonal", n.DEFAULT_BIAS_INITIALIZER = "zeros", n.units = t.units, n.activation = getActivation(null == t.activation ? n.DEFAULT_ACTIVATION : t.activation), n.useBias = null == t.useBias || t.useBias, n.kernelInitializer = getInitializer(t.kernelInitializer || n.DEFAULT_KERNEL_INITIALIZER), n.recurrentInitializer = getInitializer(t.recurrentInitializer || n.DEFAULT_RECURRENT_INITIALIZER), n.biasInitializer = getInitializer(t.biasInitializer || n.DEFAULT_BIAS_INITIALIZER), n.kernelRegularizer = getRegularizer(t.kernelRegularizer), n.recurrentRegularizer = getRegularizer(t.recurrentRegularizer), n.biasRegularizer = getRegularizer(t.biasRegularizer), n.kernelConstraint = getConstraint(t.kernelConstraint), n.recurrentConstraint = getConstraint(t.recurrentConstraint), n.biasConstraint = getConstraint(t.biasConstraint), n.dropout = min$1([1, max$1([0, null == t.dropout ? 0 : t.dropout])]), n.recurrentDropout = min$1([1, max$1([0, null == t.recurrentDropout ? 0 : t.recurrentDropout])]), n.stateSize = n.units, n.dropoutMask = null, n.recurrentDropoutMask = null, n; + }return __extends$1(t, e), t.prototype.build = function (e) { + e = getExactlyOneShape(e), this.kernel = this.addWeight("kernel", [e[e.length - 1], this.units], null, this.kernelInitializer, this.kernelRegularizer, !0, this.kernelConstraint), this.recurrentKernel = this.addWeight("recurrent_kernel", [this.units, this.units], null, this.recurrentInitializer, this.recurrentRegularizer, !0, this.recurrentConstraint), this.useBias ? this.bias = this.addWeight("bias", [this.units], null, this.biasInitializer, this.biasRegularizer, !0, this.biasConstraint) : this.bias = null, this.built = !0; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + if (2 !== (e = e).length) throw new ValueError("SimpleRNNCell expects 2 input Tensors, got " + e.length + ".");var r = e[1];e = e[0];var i, + a = null != t.training && t.training;0 < n.dropout && n.dropout < 1 && null == n.dropoutMask && (n.dropoutMask = generateDropoutMask(function () { + return onesLike(e); + }, n.dropout, a)), 0 < n.recurrentDropout && n.recurrentDropout < 1 && null == n.recurrentDropoutMask && (n.recurrentDropoutMask = generateDropoutMask(function () { + return onesLike(r); + }, n.recurrentDropout, a));var o = n.dropoutMask, + s = n.recurrentDropoutMask;i = dot$1(null != o ? mul(e, o) : e, n.kernel.read()), null != n.bias && (i = biasAdd(i, n.bias.read())), null != s && (r = mul(r, s));var l = add(i, dot$1(r, n.recurrentKernel.read()));return null != n.activation && (l = n.activation.apply(l)), [l, l]; + }); + }, t.prototype.getConfig = function () { + var t = { units: this.units, activation: serializeActivation(this.activation), useBias: this.useBias, kernelInitializer: serializeInitializer(this.kernelInitializer), recurrentInitializer: serializeInitializer(this.recurrentInitializer), biasInitializer: serializeInitializer(this.biasInitializer), kernelRegularizer: serializeRegularizer(this.kernelRegularizer), recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), biasRegularizer: serializeRegularizer(this.biasRegularizer), activityRegularizer: serializeRegularizer(this.activityRegularizer), kernelConstraint: serializeConstraint(this.kernelConstraint), recurrentConstraint: serializeConstraint(this.recurrentConstraint), biasConstraint: serializeConstraint(this.biasConstraint), dropout: this.dropout, recurrentDropout: this.recurrentDropout }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "SimpleRNNCell", t; + }(RNNCell);serialization.SerializationMap.register(SimpleRNNCell);var SimpleRNN = function (e) { + function t(t) { + return t.cell = new SimpleRNNCell(t), e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.call = function (t, n) { + var r = this;return tidy(function () { + null != r.cell.dropoutMask && (dispose(r.cell.dropoutMask), r.cell.dropoutMask = null), null != r.cell.recurrentDropoutMask && (dispose(r.cell.recurrentDropoutMask), r.cell.recurrentDropoutMask = null);var i = null == n ? null : n.mask, + a = null == n ? null : n.training, + o = null == n ? null : n.initialState;return e.prototype.call.call(r, t, { mask: i, training: a, initialState: o }); + }); + }, Object.defineProperty(t.prototype, "units", { get: function () { + return this.cell.units; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "activation", { get: function () { + return this.cell.activation; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "useBias", { get: function () { + return this.cell.useBias; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "kernelInitializer", { get: function () { + return this.cell.kernelInitializer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentInitializer", { get: function () { + return this.cell.recurrentInitializer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "biasInitializer", { get: function () { + return this.cell.biasInitializer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "kernelRegularizer", { get: function () { + return this.cell.kernelRegularizer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentRegularizer", { get: function () { + return this.cell.recurrentRegularizer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "biasRegularizer", { get: function () { + return this.cell.biasRegularizer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "kernelConstraint", { get: function () { + return this.cell.kernelConstraint; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentConstraint", { get: function () { + return this.cell.recurrentConstraint; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "biasConstraint", { get: function () { + return this.cell.biasConstraint; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "dropout", { get: function () { + return this.cell.dropout; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentDropout", { get: function () { + return this.cell.recurrentDropout; + }, enumerable: !0, configurable: !0 }), t.prototype.getConfig = function () { + var t = { units: this.units, activation: serializeActivation(this.activation), useBias: this.useBias, kernelInitializer: serializeInitializer(this.kernelInitializer), recurrentInitializer: serializeInitializer(this.recurrentInitializer), biasInitializer: serializeInitializer(this.biasInitializer), kernelRegularizer: serializeRegularizer(this.kernelRegularizer), recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), biasRegularizer: serializeRegularizer(this.biasRegularizer), activityRegularizer: serializeRegularizer(this.activityRegularizer), kernelConstraint: serializeConstraint(this.kernelConstraint), recurrentConstraint: serializeConstraint(this.recurrentConstraint), biasConstraint: serializeConstraint(this.biasConstraint), dropout: this.dropout, recurrentDropout: this.recurrentDropout }, + n = e.prototype.getConfig.call(this);return delete n.cell, Object.assign(t, n), t; + }, t.className = "SimpleRNN", t; + }(RNN);serialization.SerializationMap.register(SimpleRNN);var GRUCell = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.DEFAULT_ACTIVATION = "tanh", n.DEFAULT_RECURRENT_ACTIVATION = "hardSigmoid", n.DEFAULT_KERNEL_INITIALIZER = "glorotNormal", n.DEFAULT_RECURRENT_INITIALIZER = "orthogonal", n.DEFAULT_BIAS_INITIALIZER = "zeros", n.units = t.units, n.activation = getActivation(void 0 === t.activation ? n.DEFAULT_ACTIVATION : t.activation), n.recurrentActivation = getActivation(void 0 === t.recurrentActivation ? n.DEFAULT_RECURRENT_ACTIVATION : t.recurrentActivation), n.useBias = null == t.useBias || t.useBias, n.kernelInitializer = getInitializer(t.kernelInitializer || n.DEFAULT_KERNEL_INITIALIZER), n.recurrentInitializer = getInitializer(t.recurrentInitializer || n.DEFAULT_RECURRENT_INITIALIZER), n.biasInitializer = getInitializer(t.biasInitializer || n.DEFAULT_BIAS_INITIALIZER), n.kernelRegularizer = getRegularizer(t.kernelRegularizer), n.recurrentRegularizer = getRegularizer(t.recurrentRegularizer), n.biasRegularizer = getRegularizer(t.biasRegularizer), n.kernelConstraint = getConstraint(t.kernelConstraint), n.recurrentConstraint = getConstraint(t.recurrentConstraint), n.biasConstraint = getConstraint(t.biasConstraint), n.dropout = min$1([1, max$1([0, null == t.dropout ? 0 : t.dropout])]), n.recurrentDropout = min$1([1, max$1([0, null == t.recurrentDropout ? 0 : t.recurrentDropout])]), n.implementation = t.implementation, n.stateSize = n.units, n.dropoutMask = null, n.recurrentDropoutMask = null, n; + }return __extends$1(t, e), t.prototype.build = function (e) { + var t = (e = getExactlyOneShape(e))[e.length - 1];this.kernel = this.addWeight("kernel", [t, 3 * this.units], null, this.kernelInitializer, this.kernelRegularizer, !0, this.kernelConstraint), this.recurrentKernel = this.addWeight("recurrent_kernel", [this.units, 3 * this.units], null, this.recurrentInitializer, this.recurrentRegularizer, !0, this.recurrentConstraint), this.useBias ? this.bias = this.addWeight("bias", [3 * this.units], null, this.biasInitializer, this.biasRegularizer, !0, this.biasConstraint) : this.bias = null, this.built = !0; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + if (2 !== (e = e).length) throw new ValueError("GRUCell expects 2 input Tensors (inputs, h, c), got " + e.length + ".");var r = null != t.training && t.training, + i = e[1];e = e[0], 0 < n.dropout && n.dropout < 1 && null == n.dropoutMask && (n.dropoutMask = generateDropoutMask(function () { + return onesLike(e); + }, n.dropout, r, 3)), 0 < n.recurrentDropout && n.recurrentDropout < 1 && null == n.recurrentDropoutMask && (n.recurrentDropoutMask = generateDropoutMask(function () { + return onesLike(i); + }, n.recurrentDropout, r, 3));var a, + o, + s, + l = n.dropoutMask, + u = n.recurrentDropoutMask;if (1 === n.implementation) { + var c = sliceAlongLastAxis(n.kernel.read(), 0, n.units), + p = sliceAlongLastAxis(n.kernel.read(), n.units, n.units), + h = sliceAlongLastAxis(n.kernel.read(), 2 * n.units, n.units), + d = sliceAlongLastAxis(n.recurrentKernel.read(), 0, n.units), + g = sliceAlongLastAxis(n.recurrentKernel.read(), n.units, n.units), + f = sliceAlongLastAxis(n.recurrentKernel.read(), 2 * n.units, n.units), + m = void 0, + y = void 0, + v = void 0;0 < n.dropout && n.dropout < 1 ? (m = mul(e, l[0]), y = mul(e, l[1]), v = mul(e, l[2])) : (m = e, y = e, v = e);var b = dot$1(m, c), + z = dot$1(y, p), + w = dot$1(v, h);if (n.useBias) { + var S = sliceAlongFirstAxis(n.bias.read(), 0, n.units), + A = sliceAlongFirstAxis(n.bias.read(), n.units, n.units), + I = sliceAlongFirstAxis(n.bias.read(), 2 * n.units, n.units);b = biasAdd(b, S), z = biasAdd(z, A), w = biasAdd(w, I); + }var N = void 0, + E = void 0, + _ = void 0;0 < n.recurrentDropout && n.recurrentDropout < 1 ? (N = mul(i, u[0]), E = mul(i, u[1]), _ = mul(i, u[2])) : (N = i, E = i, _ = i), a = n.recurrentActivation.apply(add(b, dot$1(N, d))), o = n.recurrentActivation.apply(add(z, dot$1(E, g))), s = n.activation.apply(add(w, dot$1(mul(o, _), f))); + } else { + 0 < n.dropout && n.dropout < 1 && (e = mul(e, l[0]));var k = dot$1(e, n.kernel.read());n.useBias && (k = biasAdd(k, n.bias.read())), 0 < n.dropout && n.dropout < 1 && (i = mul(i, u[0]));var C = dot$1(i, sliceAlongLastAxis(n.recurrentKernel.read(), 0, 2 * n.units)), + L = (b = sliceAlongLastAxis(k, 0, n.units), z = sliceAlongLastAxis(k, n.units, n.units), sliceAlongLastAxis(C, 0, n.units)), + x = sliceAlongLastAxis(C, n.units, n.units);a = n.recurrentActivation.apply(add(b, L)), o = n.recurrentActivation.apply(add(z, x));w = sliceAlongLastAxis(k, 2 * n.units, n.units);var T = dot$1(mul(o, i), sliceAlongLastAxis(n.recurrentKernel.read(), 2 * n.units, n.units));s = n.activation.apply(add(w, T)); + }var R = add(mul(a, i), mul(add(getScalar(1), neg(a)), s));return [R, R]; + }); + }, t.prototype.getConfig = function () { + var t = { units: this.units, activation: serializeActivation(this.activation), recurrentActivation: serializeActivation(this.recurrentActivation), useBias: this.useBias, kernelInitializer: serializeInitializer(this.kernelInitializer), recurrentInitializer: serializeInitializer(this.recurrentInitializer), biasInitializer: serializeInitializer(this.biasInitializer), kernelRegularizer: serializeRegularizer(this.kernelRegularizer), recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), biasRegularizer: serializeRegularizer(this.biasRegularizer), activityRegularizer: serializeRegularizer(this.activityRegularizer), kernelConstraint: serializeConstraint(this.kernelConstraint), recurrentConstraint: serializeConstraint(this.recurrentConstraint), biasConstraint: serializeConstraint(this.biasConstraint), dropout: this.dropout, recurrentDropout: this.recurrentDropout, implementation: this.implementation }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "GRUCell", t; + }(RNNCell);serialization.SerializationMap.register(GRUCell);var GRU = function (e) { + function t(t) { + return 0 === t.implementation && console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."), t.cell = new GRUCell(t), e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.call = function (t, n) { + var r = this;return tidy(function () { + null != r.cell.dropoutMask && (dispose(r.cell.dropoutMask), r.cell.dropoutMask = null), null != r.cell.recurrentDropoutMask && (dispose(r.cell.recurrentDropoutMask), r.cell.recurrentDropoutMask = null);var i = null == n ? null : n.mask, + a = null == n ? null : n.training, + o = null == n ? null : n.initialState;return e.prototype.call.call(r, t, { mask: i, training: a, initialState: o }); + }); + }, Object.defineProperty(t.prototype, "units", { get: function () { + return this.cell.units; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "activation", { get: function () { + return this.cell.activation; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentActivation", { get: function () { + return this.cell.recurrentActivation; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "useBias", { get: function () { + return this.cell.useBias; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "kernelInitializer", { get: function () { + return this.cell.kernelInitializer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentInitializer", { get: function () { + return this.cell.recurrentInitializer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "biasInitializer", { get: function () { + return this.cell.biasInitializer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "kernelRegularizer", { get: function () { + return this.cell.kernelRegularizer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentRegularizer", { get: function () { + return this.cell.recurrentRegularizer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "biasRegularizer", { get: function () { + return this.cell.biasRegularizer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "kernelConstraint", { get: function () { + return this.cell.kernelConstraint; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentConstraint", { get: function () { + return this.cell.recurrentConstraint; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "biasConstraint", { get: function () { + return this.cell.biasConstraint; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "dropout", { get: function () { + return this.cell.dropout; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentDropout", { get: function () { + return this.cell.recurrentDropout; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "implementation", { get: function () { + return this.cell.implementation; + }, enumerable: !0, configurable: !0 }), t.prototype.getConfig = function () { + var t = { units: this.units, activation: serializeActivation(this.activation), recurrentActivation: serializeActivation(this.recurrentActivation), useBias: this.useBias, kernelInitializer: serializeInitializer(this.kernelInitializer), recurrentInitializer: serializeInitializer(this.recurrentInitializer), biasInitializer: serializeInitializer(this.biasInitializer), kernelRegularizer: serializeRegularizer(this.kernelRegularizer), recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), biasRegularizer: serializeRegularizer(this.biasRegularizer), activityRegularizer: serializeRegularizer(this.activityRegularizer), kernelConstraint: serializeConstraint(this.kernelConstraint), recurrentConstraint: serializeConstraint(this.recurrentConstraint), biasConstraint: serializeConstraint(this.biasConstraint), dropout: this.dropout, recurrentDropout: this.recurrentDropout, implementation: this.implementation }, + n = e.prototype.getConfig.call(this);return delete n.cell, Object.assign(t, n), t; + }, t.fromConfig = function (e, t) { + return 0 === t.implmentation && (t.implementation = 1), new e(t); + }, t.className = "GRU", t; + }(RNN);serialization.SerializationMap.register(GRU);var LSTMCell = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.DEFAULT_ACTIVATION = "tanh", n.DEFAULT_RECURRENT_ACTIVATION = "hardSigmoid", n.DEFAULT_KERNEL_INITIALIZER = "glorotNormal", n.DEFAULT_RECURRENT_INITIALIZER = "orthogonal", n.DEFAULT_BIAS_INITIALIZER = "zeros", n.units = t.units, n.activation = getActivation(void 0 === t.activation ? n.DEFAULT_ACTIVATION : t.activation), n.recurrentActivation = getActivation(void 0 === t.recurrentActivation ? n.DEFAULT_RECURRENT_ACTIVATION : t.recurrentActivation), n.useBias = null == t.useBias || t.useBias, n.kernelInitializer = getInitializer(t.kernelInitializer || n.DEFAULT_KERNEL_INITIALIZER), n.recurrentInitializer = getInitializer(t.recurrentInitializer || n.DEFAULT_RECURRENT_INITIALIZER), n.biasInitializer = getInitializer(t.biasInitializer || n.DEFAULT_BIAS_INITIALIZER), n.unitForgetBias = t.unitForgetBias, n.kernelRegularizer = getRegularizer(t.kernelRegularizer), n.recurrentRegularizer = getRegularizer(t.recurrentRegularizer), n.biasRegularizer = getRegularizer(t.biasRegularizer), n.kernelConstraint = getConstraint(t.kernelConstraint), n.recurrentConstraint = getConstraint(t.recurrentConstraint), n.biasConstraint = getConstraint(t.biasConstraint), n.dropout = min$1([1, max$1([0, null == t.dropout ? 0 : t.dropout])]), n.recurrentDropout = min$1([1, max$1([0, null == t.recurrentDropout ? 0 : t.recurrentDropout])]), n.implementation = t.implementation, n.stateSize = [n.units, n.units], n.dropoutMask = null, n.recurrentDropoutMask = null, n; + }return __extends$1(t, e), t.prototype.build = function (e) { + var t, + n, + r = (e = getExactlyOneShape(e))[e.length - 1];if (this.kernel = this.addWeight("kernel", [r, 4 * this.units], null, this.kernelInitializer, this.kernelRegularizer, !0, this.kernelConstraint), this.recurrentKernel = this.addWeight("recurrent_kernel", [this.units, 4 * this.units], null, this.recurrentInitializer, this.recurrentRegularizer, !0, this.recurrentConstraint), this.useBias) { + if (this.unitForgetBias) { + var i = this.biasInitializer, + a = this.units;t = new ((n = function (e) { + function t() { + return null !== e && e.apply(this, arguments) || this; + }return __extends$1(t, e), t.prototype.apply = function (e, t) { + var n = i.apply([a]), + r = new Ones().apply([a]), + o = i.apply([2 * a]);return concatAlongFirstAxis(concatAlongFirstAxis(n, r), o); + }, t; + }(Initializer)).className = "CustomInit", n)(); + } else t = this.biasInitializer;this.bias = this.addWeight("bias", [4 * this.units], null, t, this.biasRegularizer, !0, this.biasConstraint); + } else this.bias = null;this.built = !0; + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + var r = null != t.training && t.training;if (3 !== (e = e).length) throw new ValueError("LSTMCell expects 3 input Tensors (inputs, h, c), got " + e.length + ".");var i = e[1], + a = e[2];e = e[0], 0 < n.dropout && n.dropout < 1 && null == n.dropoutMask && (n.dropoutMask = generateDropoutMask(function () { + return onesLike(e); + }, n.dropout, r, 4)), 0 < n.recurrentDropout && n.recurrentDropout < 1 && null == n.recurrentDropoutMask && (n.recurrentDropoutMask = generateDropoutMask(function () { + return onesLike(i); + }, n.recurrentDropout, r, 4));var o, + s, + l, + u, + c = n.dropoutMask, + p = n.recurrentDropoutMask;if (1 === n.implementation) { + var h = sliceAlongLastAxis(n.kernel.read(), 0, n.units), + d = sliceAlongLastAxis(n.kernel.read(), n.units, n.units), + g = sliceAlongLastAxis(n.kernel.read(), 2 * n.units, n.units), + f = sliceAlongLastAxis(n.kernel.read(), 3 * n.units, n.units), + m = sliceAlongLastAxis(n.recurrentKernel.read(), 0, n.units), + y = sliceAlongLastAxis(n.recurrentKernel.read(), n.units, n.units), + v = sliceAlongLastAxis(n.recurrentKernel.read(), 2 * n.units, n.units), + b = sliceAlongLastAxis(n.recurrentKernel.read(), 3 * n.units, n.units), + z = void 0, + w = void 0, + S = void 0, + A = void 0;0 < n.dropout && n.dropout < 1 ? (z = mul(e, c[0]), w = mul(e, c[1]), S = mul(e, c[2]), A = mul(e, c[3])) : (z = e, w = e, S = e, A = e);var I = dot$1(z, h), + N = dot$1(w, d), + E = dot$1(S, g), + _ = dot$1(A, f);if (n.useBias) { + var k = sliceAlongFirstAxis(n.bias.read(), 0, n.units), + C = sliceAlongFirstAxis(n.bias.read(), n.units, n.units), + L = sliceAlongFirstAxis(n.bias.read(), 2 * n.units, n.units), + x = sliceAlongFirstAxis(n.bias.read(), 3 * n.units, n.units);I = biasAdd(I, k), N = biasAdd(N, C), E = biasAdd(E, L), _ = biasAdd(_, x); + }var T = void 0, + R = void 0, + O = void 0, + D = void 0;0 < n.recurrentDropout && n.recurrentDropout < 1 ? (T = mul(i, p[0]), R = mul(i, p[1]), O = mul(i, p[2]), D = mul(i, p[3])) : (T = i, R = i, O = i, D = i), o = n.recurrentActivation.apply(add(I, dot$1(T, m))), s = n.recurrentActivation.apply(add(N, dot$1(R, y))), l = add(mul(s, a), mul(o, n.activation.apply(add(E, dot$1(O, v))))), u = n.recurrentActivation.apply(add(_, dot$1(D, b))); + } else { + 0 < n.dropout && n.dropout < 1 && (e = mul(e, c[0]));var M = dot$1(e, n.kernel.read());0 < n.recurrentDropout && n.recurrentDropout < 1 && (i = mul(i, p[0])), M = add(M, dot$1(i, n.recurrentKernel.read())), n.useBias && (M = biasAdd(M, n.bias.read()));var P = sliceAlongLastAxis(M, 0, n.units), + F = sliceAlongLastAxis(M, n.units, n.units), + V = sliceAlongLastAxis(M, 2 * n.units, n.units), + B = sliceAlongLastAxis(M, 3 * n.units, n.units);o = n.recurrentActivation.apply(P), s = n.recurrentActivation.apply(F), l = add(mul(s, a), mul(o, n.activation.apply(V))), u = n.recurrentActivation.apply(B); + }var U = mul(u, n.activation.apply(l));return [U, U, l]; + }); + }, t.prototype.getConfig = function () { + var t = { units: this.units, activation: serializeActivation(this.activation), recurrentActivation: serializeActivation(this.recurrentActivation), useBias: this.useBias, kernelInitializer: serializeInitializer(this.kernelInitializer), recurrentInitializer: serializeInitializer(this.recurrentInitializer), biasInitializer: serializeInitializer(this.biasInitializer), unitForgetBias: this.unitForgetBias, kernelRegularizer: serializeRegularizer(this.kernelRegularizer), recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), biasRegularizer: serializeRegularizer(this.biasRegularizer), activityRegularizer: serializeRegularizer(this.activityRegularizer), kernelConstraint: serializeConstraint(this.kernelConstraint), recurrentConstraint: serializeConstraint(this.recurrentConstraint), biasConstraint: serializeConstraint(this.biasConstraint), dropout: this.dropout, recurrentDropout: this.recurrentDropout, implementation: this.implementation }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.className = "LSTMCell", t; + }(RNNCell);serialization.SerializationMap.register(LSTMCell);var LSTM = function (e) { + function t(t) { + return 0 === t.implementation && console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."), t.cell = new LSTMCell(t), e.call(this, t) || this; + }return __extends$1(t, e), t.prototype.call = function (t, n) { + var r = this;return tidy(function () { + null != r.cell.dropoutMask && (dispose(r.cell.dropoutMask), r.cell.dropoutMask = null), null != r.cell.recurrentDropoutMask && (dispose(r.cell.recurrentDropoutMask), r.cell.recurrentDropoutMask = null);var i = null == n ? null : n.mask, + a = null == n ? null : n.training, + o = null == n ? null : n.initialState;return e.prototype.call.call(r, t, { mask: i, training: a, initialState: o }); + }); + }, Object.defineProperty(t.prototype, "units", { get: function () { + return this.cell.units; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "activation", { get: function () { + return this.cell.activation; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentActivation", { get: function () { + return this.cell.recurrentActivation; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "useBias", { get: function () { + return this.cell.useBias; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "kernelInitializer", { get: function () { + return this.cell.kernelInitializer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentInitializer", { get: function () { + return this.cell.recurrentInitializer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "biasInitializer", { get: function () { + return this.cell.biasInitializer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "unitForgetBias", { get: function () { + return this.cell.unitForgetBias; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "kernelRegularizer", { get: function () { + return this.cell.kernelRegularizer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentRegularizer", { get: function () { + return this.cell.recurrentRegularizer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "biasRegularizer", { get: function () { + return this.cell.biasRegularizer; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "kernelConstraint", { get: function () { + return this.cell.kernelConstraint; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentConstraint", { get: function () { + return this.cell.recurrentConstraint; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "biasConstraint", { get: function () { + return this.cell.biasConstraint; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "dropout", { get: function () { + return this.cell.dropout; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "recurrentDropout", { get: function () { + return this.cell.recurrentDropout; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "implementation", { get: function () { + return this.cell.implementation; + }, enumerable: !0, configurable: !0 }), t.prototype.getConfig = function () { + var t = { units: this.units, activation: serializeActivation(this.activation), recurrentActivation: serializeActivation(this.recurrentActivation), useBias: this.useBias, kernelInitializer: serializeInitializer(this.kernelInitializer), recurrentInitializer: serializeInitializer(this.recurrentInitializer), biasInitializer: serializeInitializer(this.biasInitializer), unitForgetBias: this.unitForgetBias, kernelRegularizer: serializeRegularizer(this.kernelRegularizer), recurrentRegularizer: serializeRegularizer(this.recurrentRegularizer), biasRegularizer: serializeRegularizer(this.biasRegularizer), activityRegularizer: serializeRegularizer(this.activityRegularizer), kernelConstraint: serializeConstraint(this.kernelConstraint), recurrentConstraint: serializeConstraint(this.recurrentConstraint), biasConstraint: serializeConstraint(this.biasConstraint), dropout: this.dropout, recurrentDropout: this.recurrentDropout, implementation: this.implementation }, + n = e.prototype.getConfig.call(this);return delete n.cell, Object.assign(t, n), t; + }, t.fromConfig = function (e, t) { + return 0 === t.implmentation && (t.implementation = 1), new e(t); + }, t.className = "LSTM", t; + }(RNN);serialization.SerializationMap.register(LSTM);var StackedRNNCells = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.cells = t.cells, n; + }return __extends$1(t, e), Object.defineProperty(t.prototype, "stateSize", { get: function () { + for (var e = [], t = 0, n = this.cells.slice().reverse(); t < n.length; t++) { + var r = n[t];Array.isArray(r.stateSize) ? e.push.apply(e, r.stateSize) : e.push(r.stateSize); + }return e; + }, enumerable: !0, configurable: !0 }), t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + for (var r = (e = e).slice(1), i = [], a = 0, o = n.cells.slice().reverse(); a < o.length; a++) { + var s = o[a];Array.isArray(s.stateSize) ? i.push(r.splice(0, s.stateSize.length)) : i.push(r.splice(0, 1)); + }i.reverse();for (var l, u = [], c = 0; c < n.cells.length; ++c) { + s = n.cells[c];r = i[c], l = 0 === c ? [e[0]].concat(r) : [l[0]].concat(r), l = s.call(l, t), u.push(l.slice(1)); + }r = [];for (var p = 0, h = u.slice().reverse(); p < h.length; p++) { + var d = h[p];r.push.apply(r, d); + }return [l[0]].concat(r); + }); + }, t.prototype.build = function (e) { + var t;isArrayOfShapes(e) && (e = e[0]), e = e;for (var n = 0, r = this.cells; n < r.length; n++) { + var i = r[n];i.build(e), t = Array.isArray(i.stateSize) ? i.stateSize[0] : i.stateSize, e = [e[0], t]; + }this.built = !0; + }, t.prototype.getConfig = function () { + for (var t = [], n = 0, r = this.cells; n < r.length; n++) { + var i = r[n];t.push({ className: this.getClassName(), config: i.getConfig() }); + }var a = { cells: t }, + o = e.prototype.getConfig.call(this);return Object.assign(a, o), a; + }, t.fromConfig = function (e, t, n) { + void 0 === n && (n = {});for (var r = [], i = 0, a = t.cells; i < a.length; i++) { + var o = a[i];r.push(deserialize(o, n)); + }return new e({ cells: r }); + }, Object.defineProperty(t.prototype, "trainableWeights", { get: function () { + if (!this.trainable) return [];for (var e = [], t = 0, n = this.cells; t < n.length; t++) { + var r = n[t];e.push.apply(e, r.trainableWeights); + }return e; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "nonTrainableWeights", { get: function () { + for (var e = [], t = 0, n = this.cells; t < n.length; t++) { + var r = n[t];e.push.apply(e, r.nonTrainableWeights); + }if (!this.trainable) { + for (var i = [], a = 0, o = this.cells; a < o.length; a++) { + r = o[a];i.push.apply(i, r.trainableWeights); + }return i.concat(e); + }return e; + }, enumerable: !0, configurable: !0 }), t.prototype.getWeights = function () { + for (var e = [], t = 0, n = this.cells; t < n.length; t++) { + var r = n[t];e.push.apply(e, r.weights); + }return batchGetValue(e); + }, t.prototype.setWeights = function (e) { + for (var t = [], n = 0, r = this.cells; n < r.length; n++) for (var i = r[n], a = i.weights.length, o = e.splice(a), s = 0; s < i.weights.length; ++s) t.push([i.weights[s], o[s]]);batchSetValue(t); + }, t.className = "StackedRNNCells", t; + }(RNNCell);function generateDropoutMask(e, t, n, r) { + function i() { + return dropout(e(), getScalar(t)); + }if (void 0 === n && (n = null), void 0 === r && (r = 1), r > 1) { + for (var a = [], o = 0; o < r; o++) a.push(inTrainPhase(i, e, n));return a.forEach(function (e) { + return keep(e); + }), a; + }return keep(inTrainPhase(i, e, n)); + }serialization.SerializationMap.register(StackedRNNCells);var Wrapper = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.layer = t.layer, n; + }return __extends$1(t, e), t.prototype.build = function (e) { + this.built = !0; + }, Object.defineProperty(t.prototype, "trainable", { get: function () { + return null != this.layer && this.layer.trainable; + }, set: function (e) { + null != this.layer && (this.layer.trainable = e); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "trainableWeights", { get: function () { + return this.layer.trainableWeights; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "nonTrainableWeights", { get: function () { + return this.layer.nonTrainableWeights; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "updates", { get: function () { + return this.layer._updates; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "losses", { get: function () { + return this.layer.losses; + }, enumerable: !0, configurable: !0 }), t.prototype.getWeights = function () { + return this.layer.getWeights(); + }, t.prototype.setWeights = function (e) { + this.layer.setWeights(e); + }, t.prototype.getConfig = function () { + var t = { layer: { className: this.layer.getClassName(), config: this.layer.getConfig() } }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.fromConfig = function (e, t, n) { + void 0 === n && (n = {});var r = deserialize(t.layer, n);delete t.layer;var i = { layer: r };return Object.assign(i, t), new e(i); + }, t; + }(Layer), + TimeDistributed = function (e) { + function t(t) { + var n = e.call(this, t) || this;return n.supportsMasking = !0, n; + }return __extends$1(t, e), t.prototype.build = function (t) { + if ((t = getExactlyOneShape(t)).length < 3) throw new ValueError("TimeDistributed layer expects an input shape >= 3D, but received input shape " + JSON.stringify(t));this.inputSpec = [{ shape: t }];var n = [t[0]].concat(t.slice(2));this.layer.built || (this.layer.build(n), this.layer.built = !0), e.prototype.build.call(this, t); + }, t.prototype.computeOutputShape = function (e) { + var t = [(e = getExactlyOneShape(e))[0]].concat(e.slice(2)), + n = this.layer.computeOutputShape(t), + r = e[1];return [n[0], r].concat(n.slice(1)); + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + return rnn(function (e, r) { + return [n.layer.call(e, t), []]; + }, e = getExactlyOneTensor(e), [], !1, null, null, !1, e.shape[1])[1]; + }); + }, t.className = "TimeDistributed", t; + }(Wrapper);serialization.SerializationMap.register(TimeDistributed);var VALID_BIDIRECTIONAL_MERGE_MODES = ["sum", "mul", "concat", "ave"];function checkBidirectionalMergeMode(e) { + checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES, "BidirectionalMergeMode", e); + }var Bidirectional = function (e) { + function t(t) { + var n = e.call(this, t) || this, + r = t.layer.getConfig();if (n.forwardLayer = deserialize({ className: t.layer.getClassName(), config: r }), r.goBackwards = !0 !== r.goBackwards, n.backwardLayer = deserialize({ className: t.layer.getClassName(), config: r }), n.forwardLayer.name = "forward_" + n.forwardLayer.name, n.backwardLayer.name = "backward_" + n.backwardLayer.name, checkBidirectionalMergeMode(t.mergeMode), n.mergeMode = t.mergeMode, t.weights) throw new NotImplementedError("weights support is not implemented for Bidirectional layer yet.");return n._stateful = t.layer.stateful, n.returnSequences = t.layer.returnSequences, n.returnState = t.layer.returnState, n.supportsMasking = !0, n._trainable = !0, n.inputSpec = t.layer.inputSpec, n.numConstants = null, n; + }return __extends$1(t, e), Object.defineProperty(t.prototype, "trainable", { get: function () { + return this._trainable; + }, set: function (e) { + this._trainable = e, null != this.forwardLayer && (this.forwardLayer.trainable = e), null != this.backwardLayer && (this.backwardLayer.trainable = e); + }, enumerable: !0, configurable: !0 }), t.prototype.getWeights = function () { + return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights()); + }, t.prototype.setWeights = function (e) { + var t = e.length, + n = Math.floor(t / 2);this.forwardLayer.setWeights(e.slice(0, n)), this.backwardLayer.setWeights(e.slice(n)); + }, t.prototype.computeOutputShape = function (e) { + var t, + n, + r, + i = this.forwardLayer.computeOutputShape(e);return Array.isArray(i) && Array.isArray(i[0]) || (i = [i]), i = i, this.returnState ? (r = i.slice(1), t = i[0]) : t = i[0], t = t, "concat" === this.mergeMode ? (t[t.length - 1] *= 2, n = [t]) : n = null == this.mergeMode ? [t, t.slice()] : [t], this.returnState ? null == this.mergeMode ? n.concat(r).concat(r.slice()) : [t].concat(r).concat(r.slice()) : singletonOrArray(n); + }, t.prototype.apply = function (t, n) { + var r = null == n ? null : n.initialState, + i = null == n ? null : n.constants;null == n && (n = {});var a = standardizeArgs(t, r, i, this.numConstants);if (t = a.inputs, r = a.initialState, i = a.constants, Array.isArray(t) && (r = t.slice(1), t = t[0]), (null == r || 0 === r.length) && null == i) return e.prototype.apply.call(this, t, n);var o = [], + s = [];if (null != r) { + var l = r.length;if (l % 2 > 0) throw new ValueError("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");n.initialState = r, o.push.apply(o, r);var u = r.map(function (e) { + return new InputSpec({ shape: e.shape }); + });this.forwardLayer.stateSpec = u.slice(0, l / 2), this.backwardLayer.stateSpec = u.slice(l / 2), s.push.apply(s, u); + }if (null != i) throw new NotImplementedError("Support for constants in Bidirectional layers is not implemented yet.");for (var c = o[0] instanceof SymbolicTensor, p = 0, h = o; p < h.length; p++) { + if (h[p] instanceof SymbolicTensor !== c) throw new ValueError("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors"); + }if (c) { + var d = [t].concat(o), + g = this.inputSpec.concat(s), + f = this.inputSpec;this.inputSpec = g;var m = e.prototype.apply.call(this, d, n);return this.inputSpec = f, m; + }return e.prototype.apply.call(this, t, n); + }, t.prototype.call = function (e, t) { + var n = this;return tidy(function () { + if (null != t.mask) throw new NotImplementedError("The support for masking is not implemented for Bidirectional layers yet.");var r, + i, + a, + o, + s = t.initialState;if (null == s) r = n.forwardLayer.call(e, t), i = n.backwardLayer.call(e, t);else { + var l = s.slice(0, s.length / 2), + u = s.slice(s.length / 2);r = n.forwardLayer.call(e, Object.assign(t, { initialState: l })), i = n.forwardLayer.call(e, Object.assign(t, { initialState: u })); + }return n.returnState && (Array.isArray(r) && (a = r.slice(1).concat(i.slice(1))), r = r[0], i = i[0]), n.returnSequences && (i = reverse(i, 1)), "concat" === n.mergeMode ? o = concatenate([r, i]) : "sum" === n.mergeMode ? o = add(r, i) : "ave" === n.mergeMode ? o = mul(getScalar(.5), add(r, i)) : "mul" === n.mergeMode ? o = mul(r, i) : null == n.mergeMode && (o = [r, i]), n.returnState ? null == n.mergeMode ? o.concat(a) : [o].concat(a) : o; + }); + }, t.prototype.resetStates = function (e) { + this.forwardLayer.resetStates(), this.backwardLayer.resetStates(); + }, t.prototype.build = function (e) { + var t = this;nameScope(this.forwardLayer.name, function () { + t.forwardLayer.build(e); + }), nameScope(this.backwardLayer.name, function () { + t.backwardLayer.build(e); + }), this.built = !0; + }, Object.defineProperty(t.prototype, "trainableWeights", { get: function () { + return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "nonTrainableWeights", { get: function () { + return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights); + }, enumerable: !0, configurable: !0 }), t.prototype.getConfig = function () { + var t = { mergeMode: this.mergeMode }, + n = e.prototype.getConfig.call(this);return Object.assign(t, n), t; + }, t.fromConfig = function (e, t) { + var n = deserialize(t.layer);if (delete t.layer, null != t.numConstants) throw new NotImplementedError("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");var r = t;return r.layer = n, new e(r); + }, t.className = "Bidirectional", t; + }(Wrapper);function inputLayer(e) { + return new InputLayer(e); + }function elu$2(e) { + return new ELU$1(e); + }function leakyReLU(e) { + return new LeakyReLU(e); + }function softmax$1(e) { + return new Softmax$1(e); + }function thresholdedReLU(e) { + return new ThresholdedReLU(e); + }function conv1d$2(e) { + return new Conv1D(e); + }function conv2d$2(e) { + return new Conv2D(e); + }function conv2dTranspose$1(e) { + return new Conv2DTranspose(e); + }function separableConv2d$1(e) { + return new SeparableConv2D(e); + }function cropping2D(e) { + return new Cropping2D(e); + }function upSampling2d(e) { + return new UpSampling2D(e); + }function depthwiseConv2d$2(e) { + return new DepthwiseConv2D(e); + }function activation(e) { + return new Activation$1(e); + }function dense(e) { + return new Dense(e); + }function dropout$1(e) { + return new Dropout(e); + }function flatten$1$1(e) { + return new Flatten(e); + }function repeatVector(e) { + return new RepeatVector(e); + }function reshape$1(e) { + return new Reshape(e); + }function embedding(e) { + return new Embedding(e); + }function add$2(e) { + return new Add(e); + }function average$1(e) { + return new Average(e); + }function concatenate$2(e) { + return new Concatenate(e); + }function maximum$2(e) { + return new Maximum(e); + }function minimum$2(e) { + return new Minimum(e); + }function multiply$1(e) { + return new Multiply(e); + }function batchNormalization$1$1(e) { + return new BatchNormalization(e); + }function zeroPadding2d(e) { + return new ZeroPadding2D(e); + }function averagePooling1d(e) { + return new AveragePooling1D(e); + }function avgPool1d(e) { + return averagePooling1d(e); + }function avgPooling1d(e) { + return averagePooling1d(e); + }function averagePooling2d(e) { + return new AveragePooling2D(e); + }function avgPool2d(e) { + return averagePooling2d(e); + }function avgPooling2d(e) { + return averagePooling2d(e); + }function globalAveragePooling1d(e) { + return new GlobalAveragePooling1D(e); + }function globalAveragePooling2d(e) { + return new GlobalAveragePooling2D(e); + }function globalMaxPooling1d(e) { + return new GlobalMaxPooling1D(e); + }function globalMaxPooling2d(e) { + return new GlobalMaxPooling2D(e); + }function maxPooling1d(e) { + return new MaxPooling1D(e); + }function maxPooling2d(e) { + return new MaxPooling2D(e); + }function gru(e) { + return new GRU(e); + }function gruCell(e) { + return new GRUCell(e); + }function lstm(e) { + return new LSTM(e); + }function lstmCell(e) { + return new LSTMCell(e); + }function simpleRNN(e) { + return new SimpleRNN(e); + }function simpleRNNCell(e) { + return new SimpleRNNCell(e); + }function rnn$1(e) { + return new RNN(e); + }function stackedRNNCells(e) { + return new StackedRNNCells(e); + }function bidirectional(e) { + return new Bidirectional(e); + }function timeDistributed(e) { + return new TimeDistributed(e); + }serialization.SerializationMap.register(Bidirectional);var globalMaxPool1d = globalMaxPooling1d, + globalMaxPool2d = globalMaxPooling2d, + maxPool1d = maxPooling1d, + maxPool2d = maxPooling2d, + exports_layers = Object.freeze({ inputLayer: inputLayer, elu: elu$2, leakyReLU: leakyReLU, softmax: softmax$1, thresholdedReLU: thresholdedReLU, conv1d: conv1d$2, conv2d: conv2d$2, conv2dTranspose: conv2dTranspose$1, separableConv2d: separableConv2d$1, cropping2D: cropping2D, upSampling2d: upSampling2d, depthwiseConv2d: depthwiseConv2d$2, activation: activation, dense: dense, dropout: dropout$1, flatten: flatten$1$1, repeatVector: repeatVector, reshape: reshape$1, embedding: embedding, add: add$2, average: average$1, concatenate: concatenate$2, maximum: maximum$2, minimum: minimum$2, multiply: multiply$1, batchNormalization: batchNormalization$1$1, zeroPadding2d: zeroPadding2d, averagePooling1d: averagePooling1d, avgPool1d: avgPool1d, avgPooling1d: avgPooling1d, averagePooling2d: averagePooling2d, avgPool2d: avgPool2d, avgPooling2d: avgPooling2d, globalAveragePooling1d: globalAveragePooling1d, globalAveragePooling2d: globalAveragePooling2d, globalMaxPooling1d: globalMaxPooling1d, globalMaxPooling2d: globalMaxPooling2d, maxPooling1d: maxPooling1d, maxPooling2d: maxPooling2d, gru: gru, gruCell: gruCell, lstm: lstm, lstmCell: lstmCell, simpleRNN: simpleRNN, simpleRNNCell: simpleRNNCell, rnn: rnn$1, stackedRNNCells: stackedRNNCells, bidirectional: bidirectional, timeDistributed: timeDistributed, globalMaxPool1d: globalMaxPool1d, globalMaxPool2d: globalMaxPool2d, maxPool1d: maxPool1d, maxPool2d: maxPool2d, Layer: Layer, input: input });function binaryAccuracy$1(e, t) { + return binaryAccuracy(e, t); + }function binaryCrossentropy$2(e, t) { + return binaryCrossentropy$1(e, t); + }function categoricalAccuracy$1(e, t) { + return categoricalAccuracy(e, t); + }function categoricalCrossentropy$2(e, t) { + return categoricalCrossentropy$1(e, t); + }function cosineProximity$1(e, t) { + return cosineProximity(e, t); + }function meanAbsoluteError$1(e, t) { + return meanAbsoluteError(e, t); + }function meanAbsolutePercentageError$1(e, t) { + return meanAbsolutePercentageError(e, t); + }function MAPE$2(e, t) { + return meanAbsolutePercentageError(e, t); + }function mape$2(e, t) { + return meanAbsolutePercentageError(e, t); + }function meanSquaredError$1$1(e, t) { + return meanSquaredError$1(e, t); + }function MSE$2(e, t) { + return meanSquaredError$1(e, t); + }function mse$2(e, t) { + return meanSquaredError$1(e, t); + }var exports_metrics = Object.freeze({ binaryAccuracy: binaryAccuracy$1, binaryCrossentropy: binaryCrossentropy$2, categoricalAccuracy: categoricalAccuracy$1, categoricalCrossentropy: categoricalCrossentropy$2, cosineProximity: cosineProximity$1, meanAbsoluteError: meanAbsoluteError$1, meanAbsolutePercentageError: meanAbsolutePercentageError$1, MAPE: MAPE$2, mape: mape$2, meanSquaredError: meanSquaredError$1$1, MSE: MSE$2, mse: mse$2 });function l1l2(e) { + return new L1L2(e); + }function l1$1(e) { + return l1(e); + }function l2$1(e) { + return l2(e); + }var exports_regularizers = Object.freeze({ l1l2: l1l2, l1: l1$1, l2: l2$1 }), + Callback = function (e) { + function t() { + var t = null !== e && e.apply(this, arguments) || this;return t.model = null, t; + }return __extends$1(t, e), t.prototype.setModel = function (e) { + if (!(e instanceof Model)) throw new Error("model must be a Model, not some other Container");this.model = e; + }, t; + }(BaseCallback); + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var __assign$2 = Object.assign || function (e) { + for (var t, a = 1, r = arguments.length; a < r; a++) for (var n in t = arguments[a]) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);return e; + };function __awaiter$2(e, t, a, r) { + return new (a || (a = Promise))(function (n, o) { + function s(e) { + try { + p(r.next(e)); + } catch (e) { + o(e); + } + }function i(e) { + try { + p(r.throw(e)); + } catch (e) { + o(e); + } + }function p(e) { + e.done ? n(e.value) : new a(function (t) { + t(e.value); + }).then(s, i); + }p((r = r.apply(e, t || [])).next()); + }); + }function __generator$2(e, t) { + var a, + r, + n, + o, + s = { label: 0, sent: function () { + if (1 & n[0]) throw n[1];return n[1]; + }, trys: [], ops: [] };return o = { next: i(0), throw: i(1), return: i(2) }, "function" == typeof Symbol && (o[Symbol.iterator] = function () { + return this; + }), o;function i(o) { + return function (i) { + return function (o) { + if (a) throw new TypeError("Generator is already executing.");for (; s;) try { + if (a = 1, r && (n = r[2 & o[0] ? "return" : o[0] ? "throw" : "next"]) && !(n = n.call(r, o[1])).done) return n;switch (r = 0, n && (o = [0, n.value]), o[0]) {case 0:case 1: + n = o;break;case 4: + return s.label++, { value: o[1], done: !1 };case 5: + s.label++, r = o[1], o = [0];continue;case 7: + o = s.ops.pop(), s.trys.pop();continue;default: + if (!(n = (n = s.trys).length > 0 && n[n.length - 1]) && (6 === o[0] || 2 === o[0])) { + s = 0;continue; + }if (3 === o[0] && (!n || o[1] > n[0] && o[1] < n[3])) { + s.label = o[1];break; + }if (6 === o[0] && s.label < n[1]) { + s.label = n[1], n = o;break; + }if (n && s.label < n[2]) { + s.label = n[2], s.ops.push(o);break; + }n[2] && s.ops.pop(), s.trys.pop();continue;}o = t.call(e, s); + } catch (e) { + o = [6, e], r = 0; + } finally { + a = n = 0; + }if (5 & o[0]) throw o[1];return { value: o[0] ? o[1] : void 0, done: !0 }; + }([o, i]); + }; + } + }var commonjsGlobal$1 = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};function createCommonjsModule$1(e, t) { + return e(t = { exports: {} }, t.exports), t.exports; + }var punycode = createCommonjsModule$1(function (e, t) { + !function (a) { + var r = t && !t.nodeType && t, + n = e && !e.nodeType && e, + o = "object" == typeof commonjsGlobal$1 && commonjsGlobal$1;o.global !== o && o.window !== o && o.self !== o || (a = o);var s, + i, + p = 2147483647, + u = 36, + m = 1, + l = 26, + d = 38, + c = 700, + f = 72, + h = 128, + y = "-", + g = /^xn--/, + N = /[^\x20-\x7E]/, + P = /[\x2E\u3002\uFF0E\uFF61]/g, + b = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, + x = u - m, + v = Math.floor, + I = String.fromCharCode;function O(e) { + throw RangeError(b[e]); + }function w(e, t) { + for (var a = e.length, r = []; a--;) r[a] = t(e[a]);return r; + }function V(e, t) { + var a = e.split("@"), + r = "";return a.length > 1 && (r = a[0] + "@", e = a[1]), r + w((e = e.replace(P, ".")).split("."), t).join("."); + }function T(e) { + for (var t, a, r = [], n = 0, o = e.length; n < o;) (t = e.charCodeAt(n++)) >= 55296 && t <= 56319 && n < o ? 56320 == (64512 & (a = e.charCodeAt(n++))) ? r.push(((1023 & t) << 10) + (1023 & a) + 65536) : (r.push(t), n--) : r.push(t);return r; + }function k(e) { + return w(e, function (e) { + var t = "";return e > 65535 && (t += I((e -= 65536) >>> 10 & 1023 | 55296), e = 56320 | 1023 & e), t += I(e); + }).join(""); + }function $(e, t) { + return e + 22 + 75 * (e < 26) - ((0 != t) << 5); + }function _(e, t, a) { + var r = 0;for (e = a ? v(e / c) : e >> 1, e += v(e / t); e > x * l >> 1; r += u) e = v(e / x);return v(r + (x + 1) * e / (e + d)); + }function A(e) { + var t, + a, + r, + n, + o, + s, + i, + d, + c, + g, + N, + P = [], + b = e.length, + x = 0, + I = h, + w = f;for ((a = e.lastIndexOf(y)) < 0 && (a = 0), r = 0; r < a; ++r) e.charCodeAt(r) >= 128 && O("not-basic"), P.push(e.charCodeAt(r));for (n = a > 0 ? a + 1 : 0; n < b;) { + for (o = x, s = 1, i = u; n >= b && O("invalid-input"), ((d = (N = e.charCodeAt(n++)) - 48 < 10 ? N - 22 : N - 65 < 26 ? N - 65 : N - 97 < 26 ? N - 97 : u) >= u || d > v((p - x) / s)) && O("overflow"), x += d * s, !(d < (c = i <= w ? m : i >= w + l ? l : i - w)); i += u) s > v(p / (g = u - c)) && O("overflow"), s *= g;w = _(x - o, t = P.length + 1, 0 == o), v(x / t) > p - I && O("overflow"), I += v(x / t), x %= t, P.splice(x++, 0, I); + }return k(P); + }function S(e) { + var t, + a, + r, + n, + o, + s, + i, + d, + c, + g, + N, + P, + b, + x, + w, + V = [];for (P = (e = T(e)).length, t = h, a = 0, o = f, s = 0; s < P; ++s) (N = e[s]) < 128 && V.push(I(N));for (r = n = V.length, n && V.push(y); r < P;) { + for (i = p, s = 0; s < P; ++s) (N = e[s]) >= t && N < i && (i = N);for (i - t > v((p - a) / (b = r + 1)) && O("overflow"), a += (i - t) * b, t = i, s = 0; s < P; ++s) if ((N = e[s]) < t && ++a > p && O("overflow"), N == t) { + for (d = a, c = u; !(d < (g = c <= o ? m : c >= o + l ? l : c - o)); c += u) w = d - g, x = u - g, V.push(I($(g + w % x, 0))), d = v(w / x);V.push(I($(d, 0))), o = _(a, b, r == n), a = 0, ++r; + }++a, ++t; + }return V.join(""); + }if (s = { version: "1.3.2", ucs2: { decode: T, encode: k }, decode: A, encode: S, toASCII: function (e) { + return V(e, function (e) { + return N.test(e) ? "xn--" + S(e) : e; + }); + }, toUnicode: function (e) { + return V(e, function (e) { + return g.test(e) ? A(e.slice(4).toLowerCase()) : e; + }); + } }, r && n) { + if (e.exports == r) n.exports = s;else for (i in s) s.hasOwnProperty(i) && (r[i] = s[i]); + } else a.punycode = s; + }(commonjsGlobal$1); + }), + util$1 = { isString: function (e) { + return "string" == typeof e; + }, isObject: function (e) { + return "object" == typeof e && null !== e; + }, isNull: function (e) { + return null === e; + }, isNullOrUndefined: function (e) { + return null == e; + } };function hasOwnProperty(e, t) { + return Object.prototype.hasOwnProperty.call(e, t); + }var decode = function (e, t, a, r) { + t = t || "&", a = a || "=";var n = {};if ("string" != typeof e || 0 === e.length) return n;var o = /\+/g;e = e.split(t);var s = 1e3;r && "number" == typeof r.maxKeys && (s = r.maxKeys);var i = e.length;s > 0 && i > s && (i = s);for (var p = 0; p < i; ++p) { + var u, + m, + l, + d, + c = e[p].replace(o, "%20"), + f = c.indexOf(a);f >= 0 ? (u = c.substr(0, f), m = c.substr(f + 1)) : (u = c, m = ""), l = decodeURIComponent(u), d = decodeURIComponent(m), hasOwnProperty(n, l) ? Array.isArray(n[l]) ? n[l].push(d) : n[l] = [n[l], d] : n[l] = d; + }return n; + }, + stringifyPrimitive = function (e) { + switch (typeof e) {case "string": + return e;case "boolean": + return e ? "true" : "false";case "number": + return isFinite(e) ? e : "";default: + return "";} + }, + encode = function (e, t, a, r) { + return t = t || "&", a = a || "=", null === e && (e = void 0), "object" == typeof e ? Object.keys(e).map(function (r) { + var n = encodeURIComponent(stringifyPrimitive(r)) + a;return Array.isArray(e[r]) ? e[r].map(function (e) { + return n + encodeURIComponent(stringifyPrimitive(e)); + }).join(t) : n + encodeURIComponent(stringifyPrimitive(e[r])); + }).join(t) : r ? encodeURIComponent(stringifyPrimitive(r)) + a + encodeURIComponent(stringifyPrimitive(e)) : ""; + }, + querystring = createCommonjsModule$1(function (e, t) { + t.decode = t.parse = decode, t.encode = t.stringify = encode; + }), + querystring_1 = querystring.decode, + querystring_2 = querystring.parse, + querystring_3 = querystring.encode, + querystring_4 = querystring.stringify, + parse = urlParse, + format = urlFormat;function Url() { + this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null; + }var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + delims = ["<", ">", '"', "`", " ", "\r", "\n", "\t"], + unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims), + autoEscape = ["'"].concat(unwise), + nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape), + hostEndingChars = ["/", "?", "#"], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + unsafeProtocol = { javascript: !0, "javascript:": !0 }, + hostlessProtocol = { javascript: !0, "javascript:": !0 }, + slashedProtocol = { http: !0, https: !0, ftp: !0, gopher: !0, file: !0, "http:": !0, "https:": !0, "ftp:": !0, "gopher:": !0, "file:": !0 };function urlParse(e, t, a) { + if (e && util$1.isObject(e) && e instanceof Url) return e;var r = new Url();return r.parse(e, t, a), r; + }function urlFormat(e) { + return util$1.isString(e) && (e = urlParse(e)), e instanceof Url ? e.format() : Url.prototype.format.call(e); + }Url.prototype.parse = function (e, t, a) { + if (!util$1.isString(e)) throw new TypeError("Parameter 'url' must be a string, not " + typeof e);var r = e.indexOf("?"), + n = -1 !== r && r < e.indexOf("#") ? "?" : "#", + o = e.split(n);o[0] = o[0].replace(/\\/g, "/");var s = e = o.join(n);if (s = s.trim(), !a && 1 === e.split("#").length) { + var i = simplePathPattern.exec(s);if (i) return this.path = s, this.href = s, this.pathname = i[1], i[2] ? (this.search = i[2], this.query = t ? querystring.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "", this.query = {}), this; + }var p = protocolPattern.exec(s);if (p) { + var u = (p = p[0]).toLowerCase();this.protocol = u, s = s.substr(p.length); + }if (a || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var m = "//" === s.substr(0, 2);!m || p && hostlessProtocol[p] || (s = s.substr(2), this.slashes = !0); + }if (!hostlessProtocol[p] && (m || p && !slashedProtocol[p])) { + for (var l, d, c = -1, f = 0; f < hostEndingChars.length; f++) { + -1 !== (h = s.indexOf(hostEndingChars[f])) && (-1 === c || h < c) && (c = h); + }-1 !== (d = -1 === c ? s.lastIndexOf("@") : s.lastIndexOf("@", c)) && (l = s.slice(0, d), s = s.slice(d + 1), this.auth = decodeURIComponent(l)), c = -1;for (f = 0; f < nonHostChars.length; f++) { + var h;-1 !== (h = s.indexOf(nonHostChars[f])) && (-1 === c || h < c) && (c = h); + }-1 === c && (c = s.length), this.host = s.slice(0, c), s = s.slice(c), this.parseHost(), this.hostname = this.hostname || "";var y = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];if (!y) for (var g = this.hostname.split(/\./), N = (f = 0, g.length); f < N; f++) { + var P = g[f];if (P && !P.match(hostnamePartPattern)) { + for (var b = "", x = 0, v = P.length; x < v; x++) P.charCodeAt(x) > 127 ? b += "x" : b += P[x];if (!b.match(hostnamePartPattern)) { + var I = g.slice(0, f), + O = g.slice(f + 1), + w = P.match(hostnamePartStart);w && (I.push(w[1]), O.unshift(w[2])), O.length && (s = "/" + O.join(".") + s), this.hostname = I.join(".");break; + } + } + }this.hostname.length > hostnameMaxLen ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), y || (this.hostname = punycode.toASCII(this.hostname));var V = this.port ? ":" + this.port : "", + T = this.hostname || "";this.host = T + V, this.href += this.host, y && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== s[0] && (s = "/" + s)); + }if (!unsafeProtocol[u]) for (f = 0, N = autoEscape.length; f < N; f++) { + var k = autoEscape[f];if (-1 !== s.indexOf(k)) { + var $ = encodeURIComponent(k);$ === k && ($ = escape(k)), s = s.split(k).join($); + } + }var _ = s.indexOf("#");-1 !== _ && (this.hash = s.substr(_), s = s.slice(0, _));var A = s.indexOf("?");if (-1 !== A ? (this.search = s.substr(A), this.query = s.substr(A + 1), t && (this.query = querystring.parse(this.query)), s = s.slice(0, A)) : t && (this.search = "", this.query = {}), s && (this.pathname = s), slashedProtocol[u] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) { + V = this.pathname || "";var S = this.search || "";this.path = V + S; + }return this.href = this.format(), this; + }, Url.prototype.format = function () { + var e = this.auth || "";e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"), e += "@");var t = this.protocol || "", + a = this.pathname || "", + r = this.hash || "", + n = !1, + o = "";this.host ? n = e + this.host : this.hostname && (n = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (n += ":" + this.port)), this.query && util$1.isObject(this.query) && Object.keys(this.query).length && (o = querystring.stringify(this.query));var s = this.search || o && "?" + o || "";return t && ":" !== t.substr(-1) && (t += ":"), this.slashes || (!t || slashedProtocol[t]) && !1 !== n ? (n = "//" + (n || ""), a && "/" !== a.charAt(0) && (a = "/" + a)) : n || (n = ""), r && "#" !== r.charAt(0) && (r = "#" + r), s && "?" !== s.charAt(0) && (s = "?" + s), t + n + (a = a.replace(/[?#]/g, function (e) { + return encodeURIComponent(e); + })) + (s = s.replace("#", "%23")) + r; + }, Url.prototype.resolve = function (e) { + return this.resolveObject(urlParse(e, !1, !0)).format(); + }, Url.prototype.resolveObject = function (e) { + if (util$1.isString(e)) { + var t = new Url();t.parse(e, !1, !0), e = t; + }for (var a = new Url(), r = Object.keys(this), n = 0; n < r.length; n++) { + var o = r[n];a[o] = this[o]; + }if (a.hash = e.hash, "" === e.href) return a.href = a.format(), a;if (e.slashes && !e.protocol) { + for (var s = Object.keys(e), i = 0; i < s.length; i++) { + var p = s[i];"protocol" !== p && (a[p] = e[p]); + }return slashedProtocol[a.protocol] && a.hostname && !a.pathname && (a.path = a.pathname = "/"), a.href = a.format(), a; + }if (e.protocol && e.protocol !== a.protocol) { + if (!slashedProtocol[e.protocol]) { + for (var u = Object.keys(e), m = 0; m < u.length; m++) { + var l = u[m];a[l] = e[l]; + }return a.href = a.format(), a; + }if (a.protocol = e.protocol, e.host || hostlessProtocol[e.protocol]) a.pathname = e.pathname;else { + for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()););e.host || (e.host = ""), e.hostname || (e.hostname = ""), "" !== d[0] && d.unshift(""), d.length < 2 && d.unshift(""), a.pathname = d.join("/"); + }if (a.search = e.search, a.query = e.query, a.host = e.host || "", a.auth = e.auth, a.hostname = e.hostname || e.host, a.port = e.port, a.pathname || a.search) { + var c = a.pathname || "", + f = a.search || "";a.path = c + f; + }return a.slashes = a.slashes || e.slashes, a.href = a.format(), a; + }var h = a.pathname && "/" === a.pathname.charAt(0), + y = e.host || e.pathname && "/" === e.pathname.charAt(0), + g = y || h || a.host && e.pathname, + N = g, + P = a.pathname && a.pathname.split("/") || [], + b = (d = e.pathname && e.pathname.split("/") || [], a.protocol && !slashedProtocol[a.protocol]);if (b && (a.hostname = "", a.port = null, a.host && ("" === P[0] ? P[0] = a.host : P.unshift(a.host)), a.host = "", e.protocol && (e.hostname = null, e.port = null, e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)), e.host = null), g = g && ("" === d[0] || "" === P[0])), y) a.host = e.host || "" === e.host ? e.host : a.host, a.hostname = e.hostname || "" === e.hostname ? e.hostname : a.hostname, a.search = e.search, a.query = e.query, P = d;else if (d.length) P || (P = []), P.pop(), P = P.concat(d), a.search = e.search, a.query = e.query;else if (!util$1.isNullOrUndefined(e.search)) { + if (b) a.hostname = a.host = P.shift(), (w = !!(a.host && a.host.indexOf("@") > 0) && a.host.split("@")) && (a.auth = w.shift(), a.host = a.hostname = w.shift());return a.search = e.search, a.query = e.query, util$1.isNull(a.pathname) && util$1.isNull(a.search) || (a.path = (a.pathname ? a.pathname : "") + (a.search ? a.search : "")), a.href = a.format(), a; + }if (!P.length) return a.pathname = null, a.search ? a.path = "/" + a.search : a.path = null, a.href = a.format(), a;for (var x = P.slice(-1)[0], v = (a.host || e.host || P.length > 1) && ("." === x || ".." === x) || "" === x, I = 0, O = P.length; O >= 0; O--) "." === (x = P[O]) ? P.splice(O, 1) : ".." === x ? (P.splice(O, 1), I++) : I && (P.splice(O, 1), I--);if (!g && !N) for (; I--; I) P.unshift("..");!g || "" === P[0] || P[0] && "/" === P[0].charAt(0) || P.unshift(""), v && "/" !== P.join("/").substr(-1) && P.push("");var w, + V = "" === P[0] || P[0] && "/" === P[0].charAt(0);b && (a.hostname = a.host = V ? "" : P.length ? P.shift() : "", (w = !!(a.host && a.host.indexOf("@") > 0) && a.host.split("@")) && (a.auth = w.shift(), a.host = a.hostname = w.shift()));return (g = g || a.host && P.length) && !V && P.unshift(""), P.length ? a.pathname = P.join("/") : (a.pathname = null, a.path = null), util$1.isNull(a.pathname) && util$1.isNull(a.search) || (a.path = (a.pathname ? a.pathname : "") + (a.search ? a.search : "")), a.auth = e.auth || a.auth, a.slashes = a.slashes || e.slashes, a.href = a.format(), a; + }, Url.prototype.parseHost = function () { + var e = this.host, + t = portPattern.exec(e);t && (":" !== (t = t[0]) && (this.port = t.substr(1)), e = e.substr(0, e.length - t.length)), e && (this.hostname = e); + };var aspromise = asPromise;function asPromise(e, t) { + for (var a = new Array(arguments.length - 1), r = 0, n = 2, o = !0; n < arguments.length;) a[r++] = arguments[n++];return new Promise(function (n, s) { + a[r] = function (e) { + if (o) if (o = !1, e) s(e);else { + for (var t = new Array(arguments.length - 1), a = 0; a < t.length;) t[a++] = arguments[a];n.apply(null, t); + } + };try { + e.apply(t || null, a); + } catch (e) { + o && (o = !1, s(e)); + } + }); + }var base64_1 = createCommonjsModule$1(function (e, t) { + var a = t;a.length = function (e) { + var t = e.length;if (!t) return 0;for (var a = 0; --t % 4 > 1 && "=" === e.charAt(t);) ++a;return Math.ceil(3 * e.length) / 4 - a; + };for (var r = new Array(64), n = new Array(123), o = 0; o < 64;) n[r[o] = o < 26 ? o + 65 : o < 52 ? o + 71 : o < 62 ? o - 4 : o - 59 | 43] = o++;a.encode = function (e, t, a) { + for (var n, o = null, s = [], i = 0, p = 0; t < a;) { + var u = e[t++];switch (p) {case 0: + s[i++] = r[u >> 2], n = (3 & u) << 4, p = 1;break;case 1: + s[i++] = r[n | u >> 4], n = (15 & u) << 2, p = 2;break;case 2: + s[i++] = r[n | u >> 6], s[i++] = r[63 & u], p = 0;}i > 8191 && ((o || (o = [])).push(String.fromCharCode.apply(String, s)), i = 0); + }return p && (s[i++] = r[n], s[i++] = 61, 1 === p && (s[i++] = 61)), o ? (i && o.push(String.fromCharCode.apply(String, s.slice(0, i))), o.join("")) : String.fromCharCode.apply(String, s.slice(0, i)); + };a.decode = function (e, t, a) { + for (var r, o = a, s = 0, i = 0; i < e.length;) { + var p = e.charCodeAt(i++);if (61 === p && s > 1) break;if (void 0 === (p = n[p])) throw Error("invalid encoding");switch (s) {case 0: + r = p, s = 1;break;case 1: + t[a++] = r << 2 | (48 & p) >> 4, r = p, s = 2;break;case 2: + t[a++] = (15 & r) << 4 | (60 & p) >> 2, r = p, s = 3;break;case 3: + t[a++] = (3 & r) << 6 | p, s = 0;} + }if (1 === s) throw Error("invalid encoding");return a - o; + }, a.test = function (e) { + return (/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e) + ); + }; + }), + eventemitter = EventEmitter;function EventEmitter() { + this._listeners = {}; + }EventEmitter.prototype.on = function (e, t, a) { + return (this._listeners[e] || (this._listeners[e] = [])).push({ fn: t, ctx: a || this }), this; + }, EventEmitter.prototype.off = function (e, t) { + if (void 0 === e) this._listeners = {};else if (void 0 === t) this._listeners[e] = [];else for (var a = this._listeners[e], r = 0; r < a.length;) a[r].fn === t ? a.splice(r, 1) : ++r;return this; + }, EventEmitter.prototype.emit = function (e) { + var t = this._listeners[e];if (t) { + for (var a = [], r = 1; r < arguments.length;) a.push(arguments[r++]);for (r = 0; r < t.length;) t[r].fn.apply(t[r++].ctx, a); + }return this; + };var float_1 = factory(factory);function factory(e) { + return "undefined" != typeof Float32Array ? function () { + var t = new Float32Array([-0]), + a = new Uint8Array(t.buffer), + r = 128 === a[3];function n(e, r, n) { + t[0] = e, r[n] = a[0], r[n + 1] = a[1], r[n + 2] = a[2], r[n + 3] = a[3]; + }function o(e, r, n) { + t[0] = e, r[n] = a[3], r[n + 1] = a[2], r[n + 2] = a[1], r[n + 3] = a[0]; + }function s(e, r) { + return a[0] = e[r], a[1] = e[r + 1], a[2] = e[r + 2], a[3] = e[r + 3], t[0]; + }function i(e, r) { + return a[3] = e[r], a[2] = e[r + 1], a[1] = e[r + 2], a[0] = e[r + 3], t[0]; + }e.writeFloatLE = r ? n : o, e.writeFloatBE = r ? o : n, e.readFloatLE = r ? s : i, e.readFloatBE = r ? i : s; + }() : function () { + function t(e, t, a, r) { + var n = t < 0 ? 1 : 0;if (n && (t = -t), 0 === t) e(1 / t > 0 ? 0 : 2147483648, a, r);else if (isNaN(t)) e(2143289344, a, r);else if (t > 3.4028234663852886e38) e((n << 31 | 2139095040) >>> 0, a, r);else if (t < 1.1754943508222875e-38) e((n << 31 | Math.round(t / 1.401298464324817e-45)) >>> 0, a, r);else { + var o = Math.floor(Math.log(t) / Math.LN2);e((n << 31 | o + 127 << 23 | 8388607 & Math.round(t * Math.pow(2, -o) * 8388608)) >>> 0, a, r); + } + }function a(e, t, a) { + var r = e(t, a), + n = 2 * (r >> 31) + 1, + o = r >>> 23 & 255, + s = 8388607 & r;return 255 === o ? s ? NaN : n * (1 / 0) : 0 === o ? 1.401298464324817e-45 * n * s : n * Math.pow(2, o - 150) * (s + 8388608); + }e.writeFloatLE = t.bind(null, writeUintLE), e.writeFloatBE = t.bind(null, writeUintBE), e.readFloatLE = a.bind(null, readUintLE), e.readFloatBE = a.bind(null, readUintBE); + }(), "undefined" != typeof Float64Array ? function () { + var t = new Float64Array([-0]), + a = new Uint8Array(t.buffer), + r = 128 === a[7];function n(e, r, n) { + t[0] = e, r[n] = a[0], r[n + 1] = a[1], r[n + 2] = a[2], r[n + 3] = a[3], r[n + 4] = a[4], r[n + 5] = a[5], r[n + 6] = a[6], r[n + 7] = a[7]; + }function o(e, r, n) { + t[0] = e, r[n] = a[7], r[n + 1] = a[6], r[n + 2] = a[5], r[n + 3] = a[4], r[n + 4] = a[3], r[n + 5] = a[2], r[n + 6] = a[1], r[n + 7] = a[0]; + }function s(e, r) { + return a[0] = e[r], a[1] = e[r + 1], a[2] = e[r + 2], a[3] = e[r + 3], a[4] = e[r + 4], a[5] = e[r + 5], a[6] = e[r + 6], a[7] = e[r + 7], t[0]; + }function i(e, r) { + return a[7] = e[r], a[6] = e[r + 1], a[5] = e[r + 2], a[4] = e[r + 3], a[3] = e[r + 4], a[2] = e[r + 5], a[1] = e[r + 6], a[0] = e[r + 7], t[0]; + }e.writeDoubleLE = r ? n : o, e.writeDoubleBE = r ? o : n, e.readDoubleLE = r ? s : i, e.readDoubleBE = r ? i : s; + }() : function () { + function t(e, t, a, r, n, o) { + var s = r < 0 ? 1 : 0;if (s && (r = -r), 0 === r) e(0, n, o + t), e(1 / r > 0 ? 0 : 2147483648, n, o + a);else if (isNaN(r)) e(0, n, o + t), e(2146959360, n, o + a);else if (r > 1.7976931348623157e308) e(0, n, o + t), e((s << 31 | 2146435072) >>> 0, n, o + a);else { + var i;if (r < 2.2250738585072014e-308) e((i = r / 5e-324) >>> 0, n, o + t), e((s << 31 | i / 4294967296) >>> 0, n, o + a);else { + var p = Math.floor(Math.log(r) / Math.LN2);1024 === p && (p = 1023), e(4503599627370496 * (i = r * Math.pow(2, -p)) >>> 0, n, o + t), e((s << 31 | p + 1023 << 20 | 1048576 * i & 1048575) >>> 0, n, o + a); + } + } + }function a(e, t, a, r, n) { + var o = e(r, n + t), + s = e(r, n + a), + i = 2 * (s >> 31) + 1, + p = s >>> 20 & 2047, + u = 4294967296 * (1048575 & s) + o;return 2047 === p ? u ? NaN : i * (1 / 0) : 0 === p ? 5e-324 * i * u : i * Math.pow(2, p - 1075) * (u + 4503599627370496); + }e.writeDoubleLE = t.bind(null, writeUintLE, 0, 4), e.writeDoubleBE = t.bind(null, writeUintBE, 4, 0), e.readDoubleLE = a.bind(null, readUintLE, 0, 4), e.readDoubleBE = a.bind(null, readUintBE, 4, 0); + }(), e; + }function writeUintLE(e, t, a) { + t[a] = 255 & e, t[a + 1] = e >>> 8 & 255, t[a + 2] = e >>> 16 & 255, t[a + 3] = e >>> 24; + }function writeUintBE(e, t, a) { + t[a] = e >>> 24, t[a + 1] = e >>> 16 & 255, t[a + 2] = e >>> 8 & 255, t[a + 3] = 255 & e; + }function readUintLE(e, t) { + return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0; + }function readUintBE(e, t) { + return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0; + }var inquire_1 = inquire;function inquire(moduleName) { + try { + var mod$$1 = eval("quire".replace(/^/, "re"))(moduleName);if (mod$$1 && (mod$$1.length || Object.keys(mod$$1).length)) return mod$$1; + } catch (e) {}return null; + }var utf8_1 = createCommonjsModule$1(function (e, t) { + var a = t;a.length = function (e) { + for (var t = 0, a = 0, r = 0; r < e.length; ++r) (a = e.charCodeAt(r)) < 128 ? t += 1 : a < 2048 ? t += 2 : 55296 == (64512 & a) && 56320 == (64512 & e.charCodeAt(r + 1)) ? (++r, t += 4) : t += 3;return t; + }, a.read = function (e, t, a) { + if (a - t < 1) return "";for (var r, n = null, o = [], s = 0; t < a;) (r = e[t++]) < 128 ? o[s++] = r : r > 191 && r < 224 ? o[s++] = (31 & r) << 6 | 63 & e[t++] : r > 239 && r < 365 ? (r = ((7 & r) << 18 | (63 & e[t++]) << 12 | (63 & e[t++]) << 6 | 63 & e[t++]) - 65536, o[s++] = 55296 + (r >> 10), o[s++] = 56320 + (1023 & r)) : o[s++] = (15 & r) << 12 | (63 & e[t++]) << 6 | 63 & e[t++], s > 8191 && ((n || (n = [])).push(String.fromCharCode.apply(String, o)), s = 0);return n ? (s && n.push(String.fromCharCode.apply(String, o.slice(0, s))), n.join("")) : String.fromCharCode.apply(String, o.slice(0, s)); + }, a.write = function (e, t, a) { + for (var r, n, o = a, s = 0; s < e.length; ++s) (r = e.charCodeAt(s)) < 128 ? t[a++] = r : r < 2048 ? (t[a++] = r >> 6 | 192, t[a++] = 63 & r | 128) : 55296 == (64512 & r) && 56320 == (64512 & (n = e.charCodeAt(s + 1))) ? (r = 65536 + ((1023 & r) << 10) + (1023 & n), ++s, t[a++] = r >> 18 | 240, t[a++] = r >> 12 & 63 | 128, t[a++] = r >> 6 & 63 | 128, t[a++] = 63 & r | 128) : (t[a++] = r >> 12 | 224, t[a++] = r >> 6 & 63 | 128, t[a++] = 63 & r | 128);return a - o; + }; + }), + pool_1 = pool;function pool(e, t, a) { + var r = a || 8192, + n = r >>> 1, + o = null, + s = r;return function (a) { + if (a < 1 || a > n) return e(a);s + a > r && (o = e(r), s = 0);var i = t.call(o, s, s += a);return 7 & s && (s = 1 + (7 | s)), i; + }; + }var longbits = LongBits;function LongBits(e, t) { + this.lo = e >>> 0, this.hi = t >>> 0; + }var zero = LongBits.zero = new LongBits(0, 0);zero.toNumber = function () { + return 0; + }, zero.zzEncode = zero.zzDecode = function () { + return this; + }, zero.length = function () { + return 1; + };var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0";LongBits.fromNumber = function (e) { + if (0 === e) return zero;var t = e < 0;t && (e = -e);var a = e >>> 0, + r = (e - a) / 4294967296 >>> 0;return t && (r = ~r >>> 0, a = ~a >>> 0, ++a > 4294967295 && (a = 0, ++r > 4294967295 && (r = 0))), new LongBits(a, r); + }, LongBits.from = function (e) { + if ("number" == typeof e) return LongBits.fromNumber(e);if (minimal.isString(e)) { + if (!minimal.Long) return LongBits.fromNumber(parseInt(e, 10));e = minimal.Long.fromString(e); + }return e.low || e.high ? new LongBits(e.low >>> 0, e.high >>> 0) : zero; + }, LongBits.prototype.toNumber = function (e) { + if (!e && this.hi >>> 31) { + var t = 1 + ~this.lo >>> 0, + a = ~this.hi >>> 0;return t || (a = a + 1 >>> 0), -(t + 4294967296 * a); + }return this.lo + 4294967296 * this.hi; + }, LongBits.prototype.toLong = function (e) { + return minimal.Long ? new minimal.Long(0 | this.lo, 0 | this.hi, Boolean(e)) : { low: 0 | this.lo, high: 0 | this.hi, unsigned: Boolean(e) }; + };var charCodeAt = String.prototype.charCodeAt;LongBits.fromHash = function (e) { + return e === zeroHash ? zero : new LongBits((charCodeAt.call(e, 0) | charCodeAt.call(e, 1) << 8 | charCodeAt.call(e, 2) << 16 | charCodeAt.call(e, 3) << 24) >>> 0, (charCodeAt.call(e, 4) | charCodeAt.call(e, 5) << 8 | charCodeAt.call(e, 6) << 16 | charCodeAt.call(e, 7) << 24) >>> 0); + }, LongBits.prototype.toHash = function () { + return String.fromCharCode(255 & this.lo, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24, 255 & this.hi, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24); + }, LongBits.prototype.zzEncode = function () { + var e = this.hi >> 31;return this.hi = ((this.hi << 1 | this.lo >>> 31) ^ e) >>> 0, this.lo = (this.lo << 1 ^ e) >>> 0, this; + }, LongBits.prototype.zzDecode = function () { + var e = -(1 & this.lo);return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ e) >>> 0, this.hi = (this.hi >>> 1 ^ e) >>> 0, this; + }, LongBits.prototype.length = function () { + var e = this.lo, + t = (this.lo >>> 28 | this.hi << 4) >>> 0, + a = this.hi >>> 24;return 0 === a ? 0 === t ? e < 16384 ? e < 128 ? 1 : 2 : e < 2097152 ? 3 : 4 : t < 16384 ? t < 128 ? 5 : 6 : t < 2097152 ? 7 : 8 : a < 128 ? 9 : 10; + };var minimal = createCommonjsModule$1(function (e, t) { + var a = t;function r(e, t, a) { + for (var r = Object.keys(t), n = 0; n < r.length; ++n) void 0 !== e[r[n]] && a || (e[r[n]] = t[r[n]]);return e; + }function n(e) { + function t(e, a) { + if (!(this instanceof t)) return new t(e, a);Object.defineProperty(this, "message", { get: function () { + return e; + } }), Error.captureStackTrace ? Error.captureStackTrace(this, t) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), a && r(this, a); + }return (t.prototype = Object.create(Error.prototype)).constructor = t, Object.defineProperty(t.prototype, "name", { get: function () { + return e; + } }), t.prototype.toString = function () { + return this.name + ": " + this.message; + }, t; + }a.asPromise = aspromise, a.base64 = base64_1, a.EventEmitter = eventemitter, a.float = float_1, a.inquire = inquire_1, a.utf8 = utf8_1, a.pool = pool_1, a.LongBits = longbits, a.emptyArray = Object.freeze ? Object.freeze([]) : [], a.emptyObject = Object.freeze ? Object.freeze({}) : {}, a.isNode = Boolean(commonjsGlobal$1.process && commonjsGlobal$1.process.versions && commonjsGlobal$1.process.versions.node), a.isInteger = Number.isInteger || function (e) { + return "number" == typeof e && isFinite(e) && Math.floor(e) === e; + }, a.isString = function (e) { + return "string" == typeof e || e instanceof String; + }, a.isObject = function (e) { + return e && "object" == typeof e; + }, a.isset = a.isSet = function (e, t) { + var a = e[t];return !(null == a || !e.hasOwnProperty(t)) && ("object" != typeof a || (Array.isArray(a) ? a.length : Object.keys(a).length) > 0); + }, a.Buffer = function () { + try { + var e = a.inquire("buffer").Buffer;return e.prototype.utf8Write ? e : null; + } catch (e) { + return null; + } + }(), a._Buffer_from = null, a._Buffer_allocUnsafe = null, a.newBuffer = function (e) { + return "number" == typeof e ? a.Buffer ? a._Buffer_allocUnsafe(e) : new a.Array(e) : a.Buffer ? a._Buffer_from(e) : "undefined" == typeof Uint8Array ? e : new Uint8Array(e); + }, a.Array = "undefined" != typeof Uint8Array ? Uint8Array : Array, a.Long = commonjsGlobal$1.dcodeIO && commonjsGlobal$1.dcodeIO.Long || a.inquire("long"), a.key2Re = /^true|false|0|1$/, a.key32Re = /^-?(?:0|[1-9][0-9]*)$/, a.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, a.longToHash = function (e) { + return e ? a.LongBits.from(e).toHash() : a.LongBits.zeroHash; + }, a.longFromHash = function (e, t) { + var r = a.LongBits.fromHash(e);return a.Long ? a.Long.fromBits(r.lo, r.hi, t) : r.toNumber(Boolean(t)); + }, a.merge = r, a.lcFirst = function (e) { + return e.charAt(0).toLowerCase() + e.substring(1); + }, a.newError = n, a.ProtocolError = n("ProtocolError"), a.oneOfGetter = function (e) { + for (var t = {}, a = 0; a < e.length; ++a) t[e[a]] = 1;return function () { + for (var e = Object.keys(this), a = e.length - 1; a > -1; --a) if (1 === t[e[a]] && void 0 !== this[e[a]] && null !== this[e[a]]) return e[a]; + }; + }, a.oneOfSetter = function (e) { + return function (t) { + for (var a = 0; a < e.length; ++a) e[a] !== t && delete this[e[a]]; + }; + }, a.toJSONOptions = { longs: String, enums: String, bytes: String, json: !0 }, a._configure = function () { + var e = a.Buffer;e ? (a._Buffer_from = e.from !== Uint8Array.from && e.from || function (t, a) { + return new e(t, a); + }, a._Buffer_allocUnsafe = e.allocUnsafe || function (t) { + return new e(t); + }) : a._Buffer_from = a._Buffer_allocUnsafe = null; + }; + }), + writer = Writer, + BufferWriter, + LongBits$1 = minimal.LongBits, + base64 = minimal.base64, + utf8 = minimal.utf8;function Op(e, t, a) { + this.fn = e, this.len = t, this.next = void 0, this.val = a; + }function noop() {}function State(e) { + this.head = e.head, this.tail = e.tail, this.len = e.len, this.next = e.states; + }function Writer() { + this.len = 0, this.head = new Op(noop, 0, 0), this.tail = this.head, this.states = null; + }function writeByte(e, t, a) { + t[a] = 255 & e; + }function writeVarint32(e, t, a) { + for (; e > 127;) t[a++] = 127 & e | 128, e >>>= 7;t[a] = e; + }function VarintOp(e, t) { + this.len = e, this.next = void 0, this.val = t; + }function writeVarint64(e, t, a) { + for (; e.hi;) t[a++] = 127 & e.lo | 128, e.lo = (e.lo >>> 7 | e.hi << 25) >>> 0, e.hi >>>= 7;for (; e.lo > 127;) t[a++] = 127 & e.lo | 128, e.lo = e.lo >>> 7;t[a++] = e.lo; + }function writeFixed32(e, t, a) { + t[a] = 255 & e, t[a + 1] = e >>> 8 & 255, t[a + 2] = e >>> 16 & 255, t[a + 3] = e >>> 24; + }Writer.create = minimal.Buffer ? function () { + return (Writer.create = function () { + return new BufferWriter(); + })(); + } : function () { + return new Writer(); + }, Writer.alloc = function (e) { + return new minimal.Array(e); + }, minimal.Array !== Array && (Writer.alloc = minimal.pool(Writer.alloc, minimal.Array.prototype.subarray)), Writer.prototype._push = function (e, t, a) { + return this.tail = this.tail.next = new Op(e, t, a), this.len += t, this; + }, VarintOp.prototype = Object.create(Op.prototype), VarintOp.prototype.fn = writeVarint32, Writer.prototype.uint32 = function (e) { + return this.len += (this.tail = this.tail.next = new VarintOp((e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5, e)).len, this; + }, Writer.prototype.int32 = function (e) { + return e < 0 ? this._push(writeVarint64, 10, LongBits$1.fromNumber(e)) : this.uint32(e); + }, Writer.prototype.sint32 = function (e) { + return this.uint32((e << 1 ^ e >> 31) >>> 0); + }, Writer.prototype.uint64 = function (e) { + var t = LongBits$1.from(e);return this._push(writeVarint64, t.length(), t); + }, Writer.prototype.int64 = Writer.prototype.uint64, Writer.prototype.sint64 = function (e) { + var t = LongBits$1.from(e).zzEncode();return this._push(writeVarint64, t.length(), t); + }, Writer.prototype.bool = function (e) { + return this._push(writeByte, 1, e ? 1 : 0); + }, Writer.prototype.fixed32 = function (e) { + return this._push(writeFixed32, 4, e >>> 0); + }, Writer.prototype.sfixed32 = Writer.prototype.fixed32, Writer.prototype.fixed64 = function (e) { + var t = LongBits$1.from(e);return this._push(writeFixed32, 4, t.lo)._push(writeFixed32, 4, t.hi); + }, Writer.prototype.sfixed64 = Writer.prototype.fixed64, Writer.prototype.float = function (e) { + return this._push(minimal.float.writeFloatLE, 4, e); + }, Writer.prototype.double = function (e) { + return this._push(minimal.float.writeDoubleLE, 8, e); + };var writeBytes = minimal.Array.prototype.set ? function (e, t, a) { + t.set(e, a); + } : function (e, t, a) { + for (var r = 0; r < e.length; ++r) t[a + r] = e[r]; + };Writer.prototype.bytes = function (e) { + var t = e.length >>> 0;if (!t) return this._push(writeByte, 1, 0);if (minimal.isString(e)) { + var a = Writer.alloc(t = base64.length(e));base64.decode(e, a, 0), e = a; + }return this.uint32(t)._push(writeBytes, t, e); + }, Writer.prototype.string = function (e) { + var t = utf8.length(e);return t ? this.uint32(t)._push(utf8.write, t, e) : this._push(writeByte, 1, 0); + }, Writer.prototype.fork = function () { + return this.states = new State(this), this.head = this.tail = new Op(noop, 0, 0), this.len = 0, this; + }, Writer.prototype.reset = function () { + return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new Op(noop, 0, 0), this.len = 0), this; + }, Writer.prototype.ldelim = function () { + var e = this.head, + t = this.tail, + a = this.len;return this.reset().uint32(a), a && (this.tail.next = e.next, this.tail = t, this.len += a), this; + }, Writer.prototype.finish = function () { + for (var e = this.head.next, t = this.constructor.alloc(this.len), a = 0; e;) e.fn(e.val, t, a), a += e.len, e = e.next;return t; + }, Writer._configure = function (e) { + BufferWriter = e; + };var writer_buffer = BufferWriter$1;(BufferWriter$1.prototype = Object.create(writer.prototype)).constructor = BufferWriter$1;var Buffer$1 = minimal.Buffer;function BufferWriter$1() { + writer.call(this); + }BufferWriter$1.alloc = function (e) { + return (BufferWriter$1.alloc = minimal._Buffer_allocUnsafe)(e); + };var writeBytesBuffer = Buffer$1 && Buffer$1.prototype instanceof Uint8Array && "set" === Buffer$1.prototype.set.name ? function (e, t, a) { + t.set(e, a); + } : function (e, t, a) { + if (e.copy) e.copy(t, a, 0, e.length);else for (var r = 0; r < e.length;) t[a++] = e[r++]; + };function writeStringBuffer(e, t, a) { + e.length < 40 ? minimal.utf8.write(e, t, a) : t.utf8Write(e, a); + }BufferWriter$1.prototype.bytes = function (e) { + minimal.isString(e) && (e = minimal._Buffer_from(e, "base64"));var t = e.length >>> 0;return this.uint32(t), t && this._push(writeBytesBuffer, t, e), this; + }, BufferWriter$1.prototype.string = function (e) { + var t = Buffer$1.byteLength(e);return this.uint32(t), t && this._push(writeStringBuffer, t, e), this; + };var reader = Reader, + BufferReader, + LongBits$2 = minimal.LongBits, + utf8$1 = minimal.utf8;function indexOutOfRange(e, t) { + return RangeError("index out of range: " + e.pos + " + " + (t || 1) + " > " + e.len); + }function Reader(e) { + this.buf = e, this.pos = 0, this.len = e.length; + }var create_array = "undefined" != typeof Uint8Array ? function (e) { + if (e instanceof Uint8Array || Array.isArray(e)) return new Reader(e);throw Error("illegal buffer"); + } : function (e) { + if (Array.isArray(e)) return new Reader(e);throw Error("illegal buffer"); + };function readLongVarint() { + var e = new LongBits$2(0, 0), + t = 0;if (!(this.len - this.pos > 4)) { + for (; t < 3; ++t) { + if (this.pos >= this.len) throw indexOutOfRange(this);if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 7 * t) >>> 0, this.buf[this.pos++] < 128) return e; + }return e.lo = (e.lo | (127 & this.buf[this.pos++]) << 7 * t) >>> 0, e; + }for (; t < 4; ++t) if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 7 * t) >>> 0, this.buf[this.pos++] < 128) return e;if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 28) >>> 0, e.hi = (e.hi | (127 & this.buf[this.pos]) >> 4) >>> 0, this.buf[this.pos++] < 128) return e;if (t = 0, this.len - this.pos > 4) { + for (; t < 5; ++t) if (e.hi = (e.hi | (127 & this.buf[this.pos]) << 7 * t + 3) >>> 0, this.buf[this.pos++] < 128) return e; + } else for (; t < 5; ++t) { + if (this.pos >= this.len) throw indexOutOfRange(this);if (e.hi = (e.hi | (127 & this.buf[this.pos]) << 7 * t + 3) >>> 0, this.buf[this.pos++] < 128) return e; + }throw Error("invalid varint encoding"); + }function readFixed32_end(e, t) { + return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0; + }function readFixed64() { + if (this.pos + 8 > this.len) throw indexOutOfRange(this, 8);return new LongBits$2(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); + }Reader.create = minimal.Buffer ? function (e) { + return (Reader.create = function (e) { + return minimal.Buffer.isBuffer(e) ? new BufferReader(e) : create_array(e); + })(e); + } : create_array, Reader.prototype._slice = minimal.Array.prototype.subarray || minimal.Array.prototype.slice, Reader.prototype.uint32 = function () { + var e = 4294967295;return function () { + if (e = (127 & this.buf[this.pos]) >>> 0, this.buf[this.pos++] < 128) return e;if (e = (e | (127 & this.buf[this.pos]) << 7) >>> 0, this.buf[this.pos++] < 128) return e;if (e = (e | (127 & this.buf[this.pos]) << 14) >>> 0, this.buf[this.pos++] < 128) return e;if (e = (e | (127 & this.buf[this.pos]) << 21) >>> 0, this.buf[this.pos++] < 128) return e;if (e = (e | (15 & this.buf[this.pos]) << 28) >>> 0, this.buf[this.pos++] < 128) return e;if ((this.pos += 5) > this.len) throw this.pos = this.len, indexOutOfRange(this, 10);return e; + }; + }(), Reader.prototype.int32 = function () { + return 0 | this.uint32(); + }, Reader.prototype.sint32 = function () { + var e = this.uint32();return e >>> 1 ^ -(1 & e) | 0; + }, Reader.prototype.bool = function () { + return 0 !== this.uint32(); + }, Reader.prototype.fixed32 = function () { + if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4);return readFixed32_end(this.buf, this.pos += 4); + }, Reader.prototype.sfixed32 = function () { + if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4);return 0 | readFixed32_end(this.buf, this.pos += 4); + }, Reader.prototype.float = function () { + if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4);var e = minimal.float.readFloatLE(this.buf, this.pos);return this.pos += 4, e; + }, Reader.prototype.double = function () { + if (this.pos + 8 > this.len) throw indexOutOfRange(this, 4);var e = minimal.float.readDoubleLE(this.buf, this.pos);return this.pos += 8, e; + }, Reader.prototype.bytes = function () { + var e = this.uint32(), + t = this.pos, + a = this.pos + e;if (a > this.len) throw indexOutOfRange(this, e);return this.pos += e, Array.isArray(this.buf) ? this.buf.slice(t, a) : t === a ? new this.buf.constructor(0) : this._slice.call(this.buf, t, a); + }, Reader.prototype.string = function () { + var e = this.bytes();return utf8$1.read(e, 0, e.length); + }, Reader.prototype.skip = function (e) { + if ("number" == typeof e) { + if (this.pos + e > this.len) throw indexOutOfRange(this, e);this.pos += e; + } else do { + if (this.pos >= this.len) throw indexOutOfRange(this); + } while (128 & this.buf[this.pos++]);return this; + }, Reader.prototype.skipType = function (e) { + switch (e) {case 0: + this.skip();break;case 1: + this.skip(8);break;case 2: + this.skip(this.uint32());break;case 3: + for (;;) { + if (4 == (e = 7 & this.uint32())) break;this.skipType(e); + }break;case 5: + this.skip(4);break;default: + throw Error("invalid wire type " + e + " at offset " + this.pos);}return this; + }, Reader._configure = function (e) { + BufferReader = e;var t = minimal.Long ? "toLong" : "toNumber";minimal.merge(Reader.prototype, { int64: function () { + return readLongVarint.call(this)[t](!1); + }, uint64: function () { + return readLongVarint.call(this)[t](!0); + }, sint64: function () { + return readLongVarint.call(this).zzDecode()[t](!1); + }, fixed64: function () { + return readFixed64.call(this)[t](!0); + }, sfixed64: function () { + return readFixed64.call(this)[t](!1); + } }); + };var reader_buffer = BufferReader$1;function BufferReader$1(e) { + reader.call(this, e); + }(BufferReader$1.prototype = Object.create(reader.prototype)).constructor = BufferReader$1, minimal.Buffer && (BufferReader$1.prototype._slice = minimal.Buffer.prototype.slice), BufferReader$1.prototype.string = function () { + var e = this.uint32();return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + e, this.len)); + };var service = Service;function Service(e, t, a) { + if ("function" != typeof e) throw TypeError("rpcImpl must be a function");minimal.EventEmitter.call(this), this.rpcImpl = e, this.requestDelimited = Boolean(t), this.responseDelimited = Boolean(a); + }(Service.prototype = Object.create(minimal.EventEmitter.prototype)).constructor = Service, Service.prototype.rpcCall = function e(t, a, r, n, o) { + if (!n) throw TypeError("request must be specified");var s = this;if (!o) return minimal.asPromise(e, s, t, a, r, n);if (s.rpcImpl) try { + return s.rpcImpl(t, a[s.requestDelimited ? "encodeDelimited" : "encode"](n).finish(), function (e, a) { + if (e) return s.emit("error", e, t), o(e);if (null !== a) { + if (!(a instanceof r)) try { + a = r[s.responseDelimited ? "decodeDelimited" : "decode"](a); + } catch (e) { + return s.emit("error", e, t), o(e); + }return s.emit("data", a, t), o(null, a); + }s.end(!0); + }); + } catch (e) { + return s.emit("error", e, t), void setTimeout(function () { + o(e); + }, 0); + } else setTimeout(function () { + o(Error("already ended")); + }, 0); + }, Service.prototype.end = function (e) { + return this.rpcImpl && (e || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this; + };var rpc_1 = createCommonjsModule$1(function (e, t) { + t.Service = service; + }), + roots = {}, + indexMinimal = createCommonjsModule$1(function (e, t) { + var a = t;function r() { + a.Reader._configure(a.BufferReader), a.util._configure(); + }a.build = "minimal", a.Writer = writer, a.BufferWriter = writer_buffer, a.Reader = reader, a.BufferReader = reader_buffer, a.util = minimal, a.rpc = rpc_1, a.roots = roots, a.configure = r, a.Writer._configure(a.BufferWriter), r(); + }), + minimal$1 = indexMinimal, + minimal_1 = minimal$1.roots, + minimal_2 = minimal$1.Reader, + minimal_3 = minimal$1.util, + $Reader = minimal$1.Reader, + $util = minimal$1.util, + $root = minimal$1.roots.default || (minimal$1.roots.default = {});$root.tensorflow = function () { + var e, + t, + a = {};return a.Any = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.typeUrl = "", e.prototype.value = $util.newBuffer([]), e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.Any(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.typeUrl = e.string();break;case 2: + r.value = e.bytes();break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), a.DataType = (e = {}, (t = Object.create(e))[e[0] = "DT_INVALID"] = 0, t[e[1] = "DT_FLOAT"] = 1, t[e[2] = "DT_DOUBLE"] = 2, t[e[3] = "DT_INT32"] = 3, t[e[4] = "DT_UINT8"] = 4, t[e[5] = "DT_INT16"] = 5, t[e[6] = "DT_INT8"] = 6, t[e[7] = "DT_STRING"] = 7, t[e[8] = "DT_COMPLEX64"] = 8, t[e[9] = "DT_INT64"] = 9, t[e[10] = "DT_BOOL"] = 10, t[e[11] = "DT_QINT8"] = 11, t[e[12] = "DT_QUINT8"] = 12, t[e[13] = "DT_QINT32"] = 13, t[e[14] = "DT_BFLOAT16"] = 14, t[e[101] = "DT_FLOAT_REF"] = 101, t[e[102] = "DT_DOUBLE_REF"] = 102, t[e[103] = "DT_INT32_REF"] = 103, t[e[104] = "DT_UINT8_REF"] = 104, t[e[105] = "DT_INT16_REF"] = 105, t[e[106] = "DT_INT8_REF"] = 106, t[e[107] = "DT_STRING_REF"] = 107, t[e[108] = "DT_COMPLEX64_REF"] = 108, t[e[109] = "DT_INT64_REF"] = 109, t[e[110] = "DT_BOOL_REF"] = 110, t[e[111] = "DT_QINT8_REF"] = 111, t[e[112] = "DT_QUINT8_REF"] = 112, t[e[113] = "DT_QINT32_REF"] = 113, t[e[114] = "DT_BFLOAT16_REF"] = 114, t), a.TensorShape = function () { + function e(e) { + if (this.dim = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.dim = $util.emptyArray, e.prototype.unknownRank = !1, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.TensorShape(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 2: + r.dim && r.dim.length || (r.dim = []), r.dim.push($root.tensorflow.TensorShape.Dim.decode(e, e.uint32()));break;case 3: + r.unknownRank = e.bool();break;default: + e.skipType(7 & n);} + }return r; + }, e.Dim = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.size = $util.Long ? $util.Long.fromBits(0, 0, !1) : 0, e.prototype.name = "", e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.TensorShape.Dim(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.size = e.int64();break;case 2: + r.name = e.string();break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e; + }(), a.Tensor = function () { + function e(e) { + if (this.floatVal = [], this.doubleVal = [], this.intVal = [], this.stringVal = [], this.scomplexVal = [], this.int64Val = [], this.boolVal = [], this.uint32Val = [], this.uint64Val = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.dtype = 0, e.prototype.tensorShape = null, e.prototype.versionNumber = 0, e.prototype.tensorContent = $util.newBuffer([]), e.prototype.floatVal = $util.emptyArray, e.prototype.doubleVal = $util.emptyArray, e.prototype.intVal = $util.emptyArray, e.prototype.stringVal = $util.emptyArray, e.prototype.scomplexVal = $util.emptyArray, e.prototype.int64Val = $util.emptyArray, e.prototype.boolVal = $util.emptyArray, e.prototype.uint32Val = $util.emptyArray, e.prototype.uint64Val = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.Tensor(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.dtype = e.int32();break;case 2: + r.tensorShape = $root.tensorflow.TensorShape.decode(e, e.uint32());break;case 3: + r.versionNumber = e.int32();break;case 4: + r.tensorContent = e.bytes();break;case 5: + if (r.floatVal && r.floatVal.length || (r.floatVal = []), 2 == (7 & n)) for (var o = e.uint32() + e.pos; e.pos < o;) r.floatVal.push(e.float());else r.floatVal.push(e.float());break;case 6: + if (r.doubleVal && r.doubleVal.length || (r.doubleVal = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.doubleVal.push(e.double());else r.doubleVal.push(e.double());break;case 7: + if (r.intVal && r.intVal.length || (r.intVal = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.intVal.push(e.int32());else r.intVal.push(e.int32());break;case 8: + r.stringVal && r.stringVal.length || (r.stringVal = []), r.stringVal.push(e.bytes());break;case 9: + if (r.scomplexVal && r.scomplexVal.length || (r.scomplexVal = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.scomplexVal.push(e.float());else r.scomplexVal.push(e.float());break;case 10: + if (r.int64Val && r.int64Val.length || (r.int64Val = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.int64Val.push(e.int64());else r.int64Val.push(e.int64());break;case 11: + if (r.boolVal && r.boolVal.length || (r.boolVal = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.boolVal.push(e.bool());else r.boolVal.push(e.bool());break;case 16: + if (r.uint32Val && r.uint32Val.length || (r.uint32Val = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.uint32Val.push(e.uint32());else r.uint32Val.push(e.uint32());break;case 17: + if (r.uint64Val && r.uint64Val.length || (r.uint64Val = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.uint64Val.push(e.uint64());else r.uint64Val.push(e.uint64());break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), a.AttrValue = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }var t;return e.prototype.list = null, e.prototype.s = $util.newBuffer([]), e.prototype.i = $util.Long ? $util.Long.fromBits(0, 0, !1) : 0, e.prototype.f = 0, e.prototype.b = !1, e.prototype.type = 0, e.prototype.shape = null, e.prototype.tensor = null, e.prototype.placeholder = "", e.prototype.func = null, Object.defineProperty(e.prototype, "value", { get: $util.oneOfGetter(t = ["list", "s", "i", "f", "b", "type", "shape", "tensor", "placeholder", "func"]), set: $util.oneOfSetter(t) }), e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.AttrValue(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.list = $root.tensorflow.AttrValue.ListValue.decode(e, e.uint32());break;case 2: + r.s = e.bytes();break;case 3: + r.i = e.int64();break;case 4: + r.f = e.float();break;case 5: + r.b = e.bool();break;case 6: + r.type = e.int32();break;case 7: + r.shape = $root.tensorflow.TensorShape.decode(e, e.uint32());break;case 8: + r.tensor = $root.tensorflow.Tensor.decode(e, e.uint32());break;case 9: + r.placeholder = e.string();break;case 10: + r.func = $root.tensorflow.NameAttrList.decode(e, e.uint32());break;default: + e.skipType(7 & n);} + }return r; + }, e.ListValue = function () { + function e(e) { + if (this.s = [], this.i = [], this.f = [], this.b = [], this.type = [], this.shape = [], this.tensor = [], this.func = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.s = $util.emptyArray, e.prototype.i = $util.emptyArray, e.prototype.f = $util.emptyArray, e.prototype.b = $util.emptyArray, e.prototype.type = $util.emptyArray, e.prototype.shape = $util.emptyArray, e.prototype.tensor = $util.emptyArray, e.prototype.func = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.AttrValue.ListValue(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 2: + r.s && r.s.length || (r.s = []), r.s.push(e.bytes());break;case 3: + if (r.i && r.i.length || (r.i = []), 2 == (7 & n)) for (var o = e.uint32() + e.pos; e.pos < o;) r.i.push(e.int64());else r.i.push(e.int64());break;case 4: + if (r.f && r.f.length || (r.f = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.f.push(e.float());else r.f.push(e.float());break;case 5: + if (r.b && r.b.length || (r.b = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.b.push(e.bool());else r.b.push(e.bool());break;case 6: + if (r.type && r.type.length || (r.type = []), 2 == (7 & n)) for (o = e.uint32() + e.pos; e.pos < o;) r.type.push(e.int32());else r.type.push(e.int32());break;case 7: + r.shape && r.shape.length || (r.shape = []), r.shape.push($root.tensorflow.TensorShape.decode(e, e.uint32()));break;case 8: + r.tensor && r.tensor.length || (r.tensor = []), r.tensor.push($root.tensorflow.Tensor.decode(e, e.uint32()));break;case 9: + r.func && r.func.length || (r.func = []), r.func.push($root.tensorflow.NameAttrList.decode(e, e.uint32()));break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e; + }(), a.NameAttrList = function () { + function e(e) { + if (this.attr = {}, e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.name = "", e.prototype.attr = $util.emptyObject, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a, r = void 0 === t ? e.len : e.pos + t, n = new $root.tensorflow.NameAttrList(); e.pos < r;) { + var o = e.uint32();switch (o >>> 3) {case 1: + n.name = e.string();break;case 2: + e.skip().pos++, n.attr === $util.emptyObject && (n.attr = {}), a = e.string(), e.pos++, n.attr[a] = $root.tensorflow.AttrValue.decode(e, e.uint32());break;default: + e.skipType(7 & o);} + }return n; + }, e; + }(), a.NodeDef = function () { + function e(e) { + if (this.input = [], this.attr = {}, e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.name = "", e.prototype.op = "", e.prototype.input = $util.emptyArray, e.prototype.device = "", e.prototype.attr = $util.emptyObject, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a, r = void 0 === t ? e.len : e.pos + t, n = new $root.tensorflow.NodeDef(); e.pos < r;) { + var o = e.uint32();switch (o >>> 3) {case 1: + n.name = e.string();break;case 2: + n.op = e.string();break;case 3: + n.input && n.input.length || (n.input = []), n.input.push(e.string());break;case 4: + n.device = e.string();break;case 5: + e.skip().pos++, n.attr === $util.emptyObject && (n.attr = {}), a = e.string(), e.pos++, n.attr[a] = $root.tensorflow.AttrValue.decode(e, e.uint32());break;default: + e.skipType(7 & o);} + }return n; + }, e; + }(), a.VersionDef = function () { + function e(e) { + if (this.badConsumers = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.producer = 0, e.prototype.minConsumer = 0, e.prototype.badConsumers = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.VersionDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.producer = e.int32();break;case 2: + r.minConsumer = e.int32();break;case 3: + if (r.badConsumers && r.badConsumers.length || (r.badConsumers = []), 2 == (7 & n)) for (var o = e.uint32() + e.pos; e.pos < o;) r.badConsumers.push(e.int32());else r.badConsumers.push(e.int32());break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), a.GraphDef = function () { + function e(e) { + if (this.node = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.node = $util.emptyArray, e.prototype.versions = null, e.prototype.library = null, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.GraphDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.node && r.node.length || (r.node = []), r.node.push($root.tensorflow.NodeDef.decode(e, e.uint32()));break;case 4: + r.versions = $root.tensorflow.VersionDef.decode(e, e.uint32());break;case 2: + r.library = $root.tensorflow.FunctionDefLibrary.decode(e, e.uint32());break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), a.CollectionDef = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }var t;return e.prototype.nodeList = null, e.prototype.bytesList = null, e.prototype.int64List = null, e.prototype.floatList = null, e.prototype.anyList = null, Object.defineProperty(e.prototype, "kind", { get: $util.oneOfGetter(t = ["nodeList", "bytesList", "int64List", "floatList", "anyList"]), set: $util.oneOfSetter(t) }), e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.CollectionDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.nodeList = $root.tensorflow.CollectionDef.NodeList.decode(e, e.uint32());break;case 2: + r.bytesList = $root.tensorflow.CollectionDef.BytesList.decode(e, e.uint32());break;case 3: + r.int64List = $root.tensorflow.CollectionDef.Int64List.decode(e, e.uint32());break;case 4: + r.floatList = $root.tensorflow.CollectionDef.FloatList.decode(e, e.uint32());break;case 5: + r.anyList = $root.tensorflow.CollectionDef.AnyList.decode(e, e.uint32());break;default: + e.skipType(7 & n);} + }return r; + }, e.NodeList = function () { + function e(e) { + if (this.value = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.value = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.CollectionDef.NodeList(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.value && r.value.length || (r.value = []), r.value.push(e.string());break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e.BytesList = function () { + function e(e) { + if (this.value = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.value = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.CollectionDef.BytesList(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.value && r.value.length || (r.value = []), r.value.push(e.bytes());break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e.Int64List = function () { + function e(e) { + if (this.value = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.value = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.CollectionDef.Int64List(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + if (r.value && r.value.length || (r.value = []), 2 == (7 & n)) for (var o = e.uint32() + e.pos; e.pos < o;) r.value.push(e.int64());else r.value.push(e.int64());break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e.FloatList = function () { + function e(e) { + if (this.value = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.value = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.CollectionDef.FloatList(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + if (r.value && r.value.length || (r.value = []), 2 == (7 & n)) for (var o = e.uint32() + e.pos; e.pos < o;) r.value.push(e.float());else r.value.push(e.float());break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e.AnyList = function () { + function e(e) { + if (this.value = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.value = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.CollectionDef.AnyList(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.value && r.value.length || (r.value = []), r.value.push($root.tensorflow.Any.decode(e, e.uint32()));break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e; + }(), a.SaverDef = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }var t, a;return e.prototype.filenameTensorName = "", e.prototype.saveTensorName = "", e.prototype.restoreOpName = "", e.prototype.maxToKeep = 0, e.prototype.sharded = !1, e.prototype.keepCheckpointEveryNHours = 0, e.prototype.version = 0, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.SaverDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.filenameTensorName = e.string();break;case 2: + r.saveTensorName = e.string();break;case 3: + r.restoreOpName = e.string();break;case 4: + r.maxToKeep = e.int32();break;case 5: + r.sharded = e.bool();break;case 6: + r.keepCheckpointEveryNHours = e.float();break;case 7: + r.version = e.int32();break;default: + e.skipType(7 & n);} + }return r; + }, e.CheckpointFormatVersion = (t = {}, (a = Object.create(t))[t[0] = "LEGACY"] = 0, a[t[1] = "V1"] = 1, a[t[2] = "V2"] = 2, a), e; + }(), a.TensorInfo = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }var t;return e.prototype.name = "", e.prototype.cooSparse = null, e.prototype.dtype = 0, e.prototype.tensorShape = null, Object.defineProperty(e.prototype, "encoding", { get: $util.oneOfGetter(t = ["name", "cooSparse"]), set: $util.oneOfSetter(t) }), e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.TensorInfo(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.name = e.string();break;case 4: + r.cooSparse = $root.tensorflow.TensorInfo.CooSparse.decode(e, e.uint32());break;case 2: + r.dtype = e.int32();break;case 3: + r.tensorShape = $root.tensorflow.TensorShape.decode(e, e.uint32());break;default: + e.skipType(7 & n);} + }return r; + }, e.CooSparse = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.valuesTensorName = "", e.prototype.indicesTensorName = "", e.prototype.denseShapeTensorName = "", e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.TensorInfo.CooSparse(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.valuesTensorName = e.string();break;case 2: + r.indicesTensorName = e.string();break;case 3: + r.denseShapeTensorName = e.string();break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e; + }(), a.SignatureDef = function () { + function e(e) { + if (this.inputs = {}, this.outputs = {}, e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.inputs = $util.emptyObject, e.prototype.outputs = $util.emptyObject, e.prototype.methodName = "", e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a, r = void 0 === t ? e.len : e.pos + t, n = new $root.tensorflow.SignatureDef(); e.pos < r;) { + var o = e.uint32();switch (o >>> 3) {case 1: + e.skip().pos++, n.inputs === $util.emptyObject && (n.inputs = {}), a = e.string(), e.pos++, n.inputs[a] = $root.tensorflow.TensorInfo.decode(e, e.uint32());break;case 2: + e.skip().pos++, n.outputs === $util.emptyObject && (n.outputs = {}), a = e.string(), e.pos++, n.outputs[a] = $root.tensorflow.TensorInfo.decode(e, e.uint32());break;case 3: + n.methodName = e.string();break;default: + e.skipType(7 & o);} + }return n; + }, e; + }(), a.AssetFileDef = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.tensorInfo = null, e.prototype.filename = "", e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.AssetFileDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.tensorInfo = $root.tensorflow.TensorInfo.decode(e, e.uint32());break;case 2: + r.filename = e.string();break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), a.OpDef = function () { + function e(e) { + if (this.inputArg = [], this.outputArg = [], this.attr = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.name = "", e.prototype.inputArg = $util.emptyArray, e.prototype.outputArg = $util.emptyArray, e.prototype.attr = $util.emptyArray, e.prototype.deprecation = null, e.prototype.summary = "", e.prototype.description = "", e.prototype.isCommutative = !1, e.prototype.isAggregate = !1, e.prototype.isStateful = !1, e.prototype.allowsUninitializedInput = !1, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.OpDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.name = e.string();break;case 2: + r.inputArg && r.inputArg.length || (r.inputArg = []), r.inputArg.push($root.tensorflow.OpDef.ArgDef.decode(e, e.uint32()));break;case 3: + r.outputArg && r.outputArg.length || (r.outputArg = []), r.outputArg.push($root.tensorflow.OpDef.ArgDef.decode(e, e.uint32()));break;case 4: + r.attr && r.attr.length || (r.attr = []), r.attr.push($root.tensorflow.OpDef.AttrDef.decode(e, e.uint32()));break;case 8: + r.deprecation = $root.tensorflow.OpDef.OpDeprecation.decode(e, e.uint32());break;case 5: + r.summary = e.string();break;case 6: + r.description = e.string();break;case 18: + r.isCommutative = e.bool();break;case 16: + r.isAggregate = e.bool();break;case 17: + r.isStateful = e.bool();break;case 19: + r.allowsUninitializedInput = e.bool();break;default: + e.skipType(7 & n);} + }return r; + }, e.ArgDef = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.name = "", e.prototype.description = "", e.prototype.type = 0, e.prototype.typeAttr = "", e.prototype.numberAttr = "", e.prototype.typeListAttr = "", e.prototype.isRef = !1, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.OpDef.ArgDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.name = e.string();break;case 2: + r.description = e.string();break;case 3: + r.type = e.int32();break;case 4: + r.typeAttr = e.string();break;case 5: + r.numberAttr = e.string();break;case 6: + r.typeListAttr = e.string();break;case 16: + r.isRef = e.bool();break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e.AttrDef = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.name = "", e.prototype.type = "", e.prototype.defaultValue = null, e.prototype.description = "", e.prototype.hasMinimum = !1, e.prototype.minimum = $util.Long ? $util.Long.fromBits(0, 0, !1) : 0, e.prototype.allowedValues = null, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.OpDef.AttrDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.name = e.string();break;case 2: + r.type = e.string();break;case 3: + r.defaultValue = $root.tensorflow.AttrValue.decode(e, e.uint32());break;case 4: + r.description = e.string();break;case 5: + r.hasMinimum = e.bool();break;case 6: + r.minimum = e.int64();break;case 7: + r.allowedValues = $root.tensorflow.AttrValue.decode(e, e.uint32());break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e.OpDeprecation = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.version = 0, e.prototype.explanation = "", e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.OpDef.OpDeprecation(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.version = e.int32();break;case 2: + r.explanation = e.string();break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e; + }(), a.OpList = function () { + function e(e) { + if (this.op = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.op = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.OpList(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.op && r.op.length || (r.op = []), r.op.push($root.tensorflow.OpDef.decode(e, e.uint32()));break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), a.MetaGraphDef = function () { + function e(e) { + if (this.collectionDef = {}, this.signatureDef = {}, this.assetFileDef = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.metaInfoDef = null, e.prototype.graphDef = null, e.prototype.saverDef = null, e.prototype.collectionDef = $util.emptyObject, e.prototype.signatureDef = $util.emptyObject, e.prototype.assetFileDef = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a, r = void 0 === t ? e.len : e.pos + t, n = new $root.tensorflow.MetaGraphDef(); e.pos < r;) { + var o = e.uint32();switch (o >>> 3) {case 1: + n.metaInfoDef = $root.tensorflow.MetaGraphDef.MetaInfoDef.decode(e, e.uint32());break;case 2: + n.graphDef = $root.tensorflow.GraphDef.decode(e, e.uint32());break;case 3: + n.saverDef = $root.tensorflow.SaverDef.decode(e, e.uint32());break;case 4: + e.skip().pos++, n.collectionDef === $util.emptyObject && (n.collectionDef = {}), a = e.string(), e.pos++, n.collectionDef[a] = $root.tensorflow.CollectionDef.decode(e, e.uint32());break;case 5: + e.skip().pos++, n.signatureDef === $util.emptyObject && (n.signatureDef = {}), a = e.string(), e.pos++, n.signatureDef[a] = $root.tensorflow.SignatureDef.decode(e, e.uint32());break;case 6: + n.assetFileDef && n.assetFileDef.length || (n.assetFileDef = []), n.assetFileDef.push($root.tensorflow.AssetFileDef.decode(e, e.uint32()));break;default: + e.skipType(7 & o);} + }return n; + }, e.MetaInfoDef = function () { + function e(e) { + if (this.tags = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.metaGraphVersion = "", e.prototype.strippedOpList = null, e.prototype.anyInfo = null, e.prototype.tags = $util.emptyArray, e.prototype.tensorflowVersion = "", e.prototype.tensorflowGitVersion = "", e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.MetaGraphDef.MetaInfoDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.metaGraphVersion = e.string();break;case 2: + r.strippedOpList = $root.tensorflow.OpList.decode(e, e.uint32());break;case 3: + r.anyInfo = $root.tensorflow.Any.decode(e, e.uint32());break;case 4: + r.tags && r.tags.length || (r.tags = []), r.tags.push(e.string());break;case 5: + r.tensorflowVersion = e.string();break;case 6: + r.tensorflowGitVersion = e.string();break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), e; + }(), a.SavedModel = function () { + function e(e) { + if (this.metaGraphs = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.savedModelSchemaVersion = $util.Long ? $util.Long.fromBits(0, 0, !1) : 0, e.prototype.metaGraphs = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.SavedModel(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.savedModelSchemaVersion = e.int64();break;case 2: + r.metaGraphs && r.metaGraphs.length || (r.metaGraphs = []), r.metaGraphs.push($root.tensorflow.MetaGraphDef.decode(e, e.uint32()));break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), a.FunctionDefLibrary = function () { + function e(e) { + if (this.function = [], this.gradient = [], e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.function = $util.emptyArray, e.prototype.gradient = $util.emptyArray, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.FunctionDefLibrary(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.function && r.function.length || (r.function = []), r.function.push($root.tensorflow.FunctionDef.decode(e, e.uint32()));break;case 2: + r.gradient && r.gradient.length || (r.gradient = []), r.gradient.push($root.tensorflow.GradientDef.decode(e, e.uint32()));break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), a.FunctionDef = function () { + function e(e) { + if (this.attr = {}, this.nodeDef = [], this.ret = {}, e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.signature = null, e.prototype.attr = $util.emptyObject, e.prototype.nodeDef = $util.emptyArray, e.prototype.ret = $util.emptyObject, e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a, r = void 0 === t ? e.len : e.pos + t, n = new $root.tensorflow.FunctionDef(); e.pos < r;) { + var o = e.uint32();switch (o >>> 3) {case 1: + n.signature = $root.tensorflow.OpDef.decode(e, e.uint32());break;case 5: + e.skip().pos++, n.attr === $util.emptyObject && (n.attr = {}), a = e.string(), e.pos++, n.attr[a] = $root.tensorflow.AttrValue.decode(e, e.uint32());break;case 3: + n.nodeDef && n.nodeDef.length || (n.nodeDef = []), n.nodeDef.push($root.tensorflow.NodeDef.decode(e, e.uint32()));break;case 4: + e.skip().pos++, n.ret === $util.emptyObject && (n.ret = {}), a = e.string(), e.pos++, n.ret[a] = e.string();break;default: + e.skipType(7 & o);} + }return n; + }, e; + }(), a.GradientDef = function () { + function e(e) { + if (e) for (var t = Object.keys(e), a = 0; a < t.length; ++a) null != e[t[a]] && (this[t[a]] = e[t[a]]); + }return e.prototype.functionName = "", e.prototype.gradientFunc = "", e.decode = function (e, t) { + e instanceof $Reader || (e = $Reader.create(e));for (var a = void 0 === t ? e.len : e.pos + t, r = new $root.tensorflow.GradientDef(); e.pos < a;) { + var n = e.uint32();switch (n >>> 3) {case 1: + r.functionName = e.string();break;case 2: + r.gradientFunc = e.string();break;default: + e.skipType(7 & n);} + }return r; + }, e; + }(), a; + }();var compiled_api = $root, + compiled_api_1 = compiled_api.tensorflow;function getParamValue(e, t, a, r) { + var n = t.params[e];if (n && void 0 !== n.inputIndex) { + if ("tensor" === n.type) return getTensor(t.inputNames[n.inputIndex], a, r);if ("tensors" === n.type) return (0 === n.inputIndex ? 0 === n.inputParamLength ? t.inputNames : t.inputNames.slice(n.inputIndex, -n.inputParamLength) : t.inputNames.splice(n.inputIndex)).map(function (e) { + return getTensor(e, a, r); + });var o = Array.prototype.slice.call(getTensor(t.inputNames.slice(n.inputIndex)[0], a, r).dataSync());return "number" === n.type ? o[0] : o; + }return n && n.value; + }function getTensor(e, t, a) { + var r = parseNodeName(e), + n = r[0], + o = r[1], + s = a.currentContextIds.find(function (e) { + return !!t[getNodeNameWithContextId(n, e)]; + });return void 0 !== s ? t[getNodeNameWithContextId(n, s)][o] : void 0; + }function getNodeNameAndIndex(e, t) { + var a = parseNodeName(e), + r = a[0], + n = a[1];return [getNodeNameWithContextId(r, t && t.currentContextId), n]; + }function getNodeNameWithContextId(e, t) { + return t ? e + "-" + t : e; + }function parseNodeName(e) { + var t = e.lastIndexOf(":");return -1 === t ? [e, 0] : [e.substring(0, t), Number(e.substring(t + 1))]; + }function split$1(e, t) { + for (var a = [], r = 0; r < e.length; r += t) a.push(e.slice(r, r + t));return a; + }var arithmetic = [{ tfOpName: "Add", dlOpName: "add", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "BiasAdd", dlOpName: "add", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Sub", dlOpName: "sub", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "RealDiv", dlOpName: "div", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Div", dlOpName: "div", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "FloorDiv", dlOpName: "floorDiv", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Mul", dlOpName: "mul", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Maximum", dlOpName: "maximum", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }] }, { tfOpName: "Minimum", dlOpName: "minimum", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }] }, { tfOpName: "Pow", dlOpName: "pow", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "SquaredDifference", dlOpName: "squaredDifference", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Mod", dlOpName: "mod", category: "arithmetic", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }], + arithmetic$1 = Object.freeze({ default: arithmetic }), + basic_math = [{ tfOpName: "Abs", dlOpName: "abs", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Acos", dlOpName: "acos", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Asin", dlOpName: "asin", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "atan", dlOpName: "atan", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Ceil", dlOpName: "ceil", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "ClipByValue", dlOpName: "clipByValue", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "clip_value_min", dlParamName: "clipValueMin", type: "number" }, { tfParamName: "clip_value_max", dlParamName: "clipValueMax", type: "number" }] }, { tfOpName: "Cos", dlOpName: "cos", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Cosh", dlOpName: "cosh", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Elu", dlOpName: "elu", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Exp", dlOpName: "exp", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Floor", dlOpName: "floor", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Log", dlOpName: "log", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Neg", dlOpName: "neg", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Relu", dlOpName: "relu", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Relu6", dlOpName: "clipByValue", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }, { dlParamName: "clipValueMin", type: "number", defaultValue: 0 }, { dlParamName: "clipValueMax", type: "number", defaultValue: 6 }] }, { tfOpName: "Selu", dlOpName: "selu", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Sigmoid", dlOpName: "sigmoid", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Sin", dlOpName: "sin", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Sinh", dlOpName: "sinh", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Sqrt", dlOpName: "sqrt", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Rsqrt", dlOpName: "rsqrt", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Square", dlOpName: "square", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Tan", dlOpName: "tan", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Tanh", dlOpName: "tanh", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Sign", dlOpName: "sign", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Round", dlOpName: "round", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Expm1", dlOpName: "expm1", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Log1p", dlOpName: "log1p", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Reciprocal", dlOpName: "reciprocal", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Reciprocal", dlOpName: "reciprocal", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Softplus", dlOpName: "softplus", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Asinh", dlOpName: "asinh", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Acosh", dlOpName: "acosh", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Atanh", dlOpName: "atanh", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Erf", dlOpName: "erf", category: "basic_math", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }], + basicMath = Object.freeze({ default: basic_math }), + control = [{ tfOpName: "LoopCond", dlOpName: "loopCond", category: "control", params: [{ tfInputIndex: 0, dlParamName: "pred", type: "tensor" }] }, { tfOpName: "Switch", dlOpName: "switch", category: "control", params: [{ tfInputIndex: 0, dlParamName: "data", type: "tensor" }, { tfInputIndex: 1, dlParamName: "pred", type: "tensor" }] }, { tfOpName: "Merge", dlOpName: "merge", category: "control", params: [{ tfInputIndex: 0, tfInputParamLength: 0, dlParamName: "tensors", type: "tensors" }] }, { tfOpName: "Enter", dlOpName: "enter", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensor", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }, { tfParamName: "frame_name", dlParamName: "frameName", type: "string" }, { tfParamName: "is_constant", dlParamName: "isConstant", type: "bool" }] }, { tfOpName: "Exit", dlOpName: "exit", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensor", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "NextIteration", dlOpName: "nextIteration", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensor", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "TensorArrayV3", dlOpName: "tensorArray", category: "control", params: [{ tfInputIndex: 0, dlParamName: "size", type: "number" }, { tfParamName: "dtype", dlParamName: "dtype", type: "dtype" }, { tfParamName: "element_shape", dlParamName: "elementShape", type: "shape" }, { tfParamName: "dynamic_size", dlParamName: "dynamicSize", type: "bool" }, { tfParamName: "clear_after_read", dlParamName: "clearAfterRead", type: "bool" }, { tfParamName: "identical_element_shapes", dlParamName: "identicalElementShapes", type: "bool" }, { tfParamName: "tensor_array_name", dlParamName: "name", type: "string" }] }, { tfOpName: "TensorArrayWriteV3", dlOpName: "tensorArrayWrite", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensorArrayId", type: "number" }, { tfInputIndex: 1, dlParamName: "index", type: "number" }, { tfInputIndex: 2, dlParamName: "tensor", type: "tensor" }, { tfInputIndex: 3, dlParamName: "flowIn", type: "number" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "TensorArrayReadV3", dlOpName: "tensorArrayRead", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensorArrayId", type: "number" }, { tfInputIndex: 1, dlParamName: "index", type: "number" }, { tfInputIndex: 2, dlParamName: "flowIn", type: "number" }, { tfParamName: "dtype", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "TensorArrayGatherV3", dlOpName: "tensorArrayGather", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensorArrayId", type: "number" }, { tfInputIndex: 1, dlParamName: "indices", type: "number[]" }, { tfInputIndex: 2, dlParamName: "flowIn", type: "number" }, { tfParamName: "dtype", dlParamName: "dtype", type: "dtype" }, { tfParamName: "element_shape", dlParamName: "elementShape", type: "shape" }] }, { tfOpName: "TensorArrayScatterV3", dlOpName: "tensorArrayScatter", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensorArrayId", type: "number" }, { tfInputIndex: 1, dlParamName: "indices", type: "number[]" }, { tfInputIndex: 2, dlParamName: "tensor", type: "number[]" }, { tfInputIndex: 3, dlParamName: "flowIn", type: "number" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype" }] }, { tfOpName: "TensorArrayConcatV3", dlOpName: "tensorArrayConcat", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensorArrayId", type: "number" }, { tfInputIndex: 1, dlParamName: "flowIn", type: "number" }, { tfParamName: "dtype", dlParamName: "dtype", type: "dtype" }, { tfParamName: "element_shape_except0", dlParamName: "elementShapeExcept0", type: "shape", notSupported: !0 }] }, { tfOpName: "TensorArraySplitV3", dlOpName: "tensorArraySplit", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensorArrayId", type: "number" }, { tfInputIndex: 1, dlParamName: "tensor", type: "tensor" }, { tfInputIndex: 2, dlParamName: "lengths", type: "number[]" }, { tfInputIndex: 3, dlParamName: "flowIn", type: "number" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype" }] }, { tfOpName: "TensorArraySizeV3", dlOpName: "tensorArraySize", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensorArrayId", type: "number" }, { tfInputIndex: 1, dlParamName: "flowIn", type: "number" }] }, { tfOpName: "TensorArrayCloseV3", dlOpName: "tensorArrayClose", category: "control", params: [{ tfInputIndex: 0, dlParamName: "tensorArrayId", type: "number" }] }], + control$1 = Object.freeze({ default: control }), + convolution = [{ tfOpName: "AvgPool", dlOpName: "avgPool", category: "convolution", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "strides", dlParamName: "strides", type: "number[]" }, { tfParamName: "padding", dlParamName: "pad", type: "string" }, { tfParamName: "data_format", dlParamName: "dataFormat", type: "string", notSupported: !0 }, { tfParamName: "ksize", dlParamName: "kernelSize", type: "number[]" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "MaxPool", dlOpName: "maxPool", category: "convolution", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "strides", dlParamName: "strides", type: "number[]" }, { tfParamName: "padding", dlParamName: "pad", type: "string" }, { tfParamName: "data_format", dlParamName: "dataFormat", type: "string", notSupported: !0 }, { tfParamName: "ksize", dlParamName: "kernelSize", type: "number[]" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Conv1D", dlOpName: "conv1d", category: "convolution", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "filter", type: "tensor" }, { tfParamName: "stride", dlParamName: "stride", type: "number" }, { tfParamName: "padding", dlParamName: "pad", type: "string" }, { tfParamName: "data_format", dlParamName: "dataFormat", type: "string", defaultValue: "NWC" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }, { tfParamName: "dilation", dlParamName: "dilation", type: "number", defaultValue: 1 }] }, { tfOpName: "Conv2D", dlOpName: "conv2d", category: "convolution", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "filter", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }, { tfParamName: "strides", dlParamName: "strides", type: "number[]" }, { tfParamName: "padding", dlParamName: "pad", type: "string" }, { tfParamName: "useCudnnOnGpu", dlParamName: "useCudnnOnGpu", type: "bool" }, { tfParamName: "data_format", dlParamName: "dataFormat", type: "string", defaultValue: "NHWC" }, { tfParamName: "dilations", dlParamName: "dilations", type: "number[]" }] }, { tfOpName: "Conv2DBackpropInput", dlOpName: "conv2dTranspose", category: "convolution", params: [{ tfInputIndex: 2, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "filter", type: "tensor" }, { tfInputIndex: 0, dlParamName: "outputShape", type: "number[]" }, { tfParamName: "strides", dlParamName: "strides", type: "number[]" }, { tfParamName: "padding", dlParamName: "pad", type: "string" }, { tfParamName: "data_format", dlParamName: "dataFormat", type: "string", notSupported: !0 }] }, { tfOpName: "DepthwiseConv2d", dlOpName: "depthwiseConv2d", category: "convolution", params: [{ tfInputIndex: 0, dlParamName: "input", type: "tensor" }, { tfInputIndex: 1, dlParamName: "filter", type: "tensor" }, { tfParamName: "strides", dlParamName: "strides", type: "number[]" }, { tfParamName: "padding", dlParamName: "pad", type: "string" }, { tfParamName: "data_format", dlParamName: "dataFormat", type: "string", defaultValue: "NHWC" }, { tfParamName: "dilations", dlParamName: "dilations", type: "number[]" }] }, { tfOpName: "DepthwiseConv2dNative", dlOpName: "depthwiseConv2d", category: "convolution", params: [{ tfInputIndex: 0, dlParamName: "input", type: "tensor" }, { tfInputIndex: 1, dlParamName: "filter", type: "tensor" }, { tfParamName: "strides", dlParamName: "strides", type: "number[]" }, { tfParamName: "padding", dlParamName: "pad", type: "string" }, { tfParamName: "data_format", dlParamName: "dataFormat", type: "string", defaultValue: "NHWC" }, { tfParamName: "dilations", dlParamName: "dilations", type: "number[]" }] }], + convolution$1 = Object.freeze({ default: convolution }), + creation = [{ tfOpName: "Fill", dlOpName: "fill", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "shape", type: "number[]" }, { tfInputIndex: 1, dlParamName: "value", type: "number" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "LinSpace", dlOpName: "linspace", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "start", type: "number" }, { tfInputIndex: 1, dlParamName: "stop", type: "number" }, { tfInputIndex: 2, dlParamName: "num", type: "number" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "OneHot", dlOpName: "oneHot", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "indices", type: "tensor" }, { tfInputIndex: 1, dlParamName: "depth", type: "number" }, { tfInputIndex: 2, dlParamName: "onValue", type: "number", defaultValue: 1 }, { tfInputIndex: 3, dlParamName: "offValue", type: "number", defaultValue: 0 }, { tfParamName: "axis", dlParamName: "axis", type: "number", notSupported: !0 }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Ones", dlOpName: "ones", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "shape", type: "number[]" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype" }] }, { tfOpName: "OnesLike", dlOpName: "onesLike", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "dtype", dlParamName: "dtype", type: "dtype" }] }, { tfOpName: "RandomUniform", dlOpName: "randomUniform", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "shape", type: "number[]" }, { tfParamName: "minval", dlParamName: "minval", type: "number", defaultValue: 0 }, { tfParamName: "maxval", dlParamName: "maxval", type: "number", defaultValue: 1 }, { tfParamName: "dtype", dlParamName: "dtype", type: "dtype" }, { tfParamName: "seed", dlParamName: "seed", type: "number", defaultValue: 0 }, { tfParamName: "seed2", dlParamName: "seed2", type: "number", defaultValue: 0, notSupported: !0 }, { tfParamName: "T", dlParamName: "T", type: "number", notSupported: !0 }] }, { tfOpName: "Range", dlOpName: "range", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "start", type: "number" }, { tfInputIndex: 1, dlParamName: "stop", type: "number" }, { tfInputIndex: 2, dlParamName: "step", type: "number", defaultValue: 0 }, { tfParamName: "Tidx", dlParamName: "dtype", type: "dtype" }] }, { tfOpName: "truncatedNormal", dlOpName: "truncatedNormal", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "shape", type: "number[]" }, { tfParamName: "means", dlParamName: "mean", type: "number", defaultValue: 0 }, { tfParamName: "stddev", dlParamName: "stdDev", type: "number", defaultValue: 1 }, { tfParamName: "seed", dlParamName: "seed", type: "number" }, { tfParamName: "seed2", dlParamName: "seed2", type: "number", defaultValue: 0, notSupported: !0 }, { tfParamName: "dtype", dlParamName: "dtype", type: "dtype" }, { tfParamName: "T", dlParamName: "T", type: "number", notSupported: !0 }] }, { tfOpName: "Zeros", dlOpName: "zeros", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "shape", type: "number[]" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype" }] }, { tfOpName: "ZerosLike", dlOpName: "zerosLike", category: "creation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype" }] }], + creation$1 = Object.freeze({ default: creation }), + dynamic = [{ tfOpName: "NonMaxSuppressionV2", dlOpName: "nonMaxSuppression", category: "dynamic", params: [{ tfInputIndex: 0, dlParamName: "boxes", type: "tensor" }, { tfInputIndex: 1, dlParamName: "scores", type: "tensor" }, { tfInputIndex: 2, dlParamName: "maxOutputSize", type: "number" }, { tfInputIndex: 3, dlParamName: "iouThreshold", type: "number" }] }, { tfOpName: "NonMaxSuppressionV3", dlOpName: "nonMaxSuppression", category: "dynamic", params: [{ tfInputIndex: 0, dlParamName: "boxes", type: "tensor" }, { tfInputIndex: 1, dlParamName: "scores", type: "tensor" }, { tfInputIndex: 2, dlParamName: "maxOutputSize", type: "number" }, { tfInputIndex: 3, dlParamName: "iouThreshold", type: "number" }, { tfInputIndex: 4, dlParamName: "scoreThreshold", type: "number" }] }, { tfOpName: "Where", dlOpName: "whereAsync", category: "dynamic", params: [{ tfInputIndex: 0, dlParamName: "condition", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }], + dynamic$1 = Object.freeze({ default: dynamic }), + evaluation = [{ tfOpName: "TopKV2", dlOpName: "topK", category: "evaluation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "k", type: "number" }, { tfParamName: "sorted", dlParamName: "sorted", type: "bool" }] }], + evaluation$1 = Object.freeze({ default: evaluation }), + graph = [{ tfOpName: "PlaceholderWithDefault", dlOpName: "placeholder", category: "graph", params: [{ tfInputIndex: 0, dlParamName: "default", type: "tensor" }, { tfParamName: "shape", dlParamName: "shape", type: "shape" }, { tfParamName: "dtype", dlParamName: "dtype", type: "dtype" }] }, { tfOpName: "Placeholder", dlOpName: "placeholder", category: "graph", params: [{ tfParamName: "shape", dlParamName: "shape", type: "shape" }, { tfParamName: "dtype", dlParamName: "dtype", type: "dtype" }] }, { tfOpName: "Const", dlOpName: "const", category: "graph" }, { tfOpName: "Identity", dlOpName: "identity", category: "graph", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }] }, { tfOpName: "Snapshot", dlOpName: "snapshot", category: "graph", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }] }, { tfOpName: "Rank", dlOpName: "rank", category: "graph", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }] }, { tfOpName: "Size", dlOpName: "size", category: "graph", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }] }, { tfOpName: "Shape", dlOpName: "shape", category: "graph", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }] }, { tfOpName: "Print", dlOpName: "print", category: "graph", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, tfInputParamLength: 1, dlParamName: "data", type: "tensors" }, { tfParamName: "message", dlParamName: "message", type: "string" }, { tfParamName: "first_n", dlParamName: "firstN", type: "number", notSupprted: !0 }, { tfParamName: "summarize", dlParamName: "summarize", type: "number", defaultValue: 3 }] }, { tfOpName: "NoOp", dlOpName: "noop", category: "graph", params: [] }, { tfOpName: "StopGradient", dlOpName: "stopGradient", category: "graph", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }] }, { tfOpName: "FakeQuantWithMinMaxVars", dlOpName: "fakeQuantWithMinMaxVars", category: "graph", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "min", dlParamName: "min", type: "number" }, { tfParamName: "max", dlParamName: "max", type: "number" }] }], + graph$1 = Object.freeze({ default: graph }), + image$1 = [{ tfOpName: "ResizeBilinear", dlOpName: "resizeBilinear", category: "image", params: [{ tfInputIndex: 0, dlParamName: "images", type: "tensor" }, { tfInputIndex: 1, dlParamName: "size", type: "number[]" }, { tfParamName: "align_corners", dlParamName: "alignCorners", type: "bool" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "ResizeNearestNeighbor", dlOpName: "resizeNearestNeighbor", category: "image", params: [{ tfInputIndex: 0, dlParamName: "images", type: "tensor" }, { tfInputIndex: 1, dlParamName: "size", type: "number[]" }, { tfParamName: "align_corners", dlParamName: "alignCorners", type: "bool" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "NonMaxSuppressionV2", dlOpName: "nonMaxSuppression", category: "image", params: [{ tfInputIndex: 0, dlParamName: "boxes", type: "tensor" }, { tfInputIndex: 1, dlParamName: "scores", type: "tensor" }, { tfInputIndex: 2, dlParamName: "maxOutputSize", type: "number" }, { tfInputIndex: 3, dlParamName: "iouThreshold", type: "number" }] }, { tfOpName: "NonMaxSuppressionV3", dlOpName: "nonMaxSuppression", category: "image", params: [{ tfInputIndex: 0, dlParamName: "boxes", type: "tensor" }, { tfInputIndex: 1, dlParamName: "scores", type: "tensor" }, { tfInputIndex: 2, dlParamName: "maxOutputSize", type: "number" }, { tfInputIndex: 3, dlParamName: "iouThreshold", type: "number" }, { tfInputIndex: 4, dlParamName: "scoreThreshold", type: "number" }] }], + image$2 = Object.freeze({ default: image$1 }), + logical = [{ tfOpName: "Equal", dlOpName: "equal", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "NotEqual", dlOpName: "notEqual", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Greater", dlOpName: "greater", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "GreaterEqual", dlOpName: "greaterEqual", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Less", dlOpName: "less", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "LessEqual", dlOpName: "lessEqual", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "LogicalAnd", dlOpName: "logicalAnd", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "LogicalNot", dlOpName: "logicalNot", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "LogicalOr", dlOpName: "logicalOr", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Select", dlOpName: "where", category: "logical", params: [{ tfInputIndex: 0, dlParamName: "condition", type: "tensor" }, { tfInputIndex: 1, dlParamName: "a", type: "tensor" }, { tfInputIndex: 2, dlParamName: "b", type: "tensor" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }], + logical$1 = Object.freeze({ default: logical }), + matrices = [{ tfOpName: "MatMul", dlOpName: "matMul", category: "matrices", params: [{ tfInputIndex: 0, dlParamName: "a", type: "tensor" }, { tfInputIndex: 1, dlParamName: "b", type: "tensor" }, { tfParamName: "transpose_a", dlParamName: "transposeA", type: "bool", defaultValue: !1 }, { tfParamName: "transpose_b", dlParamName: "transposeB", type: "bool", defaultValue: !1 }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }, { tfOpName: "Transpose", dlOpName: "transpose", category: "matrices", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "perm", dlParamName: "perm", type: "number[]" }, { tfParamName: "T", dlParamName: "dtype", type: "dtype", notSupported: !0 }] }], + matrices$1 = Object.freeze({ default: matrices }), + normalization = [{ tfOpName: "FusedBatchNorm", dlOpName: "batchNormalization", category: "normalization", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "scale", type: "tensor" }, { tfInputIndex: 2, dlParamName: "offset", type: "tensor" }, { tfInputIndex: 3, dlParamName: "mean", type: "tensor" }, { tfInputIndex: 4, dlParamName: "variance", type: "tensor" }, { tfParamName: "epsilon", dlParamName: "epsilon", type: "number", defaultValue: .001 }, { tfParamName: "data_format", dlParamName: "dataFormat", type: "string", notSupported: !0 }] }, { tfOpName: "FusedBatchNormV2", dlOpName: "batchNormalization", category: "normalization", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "scale", type: "tensor" }, { tfInputIndex: 2, dlParamName: "offset", type: "tensor" }, { tfInputIndex: 3, dlParamName: "mean", type: "tensor" }, { tfInputIndex: 4, dlParamName: "variance", type: "tensor" }, { tfParamName: "epsilon", dlParamName: "epsilon", type: "number", defaultValue: .001 }, { tfParamName: "data_format", dlParamName: "dataFormat", type: "string", notSupported: !0 }] }, { tfOpName: "LRN", dlOpName: "localResponseNormalization", category: "normalization", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "depth_radius", dlParamName: "radius", type: "number", defaultValue: 5 }, { tfParamName: "bias", dlParamName: "bias", type: "number", defaultValue: 1 }, { tfParamName: "alpha", dlParamName: "alpha", type: "number", defaultValue: 1 }, { tfParamName: "beta", dlParamName: "beta", type: "number", defaultValue: .5 }] }, { tfOpName: "Softmax", dlOpName: "softmax", category: "normalization", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }] }], + normalization$1 = Object.freeze({ default: normalization }), + reduction = [{ tfOpName: "Max", dlOpName: "max", category: "reduction", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number[]" }, { tfParamName: "keep_dims", dlParamName: "keepDims", type: "bool" }] }, { tfOpName: "Mean", dlOpName: "mean", category: "reduction", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number[]" }, { tfParamName: "keep_dims", dlParamName: "keepDims", type: "bool" }] }, { tfOpName: "Min", dlOpName: "min", category: "reduction", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number[]" }, { tfParamName: "keep_dims", dlParamName: "keepDims", type: "bool" }] }, { tfOpName: "Sum", dlOpName: "sum", category: "reduction", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number[]" }, { tfParamName: "keep_dims", dlParamName: "keepDims", type: "bool" }] }, { tfOpName: "All", dlOpName: "all", category: "reduction", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number[]" }, { tfParamName: "keep_dims", dlParamName: "keepDims", type: "bool" }] }, { tfOpName: "Any", dlOpName: "any", category: "reduction", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number[]" }, { tfParamName: "keep_dims", dlParamName: "keepDims", type: "bool" }] }, { tfOpName: "ArgMax", dlOpName: "argMax", category: "reduction", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number" }] }, { tfOpName: "ArgMin", dlOpName: "argMin", category: "reduction", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number" }] }], + reduction$1 = Object.freeze({ default: reduction }), + slice_join = [{ tfOpName: "ConcatV2", dlOpName: "concat", category: "slice_join", params: [{ tfInputIndex: 0, tfInputParamLength: 1, dlParamName: "tensors", type: "tensors" }, { tfInputIndex: -1, dlParamName: "axis", type: "number" }] }, { tfOpName: "Concat", dlOpName: "concat", category: "slice_join", params: [{ tfInputIndex: 1, tfInputParamLength: 1, dlParamName: "tensors", type: "tensors" }, { tfInputIndex: 0, dlParamName: "axis", type: "number" }] }, { tfOpName: "GatherV2", dlOpName: "gather", category: "slice_join", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "indices", type: "tensor" }, { tfParamName: "axis", dlParamName: "axis", type: "number", defaultValue: 0 }] }, { tfOpName: "Gather", dlOpName: "gather", category: "slice_join", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "indices", type: "tensor" }, { tfParamName: "axis", dlParamName: "axis", type: "number", defaultValue: 0 }, { tfParamName: "validate_indices", dlParamName: "validateIndices", type: "bool", notSupported: !0 }] }, { tfOpName: "Reverse", dlOpName: "reverse", category: "slice_join", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number" }] }, { tfOpName: "ReverseV2", dlOpName: "reverse", category: "slice_join", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "axis", type: "number" }] }, { tfOpName: "Slice", dlOpName: "slice", category: "slice_join", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "begin", type: "number[]" }, { tfInputIndex: 2, dlParamName: "size", type: "number[]" }] }, { tfOpName: "StridedSlice", dlOpName: "stridedSlice", category: "slice_join", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "begin", type: "number[]" }, { tfInputIndex: 2, dlParamName: "end", type: "number[]" }, { tfInputIndex: 3, dlParamName: "strides", type: "number[]" }, { tfParamName: "begin_mask", dlParamName: "beginMask", type: "number", defaultValue: 0 }, { tfParamName: "end_mask", dlParamName: "endMask", type: "number", defaultValue: 0 }] }, { tfOpName: "Pack", dlOpName: "stack", category: "slice_join", params: [{ tfInputIndex: 0, tfInputParamLength: 0, dlParamName: "tensors", type: "tensors" }, { tfParamName: "axis", dlParamName: "axis", type: "number", defaultValue: 0 }] }, { tfOpName: "Unpack", dlOpName: "unstack", category: "slice_join", params: [{ tfInputIndex: 0, tfInputParamLength: 0, dlParamName: "tensor", type: "tensor" }, { tfParamName: "axis", dlParamName: "axis", type: "number", defaultValue: 0 }, { tfParamName: "num", dlParamName: "num", type: "number", defaultValue: 0, notSupported: !0 }] }, { tfOpName: "Tile", dlOpName: "tile", category: "slice_join", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "reps", type: "number[]" }] }, { tfOpName: "Split", dlOpName: "split", category: "slice_join", params: [{ tfInputIndex: 0, dlParamName: "axis", type: "number", defaultValue: 0 }, { tfInputIndex: 1, dlParamName: "x", type: "tensor" }, { tfParamName: "num_split", dlParamName: "numOrSizeSplits", type: "number", defaultValue: 1 }] }], + sliceJoin = Object.freeze({ default: slice_join }), + transformation = [{ tfOpName: "Cast", dlOpName: "cast", category: "transformation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "SrcT", dlParamName: "sdtype", type: "dtype", notSupported: !0 }, { tfParamName: "DstT", dlParamName: "dtype", type: "dtype" }] }, { tfOpName: "ExpandDims", dlOpName: "expandDims", category: "transformation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, tfParamNameDeprecated: "dim", dlParamName: "axis", type: "number" }] }, { tfOpName: "Pad", dlOpName: "pad", category: "transformation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "padding", type: "number[]" }, { tfParamName: "constant_value", dlParamName: "constantValue", type: "number", defaultValue: 0 }] }, { tfOpName: "PadV2", dlOpName: "pad", category: "transformation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "padding", type: "number[]" }, { tfInputIndex: 2, dlParamName: "constantValue", type: "number", defaultValue: 0 }] }, { tfOpName: "Reshape", dlOpName: "reshape", category: "transformation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "shape", type: "number[]" }] }, { tfOpName: "Squeeze", dlOpName: "squeeze", category: "transformation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfParamName: "axis", tfParamNameDeprecated: "squeeze_dims", dlParamName: "axis", type: "number[]" }] }, { tfOpName: "SpaceToBatchND", dlOpName: "spaceToBatchND", category: "transformation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "blockShape", type: "number[]" }, { tfInputIndex: 2, dlParamName: "paddings", type: "number[]" }] }, { tfOpName: "BatchToSpaceND", dlOpName: "batchToSpaceND", category: "transformation", params: [{ tfInputIndex: 0, dlParamName: "x", type: "tensor" }, { tfInputIndex: 1, dlParamName: "blockShape", type: "number[]" }, { tfInputIndex: 2, dlParamName: "crops", type: "number[]" }] }], + transformation$1 = Object.freeze({ default: transformation }), + CONTROL_FLOW_OPS = ["Switch", "Merge", "Enter", "Exit", "NextIteration"], + DYNAMIC_SHAPE_OPS = ["NonMaxSuppressionV2", "NonMaxSuppressionV3", "Where"], + OperationMapper = function () { + function e() { + var e = [arithmetic$1, basicMath, control$1, convolution$1, creation$1, dynamic$1, evaluation$1, logical$1, image$2, graph$1, matrices$1, normalization$1, reduction$1, sliceJoin, transformation$1], + t = [].concat.apply([], e.map(function (e) { + return e.default ? e.default : e; + }));this.opMappers = t.reduce(function (e, t) { + return e[t.tfOpName] = t, e; + }, {}); + }return Object.defineProperty(e, "Instance", { get: function () { + return this._instance || (this._instance = new this()); + }, enumerable: !0, configurable: !0 }), e.prototype.isControlFlow = function (e) { + return CONTROL_FLOW_OPS.some(function (t) { + return t === e.op; + }); + }, e.prototype.isDynamicShape = function (e) { + return DYNAMIC_SHAPE_OPS.some(function (t) { + return t === e.op; + }); + }, e.prototype.transformGraph = function (e) { + var t = this, + a = !1, + r = !1, + n = [], + o = e.node.reduce(function (e, o) { + return e[o.name] = t.mapNode(o), t.isControlFlow(o) && (a = !0), t.isDynamicShape(o) && (r = !0), "Placeholder" === o.op && n.push(e[o.name]), e; + }, {}), + s = [], + i = [];return Object.keys(o).forEach(function (e) { + var t = o[e];t.inputNames.forEach(function (e) { + var a = getNodeNameAndIndex(e)[0];t.inputs.push(o[a]), o[a].children.push(t); + }), 0 === t.inputs.length && s.push(t); + }), Object.keys(o).forEach(function (e) { + var t = o[e];0 === t.children.length && i.push(t); + }), { nodes: o, inputs: s, outputs: i, placeholders: n, withControlFlow: a, withDynamicShape: r }; + }, e.prototype.mapNode = function (e) { + var t = this, + a = this.opMappers[e.op];if (void 0 === a) throw new Error("Tensorflow Op is not supported: " + e.op);var r = { name: e.name, op: a.dlOpName, category: a.category, inputNames: (e.input || []).map(function (e) { + return e.startsWith("^") ? e.substr(1) : e; + }), inputs: [], children: [], params: {} };return a.params && (r.params = a.params.reduce(function (a, r) { + var n = r.tfInputIndex, + o = r.tfInputParamLength, + s = r.type, + i = void 0;if (void 0 === n) switch (r.type) {case "string": + void 0 === (i = t.getStringParam(e.attr, r.tfParamName, r.defaultValue)) && r.tfParamNameDeprecated && (i = t.getStringParam(e.attr, r.tfParamNameDeprecated, r.defaultValue));break;case "number": + void 0 === (i = t.getNumberParam(e.attr, r.tfParamName, r.defaultValue)) && r.tfParamNameDeprecated && (i = t.getNumberParam(e.attr, r.tfParamNameDeprecated, r.defaultValue));break;case "number[]": + void 0 === (i = t.getNumericArrayParam(e.attr, r.tfParamName, r.defaultValue)) && r.tfParamNameDeprecated && (i = t.getNumericArrayParam(e.attr, r.tfParamNameDeprecated, r.defaultValue));break;case "bool": + void 0 === (i = t.getBoolParam(e.attr, r.tfParamName, r.defaultValue)) && r.tfParamNameDeprecated && (i = t.getBoolParam(e.attr, r.tfParamNameDeprecated, r.defaultValue));break;case "shape": + void 0 === (i = t.getTensorShapeParam(e.attr, r.tfParamName, r.defaultValue)) && r.tfParamNameDeprecated && (i = t.getTensorShapeParam(e.attr, r.tfParamNameDeprecated, r.defaultValue));break;case "dtype": + void 0 === (i = t.getDtypeParam(e.attr, r.tfParamName, r.defaultValue)) && r.tfParamNameDeprecated && (i = t.getDtypeParam(e.attr, r.tfParamNameDeprecated, r.defaultValue));break;case "tensor":case "tensors": + break;default: + throw new Error("Unsupported param type: " + r.type + " for op: " + e.op);}return a[r.dlParamName] = { value: i, inputIndex: n, type: s, inputParamLength: o }, a; + }, {})), r; + }, e.prototype.getStringParam = function (e, t, a, r) { + void 0 === r && (r = !1);var n = e[t];if (void 0 !== n) { + var o = String.fromCharCode.apply(null, n.s);return r ? o : o.toLowerCase(); + }return a; + }, e.prototype.getBoolParam = function (e, t, a) { + var r = e[t];return r ? r.b : a; + }, e.prototype.getNumberParam = function (e, t, a) { + var r = e[t], + n = r ? void 0 !== r.f ? r.f : r.i : a;return "number" == typeof n ? n : n.toInt(); + }, e.prototype.getDtypeParam = function (e, t, a) { + var r = e[t];if (r && r.type) switch (r.type) {case compiled_api_1.DataType.DT_FLOAT: + return "float32";case compiled_api_1.DataType.DT_INT32: + return "int32";case compiled_api_1.DataType.DT_BOOL: + return "bool";default: + return a;}return a; + }, e.prototype.getTensorShapeParam = function (e, t, a) { + var r = e[t];return r && r.shape ? r.shape.dim.map(function (e) { + return "number" == typeof e.size ? e.size : e.size.toInt(); + }) : a; + }, e.prototype.getNumericArrayParam = function (e, t, a) { + var r = e[t];return r ? (r.list.f && r.list.f.length ? r.list.f : r.list.i).map(function (e) { + return "number" == typeof e ? e : e.toInt(); + }) : a; + }, e; + }(), + executeOp = function (e, t, a) { + switch (e.op) {case "add": + return [add(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "mod": + return [mod(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "mul": + return [mul(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "div": + return [div(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "floorDiv": + return [floorDiv(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "sub": + return [sub(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "minimum": + return [minimum(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "maximum": + return [maximum(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "pow": + return [pow(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "squaredDifference": + return [squaredDifference(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$1 = function (e, t, a) { + switch (e.op) {case "abs": + return [abs(getParamValue("x", e, t, a))];case "acos": + return [acos(getParamValue("x", e, t, a))];case "acosh": + return [acosh(getParamValue("x", e, t, a))];case "asin": + return [asin(getParamValue("x", e, t, a))];case "asinh": + return [asinh(getParamValue("x", e, t, a))];case "atan": + return [atan(getParamValue("x", e, t, a))];case "atanh": + return [atanh(getParamValue("x", e, t, a))];case "ceil": + return [ceil(getParamValue("x", e, t, a))];case "cos": + return [cos(getParamValue("x", e, t, a))];case "cosh": + return [cosh(getParamValue("x", e, t, a))];case "elu": + return [elu(getParamValue("x", e, t, a))];case "erf": + return [erf(getParamValue("x", e, t, a))];case "exp": + return [exp(getParamValue("x", e, t, a))];case "expm1": + return [expm1(getParamValue("x", e, t, a))];case "floor": + return [floor(getParamValue("x", e, t, a))];case "log": + return [log$1(getParamValue("x", e, t, a))];case "log1p": + return [log1p(getParamValue("x", e, t, a))];case "neg": + return [neg(getParamValue("x", e, t, a))];case "reciprocal": + return [reciprocal(getParamValue("x", e, t, a))];case "relu": + return [relu(getParamValue("x", e, t, a))];case "round": + return [round(getParamValue("x", e, t, a))];case "selu": + return [selu(getParamValue("x", e, t, a))];case "sigmoid": + return [sigmoid(getParamValue("x", e, t, a))];case "sin": + return [sin(getParamValue("x", e, t, a))];case "sign": + return [sign(getParamValue("x", e, t, a))];case "sinh": + return [sinh(getParamValue("x", e, t, a))];case "softplus": + return [softplus(getParamValue("x", e, t, a))];case "sqrt": + return [sqrt(getParamValue("x", e, t, a))];case "square": + return [square(getParamValue("x", e, t, a))];case "tanh": + return [tanh$1(getParamValue("x", e, t, a))];case "tan": + return [tan(getParamValue("x", e, t, a))];case "clipByValue": + return [clipByValue(getParamValue("x", e, t, a), getParamValue("clipValueMin", e, t, a), getParamValue("clipValueMax", e, t, a))];case "rsqrt": + return [div(scalar(1, "float32"), sqrt(getTensor(e.inputNames[0], t, a)))];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + TensorArray = function () { + function e(t, a, r, n, o, s, i) { + this.name = t, this.dtype = a, this.maxSize = r, this.elementShape = n, this.identicalElementShapes = o, this.dynamicSize = s, this.clearAfterRead = i, this.tensors = [], this.closed_ = !1, this.id = e.nextId++; + }return Object.defineProperty(e.prototype, "closed", { get: function () { + return this.closed_; + }, enumerable: !0, configurable: !0 }), e.prototype.clearAndClose = function () { + this.tensors.forEach(function (e) { + return e.tensor.dispose(); + }), this.tensors = [], this.closed_ = !0; + }, e.prototype.size = function () { + return this.tensors.length; + }, e.prototype.read = function (e) { + if (this.closed_) throw new Error("TensorArray " + this.name + " has already been closed.");if (e < 0 || e >= this.tensors.length) throw new Error("Tried to read from index " + e + ", but array size is: " + this.tensors.length);var t = this.tensors[e];if (t.cleared) throw new Error("TensorArray " + this.name + ": Could not read index " + e + " twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).");return this.clearAfterRead && (t.cleared = !0), t.read = !0, t.tensor; + }, e.prototype.readMany = function (e) { + var t = this;return e.map(function (e) { + return t.read(e); + }); + }, e.prototype.write = function (e, t) { + if (this.closed_) throw new Error("TensorArray " + this.name + " has already been closed.");if (e < 0 || !this.dynamicSize && e >= this.maxSize) throw new Error("Tried to write to index " + e + ", but array is not resizeable and size is: " + this.maxSize);var a = this.tensors[e] || {};if (t.dtype !== this.dtype) throw new Error("TensorArray " + this.name + ": Could not write to TensorArray index " + e + ",\n because the value dtype is " + t.dtype + ", but TensorArray dtype is " + this.dtype + ".");if (0 === this.size() && 0 === this.elementShape.length && (this.elementShape = t.shape), util.assertShapesMatch(this.elementShape, t.shape, "TensorArray " + this.name + ": Could not write to TensorArray index " + e + "."), a && a.read) throw new Error("TensorArray " + this.name + ": Could not write to TensorArray index " + e + ", because it has already been read.");if (a && a.written) throw new Error("TensorArray " + this.name + ": Could not write to TensorArray index " + e + ", because it has already been written.");a.tensor = t, a.written = !0, this.tensors[e] = a; + }, e.prototype.writeMany = function (e, t) { + var a = this;if (e.length !== t.length) throw new Error("TensorArray " + this.name + ": could not write multiple tensors,because the index size: " + e.length + " is not the same as tensors size: " + t.length + ".");e.map(function (e, r) { + return a.write(e, t[r]); + }); + }, e.prototype.gather = function (e, t) { + if (t && t !== this.dtype) throw new Error("TensorArray dtype is " + this.dtype + " but gather requested dtype " + t);if (!e) { + e = [];for (var a = 0; a < this.size(); a++) e.push(a); + }if (0 === e.length) return tensor([], [0].concat(this.elementShape));var r = this.readMany(e);return util.assertShapesMatch(this.elementShape, r[0].shape, "TensorArray shape mismatch: "), stack(r, 0); + }, e.prototype.concat = function (e) { + if (e && e !== this.dtype) throw new Error("TensorArray dtype is " + this.dtype + " but concat requested dtype " + e);if (0 === this.size()) return tensor([], [0].concat(this.elementShape));for (var t = [], a = 0; a < this.size(); a++) t.push(a);var r = this.readMany(t);return util.assertShapesMatch(this.elementShape, r[0].shape, "TensorArray shape mismatch: tensor array shape (" + this.elementShape + ") vs first tensor shape (" + r[0].shape + ")"), concat(r, 0); + }, e.prototype.scatter = function (e, t) { + if (t.dtype !== this.dtype) throw new Error("TensorArray dtype is " + this.dtype + " but tensor has dtype " + t.dtype);if (e.length !== t.shape[0]) throw new Error("Expected len(indices) == tensor.shape[0], but saw: " + e.length + " vs. " + t.shape[0]);var a = Math.max.apply(Math, e);if (!this.dynamicSize && a >= this.maxSize) throw new Error("Max index must be < array size (" + a + " vs. " + this.maxSize + ")");this.writeMany(e, unstack(t, 0)); + }, e.prototype.split = function (e, t) { + var a = this;if (t.dtype !== this.dtype) throw new Error("TensorArray dtype is " + this.dtype + " but tensor has dtype " + t.dtype);var r = 0, + n = e.map(function (e) { + return r += e; + });if (r !== t.shape[0]) throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n " + r + ", and tensor's shape is: " + t.shape);if (!this.dynamicSize && e.length !== this.maxSize) throw new Error("TensorArray's size is not equal to the size of lengths (" + this.maxSize + " vs. " + e.length + "), and the TensorArray is not marked as dynamically resizeable");var o = 0 === r ? 0 : t.size / r, + s = [];tidy(function () { + t = t.reshape([1, r, o]);for (var i = 0; i < e.length; ++i) { + var p = [0, 0 === i ? 0 : n[i - 1], 0], + u = [1, e[i], o];s[i] = slice(t, p, u).reshape(a.elementShape); + }return s; + });for (var i = [], p = 0; p < e.length; p++) i[p] = p;this.writeMany(i, s); + }, e.nextId = 0, e; + }();function executeOp$2(e, t, a) { + return __awaiter$2(this, void 0, void 0, function () { + var r, n, o, s, i, p, u, m, l, d, c, f, h, y, g, N, P, b, x, v, I, O, w, V, T, k, $, _, A, S, D, C, E, j, R;return __generator$2(this, function (L) { + switch (L.label) {case 0: + switch (e.op) {case "loopCond": + return [3, 1];case "switch": + return [3, 2];case "merge": + return [3, 4];case "enter": + return [3, 5];case "exit": + return [3, 6];case "nextIteration": + return [3, 7];case "tensorArray": + return [3, 8];case "tensorArrayWrite": + return [3, 9];case "tensorArrayRead": + return [3, 10];case "tensorArrayGather": + return [3, 11];case "tensorArrayScatter": + return [3, 12];case "tensorArrayConcat": + return [3, 13];case "tensorArraySplit": + return [3, 14];case "tensorArraySize": + return [3, 15];case "tensorArrayClose": + return [3, 16];}return [3, 17];case 1: + return [2, [getParamValue("pred", e, t, a)]];case 2: + return r = getParamValue("pred", e, t, a), n = getParamValue("data", e, t, a), [4, r.data()];case 3: + return [2, L.sent()[0] ? [void 0, n] : [n, void 0]];case 4: + return [2, (o = e.inputNames.find(function (e) { + return void 0 !== getTensor(e, t, a); + })) ? [getTensor(o, t, a)] : void 0];case 5: + return s = getParamValue("frameName", e, t, a), i = getParamValue("tensor", e, t, a), a.enterFrame(s), [2, [i]];case 6: + return p = getParamValue("tensor", e, t, a), a.exitFrame(), [2, [p]];case 7: + return u = getParamValue("tensor", e, t, a), a.nextIteration(), [2, [u]];case 8: + return m = getParamValue("size", e, t, a), l = getParamValue("dtype", e, t, a), d = getParamValue("elementShape", e, t, a), c = getParamValue("dynamicSize", e, t, a), f = getParamValue("clearAfterRead", e, t, a), h = getParamValue("identicalElementShapes", e, t, a), y = getParamValue("name", e, t, a), g = new TensorArray(y, l, m, d, h, c, f), a.addTensorArray(g), [2, [scalar(g.id), scalar(1)]];case 9: + return N = getParamValue("tensorArrayId", e, t, a), P = getParamValue("index", e, t, a), b = getParamValue("tensor", e, t, a), a.getTensorArray(N).write(P, b), [2, [scalar(1)]];case 10: + return x = getParamValue("tensorArrayId", e, t, a), v = getParamValue("index", e, t, a), [2, [a.getTensorArray(x).read(v)]];case 11: + return I = getParamValue("tensorArrayId", e, t, a), O = getParamValue("indices", e, t, a), w = getParamValue("dtype", e, t, a), [2, [a.getTensorArray(I).gather(O, w)]];case 12: + return V = getParamValue("tensorArrayId", e, t, a), T = getParamValue("indices", e, t, a), k = getParamValue("tensor", e, t, a), a.getTensorArray(V).scatter(T, k), [2, [scalar(1)]];case 13: + return $ = getParamValue("tensorArrayId", e, t, a), _ = a.getTensorArray($), A = getParamValue("dtype", e, t, a), [2, [_.concat(A)]];case 14: + return S = getParamValue("tensorArrayId", e, t, a), D = getParamValue("tensor", e, t, a), C = getParamValue("lengths", e, t, a), a.getTensorArray(S).split(C, D), [2, [scalar(1)]];case 15: + return E = getParamValue("tensorArrayId", e, t, a), j = a.getTensorArray(E), [2, [scalar(j.size(), "int32")]];case 16: + return R = getParamValue("tensorArrayId", e, t, a), a.getTensorArray(R).clearAndClose(), [2, []];case 17: + throw TypeError("Node type " + e.op + " is not implemented");} + }); + }); + }var executeOp$3 = function (e, t, a) { + switch (e.op) {case "conv1d": + var r = getParamValue("stride", e, t, a), + n = getParamValue("pad", e, t, a), + o = getParamValue("dataFormat", e, t, a).toUpperCase(), + s = getParamValue("dilation", e, t, a);return [conv1d(getParamValue("x", e, t, a), getParamValue("filter", e, t, a), r, n, o, s)];case "conv2d": + r = getParamValue("strides", e, t, a), n = getParamValue("pad", e, t, a), o = getParamValue("dataFormat", e, t, a).toUpperCase();var i = getParamValue("dilations", e, t, a);return [conv2d(getParamValue("x", e, t, a), getParamValue("filter", e, t, a), [r[1], r[2]], n, o, [i[0], i[1]])];case "conv2dTranspose": + var p = getParamValue("outputShape", e, t, a);r = getParamValue("strides", e, t, a), n = getParamValue("pad", e, t, a);return [conv2dTranspose(getParamValue("x", e, t, a), getParamValue("filter", e, t, a), p, [r[1], r[2]], n)];case "depthwiseConv2d": + r = getParamValue("strides", e, t, a), n = getParamValue("pad", e, t, a), i = getParamValue("dilations", e, t, a), o = getParamValue("dataFormat", e, t, a).toUpperCase();return [depthwiseConv2d(getParamValue("input", e, t, a), getParamValue("filter", e, t, a), [r[1], r[2]], n, o, [i[0], i[1]])];case "avgPool": + r = getParamValue("strides", e, t, a), n = getParamValue("pad", e, t, a);var u = getParamValue("kernelSize", e, t, a);return [avgPool(getParamValue("x", e, t, a), [u[1], u[2]], [r[1], r[2]], n)];case "maxPool": + r = getParamValue("strides", e, t, a), n = getParamValue("pad", e, t, a), u = getParamValue("kernelSize", e, t, a);return [maxPool(getParamValue("x", e, t, a), [u[1], u[2]], [r[1], r[2]], n)];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$4 = function (e, t, a) { + switch (e.op) {case "fill": + var r = getParamValue("shape", e, t, a), + n = getParamValue("value", e, t, a);return [fill(r, n)];case "linspace": + var o = getParamValue("start", e, t, a), + s = getParamValue("stop", e, t, a), + i = getParamValue("num", e, t, a);return [linspace(o, s, i)];case "oneHot": + var p = getParamValue("indices", e, t, a), + u = getParamValue("depth", e, t, a), + m = getParamValue("onValue", e, t, a), + l = getParamValue("offValue", e, t, a);return [oneHot(p, u, m, l)];case "ones": + return [ones$1(getParamValue("shape", e, t, a), getParamValue("dtype", e, t, a))];case "onesLike": + return [onesLike(getParamValue("x", e, t, a))];case "randomUniform": + return [randomUniform(getParamValue("shape", e, t, a), getParamValue("minval", e, t, a), getParamValue("maxval", e, t, a), getParamValue("dtype", e, t, a))];case "range": + o = getParamValue("start", e, t, a);var d = getParamValue("stop", e, t, a), + c = getParamValue("step", e, t, a);return [range(o, d, c, getParamValue("dtype", e, t, a))];case "truncatedNormal": + r = getParamValue("shape", e, t, a);var f = getParamValue("mean", e, t, a), + h = getParamValue("stdDev", e, t, a), + y = getParamValue("seed", e, t, a);return [truncatedNormal(r, f, h, getParamValue("dtype", e, t, a), y)];case "zeros": + return [zeros(getParamValue("shape", e, t, a), getParamValue("dtype", e, t, a))];case "zerosLike": + return [zerosLike(getParamValue("x", e, t, a))];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + _this = void 0, + executeOp$5 = function (e, t, a) { + return __awaiter$2(_this, void 0, void 0, function () { + var r, n, o, s, i;return __generator$2(this, function (p) { + switch (p.label) {case 0: + switch (e.op) {case "nonMaxSuppression": + return [3, 1];case "whereAsync": + return [3, 3];}return [3, 5];case 1: + return r = getParamValue("boxes", e, t, a), n = getParamValue("scores", e, t, a), o = getParamValue("maxOutputSize", e, t, a), s = getParamValue("iouThreshold", e, t, a), i = getParamValue("scoreThreshold", e, t, a), [4, image_ops.nonMaxSuppressionAsync(r, n, o, s, i)];case 2: + return [2, [p.sent()]];case 3: + return [4, whereAsync(getParamValue("condition", e, t, a))];case 4: + return [2, [p.sent()]];case 5: + throw TypeError("Node type " + e.op + " is not implemented");} + }); + }); + }, + executeOp$6 = function (e, t, a) { + switch (e.op) {case "topK": + var r = getParamValue("x", e, t, a), + n = getParamValue("k", e, t, a), + o = getParamValue("sorted", e, t, a), + s = topk(r, n, o);return [s.values, s.indices];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$7 = function (e, t, a) { + switch (e.op) {case "const": + return t[e.name];case "placeholder": + var r = getParamValue("default", e, t, a);return [getTensor(e.name, t, a) || r];case "identity":case "stopGradient":case "fakeQuantWithMinMaxVars": + return [getParamValue("x", e, t, a)];case "snapshot": + return [getParamValue("x", e, t, a).clone()];case "shape": + return [tensor1d(getParamValue("x", e, t, a).shape, "int32")];case "size": + return [scalar(getParamValue("x", e, t, a).size, "int32")];case "rank": + return [scalar(getParamValue("x", e, t, a).rank, "int32")];case "noop": + return [];case "print": + var n = getParamValue("x", e, t, a), + o = getParamValue("data", e, t, a), + s = getParamValue("message", e, t, a), + i = getParamValue("summarize", e, t, a);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."), console.log(s);for (var p = 0; p < o.length; p++) console.log(Array.prototype.slice.call(o[0].dataSync()).slice(0, i));return [n];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$8 = function (e, t, a) { + switch (e.op) {case "resizeBilinear": + var r = getParamValue("images", e, t, a), + n = getParamValue("size", e, t, a), + o = getParamValue("alignCorners", e, t, a);return [image_ops.resizeBilinear(r, [n[0], n[1]], o)];case "resizeNearestNeighbor": + r = getParamValue("images", e, t, a), n = getParamValue("size", e, t, a), o = getParamValue("alignCorners", e, t, a);return [image_ops.resizeNearestNeighbor(r, [n[0], n[1]], o)];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$9 = function (e, t, a) { + switch (e.op) {case "equal": + return [equal(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "notEqual": + return [notEqual(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "greater": + return [greater(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "greaterEqual": + return [greaterEqual(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "less": + return [less(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "lessEqual": + return [lessEqual(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "logicalAnd": + return [logicalAnd(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "logicalNot": + return [logicalNot(getParamValue("a", e, t, a))];case "logicalOr": + return [logicalOr(getParamValue("a", e, t, a), getParamValue("b", e, t, a))];case "where": + return [where(getParamValue("condition", e, t, a), getParamValue("a", e, t, a), getParamValue("b", e, t, a))];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$10 = function (e, t, a) { + switch (e.op) {case "matMul": + return [matMul(getParamValue("a", e, t, a), getParamValue("b", e, t, a), getParamValue("transposeA", e, t, a), getParamValue("transposeB", e, t, a))];case "transpose": + return [transpose(getParamValue("x", e, t, a), getParamValue("perm", e, t, a))];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$11 = function (e, t, a) { + switch (e.op) {case "batchNormalization": + return [batchNormalization(getParamValue("x", e, t, a), getParamValue("mean", e, t, a), getParamValue("variance", e, t, a), getParamValue("epsilon", e, t, a), getParamValue("scale", e, t, a), getParamValue("offset", e, t, a))];case "localResponseNormalization": + return [localResponseNormalization(getParamValue("x", e, t, a), getParamValue("radius", e, t, a), getParamValue("bias", e, t, a), getParamValue("alpha", e, t, a), getParamValue("beta", e, t, a))];case "softmax": + return [softmax(getParamValue("x", e, t, a))];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$12 = function (e, t, a) { + switch (e.op) {case "max": + var r = getParamValue("axis", e, t, a), + n = getParamValue("keepDims", e, t, a);return [max(getParamValue("x", e, t, a), r, n)];case "mean": + r = getParamValue("axis", e, t, a), n = getParamValue("keepDims", e, t, a);return [mean(getParamValue("x", e, t, a), r, n)];case "min": + r = getParamValue("axis", e, t, a), n = getParamValue("keepDims", e, t, a);return [min(getParamValue("x", e, t, a), r, n)];case "sum": + r = getParamValue("axis", e, t, a), n = getParamValue("keepDims", e, t, a);return [sum(getParamValue("x", e, t, a), r, n)];case "all": + r = getParamValue("axis", e, t, a), n = getParamValue("keepDims", e, t, a);return [all(getParamValue("x", e, t, a), r, n)];case "any": + r = getParamValue("axis", e, t, a), n = getParamValue("keepDims", e, t, a);return [any(getParamValue("x", e, t, a), r, n)];case "argMax": + r = getParamValue("axis", e, t, a);return [argMax(getParamValue("x", e, t, a), r)];case "argMin": + r = getParamValue("axis", e, t, a);return [argMin(getParamValue("x", e, t, a), r)];default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$13 = function (e, t, a) { + switch (e.op) {case "concat": + var r = getParamValue("axis", e, t, a), + n = getParamValue("tensors", e, t, a);return [concat(n, r)];case "gather": + r = getParamValue("axis", e, t, a);var o = getParamValue("x", e, t, a), + s = getParamValue("indices", e, t, a);return [gather(o, s, r)];case "reverse": + r = getParamValue("axis", e, t, a), o = getParamValue("x", e, t, a);return [reverse(o, r)];case "slice": + var i = getParamValue("begin", e, t, a), + p = getParamValue("size", e, t, a);return [slice(getParamValue("x", e, t, a), i, p)];case "stridedSlice": + i = getParamValue("begin", e, t, a);var u = getParamValue("end", e, t, a), + m = getParamValue("strides", e, t, a), + l = getParamValue("beginMask", e, t, a), + d = getParamValue("endMask", e, t, a), + c = getParamValue("x", e, t, a);if (1 === i.length && c.shape.length > 1) for (var f = 1; f < c.shape.length; f++) i.push(0), u.push(c.shape[f]), m.push(m[0]);return [stridedSlice(c, i, u, m, l, d)];case "stack": + return tidy(function () { + var r = getParamValue("axis", e, t, a), + n = getParamValue("tensors", e, t, a), + o = n[0].shape, + s = n[0].squeeze().shape, + i = n.map(function (e) { + var t = util.arraysEqual(e.shape, o);if (!t && !util.arraysEqual(e.squeeze().shape, s)) throw new Error("the input tensors shape does not match");return t ? e : e.reshape(o); + });return [stack(i, r)]; + });case "unstack": + return tidy(function () { + var r = getParamValue("axis", e, t, a), + n = getParamValue("tensor", e, t, a);return unstack(n, r); + });case "tile": + var h = getParamValue("reps", e, t, a);return [tile(getParamValue("x", e, t, a), h)];case "split": + r = getParamValue("axis", e, t, a);var y = getParamValue("numOrSizeSplits", e, t, a);return split(getParamValue("x", e, t, a), y, r);default: + throw TypeError("Node type " + e.op + " is not implemented");} + }, + executeOp$14 = function (e, t, a) { + switch (e.op) {case "cast": + return [cast(getParamValue("x", e, t, a), getParamValue("dtype", e, t, a))];case "expandDims": + var r = e.params.axis.value;return [expandDims(getParamValue("x", e, t, a), r)];case "squeeze": + r = e.params.axis.value;return [squeeze(getParamValue("x", e, t, a), r)];case "reshape": + return [reshape(getParamValue("x", e, t, a), getParamValue("shape", e, t, a))];case "pad": + return [pad(getParamValue("x", e, t, a), split$1(getParamValue("padding", e, t, a), 2), getParamValue("constantValue", e, t, a))];case "spaceToBatchND": + var n = getParamValue("blockShape", e, t, a), + o = split$1(getParamValue("paddings", e, t, a), 2);return [spaceToBatchND(getParamValue("x", e, t, a), n, o)];case "batchToSpaceND": + n = getParamValue("blockShape", e, t, a);var s = split$1(getParamValue("crops", e, t, a), 2);return [batchToSpaceND(getParamValue("x", e, t, a), n, s)];default: + throw TypeError("Node type " + e.op + " is not implemented");} + };function executeOp$15(e, t, a) { + switch (e.category) {case "arithmetic": + return executeOp(e, t, a);case "basic_math": + return executeOp$1(e, t, a);case "control": + return executeOp$2(e, t, a);case "convolution": + return executeOp$3(e, t, a);case "creation": + return executeOp$4(e, t, a);case "dynamic": + return executeOp$5(e, t, a);case "evaluation": + return executeOp$6(e, t, a);case "image": + return executeOp$8(e, t, a);case "graph": + return executeOp$7(e, t, a);case "logical": + return executeOp$9(e, t, a);case "matrices": + return executeOp$10(e, t, a);case "normalization": + return executeOp$11(e, t, a);case "reduction": + return executeOp$12(e, t, a);case "slice_join": + return executeOp$13(e, t, a);case "transformation": + return executeOp$14(e, t, a);default: + throw TypeError("Node type " + e.op + " is not implemented");} + }var ExecutionContext = function () { + function e(e, t) { + this.weightMap = e, this.tensorArrayMap = t, this.rootContext = { id: 0, frameName: "", iterationId: 0 }, this.contexts = [this.rootContext], this.lastId = 0, this.generateCurrentContextIds(); + }return e.prototype.newFrame = function (e, t) { + return { id: e, frameName: t, iterationId: 0 }; + }, Object.defineProperty(e.prototype, "currentContext", { get: function () { + return this.contexts; + }, set: function (e) { + this.contexts !== e && (this.contexts = e, this.generateCurrentContextIds()); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "currentContextId", { get: function () { + return this._currentContextIds[0]; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "currentContextIds", { get: function () { + return this._currentContextIds; + }, enumerable: !0, configurable: !0 }), e.prototype.generateCurrentContextIds = function () { + for (var e = [], t = 0; t < this.contexts.length - 1; t++) { + var a = this.contexts.slice(0, this.contexts.length - t);e.push(this.contextIdforContexts(a)); + }e.push(""), this._currentContextIds = e; + }, e.prototype.contextIdforContexts = function (e) { + return e ? e.map(function (e) { + return 0 === e.id && 0 === e.iterationId ? "" : e.frameName + "-" + e.iterationId; + }).join("/") : ""; + }, e.prototype.enterFrame = function (e) { + this.contexts && (this.lastId++, this.contexts = this.contexts.slice(), this.contexts.push(this.newFrame(this.lastId, e)), this._currentContextIds.unshift(this.contextIdforContexts(this.contexts))); + }, e.prototype.exitFrame = function () { + if (!(this.contexts && this.contexts.length > 1)) throw new Error("Cannot exit frame, the context is empty");this.contexts = this.contexts.slice(), this.contexts.splice(-1), this.currentContextIds.shift(); + }, e.prototype.nextIteration = function () { + if (!(this.contexts && this.contexts.length > 0)) throw new Error("Cannot increase frame iteration, the context is empty");this.contexts = this.contexts.slice(), this.lastId++;var e = Object.assign({}, this.contexts[this.contexts.length - 1]);e.iterationId += 1, e.id = this.lastId, this.contexts.splice(-1, 1, e), this._currentContextIds.splice(0, 1, this.contextIdforContexts(this.contexts)); + }, e.prototype.getWeight = function (e) { + return this.weightMap[e]; + }, e.prototype.addTensorArray = function (e) { + this.tensorArrayMap[e.id] = e; + }, e.prototype.getTensorArray = function (e) { + return this.tensorArrayMap[e]; + }, e; + }(), + GraphExecutor = function () { + function e(e) { + this.graph = e, this.compiledOrder = [], this._weightMap = {}, this.placeholders = e.placeholders, this._outputs = e.outputs, this.compile(); + }return Object.defineProperty(e.prototype, "weightMap", { get: function () { + return this._weightMap; + }, set: function (e) { + var t = Object.keys(e).map(function (t) { + return e[t].map(function (e) { + return e.id; + }); + });this.weightIds = [].concat.apply([], t), this._weightMap = e; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "inputs", { get: function () { + return this.placeholders.map(function (e) { + return { name: e.name, shape: e.params.shape ? e.params.shape.value : void 0, dtype: e.params.dtype ? e.params.dtype.value : void 0 }; + }); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "outputs", { get: function () { + return this._outputs.map(function (e) { + return { name: e.name, shape: e.params.shape ? e.params.shape.value : void 0, dtype: e.params.dtype ? e.params.dtype.value : void 0 }; + }); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "inputNodes", { get: function () { + return this.placeholders.map(function (e) { + return e.name; + }); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "outputNodes", { get: function () { + return this.outputs.map(function (e) { + return e.name; + }); + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "isControlFlowModel", { get: function () { + return this.graph.withControlFlow; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "isDynamicShapeModel", { get: function () { + return this.graph.withDynamicShape; + }, enumerable: !0, configurable: !0 }), e.prototype.compile = function () { + if (!this.graph.withControlFlow && !this.graph.withDynamicShape) for (var e = this.graph.inputs.slice(), t = {}; e.length > 0;) { + var a = e.pop();t[a.name] = !0, this.compiledOrder.push(a), a.children.forEach(function (a) { + !t[a.name] && a.inputNames.every(function (e) { + var a = getNodeNameAndIndex(e)[0];return t[a]; + }) && e.push(a); + }); + } + }, e.prototype.execute = function (e, t) { + var a = this;this.checkInput(e), this.checkInputShapeAndType(e);var r = {};return tidy(function () { + var n = new ExecutionContext(a._weightMap, r), + o = a.compiledOrder.reduce(function (e, t) { + return e[t.name] = executeOp$15(t, e, n), e; + }, __assign$2({}, a.weightMap, e));return a.findOutputs(o, n, t); + }); + }, e.prototype.executeAsync = function (e, t) { + return __awaiter$2(this, void 0, void 0, function () { + var a, + r, + n, + o, + s, + i, + p, + u = this;return __generator$2(this, function (m) { + switch (m.label) {case 0: + return this.checkInput(e), this.checkInputShapeAndType(e), a = {}, r = new ExecutionContext(this._weightMap, a), [4, this.executeWithControlFlow(e, r)];case 1: + return n = m.sent(), o = this.findOutputs(n, r, t), s = Object.keys(o).map(function (e) { + return o[e].id; + }), i = Object.keys(e).map(function (t) { + return e[t].map(function (e) { + return e.id; + }); + }), p = [].concat.apply([], i), Object.keys(n).forEach(function (e) { + n[e].forEach(function (e) { + e && -1 === s.indexOf(e.id) && -1 === p.indexOf(e.id) && -1 === u.weightIds.indexOf(e.id) && e.dispose(); + }); + }), [2, o];} + }); + }); + }, e.prototype.executeWithControlFlow = function (e, t) { + return __awaiter$2(this, void 0, void 0, function () { + var a, r, n, o, s, i, p, u;return __generator$2(this, function (m) { + switch (m.label) {case 0: + a = this.graph.inputs.map(function (e) { + return { node: e, contexts: t.currentContext }; + }), r = __assign$2({}, this.weightMap, e), n = {}, m.label = 1;case 1: + return a.length > 0 ? (o = a.pop(), t.currentContext = o.contexts, s = "", "enter" === o.node.op && getParamValue("isConstant", o.node, r, t) && (s = getNodeNameAndIndex(o.node.name, t)[0]), i = executeOp$15(o.node, r, t), s || (s = getNodeNameAndIndex(o.node.name, t)[0]), p = r, u = s, [4, i]) : [3, 3];case 2: + return p[u] = m.sent(), o.node.children.forEach(function (e) { + var o = getNodeNameAndIndex(e.name, t)[0];n[o] || ("merge" === e.op ? e.inputNames.some(function (e) { + return !!getTensor(e, r, t); + }) && (n[o] = !0, a.push({ contexts: t.currentContext, node: e })) : e.inputNames.every(function (e) { + return !!getTensor(e, r, t); + }) && (n[o] = !0, a.push({ contexts: t.currentContext, node: e }))); + }), [3, 1];case 3: + return [2, r];} + }); + }); + }, e.prototype.findOutputs = function (e, t, a) { + return !a || a instanceof Array || (a = [a]), (a || this.graph.outputs.map(function (e) { + return e.name; + })).reduce(function (a, r) { + return a[r] = getTensor(r, e, t), a; + }, {}); + }, e.prototype.dispose = function () { + var e = this;Object.keys(this.weightMap).forEach(function (t) { + return e.weightMap[t].forEach(function (e) { + return e.dispose(); + }); + }); + }, e.prototype.checkInputShapeAndType = function (e) { + this.placeholders.forEach(function (t) { + var a = e[t.name][0];if (t.params.shape && t.params.shape.value) { + var r = t.params.shape.value, + n = r.length === a.shape.length && a.shape.every(function (e, t) { + return -1 === r[t] || r[t] === e; + });util.assert(n, "The shape of dict['" + t.name + "'] provided in model.execute(dict) must be [" + r + "], but was [" + a.shape + "]"); + }t.params.dtype && t.params.dtype.value && util.assert(a.dtype === t.params.dtype.value, "The dtype of dict['" + t.name + "'] provided in model.execute(dict) must be " + t.params.dtype.value + ", but was " + a.dtype); + }); + }, e.prototype.checkInput = function (e) { + var t = this, + a = Object.keys(e), + r = [], + n = [];if (this.inputNodes.forEach(function (e) { + -1 === a.indexOf(e) && r.push(e); + }), a.forEach(function (e) { + -1 === t.inputNodes.indexOf(e) && n.push(e); + }), r.length > 0) throw new Error("The dict provided in model.execute(dict) has the keys [" + a + "], but is missing the required keys: [" + r + "].");if (n.length > 0) throw new Error("The dict provided in model.execute(dict) has unused keys: [" + n + "]. Please provide only the following keys: [" + this.inputNodes + "]."); + }, e; + }(), + FrozenModel = function () { + function e(e, t, a) { + this.modelUrl = e, this.weightManifestUrl = t, this.requestOption = a, this.version = "n/a", this.pathPrefix = this.getPathPrefix(); + }return Object.defineProperty(e.prototype, "modelVersion", { get: function () { + return this.version; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "inputNodes", { get: function () { + return this.executor.inputNodes; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "outputNodes", { get: function () { + return this.executor.outputNodes; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "inputs", { get: function () { + return this.executor.inputs; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "outputs", { get: function () { + return this.executor.outputs; + }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "weights", { get: function () { + return this.executor.weightMap; + }, enumerable: !0, configurable: !0 }), e.prototype.getPathPrefix = function () { + var e = parse(this.weightManifestUrl), + t = e.pathname.split("/");return t.splice(-1), e.pathname = t.join("/"), format(e) + "/"; + }, e.prototype.loadRemoteProtoFile = function () { + return __awaiter$2(this, void 0, void 0, function () { + var e, t, a, r, n;return __generator$2(this, function (o) { + switch (o.label) {case 0: + return o.trys.push([0, 3,, 4]), [4, fetch(this.modelUrl, this.requestOption)];case 1: + return e = o.sent(), a = (t = compiled_api_1.GraphDef).decode, r = Uint8Array.bind, [4, e.arrayBuffer()];case 2: + return [2, a.apply(t, [new (r.apply(Uint8Array, [void 0, o.sent()]))()])];case 3: + throw n = o.sent(), new Error(this.modelUrl + " not found. " + n);case 4: + return [2];} + }); + }); + }, e.prototype.loadWeightManifest = function () { + return __awaiter$2(this, void 0, void 0, function () { + var e, t, a;return __generator$2(this, function (r) { + switch (r.label) {case 0: + return r.trys.push([0, 3,, 4]), [4, fetch(this.weightManifestUrl, this.requestOption)];case 1: + return e = r.sent(), t = this, [4, e.clone().json()];case 2: + return t.weightManifest = r.sent(), [3, 4];case 3: + throw a = r.sent(), new Error(this.weightManifestUrl + " not found. " + a);case 4: + return [2];} + }); + }); + }, e.prototype.load = function () { + return __awaiter$2(this, void 0, void 0, function () { + var e, t, a, r;return __generator$2(this, function (n) { + switch (n.label) {case 0: + return e = this.loadRemoteProtoFile(), t = this.loadWeightManifest(), [4, Promise.all([e, t])];case 1: + return a = n.sent()[0], this.version = a.versions.producer + "." + a.versions.minConsumer, [4, io.loadWeights(this.weightManifest, this.pathPrefix, void 0, this.requestOption)];case 2: + return r = n.sent(), this.executor = new GraphExecutor(OperationMapper.Instance.transformGraph(a)), this.executor.weightMap = this.convertTensorMapToTensorsMap(r), [2, !0];} + }); + }); + }, e.prototype.predict = function (e, t) { + return this.execute(e, this.outputNodes); + }, e.prototype.constructTensorMap = function (e) { + var t = e instanceof Tensor ? [e] : e;if (t.length !== this.inputNodes.length) throw new Error("Input tensor count mismatch,the frozen model has " + this.inputNodes.length + " placeholders, while there are " + t.length + " input tensors.");return this.inputNodes.reduce(function (e, a, r) { + return e[a] = t[r], e; + }, {}); + }, e.prototype.execute = function (e, t) { + if (t = t || this.outputNodes, (e instanceof Tensor || Array.isArray(e)) && (e = this.constructTensorMap(e)), this.executor.isControlFlowModel || this.executor.isDynamicShapeModel) throw new Error("The model contains control flow or dynamic shape ops, please use executeAsync method");var a = this.executor.execute(this.convertTensorMapToTensorsMap(e), t), + r = Object.keys(a);return Array.isArray(t) && t.length > 1 ? t.map(function (e) { + return a[e]; + }) : a[r[0]]; + }, e.prototype.executeAsync = function (e, t) { + return __awaiter$2(this, void 0, void 0, function () { + var a, r;return __generator$2(this, function (n) { + switch (n.label) {case 0: + if (!this.executor.isControlFlowModel || !this.executor.isDynamicShapeModel) throw new Error("The model does not contain control flow or dynamic shape ops, please use execute method for better performance.");return t = t || this.outputNodes, (e instanceof Tensor || Array.isArray(e)) && (e = this.constructTensorMap(e)), [4, this.executor.executeAsync(this.convertTensorMapToTensorsMap(e), t)];case 1: + return a = n.sent(), r = Object.keys(a), [2, Array.isArray(t) && t.length > 1 ? t.map(function (e) { + return a[e]; + }) : a[r[0]]];} + }); + }); + }, e.prototype.convertTensorMapToTensorsMap = function (e) { + return Object.keys(e).reduce(function (t, a) { + return t[a] = [e[a]], t; + }, {}); + }, e.prototype.dispose = function () { + this.executor.dispose(); + }, e; + }();function loadFrozenModel(e, t, a) { + return __awaiter$2(this, void 0, void 0, function () { + var r;return __generator$2(this, function (n) { + switch (n.label) {case 0: + return [4, (r = new FrozenModel(e, t, a)).load()];case 1: + return n.sent(), [2, r];} + }); + }); + }var version$2 = "0.5.5"; + + var version$3 = '0.12.4'; + + var version$4 = { + 'tfjs-core': version, + 'tfjs-layers': version$1, + 'tfjs-converter': version$2, + 'tfjs': version$3 + }; + + exports.version = version$4; + exports.setBackend = setBackend; + exports.getBackend = getBackend; + exports.disposeVariables = disposeVariables; + exports.memory = memory; + exports.version_core = version; + exports.nextFrame = nextFrame; + exports.environment = environment; + exports.io = io; + exports.serialization = serialization; + exports.test_util = test_util; + exports.util = util; + exports.webgl = webgl; + exports.AdadeltaOptimizer = AdadeltaOptimizer; + exports.AdagradOptimizer = AdagradOptimizer; + exports.AdamOptimizer = AdamOptimizer; + exports.AdamaxOptimizer = AdamaxOptimizer; + exports.MomentumOptimizer = MomentumOptimizer; + exports.Optimizer = Optimizer; + exports.RMSPropOptimizer = RMSPropOptimizer; + exports.SGDOptimizer = SGDOptimizer; + exports.Tensor = Tensor; + exports.TensorBuffer = TensorBuffer; + exports.variable = variable; + exports.Variable = Variable; + exports.ENV = ENV; + exports.Environment = Environment; + exports.image = image_ops; + exports.linalg = linalg_ops; + exports.losses = loss_ops; + exports.op = op; + exports.batchNormalization2d = batchNormalization2d; + exports.batchNormalization3d = batchNormalization3d; + exports.batchNormalization4d = batchNormalization4d; + exports.batchNormalization = batchNormalization; + exports.concat = concat; + exports.concat1d = concat1d; + exports.concat2d = concat2d; + exports.concat3d = concat3d; + exports.concat4d = concat4d; + exports.conv1d = conv1d; + exports.conv2d = conv2d; + exports.depthwiseConv2d = depthwiseConv2d; + exports.separableConv2d = separableConv2d; + exports.conv2dTranspose = conv2dTranspose; + exports.matMul = matMul; + exports.dot = dot; + exports.outerProduct = outerProduct; + exports.reverse = reverse; + exports.reverse1d = reverse1d; + exports.reverse2d = reverse2d; + exports.reverse3d = reverse3d; + exports.reverse4d = reverse4d; + exports.maxPool = maxPool; + exports.avgPool = avgPool; + exports.slice = slice; + exports.slice1d = slice1d; + exports.slice2d = slice2d; + exports.slice3d = slice3d; + exports.slice4d = slice4d; + exports.abs = abs; + exports.acos = acos; + exports.acosh = acosh; + exports.asin = asin; + exports.asinh = asinh; + exports.atan = atan; + exports.atanh = atanh; + exports.ceil = ceil; + exports.clipByValue = clipByValue; + exports.cos = cos; + exports.cosh = cosh; + exports.erf = erf; + exports.exp = exp; + exports.expm1 = expm1; + exports.floor = floor; + exports.log = log$1; + exports.log1p = log1p; + exports.logSigmoid = logSigmoid; + exports.neg = neg; + exports.reciprocal = reciprocal; + exports.round = round; + exports.rsqrt = rsqrt; + exports.sigmoid = sigmoid; + exports.sign = sign; + exports.sin = sin; + exports.sinh = sinh; + exports.softplus = softplus; + exports.sqrt = sqrt; + exports.square = square; + exports.step = step; + exports.tan = tan; + exports.tanh = tanh$1; + exports.all = all; + exports.any = any; + exports.argMax = argMax; + exports.argMin = argMin; + exports.logSumExp = logSumExp; + exports.max = max; + exports.mean = mean; + exports.min = min; + exports.moments = moments; + exports.sum = sum; + exports.equal = equal; + exports.equalStrict = equalStrict; + exports.greater = greater; + exports.greaterEqual = greaterEqual; + exports.greaterEqualStrict = greaterEqualStrict; + exports.greaterStrict = greaterStrict; + exports.less = less; + exports.lessEqual = lessEqual; + exports.lessEqualStrict = lessEqualStrict; + exports.lessStrict = lessStrict; + exports.notEqual = notEqual; + exports.notEqualStrict = notEqualStrict; + exports.add = add; + exports.addN = addN; + exports.addStrict = addStrict; + exports.atan2 = atan2; + exports.div = div; + exports.divStrict = divStrict; + exports.floorDiv = floorDiv; + exports.maximum = maximum; + exports.maximumStrict = maximumStrict; + exports.minimum = minimum; + exports.minimumStrict = minimumStrict; + exports.mod = mod; + exports.modStrict = modStrict; + exports.mul = mul; + exports.mulStrict = mulStrict; + exports.pow = pow; + exports.powStrict = powStrict; + exports.squaredDifference = squaredDifference; + exports.squaredDifferenceStrict = squaredDifferenceStrict; + exports.sub = sub; + exports.subStrict = subStrict; + exports.elu = elu; + exports.leakyRelu = leakyRelu; + exports.prelu = prelu; + exports.relu = relu; + exports.selu = selu; + exports.logicalAnd = logicalAnd; + exports.logicalNot = logicalNot; + exports.logicalOr = logicalOr; + exports.logicalXor = logicalXor; + exports.where = where; + exports.whereAsync = whereAsync; + exports.buffer = buffer; + exports.toPixels = toPixels; + exports.print = print; + exports.cast = cast; + exports.clone = clone; + exports.cumsum = cumsum; + exports.expandDims = expandDims; + exports.eye = eye; + exports.fromPixels = fromPixels; + exports.multinomial = multinomial; + exports.oneHot = oneHot; + exports.pad = pad; + exports.pad1d = pad1d; + exports.pad2d = pad2d; + exports.pad3d = pad3d; + exports.pad4d = pad4d; + exports.rand = rand; + exports.randomNormal = randomNormal; + exports.randomUniform = randomUniform; + exports.reshape = reshape; + exports.split = split; + exports.squeeze = squeeze; + exports.stack = stack; + exports.tile = tile; + exports.truncatedNormal = truncatedNormal; + exports.unstack = unstack; + exports.batchToSpaceND = batchToSpaceND; + exports.spaceToBatchND = spaceToBatchND; + exports.fill = fill; + exports.linspace = linspace; + exports.ones = ones$1; + exports.range = range; + exports.scalar = scalar; + exports.tensor = tensor; + exports.tensor1d = tensor1d; + exports.tensor2d = tensor2d; + exports.tensor3d = tensor3d; + exports.tensor4d = tensor4d; + exports.tensor5d = tensor5d; + exports.tensor6d = tensor6d; + exports.zeros = zeros; + exports.onesLike = onesLike; + exports.zerosLike = zerosLike; + exports.transpose = transpose; + exports.softmax = softmax; + exports.localResponseNormalization = localResponseNormalization; + exports.norm = norm; + exports.gather = gather; + exports.unsortedSegmentSum = unsortedSegmentSum; + exports.basicLSTMCell = basicLSTMCell; + exports.multiRNNCell = multiRNNCell; + exports.movingAverage = movingAverage; + exports.stridedSlice = stridedSlice; + exports.topk = topk; + exports.train = train; + exports.tidy = tidy; + exports.keep = keep; + exports.dispose = dispose; + exports.time = time; + exports.customGrad = customGrad; + exports.grad = grad; + exports.grads = grads; + exports.valueAndGrad = valueAndGrad; + exports.valueAndGrads = valueAndGrads; + exports.variableGrads = variableGrads; + exports.constraints = exports_constraints; + exports.initializers = exports_initializers; + exports.layers = exports_layers; + exports.metrics = exports_metrics; + exports.regularizers = exports_regularizers; + exports.CallbackList = CallbackList; + exports.CustomCallback = CustomCallback; + exports.Callback = Callback; + exports.SymbolicTensor = SymbolicTensor; + exports.Model = Model; + exports.input = input; + exports.loadModel = loadModel; + exports.model = model; + exports.sequential = sequential; + exports.RNN = RNN; + exports.Sequential = Sequential; + exports.LayerVariable = LayerVariable; + exports.version_layers = version$1; + exports.FrozenModel = FrozenModel; + exports.loadFrozenModel = loadFrozenModel; + exports.version_converter = version$2; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=tf.js.map diff --git a/node_modules/@tensorflow/tfjs/dist/tf.js.map b/node_modules/@tensorflow/tfjs/dist/tf.js.map new file mode 100644 index 0000000..d7bb1c8 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/tf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tf.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js","../node_modules/@tensorflow/tfjs-layers/dist/tf-layers.esm.js","../node_modules/@tensorflow/tfjs-converter/dist/tf-converter.esm.js","../src/version.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nvar extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0;)r=Math.random()*t|0,n=e[--t],e[t]=e[r],e[r]=n}function clamp(e,t,n){return Math.max(e,Math.min(t,n))}function randUniform(e,t){return Math.random()*(t-e)+e}function distSquared(e,t){for(var n=0,r=0;r0,function(){return\"Element arr[\"+n.join(\"][\")+\"] should be a primitive, but is an array of \"+e.length+\" elements\"}),assert(e.length===t[0],function(){return\"Element arr[\"+n.join(\"][\")+\"] should have \"+t[0]+\" elements, but has \"+e.length+\" elements\"});for(var r=t.slice(1),o=0;o1;--t)if(e%t==0)return[t,e/t];return[1,e]}function createShuffledIndices(e){for(var t=new Uint32Array(e),n=0;n=n?o():setTimeout(i,s)}};i()})}function inferFromImplicitShape(e,t){for(var n=1,r=-1,o=0;o0)n*=e[o];else if(-1===e[o]){if(-1!==r)throw Error(\"Shapes can only have 1 implicit size. Found - 1 at dim \"+r+\" and dim \"+o);r=o}else if(e[o]<=0)throw Error(\"Shapes can not be <= 0. Found \"+e[o]+\" at dim \"+o);if(-1===r){if(t>0&&t!==n)throw Error(\"Size(\"+t+\") must match the product of shape \"+e);return e}if(t%n!=0)throw Error(\"The implicit shape can't be a fractional number. Got \"+t+\" / \"+n);var a=e.slice();return a[r]=t/n,a}function squeezeShape(e,t){for(var n=[],r=[],o=0,a=0;a1)throw new Error(\"Can't squeeze axis \"+a+\" since its dim '\"+e[a]+\"' is not 1\");(null==t[o]||t[o]>a)&&1===e[a]&&(n.push(e[a]),r.push(a)),t[o]<=a&&o++}e[a]>1&&(n.push(e[a]),r.push(a))}return{newShape:n,keptDims:r}}function getTypedArrayFromDType(e,t){var n=null;if(null==e||\"float32\"===e)n=new Float32Array(t);else if(\"int32\"===e)n=new Int32Array(t);else{if(\"bool\"!==e)throw new Error(\"Unknown data type \"+e);n=new Uint8Array(t)}return n}function checkComputationForNaN(e,t,n){if(\"float32\"===t)for(var r=0;r=0;--r)n[r]=n[r+1]*e[r+1];return n}function toTypedArray(e,t,n){return noConversionNeeded(e,t)?e:(Array.isArray(e)&&(e=flatten(e)),copyTypedArray(e,t,n))}function noConversionNeeded(e,t){return e instanceof Float32Array&&\"float32\"===t||e instanceof Int32Array&&\"int32\"===t||e instanceof Uint8Array&&\"bool\"===t}function makeOnesTypedArray(e,t){for(var n=makeZerosTypedArray(e,t),r=0;r=0;a--){i=(m=e[a]).inputs;var h=[];h.push(m.output);for(c=0;c=0;n--){var r=t[n],o=e[r.output.id];if(null==r.gradient)throw new Error(\"Cannot compute gradient: gradient function not found for \"+r.name+\".\");var a=r.gradient(o);for(var i in r.inputs){if(!(i in a))throw new Error(\"Cannot backprop through input \"+i+\". Available gradients found: \"+Object.keys(a)+\".\");var s=a[i](),u=r.inputs[i];if(!arraysEqual(s.shape,u.shape))throw new Error(\"Error in gradient for op \"+r.name+\". The gradient of input '\"+i+\"' has shape '\"+s.shape+\"', which does not match the shape of the input '\"+u.shape+\"'\");if(null==e[u.id])e[u.id]=s;else{var l=e[u.id];e[u.id]=l.add(s),l.dispose()}}}}var FORMAT_LIMIT_NUM_VALS=20,FORMAT_NUM_FIRST_LAST_VALS=3,FORMAT_NUM_SIG_DIGITS=7;function tensorToString(e,t,n,r){var o=computeStrides(t),a=computeMaxSizePerColumn(e,t,o),i=t.length,s=subTensorToString(e,t,o,a),u=[\"Tensor\"];return r&&(u.push(\" dtype: \"+n),u.push(\" rank: \"+i),u.push(\" shape: [\"+t+\"]\"),u.push(\" values:\")),u.push(s.map(function(e){return\" \"+e}).join(\"\\n\")),u.join(\"\\n\")}function computeMaxSizePerColumn(e,t,n){var r=sizeFromShape(t),o=n[n.length-1],a=new Array(o).fill(0);if(t.length>1)for(var i=0;iFORMAT_LIMIT_NUM_VALS){var s=Array.from(e.subarray(0,FORMAT_NUM_FIRST_LAST_VALS)),u=Array.from(e.subarray(a-FORMAT_NUM_FIRST_LAST_VALS,a));return[\"[\"+s.map(function(e,t){return valToString(e,r[t])}).join(\", \")+\", ..., \"+u.map(function(e,t){return valToString(e,r[a-FORMAT_NUM_FIRST_LAST_VALS+t])}).join(\", \")+\"]\"]}return[\"[\"+Array.from(e).map(function(e,t){return valToString(e,r[t])}).join(\", \")+\"]\"]}var l=t.slice(1),c=n.slice(1),p=n[0],d=[];if(a>FORMAT_LIMIT_NUM_VALS){for(var h=0;h {...}) to avoid memory leaks.\");return this.keepTensors.add(e.id),e},e.prototype.startScope=function(e,t){void 0===t&&(t=!1),t&&0===this.gradientScopeCount&&(this.activeTape=[]),t&&this.gradientScopeCount++;var n={track:[],name:\"unnamed scope\"};e&&(n.name=e),this.scopeStack.push(n),this.activeScope=n},e.prototype.endScope=function(e,t){var n=this;void 0===t&&(t=!1),t&&(this.gradientScopeCount--,0===this.gradientScopeCount&&(this.activeTape=null));var r=new Set(this.keepTensors),o=getTensorsInContainer(e);o.forEach(function(e){return r.add(e.id)});for(var a=0;a0,\"gradients() received an empty list of xs.\"),this.tidy(\"gradients\",function(){var a=e();assert(a instanceof Tensor,\"The result y returned by f() must be a tensor.\");var i=getFilteredNodesXToY(o.activeTape,t,a);if(!r&&0===i.length&&t.length>0)throw new Error(\"Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.\");var s={};return s[a.id]=null==n?ones(a.shape):n,backpropagateGradients(s,i),{value:a,grads:t.map(function(e){return s[e.id]})}},!0)},e.prototype.customGrad=function(e){var t=this;return assert(isFunction(e),\"The f passed in customGrad(f) must be a function.\"),function(){for(var n,r,o=[],a=0;a {op();...}); to avoid memory leaks.\");return this.activeScope.track.push(e),e},e}();function ones(e){var t=makeOnesTypedArray(sizeFromShape(e),\"float32\");return Tensor.make(e,{values:t})}!function(e){e[e.NUMBER=0]=\"NUMBER\",e[e.BOOLEAN=1]=\"BOOLEAN\",e[e.STRING=2]=\"STRING\"}(Type||(Type={}));var URL_PROPERTIES=[{name:\"DEBUG\",type:Type.BOOLEAN},{name:\"IS_BROWSER\",type:Type.BOOLEAN},{name:\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\",type:Type.NUMBER},{name:\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\",type:Type.BOOLEAN},{name:\"WEBGL_VERSION\",type:Type.NUMBER},{name:\"WEBGL_RENDER_FLOAT32_ENABLED\",type:Type.BOOLEAN},{name:\"WEBGL_DOWNLOAD_FLOAT_ENABLED\",type:Type.BOOLEAN},{name:\"WEBGL_FENCE_API_ENABLED\",type:Type.BOOLEAN},{name:\"BACKEND\",type:Type.STRING}];function isWebGLVersionEnabled(e,t){var n;try{n=getWebGLRenderingContext(e,t)}catch(e){return!1}return null!=n&&(loseContext(n),!0)}function getWebGLDisjointQueryTimerVersion(e,t){if(0===e)return 0;var n,r=getWebGLRenderingContext(e,t);return n=hasExtension(r,\"EXT_disjoint_timer_query_webgl2\")&&2===e?2:hasExtension(r,\"EXT_disjoint_timer_query\")?1:0,null!=r&&loseContext(r),n}function isRenderToFloatTextureEnabled(e,t){if(0===e)return!1;var n=getWebGLRenderingContext(e,t);if(1===e){if(!hasExtension(n,\"OES_texture_float\"))return!1}else if(!hasExtension(n,\"EXT_color_buffer_float\"))return!1;createFloatTextureAndBindToFramebuffer(n,e);var r=n.checkFramebufferStatus(n.FRAMEBUFFER)===n.FRAMEBUFFER_COMPLETE;return loseContext(n),r}function isDownloadFloatTextureEnabled(e,t){if(0===e)return!1;var n=getWebGLRenderingContext(e,t);if(1===e){if(!hasExtension(n,\"OES_texture_float\"))return!1}else if(!hasExtension(n,\"EXT_color_buffer_float\"))return!1;createFloatTextureAndBindToFramebuffer(n,e),n.readPixels(0,0,1,1,n.RGBA,n.FLOAT,new Float32Array(4));var r=n.getError()===n.NO_ERROR;return loseContext(n),r}function isWebGLFenceEnabled(e,t){if(2!==e)return!1;var n=getWebGLRenderingContext(e,t),r=null!=n.fenceSync;return loseContext(n),r}function isChrome(){return\"undefined\"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}var TENSORFLOWJS_FLAGS_PREFIX=\"tfjsflags\";function getFeaturesFromURL(){var e={};if(\"undefined\"==typeof window||void 0===window.location)return e;var t=getQueryParams(window.location.search);if(TENSORFLOWJS_FLAGS_PREFIX in t){var n={};t[TENSORFLOWJS_FLAGS_PREFIX].split(\",\").forEach(function(e){var t=e.split(\":\"),r=t[0],o=t[1];n[r]=o}),URL_PROPERTIES.forEach(function(t){t.name in n&&(console.log(\"Setting feature override from URL \"+t.name+\": \"+n[t.name]),t.type===Type.NUMBER?e[t.name]=+n[t.name]:t.type===Type.BOOLEAN?e[t.name]=\"true\"===n[t.name]:t.type===Type.STRING?e[t.name]=n[t.name]:console.warn(\"Unknown URL param: \"+t.name+\".\"))})}return e}function hasExtension(e,t){return null!=e.getExtension(t)}function getWebGLRenderingContext(e,t){if(0===e||!t)throw new Error(\"Cannot get WebGL rendering context, WebGL is disabled.\");var n=document.createElement(\"canvas\");return 1===e?n.getContext(\"webgl\")||n.getContext(\"experimental-webgl\"):n.getContext(\"webgl2\")}function loseContext(e){if(null!=e){var t=e.getExtension(\"WEBGL_lose_context\");if(null==t)throw new Error(\"Extension WEBGL_lose_context not supported on this browser.\");t.loseContext()}}function createFloatTextureAndBindToFramebuffer(e,t){var n=e.createFramebuffer(),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);var o=2===t?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,o,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0)}function getQueryParams(e){var t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(e){for(var n=[],r=1;r0?0:getWebGLDisjointQueryTimerVersion(t,this.get(\"IS_BROWSER\"))}if(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\"===e)return this.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0&&!isMobile();if(\"HAS_WEBGL\"===e)return this.get(\"WEBGL_VERSION\")>0;if(\"WEBGL_VERSION\"===e)return isWebGLVersionEnabled(2,this.get(\"IS_BROWSER\"))?2:isWebGLVersionEnabled(1,this.get(\"IS_BROWSER\"))?1:0;if(\"WEBGL_RENDER_FLOAT32_ENABLED\"===e)return isRenderToFloatTextureEnabled(this.get(\"WEBGL_VERSION\"),this.get(\"IS_BROWSER\"));if(\"WEBGL_DOWNLOAD_FLOAT_ENABLED\"===e)return isDownloadFloatTextureEnabled(this.get(\"WEBGL_VERSION\"),this.get(\"IS_BROWSER\"));if(\"WEBGL_FENCE_API_ENABLED\"===e)return isWebGLFenceEnabled(this.get(\"WEBGL_VERSION\"),this.get(\"IS_BROWSER\"));if(\"TEST_EPSILON\"===e)return this.get(\"WEBGL_RENDER_FLOAT32_ENABLED\")?TEST_EPSILON_FLOAT32_ENABLED:TEST_EPSILON_FLOAT32_DISABLED;throw new Error(\"Unknown feature \"+e+\".\")},e.prototype.setFeatures=function(e){this.features=Object.assign({},e)},e.prototype.reset=function(){this.features=getFeaturesFromURL(),null!=this.globalEngine&&(this.globalEngine=null)},e.prototype.initBackend=function(e,t){var n=this;void 0===t&&(t=!1),this.backendName=e,this.backend=this.findBackend(e),this.globalEngine=new Engine(this.backend,t,function(){return n.get(\"DEBUG\")})},e.prototype.findBackend=function(e){return e in this.registry?this.registry[e].backend:null},e.prototype.registerBackend=function(e,t,n,r){var o=this;if(void 0===n&&(n=1),e in this.registry)return console.warn(e+\" backend was already registered. Reusing existing backend\"),null!=r&&r(function(){return o.engine}),!1;try{var a=t();return this.registry[e]={backend:a,priority:n},!0}catch(t){return console.warn(\"Registration of backend \"+e+\" failed\"),console.warn(t.stack||t.message),!1}},e.prototype.removeBackend=function(e){if(!(e in this.registry))throw new Error(e+\" backend not found in registry\");this.registry[e].backend.dispose(),delete this.registry[e]},Object.defineProperty(e.prototype,\"engine\",{get:function(){return this.initDefaultBackend(),this.globalEngine},enumerable:!0,configurable:!0}),e.prototype.initDefaultBackend=function(){null==this.globalEngine&&this.initBackend(this.get(\"BACKEND\"),!1)},e}();function getGlobalNamespace(){var e;if(\"undefined\"!=typeof window)e=window;else{if(\"undefined\"==typeof process)throw new Error(\"Could not find a global object\");e=process}return e}function getOrMakeEnvironment(){var e=getGlobalNamespace();return null==e.ENV&&(e.ENV=new Environment(getFeaturesFromURL()),setTensorTracker(function(){return e.ENV.engine})),e.ENV}var ENV=getOrMakeEnvironment(),environment=Object.freeze({Environment:Environment,ENV:ENV});function warn(){for(var e=[],t=0;t=2*t+1||o%2==1?i.push(o):a.push(o);r.push.apply(r,a),r.push(0),r.push.apply(r,i)}return r}function getReshapedPermuted(e,t,n,r){void 0===r&&(r=!0);var o=[];r?o.push(e[0]/n):o.push(e[0]*n);for(var a=1;a=-n&&et||n===e){r=!0;break}n=nearestDivisor(e,n+1)}return n}function computeOutShape(e,t,n){for(var r=[],o=e.length,a=0;a0?o>=s[t]:o<=s[t]);o+=r[t])n+=1;return n}),[i,l]}function startForAxis(e,t,n,r,o){var a=t[o];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var i=r[o];return a<0&&(a+=i),a=clamp(0,a,i-1)}function stopForAxis(e,t,n,r,o){var a=t[o];e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var i=r[o];return a<0&&(a+=i),a=n[o]>0?clamp(0,a,i):clamp(-1,a,i-1)}function grad(e){return assert(isFunction(e),\"The f passed in grad(f) must be a function\"),function(t,n){return assert(t instanceof Tensor,\"The x passed in grad(f)(x) must be a tensor\"),assert(null==n||n instanceof Tensor,\"The dy passed in grad(f)(x, dy) must be a tensor\"),ENV.engine.tidy(function(){var r=ENV.engine.gradients(function(){return e(t)},[t],n),o=r.value,a=r.grads;return null!=n&&assertShapesMatch(o.shape,n.shape,\"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)\"),checkGrads(a),a[0]})}}function grads(e){return assert(isFunction(e),\"The f passed in grads(f) must be a function\"),function(t,n){return assert(Array.isArray(t)&&t.every(function(e){return e instanceof Tensor}),\"The args passed in grads(f)(args) must be an array of tensors\"),assert(null==n||n instanceof Tensor,\"The dy passed in grads(f)(args, dy) must be a tensor\"),ENV.engine.tidy(function(){var r=ENV.engine.gradients(function(){return e.apply(void 0,t)},t,n),o=r.value,a=r.grads;return null!=n&&assertShapesMatch(o.shape,n.shape,\"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])\"),checkGrads(a),a})}}function valueAndGrad(e){return assert(isFunction(e),\"The f passed in valueAndGrad(f) must be a function\"),function(t,n){assert(t instanceof Tensor,\"The x passed in valueAndGrad(f)(x) must be a tensor\"),assert(null==n||n instanceof Tensor,\"The dy passed in valueAndGrad(f)(x, dy) must be a tensor\");var r=ENV.engine.gradients(function(){return e(t)},[t],n),o=r.grads,a=r.value;return checkGrads(o),{grad:o[0],value:a}}}function valueAndGrads(e){return assert(isFunction(e),\"The f passed in valueAndGrads(f) must be a function\"),function(t,n){assert(Array.isArray(t)&&t.every(function(e){return e instanceof Tensor}),\"The args passed in valueAndGrads(f)(args) must be array of tensors\"),assert(null==n||n instanceof Tensor,\"The dy passed in valueAndGrads(f)(args, dy) must be a tensor\");var r=ENV.engine.gradients(function(){return e.apply(void 0,t)},t,n);return null!=n&&assertShapesMatch(r.value.shape,n.shape,\"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])\"),checkGrads(r.grads),r}}function variableGrads(e,t){if(assert(isFunction(e),\"The f passed in variableGrads(f) must be a function\"),assert(null==t||Array.isArray(t)&&t.every(function(e){return e instanceof Variable}),\"The varList passed in variableGrads(f, varList) must be an array of variables\"),null==t)for(var n in t=[],ENV.engine.registeredVariables)t.push(ENV.engine.registeredVariables[n]);var r=t.length;assert((t=t.filter(function(e){return e.trainable})).length>0,\"variableGrads() expects at least one of the input variables to be trainable, but none of the \"+r+\" variables is trainable.\");var o=ENV.engine.gradients(e,t,null,!0),a=o.value,i=o.grads;assert(i.some(function(e){return null!=e}),\"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().\"),assert(0===a.rank,\"The f passed in variableGrads(f) must return a scalar, but it returned a rank-\"+a.rank+\" tensor\");var s={};return t.forEach(function(e,t){null!=i[t]&&(s[e.name]=i[t])}),{value:a,grads:s}}function customGrad(e){return ENV.engine.customGrad(e)}function checkGrads(e){if(e.filter(function(e){return null==e}).length>0)throw new Error(\"Cannot compute gradient of y=f(x) with respect to x. Make sure that\\n the f you passed encloses all operations that lead from x to y.\")}function convertToTensor(e,t,n,r){if(void 0===r&&(r=\"float32\"),r=r||\"float32\",e instanceof Tensor)return e;if(!isTypedArray(e)&&!Array.isArray(e)&&\"number\"!=typeof e&&\"boolean\"!=typeof e)throw new Error(\"Argument '\"+t+\"' passed to '\"+n+\"' must be a Tensor or TensorLike, but got \"+e.constructor.name);var o=inferShape(e);return isTypedArray(e)||Array.isArray(e)||(e=[e]),Tensor.make(o,{values:toTypedArray(e,r,ENV.get(\"DEBUG\"))},r)}function convertToTensorArray(e,t,n){if(!Array.isArray(e))throw new Error(\"Argument \"+t+\" passed to \"+n+\" must be a `Tensor[]` or `TensorLike[]`\");return e.map(function(e,r){return convertToTensor(e,t+\"[\"+r+\"]\",n)})}function op(e){var t=Object.keys(e);if(1!==t.length)throw new Error(\"Please provide an object with a single key (operation name) mapping to a function. Got an object with \"+t.length+\" keys.\");var n=t[0],r=e[n];n.endsWith(\"_\")&&(n=n.substring(0,n.length-1));var o=function(){for(var e=[],t=0;t1)return zeros([0],r);var o=makeZerosTypedArray(Math.abs(Math.ceil((t-e)/n)),r);to}).sort(function(e,t){return t.score-e.score}),i=[],s=0;s=0;--d){if(intersectionOverUnion(e,c,i[d])>=r){p=!0;break}}if(!p&&(i.push(c),i.length>=n))break}return tensor1d(i,\"int32\")}function intersectionOverUnion(e,t,n){var r=e.subarray(4*t,4*t+4),o=e.subarray(4*n,4*n+4),a=Math.min(r[0],r[2]),i=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),u=Math.max(r[1],r[3]),l=Math.min(o[0],o[2]),c=Math.min(o[1],o[3]),p=Math.max(o[0],o[2]),d=Math.max(o[1],o[3]),h=(s-a)*(u-i),f=(p-l)*(d-c);if(h<=0||f<=0)return 0;var m=Math.max(a,l),g=Math.max(i,c),v=Math.min(s,p),y=Math.min(u,d),x=Math.max(v-m,0)*Math.max(y-g,0);return x/(h+f-x)}function topkImpl(e,t,n,r,o){for(var a=t[t.length-1],i=[e.length/a,a],s=i[0],u=i[1],l=getTypedArrayFromDType(n,s*r),c=getTypedArrayFromDType(\"int32\",s*r),p=0;p\":\"<\",u=n?\"inOffset + i;\":\"round(getBestIndicesA(batch, inOffset + i));\";this.userCode=\"\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int batch = coords[0];\\n int outIdx = coords[1];\\n int inOffset = outIdx * \"+r+\";\\n\\n int bestIndex = 0;\\n float bestValue = getA(batch, inOffset);\\n\\n for (int i = 0; i < \"+r+\"; i++) {\\n int inIdx = \"+u+\";\\n float candidate = getA(batch, inIdx);\\n if (candidate \"+s+\" bestValue) {\\n bestValue = candidate;\\n bestIndex = inIdx;\\n }\\n }\\n setOutput(float(bestIndex));\\n }\\n \"}}(),AvgPool2DBackpropProgram=function(){return function(e){this.variableNames=[\"dy\"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,s=1/(t*n);this.userCode=\"\\n const ivec2 pads = ivec2(\"+a+\", \"+i+\");\\n const float avgMultiplier = float(\"+s+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n\\n ivec2 dyRCCorner = coords.yz - pads;\\n int dyRCorner = dyRCCorner.x;\\n int dyCCorner = dyRCCorner.y;\\n\\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n for (int wR = 0; wR < \"+t+\"; wR++) {\\n float dyR = float(dyRCorner + wR) / \"+r+\".0;\\n\\n if (dyR < 0.0 || dyR >= \"+e.outHeight+\".0 || fract(dyR) > 0.0) {\\n continue;\\n }\\n int idyR = int(dyR);\\n\\n for (int wC = 0; wC < \"+n+\"; wC++) {\\n float dyC = float(dyCCorner + wC) / \"+o+\".0;\\n\\n if (dyC < 0.0 || dyC >= \"+e.outWidth+\".0 ||\\n fract(dyC) > 0.0) {\\n continue;\\n }\\n int idyC = int(dyC);\\n\\n float dyValue = getDy(b, idyR, idyC, d);\\n\\n dotProd += dyValue * avgMultiplier;\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}();function getBroadcastDims(e,t){for(var n=e.length,r=[],o=0;o1&&1===i&&r.unshift(a)}return r}function getReductionAxes(e,t){for(var n=[],r=0;r1)&&n.unshift(a)}return n}function broadcastDimsAreOuter(e){for(var t=0;t1&&s>1&&i!==s)throw Error(r);n.unshift(Math.max(i,s))}return n}var BatchNormProgram=function(){return function(e,t,n,r,o,a){this.outputShape=[],this.supportsBroadcasting=!0,this.variableNames=[\"x\",\"mean\",\"variance\"],assertAndGetBroadcastShape(e,t),assertAndGetBroadcastShape(e,n);var i=\"0.0\";null!=r&&(assertAndGetBroadcastShape(e,r),this.variableNames.push(\"offset\"),i=\"getOffsetAtOutCoords()\");var s=\"1.0\";null!=o&&(assertAndGetBroadcastShape(e,o),this.variableNames.push(\"scale\"),s=\"getScaleAtOutCoords()\"),this.outputShape=e,this.userCode=\"\\n void main() {\\n float x = getXAtOutCoords();\\n float mean = getMeanAtOutCoords();\\n float variance = getVarianceAtOutCoords();\\n float offset = \"+i+\";\\n float scale = \"+s+\";\\n float inv = scale * inversesqrt(variance + float(\"+a+\"));\\n setOutput((x - mean) * inv + offset);\\n }\\n \"}}(),CHECK_NAN_SNIPPET=\"\\n if (isNaN(a)) return a;\\n if (isNaN(b)) return b;\\n\",ADD=\"return a + b;\",SUB=\"return a - b;\",MUL=\"return a * b;\",DIV=\"if (a == b) return 1.0;\\n return a / b;\",INT_DIV=\"\\n float resultSign = sign(a) * sign(b);\\n int ia = round(a);\\n int ib = round(b);\\n int result = ia / ib;\\n int amodb = ia - ib * result;\\n\\n if (resultSign < 0.0 && amodb != 0) {\\n result -= 1;\\n }\\n return float(result);\\n\",POW=\"\\nif(a < 0.0 && floor(b) < b){\\n return NAN;\\n}\\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\\n\",SQUARED_DIFFERENCE=\"return (a - b) * (a - b);\",EQUAL=\"return float(a == b);\",NOT_EQUAL=\"return float(a != b);\",LESS=\"return float(a < b);\",LESS_EQUAL=\"return float(a <= b);\",GREATER=\"return float(a > b);\",GREATER_EQUAL=\"return float(a >= b);\",LOGICAL_AND=\"return float(a >= 1.0 && b >= 1.0);\",LOGICAL_OR=\"return float(a >= 1.0 || b >= 1.0);\",MAX=CHECK_NAN_SNIPPET+\"\\n return max(a, b);\\n\",MIN=CHECK_NAN_SNIPPET+\"\\n return min(a, b);\\n\",MOD=\"if (b == 0.0) return NAN;\\n return mod(a, b);\",ATAN2=CHECK_NAN_SNIPPET+\"\\n return atan(a, b);\\n\",ELU_DER=\"return (b >= 1.0) ? a : a * (b + 1.0);\",BinaryOpProgram=function(){function e(e,t,n){this.variableNames=[\"A\",\"B\"],this.supportsBroadcasting=!0,this.outputShape=assertAndGetBroadcastShape(t,n),this.userCode=\"\\n uniform float NAN;\\n float binaryOperation(float a, float b) {\\n \"+e+\"\\n }\\n\\n void main() {\\n float a = getAAtOutCoords();\\n float b = getBAtOutCoords();\\n setOutput(binaryOperation(a, b));\\n }\\n \"}return e.prototype.getCustomSetupFunc=function(){var e=this;return function(t,n){null==e.startLoc&&(e.startLoc=t.getUniformLocationNoThrow(n,\"NAN\"),null==e.startLoc)||t.gl.uniform1f(e.startLoc,NaN)}},e}(),ClipProgram=function(){return function(e,t,n){this.variableNames=[\"A\"],this.outputShape=e;var r=t.toFixed(20),o=n.toFixed(20);this.userCode=\"\\n void main() {\\n float value = getAAtOutCoords();\\n if (isNaN(value)) {\\n setOutput(value);\\n return;\\n }\\n\\n setOutput(clamp(value, \"+r+\", \"+o+\"));\\n }\\n \"}}();function assertParams(e,t,n){var r=e.length,o=t.length;assert(e.length===t.length,\"Error in concat\"+r+\"D: rank of x1 (\"+r+\") and x2 (\"+o+\") must be the same.\"),assert(n>=0&&n= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int yC = 0; yC < \"+e.outWidth+\"; yC++) {\\n int xC = wC + yC * \"+n+\" - \"+o+\";\\n\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n continue;\\n }\\n\\n float dyValue = getDy(b, yR, yC, d2);\\n float xValue = getX(b, xR, xC, d1);\\n dotProd += (xValue * dyValue);\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),Conv2DDerInputProgram=function(){return function(e){this.variableNames=[\"dy\",\"W\"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left;this.userCode=\"\\n const ivec2 pads = ivec2(\"+a+\", \"+i+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d1 = coords[3];\\n\\n ivec2 dyCorner = coords.yz - pads;\\n int dyRCorner = dyCorner.x;\\n int dyCCorner = dyCorner.y;\\n\\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n for (int wR = 0; wR < \"+t+\"; wR++) {\\n float dyR = float(dyRCorner + wR) / \"+r+\".0;\\n\\n if (dyR < 0.0 || dyR >= \"+e.outHeight+\".0 || fract(dyR) > 0.0) {\\n continue;\\n }\\n int idyR = int(dyR);\\n\\n int wRPerm = \"+t+\" - 1 - wR;\\n\\n for (int wC = 0; wC < \"+n+\"; wC++) {\\n float dyC = float(dyCCorner + wC) / \"+o+\".0;\\n\\n if (dyC < 0.0 || dyC >= \"+e.outWidth+\".0 ||\\n fract(dyC) > 0.0) {\\n continue;\\n }\\n int idyC = int(dyC);\\n\\n int wCPerm = \"+n+\" - 1 - wC;\\n\\n for (int d2 = 0; d2 < \"+e.outChannels+\"; d2++) {\\n float xValue = getDy(batch, idyR, idyC, d2);\\n float wValue = getW(wRPerm, wCPerm, d1, d2);\\n dotProd += xValue * wValue;\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),DepthwiseConv2DDerFilterProgram=function(){return function(e){this.variableNames=[\"x\",\"dy\"],this.outputShape=e.filterShape;var t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,o=e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=\"\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int wR = coords.x;\\n int wC = coords.y;\\n int d1 = coords.z;\\n int dm = coords.w;\\n int d2 = d1 * \"+a+\" + dm;\\n\\n float dotProd = 0.0;\\n\\n // TODO: Vec4 over the batch size\\n for (int b = 0; b < \"+e.batchSize+\"; b++) {\\n for (int yR = 0; yR < \"+e.outHeight+\"; yR++) {\\n int xR = wR + yR * \"+t+\" - \"+r+\";\\n\\n if (xR < 0 || xR >= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int yC = 0; yC < \"+e.outWidth+\"; yC++) {\\n int xC = wC + yC * \"+n+\" - \"+o+\";\\n\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n continue;\\n }\\n\\n float dyValue = getDy(b, yR, yC, d2);\\n float xValue = getX(b, xR, xC, d1);\\n dotProd += (xValue * dyValue);\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),DepthwiseConv2DDerInputProgram=function(){return function(e){this.variableNames=[\"dy\",\"W\"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=\"\\n const ivec2 pads = ivec2(\"+a+\", \"+i+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d1 = coords[3];\\n ivec2 dyCorner = coords.yz - pads;\\n int dyRCorner = dyCorner.x;\\n int dyCCorner = dyCorner.y;\\n\\n float dotProd = 0.0;\\n\\n for (int wR = 0; wR < \"+t+\"; wR++) {\\n float dyR = float(dyRCorner + wR) / \"+r+\".0;\\n\\n if (dyR < 0.0 || dyR >= \"+e.outHeight+\".0 || fract(dyR) > 0.0) {\\n continue;\\n }\\n int idyR = int(dyR);\\n\\n int wRPerm = \"+t+\" - 1 - wR;\\n\\n for (int wC = 0; wC < \"+n+\"; wC++) {\\n float dyC = float(dyCCorner + wC) / \"+o+\".0;\\n\\n if (dyC < 0.0 || dyC >= \"+e.outWidth+\".0 ||\\n fract(dyC) > 0.0) {\\n continue;\\n }\\n int idyC = int(dyC);\\n\\n int wCPerm = \"+n+\" - 1 - wC;\\n\\n // TODO: Vec4 over the channelMul\\n for (int dm = 0; dm < \"+s+\"; dm++) {\\n int d2 = d1 * \"+s+\" + dm;\\n float xValue = getDy(batch, idyR, idyC, d2);\\n float wValue = getW(wRPerm, wCPerm, d1, dm);\\n dotProd += xValue * wValue;\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),Conv2DProgram=function(){return function(e){this.variableNames=[\"x\",\"W\"],this.outputShape=e.outShape;var t=e.padInfo.top,n=e.padInfo.left,r=e.strideHeight,o=e.strideWidth,a=e.dilationHeight,i=e.dilationWidth,s=e.filterHeight,u=e.filterWidth,l=4*Math.floor(e.inChannels/4),c=e.inChannels%4;this.userCode=\"\\n const ivec2 strides = ivec2(\"+r+\", \"+o+\");\\n const ivec2 pads = ivec2(\"+t+\", \"+n+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d2 = coords[3];\\n\\n ivec2 xRCCorner = coords.yz * strides - pads;\\n int xRCorner = xRCCorner.x;\\n int xCCorner = xRCCorner.y;\\n\\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n for (int wR = 0; wR < \"+s+\"; wR++) {\\n int xR = xRCorner + wR * \"+a+\";\\n\\n if (xR < 0 || xR >= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int wC = 0; wC < \"+u+\"; wC++) {\\n int xC = xCCorner + wC * \"+i+\";\\n\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n continue;\\n }\\n\\n for (int d1 = 0; d1 < \"+l+\"; d1 += 4) {\\n vec4 xValues = vec4(\\n getX(batch, xR, xC, d1),\\n getX(batch, xR, xC, d1 + 1),\\n getX(batch, xR, xC, d1 + 2),\\n getX(batch, xR, xC, d1 + 3)\\n );\\n vec4 wValues = vec4(\\n getW(wR, wC, d1, d2),\\n getW(wR, wC, d1 + 1, d2),\\n getW(wR, wC, d1 + 2, d2),\\n getW(wR, wC, d1 + 3, d2)\\n );\\n\\n dotProd += dot(xValues, wValues);\\n }\\n\\n if (\"+(1===c)+\") {\\n dotProd +=\\n getX(batch, xR, xC, \"+l+\") *\\n getW(wR, wC, \"+l+\", d2);\\n } else if (\"+(2===c)+\") {\\n vec2 xValues = vec2(\\n getX(batch, xR, xC, \"+l+\"),\\n getX(batch, xR, xC, \"+l+\" + 1)\\n );\\n vec2 wValues = vec2(\\n getW(wR, wC, \"+l+\", d2),\\n getW(wR, wC, \"+l+\" + 1, d2)\\n );\\n dotProd += dot(xValues, wValues);\\n } else if (\"+(3===c)+\") {\\n vec3 xValues = vec3(\\n getX(batch, xR, xC, \"+l+\"),\\n getX(batch, xR, xC, \"+l+\" + 1),\\n getX(batch, xR, xC, \"+l+\" + 2)\\n );\\n vec3 wValues = vec3(\\n getW(wR, wC, \"+l+\", d2),\\n getW(wR, wC, \"+l+\" + 1, d2),\\n getW(wR, wC, \"+l+\" + 2, d2)\\n );\\n dotProd += dot(xValues, wValues);\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),DepthwiseConv2DProgram=function(){return function(e){this.variableNames=[\"x\",\"W\"],this.outputShape=e.outShape;var t=e.inHeight,n=e.inWidth,r=e.padInfo.top,o=e.padInfo.left,a=e.strideHeight,i=e.strideWidth,s=e.dilationHeight,u=e.dilationWidth,l=e.filterHeight,c=e.filterWidth,p=e.outChannels/e.inChannels;this.userCode=\"\\n const ivec2 strides = ivec2(\"+a+\", \"+i+\");\\n const ivec2 pads = ivec2(\"+r+\", \"+o+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords.x;\\n ivec2 xRCCorner = coords.yz * strides - pads;\\n int d2 = coords.w;\\n int d1 = d2 / \"+p+\";\\n int q = d2 - d1 * \"+p+\";\\n\\n int xRCorner = xRCCorner.x;\\n int xCCorner = xRCCorner.y;\\n\\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\\n for (int wR = 0; wR < \"+l+\"; wR++) {\\n int xR = xRCorner + wR * \"+s+\";\\n\\n if (xR < 0 || xR >= \"+t+\") {\\n continue;\\n }\\n\\n for (int wC = 0; wC < \"+c+\"; wC++) {\\n int xC = xCCorner + wC * \"+u+\";\\n\\n if (xC < 0 || xC >= \"+n+\") {\\n continue;\\n }\\n\\n float xVal = getX(batch, xR, xC, d1);\\n float wVal = getW(wR, wC, d1, q);\\n dotProd += xVal * wVal;\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}();function makeShader(e,t,n,r){var o=e.map(function(e){var t=sizeFromShape(e.shapeInfo.logicalShape);return e.shapeInfo.isUniform?\"uniform float \"+e.name+(t>1?\"[\"+t+\"]\":\"\")+\";\":\"uniform sampler2D \"+e.name+\";\"});o=o.join(\"\\n\");var a=e.map(function(e){return getInputSamplingSnippet(e,t,r)}).join(\"\\n\"),i=t.texShape,s=getOutputSamplingSnippet(t.logicalShape,i);return[SHADER_PREFIX,FLOAT_TEXTURE_SAMPLE_SNIPPET,FLOAT_TEXTURE_SETOUTPUT_SNIPPET,o,s,a,n].join(\"\\n\")}function getSamplerFromInInfo(e){var t=e.shapeInfo.logicalShape;switch(t.length){case 0:return getSamplerScalar(e);case 1:return getSampler1D(e);case 2:return getSampler2D(e);case 3:return getSampler3D(e);case 4:return getSampler4D(e);case 5:return getSampler5D(e);case 6:return getSampler6D(e);default:throw new Error(t.length+\"-D input sampling is not yet supported\")}}function getInputSamplingSnippet(e,t,n){var r=getSamplerFlat(e);return r+=getSamplerFromInInfo(e),(n||arraysEqual(e.shapeInfo.logicalShape,t.logicalShape))&&(r+=getSamplerAtOutputCoords(e,t,n)),r}function getOutputSamplingSnippet(e,t){switch(e.length){case 0:return getOutputScalarCoords();case 1:return getOutput1DCoords(e,t);case 2:return getOutput2DCoords(e,t);case 3:return getOutput3DCoords(e,t);case 4:return getOutput4DCoords(e,t);case 5:return getOutput5DCoords(e,t);case 6:return getOutput6DCoords(e,t);default:throw new Error(e.length+\"-D output sampling is not yet supported\")}}var SAMPLE_1D_SNIPPET=\"\\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_2D_SNIPPET=\"\\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\\n int index = row * numC + col;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_3D_SNIPPET=\"\\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\\n int stride1, int row, int col, int depth) {\\n // Explicitly use integer operations as dot() only works on floats.\\n int index = row * stride0 + col * stride1 + depth;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_4D_SNIPPET=\"\\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\\n int stride1, int stride2, int row, int col, int depth,\\n int depth2) {\\n // Explicitly use integer operations as dot() only works on floats.\\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_5D_SNIPPET=\"\\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\\n int stride1, int stride2, int stride3, int row, int col, int depth,\\n int depth2, int depth3) {\\n // Explicitly use integer operations as dot() only works on floats.\\n int index = row * stride0 + col * stride1 +\\n depth * stride2 + depth2 * stride3 + depth3;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_6D_SNIPPET=\"\\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\\n int stride1, int stride2, int stride3, int stride4,\\n int row, int col, int depth, int depth2, int depth3, int depth4) {\\n // Explicitly use integer operations as dot() only works on floats.\\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\\n stride3 + depth3 * stride4 + depth4;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",FLOAT_TEXTURE_SAMPLE_SNIPPET=\"\\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\\n return texture2D(textureSampler, uv).r;\\n }\\n\",FLOAT_TEXTURE_SETOUTPUT_SNIPPET=\"\\n void setOutput(float val) {\\n gl_FragColor = vec4(val, 0, 0, 0);\\n }\\n\",SHADER_PREFIX=\"\\n precision highp float;\\n precision highp int;\\n varying vec2 resultUV;\\n const vec2 halfCR = vec2(0.5, 0.5);\\n\\n struct ivec5\\n {\\n int x;\\n int y;\\n int z;\\n int w;\\n int u;\\n };\\n\\n struct ivec6\\n {\\n int x;\\n int y;\\n int z;\\n int w;\\n int u;\\n int v;\\n };\\n\\n bool isNaN(float val) {\\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\\n }\\n\\n bool hasNaN(vec4 values) {\\n vec4 v1 = values * values;\\n vec4 v2 = values * values;\\n return any(notEqual(v1, v2));\\n }\\n\\n float getNaN(vec4 values) {\\n return dot(vec4(1), values);\\n }\\n\\n int round(float value) {\\n return int(floor(value + 0.5));\\n }\\n\\n int imod(int x, int y) {\\n return x - y * (x / y);\\n }\\n\\n //Based on the work of Dave Hoskins\\n //https://www.shadertoy.com/view/4djSRW\\n #define HASHSCALE1 443.8975\\n float random(float seed){\\n vec2 p = resultUV * seed;\\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\\n p3 += dot(p3, p3.yzx + 19.19);\\n return fract((p3.x + p3.y) * p3.z);\\n }\\n\\n \"+SAMPLE_1D_SNIPPET+\"\\n \"+SAMPLE_2D_SNIPPET+\"\\n \"+SAMPLE_3D_SNIPPET+\"\\n \"+SAMPLE_4D_SNIPPET+\"\\n \"+SAMPLE_5D_SNIPPET+\"\\n \"+SAMPLE_6D_SNIPPET+\"\\n\";function getOutputScalarCoords(){return\"\\n int getOutputCoords() {\\n return 0;\\n }\\n \"}function getOutput1DCoords(e,t){return 1===t[0]?\"\\n int getOutputCoords() {\\n return int(resultUV.x * \"+t[1]+\".0);\\n }\\n \":1===t[1]?\"\\n int getOutputCoords() {\\n return int(resultUV.y * \"+t[0]+\".0);\\n }\\n \":\"\\n int getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n return resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n }\\n \"}function getOutput3DCoords(e,t){var n=e[1]*e[2],r=e[2];return\"\\n ivec3 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n int r = index / \"+n+\";\\n index -= r * \"+n+\";\\n int c = index / \"+r+\";\\n int d = index - c * \"+r+\";\\n return ivec3(r, c, d);\\n }\\n \"}function getOutput4DCoords(e,t){var n=e[3],r=e[2]*n,o=e[1]*r;return\"\\n ivec4 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n\\n int r = index / \"+o+\";\\n index -= r * \"+o+\";\\n\\n int c = index / \"+r+\";\\n index -= c * \"+r+\";\\n\\n int d = index / \"+n+\";\\n int d2 = index - d * \"+n+\";\\n\\n return ivec4(r, c, d, d2);\\n }\\n \"}function getOutput5DCoords(e,t){var n=e[4],r=e[3]*n,o=e[2]*r,a=e[1]*o;return\"\\n ivec5 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(\"+t[0]+\",\\n \"+t[1]+\"));\\n\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n\\n int r = index / \"+a+\";\\n index -= r * \"+a+\";\\n\\n int c = index / \"+o+\";\\n index -= c * \"+o+\";\\n\\n int d = index / \"+r+\";\\n index -= d * \"+r+\";\\n\\n int d2 = index / \"+n+\";\\n int d3 = index - d2 * \"+n+\";\\n\\n ivec5 outShape = ivec5(r, c, d, d2, d3);\\n return outShape;\\n }\\n \"}function getOutput6DCoords(e,t){var n=e[5],r=e[4]*n,o=e[3]*r,a=e[2]*o,i=e[1]*a;return\"\\n ivec6 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n\\n int r = index / \"+i+\";\\n index -= r * \"+i+\";\\n\\n int c = index / \"+a+\";\\n index -= c * \"+a+\";\\n\\n int d = index / \"+o+\";\\n index -= d * \"+o+\";\\n\\n int d2 = index / \"+r+\";\\n index -= d2 * \"+r+\";\\n\\n int d3 = index / \"+n+\";\\n int d4 = index - d3 * \"+n+\";\\n\\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\\n return result;\\n }\\n \"}function getOutput2DCoords(e,t){return arraysEqual(e,t)?\"\\n ivec2 getOutputCoords() {\\n return ivec2(resultUV.yx * vec2(\"+t[0]+\", \"+t[1]+\"));\\n }\\n \":1===e[1]?\"\\n ivec2 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n return ivec2(index, 0);\\n }\\n \":1===e[0]?\"\\n ivec2 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n return ivec2(0, index);\\n }\\n \":\"\\n ivec2 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n int r = index / \"+e[1]+\";\\n int c = index - r * \"+e[1]+\";\\n return ivec2(r, c);\\n }\\n \"}function getSamplerScalar(e){var t=e.name,n=\"get\"+t.charAt(0).toUpperCase()+t.slice(1);return e.shapeInfo.isUniform?\"float \"+n+\"() {return \"+t+\";}\":\"\\n float \"+n+\"() {\\n return sampleTexture(\"+t+\", halfCR);\\n }\\n \"}function getSampler1D(e){var t=e.name,n=\"get\"+t.charAt(0).toUpperCase()+t.slice(1);return\"\\n float \"+n+\"(int index) {\\n return \"+n+\"Flat(index);\\n }\\n \"}function getSampler2D(e){var t=e.shapeInfo.logicalShape,n=e.name,r=\"get\"+n.charAt(0).toUpperCase()+n.slice(1),o=e.shapeInfo.texShape;if(null!=o&&arraysEqual(t,o)){var a=o[0];return\"\\n float \"+r+\"(int row, int col) {\\n vec2 uv = (vec2(col, row) + halfCR) / vec2(\"+o[1]+\".0, \"+a+\".0);\\n return sampleTexture(\"+n+\", uv);\\n }\\n \"}var i=squeezeShape(t),s=i.newShape,u=i.keptDims,l=s;if(l.length=1?\"coords = 0;\":s.map(function(e){return\"coords[\"+(e+u)+\"] = 0;\"}).join(\"\\n\"))+\"\\n return get\"+n+\"(\"+(a<2&&o>0?\"coords\":e.shapeInfo.logicalShape.map(function(e,t){return\"coords[\"+(t+u)+\"]\"}).join(\", \"))+\");\\n }\\n \"}function getSamplerAtOutputCoords(e,t,n){var r=e.name,o=r.charAt(0).toUpperCase()+r.slice(1),a=\"get\"+o+\"AtOutCoords\",i=getBroadcastDims(e.shapeInfo.logicalShape,t.logicalShape),s=e.shapeInfo.logicalShape.length,u=t.logicalShape.length,l=n&&(u>s||i.length>0),c=broadcastDimsAreOuter(i),p=e.shapeInfo.isUniform;if(l&&!c)return getBroadcastOutputCoordsSampler(e,t,o,a);var d=sizeFromShape(e.shapeInfo.logicalShape),h=\"\";l&&c&&(h=\"\\n int mainPart = index / \"+d+\";\\n index -= mainPart * \"+d+\";\\n \");var f=t.texShape;if(p)return 1===d?\"float \"+a+\"() {return \"+r+\";}\":\"\\n float \"+a+\"() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+f[0]+\", \"+f[1]+\"));\\n int index = resTexRC.x * \"+f[1]+\" + resTexRC.y;\\n \"+h+\"\\n return get\"+o+\"Flat(index);\\n }\\n \";var m=e.shapeInfo.texShape;return arraysEqual(m,f)?\"\\n float \"+a+\"() {\\n return sampleTexture(\"+r+\", resultUV);\\n }\\n \":\"\\n float \"+a+\"() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+f[0]+\", \"+f[1]+\"));\\n int index = resTexRC.x * \"+f[1]+\" + resTexRC.y;\\n \"+h+\"\\n int texR = index / \"+m[1]+\";\\n int texC = index - texR * \"+m[1]+\";\\n vec2 uv = (vec2(texC, texR) + halfCR) /\\n vec2(\"+m[1]+\".0, \"+m[0]+\".0);\\n\\n return sampleTexture(\"+r+\", uv);\\n }\\n \"}function getCoordsDataType(e){if(e<=1)return\"int\";if(2===e)return\"ivec2\";if(3===e)return\"ivec3\";if(4===e)return\"ivec4\";if(5===e)return\"ivec5\";if(6===e)return\"ivec6\";throw Error(\"GPU for rank \"+e+\" is not yet supported\")}function squeezeInputInfo(e,t){var n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function getSqueezedParams(e,t){return t.map(function(t){return e[t]}).join(\", \")}var CumSumProgram=function(){return function(e,t,n){this.variableNames=[\"x\"],this.outputShape=e;var r=e.length,o=e[e.length-1],a=n?\"<\":\">\";this.userCode=\"\\n int getIndex(int i) {\\n \"+(n?\"return \"+o+\" -i - 1;\":\"return i;\")+\"\\n }\\n\\n void main() {\\n \"+getCoordsDataType(r)+\" coords = getOutputCoords();\\n int end = \"+getFinalCoord(r,\"coords\")+\";\\n float val = 0.0;\\n for (int i = \"+o+\" - 1; i >= 0; i -= 1) {\\n int idx = getIndex(i);\\n if (idx \"+a+\" end) {\\n continue;\\n }\\n if (idx == end && \"+t+\") {\\n continue;\\n }\\n \"+getFinalCoord(r,\"coords\")+\" = idx;\\n val += getX(\"+getCoords(r,\"coords\")+\");\\n }\\n setOutput(val);\\n }\\n \"}}();function getCoords(e,t){if(1===e)return\"\"+t;if(2===e)return t+\".x, \"+t+\".y\";if(3===e)return t+\".x, \"+t+\".y, \"+t+\".z\";if(4===e)return t+\".x, \"+t+\".y, \"+t+\".z, \"+t+\".w\";throw Error(\"Cumulative sum for rank \"+e+\" is not yet supported\")}function getFinalCoord(e,t){if(1===e)return\"\"+t;if(2===e)return t+\".y\";if(3===e)return t+\".z\";if(4===e)return t+\".w\";throw Error(\"Cumulative sum for rank \"+e+\" is not yet supported\")}var TextureUsage,PhysicalTextureType,EncodeFloatProgram=function(){return function(e){this.variableNames=[\"A\"],this.outputShape=e,this.userCode=\"\\n const float FLOAT_MAX = 1.70141184e38;\\n const float FLOAT_MIN = 1.17549435e-38;\\n\\n lowp vec4 encode_float(highp float v) {\\n if (isNaN(v)) {\\n return vec4(255, 255, 255, 255);\\n }\\n\\n highp float av = abs(v);\\n\\n if(av < FLOAT_MIN) {\\n return vec4(0.0, 0.0, 0.0, 0.0);\\n } else if(v > FLOAT_MAX) {\\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\\n } else if(v < -FLOAT_MAX) {\\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\\n }\\n\\n highp vec4 c = vec4(0,0,0,0);\\n\\n highp float e = floor(log2(av));\\n highp float m = exp2(fract(log2(av))) - 1.0;\\n\\n c[2] = floor(128.0 * m);\\n m -= c[2] / 128.0;\\n c[1] = floor(32768.0 * m);\\n m -= c[1] / 32768.0;\\n c[0] = floor(8388608.0 * m);\\n\\n highp float ebias = e + 127.0;\\n c[3] = floor(ebias / 2.0);\\n ebias -= c[3] * 2.0;\\n c[2] += floor(ebias) * 128.0;\\n\\n c[3] += 128.0 * step(0.0, -v);\\n\\n return c / 255.0;\\n }\\n\\n void main() {\\n float x = getAAtOutCoords();\\n gl_FragColor = encode_float(x);\\n }\\n \"}}(),FromPixelsProgram=function(){return function(e){this.variableNames=[\"A\"];var t=e[0],n=e[1];this.outputShape=e,this.userCode=\"\\n void main() {\\n ivec3 coords = getOutputCoords();\\n int texR = coords[0];\\n int texC = coords[1];\\n int depth = coords[2];\\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(\"+n+\".0, \"+t+\".0);\\n\\n vec4 values = texture2D(A, uv);\\n float value;\\n if (depth == 0) {\\n value = values.r;\\n } else if (depth == 1) {\\n value = values.g;\\n } else if (depth == 2) {\\n value = values.b;\\n } else if (depth == 3) {\\n value = values.a;\\n }\\n\\n setOutput(floor(value * 255.0 + 0.5));\\n }\\n \"}}(),GatherProgram=function(){return function(e,t,n){this.variableNames=[\"A\",\"indices\"];var r=e.slice();r[n]=t,this.outputShape=r,this.rank=r.length;var o=getCoordsDataType(this.rank),a=getSourceCoords(e,n);this.userCode=\"\\n void main() {\\n \"+o+\" resRC = getOutputCoords();\\n setOutput(getA(\"+a+\"));\\n }\\n \"}}();function getSourceCoords(e,t){var n=e.length;if(n>4)throw Error(\"Gather for rank \"+n+\" is not yet supported\");if(1===n)return\"int(getIndices(resRC))\";for(var r=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],o=[],a=0;a= \"+r);for(var o=0,a=0;a= \"+r);for(var o=0,a=0;a= \"+o);for(var a=getPackedMatrixTextureShapeWidthHeight(t,n),i=a[0],s=a[1],u=n%2==1,l=t%2==1,c=Math.floor(n/2),p=Math.floor(t/2),d=u?4:0,h=n,f=0,m=0;m= \"+o);for(var a=n%2==1,i=t%2==1,s=Math.floor(n/2),u=Math.floor(t/2),l=getPackedMatrixTextureShapeWidthHeight(t,n),c=l[0],p=l[1],d=a?4:0,h=n+(a?1:0),f=0,m=0,g=n,v=0;vr||n>r){o=\"[\"+t+\"x\"+n+\"]\";throw new Error(\"Requested texture size \"+o+\" greater than WebGL maximum on this browser / GPU \"+(\"[\"+r+\"x\"+r+\"]\")+\".\")}}function createFramebuffer(e){return throwIfNull(e,function(){return e.createFramebuffer()},\"Unable to create WebGLFramebuffer.\")}function bindVertexBufferToProgramAttribute(e,t,n,r,o,a,i){var s=e.getAttribLocation(t,n);return-1!==s&&(callAndCheck(e,function(){return e.bindBuffer(e.ARRAY_BUFFER,r)}),callAndCheck(e,function(){return e.vertexAttribPointer(s,o,e.FLOAT,!1,a,i)}),callAndCheck(e,function(){return e.enableVertexAttribArray(s)}),!0)}function bindTextureUnit(e,t,n){validateTextureUnit(e,n),callAndCheck(e,function(){return e.activeTexture(e.TEXTURE0+n)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)})}function unbindTextureUnit(e,t){validateTextureUnit(e,t),callAndCheck(e,function(){return e.activeTexture(e.TEXTURE0+t)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function getProgramUniformLocationOrThrow(e,t,n){return throwIfNull(e,function(){return e.getUniformLocation(t,n)},'uniform \"'+n+'\" not present in program.')}function getProgramUniformLocation(e,t,n){return e.getUniformLocation(t,n)}function bindTextureToProgramUniformSampler(e,t,n,r,o){callAndCheck(e,function(){return bindTextureUnit(e,n,o)}),callAndCheck(e,function(){return e.uniform1i(r,o)})}function bindCanvasToFramebuffer(e){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,null)}),callAndCheck(e,function(){return e.viewport(0,0,e.canvas.width,e.canvas.height)}),callAndCheck(e,function(){return e.scissor(0,0,e.canvas.width,e.canvas.height)})}function bindColorTextureToFramebuffer(e,t,n){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,n)}),callAndCheck(e,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)})}function unbindColorTextureFromFramebuffer(e,t){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,t)}),callAndCheck(e,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)})}function validateFramebuffer(e){var t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error(\"Error binding framebuffer: \"+getFramebufferErrorMessage(e,t))}function getFramebufferErrorMessage(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\";case e.FRAMEBUFFER_UNSUPPORTED:return\"FRAMEBUFFER_UNSUPPORTED\";default:return\"unknown error \"+t}}function throwIfNull(e,t,n){var r=callAndCheck(e,function(){return t()});if(null==r)throw new Error(n);return r}function validateTextureUnit(e,t){var n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(rn)throw new Error(\"textureUnit must be in \"+(\"[gl.TEXTURE0, gl.TEXTURE\"+n+\"]\")+\".\")}function getTextureShapeFromLogicalShape(e,t){2!==t.length&&(t=squeezeShape(t).newShape);var n=queryMaxTextureSize(e),r=sizeFromShape(t);return t.length<=1&&r<=n?[r,1]:2===t.length&&t[0]<=n&&t[1]<=n?t:3===t.length&&t[0]<=n&&t[1]*t[2]<=n?[t[0],t[1]*t[2]]:4===t.length&&t[0]<=n&&t[1]*t[2]*t[3]<=n?[t[0],t[1]*t[2]*t[3]]:sizeToSquarishShape(r)}var webgl_util=Object.freeze({createWebGLRenderingContext:createWebGLRenderingContext,createWebGLRenderingContextFromCanvas:createWebGLRenderingContextFromCanvas,callAndCheck:callAndCheck,enableDebugWebGLErrorChecking:enableDebugWebGLErrorChecking,checkWebGLError:checkWebGLError,getWebGLErrorMessage:getWebGLErrorMessage,getExtensionOrThrow:getExtensionOrThrow,createVertexShader:createVertexShader,createFragmentShader:createFragmentShader,createProgram:createProgram,linkProgram:linkProgram,validateProgram:validateProgram,createStaticVertexBuffer:createStaticVertexBuffer,createStaticIndexBuffer:createStaticIndexBuffer,queryMaxTextureSize:queryMaxTextureSize,getNumChannels:getNumChannels,createTexture:createTexture,validateTextureSize:validateTextureSize,createFramebuffer:createFramebuffer,bindVertexBufferToProgramAttribute:bindVertexBufferToProgramAttribute,bindTextureUnit:bindTextureUnit,unbindTextureUnit:unbindTextureUnit,getProgramUniformLocationOrThrow:getProgramUniformLocationOrThrow,getProgramUniformLocation:getProgramUniformLocation,bindTextureToProgramUniformSampler:bindTextureToProgramUniformSampler,bindCanvasToFramebuffer:bindCanvasToFramebuffer,bindColorTextureToFramebuffer:bindColorTextureToFramebuffer,unbindColorTextureFromFramebuffer:unbindColorTextureFromFramebuffer,validateFramebuffer:validateFramebuffer,getFramebufferErrorMessage:getFramebufferErrorMessage,getTextureShapeFromLogicalShape:getTextureShapeFromLogicalShape});function getWebGLContextAttributes(){return{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0}}function createWebGLContext(e){var t,n=getWebGLContextAttributes();return callAndCheck(t=null!=e?createWebGLRenderingContextFromCanvas(e,n):createWebGLRenderingContext(n),function(){return t.disable(t.DEPTH_TEST)}),callAndCheck(t,function(){return t.disable(t.STENCIL_TEST)}),callAndCheck(t,function(){return t.disable(t.BLEND)}),callAndCheck(t,function(){return t.disable(t.DITHER)}),callAndCheck(t,function(){return t.disable(t.POLYGON_OFFSET_FILL)}),callAndCheck(t,function(){return t.disable(t.SAMPLE_COVERAGE)}),callAndCheck(t,function(){return t.enable(t.SCISSOR_TEST)}),callAndCheck(t,function(){return t.enable(t.CULL_FACE)}),callAndCheck(t,function(){return t.cullFace(t.BACK)}),t}function createVertexShader$1(e){return createVertexShader(e,\"\\n precision highp float;\\n attribute vec3 clipSpacePos;\\n attribute vec2 uv;\\n varying vec2 resultUV;\\n\\n void main() {\\n gl_Position = vec4(clipSpacePos, 1);\\n resultUV = uv;\\n }\")}function createVertexBuffer(e){return createStaticVertexBuffer(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function createIndexBuffer(e){return createStaticIndexBuffer(e,new Uint16Array([0,1,2,2,1,3]))}function getTextureConfig(e,t){var n,r,o,a,i,s,u,l=e;return 2===ENV.get(\"WEBGL_VERSION\")?(n=l.R32F,r=l.R16F,o=l.RGBA32F,a=l.RED,i=4,s=1,u=l.HALF_FLOAT):(n=e.RGBA,r=e.RGBA,o=l.RGBA,a=e.RGBA,i=4,s=4,u=null!=t?t.HALF_FLOAT_OES:null),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedFloat:o,textureFormatFloat:a,downloadTextureFormat:e.RGBA,downloadUnpackNumChannels:i,defaultNumChannels:s,textureTypeHalfFloat:u}}function createAndConfigureTexture(e,t,n,r,o,a){validateTextureSize(e,t,n);var i=createTexture(e),s=e.TEXTURE_2D;return callAndCheck(e,function(){return e.bindTexture(s,i)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_MIN_FILTER,e.NEAREST)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_MAG_FILTER,e.NEAREST)}),callAndCheck(e,function(){return e.texImage2D(s,0,r,t,n,0,o,a,null)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)}),i}function createFloat32MatrixTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],r.internalFormatFloat,r.textureFormatFloat,e.FLOAT)}function createFloat16MatrixTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],r.internalFormatFloat,r.textureFormatFloat,r.textureTypeHalfFloat)}function createUnsignedBytesMatrixTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],e.RGBA,e.RGBA,e.UNSIGNED_BYTE)}function createPackedMatrixTexture(e,t,n,r){var o=getPackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],r.internalFormatPackedFloat,e.RGBA,e.FLOAT)}function bindVertexProgramAttributeStreams(e,t,n){return callAndCheck(e,function(){return e.bindBuffer(e.ARRAY_BUFFER,n)}),bindVertexBufferToProgramAttribute(e,t,\"clipSpacePos\",n,3,20,0)&&bindVertexBufferToProgramAttribute(e,t,\"uv\",n,2,20,12)}function uploadPixelDataToTexture(e,t,n){callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)}),callAndCheck(e,function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function uploadDataToTexture(e,t,n,r,o,a){validateTextureSize(e,n,r),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)}),callAndCheck(e,function(){return e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,r,a,e.FLOAT,o)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function uploadMatrixToTexture(e,t,n,r,o,a,i){var s,u=getUnpackedMatrixTextureShapeWidthHeight(n,r),l=u[0],c=u[1];1===i.defaultNumChannels?s=o:encodeMatrixToUnpackedArray(o,s=new Float32Array(getUnpackedArraySizeFromMatrixSize(o.length,a)),a),uploadDataToTexture(e,t,l,c,s,i.textureFormatFloat)}function uploadMatrixToPackedTexture(e,t,n,r,o,a){var i=getPackedMatrixTextureShapeWidthHeight(n,r),s=i[0],u=i[1],l=new Float32Array(getPackedRGBAArraySizeFromMatrixShape(n,r));encodeMatrixToPackedRGBA(o,n,r,l),uploadDataToTexture(e,t,s,u,l,e.RGBA)}function maybeCreateBufferFromOutputTexture(e,t,n,r,o){var a=t;if(2===ENV.get(\"WEBGL_VERSION\")){var i=e,s=i.createBuffer();callAndCheck(e,function(){return e.bindBuffer(i.PIXEL_PACK_BUFFER,s)});var u=4*getUnpackedArraySizeFromMatrixSize(n*r,o.downloadUnpackNumChannels);callAndCheck(e,function(){return e.bufferData(i.PIXEL_PACK_BUFFER,u,e.STATIC_DRAW)}),callAndCheck(e,function(){return i.readPixels(0,0,r,n,e.RGBA,e.FLOAT,0)}),callAndCheck(e,function(){return e.bindBuffer(i.PIXEL_PACK_BUFFER,null)}),a=s}return a}function downloadFloat32MatrixFromBuffer(e,t,n,r,o){var a=e,i=new Float32Array(getUnpackedArraySizeFromMatrixSize(n*r,o.downloadUnpackNumChannels));a.bindBuffer(e.ARRAY_BUFFER,t),a.getBufferSubData(e.ARRAY_BUFFER,0,i),a.bindBuffer(e.ARRAY_BUFFER,null);var s=new Float32Array(n*r);return decodeMatrixFromUnpackedArray(i,s,o.downloadUnpackNumChannels),s}function downloadFloat32MatrixFromOutputTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n),a=o[0],i=o[1],s=new Float32Array(getUnpackedArraySizeFromMatrixSize(t*n,r.downloadUnpackNumChannels));callAndCheck(e,function(){return e.readPixels(0,0,a,i,r.downloadTextureFormat,e.FLOAT,s)});var u=new Float32Array(t*n);return decodeMatrixFromUnpackedArray(s,u,r.downloadUnpackNumChannels),u}function downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n),a=o[0],i=o[1],s=new Uint8Array(getUnpackedArraySizeFromMatrixSize(t*n,4));return callAndCheck(e,function(){return e.readPixels(0,0,a,i,r.downloadTextureFormat,e.UNSIGNED_BYTE,s)}),new Float32Array(s.buffer)}function downloadMatrixFromPackedOutputTexture(e,t,n,r){var o=getPackedMatrixTextureShapeWidthHeight(t,n),a=o[0],i=o[1],s=new Float32Array(getPackedRGBAArraySizeFromMatrixShape(t,n));callAndCheck(e,function(){return e.readPixels(0,0,a,i,e.RGBA,e.FLOAT,s)});var u=new Float32Array(t*n);return decodeMatrixFromPackedRGBA(s,t,n,u)}var gpgpu_util=Object.freeze({getWebGLContextAttributes:getWebGLContextAttributes,createWebGLContext:createWebGLContext,createVertexShader:createVertexShader$1,createVertexBuffer:createVertexBuffer,createIndexBuffer:createIndexBuffer,getTextureConfig:getTextureConfig,createFloat32MatrixTexture:createFloat32MatrixTexture,createFloat16MatrixTexture:createFloat16MatrixTexture,createUnsignedBytesMatrixTexture:createUnsignedBytesMatrixTexture,createPackedMatrixTexture:createPackedMatrixTexture,bindVertexProgramAttributeStreams:bindVertexProgramAttributeStreams,uploadPixelDataToTexture:uploadPixelDataToTexture,uploadMatrixToTexture:uploadMatrixToTexture,uploadMatrixToPackedTexture:uploadMatrixToPackedTexture,maybeCreateBufferFromOutputTexture:maybeCreateBufferFromOutputTexture,downloadFloat32MatrixFromBuffer:downloadFloat32MatrixFromBuffer,downloadFloat32MatrixFromOutputTexture:downloadFloat32MatrixFromOutputTexture,downloadByteEncodedFloatMatrixFromOutputTexture:downloadByteEncodedFloatMatrixFromOutputTexture,downloadMatrixFromPackedOutputTexture:downloadMatrixFromPackedOutputTexture}),GPGPUContext=function(){function e(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.autoDebugValidate=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[],this.gl=null!=e?e:createWebGLContext(),1===ENV.get(\"WEBGL_VERSION\")?(this.textureFloatExtension=getExtensionOrThrow(this.gl,\"OES_texture_float\"),this.colorBufferFloatExtension=this.gl.getExtension(\"WEBGL_color_buffer_float\"),ENV.get(\"WEBGL_RENDER_FLOAT32_ENABLED\")||(this.textureHalfFloatExtension=getExtensionOrThrow(this.gl,\"OES_texture_half_float\"),this.colorBufferHalfFloatExtension=this.gl.getExtension(\"EXT_color_buffer_half_float\"))):this.colorBufferFloatExtension=getExtensionOrThrow(this.gl,\"EXT_color_buffer_float\"),this.loseContextExtension=getExtensionOrThrow(this.gl,\"WEBGL_lose_context\"),this.vertexBuffer=createVertexBuffer(this.gl),this.indexBuffer=createIndexBuffer(this.gl),this.framebuffer=createFramebuffer(this.gl),this.textureConfig=getTextureConfig(this.gl,this.textureHalfFloatExtension)}return e.prototype.dispose=function(){var e=this;if(!this.disposed){null!=this.program&&console.warn(\"Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing.\"),null!=this.outputTexture&&console.warn(\"Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.\");var t=this.gl;callAndCheck(t,function(){return t.finish()}),callAndCheck(t,function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)}),callAndCheck(t,function(){return t.deleteFramebuffer(e.framebuffer)}),callAndCheck(t,function(){return t.bindBuffer(t.ARRAY_BUFFER,null)}),callAndCheck(t,function(){return t.deleteBuffer(e.vertexBuffer)}),callAndCheck(t,function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}),callAndCheck(t,function(){return t.deleteBuffer(e.indexBuffer)}),this.loseContextExtension.loseContext(),this.disposed=!0}},e.prototype.enableAutomaticDebugValidation=function(e){this.autoDebugValidate=e,enableDebugWebGLErrorChecking(e)},e.prototype.createFloat32MatrixTexture=function(e,t){return this.throwIfDisposed(),createFloat32MatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.createFloat16MatrixTexture=function(e,t){return this.throwIfDisposed(),createFloat16MatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.createUnsignedBytesMatrixTexture=function(e,t){return this.throwIfDisposed(),createUnsignedBytesMatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.uploadPixelDataToTexture=function(e,t){this.throwIfDisposed(),uploadPixelDataToTexture(this.gl,e,t)},e.prototype.createPackedMatrixTexture=function(e,t){return this.throwIfDisposed(),createPackedMatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.deleteMatrixTexture=function(e){var t=this;this.throwIfDisposed(),this.outputTexture===e&&(unbindColorTextureFromFramebuffer(this.gl,this.framebuffer),this.outputTexture=null),callAndCheck(this.gl,function(){return t.gl.deleteTexture(e)})},e.prototype.uploadMatrixToTexture=function(e,t,n,r){this.throwIfDisposed();var o=getNumChannels();return uploadMatrixToTexture(this.gl,e,t,n,r,o,this.textureConfig)},e.prototype.uploadMatrixToPackedTexture=function(e,t,n,r){return this.throwIfDisposed(),uploadMatrixToPackedTexture(this.gl,e,t,n,r,this.textureConfig)},e.prototype.downloadFloat32MatrixFromOutputTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return downloadFloat32MatrixFromOutputTexture(r.gl,t,n,r.textureConfig)})},e.prototype.downloadByteEncodedFloatMatrixFromOutputTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return downloadByteEncodedFloatMatrixFromOutputTexture(r.gl,t,n,r.textureConfig)})},e.prototype.downloadFloat32MatrixFromBuffer=function(e,t,n){return downloadFloat32MatrixFromBuffer(this.gl,e,t,n,this.textureConfig)},e.prototype.maybeCreateBufferFromTexture=function(e,t,n){this.bindTextureToFrameBuffer(e);var r=maybeCreateBufferFromOutputTexture(this.gl,e,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r},e.prototype.createAndWaitForFence=function(){var e=this.createFence(this.gl);return this.pollFence(e)},e.prototype.createFence=function(e){var t,n,r=this;if(ENV.get(\"WEBGL_FENCE_API_ENABLED\")){var o=e,a=o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=function(){var e=o.clientWaitSync(a,0,0);return e===o.ALREADY_SIGNALED||e===o.CONDITION_SATISFIED},t=a}else ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0?(t=this.beginQuery(),this.endQuery(),n=function(){return r.isQueryAvailable(t,ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))}):n=function(){return!0};return{query:t,isFencePassed:n}},e.prototype.downloadMatrixFromPackedTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return downloadMatrixFromPackedOutputTexture(r.gl,t,n,r.textureConfig)})},e.prototype.createProgram=function(e){this.throwIfDisposed();var t=this.gl,n=createFragmentShader(t,e),r=createVertexShader$1(t),o=createProgram(t);return callAndCheck(t,function(){return t.attachShader(o,r)}),callAndCheck(t,function(){return t.attachShader(o,n)}),linkProgram(t,o),this.autoDebugValidate&&validateProgram(t,o),this.vertexAttrsAreBound||(this.setProgram(o),this.vertexAttrsAreBound=bindVertexProgramAttributeStreams(t,this.program,this.vertexBuffer)),o},e.prototype.deleteProgram=function(e){var t=this;this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&callAndCheck(this.gl,function(){return t.gl.deleteProgram(e)})},e.prototype.setProgram=function(e){var t=this;this.throwIfDisposed(),this.program=e,null!=this.program&&this.autoDebugValidate&&validateProgram(this.gl,this.program),callAndCheck(this.gl,function(){return t.gl.useProgram(e)})},e.prototype.getUniformLocation=function(e,t,n){return void 0===n&&(n=!0),this.throwIfDisposed(),n?getProgramUniformLocationOrThrow(this.gl,e,t):getProgramUniformLocation(this.gl,e,t)},e.prototype.getAttributeLocation=function(e,t){var n=this;return this.throwIfDisposed(),callAndCheck(this.gl,function(){return n.gl.getAttribLocation(e,t)})},e.prototype.getUniformLocationNoThrow=function(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)},e.prototype.setInputMatrixTexture=function(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),bindTextureToProgramUniformSampler(this.gl,this.program,e,t,n)},e.prototype.setOutputMatrixTexture=function(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)},e.prototype.setOutputPackedMatrixTexture=function(e,t,n){this.throwIfDisposed();var r=getPackedMatrixTextureShapeWidthHeight(t,n),o=r[0],a=r[1];this.setOutputMatrixTextureDriver(e,o,a)},e.prototype.setOutputMatrixWriteRegion=function(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)},e.prototype.setOutputPackedMatrixWriteRegion=function(e,t,n,r){throw new Error(\"setOutputPackedMatrixWriteRegion not implemented.\")},e.prototype.debugValidate=function(){null!=this.program&&validateProgram(this.gl,this.program),validateFramebuffer(this.gl)},e.prototype.executeProgram=function(){this.throwIfDisposed(),this.throwIfNoProgram();var e=this.gl;this.autoDebugValidate&&this.debugValidate(),callAndCheck(e,function(){return e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)})},e.prototype.blockUntilAllProgramsCompleted=function(){var e=this;this.throwIfDisposed(),callAndCheck(this.gl,function(){return e.gl.finish()})},e.prototype.getQueryTimerExtension=function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=getExtensionOrThrow(this.gl,2===ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")?\"EXT_disjoint_timer_query_webgl2\":\"EXT_disjoint_timer_query\")),this.disjointQueryTimerExtension},e.prototype.getQueryTimerExtensionWebGL2=function(){return this.getQueryTimerExtension()},e.prototype.getQueryTimerExtensionWebGL1=function(){return this.getQueryTimerExtension()},e.prototype.beginQuery=function(){if(2===ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")){var e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}var r=this.getQueryTimerExtensionWebGL1(),o=r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT,o),o},e.prototype.endQuery=function(){if(2!==ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")){var e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}else{var t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT)}},e.prototype.waitForQueryAndGetTime=function(e){return __awaiter(this,void 0,void 0,function(){var t=this;return __generator(this,function(n){switch(n.label){case 0:return[4,repeatedTry(function(){return t.isQueryAvailable(e,ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))})];case 1:return n.sent(),[2,this.getQueryTime(e,ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))]}})})},e.prototype.getQueryTime=function(e,t){if(0===t)return null;if(2===t){var n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}var r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(e,r.QUERY_RESULT_EXT)/1e6},e.prototype.isQueryAvailable=function(e,t){if(0===t)return!0;if(2===t){var n=this.gl,r=this.getQueryTimerExtensionWebGL2(),o=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),o&&!this.disjoint}o=(r=this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(e,r.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),o&&!this.disjoint},e.prototype.pollFence=function(e){var t=this;return new Promise(function(n){t.addItemToPoll(function(){return e.isFencePassed()},function(){return n()})})},e.prototype.pollItems=function(){for(var e=binSearchLastTrue(this.itemsToPoll.map(function(e){return e.isDoneFn})),t=0;t<=e;++t){(0,this.itemsToPoll[t].resolveFn)()}this.itemsToPoll=this.itemsToPoll.slice(e+1)},e.prototype.addItemToPoll=function(e,t){var n=this;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||repeatedTry(function(){return n.pollItems(),0===n.itemsToPoll.length})},e.prototype.bindTextureToFrameBuffer=function(e){this.throwIfDisposed(),bindColorTextureToFramebuffer(this.gl,e,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(this.gl)},e.prototype.unbindTextureToFrameBuffer=function(){null!=this.outputTexture?(bindColorTextureToFramebuffer(this.gl,this.outputTexture,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(this.gl)):unbindColorTextureFromFramebuffer(this.gl,this.framebuffer)},e.prototype.downloadMatrixDriver=function(e,t){this.bindTextureToFrameBuffer(e);var n=t();return this.unbindTextureToFrameBuffer(),n},e.prototype.setOutputMatrixTextureDriver=function(e,t,n){this.throwIfDisposed();var r=this.gl;bindColorTextureToFramebuffer(r,e,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(r),this.outputTexture=e,callAndCheck(r,function(){return r.viewport(0,0,t,n)}),callAndCheck(r,function(){return r.scissor(0,0,t,n)})},e.prototype.setOutputMatrixWriteRegionDriver=function(e,t,n,r){var o=this;this.throwIfDisposed(),callAndCheck(this.gl,function(){return o.gl.scissor(e,t,n,r)})},e.prototype.throwIfDisposed=function(){if(this.disposed)throw new Error(\"Attempted to use disposed GPGPUContext.\")},e.prototype.throwIfNoProgram=function(){if(null==this.program)throw new Error(\"No GPU program is currently set.\")},e}();function binSearchLastTrue(e){for(var t=0,n=e.length-1,r=-1;t<=n;){var o=t+n>>1;e[o]()?(r=o,t=o+1):n=o-1}return r}function compileProgram(e,t,n,r){for(var o=t.userCode,a=n.map(function(e,n){var r={logicalShape:e.tensor.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform};return{name:t.variableNames[n],shapeInfo:r}}),i=a.map(function(e){return e.shapeInfo}),s={logicalShape:r.tensor.shape,texShape:r.texData.texShape,isUniform:!1},u=makeShader(a,s,o,!0===t.supportsBroadcasting),l=e.createProgram(u),c={},p=0;p= 0 && idx <= \"+s+\") {\\n float z = getX(b, r, c, idx);\\n sum += z * z;\\n }\\n }\\n float val = x * \"+a+\";\\n setOutput(val);\\n }\\n \"}}(),LRNGradProgram=function(){return function(e,t,n,r,o){this.variableNames=[\"inputImage\",\"outputImage\",\"dy\"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=r,this.beta=o,this.userCode=\"\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int r = coords[1];\\n int c = coords[2];\\n\\n float result = 0.0;\\n for (int d = 0; d < \"+this.depth+\"; ++d) {\\n int depthBegin = int(max(0.0, float(d - \"+t+\")));\\n int depthEnd = int(min(float(\"+this.depth+\"),\\n float(d + \"+t+\" + 1)));\\n\\n const int MIN_DEPTH_BEGIN = 0;\\n const int MAX_DEPTH_END = \"+this.depth+\";\\n\\n float norm = 0.0;\\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\\n if (k < depthBegin){\\n continue;\\n }\\n else if (k >= depthBegin && k < depthEnd) {\\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\\n }\\n else {\\n break;\\n }\\n }\\n\\n norm = float(\"+r+\") * norm + float(\"+n+\");\\n\\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\\n if (k < depthBegin){\\n continue;\\n }\\n else if (k >= depthBegin && k < depthEnd){\\n float dyi = -2.0 * float(\"+r+\")\\n * float(\"+o+\")\\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\\n / norm;\\n if (k == d) {\\n dyi += pow(norm, -1.0 * \"+o+\");\\n }\\n if (k == coords[3]) {\\n dyi *= getDy(b, r, c, d);\\n result += dyi;\\n }\\n }\\n else {\\n break;\\n }\\n }\\n }\\n setOutput(result);\\n }\\n \"}}(),MaxPool2DBackpropProgram=function(){return function(e){this.variableNames=[\"dy\",\"maxPos\"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,s=t*n-1;this.userCode=\"\\n const ivec2 pads = ivec2(\"+a+\", \"+i+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n\\n ivec2 dyRCCorner = coords.yz - pads;\\n int dyRCorner = dyRCCorner.x;\\n int dyCCorner = dyRCCorner.y;\\n\\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n for (int wR = 0; wR < \"+t+\"; wR++) {\\n float dyR = float(dyRCorner + wR) / \"+r+\".0;\\n\\n if (dyR < 0.0 || dyR >= \"+e.outHeight+\".0 || fract(dyR) > 0.0) {\\n continue;\\n }\\n int idyR = int(dyR);\\n\\n for (int wC = 0; wC < \"+n+\"; wC++) {\\n float dyC = float(dyCCorner + wC) / \"+o+\".0;\\n\\n if (dyC < 0.0 || dyC >= \"+e.outWidth+\".0 ||\\n fract(dyC) > 0.0) {\\n continue;\\n }\\n int idyC = int(dyC);\\n\\n float dyValue = getDy(b, idyR, idyC, d);\\n int maxPosValue = \"+s+\" - int(getMaxPos(b, idyR, idyC, d));\\n\\n // Get the current value, check it against the value from the\\n // position matrix.\\n int curPosValue = wR * \"+n+\" + wC;\\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\\n\\n dotProd += dyValue * mask;\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),MatMulProgram=function(){return function(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1),this.variableNames=[\"matrixA\",\"matrixB\"];var o=n?e[1]:e[0],a=r?t[0]:t[1],i=n?e[0]:e[1];this.outputShape=[o,a];var s=function(e,t){return n?t+\" + \"+e+\", aRow\":\"aRow, \"+t+\" + \"+e},u=function(e,t){return r?\"bCol, \"+t+\" + \"+e:t+\" + \"+e+\", bCol\"},l=4*Math.floor(i/4),c=i%4;this.userCode=\" float dotARowBCol(int aRow, int bCol) {\\n float result = 0.0;\\n for (int i = 0; i < \"+l+\"; i += 4) {\\n vec4 a = vec4(\\n getMatrixA(\"+s(0,\"i\")+\"),\\n getMatrixA(\"+s(1,\"i\")+\"),\\n getMatrixA(\"+s(2,\"i\")+\"),\\n getMatrixA(\"+s(3,\"i\")+\")\\n );\\n vec4 b = vec4(\\n getMatrixB(\"+u(0,\"i\")+\"),\\n getMatrixB(\"+u(1,\"i\")+\"),\\n getMatrixB(\"+u(2,\"i\")+\"),\\n getMatrixB(\"+u(3,\"i\")+\")\\n );\\n\\n result += dot(a, b);\\n }\\n\\n if (\"+(1===c)+\") {\\n result += getMatrixA(\"+s(0,l)+\") *\\n getMatrixB(\"+u(0,l)+\");\\n } else if (\"+(2===c)+\") {\\n vec2 a = vec2(\\n getMatrixA(\"+s(0,l)+\"),\\n getMatrixA(\"+s(1,l)+\")\\n );\\n vec2 b = vec2(\\n getMatrixB(\"+u(0,l)+\"),\\n getMatrixB(\"+u(1,l)+\")\\n );\\n result += dot(a, b);\\n } else if (\"+(3===c)+\") {\\n vec3 a = vec3(\\n getMatrixA(\"+s(0,l)+\"),\\n getMatrixA(\"+s(1,l)+\"),\\n getMatrixA(\"+s(2,l)+\")\\n );\\n vec3 b = vec3(\\n getMatrixB(\"+u(0,l)+\"),\\n getMatrixB(\"+u(1,l)+\"),\\n getMatrixB(\"+u(2,l)+\")\\n );\\n result += dot(a, b);\\n }\\n\\n return result;\\n }\\n\\n void main() {\\n ivec2 resRC = getOutputCoords();\\n setOutput(dotARowBCol(resRC.x, resRC.y));\\n }\\n \"}}(),MultinomialProgram=function(){function e(e,t,n){this.variableNames=[\"probs\"],this.outputShape=[e,n],this.userCode=\"\\n uniform float seed;\\n\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int batch = coords[0];\\n\\n float r = random(seed);\\n float cdf = 0.0;\\n\\n for (int i = 0; i < \"+(t-1)+\"; i++) {\\n cdf += getProbs(batch, i);\\n\\n if (r < cdf) {\\n setOutput(float(i));\\n return;\\n }\\n }\\n\\n // If no other event happened, last event happened.\\n setOutput(float(\"+(t-1)+\"));\\n }\\n \"}return e.prototype.getCustomSetupFunc=function(e){var t=this;return function(n,r){null==t.seedLoc&&(t.seedLoc=n.getUniformLocation(r,\"seed\")),n.gl.uniform1f(t.seedLoc,e)}},e}(),OneHotProgram=function(){return function(e,t,n,r){this.variableNames=[\"indices\"],this.outputShape=[e,t],this.userCode=\"\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int index = round(getIndices(coords.x));\\n setOutput(mix(float(\"+r+\"), float(\"+n+\"),\\n float(index == coords.y)));\\n }\\n \"}}(),PadProgram=function(){return function(e,t,n){this.variableNames=[\"x\"],this.outputShape=t.map(function(t,n){return t[0]+e[n]+t[1]});var r=e.length,o=getCoordsDataType(r),a=t.map(function(e){return e[0]}).join(\",\"),i=t.map(function(t,n){return t[0]+e[n]}).join(\",\"),s=[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,r);this.userCode=1!==r?\"\\n \"+o+\" start = \"+o+\"(\"+a+\");\\n \"+o+\" end = \"+o+\"(\"+i+\");\\n\\n void main() {\\n \"+o+\" outC = getOutputCoords();\\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\\n setOutput(float(\"+n+\"));\\n } else {\\n \"+o+\" coords = outC - start;\\n setOutput(getX(\"+s+\"));\\n }\\n }\\n \":\"\\n int start = \"+a+\";\\n int end = \"+i+\";\\n\\n void main() {\\n int outC = getOutputCoords();\\n if (outC < start || outC >= end) {\\n setOutput(float(\"+n+\"));\\n } else {\\n setOutput(getX(outC - start));\\n }\\n }\\n \"}}(),Pool2DProgram=function(){return function(e,t,n){if(this.variableNames=[\"x\"],\"avg\"===t&&n)throw new Error(\"Cannot compute positions for average pool.\");var r=e.filterHeight,o=e.filterWidth,a=e.strideHeight,i=e.strideWidth,s=e.padInfo.top,u=e.padInfo.left;this.outputShape=e.outShape;var l=\"avg\"===t,c=\"0.0\";if(l||(c=\"-1.0 / 0.0\"),n)this.userCode=\"\\n const ivec2 strides = ivec2(\"+a+\", \"+i+\");\\n const ivec2 pads = ivec2(\"+s+\", \"+u+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d = coords[3];\\n\\n ivec2 xRCCorner = coords.yz * strides - pads;\\n int xRCorner = xRCCorner.x;\\n int xCCorner = xRCCorner.y;\\n\\n // max/min x(?, ?, d) to get y(yR, yC, d).\\n // ? = to be determined\\n float minMaxValue = 0.0;\\n float minMaxValueFound = 0.0;\\n int minMaxPosition = 0;\\n float avgValue = 0.0;\\n\\n for (int wR = 0; wR < \"+r+\"; wR++) {\\n int xR = xRCorner + wR;\\n\\n if (xR < 0 || xR >= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int wC = 0; wC < \"+o+\"; wC++) {\\n int xC = xCCorner + wC;\\n\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n continue;\\n }\\n\\n float value = getX(batch, xR, xC, d);\\n\\n // If a min / max value has already been found, use it. If not,\\n // use the current value.\\n float currMinMaxValue = mix(\\n value, minMaxValue, minMaxValueFound);\\n if (value >= currMinMaxValue) {\\n minMaxValue = value;\\n minMaxValueFound = 1.0;\\n minMaxPosition = wR * \"+o+\" + wC;\\n }\\n }\\n }\\n setOutput(float(minMaxPosition));\\n }\\n \";else{var p=t+\"(\"+t+\"(\"+t+\"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])\";\"avg\"===t&&(p=\"avgValue / count\");var d=4*Math.floor(o/4),h=o%4,f=\"\\n if (\"+l+\") {\\n avgValue += dot(values, ones);\\n } else {\\n minMaxValue = max(values, minMaxValue);\\n }\\n \";this.userCode=\"\\n const ivec2 strides = ivec2(\"+a+\", \"+i+\");\\n const ivec2 pads = ivec2(\"+s+\", \"+u+\");\\n const float initializationValue = \"+c+\";\\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\\n\\n float count = 0.0;\\n\\n float getValue(int batch, int xR, int xC, int d) {\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n return initializationValue;\\n }\\n count += 1.0;\\n return getX(batch, xR, xC, d);\\n }\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d = coords[3];\\n\\n ivec2 xRCCorner = coords.yz * strides - pads;\\n int xRCorner = xRCCorner.x;\\n int xCCorner = xRCCorner.y;\\n\\n // max/min x(?, ?, d) to get y(yR, yC, d).\\n // ? = to be determined\\n vec4 minMaxValue = vec4(\"+c+\");\\n float avgValue = 0.0;\\n count = 0.0;\\n\\n for (int wR = 0; wR < \"+r+\"; wR++) {\\n int xR = xRCorner + wR;\\n\\n if (xR < 0 || xR >= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int wC = 0; wC < \"+d+\"; wC += 4) {\\n int xC = xCCorner + wC;\\n\\n vec4 values = vec4(\\n getValue(batch, xR, xC, d),\\n getValue(batch, xR, xC + 1, d),\\n getValue(batch, xR, xC + 2, d),\\n getValue(batch, xR, xC + 3, d)\\n );\\n\\n \"+f+\"\\n }\\n\\n int xC = xCCorner + \"+d+\";\\n if (\"+(1===h)+\") {\\n vec4 values = vec4(\\n getValue(batch, xR, xC, d),\\n initializationValue,\\n initializationValue,\\n initializationValue\\n );\\n\\n \"+f+\"\\n } else if (\"+(2===h)+\") {\\n vec4 values = vec4(\\n getValue(batch, xR, xC, d),\\n getValue(batch, xR, xC + 1, d),\\n initializationValue,\\n initializationValue\\n );\\n\\n \"+f+\"\\n } else if (\"+(3===h)+\") {\\n vec4 values = vec4(\\n getValue(batch, xR, xC, d),\\n getValue(batch, xR, xC + 1, d),\\n getValue(batch, xR, xC + 2, d),\\n initializationValue\\n );\\n\\n \"+f+\"\\n }\\n }\\n setOutput(\"+p+\");\\n }\\n \"}}}(),ReduceProgram=function(){return function(e,t){this.variableNames=[\"x\"];var n=e.windowSize,r=e.batchSize,o=e.inSize,a=Math.ceil(o/n);this.outputShape=[r,a];var i=\"0.0\",s=\"\";\"min\"===t?(i=\"1.0 / 0.0\",s=\"min\"):\"max\"===t&&(i=\"-1.0 / 0.0\",s=\"max\");var u=t+\"(\"+t+\"(\"+t+\"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])\";\"sum\"===t?u=\"sumValue\":\"all\"===t?u=\"allValue\":\"any\"===t&&(u=\"anyValue\");var l=4*Math.floor(n/4),c=n%4,p=\"\\n if (\"+(\"sum\"===t)+\") {\\n sumValue += dot(values, ones);\\n } else {\\n minMaxValue = \"+s+\"(values, minMaxValue);\\n }\\n \",d=\"vec4\";\"all\"===t?(i=\"1.0\",p=\"\\n bool reducedAllValue = all(values);\\n float floatedReducedAllValue = float(reducedAllValue);\\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\\n \",d=\"bvec4\"):\"any\"===t&&(i=\"0.0\",p=\"\\n bool reducedAnyValue = any(values);\\n float floatedReducedAnyValue = float(reducedAnyValue);\\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\\n \",d=\"bvec4\");var h=\"\";o%n>0&&(h=\"\\n if (inIdx < 0 || inIdx >= \"+o+\") {\\n return initializationValue;\\n }\\n \"),this.userCode=\"\\n const float initializationValue = \"+i+\";\\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\\n\\n float getValue(int batch, int inIdx) {\\n \"+h+\"\\n return getX(batch, inIdx);\\n }\\n\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int batch = coords[0];\\n int outIdx = coords[1];\\n int inOffset = outIdx * \"+n+\";\\n\\n vec4 minMaxValue = vec4(\"+i+\");\\n float sumValue = 0.0;\\n float allValue = 1.0;\\n float anyValue = 0.0;\\n\\n for (int i = 0; i < \"+l+\"; i += 4) {\\n int inIdx = inOffset + i;\\n \"+d+\" values = \"+d+\"(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n getValue(batch, inIdx + 2),\\n getValue(batch, inIdx + 3)\\n );\\n\\n \"+p+\"\\n }\\n\\n int inIdx = inOffset + \"+l+\";\\n if (\"+(1===c)+\") {\\n \"+d+\" values = \"+d+\"(\\n getValue(batch, inIdx),\\n initializationValue,\\n initializationValue,\\n initializationValue\\n );\\n\\n \"+p+\"\\n } else if (\"+(2===c)+\") {\\n \"+d+\" values = \"+d+\"(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n initializationValue,\\n initializationValue\\n );\\n\\n \"+p+\"\\n } else if (\"+(3===c)+\") {\\n \"+d+\" values = \"+d+\"(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n getValue(batch, inIdx + 2),\\n initializationValue\\n );\\n\\n \"+p+\"\\n }\\n setOutput(\"+u+\");\\n }\\n \"}}(),ResizeBilinearBackpropProgram=function(){return function(e,t,n){this.variableNames=[\"dy\"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,o=r[1],a=r[2],i=e.shape,s=i[1],u=i[2],l=[n&&s>1?o-1:o,n&&u>1?a-1:a],c=[n&&s>1?s-1:s,n&&u>1?u-1:u],p=l[0]/c[0],d=l[1]/c[1],h=1/p,f=1/d,m=2*Math.ceil(h)+2,g=2*Math.ceil(f)+2;this.userCode=\"\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n int r = coords[1];\\n int c = coords[2];\\n\\n float accumulator = 0.0;\\n\\n const float heightScale = float(\"+p+\");\\n const float widthScale = float(\"+d+\");\\n\\n const float invHeightScale = float(\"+h+\");\\n const float invWidthScale = float(\"+f+\");\\n\\n const int winHeight = int(\"+m+\");\\n const int winWidth = int(\"+g+\");\\n\\n // Compute bounds for where in dy we will look\\n float startRLerp = floor(float(r) * invHeightScale);\\n int startDyR = int(startRLerp - float(winHeight / 2));\\n\\n float startCLerp = floor(float(c) * invWidthScale);\\n int startDyC = int(startCLerp - float(winWidth / 2));\\n\\n // Loop over dy\\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\\n int dyR = dyROffset + startDyR;\\n\\n // Guard against the window exceeding the bounds of dy\\n if (dyR < 0 || dyR >= \"+s+\") {\\n continue;\\n }\\n\\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\\n int dyC = dyCOffset + startDyC;\\n\\n // Guard against the window exceeding the bounds of dy\\n if (dyC < 0 || dyC >= \"+u+\") {\\n continue;\\n }\\n\\n float dxR = float(dyR) * heightScale;\\n int topDxRIndex = int(floor(dxR));\\n int bottomDxRIndex = int(min(ceil(dxR), \"+(o-1)+\".0));\\n float dxRLerp = dxR - float(topDxRIndex);\\n float inverseDxRLerp = 1.0 - dxRLerp;\\n\\n float dxC = float(dyC) * widthScale;\\n int leftDxCIndex = int(floor(dxC));\\n int rightDxCIndex = int(min(ceil(dxC), \"+(a-1)+\".0));\\n float dxCLerp = dxC - float(leftDxCIndex);\\n float inverseDxCLerp = 1.0 - dxCLerp;\\n\\n if (r == topDxRIndex && c == leftDxCIndex) {\\n // topLeft\\n accumulator +=\\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\\n }\\n\\n if (r == topDxRIndex && c == rightDxCIndex) {\\n // topRight\\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\\n }\\n\\n if (r == bottomDxRIndex && c == leftDxCIndex) {\\n // bottomLeft\\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\\n }\\n\\n if (r == bottomDxRIndex && c == rightDxCIndex) {\\n // bottomRight\\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\\n }\\n }\\n }\\n // End loop over dy\\n\\n setOutput(accumulator);\\n }\\n \"}}(),ResizeBilinearProgram=function(){return function(e,t,n,r){this.variableNames=[\"A\"],this.outputShape=[];var o=e[0],a=e[1],i=e[2],s=e[3];this.outputShape=[o,t,n,s];var u=[r&&t>1?a-1:a,r&&n>1?i-1:i],l=[r&&t>1?t-1:t,r&&n>1?n-1:n];this.userCode=\"\\n const vec2 effectiveInputOverOutputRatioRC = vec2(\\n \"+u[0]/l[0]+\",\\n \"+u[1]/l[1]+\");\\n const vec2 inputShapeRC = vec2(\"+a+\".0, \"+i+\".0);\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n ivec2 yRC = coords.yz;\\n\\n // Fractional source index.\\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\\n\\n // Compute the four integer indices.\\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\\n ivec2 sourceCeilRC = ivec2(\\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\\n\\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\\n\\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\\n\\n float top = topLeft + (topRight - topLeft) * fracRC.y;\\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\\n float newValue = top + (bottom - top) * fracRC.x;\\n\\n setOutput(newValue);\\n }\\n \"}}(),ResizeNearestNeigborBackpropProgram=function(){return function(e,t,n){this.variableNames=[\"dy\"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,o=r[1],a=r[2],i=e.shape,s=i[1],u=i[2],l=[n&&s>1?o-1:o,n&&u>1?a-1:a],c=[n&&s>1?s-1:s,n&&u>1?u-1:u],p=l[0]/c[0],d=l[1]/c[1],h=1/p,f=1/d,m=2*Math.ceil(h)+2,g=2*Math.ceil(f)+2;this.userCode=\"\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n int r = coords[1];\\n int c = coords[2];\\n\\n float accumulator = 0.0;\\n\\n const float heightScale = float(\"+p+\");\\n const float widthScale = float(\"+d+\");\\n\\n const float invHeightScale = float(\"+h+\");\\n const float invWidthScale = float(\"+f+\");\\n\\n const int winHeight = int(\"+m+\");\\n const int winWidth = int(\"+g+\");\\n\\n // Compute bounds for where in dy we will look\\n float startRLerp = floor(float(r) * invHeightScale);\\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\\n\\n float startCLerp = floor(float(c) * invWidthScale);\\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\\n\\n // Loop over dy\\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\\n int dyR = dyROffset + startDyR;\\n\\n // Guard against the window exceeding the bounds of dy\\n if (dyR < 0 || dyR >= \"+s+\") {\\n continue;\\n }\\n\\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\\n int dyC = dyCOffset + startDyC;\\n\\n // Guard against the window exceeding the bounds of dy\\n if (dyC < 0 || dyC >= \"+u+\") {\\n continue;\\n }\\n\\n float sourceFracRow =\\n float(\"+l[0]+\") *\\n (float(dyR) / float(\"+c[0]+\"));\\n\\n float sourceFracCol =\\n float(\"+l[1]+\") *\\n (float(dyC) / float(\"+c[1]+\"));\\n\\n int sourceNearestRow = int(min(\\n float(int(\"+o+\") - 1),\\n \"+n+\" ? float(round(sourceFracRow)) :\\n float(floor(sourceFracRow))));\\n\\n int sourceNearestCol = int(min(\\n float(int(\"+a+\") - 1),\\n \"+n+\" ? float(round(sourceFracCol)) :\\n float(floor(sourceFracCol))));\\n\\n if (r == sourceNearestRow && c == sourceNearestCol) {\\n accumulator += getDy(b, dyR, dyC, d);\\n }\\n }\\n }\\n // End loop over dy\\n\\n setOutput(accumulator);\\n }\\n \"}}(),ResizeNearestNeighborProgram=function(){return function(e,t,n,r){this.variableNames=[\"A\"],this.outputShape=[];var o=e[0],a=e[1],i=e[2],s=e[3];this.outputShape=[o,t,n,s];var u=[r&&t>1?a-1:a,r&&n>1?i-1:i],l=[r&&t>1?t-1:t,r&&n>1?n-1:n],c=r?\"0.5\":\"0.0\";this.userCode=\"\\n const vec2 effectiveInputOverOutputRatioRC = vec2(\\n \"+u[0]/l[0]+\",\\n \"+u[1]/l[1]+\");\\n const vec2 inputShapeRC = vec2(\"+a+\".0, \"+i+\".0);\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n ivec2 yRC = coords.yz;\\n\\n // Fractional source index.\\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\\n\\n // Compute the coordinators of nearest neighbor point.\\n ivec2 sourceNearestRC = ivec2(\\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + \"+c+\")));\\n\\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\\n\\n setOutput(newValue);\\n }\\n \"}}(),ReverseProgram=function(){return function(e,t){this.variableNames=[\"x\"];var n=e.length;if(n>4)throw new Error(\"WebGL backend: Reverse of rank-\"+n+\" tensor is not yet supported\");if(this.outputShape=e,1!==n){var r=e.map(function(n,r){return function(n){return-1!==t.indexOf(n)&&1!==e[n]?e[n]+\" - coords[\"+n+\"] - 1\":\"coords[\"+n+\"]\"}(r)}).join(\",\"),o=getCoordsDataType(n);this.userCode=\"\\n void main() {\\n \"+o+\" coords = getOutputCoords();\\n setOutput(getX(\"+r+\"));\\n }\\n \"}else this.userCode=\"\\n void main() {\\n int coord = getOutputCoords();\\n setOutput(getX(\"+e[0]+\" - coord - 1));\\n }\\n \"}}(),SegmentOpProgram=function(){return function(e,t){this.variableNames=[\"x\",\"segmentIds\"];var n=e.windowSize,r=e.batchSize,o=e.inSize,a=e.numSegments,i=a*Math.ceil(o/n);this.outputShape=[r,i];var s=4*Math.floor(n/4),u=n%4,l=\"\\n sumValue += dot(values, filter);\\n \",c=\"\";o%n>0&&(c=\"\\n if (inIdx < 0 || inIdx >= \"+o+\") {\\n return initializationValue;\\n }\\n \");var p=\"\";o%n>0&&(p=\"\\n if (inIdx < 0 || inIdx >= \"+o+\") {\\n return -1.0;\\n }\\n \"),this.userCode=\"\\n const float initializationValue = 0.0;\\n\\n float getValue(int batch, int inIdx) {\\n \"+c+\"\\n return getX(batch, inIdx);\\n }\\n\\n float getSegmentIdAtIndex(int inIdx) {\\n \"+p+\"\\n return getSegmentIds(inIdx);\\n }\\n\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int batch = coords[0];\\n int outIdx = coords[1];\\n int inOffset = int(floor(float(outIdx) / float(\\n \"+a+\")) * float(\"+n+\"));\\n int currentSeg = int(mod(float(outIdx), float(\"+a+\")));\\n\\n float sumValue = 0.0;\\n\\n for (int i = 0; i < \"+s+\"; i += 4) {\\n int inIdx = inOffset + i;\\n vec4 values = vec4(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n getValue(batch, inIdx + 2),\\n getValue(batch, inIdx + 3)\\n );\\n\\n vec4 filter = vec4(\\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\\n );\\n\\n \"+l+\"\\n }\\n\\n int inIdx = inOffset + \"+s+\";\\n if (\"+(1===u)+\") {\\n vec4 values = vec4(\\n getValue(batch, inIdx),\\n initializationValue,\\n initializationValue,\\n initializationValue\\n );\\n\\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\\n\\n vec4 filter = vec4(\\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\\n 0,\\n 0,\\n 0\\n );\\n\\n \"+l+\"\\n } else if (\"+(2===u)+\") {\\n vec4 values = vec4(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n initializationValue,\\n initializationValue\\n );\\n\\n vec4 filter = vec4(\\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\\n 0,\\n 0\\n );\\n\\n \"+l+\"\\n } else if (\"+(3===u)+\") {\\n vec4 values = vec4(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n getValue(batch, inIdx + 2),\\n initializationValue\\n );\\n\\n vec4 filter = vec4(\\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\\n 0\\n );\\n\\n \"+l+\"\\n }\\n setOutput(sumValue);\\n }\\n \"}}(),SelectProgram=function(){return function(e,t,n){var r,o;if(this.variableNames=[\"c\",\"a\",\"b\"],this.outputShape=t,n>4)throw Error(\"Where for rank \"+n+\" is not yet supported\");if(1===n)o=\"resRC\",r=\"resRC\";else{for(var a=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],i=[],s=[],u=0;u= 1.0) {\\n setOutput(getA(\"+o+\"));\\n } else {\\n setOutput(getB(\"+o+\"));\\n }\\n }\\n \"}}(),SliceProgram=function(){function e(e){this.variableNames=[\"source\"],this.outputShape=e,this.rank=e.length;var t=getCoordsDataType(this.rank),n=getCoords$1(this.rank);this.userCode=\"\\n uniform \"+t+\" start;\\n\\n void main() {\\n \"+t+\" sourceLoc = start + getOutputCoords();\\n setOutput(getSource(\"+n+\"));\\n }\\n \"}return e.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error(\"The rank (\"+this.rank+\") of the program must match the length of start (\"+e.length+\")\");return function(n,r){if(null!=t.startLoc||(t.startLoc=n.getUniformLocationNoThrow(r,\"start\"),null!=t.startLoc))if(1===t.rank)n.gl.uniform1i(t.startLoc,e[0]);else if(2===t.rank)n.gl.uniform2i(t.startLoc,e[0],e[1]);else if(3===t.rank)n.gl.uniform3i(t.startLoc,e[0],e[1],e[2]);else{if(4!==t.rank)throw Error(\"Slicing for rank \"+t.rank+\" is not yet supported\");n.gl.uniform4i(t.startLoc,e[0],e[1],e[2],e[3])}}},e}();function getCoords$1(e){if(1===e)return\"sourceLoc\";if(2===e)return\"sourceLoc.x, sourceLoc.y\";if(3===e)return\"sourceLoc.x, sourceLoc.y, sourceLoc.z\";if(4===e)return\"sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w\";throw Error(\"Slicing for rank \"+e+\" is not yet supported\")}var StridedSliceProgram=function(){return function(e,t,n){this.variableNames=[\"x\"],this.outputShape=n,this.rank=n.length;var r=getCoordsDataType(this.rank),o=\"\";o=1===this.rank?\"coords * strides + begin\":n.map(function(e,t){return\"coords[\"+t+\"] * strides[\"+t+\"] + begin[\"+t+\"]\"}).join(\",\"),this.userCode=\"\\n \"+r+\" begin = \"+r+\"(\"+e+\");\\n \"+r+\" strides = \"+r+\"(\"+t+\");\\n\\n void main() {\\n \"+r+\" coords = getOutputCoords();\\n setOutput(getX(\"+o+\"));\\n }\\n \"}}(),TextureManager=function(){function e(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return e.prototype.acquireTexture=function(e,t){var n,r=getPhysicalFromLogicalTextureType(t),o=getKeyFromTextureShape(e,r);if(o in this.freeTextures||(this.freeTextures[o]=[]),o in this.usedTextures||(this.usedTextures[o]=[]),this.freeTextures[o].length>0){this.numFreeTextures--,this.numUsedTextures++,this.log();var a=this.freeTextures[o].shift();return this.usedTextures[o].push(a),a}return this.numUsedTextures++,this.log(),r===PhysicalTextureType.FLOAT32?n=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):r===PhysicalTextureType.FLOAT16?n=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):r===PhysicalTextureType.UNSIGNED_BYTE&&(n=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[o].push(n),n},e.prototype.releaseTexture=function(e,t,n){var r=getKeyFromTextureShape(t,getPhysicalFromLogicalTextureType(n));r in this.freeTextures||(this.freeTextures[r]=[]),this.freeTextures[r].push(e),this.numFreeTextures++,this.numUsedTextures--;var o=this.usedTextures[r],a=o.indexOf(e);if(a<0)throw new Error(\"Cannot release a texture that was never provided by this texture manager\");o.splice(a,1),this.log()},e.prototype.log=function(){if(this.logEnabled){var e=this.numFreeTextures+this.numUsedTextures;console.log(\"Free/Used\",this.numFreeTextures+\" / \"+this.numUsedTextures,\"(\"+e+\")\")}},e.prototype.getNumUsedTextures=function(){return this.numUsedTextures},e.prototype.getNumFreeTextures=function(){return this.numFreeTextures},e.prototype.dispose=function(){var e=this;if(null!=this.freeTextures){for(var t in this.freeTextures)this.freeTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});for(var t in this.usedTextures)this.usedTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0}},e}();function getPhysicalFromLogicalTextureType(e){if(e===TextureUsage.DOWNLOAD||e===TextureUsage.PIXELS)return PhysicalTextureType.UNSIGNED_BYTE;if(e===TextureUsage.UPLOAD)return PhysicalTextureType.FLOAT32;if(e===TextureUsage.RENDER)return ENV.get(\"WEBGL_RENDER_FLOAT32_ENABLED\")?PhysicalTextureType.FLOAT32:PhysicalTextureType.FLOAT16;throw new Error(\"Unknown logical texture type \"+e)}function getKeyFromTextureShape(e,t){return e[0]+\"_\"+e[1]+\"_\"+t}var TileProgram=function(){return function(e,t){this.variableNames=[\"A\"];for(var n=new Array(e.length),r=0;r5)throw Error(\"Tile for rank \"+t+\" is not yet supported\");if(1===t)return\"imod(resRC, \"+e[0]+\")\";for(var n=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\",\"resRC.u\"],r=[],o=0;o6)throw Error(\"Transpose for rank \"+t+\" is not yet supported\");for(var n=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\",\"resRC.u\",\"resRC.v\"],r=new Array(t),o=0;o= 0.0) ? x : (exp(x) - 1.0);\",SELU=\"\\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\\n // see: https://arxiv.org/abs/1706.02515\\n float scaleAlpha = \"+SELU_SCALEALPHA+\";\\n float scale = \"+SELU_SCALE+\";\\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\\n\";function STEP(e){return void 0===e&&(e=0),CHECK_NAN_SNIPPET$1+\"\\n return x > 0.0 ? 1.0 : float(\"+e+\");\\n \"}var NEG=\"return -x;\",CEIL=\"return ceil(x);\",FLOOR=\"return floor(x);\",SIGN=\"\\n if (isNaN(x)) { return 0.0; }\\n return sign(x);\\n\",ROUND=\"\\n // OpenGL ES does not support round function.\\n // The algorithm is based on banker's rounding.\\n float base = floor(x);\\n if ((x - base) < 0.5) {\\n return floor(x);\\n } else if ((x - base) > 0.5) {\\n return ceil(x);\\n } else {\\n if (mod(base, 2.0) == 0.0) {\\n return base;\\n } else {\\n return base + 1.0;\\n }\\n }\\n\",EXP=\"return exp(x);\",EXPM1=\"return exp(x) - 1.0;\",LOG=\"if (x < 0.0) return NAN;\\n return log(x);\",LOG1P=\"return log(1.0 + x);\",SQRT=\"return sqrt(x);\",RSQRT=\"return inversesqrt(x);\",SIGMOID=\"return 1.0 / (1.0 + exp(-1.0 * x));\",SOFTPLUS=\"\\n float epsilon = 1.1920928955078125e-7;\\n float threshold = log(epsilon) + 2.0;\\n\\n bool too_large = x > -threshold;\\n bool too_small = x < threshold;\\n\\n float result;\\n float exp_x = exp(x);\\n\\n if (too_large){\\n result = x;\\n }\\n else if (too_small){\\n result = exp_x;\\n }\\n else{\\n result = log(exp_x + 1.0);\\n }\\n return result;\\n\",SIN=CHECK_NAN_SNIPPET$1+\"\\n return sin(x);\\n\",COS=CHECK_NAN_SNIPPET$1+\"\\n return cos(x);\\n\",TAN=\"return tan(x);\",ASIN=\"return asin(x);\",ACOS=\"return acos(x);\",ATAN=CHECK_NAN_SNIPPET$1+\"\\n return atan(x);\\n\",SINH=\"\\n float e2x = exp(x);\\n return (e2x - 1.0 / e2x) / 2.0;\\n\",COSH=\"\\n float e2x = exp(-x);\\n return (e2x + 1.0 / e2x) / 2.0;\\n\",TANH=\"\\n float e2x = exp(-2.0 * abs(x));\\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\\n\",ASINH=\"return log(x + sqrt(x * x + 1.0));\",ACOSH=CHECK_NAN_SNIPPET$1+\"\\n if (x < 1.0) return NAN;\\n return log(x + sqrt(x * x - 1.0));\",ATANH=CHECK_NAN_SNIPPET$1+\"\\n if ((x < -1.0) || (x > 1.0)) return NAN;\\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;\",ERF='\\n // Error function is calculated approximately with elementary function.\\n // See \"Handbook of Mathematical Functions with Formulas,\\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\\n float p = '+ERF_P+\";\\n float a1 = \"+ERF_A1+\";\\n float a2 = \"+ERF_A2+\";\\n float a3 = \"+ERF_A3+\";\\n float a4 = \"+ERF_A4+\";\\n float a5 = \"+ERF_A5+\";\\n\\n float t = 1.0 / (1.0 + p * x);\\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\\n\",SQUARE=\"return x * x;\",RECIPROCAL=\"return 1.0 / x;\",LOGICAL_NOT=\"return float(!(x >= 1.0));\",TO_INT=\"return float(int(x));\";function concat1d_(e){return concat(e,0)}function concat2d_(e,t){return concat(e,t)}function concat3d_(e,t){return concat(e,t)}function concat4d_(e,t){return concat(e,t)}function concat_(e,t){void 0===t&&(t=0),assert(e.length>=1,\"Pass at least one tensor to concat\");var n=convertToTensorArray(e,\"tensors\",\"concat\"),r=n[0];if(1===n.length)return r;for(var o=parseAxisParam(t,r.shape),a=1;a>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(\" \"),n.s1=r(\" \"),n.s2=r(\" \"),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}(e),o=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+1.1102230246251565e-16*(2097152*a()|0)},a.quick=a,o&&(\"object\"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.alea=o}(0,e,!1)}),xor128=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function o(e,t){var n=new function(e){var t=this,n=\"\";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(\"object\"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xor128=o}(0,e,!1)}),xorwow=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function o(e,t){var n=new function(e){var t=this,n=\"\";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(\"object\"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xorwow=o}(0,e,!1)}),xorshift7=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.x=e.x.slice(),t.i=e.i,t}function o(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.x,o=t.i;return e=r[o],n=(e^=e>>>7)^e<<24,n^=(e=r[o+1&7])^e>>>10,n^=(e=r[o+3&7])^e>>>3,n^=(e=r[o+4&7])^e<<7,e=r[o+7&7],n^=(e^=e<<13)^e<<9,r[o]=n,t.i=o+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=\"\"+t,n=0;n0;--n)e.next()}(t,e)}(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(o.x&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xorshift7=o}(0,e,!1)}),xor4096=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function o(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.w,o=t.X,a=t.i;return t.w=r=r+1640531527|0,n=o[a+34&127],e=o[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=o[a]=n^e,t.i=a,n+(r^r>>>16)|0},function(e,t){var n,r,o,a,i,s=[],u=128;for(t===(0|t)?(r=t,t=null):(t+=\"\\0\",r=0,u=Math.max(u,t.length)),o=0,a=-32;a>>15,r^=r<<4,r^=r>>>13,a>=0&&(i=i+1640531527|0,o=0==(n=s[127&a]^=r+i)?o+1:0);for(o>=128&&(s[127&(t&&t.length||0)]=-1),o=127,a=512;a>0;--a)r=s[o+34&127],n=s[o=o+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[o]=r^n;e.w=i,e.X=s,e.i=o}(t,e)}(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(o.X&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xor4096=o}(0,e,!1)}),tychei=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function o(e,t){var n=new function(e){var t=this,n=\"\";t.next=function(){var e=t.b,n=t.c,r=t.d,o=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^o,t.a=o-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(\"object\"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.tychei=o}(0,e,!1)}),seedrandom=createCommonjsModule(function(e){!function(t,n){var r,o=this,a=256,i=6,s=\"random\",u=n.pow(a,i),l=n.pow(2,52),c=2*l,p=a-1;function d(e,d,g){var v=[],y=f(function e(t,n){var r,o=[],a=typeof t;if(n&&\"object\"==a)for(r in t)try{o.push(e(t[r],n-1))}catch(e){}return o.length?o:\"string\"==a?t:t+\"\\0\"}((d=1==d?{entropy:!0}:d||{}).entropy?[e,m(t)]:null==e?function(){try{var e;return r&&(e=r.randomBytes)?e=e(a):(e=new Uint8Array(a),(o.crypto||o.msCrypto).getRandomValues(e)),m(e)}catch(e){var n=o.navigator,i=n&&n.plugins;return[+new Date,o,i,o.screen,m(t)]}}():e,3),v),x=new function(e){var t,n=e.length,r=this,o=0,i=r.i=r.j=0,s=r.S=[];n||(e=[n++]);for(;o=c;)e/=2,t/=2,n>>>=1;return(e+n)/t};return T.int32=function(){return 0|x.g(4)},T.quick=function(){return x.g(4)/4294967296},T.double=T,f(m(x.S),t),(d.pass||g||function(e,t,r,o){return o&&(o.S&&h(o,x),e.state=function(){return h(x,{})}),r?(n[s]=e,t):e})(T,y,\"global\"in d?d.global:this==n,d.state)}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function f(e,t){for(var n,r=e+\"\",o=0;o=1||0===i);var s=Math.sqrt(-2*Math.log(i)/i);t=this.mean+this.stdDev*o*s,n=this.mean+this.stdDev*a*s,this.truncated&&!this.isValidTruncated(t)||(r=!0)}return this.truncated&&!this.isValidTruncated(n)||(this.nextVal=this.convertValue(n)),this.convertValue(t)},e.prototype.convertValue=function(e){return null==this.dtype||\"float32\"===this.dtype?e:Math.round(e)},e.prototype.isValidTruncated=function(e){return e<=this.upper&&e>=this.lower},e}();function clone_(e){var t=convertToTensor(e,\"x\",\"clone\");return ENV.engine.runKernel(function(e){return Tensor.make(t.shape,{dataId:t.dataId},t.dtype)},{$x:t},function(e){return{$x:function(){return e.toFloat()}}})}function eye_(e,t,n,r){void 0===r&&(r=\"float32\"),null==t&&(t=e);for(var o=buffer([e,t],r),a=e<=t?e:t,i=0;i2)throw new Error(\"Rank of probabilities must be 1 or 2, but is \"+i);n=n||Math.random();var s=1===i?o.as2D(1,-1):o,u=ENV.engine.runKernel(function(e){return e.multinomial(s,r,t,n)},{logits2D:s});return 1===i?u.as1D():u}function oneHot_(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=0);var o=convertToTensor(e,\"indices\",\"oneHot\",\"int32\");if(assert(\"int32\"===o.dtype,\"Indices must be of dtype `int32`\"),t<2)throw new Error(\"Error in oneHot: depth must be >=2, but it is \"+t);return ENV.engine.runKernel(function(e){return e.oneHot(o,t,n,r)},{$indices:o})}function fromPixels_(e,t){if(void 0===t&&(t=3),t>4)throw new Error(\"Cannot construct Tensor with more than 4 channels from pixels.\");return ENV.engine.fromPixels(e,t)}function toPixels(e,t){return __awaiter(this,void 0,void 0,function(){var n,r,o,a,i,s,u,l,c,p,d,h,f,m,g,v,y,x,T,S;return __generator(this,function(b){switch(b.label){case 0:if(2!==(n=convertToTensor(e,\"img\",\"toPixels\",\"int32\")).rank&&3!==n.rank)throw new Error(\"toPixels only supports rank 2 or 3 tensors, got rank \"+n.rank+\".\");if(r=n.shape.slice(0,2),o=r[0],a=r[1],(i=2===n.rank?1:n.shape[2])>4||2===i)throw new Error(\"toPixels only supports depth of size 1, 3 or 4 but got \"+i);return s=n.min(),u=n.max(),[4,s.data()];case 1:return l=b.sent()[0],[4,u.data()];case 2:if(c=b.sent()[0],s.dispose(),u.dispose(),\"float32\"===n.dtype){if(l<0||c>1)throw new Error(\"Tensor values for a float32 Tensor must be in the range [0 - 1] but got range [\"+l+\" - \"+c+\"].\")}else{if(\"int32\"!==n.dtype)throw new Error(\"Unsupported type for toPixels: \"+n.dtype+\". Please use float32 or int32 tensors.\");if(l<0||c>255)throw new Error(\"Tensor values for a int32 Tensor must be in the range [0 - 255] but got range [\"+l+\" - \"+c+\"].\")}return[4,n.data()];case 3:for(p=b.sent(),d=\"float32\"===n.dtype?255:1,h=new Uint8ClampedArray(a*o*4),f=0;f=1,\"Pass at least one tensor to tf.stack\"),1===n.length)return n[0].expandDims(t);var r=n[0].rank,o=n[0].shape,a=n[0].dtype;assert(t<=r,\"Axis must be <= rank of the tensor\"),n.forEach(function(e){assertShapesMatch(o,e.shape,\"All tensors passed to stack must have matching shapes\")}),n.forEach(function(e){assert(a===e.dtype,\"All tensors passed to stack must have matching dtypes\")});var i=n.map(function(e){return e.expandDims(t)});return concat(i,t)}function batchToSpaceND_(e,t,n){var r=convertToTensor(e,\"x\",\"batchToSpaceND\"),o=t.reduce(function(e,t){return e*t});return assert(r.rank>=1+t.length,\"input rank should be > than [blockShape] but got \"+r.rank),assert(n.length===t.length,\"crops.shape[0] must be equal to [blockShape] but got \"+n.length),assert(r.shape[0]%o==0,\"input tensor batch must be divisible by prod( blockShape )\"),ENV.engine.runKernel(function(e){return e.batchToSpaceND(r,t,n)},{})}function spaceToBatchND_(e,t,n){var r=convertToTensor(e,\"x\",\"spaceToBatchND\");return assert(r.rank>=1+t.length,\"input rank should be > than [blockShape] but got \"+r.rank),assert(n.length===t.length,\"paddings.shape[0] must be equal to [blockShape], got \"+n.length),assert(r.shape.reduce(function(e,n,r){return r>0&&r<=t.length?e&&n%t[r-1]==0:e},!0),\"input spatial dimensions must be divisible by blockShapes\"),ENV.engine.runKernel(function(e){return e.spaceToBatchND(r,t,n)},{})}function unstack_(e,t){void 0===t&&(t=0);for(var n,r=convertToTensor(e,\"x\",\"unstack\"),o=r.shape[t],a=Array(r.rank-1).fill(0),i=0,s=0;s0?this.gpgpu.beginQuery():{startMs:performance.now(),endMs:null}},e.prototype.endTimer=function(e){return ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0?(this.gpgpu.endQuery(),e):(e.endMs=performance.now(),e)},e.prototype.getQueryTime=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){return ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0?[2,this.gpgpu.waitForQueryAndGetTime(e)]:[2,(t=e).endMs-t.startMs]})})},e.prototype.disposeData=function(e){if(!this.pendingDisposal.has(e))if(this.pendingRead.has(e))this.pendingDisposal.add(e);else if(this.texData.has(e)){var t=this.texData.get(e),n=t.texture,r=t.texShape,o=t.usage;null!=n&&this.releaseTexture(e,n,r,o),this.texData.delete(e)}},e.prototype.getTexture=function(e){return this.uploadToGPU(e),this.texData.get(e).texture},e.prototype.getGPGPUContext=function(){return this.gpgpu},e.prototype.getCanvas=function(){return this.canvas},e.prototype.slice=function(e,t,n){var r=new SliceProgram(n),o=r.getCustomSetupFunc(t);return this.compileAndRun(r,[e],null,o)},e.prototype.stridedSlice=function(e,t,n,r,o,a){var i=getStridedSlicedInfo(e.shape,t,n,r,o,a),s=i[0],u=i[1];if(u.some(function(e){return 0===e}))return tensor([],u);var l=new StridedSliceProgram(s,r,u);return this.compileAndRun(l,[e])},e.prototype.reverse=function(e,t){var n=new ReverseProgram(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.concat=function(e,t){var n=new ConcatProgram(e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.neg=function(e){var t=new UnaryOpProgram(e.shape,NEG);return this.compileAndRun(t,[e])},e.prototype.matMul=function(e,t,n,r){var o=new MatMulProgram(e.shape,t.shape,n,r);return this.compileAndRun(o,[e,t])},e.prototype.multiply=function(e,t){var n=new BinaryOpProgram(MUL,e.shape,t.shape),r=this.makeOutputArray(n.outputShape,upcastType(e.dtype,t.dtype));return this.compileAndRun(n,[e,t],r)},e.prototype.batchNormalization=function(e,t,n,r,o,a){var i=[e,t,n],s=null;null!=a&&(s=a.shape,i.push(a));var u=null;null!=o&&(u=o.shape,i.push(o));var l=new BatchNormProgram(e.shape,t.shape,n.shape,s,u,r);return this.compileAndRun(l,i)},e.prototype.localResponseNormalization4D=function(e,t,n,r,o){var a=new LRNProgram(e.shape,t,n,r,o);return this.compileAndRun(a,[e])},e.prototype.LRNGrad=function(e,t,n,r,o,a,i){var s=new LRNGradProgram(t.shape,r,o,a,i);return this.compileAndRun(s,[t,n,e])},e.prototype.tile=function(e,t){var n=new TileProgram(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.pad=function(e,t,n){var r=new PadProgram(e.shape,t,n);return this.compileAndRun(r,[e])},e.prototype.transpose=function(e,t){var n=new TransposeProgram(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.gather=function(e,t,n){var r=new GatherProgram(e.shape,t.size,n);return this.compileAndRun(r,[e,t])},e.prototype.batchToSpaceND=function(e,t,n){assert(e.rank<=4,\"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet\");var r=t.reduce(function(e,t){return e*t}),o=getReshaped(e.shape,t,r),a=getPermuted(o.length,t.length),i=getReshapedPermuted(e.shape,t,r),s=getSliceBeginCoords(n,t.length),u=getSliceSize(i,n,t.length);return e.reshape(o).transpose(a).reshape(i).slice(s,u)},e.prototype.spaceToBatchND=function(e,t,n){assert(e.rank<=4,\"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet\");var r=t.reduce(function(e,t){return e*t}),o=[[0,0]];o.push.apply(o,n);for(var a=1+t.length;athis.NUM_BYTES_BEFORE_PAGING)for(var d=this.numBytesInGPU-this.NUM_BYTES_BEFORE_PAGING;d>0&&this.lruDataGPU.length>0;){var h=this.lruDataGPU.shift(),f=this.texData.get(h),m=f.shape,g=f.dtype;d-=this.computeBytes(m,g),this.read(h)}return p&&(s=this.endTimer(s),this.activeTimers.push(this.getQueryTime(s))),n},e.prototype.getAndSaveBinary=function(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]},e.prototype.getTextureManager=function(){return this.textureManager},e.prototype.dispose=function(){if(!this.disposed){for(var e in this.binaryCache)this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram);this.textureManager.dispose(),this.canvas.remove(),null!=this.fromPixelsCanvas&&this.fromPixelsCanvas.remove(),this.gpgpuCreatedLocally&&this.gpgpu.dispose(),this.disposed=!0}},e.prototype.throwIfNoData=function(e){if(!this.texData.has(e))throw new Error(\"WebGL backend: No data found for this tensor. Did you change your backend in the middle of the program? New backends can't use Tensors created with previous backends\")},e.prototype.uploadToGPU=function(e){this.throwIfNoData(e);var t=this.texData.get(e),n=t.shape,r=t.values,o=t.texture,a=t.dtype,i=t.usage;if(null==o){var s,u=null!=this.activeTimers;u&&(s=performance.now());var l=getTextureShapeFromLogicalShape(this.gpgpu.gl,n);t.texShape=l;var c=this.acquireTexture(e,l,i);t.texture=c,null!=r&&(this.gpgpu.uploadMatrixToTexture(c,l[0],l[1],typedArrayToFloat32(r,a)),t.values=null,u&&(this.uploadWaitMs+=performance.now()-s))}else{this.lruDataGPU.indexOf(e)>=0&&(this.lruDataGPU.splice(this.lruDataGPU.indexOf(e),1),this.lruDataGPU.push(e))}},e.prototype.cacheOnCPU=function(e,t){var n=this.delayedStorage,r=this.texData.get(e),o=r.texture,a=r.texShape,i=r.dtype,s=r.usage;n&&null!=o&&(this.releaseTexture(e,o,a,s),r.texture=null,r.texShape=null),null!=t&&(r.values=float32ToTypedArray(t,i))},e.prototype.releaseTexture=function(e,t,n,r){var o=this.texData.get(e),a=o.shape,i=o.dtype,s=this.lruDataGPU.indexOf(e);s>=0&&this.lruDataGPU.splice(s,1),this.numBytesInGPU-=this.computeBytes(a,i),this.textureManager.releaseTexture(t,n,r)},e.prototype.acquireTexture=function(e,t,n){var r=this.texData.get(e),o=r.shape,a=r.dtype;return this.lruDataGPU.push(e),this.numBytesInGPU+=this.computeBytes(o,a),this.textureManager.acquireTexture(t,n)},e.prototype.computeBytes=function(e,t){return sizeFromShape(e)*bytesPerElement(t)},e}();function float32ToTypedArray(e,t){if(\"float32\"===t)return e;if(\"int32\"===t||\"bool\"===t){for(var n=\"int32\"===t?new Int32Array(e.length):new Uint8Array(e.length),r=0;r=0?e:(assert(-1===e,\"Bad value in size\"),a.shape[t]-r[t])}),assertParamsValid(a,r,o);var i=a.shape;return ENV.engine.runKernel(function(e){return e.slice(a,r,o)},{$x:a},function(e){for(var t=[],n=0;n0&&(t=t.sum(r)),t.reshape(n.shape)},$b:function(){var t=e,n=getReductionAxes(r.shape,o);return n.length>0&&(t=t.sum(n)),t.reshape(r.shape)}}})}function addN_(e){assert(Array.isArray(e),function(){return\"The param passed to tf.addN() must be a list of tensors\"}),assert(e.length>=1,function(){return\"Must pass at least one tensor to tf.addN(), but got \"+e.length});var t=e.map(function(e,t){return convertToTensor(e,\"tensors\"+t,\"addN\")}),n=t[0];t.forEach(function(e){if(e.dtype!==n.dtype)throw new Error(\"All tensors passed to tf.addN() must have the same dtype\")}),t.forEach(function(e){if(!arraysEqual(e.shape,n.shape))throw new Error(\"All tensors passed to tf.addN() must have the same shape\")});var r=t;return ENV.engine.runKernel(function(e){return e.addN(t)},r,function(e){var n={};return t.forEach(function(t,r){n[r]=function(){return e.clone()}}),n})}function addStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in addStrict: \"),e.add(t)}function sub_(e,t){var n=convertToTensor(e,\"a\",\"sub\"),r=convertToTensor(t,\"b\",\"sub\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.subtract(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=e,r=getReductionAxes(n.shape,o);return r.length>0&&(t=t.sum(r)),t.reshape(n.shape)},$b:function(){var t=e,n=getReductionAxes(r.shape,o);return n.length>0&&(t=t.sum(n)),t.neg().reshape(r.shape)}}})}function subStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in subStrict: \"),e.sub(t)}function pow_(e,t){var n=convertToTensor(e,\"base\",\"pow\"),r=convertToTensor(t,\"exp\",\"pow\"),o=assertAndGetBroadcastShape(n.shape,r.shape);e=n.cast(upcastType(n.dtype,r.dtype)),t=r.cast(upcastType(n.dtype,r.dtype));return ENV.engine.runKernel(function(e,t){return t(e.pow(n,r))},{$base:n,$exp:r},function(e,t){var a=t[0];return{$base:function(){var t=e.mul(r.toFloat().mul(a.div(n))),i=getReductionAxes(n.shape,o);return i.length>0&&(t=t.sum(i)),t.reshape(n.shape)},$exp:function(){var t=e.mul(a.mul(n.log()).toFloat()),i=getReductionAxes(r.shape,o);return i.length>0&&(t=t.sum(i)),t.reshape(r.shape)}}})}function powStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in powStrict: \"),e.pow(t)}function mul_(e,t){var n=convertToTensor(e,\"a\",\"mul\"),r=convertToTensor(t,\"b\",\"mul\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.multiply(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=e.mul(r.toFloat()),a=getReductionAxes(n.shape,o);return a.length>0?t.sum(a).reshape(n.shape):t},$b:function(){var t=e.mul(n.toFloat()),a=getReductionAxes(r.shape,o);return a.length>0?t.sum(a).reshape(r.shape):t}}})}function mulStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in multiplyStrict: \"),e.mul(t)}function div_(e,t){var n,r=convertToTensor(e,\"a\",\"div\"),o=convertToTensor(t,\"b\",\"div\");if(assertTypesMatch(r,o),\"int32\"===r.dtype&&\"int32\"===o.dtype)return floorDiv(r,o);n=function(e){return e.realDivide(r,o)};var a=assertAndGetBroadcastShape(r.shape,o.shape);return ENV.engine.runKernel(n,{$a:r,$b:o},function(e){return{$a:function(){var t=e.div(o.toFloat()),n=getReductionAxes(r.shape,a);return n.length>0?t.sum(n).reshape(r.shape):t},$b:function(){var t=e.mul(r.toFloat()),n=getReductionAxes(o.shape,a);n.length>0&&(t=t.sum(n).reshape(o.shape));var i=o.square();return t.div(i.toFloat()).neg()}}})}function floorDiv_(e,t){var n=convertToTensor(e,\"a\",\"floorDiv\"),r=convertToTensor(t,\"b\",\"floorDiv\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.floorDiv(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=e.div(r.toFloat()),a=getReductionAxes(n.shape,o);return a.length>0?t.sum(a).reshape(n.shape):t},$b:function(){var t=e.mul(n.toFloat()),a=getReductionAxes(r.shape,o);a.length>0&&(t=t.sum(a).reshape(r.shape));var i=r.square();return t.div(i.toFloat()).neg()}}})}function divStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in divideStrict: \"),e.div(t)}function mod_(e,t){var n=convertToTensor(e,\"a\",\"mod\"),r=convertToTensor(t,\"b\",\"mod\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.mod(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=getReductionAxes(n.shape,o);return t.length>0?e.sum(t).reshape(n.shape):e},$b:function(){var t=e.mul(n.div(r).floor().neg()),a=getReductionAxes(r.shape,o);return a.length>0?t.sum(a).reshape(r.shape):t}}})}function modStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in modStrict: \"),e.mod(t)}function minimum_(e,t){var n=convertToTensor(e,\"a\",\"minimum\"),r=convertToTensor(t,\"b\",\"minimum\");assertTypesMatch(n,r),\"bool\"===n.dtype&&(n=n.toInt()),\"bool\"===r.dtype&&(r=r.toInt()),assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.minimum(n,r)},{$a:n,$b:r},function(e){return{$a:function(){return e.mul(n.lessEqual(r).toFloat())},$b:function(){return e.mul(n.greater(r).toFloat())}}})}function minimumStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in minimumStrict: \"),e.minimum(t)}function maximum_(e,t){var n=convertToTensor(e,\"a\",\"maximum\"),r=convertToTensor(t,\"b\",\"maximum\");assertTypesMatch(n,r),\"bool\"===n.dtype&&(n=n.toInt()),\"bool\"===r.dtype&&(r=r.toInt()),assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.maximum(n,r)},{$a:n,$b:r},function(e){return{$a:function(){return e.mul(n.greaterEqual(r).toFloat())},$b:function(){return e.mul(n.less(r).toFloat())}}})}function maximumStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in minimumStrict: \"),e.maximum(t)}function squaredDifference_(e,t){var n=convertToTensor(e,\"a\",\"squaredDifference\"),r=convertToTensor(t,\"b\",\"squaredDifference\");assertTypesMatch(n,r),assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.squaredDifference(n,r)},{$a:n,$b:r},function(e){var t=scalar(2);return{$a:function(){return e.mul(n.sub(r).mul(t))},$b:function(){return e.mul(r.sub(n).mul(t))}}})}function squaredDifferenceStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in squaredDifferenceStrict: \"),e.squaredDifference(t)}function atan2_(e,t){var n=convertToTensor(e,\"a\",\"atan2\"),r=convertToTensor(t,\"b\",\"atan2\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.atan2(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=add(n.square(),r.square()),a=e.mul(r.div(t)),i=getReductionAxes(n.shape,o);return i.length>0&&(a=a.sum(i)),a.reshape(n.shape)},$b:function(){var t=add(n.square(),r.square()),a=neg(e.mul(n.div(t))),i=getReductionAxes(r.shape,o);return i.length>0&&(a=a.sum(i)),a.reshape(r.shape)}}})}var add=op({add_:add_}),addN=op({addN_:addN_}),addStrict=op({addStrict_:addStrict_}),atan2=op({atan2_:atan2_}),div=op({div_:div_}),divStrict=op({divStrict_:divStrict_}),floorDiv=op({floorDiv_:floorDiv_}),maximum=op({maximum_:maximum_}),maximumStrict=op({maximumStrict_:maximumStrict_}),minimum=op({minimum_:minimum_}),minimumStrict=op({minimumStrict_:minimumStrict_}),mod=op({mod_:mod_}),modStrict=op({modStrict_:modStrict_}),mul=op({mul_:mul_}),mulStrict=op({mulStrict_:mulStrict_}),pow=op({pow_:pow_}),powStrict=op({powStrict_:powStrict_}),squaredDifference=op({squaredDifference_:squaredDifference_}),squaredDifferenceStrict=op({squaredDifferenceStrict_:squaredDifferenceStrict_}),sub=op({sub_:sub_}),subStrict=op({subStrict_:subStrict_});function logicalNot_(e){var t=convertToTensor(e,\"x\",\"logicalNot\",\"bool\");return assert(\"bool\"===t.dtype,\"Error Array must be of type bool.\"),ENV.engine.runKernel(function(e){return e.logicalNot(t)},{$x:t})}function logicalAnd_(e,t){var n=convertToTensor(e,\"a\",\"logicalAnd\",\"bool\"),r=convertToTensor(t,\"b\",\"logicalAnd\",\"bool\");return assert(\"bool\"===n.dtype&&\"bool\"===r.dtype,\"Error Array must be of type bool.\"),assertAndGetBroadcastShape(n.shape,r.shape),ENV.engine.runKernel(function(e){return e.logicalAnd(n,r)},{$a:n,$b:r})}function logicalOr_(e,t){var n=convertToTensor(e,\"a\",\"logicalOr\",\"bool\"),r=convertToTensor(t,\"b\",\"logicalOr\",\"bool\");return assert(\"bool\"===n.dtype&&\"bool\"===r.dtype,\"Error Array must be of type bool.\"),assertAndGetBroadcastShape(n.shape,r.shape),ENV.engine.runKernel(function(e){return e.logicalOr(n,r)},{$a:n,$b:r})}function logicalXor_(e,t){var n=convertToTensor(e,\"a\",\"logicalXor\",\"bool\"),r=convertToTensor(t,\"b\",\"logicalXor\",\"bool\");return assert(\"bool\"===n.dtype&&\"bool\"===r.dtype,\"Error Array must be of type bool.\"),assertAndGetBroadcastShape(n.shape,r.shape),logicalOr(e,t).logicalAnd(logicalAnd(e,t).logicalNot())}function where_(e,t,n){var r=convertToTensor(t,\"a\",\"where\"),o=convertToTensor(n,\"b\",\"where\"),a=convertToTensor(e,\"condition\",\"where\",\"bool\");assert(\"bool\"===a.dtype,\"Error Condition must be of type bool.\"),assertShapesMatch(r.shape,o.shape,\"Error in where: \"),1===a.rank?assert(a.shape[0]===r.shape[0],\"The first dimension of `a` must match the size of `condition`.\"):assertShapesMatch(a.shape,o.shape,\"Error in where: \");return ENV.engine.runKernel(function(e){return e.select(a,r,o)},{$condition:a,$a:r,$b:o},function(e){return{$condition:function(){return zerosLike(a)},$a:function(){return e.mul(a.cast(r.dtype))},$b:function(){return e.mul(a.logicalNot().cast(o.dtype))}}})}function whereAsync_(e){return __awaiter(this,void 0,void 0,function(){var t,n,r;return __generator(this,function(o){switch(o.label){case 0:return assert(\"bool\"===(t=convertToTensor(e,\"condition\",\"where\",\"bool\")).dtype,\"Condition must be of type bool.\"),[4,t.data()];case 1:return n=o.sent(),r=whereImpl(t.shape,n),e!==t&&t.dispose(),[2,r]}})})}var logicalAnd=op({logicalAnd_:logicalAnd_}),logicalNot=op({logicalNot_:logicalNot_}),logicalOr=op({logicalOr_:logicalOr_}),logicalXor=op({logicalXor_:logicalXor_}),where=op({where_:where_}),whereAsync=whereAsync_;function relu_(e){var t=convertToTensor(e,\"x\",\"relu\");if(\"bool\"===t.dtype)return t.toInt();return ENV.engine.runKernel(function(e){return e.relu(t)},{$x:t},function(e){var n=t.step();return{$x:function(){return e.mulStrict(n.toFloat())}}})}function elu_(e){var t=convertToTensor(e,\"x\",\"elu\");return ENV.engine.runKernel(function(e,n){return n(e.elu(t))},{$x:t},function(e,t){var n=t[0];return{$x:function(){return ENV.engine.runKernel(function(t){return t.eluDer(e,n)},{dy:e,y:n})}}})}function selu_(e){var t=convertToTensor(e,\"x\",\"selu\");return ENV.engine.runKernel(function(e){return e.selu(t)},{$x:t},function(e){return{$x:function(){var n=t.greater(scalar(0)),r=scalar(SELU_SCALEALPHA),o=scalar(SELU_SCALE),a=e.mul(o),i=e.mul(r).mul(t.toFloat().exp());return where(n,a,i)}}})}function leakyRelu_(e,t){void 0===t&&(t=.2);var n=convertToTensor(e,\"x\",\"leakyRelu\");return maximum(scalar(t).mul(n),n)}function prelu_(e,t){var n=convertToTensor(e,\"x\",\"prelu\"),r=convertToTensor(t,\"alpha\",\"prelu\"),o=scalar(0);return maximum(o,n).add(r.mul(minimum(o,n)))}var elu=op({elu_:elu_}),leakyRelu=op({leakyRelu_:leakyRelu_}),prelu=op({prelu_:prelu_}),relu=op({relu_:relu_}),selu=op({selu_:selu_});function transpose_(e,t){var n=convertToTensor(e,\"x\",\"transpose\");if(null==t&&(t=n.shape.map(function(e,t){return t}).reverse()),assert(n.rank===t.length,\"Error in transpose: rank of input \"+n.rank+\" must match length of perm \"+t+\".\"),t.forEach(function(e){assert(e>=0&&eo)throw new Error(\"'k' passed to topk() must be <= the last dimension (\"+o+\") but got \"+t);var a=ENV.engine.runKernel(function(e){return e.topk(r,t,n)},{$x:r});return{values:a[0],indices:a[1]}}var Reduction,topk=op({topk_:topk_});function computeWeightedLoss_(e,t,n){void 0===n&&(n=Reduction.SUM_BY_NONZERO_WEIGHTS);var r=convertToTensor(e,\"losses\",\"computeWeightedLoss\"),o=null;null!=t&&(o=convertToTensor(t,\"weights\",\"computeWeightedLoss\"));var a=null==o?r:r.mul(o);if(n===Reduction.NONE)return a;if(n===Reduction.SUM)return a.sum();if(n===Reduction.MEAN){if(null==o)return a.mean();var i=sizeFromShape(r.shape)/sizeFromShape(o.shape),s=a.sum().div(o.sum());return i>1?s.div(scalar(i)):s}if(n===Reduction.SUM_BY_NONZERO_WEIGHTS){if(null==o)return a.sum().div(scalar(r.size));var u=o.mul(ones$1(r.shape)).notEqual(scalar(0)).sum().toFloat();return a.sum().div(u)}throw Error(\"Unknown reduction: \"+n)}function absoluteDifference_(e,t,n,r){void 0===r&&(r=Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,\"labels\",\"absoluteDifference\"),a=convertToTensor(t,\"predictions\",\"absoluteDifference\"),i=null;null!=n&&(i=convertToTensor(n,\"weights\",\"absoluteDifference\")),assertShapesMatch(o.shape,a.shape,\"Error in absoluteDifference: \");var s=o.sub(a).abs();return computeWeightedLoss(s,i,r)}function meanSquaredError_(e,t,n,r){void 0===r&&(r=Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,\"labels\",\"meanSquaredError\"),a=convertToTensor(t,\"predictions\",\"meanSquaredError\"),i=null;null!=n&&(i=convertToTensor(n,\"weights\",\"meanSquaredError\")),assertShapesMatch(o.shape,a.shape,\"Error in meanSquaredError: \");var s=o.squaredDifference(a);return computeWeightedLoss(s,i,r)}function cosineDistance_(e,t,n,r,o){void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"labels\",\"cosineDistance\"),i=convertToTensor(t,\"predictions\",\"cosineDistance\"),s=null;null!=r&&(s=convertToTensor(r,\"weights\",\"cosineDistance\")),assertShapesMatch(a.shape,i.shape,\"Error in cosineDistance: \");var u=scalar(1).sub(a.mul(i).sum(n,!0));return computeWeightedLoss(u,s,o)}function hingeLoss_(e,t,n,r){void 0===r&&(r=Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,\"labels\",\"hingeLoss\"),a=convertToTensor(t,\"predictions\",\"hingeLoss\"),i=null;null!=n&&(i=convertToTensor(n,\"weights\",\"hingeLoss\")),assertShapesMatch(o.shape,a.shape,\"Error in hingeLoss: \");var s=scalar(1);o=scalar(2).mul(o).sub(s);var u=s.sub(o.mul(a)).relu();return computeWeightedLoss(u,i,r)}function logLoss_(e,t,n,r,o){void 0===r&&(r=1e-7),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"labels\",\"logLoss\"),i=convertToTensor(t,\"predictions\",\"logLoss\"),s=null;null!=n&&(s=convertToTensor(n,\"weights\",\"logLoss\")),assertShapesMatch(a.shape,i.shape,\"Error in logLoss: \");var u=scalar(1),l=scalar(r),c=a.mul(i.add(l).log()).neg().sub(u.sub(a).mul(u.sub(i).add(l).log()));return computeWeightedLoss(c,s,o)}function sigmoidCrossEntropyWithLogits_(e,t){var n=convertToTensor(e,\"labels\",\"sigmoidCrossEntropyWithLogits\"),r=convertToTensor(t,\"logits\",\"sigmoidCrossEntropyWithLogits\");assertShapesMatch(n.shape,r.shape,\"Error in sigmoidCrossEntropyWithLogits: \");var o=r.relu(),a=r.mul(n),i=r.abs().neg().exp().log1p();return o.sub(a).add(i)}function sigmoidCrossEntropy_(e,t,n,r,o){void 0===r&&(r=0),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"multiClassLabels\",\"sigmoidCrossEntropy\"),i=convertToTensor(t,\"logits\",\"sigmoidCrossEntropy\"),s=null;if(null!=n&&(s=convertToTensor(n,\"weights\",\"sigmoidCrossEntropy\")),assertShapesMatch(a.shape,i.shape,\"Error in sigmoidCrossEntropy: \"),r>0){var u=scalar(r),l=scalar(1),c=scalar(.5);a=a.mul(l.sub(u)).add(c.mul(u))}var p=sigmoidCrossEntropyWithLogits_(a,i);return computeWeightedLoss(p,s,o)}function huberLoss_(e,t,n,r,o){void 0===r&&(r=1),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"labels\",\"huberLoss\"),i=convertToTensor(t,\"predictions\",\"huberLoss\"),s=null;null!=n&&(s=convertToTensor(n,\"weights\",\"huberLoss\")),assertShapesMatch(a.shape,i.shape,\"Error in huberLoss: \");var u=scalar(r),l=i.sub(a).abs(),c=minimum(l,u),p=l.sub(c),d=scalar(.5).mul(c.square()).add(u.mul(p));return computeWeightedLoss(d,s,o)}function softmaxCrossEntropyWithLogits_(e,t,n){if(void 0===n&&(n=-1),-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error(\"Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank \"+t.rank+\" and dim was \"+n);return customGrad(function(e,t){var r=t.logSumExp([n],!0),o=t.toFloat().sub(r);return{value:o.mul(e).neg().sum([n]),gradFunc:function(t){var r=expandShapeToKeepDim(t.shape,[n]);return[t.reshape(r).mul(e.toFloat().sub(o.exp())),t.reshape(r).mul(o.exp().sub(e.toFloat()))]}}})(e,t)}function softmaxCrossEntropy_(e,t,n,r,o){void 0===r&&(r=0),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"onehotLabels\",\"softmaxCrossEntropy\"),i=convertToTensor(t,\"logits\",\"softmaxCrossEntropy\"),s=null;if(null!=n&&(s=convertToTensor(n,\"weights\",\"softmaxCrossEntropy\")),assertShapesMatch(a.shape,i.shape,\"Error in softmaxCrossEntropy: \"),r>0){var u=scalar(r),l=scalar(1),c=scalar(a.shape[1]);a=a.mul(l.sub(u)).add(u.div(c))}var p=softmaxCrossEntropyWithLogits_(a,i);return computeWeightedLoss(p,s,o)}!function(e){e[e.NONE=0]=\"NONE\",e[e.MEAN=1]=\"MEAN\",e[e.SUM=2]=\"SUM\",e[e.SUM_BY_NONZERO_WEIGHTS=3]=\"SUM_BY_NONZERO_WEIGHTS\"}(Reduction||(Reduction={}));var absoluteDifference=op({absoluteDifference_:absoluteDifference_}),computeWeightedLoss=op({computeWeightedLoss_:computeWeightedLoss_}),cosineDistance=op({cosineDistance_:cosineDistance_}),hingeLoss=op({hingeLoss_:hingeLoss_}),huberLoss=op({huberLoss_:huberLoss_}),logLoss=op({logLoss_:logLoss_}),meanSquaredError=op({meanSquaredError_:meanSquaredError_}),sigmoidCrossEntropy=op({sigmoidCrossEntropy_:sigmoidCrossEntropy_}),softmaxCrossEntropy=op({softmaxCrossEntropy_:softmaxCrossEntropy_}),loss_ops=Object.freeze({get Reduction(){return Reduction},absoluteDifference:absoluteDifference,computeWeightedLoss:computeWeightedLoss,cosineDistance:cosineDistance,hingeLoss:hingeLoss,huberLoss:huberLoss,logLoss:logLoss,meanSquaredError:meanSquaredError,sigmoidCrossEntropy:sigmoidCrossEntropy,softmaxCrossEntropy:softmaxCrossEntropy});function gramSchmidt_(e){var t;if(Array.isArray(e)){t=!1,assert(null!=e&&e.length>0,\"Gram-Schmidt process: input must not be null, undefined, or empty\");for(var n=e[0].shape[0],r=1;r0)for(var n=0;n= 2, but got rank \"+e.rank);if(2===e.rank)return qr2d(e,t);var n=e.shape.slice(0,e.shape.length-2).reduce(function(e,t){return e*t}),r=[],o=[];return unstack(e.reshape([n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0).forEach(function(e){var n=qr2d(e,t),a=n[0],i=n[1];r.push(a),o.push(i)}),[stack(r,0).reshape(e.shape),stack(o,0).reshape(e.shape)]}function qr2d(e,t){return void 0===t&&(t=!1),ENV.engine.tidy(function(){if(2!==e.shape.length)throw new Error(\"qr2d() requires a 2D Tensor, but got a \"+e.shape.length+\"D Tensor.\");for(var n=e.shape[0],r=e.shape[1],o=eye(n),a=e.clone(),i=tensor2d([[1]],[1,1]),s=i.clone(),u=n>=r?r:n,l=function(e){var t,u=a,l=s,c=o;t=ENV.engine.tidy(function(){var t=a.slice([e,e],[n-e,1]),u=t.norm(),l=a.slice([e,e],[1,1]),c=l.sign().neg(),p=l.sub(c.mul(u)),d=t.div(p);s=1===d.shape[0]?i.clone():i.concat(d.slice([1,0],[d.shape[0]-1,d.shape[1]]),0);var h=c.matMul(p).div(u).neg(),f=a.slice([e,0],[n-e,r]),m=h.mul(s);a=0===e?f.sub(m.matMul(s.transpose().matMul(f))):a.slice([0,0],[e,r]).concat(f.sub(m.matMul(s.transpose().matMul(f))),0);var g=o.slice([0,e],[n,o.shape[1]-e]);return o=0===e?g.sub(g.matMul(s).matMul(m.transpose())):o.slice([0,0],[n,e]).concat(g.sub(g.matMul(s).matMul(m.transpose())),1),[s,a,o]}),s=t[0],a=t[1],o=t[2],dispose([u,l,c])},c=0;cr&&(o=o.slice([0,0],[n,r]),a=a.slice([0,0],[r,r])),[o,a]})}var gramSchmidt=op({gramSchmidt_:gramSchmidt_}),qr=op({qr_:qr_}),linalg_ops=Object.freeze({gramSchmidt:gramSchmidt,qr:qr});function resizeBilinear_(e,t,n){void 0===n&&(n=!1);var r=convertToTensor(e,\"images\",\"resizeBilinear\");assert(3===r.rank||4===r.rank,\"Error in resizeBilinear: x must be rank 3 or 4, but got rank \"+r.rank+\".\"),assert(2===t.length,\"Error in resizeBilinear: new shape must 2D, but got shape \"+t+\".\");var o=r,a=!1;3===r.rank&&(a=!0,o=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var i=t[0],s=t[1],u=ENV.engine.runKernel(function(e,t){return e.resizeBilinear(o,i,s,n)},{batchImages:o},function(e,t){return{batchImages:function(){return ENV.engine.runKernel(function(t){return t.resizeBilinearBackprop(e,o,n)},{})}}});return a?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}function resizeNearestNeighbor_(e,t,n){void 0===n&&(n=!1);var r=convertToTensor(e,\"images\",\"resizeNearestNeighbor\");assert(3===r.rank||4===r.rank,\"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank \"+r.rank+\".\"),assert(2===t.length,\"Error in resizeNearestNeighbor: new shape must 2D, but got shape \"+t+\".\"),assert(\"float32\"===r.dtype||\"int32\"===r.dtype,\"`images` must have `int32` or `float32` as dtype\");var o=r,a=!1;3===r.rank&&(a=!0,o=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var i=t[0],s=t[1],u=ENV.engine.runKernel(function(e,t){return e.resizeNearestNeighbor(o,i,s,n)},{batchImages:o},function(e,t){return{batchImages:function(){return ENV.engine.runKernel(function(t){return t.resizeNearestNeighborBackprop(e,o,n)},{})}}});return a?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}function nonMaxSuppression_(e,t,n,r,o){void 0===r&&(r=.5),void 0===o&&(o=Number.NEGATIVE_INFINITY);var a=convertToTensor(e,\"boxes\",\"nonMaxSuppression\"),i=convertToTensor(t,\"scores\",\"nonMaxSuppression\"),s=nonMaxSuppSanityCheck(a,i,n,r,o);return n=s.maxOutputSize,r=s.iouThreshold,o=s.scoreThreshold,ENV.engine.runKernel(function(e){return e.nonMaxSuppression(a,i,n,r,o)},{$boxes:a})}function nonMaxSuppressionAsync_(e,t,n,r,o){return void 0===r&&(r=.5),void 0===o&&(o=Number.NEGATIVE_INFINITY),__awaiter(this,void 0,void 0,function(){var a,i,s,u,l,c;return __generator(this,function(p){switch(p.label){case 0:return a=convertToTensor(e,\"boxes\",\"nonMaxSuppressionAsync\"),i=convertToTensor(t,\"scores\",\"nonMaxSuppressionAsync\"),s=nonMaxSuppSanityCheck(a,i,n,r,o),n=s.maxOutputSize,r=s.iouThreshold,o=s.scoreThreshold,[4,a.data()];case 1:return u=p.sent(),[4,i.data()];case 2:return l=p.sent(),c=nonMaxSuppressionImpl(u,l,n,r,o),a!==e&&a.dispose(),i!==t&&i.dispose(),[2,c]}})})}function nonMaxSuppSanityCheck(e,t,n,r,o){null==r&&(r=.5),null==o&&(o=Number.NEGATIVE_INFINITY);var a=e.shape[0];return n=Math.min(n,a),assert(0<=r&&r<=1,\"iouThreshold must be in [0, 1], but was '\"+r+\"'\"),assert(2===e.rank,\"boxes must be a 2D tensor, but was of rank '\"+e.rank+\"'\"),assert(4===e.shape[1],\"boxes must have 4 columns, but 2nd dimension was \"+e.shape[1]),assert(1===t.rank,\"scores must be a 1D tensor\"),assert(t.shape[0]===a,\"scores has incompatible shape with boxes. Expected \"+a+\", but was \"+t.shape[0]),{maxOutputSize:n,iouThreshold:r,scoreThreshold:o}}var resizeBilinear=op({resizeBilinear_:resizeBilinear_}),resizeNearestNeighbor=op({resizeNearestNeighbor_:resizeNearestNeighbor_}),nonMaxSuppression=op({nonMaxSuppression_:nonMaxSuppression_}),nonMaxSuppressionAsync=nonMaxSuppressionAsync_,image_ops=Object.freeze({resizeBilinear:resizeBilinear,resizeNearestNeighbor:resizeNearestNeighbor,nonMaxSuppression:nonMaxSuppression,nonMaxSuppressionAsync:nonMaxSuppressionAsync}),ops=Object.freeze({image:image_ops,linalg:linalg_ops,losses:loss_ops,op:op,batchNormalization2d:batchNormalization2d,batchNormalization3d:batchNormalization3d,batchNormalization4d:batchNormalization4d,batchNormalization:batchNormalization,concat:concat,concat1d:concat1d,concat2d:concat2d,concat3d:concat3d,concat4d:concat4d,conv1d:conv1d,conv2d:conv2d,depthwiseConv2d:depthwiseConv2d,separableConv2d:separableConv2d,conv2dTranspose:conv2dTranspose,matMul:matMul,dot:dot,outerProduct:outerProduct,reverse:reverse,reverse1d:reverse1d,reverse2d:reverse2d,reverse3d:reverse3d,reverse4d:reverse4d,maxPool:maxPool,avgPool:avgPool,slice:slice,slice1d:slice1d,slice2d:slice2d,slice3d:slice3d,slice4d:slice4d,abs:abs,acos:acos,acosh:acosh,asin:asin,asinh:asinh,atan:atan,atanh:atanh,ceil:ceil,clipByValue:clipByValue,cos:cos,cosh:cosh,erf:erf,exp:exp,expm1:expm1,floor:floor,log:log$1,log1p:log1p,logSigmoid:logSigmoid,neg:neg,reciprocal:reciprocal,round:round,rsqrt:rsqrt,sigmoid:sigmoid,sign:sign,sin:sin,sinh:sinh,softplus:softplus,sqrt:sqrt,square:square,step:step,tan:tan,tanh:tanh$1,all:all,any:any,argMax:argMax,argMin:argMin,logSumExp:logSumExp,max:max,mean:mean,min:min,moments:moments,sum:sum,equal:equal,equalStrict:equalStrict,greater:greater,greaterEqual:greaterEqual,greaterEqualStrict:greaterEqualStrict,greaterStrict:greaterStrict,less:less,lessEqual:lessEqual,lessEqualStrict:lessEqualStrict,lessStrict:lessStrict,notEqual:notEqual,notEqualStrict:notEqualStrict,add:add,addN:addN,addStrict:addStrict,atan2:atan2,div:div,divStrict:divStrict,floorDiv:floorDiv,maximum:maximum,maximumStrict:maximumStrict,minimum:minimum,minimumStrict:minimumStrict,mod:mod,modStrict:modStrict,mul:mul,mulStrict:mulStrict,pow:pow,powStrict:powStrict,squaredDifference:squaredDifference,squaredDifferenceStrict:squaredDifferenceStrict,sub:sub,subStrict:subStrict,elu:elu,leakyRelu:leakyRelu,prelu:prelu,relu:relu,selu:selu,logicalAnd:logicalAnd,logicalNot:logicalNot,logicalOr:logicalOr,logicalXor:logicalXor,where:where,whereAsync:whereAsync,buffer:buffer,toPixels:toPixels,print:print,cast:cast,clone:clone,cumsum:cumsum,expandDims:expandDims,eye:eye,fromPixels:fromPixels,multinomial:multinomial,oneHot:oneHot,pad:pad,pad1d:pad1d,pad2d:pad2d,pad3d:pad3d,pad4d:pad4d,rand:rand,randomNormal:randomNormal,randomUniform:randomUniform,reshape:reshape,split:split,squeeze:squeeze,stack:stack,tile:tile,truncatedNormal:truncatedNormal,unstack:unstack,batchToSpaceND:batchToSpaceND,spaceToBatchND:spaceToBatchND,fill:fill,linspace:linspace,ones:ones$1,range:range,scalar:scalar,tensor:tensor,tensor1d:tensor1d,tensor2d:tensor2d,tensor3d:tensor3d,tensor4d:tensor4d,tensor5d:tensor5d,tensor6d:tensor6d,zeros:zeros,onesLike:onesLike,zerosLike:zerosLike,transpose:transpose,softmax:softmax,localResponseNormalization:localResponseNormalization,norm:norm,gather:gather,unsortedSegmentSum:unsortedSegmentSum,basicLSTMCell:basicLSTMCell,multiRNNCell:multiRNNCell,movingAverage:movingAverage,stridedSlice:stridedSlice,topk:topk}),MathBackendCPU=function(){function e(){this.data=new WeakMap,this.firstUse=!0,ENV.get(\"IS_BROWSER\")&&(this.canvas=document.createElement(\"canvas\"))}return e.prototype.register=function(e,t,n){if(this.firstUse&&(this.firstUse=!1,ENV.get(\"IS_NODE\")&&warn(\"\\n============================\\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\\n============================\\n\")),this.data.has(e))throw new Error(\"Data buffer is already registered\");this.data.set(e,null)},e.prototype.write=function(e,t){if(null==t)throw new Error(\"MathBackendCPU.write(): values can not be null\");this.throwIfNoData(e),this.data.set(e,t)},e.prototype.fromPixels=function(e,t){if(null==e)throw new Error(\"pixels passed to tf.fromPixels() can not be null\");var n,r;if(ENV.get(\"IS_NODE\")&&null==e.getContext)throw new Error(\"When running in node, pixels must be an HTMLCanvasElement like the one returned by the `canvas` npm package\");if(null!=e.getContext)n=e.getContext(\"2d\").getImageData(0,0,e.width,e.height).data;else if(e instanceof ImageData)n=e.data;else{if(!(e instanceof HTMLImageElement||e instanceof HTMLVideoElement))throw new Error(\"pixels passed to tf.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ImageData, but was \"+e.constructor.name);if(null==this.canvas)throw new Error(\"Can't read pixels from HTMLImageElement outside the browser.\");this.canvas.width=e.width,this.canvas.height=e.height,this.canvas.getContext(\"2d\").drawImage(e,0,0,e.width,e.height),n=this.canvas.getContext(\"2d\").getImageData(0,0,e.width,e.height).data}if(4===t)r=new Int32Array(n);else{var o=e.width*e.height;r=new Int32Array(o*t);for(var a=0;ad&&(d=m,h=f)}u[c]=h}return i},e.prototype.cumsum=function(e,t,n,r){if(t!==e.rank-1)throw new Error(\"backend.cumsum in CPU expects an inner-most axis=\"+(e.rank-1)+\" but got axis=\"+t);for(var o=upcastType(e.dtype,\"int32\"),a=zeros(e.shape,o),i=a.dataSync(),s=e.dataSync(),u=e.shape[e.rank-1],l=r?function(e,t){return e+u-t-1}:function(e,t){return e+t},c=0;ct?1:0})},e.prototype.greaterEqual=function(e,t){return this.broadcastedBinaryOp(e,t,\"bool\",function(e,t){return e>=t?1:0})},e.prototype.logicalNot=function(e){for(var t=e.dataSync(),n=new Int32Array(t.length),r=0;r1||1===t.rank?1:t.shape[1],c=0;c=0&&t>=0?n:(n+t)%t})},e.prototype.max=function(e,t){assertAxesAreInnerMostDims(\"max\",t,e.rank);for(var n=computeOutAndReduceShapes(e.shape,t),r=n[0],o=n[1],a=zeros(r,e.dtype),i=sizeFromShape(o),s=a.dataSync(),u=e.dataSync(),l=0;lp&&(p=h)}s[l]=p}return a},e.prototype.maximum=function(e,t){return this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.max(e,t)})},e.prototype.all=function(e,t){assertAxesAreInnerMostDims(\"all\",t,e.rank);for(var n=computeOutAndReduceShapes(e.shape,t),r=n[0],o=n[1],a=zeros(r,e.dtype),i=sizeFromShape(o),s=a.dataSync(),u=e.dataSync(),l=0;l0?n[r]=1:n[r]=0;return Tensor.make(e.shape,{values:n})},e.prototype.round=function(e){for(var t=e.dataSync(),n=new Float32Array(t.length),r=0;r.5?n[r]=Math.ceil(t[r]):n[r]=o%2==0?o:o+1}return Tensor.make(e.shape,{values:n})},e.prototype.exp=function(e){for(var t=e.dataSync(),n=new Float32Array(t.length),r=0;r=0?o:Math.exp(o)-1}return Tensor.make(e.shape,{values:t})},e.prototype.eluDer=function(e,t){for(var n=new Float32Array(t.size),r=t.dataSync(),o=e.dataSync(),a=0;a=1?o[a]:o[a]*(i+1)}return Tensor.make(t.shape,{values:n})},e.prototype.selu=function(e){for(var t=SELU_SCALEALPHA,n=SELU_SCALE,r=new Float32Array(e.size),o=e.dataSync(),a=0;a=0?n*i:t*(Math.exp(i)-1)}return Tensor.make(e.shape,{values:r})},e.prototype.clip=function(e,t,n){for(var r=new Float32Array(e.size),o=e.dataSync(),a=0;a-t,i=r[o]0?1:t}return Tensor.make(e.shape,{values:n})},e.prototype.conv2d=function(e,t,n){for(var r=n.filterHeight,o=n.filterWidth,a=n.dilationHeight,i=n.dilationWidth,s=n.padInfo.left,u=n.padInfo.top,l=buffer(n.outShape,e.dtype),c=0;c=n.inHeight))for(var x=0;x=n.inWidth))for(var S=0;S=n.inHeight))for(var S=0;S=n.inWidth))y+=e.get(p,T,b,d)*t.get(x,S,d,v)}}c.set(y,p,h,m,d*l+v)}return c.toTensor()},e.prototype.depthwiseConv2DDerInput=function(e,t,n){for(var r=buffer(n.inShape,\"float32\"),o=r.values,a=r.strides,i=a[0],s=a[1],u=a[2],l=e.dataSync(),c=e.strides,p=c[0],d=c[1],h=c[2],f=t.dataSync(),m=t.strides,g=m[0],v=m[1],y=m[2],x=n.batchSize,T=n.filterHeight,S=n.filterWidth,b=n.inChannels,E=n.inHeight,w=n.inWidth,_=n.outChannels,A=n.outHeight,R=n.outWidth,C=n.strideHeight,N=n.strideWidth,k=T-1-n.padInfo.top,I=S-1-n.padInfo.left,D=_/b,M=0;MT?T=_:\"avg\"===n&&(S+=_,b++)}if(isNaN(T))break}s.set(\"avg\"===n?S/b:T,c,d,g,p)}return s.toTensor()},e.prototype.maxPool=function(e,t){return this.pool(e,t,\"max\")},e.prototype.maxPoolPositions=function(e,t){for(var n=buffer(t.outShape,\"int32\"),r=t.strideHeight,o=t.strideWidth,a=t.filterHeight,i=t.filterWidth,s=t.padInfo.top,u=t.padInfo.left,l=0;lx&&(x=_,T=b*i+w)}n.set(T,l,p,m,c)}return n.toTensor()},e.prototype.maxPoolBackprop=function(e,t,n,r){for(var o=this.maxPoolPositions(t,r),a=r.strideHeight,i=r.strideWidth,s=r.filterHeight,u=r.filterWidth,l=u-1-r.padInfo.left,c=s-1-r.padInfo.top,p=buffer(t.shape,\"float32\"),d=0;d=r.outHeight||Math.floor(T)!==T))for(var S=0;S=r.outWidth||Math.floor(b)!==b)){var E=s*u-1-o.get(d,T,b,h)===x*u+S?1:0;if(0!==E)y+=e.get(d,T,b,h)*E}}}p.set(y,d,f,m,h)}return p.toTensor()},e.prototype.avgPoolBackprop=function(e,t,n){for(var r=n.strideHeight,o=n.strideWidth,a=n.filterHeight,i=n.filterWidth,s=i-1-n.padInfo.left,u=a-1-n.padInfo.top,l=buffer(t.shape,\"float32\"),c=1/(a*i),p=0;p=n.outHeight||Math.floor(x)!==x))for(var T=0;T=n.outWidth||Math.floor(S)!==S))v+=e.get(p,x,S,d)}}l.set(v*c,p,h,f,d)}return l.toTensor()},e.prototype.cast=function(e,t){return castTensor(e,t,this)},e.prototype.reshape=function(e,t){return reshapeTensor(e,t)},e.prototype.avgPool=function(e,t){return this.pool(e,t,\"avg\").toFloat()},e.prototype.resizeBilinear=function(e,t,n,r){for(var o=e.shape,a=o[0],i=o[1],s=o[2],u=o[3],l=buffer([a,t,n,u],e.dtype),c=[r&&t>1?i-1:i,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],d=0;d1?a-1:a,n&&c>1?i-1:i],h=[n&&l>1?l-1:l,n&&c>1?c-1:c],f=d[0]/h[0],m=d[1]/h[1],g=0;g1?i-1:i,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],d=0;d1?a-1:a,n&&c>1?i-1:i],h=[n&&l>1?l-1:l,n&&c>1?c-1:c],f=1/(d[0]/h[0]),m=1/(d[1]/h[1]),g=2*Math.ceil(f)+2,v=2*Math.ceil(m)+2,y=0;y=l))for(var N=0;N=c)){var I=d[0]*(C/h[0]),D=d[1]*(k/h[1]),M=Math.min(a-1,n?Math.round(I):Math.floor(I)),O=Math.min(i-1,n?Math.round(D):Math.floor(D));x===M&&T===O&&(A+=e.get(y,C,k,_))}}}p.set(A,y,x,T,_)}return p.toTensor()},e.prototype.batchNormalization=function(e,t,n,r,o,a){for(var i=e.dataSync(),s=t.dataSync(),u=n.dataSync(),l=o?o.dataSync():new Float32Array([1]),c=a?a.dataSync():new Float32Array([0]),p=new Float32Array(i.length),d=0;d=0&&e.get(a)0,\"scheme must not be an empty string.\");var r=e.getInstance();assert(null==r.managers[t],\"A model store manager is already registered for scheme '\"+t+\"'.\"),r.managers[t]=n},e.getManager=function(e){var t=this.getInstance().managers[e];if(null==t)throw new Error(\"Cannot find model manager for scheme '\"+e+\"'\");return t},e.getSchemes=function(){return Object.keys(this.getInstance().managers)},e}();function parseURL(e){if(-1===e.indexOf(URL_SCHEME_SUFFIX))throw new Error(\"The url string provided does not contain a scheme. Supported schemes are: \"+ModelStoreManagerRegistry.getSchemes().join(\",\"));return{scheme:e.split(URL_SCHEME_SUFFIX)[0],path:e.split(URL_SCHEME_SUFFIX)[1]}}function cloneModelInternal(e,t,n){return void 0===n&&(n=!1),__awaiter(this,void 0,void 0,function(){var r,o,a,i,s,u,l,c,p;return __generator(this,function(d){switch(d.label){case 0:return assert(e!==t,\"Old path and new path are the same: '\"+e+\"'\"),assert((r=IORouterRegistry.getLoadHandlers(e)).length>0,\"Copying failed because no load handler is found for source URL \"+e+\".\"),assert(r.length<2,\"Copying failed because more than one (\"+r.length+\") load handlers for source URL \"+e+\".\"),o=r[0],assert((a=IORouterRegistry.getSaveHandlers(t)).length>0,\"Copying failed because no save handler is found for destination URL \"+t+\".\"),assert(a.length<2,\"Copying failed because more than one (\"+r.length+\") save handlers for destination URL \"+t+\".\"),i=a[0],s=parseURL(e).scheme,u=parseURL(e).path,l=s===parseURL(e).scheme,[4,o.load()];case 1:return c=d.sent(),n&&l?[4,ModelStoreManagerRegistry.getManager(s).removeModel(u)]:[3,3];case 2:d.sent(),d.label=3;case 3:return[4,i.save(c)];case 4:return p=d.sent(),!n||l?[3,6]:[4,ModelStoreManagerRegistry.getManager(s).removeModel(u)];case 5:d.sent(),d.label=6;case 6:return[2,p.modelArtifactsInfo]}})})}function listModels(){return __awaiter(this,void 0,void 0,function(){var e,t,n,r,o,a,i;return __generator(this,function(s){switch(s.label){case 0:e=ModelStoreManagerRegistry.getSchemes(),t={},n=0,r=e,s.label=1;case 1:return n0,\"URL path for browserHTTPRequest must not be null, undefined or empty.\"),this.path=e,null!=t&&null!=t.body)throw new Error(\"requestInit is expected to have no pre-existing body, but has one.\");this.requestInit=t||{}}return e.prototype.save=function(e){return __awaiter(this,void 0,void 0,function(){var t,n,r,o;return __generator(this,function(a){switch(a.label){case 0:if(e.modelTopology instanceof ArrayBuffer)throw new Error(\"BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.\");return(t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,n=[{paths:[\"./model.weights.bin\"],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,weightsManifest:n},t.body.append(\"model.json\",new Blob([JSON.stringify(r)],{type:\"application/json\"}),\"model.json\"),null!=e.weightData&&t.body.append(\"model.weights.bin\",new Blob([e.weightData],{type:\"application/octet-stream\"}),\"model.weights.bin\"),[4,fetch(this.path,t)];case 1:if(200===(o=a.sent()).status)return[2,{modelArtifactsInfo:getModelArtifactsInfoForJSON(e),responses:[o]}];throw new Error(\"BrowserHTTPRequest.save() failed due to HTTP response status \"+o.status+\".\")}})})},e.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){var e,t,n,r,o,a,i,s,u,l,c,p;return __generator(this,function(d){switch(d.label){case 0:return[4,fetch(this.path,this.requestInit)];case 1:return[4,d.sent().json()];case 2:if(e=d.sent(),t=e.modelTopology,n=e.weightsManifest,null==t&&null==n)throw new Error(\"The JSON from HTTP path \"+this.path+\" contains neither model topology or manifest for weights.\");if(null==n)return[3,4];for(a=e.weightsManifest,r=[],i=0,s=a;i0&&(e=__assign({weightSpecs:this.weightSpecs},e)),null!=this.weightData&&this.weightData.byteLength>0&&(e=__assign({weightData:this.weightData},e)),[2,e]})})},e}(),PassthroughSaver=function(){function e(e){this.saveHandler=e}return e.prototype.save=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,this.saveHandler(e)]})})},e}();function fromMemory(e,t,n){return new PassthroughLoader(e,t,n)}function withSaveHandler(e){return new PassthroughSaver(e)}var registerSaveRouter=IORouterRegistry.registerSaveRouter,registerLoadRouter=IORouterRegistry.registerLoadRouter,getSaveHandlers=IORouterRegistry.getSaveHandlers,getLoadHandlers=IORouterRegistry.getLoadHandlers,io=Object.freeze({browserFiles:browserFiles,browserHTTPRequest:browserHTTPRequest,concatenateArrayBuffers:concatenateArrayBuffers,decodeWeights:decodeWeights,encodeWeights:encodeWeights,fromMemory:fromMemory,getLoadHandlers:getLoadHandlers,getModelArtifactsInfoForJSON:getModelArtifactsInfoForJSON,getSaveHandlers:getSaveHandlers,loadWeights:loadWeights,registerLoadRouter:registerLoadRouter,registerSaveRouter:registerSaveRouter,withSaveHandler:withSaveHandler,copyModel:copyModel,listModels:listModels,moveModel:moveModel,removeModel:removeModel}),Serializable=function(){function e(){}return e.prototype.getClassName=function(){return this.constructor.className},e.fromConfig=function(e,t){return new e(t)},e}(),SerializationMap=function(){function e(){this.classNameMap={}}return e.getMap=function(){return null==e.instance&&(e.instance=new e),e.instance},e.register=function(t){e.getMap().classNameMap[t.className]=[t,t.fromConfig]},e}(),serialization=Object.freeze({Serializable:Serializable,SerializationMap:SerializationMap}),WEBGL_ENVS={HAS_WEBGL:!0},NODE_ENVS={IS_NODE:!0},CHROME_ENVS={IS_CHROME:!0},BROWSER_ENVS={IS_BROWSER:!0},CPU_ENVS={HAS_WEBGL:!1},ALL_ENVS={};function expectArraysClose(e,t,n){if(null==n&&(n=ENV.get(\"TEST_EPSILON\")),e instanceof Tensor||t instanceof Tensor){if(e instanceof Tensor&&t instanceof Tensor){if(e.dtype!==t.dtype)throw new Error(\"Arrays are of different type actual: \"+e.dtype+\" vs expected: \"+t.dtype+\".\");if(!arraysEqual(e.shape,t.shape))throw new Error(\"Arrays are of different shape actual: \"+e.shape+\" vs expected: \"+t.shape+\".\")}}else{var r=e.constructor.name,o=t.constructor.name;if(r!==o)throw new Error(\"Arrays are of different type actual: \"+r+\" vs expected: \"+o)}var a,i;if(a=e instanceof Tensor?e.dataSync():e,i=t instanceof Tensor?t.dataSync():t,a.length!==i.length)throw new Error(\"Arrays have different lengths actual: \"+a.length+\" vs expected: \"+i.length+\".\\nActual: \"+a+\".\\nExpected: \"+i+\".\");for(var s=0;sn)}function expectValuesInRange(e,t,n){var r;r=e instanceof Tensor?e.dataSync():e;for(var o=0;on)throw new Error(\"Value out of range:\"+r[o]+\" low: \"+t+\", high: \"+n)}function expectArrayBuffersEqual(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}var test_util=Object.freeze({WEBGL_ENVS:WEBGL_ENVS,NODE_ENVS:NODE_ENVS,CHROME_ENVS:CHROME_ENVS,BROWSER_ENVS:BROWSER_ENVS,CPU_ENVS:CPU_ENVS,ALL_ENVS:ALL_ENVS,expectArraysClose:expectArraysClose,expectPromiseToFail:expectPromiseToFail,expectArraysEqual:expectArraysEqual,expectNumbersClose:expectNumbersClose,expectValuesInRange:expectValuesInRange,expectArrayBuffersEqual:expectArrayBuffersEqual}),version=\"0.12.8\",webgl=Object.freeze({gpgpu_util:gpgpu_util,webgl_util:webgl_util,MathBackendWebGL:MathBackendWebGL,GPGPUContext:GPGPUContext}),Optimizer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.minimize=function(e,t,n){void 0===t&&(t=!1);var r=this.computeGradients(e,n),o=r.value,a=r.grads;return this.applyGradients(a),Object.keys(a).forEach(function(e){return a[e].dispose()}),t?o:(o.dispose(),null)},t.prototype.computeGradients=function(e,t){return variableGrads(e,t)},t}(Serializable),DEFAULT_FLOAT32_EPSILON=1e-8,DEFAULT_FLOAT16_EPSILON=1e-4;function getOptimizerDefaultEpsilonValue(){return ENV.get(\"WEBGL_RENDER_FLOAT32_ENABLED\")?DEFAULT_FLOAT32_EPSILON:DEFAULT_FLOAT16_EPSILON}var AdadeltaOptimizer=function(e){function t(t,n,r){void 0===r&&(r=null);var o=e.call(this)||this;return o.learningRate=t,o.rho=n,o.epsilon=r,o.accumulatedGrads={},o.accumulatedUpdates={},o.c=keep(scalar(-t)),o.rhoScalar=keep(scalar(n)),o.oneMinusRho=keep(scalar(1-n)),null===r&&(r=getOptimizerDefaultEpsilonValue()),o.epsilonScalar=keep(scalar(r)),o}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulatedGrads[n]){tidy(function(){t.accumulatedGrads[n]=zerosLike(o).variable(!1)})}if(null==r.accumulatedUpdates[n]){tidy(function(){t.accumulatedUpdates[n]=zerosLike(o).variable(!1)})}var a=e[n],i=r.accumulatedGrads[n],s=r.accumulatedUpdates[n];tidy(function(){var e=t.rhoScalar.mul(i).add(t.oneMinusRho.mul(a.square())),r=s.add(t.epsilonScalar).sqrt().div(i.add(t.epsilonScalar).sqrt()).mul(a),u=t.rhoScalar.mul(s).add(t.oneMinusRho.mul(r.square()));t.accumulatedGrads[n].assign(e),t.accumulatedUpdates[n].assign(u);var l=t.c.mul(r).add(o);o.assign(l)})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsilonScalar.dispose(),this.rhoScalar.dispose(),this.oneMinusRho.dispose(),null!=this.accumulatedUpdates&&(Object.keys(this.accumulatedUpdates).forEach(function(t){return e.accumulatedUpdates[t].dispose()}),Object.keys(this.accumulatedGrads).forEach(function(t){return e.accumulatedGrads[t].dispose()}))},t.prototype.getConfig=function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.rho,t.epsilon)},t.className=\"AdadeltaOptimizer\",t}(Optimizer);SerializationMap.register(AdadeltaOptimizer);var AdagradOptimizer=function(e){function t(t,n){void 0===n&&(n=.1);var r=e.call(this)||this;r.learningRate=t,r.initialAccumulatorValue=n,r.accumulatedGrads={},r.c=keep(scalar(-t));var o=getOptimizerDefaultEpsilonValue();return r.epsilon=keep(scalar(o)),r}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulatedGrads[n]){tidy(function(){t.accumulatedGrads[n]=fill(o.shape,t.initialAccumulatorValue).variable(!1)})}var a=e[n],i=r.accumulatedGrads[n];tidy(function(){var e=i.add(a.square());t.accumulatedGrads[n].assign(e);var r=t.c.mul(a.div(e.add(t.epsilon).sqrt())).add(o);o.assign(r)})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){var e=this;this.epsilon.dispose(),this.c.dispose(),null!=this.accumulatedGrads&&Object.keys(this.accumulatedGrads).forEach(function(t){return e.accumulatedGrads[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}},t.fromConfig=function(e,t){return new e(t.learningRate,t.initialAccumulatorValue)},t.className=\"AdagradOptimizer\",t}(Optimizer);SerializationMap.register(AdagradOptimizer);var AdamOptimizer=function(e){function t(t,n,r,o){void 0===o&&(o=null);var a=e.call(this)||this;return a.learningRate=t,a.beta1=n,a.beta2=r,a.epsilon=o,a.accumulatedFirstMoment={},a.accumulatedSecondMoment={},a.c=keep(scalar(-t)),a.beta1Scalar=keep(scalar(n)),a.beta2Scalar=keep(scalar(r)),tidy(function(){a.accBeta1=scalar(n).variable(),a.accBeta2=scalar(r).variable()}),a.oneMinusBeta1=keep(scalar(1-n)),a.oneMinusBeta2=keep(scalar(1-r)),a.one=keep(scalar(1)),null===o&&(o=getOptimizerDefaultEpsilonValue()),a.epsScalar=keep(scalar(o)),a}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;tidy(function(){var n=t.one.sub(t.accBeta1),r=t.one.sub(t.accBeta2);for(var o in e){var a=ENV.engine.registeredVariables[o];if(null==t.accumulatedFirstMoment[o]){var i=!1;t.accumulatedFirstMoment[o]=zerosLike(a).variable(i)}if(null==t.accumulatedSecondMoment[o]){i=!1;t.accumulatedSecondMoment[o]=zerosLike(a).variable(i)}var s=e[o],u=t.accumulatedFirstMoment[o],l=t.accumulatedSecondMoment[o],c=t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)),p=t.beta2Scalar.mul(l).add(t.oneMinusBeta2.mul(s.square())),d=c.div(n),h=p.div(r);t.accumulatedFirstMoment[o].assign(c),t.accumulatedSecondMoment[o].assign(p);var f=t.c.mul(d.div(t.epsScalar.add(h.sqrt()))).add(a);a.assign(f)}t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar)),t.accBeta2.assign(t.accBeta2.mul(t.beta2Scalar))})},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsScalar.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.accBeta1.dispose(),this.accBeta2.dispose(),this.oneMinusBeta1.dispose(),this.oneMinusBeta2.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(t){return e.accumulatedFirstMoment[t].dispose()}),null!=this.accumulatedSecondMoment&&Object.keys(this.accumulatedSecondMoment).forEach(function(t){return e.accumulatedSecondMoment[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)},t.className=\"AdamOptimizer\",t}(Optimizer);SerializationMap.register(AdamOptimizer);var AdamaxOptimizer=function(e){function t(t,n,r,o,a){void 0===o&&(o=null),void 0===a&&(a=0);var i=e.call(this)||this;return i.learningRate=t,i.beta1=n,i.beta2=r,i.epsilon=o,i.decay=a,i.accumulatedFirstMoment={},i.accumulatedWeightedInfNorm={},i.c=keep(scalar(-t)),i.beta1Scalar=keep(scalar(n)),i.beta2Scalar=keep(scalar(r)),i.decayScalar=keep(scalar(a)),tidy(function(){i.iteration=scalar(0).variable(),i.accBeta1=scalar(n).variable()}),i.oneMinusBeta1=keep(scalar(1-n)),i.one=keep(scalar(1)),null===o&&(o=getOptimizerDefaultEpsilonValue()),i.epsScalar=keep(scalar(o)),i}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;tidy(function(){var n=t.one.sub(t.accBeta1),r=t.c.div(t.one.add(t.decayScalar.mul(t.iteration)));for(var o in e){var a=ENV.engine.registeredVariables[o];if(null==t.accumulatedFirstMoment[o]){var i=!1;t.accumulatedFirstMoment[o]=zerosLike(a).variable(i)}if(null==t.accumulatedWeightedInfNorm[o]){i=!1;t.accumulatedWeightedInfNorm[o]=zerosLike(a).variable(i)}var s=e[o],u=t.accumulatedFirstMoment[o],l=t.accumulatedWeightedInfNorm[o],c=t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)),p=t.beta2Scalar.mul(l),d=s.abs(),h=p.maximum(d);t.accumulatedFirstMoment[o].assign(c),t.accumulatedWeightedInfNorm[o].assign(h);var f=r.div(n).mul(c.div(t.epsScalar.add(h))).add(a);a.assign(f)}t.iteration.assign(t.iteration.add(t.one)),t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar))})},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsScalar.dispose(),this.accBeta1.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.oneMinusBeta1.dispose(),this.decayScalar.dispose(),this.iteration.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(t){return e.accumulatedFirstMoment[t].dispose()}),null!=this.accumulatedWeightedInfNorm&&Object.keys(this.accumulatedWeightedInfNorm).forEach(function(t){return e.accumulatedWeightedInfNorm[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)},t.className=\"AdamaxOptimizer\",t}(Optimizer);SerializationMap.register(AdamaxOptimizer);var SGDOptimizer=function(e){function t(t){var n=e.call(this)||this;return n.learningRate=t,n.setLearningRate(t),n}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n],o=ENV.engine.registeredVariables[n];tidy(function(){var e=t.c.mul(r).add(o);o.assign(e)})})},t.prototype.setLearningRate=function(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=keep(scalar(-e))},t.prototype.dispose=function(){this.c.dispose()},t.prototype.getConfig=function(){return{learningRate:this.learningRate}},t.fromConfig=function(e,t){return new e(t.learningRate)},t.className=\"SGDOptimizer\",t}(Optimizer);SerializationMap.register(SGDOptimizer);var MomentumOptimizer=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t)||this;return o.learningRate=t,o.momentum=n,o.useNesterov=r,o.m=scalar(o.momentum),o.accumulations={},o}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulations[n]){tidy(function(){t.accumulations[n]=zerosLike(o).variable(!1)})}var a=r.accumulations[n],i=e[n];tidy(function(){var e,r=t.m.mul(a).add(i);e=t.useNesterov?t.c.mul(i.add(r.mul(t.m))).add(o):t.c.mul(r).add(o),t.accumulations[n].assign(r),o.assign(e)})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){if(e.prototype.dispose.call(this),this.m.dispose(),null!=this.accumulations)for(var t in this.accumulations)this.accumulations[t].dispose()},t.prototype.setMomentum=function(e){this.momentum=e},t.prototype.getConfig=function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}},t.fromConfig=function(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)},t.className=\"MomentumOptimizer\",t}(SGDOptimizer);SerializationMap.register(MomentumOptimizer);var RMSPropOptimizer=function(e){function t(t,n,r,o,a){void 0===n&&(n=.9),void 0===r&&(r=0),void 0===o&&(o=null),void 0===a&&(a=!1);var i=e.call(this)||this;return i.learningRate=t,i.decay=n,i.momentum=r,i.epsilon=o,i.accumulatedMeanSquares={},i.accumulatedMeanGrads={},i.accumulatedMoments={},i.c=keep(scalar(t)),i.decayScalar=keep(scalar(n)),i.momentumScalar=keep(scalar(r)),i.oneMinusDecay=keep(scalar(1-n)),i.centered=a,null===o&&(o=getOptimizerDefaultEpsilonValue()),i.epsilonScalar=keep(scalar(o)),i}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulatedMeanSquares[n]){tidy(function(){t.accumulatedMeanSquares[n]=zerosLike(o).variable(!1)})}if(null==r.accumulatedMeanGrads[n]&&r.centered){tidy(function(){t.accumulatedMeanGrads[n]=zerosLike(o).variable(!1)})}if(null==r.accumulatedMoments[n]){tidy(function(){t.accumulatedMoments[n]=zerosLike(o).variable(!1)})}var a=r.accumulatedMeanSquares[n],i=r.accumulatedMeanGrads[n],s=r.accumulatedMoments[n],u=e[n];tidy(function(){var e=t.decayScalar.mul(a).add(t.oneMinusDecay.mul(u.square()));if(t.centered){var r=t.decayScalar.mul(i).add(t.oneMinusDecay.mul(u)),l=t.momentumScalar.mul(s).add(t.c.mul(u).div(e.sub(r.square().add(t.epsilonScalar)).sqrt()));t.accumulatedMeanSquares[n].assign(e),t.accumulatedMeanGrads[n].assign(r),t.accumulatedMoments[n].assign(l);var c=o.sub(l);o.assign(c)}else{var p=t.decayScalar.mul(a).add(t.oneMinusDecay.mul(u.square()));l=t.momentumScalar.mul(s).add(t.c.mul(u).div(p.add(t.epsilonScalar).sqrt()));t.accumulatedMeanSquares[n].assign(p),t.accumulatedMoments[n].assign(l);c=o.sub(l);o.assign(c)}})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsilonScalar.dispose(),this.decayScalar.dispose(),this.momentumScalar.dispose(),this.oneMinusDecay.dispose(),null!=this.accumulatedMeanSquares&&Object.keys(this.accumulatedMeanSquares).forEach(function(t){return e.accumulatedMeanSquares[t].dispose()}),null!=this.accumulatedMeanGrads&&this.centered&&Object.keys(this.accumulatedMeanGrads).forEach(function(t){return e.accumulatedMeanGrads[t].dispose()}),null!=this.accumulatedMoments&&Object.keys(this.accumulatedMoments).forEach(function(t){return e.accumulatedMoments[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}},t.fromConfig=function(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)},t.className=\"RMSPropOptimizer\",t}(Optimizer);SerializationMap.register(RMSPropOptimizer);var OptimizerConstructors=function(){function e(){}return e.sgd=function(e){return new SGDOptimizer(e)},e.momentum=function(e,t,n){return void 0===n&&(n=!1),new MomentumOptimizer(e,t,n)},e.rmsprop=function(e,t,n,r,o){return void 0===t&&(t=.9),void 0===n&&(n=0),void 0===r&&(r=null),void 0===o&&(o=!1),new RMSPropOptimizer(e,t,n,r,o)},e.adam=function(e,t,n,r){return void 0===e&&(e=.001),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),new AdamOptimizer(e,t,n,r)},e.adadelta=function(e,t,n){return void 0===e&&(e=.001),void 0===t&&(t=.95),void 0===n&&(n=null),new AdadeltaOptimizer(e,t,n)},e.adamax=function(e,t,n,r,o){return void 0===e&&(e=.002),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),void 0===o&&(o=0),new AdamaxOptimizer(e,t,n,r,o)},e.adagrad=function(e,t){return void 0===t&&(t=.1),new AdagradOptimizer(e,t)},e}(),train={sgd:OptimizerConstructors.sgd,momentum:OptimizerConstructors.momentum,adadelta:OptimizerConstructors.adadelta,adagrad:OptimizerConstructors.adagrad,rmsprop:OptimizerConstructors.rmsprop,adamax:OptimizerConstructors.adamax,adam:OptimizerConstructors.adam},setBackend=Environment.setBackend,getBackend=Environment.getBackend,disposeVariables=Environment.disposeVariables,memory=Environment.memory;setOpHandler(ops);export{setBackend,getBackend,disposeVariables,memory,version as version_core,nextFrame,environment,io,serialization,test_util,util,webgl,AdadeltaOptimizer,AdagradOptimizer,AdamOptimizer,AdamaxOptimizer,MomentumOptimizer,Optimizer,RMSPropOptimizer,SGDOptimizer,Tensor,TensorBuffer,variable,Variable,Rank,Reduction,ENV,Environment,image_ops as image,linalg_ops as linalg,loss_ops as losses,op,batchNormalization2d,batchNormalization3d,batchNormalization4d,batchNormalization,concat,concat1d,concat2d,concat3d,concat4d,conv1d,conv2d,depthwiseConv2d,separableConv2d,conv2dTranspose,matMul,dot,outerProduct,reverse,reverse1d,reverse2d,reverse3d,reverse4d,maxPool,avgPool,slice,slice1d,slice2d,slice3d,slice4d,abs,acos,acosh,asin,asinh,atan,atanh,ceil,clipByValue,cos,cosh,erf,exp,expm1,floor,log$1 as log,log1p,logSigmoid,neg,reciprocal,round,rsqrt,sigmoid,sign,sin,sinh,softplus,sqrt,square,step,tan,tanh$1 as tanh,all,any,argMax,argMin,logSumExp,max,mean,min,moments,sum,equal,equalStrict,greater,greaterEqual,greaterEqualStrict,greaterStrict,less,lessEqual,lessEqualStrict,lessStrict,notEqual,notEqualStrict,add,addN,addStrict,atan2,div,divStrict,floorDiv,maximum,maximumStrict,minimum,minimumStrict,mod,modStrict,mul,mulStrict,pow,powStrict,squaredDifference,squaredDifferenceStrict,sub,subStrict,elu,leakyRelu,prelu,relu,selu,logicalAnd,logicalNot,logicalOr,logicalXor,where,whereAsync,buffer,toPixels,print,cast,clone,cumsum,expandDims,eye,fromPixels,multinomial,oneHot,pad,pad1d,pad2d,pad3d,pad4d,rand,randomNormal,randomUniform,reshape,split,squeeze,stack,tile,truncatedNormal,unstack,batchToSpaceND,spaceToBatchND,fill,linspace,ones$1 as ones,range,scalar,tensor,tensor1d,tensor2d,tensor3d,tensor4d,tensor5d,tensor6d,zeros,onesLike,zerosLike,transpose,softmax,localResponseNormalization,norm,gather,unsortedSegmentSum,basicLSTMCell,multiRNNCell,movingAverage,stridedSlice,topk,train,tidy,keep,dispose,time,customGrad,grad,grads,valueAndGrad,valueAndGrads,variableGrads};\n//# sourceMappingURL=tf-core.esm.js.map\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport{keep,scalar,tidy,onesLike,tensor1d,util,zerosLike,train,cast,serialization,add,mul,div,Tensor,Optimizer,mean,io,transpose,reverse,zeros,sum,dispose,neg,variable,ones,eye,randomUniform,truncatedNormal,randomNormal,sub,sqrt,mulStrict,clipByValue,relu,linalg,leakyRelu,elu,conv1d,conv2d,conv2dTranspose,separableConv2d,depthwiseConv2d,maximum,minimum,batchNormalization2d,batchNormalization3d,batchNormalization4d,moments,movingAverage,pad,maxPool,avgPool,squeeze,max,abs,log,softplus,softmax,floor,oneHot,exp,greater,equal,argMax,slice1d,slice2d,slice3d,slice4d,concat,concat1d,concat2d,concat3d,concat4d,tile,matMul,gather,step,min,selu,sigmoid,tanh}from\"@tensorflow/tfjs-core\";var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]t?1:0}function reverseNumberCompare(e,t){return-1*numberCompare(e,t)}function stringToDType(e){switch(e){case\"float32\":return\"float32\";default:throw new ValueError(\"Invalid dtype: \"+e)}}function unique(e){if(null==e)return e;for(var t=[],n=0,r=e;n=0),assert(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every(function(e){return typeof e===t})}function calcL2Norms(e,t){return tidy(function(){return sqrt(sum(mulStrict(e,e),t,!0))})}var Constraint=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getConfig=function(){return{}},t}(serialization.Serializable),MaxNorm=function(e){function t(t){var n=e.call(this)||this;return n.defaultMaxValue=2,n.defaultAxis=0,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return __extends(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){var n=calcL2Norms(e,t.axis),r=clipByValue(n,0,t.maxValue);return mul(e,div(r,add(getScalar(epsilon()),n)))})},t.prototype.getConfig=function(){return{maxValue:this.maxValue,axis:this.axis}},t.className=\"MaxNorm\",t}(Constraint);serialization.SerializationMap.register(MaxNorm);var UnitNorm=function(e){function t(t){var n=e.call(this)||this;return n.defaultAxis=0,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return __extends(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){return div(e,add(getScalar(epsilon()),calcL2Norms(e,t.axis)))})},t.prototype.getConfig=function(){return{axis:this.axis}},t.className=\"UnitNorm\",t}(Constraint);serialization.SerializationMap.register(UnitNorm);var NonNeg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.apply=function(e){return relu(e)},t.className=\"NonNeg\",t}(Constraint);serialization.SerializationMap.register(NonNeg);var MinMaxNorm=function(e){function t(t){var n=e.call(this)||this;return n.defaultMinValue=0,n.defaultMaxValue=1,n.defaultRate=1,n.defaultAxis=0,n.minValue=null!=t.minValue?t.minValue:n.defaultMinValue,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.rate=null!=t.rate?t.rate:n.defaultRate,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return __extends(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){var n=calcL2Norms(e,t.axis),r=add(mul(getScalar(t.rate),clipByValue(n,t.minValue,t.maxValue)),mul(getScalar(1-t.rate),n));return mul(e,div(r,add(getScalar(epsilon()),n)))})},t.prototype.getConfig=function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}},t.className=\"MinMaxNorm\",t}(Constraint);serialization.SerializationMap.register(MinMaxNorm);var CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP={maxNorm:\"MaxNorm\",minMaxNorm:\"MinMaxNorm\",nonNeg:\"NonNeg\",unitNorm:\"UnitNorm\"};function serializeConstraint(e){return serializeKerasObject(e)}function deserializeConstraint(e,t){return void 0===t&&(t={}),deserializeKerasObject(e,serialization.SerializationMap.getMap().classNameMap,t,\"constraint\")}function getConstraint(e){return null==e?null:\"string\"==typeof e?deserializeConstraint({className:e in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP?CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[e]:e,config:{}}):e instanceof Constraint?e:deserializeConstraint(e)}function maxNorm(e){return new MaxNorm(e)}function unitNorm(e){return new UnitNorm(e)}function nonNeg(){return new NonNeg}function minMaxNorm(e){return new MinMaxNorm(e)}var exports_constraints=Object.freeze({maxNorm:maxNorm,unitNorm:unitNorm,nonNeg:nonNeg,minMaxNorm:minMaxNorm}),nameMap=new Map,VALID_DATA_FORMAT_VALUES=[\"channelsFirst\",\"channelsLast\"];function checkDataFormat(e){checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES,\"DataFormat\",e)}var VALID_PADDING_MODE_VALUES=[\"valid\",\"same\",\"causal\"];function checkPaddingMode(e){checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES,\"PaddingMode\",e)}var VALID_POOL_MODE_VALUES=[\"max\",\"avg\"];function checkPoolMode(e){checkStringTypeUnionValue(VALID_POOL_MODE_VALUES,\"PoolMode\",e)}var _nameScopeStack=[],_nameScopeDivider=\"/\";function nameScope(e,t){_nameScopeStack.push(e);try{var n=t();return _nameScopeStack.pop(),n}catch(e){throw _nameScopeStack.pop(),e}}function currentNameScopePrefix(){return 0===_nameScopeStack.length?\"\":_nameScopeStack.join(_nameScopeDivider)+_nameScopeDivider}function getScopedTensorName(e){if(!isValidTensorName(e))throw new Error(\"Not a valid tensor name: '\"+e+\"'\");return currentNameScopePrefix()+e}function getUniqueTensorName(e){if(!isValidTensorName(e))throw new Error(\"Not a valid tensor name: '\"+e+\"'\");nameMap.has(e)||nameMap.set(e,0);var t=nameMap.get(e);if(nameMap.set(e,nameMap.get(e)+1),t>0){var n=e+\"_\"+t;return nameMap.set(n,1),n}return e}var tensorNameRegex=new RegExp(/^[A-Za-z][A-Za-z0-9\\._\\/]*$/);function isValidTensorName(e){return!!e.match(tensorNameRegex)}function isInteger(e){return e===parseInt(e.toString(),10)}function arrayProd(e,t,n){null==t&&(t=0),null==n&&(n=e.length);for(var r=1,i=t;i2e3&&console.warn(\"Orthogonal initializer is being called on a matrix with more than 2000 (\"+e[0]*e[1]+\") elements: Slowness may result.\");var t=randomNormal$1(e[0]>e[1]?[e[1],e[0]]:e,0,1,\"float32\"),r=linalg.gramSchmidt(t);return e[0]>e[1]&&(r=r.transpose()),mul(getScalar(n.gain),r)})},t.prototype.getConfig=function(){return{gain:this.gain,seed:this.seed}},t.className=\"Orthogonal\",t}(Initializer);serialization.SerializationMap.register(Orthogonal);var INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP={constant:\"Constant\",glorotNormal:\"GlorotNormal\",glorotUniform:\"GlorotUniform\",heNormal:\"HeNormal\",identity:\"Identity\",leCunNormal:\"LeCunNormal\",ones:\"Ones\",orthogonal:\"Orthogonal\",randomNormal:\"RandomNormal\",randomUniform:\"RandomUniform\",truncatedNormal:\"TruncatedNormal\",varianceScaling:\"VarianceScaling\",zeros:\"Zeros\"};function deserializeInitializer(e,t){return void 0===t&&(t={}),deserializeKerasObject(e,serialization.SerializationMap.getMap().classNameMap,t,\"initializer\")}function serializeInitializer(e){return serializeKerasObject(e)}function getInitializer(e){if(\"string\"==typeof e){var t=e in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP?INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[e]:e;return\"GlorotUniform\"===t?new GlorotUniform:\"GlorotNormal\"===t?new GlorotNormal:\"HeNormal\"===t?new HeNormal:\"LeCunNormal\"===t?new LeCunNormal:deserializeInitializer({className:t,config:{}})}return e instanceof Initializer?e:deserializeInitializer(e)}function zeros$1(){return new Zeros}function ones$1(){return new Ones}function constant(e){return new Constant(e)}function randomUniform$1(e){return new RandomUniform(e)}function randomNormal$2(e){return new RandomNormal(e)}function truncatedNormal$1(e){return new TruncatedNormal(e)}function identity(e){return new Identity(e)}function varianceScaling(e){return new VarianceScaling(e)}function glorotUniform(e){return new GlorotUniform(e)}function glorotNormal(e){return new GlorotNormal(e)}function heNormal(e){return new HeNormal(e)}function leCunNormal(e){return new LeCunNormal(e)}function orthogonal(e){return new Orthogonal(e)}var exports_initializers=Object.freeze({zeros:zeros$1,ones:ones$1,constant:constant,randomUniform:randomUniform$1,randomNormal:randomNormal$2,truncatedNormal:truncatedNormal$1,identity:identity,varianceScaling:varianceScaling,glorotUniform:glorotUniform,glorotNormal:glorotNormal,heNormal:heNormal,leCunNormal:leCunNormal,orthogonal:orthogonal});function isArrayOfShapes(e){return Array.isArray(e)&&Array.isArray(e[0])}function normalizeShapeList(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function getExactlyOneTensor(e){var t;if(Array.isArray(e)){if(1!==e.length)throw new ValueError(\"Expected Tensor length to be 1; got \"+e.length);t=e[0]}else t=e;return t}function getExactlyOneShape(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return(e=e)[0];throw new ValueError(\"Expected exactly 1 Shape; got \"+e.length)}return e}function countParamsInWeights(e){for(var t=0,n=0,r=e;n1)throw new AttributeError(\"Layer \"+this.name+' has multiple inbound nodes, hence the notion of \"layer input\" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new AttributeError(\"Layer \"+this.name+\" is not connected, no input to return.\");return singletonOrArray(this.getNodeAtIndex(0,\"input\").inputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"output\",{get:function(){if(0===this.inboundNodes.length)throw new AttributeError(\"Layer \"+this.name+\" has no inbound nodes.\");if(this.inboundNodes.length>1)throw new AttributeError(\"Layer \"+this.name+' has multiple inbound nodes, hence the notion of \"layer output\" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return singletonOrArray(this.getNodeAtIndex(0,\"output\").outputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"losses\",{get:function(){return this._losses},enumerable:!0,configurable:!0}),t.prototype.calculateLosses=function(){return this.losses.map(function(e){return e()})},Object.defineProperty(t.prototype,\"updates\",{get:function(){return this._updates},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"built\",{get:function(){return this._built},set:function(e){this._built=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"trainableWeights\",{get:function(){return this.trainable?this._trainableWeights:[]},set:function(e){this._trainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"nonTrainableWeights\",{get:function(){return this.trainable?this._nonTrainableWeights:this._trainableWeights.concat(this._nonTrainableWeights)},set:function(e){this._nonTrainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"weights\",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"stateful\",{get:function(){return this._stateful},enumerable:!0,configurable:!0}),t.prototype.assertInputCompatibility=function(e){if(e=toList(e),null!=this.inputSpec&&0!==this.inputSpec.length){var t=toList(this.inputSpec);if(e.length!==t.length)throw new ValueError(\"Layer \"+this.name+\" expects \"+t.length+\" inputs, but it received \"+e.length+\" input tensors. Input received: \"+e);for(var n=0;ni.maxNDim)throw new ValueError(\"Input \"+n+\" is incompatible with layer \"+this.name+\": expected max_ndim=\"+i.maxNDim+\", found ndim=\"+a);if(null!=i.minNDim&&a=0?o[l]:o[o.length+l];if(null!=u&&-1===[u,null].indexOf(c))throw new ValueError(\"Input \"+n+\" is incompatible with layer \"+this.name+\": expected axis \"+l+\" of input shape to have value \"+u+\" but got shape \"+o+\".\")}}if(null!=i.shape)for(var p=0;p0&&Array.isArray(g[0])?g.map(function(r,i){return new SymbolicTensor(m,r,n,toList(e),t,n.name,i)}):new SymbolicTensor(m,g,n,toList(e),t,n.name),n.addInboundNode(e,f,null,null,d,g,t),null!=n.activityRegularizer)throw new NotImplementedError(\"Layer invocation in the presence of activity regularizer(s) is not supported yet.\");return f})},t.prototype.warnOnIncompatibleInputShape=function(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn(\"The rank of the input tensor provided (shape: \"+JSON.stringify(e)+\") does not match that of the batchInputShape (\"+JSON.stringify(this.batchInputShape)+\") of the layer \"+this.name);else{var t=!1;this.batchInputShape.forEach(function(n,r){null!=n&&null!=e[r]&&e[r]!==n&&(t=!0)}),t&&console.warn(\"The shape of the input tensor (\"+JSON.stringify(e)+\") does not match the expectation of layer \"+this.name+\": \"+JSON.stringify(this.batchInputShape))}},Object.defineProperty(t.prototype,\"outputShape\",{get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new AttributeError(\"The layer \"+this.name+\" has never been called and thus has no defined output shape.\");for(var e=[],t=0,n=this.inboundNodes;t0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];var r=t.inboundNodes[n];if(0===r.inboundLayers.length)return r.inputTensors;for(var i=[],a=0;a1||1===s.length&&s[0].inboundLayers.length>1){t=!1;break}r.push.apply(r,s)}if(t)for(var l=0,u=e.layers;l0&&(r=r.slice(0,r.length-1)+\" \"),r=(r+=e[i]).slice(0,t[i]),r+=\" \".repeat(t[i]-r.length);n(r)}function printLayerSummary(e,t,n){var r;try{r=JSON.stringify(e.outputShape)}catch(e){r=\"multiple\"}printRow([e.name+\" (\"+e.getClassName()+\")\",r,e.countParams().toString()],t,n)}function printLayerSummaryWithConnections(e,t,n,r){var i;try{i=JSON.stringify(e.outputShape)}catch(e){i=\"multiple\"}for(var a=[],o=0,s=e.inboundNodes;o0&&-1===n.indexOf(l)))for(var u=0;u0)throw new ValueError(p.length+\" of \"+r+\" weights are not set: \"+p);batchSetValue(u)}var Container=function(e){function t(n){var r=e.call(this,{})||this;if(r.containerNodes=new Set,r.name=n.name,null==r.name){var i=r.getClassName().toLowerCase();r.name=getUid(i)}if(r.supportsMasking=!1,r.trainable=!0,r.updatable=!0,Array.isArray(n.inputs)?r.inputs=n.inputs.slice():r.inputs=[n.inputs],Array.isArray(n.outputs)?r.outputs=n.outputs.slice():r.outputs=[n.outputs],unique(r.inputs).length!==r.inputs.length)throw new ValueError(\"The list of inputs passed to the model is redundant. All inputs should only appear once. Found: \"+r.inputs.map(function(e){return e.name}));unique(r.outputs).length!==r.outputs.length&&console.warn(\"The list of outputs passed to the model is redundant. All outputs should only appear once. Found: \"+r.outputs.map(function(e){return e.name})),r.inputLayers=[],r.inputLayersNodeIndices=[],r.inputLayersTensorIndices=[],r.outputLayers=[],r.outputLayersNodeIndices=[],r.outputLayersTensorIndices=[],r.layers=[];for(var a=0,o=r.outputs;a1 nodes\"),assert(0===u,\"input layer has >1 tensors\"),r.inputLayers.push(s),r.inputLayersNodeIndices.push(l),r.inputLayersTensorIndices.push(u)}r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var h=0;h=0;)i.splice(i.indexOf(l),1);z.push(l)}},S=[],A=[],I=0,N=r.outputs;Ir?1:0});for(var j=0,W=U;j0)throw new ValueError(\"Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.\");if(!this.trainable)return[];for(var e=[],t=0,n=this.layers;t1)for(var s=0,l=o;s0){for(var d=[],g=0;g0&&e.apply(singletonOrArray(a),r)}function o(e){var r=e.name,a=deserialize(e,null!=t.customObjects?t.customObjects:{});n[r]=a;for(var o=0,s=e.inboundNodes;o0)a=!0;else if(isDataDict(e)){for(var o in e)if(e.hasOwnProperty(o)){a=!0;break}}else a=!0;if(a)throw new ValueError(\"Error when checking model \"+i+\" expected no data, but got \"+e)}return[]}if(null==e)return t.map(function(e){return null});var s;if(isDataDict(e)){e=e,s=[];for(var l=0,u=t;l1)throw new ValueError(\"The model \"+i+\" expects \"+t.length+\" Tensor(s), but only received one Tensor. Found: Tensor with shape \"+e.shape);s=[e]}for(var p=0;p=0&&g!==f)throw new ValueError(\"Error when checking \"+i+\": expected \"+t[p]+\" to have shape [\"+n[p]+\"], but got array with shape [\"+h.shape+\"].\")}}return s}function checkArrayLengths(e,t,n){var r=unique(e.map(function(e){return e.shape[0]}));r.sort();var i=unique(t.map(function(e){return e.shape[0]}));if(i.sort(),r.length>1)throw new ValueError(\"All input Tensors (x) should have the same number of samples. Got array shapes: \"+JSON.stringify(e.map(function(e){return e.shape})));if(i.length>1)throw new ValueError(\"All target Tensors (y) should have the same number of samples. Got array shapes: \"+JSON.stringify(t.map(function(e){return e.shape})));if(r.length>0&&i.length>0&&!util.arraysEqual(r,i))throw new ValueError(\"Input Tensors should have the same number of samples as target Tensors. Found \"+r[0]+\" input sample(s) and \"+i[0]+\" target sample(s).\")}function checkLossAndTargetCompatibility(e,t,n){for(var r=[meanSquaredError,binaryCrossentropy,categoricalCrossentropy],i=0;i=e&&(i=e),n.push([r,i]),r=i;return n}function sliceArrays(e,t,n){return null==e?[null]:Array.isArray(e)?e.map(function(e){return sliceAlongFirstAxis(e,t,n-t)}):sliceAlongFirstAxis(e,t,n-t)}function sliceArraysByIndices(e,t){return tidy(function(){return null==e?null:Array.isArray(e)?e.map(function(e){return sliceArraysByIndices(e,t)}):gather$1(e,\"int32\"===t.dtype?t:t.toInt())})}function checkInputData(e,t,n,r,i){var a;if(void 0===r&&(r=!0),void 0===i&&(i=\"\"),Array.isArray(e)){if(e.length!==t.length)throw new ValueError(\"Error when checking model \"+i+\": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see \"+t.length+\" Tensor(s), but instead got \"+e.length+\" Tensors(s).\");a=e}else{if(t.length>1)throw new ValueError(\"The model expects \"+t.length+\" \"+i+\" Tensors, but only received one Tensor. Found: array with shape \"+JSON.stringify(e.shape)+\".\");a=[e]}if(null!=n)for(var o=0;o1&&(t.metricsTensors.push([n,e]),t.metricsNames.push(t.outputNames[e]+\"_loss\"))}});var p=collectMetrics(e.metrics,this.outputNames);nameScope(\"metric\",function(){for(var e=function(e){if(-1!==c.indexOf(e))return\"continue\";!function(n){for(var r,i,a,o=function(n){if(-1!==[\"accuracy\",\"acc\",\"crossentropy\",\"ce\"].indexOf(n)){var o=t.internalOutputShapes[e];1===o[o.length-1]||t.lossFunctions[e]===binaryCrossentropy?-1!==[\"accuracy\",\"acc\"].indexOf(n)?i=binaryAccuracy:-1!==[\"crossentropy\",\"ce\"].indexOf(n)&&(i=binaryCrossentropy$1):t.lossFunctions[e]===sparseCategoricalCrossentropy?-1!==[\"accuracy\",\"acc\"].indexOf(n)?i=sparseCategoricalAccuracy:-1!==[\"crossentropy\",\"ce\"].indexOf(n)&&(i=sparseCategoricalCrossentropy$1):-1!==[\"accuracy\",\"acc\"].indexOf(n)?i=categoricalAccuracy:-1!==[\"crossentropy\",\"ce\"].indexOf(n)&&(i=categoricalCrossentropy$1);var s=void 0;-1!==[\"accuracy\",\"acc\"].indexOf(n)?s=\"acc\":-1!==[\"crossentropy\",\"ce\"].indexOf(n)&&(s=\"ce\"),a=i,r=\"\"+s}else{var l=get$1(n);a=l,r=\"\"+n}var u;nameScope(r,function(){u=a}),function(e,n,r){t.outputNames.length>1&&(n=t.outputNames[e]+\"_\"+n),t.metricsNames.push(n),t.metricsTensors.push([r,e])}(e,r,u)},s=0,l=n;s0){var c=[];throw t.forEach(function(t,n){null==t&&c.push(e[n])}),new ValueError(\"Cannot find SymbolicTensors for output name(s): \"+JSON.stringify(c))}return t},t.prototype.predictLoop=function(e,t,n){var r=this;return void 0===t&&(t=32),void 0===n&&(n=!1),tidy(function(){var i=r.checkNumSamples(e);if(n)throw new NotImplementedError(\"Verbose predictLoop() is not implemented yet.\");for(var a=makeBatches(i,t),o=[],s=function(t){var n=tidy(function(){var n=a[t][0],i=a[t][1],o=sliceArrays(e,n,i),s=[];if(Array.isArray(o))for(var l=0;l0&&e[0].shape[0]%r!=0)throw new ValueError(\"In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size \"+r+\". Found: \"+e[0].shape[0]+\" sample(s).\");return[e,t,null]},t.prototype.fitLoop=function(e,t,n,r,i,a,o,s,l,u,c,p,h,d){return __awaiter(this,void 0,void 0,function(){var g,f,m,y,v,b,z,w=this;return __generator(this,function(S){switch(S.label){case 0:if(null==r&&(r=32),null==i&&(i=1),null==u&&(u=!0),null==p&&(p=0),g=!1,null!=s&&null!=l&&(g=!0),null!=d&&(g=!0,null==h))throw new ValueError(\"Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.\");if(null!=(f=this.checkNumSamples(t,r,h,\"steps_per_epoch\"))&&(m=range(0,f)),this.history=new History,o=(o=null==o?[new BaseLogger]:[new BaseLogger].concat(o)).concat([this.history]),a>0)throw new NotImplementedError(\"Verbose mode is not implemented yet.\");return(y=new CallbackList(o)).setModel(this),y.setParams({epochs:i,initialEpoch:p,steps:h,verbose:a,doValidation:g,metrics:c}),[4,y.onTrainBegin()];case 1:S.sent(),this.stopTraining=!1,v=function(i){var a,o,c,p,d;return __generator(this,function(v){switch(v.label){case 0:return[4,y.onEpochBegin(i)];case 1:if(v.sent(),a={},null==h)return[3,2];throw new NotImplementedError(\"stepsPerEpoch mode is not implemented yet.\");case 2:if(\"batch\"===u)throw new NotImplementedError(\"batch shuffling is not implemneted yet\");u&&util.shuffle(m),o=tensor1d(m),c=makeBatches(f,r),p=function(i){var u;return __generator(this,function(p){switch(p.label){case 0:return u={},[4,y.onBatchBegin(i,u)];case 1:return p.sent(),tidy(function(){var p=c[i][0],h=c[i][1],d=sliceAlongFirstAxis(o,p,h-p);u.batch=i,u.size=h-p;for(var f=sliceArraysByIndices(t,d),m=e(f),y=0;y1)i+=\"_\"+count(e.slice(0,n),r);t.push(i)}return t},t.prototype.makeTestFunction=function(){var e=this;this.testFunction=function(t){return tidy(function(){for(var n,r=[],i=t.slice(0,e.inputs.length),a=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),o=[],s=0;s0){if(s=!0,2!==n.validationData.length)throw 3===n.validationData.length?new NotImplementedError(\"validationData including sample weights is not supported yet.\"):new ValueError(\"When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; \"+n.validationData+\" is invalid.\");l=n.validationData[0],u=n.validationData[1],h=this.standardizeUserData(l,u,!0,r),l=h[0],u=h[1],c=l.concat(u)}else null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1?(s=!0,d=Math.floor(a[0].shape[0]*(1-n.validationSplit)),g=a[0].shape[0],l=sliceArrays(a,d,g),a=sliceArrays(a,0,d),u=sliceArrays(o,d,g),o=sliceArrays(o,0,d),p=!0,c=l.concat(u)):null!=n.validationSteps&&(s=!0);return f=a.concat(o),this.checkTrainableWeightsConsistency(),m=function(e){var t=e.slice(0,S.inputs.length),n=e.slice(S.inputs.length,S.inputs.length+S.outputs.length),r=[],i=S.collectedTrainableWeights.map(function(e){return e.read()});return[S.optimizer.minimize(function(){for(var e=[],i=0;i1)throw new ValueError(\"Found more than one (\"+n.length+\") save handlers for URL '\"+e+\"'\");e=n[0]}if(null==e.save)throw new ValueError(\"Model.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.\");return[4,io.encodeWeights(this.getNamedWeights(t))];case 1:return r=s.sent(),i=!1,a=null,o=this.toJSON(a,i),[2,e.save({modelTopology:o,weightData:r.data,weightSpecs:r.specs})]}})})},t.className=\"Model\",t}(Container);function loadModelInternal(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){if(\"string\"==typeof e){if(0===(t=io.getLoadHandlers(e)).length)t.push(io.browserHTTPRequest(e));else if(t.length>1)throw new ValueError(\"Found more than one (\"+t.length+\") load handlers for URL '\"+e+\"'\");e=t[0]}return[2,loadModelFromIOHandler(e)]})})}function loadModelFromIOHandler(e,t){return __awaiter(this,void 0,void 0,function(){var n,r,i,a,o;return __generator(this,function(s){switch(s.label){case 0:if(null==e.load)throw new ValueError(\"Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.\");return[4,e.load()];case 1:if(n=s.sent(),null!=(r=n.modelTopology).model_config&&(r=r.model_config),i=deserialize(convertPythonicToTs(r),t),null!=n.weightData){if(null==n.weightSpecs)throw new ValueError(\"Model artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.\");a=!1,o=!0,i.loadWeights(io.decodeWeights(n.weightData,n.weightSpecs),a,o)}return[2,i]}})})}serialization.SerializationMap.register(Model);var Sequential=function(e){function t(t){var n=e.call(this,{inputs:[],outputs:[]})||this;if(t=t||{},n.trainable=!0,n._updatable=!0,n.built=!1,n.name=null!=t.name?t.name:getUid(\"sequential_\"),null!=t.layers)for(var r=0,i=t.layers;r 0 but got \"+JSON.stringify(e.filters))},t}(BaseConv),Conv2D=function(e){function t(n){var r=e.call(this,2,n)||this;return t.verifyConfig(n),r}return __extends(t,e),t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.rank,t},t.verifyConfig=function(e){if(\"number\"!=typeof e.kernelSize&&!checkArrayTypeAndLength(e.kernelSize,\"number\",1,2))throw new ValueError(\"Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received \"+JSON.stringify(e.kernelSize)+\".\")},t.className=\"Conv2D\",t}(Conv);serialization.SerializationMap.register(Conv2D);var Conv2DTranspose=function(e){function t(t){var n=e.call(this,t)||this;if(n.inputSpec=[new InputSpec({ndim:4})],\"same\"!==n.padding&&\"valid\"!==n.padding)throw new ValueError(\"Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode \"+n.padding);return n}return __extends(t,e),t.prototype.build=function(e){if(4!==(e=getExactlyOneShape(e)).length)throw new ValueError(\"Input should have rank 4; Received input shape: \"+JSON.stringify(e));var t=\"channelsFirst\"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ValueError(\"The channel dimension of the inputs should be defined. Found `None`.\");var n,r=e[t],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight(\"kernel\",i,\"float32\",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight(\"bias\",[this.filters],\"float32\",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new InputSpec({ndim:4,axes:(n={},n[t]=r,n)})],this.built=!0},t.prototype.call=function(e,t){var n=this;return tidy(function(){var t=getExactlyOneTensor(e);if(4!==t.shape.length)throw new ValueError(\"Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-\"+t.shape.length);var r,i,a=t.shape,o=a[0];\"channelsFirst\"===n.dataFormat?(r=2,i=3):(r=1,i=2);var s=a[r],l=a[i],u=n.kernelSize[0],c=n.kernelSize[1],p=n.strides[0],h=n.strides[1],d=[o,deconvLength(s,p,u,n.padding),deconvLength(l,h,c,n.padding),n.filters];\"channelsLast\"!==n.dataFormat&&(t=transpose(t,[0,2,3,1]));var g=conv2dTranspose(t,n.kernel.read(),d,n.strides,n.padding);return\"channelsLast\"!==n.dataFormat&&(g=transpose(g,[0,3,1,2])),null!=n.bias&&(g=biasAdd(g,n.bias.read(),n.dataFormat)),null!=n.activation&&(g=n.activation.apply(g)),g})},t.prototype.computeOutputShape=function(e){var t,n,r,i=(e=getExactlyOneShape(e)).slice();\"channelsFirst\"===this.dataFormat?(t=1,n=2,r=3):(t=3,n=1,r=2);var a=this.kernelSize[0],o=this.kernelSize[1],s=this.strides[0],l=this.strides[1];return i[t]=this.filters,i[n]=deconvLength(i[n],s,a,this.padding),i[r]=deconvLength(i[r],l,o,this.padding),i},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.dilationRate,t},t.className=\"Conv2DTranspose\",t}(Conv2D);serialization.SerializationMap.register(Conv2DTranspose);var SeparableConv=function(e){function t(t,n){var r=e.call(this,t,n)||this;if(r.DEFAULT_DEPTHWISE_INITIALIZER=\"glorotUniform\",r.DEFAULT_POINTWISE_INITIALIZER=\"glorotUniform\",r.depthwiseKernel=null,r.pointwiseKernel=null,null==n.filters)throw new ValueError(\"The `filters` configuration field is required by SeparableConv, but is unspecified.\");if(null!=n.kernelInitializer||null!=n.kernelRegularizer||null!=n.kernelConstraint)throw new ValueError(\"Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.\");if(null!=n.padding&&\"same\"!==n.padding&&\"valid\"!==n.padding)throw new ValueError(\"SeparableConv\"+r.rank+\"D supports only padding modes: 'same' and 'valid', but received \"+JSON.stringify(n.padding));return r.depthMultiplier=null==n.depthMultiplier?1:n.depthMultiplier,r.depthwiseInitializer=getInitializer(n.depthwiseInitializer||r.DEFAULT_DEPTHWISE_INITIALIZER),r.depthwiseRegularizer=getRegularizer(n.depthwiseRegularizer),r.depthwiseConstraint=getConstraint(n.depthwiseConstraint),r.pointwiseInitializer=getInitializer(n.depthwiseInitializer||r.DEFAULT_POINTWISE_INITIALIZER),r.pointwiseRegularizer=getRegularizer(n.pointwiseRegularizer),r.pointwiseConstraint=getConstraint(n.pointwiseConstraint),r}return __extends(t,e),t.prototype.build=function(e){if((e=getExactlyOneShape(e)).length1)throw new ValueError(\"Can not merge tensors with different batch sizes. Got tensors with shapes: \"+JSON.stringify(e)+\".\");for(var i=null==e[0]?null:e[0].slice(1),a=1;a1){var y=range(1,s).concat([0]);t.push(transpose(h,y)),u=!0}else t.push(h)}var v=n.mergeFunction(t),b=v.rank;if(u)if(null==b){var z=v.shape;f=[g=z[z.length-1]].concat(z.slice(0,z.length-1));v=transpose(v.reshape([-1,g]),[1,0]).reshape(f)}else if(b>1){y=[b-1].concat(range(0,b-1));v=transpose(v,y)}return v}return n.mergeFunction(e)})},t.prototype.computeOutputShape=function(e){var t;t=null==(e=e)[0]?null:e[0].slice(1);for(var n=1;n1)throw new ValueError(\"A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: \"+JSON.stringify(e))}},t.prototype.mergeFunction=function(e){var t=this;return tidy(function(){return concatenate(e,t.axis)})},t.prototype.computeOutputShape=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new ValueError(\"A `Concatenate` layer should be called on a list of inputs.\");for(var t=e,n=t[0].slice(),r=this.axis<0?n.length+this.axis:this.axis,i=0,a=t.slice(1);i=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new ValueError(\"Axis \"+t+\" of input tensor should have a defined dimension but the layer received an input with shape \"+JSON.stringify(e)+\".\");this.inputSpec=[new InputSpec({ndim:e.length,axes:(r={},r[t]=n,r)})];var r,i=[n];this.scale&&(this.gamma=this.addWeight(\"gamma\",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight(\"beta\",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight(\"moving_mean\",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight(\"moving_variance\",i,null,this.movingVarianceInitializer,null,!1),this.built=!0},t.prototype.call=function(e,t){var n=this;return tidy(function(){var r=null!=t.training&&t.training,i=getExactlyOneTensor(e),a=i.shape,o=a.length,s=range(0,o),l=n.axis>=0?n.axis:n.axis+o;s.splice(l,1);var u=pyListRepeat(1,o);u[l]=a[l];var c=s.slice();c.sort();var p=!util.arraysEqual(c,range(0,o).slice(0,o-1));if(!r)return function(){if(p){var e=n.movingMean.read().reshape(u),t=n.movingVariance.read().reshape(u),r=n.center?n.beta.read().reshape(u):null,a=n.scale?n.gamma.read().reshape(u):null;return batchNormalization(i,e,t,r,a,n.epsilon)}return batchNormalization(i,n.movingMean.read(),n.movingVariance.read(),null==n.beta?null:n.beta.read(),null==n.gamma?null:n.gamma.read(),n.epsilon)}();var h=normalizeBatchInTraining(i,n.gamma.read(),n.beta.read(),s,n.epsilon),d=h[0],g=h[1],f=h[2],m=arrayProd(s.map(function(e){return i.shape[e]})),y=f.mul(getScalar(m/(m-(1+n.epsilon))));return function(){n.stepCount++;var e=movingAverage(n.movingMean.read(),g,n.momentum,n.stepCount);n.movingMean.write(e);var t=movingAverage(n.movingVariance.read(),y,n.momentum,n.stepCount);n.movingVariance.write(t)}(),d})},t.prototype.getConfig=function(){var t={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:serializeInitializer(this.betaInitializer),gammaInitializer:serializeInitializer(this.gammaInitializer),movingMeanInitializer:serializeInitializer(this.movingMeanInitializer),movingVarianceInitializer:serializeInitializer(this.movingVarianceInitializer),betaRegularizer:serializeRegularizer(this.betaRegularizer),gammaRegularizer:serializeRegularizer(this.gammaRegularizer),betaConstraint:serializeConstraint(this.betaConstraint),gammaConstraint:serializeConstraint(this.gammaConstraint)},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className=\"BatchNormalization\",t}(Layer);function spatial2dPadding(e,t,n){return tidy(function(){if(4!==e.rank)throw new ValueError(\"temporalPadding expects input tensor to be 4-D, but received a \"+e.rank+\"-D tensor.\");if(null==t&&(t=[[1,1],[1,1]]),2!==t.length||2!==t[0].length||2!==t[1].length)throw new ValueError(\"spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.\");if(null==n&&(n=imageDataFormat()),\"channelsLast\"!==n&&\"channelsFirst\"!==n)throw new ValueError(\"Unknown data format: \"+n+\". Supported data formats are 'channelsLast' and 'channelsFirst.\");var r;return r=\"channelsFirst\"===n?[[0,0],[0,0],t[0],t[1]]:[[0,0],t[0],t[1],[0,0]],pad(e,r)})}serialization.SerializationMap.register(BatchNormalization);var ZeroPadding2D=function(e){function t(t){var n=this;if(null==t&&(t={}),(n=e.call(this,t)||this).dataFormat=null==t.dataFormat?imageDataFormat():t.dataFormat,null==t.padding)n.padding=[[1,1],[1,1]];else if(\"number\"==typeof t.padding)n.padding=[[t.padding,t.padding],[t.padding,t.padding]];else{if(t.padding=t.padding,2!==t.padding.length)throw new ValueError(\"ZeroPadding2D expects padding to be a length-2 array, but received a length-\"+t.padding.length+\" array.\");var r=void 0,i=void 0;if(\"number\"==typeof t.padding[0])r=[t.padding[0],t.padding[0]],i=[t.padding[1],t.padding[1]];else{if(t.padding=t.padding,2!==t.padding[0].length)throw new ValueError(\"ZeroPadding2D expects height padding to be a length-2 array, but received a length-\"+t.padding[0].length+\" array.\");if(r=t.padding[0],2!==t.padding[1].length)throw new ValueError(\"ZeroPadding2D expects width padding to be a length-2 array, but received a length-\"+t.padding[1].length+\" array.\");i=t.padding[1]}n.padding=[r,i]}return n.inputSpec=[new InputSpec({ndim:4})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){var t,n;return e=getExactlyOneShape(e),\"channelsFirst\"===this.dataFormat?(t=null!=e[2]&&e[2]>=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])},t.prototype.call=function(e,t){var n=this;return tidy(function(){return spatial2dPadding(getExactlyOneTensor(e),n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={padding:this.padding,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className=\"ZeroPadding2D\",t}(Layer);function pool2d(e,t,n,r,i,a){return tidy(function(){var o;checkDataFormat(i),checkPoolMode(a),checkPaddingMode(r),null==n&&(n=[1,1]),null==r&&(r=\"valid\"),null==i&&(i=imageDataFormat()),null==a&&(a=\"max\"),e=preprocessConv2DInput(e,i);var s=\"same\"===r?\"same\":\"valid\";return o=\"max\"===a?maxPool(e,t,n,s):avgPool(e,t,n,s),\"channelsFirst\"===i&&(o=transpose(o,[0,3,1,2])),o})}serialization.SerializationMap.register(ZeroPadding2D);var Pooling1D=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=2),n=e.call(this,t)||this,\"number\"==typeof t.poolSize)n.poolSize=[t.poolSize];else{if(!Array.isArray(t.poolSize)||1!==t.poolSize.length||\"number\"!=typeof t.poolSize[0])throw new ValueError(\"poolSize for 1D convolutional layer must be a number or an Array of a single number, but received \"+JSON.stringify(t.poolSize));n.poolSize=t.poolSize}if(null==t.strides)n.strides=n.poolSize;else if(\"number\"==typeof t.strides)n.strides=[t.strides];else{if(!Array.isArray(t.strides)||1!==t.strides.length||\"number\"!=typeof t.strides[0])throw new ValueError(\"strides for 1D convolutional layer must be a number or an Array of a single number, but received \"+JSON.stringify(t.strides));n.strides=t.strides}return n.padding=null==t.padding?\"valid\":t.padding,checkPaddingMode(n.padding),n.inputSpec=[new InputSpec({ndim:3})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){var t=convOutputLength((e=getExactlyOneShape(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]},t.prototype.call=function(e,t){var n=this;return tidy(function(){n.invokeCallHook(e,t),e=expandDims(getExactlyOneTensor(e),2);var r=n.poolingFunction(getExactlyOneTensor(e),[n.poolSize[0],1],[n.strides[0],1],n.padding,\"channelsLast\");return squeeze(r,[2])})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(Layer),MaxPooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,\"max\")},t.className=\"MaxPooling1D\",t}(Pooling1D);serialization.SerializationMap.register(MaxPooling1D);var AveragePooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,\"avg\")},t.className=\"AveragePooling1D\",t}(Pooling1D);serialization.SerializationMap.register(AveragePooling1D);var Pooling2D=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=[2,2]),(n=e.call(this,t)||this).poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize],null==t.strides)n.strides=n.poolSize;else if(Array.isArray(t.strides)){if(2!==t.strides.length)throw new ValueError(\"If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length \"+t.strides.length+\".\");n.strides=t.strides}else n.strides=[t.strides,t.strides];return n.padding=null==t.padding?\"valid\":t.padding,n.dataFormat=null==t.dataFormat?\"channelsLast\":t.dataFormat,checkDataFormat(n.dataFormat),checkPaddingMode(n.padding),n.inputSpec=[new InputSpec({ndim:4})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){e=getExactlyOneShape(e);var t=\"channelsFirst\"===this.dataFormat?e[2]:e[1],n=\"channelsFirst\"===this.dataFormat?e[3]:e[2];return t=convOutputLength(t,this.poolSize[0],this.padding,this.strides[0]),n=convOutputLength(n,this.poolSize[1],this.padding,this.strides[1]),\"channelsFirst\"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]},t.prototype.call=function(e,t){var n=this;return tidy(function(){return n.invokeCallHook(e,t),n.poolingFunction(getExactlyOneTensor(e),n.poolSize,n.strides,n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(Layer),MaxPooling2D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,\"max\")},t.className=\"MaxPooling2D\",t}(Pooling2D);serialization.SerializationMap.register(MaxPooling2D);var AveragePooling2D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,\"avg\")},t.className=\"AveragePooling2D\",t}(Pooling2D);serialization.SerializationMap.register(AveragePooling2D);var GlobalPooling1D=function(e){function t(t){var n=e.call(this,t)||this;return n.inputSpec=[new InputSpec({ndim:3})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){return[e[0],e[2]]},t.prototype.call=function(e,t){throw new NotImplementedError},t}(Layer),GlobalAveragePooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.call=function(e,t){return tidy(function(){var t=getExactlyOneTensor(e);return mean(t,1)})},t.className=\"GlobalAveragePooling1D\",t}(GlobalPooling1D);serialization.SerializationMap.register(GlobalAveragePooling1D);var GlobalMaxPooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.call=function(e,t){return tidy(function(){var t=getExactlyOneTensor(e);return max(t,1)})},t.className=\"GlobalMaxPooling1D\",t}(GlobalPooling1D);serialization.SerializationMap.register(GlobalMaxPooling1D);var GlobalPooling2D=function(e){function t(t){var n=e.call(this,t)||this;return n.dataFormat=null==t.dataFormat?\"channelsLast\":t.dataFormat,checkDataFormat(n.dataFormat),n.inputSpec=[new InputSpec({ndim:4})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){return e=e,\"channelsLast\"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]},t.prototype.call=function(e,t){throw new NotImplementedError},t.prototype.getConfig=function(){var t={dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(Layer),GlobalAveragePooling2D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.call=function(e,t){var n=this;return tidy(function(){var t=getExactlyOneTensor(e);return\"channelsLast\"===n.dataFormat?mean(t,[1,2]):mean(t,[2,3])})},t.className=\"GlobalAveragePooling2D\",t}(GlobalPooling2D);serialization.SerializationMap.register(GlobalAveragePooling2D);var GlobalMaxPooling2D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.call=function(e,t){var n=this;return tidy(function(){var t=getExactlyOneTensor(e);return\"channelsLast\"===n.dataFormat?max(t,[1,2]):max(t,[2,3])})},t.className=\"GlobalMaxPooling2D\",t}(GlobalPooling2D);function standardizeArgs(e,t,n,r){if(Array.isArray(e)){if(null!=t||null!=n)throw new ValueError(\"When inputs is an array, neither initialState or constants should be provided\");null!=r&&(n=e.slice(e.length-r,e.length),e=e.slice(0,e.length-r)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function i(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=i(t),constants:n=i(n)}}function rnn(e,t,n,r,i,a,o,s){void 0===r&&(r=!1),void 0===o&&(o=!1);var l=t.shape.length;if(l<3)throw new ValueError(\"Input should be at least 3D, but is \"+l+\"D.\");var u,c,p=[1,0].concat(range(2,l));if(t=transpose(t,p),null!=i)throw new NotImplementedError(\"The rnn() function of the deeplearn.js backend does not support masking yet.\");if(null!=a)throw new NotImplementedError(\"The rnn() functoin of the deeplearn.js backend does not support constants yet.\");o&&console.warn(\"Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend.\"),r&&(t=reverse(t,0));for(var h=n,d=t.shape[0],g=0;g1?tile$1(n,[1,e]):n}):t.cell.stateSize>1?[tile$1(n,[1,t.cell.stateSize])]:[n]})},Object.defineProperty(t.prototype,\"trainableWeights\",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"nonTrainableWeights\",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),t.prototype.getConfig=function(){var t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);var n=this.cell.getConfig();t.cell={className:this.cell.getClassName(),config:n};var r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t.className=\"RNN\",t}(Layer);serialization.SerializationMap.register(RNN);var RNNCell=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(Layer),SimpleRNNCell=function(e){function t(t){var n=e.call(this,t)||this;return n.DEFAULT_ACTIVATION=\"tanh\",n.DEFAULT_KERNEL_INITIALIZER=\"glorotNormal\",n.DEFAULT_RECURRENT_INITIALIZER=\"orthogonal\",n.DEFAULT_BIAS_INITIALIZER=\"zeros\",n.units=t.units,n.activation=getActivation(null==t.activation?n.DEFAULT_ACTIVATION:t.activation),n.useBias=null==t.useBias||t.useBias,n.kernelInitializer=getInitializer(t.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=getInitializer(t.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=getInitializer(t.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelRegularizer=getRegularizer(t.kernelRegularizer),n.recurrentRegularizer=getRegularizer(t.recurrentRegularizer),n.biasRegularizer=getRegularizer(t.biasRegularizer),n.kernelConstraint=getConstraint(t.kernelConstraint),n.recurrentConstraint=getConstraint(t.recurrentConstraint),n.biasConstraint=getConstraint(t.biasConstraint),n.dropout=min$1([1,max$1([0,null==t.dropout?0:t.dropout])]),n.recurrentDropout=min$1([1,max$1([0,null==t.recurrentDropout?0:t.recurrentDropout])]),n.stateSize=n.units,n.dropoutMask=null,n.recurrentDropoutMask=null,n}return __extends(t,e),t.prototype.build=function(e){e=getExactlyOneShape(e),this.kernel=this.addWeight(\"kernel\",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight(\"recurrent_kernel\",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight(\"bias\",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},t.prototype.call=function(e,t){var n=this;return tidy(function(){if(2!==(e=e).length)throw new ValueError(\"SimpleRNNCell expects 2 input Tensors, got \"+e.length+\".\");var r=e[1];e=e[0];var i,a=null!=t.training&&t.training;01){for(var a=[],o=0;o= 3D, but received input shape \"+JSON.stringify(t));this.inputSpec=[{shape:t}];var n=[t[0]].concat(t.slice(2));this.layer.built||(this.layer.build(n),this.layer.built=!0),e.prototype.build.call(this,t)},t.prototype.computeOutputShape=function(e){var t=[(e=getExactlyOneShape(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))},t.prototype.call=function(e,t){var n=this;return tidy(function(){return rnn(function(e,r){return[n.layer.call(e,t),[]]},e=getExactlyOneTensor(e),[],!1,null,null,!1,e.shape[1])[1]})},t.className=\"TimeDistributed\",t}(Wrapper);serialization.SerializationMap.register(TimeDistributed);var VALID_BIDIRECTIONAL_MERGE_MODES=[\"sum\",\"mul\",\"concat\",\"ave\"];function checkBidirectionalMergeMode(e){checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES,\"BidirectionalMergeMode\",e)}var Bidirectional=function(e){function t(t){var n=e.call(this,t)||this,r=t.layer.getConfig();if(n.forwardLayer=deserialize({className:t.layer.getClassName(),config:r}),r.goBackwards=!0!==r.goBackwards,n.backwardLayer=deserialize({className:t.layer.getClassName(),config:r}),n.forwardLayer.name=\"forward_\"+n.forwardLayer.name,n.backwardLayer.name=\"backward_\"+n.backwardLayer.name,checkBidirectionalMergeMode(t.mergeMode),n.mergeMode=t.mergeMode,t.weights)throw new NotImplementedError(\"weights support is not implemented for Bidirectional layer yet.\");return n._stateful=t.layer.stateful,n.returnSequences=t.layer.returnSequences,n.returnState=t.layer.returnState,n.supportsMasking=!0,n._trainable=!0,n.inputSpec=t.layer.inputSpec,n.numConstants=null,n}return __extends(t,e),Object.defineProperty(t.prototype,\"trainable\",{get:function(){return this._trainable},set:function(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)},enumerable:!0,configurable:!0}),t.prototype.getWeights=function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())},t.prototype.setWeights=function(e){var t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))},t.prototype.computeOutputShape=function(e){var t,n,r,i=this.forwardLayer.computeOutputShape(e);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(r=i.slice(1),t=i[0]):t=i[0],t=t,\"concat\"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[t].concat(r).concat(r.slice()):singletonOrArray(n)},t.prototype.apply=function(t,n){var r=null==n?null:n.initialState,i=null==n?null:n.constants;null==n&&(n={});var a=standardizeArgs(t,r,i,this.numConstants);if(t=a.inputs,r=a.initialState,i=a.constants,Array.isArray(t)&&(r=t.slice(1),t=t[0]),(null==r||0===r.length)&&null==i)return e.prototype.apply.call(this,t,n);var o=[],s=[];if(null!=r){var l=r.length;if(l%2>0)throw new ValueError(\"When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.\");n.initialState=r,o.push.apply(o,r);var u=r.map(function(e){return new InputSpec({shape:e.shape})});this.forwardLayer.stateSpec=u.slice(0,l/2),this.backwardLayer.stateSpec=u.slice(l/2),s.push.apply(s,u)}if(null!=i)throw new NotImplementedError(\"Support for constants in Bidirectional layers is not implemented yet.\");for(var c=o[0]instanceof SymbolicTensor,p=0,h=o;p0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},x=u-m,v=Math.floor,I=String.fromCharCode;function O(e){throw RangeError(b[e])}function w(e,t){for(var a=e.length,r=[];a--;)r[a]=t(e[a]);return r}function V(e,t){var a=e.split(\"@\"),r=\"\";return a.length>1&&(r=a[0]+\"@\",e=a[1]),r+w((e=e.replace(P,\".\")).split(\".\"),t).join(\".\")}function T(e){for(var t,a,r=[],n=0,o=e.length;n=55296&&t<=56319&&n65535&&(t+=I((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=I(e)}).join(\"\")}function $(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,a){var r=0;for(e=a?v(e/c):e>>1,e+=v(e/t);e>x*l>>1;r+=u)e=v(e/x);return v(r+(x+1)*e/(e+d))}function A(e){var t,a,r,n,o,s,i,d,c,g,N,P=[],b=e.length,x=0,I=h,w=f;for((a=e.lastIndexOf(y))<0&&(a=0),r=0;r=128&&O(\"not-basic\"),P.push(e.charCodeAt(r));for(n=a>0?a+1:0;n=b&&O(\"invalid-input\"),((d=(N=e.charCodeAt(n++))-48<10?N-22:N-65<26?N-65:N-97<26?N-97:u)>=u||d>v((p-x)/s))&&O(\"overflow\"),x+=d*s,!(d<(c=i<=w?m:i>=w+l?l:i-w));i+=u)s>v(p/(g=u-c))&&O(\"overflow\"),s*=g;w=_(x-o,t=P.length+1,0==o),v(x/t)>p-I&&O(\"overflow\"),I+=v(x/t),x%=t,P.splice(x++,0,I)}return k(P)}function S(e){var t,a,r,n,o,s,i,d,c,g,N,P,b,x,w,V=[];for(P=(e=T(e)).length,t=h,a=0,o=f,s=0;s=t&&Nv((p-a)/(b=r+1))&&O(\"overflow\"),a+=(i-t)*b,t=i,s=0;sp&&O(\"overflow\"),N==t){for(d=a,c=u;!(d<(g=c<=o?m:c>=o+l?l:c-o));c+=u)w=d-g,x=u-g,V.push(I($(g+w%x,0))),d=v(w/x);V.push(I($(d,0))),o=_(a,b,r==n),a=0,++r}++a,++t}return V.join(\"\")}if(s={version:\"1.3.2\",ucs2:{decode:T,encode:k},decode:A,encode:S,toASCII:function(e){return V(e,function(e){return N.test(e)?\"xn--\"+S(e):e})},toUnicode:function(e){return V(e,function(e){return g.test(e)?A(e.slice(4).toLowerCase()):e})}},r&&n)if(e.exports==r)n.exports=s;else for(i in s)s.hasOwnProperty(i)&&(r[i]=s[i]);else a.punycode=s}(commonjsGlobal)}),util$1={isString:function(e){return\"string\"==typeof e},isObject:function(e){return\"object\"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var decode=function(e,t,a,r){t=t||\"&\",a=a||\"=\";var n={};if(\"string\"!=typeof e||0===e.length)return n;var o=/\\+/g;e=e.split(t);var s=1e3;r&&\"number\"==typeof r.maxKeys&&(s=r.maxKeys);var i=e.length;s>0&&i>s&&(i=s);for(var p=0;p=0?(u=c.substr(0,f),m=c.substr(f+1)):(u=c,m=\"\"),l=decodeURIComponent(u),d=decodeURIComponent(m),hasOwnProperty(n,l)?Array.isArray(n[l])?n[l].push(d):n[l]=[n[l],d]:n[l]=d}return n},stringifyPrimitive=function(e){switch(typeof e){case\"string\":return e;case\"boolean\":return e?\"true\":\"false\";case\"number\":return isFinite(e)?e:\"\";default:return\"\"}},encode=function(e,t,a,r){return t=t||\"&\",a=a||\"=\",null===e&&(e=void 0),\"object\"==typeof e?Object.keys(e).map(function(r){var n=encodeURIComponent(stringifyPrimitive(r))+a;return Array.isArray(e[r])?e[r].map(function(e){return n+encodeURIComponent(stringifyPrimitive(e))}).join(t):n+encodeURIComponent(stringifyPrimitive(e[r]))}).join(t):r?encodeURIComponent(stringifyPrimitive(r))+a+encodeURIComponent(stringifyPrimitive(e)):\"\"},querystring=createCommonjsModule(function(e,t){t.decode=t.parse=decode,t.encode=t.stringify=encode}),querystring_1=querystring.decode,querystring_2=querystring.parse,querystring_3=querystring.encode,querystring_4=querystring.stringify,parse=urlParse,format=urlFormat;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,delims=[\"<\",\">\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"],unwise=[\"{\",\"}\",\"|\",\"\\\\\",\"^\",\"`\"].concat(delims),autoEscape=[\"'\"].concat(unwise),nonHostChars=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(autoEscape),hostEndingChars=[\"/\",\"?\",\"#\"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,\"javascript:\":!0},hostlessProtocol={javascript:!0,\"javascript:\":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0};function urlParse(e,t,a){if(e&&util$1.isObject(e)&&e instanceof Url)return e;var r=new Url;return r.parse(e,t,a),r}function urlFormat(e){return util$1.isString(e)&&(e=urlParse(e)),e instanceof Url?e.format():Url.prototype.format.call(e)}Url.prototype.parse=function(e,t,a){if(!util$1.isString(e))throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof e);var r=e.indexOf(\"?\"),n=-1!==r&&r127?b+=\"x\":b+=P[x];if(!b.match(hostnamePartPattern)){var I=g.slice(0,f),O=g.slice(f+1),w=P.match(hostnamePartStart);w&&(I.push(w[1]),O.unshift(w[2])),O.length&&(s=\"/\"+O.join(\".\")+s),this.hostname=I.join(\".\");break}}}this.hostname.length>hostnameMaxLen?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=punycode.toASCII(this.hostname));var V=this.port?\":\"+this.port:\"\",T=this.hostname||\"\";this.host=T+V,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==s[0]&&(s=\"/\"+s))}if(!unsafeProtocol[u])for(f=0,N=autoEscape.length;f0)&&a.host.split(\"@\"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift());return a.search=e.search,a.query=e.query,util$1.isNull(a.pathname)&&util$1.isNull(a.search)||(a.path=(a.pathname?a.pathname:\"\")+(a.search?a.search:\"\")),a.href=a.format(),a}if(!P.length)return a.pathname=null,a.search?a.path=\"/\"+a.search:a.path=null,a.href=a.format(),a;for(var x=P.slice(-1)[0],v=(a.host||e.host||P.length>1)&&(\".\"===x||\"..\"===x)||\"\"===x,I=0,O=P.length;O>=0;O--)\".\"===(x=P[O])?P.splice(O,1):\"..\"===x?(P.splice(O,1),I++):I&&(P.splice(O,1),I--);if(!g&&!N)for(;I--;I)P.unshift(\"..\");!g||\"\"===P[0]||P[0]&&\"/\"===P[0].charAt(0)||P.unshift(\"\"),v&&\"/\"!==P.join(\"/\").substr(-1)&&P.push(\"\");var w,V=\"\"===P[0]||P[0]&&\"/\"===P[0].charAt(0);b&&(a.hostname=a.host=V?\"\":P.length?P.shift():\"\",(w=!!(a.host&&a.host.indexOf(\"@\")>0)&&a.host.split(\"@\"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift()));return(g=g||a.host&&P.length)&&!V&&P.unshift(\"\"),P.length?a.pathname=P.join(\"/\"):(a.pathname=null,a.path=null),util$1.isNull(a.pathname)&&util$1.isNull(a.search)||(a.path=(a.pathname?a.pathname:\"\")+(a.search?a.search:\"\")),a.auth=e.auth||a.auth,a.slashes=a.slashes||e.slashes,a.href=a.format(),a},Url.prototype.parseHost=function(){var e=this.host,t=portPattern.exec(e);t&&(\":\"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var aspromise=asPromise;function asPromise(e,t){for(var a=new Array(arguments.length-1),r=0,n=2,o=!0;n1&&\"=\"===e.charAt(t);)++a;return Math.ceil(3*e.length)/4-a};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;a.encode=function(e,t,a){for(var n,o=null,s=[],i=0,p=0;t>2],n=(3&u)<<4,p=1;break;case 1:s[i++]=r[n|u>>4],n=(15&u)<<2,p=2;break;case 2:s[i++]=r[n|u>>6],s[i++]=r[63&u],p=0}i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),i=0)}return p&&(s[i++]=r[n],s[i++]=61,1===p&&(s[i++]=61)),o?(i&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join(\"\")):String.fromCharCode.apply(String,s.slice(0,i))};a.decode=function(e,t,a){for(var r,o=a,s=0,i=0;i1)break;if(void 0===(p=n[p]))throw Error(\"invalid encoding\");switch(s){case 0:r=p,s=1;break;case 1:t[a++]=r<<2|(48&p)>>4,r=p,s=2;break;case 2:t[a++]=(15&r)<<4|(60&p)>>2,r=p,s=3;break;case 3:t[a++]=(3&r)<<6|p,s=0}}if(1===s)throw Error(\"invalid encoding\");return a-o},a.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}),eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(e,t,a){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:a||this}),this},EventEmitter.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var a=this._listeners[e],r=0;r0?0:2147483648,a,r);else if(isNaN(t))e(2143289344,a,r);else if(t>3.4028234663852886e38)e((n<<31|2139095040)>>>0,a,r);else if(t<1.1754943508222875e-38)e((n<<31|Math.round(t/1.401298464324817e-45))>>>0,a,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((n<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,a,r)}}function a(e,t,a){var r=e(t,a),n=2*(r>>31)+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:n*(1/0):0===o?1.401298464324817e-45*n*s:n*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,writeUintLE),e.writeFloatBE=t.bind(null,writeUintBE),e.readFloatLE=a.bind(null,readUintLE),e.readFloatBE=a.bind(null,readUintBE)}(),\"undefined\"!=typeof Float64Array?function(){var t=new Float64Array([-0]),a=new Uint8Array(t.buffer),r=128===a[7];function n(e,r,n){t[0]=e,r[n]=a[0],r[n+1]=a[1],r[n+2]=a[2],r[n+3]=a[3],r[n+4]=a[4],r[n+5]=a[5],r[n+6]=a[6],r[n+7]=a[7]}function o(e,r,n){t[0]=e,r[n]=a[7],r[n+1]=a[6],r[n+2]=a[5],r[n+3]=a[4],r[n+4]=a[3],r[n+5]=a[2],r[n+6]=a[1],r[n+7]=a[0]}function s(e,r){return a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],t[0]}function i(e,r){return a[7]=e[r],a[6]=e[r+1],a[5]=e[r+2],a[4]=e[r+3],a[3]=e[r+4],a[2]=e[r+5],a[1]=e[r+6],a[0]=e[r+7],t[0]}e.writeDoubleLE=r?n:o,e.writeDoubleBE=r?o:n,e.readDoubleLE=r?s:i,e.readDoubleBE=r?i:s}():function(){function t(e,t,a,r,n,o){var s=r<0?1:0;if(s&&(r=-r),0===r)e(0,n,o+t),e(1/r>0?0:2147483648,n,o+a);else if(isNaN(r))e(0,n,o+t),e(2146959360,n,o+a);else if(r>1.7976931348623157e308)e(0,n,o+t),e((s<<31|2146435072)>>>0,n,o+a);else{var i;if(r<2.2250738585072014e-308)e((i=r/5e-324)>>>0,n,o+t),e((s<<31|i/4294967296)>>>0,n,o+a);else{var p=Math.floor(Math.log(r)/Math.LN2);1024===p&&(p=1023),e(4503599627370496*(i=r*Math.pow(2,-p))>>>0,n,o+t),e((s<<31|p+1023<<20|1048576*i&1048575)>>>0,n,o+a)}}}function a(e,t,a,r,n){var o=e(r,n+t),s=e(r,n+a),i=2*(s>>31)+1,p=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===p?u?NaN:i*(1/0):0===p?5e-324*i*u:i*Math.pow(2,p-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,writeUintLE,0,4),e.writeDoubleBE=t.bind(null,writeUintBE,4,0),e.readDoubleLE=a.bind(null,readUintLE,0,4),e.readDoubleBE=a.bind(null,readUintBE,4,0)}(),e}function writeUintLE(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}function writeUintBE(e,t,a){t[a]=e>>>24,t[a+1]=e>>>16&255,t[a+2]=e>>>8&255,t[a+3]=255&e}function readUintLE(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function readUintBE(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod$$1=eval(\"quire\".replace(/^/,\"re\"))(moduleName);if(mod$$1&&(mod$$1.length||Object.keys(mod$$1).length))return mod$$1}catch(e){}return null}var utf8_1=createCommonjsModule(function(e,t){var a=t;a.length=function(e){for(var t=0,a=0,r=0;r191&&r<224?o[s++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(r>>10),o[s++]=56320+(1023&r)):o[s++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join(\"\")):String.fromCharCode.apply(String,o.slice(0,s))},a.write=function(e,t,a){for(var r,n,o=a,s=0;s>6|192,t[a++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&n),++s,t[a++]=r>>18|240,t[a++]=r>>12&63|128,t[a++]=r>>6&63|128,t[a++]=63&r|128):(t[a++]=r>>12|224,t[a++]=r>>6&63|128,t[a++]=63&r|128);return a-o}}),pool_1=pool;function pool(e,t,a){var r=a||8192,n=r>>>1,o=null,s=r;return function(a){if(a<1||a>n)return e(a);s+a>r&&(o=e(r),s=0);var i=t.call(o,s,s+=a);return 7&s&&(s=1+(7|s)),i}}var longbits=LongBits;function LongBits(e,t){this.lo=e>>>0,this.hi=t>>>0}var zero=LongBits.zero=new LongBits(0,0);zero.toNumber=function(){return 0},zero.zzEncode=zero.zzDecode=function(){return this},zero.length=function(){return 1};var zeroHash=LongBits.zeroHash=\"\\0\\0\\0\\0\\0\\0\\0\\0\";LongBits.fromNumber=function(e){if(0===e)return zero;var t=e<0;t&&(e=-e);var a=e>>>0,r=(e-a)/4294967296>>>0;return t&&(r=~r>>>0,a=~a>>>0,++a>4294967295&&(a=0,++r>4294967295&&(r=0))),new LongBits(a,r)},LongBits.from=function(e){if(\"number\"==typeof e)return LongBits.fromNumber(e);if(minimal.isString(e)){if(!minimal.Long)return LongBits.fromNumber(parseInt(e,10));e=minimal.Long.fromString(e)}return e.low||e.high?new LongBits(e.low>>>0,e.high>>>0):zero},LongBits.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,a=~this.hi>>>0;return t||(a=a+1>>>0),-(t+4294967296*a)}return this.lo+4294967296*this.hi},LongBits.prototype.toLong=function(e){return minimal.Long?new minimal.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var charCodeAt=String.prototype.charCodeAt;LongBits.fromHash=function(e){return e===zeroHash?zero:new LongBits((charCodeAt.call(e,0)|charCodeAt.call(e,1)<<8|charCodeAt.call(e,2)<<16|charCodeAt.call(e,3)<<24)>>>0,(charCodeAt.call(e,4)|charCodeAt.call(e,5)<<8|charCodeAt.call(e,6)<<16|charCodeAt.call(e,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},LongBits.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},LongBits.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,a=this.hi>>>24;return 0===a?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:a<128?9:10};var minimal=createCommonjsModule(function(e,t){var a=t;function r(e,t,a){for(var r=Object.keys(t),n=0;n0)},a.Buffer=function(){try{var e=a.inquire(\"buffer\").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),a._Buffer_from=null,a._Buffer_allocUnsafe=null,a.newBuffer=function(e){return\"number\"==typeof e?a.Buffer?a._Buffer_allocUnsafe(e):new a.Array(e):a.Buffer?a._Buffer_from(e):\"undefined\"==typeof Uint8Array?e:new Uint8Array(e)},a.Array=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,a.Long=commonjsGlobal.dcodeIO&&commonjsGlobal.dcodeIO.Long||a.inquire(\"long\"),a.key2Re=/^true|false|0|1$/,a.key32Re=/^-?(?:0|[1-9][0-9]*)$/,a.key64Re=/^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,a.longToHash=function(e){return e?a.LongBits.from(e).toHash():a.LongBits.zeroHash},a.longFromHash=function(e,t){var r=a.LongBits.fromHash(e);return a.Long?a.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},a.merge=r,a.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},a.newError=n,a.ProtocolError=n(\"ProtocolError\"),a.oneOfGetter=function(e){for(var t={},a=0;a-1;--a)if(1===t[e[a]]&&void 0!==this[e[a]]&&null!==this[e[a]])return e[a]}},a.oneOfSetter=function(e){return function(t){for(var a=0;a127;)t[a++]=127&e|128,e>>>=7;t[a]=e}function VarintOp(e,t){this.len=e,this.next=void 0,this.val=t}function writeVarint64(e,t,a){for(;e.hi;)t[a++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[a++]=127&e.lo|128,e.lo=e.lo>>>7;t[a++]=e.lo}function writeFixed32(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}Writer.create=minimal.Buffer?function(){return(Writer.create=function(){return new BufferWriter})()}:function(){return new Writer},Writer.alloc=function(e){return new minimal.Array(e)},minimal.Array!==Array&&(Writer.alloc=minimal.pool(Writer.alloc,minimal.Array.prototype.subarray)),Writer.prototype._push=function(e,t,a){return this.tail=this.tail.next=new Op(e,t,a),this.len+=t,this},VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new VarintOp((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},Writer.prototype.int32=function(e){return e<0?this._push(writeVarint64,10,LongBits$1.fromNumber(e)):this.uint32(e)},Writer.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},Writer.prototype.uint64=function(e){var t=LongBits$1.from(e);return this._push(writeVarint64,t.length(),t)},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(e){var t=LongBits$1.from(e).zzEncode();return this._push(writeVarint64,t.length(),t)},Writer.prototype.bool=function(e){return this._push(writeByte,1,e?1:0)},Writer.prototype.fixed32=function(e){return this._push(writeFixed32,4,e>>>0)},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(e){var t=LongBits$1.from(e);return this._push(writeFixed32,4,t.lo)._push(writeFixed32,4,t.hi)},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(e){return this._push(minimal.float.writeFloatLE,4,e)},Writer.prototype.double=function(e){return this._push(minimal.float.writeDoubleLE,8,e)};var writeBytes=minimal.Array.prototype.set?function(e,t,a){t.set(e,a)}:function(e,t,a){for(var r=0;r>>0;if(!t)return this._push(writeByte,1,0);if(minimal.isString(e)){var a=Writer.alloc(t=base64.length(e));base64.decode(e,a,0),e=a}return this.uint32(t)._push(writeBytes,t,e)},Writer.prototype.string=function(e){var t=utf8.length(e);return t?this.uint32(t)._push(utf8.write,t,e):this._push(writeByte,1,0)},Writer.prototype.fork=function(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this},Writer.prototype.ldelim=function(){var e=this.head,t=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=e.next,this.tail=t,this.len+=a),this},Writer.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),a=0;e;)e.fn(e.val,t,a),a+=e.len,e=e.next;return t},Writer._configure=function(e){BufferWriter=e};var writer_buffer=BufferWriter$1;(BufferWriter$1.prototype=Object.create(writer.prototype)).constructor=BufferWriter$1;var Buffer=minimal.Buffer;function BufferWriter$1(){writer.call(this)}BufferWriter$1.alloc=function(e){return(BufferWriter$1.alloc=minimal._Buffer_allocUnsafe)(e)};var writeBytesBuffer=Buffer&&Buffer.prototype instanceof Uint8Array&&\"set\"===Buffer.prototype.set.name?function(e,t,a){t.set(e,a)}:function(e,t,a){if(e.copy)e.copy(t,a,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this._push(writeBytesBuffer,t,e),this},BufferWriter$1.prototype.string=function(e){var t=Buffer.byteLength(e);return this.uint32(t),t&&this._push(writeStringBuffer,t,e),this};var reader=Reader,BufferReader,LongBits$2=minimal.LongBits,utf8$1=minimal.utf8;function indexOutOfRange(e,t){return RangeError(\"index out of range: \"+e.pos+\" + \"+(t||1)+\" > \"+e.len)}function Reader(e){this.buf=e,this.pos=0,this.len=e.length}var create_array=\"undefined\"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Reader(e);throw Error(\"illegal buffer\")}:function(e){if(Array.isArray(e))return new Reader(e);throw Error(\"illegal buffer\")};function readLongVarint(){var e=new LongBits$2(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(\"invalid varint encoding\")}function readFixed32_end(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits$2(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader.create=minimal.Buffer?function(e){return(Reader.create=function(e){return minimal.Buffer.isBuffer(e)?new BufferReader(e):create_array(e)})(e)}:create_array,Reader.prototype._slice=minimal.Array.prototype.subarray||minimal.Array.prototype.slice,Reader.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return e}}(),Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},Reader.prototype.bool=function(){return 0!==this.uint32()},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},Reader.prototype.bytes=function(){var e=this.uint32(),t=this.pos,a=this.pos+e;if(a>this.len)throw indexOutOfRange(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,a):t===a?new this.buf.constructor(0):this._slice.call(this.buf,t,a)},Reader.prototype.string=function(){var e=this.bytes();return utf8$1.read(e,0,e.length)},Reader.prototype.skip=function(e){if(\"number\"==typeof e){if(this.pos+e>this.len)throw indexOutOfRange(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw indexOutOfRange(this)}while(128&this.buf[this.pos++]);return this},Reader.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error(\"invalid wire type \"+e+\" at offset \"+this.pos)}return this},Reader._configure=function(e){BufferReader=e;var t=minimal.Long?\"toLong\":\"toNumber\";minimal.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader$1;function BufferReader$1(e){reader.call(this,e)}(BufferReader$1.prototype=Object.create(reader.prototype)).constructor=BufferReader$1,minimal.Buffer&&(BufferReader$1.prototype._slice=minimal.Buffer.prototype.slice),BufferReader$1.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))};var service=Service;function Service(e,t,a){if(\"function\"!=typeof e)throw TypeError(\"rpcImpl must be a function\");minimal.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(a)}(Service.prototype=Object.create(minimal.EventEmitter.prototype)).constructor=Service,Service.prototype.rpcCall=function e(t,a,r,n,o){if(!n)throw TypeError(\"request must be specified\");var s=this;if(!o)return minimal.asPromise(e,s,t,a,r,n);if(s.rpcImpl)try{return s.rpcImpl(t,a[s.requestDelimited?\"encodeDelimited\":\"encode\"](n).finish(),function(e,a){if(e)return s.emit(\"error\",e,t),o(e);if(null!==a){if(!(a instanceof r))try{a=r[s.responseDelimited?\"decodeDelimited\":\"decode\"](a)}catch(e){return s.emit(\"error\",e,t),o(e)}return s.emit(\"data\",a,t),o(null,a)}s.end(!0)})}catch(e){return s.emit(\"error\",e,t),void setTimeout(function(){o(e)},0)}else setTimeout(function(){o(Error(\"already ended\"))},0)},Service.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(\"end\").off()),this};var rpc_1=createCommonjsModule(function(e,t){t.Service=service}),roots={},indexMinimal=createCommonjsModule(function(e,t){var a=t;function r(){a.Reader._configure(a.BufferReader),a.util._configure()}a.build=\"minimal\",a.Writer=writer,a.BufferWriter=writer_buffer,a.Reader=reader,a.BufferReader=reader_buffer,a.util=minimal,a.rpc=rpc_1,a.roots=roots,a.configure=r,a.Writer._configure(a.BufferWriter),r()}),minimal$1=indexMinimal,minimal_1=minimal$1.roots,minimal_2=minimal$1.Reader,minimal_3=minimal$1.util,$Reader=minimal$1.Reader,$util=minimal$1.util,$root=minimal$1.roots.default||(minimal$1.roots.default={});$root.tensorflow=function(){var e,t,a={};return a.Any=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.typeUrl=e.string();break;case 2:r.value=e.bytes();break;default:e.skipType(7&n)}}return r},e}(),a.DataType=(e={},(t=Object.create(e))[e[0]=\"DT_INVALID\"]=0,t[e[1]=\"DT_FLOAT\"]=1,t[e[2]=\"DT_DOUBLE\"]=2,t[e[3]=\"DT_INT32\"]=3,t[e[4]=\"DT_UINT8\"]=4,t[e[5]=\"DT_INT16\"]=5,t[e[6]=\"DT_INT8\"]=6,t[e[7]=\"DT_STRING\"]=7,t[e[8]=\"DT_COMPLEX64\"]=8,t[e[9]=\"DT_INT64\"]=9,t[e[10]=\"DT_BOOL\"]=10,t[e[11]=\"DT_QINT8\"]=11,t[e[12]=\"DT_QUINT8\"]=12,t[e[13]=\"DT_QINT32\"]=13,t[e[14]=\"DT_BFLOAT16\"]=14,t[e[101]=\"DT_FLOAT_REF\"]=101,t[e[102]=\"DT_DOUBLE_REF\"]=102,t[e[103]=\"DT_INT32_REF\"]=103,t[e[104]=\"DT_UINT8_REF\"]=104,t[e[105]=\"DT_INT16_REF\"]=105,t[e[106]=\"DT_INT8_REF\"]=106,t[e[107]=\"DT_STRING_REF\"]=107,t[e[108]=\"DT_COMPLEX64_REF\"]=108,t[e[109]=\"DT_INT64_REF\"]=109,t[e[110]=\"DT_BOOL_REF\"]=110,t[e[111]=\"DT_QINT8_REF\"]=111,t[e[112]=\"DT_QUINT8_REF\"]=112,t[e[113]=\"DT_QINT32_REF\"]=113,t[e[114]=\"DT_BFLOAT16_REF\"]=114,t),a.TensorShape=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.dim&&r.dim.length||(r.dim=[]),r.dim.push($root.tensorflow.TensorShape.Dim.decode(e,e.uint32()));break;case 3:r.unknownRank=e.bool();break;default:e.skipType(7&n)}}return r},e.Dim=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.size=e.int64();break;case 2:r.name=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.Tensor=function(){function e(e){if(this.floatVal=[],this.doubleVal=[],this.intVal=[],this.stringVal=[],this.scomplexVal=[],this.int64Val=[],this.boolVal=[],this.uint32Val=[],this.uint64Val=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.dtype=e.int32();break;case 2:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 3:r.versionNumber=e.int32();break;case 4:r.tensorContent=e.bytes();break;case 5:if(r.floatVal&&r.floatVal.length||(r.floatVal=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.list=$root.tensorflow.AttrValue.ListValue.decode(e,e.uint32());break;case 2:r.s=e.bytes();break;case 3:r.i=e.int64();break;case 4:r.f=e.float();break;case 5:r.b=e.bool();break;case 6:r.type=e.int32();break;case 7:r.shape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 8:r.tensor=$root.tensorflow.Tensor.decode(e,e.uint32());break;case 9:r.placeholder=e.string();break;case 10:r.func=$root.tensorflow.NameAttrList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.ListValue=function(){function e(e){if(this.s=[],this.i=[],this.f=[],this.b=[],this.type=[],this.shape=[],this.tensor=[],this.func=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.s&&r.s.length||(r.s=[]),r.s.push(e.bytes());break;case 3:if(r.i&&r.i.length||(r.i=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.name=e.string();break;case 2:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),a.NodeDef=function(){function e(e){if(this.input=[],this.attr={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.name=e.string();break;case 2:n.op=e.string();break;case 3:n.input&&n.input.length||(n.input=[]),n.input.push(e.string());break;case 4:n.device=e.string();break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),a.VersionDef=function(){function e(e){if(this.badConsumers=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.producer=e.int32();break;case 2:r.minConsumer=e.int32();break;case 3:if(r.badConsumers&&r.badConsumers.length||(r.badConsumers=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:r.versions=$root.tensorflow.VersionDef.decode(e,e.uint32());break;case 2:r.library=$root.tensorflow.FunctionDefLibrary.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),a.CollectionDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.nodeList=$root.tensorflow.CollectionDef.NodeList.decode(e,e.uint32());break;case 2:r.bytesList=$root.tensorflow.CollectionDef.BytesList.decode(e,e.uint32());break;case 3:r.int64List=$root.tensorflow.CollectionDef.Int64List.decode(e,e.uint32());break;case 4:r.floatList=$root.tensorflow.CollectionDef.FloatList.decode(e,e.uint32());break;case 5:r.anyList=$root.tensorflow.CollectionDef.AnyList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.NodeList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.string());break;default:e.skipType(7&n)}}return r},e}(),e.BytesList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.bytes());break;default:e.skipType(7&n)}}return r},e}(),e.Int64List=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push($root.tensorflow.Any.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),e}(),a.SaverDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.filenameTensorName=e.string();break;case 2:r.saveTensorName=e.string();break;case 3:r.restoreOpName=e.string();break;case 4:r.maxToKeep=e.int32();break;case 5:r.sharded=e.bool();break;case 6:r.keepCheckpointEveryNHours=e.float();break;case 7:r.version=e.int32();break;default:e.skipType(7&n)}}return r},e.CheckpointFormatVersion=(t={},(a=Object.create(t))[t[0]=\"LEGACY\"]=0,a[t[1]=\"V1\"]=1,a[t[2]=\"V2\"]=2,a),e}(),a.TensorInfo=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 4:r.cooSparse=$root.tensorflow.TensorInfo.CooSparse.decode(e,e.uint32());break;case 2:r.dtype=e.int32();break;case 3:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.CooSparse=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.valuesTensorName=e.string();break;case 2:r.indicesTensorName=e.string();break;case 3:r.denseShapeTensorName=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.SignatureDef=function(){function e(e){if(this.inputs={},this.outputs={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:e.skip().pos++,n.inputs===$util.emptyObject&&(n.inputs={}),a=e.string(),e.pos++,n.inputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:e.skip().pos++,n.outputs===$util.emptyObject&&(n.outputs={}),a=e.string(),e.pos++,n.outputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 3:n.methodName=e.string();break;default:e.skipType(7&o)}}return n},e}(),a.AssetFileDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.tensorInfo=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:r.filename=e.string();break;default:e.skipType(7&n)}}return r},e}(),a.OpDef=function(){function e(e){if(this.inputArg=[],this.outputArg=[],this.attr=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.inputArg&&r.inputArg.length||(r.inputArg=[]),r.inputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 3:r.outputArg&&r.outputArg.length||(r.outputArg=[]),r.outputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 4:r.attr&&r.attr.length||(r.attr=[]),r.attr.push($root.tensorflow.OpDef.AttrDef.decode(e,e.uint32()));break;case 8:r.deprecation=$root.tensorflow.OpDef.OpDeprecation.decode(e,e.uint32());break;case 5:r.summary=e.string();break;case 6:r.description=e.string();break;case 18:r.isCommutative=e.bool();break;case 16:r.isAggregate=e.bool();break;case 17:r.isStateful=e.bool();break;case 19:r.allowsUninitializedInput=e.bool();break;default:e.skipType(7&n)}}return r},e.ArgDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.description=e.string();break;case 3:r.type=e.int32();break;case 4:r.typeAttr=e.string();break;case 5:r.numberAttr=e.string();break;case 6:r.typeListAttr=e.string();break;case 16:r.isRef=e.bool();break;default:e.skipType(7&n)}}return r},e}(),e.AttrDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.type=e.string();break;case 3:r.defaultValue=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 4:r.description=e.string();break;case 5:r.hasMinimum=e.bool();break;case 6:r.minimum=e.int64();break;case 7:r.allowedValues=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),e.OpDeprecation=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.version=e.int32();break;case 2:r.explanation=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.OpList=function(){function e(e){if(this.op=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.op&&r.op.length||(r.op=[]),r.op.push($root.tensorflow.OpDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),a.MetaGraphDef=function(){function e(e){if(this.collectionDef={},this.signatureDef={},this.assetFileDef=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.metaInfoDef=$root.tensorflow.MetaGraphDef.MetaInfoDef.decode(e,e.uint32());break;case 2:n.graphDef=$root.tensorflow.GraphDef.decode(e,e.uint32());break;case 3:n.saverDef=$root.tensorflow.SaverDef.decode(e,e.uint32());break;case 4:e.skip().pos++,n.collectionDef===$util.emptyObject&&(n.collectionDef={}),a=e.string(),e.pos++,n.collectionDef[a]=$root.tensorflow.CollectionDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.signatureDef===$util.emptyObject&&(n.signatureDef={}),a=e.string(),e.pos++,n.signatureDef[a]=$root.tensorflow.SignatureDef.decode(e,e.uint32());break;case 6:n.assetFileDef&&n.assetFileDef.length||(n.assetFileDef=[]),n.assetFileDef.push($root.tensorflow.AssetFileDef.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.MetaInfoDef=function(){function e(e){if(this.tags=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.metaGraphVersion=e.string();break;case 2:r.strippedOpList=$root.tensorflow.OpList.decode(e,e.uint32());break;case 3:r.anyInfo=$root.tensorflow.Any.decode(e,e.uint32());break;case 4:r.tags&&r.tags.length||(r.tags=[]),r.tags.push(e.string());break;case 5:r.tensorflowVersion=e.string();break;case 6:r.tensorflowGitVersion=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.SavedModel=function(){function e(e){if(this.metaGraphs=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.savedModelSchemaVersion=e.int64();break;case 2:r.metaGraphs&&r.metaGraphs.length||(r.metaGraphs=[]),r.metaGraphs.push($root.tensorflow.MetaGraphDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),a.FunctionDefLibrary=function(){function e(e){if(this.function=[],this.gradient=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.function&&r.function.length||(r.function=[]),r.function.push($root.tensorflow.FunctionDef.decode(e,e.uint32()));break;case 2:r.gradient&&r.gradient.length||(r.gradient=[]),r.gradient.push($root.tensorflow.GradientDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),a.FunctionDef=function(){function e(e){if(this.attr={},this.nodeDef=[],this.ret={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.signature=$root.tensorflow.OpDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 3:n.nodeDef&&n.nodeDef.length||(n.nodeDef=[]),n.nodeDef.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:e.skip().pos++,n.ret===$util.emptyObject&&(n.ret={}),a=e.string(),e.pos++,n.ret[a]=e.string();break;default:e.skipType(7&o)}}return n},e}(),a.GradientDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.functionName=e.string();break;case 2:r.gradientFunc=e.string();break;default:e.skipType(7&n)}}return r},e}(),a}();var compiled_api=$root,compiled_api_1=compiled_api.tensorflow;function getParamValue(e,t,a,r){var n=t.params[e];if(n&&void 0!==n.inputIndex){if(\"tensor\"===n.type)return getTensor(t.inputNames[n.inputIndex],a,r);if(\"tensors\"===n.type)return(0===n.inputIndex?0===n.inputParamLength?t.inputNames:t.inputNames.slice(n.inputIndex,-n.inputParamLength):t.inputNames.splice(n.inputIndex)).map(function(e){return getTensor(e,a,r)});var o=Array.prototype.slice.call(getTensor(t.inputNames.slice(n.inputIndex)[0],a,r).dataSync());return\"number\"===n.type?o[0]:o}return n&&n.value}function getTensor(e,t,a){var r=parseNodeName(e),n=r[0],o=r[1],s=a.currentContextIds.find(function(e){return!!t[getNodeNameWithContextId(n,e)]});return void 0!==s?t[getNodeNameWithContextId(n,s)][o]:void 0}function getNodeNameAndIndex(e,t){var a=parseNodeName(e),r=a[0],n=a[1];return[getNodeNameWithContextId(r,t&&t.currentContextId),n]}function getNodeNameWithContextId(e,t){return t?e+\"-\"+t:e}function parseNodeName(e){var t=e.lastIndexOf(\":\");return-1===t?[e,0]:[e.substring(0,t),Number(e.substring(t+1))]}function split$1(e,t){for(var a=[],r=0;r=this.tensors.length)throw new Error(\"Tried to read from index \"+e+\", but array size is: \"+this.tensors.length);var t=this.tensors[e];if(t.cleared)throw new Error(\"TensorArray \"+this.name+\": Could not read index \"+e+\" twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).\");return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor},e.prototype.readMany=function(e){var t=this;return e.map(function(e){return t.read(e)})},e.prototype.write=function(e,t){if(this.closed_)throw new Error(\"TensorArray \"+this.name+\" has already been closed.\");if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(\"Tried to write to index \"+e+\", but array is not resizeable and size is: \"+this.maxSize);var a=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(\"TensorArray \"+this.name+\": Could not write to TensorArray index \"+e+\",\\n because the value dtype is \"+t.dtype+\", but TensorArray dtype is \"+this.dtype+\".\");if(0===this.size()&&0===this.elementShape.length&&(this.elementShape=t.shape),util.assertShapesMatch(this.elementShape,t.shape,\"TensorArray \"+this.name+\": Could not write to TensorArray index \"+e+\".\"),a&&a.read)throw new Error(\"TensorArray \"+this.name+\": Could not write to TensorArray index \"+e+\", because it has already been read.\");if(a&&a.written)throw new Error(\"TensorArray \"+this.name+\": Could not write to TensorArray index \"+e+\", because it has already been written.\");a.tensor=t,a.written=!0,this.tensors[e]=a},e.prototype.writeMany=function(e,t){var a=this;if(e.length!==t.length)throw new Error(\"TensorArray \"+this.name+\": could not write multiple tensors,because the index size: \"+e.length+\" is not the same as tensors size: \"+t.length+\".\");e.map(function(e,r){return a.write(e,t[r])})},e.prototype.gather=function(e,t){if(t&&t!==this.dtype)throw new Error(\"TensorArray dtype is \"+this.dtype+\" but gather requested dtype \"+t);if(!e){e=[];for(var a=0;a=this.maxSize)throw new Error(\"Max index must be < array size (\"+a+\" vs. \"+this.maxSize+\")\");this.writeMany(e,unstack(t,0))},e.prototype.split=function(e,t){var a=this;if(t.dtype!==this.dtype)throw new Error(\"TensorArray dtype is \"+this.dtype+\" but tensor has dtype \"+t.dtype);var r=0,n=e.map(function(e){return r+=e});if(r!==t.shape[0])throw new Error(\"Expected sum of lengths to be equal to\\n tensor.shape[0], but sum of lengths is\\n \"+r+\", and tensor's shape is: \"+t.shape);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(\"TensorArray's size is not equal to the size of lengths (\"+this.maxSize+\" vs. \"+e.length+\"), and the TensorArray is not marked as dynamically resizeable\");var o=0===r?0:t.size/r,s=[];tidy(function(){t=t.reshape([1,r,o]);for(var i=0;i1)for(var f=1;f1))throw new Error(\"Cannot exit frame, the context is empty\");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()},e.prototype.nextIteration=function(){if(!(this.contexts&&this.contexts.length>0))throw new Error(\"Cannot increase frame iteration, the context is empty\");this.contexts=this.contexts.slice(),this.lastId++;var e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))},e.prototype.getWeight=function(e){return this.weightMap[e]},e.prototype.addTensorArray=function(e){this.tensorArrayMap[e.id]=e},e.prototype.getTensorArray=function(e){return this.tensorArrayMap[e]},e}(),GraphExecutor=function(){function e(e){this.graph=e,this.compiledOrder=[],this._weightMap={},this.placeholders=e.placeholders,this._outputs=e.outputs,this.compile()}return Object.defineProperty(e.prototype,\"weightMap\",{get:function(){return this._weightMap},set:function(e){var t=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})});this.weightIds=[].concat.apply([],t),this._weightMap=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"inputs\",{get:function(){return this.placeholders.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"outputs\",{get:function(){return this._outputs.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"inputNodes\",{get:function(){return this.placeholders.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"outputNodes\",{get:function(){return this.outputs.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"isControlFlowModel\",{get:function(){return this.graph.withControlFlow},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"isDynamicShapeModel\",{get:function(){return this.graph.withDynamicShape},enumerable:!0,configurable:!0}),e.prototype.compile=function(){if(!this.graph.withControlFlow&&!this.graph.withDynamicShape)for(var e=this.graph.inputs.slice(),t={};e.length>0;){var a=e.pop();t[a.name]=!0,this.compiledOrder.push(a),a.children.forEach(function(a){!t[a.name]&&a.inputNames.every(function(e){var a=getNodeNameAndIndex(e)[0];return t[a]})&&e.push(a)})}},e.prototype.execute=function(e,t){var a=this;this.checkInput(e),this.checkInputShapeAndType(e);var r={};return tidy(function(){var n=new ExecutionContext(a._weightMap,r),o=a.compiledOrder.reduce(function(e,t){return e[t.name]=executeOp$15(t,e,n),e},__assign({},a.weightMap,e));return a.findOutputs(o,n,t)})},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u=this;return __generator(this,function(m){switch(m.label){case 0:return this.checkInput(e),this.checkInputShapeAndType(e),a={},r=new ExecutionContext(this._weightMap,a),[4,this.executeWithControlFlow(e,r)];case 1:return n=m.sent(),o=this.findOutputs(n,r,t),s=Object.keys(o).map(function(e){return o[e].id}),i=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})}),p=[].concat.apply([],i),Object.keys(n).forEach(function(e){n[e].forEach(function(e){e&&-1===s.indexOf(e.id)&&-1===p.indexOf(e.id)&&-1===u.weightIds.indexOf(e.id)&&e.dispose()})}),[2,o]}})})},e.prototype.executeWithControlFlow=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u;return __generator(this,function(m){switch(m.label){case 0:a=this.graph.inputs.map(function(e){return{node:e,contexts:t.currentContext}}),r=__assign({},this.weightMap,e),n={},m.label=1;case 1:return a.length>0?(o=a.pop(),t.currentContext=o.contexts,s=\"\",\"enter\"===o.node.op&&getParamValue(\"isConstant\",o.node,r,t)&&(s=getNodeNameAndIndex(o.node.name,t)[0]),i=executeOp$15(o.node,r,t),s||(s=getNodeNameAndIndex(o.node.name,t)[0]),p=r,u=s,[4,i]):[3,3];case 2:return p[u]=m.sent(),o.node.children.forEach(function(e){var o=getNodeNameAndIndex(e.name,t)[0];n[o]||(\"merge\"===e.op?e.inputNames.some(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})):e.inputNames.every(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})))}),[3,1];case 3:return[2,r]}})})},e.prototype.findOutputs=function(e,t,a){return!a||a instanceof Array||(a=[a]),(a||this.graph.outputs.map(function(e){return e.name})).reduce(function(a,r){return a[r]=getTensor(r,e,t),a},{})},e.prototype.dispose=function(){var e=this;Object.keys(this.weightMap).forEach(function(t){return e.weightMap[t].forEach(function(e){return e.dispose()})})},e.prototype.checkInputShapeAndType=function(e){this.placeholders.forEach(function(t){var a=e[t.name][0];if(t.params.shape&&t.params.shape.value){var r=t.params.shape.value,n=r.length===a.shape.length&&a.shape.every(function(e,t){return-1===r[t]||r[t]===e});util.assert(n,\"The shape of dict['\"+t.name+\"'] provided in model.execute(dict) must be [\"+r+\"], but was [\"+a.shape+\"]\")}t.params.dtype&&t.params.dtype.value&&util.assert(a.dtype===t.params.dtype.value,\"The dtype of dict['\"+t.name+\"'] provided in model.execute(dict) must be \"+t.params.dtype.value+\", but was \"+a.dtype)})},e.prototype.checkInput=function(e){var t=this,a=Object.keys(e),r=[],n=[];if(this.inputNodes.forEach(function(e){-1===a.indexOf(e)&&r.push(e)}),a.forEach(function(e){-1===t.inputNodes.indexOf(e)&&n.push(e)}),r.length>0)throw new Error(\"The dict provided in model.execute(dict) has the keys [\"+a+\"], but is missing the required keys: [\"+r+\"].\");if(n.length>0)throw new Error(\"The dict provided in model.execute(dict) has unused keys: [\"+n+\"]. Please provide only the following keys: [\"+this.inputNodes+\"].\")},e}(),FrozenModel=function(){function e(e,t,a){this.modelUrl=e,this.weightManifestUrl=t,this.requestOption=a,this.version=\"n/a\",this.pathPrefix=this.getPathPrefix()}return Object.defineProperty(e.prototype,\"modelVersion\",{get:function(){return this.version},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"inputNodes\",{get:function(){return this.executor.inputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"outputNodes\",{get:function(){return this.executor.outputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"inputs\",{get:function(){return this.executor.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"outputs\",{get:function(){return this.executor.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"weights\",{get:function(){return this.executor.weightMap},enumerable:!0,configurable:!0}),e.prototype.getPathPrefix=function(){var e=parse(this.weightManifestUrl),t=e.pathname.split(\"/\");return t.splice(-1),e.pathname=t.join(\"/\"),format(e)+\"/\"},e.prototype.loadRemoteProtoFile=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r,n;return __generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,fetch(this.modelUrl,this.requestOption)];case 1:return e=o.sent(),a=(t=compiled_api_1.GraphDef).decode,r=Uint8Array.bind,[4,e.arrayBuffer()];case 2:return[2,a.apply(t,[new(r.apply(Uint8Array,[void 0,o.sent()]))])];case 3:throw n=o.sent(),new Error(this.modelUrl+\" not found. \"+n);case 4:return[2]}})})},e.prototype.loadWeightManifest=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,fetch(this.weightManifestUrl,this.requestOption)];case 1:return e=r.sent(),t=this,[4,e.clone().json()];case 2:return t.weightManifest=r.sent(),[3,4];case 3:throw a=r.sent(),new Error(this.weightManifestUrl+\" not found. \"+a);case 4:return[2]}})})},e.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r;return __generator(this,function(n){switch(n.label){case 0:return e=this.loadRemoteProtoFile(),t=this.loadWeightManifest(),[4,Promise.all([e,t])];case 1:return a=n.sent()[0],this.version=a.versions.producer+\".\"+a.versions.minConsumer,[4,io.loadWeights(this.weightManifest,this.pathPrefix,void 0,this.requestOption)];case 2:return r=n.sent(),this.executor=new GraphExecutor(OperationMapper.Instance.transformGraph(a)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),[2,!0]}})})},e.prototype.predict=function(e,t){return this.execute(e,this.outputNodes)},e.prototype.constructTensorMap=function(e){var t=e instanceof Tensor?[e]:e;if(t.length!==this.inputNodes.length)throw new Error(\"Input tensor count mismatch,the frozen model has \"+this.inputNodes.length+\" placeholders, while there are \"+t.length+\" input tensors.\");return this.inputNodes.reduce(function(e,a,r){return e[a]=t[r],e},{})},e.prototype.execute=function(e,t){if(t=t||this.outputNodes,(e instanceof Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),this.executor.isControlFlowModel||this.executor.isDynamicShapeModel)throw new Error(\"The model contains control flow or dynamic shape ops, please use executeAsync method\");var a=this.executor.execute(this.convertTensorMapToTensorsMap(e),t),r=Object.keys(a);return Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r;return __generator(this,function(n){switch(n.label){case 0:if(!this.executor.isControlFlowModel||!this.executor.isDynamicShapeModel)throw new Error(\"The model does not contain control flow or dynamic shape ops, please use execute method for better performance.\");return t=t||this.outputNodes,(e instanceof Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),[4,this.executor.executeAsync(this.convertTensorMapToTensorsMap(e),t)];case 1:return a=n.sent(),r=Object.keys(a),[2,Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]]}})})},e.prototype.convertTensorMapToTensorsMap=function(e){return Object.keys(e).reduce(function(t,a){return t[a]=[e[a]],t},{})},e.prototype.dispose=function(){this.executor.dispose()},e}();function loadFrozenModel(e,t,a){return __awaiter(this,void 0,void 0,function(){var r;return __generator(this,function(n){switch(n.label){case 0:return[4,(r=new FrozenModel(e,t,a)).load()];case 1:return n.sent(),[2,r]}})})}var version=\"0.5.5\";export{FrozenModel,loadFrozenModel,version as version_converter};\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '0.12.4';\nexport {version};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport * from '@tensorflow/tfjs-core';\nexport * from '@tensorflow/tfjs-layers';\nexport * from '@tensorflow/tfjs-converter';\n\n// Import versions of all sub-packages.\nimport {version_core} from '@tensorflow/tfjs-core';\nimport {version_layers} from '@tensorflow/tfjs-layers';\nimport {version_converter} from '@tensorflow/tfjs-converter';\nimport {version as version_union} from './version';\n\nexport const version = {\n 'tfjs-core': version_core,\n 'tfjs-layers': version_layers,\n 'tfjs-converter': version_converter,\n 'tfjs': version_union\n};\n"],"names":["extendStatics","Object","setPrototypeOf","__proto__","Array","e","t","n","hasOwnProperty","__extends","constructor","prototype","create","__assign","assign","r","arguments","length","o","call","__awaiter","Promise","a","i","u","next","s","throw","done","value","then","apply","__generator","label","sent","trys","ops","return","Symbol","iterator","TypeError","pop","push","isMobile","navigator","userAgent","vendor","window","opera","test","substr","shuffle","Math","random","clamp","max","min","randUniform","distSquared","Number","assert","Error","assertShapesMatch","arraysEqual","assertNonNull","flatten","isArray","inferShape","isTypedArray","deepAssertShapeConsistency","join","slice","concat","sizeFromShape","isScalarShape","isInt","tanh","exp","sizeToSquarishShape","floor","sqrt","createShuffledIndices","Uint32Array","rightPad","repeat","repeatedTry","setTimeout","inferFromImplicitShape","squeezeShape","newShape","keptDims","getTypedArrayFromDType","Float32Array","Int32Array","Uint8Array","checkComputationForNaN","isNaN","checkConversionForNaN","hasEncodingLoss","copyTypedArray","round","bytesPerElement","isFunction","nearestDivisor","computeStrides","toTypedArray","noConversionNeeded","makeOnesTypedArray","makeZerosTypedArray","now","performance","process","hrtime","util","freeze","Profiler","backendTimer","logger","Logger","profileKernel","time","forEach","dataSync","dtype","logKernelProfile","kernelMs","rank","size","shape","toString","console","log","getFilteredNodesXToY","id","m","inputs","l","c","output","p","d","h","f","g","v","y","backpropagateGradients","gradient","name","keys","add","dispose","FORMAT_LIMIT_NUM_VALS","FORMAT_NUM_FIRST_LAST_VALS","FORMAT_NUM_SIG_DIGITS","tensorToString","computeMaxSizePerColumn","subTensorToString","map","fill","valToString","parseFloat","toFixed","from","subarray","TensorBuffer","values","strides","set","locToIndex","get","indexToLoc","defineProperty","enumerable","configurable","toTensor","Tensor","make","trackerFn","opHandler","setTensorTracker","setOpHandler","isDisposedInternal","dataId","nextId","rankType","registerTensor","write","throwIfDisposed","as1D","asScalar","reshape","as2D","as3D","as4D","asType","cast","buffer","data","read","readSync","isDisposed","disposeTensor","toFloat","toInt","toBool","print","reshapeAs","expandDims","cumsum","squeeze","clone","tile","gather","matMul","dot","norm","reverse","stack","unstack","pad","batchNormalization","all","any","logSumExp","sum","mean","argMin","argMax","addStrict","sub","subStrict","pow","powStrict","mul","mulStrict","div","floorDiv","divStrict","minimum","minimumStrict","maximum","maximumStrict","mod","modStrict","squaredDifference","squaredDifferenceStrict","transpose","notEqual","notEqualStrict","less","lessStrict","equal","equalStrict","lessEqual","lessEqualStrict","greater","greaterStrict","greaterEqual","greaterEqualStrict","logicalAnd","logicalOr","logicalNot","logicalXor","where","neg","ceil","sign","expm1","log1p","rsqrt","square","reciprocal","abs","clipByValue","relu","elu","selu","leakyRelu","prelu","sigmoid","logSigmoid","softplus","sin","cos","tan","asin","acos","atan","sinh","cosh","asinh","acosh","atanh","erf","step","softmax","resizeBilinear","image","resizeNearestNeighbor","conv1d","conv2d","conv2dTranspose","depthwiseConv2D","depthwiseConv2d","avgPool","maxPool","localResponseNormalization","variable","Variable","unsortedSegmentSum","batchToSpaceND","spaceToBatchND","hasInstance","trainable","nextVarId","registerVariable","Function","assertTypesMatch","isTensorInList","getTensorsInContainer","walkTensorContainer","Set","isIterable","has","Type","Engine","backend","safeMode","debugMode","registeredVariables","refCounter","WeakMap","nextTapeNodeId","numBytes","numTensors","numDataBuffers","gradientScopeCount","customGradientDepth","keepTensors","activeScope","track","scopeStack","profiler","tidy","String","scopedRun","startScope","endScope","error","runKernel","shouldRecord","activeTape","register","delete","disposeData","disposeVariables","memory","addTapeNode","keep","gradients","ones","grads","customGrad","every","gradFunc","fromPixels","wallMs","NUMBER","BOOLEAN","STRING","URL_PROPERTIES","type","isWebGLVersionEnabled","getWebGLRenderingContext","loseContext","getWebGLDisjointQueryTimerVersion","hasExtension","isRenderToFloatTextureEnabled","createFloatTextureAndBindToFramebuffer","checkFramebufferStatus","FRAMEBUFFER","FRAMEBUFFER_COMPLETE","isDownloadFloatTextureEnabled","readPixels","RGBA","FLOAT","getError","NO_ERROR","isWebGLFenceEnabled","fenceSync","isChrome","TENSORFLOWJS_FLAGS_PREFIX","getFeaturesFromURL","location","getQueryParams","search","split","warn","getExtension","document","createElement","getContext","createFramebuffer","createTexture","bindTexture","TEXTURE_2D","RGBA32F","texImage2D","bindFramebuffer","framebufferTexture2D","COLOR_ATTACHMENT0","replace","decodeParam","decodeURIComponent","TEST_EPSILON_FLOAT32_ENABLED","TEST_EPSILON_FLOAT32_DISABLED","Environment","features","registry","setBackend","ENV","initBackend","getBackend","initDefaultBackend","backendName","engine","evaluateFeature","getFeatures","getBestBackendName","entry","sort","priority","versions","node","setFeatures","reset","globalEngine","findBackend","registerBackend","message","removeBackend","getGlobalNamespace","getOrMakeEnvironment","environment","getReshaped","getPermuted","getReshapedPermuted","getSliceBeginCoords","getSliceSize","axesAreInnerMostDims","combineLocations","indexOf","computeOutAndReduceShapes","expandShapeToKeepDim","parseAxisParam","assertAxesAreInnerMostDims","getAxesPermutation","getUndoAxesPermutation","getInnerMostAxes","PARALLELIZE_THRESHOLD","computeOptimalWindowSize","segOpComputeOptimalWindowSize","computeOutShape","assertParamsValid","getStridedSlicedInfo","startForAxis","stopForAxis","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","grad","checkGrads","valueAndGrad","valueAndGrads","variableGrads","filter","some","convertToTensor","convertToTensorArray","op","endsWith","substring","softmax_","tensor","scalar","tensor1d","tensor2d","tensor3d","tensor4d","tensor5d","tensor6d","ones$1","zeros","onesLike_","zerosLike_","linspace","range","DType","Rank","UpcastInt32AndMap","UpcastBoolAndMap","UpcastFloat32AndMap","onesLike","zerosLike","float32","int32","bool","R0","R1","R2","R3","R4","R5","R6","upcastTypeMap","upcastType","sumOutType","castTensor","int","reshapeTensor","nonMaxSuppressionImpl","score","boxIndex","intersectionOverUnion","x","topkImpl","index","ArgMinMaxProgram","variableNames","windowSize","batchSize","inSize","outputShape","userCode","AvgPool2DBackpropProgram","inShape","filterHeight","filterWidth","strideHeight","strideWidth","padInfo","top","left","outHeight","outWidth","getBroadcastDims","unshift","getReductionAxes","broadcastDimsAreOuter","assertAndGetBroadcastShape","BatchNormProgram","supportsBroadcasting","CHECK_NAN_SNIPPET","ADD","SUB","MUL","DIV","INT_DIV","POW","SQUARED_DIFFERENCE","EQUAL","NOT_EQUAL","LESS","LESS_EQUAL","GREATER","GREATER_EQUAL","LOGICAL_AND","LOGICAL_OR","MAX","MIN","MOD","ATAN2","ELU_DER","BinaryOpProgram","getCustomSetupFunc","startLoc","getUniformLocationNoThrow","gl","uniform1f","NaN","ClipProgram","assertParams","computeOutShape$1","computeGradientSliceShapes","aBegin","aSize","bBegin","bSize","ConcatProgram","Conv2DDerFilterProgram","filterShape","inHeight","inWidth","Conv2DDerInputProgram","outChannels","DepthwiseConv2DDerFilterProgram","inChannels","DepthwiseConv2DDerInputProgram","Conv2DProgram","outShape","dilationHeight","dilationWidth","DepthwiseConv2DProgram","makeShader","shapeInfo","logicalShape","isUniform","getInputSamplingSnippet","texShape","getOutputSamplingSnippet","SHADER_PREFIX","FLOAT_TEXTURE_SAMPLE_SNIPPET","FLOAT_TEXTURE_SETOUTPUT_SNIPPET","getSamplerFromInInfo","getSamplerScalar","getSampler1D","getSampler2D","getSampler3D","getSampler4D","getSampler5D","getSampler6D","getSamplerFlat","getSamplerAtOutputCoords","getOutputScalarCoords","getOutput1DCoords","getOutput2DCoords","getOutput3DCoords","getOutput4DCoords","getOutput5DCoords","getOutput6DCoords","SAMPLE_1D_SNIPPET","SAMPLE_2D_SNIPPET","SAMPLE_3D_SNIPPET","SAMPLE_4D_SNIPPET","SAMPLE_5D_SNIPPET","SAMPLE_6D_SNIPPET","charAt","toUpperCase","squeezeInputInfo","getSqueezedParams","getBroadcastOutputCoordsSampler","getCoordsDataType","JSON","parse","stringify","CumSumProgram","getFinalCoord","getCoords","TextureUsage","PhysicalTextureType","EncodeFloatProgram","FromPixelsProgram","GatherProgram","getSourceCoords","getUnpackedMatrixTextureShapeWidthHeight","getUnpackedArraySizeFromMatrixSize","getMatrixSizeFromUnpackedArraySize","encodeMatrixToUnpackedArray","decodeMatrixFromUnpackedArray","getPackedMatrixTextureShapeWidthHeight","getPackedRGBAArraySizeFromMatrixShape","encodeMatrixToPackedRGBA","decodeMatrixFromPackedRGBA","RENDER","UPLOAD","PIXELS","DOWNLOAD","FLOAT16","FLOAT32","UNSIGNED_BYTE","MAX_TEXTURE_SIZE","createWebGLRenderingContext","width","height","createWebGLRenderingContextFromCanvas","callAndCheck","checkWebGLError","webGLDebugErrorCheckingEnabled","enableDebugWebGLErrorChecking","getWebGLErrorMessage","INVALID_ENUM","INVALID_VALUE","INVALID_OPERATION","INVALID_FRAMEBUFFER_OPERATION","OUT_OF_MEMORY","CONTEXT_LOST_WEBGL","getExtensionOrThrow","throwIfNull","createVertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","createFragmentShader","FRAGMENT_SHADER","logShaderSourceAndInfoLog","lineNumberRegex","exec","createProgram","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","validateProgram","VALIDATE_STATUS","createStaticVertexBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","createStaticIndexBuffer","ELEMENT_ARRAY_BUFFER","queryMaxTextureSize","getParameter","getNumChannels","validateTextureSize","bindVertexBufferToProgramAttribute","getAttribLocation","vertexAttribPointer","enableVertexAttribArray","bindTextureUnit","validateTextureUnit","activeTexture","TEXTURE0","unbindTextureUnit","getProgramUniformLocationOrThrow","getUniformLocation","getProgramUniformLocation","bindTextureToProgramUniformSampler","uniform1i","bindCanvasToFramebuffer","viewport","canvas","scissor","bindColorTextureToFramebuffer","unbindColorTextureFromFramebuffer","validateFramebuffer","getFramebufferErrorMessage","FRAMEBUFFER_INCOMPLETE_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_DIMENSIONS","FRAMEBUFFER_UNSUPPORTED","MAX_COMBINED_TEXTURE_IMAGE_UNITS","getTextureShapeFromLogicalShape","webgl_util","getWebGLContextAttributes","alpha","antialias","premultipliedAlpha","preserveDrawingBuffer","depth","stencil","failIfMajorPerformanceCaveat","createWebGLContext","disable","DEPTH_TEST","STENCIL_TEST","BLEND","DITHER","POLYGON_OFFSET_FILL","SAMPLE_COVERAGE","enable","SCISSOR_TEST","CULL_FACE","cullFace","BACK","createVertexShader$1","createVertexBuffer","createIndexBuffer","Uint16Array","getTextureConfig","R32F","R16F","RED","HALF_FLOAT","HALF_FLOAT_OES","internalFormatFloat","internalFormatHalfFloat","internalFormatPackedFloat","textureFormatFloat","downloadTextureFormat","downloadUnpackNumChannels","defaultNumChannels","textureTypeHalfFloat","createAndConfigureTexture","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","createFloat32MatrixTexture","createFloat16MatrixTexture","createUnsignedBytesMatrixTexture","createPackedMatrixTexture","bindVertexProgramAttributeStreams","uploadPixelDataToTexture","uploadDataToTexture","texSubImage2D","uploadMatrixToTexture","uploadMatrixToPackedTexture","maybeCreateBufferFromOutputTexture","PIXEL_PACK_BUFFER","downloadFloat32MatrixFromBuffer","getBufferSubData","downloadFloat32MatrixFromOutputTexture","downloadByteEncodedFloatMatrixFromOutputTexture","downloadMatrixFromPackedOutputTexture","gpgpu_util","GPGPUContext","outputTexture","program","disposed","autoDebugValidate","vertexAttrsAreBound","itemsToPoll","textureFloatExtension","colorBufferFloatExtension","textureHalfFloatExtension","colorBufferHalfFloatExtension","loseContextExtension","vertexBuffer","indexBuffer","framebuffer","textureConfig","finish","deleteFramebuffer","deleteBuffer","enableAutomaticDebugValidation","deleteMatrixTexture","deleteTexture","downloadMatrixDriver","maybeCreateBufferFromTexture","bindTextureToFrameBuffer","unbindTextureToFrameBuffer","createAndWaitForFence","createFence","pollFence","SYNC_GPU_COMMANDS_COMPLETE","flush","clientWaitSync","ALREADY_SIGNALED","CONDITION_SATISFIED","beginQuery","endQuery","isQueryAvailable","query","isFencePassed","downloadMatrixFromPackedTexture","attachShader","setProgram","deleteProgram","useProgram","getAttributeLocation","setInputMatrixTexture","throwIfNoProgram","setOutputMatrixTexture","setOutputMatrixTextureDriver","setOutputPackedMatrixTexture","setOutputMatrixWriteRegion","setOutputMatrixWriteRegionDriver","setOutputPackedMatrixWriteRegion","debugValidate","executeProgram","drawElements","TRIANGLES","UNSIGNED_SHORT","blockUntilAllProgramsCompleted","getQueryTimerExtension","disjointQueryTimerExtension","getQueryTimerExtensionWebGL2","getQueryTimerExtensionWebGL1","createQuery","TIME_ELAPSED_EXT","createQueryEXT","beginQueryEXT","endQueryEXT","waitForQueryAndGetTime","getQueryTime","getQueryParameter","QUERY_RESULT","getQueryObjectEXT","QUERY_RESULT_EXT","QUERY_RESULT_AVAILABLE","disjoint","GPU_DISJOINT_EXT","QUERY_RESULT_AVAILABLE_EXT","addItemToPoll","pollItems","binSearchLastTrue","isDoneFn","resolveFn","compileProgram","texData","source","webGLProgram","uniformLocations","gpgpu","inShapeInfos","outShapeInfo","validateBinaryAndProgram","runProgram","texture","uniform1fv","makeShaderKey","LRNProgram","LRNGradProgram","depthRadius","bias","beta","MaxPool2DBackpropProgram","MatMulProgram","MultinomialProgram","seedLoc","OneHotProgram","PadProgram","Pool2DProgram","ReduceProgram","ResizeBilinearBackpropProgram","ResizeBilinearProgram","ResizeNearestNeigborBackpropProgram","ResizeNearestNeighborProgram","ReverseProgram","SegmentOpProgram","numSegments","SelectProgram","SliceProgram","getCoords$1","uniform2i","uniform3i","uniform4i","StridedSliceProgram","TextureManager","numUsedTextures","numFreeTextures","freeTextures","logEnabled","usedTextures","acquireTexture","getPhysicalFromLogicalTextureType","getKeyFromTextureShape","shift","releaseTexture","splice","getNumUsedTextures","getNumFreeTextures","TileProgram","getSourceCoords$1","TransposeProgram","getSwitchedCoords","ERF_P","ERF_A1","ERF_A2","ERF_A3","ERF_A4","ERF_A5","SELU_SCALEALPHA","SELU_SCALE","UnaryOpProgram","CHECK_NAN_SNIPPET$1","ABS","RELU","ELU","SELU","STEP","NEG","CEIL","FLOOR","SIGN","ROUND","EXP","EXPM1","LOG","LOG1P","SQRT","RSQRT","SIGMOID","SOFTPLUS","SIN","COS","TAN","ASIN","ACOS","ATAN","SINH","COSH","TANH","ASINH","ACOSH","ATANH","ERF","SQUARE","RECIPROCAL","LOGICAL_NOT","TO_INT","concat1d_","concat2d_","concat3d_","concat4d_","concat_","concat2Tensors","b","concat1d","concat2d","concat3d","concat4d","createCommonjsModule","exports","alea","s0","s1","s2","charCodeAt","state","double","quick","amd","xor128","z","w","xorwow","xorshift7","Date","xor4096","X","tychei","seedrandom","entropy","randomBytes","crypto","msCrypto","getRandomValues","plugins","screen","j","S","T","pass","global","fromCharCode","require","seedrandom$1","seedrandom_1","MPRandGauss","stdDev","nextVal","truncated","upper","lower","nextValue","isValidTruncated","convertValue","clone_","$x","eye_","randomNormal_","truncatedNormal_","randomUniform_","rand_","multinomial_","multinomial","logits2D","oneHot_","oneHot","$indices","fromPixels_","toPixels","Uint8ClampedArray","ImageData","putImageData","reshape_","squeeze_","cast_","tile_","pad1d_","pad2d_","pad3d_","pad4d_","pad_","stack_","batchToSpaceND_","reduce","spaceToBatchND_","unstack_","split_","cumsum_","permutedX","expandDims_","eye","pad1d","pad2d","pad3d","pad4d","rand","randomNormal","randomUniform","truncatedNormal","whereImpl","BEFORE_PAGING_CONSTANT","SIZE_UPLOAD_UNIFORM","MathBackendWebGL","delayedStorage","pendingRead","pendingDisposal","WeakSet","lruDataGPU","numBytesInGPU","uploadWaitMs","downloadWaitMs","binaryCache","gpgpuCreatedLocally","NUM_BYTES_BEFORE_PAGING","devicePixelRatio","textureManager","usage","HTMLVideoElement","HTMLImageElement","HTMLCanvasElement","fromPixelsCanvas","readyState","drawImage","getTexture","compileAndRun","throwIfNoData","uploadToGPU","cacheOnCPU","activeTimers","getValuesFromTexture","WebGLTexture","programTimersStack","unreliable","startTimer","startMs","endMs","endTimer","getGPGPUContext","getCanvas","stridedSlice","multiply","makeOutputArray","localResponseNormalization4D","LRNGrad","argReduce","segOpCompute","select","topk","realDivide","addN","subtract","eluDer","clip","atan2","conv2dDerInput","conv2dDerFilter","depthwiseConv2DDerInput","depthwiseConv2DDerFilter","maxPoolBackprop","avgPoolBackprop","resizeBilinearBackprop","resizeNearestNeighborBackprop","nonMaxSuppression","getAndSaveBinary","computeBytes","getTextureManager","remove","typedArrayToFloat32","float32ToTypedArray","neg_","ceil_","floor_","sign_","round_","exp_","expm1_","log_","log1p_","sqrt_","rsqrt_","square_","reciprocal_","abs_","clipByValue_","sigmoid_","logSigmoid_","softplus_","sin_","cos_","tan_","asin_","acos_","atan_","sinh_","cosh_","tanh_","asinh_","acosh_","atanh_","erf_","PI","step_","log$1","tanh$1","batchNormalization2d_","batchNormalization3d_","batchNormalization4d_","batchNormalization_","batchnormReshape4D","$mean","$variance","$scale","$offset","batchNormalization2d","batchNormalization3d","batchNormalization4d","computePool2DInfo","parseTupleParam","computeConv2DInfo","E","getPadAndOutInfo","getEffectiveFilterSize","_","A","R","dataFormat","computeOutputShape3D","computeDefaultPad","conditionalRound","bottom","right","conv1d_","eitherStridesOrDilationsAreOne","conv2d_","$filter","tupleValuesAreOne","conv2dDerInput_","conv2dDerFilter_","dy4D","x4D","conv2dTranspose_","depthwiseConv2d_","depthwiseConv2dDerInput","depthwiseConv2dDerFilter","separableConv2d_","parseTupleParam$1","separableConv2d","matMul_","$a","$b","outerProduct_","dot_","outerProduct","reverse1d_","reverse2d_","reverse3d_","reverse4d_","reverse_","reverse1d","reverse2d","reverse3d","reverse4d","maxPool_","avgPool_","$dy","$input","input4D","slice1d_","slice2d_","slice3d_","slice4d_","slice_","slice1d","slice2d","slice3d","slice4d","logSumExp_","sum_","mean_","min_","max_","argMin_","argMax_","all_","any_","moments_","variance","moments","notEqual_","notEqualStrict_","less_","lessStrict_","equal_","equalStrict_","lessEqual_","lessEqualStrict_","greater_","greaterStrict_","greaterEqual_","greaterEqualStrict_","add_","addN_","addStrict_","sub_","subStrict_","pow_","$base","$exp","powStrict_","mul_","mulStrict_","div_","floorDiv_","divStrict_","mod_","modStrict_","minimum_","minimumStrict_","maximum_","maximumStrict_","squaredDifference_","squaredDifferenceStrict_","atan2_","logicalNot_","logicalAnd_","logicalOr_","logicalXor_","where_","$condition","whereAsync_","whereAsync","relu_","elu_","dy","selu_","leakyRelu_","prelu_","transpose_","localResponseNormalization_","norm_","normImpl","unsortedSegmentSum_","gatherDropNegatives","gather_","arrayRange","arrayConcat","multiRNNCell_","basicLSTMCell_","basicLSTMCell","multiRNNCell","movingAverage_","movingAverage","stridedSlice_","topk_","indices","computeWeightedLoss_","Reduction","SUM_BY_NONZERO_WEIGHTS","NONE","SUM","MEAN","absoluteDifference_","computeWeightedLoss","meanSquaredError_","cosineDistance_","hingeLoss_","logLoss_","sigmoidCrossEntropyWithLogits_","sigmoidCrossEntropy_","huberLoss_","softmaxCrossEntropyWithLogits_","softmaxCrossEntropy_","absoluteDifference","cosineDistance","hingeLoss","huberLoss","logLoss","meanSquaredError","sigmoidCrossEntropy","softmaxCrossEntropy","loss_ops","gramSchmidt_","qr_","qr2d","gramSchmidt","qr","linalg_ops","resizeBilinear_","batchImages","resizeNearestNeighbor_","nonMaxSuppression_","NEGATIVE_INFINITY","nonMaxSuppSanityCheck","maxOutputSize","iouThreshold","scoreThreshold","$boxes","nonMaxSuppressionAsync_","nonMaxSuppressionAsync","image_ops","linalg","losses","MathBackendCPU","firstUse","getImageData","broadcastedBinaryOp","C","N","k","I","D","M","O","F","P","L","B","U","V","G","H","W","q","$","K","trunc","pool","POSITIVE_INFINITY","maxPoolPositions","delayCallback","requestAnimationFrame","setImmediate","nextFrame","DTYPE_VALUE_SIZE_MAP","uint16","uint8","encodeWeights","concatenateTypedArrays","specs","decodeWeights","quantization","byteLength","useNodeBuffer","Buffer","Blob","atob","btoa","stringByteLength","arrayBufferToBase64String","base64StringToArrayBuffer","byteOffset","concatenateArrayBuffers","basename","trim","getModelArtifactsInfoForJSON","modelTopology","ArrayBuffer","dateSaved","modelTopologyType","modelTopologyBytes","weightSpecsBytes","weightSpecs","weightDataBytes","weightData","IORouterRegistry","saveRouters","loadRouters","getInstance","instance","registerSaveRouter","registerLoadRouter","getSaveHandlers","getHandlers","getLoadHandlers","URL_SCHEME_SUFFIX","ModelStoreManagerRegistry","managers","registerManager","getManager","getSchemes","parseURL","scheme","path","cloneModelInternal","load","removeModel","save","modelArtifactsInfo","listModels","copyModel","moveModel","DATABASE_NAME","DATABASE_VERSION","MODEL_STORE_NAME","INFO_STORE_NAME","getIndexedDBFactory","indexedDB","mozIndexedDB","webkitIndexedDB","msIndexedDB","shimIndexedDB","setUpDatabase","result","createObjectStore","keyPath","BrowserIndexedDB","modelPath","databaseAction","open","onupgradeneeded","onsuccess","transaction","objectStore","close","modelArtifacts","onerror","oncomplete","put","URL_SCHEME","indexedDBRouter","startsWith","browserIndexedDB","maybeStripScheme","BrowserIndexedDBManager","getAll","PATH_SEPARATOR","PATH_PREFIX","INFO_SUFFIX","MODEL_TOPOLOGY_SUFFIX","WEIGHT_SPECS_SUFFIX","WEIGHT_DATA_SUFFIX","getModelKeys","info","topology","getModelPathFromKey","maybeStripScheme$1","BrowserLocalStorage","localStorage","LS","setItem","removeItem","getItem","localStorageRouter","browserLocalStorage","BrowserLocalStorageManager","key","DEFAULT_FILE_NAME_PREFIX","DEFAULT_JSON_EXTENSION_NAME","DEFAULT_WEIGHT_DATA_EXTENSION_NAME","BrowserDownloads","modelTopologyFileName","weightDataFileName","URL","createObjectURL","paths","weights","weightsManifest","jsonAnchor","download","href","click","weightDataAnchor","BrowserFiles","files","FileReader","onload","target","checkManifestAndWeightFiles","readAsArrayBuffer","readAsText","browserDownloadsRouter","browserDownloads","browserFiles","loadWeightsAsArrayBuffer","fetch","arrayBuffer","loadWeights","manifestEntry","groupOffset","sizeBytes","scale","BrowserHTTPRequest","DEFAULT_METHOD","body","requestInit","method","FormData","append","status","responses","json","lastIndexOf","URL_SCHEMES","httpRequestRouter","browserHTTPRequest","PassthroughLoader","PassthroughSaver","saveHandler","fromMemory","withSaveHandler","io","Serializable","getClassName","className","fromConfig","SerializationMap","classNameMap","getMap","serialization","WEBGL_ENVS","HAS_WEBGL","NODE_ENVS","IS_NODE","CHROME_ENVS","IS_CHROME","BROWSER_ENVS","IS_BROWSER","CPU_ENVS","ALL_ENVS","expectArraysClose","areClose","expectPromiseToFail","fail","expectArraysEqual","expectNumbersClose","expectValuesInRange","expectArrayBuffersEqual","expect","toEqual","test_util","version","webgl","Optimizer","minimize","computeGradients","applyGradients","DEFAULT_FLOAT32_EPSILON","DEFAULT_FLOAT16_EPSILON","getOptimizerDefaultEpsilonValue","AdadeltaOptimizer","learningRate","rho","epsilon","accumulatedGrads","accumulatedUpdates","rhoScalar","oneMinusRho","epsilonScalar","getConfig","AdagradOptimizer","initialAccumulatorValue","AdamOptimizer","beta1","beta2","accumulatedFirstMoment","accumulatedSecondMoment","beta1Scalar","beta2Scalar","accBeta1","accBeta2","oneMinusBeta1","oneMinusBeta2","one","epsScalar","AdamaxOptimizer","decay","accumulatedWeightedInfNorm","decayScalar","iteration","SGDOptimizer","setLearningRate","MomentumOptimizer","momentum","useNesterov","accumulations","setMomentum","RMSPropOptimizer","accumulatedMeanSquares","accumulatedMeanGrads","accumulatedMoments","momentumScalar","oneMinusDecay","centered","OptimizerConstructors","sgd","rmsprop","adam","adadelta","adamax","adagrad","train","_epsilon","imageDataFormat","_nextUniqueTensorId","getNextUniqueTensorId","_uidPrefixes","getUid","scalarCache","DEFAULT_DTYPE","getScalar","AttributeError","RuntimeError","ValueError","NotImplementedError","AssertionError","IndexError","pyListRepeat","count","singletonOrArray","toList","toSnakeCase","toLowerCase","toCamelCase","_GLOBAL_CUSTOM_OBJECTS","serializeKerasObject","config","deserializeKerasObject","customObjects","numberCompare","reverseNumberCompare","stringToDType","unique","isObjectEmpty","checkStringTypeUnionValue","checkArrayTypeAndLength","calcL2Norms","Constraint","MaxNorm","defaultMaxValue","defaultAxis","maxValue","axis","UnitNorm","NonNeg","MinMaxNorm","defaultMinValue","defaultRate","minValue","rate","CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP","maxNorm","minMaxNorm","nonNeg","unitNorm","serializeConstraint","deserializeConstraint","getConstraint","exports_constraints","nameMap","Map","VALID_DATA_FORMAT_VALUES","checkDataFormat","VALID_PADDING_MODE_VALUES","checkPaddingMode","VALID_POOL_MODE_VALUES","checkPoolMode","_nameScopeStack","_nameScopeDivider","nameScope","currentNameScopePrefix","getScopedTensorName","isValidTensorName","getUniqueTensorName","tensorNameRegex","RegExp","match","isInteger","parseInt","arrayProd","toArray1D","min$1","max$1","cast$1","tile$1","batchFlatten","sliceAlongFirstAxis","sliceAlongLastAxis","sliceAlongAxis","concatenate","concatAlongFirstAxis","randomNormal$1","gather$1","biasAdd","elu$1","softsign","dropout","hardSigmoid","inTrainPhase","VALID_FAN_MODE_VALUES","checkFanMode","VALID_DISTRIBUTION_VALUES","checkDistribution","Initializer","fromConfigUsesCustomObjects","Zeros","Ones","Constant","RandomUniform","DEFAULT_MINVAL","DEFAULT_MAXVAL","minval","maxval","seed","RandomNormal","DEFAULT_MEAN","DEFAULT_STDDEV","stddev","TruncatedNormal","Identity","gain","computeFans","VarianceScaling","mode","distribution","GlorotUniform","GlorotNormal","HeNormal","LeCunNormal","Orthogonal","DEFAULT_GAIN","INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","constant","glorotNormal","glorotUniform","heNormal","identity","leCunNormal","orthogonal","varianceScaling","deserializeInitializer","serializeInitializer","getInitializer","zeros$1","randomUniform$1","randomNormal$2","truncatedNormal$1","exports_initializers","isArrayOfShapes","normalizeShapeList","getExactlyOneTensor","getExactlyOneShape","countParamsInWeights","DEFAULT_VARIABLE_NAME_PREFIX","LayerVariable","originalName","constraint","val","checkShapesMatch","batchGetValue","batchSetValue","InputSpec","ndim","maxNDim","minNDim","axes","SymbolicTensor","sourceLayer","callArgs","outputTensorIndex","_nextNodeID","Node","outboundLayer","inboundLayers","nodeIndices","tensorIndices","inputTensors","outputTensors","inputMasks","outputMasks","inputShapes","outputShapes","outboundNodes","inboundNodes","_nextLayerID","Layer","_callHook","_addedWeightNames","_stateful","activityRegularizer","inputSpec","supportsMasking","_trainableWeights","_nonTrainableWeights","_losses","_updates","_built","updatable","inputShape","batchInputShape","inputDType","initialWeights","nodeKey","getNodeAtIndex","getInputAt","getOutputAt","calculateLosses","trainableWeights","nonTrainableWeights","assertInputCompatibility","invokeCallHook","setCallHook","clearCallHook","built","build","setWeights","collectInputShape","computeOutputShape","guessOutputDType","warnOnIncompatibleInputShape","addInboundNode","countParams","getWeights","addWeight","addLoss","computeMask","nodeIndex","tensorIndex","getSourceInputs","InputLayer","sparse","Input","batchShape","resolveScalarsInLogs","disposeTensorsInLogs","BaseCallback","validationData","setParams","params","onEpochBegin","onEpochEnd","onBatchBegin","onBatchEnd","onTrainBegin","onTrainEnd","setModel","CallbackList","callbacks","queueLength","BaseLogger","seen","totals","metrics","History","epoch","history","syncData","CustomCallback","trainBegin","trainEnd","epochBegin","epochEnd","batchBegin","batchEnd","standardizeCallbacks","l2Normalize","meanAbsoluteError","meanAbsolutePercentageError","MAX_VALUE","meanSquaredLogarithmicError","squaredHinge","hinge","categoricalHinge","logcosh","categoricalCrossentropy","sparseCategoricalCrossentropy","sigmoidCrossEntropyWithLogits","binaryCrossentropy","kullbackLeiblerDivergence","poisson","cosineProximity","binaryAccuracy","categoricalAccuracy","binaryCrossentropy$1","sparseCategoricalAccuracy","mse$1","MSE$1","mae$1","MAE$1","mape$1","MAPE$1","categoricalCrossentropy$1","cosine$1","sparseCategoricalCrossentropy$1","get$1","mse","MSE","mae","MAE","mape","MAPE","cosine","getOptimizer","Adagrad","Adadelta","Adam","Adamax","RMSProp","SGD","printSummary","isModelSequentialLike","nodesByDepth","printRow","layers","printLayerSummary","printLayerSummaryWithConnections","checkTrainableWeightsConsistency","collectedTrainableWeights","deserialize","isArrayItemInputOrOutputName","convertPythonicToTs","convertTsToPythonic","preprocessWeightsForLoading","loadTensor","loadWeightsFromJson","keras_version","loadWeightsFromNamedTensorMap","Container","containerNodes","outputs","inputLayers","inputLayersNodeIndices","inputLayersTensorIndices","outputLayers","outputLayersNodeIndices","outputLayersTensorIndices","inputNames","outputNames","feedInputShapes","feedInputNames","feedOutputNames","internalInputShapes","internalOutputShapes","layersByDepth","J","Z","Y","Q","ee","te","ne","re","ie","updatedConfig","kerasVersion","toJSON","mask","runInternalGraph","buildNodeConversionMap","getLayer","stateful","assertFeedCompatibility","ModelLoggingVerbosity","FeedDict","id2Value","addFeed","hasKey","getValue","execute","executeInternal","getNodeOutputs","isDataTensor","isDataArray","isDataDict","standardizeInputData","checkArrayLengths","checkLossAndTargetCompatibility","makeBatches","sliceArrays","sliceArraysByIndices","checkInputData","collectMetrics","SILENT","VERBOSE","Model","summary","compile","loss","optimizer","lossFunctions","feedOutputShapes","feedLossFns","metricsNames","metricsTensors","evaluate","standardizeUserData","makeTestFunction","testFunction","testLoop","verbose","steps","checkNumSamples","retrieveSymbolicTensors","predictLoop","predict","predictOnBatch","fitLoop","epochs","initialEpoch","doValidation","stopTraining","batch","getDedupedMetricsNames","fit","validationSplit","validationSteps","training","getNamedWeights","trainableOnly","loadModelInternal","loadModelFromIOHandler","model_config","Sequential","_updatable","model","sequential","loadModel","input","Activation","Elu","Selu","Relu","Relu6","Linear","Sigmoid","HardSigmoid","Softplus","Softsign","Tanh","Softmax","serializeActivation","deserializeActivation","getActivation","LeakyReLU","DEFAULT_ALPHA","ThresholdedReLU","DEFAULT_THETA","theta","thetaTensor","Softmax$1","DEFAULT_AXIS","Regularizer","L1L2","l1","l2","hasL1","hasL2","REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","l1l2","serializeRegularizer","deserializeRegularizer","getRegularizer","normalizeArray","convOutputLength","deconvLength","preprocessConv2DInput","conv1dWithBias","conv2dWithBias","BaseConv","DEFAULT_KERNEL_INITIALIZER","DEFAULT_BIAS_INITIALIZER","verifyConfig","kernelSize","padding","activation","useBias","biasInitializer","biasConstraint","biasRegularizer","dilationRate","Conv","kernel","filters","kernelInitializer","kernelConstraint","kernelRegularizer","Conv2D","Conv2DTranspose","SeparableConv","DEFAULT_DEPTHWISE_INITIALIZER","DEFAULT_POINTWISE_INITIALIZER","depthwiseKernel","pointwiseKernel","depthMultiplier","depthwiseInitializer","depthwiseRegularizer","depthwiseConstraint","pointwiseInitializer","pointwiseRegularizer","pointwiseConstraint","SeparableConv2D","Conv1D","Cropping2D","cropping","UpSampling2D","DEFAULT_SIZE","depthwiseConv2d$1","DepthwiseConv2D","Dropout","rateScalar","noiseShape","getNoiseShape","Dense","inputDim","units","Flatten","Activation$1","RepeatVector","Reshape","targetShape","isUnknown","fixUnknownDimension","Embedding","embeddings","DEFAULT_EMBEDDINGS_INITIALIZER","inputLength","outputDim","embeddingsInitializer","embeddingsRegularizer","embeddingsConstraint","maskZero","Merge","mergeFunction","computeElementwiseOpOutputShape","reshapeRequired","Add","Multiply","Average","Maximum","Minimum","Concatenate","regularNormalizeBatchInTraining","broadcastNormalizeBatchInTraining","normalizeBatchInTraining","BatchNormalization","center","betaInitializer","gammaInitializer","movingMeanInitializer","movingVarianceInitializer","betaConstraint","gammaConstraint","betaRegularizer","gammaRegularizer","stepCount","gamma","movingMean","movingVariance","spatial2dPadding","ZeroPadding2D","pool2d","Pooling1D","poolSize","poolingFunction","MaxPooling1D","AveragePooling1D","Pooling2D","MaxPooling2D","AveragePooling2D","GlobalPooling1D","GlobalAveragePooling1D","GlobalMaxPooling1D","GlobalPooling2D","GlobalAveragePooling2D","GlobalMaxPooling2D","standardizeArgs","initialState","constants","rnn","RNN","cell","StackedRNNCells","cells","stateSize","returnSequences","returnState","goBackwards","unroll","stateSpec","states","numConstants","getStates","setStates","resetStates","getInitialState","RNNCell","SimpleRNNCell","DEFAULT_ACTIVATION","DEFAULT_RECURRENT_INITIALIZER","recurrentInitializer","recurrentRegularizer","recurrentConstraint","recurrentDropout","dropoutMask","recurrentDropoutMask","recurrentKernel","generateDropoutMask","SimpleRNN","GRUCell","DEFAULT_RECURRENT_ACTIVATION","recurrentActivation","implementation","GRU","implmentation","LSTMCell","unitForgetBias","LSTM","Wrapper","layer","TimeDistributed","VALID_BIDIRECTIONAL_MERGE_MODES","checkBidirectionalMergeMode","Bidirectional","forwardLayer","backwardLayer","mergeMode","_trainable","inputLayer","elu$2","leakyReLU","softmax$1","thresholdedReLU","conv1d$2","conv2d$2","conv2dTranspose$1","separableConv2d$1","cropping2D","upSampling2d","depthwiseConv2d$2","dense","dropout$1","flatten$1","repeatVector","embedding","add$2","average$1","concatenate$2","maximum$2","minimum$2","multiply$1","batchNormalization$1","zeroPadding2d","averagePooling1d","avgPool1d","avgPooling1d","averagePooling2d","avgPool2d","avgPooling2d","globalAveragePooling1d","globalAveragePooling2d","globalMaxPooling1d","globalMaxPooling2d","maxPooling1d","maxPooling2d","gru","gruCell","lstm","lstmCell","simpleRNN","simpleRNNCell","rnn$1","stackedRNNCells","bidirectional","timeDistributed","globalMaxPool1d","globalMaxPool2d","maxPool1d","maxPool2d","exports_layers","average","binaryAccuracy$1","binaryCrossentropy$2","categoricalAccuracy$1","categoricalCrossentropy$2","cosineProximity$1","meanAbsoluteError$1","meanAbsolutePercentageError$1","MAPE$2","mape$2","meanSquaredError$1","MSE$2","mse$2","exports_metrics","l1$1","l2$1","exports_regularizers","Callback","commonjsGlobal","self","punycode","nodeType","overflow","RangeError","ucs2","decode","encode","toASCII","toUnicode","util$1","isString","isObject","isNull","isNullOrUndefined","maxKeys","stringifyPrimitive","isFinite","encodeURIComponent","querystring","querystring_1","querystring_2","querystring_3","querystring_4","urlParse","format","urlFormat","Url","protocol","slashes","auth","host","port","hostname","hash","pathname","protocolPattern","portPattern","simplePathPattern","delims","unwise","autoEscape","nonHostChars","hostEndingChars","hostnameMaxLen","hostnamePartPattern","hostnamePartStart","unsafeProtocol","javascript","hostlessProtocol","slashedProtocol","http","https","ftp","gopher","file","parseHost","escape","resolve","resolveObject","aspromise","asPromise","base64_1","eventemitter","EventEmitter","_listeners","on","fn","ctx","off","emit","float_1","factory","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","LN2","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","inquire_1","inquire","moduleName","mod$$1","eval","utf8_1","pool_1","longbits","LongBits","lo","hi","zero","toNumber","zzEncode","zzDecode","zeroHash","fromNumber","minimal","Long","fromString","low","high","toLong","Boolean","unsigned","fromHash","toHash","captureStackTrace","base64","float","utf8","emptyArray","emptyObject","isNode","isset","isSet","utf8Write","_Buffer_from","_Buffer_allocUnsafe","newBuffer","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","merge","lcFirst","newError","ProtocolError","oneOfGetter","oneOfSetter","toJSONOptions","longs","enums","bytes","_configure","allocUnsafe","writer","Writer","BufferWriter","LongBits$1","Op","len","noop","State","head","tail","writeByte","writeVarint32","VarintOp","writeVarint64","writeFixed32","alloc","_push","uint32","sint32","uint64","int64","sint64","fixed32","sfixed32","fixed64","sfixed64","writeBytes","string","fork","ldelim","writer_buffer","BufferWriter$1","writeBytesBuffer","copy","writeStringBuffer","reader","Reader","BufferReader","LongBits$2","utf8$1","indexOutOfRange","pos","buf","create_array","readLongVarint","readFixed32_end","readFixed64","isBuffer","_slice","skip","skipType","reader_buffer","BufferReader$1","utf8Slice","service","Service","rpcImpl","requestDelimited","responseDelimited","rpcCall","end","rpc_1","roots","indexMinimal","rpc","configure","minimal$1","minimal_1","minimal_2","minimal_3","$Reader","$util","$root","default","tensorflow","Any","typeUrl","DataType","TensorShape","dim","unknownRank","Dim","floatVal","doubleVal","intVal","stringVal","scomplexVal","int64Val","boolVal","uint32Val","uint64Val","tensorShape","versionNumber","tensorContent","AttrValue","list","placeholder","func","ListValue","NameAttrList","attr","NodeDef","device","VersionDef","badConsumers","producer","minConsumer","GraphDef","library","FunctionDefLibrary","CollectionDef","nodeList","bytesList","int64List","floatList","anyList","NodeList","BytesList","Int64List","FloatList","AnyList","SaverDef","filenameTensorName","saveTensorName","restoreOpName","maxToKeep","sharded","keepCheckpointEveryNHours","CheckpointFormatVersion","TensorInfo","cooSparse","CooSparse","valuesTensorName","indicesTensorName","denseShapeTensorName","SignatureDef","methodName","AssetFileDef","tensorInfo","filename","OpDef","inputArg","outputArg","deprecation","description","isCommutative","isAggregate","isStateful","allowsUninitializedInput","ArgDef","AttrDef","OpDeprecation","typeAttr","numberAttr","typeListAttr","isRef","defaultValue","hasMinimum","allowedValues","explanation","OpList","MetaGraphDef","collectionDef","signatureDef","assetFileDef","metaInfoDef","graphDef","saverDef","MetaInfoDef","tags","metaGraphVersion","strippedOpList","anyInfo","tensorflowVersion","tensorflowGitVersion","SavedModel","metaGraphs","savedModelSchemaVersion","function","FunctionDef","GradientDef","nodeDef","ret","signature","functionName","gradientFunc","compiled_api","compiled_api_1","getParamValue","inputIndex","getTensor","inputParamLength","parseNodeName","currentContextIds","find","getNodeNameWithContextId","getNodeNameAndIndex","currentContextId","split$1","arithmetic","tfOpName","dlOpName","category","tfInputIndex","dlParamName","tfParamName","notSupported","arithmetic$1","basic_math","basicMath","control","tfInputParamLength","control$1","convolution","convolution$1","creation","creation$1","dynamic","dynamic$1","evaluation","evaluation$1","graph","notSupprted","graph$1","image$1","image$2","logical","logical$1","matrices","matrices$1","normalization","normalization$1","reduction","reduction$1","slice_join","sliceJoin","transformation","tfParamNameDeprecated","transformation$1","CONTROL_FLOW_OPS","DYNAMIC_SHAPE_OPS","OperationMapper","opMappers","_instance","isControlFlow","isDynamicShape","transformGraph","mapNode","children","nodes","placeholders","withControlFlow","withDynamicShape","getStringParam","getNumberParam","getNumericArrayParam","getBoolParam","getTensorShapeParam","getDtypeParam","DT_FLOAT","DT_INT32","DT_BOOL","executeOp","executeOp$1","TensorArray","maxSize","elementShape","identicalElementShapes","dynamicSize","clearAfterRead","tensors","closed_","clearAndClose","cleared","readMany","written","writeMany","scatter","executeOp$2","enterFrame","exitFrame","nextIteration","addTensorArray","getTensorArray","executeOp$3","executeOp$4","_this","executeOp$5","executeOp$6","executeOp$7","executeOp$8","executeOp$9","executeOp$10","executeOp$11","executeOp$12","executeOp$13","executeOp$14","executeOp$15","ExecutionContext","weightMap","tensorArrayMap","rootContext","frameName","iterationId","contexts","lastId","generateCurrentContextIds","newFrame","_currentContextIds","contextIdforContexts","getWeight","GraphExecutor","compiledOrder","_weightMap","_outputs","weightIds","checkInput","checkInputShapeAndType","findOutputs","executeAsync","executeWithControlFlow","currentContext","inputNodes","FrozenModel","modelUrl","weightManifestUrl","requestOption","pathPrefix","getPathPrefix","executor","outputNodes","loadRemoteProtoFile","loadWeightManifest","weightManifest","Instance","convertTensorMapToTensorsMap","constructTensorMap","isControlFlowModel","isDynamicShapeModel","loadFrozenModel","version_core","version_layers","version_converter","version_union"],"mappings":";;;;;;;EAAA;;;;;;;;;;;;;;;;EAgBA,IAAIA,gBAAcC,OAAOC,cAAP,IAAuB,EAACC,WAAU,EAAX,cAAyBC,KAAzB,IAAgC,UAASC,CAAT,EAAWC,CAAX,EAAa;EAACD,IAAEF,SAAF,GAAYG,CAAZ;EAAc,CAAnF,IAAqF,UAASD,CAAT,EAAWC,CAAX,EAAa;EAAC,OAAI,IAAIC,CAAR,IAAaD,CAAb,EAAeA,EAAEE,cAAF,CAAiBD,CAAjB,MAAsBF,EAAEE,CAAF,IAAKD,EAAEC,CAAF,CAA3B;EAAiC,CAArK,CAAsK,SAASE,SAAT,CAAmBJ,CAAnB,EAAqBC,CAArB,EAAuB;EAAC,WAASC,CAAT,GAAY;EAAC,SAAKG,WAAL,GAAiBL,CAAjB;EAAmB,iBAAcA,CAAd,EAAgBC,CAAhB,GAAmBD,EAAEM,SAAF,GAAY,SAAOL,CAAP,GAASL,OAAOW,MAAP,CAAcN,CAAd,CAAT,IAA2BC,EAAEI,SAAF,GAAYL,EAAEK,SAAd,EAAwB,IAAIJ,CAAJ,EAAnD,CAA/B;EAAyF,KAAIM,WAASZ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AASuzF,eAAT,CAAyBvzF,CAAzB,EAA2BC,CAA3B,EAA6BgB,CAA7B,EAA+B;EAAC,SAAOF,YAAU,IAAV,EAAe,KAAK,CAApB,EAAsB,KAAK,CAA3B,EAA6B,YAAU;EAAC,QAAIL,CAAJ,CAAM,OAAOiB,cAAY,IAAZ,EAAiB,UAASzB,CAAT,EAAW;EAAC,cAAOA,EAAE0B,KAAT,GAAgB,KAAK,CAAL;EAAO,iBAAM,CAAC,CAAD,EAAG,CAAClB,IAAE,IAAI6xF,WAAJ,CAAgBvyF,CAAhB,EAAkBC,CAAlB,EAAoBgB,CAApB,CAAH,EAA2By7C,IAA3B,EAAH,CAAN,CAA4C,KAAK,CAAL;EAAO,iBAAOx8C,EAAE2B,IAAF,IAAS,CAAC,CAAD,EAAGnB,CAAH,CAAhB,CAA1E;EAAiG,KAA9H,CAAP;EAAuI,GAArL,CAAP;EAA8L,KAAIklD,YAAQ,OAAZ;;ECbnnvI,IAAMA,YAAU,QAAhB;;MCwBaA,YAAU;EACrB,iBAAa4tC,OADQ;EAErB,mBAAeC,SAFM;EAGrB,sBAAkBC,SAHG;EAIrB,YAAQC;EAJa,CAAhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist/tf.min.js b/node_modules/@tensorflow/tfjs/dist/tf.min.js new file mode 100644 index 0000000..7c8dff1 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/tf.min.js @@ -0,0 +1,3 @@ +// @tensorflow/tfjs Copyright 2018 Google +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.tf=e.tf||{})}(this,function(exports){"use strict";var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};function __extends(e,t){function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]0;)n=Math.random()*t|0,r=e[--t],e[t]=e[n],e[n]=r}function clamp(e,t,r){return Math.max(e,Math.min(t,r))}function randUniform(e,t){return Math.random()*(t-e)+e}function distSquared(e,t){for(var r=0,n=0;n0,function(){return"Element arr["+r.join("][")+"] should be a primitive, but is an array of "+e.length+" elements"}),assert(e.length===t[0],function(){return"Element arr["+r.join("][")+"] should have "+t[0]+" elements, but has "+e.length+" elements"});for(var n=t.slice(1),a=0;a1;--t)if(e%t==0)return[t,e/t];return[1,e]}function createShuffledIndices(e){for(var t=new Uint32Array(e),r=0;r=r?a():setTimeout(i,s)}};i()})}function inferFromImplicitShape(e,t){for(var r=1,n=-1,a=0;a0)r*=e[a];else if(-1===e[a]){if(-1!==n)throw Error("Shapes can only have 1 implicit size. Found - 1 at dim "+n+" and dim "+a);n=a}else if(e[a]<=0)throw Error("Shapes can not be <= 0. Found "+e[a]+" at dim "+a);if(-1===n){if(t>0&&t!==r)throw Error("Size("+t+") must match the product of shape "+e);return e}if(t%r!=0)throw Error("The implicit shape can't be a fractional number. Got "+t+" / "+r);var o=e.slice();return o[n]=t/r,o}function squeezeShape(e,t){for(var r=[],n=[],a=0,o=0;o1)throw new Error("Can't squeeze axis "+o+" since its dim '"+e[o]+"' is not 1");(null==t[a]||t[a]>o)&&1===e[o]&&(r.push(e[o]),n.push(o)),t[a]<=o&&a++}e[o]>1&&(r.push(e[o]),n.push(o))}return{newShape:r,keptDims:n}}function getTypedArrayFromDType(e,t){var r=null;if(null==e||"float32"===e)r=new Float32Array(t);else if("int32"===e)r=new Int32Array(t);else{if("bool"!==e)throw new Error("Unknown data type "+e);r=new Uint8Array(t)}return r}function checkComputationForNaN(e,t,r){if("float32"===t)for(var n=0;n=0;--n)r[n]=r[n+1]*e[n+1];return r}function toTypedArray(e,t,r){return noConversionNeeded(e,t)?e:(Array.isArray(e)&&(e=flatten(e)),copyTypedArray(e,t,r))}function noConversionNeeded(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}function makeOnesTypedArray(e,t){for(var r=makeZerosTypedArray(e,t),n=0;n=0;o--){i=(m=e[o]).inputs;var h=[];for(h.push(m.output),p=0;p=0;r--){var n=t[r],a=e[n.output.id];if(null==n.gradient)throw new Error("Cannot compute gradient: gradient function not found for "+n.name+".");var o=n.gradient(a);for(var i in n.inputs){if(!(i in o))throw new Error("Cannot backprop through input "+i+". Available gradients found: "+Object.keys(o)+".");var s=o[i](),u=n.inputs[i];if(!arraysEqual(s.shape,u.shape))throw new Error("Error in gradient for op "+n.name+". The gradient of input '"+i+"' has shape '"+s.shape+"', which does not match the shape of the input '"+u.shape+"'");if(null==e[u.id])e[u.id]=s;else{var l=e[u.id];e[u.id]=l.add(s),l.dispose()}}}}var FORMAT_LIMIT_NUM_VALS=20,FORMAT_NUM_FIRST_LAST_VALS=3,FORMAT_NUM_SIG_DIGITS=7;function tensorToString(e,t,r,n){var a=computeStrides(t),o=computeMaxSizePerColumn(e,t,a),i=t.length,s=subTensorToString(e,t,a,o),u=["Tensor"];return n&&(u.push(" dtype: "+r),u.push(" rank: "+i),u.push(" shape: ["+t+"]"),u.push(" values:")),u.push(s.map(function(e){return" "+e}).join("\n")),u.join("\n")}function computeMaxSizePerColumn(e,t,r){var n=sizeFromShape(t),a=r[r.length-1],o=new Array(a).fill(0);if(t.length>1)for(var i=0;iFORMAT_LIMIT_NUM_VALS){var s=Array.from(e.subarray(0,FORMAT_NUM_FIRST_LAST_VALS)),u=Array.from(e.subarray(o-FORMAT_NUM_FIRST_LAST_VALS,o));return["["+s.map(function(e,t){return valToString(e,n[t])}).join(", ")+", ..., "+u.map(function(e,t){return valToString(e,n[o-FORMAT_NUM_FIRST_LAST_VALS+t])}).join(", ")+"]"]}return["["+Array.from(e).map(function(e,t){return valToString(e,n[t])}).join(", ")+"]"]}var l=t.slice(1),p=r.slice(1),c=r[0],d=[];if(o>FORMAT_LIMIT_NUM_VALS){for(var h=0;h {...}) to avoid memory leaks.");return this.keepTensors.add(e.id),e},e.prototype.startScope=function(e,t){void 0===t&&(t=!1),t&&0===this.gradientScopeCount&&(this.activeTape=[]),t&&this.gradientScopeCount++;var r={track:[],name:"unnamed scope"};e&&(r.name=e),this.scopeStack.push(r),this.activeScope=r},e.prototype.endScope=function(e,t){var r=this;void 0===t&&(t=!1),t&&(this.gradientScopeCount--,0===this.gradientScopeCount&&(this.activeTape=null));var n=new Set(this.keepTensors),a=getTensorsInContainer(e);a.forEach(function(e){return n.add(e.id)});for(var o=0;o0,"gradients() received an empty list of xs."),this.tidy("gradients",function(){var o=e();assert(o instanceof Tensor,"The result y returned by f() must be a tensor.");var i=getFilteredNodesXToY(a.activeTape,t,o);if(!n&&0===i.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");var s={};return s[o.id]=null==r?ones(o.shape):r,backpropagateGradients(s,i),{value:o,grads:t.map(function(e){return s[e.id]})}},!0)},e.prototype.customGrad=function(e){var t=this;return assert(isFunction(e),"The f passed in customGrad(f) must be a function."),function(){for(var r,n,a=[],o=0;o {op();...}); to avoid memory leaks.");return this.activeScope.track.push(e),e},e}(),e;function ones(e){var t=makeOnesTypedArray(sizeFromShape(e),"float32");return Tensor.make(e,{values:t})}e=Type||(Type={}),e[e.NUMBER=0]="NUMBER",e[e.BOOLEAN=1]="BOOLEAN",e[e.STRING=2]="STRING";var URL_PROPERTIES=[{name:"DEBUG",type:Type.BOOLEAN},{name:"IS_BROWSER",type:Type.BOOLEAN},{name:"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",type:Type.NUMBER},{name:"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",type:Type.BOOLEAN},{name:"WEBGL_VERSION",type:Type.NUMBER},{name:"WEBGL_RENDER_FLOAT32_ENABLED",type:Type.BOOLEAN},{name:"WEBGL_DOWNLOAD_FLOAT_ENABLED",type:Type.BOOLEAN},{name:"WEBGL_FENCE_API_ENABLED",type:Type.BOOLEAN},{name:"BACKEND",type:Type.STRING}];function isWebGLVersionEnabled(e,t){var r;try{r=getWebGLRenderingContext(e,t)}catch(e){return!1}return null!=r&&(loseContext(r),!0)}function getWebGLDisjointQueryTimerVersion(e,t){if(0===e)return 0;var r,n=getWebGLRenderingContext(e,t);return r=hasExtension(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:hasExtension(n,"EXT_disjoint_timer_query")?1:0,null!=n&&loseContext(n),r}function isRenderToFloatTextureEnabled(e,t){if(0===e)return!1;var r=getWebGLRenderingContext(e,t);if(1===e){if(!hasExtension(r,"OES_texture_float"))return!1}else if(!hasExtension(r,"EXT_color_buffer_float"))return!1;createFloatTextureAndBindToFramebuffer(r,e);var n=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return loseContext(r),n}function isDownloadFloatTextureEnabled(e,t){if(0===e)return!1;var r=getWebGLRenderingContext(e,t);if(1===e){if(!hasExtension(r,"OES_texture_float"))return!1}else if(!hasExtension(r,"EXT_color_buffer_float"))return!1;createFloatTextureAndBindToFramebuffer(r,e),r.readPixels(0,0,1,1,r.RGBA,r.FLOAT,new Float32Array(4));var n=r.getError()===r.NO_ERROR;return loseContext(r),n}function isWebGLFenceEnabled(e,t){if(2!==e)return!1;var r=getWebGLRenderingContext(e,t),n=null!=r.fenceSync;return loseContext(r),n}function isChrome(){return"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}var TENSORFLOWJS_FLAGS_PREFIX="tfjsflags";function getFeaturesFromURL(){var e={};if("undefined"==typeof window||void 0===window.location)return e;var t=getQueryParams(window.location.search);if(TENSORFLOWJS_FLAGS_PREFIX in t){var r={};t[TENSORFLOWJS_FLAGS_PREFIX].split(",").forEach(function(e){var t=e.split(":"),n=t[0],a=t[1];r[n]=a}),URL_PROPERTIES.forEach(function(t){t.name in r&&(console.log("Setting feature override from URL "+t.name+": "+r[t.name]),t.type===Type.NUMBER?e[t.name]=+r[t.name]:t.type===Type.BOOLEAN?e[t.name]="true"===r[t.name]:t.type===Type.STRING?e[t.name]=r[t.name]:console.warn("Unknown URL param: "+t.name+"."))})}return e}function hasExtension(e,t){return null!=e.getExtension(t)}function getWebGLRenderingContext(e,t){if(0===e||!t)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");var r=document.createElement("canvas");return 1===e?r.getContext("webgl")||r.getContext("experimental-webgl"):r.getContext("webgl2")}function loseContext(e){if(null!=e){var t=e.getExtension("WEBGL_lose_context");if(null==t)throw new Error("Extension WEBGL_lose_context not supported on this browser.");t.loseContext()}}function createFloatTextureAndBindToFramebuffer(e,t){var r=e.createFramebuffer(),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);var a=2===t?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,a,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function getQueryParams(e){var t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(e){for(var r=[],n=1;n0?0:getWebGLDisjointQueryTimerVersion(t,this.get("IS_BROWSER"))}if("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE"===e)return this.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!isMobile();if("HAS_WEBGL"===e)return this.get("WEBGL_VERSION")>0;if("WEBGL_VERSION"===e)return isWebGLVersionEnabled(2,this.get("IS_BROWSER"))?2:isWebGLVersionEnabled(1,this.get("IS_BROWSER"))?1:0;if("WEBGL_RENDER_FLOAT32_ENABLED"===e)return isRenderToFloatTextureEnabled(this.get("WEBGL_VERSION"),this.get("IS_BROWSER"));if("WEBGL_DOWNLOAD_FLOAT_ENABLED"===e)return isDownloadFloatTextureEnabled(this.get("WEBGL_VERSION"),this.get("IS_BROWSER"));if("WEBGL_FENCE_API_ENABLED"===e)return isWebGLFenceEnabled(this.get("WEBGL_VERSION"),this.get("IS_BROWSER"));if("TEST_EPSILON"===e)return this.get("WEBGL_RENDER_FLOAT32_ENABLED")?TEST_EPSILON_FLOAT32_ENABLED:TEST_EPSILON_FLOAT32_DISABLED;throw new Error("Unknown feature "+e+".")},e.prototype.setFeatures=function(e){this.features=Object.assign({},e)},e.prototype.reset=function(){this.features=getFeaturesFromURL(),null!=this.globalEngine&&(this.globalEngine=null)},e.prototype.initBackend=function(e,t){var r=this;void 0===t&&(t=!1),this.backendName=e,this.backend=this.findBackend(e),this.globalEngine=new Engine(this.backend,t,function(){return r.get("DEBUG")})},e.prototype.findBackend=function(e){return e in this.registry?this.registry[e].backend:null},e.prototype.registerBackend=function(e,t,r,n){var a=this;if(void 0===r&&(r=1),e in this.registry)return console.warn(e+" backend was already registered. Reusing existing backend"),null!=n&&n(function(){return a.engine}),!1;try{var o=t();return this.registry[e]={backend:o,priority:r},!0}catch(t){return console.warn("Registration of backend "+e+" failed"),console.warn(t.stack||t.message),!1}},e.prototype.removeBackend=function(e){if(!(e in this.registry))throw new Error(e+" backend not found in registry");this.registry[e].backend.dispose(),delete this.registry[e]},Object.defineProperty(e.prototype,"engine",{get:function(){return this.initDefaultBackend(),this.globalEngine},enumerable:!0,configurable:!0}),e.prototype.initDefaultBackend=function(){null==this.globalEngine&&this.initBackend(this.get("BACKEND"),!1)},e}();function getGlobalNamespace(){var e;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof process)throw new Error("Could not find a global object");e=process}return e}function getOrMakeEnvironment(){var e=getGlobalNamespace();return null==e.ENV&&(e.ENV=new Environment(getFeaturesFromURL()),setTensorTracker(function(){return e.ENV.engine})),e.ENV}var ENV=getOrMakeEnvironment(),environment=Object.freeze({Environment:Environment,ENV:ENV});function warn(){for(var e=[],t=0;t=2*t+1||a%2==1?i.push(a):o.push(a);n.push.apply(n,o),n.push(0),n.push.apply(n,i)}return n}function getReshapedPermuted(e,t,r,n){void 0===n&&(n=!0);var a=[];n?a.push(e[0]/r):a.push(e[0]*r);for(var o=1;o=-r&&et||r===e){n=!0;break}r=nearestDivisor(e,r+1)}return r}function computeOutShape(e,t,r){for(var n=[],a=e.length,o=0;o0?a>=s[t]:a<=s[t]);a+=n[t])r+=1;return r}),[i,l]}function startForAxis(e,t,r,n,a){var o=t[a];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var i=n[a];return o<0&&(o+=i),clamp(0,o,i-1)}function stopForAxis(e,t,r,n,a){var o=t[a];e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var i=n[a];return o<0&&(o+=i),r[a]>0?clamp(0,o,i):clamp(-1,o,i-1)}function grad(e){return assert(isFunction(e),"The f passed in grad(f) must be a function"),function(t,r){return assert(t instanceof Tensor,"The x passed in grad(f)(x) must be a tensor"),assert(null==r||r instanceof Tensor,"The dy passed in grad(f)(x, dy) must be a tensor"),ENV.engine.tidy(function(){var n=ENV.engine.gradients(function(){return e(t)},[t],r),a=n.value,o=n.grads;return null!=r&&assertShapesMatch(a.shape,r.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),checkGrads(o),o[0]})}}function grads(e){return assert(isFunction(e),"The f passed in grads(f) must be a function"),function(t,r){return assert(Array.isArray(t)&&t.every(function(e){return e instanceof Tensor}),"The args passed in grads(f)(args) must be an array of tensors"),assert(null==r||r instanceof Tensor,"The dy passed in grads(f)(args, dy) must be a tensor"),ENV.engine.tidy(function(){var n=ENV.engine.gradients(function(){return e.apply(void 0,t)},t,r),a=n.value,o=n.grads;return null!=r&&assertShapesMatch(a.shape,r.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),checkGrads(o),o})}}function valueAndGrad(e){return assert(isFunction(e),"The f passed in valueAndGrad(f) must be a function"),function(t,r){assert(t instanceof Tensor,"The x passed in valueAndGrad(f)(x) must be a tensor"),assert(null==r||r instanceof Tensor,"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");var n=ENV.engine.gradients(function(){return e(t)},[t],r),a=n.grads,o=n.value;return checkGrads(a),{grad:a[0],value:o}}}function valueAndGrads(e){return assert(isFunction(e),"The f passed in valueAndGrads(f) must be a function"),function(t,r){assert(Array.isArray(t)&&t.every(function(e){return e instanceof Tensor}),"The args passed in valueAndGrads(f)(args) must be array of tensors"),assert(null==r||r instanceof Tensor,"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");var n=ENV.engine.gradients(function(){return e.apply(void 0,t)},t,r);return null!=r&&assertShapesMatch(n.value.shape,r.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),checkGrads(n.grads),n}}function variableGrads(e,t){if(assert(isFunction(e),"The f passed in variableGrads(f) must be a function"),assert(null==t||Array.isArray(t)&&t.every(function(e){return e instanceof Variable}),"The varList passed in variableGrads(f, varList) must be an array of variables"),null==t)for(var r in t=[],ENV.engine.registeredVariables)t.push(ENV.engine.registeredVariables[r]);var n=t.length;assert((t=t.filter(function(e){return e.trainable})).length>0,"variableGrads() expects at least one of the input variables to be trainable, but none of the "+n+" variables is trainable.");var a=ENV.engine.gradients(e,t,null,!0),o=a.value,i=a.grads;assert(i.some(function(e){return null!=e}),"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),assert(0===o.rank,"The f passed in variableGrads(f) must return a scalar, but it returned a rank-"+o.rank+" tensor");var s={};return t.forEach(function(e,t){null!=i[t]&&(s[e.name]=i[t])}),{value:o,grads:s}}function customGrad(e){return ENV.engine.customGrad(e)}function checkGrads(e){if(e.filter(function(e){return null==e}).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.")}function convertToTensor(e,t,r,n){if(void 0===n&&(n="float32"),n=n||"float32",e instanceof Tensor)return e;if(!isTypedArray(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e)throw new Error("Argument '"+t+"' passed to '"+r+"' must be a Tensor or TensorLike, but got "+e.constructor.name);var a=inferShape(e);return isTypedArray(e)||Array.isArray(e)||(e=[e]),Tensor.make(a,{values:toTypedArray(e,n,ENV.get("DEBUG"))},n)}function convertToTensorArray(e,t,r){if(!Array.isArray(e))throw new Error("Argument "+t+" passed to "+r+" must be a `Tensor[]` or `TensorLike[]`");return e.map(function(e,n){return convertToTensor(e,t+"["+n+"]",r)})}function op(e){var t=Object.keys(e);if(1!==t.length)throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with "+t.length+" keys.");var r=t[0],n=e[r];r.endsWith("_")&&(r=r.substring(0,r.length-1));var a=function(){for(var e=[],t=0;t1)return zeros([0],n);var a=makeZerosTypedArray(Math.abs(Math.ceil((t-e)/r)),n);ta}).sort(function(e,t){return t.score-e.score}),i=[],s=0;s=0;--d)if(intersectionOverUnion(e,p,i[d])>=n){c=!0;break}if(!c&&(i.push(p),i.length>=r))break}return tensor1d(i,"int32")}function intersectionOverUnion(e,t,r){var n=e.subarray(4*t,4*t+4),a=e.subarray(4*r,4*r+4),o=Math.min(n[0],n[2]),i=Math.min(n[1],n[3]),s=Math.max(n[0],n[2]),u=Math.max(n[1],n[3]),l=Math.min(a[0],a[2]),p=Math.min(a[1],a[3]),c=Math.max(a[0],a[2]),d=Math.max(a[1],a[3]),h=(s-o)*(u-i),f=(c-l)*(d-p);if(h<=0||f<=0)return 0;var m=Math.max(o,l),g=Math.max(i,p),y=Math.min(s,c),v=Math.min(u,d),b=Math.max(y-m,0)*Math.max(v-g,0);return b/(h+f-b)}function topkImpl(e,t,r,n,a){for(var o=t[t.length-1],i=[e.length/o,o],s=i[0],u=i[1],l=getTypedArrayFromDType(r,s*n),p=getTypedArrayFromDType("int32",s*n),c=0;c":"<",u=r?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+n+";\n\n int bestIndex = 0;\n float bestValue = getA(batch, inOffset);\n\n for (int i = 0; i < "+n+"; i++) {\n int inIdx = "+u+";\n float candidate = getA(batch, inIdx);\n if (candidate "+s+" bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n "},AvgPool2DBackpropProgram=function(e){this.variableNames=["dy"],this.outputShape=e.inShape;var t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,a=e.strideWidth,o=t-1-e.padInfo.top,i=r-1-e.padInfo.left,s=1/(t*r);this.userCode="\n const ivec2 pads = ivec2("+o+", "+i+");\n const float avgMultiplier = float("+s+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+n+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+r+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+a+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n "};function getBroadcastDims(e,t){for(var r=e.length,n=[],a=0;a1&&1===i&&n.unshift(o)}return n}function getReductionAxes(e,t){for(var r=[],n=0;n1)&&r.unshift(o)}return r}function broadcastDimsAreOuter(e){for(var t=0;t1&&s>1&&i!==s)throw Error(n);r.unshift(Math.max(i,s))}return r}var BatchNormProgram=function(e,t,r,n,a,o){this.outputShape=[],this.supportsBroadcasting=!0,this.variableNames=["x","mean","variance"],assertAndGetBroadcastShape(e,t),assertAndGetBroadcastShape(e,r);var i="0.0";null!=n&&(assertAndGetBroadcastShape(e,n),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");var s="1.0";null!=a&&(assertAndGetBroadcastShape(e,a),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode="\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = "+i+";\n float scale = "+s+";\n float inv = scale * inversesqrt(variance + float("+o+"));\n setOutput((x - mean) * inv + offset);\n }\n "},CHECK_NAN_SNIPPET="\n if (isNaN(a)) return a;\n if (isNaN(b)) return b;\n",ADD="return a + b;",SUB="return a - b;",MUL="return a * b;",DIV="if (a == b) return 1.0;\n return a / b;",INT_DIV="\n float resultSign = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n int result = ia / ib;\n int amodb = ia - ib * result;\n\n if (resultSign < 0.0 && amodb != 0) {\n result -= 1;\n }\n return float(result);\n",POW="\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",SQUARED_DIFFERENCE="return (a - b) * (a - b);",EQUAL="return float(a == b);",NOT_EQUAL="return float(a != b);",LESS="return float(a < b);",LESS_EQUAL="return float(a <= b);",GREATER="return float(a > b);",GREATER_EQUAL="return float(a >= b);",LOGICAL_AND="return float(a >= 1.0 && b >= 1.0);",LOGICAL_OR="return float(a >= 1.0 || b >= 1.0);",MAX=CHECK_NAN_SNIPPET+"\n return max(a, b);\n",MIN=CHECK_NAN_SNIPPET+"\n return min(a, b);\n",MOD="if (b == 0.0) return NAN;\n return mod(a, b);",ATAN2=CHECK_NAN_SNIPPET+"\n return atan(a, b);\n",ELU_DER="return (b >= 1.0) ? a : a * (b + 1.0);",BinaryOpProgram=function(){function e(e,t,r){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.outputShape=assertAndGetBroadcastShape(t,r),this.userCode="\n uniform float NAN;\n float binaryOperation(float a, float b) {\n "+e+"\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n "}return e.prototype.getCustomSetupFunc=function(){var e=this;return function(t,r){null==e.startLoc&&(e.startLoc=t.getUniformLocationNoThrow(r,"NAN"),null==e.startLoc)||t.gl.uniform1f(e.startLoc,NaN)}},e}(),ClipProgram=function(e,t,r){this.variableNames=["A"],this.outputShape=e;var n=t.toFixed(20),a=r.toFixed(20);this.userCode="\n void main() {\n float value = getAAtOutCoords();\n if (isNaN(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, "+n+", "+a+"));\n }\n "};function assertParams(e,t,r){var n=e.length,a=t.length;assert(e.length===t.length,"Error in concat"+n+"D: rank of x1 ("+n+") and x2 ("+a+") must be the same."),assert(r>=0&&r= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+r+" - "+a+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "},Conv2DDerInputProgram=function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,a=e.strideWidth,o=t-1-e.padInfo.top,i=r-1-e.padInfo.left;this.userCode="\n const ivec2 pads = ivec2("+o+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+n+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+t+" - 1 - wR;\n\n for (int wC = 0; wC < "+r+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+a+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+r+" - 1 - wC;\n\n for (int d2 = 0; d2 < "+e.outChannels+"; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "},DepthwiseConv2DDerFilterProgram=function(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;var t=e.strideHeight,r=e.strideWidth,n=e.padInfo.top,a=e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * "+o+" + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < "+e.batchSize+"; b++) {\n for (int yR = 0; yR < "+e.outHeight+"; yR++) {\n int xR = wR + yR * "+t+" - "+n+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+r+" - "+a+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "},DepthwiseConv2DDerInputProgram=function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,a=e.strideWidth,o=t-1-e.padInfo.top,i=r-1-e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode="\n const ivec2 pads = ivec2("+o+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+n+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+t+" - 1 - wR;\n\n for (int wC = 0; wC < "+r+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+a+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+r+" - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < "+s+"; dm++) {\n int d2 = d1 * "+s+" + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "},Conv2DProgram=function(e){this.variableNames=["x","W"],this.outputShape=e.outShape;var t=e.padInfo.top,r=e.padInfo.left,n=e.strideHeight,a=e.strideWidth,o=e.dilationHeight,i=e.dilationWidth,s=e.filterHeight,u=e.filterWidth,l=4*Math.floor(e.inChannels/4),p=e.inChannels%4;this.userCode="\n const ivec2 strides = ivec2("+n+", "+a+");\n const ivec2 pads = ivec2("+t+", "+r+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+s+"; wR++) {\n int xR = xRCorner + wR * "+o+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+u+"; wC++) {\n int xC = xCCorner + wC * "+i+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n for (int d1 = 0; d1 < "+l+"; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if ("+(1===p)+") {\n dotProd +=\n getX(batch, xR, xC, "+l+") *\n getW(wR, wC, "+l+", d2);\n } else if ("+(2===p)+") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, "+l+"),\n getX(batch, xR, xC, "+l+" + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, "+l+", d2),\n getW(wR, wC, "+l+" + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if ("+(3===p)+") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, "+l+"),\n getX(batch, xR, xC, "+l+" + 1),\n getX(batch, xR, xC, "+l+" + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, "+l+", d2),\n getW(wR, wC, "+l+" + 1, d2),\n getW(wR, wC, "+l+" + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n "},DepthwiseConv2DProgram=function(e){this.variableNames=["x","W"],this.outputShape=e.outShape;var t=e.inHeight,r=e.inWidth,n=e.padInfo.top,a=e.padInfo.left,o=e.strideHeight,i=e.strideWidth,s=e.dilationHeight,u=e.dilationWidth,l=e.filterHeight,p=e.filterWidth,c=e.outChannels/e.inChannels;this.userCode="\n const ivec2 strides = ivec2("+o+", "+i+");\n const ivec2 pads = ivec2("+n+", "+a+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / "+c+";\n int q = d2 - d1 * "+c+";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < "+l+"; wR++) {\n int xR = xRCorner + wR * "+s+";\n\n if (xR < 0 || xR >= "+t+") {\n continue;\n }\n\n for (int wC = 0; wC < "+p+"; wC++) {\n int xC = xCCorner + wC * "+u+";\n\n if (xC < 0 || xC >= "+r+") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n "};function makeShader(e,t,r,n){var a=e.map(function(e){var t=sizeFromShape(e.shapeInfo.logicalShape);return e.shapeInfo.isUniform?"uniform float "+e.name+(t>1?"["+t+"]":"")+";":"uniform sampler2D "+e.name+";"});a=a.join("\n");var o=e.map(function(e){return getInputSamplingSnippet(e,t,n)}).join("\n"),i=t.texShape,s=getOutputSamplingSnippet(t.logicalShape,i);return[SHADER_PREFIX,FLOAT_TEXTURE_SAMPLE_SNIPPET,FLOAT_TEXTURE_SETOUTPUT_SNIPPET,a,s,o,r].join("\n")}function getSamplerFromInInfo(e){var t=e.shapeInfo.logicalShape;switch(t.length){case 0:return getSamplerScalar(e);case 1:return getSampler1D(e);case 2:return getSampler2D(e);case 3:return getSampler3D(e);case 4:return getSampler4D(e);case 5:return getSampler5D(e);case 6:return getSampler6D(e);default:throw new Error(t.length+"-D input sampling is not yet supported")}}function getInputSamplingSnippet(e,t,r){var n=getSamplerFlat(e);return n+=getSamplerFromInInfo(e),(r||arraysEqual(e.shapeInfo.logicalShape,t.logicalShape))&&(n+=getSamplerAtOutputCoords(e,t,r)),n}function getOutputSamplingSnippet(e,t){switch(e.length){case 0:return getOutputScalarCoords();case 1:return getOutput1DCoords(e,t);case 2:return getOutput2DCoords(e,t);case 3:return getOutput3DCoords(e,t);case 4:return getOutput4DCoords(e,t);case 5:return getOutput5DCoords(e,t);case 6:return getOutput6DCoords(e,t);default:throw new Error(e.length+"-D output sampling is not yet supported")}}var SAMPLE_1D_SNIPPET="\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_2D_SNIPPET="\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\n int index = row * numC + col;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_3D_SNIPPET="\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\n int stride1, int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_4D_SNIPPET="\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int row, int col, int depth,\n int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_5D_SNIPPET="\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int row, int col, int depth,\n int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2 * stride3 + depth3;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",SAMPLE_6D_SNIPPET="\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\n int stride1, int stride2, int stride3, int stride4,\n int row, int col, int depth, int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\n stride3 + depth3 * stride4 + depth4;\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",FLOAT_TEXTURE_SAMPLE_SNIPPET="\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return texture2D(textureSampler, uv).r;\n }\n",FLOAT_TEXTURE_SETOUTPUT_SNIPPET="\n void setOutput(float val) {\n gl_FragColor = vec4(val, 0, 0, 0);\n }\n",SHADER_PREFIX="\n precision highp float;\n precision highp int;\n varying vec2 resultUV;\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n bool isNaN(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n bool hasNaN(vec4 values) {\n vec4 v1 = values * values;\n vec4 v2 = values * values;\n return any(notEqual(v1, v2));\n }\n\n float getNaN(vec4 values) {\n return dot(vec4(1), values);\n }\n\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n "+SAMPLE_1D_SNIPPET+"\n "+SAMPLE_2D_SNIPPET+"\n "+SAMPLE_3D_SNIPPET+"\n "+SAMPLE_4D_SNIPPET+"\n "+SAMPLE_5D_SNIPPET+"\n "+SAMPLE_6D_SNIPPET+"\n";function getOutputScalarCoords(){return"\n int getOutputCoords() {\n return 0;\n }\n "}function getOutput1DCoords(e,t){return 1===t[0]?"\n int getOutputCoords() {\n return int(resultUV.x * "+t[1]+".0);\n }\n ":1===t[1]?"\n int getOutputCoords() {\n return int(resultUV.y * "+t[0]+".0);\n }\n ":"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n return resTexRC.x * "+t[1]+" + resTexRC.y;\n }\n "}function getOutput3DCoords(e,t){var r=e[1]*e[2],n=e[2];return"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n int r = index / "+r+";\n index -= r * "+r+";\n int c = index / "+n+";\n int d = index - c * "+n+";\n return ivec3(r, c, d);\n }\n "}function getOutput4DCoords(e,t){var r=e[3],n=e[2]*r,a=e[1]*n;return"\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n int r = index / "+a+";\n index -= r * "+a+";\n\n int c = index / "+n+";\n index -= c * "+n+";\n\n int d = index / "+r+";\n int d2 = index - d * "+r+";\n\n return ivec4(r, c, d, d2);\n }\n "}function getOutput5DCoords(e,t){var r=e[4],n=e[3]*r,a=e[2]*n,o=e[1]*a;return"\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2("+t[0]+",\n "+t[1]+"));\n\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n int r = index / "+o+";\n index -= r * "+o+";\n\n int c = index / "+a+";\n index -= c * "+a+";\n\n int d = index / "+n+";\n index -= d * "+n+";\n\n int d2 = index / "+r+";\n int d3 = index - d2 * "+r+";\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n "}function getOutput6DCoords(e,t){var r=e[5],n=e[4]*r,a=e[3]*n,o=e[2]*a,i=e[1]*o;return"\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n int r = index / "+i+";\n index -= r * "+i+";\n\n int c = index / "+o+";\n index -= c * "+o+";\n\n int d = index / "+a+";\n index -= d * "+a+";\n\n int d2 = index / "+n+";\n index -= d2 * "+n+";\n\n int d3 = index / "+r+";\n int d4 = index - d3 * "+r+";\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n "}function getOutput2DCoords(e,t){return arraysEqual(e,t)?"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2("+t[0]+", "+t[1]+"));\n }\n ":1===e[1]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n return ivec2(index, 0);\n }\n ":1===e[0]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n return ivec2(0, index);\n }\n ":"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n int r = index / "+e[1]+";\n int c = index - r * "+e[1]+";\n return ivec2(r, c);\n }\n "}function getSamplerScalar(e){var t=e.name,r="get"+t.charAt(0).toUpperCase()+t.slice(1);return e.shapeInfo.isUniform?"float "+r+"() {return "+t+";}":"\n float "+r+"() {\n return sampleTexture("+t+", halfCR);\n }\n "}function getSampler1D(e){var t=e.name,r="get"+t.charAt(0).toUpperCase()+t.slice(1);return"\n float "+r+"(int index) {\n return "+r+"Flat(index);\n }\n "}function getSampler2D(e){var t=e.shapeInfo.logicalShape,r=e.name,n="get"+r.charAt(0).toUpperCase()+r.slice(1),a=e.shapeInfo.texShape;if(null!=a&&arraysEqual(t,a)){var o=a[0];return"\n float "+n+"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2("+a[1]+".0, "+o+".0);\n return sampleTexture("+r+", uv);\n }\n "}var i=squeezeShape(t),s=i.newShape,u=i.keptDims,l=s;if(l.length=1?"coords = 0;":s.map(function(e){return"coords["+(e+u)+"] = 0;"}).join("\n"))+"\n return get"+r+"("+(o<2&&a>0?"coords":e.shapeInfo.logicalShape.map(function(e,t){return"coords["+(t+u)+"]"}).join(", "))+");\n }\n "}function getSamplerAtOutputCoords(e,t,r){var n=e.name,a=n.charAt(0).toUpperCase()+n.slice(1),o="get"+a+"AtOutCoords",i=getBroadcastDims(e.shapeInfo.logicalShape,t.logicalShape),s=e.shapeInfo.logicalShape.length,u=t.logicalShape.length,l=r&&(u>s||i.length>0),p=broadcastDimsAreOuter(i),c=e.shapeInfo.isUniform;if(l&&!p)return getBroadcastOutputCoordsSampler(e,t,a,o);var d=sizeFromShape(e.shapeInfo.logicalShape),h="";l&&p&&(h="\n int mainPart = index / "+d+";\n index -= mainPart * "+d+";\n ");var f=t.texShape;if(c)return 1===d?"float "+o+"() {return "+n+";}":"\n float "+o+"() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+f[0]+", "+f[1]+"));\n int index = resTexRC.x * "+f[1]+" + resTexRC.y;\n "+h+"\n return get"+a+"Flat(index);\n }\n ";var m=e.shapeInfo.texShape;return arraysEqual(m,f)?"\n float "+o+"() {\n return sampleTexture("+n+", resultUV);\n }\n ":"\n float "+o+"() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+f[0]+", "+f[1]+"));\n int index = resTexRC.x * "+f[1]+" + resTexRC.y;\n "+h+"\n int texR = index / "+m[1]+";\n int texC = index - texR * "+m[1]+";\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+m[1]+".0, "+m[0]+".0);\n\n return sampleTexture("+n+", uv);\n }\n "}function getCoordsDataType(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error("GPU for rank "+e+" is not yet supported")}function squeezeInputInfo(e,t){var r=JSON.parse(JSON.stringify(e));return r.shapeInfo.logicalShape=t,r}function getSqueezedParams(e,t){return t.map(function(t){return e[t]}).join(", ")}var CumSumProgram=function(e,t,r){this.variableNames=["x"],this.outputShape=e;var n=e.length,a=e[e.length-1],o=r?"<":">";this.userCode="\n int getIndex(int i) {\n "+(r?"return "+a+" -i - 1;":"return i;")+"\n }\n\n void main() {\n "+getCoordsDataType(n)+" coords = getOutputCoords();\n int end = "+getFinalCoord(n,"coords")+";\n float val = 0.0;\n for (int i = "+a+" - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx "+o+" end) {\n continue;\n }\n if (idx == end && "+t+") {\n continue;\n }\n "+getFinalCoord(n,"coords")+" = idx;\n val += getX("+getCoords(n,"coords")+");\n }\n setOutput(val);\n }\n "};function getCoords(e,t){if(1===e)return""+t;if(2===e)return t+".x, "+t+".y";if(3===e)return t+".x, "+t+".y, "+t+".z";if(4===e)return t+".x, "+t+".y, "+t+".z, "+t+".w";throw Error("Cumulative sum for rank "+e+" is not yet supported")}function getFinalCoord(e,t){if(1===e)return""+t;if(2===e)return t+".y";if(3===e)return t+".z";if(4===e)return t+".w";throw Error("Cumulative sum for rank "+e+" is not yet supported")}var TextureUsage,PhysicalTextureType,EncodeFloatProgram=function(e){this.variableNames=["A"],this.outputShape=e,this.userCode="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n gl_FragColor = encode_float(x);\n }\n "},FromPixelsProgram=function(e){this.variableNames=["A"];var t=e[0],r=e[1];this.outputShape=e,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+r+".0, "+t+".0);\n\n vec4 values = texture2D(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n "},GatherProgram=function(e,t,r){this.variableNames=["A","indices"];var n=e.slice();n[r]=t,this.outputShape=n,this.rank=n.length;var a=getCoordsDataType(this.rank),o=getSourceCoords(e,r);this.userCode="\n void main() {\n "+a+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "};function getSourceCoords(e,t){var r=e.length;if(r>4)throw Error("Gather for rank "+r+" is not yet supported");if(1===r)return"int(getIndices(resRC))";for(var n=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[],o=0;o= "+n);for(var a=0,o=0;o= "+n);for(var a=0,o=0;o= "+a);for(var o=getPackedMatrixTextureShapeWidthHeight(t,r),i=o[0],s=o[1],u=r%2==1,l=t%2==1,p=Math.floor(r/2),c=Math.floor(t/2),d=u?4:0,h=r,f=0,m=0;m= "+a);for(var o=r%2==1,i=t%2==1,s=Math.floor(r/2),u=Math.floor(t/2),l=getPackedMatrixTextureShapeWidthHeight(t,r),p=l[0],c=l[1],d=o?4:0,h=r+(o?1:0),f=0,m=0,g=r,y=0;yn||r>n)throw a="["+t+"x"+r+"]",new Error("Requested texture size "+a+" greater than WebGL maximum on this browser / GPU ["+n+"x"+n+"].")}function createFramebuffer(e){return throwIfNull(e,function(){return e.createFramebuffer()},"Unable to create WebGLFramebuffer.")}function bindVertexBufferToProgramAttribute(e,t,r,n,a,o,i){var s=e.getAttribLocation(t,r);return-1!==s&&(callAndCheck(e,function(){return e.bindBuffer(e.ARRAY_BUFFER,n)}),callAndCheck(e,function(){return e.vertexAttribPointer(s,a,e.FLOAT,!1,o,i)}),callAndCheck(e,function(){return e.enableVertexAttribArray(s)}),!0)}function bindTextureUnit(e,t,r){validateTextureUnit(e,r),callAndCheck(e,function(){return e.activeTexture(e.TEXTURE0+r)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)})}function unbindTextureUnit(e,t){validateTextureUnit(e,t),callAndCheck(e,function(){return e.activeTexture(e.TEXTURE0+t)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function getProgramUniformLocationOrThrow(e,t,r){return throwIfNull(e,function(){return e.getUniformLocation(t,r)},'uniform "'+r+'" not present in program.')}function getProgramUniformLocation(e,t,r){return e.getUniformLocation(t,r)}function bindTextureToProgramUniformSampler(e,t,r,n,a){callAndCheck(e,function(){return bindTextureUnit(e,r,a)}),callAndCheck(e,function(){return e.uniform1i(n,a)})}function bindCanvasToFramebuffer(e){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,null)}),callAndCheck(e,function(){return e.viewport(0,0,e.canvas.width,e.canvas.height)}),callAndCheck(e,function(){return e.scissor(0,0,e.canvas.width,e.canvas.height)})}function bindColorTextureToFramebuffer(e,t,r){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,r)}),callAndCheck(e,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)})}function unbindColorTextureFromFramebuffer(e,t){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,t)}),callAndCheck(e,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)})}function validateFramebuffer(e){var t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+getFramebufferErrorMessage(e,t))}function getFramebufferErrorMessage(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return"unknown error "+t}}function throwIfNull(e,t,r){var n=callAndCheck(e,function(){return t()});if(null==n)throw new Error(r);return n}function validateTextureUnit(e,t){var r=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,n=t+e.TEXTURE0;if(nr)throw new Error("textureUnit must be in [gl.TEXTURE0, gl.TEXTURE"+r+"].")}function getTextureShapeFromLogicalShape(e,t){2!==t.length&&(t=squeezeShape(t).newShape);var r=queryMaxTextureSize(e),n=sizeFromShape(t);return t.length<=1&&n<=r?[n,1]:2===t.length&&t[0]<=r&&t[1]<=r?t:3===t.length&&t[0]<=r&&t[1]*t[2]<=r?[t[0],t[1]*t[2]]:4===t.length&&t[0]<=r&&t[1]*t[2]*t[3]<=r?[t[0],t[1]*t[2]*t[3]]:sizeToSquarishShape(n)}var webgl_util=Object.freeze({createWebGLRenderingContext:createWebGLRenderingContext,createWebGLRenderingContextFromCanvas:createWebGLRenderingContextFromCanvas,callAndCheck:callAndCheck,enableDebugWebGLErrorChecking:enableDebugWebGLErrorChecking,checkWebGLError:checkWebGLError,getWebGLErrorMessage:getWebGLErrorMessage,getExtensionOrThrow:getExtensionOrThrow,createVertexShader:createVertexShader,createFragmentShader:createFragmentShader,createProgram:createProgram,linkProgram:linkProgram,validateProgram:validateProgram,createStaticVertexBuffer:createStaticVertexBuffer,createStaticIndexBuffer:createStaticIndexBuffer,queryMaxTextureSize:queryMaxTextureSize,getNumChannels:getNumChannels,createTexture:createTexture,validateTextureSize:validateTextureSize,createFramebuffer:createFramebuffer,bindVertexBufferToProgramAttribute:bindVertexBufferToProgramAttribute,bindTextureUnit:bindTextureUnit,unbindTextureUnit:unbindTextureUnit,getProgramUniformLocationOrThrow:getProgramUniformLocationOrThrow,getProgramUniformLocation:getProgramUniformLocation,bindTextureToProgramUniformSampler:bindTextureToProgramUniformSampler,bindCanvasToFramebuffer:bindCanvasToFramebuffer,bindColorTextureToFramebuffer:bindColorTextureToFramebuffer,unbindColorTextureFromFramebuffer:unbindColorTextureFromFramebuffer,validateFramebuffer:validateFramebuffer,getFramebufferErrorMessage:getFramebufferErrorMessage,getTextureShapeFromLogicalShape:getTextureShapeFromLogicalShape});function getWebGLContextAttributes(){return{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0}}function createWebGLContext(e){var t,r=getWebGLContextAttributes();return callAndCheck(t=null!=e?createWebGLRenderingContextFromCanvas(e,r):createWebGLRenderingContext(r),function(){return t.disable(t.DEPTH_TEST)}),callAndCheck(t,function(){return t.disable(t.STENCIL_TEST)}),callAndCheck(t,function(){return t.disable(t.BLEND)}),callAndCheck(t,function(){return t.disable(t.DITHER)}),callAndCheck(t,function(){return t.disable(t.POLYGON_OFFSET_FILL)}),callAndCheck(t,function(){return t.disable(t.SAMPLE_COVERAGE)}),callAndCheck(t,function(){return t.enable(t.SCISSOR_TEST)}),callAndCheck(t,function(){return t.enable(t.CULL_FACE)}),callAndCheck(t,function(){return t.cullFace(t.BACK)}),t}function createVertexShader$1(e){return createVertexShader(e,"\n precision highp float;\n attribute vec3 clipSpacePos;\n attribute vec2 uv;\n varying vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }")}function createVertexBuffer(e){return createStaticVertexBuffer(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function createIndexBuffer(e){return createStaticIndexBuffer(e,new Uint16Array([0,1,2,2,1,3]))}function getTextureConfig(e,t){var r,n,a,o,i,s,u,l=e;return 2===ENV.get("WEBGL_VERSION")?(r=l.R32F,n=l.R16F,a=l.RGBA32F,o=l.RED,i=4,s=1,u=l.HALF_FLOAT):(r=e.RGBA,n=e.RGBA,a=l.RGBA,o=e.RGBA,i=4,s=4,u=null!=t?t.HALF_FLOAT_OES:null),{internalFormatFloat:r,internalFormatHalfFloat:n,internalFormatPackedFloat:a,textureFormatFloat:o,downloadTextureFormat:e.RGBA,downloadUnpackNumChannels:i,defaultNumChannels:s,textureTypeHalfFloat:u}}function createAndConfigureTexture(e,t,r,n,a,o){validateTextureSize(e,t,r);var i=createTexture(e),s=e.TEXTURE_2D;return callAndCheck(e,function(){return e.bindTexture(s,i)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_MIN_FILTER,e.NEAREST)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_MAG_FILTER,e.NEAREST)}),callAndCheck(e,function(){return e.texImage2D(s,0,n,t,r,0,a,o,null)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)}),i}function createFloat32MatrixTexture(e,t,r,n){var a=getUnpackedMatrixTextureShapeWidthHeight(t,r);return createAndConfigureTexture(e,a[0],a[1],n.internalFormatFloat,n.textureFormatFloat,e.FLOAT)}function createFloat16MatrixTexture(e,t,r,n){var a=getUnpackedMatrixTextureShapeWidthHeight(t,r);return createAndConfigureTexture(e,a[0],a[1],n.internalFormatFloat,n.textureFormatFloat,n.textureTypeHalfFloat)}function createUnsignedBytesMatrixTexture(e,t,r,n){var a=getUnpackedMatrixTextureShapeWidthHeight(t,r);return createAndConfigureTexture(e,a[0],a[1],e.RGBA,e.RGBA,e.UNSIGNED_BYTE)}function createPackedMatrixTexture(e,t,r,n){var a=getPackedMatrixTextureShapeWidthHeight(t,r);return createAndConfigureTexture(e,a[0],a[1],n.internalFormatPackedFloat,e.RGBA,e.FLOAT)}function bindVertexProgramAttributeStreams(e,t,r){return callAndCheck(e,function(){return e.bindBuffer(e.ARRAY_BUFFER,r)}),bindVertexBufferToProgramAttribute(e,t,"clipSpacePos",r,3,20,0)&&bindVertexBufferToProgramAttribute(e,t,"uv",r,2,20,12)}function uploadPixelDataToTexture(e,t,r){callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)}),callAndCheck(e,function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function uploadDataToTexture(e,t,r,n,a,o){validateTextureSize(e,r,n),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)}),callAndCheck(e,function(){return e.texSubImage2D(e.TEXTURE_2D,0,0,0,r,n,o,e.FLOAT,a)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function uploadMatrixToTexture(e,t,r,n,a,o,i){var s,u=getUnpackedMatrixTextureShapeWidthHeight(r,n),l=u[0],p=u[1];1===i.defaultNumChannels?s=a:encodeMatrixToUnpackedArray(a,s=new Float32Array(getUnpackedArraySizeFromMatrixSize(a.length,o)),o),uploadDataToTexture(e,t,l,p,s,i.textureFormatFloat)}function uploadMatrixToPackedTexture(e,t,r,n,a,o){var i=getPackedMatrixTextureShapeWidthHeight(r,n),s=i[0],u=i[1],l=new Float32Array(getPackedRGBAArraySizeFromMatrixShape(r,n));encodeMatrixToPackedRGBA(a,r,n,l),uploadDataToTexture(e,t,s,u,l,e.RGBA)}function maybeCreateBufferFromOutputTexture(e,t,r,n,a){var o=t;if(2===ENV.get("WEBGL_VERSION")){var i=e,s=i.createBuffer();callAndCheck(e,function(){return e.bindBuffer(i.PIXEL_PACK_BUFFER,s)});var u=4*getUnpackedArraySizeFromMatrixSize(r*n,a.downloadUnpackNumChannels);callAndCheck(e,function(){return e.bufferData(i.PIXEL_PACK_BUFFER,u,e.STATIC_DRAW)}),callAndCheck(e,function(){return i.readPixels(0,0,n,r,e.RGBA,e.FLOAT,0)}),callAndCheck(e,function(){return e.bindBuffer(i.PIXEL_PACK_BUFFER,null)}),o=s}return o}function downloadFloat32MatrixFromBuffer(e,t,r,n,a){var o=e,i=new Float32Array(getUnpackedArraySizeFromMatrixSize(r*n,a.downloadUnpackNumChannels));o.bindBuffer(e.ARRAY_BUFFER,t),o.getBufferSubData(e.ARRAY_BUFFER,0,i),o.bindBuffer(e.ARRAY_BUFFER,null);var s=new Float32Array(r*n);return decodeMatrixFromUnpackedArray(i,s,a.downloadUnpackNumChannels),s}function downloadFloat32MatrixFromOutputTexture(e,t,r,n){var a=getUnpackedMatrixTextureShapeWidthHeight(t,r),o=a[0],i=a[1],s=new Float32Array(getUnpackedArraySizeFromMatrixSize(t*r,n.downloadUnpackNumChannels));callAndCheck(e,function(){return e.readPixels(0,0,o,i,n.downloadTextureFormat,e.FLOAT,s)});var u=new Float32Array(t*r);return decodeMatrixFromUnpackedArray(s,u,n.downloadUnpackNumChannels),u}function downloadByteEncodedFloatMatrixFromOutputTexture(e,t,r,n){var a=getUnpackedMatrixTextureShapeWidthHeight(t,r),o=a[0],i=a[1],s=new Uint8Array(getUnpackedArraySizeFromMatrixSize(t*r,4));return callAndCheck(e,function(){return e.readPixels(0,0,o,i,n.downloadTextureFormat,e.UNSIGNED_BYTE,s)}),new Float32Array(s.buffer)}function downloadMatrixFromPackedOutputTexture(e,t,r,n){var a=getPackedMatrixTextureShapeWidthHeight(t,r),o=a[0],i=a[1],s=new Float32Array(getPackedRGBAArraySizeFromMatrixShape(t,r));callAndCheck(e,function(){return e.readPixels(0,0,o,i,e.RGBA,e.FLOAT,s)});var u=new Float32Array(t*r);return decodeMatrixFromPackedRGBA(s,t,r,u)}var gpgpu_util=Object.freeze({getWebGLContextAttributes:getWebGLContextAttributes,createWebGLContext:createWebGLContext,createVertexShader:createVertexShader$1,createVertexBuffer:createVertexBuffer,createIndexBuffer:createIndexBuffer,getTextureConfig:getTextureConfig,createFloat32MatrixTexture:createFloat32MatrixTexture,createFloat16MatrixTexture:createFloat16MatrixTexture,createUnsignedBytesMatrixTexture:createUnsignedBytesMatrixTexture,createPackedMatrixTexture:createPackedMatrixTexture,bindVertexProgramAttributeStreams:bindVertexProgramAttributeStreams,uploadPixelDataToTexture:uploadPixelDataToTexture,uploadMatrixToTexture:uploadMatrixToTexture,uploadMatrixToPackedTexture:uploadMatrixToPackedTexture,maybeCreateBufferFromOutputTexture:maybeCreateBufferFromOutputTexture,downloadFloat32MatrixFromBuffer:downloadFloat32MatrixFromBuffer,downloadFloat32MatrixFromOutputTexture:downloadFloat32MatrixFromOutputTexture,downloadByteEncodedFloatMatrixFromOutputTexture:downloadByteEncodedFloatMatrixFromOutputTexture,downloadMatrixFromPackedOutputTexture:downloadMatrixFromPackedOutputTexture}),GPGPUContext=function(){function e(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.autoDebugValidate=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[],this.gl=null!=e?e:createWebGLContext(),1===ENV.get("WEBGL_VERSION")?(this.textureFloatExtension=getExtensionOrThrow(this.gl,"OES_texture_float"),this.colorBufferFloatExtension=this.gl.getExtension("WEBGL_color_buffer_float"),ENV.get("WEBGL_RENDER_FLOAT32_ENABLED")||(this.textureHalfFloatExtension=getExtensionOrThrow(this.gl,"OES_texture_half_float"),this.colorBufferHalfFloatExtension=this.gl.getExtension("EXT_color_buffer_half_float"))):this.colorBufferFloatExtension=getExtensionOrThrow(this.gl,"EXT_color_buffer_float"),this.loseContextExtension=getExtensionOrThrow(this.gl,"WEBGL_lose_context"),this.vertexBuffer=createVertexBuffer(this.gl),this.indexBuffer=createIndexBuffer(this.gl),this.framebuffer=createFramebuffer(this.gl),this.textureConfig=getTextureConfig(this.gl,this.textureHalfFloatExtension)}return e.prototype.dispose=function(){var e=this;if(!this.disposed){null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");var t=this.gl;callAndCheck(t,function(){return t.finish()}),callAndCheck(t,function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)}),callAndCheck(t,function(){return t.deleteFramebuffer(e.framebuffer)}),callAndCheck(t,function(){return t.bindBuffer(t.ARRAY_BUFFER,null)}),callAndCheck(t,function(){return t.deleteBuffer(e.vertexBuffer)}),callAndCheck(t,function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}),callAndCheck(t,function(){return t.deleteBuffer(e.indexBuffer)}),this.loseContextExtension.loseContext(),this.disposed=!0}},e.prototype.enableAutomaticDebugValidation=function(e){this.autoDebugValidate=e,enableDebugWebGLErrorChecking(e)},e.prototype.createFloat32MatrixTexture=function(e,t){return this.throwIfDisposed(),createFloat32MatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.createFloat16MatrixTexture=function(e,t){return this.throwIfDisposed(),createFloat16MatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.createUnsignedBytesMatrixTexture=function(e,t){return this.throwIfDisposed(),createUnsignedBytesMatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.uploadPixelDataToTexture=function(e,t){this.throwIfDisposed(),uploadPixelDataToTexture(this.gl,e,t)},e.prototype.createPackedMatrixTexture=function(e,t){return this.throwIfDisposed(),createPackedMatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.deleteMatrixTexture=function(e){var t=this;this.throwIfDisposed(),this.outputTexture===e&&(unbindColorTextureFromFramebuffer(this.gl,this.framebuffer),this.outputTexture=null),callAndCheck(this.gl,function(){return t.gl.deleteTexture(e)})},e.prototype.uploadMatrixToTexture=function(e,t,r,n){this.throwIfDisposed();var a=getNumChannels();return uploadMatrixToTexture(this.gl,e,t,r,n,a,this.textureConfig)},e.prototype.uploadMatrixToPackedTexture=function(e,t,r,n){return this.throwIfDisposed(),uploadMatrixToPackedTexture(this.gl,e,t,r,n,this.textureConfig)},e.prototype.downloadFloat32MatrixFromOutputTexture=function(e,t,r){var n=this;return this.downloadMatrixDriver(e,function(){return downloadFloat32MatrixFromOutputTexture(n.gl,t,r,n.textureConfig)})},e.prototype.downloadByteEncodedFloatMatrixFromOutputTexture=function(e,t,r){var n=this;return this.downloadMatrixDriver(e,function(){return downloadByteEncodedFloatMatrixFromOutputTexture(n.gl,t,r,n.textureConfig)})},e.prototype.downloadFloat32MatrixFromBuffer=function(e,t,r){return downloadFloat32MatrixFromBuffer(this.gl,e,t,r,this.textureConfig)},e.prototype.maybeCreateBufferFromTexture=function(e,t,r){this.bindTextureToFrameBuffer(e);var n=maybeCreateBufferFromOutputTexture(this.gl,e,t,r,this.textureConfig);return this.unbindTextureToFrameBuffer(),n},e.prototype.createAndWaitForFence=function(){var e=this.createFence(this.gl);return this.pollFence(e)},e.prototype.createFence=function(e){var t,r,n=this;if(ENV.get("WEBGL_FENCE_API_ENABLED")){var a=e,o=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),r=function(){var e=a.clientWaitSync(o,0,0);return e===a.ALREADY_SIGNALED||e===a.CONDITION_SATISFIED},t=o}else ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),r=function(){return n.isQueryAvailable(t,ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}):r=function(){return!0};return{query:t,isFencePassed:r}},e.prototype.downloadMatrixFromPackedTexture=function(e,t,r){var n=this;return this.downloadMatrixDriver(e,function(){return downloadMatrixFromPackedOutputTexture(n.gl,t,r,n.textureConfig)})},e.prototype.createProgram=function(e){this.throwIfDisposed();var t=this.gl,r=createFragmentShader(t,e),n=createVertexShader$1(t),a=createProgram(t);return callAndCheck(t,function(){return t.attachShader(a,n)}),callAndCheck(t,function(){return t.attachShader(a,r)}),linkProgram(t,a),this.autoDebugValidate&&validateProgram(t,a),this.vertexAttrsAreBound||(this.setProgram(a),this.vertexAttrsAreBound=bindVertexProgramAttributeStreams(t,this.program,this.vertexBuffer)),a},e.prototype.deleteProgram=function(e){var t=this;this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&callAndCheck(this.gl,function(){return t.gl.deleteProgram(e)})},e.prototype.setProgram=function(e){var t=this;this.throwIfDisposed(),this.program=e,null!=this.program&&this.autoDebugValidate&&validateProgram(this.gl,this.program),callAndCheck(this.gl,function(){return t.gl.useProgram(e)})},e.prototype.getUniformLocation=function(e,t,r){return void 0===r&&(r=!0),this.throwIfDisposed(),r?getProgramUniformLocationOrThrow(this.gl,e,t):getProgramUniformLocation(this.gl,e,t)},e.prototype.getAttributeLocation=function(e,t){var r=this;return this.throwIfDisposed(),callAndCheck(this.gl,function(){return r.gl.getAttribLocation(e,t)})},e.prototype.getUniformLocationNoThrow=function(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)},e.prototype.setInputMatrixTexture=function(e,t,r){this.throwIfDisposed(),this.throwIfNoProgram(),bindTextureToProgramUniformSampler(this.gl,this.program,e,t,r)},e.prototype.setOutputMatrixTexture=function(e,t,r){this.setOutputMatrixTextureDriver(e,r,t)},e.prototype.setOutputPackedMatrixTexture=function(e,t,r){this.throwIfDisposed();var n=getPackedMatrixTextureShapeWidthHeight(t,r),a=n[0],o=n[1];this.setOutputMatrixTextureDriver(e,a,o)},e.prototype.setOutputMatrixWriteRegion=function(e,t,r,n){this.setOutputMatrixWriteRegionDriver(r,e,n,t)},e.prototype.setOutputPackedMatrixWriteRegion=function(e,t,r,n){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")},e.prototype.debugValidate=function(){null!=this.program&&validateProgram(this.gl,this.program),validateFramebuffer(this.gl)},e.prototype.executeProgram=function(){this.throwIfDisposed(),this.throwIfNoProgram();var e=this.gl;this.autoDebugValidate&&this.debugValidate(),callAndCheck(e,function(){return e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)})},e.prototype.blockUntilAllProgramsCompleted=function(){var e=this;this.throwIfDisposed(),callAndCheck(this.gl,function(){return e.gl.finish()})},e.prototype.getQueryTimerExtension=function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=getExtensionOrThrow(this.gl,2===ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension},e.prototype.getQueryTimerExtensionWebGL2=function(){return this.getQueryTimerExtension()},e.prototype.getQueryTimerExtensionWebGL1=function(){return this.getQueryTimerExtension()},e.prototype.beginQuery=function(){if(2===ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.gl,t=this.getQueryTimerExtensionWebGL2(),r=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,r),r}var n=this.getQueryTimerExtensionWebGL1(),a=n.createQueryEXT();return n.beginQueryEXT(n.TIME_ELAPSED_EXT,a),a},e.prototype.endQuery=function(){if(2!==ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}else{var t=this.gl,r=this.getQueryTimerExtensionWebGL2();t.endQuery(r.TIME_ELAPSED_EXT)}},e.prototype.waitForQueryAndGetTime=function(e){return __awaiter(this,void 0,void 0,function(){var t=this;return __generator(this,function(r){switch(r.label){case 0:return[4,repeatedTry(function(){return t.isQueryAvailable(e,ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))})];case 1:return r.sent(),[2,this.getQueryTime(e,ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))]}})})},e.prototype.getQueryTime=function(e,t){if(0===t)return null;if(2===t){var r=this.gl;return r.getQueryParameter(e,r.QUERY_RESULT)/1e6}var n=this.getQueryTimerExtensionWebGL1();return n.getQueryObjectEXT(e,n.QUERY_RESULT_EXT)/1e6},e.prototype.isQueryAvailable=function(e,t){if(0===t)return!0;if(2===t){var r=this.gl,n=this.getQueryTimerExtensionWebGL2(),a=r.getQueryParameter(e,r.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),a&&!this.disjoint}return a=(n=this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(e,n.QUERY_RESULT_AVAILABLE_EXT),null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),a&&!this.disjoint},e.prototype.pollFence=function(e){var t=this;return new Promise(function(r){t.addItemToPoll(function(){return e.isFencePassed()},function(){return r()})})},e.prototype.pollItems=function(){for(var e=binSearchLastTrue(this.itemsToPoll.map(function(e){return e.isDoneFn})),t=0;t<=e;++t)(0,this.itemsToPoll[t].resolveFn)();this.itemsToPoll=this.itemsToPoll.slice(e+1)},e.prototype.addItemToPoll=function(e,t){var r=this;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||repeatedTry(function(){return r.pollItems(),0===r.itemsToPoll.length})},e.prototype.bindTextureToFrameBuffer=function(e){this.throwIfDisposed(),bindColorTextureToFramebuffer(this.gl,e,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(this.gl)},e.prototype.unbindTextureToFrameBuffer=function(){null!=this.outputTexture?(bindColorTextureToFramebuffer(this.gl,this.outputTexture,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(this.gl)):unbindColorTextureFromFramebuffer(this.gl,this.framebuffer)},e.prototype.downloadMatrixDriver=function(e,t){this.bindTextureToFrameBuffer(e);var r=t();return this.unbindTextureToFrameBuffer(),r},e.prototype.setOutputMatrixTextureDriver=function(e,t,r){this.throwIfDisposed();var n=this.gl;bindColorTextureToFramebuffer(n,e,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(n),this.outputTexture=e,callAndCheck(n,function(){return n.viewport(0,0,t,r)}),callAndCheck(n,function(){return n.scissor(0,0,t,r)})},e.prototype.setOutputMatrixWriteRegionDriver=function(e,t,r,n){var a=this;this.throwIfDisposed(),callAndCheck(this.gl,function(){return a.gl.scissor(e,t,r,n)})},e.prototype.throwIfDisposed=function(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")},e.prototype.throwIfNoProgram=function(){if(null==this.program)throw new Error("No GPU program is currently set.")},e}();function binSearchLastTrue(e){for(var t=0,r=e.length-1,n=-1;t<=r;){var a=t+r>>1;e[a]()?(n=a,t=a+1):r=a-1}return n}function compileProgram(e,t,r,n){for(var a=t.userCode,o=r.map(function(e,r){var n={logicalShape:e.tensor.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform};return{name:t.variableNames[r],shapeInfo:n}}),i=o.map(function(e){return e.shapeInfo}),s={logicalShape:n.tensor.shape,texShape:n.texData.texShape,isUniform:!1},u=makeShader(o,s,a,!0===t.supportsBroadcasting),l=e.createProgram(u),p={},c=0;c= 0 && idx <= "+s+") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * "+o+";\n setOutput(val);\n }\n "},LRNGradProgram=function(e,t,r,n,a){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=r,this.alpha=n,this.beta=a,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < "+this.depth+"; ++d) {\n int depthBegin = int(max(0.0, float(d - "+t+")));\n int depthEnd = int(min(float("+this.depth+"),\n float(d + "+t+" + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = "+this.depth+";\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float("+n+") * norm + float("+r+");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float("+n+")\n * float("+a+")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * "+a+");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n "},MaxPool2DBackpropProgram=function(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;var t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,a=e.strideWidth,o=t-1-e.padInfo.top,i=r-1-e.padInfo.left,s=t*r-1;this.userCode="\n const ivec2 pads = ivec2("+o+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+n+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+r+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+a+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = "+s+" - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * "+r+" + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n "},MatMulProgram=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1),this.variableNames=["matrixA","matrixB"];var a=r?e[1]:e[0],o=n?t[0]:t[1],i=r?e[0]:e[1];this.outputShape=[a,o];var s=function(e,t){return r?t+" + "+e+", aRow":"aRow, "+t+" + "+e},u=function(e,t){return n?"bCol, "+t+" + "+e:t+" + "+e+", bCol"},l=4*Math.floor(i/4),p=i%4;this.userCode=" float dotARowBCol(int aRow, int bCol) {\n float result = 0.0;\n for (int i = 0; i < "+l+"; i += 4) {\n vec4 a = vec4(\n getMatrixA("+s(0,"i")+"),\n getMatrixA("+s(1,"i")+"),\n getMatrixA("+s(2,"i")+"),\n getMatrixA("+s(3,"i")+")\n );\n vec4 b = vec4(\n getMatrixB("+u(0,"i")+"),\n getMatrixB("+u(1,"i")+"),\n getMatrixB("+u(2,"i")+"),\n getMatrixB("+u(3,"i")+")\n );\n\n result += dot(a, b);\n }\n\n if ("+(1===p)+") {\n result += getMatrixA("+s(0,l)+") *\n getMatrixB("+u(0,l)+");\n } else if ("+(2===p)+") {\n vec2 a = vec2(\n getMatrixA("+s(0,l)+"),\n getMatrixA("+s(1,l)+")\n );\n vec2 b = vec2(\n getMatrixB("+u(0,l)+"),\n getMatrixB("+u(1,l)+")\n );\n result += dot(a, b);\n } else if ("+(3===p)+") {\n vec3 a = vec3(\n getMatrixA("+s(0,l)+"),\n getMatrixA("+s(1,l)+"),\n getMatrixA("+s(2,l)+")\n );\n vec3 b = vec3(\n getMatrixB("+u(0,l)+"),\n getMatrixB("+u(1,l)+"),\n getMatrixB("+u(2,l)+")\n );\n result += dot(a, b);\n }\n\n return result;\n }\n\n void main() {\n ivec2 resRC = getOutputCoords();\n setOutput(dotARowBCol(resRC.x, resRC.y));\n }\n "},MultinomialProgram=function(){function e(e,t,r){this.variableNames=["probs"],this.outputShape=[e,r],this.userCode="\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < "+(t-1)+"; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float("+(t-1)+"));\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;return function(r,n){null==t.seedLoc&&(t.seedLoc=r.getUniformLocation(n,"seed")),r.gl.uniform1f(t.seedLoc,e)}},e}(),OneHotProgram=function(e,t,r,n){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float("+n+"), float("+r+"),\n float(index == coords.y)));\n }\n "},PadProgram=function(e,t,r){this.variableNames=["x"],this.outputShape=t.map(function(t,r){return t[0]+e[r]+t[1]});var n=e.length,a=getCoordsDataType(n),o=t.map(function(e){return e[0]}).join(","),i=t.map(function(t,r){return t[0]+e[r]}).join(","),s=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n);this.userCode=1!==n?"\n "+a+" start = "+a+"("+o+");\n "+a+" end = "+a+"("+i+");\n\n void main() {\n "+a+" outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float("+r+"));\n } else {\n "+a+" coords = outC - start;\n setOutput(getX("+s+"));\n }\n }\n ":"\n int start = "+o+";\n int end = "+i+";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float("+r+"));\n } else {\n setOutput(getX(outC - start));\n }\n }\n "},Pool2DProgram=function(e,t,r){if(this.variableNames=["x"],"avg"===t&&r)throw new Error("Cannot compute positions for average pool.");var n=e.filterHeight,a=e.filterWidth,o=e.strideHeight,i=e.strideWidth,s=e.padInfo.top,u=e.padInfo.left;this.outputShape=e.outShape;var l="avg"===t,p="0.0";if(l||(p="-1.0 / 0.0"),r)this.userCode="\n const ivec2 strides = ivec2("+o+", "+i+");\n const ivec2 pads = ivec2("+s+", "+u+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < "+n+"; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+a+"; wC++) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value >= currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * "+a+" + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ";else{var c=t+"("+t+"("+t+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===t&&(c="avgValue / count");var d=4*Math.floor(a/4),h=a%4,f="\n if ("+l+") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n ";this.userCode="\n const ivec2 strides = ivec2("+o+", "+i+");\n const ivec2 pads = ivec2("+s+", "+u+");\n const float initializationValue = "+p+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= "+e.inWidth+") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4("+p+");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < "+n+"; wR++) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+d+"; wC += 4) {\n int xC = xCCorner + wC;\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n getValue(batch, xR, xC + 3, d)\n );\n\n "+f+"\n }\n\n int xC = xCCorner + "+d+";\n if ("+(1===h)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+f+"\n } else if ("+(2===h)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n initializationValue,\n initializationValue\n );\n\n "+f+"\n } else if ("+(3===h)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + 1, d),\n getValue(batch, xR, xC + 2, d),\n initializationValue\n );\n\n "+f+"\n }\n }\n setOutput("+c+");\n }\n "}},ReduceProgram=function(e,t){this.variableNames=["x"];var r=e.windowSize,n=e.batchSize,a=e.inSize,o=Math.ceil(a/r);this.outputShape=[n,o];var i="0.0",s="";"min"===t?(i="1.0 / 0.0",s="min"):"max"===t&&(i="-1.0 / 0.0",s="max");var u=t+"("+t+"("+t+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum"===t?u="sumValue":"all"===t?u="allValue":"any"===t&&(u="anyValue");var l=4*Math.floor(r/4),p=r%4,c="\n if ("+("sum"===t)+") {\n sumValue += dot(values, ones);\n } else {\n minMaxValue = "+s+"(values, minMaxValue);\n }\n ",d="vec4";"all"===t?(i="1.0",c="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",d="bvec4"):"any"===t&&(i="0.0",c="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",d="bvec4");var h="";a%r>0&&(h="\n if (inIdx < 0 || inIdx >= "+a+") {\n return initializationValue;\n }\n "),this.userCode="\n const float initializationValue = "+i+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n "+h+"\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+r+";\n\n vec4 minMaxValue = vec4("+i+");\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < "+l+"; i += 4) {\n int inIdx = inOffset + i;\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n "+c+"\n }\n\n int inIdx = inOffset + "+l+";\n if ("+(1===p)+") {\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+c+"\n } else if ("+(2===p)+") {\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n "+c+"\n } else if ("+(3===p)+") {\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n "+c+"\n }\n setOutput("+u+");\n }\n "},ResizeBilinearBackpropProgram=function(e,t,r){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t.shape;var n=t.shape,a=n[1],o=n[2],i=e.shape,s=i[1],u=i[2],l=[r&&s>1?a-1:a,r&&u>1?o-1:o],p=[r&&s>1?s-1:s,r&&u>1?u-1:u],c=l[0]/p[0],d=l[1]/p[1],h=1/c,f=1/d,m=2*Math.ceil(h)+2,g=2*Math.ceil(f)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+c+");\n const float widthScale = float("+d+");\n\n const float invHeightScale = float("+h+");\n const float invWidthScale = float("+f+");\n\n const int winHeight = int("+m+");\n const int winWidth = int("+g+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+s+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+u+") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), "+(a-1)+".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), "+(o-1)+".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "},ResizeBilinearProgram=function(e,t,r,n){this.variableNames=["A"],this.outputShape=[];var a=e[0],o=e[1],i=e[2],s=e[3];this.outputShape=[a,t,r,s];var u=[n&&t>1?o-1:o,n&&r>1?i-1:i],l=[n&&t>1?t-1:t,n&&r>1?r-1:r];this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+u[0]/l[0]+",\n "+u[1]/l[1]+");\n const vec2 inputShapeRC = vec2("+o+".0, "+i+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n "},ResizeNearestNeigborBackpropProgram=function(e,t,r){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t.shape;var n=t.shape,a=n[1],o=n[2],i=e.shape,s=i[1],u=i[2],l=[r&&s>1?a-1:a,r&&u>1?o-1:o],p=[r&&s>1?s-1:s,r&&u>1?u-1:u],c=l[0]/p[0],d=l[1]/p[1],h=1/c,f=1/d,m=2*Math.ceil(h)+2,g=2*Math.ceil(f)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+c+");\n const float widthScale = float("+d+");\n\n const float invHeightScale = float("+h+");\n const float invWidthScale = float("+f+");\n\n const int winHeight = int("+m+");\n const int winWidth = int("+g+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+s+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+u+") {\n continue;\n }\n\n float sourceFracRow =\n float("+l[0]+") *\n (float(dyR) / float("+p[0]+"));\n\n float sourceFracCol =\n float("+l[1]+") *\n (float(dyC) / float("+p[1]+"));\n\n int sourceNearestRow = int(min(\n float(int("+a+") - 1),\n "+r+" ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int("+o+") - 1),\n "+r+" ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "},ResizeNearestNeighborProgram=function(e,t,r,n){this.variableNames=["A"],this.outputShape=[];var a=e[0],o=e[1],i=e[2],s=e[3];this.outputShape=[a,t,r,s];var u=[n&&t>1?o-1:o,n&&r>1?i-1:i],l=[n&&t>1?t-1:t,n&&r>1?r-1:r],p=n?"0.5":"0.0";this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+u[0]/l[0]+",\n "+u[1]/l[1]+");\n const vec2 inputShapeRC = vec2("+o+".0, "+i+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + "+p+")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n "},ReverseProgram=function(e,t){this.variableNames=["x"];var r=e.length;if(r>4)throw new Error("WebGL backend: Reverse of rank-"+r+" tensor is not yet supported");if(this.outputShape=e,1!==r){var n=e.map(function(r,n){return function(r){return-1!==t.indexOf(r)&&1!==e[r]?e[r]+" - coords["+r+"] - 1":"coords["+r+"]"}(n)}).join(","),a=getCoordsDataType(r);this.userCode="\n void main() {\n "+a+" coords = getOutputCoords();\n setOutput(getX("+n+"));\n }\n "}else this.userCode="\n void main() {\n int coord = getOutputCoords();\n setOutput(getX("+e[0]+" - coord - 1));\n }\n "},SegmentOpProgram=function(e,t){this.variableNames=["x","segmentIds"];var r=e.windowSize,n=e.batchSize,a=e.inSize,o=e.numSegments,i=o*Math.ceil(a/r);this.outputShape=[n,i];var s=4*Math.floor(r/4),u=r%4,l="\n sumValue += dot(values, filter);\n ",p="";a%r>0&&(p="\n if (inIdx < 0 || inIdx >= "+a+") {\n return initializationValue;\n }\n ");var c="";a%r>0&&(c="\n if (inIdx < 0 || inIdx >= "+a+") {\n return -1.0;\n }\n "),this.userCode="\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n "+p+"\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n "+c+"\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n "+o+")) * float("+r+"));\n int currentSeg = int(mod(float(outIdx), float("+o+")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < "+s+"; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n "+l+"\n }\n\n int inIdx = inOffset + "+s+";\n if ("+(1===u)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n "+l+"\n } else if ("+(2===u)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n "+l+"\n } else if ("+(3===u)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 filter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n "+l+"\n }\n setOutput(sumValue);\n }\n "},SelectProgram=function(e,t,r){var n,a;if(this.variableNames=["c","a","b"],this.outputShape=t,r>4)throw Error("Where for rank "+r+" is not yet supported");if(1===r)a="resRC",n="resRC";else{for(var o=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],s=[],u=0;u= 1.0) {\n setOutput(getA("+a+"));\n } else {\n setOutput(getB("+a+"));\n }\n }\n "},SliceProgram=function(){function e(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;var t=getCoordsDataType(this.rank),r=getCoords$1(this.rank);this.userCode="\n uniform "+t+" start;\n\n void main() {\n "+t+" sourceLoc = start + getOutputCoords();\n setOutput(getSource("+r+"));\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+e.length+")");return function(r,n){if(null!=t.startLoc||(t.startLoc=r.getUniformLocationNoThrow(n,"start"),null!=t.startLoc))if(1===t.rank)r.gl.uniform1i(t.startLoc,e[0]);else if(2===t.rank)r.gl.uniform2i(t.startLoc,e[0],e[1]);else if(3===t.rank)r.gl.uniform3i(t.startLoc,e[0],e[1],e[2]);else{if(4!==t.rank)throw Error("Slicing for rank "+t.rank+" is not yet supported");r.gl.uniform4i(t.startLoc,e[0],e[1],e[2],e[3])}}},e}();function getCoords$1(e){if(1===e)return"sourceLoc";if(2===e)return"sourceLoc.x, sourceLoc.y";if(3===e)return"sourceLoc.x, sourceLoc.y, sourceLoc.z";if(4===e)return"sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w";throw Error("Slicing for rank "+e+" is not yet supported")}var StridedSliceProgram=function(e,t,r){this.variableNames=["x"],this.outputShape=r,this.rank=r.length;var n,a=getCoordsDataType(this.rank);n=1===this.rank?"coords * strides + begin":r.map(function(e,t){return"coords["+t+"] * strides["+t+"] + begin["+t+"]"}).join(","),this.userCode="\n "+a+" begin = "+a+"("+e+");\n "+a+" strides = "+a+"("+t+");\n\n void main() {\n "+a+" coords = getOutputCoords();\n setOutput(getX("+n+"));\n }\n "},TextureManager=function(){function e(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return e.prototype.acquireTexture=function(e,t){var r,n=getPhysicalFromLogicalTextureType(t),a=getKeyFromTextureShape(e,n);if(a in this.freeTextures||(this.freeTextures[a]=[]),a in this.usedTextures||(this.usedTextures[a]=[]),this.freeTextures[a].length>0){this.numFreeTextures--,this.numUsedTextures++,this.log();var o=this.freeTextures[a].shift();return this.usedTextures[a].push(o),o}return this.numUsedTextures++,this.log(),n===PhysicalTextureType.FLOAT32?r=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):n===PhysicalTextureType.FLOAT16?r=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):n===PhysicalTextureType.UNSIGNED_BYTE&&(r=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[a].push(r),r},e.prototype.releaseTexture=function(e,t,r){var n=getKeyFromTextureShape(t,getPhysicalFromLogicalTextureType(r));n in this.freeTextures||(this.freeTextures[n]=[]),this.freeTextures[n].push(e),this.numFreeTextures++,this.numUsedTextures--;var a=this.usedTextures[n],o=a.indexOf(e);if(o<0)throw new Error("Cannot release a texture that was never provided by this texture manager");a.splice(o,1),this.log()},e.prototype.log=function(){if(this.logEnabled){var e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",this.numFreeTextures+" / "+this.numUsedTextures,"("+e+")")}},e.prototype.getNumUsedTextures=function(){return this.numUsedTextures},e.prototype.getNumFreeTextures=function(){return this.numFreeTextures},e.prototype.dispose=function(){var e=this;if(null!=this.freeTextures){for(var t in this.freeTextures)this.freeTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});for(var t in this.usedTextures)this.usedTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0}},e}();function getPhysicalFromLogicalTextureType(e){if(e===TextureUsage.DOWNLOAD||e===TextureUsage.PIXELS)return PhysicalTextureType.UNSIGNED_BYTE;if(e===TextureUsage.UPLOAD)return PhysicalTextureType.FLOAT32;if(e===TextureUsage.RENDER)return ENV.get("WEBGL_RENDER_FLOAT32_ENABLED")?PhysicalTextureType.FLOAT32:PhysicalTextureType.FLOAT16;throw new Error("Unknown logical texture type "+e)}function getKeyFromTextureShape(e,t){return e[0]+"_"+e[1]+"_"+t}var TileProgram=function(e,t){this.variableNames=["A"];for(var r=new Array(e.length),n=0;n5)throw Error("Tile for rank "+t+" is not yet supported");if(1===t)return"imod(resRC, "+e[0]+")";for(var r=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],n=[],a=0;a6)throw Error("Transpose for rank "+t+" is not yet supported");for(var r=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],n=new Array(t),a=0;a= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n";function STEP(e){return void 0===e&&(e=0),CHECK_NAN_SNIPPET$1+"\n return x > 0.0 ? 1.0 : float("+e+");\n "}var NEG="return -x;",CEIL="return ceil(x);",FLOOR="return floor(x);",SIGN="\n if (isNaN(x)) { return 0.0; }\n return sign(x);\n",ROUND="\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n",EXP="return exp(x);",EXPM1="return exp(x) - 1.0;",LOG="if (x < 0.0) return NAN;\n return log(x);",LOG1P="return log(1.0 + x);",SQRT="return sqrt(x);",RSQRT="return inversesqrt(x);",SIGMOID="return 1.0 / (1.0 + exp(-1.0 * x));",SOFTPLUS="\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n",SIN=CHECK_NAN_SNIPPET$1+"\n return sin(x);\n",COS=CHECK_NAN_SNIPPET$1+"\n return cos(x);\n",TAN="return tan(x);",ASIN="return asin(x);",ACOS="return acos(x);",ATAN=CHECK_NAN_SNIPPET$1+"\n return atan(x);\n",SINH="\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n",COSH="\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n",TANH="\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n",ASINH="return log(x + sqrt(x * x + 1.0));",ACOSH=CHECK_NAN_SNIPPET$1+"\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));",ATANH=CHECK_NAN_SNIPPET$1+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;",ERF='\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = '+ERF_P+";\n float a1 = "+ERF_A1+";\n float a2 = "+ERF_A2+";\n float a3 = "+ERF_A3+";\n float a4 = "+ERF_A4+";\n float a5 = "+ERF_A5+";\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n",SQUARE="return x * x;",RECIPROCAL="return 1.0 / x;",LOGICAL_NOT="return float(!(x >= 1.0));",TO_INT="return float(int(x));";function concat1d_(e){return concat(e,0)}function concat2d_(e,t){return concat(e,t)}function concat3d_(e,t){return concat(e,t)}function concat4d_(e,t){return concat(e,t)}function concat_(e,t){void 0===t&&(t=0),assert(e.length>=1,"Pass at least one tensor to concat");var r=convertToTensorArray(e,"tensors","concat"),n=r[0];if(1===r.length)return n;for(var a=parseAxisParam(t,n.shape),o=1;o>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}(e),a=t&&t.state,o=r.next;return o.int32=function(){return 4294967296*r.next()|0},o.double=function(){return o()+1.1102230246251565e-16*(2097152*o()|0)},o.quick=o,a&&("object"==typeof a&&n(a,r),o.state=function(){return n(r,{})}),o}t&&t.exports?t.exports=a:this.alea=a}(0,e)}),xor128=createCommonjsModule(function(e){!function(e,t,r){function n(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function a(e,t){var r=new function(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,a&&("object"==typeof a&&n(a,r),o.state=function(){return n(r,{})}),o}t&&t.exports?t.exports=a:this.xor128=a}(0,e)}),xorwow=createCommonjsModule(function(e){!function(e,t,r){function n(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function a(e,t){var r=new function(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n>>4),t.next()}(e),a=t&&t.state,o=function(){return(r.next()>>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,a&&("object"==typeof a&&n(a,r),o.state=function(){return n(r,{})}),o}t&&t.exports?t.exports=a:this.xorwow=a}(0,e)}),xorshift7=createCommonjsModule(function(e){!function(e,t,r){function n(e,t){return t.x=e.x.slice(),t.i=e.i,t}function a(e,t){null==e&&(e=+new Date);var r=new function(e){var t=this;t.next=function(){var e,r,n=t.x,a=t.i;return e=n[a],r=(e^=e>>>7)^e<<24,r^=(e=n[a+1&7])^e>>>10,r^=(e=n[a+3&7])^e>>>3,r^=(e=n[a+4&7])^e<<7,e=n[a+7&7],r^=(e^=e<<13)^e<<9,n[a]=r,t.i=a+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r0;--r)e.next()}(t,e)}(e),a=t&&t.state,o=function(){return(r.next()>>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,a&&(a.x&&n(a,r),o.state=function(){return n(r,{})}),o}t&&t.exports?t.exports=a:this.xorshift7=a}(0,e)}),xor4096=createCommonjsModule(function(e){!function(e,t,r){function n(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function a(e,t){null==e&&(e=+new Date);var r=new function(e){var t=this;t.next=function(){var e,r,n=t.w,a=t.X,o=t.i;return t.w=n=n+1640531527|0,r=a[o+34&127],e=a[o=o+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=a[o]=r^e,t.i=o,r+(n^n>>>16)|0},function(e,t){var r,n,a,o,i,s=[],u=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,u=Math.max(u,t.length)),a=0,o=-32;o>>15,n^=n<<4,n^=n>>>13,o>=0&&(i=i+1640531527|0,a=0==(r=s[127&o]^=n+i)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,o=512;o>0;--o)n=s[a+34&127],r=s[a=a+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[a]=n^r;e.w=i,e.X=s,e.i=a}(t,e)}(e),a=t&&t.state,o=function(){return(r.next()>>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,a&&(a.X&&n(a,r),o.state=function(){return n(r,{})}),o}t&&t.exports?t.exports=a:this.xor4096=a}(0,e)}),tychei=createCommonjsModule(function(e){!function(e,t,r){function n(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function a(e,t){var r=new function(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,a=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,a&&("object"==typeof a&&n(a,r),o.state=function(){return n(r,{})}),o}t&&t.exports?t.exports=a:this.tychei=a}(0,e)}),seedrandom=createCommonjsModule(function(e){!function(t,r){var n,a=this,o=256,i=6,s="random",u=r.pow(o,i),l=r.pow(2,52),p=2*l,c=o-1;function d(e,d,g){var y=[],v=f(function e(t,r){var n,a=[],o=typeof t;if(r&&"object"==o)for(n in t)try{a.push(e(t[n],r-1))}catch(e){}return a.length?a:"string"==o?t:t+"\0"}((d=1==d?{entropy:!0}:d||{}).entropy?[e,m(t)]:null==e?function(){try{var e;return n&&(e=n.randomBytes)?e=e(o):(e=new Uint8Array(o),(a.crypto||a.msCrypto).getRandomValues(e)),m(e)}catch(e){var r=a.navigator,i=r&&r.plugins;return[+new Date,a,i,a.screen,m(t)]}}():e,3),y),b=new function(e){var t,r=e.length,n=this,a=0,i=n.i=n.j=0,s=n.S=[];for(r||(e=[r++]);a=p;)e/=2,t/=2,r>>>=1;return(e+r)/t};return x.int32=function(){return 0|b.g(4)},x.quick=function(){return b.g(4)/4294967296},x.double=x,f(m(b.S),t),(d.pass||g||function(e,t,n,a){return a&&(a.S&&h(a,b),e.state=function(){return h(b,{})}),n?(r[s]=e,t):e})(x,v,"global"in d?d.global:this==r,d.state)}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function f(e,t){for(var r,n=e+"",a=0;a=1||0===i);var s=Math.sqrt(-2*Math.log(i)/i);t=this.mean+this.stdDev*a*s,r=this.mean+this.stdDev*o*s,this.truncated&&!this.isValidTruncated(t)||(n=!0)}return this.truncated&&!this.isValidTruncated(r)||(this.nextVal=this.convertValue(r)),this.convertValue(t)},e.prototype.convertValue=function(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)},e.prototype.isValidTruncated=function(e){return e<=this.upper&&e>=this.lower},e}();function clone_(e){var t=convertToTensor(e,"x","clone");return ENV.engine.runKernel(function(e){return Tensor.make(t.shape,{dataId:t.dataId},t.dtype)},{$x:t},function(e){return{$x:function(){return e.toFloat()}}})}function eye_(e,t,r,n){void 0===n&&(n="float32"),null==t&&(t=e);for(var a=buffer([e,t],n),o=e<=t?e:t,i=0;i2)throw new Error("Rank of probabilities must be 1 or 2, but is "+i);r=r||Math.random();var s=1===i?a.as2D(1,-1):a,u=ENV.engine.runKernel(function(e){return e.multinomial(s,n,t,r)},{logits2D:s});return 1===i?u.as1D():u}function oneHot_(e,t,r,n){void 0===r&&(r=1),void 0===n&&(n=0);var a=convertToTensor(e,"indices","oneHot","int32");if(assert("int32"===a.dtype,"Indices must be of dtype `int32`"),t<2)throw new Error("Error in oneHot: depth must be >=2, but it is "+t);return ENV.engine.runKernel(function(e){return e.oneHot(a,t,r,n)},{$indices:a})}function fromPixels_(e,t){if(void 0===t&&(t=3),t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");return ENV.engine.fromPixels(e,t)}function toPixels(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,a,o,i,s,u,l,p,c,d,h,f,m,g,y,v,b,x,w;return __generator(this,function(S){switch(S.label){case 0:if(2!==(r=convertToTensor(e,"img","toPixels","int32")).rank&&3!==r.rank)throw new Error("toPixels only supports rank 2 or 3 tensors, got rank "+r.rank+".");if(n=r.shape.slice(0,2),a=n[0],o=n[1],(i=2===r.rank?1:r.shape[2])>4||2===i)throw new Error("toPixels only supports depth of size 1, 3 or 4 but got "+i);return s=r.min(),u=r.max(),[4,s.data()];case 1:return l=S.sent()[0],[4,u.data()];case 2:if(p=S.sent()[0],s.dispose(),u.dispose(),"float32"===r.dtype){if(l<0||p>1)throw new Error("Tensor values for a float32 Tensor must be in the range [0 - 1] but got range ["+l+" - "+p+"].")}else{if("int32"!==r.dtype)throw new Error("Unsupported type for toPixels: "+r.dtype+". Please use float32 or int32 tensors.");if(l<0||p>255)throw new Error("Tensor values for a int32 Tensor must be in the range [0 - 255] but got range ["+l+" - "+p+"].")}return[4,r.data()];case 3:for(c=S.sent(),d="float32"===r.dtype?255:1,h=new Uint8ClampedArray(o*a*4),f=0;f=1,"Pass at least one tensor to tf.stack"),1===r.length)return r[0].expandDims(t);var n=r[0].rank,a=r[0].shape,o=r[0].dtype;assert(t<=n,"Axis must be <= rank of the tensor"),r.forEach(function(e){assertShapesMatch(a,e.shape,"All tensors passed to stack must have matching shapes")}),r.forEach(function(e){assert(o===e.dtype,"All tensors passed to stack must have matching dtypes")});var i=r.map(function(e){return e.expandDims(t)});return concat(i,t)}function batchToSpaceND_(e,t,r){var n=convertToTensor(e,"x","batchToSpaceND"),a=t.reduce(function(e,t){return e*t});return assert(n.rank>=1+t.length,"input rank should be > than [blockShape] but got "+n.rank),assert(r.length===t.length,"crops.shape[0] must be equal to [blockShape] but got "+r.length),assert(n.shape[0]%a==0,"input tensor batch must be divisible by prod( blockShape )"),ENV.engine.runKernel(function(e){return e.batchToSpaceND(n,t,r)},{})}function spaceToBatchND_(e,t,r){var n=convertToTensor(e,"x","spaceToBatchND");return assert(n.rank>=1+t.length,"input rank should be > than [blockShape] but got "+n.rank),assert(r.length===t.length,"paddings.shape[0] must be equal to [blockShape], got "+r.length),assert(n.shape.reduce(function(e,r,n){return n>0&&n<=t.length?e&&r%t[n-1]==0:e},!0),"input spatial dimensions must be divisible by blockShapes"),ENV.engine.runKernel(function(e){return e.spaceToBatchND(n,t,r)},{})}function unstack_(e,t){void 0===t&&(t=0);for(var r,n=convertToTensor(e,"x","unstack"),a=n.shape[t],o=Array(n.rank-1).fill(0),i=0,s=0;s0?this.gpgpu.beginQuery():{startMs:performance.now(),endMs:null}},e.prototype.endTimer=function(e){return ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(this.gpgpu.endQuery(),e):(e.endMs=performance.now(),e)},e.prototype.getQueryTime=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(r){return ENV.get("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?[2,this.gpgpu.waitForQueryAndGetTime(e)]:[2,(t=e).endMs-t.startMs]})})},e.prototype.disposeData=function(e){if(!this.pendingDisposal.has(e))if(this.pendingRead.has(e))this.pendingDisposal.add(e);else if(this.texData.has(e)){var t=this.texData.get(e),r=t.texture,n=t.texShape,a=t.usage;null!=r&&this.releaseTexture(e,r,n,a),this.texData.delete(e)}},e.prototype.getTexture=function(e){return this.uploadToGPU(e),this.texData.get(e).texture},e.prototype.getGPGPUContext=function(){return this.gpgpu},e.prototype.getCanvas=function(){return this.canvas},e.prototype.slice=function(e,t,r){var n=new SliceProgram(r),a=n.getCustomSetupFunc(t);return this.compileAndRun(n,[e],null,a)},e.prototype.stridedSlice=function(e,t,r,n,a,o){var i=getStridedSlicedInfo(e.shape,t,r,n,a,o),s=i[0],u=i[1];if(u.some(function(e){return 0===e}))return tensor([],u);var l=new StridedSliceProgram(s,n,u);return this.compileAndRun(l,[e])},e.prototype.reverse=function(e,t){var r=new ReverseProgram(e.shape,t);return this.compileAndRun(r,[e])},e.prototype.concat=function(e,t){var r=new ConcatProgram(e.shape,t.shape);return this.compileAndRun(r,[e,t])},e.prototype.neg=function(e){var t=new UnaryOpProgram(e.shape,NEG);return this.compileAndRun(t,[e])},e.prototype.matMul=function(e,t,r,n){var a=new MatMulProgram(e.shape,t.shape,r,n);return this.compileAndRun(a,[e,t])},e.prototype.multiply=function(e,t){var r=new BinaryOpProgram(MUL,e.shape,t.shape),n=this.makeOutputArray(r.outputShape,upcastType(e.dtype,t.dtype));return this.compileAndRun(r,[e,t],n)},e.prototype.batchNormalization=function(e,t,r,n,a,o){var i=[e,t,r],s=null;null!=o&&(s=o.shape,i.push(o));var u=null;null!=a&&(u=a.shape,i.push(a));var l=new BatchNormProgram(e.shape,t.shape,r.shape,s,u,n);return this.compileAndRun(l,i)},e.prototype.localResponseNormalization4D=function(e,t,r,n,a){var o=new LRNProgram(e.shape,t,r,n,a);return this.compileAndRun(o,[e])},e.prototype.LRNGrad=function(e,t,r,n,a,o,i){var s=new LRNGradProgram(t.shape,n,a,o,i);return this.compileAndRun(s,[t,r,e])},e.prototype.tile=function(e,t){var r=new TileProgram(e.shape,t);return this.compileAndRun(r,[e])},e.prototype.pad=function(e,t,r){var n=new PadProgram(e.shape,t,r);return this.compileAndRun(n,[e])},e.prototype.transpose=function(e,t){var r=new TransposeProgram(e.shape,t);return this.compileAndRun(r,[e])},e.prototype.gather=function(e,t,r){var n=new GatherProgram(e.shape,t.size,r);return this.compileAndRun(n,[e,t])},e.prototype.batchToSpaceND=function(e,t,r){assert(e.rank<=4,"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");var n=t.reduce(function(e,t){return e*t}),a=getReshaped(e.shape,t,n),o=getPermuted(a.length,t.length),i=getReshapedPermuted(e.shape,t,n),s=getSliceBeginCoords(r,t.length),u=getSliceSize(i,r,t.length);return e.reshape(a).transpose(o).reshape(i).slice(s,u)},e.prototype.spaceToBatchND=function(e,t,r){assert(e.rank<=4,"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");var n=t.reduce(function(e,t){return e*t}),a=[[0,0]];a.push.apply(a,r);for(var o=1+t.length;othis.NUM_BYTES_BEFORE_PAGING)for(var d=this.numBytesInGPU-this.NUM_BYTES_BEFORE_PAGING;d>0&&this.lruDataGPU.length>0;){var h=this.lruDataGPU.shift(),f=this.texData.get(h),m=f.shape,g=f.dtype;d-=this.computeBytes(m,g),this.read(h)}return c&&(s=this.endTimer(s),this.activeTimers.push(this.getQueryTime(s))),r},e.prototype.getAndSaveBinary=function(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]},e.prototype.getTextureManager=function(){return this.textureManager},e.prototype.dispose=function(){if(!this.disposed){for(var e in this.binaryCache)this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram);this.textureManager.dispose(),this.canvas.remove(),null!=this.fromPixelsCanvas&&this.fromPixelsCanvas.remove(),this.gpgpuCreatedLocally&&this.gpgpu.dispose(),this.disposed=!0}},e.prototype.throwIfNoData=function(e){if(!this.texData.has(e))throw new Error("WebGL backend: No data found for this tensor. Did you change your backend in the middle of the program? New backends can't use Tensors created with previous backends")},e.prototype.uploadToGPU=function(e){this.throwIfNoData(e);var t=this.texData.get(e),r=t.shape,n=t.values,a=t.texture,o=t.dtype,i=t.usage;if(null==a){var s,u=null!=this.activeTimers;u&&(s=performance.now());var l=getTextureShapeFromLogicalShape(this.gpgpu.gl,r);t.texShape=l;var p=this.acquireTexture(e,l,i);t.texture=p,null!=n&&(this.gpgpu.uploadMatrixToTexture(p,l[0],l[1],typedArrayToFloat32(n,o)),t.values=null,u&&(this.uploadWaitMs+=performance.now()-s))}else this.lruDataGPU.indexOf(e)>=0&&(this.lruDataGPU.splice(this.lruDataGPU.indexOf(e),1),this.lruDataGPU.push(e))},e.prototype.cacheOnCPU=function(e,t){var r=this.delayedStorage,n=this.texData.get(e),a=n.texture,o=n.texShape,i=n.dtype,s=n.usage;r&&null!=a&&(this.releaseTexture(e,a,o,s),n.texture=null,n.texShape=null),null!=t&&(n.values=float32ToTypedArray(t,i))},e.prototype.releaseTexture=function(e,t,r,n){var a=this.texData.get(e),o=a.shape,i=a.dtype,s=this.lruDataGPU.indexOf(e);s>=0&&this.lruDataGPU.splice(s,1),this.numBytesInGPU-=this.computeBytes(o,i),this.textureManager.releaseTexture(t,r,n)},e.prototype.acquireTexture=function(e,t,r){var n=this.texData.get(e),a=n.shape,o=n.dtype;return this.lruDataGPU.push(e),this.numBytesInGPU+=this.computeBytes(a,o),this.textureManager.acquireTexture(t,r)},e.prototype.computeBytes=function(e,t){return sizeFromShape(e)*bytesPerElement(t)},e}();function float32ToTypedArray(e,t){if("float32"===t)return e;if("int32"===t||"bool"===t){for(var r="int32"===t?new Int32Array(e.length):new Uint8Array(e.length),n=0;n=0?e:(assert(-1===e,"Bad value in size"),o.shape[t]-n[t])}),assertParamsValid(o,n,a);var i=o.shape;return ENV.engine.runKernel(function(e){return e.slice(o,n,a)},{$x:o},function(e){for(var t=[],r=0;r0&&(t=t.sum(n)),t.reshape(r.shape)},$b:function(){var t=e,r=getReductionAxes(n.shape,a);return r.length>0&&(t=t.sum(r)),t.reshape(n.shape)}}})}function addN_(e){assert(Array.isArray(e),function(){return"The param passed to tf.addN() must be a list of tensors"}),assert(e.length>=1,function(){return"Must pass at least one tensor to tf.addN(), but got "+e.length});var t=e.map(function(e,t){return convertToTensor(e,"tensors"+t,"addN")}),r=t[0];t.forEach(function(e){if(e.dtype!==r.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(function(e){if(!arraysEqual(e.shape,r.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});var n=t;return ENV.engine.runKernel(function(e){return e.addN(t)},n,function(e){var r={};return t.forEach(function(t,n){r[n]=function(){return e.clone()}}),r})}function addStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in addStrict: "),e.add(t)}function sub_(e,t){var r=convertToTensor(e,"a","sub"),n=convertToTensor(t,"b","sub");assertTypesMatch(r,n);var a=assertAndGetBroadcastShape(r.shape,n.shape);return ENV.engine.runKernel(function(e){return e.subtract(r,n)},{$a:r,$b:n},function(e){return{$a:function(){var t=e,n=getReductionAxes(r.shape,a);return n.length>0&&(t=t.sum(n)),t.reshape(r.shape)},$b:function(){var t=e,r=getReductionAxes(n.shape,a);return r.length>0&&(t=t.sum(r)),t.neg().reshape(n.shape)}}})}function subStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in subStrict: "),e.sub(t)}function pow_(e,t){var r=convertToTensor(e,"base","pow"),n=convertToTensor(t,"exp","pow"),a=assertAndGetBroadcastShape(r.shape,n.shape);return e=r.cast(upcastType(r.dtype,n.dtype)),t=n.cast(upcastType(r.dtype,n.dtype)),ENV.engine.runKernel(function(e,t){return t(e.pow(r,n))},{$base:r,$exp:n},function(e,t){var o=t[0];return{$base:function(){var t=e.mul(n.toFloat().mul(o.div(r))),i=getReductionAxes(r.shape,a);return i.length>0&&(t=t.sum(i)),t.reshape(r.shape)},$exp:function(){var t=e.mul(o.mul(r.log()).toFloat()),i=getReductionAxes(n.shape,a);return i.length>0&&(t=t.sum(i)),t.reshape(n.shape)}}})}function powStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in powStrict: "),e.pow(t)}function mul_(e,t){var r=convertToTensor(e,"a","mul"),n=convertToTensor(t,"b","mul");assertTypesMatch(r,n);var a=assertAndGetBroadcastShape(r.shape,n.shape);return ENV.engine.runKernel(function(e){return e.multiply(r,n)},{$a:r,$b:n},function(e){return{$a:function(){var t=e.mul(n.toFloat()),o=getReductionAxes(r.shape,a);return o.length>0?t.sum(o).reshape(r.shape):t},$b:function(){var t=e.mul(r.toFloat()),o=getReductionAxes(n.shape,a);return o.length>0?t.sum(o).reshape(n.shape):t}}})}function mulStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in multiplyStrict: "),e.mul(t)}function div_(e,t){var r,n=convertToTensor(e,"a","div"),a=convertToTensor(t,"b","div");if(assertTypesMatch(n,a),"int32"===n.dtype&&"int32"===a.dtype)return floorDiv(n,a);r=function(e){return e.realDivide(n,a)};var o=assertAndGetBroadcastShape(n.shape,a.shape);return ENV.engine.runKernel(r,{$a:n,$b:a},function(e){return{$a:function(){var t=e.div(a.toFloat()),r=getReductionAxes(n.shape,o);return r.length>0?t.sum(r).reshape(n.shape):t},$b:function(){var t=e.mul(n.toFloat()),r=getReductionAxes(a.shape,o);r.length>0&&(t=t.sum(r).reshape(a.shape));var i=a.square();return t.div(i.toFloat()).neg()}}})}function floorDiv_(e,t){var r=convertToTensor(e,"a","floorDiv"),n=convertToTensor(t,"b","floorDiv");assertTypesMatch(r,n);var a=assertAndGetBroadcastShape(r.shape,n.shape);return ENV.engine.runKernel(function(e){return e.floorDiv(r,n)},{$a:r,$b:n},function(e){return{$a:function(){var t=e.div(n.toFloat()),o=getReductionAxes(r.shape,a);return o.length>0?t.sum(o).reshape(r.shape):t},$b:function(){var t=e.mul(r.toFloat()),o=getReductionAxes(n.shape,a);o.length>0&&(t=t.sum(o).reshape(n.shape));var i=n.square();return t.div(i.toFloat()).neg()}}})}function divStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in divideStrict: "),e.div(t)}function mod_(e,t){var r=convertToTensor(e,"a","mod"),n=convertToTensor(t,"b","mod");assertTypesMatch(r,n);var a=assertAndGetBroadcastShape(r.shape,n.shape);return ENV.engine.runKernel(function(e){return e.mod(r,n)},{$a:r,$b:n},function(e){return{$a:function(){var t=getReductionAxes(r.shape,a);return t.length>0?e.sum(t).reshape(r.shape):e},$b:function(){var t=e.mul(r.div(n).floor().neg()),o=getReductionAxes(n.shape,a);return o.length>0?t.sum(o).reshape(n.shape):t}}})}function modStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in modStrict: "),e.mod(t)}function minimum_(e,t){var r=convertToTensor(e,"a","minimum"),n=convertToTensor(t,"b","minimum");return assertTypesMatch(r,n),"bool"===r.dtype&&(r=r.toInt()),"bool"===n.dtype&&(n=n.toInt()),assertAndGetBroadcastShape(r.shape,n.shape),ENV.engine.runKernel(function(e){return e.minimum(r,n)},{$a:r,$b:n},function(e){return{$a:function(){return e.mul(r.lessEqual(n).toFloat())},$b:function(){return e.mul(r.greater(n).toFloat())}}})}function minimumStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in minimumStrict: "),e.minimum(t)}function maximum_(e,t){var r=convertToTensor(e,"a","maximum"),n=convertToTensor(t,"b","maximum");return assertTypesMatch(r,n),"bool"===r.dtype&&(r=r.toInt()),"bool"===n.dtype&&(n=n.toInt()),assertAndGetBroadcastShape(r.shape,n.shape),ENV.engine.runKernel(function(e){return e.maximum(r,n)},{$a:r,$b:n},function(e){return{$a:function(){return e.mul(r.greaterEqual(n).toFloat())},$b:function(){return e.mul(r.less(n).toFloat())}}})}function maximumStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in minimumStrict: "),e.maximum(t)}function squaredDifference_(e,t){var r=convertToTensor(e,"a","squaredDifference"),n=convertToTensor(t,"b","squaredDifference");return assertTypesMatch(r,n),assertAndGetBroadcastShape(r.shape,n.shape),ENV.engine.runKernel(function(e){return e.squaredDifference(r,n)},{$a:r,$b:n},function(e){var t=scalar(2);return{$a:function(){return e.mul(r.sub(n).mul(t))},$b:function(){return e.mul(n.sub(r).mul(t))}}})}function squaredDifferenceStrict_(e,t){return assertShapesMatch(e.shape,t.shape,"Error in squaredDifferenceStrict: "),e.squaredDifference(t)}function atan2_(e,t){var r=convertToTensor(e,"a","atan2"),n=convertToTensor(t,"b","atan2");assertTypesMatch(r,n);var a=assertAndGetBroadcastShape(r.shape,n.shape);return ENV.engine.runKernel(function(e){return e.atan2(r,n)},{$a:r,$b:n},function(e){return{$a:function(){var t=add(r.square(),n.square()),o=e.mul(n.div(t)),i=getReductionAxes(r.shape,a);return i.length>0&&(o=o.sum(i)),o.reshape(r.shape)},$b:function(){var t=add(r.square(),n.square()),o=neg(e.mul(r.div(t))),i=getReductionAxes(n.shape,a);return i.length>0&&(o=o.sum(i)),o.reshape(n.shape)}}})}var add=op({add_:add_}),addN=op({addN_:addN_}),addStrict=op({addStrict_:addStrict_}),atan2=op({atan2_:atan2_}),div=op({div_:div_}),divStrict=op({divStrict_:divStrict_}),floorDiv=op({floorDiv_:floorDiv_}),maximum=op({maximum_:maximum_}),maximumStrict=op({maximumStrict_:maximumStrict_}),minimum=op({minimum_:minimum_}),minimumStrict=op({minimumStrict_:minimumStrict_}),mod=op({mod_:mod_}),modStrict=op({modStrict_:modStrict_}),mul=op({mul_:mul_}),mulStrict=op({mulStrict_:mulStrict_}),pow=op({pow_:pow_}),powStrict=op({powStrict_:powStrict_}),squaredDifference=op({squaredDifference_:squaredDifference_}),squaredDifferenceStrict=op({squaredDifferenceStrict_:squaredDifferenceStrict_}),sub=op({sub_:sub_}),subStrict=op({subStrict_:subStrict_});function logicalNot_(e){var t=convertToTensor(e,"x","logicalNot","bool");return assert("bool"===t.dtype,"Error Array must be of type bool."),ENV.engine.runKernel(function(e){return e.logicalNot(t)},{$x:t})}function logicalAnd_(e,t){var r=convertToTensor(e,"a","logicalAnd","bool"),n=convertToTensor(t,"b","logicalAnd","bool");return assert("bool"===r.dtype&&"bool"===n.dtype,"Error Array must be of type bool."),assertAndGetBroadcastShape(r.shape,n.shape),ENV.engine.runKernel(function(e){return e.logicalAnd(r,n)},{$a:r,$b:n})}function logicalOr_(e,t){var r=convertToTensor(e,"a","logicalOr","bool"),n=convertToTensor(t,"b","logicalOr","bool");return assert("bool"===r.dtype&&"bool"===n.dtype,"Error Array must be of type bool."),assertAndGetBroadcastShape(r.shape,n.shape),ENV.engine.runKernel(function(e){return e.logicalOr(r,n)},{$a:r,$b:n})}function logicalXor_(e,t){var r=convertToTensor(e,"a","logicalXor","bool"),n=convertToTensor(t,"b","logicalXor","bool");return assert("bool"===r.dtype&&"bool"===n.dtype,"Error Array must be of type bool."),assertAndGetBroadcastShape(r.shape,n.shape),logicalOr(e,t).logicalAnd(logicalAnd(e,t).logicalNot())}function where_(e,t,r){var n=convertToTensor(t,"a","where"),a=convertToTensor(r,"b","where"),o=convertToTensor(e,"condition","where","bool");return assert("bool"===o.dtype,"Error Condition must be of type bool."),assertShapesMatch(n.shape,a.shape,"Error in where: "),1===o.rank?assert(o.shape[0]===n.shape[0],"The first dimension of `a` must match the size of `condition`."):assertShapesMatch(o.shape,a.shape,"Error in where: "),ENV.engine.runKernel(function(e){return e.select(o,n,a)},{$condition:o,$a:n,$b:a},function(e){return{$condition:function(){return zerosLike(o)},$a:function(){return e.mul(o.cast(n.dtype))},$b:function(){return e.mul(o.logicalNot().cast(a.dtype))}}})}function whereAsync_(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator(this,function(a){switch(a.label){case 0:return assert("bool"===(t=convertToTensor(e,"condition","where","bool")).dtype,"Condition must be of type bool."),[4,t.data()];case 1:return r=a.sent(),n=whereImpl(t.shape,r),e!==t&&t.dispose(),[2,n]}})})}var logicalAnd=op({logicalAnd_:logicalAnd_}),logicalNot=op({logicalNot_:logicalNot_}),logicalOr=op({logicalOr_:logicalOr_}),logicalXor=op({logicalXor_:logicalXor_}),where=op({where_:where_}),whereAsync=whereAsync_;function relu_(e){var t=convertToTensor(e,"x","relu");return"bool"===t.dtype?t.toInt():ENV.engine.runKernel(function(e){return e.relu(t)},{$x:t},function(e){var r=t.step();return{$x:function(){return e.mulStrict(r.toFloat())}}})}function elu_(e){var t=convertToTensor(e,"x","elu");return ENV.engine.runKernel(function(e,r){return r(e.elu(t))},{$x:t},function(e,t){var r=t[0];return{$x:function(){return ENV.engine.runKernel(function(t){return t.eluDer(e,r)},{dy:e,y:r})}}})}function selu_(e){var t=convertToTensor(e,"x","selu");return ENV.engine.runKernel(function(e){return e.selu(t)},{$x:t},function(e){return{$x:function(){var r=t.greater(scalar(0)),n=scalar(SELU_SCALEALPHA),a=scalar(SELU_SCALE),o=e.mul(a),i=e.mul(n).mul(t.toFloat().exp());return where(r,o,i)}}})}function leakyRelu_(e,t){void 0===t&&(t=.2);var r=convertToTensor(e,"x","leakyRelu");return maximum(scalar(t).mul(r),r)}function prelu_(e,t){var r=convertToTensor(e,"x","prelu"),n=convertToTensor(t,"alpha","prelu"),a=scalar(0);return maximum(a,r).add(n.mul(minimum(a,r)))}var elu=op({elu_:elu_}),leakyRelu=op({leakyRelu_:leakyRelu_}),prelu=op({prelu_:prelu_}),relu=op({relu_:relu_}),selu=op({selu_:selu_});function transpose_(e,t){var r=convertToTensor(e,"x","transpose");return null==t&&(t=r.shape.map(function(e,t){return t}).reverse()),assert(r.rank===t.length,"Error in transpose: rank of input "+r.rank+" must match length of perm "+t+"."),t.forEach(function(e){assert(e>=0&&ea)throw new Error("'k' passed to topk() must be <= the last dimension ("+a+") but got "+t);var o=ENV.engine.runKernel(function(e){return e.topk(n,t,r)},{$x:n});return{values:o[0],indices:o[1]}}var topk=op({topk_:topk_});function computeWeightedLoss_(e,t,r){void 0===r&&(r=exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var n=convertToTensor(e,"losses","computeWeightedLoss"),a=null;null!=t&&(a=convertToTensor(t,"weights","computeWeightedLoss"));var o=null==a?n:n.mul(a);if(r===exports.Reduction.NONE)return o;if(r===exports.Reduction.SUM)return o.sum();if(r===exports.Reduction.MEAN){if(null==a)return o.mean();var i=sizeFromShape(n.shape)/sizeFromShape(a.shape),s=o.sum().div(a.sum());return i>1?s.div(scalar(i)):s}if(r===exports.Reduction.SUM_BY_NONZERO_WEIGHTS){if(null==a)return o.sum().div(scalar(n.size));var u=a.mul(ones$1(n.shape)).notEqual(scalar(0)).sum().toFloat();return o.sum().div(u)}throw Error("Unknown reduction: "+r)}function absoluteDifference_(e,t,r,n){void 0===n&&(n=exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,"labels","absoluteDifference"),o=convertToTensor(t,"predictions","absoluteDifference"),i=null;null!=r&&(i=convertToTensor(r,"weights","absoluteDifference")),assertShapesMatch(a.shape,o.shape,"Error in absoluteDifference: ");var s=a.sub(o).abs();return computeWeightedLoss(s,i,n)}function meanSquaredError_(e,t,r,n){void 0===n&&(n=exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,"labels","meanSquaredError"),o=convertToTensor(t,"predictions","meanSquaredError"),i=null;null!=r&&(i=convertToTensor(r,"weights","meanSquaredError")),assertShapesMatch(a.shape,o.shape,"Error in meanSquaredError: ");var s=a.squaredDifference(o);return computeWeightedLoss(s,i,n)}function cosineDistance_(e,t,r,n,a){void 0===a&&(a=exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,"labels","cosineDistance"),i=convertToTensor(t,"predictions","cosineDistance"),s=null;null!=n&&(s=convertToTensor(n,"weights","cosineDistance")),assertShapesMatch(o.shape,i.shape,"Error in cosineDistance: ");var u=scalar(1).sub(o.mul(i).sum(r,!0));return computeWeightedLoss(u,s,a)}function hingeLoss_(e,t,r,n){void 0===n&&(n=exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,"labels","hingeLoss"),o=convertToTensor(t,"predictions","hingeLoss"),i=null;null!=r&&(i=convertToTensor(r,"weights","hingeLoss")),assertShapesMatch(a.shape,o.shape,"Error in hingeLoss: ");var s=scalar(1);a=scalar(2).mul(a).sub(s);var u=s.sub(a.mul(o)).relu();return computeWeightedLoss(u,i,n)}function logLoss_(e,t,r,n,a){void 0===n&&(n=1e-7),void 0===a&&(a=exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,"labels","logLoss"),i=convertToTensor(t,"predictions","logLoss"),s=null;null!=r&&(s=convertToTensor(r,"weights","logLoss")),assertShapesMatch(o.shape,i.shape,"Error in logLoss: ");var u=scalar(1),l=scalar(n),p=o.mul(i.add(l).log()).neg().sub(u.sub(o).mul(u.sub(i).add(l).log()));return computeWeightedLoss(p,s,a)}function sigmoidCrossEntropyWithLogits_(e,t){var r=convertToTensor(e,"labels","sigmoidCrossEntropyWithLogits"),n=convertToTensor(t,"logits","sigmoidCrossEntropyWithLogits");assertShapesMatch(r.shape,n.shape,"Error in sigmoidCrossEntropyWithLogits: ");var a=n.relu(),o=n.mul(r),i=n.abs().neg().exp().log1p();return a.sub(o).add(i)}function sigmoidCrossEntropy_(e,t,r,n,a){void 0===n&&(n=0),void 0===a&&(a=exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,"multiClassLabels","sigmoidCrossEntropy"),i=convertToTensor(t,"logits","sigmoidCrossEntropy"),s=null;if(null!=r&&(s=convertToTensor(r,"weights","sigmoidCrossEntropy")),assertShapesMatch(o.shape,i.shape,"Error in sigmoidCrossEntropy: "),n>0){var u=scalar(n),l=scalar(1),p=scalar(.5);o=o.mul(l.sub(u)).add(p.mul(u))}var c=sigmoidCrossEntropyWithLogits_(o,i);return computeWeightedLoss(c,s,a)}function huberLoss_(e,t,r,n,a){void 0===n&&(n=1),void 0===a&&(a=exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,"labels","huberLoss"),i=convertToTensor(t,"predictions","huberLoss"),s=null;null!=r&&(s=convertToTensor(r,"weights","huberLoss")),assertShapesMatch(o.shape,i.shape,"Error in huberLoss: ");var u=scalar(n),l=i.sub(o).abs(),p=minimum(l,u),c=l.sub(p),d=scalar(.5).mul(p.square()).add(u.mul(c));return computeWeightedLoss(d,s,a)}function softmaxCrossEntropyWithLogits_(e,t,r){if(void 0===r&&(r=-1),-1===r&&(r=t.rank-1),r!==t.rank-1)throw Error("Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank "+t.rank+" and dim was "+r);return customGrad(function(e,t){var n=t.logSumExp([r],!0),a=t.toFloat().sub(n);return{value:a.mul(e).neg().sum([r]),gradFunc:function(t){var n=expandShapeToKeepDim(t.shape,[r]);return[t.reshape(n).mul(e.toFloat().sub(a.exp())),t.reshape(n).mul(a.exp().sub(e.toFloat()))]}}})(e,t)}function softmaxCrossEntropy_(e,t,r,n,a){void 0===n&&(n=0),void 0===a&&(a=exports.Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,"onehotLabels","softmaxCrossEntropy"),i=convertToTensor(t,"logits","softmaxCrossEntropy"),s=null;if(null!=r&&(s=convertToTensor(r,"weights","softmaxCrossEntropy")),assertShapesMatch(o.shape,i.shape,"Error in softmaxCrossEntropy: "),n>0){var u=scalar(n),l=scalar(1),p=scalar(o.shape[1]);o=o.mul(l.sub(u)).add(u.div(p))}var c=softmaxCrossEntropyWithLogits_(o,i);return computeWeightedLoss(c,s,a)}!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(exports.Reduction||(exports.Reduction={}));var absoluteDifference=op({absoluteDifference_:absoluteDifference_}),computeWeightedLoss=op({computeWeightedLoss_:computeWeightedLoss_}),cosineDistance=op({cosineDistance_:cosineDistance_}),hingeLoss=op({hingeLoss_:hingeLoss_}),huberLoss=op({huberLoss_:huberLoss_}),logLoss=op({logLoss_:logLoss_}),meanSquaredError=op({meanSquaredError_:meanSquaredError_}),sigmoidCrossEntropy=op({sigmoidCrossEntropy_:sigmoidCrossEntropy_}),softmaxCrossEntropy=op({softmaxCrossEntropy_:softmaxCrossEntropy_}),loss_ops=Object.freeze({get Reduction(){return exports.Reduction},absoluteDifference:absoluteDifference,computeWeightedLoss:computeWeightedLoss,cosineDistance:cosineDistance,hingeLoss:hingeLoss,huberLoss:huberLoss,logLoss:logLoss,meanSquaredError:meanSquaredError,sigmoidCrossEntropy:sigmoidCrossEntropy,softmaxCrossEntropy:softmaxCrossEntropy});function gramSchmidt_(e){var t;if(Array.isArray(e)){t=!1,assert(null!=e&&e.length>0,"Gram-Schmidt process: input must not be null, undefined, or empty");for(var r=e[0].shape[0],n=1;n0)for(var r=0;r= 2, but got rank "+e.rank);if(2===e.rank)return qr2d(e,t);var r=e.shape.slice(0,e.shape.length-2).reduce(function(e,t){return e*t}),n=[],a=[];return unstack(e.reshape([r,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0).forEach(function(e){var r=qr2d(e,t),o=r[0],i=r[1];n.push(o),a.push(i)}),[stack(n,0).reshape(e.shape),stack(a,0).reshape(e.shape)]}function qr2d(e,t){return void 0===t&&(t=!1),ENV.engine.tidy(function(){if(2!==e.shape.length)throw new Error("qr2d() requires a 2D Tensor, but got a "+e.shape.length+"D Tensor.");for(var r=e.shape[0],n=e.shape[1],a=eye(r),o=e.clone(),i=tensor2d([[1]],[1,1]),s=i.clone(),u=r>=n?n:r,l=function(e){var t,u=o,l=s,p=a;t=ENV.engine.tidy(function(){var t=o.slice([e,e],[r-e,1]),u=t.norm(),l=o.slice([e,e],[1,1]),p=l.sign().neg(),c=l.sub(p.mul(u)),d=t.div(c);s=1===d.shape[0]?i.clone():i.concat(d.slice([1,0],[d.shape[0]-1,d.shape[1]]),0);var h=p.matMul(c).div(u).neg(),f=o.slice([e,0],[r-e,n]),m=h.mul(s);o=0===e?f.sub(m.matMul(s.transpose().matMul(f))):o.slice([0,0],[e,n]).concat(f.sub(m.matMul(s.transpose().matMul(f))),0);var g=a.slice([0,e],[r,a.shape[1]-e]);return a=0===e?g.sub(g.matMul(s).matMul(m.transpose())):a.slice([0,0],[r,e]).concat(g.sub(g.matMul(s).matMul(m.transpose())),1),[s,o,a]}),s=t[0],o=t[1],a=t[2],dispose([u,l,p])},p=0;pn&&(a=a.slice([0,0],[r,n]),o=o.slice([0,0],[n,n])),[a,o]})}var gramSchmidt=op({gramSchmidt_:gramSchmidt_}),qr=op({qr_:qr_}),linalg_ops=Object.freeze({gramSchmidt:gramSchmidt,qr:qr});function resizeBilinear_(e,t,r){void 0===r&&(r=!1);var n=convertToTensor(e,"images","resizeBilinear");assert(3===n.rank||4===n.rank,"Error in resizeBilinear: x must be rank 3 or 4, but got rank "+n.rank+"."),assert(2===t.length,"Error in resizeBilinear: new shape must 2D, but got shape "+t+".");var a=n,o=!1;3===n.rank&&(o=!0,a=n.as4D(1,n.shape[0],n.shape[1],n.shape[2]));var i=t[0],s=t[1],u=ENV.engine.runKernel(function(e,t){return e.resizeBilinear(a,i,s,r)},{batchImages:a},function(e,t){return{batchImages:function(){return ENV.engine.runKernel(function(t){return t.resizeBilinearBackprop(e,a,r)},{})}}});return o?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}function resizeNearestNeighbor_(e,t,r){void 0===r&&(r=!1);var n=convertToTensor(e,"images","resizeNearestNeighbor");assert(3===n.rank||4===n.rank,"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank "+n.rank+"."),assert(2===t.length,"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+t+"."),assert("float32"===n.dtype||"int32"===n.dtype,"`images` must have `int32` or `float32` as dtype");var a=n,o=!1;3===n.rank&&(o=!0,a=n.as4D(1,n.shape[0],n.shape[1],n.shape[2]));var i=t[0],s=t[1],u=ENV.engine.runKernel(function(e,t){return e.resizeNearestNeighbor(a,i,s,r)},{batchImages:a},function(e,t){return{batchImages:function(){return ENV.engine.runKernel(function(t){return t.resizeNearestNeighborBackprop(e,a,r)},{})}}});return o?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}function nonMaxSuppression_(e,t,r,n,a){void 0===n&&(n=.5),void 0===a&&(a=Number.NEGATIVE_INFINITY);var o=convertToTensor(e,"boxes","nonMaxSuppression"),i=convertToTensor(t,"scores","nonMaxSuppression"),s=nonMaxSuppSanityCheck(o,i,r,n,a);return r=s.maxOutputSize,n=s.iouThreshold,a=s.scoreThreshold,ENV.engine.runKernel(function(e){return e.nonMaxSuppression(o,i,r,n,a)},{$boxes:o})}function nonMaxSuppressionAsync_(e,t,r,n,a){return void 0===n&&(n=.5),void 0===a&&(a=Number.NEGATIVE_INFINITY),__awaiter(this,void 0,void 0,function(){var o,i,s,u,l,p;return __generator(this,function(c){switch(c.label){case 0:return o=convertToTensor(e,"boxes","nonMaxSuppressionAsync"),i=convertToTensor(t,"scores","nonMaxSuppressionAsync"),s=nonMaxSuppSanityCheck(o,i,r,n,a),r=s.maxOutputSize,n=s.iouThreshold,a=s.scoreThreshold,[4,o.data()];case 1:return u=c.sent(),[4,i.data()];case 2:return l=c.sent(),p=nonMaxSuppressionImpl(u,l,r,n,a),o!==e&&o.dispose(),i!==t&&i.dispose(),[2,p]}})})}function nonMaxSuppSanityCheck(e,t,r,n,a){null==n&&(n=.5),null==a&&(a=Number.NEGATIVE_INFINITY);var o=e.shape[0];return r=Math.min(r,o),assert(0<=n&&n<=1,"iouThreshold must be in [0, 1], but was '"+n+"'"),assert(2===e.rank,"boxes must be a 2D tensor, but was of rank '"+e.rank+"'"),assert(4===e.shape[1],"boxes must have 4 columns, but 2nd dimension was "+e.shape[1]),assert(1===t.rank,"scores must be a 1D tensor"),assert(t.shape[0]===o,"scores has incompatible shape with boxes. Expected "+o+", but was "+t.shape[0]),{maxOutputSize:r,iouThreshold:n,scoreThreshold:a}}var resizeBilinear=op({resizeBilinear_:resizeBilinear_}),resizeNearestNeighbor=op({resizeNearestNeighbor_:resizeNearestNeighbor_}),nonMaxSuppression=op({nonMaxSuppression_:nonMaxSuppression_}),nonMaxSuppressionAsync=nonMaxSuppressionAsync_,image_ops=Object.freeze({resizeBilinear:resizeBilinear,resizeNearestNeighbor:resizeNearestNeighbor,nonMaxSuppression:nonMaxSuppression,nonMaxSuppressionAsync:nonMaxSuppressionAsync}),ops=Object.freeze({image:image_ops,linalg:linalg_ops,losses:loss_ops,op:op,batchNormalization2d:batchNormalization2d,batchNormalization3d:batchNormalization3d,batchNormalization4d:batchNormalization4d,batchNormalization:batchNormalization,concat:concat,concat1d:concat1d,concat2d:concat2d,concat3d:concat3d,concat4d:concat4d,conv1d:conv1d,conv2d:conv2d,depthwiseConv2d:depthwiseConv2d,separableConv2d:separableConv2d,conv2dTranspose:conv2dTranspose,matMul:matMul,dot:dot,outerProduct:outerProduct,reverse:reverse,reverse1d:reverse1d,reverse2d:reverse2d,reverse3d:reverse3d,reverse4d:reverse4d,maxPool:maxPool,avgPool:avgPool,slice:slice,slice1d:slice1d,slice2d:slice2d,slice3d:slice3d,slice4d:slice4d,abs:abs,acos:acos,acosh:acosh,asin:asin,asinh:asinh,atan:atan,atanh:atanh,ceil:ceil,clipByValue:clipByValue,cos:cos,cosh:cosh,erf:erf,exp:exp,expm1:expm1,floor:floor,log:log$1,log1p:log1p,logSigmoid:logSigmoid,neg:neg,reciprocal:reciprocal,round:round,rsqrt:rsqrt,sigmoid:sigmoid,sign:sign,sin:sin,sinh:sinh,softplus:softplus,sqrt:sqrt,square:square,step:step,tan:tan,tanh:tanh$1,all:all,any:any,argMax:argMax,argMin:argMin,logSumExp:logSumExp,max:max,mean:mean,min:min,moments:moments,sum:sum,equal:equal,equalStrict:equalStrict,greater:greater,greaterEqual:greaterEqual,greaterEqualStrict:greaterEqualStrict,greaterStrict:greaterStrict,less:less,lessEqual:lessEqual,lessEqualStrict:lessEqualStrict,lessStrict:lessStrict,notEqual:notEqual,notEqualStrict:notEqualStrict,add:add,addN:addN,addStrict:addStrict,atan2:atan2,div:div,divStrict:divStrict,floorDiv:floorDiv,maximum:maximum,maximumStrict:maximumStrict,minimum:minimum,minimumStrict:minimumStrict,mod:mod,modStrict:modStrict,mul:mul,mulStrict:mulStrict,pow:pow,powStrict:powStrict,squaredDifference:squaredDifference,squaredDifferenceStrict:squaredDifferenceStrict,sub:sub,subStrict:subStrict,elu:elu,leakyRelu:leakyRelu,prelu:prelu,relu:relu,selu:selu,logicalAnd:logicalAnd,logicalNot:logicalNot,logicalOr:logicalOr,logicalXor:logicalXor,where:where,whereAsync:whereAsync,buffer:buffer,toPixels:toPixels,print:print,cast:cast,clone:clone,cumsum:cumsum,expandDims:expandDims,eye:eye,fromPixels:fromPixels,multinomial:multinomial,oneHot:oneHot,pad:pad,pad1d:pad1d,pad2d:pad2d,pad3d:pad3d,pad4d:pad4d,rand:rand,randomNormal:randomNormal,randomUniform:randomUniform,reshape:reshape,split:split,squeeze:squeeze,stack:stack,tile:tile,truncatedNormal:truncatedNormal,unstack:unstack,batchToSpaceND:batchToSpaceND,spaceToBatchND:spaceToBatchND,fill:fill,linspace:linspace,ones:ones$1,range:range,scalar:scalar,tensor:tensor,tensor1d:tensor1d,tensor2d:tensor2d,tensor3d:tensor3d,tensor4d:tensor4d,tensor5d:tensor5d,tensor6d:tensor6d,zeros:zeros,onesLike:onesLike,zerosLike:zerosLike,transpose:transpose,softmax:softmax,localResponseNormalization:localResponseNormalization,norm:norm,gather:gather,unsortedSegmentSum:unsortedSegmentSum,basicLSTMCell:basicLSTMCell,multiRNNCell:multiRNNCell,movingAverage:movingAverage,stridedSlice:stridedSlice,topk:topk}),MathBackendCPU=function(){function e(){this.data=new WeakMap,this.firstUse=!0,ENV.get("IS_BROWSER")&&(this.canvas=document.createElement("canvas"))}return e.prototype.register=function(e,t,r){if(this.firstUse&&(this.firstUse=!1,ENV.get("IS_NODE")&&warn("\n============================\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================\n")),this.data.has(e))throw new Error("Data buffer is already registered");this.data.set(e,null)},e.prototype.write=function(e,t){if(null==t)throw new Error("MathBackendCPU.write(): values can not be null");this.throwIfNoData(e),this.data.set(e,t)},e.prototype.fromPixels=function(e,t){if(null==e)throw new Error("pixels passed to tf.fromPixels() can not be null");var r,n;if(ENV.get("IS_NODE")&&null==e.getContext)throw new Error("When running in node, pixels must be an HTMLCanvasElement like the one returned by the `canvas` npm package");if(null!=e.getContext)r=e.getContext("2d").getImageData(0,0,e.width,e.height).data;else if(e instanceof ImageData)r=e.data;else{if(!(e instanceof HTMLImageElement||e instanceof HTMLVideoElement))throw new Error("pixels passed to tf.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ImageData, but was "+e.constructor.name);if(null==this.canvas)throw new Error("Can't read pixels from HTMLImageElement outside the browser.");this.canvas.width=e.width,this.canvas.height=e.height,this.canvas.getContext("2d").drawImage(e,0,0,e.width,e.height),r=this.canvas.getContext("2d").getImageData(0,0,e.width,e.height).data}if(4===t)n=new Int32Array(r);else{var a=e.width*e.height;n=new Int32Array(a*t);for(var o=0;od&&(d=m,h=f)}u[p]=h}return i},e.prototype.cumsum=function(e,t,r,n){if(t!==e.rank-1)throw new Error("backend.cumsum in CPU expects an inner-most axis="+(e.rank-1)+" but got axis="+t);for(var a=upcastType(e.dtype,"int32"),o=zeros(e.shape,a),i=o.dataSync(),s=e.dataSync(),u=e.shape[e.rank-1],l=n?function(e,t){return e+u-t-1}:function(e,t){return e+t},p=0;pt?1:0})},e.prototype.greaterEqual=function(e,t){return this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e>=t?1:0})},e.prototype.logicalNot=function(e){for(var t=e.dataSync(),r=new Int32Array(t.length),n=0;n1||1===t.rank?1:t.shape[1],p=0;p=0&&t>=0?r:(r+t)%t})},e.prototype.max=function(e,t){assertAxesAreInnerMostDims("max",t,e.rank);for(var r=computeOutAndReduceShapes(e.shape,t),n=r[0],a=r[1],o=zeros(n,e.dtype),i=sizeFromShape(a),s=o.dataSync(),u=e.dataSync(),l=0;lc&&(c=h)}s[l]=c}return o},e.prototype.maximum=function(e,t){return this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.max(e,t)})},e.prototype.all=function(e,t){assertAxesAreInnerMostDims("all",t,e.rank);for(var r=computeOutAndReduceShapes(e.shape,t),n=r[0],a=r[1],o=zeros(n,e.dtype),i=sizeFromShape(a),s=o.dataSync(),u=e.dataSync(),l=0;l0?r[n]=1:r[n]=0;return Tensor.make(e.shape,{values:r})},e.prototype.round=function(e){for(var t=e.dataSync(),r=new Float32Array(t.length),n=0;n.5?r[n]=Math.ceil(t[n]):r[n]=a%2==0?a:a+1}return Tensor.make(e.shape,{values:r})},e.prototype.exp=function(e){for(var t=e.dataSync(),r=new Float32Array(t.length),n=0;n=0?a:Math.exp(a)-1}return Tensor.make(e.shape,{values:t})},e.prototype.eluDer=function(e,t){for(var r=new Float32Array(t.size),n=t.dataSync(),a=e.dataSync(),o=0;o=1?a[o]:a[o]*(i+1)}return Tensor.make(t.shape,{values:r})},e.prototype.selu=function(e){for(var t=SELU_SCALEALPHA,r=SELU_SCALE,n=new Float32Array(e.size),a=e.dataSync(),o=0;o=0?r*i:t*(Math.exp(i)-1)}return Tensor.make(e.shape,{values:n})},e.prototype.clip=function(e,t,r){for(var n=new Float32Array(e.size),a=e.dataSync(),o=0;o-t,s=n[a]0?1:t}return Tensor.make(e.shape,{values:r})},e.prototype.conv2d=function(e,t,r){for(var n=r.filterHeight,a=r.filterWidth,o=r.dilationHeight,i=r.dilationWidth,s=r.padInfo.left,u=r.padInfo.top,l=buffer(r.outShape,e.dtype),p=0;p=r.inHeight))for(var b=0;b=r.inWidth))for(var w=0;w=r.inHeight))for(var w=0;w=r.inWidth||(v+=e.get(c,x,S,d)*t.get(b,w,d,y))}}p.set(v,c,h,m,d*l+y)}return p.toTensor()},e.prototype.depthwiseConv2DDerInput=function(e,t,r){for(var n=buffer(r.inShape,"float32"),a=n.values,o=n.strides,i=o[0],s=o[1],u=o[2],l=e.dataSync(),p=e.strides,c=p[0],d=p[1],h=p[2],f=t.dataSync(),m=t.strides,g=m[0],y=m[1],v=m[2],b=r.batchSize,x=r.filterHeight,w=r.filterWidth,S=r.inChannels,N=r.inHeight,T=r.inWidth,E=r.outChannels,I=r.outHeight,A=r.outWidth,_=r.strideHeight,P=r.strideWidth,C=x-1-r.padInfo.top,k=w-1-r.padInfo.left,O=E/S,R=0;Rx?x=E:"avg"===r&&(w+=E,S++)}if(isNaN(x))break}s.set("avg"===r?w/S:x,p,d,g,c)}return s.toTensor()},e.prototype.maxPool=function(e,t){return this.pool(e,t,"max")},e.prototype.maxPoolPositions=function(e,t){for(var r=buffer(t.outShape,"int32"),n=t.strideHeight,a=t.strideWidth,o=t.filterHeight,i=t.filterWidth,s=t.padInfo.top,u=t.padInfo.left,l=0;lb&&(b=E,x=S*i+T)}r.set(x,l,c,m,p)}return r.toTensor()},e.prototype.maxPoolBackprop=function(e,t,r,n){for(var a=this.maxPoolPositions(t,n),o=n.strideHeight,i=n.strideWidth,s=n.filterHeight,u=n.filterWidth,l=u-1-n.padInfo.left,p=s-1-n.padInfo.top,c=buffer(t.shape,"float32"),d=0;d=n.outHeight||Math.floor(x)!==x))for(var w=0;w=n.outWidth||Math.floor(S)!==S)){var N=s*u-1-a.get(d,x,S,h)===b*u+w?1:0;0!==N&&(v+=e.get(d,x,S,h)*N)}}}c.set(v,d,f,m,h)}return c.toTensor()},e.prototype.avgPoolBackprop=function(e,t,r){for(var n=r.strideHeight,a=r.strideWidth,o=r.filterHeight,i=r.filterWidth,s=i-1-r.padInfo.left,u=o-1-r.padInfo.top,l=buffer(t.shape,"float32"),p=1/(o*i),c=0;c=r.outHeight||Math.floor(b)!==b))for(var x=0;x=r.outWidth||Math.floor(w)!==w||(y+=e.get(c,b,w,d))}}l.set(y*p,c,h,f,d)}return l.toTensor()},e.prototype.cast=function(e,t){return castTensor(e,t,this)},e.prototype.reshape=function(e,t){return reshapeTensor(e,t)},e.prototype.avgPool=function(e,t){return this.pool(e,t,"avg").toFloat()},e.prototype.resizeBilinear=function(e,t,r,n){for(var a=e.shape,o=a[0],i=a[1],s=a[2],u=a[3],l=buffer([o,t,r,u],e.dtype),p=[n&&t>1?i-1:i,n&&r>1?s-1:s],c=[n&&t>1?t-1:t,n&&r>1?r-1:r],d=0;d1?o-1:o,r&&p>1?i-1:i],h=[r&&l>1?l-1:l,r&&p>1?p-1:p],f=d[0]/h[0],m=d[1]/h[1],g=0;g1?i-1:i,n&&r>1?s-1:s],c=[n&&t>1?t-1:t,n&&r>1?r-1:r],d=0;d1?o-1:o,r&&p>1?i-1:i],h=[r&&l>1?l-1:l,r&&p>1?p-1:p],f=1/(d[0]/h[0]),m=1/(d[1]/h[1]),g=2*Math.ceil(f)+2,y=2*Math.ceil(m)+2,v=0;v=l))for(var P=0;P=p)){var k=d[0]*(_/h[0]),O=d[1]*(C/h[1]),R=Math.min(o-1,r?Math.round(k):Math.floor(k)),D=Math.min(i-1,r?Math.round(O):Math.floor(O));b===R&&x===D&&(I+=e.get(v,_,C,E))}}}c.set(I,v,b,x,E)}return c.toTensor()},e.prototype.batchNormalization=function(e,t,r,n,a,o){for(var i=e.dataSync(),s=t.dataSync(),u=r.dataSync(),l=a?a.dataSync():new Float32Array([1]),p=o?o.dataSync():new Float32Array([0]),c=new Float32Array(i.length),d=0;d=0&&e.get(o)0,"scheme must not be an empty string.");var n=e.getInstance();assert(null==n.managers[t],"A model store manager is already registered for scheme '"+t+"'."),n.managers[t]=r},e.getManager=function(e){var t=this.getInstance().managers[e];if(null==t)throw new Error("Cannot find model manager for scheme '"+e+"'");return t},e.getSchemes=function(){return Object.keys(this.getInstance().managers)},e}();function parseURL(e){if(-1===e.indexOf(URL_SCHEME_SUFFIX))throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+ModelStoreManagerRegistry.getSchemes().join(","));return{scheme:e.split(URL_SCHEME_SUFFIX)[0],path:e.split(URL_SCHEME_SUFFIX)[1]}}function cloneModelInternal(e,t,r){return void 0===r&&(r=!1),__awaiter(this,void 0,void 0,function(){var n,a,o,i,s,u,l,p,c;return __generator(this,function(d){switch(d.label){case 0:return assert(e!==t,"Old path and new path are the same: '"+e+"'"),assert((n=IORouterRegistry.getLoadHandlers(e)).length>0,"Copying failed because no load handler is found for source URL "+e+"."),assert(n.length<2,"Copying failed because more than one ("+n.length+") load handlers for source URL "+e+"."),a=n[0],assert((o=IORouterRegistry.getSaveHandlers(t)).length>0,"Copying failed because no save handler is found for destination URL "+t+"."),assert(o.length<2,"Copying failed because more than one ("+n.length+") save handlers for destination URL "+t+"."),i=o[0],s=parseURL(e).scheme,u=parseURL(e).path,l=s===parseURL(e).scheme,[4,a.load()];case 1:return p=d.sent(),r&&l?[4,ModelStoreManagerRegistry.getManager(s).removeModel(u)]:[3,3];case 2:d.sent(),d.label=3;case 3:return[4,i.save(p)];case 4:return c=d.sent(),!r||l?[3,6]:[4,ModelStoreManagerRegistry.getManager(s).removeModel(u)];case 5:d.sent(),d.label=6;case 6:return[2,c.modelArtifactsInfo]}})})}function listModels(){return __awaiter(this,void 0,void 0,function(){var e,t,r,n,a,o,i;return __generator(this,function(s){switch(s.label){case 0:e=ModelStoreManagerRegistry.getSchemes(),t={},r=0,n=e,s.label=1;case 1:return r0,"URL path for browserHTTPRequest must not be null, undefined or empty."),this.path=e,null!=t&&null!=t.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t||{}}return e.prototype.save=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,a;return __generator(this,function(o){switch(o.label){case 0:if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");return(t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,r=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],n={modelTopology:e.modelTopology,weightsManifest:r},t.body.append("model.json",new Blob([JSON.stringify(n)],{type:"application/json"}),"model.json"),null!=e.weightData&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:"application/octet-stream"}),"model.weights.bin"),[4,fetch(this.path,t)];case 1:if(200===(a=o.sent()).status)return[2,{modelArtifactsInfo:getModelArtifactsInfoForJSON(e),responses:[a]}];throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+a.status+".")}})})},e.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){var e,t,r,n,a,o,i,s,u,l,p,c;return __generator(this,function(d){switch(d.label){case 0:return[4,fetch(this.path,this.requestInit)];case 1:return[4,d.sent().json()];case 2:if(e=d.sent(),t=e.modelTopology,r=e.weightsManifest,null==t&&null==r)throw new Error("The JSON from HTTP path "+this.path+" contains neither model topology or manifest for weights.");if(null==r)return[3,4];for(o=e.weightsManifest,n=[],i=0,s=o;i0&&(e=__assign({weightSpecs:this.weightSpecs},e)),null!=this.weightData&&this.weightData.byteLength>0&&(e=__assign({weightData:this.weightData},e)),[2,e]})})},e}(),PassthroughSaver=function(){function e(e){this.saveHandler=e}return e.prototype.save=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,this.saveHandler(e)]})})},e}();function fromMemory(e,t,r){return new PassthroughLoader(e,t,r)}function withSaveHandler(e){return new PassthroughSaver(e)}var registerSaveRouter=IORouterRegistry.registerSaveRouter,registerLoadRouter=IORouterRegistry.registerLoadRouter,getSaveHandlers=IORouterRegistry.getSaveHandlers,getLoadHandlers=IORouterRegistry.getLoadHandlers,io=Object.freeze({browserFiles:browserFiles,browserHTTPRequest:browserHTTPRequest,concatenateArrayBuffers:concatenateArrayBuffers,decodeWeights:decodeWeights,encodeWeights:encodeWeights,fromMemory:fromMemory,getLoadHandlers:getLoadHandlers,getModelArtifactsInfoForJSON:getModelArtifactsInfoForJSON,getSaveHandlers:getSaveHandlers,loadWeights:loadWeights,registerLoadRouter:registerLoadRouter,registerSaveRouter:registerSaveRouter,withSaveHandler:withSaveHandler,copyModel:copyModel,listModels:listModels,moveModel:moveModel,removeModel:removeModel}),Serializable=function(){function e(){}return e.prototype.getClassName=function(){return this.constructor.className},e.fromConfig=function(e,t){return new e(t)},e}(),SerializationMap=function(){function e(){this.classNameMap={}}return e.getMap=function(){return null==e.instance&&(e.instance=new e),e.instance},e.register=function(t){e.getMap().classNameMap[t.className]=[t,t.fromConfig]},e}(),serialization=Object.freeze({Serializable:Serializable,SerializationMap:SerializationMap}),WEBGL_ENVS={HAS_WEBGL:!0},NODE_ENVS={IS_NODE:!0},CHROME_ENVS={IS_CHROME:!0},BROWSER_ENVS={IS_BROWSER:!0},CPU_ENVS={HAS_WEBGL:!1},ALL_ENVS={};function expectArraysClose(e,t,r){if(null==r&&(r=ENV.get("TEST_EPSILON")),e instanceof Tensor||t instanceof Tensor){if(e instanceof Tensor&&t instanceof Tensor){if(e.dtype!==t.dtype)throw new Error("Arrays are of different type actual: "+e.dtype+" vs expected: "+t.dtype+".");if(!arraysEqual(e.shape,t.shape))throw new Error("Arrays are of different shape actual: "+e.shape+" vs expected: "+t.shape+".")}}else{var n=e.constructor.name,a=t.constructor.name;if(n!==a)throw new Error("Arrays are of different type actual: "+n+" vs expected: "+a)}var o,i;if(o=e instanceof Tensor?e.dataSync():e,i=t instanceof Tensor?t.dataSync():t,o.length!==i.length)throw new Error("Arrays have different lengths actual: "+o.length+" vs expected: "+i.length+".\nActual: "+o+".\nExpected: "+i+".");for(var s=0;sr)}function expectValuesInRange(e,t,r){var n;n=e instanceof Tensor?e.dataSync():e;for(var a=0;ar)throw new Error("Value out of range:"+n[a]+" low: "+t+", high: "+r)}function expectArrayBuffersEqual(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}var test_util=Object.freeze({WEBGL_ENVS:WEBGL_ENVS,NODE_ENVS:NODE_ENVS,CHROME_ENVS:CHROME_ENVS,BROWSER_ENVS:BROWSER_ENVS,CPU_ENVS:CPU_ENVS,ALL_ENVS:ALL_ENVS,expectArraysClose:expectArraysClose,expectPromiseToFail:expectPromiseToFail,expectArraysEqual:expectArraysEqual,expectNumbersClose:expectNumbersClose,expectValuesInRange:expectValuesInRange,expectArrayBuffersEqual:expectArrayBuffersEqual}),version="0.12.8",webgl=Object.freeze({gpgpu_util:gpgpu_util,webgl_util:webgl_util,MathBackendWebGL:MathBackendWebGL,GPGPUContext:GPGPUContext}),Optimizer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.minimize=function(e,t,r){void 0===t&&(t=!1);var n=this.computeGradients(e,r),a=n.value,o=n.grads;return this.applyGradients(o),Object.keys(o).forEach(function(e){return o[e].dispose()}),t?a:(a.dispose(),null)},t.prototype.computeGradients=function(e,t){return variableGrads(e,t)},t}(Serializable),DEFAULT_FLOAT32_EPSILON=1e-8,DEFAULT_FLOAT16_EPSILON=1e-4;function getOptimizerDefaultEpsilonValue(){return ENV.get("WEBGL_RENDER_FLOAT32_ENABLED")?DEFAULT_FLOAT32_EPSILON:DEFAULT_FLOAT16_EPSILON}var AdadeltaOptimizer=function(e){function t(t,r,n){void 0===n&&(n=null);var a=e.call(this)||this;return a.learningRate=t,a.rho=r,a.epsilon=n,a.accumulatedGrads={},a.accumulatedUpdates={},a.c=keep(scalar(-t)),a.rhoScalar=keep(scalar(r)),a.oneMinusRho=keep(scalar(1-r)),null===n&&(n=getOptimizerDefaultEpsilonValue()),a.epsilonScalar=keep(scalar(n)),a}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,r=function(r){var a=ENV.engine.registeredVariables[r];null==n.accumulatedGrads[r]&&tidy(function(){t.accumulatedGrads[r]=zerosLike(a).variable(!1)}),null==n.accumulatedUpdates[r]&&tidy(function(){t.accumulatedUpdates[r]=zerosLike(a).variable(!1)});var o=e[r],i=n.accumulatedGrads[r],s=n.accumulatedUpdates[r];tidy(function(){var e=t.rhoScalar.mul(i).add(t.oneMinusRho.mul(o.square())),n=s.add(t.epsilonScalar).sqrt().div(i.add(t.epsilonScalar).sqrt()).mul(o),u=t.rhoScalar.mul(s).add(t.oneMinusRho.mul(n.square()));t.accumulatedGrads[r].assign(e),t.accumulatedUpdates[r].assign(u);var l=t.c.mul(n).add(a);a.assign(l)})},n=this;for(var a in e)r(a)},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsilonScalar.dispose(),this.rhoScalar.dispose(),this.oneMinusRho.dispose(),null!=this.accumulatedUpdates&&(Object.keys(this.accumulatedUpdates).forEach(function(t){return e.accumulatedUpdates[t].dispose()}),Object.keys(this.accumulatedGrads).forEach(function(t){return e.accumulatedGrads[t].dispose()}))},t.prototype.getConfig=function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.rho,t.epsilon)},t.className="AdadeltaOptimizer",t}(Optimizer);SerializationMap.register(AdadeltaOptimizer);var AdagradOptimizer=function(e){function t(t,r){void 0===r&&(r=.1);var n=e.call(this)||this;n.learningRate=t,n.initialAccumulatorValue=r,n.accumulatedGrads={},n.c=keep(scalar(-t));var a=getOptimizerDefaultEpsilonValue();return n.epsilon=keep(scalar(a)),n}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,r=function(r){var a=ENV.engine.registeredVariables[r];null==n.accumulatedGrads[r]&&tidy(function(){t.accumulatedGrads[r]=fill(a.shape,t.initialAccumulatorValue).variable(!1)});var o=e[r],i=n.accumulatedGrads[r];tidy(function(){var e=i.add(o.square());t.accumulatedGrads[r].assign(e);var n=t.c.mul(o.div(e.add(t.epsilon).sqrt())).add(a);a.assign(n)})},n=this;for(var a in e)r(a)},t.prototype.dispose=function(){var e=this;this.epsilon.dispose(),this.c.dispose(),null!=this.accumulatedGrads&&Object.keys(this.accumulatedGrads).forEach(function(t){return e.accumulatedGrads[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}},t.fromConfig=function(e,t){return new e(t.learningRate,t.initialAccumulatorValue)},t.className="AdagradOptimizer",t}(Optimizer);SerializationMap.register(AdagradOptimizer);var AdamOptimizer=function(e){function t(t,r,n,a){void 0===a&&(a=null);var o=e.call(this)||this;return o.learningRate=t,o.beta1=r,o.beta2=n,o.epsilon=a,o.accumulatedFirstMoment={},o.accumulatedSecondMoment={},o.c=keep(scalar(-t)),o.beta1Scalar=keep(scalar(r)),o.beta2Scalar=keep(scalar(n)),tidy(function(){o.accBeta1=scalar(r).variable(),o.accBeta2=scalar(n).variable()}),o.oneMinusBeta1=keep(scalar(1-r)),o.oneMinusBeta2=keep(scalar(1-n)),o.one=keep(scalar(1)),null===a&&(a=getOptimizerDefaultEpsilonValue()),o.epsScalar=keep(scalar(a)),o}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;tidy(function(){var r=t.one.sub(t.accBeta1),n=t.one.sub(t.accBeta2);for(var a in e){var o=ENV.engine.registeredVariables[a];if(null==t.accumulatedFirstMoment[a]){var i=!1;t.accumulatedFirstMoment[a]=zerosLike(o).variable(i)}null==t.accumulatedSecondMoment[a]&&(i=!1,t.accumulatedSecondMoment[a]=zerosLike(o).variable(i));var s=e[a],u=t.accumulatedFirstMoment[a],l=t.accumulatedSecondMoment[a],p=t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)),c=t.beta2Scalar.mul(l).add(t.oneMinusBeta2.mul(s.square())),d=p.div(r),h=c.div(n);t.accumulatedFirstMoment[a].assign(p),t.accumulatedSecondMoment[a].assign(c);var f=t.c.mul(d.div(t.epsScalar.add(h.sqrt()))).add(o);o.assign(f)}t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar)),t.accBeta2.assign(t.accBeta2.mul(t.beta2Scalar))})},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsScalar.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.accBeta1.dispose(),this.accBeta2.dispose(),this.oneMinusBeta1.dispose(),this.oneMinusBeta2.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(t){return e.accumulatedFirstMoment[t].dispose()}),null!=this.accumulatedSecondMoment&&Object.keys(this.accumulatedSecondMoment).forEach(function(t){return e.accumulatedSecondMoment[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)},t.className="AdamOptimizer",t}(Optimizer);SerializationMap.register(AdamOptimizer);var AdamaxOptimizer=function(e){function t(t,r,n,a,o){void 0===a&&(a=null),void 0===o&&(o=0);var i=e.call(this)||this;return i.learningRate=t,i.beta1=r,i.beta2=n,i.epsilon=a,i.decay=o,i.accumulatedFirstMoment={},i.accumulatedWeightedInfNorm={},i.c=keep(scalar(-t)),i.beta1Scalar=keep(scalar(r)),i.beta2Scalar=keep(scalar(n)),i.decayScalar=keep(scalar(o)),tidy(function(){i.iteration=scalar(0).variable(),i.accBeta1=scalar(r).variable()}),i.oneMinusBeta1=keep(scalar(1-r)),i.one=keep(scalar(1)),null===a&&(a=getOptimizerDefaultEpsilonValue()),i.epsScalar=keep(scalar(a)),i}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;tidy(function(){var r=t.one.sub(t.accBeta1),n=t.c.div(t.one.add(t.decayScalar.mul(t.iteration)));for(var a in e){var o=ENV.engine.registeredVariables[a];if(null==t.accumulatedFirstMoment[a]){var i=!1;t.accumulatedFirstMoment[a]=zerosLike(o).variable(i)}null==t.accumulatedWeightedInfNorm[a]&&(i=!1,t.accumulatedWeightedInfNorm[a]=zerosLike(o).variable(i));var s=e[a],u=t.accumulatedFirstMoment[a],l=t.accumulatedWeightedInfNorm[a],p=t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)),c=t.beta2Scalar.mul(l),d=s.abs(),h=c.maximum(d);t.accumulatedFirstMoment[a].assign(p),t.accumulatedWeightedInfNorm[a].assign(h);var f=n.div(r).mul(p.div(t.epsScalar.add(h))).add(o);o.assign(f)}t.iteration.assign(t.iteration.add(t.one)),t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar))})},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsScalar.dispose(),this.accBeta1.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.oneMinusBeta1.dispose(),this.decayScalar.dispose(),this.iteration.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(t){return e.accumulatedFirstMoment[t].dispose()}),null!=this.accumulatedWeightedInfNorm&&Object.keys(this.accumulatedWeightedInfNorm).forEach(function(t){return e.accumulatedWeightedInfNorm[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)},t.className="AdamaxOptimizer",t}(Optimizer);SerializationMap.register(AdamaxOptimizer);var SGDOptimizer=function(e){function t(t){var r=e.call(this)||this;return r.learningRate=t,r.setLearningRate(t),r}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;Object.keys(e).forEach(function(r){var n=e[r],a=ENV.engine.registeredVariables[r];tidy(function(){var e=t.c.mul(n).add(a);a.assign(e)})})},t.prototype.setLearningRate=function(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=keep(scalar(-e))},t.prototype.dispose=function(){this.c.dispose()},t.prototype.getConfig=function(){return{learningRate:this.learningRate}},t.fromConfig=function(e,t){return new e(t.learningRate)},t.className="SGDOptimizer",t}(Optimizer);SerializationMap.register(SGDOptimizer);var MomentumOptimizer=function(e){function t(t,r,n){void 0===n&&(n=!1);var a=e.call(this,t)||this;return a.learningRate=t,a.momentum=r,a.useNesterov=n,a.m=scalar(a.momentum),a.accumulations={},a}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,r=function(r){var a=ENV.engine.registeredVariables[r];null==n.accumulations[r]&&tidy(function(){t.accumulations[r]=zerosLike(a).variable(!1)});var o=n.accumulations[r],i=e[r];tidy(function(){var e,n=t.m.mul(o).add(i);e=t.useNesterov?t.c.mul(i.add(n.mul(t.m))).add(a):t.c.mul(n).add(a),t.accumulations[r].assign(n),a.assign(e)})},n=this;for(var a in e)r(a)},t.prototype.dispose=function(){if(e.prototype.dispose.call(this),this.m.dispose(),null!=this.accumulations)for(var t in this.accumulations)this.accumulations[t].dispose()},t.prototype.setMomentum=function(e){this.momentum=e},t.prototype.getConfig=function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}},t.fromConfig=function(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)},t.className="MomentumOptimizer",t}(SGDOptimizer);SerializationMap.register(MomentumOptimizer);var RMSPropOptimizer=function(e){function t(t,r,n,a,o){void 0===r&&(r=.9),void 0===n&&(n=0),void 0===a&&(a=null),void 0===o&&(o=!1);var i=e.call(this)||this;return i.learningRate=t,i.decay=r,i.momentum=n,i.epsilon=a,i.accumulatedMeanSquares={},i.accumulatedMeanGrads={},i.accumulatedMoments={},i.c=keep(scalar(t)),i.decayScalar=keep(scalar(r)),i.momentumScalar=keep(scalar(n)),i.oneMinusDecay=keep(scalar(1-r)),i.centered=o,null===a&&(a=getOptimizerDefaultEpsilonValue()),i.epsilonScalar=keep(scalar(a)),i}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,r=function(r){var a=ENV.engine.registeredVariables[r];null==n.accumulatedMeanSquares[r]&&tidy(function(){t.accumulatedMeanSquares[r]=zerosLike(a).variable(!1)}),null==n.accumulatedMeanGrads[r]&&n.centered&&tidy(function(){t.accumulatedMeanGrads[r]=zerosLike(a).variable(!1)}),null==n.accumulatedMoments[r]&&tidy(function(){t.accumulatedMoments[r]=zerosLike(a).variable(!1)});var o=n.accumulatedMeanSquares[r],i=n.accumulatedMeanGrads[r],s=n.accumulatedMoments[r],u=e[r];tidy(function(){var e=t.decayScalar.mul(o).add(t.oneMinusDecay.mul(u.square()));if(t.centered){var n=t.decayScalar.mul(i).add(t.oneMinusDecay.mul(u)),l=t.momentumScalar.mul(s).add(t.c.mul(u).div(e.sub(n.square().add(t.epsilonScalar)).sqrt()));t.accumulatedMeanSquares[r].assign(e),t.accumulatedMeanGrads[r].assign(n),t.accumulatedMoments[r].assign(l);var p=a.sub(l);a.assign(p)}else{var c=t.decayScalar.mul(o).add(t.oneMinusDecay.mul(u.square()));l=t.momentumScalar.mul(s).add(t.c.mul(u).div(c.add(t.epsilonScalar).sqrt())),t.accumulatedMeanSquares[r].assign(c),t.accumulatedMoments[r].assign(l),p=a.sub(l),a.assign(p)}})},n=this;for(var a in e)r(a)},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsilonScalar.dispose(),this.decayScalar.dispose(),this.momentumScalar.dispose(),this.oneMinusDecay.dispose(),null!=this.accumulatedMeanSquares&&Object.keys(this.accumulatedMeanSquares).forEach(function(t){return e.accumulatedMeanSquares[t].dispose()}),null!=this.accumulatedMeanGrads&&this.centered&&Object.keys(this.accumulatedMeanGrads).forEach(function(t){return e.accumulatedMeanGrads[t].dispose()}),null!=this.accumulatedMoments&&Object.keys(this.accumulatedMoments).forEach(function(t){return e.accumulatedMoments[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}},t.fromConfig=function(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)},t.className="RMSPropOptimizer",t}(Optimizer);SerializationMap.register(RMSPropOptimizer);var OptimizerConstructors=function(){function e(){}return e.sgd=function(e){return new SGDOptimizer(e)},e.momentum=function(e,t,r){return void 0===r&&(r=!1),new MomentumOptimizer(e,t,r)},e.rmsprop=function(e,t,r,n,a){return void 0===t&&(t=.9),void 0===r&&(r=0),void 0===n&&(n=null),void 0===a&&(a=!1),new RMSPropOptimizer(e,t,r,n,a)},e.adam=function(e,t,r,n){return void 0===e&&(e=.001),void 0===t&&(t=.9),void 0===r&&(r=.999),void 0===n&&(n=null),new AdamOptimizer(e,t,r,n)},e.adadelta=function(e,t,r){return void 0===e&&(e=.001),void 0===t&&(t=.95),void 0===r&&(r=null),new AdadeltaOptimizer(e,t,r)},e.adamax=function(e,t,r,n,a){return void 0===e&&(e=.002),void 0===t&&(t=.9),void 0===r&&(r=.999),void 0===n&&(n=null),void 0===a&&(a=0),new AdamaxOptimizer(e,t,r,n,a)},e.adagrad=function(e,t){return void 0===t&&(t=.1),new AdagradOptimizer(e,t)},e}(),train={sgd:OptimizerConstructors.sgd,momentum:OptimizerConstructors.momentum,adadelta:OptimizerConstructors.adadelta,adagrad:OptimizerConstructors.adagrad,rmsprop:OptimizerConstructors.rmsprop,adamax:OptimizerConstructors.adamax,adam:OptimizerConstructors.adam},setBackend=Environment.setBackend,getBackend=Environment.getBackend,disposeVariables=Environment.disposeVariables,memory=Environment.memory;setOpHandler(ops);var extendStatics$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};function __extends$1(e,t){function r(){this.constructor=e}extendStatics$1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]t?1:0}function reverseNumberCompare(e,t){return-1*numberCompare(e,t)}function stringToDType(e){switch(e){case"float32":return"float32";default:throw new ValueError("Invalid dtype: "+e)}}function unique(e){if(null==e)return e;for(var t=[],r=0,n=e;r=0),assert$1(n>=r),Array.isArray(e)&&e.length>=r&&e.length<=n&&e.every(function(e){return typeof e===t})}function calcL2Norms(e,t){return tidy(function(){return sqrt(sum(mulStrict(e,e),t,!0))})}var Constraint=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends$1(t,e),t.prototype.getConfig=function(){return{}},t}(serialization.Serializable),MaxNorm=function(e){function t(t){var r=e.call(this)||this;return r.defaultMaxValue=2,r.defaultAxis=0,r.maxValue=null!=t.maxValue?t.maxValue:r.defaultMaxValue,r.axis=null!=t.axis?t.axis:r.defaultAxis,r}return __extends$1(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){var r=calcL2Norms(e,t.axis),n=clipByValue(r,0,t.maxValue);return mul(e,div(n,add(getScalar(epsilon()),r)))})},t.prototype.getConfig=function(){return{maxValue:this.maxValue,axis:this.axis}},t.className="MaxNorm",t}(Constraint);serialization.SerializationMap.register(MaxNorm);var UnitNorm=function(e){function t(t){var r=e.call(this)||this;return r.defaultAxis=0,r.axis=null!=t.axis?t.axis:r.defaultAxis,r}return __extends$1(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){return div(e,add(getScalar(epsilon()),calcL2Norms(e,t.axis)))})},t.prototype.getConfig=function(){return{axis:this.axis}},t.className="UnitNorm",t}(Constraint);serialization.SerializationMap.register(UnitNorm);var NonNeg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends$1(t,e),t.prototype.apply=function(e){return relu(e)},t.className="NonNeg",t}(Constraint);serialization.SerializationMap.register(NonNeg);var MinMaxNorm=function(e){function t(t){var r=e.call(this)||this;return r.defaultMinValue=0,r.defaultMaxValue=1,r.defaultRate=1,r.defaultAxis=0,r.minValue=null!=t.minValue?t.minValue:r.defaultMinValue,r.maxValue=null!=t.maxValue?t.maxValue:r.defaultMaxValue,r.rate=null!=t.rate?t.rate:r.defaultRate,r.axis=null!=t.axis?t.axis:r.defaultAxis,r}return __extends$1(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){var r=calcL2Norms(e,t.axis),n=add(mul(getScalar(t.rate),clipByValue(r,t.minValue,t.maxValue)),mul(getScalar(1-t.rate),r));return mul(e,div(n,add(getScalar(epsilon()),r)))})},t.prototype.getConfig=function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}},t.className="MinMaxNorm",t}(Constraint);serialization.SerializationMap.register(MinMaxNorm);var CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function serializeConstraint(e){return serializeKerasObject(e)}function deserializeConstraint(e,t){return void 0===t&&(t={}),deserializeKerasObject(e,serialization.SerializationMap.getMap().classNameMap,t,"constraint")}function getConstraint(e){return null==e?null:"string"==typeof e?deserializeConstraint({className:e in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP?CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[e]:e,config:{}}):e instanceof Constraint?e:deserializeConstraint(e)}function maxNorm(e){return new MaxNorm(e)}function unitNorm(e){return new UnitNorm(e)}function nonNeg(){return new NonNeg}function minMaxNorm(e){return new MinMaxNorm(e)}var exports_constraints=Object.freeze({maxNorm:maxNorm,unitNorm:unitNorm,nonNeg:nonNeg,minMaxNorm:minMaxNorm}),nameMap=new Map,VALID_DATA_FORMAT_VALUES=["channelsFirst","channelsLast"];function checkDataFormat(e){checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES,"DataFormat",e)}var VALID_PADDING_MODE_VALUES=["valid","same","causal"];function checkPaddingMode(e){checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES,"PaddingMode",e)}var VALID_POOL_MODE_VALUES=["max","avg"];function checkPoolMode(e){checkStringTypeUnionValue(VALID_POOL_MODE_VALUES,"PoolMode",e)}var _nameScopeStack=[],_nameScopeDivider="/";function nameScope(e,t){_nameScopeStack.push(e);try{var r=t();return _nameScopeStack.pop(),r}catch(e){throw _nameScopeStack.pop(),e}}function currentNameScopePrefix(){return 0===_nameScopeStack.length?"":_nameScopeStack.join(_nameScopeDivider)+_nameScopeDivider}function getScopedTensorName(e){if(!isValidTensorName(e))throw new Error("Not a valid tensor name: '"+e+"'");return currentNameScopePrefix()+e}function getUniqueTensorName(e){if(!isValidTensorName(e))throw new Error("Not a valid tensor name: '"+e+"'");nameMap.has(e)||nameMap.set(e,0);var t=nameMap.get(e);if(nameMap.set(e,nameMap.get(e)+1),t>0){var r=e+"_"+t;return nameMap.set(r,1),r}return e}var tensorNameRegex=new RegExp(/^[A-Za-z][A-Za-z0-9\._\/]*$/);function isValidTensorName(e){return!!e.match(tensorNameRegex)}function isInteger(e){return e===parseInt(e.toString(),10)}function arrayProd(e,t,r){null==t&&(t=0),null==r&&(r=e.length);for(var n=1,a=t;a2e3&&console.warn("Orthogonal initializer is being called on a matrix with more than 2000 ("+e[0]*e[1]+") elements: Slowness may result.");var t=randomNormal$1(e[0]>e[1]?[e[1],e[0]]:e,0,1,"float32"),n=linalg_ops.gramSchmidt(t);return e[0]>e[1]&&(n=n.transpose()),mul(getScalar(r.gain),n)})},t.prototype.getConfig=function(){return{gain:this.gain,seed:this.seed}},t.className="Orthogonal",t}(Initializer);serialization.SerializationMap.register(Orthogonal);var INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",identity:"Identity",leCunNormal:"LeCunNormal",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function deserializeInitializer(e,t){return void 0===t&&(t={}),deserializeKerasObject(e,serialization.SerializationMap.getMap().classNameMap,t,"initializer")}function serializeInitializer(e){return serializeKerasObject(e)}function getInitializer(e){if("string"==typeof e){var t=e in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP?INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[e]:e;return"GlorotUniform"===t?new GlorotUniform:"GlorotNormal"===t?new GlorotNormal:"HeNormal"===t?new HeNormal:"LeCunNormal"===t?new LeCunNormal:deserializeInitializer({className:t,config:{}})}return e instanceof Initializer?e:deserializeInitializer(e)}function zeros$1(){return new Zeros}function ones$1$1(){return new Ones}function constant(e){return new Constant(e)}function randomUniform$1(e){return new RandomUniform(e)}function randomNormal$2(e){return new RandomNormal(e)}function truncatedNormal$1(e){return new TruncatedNormal(e)}function identity(e){return new Identity(e)}function varianceScaling(e){return new VarianceScaling(e)}function glorotUniform(e){return new GlorotUniform(e)}function glorotNormal(e){return new GlorotNormal(e)}function heNormal(e){return new HeNormal(e)}function leCunNormal(e){return new LeCunNormal(e)}function orthogonal(e){return new Orthogonal(e)}var exports_initializers=Object.freeze({zeros:zeros$1,ones:ones$1$1,constant:constant,randomUniform:randomUniform$1,randomNormal:randomNormal$2,truncatedNormal:truncatedNormal$1,identity:identity,varianceScaling:varianceScaling,glorotUniform:glorotUniform,glorotNormal:glorotNormal,heNormal:heNormal,leCunNormal:leCunNormal,orthogonal:orthogonal});function isArrayOfShapes(e){return Array.isArray(e)&&Array.isArray(e[0])}function normalizeShapeList(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function getExactlyOneTensor(e){var t;if(Array.isArray(e)){if(1!==e.length)throw new ValueError("Expected Tensor length to be 1; got "+e.length);t=e[0]}else t=e;return t}function getExactlyOneShape(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return(e=e)[0];throw new ValueError("Expected exactly 1 Shape; got "+e.length)}return e}function countParamsInWeights(e){for(var t=0,r=0,n=e;r1)throw new AttributeError("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new AttributeError("Layer "+this.name+" is not connected, no input to return.");return singletonOrArray(this.getNodeAtIndex(0,"input").inputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){if(0===this.inboundNodes.length)throw new AttributeError("Layer "+this.name+" has no inbound nodes.");if(this.inboundNodes.length>1)throw new AttributeError("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return singletonOrArray(this.getNodeAtIndex(0,"output").outputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"losses",{get:function(){return this._losses},enumerable:!0,configurable:!0}),t.prototype.calculateLosses=function(){return this.losses.map(function(e){return e()})},Object.defineProperty(t.prototype,"updates",{get:function(){return this._updates},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"built",{get:function(){return this._built},set:function(e){this._built=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.trainable?this._trainableWeights:[]},set:function(e){this._trainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this._nonTrainableWeights:this._trainableWeights.concat(this._nonTrainableWeights)},set:function(e){this._nonTrainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"weights",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stateful",{get:function(){return this._stateful},enumerable:!0,configurable:!0}),t.prototype.assertInputCompatibility=function(e){if(e=toList(e),null!=this.inputSpec&&0!==this.inputSpec.length){var t=toList(this.inputSpec);if(e.length!==t.length)throw new ValueError("Layer "+this.name+" expects "+t.length+" inputs, but it received "+e.length+" input tensors. Input received: "+e);for(var r=0;r=0?i[u]:i[i.length+u];if(null!=l&&-1===[l,null].indexOf(p))throw new ValueError("Input "+r+" is incompatible with layer "+this.name+": expected axis "+u+" of input shape to have value "+l+" but got shape "+i+".")}}if(null!=a.shape)for(var c=0;c0&&Array.isArray(f[0])?f.map(function(n,a){return new SymbolicTensor(g,n,r,toList(e),t,r.name,a)}):new SymbolicTensor(g,f,r,toList(e),t,r.name),r.addInboundNode(e,m,null,null,h,f,t),null!=r.activityRegularizer)throw new NotImplementedError("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return m})},t.prototype.warnOnIncompatibleInputShape=function(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn("The rank of the input tensor provided (shape: "+JSON.stringify(e)+") does not match that of the batchInputShape ("+JSON.stringify(this.batchInputShape)+") of the layer "+this.name);else{var t=!1;this.batchInputShape.forEach(function(r,n){null!=r&&null!=e[n]&&e[n]!==r&&(t=!0)}),t&&console.warn("The shape of the input tensor ("+JSON.stringify(e)+") does not match the expectation of layer "+this.name+": "+JSON.stringify(this.batchInputShape))}},Object.defineProperty(t.prototype,"outputShape",{get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new AttributeError("The layer "+this.name+" has never been called and thus has no defined output shape.");for(var e=[],t=0,r=this.inboundNodes;t0)&&(t=e.sourceLayer,r=e.nodeIndex),0===t.inboundNodes.length)return[e];var n=t.inboundNodes[r];if(0===n.inboundLayers.length)return n.inputTensors;for(var a=[],o=0;o1||1===s.length&&s[0].inboundLayers.length>1){t=!1;break}n.push.apply(n,s)}if(t)for(var u=0,l=e.layers;u0&&(n=n.slice(0,n.length-1)+" "),n=(n+=e[a]).slice(0,t[a]),n+=" ".repeat(t[a]-n.length);r(n)}function printLayerSummary(e,t,r){var n;try{n=JSON.stringify(e.outputShape)}catch(e){n="multiple"}printRow([e.name+" ("+e.getClassName()+")",n,e.countParams().toString()],t,r)}function printLayerSummaryWithConnections(e,t,r,n){var a;try{a=JSON.stringify(e.outputShape)}catch(e){a="multiple"}for(var o=[],i=0,s=e.inboundNodes;i0&&-1===r.indexOf(u)))for(var l=0;l0)throw new ValueError(c.length+" of "+n+" weights are not set: "+c);batchSetValue(l)}var Container=function(e){function t(r){var n=e.call(this,{})||this;if(n.containerNodes=new Set,n.name=r.name,null==n.name){var a=n.getClassName().toLowerCase();n.name=getUid(a)}if(n.supportsMasking=!1,n.trainable=!0,n.updatable=!0,Array.isArray(r.inputs)?n.inputs=r.inputs.slice():n.inputs=[r.inputs],Array.isArray(r.outputs)?n.outputs=r.outputs.slice():n.outputs=[r.outputs],unique(n.inputs).length!==n.inputs.length)throw new ValueError("The list of inputs passed to the model is redundant. All inputs should only appear once. Found: "+n.inputs.map(function(e){return e.name}));unique(n.outputs).length!==n.outputs.length&&console.warn("The list of outputs passed to the model is redundant. All outputs should only appear once. Found: "+n.outputs.map(function(e){return e.name})),n.inputLayers=[],n.inputLayersNodeIndices=[],n.inputLayersTensorIndices=[],n.outputLayers=[],n.outputLayersNodeIndices=[],n.outputLayersTensorIndices=[],n.layers=[];for(var o=0,i=n.outputs;o1 nodes"),assert$1(0===l,"input layer has >1 tensors"),n.inputLayers.push(s),n.inputLayersNodeIndices.push(u),n.inputLayersTensorIndices.push(l);n.inputNames=[],n.outputNames=[],n.feedInputShapes=[],n.feedInputNames=[],n.feedOutputNames=[];for(var d=0;d=0;)a.splice(a.indexOf(u),1);x.push(u)}},S=[],N=[],T=0,E=n.outputs;Tn?1:0});for(var U=0,W=$;U0)throw new ValueError("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];for(var e=[],t=0,r=this.layers;t1)for(var s=0,u=i;s0){for(var h=[],f=0;f0&&e.apply(singletonOrArray(o),n)}function i(e){var n=e.name,o=deserialize(e,null!=t.customObjects?t.customObjects:{});r[n]=o;for(var i=0,s=e.inboundNodes;i0)o=!0;else if(isDataDict(e)){for(var i in e)if(e.hasOwnProperty(i)){o=!0;break}}else o=!0;if(o)throw new ValueError("Error when checking model "+a+" expected no data, but got "+e)}return[]}if(null==e)return t.map(function(e){return null});var s;if(isDataDict(e)){e=e,s=[];for(var u=0,l=t;u1)throw new ValueError("The model "+a+" expects "+t.length+" Tensor(s), but only received one Tensor. Found: Tensor with shape "+e.shape);s=[e]}for(var c=0;c=0&&f!==m)throw new ValueError("Error when checking "+a+": expected "+t[c]+" to have shape ["+r[c]+"], but got array with shape ["+d.shape+"].")}}return s}function checkArrayLengths(e,t,r){var n=unique(e.map(function(e){return e.shape[0]}));n.sort();var a=unique(t.map(function(e){return e.shape[0]}));if(a.sort(),n.length>1)throw new ValueError("All input Tensors (x) should have the same number of samples. Got array shapes: "+JSON.stringify(e.map(function(e){return e.shape})));if(a.length>1)throw new ValueError("All target Tensors (y) should have the same number of samples. Got array shapes: "+JSON.stringify(t.map(function(e){return e.shape})));if(n.length>0&&a.length>0&&!util.arraysEqual(n,a))throw new ValueError("Input Tensors should have the same number of samples as target Tensors. Found "+n[0]+" input sample(s) and "+a[0]+" target sample(s).")}function checkLossAndTargetCompatibility(e,t,r){for(var n=[meanSquaredError$1,binaryCrossentropy,categoricalCrossentropy],a=0;a=e&&(a=e),r.push([n,a]),n=a;return r}function sliceArrays(e,t,r){return null==e?[null]:Array.isArray(e)?e.map(function(e){return sliceAlongFirstAxis(e,t,r-t)}):sliceAlongFirstAxis(e,t,r-t)}function sliceArraysByIndices(e,t){return tidy(function(){return null==e?null:Array.isArray(e)?e.map(function(e){return sliceArraysByIndices(e,t)}):gather$1(e,"int32"===t.dtype?t:t.toInt())})}function checkInputData(e,t,r,n,a){var o;if(void 0===n&&(n=!0),void 0===a&&(a=""),Array.isArray(e)){if(e.length!==t.length)throw new ValueError("Error when checking model "+a+": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see "+t.length+" Tensor(s), but instead got "+e.length+" Tensors(s).");o=e}else{if(t.length>1)throw new ValueError("The model expects "+t.length+" "+a+" Tensors, but only received one Tensor. Found: array with shape "+JSON.stringify(e.shape)+".");o=[e]}if(null!=r)for(var i=0;i1&&(t.metricsTensors.push([r,e]),t.metricsNames.push(t.outputNames[e]+"_loss"))}});var c=collectMetrics(e.metrics,this.outputNames);nameScope("metric",function(){for(var e=function(e){if(-1!==p.indexOf(e))return"continue";!function(r){for(var n,a,o,i=function(r){if(-1!==["accuracy","acc","crossentropy","ce"].indexOf(r)){var i=t.internalOutputShapes[e];1===i[i.length-1]||t.lossFunctions[e]===binaryCrossentropy?-1!==["accuracy","acc"].indexOf(r)?a=binaryAccuracy:-1!==["crossentropy","ce"].indexOf(r)&&(a=binaryCrossentropy$1):t.lossFunctions[e]===sparseCategoricalCrossentropy?-1!==["accuracy","acc"].indexOf(r)?a=sparseCategoricalAccuracy:-1!==["crossentropy","ce"].indexOf(r)&&(a=sparseCategoricalCrossentropy$1):-1!==["accuracy","acc"].indexOf(r)?a=categoricalAccuracy:-1!==["crossentropy","ce"].indexOf(r)&&(a=categoricalCrossentropy$1);var s=void 0;-1!==["accuracy","acc"].indexOf(r)?s="acc":-1!==["crossentropy","ce"].indexOf(r)&&(s="ce"),o=a,n=""+s}else{var u=get$1(r);o=u,n=""+r}var l;nameScope(n,function(){l=o}),function(e,r,n){t.outputNames.length>1&&(r=t.outputNames[e]+"_"+r),t.metricsNames.push(r),t.metricsTensors.push([n,e])}(e,n,l)},s=0,u=c[e];s0){var p=[];throw t.forEach(function(t,r){null==t&&p.push(e[r])}),new ValueError("Cannot find SymbolicTensors for output name(s): "+JSON.stringify(p))}return t},t.prototype.predictLoop=function(e,t,r){var n=this;return void 0===t&&(t=32),void 0===r&&(r=!1),tidy(function(){var a=n.checkNumSamples(e);if(r)throw new NotImplementedError("Verbose predictLoop() is not implemented yet.");for(var o=makeBatches(a,t),i=[],s=function(t){var r=tidy(function(){var r=o[t][0],a=o[t][1],i=sliceArrays(e,r,a),s=[];if(Array.isArray(i))for(var u=0;u0&&e[0].shape[0]%n!=0)throw new ValueError("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size "+n+". Found: "+e[0].shape[0]+" sample(s).");return[e,t,null]},t.prototype.fitLoop=function(e,t,r,n,a,o,i,s,u,l,p,c,d,h){return __awaiter$1(this,void 0,void 0,function(){var f,m,g,y,v,b,x,w=this;return __generator$1(this,function(S){switch(S.label){case 0:if(null==n&&(n=32),null==a&&(a=1),null==l&&(l=!0),null==c&&(c=0),f=!1,null!=s&&null!=u&&(f=!0),null!=h&&(f=!0,null==d))throw new ValueError("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");if(null!=(m=this.checkNumSamples(t,n,d,"steps_per_epoch"))&&(g=range$1(0,m)),this.history=new History,i=(i=null==i?[new BaseLogger]:[new BaseLogger].concat(i)).concat([this.history]),o>0)throw new NotImplementedError("Verbose mode is not implemented yet.");return(y=new CallbackList(i)).setModel(this),y.setParams({epochs:a,initialEpoch:c,steps:d,verbose:o,doValidation:f,metrics:p}),[4,y.onTrainBegin()];case 1:S.sent(),this.stopTraining=!1,v=function(a){var o,i,p,c,h;return __generator$1(this,function(v){switch(v.label){case 0:return[4,y.onEpochBegin(a)];case 1:if(v.sent(),o={},null==d)return[3,2];throw new NotImplementedError("stepsPerEpoch mode is not implemented yet.");case 2:if("batch"===l)throw new NotImplementedError("batch shuffling is not implemneted yet");l&&util.shuffle(g),i=tensor1d(g),p=makeBatches(m,n),c=function(a){var l;return __generator$1(this,function(c){switch(c.label){case 0:return l={},[4,y.onBatchBegin(a,l)];case 1:return c.sent(),tidy(function(){var c=p[a][0],d=p[a][1],h=sliceAlongFirstAxis(i,c,d-c);l.batch=a,l.size=d-c;for(var m=sliceArraysByIndices(t,h),g=e(m),y=0;y1&&(a+="_"+count(e.slice(0,r),n)),t.push(a)}return t},t.prototype.makeTestFunction=function(){var e=this;this.testFunction=function(t){return tidy(function(){for(var r,n=[],a=t.slice(0,e.inputs.length),o=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),i=[],s=0;s0){if(s=!0,2!==r.validationData.length)throw 3===r.validationData.length?new NotImplementedError("validationData including sample weights is not supported yet."):new ValueError("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; "+r.validationData+" is invalid.");u=r.validationData[0],l=r.validationData[1],d=this.standardizeUserData(u,l,!0,n),u=d[0],l=d[1],p=u.concat(l)}else null!=r.validationSplit&&r.validationSplit>0&&r.validationSplit<1?(s=!0,h=Math.floor(o[0].shape[0]*(1-r.validationSplit)),f=o[0].shape[0],u=sliceArrays(o,h,f),o=sliceArrays(o,0,h),l=sliceArrays(i,h,f),i=sliceArrays(i,0,h),c=!0,p=u.concat(l)):null!=r.validationSteps&&(s=!0);return m=o.concat(i),this.checkTrainableWeightsConsistency(),g=function(e){var t=e.slice(0,S.inputs.length),r=e.slice(S.inputs.length,S.inputs.length+S.outputs.length),n=[],a=S.collectedTrainableWeights.map(function(e){return e.read()});return[S.optimizer.minimize(function(){for(var e=[],a=0;a1)throw new ValueError("Found more than one ("+r.length+") save handlers for URL '"+e+"'");e=r[0]}if(null==e.save)throw new ValueError("Model.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return[4,io.encodeWeights(this.getNamedWeights(t))];case 1:return n=s.sent(),a=!1,o=null,i=this.toJSON(o,a),[2,e.save({modelTopology:i,weightData:n.data,weightSpecs:n.specs})]}})})},t.className="Model",t}(Container);function loadModelInternal(e){return __awaiter$1(this,void 0,void 0,function(){var t;return __generator$1(this,function(r){if("string"==typeof e){if(0===(t=io.getLoadHandlers(e)).length)t.push(io.browserHTTPRequest(e));else if(t.length>1)throw new ValueError("Found more than one ("+t.length+") load handlers for URL '"+e+"'");e=t[0]}return[2,loadModelFromIOHandler(e)]})})}function loadModelFromIOHandler(e,t){return __awaiter$1(this,void 0,void 0,function(){var r,n,a,o,i;return __generator$1(this,function(s){switch(s.label){case 0:if(null==e.load)throw new ValueError("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");return[4,e.load()];case 1:if(r=s.sent(),null!=(n=r.modelTopology).model_config&&(n=n.model_config),a=deserialize(convertPythonicToTs(n),t),null!=r.weightData){if(null==r.weightSpecs)throw new ValueError("Model artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");o=!1,i=!0,a.loadWeights(io.decodeWeights(r.weightData,r.weightSpecs),o,i)}return[2,a]}})})}serialization.SerializationMap.register(Model);var Sequential=function(e){function t(t){var r=e.call(this,{inputs:[],outputs:[]})||this;if(t=t||{},r.trainable=!0,r._updatable=!0,r.built=!1,r.name=null!=t.name?t.name:getUid("sequential_"),null!=t.layers)for(var n=0,a=t.layers;n 0 but got "+JSON.stringify(e.filters))},t}(BaseConv),Conv2D=function(e){function t(r){var n=e.call(this,2,r)||this;return t.verifyConfig(r),n}return __extends$1(t,e),t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.rank,t},t.verifyConfig=function(e){if("number"!=typeof e.kernelSize&&!checkArrayTypeAndLength(e.kernelSize,"number",1,2))throw new ValueError("Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received "+JSON.stringify(e.kernelSize)+".")},t.className="Conv2D",t}(Conv);serialization.SerializationMap.register(Conv2D);var Conv2DTranspose=function(e){function t(t){var r=e.call(this,t)||this;if(r.inputSpec=[new InputSpec({ndim:4})],"same"!==r.padding&&"valid"!==r.padding)throw new ValueError("Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode "+r.padding);return r}return __extends$1(t,e),t.prototype.build=function(e){if(4!==(e=getExactlyOneShape(e)).length)throw new ValueError("Input should have rank 4; Received input shape: "+JSON.stringify(e));var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ValueError("The channel dimension of the inputs should be defined. Found `None`.");var r,n=e[t],a=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",a,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new InputSpec({ndim:4,axes:(r={},r[t]=n,r)})],this.built=!0},t.prototype.call=function(e,t){var r=this;return tidy(function(){var t=getExactlyOneTensor(e);if(4!==t.shape.length)throw new ValueError("Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-"+t.shape.length);var n,a,o=t.shape,i=o[0];"channelsFirst"===r.dataFormat?(n=2,a=3):(n=1,a=2);var s=o[n],u=o[a],l=r.kernelSize[0],p=r.kernelSize[1],c=r.strides[0],d=r.strides[1],h=[i,deconvLength(s,c,l,r.padding),deconvLength(u,d,p,r.padding),r.filters];"channelsLast"!==r.dataFormat&&(t=transpose(t,[0,2,3,1]));var f=conv2dTranspose(t,r.kernel.read(),h,r.strides,r.padding);return"channelsLast"!==r.dataFormat&&(f=transpose(f,[0,3,1,2])),null!=r.bias&&(f=biasAdd(f,r.bias.read(),r.dataFormat)),null!=r.activation&&(f=r.activation.apply(f)),f})},t.prototype.computeOutputShape=function(e){var t,r,n,a=(e=getExactlyOneShape(e)).slice();"channelsFirst"===this.dataFormat?(t=1,r=2,n=3):(t=3,r=1,n=2);var o=this.kernelSize[0],i=this.kernelSize[1],s=this.strides[0],u=this.strides[1];return a[t]=this.filters,a[r]=deconvLength(a[r],s,o,this.padding),a[n]=deconvLength(a[n],u,i,this.padding),a},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.dilationRate,t},t.className="Conv2DTranspose",t}(Conv2D);serialization.SerializationMap.register(Conv2DTranspose);var SeparableConv=function(e){function t(t,r){var n=e.call(this,t,r)||this;if(n.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",n.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",n.depthwiseKernel=null,n.pointwiseKernel=null,null==r.filters)throw new ValueError("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=r.kernelInitializer||null!=r.kernelRegularizer||null!=r.kernelConstraint)throw new ValueError("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=r.padding&&"same"!==r.padding&&"valid"!==r.padding)throw new ValueError("SeparableConv"+n.rank+"D supports only padding modes: 'same' and 'valid', but received "+JSON.stringify(r.padding));return n.depthMultiplier=null==r.depthMultiplier?1:r.depthMultiplier,n.depthwiseInitializer=getInitializer(r.depthwiseInitializer||n.DEFAULT_DEPTHWISE_INITIALIZER),n.depthwiseRegularizer=getRegularizer(r.depthwiseRegularizer),n.depthwiseConstraint=getConstraint(r.depthwiseConstraint),n.pointwiseInitializer=getInitializer(r.depthwiseInitializer||n.DEFAULT_POINTWISE_INITIALIZER),n.pointwiseRegularizer=getRegularizer(r.pointwiseRegularizer),n.pointwiseConstraint=getConstraint(r.pointwiseConstraint),n}return __extends$1(t,e),t.prototype.build=function(e){if((e=getExactlyOneShape(e)).length1)throw new ValueError("Can not merge tensors with different batch sizes. Got tensors with shapes: "+JSON.stringify(e)+".");for(var a=null==e[0]?null:e[0].slice(1),o=1;o1){var y=range$1(1,s).concat([0]);t.push(transpose(d,y)),l=!0}else t.push(d)}var v=r.mergeFunction(t),b=v.rank;if(l)if(null==b){var x=v.shape;m=[f=x[x.length-1]].concat(x.slice(0,x.length-1)),v=transpose(v.reshape([-1,f]),[1,0]).reshape(m)}else b>1&&(y=[b-1].concat(range$1(0,b-1)),v=transpose(v,y));return v}return r.mergeFunction(e)})},t.prototype.computeOutputShape=function(e){var t;t=null==(e=e)[0]?null:e[0].slice(1);for(var r=1;r1)throw new ValueError("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}},t.prototype.mergeFunction=function(e){var t=this;return tidy(function(){return concatenate(e,t.axis)})},t.prototype.computeOutputShape=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new ValueError("A `Concatenate` layer should be called on a list of inputs.");for(var t=e,r=t[0].slice(),n=this.axis<0?r.length+this.axis:this.axis,a=0,o=t.slice(1);a=0?this.axis:this.axis+e.length,r=e[t];if(null==r)throw new ValueError("Axis "+t+" of input tensor should have a defined dimension but the layer received an input with shape "+JSON.stringify(e)+".");this.inputSpec=[new InputSpec({ndim:e.length,axes:(n={},n[t]=r,n)})];var n,a=[r];this.scale&&(this.gamma=this.addWeight("gamma",a,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",a,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",a,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",a,null,this.movingVarianceInitializer,null,!1),this.built=!0},t.prototype.call=function(e,t){var r=this;return tidy(function(){var n=null!=t.training&&t.training,a=getExactlyOneTensor(e),o=a.shape,i=o.length,s=range$1(0,i),u=r.axis>=0?r.axis:r.axis+i;s.splice(u,1);var l=pyListRepeat(1,i);l[u]=o[u];var p=s.slice();p.sort();var c=!util.arraysEqual(p,range$1(0,i).slice(0,i-1));if(!n)return function(){if(c){var e=r.movingMean.read().reshape(l),t=r.movingVariance.read().reshape(l),n=r.center?r.beta.read().reshape(l):null,o=r.scale?r.gamma.read().reshape(l):null;return batchNormalization$1(a,e,t,n,o,r.epsilon)}return batchNormalization$1(a,r.movingMean.read(),r.movingVariance.read(),null==r.beta?null:r.beta.read(),null==r.gamma?null:r.gamma.read(),r.epsilon)}();var d=normalizeBatchInTraining(a,r.gamma.read(),r.beta.read(),s,r.epsilon),h=d[0],f=d[1],m=d[2],g=arrayProd(s.map(function(e){return a.shape[e]})),y=m.mul(getScalar(g/(g-(1+r.epsilon))));return function(){r.stepCount++;var e=movingAverage(r.movingMean.read(),f,r.momentum,r.stepCount);r.movingMean.write(e);var t=movingAverage(r.movingVariance.read(),y,r.momentum,r.stepCount);r.movingVariance.write(t)}(),h})},t.prototype.getConfig=function(){var t={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:serializeInitializer(this.betaInitializer),gammaInitializer:serializeInitializer(this.gammaInitializer),movingMeanInitializer:serializeInitializer(this.movingMeanInitializer),movingVarianceInitializer:serializeInitializer(this.movingVarianceInitializer),betaRegularizer:serializeRegularizer(this.betaRegularizer),gammaRegularizer:serializeRegularizer(this.gammaRegularizer),betaConstraint:serializeConstraint(this.betaConstraint),gammaConstraint:serializeConstraint(this.gammaConstraint)},r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t.className="BatchNormalization",t}(Layer);function spatial2dPadding(e,t,r){return tidy(function(){if(4!==e.rank)throw new ValueError("temporalPadding expects input tensor to be 4-D, but received a "+e.rank+"-D tensor.");if(null==t&&(t=[[1,1],[1,1]]),2!==t.length||2!==t[0].length||2!==t[1].length)throw new ValueError("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==r&&(r=imageDataFormat()),"channelsLast"!==r&&"channelsFirst"!==r)throw new ValueError("Unknown data format: "+r+". Supported data formats are 'channelsLast' and 'channelsFirst.");var n;return n="channelsFirst"===r?[[0,0],[0,0],t[0],t[1]]:[[0,0],t[0],t[1],[0,0]],pad(e,n)})}serialization.SerializationMap.register(BatchNormalization);var ZeroPadding2D=function(e){function t(t){var r=this;if(null==t&&(t={}),(r=e.call(this,t)||this).dataFormat=null==t.dataFormat?imageDataFormat():t.dataFormat,null==t.padding)r.padding=[[1,1],[1,1]];else if("number"==typeof t.padding)r.padding=[[t.padding,t.padding],[t.padding,t.padding]];else{if(t.padding=t.padding,2!==t.padding.length)throw new ValueError("ZeroPadding2D expects padding to be a length-2 array, but received a length-"+t.padding.length+" array.");var n=void 0,a=void 0;if("number"==typeof t.padding[0])n=[t.padding[0],t.padding[0]],a=[t.padding[1],t.padding[1]];else{if(t.padding=t.padding,2!==t.padding[0].length)throw new ValueError("ZeroPadding2D expects height padding to be a length-2 array, but received a length-"+t.padding[0].length+" array.");if(n=t.padding[0],2!==t.padding[1].length)throw new ValueError("ZeroPadding2D expects width padding to be a length-2 array, but received a length-"+t.padding[1].length+" array.");a=t.padding[1]}r.padding=[n,a]}return r.inputSpec=[new InputSpec({ndim:4})],r}return __extends$1(t,e),t.prototype.computeOutputShape=function(e){var t,r;return e=getExactlyOneShape(e),"channelsFirst"===this.dataFormat?(t=null!=e[2]&&e[2]>=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,r=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,r]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,r=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,r,e[3]])},t.prototype.call=function(e,t){var r=this;return tidy(function(){return spatial2dPadding(getExactlyOneTensor(e),r.padding,r.dataFormat)})},t.prototype.getConfig=function(){var t={padding:this.padding,dataFormat:this.dataFormat},r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t.className="ZeroPadding2D",t}(Layer);function pool2d(e,t,r,n,a,o){return tidy(function(){var i;checkDataFormat(a),checkPoolMode(o),checkPaddingMode(n),null==r&&(r=[1,1]),null==n&&(n="valid"),null==a&&(a=imageDataFormat()),null==o&&(o="max"),e=preprocessConv2DInput(e,a);var s="same"===n?"same":"valid";return i="max"===o?maxPool(e,t,r,s):avgPool(e,t,r,s),"channelsFirst"===a&&(i=transpose(i,[0,3,1,2])),i})}serialization.SerializationMap.register(ZeroPadding2D);var Pooling1D=function(e){function t(t){var r=this;if(null==t.poolSize&&(t.poolSize=2),r=e.call(this,t)||this,"number"==typeof t.poolSize)r.poolSize=[t.poolSize];else{if(!Array.isArray(t.poolSize)||1!==t.poolSize.length||"number"!=typeof t.poolSize[0])throw new ValueError("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(t.poolSize));r.poolSize=t.poolSize}if(null==t.strides)r.strides=r.poolSize;else if("number"==typeof t.strides)r.strides=[t.strides];else{if(!Array.isArray(t.strides)||1!==t.strides.length||"number"!=typeof t.strides[0])throw new ValueError("strides for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(t.strides));r.strides=t.strides}return r.padding=null==t.padding?"valid":t.padding,checkPaddingMode(r.padding),r.inputSpec=[new InputSpec({ndim:3})],r}return __extends$1(t,e),t.prototype.computeOutputShape=function(e){var t=convOutputLength((e=getExactlyOneShape(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]},t.prototype.call=function(e,t){var r=this;return tidy(function(){r.invokeCallHook(e,t),e=expandDims$1(getExactlyOneTensor(e),2);var n=r.poolingFunction(getExactlyOneTensor(e),[r.poolSize[0],1],[r.strides[0],1],r.padding,"channelsLast");return squeeze(n,[2])})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides},r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t}(Layer),MaxPooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends$1(t,e),t.prototype.poolingFunction=function(e,t,r,n,a){return checkDataFormat(a),checkPaddingMode(n),pool2d(e,t,r,n,a,"max")},t.className="MaxPooling1D",t}(Pooling1D);serialization.SerializationMap.register(MaxPooling1D);var AveragePooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends$1(t,e),t.prototype.poolingFunction=function(e,t,r,n,a){return checkDataFormat(a),checkPaddingMode(n),pool2d(e,t,r,n,a,"avg")},t.className="AveragePooling1D",t}(Pooling1D);serialization.SerializationMap.register(AveragePooling1D);var Pooling2D=function(e){function t(t){var r=this;if(null==t.poolSize&&(t.poolSize=[2,2]),(r=e.call(this,t)||this).poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize],null==t.strides)r.strides=r.poolSize;else if(Array.isArray(t.strides)){if(2!==t.strides.length)throw new ValueError("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length "+t.strides.length+".");r.strides=t.strides}else r.strides=[t.strides,t.strides];return r.padding=null==t.padding?"valid":t.padding,r.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,checkDataFormat(r.dataFormat),checkPaddingMode(r.padding),r.inputSpec=[new InputSpec({ndim:4})],r}return __extends$1(t,e),t.prototype.computeOutputShape=function(e){e=getExactlyOneShape(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],r="channelsFirst"===this.dataFormat?e[3]:e[2];return t=convOutputLength(t,this.poolSize[0],this.padding,this.strides[0]),r=convOutputLength(r,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,r]:[e[0],t,r,e[3]]},t.prototype.call=function(e,t){var r=this;return tidy(function(){return r.invokeCallHook(e,t),r.poolingFunction(getExactlyOneTensor(e),r.poolSize,r.strides,r.padding,r.dataFormat)})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t}(Layer),MaxPooling2D=function(e){function t(t){return e.call(this,t)||this}return __extends$1(t,e),t.prototype.poolingFunction=function(e,t,r,n,a){return checkDataFormat(a),checkPaddingMode(n),pool2d(e,t,r,n,a,"max")},t.className="MaxPooling2D",t}(Pooling2D);serialization.SerializationMap.register(MaxPooling2D);var AveragePooling2D=function(e){function t(t){return e.call(this,t)||this}return __extends$1(t,e),t.prototype.poolingFunction=function(e,t,r,n,a){return checkDataFormat(a),checkPaddingMode(n),pool2d(e,t,r,n,a,"avg")},t.className="AveragePooling2D",t}(Pooling2D);serialization.SerializationMap.register(AveragePooling2D);var GlobalPooling1D=function(e){function t(t){var r=e.call(this,t)||this;return r.inputSpec=[new InputSpec({ndim:3})],r}return __extends$1(t,e),t.prototype.computeOutputShape=function(e){return[e[0],e[2]]},t.prototype.call=function(e,t){throw new NotImplementedError},t}(Layer),GlobalAveragePooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends$1(t,e),t.prototype.call=function(e,t){return tidy(function(){var t=getExactlyOneTensor(e);return mean(t,1)})},t.className="GlobalAveragePooling1D",t}(GlobalPooling1D);serialization.SerializationMap.register(GlobalAveragePooling1D);var GlobalMaxPooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends$1(t,e),t.prototype.call=function(e,t){return tidy(function(){var t=getExactlyOneTensor(e);return max(t,1)})},t.className="GlobalMaxPooling1D",t}(GlobalPooling1D);serialization.SerializationMap.register(GlobalMaxPooling1D);var GlobalPooling2D=function(e){function t(t){var r=e.call(this,t)||this;return r.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,checkDataFormat(r.dataFormat),r.inputSpec=[new InputSpec({ndim:4})],r}return __extends$1(t,e),t.prototype.computeOutputShape=function(e){return e=e,"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]},t.prototype.call=function(e,t){throw new NotImplementedError},t.prototype.getConfig=function(){var t={dataFormat:this.dataFormat},r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t}(Layer),GlobalAveragePooling2D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends$1(t,e),t.prototype.call=function(e,t){var r=this;return tidy(function(){var t=getExactlyOneTensor(e);return"channelsLast"===r.dataFormat?mean(t,[1,2]):mean(t,[2,3])})},t.className="GlobalAveragePooling2D",t}(GlobalPooling2D);serialization.SerializationMap.register(GlobalAveragePooling2D);var GlobalMaxPooling2D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends$1(t,e),t.prototype.call=function(e,t){var r=this;return tidy(function(){var t=getExactlyOneTensor(e);return"channelsLast"===r.dataFormat?max(t,[1,2]):max(t,[2,3])})},t.className="GlobalMaxPooling2D",t}(GlobalPooling2D);function standardizeArgs(e,t,r,n){if(Array.isArray(e)){if(null!=t||null!=r)throw new ValueError("When inputs is an array, neither initialState or constants should be provided");null!=n&&(r=e.slice(e.length-n,e.length),e=e.slice(0,e.length-n)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function a(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=a(t),constants:r=a(r)}}function rnn(e,t,r,n,a,o,i,s){void 0===n&&(n=!1),void 0===i&&(i=!1);var u=t.shape.length;if(u<3)throw new ValueError("Input should be at least 3D, but is "+u+"D.");var l,p,c=[1,0].concat(range$1(2,u));if(t=transpose(t,c),null!=a)throw new NotImplementedError("The rnn() function of the deeplearn.js backend does not support masking yet.");if(null!=o)throw new NotImplementedError("The rnn() functoin of the deeplearn.js backend does not support constants yet.");i&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),n&&(t=reverse(t,0));for(var d=r,h=t.shape[0],f=0;f1?tile$1(r,[1,e]):r}):t.cell.stateSize>1?[tile$1(r,[1,t.cell.stateSize])]:[r]})},Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),t.prototype.getConfig=function(){var t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);var r=this.cell.getConfig();t.cell={className:this.cell.getClassName(),config:r};var n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="RNN",t}(Layer);serialization.SerializationMap.register(RNN);var RNNCell=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends$1(t,e),t}(Layer),SimpleRNNCell=function(e){function t(t){var r=e.call(this,t)||this;return r.DEFAULT_ACTIVATION="tanh",r.DEFAULT_KERNEL_INITIALIZER="glorotNormal",r.DEFAULT_RECURRENT_INITIALIZER="orthogonal",r.DEFAULT_BIAS_INITIALIZER="zeros",r.units=t.units,r.activation=getActivation(null==t.activation?r.DEFAULT_ACTIVATION:t.activation),r.useBias=null==t.useBias||t.useBias,r.kernelInitializer=getInitializer(t.kernelInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.recurrentInitializer=getInitializer(t.recurrentInitializer||r.DEFAULT_RECURRENT_INITIALIZER),r.biasInitializer=getInitializer(t.biasInitializer||r.DEFAULT_BIAS_INITIALIZER),r.kernelRegularizer=getRegularizer(t.kernelRegularizer),r.recurrentRegularizer=getRegularizer(t.recurrentRegularizer),r.biasRegularizer=getRegularizer(t.biasRegularizer),r.kernelConstraint=getConstraint(t.kernelConstraint),r.recurrentConstraint=getConstraint(t.recurrentConstraint),r.biasConstraint=getConstraint(t.biasConstraint),r.dropout=min$1([1,max$1([0,null==t.dropout?0:t.dropout])]),r.recurrentDropout=min$1([1,max$1([0,null==t.recurrentDropout?0:t.recurrentDropout])]),r.stateSize=r.units,r.dropoutMask=null,r.recurrentDropoutMask=null,r}return __extends$1(t,e),t.prototype.build=function(e){e=getExactlyOneShape(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},t.prototype.call=function(e,t){var r=this;return tidy(function(){if(2!==(e=e).length)throw new ValueError("SimpleRNNCell expects 2 input Tensors, got "+e.length+".");var n=e[1];e=e[0];var a,o=null!=t.training&&t.training;01){for(var o=[],i=0;i= 3D, but received input shape "+JSON.stringify(t));this.inputSpec=[{shape:t}];var r=[t[0]].concat(t.slice(2));this.layer.built||(this.layer.build(r),this.layer.built=!0),e.prototype.build.call(this,t)},t.prototype.computeOutputShape=function(e){var t=[(e=getExactlyOneShape(e))[0]].concat(e.slice(2)),r=this.layer.computeOutputShape(t),n=e[1];return[r[0],n].concat(r.slice(1))},t.prototype.call=function(e,t){var r=this;return tidy(function(){return rnn(function(e,n){return[r.layer.call(e,t),[]]},e=getExactlyOneTensor(e),[],!1,null,null,!1,e.shape[1])[1]})},t.className="TimeDistributed",t}(Wrapper);serialization.SerializationMap.register(TimeDistributed);var VALID_BIDIRECTIONAL_MERGE_MODES=["sum","mul","concat","ave"];function checkBidirectionalMergeMode(e){checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES,"BidirectionalMergeMode",e)}var Bidirectional=function(e){function t(t){var r=e.call(this,t)||this,n=t.layer.getConfig();if(r.forwardLayer=deserialize({className:t.layer.getClassName(),config:n}),n.goBackwards=!0!==n.goBackwards,r.backwardLayer=deserialize({className:t.layer.getClassName(),config:n}),r.forwardLayer.name="forward_"+r.forwardLayer.name,r.backwardLayer.name="backward_"+r.backwardLayer.name,checkBidirectionalMergeMode(t.mergeMode),r.mergeMode=t.mergeMode,t.weights)throw new NotImplementedError("weights support is not implemented for Bidirectional layer yet.");return r._stateful=t.layer.stateful,r.returnSequences=t.layer.returnSequences,r.returnState=t.layer.returnState,r.supportsMasking=!0,r._trainable=!0,r.inputSpec=t.layer.inputSpec,r.numConstants=null,r}return __extends$1(t,e),Object.defineProperty(t.prototype,"trainable",{get:function(){return this._trainable},set:function(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)},enumerable:!0,configurable:!0}),t.prototype.getWeights=function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())},t.prototype.setWeights=function(e){var t=e.length,r=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,r)),this.backwardLayer.setWeights(e.slice(r))},t.prototype.computeOutputShape=function(e){var t,r,n,a=this.forwardLayer.computeOutputShape(e);return Array.isArray(a)&&Array.isArray(a[0])||(a=[a]),a=a,this.returnState?(n=a.slice(1),t=a[0]):t=a[0],t=t,"concat"===this.mergeMode?(t[t.length-1]*=2,r=[t]):r=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?r.concat(n).concat(n.slice()):[t].concat(n).concat(n.slice()):singletonOrArray(r)},t.prototype.apply=function(t,r){var n=null==r?null:r.initialState,a=null==r?null:r.constants;null==r&&(r={});var o=standardizeArgs(t,n,a,this.numConstants);if(t=o.inputs,n=o.initialState,a=o.constants,Array.isArray(t)&&(n=t.slice(1),t=t[0]),(null==n||0===n.length)&&null==a)return e.prototype.apply.call(this,t,r);var i=[],s=[];if(null!=n){var u=n.length;if(u%2>0)throw new ValueError("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");r.initialState=n,i.push.apply(i,n);var l=n.map(function(e){return new InputSpec({shape:e.shape})});this.forwardLayer.stateSpec=l.slice(0,u/2),this.backwardLayer.stateSpec=l.slice(u/2),s.push.apply(s,l)}if(null!=a)throw new NotImplementedError("Support for constants in Bidirectional layers is not implemented yet.");for(var p=i[0]instanceof SymbolicTensor,c=0,d=i;c0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=l-p,S=Math.floor,N=String.fromCharCode;function T(e){throw RangeError(x[e])}function E(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function I(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+E((e=e.replace(b,".")).split("."),t).join(".")}function A(e){for(var t,r,n=[],a=0,o=e.length;a=55296&&t<=56319&&a65535&&(t+=N((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+N(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function C(e,t,r){var n=0;for(e=r?S(e/h):e>>1,e+=S(e/t);e>w*c>>1;n+=l)e=S(e/w);return S(n+(w+1)*e/(e+d))}function k(e){var t,r,n,a,o,i,s,d,h,y,v,b=[],x=e.length,w=0,N=m,E=f;for((r=e.lastIndexOf(g))<0&&(r=0),n=0;n=128&&T("not-basic"),b.push(e.charCodeAt(n));for(a=r>0?r+1:0;a=x&&T("invalid-input"),((d=(v=e.charCodeAt(a++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:l)>=l||d>S((u-w)/i))&&T("overflow"),w+=d*i,!(d<(h=s<=E?p:s>=E+c?c:s-E));s+=l)i>S(u/(y=l-h))&&T("overflow"),i*=y;E=C(w-o,t=b.length+1,0==o),S(w/t)>u-N&&T("overflow"),N+=S(w/t),w%=t,b.splice(w++,0,N)}return _(b)}function O(e){var t,r,n,a,o,i,s,d,h,y,v,b,x,w,E,I=[];for(b=(e=A(e)).length,t=m,r=0,o=f,i=0;i=t&&vS((u-r)/(x=n+1))&&T("overflow"),r+=(s-t)*x,t=s,i=0;iu&&T("overflow"),v==t){for(d=r,h=l;!(d<(y=h<=o?p:h>=o+c?c:h-o));h+=l)E=d-y,w=l-y,I.push(N(P(y+E%w,0))),d=S(E/w);I.push(N(P(d,0))),o=C(r,x,n==a),r=0,++n}++r,++t}return I.join("")}if(i={version:"1.3.2",ucs2:{decode:A,encode:_},decode:k,encode:O,toASCII:function(e){return I(e,function(e){return v.test(e)?"xn--"+O(e):e})},toUnicode:function(e){return I(e,function(e){return y.test(e)?k(e.slice(4).toLowerCase()):e})}},n&&a)if(e.exports==n)a.exports=i;else for(s in i)i.hasOwnProperty(s)&&(n[s]=i[s]);else r.punycode=i}(commonjsGlobal$1)}),util$1={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var decode=function(e,t,r,n){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var o=/\+/g;e=e.split(t);var i=1e3;n&&"number"==typeof n.maxKeys&&(i=n.maxKeys);var s=e.length;i>0&&s>i&&(s=i);for(var u=0;u=0?(l=h.substr(0,f),p=h.substr(f+1)):(l=h,p=""),c=decodeURIComponent(l),d=decodeURIComponent(p),hasOwnProperty(a,c)?Array.isArray(a[c])?a[c].push(d):a[c]=[a[c],d]:a[c]=d}return a},stringifyPrimitive=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},encode=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(n){var a=encodeURIComponent(stringifyPrimitive(n))+r;return Array.isArray(e[n])?e[n].map(function(e){return a+encodeURIComponent(stringifyPrimitive(e))}).join(t):a+encodeURIComponent(stringifyPrimitive(e[n]))}).join(t):n?encodeURIComponent(stringifyPrimitive(n))+r+encodeURIComponent(stringifyPrimitive(e)):""},querystring=createCommonjsModule$1(function(e,t){t.decode=t.parse=decode,t.encode=t.stringify=encode}),querystring_1=querystring.decode,querystring_2=querystring.parse,querystring_3=querystring.encode,querystring_4=querystring.stringify,parse=urlParse,format=urlFormat;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function urlParse(e,t,r){if(e&&util$1.isObject(e)&&e instanceof Url)return e;var n=new Url;return n.parse(e,t,r),n}function urlFormat(e){return util$1.isString(e)&&(e=urlParse(e)),e instanceof Url?e.format():Url.prototype.format.call(e)}Url.prototype.parse=function(e,t,r){if(!util$1.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),a=-1!==n&&n127?x+="x":x+=b[w];if(!x.match(hostnamePartPattern)){var N=y.slice(0,f),T=y.slice(f+1),E=b.match(hostnamePartStart);E&&(N.push(E[1]),T.unshift(E[2])),T.length&&(i="/"+T.join(".")+i),this.hostname=N.join(".");break}}}this.hostname.length>hostnameMaxLen?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=punycode.toASCII(this.hostname));var I=this.port?":"+this.port:"",A=this.hostname||"";this.host=A+I,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!unsafeProtocol[l])for(f=0,v=autoEscape.length;f0)&&r.host.split("@"))&&(r.auth=E.shift(),r.host=r.hostname=E.shift())),r.search=e.search,r.query=e.query,util$1.isNull(r.pathname)&&util$1.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!b.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var w=b.slice(-1)[0],S=(r.host||e.host||b.length>1)&&("."===w||".."===w)||""===w,N=0,T=b.length;T>=0;T--)"."===(w=b[T])?b.splice(T,1):".."===w?(b.splice(T,1),N++):N&&(b.splice(T,1),N--);if(!y&&!v)for(;N--;N)b.unshift("..");!y||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),S&&"/"!==b.join("/").substr(-1)&&b.push("");var E,I=""===b[0]||b[0]&&"/"===b[0].charAt(0);return x&&(r.hostname=r.host=I?"":b.length?b.shift():"",(E=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=E.shift(),r.host=r.hostname=E.shift())),(y=y||r.host&&b.length)&&!I&&b.unshift(""),b.length?r.pathname=b.join("/"):(r.pathname=null,r.path=null),util$1.isNull(r.pathname)&&util$1.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},Url.prototype.parseHost=function(){var e=this.host,t=portPattern.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var aspromise=asPromise;function asPromise(e,t){for(var r=new Array(arguments.length-1),n=0,a=2,o=!0;a1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),a=new Array(123),o=0;o<64;)a[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var a,o=null,i=[],s=0,u=0;t>2],a=(3&l)<<4,u=1;break;case 1:i[s++]=n[a|l>>4],a=(15&l)<<2,u=2;break;case 2:i[s++]=n[a|l>>6],i[s++]=n[63&l],u=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),s=0)}return u&&(i[s++]=n[a],i[s++]=61,1===u&&(i[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,i.slice(0,s))),o.join("")):String.fromCharCode.apply(String,i.slice(0,s))},r.decode=function(e,t,r){for(var n,o=r,i=0,s=0;s1)break;if(void 0===(u=a[u]))throw Error("invalid encoding");switch(i){case 0:n=u,i=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,i=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,i=3;break;case 3:t[r++]=(3&n)<<6|u,i=0}}if(1===i)throw Error("invalid encoding");return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}),eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},EventEmitter.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>3.4028234663852886e38)e((a<<31|2139095040)>>>0,r,n);else if(t<1.1754943508222875e-38)e((a<<31|Math.round(t/1.401298464324817e-45))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((a<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function r(e,t,r){var n=e(t,r),a=2*(n>>31)+1,o=n>>>23&255,i=8388607&n;return 255===o?i?NaN:a*(1/0):0===o?1.401298464324817e-45*a*i:a*Math.pow(2,o-150)*(i+8388608)}e.writeFloatLE=t.bind(null,writeUintLE),e.writeFloatBE=t.bind(null,writeUintBE),e.readFloatLE=r.bind(null,readUintLE),e.readFloatBE=r.bind(null,readUintBE)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function a(e,n,a){t[0]=e,n[a]=r[0],n[a+1]=r[1],n[a+2]=r[2],n[a+3]=r[3],n[a+4]=r[4],n[a+5]=r[5],n[a+6]=r[6],n[a+7]=r[7]}function o(e,n,a){t[0]=e,n[a]=r[7],n[a+1]=r[6],n[a+2]=r[5],n[a+3]=r[4],n[a+4]=r[3],n[a+5]=r[2],n[a+6]=r[1],n[a+7]=r[0]}function i(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?a:o,e.writeDoubleBE=n?o:a,e.readDoubleLE=n?i:s,e.readDoubleBE=n?s:i}():function(){function t(e,t,r,n,a,o){var i=n<0?1:0;if(i&&(n=-n),0===n)e(0,a,o+t),e(1/n>0?0:2147483648,a,o+r);else if(isNaN(n))e(0,a,o+t),e(2146959360,a,o+r);else if(n>1.7976931348623157e308)e(0,a,o+t),e((i<<31|2146435072)>>>0,a,o+r);else{var s;if(n<2.2250738585072014e-308)e((s=n/5e-324)>>>0,a,o+t),e((i<<31|s/4294967296)>>>0,a,o+r);else{var u=Math.floor(Math.log(n)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(s=n*Math.pow(2,-u))>>>0,a,o+t),e((i<<31|u+1023<<20|1048576*s&1048575)>>>0,a,o+r)}}}function r(e,t,r,n,a){var o=e(n,a+t),i=e(n,a+r),s=2*(i>>31)+1,u=i>>>20&2047,l=4294967296*(1048575&i)+o;return 2047===u?l?NaN:s*(1/0):0===u?5e-324*s*l:s*Math.pow(2,u-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,writeUintLE,0,4),e.writeDoubleBE=t.bind(null,writeUintBE,4,0),e.readDoubleLE=r.bind(null,readUintLE,0,4),e.readDoubleBE=r.bind(null,readUintBE,4,0)}(),e}function writeUintLE(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function writeUintBE(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function readUintLE(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function readUintBE(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod$$1=eval("quire".replace(/^/,"re"))(moduleName);if(mod$$1&&(mod$$1.length||Object.keys(mod$$1).length))return mod$$1}catch(e){}return null}var utf8_1=createCommonjsModule$1(function(e,t){var r=t;r.length=function(e){for(var t=0,r=0,n=0;n191&&n<224?o[i++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[i++]=55296+(n>>10),o[i++]=56320+(1023&n)):o[i++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),i=0);return a?(i&&a.push(String.fromCharCode.apply(String,o.slice(0,i))),a.join("")):String.fromCharCode.apply(String,o.slice(0,i))},r.write=function(e,t,r){for(var n,a,o=r,i=0;i>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(a=e.charCodeAt(i+1)))?(n=65536+((1023&n)<<10)+(1023&a),++i,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}}),pool_1=pool;function pool(e,t,r){var n=r||8192,a=n>>>1,o=null,i=n;return function(r){if(r<1||r>a)return e(r);i+r>n&&(o=e(n),i=0);var s=t.call(o,i,i+=r);return 7&i&&(i=1+(7|i)),s}}var longbits=LongBits;function LongBits(e,t){this.lo=e>>>0,this.hi=t>>>0}var zero=LongBits.zero=new LongBits(0,0);zero.toNumber=function(){return 0},zero.zzEncode=zero.zzDecode=function(){return this},zero.length=function(){return 1};var zeroHash=LongBits.zeroHash="\0\0\0\0\0\0\0\0";LongBits.fromNumber=function(e){if(0===e)return zero;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new LongBits(r,n)},LongBits.from=function(e){if("number"==typeof e)return LongBits.fromNumber(e);if(minimal.isString(e)){if(!minimal.Long)return LongBits.fromNumber(parseInt(e,10));e=minimal.Long.fromString(e)}return e.low||e.high?new LongBits(e.low>>>0,e.high>>>0):zero},LongBits.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},LongBits.prototype.toLong=function(e){return minimal.Long?new minimal.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var charCodeAt=String.prototype.charCodeAt;LongBits.fromHash=function(e){return e===zeroHash?zero:new LongBits((charCodeAt.call(e,0)|charCodeAt.call(e,1)<<8|charCodeAt.call(e,2)<<16|charCodeAt.call(e,3)<<24)>>>0,(charCodeAt.call(e,4)|charCodeAt.call(e,5)<<8|charCodeAt.call(e,6)<<16|charCodeAt.call(e,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},LongBits.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},LongBits.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10};var minimal=createCommonjsModule$1(function(e,t){var r=t;function n(e,t,r){for(var n=Object.keys(t),a=0;a0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=commonjsGlobal$1.dcodeIO&&commonjsGlobal$1.dcodeIO.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=n,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},r.oneOfSetter=function(e){return function(t){for(var r=0;r127;)t[r++]=127&e|128,e>>>=7;t[r]=e}function VarintOp(e,t){this.len=e,this.next=void 0,this.val=t}function writeVarint64(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function writeFixed32(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}Writer.create=minimal.Buffer?function(){return(Writer.create=function(){return new BufferWriter})()}:function(){return new Writer},Writer.alloc=function(e){return new minimal.Array(e)},minimal.Array!==Array&&(Writer.alloc=minimal.pool(Writer.alloc,minimal.Array.prototype.subarray)),Writer.prototype._push=function(e,t,r){return this.tail=this.tail.next=new Op(e,t,r),this.len+=t,this},VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new VarintOp((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},Writer.prototype.int32=function(e){return e<0?this._push(writeVarint64,10,LongBits$1.fromNumber(e)):this.uint32(e)},Writer.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},Writer.prototype.uint64=function(e){var t=LongBits$1.from(e);return this._push(writeVarint64,t.length(),t)},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(e){var t=LongBits$1.from(e).zzEncode();return this._push(writeVarint64,t.length(),t)},Writer.prototype.bool=function(e){return this._push(writeByte,1,e?1:0)},Writer.prototype.fixed32=function(e){return this._push(writeFixed32,4,e>>>0)},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(e){var t=LongBits$1.from(e);return this._push(writeFixed32,4,t.lo)._push(writeFixed32,4,t.hi)},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(e){return this._push(minimal.float.writeFloatLE,4,e)},Writer.prototype.double=function(e){return this._push(minimal.float.writeDoubleLE,8,e)};var writeBytes=minimal.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(writeByte,1,0);if(minimal.isString(e)){var r=Writer.alloc(t=base64.length(e));base64.decode(e,r,0),e=r}return this.uint32(t)._push(writeBytes,t,e)},Writer.prototype.string=function(e){var t=utf8.length(e);return t?this.uint32(t)._push(utf8.write,t,e):this._push(writeByte,1,0)},Writer.prototype.fork=function(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this},Writer.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},Writer.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},Writer._configure=function(e){BufferWriter=e};var writer_buffer=BufferWriter$1;(BufferWriter$1.prototype=Object.create(writer.prototype)).constructor=BufferWriter$1;var Buffer$1=minimal.Buffer;function BufferWriter$1(){writer.call(this)}BufferWriter$1.alloc=function(e){return(BufferWriter$1.alloc=minimal._Buffer_allocUnsafe)(e)};var writeBytesBuffer=Buffer$1&&Buffer$1.prototype instanceof Uint8Array&&"set"===Buffer$1.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(writeBytesBuffer,t,e),this},BufferWriter$1.prototype.string=function(e){var t=Buffer$1.byteLength(e);return this.uint32(t),t&&this._push(writeStringBuffer,t,e),this};var reader=Reader,BufferReader,LongBits$2=minimal.LongBits,utf8$1=minimal.utf8;function indexOutOfRange(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function Reader(e){this.buf=e,this.pos=0,this.len=e.length}var create_array="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Reader(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Reader(e);throw Error("illegal buffer")};function readLongVarint(){var e=new LongBits$2(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function readFixed32_end(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits$2(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader.create=minimal.Buffer?function(e){return(Reader.create=function(e){return minimal.Buffer.isBuffer(e)?new BufferReader(e):create_array(e)})(e)}:create_array,Reader.prototype._slice=minimal.Array.prototype.subarray||minimal.Array.prototype.slice,Reader.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return e}}(),Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},Reader.prototype.bool=function(){return 0!==this.uint32()},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},Reader.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw indexOutOfRange(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},Reader.prototype.string=function(){var e=this.bytes();return utf8$1.read(e,0,e.length)},Reader.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw indexOutOfRange(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw indexOutOfRange(this)}while(128&this.buf[this.pos++]);return this},Reader.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},Reader._configure=function(e){BufferReader=e;var t=minimal.Long?"toLong":"toNumber";minimal.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader$1;function BufferReader$1(e){reader.call(this,e)}(BufferReader$1.prototype=Object.create(reader.prototype)).constructor=BufferReader$1,minimal.Buffer&&(BufferReader$1.prototype._slice=minimal.Buffer.prototype.slice),BufferReader$1.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))};var service=Service;function Service(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");minimal.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(Service.prototype=Object.create(minimal.EventEmitter.prototype)).constructor=Service,Service.prototype.rpcCall=function e(t,r,n,a,o){if(!a)throw TypeError("request must be specified");var i=this;if(!o)return minimal.asPromise(e,i,t,r,n,a);if(i.rpcImpl)try{return i.rpcImpl(t,r[i.requestDelimited?"encodeDelimited":"encode"](a).finish(),function(e,r){if(e)return i.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof n))try{r=n[i.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return i.emit("error",e,t),o(e)}return i.emit("data",r,t),o(null,r)}i.end(!0)})}catch(e){return i.emit("error",e,t),void setTimeout(function(){o(e)},0)}else setTimeout(function(){o(Error("already ended"))},0)},Service.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};var rpc_1=createCommonjsModule$1(function(e,t){t.Service=service}),roots={},indexMinimal=createCommonjsModule$1(function(e,t){var r=t;function n(){r.Reader._configure(r.BufferReader),r.util._configure()}r.build="minimal",r.Writer=writer,r.BufferWriter=writer_buffer,r.Reader=reader,r.BufferReader=reader_buffer,r.util=minimal,r.rpc=rpc_1,r.roots=roots,r.configure=n,r.Writer._configure(r.BufferWriter),n()}),minimal$1=indexMinimal,minimal_1=minimal$1.roots,minimal_2=minimal$1.Reader,minimal_3=minimal$1.util,$Reader=minimal$1.Reader,$util=minimal$1.util,$root=minimal$1.roots.default||(minimal$1.roots.default={});$root.tensorflow=function(){var e,t,r={};return r.Any=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.typeUrl=e.string();break;case 2:n.value=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),r.DataType=(e={},(t=Object.create(e))[e[0]="DT_INVALID"]=0,t[e[1]="DT_FLOAT"]=1,t[e[2]="DT_DOUBLE"]=2,t[e[3]="DT_INT32"]=3,t[e[4]="DT_UINT8"]=4,t[e[5]="DT_INT16"]=5,t[e[6]="DT_INT8"]=6,t[e[7]="DT_STRING"]=7,t[e[8]="DT_COMPLEX64"]=8,t[e[9]="DT_INT64"]=9,t[e[10]="DT_BOOL"]=10,t[e[11]="DT_QINT8"]=11,t[e[12]="DT_QUINT8"]=12,t[e[13]="DT_QINT32"]=13,t[e[14]="DT_BFLOAT16"]=14,t[e[101]="DT_FLOAT_REF"]=101,t[e[102]="DT_DOUBLE_REF"]=102,t[e[103]="DT_INT32_REF"]=103,t[e[104]="DT_UINT8_REF"]=104,t[e[105]="DT_INT16_REF"]=105,t[e[106]="DT_INT8_REF"]=106,t[e[107]="DT_STRING_REF"]=107,t[e[108]="DT_COMPLEX64_REF"]=108,t[e[109]="DT_INT64_REF"]=109,t[e[110]="DT_BOOL_REF"]=110,t[e[111]="DT_QINT8_REF"]=111,t[e[112]="DT_QUINT8_REF"]=112,t[e[113]="DT_QINT32_REF"]=113,t[e[114]="DT_BFLOAT16_REF"]=114,t),r.TensorShape=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),r=0;r>>3){case 2:n.dim&&n.dim.length||(n.dim=[]),n.dim.push($root.tensorflow.TensorShape.Dim.decode(e,e.uint32()));break;case 3:n.unknownRank=e.bool();break;default:e.skipType(7&a)}}return n},e.Dim=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.size=e.int64();break;case 2:n.name=e.string();break;default:e.skipType(7&a)}}return n},e}(),e}(),r.Tensor=function(){function e(e){if(this.floatVal=[],this.doubleVal=[],this.intVal=[],this.stringVal=[],this.scomplexVal=[],this.int64Val=[],this.boolVal=[],this.uint32Val=[],this.uint64Val=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.dtype=e.int32();break;case 2:n.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 3:n.versionNumber=e.int32();break;case 4:n.tensorContent=e.bytes();break;case 5:if(n.floatVal&&n.floatVal.length||(n.floatVal=[]),2==(7&a))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.list=$root.tensorflow.AttrValue.ListValue.decode(e,e.uint32());break;case 2:n.s=e.bytes();break;case 3:n.i=e.int64();break;case 4:n.f=e.float();break;case 5:n.b=e.bool();break;case 6:n.type=e.int32();break;case 7:n.shape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 8:n.tensor=$root.tensorflow.Tensor.decode(e,e.uint32());break;case 9:n.placeholder=e.string();break;case 10:n.func=$root.tensorflow.NameAttrList.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e.ListValue=function(){function e(e){if(this.s=[],this.i=[],this.f=[],this.b=[],this.type=[],this.shape=[],this.tensor=[],this.func=[],e)for(var t=Object.keys(e),r=0;r>>3){case 2:n.s&&n.s.length||(n.s=[]),n.s.push(e.bytes());break;case 3:if(n.i&&n.i.length||(n.i=[]),2==(7&a))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:a.name=e.string();break;case 2:e.skip().pos++,a.attr===$util.emptyObject&&(a.attr={}),r=e.string(),e.pos++,a.attr[r]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return a},e}(),r.NodeDef=function(){function e(e){if(this.input=[],this.attr={},e)for(var t=Object.keys(e),r=0;r>>3){case 1:a.name=e.string();break;case 2:a.op=e.string();break;case 3:a.input&&a.input.length||(a.input=[]),a.input.push(e.string());break;case 4:a.device=e.string();break;case 5:e.skip().pos++,a.attr===$util.emptyObject&&(a.attr={}),r=e.string(),e.pos++,a.attr[r]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return a},e}(),r.VersionDef=function(){function e(e){if(this.badConsumers=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.producer=e.int32();break;case 2:n.minConsumer=e.int32();break;case 3:if(n.badConsumers&&n.badConsumers.length||(n.badConsumers=[]),2==(7&a))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.node&&n.node.length||(n.node=[]),n.node.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:n.versions=$root.tensorflow.VersionDef.decode(e,e.uint32());break;case 2:n.library=$root.tensorflow.FunctionDefLibrary.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),r.CollectionDef=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.nodeList=$root.tensorflow.CollectionDef.NodeList.decode(e,e.uint32());break;case 2:n.bytesList=$root.tensorflow.CollectionDef.BytesList.decode(e,e.uint32());break;case 3:n.int64List=$root.tensorflow.CollectionDef.Int64List.decode(e,e.uint32());break;case 4:n.floatList=$root.tensorflow.CollectionDef.FloatList.decode(e,e.uint32());break;case 5:n.anyList=$root.tensorflow.CollectionDef.AnyList.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e.NodeList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.value&&n.value.length||(n.value=[]),n.value.push(e.string());break;default:e.skipType(7&a)}}return n},e}(),e.BytesList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.value&&n.value.length||(n.value=[]),n.value.push(e.bytes());break;default:e.skipType(7&a)}}return n},e}(),e.Int64List=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:if(n.value&&n.value.length||(n.value=[]),2==(7&a))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:if(n.value&&n.value.length||(n.value=[]),2==(7&a))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.value&&n.value.length||(n.value=[]),n.value.push($root.tensorflow.Any.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),e}(),r.SaverDef=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.filenameTensorName=e.string();break;case 2:n.saveTensorName=e.string();break;case 3:n.restoreOpName=e.string();break;case 4:n.maxToKeep=e.int32();break;case 5:n.sharded=e.bool();break;case 6:n.keepCheckpointEveryNHours=e.float();break;case 7:n.version=e.int32();break;default:e.skipType(7&a)}}return n},e.CheckpointFormatVersion=(t={},(r=Object.create(t))[t[0]="LEGACY"]=0,r[t[1]="V1"]=1,r[t[2]="V2"]=2,r),e}(),r.TensorInfo=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.name=e.string();break;case 4:n.cooSparse=$root.tensorflow.TensorInfo.CooSparse.decode(e,e.uint32());break;case 2:n.dtype=e.int32();break;case 3:n.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e.CooSparse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.valuesTensorName=e.string();break;case 2:n.indicesTensorName=e.string();break;case 3:n.denseShapeTensorName=e.string();break;default:e.skipType(7&a)}}return n},e}(),e}(),r.SignatureDef=function(){function e(e){if(this.inputs={},this.outputs={},e)for(var t=Object.keys(e),r=0;r>>3){case 1:e.skip().pos++,a.inputs===$util.emptyObject&&(a.inputs={}),r=e.string(),e.pos++,a.inputs[r]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:e.skip().pos++,a.outputs===$util.emptyObject&&(a.outputs={}),r=e.string(),e.pos++,a.outputs[r]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 3:a.methodName=e.string();break;default:e.skipType(7&o)}}return a},e}(),r.AssetFileDef=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.tensorInfo=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:n.filename=e.string();break;default:e.skipType(7&a)}}return n},e}(),r.OpDef=function(){function e(e){if(this.inputArg=[],this.outputArg=[],this.attr=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.name=e.string();break;case 2:n.inputArg&&n.inputArg.length||(n.inputArg=[]),n.inputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 3:n.outputArg&&n.outputArg.length||(n.outputArg=[]),n.outputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 4:n.attr&&n.attr.length||(n.attr=[]),n.attr.push($root.tensorflow.OpDef.AttrDef.decode(e,e.uint32()));break;case 8:n.deprecation=$root.tensorflow.OpDef.OpDeprecation.decode(e,e.uint32());break;case 5:n.summary=e.string();break;case 6:n.description=e.string();break;case 18:n.isCommutative=e.bool();break;case 16:n.isAggregate=e.bool();break;case 17:n.isStateful=e.bool();break;case 19:n.allowsUninitializedInput=e.bool();break;default:e.skipType(7&a)}}return n},e.ArgDef=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.type=e.int32();break;case 4:n.typeAttr=e.string();break;case 5:n.numberAttr=e.string();break;case 6:n.typeListAttr=e.string();break;case 16:n.isRef=e.bool();break;default:e.skipType(7&a)}}return n},e}(),e.AttrDef=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.name=e.string();break;case 2:n.type=e.string();break;case 3:n.defaultValue=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 4:n.description=e.string();break;case 5:n.hasMinimum=e.bool();break;case 6:n.minimum=e.int64();break;case 7:n.allowedValues=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.OpDeprecation=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.version=e.int32();break;case 2:n.explanation=e.string();break;default:e.skipType(7&a)}}return n},e}(),e}(),r.OpList=function(){function e(e){if(this.op=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.op&&n.op.length||(n.op=[]),n.op.push($root.tensorflow.OpDef.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),r.MetaGraphDef=function(){function e(e){if(this.collectionDef={},this.signatureDef={},this.assetFileDef=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:a.metaInfoDef=$root.tensorflow.MetaGraphDef.MetaInfoDef.decode(e,e.uint32());break;case 2:a.graphDef=$root.tensorflow.GraphDef.decode(e,e.uint32());break;case 3:a.saverDef=$root.tensorflow.SaverDef.decode(e,e.uint32());break;case 4:e.skip().pos++,a.collectionDef===$util.emptyObject&&(a.collectionDef={}),r=e.string(),e.pos++,a.collectionDef[r]=$root.tensorflow.CollectionDef.decode(e,e.uint32());break;case 5:e.skip().pos++,a.signatureDef===$util.emptyObject&&(a.signatureDef={}),r=e.string(),e.pos++,a.signatureDef[r]=$root.tensorflow.SignatureDef.decode(e,e.uint32());break;case 6:a.assetFileDef&&a.assetFileDef.length||(a.assetFileDef=[]),a.assetFileDef.push($root.tensorflow.AssetFileDef.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return a},e.MetaInfoDef=function(){function e(e){if(this.tags=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.metaGraphVersion=e.string();break;case 2:n.strippedOpList=$root.tensorflow.OpList.decode(e,e.uint32());break;case 3:n.anyInfo=$root.tensorflow.Any.decode(e,e.uint32());break;case 4:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 5:n.tensorflowVersion=e.string();break;case 6:n.tensorflowGitVersion=e.string();break;default:e.skipType(7&a)}}return n},e}(),e}(),r.SavedModel=function(){function e(e){if(this.metaGraphs=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.savedModelSchemaVersion=e.int64();break;case 2:n.metaGraphs&&n.metaGraphs.length||(n.metaGraphs=[]),n.metaGraphs.push($root.tensorflow.MetaGraphDef.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),r.FunctionDefLibrary=function(){function e(e){if(this.function=[],this.gradient=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.function&&n.function.length||(n.function=[]),n.function.push($root.tensorflow.FunctionDef.decode(e,e.uint32()));break;case 2:n.gradient&&n.gradient.length||(n.gradient=[]),n.gradient.push($root.tensorflow.GradientDef.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),r.FunctionDef=function(){function e(e){if(this.attr={},this.nodeDef=[],this.ret={},e)for(var t=Object.keys(e),r=0;r>>3){case 1:a.signature=$root.tensorflow.OpDef.decode(e,e.uint32());break;case 5:e.skip().pos++,a.attr===$util.emptyObject&&(a.attr={}),r=e.string(),e.pos++,a.attr[r]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 3:a.nodeDef&&a.nodeDef.length||(a.nodeDef=[]),a.nodeDef.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:e.skip().pos++,a.ret===$util.emptyObject&&(a.ret={}),r=e.string(),e.pos++,a.ret[r]=e.string();break;default:e.skipType(7&o)}}return a},e}(),r.GradientDef=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.functionName=e.string();break;case 2:n.gradientFunc=e.string();break;default:e.skipType(7&a)}}return n},e}(),r}();var compiled_api=$root,compiled_api_1=compiled_api.tensorflow;function getParamValue(e,t,r,n){var a=t.params[e];if(a&&void 0!==a.inputIndex){if("tensor"===a.type)return getTensor(t.inputNames[a.inputIndex],r,n);if("tensors"===a.type)return(0===a.inputIndex?0===a.inputParamLength?t.inputNames:t.inputNames.slice(a.inputIndex,-a.inputParamLength):t.inputNames.splice(a.inputIndex)).map(function(e){return getTensor(e,r,n)});var o=Array.prototype.slice.call(getTensor(t.inputNames.slice(a.inputIndex)[0],r,n).dataSync());return"number"===a.type?o[0]:o}return a&&a.value}function getTensor(e,t,r){var n=parseNodeName(e),a=n[0],o=n[1],i=r.currentContextIds.find(function(e){return!!t[getNodeNameWithContextId(a,e)]});return void 0!==i?t[getNodeNameWithContextId(a,i)][o]:void 0}function getNodeNameAndIndex(e,t){var r=parseNodeName(e),n=r[0],a=r[1];return[getNodeNameWithContextId(n,t&&t.currentContextId),a]}function getNodeNameWithContextId(e,t){return t?e+"-"+t:e}function parseNodeName(e){var t=e.lastIndexOf(":");return-1===t?[e,0]:[e.substring(0,t),Number(e.substring(t+1))]}function split$1(e,t){for(var r=[],n=0;n=this.tensors.length)throw new Error("Tried to read from index "+e+", but array size is: "+this.tensors.length);var t=this.tensors[e];if(t.cleared)throw new Error("TensorArray "+this.name+": Could not read index "+e+" twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).");return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor},e.prototype.readMany=function(e){var t=this;return e.map(function(e){return t.read(e)})},e.prototype.write=function(e,t){if(this.closed_)throw new Error("TensorArray "+this.name+" has already been closed.");if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error("Tried to write to index "+e+", but array is not resizeable and size is: "+this.maxSize);var r=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+",\n because the value dtype is "+t.dtype+", but TensorArray dtype is "+this.dtype+".");if(0===this.size()&&0===this.elementShape.length&&(this.elementShape=t.shape),util.assertShapesMatch(this.elementShape,t.shape,"TensorArray "+this.name+": Could not write to TensorArray index "+e+"."),r&&r.read)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been read.");if(r&&r.written)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been written.");r.tensor=t,r.written=!0,this.tensors[e]=r},e.prototype.writeMany=function(e,t){var r=this;if(e.length!==t.length)throw new Error("TensorArray "+this.name+": could not write multiple tensors,because the index size: "+e.length+" is not the same as tensors size: "+t.length+".");e.map(function(e,n){return r.write(e,t[n])})},e.prototype.gather=function(e,t){if(t&&t!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but gather requested dtype "+t);if(!e){e=[];for(var r=0;r=this.maxSize)throw new Error("Max index must be < array size ("+r+" vs. "+this.maxSize+")");this.writeMany(e,unstack(t,0))},e.prototype.split=function(e,t){var r=this;if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but tensor has dtype "+t.dtype);var n=0,a=e.map(function(e){return n+=e});if(n!==t.shape[0])throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n "+n+", and tensor's shape is: "+t.shape);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error("TensorArray's size is not equal to the size of lengths ("+this.maxSize+" vs. "+e.length+"), and the TensorArray is not marked as dynamically resizeable");var o=0===n?0:t.size/n,i=[];tidy(function(){t=t.reshape([1,n,o]);for(var s=0;s1)for(var f=1;f1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()},e.prototype.nextIteration=function(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");this.contexts=this.contexts.slice(),this.lastId++;var e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))},e.prototype.getWeight=function(e){return this.weightMap[e]},e.prototype.addTensorArray=function(e){this.tensorArrayMap[e.id]=e},e.prototype.getTensorArray=function(e){return this.tensorArrayMap[e]},e}(),GraphExecutor=function(){function e(e){this.graph=e,this.compiledOrder=[],this._weightMap={},this.placeholders=e.placeholders,this._outputs=e.outputs,this.compile()}return Object.defineProperty(e.prototype,"weightMap",{get:function(){return this._weightMap},set:function(e){var t=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})});this.weightIds=[].concat.apply([],t),this._weightMap=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.placeholders.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this._outputs.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.placeholders.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.outputs.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isControlFlowModel",{get:function(){return this.graph.withControlFlow},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDynamicShapeModel",{get:function(){return this.graph.withDynamicShape},enumerable:!0,configurable:!0}),e.prototype.compile=function(){if(!this.graph.withControlFlow&&!this.graph.withDynamicShape)for(var e=this.graph.inputs.slice(),t={};e.length>0;){var r=e.pop();t[r.name]=!0,this.compiledOrder.push(r),r.children.forEach(function(r){!t[r.name]&&r.inputNames.every(function(e){var r=getNodeNameAndIndex(e)[0];return t[r]})&&e.push(r)})}},e.prototype.execute=function(e,t){var r=this;this.checkInput(e),this.checkInputShapeAndType(e);var n={};return tidy(function(){var a=new ExecutionContext(r._weightMap,n),o=r.compiledOrder.reduce(function(e,t){return e[t.name]=executeOp$15(t,e,a),e},__assign$2({},r.weightMap,e));return r.findOutputs(o,a,t)})},e.prototype.executeAsync=function(e,t){return __awaiter$2(this,void 0,void 0,function(){var r,n,a,o,i,s,u,l=this;return __generator$2(this,function(p){switch(p.label){case 0:return this.checkInput(e),this.checkInputShapeAndType(e),r={},n=new ExecutionContext(this._weightMap,r),[4,this.executeWithControlFlow(e,n)];case 1:return a=p.sent(),o=this.findOutputs(a,n,t),i=Object.keys(o).map(function(e){return o[e].id}),s=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})}),u=[].concat.apply([],s),Object.keys(a).forEach(function(e){a[e].forEach(function(e){e&&-1===i.indexOf(e.id)&&-1===u.indexOf(e.id)&&-1===l.weightIds.indexOf(e.id)&&e.dispose()})}),[2,o]}})})},e.prototype.executeWithControlFlow=function(e,t){return __awaiter$2(this,void 0,void 0,function(){var r,n,a,o,i,s,u,l;return __generator$2(this,function(p){switch(p.label){case 0:r=this.graph.inputs.map(function(e){return{node:e,contexts:t.currentContext}}),n=__assign$2({},this.weightMap,e),a={},p.label=1;case 1:return r.length>0?(o=r.pop(),t.currentContext=o.contexts,i="","enter"===o.node.op&&getParamValue("isConstant",o.node,n,t)&&(i=getNodeNameAndIndex(o.node.name,t)[0]),s=executeOp$15(o.node,n,t),i||(i=getNodeNameAndIndex(o.node.name,t)[0]),u=n,l=i,[4,s]):[3,3];case 2:return u[l]=p.sent(),o.node.children.forEach(function(e){var o=getNodeNameAndIndex(e.name,t)[0];a[o]||("merge"===e.op?e.inputNames.some(function(e){return!!getTensor(e,n,t)})&&(a[o]=!0,r.push({contexts:t.currentContext,node:e})):e.inputNames.every(function(e){return!!getTensor(e,n,t)})&&(a[o]=!0,r.push({contexts:t.currentContext,node:e})))}),[3,1];case 3:return[2,n]}})})},e.prototype.findOutputs=function(e,t,r){return!r||r instanceof Array||(r=[r]),(r||this.graph.outputs.map(function(e){return e.name})).reduce(function(r,n){return r[n]=getTensor(n,e,t),r},{})},e.prototype.dispose=function(){var e=this;Object.keys(this.weightMap).forEach(function(t){return e.weightMap[t].forEach(function(e){return e.dispose()})})},e.prototype.checkInputShapeAndType=function(e){this.placeholders.forEach(function(t){var r=e[t.name][0];if(t.params.shape&&t.params.shape.value){var n=t.params.shape.value,a=n.length===r.shape.length&&r.shape.every(function(e,t){return-1===n[t]||n[t]===e});util.assert(a,"The shape of dict['"+t.name+"'] provided in model.execute(dict) must be ["+n+"], but was ["+r.shape+"]")}t.params.dtype&&t.params.dtype.value&&util.assert(r.dtype===t.params.dtype.value,"The dtype of dict['"+t.name+"'] provided in model.execute(dict) must be "+t.params.dtype.value+", but was "+r.dtype)})},e.prototype.checkInput=function(e){var t=this,r=Object.keys(e),n=[],a=[];if(this.inputNodes.forEach(function(e){-1===r.indexOf(e)&&n.push(e)}),r.forEach(function(e){-1===t.inputNodes.indexOf(e)&&a.push(e)}),n.length>0)throw new Error("The dict provided in model.execute(dict) has the keys ["+r+"], but is missing the required keys: ["+n+"].");if(a.length>0)throw new Error("The dict provided in model.execute(dict) has unused keys: ["+a+"]. Please provide only the following keys: ["+this.inputNodes+"].")},e}(),FrozenModel=function(){function e(e,t,r){this.modelUrl=e,this.weightManifestUrl=t,this.requestOption=r,this.version="n/a",this.pathPrefix=this.getPathPrefix()}return Object.defineProperty(e.prototype,"modelVersion",{get:function(){return this.version},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.executor.inputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.executor.outputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.executor.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this.executor.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weights",{get:function(){return this.executor.weightMap},enumerable:!0,configurable:!0}),e.prototype.getPathPrefix=function(){var e=parse(this.weightManifestUrl),t=e.pathname.split("/");return t.splice(-1),e.pathname=t.join("/"),format(e)+"/"},e.prototype.loadRemoteProtoFile=function(){return __awaiter$2(this,void 0,void 0,function(){var e,t,r,n,a;return __generator$2(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,fetch(this.modelUrl,this.requestOption)];case 1:return e=o.sent(),r=(t=compiled_api_1.GraphDef).decode,n=Uint8Array.bind,[4,e.arrayBuffer()];case 2:return[2,r.apply(t,[new(n.apply(Uint8Array,[void 0,o.sent()]))])];case 3:throw a=o.sent(),new Error(this.modelUrl+" not found. "+a);case 4:return[2]}})})},e.prototype.loadWeightManifest=function(){return __awaiter$2(this,void 0,void 0,function(){var e,t,r;return __generator$2(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,fetch(this.weightManifestUrl,this.requestOption)];case 1:return e=n.sent(),t=this,[4,e.clone().json()];case 2:return t.weightManifest=n.sent(),[3,4];case 3:throw r=n.sent(),new Error(this.weightManifestUrl+" not found. "+r);case 4:return[2]}})})},e.prototype.load=function(){return __awaiter$2(this,void 0,void 0,function(){var e,t,r,n;return __generator$2(this,function(a){switch(a.label){case 0:return e=this.loadRemoteProtoFile(),t=this.loadWeightManifest(),[4,Promise.all([e,t])];case 1:return r=a.sent()[0],this.version=r.versions.producer+"."+r.versions.minConsumer,[4,io.loadWeights(this.weightManifest,this.pathPrefix,void 0,this.requestOption)];case 2:return n=a.sent(),this.executor=new GraphExecutor(OperationMapper.Instance.transformGraph(r)),this.executor.weightMap=this.convertTensorMapToTensorsMap(n),[2,!0]}})})},e.prototype.predict=function(e,t){return this.execute(e,this.outputNodes)},e.prototype.constructTensorMap=function(e){var t=e instanceof Tensor?[e]:e;if(t.length!==this.inputNodes.length)throw new Error("Input tensor count mismatch,the frozen model has "+this.inputNodes.length+" placeholders, while there are "+t.length+" input tensors.");return this.inputNodes.reduce(function(e,r,n){return e[r]=t[n],e},{})},e.prototype.execute=function(e,t){if(t=t||this.outputNodes,(e instanceof Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),this.executor.isControlFlowModel||this.executor.isDynamicShapeModel)throw new Error("The model contains control flow or dynamic shape ops, please use executeAsync method");var r=this.executor.execute(this.convertTensorMapToTensorsMap(e),t),n=Object.keys(r);return Array.isArray(t)&&t.length>1?t.map(function(e){return r[e]}):r[n[0]]},e.prototype.executeAsync=function(e,t){return __awaiter$2(this,void 0,void 0,function(){var r,n;return __generator$2(this,function(a){switch(a.label){case 0:if(!this.executor.isControlFlowModel||!this.executor.isDynamicShapeModel)throw new Error("The model does not contain control flow or dynamic shape ops, please use execute method for better performance.");return t=t||this.outputNodes,(e instanceof Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),[4,this.executor.executeAsync(this.convertTensorMapToTensorsMap(e),t)];case 1:return r=a.sent(),n=Object.keys(r),[2,Array.isArray(t)&&t.length>1?t.map(function(e){return r[e]}):r[n[0]]]}})})},e.prototype.convertTensorMapToTensorsMap=function(e){return Object.keys(e).reduce(function(t,r){return t[r]=[e[r]],t},{})},e.prototype.dispose=function(){this.executor.dispose()},e}();function loadFrozenModel(e,t,r){return __awaiter$2(this,void 0,void 0,function(){var n;return __generator$2(this,function(a){switch(a.label){case 0:return[4,(n=new FrozenModel(e,t,r)).load()];case 1:return a.sent(),[2,n]}})})}var version$2="0.5.5",version$3="0.12.4",version$4={"tfjs-core":version,"tfjs-layers":version$1,"tfjs-converter":version$2,tfjs:version$3};exports.version=version$4,exports.setBackend=setBackend,exports.getBackend=getBackend,exports.disposeVariables=disposeVariables,exports.memory=memory,exports.version_core=version,exports.nextFrame=nextFrame,exports.environment=environment,exports.io=io,exports.serialization=serialization,exports.test_util=test_util,exports.util=util,exports.webgl=webgl,exports.AdadeltaOptimizer=AdadeltaOptimizer,exports.AdagradOptimizer=AdagradOptimizer,exports.AdamOptimizer=AdamOptimizer,exports.AdamaxOptimizer=AdamaxOptimizer,exports.MomentumOptimizer=MomentumOptimizer,exports.Optimizer=Optimizer,exports.RMSPropOptimizer=RMSPropOptimizer,exports.SGDOptimizer=SGDOptimizer,exports.Tensor=Tensor,exports.TensorBuffer=TensorBuffer,exports.variable=variable,exports.Variable=Variable,exports.ENV=ENV,exports.Environment=Environment,exports.image=image_ops,exports.linalg=linalg_ops,exports.losses=loss_ops,exports.op=op,exports.batchNormalization2d=batchNormalization2d,exports.batchNormalization3d=batchNormalization3d,exports.batchNormalization4d=batchNormalization4d,exports.batchNormalization=batchNormalization,exports.concat=concat,exports.concat1d=concat1d,exports.concat2d=concat2d,exports.concat3d=concat3d,exports.concat4d=concat4d,exports.conv1d=conv1d,exports.conv2d=conv2d,exports.depthwiseConv2d=depthwiseConv2d,exports.separableConv2d=separableConv2d,exports.conv2dTranspose=conv2dTranspose,exports.matMul=matMul,exports.dot=dot,exports.outerProduct=outerProduct,exports.reverse=reverse,exports.reverse1d=reverse1d,exports.reverse2d=reverse2d,exports.reverse3d=reverse3d,exports.reverse4d=reverse4d,exports.maxPool=maxPool,exports.avgPool=avgPool,exports.slice=slice,exports.slice1d=slice1d,exports.slice2d=slice2d,exports.slice3d=slice3d,exports.slice4d=slice4d,exports.abs=abs,exports.acos=acos,exports.acosh=acosh,exports.asin=asin,exports.asinh=asinh,exports.atan=atan,exports.atanh=atanh,exports.ceil=ceil,exports.clipByValue=clipByValue,exports.cos=cos,exports.cosh=cosh,exports.erf=erf,exports.exp=exp,exports.expm1=expm1,exports.floor=floor,exports.log=log$1,exports.log1p=log1p,exports.logSigmoid=logSigmoid,exports.neg=neg,exports.reciprocal=reciprocal,exports.round=round,exports.rsqrt=rsqrt,exports.sigmoid=sigmoid,exports.sign=sign,exports.sin=sin,exports.sinh=sinh,exports.softplus=softplus,exports.sqrt=sqrt,exports.square=square,exports.step=step,exports.tan=tan,exports.tanh=tanh$1,exports.all=all,exports.any=any,exports.argMax=argMax,exports.argMin=argMin,exports.logSumExp=logSumExp,exports.max=max,exports.mean=mean,exports.min=min,exports.moments=moments,exports.sum=sum,exports.equal=equal,exports.equalStrict=equalStrict,exports.greater=greater,exports.greaterEqual=greaterEqual,exports.greaterEqualStrict=greaterEqualStrict,exports.greaterStrict=greaterStrict,exports.less=less,exports.lessEqual=lessEqual,exports.lessEqualStrict=lessEqualStrict,exports.lessStrict=lessStrict,exports.notEqual=notEqual,exports.notEqualStrict=notEqualStrict,exports.add=add,exports.addN=addN,exports.addStrict=addStrict,exports.atan2=atan2,exports.div=div,exports.divStrict=divStrict,exports.floorDiv=floorDiv,exports.maximum=maximum,exports.maximumStrict=maximumStrict,exports.minimum=minimum,exports.minimumStrict=minimumStrict,exports.mod=mod,exports.modStrict=modStrict,exports.mul=mul,exports.mulStrict=mulStrict,exports.pow=pow,exports.powStrict=powStrict,exports.squaredDifference=squaredDifference,exports.squaredDifferenceStrict=squaredDifferenceStrict,exports.sub=sub,exports.subStrict=subStrict,exports.elu=elu,exports.leakyRelu=leakyRelu,exports.prelu=prelu,exports.relu=relu,exports.selu=selu,exports.logicalAnd=logicalAnd,exports.logicalNot=logicalNot,exports.logicalOr=logicalOr,exports.logicalXor=logicalXor,exports.where=where,exports.whereAsync=whereAsync,exports.buffer=buffer,exports.toPixels=toPixels,exports.print=print,exports.cast=cast,exports.clone=clone,exports.cumsum=cumsum,exports.expandDims=expandDims,exports.eye=eye,exports.fromPixels=fromPixels,exports.multinomial=multinomial,exports.oneHot=oneHot,exports.pad=pad,exports.pad1d=pad1d,exports.pad2d=pad2d,exports.pad3d=pad3d,exports.pad4d=pad4d,exports.rand=rand,exports.randomNormal=randomNormal,exports.randomUniform=randomUniform,exports.reshape=reshape,exports.split=split,exports.squeeze=squeeze,exports.stack=stack,exports.tile=tile,exports.truncatedNormal=truncatedNormal,exports.unstack=unstack,exports.batchToSpaceND=batchToSpaceND,exports.spaceToBatchND=spaceToBatchND,exports.fill=fill,exports.linspace=linspace,exports.ones=ones$1,exports.range=range,exports.scalar=scalar,exports.tensor=tensor,exports.tensor1d=tensor1d,exports.tensor2d=tensor2d,exports.tensor3d=tensor3d,exports.tensor4d=tensor4d,exports.tensor5d=tensor5d,exports.tensor6d=tensor6d,exports.zeros=zeros,exports.onesLike=onesLike,exports.zerosLike=zerosLike,exports.transpose=transpose,exports.softmax=softmax,exports.localResponseNormalization=localResponseNormalization,exports.norm=norm,exports.gather=gather,exports.unsortedSegmentSum=unsortedSegmentSum,exports.basicLSTMCell=basicLSTMCell,exports.multiRNNCell=multiRNNCell,exports.movingAverage=movingAverage,exports.stridedSlice=stridedSlice,exports.topk=topk,exports.train=train,exports.tidy=tidy,exports.keep=keep,exports.dispose=dispose,exports.time=time,exports.customGrad=customGrad,exports.grad=grad,exports.grads=grads,exports.valueAndGrad=valueAndGrad,exports.valueAndGrads=valueAndGrads,exports.variableGrads=variableGrads,exports.constraints=exports_constraints,exports.initializers=exports_initializers,exports.layers=exports_layers,exports.metrics=exports_metrics,exports.regularizers=exports_regularizers,exports.CallbackList=CallbackList,exports.CustomCallback=CustomCallback,exports.Callback=Callback,exports.SymbolicTensor=SymbolicTensor,exports.Model=Model,exports.input=input,exports.loadModel=loadModel,exports.model=model,exports.sequential=sequential,exports.RNN=RNN,exports.Sequential=Sequential,exports.LayerVariable=LayerVariable,exports.version_layers=version$1,exports.FrozenModel=FrozenModel,exports.loadFrozenModel=loadFrozenModel,exports.version_converter=version$2,Object.defineProperty(exports,"__esModule",{value:!0})}); +//# sourceMappingURL=tf.min.js.map diff --git a/node_modules/@tensorflow/tfjs/dist/tf.min.js.map b/node_modules/@tensorflow/tfjs/dist/tf.min.js.map new file mode 100644 index 0000000..3893c32 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/tf.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tf.min.js","sources":["../node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js","../node_modules/@tensorflow/tfjs-layers/dist/tf-layers.esm.js","../node_modules/@tensorflow/tfjs-converter/dist/tf-converter.esm.js","../src/version.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nvar extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0;)r=Math.random()*t|0,n=e[--t],e[t]=e[r],e[r]=n}function clamp(e,t,n){return Math.max(e,Math.min(t,n))}function randUniform(e,t){return Math.random()*(t-e)+e}function distSquared(e,t){for(var n=0,r=0;r0,function(){return\"Element arr[\"+n.join(\"][\")+\"] should be a primitive, but is an array of \"+e.length+\" elements\"}),assert(e.length===t[0],function(){return\"Element arr[\"+n.join(\"][\")+\"] should have \"+t[0]+\" elements, but has \"+e.length+\" elements\"});for(var r=t.slice(1),o=0;o1;--t)if(e%t==0)return[t,e/t];return[1,e]}function createShuffledIndices(e){for(var t=new Uint32Array(e),n=0;n=n?o():setTimeout(i,s)}};i()})}function inferFromImplicitShape(e,t){for(var n=1,r=-1,o=0;o0)n*=e[o];else if(-1===e[o]){if(-1!==r)throw Error(\"Shapes can only have 1 implicit size. Found - 1 at dim \"+r+\" and dim \"+o);r=o}else if(e[o]<=0)throw Error(\"Shapes can not be <= 0. Found \"+e[o]+\" at dim \"+o);if(-1===r){if(t>0&&t!==n)throw Error(\"Size(\"+t+\") must match the product of shape \"+e);return e}if(t%n!=0)throw Error(\"The implicit shape can't be a fractional number. Got \"+t+\" / \"+n);var a=e.slice();return a[r]=t/n,a}function squeezeShape(e,t){for(var n=[],r=[],o=0,a=0;a1)throw new Error(\"Can't squeeze axis \"+a+\" since its dim '\"+e[a]+\"' is not 1\");(null==t[o]||t[o]>a)&&1===e[a]&&(n.push(e[a]),r.push(a)),t[o]<=a&&o++}e[a]>1&&(n.push(e[a]),r.push(a))}return{newShape:n,keptDims:r}}function getTypedArrayFromDType(e,t){var n=null;if(null==e||\"float32\"===e)n=new Float32Array(t);else if(\"int32\"===e)n=new Int32Array(t);else{if(\"bool\"!==e)throw new Error(\"Unknown data type \"+e);n=new Uint8Array(t)}return n}function checkComputationForNaN(e,t,n){if(\"float32\"===t)for(var r=0;r=0;--r)n[r]=n[r+1]*e[r+1];return n}function toTypedArray(e,t,n){return noConversionNeeded(e,t)?e:(Array.isArray(e)&&(e=flatten(e)),copyTypedArray(e,t,n))}function noConversionNeeded(e,t){return e instanceof Float32Array&&\"float32\"===t||e instanceof Int32Array&&\"int32\"===t||e instanceof Uint8Array&&\"bool\"===t}function makeOnesTypedArray(e,t){for(var n=makeZerosTypedArray(e,t),r=0;r=0;a--){i=(m=e[a]).inputs;var h=[];h.push(m.output);for(c=0;c=0;n--){var r=t[n],o=e[r.output.id];if(null==r.gradient)throw new Error(\"Cannot compute gradient: gradient function not found for \"+r.name+\".\");var a=r.gradient(o);for(var i in r.inputs){if(!(i in a))throw new Error(\"Cannot backprop through input \"+i+\". Available gradients found: \"+Object.keys(a)+\".\");var s=a[i](),u=r.inputs[i];if(!arraysEqual(s.shape,u.shape))throw new Error(\"Error in gradient for op \"+r.name+\". The gradient of input '\"+i+\"' has shape '\"+s.shape+\"', which does not match the shape of the input '\"+u.shape+\"'\");if(null==e[u.id])e[u.id]=s;else{var l=e[u.id];e[u.id]=l.add(s),l.dispose()}}}}var FORMAT_LIMIT_NUM_VALS=20,FORMAT_NUM_FIRST_LAST_VALS=3,FORMAT_NUM_SIG_DIGITS=7;function tensorToString(e,t,n,r){var o=computeStrides(t),a=computeMaxSizePerColumn(e,t,o),i=t.length,s=subTensorToString(e,t,o,a),u=[\"Tensor\"];return r&&(u.push(\" dtype: \"+n),u.push(\" rank: \"+i),u.push(\" shape: [\"+t+\"]\"),u.push(\" values:\")),u.push(s.map(function(e){return\" \"+e}).join(\"\\n\")),u.join(\"\\n\")}function computeMaxSizePerColumn(e,t,n){var r=sizeFromShape(t),o=n[n.length-1],a=new Array(o).fill(0);if(t.length>1)for(var i=0;iFORMAT_LIMIT_NUM_VALS){var s=Array.from(e.subarray(0,FORMAT_NUM_FIRST_LAST_VALS)),u=Array.from(e.subarray(a-FORMAT_NUM_FIRST_LAST_VALS,a));return[\"[\"+s.map(function(e,t){return valToString(e,r[t])}).join(\", \")+\", ..., \"+u.map(function(e,t){return valToString(e,r[a-FORMAT_NUM_FIRST_LAST_VALS+t])}).join(\", \")+\"]\"]}return[\"[\"+Array.from(e).map(function(e,t){return valToString(e,r[t])}).join(\", \")+\"]\"]}var l=t.slice(1),c=n.slice(1),p=n[0],d=[];if(a>FORMAT_LIMIT_NUM_VALS){for(var h=0;h {...}) to avoid memory leaks.\");return this.keepTensors.add(e.id),e},e.prototype.startScope=function(e,t){void 0===t&&(t=!1),t&&0===this.gradientScopeCount&&(this.activeTape=[]),t&&this.gradientScopeCount++;var n={track:[],name:\"unnamed scope\"};e&&(n.name=e),this.scopeStack.push(n),this.activeScope=n},e.prototype.endScope=function(e,t){var n=this;void 0===t&&(t=!1),t&&(this.gradientScopeCount--,0===this.gradientScopeCount&&(this.activeTape=null));var r=new Set(this.keepTensors),o=getTensorsInContainer(e);o.forEach(function(e){return r.add(e.id)});for(var a=0;a0,\"gradients() received an empty list of xs.\"),this.tidy(\"gradients\",function(){var a=e();assert(a instanceof Tensor,\"The result y returned by f() must be a tensor.\");var i=getFilteredNodesXToY(o.activeTape,t,a);if(!r&&0===i.length&&t.length>0)throw new Error(\"Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.\");var s={};return s[a.id]=null==n?ones(a.shape):n,backpropagateGradients(s,i),{value:a,grads:t.map(function(e){return s[e.id]})}},!0)},e.prototype.customGrad=function(e){var t=this;return assert(isFunction(e),\"The f passed in customGrad(f) must be a function.\"),function(){for(var n,r,o=[],a=0;a {op();...}); to avoid memory leaks.\");return this.activeScope.track.push(e),e},e}();function ones(e){var t=makeOnesTypedArray(sizeFromShape(e),\"float32\");return Tensor.make(e,{values:t})}!function(e){e[e.NUMBER=0]=\"NUMBER\",e[e.BOOLEAN=1]=\"BOOLEAN\",e[e.STRING=2]=\"STRING\"}(Type||(Type={}));var URL_PROPERTIES=[{name:\"DEBUG\",type:Type.BOOLEAN},{name:\"IS_BROWSER\",type:Type.BOOLEAN},{name:\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\",type:Type.NUMBER},{name:\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\",type:Type.BOOLEAN},{name:\"WEBGL_VERSION\",type:Type.NUMBER},{name:\"WEBGL_RENDER_FLOAT32_ENABLED\",type:Type.BOOLEAN},{name:\"WEBGL_DOWNLOAD_FLOAT_ENABLED\",type:Type.BOOLEAN},{name:\"WEBGL_FENCE_API_ENABLED\",type:Type.BOOLEAN},{name:\"BACKEND\",type:Type.STRING}];function isWebGLVersionEnabled(e,t){var n;try{n=getWebGLRenderingContext(e,t)}catch(e){return!1}return null!=n&&(loseContext(n),!0)}function getWebGLDisjointQueryTimerVersion(e,t){if(0===e)return 0;var n,r=getWebGLRenderingContext(e,t);return n=hasExtension(r,\"EXT_disjoint_timer_query_webgl2\")&&2===e?2:hasExtension(r,\"EXT_disjoint_timer_query\")?1:0,null!=r&&loseContext(r),n}function isRenderToFloatTextureEnabled(e,t){if(0===e)return!1;var n=getWebGLRenderingContext(e,t);if(1===e){if(!hasExtension(n,\"OES_texture_float\"))return!1}else if(!hasExtension(n,\"EXT_color_buffer_float\"))return!1;createFloatTextureAndBindToFramebuffer(n,e);var r=n.checkFramebufferStatus(n.FRAMEBUFFER)===n.FRAMEBUFFER_COMPLETE;return loseContext(n),r}function isDownloadFloatTextureEnabled(e,t){if(0===e)return!1;var n=getWebGLRenderingContext(e,t);if(1===e){if(!hasExtension(n,\"OES_texture_float\"))return!1}else if(!hasExtension(n,\"EXT_color_buffer_float\"))return!1;createFloatTextureAndBindToFramebuffer(n,e),n.readPixels(0,0,1,1,n.RGBA,n.FLOAT,new Float32Array(4));var r=n.getError()===n.NO_ERROR;return loseContext(n),r}function isWebGLFenceEnabled(e,t){if(2!==e)return!1;var n=getWebGLRenderingContext(e,t),r=null!=n.fenceSync;return loseContext(n),r}function isChrome(){return\"undefined\"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}var TENSORFLOWJS_FLAGS_PREFIX=\"tfjsflags\";function getFeaturesFromURL(){var e={};if(\"undefined\"==typeof window||void 0===window.location)return e;var t=getQueryParams(window.location.search);if(TENSORFLOWJS_FLAGS_PREFIX in t){var n={};t[TENSORFLOWJS_FLAGS_PREFIX].split(\",\").forEach(function(e){var t=e.split(\":\"),r=t[0],o=t[1];n[r]=o}),URL_PROPERTIES.forEach(function(t){t.name in n&&(console.log(\"Setting feature override from URL \"+t.name+\": \"+n[t.name]),t.type===Type.NUMBER?e[t.name]=+n[t.name]:t.type===Type.BOOLEAN?e[t.name]=\"true\"===n[t.name]:t.type===Type.STRING?e[t.name]=n[t.name]:console.warn(\"Unknown URL param: \"+t.name+\".\"))})}return e}function hasExtension(e,t){return null!=e.getExtension(t)}function getWebGLRenderingContext(e,t){if(0===e||!t)throw new Error(\"Cannot get WebGL rendering context, WebGL is disabled.\");var n=document.createElement(\"canvas\");return 1===e?n.getContext(\"webgl\")||n.getContext(\"experimental-webgl\"):n.getContext(\"webgl2\")}function loseContext(e){if(null!=e){var t=e.getExtension(\"WEBGL_lose_context\");if(null==t)throw new Error(\"Extension WEBGL_lose_context not supported on this browser.\");t.loseContext()}}function createFloatTextureAndBindToFramebuffer(e,t){var n=e.createFramebuffer(),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);var o=2===t?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,o,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0)}function getQueryParams(e){var t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(e){for(var n=[],r=1;r0?0:getWebGLDisjointQueryTimerVersion(t,this.get(\"IS_BROWSER\"))}if(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\"===e)return this.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0&&!isMobile();if(\"HAS_WEBGL\"===e)return this.get(\"WEBGL_VERSION\")>0;if(\"WEBGL_VERSION\"===e)return isWebGLVersionEnabled(2,this.get(\"IS_BROWSER\"))?2:isWebGLVersionEnabled(1,this.get(\"IS_BROWSER\"))?1:0;if(\"WEBGL_RENDER_FLOAT32_ENABLED\"===e)return isRenderToFloatTextureEnabled(this.get(\"WEBGL_VERSION\"),this.get(\"IS_BROWSER\"));if(\"WEBGL_DOWNLOAD_FLOAT_ENABLED\"===e)return isDownloadFloatTextureEnabled(this.get(\"WEBGL_VERSION\"),this.get(\"IS_BROWSER\"));if(\"WEBGL_FENCE_API_ENABLED\"===e)return isWebGLFenceEnabled(this.get(\"WEBGL_VERSION\"),this.get(\"IS_BROWSER\"));if(\"TEST_EPSILON\"===e)return this.get(\"WEBGL_RENDER_FLOAT32_ENABLED\")?TEST_EPSILON_FLOAT32_ENABLED:TEST_EPSILON_FLOAT32_DISABLED;throw new Error(\"Unknown feature \"+e+\".\")},e.prototype.setFeatures=function(e){this.features=Object.assign({},e)},e.prototype.reset=function(){this.features=getFeaturesFromURL(),null!=this.globalEngine&&(this.globalEngine=null)},e.prototype.initBackend=function(e,t){var n=this;void 0===t&&(t=!1),this.backendName=e,this.backend=this.findBackend(e),this.globalEngine=new Engine(this.backend,t,function(){return n.get(\"DEBUG\")})},e.prototype.findBackend=function(e){return e in this.registry?this.registry[e].backend:null},e.prototype.registerBackend=function(e,t,n,r){var o=this;if(void 0===n&&(n=1),e in this.registry)return console.warn(e+\" backend was already registered. Reusing existing backend\"),null!=r&&r(function(){return o.engine}),!1;try{var a=t();return this.registry[e]={backend:a,priority:n},!0}catch(t){return console.warn(\"Registration of backend \"+e+\" failed\"),console.warn(t.stack||t.message),!1}},e.prototype.removeBackend=function(e){if(!(e in this.registry))throw new Error(e+\" backend not found in registry\");this.registry[e].backend.dispose(),delete this.registry[e]},Object.defineProperty(e.prototype,\"engine\",{get:function(){return this.initDefaultBackend(),this.globalEngine},enumerable:!0,configurable:!0}),e.prototype.initDefaultBackend=function(){null==this.globalEngine&&this.initBackend(this.get(\"BACKEND\"),!1)},e}();function getGlobalNamespace(){var e;if(\"undefined\"!=typeof window)e=window;else{if(\"undefined\"==typeof process)throw new Error(\"Could not find a global object\");e=process}return e}function getOrMakeEnvironment(){var e=getGlobalNamespace();return null==e.ENV&&(e.ENV=new Environment(getFeaturesFromURL()),setTensorTracker(function(){return e.ENV.engine})),e.ENV}var ENV=getOrMakeEnvironment(),environment=Object.freeze({Environment:Environment,ENV:ENV});function warn(){for(var e=[],t=0;t=2*t+1||o%2==1?i.push(o):a.push(o);r.push.apply(r,a),r.push(0),r.push.apply(r,i)}return r}function getReshapedPermuted(e,t,n,r){void 0===r&&(r=!0);var o=[];r?o.push(e[0]/n):o.push(e[0]*n);for(var a=1;a=-n&&et||n===e){r=!0;break}n=nearestDivisor(e,n+1)}return n}function computeOutShape(e,t,n){for(var r=[],o=e.length,a=0;a0?o>=s[t]:o<=s[t]);o+=r[t])n+=1;return n}),[i,l]}function startForAxis(e,t,n,r,o){var a=t[o];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var i=r[o];return a<0&&(a+=i),a=clamp(0,a,i-1)}function stopForAxis(e,t,n,r,o){var a=t[o];e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var i=r[o];return a<0&&(a+=i),a=n[o]>0?clamp(0,a,i):clamp(-1,a,i-1)}function grad(e){return assert(isFunction(e),\"The f passed in grad(f) must be a function\"),function(t,n){return assert(t instanceof Tensor,\"The x passed in grad(f)(x) must be a tensor\"),assert(null==n||n instanceof Tensor,\"The dy passed in grad(f)(x, dy) must be a tensor\"),ENV.engine.tidy(function(){var r=ENV.engine.gradients(function(){return e(t)},[t],n),o=r.value,a=r.grads;return null!=n&&assertShapesMatch(o.shape,n.shape,\"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)\"),checkGrads(a),a[0]})}}function grads(e){return assert(isFunction(e),\"The f passed in grads(f) must be a function\"),function(t,n){return assert(Array.isArray(t)&&t.every(function(e){return e instanceof Tensor}),\"The args passed in grads(f)(args) must be an array of tensors\"),assert(null==n||n instanceof Tensor,\"The dy passed in grads(f)(args, dy) must be a tensor\"),ENV.engine.tidy(function(){var r=ENV.engine.gradients(function(){return e.apply(void 0,t)},t,n),o=r.value,a=r.grads;return null!=n&&assertShapesMatch(o.shape,n.shape,\"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])\"),checkGrads(a),a})}}function valueAndGrad(e){return assert(isFunction(e),\"The f passed in valueAndGrad(f) must be a function\"),function(t,n){assert(t instanceof Tensor,\"The x passed in valueAndGrad(f)(x) must be a tensor\"),assert(null==n||n instanceof Tensor,\"The dy passed in valueAndGrad(f)(x, dy) must be a tensor\");var r=ENV.engine.gradients(function(){return e(t)},[t],n),o=r.grads,a=r.value;return checkGrads(o),{grad:o[0],value:a}}}function valueAndGrads(e){return assert(isFunction(e),\"The f passed in valueAndGrads(f) must be a function\"),function(t,n){assert(Array.isArray(t)&&t.every(function(e){return e instanceof Tensor}),\"The args passed in valueAndGrads(f)(args) must be array of tensors\"),assert(null==n||n instanceof Tensor,\"The dy passed in valueAndGrads(f)(args, dy) must be a tensor\");var r=ENV.engine.gradients(function(){return e.apply(void 0,t)},t,n);return null!=n&&assertShapesMatch(r.value.shape,n.shape,\"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])\"),checkGrads(r.grads),r}}function variableGrads(e,t){if(assert(isFunction(e),\"The f passed in variableGrads(f) must be a function\"),assert(null==t||Array.isArray(t)&&t.every(function(e){return e instanceof Variable}),\"The varList passed in variableGrads(f, varList) must be an array of variables\"),null==t)for(var n in t=[],ENV.engine.registeredVariables)t.push(ENV.engine.registeredVariables[n]);var r=t.length;assert((t=t.filter(function(e){return e.trainable})).length>0,\"variableGrads() expects at least one of the input variables to be trainable, but none of the \"+r+\" variables is trainable.\");var o=ENV.engine.gradients(e,t,null,!0),a=o.value,i=o.grads;assert(i.some(function(e){return null!=e}),\"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().\"),assert(0===a.rank,\"The f passed in variableGrads(f) must return a scalar, but it returned a rank-\"+a.rank+\" tensor\");var s={};return t.forEach(function(e,t){null!=i[t]&&(s[e.name]=i[t])}),{value:a,grads:s}}function customGrad(e){return ENV.engine.customGrad(e)}function checkGrads(e){if(e.filter(function(e){return null==e}).length>0)throw new Error(\"Cannot compute gradient of y=f(x) with respect to x. Make sure that\\n the f you passed encloses all operations that lead from x to y.\")}function convertToTensor(e,t,n,r){if(void 0===r&&(r=\"float32\"),r=r||\"float32\",e instanceof Tensor)return e;if(!isTypedArray(e)&&!Array.isArray(e)&&\"number\"!=typeof e&&\"boolean\"!=typeof e)throw new Error(\"Argument '\"+t+\"' passed to '\"+n+\"' must be a Tensor or TensorLike, but got \"+e.constructor.name);var o=inferShape(e);return isTypedArray(e)||Array.isArray(e)||(e=[e]),Tensor.make(o,{values:toTypedArray(e,r,ENV.get(\"DEBUG\"))},r)}function convertToTensorArray(e,t,n){if(!Array.isArray(e))throw new Error(\"Argument \"+t+\" passed to \"+n+\" must be a `Tensor[]` or `TensorLike[]`\");return e.map(function(e,r){return convertToTensor(e,t+\"[\"+r+\"]\",n)})}function op(e){var t=Object.keys(e);if(1!==t.length)throw new Error(\"Please provide an object with a single key (operation name) mapping to a function. Got an object with \"+t.length+\" keys.\");var n=t[0],r=e[n];n.endsWith(\"_\")&&(n=n.substring(0,n.length-1));var o=function(){for(var e=[],t=0;t1)return zeros([0],r);var o=makeZerosTypedArray(Math.abs(Math.ceil((t-e)/n)),r);to}).sort(function(e,t){return t.score-e.score}),i=[],s=0;s=0;--d){if(intersectionOverUnion(e,c,i[d])>=r){p=!0;break}}if(!p&&(i.push(c),i.length>=n))break}return tensor1d(i,\"int32\")}function intersectionOverUnion(e,t,n){var r=e.subarray(4*t,4*t+4),o=e.subarray(4*n,4*n+4),a=Math.min(r[0],r[2]),i=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),u=Math.max(r[1],r[3]),l=Math.min(o[0],o[2]),c=Math.min(o[1],o[3]),p=Math.max(o[0],o[2]),d=Math.max(o[1],o[3]),h=(s-a)*(u-i),f=(p-l)*(d-c);if(h<=0||f<=0)return 0;var m=Math.max(a,l),g=Math.max(i,c),v=Math.min(s,p),y=Math.min(u,d),x=Math.max(v-m,0)*Math.max(y-g,0);return x/(h+f-x)}function topkImpl(e,t,n,r,o){for(var a=t[t.length-1],i=[e.length/a,a],s=i[0],u=i[1],l=getTypedArrayFromDType(n,s*r),c=getTypedArrayFromDType(\"int32\",s*r),p=0;p\":\"<\",u=n?\"inOffset + i;\":\"round(getBestIndicesA(batch, inOffset + i));\";this.userCode=\"\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int batch = coords[0];\\n int outIdx = coords[1];\\n int inOffset = outIdx * \"+r+\";\\n\\n int bestIndex = 0;\\n float bestValue = getA(batch, inOffset);\\n\\n for (int i = 0; i < \"+r+\"; i++) {\\n int inIdx = \"+u+\";\\n float candidate = getA(batch, inIdx);\\n if (candidate \"+s+\" bestValue) {\\n bestValue = candidate;\\n bestIndex = inIdx;\\n }\\n }\\n setOutput(float(bestIndex));\\n }\\n \"}}(),AvgPool2DBackpropProgram=function(){return function(e){this.variableNames=[\"dy\"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,s=1/(t*n);this.userCode=\"\\n const ivec2 pads = ivec2(\"+a+\", \"+i+\");\\n const float avgMultiplier = float(\"+s+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n\\n ivec2 dyRCCorner = coords.yz - pads;\\n int dyRCorner = dyRCCorner.x;\\n int dyCCorner = dyRCCorner.y;\\n\\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n for (int wR = 0; wR < \"+t+\"; wR++) {\\n float dyR = float(dyRCorner + wR) / \"+r+\".0;\\n\\n if (dyR < 0.0 || dyR >= \"+e.outHeight+\".0 || fract(dyR) > 0.0) {\\n continue;\\n }\\n int idyR = int(dyR);\\n\\n for (int wC = 0; wC < \"+n+\"; wC++) {\\n float dyC = float(dyCCorner + wC) / \"+o+\".0;\\n\\n if (dyC < 0.0 || dyC >= \"+e.outWidth+\".0 ||\\n fract(dyC) > 0.0) {\\n continue;\\n }\\n int idyC = int(dyC);\\n\\n float dyValue = getDy(b, idyR, idyC, d);\\n\\n dotProd += dyValue * avgMultiplier;\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}();function getBroadcastDims(e,t){for(var n=e.length,r=[],o=0;o1&&1===i&&r.unshift(a)}return r}function getReductionAxes(e,t){for(var n=[],r=0;r1)&&n.unshift(a)}return n}function broadcastDimsAreOuter(e){for(var t=0;t1&&s>1&&i!==s)throw Error(r);n.unshift(Math.max(i,s))}return n}var BatchNormProgram=function(){return function(e,t,n,r,o,a){this.outputShape=[],this.supportsBroadcasting=!0,this.variableNames=[\"x\",\"mean\",\"variance\"],assertAndGetBroadcastShape(e,t),assertAndGetBroadcastShape(e,n);var i=\"0.0\";null!=r&&(assertAndGetBroadcastShape(e,r),this.variableNames.push(\"offset\"),i=\"getOffsetAtOutCoords()\");var s=\"1.0\";null!=o&&(assertAndGetBroadcastShape(e,o),this.variableNames.push(\"scale\"),s=\"getScaleAtOutCoords()\"),this.outputShape=e,this.userCode=\"\\n void main() {\\n float x = getXAtOutCoords();\\n float mean = getMeanAtOutCoords();\\n float variance = getVarianceAtOutCoords();\\n float offset = \"+i+\";\\n float scale = \"+s+\";\\n float inv = scale * inversesqrt(variance + float(\"+a+\"));\\n setOutput((x - mean) * inv + offset);\\n }\\n \"}}(),CHECK_NAN_SNIPPET=\"\\n if (isNaN(a)) return a;\\n if (isNaN(b)) return b;\\n\",ADD=\"return a + b;\",SUB=\"return a - b;\",MUL=\"return a * b;\",DIV=\"if (a == b) return 1.0;\\n return a / b;\",INT_DIV=\"\\n float resultSign = sign(a) * sign(b);\\n int ia = round(a);\\n int ib = round(b);\\n int result = ia / ib;\\n int amodb = ia - ib * result;\\n\\n if (resultSign < 0.0 && amodb != 0) {\\n result -= 1;\\n }\\n return float(result);\\n\",POW=\"\\nif(a < 0.0 && floor(b) < b){\\n return NAN;\\n}\\nreturn (round(mod(b, 2.0)) == 0 || round(mod(b, 2.0)) == 2) ?\\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\\n\",SQUARED_DIFFERENCE=\"return (a - b) * (a - b);\",EQUAL=\"return float(a == b);\",NOT_EQUAL=\"return float(a != b);\",LESS=\"return float(a < b);\",LESS_EQUAL=\"return float(a <= b);\",GREATER=\"return float(a > b);\",GREATER_EQUAL=\"return float(a >= b);\",LOGICAL_AND=\"return float(a >= 1.0 && b >= 1.0);\",LOGICAL_OR=\"return float(a >= 1.0 || b >= 1.0);\",MAX=CHECK_NAN_SNIPPET+\"\\n return max(a, b);\\n\",MIN=CHECK_NAN_SNIPPET+\"\\n return min(a, b);\\n\",MOD=\"if (b == 0.0) return NAN;\\n return mod(a, b);\",ATAN2=CHECK_NAN_SNIPPET+\"\\n return atan(a, b);\\n\",ELU_DER=\"return (b >= 1.0) ? a : a * (b + 1.0);\",BinaryOpProgram=function(){function e(e,t,n){this.variableNames=[\"A\",\"B\"],this.supportsBroadcasting=!0,this.outputShape=assertAndGetBroadcastShape(t,n),this.userCode=\"\\n uniform float NAN;\\n float binaryOperation(float a, float b) {\\n \"+e+\"\\n }\\n\\n void main() {\\n float a = getAAtOutCoords();\\n float b = getBAtOutCoords();\\n setOutput(binaryOperation(a, b));\\n }\\n \"}return e.prototype.getCustomSetupFunc=function(){var e=this;return function(t,n){null==e.startLoc&&(e.startLoc=t.getUniformLocationNoThrow(n,\"NAN\"),null==e.startLoc)||t.gl.uniform1f(e.startLoc,NaN)}},e}(),ClipProgram=function(){return function(e,t,n){this.variableNames=[\"A\"],this.outputShape=e;var r=t.toFixed(20),o=n.toFixed(20);this.userCode=\"\\n void main() {\\n float value = getAAtOutCoords();\\n if (isNaN(value)) {\\n setOutput(value);\\n return;\\n }\\n\\n setOutput(clamp(value, \"+r+\", \"+o+\"));\\n }\\n \"}}();function assertParams(e,t,n){var r=e.length,o=t.length;assert(e.length===t.length,\"Error in concat\"+r+\"D: rank of x1 (\"+r+\") and x2 (\"+o+\") must be the same.\"),assert(n>=0&&n= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int yC = 0; yC < \"+e.outWidth+\"; yC++) {\\n int xC = wC + yC * \"+n+\" - \"+o+\";\\n\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n continue;\\n }\\n\\n float dyValue = getDy(b, yR, yC, d2);\\n float xValue = getX(b, xR, xC, d1);\\n dotProd += (xValue * dyValue);\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),Conv2DDerInputProgram=function(){return function(e){this.variableNames=[\"dy\",\"W\"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left;this.userCode=\"\\n const ivec2 pads = ivec2(\"+a+\", \"+i+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d1 = coords[3];\\n\\n ivec2 dyCorner = coords.yz - pads;\\n int dyRCorner = dyCorner.x;\\n int dyCCorner = dyCorner.y;\\n\\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n for (int wR = 0; wR < \"+t+\"; wR++) {\\n float dyR = float(dyRCorner + wR) / \"+r+\".0;\\n\\n if (dyR < 0.0 || dyR >= \"+e.outHeight+\".0 || fract(dyR) > 0.0) {\\n continue;\\n }\\n int idyR = int(dyR);\\n\\n int wRPerm = \"+t+\" - 1 - wR;\\n\\n for (int wC = 0; wC < \"+n+\"; wC++) {\\n float dyC = float(dyCCorner + wC) / \"+o+\".0;\\n\\n if (dyC < 0.0 || dyC >= \"+e.outWidth+\".0 ||\\n fract(dyC) > 0.0) {\\n continue;\\n }\\n int idyC = int(dyC);\\n\\n int wCPerm = \"+n+\" - 1 - wC;\\n\\n for (int d2 = 0; d2 < \"+e.outChannels+\"; d2++) {\\n float xValue = getDy(batch, idyR, idyC, d2);\\n float wValue = getW(wRPerm, wCPerm, d1, d2);\\n dotProd += xValue * wValue;\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),DepthwiseConv2DDerFilterProgram=function(){return function(e){this.variableNames=[\"x\",\"dy\"],this.outputShape=e.filterShape;var t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,o=e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=\"\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int wR = coords.x;\\n int wC = coords.y;\\n int d1 = coords.z;\\n int dm = coords.w;\\n int d2 = d1 * \"+a+\" + dm;\\n\\n float dotProd = 0.0;\\n\\n // TODO: Vec4 over the batch size\\n for (int b = 0; b < \"+e.batchSize+\"; b++) {\\n for (int yR = 0; yR < \"+e.outHeight+\"; yR++) {\\n int xR = wR + yR * \"+t+\" - \"+r+\";\\n\\n if (xR < 0 || xR >= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int yC = 0; yC < \"+e.outWidth+\"; yC++) {\\n int xC = wC + yC * \"+n+\" - \"+o+\";\\n\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n continue;\\n }\\n\\n float dyValue = getDy(b, yR, yC, d2);\\n float xValue = getX(b, xR, xC, d1);\\n dotProd += (xValue * dyValue);\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),DepthwiseConv2DDerInputProgram=function(){return function(e){this.variableNames=[\"dy\",\"W\"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=\"\\n const ivec2 pads = ivec2(\"+a+\", \"+i+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d1 = coords[3];\\n ivec2 dyCorner = coords.yz - pads;\\n int dyRCorner = dyCorner.x;\\n int dyCCorner = dyCorner.y;\\n\\n float dotProd = 0.0;\\n\\n for (int wR = 0; wR < \"+t+\"; wR++) {\\n float dyR = float(dyRCorner + wR) / \"+r+\".0;\\n\\n if (dyR < 0.0 || dyR >= \"+e.outHeight+\".0 || fract(dyR) > 0.0) {\\n continue;\\n }\\n int idyR = int(dyR);\\n\\n int wRPerm = \"+t+\" - 1 - wR;\\n\\n for (int wC = 0; wC < \"+n+\"; wC++) {\\n float dyC = float(dyCCorner + wC) / \"+o+\".0;\\n\\n if (dyC < 0.0 || dyC >= \"+e.outWidth+\".0 ||\\n fract(dyC) > 0.0) {\\n continue;\\n }\\n int idyC = int(dyC);\\n\\n int wCPerm = \"+n+\" - 1 - wC;\\n\\n // TODO: Vec4 over the channelMul\\n for (int dm = 0; dm < \"+s+\"; dm++) {\\n int d2 = d1 * \"+s+\" + dm;\\n float xValue = getDy(batch, idyR, idyC, d2);\\n float wValue = getW(wRPerm, wCPerm, d1, dm);\\n dotProd += xValue * wValue;\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),Conv2DProgram=function(){return function(e){this.variableNames=[\"x\",\"W\"],this.outputShape=e.outShape;var t=e.padInfo.top,n=e.padInfo.left,r=e.strideHeight,o=e.strideWidth,a=e.dilationHeight,i=e.dilationWidth,s=e.filterHeight,u=e.filterWidth,l=4*Math.floor(e.inChannels/4),c=e.inChannels%4;this.userCode=\"\\n const ivec2 strides = ivec2(\"+r+\", \"+o+\");\\n const ivec2 pads = ivec2(\"+t+\", \"+n+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d2 = coords[3];\\n\\n ivec2 xRCCorner = coords.yz * strides - pads;\\n int xRCorner = xRCCorner.x;\\n int xCCorner = xRCCorner.y;\\n\\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n for (int wR = 0; wR < \"+s+\"; wR++) {\\n int xR = xRCorner + wR * \"+a+\";\\n\\n if (xR < 0 || xR >= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int wC = 0; wC < \"+u+\"; wC++) {\\n int xC = xCCorner + wC * \"+i+\";\\n\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n continue;\\n }\\n\\n for (int d1 = 0; d1 < \"+l+\"; d1 += 4) {\\n vec4 xValues = vec4(\\n getX(batch, xR, xC, d1),\\n getX(batch, xR, xC, d1 + 1),\\n getX(batch, xR, xC, d1 + 2),\\n getX(batch, xR, xC, d1 + 3)\\n );\\n vec4 wValues = vec4(\\n getW(wR, wC, d1, d2),\\n getW(wR, wC, d1 + 1, d2),\\n getW(wR, wC, d1 + 2, d2),\\n getW(wR, wC, d1 + 3, d2)\\n );\\n\\n dotProd += dot(xValues, wValues);\\n }\\n\\n if (\"+(1===c)+\") {\\n dotProd +=\\n getX(batch, xR, xC, \"+l+\") *\\n getW(wR, wC, \"+l+\", d2);\\n } else if (\"+(2===c)+\") {\\n vec2 xValues = vec2(\\n getX(batch, xR, xC, \"+l+\"),\\n getX(batch, xR, xC, \"+l+\" + 1)\\n );\\n vec2 wValues = vec2(\\n getW(wR, wC, \"+l+\", d2),\\n getW(wR, wC, \"+l+\" + 1, d2)\\n );\\n dotProd += dot(xValues, wValues);\\n } else if (\"+(3===c)+\") {\\n vec3 xValues = vec3(\\n getX(batch, xR, xC, \"+l+\"),\\n getX(batch, xR, xC, \"+l+\" + 1),\\n getX(batch, xR, xC, \"+l+\" + 2)\\n );\\n vec3 wValues = vec3(\\n getW(wR, wC, \"+l+\", d2),\\n getW(wR, wC, \"+l+\" + 1, d2),\\n getW(wR, wC, \"+l+\" + 2, d2)\\n );\\n dotProd += dot(xValues, wValues);\\n }\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),DepthwiseConv2DProgram=function(){return function(e){this.variableNames=[\"x\",\"W\"],this.outputShape=e.outShape;var t=e.inHeight,n=e.inWidth,r=e.padInfo.top,o=e.padInfo.left,a=e.strideHeight,i=e.strideWidth,s=e.dilationHeight,u=e.dilationWidth,l=e.filterHeight,c=e.filterWidth,p=e.outChannels/e.inChannels;this.userCode=\"\\n const ivec2 strides = ivec2(\"+a+\", \"+i+\");\\n const ivec2 pads = ivec2(\"+r+\", \"+o+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords.x;\\n ivec2 xRCCorner = coords.yz * strides - pads;\\n int d2 = coords.w;\\n int d1 = d2 / \"+p+\";\\n int q = d2 - d1 * \"+p+\";\\n\\n int xRCorner = xRCCorner.x;\\n int xCCorner = xRCCorner.y;\\n\\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\\n for (int wR = 0; wR < \"+l+\"; wR++) {\\n int xR = xRCorner + wR * \"+s+\";\\n\\n if (xR < 0 || xR >= \"+t+\") {\\n continue;\\n }\\n\\n for (int wC = 0; wC < \"+c+\"; wC++) {\\n int xC = xCCorner + wC * \"+u+\";\\n\\n if (xC < 0 || xC >= \"+n+\") {\\n continue;\\n }\\n\\n float xVal = getX(batch, xR, xC, d1);\\n float wVal = getW(wR, wC, d1, q);\\n dotProd += xVal * wVal;\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}();function makeShader(e,t,n,r){var o=e.map(function(e){var t=sizeFromShape(e.shapeInfo.logicalShape);return e.shapeInfo.isUniform?\"uniform float \"+e.name+(t>1?\"[\"+t+\"]\":\"\")+\";\":\"uniform sampler2D \"+e.name+\";\"});o=o.join(\"\\n\");var a=e.map(function(e){return getInputSamplingSnippet(e,t,r)}).join(\"\\n\"),i=t.texShape,s=getOutputSamplingSnippet(t.logicalShape,i);return[SHADER_PREFIX,FLOAT_TEXTURE_SAMPLE_SNIPPET,FLOAT_TEXTURE_SETOUTPUT_SNIPPET,o,s,a,n].join(\"\\n\")}function getSamplerFromInInfo(e){var t=e.shapeInfo.logicalShape;switch(t.length){case 0:return getSamplerScalar(e);case 1:return getSampler1D(e);case 2:return getSampler2D(e);case 3:return getSampler3D(e);case 4:return getSampler4D(e);case 5:return getSampler5D(e);case 6:return getSampler6D(e);default:throw new Error(t.length+\"-D input sampling is not yet supported\")}}function getInputSamplingSnippet(e,t,n){var r=getSamplerFlat(e);return r+=getSamplerFromInInfo(e),(n||arraysEqual(e.shapeInfo.logicalShape,t.logicalShape))&&(r+=getSamplerAtOutputCoords(e,t,n)),r}function getOutputSamplingSnippet(e,t){switch(e.length){case 0:return getOutputScalarCoords();case 1:return getOutput1DCoords(e,t);case 2:return getOutput2DCoords(e,t);case 3:return getOutput3DCoords(e,t);case 4:return getOutput4DCoords(e,t);case 5:return getOutput5DCoords(e,t);case 6:return getOutput6DCoords(e,t);default:throw new Error(e.length+\"-D output sampling is not yet supported\")}}var SAMPLE_1D_SNIPPET=\"\\nvec2 UVfrom1D(int texNumR, int texNumC, int index) {\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_2D_SNIPPET=\"\\nvec2 UVfrom2D(int texNumR, int texNumC, int numC, int row, int col) {\\n int index = row * numC + col;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_3D_SNIPPET=\"\\nvec2 UVfrom3D(int texNumR, int texNumC, int stride0,\\n int stride1, int row, int col, int depth) {\\n // Explicitly use integer operations as dot() only works on floats.\\n int index = row * stride0 + col * stride1 + depth;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_4D_SNIPPET=\"\\nvec2 UVfrom4D(int texNumR, int texNumC, int stride0,\\n int stride1, int stride2, int row, int col, int depth,\\n int depth2) {\\n // Explicitly use integer operations as dot() only works on floats.\\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_5D_SNIPPET=\"\\nvec2 UVfrom5D(int texNumR, int texNumC, int stride0,\\n int stride1, int stride2, int stride3, int row, int col, int depth,\\n int depth2, int depth3) {\\n // Explicitly use integer operations as dot() only works on floats.\\n int index = row * stride0 + col * stride1 +\\n depth * stride2 + depth2 * stride3 + depth3;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",SAMPLE_6D_SNIPPET=\"\\nvec2 UVfrom6D(int texNumR, int texNumC, int stride0,\\n int stride1, int stride2, int stride3, int stride4,\\n int row, int col, int depth, int depth2, int depth3, int depth4) {\\n // Explicitly use integer operations as dot() only works on floats.\\n int index = row * stride0 + col * stride1 + depth * stride2 + depth2 *\\n stride3 + depth3 * stride4 + depth4;\\n int texR = index / texNumC;\\n int texC = index - texR * texNumC;\\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\\n}\\n\",FLOAT_TEXTURE_SAMPLE_SNIPPET=\"\\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\\n return texture2D(textureSampler, uv).r;\\n }\\n\",FLOAT_TEXTURE_SETOUTPUT_SNIPPET=\"\\n void setOutput(float val) {\\n gl_FragColor = vec4(val, 0, 0, 0);\\n }\\n\",SHADER_PREFIX=\"\\n precision highp float;\\n precision highp int;\\n varying vec2 resultUV;\\n const vec2 halfCR = vec2(0.5, 0.5);\\n\\n struct ivec5\\n {\\n int x;\\n int y;\\n int z;\\n int w;\\n int u;\\n };\\n\\n struct ivec6\\n {\\n int x;\\n int y;\\n int z;\\n int w;\\n int u;\\n int v;\\n };\\n\\n bool isNaN(float val) {\\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\\n }\\n\\n bool hasNaN(vec4 values) {\\n vec4 v1 = values * values;\\n vec4 v2 = values * values;\\n return any(notEqual(v1, v2));\\n }\\n\\n float getNaN(vec4 values) {\\n return dot(vec4(1), values);\\n }\\n\\n int round(float value) {\\n return int(floor(value + 0.5));\\n }\\n\\n int imod(int x, int y) {\\n return x - y * (x / y);\\n }\\n\\n //Based on the work of Dave Hoskins\\n //https://www.shadertoy.com/view/4djSRW\\n #define HASHSCALE1 443.8975\\n float random(float seed){\\n vec2 p = resultUV * seed;\\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\\n p3 += dot(p3, p3.yzx + 19.19);\\n return fract((p3.x + p3.y) * p3.z);\\n }\\n\\n \"+SAMPLE_1D_SNIPPET+\"\\n \"+SAMPLE_2D_SNIPPET+\"\\n \"+SAMPLE_3D_SNIPPET+\"\\n \"+SAMPLE_4D_SNIPPET+\"\\n \"+SAMPLE_5D_SNIPPET+\"\\n \"+SAMPLE_6D_SNIPPET+\"\\n\";function getOutputScalarCoords(){return\"\\n int getOutputCoords() {\\n return 0;\\n }\\n \"}function getOutput1DCoords(e,t){return 1===t[0]?\"\\n int getOutputCoords() {\\n return int(resultUV.x * \"+t[1]+\".0);\\n }\\n \":1===t[1]?\"\\n int getOutputCoords() {\\n return int(resultUV.y * \"+t[0]+\".0);\\n }\\n \":\"\\n int getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n return resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n }\\n \"}function getOutput3DCoords(e,t){var n=e[1]*e[2],r=e[2];return\"\\n ivec3 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n int r = index / \"+n+\";\\n index -= r * \"+n+\";\\n int c = index / \"+r+\";\\n int d = index - c * \"+r+\";\\n return ivec3(r, c, d);\\n }\\n \"}function getOutput4DCoords(e,t){var n=e[3],r=e[2]*n,o=e[1]*r;return\"\\n ivec4 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n\\n int r = index / \"+o+\";\\n index -= r * \"+o+\";\\n\\n int c = index / \"+r+\";\\n index -= c * \"+r+\";\\n\\n int d = index / \"+n+\";\\n int d2 = index - d * \"+n+\";\\n\\n return ivec4(r, c, d, d2);\\n }\\n \"}function getOutput5DCoords(e,t){var n=e[4],r=e[3]*n,o=e[2]*r,a=e[1]*o;return\"\\n ivec5 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(\"+t[0]+\",\\n \"+t[1]+\"));\\n\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n\\n int r = index / \"+a+\";\\n index -= r * \"+a+\";\\n\\n int c = index / \"+o+\";\\n index -= c * \"+o+\";\\n\\n int d = index / \"+r+\";\\n index -= d * \"+r+\";\\n\\n int d2 = index / \"+n+\";\\n int d3 = index - d2 * \"+n+\";\\n\\n ivec5 outShape = ivec5(r, c, d, d2, d3);\\n return outShape;\\n }\\n \"}function getOutput6DCoords(e,t){var n=e[5],r=e[4]*n,o=e[3]*r,a=e[2]*o,i=e[1]*a;return\"\\n ivec6 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n\\n int r = index / \"+i+\";\\n index -= r * \"+i+\";\\n\\n int c = index / \"+a+\";\\n index -= c * \"+a+\";\\n\\n int d = index / \"+o+\";\\n index -= d * \"+o+\";\\n\\n int d2 = index / \"+r+\";\\n index -= d2 * \"+r+\";\\n\\n int d3 = index / \"+n+\";\\n int d4 = index - d3 * \"+n+\";\\n\\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\\n return result;\\n }\\n \"}function getOutput2DCoords(e,t){return arraysEqual(e,t)?\"\\n ivec2 getOutputCoords() {\\n return ivec2(resultUV.yx * vec2(\"+t[0]+\", \"+t[1]+\"));\\n }\\n \":1===e[1]?\"\\n ivec2 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n return ivec2(index, 0);\\n }\\n \":1===e[0]?\"\\n ivec2 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n return ivec2(0, index);\\n }\\n \":\"\\n ivec2 getOutputCoords() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+t[0]+\", \"+t[1]+\"));\\n int index = resTexRC.x * \"+t[1]+\" + resTexRC.y;\\n int r = index / \"+e[1]+\";\\n int c = index - r * \"+e[1]+\";\\n return ivec2(r, c);\\n }\\n \"}function getSamplerScalar(e){var t=e.name,n=\"get\"+t.charAt(0).toUpperCase()+t.slice(1);return e.shapeInfo.isUniform?\"float \"+n+\"() {return \"+t+\";}\":\"\\n float \"+n+\"() {\\n return sampleTexture(\"+t+\", halfCR);\\n }\\n \"}function getSampler1D(e){var t=e.name,n=\"get\"+t.charAt(0).toUpperCase()+t.slice(1);return\"\\n float \"+n+\"(int index) {\\n return \"+n+\"Flat(index);\\n }\\n \"}function getSampler2D(e){var t=e.shapeInfo.logicalShape,n=e.name,r=\"get\"+n.charAt(0).toUpperCase()+n.slice(1),o=e.shapeInfo.texShape;if(null!=o&&arraysEqual(t,o)){var a=o[0];return\"\\n float \"+r+\"(int row, int col) {\\n vec2 uv = (vec2(col, row) + halfCR) / vec2(\"+o[1]+\".0, \"+a+\".0);\\n return sampleTexture(\"+n+\", uv);\\n }\\n \"}var i=squeezeShape(t),s=i.newShape,u=i.keptDims,l=s;if(l.length=1?\"coords = 0;\":s.map(function(e){return\"coords[\"+(e+u)+\"] = 0;\"}).join(\"\\n\"))+\"\\n return get\"+n+\"(\"+(a<2&&o>0?\"coords\":e.shapeInfo.logicalShape.map(function(e,t){return\"coords[\"+(t+u)+\"]\"}).join(\", \"))+\");\\n }\\n \"}function getSamplerAtOutputCoords(e,t,n){var r=e.name,o=r.charAt(0).toUpperCase()+r.slice(1),a=\"get\"+o+\"AtOutCoords\",i=getBroadcastDims(e.shapeInfo.logicalShape,t.logicalShape),s=e.shapeInfo.logicalShape.length,u=t.logicalShape.length,l=n&&(u>s||i.length>0),c=broadcastDimsAreOuter(i),p=e.shapeInfo.isUniform;if(l&&!c)return getBroadcastOutputCoordsSampler(e,t,o,a);var d=sizeFromShape(e.shapeInfo.logicalShape),h=\"\";l&&c&&(h=\"\\n int mainPart = index / \"+d+\";\\n index -= mainPart * \"+d+\";\\n \");var f=t.texShape;if(p)return 1===d?\"float \"+a+\"() {return \"+r+\";}\":\"\\n float \"+a+\"() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+f[0]+\", \"+f[1]+\"));\\n int index = resTexRC.x * \"+f[1]+\" + resTexRC.y;\\n \"+h+\"\\n return get\"+o+\"Flat(index);\\n }\\n \";var m=e.shapeInfo.texShape;return arraysEqual(m,f)?\"\\n float \"+a+\"() {\\n return sampleTexture(\"+r+\", resultUV);\\n }\\n \":\"\\n float \"+a+\"() {\\n ivec2 resTexRC = ivec2(resultUV.yx *\\n vec2(\"+f[0]+\", \"+f[1]+\"));\\n int index = resTexRC.x * \"+f[1]+\" + resTexRC.y;\\n \"+h+\"\\n int texR = index / \"+m[1]+\";\\n int texC = index - texR * \"+m[1]+\";\\n vec2 uv = (vec2(texC, texR) + halfCR) /\\n vec2(\"+m[1]+\".0, \"+m[0]+\".0);\\n\\n return sampleTexture(\"+r+\", uv);\\n }\\n \"}function getCoordsDataType(e){if(e<=1)return\"int\";if(2===e)return\"ivec2\";if(3===e)return\"ivec3\";if(4===e)return\"ivec4\";if(5===e)return\"ivec5\";if(6===e)return\"ivec6\";throw Error(\"GPU for rank \"+e+\" is not yet supported\")}function squeezeInputInfo(e,t){var n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function getSqueezedParams(e,t){return t.map(function(t){return e[t]}).join(\", \")}var CumSumProgram=function(){return function(e,t,n){this.variableNames=[\"x\"],this.outputShape=e;var r=e.length,o=e[e.length-1],a=n?\"<\":\">\";this.userCode=\"\\n int getIndex(int i) {\\n \"+(n?\"return \"+o+\" -i - 1;\":\"return i;\")+\"\\n }\\n\\n void main() {\\n \"+getCoordsDataType(r)+\" coords = getOutputCoords();\\n int end = \"+getFinalCoord(r,\"coords\")+\";\\n float val = 0.0;\\n for (int i = \"+o+\" - 1; i >= 0; i -= 1) {\\n int idx = getIndex(i);\\n if (idx \"+a+\" end) {\\n continue;\\n }\\n if (idx == end && \"+t+\") {\\n continue;\\n }\\n \"+getFinalCoord(r,\"coords\")+\" = idx;\\n val += getX(\"+getCoords(r,\"coords\")+\");\\n }\\n setOutput(val);\\n }\\n \"}}();function getCoords(e,t){if(1===e)return\"\"+t;if(2===e)return t+\".x, \"+t+\".y\";if(3===e)return t+\".x, \"+t+\".y, \"+t+\".z\";if(4===e)return t+\".x, \"+t+\".y, \"+t+\".z, \"+t+\".w\";throw Error(\"Cumulative sum for rank \"+e+\" is not yet supported\")}function getFinalCoord(e,t){if(1===e)return\"\"+t;if(2===e)return t+\".y\";if(3===e)return t+\".z\";if(4===e)return t+\".w\";throw Error(\"Cumulative sum for rank \"+e+\" is not yet supported\")}var TextureUsage,PhysicalTextureType,EncodeFloatProgram=function(){return function(e){this.variableNames=[\"A\"],this.outputShape=e,this.userCode=\"\\n const float FLOAT_MAX = 1.70141184e38;\\n const float FLOAT_MIN = 1.17549435e-38;\\n\\n lowp vec4 encode_float(highp float v) {\\n if (isNaN(v)) {\\n return vec4(255, 255, 255, 255);\\n }\\n\\n highp float av = abs(v);\\n\\n if(av < FLOAT_MIN) {\\n return vec4(0.0, 0.0, 0.0, 0.0);\\n } else if(v > FLOAT_MAX) {\\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\\n } else if(v < -FLOAT_MAX) {\\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\\n }\\n\\n highp vec4 c = vec4(0,0,0,0);\\n\\n highp float e = floor(log2(av));\\n highp float m = exp2(fract(log2(av))) - 1.0;\\n\\n c[2] = floor(128.0 * m);\\n m -= c[2] / 128.0;\\n c[1] = floor(32768.0 * m);\\n m -= c[1] / 32768.0;\\n c[0] = floor(8388608.0 * m);\\n\\n highp float ebias = e + 127.0;\\n c[3] = floor(ebias / 2.0);\\n ebias -= c[3] * 2.0;\\n c[2] += floor(ebias) * 128.0;\\n\\n c[3] += 128.0 * step(0.0, -v);\\n\\n return c / 255.0;\\n }\\n\\n void main() {\\n float x = getAAtOutCoords();\\n gl_FragColor = encode_float(x);\\n }\\n \"}}(),FromPixelsProgram=function(){return function(e){this.variableNames=[\"A\"];var t=e[0],n=e[1];this.outputShape=e,this.userCode=\"\\n void main() {\\n ivec3 coords = getOutputCoords();\\n int texR = coords[0];\\n int texC = coords[1];\\n int depth = coords[2];\\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(\"+n+\".0, \"+t+\".0);\\n\\n vec4 values = texture2D(A, uv);\\n float value;\\n if (depth == 0) {\\n value = values.r;\\n } else if (depth == 1) {\\n value = values.g;\\n } else if (depth == 2) {\\n value = values.b;\\n } else if (depth == 3) {\\n value = values.a;\\n }\\n\\n setOutput(floor(value * 255.0 + 0.5));\\n }\\n \"}}(),GatherProgram=function(){return function(e,t,n){this.variableNames=[\"A\",\"indices\"];var r=e.slice();r[n]=t,this.outputShape=r,this.rank=r.length;var o=getCoordsDataType(this.rank),a=getSourceCoords(e,n);this.userCode=\"\\n void main() {\\n \"+o+\" resRC = getOutputCoords();\\n setOutput(getA(\"+a+\"));\\n }\\n \"}}();function getSourceCoords(e,t){var n=e.length;if(n>4)throw Error(\"Gather for rank \"+n+\" is not yet supported\");if(1===n)return\"int(getIndices(resRC))\";for(var r=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],o=[],a=0;a= \"+r);for(var o=0,a=0;a= \"+r);for(var o=0,a=0;a= \"+o);for(var a=getPackedMatrixTextureShapeWidthHeight(t,n),i=a[0],s=a[1],u=n%2==1,l=t%2==1,c=Math.floor(n/2),p=Math.floor(t/2),d=u?4:0,h=n,f=0,m=0;m= \"+o);for(var a=n%2==1,i=t%2==1,s=Math.floor(n/2),u=Math.floor(t/2),l=getPackedMatrixTextureShapeWidthHeight(t,n),c=l[0],p=l[1],d=a?4:0,h=n+(a?1:0),f=0,m=0,g=n,v=0;vr||n>r){o=\"[\"+t+\"x\"+n+\"]\";throw new Error(\"Requested texture size \"+o+\" greater than WebGL maximum on this browser / GPU \"+(\"[\"+r+\"x\"+r+\"]\")+\".\")}}function createFramebuffer(e){return throwIfNull(e,function(){return e.createFramebuffer()},\"Unable to create WebGLFramebuffer.\")}function bindVertexBufferToProgramAttribute(e,t,n,r,o,a,i){var s=e.getAttribLocation(t,n);return-1!==s&&(callAndCheck(e,function(){return e.bindBuffer(e.ARRAY_BUFFER,r)}),callAndCheck(e,function(){return e.vertexAttribPointer(s,o,e.FLOAT,!1,a,i)}),callAndCheck(e,function(){return e.enableVertexAttribArray(s)}),!0)}function bindTextureUnit(e,t,n){validateTextureUnit(e,n),callAndCheck(e,function(){return e.activeTexture(e.TEXTURE0+n)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)})}function unbindTextureUnit(e,t){validateTextureUnit(e,t),callAndCheck(e,function(){return e.activeTexture(e.TEXTURE0+t)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function getProgramUniformLocationOrThrow(e,t,n){return throwIfNull(e,function(){return e.getUniformLocation(t,n)},'uniform \"'+n+'\" not present in program.')}function getProgramUniformLocation(e,t,n){return e.getUniformLocation(t,n)}function bindTextureToProgramUniformSampler(e,t,n,r,o){callAndCheck(e,function(){return bindTextureUnit(e,n,o)}),callAndCheck(e,function(){return e.uniform1i(r,o)})}function bindCanvasToFramebuffer(e){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,null)}),callAndCheck(e,function(){return e.viewport(0,0,e.canvas.width,e.canvas.height)}),callAndCheck(e,function(){return e.scissor(0,0,e.canvas.width,e.canvas.height)})}function bindColorTextureToFramebuffer(e,t,n){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,n)}),callAndCheck(e,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)})}function unbindColorTextureFromFramebuffer(e,t){callAndCheck(e,function(){return e.bindFramebuffer(e.FRAMEBUFFER,t)}),callAndCheck(e,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)})}function validateFramebuffer(e){var t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error(\"Error binding framebuffer: \"+getFramebufferErrorMessage(e,t))}function getFramebufferErrorMessage(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\";case e.FRAMEBUFFER_UNSUPPORTED:return\"FRAMEBUFFER_UNSUPPORTED\";default:return\"unknown error \"+t}}function throwIfNull(e,t,n){var r=callAndCheck(e,function(){return t()});if(null==r)throw new Error(n);return r}function validateTextureUnit(e,t){var n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(rn)throw new Error(\"textureUnit must be in \"+(\"[gl.TEXTURE0, gl.TEXTURE\"+n+\"]\")+\".\")}function getTextureShapeFromLogicalShape(e,t){2!==t.length&&(t=squeezeShape(t).newShape);var n=queryMaxTextureSize(e),r=sizeFromShape(t);return t.length<=1&&r<=n?[r,1]:2===t.length&&t[0]<=n&&t[1]<=n?t:3===t.length&&t[0]<=n&&t[1]*t[2]<=n?[t[0],t[1]*t[2]]:4===t.length&&t[0]<=n&&t[1]*t[2]*t[3]<=n?[t[0],t[1]*t[2]*t[3]]:sizeToSquarishShape(r)}var webgl_util=Object.freeze({createWebGLRenderingContext:createWebGLRenderingContext,createWebGLRenderingContextFromCanvas:createWebGLRenderingContextFromCanvas,callAndCheck:callAndCheck,enableDebugWebGLErrorChecking:enableDebugWebGLErrorChecking,checkWebGLError:checkWebGLError,getWebGLErrorMessage:getWebGLErrorMessage,getExtensionOrThrow:getExtensionOrThrow,createVertexShader:createVertexShader,createFragmentShader:createFragmentShader,createProgram:createProgram,linkProgram:linkProgram,validateProgram:validateProgram,createStaticVertexBuffer:createStaticVertexBuffer,createStaticIndexBuffer:createStaticIndexBuffer,queryMaxTextureSize:queryMaxTextureSize,getNumChannels:getNumChannels,createTexture:createTexture,validateTextureSize:validateTextureSize,createFramebuffer:createFramebuffer,bindVertexBufferToProgramAttribute:bindVertexBufferToProgramAttribute,bindTextureUnit:bindTextureUnit,unbindTextureUnit:unbindTextureUnit,getProgramUniformLocationOrThrow:getProgramUniformLocationOrThrow,getProgramUniformLocation:getProgramUniformLocation,bindTextureToProgramUniformSampler:bindTextureToProgramUniformSampler,bindCanvasToFramebuffer:bindCanvasToFramebuffer,bindColorTextureToFramebuffer:bindColorTextureToFramebuffer,unbindColorTextureFromFramebuffer:unbindColorTextureFromFramebuffer,validateFramebuffer:validateFramebuffer,getFramebufferErrorMessage:getFramebufferErrorMessage,getTextureShapeFromLogicalShape:getTextureShapeFromLogicalShape});function getWebGLContextAttributes(){return{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0}}function createWebGLContext(e){var t,n=getWebGLContextAttributes();return callAndCheck(t=null!=e?createWebGLRenderingContextFromCanvas(e,n):createWebGLRenderingContext(n),function(){return t.disable(t.DEPTH_TEST)}),callAndCheck(t,function(){return t.disable(t.STENCIL_TEST)}),callAndCheck(t,function(){return t.disable(t.BLEND)}),callAndCheck(t,function(){return t.disable(t.DITHER)}),callAndCheck(t,function(){return t.disable(t.POLYGON_OFFSET_FILL)}),callAndCheck(t,function(){return t.disable(t.SAMPLE_COVERAGE)}),callAndCheck(t,function(){return t.enable(t.SCISSOR_TEST)}),callAndCheck(t,function(){return t.enable(t.CULL_FACE)}),callAndCheck(t,function(){return t.cullFace(t.BACK)}),t}function createVertexShader$1(e){return createVertexShader(e,\"\\n precision highp float;\\n attribute vec3 clipSpacePos;\\n attribute vec2 uv;\\n varying vec2 resultUV;\\n\\n void main() {\\n gl_Position = vec4(clipSpacePos, 1);\\n resultUV = uv;\\n }\")}function createVertexBuffer(e){return createStaticVertexBuffer(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function createIndexBuffer(e){return createStaticIndexBuffer(e,new Uint16Array([0,1,2,2,1,3]))}function getTextureConfig(e,t){var n,r,o,a,i,s,u,l=e;return 2===ENV.get(\"WEBGL_VERSION\")?(n=l.R32F,r=l.R16F,o=l.RGBA32F,a=l.RED,i=4,s=1,u=l.HALF_FLOAT):(n=e.RGBA,r=e.RGBA,o=l.RGBA,a=e.RGBA,i=4,s=4,u=null!=t?t.HALF_FLOAT_OES:null),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedFloat:o,textureFormatFloat:a,downloadTextureFormat:e.RGBA,downloadUnpackNumChannels:i,defaultNumChannels:s,textureTypeHalfFloat:u}}function createAndConfigureTexture(e,t,n,r,o,a){validateTextureSize(e,t,n);var i=createTexture(e),s=e.TEXTURE_2D;return callAndCheck(e,function(){return e.bindTexture(s,i)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_MIN_FILTER,e.NEAREST)}),callAndCheck(e,function(){return e.texParameteri(s,e.TEXTURE_MAG_FILTER,e.NEAREST)}),callAndCheck(e,function(){return e.texImage2D(s,0,r,t,n,0,o,a,null)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)}),i}function createFloat32MatrixTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],r.internalFormatFloat,r.textureFormatFloat,e.FLOAT)}function createFloat16MatrixTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],r.internalFormatFloat,r.textureFormatFloat,r.textureTypeHalfFloat)}function createUnsignedBytesMatrixTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],e.RGBA,e.RGBA,e.UNSIGNED_BYTE)}function createPackedMatrixTexture(e,t,n,r){var o=getPackedMatrixTextureShapeWidthHeight(t,n);return createAndConfigureTexture(e,o[0],o[1],r.internalFormatPackedFloat,e.RGBA,e.FLOAT)}function bindVertexProgramAttributeStreams(e,t,n){return callAndCheck(e,function(){return e.bindBuffer(e.ARRAY_BUFFER,n)}),bindVertexBufferToProgramAttribute(e,t,\"clipSpacePos\",n,3,20,0)&&bindVertexBufferToProgramAttribute(e,t,\"uv\",n,2,20,12)}function uploadPixelDataToTexture(e,t,n){callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)}),callAndCheck(e,function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function uploadDataToTexture(e,t,n,r,o,a){validateTextureSize(e,n,r),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,t)}),callAndCheck(e,function(){return e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,r,a,e.FLOAT,o)}),callAndCheck(e,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function uploadMatrixToTexture(e,t,n,r,o,a,i){var s,u=getUnpackedMatrixTextureShapeWidthHeight(n,r),l=u[0],c=u[1];1===i.defaultNumChannels?s=o:encodeMatrixToUnpackedArray(o,s=new Float32Array(getUnpackedArraySizeFromMatrixSize(o.length,a)),a),uploadDataToTexture(e,t,l,c,s,i.textureFormatFloat)}function uploadMatrixToPackedTexture(e,t,n,r,o,a){var i=getPackedMatrixTextureShapeWidthHeight(n,r),s=i[0],u=i[1],l=new Float32Array(getPackedRGBAArraySizeFromMatrixShape(n,r));encodeMatrixToPackedRGBA(o,n,r,l),uploadDataToTexture(e,t,s,u,l,e.RGBA)}function maybeCreateBufferFromOutputTexture(e,t,n,r,o){var a=t;if(2===ENV.get(\"WEBGL_VERSION\")){var i=e,s=i.createBuffer();callAndCheck(e,function(){return e.bindBuffer(i.PIXEL_PACK_BUFFER,s)});var u=4*getUnpackedArraySizeFromMatrixSize(n*r,o.downloadUnpackNumChannels);callAndCheck(e,function(){return e.bufferData(i.PIXEL_PACK_BUFFER,u,e.STATIC_DRAW)}),callAndCheck(e,function(){return i.readPixels(0,0,r,n,e.RGBA,e.FLOAT,0)}),callAndCheck(e,function(){return e.bindBuffer(i.PIXEL_PACK_BUFFER,null)}),a=s}return a}function downloadFloat32MatrixFromBuffer(e,t,n,r,o){var a=e,i=new Float32Array(getUnpackedArraySizeFromMatrixSize(n*r,o.downloadUnpackNumChannels));a.bindBuffer(e.ARRAY_BUFFER,t),a.getBufferSubData(e.ARRAY_BUFFER,0,i),a.bindBuffer(e.ARRAY_BUFFER,null);var s=new Float32Array(n*r);return decodeMatrixFromUnpackedArray(i,s,o.downloadUnpackNumChannels),s}function downloadFloat32MatrixFromOutputTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n),a=o[0],i=o[1],s=new Float32Array(getUnpackedArraySizeFromMatrixSize(t*n,r.downloadUnpackNumChannels));callAndCheck(e,function(){return e.readPixels(0,0,a,i,r.downloadTextureFormat,e.FLOAT,s)});var u=new Float32Array(t*n);return decodeMatrixFromUnpackedArray(s,u,r.downloadUnpackNumChannels),u}function downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n,r){var o=getUnpackedMatrixTextureShapeWidthHeight(t,n),a=o[0],i=o[1],s=new Uint8Array(getUnpackedArraySizeFromMatrixSize(t*n,4));return callAndCheck(e,function(){return e.readPixels(0,0,a,i,r.downloadTextureFormat,e.UNSIGNED_BYTE,s)}),new Float32Array(s.buffer)}function downloadMatrixFromPackedOutputTexture(e,t,n,r){var o=getPackedMatrixTextureShapeWidthHeight(t,n),a=o[0],i=o[1],s=new Float32Array(getPackedRGBAArraySizeFromMatrixShape(t,n));callAndCheck(e,function(){return e.readPixels(0,0,a,i,e.RGBA,e.FLOAT,s)});var u=new Float32Array(t*n);return decodeMatrixFromPackedRGBA(s,t,n,u)}var gpgpu_util=Object.freeze({getWebGLContextAttributes:getWebGLContextAttributes,createWebGLContext:createWebGLContext,createVertexShader:createVertexShader$1,createVertexBuffer:createVertexBuffer,createIndexBuffer:createIndexBuffer,getTextureConfig:getTextureConfig,createFloat32MatrixTexture:createFloat32MatrixTexture,createFloat16MatrixTexture:createFloat16MatrixTexture,createUnsignedBytesMatrixTexture:createUnsignedBytesMatrixTexture,createPackedMatrixTexture:createPackedMatrixTexture,bindVertexProgramAttributeStreams:bindVertexProgramAttributeStreams,uploadPixelDataToTexture:uploadPixelDataToTexture,uploadMatrixToTexture:uploadMatrixToTexture,uploadMatrixToPackedTexture:uploadMatrixToPackedTexture,maybeCreateBufferFromOutputTexture:maybeCreateBufferFromOutputTexture,downloadFloat32MatrixFromBuffer:downloadFloat32MatrixFromBuffer,downloadFloat32MatrixFromOutputTexture:downloadFloat32MatrixFromOutputTexture,downloadByteEncodedFloatMatrixFromOutputTexture:downloadByteEncodedFloatMatrixFromOutputTexture,downloadMatrixFromPackedOutputTexture:downloadMatrixFromPackedOutputTexture}),GPGPUContext=function(){function e(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.autoDebugValidate=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[],this.gl=null!=e?e:createWebGLContext(),1===ENV.get(\"WEBGL_VERSION\")?(this.textureFloatExtension=getExtensionOrThrow(this.gl,\"OES_texture_float\"),this.colorBufferFloatExtension=this.gl.getExtension(\"WEBGL_color_buffer_float\"),ENV.get(\"WEBGL_RENDER_FLOAT32_ENABLED\")||(this.textureHalfFloatExtension=getExtensionOrThrow(this.gl,\"OES_texture_half_float\"),this.colorBufferHalfFloatExtension=this.gl.getExtension(\"EXT_color_buffer_half_float\"))):this.colorBufferFloatExtension=getExtensionOrThrow(this.gl,\"EXT_color_buffer_float\"),this.loseContextExtension=getExtensionOrThrow(this.gl,\"WEBGL_lose_context\"),this.vertexBuffer=createVertexBuffer(this.gl),this.indexBuffer=createIndexBuffer(this.gl),this.framebuffer=createFramebuffer(this.gl),this.textureConfig=getTextureConfig(this.gl,this.textureHalfFloatExtension)}return e.prototype.dispose=function(){var e=this;if(!this.disposed){null!=this.program&&console.warn(\"Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing.\"),null!=this.outputTexture&&console.warn(\"Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.\");var t=this.gl;callAndCheck(t,function(){return t.finish()}),callAndCheck(t,function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)}),callAndCheck(t,function(){return t.deleteFramebuffer(e.framebuffer)}),callAndCheck(t,function(){return t.bindBuffer(t.ARRAY_BUFFER,null)}),callAndCheck(t,function(){return t.deleteBuffer(e.vertexBuffer)}),callAndCheck(t,function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}),callAndCheck(t,function(){return t.deleteBuffer(e.indexBuffer)}),this.loseContextExtension.loseContext(),this.disposed=!0}},e.prototype.enableAutomaticDebugValidation=function(e){this.autoDebugValidate=e,enableDebugWebGLErrorChecking(e)},e.prototype.createFloat32MatrixTexture=function(e,t){return this.throwIfDisposed(),createFloat32MatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.createFloat16MatrixTexture=function(e,t){return this.throwIfDisposed(),createFloat16MatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.createUnsignedBytesMatrixTexture=function(e,t){return this.throwIfDisposed(),createUnsignedBytesMatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.uploadPixelDataToTexture=function(e,t){this.throwIfDisposed(),uploadPixelDataToTexture(this.gl,e,t)},e.prototype.createPackedMatrixTexture=function(e,t){return this.throwIfDisposed(),createPackedMatrixTexture(this.gl,e,t,this.textureConfig)},e.prototype.deleteMatrixTexture=function(e){var t=this;this.throwIfDisposed(),this.outputTexture===e&&(unbindColorTextureFromFramebuffer(this.gl,this.framebuffer),this.outputTexture=null),callAndCheck(this.gl,function(){return t.gl.deleteTexture(e)})},e.prototype.uploadMatrixToTexture=function(e,t,n,r){this.throwIfDisposed();var o=getNumChannels();return uploadMatrixToTexture(this.gl,e,t,n,r,o,this.textureConfig)},e.prototype.uploadMatrixToPackedTexture=function(e,t,n,r){return this.throwIfDisposed(),uploadMatrixToPackedTexture(this.gl,e,t,n,r,this.textureConfig)},e.prototype.downloadFloat32MatrixFromOutputTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return downloadFloat32MatrixFromOutputTexture(r.gl,t,n,r.textureConfig)})},e.prototype.downloadByteEncodedFloatMatrixFromOutputTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return downloadByteEncodedFloatMatrixFromOutputTexture(r.gl,t,n,r.textureConfig)})},e.prototype.downloadFloat32MatrixFromBuffer=function(e,t,n){return downloadFloat32MatrixFromBuffer(this.gl,e,t,n,this.textureConfig)},e.prototype.maybeCreateBufferFromTexture=function(e,t,n){this.bindTextureToFrameBuffer(e);var r=maybeCreateBufferFromOutputTexture(this.gl,e,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r},e.prototype.createAndWaitForFence=function(){var e=this.createFence(this.gl);return this.pollFence(e)},e.prototype.createFence=function(e){var t,n,r=this;if(ENV.get(\"WEBGL_FENCE_API_ENABLED\")){var o=e,a=o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=function(){var e=o.clientWaitSync(a,0,0);return e===o.ALREADY_SIGNALED||e===o.CONDITION_SATISFIED},t=a}else ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0?(t=this.beginQuery(),this.endQuery(),n=function(){return r.isQueryAvailable(t,ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))}):n=function(){return!0};return{query:t,isFencePassed:n}},e.prototype.downloadMatrixFromPackedTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return downloadMatrixFromPackedOutputTexture(r.gl,t,n,r.textureConfig)})},e.prototype.createProgram=function(e){this.throwIfDisposed();var t=this.gl,n=createFragmentShader(t,e),r=createVertexShader$1(t),o=createProgram(t);return callAndCheck(t,function(){return t.attachShader(o,r)}),callAndCheck(t,function(){return t.attachShader(o,n)}),linkProgram(t,o),this.autoDebugValidate&&validateProgram(t,o),this.vertexAttrsAreBound||(this.setProgram(o),this.vertexAttrsAreBound=bindVertexProgramAttributeStreams(t,this.program,this.vertexBuffer)),o},e.prototype.deleteProgram=function(e){var t=this;this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&callAndCheck(this.gl,function(){return t.gl.deleteProgram(e)})},e.prototype.setProgram=function(e){var t=this;this.throwIfDisposed(),this.program=e,null!=this.program&&this.autoDebugValidate&&validateProgram(this.gl,this.program),callAndCheck(this.gl,function(){return t.gl.useProgram(e)})},e.prototype.getUniformLocation=function(e,t,n){return void 0===n&&(n=!0),this.throwIfDisposed(),n?getProgramUniformLocationOrThrow(this.gl,e,t):getProgramUniformLocation(this.gl,e,t)},e.prototype.getAttributeLocation=function(e,t){var n=this;return this.throwIfDisposed(),callAndCheck(this.gl,function(){return n.gl.getAttribLocation(e,t)})},e.prototype.getUniformLocationNoThrow=function(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)},e.prototype.setInputMatrixTexture=function(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),bindTextureToProgramUniformSampler(this.gl,this.program,e,t,n)},e.prototype.setOutputMatrixTexture=function(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)},e.prototype.setOutputPackedMatrixTexture=function(e,t,n){this.throwIfDisposed();var r=getPackedMatrixTextureShapeWidthHeight(t,n),o=r[0],a=r[1];this.setOutputMatrixTextureDriver(e,o,a)},e.prototype.setOutputMatrixWriteRegion=function(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)},e.prototype.setOutputPackedMatrixWriteRegion=function(e,t,n,r){throw new Error(\"setOutputPackedMatrixWriteRegion not implemented.\")},e.prototype.debugValidate=function(){null!=this.program&&validateProgram(this.gl,this.program),validateFramebuffer(this.gl)},e.prototype.executeProgram=function(){this.throwIfDisposed(),this.throwIfNoProgram();var e=this.gl;this.autoDebugValidate&&this.debugValidate(),callAndCheck(e,function(){return e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)})},e.prototype.blockUntilAllProgramsCompleted=function(){var e=this;this.throwIfDisposed(),callAndCheck(this.gl,function(){return e.gl.finish()})},e.prototype.getQueryTimerExtension=function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=getExtensionOrThrow(this.gl,2===ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")?\"EXT_disjoint_timer_query_webgl2\":\"EXT_disjoint_timer_query\")),this.disjointQueryTimerExtension},e.prototype.getQueryTimerExtensionWebGL2=function(){return this.getQueryTimerExtension()},e.prototype.getQueryTimerExtensionWebGL1=function(){return this.getQueryTimerExtension()},e.prototype.beginQuery=function(){if(2===ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")){var e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}var r=this.getQueryTimerExtensionWebGL1(),o=r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT,o),o},e.prototype.endQuery=function(){if(2!==ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")){var e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}else{var t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT)}},e.prototype.waitForQueryAndGetTime=function(e){return __awaiter(this,void 0,void 0,function(){var t=this;return __generator(this,function(n){switch(n.label){case 0:return[4,repeatedTry(function(){return t.isQueryAvailable(e,ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))})];case 1:return n.sent(),[2,this.getQueryTime(e,ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))]}})})},e.prototype.getQueryTime=function(e,t){if(0===t)return null;if(2===t){var n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}var r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(e,r.QUERY_RESULT_EXT)/1e6},e.prototype.isQueryAvailable=function(e,t){if(0===t)return!0;if(2===t){var n=this.gl,r=this.getQueryTimerExtensionWebGL2(),o=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),o&&!this.disjoint}o=(r=this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(e,r.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),o&&!this.disjoint},e.prototype.pollFence=function(e){var t=this;return new Promise(function(n){t.addItemToPoll(function(){return e.isFencePassed()},function(){return n()})})},e.prototype.pollItems=function(){for(var e=binSearchLastTrue(this.itemsToPoll.map(function(e){return e.isDoneFn})),t=0;t<=e;++t){(0,this.itemsToPoll[t].resolveFn)()}this.itemsToPoll=this.itemsToPoll.slice(e+1)},e.prototype.addItemToPoll=function(e,t){var n=this;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||repeatedTry(function(){return n.pollItems(),0===n.itemsToPoll.length})},e.prototype.bindTextureToFrameBuffer=function(e){this.throwIfDisposed(),bindColorTextureToFramebuffer(this.gl,e,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(this.gl)},e.prototype.unbindTextureToFrameBuffer=function(){null!=this.outputTexture?(bindColorTextureToFramebuffer(this.gl,this.outputTexture,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(this.gl)):unbindColorTextureFromFramebuffer(this.gl,this.framebuffer)},e.prototype.downloadMatrixDriver=function(e,t){this.bindTextureToFrameBuffer(e);var n=t();return this.unbindTextureToFrameBuffer(),n},e.prototype.setOutputMatrixTextureDriver=function(e,t,n){this.throwIfDisposed();var r=this.gl;bindColorTextureToFramebuffer(r,e,this.framebuffer),this.autoDebugValidate&&validateFramebuffer(r),this.outputTexture=e,callAndCheck(r,function(){return r.viewport(0,0,t,n)}),callAndCheck(r,function(){return r.scissor(0,0,t,n)})},e.prototype.setOutputMatrixWriteRegionDriver=function(e,t,n,r){var o=this;this.throwIfDisposed(),callAndCheck(this.gl,function(){return o.gl.scissor(e,t,n,r)})},e.prototype.throwIfDisposed=function(){if(this.disposed)throw new Error(\"Attempted to use disposed GPGPUContext.\")},e.prototype.throwIfNoProgram=function(){if(null==this.program)throw new Error(\"No GPU program is currently set.\")},e}();function binSearchLastTrue(e){for(var t=0,n=e.length-1,r=-1;t<=n;){var o=t+n>>1;e[o]()?(r=o,t=o+1):n=o-1}return r}function compileProgram(e,t,n,r){for(var o=t.userCode,a=n.map(function(e,n){var r={logicalShape:e.tensor.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform};return{name:t.variableNames[n],shapeInfo:r}}),i=a.map(function(e){return e.shapeInfo}),s={logicalShape:r.tensor.shape,texShape:r.texData.texShape,isUniform:!1},u=makeShader(a,s,o,!0===t.supportsBroadcasting),l=e.createProgram(u),c={},p=0;p= 0 && idx <= \"+s+\") {\\n float z = getX(b, r, c, idx);\\n sum += z * z;\\n }\\n }\\n float val = x * \"+a+\";\\n setOutput(val);\\n }\\n \"}}(),LRNGradProgram=function(){return function(e,t,n,r,o){this.variableNames=[\"inputImage\",\"outputImage\",\"dy\"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=r,this.beta=o,this.userCode=\"\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int r = coords[1];\\n int c = coords[2];\\n\\n float result = 0.0;\\n for (int d = 0; d < \"+this.depth+\"; ++d) {\\n int depthBegin = int(max(0.0, float(d - \"+t+\")));\\n int depthEnd = int(min(float(\"+this.depth+\"),\\n float(d + \"+t+\" + 1)));\\n\\n const int MIN_DEPTH_BEGIN = 0;\\n const int MAX_DEPTH_END = \"+this.depth+\";\\n\\n float norm = 0.0;\\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\\n if (k < depthBegin){\\n continue;\\n }\\n else if (k >= depthBegin && k < depthEnd) {\\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\\n }\\n else {\\n break;\\n }\\n }\\n\\n norm = float(\"+r+\") * norm + float(\"+n+\");\\n\\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\\n if (k < depthBegin){\\n continue;\\n }\\n else if (k >= depthBegin && k < depthEnd){\\n float dyi = -2.0 * float(\"+r+\")\\n * float(\"+o+\")\\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\\n / norm;\\n if (k == d) {\\n dyi += pow(norm, -1.0 * \"+o+\");\\n }\\n if (k == coords[3]) {\\n dyi *= getDy(b, r, c, d);\\n result += dyi;\\n }\\n }\\n else {\\n break;\\n }\\n }\\n }\\n setOutput(result);\\n }\\n \"}}(),MaxPool2DBackpropProgram=function(){return function(e){this.variableNames=[\"dy\",\"maxPos\"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.top,i=n-1-e.padInfo.left,s=t*n-1;this.userCode=\"\\n const ivec2 pads = ivec2(\"+a+\", \"+i+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n\\n ivec2 dyRCCorner = coords.yz - pads;\\n int dyRCorner = dyRCCorner.x;\\n int dyCCorner = dyRCCorner.y;\\n\\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\\n // ? = to be determined. : = across all values in that axis.\\n float dotProd = 0.0;\\n for (int wR = 0; wR < \"+t+\"; wR++) {\\n float dyR = float(dyRCorner + wR) / \"+r+\".0;\\n\\n if (dyR < 0.0 || dyR >= \"+e.outHeight+\".0 || fract(dyR) > 0.0) {\\n continue;\\n }\\n int idyR = int(dyR);\\n\\n for (int wC = 0; wC < \"+n+\"; wC++) {\\n float dyC = float(dyCCorner + wC) / \"+o+\".0;\\n\\n if (dyC < 0.0 || dyC >= \"+e.outWidth+\".0 ||\\n fract(dyC) > 0.0) {\\n continue;\\n }\\n int idyC = int(dyC);\\n\\n float dyValue = getDy(b, idyR, idyC, d);\\n int maxPosValue = \"+s+\" - int(getMaxPos(b, idyR, idyC, d));\\n\\n // Get the current value, check it against the value from the\\n // position matrix.\\n int curPosValue = wR * \"+n+\" + wC;\\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\\n\\n dotProd += dyValue * mask;\\n }\\n }\\n setOutput(dotProd);\\n }\\n \"}}(),MatMulProgram=function(){return function(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1),this.variableNames=[\"matrixA\",\"matrixB\"];var o=n?e[1]:e[0],a=r?t[0]:t[1],i=n?e[0]:e[1];this.outputShape=[o,a];var s=function(e,t){return n?t+\" + \"+e+\", aRow\":\"aRow, \"+t+\" + \"+e},u=function(e,t){return r?\"bCol, \"+t+\" + \"+e:t+\" + \"+e+\", bCol\"},l=4*Math.floor(i/4),c=i%4;this.userCode=\" float dotARowBCol(int aRow, int bCol) {\\n float result = 0.0;\\n for (int i = 0; i < \"+l+\"; i += 4) {\\n vec4 a = vec4(\\n getMatrixA(\"+s(0,\"i\")+\"),\\n getMatrixA(\"+s(1,\"i\")+\"),\\n getMatrixA(\"+s(2,\"i\")+\"),\\n getMatrixA(\"+s(3,\"i\")+\")\\n );\\n vec4 b = vec4(\\n getMatrixB(\"+u(0,\"i\")+\"),\\n getMatrixB(\"+u(1,\"i\")+\"),\\n getMatrixB(\"+u(2,\"i\")+\"),\\n getMatrixB(\"+u(3,\"i\")+\")\\n );\\n\\n result += dot(a, b);\\n }\\n\\n if (\"+(1===c)+\") {\\n result += getMatrixA(\"+s(0,l)+\") *\\n getMatrixB(\"+u(0,l)+\");\\n } else if (\"+(2===c)+\") {\\n vec2 a = vec2(\\n getMatrixA(\"+s(0,l)+\"),\\n getMatrixA(\"+s(1,l)+\")\\n );\\n vec2 b = vec2(\\n getMatrixB(\"+u(0,l)+\"),\\n getMatrixB(\"+u(1,l)+\")\\n );\\n result += dot(a, b);\\n } else if (\"+(3===c)+\") {\\n vec3 a = vec3(\\n getMatrixA(\"+s(0,l)+\"),\\n getMatrixA(\"+s(1,l)+\"),\\n getMatrixA(\"+s(2,l)+\")\\n );\\n vec3 b = vec3(\\n getMatrixB(\"+u(0,l)+\"),\\n getMatrixB(\"+u(1,l)+\"),\\n getMatrixB(\"+u(2,l)+\")\\n );\\n result += dot(a, b);\\n }\\n\\n return result;\\n }\\n\\n void main() {\\n ivec2 resRC = getOutputCoords();\\n setOutput(dotARowBCol(resRC.x, resRC.y));\\n }\\n \"}}(),MultinomialProgram=function(){function e(e,t,n){this.variableNames=[\"probs\"],this.outputShape=[e,n],this.userCode=\"\\n uniform float seed;\\n\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int batch = coords[0];\\n\\n float r = random(seed);\\n float cdf = 0.0;\\n\\n for (int i = 0; i < \"+(t-1)+\"; i++) {\\n cdf += getProbs(batch, i);\\n\\n if (r < cdf) {\\n setOutput(float(i));\\n return;\\n }\\n }\\n\\n // If no other event happened, last event happened.\\n setOutput(float(\"+(t-1)+\"));\\n }\\n \"}return e.prototype.getCustomSetupFunc=function(e){var t=this;return function(n,r){null==t.seedLoc&&(t.seedLoc=n.getUniformLocation(r,\"seed\")),n.gl.uniform1f(t.seedLoc,e)}},e}(),OneHotProgram=function(){return function(e,t,n,r){this.variableNames=[\"indices\"],this.outputShape=[e,t],this.userCode=\"\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int index = round(getIndices(coords.x));\\n setOutput(mix(float(\"+r+\"), float(\"+n+\"),\\n float(index == coords.y)));\\n }\\n \"}}(),PadProgram=function(){return function(e,t,n){this.variableNames=[\"x\"],this.outputShape=t.map(function(t,n){return t[0]+e[n]+t[1]});var r=e.length,o=getCoordsDataType(r),a=t.map(function(e){return e[0]}).join(\",\"),i=t.map(function(t,n){return t[0]+e[n]}).join(\",\"),s=[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,r);this.userCode=1!==r?\"\\n \"+o+\" start = \"+o+\"(\"+a+\");\\n \"+o+\" end = \"+o+\"(\"+i+\");\\n\\n void main() {\\n \"+o+\" outC = getOutputCoords();\\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\\n setOutput(float(\"+n+\"));\\n } else {\\n \"+o+\" coords = outC - start;\\n setOutput(getX(\"+s+\"));\\n }\\n }\\n \":\"\\n int start = \"+a+\";\\n int end = \"+i+\";\\n\\n void main() {\\n int outC = getOutputCoords();\\n if (outC < start || outC >= end) {\\n setOutput(float(\"+n+\"));\\n } else {\\n setOutput(getX(outC - start));\\n }\\n }\\n \"}}(),Pool2DProgram=function(){return function(e,t,n){if(this.variableNames=[\"x\"],\"avg\"===t&&n)throw new Error(\"Cannot compute positions for average pool.\");var r=e.filterHeight,o=e.filterWidth,a=e.strideHeight,i=e.strideWidth,s=e.padInfo.top,u=e.padInfo.left;this.outputShape=e.outShape;var l=\"avg\"===t,c=\"0.0\";if(l||(c=\"-1.0 / 0.0\"),n)this.userCode=\"\\n const ivec2 strides = ivec2(\"+a+\", \"+i+\");\\n const ivec2 pads = ivec2(\"+s+\", \"+u+\");\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d = coords[3];\\n\\n ivec2 xRCCorner = coords.yz * strides - pads;\\n int xRCorner = xRCCorner.x;\\n int xCCorner = xRCCorner.y;\\n\\n // max/min x(?, ?, d) to get y(yR, yC, d).\\n // ? = to be determined\\n float minMaxValue = 0.0;\\n float minMaxValueFound = 0.0;\\n int minMaxPosition = 0;\\n float avgValue = 0.0;\\n\\n for (int wR = 0; wR < \"+r+\"; wR++) {\\n int xR = xRCorner + wR;\\n\\n if (xR < 0 || xR >= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int wC = 0; wC < \"+o+\"; wC++) {\\n int xC = xCCorner + wC;\\n\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n continue;\\n }\\n\\n float value = getX(batch, xR, xC, d);\\n\\n // If a min / max value has already been found, use it. If not,\\n // use the current value.\\n float currMinMaxValue = mix(\\n value, minMaxValue, minMaxValueFound);\\n if (value >= currMinMaxValue) {\\n minMaxValue = value;\\n minMaxValueFound = 1.0;\\n minMaxPosition = wR * \"+o+\" + wC;\\n }\\n }\\n }\\n setOutput(float(minMaxPosition));\\n }\\n \";else{var p=t+\"(\"+t+\"(\"+t+\"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])\";\"avg\"===t&&(p=\"avgValue / count\");var d=4*Math.floor(o/4),h=o%4,f=\"\\n if (\"+l+\") {\\n avgValue += dot(values, ones);\\n } else {\\n minMaxValue = max(values, minMaxValue);\\n }\\n \";this.userCode=\"\\n const ivec2 strides = ivec2(\"+a+\", \"+i+\");\\n const ivec2 pads = ivec2(\"+s+\", \"+u+\");\\n const float initializationValue = \"+c+\";\\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\\n\\n float count = 0.0;\\n\\n float getValue(int batch, int xR, int xC, int d) {\\n if (xC < 0 || xC >= \"+e.inWidth+\") {\\n return initializationValue;\\n }\\n count += 1.0;\\n return getX(batch, xR, xC, d);\\n }\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int batch = coords[0];\\n int d = coords[3];\\n\\n ivec2 xRCCorner = coords.yz * strides - pads;\\n int xRCorner = xRCCorner.x;\\n int xCCorner = xRCCorner.y;\\n\\n // max/min x(?, ?, d) to get y(yR, yC, d).\\n // ? = to be determined\\n vec4 minMaxValue = vec4(\"+c+\");\\n float avgValue = 0.0;\\n count = 0.0;\\n\\n for (int wR = 0; wR < \"+r+\"; wR++) {\\n int xR = xRCorner + wR;\\n\\n if (xR < 0 || xR >= \"+e.inHeight+\") {\\n continue;\\n }\\n\\n for (int wC = 0; wC < \"+d+\"; wC += 4) {\\n int xC = xCCorner + wC;\\n\\n vec4 values = vec4(\\n getValue(batch, xR, xC, d),\\n getValue(batch, xR, xC + 1, d),\\n getValue(batch, xR, xC + 2, d),\\n getValue(batch, xR, xC + 3, d)\\n );\\n\\n \"+f+\"\\n }\\n\\n int xC = xCCorner + \"+d+\";\\n if (\"+(1===h)+\") {\\n vec4 values = vec4(\\n getValue(batch, xR, xC, d),\\n initializationValue,\\n initializationValue,\\n initializationValue\\n );\\n\\n \"+f+\"\\n } else if (\"+(2===h)+\") {\\n vec4 values = vec4(\\n getValue(batch, xR, xC, d),\\n getValue(batch, xR, xC + 1, d),\\n initializationValue,\\n initializationValue\\n );\\n\\n \"+f+\"\\n } else if (\"+(3===h)+\") {\\n vec4 values = vec4(\\n getValue(batch, xR, xC, d),\\n getValue(batch, xR, xC + 1, d),\\n getValue(batch, xR, xC + 2, d),\\n initializationValue\\n );\\n\\n \"+f+\"\\n }\\n }\\n setOutput(\"+p+\");\\n }\\n \"}}}(),ReduceProgram=function(){return function(e,t){this.variableNames=[\"x\"];var n=e.windowSize,r=e.batchSize,o=e.inSize,a=Math.ceil(o/n);this.outputShape=[r,a];var i=\"0.0\",s=\"\";\"min\"===t?(i=\"1.0 / 0.0\",s=\"min\"):\"max\"===t&&(i=\"-1.0 / 0.0\",s=\"max\");var u=t+\"(\"+t+\"(\"+t+\"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])\";\"sum\"===t?u=\"sumValue\":\"all\"===t?u=\"allValue\":\"any\"===t&&(u=\"anyValue\");var l=4*Math.floor(n/4),c=n%4,p=\"\\n if (\"+(\"sum\"===t)+\") {\\n sumValue += dot(values, ones);\\n } else {\\n minMaxValue = \"+s+\"(values, minMaxValue);\\n }\\n \",d=\"vec4\";\"all\"===t?(i=\"1.0\",p=\"\\n bool reducedAllValue = all(values);\\n float floatedReducedAllValue = float(reducedAllValue);\\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\\n \",d=\"bvec4\"):\"any\"===t&&(i=\"0.0\",p=\"\\n bool reducedAnyValue = any(values);\\n float floatedReducedAnyValue = float(reducedAnyValue);\\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\\n \",d=\"bvec4\");var h=\"\";o%n>0&&(h=\"\\n if (inIdx < 0 || inIdx >= \"+o+\") {\\n return initializationValue;\\n }\\n \"),this.userCode=\"\\n const float initializationValue = \"+i+\";\\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\\n\\n float getValue(int batch, int inIdx) {\\n \"+h+\"\\n return getX(batch, inIdx);\\n }\\n\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int batch = coords[0];\\n int outIdx = coords[1];\\n int inOffset = outIdx * \"+n+\";\\n\\n vec4 minMaxValue = vec4(\"+i+\");\\n float sumValue = 0.0;\\n float allValue = 1.0;\\n float anyValue = 0.0;\\n\\n for (int i = 0; i < \"+l+\"; i += 4) {\\n int inIdx = inOffset + i;\\n \"+d+\" values = \"+d+\"(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n getValue(batch, inIdx + 2),\\n getValue(batch, inIdx + 3)\\n );\\n\\n \"+p+\"\\n }\\n\\n int inIdx = inOffset + \"+l+\";\\n if (\"+(1===c)+\") {\\n \"+d+\" values = \"+d+\"(\\n getValue(batch, inIdx),\\n initializationValue,\\n initializationValue,\\n initializationValue\\n );\\n\\n \"+p+\"\\n } else if (\"+(2===c)+\") {\\n \"+d+\" values = \"+d+\"(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n initializationValue,\\n initializationValue\\n );\\n\\n \"+p+\"\\n } else if (\"+(3===c)+\") {\\n \"+d+\" values = \"+d+\"(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n getValue(batch, inIdx + 2),\\n initializationValue\\n );\\n\\n \"+p+\"\\n }\\n setOutput(\"+u+\");\\n }\\n \"}}(),ResizeBilinearBackpropProgram=function(){return function(e,t,n){this.variableNames=[\"dy\"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,o=r[1],a=r[2],i=e.shape,s=i[1],u=i[2],l=[n&&s>1?o-1:o,n&&u>1?a-1:a],c=[n&&s>1?s-1:s,n&&u>1?u-1:u],p=l[0]/c[0],d=l[1]/c[1],h=1/p,f=1/d,m=2*Math.ceil(h)+2,g=2*Math.ceil(f)+2;this.userCode=\"\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n int r = coords[1];\\n int c = coords[2];\\n\\n float accumulator = 0.0;\\n\\n const float heightScale = float(\"+p+\");\\n const float widthScale = float(\"+d+\");\\n\\n const float invHeightScale = float(\"+h+\");\\n const float invWidthScale = float(\"+f+\");\\n\\n const int winHeight = int(\"+m+\");\\n const int winWidth = int(\"+g+\");\\n\\n // Compute bounds for where in dy we will look\\n float startRLerp = floor(float(r) * invHeightScale);\\n int startDyR = int(startRLerp - float(winHeight / 2));\\n\\n float startCLerp = floor(float(c) * invWidthScale);\\n int startDyC = int(startCLerp - float(winWidth / 2));\\n\\n // Loop over dy\\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\\n int dyR = dyROffset + startDyR;\\n\\n // Guard against the window exceeding the bounds of dy\\n if (dyR < 0 || dyR >= \"+s+\") {\\n continue;\\n }\\n\\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\\n int dyC = dyCOffset + startDyC;\\n\\n // Guard against the window exceeding the bounds of dy\\n if (dyC < 0 || dyC >= \"+u+\") {\\n continue;\\n }\\n\\n float dxR = float(dyR) * heightScale;\\n int topDxRIndex = int(floor(dxR));\\n int bottomDxRIndex = int(min(ceil(dxR), \"+(o-1)+\".0));\\n float dxRLerp = dxR - float(topDxRIndex);\\n float inverseDxRLerp = 1.0 - dxRLerp;\\n\\n float dxC = float(dyC) * widthScale;\\n int leftDxCIndex = int(floor(dxC));\\n int rightDxCIndex = int(min(ceil(dxC), \"+(a-1)+\".0));\\n float dxCLerp = dxC - float(leftDxCIndex);\\n float inverseDxCLerp = 1.0 - dxCLerp;\\n\\n if (r == topDxRIndex && c == leftDxCIndex) {\\n // topLeft\\n accumulator +=\\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\\n }\\n\\n if (r == topDxRIndex && c == rightDxCIndex) {\\n // topRight\\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\\n }\\n\\n if (r == bottomDxRIndex && c == leftDxCIndex) {\\n // bottomLeft\\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\\n }\\n\\n if (r == bottomDxRIndex && c == rightDxCIndex) {\\n // bottomRight\\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\\n }\\n }\\n }\\n // End loop over dy\\n\\n setOutput(accumulator);\\n }\\n \"}}(),ResizeBilinearProgram=function(){return function(e,t,n,r){this.variableNames=[\"A\"],this.outputShape=[];var o=e[0],a=e[1],i=e[2],s=e[3];this.outputShape=[o,t,n,s];var u=[r&&t>1?a-1:a,r&&n>1?i-1:i],l=[r&&t>1?t-1:t,r&&n>1?n-1:n];this.userCode=\"\\n const vec2 effectiveInputOverOutputRatioRC = vec2(\\n \"+u[0]/l[0]+\",\\n \"+u[1]/l[1]+\");\\n const vec2 inputShapeRC = vec2(\"+a+\".0, \"+i+\".0);\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n ivec2 yRC = coords.yz;\\n\\n // Fractional source index.\\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\\n\\n // Compute the four integer indices.\\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\\n ivec2 sourceCeilRC = ivec2(\\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\\n\\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\\n\\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\\n\\n float top = topLeft + (topRight - topLeft) * fracRC.y;\\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\\n float newValue = top + (bottom - top) * fracRC.x;\\n\\n setOutput(newValue);\\n }\\n \"}}(),ResizeNearestNeigborBackpropProgram=function(){return function(e,t,n){this.variableNames=[\"dy\"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,o=r[1],a=r[2],i=e.shape,s=i[1],u=i[2],l=[n&&s>1?o-1:o,n&&u>1?a-1:a],c=[n&&s>1?s-1:s,n&&u>1?u-1:u],p=l[0]/c[0],d=l[1]/c[1],h=1/p,f=1/d,m=2*Math.ceil(h)+2,g=2*Math.ceil(f)+2;this.userCode=\"\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n int r = coords[1];\\n int c = coords[2];\\n\\n float accumulator = 0.0;\\n\\n const float heightScale = float(\"+p+\");\\n const float widthScale = float(\"+d+\");\\n\\n const float invHeightScale = float(\"+h+\");\\n const float invWidthScale = float(\"+f+\");\\n\\n const int winHeight = int(\"+m+\");\\n const int winWidth = int(\"+g+\");\\n\\n // Compute bounds for where in dy we will look\\n float startRLerp = floor(float(r) * invHeightScale);\\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\\n\\n float startCLerp = floor(float(c) * invWidthScale);\\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\\n\\n // Loop over dy\\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\\n int dyR = dyROffset + startDyR;\\n\\n // Guard against the window exceeding the bounds of dy\\n if (dyR < 0 || dyR >= \"+s+\") {\\n continue;\\n }\\n\\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\\n int dyC = dyCOffset + startDyC;\\n\\n // Guard against the window exceeding the bounds of dy\\n if (dyC < 0 || dyC >= \"+u+\") {\\n continue;\\n }\\n\\n float sourceFracRow =\\n float(\"+l[0]+\") *\\n (float(dyR) / float(\"+c[0]+\"));\\n\\n float sourceFracCol =\\n float(\"+l[1]+\") *\\n (float(dyC) / float(\"+c[1]+\"));\\n\\n int sourceNearestRow = int(min(\\n float(int(\"+o+\") - 1),\\n \"+n+\" ? float(round(sourceFracRow)) :\\n float(floor(sourceFracRow))));\\n\\n int sourceNearestCol = int(min(\\n float(int(\"+a+\") - 1),\\n \"+n+\" ? float(round(sourceFracCol)) :\\n float(floor(sourceFracCol))));\\n\\n if (r == sourceNearestRow && c == sourceNearestCol) {\\n accumulator += getDy(b, dyR, dyC, d);\\n }\\n }\\n }\\n // End loop over dy\\n\\n setOutput(accumulator);\\n }\\n \"}}(),ResizeNearestNeighborProgram=function(){return function(e,t,n,r){this.variableNames=[\"A\"],this.outputShape=[];var o=e[0],a=e[1],i=e[2],s=e[3];this.outputShape=[o,t,n,s];var u=[r&&t>1?a-1:a,r&&n>1?i-1:i],l=[r&&t>1?t-1:t,r&&n>1?n-1:n],c=r?\"0.5\":\"0.0\";this.userCode=\"\\n const vec2 effectiveInputOverOutputRatioRC = vec2(\\n \"+u[0]/l[0]+\",\\n \"+u[1]/l[1]+\");\\n const vec2 inputShapeRC = vec2(\"+a+\".0, \"+i+\".0);\\n\\n void main() {\\n ivec4 coords = getOutputCoords();\\n int b = coords[0];\\n int d = coords[3];\\n ivec2 yRC = coords.yz;\\n\\n // Fractional source index.\\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\\n\\n // Compute the coordinators of nearest neighbor point.\\n ivec2 sourceNearestRC = ivec2(\\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + \"+c+\")));\\n\\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\\n\\n setOutput(newValue);\\n }\\n \"}}(),ReverseProgram=function(){return function(e,t){this.variableNames=[\"x\"];var n=e.length;if(n>4)throw new Error(\"WebGL backend: Reverse of rank-\"+n+\" tensor is not yet supported\");if(this.outputShape=e,1!==n){var r=e.map(function(n,r){return function(n){return-1!==t.indexOf(n)&&1!==e[n]?e[n]+\" - coords[\"+n+\"] - 1\":\"coords[\"+n+\"]\"}(r)}).join(\",\"),o=getCoordsDataType(n);this.userCode=\"\\n void main() {\\n \"+o+\" coords = getOutputCoords();\\n setOutput(getX(\"+r+\"));\\n }\\n \"}else this.userCode=\"\\n void main() {\\n int coord = getOutputCoords();\\n setOutput(getX(\"+e[0]+\" - coord - 1));\\n }\\n \"}}(),SegmentOpProgram=function(){return function(e,t){this.variableNames=[\"x\",\"segmentIds\"];var n=e.windowSize,r=e.batchSize,o=e.inSize,a=e.numSegments,i=a*Math.ceil(o/n);this.outputShape=[r,i];var s=4*Math.floor(n/4),u=n%4,l=\"\\n sumValue += dot(values, filter);\\n \",c=\"\";o%n>0&&(c=\"\\n if (inIdx < 0 || inIdx >= \"+o+\") {\\n return initializationValue;\\n }\\n \");var p=\"\";o%n>0&&(p=\"\\n if (inIdx < 0 || inIdx >= \"+o+\") {\\n return -1.0;\\n }\\n \"),this.userCode=\"\\n const float initializationValue = 0.0;\\n\\n float getValue(int batch, int inIdx) {\\n \"+c+\"\\n return getX(batch, inIdx);\\n }\\n\\n float getSegmentIdAtIndex(int inIdx) {\\n \"+p+\"\\n return getSegmentIds(inIdx);\\n }\\n\\n void main() {\\n ivec2 coords = getOutputCoords();\\n int batch = coords[0];\\n int outIdx = coords[1];\\n int inOffset = int(floor(float(outIdx) / float(\\n \"+a+\")) * float(\"+n+\"));\\n int currentSeg = int(mod(float(outIdx), float(\"+a+\")));\\n\\n float sumValue = 0.0;\\n\\n for (int i = 0; i < \"+s+\"; i += 4) {\\n int inIdx = inOffset + i;\\n vec4 values = vec4(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n getValue(batch, inIdx + 2),\\n getValue(batch, inIdx + 3)\\n );\\n\\n vec4 filter = vec4(\\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\\n );\\n\\n \"+l+\"\\n }\\n\\n int inIdx = inOffset + \"+s+\";\\n if (\"+(1===u)+\") {\\n vec4 values = vec4(\\n getValue(batch, inIdx),\\n initializationValue,\\n initializationValue,\\n initializationValue\\n );\\n\\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\\n\\n vec4 filter = vec4(\\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\\n 0,\\n 0,\\n 0\\n );\\n\\n \"+l+\"\\n } else if (\"+(2===u)+\") {\\n vec4 values = vec4(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n initializationValue,\\n initializationValue\\n );\\n\\n vec4 filter = vec4(\\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\\n 0,\\n 0\\n );\\n\\n \"+l+\"\\n } else if (\"+(3===u)+\") {\\n vec4 values = vec4(\\n getValue(batch, inIdx),\\n getValue(batch, inIdx + 1),\\n getValue(batch, inIdx + 2),\\n initializationValue\\n );\\n\\n vec4 filter = vec4(\\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\\n 0\\n );\\n\\n \"+l+\"\\n }\\n setOutput(sumValue);\\n }\\n \"}}(),SelectProgram=function(){return function(e,t,n){var r,o;if(this.variableNames=[\"c\",\"a\",\"b\"],this.outputShape=t,n>4)throw Error(\"Where for rank \"+n+\" is not yet supported\");if(1===n)o=\"resRC\",r=\"resRC\";else{for(var a=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],i=[],s=[],u=0;u= 1.0) {\\n setOutput(getA(\"+o+\"));\\n } else {\\n setOutput(getB(\"+o+\"));\\n }\\n }\\n \"}}(),SliceProgram=function(){function e(e){this.variableNames=[\"source\"],this.outputShape=e,this.rank=e.length;var t=getCoordsDataType(this.rank),n=getCoords$1(this.rank);this.userCode=\"\\n uniform \"+t+\" start;\\n\\n void main() {\\n \"+t+\" sourceLoc = start + getOutputCoords();\\n setOutput(getSource(\"+n+\"));\\n }\\n \"}return e.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error(\"The rank (\"+this.rank+\") of the program must match the length of start (\"+e.length+\")\");return function(n,r){if(null!=t.startLoc||(t.startLoc=n.getUniformLocationNoThrow(r,\"start\"),null!=t.startLoc))if(1===t.rank)n.gl.uniform1i(t.startLoc,e[0]);else if(2===t.rank)n.gl.uniform2i(t.startLoc,e[0],e[1]);else if(3===t.rank)n.gl.uniform3i(t.startLoc,e[0],e[1],e[2]);else{if(4!==t.rank)throw Error(\"Slicing for rank \"+t.rank+\" is not yet supported\");n.gl.uniform4i(t.startLoc,e[0],e[1],e[2],e[3])}}},e}();function getCoords$1(e){if(1===e)return\"sourceLoc\";if(2===e)return\"sourceLoc.x, sourceLoc.y\";if(3===e)return\"sourceLoc.x, sourceLoc.y, sourceLoc.z\";if(4===e)return\"sourceLoc.x, sourceLoc.y, sourceLoc.z, sourceLoc.w\";throw Error(\"Slicing for rank \"+e+\" is not yet supported\")}var StridedSliceProgram=function(){return function(e,t,n){this.variableNames=[\"x\"],this.outputShape=n,this.rank=n.length;var r=getCoordsDataType(this.rank),o=\"\";o=1===this.rank?\"coords * strides + begin\":n.map(function(e,t){return\"coords[\"+t+\"] * strides[\"+t+\"] + begin[\"+t+\"]\"}).join(\",\"),this.userCode=\"\\n \"+r+\" begin = \"+r+\"(\"+e+\");\\n \"+r+\" strides = \"+r+\"(\"+t+\");\\n\\n void main() {\\n \"+r+\" coords = getOutputCoords();\\n setOutput(getX(\"+o+\"));\\n }\\n \"}}(),TextureManager=function(){function e(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return e.prototype.acquireTexture=function(e,t){var n,r=getPhysicalFromLogicalTextureType(t),o=getKeyFromTextureShape(e,r);if(o in this.freeTextures||(this.freeTextures[o]=[]),o in this.usedTextures||(this.usedTextures[o]=[]),this.freeTextures[o].length>0){this.numFreeTextures--,this.numUsedTextures++,this.log();var a=this.freeTextures[o].shift();return this.usedTextures[o].push(a),a}return this.numUsedTextures++,this.log(),r===PhysicalTextureType.FLOAT32?n=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):r===PhysicalTextureType.FLOAT16?n=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):r===PhysicalTextureType.UNSIGNED_BYTE&&(n=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[o].push(n),n},e.prototype.releaseTexture=function(e,t,n){var r=getKeyFromTextureShape(t,getPhysicalFromLogicalTextureType(n));r in this.freeTextures||(this.freeTextures[r]=[]),this.freeTextures[r].push(e),this.numFreeTextures++,this.numUsedTextures--;var o=this.usedTextures[r],a=o.indexOf(e);if(a<0)throw new Error(\"Cannot release a texture that was never provided by this texture manager\");o.splice(a,1),this.log()},e.prototype.log=function(){if(this.logEnabled){var e=this.numFreeTextures+this.numUsedTextures;console.log(\"Free/Used\",this.numFreeTextures+\" / \"+this.numUsedTextures,\"(\"+e+\")\")}},e.prototype.getNumUsedTextures=function(){return this.numUsedTextures},e.prototype.getNumFreeTextures=function(){return this.numFreeTextures},e.prototype.dispose=function(){var e=this;if(null!=this.freeTextures){for(var t in this.freeTextures)this.freeTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});for(var t in this.usedTextures)this.usedTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0}},e}();function getPhysicalFromLogicalTextureType(e){if(e===TextureUsage.DOWNLOAD||e===TextureUsage.PIXELS)return PhysicalTextureType.UNSIGNED_BYTE;if(e===TextureUsage.UPLOAD)return PhysicalTextureType.FLOAT32;if(e===TextureUsage.RENDER)return ENV.get(\"WEBGL_RENDER_FLOAT32_ENABLED\")?PhysicalTextureType.FLOAT32:PhysicalTextureType.FLOAT16;throw new Error(\"Unknown logical texture type \"+e)}function getKeyFromTextureShape(e,t){return e[0]+\"_\"+e[1]+\"_\"+t}var TileProgram=function(){return function(e,t){this.variableNames=[\"A\"];for(var n=new Array(e.length),r=0;r5)throw Error(\"Tile for rank \"+t+\" is not yet supported\");if(1===t)return\"imod(resRC, \"+e[0]+\")\";for(var n=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\",\"resRC.u\"],r=[],o=0;o6)throw Error(\"Transpose for rank \"+t+\" is not yet supported\");for(var n=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\",\"resRC.u\",\"resRC.v\"],r=new Array(t),o=0;o= 0.0) ? x : (exp(x) - 1.0);\",SELU=\"\\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\\n // see: https://arxiv.org/abs/1706.02515\\n float scaleAlpha = \"+SELU_SCALEALPHA+\";\\n float scale = \"+SELU_SCALE+\";\\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\\n\";function STEP(e){return void 0===e&&(e=0),CHECK_NAN_SNIPPET$1+\"\\n return x > 0.0 ? 1.0 : float(\"+e+\");\\n \"}var NEG=\"return -x;\",CEIL=\"return ceil(x);\",FLOOR=\"return floor(x);\",SIGN=\"\\n if (isNaN(x)) { return 0.0; }\\n return sign(x);\\n\",ROUND=\"\\n // OpenGL ES does not support round function.\\n // The algorithm is based on banker's rounding.\\n float base = floor(x);\\n if ((x - base) < 0.5) {\\n return floor(x);\\n } else if ((x - base) > 0.5) {\\n return ceil(x);\\n } else {\\n if (mod(base, 2.0) == 0.0) {\\n return base;\\n } else {\\n return base + 1.0;\\n }\\n }\\n\",EXP=\"return exp(x);\",EXPM1=\"return exp(x) - 1.0;\",LOG=\"if (x < 0.0) return NAN;\\n return log(x);\",LOG1P=\"return log(1.0 + x);\",SQRT=\"return sqrt(x);\",RSQRT=\"return inversesqrt(x);\",SIGMOID=\"return 1.0 / (1.0 + exp(-1.0 * x));\",SOFTPLUS=\"\\n float epsilon = 1.1920928955078125e-7;\\n float threshold = log(epsilon) + 2.0;\\n\\n bool too_large = x > -threshold;\\n bool too_small = x < threshold;\\n\\n float result;\\n float exp_x = exp(x);\\n\\n if (too_large){\\n result = x;\\n }\\n else if (too_small){\\n result = exp_x;\\n }\\n else{\\n result = log(exp_x + 1.0);\\n }\\n return result;\\n\",SIN=CHECK_NAN_SNIPPET$1+\"\\n return sin(x);\\n\",COS=CHECK_NAN_SNIPPET$1+\"\\n return cos(x);\\n\",TAN=\"return tan(x);\",ASIN=\"return asin(x);\",ACOS=\"return acos(x);\",ATAN=CHECK_NAN_SNIPPET$1+\"\\n return atan(x);\\n\",SINH=\"\\n float e2x = exp(x);\\n return (e2x - 1.0 / e2x) / 2.0;\\n\",COSH=\"\\n float e2x = exp(-x);\\n return (e2x + 1.0 / e2x) / 2.0;\\n\",TANH=\"\\n float e2x = exp(-2.0 * abs(x));\\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\\n\",ASINH=\"return log(x + sqrt(x * x + 1.0));\",ACOSH=CHECK_NAN_SNIPPET$1+\"\\n if (x < 1.0) return NAN;\\n return log(x + sqrt(x * x - 1.0));\",ATANH=CHECK_NAN_SNIPPET$1+\"\\n if ((x < -1.0) || (x > 1.0)) return NAN;\\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;\",ERF='\\n // Error function is calculated approximately with elementary function.\\n // See \"Handbook of Mathematical Functions with Formulas,\\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\\n float p = '+ERF_P+\";\\n float a1 = \"+ERF_A1+\";\\n float a2 = \"+ERF_A2+\";\\n float a3 = \"+ERF_A3+\";\\n float a4 = \"+ERF_A4+\";\\n float a5 = \"+ERF_A5+\";\\n\\n float t = 1.0 / (1.0 + p * x);\\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\\n\",SQUARE=\"return x * x;\",RECIPROCAL=\"return 1.0 / x;\",LOGICAL_NOT=\"return float(!(x >= 1.0));\",TO_INT=\"return float(int(x));\";function concat1d_(e){return concat(e,0)}function concat2d_(e,t){return concat(e,t)}function concat3d_(e,t){return concat(e,t)}function concat4d_(e,t){return concat(e,t)}function concat_(e,t){void 0===t&&(t=0),assert(e.length>=1,\"Pass at least one tensor to concat\");var n=convertToTensorArray(e,\"tensors\",\"concat\"),r=n[0];if(1===n.length)return r;for(var o=parseAxisParam(t,r.shape),a=1;a>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(\" \"),n.s1=r(\" \"),n.s2=r(\" \"),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}(e),o=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+1.1102230246251565e-16*(2097152*a()|0)},a.quick=a,o&&(\"object\"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.alea=o}(0,e,!1)}),xor128=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function o(e,t){var n=new function(e){var t=this,n=\"\";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(\"object\"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xor128=o}(0,e,!1)}),xorwow=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function o(e,t){var n=new function(e){var t=this,n=\"\";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(\"object\"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xorwow=o}(0,e,!1)}),xorshift7=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.x=e.x.slice(),t.i=e.i,t}function o(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.x,o=t.i;return e=r[o],n=(e^=e>>>7)^e<<24,n^=(e=r[o+1&7])^e>>>10,n^=(e=r[o+3&7])^e>>>3,n^=(e=r[o+4&7])^e<<7,e=r[o+7&7],n^=(e^=e<<13)^e<<9,r[o]=n,t.i=o+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=\"\"+t,n=0;n0;--n)e.next()}(t,e)}(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(o.x&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xorshift7=o}(0,e,!1)}),xor4096=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function o(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.w,o=t.X,a=t.i;return t.w=r=r+1640531527|0,n=o[a+34&127],e=o[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=o[a]=n^e,t.i=a,n+(r^r>>>16)|0},function(e,t){var n,r,o,a,i,s=[],u=128;for(t===(0|t)?(r=t,t=null):(t+=\"\\0\",r=0,u=Math.max(u,t.length)),o=0,a=-32;a>>15,r^=r<<4,r^=r>>>13,a>=0&&(i=i+1640531527|0,o=0==(n=s[127&a]^=r+i)?o+1:0);for(o>=128&&(s[127&(t&&t.length||0)]=-1),o=127,a=512;a>0;--a)r=s[o+34&127],n=s[o=o+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[o]=r^n;e.w=i,e.X=s,e.i=o}(t,e)}(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(o.X&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.xor4096=o}(0,e,!1)}),tychei=createCommonjsModule(function(e){!function(e,t,n){function r(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function o(e,t){var n=new function(e){var t=this,n=\"\";t.next=function(){var e=t.b,n=t.c,r=t.d,o=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^o,t.a=o-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(\"object\"==typeof o&&r(o,n),a.state=function(){return r(n,{})}),a}t&&t.exports?t.exports=o:n&&n.amd?n(function(){return o}):this.tychei=o}(0,e,!1)}),seedrandom=createCommonjsModule(function(e){!function(t,n){var r,o=this,a=256,i=6,s=\"random\",u=n.pow(a,i),l=n.pow(2,52),c=2*l,p=a-1;function d(e,d,g){var v=[],y=f(function e(t,n){var r,o=[],a=typeof t;if(n&&\"object\"==a)for(r in t)try{o.push(e(t[r],n-1))}catch(e){}return o.length?o:\"string\"==a?t:t+\"\\0\"}((d=1==d?{entropy:!0}:d||{}).entropy?[e,m(t)]:null==e?function(){try{var e;return r&&(e=r.randomBytes)?e=e(a):(e=new Uint8Array(a),(o.crypto||o.msCrypto).getRandomValues(e)),m(e)}catch(e){var n=o.navigator,i=n&&n.plugins;return[+new Date,o,i,o.screen,m(t)]}}():e,3),v),x=new function(e){var t,n=e.length,r=this,o=0,i=r.i=r.j=0,s=r.S=[];n||(e=[n++]);for(;o=c;)e/=2,t/=2,n>>>=1;return(e+n)/t};return T.int32=function(){return 0|x.g(4)},T.quick=function(){return x.g(4)/4294967296},T.double=T,f(m(x.S),t),(d.pass||g||function(e,t,r,o){return o&&(o.S&&h(o,x),e.state=function(){return h(x,{})}),r?(n[s]=e,t):e})(T,y,\"global\"in d?d.global:this==n,d.state)}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function f(e,t){for(var n,r=e+\"\",o=0;o=1||0===i);var s=Math.sqrt(-2*Math.log(i)/i);t=this.mean+this.stdDev*o*s,n=this.mean+this.stdDev*a*s,this.truncated&&!this.isValidTruncated(t)||(r=!0)}return this.truncated&&!this.isValidTruncated(n)||(this.nextVal=this.convertValue(n)),this.convertValue(t)},e.prototype.convertValue=function(e){return null==this.dtype||\"float32\"===this.dtype?e:Math.round(e)},e.prototype.isValidTruncated=function(e){return e<=this.upper&&e>=this.lower},e}();function clone_(e){var t=convertToTensor(e,\"x\",\"clone\");return ENV.engine.runKernel(function(e){return Tensor.make(t.shape,{dataId:t.dataId},t.dtype)},{$x:t},function(e){return{$x:function(){return e.toFloat()}}})}function eye_(e,t,n,r){void 0===r&&(r=\"float32\"),null==t&&(t=e);for(var o=buffer([e,t],r),a=e<=t?e:t,i=0;i2)throw new Error(\"Rank of probabilities must be 1 or 2, but is \"+i);n=n||Math.random();var s=1===i?o.as2D(1,-1):o,u=ENV.engine.runKernel(function(e){return e.multinomial(s,r,t,n)},{logits2D:s});return 1===i?u.as1D():u}function oneHot_(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=0);var o=convertToTensor(e,\"indices\",\"oneHot\",\"int32\");if(assert(\"int32\"===o.dtype,\"Indices must be of dtype `int32`\"),t<2)throw new Error(\"Error in oneHot: depth must be >=2, but it is \"+t);return ENV.engine.runKernel(function(e){return e.oneHot(o,t,n,r)},{$indices:o})}function fromPixels_(e,t){if(void 0===t&&(t=3),t>4)throw new Error(\"Cannot construct Tensor with more than 4 channels from pixels.\");return ENV.engine.fromPixels(e,t)}function toPixels(e,t){return __awaiter(this,void 0,void 0,function(){var n,r,o,a,i,s,u,l,c,p,d,h,f,m,g,v,y,x,T,S;return __generator(this,function(b){switch(b.label){case 0:if(2!==(n=convertToTensor(e,\"img\",\"toPixels\",\"int32\")).rank&&3!==n.rank)throw new Error(\"toPixels only supports rank 2 or 3 tensors, got rank \"+n.rank+\".\");if(r=n.shape.slice(0,2),o=r[0],a=r[1],(i=2===n.rank?1:n.shape[2])>4||2===i)throw new Error(\"toPixels only supports depth of size 1, 3 or 4 but got \"+i);return s=n.min(),u=n.max(),[4,s.data()];case 1:return l=b.sent()[0],[4,u.data()];case 2:if(c=b.sent()[0],s.dispose(),u.dispose(),\"float32\"===n.dtype){if(l<0||c>1)throw new Error(\"Tensor values for a float32 Tensor must be in the range [0 - 1] but got range [\"+l+\" - \"+c+\"].\")}else{if(\"int32\"!==n.dtype)throw new Error(\"Unsupported type for toPixels: \"+n.dtype+\". Please use float32 or int32 tensors.\");if(l<0||c>255)throw new Error(\"Tensor values for a int32 Tensor must be in the range [0 - 255] but got range [\"+l+\" - \"+c+\"].\")}return[4,n.data()];case 3:for(p=b.sent(),d=\"float32\"===n.dtype?255:1,h=new Uint8ClampedArray(a*o*4),f=0;f=1,\"Pass at least one tensor to tf.stack\"),1===n.length)return n[0].expandDims(t);var r=n[0].rank,o=n[0].shape,a=n[0].dtype;assert(t<=r,\"Axis must be <= rank of the tensor\"),n.forEach(function(e){assertShapesMatch(o,e.shape,\"All tensors passed to stack must have matching shapes\")}),n.forEach(function(e){assert(a===e.dtype,\"All tensors passed to stack must have matching dtypes\")});var i=n.map(function(e){return e.expandDims(t)});return concat(i,t)}function batchToSpaceND_(e,t,n){var r=convertToTensor(e,\"x\",\"batchToSpaceND\"),o=t.reduce(function(e,t){return e*t});return assert(r.rank>=1+t.length,\"input rank should be > than [blockShape] but got \"+r.rank),assert(n.length===t.length,\"crops.shape[0] must be equal to [blockShape] but got \"+n.length),assert(r.shape[0]%o==0,\"input tensor batch must be divisible by prod( blockShape )\"),ENV.engine.runKernel(function(e){return e.batchToSpaceND(r,t,n)},{})}function spaceToBatchND_(e,t,n){var r=convertToTensor(e,\"x\",\"spaceToBatchND\");return assert(r.rank>=1+t.length,\"input rank should be > than [blockShape] but got \"+r.rank),assert(n.length===t.length,\"paddings.shape[0] must be equal to [blockShape], got \"+n.length),assert(r.shape.reduce(function(e,n,r){return r>0&&r<=t.length?e&&n%t[r-1]==0:e},!0),\"input spatial dimensions must be divisible by blockShapes\"),ENV.engine.runKernel(function(e){return e.spaceToBatchND(r,t,n)},{})}function unstack_(e,t){void 0===t&&(t=0);for(var n,r=convertToTensor(e,\"x\",\"unstack\"),o=r.shape[t],a=Array(r.rank-1).fill(0),i=0,s=0;s0?this.gpgpu.beginQuery():{startMs:performance.now(),endMs:null}},e.prototype.endTimer=function(e){return ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0?(this.gpgpu.endQuery(),e):(e.endMs=performance.now(),e)},e.prototype.getQueryTime=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){return ENV.get(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0?[2,this.gpgpu.waitForQueryAndGetTime(e)]:[2,(t=e).endMs-t.startMs]})})},e.prototype.disposeData=function(e){if(!this.pendingDisposal.has(e))if(this.pendingRead.has(e))this.pendingDisposal.add(e);else if(this.texData.has(e)){var t=this.texData.get(e),n=t.texture,r=t.texShape,o=t.usage;null!=n&&this.releaseTexture(e,n,r,o),this.texData.delete(e)}},e.prototype.getTexture=function(e){return this.uploadToGPU(e),this.texData.get(e).texture},e.prototype.getGPGPUContext=function(){return this.gpgpu},e.prototype.getCanvas=function(){return this.canvas},e.prototype.slice=function(e,t,n){var r=new SliceProgram(n),o=r.getCustomSetupFunc(t);return this.compileAndRun(r,[e],null,o)},e.prototype.stridedSlice=function(e,t,n,r,o,a){var i=getStridedSlicedInfo(e.shape,t,n,r,o,a),s=i[0],u=i[1];if(u.some(function(e){return 0===e}))return tensor([],u);var l=new StridedSliceProgram(s,r,u);return this.compileAndRun(l,[e])},e.prototype.reverse=function(e,t){var n=new ReverseProgram(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.concat=function(e,t){var n=new ConcatProgram(e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.neg=function(e){var t=new UnaryOpProgram(e.shape,NEG);return this.compileAndRun(t,[e])},e.prototype.matMul=function(e,t,n,r){var o=new MatMulProgram(e.shape,t.shape,n,r);return this.compileAndRun(o,[e,t])},e.prototype.multiply=function(e,t){var n=new BinaryOpProgram(MUL,e.shape,t.shape),r=this.makeOutputArray(n.outputShape,upcastType(e.dtype,t.dtype));return this.compileAndRun(n,[e,t],r)},e.prototype.batchNormalization=function(e,t,n,r,o,a){var i=[e,t,n],s=null;null!=a&&(s=a.shape,i.push(a));var u=null;null!=o&&(u=o.shape,i.push(o));var l=new BatchNormProgram(e.shape,t.shape,n.shape,s,u,r);return this.compileAndRun(l,i)},e.prototype.localResponseNormalization4D=function(e,t,n,r,o){var a=new LRNProgram(e.shape,t,n,r,o);return this.compileAndRun(a,[e])},e.prototype.LRNGrad=function(e,t,n,r,o,a,i){var s=new LRNGradProgram(t.shape,r,o,a,i);return this.compileAndRun(s,[t,n,e])},e.prototype.tile=function(e,t){var n=new TileProgram(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.pad=function(e,t,n){var r=new PadProgram(e.shape,t,n);return this.compileAndRun(r,[e])},e.prototype.transpose=function(e,t){var n=new TransposeProgram(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.gather=function(e,t,n){var r=new GatherProgram(e.shape,t.size,n);return this.compileAndRun(r,[e,t])},e.prototype.batchToSpaceND=function(e,t,n){assert(e.rank<=4,\"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet\");var r=t.reduce(function(e,t){return e*t}),o=getReshaped(e.shape,t,r),a=getPermuted(o.length,t.length),i=getReshapedPermuted(e.shape,t,r),s=getSliceBeginCoords(n,t.length),u=getSliceSize(i,n,t.length);return e.reshape(o).transpose(a).reshape(i).slice(s,u)},e.prototype.spaceToBatchND=function(e,t,n){assert(e.rank<=4,\"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet\");var r=t.reduce(function(e,t){return e*t}),o=[[0,0]];o.push.apply(o,n);for(var a=1+t.length;athis.NUM_BYTES_BEFORE_PAGING)for(var d=this.numBytesInGPU-this.NUM_BYTES_BEFORE_PAGING;d>0&&this.lruDataGPU.length>0;){var h=this.lruDataGPU.shift(),f=this.texData.get(h),m=f.shape,g=f.dtype;d-=this.computeBytes(m,g),this.read(h)}return p&&(s=this.endTimer(s),this.activeTimers.push(this.getQueryTime(s))),n},e.prototype.getAndSaveBinary=function(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]},e.prototype.getTextureManager=function(){return this.textureManager},e.prototype.dispose=function(){if(!this.disposed){for(var e in this.binaryCache)this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram);this.textureManager.dispose(),this.canvas.remove(),null!=this.fromPixelsCanvas&&this.fromPixelsCanvas.remove(),this.gpgpuCreatedLocally&&this.gpgpu.dispose(),this.disposed=!0}},e.prototype.throwIfNoData=function(e){if(!this.texData.has(e))throw new Error(\"WebGL backend: No data found for this tensor. Did you change your backend in the middle of the program? New backends can't use Tensors created with previous backends\")},e.prototype.uploadToGPU=function(e){this.throwIfNoData(e);var t=this.texData.get(e),n=t.shape,r=t.values,o=t.texture,a=t.dtype,i=t.usage;if(null==o){var s,u=null!=this.activeTimers;u&&(s=performance.now());var l=getTextureShapeFromLogicalShape(this.gpgpu.gl,n);t.texShape=l;var c=this.acquireTexture(e,l,i);t.texture=c,null!=r&&(this.gpgpu.uploadMatrixToTexture(c,l[0],l[1],typedArrayToFloat32(r,a)),t.values=null,u&&(this.uploadWaitMs+=performance.now()-s))}else{this.lruDataGPU.indexOf(e)>=0&&(this.lruDataGPU.splice(this.lruDataGPU.indexOf(e),1),this.lruDataGPU.push(e))}},e.prototype.cacheOnCPU=function(e,t){var n=this.delayedStorage,r=this.texData.get(e),o=r.texture,a=r.texShape,i=r.dtype,s=r.usage;n&&null!=o&&(this.releaseTexture(e,o,a,s),r.texture=null,r.texShape=null),null!=t&&(r.values=float32ToTypedArray(t,i))},e.prototype.releaseTexture=function(e,t,n,r){var o=this.texData.get(e),a=o.shape,i=o.dtype,s=this.lruDataGPU.indexOf(e);s>=0&&this.lruDataGPU.splice(s,1),this.numBytesInGPU-=this.computeBytes(a,i),this.textureManager.releaseTexture(t,n,r)},e.prototype.acquireTexture=function(e,t,n){var r=this.texData.get(e),o=r.shape,a=r.dtype;return this.lruDataGPU.push(e),this.numBytesInGPU+=this.computeBytes(o,a),this.textureManager.acquireTexture(t,n)},e.prototype.computeBytes=function(e,t){return sizeFromShape(e)*bytesPerElement(t)},e}();function float32ToTypedArray(e,t){if(\"float32\"===t)return e;if(\"int32\"===t||\"bool\"===t){for(var n=\"int32\"===t?new Int32Array(e.length):new Uint8Array(e.length),r=0;r=0?e:(assert(-1===e,\"Bad value in size\"),a.shape[t]-r[t])}),assertParamsValid(a,r,o);var i=a.shape;return ENV.engine.runKernel(function(e){return e.slice(a,r,o)},{$x:a},function(e){for(var t=[],n=0;n0&&(t=t.sum(r)),t.reshape(n.shape)},$b:function(){var t=e,n=getReductionAxes(r.shape,o);return n.length>0&&(t=t.sum(n)),t.reshape(r.shape)}}})}function addN_(e){assert(Array.isArray(e),function(){return\"The param passed to tf.addN() must be a list of tensors\"}),assert(e.length>=1,function(){return\"Must pass at least one tensor to tf.addN(), but got \"+e.length});var t=e.map(function(e,t){return convertToTensor(e,\"tensors\"+t,\"addN\")}),n=t[0];t.forEach(function(e){if(e.dtype!==n.dtype)throw new Error(\"All tensors passed to tf.addN() must have the same dtype\")}),t.forEach(function(e){if(!arraysEqual(e.shape,n.shape))throw new Error(\"All tensors passed to tf.addN() must have the same shape\")});var r=t;return ENV.engine.runKernel(function(e){return e.addN(t)},r,function(e){var n={};return t.forEach(function(t,r){n[r]=function(){return e.clone()}}),n})}function addStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in addStrict: \"),e.add(t)}function sub_(e,t){var n=convertToTensor(e,\"a\",\"sub\"),r=convertToTensor(t,\"b\",\"sub\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.subtract(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=e,r=getReductionAxes(n.shape,o);return r.length>0&&(t=t.sum(r)),t.reshape(n.shape)},$b:function(){var t=e,n=getReductionAxes(r.shape,o);return n.length>0&&(t=t.sum(n)),t.neg().reshape(r.shape)}}})}function subStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in subStrict: \"),e.sub(t)}function pow_(e,t){var n=convertToTensor(e,\"base\",\"pow\"),r=convertToTensor(t,\"exp\",\"pow\"),o=assertAndGetBroadcastShape(n.shape,r.shape);e=n.cast(upcastType(n.dtype,r.dtype)),t=r.cast(upcastType(n.dtype,r.dtype));return ENV.engine.runKernel(function(e,t){return t(e.pow(n,r))},{$base:n,$exp:r},function(e,t){var a=t[0];return{$base:function(){var t=e.mul(r.toFloat().mul(a.div(n))),i=getReductionAxes(n.shape,o);return i.length>0&&(t=t.sum(i)),t.reshape(n.shape)},$exp:function(){var t=e.mul(a.mul(n.log()).toFloat()),i=getReductionAxes(r.shape,o);return i.length>0&&(t=t.sum(i)),t.reshape(r.shape)}}})}function powStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in powStrict: \"),e.pow(t)}function mul_(e,t){var n=convertToTensor(e,\"a\",\"mul\"),r=convertToTensor(t,\"b\",\"mul\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.multiply(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=e.mul(r.toFloat()),a=getReductionAxes(n.shape,o);return a.length>0?t.sum(a).reshape(n.shape):t},$b:function(){var t=e.mul(n.toFloat()),a=getReductionAxes(r.shape,o);return a.length>0?t.sum(a).reshape(r.shape):t}}})}function mulStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in multiplyStrict: \"),e.mul(t)}function div_(e,t){var n,r=convertToTensor(e,\"a\",\"div\"),o=convertToTensor(t,\"b\",\"div\");if(assertTypesMatch(r,o),\"int32\"===r.dtype&&\"int32\"===o.dtype)return floorDiv(r,o);n=function(e){return e.realDivide(r,o)};var a=assertAndGetBroadcastShape(r.shape,o.shape);return ENV.engine.runKernel(n,{$a:r,$b:o},function(e){return{$a:function(){var t=e.div(o.toFloat()),n=getReductionAxes(r.shape,a);return n.length>0?t.sum(n).reshape(r.shape):t},$b:function(){var t=e.mul(r.toFloat()),n=getReductionAxes(o.shape,a);n.length>0&&(t=t.sum(n).reshape(o.shape));var i=o.square();return t.div(i.toFloat()).neg()}}})}function floorDiv_(e,t){var n=convertToTensor(e,\"a\",\"floorDiv\"),r=convertToTensor(t,\"b\",\"floorDiv\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.floorDiv(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=e.div(r.toFloat()),a=getReductionAxes(n.shape,o);return a.length>0?t.sum(a).reshape(n.shape):t},$b:function(){var t=e.mul(n.toFloat()),a=getReductionAxes(r.shape,o);a.length>0&&(t=t.sum(a).reshape(r.shape));var i=r.square();return t.div(i.toFloat()).neg()}}})}function divStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in divideStrict: \"),e.div(t)}function mod_(e,t){var n=convertToTensor(e,\"a\",\"mod\"),r=convertToTensor(t,\"b\",\"mod\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.mod(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=getReductionAxes(n.shape,o);return t.length>0?e.sum(t).reshape(n.shape):e},$b:function(){var t=e.mul(n.div(r).floor().neg()),a=getReductionAxes(r.shape,o);return a.length>0?t.sum(a).reshape(r.shape):t}}})}function modStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in modStrict: \"),e.mod(t)}function minimum_(e,t){var n=convertToTensor(e,\"a\",\"minimum\"),r=convertToTensor(t,\"b\",\"minimum\");assertTypesMatch(n,r),\"bool\"===n.dtype&&(n=n.toInt()),\"bool\"===r.dtype&&(r=r.toInt()),assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.minimum(n,r)},{$a:n,$b:r},function(e){return{$a:function(){return e.mul(n.lessEqual(r).toFloat())},$b:function(){return e.mul(n.greater(r).toFloat())}}})}function minimumStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in minimumStrict: \"),e.minimum(t)}function maximum_(e,t){var n=convertToTensor(e,\"a\",\"maximum\"),r=convertToTensor(t,\"b\",\"maximum\");assertTypesMatch(n,r),\"bool\"===n.dtype&&(n=n.toInt()),\"bool\"===r.dtype&&(r=r.toInt()),assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.maximum(n,r)},{$a:n,$b:r},function(e){return{$a:function(){return e.mul(n.greaterEqual(r).toFloat())},$b:function(){return e.mul(n.less(r).toFloat())}}})}function maximumStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in minimumStrict: \"),e.maximum(t)}function squaredDifference_(e,t){var n=convertToTensor(e,\"a\",\"squaredDifference\"),r=convertToTensor(t,\"b\",\"squaredDifference\");assertTypesMatch(n,r),assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.squaredDifference(n,r)},{$a:n,$b:r},function(e){var t=scalar(2);return{$a:function(){return e.mul(n.sub(r).mul(t))},$b:function(){return e.mul(r.sub(n).mul(t))}}})}function squaredDifferenceStrict_(e,t){return assertShapesMatch(e.shape,t.shape,\"Error in squaredDifferenceStrict: \"),e.squaredDifference(t)}function atan2_(e,t){var n=convertToTensor(e,\"a\",\"atan2\"),r=convertToTensor(t,\"b\",\"atan2\");assertTypesMatch(n,r);var o=assertAndGetBroadcastShape(n.shape,r.shape);return ENV.engine.runKernel(function(e){return e.atan2(n,r)},{$a:n,$b:r},function(e){return{$a:function(){var t=add(n.square(),r.square()),a=e.mul(r.div(t)),i=getReductionAxes(n.shape,o);return i.length>0&&(a=a.sum(i)),a.reshape(n.shape)},$b:function(){var t=add(n.square(),r.square()),a=neg(e.mul(n.div(t))),i=getReductionAxes(r.shape,o);return i.length>0&&(a=a.sum(i)),a.reshape(r.shape)}}})}var add=op({add_:add_}),addN=op({addN_:addN_}),addStrict=op({addStrict_:addStrict_}),atan2=op({atan2_:atan2_}),div=op({div_:div_}),divStrict=op({divStrict_:divStrict_}),floorDiv=op({floorDiv_:floorDiv_}),maximum=op({maximum_:maximum_}),maximumStrict=op({maximumStrict_:maximumStrict_}),minimum=op({minimum_:minimum_}),minimumStrict=op({minimumStrict_:minimumStrict_}),mod=op({mod_:mod_}),modStrict=op({modStrict_:modStrict_}),mul=op({mul_:mul_}),mulStrict=op({mulStrict_:mulStrict_}),pow=op({pow_:pow_}),powStrict=op({powStrict_:powStrict_}),squaredDifference=op({squaredDifference_:squaredDifference_}),squaredDifferenceStrict=op({squaredDifferenceStrict_:squaredDifferenceStrict_}),sub=op({sub_:sub_}),subStrict=op({subStrict_:subStrict_});function logicalNot_(e){var t=convertToTensor(e,\"x\",\"logicalNot\",\"bool\");return assert(\"bool\"===t.dtype,\"Error Array must be of type bool.\"),ENV.engine.runKernel(function(e){return e.logicalNot(t)},{$x:t})}function logicalAnd_(e,t){var n=convertToTensor(e,\"a\",\"logicalAnd\",\"bool\"),r=convertToTensor(t,\"b\",\"logicalAnd\",\"bool\");return assert(\"bool\"===n.dtype&&\"bool\"===r.dtype,\"Error Array must be of type bool.\"),assertAndGetBroadcastShape(n.shape,r.shape),ENV.engine.runKernel(function(e){return e.logicalAnd(n,r)},{$a:n,$b:r})}function logicalOr_(e,t){var n=convertToTensor(e,\"a\",\"logicalOr\",\"bool\"),r=convertToTensor(t,\"b\",\"logicalOr\",\"bool\");return assert(\"bool\"===n.dtype&&\"bool\"===r.dtype,\"Error Array must be of type bool.\"),assertAndGetBroadcastShape(n.shape,r.shape),ENV.engine.runKernel(function(e){return e.logicalOr(n,r)},{$a:n,$b:r})}function logicalXor_(e,t){var n=convertToTensor(e,\"a\",\"logicalXor\",\"bool\"),r=convertToTensor(t,\"b\",\"logicalXor\",\"bool\");return assert(\"bool\"===n.dtype&&\"bool\"===r.dtype,\"Error Array must be of type bool.\"),assertAndGetBroadcastShape(n.shape,r.shape),logicalOr(e,t).logicalAnd(logicalAnd(e,t).logicalNot())}function where_(e,t,n){var r=convertToTensor(t,\"a\",\"where\"),o=convertToTensor(n,\"b\",\"where\"),a=convertToTensor(e,\"condition\",\"where\",\"bool\");assert(\"bool\"===a.dtype,\"Error Condition must be of type bool.\"),assertShapesMatch(r.shape,o.shape,\"Error in where: \"),1===a.rank?assert(a.shape[0]===r.shape[0],\"The first dimension of `a` must match the size of `condition`.\"):assertShapesMatch(a.shape,o.shape,\"Error in where: \");return ENV.engine.runKernel(function(e){return e.select(a,r,o)},{$condition:a,$a:r,$b:o},function(e){return{$condition:function(){return zerosLike(a)},$a:function(){return e.mul(a.cast(r.dtype))},$b:function(){return e.mul(a.logicalNot().cast(o.dtype))}}})}function whereAsync_(e){return __awaiter(this,void 0,void 0,function(){var t,n,r;return __generator(this,function(o){switch(o.label){case 0:return assert(\"bool\"===(t=convertToTensor(e,\"condition\",\"where\",\"bool\")).dtype,\"Condition must be of type bool.\"),[4,t.data()];case 1:return n=o.sent(),r=whereImpl(t.shape,n),e!==t&&t.dispose(),[2,r]}})})}var logicalAnd=op({logicalAnd_:logicalAnd_}),logicalNot=op({logicalNot_:logicalNot_}),logicalOr=op({logicalOr_:logicalOr_}),logicalXor=op({logicalXor_:logicalXor_}),where=op({where_:where_}),whereAsync=whereAsync_;function relu_(e){var t=convertToTensor(e,\"x\",\"relu\");if(\"bool\"===t.dtype)return t.toInt();return ENV.engine.runKernel(function(e){return e.relu(t)},{$x:t},function(e){var n=t.step();return{$x:function(){return e.mulStrict(n.toFloat())}}})}function elu_(e){var t=convertToTensor(e,\"x\",\"elu\");return ENV.engine.runKernel(function(e,n){return n(e.elu(t))},{$x:t},function(e,t){var n=t[0];return{$x:function(){return ENV.engine.runKernel(function(t){return t.eluDer(e,n)},{dy:e,y:n})}}})}function selu_(e){var t=convertToTensor(e,\"x\",\"selu\");return ENV.engine.runKernel(function(e){return e.selu(t)},{$x:t},function(e){return{$x:function(){var n=t.greater(scalar(0)),r=scalar(SELU_SCALEALPHA),o=scalar(SELU_SCALE),a=e.mul(o),i=e.mul(r).mul(t.toFloat().exp());return where(n,a,i)}}})}function leakyRelu_(e,t){void 0===t&&(t=.2);var n=convertToTensor(e,\"x\",\"leakyRelu\");return maximum(scalar(t).mul(n),n)}function prelu_(e,t){var n=convertToTensor(e,\"x\",\"prelu\"),r=convertToTensor(t,\"alpha\",\"prelu\"),o=scalar(0);return maximum(o,n).add(r.mul(minimum(o,n)))}var elu=op({elu_:elu_}),leakyRelu=op({leakyRelu_:leakyRelu_}),prelu=op({prelu_:prelu_}),relu=op({relu_:relu_}),selu=op({selu_:selu_});function transpose_(e,t){var n=convertToTensor(e,\"x\",\"transpose\");if(null==t&&(t=n.shape.map(function(e,t){return t}).reverse()),assert(n.rank===t.length,\"Error in transpose: rank of input \"+n.rank+\" must match length of perm \"+t+\".\"),t.forEach(function(e){assert(e>=0&&eo)throw new Error(\"'k' passed to topk() must be <= the last dimension (\"+o+\") but got \"+t);var a=ENV.engine.runKernel(function(e){return e.topk(r,t,n)},{$x:r});return{values:a[0],indices:a[1]}}var Reduction,topk=op({topk_:topk_});function computeWeightedLoss_(e,t,n){void 0===n&&(n=Reduction.SUM_BY_NONZERO_WEIGHTS);var r=convertToTensor(e,\"losses\",\"computeWeightedLoss\"),o=null;null!=t&&(o=convertToTensor(t,\"weights\",\"computeWeightedLoss\"));var a=null==o?r:r.mul(o);if(n===Reduction.NONE)return a;if(n===Reduction.SUM)return a.sum();if(n===Reduction.MEAN){if(null==o)return a.mean();var i=sizeFromShape(r.shape)/sizeFromShape(o.shape),s=a.sum().div(o.sum());return i>1?s.div(scalar(i)):s}if(n===Reduction.SUM_BY_NONZERO_WEIGHTS){if(null==o)return a.sum().div(scalar(r.size));var u=o.mul(ones$1(r.shape)).notEqual(scalar(0)).sum().toFloat();return a.sum().div(u)}throw Error(\"Unknown reduction: \"+n)}function absoluteDifference_(e,t,n,r){void 0===r&&(r=Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,\"labels\",\"absoluteDifference\"),a=convertToTensor(t,\"predictions\",\"absoluteDifference\"),i=null;null!=n&&(i=convertToTensor(n,\"weights\",\"absoluteDifference\")),assertShapesMatch(o.shape,a.shape,\"Error in absoluteDifference: \");var s=o.sub(a).abs();return computeWeightedLoss(s,i,r)}function meanSquaredError_(e,t,n,r){void 0===r&&(r=Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,\"labels\",\"meanSquaredError\"),a=convertToTensor(t,\"predictions\",\"meanSquaredError\"),i=null;null!=n&&(i=convertToTensor(n,\"weights\",\"meanSquaredError\")),assertShapesMatch(o.shape,a.shape,\"Error in meanSquaredError: \");var s=o.squaredDifference(a);return computeWeightedLoss(s,i,r)}function cosineDistance_(e,t,n,r,o){void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"labels\",\"cosineDistance\"),i=convertToTensor(t,\"predictions\",\"cosineDistance\"),s=null;null!=r&&(s=convertToTensor(r,\"weights\",\"cosineDistance\")),assertShapesMatch(a.shape,i.shape,\"Error in cosineDistance: \");var u=scalar(1).sub(a.mul(i).sum(n,!0));return computeWeightedLoss(u,s,o)}function hingeLoss_(e,t,n,r){void 0===r&&(r=Reduction.SUM_BY_NONZERO_WEIGHTS);var o=convertToTensor(e,\"labels\",\"hingeLoss\"),a=convertToTensor(t,\"predictions\",\"hingeLoss\"),i=null;null!=n&&(i=convertToTensor(n,\"weights\",\"hingeLoss\")),assertShapesMatch(o.shape,a.shape,\"Error in hingeLoss: \");var s=scalar(1);o=scalar(2).mul(o).sub(s);var u=s.sub(o.mul(a)).relu();return computeWeightedLoss(u,i,r)}function logLoss_(e,t,n,r,o){void 0===r&&(r=1e-7),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"labels\",\"logLoss\"),i=convertToTensor(t,\"predictions\",\"logLoss\"),s=null;null!=n&&(s=convertToTensor(n,\"weights\",\"logLoss\")),assertShapesMatch(a.shape,i.shape,\"Error in logLoss: \");var u=scalar(1),l=scalar(r),c=a.mul(i.add(l).log()).neg().sub(u.sub(a).mul(u.sub(i).add(l).log()));return computeWeightedLoss(c,s,o)}function sigmoidCrossEntropyWithLogits_(e,t){var n=convertToTensor(e,\"labels\",\"sigmoidCrossEntropyWithLogits\"),r=convertToTensor(t,\"logits\",\"sigmoidCrossEntropyWithLogits\");assertShapesMatch(n.shape,r.shape,\"Error in sigmoidCrossEntropyWithLogits: \");var o=r.relu(),a=r.mul(n),i=r.abs().neg().exp().log1p();return o.sub(a).add(i)}function sigmoidCrossEntropy_(e,t,n,r,o){void 0===r&&(r=0),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"multiClassLabels\",\"sigmoidCrossEntropy\"),i=convertToTensor(t,\"logits\",\"sigmoidCrossEntropy\"),s=null;if(null!=n&&(s=convertToTensor(n,\"weights\",\"sigmoidCrossEntropy\")),assertShapesMatch(a.shape,i.shape,\"Error in sigmoidCrossEntropy: \"),r>0){var u=scalar(r),l=scalar(1),c=scalar(.5);a=a.mul(l.sub(u)).add(c.mul(u))}var p=sigmoidCrossEntropyWithLogits_(a,i);return computeWeightedLoss(p,s,o)}function huberLoss_(e,t,n,r,o){void 0===r&&(r=1),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"labels\",\"huberLoss\"),i=convertToTensor(t,\"predictions\",\"huberLoss\"),s=null;null!=n&&(s=convertToTensor(n,\"weights\",\"huberLoss\")),assertShapesMatch(a.shape,i.shape,\"Error in huberLoss: \");var u=scalar(r),l=i.sub(a).abs(),c=minimum(l,u),p=l.sub(c),d=scalar(.5).mul(c.square()).add(u.mul(p));return computeWeightedLoss(d,s,o)}function softmaxCrossEntropyWithLogits_(e,t,n){if(void 0===n&&(n=-1),-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error(\"Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank \"+t.rank+\" and dim was \"+n);return customGrad(function(e,t){var r=t.logSumExp([n],!0),o=t.toFloat().sub(r);return{value:o.mul(e).neg().sum([n]),gradFunc:function(t){var r=expandShapeToKeepDim(t.shape,[n]);return[t.reshape(r).mul(e.toFloat().sub(o.exp())),t.reshape(r).mul(o.exp().sub(e.toFloat()))]}}})(e,t)}function softmaxCrossEntropy_(e,t,n,r,o){void 0===r&&(r=0),void 0===o&&(o=Reduction.SUM_BY_NONZERO_WEIGHTS);var a=convertToTensor(e,\"onehotLabels\",\"softmaxCrossEntropy\"),i=convertToTensor(t,\"logits\",\"softmaxCrossEntropy\"),s=null;if(null!=n&&(s=convertToTensor(n,\"weights\",\"softmaxCrossEntropy\")),assertShapesMatch(a.shape,i.shape,\"Error in softmaxCrossEntropy: \"),r>0){var u=scalar(r),l=scalar(1),c=scalar(a.shape[1]);a=a.mul(l.sub(u)).add(u.div(c))}var p=softmaxCrossEntropyWithLogits_(a,i);return computeWeightedLoss(p,s,o)}!function(e){e[e.NONE=0]=\"NONE\",e[e.MEAN=1]=\"MEAN\",e[e.SUM=2]=\"SUM\",e[e.SUM_BY_NONZERO_WEIGHTS=3]=\"SUM_BY_NONZERO_WEIGHTS\"}(Reduction||(Reduction={}));var absoluteDifference=op({absoluteDifference_:absoluteDifference_}),computeWeightedLoss=op({computeWeightedLoss_:computeWeightedLoss_}),cosineDistance=op({cosineDistance_:cosineDistance_}),hingeLoss=op({hingeLoss_:hingeLoss_}),huberLoss=op({huberLoss_:huberLoss_}),logLoss=op({logLoss_:logLoss_}),meanSquaredError=op({meanSquaredError_:meanSquaredError_}),sigmoidCrossEntropy=op({sigmoidCrossEntropy_:sigmoidCrossEntropy_}),softmaxCrossEntropy=op({softmaxCrossEntropy_:softmaxCrossEntropy_}),loss_ops=Object.freeze({get Reduction(){return Reduction},absoluteDifference:absoluteDifference,computeWeightedLoss:computeWeightedLoss,cosineDistance:cosineDistance,hingeLoss:hingeLoss,huberLoss:huberLoss,logLoss:logLoss,meanSquaredError:meanSquaredError,sigmoidCrossEntropy:sigmoidCrossEntropy,softmaxCrossEntropy:softmaxCrossEntropy});function gramSchmidt_(e){var t;if(Array.isArray(e)){t=!1,assert(null!=e&&e.length>0,\"Gram-Schmidt process: input must not be null, undefined, or empty\");for(var n=e[0].shape[0],r=1;r0)for(var n=0;n= 2, but got rank \"+e.rank);if(2===e.rank)return qr2d(e,t);var n=e.shape.slice(0,e.shape.length-2).reduce(function(e,t){return e*t}),r=[],o=[];return unstack(e.reshape([n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0).forEach(function(e){var n=qr2d(e,t),a=n[0],i=n[1];r.push(a),o.push(i)}),[stack(r,0).reshape(e.shape),stack(o,0).reshape(e.shape)]}function qr2d(e,t){return void 0===t&&(t=!1),ENV.engine.tidy(function(){if(2!==e.shape.length)throw new Error(\"qr2d() requires a 2D Tensor, but got a \"+e.shape.length+\"D Tensor.\");for(var n=e.shape[0],r=e.shape[1],o=eye(n),a=e.clone(),i=tensor2d([[1]],[1,1]),s=i.clone(),u=n>=r?r:n,l=function(e){var t,u=a,l=s,c=o;t=ENV.engine.tidy(function(){var t=a.slice([e,e],[n-e,1]),u=t.norm(),l=a.slice([e,e],[1,1]),c=l.sign().neg(),p=l.sub(c.mul(u)),d=t.div(p);s=1===d.shape[0]?i.clone():i.concat(d.slice([1,0],[d.shape[0]-1,d.shape[1]]),0);var h=c.matMul(p).div(u).neg(),f=a.slice([e,0],[n-e,r]),m=h.mul(s);a=0===e?f.sub(m.matMul(s.transpose().matMul(f))):a.slice([0,0],[e,r]).concat(f.sub(m.matMul(s.transpose().matMul(f))),0);var g=o.slice([0,e],[n,o.shape[1]-e]);return o=0===e?g.sub(g.matMul(s).matMul(m.transpose())):o.slice([0,0],[n,e]).concat(g.sub(g.matMul(s).matMul(m.transpose())),1),[s,a,o]}),s=t[0],a=t[1],o=t[2],dispose([u,l,c])},c=0;cr&&(o=o.slice([0,0],[n,r]),a=a.slice([0,0],[r,r])),[o,a]})}var gramSchmidt=op({gramSchmidt_:gramSchmidt_}),qr=op({qr_:qr_}),linalg_ops=Object.freeze({gramSchmidt:gramSchmidt,qr:qr});function resizeBilinear_(e,t,n){void 0===n&&(n=!1);var r=convertToTensor(e,\"images\",\"resizeBilinear\");assert(3===r.rank||4===r.rank,\"Error in resizeBilinear: x must be rank 3 or 4, but got rank \"+r.rank+\".\"),assert(2===t.length,\"Error in resizeBilinear: new shape must 2D, but got shape \"+t+\".\");var o=r,a=!1;3===r.rank&&(a=!0,o=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var i=t[0],s=t[1],u=ENV.engine.runKernel(function(e,t){return e.resizeBilinear(o,i,s,n)},{batchImages:o},function(e,t){return{batchImages:function(){return ENV.engine.runKernel(function(t){return t.resizeBilinearBackprop(e,o,n)},{})}}});return a?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}function resizeNearestNeighbor_(e,t,n){void 0===n&&(n=!1);var r=convertToTensor(e,\"images\",\"resizeNearestNeighbor\");assert(3===r.rank||4===r.rank,\"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank \"+r.rank+\".\"),assert(2===t.length,\"Error in resizeNearestNeighbor: new shape must 2D, but got shape \"+t+\".\"),assert(\"float32\"===r.dtype||\"int32\"===r.dtype,\"`images` must have `int32` or `float32` as dtype\");var o=r,a=!1;3===r.rank&&(a=!0,o=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var i=t[0],s=t[1],u=ENV.engine.runKernel(function(e,t){return e.resizeNearestNeighbor(o,i,s,n)},{batchImages:o},function(e,t){return{batchImages:function(){return ENV.engine.runKernel(function(t){return t.resizeNearestNeighborBackprop(e,o,n)},{})}}});return a?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}function nonMaxSuppression_(e,t,n,r,o){void 0===r&&(r=.5),void 0===o&&(o=Number.NEGATIVE_INFINITY);var a=convertToTensor(e,\"boxes\",\"nonMaxSuppression\"),i=convertToTensor(t,\"scores\",\"nonMaxSuppression\"),s=nonMaxSuppSanityCheck(a,i,n,r,o);return n=s.maxOutputSize,r=s.iouThreshold,o=s.scoreThreshold,ENV.engine.runKernel(function(e){return e.nonMaxSuppression(a,i,n,r,o)},{$boxes:a})}function nonMaxSuppressionAsync_(e,t,n,r,o){return void 0===r&&(r=.5),void 0===o&&(o=Number.NEGATIVE_INFINITY),__awaiter(this,void 0,void 0,function(){var a,i,s,u,l,c;return __generator(this,function(p){switch(p.label){case 0:return a=convertToTensor(e,\"boxes\",\"nonMaxSuppressionAsync\"),i=convertToTensor(t,\"scores\",\"nonMaxSuppressionAsync\"),s=nonMaxSuppSanityCheck(a,i,n,r,o),n=s.maxOutputSize,r=s.iouThreshold,o=s.scoreThreshold,[4,a.data()];case 1:return u=p.sent(),[4,i.data()];case 2:return l=p.sent(),c=nonMaxSuppressionImpl(u,l,n,r,o),a!==e&&a.dispose(),i!==t&&i.dispose(),[2,c]}})})}function nonMaxSuppSanityCheck(e,t,n,r,o){null==r&&(r=.5),null==o&&(o=Number.NEGATIVE_INFINITY);var a=e.shape[0];return n=Math.min(n,a),assert(0<=r&&r<=1,\"iouThreshold must be in [0, 1], but was '\"+r+\"'\"),assert(2===e.rank,\"boxes must be a 2D tensor, but was of rank '\"+e.rank+\"'\"),assert(4===e.shape[1],\"boxes must have 4 columns, but 2nd dimension was \"+e.shape[1]),assert(1===t.rank,\"scores must be a 1D tensor\"),assert(t.shape[0]===a,\"scores has incompatible shape with boxes. Expected \"+a+\", but was \"+t.shape[0]),{maxOutputSize:n,iouThreshold:r,scoreThreshold:o}}var resizeBilinear=op({resizeBilinear_:resizeBilinear_}),resizeNearestNeighbor=op({resizeNearestNeighbor_:resizeNearestNeighbor_}),nonMaxSuppression=op({nonMaxSuppression_:nonMaxSuppression_}),nonMaxSuppressionAsync=nonMaxSuppressionAsync_,image_ops=Object.freeze({resizeBilinear:resizeBilinear,resizeNearestNeighbor:resizeNearestNeighbor,nonMaxSuppression:nonMaxSuppression,nonMaxSuppressionAsync:nonMaxSuppressionAsync}),ops=Object.freeze({image:image_ops,linalg:linalg_ops,losses:loss_ops,op:op,batchNormalization2d:batchNormalization2d,batchNormalization3d:batchNormalization3d,batchNormalization4d:batchNormalization4d,batchNormalization:batchNormalization,concat:concat,concat1d:concat1d,concat2d:concat2d,concat3d:concat3d,concat4d:concat4d,conv1d:conv1d,conv2d:conv2d,depthwiseConv2d:depthwiseConv2d,separableConv2d:separableConv2d,conv2dTranspose:conv2dTranspose,matMul:matMul,dot:dot,outerProduct:outerProduct,reverse:reverse,reverse1d:reverse1d,reverse2d:reverse2d,reverse3d:reverse3d,reverse4d:reverse4d,maxPool:maxPool,avgPool:avgPool,slice:slice,slice1d:slice1d,slice2d:slice2d,slice3d:slice3d,slice4d:slice4d,abs:abs,acos:acos,acosh:acosh,asin:asin,asinh:asinh,atan:atan,atanh:atanh,ceil:ceil,clipByValue:clipByValue,cos:cos,cosh:cosh,erf:erf,exp:exp,expm1:expm1,floor:floor,log:log$1,log1p:log1p,logSigmoid:logSigmoid,neg:neg,reciprocal:reciprocal,round:round,rsqrt:rsqrt,sigmoid:sigmoid,sign:sign,sin:sin,sinh:sinh,softplus:softplus,sqrt:sqrt,square:square,step:step,tan:tan,tanh:tanh$1,all:all,any:any,argMax:argMax,argMin:argMin,logSumExp:logSumExp,max:max,mean:mean,min:min,moments:moments,sum:sum,equal:equal,equalStrict:equalStrict,greater:greater,greaterEqual:greaterEqual,greaterEqualStrict:greaterEqualStrict,greaterStrict:greaterStrict,less:less,lessEqual:lessEqual,lessEqualStrict:lessEqualStrict,lessStrict:lessStrict,notEqual:notEqual,notEqualStrict:notEqualStrict,add:add,addN:addN,addStrict:addStrict,atan2:atan2,div:div,divStrict:divStrict,floorDiv:floorDiv,maximum:maximum,maximumStrict:maximumStrict,minimum:minimum,minimumStrict:minimumStrict,mod:mod,modStrict:modStrict,mul:mul,mulStrict:mulStrict,pow:pow,powStrict:powStrict,squaredDifference:squaredDifference,squaredDifferenceStrict:squaredDifferenceStrict,sub:sub,subStrict:subStrict,elu:elu,leakyRelu:leakyRelu,prelu:prelu,relu:relu,selu:selu,logicalAnd:logicalAnd,logicalNot:logicalNot,logicalOr:logicalOr,logicalXor:logicalXor,where:where,whereAsync:whereAsync,buffer:buffer,toPixels:toPixels,print:print,cast:cast,clone:clone,cumsum:cumsum,expandDims:expandDims,eye:eye,fromPixels:fromPixels,multinomial:multinomial,oneHot:oneHot,pad:pad,pad1d:pad1d,pad2d:pad2d,pad3d:pad3d,pad4d:pad4d,rand:rand,randomNormal:randomNormal,randomUniform:randomUniform,reshape:reshape,split:split,squeeze:squeeze,stack:stack,tile:tile,truncatedNormal:truncatedNormal,unstack:unstack,batchToSpaceND:batchToSpaceND,spaceToBatchND:spaceToBatchND,fill:fill,linspace:linspace,ones:ones$1,range:range,scalar:scalar,tensor:tensor,tensor1d:tensor1d,tensor2d:tensor2d,tensor3d:tensor3d,tensor4d:tensor4d,tensor5d:tensor5d,tensor6d:tensor6d,zeros:zeros,onesLike:onesLike,zerosLike:zerosLike,transpose:transpose,softmax:softmax,localResponseNormalization:localResponseNormalization,norm:norm,gather:gather,unsortedSegmentSum:unsortedSegmentSum,basicLSTMCell:basicLSTMCell,multiRNNCell:multiRNNCell,movingAverage:movingAverage,stridedSlice:stridedSlice,topk:topk}),MathBackendCPU=function(){function e(){this.data=new WeakMap,this.firstUse=!0,ENV.get(\"IS_BROWSER\")&&(this.canvas=document.createElement(\"canvas\"))}return e.prototype.register=function(e,t,n){if(this.firstUse&&(this.firstUse=!1,ENV.get(\"IS_NODE\")&&warn(\"\\n============================\\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\\n============================\\n\")),this.data.has(e))throw new Error(\"Data buffer is already registered\");this.data.set(e,null)},e.prototype.write=function(e,t){if(null==t)throw new Error(\"MathBackendCPU.write(): values can not be null\");this.throwIfNoData(e),this.data.set(e,t)},e.prototype.fromPixels=function(e,t){if(null==e)throw new Error(\"pixels passed to tf.fromPixels() can not be null\");var n,r;if(ENV.get(\"IS_NODE\")&&null==e.getContext)throw new Error(\"When running in node, pixels must be an HTMLCanvasElement like the one returned by the `canvas` npm package\");if(null!=e.getContext)n=e.getContext(\"2d\").getImageData(0,0,e.width,e.height).data;else if(e instanceof ImageData)n=e.data;else{if(!(e instanceof HTMLImageElement||e instanceof HTMLVideoElement))throw new Error(\"pixels passed to tf.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement or ImageData, but was \"+e.constructor.name);if(null==this.canvas)throw new Error(\"Can't read pixels from HTMLImageElement outside the browser.\");this.canvas.width=e.width,this.canvas.height=e.height,this.canvas.getContext(\"2d\").drawImage(e,0,0,e.width,e.height),n=this.canvas.getContext(\"2d\").getImageData(0,0,e.width,e.height).data}if(4===t)r=new Int32Array(n);else{var o=e.width*e.height;r=new Int32Array(o*t);for(var a=0;ad&&(d=m,h=f)}u[c]=h}return i},e.prototype.cumsum=function(e,t,n,r){if(t!==e.rank-1)throw new Error(\"backend.cumsum in CPU expects an inner-most axis=\"+(e.rank-1)+\" but got axis=\"+t);for(var o=upcastType(e.dtype,\"int32\"),a=zeros(e.shape,o),i=a.dataSync(),s=e.dataSync(),u=e.shape[e.rank-1],l=r?function(e,t){return e+u-t-1}:function(e,t){return e+t},c=0;ct?1:0})},e.prototype.greaterEqual=function(e,t){return this.broadcastedBinaryOp(e,t,\"bool\",function(e,t){return e>=t?1:0})},e.prototype.logicalNot=function(e){for(var t=e.dataSync(),n=new Int32Array(t.length),r=0;r1||1===t.rank?1:t.shape[1],c=0;c=0&&t>=0?n:(n+t)%t})},e.prototype.max=function(e,t){assertAxesAreInnerMostDims(\"max\",t,e.rank);for(var n=computeOutAndReduceShapes(e.shape,t),r=n[0],o=n[1],a=zeros(r,e.dtype),i=sizeFromShape(o),s=a.dataSync(),u=e.dataSync(),l=0;lp&&(p=h)}s[l]=p}return a},e.prototype.maximum=function(e,t){return this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.max(e,t)})},e.prototype.all=function(e,t){assertAxesAreInnerMostDims(\"all\",t,e.rank);for(var n=computeOutAndReduceShapes(e.shape,t),r=n[0],o=n[1],a=zeros(r,e.dtype),i=sizeFromShape(o),s=a.dataSync(),u=e.dataSync(),l=0;l0?n[r]=1:n[r]=0;return Tensor.make(e.shape,{values:n})},e.prototype.round=function(e){for(var t=e.dataSync(),n=new Float32Array(t.length),r=0;r.5?n[r]=Math.ceil(t[r]):n[r]=o%2==0?o:o+1}return Tensor.make(e.shape,{values:n})},e.prototype.exp=function(e){for(var t=e.dataSync(),n=new Float32Array(t.length),r=0;r=0?o:Math.exp(o)-1}return Tensor.make(e.shape,{values:t})},e.prototype.eluDer=function(e,t){for(var n=new Float32Array(t.size),r=t.dataSync(),o=e.dataSync(),a=0;a=1?o[a]:o[a]*(i+1)}return Tensor.make(t.shape,{values:n})},e.prototype.selu=function(e){for(var t=SELU_SCALEALPHA,n=SELU_SCALE,r=new Float32Array(e.size),o=e.dataSync(),a=0;a=0?n*i:t*(Math.exp(i)-1)}return Tensor.make(e.shape,{values:r})},e.prototype.clip=function(e,t,n){for(var r=new Float32Array(e.size),o=e.dataSync(),a=0;a-t,i=r[o]0?1:t}return Tensor.make(e.shape,{values:n})},e.prototype.conv2d=function(e,t,n){for(var r=n.filterHeight,o=n.filterWidth,a=n.dilationHeight,i=n.dilationWidth,s=n.padInfo.left,u=n.padInfo.top,l=buffer(n.outShape,e.dtype),c=0;c=n.inHeight))for(var x=0;x=n.inWidth))for(var S=0;S=n.inHeight))for(var S=0;S=n.inWidth))y+=e.get(p,T,b,d)*t.get(x,S,d,v)}}c.set(y,p,h,m,d*l+v)}return c.toTensor()},e.prototype.depthwiseConv2DDerInput=function(e,t,n){for(var r=buffer(n.inShape,\"float32\"),o=r.values,a=r.strides,i=a[0],s=a[1],u=a[2],l=e.dataSync(),c=e.strides,p=c[0],d=c[1],h=c[2],f=t.dataSync(),m=t.strides,g=m[0],v=m[1],y=m[2],x=n.batchSize,T=n.filterHeight,S=n.filterWidth,b=n.inChannels,E=n.inHeight,w=n.inWidth,_=n.outChannels,A=n.outHeight,R=n.outWidth,C=n.strideHeight,N=n.strideWidth,k=T-1-n.padInfo.top,I=S-1-n.padInfo.left,D=_/b,M=0;MT?T=_:\"avg\"===n&&(S+=_,b++)}if(isNaN(T))break}s.set(\"avg\"===n?S/b:T,c,d,g,p)}return s.toTensor()},e.prototype.maxPool=function(e,t){return this.pool(e,t,\"max\")},e.prototype.maxPoolPositions=function(e,t){for(var n=buffer(t.outShape,\"int32\"),r=t.strideHeight,o=t.strideWidth,a=t.filterHeight,i=t.filterWidth,s=t.padInfo.top,u=t.padInfo.left,l=0;lx&&(x=_,T=b*i+w)}n.set(T,l,p,m,c)}return n.toTensor()},e.prototype.maxPoolBackprop=function(e,t,n,r){for(var o=this.maxPoolPositions(t,r),a=r.strideHeight,i=r.strideWidth,s=r.filterHeight,u=r.filterWidth,l=u-1-r.padInfo.left,c=s-1-r.padInfo.top,p=buffer(t.shape,\"float32\"),d=0;d=r.outHeight||Math.floor(T)!==T))for(var S=0;S=r.outWidth||Math.floor(b)!==b)){var E=s*u-1-o.get(d,T,b,h)===x*u+S?1:0;if(0!==E)y+=e.get(d,T,b,h)*E}}}p.set(y,d,f,m,h)}return p.toTensor()},e.prototype.avgPoolBackprop=function(e,t,n){for(var r=n.strideHeight,o=n.strideWidth,a=n.filterHeight,i=n.filterWidth,s=i-1-n.padInfo.left,u=a-1-n.padInfo.top,l=buffer(t.shape,\"float32\"),c=1/(a*i),p=0;p=n.outHeight||Math.floor(x)!==x))for(var T=0;T=n.outWidth||Math.floor(S)!==S))v+=e.get(p,x,S,d)}}l.set(v*c,p,h,f,d)}return l.toTensor()},e.prototype.cast=function(e,t){return castTensor(e,t,this)},e.prototype.reshape=function(e,t){return reshapeTensor(e,t)},e.prototype.avgPool=function(e,t){return this.pool(e,t,\"avg\").toFloat()},e.prototype.resizeBilinear=function(e,t,n,r){for(var o=e.shape,a=o[0],i=o[1],s=o[2],u=o[3],l=buffer([a,t,n,u],e.dtype),c=[r&&t>1?i-1:i,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],d=0;d1?a-1:a,n&&c>1?i-1:i],h=[n&&l>1?l-1:l,n&&c>1?c-1:c],f=d[0]/h[0],m=d[1]/h[1],g=0;g1?i-1:i,r&&n>1?s-1:s],p=[r&&t>1?t-1:t,r&&n>1?n-1:n],d=0;d1?a-1:a,n&&c>1?i-1:i],h=[n&&l>1?l-1:l,n&&c>1?c-1:c],f=1/(d[0]/h[0]),m=1/(d[1]/h[1]),g=2*Math.ceil(f)+2,v=2*Math.ceil(m)+2,y=0;y=l))for(var N=0;N=c)){var I=d[0]*(C/h[0]),D=d[1]*(k/h[1]),M=Math.min(a-1,n?Math.round(I):Math.floor(I)),O=Math.min(i-1,n?Math.round(D):Math.floor(D));x===M&&T===O&&(A+=e.get(y,C,k,_))}}}p.set(A,y,x,T,_)}return p.toTensor()},e.prototype.batchNormalization=function(e,t,n,r,o,a){for(var i=e.dataSync(),s=t.dataSync(),u=n.dataSync(),l=o?o.dataSync():new Float32Array([1]),c=a?a.dataSync():new Float32Array([0]),p=new Float32Array(i.length),d=0;d=0&&e.get(a)0,\"scheme must not be an empty string.\");var r=e.getInstance();assert(null==r.managers[t],\"A model store manager is already registered for scheme '\"+t+\"'.\"),r.managers[t]=n},e.getManager=function(e){var t=this.getInstance().managers[e];if(null==t)throw new Error(\"Cannot find model manager for scheme '\"+e+\"'\");return t},e.getSchemes=function(){return Object.keys(this.getInstance().managers)},e}();function parseURL(e){if(-1===e.indexOf(URL_SCHEME_SUFFIX))throw new Error(\"The url string provided does not contain a scheme. Supported schemes are: \"+ModelStoreManagerRegistry.getSchemes().join(\",\"));return{scheme:e.split(URL_SCHEME_SUFFIX)[0],path:e.split(URL_SCHEME_SUFFIX)[1]}}function cloneModelInternal(e,t,n){return void 0===n&&(n=!1),__awaiter(this,void 0,void 0,function(){var r,o,a,i,s,u,l,c,p;return __generator(this,function(d){switch(d.label){case 0:return assert(e!==t,\"Old path and new path are the same: '\"+e+\"'\"),assert((r=IORouterRegistry.getLoadHandlers(e)).length>0,\"Copying failed because no load handler is found for source URL \"+e+\".\"),assert(r.length<2,\"Copying failed because more than one (\"+r.length+\") load handlers for source URL \"+e+\".\"),o=r[0],assert((a=IORouterRegistry.getSaveHandlers(t)).length>0,\"Copying failed because no save handler is found for destination URL \"+t+\".\"),assert(a.length<2,\"Copying failed because more than one (\"+r.length+\") save handlers for destination URL \"+t+\".\"),i=a[0],s=parseURL(e).scheme,u=parseURL(e).path,l=s===parseURL(e).scheme,[4,o.load()];case 1:return c=d.sent(),n&&l?[4,ModelStoreManagerRegistry.getManager(s).removeModel(u)]:[3,3];case 2:d.sent(),d.label=3;case 3:return[4,i.save(c)];case 4:return p=d.sent(),!n||l?[3,6]:[4,ModelStoreManagerRegistry.getManager(s).removeModel(u)];case 5:d.sent(),d.label=6;case 6:return[2,p.modelArtifactsInfo]}})})}function listModels(){return __awaiter(this,void 0,void 0,function(){var e,t,n,r,o,a,i;return __generator(this,function(s){switch(s.label){case 0:e=ModelStoreManagerRegistry.getSchemes(),t={},n=0,r=e,s.label=1;case 1:return n0,\"URL path for browserHTTPRequest must not be null, undefined or empty.\"),this.path=e,null!=t&&null!=t.body)throw new Error(\"requestInit is expected to have no pre-existing body, but has one.\");this.requestInit=t||{}}return e.prototype.save=function(e){return __awaiter(this,void 0,void 0,function(){var t,n,r,o;return __generator(this,function(a){switch(a.label){case 0:if(e.modelTopology instanceof ArrayBuffer)throw new Error(\"BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.\");return(t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,n=[{paths:[\"./model.weights.bin\"],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,weightsManifest:n},t.body.append(\"model.json\",new Blob([JSON.stringify(r)],{type:\"application/json\"}),\"model.json\"),null!=e.weightData&&t.body.append(\"model.weights.bin\",new Blob([e.weightData],{type:\"application/octet-stream\"}),\"model.weights.bin\"),[4,fetch(this.path,t)];case 1:if(200===(o=a.sent()).status)return[2,{modelArtifactsInfo:getModelArtifactsInfoForJSON(e),responses:[o]}];throw new Error(\"BrowserHTTPRequest.save() failed due to HTTP response status \"+o.status+\".\")}})})},e.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){var e,t,n,r,o,a,i,s,u,l,c,p;return __generator(this,function(d){switch(d.label){case 0:return[4,fetch(this.path,this.requestInit)];case 1:return[4,d.sent().json()];case 2:if(e=d.sent(),t=e.modelTopology,n=e.weightsManifest,null==t&&null==n)throw new Error(\"The JSON from HTTP path \"+this.path+\" contains neither model topology or manifest for weights.\");if(null==n)return[3,4];for(a=e.weightsManifest,r=[],i=0,s=a;i0&&(e=__assign({weightSpecs:this.weightSpecs},e)),null!=this.weightData&&this.weightData.byteLength>0&&(e=__assign({weightData:this.weightData},e)),[2,e]})})},e}(),PassthroughSaver=function(){function e(e){this.saveHandler=e}return e.prototype.save=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,this.saveHandler(e)]})})},e}();function fromMemory(e,t,n){return new PassthroughLoader(e,t,n)}function withSaveHandler(e){return new PassthroughSaver(e)}var registerSaveRouter=IORouterRegistry.registerSaveRouter,registerLoadRouter=IORouterRegistry.registerLoadRouter,getSaveHandlers=IORouterRegistry.getSaveHandlers,getLoadHandlers=IORouterRegistry.getLoadHandlers,io=Object.freeze({browserFiles:browserFiles,browserHTTPRequest:browserHTTPRequest,concatenateArrayBuffers:concatenateArrayBuffers,decodeWeights:decodeWeights,encodeWeights:encodeWeights,fromMemory:fromMemory,getLoadHandlers:getLoadHandlers,getModelArtifactsInfoForJSON:getModelArtifactsInfoForJSON,getSaveHandlers:getSaveHandlers,loadWeights:loadWeights,registerLoadRouter:registerLoadRouter,registerSaveRouter:registerSaveRouter,withSaveHandler:withSaveHandler,copyModel:copyModel,listModels:listModels,moveModel:moveModel,removeModel:removeModel}),Serializable=function(){function e(){}return e.prototype.getClassName=function(){return this.constructor.className},e.fromConfig=function(e,t){return new e(t)},e}(),SerializationMap=function(){function e(){this.classNameMap={}}return e.getMap=function(){return null==e.instance&&(e.instance=new e),e.instance},e.register=function(t){e.getMap().classNameMap[t.className]=[t,t.fromConfig]},e}(),serialization=Object.freeze({Serializable:Serializable,SerializationMap:SerializationMap}),WEBGL_ENVS={HAS_WEBGL:!0},NODE_ENVS={IS_NODE:!0},CHROME_ENVS={IS_CHROME:!0},BROWSER_ENVS={IS_BROWSER:!0},CPU_ENVS={HAS_WEBGL:!1},ALL_ENVS={};function expectArraysClose(e,t,n){if(null==n&&(n=ENV.get(\"TEST_EPSILON\")),e instanceof Tensor||t instanceof Tensor){if(e instanceof Tensor&&t instanceof Tensor){if(e.dtype!==t.dtype)throw new Error(\"Arrays are of different type actual: \"+e.dtype+\" vs expected: \"+t.dtype+\".\");if(!arraysEqual(e.shape,t.shape))throw new Error(\"Arrays are of different shape actual: \"+e.shape+\" vs expected: \"+t.shape+\".\")}}else{var r=e.constructor.name,o=t.constructor.name;if(r!==o)throw new Error(\"Arrays are of different type actual: \"+r+\" vs expected: \"+o)}var a,i;if(a=e instanceof Tensor?e.dataSync():e,i=t instanceof Tensor?t.dataSync():t,a.length!==i.length)throw new Error(\"Arrays have different lengths actual: \"+a.length+\" vs expected: \"+i.length+\".\\nActual: \"+a+\".\\nExpected: \"+i+\".\");for(var s=0;sn)}function expectValuesInRange(e,t,n){var r;r=e instanceof Tensor?e.dataSync():e;for(var o=0;on)throw new Error(\"Value out of range:\"+r[o]+\" low: \"+t+\", high: \"+n)}function expectArrayBuffersEqual(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}var test_util=Object.freeze({WEBGL_ENVS:WEBGL_ENVS,NODE_ENVS:NODE_ENVS,CHROME_ENVS:CHROME_ENVS,BROWSER_ENVS:BROWSER_ENVS,CPU_ENVS:CPU_ENVS,ALL_ENVS:ALL_ENVS,expectArraysClose:expectArraysClose,expectPromiseToFail:expectPromiseToFail,expectArraysEqual:expectArraysEqual,expectNumbersClose:expectNumbersClose,expectValuesInRange:expectValuesInRange,expectArrayBuffersEqual:expectArrayBuffersEqual}),version=\"0.12.8\",webgl=Object.freeze({gpgpu_util:gpgpu_util,webgl_util:webgl_util,MathBackendWebGL:MathBackendWebGL,GPGPUContext:GPGPUContext}),Optimizer=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.minimize=function(e,t,n){void 0===t&&(t=!1);var r=this.computeGradients(e,n),o=r.value,a=r.grads;return this.applyGradients(a),Object.keys(a).forEach(function(e){return a[e].dispose()}),t?o:(o.dispose(),null)},t.prototype.computeGradients=function(e,t){return variableGrads(e,t)},t}(Serializable),DEFAULT_FLOAT32_EPSILON=1e-8,DEFAULT_FLOAT16_EPSILON=1e-4;function getOptimizerDefaultEpsilonValue(){return ENV.get(\"WEBGL_RENDER_FLOAT32_ENABLED\")?DEFAULT_FLOAT32_EPSILON:DEFAULT_FLOAT16_EPSILON}var AdadeltaOptimizer=function(e){function t(t,n,r){void 0===r&&(r=null);var o=e.call(this)||this;return o.learningRate=t,o.rho=n,o.epsilon=r,o.accumulatedGrads={},o.accumulatedUpdates={},o.c=keep(scalar(-t)),o.rhoScalar=keep(scalar(n)),o.oneMinusRho=keep(scalar(1-n)),null===r&&(r=getOptimizerDefaultEpsilonValue()),o.epsilonScalar=keep(scalar(r)),o}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulatedGrads[n]){tidy(function(){t.accumulatedGrads[n]=zerosLike(o).variable(!1)})}if(null==r.accumulatedUpdates[n]){tidy(function(){t.accumulatedUpdates[n]=zerosLike(o).variable(!1)})}var a=e[n],i=r.accumulatedGrads[n],s=r.accumulatedUpdates[n];tidy(function(){var e=t.rhoScalar.mul(i).add(t.oneMinusRho.mul(a.square())),r=s.add(t.epsilonScalar).sqrt().div(i.add(t.epsilonScalar).sqrt()).mul(a),u=t.rhoScalar.mul(s).add(t.oneMinusRho.mul(r.square()));t.accumulatedGrads[n].assign(e),t.accumulatedUpdates[n].assign(u);var l=t.c.mul(r).add(o);o.assign(l)})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsilonScalar.dispose(),this.rhoScalar.dispose(),this.oneMinusRho.dispose(),null!=this.accumulatedUpdates&&(Object.keys(this.accumulatedUpdates).forEach(function(t){return e.accumulatedUpdates[t].dispose()}),Object.keys(this.accumulatedGrads).forEach(function(t){return e.accumulatedGrads[t].dispose()}))},t.prototype.getConfig=function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.rho,t.epsilon)},t.className=\"AdadeltaOptimizer\",t}(Optimizer);SerializationMap.register(AdadeltaOptimizer);var AdagradOptimizer=function(e){function t(t,n){void 0===n&&(n=.1);var r=e.call(this)||this;r.learningRate=t,r.initialAccumulatorValue=n,r.accumulatedGrads={},r.c=keep(scalar(-t));var o=getOptimizerDefaultEpsilonValue();return r.epsilon=keep(scalar(o)),r}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulatedGrads[n]){tidy(function(){t.accumulatedGrads[n]=fill(o.shape,t.initialAccumulatorValue).variable(!1)})}var a=e[n],i=r.accumulatedGrads[n];tidy(function(){var e=i.add(a.square());t.accumulatedGrads[n].assign(e);var r=t.c.mul(a.div(e.add(t.epsilon).sqrt())).add(o);o.assign(r)})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){var e=this;this.epsilon.dispose(),this.c.dispose(),null!=this.accumulatedGrads&&Object.keys(this.accumulatedGrads).forEach(function(t){return e.accumulatedGrads[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}},t.fromConfig=function(e,t){return new e(t.learningRate,t.initialAccumulatorValue)},t.className=\"AdagradOptimizer\",t}(Optimizer);SerializationMap.register(AdagradOptimizer);var AdamOptimizer=function(e){function t(t,n,r,o){void 0===o&&(o=null);var a=e.call(this)||this;return a.learningRate=t,a.beta1=n,a.beta2=r,a.epsilon=o,a.accumulatedFirstMoment={},a.accumulatedSecondMoment={},a.c=keep(scalar(-t)),a.beta1Scalar=keep(scalar(n)),a.beta2Scalar=keep(scalar(r)),tidy(function(){a.accBeta1=scalar(n).variable(),a.accBeta2=scalar(r).variable()}),a.oneMinusBeta1=keep(scalar(1-n)),a.oneMinusBeta2=keep(scalar(1-r)),a.one=keep(scalar(1)),null===o&&(o=getOptimizerDefaultEpsilonValue()),a.epsScalar=keep(scalar(o)),a}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;tidy(function(){var n=t.one.sub(t.accBeta1),r=t.one.sub(t.accBeta2);for(var o in e){var a=ENV.engine.registeredVariables[o];if(null==t.accumulatedFirstMoment[o]){var i=!1;t.accumulatedFirstMoment[o]=zerosLike(a).variable(i)}if(null==t.accumulatedSecondMoment[o]){i=!1;t.accumulatedSecondMoment[o]=zerosLike(a).variable(i)}var s=e[o],u=t.accumulatedFirstMoment[o],l=t.accumulatedSecondMoment[o],c=t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)),p=t.beta2Scalar.mul(l).add(t.oneMinusBeta2.mul(s.square())),d=c.div(n),h=p.div(r);t.accumulatedFirstMoment[o].assign(c),t.accumulatedSecondMoment[o].assign(p);var f=t.c.mul(d.div(t.epsScalar.add(h.sqrt()))).add(a);a.assign(f)}t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar)),t.accBeta2.assign(t.accBeta2.mul(t.beta2Scalar))})},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsScalar.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.accBeta1.dispose(),this.accBeta2.dispose(),this.oneMinusBeta1.dispose(),this.oneMinusBeta2.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(t){return e.accumulatedFirstMoment[t].dispose()}),null!=this.accumulatedSecondMoment&&Object.keys(this.accumulatedSecondMoment).forEach(function(t){return e.accumulatedSecondMoment[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)},t.className=\"AdamOptimizer\",t}(Optimizer);SerializationMap.register(AdamOptimizer);var AdamaxOptimizer=function(e){function t(t,n,r,o,a){void 0===o&&(o=null),void 0===a&&(a=0);var i=e.call(this)||this;return i.learningRate=t,i.beta1=n,i.beta2=r,i.epsilon=o,i.decay=a,i.accumulatedFirstMoment={},i.accumulatedWeightedInfNorm={},i.c=keep(scalar(-t)),i.beta1Scalar=keep(scalar(n)),i.beta2Scalar=keep(scalar(r)),i.decayScalar=keep(scalar(a)),tidy(function(){i.iteration=scalar(0).variable(),i.accBeta1=scalar(n).variable()}),i.oneMinusBeta1=keep(scalar(1-n)),i.one=keep(scalar(1)),null===o&&(o=getOptimizerDefaultEpsilonValue()),i.epsScalar=keep(scalar(o)),i}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;tidy(function(){var n=t.one.sub(t.accBeta1),r=t.c.div(t.one.add(t.decayScalar.mul(t.iteration)));for(var o in e){var a=ENV.engine.registeredVariables[o];if(null==t.accumulatedFirstMoment[o]){var i=!1;t.accumulatedFirstMoment[o]=zerosLike(a).variable(i)}if(null==t.accumulatedWeightedInfNorm[o]){i=!1;t.accumulatedWeightedInfNorm[o]=zerosLike(a).variable(i)}var s=e[o],u=t.accumulatedFirstMoment[o],l=t.accumulatedWeightedInfNorm[o],c=t.beta1Scalar.mul(u).add(t.oneMinusBeta1.mul(s)),p=t.beta2Scalar.mul(l),d=s.abs(),h=p.maximum(d);t.accumulatedFirstMoment[o].assign(c),t.accumulatedWeightedInfNorm[o].assign(h);var f=r.div(n).mul(c.div(t.epsScalar.add(h))).add(a);a.assign(f)}t.iteration.assign(t.iteration.add(t.one)),t.accBeta1.assign(t.accBeta1.mul(t.beta1Scalar))})},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsScalar.dispose(),this.accBeta1.dispose(),this.beta1Scalar.dispose(),this.beta2Scalar.dispose(),this.oneMinusBeta1.dispose(),this.decayScalar.dispose(),this.iteration.dispose(),this.one.dispose(),null!=this.accumulatedFirstMoment&&Object.keys(this.accumulatedFirstMoment).forEach(function(t){return e.accumulatedFirstMoment[t].dispose()}),null!=this.accumulatedWeightedInfNorm&&Object.keys(this.accumulatedWeightedInfNorm).forEach(function(t){return e.accumulatedWeightedInfNorm[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)},t.className=\"AdamaxOptimizer\",t}(Optimizer);SerializationMap.register(AdamaxOptimizer);var SGDOptimizer=function(e){function t(t){var n=e.call(this)||this;return n.learningRate=t,n.setLearningRate(t),n}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n],o=ENV.engine.registeredVariables[n];tidy(function(){var e=t.c.mul(r).add(o);o.assign(e)})})},t.prototype.setLearningRate=function(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=keep(scalar(-e))},t.prototype.dispose=function(){this.c.dispose()},t.prototype.getConfig=function(){return{learningRate:this.learningRate}},t.fromConfig=function(e,t){return new e(t.learningRate)},t.className=\"SGDOptimizer\",t}(Optimizer);SerializationMap.register(SGDOptimizer);var MomentumOptimizer=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t)||this;return o.learningRate=t,o.momentum=n,o.useNesterov=r,o.m=scalar(o.momentum),o.accumulations={},o}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulations[n]){tidy(function(){t.accumulations[n]=zerosLike(o).variable(!1)})}var a=r.accumulations[n],i=e[n];tidy(function(){var e,r=t.m.mul(a).add(i);e=t.useNesterov?t.c.mul(i.add(r.mul(t.m))).add(o):t.c.mul(r).add(o),t.accumulations[n].assign(r),o.assign(e)})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){if(e.prototype.dispose.call(this),this.m.dispose(),null!=this.accumulations)for(var t in this.accumulations)this.accumulations[t].dispose()},t.prototype.setMomentum=function(e){this.momentum=e},t.prototype.getConfig=function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}},t.fromConfig=function(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)},t.className=\"MomentumOptimizer\",t}(SGDOptimizer);SerializationMap.register(MomentumOptimizer);var RMSPropOptimizer=function(e){function t(t,n,r,o,a){void 0===n&&(n=.9),void 0===r&&(r=0),void 0===o&&(o=null),void 0===a&&(a=!1);var i=e.call(this)||this;return i.learningRate=t,i.decay=n,i.momentum=r,i.epsilon=o,i.accumulatedMeanSquares={},i.accumulatedMeanGrads={},i.accumulatedMoments={},i.c=keep(scalar(t)),i.decayScalar=keep(scalar(n)),i.momentumScalar=keep(scalar(r)),i.oneMinusDecay=keep(scalar(1-n)),i.centered=a,null===o&&(o=getOptimizerDefaultEpsilonValue()),i.epsilonScalar=keep(scalar(o)),i}return __extends(t,e),t.prototype.applyGradients=function(e){var t=this,n=function(n){var o=ENV.engine.registeredVariables[n];if(null==r.accumulatedMeanSquares[n]){tidy(function(){t.accumulatedMeanSquares[n]=zerosLike(o).variable(!1)})}if(null==r.accumulatedMeanGrads[n]&&r.centered){tidy(function(){t.accumulatedMeanGrads[n]=zerosLike(o).variable(!1)})}if(null==r.accumulatedMoments[n]){tidy(function(){t.accumulatedMoments[n]=zerosLike(o).variable(!1)})}var a=r.accumulatedMeanSquares[n],i=r.accumulatedMeanGrads[n],s=r.accumulatedMoments[n],u=e[n];tidy(function(){var e=t.decayScalar.mul(a).add(t.oneMinusDecay.mul(u.square()));if(t.centered){var r=t.decayScalar.mul(i).add(t.oneMinusDecay.mul(u)),l=t.momentumScalar.mul(s).add(t.c.mul(u).div(e.sub(r.square().add(t.epsilonScalar)).sqrt()));t.accumulatedMeanSquares[n].assign(e),t.accumulatedMeanGrads[n].assign(r),t.accumulatedMoments[n].assign(l);var c=o.sub(l);o.assign(c)}else{var p=t.decayScalar.mul(a).add(t.oneMinusDecay.mul(u.square()));l=t.momentumScalar.mul(s).add(t.c.mul(u).div(p.add(t.epsilonScalar).sqrt()));t.accumulatedMeanSquares[n].assign(p),t.accumulatedMoments[n].assign(l);c=o.sub(l);o.assign(c)}})},r=this;for(var o in e)n(o)},t.prototype.dispose=function(){var e=this;this.c.dispose(),this.epsilonScalar.dispose(),this.decayScalar.dispose(),this.momentumScalar.dispose(),this.oneMinusDecay.dispose(),null!=this.accumulatedMeanSquares&&Object.keys(this.accumulatedMeanSquares).forEach(function(t){return e.accumulatedMeanSquares[t].dispose()}),null!=this.accumulatedMeanGrads&&this.centered&&Object.keys(this.accumulatedMeanGrads).forEach(function(t){return e.accumulatedMeanGrads[t].dispose()}),null!=this.accumulatedMoments&&Object.keys(this.accumulatedMoments).forEach(function(t){return e.accumulatedMoments[t].dispose()})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}},t.fromConfig=function(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)},t.className=\"RMSPropOptimizer\",t}(Optimizer);SerializationMap.register(RMSPropOptimizer);var OptimizerConstructors=function(){function e(){}return e.sgd=function(e){return new SGDOptimizer(e)},e.momentum=function(e,t,n){return void 0===n&&(n=!1),new MomentumOptimizer(e,t,n)},e.rmsprop=function(e,t,n,r,o){return void 0===t&&(t=.9),void 0===n&&(n=0),void 0===r&&(r=null),void 0===o&&(o=!1),new RMSPropOptimizer(e,t,n,r,o)},e.adam=function(e,t,n,r){return void 0===e&&(e=.001),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),new AdamOptimizer(e,t,n,r)},e.adadelta=function(e,t,n){return void 0===e&&(e=.001),void 0===t&&(t=.95),void 0===n&&(n=null),new AdadeltaOptimizer(e,t,n)},e.adamax=function(e,t,n,r,o){return void 0===e&&(e=.002),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),void 0===o&&(o=0),new AdamaxOptimizer(e,t,n,r,o)},e.adagrad=function(e,t){return void 0===t&&(t=.1),new AdagradOptimizer(e,t)},e}(),train={sgd:OptimizerConstructors.sgd,momentum:OptimizerConstructors.momentum,adadelta:OptimizerConstructors.adadelta,adagrad:OptimizerConstructors.adagrad,rmsprop:OptimizerConstructors.rmsprop,adamax:OptimizerConstructors.adamax,adam:OptimizerConstructors.adam},setBackend=Environment.setBackend,getBackend=Environment.getBackend,disposeVariables=Environment.disposeVariables,memory=Environment.memory;setOpHandler(ops);export{setBackend,getBackend,disposeVariables,memory,version as version_core,nextFrame,environment,io,serialization,test_util,util,webgl,AdadeltaOptimizer,AdagradOptimizer,AdamOptimizer,AdamaxOptimizer,MomentumOptimizer,Optimizer,RMSPropOptimizer,SGDOptimizer,Tensor,TensorBuffer,variable,Variable,Rank,Reduction,ENV,Environment,image_ops as image,linalg_ops as linalg,loss_ops as losses,op,batchNormalization2d,batchNormalization3d,batchNormalization4d,batchNormalization,concat,concat1d,concat2d,concat3d,concat4d,conv1d,conv2d,depthwiseConv2d,separableConv2d,conv2dTranspose,matMul,dot,outerProduct,reverse,reverse1d,reverse2d,reverse3d,reverse4d,maxPool,avgPool,slice,slice1d,slice2d,slice3d,slice4d,abs,acos,acosh,asin,asinh,atan,atanh,ceil,clipByValue,cos,cosh,erf,exp,expm1,floor,log$1 as log,log1p,logSigmoid,neg,reciprocal,round,rsqrt,sigmoid,sign,sin,sinh,softplus,sqrt,square,step,tan,tanh$1 as tanh,all,any,argMax,argMin,logSumExp,max,mean,min,moments,sum,equal,equalStrict,greater,greaterEqual,greaterEqualStrict,greaterStrict,less,lessEqual,lessEqualStrict,lessStrict,notEqual,notEqualStrict,add,addN,addStrict,atan2,div,divStrict,floorDiv,maximum,maximumStrict,minimum,minimumStrict,mod,modStrict,mul,mulStrict,pow,powStrict,squaredDifference,squaredDifferenceStrict,sub,subStrict,elu,leakyRelu,prelu,relu,selu,logicalAnd,logicalNot,logicalOr,logicalXor,where,whereAsync,buffer,toPixels,print,cast,clone,cumsum,expandDims,eye,fromPixels,multinomial,oneHot,pad,pad1d,pad2d,pad3d,pad4d,rand,randomNormal,randomUniform,reshape,split,squeeze,stack,tile,truncatedNormal,unstack,batchToSpaceND,spaceToBatchND,fill,linspace,ones$1 as ones,range,scalar,tensor,tensor1d,tensor2d,tensor3d,tensor4d,tensor5d,tensor6d,zeros,onesLike,zerosLike,transpose,softmax,localResponseNormalization,norm,gather,unsortedSegmentSum,basicLSTMCell,multiRNNCell,movingAverage,stridedSlice,topk,train,tidy,keep,dispose,time,customGrad,grad,grads,valueAndGrad,valueAndGrads,variableGrads};\n//# sourceMappingURL=tf-core.esm.js.map\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\nimport{keep,scalar,tidy,onesLike,tensor1d,util,zerosLike,train,cast,serialization,add,mul,div,Tensor,Optimizer,mean,io,transpose,reverse,zeros,sum,dispose,neg,variable,ones,eye,randomUniform,truncatedNormal,randomNormal,sub,sqrt,mulStrict,clipByValue,relu,linalg,leakyRelu,elu,conv1d,conv2d,conv2dTranspose,separableConv2d,depthwiseConv2d,maximum,minimum,batchNormalization2d,batchNormalization3d,batchNormalization4d,moments,movingAverage,pad,maxPool,avgPool,squeeze,max,abs,log,softplus,softmax,floor,oneHot,exp,greater,equal,argMax,slice1d,slice2d,slice3d,slice4d,concat,concat1d,concat2d,concat3d,concat4d,tile,matMul,gather,step,min,selu,sigmoid,tanh}from\"@tensorflow/tfjs-core\";var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]t?1:0}function reverseNumberCompare(e,t){return-1*numberCompare(e,t)}function stringToDType(e){switch(e){case\"float32\":return\"float32\";default:throw new ValueError(\"Invalid dtype: \"+e)}}function unique(e){if(null==e)return e;for(var t=[],n=0,r=e;n=0),assert(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every(function(e){return typeof e===t})}function calcL2Norms(e,t){return tidy(function(){return sqrt(sum(mulStrict(e,e),t,!0))})}var Constraint=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getConfig=function(){return{}},t}(serialization.Serializable),MaxNorm=function(e){function t(t){var n=e.call(this)||this;return n.defaultMaxValue=2,n.defaultAxis=0,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return __extends(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){var n=calcL2Norms(e,t.axis),r=clipByValue(n,0,t.maxValue);return mul(e,div(r,add(getScalar(epsilon()),n)))})},t.prototype.getConfig=function(){return{maxValue:this.maxValue,axis:this.axis}},t.className=\"MaxNorm\",t}(Constraint);serialization.SerializationMap.register(MaxNorm);var UnitNorm=function(e){function t(t){var n=e.call(this)||this;return n.defaultAxis=0,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return __extends(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){return div(e,add(getScalar(epsilon()),calcL2Norms(e,t.axis)))})},t.prototype.getConfig=function(){return{axis:this.axis}},t.className=\"UnitNorm\",t}(Constraint);serialization.SerializationMap.register(UnitNorm);var NonNeg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.apply=function(e){return relu(e)},t.className=\"NonNeg\",t}(Constraint);serialization.SerializationMap.register(NonNeg);var MinMaxNorm=function(e){function t(t){var n=e.call(this)||this;return n.defaultMinValue=0,n.defaultMaxValue=1,n.defaultRate=1,n.defaultAxis=0,n.minValue=null!=t.minValue?t.minValue:n.defaultMinValue,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.rate=null!=t.rate?t.rate:n.defaultRate,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return __extends(t,e),t.prototype.apply=function(e){var t=this;return tidy(function(){var n=calcL2Norms(e,t.axis),r=add(mul(getScalar(t.rate),clipByValue(n,t.minValue,t.maxValue)),mul(getScalar(1-t.rate),n));return mul(e,div(r,add(getScalar(epsilon()),n)))})},t.prototype.getConfig=function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}},t.className=\"MinMaxNorm\",t}(Constraint);serialization.SerializationMap.register(MinMaxNorm);var CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP={maxNorm:\"MaxNorm\",minMaxNorm:\"MinMaxNorm\",nonNeg:\"NonNeg\",unitNorm:\"UnitNorm\"};function serializeConstraint(e){return serializeKerasObject(e)}function deserializeConstraint(e,t){return void 0===t&&(t={}),deserializeKerasObject(e,serialization.SerializationMap.getMap().classNameMap,t,\"constraint\")}function getConstraint(e){return null==e?null:\"string\"==typeof e?deserializeConstraint({className:e in CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP?CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP[e]:e,config:{}}):e instanceof Constraint?e:deserializeConstraint(e)}function maxNorm(e){return new MaxNorm(e)}function unitNorm(e){return new UnitNorm(e)}function nonNeg(){return new NonNeg}function minMaxNorm(e){return new MinMaxNorm(e)}var exports_constraints=Object.freeze({maxNorm:maxNorm,unitNorm:unitNorm,nonNeg:nonNeg,minMaxNorm:minMaxNorm}),nameMap=new Map,VALID_DATA_FORMAT_VALUES=[\"channelsFirst\",\"channelsLast\"];function checkDataFormat(e){checkStringTypeUnionValue(VALID_DATA_FORMAT_VALUES,\"DataFormat\",e)}var VALID_PADDING_MODE_VALUES=[\"valid\",\"same\",\"causal\"];function checkPaddingMode(e){checkStringTypeUnionValue(VALID_PADDING_MODE_VALUES,\"PaddingMode\",e)}var VALID_POOL_MODE_VALUES=[\"max\",\"avg\"];function checkPoolMode(e){checkStringTypeUnionValue(VALID_POOL_MODE_VALUES,\"PoolMode\",e)}var _nameScopeStack=[],_nameScopeDivider=\"/\";function nameScope(e,t){_nameScopeStack.push(e);try{var n=t();return _nameScopeStack.pop(),n}catch(e){throw _nameScopeStack.pop(),e}}function currentNameScopePrefix(){return 0===_nameScopeStack.length?\"\":_nameScopeStack.join(_nameScopeDivider)+_nameScopeDivider}function getScopedTensorName(e){if(!isValidTensorName(e))throw new Error(\"Not a valid tensor name: '\"+e+\"'\");return currentNameScopePrefix()+e}function getUniqueTensorName(e){if(!isValidTensorName(e))throw new Error(\"Not a valid tensor name: '\"+e+\"'\");nameMap.has(e)||nameMap.set(e,0);var t=nameMap.get(e);if(nameMap.set(e,nameMap.get(e)+1),t>0){var n=e+\"_\"+t;return nameMap.set(n,1),n}return e}var tensorNameRegex=new RegExp(/^[A-Za-z][A-Za-z0-9\\._\\/]*$/);function isValidTensorName(e){return!!e.match(tensorNameRegex)}function isInteger(e){return e===parseInt(e.toString(),10)}function arrayProd(e,t,n){null==t&&(t=0),null==n&&(n=e.length);for(var r=1,i=t;i2e3&&console.warn(\"Orthogonal initializer is being called on a matrix with more than 2000 (\"+e[0]*e[1]+\") elements: Slowness may result.\");var t=randomNormal$1(e[0]>e[1]?[e[1],e[0]]:e,0,1,\"float32\"),r=linalg.gramSchmidt(t);return e[0]>e[1]&&(r=r.transpose()),mul(getScalar(n.gain),r)})},t.prototype.getConfig=function(){return{gain:this.gain,seed:this.seed}},t.className=\"Orthogonal\",t}(Initializer);serialization.SerializationMap.register(Orthogonal);var INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP={constant:\"Constant\",glorotNormal:\"GlorotNormal\",glorotUniform:\"GlorotUniform\",heNormal:\"HeNormal\",identity:\"Identity\",leCunNormal:\"LeCunNormal\",ones:\"Ones\",orthogonal:\"Orthogonal\",randomNormal:\"RandomNormal\",randomUniform:\"RandomUniform\",truncatedNormal:\"TruncatedNormal\",varianceScaling:\"VarianceScaling\",zeros:\"Zeros\"};function deserializeInitializer(e,t){return void 0===t&&(t={}),deserializeKerasObject(e,serialization.SerializationMap.getMap().classNameMap,t,\"initializer\")}function serializeInitializer(e){return serializeKerasObject(e)}function getInitializer(e){if(\"string\"==typeof e){var t=e in INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP?INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[e]:e;return\"GlorotUniform\"===t?new GlorotUniform:\"GlorotNormal\"===t?new GlorotNormal:\"HeNormal\"===t?new HeNormal:\"LeCunNormal\"===t?new LeCunNormal:deserializeInitializer({className:t,config:{}})}return e instanceof Initializer?e:deserializeInitializer(e)}function zeros$1(){return new Zeros}function ones$1(){return new Ones}function constant(e){return new Constant(e)}function randomUniform$1(e){return new RandomUniform(e)}function randomNormal$2(e){return new RandomNormal(e)}function truncatedNormal$1(e){return new TruncatedNormal(e)}function identity(e){return new Identity(e)}function varianceScaling(e){return new VarianceScaling(e)}function glorotUniform(e){return new GlorotUniform(e)}function glorotNormal(e){return new GlorotNormal(e)}function heNormal(e){return new HeNormal(e)}function leCunNormal(e){return new LeCunNormal(e)}function orthogonal(e){return new Orthogonal(e)}var exports_initializers=Object.freeze({zeros:zeros$1,ones:ones$1,constant:constant,randomUniform:randomUniform$1,randomNormal:randomNormal$2,truncatedNormal:truncatedNormal$1,identity:identity,varianceScaling:varianceScaling,glorotUniform:glorotUniform,glorotNormal:glorotNormal,heNormal:heNormal,leCunNormal:leCunNormal,orthogonal:orthogonal});function isArrayOfShapes(e){return Array.isArray(e)&&Array.isArray(e[0])}function normalizeShapeList(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function getExactlyOneTensor(e){var t;if(Array.isArray(e)){if(1!==e.length)throw new ValueError(\"Expected Tensor length to be 1; got \"+e.length);t=e[0]}else t=e;return t}function getExactlyOneShape(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return(e=e)[0];throw new ValueError(\"Expected exactly 1 Shape; got \"+e.length)}return e}function countParamsInWeights(e){for(var t=0,n=0,r=e;n1)throw new AttributeError(\"Layer \"+this.name+' has multiple inbound nodes, hence the notion of \"layer input\" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new AttributeError(\"Layer \"+this.name+\" is not connected, no input to return.\");return singletonOrArray(this.getNodeAtIndex(0,\"input\").inputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"output\",{get:function(){if(0===this.inboundNodes.length)throw new AttributeError(\"Layer \"+this.name+\" has no inbound nodes.\");if(this.inboundNodes.length>1)throw new AttributeError(\"Layer \"+this.name+' has multiple inbound nodes, hence the notion of \"layer output\" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return singletonOrArray(this.getNodeAtIndex(0,\"output\").outputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"losses\",{get:function(){return this._losses},enumerable:!0,configurable:!0}),t.prototype.calculateLosses=function(){return this.losses.map(function(e){return e()})},Object.defineProperty(t.prototype,\"updates\",{get:function(){return this._updates},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"built\",{get:function(){return this._built},set:function(e){this._built=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"trainableWeights\",{get:function(){return this.trainable?this._trainableWeights:[]},set:function(e){this._trainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"nonTrainableWeights\",{get:function(){return this.trainable?this._nonTrainableWeights:this._trainableWeights.concat(this._nonTrainableWeights)},set:function(e){this._nonTrainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"weights\",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"stateful\",{get:function(){return this._stateful},enumerable:!0,configurable:!0}),t.prototype.assertInputCompatibility=function(e){if(e=toList(e),null!=this.inputSpec&&0!==this.inputSpec.length){var t=toList(this.inputSpec);if(e.length!==t.length)throw new ValueError(\"Layer \"+this.name+\" expects \"+t.length+\" inputs, but it received \"+e.length+\" input tensors. Input received: \"+e);for(var n=0;ni.maxNDim)throw new ValueError(\"Input \"+n+\" is incompatible with layer \"+this.name+\": expected max_ndim=\"+i.maxNDim+\", found ndim=\"+a);if(null!=i.minNDim&&a=0?o[l]:o[o.length+l];if(null!=u&&-1===[u,null].indexOf(c))throw new ValueError(\"Input \"+n+\" is incompatible with layer \"+this.name+\": expected axis \"+l+\" of input shape to have value \"+u+\" but got shape \"+o+\".\")}}if(null!=i.shape)for(var p=0;p0&&Array.isArray(g[0])?g.map(function(r,i){return new SymbolicTensor(m,r,n,toList(e),t,n.name,i)}):new SymbolicTensor(m,g,n,toList(e),t,n.name),n.addInboundNode(e,f,null,null,d,g,t),null!=n.activityRegularizer)throw new NotImplementedError(\"Layer invocation in the presence of activity regularizer(s) is not supported yet.\");return f})},t.prototype.warnOnIncompatibleInputShape=function(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn(\"The rank of the input tensor provided (shape: \"+JSON.stringify(e)+\") does not match that of the batchInputShape (\"+JSON.stringify(this.batchInputShape)+\") of the layer \"+this.name);else{var t=!1;this.batchInputShape.forEach(function(n,r){null!=n&&null!=e[r]&&e[r]!==n&&(t=!0)}),t&&console.warn(\"The shape of the input tensor (\"+JSON.stringify(e)+\") does not match the expectation of layer \"+this.name+\": \"+JSON.stringify(this.batchInputShape))}},Object.defineProperty(t.prototype,\"outputShape\",{get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new AttributeError(\"The layer \"+this.name+\" has never been called and thus has no defined output shape.\");for(var e=[],t=0,n=this.inboundNodes;t0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];var r=t.inboundNodes[n];if(0===r.inboundLayers.length)return r.inputTensors;for(var i=[],a=0;a1||1===s.length&&s[0].inboundLayers.length>1){t=!1;break}r.push.apply(r,s)}if(t)for(var l=0,u=e.layers;l0&&(r=r.slice(0,r.length-1)+\" \"),r=(r+=e[i]).slice(0,t[i]),r+=\" \".repeat(t[i]-r.length);n(r)}function printLayerSummary(e,t,n){var r;try{r=JSON.stringify(e.outputShape)}catch(e){r=\"multiple\"}printRow([e.name+\" (\"+e.getClassName()+\")\",r,e.countParams().toString()],t,n)}function printLayerSummaryWithConnections(e,t,n,r){var i;try{i=JSON.stringify(e.outputShape)}catch(e){i=\"multiple\"}for(var a=[],o=0,s=e.inboundNodes;o0&&-1===n.indexOf(l)))for(var u=0;u0)throw new ValueError(p.length+\" of \"+r+\" weights are not set: \"+p);batchSetValue(u)}var Container=function(e){function t(n){var r=e.call(this,{})||this;if(r.containerNodes=new Set,r.name=n.name,null==r.name){var i=r.getClassName().toLowerCase();r.name=getUid(i)}if(r.supportsMasking=!1,r.trainable=!0,r.updatable=!0,Array.isArray(n.inputs)?r.inputs=n.inputs.slice():r.inputs=[n.inputs],Array.isArray(n.outputs)?r.outputs=n.outputs.slice():r.outputs=[n.outputs],unique(r.inputs).length!==r.inputs.length)throw new ValueError(\"The list of inputs passed to the model is redundant. All inputs should only appear once. Found: \"+r.inputs.map(function(e){return e.name}));unique(r.outputs).length!==r.outputs.length&&console.warn(\"The list of outputs passed to the model is redundant. All outputs should only appear once. Found: \"+r.outputs.map(function(e){return e.name})),r.inputLayers=[],r.inputLayersNodeIndices=[],r.inputLayersTensorIndices=[],r.outputLayers=[],r.outputLayersNodeIndices=[],r.outputLayersTensorIndices=[],r.layers=[];for(var a=0,o=r.outputs;a1 nodes\"),assert(0===u,\"input layer has >1 tensors\"),r.inputLayers.push(s),r.inputLayersNodeIndices.push(l),r.inputLayersTensorIndices.push(u)}r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var h=0;h=0;)i.splice(i.indexOf(l),1);z.push(l)}},S=[],A=[],I=0,N=r.outputs;Ir?1:0});for(var j=0,W=U;j0)throw new ValueError(\"Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.\");if(!this.trainable)return[];for(var e=[],t=0,n=this.layers;t1)for(var s=0,l=o;s0){for(var d=[],g=0;g0&&e.apply(singletonOrArray(a),r)}function o(e){var r=e.name,a=deserialize(e,null!=t.customObjects?t.customObjects:{});n[r]=a;for(var o=0,s=e.inboundNodes;o0)a=!0;else if(isDataDict(e)){for(var o in e)if(e.hasOwnProperty(o)){a=!0;break}}else a=!0;if(a)throw new ValueError(\"Error when checking model \"+i+\" expected no data, but got \"+e)}return[]}if(null==e)return t.map(function(e){return null});var s;if(isDataDict(e)){e=e,s=[];for(var l=0,u=t;l1)throw new ValueError(\"The model \"+i+\" expects \"+t.length+\" Tensor(s), but only received one Tensor. Found: Tensor with shape \"+e.shape);s=[e]}for(var p=0;p=0&&g!==f)throw new ValueError(\"Error when checking \"+i+\": expected \"+t[p]+\" to have shape [\"+n[p]+\"], but got array with shape [\"+h.shape+\"].\")}}return s}function checkArrayLengths(e,t,n){var r=unique(e.map(function(e){return e.shape[0]}));r.sort();var i=unique(t.map(function(e){return e.shape[0]}));if(i.sort(),r.length>1)throw new ValueError(\"All input Tensors (x) should have the same number of samples. Got array shapes: \"+JSON.stringify(e.map(function(e){return e.shape})));if(i.length>1)throw new ValueError(\"All target Tensors (y) should have the same number of samples. Got array shapes: \"+JSON.stringify(t.map(function(e){return e.shape})));if(r.length>0&&i.length>0&&!util.arraysEqual(r,i))throw new ValueError(\"Input Tensors should have the same number of samples as target Tensors. Found \"+r[0]+\" input sample(s) and \"+i[0]+\" target sample(s).\")}function checkLossAndTargetCompatibility(e,t,n){for(var r=[meanSquaredError,binaryCrossentropy,categoricalCrossentropy],i=0;i=e&&(i=e),n.push([r,i]),r=i;return n}function sliceArrays(e,t,n){return null==e?[null]:Array.isArray(e)?e.map(function(e){return sliceAlongFirstAxis(e,t,n-t)}):sliceAlongFirstAxis(e,t,n-t)}function sliceArraysByIndices(e,t){return tidy(function(){return null==e?null:Array.isArray(e)?e.map(function(e){return sliceArraysByIndices(e,t)}):gather$1(e,\"int32\"===t.dtype?t:t.toInt())})}function checkInputData(e,t,n,r,i){var a;if(void 0===r&&(r=!0),void 0===i&&(i=\"\"),Array.isArray(e)){if(e.length!==t.length)throw new ValueError(\"Error when checking model \"+i+\": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see \"+t.length+\" Tensor(s), but instead got \"+e.length+\" Tensors(s).\");a=e}else{if(t.length>1)throw new ValueError(\"The model expects \"+t.length+\" \"+i+\" Tensors, but only received one Tensor. Found: array with shape \"+JSON.stringify(e.shape)+\".\");a=[e]}if(null!=n)for(var o=0;o1&&(t.metricsTensors.push([n,e]),t.metricsNames.push(t.outputNames[e]+\"_loss\"))}});var p=collectMetrics(e.metrics,this.outputNames);nameScope(\"metric\",function(){for(var e=function(e){if(-1!==c.indexOf(e))return\"continue\";!function(n){for(var r,i,a,o=function(n){if(-1!==[\"accuracy\",\"acc\",\"crossentropy\",\"ce\"].indexOf(n)){var o=t.internalOutputShapes[e];1===o[o.length-1]||t.lossFunctions[e]===binaryCrossentropy?-1!==[\"accuracy\",\"acc\"].indexOf(n)?i=binaryAccuracy:-1!==[\"crossentropy\",\"ce\"].indexOf(n)&&(i=binaryCrossentropy$1):t.lossFunctions[e]===sparseCategoricalCrossentropy?-1!==[\"accuracy\",\"acc\"].indexOf(n)?i=sparseCategoricalAccuracy:-1!==[\"crossentropy\",\"ce\"].indexOf(n)&&(i=sparseCategoricalCrossentropy$1):-1!==[\"accuracy\",\"acc\"].indexOf(n)?i=categoricalAccuracy:-1!==[\"crossentropy\",\"ce\"].indexOf(n)&&(i=categoricalCrossentropy$1);var s=void 0;-1!==[\"accuracy\",\"acc\"].indexOf(n)?s=\"acc\":-1!==[\"crossentropy\",\"ce\"].indexOf(n)&&(s=\"ce\"),a=i,r=\"\"+s}else{var l=get$1(n);a=l,r=\"\"+n}var u;nameScope(r,function(){u=a}),function(e,n,r){t.outputNames.length>1&&(n=t.outputNames[e]+\"_\"+n),t.metricsNames.push(n),t.metricsTensors.push([r,e])}(e,r,u)},s=0,l=n;s0){var c=[];throw t.forEach(function(t,n){null==t&&c.push(e[n])}),new ValueError(\"Cannot find SymbolicTensors for output name(s): \"+JSON.stringify(c))}return t},t.prototype.predictLoop=function(e,t,n){var r=this;return void 0===t&&(t=32),void 0===n&&(n=!1),tidy(function(){var i=r.checkNumSamples(e);if(n)throw new NotImplementedError(\"Verbose predictLoop() is not implemented yet.\");for(var a=makeBatches(i,t),o=[],s=function(t){var n=tidy(function(){var n=a[t][0],i=a[t][1],o=sliceArrays(e,n,i),s=[];if(Array.isArray(o))for(var l=0;l0&&e[0].shape[0]%r!=0)throw new ValueError(\"In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size \"+r+\". Found: \"+e[0].shape[0]+\" sample(s).\");return[e,t,null]},t.prototype.fitLoop=function(e,t,n,r,i,a,o,s,l,u,c,p,h,d){return __awaiter(this,void 0,void 0,function(){var g,f,m,y,v,b,z,w=this;return __generator(this,function(S){switch(S.label){case 0:if(null==r&&(r=32),null==i&&(i=1),null==u&&(u=!0),null==p&&(p=0),g=!1,null!=s&&null!=l&&(g=!0),null!=d&&(g=!0,null==h))throw new ValueError(\"Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.\");if(null!=(f=this.checkNumSamples(t,r,h,\"steps_per_epoch\"))&&(m=range(0,f)),this.history=new History,o=(o=null==o?[new BaseLogger]:[new BaseLogger].concat(o)).concat([this.history]),a>0)throw new NotImplementedError(\"Verbose mode is not implemented yet.\");return(y=new CallbackList(o)).setModel(this),y.setParams({epochs:i,initialEpoch:p,steps:h,verbose:a,doValidation:g,metrics:c}),[4,y.onTrainBegin()];case 1:S.sent(),this.stopTraining=!1,v=function(i){var a,o,c,p,d;return __generator(this,function(v){switch(v.label){case 0:return[4,y.onEpochBegin(i)];case 1:if(v.sent(),a={},null==h)return[3,2];throw new NotImplementedError(\"stepsPerEpoch mode is not implemented yet.\");case 2:if(\"batch\"===u)throw new NotImplementedError(\"batch shuffling is not implemneted yet\");u&&util.shuffle(m),o=tensor1d(m),c=makeBatches(f,r),p=function(i){var u;return __generator(this,function(p){switch(p.label){case 0:return u={},[4,y.onBatchBegin(i,u)];case 1:return p.sent(),tidy(function(){var p=c[i][0],h=c[i][1],d=sliceAlongFirstAxis(o,p,h-p);u.batch=i,u.size=h-p;for(var f=sliceArraysByIndices(t,d),m=e(f),y=0;y1)i+=\"_\"+count(e.slice(0,n),r);t.push(i)}return t},t.prototype.makeTestFunction=function(){var e=this;this.testFunction=function(t){return tidy(function(){for(var n,r=[],i=t.slice(0,e.inputs.length),a=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),o=[],s=0;s0){if(s=!0,2!==n.validationData.length)throw 3===n.validationData.length?new NotImplementedError(\"validationData including sample weights is not supported yet.\"):new ValueError(\"When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; \"+n.validationData+\" is invalid.\");l=n.validationData[0],u=n.validationData[1],h=this.standardizeUserData(l,u,!0,r),l=h[0],u=h[1],c=l.concat(u)}else null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1?(s=!0,d=Math.floor(a[0].shape[0]*(1-n.validationSplit)),g=a[0].shape[0],l=sliceArrays(a,d,g),a=sliceArrays(a,0,d),u=sliceArrays(o,d,g),o=sliceArrays(o,0,d),p=!0,c=l.concat(u)):null!=n.validationSteps&&(s=!0);return f=a.concat(o),this.checkTrainableWeightsConsistency(),m=function(e){var t=e.slice(0,S.inputs.length),n=e.slice(S.inputs.length,S.inputs.length+S.outputs.length),r=[],i=S.collectedTrainableWeights.map(function(e){return e.read()});return[S.optimizer.minimize(function(){for(var e=[],i=0;i1)throw new ValueError(\"Found more than one (\"+n.length+\") save handlers for URL '\"+e+\"'\");e=n[0]}if(null==e.save)throw new ValueError(\"Model.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.\");return[4,io.encodeWeights(this.getNamedWeights(t))];case 1:return r=s.sent(),i=!1,a=null,o=this.toJSON(a,i),[2,e.save({modelTopology:o,weightData:r.data,weightSpecs:r.specs})]}})})},t.className=\"Model\",t}(Container);function loadModelInternal(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){if(\"string\"==typeof e){if(0===(t=io.getLoadHandlers(e)).length)t.push(io.browserHTTPRequest(e));else if(t.length>1)throw new ValueError(\"Found more than one (\"+t.length+\") load handlers for URL '\"+e+\"'\");e=t[0]}return[2,loadModelFromIOHandler(e)]})})}function loadModelFromIOHandler(e,t){return __awaiter(this,void 0,void 0,function(){var n,r,i,a,o;return __generator(this,function(s){switch(s.label){case 0:if(null==e.load)throw new ValueError(\"Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.\");return[4,e.load()];case 1:if(n=s.sent(),null!=(r=n.modelTopology).model_config&&(r=r.model_config),i=deserialize(convertPythonicToTs(r),t),null!=n.weightData){if(null==n.weightSpecs)throw new ValueError(\"Model artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.\");a=!1,o=!0,i.loadWeights(io.decodeWeights(n.weightData,n.weightSpecs),a,o)}return[2,i]}})})}serialization.SerializationMap.register(Model);var Sequential=function(e){function t(t){var n=e.call(this,{inputs:[],outputs:[]})||this;if(t=t||{},n.trainable=!0,n._updatable=!0,n.built=!1,n.name=null!=t.name?t.name:getUid(\"sequential_\"),null!=t.layers)for(var r=0,i=t.layers;r 0 but got \"+JSON.stringify(e.filters))},t}(BaseConv),Conv2D=function(e){function t(n){var r=e.call(this,2,n)||this;return t.verifyConfig(n),r}return __extends(t,e),t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.rank,t},t.verifyConfig=function(e){if(\"number\"!=typeof e.kernelSize&&!checkArrayTypeAndLength(e.kernelSize,\"number\",1,2))throw new ValueError(\"Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received \"+JSON.stringify(e.kernelSize)+\".\")},t.className=\"Conv2D\",t}(Conv);serialization.SerializationMap.register(Conv2D);var Conv2DTranspose=function(e){function t(t){var n=e.call(this,t)||this;if(n.inputSpec=[new InputSpec({ndim:4})],\"same\"!==n.padding&&\"valid\"!==n.padding)throw new ValueError(\"Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode \"+n.padding);return n}return __extends(t,e),t.prototype.build=function(e){if(4!==(e=getExactlyOneShape(e)).length)throw new ValueError(\"Input should have rank 4; Received input shape: \"+JSON.stringify(e));var t=\"channelsFirst\"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ValueError(\"The channel dimension of the inputs should be defined. Found `None`.\");var n,r=e[t],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight(\"kernel\",i,\"float32\",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight(\"bias\",[this.filters],\"float32\",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new InputSpec({ndim:4,axes:(n={},n[t]=r,n)})],this.built=!0},t.prototype.call=function(e,t){var n=this;return tidy(function(){var t=getExactlyOneTensor(e);if(4!==t.shape.length)throw new ValueError(\"Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-\"+t.shape.length);var r,i,a=t.shape,o=a[0];\"channelsFirst\"===n.dataFormat?(r=2,i=3):(r=1,i=2);var s=a[r],l=a[i],u=n.kernelSize[0],c=n.kernelSize[1],p=n.strides[0],h=n.strides[1],d=[o,deconvLength(s,p,u,n.padding),deconvLength(l,h,c,n.padding),n.filters];\"channelsLast\"!==n.dataFormat&&(t=transpose(t,[0,2,3,1]));var g=conv2dTranspose(t,n.kernel.read(),d,n.strides,n.padding);return\"channelsLast\"!==n.dataFormat&&(g=transpose(g,[0,3,1,2])),null!=n.bias&&(g=biasAdd(g,n.bias.read(),n.dataFormat)),null!=n.activation&&(g=n.activation.apply(g)),g})},t.prototype.computeOutputShape=function(e){var t,n,r,i=(e=getExactlyOneShape(e)).slice();\"channelsFirst\"===this.dataFormat?(t=1,n=2,r=3):(t=3,n=1,r=2);var a=this.kernelSize[0],o=this.kernelSize[1],s=this.strides[0],l=this.strides[1];return i[t]=this.filters,i[n]=deconvLength(i[n],s,a,this.padding),i[r]=deconvLength(i[r],l,o,this.padding),i},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.dilationRate,t},t.className=\"Conv2DTranspose\",t}(Conv2D);serialization.SerializationMap.register(Conv2DTranspose);var SeparableConv=function(e){function t(t,n){var r=e.call(this,t,n)||this;if(r.DEFAULT_DEPTHWISE_INITIALIZER=\"glorotUniform\",r.DEFAULT_POINTWISE_INITIALIZER=\"glorotUniform\",r.depthwiseKernel=null,r.pointwiseKernel=null,null==n.filters)throw new ValueError(\"The `filters` configuration field is required by SeparableConv, but is unspecified.\");if(null!=n.kernelInitializer||null!=n.kernelRegularizer||null!=n.kernelConstraint)throw new ValueError(\"Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.\");if(null!=n.padding&&\"same\"!==n.padding&&\"valid\"!==n.padding)throw new ValueError(\"SeparableConv\"+r.rank+\"D supports only padding modes: 'same' and 'valid', but received \"+JSON.stringify(n.padding));return r.depthMultiplier=null==n.depthMultiplier?1:n.depthMultiplier,r.depthwiseInitializer=getInitializer(n.depthwiseInitializer||r.DEFAULT_DEPTHWISE_INITIALIZER),r.depthwiseRegularizer=getRegularizer(n.depthwiseRegularizer),r.depthwiseConstraint=getConstraint(n.depthwiseConstraint),r.pointwiseInitializer=getInitializer(n.depthwiseInitializer||r.DEFAULT_POINTWISE_INITIALIZER),r.pointwiseRegularizer=getRegularizer(n.pointwiseRegularizer),r.pointwiseConstraint=getConstraint(n.pointwiseConstraint),r}return __extends(t,e),t.prototype.build=function(e){if((e=getExactlyOneShape(e)).length1)throw new ValueError(\"Can not merge tensors with different batch sizes. Got tensors with shapes: \"+JSON.stringify(e)+\".\");for(var i=null==e[0]?null:e[0].slice(1),a=1;a1){var y=range(1,s).concat([0]);t.push(transpose(h,y)),u=!0}else t.push(h)}var v=n.mergeFunction(t),b=v.rank;if(u)if(null==b){var z=v.shape;f=[g=z[z.length-1]].concat(z.slice(0,z.length-1));v=transpose(v.reshape([-1,g]),[1,0]).reshape(f)}else if(b>1){y=[b-1].concat(range(0,b-1));v=transpose(v,y)}return v}return n.mergeFunction(e)})},t.prototype.computeOutputShape=function(e){var t;t=null==(e=e)[0]?null:e[0].slice(1);for(var n=1;n1)throw new ValueError(\"A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: \"+JSON.stringify(e))}},t.prototype.mergeFunction=function(e){var t=this;return tidy(function(){return concatenate(e,t.axis)})},t.prototype.computeOutputShape=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new ValueError(\"A `Concatenate` layer should be called on a list of inputs.\");for(var t=e,n=t[0].slice(),r=this.axis<0?n.length+this.axis:this.axis,i=0,a=t.slice(1);i=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new ValueError(\"Axis \"+t+\" of input tensor should have a defined dimension but the layer received an input with shape \"+JSON.stringify(e)+\".\");this.inputSpec=[new InputSpec({ndim:e.length,axes:(r={},r[t]=n,r)})];var r,i=[n];this.scale&&(this.gamma=this.addWeight(\"gamma\",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight(\"beta\",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight(\"moving_mean\",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight(\"moving_variance\",i,null,this.movingVarianceInitializer,null,!1),this.built=!0},t.prototype.call=function(e,t){var n=this;return tidy(function(){var r=null!=t.training&&t.training,i=getExactlyOneTensor(e),a=i.shape,o=a.length,s=range(0,o),l=n.axis>=0?n.axis:n.axis+o;s.splice(l,1);var u=pyListRepeat(1,o);u[l]=a[l];var c=s.slice();c.sort();var p=!util.arraysEqual(c,range(0,o).slice(0,o-1));if(!r)return function(){if(p){var e=n.movingMean.read().reshape(u),t=n.movingVariance.read().reshape(u),r=n.center?n.beta.read().reshape(u):null,a=n.scale?n.gamma.read().reshape(u):null;return batchNormalization(i,e,t,r,a,n.epsilon)}return batchNormalization(i,n.movingMean.read(),n.movingVariance.read(),null==n.beta?null:n.beta.read(),null==n.gamma?null:n.gamma.read(),n.epsilon)}();var h=normalizeBatchInTraining(i,n.gamma.read(),n.beta.read(),s,n.epsilon),d=h[0],g=h[1],f=h[2],m=arrayProd(s.map(function(e){return i.shape[e]})),y=f.mul(getScalar(m/(m-(1+n.epsilon))));return function(){n.stepCount++;var e=movingAverage(n.movingMean.read(),g,n.momentum,n.stepCount);n.movingMean.write(e);var t=movingAverage(n.movingVariance.read(),y,n.momentum,n.stepCount);n.movingVariance.write(t)}(),d})},t.prototype.getConfig=function(){var t={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:serializeInitializer(this.betaInitializer),gammaInitializer:serializeInitializer(this.gammaInitializer),movingMeanInitializer:serializeInitializer(this.movingMeanInitializer),movingVarianceInitializer:serializeInitializer(this.movingVarianceInitializer),betaRegularizer:serializeRegularizer(this.betaRegularizer),gammaRegularizer:serializeRegularizer(this.gammaRegularizer),betaConstraint:serializeConstraint(this.betaConstraint),gammaConstraint:serializeConstraint(this.gammaConstraint)},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className=\"BatchNormalization\",t}(Layer);function spatial2dPadding(e,t,n){return tidy(function(){if(4!==e.rank)throw new ValueError(\"temporalPadding expects input tensor to be 4-D, but received a \"+e.rank+\"-D tensor.\");if(null==t&&(t=[[1,1],[1,1]]),2!==t.length||2!==t[0].length||2!==t[1].length)throw new ValueError(\"spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.\");if(null==n&&(n=imageDataFormat()),\"channelsLast\"!==n&&\"channelsFirst\"!==n)throw new ValueError(\"Unknown data format: \"+n+\". Supported data formats are 'channelsLast' and 'channelsFirst.\");var r;return r=\"channelsFirst\"===n?[[0,0],[0,0],t[0],t[1]]:[[0,0],t[0],t[1],[0,0]],pad(e,r)})}serialization.SerializationMap.register(BatchNormalization);var ZeroPadding2D=function(e){function t(t){var n=this;if(null==t&&(t={}),(n=e.call(this,t)||this).dataFormat=null==t.dataFormat?imageDataFormat():t.dataFormat,null==t.padding)n.padding=[[1,1],[1,1]];else if(\"number\"==typeof t.padding)n.padding=[[t.padding,t.padding],[t.padding,t.padding]];else{if(t.padding=t.padding,2!==t.padding.length)throw new ValueError(\"ZeroPadding2D expects padding to be a length-2 array, but received a length-\"+t.padding.length+\" array.\");var r=void 0,i=void 0;if(\"number\"==typeof t.padding[0])r=[t.padding[0],t.padding[0]],i=[t.padding[1],t.padding[1]];else{if(t.padding=t.padding,2!==t.padding[0].length)throw new ValueError(\"ZeroPadding2D expects height padding to be a length-2 array, but received a length-\"+t.padding[0].length+\" array.\");if(r=t.padding[0],2!==t.padding[1].length)throw new ValueError(\"ZeroPadding2D expects width padding to be a length-2 array, but received a length-\"+t.padding[1].length+\" array.\");i=t.padding[1]}n.padding=[r,i]}return n.inputSpec=[new InputSpec({ndim:4})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){var t,n;return e=getExactlyOneShape(e),\"channelsFirst\"===this.dataFormat?(t=null!=e[2]&&e[2]>=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])},t.prototype.call=function(e,t){var n=this;return tidy(function(){return spatial2dPadding(getExactlyOneTensor(e),n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={padding:this.padding,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className=\"ZeroPadding2D\",t}(Layer);function pool2d(e,t,n,r,i,a){return tidy(function(){var o;checkDataFormat(i),checkPoolMode(a),checkPaddingMode(r),null==n&&(n=[1,1]),null==r&&(r=\"valid\"),null==i&&(i=imageDataFormat()),null==a&&(a=\"max\"),e=preprocessConv2DInput(e,i);var s=\"same\"===r?\"same\":\"valid\";return o=\"max\"===a?maxPool(e,t,n,s):avgPool(e,t,n,s),\"channelsFirst\"===i&&(o=transpose(o,[0,3,1,2])),o})}serialization.SerializationMap.register(ZeroPadding2D);var Pooling1D=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=2),n=e.call(this,t)||this,\"number\"==typeof t.poolSize)n.poolSize=[t.poolSize];else{if(!Array.isArray(t.poolSize)||1!==t.poolSize.length||\"number\"!=typeof t.poolSize[0])throw new ValueError(\"poolSize for 1D convolutional layer must be a number or an Array of a single number, but received \"+JSON.stringify(t.poolSize));n.poolSize=t.poolSize}if(null==t.strides)n.strides=n.poolSize;else if(\"number\"==typeof t.strides)n.strides=[t.strides];else{if(!Array.isArray(t.strides)||1!==t.strides.length||\"number\"!=typeof t.strides[0])throw new ValueError(\"strides for 1D convolutional layer must be a number or an Array of a single number, but received \"+JSON.stringify(t.strides));n.strides=t.strides}return n.padding=null==t.padding?\"valid\":t.padding,checkPaddingMode(n.padding),n.inputSpec=[new InputSpec({ndim:3})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){var t=convOutputLength((e=getExactlyOneShape(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]},t.prototype.call=function(e,t){var n=this;return tidy(function(){n.invokeCallHook(e,t),e=expandDims(getExactlyOneTensor(e),2);var r=n.poolingFunction(getExactlyOneTensor(e),[n.poolSize[0],1],[n.strides[0],1],n.padding,\"channelsLast\");return squeeze(r,[2])})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(Layer),MaxPooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,\"max\")},t.className=\"MaxPooling1D\",t}(Pooling1D);serialization.SerializationMap.register(MaxPooling1D);var AveragePooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,\"avg\")},t.className=\"AveragePooling1D\",t}(Pooling1D);serialization.SerializationMap.register(AveragePooling1D);var Pooling2D=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=[2,2]),(n=e.call(this,t)||this).poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize],null==t.strides)n.strides=n.poolSize;else if(Array.isArray(t.strides)){if(2!==t.strides.length)throw new ValueError(\"If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length \"+t.strides.length+\".\");n.strides=t.strides}else n.strides=[t.strides,t.strides];return n.padding=null==t.padding?\"valid\":t.padding,n.dataFormat=null==t.dataFormat?\"channelsLast\":t.dataFormat,checkDataFormat(n.dataFormat),checkPaddingMode(n.padding),n.inputSpec=[new InputSpec({ndim:4})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){e=getExactlyOneShape(e);var t=\"channelsFirst\"===this.dataFormat?e[2]:e[1],n=\"channelsFirst\"===this.dataFormat?e[3]:e[2];return t=convOutputLength(t,this.poolSize[0],this.padding,this.strides[0]),n=convOutputLength(n,this.poolSize[1],this.padding,this.strides[1]),\"channelsFirst\"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]},t.prototype.call=function(e,t){var n=this;return tidy(function(){return n.invokeCallHook(e,t),n.poolingFunction(getExactlyOneTensor(e),n.poolSize,n.strides,n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(Layer),MaxPooling2D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,\"max\")},t.className=\"MaxPooling2D\",t}(Pooling2D);serialization.SerializationMap.register(MaxPooling2D);var AveragePooling2D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return checkDataFormat(i),checkPaddingMode(r),pool2d(e,t,n,r,i,\"avg\")},t.className=\"AveragePooling2D\",t}(Pooling2D);serialization.SerializationMap.register(AveragePooling2D);var GlobalPooling1D=function(e){function t(t){var n=e.call(this,t)||this;return n.inputSpec=[new InputSpec({ndim:3})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){return[e[0],e[2]]},t.prototype.call=function(e,t){throw new NotImplementedError},t}(Layer),GlobalAveragePooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.call=function(e,t){return tidy(function(){var t=getExactlyOneTensor(e);return mean(t,1)})},t.className=\"GlobalAveragePooling1D\",t}(GlobalPooling1D);serialization.SerializationMap.register(GlobalAveragePooling1D);var GlobalMaxPooling1D=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.call=function(e,t){return tidy(function(){var t=getExactlyOneTensor(e);return max(t,1)})},t.className=\"GlobalMaxPooling1D\",t}(GlobalPooling1D);serialization.SerializationMap.register(GlobalMaxPooling1D);var GlobalPooling2D=function(e){function t(t){var n=e.call(this,t)||this;return n.dataFormat=null==t.dataFormat?\"channelsLast\":t.dataFormat,checkDataFormat(n.dataFormat),n.inputSpec=[new InputSpec({ndim:4})],n}return __extends(t,e),t.prototype.computeOutputShape=function(e){return e=e,\"channelsLast\"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]},t.prototype.call=function(e,t){throw new NotImplementedError},t.prototype.getConfig=function(){var t={dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(Layer),GlobalAveragePooling2D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.call=function(e,t){var n=this;return tidy(function(){var t=getExactlyOneTensor(e);return\"channelsLast\"===n.dataFormat?mean(t,[1,2]):mean(t,[2,3])})},t.className=\"GlobalAveragePooling2D\",t}(GlobalPooling2D);serialization.SerializationMap.register(GlobalAveragePooling2D);var GlobalMaxPooling2D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.call=function(e,t){var n=this;return tidy(function(){var t=getExactlyOneTensor(e);return\"channelsLast\"===n.dataFormat?max(t,[1,2]):max(t,[2,3])})},t.className=\"GlobalMaxPooling2D\",t}(GlobalPooling2D);function standardizeArgs(e,t,n,r){if(Array.isArray(e)){if(null!=t||null!=n)throw new ValueError(\"When inputs is an array, neither initialState or constants should be provided\");null!=r&&(n=e.slice(e.length-r,e.length),e=e.slice(0,e.length-r)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function i(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=i(t),constants:n=i(n)}}function rnn(e,t,n,r,i,a,o,s){void 0===r&&(r=!1),void 0===o&&(o=!1);var l=t.shape.length;if(l<3)throw new ValueError(\"Input should be at least 3D, but is \"+l+\"D.\");var u,c,p=[1,0].concat(range(2,l));if(t=transpose(t,p),null!=i)throw new NotImplementedError(\"The rnn() function of the deeplearn.js backend does not support masking yet.\");if(null!=a)throw new NotImplementedError(\"The rnn() functoin of the deeplearn.js backend does not support constants yet.\");o&&console.warn(\"Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend.\"),r&&(t=reverse(t,0));for(var h=n,d=t.shape[0],g=0;g1?tile$1(n,[1,e]):n}):t.cell.stateSize>1?[tile$1(n,[1,t.cell.stateSize])]:[n]})},Object.defineProperty(t.prototype,\"trainableWeights\",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"nonTrainableWeights\",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),t.prototype.getConfig=function(){var t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);var n=this.cell.getConfig();t.cell={className:this.cell.getClassName(),config:n};var r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t.className=\"RNN\",t}(Layer);serialization.SerializationMap.register(RNN);var RNNCell=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(Layer),SimpleRNNCell=function(e){function t(t){var n=e.call(this,t)||this;return n.DEFAULT_ACTIVATION=\"tanh\",n.DEFAULT_KERNEL_INITIALIZER=\"glorotNormal\",n.DEFAULT_RECURRENT_INITIALIZER=\"orthogonal\",n.DEFAULT_BIAS_INITIALIZER=\"zeros\",n.units=t.units,n.activation=getActivation(null==t.activation?n.DEFAULT_ACTIVATION:t.activation),n.useBias=null==t.useBias||t.useBias,n.kernelInitializer=getInitializer(t.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=getInitializer(t.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=getInitializer(t.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelRegularizer=getRegularizer(t.kernelRegularizer),n.recurrentRegularizer=getRegularizer(t.recurrentRegularizer),n.biasRegularizer=getRegularizer(t.biasRegularizer),n.kernelConstraint=getConstraint(t.kernelConstraint),n.recurrentConstraint=getConstraint(t.recurrentConstraint),n.biasConstraint=getConstraint(t.biasConstraint),n.dropout=min$1([1,max$1([0,null==t.dropout?0:t.dropout])]),n.recurrentDropout=min$1([1,max$1([0,null==t.recurrentDropout?0:t.recurrentDropout])]),n.stateSize=n.units,n.dropoutMask=null,n.recurrentDropoutMask=null,n}return __extends(t,e),t.prototype.build=function(e){e=getExactlyOneShape(e),this.kernel=this.addWeight(\"kernel\",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight(\"recurrent_kernel\",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight(\"bias\",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},t.prototype.call=function(e,t){var n=this;return tidy(function(){if(2!==(e=e).length)throw new ValueError(\"SimpleRNNCell expects 2 input Tensors, got \"+e.length+\".\");var r=e[1];e=e[0];var i,a=null!=t.training&&t.training;01){for(var a=[],o=0;o= 3D, but received input shape \"+JSON.stringify(t));this.inputSpec=[{shape:t}];var n=[t[0]].concat(t.slice(2));this.layer.built||(this.layer.build(n),this.layer.built=!0),e.prototype.build.call(this,t)},t.prototype.computeOutputShape=function(e){var t=[(e=getExactlyOneShape(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))},t.prototype.call=function(e,t){var n=this;return tidy(function(){return rnn(function(e,r){return[n.layer.call(e,t),[]]},e=getExactlyOneTensor(e),[],!1,null,null,!1,e.shape[1])[1]})},t.className=\"TimeDistributed\",t}(Wrapper);serialization.SerializationMap.register(TimeDistributed);var VALID_BIDIRECTIONAL_MERGE_MODES=[\"sum\",\"mul\",\"concat\",\"ave\"];function checkBidirectionalMergeMode(e){checkStringTypeUnionValue(VALID_BIDIRECTIONAL_MERGE_MODES,\"BidirectionalMergeMode\",e)}var Bidirectional=function(e){function t(t){var n=e.call(this,t)||this,r=t.layer.getConfig();if(n.forwardLayer=deserialize({className:t.layer.getClassName(),config:r}),r.goBackwards=!0!==r.goBackwards,n.backwardLayer=deserialize({className:t.layer.getClassName(),config:r}),n.forwardLayer.name=\"forward_\"+n.forwardLayer.name,n.backwardLayer.name=\"backward_\"+n.backwardLayer.name,checkBidirectionalMergeMode(t.mergeMode),n.mergeMode=t.mergeMode,t.weights)throw new NotImplementedError(\"weights support is not implemented for Bidirectional layer yet.\");return n._stateful=t.layer.stateful,n.returnSequences=t.layer.returnSequences,n.returnState=t.layer.returnState,n.supportsMasking=!0,n._trainable=!0,n.inputSpec=t.layer.inputSpec,n.numConstants=null,n}return __extends(t,e),Object.defineProperty(t.prototype,\"trainable\",{get:function(){return this._trainable},set:function(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)},enumerable:!0,configurable:!0}),t.prototype.getWeights=function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())},t.prototype.setWeights=function(e){var t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))},t.prototype.computeOutputShape=function(e){var t,n,r,i=this.forwardLayer.computeOutputShape(e);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(r=i.slice(1),t=i[0]):t=i[0],t=t,\"concat\"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[t].concat(r).concat(r.slice()):singletonOrArray(n)},t.prototype.apply=function(t,n){var r=null==n?null:n.initialState,i=null==n?null:n.constants;null==n&&(n={});var a=standardizeArgs(t,r,i,this.numConstants);if(t=a.inputs,r=a.initialState,i=a.constants,Array.isArray(t)&&(r=t.slice(1),t=t[0]),(null==r||0===r.length)&&null==i)return e.prototype.apply.call(this,t,n);var o=[],s=[];if(null!=r){var l=r.length;if(l%2>0)throw new ValueError(\"When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.\");n.initialState=r,o.push.apply(o,r);var u=r.map(function(e){return new InputSpec({shape:e.shape})});this.forwardLayer.stateSpec=u.slice(0,l/2),this.backwardLayer.stateSpec=u.slice(l/2),s.push.apply(s,u)}if(null!=i)throw new NotImplementedError(\"Support for constants in Bidirectional layers is not implemented yet.\");for(var c=o[0]instanceof SymbolicTensor,p=0,h=o;p0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},x=u-m,v=Math.floor,I=String.fromCharCode;function O(e){throw RangeError(b[e])}function w(e,t){for(var a=e.length,r=[];a--;)r[a]=t(e[a]);return r}function V(e,t){var a=e.split(\"@\"),r=\"\";return a.length>1&&(r=a[0]+\"@\",e=a[1]),r+w((e=e.replace(P,\".\")).split(\".\"),t).join(\".\")}function T(e){for(var t,a,r=[],n=0,o=e.length;n=55296&&t<=56319&&n65535&&(t+=I((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=I(e)}).join(\"\")}function $(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,a){var r=0;for(e=a?v(e/c):e>>1,e+=v(e/t);e>x*l>>1;r+=u)e=v(e/x);return v(r+(x+1)*e/(e+d))}function A(e){var t,a,r,n,o,s,i,d,c,g,N,P=[],b=e.length,x=0,I=h,w=f;for((a=e.lastIndexOf(y))<0&&(a=0),r=0;r=128&&O(\"not-basic\"),P.push(e.charCodeAt(r));for(n=a>0?a+1:0;n=b&&O(\"invalid-input\"),((d=(N=e.charCodeAt(n++))-48<10?N-22:N-65<26?N-65:N-97<26?N-97:u)>=u||d>v((p-x)/s))&&O(\"overflow\"),x+=d*s,!(d<(c=i<=w?m:i>=w+l?l:i-w));i+=u)s>v(p/(g=u-c))&&O(\"overflow\"),s*=g;w=_(x-o,t=P.length+1,0==o),v(x/t)>p-I&&O(\"overflow\"),I+=v(x/t),x%=t,P.splice(x++,0,I)}return k(P)}function S(e){var t,a,r,n,o,s,i,d,c,g,N,P,b,x,w,V=[];for(P=(e=T(e)).length,t=h,a=0,o=f,s=0;s=t&&Nv((p-a)/(b=r+1))&&O(\"overflow\"),a+=(i-t)*b,t=i,s=0;sp&&O(\"overflow\"),N==t){for(d=a,c=u;!(d<(g=c<=o?m:c>=o+l?l:c-o));c+=u)w=d-g,x=u-g,V.push(I($(g+w%x,0))),d=v(w/x);V.push(I($(d,0))),o=_(a,b,r==n),a=0,++r}++a,++t}return V.join(\"\")}if(s={version:\"1.3.2\",ucs2:{decode:T,encode:k},decode:A,encode:S,toASCII:function(e){return V(e,function(e){return N.test(e)?\"xn--\"+S(e):e})},toUnicode:function(e){return V(e,function(e){return g.test(e)?A(e.slice(4).toLowerCase()):e})}},r&&n)if(e.exports==r)n.exports=s;else for(i in s)s.hasOwnProperty(i)&&(r[i]=s[i]);else a.punycode=s}(commonjsGlobal)}),util$1={isString:function(e){return\"string\"==typeof e},isObject:function(e){return\"object\"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var decode=function(e,t,a,r){t=t||\"&\",a=a||\"=\";var n={};if(\"string\"!=typeof e||0===e.length)return n;var o=/\\+/g;e=e.split(t);var s=1e3;r&&\"number\"==typeof r.maxKeys&&(s=r.maxKeys);var i=e.length;s>0&&i>s&&(i=s);for(var p=0;p=0?(u=c.substr(0,f),m=c.substr(f+1)):(u=c,m=\"\"),l=decodeURIComponent(u),d=decodeURIComponent(m),hasOwnProperty(n,l)?Array.isArray(n[l])?n[l].push(d):n[l]=[n[l],d]:n[l]=d}return n},stringifyPrimitive=function(e){switch(typeof e){case\"string\":return e;case\"boolean\":return e?\"true\":\"false\";case\"number\":return isFinite(e)?e:\"\";default:return\"\"}},encode=function(e,t,a,r){return t=t||\"&\",a=a||\"=\",null===e&&(e=void 0),\"object\"==typeof e?Object.keys(e).map(function(r){var n=encodeURIComponent(stringifyPrimitive(r))+a;return Array.isArray(e[r])?e[r].map(function(e){return n+encodeURIComponent(stringifyPrimitive(e))}).join(t):n+encodeURIComponent(stringifyPrimitive(e[r]))}).join(t):r?encodeURIComponent(stringifyPrimitive(r))+a+encodeURIComponent(stringifyPrimitive(e)):\"\"},querystring=createCommonjsModule(function(e,t){t.decode=t.parse=decode,t.encode=t.stringify=encode}),querystring_1=querystring.decode,querystring_2=querystring.parse,querystring_3=querystring.encode,querystring_4=querystring.stringify,parse=urlParse,format=urlFormat;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,delims=[\"<\",\">\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"],unwise=[\"{\",\"}\",\"|\",\"\\\\\",\"^\",\"`\"].concat(delims),autoEscape=[\"'\"].concat(unwise),nonHostChars=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(autoEscape),hostEndingChars=[\"/\",\"?\",\"#\"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,\"javascript:\":!0},hostlessProtocol={javascript:!0,\"javascript:\":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0};function urlParse(e,t,a){if(e&&util$1.isObject(e)&&e instanceof Url)return e;var r=new Url;return r.parse(e,t,a),r}function urlFormat(e){return util$1.isString(e)&&(e=urlParse(e)),e instanceof Url?e.format():Url.prototype.format.call(e)}Url.prototype.parse=function(e,t,a){if(!util$1.isString(e))throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof e);var r=e.indexOf(\"?\"),n=-1!==r&&r127?b+=\"x\":b+=P[x];if(!b.match(hostnamePartPattern)){var I=g.slice(0,f),O=g.slice(f+1),w=P.match(hostnamePartStart);w&&(I.push(w[1]),O.unshift(w[2])),O.length&&(s=\"/\"+O.join(\".\")+s),this.hostname=I.join(\".\");break}}}this.hostname.length>hostnameMaxLen?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=punycode.toASCII(this.hostname));var V=this.port?\":\"+this.port:\"\",T=this.hostname||\"\";this.host=T+V,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==s[0]&&(s=\"/\"+s))}if(!unsafeProtocol[u])for(f=0,N=autoEscape.length;f0)&&a.host.split(\"@\"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift());return a.search=e.search,a.query=e.query,util$1.isNull(a.pathname)&&util$1.isNull(a.search)||(a.path=(a.pathname?a.pathname:\"\")+(a.search?a.search:\"\")),a.href=a.format(),a}if(!P.length)return a.pathname=null,a.search?a.path=\"/\"+a.search:a.path=null,a.href=a.format(),a;for(var x=P.slice(-1)[0],v=(a.host||e.host||P.length>1)&&(\".\"===x||\"..\"===x)||\"\"===x,I=0,O=P.length;O>=0;O--)\".\"===(x=P[O])?P.splice(O,1):\"..\"===x?(P.splice(O,1),I++):I&&(P.splice(O,1),I--);if(!g&&!N)for(;I--;I)P.unshift(\"..\");!g||\"\"===P[0]||P[0]&&\"/\"===P[0].charAt(0)||P.unshift(\"\"),v&&\"/\"!==P.join(\"/\").substr(-1)&&P.push(\"\");var w,V=\"\"===P[0]||P[0]&&\"/\"===P[0].charAt(0);b&&(a.hostname=a.host=V?\"\":P.length?P.shift():\"\",(w=!!(a.host&&a.host.indexOf(\"@\")>0)&&a.host.split(\"@\"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift()));return(g=g||a.host&&P.length)&&!V&&P.unshift(\"\"),P.length?a.pathname=P.join(\"/\"):(a.pathname=null,a.path=null),util$1.isNull(a.pathname)&&util$1.isNull(a.search)||(a.path=(a.pathname?a.pathname:\"\")+(a.search?a.search:\"\")),a.auth=e.auth||a.auth,a.slashes=a.slashes||e.slashes,a.href=a.format(),a},Url.prototype.parseHost=function(){var e=this.host,t=portPattern.exec(e);t&&(\":\"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var aspromise=asPromise;function asPromise(e,t){for(var a=new Array(arguments.length-1),r=0,n=2,o=!0;n1&&\"=\"===e.charAt(t);)++a;return Math.ceil(3*e.length)/4-a};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;a.encode=function(e,t,a){for(var n,o=null,s=[],i=0,p=0;t>2],n=(3&u)<<4,p=1;break;case 1:s[i++]=r[n|u>>4],n=(15&u)<<2,p=2;break;case 2:s[i++]=r[n|u>>6],s[i++]=r[63&u],p=0}i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),i=0)}return p&&(s[i++]=r[n],s[i++]=61,1===p&&(s[i++]=61)),o?(i&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join(\"\")):String.fromCharCode.apply(String,s.slice(0,i))};a.decode=function(e,t,a){for(var r,o=a,s=0,i=0;i1)break;if(void 0===(p=n[p]))throw Error(\"invalid encoding\");switch(s){case 0:r=p,s=1;break;case 1:t[a++]=r<<2|(48&p)>>4,r=p,s=2;break;case 2:t[a++]=(15&r)<<4|(60&p)>>2,r=p,s=3;break;case 3:t[a++]=(3&r)<<6|p,s=0}}if(1===s)throw Error(\"invalid encoding\");return a-o},a.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}),eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(e,t,a){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:a||this}),this},EventEmitter.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var a=this._listeners[e],r=0;r0?0:2147483648,a,r);else if(isNaN(t))e(2143289344,a,r);else if(t>3.4028234663852886e38)e((n<<31|2139095040)>>>0,a,r);else if(t<1.1754943508222875e-38)e((n<<31|Math.round(t/1.401298464324817e-45))>>>0,a,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((n<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,a,r)}}function a(e,t,a){var r=e(t,a),n=2*(r>>31)+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:n*(1/0):0===o?1.401298464324817e-45*n*s:n*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,writeUintLE),e.writeFloatBE=t.bind(null,writeUintBE),e.readFloatLE=a.bind(null,readUintLE),e.readFloatBE=a.bind(null,readUintBE)}(),\"undefined\"!=typeof Float64Array?function(){var t=new Float64Array([-0]),a=new Uint8Array(t.buffer),r=128===a[7];function n(e,r,n){t[0]=e,r[n]=a[0],r[n+1]=a[1],r[n+2]=a[2],r[n+3]=a[3],r[n+4]=a[4],r[n+5]=a[5],r[n+6]=a[6],r[n+7]=a[7]}function o(e,r,n){t[0]=e,r[n]=a[7],r[n+1]=a[6],r[n+2]=a[5],r[n+3]=a[4],r[n+4]=a[3],r[n+5]=a[2],r[n+6]=a[1],r[n+7]=a[0]}function s(e,r){return a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],t[0]}function i(e,r){return a[7]=e[r],a[6]=e[r+1],a[5]=e[r+2],a[4]=e[r+3],a[3]=e[r+4],a[2]=e[r+5],a[1]=e[r+6],a[0]=e[r+7],t[0]}e.writeDoubleLE=r?n:o,e.writeDoubleBE=r?o:n,e.readDoubleLE=r?s:i,e.readDoubleBE=r?i:s}():function(){function t(e,t,a,r,n,o){var s=r<0?1:0;if(s&&(r=-r),0===r)e(0,n,o+t),e(1/r>0?0:2147483648,n,o+a);else if(isNaN(r))e(0,n,o+t),e(2146959360,n,o+a);else if(r>1.7976931348623157e308)e(0,n,o+t),e((s<<31|2146435072)>>>0,n,o+a);else{var i;if(r<2.2250738585072014e-308)e((i=r/5e-324)>>>0,n,o+t),e((s<<31|i/4294967296)>>>0,n,o+a);else{var p=Math.floor(Math.log(r)/Math.LN2);1024===p&&(p=1023),e(4503599627370496*(i=r*Math.pow(2,-p))>>>0,n,o+t),e((s<<31|p+1023<<20|1048576*i&1048575)>>>0,n,o+a)}}}function a(e,t,a,r,n){var o=e(r,n+t),s=e(r,n+a),i=2*(s>>31)+1,p=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===p?u?NaN:i*(1/0):0===p?5e-324*i*u:i*Math.pow(2,p-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,writeUintLE,0,4),e.writeDoubleBE=t.bind(null,writeUintBE,4,0),e.readDoubleLE=a.bind(null,readUintLE,0,4),e.readDoubleBE=a.bind(null,readUintBE,4,0)}(),e}function writeUintLE(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}function writeUintBE(e,t,a){t[a]=e>>>24,t[a+1]=e>>>16&255,t[a+2]=e>>>8&255,t[a+3]=255&e}function readUintLE(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function readUintBE(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod$$1=eval(\"quire\".replace(/^/,\"re\"))(moduleName);if(mod$$1&&(mod$$1.length||Object.keys(mod$$1).length))return mod$$1}catch(e){}return null}var utf8_1=createCommonjsModule(function(e,t){var a=t;a.length=function(e){for(var t=0,a=0,r=0;r191&&r<224?o[s++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(r>>10),o[s++]=56320+(1023&r)):o[s++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join(\"\")):String.fromCharCode.apply(String,o.slice(0,s))},a.write=function(e,t,a){for(var r,n,o=a,s=0;s>6|192,t[a++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&n),++s,t[a++]=r>>18|240,t[a++]=r>>12&63|128,t[a++]=r>>6&63|128,t[a++]=63&r|128):(t[a++]=r>>12|224,t[a++]=r>>6&63|128,t[a++]=63&r|128);return a-o}}),pool_1=pool;function pool(e,t,a){var r=a||8192,n=r>>>1,o=null,s=r;return function(a){if(a<1||a>n)return e(a);s+a>r&&(o=e(r),s=0);var i=t.call(o,s,s+=a);return 7&s&&(s=1+(7|s)),i}}var longbits=LongBits;function LongBits(e,t){this.lo=e>>>0,this.hi=t>>>0}var zero=LongBits.zero=new LongBits(0,0);zero.toNumber=function(){return 0},zero.zzEncode=zero.zzDecode=function(){return this},zero.length=function(){return 1};var zeroHash=LongBits.zeroHash=\"\\0\\0\\0\\0\\0\\0\\0\\0\";LongBits.fromNumber=function(e){if(0===e)return zero;var t=e<0;t&&(e=-e);var a=e>>>0,r=(e-a)/4294967296>>>0;return t&&(r=~r>>>0,a=~a>>>0,++a>4294967295&&(a=0,++r>4294967295&&(r=0))),new LongBits(a,r)},LongBits.from=function(e){if(\"number\"==typeof e)return LongBits.fromNumber(e);if(minimal.isString(e)){if(!minimal.Long)return LongBits.fromNumber(parseInt(e,10));e=minimal.Long.fromString(e)}return e.low||e.high?new LongBits(e.low>>>0,e.high>>>0):zero},LongBits.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,a=~this.hi>>>0;return t||(a=a+1>>>0),-(t+4294967296*a)}return this.lo+4294967296*this.hi},LongBits.prototype.toLong=function(e){return minimal.Long?new minimal.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var charCodeAt=String.prototype.charCodeAt;LongBits.fromHash=function(e){return e===zeroHash?zero:new LongBits((charCodeAt.call(e,0)|charCodeAt.call(e,1)<<8|charCodeAt.call(e,2)<<16|charCodeAt.call(e,3)<<24)>>>0,(charCodeAt.call(e,4)|charCodeAt.call(e,5)<<8|charCodeAt.call(e,6)<<16|charCodeAt.call(e,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},LongBits.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},LongBits.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,a=this.hi>>>24;return 0===a?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:a<128?9:10};var minimal=createCommonjsModule(function(e,t){var a=t;function r(e,t,a){for(var r=Object.keys(t),n=0;n0)},a.Buffer=function(){try{var e=a.inquire(\"buffer\").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),a._Buffer_from=null,a._Buffer_allocUnsafe=null,a.newBuffer=function(e){return\"number\"==typeof e?a.Buffer?a._Buffer_allocUnsafe(e):new a.Array(e):a.Buffer?a._Buffer_from(e):\"undefined\"==typeof Uint8Array?e:new Uint8Array(e)},a.Array=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,a.Long=commonjsGlobal.dcodeIO&&commonjsGlobal.dcodeIO.Long||a.inquire(\"long\"),a.key2Re=/^true|false|0|1$/,a.key32Re=/^-?(?:0|[1-9][0-9]*)$/,a.key64Re=/^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,a.longToHash=function(e){return e?a.LongBits.from(e).toHash():a.LongBits.zeroHash},a.longFromHash=function(e,t){var r=a.LongBits.fromHash(e);return a.Long?a.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},a.merge=r,a.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},a.newError=n,a.ProtocolError=n(\"ProtocolError\"),a.oneOfGetter=function(e){for(var t={},a=0;a-1;--a)if(1===t[e[a]]&&void 0!==this[e[a]]&&null!==this[e[a]])return e[a]}},a.oneOfSetter=function(e){return function(t){for(var a=0;a127;)t[a++]=127&e|128,e>>>=7;t[a]=e}function VarintOp(e,t){this.len=e,this.next=void 0,this.val=t}function writeVarint64(e,t,a){for(;e.hi;)t[a++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[a++]=127&e.lo|128,e.lo=e.lo>>>7;t[a++]=e.lo}function writeFixed32(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}Writer.create=minimal.Buffer?function(){return(Writer.create=function(){return new BufferWriter})()}:function(){return new Writer},Writer.alloc=function(e){return new minimal.Array(e)},minimal.Array!==Array&&(Writer.alloc=minimal.pool(Writer.alloc,minimal.Array.prototype.subarray)),Writer.prototype._push=function(e,t,a){return this.tail=this.tail.next=new Op(e,t,a),this.len+=t,this},VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new VarintOp((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},Writer.prototype.int32=function(e){return e<0?this._push(writeVarint64,10,LongBits$1.fromNumber(e)):this.uint32(e)},Writer.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},Writer.prototype.uint64=function(e){var t=LongBits$1.from(e);return this._push(writeVarint64,t.length(),t)},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(e){var t=LongBits$1.from(e).zzEncode();return this._push(writeVarint64,t.length(),t)},Writer.prototype.bool=function(e){return this._push(writeByte,1,e?1:0)},Writer.prototype.fixed32=function(e){return this._push(writeFixed32,4,e>>>0)},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(e){var t=LongBits$1.from(e);return this._push(writeFixed32,4,t.lo)._push(writeFixed32,4,t.hi)},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(e){return this._push(minimal.float.writeFloatLE,4,e)},Writer.prototype.double=function(e){return this._push(minimal.float.writeDoubleLE,8,e)};var writeBytes=minimal.Array.prototype.set?function(e,t,a){t.set(e,a)}:function(e,t,a){for(var r=0;r>>0;if(!t)return this._push(writeByte,1,0);if(minimal.isString(e)){var a=Writer.alloc(t=base64.length(e));base64.decode(e,a,0),e=a}return this.uint32(t)._push(writeBytes,t,e)},Writer.prototype.string=function(e){var t=utf8.length(e);return t?this.uint32(t)._push(utf8.write,t,e):this._push(writeByte,1,0)},Writer.prototype.fork=function(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this},Writer.prototype.ldelim=function(){var e=this.head,t=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=e.next,this.tail=t,this.len+=a),this},Writer.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),a=0;e;)e.fn(e.val,t,a),a+=e.len,e=e.next;return t},Writer._configure=function(e){BufferWriter=e};var writer_buffer=BufferWriter$1;(BufferWriter$1.prototype=Object.create(writer.prototype)).constructor=BufferWriter$1;var Buffer=minimal.Buffer;function BufferWriter$1(){writer.call(this)}BufferWriter$1.alloc=function(e){return(BufferWriter$1.alloc=minimal._Buffer_allocUnsafe)(e)};var writeBytesBuffer=Buffer&&Buffer.prototype instanceof Uint8Array&&\"set\"===Buffer.prototype.set.name?function(e,t,a){t.set(e,a)}:function(e,t,a){if(e.copy)e.copy(t,a,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this._push(writeBytesBuffer,t,e),this},BufferWriter$1.prototype.string=function(e){var t=Buffer.byteLength(e);return this.uint32(t),t&&this._push(writeStringBuffer,t,e),this};var reader=Reader,BufferReader,LongBits$2=minimal.LongBits,utf8$1=minimal.utf8;function indexOutOfRange(e,t){return RangeError(\"index out of range: \"+e.pos+\" + \"+(t||1)+\" > \"+e.len)}function Reader(e){this.buf=e,this.pos=0,this.len=e.length}var create_array=\"undefined\"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Reader(e);throw Error(\"illegal buffer\")}:function(e){if(Array.isArray(e))return new Reader(e);throw Error(\"illegal buffer\")};function readLongVarint(){var e=new LongBits$2(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(\"invalid varint encoding\")}function readFixed32_end(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits$2(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader.create=minimal.Buffer?function(e){return(Reader.create=function(e){return minimal.Buffer.isBuffer(e)?new BufferReader(e):create_array(e)})(e)}:create_array,Reader.prototype._slice=minimal.Array.prototype.subarray||minimal.Array.prototype.slice,Reader.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return e}}(),Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},Reader.prototype.bool=function(){return 0!==this.uint32()},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},Reader.prototype.bytes=function(){var e=this.uint32(),t=this.pos,a=this.pos+e;if(a>this.len)throw indexOutOfRange(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,a):t===a?new this.buf.constructor(0):this._slice.call(this.buf,t,a)},Reader.prototype.string=function(){var e=this.bytes();return utf8$1.read(e,0,e.length)},Reader.prototype.skip=function(e){if(\"number\"==typeof e){if(this.pos+e>this.len)throw indexOutOfRange(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw indexOutOfRange(this)}while(128&this.buf[this.pos++]);return this},Reader.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error(\"invalid wire type \"+e+\" at offset \"+this.pos)}return this},Reader._configure=function(e){BufferReader=e;var t=minimal.Long?\"toLong\":\"toNumber\";minimal.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader$1;function BufferReader$1(e){reader.call(this,e)}(BufferReader$1.prototype=Object.create(reader.prototype)).constructor=BufferReader$1,minimal.Buffer&&(BufferReader$1.prototype._slice=minimal.Buffer.prototype.slice),BufferReader$1.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))};var service=Service;function Service(e,t,a){if(\"function\"!=typeof e)throw TypeError(\"rpcImpl must be a function\");minimal.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(a)}(Service.prototype=Object.create(minimal.EventEmitter.prototype)).constructor=Service,Service.prototype.rpcCall=function e(t,a,r,n,o){if(!n)throw TypeError(\"request must be specified\");var s=this;if(!o)return minimal.asPromise(e,s,t,a,r,n);if(s.rpcImpl)try{return s.rpcImpl(t,a[s.requestDelimited?\"encodeDelimited\":\"encode\"](n).finish(),function(e,a){if(e)return s.emit(\"error\",e,t),o(e);if(null!==a){if(!(a instanceof r))try{a=r[s.responseDelimited?\"decodeDelimited\":\"decode\"](a)}catch(e){return s.emit(\"error\",e,t),o(e)}return s.emit(\"data\",a,t),o(null,a)}s.end(!0)})}catch(e){return s.emit(\"error\",e,t),void setTimeout(function(){o(e)},0)}else setTimeout(function(){o(Error(\"already ended\"))},0)},Service.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(\"end\").off()),this};var rpc_1=createCommonjsModule(function(e,t){t.Service=service}),roots={},indexMinimal=createCommonjsModule(function(e,t){var a=t;function r(){a.Reader._configure(a.BufferReader),a.util._configure()}a.build=\"minimal\",a.Writer=writer,a.BufferWriter=writer_buffer,a.Reader=reader,a.BufferReader=reader_buffer,a.util=minimal,a.rpc=rpc_1,a.roots=roots,a.configure=r,a.Writer._configure(a.BufferWriter),r()}),minimal$1=indexMinimal,minimal_1=minimal$1.roots,minimal_2=minimal$1.Reader,minimal_3=minimal$1.util,$Reader=minimal$1.Reader,$util=minimal$1.util,$root=minimal$1.roots.default||(minimal$1.roots.default={});$root.tensorflow=function(){var e,t,a={};return a.Any=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.typeUrl=e.string();break;case 2:r.value=e.bytes();break;default:e.skipType(7&n)}}return r},e}(),a.DataType=(e={},(t=Object.create(e))[e[0]=\"DT_INVALID\"]=0,t[e[1]=\"DT_FLOAT\"]=1,t[e[2]=\"DT_DOUBLE\"]=2,t[e[3]=\"DT_INT32\"]=3,t[e[4]=\"DT_UINT8\"]=4,t[e[5]=\"DT_INT16\"]=5,t[e[6]=\"DT_INT8\"]=6,t[e[7]=\"DT_STRING\"]=7,t[e[8]=\"DT_COMPLEX64\"]=8,t[e[9]=\"DT_INT64\"]=9,t[e[10]=\"DT_BOOL\"]=10,t[e[11]=\"DT_QINT8\"]=11,t[e[12]=\"DT_QUINT8\"]=12,t[e[13]=\"DT_QINT32\"]=13,t[e[14]=\"DT_BFLOAT16\"]=14,t[e[101]=\"DT_FLOAT_REF\"]=101,t[e[102]=\"DT_DOUBLE_REF\"]=102,t[e[103]=\"DT_INT32_REF\"]=103,t[e[104]=\"DT_UINT8_REF\"]=104,t[e[105]=\"DT_INT16_REF\"]=105,t[e[106]=\"DT_INT8_REF\"]=106,t[e[107]=\"DT_STRING_REF\"]=107,t[e[108]=\"DT_COMPLEX64_REF\"]=108,t[e[109]=\"DT_INT64_REF\"]=109,t[e[110]=\"DT_BOOL_REF\"]=110,t[e[111]=\"DT_QINT8_REF\"]=111,t[e[112]=\"DT_QUINT8_REF\"]=112,t[e[113]=\"DT_QINT32_REF\"]=113,t[e[114]=\"DT_BFLOAT16_REF\"]=114,t),a.TensorShape=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.dim&&r.dim.length||(r.dim=[]),r.dim.push($root.tensorflow.TensorShape.Dim.decode(e,e.uint32()));break;case 3:r.unknownRank=e.bool();break;default:e.skipType(7&n)}}return r},e.Dim=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.size=e.int64();break;case 2:r.name=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.Tensor=function(){function e(e){if(this.floatVal=[],this.doubleVal=[],this.intVal=[],this.stringVal=[],this.scomplexVal=[],this.int64Val=[],this.boolVal=[],this.uint32Val=[],this.uint64Val=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.dtype=e.int32();break;case 2:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 3:r.versionNumber=e.int32();break;case 4:r.tensorContent=e.bytes();break;case 5:if(r.floatVal&&r.floatVal.length||(r.floatVal=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.list=$root.tensorflow.AttrValue.ListValue.decode(e,e.uint32());break;case 2:r.s=e.bytes();break;case 3:r.i=e.int64();break;case 4:r.f=e.float();break;case 5:r.b=e.bool();break;case 6:r.type=e.int32();break;case 7:r.shape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 8:r.tensor=$root.tensorflow.Tensor.decode(e,e.uint32());break;case 9:r.placeholder=e.string();break;case 10:r.func=$root.tensorflow.NameAttrList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.ListValue=function(){function e(e){if(this.s=[],this.i=[],this.f=[],this.b=[],this.type=[],this.shape=[],this.tensor=[],this.func=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.s&&r.s.length||(r.s=[]),r.s.push(e.bytes());break;case 3:if(r.i&&r.i.length||(r.i=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.name=e.string();break;case 2:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),a.NodeDef=function(){function e(e){if(this.input=[],this.attr={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.name=e.string();break;case 2:n.op=e.string();break;case 3:n.input&&n.input.length||(n.input=[]),n.input.push(e.string());break;case 4:n.device=e.string();break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),a.VersionDef=function(){function e(e){if(this.badConsumers=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.producer=e.int32();break;case 2:r.minConsumer=e.int32();break;case 3:if(r.badConsumers&&r.badConsumers.length||(r.badConsumers=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:r.versions=$root.tensorflow.VersionDef.decode(e,e.uint32());break;case 2:r.library=$root.tensorflow.FunctionDefLibrary.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),a.CollectionDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.nodeList=$root.tensorflow.CollectionDef.NodeList.decode(e,e.uint32());break;case 2:r.bytesList=$root.tensorflow.CollectionDef.BytesList.decode(e,e.uint32());break;case 3:r.int64List=$root.tensorflow.CollectionDef.Int64List.decode(e,e.uint32());break;case 4:r.floatList=$root.tensorflow.CollectionDef.FloatList.decode(e,e.uint32());break;case 5:r.anyList=$root.tensorflow.CollectionDef.AnyList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.NodeList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.string());break;default:e.skipType(7&n)}}return r},e}(),e.BytesList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.bytes());break;default:e.skipType(7&n)}}return r},e}(),e.Int64List=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push($root.tensorflow.Any.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),e}(),a.SaverDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.filenameTensorName=e.string();break;case 2:r.saveTensorName=e.string();break;case 3:r.restoreOpName=e.string();break;case 4:r.maxToKeep=e.int32();break;case 5:r.sharded=e.bool();break;case 6:r.keepCheckpointEveryNHours=e.float();break;case 7:r.version=e.int32();break;default:e.skipType(7&n)}}return r},e.CheckpointFormatVersion=(t={},(a=Object.create(t))[t[0]=\"LEGACY\"]=0,a[t[1]=\"V1\"]=1,a[t[2]=\"V2\"]=2,a),e}(),a.TensorInfo=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 4:r.cooSparse=$root.tensorflow.TensorInfo.CooSparse.decode(e,e.uint32());break;case 2:r.dtype=e.int32();break;case 3:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.CooSparse=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.valuesTensorName=e.string();break;case 2:r.indicesTensorName=e.string();break;case 3:r.denseShapeTensorName=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.SignatureDef=function(){function e(e){if(this.inputs={},this.outputs={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:e.skip().pos++,n.inputs===$util.emptyObject&&(n.inputs={}),a=e.string(),e.pos++,n.inputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:e.skip().pos++,n.outputs===$util.emptyObject&&(n.outputs={}),a=e.string(),e.pos++,n.outputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 3:n.methodName=e.string();break;default:e.skipType(7&o)}}return n},e}(),a.AssetFileDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.tensorInfo=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:r.filename=e.string();break;default:e.skipType(7&n)}}return r},e}(),a.OpDef=function(){function e(e){if(this.inputArg=[],this.outputArg=[],this.attr=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.inputArg&&r.inputArg.length||(r.inputArg=[]),r.inputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 3:r.outputArg&&r.outputArg.length||(r.outputArg=[]),r.outputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 4:r.attr&&r.attr.length||(r.attr=[]),r.attr.push($root.tensorflow.OpDef.AttrDef.decode(e,e.uint32()));break;case 8:r.deprecation=$root.tensorflow.OpDef.OpDeprecation.decode(e,e.uint32());break;case 5:r.summary=e.string();break;case 6:r.description=e.string();break;case 18:r.isCommutative=e.bool();break;case 16:r.isAggregate=e.bool();break;case 17:r.isStateful=e.bool();break;case 19:r.allowsUninitializedInput=e.bool();break;default:e.skipType(7&n)}}return r},e.ArgDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.description=e.string();break;case 3:r.type=e.int32();break;case 4:r.typeAttr=e.string();break;case 5:r.numberAttr=e.string();break;case 6:r.typeListAttr=e.string();break;case 16:r.isRef=e.bool();break;default:e.skipType(7&n)}}return r},e}(),e.AttrDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.type=e.string();break;case 3:r.defaultValue=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 4:r.description=e.string();break;case 5:r.hasMinimum=e.bool();break;case 6:r.minimum=e.int64();break;case 7:r.allowedValues=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),e.OpDeprecation=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.version=e.int32();break;case 2:r.explanation=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.OpList=function(){function e(e){if(this.op=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.op&&r.op.length||(r.op=[]),r.op.push($root.tensorflow.OpDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),a.MetaGraphDef=function(){function e(e){if(this.collectionDef={},this.signatureDef={},this.assetFileDef=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.metaInfoDef=$root.tensorflow.MetaGraphDef.MetaInfoDef.decode(e,e.uint32());break;case 2:n.graphDef=$root.tensorflow.GraphDef.decode(e,e.uint32());break;case 3:n.saverDef=$root.tensorflow.SaverDef.decode(e,e.uint32());break;case 4:e.skip().pos++,n.collectionDef===$util.emptyObject&&(n.collectionDef={}),a=e.string(),e.pos++,n.collectionDef[a]=$root.tensorflow.CollectionDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.signatureDef===$util.emptyObject&&(n.signatureDef={}),a=e.string(),e.pos++,n.signatureDef[a]=$root.tensorflow.SignatureDef.decode(e,e.uint32());break;case 6:n.assetFileDef&&n.assetFileDef.length||(n.assetFileDef=[]),n.assetFileDef.push($root.tensorflow.AssetFileDef.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.MetaInfoDef=function(){function e(e){if(this.tags=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.metaGraphVersion=e.string();break;case 2:r.strippedOpList=$root.tensorflow.OpList.decode(e,e.uint32());break;case 3:r.anyInfo=$root.tensorflow.Any.decode(e,e.uint32());break;case 4:r.tags&&r.tags.length||(r.tags=[]),r.tags.push(e.string());break;case 5:r.tensorflowVersion=e.string();break;case 6:r.tensorflowGitVersion=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),a.SavedModel=function(){function e(e){if(this.metaGraphs=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.savedModelSchemaVersion=e.int64();break;case 2:r.metaGraphs&&r.metaGraphs.length||(r.metaGraphs=[]),r.metaGraphs.push($root.tensorflow.MetaGraphDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),a.FunctionDefLibrary=function(){function e(e){if(this.function=[],this.gradient=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.function&&r.function.length||(r.function=[]),r.function.push($root.tensorflow.FunctionDef.decode(e,e.uint32()));break;case 2:r.gradient&&r.gradient.length||(r.gradient=[]),r.gradient.push($root.tensorflow.GradientDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),a.FunctionDef=function(){function e(e){if(this.attr={},this.nodeDef=[],this.ret={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.signature=$root.tensorflow.OpDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 3:n.nodeDef&&n.nodeDef.length||(n.nodeDef=[]),n.nodeDef.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:e.skip().pos++,n.ret===$util.emptyObject&&(n.ret={}),a=e.string(),e.pos++,n.ret[a]=e.string();break;default:e.skipType(7&o)}}return n},e}(),a.GradientDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.functionName=e.string();break;case 2:r.gradientFunc=e.string();break;default:e.skipType(7&n)}}return r},e}(),a}();var compiled_api=$root,compiled_api_1=compiled_api.tensorflow;function getParamValue(e,t,a,r){var n=t.params[e];if(n&&void 0!==n.inputIndex){if(\"tensor\"===n.type)return getTensor(t.inputNames[n.inputIndex],a,r);if(\"tensors\"===n.type)return(0===n.inputIndex?0===n.inputParamLength?t.inputNames:t.inputNames.slice(n.inputIndex,-n.inputParamLength):t.inputNames.splice(n.inputIndex)).map(function(e){return getTensor(e,a,r)});var o=Array.prototype.slice.call(getTensor(t.inputNames.slice(n.inputIndex)[0],a,r).dataSync());return\"number\"===n.type?o[0]:o}return n&&n.value}function getTensor(e,t,a){var r=parseNodeName(e),n=r[0],o=r[1],s=a.currentContextIds.find(function(e){return!!t[getNodeNameWithContextId(n,e)]});return void 0!==s?t[getNodeNameWithContextId(n,s)][o]:void 0}function getNodeNameAndIndex(e,t){var a=parseNodeName(e),r=a[0],n=a[1];return[getNodeNameWithContextId(r,t&&t.currentContextId),n]}function getNodeNameWithContextId(e,t){return t?e+\"-\"+t:e}function parseNodeName(e){var t=e.lastIndexOf(\":\");return-1===t?[e,0]:[e.substring(0,t),Number(e.substring(t+1))]}function split$1(e,t){for(var a=[],r=0;r=this.tensors.length)throw new Error(\"Tried to read from index \"+e+\", but array size is: \"+this.tensors.length);var t=this.tensors[e];if(t.cleared)throw new Error(\"TensorArray \"+this.name+\": Could not read index \"+e+\" twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).\");return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor},e.prototype.readMany=function(e){var t=this;return e.map(function(e){return t.read(e)})},e.prototype.write=function(e,t){if(this.closed_)throw new Error(\"TensorArray \"+this.name+\" has already been closed.\");if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(\"Tried to write to index \"+e+\", but array is not resizeable and size is: \"+this.maxSize);var a=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(\"TensorArray \"+this.name+\": Could not write to TensorArray index \"+e+\",\\n because the value dtype is \"+t.dtype+\", but TensorArray dtype is \"+this.dtype+\".\");if(0===this.size()&&0===this.elementShape.length&&(this.elementShape=t.shape),util.assertShapesMatch(this.elementShape,t.shape,\"TensorArray \"+this.name+\": Could not write to TensorArray index \"+e+\".\"),a&&a.read)throw new Error(\"TensorArray \"+this.name+\": Could not write to TensorArray index \"+e+\", because it has already been read.\");if(a&&a.written)throw new Error(\"TensorArray \"+this.name+\": Could not write to TensorArray index \"+e+\", because it has already been written.\");a.tensor=t,a.written=!0,this.tensors[e]=a},e.prototype.writeMany=function(e,t){var a=this;if(e.length!==t.length)throw new Error(\"TensorArray \"+this.name+\": could not write multiple tensors,because the index size: \"+e.length+\" is not the same as tensors size: \"+t.length+\".\");e.map(function(e,r){return a.write(e,t[r])})},e.prototype.gather=function(e,t){if(t&&t!==this.dtype)throw new Error(\"TensorArray dtype is \"+this.dtype+\" but gather requested dtype \"+t);if(!e){e=[];for(var a=0;a=this.maxSize)throw new Error(\"Max index must be < array size (\"+a+\" vs. \"+this.maxSize+\")\");this.writeMany(e,unstack(t,0))},e.prototype.split=function(e,t){var a=this;if(t.dtype!==this.dtype)throw new Error(\"TensorArray dtype is \"+this.dtype+\" but tensor has dtype \"+t.dtype);var r=0,n=e.map(function(e){return r+=e});if(r!==t.shape[0])throw new Error(\"Expected sum of lengths to be equal to\\n tensor.shape[0], but sum of lengths is\\n \"+r+\", and tensor's shape is: \"+t.shape);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(\"TensorArray's size is not equal to the size of lengths (\"+this.maxSize+\" vs. \"+e.length+\"), and the TensorArray is not marked as dynamically resizeable\");var o=0===r?0:t.size/r,s=[];tidy(function(){t=t.reshape([1,r,o]);for(var i=0;i1)for(var f=1;f1))throw new Error(\"Cannot exit frame, the context is empty\");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()},e.prototype.nextIteration=function(){if(!(this.contexts&&this.contexts.length>0))throw new Error(\"Cannot increase frame iteration, the context is empty\");this.contexts=this.contexts.slice(),this.lastId++;var e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))},e.prototype.getWeight=function(e){return this.weightMap[e]},e.prototype.addTensorArray=function(e){this.tensorArrayMap[e.id]=e},e.prototype.getTensorArray=function(e){return this.tensorArrayMap[e]},e}(),GraphExecutor=function(){function e(e){this.graph=e,this.compiledOrder=[],this._weightMap={},this.placeholders=e.placeholders,this._outputs=e.outputs,this.compile()}return Object.defineProperty(e.prototype,\"weightMap\",{get:function(){return this._weightMap},set:function(e){var t=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})});this.weightIds=[].concat.apply([],t),this._weightMap=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"inputs\",{get:function(){return this.placeholders.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"outputs\",{get:function(){return this._outputs.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"inputNodes\",{get:function(){return this.placeholders.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"outputNodes\",{get:function(){return this.outputs.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"isControlFlowModel\",{get:function(){return this.graph.withControlFlow},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"isDynamicShapeModel\",{get:function(){return this.graph.withDynamicShape},enumerable:!0,configurable:!0}),e.prototype.compile=function(){if(!this.graph.withControlFlow&&!this.graph.withDynamicShape)for(var e=this.graph.inputs.slice(),t={};e.length>0;){var a=e.pop();t[a.name]=!0,this.compiledOrder.push(a),a.children.forEach(function(a){!t[a.name]&&a.inputNames.every(function(e){var a=getNodeNameAndIndex(e)[0];return t[a]})&&e.push(a)})}},e.prototype.execute=function(e,t){var a=this;this.checkInput(e),this.checkInputShapeAndType(e);var r={};return tidy(function(){var n=new ExecutionContext(a._weightMap,r),o=a.compiledOrder.reduce(function(e,t){return e[t.name]=executeOp$15(t,e,n),e},__assign({},a.weightMap,e));return a.findOutputs(o,n,t)})},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u=this;return __generator(this,function(m){switch(m.label){case 0:return this.checkInput(e),this.checkInputShapeAndType(e),a={},r=new ExecutionContext(this._weightMap,a),[4,this.executeWithControlFlow(e,r)];case 1:return n=m.sent(),o=this.findOutputs(n,r,t),s=Object.keys(o).map(function(e){return o[e].id}),i=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})}),p=[].concat.apply([],i),Object.keys(n).forEach(function(e){n[e].forEach(function(e){e&&-1===s.indexOf(e.id)&&-1===p.indexOf(e.id)&&-1===u.weightIds.indexOf(e.id)&&e.dispose()})}),[2,o]}})})},e.prototype.executeWithControlFlow=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u;return __generator(this,function(m){switch(m.label){case 0:a=this.graph.inputs.map(function(e){return{node:e,contexts:t.currentContext}}),r=__assign({},this.weightMap,e),n={},m.label=1;case 1:return a.length>0?(o=a.pop(),t.currentContext=o.contexts,s=\"\",\"enter\"===o.node.op&&getParamValue(\"isConstant\",o.node,r,t)&&(s=getNodeNameAndIndex(o.node.name,t)[0]),i=executeOp$15(o.node,r,t),s||(s=getNodeNameAndIndex(o.node.name,t)[0]),p=r,u=s,[4,i]):[3,3];case 2:return p[u]=m.sent(),o.node.children.forEach(function(e){var o=getNodeNameAndIndex(e.name,t)[0];n[o]||(\"merge\"===e.op?e.inputNames.some(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})):e.inputNames.every(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})))}),[3,1];case 3:return[2,r]}})})},e.prototype.findOutputs=function(e,t,a){return!a||a instanceof Array||(a=[a]),(a||this.graph.outputs.map(function(e){return e.name})).reduce(function(a,r){return a[r]=getTensor(r,e,t),a},{})},e.prototype.dispose=function(){var e=this;Object.keys(this.weightMap).forEach(function(t){return e.weightMap[t].forEach(function(e){return e.dispose()})})},e.prototype.checkInputShapeAndType=function(e){this.placeholders.forEach(function(t){var a=e[t.name][0];if(t.params.shape&&t.params.shape.value){var r=t.params.shape.value,n=r.length===a.shape.length&&a.shape.every(function(e,t){return-1===r[t]||r[t]===e});util.assert(n,\"The shape of dict['\"+t.name+\"'] provided in model.execute(dict) must be [\"+r+\"], but was [\"+a.shape+\"]\")}t.params.dtype&&t.params.dtype.value&&util.assert(a.dtype===t.params.dtype.value,\"The dtype of dict['\"+t.name+\"'] provided in model.execute(dict) must be \"+t.params.dtype.value+\", but was \"+a.dtype)})},e.prototype.checkInput=function(e){var t=this,a=Object.keys(e),r=[],n=[];if(this.inputNodes.forEach(function(e){-1===a.indexOf(e)&&r.push(e)}),a.forEach(function(e){-1===t.inputNodes.indexOf(e)&&n.push(e)}),r.length>0)throw new Error(\"The dict provided in model.execute(dict) has the keys [\"+a+\"], but is missing the required keys: [\"+r+\"].\");if(n.length>0)throw new Error(\"The dict provided in model.execute(dict) has unused keys: [\"+n+\"]. Please provide only the following keys: [\"+this.inputNodes+\"].\")},e}(),FrozenModel=function(){function e(e,t,a){this.modelUrl=e,this.weightManifestUrl=t,this.requestOption=a,this.version=\"n/a\",this.pathPrefix=this.getPathPrefix()}return Object.defineProperty(e.prototype,\"modelVersion\",{get:function(){return this.version},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"inputNodes\",{get:function(){return this.executor.inputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"outputNodes\",{get:function(){return this.executor.outputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"inputs\",{get:function(){return this.executor.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"outputs\",{get:function(){return this.executor.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"weights\",{get:function(){return this.executor.weightMap},enumerable:!0,configurable:!0}),e.prototype.getPathPrefix=function(){var e=parse(this.weightManifestUrl),t=e.pathname.split(\"/\");return t.splice(-1),e.pathname=t.join(\"/\"),format(e)+\"/\"},e.prototype.loadRemoteProtoFile=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r,n;return __generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,fetch(this.modelUrl,this.requestOption)];case 1:return e=o.sent(),a=(t=compiled_api_1.GraphDef).decode,r=Uint8Array.bind,[4,e.arrayBuffer()];case 2:return[2,a.apply(t,[new(r.apply(Uint8Array,[void 0,o.sent()]))])];case 3:throw n=o.sent(),new Error(this.modelUrl+\" not found. \"+n);case 4:return[2]}})})},e.prototype.loadWeightManifest=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,fetch(this.weightManifestUrl,this.requestOption)];case 1:return e=r.sent(),t=this,[4,e.clone().json()];case 2:return t.weightManifest=r.sent(),[3,4];case 3:throw a=r.sent(),new Error(this.weightManifestUrl+\" not found. \"+a);case 4:return[2]}})})},e.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r;return __generator(this,function(n){switch(n.label){case 0:return e=this.loadRemoteProtoFile(),t=this.loadWeightManifest(),[4,Promise.all([e,t])];case 1:return a=n.sent()[0],this.version=a.versions.producer+\".\"+a.versions.minConsumer,[4,io.loadWeights(this.weightManifest,this.pathPrefix,void 0,this.requestOption)];case 2:return r=n.sent(),this.executor=new GraphExecutor(OperationMapper.Instance.transformGraph(a)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),[2,!0]}})})},e.prototype.predict=function(e,t){return this.execute(e,this.outputNodes)},e.prototype.constructTensorMap=function(e){var t=e instanceof Tensor?[e]:e;if(t.length!==this.inputNodes.length)throw new Error(\"Input tensor count mismatch,the frozen model has \"+this.inputNodes.length+\" placeholders, while there are \"+t.length+\" input tensors.\");return this.inputNodes.reduce(function(e,a,r){return e[a]=t[r],e},{})},e.prototype.execute=function(e,t){if(t=t||this.outputNodes,(e instanceof Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),this.executor.isControlFlowModel||this.executor.isDynamicShapeModel)throw new Error(\"The model contains control flow or dynamic shape ops, please use executeAsync method\");var a=this.executor.execute(this.convertTensorMapToTensorsMap(e),t),r=Object.keys(a);return Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r;return __generator(this,function(n){switch(n.label){case 0:if(!this.executor.isControlFlowModel||!this.executor.isDynamicShapeModel)throw new Error(\"The model does not contain control flow or dynamic shape ops, please use execute method for better performance.\");return t=t||this.outputNodes,(e instanceof Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),[4,this.executor.executeAsync(this.convertTensorMapToTensorsMap(e),t)];case 1:return a=n.sent(),r=Object.keys(a),[2,Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]]}})})},e.prototype.convertTensorMapToTensorsMap=function(e){return Object.keys(e).reduce(function(t,a){return t[a]=[e[a]],t},{})},e.prototype.dispose=function(){this.executor.dispose()},e}();function loadFrozenModel(e,t,a){return __awaiter(this,void 0,void 0,function(){var r;return __generator(this,function(n){switch(n.label){case 0:return[4,(r=new FrozenModel(e,t,a)).load()];case 1:return n.sent(),[2,r]}})})}var version=\"0.5.5\";export{FrozenModel,loadFrozenModel,version as version_converter};\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '0.12.4';\nexport {version};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport * from '@tensorflow/tfjs-core';\nexport * from '@tensorflow/tfjs-layers';\nexport * from '@tensorflow/tfjs-converter';\n\n// Import versions of all sub-packages.\nimport {version_core} from '@tensorflow/tfjs-core';\nimport {version_layers} from '@tensorflow/tfjs-layers';\nimport {version_converter} from '@tensorflow/tfjs-converter';\nimport {version as version_union} from './version';\n\nexport const version = {\n 'tfjs-core': version_core,\n 'tfjs-layers': version_layers,\n 'tfjs-converter': version_converter,\n 'tfjs': version_union\n};\n"],"names":["extendStatics","Object","setPrototypeOf","__proto__","Array","e","t","n","hasOwnProperty","__extends","constructor","prototype","create","__assign","assign","r","arguments","length","o","call","__awaiter","Promise","a","i","next","s","throw","u","done","value","then","apply","__generator","label","sent","trys","ops","return","Symbol","iterator","this","TypeError","pop","push","isMobile","navigator","userAgent","vendor","window","opera","test","substr","shuffle","Math","random","clamp","max","min","randUniform","distSquared","Number","assert","Error","assertShapesMatch","arraysEqual","assertNonNull","flatten","isArray","inferShape","isTypedArray","deepAssertShapeConsistency","join","slice","concat","sizeFromShape","isScalarShape","isInt","tanh","exp","sizeToSquarishShape","floor","sqrt","createShuffledIndices","Uint32Array","rightPad","repeat","repeatedTry","setTimeout","inferFromImplicitShape","squeezeShape","newShape","keptDims","getTypedArrayFromDType","Float32Array","Int32Array","Uint8Array","checkComputationForNaN","isNaN","checkConversionForNaN","hasEncodingLoss","copyTypedArray","round","bytesPerElement","isFunction","nearestDivisor","computeStrides","toTypedArray","noConversionNeeded","makeOnesTypedArray","makeZerosTypedArray","now","performance","process","hrtime","util","freeze","Profiler","backendTimer","logger","Logger","profileKernel","time","forEach","dataSync","dtype","logKernelProfile","kernelMs","rank","size","shape","toString","console","log","getFilteredNodesXToY","id","m","inputs","l","c","output","p","d","h","f","g","v","y","backpropagateGradients","gradient","name","keys","add","dispose","FORMAT_LIMIT_NUM_VALS","FORMAT_NUM_FIRST_LAST_VALS","FORMAT_NUM_SIG_DIGITS","tensorToString","computeMaxSizePerColumn","subTensorToString","map","fill","valToString","parseFloat","toFixed","from","subarray","TensorBuffer","values","strides","set","locToIndex","get","indexToLoc","defineProperty","enumerable","configurable","toTensor","Tensor","make","trackerFn","opHandler","setTensorTracker","setOpHandler","isDisposedInternal","dataId","nextId","rankType","registerTensor","write","throwIfDisposed","as1D","asScalar","reshape","as2D","as3D","as4D","asType","cast","buffer","data","read","readSync","isDisposed","disposeTensor","toFloat","toInt","toBool","print","reshapeAs","expandDims","cumsum","squeeze","clone","tile","gather","matMul","dot","norm","reverse","stack","unstack","pad","batchNormalization","all","any","logSumExp","sum","mean","argMin","argMax","addStrict","sub","subStrict","pow","powStrict","mul","mulStrict","div","floorDiv","divStrict","minimum","minimumStrict","maximum","maximumStrict","mod","modStrict","squaredDifference","squaredDifferenceStrict","transpose","notEqual","notEqualStrict","less","lessStrict","equal","equalStrict","lessEqual","lessEqualStrict","greater","greaterStrict","greaterEqual","greaterEqualStrict","logicalAnd","logicalOr","logicalNot","logicalXor","where","neg","ceil","sign","expm1","log1p","rsqrt","square","reciprocal","abs","clipByValue","relu","elu","selu","leakyRelu","prelu","sigmoid","logSigmoid","softplus","sin","cos","tan","asin","acos","atan","sinh","cosh","asinh","acosh","atanh","erf","step","softmax","resizeBilinear","image","resizeNearestNeighbor","conv1d","conv2d","conv2dTranspose","depthwiseConv2D","depthwiseConv2d","avgPool","maxPool","localResponseNormalization","variable","Variable","unsortedSegmentSum","batchToSpaceND","spaceToBatchND","hasInstance","trainable","nextVarId","registerVariable","Function","assertTypesMatch","isTensorInList","getTensorsInContainer","walkTensorContainer","Set","isIterable","has","Type","Engine","backend","safeMode","debugMode","registeredVariables","refCounter","WeakMap","nextTapeNodeId","numBytes","numTensors","numDataBuffers","gradientScopeCount","customGradientDepth","keepTensors","activeScope","track","scopeStack","profiler","tidy","String","scopedRun","startScope","endScope","error","runKernel","shouldRecord","activeTape","register","delete","disposeData","disposeVariables","memory","addTapeNode","keep","gradients","ones","grads","customGrad","every","gradFunc","fromPixels","wallMs","NUMBER","BOOLEAN","STRING","URL_PROPERTIES","type","isWebGLVersionEnabled","getWebGLRenderingContext","loseContext","getWebGLDisjointQueryTimerVersion","hasExtension","isRenderToFloatTextureEnabled","createFloatTextureAndBindToFramebuffer","checkFramebufferStatus","FRAMEBUFFER","FRAMEBUFFER_COMPLETE","isDownloadFloatTextureEnabled","readPixels","RGBA","FLOAT","getError","NO_ERROR","isWebGLFenceEnabled","fenceSync","isChrome","TENSORFLOWJS_FLAGS_PREFIX","getFeaturesFromURL","location","getQueryParams","search","split","warn","getExtension","document","createElement","getContext","createFramebuffer","createTexture","bindTexture","TEXTURE_2D","RGBA32F","texImage2D","bindFramebuffer","framebufferTexture2D","COLOR_ATTACHMENT0","replace","decodeParam","decodeURIComponent","TEST_EPSILON_FLOAT32_ENABLED","TEST_EPSILON_FLOAT32_DISABLED","Environment","features","registry","setBackend","ENV","initBackend","getBackend","initDefaultBackend","backendName","engine","evaluateFeature","getFeatures","getBestBackendName","entry","sort","priority","versions","node","setFeatures","reset","globalEngine","findBackend","registerBackend","message","removeBackend","getGlobalNamespace","getOrMakeEnvironment","environment","getReshaped","getPermuted","getReshapedPermuted","getSliceBeginCoords","getSliceSize","axesAreInnerMostDims","combineLocations","indexOf","computeOutAndReduceShapes","expandShapeToKeepDim","parseAxisParam","assertAxesAreInnerMostDims","getAxesPermutation","getUndoAxesPermutation","getInnerMostAxes","PARALLELIZE_THRESHOLD","computeOptimalWindowSize","segOpComputeOptimalWindowSize","computeOutShape","assertParamsValid","getStridedSlicedInfo","startForAxis","stopForAxis","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","grad","checkGrads","valueAndGrad","valueAndGrads","variableGrads","filter","some","convertToTensor","convertToTensorArray","op","endsWith","substring","softmax_","tensor","scalar","tensor1d","tensor2d","tensor3d","tensor4d","tensor5d","tensor6d","ones$1","zeros","onesLike_","zerosLike_","linspace","range","DType","Rank","UpcastBoolAndMap","UpcastFloat32AndMap","onesLike","zerosLike","float32","int32","bool","R0","R1","R2","R3","R4","R5","R6","UpcastInt32AndMap","upcastTypeMap","upcastType","sumOutType","castTensor","int","reshapeTensor","nonMaxSuppressionImpl","score","boxIndex","intersectionOverUnion","x","topkImpl","index","ArgMinMaxProgram","variableNames","windowSize","batchSize","inSize","outputShape","userCode","AvgPool2DBackpropProgram","inShape","filterHeight","filterWidth","strideHeight","strideWidth","padInfo","top","left","outHeight","outWidth","getBroadcastDims","unshift","getReductionAxes","broadcastDimsAreOuter","assertAndGetBroadcastShape","BatchNormProgram","supportsBroadcasting","CHECK_NAN_SNIPPET","ADD","SUB","MUL","DIV","INT_DIV","POW","SQUARED_DIFFERENCE","EQUAL","NOT_EQUAL","LESS","LESS_EQUAL","GREATER","GREATER_EQUAL","LOGICAL_AND","LOGICAL_OR","MAX","MIN","MOD","ATAN2","ELU_DER","BinaryOpProgram","getCustomSetupFunc","startLoc","getUniformLocationNoThrow","gl","uniform1f","NaN","ClipProgram","assertParams","computeOutShape$1","computeGradientSliceShapes","aBegin","aSize","bBegin","bSize","ConcatProgram","Conv2DDerFilterProgram","filterShape","inHeight","inWidth","Conv2DDerInputProgram","outChannels","DepthwiseConv2DDerFilterProgram","inChannels","DepthwiseConv2DDerInputProgram","Conv2DProgram","outShape","dilationHeight","dilationWidth","DepthwiseConv2DProgram","makeShader","shapeInfo","logicalShape","isUniform","getInputSamplingSnippet","texShape","getOutputSamplingSnippet","SHADER_PREFIX","FLOAT_TEXTURE_SAMPLE_SNIPPET","FLOAT_TEXTURE_SETOUTPUT_SNIPPET","getSamplerFromInInfo","getSamplerScalar","getSampler1D","getSampler2D","getSampler3D","getSampler4D","getSampler5D","getSampler6D","getSamplerFlat","getSamplerAtOutputCoords","getOutputScalarCoords","getOutput1DCoords","getOutput2DCoords","getOutput3DCoords","getOutput4DCoords","getOutput5DCoords","getOutput6DCoords","SAMPLE_1D_SNIPPET","SAMPLE_2D_SNIPPET","SAMPLE_3D_SNIPPET","SAMPLE_4D_SNIPPET","SAMPLE_5D_SNIPPET","SAMPLE_6D_SNIPPET","charAt","toUpperCase","squeezeInputInfo","getSqueezedParams","getBroadcastOutputCoordsSampler","getCoordsDataType","JSON","parse","stringify","CumSumProgram","getFinalCoord","getCoords","TextureUsage","PhysicalTextureType","EncodeFloatProgram","FromPixelsProgram","GatherProgram","getSourceCoords","getUnpackedMatrixTextureShapeWidthHeight","getUnpackedArraySizeFromMatrixSize","getMatrixSizeFromUnpackedArraySize","encodeMatrixToUnpackedArray","decodeMatrixFromUnpackedArray","getPackedMatrixTextureShapeWidthHeight","getPackedRGBAArraySizeFromMatrixShape","encodeMatrixToPackedRGBA","decodeMatrixFromPackedRGBA","RENDER","UPLOAD","PIXELS","DOWNLOAD","FLOAT16","FLOAT32","UNSIGNED_BYTE","MAX_TEXTURE_SIZE","createWebGLRenderingContext","width","height","createWebGLRenderingContextFromCanvas","callAndCheck","checkWebGLError","webGLDebugErrorCheckingEnabled","enableDebugWebGLErrorChecking","getWebGLErrorMessage","INVALID_ENUM","INVALID_VALUE","INVALID_OPERATION","INVALID_FRAMEBUFFER_OPERATION","OUT_OF_MEMORY","CONTEXT_LOST_WEBGL","getExtensionOrThrow","throwIfNull","createVertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","createFragmentShader","FRAGMENT_SHADER","logShaderSourceAndInfoLog","lineNumberRegex","exec","createProgram","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","validateProgram","VALIDATE_STATUS","createStaticVertexBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","createStaticIndexBuffer","ELEMENT_ARRAY_BUFFER","queryMaxTextureSize","getParameter","getNumChannels","validateTextureSize","bindVertexBufferToProgramAttribute","getAttribLocation","vertexAttribPointer","enableVertexAttribArray","bindTextureUnit","activeTexture","TEXTURE0","unbindTextureUnit","getProgramUniformLocationOrThrow","getUniformLocation","getProgramUniformLocation","bindTextureToProgramUniformSampler","uniform1i","bindCanvasToFramebuffer","viewport","canvas","scissor","bindColorTextureToFramebuffer","unbindColorTextureFromFramebuffer","validateFramebuffer","getFramebufferErrorMessage","FRAMEBUFFER_INCOMPLETE_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_DIMENSIONS","FRAMEBUFFER_UNSUPPORTED","validateTextureUnit","MAX_COMBINED_TEXTURE_IMAGE_UNITS","getTextureShapeFromLogicalShape","webgl_util","getWebGLContextAttributes","alpha","antialias","premultipliedAlpha","preserveDrawingBuffer","depth","stencil","failIfMajorPerformanceCaveat","createWebGLContext","disable","DEPTH_TEST","STENCIL_TEST","BLEND","DITHER","POLYGON_OFFSET_FILL","SAMPLE_COVERAGE","enable","SCISSOR_TEST","CULL_FACE","cullFace","BACK","createVertexShader$1","createVertexBuffer","createIndexBuffer","Uint16Array","getTextureConfig","R32F","R16F","RED","HALF_FLOAT","HALF_FLOAT_OES","internalFormatFloat","internalFormatHalfFloat","internalFormatPackedFloat","textureFormatFloat","downloadTextureFormat","downloadUnpackNumChannels","defaultNumChannels","textureTypeHalfFloat","createAndConfigureTexture","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","createFloat32MatrixTexture","createFloat16MatrixTexture","createUnsignedBytesMatrixTexture","createPackedMatrixTexture","bindVertexProgramAttributeStreams","uploadPixelDataToTexture","uploadDataToTexture","texSubImage2D","uploadMatrixToTexture","uploadMatrixToPackedTexture","maybeCreateBufferFromOutputTexture","PIXEL_PACK_BUFFER","downloadFloat32MatrixFromBuffer","getBufferSubData","downloadFloat32MatrixFromOutputTexture","downloadByteEncodedFloatMatrixFromOutputTexture","downloadMatrixFromPackedOutputTexture","gpgpu_util","GPGPUContext","outputTexture","program","disposed","autoDebugValidate","vertexAttrsAreBound","itemsToPoll","textureFloatExtension","colorBufferFloatExtension","textureHalfFloatExtension","colorBufferHalfFloatExtension","loseContextExtension","vertexBuffer","indexBuffer","framebuffer","textureConfig","finish","deleteFramebuffer","deleteBuffer","enableAutomaticDebugValidation","deleteMatrixTexture","deleteTexture","downloadMatrixDriver","maybeCreateBufferFromTexture","bindTextureToFrameBuffer","unbindTextureToFrameBuffer","createAndWaitForFence","createFence","pollFence","SYNC_GPU_COMMANDS_COMPLETE","flush","clientWaitSync","ALREADY_SIGNALED","CONDITION_SATISFIED","beginQuery","endQuery","isQueryAvailable","query","isFencePassed","downloadMatrixFromPackedTexture","attachShader","setProgram","deleteProgram","useProgram","getAttributeLocation","setInputMatrixTexture","throwIfNoProgram","setOutputMatrixTexture","setOutputMatrixTextureDriver","setOutputPackedMatrixTexture","setOutputMatrixWriteRegion","setOutputMatrixWriteRegionDriver","setOutputPackedMatrixWriteRegion","debugValidate","executeProgram","drawElements","TRIANGLES","UNSIGNED_SHORT","blockUntilAllProgramsCompleted","getQueryTimerExtension","disjointQueryTimerExtension","getQueryTimerExtensionWebGL2","getQueryTimerExtensionWebGL1","createQuery","TIME_ELAPSED_EXT","createQueryEXT","beginQueryEXT","endQueryEXT","waitForQueryAndGetTime","getQueryTime","getQueryParameter","QUERY_RESULT","getQueryObjectEXT","QUERY_RESULT_EXT","QUERY_RESULT_AVAILABLE","disjoint","GPU_DISJOINT_EXT","QUERY_RESULT_AVAILABLE_EXT","addItemToPoll","pollItems","binSearchLastTrue","isDoneFn","resolveFn","compileProgram","texData","source","webGLProgram","uniformLocations","gpgpu","inShapeInfos","outShapeInfo","validateBinaryAndProgram","runProgram","texture","uniform1fv","makeShaderKey","LRNProgram","LRNGradProgram","depthRadius","bias","beta","MaxPool2DBackpropProgram","MatMulProgram","MultinomialProgram","seedLoc","OneHotProgram","PadProgram","Pool2DProgram","ReduceProgram","ResizeBilinearBackpropProgram","ResizeBilinearProgram","ResizeNearestNeigborBackpropProgram","ResizeNearestNeighborProgram","ReverseProgram","SegmentOpProgram","numSegments","SelectProgram","SliceProgram","getCoords$1","uniform2i","uniform3i","uniform4i","StridedSliceProgram","TextureManager","numUsedTextures","numFreeTextures","freeTextures","logEnabled","usedTextures","acquireTexture","getPhysicalFromLogicalTextureType","getKeyFromTextureShape","shift","releaseTexture","splice","getNumUsedTextures","getNumFreeTextures","TileProgram","getSourceCoords$1","TransposeProgram","getSwitchedCoords","ERF_P","ERF_A1","ERF_A2","ERF_A3","ERF_A4","ERF_A5","SELU_SCALEALPHA","SELU_SCALE","UnaryOpProgram","CHECK_NAN_SNIPPET$1","ABS","RELU","ELU","SELU","STEP","NEG","CEIL","FLOOR","SIGN","ROUND","EXP","EXPM1","LOG","LOG1P","SQRT","RSQRT","SIGMOID","SOFTPLUS","SIN","COS","TAN","ASIN","ACOS","ATAN","SINH","COSH","TANH","ASINH","ACOSH","ATANH","ERF","SQUARE","RECIPROCAL","LOGICAL_NOT","TO_INT","concat1d_","concat2d_","concat3d_","concat4d_","concat_","concat2Tensors","b","concat1d","concat2d","concat3d","concat4d","createCommonjsModule","exports","alea","s0","s1","s2","charCodeAt","state","double","quick","xor128","z","w","xorwow","xorshift7","Date","xor4096","X","tychei","seedrandom","entropy","randomBytes","crypto","msCrypto","getRandomValues","plugins","screen","j","S","T","pass","global","fromCharCode","require","seedrandom$1","seedrandom_1","MPRandGauss","stdDev","nextVal","truncated","upper","lower","nextValue","isValidTruncated","convertValue","clone_","$x","eye_","randomNormal_","truncatedNormal_","randomUniform_","rand_","multinomial_","multinomial","logits2D","oneHot_","oneHot","$indices","fromPixels_","toPixels","Uint8ClampedArray","ImageData","putImageData","reshape_","squeeze_","cast_","tile_","pad1d_","pad2d_","pad3d_","pad4d_","pad_","stack_","batchToSpaceND_","reduce","spaceToBatchND_","unstack_","split_","cumsum_","permutedX","expandDims_","eye","pad1d","pad2d","pad3d","pad4d","rand","randomNormal","randomUniform","truncatedNormal","whereImpl","BEFORE_PAGING_CONSTANT","SIZE_UPLOAD_UNIFORM","MathBackendWebGL","delayedStorage","pendingRead","pendingDisposal","WeakSet","lruDataGPU","numBytesInGPU","uploadWaitMs","downloadWaitMs","binaryCache","gpgpuCreatedLocally","NUM_BYTES_BEFORE_PAGING","devicePixelRatio","textureManager","usage","HTMLVideoElement","HTMLImageElement","HTMLCanvasElement","fromPixelsCanvas","readyState","drawImage","getTexture","compileAndRun","throwIfNoData","uploadToGPU","cacheOnCPU","activeTimers","getValuesFromTexture","WebGLTexture","programTimersStack","unreliable","startTimer","startMs","endMs","endTimer","getGPGPUContext","getCanvas","stridedSlice","multiply","makeOutputArray","localResponseNormalization4D","LRNGrad","argReduce","segOpCompute","select","topk","realDivide","addN","subtract","eluDer","clip","atan2","conv2dDerInput","conv2dDerFilter","depthwiseConv2DDerInput","depthwiseConv2DDerFilter","maxPoolBackprop","avgPoolBackprop","resizeBilinearBackprop","resizeNearestNeighborBackprop","nonMaxSuppression","getAndSaveBinary","computeBytes","getTextureManager","remove","typedArrayToFloat32","float32ToTypedArray","neg_","ceil_","floor_","sign_","round_","exp_","expm1_","log_","log1p_","sqrt_","rsqrt_","square_","reciprocal_","abs_","clipByValue_","sigmoid_","logSigmoid_","softplus_","sin_","cos_","tan_","asin_","acos_","atan_","sinh_","cosh_","tanh_","asinh_","acosh_","atanh_","erf_","PI","step_","log$1","tanh$1","batchNormalization2d_","batchNormalization3d_","batchNormalization4d_","batchNormalization_","batchnormReshape4D","$mean","$variance","$scale","$offset","batchNormalization2d","batchNormalization3d","batchNormalization4d","computePool2DInfo","parseTupleParam","computeConv2DInfo","E","getPadAndOutInfo","getEffectiveFilterSize","_","A","R","dataFormat","computeOutputShape3D","computeDefaultPad","conditionalRound","bottom","right","conv1d_","eitherStridesOrDilationsAreOne","conv2d_","$filter","tupleValuesAreOne","conv2dDerInput_","conv2dDerFilter_","dy4D","x4D","conv2dTranspose_","depthwiseConv2d_","depthwiseConv2dDerInput","depthwiseConv2dDerFilter","separableConv2d_","parseTupleParam$1","separableConv2d","matMul_","$a","$b","outerProduct_","dot_","outerProduct","reverse1d_","reverse2d_","reverse3d_","reverse4d_","reverse_","reverse1d","reverse2d","reverse3d","reverse4d","maxPool_","avgPool_","$dy","$input","input4D","slice1d_","slice2d_","slice3d_","slice4d_","slice_","slice1d","slice2d","slice3d","slice4d","logSumExp_","sum_","mean_","min_","max_","argMin_","argMax_","all_","any_","moments_","variance","moments","notEqual_","notEqualStrict_","less_","lessStrict_","equal_","equalStrict_","lessEqual_","lessEqualStrict_","greater_","greaterStrict_","greaterEqual_","greaterEqualStrict_","add_","addN_","addStrict_","sub_","subStrict_","pow_","$base","$exp","powStrict_","mul_","mulStrict_","div_","floorDiv_","divStrict_","mod_","modStrict_","minimum_","minimumStrict_","maximum_","maximumStrict_","squaredDifference_","squaredDifferenceStrict_","atan2_","logicalNot_","logicalAnd_","logicalOr_","logicalXor_","where_","$condition","whereAsync_","whereAsync","relu_","elu_","dy","selu_","leakyRelu_","prelu_","transpose_","localResponseNormalization_","norm_","normImpl","unsortedSegmentSum_","gatherDropNegatives","gather_","arrayRange","arrayConcat","multiRNNCell_","basicLSTMCell_","basicLSTMCell","multiRNNCell","movingAverage_","movingAverage","stridedSlice_","topk_","indices","computeWeightedLoss_","Reduction","SUM_BY_NONZERO_WEIGHTS","NONE","SUM","MEAN","absoluteDifference_","computeWeightedLoss","meanSquaredError_","cosineDistance_","hingeLoss_","logLoss_","sigmoidCrossEntropyWithLogits_","sigmoidCrossEntropy_","huberLoss_","softmaxCrossEntropyWithLogits_","softmaxCrossEntropy_","absoluteDifference","cosineDistance","hingeLoss","huberLoss","logLoss","meanSquaredError","sigmoidCrossEntropy","softmaxCrossEntropy","loss_ops","gramSchmidt_","qr_","qr2d","gramSchmidt","qr","linalg_ops","resizeBilinear_","batchImages","resizeNearestNeighbor_","nonMaxSuppression_","NEGATIVE_INFINITY","nonMaxSuppSanityCheck","maxOutputSize","iouThreshold","scoreThreshold","$boxes","nonMaxSuppressionAsync_","nonMaxSuppressionAsync","image_ops","linalg","losses","MathBackendCPU","firstUse","getImageData","broadcastedBinaryOp","C","N","k","I","D","M","O","F","P","L","B","U","V","G","H","W","q","$","K","trunc","pool","POSITIVE_INFINITY","maxPoolPositions","delayCallback","requestAnimationFrame","setImmediate","nextFrame","DTYPE_VALUE_SIZE_MAP","uint16","uint8","encodeWeights","concatenateTypedArrays","specs","decodeWeights","quantization","byteLength","useNodeBuffer","Buffer","Blob","atob","btoa","stringByteLength","arrayBufferToBase64String","base64StringToArrayBuffer","byteOffset","concatenateArrayBuffers","basename","trim","getModelArtifactsInfoForJSON","modelTopology","ArrayBuffer","dateSaved","modelTopologyType","modelTopologyBytes","weightSpecsBytes","weightSpecs","weightDataBytes","weightData","IORouterRegistry","saveRouters","loadRouters","getInstance","instance","registerSaveRouter","registerLoadRouter","getSaveHandlers","getHandlers","getLoadHandlers","URL_SCHEME_SUFFIX","ModelStoreManagerRegistry","managers","registerManager","getManager","getSchemes","parseURL","scheme","path","cloneModelInternal","load","removeModel","save","modelArtifactsInfo","listModels","copyModel","moveModel","DATABASE_NAME","DATABASE_VERSION","MODEL_STORE_NAME","INFO_STORE_NAME","getIndexedDBFactory","indexedDB","mozIndexedDB","webkitIndexedDB","msIndexedDB","shimIndexedDB","setUpDatabase","result","createObjectStore","keyPath","BrowserIndexedDB","modelPath","databaseAction","open","onupgradeneeded","onsuccess","transaction","objectStore","close","modelArtifacts","onerror","oncomplete","put","URL_SCHEME","indexedDBRouter","startsWith","browserIndexedDB","maybeStripScheme","BrowserIndexedDBManager","getAll","PATH_SEPARATOR","PATH_PREFIX","INFO_SUFFIX","MODEL_TOPOLOGY_SUFFIX","WEIGHT_SPECS_SUFFIX","WEIGHT_DATA_SUFFIX","getModelKeys","info","topology","getModelPathFromKey","maybeStripScheme$1","BrowserLocalStorage","localStorage","LS","setItem","removeItem","getItem","localStorageRouter","browserLocalStorage","BrowserLocalStorageManager","key","DEFAULT_FILE_NAME_PREFIX","DEFAULT_JSON_EXTENSION_NAME","DEFAULT_WEIGHT_DATA_EXTENSION_NAME","BrowserDownloads","modelTopologyFileName","weightDataFileName","URL","createObjectURL","paths","weights","weightsManifest","jsonAnchor","download","href","click","weightDataAnchor","BrowserFiles","files","FileReader","onload","target","checkManifestAndWeightFiles","readAsArrayBuffer","readAsText","browserDownloadsRouter","browserDownloads","browserFiles","loadWeightsAsArrayBuffer","fetch","arrayBuffer","loadWeights","manifestEntry","groupOffset","sizeBytes","scale","BrowserHTTPRequest","DEFAULT_METHOD","body","requestInit","method","FormData","append","status","responses","json","lastIndexOf","URL_SCHEMES","httpRequestRouter","browserHTTPRequest","PassthroughLoader","PassthroughSaver","saveHandler","fromMemory","withSaveHandler","io","Serializable","getClassName","className","fromConfig","SerializationMap","classNameMap","getMap","serialization","WEBGL_ENVS","HAS_WEBGL","NODE_ENVS","IS_NODE","CHROME_ENVS","IS_CHROME","BROWSER_ENVS","IS_BROWSER","CPU_ENVS","ALL_ENVS","expectArraysClose","areClose","expectPromiseToFail","fail","expectArraysEqual","expectNumbersClose","expectValuesInRange","expectArrayBuffersEqual","toEqual","test_util","version","webgl","Optimizer","minimize","computeGradients","applyGradients","DEFAULT_FLOAT32_EPSILON","DEFAULT_FLOAT16_EPSILON","getOptimizerDefaultEpsilonValue","AdadeltaOptimizer","learningRate","rho","epsilon","accumulatedGrads","accumulatedUpdates","rhoScalar","oneMinusRho","epsilonScalar","getConfig","AdagradOptimizer","initialAccumulatorValue","AdamOptimizer","beta1","beta2","accumulatedFirstMoment","accumulatedSecondMoment","beta1Scalar","beta2Scalar","accBeta1","accBeta2","oneMinusBeta1","oneMinusBeta2","one","epsScalar","AdamaxOptimizer","decay","accumulatedWeightedInfNorm","decayScalar","iteration","SGDOptimizer","setLearningRate","MomentumOptimizer","momentum","useNesterov","accumulations","setMomentum","RMSPropOptimizer","accumulatedMeanSquares","accumulatedMeanGrads","accumulatedMoments","momentumScalar","oneMinusDecay","centered","OptimizerConstructors","sgd","rmsprop","adam","adadelta","adamax","adagrad","train","_epsilon","imageDataFormat","_nextUniqueTensorId","getNextUniqueTensorId","_uidPrefixes","getUid","scalarCache","DEFAULT_DTYPE","getScalar","AttributeError","RuntimeError","ValueError","NotImplementedError","AssertionError","IndexError","pyListRepeat","count","singletonOrArray","toList","toSnakeCase","toLowerCase","toCamelCase","_GLOBAL_CUSTOM_OBJECTS","serializeKerasObject","config","deserializeKerasObject","customObjects","numberCompare","reverseNumberCompare","stringToDType","unique","isObjectEmpty","checkStringTypeUnionValue","checkArrayTypeAndLength","calcL2Norms","Constraint","MaxNorm","defaultMaxValue","defaultAxis","maxValue","axis","UnitNorm","NonNeg","MinMaxNorm","defaultMinValue","defaultRate","minValue","rate","CONSTRAINT_IDENTIFIER_REGISTRY_SYMBOL_MAP","maxNorm","minMaxNorm","nonNeg","unitNorm","serializeConstraint","deserializeConstraint","getConstraint","exports_constraints","nameMap","Map","VALID_DATA_FORMAT_VALUES","checkDataFormat","VALID_PADDING_MODE_VALUES","checkPaddingMode","VALID_POOL_MODE_VALUES","checkPoolMode","_nameScopeStack","_nameScopeDivider","nameScope","currentNameScopePrefix","getScopedTensorName","isValidTensorName","getUniqueTensorName","tensorNameRegex","RegExp","match","isInteger","parseInt","arrayProd","toArray1D","min$1","max$1","cast$1","tile$1","batchFlatten","sliceAlongFirstAxis","sliceAlongLastAxis","sliceAlongAxis","concatenate","concatAlongFirstAxis","randomNormal$1","gather$1","biasAdd","elu$1","softsign","dropout","hardSigmoid","inTrainPhase","VALID_FAN_MODE_VALUES","checkFanMode","VALID_DISTRIBUTION_VALUES","checkDistribution","Initializer","fromConfigUsesCustomObjects","Zeros","Ones","Constant","RandomUniform","DEFAULT_MINVAL","DEFAULT_MAXVAL","minval","maxval","seed","RandomNormal","DEFAULT_MEAN","DEFAULT_STDDEV","stddev","TruncatedNormal","Identity","gain","computeFans","VarianceScaling","mode","distribution","GlorotUniform","GlorotNormal","HeNormal","LeCunNormal","Orthogonal","DEFAULT_GAIN","INITIALIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","constant","glorotNormal","glorotUniform","heNormal","identity","leCunNormal","orthogonal","varianceScaling","deserializeInitializer","serializeInitializer","getInitializer","zeros$1","randomUniform$1","randomNormal$2","truncatedNormal$1","exports_initializers","isArrayOfShapes","normalizeShapeList","getExactlyOneTensor","getExactlyOneShape","countParamsInWeights","DEFAULT_VARIABLE_NAME_PREFIX","LayerVariable","originalName","constraint","val","checkShapesMatch","batchGetValue","batchSetValue","InputSpec","ndim","maxNDim","minNDim","axes","SymbolicTensor","sourceLayer","callArgs","outputTensorIndex","_nextNodeID","Node","outboundLayer","inboundLayers","nodeIndices","tensorIndices","inputTensors","outputTensors","inputMasks","outputMasks","inputShapes","outputShapes","outboundNodes","inboundNodes","_nextLayerID","Layer","_callHook","_addedWeightNames","_stateful","activityRegularizer","inputSpec","supportsMasking","_trainableWeights","_nonTrainableWeights","_losses","_updates","_built","updatable","inputShape","batchInputShape","inputDType","initialWeights","nodeKey","getNodeAtIndex","getInputAt","getOutputAt","calculateLosses","trainableWeights","nonTrainableWeights","assertInputCompatibility","invokeCallHook","setCallHook","clearCallHook","built","build","setWeights","collectInputShape","computeOutputShape","guessOutputDType","warnOnIncompatibleInputShape","addInboundNode","countParams","getWeights","addWeight","addLoss","computeMask","nodeIndex","tensorIndex","getSourceInputs","InputLayer","sparse","Input","batchShape","resolveScalarsInLogs","disposeTensorsInLogs","BaseCallback","validationData","setParams","params","onEpochBegin","onEpochEnd","onBatchBegin","onBatchEnd","onTrainBegin","onTrainEnd","setModel","CallbackList","callbacks","queueLength","BaseLogger","seen","totals","metrics","History","epoch","history","syncData","CustomCallback","trainBegin","trainEnd","epochBegin","epochEnd","batchBegin","batchEnd","standardizeCallbacks","l2Normalize","meanAbsoluteError","meanAbsolutePercentageError","MAX_VALUE","meanSquaredLogarithmicError","squaredHinge","hinge","categoricalHinge","logcosh","categoricalCrossentropy","sparseCategoricalCrossentropy","sigmoidCrossEntropyWithLogits","binaryCrossentropy","kullbackLeiblerDivergence","poisson","cosineProximity","binaryAccuracy","categoricalAccuracy","binaryCrossentropy$1","sparseCategoricalAccuracy","mse$1","MSE$1","mae$1","MAE$1","mape$1","MAPE$1","categoricalCrossentropy$1","cosine$1","sparseCategoricalCrossentropy$1","get$1","mse","MSE","mae","MAE","mape","MAPE","cosine","getOptimizer","Adagrad","Adadelta","Adam","Adamax","RMSProp","SGD","printSummary","isModelSequentialLike","nodesByDepth","printRow","layers","printLayerSummary","printLayerSummaryWithConnections","checkTrainableWeightsConsistency","collectedTrainableWeights","deserialize","isArrayItemInputOrOutputName","convertPythonicToTs","convertTsToPythonic","preprocessWeightsForLoading","loadTensor","loadWeightsFromJson","keras_version","loadWeightsFromNamedTensorMap","Container","containerNodes","outputs","inputLayers","inputLayersNodeIndices","inputLayersTensorIndices","outputLayers","outputLayersNodeIndices","outputLayersTensorIndices","inputNames","outputNames","feedInputShapes","feedInputNames","feedOutputNames","internalInputShapes","internalOutputShapes","layersByDepth","J","Z","Y","Q","ee","te","ne","re","ie","updatedConfig","kerasVersion","toJSON","mask","runInternalGraph","buildNodeConversionMap","getLayer","stateful","assertFeedCompatibility","ModelLoggingVerbosity","FeedDict","id2Value","addFeed","hasKey","getValue","execute","executeInternal","getNodeOutputs","isDataTensor","isDataArray","isDataDict","standardizeInputData","checkArrayLengths","checkLossAndTargetCompatibility","makeBatches","sliceArrays","sliceArraysByIndices","checkInputData","collectMetrics","SILENT","VERBOSE","Model","summary","compile","loss","optimizer","lossFunctions","feedOutputShapes","feedLossFns","metricsNames","metricsTensors","evaluate","standardizeUserData","makeTestFunction","testFunction","testLoop","verbose","steps","checkNumSamples","retrieveSymbolicTensors","predictLoop","predict","predictOnBatch","fitLoop","epochs","initialEpoch","doValidation","stopTraining","batch","getDedupedMetricsNames","fit","validationSplit","validationSteps","training","getNamedWeights","trainableOnly","loadModelInternal","loadModelFromIOHandler","model_config","Sequential","_updatable","model","sequential","loadModel","input","Activation","Elu","Selu","Relu","Relu6","Linear","Sigmoid","HardSigmoid","Softplus","Softsign","Tanh","Softmax","serializeActivation","deserializeActivation","getActivation","LeakyReLU","DEFAULT_ALPHA","ThresholdedReLU","DEFAULT_THETA","theta","thetaTensor","Softmax$1","DEFAULT_AXIS","Regularizer","L1L2","l1","l2","hasL1","hasL2","REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP","l1l2","serializeRegularizer","deserializeRegularizer","getRegularizer","normalizeArray","convOutputLength","deconvLength","preprocessConv2DInput","conv1dWithBias","conv2dWithBias","BaseConv","DEFAULT_KERNEL_INITIALIZER","DEFAULT_BIAS_INITIALIZER","verifyConfig","kernelSize","padding","activation","useBias","biasInitializer","biasConstraint","biasRegularizer","dilationRate","Conv","kernel","filters","kernelInitializer","kernelConstraint","kernelRegularizer","Conv2D","Conv2DTranspose","SeparableConv","DEFAULT_DEPTHWISE_INITIALIZER","DEFAULT_POINTWISE_INITIALIZER","depthwiseKernel","pointwiseKernel","depthMultiplier","depthwiseInitializer","depthwiseRegularizer","depthwiseConstraint","pointwiseInitializer","pointwiseRegularizer","pointwiseConstraint","SeparableConv2D","Conv1D","Cropping2D","cropping","UpSampling2D","DEFAULT_SIZE","depthwiseConv2d$1","DepthwiseConv2D","Dropout","rateScalar","noiseShape","getNoiseShape","Dense","inputDim","units","Flatten","Activation$1","RepeatVector","Reshape","targetShape","isUnknown","fixUnknownDimension","Embedding","embeddings","DEFAULT_EMBEDDINGS_INITIALIZER","inputLength","outputDim","embeddingsInitializer","embeddingsRegularizer","embeddingsConstraint","maskZero","Merge","mergeFunction","computeElementwiseOpOutputShape","reshapeRequired","Add","Multiply","Average","Maximum","Minimum","Concatenate","regularNormalizeBatchInTraining","broadcastNormalizeBatchInTraining","normalizeBatchInTraining","BatchNormalization","center","betaInitializer","gammaInitializer","movingMeanInitializer","movingVarianceInitializer","betaConstraint","gammaConstraint","betaRegularizer","gammaRegularizer","stepCount","gamma","movingMean","movingVariance","spatial2dPadding","ZeroPadding2D","pool2d","Pooling1D","poolSize","poolingFunction","MaxPooling1D","AveragePooling1D","Pooling2D","MaxPooling2D","AveragePooling2D","GlobalPooling1D","GlobalAveragePooling1D","GlobalMaxPooling1D","GlobalPooling2D","GlobalAveragePooling2D","GlobalMaxPooling2D","standardizeArgs","initialState","constants","rnn","RNN","cell","StackedRNNCells","cells","stateSize","returnSequences","returnState","goBackwards","unroll","stateSpec","states","numConstants","getStates","setStates","resetStates","getInitialState","RNNCell","SimpleRNNCell","DEFAULT_ACTIVATION","DEFAULT_RECURRENT_INITIALIZER","recurrentInitializer","recurrentRegularizer","recurrentConstraint","recurrentDropout","dropoutMask","recurrentDropoutMask","recurrentKernel","generateDropoutMask","SimpleRNN","GRUCell","DEFAULT_RECURRENT_ACTIVATION","recurrentActivation","implementation","GRU","implmentation","LSTMCell","unitForgetBias","LSTM","Wrapper","layer","TimeDistributed","VALID_BIDIRECTIONAL_MERGE_MODES","checkBidirectionalMergeMode","Bidirectional","forwardLayer","backwardLayer","mergeMode","_trainable","inputLayer","elu$2","leakyReLU","softmax$1","thresholdedReLU","conv1d$2","conv2d$2","conv2dTranspose$1","separableConv2d$1","cropping2D","upSampling2d","depthwiseConv2d$2","dense","dropout$1","flatten$1","repeatVector","embedding","add$2","average$1","concatenate$2","maximum$2","minimum$2","multiply$1","batchNormalization$1","zeroPadding2d","averagePooling1d","avgPool1d","avgPooling1d","averagePooling2d","avgPool2d","avgPooling2d","globalAveragePooling1d","globalAveragePooling2d","globalMaxPooling1d","globalMaxPooling2d","maxPooling1d","maxPooling2d","gru","gruCell","lstm","lstmCell","simpleRNN","simpleRNNCell","rnn$1","stackedRNNCells","bidirectional","timeDistributed","globalMaxPool1d","globalMaxPool2d","maxPool1d","maxPool2d","exports_layers","average","binaryAccuracy$1","binaryCrossentropy$2","categoricalAccuracy$1","categoricalCrossentropy$2","cosineProximity$1","meanAbsoluteError$1","meanAbsolutePercentageError$1","MAPE$2","mape$2","meanSquaredError$1","MSE$2","mse$2","exports_metrics","l1$1","l2$1","exports_regularizers","Callback","commonjsGlobal","self","punycode","nodeType","overflow","not-basic","invalid-input","RangeError","ucs2","decode","encode","toASCII","toUnicode","util$1","isString","isObject","isNull","isNullOrUndefined","maxKeys","stringifyPrimitive","isFinite","encodeURIComponent","querystring","querystring_1","querystring_2","querystring_3","querystring_4","urlParse","format","urlFormat","Url","protocol","slashes","auth","host","port","hostname","hash","pathname","protocolPattern","portPattern","simplePathPattern","delims","unwise","autoEscape","nonHostChars","hostEndingChars","hostnameMaxLen","hostnamePartPattern","hostnamePartStart","unsafeProtocol","javascript","javascript:","hostlessProtocol","slashedProtocol","http","https","ftp","gopher","file","http:","https:","ftp:","gopher:","file:","parseHost","escape","resolve","resolveObject","aspromise","asPromise","base64_1","eventemitter","EventEmitter","_listeners","on","fn","ctx","off","emit","float_1","factory","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","LN2","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","inquire_1","inquire","moduleName","mod$$1","eval","utf8_1","pool_1","longbits","LongBits","lo","hi","zero","toNumber","zzEncode","zzDecode","zeroHash","fromNumber","minimal","Long","fromString","low","high","toLong","Boolean","unsigned","fromHash","toHash","captureStackTrace","base64","float","utf8","emptyArray","emptyObject","isNode","isset","isSet","utf8Write","_Buffer_from","_Buffer_allocUnsafe","newBuffer","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","merge","lcFirst","newError","ProtocolError","oneOfGetter","oneOfSetter","toJSONOptions","longs","enums","bytes","_configure","allocUnsafe","writer","Writer","BufferWriter","LongBits$1","Op","len","noop","State","head","tail","writeByte","writeVarint32","VarintOp","writeVarint64","writeFixed32","alloc","_push","uint32","sint32","uint64","int64","sint64","fixed32","sfixed32","fixed64","sfixed64","writeBytes","string","fork","ldelim","writer_buffer","BufferWriter$1","writeBytesBuffer","copy","writeStringBuffer","reader","Reader","BufferReader","LongBits$2","utf8$1","indexOutOfRange","pos","buf","create_array","readLongVarint","readFixed32_end","readFixed64","isBuffer","_slice","skip","skipType","reader_buffer","BufferReader$1","utf8Slice","service","Service","rpcImpl","requestDelimited","responseDelimited","rpcCall","end","rpc_1","roots","indexMinimal","rpc","configure","minimal$1","minimal_1","minimal_2","minimal_3","$Reader","$util","$root","default","tensorflow","Any","typeUrl","DataType","TensorShape","dim","unknownRank","Dim","floatVal","doubleVal","intVal","stringVal","scomplexVal","int64Val","boolVal","uint32Val","uint64Val","tensorShape","versionNumber","tensorContent","AttrValue","list","placeholder","func","ListValue","NameAttrList","attr","NodeDef","device","VersionDef","badConsumers","producer","minConsumer","GraphDef","library","FunctionDefLibrary","CollectionDef","nodeList","bytesList","int64List","floatList","anyList","NodeList","BytesList","Int64List","FloatList","AnyList","SaverDef","filenameTensorName","saveTensorName","restoreOpName","maxToKeep","sharded","keepCheckpointEveryNHours","CheckpointFormatVersion","TensorInfo","cooSparse","CooSparse","valuesTensorName","indicesTensorName","denseShapeTensorName","SignatureDef","methodName","AssetFileDef","tensorInfo","filename","OpDef","inputArg","outputArg","deprecation","description","isCommutative","isAggregate","isStateful","allowsUninitializedInput","ArgDef","AttrDef","OpDeprecation","typeAttr","numberAttr","typeListAttr","isRef","defaultValue","hasMinimum","allowedValues","explanation","OpList","MetaGraphDef","collectionDef","signatureDef","assetFileDef","metaInfoDef","graphDef","saverDef","MetaInfoDef","tags","metaGraphVersion","strippedOpList","anyInfo","tensorflowVersion","tensorflowGitVersion","SavedModel","metaGraphs","savedModelSchemaVersion","function","FunctionDef","GradientDef","nodeDef","ret","signature","functionName","gradientFunc","compiled_api","compiled_api_1","getParamValue","inputIndex","getTensor","inputParamLength","parseNodeName","currentContextIds","find","getNodeNameWithContextId","getNodeNameAndIndex","currentContextId","split$1","arithmetic","tfOpName","dlOpName","category","tfInputIndex","dlParamName","tfParamName","notSupported","arithmetic$1","basic_math","basicMath","control","tfInputParamLength","control$1","convolution","convolution$1","creation","creation$1","dynamic","dynamic$1","evaluation","evaluation$1","graph","notSupprted","graph$1","image$1","image$2","logical","logical$1","matrices","matrices$1","normalization","normalization$1","reduction","reduction$1","slice_join","sliceJoin","transformation","tfParamNameDeprecated","transformation$1","CONTROL_FLOW_OPS","DYNAMIC_SHAPE_OPS","OperationMapper","opMappers","_instance","isControlFlow","isDynamicShape","transformGraph","mapNode","children","nodes","placeholders","withControlFlow","withDynamicShape","getStringParam","getNumberParam","getNumericArrayParam","getBoolParam","getTensorShapeParam","getDtypeParam","DT_FLOAT","DT_INT32","DT_BOOL","executeOp","executeOp$1","TensorArray","maxSize","elementShape","identicalElementShapes","dynamicSize","clearAfterRead","tensors","closed_","clearAndClose","cleared","readMany","written","writeMany","scatter","executeOp$2","enterFrame","exitFrame","nextIteration","addTensorArray","getTensorArray","executeOp$3","executeOp$4","_this","executeOp$5","executeOp$6","executeOp$7","executeOp$8","executeOp$9","executeOp$10","executeOp$11","executeOp$12","executeOp$13","executeOp$14","executeOp$15","ExecutionContext","weightMap","tensorArrayMap","rootContext","frameName","iterationId","contexts","lastId","generateCurrentContextIds","newFrame","_currentContextIds","contextIdforContexts","getWeight","GraphExecutor","compiledOrder","_weightMap","_outputs","weightIds","checkInput","checkInputShapeAndType","findOutputs","executeAsync","executeWithControlFlow","currentContext","inputNodes","FrozenModel","modelUrl","weightManifestUrl","requestOption","pathPrefix","getPathPrefix","executor","outputNodes","loadRemoteProtoFile","loadWeightManifest","weightManifest","Instance","convertTensorMapToTensorsMap","constructTensorMap","isControlFlowModel","isDynamicShapeModel","loadFrozenModel","version_core","version_layers","version_converter","version_union"],"mappings":";iMAgBA,IAAIA,cAAcC,OAAOC,iBAAiBC,wBAAwBC,OAAO,SAASC,EAAEC,KAAKH,UAAUG,IAAI,SAASD,EAAEC,OAAO,IAAIC,KAAKD,EAAEA,EAAEE,eAAeD,KAAKF,EAAEE,GAAGD,EAAEC,KAAK,SAASE,UAAUJ,EAAEC,YAAYC,SAASG,YAAYL,gBAAgBA,EAAEC,GAAGD,EAAEM,UAAU,OAAOL,EAAEL,OAAOW,OAAON,IAAIC,EAAEI,UAAUL,EAAEK,UAAU,IAAIJ,OAAOM,SAASZ,OAAOa,QAAQ,SAAST,OAAO,IAAIC,EAAEC,EAAE,EAAEQ,EAAEC,UAAUC,OAAOV,EAAEQ,EAAER,IAAI,IAAI,IAAIW,KAAKZ,EAAEU,UAAUT,GAAGN,OAAOU,UAAUH,eAAeW,KAAKb,EAAEY,KAAKb,EAAEa,GAAGZ,EAAEY,IAAI,OAAOb,GAAG,SAASe,UAAUf,EAAEC,EAAEC,EAAEQ,UAAU,IAAIR,IAAIA,EAAEc,UAAU,SAASH,EAAEI,YAAYC,EAAElB,SAASU,EAAES,KAAKnB,IAAI,MAAMA,KAAKA,aAAaoB,EAAEpB,SAASU,EAAEW,MAAMrB,IAAI,MAAMA,KAAKA,aAAasB,EAAEtB,KAAKu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AAQ9D,MAAMA,EAAEmC,KAAKwxF,mBAAmB3zF,KAAK,EAAEmC,KAAKixF,SAASV,aAAavwF,KAAKuxF,6BAA6B1zF,GAAGC,IAAI,KAAK,SAASgB,EAAEf,EAAE2B,OAAOnB,EAAEd,OAAOqJ,KAAKhI,IAAI,EAAElB,MAAM+D,QAAQ7D,IAAIA,EAAEW,OAAO,EAAEX,EAAEyJ,IAAI,SAAS1J,UAAUiB,EAAEjB,KAAKiB,EAAEP,EAAE,WAAWV,EAAEM,UAAUozF,6BAA6B,SAAS1zF,UAAUJ,OAAOqJ,KAAKjJ,GAAGyjC,OAAO,SAASxjC,EAAEgB,UAAUhB,EAAEgB,IAAIjB,EAAEiB,IAAIhB,QAAQD,EAAEM,UAAU6I,QAAQ,gBAAgBiqF,SAASjqF,WAAWnJ,EAA7qI,GAAkrI,SAAS8zF,gBAAgB9zF,EAAEC,EAAEgB,UAAUF,YAAUoB,UAAK,OAAO,EAAO,eAAezB,EAAE,OAAOiB,cAAYQ,KAAK,SAASjC,UAAUA,EAAE0B,OAAO,KAAK,SAAS,GAAGlB,EAAE,IAAIoyF,YAAY9yF,EAAEC,EAAEgB,IAAIy7C,QAAQ,KAAK,SAASx8C,EAAE2B,QAAQ,EAAEnB,YAAYilD,UAAQ,QCbznvIA,UAAU,SCwBHA,uBACEouC,sBACEC,2BACGC,eACVC"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist/version.d.ts b/node_modules/@tensorflow/tfjs/dist/version.d.ts new file mode 100644 index 0000000..617cee3 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/version.d.ts @@ -0,0 +1,2 @@ +declare const version = "0.12.4"; +export { version }; diff --git a/node_modules/@tensorflow/tfjs/dist/version.js b/node_modules/@tensorflow/tfjs/dist/version.js new file mode 100644 index 0000000..fb2497a --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/version.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var version = '0.12.4'; +exports.version = version; +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/dist/version.js.map b/node_modules/@tensorflow/tfjs/dist/version.js.map new file mode 100644 index 0000000..71e4f86 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/dist/version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAGA,IAAM,OAAO,GAAG,QAAQ,CAAC;AACjB,0BAAO"} \ No newline at end of file diff --git a/node_modules/@tensorflow/tfjs/package.json b/node_modules/@tensorflow/tfjs/package.json new file mode 100644 index 0000000..46c9873 --- /dev/null +++ b/node_modules/@tensorflow/tfjs/package.json @@ -0,0 +1,96 @@ +{ + "_from": "@tensorflow/tfjs", + "_id": "@tensorflow/tfjs@0.12.4", + "_inBundle": false, + "_integrity": "sha512-K/UZ0QyRqs36HWJcrddYz0AGpFtTJgWoIwUjG5041CixoEb3uyKS4ejEjECRdPy6TPFpjnIyYuO4hZMc3ny/Vg==", + "_location": "/@tensorflow/tfjs", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "@tensorflow/tfjs", + "name": "@tensorflow/tfjs", + "escapedName": "@tensorflow%2ftfjs", + "scope": "@tensorflow", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/@tensorflow/tfjs/-/tfjs-0.12.4.tgz", + "_shasum": "dbdcd0389eb68a0974b2b52472ff97e21e664017", + "_spec": "@tensorflow/tfjs", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot", + "bugs": { + "url": "https://github.com/tensorflow/tfjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@tensorflow/tfjs-converter": "0.5.5", + "@tensorflow/tfjs-core": "0.12.8", + "@tensorflow/tfjs-layers": "0.7.2" + }, + "deprecated": false, + "description": "An open-source machine learning framework.", + "devDependencies": { + "@octokit/rest": "15.2.6", + "@types/jasmine": "~2.8.6", + "@types/node": "~9.6.1", + "babel-core": "~6.26.3", + "babel-plugin-external-helpers": "~6.22.0", + "babel-preset-env": "~1.7.0", + "clang-format": "~1.2.2", + "commander": "~2.14.1", + "jasmine": "3.1.0", + "jasmine-core": "~3.1.0", + "karma": "~2.0.0", + "karma-browserstack-launcher": "~1.3.0", + "karma-chrome-launcher": "~2.2.0", + "karma-firefox-launcher": "~1.1.0", + "karma-jasmine": "~1.1.1", + "karma-typescript": "~3.0.12", + "mkdirp": "~0.5.1", + "nodemon": "1.17.3", + "rimraf": "~2.6.2", + "rollup": "~0.58.2", + "rollup-plugin-babel": "~3.0.4", + "rollup-plugin-commonjs": "9.1.3", + "rollup-plugin-json": "~3.0.0", + "rollup-plugin-node-resolve": "3.3.0", + "rollup-plugin-typescript2": "0.13.0", + "rollup-plugin-uglify": "~3.0.0", + "shelljs": "~0.8.1", + "ts-node": "~4.1.0", + "tslint": "~5.9.1", + "typescript": "2.7.2", + "yalc": "~1.0.0-pre.21" + }, + "homepage": "https://github.com/tensorflow/tfjs#readme", + "jsdelivr": "dist/tf.min.js", + "jsnext:main": "dist/tf.esm.js", + "license": "Apache-2.0", + "main": "dist/index", + "module": "dist/tf.esm.js", + "name": "@tensorflow/tfjs", + "private": false, + "repository": { + "type": "git", + "url": "git+https://github.com/tensorflow/tfjs.git" + }, + "scripts": { + "build": "tsc", + "build-npm": "./scripts/build-npm.sh", + "link-local": "yalc link", + "lint": "tslint -p . -t verbose", + "publish-local": "yarn build-npm && yalc push", + "release-notes": "ts-node ./scripts/release_notes/release_notes.ts", + "test": "ts-node ./scripts/release_notes/run_tests.ts && karma start", + "test-travis": "ts-node ./scripts/release_notes/run_tests.ts && karma start --browsers='bs_firefox_mac,bs_chrome_mac' --singleRun" + }, + "types": "dist/index.d.ts", + "unpkg": "dist/tf.min.js", + "version": "0.12.4" +} diff --git a/node_modules/@tensorflow/tfjs/yalc.lock b/node_modules/@tensorflow/tfjs/yalc.lock new file mode 100644 index 0000000..21b9ada --- /dev/null +++ b/node_modules/@tensorflow/tfjs/yalc.lock @@ -0,0 +1,4 @@ +{ + "version": "v1", + "packages": {} +} \ No newline at end of file diff --git a/node_modules/@types/long/LICENSE b/node_modules/@types/long/LICENSE new file mode 100644 index 0000000..2107107 --- /dev/null +++ b/node_modules/@types/long/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/long/README.md b/node_modules/@types/long/README.md new file mode 100644 index 0000000..28c1a1d --- /dev/null +++ b/node_modules/@types/long/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/long` + +# Summary +This package contains type definitions for long.js (https://github.com/dcodeIO/long.js). + +# Details +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/long + +Additional Details + * Last updated: Mon, 21 Aug 2017 21:55:03 GMT + * Dependencies: none + * Global values: Long + +# Credits +These definitions were written by Peter Kooijmans . diff --git a/node_modules/@types/long/index.d.ts b/node_modules/@types/long/index.d.ts new file mode 100644 index 0000000..3fbc027 --- /dev/null +++ b/node_modules/@types/long/index.d.ts @@ -0,0 +1,352 @@ +// Type definitions for long.js 3.0.2 +// Project: https://github.com/dcodeIO/long.js +// Definitions by: Peter Kooijmans +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Definitions by: Denis Cappellin + +export = Long; +export as namespace Long; + +declare namespace Long {} +declare class Long +{ + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. + */ + constructor( low: number, high?: number, unsigned?: boolean ); + + /** + * Maximum unsigned value. + */ + static MAX_UNSIGNED_VALUE: Long; + + /** + * Maximum signed value. + */ + static MAX_VALUE: Long; + + /** + * Minimum signed value. + */ + static MIN_VALUE: Long; + + /** + * Signed negative one. + */ + static NEG_ONE: Long; + + /** + * Signed one. + */ + static ONE: Long; + + /** + * Unsigned one. + */ + static UONE: Long; + + /** + * Unsigned zero. + */ + static UZERO: Long; + + /** + * Signed zero + */ + static ZERO: Long; + + /** + * The high 32 bits as a signed value. + */ + high: number; + + /** + * The low 32 bits as a signed value. + */ + low: number; + + /** + * Whether unsigned or not. + */ + unsigned: boolean; + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + */ + static fromBits( lowBits:number, highBits:number, unsigned?:boolean ): Long; + + /** + * Returns a Long representing the given 32 bit integer value. + */ + static fromInt( value: number, unsigned?: boolean ): Long; + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + */ + static fromNumber( value: number, unsigned?: boolean ): Long; + + /** + * Returns a Long representation of the given string, written using the specified radix. + */ + static fromString( str: string, unsigned?: boolean | number, radix?: number ): Long; + + /** + * Tests if the specified object is a Long. + */ + static isLong( obj: any ): boolean; + + /** + * Converts the specified value to a Long. + */ + static fromValue( val: Long | number | string | {low: number, high: number, unsigned: boolean} ): Long; + + /** + * Returns the sum of this and the specified Long. + */ + add( addend: number | Long | string ): Long; + + /** + * Returns the bitwise AND of this Long and the specified. + */ + and( other: Long | number | string ): Long; + + /** + * Compares this Long's value with the specified's. + */ + compare( other: Long | number | string ): number; + + /** + * Compares this Long's value with the specified's. + */ + comp( other: Long | number | string ): number; + + /** + * Returns this Long divided by the specified. + */ + divide( divisor: Long | number | string ): Long; + + /** + * Returns this Long divided by the specified. + */ + div( divisor: Long | number | string ): Long; + + /** + * Tests if this Long's value equals the specified's. + */ + equals( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value equals the specified's. + */ + eq( other: Long | number | string ): boolean; + + /** + * Gets the high 32 bits as a signed integer. + */ + getHighBits(): number; + + /** + * Gets the high 32 bits as an unsigned integer. + */ + getHighBitsUnsigned(): number; + + /** + * Gets the low 32 bits as a signed integer. + */ + getLowBits(): number; + + /** + * Gets the low 32 bits as an unsigned integer. + */ + getLowBitsUnsigned(): number; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + */ + getNumBitsAbs(): number; + + /** + * Tests if this Long's value is greater than the specified's. + */ + greaterThan( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than the specified's. + */ + gt( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + greaterThanOrEqual( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + gte( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is even. + */ + isEven(): boolean; + + /** + * Tests if this Long's value is negative. + */ + isNegative(): boolean; + + /** + * Tests if this Long's value is odd. + */ + isOdd(): boolean; + + /** + * Tests if this Long's value is positive. + */ + isPositive(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + isZero(): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lessThan( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lt( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lessThanOrEqual( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lte( other: Long | number | string ): boolean; + + /** + * Returns this Long modulo the specified. + */ + modulo( other: Long | number | string ): Long; + + /** + * Returns this Long modulo the specified. + */ + mod( other: Long | number | string ): Long; + + /** + * Returns the product of this and the specified Long. + */ + multiply( multiplier: Long | number | string ): Long; + + /** + * Returns the product of this and the specified Long. + */ + mul( multiplier: Long | number | string ): Long; + + /** + * Negates this Long's value. + */ + negate(): Long; + + /** + * Negates this Long's value. + */ + neg(): Long; + + /** + * Returns the bitwise NOT of this Long. + */ + not(): Long; + + /** + * Tests if this Long's value differs from the specified's. + */ + notEquals( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + neq( other: Long | number | string ): boolean; + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or( other: Long | number | string ): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shiftLeft( numBits: number | Long ): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shl( numBits: number | Long ): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shiftRight( numBits: number | Long ): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shr( numBits: number | Long ): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shiftRightUnsigned( numBits: number | Long ): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shru( numBits: number | Long ): Long; + + /** + * Returns the difference of this and the specified Long. + */ + subtract( subtrahend: number | Long | string ): Long; + + /** + * Returns the difference of this and the specified Long. + */ + sub( subtrahend: number | Long |string ): Long; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + */ + toInt(): number; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + */ + toNumber(): number; + + /** + * Converts this Long to signed. + */ + toSigned(): Long; + + /** + * Converts the Long to a string written in the specified radix. + */ + toString( radix?: number ): string; + + /** + * Converts this Long to unsigned. + */ + toUnsigned(): Long; + + /** + * Returns the bitwise XOR of this Long and the given one. + */ + xor( other: Long | number | string ): Long; +} diff --git a/node_modules/@types/long/package.json b/node_modules/@types/long/package.json new file mode 100644 index 0000000..8bf25df --- /dev/null +++ b/node_modules/@types/long/package.json @@ -0,0 +1,47 @@ +{ + "_from": "@types/long@~3.0.32", + "_id": "@types/long@3.0.32", + "_inBundle": false, + "_integrity": "sha512-ZXyOOm83p7X8p3s0IYM3VeueNmHpkk/yMlP8CLeOnEcu6hIwPH7YjZBvhQkR0ZFS2DqZAxKtJ/M5fcuv3OU5BA==", + "_location": "/@types/long", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@types/long@~3.0.32", + "name": "@types/long", + "escapedName": "@types%2flong", + "scope": "@types", + "rawSpec": "~3.0.32", + "saveSpec": null, + "fetchSpec": "~3.0.32" + }, + "_requiredBy": [ + "/@tensorflow/tfjs-converter" + ], + "_resolved": "https://registry.npmjs.org/@types/long/-/long-3.0.32.tgz", + "_shasum": "f4e5af31e9e9b196d8e5fca8a5e2e20aa3d60b69", + "_spec": "@types/long@~3.0.32", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs-converter", + "bundleDependencies": false, + "contributors": [ + { + "name": "Peter Kooijmans", + "url": "https://github.com/peterkooijmans" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "TypeScript definitions for long.js", + "license": "MIT", + "main": "", + "name": "@types/long", + "repository": { + "type": "git", + "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "typeScriptVersion": "2.0", + "typesPublisherContentHash": "26c346715f4bbe747a7eddec4134408618814ef4340646fcbac955fcdb491a4c", + "version": "3.0.32" +} diff --git a/node_modules/@types/seedrandom/README.md b/node_modules/@types/seedrandom/README.md new file mode 100644 index 0000000..a572b31 --- /dev/null +++ b/node_modules/@types/seedrandom/README.md @@ -0,0 +1,18 @@ +# Installation +> `npm install --save @types/seedrandom` + +# Summary +This package contains type definitions for seedrandom 2.4.2 (https://github.com/davidbau/seedrandom). + +# Details +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/seedrandom + +Additional Details + * Last updated: Mon, 19 Sep 2016 17:28:59 GMT + * File structure: UMD + * Library Dependencies: none + * Module Dependencies: none + * Global values: seedrandom + +# Credits +These definitions were written by Kern Handa . diff --git a/node_modules/@types/seedrandom/index.d.ts b/node_modules/@types/seedrandom/index.d.ts new file mode 100644 index 0000000..4db5005 --- /dev/null +++ b/node_modules/@types/seedrandom/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for seedrandom 2.4.2 +// Project: https://github.com/davidbau/seedrandom +// Definitions by: Kern Handa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace seedrandom { + + export type seedrandomStateType = boolean | (() => prng); + + interface prng { + new (seed?: string, options?: seedRandomOptions, callback?: any): prng; + (): number; + quick(): number; + int32(): number; + double(): number; + state(): () => prng; + } + + interface seedrandom_prng { + (seed?: string, options?: seedRandomOptions, callback?: any): prng; + alea: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + xor128: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + tychei: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + xorwow: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + xor4096: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + xorshift7: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + quick: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + } + + interface seedrandomCallback { + (prng?: prng, shortseed?: string, global?: boolean, state?: seedrandomStateType): prng; + } + + interface seedRandomOptions { + entropy?: boolean; + 'global'?: boolean; + state?: seedrandomStateType; + pass?: seedrandomCallback; + } +} + +declare var seedrandom: seedrandom.seedrandom_prng; + +export = seedrandom; +export as namespace seedrandom; diff --git a/node_modules/@types/seedrandom/package.json b/node_modules/@types/seedrandom/package.json new file mode 100644 index 0000000..6e0c98b --- /dev/null +++ b/node_modules/@types/seedrandom/package.json @@ -0,0 +1,45 @@ +{ + "_from": "@types/seedrandom@~2.4.27", + "_id": "@types/seedrandom@2.4.27", + "_inBundle": false, + "_integrity": "sha1-nbVjk33YaRX2kJK8QyWdL0hXjkE=", + "_location": "/@types/seedrandom", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@types/seedrandom@~2.4.27", + "name": "@types/seedrandom", + "escapedName": "@types%2fseedrandom", + "scope": "@types", + "rawSpec": "~2.4.27", + "saveSpec": null, + "fetchSpec": "~2.4.27" + }, + "_requiredBy": [ + "/@tensorflow/tfjs-core" + ], + "_resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.27.tgz", + "_shasum": "9db563937dd86915f69092bc43259d2f48578e41", + "_spec": "@types/seedrandom@~2.4.27", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs-core", + "author": { + "name": "Kern Handa", + "email": "https://github.com/kernhanda" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "TypeScript definitions for seedrandom 2.4.2", + "license": "MIT", + "main": "", + "name": "@types/seedrandom", + "repository": { + "type": "git", + "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "typesPublisherContentHash": "6ad69483683964e97254f65e374a17f845154a74df41e5bf3ea0d53ec1b70e19", + "typings": "index.d.ts", + "version": "2.4.27" +} diff --git a/node_modules/@types/seedrandom/types-metadata.json b/node_modules/@types/seedrandom/types-metadata.json new file mode 100644 index 0000000..22b3620 --- /dev/null +++ b/node_modules/@types/seedrandom/types-metadata.json @@ -0,0 +1,23 @@ +{ + "authors": "Kern Handa ", + "definitionFilename": "index.d.ts", + "libraryDependencies": [], + "moduleDependencies": [], + "libraryMajorVersion": "2", + "libraryMinorVersion": "4", + "libraryName": "seedrandom 2.4.2", + "typingsPackageName": "seedrandom", + "projectName": "https://github.com/davidbau/seedrandom", + "sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped", + "sourceBranch": "types-2.0", + "kind": "UMD", + "globals": [ + "seedrandom" + ], + "declaredModules": [], + "files": [ + "index.d.ts" + ], + "hasPackageJson": false, + "contentHash": "6ad69483683964e97254f65e374a17f845154a74df41e5bf3ea0d53ec1b70e19" +} \ No newline at end of file diff --git a/node_modules/@types/webgl-ext/LICENSE b/node_modules/@types/webgl-ext/LICENSE new file mode 100644 index 0000000..2107107 --- /dev/null +++ b/node_modules/@types/webgl-ext/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/webgl-ext/README.md b/node_modules/@types/webgl-ext/README.md new file mode 100644 index 0000000..0f4b46f --- /dev/null +++ b/node_modules/@types/webgl-ext/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/webgl-ext` + +# Summary +This package contains type definitions for WebGL Extensions (http://webgl.org/). + +# Details +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webgl-ext + +Additional Details + * Last updated: Mon, 21 Aug 2017 22:03:22 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by Arthur Langereis . diff --git a/node_modules/@types/webgl-ext/index.d.ts b/node_modules/@types/webgl-ext/index.d.ts new file mode 100644 index 0000000..3f0da0c --- /dev/null +++ b/node_modules/@types/webgl-ext/index.d.ts @@ -0,0 +1,214 @@ +// Type definitions for WebGL Extensions +// Project: http://webgl.org/ +// Definitions by: Arthur Langereis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/webgl-ext + +// These definitions go beyond those already defined in TS 1.6.2 stdlib +// All non-draft WebGL 1.0 extensions and prefixed extension names are +// covered. + +interface HTMLCanvasElement { + getContext(contextId: "webgl"): WebGLRenderingContext; +} + +interface WebGLRenderingContext { + getExtension(name: "ANGLE_instanced_arrays"): ANGLEInstancedArrays; + + getExtension(name: "EXT_blend_minmax"): EXTBlendMinMax; + getExtension(name: "EXT_color_buffer_half_float"): EXTColorBufferHalfFloat; + getExtension(name: "EXT_frag_depth"): EXTFragDepth; + getExtension(name: "EXT_sRGB"): EXTsRGB; + getExtension(name: "EXT_shader_texture_lod"): EXTShaderTextureLOD; + getExtension(name: "EXT_texture_filter_anisotropic"): EXTTextureFilterAnisotropic; + + getExtension(name: "OES_element_index_uint"): OESElementIndexUint; + getExtension(name: "OES_standard_derivatives"): OESStandardDerivatives; + getExtension(name: "OES_texture_float"): OESTextureFloat; + getExtension(name: "OES_texture_float_linear"): OESTextureFloatLinear; + getExtension(name: "OES_texture_half_float"): OESTextureHalfFloat; + getExtension(name: "OES_texture_half_float_linear"): OESTextureHalfFloatLinear; + getExtension(name: "OES_vertex_array_object"): OESVertexArrayObject; + + getExtension(name: "WEBGL_color_buffer_float"): WebGLColorBufferFloat; + getExtension(name: "WEBGL_compressed_texture_atc"): WebGLCompressedTextureATC; + getExtension(name: "WEBGL_compressed_texture_etc1"): WebGLCompressedTextureETC1; + getExtension(name: "WEBGL_compressed_texture_pvrtc"): WebGLCompressedTexturePVRTC; + getExtension(name: "WEBGL_compressed_texture_s3tc"): WebGLCompressedTextureS3TC; + getExtension(name: "WEBGL_debug_renderer_info"): WebGLDebugRendererInfo; + getExtension(name: "WEBGL_debug_shaders"): WebGLDebugShaders; + getExtension(name: "WEBGL_depth_texture"): WebGLDepthTexture; + getExtension(name: "WEBGL_draw_buffers"): WebGLDrawBuffers; + getExtension(name: "WEBGL_lose_context"): WebGLLoseContext; + + // Prefixed versions appearing in the wild as per September 2015 + + getExtension(name: "WEBKIT_EXT_texture_filter_anisotropic"): EXTTextureFilterAnisotropic; + getExtension(name: "WEBKIT_WEBGL_compressed_texture_atc"): WebGLCompressedTextureATC; + getExtension(name: "WEBKIT_WEBGL_compressed_texture_pvrtc"): WebGLCompressedTexturePVRTC; + getExtension(name: "WEBKIT_WEBGL_compressed_texture_s3tc"): WebGLCompressedTextureS3TC; + getExtension(name: "WEBKIT_WEBGL_depth_texture"): WebGLDepthTexture; + getExtension(name: "WEBKIT_WEBGL_lose_context"): WebGLLoseContext; + + getExtension(name: "MOZ_WEBGL_compressed_texture_s3tc"): WebGLCompressedTextureS3TC; + getExtension(name: "MOZ_WEBGL_depth_texture"): WebGLDepthTexture; + getExtension(name: "MOZ_WEBGL_lose_context"): WebGLLoseContext; +} + +interface ANGLEInstancedArrays { + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; + + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; +} + +interface EXTBlendMinMax { + MIN_EXT: number; + MAX_EXT: number; +} + +interface EXTColorBufferHalfFloat { + RGBA16F_EXT: number; + RGB16F_EXT: number; + FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number; + UNSIGNED_NORMALIZED_EXT: number; +} + +interface EXTFragDepth { +} + +interface EXTsRGB { + SRGB_EXT: number; + SRGB_ALPHA_EXT: number; + SRGB8_ALPHA8_EXT: number; + FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; +} + +interface EXTShaderTextureLOD { +} + +interface EXTTextureFilterAnisotropic { + TEXTURE_MAX_ANISOTROPY_EXT: number; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface OESElementIndexUint { +} + +interface OESStandardDerivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OESTextureFloat { +} + +interface OESTextureFloatLinear { +} + +interface OESTextureHalfFloat { + HALF_FLOAT_OES: number; +} + +interface OESTextureHalfFloatLinear { +} + +interface WebGLVertexArrayObjectOES extends WebGLObject { +} + +interface OESVertexArrayObject { + VERTEX_ARRAY_BINDING_OES: number; + + createVertexArrayOES(): WebGLVertexArrayObjectOES | null; + deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void; + isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): boolean; + bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void; +} + +interface WebGLColorBufferFloat { + RGBA32F_EXT: number; + FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number; + UNSIGNED_NORMALIZED_EXT: number; +} + +interface WebGLCompressedTextureATC { + COMPRESSED_RGB_ATC_WEBGL: number; + COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: number; + COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: number; +} + +interface WebGLCompressedTextureETC1 { + COMPRESSED_RGB_ETC1_WEBGL: number; +} + +interface WebGLCompressedTexturePVRTC { + COMPRESSED_RGB_PVRTC_4BPPV1_IMG: number; + COMPRESSED_RGB_PVRTC_2BPPV1_IMG: number; + COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: number; + COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: number; +} + +interface WebGLCompressedTextureS3TC { + COMPRESSED_RGB_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; +} + +interface WebGLDebugRendererInfo { + UNMASKED_VENDOR_WEBGL: number; + UNMASKED_RENDERER_WEBGL: number; +} + +interface WebGLDebugShaders { + getTranslatedShaderSource(shader: WebGLShader): string; +} + +interface WebGLDepthTexture { + UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WebGLDrawBuffers { + COLOR_ATTACHMENT0_WEBGL: number; + COLOR_ATTACHMENT1_WEBGL: number; + COLOR_ATTACHMENT2_WEBGL: number; + COLOR_ATTACHMENT3_WEBGL: number; + COLOR_ATTACHMENT4_WEBGL: number; + COLOR_ATTACHMENT5_WEBGL: number; + COLOR_ATTACHMENT6_WEBGL: number; + COLOR_ATTACHMENT7_WEBGL: number; + COLOR_ATTACHMENT8_WEBGL: number; + COLOR_ATTACHMENT9_WEBGL: number; + COLOR_ATTACHMENT10_WEBGL: number; + COLOR_ATTACHMENT11_WEBGL: number; + COLOR_ATTACHMENT12_WEBGL: number; + COLOR_ATTACHMENT13_WEBGL: number; + COLOR_ATTACHMENT14_WEBGL: number; + COLOR_ATTACHMENT15_WEBGL: number; + + DRAW_BUFFER0_WEBGL: number; + DRAW_BUFFER1_WEBGL: number; + DRAW_BUFFER2_WEBGL: number; + DRAW_BUFFER3_WEBGL: number; + DRAW_BUFFER4_WEBGL: number; + DRAW_BUFFER5_WEBGL: number; + DRAW_BUFFER6_WEBGL: number; + DRAW_BUFFER7_WEBGL: number; + DRAW_BUFFER8_WEBGL: number; + DRAW_BUFFER9_WEBGL: number; + DRAW_BUFFER10_WEBGL: number; + DRAW_BUFFER11_WEBGL: number; + DRAW_BUFFER12_WEBGL: number; + DRAW_BUFFER13_WEBGL: number; + DRAW_BUFFER14_WEBGL: number; + DRAW_BUFFER15_WEBGL: number; + + MAX_COLOR_ATTACHMENTS_WEBGL: number; + MAX_DRAW_BUFFERS_WEBGL: number; + + drawBuffersWEBGL(buffers: number[]): void; +} + +interface WebGLLoseContext { + loseContext(): void; + restoreContext(): void; +} diff --git a/node_modules/@types/webgl-ext/package.json b/node_modules/@types/webgl-ext/package.json new file mode 100644 index 0000000..5bdd20c --- /dev/null +++ b/node_modules/@types/webgl-ext/package.json @@ -0,0 +1,47 @@ +{ + "_from": "@types/webgl-ext@~0.0.29", + "_id": "@types/webgl-ext@0.0.29", + "_inBundle": false, + "_integrity": "sha512-ZlVjDQU5Vlc9hF4LGdDldujZUf0amwlwGv1RI2bfvdrEHIl6X/7MZVpemJUjS7NxD9XaKfE8SlFrxsfXpUkt/A==", + "_location": "/@types/webgl-ext", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@types/webgl-ext@~0.0.29", + "name": "@types/webgl-ext", + "escapedName": "@types%2fwebgl-ext", + "scope": "@types", + "rawSpec": "~0.0.29", + "saveSpec": null, + "fetchSpec": "~0.0.29" + }, + "_requiredBy": [ + "/@tensorflow/tfjs-core" + ], + "_resolved": "https://registry.npmjs.org/@types/webgl-ext/-/webgl-ext-0.0.29.tgz", + "_shasum": "4d479baf1124795f53d54bdc85b386e0f194d90a", + "_spec": "@types/webgl-ext@~0.0.29", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs-core", + "bundleDependencies": false, + "contributors": [ + { + "name": "Arthur Langereis", + "url": "https://github.com/zenmumbler" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "TypeScript definitions for WebGL Extensions", + "license": "MIT", + "main": "", + "name": "@types/webgl-ext", + "repository": { + "type": "git", + "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "typeScriptVersion": "2.0", + "typesPublisherContentHash": "afb36c8f21fbfaba3c3ee3d8f36d359b5bd35095ad28dac7c3ae77940da351ae", + "version": "0.0.29" +} diff --git a/node_modules/@types/webgl2/LICENSE b/node_modules/@types/webgl2/LICENSE new file mode 100644 index 0000000..2107107 --- /dev/null +++ b/node_modules/@types/webgl2/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/webgl2/README.md b/node_modules/@types/webgl2/README.md new file mode 100644 index 0000000..b632484 --- /dev/null +++ b/node_modules/@types/webgl2/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/webgl2` + +# Summary +This package contains type definitions for WebGL 2, Editor's Draft Fri Feb 24 16:10:18 2017 -0800 (https://www.khronos.org/registry/webgl/specs/latest/2.0/). + +# Details +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webgl2 + +Additional Details + * Last updated: Thu, 26 Apr 2018 22:15:55 GMT + * Dependencies: none + * Global values: WebGL2RenderingContext, WebGLQuery, WebGLSampler, WebGLSync, WebGLTransformFeedback, WebGLVertexArrayObject + +# Credits +These definitions were written by Nico Kemnitz , Adrian Blumer . diff --git a/node_modules/@types/webgl2/index.d.ts b/node_modules/@types/webgl2/index.d.ts new file mode 100644 index 0000000..a18d509 --- /dev/null +++ b/node_modules/@types/webgl2/index.d.ts @@ -0,0 +1,1194 @@ +// Type definitions for WebGL 2, Editor's Draft Fri Feb 24 16:10:18 2017 -0800 +// Project: https://www.khronos.org/registry/webgl/specs/latest/2.0/ +// Definitions by: Nico Kemnitz +// Adrian Blumer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface HTMLCanvasElement extends HTMLElement { + getContext(contextId: "webgl2" | "experimental-webgl2", contextAttributes?: WebGLContextAttributes): WebGL2RenderingContext | null; +} + +interface ImageBitmap { + readonly width: number; + readonly height: number; + close(): void; +} + +interface WebGL2RenderingContext extends WebGLRenderingContext { + readonly READ_BUFFER: number; // 0x0C02 + readonly UNPACK_ROW_LENGTH: number; // 0x0CF2 + readonly UNPACK_SKIP_ROWS: number; // 0x0CF3 + readonly UNPACK_SKIP_PIXELS: number; // 0x0CF4 + readonly PACK_ROW_LENGTH: number; // 0x0D02 + readonly PACK_SKIP_ROWS: number; // 0x0D03 + readonly PACK_SKIP_PIXELS: number; // 0x0D04 + readonly COLOR: number; // 0x1800 + readonly DEPTH: number; // 0x1801 + readonly STENCIL: number; // 0x1802 + readonly RED: number; // 0x1903 + readonly RGB8: number; // 0x8051 + readonly RGBA8: number; // 0x8058 + readonly RGB10_A2: number; // 0x8059 + readonly TEXTURE_BINDING_3D: number; // 0x806A + readonly UNPACK_SKIP_IMAGES: number; // 0x806D + readonly UNPACK_IMAGE_HEIGHT: number; // 0x806E + readonly TEXTURE_3D: number; // 0x806F + readonly TEXTURE_WRAP_R: number; // 0x8072 + readonly MAX_3D_TEXTURE_SIZE: number; // 0x8073 + readonly UNSIGNED_INT_2_10_10_10_REV: number; // 0x8368 + readonly MAX_ELEMENTS_VERTICES: number; // 0x80E8 + readonly MAX_ELEMENTS_INDICES: number; // 0x80E9 + readonly TEXTURE_MIN_LOD: number; // 0x813A + readonly TEXTURE_MAX_LOD: number; // 0x813B + readonly TEXTURE_BASE_LEVEL: number; // 0x813C + readonly TEXTURE_MAX_LEVEL: number; // 0x813D + readonly MIN: number; // 0x8007 + readonly MAX: number; // 0x8008 + readonly DEPTH_COMPONENT24: number; // 0x81A6 + readonly MAX_TEXTURE_LOD_BIAS: number; // 0x84FD + readonly TEXTURE_COMPARE_MODE: number; // 0x884C + readonly TEXTURE_COMPARE_FUNC: number; // 0x884D + readonly CURRENT_QUERY: number; // 0x8865 + readonly QUERY_RESULT: number; // 0x8866 + readonly QUERY_RESULT_AVAILABLE: number; // 0x8867 + readonly STREAM_READ: number; // 0x88E1 + readonly STREAM_COPY: number; // 0x88E2 + readonly STATIC_READ: number; // 0x88E5 + readonly STATIC_COPY: number; // 0x88E6 + readonly DYNAMIC_READ: number; // 0x88E9 + readonly DYNAMIC_COPY: number; // 0x88EA + readonly MAX_DRAW_BUFFERS: number; // 0x8824 + readonly DRAW_BUFFER0: number; // 0x8825 + readonly DRAW_BUFFER1: number; // 0x8826 + readonly DRAW_BUFFER2: number; // 0x8827 + readonly DRAW_BUFFER3: number; // 0x8828 + readonly DRAW_BUFFER4: number; // 0x8829 + readonly DRAW_BUFFER5: number; // 0x882A + readonly DRAW_BUFFER6: number; // 0x882B + readonly DRAW_BUFFER7: number; // 0x882C + readonly DRAW_BUFFER8: number; // 0x882D + readonly DRAW_BUFFER9: number; // 0x882E + readonly DRAW_BUFFER10: number; // 0x882F + readonly DRAW_BUFFER11: number; // 0x8830 + readonly DRAW_BUFFER12: number; // 0x8831 + readonly DRAW_BUFFER13: number; // 0x8832 + readonly DRAW_BUFFER14: number; // 0x8833 + readonly DRAW_BUFFER15: number; // 0x8834 + readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: number; // 0x8B49 + readonly MAX_VERTEX_UNIFORM_COMPONENTS: number; // 0x8B4A + readonly SAMPLER_3D: number; // 0x8B5F + readonly SAMPLER_2D_SHADOW: number; // 0x8B62 + readonly FRAGMENT_SHADER_DERIVATIVE_HINT: number; // 0x8B8B + readonly PIXEL_PACK_BUFFER: number; // 0x88EB + readonly PIXEL_UNPACK_BUFFER: number; // 0x88EC + readonly PIXEL_PACK_BUFFER_BINDING: number; // 0x88ED + readonly PIXEL_UNPACK_BUFFER_BINDING: number; // 0x88EF + readonly FLOAT_MAT2x3: number; // 0x8B65 + readonly FLOAT_MAT2x4: number; // 0x8B66 + readonly FLOAT_MAT3x2: number; // 0x8B67 + readonly FLOAT_MAT3x4: number; // 0x8B68 + readonly FLOAT_MAT4x2: number; // 0x8B69 + readonly FLOAT_MAT4x3: number; // 0x8B6A + readonly SRGB: number; // 0x8C40 + readonly SRGB8: number; // 0x8C41 + readonly SRGB8_ALPHA8: number; // 0x8C43 + readonly COMPARE_REF_TO_TEXTURE: number; // 0x884E + readonly RGBA32F: number; // 0x8814 + readonly RGB32F: number; // 0x8815 + readonly RGBA16F: number; // 0x881A + readonly RGB16F: number; // 0x881B + readonly VERTEX_ATTRIB_ARRAY_INTEGER: number; // 0x88FD + readonly MAX_ARRAY_TEXTURE_LAYERS: number; // 0x88FF + readonly MIN_PROGRAM_TEXEL_OFFSET: number; // 0x8904 + readonly MAX_PROGRAM_TEXEL_OFFSET: number; // 0x8905 + readonly MAX_VARYING_COMPONENTS: number; // 0x8B4B + readonly TEXTURE_2D_ARRAY: number; // 0x8C1A + readonly TEXTURE_BINDING_2D_ARRAY: number; // 0x8C1D + readonly R11F_G11F_B10F: number; // 0x8C3A + readonly UNSIGNED_INT_10F_11F_11F_REV: number; // 0x8C3B + readonly RGB9_E5: number; // 0x8C3D + readonly UNSIGNED_INT_5_9_9_9_REV: number; // 0x8C3E + readonly TRANSFORM_FEEDBACK_BUFFER_MODE: number; // 0x8C7F + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: number; // 0x8C80 + readonly TRANSFORM_FEEDBACK_VARYINGS: number; // 0x8C83 + readonly TRANSFORM_FEEDBACK_BUFFER_START: number; // 0x8C84 + readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: number; // 0x8C85 + readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: number; // 0x8C88 + readonly RASTERIZER_DISCARD: number; // 0x8C89 + readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: number; // 0x8C8A + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: number; // 0x8C8B + readonly INTERLEAVED_ATTRIBS: number; // 0x8C8C + readonly SEPARATE_ATTRIBS: number; // 0x8C8D + readonly TRANSFORM_FEEDBACK_BUFFER: number; // 0x8C8E + readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: number; // 0x8C8F + readonly RGBA32UI: number; // 0x8D70 + readonly RGB32UI: number; // 0x8D71 + readonly RGBA16UI: number; // 0x8D76 + readonly RGB16UI: number; // 0x8D77 + readonly RGBA8UI: number; // 0x8D7C + readonly RGB8UI: number; // 0x8D7D + readonly RGBA32I: number; // 0x8D82 + readonly RGB32I: number; // 0x8D83 + readonly RGBA16I: number; // 0x8D88 + readonly RGB16I: number; // 0x8D89 + readonly RGBA8I: number; // 0x8D8E + readonly RGB8I: number; // 0x8D8F + readonly RED_INTEGER: number; // 0x8D94 + readonly RGB_INTEGER: number; // 0x8D98 + readonly RGBA_INTEGER: number; // 0x8D99 + readonly SAMPLER_2D_ARRAY: number; // 0x8DC1 + readonly SAMPLER_2D_ARRAY_SHADOW: number; // 0x8DC4 + readonly SAMPLER_CUBE_SHADOW: number; // 0x8DC5 + readonly UNSIGNED_INT_VEC2: number; // 0x8DC6 + readonly UNSIGNED_INT_VEC3: number; // 0x8DC7 + readonly UNSIGNED_INT_VEC4: number; // 0x8DC8 + readonly INT_SAMPLER_2D: number; // 0x8DCA + readonly INT_SAMPLER_3D: number; // 0x8DCB + readonly INT_SAMPLER_CUBE: number; // 0x8DCC + readonly INT_SAMPLER_2D_ARRAY: number; // 0x8DCF + readonly UNSIGNED_INT_SAMPLER_2D: number; // 0x8DD2 + readonly UNSIGNED_INT_SAMPLER_3D: number; // 0x8DD3 + readonly UNSIGNED_INT_SAMPLER_CUBE: number; // 0x8DD4 + readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: number; // 0x8DD7 + readonly DEPTH_COMPONENT32F: number; // 0x8CAC + readonly DEPTH32F_STENCIL8: number; // 0x8CAD + readonly FLOAT_32_UNSIGNED_INT_24_8_REV: number; // 0x8DAD + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: number; // 0x8210 + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: number; // 0x8211 + readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: number; // 0x8212 + readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: number; // 0x8213 + readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: number; // 0x8214 + readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: number; // 0x8215 + readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: number; // 0x8216 + readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: number; // 0x8217 + readonly FRAMEBUFFER_DEFAULT: number; // 0x8218 + //readonly DEPTH_STENCIL_ATTACHMENT: number; // 0x821A /* Already defined in WebGL1 constants */ + //readonly DEPTH_STENCIL: number; // 0x84F9 /* Already defined in WebGL1 constants */ + readonly UNSIGNED_INT_24_8: number; // 0x84FA + readonly DEPTH24_STENCIL8: number; // 0x88F0 + readonly UNSIGNED_NORMALIZED: number; // 0x8C17 + readonly DRAW_FRAMEBUFFER_BINDING: number; // 0x8CA6 /* Same as FRAMEBUFFER_BINDING */ + readonly READ_FRAMEBUFFER: number; // 0x8CA8 + readonly DRAW_FRAMEBUFFER: number; // 0x8CA9 + readonly READ_FRAMEBUFFER_BINDING: number; // 0x8CAA + readonly RENDERBUFFER_SAMPLES: number; // 0x8CAB + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: number; // 0x8CD4 + readonly MAX_COLOR_ATTACHMENTS: number; // 0x8CDF + readonly COLOR_ATTACHMENT1: number; // 0x8CE1 + readonly COLOR_ATTACHMENT2: number; // 0x8CE2 + readonly COLOR_ATTACHMENT3: number; // 0x8CE3 + readonly COLOR_ATTACHMENT4: number; // 0x8CE4 + readonly COLOR_ATTACHMENT5: number; // 0x8CE5 + readonly COLOR_ATTACHMENT6: number; // 0x8CE6 + readonly COLOR_ATTACHMENT7: number; // 0x8CE7 + readonly COLOR_ATTACHMENT8: number; // 0x8CE8 + readonly COLOR_ATTACHMENT9: number; // 0x8CE9 + readonly COLOR_ATTACHMENT10: number; // 0x8CEA + readonly COLOR_ATTACHMENT11: number; // 0x8CEB + readonly COLOR_ATTACHMENT12: number; // 0x8CEC + readonly COLOR_ATTACHMENT13: number; // 0x8CED + readonly COLOR_ATTACHMENT14: number; // 0x8CEE + readonly COLOR_ATTACHMENT15: number; // 0x8CEF + readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: number; // 0x8D56 + readonly MAX_SAMPLES: number; // 0x8D57 + readonly HALF_FLOAT: number; // 0x140B + readonly RG: number; // 0x8227 + readonly RG_INTEGER: number; // 0x8228 + readonly R8: number; // 0x8229 + readonly RG8: number; // 0x822B + readonly R16F: number; // 0x822D + readonly R32F: number; // 0x822E + readonly RG16F: number; // 0x822F + readonly RG32F: number; // 0x8230 + readonly R8I: number; // 0x8231 + readonly R8UI: number; // 0x8232 + readonly R16I: number; // 0x8233 + readonly R16UI: number; // 0x8234 + readonly R32I: number; // 0x8235 + readonly R32UI: number; // 0x8236 + readonly RG8I: number; // 0x8237 + readonly RG8UI: number; // 0x8238 + readonly RG16I: number; // 0x8239 + readonly RG16UI: number; // 0x823A + readonly RG32I: number; // 0x823B + readonly RG32UI: number; // 0x823C + readonly VERTEX_ARRAY_BINDING: number; // 0x85B5 + readonly R8_SNORM: number; // 0x8F94 + readonly RG8_SNORM: number; // 0x8F95 + readonly RGB8_SNORM: number; // 0x8F96 + readonly RGBA8_SNORM: number; // 0x8F97 + readonly SIGNED_NORMALIZED: number; // 0x8F9C + readonly COPY_READ_BUFFER: number; // 0x8F36 + readonly COPY_WRITE_BUFFER: number; // 0x8F37 + readonly COPY_READ_BUFFER_BINDING: number; // 0x8F36 /* Same as COPY_READ_BUFFER */ + readonly COPY_WRITE_BUFFER_BINDING: number; // 0x8F37 /* Same as COPY_WRITE_BUFFER */ + readonly UNIFORM_BUFFER: number; // 0x8A11 + readonly UNIFORM_BUFFER_BINDING: number; // 0x8A28 + readonly UNIFORM_BUFFER_START: number; // 0x8A29 + readonly UNIFORM_BUFFER_SIZE: number; // 0x8A2A + readonly MAX_VERTEX_UNIFORM_BLOCKS: number; // 0x8A2B + readonly MAX_FRAGMENT_UNIFORM_BLOCKS: number; // 0x8A2D + readonly MAX_COMBINED_UNIFORM_BLOCKS: number; // 0x8A2E + readonly MAX_UNIFORM_BUFFER_BINDINGS: number; // 0x8A2F + readonly MAX_UNIFORM_BLOCK_SIZE: number; // 0x8A30 + readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: number; // 0x8A31 + readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: number; // 0x8A33 + readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: number; // 0x8A34 + readonly ACTIVE_UNIFORM_BLOCKS: number; // 0x8A36 + readonly UNIFORM_TYPE: number; // 0x8A37 + readonly UNIFORM_SIZE: number; // 0x8A38 + readonly UNIFORM_BLOCK_INDEX: number; // 0x8A3A + readonly UNIFORM_OFFSET: number; // 0x8A3B + readonly UNIFORM_ARRAY_STRIDE: number; // 0x8A3C + readonly UNIFORM_MATRIX_STRIDE: number; // 0x8A3D + readonly UNIFORM_IS_ROW_MAJOR: number; // 0x8A3E + readonly UNIFORM_BLOCK_BINDING: number; // 0x8A3F + readonly UNIFORM_BLOCK_DATA_SIZE: number; // 0x8A40 + readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: number; // 0x8A42 + readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: number; // 0x8A43 + readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: number; // 0x8A44 + readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: number; // 0x8A46 + readonly INVALID_INDEX: number; // 0xFFFFFFFF + readonly MAX_VERTEX_OUTPUT_COMPONENTS: number; // 0x9122 + readonly MAX_FRAGMENT_INPUT_COMPONENTS: number; // 0x9125 + readonly MAX_SERVER_WAIT_TIMEOUT: number; // 0x9111 + readonly OBJECT_TYPE: number; // 0x9112 + readonly SYNC_CONDITION: number; // 0x9113 + readonly SYNC_STATUS: number; // 0x9114 + readonly SYNC_FLAGS: number; // 0x9115 + readonly SYNC_FENCE: number; // 0x9116 + readonly SYNC_GPU_COMMANDS_COMPLETE: number; // 0x9117 + readonly UNSIGNALED: number; // 0x9118 + readonly SIGNALED: number; // 0x9119 + readonly ALREADY_SIGNALED: number; // 0x911A + readonly TIMEOUT_EXPIRED: number; // 0x911B + readonly CONDITION_SATISFIED: number; // 0x911C + readonly WAIT_FAILED: number; // 0x911D + readonly SYNC_FLUSH_COMMANDS_BIT: number; // 0x00000001 + readonly VERTEX_ATTRIB_ARRAY_DIVISOR: number; // 0x88FE + readonly ANY_SAMPLES_PASSED: number; // 0x8C2F + readonly ANY_SAMPLES_PASSED_CONSERVATIVE: number; // 0x8D6A + readonly SAMPLER_BINDING: number; // 0x8919 + readonly RGB10_A2UI: number; // 0x906F + readonly INT_2_10_10_10_REV: number; // 0x8D9F + readonly TRANSFORM_FEEDBACK: number; // 0x8E22 + readonly TRANSFORM_FEEDBACK_PAUSED: number; // 0x8E23 + readonly TRANSFORM_FEEDBACK_ACTIVE: number; // 0x8E24 + readonly TRANSFORM_FEEDBACK_BINDING: number; // 0x8E25 + readonly TEXTURE_IMMUTABLE_FORMAT: number; // 0x912F + readonly MAX_ELEMENT_INDEX: number; // 0x8D6B + readonly TEXTURE_IMMUTABLE_LEVELS: number; // 0x82DF + + readonly TIMEOUT_IGNORED: number; // -1 + + /* WebGL-specific enums */ + readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: number; // 0x9247 + + + /* Buffer objects */ + // WebGL1: + bufferData(target: number, sizeOrData: number | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | + Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | + Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): void; + // For compatibility with WebGL 1 context in older Typescript versions. + bufferData(target: number, data: ArrayBufferView, usage: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBufferView): void; + // WebGL2: + bufferData(target: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number, srcOffset: number, length?: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBufferView, + srcOffset: number, length?: number): void; + + copyBufferSubData(readTarget: number, writeTarget: number, readOffset: number, + writeOffset: number, size: number): void; + // MapBufferRange, in particular its read-only and write-only modes, + // can not be exposed safely to JavaScript. GetBufferSubData + // replaces it for the purpose of fetching data back from the GPU. + getBufferSubData(target: number, srcByteOffset: number, dstBuffer: ArrayBufferView, + dstOffset?: number, length?: number): void; + + /* Framebuffer objects */ + blitFramebuffer(srcX0: number, srcY0: number, srcX1: number, srcY1: number, dstX0: number, dstY0: number, + dstX1: number, dstY1: number, mask: number, filter: number): void; + framebufferTextureLayer(target: number, attachment: number, texture: WebGLTexture | null, level: number, + layer: number): void; + invalidateFramebuffer(target: number, attachments: number[]): void; + invalidateSubFramebuffer(target: number, attachments: number[], + x: number, y: number, width: number, height: number): void; + readBuffer(src: number): void; + + /* Renderbuffer objects */ + getInternalformatParameter(target: number, internalformat: number, pname: number): any; + renderbufferStorageMultisample(target: number, samples: number, internalformat: number, + width: number, height: number): void; + + /* Texture objects */ + texStorage2D(target: number, levels: number, internalformat: number, width: number, + height: number): void; + texStorage3D(target: number, levels: number, internalformat: number, width: number, + height: number, depth: number): void; + + // WebGL1 legacy entrypoints: + texImage2D(target: number, level: number, internalformat: number, + width: number, height: number, border: number, format: number, + type: number, pixels?: ArrayBufferView | null): void; + texImage2D(target: number, level: number, internalformat: number, + format: number, type: number, source: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texImage2D(target: number, level: number, internalformat: number, + format: number, type: number, source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, + format: number, type: number, pixels?: ArrayBufferView | null): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + format: number, type: number, source: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + format: number, type: number, source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + + // WebGL2 entrypoints: + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, + border: number, format: number, type: number, pboOffset: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, + border: number, format: number, type: number, + source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, + border: number, format: number, type: number, srcData: ArrayBufferView, + srcOffset: number): void; + + texImage3D(target: number, level: number, internalformat: number, width: number, height: number, + depth: number, border: number, format: number, type: number, pboOffset: number): void; + texImage3D(target: number, level: number, internalformat: number, width: number, height: number, + depth: number, border: number, format: number, type: number, + source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texImage3D(target: number, level: number, internalformat: number, width: number, height: number, + depth: number, border: number, format: number, type: number, srcData: ArrayBufferView | null): void; + texImage3D(target: number, level: number, internalformat: number, width: number, height: number, + depth: number, border: number, format: number, type: number, srcData: ArrayBufferView, + srcOffset: number): void; + + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, + height: number, format: number, type: number, pboOffset: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, + height: number, format: number, type: number, + source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, + height: number, format: number, type: number, srcData: ArrayBufferView, + srcOffset: number): void; + + texSubImage3D(target: number, level: number, xoffset: number, yoffset: number, zoffset: number, + width: number, height: number, depth: number, format: number, type: number, + pboOffset: number): void; + texSubImage3D(target: number, level: number, xoffset: number, yoffset: number, zoffset: number, + width: number, height: number, depth: number, format: number, type: number, + source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texSubImage3D(target: number, level: number, xoffset: number, yoffset: number, zoffset: number, + width: number, height: number, depth: number, format: number, type: number, + srcData: ArrayBufferView | null, srcOffset?: number): void; + + copyTexSubImage3D(target: number, level: number, xoffset: number, yoffset: number, zoffset: number, + x: number, y: number, width: number, height: number): void; + + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, + height: number, border: number, imageSize: number, offset: number): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, + height: number, border: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | null, srcOffset?: number, srcLengthOverride?: number): void; + // For compatibility with WebGL 1 context in older Typescript versions. + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, + height: number, border: number, srcData: ArrayBufferView, + srcOffset?: number, srcLengthOverride?: number): void; + + compressedTexImage3D(target: number, level: number, internalformat: number, width: number, + height: number, depth: number, border: number, imageSize: number, offset: number): void; + compressedTexImage3D(target: number, level: number, internalformat: number, width: number, + height: number, depth: number, border: number, srcData: ArrayBufferView, + srcOffset?: number, srcLengthOverride?: number): void; + + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, format: number, imageSize: number, offset: number): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, format: number, + srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | null, srcOffset?: number, srcLengthOverride?: number): void; + // For compatibility with WebGL 1 context in older Typescript versions. + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, format: number, + srcData: ArrayBufferView | null, + srcOffset?: number, + srcLengthOverride?: number): void; + + compressedTexSubImage3D(target: number, level: number, xoffset: number, yoffset: number, + zoffset: number, width: number, height: number, depth: number, + format: number, imageSize: number, offset: number): void; + compressedTexSubImage3D(target: number, level: number, xoffset: number, yoffset: number, + zoffset: number, width: number, height: number, depth: number, + format: number, srcData: ArrayBufferView, + srcOffset?: number, + srcLengthOverride?: number): void; + + /* Programs and shaders */ + getFragDataLocation(program: WebGLProgram, name: string): number; + + /* Uniforms */ + uniform1ui(location: WebGLUniformLocation | null, v0: number): void; + uniform2ui(location: WebGLUniformLocation | null, v0: number, v1: number): void; + uniform3ui(location: WebGLUniformLocation | null, v0: number, v1: number, v2: number): void; + uniform4ui(location: WebGLUniformLocation | null, v0: number, v1: number, v2: number, v3: number): void; + + uniform1fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform2fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform3fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform4fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + + uniform1iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform2iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform3iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform4iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + + uniform1uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform2uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform3uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform4uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + + uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + + uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + + uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + + /* Vertex attribs */ + vertexAttribI4i(index: number, x: number, y: number, z: number, w: number): void; + vertexAttribI4iv(index: number, values: Int32Array | ArrayLike): void; + vertexAttribI4ui(index: number, x: number, y: number, z: number, w: number): void; + vertexAttribI4uiv(index: number, values: Uint32Array | ArrayLike): void; + vertexAttribIPointer(index: number, size: number, type: number, stride: number, offset: number): void; + + /* Writing to the drawing buffer */ + vertexAttribDivisor(index: number, divisor: number): void; + drawArraysInstanced(mode: number, first: number, count: number, instanceCount: number): void; + drawElementsInstanced(mode: number, count: number, type: number, offset: number, instanceCount: number): void; + drawRangeElements(mode: number, start: number, end: number, count: number, type: number, offset: number): void; + + /* Reading back pixels */ + // WebGL1: + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + dstData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | + Float32Array | Float64Array | DataView | null): void; + // For compatibility with WebGL 1 context in older Typescript versions. + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + dstData: ArrayBufferView | null): void; + // WebGL2: + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + offset: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + dstData: ArrayBufferView, dstOffset: number): void; + + /* Multiple Render Targets */ + drawBuffers(buffers: number[]): void; + + clearBufferfv(buffer: number, drawbuffer: number, values: Float32Array | ArrayLike, + srcOffset?: number): void; + clearBufferiv(buffer: number, drawbuffer: number, values: Int32Array | ArrayLike, + srcOffset?: number): void; + clearBufferuiv(buffer: number, drawbuffer: number, values: Uint32Array | ArrayLike, + srcOffset?: number): void; + + clearBufferfi(buffer: number, drawbuffer: number, depth: number, stencil: number): void; + + /* Query Objects */ + createQuery(): WebGLQuery | null; + deleteQuery(query: WebGLQuery | null): void; + isQuery(query: WebGLQuery | null): boolean; //[WebGLHandlesContextLoss] + beginQuery(target: number, query: WebGLQuery): void; + endQuery(target: number): void; + getQuery(target: number, pname: number): WebGLQuery | null; + getQueryParameter(query: WebGLQuery, pname: number): any; + + /* Sampler Objects */ + createSampler(): WebGLSampler | null; + deleteSampler(sampler: WebGLSampler | null): void; + isSampler(sampler: WebGLSampler | null): boolean; //[WebGLHandlesContextLoss] + bindSampler(unit: number, sampler: WebGLSampler | null): void; + samplerParameteri(sampler: WebGLSampler, pname: number, param: number): void; + samplerParameterf(sampler: WebGLSampler, pname: number, param: number): void; + getSamplerParameter(sampler: WebGLSampler, pname: number): any; + + /* Sync objects */ + fenceSync(condition: number, flags: number): WebGLSync | null; + isSync(sync: WebGLSync | null): boolean; //[WebGLHandlesContextLoss] + deleteSync(sync: WebGLSync | null): void; + clientWaitSync(sync: WebGLSync, flags: number, timeout: number): number; + waitSync(sync: WebGLSync, flags: number, timeout: number): void; + getSyncParameter(sync: WebGLSync, pname: number): any; + + /* Transform Feedback */ + createTransformFeedback(): WebGLTransformFeedback | null; + deleteTransformFeedback(tf: WebGLTransformFeedback | null): void; + isTransformFeedback(tf: WebGLTransformFeedback | null): boolean; //[WebGLHandlesContextLoss] + bindTransformFeedback(target: number, tf: WebGLTransformFeedback | null): void; + beginTransformFeedback(primitiveMode: number): void; + endTransformFeedback(): void; + transformFeedbackVaryings(program: WebGLProgram, varyings: string[], bufferMode: number): void; + getTransformFeedbackVarying(program: WebGLProgram, index: number): WebGLActiveInfo | null; + pauseTransformFeedback(): void; + resumeTransformFeedback(): void; + + /* Uniform Buffer Objects and Transform Feedback Buffers */ + bindBufferBase(target: number, index: number, buffer: WebGLBuffer | null): void; + bindBufferRange(target: number, index: number, buffer: WebGLBuffer | null, offset: number, size: number): void; + getIndexedParameter(target: number, index: number): any; + getUniformIndices(program: WebGLProgram, uniformNames: string[]): number[] | null; + getActiveUniforms(program: WebGLProgram, uniformIndices: number[], pname: number): any; + getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string): number; + getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: number, pname: number): any; + getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: number): string | null; + uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: number, uniformBlockBinding: number): void; + + /* Vertex Array Objects */ + createVertexArray(): WebGLVertexArrayObject | null; + deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void; + isVertexArray(vertexArray: WebGLVertexArrayObject | null): boolean; //[WebGLHandlesContextLoss] + bindVertexArray(array: WebGLVertexArrayObject | null): void; +} + +declare var WebGL2RenderingContext: { + prototype: WebGL2RenderingContext; + new (): WebGL2RenderingContext; + + /* WebGL1 constants */ + readonly ACTIVE_ATTRIBUTES: number; + readonly ACTIVE_TEXTURE: number; + readonly ACTIVE_UNIFORMS: number; + readonly ALIASED_LINE_WIDTH_RANGE: number; + readonly ALIASED_POINT_SIZE_RANGE: number; + readonly ALPHA: number; + readonly ALPHA_BITS: number; + readonly ALWAYS: number; + readonly ARRAY_BUFFER: number; + readonly ARRAY_BUFFER_BINDING: number; + readonly ATTACHED_SHADERS: number; + readonly BACK: number; + readonly BLEND: number; + readonly BLEND_COLOR: number; + readonly BLEND_DST_ALPHA: number; + readonly BLEND_DST_RGB: number; + readonly BLEND_EQUATION: number; + readonly BLEND_EQUATION_ALPHA: number; + readonly BLEND_EQUATION_RGB: number; + readonly BLEND_SRC_ALPHA: number; + readonly BLEND_SRC_RGB: number; + readonly BLUE_BITS: number; + readonly BOOL: number; + readonly BOOL_VEC2: number; + readonly BOOL_VEC3: number; + readonly BOOL_VEC4: number; + readonly BROWSER_DEFAULT_WEBGL: number; + readonly BUFFER_SIZE: number; + readonly BUFFER_USAGE: number; + readonly BYTE: number; + readonly CCW: number; + readonly CLAMP_TO_EDGE: number; + readonly COLOR_ATTACHMENT0: number; + readonly COLOR_BUFFER_BIT: number; + readonly COLOR_CLEAR_VALUE: number; + readonly COLOR_WRITEMASK: number; + readonly COMPILE_STATUS: number; + readonly COMPRESSED_TEXTURE_FORMATS: number; + readonly CONSTANT_ALPHA: number; + readonly CONSTANT_COLOR: number; + readonly CONTEXT_LOST_WEBGL: number; + readonly CULL_FACE: number; + readonly CULL_FACE_MODE: number; + readonly CURRENT_PROGRAM: number; + readonly CURRENT_VERTEX_ATTRIB: number; + readonly CW: number; + readonly DECR: number; + readonly DECR_WRAP: number; + readonly DELETE_STATUS: number; + readonly DEPTH_ATTACHMENT: number; + readonly DEPTH_BITS: number; + readonly DEPTH_BUFFER_BIT: number; + readonly DEPTH_CLEAR_VALUE: number; + readonly DEPTH_COMPONENT: number; + readonly DEPTH_COMPONENT16: number; + readonly DEPTH_FUNC: number; + readonly DEPTH_RANGE: number; + readonly DEPTH_STENCIL: number; + readonly DEPTH_STENCIL_ATTACHMENT: number; + readonly DEPTH_TEST: number; + readonly DEPTH_WRITEMASK: number; + readonly DITHER: number; + readonly DONT_CARE: number; + readonly DST_ALPHA: number; + readonly DST_COLOR: number; + readonly DYNAMIC_DRAW: number; + readonly ELEMENT_ARRAY_BUFFER: number; + readonly ELEMENT_ARRAY_BUFFER_BINDING: number; + readonly EQUAL: number; + readonly FASTEST: number; + readonly FLOAT: number; + readonly FLOAT_MAT2: number; + readonly FLOAT_MAT3: number; + readonly FLOAT_MAT4: number; + readonly FLOAT_VEC2: number; + readonly FLOAT_VEC3: number; + readonly FLOAT_VEC4: number; + readonly FRAGMENT_SHADER: number; + readonly FRAMEBUFFER: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + readonly FRAMEBUFFER_BINDING: number; + readonly FRAMEBUFFER_COMPLETE: number; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + readonly FRAMEBUFFER_UNSUPPORTED: number; + readonly FRONT: number; + readonly FRONT_AND_BACK: number; + readonly FRONT_FACE: number; + readonly FUNC_ADD: number; + readonly FUNC_REVERSE_SUBTRACT: number; + readonly FUNC_SUBTRACT: number; + readonly GENERATE_MIPMAP_HINT: number; + readonly GEQUAL: number; + readonly GREATER: number; + readonly GREEN_BITS: number; + readonly HIGH_FLOAT: number; + readonly HIGH_INT: number; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; + readonly IMPLEMENTATION_COLOR_READ_TYPE: number; + readonly INCR: number; + readonly INCR_WRAP: number; + readonly INT: number; + readonly INT_VEC2: number; + readonly INT_VEC3: number; + readonly INT_VEC4: number; + readonly INVALID_ENUM: number; + readonly INVALID_FRAMEBUFFER_OPERATION: number; + readonly INVALID_OPERATION: number; + readonly INVALID_VALUE: number; + readonly INVERT: number; + readonly KEEP: number; + readonly LEQUAL: number; + readonly LESS: number; + readonly LINEAR: number; + readonly LINEAR_MIPMAP_LINEAR: number; + readonly LINEAR_MIPMAP_NEAREST: number; + readonly LINES: number; + readonly LINE_LOOP: number; + readonly LINE_STRIP: number; + readonly LINE_WIDTH: number; + readonly LINK_STATUS: number; + readonly LOW_FLOAT: number; + readonly LOW_INT: number; + readonly LUMINANCE: number; + readonly LUMINANCE_ALPHA: number; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; + readonly MAX_RENDERBUFFER_SIZE: number; + readonly MAX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_TEXTURE_SIZE: number; + readonly MAX_VARYING_VECTORS: number; + readonly MAX_VERTEX_ATTRIBS: number; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_VERTEX_UNIFORM_VECTORS: number; + readonly MAX_VIEWPORT_DIMS: number; + readonly MEDIUM_FLOAT: number; + readonly MEDIUM_INT: number; + readonly MIRRORED_REPEAT: number; + readonly NEAREST: number; + readonly NEAREST_MIPMAP_LINEAR: number; + readonly NEAREST_MIPMAP_NEAREST: number; + readonly NEVER: number; + readonly NICEST: number; + readonly NONE: number; + readonly NOTEQUAL: number; + readonly NO_ERROR: number; + readonly ONE: number; + readonly ONE_MINUS_CONSTANT_ALPHA: number; + readonly ONE_MINUS_CONSTANT_COLOR: number; + readonly ONE_MINUS_DST_ALPHA: number; + readonly ONE_MINUS_DST_COLOR: number; + readonly ONE_MINUS_SRC_ALPHA: number; + readonly ONE_MINUS_SRC_COLOR: number; + readonly OUT_OF_MEMORY: number; + readonly PACK_ALIGNMENT: number; + readonly POINTS: number; + readonly POLYGON_OFFSET_FACTOR: number; + readonly POLYGON_OFFSET_FILL: number; + readonly POLYGON_OFFSET_UNITS: number; + readonly RED_BITS: number; + readonly RENDERBUFFER: number; + readonly RENDERBUFFER_ALPHA_SIZE: number; + readonly RENDERBUFFER_BINDING: number; + readonly RENDERBUFFER_BLUE_SIZE: number; + readonly RENDERBUFFER_DEPTH_SIZE: number; + readonly RENDERBUFFER_GREEN_SIZE: number; + readonly RENDERBUFFER_HEIGHT: number; + readonly RENDERBUFFER_INTERNAL_FORMAT: number; + readonly RENDERBUFFER_RED_SIZE: number; + readonly RENDERBUFFER_STENCIL_SIZE: number; + readonly RENDERBUFFER_WIDTH: number; + readonly RENDERER: number; + readonly REPEAT: number; + readonly REPLACE: number; + readonly RGB: number; + readonly RGB565: number; + readonly RGB5_A1: number; + readonly RGBA: number; + readonly RGBA4: number; + readonly SAMPLER_2D: number; + readonly SAMPLER_CUBE: number; + readonly SAMPLES: number; + readonly SAMPLE_ALPHA_TO_COVERAGE: number; + readonly SAMPLE_BUFFERS: number; + readonly SAMPLE_COVERAGE: number; + readonly SAMPLE_COVERAGE_INVERT: number; + readonly SAMPLE_COVERAGE_VALUE: number; + readonly SCISSOR_BOX: number; + readonly SCISSOR_TEST: number; + readonly SHADER_TYPE: number; + readonly SHADING_LANGUAGE_VERSION: number; + readonly SHORT: number; + readonly SRC_ALPHA: number; + readonly SRC_ALPHA_SATURATE: number; + readonly SRC_COLOR: number; + readonly STATIC_DRAW: number; + readonly STENCIL_ATTACHMENT: number; + readonly STENCIL_BACK_FAIL: number; + readonly STENCIL_BACK_FUNC: number; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; + readonly STENCIL_BACK_PASS_DEPTH_PASS: number; + readonly STENCIL_BACK_REF: number; + readonly STENCIL_BACK_VALUE_MASK: number; + readonly STENCIL_BACK_WRITEMASK: number; + readonly STENCIL_BITS: number; + readonly STENCIL_BUFFER_BIT: number; + readonly STENCIL_CLEAR_VALUE: number; + readonly STENCIL_FAIL: number; + readonly STENCIL_FUNC: number; + readonly STENCIL_INDEX: number; + readonly STENCIL_INDEX8: number; + readonly STENCIL_PASS_DEPTH_FAIL: number; + readonly STENCIL_PASS_DEPTH_PASS: number; + readonly STENCIL_REF: number; + readonly STENCIL_TEST: number; + readonly STENCIL_VALUE_MASK: number; + readonly STENCIL_WRITEMASK: number; + readonly STREAM_DRAW: number; + readonly SUBPIXEL_BITS: number; + readonly TEXTURE: number; + readonly TEXTURE0: number; + readonly TEXTURE1: number; + readonly TEXTURE10: number; + readonly TEXTURE11: number; + readonly TEXTURE12: number; + readonly TEXTURE13: number; + readonly TEXTURE14: number; + readonly TEXTURE15: number; + readonly TEXTURE16: number; + readonly TEXTURE17: number; + readonly TEXTURE18: number; + readonly TEXTURE19: number; + readonly TEXTURE2: number; + readonly TEXTURE20: number; + readonly TEXTURE21: number; + readonly TEXTURE22: number; + readonly TEXTURE23: number; + readonly TEXTURE24: number; + readonly TEXTURE25: number; + readonly TEXTURE26: number; + readonly TEXTURE27: number; + readonly TEXTURE28: number; + readonly TEXTURE29: number; + readonly TEXTURE3: number; + readonly TEXTURE30: number; + readonly TEXTURE31: number; + readonly TEXTURE4: number; + readonly TEXTURE5: number; + readonly TEXTURE6: number; + readonly TEXTURE7: number; + readonly TEXTURE8: number; + readonly TEXTURE9: number; + readonly TEXTURE_2D: number; + readonly TEXTURE_BINDING_2D: number; + readonly TEXTURE_BINDING_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; + readonly TEXTURE_MAG_FILTER: number; + readonly TEXTURE_MIN_FILTER: number; + readonly TEXTURE_WRAP_S: number; + readonly TEXTURE_WRAP_T: number; + readonly TRIANGLES: number; + readonly TRIANGLE_FAN: number; + readonly TRIANGLE_STRIP: number; + readonly UNPACK_ALIGNMENT: number; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + readonly UNPACK_FLIP_Y_WEBGL: number; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + readonly UNSIGNED_BYTE: number; + readonly UNSIGNED_INT: number; + readonly UNSIGNED_SHORT: number; + readonly UNSIGNED_SHORT_4_4_4_4: number; + readonly UNSIGNED_SHORT_5_5_5_1: number; + readonly UNSIGNED_SHORT_5_6_5: number; + readonly VALIDATE_STATUS: number; + readonly VENDOR: number; + readonly VERSION: number; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + readonly VERTEX_ATTRIB_ARRAY_POINTER: number; + readonly VERTEX_ATTRIB_ARRAY_SIZE: number; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; + readonly VERTEX_ATTRIB_ARRAY_TYPE: number; + readonly VERTEX_SHADER: number; + readonly VIEWPORT: number; + readonly ZERO: number; + + /* WebGL2 constants */ + readonly READ_BUFFER: number; // 0x0C02 + readonly UNPACK_ROW_LENGTH: number; // 0x0CF2 + readonly UNPACK_SKIP_ROWS: number; // 0x0CF3 + readonly UNPACK_SKIP_PIXELS: number; // 0x0CF4 + readonly PACK_ROW_LENGTH: number; // 0x0D02 + readonly PACK_SKIP_ROWS: number; // 0x0D03 + readonly PACK_SKIP_PIXELS: number; // 0x0D04 + readonly COLOR: number; // 0x1800 + readonly DEPTH: number; // 0x1801 + readonly STENCIL: number; // 0x1802 + readonly RED: number; // 0x1903 + readonly RGB8: number; // 0x8051 + readonly RGBA8: number; // 0x8058 + readonly RGB10_A2: number; // 0x8059 + readonly TEXTURE_BINDING_3D: number; // 0x806A + readonly UNPACK_SKIP_IMAGES: number; // 0x806D + readonly UNPACK_IMAGE_HEIGHT: number; // 0x806E + readonly TEXTURE_3D: number; // 0x806F + readonly TEXTURE_WRAP_R: number; // 0x8072 + readonly MAX_3D_TEXTURE_SIZE: number; // 0x8073 + readonly UNSIGNED_INT_2_10_10_10_REV: number; // 0x8368 + readonly MAX_ELEMENTS_VERTICES: number; // 0x80E8 + readonly MAX_ELEMENTS_INDICES: number; // 0x80E9 + readonly TEXTURE_MIN_LOD: number; // 0x813A + readonly TEXTURE_MAX_LOD: number; // 0x813B + readonly TEXTURE_BASE_LEVEL: number; // 0x813C + readonly TEXTURE_MAX_LEVEL: number; // 0x813D + readonly MIN: number; // 0x8007 + readonly MAX: number; // 0x8008 + readonly DEPTH_COMPONENT24: number; // 0x81A6 + readonly MAX_TEXTURE_LOD_BIAS: number; // 0x84FD + readonly TEXTURE_COMPARE_MODE: number; // 0x884C + readonly TEXTURE_COMPARE_FUNC: number; // 0x884D + readonly CURRENT_QUERY: number; // 0x8865 + readonly QUERY_RESULT: number; // 0x8866 + readonly QUERY_RESULT_AVAILABLE: number; // 0x8867 + readonly STREAM_READ: number; // 0x88E1 + readonly STREAM_COPY: number; // 0x88E2 + readonly STATIC_READ: number; // 0x88E5 + readonly STATIC_COPY: number; // 0x88E6 + readonly DYNAMIC_READ: number; // 0x88E9 + readonly DYNAMIC_COPY: number; // 0x88EA + readonly MAX_DRAW_BUFFERS: number; // 0x8824 + readonly DRAW_BUFFER0: number; // 0x8825 + readonly DRAW_BUFFER1: number; // 0x8826 + readonly DRAW_BUFFER2: number; // 0x8827 + readonly DRAW_BUFFER3: number; // 0x8828 + readonly DRAW_BUFFER4: number; // 0x8829 + readonly DRAW_BUFFER5: number; // 0x882A + readonly DRAW_BUFFER6: number; // 0x882B + readonly DRAW_BUFFER7: number; // 0x882C + readonly DRAW_BUFFER8: number; // 0x882D + readonly DRAW_BUFFER9: number; // 0x882E + readonly DRAW_BUFFER10: number; // 0x882F + readonly DRAW_BUFFER11: number; // 0x8830 + readonly DRAW_BUFFER12: number; // 0x8831 + readonly DRAW_BUFFER13: number; // 0x8832 + readonly DRAW_BUFFER14: number; // 0x8833 + readonly DRAW_BUFFER15: number; // 0x8834 + readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: number; // 0x8B49 + readonly MAX_VERTEX_UNIFORM_COMPONENTS: number; // 0x8B4A + readonly SAMPLER_3D: number; // 0x8B5F + readonly SAMPLER_2D_SHADOW: number; // 0x8B62 + readonly FRAGMENT_SHADER_DERIVATIVE_HINT: number; // 0x8B8B + readonly PIXEL_PACK_BUFFER: number; // 0x88EB + readonly PIXEL_UNPACK_BUFFER: number; // 0x88EC + readonly PIXEL_PACK_BUFFER_BINDING: number; // 0x88ED + readonly PIXEL_UNPACK_BUFFER_BINDING: number; // 0x88EF + readonly FLOAT_MAT2x3: number; // 0x8B65 + readonly FLOAT_MAT2x4: number; // 0x8B66 + readonly FLOAT_MAT3x2: number; // 0x8B67 + readonly FLOAT_MAT3x4: number; // 0x8B68 + readonly FLOAT_MAT4x2: number; // 0x8B69 + readonly FLOAT_MAT4x3: number; // 0x8B6A + readonly SRGB: number; // 0x8C40 + readonly SRGB8: number; // 0x8C41 + readonly SRGB8_ALPHA8: number; // 0x8C43 + readonly COMPARE_REF_TO_TEXTURE: number; // 0x884E + readonly RGBA32F: number; // 0x8814 + readonly RGB32F: number; // 0x8815 + readonly RGBA16F: number; // 0x881A + readonly RGB16F: number; // 0x881B + readonly VERTEX_ATTRIB_ARRAY_INTEGER: number; // 0x88FD + readonly MAX_ARRAY_TEXTURE_LAYERS: number; // 0x88FF + readonly MIN_PROGRAM_TEXEL_OFFSET: number; // 0x8904 + readonly MAX_PROGRAM_TEXEL_OFFSET: number; // 0x8905 + readonly MAX_VARYING_COMPONENTS: number; // 0x8B4B + readonly TEXTURE_2D_ARRAY: number; // 0x8C1A + readonly TEXTURE_BINDING_2D_ARRAY: number; // 0x8C1D + readonly R11F_G11F_B10F: number; // 0x8C3A + readonly UNSIGNED_INT_10F_11F_11F_REV: number; // 0x8C3B + readonly RGB9_E5: number; // 0x8C3D + readonly UNSIGNED_INT_5_9_9_9_REV: number; // 0x8C3E + readonly TRANSFORM_FEEDBACK_BUFFER_MODE: number; // 0x8C7F + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: number; // 0x8C80 + readonly TRANSFORM_FEEDBACK_VARYINGS: number; // 0x8C83 + readonly TRANSFORM_FEEDBACK_BUFFER_START: number; // 0x8C84 + readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: number; // 0x8C85 + readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: number; // 0x8C88 + readonly RASTERIZER_DISCARD: number; // 0x8C89 + readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: number; // 0x8C8A + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: number; // 0x8C8B + readonly INTERLEAVED_ATTRIBS: number; // 0x8C8C + readonly SEPARATE_ATTRIBS: number; // 0x8C8D + readonly TRANSFORM_FEEDBACK_BUFFER: number; // 0x8C8E + readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: number; // 0x8C8F + readonly RGBA32UI: number; // 0x8D70 + readonly RGB32UI: number; // 0x8D71 + readonly RGBA16UI: number; // 0x8D76 + readonly RGB16UI: number; // 0x8D77 + readonly RGBA8UI: number; // 0x8D7C + readonly RGB8UI: number; // 0x8D7D + readonly RGBA32I: number; // 0x8D82 + readonly RGB32I: number; // 0x8D83 + readonly RGBA16I: number; // 0x8D88 + readonly RGB16I: number; // 0x8D89 + readonly RGBA8I: number; // 0x8D8E + readonly RGB8I: number; // 0x8D8F + readonly RED_INTEGER: number; // 0x8D94 + readonly RGB_INTEGER: number; // 0x8D98 + readonly RGBA_INTEGER: number; // 0x8D99 + readonly SAMPLER_2D_ARRAY: number; // 0x8DC1 + readonly SAMPLER_2D_ARRAY_SHADOW: number; // 0x8DC4 + readonly SAMPLER_CUBE_SHADOW: number; // 0x8DC5 + readonly UNSIGNED_INT_VEC2: number; // 0x8DC6 + readonly UNSIGNED_INT_VEC3: number; // 0x8DC7 + readonly UNSIGNED_INT_VEC4: number; // 0x8DC8 + readonly INT_SAMPLER_2D: number; // 0x8DCA + readonly INT_SAMPLER_3D: number; // 0x8DCB + readonly INT_SAMPLER_CUBE: number; // 0x8DCC + readonly INT_SAMPLER_2D_ARRAY: number; // 0x8DCF + readonly UNSIGNED_INT_SAMPLER_2D: number; // 0x8DD2 + readonly UNSIGNED_INT_SAMPLER_3D: number; // 0x8DD3 + readonly UNSIGNED_INT_SAMPLER_CUBE: number; // 0x8DD4 + readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: number; // 0x8DD7 + readonly DEPTH_COMPONENT32F: number; // 0x8CAC + readonly DEPTH32F_STENCIL8: number; // 0x8CAD + readonly FLOAT_32_UNSIGNED_INT_24_8_REV: number; // 0x8DAD + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: number; // 0x8210 + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: number; // 0x8211 + readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: number; // 0x8212 + readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: number; // 0x8213 + readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: number; // 0x8214 + readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: number; // 0x8215 + readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: number; // 0x8216 + readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: number; // 0x8217 + readonly FRAMEBUFFER_DEFAULT: number; // 0x8218 + //readonly DEPTH_STENCIL_ATTACHMENT: number; // 0x821A /* Already defined in WebGL1 constants */ + //readonly DEPTH_STENCIL: number; // 0x84F9 /* Already defined in WebGL1 constants */ + readonly UNSIGNED_INT_24_8: number; // 0x84FA + readonly DEPTH24_STENCIL8: number; // 0x88F0 + readonly UNSIGNED_NORMALIZED: number; // 0x8C17 + readonly DRAW_FRAMEBUFFER_BINDING: number; // 0x8CA6 /* Same as FRAMEBUFFER_BINDING */ + readonly READ_FRAMEBUFFER: number; // 0x8CA8 + readonly DRAW_FRAMEBUFFER: number; // 0x8CA9 + readonly READ_FRAMEBUFFER_BINDING: number; // 0x8CAA + readonly RENDERBUFFER_SAMPLES: number; // 0x8CAB + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: number; // 0x8CD4 + readonly MAX_COLOR_ATTACHMENTS: number; // 0x8CDF + readonly COLOR_ATTACHMENT1: number; // 0x8CE1 + readonly COLOR_ATTACHMENT2: number; // 0x8CE2 + readonly COLOR_ATTACHMENT3: number; // 0x8CE3 + readonly COLOR_ATTACHMENT4: number; // 0x8CE4 + readonly COLOR_ATTACHMENT5: number; // 0x8CE5 + readonly COLOR_ATTACHMENT6: number; // 0x8CE6 + readonly COLOR_ATTACHMENT7: number; // 0x8CE7 + readonly COLOR_ATTACHMENT8: number; // 0x8CE8 + readonly COLOR_ATTACHMENT9: number; // 0x8CE9 + readonly COLOR_ATTACHMENT10: number; // 0x8CEA + readonly COLOR_ATTACHMENT11: number; // 0x8CEB + readonly COLOR_ATTACHMENT12: number; // 0x8CEC + readonly COLOR_ATTACHMENT13: number; // 0x8CED + readonly COLOR_ATTACHMENT14: number; // 0x8CEE + readonly COLOR_ATTACHMENT15: number; // 0x8CEF + readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: number; // 0x8D56 + readonly MAX_SAMPLES: number; // 0x8D57 + readonly HALF_FLOAT: number; // 0x140B + readonly RG: number; // 0x8227 + readonly RG_INTEGER: number; // 0x8228 + readonly R8: number; // 0x8229 + readonly RG8: number; // 0x822B + readonly R16F: number; // 0x822D + readonly R32F: number; // 0x822E + readonly RG16F: number; // 0x822F + readonly RG32F: number; // 0x8230 + readonly R8I: number; // 0x8231 + readonly R8UI: number; // 0x8232 + readonly R16I: number; // 0x8233 + readonly R16UI: number; // 0x8234 + readonly R32I: number; // 0x8235 + readonly R32UI: number; // 0x8236 + readonly RG8I: number; // 0x8237 + readonly RG8UI: number; // 0x8238 + readonly RG16I: number; // 0x8239 + readonly RG16UI: number; // 0x823A + readonly RG32I: number; // 0x823B + readonly RG32UI: number; // 0x823C + readonly VERTEX_ARRAY_BINDING: number; // 0x85B5 + readonly R8_SNORM: number; // 0x8F94 + readonly RG8_SNORM: number; // 0x8F95 + readonly RGB8_SNORM: number; // 0x8F96 + readonly RGBA8_SNORM: number; // 0x8F97 + readonly SIGNED_NORMALIZED: number; // 0x8F9C + readonly COPY_READ_BUFFER: number; // 0x8F36 + readonly COPY_WRITE_BUFFER: number; // 0x8F37 + readonly COPY_READ_BUFFER_BINDING: number; // 0x8F36 /* Same as COPY_READ_BUFFER */ + readonly COPY_WRITE_BUFFER_BINDING: number; // 0x8F37 /* Same as COPY_WRITE_BUFFER */ + readonly UNIFORM_BUFFER: number; // 0x8A11 + readonly UNIFORM_BUFFER_BINDING: number; // 0x8A28 + readonly UNIFORM_BUFFER_START: number; // 0x8A29 + readonly UNIFORM_BUFFER_SIZE: number; // 0x8A2A + readonly MAX_VERTEX_UNIFORM_BLOCKS: number; // 0x8A2B + readonly MAX_FRAGMENT_UNIFORM_BLOCKS: number; // 0x8A2D + readonly MAX_COMBINED_UNIFORM_BLOCKS: number; // 0x8A2E + readonly MAX_UNIFORM_BUFFER_BINDINGS: number; // 0x8A2F + readonly MAX_UNIFORM_BLOCK_SIZE: number; // 0x8A30 + readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: number; // 0x8A31 + readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: number; // 0x8A33 + readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: number; // 0x8A34 + readonly ACTIVE_UNIFORM_BLOCKS: number; // 0x8A36 + readonly UNIFORM_TYPE: number; // 0x8A37 + readonly UNIFORM_SIZE: number; // 0x8A38 + readonly UNIFORM_BLOCK_INDEX: number; // 0x8A3A + readonly UNIFORM_OFFSET: number; // 0x8A3B + readonly UNIFORM_ARRAY_STRIDE: number; // 0x8A3C + readonly UNIFORM_MATRIX_STRIDE: number; // 0x8A3D + readonly UNIFORM_IS_ROW_MAJOR: number; // 0x8A3E + readonly UNIFORM_BLOCK_BINDING: number; // 0x8A3F + readonly UNIFORM_BLOCK_DATA_SIZE: number; // 0x8A40 + readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: number; // 0x8A42 + readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: number; // 0x8A43 + readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: number; // 0x8A44 + readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: number; // 0x8A46 + readonly INVALID_INDEX: number; // 0xFFFFFFFF + readonly MAX_VERTEX_OUTPUT_COMPONENTS: number; // 0x9122 + readonly MAX_FRAGMENT_INPUT_COMPONENTS: number; // 0x9125 + readonly MAX_SERVER_WAIT_TIMEOUT: number; // 0x9111 + readonly OBJECT_TYPE: number; // 0x9112 + readonly SYNC_CONDITION: number; // 0x9113 + readonly SYNC_STATUS: number; // 0x9114 + readonly SYNC_FLAGS: number; // 0x9115 + readonly SYNC_FENCE: number; // 0x9116 + readonly SYNC_GPU_COMMANDS_COMPLETE: number; // 0x9117 + readonly UNSIGNALED: number; // 0x9118 + readonly SIGNALED: number; // 0x9119 + readonly ALREADY_SIGNALED: number; // 0x911A + readonly TIMEOUT_EXPIRED: number; // 0x911B + readonly CONDITION_SATISFIED: number; // 0x911C + readonly WAIT_FAILED: number; // 0x911D + readonly SYNC_FLUSH_COMMANDS_BIT: number; // 0x00000001 + readonly VERTEX_ATTRIB_ARRAY_DIVISOR: number; // 0x88FE + readonly ANY_SAMPLES_PASSED: number; // 0x8C2F + readonly ANY_SAMPLES_PASSED_CONSERVATIVE: number; // 0x8D6A + readonly SAMPLER_BINDING: number; // 0x8919 + readonly RGB10_A2UI: number; // 0x906F + readonly INT_2_10_10_10_REV: number; // 0x8D9F + readonly TRANSFORM_FEEDBACK: number; // 0x8E22 + readonly TRANSFORM_FEEDBACK_PAUSED: number; // 0x8E23 + readonly TRANSFORM_FEEDBACK_ACTIVE: number; // 0x8E24 + readonly TRANSFORM_FEEDBACK_BINDING: number; // 0x8E25 + readonly TEXTURE_IMMUTABLE_FORMAT: number; // 0x912F + readonly MAX_ELEMENT_INDEX: number; // 0x8D6B + readonly TEXTURE_IMMUTABLE_LEVELS: number; // 0x82DF + + readonly TIMEOUT_IGNORED: number; // -1 + + /* WebGL-specific enums */ + readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: number; // 0x9247 +}; + +interface WebGLQuery extends WebGLObject { +} + +declare var WebGLQuery: { + prototype: WebGLQuery; + new (): WebGLQuery; +}; + +interface WebGLSampler extends WebGLObject { +} + +declare var WebGLSampler: { + prototype: WebGLSampler; + new (): WebGLSampler; +}; + +interface WebGLSync extends WebGLObject { +} + +declare var WebGLSync: { + prototype: WebGLSync; + new (): WebGLSync; +}; + +interface WebGLTransformFeedback extends WebGLObject { +} + +declare var WebGLTransformFeedback: { + prototype: WebGLTransformFeedback; + new (): WebGLTransformFeedback; +}; + +interface WebGLVertexArrayObject extends WebGLObject { +} + +declare var WebGLVertexArrayObject: { + prototype: WebGLVertexArrayObject; + new (): WebGLVertexArrayObject; +}; diff --git a/node_modules/@types/webgl2/package.json b/node_modules/@types/webgl2/package.json new file mode 100644 index 0000000..7cc91f5 --- /dev/null +++ b/node_modules/@types/webgl2/package.json @@ -0,0 +1,51 @@ +{ + "_from": "@types/webgl2@~0.0.4", + "_id": "@types/webgl2@0.0.4", + "_inBundle": false, + "_integrity": "sha512-PACt1xdErJbMUOUweSrbVM7gSIYm1vTncW2hF6Os/EeWi6TXYAYMPp+8v6rzHmypE5gHrxaxZNXgMkJVIdZpHw==", + "_location": "/@types/webgl2", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@types/webgl2@~0.0.4", + "name": "@types/webgl2", + "escapedName": "@types%2fwebgl2", + "scope": "@types", + "rawSpec": "~0.0.4", + "saveSpec": null, + "fetchSpec": "~0.0.4" + }, + "_requiredBy": [ + "/@tensorflow/tfjs-core" + ], + "_resolved": "https://registry.npmjs.org/@types/webgl2/-/webgl2-0.0.4.tgz", + "_shasum": "c3b0f9d6b465c66138e84e64cb3bdf8373c2c279", + "_spec": "@types/webgl2@~0.0.4", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs-core", + "bundleDependencies": false, + "contributors": [ + { + "name": "Nico Kemnitz", + "url": "https://github.com/nkemnitz" + }, + { + "name": "Adrian Blumer", + "url": "https://github.com/karhu" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "TypeScript definitions for WebGL 2, Editor's Draft Fri Feb 24 16:10:18 2017 -0800", + "license": "MIT", + "main": "", + "name": "@types/webgl2", + "repository": { + "type": "git", + "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "typeScriptVersion": "2.0", + "typesPublisherContentHash": "4b06a12ad7c8229a033ac12d69a54d58274e48369d24481a61e344c8605d3d2f", + "version": "0.0.4" +} diff --git a/node_modules/coffeescript/LICENSE b/node_modules/coffeescript/LICENSE new file mode 100644 index 0000000..0393a55 --- /dev/null +++ b/node_modules/coffeescript/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2009-2018 Jeremy Ashkenas + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/coffeescript/README.md b/node_modules/coffeescript/README.md new file mode 100644 index 0000000..f495879 --- /dev/null +++ b/node_modules/coffeescript/README.md @@ -0,0 +1,66 @@ +``` + @@@@@@@ @@@@ @@@@@ + @@@@@@@@@@ @@@ @@@ { + @@@@ @@ @@@ @@@ } } { + @@@@ @@@@@@@ @@@ @@@ @@@@@@ @@@@@@ { { } } + @@@@ @@@ @@ @@@@@ @@@@@@ @@@ @@ @@@@ @@ } }{ { + @@@@ @@@@ @@ @@@ @@@ @@@ @@@ @@@ @@@ { }{ } } + @@@@ @@@@ @@ @@@ @@@ @@@@@@@@ @@@@@@@@ { }{ }{ { } + @@@@@ @@@@ @@ @@@ @@@ @@@ @@@ { { } { } { } } + @@@@@@@@@@ @@@@@@@@ @@@ @@@ @@@@@@@@ @@@@@@@@ { } { } { } + @@@@@ @@@ @@@ @@@@@ @@@@@ @@@@@@ { } { } @@@@@@@ + @@@ @@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@ @@@ @@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@ @@ @@@ @@@@ @@ @@@@@@@@@@@@@@@@@@@@@@@@ + @@@@ @@@ @@ @@@@ @@@ @@@@@@@@@@@@@@@@@@@@@ + @@@@@ @@@@@ @@ @@ @@@ @@@@@@@ @@@@@ @@@ @@@@@@@@@@@@@@@@@@ + @@@@@ @@@ @@@ @@@@@@@@ @@@@ @@@@ @@@@@@@ @@@ @@@@@@@@@@@@@@@@ + @@@@@ @@@ @@@@ @@@@ @@@ @@@ @@@ @@@@@@@@@@@@@@ + @@@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@ +@@@ @@@@ @@@ @@@@ @@@@ @@@ @@@@ @@@@ +@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@ @@@@ + @@@@@@@@@ @@@@@@ @@@@ @@@@ @@@@@@@@@ @@@@ + @@@ @@@@ + @@@ + @@@ +``` + +CoffeeScript is a little language that compiles into JavaScript. + +## Installation + +Once you have Node.js installed: + +```shell +# Install locally for a project: +npm install --save-dev coffeescript + +# Install globally to execute .coffee files anywhere: +npm install --global coffeescript +``` + +## Getting Started + +Execute a script: + +```shell +coffee /path/to/script.coffee +``` + +Compile a script: + +```shell +coffee -c /path/to/script.coffee +``` + +For documentation, usage, and examples, see: https://coffeescript.org/ + +To suggest a feature or report a bug: https://github.com/jashkenas/coffeescript/issues + +If you’d like to chat, drop by #coffeescript on Freenode IRC. + +The source repository: https://github.com/jashkenas/coffeescript.git + +Changelog: https://coffeescript.org/#changelog + +Our lovely and talented contributors are listed here: https://github.com/jashkenas/coffeescript/contributors diff --git a/node_modules/coffeescript/bin/cake b/node_modules/coffeescript/bin/cake new file mode 100644 index 0000000..067cabb --- /dev/null +++ b/node_modules/coffeescript/bin/cake @@ -0,0 +1,25 @@ +#!/usr/bin/env node + +try { + new Function('var {a} = {a: 1}')(); +} catch (error) { + console.error('Your JavaScript runtime does not support some features used by the cake command. Please use Node 6 or later.'); + process.exit(1); +} + +var path = require('path'); +var fs = require('fs'); + +var potentialPaths = [ + path.join(process.cwd(), 'node_modules/coffeescript/lib/coffeescript'), + path.join(process.cwd(), 'node_modules/coffeescript/lib/coffee-script'), + path.join(process.cwd(), 'node_modules/coffee-script/lib/coffee-script'), + path.join(__dirname, '../lib/coffeescript') +]; + +for (var i = 0, len = potentialPaths.length; i < len; i++) { + if (fs.existsSync(potentialPaths[i])) { + require(potentialPaths[i] + '/cake').run(); + break; + } +} diff --git a/node_modules/coffeescript/bin/coffee b/node_modules/coffeescript/bin/coffee new file mode 100644 index 0000000..9ebc45e --- /dev/null +++ b/node_modules/coffeescript/bin/coffee @@ -0,0 +1,25 @@ +#!/usr/bin/env node + +try { + new Function('var {a} = {a: 1}')(); +} catch (error) { + console.error('Your JavaScript runtime does not support some features used by the coffee command. Please use Node 6 or later.'); + process.exit(1); +} + +var path = require('path'); +var fs = require('fs'); + +var potentialPaths = [ + path.join(process.cwd(), 'node_modules/coffeescript/lib/coffeescript'), + path.join(process.cwd(), 'node_modules/coffeescript/lib/coffee-script'), + path.join(process.cwd(), 'node_modules/coffee-script/lib/coffee-script'), + path.join(__dirname, '../lib/coffeescript') +]; + +for (var i = 0, len = potentialPaths.length; i < len; i++) { + if (fs.existsSync(potentialPaths[i])) { + require(potentialPaths[i] + '/command').run(); + break; + } +} diff --git a/node_modules/coffeescript/lib/.DS_Store b/node_modules/coffeescript/lib/.DS_Store new file mode 100644 index 0000000..ebe6529 Binary files /dev/null and b/node_modules/coffeescript/lib/.DS_Store differ diff --git a/node_modules/coffeescript/lib/coffeescript/browser.js b/node_modules/coffeescript/lib/coffeescript/browser.js new file mode 100644 index 0000000..0961b37 --- /dev/null +++ b/node_modules/coffeescript/lib/coffeescript/browser.js @@ -0,0 +1,145 @@ +// Generated by CoffeeScript 2.3.1 +(function() { + // This **Browser** compatibility layer extends core CoffeeScript functions + // to make things work smoothly when compiling code directly in the browser. + // We add support for loading remote Coffee scripts via **XHR**, and + // `text/coffeescript` script tags, source maps via data-URLs, and so on. + var CoffeeScript, compile, runScripts, + indexOf = [].indexOf; + + CoffeeScript = require('./coffeescript'); + + ({compile} = CoffeeScript); + + // Use `window.eval` to evaluate code, rather than just `eval`, to run the + // script in a clean global scope rather than inheriting the scope of the + // CoffeeScript compiler. (So that `cake test:browser` also works in Node, + // use either `window.eval` or `global.eval` as appropriate). + CoffeeScript.eval = function(code, options = {}) { + var globalRoot; + if (options.bare == null) { + options.bare = true; + } + globalRoot = typeof window !== "undefined" && window !== null ? window : global; + return globalRoot['eval'](compile(code, options)); + }; + + // Running code does not provide access to this scope. + CoffeeScript.run = function(code, options = {}) { + options.bare = true; + options.shiftLine = true; + return Function(compile(code, options))(); + }; + + // Export this more limited `CoffeeScript` than what is exported by + // `index.coffee`, which is intended for a Node environment. + module.exports = CoffeeScript; + + // If we’re not in a browser environment, we’re finished with the public API. + if (typeof window === "undefined" || window === null) { + return; + } + + // Include source maps where possible. If we’ve got a base64 encoder, a + // JSON serializer, and tools for escaping unicode characters, we’re good to go. + // Ported from https://developer.mozilla.org/en-US/docs/DOM/window.btoa + if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null)) { + compile = function(code, options = {}) { + options.inlineMap = true; + return CoffeeScript.compile(code, options); + }; + } + + // Load a remote script from the current domain via XHR. + CoffeeScript.load = function(url, callback, options = {}, hold = false) { + var xhr; + options.sourceFiles = [url]; + xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest(); + xhr.open('GET', url, true); + if ('overrideMimeType' in xhr) { + xhr.overrideMimeType('text/plain'); + } + xhr.onreadystatechange = function() { + var param, ref; + if (xhr.readyState === 4) { + if ((ref = xhr.status) === 0 || ref === 200) { + param = [xhr.responseText, options]; + if (!hold) { + CoffeeScript.run(...param); + } + } else { + throw new Error(`Could not load ${url}`); + } + if (callback) { + return callback(param); + } + } + }; + return xhr.send(null); + }; + + // Activate CoffeeScript in the browser by having it compile and evaluate + // all script tags with a content-type of `text/coffeescript`. + // This happens on page load. + runScripts = function() { + var coffees, coffeetypes, execute, i, index, j, len, s, script, scripts; + scripts = window.document.getElementsByTagName('script'); + coffeetypes = ['text/coffeescript', 'text/literate-coffeescript']; + coffees = (function() { + var j, len, ref, results; + results = []; + for (j = 0, len = scripts.length; j < len; j++) { + s = scripts[j]; + if (ref = s.type, indexOf.call(coffeetypes, ref) >= 0) { + results.push(s); + } + } + return results; + })(); + index = 0; + execute = function() { + var param; + param = coffees[index]; + if (param instanceof Array) { + CoffeeScript.run(...param); + index++; + return execute(); + } + }; + for (i = j = 0, len = coffees.length; j < len; i = ++j) { + script = coffees[i]; + (function(script, i) { + var options, source; + options = { + literate: script.type === coffeetypes[1] + }; + source = script.src || script.getAttribute('data-src'); + if (source) { + options.filename = source; + return CoffeeScript.load(source, function(param) { + coffees[i] = param; + return execute(); + }, options, true); + } else { + // `options.filename` defines the filename the source map appears as + // in Developer Tools. If a script tag has an `id`, use that as the + // filename; otherwise use `coffeescript`, or `coffeescript1` etc., + // leaving the first one unnumbered for the common case that there’s + // only one CoffeeScript script block to parse. + options.filename = script.id && script.id !== '' ? script.id : `coffeescript${(i !== 0 ? i : '')}`; + options.sourceFiles = ['embedded']; + return coffees[i] = [script.innerHTML, options]; + } + })(script, i); + } + return execute(); + }; + + // Listen for window load, both in decent browsers and in IE. + if (window.addEventListener) { + window.addEventListener('DOMContentLoaded', runScripts, false); + } else { + window.attachEvent('onload', runScripts); + } + +}).call(this); diff --git a/node_modules/coffeescript/lib/coffeescript/cake.js b/node_modules/coffeescript/lib/coffeescript/cake.js new file mode 100644 index 0000000..b1afffd --- /dev/null +++ b/node_modules/coffeescript/lib/coffeescript/cake.js @@ -0,0 +1,135 @@ +// Generated by CoffeeScript 2.3.1 +(function() { + // `cake` is a simplified version of [Make](http://www.gnu.org/software/make/) + // ([Rake](http://rake.rubyforge.org/), [Jake](https://github.com/280north/jake)) + // for CoffeeScript. You define tasks with names and descriptions in a Cakefile, + // and can call them from the command line, or invoke them from other tasks. + + // Running `cake` with no arguments will print out a list of all the tasks in the + // current directory's Cakefile. + + // External dependencies. + var CoffeeScript, cakefileDirectory, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks; + + fs = require('fs'); + + path = require('path'); + + helpers = require('./helpers'); + + optparse = require('./optparse'); + + CoffeeScript = require('./'); + + // Register .coffee extension + CoffeeScript.register(); + + // Keep track of the list of defined tasks, the accepted options, and so on. + tasks = {}; + + options = {}; + + switches = []; + + oparse = null; + + // Mixin the top-level Cake functions for Cakefiles to use directly. + helpers.extend(global, { + // Define a Cake task with a short name, an optional sentence description, + // and the function to run as the action itself. + task: function(name, description, action) { + if (!action) { + [action, description] = [description, action]; + } + return tasks[name] = {name, description, action}; + }, + // Define an option that the Cakefile accepts. The parsed options hash, + // containing all of the command-line options passed, will be made available + // as the first argument to the action. + option: function(letter, flag, description) { + return switches.push([letter, flag, description]); + }, + // Invoke another task in the current Cakefile. + invoke: function(name) { + if (!tasks[name]) { + missingTask(name); + } + return tasks[name].action(options); + } + }); + + // Run `cake`. Executes all of the tasks you pass, in order. Note that Node's + // asynchrony may cause tasks to execute in a different order than you'd expect. + // If no tasks are passed, print the help screen. Keep a reference to the + // original directory name, when running Cake tasks from subdirectories. + exports.run = function() { + var arg, args, e, i, len, ref, results; + global.__originalDirname = fs.realpathSync('.'); + process.chdir(cakefileDirectory(__originalDirname)); + args = process.argv.slice(2); + CoffeeScript.run(fs.readFileSync('Cakefile').toString(), { + filename: 'Cakefile' + }); + oparse = new optparse.OptionParser(switches); + if (!args.length) { + return printTasks(); + } + try { + options = oparse.parse(args); + } catch (error) { + e = error; + return fatalError(`${e}`); + } + ref = options.arguments; + results = []; + for (i = 0, len = ref.length; i < len; i++) { + arg = ref[i]; + results.push(invoke(arg)); + } + return results; + }; + + // Display the list of Cake tasks in a format similar to `rake -T` + printTasks = function() { + var cakefilePath, desc, name, relative, spaces, task; + relative = path.relative || path.resolve; + cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile'); + console.log(`${cakefilePath} defines the following tasks:\n`); + for (name in tasks) { + task = tasks[name]; + spaces = 20 - name.length; + spaces = spaces > 0 ? Array(spaces + 1).join(' ') : ''; + desc = task.description ? `# ${task.description}` : ''; + console.log(`cake ${name}${spaces} ${desc}`); + } + if (switches.length) { + return console.log(oparse.help()); + } + }; + + // Print an error and exit when attempting to use an invalid task/option. + fatalError = function(message) { + console.error(message + '\n'); + console.log('To see a list of all tasks/options, run "cake"'); + return process.exit(1); + }; + + missingTask = function(task) { + return fatalError(`No such task: ${task}`); + }; + + // When `cake` is invoked, search in the current and all parent directories + // to find the relevant Cakefile. + cakefileDirectory = function(dir) { + var parent; + if (fs.existsSync(path.join(dir, 'Cakefile'))) { + return dir; + } + parent = path.normalize(path.join(dir, '..')); + if (parent !== dir) { + return cakefileDirectory(parent); + } + throw new Error(`Cakefile not found in ${process.cwd()}`); + }; + +}).call(this); diff --git a/node_modules/coffeescript/lib/coffeescript/coffeescript.js b/node_modules/coffeescript/lib/coffeescript/coffeescript.js new file mode 100644 index 0000000..4fb7883 --- /dev/null +++ b/node_modules/coffeescript/lib/coffeescript/coffeescript.js @@ -0,0 +1,438 @@ +// Generated by CoffeeScript 2.3.1 +(function() { + // CoffeeScript can be used both on the server, as a command-line compiler based + // on Node.js/V8, or to run CoffeeScript directly in the browser. This module + // contains the main entry functions for tokenizing, parsing, and compiling + // source CoffeeScript into JavaScript. + var FILE_EXTENSIONS, Lexer, SourceMap, base64encode, checkShebangLine, compile, formatSourcePosition, getSourceMap, helpers, lexer, packageJson, parser, sourceMaps, sources, withPrettyErrors, + indexOf = [].indexOf; + + ({Lexer} = require('./lexer')); + + ({parser} = require('./parser')); + + helpers = require('./helpers'); + + SourceMap = require('./sourcemap'); + + // Require `package.json`, which is two levels above this file, as this file is + // evaluated from `lib/coffeescript`. + packageJson = require('../../package.json'); + + // The current CoffeeScript version number. + exports.VERSION = packageJson.version; + + exports.FILE_EXTENSIONS = FILE_EXTENSIONS = ['.coffee', '.litcoffee', '.coffee.md']; + + // Expose helpers for testing. + exports.helpers = helpers; + + // Function that allows for btoa in both nodejs and the browser. + base64encode = function(src) { + switch (false) { + case typeof Buffer !== 'function': + return Buffer.from(src).toString('base64'); + case typeof btoa !== 'function': + // The contents of a ` +``` + +Production: + +``` + +``` + +**Remember** to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +The library supports CommonJS and AMD loaders and also exports globally as `protobuf`. + +### Distributions + +Where bundle size is a factor, there are additional stripped-down versions of the [full library][dist-full] (~19kb gzipped) available that exclude certain functionality: + +* When working with JSON descriptors (i.e. generated by [pbjs](#pbjs-for-javascript)) and/or reflection only, see the [light library][dist-light] (~16kb gzipped) that excludes the parser. CommonJS entry point is: + + ```js + var protobuf = require("protobufjs/light"); + ``` + +* When working with statically generated code only, see the [minimal library][dist-minimal] (~6.5kb gzipped) that also excludes reflection. CommonJS entry point is: + + ```js + var protobuf = require("protobufjs/minimal"); + ``` + +[dist-full]: https://github.com/dcodeIO/protobuf.js/tree/master/dist +[dist-light]: https://github.com/dcodeIO/protobuf.js/tree/master/dist/light +[dist-minimal]: https://github.com/dcodeIO/protobuf.js/tree/master/dist/minimal + +Usage +----- + +Because JavaScript is a dynamically typed language, protobuf.js introduces the concept of a **valid message** in order to provide the best possible [performance](#performance) (and, as a side product, proper typings): + +### Valid message + +> A valid message is an object (1) not missing any required fields and (2) exclusively composed of JS types understood by the wire format writer. + +There are two possible types of valid messages and the encoder is able to work with both of these for convenience: + +* **Message instances** (explicit instances of message classes with default values on their prototype) always (have to) satisfy the requirements of a valid message by design and +* **Plain JavaScript objects** that just so happen to be composed in a way satisfying the requirements of a valid message as well. + +In a nutshell, the wire format writer understands the following types: + +| Field type | Expected JS type (create, encode) | Conversion (fromObject) +|------------|-----------------------------------|------------------------ +| s-/u-/int32
s-/fixed32 | `number` (32 bit integer) | value | 0 if signed
`value >>> 0` if unsigned +| s-/u-/int64
s-/fixed64 | `Long`-like (optimal)
`number` (53 bit integer) | `Long.fromValue(value)` with long.js
`parseInt(value, 10)` otherwise +| float
double | `number` | `Number(value)` +| bool | `boolean` | `Boolean(value)` +| string | `string` | `String(value)` +| bytes | `Uint8Array` (optimal)
`Buffer` (optimal under node)
`Array.` (8 bit integers) | `base64.decode(value)` if a `string`
`Object` with non-zero `.length` is assumed to be buffer-like +| enum | `number` (32 bit integer) | Looks up the numeric id if a `string` +| message | Valid message | `Message.fromObject(value)` + +* Explicit `undefined` and `null` are considered as not set if the field is optional. +* Repeated fields are `Array.`. +* Map fields are `Object.` with the key being the string representation of the respective value or an 8 characters long binary hash string for `Long`-likes. +* Types marked as *optimal* provide the best performance because no conversion step (i.e. number to low and high bits or base64 string to buffer) is required. + +### Toolset + +With that in mind and again for performance reasons, each message class provides a distinct set of methods with each method doing just one thing. This avoids unnecessary assertions / redundant operations where performance is a concern but also forces a user to perform verification (of plain JavaScript objects that *might* just so happen to be a valid message) explicitly where necessary - for example when dealing with user input. + +**Note** that `Message` below refers to any message class. + +* **Message.verify**(message: `Object`): `null|string`
+ verifies that a **plain JavaScript object** satisfies the requirements of a valid message and thus can be encoded without issues. Instead of throwing, it returns the error message as a string, if any. + + ```js + var payload = "invalid (not an object)"; + var err = AwesomeMessage.verify(payload); + if (err) + throw Error(err); + ``` + +* **Message.encode**(message: `Message|Object` [, writer: `Writer`]): `Writer`
+ encodes a **message instance** or valid **plain JavaScript object**. This method does not implicitly verify the message and it's up to the user to make sure that the payload is a valid message. + + ```js + var buffer = AwesomeMessage.encode(message).finish(); + ``` + +* **Message.encodeDelimited**(message: `Message|Object` [, writer: `Writer`]): `Writer`
+ works like `Message.encode` but additionally prepends the length of the message as a varint. + +* **Message.decode**(reader: `Reader|Uint8Array`): `Message`
+ decodes a buffer to a **message instance**. If required fields are missing, it throws a `util.ProtocolError` with an `instance` property set to the so far decoded message. If the wire format is invalid, it throws an `Error`. + + ```js + try { + var decodedMessage = AwesomeMessage.decode(buffer); + } catch (e) { + if (e instanceof protobuf.util.ProtocolError) { + // e.instance holds the so far decoded message with missing required fields + } else { + // wire format is invalid + } + } + ``` + +* **Message.decodeDelimited**(reader: `Reader|Uint8Array`): `Message`
+ works like `Message.decode` but additionally reads the length of the message prepended as a varint. + +* **Message.create**(properties: `Object`): `Message`
+ creates a new **message instance** from a set of properties that satisfy the requirements of a valid message. Where applicable, it is recommended to prefer `Message.create` over `Message.fromObject` because it doesn't perform possibly redundant conversion. + + ```js + var message = AwesomeMessage.create({ awesomeField: "AwesomeString" }); + ``` + +* **Message.fromObject**(object: `Object`): `Message`
+ converts any non-valid **plain JavaScript object** to a **message instance** using the conversion steps outlined within the table above. + + ```js + var message = AwesomeMessage.fromObject({ awesomeField: 42 }); + // converts awesomeField to a string + ``` + +* **Message.toObject**(message: `Message` [, options: `ConversionOptions`]): `Object`
+ converts a **message instance** to an arbitrary **plain JavaScript object** for interoperability with other libraries or storage. The resulting plain JavaScript object *might* still satisfy the requirements of a valid message depending on the actual conversion options specified, but most of the time it does not. + + ```js + var object = AwesomeMessage.toObject(message, { + enums: String, // enums as string names + longs: String, // longs as strings (requires long.js) + bytes: String, // bytes as base64 encoded strings + defaults: true, // includes default values + arrays: true, // populates empty arrays (repeated fields) even if defaults=false + objects: true, // populates empty objects (map fields) even if defaults=false + oneofs: true // includes virtual oneof fields set to the present field's name + }); + ``` + +For reference, the following diagram aims to display relationships between the different methods and the concept of a valid message: + +

Toolset Diagram

+ +> In other words: `verify` indicates that calling `create` or `encode` directly on the plain object will [result in a valid message respectively] succeed. `fromObject`, on the other hand, does conversion from a broader range of plain objects to create valid messages. ([ref](https://github.com/dcodeIO/protobuf.js/issues/748#issuecomment-291925749)) + +Examples +-------- + +### Using .proto files + +It is possible to load existing .proto files using the full library, which parses and compiles the definitions to ready to use (reflection-based) message classes: + +```protobuf +// awesome.proto +package awesomepackage; +syntax = "proto3"; + +message AwesomeMessage { + string awesome_field = 1; // becomes awesomeField +} +``` + +```js +protobuf.load("awesome.proto", function(err, root) { + if (err) + throw err; + + // Obtain a message type + var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); + + // Exemplary payload + var payload = { awesomeField: "AwesomeString" }; + + // Verify the payload if necessary (i.e. when possibly incomplete or invalid) + var errMsg = AwesomeMessage.verify(payload); + if (errMsg) + throw Error(errMsg); + + // Create a new message + var message = AwesomeMessage.create(payload); // or use .fromObject if conversion is necessary + + // Encode a message to an Uint8Array (browser) or Buffer (node) + var buffer = AwesomeMessage.encode(message).finish(); + // ... do something with buffer + + // Decode an Uint8Array (browser) or Buffer (node) to a message + var message = AwesomeMessage.decode(buffer); + // ... do something with message + + // If the application uses length-delimited buffers, there is also encodeDelimited and decodeDelimited. + + // Maybe convert the message back to a plain object + var object = AwesomeMessage.toObject(message, { + longs: String, + enums: String, + bytes: String, + // see ConversionOptions + }); +}); +``` + +Additionally, promise syntax can be used by omitting the callback, if preferred: + +```js +protobuf.load("awesome.proto") + .then(function(root) { + ... + }); +``` + +### Using JSON descriptors + +The library utilizes JSON descriptors that are equivalent to a .proto definition. For example, the following is identical to the .proto definition seen above: + +```json +// awesome.json +{ + "nested": { + "AwesomeMessage": { + "fields": { + "awesomeField": { + "type": "string", + "id": 1 + } + } + } + } +} +``` + +JSON descriptors closely resemble the internal reflection structure: + +| Type (T) | Extends | Type-specific properties +|--------------------|--------------------|------------------------- +| *ReflectionObject* | | options +| *Namespace* | *ReflectionObject* | nested +| Root | *Namespace* | **nested** +| Type | *Namespace* | **fields** +| Enum | *ReflectionObject* | **values** +| Field | *ReflectionObject* | rule, **type**, **id** +| MapField | Field | **keyType** +| OneOf | *ReflectionObject* | **oneof** (array of field names) +| Service | *Namespace* | **methods** +| Method | *ReflectionObject* | type, **requestType**, **responseType**, requestStream, responseStream + +* **Bold properties** are required. *Italic types* are abstract. +* `T.fromJSON(name, json)` creates the respective reflection object from a JSON descriptor +* `T#toJSON()` creates a JSON descriptor from the respective reflection object (its name is used as the key within the parent) + +Exclusively using JSON descriptors instead of .proto files enables the use of just the light library (the parser isn't required in this case). + +A JSON descriptor can either be loaded the usual way: + +```js +protobuf.load("awesome.json", function(err, root) { + if (err) throw err; + + // Continue at "Obtain a message type" above +}); +``` + +Or it can be loaded inline: + +```js +var jsonDescriptor = require("./awesome.json"); // exemplary for node + +var root = protobuf.Root.fromJSON(jsonDescriptor); + +// Continue at "Obtain a message type" above +``` + +### Using reflection only + +Both the full and the light library include full reflection support. One could, for example, define the .proto definitions seen in the examples above using just reflection: + +```js +... +var Root = protobuf.Root, + Type = protobuf.Type, + Field = protobuf.Field; + +var AwesomeMessage = new Type("AwesomeMessage").add(new Field("awesomeField", 1, "string")); + +var root = new Root().define("awesomepackage").add(AwesomeMessage); + +// Continue at "Create a new message" above +... +``` + +Detailed information on the reflection structure is available within the [API documentation](#additional-documentation). + +### Using custom classes + +Message classes can also be extended with custom functionality and it is also possible to register a custom constructor with a reflected message type: + +```js +... + +// Define a custom constructor +function AwesomeMessage(properties) { + // custom initialization code + ... +} + +// Register the custom constructor with its reflected type (*) +root.lookupType("awesomepackage.AwesomeMessage").ctor = AwesomeMessage; + +// Define custom functionality +AwesomeMessage.customStaticMethod = function() { ... }; +AwesomeMessage.prototype.customInstanceMethod = function() { ... }; + +// Continue at "Create a new message" above +``` + +(*) Besides referencing its reflected type through `AwesomeMessage.$type` and `AwesomeMesage#$type`, the respective custom class is automatically populated with: + +* `AwesomeMessage.create` +* `AwesomeMessage.encode` and `AwesomeMessage.encodeDelimited` +* `AwesomeMessage.decode` and `AwesomeMessage.decodeDelimited` +* `AwesomeMessage.verify` +* `AwesomeMessage.fromObject`, `AwesomeMessage.toObject`, `AwesomeMessage#toObject` and `AwesomeMessage#toJSON` + +Afterwards, decoded messages of this type are `instanceof AwesomeMessage`. + +Alternatively, it is also possible to reuse and extend the internal constructor if custom initialization code is not required: + +```js +... + +// Reuse the internal constructor +var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage").ctor; + +// Define custom functionality +AwesomeMessage.customStaticMethod = function() { ... }; +AwesomeMessage.prototype.customInstanceMethod = function() { ... }; + +// Continue at "Create a new message" above +``` + +### Using services + +The library also supports consuming services but it doesn't make any assumptions about the actual transport channel. Instead, a user must provide a suitable RPC implementation, which is an asynchronous function that takes the reflected service method, the binary request and a node-style callback as its parameters: + +```js +function rpcImpl(method, requestData, callback) { + // perform the request using an HTTP request or a WebSocket for example + var responseData = ...; + // and call the callback with the binary response afterwards: + callback(null, responseData); +} +``` + +Example: + +```protobuf +// greeter.proto +syntax = "proto3"; + +service Greeter { + rpc SayHello (HelloRequest) returns (HelloReply) {} +} + +message HelloRequest { + string name = 1; +} + +message HelloReply { + string message = 1; +} +``` + +```js +... +var Greeter = root.lookup("Greeter"); +var greeter = Greeter.create(/* see above */ rpcImpl, /* request delimited? */ false, /* response delimited? */ false); + +greeter.sayHello({ name: 'you' }, function(err, response) { + console.log('Greeting:', response.message); +}); +``` + +Services also support promises: + +```js +greeter.sayHello({ name: 'you' }) + .then(function(response) { + console.log('Greeting:', response.message); + }); +``` + +There is also an [example for streaming RPC](https://github.com/dcodeIO/protobuf.js/blob/master/examples/streaming-rpc.js). + +Note that the service API is meant for clients. Implementing a server-side endpoint pretty much always requires transport channel (i.e. http, websocket, etc.) specific code with the only common denominator being that it decodes and encodes messages. + +### Usage with TypeScript + +The library ships with its own [type definitions](https://github.com/dcodeIO/protobuf.js/blob/master/index.d.ts) and modern editors like [Visual Studio Code](https://code.visualstudio.com/) will automatically detect and use them for code completion. + +The npm package depends on [@types/node](https://www.npmjs.com/package/@types/node) because of `Buffer` and [@types/long](https://www.npmjs.com/package/@types/long) because of `Long`. If you are not building for node and/or not using long.js, it should be safe to exclude them manually. + +#### Using the JS API + +The API shown above works pretty much the same with TypeScript. However, because everything is typed, accessing fields on instances of dynamically generated message classes requires either using bracket-notation (i.e. `message["awesomeField"]`) or explicit casts. Alternatively, it is possible to use a [typings file generated for its static counterpart](#pbts-for-typescript). + +```ts +import { load } from "protobufjs"; // respectively "./node_modules/protobufjs" + +load("awesome.proto", function(err, root) { + if (err) + throw err; + + // example code + const AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); + + let message = AwesomeMessage.create({ awesomeField: "hello" }); + console.log(`message = ${JSON.stringify(message)}`); + + let buffer = AwesomeMessage.encode(message).finish(); + console.log(`buffer = ${Array.prototype.toString.call(buffer)}`); + + let decoded = AwesomeMessage.decode(buffer); + console.log(`decoded = ${JSON.stringify(decoded)}`); +}); +``` + +#### Using generated static code + +If you generated static code to `bundle.js` using the CLI and its type definitions to `bundle.d.ts`, then you can just do: + +```ts +import { AwesomeMessage } from "./bundle.js"; + +// example code +let message = AwesomeMessage.create({ awesomeField: "hello" }); +let buffer = AwesomeMessage.encode(message).finish(); +let decoded = AwesomeMessage.decode(buffer); +``` + +#### Using decorators + +The library also includes an early implementation of [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html). + +**Note** that decorators are an experimental feature in TypeScript and that declaration order is important depending on the JS target. For example, `@Field.d(2, AwesomeArrayMessage)` requires that `AwesomeArrayMessage` has been defined earlier when targeting `ES5`. + +```ts +import { Message, Type, Field, OneOf } from "protobufjs/light"; // respectively "./node_modules/protobufjs/light.js" + +export class AwesomeSubMessage extends Message { + + @Field.d(1, "string") + public awesomeString: string; + +} + +export enum AwesomeEnum { + ONE = 1, + TWO = 2 +} + +@Type.d("SuperAwesomeMessage") +export class AwesomeMessage extends Message { + + @Field.d(1, "string", "optional", "awesome default string") + public awesomeField: string; + + @Field.d(2, AwesomeSubMessage) + public awesomeSubMessage: AwesomeSubMessage; + + @Field.d(3, AwesomeEnum, "optional", AwesomeEnum.ONE) + public awesomeEnum: AwesomeEnum; + + @OneOf.d("awesomeSubMessage", "awesomeEnum") + public which: string; + +} + +// example code +let message = new AwesomeMessage({ awesomeField: "hello" }); +let buffer = AwesomeMessage.encode(message).finish(); +let decoded = AwesomeMessage.decode(buffer); +``` + +Supported decorators are: + +* **Type.d(typeName?: `string`)**   *(optional)*
+ annotates a class as a protobuf message type. If `typeName` is not specified, the constructor's runtime function name is used for the reflected type. + +* **Field.d<T>(fieldId: `number`, fieldType: `string | Constructor`, fieldRule?: `"optional" | "required" | "repeated"`, defaultValue?: `T`)**
+ annotates a property as a protobuf field with the specified id and protobuf type. + +* **MapField.d<T extends { [key: string]: any }>(fieldId: `number`, fieldKeyType: `string`, fieldValueType. `string | Constructor<{}>`)**
+ annotates a property as a protobuf map field with the specified id, protobuf key and value type. + +* **OneOf.d<T extends string>(...fieldNames: `string[]`)**
+ annotates a property as a protobuf oneof covering the specified fields. + +Other notes: + +* Decorated types reside in `protobuf.roots["decorated"]` using a flat structure, so no duplicate names. +* Enums are copied to a reflected enum with a generic name on decorator evaluation because referenced enum objects have no runtime name the decorator could use. +* Default values must be specified as arguments to the decorator instead of using a property initializer for proper prototype behavior. +* Property names on decorated classes must not be renamed on compile time (i.e. by a minifier) because decorators just receive the original field name as a string. + +**ProTip!** Not as pretty, but you can [use decorators in plain JavaScript](https://github.com/dcodeIO/protobuf.js/blob/master/examples/js-decorators.js) as well. + +Command line +------------ + +**Note** that moving the CLI to [its own package](./cli) is a work in progress. At the moment, it's still part of the main package. + +The command line interface (CLI) can be used to translate between file formats and to generate static code as well as TypeScript definitions. + +### pbjs for JavaScript + +``` +Translates between file formats and generates static code. + + -t, --target Specifies the target format. Also accepts a path to require a custom target. + + json JSON representation + json-module JSON representation as a module + proto2 Protocol Buffers, Version 2 + proto3 Protocol Buffers, Version 3 + static Static code without reflection (non-functional on its own) + static-module Static code without reflection as a module + + -p, --path Adds a directory to the include path. + + -o, --out Saves to a file instead of writing to stdout. + + --sparse Exports only those types referenced from a main file (experimental). + + Module targets only: + + -w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper. + + default Default wrapper supporting both CommonJS and AMD + commonjs CommonJS wrapper + amd AMD wrapper + es6 ES6 wrapper (implies --es6) + closure A closure adding to protobuf.roots where protobuf is a global + + -r, --root Specifies an alternative protobuf.roots name. + + -l, --lint Linter configuration. Defaults to protobuf.js-compatible rules: + + eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins + + --es6 Enables ES6 syntax (const/let instead of var) + + Proto sources only: + + --keep-case Keeps field casing instead of converting to camel case. + + Static targets only: + + --no-create Does not generate create functions used for reflection compatibility. + --no-encode Does not generate encode functions. + --no-decode Does not generate decode functions. + --no-verify Does not generate verify functions. + --no-convert Does not generate convert functions like from/toObject + --no-delimited Does not generate delimited encode/decode functions. + --no-beautify Does not beautify generated code. + --no-comments Does not output any JSDoc comments. + + --force-long Enfores the use of 'Long' for s-/u-/int64 and s-/fixed64 fields. + --force-message Enfores the use of message instances instead of plain objects. + +usage: pbjs [options] file1.proto file2.json ... (or pipe) other | pbjs [options] - +``` + +For production environments it is recommended to bundle all your .proto files to a single .json file, which minimizes the number of network requests and avoids any parser overhead (hint: works with just the **light** library): + +``` +$> pbjs -t json file1.proto file2.proto > bundle.json +``` + +Now, either include this file in your final bundle: + +```js +var root = protobuf.Root.fromJSON(require("./bundle.json")); +``` + +or load it the usual way: + +```js +protobuf.load("bundle.json", function(err, root) { + ... +}); +``` + +Generated static code, on the other hand, works with just the **minimal** library. For example + +``` +$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto +``` + +will generate static code for definitions within `file1.proto` and `file2.proto` to a CommonJS module `compiled.js`. + +**ProTip!** Documenting your .proto files with `/** ... */`-blocks or (trailing) `/// ...` lines translates to generated static code. + + +### pbts for TypeScript + +``` +Generates TypeScript definitions from annotated JavaScript files. + + -o, --out Saves to a file instead of writing to stdout. + + -g, --global Name of the global object in browser environments, if any. + + --no-comments Does not output any JSDoc comments. + + Internal flags: + + -n, --name Wraps everything in a module of the specified name. + + -m, --main Whether building the main library without any imports. + +usage: pbts [options] file1.js file2.js ... (or) other | pbts [options] - +``` + +Picking up on the example above, the following not only generates static code to a CommonJS module `compiled.js` but also its respective TypeScript definitions to `compiled.d.ts`: + +``` +$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto +$> pbts -o compiled.d.ts compiled.js +``` + +Additionally, TypeScript definitions of static modules are compatible with their reflection-based counterparts (i.e. as exported by JSON modules), as long as the following conditions are met: + +1. Instead of using `new SomeMessage(...)`, always use `SomeMessage.create(...)` because reflection objects do not provide a constructor. +2. Types, services and enums must start with an uppercase letter to become available as properties of the reflected types as well (i.e. to be able to use `MyMessage.MyEnum` instead of `root.lookup("MyMessage.MyEnum")`). + +For example, the following generates a JSON module `bundle.js` and a `bundle.d.ts`, but no static code: + +``` +$> pbjs -t json-module -w commonjs -o bundle.js file1.proto file2.proto +$> pbjs -t static-module file1.proto file2.proto | pbts -o bundle.d.ts - +``` + +### Reflection vs. static code + +While using .proto files directly requires the full library respectively pure reflection/JSON the light library, pretty much all code but the relatively short descriptors is shared. + +Static code, on the other hand, requires just the minimal library, but generates additional source code without any reflection features. This also implies that there is a break-even point where statically generated code becomes larger than descriptor-based code once the amount of code generated exceeds the size of the full respectively light library. + +There is no significant difference performance-wise as the code generated statically is pretty much the same as generated at runtime and both are largely interchangeable as seen in the previous section. + +| Source | Library | Advantages | Tradeoffs +|--------|---------|------------|----------- +| .proto | full | Easily editable
Interoperability with other libraries
No compile step | Some parsing and possibly network overhead +| JSON | light | Easily editable
No parsing overhead
Single bundle (no network overhead) | protobuf.js specific
Has a compile step +| static | minimal | Works where `eval` access is restricted
Fully documented
Small footprint for small protos | Can be hard to edit
No reflection
Has a compile step + +### Command line API + +Both utilities can be used programmatically by providing command line arguments and a callback to their respective `main` functions: + +```js +var pbjs = require("protobufjs/cli/pbjs"); // or require("protobufjs/cli").pbjs / .pbts + +pbjs.main([ "--target", "json-module", "path/to/myproto.proto" ], function(err, output) { + if (err) + throw err; + // do something with output +}); +``` + +Additional documentation +------------------------ + +#### Protocol Buffers +* [Google's Developer Guide](https://developers.google.com/protocol-buffers/docs/overview) + +#### protobuf.js +* [API Documentation](http://dcode.io/protobuf.js) +* [CHANGELOG](https://github.com/dcodeIO/protobuf.js/blob/master/CHANGELOG.md) +* [Frequently asked questions](https://github.com/dcodeIO/protobuf.js/wiki) on our wiki + +#### Community +* [Questions and answers](http://stackoverflow.com/search?tab=newest&q=protobuf.js) on StackOverflow + +Performance +----------- +The package includes a benchmark that compares protobuf.js performance to native JSON (as far as this is possible) and [Google's JS implementation](https://github.com/google/protobuf/tree/master/js). On an i7-2600K running node 6.9.1 it yields: + +``` +benchmarking encoding performance ... + +protobuf.js (reflect) x 541,707 ops/sec ±1.13% (87 runs sampled) +protobuf.js (static) x 548,134 ops/sec ±1.38% (89 runs sampled) +JSON (string) x 318,076 ops/sec ±0.63% (93 runs sampled) +JSON (buffer) x 179,165 ops/sec ±2.26% (91 runs sampled) +google-protobuf x 74,406 ops/sec ±0.85% (86 runs sampled) + + protobuf.js (static) was fastest + protobuf.js (reflect) was 0.9% ops/sec slower (factor 1.0) + JSON (string) was 41.5% ops/sec slower (factor 1.7) + JSON (buffer) was 67.6% ops/sec slower (factor 3.1) + google-protobuf was 86.4% ops/sec slower (factor 7.3) + +benchmarking decoding performance ... + +protobuf.js (reflect) x 1,383,981 ops/sec ±0.88% (93 runs sampled) +protobuf.js (static) x 1,378,925 ops/sec ±0.81% (93 runs sampled) +JSON (string) x 302,444 ops/sec ±0.81% (93 runs sampled) +JSON (buffer) x 264,882 ops/sec ±0.81% (93 runs sampled) +google-protobuf x 179,180 ops/sec ±0.64% (94 runs sampled) + + protobuf.js (reflect) was fastest + protobuf.js (static) was 0.3% ops/sec slower (factor 1.0) + JSON (string) was 78.1% ops/sec slower (factor 4.6) + JSON (buffer) was 80.8% ops/sec slower (factor 5.2) + google-protobuf was 87.0% ops/sec slower (factor 7.7) + +benchmarking combined performance ... + +protobuf.js (reflect) x 275,900 ops/sec ±0.78% (90 runs sampled) +protobuf.js (static) x 290,096 ops/sec ±0.96% (90 runs sampled) +JSON (string) x 129,381 ops/sec ±0.77% (90 runs sampled) +JSON (buffer) x 91,051 ops/sec ±0.94% (90 runs sampled) +google-protobuf x 42,050 ops/sec ±0.85% (91 runs sampled) + + protobuf.js (static) was fastest + protobuf.js (reflect) was 4.7% ops/sec slower (factor 1.0) + JSON (string) was 55.3% ops/sec slower (factor 2.2) + JSON (buffer) was 68.6% ops/sec slower (factor 3.2) + google-protobuf was 85.5% ops/sec slower (factor 6.9) +``` + +These results are achieved by + +* generating type-specific encoders, decoders, verifiers and converters at runtime +* configuring the reader/writer interface according to the environment +* using node-specific functionality where beneficial and, of course +* avoiding unnecessary operations through splitting up [the toolset](#toolset). + +You can also run [the benchmark](https://github.com/dcodeIO/protobuf.js/blob/master/bench/index.js) ... + +``` +$> npm run bench +``` + +and [the profiler](https://github.com/dcodeIO/protobuf.js/blob/master/bench/prof.js) yourself (the latter requires a recent version of node): + +``` +$> npm run prof [iterations=10000000] +``` + +Note that as of this writing, the benchmark suite performs significantly slower on node 7.2.0 compared to 6.9.1 because moths. + +Compatibility +------------- + +* Works in all modern and not-so-modern browsers except IE8. +* Because the internals of this package do not rely on `google/protobuf/descriptor.proto`, options are parsed and presented literally. +* If typed arrays are not supported by the environment, plain arrays will be used instead. +* Support for pre-ES5 environments (except IE8) can be achieved by [using a polyfill](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/polyfill.js). +* Support for [Content Security Policy](https://w3c.github.io/webappsec-csp/)-restricted environments (like Chrome extensions without [unsafe-eval](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval)) can be achieved by generating and using static code instead. +* If a proper way to work with 64 bit values (uint64, int64 etc.) is required, just install [long.js](https://github.com/dcodeIO/long.js) alongside this library. All 64 bit numbers will then be returned as a `Long` instance instead of a possibly unsafe JavaScript number ([see](https://github.com/dcodeIO/long.js)). +* For descriptor.proto interoperability, see [ext/descriptor](https://github.com/dcodeIO/protobuf.js/tree/master/ext/descriptor) + +Building +-------- + +To build the library or its components yourself, clone it from GitHub and install the development dependencies: + +``` +$> git clone https://github.com/dcodeIO/protobuf.js.git +$> cd protobuf.js +$> npm install +``` + +Building the respective development and production versions with their respective source maps to `dist/`: + +``` +$> npm run build +``` + +Building the documentation to `docs/`: + +``` +$> npm run docs +``` + +Building the TypeScript definition to `index.d.ts`: + +``` +$> npm run types +``` + +### Browserify integration + +By default, protobuf.js integrates into any browserify build-process without requiring any optional modules. Hence: + +* If int64 support is required, explicitly require the `long` module somewhere in your project as it will be excluded otherwise. This assumes that a global `require` function is present that protobuf.js can call to obtain the long module. + + If there is no global `require` function present after bundling, it's also possible to assign the long module programmatically: + + ```js + var Long = ...; + + protobuf.util.Long = Long; + protobuf.configure(); + ``` + +* If you have any special requirements, there is [the bundler](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/bundle.js) for reference. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/protobufjs/bin/pbjs b/node_modules/protobufjs/bin/pbjs new file mode 100644 index 0000000..6a5d49a --- /dev/null +++ b/node_modules/protobufjs/bin/pbjs @@ -0,0 +1,6 @@ +#!/usr/bin/env node +var path = require("path"), + cli = require(path.join(__dirname, "..", "cli", "pbjs.js")); +var ret = cli.main(process.argv.slice(2)); +if (typeof ret === 'number') + process.exit(ret); diff --git a/node_modules/protobufjs/bin/pbts b/node_modules/protobufjs/bin/pbts new file mode 100644 index 0000000..cb1cdaf --- /dev/null +++ b/node_modules/protobufjs/bin/pbts @@ -0,0 +1,6 @@ +#!/usr/bin/env node +var path = require("path"), + cli = require(path.join(__dirname, "..", "cli", "pbts.js")); +var ret = cli.main(process.argv.slice(2)); +if (typeof ret === 'number') + process.exit(ret); diff --git a/node_modules/protobufjs/cli/LICENSE b/node_modules/protobufjs/cli/LICENSE new file mode 100644 index 0000000..e5f7a5c --- /dev/null +++ b/node_modules/protobufjs/cli/LICENSE @@ -0,0 +1,33 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +Code generated by the command line utilities is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. diff --git a/node_modules/protobufjs/cli/README.md b/node_modules/protobufjs/cli/README.md new file mode 100644 index 0000000..1eb4c86 --- /dev/null +++ b/node_modules/protobufjs/cli/README.md @@ -0,0 +1,11 @@ +protobufjs-cli +============== +[![npm](https://img.shields.io/npm/v/protobufjscli.svg)](https://www.npmjs.com/package/protobufjs-cli) + +Command line interface (CLI) for [protobuf.js](https://github.com/dcodeIO/protobuf.js). Translates between file formats and generates static code as well as TypeScript definitions. + +* [CLI Documentation](https://github.com/dcodeIO/protobuf.js#command-line) + +**Note** that moving the CLI to its own package is a work in progress. At the moment, it's still part of the main package. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/node_modules/protobufjs/cli/bin/pbjs b/node_modules/protobufjs/cli/bin/pbjs new file mode 100644 index 0000000..9bfedb3 --- /dev/null +++ b/node_modules/protobufjs/cli/bin/pbjs @@ -0,0 +1,6 @@ +#!/usr/bin/env node +var path = require("path"), + cli = require(path.join(__dirname, "..", "pbjs.js")); +var ret = cli.main(process.argv.slice(2)); +if (typeof ret === 'number') + process.exit(ret); diff --git a/node_modules/protobufjs/cli/bin/pbts b/node_modules/protobufjs/cli/bin/pbts new file mode 100644 index 0000000..48d392c --- /dev/null +++ b/node_modules/protobufjs/cli/bin/pbts @@ -0,0 +1,6 @@ +#!/usr/bin/env node +var path = require("path"), + cli = require(path.join(__dirname, "..", "pbts.js")); +var ret = cli.main(process.argv.slice(2)); +if (typeof ret === 'number') + process.exit(ret); diff --git a/node_modules/protobufjs/cli/index.d.ts b/node_modules/protobufjs/cli/index.d.ts new file mode 100644 index 0000000..09c2026 --- /dev/null +++ b/node_modules/protobufjs/cli/index.d.ts @@ -0,0 +1,3 @@ +import * as pbjs from "./pbjs.js"; +import * as pbts from "./pbts.js"; +export { pbjs, pbts }; diff --git a/node_modules/protobufjs/cli/index.js b/node_modules/protobufjs/cli/index.js new file mode 100644 index 0000000..c565aa6 --- /dev/null +++ b/node_modules/protobufjs/cli/index.js @@ -0,0 +1,3 @@ +"use strict"; +exports.pbjs = require("./pbjs"); +exports.pbts = require("./pbts"); diff --git a/node_modules/protobufjs/cli/lib/tsd-jsdoc.json b/node_modules/protobufjs/cli/lib/tsd-jsdoc.json new file mode 100644 index 0000000..b5fe1d9 --- /dev/null +++ b/node_modules/protobufjs/cli/lib/tsd-jsdoc.json @@ -0,0 +1,18 @@ +{ + "tags": { + "allowUnknownTags": false + }, + "plugins": [ + "./tsd-jsdoc/plugin" + ], + "opts": { + "encoding" : "utf8", + "recurse" : true, + "lenient" : true, + "template" : "./tsd-jsdoc", + + "private" : false, + "comments" : true, + "destination" : false + } +} diff --git a/node_modules/protobufjs/cli/lib/tsd-jsdoc/LICENSE b/node_modules/protobufjs/cli/lib/tsd-jsdoc/LICENSE new file mode 100644 index 0000000..e5aebc9 --- /dev/null +++ b/node_modules/protobufjs/cli/lib/tsd-jsdoc/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2016 Chad Engler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/protobufjs/cli/lib/tsd-jsdoc/README.md b/node_modules/protobufjs/cli/lib/tsd-jsdoc/README.md new file mode 100644 index 0000000..beed748 --- /dev/null +++ b/node_modules/protobufjs/cli/lib/tsd-jsdoc/README.md @@ -0,0 +1,23 @@ +protobuf.js fork of tsd-jsdoc +============================= + +This is a modified version of [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc) v1.0.1 for use with protobuf.js, parked here so we can process issues and pull requests. The ultimate goal is to switch back to the a recent version of tsd-jsdoc once it meets our needs. + +Options +------- + +* **module: `string`**
+ Wraps everything in a module of the specified name. + +* **private: `boolean`**
+ Includes private members when set to `true`. + +* **comments: `boolean`**
+ Skips comments when explicitly set to `false`. + +* **destination: `string|boolean`**
+ Saves to the specified destination file or to console when set to `false`. + +Setting options on the command line +----------------------------------- +Providing `-q, --query ` on the command line will set respectively override existing options. Example: `-q module=protobufjs` diff --git a/node_modules/protobufjs/cli/lib/tsd-jsdoc/plugin.js b/node_modules/protobufjs/cli/lib/tsd-jsdoc/plugin.js new file mode 100644 index 0000000..1bf4f42 --- /dev/null +++ b/node_modules/protobufjs/cli/lib/tsd-jsdoc/plugin.js @@ -0,0 +1,21 @@ +"use strict"; +exports.defineTags = function(dictionary) { + + dictionary.defineTag("template", { + mustHaveValue: true, + canHaveType: false, + canHaveName: false, + onTagged: function(doclet, tag) { + (doclet.templates || (doclet.templates = [])).push(tag.text); + } + }); + + dictionary.defineTag("tstype", { + mustHaveValue: true, + canHaveType: false, + canHaveName: false, + onTagged: function(doclet, tag) { + doclet.tsType = tag.text; + } + }); +}; diff --git a/node_modules/protobufjs/cli/lib/tsd-jsdoc/publish.js b/node_modules/protobufjs/cli/lib/tsd-jsdoc/publish.js new file mode 100644 index 0000000..47be4e5 --- /dev/null +++ b/node_modules/protobufjs/cli/lib/tsd-jsdoc/publish.js @@ -0,0 +1,693 @@ +"use strict"; + +var fs = require("fs"); + +// output stream +var out = null; + +// documentation data +var data = null; + +// already handled objects, by name +var seen = {}; + +// indentation level +var indent = 0; + +// whether indent has been written for the current line yet +var indentWritten = false; + +// provided options +var options = {}; + +// queued interfaces +var queuedInterfaces = []; + +// whether writing the first line +var firstLine = true; + +// JSDoc hook +exports.publish = function publish(taffy, opts) { + options = opts || {}; + + // query overrides options + if (options.query) + Object.keys(options.query).forEach(function(key) { + if (key !== "query") + switch (options[key] = options.query[key]) { + case "true": + options[key] = true; + break; + case "false": + options[key] = false; + break; + case "null": + options[key] = null; + break; + } + }); + + // remove undocumented + taffy({ undocumented: true }).remove(); + taffy({ ignore: true }).remove(); + taffy({ inherited: true }).remove(); + + // remove private + if (!options.private) + taffy({ access: "private" }).remove(); + + // setup output + out = options.destination + ? fs.createWriteStream(options.destination) + : process.stdout; + + try { + // setup environment + data = taffy().get(); + indent = 0; + indentWritten = false; + firstLine = true; + + // wrap everything in a module if configured + if (options.module) { + writeln("export = ", options.module, ";"); + writeln(); + writeln("declare namespace ", options.module, " {"); + writeln(); + ++indent; + } + + // handle all + getChildrenOf(undefined).forEach(function(child) { + handleElement(child, null); + }); + + // process queued + while (queuedInterfaces.length) { + var element = queuedInterfaces.shift(); + begin(element); + writeInterface(element); + writeln(";"); + } + + // end wrap + if (options.module) { + --indent; + writeln("}"); + } + + // close file output + if (out !== process.stdout) + out.end(); + + } finally { + // gc environment objects + out = data = null; + seen = options = {}; + queuedInterfaces = []; + } +}; + +// +// Utility +// + +// writes one or multiple strings +function write() { + var s = Array.prototype.slice.call(arguments).join(""); + if (!indentWritten) { + for (var i = 0; i < indent; ++i) + s = " " + s; + indentWritten = true; + } + out.write(s); + firstLine = false; +} + +// writes zero or multiple strings, followed by a new line +function writeln() { + var s = Array.prototype.slice.call(arguments).join(""); + if (s.length) + write(s, "\n"); + else if (!firstLine) + out.write("\n"); + indentWritten = false; +} + +var keepTags = [ + "param", + "returns", + "throws", + "see" +]; + +// parses a comment into text and tags +function parseComment(comment) { + var lines = comment.replace(/^ *\/\*\* *|^ *\*\/| *\*\/ *$|^ *\* */mg, "").trim().split(/\r?\n|\r/g); // property.description has just "\r" ?! + var desc; + var text = []; + var tags = null; + for (var i = 0; i < lines.length; ++i) { + var match = /^@(\w+)\b/.exec(lines[i]); + if (match) { + if (!tags) { + tags = []; + desc = text; + } + text = []; + tags.push({ name: match[1], text: text }); + lines[i] = lines[i].substring(match[1].length + 1).trim(); + } + if (lines[i].length || text.length) + text.push(lines[i]); + } + return { + text: desc || text, + tags: tags || [] + }; +} + +// writes a comment +function writeComment(comment, otherwiseNewline) { + if (!comment || options.comments === false) { + if (otherwiseNewline) + writeln(); + return; + } + if (typeof comment !== "object") + comment = parseComment(comment); + comment.tags = comment.tags.filter(function(tag) { + return keepTags.indexOf(tag.name) > -1 && (tag.name !== "returns" || tag.text[0] !== "{undefined}"); + }); + writeln(); + if (!comment.tags.length && comment.text.length < 2) { + writeln("/** " + comment.text[0] + " */"); + return; + } + writeln("/**"); + comment.text.forEach(function(line) { + if (line.length) + writeln(" * ", line); + else + writeln(" *"); + }); + comment.tags.forEach(function(tag) { + var started = false; + if (tag.text.length) { + tag.text.forEach(function(line, i) { + if (i > 0) + write(" * "); + else if (tag.name !== "throws") + line = line.replace(/^\{[^\s]*} ?/, ""); + if (!line.length) + return; + if (!started) { + write(" * @", tag.name, " "); + started = true; + } + writeln(line); + }); + } + }); + writeln(" */"); +} + +// recursively replaces all occurencies of re's match +function replaceRecursive(name, re, fn) { + var found; + + function replacer() { + found = true; + return fn.apply(null, arguments); + } + + do { + found = false; + name = name.replace(re, replacer); + } while (found); + return name; +} + +// tests if an element is considered to be a class or class-like +function isClassLike(element) { + return isClass(element) || isInterface(element); +} + +// tests if an element is considered to be a class +function isClass(element) { + return element && element.kind === "class"; +} + +// tests if an element is considered to be an interface +function isInterface(element) { + return element && (element.kind === "interface" || element.kind === "mixin"); +} + +// tests if an element is considered to be a namespace +function isNamespace(element) { + return element && (element.kind === "namespace" || element.kind === "module"); +} + +// gets all children of the specified parent +function getChildrenOf(parent) { + var memberof = parent ? parent.longname : undefined; + return data.filter(function(element) { + return element.memberof === memberof; + }); +} + +// gets the literal type of an element +function getTypeOf(element) { + if (element.tsType) + return element.tsType.replace(/\r?\n|\r/g, "\n"); + var name = "any"; + var type = element.type; + if (type && type.names && type.names.length) { + if (type.names.length === 1) + name = element.type.names[0].trim(); + else + name = "(" + element.type.names.join("|") + ")"; + } else + return name; + + // Replace catchalls with any + name = name.replace(/\*|\bmixed\b/g, "any"); + + // Ensure upper case Object for map expressions below + name = name.replace(/\bobject\b/g, "Object"); + + // Correct Something. to Something + name = replaceRecursive(name, /\b(?!Object|Array)([\w$]+)\.<([^>]*)>/gi, function($0, $1, $2) { + return $1 + "<" + $2 + ">"; + }); + + // Replace Array. with string[] + name = replaceRecursive(name, /\bArray\.?<([^>]*)>/gi, function($0, $1) { + return $1 + "[]"; + }); + + // Replace Object. with { [k: string]: number } + name = replaceRecursive(name, /\bObject\.?<([^,]*), *([^>]*)>/gi, function($0, $1, $2) { + return "{ [k: " + $1 + "]: " + $2 + " }"; + }); + + // Replace functions (there are no signatures) with Function + name = name.replace(/\bfunction(?:\(\))?\b/g, "Function"); + + // Convert plain Object back to just object + name = name.replace(/\b(Object\b(?!\.))/g, function($0, $1) { + return $1.toLowerCase(); + }); + + return name; +} + +// begins writing the definition of the specified element +function begin(element, is_interface) { + if (!seen[element.longname]) { + if (isClass(element)) { + var comment = parseComment(element.comment); + var classdesc = comment.tags.find(function(tag) { return tag.name === "classdesc"; }); + if (classdesc) { + comment.text = classdesc.text; + comment.tags = []; + } + writeComment(comment, true); + } else + writeComment(element.comment, is_interface || isClassLike(element) || isNamespace(element) || element.isEnum || element.scope === "global"); + seen[element.longname] = element; + } else + writeln(); + if (element.scope !== "global" || options.module) + return; + write("export "); +} + +// writes the function signature describing element +function writeFunctionSignature(element, isConstructor, isTypeDef) { + write("("); + + var params = {}; + + // this type + if (element.this) + params["this"] = { + type: element.this.replace(/^{|}$/g, ""), + optional: false + }; + + // parameter types + if (element.params) + element.params.forEach(function(param) { + var path = param.name.split(/\./g); + if (path.length === 1) + params[param.name] = { + type: getTypeOf(param), + variable: param.variable === true, + optional: param.optional === true, + defaultValue: param.defaultvalue // Not used yet (TODO) + }; + else // Property syntax (TODO) + params[path[0]].type = "{ [k: string]: any }"; + }); + + var paramNames = Object.keys(params); + paramNames.forEach(function(name, i) { + var param = params[name]; + var type = param.type; + if (param.variable) { + name = "..." + name; + type = param.type.charAt(0) === "(" ? "any[]" : param.type + "[]"; + } + write(name, !param.variable && param.optional ? "?: " : ": ", type); + if (i < paramNames.length - 1) + write(", "); + }); + + write(")"); + + // return type + if (!isConstructor) { + write(isTypeDef ? " => " : ": "); + var typeName; + if (element.returns && element.returns.length && (typeName = getTypeOf(element.returns[0])) !== "undefined") + write(typeName); + else + write("void"); + } +} + +// writes (a typedef as) an interface +function writeInterface(element) { + write("interface ", element.name); + writeInterfaceBody(element); + writeln(); +} + +function writeInterfaceBody(element) { + writeln("{"); + ++indent; + if (element.tsType) + writeln(element.tsType.replace(/\r?\n|\r/g, "\n")); + else if (element.properties && element.properties.length) + element.properties.forEach(writeProperty); + --indent; + write("}"); +} + +function writeProperty(property, declare) { + writeComment(property.description); + if (declare) + write("let "); + write(property.name); + if (property.optional) + write("?"); + writeln(": ", getTypeOf(property), ";"); +} + +// +// Handlers +// + +// handles a single element of any understood type +function handleElement(element, parent) { + if (element.scope === "inner") + return false; + + if (element.optional !== true && element.type && element.type.names && element.type.names.length) { + for (var i = 0; i < element.type.names.length; i++) { + if (element.type.names[i].toLowerCase() === "undefined") { + // This element is actually optional. Set optional to true and + // remove the 'undefined' type + element.optional = true; + element.type.names.splice(i, 1); + i--; + } + } + } + + if (seen[element.longname]) + return true; + if (isClassLike(element)) + handleClass(element, parent); + else switch (element.kind) { + case "module": + case "namespace": + handleNamespace(element, parent); + break; + case "constant": + case "member": + handleMember(element, parent); + break; + case "function": + handleFunction(element, parent); + break; + case "typedef": + handleTypeDef(element, parent); + break; + case "package": + break; + } + seen[element.longname] = element; + return true; +} + +// handles (just) a namespace +function handleNamespace(element/*, parent*/) { + var children = getChildrenOf(element); + if (!children.length) + return; + var first = true; + if (element.properties) + element.properties.forEach(function(property) { + if (!/^[$\w]+$/.test(property.name)) // incompatible in namespace + return; + if (first) { + begin(element); + writeln("namespace ", element.name, " {"); + ++indent; + first = false; + } + writeProperty(property, true); + }); + children.forEach(function(child) { + if (child.scope === "inner" || seen[child.longname]) + return; + if (first) { + begin(element); + writeln("namespace ", element.name, " {"); + ++indent; + first = false; + } + handleElement(child, element); + }); + if (!first) { + --indent; + writeln("}"); + } +} + +// a filter function to remove any module references +function notAModuleReference(ref) { + return ref.indexOf("module:") === -1; +} + +// handles a class or class-like +function handleClass(element, parent) { + var is_interface = isInterface(element); + begin(element, is_interface); + if (is_interface) + write("interface "); + else { + if (element.virtual) + write("abstract "); + write("class "); + } + write(element.name); + if (element.templates && element.templates.length) + write("<", element.templates.join(", "), ">"); + write(" "); + + // extended classes + if (element.augments) { + var augments = element.augments.filter(notAModuleReference); + if (augments.length) + write("extends ", augments[0], " "); + } + + // implemented interfaces + var impls = []; + if (element.implements) + Array.prototype.push.apply(impls, element.implements); + if (element.mixes) + Array.prototype.push.apply(impls, element.mixes); + impls = impls.filter(notAModuleReference); + if (impls.length) + write("implements ", impls.join(", "), " "); + + writeln("{"); + ++indent; + + if (element.tsType) + writeln(element.tsType.replace(/\r?\n|\r/g, "\n")); + + // constructor + if (!is_interface && !element.virtual) + handleFunction(element, parent, true); + + // properties + if (is_interface && element.properties) + element.properties.forEach(function(property) { + writeProperty(property); + }); + + // class-compatible members + var incompatible = []; + getChildrenOf(element).forEach(function(child) { + if (isClassLike(child) || child.kind === "module" || child.kind === "typedef" || child.isEnum) { + incompatible.push(child); + return; + } + handleElement(child, element); + }); + + --indent; + writeln("}"); + + // class-incompatible members + if (incompatible.length) { + writeln(); + if (element.scope === "global" && !options.module) + write("export "); + writeln("namespace ", element.name, " {"); + ++indent; + incompatible.forEach(function(child) { + handleElement(child, element); + }); + --indent; + writeln("}"); + } +} + +// handles a namespace or class member +function handleMember(element, parent) { + begin(element); + + if (element.isEnum) { + var stringEnum = false; + element.properties.forEach(function(property) { + if (isNaN(property.defaultvalue)) { + stringEnum = true; + } + }); + if (stringEnum) { + writeln("type ", element.name, " ="); + ++indent; + element.properties.forEach(function(property, i) { + write(i === 0 ? "" : "| ", JSON.stringify(property.defaultvalue)); + }); + --indent; + writeln(";"); + } else { + writeln("enum ", element.name, " {"); + ++indent; + element.properties.forEach(function(property, i) { + write(property.name); + if (property.defaultvalue !== undefined) + write(" = ", JSON.stringify(property.defaultvalue)); + if (i < element.properties.length - 1) + writeln(","); + else + writeln(); + }); + --indent; + writeln("}"); + } + + } else { + + var inClass = isClassLike(parent); + if (inClass) { + write(element.access || "public", " "); + if (element.scope === "static") + write("static "); + if (element.readonly) + write("readonly "); + } else + write(element.kind === "constant" ? "const " : "let "); + + write(element.name); + if (element.optional) + write("?"); + write(": "); + + if (element.type && element.type.names && /^Object\b/i.test(element.type.names[0]) && element.properties) { + writeln("{"); + ++indent; + element.properties.forEach(function(property, i) { + writeln(JSON.stringify(property.name), ": ", getTypeOf(property), i < element.properties.length - 1 ? "," : ""); + }); + --indent; + writeln("};"); + } else + writeln(getTypeOf(element), ";"); + } +} + +// handles a function or method +function handleFunction(element, parent, isConstructor) { + var insideClass = true; + if (isConstructor) { + writeComment(element.comment); + write("constructor"); + } else { + begin(element); + insideClass = isClassLike(parent); + if (insideClass) { + write(element.access || "public", " "); + if (element.scope === "static") + write("static "); + } else + write("function "); + write(element.name); + if (element.templates && element.templates.length) + write("<", element.templates.join(", "), ">"); + } + writeFunctionSignature(element, isConstructor, false); + writeln(";"); + if (!insideClass) + handleNamespace(element); +} + +// handles a type definition (not a real type) +function handleTypeDef(element, parent) { + if (isInterface(element)) { + if (isClassLike(parent)) + queuedInterfaces.push(element); + else { + begin(element); + writeInterface(element); + } + } else { + writeComment(element.comment, true); + write("type ", element.name); + if (element.templates && element.templates.length) + write("<", element.templates.join(", "), ">"); + write(" = "); + if (element.tsType) + write(element.tsType.replace(/\r?\n|\r/g, "\n")); + else { + var type = getTypeOf(element); + if (element.type && element.type.names.length === 1 && element.type.names[0] === "function") + writeFunctionSignature(element, false, true); + else if (type === "object") { + if (element.properties && element.properties.length) + writeInterfaceBody(element); + else + write("{}"); + } else + write(type); + } + writeln(";"); + } +} diff --git a/node_modules/protobufjs/cli/node_modules/os-tmpdir/index.js b/node_modules/protobufjs/cli/node_modules/os-tmpdir/index.js new file mode 100644 index 0000000..2077b1c --- /dev/null +++ b/node_modules/protobufjs/cli/node_modules/os-tmpdir/index.js @@ -0,0 +1,25 @@ +'use strict'; +var isWindows = process.platform === 'win32'; +var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; + +// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43 +module.exports = function () { + var path; + + if (isWindows) { + path = process.env.TEMP || + process.env.TMP || + (process.env.SystemRoot || process.env.windir) + '\\temp'; + } else { + path = process.env.TMPDIR || + process.env.TMP || + process.env.TEMP || + '/tmp'; + } + + if (trailingSlashRe.test(path)) { + path = path.slice(0, -1); + } + + return path; +}; diff --git a/node_modules/protobufjs/cli/node_modules/os-tmpdir/license b/node_modules/protobufjs/cli/node_modules/os-tmpdir/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/protobufjs/cli/node_modules/os-tmpdir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/protobufjs/cli/node_modules/os-tmpdir/readme.md b/node_modules/protobufjs/cli/node_modules/os-tmpdir/readme.md new file mode 100644 index 0000000..c09f7ed --- /dev/null +++ b/node_modules/protobufjs/cli/node_modules/os-tmpdir/readme.md @@ -0,0 +1,32 @@ +# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir) + +> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com) + +Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8). + + +## Install + +``` +$ npm install --save os-tmpdir +``` + + +## Usage + +```js +const osTmpdir = require('os-tmpdir'); + +osTmpdir(); +//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T' +``` + + +## API + +See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir). + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/protobufjs/cli/node_modules/tmp/LICENSE b/node_modules/protobufjs/cli/node_modules/tmp/LICENSE new file mode 100644 index 0000000..72418bd --- /dev/null +++ b/node_modules/protobufjs/cli/node_modules/tmp/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 KARASZI István + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/protobufjs/cli/node_modules/tmp/README.md b/node_modules/protobufjs/cli/node_modules/tmp/README.md new file mode 100644 index 0000000..810b048 --- /dev/null +++ b/node_modules/protobufjs/cli/node_modules/tmp/README.md @@ -0,0 +1,314 @@ +# Tmp + +A simple temporary file and directory creator for [node.js.][1] + +[![Build Status](https://travis-ci.org/raszi/node-tmp.svg?branch=master)](https://travis-ci.org/raszi/node-tmp) +[![Dependencies](https://david-dm.org/raszi/node-tmp.svg)](https://david-dm.org/raszi/node-tmp) +[![npm version](https://badge.fury.io/js/tmp.svg)](https://badge.fury.io/js/tmp) +[![API documented](https://img.shields.io/badge/API-documented-brightgreen.svg)](https://raszi.github.io/node-tmp/) +[![Known Vulnerabilities](https://snyk.io/test/npm/tmp/badge.svg)](https://snyk.io/test/npm/tmp) + +## About + +This is a [widely used library][2] to create temporary files and directories +in a [node.js][1] environment. + +Tmp offers both an asynchronous and a synchronous API. For all API calls, all +the parameters are optional. There also exists a promisified version of the +API, see (5) under references below. + +Tmp uses crypto for determining random file names, or, when using templates, +a six letter random identifier. And just in case that you do not have that much +entropy left on your system, Tmp will fall back to pseudo random numbers. + +You can set whether you want to remove the temporary file on process exit or +not, and the destination directory can also be set. + +## How to install + +```bash +npm install tmp +``` + +## Usage + +Please also check [API docs][4]. + +### Asynchronous file creation + +Simple temporary file creation, the file will be closed and unlinked on process exit. + +```javascript +var tmp = require('tmp'); + +tmp.file(function _tempFileCreated(err, path, fd, cleanupCallback) { + if (err) throw err; + + console.log('File: ', path); + console.log('Filedescriptor: ', fd); + + // If we don't need the file anymore we could manually call the cleanupCallback + // But that is not necessary if we didn't pass the keep option because the library + // will clean after itself. + cleanupCallback(); +}); +``` + +### Synchronous file creation + +A synchronous version of the above. + +```javascript +var tmp = require('tmp'); + +var tmpobj = tmp.fileSync(); +console.log('File: ', tmpobj.name); +console.log('Filedescriptor: ', tmpobj.fd); + +// If we don't need the file anymore we could manually call the removeCallback +// But that is not necessary if we didn't pass the keep option because the library +// will clean after itself. +tmpobj.removeCallback(); +``` + +Note that this might throw an exception if either the maximum limit of retries +for creating a temporary name fails, or, in case that you do not have the permission +to write to the directory where the temporary file should be created in. + +### Asynchronous directory creation + +Simple temporary directory creation, it will be removed on process exit. + +If the directory still contains items on process exit, then it won't be removed. + +```javascript +var tmp = require('tmp'); + +tmp.dir(function _tempDirCreated(err, path, cleanupCallback) { + if (err) throw err; + + console.log('Dir: ', path); + + // Manual cleanup + cleanupCallback(); +}); +``` + +If you want to cleanup the directory even when there are entries in it, then +you can pass the `unsafeCleanup` option when creating it. + +### Synchronous directory creation + +A synchronous version of the above. + +```javascript +var tmp = require('tmp'); + +var tmpobj = tmp.dirSync(); +console.log('Dir: ', tmpobj.name); +// Manual cleanup +tmpobj.removeCallback(); +``` + +Note that this might throw an exception if either the maximum limit of retries +for creating a temporary name fails, or, in case that you do not have the permission +to write to the directory where the temporary directory should be created in. + +### Asynchronous filename generation + +It is possible with this library to generate a unique filename in the specified +directory. + +```javascript +var tmp = require('tmp'); + +tmp.tmpName(function _tempNameGenerated(err, path) { + if (err) throw err; + + console.log('Created temporary filename: ', path); +}); +``` + +### Synchronous filename generation + +A synchronous version of the above. + +```javascript +var tmp = require('tmp'); + +var name = tmp.tmpNameSync(); +console.log('Created temporary filename: ', name); +``` + +## Advanced usage + +### Asynchronous file creation + +Creates a file with mode `0644`, prefix will be `prefix-` and postfix will be `.txt`. + +```javascript +var tmp = require('tmp'); + +tmp.file({ mode: 0644, prefix: 'prefix-', postfix: '.txt' }, function _tempFileCreated(err, path, fd) { + if (err) throw err; + + console.log('File: ', path); + console.log('Filedescriptor: ', fd); +}); +``` + +### Synchronous file creation + +A synchronous version of the above. + +```javascript +var tmp = require('tmp'); + +var tmpobj = tmp.fileSync({ mode: 0644, prefix: 'prefix-', postfix: '.txt' }); +console.log('File: ', tmpobj.name); +console.log('Filedescriptor: ', tmpobj.fd); +``` + +### Controlling the Descriptor + +As a side effect of creating a unique file `tmp` gets a file descriptor that is +returned to the user as the `fd` parameter. The descriptor may be used by the +application and is closed when the `removeCallback` is invoked. + +In some use cases the application does not need the descriptor, needs to close it +without removing the file, or needs to remove the file without closing the +descriptor. Two options control how the descriptor is managed: + +* `discardDescriptor` - if `true` causes `tmp` to close the descriptor after the file + is created. In this case the `fd` parameter is undefined. +* `detachDescriptor` - if `true` causes `tmp` to return the descriptor in the `fd` + parameter, but it is the application's responsibility to close it when it is no + longer needed. + +```javascript +var tmp = require('tmp'); + +tmp.file({ discardDescriptor: true }, function _tempFileCreated(err, path, fd, cleanupCallback) { + if (err) throw err; + // fd will be undefined, allowing application to use fs.createReadStream(path) + // without holding an unused descriptor open. +}); +``` + +```javascript +var tmp = require('tmp'); + +tmp.file({ detachDescriptor: true }, function _tempFileCreated(err, path, fd, cleanupCallback) { + if (err) throw err; + + cleanupCallback(); + // Application can store data through fd here; the space used will automatically + // be reclaimed by the operating system when the descriptor is closed or program + // terminates. +}); +``` + +### Asynchronous directory creation + +Creates a directory with mode `0755`, prefix will be `myTmpDir_`. + +```javascript +var tmp = require('tmp'); + +tmp.dir({ mode: 0750, prefix: 'myTmpDir_' }, function _tempDirCreated(err, path) { + if (err) throw err; + + console.log('Dir: ', path); +}); +``` + +### Synchronous directory creation + +Again, a synchronous version of the above. + +```javascript +var tmp = require('tmp'); + +var tmpobj = tmp.dirSync({ mode: 0750, prefix: 'myTmpDir_' }); +console.log('Dir: ', tmpobj.name); +``` + +### mkstemp like, asynchronously + +Creates a new temporary directory with mode `0700` and filename like `/tmp/tmp-nk2J1u`. + +```javascript +var tmp = require('tmp'); + +tmp.dir({ template: '/tmp/tmp-XXXXXX' }, function _tempDirCreated(err, path) { + if (err) throw err; + + console.log('Dir: ', path); +}); +``` + +### mkstemp like, synchronously + +This will behave similarly to the asynchronous version. + +```javascript +var tmp = require('tmp'); + +var tmpobj = tmp.dirSync({ template: '/tmp/tmp-XXXXXX' }); +console.log('Dir: ', tmpobj.name); +``` + +### Asynchronous filename generation + +The `tmpName()` function accepts the `prefix`, `postfix`, `dir`, etc. parameters also: + +```javascript +var tmp = require('tmp'); + +tmp.tmpName({ template: '/tmp/tmp-XXXXXX' }, function _tempNameGenerated(err, path) { + if (err) throw err; + + console.log('Created temporary filename: ', path); +}); +``` + +### Synchronous filename generation + +The `tmpNameSync()` function works similarly to `tmpName()`. + +```javascript +var tmp = require('tmp'); +var tmpname = tmp.tmpNameSync({ template: '/tmp/tmp-XXXXXX' }); +console.log('Created temporary filename: ', tmpname); +``` + +## Graceful cleanup + +One may want to cleanup the temporary files even when an uncaught exception +occurs. To enforce this, you can call the `setGracefulCleanup()` method: + +```javascript +var tmp = require('tmp'); + +tmp.setGracefulCleanup(); +``` + +## Options + +All options are optional :) + + * `mode`: the file mode to create with, it fallbacks to `0600` on file creation and `0700` on directory creation + * `prefix`: the optional prefix, fallbacks to `tmp-` if not provided + * `postfix`: the optional postfix, fallbacks to `.tmp` on file creation + * `template`: [`mkstemp`][3] like filename template, no default + * `dir`: the optional temporary directory, fallbacks to system default (guesses from environment) + * `tries`: how many times should the function try to get a unique filename before giving up, default `3` + * `keep`: signals that the temporary file or directory should not be deleted on exit, default is `false`, means delete + * Please keep in mind that it is recommended in this case to call the provided `cleanupCallback` function manually. + * `unsafeCleanup`: recursively removes the created temporary directory, even when it's not empty. default is `false` + +[1]: http://nodejs.org/ +[2]: https://www.npmjs.com/browse/depended/tmp +[3]: http://www.kernel.org/doc/man-pages/online/pages/man3/mkstemp.3.html +[4]: https://raszi.github.io/node-tmp/ +[5]: https://github.com/benjamingr/tmp-promise diff --git a/node_modules/protobufjs/cli/node_modules/tmp/lib/tmp.js b/node_modules/protobufjs/cli/node_modules/tmp/lib/tmp.js new file mode 100644 index 0000000..41b83db --- /dev/null +++ b/node_modules/protobufjs/cli/node_modules/tmp/lib/tmp.js @@ -0,0 +1,611 @@ +/*! + * Tmp + * + * Copyright (c) 2011-2017 KARASZI Istvan + * + * MIT Licensed + */ + +/* + * Module dependencies. + */ +const fs = require('fs'); +const path = require('path'); +const crypto = require('crypto'); +const osTmpDir = require('os-tmpdir'); +const _c = process.binding('constants'); + +/* + * The working inner variables. + */ +const + /** + * The temporary directory. + * @type {string} + */ + tmpDir = osTmpDir(), + + // the random characters to choose from + RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', + + TEMPLATE_PATTERN = /XXXXXX/, + + DEFAULT_TRIES = 3, + + CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR), + + EBADF = _c.EBADF || _c.os.errno.EBADF, + ENOENT = _c.ENOENT || _c.os.errno.ENOENT, + + DIR_MODE = 448 /* 0o700 */, + FILE_MODE = 384 /* 0o600 */, + + // this will hold the objects need to be removed on exit + _removeObjects = []; + +var + _gracefulCleanup = false, + _uncaughtException = false; + +/** + * Random name generator based on crypto. + * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript + * + * @param {number} howMany + * @returns {string} the generated random name + * @private + */ +function _randomChars(howMany) { + var + value = [], + rnd = null; + + // make sure that we do not fail because we ran out of entropy + try { + rnd = crypto.randomBytes(howMany); + } catch (e) { + rnd = crypto.pseudoRandomBytes(howMany); + } + + for (var i = 0; i < howMany; i++) { + value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); + } + + return value.join(''); +} + +/** + * Checks whether the `obj` parameter is defined or not. + * + * @param {Object} obj + * @returns {boolean} true if the object is undefined + * @private + */ +function _isUndefined(obj) { + return typeof obj === 'undefined'; +} + +/** + * Parses the function arguments. + * + * This function helps to have optional arguments. + * + * @param {(Options|Function)} options + * @param {Function} callback + * @returns {Array} parsed arguments + * @private + */ +function _parseArguments(options, callback) { + if (typeof options == 'function') { + return [callback || {}, options]; + } + + if (_isUndefined(options)) { + return [{}, callback]; + } + + return [options, callback]; +} + +/** + * Generates a new temporary name. + * + * @param {Object} opts + * @returns {string} the new random name according to opts + * @private + */ +function _generateTmpName(opts) { + if (opts.name) { + return path.join(opts.dir || tmpDir, opts.name); + } + + // mkstemps like template + if (opts.template) { + return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6)); + } + + // prefix and postfix + const name = [ + opts.prefix || 'tmp-', + process.pid, + _randomChars(12), + opts.postfix || '' + ].join(''); + + return path.join(opts.dir || tmpDir, name); +} + +/** + * Gets a temporary file name. + * + * @param {(Options|tmpNameCallback)} options options or callback + * @param {?tmpNameCallback} callback the callback function + */ +function tmpName(options, callback) { + var + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1], + tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES; + + if (isNaN(tries) || tries < 0) + return cb(new Error('Invalid tries')); + + if (opts.template && !opts.template.match(TEMPLATE_PATTERN)) + return cb(new Error('Invalid template provided')); + + (function _getUniqueName() { + const name = _generateTmpName(opts); + + // check whether the path exists then retry if needed + fs.stat(name, function (err) { + if (!err) { + if (tries-- > 0) return _getUniqueName(); + + return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name)); + } + + cb(null, name); + }); + }()); +} + +/** + * Synchronous version of tmpName. + * + * @param {Object} options + * @returns {string} the generated random name + * @throws {Error} if the options are invalid or could not generate a filename + */ +function tmpNameSync(options) { + var + args = _parseArguments(options), + opts = args[0], + tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES; + + if (isNaN(tries) || tries < 0) + throw new Error('Invalid tries'); + + if (opts.template && !opts.template.match(TEMPLATE_PATTERN)) + throw new Error('Invalid template provided'); + + do { + const name = _generateTmpName(opts); + try { + fs.statSync(name); + } catch (e) { + return name; + } + } while (tries-- > 0); + + throw new Error('Could not get a unique tmp filename, max tries reached'); +} + +/** + * Creates and opens a temporary file. + * + * @param {(Options|fileCallback)} options the config options or the callback function + * @param {?fileCallback} callback + */ +function file(options, callback) { + var + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1]; + + opts.postfix = (_isUndefined(opts.postfix)) ? '.tmp' : opts.postfix; + + // gets a temporary filename + tmpName(opts, function _tmpNameCreated(err, name) { + if (err) return cb(err); + + // create and open the file + fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) { + if (err) return cb(err); + + if (opts.discardDescriptor) { + return fs.close(fd, function _discardCallback(err) { + if (err) { + // Low probability, and the file exists, so this could be + // ignored. If it isn't we certainly need to unlink the + // file, and if that fails too its error is more + // important. + try { + fs.unlinkSync(name); + } catch (e) { + if (!isENOENT(e)) { + err = e; + } + } + return cb(err); + } + cb(null, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts)); + }); + } + if (opts.detachDescriptor) { + return cb(null, name, fd, _prepareTmpFileRemoveCallback(name, -1, opts)); + } + cb(null, name, fd, _prepareTmpFileRemoveCallback(name, fd, opts)); + }); + }); +} + +/** + * Synchronous version of file. + * + * @param {Options} options + * @returns {FileSyncObject} object consists of name, fd and removeCallback + * @throws {Error} if cannot create a file + */ +function fileSync(options) { + var + args = _parseArguments(options), + opts = args[0]; + + opts.postfix = opts.postfix || '.tmp'; + + const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; + const name = tmpNameSync(opts); + var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + if (opts.discardDescriptor) { + fs.closeSync(fd); + fd = undefined; + } + + return { + name: name, + fd: fd, + removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts) + }; +} + +/** + * Removes files and folders in a directory recursively. + * + * @param {string} root + * @private + */ +function _rmdirRecursiveSync(root) { + const dirs = [root]; + + do { + var + dir = dirs.pop(), + deferred = false, + files = fs.readdirSync(dir); + + for (var i = 0, length = files.length; i < length; i++) { + var + file = path.join(dir, files[i]), + stat = fs.lstatSync(file); // lstat so we don't recurse into symlinked directories + + if (stat.isDirectory()) { + if (!deferred) { + deferred = true; + dirs.push(dir); + } + dirs.push(file); + } else { + fs.unlinkSync(file); + } + } + + if (!deferred) { + fs.rmdirSync(dir); + } + } while (dirs.length !== 0); +} + +/** + * Creates a temporary directory. + * + * @param {(Options|dirCallback)} options the options or the callback function + * @param {?dirCallback} callback + */ +function dir(options, callback) { + var + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1]; + + // gets a temporary filename + tmpName(opts, function _tmpNameCreated(err, name) { + if (err) return cb(err); + + // create the directory + fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) { + if (err) return cb(err); + + cb(null, name, _prepareTmpDirRemoveCallback(name, opts)); + }); + }); +} + +/** + * Synchronous version of dir. + * + * @param {Options} options + * @returns {DirSyncObject} object consists of name and removeCallback + * @throws {Error} if it cannot create a directory + */ +function dirSync(options) { + var + args = _parseArguments(options), + opts = args[0]; + + const name = tmpNameSync(opts); + fs.mkdirSync(name, opts.mode || DIR_MODE); + + return { + name: name, + removeCallback: _prepareTmpDirRemoveCallback(name, opts) + }; +} + +/** + * Prepares the callback for removal of the temporary file. + * + * @param {string} name the path of the file + * @param {number} fd file descriptor + * @param {Object} opts + * @returns {fileCallback} + * @private + */ +function _prepareTmpFileRemoveCallback(name, fd, opts) { + const removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) { + try { + if (0 <= fdPath[0]) { + fs.closeSync(fdPath[0]); + } + } + catch (e) { + // under some node/windows related circumstances, a temporary file + // may have not be created as expected or the file was already closed + // by the user, in which case we will simply ignore the error + if (!isEBADF(e) && !isENOENT(e)) { + // reraise any unanticipated error + throw e; + } + } + try { + fs.unlinkSync(fdPath[1]); + } + catch (e) { + if (!isENOENT(e)) { + // reraise any unanticipated error + throw e; + } + } + }, [fd, name]); + + if (!opts.keep) { + _removeObjects.unshift(removeCallback); + } + + return removeCallback; +} + +/** + * Prepares the callback for removal of the temporary directory. + * + * @param {string} name + * @param {Object} opts + * @returns {Function} the callback + * @private + */ +function _prepareTmpDirRemoveCallback(name, opts) { + const removeFunction = opts.unsafeCleanup ? _rmdirRecursiveSync : fs.rmdirSync.bind(fs); + const removeCallback = _prepareRemoveCallback(removeFunction, name); + + if (!opts.keep) { + _removeObjects.unshift(removeCallback); + } + + return removeCallback; +} + +/** + * Creates a guarded function wrapping the removeFunction call. + * + * @param {Function} removeFunction + * @param {Object} arg + * @returns {Function} + * @private + */ +function _prepareRemoveCallback(removeFunction, arg) { + var called = false; + + return function _cleanupCallback(next) { + if (!called) { + const index = _removeObjects.indexOf(_cleanupCallback); + if (index >= 0) { + _removeObjects.splice(index, 1); + } + + called = true; + removeFunction(arg); + } + + if (next) next(null); + }; +} + +/** + * The garbage collector. + * + * @private + */ +function _garbageCollector() { + if (_uncaughtException && !_gracefulCleanup) { + return; + } + + // the function being called removes itself from _removeObjects, + // loop until _removeObjects is empty + while (_removeObjects.length) { + try { + _removeObjects[0].call(null); + } catch (e) { + // already removed? + } + } +} + +/** + * Helper for testing against EBADF to compensate changes made to Node 7.x under Windows. + */ +function isEBADF(error) { + return isExpectedError(error, -EBADF, 'EBADF'); +} + +/** + * Helper for testing against ENOENT to compensate changes made to Node 7.x under Windows. + */ +function isENOENT(error) { + return isExpectedError(error, -ENOENT, 'ENOENT'); +} + +/** + * Helper to determine whether the expected error code matches the actual code and errno, + * which will differ between the supported node versions. + * + * - Node >= 7.0: + * error.code {String} + * error.errno {String|Number} any numerical value will be negated + * + * - Node >= 6.0 < 7.0: + * error.code {String} + * error.errno {Number} negated + * + * - Node >= 4.0 < 6.0: introduces SystemError + * error.code {String} + * error.errno {Number} negated + * + * - Node >= 0.10 < 4.0: + * error.code {Number} negated + * error.errno n/a + */ +function isExpectedError(error, code, errno) { + return error.code == code || error.code == errno; +} + +/** + * Sets the graceful cleanup. + * + * Also removes the created files and directories when an uncaught exception occurs. + */ +function setGracefulCleanup() { + _gracefulCleanup = true; +} + +const version = process.versions.node.split('.').map(function (value) { + return parseInt(value, 10); +}); + +if (version[0] === 0 && (version[1] < 9 || version[1] === 9 && version[2] < 5)) { + process.addListener('uncaughtException', function _uncaughtExceptionThrown(err) { + _uncaughtException = true; + _garbageCollector(); + + throw err; + }); +} + +process.addListener('exit', function _exit(code) { + if (code) _uncaughtException = true; + _garbageCollector(); +}); + +/** + * Configuration options. + * + * @typedef {Object} Options + * @property {?number} tries the number of tries before give up the name generation + * @property {?string} template the "mkstemp" like filename template + * @property {?string} name fix name + * @property {?string} dir the tmp directory to use + * @property {?string} prefix prefix for the generated name + * @property {?string} postfix postfix for the generated name + */ + +/** + * @typedef {Object} FileSyncObject + * @property {string} name the name of the file + * @property {string} fd the file descriptor + * @property {fileCallback} removeCallback the callback function to remove the file + */ + +/** + * @typedef {Object} DirSyncObject + * @property {string} name the name of the directory + * @property {fileCallback} removeCallback the callback function to remove the directory + */ + +/** + * @callback tmpNameCallback + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + */ + +/** + * @callback fileCallback + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + * @param {number} fd the file descriptor + * @param {cleanupCallback} fn the cleanup callback function + */ + +/** + * @callback dirCallback + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + * @param {cleanupCallback} fn the cleanup callback function + */ + +/** + * Removes the temporary created file or directory. + * + * @callback cleanupCallback + * @param {simpleCallback} [next] function to call after entry was removed + */ + +/** + * Callback function for function composition. + * @see {@link https://github.com/raszi/node-tmp/issues/57|raszi/node-tmp#57} + * + * @callback simpleCallback + */ + +// exporting all the needed methods +module.exports.tmpdir = tmpDir; + +module.exports.dir = dir; +module.exports.dirSync = dirSync; + +module.exports.file = file; +module.exports.fileSync = fileSync; + +module.exports.tmpName = tmpName; +module.exports.tmpNameSync = tmpNameSync; + +module.exports.setGracefulCleanup = setGracefulCleanup; diff --git a/node_modules/protobufjs/cli/package-lock.json b/node_modules/protobufjs/cli/package-lock.json new file mode 100644 index 0000000..5c63603 --- /dev/null +++ b/node_modules/protobufjs/cli/package-lock.json @@ -0,0 +1,20 @@ +{ + "version": "6.7.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "1.0.2" + } + } + } +} diff --git a/node_modules/protobufjs/cli/package.json b/node_modules/protobufjs/cli/package.json new file mode 100644 index 0000000..6b17b00 --- /dev/null +++ b/node_modules/protobufjs/cli/package.json @@ -0,0 +1 @@ +{"version": "6.7.0"} \ No newline at end of file diff --git a/node_modules/protobufjs/cli/package.standalone.json b/node_modules/protobufjs/cli/package.standalone.json new file mode 100644 index 0000000..aacd040 --- /dev/null +++ b/node_modules/protobufjs/cli/package.standalone.json @@ -0,0 +1,32 @@ +{ + "name": "protobufjs-cli", + "description": "Translates between file formats and generates static code as well as TypeScript definitions.", + "version": "6.7.0", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + }, + "peerDependencies": { + "protobufjs": "~6.7.0" + }, + "dependencies": { + "chalk": "^1.1.3", + "escodegen": "^1.8.1", + "espree": "^3.1.3", + "estraverse": "^4.2.0", + "glob": "^7.1.1", + "jsdoc": "^3.4.2", + "minimist": "^1.2.0", + "semver": "^5.3.0", + "tmp": "0.0.31", + "uglify-js": "^2.8.15" + } +} \ No newline at end of file diff --git a/node_modules/protobufjs/cli/pbjs.d.ts b/node_modules/protobufjs/cli/pbjs.d.ts new file mode 100644 index 0000000..ead1f3c --- /dev/null +++ b/node_modules/protobufjs/cli/pbjs.d.ts @@ -0,0 +1,9 @@ +type pbjsCallback = (err: Error|null, output?: string) => void; + +/** + * Runs pbjs programmatically. + * @param {string[]} args Command line arguments + * @param {function(?Error, string=)} [callback] Optional completion callback + * @returns {number|undefined} Exit code, if known + */ +export function main(args: string[], callback?: pbjsCallback): number|undefined; diff --git a/node_modules/protobufjs/cli/pbjs.js b/node_modules/protobufjs/cli/pbjs.js new file mode 100644 index 0000000..ede8cb0 --- /dev/null +++ b/node_modules/protobufjs/cli/pbjs.js @@ -0,0 +1,329 @@ +"use strict"; +var path = require("path"), + fs = require("fs"), + pkg = require("./package.json"), + util = require("./util"); + +util.setup(); + +var protobuf = require(util.pathToProtobufJs), + minimist = require("minimist"), + chalk = require("chalk"), + glob = require("glob"); + +var targets = util.requireAll("./targets"); + +/** + * Runs pbjs programmatically. + * @param {string[]} args Command line arguments + * @param {function(?Error, string=)} [callback] Optional completion callback + * @returns {number|undefined} Exit code, if known + */ +exports.main = function main(args, callback) { + var lintDefault = "eslint-disable " + [ + "block-scoped-var", + "id-length", + "no-control-regex", + "no-magic-numbers", + "no-prototype-builtins", + "no-redeclare", + "no-shadow", + "no-var", + "sort-vars" + ].join(", "); + var argv = minimist(args, { + alias: { + target: "t", + out: "o", + path: "p", + wrap: "w", + root: "r", + lint: "l", + // backward compatibility: + "force-long": "strict-long", + "force-message": "strict-message" + }, + string: [ "target", "out", "path", "wrap", "dependency", "root", "lint" ], + boolean: [ "create", "encode", "decode", "verify", "convert", "delimited", "beautify", "comments", "es6", "sparse", "keep-case", "force-long", "force-number", "force-enum-string", "force-message" ], + default: { + target: "json", + create: true, + encode: true, + decode: true, + verify: true, + convert: true, + delimited: true, + beautify: true, + comments: true, + es6: null, + lint: lintDefault, + "keep-case": false, + "force-long": false, + "force-number": false, + "force-enum-string": false, + "force-message": false + } + }); + + var target = targets[argv.target], + files = argv._, + paths = typeof argv.path === "string" ? [ argv.path ] : argv.path || []; + + // alias hyphen args in camel case + Object.keys(argv).forEach(function(key) { + var camelKey = key.replace(/-([a-z])/g, function($0, $1) { return $1.toUpperCase(); }); + if (camelKey !== key) + argv[camelKey] = argv[key]; + }); + + // protobuf.js package directory contains additional, otherwise non-bundled google types + paths.push(path.relative(process.cwd(), path.join(__dirname, "..")) || "."); + + if (!files.length) { + var descs = Object.keys(targets).filter(function(key) { return !targets[key].private; }).map(function(key) { + return " " + util.pad(key, 14, true) + targets[key].description; + }); + if (callback) + callback(Error("usage")); // eslint-disable-line callback-return + else + process.stderr.write([ + "protobuf.js v" + pkg.version + " CLI for JavaScript", + "", + chalk.bold.white("Translates between file formats and generates static code."), + "", + " -t, --target Specifies the target format. Also accepts a path to require a custom target.", + "", + descs.join("\n"), + "", + " -p, --path Adds a directory to the include path.", + "", + " -o, --out Saves to a file instead of writing to stdout.", + "", + " --sparse Exports only those types referenced from a main file (experimental).", + "", + chalk.bold.gray(" Module targets only:"), + "", + " -w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.", + "", + " default Default wrapper supporting both CommonJS and AMD", + " commonjs CommonJS wrapper", + " amd AMD wrapper", + " es6 ES6 wrapper (implies --es6)", + " closure A closure adding to protobuf.roots where protobuf is a global", + "", + " --dependency Specifies which version of protobuf to require. Accepts any valid module id", + "", + " -r, --root Specifies an alternative protobuf.roots name.", + "", + " -l, --lint Linter configuration. Defaults to protobuf.js-compatible rules:", + "", + " " + lintDefault, + "", + " --es6 Enables ES6 syntax (const/let instead of var)", + "", + chalk.bold.gray(" Proto sources only:"), + "", + " --keep-case Keeps field casing instead of converting to camel case.", + "", + chalk.bold.gray(" Static targets only:"), + "", + " --no-create Does not generate create functions used for reflection compatibility.", + " --no-encode Does not generate encode functions.", + " --no-decode Does not generate decode functions.", + " --no-verify Does not generate verify functions.", + " --no-convert Does not generate convert functions like from/toObject", + " --no-delimited Does not generate delimited encode/decode functions.", + " --no-beautify Does not beautify generated code.", + " --no-comments Does not output any JSDoc comments.", + "", + " --force-long Enfores the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.", + " --force-number Enfores the use of 'number' for s-/u-/int64 and s-/fixed64 fields.", + " --force-message Enfores the use of message instances instead of plain objects.", + "", + "usage: " + chalk.bold.green("pbjs") + " [options] file1.proto file2.json ..." + chalk.gray(" (or pipe) ") + "other | " + chalk.bold.green("pbjs") + " [options] -", + "" + ].join("\n")); + return 1; + } + + if (typeof argv["strict-long"] === "boolean") + argv["force-long"] = argv["strict-long"]; + + // Resolve glob expressions + for (var i = 0; i < files.length;) { + if (glob.hasMagic(files[i])) { + var matches = glob.sync(files[i]); + Array.prototype.splice.apply(files, [i, 1].concat(matches)); + i += matches.length; + } else + ++i; + } + + // Require custom target + if (!target) + target = require(path.resolve(process.cwd(), argv.target)); + + var root = new protobuf.Root(); + + var mainFiles = []; + + // Search include paths when resolving imports + root.resolvePath = function pbjsResolvePath(origin, target) { + var normOrigin = protobuf.util.path.normalize(origin), + normTarget = protobuf.util.path.normalize(target); + if (!normOrigin) + mainFiles.push(normTarget); + + var resolved = protobuf.util.path.resolve(normOrigin, normTarget, true); + var idx = resolved.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = resolved.substring(idx); + if (altname in protobuf.common) + resolved = altname; + } + + if (fs.existsSync(resolved)) + return resolved; + + for (var i = 0; i < paths.length; ++i) { + var iresolved = protobuf.util.path.resolve(paths[i] + "/", target); + if (fs.existsSync(iresolved)) + return iresolved; + } + + return resolved; + }; + + // Use es6 syntax if not explicitly specified on the command line and the es6 wrapper is used + if (argv.wrap === "es6" || argv.es6) { + argv.wrap = "es6"; + argv.es6 = true; + } + + var parseOptions = { + "keepCase": argv["keep-case"] || false + }; + + // Read from stdin + if (files.length === 1 && files[0] === "-") { + var data = []; + process.stdin.on("data", function(chunk) { + data.push(chunk); + }); + process.stdin.on("end", function() { + var source = Buffer.concat(data).toString("utf8"); + try { + if (source.charAt(0) !== "{") { + protobuf.parse.filename = "-"; + protobuf.parse(source, root, parseOptions); + } else { + var json = JSON.parse(source); + root.setOptions(json.options).addJSON(json); + } + callTarget(); + } catch (err) { + if (callback) { + callback(err); + return; + } + throw err; + } + }); + + // Load from disk + } else { + try { + root.loadSync(files, parseOptions).resolveAll(); // sync is deterministic while async is not + if (argv.sparse) + sparsify(root); + callTarget(); + } catch (err) { + if (callback) { + callback(err); + return undefined; + } + throw err; + } + } + + function markReferenced(tobj) { + tobj.referenced = true; + // also mark a type's fields and oneofs + if (tobj.fieldsArray) + tobj.fieldsArray.forEach(function(fobj) { + fobj.referenced = true; + }); + if (tobj.oneofsArray) + tobj.oneofsArray.forEach(function(oobj) { + oobj.referenced = true; + }); + // also mark an extension field's extended type, but not its (other) fields + if (tobj.extensionField) + tobj.extensionField.parent.referenced = true; + } + + function sparsify(root) { + + // 1. mark directly or indirectly referenced objects + util.traverse(root, function(obj) { + if (!obj.filename) + return; + if (mainFiles.indexOf(obj.filename) > -1) + util.traverseResolved(obj, markReferenced); + }); + + // 2. empty unreferenced objects + util.traverse(root, function(obj) { + var parent = obj.parent; + if (!parent || obj.referenced) // root or referenced + return; + // remove unreferenced namespaces + if (obj instanceof protobuf.Namespace) { + var hasReferenced = false; + util.traverse(obj, function(iobj) { + if (iobj.referenced) + hasReferenced = true; + }); + if (hasReferenced) { // replace with plain namespace if a namespace subclass + if (obj instanceof protobuf.Type || obj instanceof protobuf.Service) { + var robj = new protobuf.Namespace(obj.name, obj.options); + robj.nested = obj.nested; + parent.add(robj); + } + } else // remove completely if nothing inside is referenced + parent.remove(obj); + + // remove everything else unreferenced + } else if (!(obj instanceof protobuf.Namespace)) + parent.remove(obj); + }); + + // 3. validate that everything is fine + root.resolveAll(); + } + + function callTarget() { + target(root, argv, function targetCallback(err, output) { + if (err) { + if (callback) + return callback(err); + throw err; + } + try { + if (argv.out) + fs.writeFileSync(argv.out, output, { encoding: "utf8" }); + else if (!callback) + process.stdout.write(output, "utf8"); + return callback + ? callback(null, output) + : undefined; + } catch (err) { + if (callback) + return callback(err); + throw err; + } + }); + } + + return undefined; +}; diff --git a/node_modules/protobufjs/cli/pbts.d.ts b/node_modules/protobufjs/cli/pbts.d.ts new file mode 100644 index 0000000..35db28c --- /dev/null +++ b/node_modules/protobufjs/cli/pbts.d.ts @@ -0,0 +1,9 @@ +type pbtsCallback = (err: Error|null, output?: string) => void; + +/** + * Runs pbts programmatically. + * @param {string[]} args Command line arguments + * @param {function(?Error, string=)} [callback] Optional completion callback + * @returns {number|undefined} Exit code, if known + */ +export function main(args: string[], callback?: pbtsCallback): number|undefined; diff --git a/node_modules/protobufjs/cli/pbts.js b/node_modules/protobufjs/cli/pbts.js new file mode 100644 index 0000000..f066964 --- /dev/null +++ b/node_modules/protobufjs/cli/pbts.js @@ -0,0 +1,197 @@ +"use strict"; +var child_process = require("child_process"), + path = require("path"), + fs = require("fs"), + pkg = require("./package.json"), + util = require("./util"); + +util.setup(); + +var minimist = require("minimist"), + chalk = require("chalk"), + glob = require("glob"), + tmp = require("tmp"); + +/** + * Runs pbts programmatically. + * @param {string[]} args Command line arguments + * @param {function(?Error, string=)} [callback] Optional completion callback + * @returns {number|undefined} Exit code, if known + */ +exports.main = function(args, callback) { + var argv = minimist(args, { + alias: { + name: "n", + out : "o", + main: "m", + global: "g", + import: "i" + }, + string: [ "name", "out", "global", "import" ], + boolean: [ "comments", "main" ], + default: { + comments: true, + main: false + } + }); + + var files = argv._; + + if (!files.length) { + if (callback) + callback(Error("usage")); // eslint-disable-line callback-return + else + process.stderr.write([ + "protobuf.js v" + pkg.version + " CLI for TypeScript", + "", + chalk.bold.white("Generates TypeScript definitions from annotated JavaScript files."), + "", + " -o, --out Saves to a file instead of writing to stdout.", + "", + " -g, --global Name of the global object in browser environments, if any.", + "", + " -i, --import Comma delimited list of imports. Local names will equal camelCase of the basename.", + "", + " --no-comments Does not output any JSDoc comments.", + "", + chalk.bold.gray(" Internal flags:"), + "", + " -n, --name Wraps everything in a module of the specified name.", + "", + " -m, --main Whether building the main library without any imports.", + "", + "usage: " + chalk.bold.green("pbts") + " [options] file1.js file2.js ..." + chalk.bold.gray(" (or) ") + "other | " + chalk.bold.green("pbts") + " [options] -", + "" + ].join("\n")); + return 1; + } + + // Resolve glob expressions + for (var i = 0; i < files.length;) { + if (glob.hasMagic(files[i])) { + var matches = glob.sync(files[i]); + Array.prototype.splice.apply(files, [i, 1].concat(matches)); + i += matches.length; + } else + ++i; + } + + var cleanup = []; + + // Read from stdin (to a temporary file) + if (files.length === 1 && files[0] === "-") { + var data = []; + process.stdin.on("data", function(chunk) { + data.push(chunk); + }); + process.stdin.on("end", function() { + files[0] = tmp.tmpNameSync() + ".js"; + fs.writeFileSync(files[0], Buffer.concat(data)); + cleanup.push(files[0]); + callJsdoc(); + }); + + // Load from disk + } else { + callJsdoc(); + } + + function callJsdoc() { + + // There is no proper API for jsdoc, so this executes the CLI and pipes the output + var basedir = path.join(__dirname, "."); + var moduleName = argv.name || "null"; + var nodePath = process.execPath; + var cmd = "\"" + nodePath + "\" \"" + require.resolve("jsdoc/jsdoc.js") + "\" -c \"" + path.join(basedir, "lib", "tsd-jsdoc.json") + "\" -q \"module=" + encodeURIComponent(moduleName) + "&comments=" + Boolean(argv.comments) + "\" " + files.map(function(file) { return "\"" + file + "\""; }).join(" "); + var child = child_process.exec(cmd, { + cwd: process.cwd(), + argv0: "node", + stdio: "pipe", + maxBuffer: 1 << 24 // 16mb + }); + var out = []; + var ended = false; + var closed = false; + child.stdout.on("data", function(data) { + out.push(data); + }); + child.stdout.on("end", function() { + if (closed) finish(); + else ended = true; + }); + child.stderr.pipe(process.stderr); + child.on("close", function(code) { + // clean up temporary files, no matter what + try { cleanup.forEach(fs.unlinkSync); } catch(e) {/**/} cleanup = []; + + if (code) { + out = out.join("").replace(/\s*JSDoc \d+\.\d+\.\d+ [^$]+/, ""); + process.stderr.write(out); + var err = Error("code " + code); + if (callback) + return callback(err); + throw err; + } + + if (ended) return finish(); + closed = true; + return undefined; + }); + + function getImportName(importItem) { + return path.basename(importItem, ".js").replace(/([-_~.+]\w)/g, function(match) { + return match[1].toUpperCase(); + }); + } + + function finish() { + var output = []; + if (argv.main) + output.push( + "// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run types'.", + "" + ); + if (argv.global) + output.push( + "export as namespace " + argv.global + ";", + "" + ); + + if (!argv.main) { + // Ensure we have a usable array of imports + var importArray = typeof argv.import === "string" ? argv.import.split(",") : argv.import || []; + + // Build an object of imports and paths + var imports = { + $protobuf: "protobufjs" + }; + importArray.forEach(function(importItem) { + imports[getImportName(importItem)] = importItem; + }); + + // Write out the imports + Object.keys(imports).forEach(function(key) { + output.push("import * as " + key + " from \"" + imports[key] + "\";"); + }); + } + + output = output.join("\n") + "\n" + out.join(""); + + try { + if (argv.out) + fs.writeFileSync(argv.out, output, { encoding: "utf8" }); + else if (!callback) + process.stdout.write(output, "utf8"); + return callback + ? callback(null, output) + : undefined; + } catch (err) { + if (callback) + return callback(err); + throw err; + } + } + } + + return undefined; +}; diff --git a/node_modules/protobufjs/cli/targets/json-module.js b/node_modules/protobufjs/cli/targets/json-module.js new file mode 100644 index 0000000..5255cd9 --- /dev/null +++ b/node_modules/protobufjs/cli/targets/json-module.js @@ -0,0 +1,38 @@ +"use strict"; +module.exports = json_module; + +var util = require("../util"); + +var protobuf = require("../.."); + +json_module.description = "JSON representation as a module"; + +function jsonSafeProp(json) { + return json.replace(/^( +)"(\w+)":/mg, function($0, $1, $2) { + return protobuf.util.safeProp($2).charAt(0) === "." + ? $1 + $2 + ":" + : $0; + }); +} + +function json_module(root, options, callback) { + try { + var rootProp = protobuf.util.safeProp(options.root || "default"); + var output = [ + (options.es6 ? "const" : "var") + " $root = ($protobuf.roots" + rootProp + " || ($protobuf.roots" + rootProp + " = new $protobuf.Root()))\n" + ]; + if (root.options) { + var optionsJson = jsonSafeProp(JSON.stringify(root.options, null, 2)); + output.push(".setOptions(" + optionsJson + ")\n"); + } + var json = jsonSafeProp(JSON.stringify(root.nested, null, 2).trim()); + output.push(".addJSON(" + json + ");"); + output = util.wrap(output.join(""), protobuf.util.merge({ dependency: "protobufjs/light" }, options)); + process.nextTick(function() { + callback(null, output); + }); + } catch (e) { + return callback(e); + } + return undefined; +} diff --git a/node_modules/protobufjs/cli/targets/json.js b/node_modules/protobufjs/cli/targets/json.js new file mode 100644 index 0000000..7025372 --- /dev/null +++ b/node_modules/protobufjs/cli/targets/json.js @@ -0,0 +1,8 @@ +"use strict"; +module.exports = json_target; + +json_target.description = "JSON representation"; + +function json_target(root, options, callback) { + callback(null, JSON.stringify(root, null, 2)); +} diff --git a/node_modules/protobufjs/cli/targets/proto.js b/node_modules/protobufjs/cli/targets/proto.js new file mode 100644 index 0000000..d633f16 --- /dev/null +++ b/node_modules/protobufjs/cli/targets/proto.js @@ -0,0 +1,326 @@ +"use strict"; +module.exports = proto_target; + +proto_target.private = true; + +var protobuf = require("../.."); + +var Namespace = protobuf.Namespace, + Enum = protobuf.Enum, + Type = protobuf.Type, + Field = protobuf.Field, + OneOf = protobuf.OneOf, + Service = protobuf.Service, + Method = protobuf.Method, + types = protobuf.types, + util = protobuf.util; + +function underScore(str) { + return str.substring(0,1) + + str.substring(1) + .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); +} + +var out = []; +var indent = 0; +var first = false; +var syntax = 3; + +function proto_target(root, options, callback) { + if (options) { + switch (options.syntax) { + case undefined: + case "proto3": + case "3": + syntax = 3; + break; + case "proto2": + case "2": + syntax = 2; + break; + default: + return callback(Error("invalid syntax: " + options.syntax)); + } + } + indent = 0; + first = false; + try { + buildRoot(root); + return callback(null, out.join("\n")); + } catch (err) { + return callback(err); + } finally { + out = []; + syntax = 3; + } +} + +function push(line) { + if (line === "") + out.push(""); + else { + var ind = ""; + for (var i = 0; i < indent; ++i) + ind += " "; + out.push(ind + line); + } +} + +function escape(str) { + return str.replace(/[\\"']/g, "\\$&") + .replace(/\r/g, "\\r") + .replace(/\n/g, "\\n") + .replace(/\u0000/g, "\\0"); // eslint-disable-line no-control-regex +} + +function value(v) { + switch (typeof v) { + case "boolean": + return v ? "true" : "false"; + case "number": + return v.toString(); + default: + return "\"" + escape(String(v)) + "\""; + } +} + +function buildRoot(root) { + root.resolveAll(); + var pkg = []; + var ptr = root; + var repeat = true; + do { + var nested = ptr.nestedArray; + if (nested.length === 1 && nested[0] instanceof Namespace && !(nested[0] instanceof Type || nested[0] instanceof Service)) { + ptr = nested[0]; + if (ptr !== root) + pkg.push(ptr.name); + } else + repeat = false; + } while (repeat); + out.push("syntax = \"proto" + syntax + "\";"); + if (pkg.length) + out.push("", "package " + pkg.join(".") + ";"); + + buildOptions(ptr); + ptr.nestedArray.forEach(build); +} + +function build(object) { + if (object instanceof Enum) + buildEnum(object); + else if (object instanceof Type) + buildType(object); + else if (object instanceof Field) + buildField(object); + else if (object instanceof OneOf) + buildOneOf(object); + else if (object instanceof Service) + buildService(object); + else if (object instanceof Method) + buildMethod(object); + else + buildNamespace(object); +} + +function buildNamespace(namespace) { // just a namespace, not a type etc. + push(""); + push("message " + namespace.name + " {"); + ++indent; + buildOptions(namespace); + consolidateExtends(namespace.nestedArray).remaining.forEach(build); + --indent; + push("}"); +} + +function buildEnum(enm) { + push(""); + push("enum " + enm.name + " {"); + buildOptions(enm); + ++indent; first = true; + Object.keys(enm.values).forEach(function(name) { + var val = enm.values[name]; + if (first) { + push(""); + first = false; + } + push(name + " = " + val + ";"); + }); + --indent; first = false; + push("}"); +} + +function buildRanges(keyword, ranges) { + if (ranges && ranges.length) { + var parts = []; + ranges.forEach(function(range) { + if (typeof range === "string") + parts.push("\"" + escape(range) + "\""); + else if (range[0] === range[1]) + parts.push(range[0]); + else + parts.push(range[0] + " to " + (range[1] === 0x1FFFFFFF ? "max" : range[1])); + }); + push(""); + push(keyword + " " + parts.join(", ") + ";"); + } +} + +function buildType(type) { + if (type.group) + return; // built with the sister-field + push(""); + push("message " + type.name + " {"); + ++indent; + buildOptions(type); + type.oneofsArray.forEach(build); + first = true; + type.fieldsArray.forEach(build); + consolidateExtends(type.nestedArray).remaining.forEach(build); + buildRanges("extensions", type.extensions); + buildRanges("reserved", type.reserved); + --indent; + push("}"); +} + +function buildField(field, passExtend) { + if (field.partOf || field.declaringField || field.extend !== undefined && !passExtend) + return; + if (first) { + first = false; + push(""); + } + if (field.resolvedType && field.resolvedType.group) { + buildGroup(field); + return; + } + var sb = []; + if (field.map) + sb.push("map<" + field.keyType + ", " + field.type + ">"); + else if (field.repeated) + sb.push("repeated", field.type); + else if (syntax === 2 || field.parent.group) + sb.push(field.required ? "required" : "optional", field.type); + else + sb.push(field.type); + sb.push(underScore(field.name), "=", field.id); + var opts = buildFieldOptions(field); + if (opts) + sb.push(opts); + push(sb.join(" ") + ";"); +} + +function buildGroup(field) { + push(field.rule + " group " + field.resolvedType.name + " = " + field.id + " {"); + ++indent; + buildOptions(field.resolvedType); + first = true; + field.resolvedType.fieldsArray.forEach(function(field) { + buildField(field); + }); + --indent; + push("}"); +} + +function buildFieldOptions(field) { + var keys; + if (!field.options || !(keys = Object.keys(field.options)).length) + return null; + var sb = []; + keys.forEach(function(key) { + var val = field.options[key]; + var wireType = types.packed[field.resolvedType instanceof Enum ? "int32" : field.type]; + switch (key) { + case "packed": + val = Boolean(val); + // skip when not packable or syntax default + if (wireType === undefined || syntax === 3 === val) + return; + break; + case "default": + if (syntax === 3) + return; + // skip default (resolved) default values + if (field.long && !util.longNeq(field.defaultValue, types.defaults[field.type]) || !field.long && field.defaultValue === types.defaults[field.type]) + return; + // enum defaults specified as strings are type references and not enclosed in quotes + if (field.resolvedType instanceof Enum) + break; + // otherwise fallthrough + default: + val = value(val); + break; + } + sb.push(key + "=" + val); + }); + return sb.length + ? "[" + sb.join(", ") + "]" + : null; +} + +function consolidateExtends(nested) { + var ext = {}; + nested = nested.filter(function(obj) { + if (!(obj instanceof Field) || obj.extend === undefined) + return true; + (ext[obj.extend] || (ext[obj.extend] = [])).push(obj); + return false; + }); + Object.keys(ext).forEach(function(extend) { + push(""); + push("extend " + extend + " {"); + ++indent; first = true; + ext[extend].forEach(function(field) { + buildField(field, true); + }); + --indent; + push("}"); + }); + return { + remaining: nested + }; +} + +function buildOneOf(oneof) { + push(""); + push("oneof " + underScore(oneof.name) + " {"); + ++indent; first = true; + oneof.oneof.forEach(function(fieldName) { + var field = oneof.parent.get(fieldName); + if (first) { + first = false; + push(""); + } + var opts = buildFieldOptions(field); + push(field.type + " " + underScore(field.name) + " = " + field.id + (opts ? " " + opts : "") + ";"); + }); + --indent; + push("}"); +} + +function buildService(service) { + push("service " + service.name + " {"); + ++indent; + service.methodsArray.forEach(build); + consolidateExtends(service.nestedArray).remaining.forEach(build); + --indent; + push("}"); +} + +function buildMethod(method) { + push(method.type + " " + method.name + " (" + (method.requestStream ? "stream " : "") + method.requestType + ") returns (" + (method.responseStream ? "stream " : "") + method.responseType + ");"); +} + +function buildOptions(object) { + if (!object.options) + return; + first = true; + Object.keys(object.options).forEach(function(key) { + if (first) { + first = false; + push(""); + } + var val = object.options[key]; + push("option " + key + " = " + JSON.stringify(val) + ";"); + }); +} diff --git a/node_modules/protobufjs/cli/targets/proto2.js b/node_modules/protobufjs/cli/targets/proto2.js new file mode 100644 index 0000000..09521e0 --- /dev/null +++ b/node_modules/protobufjs/cli/targets/proto2.js @@ -0,0 +1,10 @@ +"use strict"; +module.exports = proto2_target; + +var protobuf = require("../.."); + +proto2_target.description = "Protocol Buffers, Version 2"; + +function proto2_target(root, options, callback) { + require("./proto")(root, protobuf.util.merge(options, { syntax: "proto2" }), callback); +} diff --git a/node_modules/protobufjs/cli/targets/proto3.js b/node_modules/protobufjs/cli/targets/proto3.js new file mode 100644 index 0000000..661c916 --- /dev/null +++ b/node_modules/protobufjs/cli/targets/proto3.js @@ -0,0 +1,10 @@ +"use strict"; +module.exports = proto3_target; + +var protobuf = require("../.."); + +proto3_target.description = "Protocol Buffers, Version 3"; + +function proto3_target(root, options, callback) { + require("./proto")(root, protobuf.util.merge(options, { syntax: "proto3" }), callback); +} diff --git a/node_modules/protobufjs/cli/targets/static-module.js b/node_modules/protobufjs/cli/targets/static-module.js new file mode 100644 index 0000000..b561947 --- /dev/null +++ b/node_modules/protobufjs/cli/targets/static-module.js @@ -0,0 +1,29 @@ +"use strict"; +module.exports = static_module_target; + +// - The default wrapper supports AMD, CommonJS and the global scope (as window.root), in this order. +// - You can specify a custom wrapper with the --wrap argument. +// - CommonJS modules depend on the minimal build for reduced package size with browserify. +// - AMD and global scope depend on the full library for now. + +var util = require("../util"); + +var protobuf = require("../.."); + +static_module_target.description = "Static code without reflection as a module"; + +function static_module_target(root, options, callback) { + require("./static")(root, options, function(err, output) { + if (err) { + callback(err); + return; + } + try { + output = util.wrap(output, protobuf.util.merge({ dependency: "protobufjs/minimal" }, options)); + } catch (e) { + callback(e); + return; + } + callback(null, output); + }); +} diff --git a/node_modules/protobufjs/cli/targets/static.js b/node_modules/protobufjs/cli/targets/static.js new file mode 100644 index 0000000..0c938b0 --- /dev/null +++ b/node_modules/protobufjs/cli/targets/static.js @@ -0,0 +1,702 @@ +"use strict"; +module.exports = static_target; + +var protobuf = require("../.."), + UglifyJS = require("uglify-js"), + espree = require("espree"), + escodegen = require("escodegen"), + estraverse = require("estraverse"); + +var Type = protobuf.Type, + Service = protobuf.Service, + Enum = protobuf.Enum, + Namespace = protobuf.Namespace, + util = protobuf.util; + +var out = []; +var indent = 0; +var config = {}; + +static_target.description = "Static code without reflection (non-functional on its own)"; + +function static_target(root, options, callback) { + config = options; + try { + var aliases = []; + if (config.decode) + aliases.push("Reader"); + if (config.encode) + aliases.push("Writer"); + aliases.push("util"); + if (aliases.length) { + if (config.comments) + push("// Common aliases"); + push((config.es6 ? "const " : "var ") + aliases.map(function(name) { return "$" + name + " = $protobuf." + name; }).join(", ") + ";"); + push(""); + } + if (config.comments) { + if (root.comment) { + pushComment("@fileoverview " + root.comment); + push(""); + } + push("// Exported root namespace"); + } + var rootProp = util.safeProp(config.root || "default"); + push((config.es6 ? "const" : "var") + " $root = $protobuf.roots" + rootProp + " || ($protobuf.roots" + rootProp + " = {});"); + buildNamespace(null, root); + return callback(null, out.join("\n")); + } catch (err) { + return callback(err); + } finally { + out = []; + indent = 0; + config = {}; + } +} + +function push(line) { + if (line === "") + return out.push(""); + var ind = ""; + for (var i = 0; i < indent; ++i) + ind += " "; + return out.push(ind + line); +} + +function pushComment(lines) { + if (!config.comments) + return; + var split = []; + for (var i = 0; i < lines.length; ++i) + if (lines[i] != null && lines[i].substring(0, 8) !== "@exclude") + Array.prototype.push.apply(split, lines[i].split(/\r?\n/g)); + push("/**"); + split.forEach(function(line) { + if (line === null) + return; + push(" * " + line.replace(/\*\//g, "* /")); + }); + push(" */"); +} + +function exportName(object, asInterface) { + if (asInterface) { + if (object.__interfaceName) + return object.__interfaceName; + } else if (object.__exportName) + return object.__exportName; + var parts = object.fullName.substring(1).split("."), + i = 0; + while (i < parts.length) + parts[i] = escapeName(parts[i++]); + if (asInterface) + parts[i - 1] = "I" + parts[i - 1]; + return object[asInterface ? "__interfaceName" : "__exportName"] = parts.join("."); +} + +function escapeName(name) { + if (!name) + return "$root"; + return util.isReserved(name) ? name + "_" : name; +} + +function aOrAn(name) { + return ((/^[hH](?:ou|on|ei)/.test(name) || /^[aeiouAEIOU][a-z]/.test(name)) && !/^us/i.test(name) + ? "an " + : "a ") + name; +} + +function buildNamespace(ref, ns) { + if (!ns) + return; + if (ns.name !== "") { + push(""); + if (!ref && config.es6) + push("export const " + escapeName(ns.name) + " = " + escapeName(ref) + "." + escapeName(ns.name) + " = (() => {"); + else + push(escapeName(ref) + "." + escapeName(ns.name) + " = (function() {"); + ++indent; + } + + if (ns instanceof Type) { + buildType(undefined, ns); + } else if (ns instanceof Service) + buildService(undefined, ns); + else if (ns.name !== "") { + push(""); + pushComment([ + ns.comment || "Namespace " + ns.name + ".", + ns.parent instanceof protobuf.Root ? "@exports " + escapeName(ns.name) : "@memberof " + exportName(ns.parent), + "@namespace" + ]); + push((config.es6 ? "const" : "var") + " " + escapeName(ns.name) + " = {};"); + } + + ns.nestedArray.forEach(function(nested) { + if (nested instanceof Enum) + buildEnum(ns.name, nested); + else if (nested instanceof Namespace) + buildNamespace(ns.name, nested); + }); + if (ns.name !== "") { + push(""); + push("return " + escapeName(ns.name) + ";"); + --indent; + push("})();"); + } +} + +var reduceableBlockStatements = { + IfStatement: true, + ForStatement: true, + WhileStatement: true +}; + +var shortVars = { + "r": "reader", + "w": "writer", + "m": "message", + "t": "tag", + "l": "length", + "c": "end", "c2": "end2", + "k": "key", + "ks": "keys", "ks2": "keys2", + "e": "error", + "f": "impl", + "o": "options", + "d": "object", + "n": "long", + "p": "properties" +}; + +function beautifyCode(code) { + // Add semicolons + code = UglifyJS.minify(code, { + compress: false, + mangle: false, + output: { beautify: true } + }).code; + // Properly beautify + var ast = espree.parse(code); + estraverse.replace(ast, { + enter: function(node, parent) { + // rename short vars + if (node.type === "Identifier" && (parent.property !== node || parent.computed) && shortVars[node.name]) + return { + "type": "Identifier", + "name": shortVars[node.name] + }; + // replace var with let if es6 + if (config.es6 && node.type === "VariableDeclaration" && node.kind === "var") { + node.kind = "let"; + return undefined; + } + // remove braces around block statements with a single child + if (node.type === "BlockStatement" && reduceableBlockStatements[parent.type] && node.body.length === 1) + return node.body[0]; + return undefined; + } + }); + code = escodegen.generate(ast, { + format: { + newline: "\n", + quotes: "double" + } + }); + // Add id, wireType comments + if (config.comments) + code = code.replace(/\.uint32\((\d+)\)/g, function($0, $1) { + var id = $1 >>> 3, + wireType = $1 & 7; + return ".uint32(/* id " + id + ", wireType " + wireType + " =*/" + $1 + ")"; + }); + return code; +} + +var renameVars = { + "Writer": "$Writer", + "Reader": "$Reader", + "util": "$util" +}; + +function buildFunction(type, functionName, gen, scope) { + var code = gen.toString(functionName) + .replace(/((?!\.)types\[\d+])(\.values)/g, "$1"); // enums: use types[N] instead of reflected types[N].values + + var ast = espree.parse(code); + /* eslint-disable no-extra-parens */ + estraverse.replace(ast, { + enter: function(node, parent) { + // rename vars + if ( + node.type === "Identifier" && renameVars[node.name] + && ( + (parent.type === "MemberExpression" && parent.object === node) + || (parent.type === "BinaryExpression" && parent.right === node) + ) + ) + return { + "type": "Identifier", + "name": renameVars[node.name] + }; + // replace this.ctor with the actual ctor + if ( + node.type === "MemberExpression" + && node.object.type === "ThisExpression" + && node.property.type === "Identifier" && node.property.name === "ctor" + ) + return { + "type": "Identifier", + "name": "$root" + type.fullName + }; + // replace types[N] with the field's actual type + if ( + node.type === "MemberExpression" + && node.object.type === "Identifier" && node.object.name === "types" + && node.property.type === "Literal" + ) + return { + "type": "Identifier", + "name": "$root" + type.fieldsArray[node.property.value].resolvedType.fullName + }; + return undefined; + } + }); + /* eslint-enable no-extra-parens */ + code = escodegen.generate(ast, { + format: { + newline: "\n", + quotes: "double" + } + }); + + if (config.beautify) + code = beautifyCode(code); + + code = code.replace(/ {4}/g, "\t"); + + var hasScope = scope && Object.keys(scope).length, + isCtor = functionName === type.name; + + if (hasScope) // remove unused scope vars + Object.keys(scope).forEach(function(key) { + if (!new RegExp("\\b(" + key + ")\\b", "g").test(code)) + delete scope[key]; + }); + + var lines = code.split(/\n/g); + if (isCtor) // constructor + push(lines[0]); + else if (hasScope) // enclose in an iife + push(escapeName(type.name) + "." + escapeName(functionName) + " = (function(" + Object.keys(scope).map(escapeName).join(", ") + ") { return " + lines[0]); + else + push(escapeName(type.name) + "." + escapeName(functionName) + " = " + lines[0]); + lines.slice(1, lines.length - 1).forEach(function(line) { + var prev = indent; + var i = 0; + while (line.charAt(i++) === "\t") + ++indent; + push(line.trim()); + indent = prev; + }); + if (isCtor) + push("}"); + else if (hasScope) + push("};})(" + Object.keys(scope).map(function(key) { return scope[key]; }).join(", ") + ");"); + else + push("};"); +} + +function toJsType(field) { + var type; + + switch (field.type) { + case "double": + case "float": + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": + type = "number"; + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": + type = config.forceLong ? "Long" : config.forceNumber ? "number" : "number|Long"; + break; + case "bool": + type = "boolean"; + break; + case "string": + type = "string"; + break; + case "bytes": + type = "Uint8Array"; + break; + default: + if (field.resolve().resolvedType) + type = exportName(field.resolvedType, !(field.resolvedType instanceof protobuf.Enum || config.forceMessage)); + else + type = "*"; // should not happen + break; + } + if (field.map) + return "Object."; + if (field.repeated) + return "Array.<" + type + ">"; + return type; +} + +function buildType(ref, type) { + + if (config.comments) { + var typeDef = [ + "Properties of " + aOrAn(type.name) + ".", + type.parent instanceof protobuf.Root ? "@exports " + escapeName("I" + type.name) : "@memberof " + exportName(type.parent), + "@interface " + escapeName("I" + type.name) + ]; + type.fieldsArray.forEach(function(field) { + var prop = util.safeProp(field.name); // either .name or ["name"] + prop = prop.substring(1, prop.charAt(0) === "[" ? prop.length - 1 : prop.length); + var jsType = toJsType(field); + if (field.optional) + jsType = jsType + "|null"; + typeDef.push("@property {" + jsType + "} " + (field.optional ? "[" + prop + "]" : prop) + " " + (field.comment || type.name + " " + field.name)); + }); + push(""); + pushComment(typeDef); + } + + // constructor + push(""); + pushComment([ + "Constructs a new " + type.name + ".", + type.parent instanceof protobuf.Root ? "@exports " + escapeName(type.name) : "@memberof " + exportName(type.parent), + "@classdesc " + (type.comment || "Represents " + aOrAn(type.name) + "."), + config.comments ? "@implements " + escapeName("I" + type.name) : null, + "@constructor", + "@param {" + exportName(type, true) + "=} [" + (config.beautify ? "properties" : "p") + "] Properties to set" + ]); + buildFunction(type, type.name, Type.generateConstructor(type)); + + // default values + var firstField = true; + type.fieldsArray.forEach(function(field) { + field.resolve(); + var prop = util.safeProp(field.name); + if (config.comments) { + push(""); + var jsType = toJsType(field); + if (field.optional && !field.map && !field.repeated && field.resolvedType instanceof Type) + jsType = jsType + "|null|undefined"; + pushComment([ + field.comment || type.name + " " + field.name + ".", + "@member {" + jsType + "} " + field.name, + "@memberof " + exportName(type), + "@instance" + ]); + } else if (firstField) { + push(""); + firstField = false; + } + if (field.repeated) + push(escapeName(type.name) + ".prototype" + prop + " = $util.emptyArray;"); // overwritten in constructor + else if (field.map) + push(escapeName(type.name) + ".prototype" + prop + " = $util.emptyObject;"); // overwritten in constructor + else if (field.long) + push(escapeName(type.name) + ".prototype" + prop + " = $util.Long ? $util.Long.fromBits(" + + JSON.stringify(field.typeDefault.low) + "," + + JSON.stringify(field.typeDefault.high) + "," + + JSON.stringify(field.typeDefault.unsigned) + + ") : " + field.typeDefault.toNumber(field.type.charAt(0) === "u") + ";"); + else if (field.bytes) { + push(escapeName(type.name) + ".prototype" + prop + " = $util.newBuffer(" + JSON.stringify(Array.prototype.slice.call(field.typeDefault)) + ");"); + } else + push(escapeName(type.name) + ".prototype" + prop + " = " + JSON.stringify(field.typeDefault) + ";"); + }); + + // virtual oneof fields + var firstOneOf = true; + type.oneofsArray.forEach(function(oneof) { + if (firstOneOf) { + firstOneOf = false; + push(""); + if (config.comments) + push("// OneOf field names bound to virtual getters and setters"); + push((config.es6 ? "let" : "var") + " $oneOfFields;"); + } + oneof.resolve(); + push(""); + pushComment([ + oneof.comment || type.name + " " + oneof.name + ".", + "@member {" + oneof.oneof.map(JSON.stringify).join("|") + "|undefined} " + escapeName(oneof.name), + "@memberof " + exportName(type), + "@instance" + ]); + push("Object.defineProperty(" + escapeName(type.name) + ".prototype, " + JSON.stringify(oneof.name) +", {"); + ++indent; + push("get: $util.oneOfGetter($oneOfFields = [" + oneof.oneof.map(JSON.stringify).join(", ") + "]),"); + push("set: $util.oneOfSetter($oneOfFields)"); + --indent; + push("});"); + }); + + if (config.create) { + push(""); + pushComment([ + "Creates a new " + type.name + " instance using the specified properties.", + "@function create", + "@memberof " + exportName(type), + "@static", + "@param {" + exportName(type, true) + "=} [properties] Properties to set", + "@returns {" + exportName(type) + "} " + type.name + " instance" + ]); + push(escapeName(type.name) + ".create = function create(properties) {"); + ++indent; + push("return new " + escapeName(type.name) + "(properties);"); + --indent; + push("};"); + } + + if (config.encode) { + push(""); + pushComment([ + "Encodes the specified " + type.name + " message. Does not implicitly {@link " + exportName(type) + ".verify|verify} messages.", + "@function encode", + "@memberof " + exportName(type), + "@static", + "@param {" + exportName(type, !config.forceMessage) + "} " + (config.beautify ? "message" : "m") + " " + type.name + " message or plain object to encode", + "@param {$protobuf.Writer} [" + (config.beautify ? "writer" : "w") + "] Writer to encode to", + "@returns {$protobuf.Writer} Writer" + ]); + buildFunction(type, "encode", protobuf.encoder(type)); + + if (config.delimited) { + push(""); + pushComment([ + "Encodes the specified " + type.name + " message, length delimited. Does not implicitly {@link " + exportName(type) + ".verify|verify} messages.", + "@function encodeDelimited", + "@memberof " + exportName(type), + "@static", + "@param {" + exportName(type, !config.forceMessage) + "} message " + type.name + " message or plain object to encode", + "@param {$protobuf.Writer} [writer] Writer to encode to", + "@returns {$protobuf.Writer} Writer" + ]); + push(escapeName(type.name) + ".encodeDelimited = function encodeDelimited(message, writer) {"); + ++indent; + push("return this.encode(message, writer).ldelim();"); + --indent; + push("};"); + } + } + + if (config.decode) { + push(""); + pushComment([ + "Decodes " + aOrAn(type.name) + " message from the specified reader or buffer.", + "@function decode", + "@memberof " + exportName(type), + "@static", + "@param {$protobuf.Reader|Uint8Array} " + (config.beautify ? "reader" : "r") + " Reader or buffer to decode from", + "@param {number} [" + (config.beautify ? "length" : "l") + "] Message length if known beforehand", + "@returns {" + exportName(type) + "} " + type.name, + "@throws {Error} If the payload is not a reader or valid buffer", + "@throws {$protobuf.util.ProtocolError} If required fields are missing" + ]); + buildFunction(type, "decode", protobuf.decoder(type)); + + if (config.delimited) { + push(""); + pushComment([ + "Decodes " + aOrAn(type.name) + " message from the specified reader or buffer, length delimited.", + "@function decodeDelimited", + "@memberof " + exportName(type), + "@static", + "@param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from", + "@returns {" + exportName(type) + "} " + type.name, + "@throws {Error} If the payload is not a reader or valid buffer", + "@throws {$protobuf.util.ProtocolError} If required fields are missing" + ]); + push(escapeName(type.name) + ".decodeDelimited = function decodeDelimited(reader) {"); + ++indent; + push("if (!(reader instanceof $Reader))"); + ++indent; + push("reader = new $Reader(reader);"); + --indent; + push("return this.decode(reader, reader.uint32());"); + --indent; + push("};"); + } + } + + if (config.verify) { + push(""); + pushComment([ + "Verifies " + aOrAn(type.name) + " message.", + "@function verify", + "@memberof " + exportName(type), + "@static", + "@param {Object.} " + (config.beautify ? "message" : "m") + " Plain object to verify", + "@returns {string|null} `null` if valid, otherwise the reason why it is not" + ]); + buildFunction(type, "verify", protobuf.verifier(type)); + } + + if (config.convert) { + push(""); + pushComment([ + "Creates " + aOrAn(type.name) + " message from a plain object. Also converts values to their respective internal types.", + "@function fromObject", + "@memberof " + exportName(type), + "@static", + "@param {Object.} " + (config.beautify ? "object" : "d") + " Plain object", + "@returns {" + exportName(type) + "} " + type.name + ]); + buildFunction(type, "fromObject", protobuf.converter.fromObject(type)); + + push(""); + pushComment([ + "Creates a plain object from " + aOrAn(type.name) + " message. Also converts values to other types if specified.", + "@function toObject", + "@memberof " + exportName(type), + "@static", + "@param {" + exportName(type) + "} " + (config.beautify ? "message" : "m") + " " + type.name, + "@param {$protobuf.IConversionOptions} [" + (config.beautify ? "options" : "o") + "] Conversion options", + "@returns {Object.} Plain object" + ]); + buildFunction(type, "toObject", protobuf.converter.toObject(type)); + + push(""); + pushComment([ + "Converts this " + type.name + " to JSON.", + "@function toJSON", + "@memberof " + exportName(type), + "@instance", + "@returns {Object.} JSON object" + ]); + push(escapeName(type.name) + ".prototype.toJSON = function toJSON() {"); + ++indent; + push("return this.constructor.toObject(this, $protobuf.util.toJSONOptions);"); + --indent; + push("};"); + } +} + +function buildService(ref, service) { + + push(""); + pushComment([ + "Constructs a new " + service.name + " service.", + service.parent instanceof protobuf.Root ? "@exports " + escapeName(service.name) : "@memberof " + exportName(service.parent), + "@classdesc " + (service.comment || "Represents " + aOrAn(service.name)), + "@extends $protobuf.rpc.Service", + "@constructor", + "@param {$protobuf.RPCImpl} rpcImpl RPC implementation", + "@param {boolean} [requestDelimited=false] Whether requests are length-delimited", + "@param {boolean} [responseDelimited=false] Whether responses are length-delimited" + ]); + push("function " + escapeName(service.name) + "(rpcImpl, requestDelimited, responseDelimited) {"); + ++indent; + push("$protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);"); + --indent; + push("}"); + push(""); + push("(" + escapeName(service.name) + ".prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = " + escapeName(service.name) + ";"); + + if (config.create) { + push(""); + pushComment([ + "Creates new " + service.name + " service using the specified rpc implementation.", + "@function create", + "@memberof " + exportName(service), + "@static", + "@param {$protobuf.RPCImpl} rpcImpl RPC implementation", + "@param {boolean} [requestDelimited=false] Whether requests are length-delimited", + "@param {boolean} [responseDelimited=false] Whether responses are length-delimited", + "@returns {" + escapeName(service.name) + "} RPC service. Useful where requests and/or responses are streamed." + ]); + push(escapeName(service.name) + ".create = function create(rpcImpl, requestDelimited, responseDelimited) {"); + ++indent; + push("return new this(rpcImpl, requestDelimited, responseDelimited);"); + --indent; + push("};"); + } + + service.methodsArray.forEach(function(method) { + method.resolve(); + var lcName = protobuf.util.lcFirst(method.name), + cbName = escapeName(method.name + "Callback"); + push(""); + pushComment([ + "Callback as used by {@link " + exportName(service) + "#" + escapeName(lcName) + "}.", + // This is a more specialized version of protobuf.rpc.ServiceCallback + "@memberof " + exportName(service), + "@typedef " + cbName, + "@type {function}", + "@param {Error|null} error Error, if any", + "@param {" + exportName(method.resolvedResponseType) + "} [response] " + method.resolvedResponseType.name + ]); + push(""); + pushComment([ + method.comment || "Calls " + method.name + ".", + "@function " + lcName, + "@memberof " + exportName(service), + "@instance", + "@param {" + exportName(method.resolvedRequestType, !config.forceMessage) + "} request " + method.resolvedRequestType.name + " message or plain object", + "@param {" + exportName(service) + "." + cbName + "} callback Node-style callback called with the error, if any, and " + method.resolvedResponseType.name, + "@returns {undefined}", + "@variation 1" + ]); + push("Object.defineProperty(" + escapeName(service.name) + ".prototype" + util.safeProp(lcName) + " = function " + escapeName(lcName) + "(request, callback) {"); + ++indent; + push("return this.rpcCall(" + escapeName(lcName) + ", $root." + exportName(method.resolvedRequestType) + ", $root." + exportName(method.resolvedResponseType) + ", request, callback);"); + --indent; + push("}, \"name\", { value: " + JSON.stringify(method.name) + " });"); + if (config.comments) + push(""); + pushComment([ + method.comment || "Calls " + method.name + ".", + "@function " + lcName, + "@memberof " + exportName(service), + "@instance", + "@param {" + exportName(method.resolvedRequestType, !config.forceMessage) + "} request " + method.resolvedRequestType.name + " message or plain object", + "@returns {Promise<" + exportName(method.resolvedResponseType) + ">} Promise", + "@variation 2" + ]); + }); +} + +function buildEnum(ref, enm) { + + push(""); + var comment = [ + enm.comment || enm.name + " enum.", + enm.parent instanceof protobuf.Root ? "@exports " + escapeName(enm.name) : "@name " + exportName(enm), + config.forceEnumString ? "@enum {number}" : "@enum {string}", + ]; + Object.keys(enm.values).forEach(function(key) { + var val = config.forceEnumString ? key : enm.values[key]; + comment.push((config.forceEnumString ? "@property {string} " : "@property {number} ") + key + "=" + val + " " + (enm.comments[key] || key + " value")); + }); + pushComment(comment); + push(escapeName(ref) + "." + escapeName(enm.name) + " = (function() {"); + ++indent; + push((config.es6 ? "const" : "var") + " valuesById = {}, values = Object.create(valuesById);"); + var aliased = []; + Object.keys(enm.values).forEach(function(key) { + var valueId = enm.values[key]; + var val = config.forceEnumString ? JSON.stringify(key) : valueId; + if (aliased.indexOf(valueId) > -1) + push("values[" + JSON.stringify(key) + "] = " + val + ";"); + else { + push("values[valuesById[" + valueId + "] = " + JSON.stringify(key) + "] = " + val + ";"); + aliased.push(valueId); + } + }); + push("return values;"); + --indent; + push("})();"); +} diff --git a/node_modules/protobufjs/cli/util.js b/node_modules/protobufjs/cli/util.js new file mode 100644 index 0000000..ffce1ed --- /dev/null +++ b/node_modules/protobufjs/cli/util.js @@ -0,0 +1,183 @@ +"use strict"; +var fs = require("fs"), + path = require("path"), + child_process = require("child_process"); + +var semver; + +try { + // installed as a peer dependency + require.resolve("protobufjs"); + exports.pathToProtobufJs = "protobufjs"; +} catch (e) { + // local development, i.e. forked from github + exports.pathToProtobufJs = ".."; +} + +var protobuf = require(exports.pathToProtobufJs); + +function basenameCompare(a, b) { + var aa = String(a).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g), + bb = String(b).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g); + for (var i = 0, k = Math.min(aa.length, bb.length); i < k; i++) { + var x = parseFloat(aa[i]) || aa[i].toLowerCase(), + y = parseFloat(bb[i]) || bb[i].toLowerCase(); + if (x < y) + return -1; + if (x > y) + return 1; + } + return a.length < b.length ? -1 : 0; +} + +exports.requireAll = function requireAll(dirname) { + dirname = path.join(__dirname, dirname); + var files = fs.readdirSync(dirname).sort(basenameCompare), + all = {}; + files.forEach(function(file) { + var basename = path.basename(file, ".js"), + extname = path.extname(file); + if (extname === ".js") + all[basename] = require(path.join(dirname, file)); + }); + return all; +}; + +exports.traverse = function traverse(current, fn) { + fn(current); + if (current.fieldsArray) + current.fieldsArray.forEach(function(field) { + traverse(field, fn); + }); + if (current.oneofsArray) + current.oneofsArray.forEach(function(oneof) { + traverse(oneof, fn); + }); + if (current.methodsArray) + current.methodsArray.forEach(function(method) { + traverse(method, fn); + }); + if (current.nestedArray) + current.nestedArray.forEach(function(nested) { + traverse(nested, fn); + }); +}; + +exports.traverseResolved = function traverseResolved(current, fn) { + fn(current); + if (current.resolvedType) + traverseResolved(current.resolvedType, fn); + if (current.resolvedKeyType) + traverseResolved(current.resolvedKeyType, fn); + if (current.resolvedRequestType) + traverseResolved(current.resolvedRequestType, fn); + if (current.resolvedResponseType) + traverseResolved(current.resolvedResponseType, fn); +}; + +exports.inspect = function inspect(object, indent) { + if (!object) + return ""; + var chalk = require("chalk"); + var sb = []; + if (!indent) + indent = ""; + var ind = indent ? indent.substring(0, indent.length - 2) + "└ " : ""; + sb.push( + ind + chalk.bold(object.toString()) + (object.visible ? " (visible)" : ""), + indent + chalk.gray("parent: ") + object.parent + ); + if (object instanceof protobuf.Field) { + if (object.extend !== undefined) + sb.push(indent + chalk.gray("extend: ") + object.extend); + if (object.partOf) + sb.push(indent + chalk.gray("oneof : ") + object.oneof); + } + sb.push(""); + if (object.fieldsArray) + object.fieldsArray.forEach(function(field) { + sb.push(inspect(field, indent + " ")); + }); + if (object.oneofsArray) + object.oneofsArray.forEach(function(oneof) { + sb.push(inspect(oneof, indent + " ")); + }); + if (object.methodsArray) + object.methodsArray.forEach(function(service) { + sb.push(inspect(service, indent + " ")); + }); + if (object.nestedArray) + object.nestedArray.forEach(function(nested) { + sb.push(inspect(nested, indent + " ")); + }); + return sb.join("\n"); +}; + +function modExists(name, version) { + for (var i = 0; i < module.paths.length; ++i) { + try { + var pkg = JSON.parse(fs.readFileSync(path.join(module.paths[i], name, "package.json"))); + return semver + ? semver.satisfies(pkg.version, version) + : parseInt(pkg.version, 10) === parseInt(version.replace(/^[\^~]/, ""), 10); // used for semver only + } catch (e) {/**/} + } + return false; +} + +function modInstall(install) { + child_process.execSync("npm --silent install " + (typeof install === "string" ? install : install.join(" ")), { + cwd: __dirname, + stdio: "ignore" + }); +} + +exports.setup = function() { + var pkg = require(path.join(__dirname, "..", "package.json")); + var version = pkg.dependencies["semver"] || pkg.devDependencies["semver"]; + if (!modExists("semver", version)) { + process.stderr.write("installing semver@" + version + "\n"); + modInstall("semver@" + version); + } + semver = require("semver"); // used from now on for version comparison + var install = []; + pkg.cliDependencies.forEach(function(name) { + if (name === "semver") + return; + version = pkg.dependencies[name] || pkg.devDependencies[name]; + if (!modExists(name, version)) { + process.stderr.write("installing " + name + "@" + version + "\n"); + install.push(name + "@" + version); + } + }); + require("../scripts/postinstall"); // emit postinstall warning, if any + if (!install.length) + return; + modInstall(install); +}; + +exports.wrap = function(OUTPUT, options) { + var name = options.wrap || "default"; + var wrap; + try { + // try built-in wrappers first + wrap = fs.readFileSync(path.join(__dirname, "wrappers", name + ".js")).toString("utf8"); + } catch (e) { + // otherwise fetch the custom one + wrap = fs.readFileSync(path.resolve(process.cwd(), name)).toString("utf8"); + } + wrap = wrap.replace(/\$DEPENDENCY/g, JSON.stringify(options.dependency || "protobufjs")); + wrap = wrap.replace(/( *)\$OUTPUT;/, function($0, $1) { + return $1.length ? OUTPUT.replace(/^/mg, $1) : OUTPUT; + }); + if (options.lint !== "") + wrap = "/*" + options.lint + "*/\n" + wrap; + return wrap.replace(/\r?\n/g, "\n"); +}; + +exports.pad = function(str, len, l) { + while (str.length < len) + str = l ? str + " " : " " + str; + return str; +}; + diff --git a/node_modules/protobufjs/cli/wrappers/amd.js b/node_modules/protobufjs/cli/wrappers/amd.js new file mode 100644 index 0000000..c43dd73 --- /dev/null +++ b/node_modules/protobufjs/cli/wrappers/amd.js @@ -0,0 +1,7 @@ +define([$DEPENDENCY], function($protobuf) { + "use strict"; + + $OUTPUT; + + return $root; +}); diff --git a/node_modules/protobufjs/cli/wrappers/closure.js b/node_modules/protobufjs/cli/wrappers/closure.js new file mode 100644 index 0000000..c94327c --- /dev/null +++ b/node_modules/protobufjs/cli/wrappers/closure.js @@ -0,0 +1,7 @@ +(function($protobuf) { + "use strict"; + + $OUTPUT; + + return $root; +})(protobuf); diff --git a/node_modules/protobufjs/cli/wrappers/commonjs.js b/node_modules/protobufjs/cli/wrappers/commonjs.js new file mode 100644 index 0000000..6dc9168 --- /dev/null +++ b/node_modules/protobufjs/cli/wrappers/commonjs.js @@ -0,0 +1,7 @@ +"use strict"; + +var $protobuf = require($DEPENDENCY); + +$OUTPUT; + +module.exports = $root; diff --git a/node_modules/protobufjs/cli/wrappers/default.js b/node_modules/protobufjs/cli/wrappers/default.js new file mode 100644 index 0000000..34b29ec --- /dev/null +++ b/node_modules/protobufjs/cli/wrappers/default.js @@ -0,0 +1,15 @@ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define([$DEPENDENCY], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require($DEPENDENCY)); + +})(this, function($protobuf) { + "use strict"; + + $OUTPUT; + + return $root; +}); diff --git a/node_modules/protobufjs/cli/wrappers/es6.js b/node_modules/protobufjs/cli/wrappers/es6.js new file mode 100644 index 0000000..5bdc43c --- /dev/null +++ b/node_modules/protobufjs/cli/wrappers/es6.js @@ -0,0 +1,5 @@ +import * as $protobuf from $DEPENDENCY; + +$OUTPUT; + +export { $root as default }; diff --git a/node_modules/protobufjs/dist/README.md b/node_modules/protobufjs/dist/README.md new file mode 100644 index 0000000..93a54cc --- /dev/null +++ b/node_modules/protobufjs/dist/README.md @@ -0,0 +1,31 @@ +This folder contains prebuilt browser versions of the full library. When sending pull requests, it is not required to update these. + +Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: + +CDN usage +--------- + +Development: +``` + +``` + +Production: +``` + +``` + +**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +Frontend usage +-------------- + +Development: +``` + +``` + +Production: +``` + +``` diff --git a/node_modules/protobufjs/dist/light/README.md b/node_modules/protobufjs/dist/light/README.md new file mode 100644 index 0000000..2122c3f --- /dev/null +++ b/node_modules/protobufjs/dist/light/README.md @@ -0,0 +1,31 @@ +This folder contains prebuilt browser versions of the light library suitable for use with reflection, static code and JSON descriptors / modules. When sending pull requests, it is not required to update these. + +Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: + +CDN usage +--------- + +Development: +``` + +``` + +Production: +``` + +``` + +**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +Frontend usage +-------------- + +Development: +``` + +``` + +Production: +``` + +``` diff --git a/node_modules/protobufjs/dist/light/protobuf.js b/node_modules/protobufjs/dist/light/protobuf.js new file mode 100644 index 0000000..a2ff125 --- /dev/null +++ b/node_modules/protobufjs/dist/light/protobuf.js @@ -0,0 +1,7152 @@ +/*! + * protobuf.js v6.8.8 (c) 2016, daniel wirtz + * compiled thu, 19 jul 2018 00:33:25 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +(function(undefined){"use strict";(function prelude(modules, cache, entries) { + + // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS + // sources through a conflict-free require shim and is again wrapped within an iife that + // provides a minification-friendly `undefined` var plus a global "use strict" directive + // so that minification can remove the directives of each module. + + function $require(name) { + var $module = cache[name]; + if (!$module) + modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); + return $module.exports; + } + + var protobuf = $require(entries[0]); + + // Expose globally + protobuf.util.global.protobuf = protobuf; + + // Be nice to AMD + if (typeof define === "function" && define.amd) + define(["long"], function(Long) { + if (Long && Long.isLong) { + protobuf.util.Long = Long; + protobuf.configure(); + } + return protobuf; + }); + + // Be nice to CommonJS + if (typeof module === "object" && module && module.exports) + module.exports = protobuf; + +})/* end of prelude */({1:[function(require,module,exports){ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + +},{}],2:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + +},{}],3:[function(require,module,exports){ +"use strict"; +module.exports = codegen; + +/** + * Begins generating a function. + * @memberof util + * @param {string[]} functionParams Function parameter names + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + */ +function codegen(functionParams, functionName) { + + /* istanbul ignore if */ + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = undefined; + } + + var body = []; + + /** + * Appends code to the function's body or finishes generation. + * @typedef Codegen + * @type {function} + * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param {...*} [formatParams] Format parameters + * @returns {Codegen|Function} Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ + + function Codegen(formatStringOrScope) { + // note that explicit array handling below makes this ~50% faster + + // finish the function + if (typeof formatStringOrScope !== "string") { + var source = toString(); + if (codegen.verbose) + console.log("codegen: " + source); // eslint-disable-line no-console + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), + scopeParams = new Array(scopeKeys.length + 1), + scopeValues = new Array(scopeKeys.length), + scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func + } + return Function(source)(); // eslint-disable-line no-new-func + } + + // otherwise append to body + var formatParams = new Array(arguments.length - 1), + formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { + var value = formatParams[formatOffset++]; + switch ($1) { + case "d": case "f": return String(Number(value)); + case "i": return String(Math.floor(value)); + case "j": return JSON.stringify(value); + case "s": return String(value); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + + function toString(functionNameOverride) { + return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + + Codegen.toString = toString; + return Codegen; +} + +/** + * Begins generating a function. + * @memberof util + * @function codegen + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + * @variation 2 + */ + +/** + * When set to `true`, codegen will log generated code to console. Useful for debugging. + * @name util.codegen.verbose + * @type {boolean} + */ +codegen.verbose = false; + +},{}],4:[function(require,module,exports){ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + +},{}],5:[function(require,module,exports){ +"use strict"; +module.exports = fetch; + +var asPromise = require(1), + inquire = require(7); + +var fs = inquire("fs"); + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Options as used by {@link util.fetch}. + * @typedef FetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {FetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +function fetch(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + if (!callback) + return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this + + // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" + ? fetch.xhr(filename, options, callback) + : err + ? callback(err) + : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + + // use the XHR version otherwise. + return fetch.xhr(filename, options, callback); +} + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ + +/**/ +fetch.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { + + if (xhr.readyState !== 4) + return undefined; + + // local cors security errors return status 0 / empty string, too. afaik this cannot be + // reliably distinguished from an actually empty file for security reasons. feel free + // to send a pull request if you are aware of a solution. + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + + // if binary data is expected, make sure that some sort of array is returned, even if + // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. + if (options.binary) { + var buffer = xhr.response; + if (!buffer) { + buffer = []; + for (var i = 0; i < xhr.responseText.length; ++i) + buffer.push(xhr.responseText.charCodeAt(i) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); + } + return callback(null, xhr.responseText); + }; + + if (options.binary) { + // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + + xhr.open("GET", filename); + xhr.send(); +}; + +},{"1":1,"7":7}],6:[function(require,module,exports){ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + +},{}],7:[function(require,module,exports){ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + +},{}],8:[function(require,module,exports){ +"use strict"; + +/** + * A minimal path module to resolve Unix, Windows and URL paths alike. + * @memberof util + * @namespace + */ +var path = exports; + +var isAbsolute = +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +path.isAbsolute = function isAbsolute(path) { + return /^(?:\/|\w+:)/.test(path); +}; + +var normalize = +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +path.normalize = function normalize(path) { + path = path.replace(/\\/g, "/") + .replace(/\/{2,}/g, "/"); + var parts = path.split("/"), + absolute = isAbsolute(path), + prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i = 0; i < parts.length;) { + if (parts[i] === "..") { + if (i > 0 && parts[i - 1] !== "..") + parts.splice(--i, 2); + else if (absolute) + parts.splice(i, 1); + else + ++i; + } else if (parts[i] === ".") + parts.splice(i, 1); + else + ++i; + } + return prefix + parts.join("/"); +}; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +path.resolve = function resolve(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize(includePath); + if (isAbsolute(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; +}; + +},{}],9:[function(require,module,exports){ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +},{}],10:[function(require,module,exports){ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + +},{}],11:[function(require,module,exports){ +"use strict"; +/** + * Runtime message from/to plain object converters. + * @namespace + */ +var converter = exports; + +var Enum = require(14), + util = require(33); + +/** + * Generates a partial value fromObject conveter. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} prop Property reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genValuePartial_fromObject(gen, field, fieldIndex, prop) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(d%s){", prop); + for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { + if (field.repeated && values[keys[i]] === field.typeDefault) gen + ("default:"); + gen + ("case%j:", keys[i]) + ("case %i:", values[keys[i]]) + ("m%s=%j", prop, values[keys[i]]) + ("break"); + } gen + ("}"); + } else gen + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); + } else { + var isUnsigned = false; + switch (field.type) { + case "double": + case "float": gen + ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" + break; + case "uint32": + case "fixed32": gen + ("m%s=d%s>>>0", prop, prop); + break; + case "int32": + case "sint32": + case "sfixed32": gen + ("m%s=d%s|0", prop, prop); + break; + case "uint64": + isUnsigned = true; + // eslint-disable-line no-fallthrough + case "int64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(util.Long)") + ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) + ("else if(typeof d%s===\"string\")", prop) + ("m%s=parseInt(d%s,10)", prop, prop) + ("else if(typeof d%s===\"number\")", prop) + ("m%s=d%s", prop, prop) + ("else if(typeof d%s===\"object\")", prop) + ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); + break; + case "bytes": gen + ("if(typeof d%s===\"string\")", prop) + ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) + ("else if(d%s.length)", prop) + ("m%s=d%s", prop, prop); + break; + case "string": gen + ("m%s=String(d%s)", prop, prop); + break; + case "bool": gen + ("m%s=Boolean(d%s)", prop, prop); + break; + /* default: gen + ("m%s=d%s", prop, prop); + break; */ + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.fromObject = function fromObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray; + var gen = util.codegen(["d"], mtype.name + "$fromObject") + ("if(d instanceof this.ctor)") + ("return d"); + if (!fields.length) return gen + ("return new this.ctor"); + gen + ("var m=new this.ctor"); + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + prop = util.safeProp(field.name); + + // Map fields + if (field.map) { gen + ("if(d%s){", prop) + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s={}", prop) + ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); + break; + case "bytes": gen + ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); + break; + default: gen + ("d%s=m%s", prop, prop); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.toObject = function toObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); + if (!fields.length) + return util.codegen()("return {}"); + var gen = util.codegen(["m", "o"], mtype.name + "$toObject") + ("if(!o)") + ("o={}") + ("var d={}"); + + var repeatedFields = [], + mapFields = [], + normalFields = [], + i = 0; + for (; i < fields.length; ++i) + if (!fields[i].partOf) + ( fields[i].resolve().repeated ? repeatedFields + : fields[i].map ? mapFields + : normalFields).push(fields[i]); + + if (repeatedFields.length) { gen + ("if(o.arrays||o.defaults){"); + for (i = 0; i < repeatedFields.length; ++i) gen + ("d%s=[]", util.safeProp(repeatedFields[i].name)); + gen + ("}"); + } + + if (mapFields.length) { gen + ("if(o.objects||o.defaults){"); + for (i = 0; i < mapFields.length; ++i) gen + ("d%s={}", util.safeProp(mapFields[i].name)); + gen + ("}"); + } + + if (normalFields.length) { gen + ("if(o.defaults){"); + for (i = 0; i < normalFields.length; ++i) { + var field = normalFields[i], + prop = util.safeProp(field.name); + if (field.resolvedType instanceof Enum) gen + ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); + else if (field.long) gen + ("if(util.Long){") + ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) + ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) + ("}else") + ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); + else if (field.bytes) { + var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; + gen + ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) + ("else{") + ("d%s=%s", prop, arrayDefault) + ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) + ("}"); + } else gen + ("d%s=%j", prop, field.typeDefault); // also messages (=null) + } gen + ("}"); + } + var hasKs2 = false; + for (i = 0; i < fields.length; ++i) { + var field = fields[i], + index = mtype._fieldsArray.indexOf(field), + prop = util.safeProp(field.name); + if (field.map) { + if (!hasKs2) { hasKs2 = true; gen + ("var ks2"); + } gen + ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) + ("d%s={}", prop) + ("for(var j=0;j>>3){"); + + var i = 0; + for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + ref = "m" + util.safeProp(field.name); gen + ("case %i:", field.id); + + // Map fields + if (field.map) { gen + ("r.skip().pos++") // assumes id 1 + key wireType + ("if(%s===util.emptyObject)", ref) + ("%s={}", ref) + ("k=r.%s()", field.keyType) + ("r.pos++"); // assumes id 2 + value wireType + if (types.long[field.keyType] !== undefined) { + if (types.basic[type] === undefined) gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=r.%s()", ref, type); + } else { + if (types.basic[type] === undefined) gen + ("%s[k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[k]=r.%s()", ref, type); + } + + // Repeated fields + } else if (field.repeated) { gen + + ("if(!(%s&&%s.length))", ref, ref) + ("%s=[]", ref); + + // Packable (always check for forward and backward compatiblity) + if (types.packed[type] !== undefined) gen + ("if((t&7)===2){") + ("var c2=r.uint32()+r.pos") + ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0) + : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); +} + +/** + * Generates an encoder specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function encoder(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var gen = util.codegen(["m", "w"], mtype.name + "$encode") + ("if(!w)") + ("w=Writer.create()"); + + var i, ref; + + // "when a message is serialized its known fields should be written sequentially by field number" + var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); + + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + index = mtype._fieldsArray.indexOf(field), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + wireType = types.basic[type]; + ref = "m" + util.safeProp(field.name); + + // Map fields + if (field.map) { + gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name) // !== undefined && !== null + ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); + if (wireType === undefined) gen + ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups + else gen + (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); + gen + ("}") + ("}"); + + // Repeated fields + } else if (field.repeated) { gen + ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null + + // Packed repeated + if (field.packed && types.packed[type] !== undefined) { gen + + ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) + ("for(var i=0;i<%s.length;++i)", ref) + ("w.%s(%s[i])", type, ref) + ("w.ldelim()"); + + // Non-packed + } else { gen + + ("for(var i=0;i<%s.length;++i)", ref); + if (wireType === undefined) + genTypePartial(gen, field, index, ref + "[i]"); + else gen + ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); + + } gen + ("}"); + + // Non-repeated + } else { + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j))", ref, field.name); // !== undefined && !== null + + if (wireType === undefined) + genTypePartial(gen, field, index, ref); + else gen + ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); + + } + } + + return gen + ("return w"); + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} +},{"14":14,"32":32,"33":33}],14:[function(require,module,exports){ +"use strict"; +module.exports = Enum; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; + +var Namespace = require(21), + util = require(33); + +/** + * Constructs a new enum instance. + * @classdesc Reflected enum. + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {Object.} [values] Enum values as an object, by name + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this enum + * @param {Object.} [comments] The value comments for this enum + */ +function Enum(name, values, options, comment, comments) { + ReflectionObject.call(this, name, options); + + if (values && typeof values !== "object") + throw TypeError("values must be an object"); + + /** + * Enum values by id. + * @type {Object.} + */ + this.valuesById = {}; + + /** + * Enum values by name. + * @type {Object.} + */ + this.values = Object.create(this.valuesById); // toJSON, marker + + /** + * Enum comment text. + * @type {string|null} + */ + this.comment = comment; + + /** + * Value comment texts, if any. + * @type {Object.} + */ + this.comments = comments || {}; + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + // Note that values inherit valuesById on their prototype which makes them a TypeScript- + // compatible enum. This is used by pbts to write actual enum definitions that work for + // static and reflection code alike instead of emitting generic object definitions. + + if (values) + for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) + if (typeof values[keys[i]] === "number") // use forward entries only + this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; +} + +/** + * Enum descriptor. + * @interface IEnum + * @property {Object.} values Enum values + * @property {Object.} [options] Enum options + */ + +/** + * Constructs an enum from an enum descriptor. + * @param {string} name Enum name + * @param {IEnum} json Enum descriptor + * @returns {Enum} Created enum + * @throws {TypeError} If arguments are invalid + */ +Enum.fromJSON = function fromJSON(name, json) { + var enm = new Enum(name, json.values, json.options, json.comment, json.comments); + enm.reserved = json.reserved; + return enm; +}; + +/** + * Converts this enum to an enum descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IEnum} Enum descriptor + */ +Enum.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "values" , this.values, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "comment" , keepComments ? this.comment : undefined, + "comments" , keepComments ? this.comments : undefined + ]); +}; + +/** + * Adds a value to this enum. + * @param {string} name Value name + * @param {number} id Value id + * @param {string} [comment] Comment, if any + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ +Enum.prototype.add = function add(name, id, comment) { + // utilized by the parser but not by .fromJSON + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (!util.isInteger(id)) + throw TypeError("id must be an integer"); + + if (this.values[name] !== undefined) + throw Error("duplicate name '" + name + "' in " + this); + + if (this.isReservedId(id)) + throw Error("id " + id + " is reserved in " + this); + + if (this.isReservedName(name)) + throw Error("name '" + name + "' is reserved in " + this); + + if (this.valuesById[id] !== undefined) { + if (!(this.options && this.options.allow_alias)) + throw Error("duplicate id " + id + " in " + this); + this.values[name] = id; + } else + this.valuesById[this.values[name] = id] = name; + + this.comments[name] = comment || null; + return this; +}; + +/** + * Removes a value from this enum + * @param {string} name Value name + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ +Enum.prototype.remove = function remove(name) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + var val = this.values[name]; + if (val == null) + throw Error("name '" + name + "' does not exist in " + this); + + delete this.valuesById[val]; + delete this.values[name]; + delete this.comments[name]; + + return this; +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +},{"21":21,"22":22,"33":33}],15:[function(require,module,exports){ +"use strict"; +module.exports = Field; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; + +var Enum = require(14), + types = require(32), + util = require(33); + +var Type; // cyclic + +var ruleRe = /^required|optional|repeated$/; + +/** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @name Field + * @classdesc Reflected message field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a field from a field descriptor. + * @param {string} name Field name + * @param {IField} json Field descriptor + * @returns {Field} Created field + * @throws {TypeError} If arguments are invalid + */ +Field.fromJSON = function fromJSON(name, json) { + return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); +}; + +/** + * Not an actual constructor. Use {@link Field} instead. + * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. + * @exports FieldBase + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function Field(name, id, type, rule, extend, options, comment) { + + if (util.isObject(rule)) { + comment = extend; + options = rule; + rule = extend = undefined; + } else if (util.isObject(extend)) { + comment = options; + options = extend; + extend = undefined; + } + + ReflectionObject.call(this, name, options); + + if (!util.isInteger(id) || id < 0) + throw TypeError("id must be a non-negative integer"); + + if (!util.isString(type)) + throw TypeError("type must be a string"); + + if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) + throw TypeError("rule must be a string rule"); + + if (extend !== undefined && !util.isString(extend)) + throw TypeError("extend must be a string"); + + /** + * Field rule, if any. + * @type {string|undefined} + */ + this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON + + /** + * Field type. + * @type {string} + */ + this.type = type; // toJSON + + /** + * Unique field id. + * @type {number} + */ + this.id = id; // toJSON, marker + + /** + * Extended type if different from parent. + * @type {string|undefined} + */ + this.extend = extend || undefined; // toJSON + + /** + * Whether this field is required. + * @type {boolean} + */ + this.required = rule === "required"; + + /** + * Whether this field is optional. + * @type {boolean} + */ + this.optional = !this.required; + + /** + * Whether this field is repeated. + * @type {boolean} + */ + this.repeated = rule === "repeated"; + + /** + * Whether this field is a map or not. + * @type {boolean} + */ + this.map = false; + + /** + * Message this field belongs to. + * @type {Type|null} + */ + this.message = null; + + /** + * OneOf this field belongs to, if any, + * @type {OneOf|null} + */ + this.partOf = null; + + /** + * The field type's default value. + * @type {*} + */ + this.typeDefault = null; + + /** + * The field's default value on prototypes. + * @type {*} + */ + this.defaultValue = null; + + /** + * Whether this field's value should be treated as a long. + * @type {boolean} + */ + this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; + + /** + * Whether this field's value is a buffer. + * @type {boolean} + */ + this.bytes = type === "bytes"; + + /** + * Resolved type if not a basic type. + * @type {Type|Enum|null} + */ + this.resolvedType = null; + + /** + * Sister-field within the extended type if a declaring extension field. + * @type {Field|null} + */ + this.extensionField = null; + + /** + * Sister-field within the declaring namespace if an extended field. + * @type {Field|null} + */ + this.declaringField = null; + + /** + * Internally remembers whether this field is packed. + * @type {boolean|null} + * @private + */ + this._packed = null; + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Determines whether this field is packed. Only relevant when repeated and working with proto2. + * @name Field#packed + * @type {boolean} + * @readonly + */ +Object.defineProperty(Field.prototype, "packed", { + get: function() { + // defaults to packed=true if not explicity set to false + if (this._packed === null) + this._packed = this.getOption("packed") !== false; + return this._packed; + } +}); + +/** + * @override + */ +Field.prototype.setOption = function setOption(name, value, ifNotSet) { + if (name === "packed") // clear cached before setting + this._packed = null; + return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); +}; + +/** + * Field descriptor. + * @interface IField + * @property {string} [rule="optional"] Field rule + * @property {string} type Field type + * @property {number} id Field id + * @property {Object.} [options] Field options + */ + +/** + * Extension field descriptor. + * @interface IExtensionField + * @extends IField + * @property {string} extend Extended type + */ + +/** + * Converts this field to a field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IField} Field descriptor + */ +Field.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "rule" , this.rule !== "optional" && this.rule || undefined, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Resolves this field's type references. + * @returns {Field} `this` + * @throws {Error} If any reference cannot be resolved + */ +Field.prototype.resolve = function resolve() { + + if (this.resolved) + return this; + + if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it + this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); + if (this.resolvedType instanceof Type) + this.typeDefault = null; + else // instanceof Enum + this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined + } + + // use explicitly set default value if present + if (this.options && this.options["default"] != null) { + this.typeDefault = this.options["default"]; + if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") + this.typeDefault = this.resolvedType.values[this.typeDefault]; + } + + // remove unnecessary options + if (this.options) { + if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) + delete this.options.packed; + if (!Object.keys(this.options).length) + this.options = undefined; + } + + // convert to internal data type if necesssary + if (this.long) { + this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); + + /* istanbul ignore else */ + if (Object.freeze) + Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) + + } else if (this.bytes && typeof this.typeDefault === "string") { + var buf; + if (util.base64.test(this.typeDefault)) + util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); + else + util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); + this.typeDefault = buf; + } + + // take special care of maps and repeated fields + if (this.map) + this.defaultValue = util.emptyObject; + else if (this.repeated) + this.defaultValue = util.emptyArray; + else + this.defaultValue = this.typeDefault; + + // ensure proper value on prototype + if (this.parent instanceof Type) + this.parent.ctor.prototype[this.name] = this.defaultValue; + + return ReflectionObject.prototype.resolve.call(this); +}; + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @typedef FieldDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} fieldName Field name + * @returns {undefined} + */ + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @param {T} [defaultValue] Default value + * @returns {FieldDecorator} Decorator function + * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] + */ +Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { + + // submessage: decorate the submessage and use its name as the type + if (typeof fieldType === "function") + fieldType = util.decorateType(fieldType).name; + + // enum reference: create a reflected copy of the enum and keep reuseing it + else if (fieldType && typeof fieldType === "object") + fieldType = util.decorateEnum(fieldType).name; + + return function fieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); + }; +}; + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {Constructor|string} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @returns {FieldDecorator} Decorator function + * @template T extends Message + * @variation 2 + */ +// like Field.d but without a default value + +// Sets up cyclic dependencies (called in index-light) +Field._configure = function configure(Type_) { + Type = Type_; +}; + +},{"14":14,"22":22,"32":32,"33":33}],16:[function(require,module,exports){ +"use strict"; +var protobuf = module.exports = require(17); + +protobuf.build = "light"; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @typedef LoadCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Root} [root] Root, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param {string|string[]} filename One or multiple files to load + * @param {Root} root Root namespace, defaults to create a new one if omitted. + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + */ +function load(filename, root, callback) { + if (typeof root === "function") { + callback = root; + root = new protobuf.Root(); + } else if (!root) + root = new protobuf.Root(); + return root.load(filename, callback); +} + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Promise} Promise + * @see {@link Root#load} + * @variation 3 + */ +// function load(filename:string, [root:Root]):Promise + +protobuf.load = load; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +function loadSync(filename, root) { + if (!root) + root = new protobuf.Root(); + return root.loadSync(filename); +} + +protobuf.loadSync = loadSync; + +// Serialization +protobuf.encoder = require(13); +protobuf.decoder = require(12); +protobuf.verifier = require(36); +protobuf.converter = require(11); + +// Reflection +protobuf.ReflectionObject = require(22); +protobuf.Namespace = require(21); +protobuf.Root = require(26); +protobuf.Enum = require(14); +protobuf.Type = require(31); +protobuf.Field = require(15); +protobuf.OneOf = require(23); +protobuf.MapField = require(18); +protobuf.Service = require(30); +protobuf.Method = require(20); + +// Runtime +protobuf.Message = require(19); +protobuf.wrappers = require(37); + +// Utility +protobuf.types = require(32); +protobuf.util = require(33); + +// Set up possibly cyclic reflection dependencies +protobuf.ReflectionObject._configure(protobuf.Root); +protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); +protobuf.Root._configure(protobuf.Type); +protobuf.Field._configure(protobuf.Type); + +},{"11":11,"12":12,"13":13,"14":14,"15":15,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"26":26,"30":30,"31":31,"32":32,"33":33,"36":36,"37":37}],17:[function(require,module,exports){ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require(38); +protobuf.BufferWriter = require(39); +protobuf.Reader = require(24); +protobuf.BufferReader = require(25); + +// Utility +protobuf.util = require(35); +protobuf.rpc = require(28); +protobuf.roots = require(27); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.Reader._configure(protobuf.BufferReader); + protobuf.util._configure(); +} + +// Set up buffer utility according to the environment +protobuf.Writer._configure(protobuf.BufferWriter); +configure(); + +},{"24":24,"25":25,"27":27,"28":28,"35":35,"38":38,"39":39}],18:[function(require,module,exports){ +"use strict"; +module.exports = MapField; + +// extends Field +var Field = require(15); +((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; + +var types = require(32), + util = require(33); + +/** + * Constructs a new map field instance. + * @classdesc Reflected map field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} keyType Key type + * @param {string} type Value type + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function MapField(name, id, keyType, type, options, comment) { + Field.call(this, name, id, type, undefined, undefined, options, comment); + + /* istanbul ignore if */ + if (!util.isString(keyType)) + throw TypeError("keyType must be a string"); + + /** + * Key type. + * @type {string} + */ + this.keyType = keyType; // toJSON, marker + + /** + * Resolved key type if not a basic type. + * @type {ReflectionObject|null} + */ + this.resolvedKeyType = null; + + // Overrides Field#map + this.map = true; +} + +/** + * Map field descriptor. + * @interface IMapField + * @extends {IField} + * @property {string} keyType Key type + */ + +/** + * Extension map field descriptor. + * @interface IExtensionMapField + * @extends IMapField + * @property {string} extend Extended type + */ + +/** + * Constructs a map field from a map field descriptor. + * @param {string} name Field name + * @param {IMapField} json Map field descriptor + * @returns {MapField} Created map field + * @throws {TypeError} If arguments are invalid + */ +MapField.fromJSON = function fromJSON(name, json) { + return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); +}; + +/** + * Converts this map field to a map field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMapField} Map field descriptor + */ +MapField.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "keyType" , this.keyType, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +MapField.prototype.resolve = function resolve() { + if (this.resolved) + return this; + + // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" + if (types.mapKey[this.keyType] === undefined) + throw Error("invalid key type: " + this.keyType); + + return Field.prototype.resolve.call(this); +}; + +/** + * Map field decorator (TypeScript). + * @name MapField.d + * @function + * @param {number} fieldId Field id + * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type + * @returns {FieldDecorator} Decorator function + * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } + */ +MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { + + // submessage value: decorate the submessage and use its name as the type + if (typeof fieldValueType === "function") + fieldValueType = util.decorateType(fieldValueType).name; + + // enum reference value: create a reflected copy of the enum and keep reuseing it + else if (fieldValueType && typeof fieldValueType === "object") + fieldValueType = util.decorateEnum(fieldValueType).name; + + return function mapFieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); + }; +}; + +},{"15":15,"32":32,"33":33}],19:[function(require,module,exports){ +"use strict"; +module.exports = Message; + +var util = require(35); + +/** + * Constructs a new message instance. + * @classdesc Abstract runtime message. + * @constructor + * @param {Properties} [properties] Properties to set + * @template T extends object = object + */ +function Message(properties) { + // not used internally + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; +} + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/*eslint-disable valid-jsdoc*/ + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message} Message instance + * @template T extends Message + * @this Constructor + */ +Message.create = function create(properties) { + return this.$type.create(properties); +}; + +/** + * Encodes a message of this type. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decode = function decode(reader) { + return this.$type.decode(reader); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decodeDelimited = function decodeDelimited(reader) { + return this.$type.decodeDelimited(reader); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object + * @returns {T} Message instance + * @template T extends Message + * @this Constructor + */ +Message.fromObject = function fromObject(object) { + return this.$type.fromObject(object); +}; + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {T} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @template T extends Message + * @this Constructor + */ +Message.toObject = function toObject(message, options) { + return this.$type.toObject(message, options); +}; + +/** + * Converts this message to JSON. + * @returns {Object.} JSON object + */ +Message.prototype.toJSON = function toJSON() { + return this.$type.toObject(this, util.toJSONOptions); +}; + +/*eslint-enable valid-jsdoc*/ +},{"35":35}],20:[function(require,module,exports){ +"use strict"; +module.exports = Method; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; + +var util = require(33); + +/** + * Constructs a new service method instance. + * @classdesc Reflected service method. + * @extends ReflectionObject + * @constructor + * @param {string} name Method name + * @param {string|undefined} type Method type, usually `"rpc"` + * @param {string} requestType Request message type + * @param {string} responseType Response message type + * @param {boolean|Object.} [requestStream] Whether the request is streamed + * @param {boolean|Object.} [responseStream] Whether the response is streamed + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this method + */ +function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) { + + /* istanbul ignore next */ + if (util.isObject(requestStream)) { + options = requestStream; + requestStream = responseStream = undefined; + } else if (util.isObject(responseStream)) { + options = responseStream; + responseStream = undefined; + } + + /* istanbul ignore if */ + if (!(type === undefined || util.isString(type))) + throw TypeError("type must be a string"); + + /* istanbul ignore if */ + if (!util.isString(requestType)) + throw TypeError("requestType must be a string"); + + /* istanbul ignore if */ + if (!util.isString(responseType)) + throw TypeError("responseType must be a string"); + + ReflectionObject.call(this, name, options); + + /** + * Method type. + * @type {string} + */ + this.type = type || "rpc"; // toJSON + + /** + * Request type. + * @type {string} + */ + this.requestType = requestType; // toJSON, marker + + /** + * Whether requests are streamed or not. + * @type {boolean|undefined} + */ + this.requestStream = requestStream ? true : undefined; // toJSON + + /** + * Response type. + * @type {string} + */ + this.responseType = responseType; // toJSON + + /** + * Whether responses are streamed or not. + * @type {boolean|undefined} + */ + this.responseStream = responseStream ? true : undefined; // toJSON + + /** + * Resolved request type. + * @type {Type|null} + */ + this.resolvedRequestType = null; + + /** + * Resolved response type. + * @type {Type|null} + */ + this.resolvedResponseType = null; + + /** + * Comment for this method + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Method descriptor. + * @interface IMethod + * @property {string} [type="rpc"] Method type + * @property {string} requestType Request type + * @property {string} responseType Response type + * @property {boolean} [requestStream=false] Whether requests are streamed + * @property {boolean} [responseStream=false] Whether responses are streamed + * @property {Object.} [options] Method options + */ + +/** + * Constructs a method from a method descriptor. + * @param {string} name Method name + * @param {IMethod} json Method descriptor + * @returns {Method} Created method + * @throws {TypeError} If arguments are invalid + */ +Method.fromJSON = function fromJSON(name, json) { + return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment); +}; + +/** + * Converts this method to a method descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMethod} Method descriptor + */ +Method.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, + "requestType" , this.requestType, + "requestStream" , this.requestStream, + "responseType" , this.responseType, + "responseStream" , this.responseStream, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Method.prototype.resolve = function resolve() { + + /* istanbul ignore if */ + if (this.resolved) + return this; + + this.resolvedRequestType = this.parent.lookupType(this.requestType); + this.resolvedResponseType = this.parent.lookupType(this.responseType); + + return ReflectionObject.prototype.resolve.call(this); +}; + +},{"22":22,"33":33}],21:[function(require,module,exports){ +"use strict"; +module.exports = Namespace; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; + +var Field = require(15), + util = require(33); + +var Type, // cyclic + Service, + Enum; + +/** + * Constructs a new namespace instance. + * @name Namespace + * @classdesc Reflected namespace. + * @extends NamespaceBase + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a namespace from JSON. + * @memberof Namespace + * @function + * @param {string} name Namespace name + * @param {Object.} json JSON object + * @returns {Namespace} Created namespace + * @throws {TypeError} If arguments are invalid + */ +Namespace.fromJSON = function fromJSON(name, json) { + return new Namespace(name, json.options).addJSON(json.nested); +}; + +/** + * Converts an array of reflection objects to JSON. + * @memberof Namespace + * @param {ReflectionObject[]} array Object array + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {Object.|undefined} JSON object or `undefined` when array is empty + */ +function arrayToJSON(array, toJSONOptions) { + if (!(array && array.length)) + return undefined; + var obj = {}; + for (var i = 0; i < array.length; ++i) + obj[array[i].name] = array[i].toJSON(toJSONOptions); + return obj; +} + +Namespace.arrayToJSON = arrayToJSON; + +/** + * Tests if the specified id is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedId = function isReservedId(reserved, id) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] >= id) + return true; + return false; +}; + +/** + * Tests if the specified name is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedName = function isReservedName(reserved, name) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (reserved[i] === name) + return true; + return false; +}; + +/** + * Not an actual constructor. Use {@link Namespace} instead. + * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. + * @exports NamespaceBase + * @extends ReflectionObject + * @abstract + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + * @see {@link Namespace} + */ +function Namespace(name, options) { + ReflectionObject.call(this, name, options); + + /** + * Nested objects by name. + * @type {Object.|undefined} + */ + this.nested = undefined; // toJSON + + /** + * Cached nested objects as an array. + * @type {ReflectionObject[]|null} + * @private + */ + this._nestedArray = null; +} + +function clearCache(namespace) { + namespace._nestedArray = null; + return namespace; +} + +/** + * Nested objects of this namespace as an array for iteration. + * @name NamespaceBase#nestedArray + * @type {ReflectionObject[]} + * @readonly + */ +Object.defineProperty(Namespace.prototype, "nestedArray", { + get: function() { + return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); + } +}); + +/** + * Namespace descriptor. + * @interface INamespace + * @property {Object.} [options] Namespace options + * @property {Object.} [nested] Nested object descriptors + */ + +/** + * Any extension field descriptor. + * @typedef AnyExtensionField + * @type {IExtensionField|IExtensionMapField} + */ + +/** + * Any nested object descriptor. + * @typedef AnyNestedObject + * @type {IEnum|IType|IService|AnyExtensionField|INamespace} + */ +// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place) + +/** + * Converts this namespace to a namespace descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {INamespace} Namespace descriptor + */ +Namespace.prototype.toJSON = function toJSON(toJSONOptions) { + return util.toObject([ + "options" , this.options, + "nested" , arrayToJSON(this.nestedArray, toJSONOptions) + ]); +}; + +/** + * Adds nested objects to this namespace from nested object descriptors. + * @param {Object.} nestedJson Any nested object descriptors + * @returns {Namespace} `this` + */ +Namespace.prototype.addJSON = function addJSON(nestedJson) { + var ns = this; + /* istanbul ignore else */ + if (nestedJson) { + for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { + nested = nestedJson[names[i]]; + ns.add( // most to least likely + ( nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : nested.id !== undefined + ? Field.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + } + return this; +}; + +/** + * Gets the nested object of the specified name. + * @param {string} name Nested object name + * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist + */ +Namespace.prototype.get = function get(name) { + return this.nested && this.nested[name] + || null; +}; + +/** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param {string} name Nested enum name + * @returns {Object.} Enum values + * @throws {Error} If there is no such enum + */ +Namespace.prototype.getEnum = function getEnum(name) { + if (this.nested && this.nested[name] instanceof Enum) + return this.nested[name].values; + throw Error("no such enum: " + name); +}; + +/** + * Adds a nested object to this namespace. + * @param {ReflectionObject} object Nested object to add + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ +Namespace.prototype.add = function add(object) { + + if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace)) + throw TypeError("object must be a valid nested object"); + + if (!this.nested) + this.nested = {}; + else { + var prev = this.get(object.name); + if (prev) { + if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { + // replace plain namespace but keep existing nested elements and options + var nested = prev.nestedArray; + for (var i = 0; i < nested.length; ++i) + object.add(nested[i]); + this.remove(prev); + if (!this.nested) + this.nested = {}; + object.setOptions(prev.options, true); + + } else + throw Error("duplicate name '" + object.name + "' in " + this); + } + } + this.nested[object.name] = object; + object.onAdd(this); + return clearCache(this); +}; + +/** + * Removes a nested object from this namespace. + * @param {ReflectionObject} object Nested object to remove + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ +Namespace.prototype.remove = function remove(object) { + + if (!(object instanceof ReflectionObject)) + throw TypeError("object must be a ReflectionObject"); + if (object.parent !== this) + throw Error(object + " is not a member of " + this); + + delete this.nested[object.name]; + if (!Object.keys(this.nested).length) + this.nested = undefined; + + object.onRemove(this); + return clearCache(this); +}; + +/** + * Defines additial namespaces within this one if not yet existing. + * @param {string|string[]} path Path to create + * @param {*} [json] Nested types to create from JSON + * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty + */ +Namespace.prototype.define = function define(path, json) { + + if (util.isString(path)) + path = path.split("."); + else if (!Array.isArray(path)) + throw TypeError("illegal path"); + if (path && path.length && path[0] === "") + throw Error("path must be relative"); + + var ptr = this; + while (path.length > 0) { + var part = path.shift(); + if (ptr.nested && ptr.nested[part]) { + ptr = ptr.nested[part]; + if (!(ptr instanceof Namespace)) + throw Error("path conflicts with non-namespace objects"); + } else + ptr.add(ptr = new Namespace(part)); + } + if (json) + ptr.addJSON(json); + return ptr; +}; + +/** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns {Namespace} `this` + */ +Namespace.prototype.resolveAll = function resolveAll() { + var nested = this.nestedArray, i = 0; + while (i < nested.length) + if (nested[i] instanceof Namespace) + nested[i++].resolveAll(); + else + nested[i++].resolve(); + return this.resolve(); +}; + +/** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param {string|string[]} path Path to look up + * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + */ +Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { + + /* istanbul ignore next */ + if (typeof filterTypes === "boolean") { + parentAlreadyChecked = filterTypes; + filterTypes = undefined; + } else if (filterTypes && !Array.isArray(filterTypes)) + filterTypes = [ filterTypes ]; + + if (util.isString(path) && path.length) { + if (path === ".") + return this.root; + path = path.split("."); + } else if (!path.length) + return this; + + // Start at root if path is absolute + if (path[0] === "") + return this.root.lookup(path.slice(1), filterTypes); + + // Test if the first part matches any nested object, and if so, traverse if path contains more + var found = this.get(path[0]); + if (found) { + if (path.length === 1) { + if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) + return found; + } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) + return found; + + // Otherwise try each nested namespace + } else + for (var i = 0; i < this.nestedArray.length; ++i) + if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) + return found; + + // If there hasn't been a match, try again at the parent + if (this.parent === null || parentAlreadyChecked) + return null; + return this.parent.lookup(path, filterTypes); +}; + +/** + * Looks up the reflection object at the specified path, relative to this namespace. + * @name NamespaceBase#lookup + * @function + * @param {string|string[]} path Path to look up + * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + * @variation 2 + */ +// lookup(path: string, [parentAlreadyChecked: boolean]) + +/** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type + * @throws {Error} If `path` does not point to a type + */ +Namespace.prototype.lookupType = function lookupType(path) { + var found = this.lookup(path, [ Type ]); + if (!found) + throw Error("no such type: " + path); + return found; +}; + +/** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Enum} Looked up enum + * @throws {Error} If `path` does not point to an enum + */ +Namespace.prototype.lookupEnum = function lookupEnum(path) { + var found = this.lookup(path, [ Enum ]); + if (!found) + throw Error("no such Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ +Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { + var found = this.lookup(path, [ Type, Enum ]); + if (!found) + throw Error("no such Type or Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Service} Looked up service + * @throws {Error} If `path` does not point to a service + */ +Namespace.prototype.lookupService = function lookupService(path) { + var found = this.lookup(path, [ Service ]); + if (!found) + throw Error("no such Service '" + path + "' in " + this); + return found; +}; + +// Sets up cyclic dependencies (called in index-light) +Namespace._configure = function(Type_, Service_, Enum_) { + Type = Type_; + Service = Service_; + Enum = Enum_; +}; + +},{"15":15,"22":22,"33":33}],22:[function(require,module,exports){ +"use strict"; +module.exports = ReflectionObject; + +ReflectionObject.className = "ReflectionObject"; + +var util = require(33); + +var Root; // cyclic + +/** + * Constructs a new reflection object instance. + * @classdesc Base class of all reflection objects. + * @constructor + * @param {string} name Object name + * @param {Object.} [options] Declared options + * @abstract + */ +function ReflectionObject(name, options) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (options && !util.isObject(options)) + throw TypeError("options must be an object"); + + /** + * Options. + * @type {Object.|undefined} + */ + this.options = options; // toJSON + + /** + * Unique name within its namespace. + * @type {string} + */ + this.name = name; + + /** + * Parent namespace. + * @type {Namespace|null} + */ + this.parent = null; + + /** + * Whether already resolved or not. + * @type {boolean} + */ + this.resolved = false; + + /** + * Comment text, if any. + * @type {string|null} + */ + this.comment = null; + + /** + * Defining file name. + * @type {string|null} + */ + this.filename = null; +} + +Object.defineProperties(ReflectionObject.prototype, { + + /** + * Reference to the root namespace. + * @name ReflectionObject#root + * @type {Root} + * @readonly + */ + root: { + get: function() { + var ptr = this; + while (ptr.parent !== null) + ptr = ptr.parent; + return ptr; + } + }, + + /** + * Full name including leading dot. + * @name ReflectionObject#fullName + * @type {string} + * @readonly + */ + fullName: { + get: function() { + var path = [ this.name ], + ptr = this.parent; + while (ptr) { + path.unshift(ptr.name); + ptr = ptr.parent; + } + return path.join("."); + } + } +}); + +/** + * Converts this reflection object to its descriptor representation. + * @returns {Object.} Descriptor + * @abstract + */ +ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { + throw Error(); // not implemented, shouldn't happen +}; + +/** + * Called when this object is added to a parent. + * @param {ReflectionObject} parent Parent added to + * @returns {undefined} + */ +ReflectionObject.prototype.onAdd = function onAdd(parent) { + if (this.parent && this.parent !== parent) + this.parent.remove(this); + this.parent = parent; + this.resolved = false; + var root = parent.root; + if (root instanceof Root) + root._handleAdd(this); +}; + +/** + * Called when this object is removed from a parent. + * @param {ReflectionObject} parent Parent removed from + * @returns {undefined} + */ +ReflectionObject.prototype.onRemove = function onRemove(parent) { + var root = parent.root; + if (root instanceof Root) + root._handleRemove(this); + this.parent = null; + this.resolved = false; +}; + +/** + * Resolves this objects type references. + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.resolve = function resolve() { + if (this.resolved) + return this; + if (this.root instanceof Root) + this.resolved = true; // only if part of a root + return this; +}; + +/** + * Gets an option value. + * @param {string} name Option name + * @returns {*} Option value or `undefined` if not set + */ +ReflectionObject.prototype.getOption = function getOption(name) { + if (this.options) + return this.options[name]; + return undefined; +}; + +/** + * Sets an option. + * @param {string} name Option name + * @param {*} value Option value + * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { + if (!ifNotSet || !this.options || this.options[name] === undefined) + (this.options || (this.options = {}))[name] = value; + return this; +}; + +/** + * Sets multiple options. + * @param {Object.} options Options to set + * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { + if (options) + for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) + this.setOption(keys[i], options[keys[i]], ifNotSet); + return this; +}; + +/** + * Converts this instance to its string representation. + * @returns {string} Class name[, space, full name] + */ +ReflectionObject.prototype.toString = function toString() { + var className = this.constructor.className, + fullName = this.fullName; + if (fullName.length) + return className + " " + fullName; + return className; +}; + +// Sets up cyclic dependencies (called in index-light) +ReflectionObject._configure = function(Root_) { + Root = Root_; +}; + +},{"33":33}],23:[function(require,module,exports){ +"use strict"; +module.exports = OneOf; + +// extends ReflectionObject +var ReflectionObject = require(22); +((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; + +var Field = require(15), + util = require(33); + +/** + * Constructs a new oneof instance. + * @classdesc Reflected oneof. + * @extends ReflectionObject + * @constructor + * @param {string} name Oneof name + * @param {string[]|Object.} [fieldNames] Field names + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function OneOf(name, fieldNames, options, comment) { + if (!Array.isArray(fieldNames)) { + options = fieldNames; + fieldNames = undefined; + } + ReflectionObject.call(this, name, options); + + /* istanbul ignore if */ + if (!(fieldNames === undefined || Array.isArray(fieldNames))) + throw TypeError("fieldNames must be an Array"); + + /** + * Field names that belong to this oneof. + * @type {string[]} + */ + this.oneof = fieldNames || []; // toJSON, marker + + /** + * Fields that belong to this oneof as an array for iteration. + * @type {Field[]} + * @readonly + */ + this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Oneof descriptor. + * @interface IOneOf + * @property {Array.} oneof Oneof field names + * @property {Object.} [options] Oneof options + */ + +/** + * Constructs a oneof from a oneof descriptor. + * @param {string} name Oneof name + * @param {IOneOf} json Oneof descriptor + * @returns {OneOf} Created oneof + * @throws {TypeError} If arguments are invalid + */ +OneOf.fromJSON = function fromJSON(name, json) { + return new OneOf(name, json.oneof, json.options, json.comment); +}; + +/** + * Converts this oneof to a oneof descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IOneOf} Oneof descriptor + */ +OneOf.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "oneof" , this.oneof, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Adds the fields of the specified oneof to the parent if not already done so. + * @param {OneOf} oneof The oneof + * @returns {undefined} + * @inner + * @ignore + */ +function addFieldsToParent(oneof) { + if (oneof.parent) + for (var i = 0; i < oneof.fieldsArray.length; ++i) + if (!oneof.fieldsArray[i].parent) + oneof.parent.add(oneof.fieldsArray[i]); +} + +/** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param {Field} field Field to add + * @returns {OneOf} `this` + */ +OneOf.prototype.add = function add(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + if (field.parent && field.parent !== this.parent) + field.parent.remove(field); + this.oneof.push(field.name); + this.fieldsArray.push(field); + field.partOf = this; // field.parent remains null + addFieldsToParent(this); + return this; +}; + +/** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param {Field} field Field to remove + * @returns {OneOf} `this` + */ +OneOf.prototype.remove = function remove(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + var index = this.fieldsArray.indexOf(field); + + /* istanbul ignore if */ + if (index < 0) + throw Error(field + " is not a member of " + this); + + this.fieldsArray.splice(index, 1); + index = this.oneof.indexOf(field.name); + + /* istanbul ignore else */ + if (index > -1) // theoretical + this.oneof.splice(index, 1); + + field.partOf = null; + return this; +}; + +/** + * @override + */ +OneOf.prototype.onAdd = function onAdd(parent) { + ReflectionObject.prototype.onAdd.call(this, parent); + var self = this; + // Collect present fields + for (var i = 0; i < this.oneof.length; ++i) { + var field = parent.get(this.oneof[i]); + if (field && !field.partOf) { + field.partOf = self; + self.fieldsArray.push(field); + } + } + // Add not yet present fields + addFieldsToParent(this); +}; + +/** + * @override + */ +OneOf.prototype.onRemove = function onRemove(parent) { + for (var i = 0, field; i < this.fieldsArray.length; ++i) + if ((field = this.fieldsArray[i]).parent) + field.parent.remove(field); + ReflectionObject.prototype.onRemove.call(this, parent); +}; + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @typedef OneOfDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} oneofName OneOf name + * @returns {undefined} + */ + +/** + * OneOf decorator (TypeScript). + * @function + * @param {...string} fieldNames Field names + * @returns {OneOfDecorator} Decorator function + * @template T extends string + */ +OneOf.d = function decorateOneOf() { + var fieldNames = new Array(arguments.length), + index = 0; + while (index < arguments.length) + fieldNames[index] = arguments[index++]; + return function oneOfDecorator(prototype, oneofName) { + util.decorateType(prototype.constructor) + .add(new OneOf(oneofName, fieldNames)); + Object.defineProperty(prototype, oneofName, { + get: util.oneOfGetter(fieldNames), + set: util.oneOfSetter(fieldNames) + }); + }; +}; + +},{"15":15,"22":22,"33":33}],24:[function(require,module,exports){ +"use strict"; +module.exports = Reader; + +var util = require(35); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; + +},{"35":35}],25:[function(require,module,exports){ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require(24); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require(35); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +/* istanbul ignore else */ +if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + +},{"24":24,"35":35}],26:[function(require,module,exports){ +"use strict"; +module.exports = Root; + +// extends Namespace +var Namespace = require(21); +((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; + +var Field = require(15), + Enum = require(14), + OneOf = require(23), + util = require(33); + +var Type, // cyclic + parse, // might be excluded + common; // " + +/** + * Constructs a new root namespace instance. + * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. + * @extends NamespaceBase + * @constructor + * @param {Object.} [options] Top level options + */ +function Root(options) { + Namespace.call(this, "", options); + + /** + * Deferred extension fields. + * @type {Field[]} + */ + this.deferred = []; + + /** + * Resolved file names of loaded files. + * @type {string[]} + */ + this.files = []; +} + +/** + * Loads a namespace descriptor into a root namespace. + * @param {INamespace} json Nameespace descriptor + * @param {Root} [root] Root namespace, defaults to create a new one if omitted + * @returns {Root} Root namespace + */ +Root.fromJSON = function fromJSON(json, root) { + if (!root) + root = new Root(); + if (json.options) + root.setOptions(json.options); + return root.addJSON(json.nested); +}; + +/** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @function + * @param {string} origin The file name of the importing file + * @param {string} target The file name being imported + * @returns {string|null} Resolved path to `target` or `null` to skip the file + */ +Root.prototype.resolvePath = util.path.resolve; + +// A symbol-like function to safely signal synchronous loading +/* istanbul ignore next */ +function SYNC() {} // eslint-disable-line no-empty-function + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} options Parse options + * @param {LoadCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.load = function load(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + var self = this; + if (!callback) + return util.asPromise(load, self, filename, options); + + var sync = callback === SYNC; // undocumented + + // Finishes loading by calling the callback (exactly once) + function finish(err, root) { + /* istanbul ignore if */ + if (!callback) + return; + var cb = callback; + callback = null; + if (sync) + throw err; + cb(err, root); + } + + // Processes a single file + function process(filename, source) { + try { + if (util.isString(source) && source.charAt(0) === "{") + source = JSON.parse(source); + if (!util.isString(source)) + self.setOptions(source.options).addJSON(source.nested); + else { + parse.filename = filename; + var parsed = parse(source, self, options), + resolved, + i = 0; + if (parsed.imports) + for (; i < parsed.imports.length; ++i) + if (resolved = self.resolvePath(filename, parsed.imports[i])) + fetch(resolved); + if (parsed.weakImports) + for (i = 0; i < parsed.weakImports.length; ++i) + if (resolved = self.resolvePath(filename, parsed.weakImports[i])) + fetch(resolved, true); + } + } catch (err) { + finish(err); + } + if (!sync && !queued) + finish(null, self); // only once anyway + } + + // Fetches a single file + function fetch(filename, weak) { + + // Strip path if this file references a bundled definition + var idx = filename.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = filename.substring(idx); + if (altname in common) + filename = altname; + } + + // Skip if already loaded / attempted + if (self.files.indexOf(filename) > -1) + return; + self.files.push(filename); + + // Shortcut bundled definitions + if (filename in common) { + if (sync) + process(filename, common[filename]); + else { + ++queued; + setTimeout(function() { + --queued; + process(filename, common[filename]); + }); + } + return; + } + + // Otherwise fetch from disk or network + if (sync) { + var source; + try { + source = util.fs.readFileSync(filename).toString("utf8"); + } catch (err) { + if (!weak) + finish(err); + return; + } + process(filename, source); + } else { + ++queued; + util.fetch(filename, function(err, source) { + --queued; + /* istanbul ignore if */ + if (!callback) + return; // terminated meanwhile + if (err) { + /* istanbul ignore else */ + if (!weak) + finish(err); + else if (!queued) // can't be covered reliably + finish(null, self); + return; + } + process(filename, source); + }); + } + } + var queued = 0; + + // Assembling the root namespace doesn't require working type + // references anymore, so we can load everything in parallel + if (util.isString(filename)) + filename = [ filename ]; + for (var i = 0, resolved; i < filename.length; ++i) + if (resolved = self.resolvePath("", filename[i])) + fetch(resolved); + + if (sync) + return self; + if (!queued) + finish(null, self); + return undefined; +}; +// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Promise} Promise + * @variation 3 + */ +// function load(filename:string, [options:IParseOptions]):Promise + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @function Root#loadSync + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ +Root.prototype.loadSync = function loadSync(filename, options) { + if (!util.isNode) + throw Error("not supported"); + return this.load(filename, options, SYNC); +}; + +/** + * @override + */ +Root.prototype.resolveAll = function resolveAll() { + if (this.deferred.length) + throw Error("unresolvable extensions: " + this.deferred.map(function(field) { + return "'extend " + field.extend + "' in " + field.parent.fullName; + }).join(", ")); + return Namespace.prototype.resolveAll.call(this); +}; + +// only uppercased (and thus conflict-free) children are exposed, see below +var exposeRe = /^[A-Z]/; + +/** + * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. + * @param {Root} root Root instance + * @param {Field} field Declaring extension field witin the declaring type + * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise + * @inner + * @ignore + */ +function tryHandleExtension(root, field) { + var extendedType = field.parent.lookup(field.extend); + if (extendedType) { + var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); + sisterField.declaringField = field; + field.extensionField = sisterField; + extendedType.add(sisterField); + return true; + } + return false; +} + +/** + * Called when any object is added to this root or its sub-namespaces. + * @param {ReflectionObject} object Object added + * @returns {undefined} + * @private + */ +Root.prototype._handleAdd = function _handleAdd(object) { + if (object instanceof Field) { + + if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) + if (!tryHandleExtension(this, object)) + this.deferred.push(object); + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + object.parent[object.name] = object.values; // expose enum values as property of its parent + + } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { + + if (object instanceof Type) // Try to handle any deferred extensions + for (var i = 0; i < this.deferred.length;) + if (tryHandleExtension(this, this.deferred[i])) + this.deferred.splice(i, 1); + else + ++i; + for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace + this._handleAdd(object._nestedArray[j]); + if (exposeRe.test(object.name)) + object.parent[object.name] = object; // expose namespace as property of its parent + } + + // The above also adds uppercased (and thus conflict-free) nested types, services and enums as + // properties of namespaces just like static code does. This allows using a .d.ts generated for + // a static module with reflection-based solutions where the condition is met. +}; + +/** + * Called when any object is removed from this root or its sub-namespaces. + * @param {ReflectionObject} object Object removed + * @returns {undefined} + * @private + */ +Root.prototype._handleRemove = function _handleRemove(object) { + if (object instanceof Field) { + + if (/* an extension field */ object.extend !== undefined) { + if (/* already handled */ object.extensionField) { // remove its sister field + object.extensionField.parent.remove(object.extensionField); + object.extensionField = null; + } else { // cancel the extension + var index = this.deferred.indexOf(object); + /* istanbul ignore else */ + if (index > -1) + this.deferred.splice(index, 1); + } + } + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose enum values + + } else if (object instanceof Namespace) { + + for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace + this._handleRemove(object._nestedArray[i]); + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose namespaces + + } +}; + +// Sets up cyclic dependencies (called in index-light) +Root._configure = function(Type_, parse_, common_) { + Type = Type_; + parse = parse_; + common = common_; +}; + +},{"14":14,"15":15,"21":21,"23":23,"33":33}],27:[function(require,module,exports){ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ + +},{}],28:[function(require,module,exports){ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require(29); + +},{"29":29}],29:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +var util = require(35); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; + +},{"35":35}],30:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +// extends Namespace +var Namespace = require(21); +((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; + +var Method = require(20), + util = require(33), + rpc = require(28); + +/** + * Constructs a new service instance. + * @classdesc Reflected service. + * @extends NamespaceBase + * @constructor + * @param {string} name Service name + * @param {Object.} [options] Service options + * @throws {TypeError} If arguments are invalid + */ +function Service(name, options) { + Namespace.call(this, name, options); + + /** + * Service methods. + * @type {Object.} + */ + this.methods = {}; // toJSON, marker + + /** + * Cached methods as an array. + * @type {Method[]|null} + * @private + */ + this._methodsArray = null; +} + +/** + * Service descriptor. + * @interface IService + * @extends INamespace + * @property {Object.} methods Method descriptors + */ + +/** + * Constructs a service from a service descriptor. + * @param {string} name Service name + * @param {IService} json Service descriptor + * @returns {Service} Created service + * @throws {TypeError} If arguments are invalid + */ +Service.fromJSON = function fromJSON(name, json) { + var service = new Service(name, json.options); + /* istanbul ignore else */ + if (json.methods) + for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) + service.add(Method.fromJSON(names[i], json.methods[names[i]])); + if (json.nested) + service.addJSON(json.nested); + service.comment = json.comment; + return service; +}; + +/** + * Converts this service to a service descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IService} Service descriptor + */ +Service.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Methods of this service as an array for iteration. + * @name Service#methodsArray + * @type {Method[]} + * @readonly + */ +Object.defineProperty(Service.prototype, "methodsArray", { + get: function() { + return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); + } +}); + +function clearCache(service) { + service._methodsArray = null; + return service; +} + +/** + * @override + */ +Service.prototype.get = function get(name) { + return this.methods[name] + || Namespace.prototype.get.call(this, name); +}; + +/** + * @override + */ +Service.prototype.resolveAll = function resolveAll() { + var methods = this.methodsArray; + for (var i = 0; i < methods.length; ++i) + methods[i].resolve(); + return Namespace.prototype.resolve.call(this); +}; + +/** + * @override + */ +Service.prototype.add = function add(object) { + + /* istanbul ignore if */ + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Method) { + this.methods[object.name] = object; + object.parent = this; + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * @override + */ +Service.prototype.remove = function remove(object) { + if (object instanceof Method) { + + /* istanbul ignore if */ + if (this.methods[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.methods[object.name]; + object.parent = null; + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Creates a runtime service using the specified rpc implementation. + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. + */ +Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); + for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { + var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); + rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ + m: method, + q: method.resolvedRequestType.ctor, + s: method.resolvedResponseType.ctor + }); + } + return rpcService; +}; + +},{"20":20,"21":21,"28":28,"33":33}],31:[function(require,module,exports){ +"use strict"; +module.exports = Type; + +// extends Namespace +var Namespace = require(21); +((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; + +var Enum = require(14), + OneOf = require(23), + Field = require(15), + MapField = require(18), + Service = require(30), + Message = require(19), + Reader = require(24), + Writer = require(38), + util = require(33), + encoder = require(13), + decoder = require(12), + verifier = require(36), + converter = require(11), + wrappers = require(37); + +/** + * Constructs a new reflected message type instance. + * @classdesc Reflected message type. + * @extends NamespaceBase + * @constructor + * @param {string} name Message name + * @param {Object.} [options] Declared options + */ +function Type(name, options) { + Namespace.call(this, name, options); + + /** + * Message fields. + * @type {Object.} + */ + this.fields = {}; // toJSON, marker + + /** + * Oneofs declared within this namespace, if any. + * @type {Object.} + */ + this.oneofs = undefined; // toJSON + + /** + * Extension ranges, if any. + * @type {number[][]} + */ + this.extensions = undefined; // toJSON + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + /*? + * Whether this type is a legacy group. + * @type {boolean|undefined} + */ + this.group = undefined; // toJSON + + /** + * Cached fields by id. + * @type {Object.|null} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields as an array. + * @type {Field[]|null} + * @private + */ + this._fieldsArray = null; + + /** + * Cached oneofs as an array. + * @type {OneOf[]|null} + * @private + */ + this._oneofsArray = null; + + /** + * Cached constructor. + * @type {Constructor<{}>} + * @private + */ + this._ctor = null; +} + +Object.defineProperties(Type.prototype, { + + /** + * Message fields by id. + * @name Type#fieldsById + * @type {Object.} + * @readonly + */ + fieldsById: { + get: function() { + + /* istanbul ignore if */ + if (this._fieldsById) + return this._fieldsById; + + this._fieldsById = {}; + for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { + var field = this.fields[names[i]], + id = field.id; + + /* istanbul ignore if */ + if (this._fieldsById[id]) + throw Error("duplicate id " + id + " in " + this); + + this._fieldsById[id] = field; + } + return this._fieldsById; + } + }, + + /** + * Fields of this message as an array for iteration. + * @name Type#fieldsArray + * @type {Field[]} + * @readonly + */ + fieldsArray: { + get: function() { + return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); + } + }, + + /** + * Oneofs of this message as an array for iteration. + * @name Type#oneofsArray + * @type {OneOf[]} + * @readonly + */ + oneofsArray: { + get: function() { + return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); + } + }, + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + * @name Type#ctor + * @type {Constructor<{}>} + */ + ctor: { + get: function() { + return this._ctor || (this.ctor = Type.generateConstructor(this)()); + }, + set: function(ctor) { + + // Ensure proper prototype + var prototype = ctor.prototype; + if (!(prototype instanceof Message)) { + (ctor.prototype = new Message()).constructor = ctor; + util.merge(ctor.prototype, prototype); + } + + // Classes and messages reference their reflected type + ctor.$type = ctor.prototype.$type = this; + + // Mix in static methods + util.merge(ctor, Message, true); + + this._ctor = ctor; + + // Messages have non-enumerable default values on their prototype + var i = 0; + for (; i < /* initializes */ this.fieldsArray.length; ++i) + this._fieldsArray[i].resolve(); // ensures a proper value + + // Messages have non-enumerable getters and setters for each virtual oneof field + var ctorProperties = {}; + for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) + ctorProperties[this._oneofsArray[i].resolve().name] = { + get: util.oneOfGetter(this._oneofsArray[i].oneof), + set: util.oneOfSetter(this._oneofsArray[i].oneof) + }; + if (i) + Object.defineProperties(ctor.prototype, ctorProperties); + } + } +}); + +/** + * Generates a constructor function for the specified type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +Type.generateConstructor = function generateConstructor(mtype) { + /* eslint-disable no-unexpected-multiline */ + var gen = util.codegen(["p"], mtype.name); + // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype + for (var i = 0, field; i < mtype.fieldsArray.length; ++i) + if ((field = mtype._fieldsArray[i]).map) gen + ("this%s={}", util.safeProp(field.name)); + else if (field.repeated) gen + ("this%s=[]", util.safeProp(field.name)); + return gen + ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors + * @property {Object.} fields Field descriptors + * @property {number[][]} [extensions] Extension ranges + * @property {number[][]} [reserved] Reserved ranges + * @property {boolean} [group=false] Whether a legacy group or not + */ + +/** + * Creates a message type from a message type descriptor. + * @param {string} name Message name + * @param {IType} json Message type descriptor + * @returns {Type} Created message type + */ +Type.fromJSON = function fromJSON(name, json) { + var type = new Type(name, json.options); + type.extensions = json.extensions; + type.reserved = json.reserved; + var names = Object.keys(json.fields), + i = 0; + for (; i < names.length; ++i) + type.add( + ( typeof json.fields[names[i]].keyType !== "undefined" + ? MapField.fromJSON + : Field.fromJSON )(names[i], json.fields[names[i]]) + ); + if (json.oneofs) + for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) + type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); + if (json.nested) + for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { + var nested = json.nested[names[i]]; + type.add( // most to least likely + ( nested.id !== undefined + ? Field.fromJSON + : nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + if (json.extensions && json.extensions.length) + type.extensions = json.extensions; + if (json.reserved && json.reserved.length) + type.reserved = json.reserved; + if (json.group) + type.group = true; + if (json.comment) + type.comment = json.comment; + return type; +}; + +/** + * Converts this message type to a message type descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IType} Message type descriptor + */ +Type.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), + "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, + "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "group" , this.group || undefined, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Type.prototype.resolveAll = function resolveAll() { + var fields = this.fieldsArray, i = 0; + while (i < fields.length) + fields[i++].resolve(); + var oneofs = this.oneofsArray; i = 0; + while (i < oneofs.length) + oneofs[i++].resolve(); + return Namespace.prototype.resolveAll.call(this); +}; + +/** + * @override + */ +Type.prototype.get = function get(name) { + return this.fields[name] + || this.oneofs && this.oneofs[name] + || this.nested && this.nested[name] + || null; +}; + +/** + * Adds a nested object to this type. + * @param {ReflectionObject} object Nested object to add + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ +Type.prototype.add = function add(object) { + + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Field && object.extend === undefined) { + // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. + // The root object takes care of adding distinct sister-fields to the respective extended + // type instead. + + // avoids calling the getter if not absolutely necessary because it's called quite frequently + if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) + throw Error("duplicate id " + object.id + " in " + this); + if (this.isReservedId(object.id)) + throw Error("id " + object.id + " is reserved in " + this); + if (this.isReservedName(object.name)) + throw Error("name '" + object.name + "' is reserved in " + this); + + if (object.parent) + object.parent.remove(object); + this.fields[object.name] = object; + object.message = this; + object.onAdd(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs) + this.oneofs = {}; + this.oneofs[object.name] = object; + object.onAdd(this); + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * Removes a nested object from this type. + * @param {ReflectionObject} object Nested object to remove + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ +Type.prototype.remove = function remove(object) { + if (object instanceof Field && object.extend === undefined) { + // See Type#add for the reason why extension fields are excluded here. + + /* istanbul ignore if */ + if (!this.fields || this.fields[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.fields[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + if (object instanceof OneOf) { + + /* istanbul ignore if */ + if (!this.oneofs || this.oneofs[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.oneofs[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message<{}>} Message instance + */ +Type.prototype.create = function create(properties) { + return new this.ctor(properties); +}; + +/** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns {Type} `this` + */ +Type.prototype.setup = function setup() { + // Sets up everything at once so that the prototype chain does not have to be re-evaluated + // multiple times (V8, soft-deopt prototype-check). + + var fullName = this.fullName, + types = []; + for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) + types.push(this._fieldsArray[i].resolve().resolvedType); + + // Replace setup methods with type-specific generated functions + this.encode = encoder(this)({ + Writer : Writer, + types : types, + util : util + }); + this.decode = decoder(this)({ + Reader : Reader, + types : types, + util : util + }); + this.verify = verifier(this)({ + types : types, + util : util + }); + this.fromObject = converter.fromObject(this)({ + types : types, + util : util + }); + this.toObject = converter.toObject(this)({ + types : types, + util : util + }); + + // Inject custom wrappers for common types + var wrapper = wrappers[fullName]; + if (wrapper) { + var originalThis = Object.create(this); + // if (wrapper.fromObject) { + originalThis.fromObject = this.fromObject; + this.fromObject = wrapper.fromObject.bind(originalThis); + // } + // if (wrapper.toObject) { + originalThis.toObject = this.toObject; + this.toObject = wrapper.toObject.bind(originalThis); + // } + } + + return this; +}; + +/** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encode = function encode_setup(message, writer) { + return this.setup().encode(message, writer); // overrides this method +}; + +/** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); +}; + +/** + * Decodes a message of this type. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Length of the message, if known beforehand + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ +Type.prototype.decode = function decode_setup(reader, length) { + return this.setup().decode(reader, length); // overrides this method +}; + +/** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ +Type.prototype.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof Reader)) + reader = Reader.create(reader); + return this.decode(reader, reader.uint32()); +}; + +/** + * Verifies that field values are valid and that required fields are present. + * @param {Object.} message Plain object to verify + * @returns {null|string} `null` if valid, otherwise the reason why it is not + */ +Type.prototype.verify = function verify_setup(message) { + return this.setup().verify(message); // overrides this method +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object to convert + * @returns {Message<{}>} Message instance + */ +Type.prototype.fromObject = function fromObject(object) { + return this.setup().fromObject(object); +}; + +/** + * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. + * @interface IConversionOptions + * @property {Function} [longs] Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + * @property {Function} [enums] Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + * @property {Function} [bytes] Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + * @property {boolean} [defaults=false] Also sets default values on the resulting object + * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` + * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` + * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any + * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings + */ + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ +Type.prototype.toObject = function toObject(message, options) { + return this.setup().toObject(message, options); +}; + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @typedef TypeDecorator + * @type {function} + * @param {Constructor} target Target constructor + * @returns {undefined} + * @template T extends Message + */ + +/** + * Type decorator (TypeScript). + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {TypeDecorator} Decorator function + * @template T extends Message + */ +Type.d = function decorateType(typeName) { + return function typeDecorator(target) { + util.decorateType(target, typeName); + }; +}; + +},{"11":11,"12":12,"13":13,"14":14,"15":15,"18":18,"19":19,"21":21,"23":23,"24":24,"30":30,"33":33,"36":36,"37":37,"38":38}],32:[function(require,module,exports){ +"use strict"; + +/** + * Common type constants. + * @namespace + */ +var types = exports; + +var util = require(33); + +var s = [ + "double", // 0 + "float", // 1 + "int32", // 2 + "uint32", // 3 + "sint32", // 4 + "fixed32", // 5 + "sfixed32", // 6 + "int64", // 7 + "uint64", // 8 + "sint64", // 9 + "fixed64", // 10 + "sfixed64", // 11 + "bool", // 12 + "string", // 13 + "bytes" // 14 +]; + +function bake(values, offset) { + var i = 0, o = {}; + offset |= 0; + while (i < values.length) o[s[i + offset]] = values[i++]; + return o; +} + +/** + * Basic type wire types. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + * @property {number} bytes=2 Ldelim wire type + */ +types.basic = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2, + /* bytes */ 2 +]); + +/** + * Basic type defaults. + * @type {Object.} + * @const + * @property {number} double=0 Double default + * @property {number} float=0 Float default + * @property {number} int32=0 Int32 default + * @property {number} uint32=0 Uint32 default + * @property {number} sint32=0 Sint32 default + * @property {number} fixed32=0 Fixed32 default + * @property {number} sfixed32=0 Sfixed32 default + * @property {number} int64=0 Int64 default + * @property {number} uint64=0 Uint64 default + * @property {number} sint64=0 Sint32 default + * @property {number} fixed64=0 Fixed64 default + * @property {number} sfixed64=0 Sfixed64 default + * @property {boolean} bool=false Bool default + * @property {string} string="" String default + * @property {Array.} bytes=Array(0) Bytes default + * @property {null} message=null Message default + */ +types.defaults = bake([ + /* double */ 0, + /* float */ 0, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 0, + /* sfixed32 */ 0, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 0, + /* sfixed64 */ 0, + /* bool */ false, + /* string */ "", + /* bytes */ util.emptyArray, + /* message */ null +]); + +/** + * Basic long type wire types. + * @type {Object.} + * @const + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + */ +types.long = bake([ + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1 +], 7); + +/** + * Allowed types for map keys with their associated wire type. + * @type {Object.} + * @const + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + */ +types.mapKey = bake([ + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2 +], 2); + +/** + * Allowed types for packed repeated fields with their associated wire type. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + */ +types.packed = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0 +]); + +},{"33":33}],33:[function(require,module,exports){ +"use strict"; + +/** + * Various utility functions. + * @namespace + */ +var util = module.exports = require(35); + +var roots = require(27); + +var Type, // cyclic + Enum; + +util.codegen = require(3); +util.fetch = require(5); +util.path = require(8); + +/** + * Node's fs module if available. + * @type {Object.} + */ +util.fs = util.inquire("fs"); + +/** + * Converts an object's values to an array. + * @param {Object.} object Object to convert + * @returns {Array.<*>} Converted array + */ +util.toArray = function toArray(object) { + if (object) { + var keys = Object.keys(object), + array = new Array(keys.length), + index = 0; + while (index < keys.length) + array[index] = object[keys[index++]]; + return array; + } + return []; +}; + +/** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param {Array.<*>} array Array to convert + * @returns {Object.} Converted object + */ +util.toObject = function toObject(array) { + var object = {}, + index = 0; + while (index < array.length) { + var key = array[index++], + val = array[index++]; + if (val !== undefined) + object[key] = val; + } + return object; +}; + +var safePropBackslashRe = /\\/g, + safePropQuoteRe = /"/g; + +/** + * Tests whether the specified name is a reserved word in JS. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +util.isReserved = function isReserved(name) { + return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); +}; + +/** + * Returns a safe property accessor for the specified property name. + * @param {string} prop Property name + * @returns {string} Safe accessor + */ +util.safeProp = function safeProp(prop) { + if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) + return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; + return "." + prop; +}; + +/** + * Converts the first character of a string to upper case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.ucFirst = function ucFirst(str) { + return str.charAt(0).toUpperCase() + str.substring(1); +}; + +var camelCaseRe = /_([a-z])/g; + +/** + * Converts a string to camel case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.camelCase = function camelCase(str) { + return str.substring(0, 1) + + str.substring(1) + .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); +}; + +/** + * Compares reflected fields by id. + * @param {Field} a First field + * @param {Field} b Second field + * @returns {number} Comparison value + */ +util.compareFieldsById = function compareFieldsById(a, b) { + return a.id - b.id; +}; + +/** + * Decorator helper for types (TypeScript). + * @param {Constructor} ctor Constructor function + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {Type} Reflected type + * @template T extends Message + * @property {Root} root Decorators root + */ +util.decorateType = function decorateType(ctor, typeName) { + + /* istanbul ignore if */ + if (ctor.$type) { + if (typeName && ctor.$type.name !== typeName) { + util.decorateRoot.remove(ctor.$type); + ctor.$type.name = typeName; + util.decorateRoot.add(ctor.$type); + } + return ctor.$type; + } + + /* istanbul ignore next */ + if (!Type) + Type = require(31); + + var type = new Type(typeName || ctor.name); + util.decorateRoot.add(type); + type.ctor = ctor; // sets up .encode, .decode etc. + Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); + Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); + return type; +}; + +var decorateEnumIndex = 0; + +/** + * Decorator helper for enums (TypeScript). + * @param {Object} object Enum object + * @returns {Enum} Reflected enum + */ +util.decorateEnum = function decorateEnum(object) { + + /* istanbul ignore if */ + if (object.$type) + return object.$type; + + /* istanbul ignore next */ + if (!Enum) + Enum = require(14); + + var enm = new Enum("Enum" + decorateEnumIndex++, object); + util.decorateRoot.add(enm); + Object.defineProperty(object, "$type", { value: enm, enumerable: false }); + return enm; +}; + +/** + * Decorator root (TypeScript). + * @name util.decorateRoot + * @type {Root} + * @readonly + */ +Object.defineProperty(util, "decorateRoot", { + get: function() { + return roots["decorated"] || (roots["decorated"] = new (require(26))()); + } +}); + +},{"14":14,"26":26,"27":27,"3":3,"31":31,"35":35,"5":5,"8":8}],34:[function(require,module,exports){ +"use strict"; +module.exports = LongBits; + +var util = require(35); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; + +},{"35":35}],35:[function(require,module,exports){ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require(1); + +// converts to / from base64 encoded strings +util.base64 = require(2); + +// base class of rpc.Service +util.EventEmitter = require(4); + +// float handling accross browsers +util.float = require(6); + +// requires modules optionally and hides the call from bundlers +util.inquire = require(7); + +// converts to / from utf8 encoded strings +util.utf8 = require(10); + +// provides a node-like buffer pool in the browser +util.pool = require(9); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require(34); + +// global object reference +util.global = typeof window !== "undefined" && window + || typeof global !== "undefined" && global + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + * @const + */ +util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ + +/** + * Long.js's Long class if available. + * @type {Constructor} + */ +util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long"); + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; + +},{"1":1,"10":10,"2":2,"34":34,"4":4,"6":6,"7":7,"9":9}],36:[function(require,module,exports){ +"use strict"; +module.exports = verifier; + +var Enum = require(14), + util = require(33); + +function invalid(field, expected) { + return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; +} + +/** + * Generates a partial value verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyValue(gen, field, fieldIndex, ref) { + /* eslint-disable no-unexpected-multiline */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref) + ("default:") + ("return%j", invalid(field, "enum value")); + for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen + ("case %i:", field.resolvedType.values[keys[j]]); + gen + ("break") + ("}"); + } else { + gen + ("{") + ("var e=types[%i].verify(%s);", fieldIndex, ref) + ("if(e)") + ("return%j+e", field.name + ".") + ("}"); + } + } else { + switch (field.type) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.isInteger(%s))", ref) + ("return%j", invalid(field, "integer")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) + ("return%j", invalid(field, "integer|Long")); + break; + case "float": + case "double": gen + ("if(typeof %s!==\"number\")", ref) + ("return%j", invalid(field, "number")); + break; + case "bool": gen + ("if(typeof %s!==\"boolean\")", ref) + ("return%j", invalid(field, "boolean")); + break; + case "string": gen + ("if(!util.isString(%s))", ref) + ("return%j", invalid(field, "string")); + break; + case "bytes": gen + ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) + ("return%j", invalid(field, "buffer")); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a partial key verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyKey(gen, field, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.keyType) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.key32Re.test(%s))", ref) + ("return%j", invalid(field, "integer key")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not + ("return%j", invalid(field, "integer|Long key")); + break; + case "bool": gen + ("if(!util.key2Re.test(%s))", ref) + ("return%j", invalid(field, "boolean key")); + break; + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a verifier specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function verifier(mtype) { + /* eslint-disable no-unexpected-multiline */ + + var gen = util.codegen(["m"], mtype.name + "$verify") + ("if(typeof m!==\"object\"||m===null)") + ("return%j", "object expected"); + var oneofs = mtype.oneofsArray, + seenFirstField = {}; + if (oneofs.length) gen + ("var p={}"); + + for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + ref = "m" + util.safeProp(field.name); + + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null + + // map fields + if (field.map) { gen + ("if(!util.isObject(%s))", ref) + ("return%j", invalid(field, "object")) + ("var k=Object.keys(%s)", ref) + ("for(var i=0;i} + * @const + */ +var wrappers = exports; + +var Message = require(19); + +/** + * From object converter part of an {@link IWrapper}. + * @typedef WrapperFromObjectConverter + * @type {function} + * @param {Object.} object Plain object + * @returns {Message<{}>} Message instance + * @this Type + */ + +/** + * To object converter part of an {@link IWrapper}. + * @typedef WrapperToObjectConverter + * @type {function} + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @this Type + */ + +/** + * Common type wrapper part of {@link wrappers}. + * @interface IWrapper + * @property {WrapperFromObjectConverter} [fromObject] From object converter + * @property {WrapperToObjectConverter} [toObject] To object converter + */ + +// Custom wrapper for Any +wrappers[".google.protobuf.Any"] = { + + fromObject: function(object) { + + // unwrap value type if mapped + if (object && object["@type"]) { + var type = this.lookup(object["@type"]); + /* istanbul ignore else */ + if (type) { + // type_url does not accept leading "." + var type_url = object["@type"].charAt(0) === "." ? + object["@type"].substr(1) : object["@type"]; + // type_url prefix is optional, but path seperator is required + return this.create({ + type_url: "/" + type_url, + value: type.encode(type.fromObject(object)).finish() + }); + } + } + + return this.fromObject(object); + }, + + toObject: function(message, options) { + + // decode value if requested and unmapped + if (options && options.json && message.type_url && message.value) { + // Only use fully qualified type name after the last '/' + var name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) + message = type.decode(message.value); + } + + // wrap value if unmapped + if (!(message instanceof this.ctor) && message instanceof Message) { + var object = message.$type.toObject(message, options); + object["@type"] = message.$type.fullName; + return object; + } + + return this.toObject(message, options); + } +}; + +},{"19":19}],38:[function(require,module,exports){ +"use strict"; +module.exports = Writer; + +var util = require(35); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; +}; + +},{"35":35}],39:[function(require,module,exports){ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require(38); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require(35); + +var Buffer = util.Buffer; + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ +BufferWriter.alloc = function alloc_buffer(size) { + return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size); +}; + +var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else + buf.utf8Write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + +},{"35":35,"38":38}]},{},[16]) + +})(); +//# sourceMappingURL=protobuf.js.map diff --git a/node_modules/protobufjs/dist/light/protobuf.js.map b/node_modules/protobufjs/dist/light/protobuf.js.map new file mode 100644 index 0000000..d8b0ebc --- /dev/null +++ b/node_modules/protobufjs/dist/light/protobuf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light","../src/index-minimal.js","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3cA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function prelude(modules, cache, entries) {\r\n\r\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\r\n // sources through a conflict-free require shim and is again wrapped within an iife that\r\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\r\n // so that minification can remove the directives of each module.\r\n\r\n function $require(name) {\r\n var $module = cache[name];\r\n if (!$module)\r\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\r\n return $module.exports;\r\n }\r\n\r\n var protobuf = $require(entries[0]);\r\n\r\n // Expose globally\r\n protobuf.util.global.protobuf = protobuf;\r\n\r\n // Be nice to AMD\r\n if (typeof define === \"function\" && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long && Long.isLong) {\r\n protobuf.util.Long = Long;\r\n protobuf.configure();\r\n }\r\n return protobuf;\r\n });\r\n\r\n // Be nice to CommonJS\r\n if (typeof module === \"object\" && module && module.exports)\r\n module.exports = protobuf;\r\n\r\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\n/**\r\n * Runtime message from/to plain object converters.\r\n * @namespace\r\n */\r\nvar converter = exports;\r\n\r\nvar Enum = require(14),\r\n util = require(33);\r\n\r\n/**\r\n * Generates a partial value fromObject conveter.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {number} fieldIndex Field index\r\n * @param {string} prop Property reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n if (field.resolvedType) {\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(d%s){\", prop);\r\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\r\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\r\n (\"default:\");\r\n gen\r\n (\"case%j:\", keys[i])\r\n (\"case %i:\", values[keys[i]])\r\n (\"m%s=%j\", prop, values[keys[i]])\r\n (\"break\");\r\n } gen\r\n (\"}\");\r\n } else gen\r\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\r\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\r\n (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\r\n } else {\r\n var isUnsigned = false;\r\n switch (field.type) {\r\n case \"double\":\r\n case \"float\": gen\r\n (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\r\n break;\r\n case \"uint32\":\r\n case \"fixed32\": gen\r\n (\"m%s=d%s>>>0\", prop, prop);\r\n break;\r\n case \"int32\":\r\n case \"sint32\":\r\n case \"sfixed32\": gen\r\n (\"m%s=d%s|0\", prop, prop);\r\n break;\r\n case \"uint64\":\r\n isUnsigned = true;\r\n // eslint-disable-line no-fallthrough\r\n case \"int64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(util.Long)\")\r\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\r\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\r\n (\"m%s=parseInt(d%s,10)\", prop, prop)\r\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\r\n (\"m%s=d%s\", prop, prop)\r\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\r\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\r\n break;\r\n case \"bytes\": gen\r\n (\"if(typeof d%s===\\\"string\\\")\", prop)\r\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\r\n (\"else if(d%s.length)\", prop)\r\n (\"m%s=d%s\", prop, prop);\r\n break;\r\n case \"string\": gen\r\n (\"m%s=String(d%s)\", prop, prop);\r\n break;\r\n case \"bool\": gen\r\n (\"m%s=Boolean(d%s)\", prop, prop);\r\n break;\r\n /* default: gen\r\n (\"m%s=d%s\", prop, prop);\r\n break; */\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a plain object to runtime message converter specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nconverter.fromObject = function fromObject(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var fields = mtype.fieldsArray;\r\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\r\n (\"if(d instanceof this.ctor)\")\r\n (\"return d\");\r\n if (!fields.length) return gen\r\n (\"return new this.ctor\");\r\n gen\r\n (\"var m=new this.ctor\");\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n prop = util.safeProp(field.name);\r\n\r\n // Map fields\r\n if (field.map) { gen\r\n (\"if(d%s){\", prop)\r\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\r\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\r\n (\"m%s={}\", prop)\r\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\r\n break;\r\n case \"bytes\": gen\r\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\r\n break;\r\n default: gen\r\n (\"d%s=m%s\", prop, prop);\r\n break;\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a runtime message to plain object converter specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nconverter.toObject = function toObject(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\r\n if (!fields.length)\r\n return util.codegen()(\"return {}\");\r\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\r\n (\"if(!o)\")\r\n (\"o={}\")\r\n (\"var d={}\");\r\n\r\n var repeatedFields = [],\r\n mapFields = [],\r\n normalFields = [],\r\n i = 0;\r\n for (; i < fields.length; ++i)\r\n if (!fields[i].partOf)\r\n ( fields[i].resolve().repeated ? repeatedFields\r\n : fields[i].map ? mapFields\r\n : normalFields).push(fields[i]);\r\n\r\n if (repeatedFields.length) { gen\r\n (\"if(o.arrays||o.defaults){\");\r\n for (i = 0; i < repeatedFields.length; ++i) gen\r\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\r\n gen\r\n (\"}\");\r\n }\r\n\r\n if (mapFields.length) { gen\r\n (\"if(o.objects||o.defaults){\");\r\n for (i = 0; i < mapFields.length; ++i) gen\r\n (\"d%s={}\", util.safeProp(mapFields[i].name));\r\n gen\r\n (\"}\");\r\n }\r\n\r\n if (normalFields.length) { gen\r\n (\"if(o.defaults){\");\r\n for (i = 0; i < normalFields.length; ++i) {\r\n var field = normalFields[i],\r\n prop = util.safeProp(field.name);\r\n if (field.resolvedType instanceof Enum) gen\r\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\r\n else if (field.long) gen\r\n (\"if(util.Long){\")\r\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\r\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\r\n (\"}else\")\r\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\r\n else if (field.bytes) {\r\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\r\n gen\r\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\r\n (\"else{\")\r\n (\"d%s=%s\", prop, arrayDefault)\r\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\r\n (\"}\");\r\n } else gen\r\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\r\n } gen\r\n (\"}\");\r\n }\r\n var hasKs2 = false;\r\n for (i = 0; i < fields.length; ++i) {\r\n var field = fields[i],\r\n index = mtype._fieldsArray.indexOf(field),\r\n prop = util.safeProp(field.name);\r\n if (field.map) {\r\n if (!hasKs2) { hasKs2 = true; gen\r\n (\"var ks2\");\r\n } gen\r\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\r\n (\"d%s={}\", prop)\r\n (\"for(var j=0;j>>3){\");\r\n\r\n var i = 0;\r\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\r\n var field = mtype._fieldsArray[i].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\r\n ref = \"m\" + util.safeProp(field.name); gen\r\n (\"case %i:\", field.id);\r\n\r\n // Map fields\r\n if (field.map) { gen\r\n (\"r.skip().pos++\") // assumes id 1 + key wireType\r\n (\"if(%s===util.emptyObject)\", ref)\r\n (\"%s={}\", ref)\r\n (\"k=r.%s()\", field.keyType)\r\n (\"r.pos++\"); // assumes id 2 + value wireType\r\n if (types.long[field.keyType] !== undefined) {\r\n if (types.basic[type] === undefined) gen\r\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\r\n else gen\r\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=r.%s()\", ref, type);\r\n } else {\r\n if (types.basic[type] === undefined) gen\r\n (\"%s[k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\r\n else gen\r\n (\"%s[k]=r.%s()\", ref, type);\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) { gen\r\n\r\n (\"if(!(%s&&%s.length))\", ref, ref)\r\n (\"%s=[]\", ref);\r\n\r\n // Packable (always check for forward and backward compatiblity)\r\n if (types.packed[type] !== undefined) gen\r\n (\"if((t&7)===2){\")\r\n (\"var c2=r.uint32()+r.pos\")\r\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0)\r\n : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\r\n}\r\n\r\n/**\r\n * Generates an encoder specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nfunction encoder(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\r\n (\"if(!w)\")\r\n (\"w=Writer.create()\");\r\n\r\n var i, ref;\r\n\r\n // \"when a message is serialized its known fields should be written sequentially by field number\"\r\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\r\n\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n index = mtype._fieldsArray.indexOf(field),\r\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\r\n wireType = types.basic[type];\r\n ref = \"m\" + util.safeProp(field.name);\r\n\r\n // Map fields\r\n if (field.map) {\r\n gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name) // !== undefined && !== null\r\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\r\n if (wireType === undefined) gen\r\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\r\n else gen\r\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\r\n gen\r\n (\"}\")\r\n (\"}\");\r\n\r\n // Repeated fields\r\n } else if (field.repeated) { gen\r\n (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\r\n\r\n // Packed repeated\r\n if (field.packed && types.packed[type] !== undefined) { gen\r\n\r\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\r\n (\"for(var i=0;i<%s.length;++i)\", ref)\r\n (\"w.%s(%s[i])\", type, ref)\r\n (\"w.ldelim()\");\r\n\r\n // Non-packed\r\n } else { gen\r\n\r\n (\"for(var i=0;i<%s.length;++i)\", ref);\r\n if (wireType === undefined)\r\n genTypePartial(gen, field, index, ref + \"[i]\");\r\n else gen\r\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\r\n\r\n } gen\r\n (\"}\");\r\n\r\n // Non-repeated\r\n } else {\r\n if (field.optional) gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j))\", ref, field.name); // !== undefined && !== null\r\n\r\n if (wireType === undefined)\r\n genTypePartial(gen, field, index, ref);\r\n else gen\r\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\r\n\r\n }\r\n }\r\n\r\n return gen\r\n (\"return w\");\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}","\"use strict\";\r\nmodule.exports = Enum;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\r\n\r\nvar Namespace = require(21),\r\n util = require(33);\r\n\r\n/**\r\n * Constructs a new enum instance.\r\n * @classdesc Reflected enum.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {Object.} [values] Enum values as an object, by name\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] The comment for this enum\r\n * @param {Object.} [comments] The value comments for this enum\r\n */\r\nfunction Enum(name, values, options, comment, comments) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n if (values && typeof values !== \"object\")\r\n throw TypeError(\"values must be an object\");\r\n\r\n /**\r\n * Enum values by id.\r\n * @type {Object.}\r\n */\r\n this.valuesById = {};\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = Object.create(this.valuesById); // toJSON, marker\r\n\r\n /**\r\n * Enum comment text.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n\r\n /**\r\n * Value comment texts, if any.\r\n * @type {Object.}\r\n */\r\n this.comments = comments || {};\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {Array.}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\r\n // compatible enum. This is used by pbts to write actual enum definitions that work for\r\n // static and reflection code alike instead of emitting generic object definitions.\r\n\r\n if (values)\r\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\r\n if (typeof values[keys[i]] === \"number\") // use forward entries only\r\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\r\n}\r\n\r\n/**\r\n * Enum descriptor.\r\n * @interface IEnum\r\n * @property {Object.} values Enum values\r\n * @property {Object.} [options] Enum options\r\n */\r\n\r\n/**\r\n * Constructs an enum from an enum descriptor.\r\n * @param {string} name Enum name\r\n * @param {IEnum} json Enum descriptor\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\r\n enm.reserved = json.reserved;\r\n return enm;\r\n};\r\n\r\n/**\r\n * Converts this enum to an enum descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IEnum} Enum descriptor\r\n */\r\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"values\" , this.values,\r\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\r\n \"comment\" , keepComments ? this.comment : undefined,\r\n \"comments\" , keepComments ? this.comments : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @param {string} [comment] Comment, if any\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnum.prototype.add = function add(name, id, comment) {\r\n // utilized by the parser but not by .fromJSON\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n if (!util.isInteger(id))\r\n throw TypeError(\"id must be an integer\");\r\n\r\n if (this.values[name] !== undefined)\r\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\r\n\r\n if (this.isReservedId(id))\r\n throw Error(\"id \" + id + \" is reserved in \" + this);\r\n\r\n if (this.isReservedName(name))\r\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\r\n\r\n if (this.valuesById[id] !== undefined) {\r\n if (!(this.options && this.options.allow_alias))\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n } else\r\n this.valuesById[this.values[name] = id] = name;\r\n\r\n this.comments[name] = comment || null;\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnum.prototype.remove = function remove(name) {\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n var val = this.values[name];\r\n if (val == null)\r\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\r\n\r\n delete this.valuesById[val];\r\n delete this.values[name];\r\n delete this.comments[name];\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nEnum.prototype.isReservedId = function isReservedId(id) {\r\n return Namespace.isReservedId(this.reserved, id);\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nEnum.prototype.isReservedName = function isReservedName(name) {\r\n return Namespace.isReservedName(this.reserved, name);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\r\n\r\nvar Enum = require(14),\r\n types = require(32),\r\n util = require(33);\r\n\r\nvar Type; // cyclic\r\n\r\nvar ruleRe = /^required|optional|repeated$/;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @name Field\r\n * @classdesc Reflected message field.\r\n * @extends FieldBase\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object.} [rule=\"optional\"] Field rule\r\n * @param {string|Object.} [extend] Extended type if different from parent\r\n * @param {Object.} [options] Declared options\r\n */\r\n\r\n/**\r\n * Constructs a field from a field descriptor.\r\n * @param {string} name Field name\r\n * @param {IField} json Field descriptor\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Not an actual constructor. Use {@link Field} instead.\r\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\r\n * @exports FieldBase\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object.} [rule=\"optional\"] Field rule\r\n * @param {string|Object.} [extend] Extended type if different from parent\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction Field(name, id, type, rule, extend, options, comment) {\r\n\r\n if (util.isObject(rule)) {\r\n comment = extend;\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n comment = options;\r\n options = extend;\r\n extend = undefined;\r\n }\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n if (!util.isInteger(id) || id < 0)\r\n throw TypeError(\"id must be a non-negative integer\");\r\n\r\n if (!util.isString(type))\r\n throw TypeError(\"type must be a string\");\r\n\r\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\r\n throw TypeError(\"rule must be a string rule\");\r\n\r\n if (extend !== undefined && !util.isString(extend))\r\n throw TypeError(\"extend must be a string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {Type|null}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {OneOf|null}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field type's default value.\r\n * @type {*}\r\n */\r\n this.typeDefault = null;\r\n\r\n /**\r\n * The field's default value on prototypes.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\r\n\r\n /**\r\n * Whether this field's value is a buffer.\r\n * @type {boolean}\r\n */\r\n this.bytes = type === \"bytes\";\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {Type|Enum|null}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {Field|null}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {Field|null}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {boolean|null}\r\n * @private\r\n */\r\n this._packed = null;\r\n\r\n /**\r\n * Comment for this field.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\nObject.defineProperty(Field.prototype, \"packed\", {\r\n get: function() {\r\n // defaults to packed=true if not explicity set to false\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\") // clear cached before setting\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Field descriptor.\r\n * @interface IField\r\n * @property {string} [rule=\"optional\"] Field rule\r\n * @property {string} type Field type\r\n * @property {number} id Field id\r\n * @property {Object.} [options] Field options\r\n */\r\n\r\n/**\r\n * Extension field descriptor.\r\n * @interface IExtensionField\r\n * @extends IField\r\n * @property {string} extend Extended type\r\n */\r\n\r\n/**\r\n * Converts this field to a field descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IField} Field descriptor\r\n */\r\nField.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\r\n \"type\" , this.type,\r\n \"id\" , this.id,\r\n \"extend\" , this.extend,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nField.prototype.resolve = function resolve() {\r\n\r\n if (this.resolved)\r\n return this;\r\n\r\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\r\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\r\n if (this.resolvedType instanceof Type)\r\n this.typeDefault = null;\r\n else // instanceof Enum\r\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\r\n }\r\n\r\n // use explicitly set default value if present\r\n if (this.options && this.options[\"default\"] != null) {\r\n this.typeDefault = this.options[\"default\"];\r\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\r\n this.typeDefault = this.resolvedType.values[this.typeDefault];\r\n }\r\n\r\n // remove unnecessary options\r\n if (this.options) {\r\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\r\n delete this.options.packed;\r\n if (!Object.keys(this.options).length)\r\n this.options = undefined;\r\n }\r\n\r\n // convert to internal data type if necesssary\r\n if (this.long) {\r\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\r\n\r\n /* istanbul ignore else */\r\n if (Object.freeze)\r\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\r\n\r\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\r\n var buf;\r\n if (util.base64.test(this.typeDefault))\r\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\r\n else\r\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\r\n this.typeDefault = buf;\r\n }\r\n\r\n // take special care of maps and repeated fields\r\n if (this.map)\r\n this.defaultValue = util.emptyObject;\r\n else if (this.repeated)\r\n this.defaultValue = util.emptyArray;\r\n else\r\n this.defaultValue = this.typeDefault;\r\n\r\n // ensure proper value on prototype\r\n if (this.parent instanceof Type)\r\n this.parent.ctor.prototype[this.name] = this.defaultValue;\r\n\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\r\n * @typedef FieldDecorator\r\n * @type {function}\r\n * @param {Object} prototype Target prototype\r\n * @param {string} fieldName Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Field decorator (TypeScript).\r\n * @name Field.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\r\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\r\n * @param {T} [defaultValue] Default value\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\r\n */\r\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\r\n\r\n // submessage: decorate the submessage and use its name as the type\r\n if (typeof fieldType === \"function\")\r\n fieldType = util.decorateType(fieldType).name;\r\n\r\n // enum reference: create a reflected copy of the enum and keep reuseing it\r\n else if (fieldType && typeof fieldType === \"object\")\r\n fieldType = util.decorateEnum(fieldType).name;\r\n\r\n return function fieldDecorator(prototype, fieldName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\r\n };\r\n};\r\n\r\n/**\r\n * Field decorator (TypeScript).\r\n * @name Field.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {Constructor|string} fieldType Field type\r\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends Message\r\n * @variation 2\r\n */\r\n// like Field.d but without a default value\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nField._configure = function configure(Type_) {\r\n Type = Type_;\r\n};\r\n","\"use strict\";\r\nvar protobuf = module.exports = require(17);\r\n\r\nprotobuf.build = \"light\";\r\n\r\n/**\r\n * A node-style callback as used by {@link load} and {@link Root#load}.\r\n * @typedef LoadCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Root} [root] Root, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @see {@link Root#load}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === \"function\") {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @see {@link Root#load}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @see {@link Root#load}\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n * @see {@link Root#loadSync}\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Serialization\r\nprotobuf.encoder = require(13);\r\nprotobuf.decoder = require(12);\r\nprotobuf.verifier = require(36);\r\nprotobuf.converter = require(11);\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(22);\r\nprotobuf.Namespace = require(21);\r\nprotobuf.Root = require(26);\r\nprotobuf.Enum = require(14);\r\nprotobuf.Type = require(31);\r\nprotobuf.Field = require(15);\r\nprotobuf.OneOf = require(23);\r\nprotobuf.MapField = require(18);\r\nprotobuf.Service = require(30);\r\nprotobuf.Method = require(20);\r\n\r\n// Runtime\r\nprotobuf.Message = require(19);\r\nprotobuf.wrappers = require(37);\r\n\r\n// Utility\r\nprotobuf.types = require(32);\r\nprotobuf.util = require(33);\r\n\r\n// Set up possibly cyclic reflection dependencies\r\nprotobuf.ReflectionObject._configure(protobuf.Root);\r\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\r\nprotobuf.Root._configure(protobuf.Type);\r\nprotobuf.Field._configure(protobuf.Type);\r\n","\"use strict\";\r\nvar protobuf = exports;\r\n\r\n/**\r\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\r\n * @name build\r\n * @type {string}\r\n * @const\r\n */\r\nprotobuf.build = \"minimal\";\r\n\r\n// Serialization\r\nprotobuf.Writer = require(38);\r\nprotobuf.BufferWriter = require(39);\r\nprotobuf.Reader = require(24);\r\nprotobuf.BufferReader = require(25);\r\n\r\n// Utility\r\nprotobuf.util = require(35);\r\nprotobuf.rpc = require(28);\r\nprotobuf.roots = require(27);\r\nprotobuf.configure = configure;\r\n\r\n/* istanbul ignore next */\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n protobuf.Reader._configure(protobuf.BufferReader);\r\n protobuf.util._configure();\r\n}\r\n\r\n// Set up buffer utility according to the environment\r\nprotobuf.Writer._configure(protobuf.BufferWriter);\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\n// extends Field\r\nvar Field = require(15);\r\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\r\n\r\nvar types = require(32),\r\n util = require(33);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends FieldBase\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction MapField(name, id, keyType, type, options, comment) {\r\n Field.call(this, name, id, type, undefined, undefined, options, comment);\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(keyType))\r\n throw TypeError(\"keyType must be a string\");\r\n\r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {ReflectionObject|null}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Map field descriptor.\r\n * @interface IMapField\r\n * @extends {IField}\r\n * @property {string} keyType Key type\r\n */\r\n\r\n/**\r\n * Extension map field descriptor.\r\n * @interface IExtensionMapField\r\n * @extends IMapField\r\n * @property {string} extend Extended type\r\n */\r\n\r\n/**\r\n * Constructs a map field from a map field descriptor.\r\n * @param {string} name Field name\r\n * @param {IMapField} json Map field descriptor\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this map field to a map field descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IMapField} Map field descriptor\r\n */\r\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"keyType\" , this.keyType,\r\n \"type\" , this.type,\r\n \"id\" , this.id,\r\n \"extend\" , this.extend,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapField.prototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\r\n if (types.mapKey[this.keyType] === undefined)\r\n throw Error(\"invalid key type: \" + this.keyType);\r\n\r\n return Field.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Map field decorator (TypeScript).\r\n * @name MapField.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\r\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\r\n */\r\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\r\n\r\n // submessage value: decorate the submessage and use its name as the type\r\n if (typeof fieldValueType === \"function\")\r\n fieldValueType = util.decorateType(fieldValueType).name;\r\n\r\n // enum reference value: create a reflected copy of the enum and keep reuseing it\r\n else if (fieldValueType && typeof fieldValueType === \"object\")\r\n fieldValueType = util.decorateEnum(fieldValueType).name;\r\n\r\n return function mapFieldDecorator(prototype, fieldName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\nvar util = require(35);\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * @classdesc Abstract runtime message.\r\n * @constructor\r\n * @param {Properties} [properties] Properties to set\r\n * @template T extends object = object\r\n */\r\nfunction Message(properties) {\r\n // not used internally\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n}\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/*eslint-disable valid-jsdoc*/\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object.} [properties] Properties to set\r\n * @returns {Message} Message instance\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.create = function create(properties) {\r\n return this.$type.create(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {T|Object.} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {T|Object.} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\r\n * @returns {T} Decoded message\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.decode = function decode(reader) {\r\n return this.$type.decode(reader);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\r\n * @returns {T} Decoded message\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(reader) {\r\n return this.$type.decodeDelimited(reader);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Object.} message Plain object to verify\r\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\r\n * @param {Object.} object Plain object\r\n * @returns {T} Message instance\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.fromObject = function fromObject(object) {\r\n return this.$type.fromObject(object);\r\n};\r\n\r\n/**\r\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\r\n * @param {T} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.toObject = function toObject(message, options) {\r\n return this.$type.toObject(message, options);\r\n};\r\n\r\n/**\r\n * Converts this message to JSON.\r\n * @returns {Object.} JSON object\r\n */\r\nMessage.prototype.toJSON = function toJSON() {\r\n return this.$type.toObject(this, util.toJSONOptions);\r\n};\r\n\r\n/*eslint-enable valid-jsdoc*/","\"use strict\";\r\nmodule.exports = Method;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\r\n\r\nvar util = require(33);\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] The comment for this method\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\r\n\r\n /* istanbul ignore next */\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n\r\n /* istanbul ignore if */\r\n if (!(type === undefined || util.isString(type)))\r\n throw TypeError(\"type must be a string\");\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(requestType))\r\n throw TypeError(\"requestType must be a string\");\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(responseType))\r\n throw TypeError(\"responseType must be a string\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {Type|null}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {Type|null}\r\n */\r\n this.resolvedResponseType = null;\r\n\r\n /**\r\n * Comment for this method\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Method descriptor.\r\n * @interface IMethod\r\n * @property {string} [type=\"rpc\"] Method type\r\n * @property {string} requestType Request type\r\n * @property {string} responseType Response type\r\n * @property {boolean} [requestStream=false] Whether requests are streamed\r\n * @property {boolean} [responseStream=false] Whether responses are streamed\r\n * @property {Object.} [options] Method options\r\n */\r\n\r\n/**\r\n * Constructs a method from a method descriptor.\r\n * @param {string} name Method name\r\n * @param {IMethod} json Method descriptor\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this method to a method descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IMethod} Method descriptor\r\n */\r\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\r\n \"requestType\" , this.requestType,\r\n \"requestStream\" , this.requestStream,\r\n \"responseType\" , this.responseType,\r\n \"responseStream\" , this.responseStream,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethod.prototype.resolve = function resolve() {\r\n\r\n /* istanbul ignore if */\r\n if (this.resolved)\r\n return this;\r\n\r\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\r\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\r\n\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\r\n\r\nvar Field = require(15),\r\n util = require(33);\r\n\r\nvar Type, // cyclic\r\n Service,\r\n Enum;\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @name Namespace\r\n * @classdesc Reflected namespace.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object.} [options] Declared options\r\n */\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @memberof Namespace\r\n * @function\r\n * @param {string} name Namespace name\r\n * @param {Object.} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array, toJSONOptions) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {Array.|undefined} reserved Array of reserved ranges and names\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nNamespace.isReservedId = function isReservedId(reserved, id) {\r\n if (reserved)\r\n for (var i = 0; i < reserved.length; ++i)\r\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] >= id)\r\n return true;\r\n return false;\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {Array.|undefined} reserved Array of reserved ranges and names\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nNamespace.isReservedName = function isReservedName(reserved, name) {\r\n if (reserved)\r\n for (var i = 0; i < reserved.length; ++i)\r\n if (reserved[i] === name)\r\n return true;\r\n return false;\r\n};\r\n\r\n/**\r\n * Not an actual constructor. Use {@link Namespace} instead.\r\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\r\n * @exports NamespaceBase\r\n * @extends ReflectionObject\r\n * @abstract\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object.} [options] Declared options\r\n * @see {@link Namespace}\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {ReflectionObject[]|null}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\n/**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name NamespaceBase#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\r\n get: function() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n});\r\n\r\n/**\r\n * Namespace descriptor.\r\n * @interface INamespace\r\n * @property {Object.} [options] Namespace options\r\n * @property {Object.} [nested] Nested object descriptors\r\n */\r\n\r\n/**\r\n * Any extension field descriptor.\r\n * @typedef AnyExtensionField\r\n * @type {IExtensionField|IExtensionMapField}\r\n */\r\n\r\n/**\r\n * Any nested object descriptor.\r\n * @typedef AnyNestedObject\r\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\r\n */\r\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\r\n\r\n/**\r\n * Converts this namespace to a namespace descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {INamespace} Namespace descriptor\r\n */\r\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds nested objects to this namespace from nested object descriptors.\r\n * @param {Object.} nestedJson Any nested object descriptors\r\n * @returns {Namespace} `this`\r\n */\r\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n /* istanbul ignore else */\r\n if (nestedJson) {\r\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\r\n nested = nestedJson[names[i]];\r\n ns.add( // most to least likely\r\n ( nested.fields !== undefined\r\n ? Type.fromJSON\r\n : nested.values !== undefined\r\n ? Enum.fromJSON\r\n : nested.methods !== undefined\r\n ? Service.fromJSON\r\n : nested.id !== undefined\r\n ? Field.fromJSON\r\n : Namespace.fromJSON )(names[i], nested)\r\n );\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespace.prototype.get = function get(name) {\r\n return this.nested && this.nested[name]\r\n || null;\r\n};\r\n\r\n/**\r\n * Gets the values of the nested {@link Enum|enum} of the specified name.\r\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\r\n * @param {string} name Nested enum name\r\n * @returns {Object.} Enum values\r\n * @throws {Error} If there is no such enum\r\n */\r\nNamespace.prototype.getEnum = function getEnum(name) {\r\n if (this.nested && this.nested[name] instanceof Enum)\r\n return this.nested[name].values;\r\n throw Error(\"no such enum: \" + name);\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespace.prototype.add = function add(object) {\r\n\r\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\r\n throw TypeError(\"object must be a valid nested object\");\r\n\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.nestedArray;\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespace.prototype.remove = function remove(object) {\r\n\r\n if (!(object instanceof ReflectionObject))\r\n throw TypeError(\"object must be a ReflectionObject\");\r\n if (object.parent !== this)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespace.prototype.define = function define(path, json) {\r\n\r\n if (util.isString(path))\r\n path = path.split(\".\");\r\n else if (!Array.isArray(path))\r\n throw TypeError(\"illegal path\");\r\n if (path && path.length && path[0] === \"\")\r\n throw Error(\"path must be relative\");\r\n\r\n var ptr = this;\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespace.prototype.resolveAll = function resolveAll() {\r\n var nested = this.nestedArray, i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return this.resolve();\r\n};\r\n\r\n/**\r\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\r\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\r\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\r\n */\r\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\r\n\r\n /* istanbul ignore next */\r\n if (typeof filterTypes === \"boolean\") {\r\n parentAlreadyChecked = filterTypes;\r\n filterTypes = undefined;\r\n } else if (filterTypes && !Array.isArray(filterTypes))\r\n filterTypes = [ filterTypes ];\r\n\r\n if (util.isString(path) && path.length) {\r\n if (path === \".\")\r\n return this.root;\r\n path = path.split(\".\");\r\n } else if (!path.length)\r\n return this;\r\n\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.root.lookup(path.slice(1), filterTypes);\r\n\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found) {\r\n if (path.length === 1) {\r\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\r\n return found;\r\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\r\n return found;\r\n\r\n // Otherwise try each nested namespace\r\n } else\r\n for (var i = 0; i < this.nestedArray.length; ++i)\r\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\r\n return found;\r\n\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path, filterTypes);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @name NamespaceBase#lookup\r\n * @function\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\r\n * @variation 2\r\n */\r\n// lookup(path: string, [parentAlreadyChecked: boolean])\r\n\r\n/**\r\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Type} Looked up type\r\n * @throws {Error} If `path` does not point to a type\r\n */\r\nNamespace.prototype.lookupType = function lookupType(path) {\r\n var found = this.lookup(path, [ Type ]);\r\n if (!found)\r\n throw Error(\"no such type: \" + path);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Enum} Looked up enum\r\n * @throws {Error} If `path` does not point to an enum\r\n */\r\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\r\n var found = this.lookup(path, [ Enum ]);\r\n if (!found)\r\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Type} Looked up type or enum\r\n * @throws {Error} If `path` does not point to a type or enum\r\n */\r\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\r\n var found = this.lookup(path, [ Type, Enum ]);\r\n if (!found)\r\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Service} Looked up service\r\n * @throws {Error} If `path` does not point to a service\r\n */\r\nNamespace.prototype.lookupService = function lookupService(path) {\r\n var found = this.lookup(path, [ Service ]);\r\n if (!found)\r\n throw Error(\"no such Service '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nNamespace._configure = function(Type_, Service_, Enum_) {\r\n Type = Type_;\r\n Service = Service_;\r\n Enum = Enum_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.className = \"ReflectionObject\";\r\n\r\nvar util = require(33);\r\n\r\nvar Root; // cyclic\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object.} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n if (options && !util.isObject(options))\r\n throw TypeError(\"options must be an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {Namespace|null}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n\r\n /**\r\n * Comment text, if any.\r\n * @type {string|null}\r\n */\r\n this.comment = null;\r\n\r\n /**\r\n * Defining file name.\r\n * @type {string|null}\r\n */\r\n this.filename = null;\r\n}\r\n\r\nObject.defineProperties(ReflectionObject.prototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: function() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join(\".\");\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Converts this reflection object to its descriptor representation.\r\n * @returns {Object.} Descriptor\r\n * @abstract\r\n */\r\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObject.prototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.root;\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObject.prototype.onRemove = function onRemove(parent) {\r\n var root = parent.root;\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n if (this.root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObject.prototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\r\n this.setOption(keys[i], options[keys[i]], ifNotSet);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Class name[, space, full name]\r\n */\r\nReflectionObject.prototype.toString = function toString() {\r\n var className = this.constructor.className,\r\n fullName = this.fullName;\r\n if (fullName.length)\r\n return className + \" \" + fullName;\r\n return className;\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nReflectionObject._configure = function(Root_) {\r\n Root = Root_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\r\n\r\nvar Field = require(15),\r\n util = require(33);\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object.} [fieldNames] Field names\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction OneOf(name, fieldNames, options, comment) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n\r\n /* istanbul ignore if */\r\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\r\n throw TypeError(\"fieldNames must be an Array\");\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof as an array for iteration.\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\r\n\r\n /**\r\n * Comment for this field.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Oneof descriptor.\r\n * @interface IOneOf\r\n * @property {Array.} oneof Oneof field names\r\n * @property {Object.} [options] Oneof options\r\n */\r\n\r\n/**\r\n * Constructs a oneof from a oneof descriptor.\r\n * @param {string} name Oneof name\r\n * @param {IOneOf} json Oneof descriptor\r\n * @returns {OneOf} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this oneof to a oneof descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IOneOf} Oneof descriptor\r\n */\r\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"oneof\" , this.oneof,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\r\n if (!oneof.fieldsArray[i].parent)\r\n oneof.parent.add(oneof.fieldsArray[i]);\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof and removes it from its current parent, if any.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOf.prototype.add = function add(field) {\r\n\r\n /* istanbul ignore if */\r\n if (!(field instanceof Field))\r\n throw TypeError(\"field must be a Field\");\r\n\r\n if (field.parent && field.parent !== this.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this.fieldsArray.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof and puts it back to the oneof's parent.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOf.prototype.remove = function remove(field) {\r\n\r\n /* istanbul ignore if */\r\n if (!(field instanceof Field))\r\n throw TypeError(\"field must be a Field\");\r\n\r\n var index = this.fieldsArray.indexOf(field);\r\n\r\n /* istanbul ignore if */\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n\r\n this.fieldsArray.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n\r\n /* istanbul ignore else */\r\n if (index > -1) // theoretical\r\n this.oneof.splice(index, 1);\r\n\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOf.prototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n var self = this;\r\n // Collect present fields\r\n for (var i = 0; i < this.oneof.length; ++i) {\r\n var field = parent.get(this.oneof[i]);\r\n if (field && !field.partOf) {\r\n field.partOf = self;\r\n self.fieldsArray.push(field);\r\n }\r\n }\r\n // Add not yet present fields\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOf.prototype.onRemove = function onRemove(parent) {\r\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\r\n if ((field = this.fieldsArray[i]).parent)\r\n field.parent.remove(field);\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\r\n * @typedef OneOfDecorator\r\n * @type {function}\r\n * @param {Object} prototype Target prototype\r\n * @param {string} oneofName OneOf name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * OneOf decorator (TypeScript).\r\n * @function\r\n * @param {...string} fieldNames Field names\r\n * @returns {OneOfDecorator} Decorator function\r\n * @template T extends string\r\n */\r\nOneOf.d = function decorateOneOf() {\r\n var fieldNames = new Array(arguments.length),\r\n index = 0;\r\n while (index < arguments.length)\r\n fieldNames[index] = arguments[index++];\r\n return function oneOfDecorator(prototype, oneofName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new OneOf(oneofName, fieldNames));\r\n Object.defineProperty(prototype, oneofName, {\r\n get: util.oneOfGetter(fieldNames),\r\n set: util.oneOfSetter(fieldNames)\r\n });\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nvar util = require(35);\r\n\r\nvar BufferReader; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n utf8 = util.utf8;\r\n\r\n/* istanbul ignore next */\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n\r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\nvar create_array = typeof Uint8Array !== \"undefined\"\r\n ? function create_typed_array(buffer) {\r\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n }\r\n /* istanbul ignore next */\r\n : function create_array(buffer) {\r\n if (Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n };\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @function\r\n * @param {Uint8Array|Buffer} buffer Buffer to read from\r\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n * @throws {Error} If `buffer` is not a valid buffer\r\n */\r\nReader.create = util.Buffer\r\n ? function create_buffer_setup(buffer) {\r\n return (Reader.create = function create_buffer(buffer) {\r\n return util.Buffer.isBuffer(buffer)\r\n ? new BufferReader(buffer)\r\n /* istanbul ignore next */\r\n : create_array(buffer);\r\n })(buffer);\r\n }\r\n /* istanbul ignore next */\r\n : create_array;\r\n\r\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.uint32 = (function read_uint32_setup() {\r\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\r\n return function read_uint32() {\r\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n\r\n /* istanbul ignore if */\r\n if ((this.pos += 5) > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this, 10);\r\n }\r\n return value;\r\n };\r\n})();\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.int32 = function read_int32() {\r\n return this.uint32() | 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sint32 = function read_sint32() {\r\n var value = this.uint32();\r\n return value >>> 1 ^ -(value & 1) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n // tends to deopt with local vars for octet etc.\r\n var bits = new LongBits(0, 0);\r\n var i = 0;\r\n if (this.len - this.pos > 4) { // fast route (lo)\r\n for (; i < 4; ++i) {\r\n // 1st..4th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 5th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n i = 0;\r\n } else {\r\n for (; i < 3; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 1st..3th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 4th\r\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\r\n return bits;\r\n }\r\n if (this.len - this.pos > 4) { // fast route (hi)\r\n for (; i < 5; ++i) {\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n } else {\r\n for (; i < 5; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n }\r\n /* istanbul ignore next */\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReader.prototype.bool = function read_bool() {\r\n return this.uint32() !== 0;\r\n};\r\n\r\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\r\n return (buf[end - 4]\r\n | buf[end - 3] << 8\r\n | buf[end - 2] << 16\r\n | buf[end - 1] << 24) >>> 0;\r\n}\r\n\r\n/**\r\n * Reads fixed 32 bits as an unsigned 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.fixed32 = function read_fixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4);\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a signed 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sfixed32 = function read_sfixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readFixed64(/* this: Reader */) {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n\r\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.float = function read_float() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readFloatLE(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.double = function read_double() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readDoubleLE(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReader.prototype.bytes = function read_bytes() {\r\n var length = this.uint32(),\r\n start = this.pos,\r\n end = this.pos + length;\r\n\r\n /* istanbul ignore if */\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n\r\n this.pos += length;\r\n if (Array.isArray(this.buf)) // plain array\r\n return this.buf.slice(start, end);\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReader.prototype.string = function read_string() {\r\n var bytes = this.bytes();\r\n return utf8.read(bytes, 0, bytes.length);\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skip = function skip(length) {\r\n if (typeof length === \"number\") {\r\n /* istanbul ignore if */\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n } else {\r\n do {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n while ((wireType = this.uint32() & 7) !== 4) {\r\n this.skipType(wireType);\r\n }\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n\r\n /* istanbul ignore next */\r\n default:\r\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\r\n }\r\n return this;\r\n};\r\n\r\nReader._configure = function(BufferReader_) {\r\n BufferReader = BufferReader_;\r\n\r\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\r\n util.merge(Reader.prototype, {\r\n\r\n int64: function read_int64() {\r\n return readLongVarint.call(this)[fn](false);\r\n },\r\n\r\n uint64: function read_uint64() {\r\n return readLongVarint.call(this)[fn](true);\r\n },\r\n\r\n sint64: function read_sint64() {\r\n return readLongVarint.call(this).zzDecode()[fn](false);\r\n },\r\n\r\n fixed64: function read_fixed64() {\r\n return readFixed64.call(this)[fn](true);\r\n },\r\n\r\n sfixed64: function read_sfixed64() {\r\n return readFixed64.call(this)[fn](false);\r\n }\r\n\r\n });\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferReader;\r\n\r\n// extends Reader\r\nvar Reader = require(24);\r\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\r\n\r\nvar util = require(35);\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n Reader.call(this, buffer);\r\n\r\n /**\r\n * Read buffer.\r\n * @name BufferReader#buf\r\n * @type {Buffer}\r\n */\r\n}\r\n\r\n/* istanbul ignore else */\r\nif (util.Buffer)\r\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReader.prototype.string = function read_string_buffer() {\r\n var len = this.uint32(); // modifies pos\r\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @name BufferReader#bytes\r\n * @function\r\n * @returns {Buffer} Value read\r\n */\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\n// extends Namespace\r\nvar Namespace = require(21);\r\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\r\n\r\nvar Field = require(15),\r\n Enum = require(14),\r\n OneOf = require(23),\r\n util = require(33);\r\n\r\nvar Type, // cyclic\r\n parse, // might be excluded\r\n common; // \"\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {Object.} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files.\r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a namespace descriptor into a root namespace.\r\n * @param {INamespace} json Nameespace descriptor\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n if (json.options)\r\n root.setOptions(json.options);\r\n return root.addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\r\n */\r\nRoot.prototype.resolvePath = util.path.resolve;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\n/* istanbul ignore next */\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} options Parse options\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nRoot.prototype.load = function load(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = undefined;\r\n }\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename, options);\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n /* istanbul ignore if */\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n if (sync)\r\n throw err;\r\n cb(err, root);\r\n }\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n parse.filename = filename;\r\n var parsed = parse(source, self, options),\r\n resolved,\r\n i = 0;\r\n if (parsed.imports)\r\n for (; i < parsed.imports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\r\n fetch(resolved);\r\n if (parsed.weakImports)\r\n for (i = 0; i < parsed.weakImports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\r\n fetch(resolved, true);\r\n }\r\n } catch (err) {\r\n finish(err);\r\n }\r\n if (!sync && !queued)\r\n finish(null, self); // only once anyway\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.lastIndexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded / attempted\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n /* istanbul ignore if */\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n /* istanbul ignore else */\r\n if (!weak)\r\n finish(err);\r\n else if (!queued) // can't be covered reliably\r\n finish(null, self);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n for (var i = 0, resolved; i < filename.length; ++i)\r\n if (resolved = self.resolvePath(\"\", filename[i]))\r\n fetch(resolved);\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @function Root#load\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @function Root#load\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [options:IParseOptions]):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\r\n * @function Root#loadSync\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRoot.prototype.loadSync = function loadSync(filename, options) {\r\n if (!util.isNode)\r\n throw Error(\"not supported\");\r\n return this.load(filename, options, SYNC);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRoot.prototype.resolveAll = function resolveAll() {\r\n if (this.deferred.length)\r\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\r\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\r\n }).join(\", \"));\r\n return Namespace.prototype.resolveAll.call(this);\r\n};\r\n\r\n// only uppercased (and thus conflict-free) children are exposed, see below\r\nvar exposeRe = /^[A-Z]/;\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Root} root Root instance\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction tryHandleExtension(root, field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRoot.prototype._handleAdd = function _handleAdd(object) {\r\n if (object instanceof Field) {\r\n\r\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\r\n if (!tryHandleExtension(this, object))\r\n this.deferred.push(object);\r\n\r\n } else if (object instanceof Enum) {\r\n\r\n if (exposeRe.test(object.name))\r\n object.parent[object.name] = object.values; // expose enum values as property of its parent\r\n\r\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\r\n\r\n if (object instanceof Type) // Try to handle any deferred extensions\r\n for (var i = 0; i < this.deferred.length;)\r\n if (tryHandleExtension(this, this.deferred[i]))\r\n this.deferred.splice(i, 1);\r\n else\r\n ++i;\r\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\r\n this._handleAdd(object._nestedArray[j]);\r\n if (exposeRe.test(object.name))\r\n object.parent[object.name] = object; // expose namespace as property of its parent\r\n }\r\n\r\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\r\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\r\n // a static module with reflection-based solutions where the condition is met.\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRoot.prototype._handleRemove = function _handleRemove(object) {\r\n if (object instanceof Field) {\r\n\r\n if (/* an extension field */ object.extend !== undefined) {\r\n if (/* already handled */ object.extensionField) { // remove its sister field\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n } else { // cancel the extension\r\n var index = this.deferred.indexOf(object);\r\n /* istanbul ignore else */\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n }\r\n\r\n } else if (object instanceof Enum) {\r\n\r\n if (exposeRe.test(object.name))\r\n delete object.parent[object.name]; // unexpose enum values\r\n\r\n } else if (object instanceof Namespace) {\r\n\r\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\r\n this._handleRemove(object._nestedArray[i]);\r\n\r\n if (exposeRe.test(object.name))\r\n delete object.parent[object.name]; // unexpose namespaces\r\n\r\n }\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nRoot._configure = function(Type_, parse_, common_) {\r\n Type = Type_;\r\n parse = parse_;\r\n common = common_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = {};\r\n\r\n/**\r\n * Named roots.\r\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\r\n * Can also be used manually to make roots available accross modules.\r\n * @name roots\r\n * @type {Object.}\r\n * @example\r\n * // pbjs -r myroot -o compiled.js ...\r\n *\r\n * // in another module:\r\n * require(\"./compiled.js\");\r\n *\r\n * // in any subsequent module:\r\n * var root = protobuf.roots[\"myroot\"];\r\n */\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCImplCallback} callback Callback function\r\n * @returns {undefined}\r\n * @example\r\n * function rpcImpl(method, requestData, callback) {\r\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\r\n * throw Error(\"no such method\");\r\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\r\n * callback(err, responseData);\r\n * });\r\n * }\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCImplCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\nrpc.Service = require(29);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar util = require(35);\r\n\r\n// Extends EventEmitter\r\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\r\n\r\n/**\r\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\r\n *\r\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\r\n * @typedef rpc.ServiceMethodCallback\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {TRes} [response] Response message\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\r\n * @typedef rpc.ServiceMethod\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\r\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\r\n */\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @exports rpc.Service\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n */\r\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\r\n\r\n if (typeof rpcImpl !== \"function\")\r\n throw TypeError(\"rpcImpl must be a function\");\r\n\r\n util.EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` once the service is ended.\r\n * @type {RPCImpl|null}\r\n */\r\n this.rpcImpl = rpcImpl;\r\n\r\n /**\r\n * Whether requests are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.requestDelimited = Boolean(requestDelimited);\r\n\r\n /**\r\n * Whether responses are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.responseDelimited = Boolean(responseDelimited);\r\n}\r\n\r\n/**\r\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\r\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\r\n * @param {Constructor} requestCtor Request constructor\r\n * @param {Constructor} responseCtor Response constructor\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} callback Service callback\r\n * @returns {undefined}\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n */\r\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\r\n\r\n if (!request)\r\n throw TypeError(\"request must be specified\");\r\n\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\r\n\r\n if (!self.rpcImpl) {\r\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\r\n return undefined;\r\n }\r\n\r\n try {\r\n return self.rpcImpl(\r\n method,\r\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\r\n function rpcCallback(err, response) {\r\n\r\n if (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n\r\n if (response === null) {\r\n self.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n\r\n if (!(response instanceof responseCtor)) {\r\n try {\r\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n }\r\n\r\n self.emit(\"data\", response, method);\r\n return callback(null, response);\r\n }\r\n );\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n setTimeout(function() { callback(err); }, 0);\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nService.prototype.end = function end(endedByRPC) {\r\n if (this.rpcImpl) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.rpcImpl(null, null, null);\r\n this.rpcImpl = null;\r\n this.emit(\"end\").off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\n// extends Namespace\r\nvar Namespace = require(21);\r\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\r\n\r\nvar Method = require(20),\r\n util = require(33),\r\n rpc = require(28);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {Method[]|null}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\n/**\r\n * Service descriptor.\r\n * @interface IService\r\n * @extends INamespace\r\n * @property {Object.} methods Method descriptors\r\n */\r\n\r\n/**\r\n * Constructs a service from a service descriptor.\r\n * @param {string} name Service name\r\n * @param {IService} json Service descriptor\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n /* istanbul ignore else */\r\n if (json.methods)\r\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\r\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\r\n if (json.nested)\r\n service.addJSON(json.nested);\r\n service.comment = json.comment;\r\n return service;\r\n};\r\n\r\n/**\r\n * Converts this service to a service descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IService} Service descriptor\r\n */\r\nService.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , inherited && inherited.options || undefined,\r\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\r\n \"nested\" , inherited && inherited.nested || undefined,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\nObject.defineProperty(Service.prototype, \"methodsArray\", {\r\n get: function() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.get = function get(name) {\r\n return this.methods[name]\r\n || Namespace.prototype.get.call(this, name);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.resolveAll = function resolveAll() {\r\n var methods = this.methodsArray;\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return Namespace.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.add = function add(object) {\r\n\r\n /* istanbul ignore if */\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n\r\n /* istanbul ignore if */\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\r\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\r\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\r\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\r\n m: method,\r\n q: method.resolvedRequestType.ctor,\r\n s: method.resolvedResponseType.ctor\r\n });\r\n }\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Type;\r\n\r\n// extends Namespace\r\nvar Namespace = require(21);\r\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\r\n\r\nvar Enum = require(14),\r\n OneOf = require(23),\r\n Field = require(15),\r\n MapField = require(18),\r\n Service = require(30),\r\n Message = require(19),\r\n Reader = require(24),\r\n Writer = require(38),\r\n util = require(33),\r\n encoder = require(13),\r\n decoder = require(12),\r\n verifier = require(36),\r\n converter = require(11),\r\n wrappers = require(37);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object.} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {Array.}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /*?\r\n * Whether this type is a legacy group.\r\n * @type {boolean|undefined}\r\n */\r\n this.group = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {Object.|null}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {Field[]|null}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {OneOf[]|null}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {Constructor<{}>}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nObject.defineProperties(Type.prototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function() {\r\n\r\n /* istanbul ignore if */\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n\r\n this._fieldsById = {};\r\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n\r\n /* istanbul ignore if */\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\r\n * @name Type#ctor\r\n * @type {Constructor<{}>}\r\n */\r\n ctor: {\r\n get: function() {\r\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\r\n },\r\n set: function(ctor) {\r\n\r\n // Ensure proper prototype\r\n var prototype = ctor.prototype;\r\n if (!(prototype instanceof Message)) {\r\n (ctor.prototype = new Message()).constructor = ctor;\r\n util.merge(ctor.prototype, prototype);\r\n }\r\n\r\n // Classes and messages reference their reflected type\r\n ctor.$type = ctor.prototype.$type = this;\r\n\r\n // Mix in static methods\r\n util.merge(ctor, Message, true);\r\n\r\n this._ctor = ctor;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n var i = 0;\r\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\r\n this._fieldsArray[i].resolve(); // ensures a proper value\r\n\r\n // Messages have non-enumerable getters and setters for each virtual oneof field\r\n var ctorProperties = {};\r\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\r\n ctorProperties[this._oneofsArray[i].resolve().name] = {\r\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\r\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\r\n };\r\n if (i)\r\n Object.defineProperties(ctor.prototype, ctorProperties);\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Generates a constructor function for the specified type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nType.generateConstructor = function generateConstructor(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var gen = util.codegen([\"p\"], mtype.name);\r\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\r\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\r\n if ((field = mtype._fieldsArray[i]).map) gen\r\n (\"this%s={}\", util.safeProp(field.name));\r\n else if (field.repeated) gen\r\n (\"this%s=[]\", util.safeProp(field.name));\r\n return gen\r\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\r\n * @property {Object.} fields Field descriptors\r\n * @property {number[][]} [extensions] Extension ranges\r\n * @property {number[][]} [reserved] Reserved ranges\r\n * @property {boolean} [group=false] Whether a legacy group or not\r\n */\r\n\r\n/**\r\n * Creates a message type from a message type descriptor.\r\n * @param {string} name Message name\r\n * @param {IType} json Message type descriptor\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n var names = Object.keys(json.fields),\r\n i = 0;\r\n for (; i < names.length; ++i)\r\n type.add(\r\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\r\n ? MapField.fromJSON\r\n : Field.fromJSON )(names[i], json.fields[names[i]])\r\n );\r\n if (json.oneofs)\r\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\r\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\r\n if (json.nested)\r\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\r\n var nested = json.nested[names[i]];\r\n type.add( // most to least likely\r\n ( nested.id !== undefined\r\n ? Field.fromJSON\r\n : nested.fields !== undefined\r\n ? Type.fromJSON\r\n : nested.values !== undefined\r\n ? Enum.fromJSON\r\n : nested.methods !== undefined\r\n ? Service.fromJSON\r\n : Namespace.fromJSON )(names[i], nested)\r\n );\r\n }\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n if (json.group)\r\n type.group = true;\r\n if (json.comment)\r\n type.comment = json.comment;\r\n return type;\r\n};\r\n\r\n/**\r\n * Converts this message type to a message type descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IType} Message type descriptor\r\n */\r\nType.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , inherited && inherited.options || undefined,\r\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\r\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\r\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\r\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\r\n \"group\" , this.group || undefined,\r\n \"nested\" , inherited && inherited.nested || undefined,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nType.prototype.resolveAll = function resolveAll() {\r\n var fields = this.fieldsArray, i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.oneofsArray; i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return Namespace.prototype.resolveAll.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nType.prototype.get = function get(name) {\r\n return this.fields[name]\r\n || this.oneofs && this.oneofs[name]\r\n || this.nested && this.nested[name]\r\n || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nType.prototype.add = function add(object) {\r\n\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n\r\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\r\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (this.isReservedId(object.id))\r\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\r\n if (this.isReservedName(object.name))\r\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\r\n\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nType.prototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n\r\n /* istanbul ignore if */\r\n if (!this.fields || this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.fields[object.name];\r\n object.parent = null;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n\r\n /* istanbul ignore if */\r\n if (!this.oneofs || this.oneofs[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.oneofs[object.name];\r\n object.parent = null;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nType.prototype.isReservedId = function isReservedId(id) {\r\n return Namespace.isReservedId(this.reserved, id);\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nType.prototype.isReservedName = function isReservedName(name) {\r\n return Namespace.isReservedName(this.reserved, name);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object.} [properties] Properties to set\r\n * @returns {Message<{}>} Message instance\r\n */\r\nType.prototype.create = function create(properties) {\r\n return new this.ctor(properties);\r\n};\r\n\r\n/**\r\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\r\n * @returns {Type} `this`\r\n */\r\nType.prototype.setup = function setup() {\r\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\r\n // multiple times (V8, soft-deopt prototype-check).\r\n\r\n var fullName = this.fullName,\r\n types = [];\r\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\r\n types.push(this._fieldsArray[i].resolve().resolvedType);\r\n\r\n // Replace setup methods with type-specific generated functions\r\n this.encode = encoder(this)({\r\n Writer : Writer,\r\n types : types,\r\n util : util\r\n });\r\n this.decode = decoder(this)({\r\n Reader : Reader,\r\n types : types,\r\n util : util\r\n });\r\n this.verify = verifier(this)({\r\n types : types,\r\n util : util\r\n });\r\n this.fromObject = converter.fromObject(this)({\r\n types : types,\r\n util : util\r\n });\r\n this.toObject = converter.toObject(this)({\r\n types : types,\r\n util : util\r\n });\r\n\r\n // Inject custom wrappers for common types\r\n var wrapper = wrappers[fullName];\r\n if (wrapper) {\r\n var originalThis = Object.create(this);\r\n // if (wrapper.fromObject) {\r\n originalThis.fromObject = this.fromObject;\r\n this.fromObject = wrapper.fromObject.bind(originalThis);\r\n // }\r\n // if (wrapper.toObject) {\r\n originalThis.toObject = this.toObject;\r\n this.toObject = wrapper.toObject.bind(originalThis);\r\n // }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\r\n * @param {Message<{}>|Object.} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nType.prototype.encode = function encode_setup(message, writer) {\r\n return this.setup().encode(message, writer); // overrides this method\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\r\n * @param {Message<{}>|Object.} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message<{}>} Decoded message\r\n * @throws {Error} If the payload is not a reader or valid buffer\r\n * @throws {util.ProtocolError<{}>} If required fields are missing\r\n */\r\nType.prototype.decode = function decode_setup(reader, length) {\r\n return this.setup().decode(reader, length); // overrides this method\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\r\n * @returns {Message<{}>} Decoded message\r\n * @throws {Error} If the payload is not a reader or valid buffer\r\n * @throws {util.ProtocolError} If required fields are missing\r\n */\r\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\r\n if (!(reader instanceof Reader))\r\n reader = Reader.create(reader);\r\n return this.decode(reader, reader.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that field values are valid and that required fields are present.\r\n * @param {Object.} message Plain object to verify\r\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\r\n */\r\nType.prototype.verify = function verify_setup(message) {\r\n return this.setup().verify(message); // overrides this method\r\n};\r\n\r\n/**\r\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\r\n * @param {Object.} object Plain object to convert\r\n * @returns {Message<{}>} Message instance\r\n */\r\nType.prototype.fromObject = function fromObject(object) {\r\n return this.setup().fromObject(object);\r\n};\r\n\r\n/**\r\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\r\n * @interface IConversionOptions\r\n * @property {Function} [longs] Long conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\r\n * @property {Function} [enums] Enum value conversion type.\r\n * Only valid value is `String` (the global type).\r\n * Defaults to copy the present value, which is the numeric id.\r\n * @property {Function} [bytes] Bytes value conversion type.\r\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\r\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\r\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\r\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\r\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\r\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\r\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\r\n */\r\n\r\n/**\r\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\r\n * @param {Message<{}>} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n */\r\nType.prototype.toObject = function toObject(message, options) {\r\n return this.setup().toObject(message, options);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link Type.d} (TypeScript).\r\n * @typedef TypeDecorator\r\n * @type {function}\r\n * @param {Constructor} target Target constructor\r\n * @returns {undefined}\r\n * @template T extends Message\r\n */\r\n\r\n/**\r\n * Type decorator (TypeScript).\r\n * @param {string} [typeName] Type name, defaults to the constructor's name\r\n * @returns {TypeDecorator} Decorator function\r\n * @template T extends Message\r\n */\r\nType.d = function decorateType(typeName) {\r\n return function typeDecorator(target) {\r\n util.decorateType(target, typeName);\r\n };\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(33);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=1 Fixed64 wire type\r\n * @property {number} float=5 Fixed32 wire type\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n * @property {number} string=2 Ldelim wire type\r\n * @property {number} bytes=2 Ldelim wire type\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=0 Double default\r\n * @property {number} float=0 Float default\r\n * @property {number} int32=0 Int32 default\r\n * @property {number} uint32=0 Uint32 default\r\n * @property {number} sint32=0 Sint32 default\r\n * @property {number} fixed32=0 Fixed32 default\r\n * @property {number} sfixed32=0 Sfixed32 default\r\n * @property {number} int64=0 Int64 default\r\n * @property {number} uint64=0 Uint64 default\r\n * @property {number} sint64=0 Sint32 default\r\n * @property {number} fixed64=0 Fixed64 default\r\n * @property {number} sfixed64=0 Sfixed64 default\r\n * @property {boolean} bool=false Bool default\r\n * @property {string} string=\"\" String default\r\n * @property {Array.} bytes=Array(0) Bytes default\r\n * @property {null} message=null Message default\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray,\r\n /* message */ null\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n * @property {number} string=2 Ldelim wire type\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=1 Fixed64 wire type\r\n * @property {number} float=5 Fixed32 wire type\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = module.exports = require(35);\r\n\r\nvar roots = require(27);\r\n\r\nvar Type, // cyclic\r\n Enum;\r\n\r\nutil.codegen = require(3);\r\nutil.fetch = require(5);\r\nutil.path = require(8);\r\n\r\n/**\r\n * Node's fs module if available.\r\n * @type {Object.}\r\n */\r\nutil.fs = util.inquire(\"fs\");\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (object) {\r\n var keys = Object.keys(object),\r\n array = new Array(keys.length),\r\n index = 0;\r\n while (index < keys.length)\r\n array[index] = object[keys[index++]];\r\n return array;\r\n }\r\n return [];\r\n};\r\n\r\n/**\r\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\r\n * @param {Array.<*>} array Array to convert\r\n * @returns {Object.} Converted object\r\n */\r\nutil.toObject = function toObject(array) {\r\n var object = {},\r\n index = 0;\r\n while (index < array.length) {\r\n var key = array[index++],\r\n val = array[index++];\r\n if (val !== undefined)\r\n object[key] = val;\r\n }\r\n return object;\r\n};\r\n\r\nvar safePropBackslashRe = /\\\\/g,\r\n safePropQuoteRe = /\"/g;\r\n\r\n/**\r\n * Tests whether the specified name is a reserved word in JS.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nutil.isReserved = function isReserved(name) {\r\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified property name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\r\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\r\n return \".\" + prop;\r\n};\r\n\r\n/**\r\n * Converts the first character of a string to upper case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.ucFirst = function ucFirst(str) {\r\n return str.charAt(0).toUpperCase() + str.substring(1);\r\n};\r\n\r\nvar camelCaseRe = /_([a-z])/g;\r\n\r\n/**\r\n * Converts a string to camel case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0, 1)\r\n + str.substring(1)\r\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Compares reflected fields by id.\r\n * @param {Field} a First field\r\n * @param {Field} b Second field\r\n * @returns {number} Comparison value\r\n */\r\nutil.compareFieldsById = function compareFieldsById(a, b) {\r\n return a.id - b.id;\r\n};\r\n\r\n/**\r\n * Decorator helper for types (TypeScript).\r\n * @param {Constructor} ctor Constructor function\r\n * @param {string} [typeName] Type name, defaults to the constructor's name\r\n * @returns {Type} Reflected type\r\n * @template T extends Message\r\n * @property {Root} root Decorators root\r\n */\r\nutil.decorateType = function decorateType(ctor, typeName) {\r\n\r\n /* istanbul ignore if */\r\n if (ctor.$type) {\r\n if (typeName && ctor.$type.name !== typeName) {\r\n util.decorateRoot.remove(ctor.$type);\r\n ctor.$type.name = typeName;\r\n util.decorateRoot.add(ctor.$type);\r\n }\r\n return ctor.$type;\r\n }\r\n\r\n /* istanbul ignore next */\r\n if (!Type)\r\n Type = require(31);\r\n\r\n var type = new Type(typeName || ctor.name);\r\n util.decorateRoot.add(type);\r\n type.ctor = ctor; // sets up .encode, .decode etc.\r\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\r\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\r\n return type;\r\n};\r\n\r\nvar decorateEnumIndex = 0;\r\n\r\n/**\r\n * Decorator helper for enums (TypeScript).\r\n * @param {Object} object Enum object\r\n * @returns {Enum} Reflected enum\r\n */\r\nutil.decorateEnum = function decorateEnum(object) {\r\n\r\n /* istanbul ignore if */\r\n if (object.$type)\r\n return object.$type;\r\n\r\n /* istanbul ignore next */\r\n if (!Enum)\r\n Enum = require(14);\r\n\r\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\r\n util.decorateRoot.add(enm);\r\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\r\n return enm;\r\n};\r\n\r\n/**\r\n * Decorator root (TypeScript).\r\n * @name util.decorateRoot\r\n * @type {Root}\r\n * @readonly\r\n */\r\nObject.defineProperty(util, \"decorateRoot\", {\r\n get: function() {\r\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(26))());\r\n }\r\n});\r\n","\"use strict\";\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(35);\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low 32 bits, unsigned\r\n * @param {number} hi High 32 bits, unsigned\r\n */\r\nfunction LongBits(lo, hi) {\r\n\r\n // note that the casts below are theoretically unnecessary as of today, but older statically\r\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo >>> 0;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi >>> 0;\r\n}\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Zero hash.\r\n * @memberof util.LongBits\r\n * @type {string}\r\n */\r\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n if (sign)\r\n value = -value;\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n if (typeof value === \"number\")\r\n return LongBits.fromNumber(value);\r\n if (util.isString(value)) {\r\n /* istanbul ignore else */\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBits.prototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n var lo = ~this.lo + 1 >>> 0,\r\n hi = ~this.hi >>> 0;\r\n if (!lo)\r\n hi = hi + 1 >>> 0;\r\n return -(lo + hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBits.prototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\r\n /* istanbul ignore next */\r\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n if (hash === zeroHash)\r\n return zero;\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBits.prototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 ,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBits.prototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n return part2 === 0\r\n ? part1 === 0\r\n ? part0 < 16384\r\n ? part0 < 128 ? 1 : 2\r\n : part0 < 2097152 ? 3 : 4\r\n : part1 < 16384\r\n ? part1 < 128 ? 5 : 6\r\n : part1 < 2097152 ? 7 : 8\r\n : part2 < 128 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nvar util = exports;\r\n\r\n// used to return a Promise where callback is omitted\r\nutil.asPromise = require(1);\r\n\r\n// converts to / from base64 encoded strings\r\nutil.base64 = require(2);\r\n\r\n// base class of rpc.Service\r\nutil.EventEmitter = require(4);\r\n\r\n// float handling accross browsers\r\nutil.float = require(6);\r\n\r\n// requires modules optionally and hides the call from bundlers\r\nutil.inquire = require(7);\r\n\r\n// converts to / from utf8 encoded strings\r\nutil.utf8 = require(10);\r\n\r\n// provides a node-like buffer pool in the browser\r\nutil.pool = require(9);\r\n\r\n// utility to work with the low and high bits of a 64 bit value\r\nutil.LongBits = require(34);\r\n\r\n// global object reference\r\nutil.global = typeof window !== \"undefined\" && window\r\n || typeof global !== \"undefined\" && global\r\n || typeof self !== \"undefined\" && self\r\n || this; // eslint-disable-line no-invalid-this\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n * @const\r\n */\r\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n * @const\r\n */\r\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n * @const\r\n */\r\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\r\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === \"string\" || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return value && typeof value === \"object\";\r\n};\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * This is an alias of {@link util.isSet}.\r\n * @function\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isset =\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isSet = function isSet(obj, prop) {\r\n var value = obj[prop];\r\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\r\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\r\n return false;\r\n};\r\n\r\n/**\r\n * Any compatible Buffer instance.\r\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\r\n * @interface Buffer\r\n * @extends Uint8Array\r\n */\r\n\r\n/**\r\n * Node's Buffer class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Buffer = (function() {\r\n try {\r\n var Buffer = util.inquire(\"buffer\").Buffer;\r\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\r\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n return null;\r\n }\r\n})();\r\n\r\n// Internal alias of or polyfull for Buffer.from.\r\nutil._Buffer_from = null;\r\n\r\n// Internal alias of or polyfill for Buffer.allocUnsafe.\r\nutil._Buffer_allocUnsafe = null;\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\r\n * @returns {Uint8Array|Buffer} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(sizeOrArray) {\r\n /* istanbul ignore next */\r\n return typeof sizeOrArray === \"number\"\r\n ? util.Buffer\r\n ? util._Buffer_allocUnsafe(sizeOrArray)\r\n : new util.Array(sizeOrArray)\r\n : util.Buffer\r\n ? util._Buffer_from(sizeOrArray)\r\n : typeof Uint8Array === \"undefined\"\r\n ? sizeOrArray\r\n : new Uint8Array(sizeOrArray);\r\n};\r\n\r\n/**\r\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\r\n * @type {Constructor}\r\n */\r\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\r\n * @interface Long\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Long.js's Long class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\r\n || /* istanbul ignore next */ util.global.Long\r\n || util.inquire(\"long\");\r\n\r\n/**\r\n * Regular expression used to verify 2 bit (`bool`) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key2Re = /^true|false|0|1$/;\r\n\r\n/**\r\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\r\n\r\n/**\r\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? util.LongBits.from(value).toHash()\r\n : util.LongBits.zeroHash;\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = util.LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @memberof util\r\n * @param {Object.} dst Destination object\r\n * @param {Object.} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object.} Destination object\r\n */\r\nfunction merge(dst, src, ifNotSet) { // used by converters\r\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n return dst;\r\n}\r\n\r\nutil.merge = merge;\r\n\r\n/**\r\n * Converts the first character of a string to lower case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.lcFirst = function lcFirst(str) {\r\n return str.charAt(0).toLowerCase() + str.substring(1);\r\n};\r\n\r\n/**\r\n * Creates a custom error constructor.\r\n * @memberof util\r\n * @param {string} name Error name\r\n * @returns {Constructor} Custom error constructor\r\n */\r\nfunction newError(name) {\r\n\r\n function CustomError(message, properties) {\r\n\r\n if (!(this instanceof CustomError))\r\n return new CustomError(message, properties);\r\n\r\n // Error.call(this, message);\r\n // ^ just returns a new error instance because the ctor can be called as a function\r\n\r\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\r\n\r\n /* istanbul ignore next */\r\n if (Error.captureStackTrace) // node\r\n Error.captureStackTrace(this, CustomError);\r\n else\r\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\r\n\r\n if (properties)\r\n merge(this, properties);\r\n }\r\n\r\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\r\n\r\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\r\n\r\n CustomError.prototype.toString = function toString() {\r\n return this.name + \": \" + this.message;\r\n };\r\n\r\n return CustomError;\r\n}\r\n\r\nutil.newError = newError;\r\n\r\n/**\r\n * Constructs a new protocol error.\r\n * @classdesc Error subclass indicating a protocol specifc error.\r\n * @memberof util\r\n * @extends Error\r\n * @template T extends Message\r\n * @constructor\r\n * @param {string} message Error message\r\n * @param {Object.} [properties] Additional properties\r\n * @example\r\n * try {\r\n * MyMessage.decode(someBuffer); // throws if required fields are missing\r\n * } catch (e) {\r\n * if (e instanceof ProtocolError && e.instance)\r\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\r\n * }\r\n */\r\nutil.ProtocolError = newError(\"ProtocolError\");\r\n\r\n/**\r\n * So far decoded message instance.\r\n * @name util.ProtocolError#instance\r\n * @type {Message}\r\n */\r\n\r\n/**\r\n * A OneOf getter as returned by {@link util.oneOfGetter}.\r\n * @typedef OneOfGetter\r\n * @type {function}\r\n * @returns {string|undefined} Set field name, if any\r\n */\r\n\r\n/**\r\n * Builds a getter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfGetter} Unbound getter\r\n */\r\nutil.oneOfGetter = function getOneOf(fieldNames) {\r\n var fieldMap = {};\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n fieldMap[fieldNames[i]] = 1;\r\n\r\n /**\r\n * @returns {string|undefined} Set field name, if any\r\n * @this Object\r\n * @ignore\r\n */\r\n return function() { // eslint-disable-line consistent-return\r\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\r\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\r\n return keys[i];\r\n };\r\n};\r\n\r\n/**\r\n * A OneOf setter as returned by {@link util.oneOfSetter}.\r\n * @typedef OneOfSetter\r\n * @type {function}\r\n * @param {string|undefined} value Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Builds a setter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfSetter} Unbound setter\r\n */\r\nutil.oneOfSetter = function setOneOf(fieldNames) {\r\n\r\n /**\r\n * @param {string} name Field name\r\n * @returns {undefined}\r\n * @this Object\r\n * @ignore\r\n */\r\n return function(name) {\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n if (fieldNames[i] !== name)\r\n delete this[fieldNames[i]];\r\n };\r\n};\r\n\r\n/**\r\n * Default conversion options used for {@link Message#toJSON} implementations.\r\n *\r\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\r\n *\r\n * - Longs become strings\r\n * - Enums become string keys\r\n * - Bytes become base64 encoded strings\r\n * - (Sub-)Messages become plain objects\r\n * - Maps become plain objects with all string keys\r\n * - Repeated fields become arrays\r\n * - NaN and Infinity for float and double fields become strings\r\n *\r\n * @type {IConversionOptions}\r\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\r\n */\r\nutil.toJSONOptions = {\r\n longs: String,\r\n enums: String,\r\n bytes: String,\r\n json: true\r\n};\r\n\r\n// Sets up buffer utility according to the environment (called in index-minimal)\r\nutil._configure = function() {\r\n var Buffer = util.Buffer;\r\n /* istanbul ignore if */\r\n if (!Buffer) {\r\n util._Buffer_from = util._Buffer_allocUnsafe = null;\r\n return;\r\n }\r\n // because node 4.x buffers are incompatible & immutable\r\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\r\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\r\n /* istanbul ignore next */\r\n function Buffer_from(value, encoding) {\r\n return new Buffer(value, encoding);\r\n };\r\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\r\n /* istanbul ignore next */\r\n function Buffer_allocUnsafe(size) {\r\n return new Buffer(size);\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = verifier;\r\n\r\nvar Enum = require(14),\r\n util = require(33);\r\n\r\nfunction invalid(field, expected) {\r\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\r\n}\r\n\r\n/**\r\n * Generates a partial value verifier.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {number} fieldIndex Field index\r\n * @param {string} ref Variable reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n if (field.resolvedType) {\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(%s){\", ref)\r\n (\"default:\")\r\n (\"return%j\", invalid(field, \"enum value\"));\r\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\r\n (\"case %i:\", field.resolvedType.values[keys[j]]);\r\n gen\r\n (\"break\")\r\n (\"}\");\r\n } else {\r\n gen\r\n (\"{\")\r\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\r\n (\"if(e)\")\r\n (\"return%j+e\", field.name + \".\")\r\n (\"}\");\r\n }\r\n } else {\r\n switch (field.type) {\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.isInteger(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\r\n (\"return%j\", invalid(field, \"integer|Long\"));\r\n break;\r\n case \"float\":\r\n case \"double\": gen\r\n (\"if(typeof %s!==\\\"number\\\")\", ref)\r\n (\"return%j\", invalid(field, \"number\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\r\n (\"return%j\", invalid(field, \"boolean\"));\r\n break;\r\n case \"string\": gen\r\n (\"if(!util.isString(%s))\", ref)\r\n (\"return%j\", invalid(field, \"string\"));\r\n break;\r\n case \"bytes\": gen\r\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\r\n (\"return%j\", invalid(field, \"buffer\"));\r\n break;\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a partial key verifier.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {string} ref Variable reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genVerifyKey(gen, field, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n switch (field.keyType) {\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.key32Re.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer key\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\r\n (\"return%j\", invalid(field, \"integer|Long key\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(!util.key2Re.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"boolean key\"));\r\n break;\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a verifier specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nfunction verifier(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n\r\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\r\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\r\n (\"return%j\", \"object expected\");\r\n var oneofs = mtype.oneofsArray,\r\n seenFirstField = {};\r\n if (oneofs.length) gen\r\n (\"var p={}\");\r\n\r\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\r\n var field = mtype._fieldsArray[i].resolve(),\r\n ref = \"m\" + util.safeProp(field.name);\r\n\r\n if (field.optional) gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\r\n\r\n // map fields\r\n if (field.map) { gen\r\n (\"if(!util.isObject(%s))\", ref)\r\n (\"return%j\", invalid(field, \"object\"))\r\n (\"var k=Object.keys(%s)\", ref)\r\n (\"for(var i=0;i}\r\n * @const\r\n */\r\nvar wrappers = exports;\r\n\r\nvar Message = require(19);\r\n\r\n/**\r\n * From object converter part of an {@link IWrapper}.\r\n * @typedef WrapperFromObjectConverter\r\n * @type {function}\r\n * @param {Object.} object Plain object\r\n * @returns {Message<{}>} Message instance\r\n * @this Type\r\n */\r\n\r\n/**\r\n * To object converter part of an {@link IWrapper}.\r\n * @typedef WrapperToObjectConverter\r\n * @type {function}\r\n * @param {Message<{}>} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n * @this Type\r\n */\r\n\r\n/**\r\n * Common type wrapper part of {@link wrappers}.\r\n * @interface IWrapper\r\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\r\n * @property {WrapperToObjectConverter} [toObject] To object converter\r\n */\r\n\r\n// Custom wrapper for Any\r\nwrappers[\".google.protobuf.Any\"] = {\r\n\r\n fromObject: function(object) {\r\n\r\n // unwrap value type if mapped\r\n if (object && object[\"@type\"]) {\r\n var type = this.lookup(object[\"@type\"]);\r\n /* istanbul ignore else */\r\n if (type) {\r\n // type_url does not accept leading \".\"\r\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\r\n object[\"@type\"].substr(1) : object[\"@type\"];\r\n // type_url prefix is optional, but path seperator is required\r\n return this.create({\r\n type_url: \"/\" + type_url,\r\n value: type.encode(type.fromObject(object)).finish()\r\n });\r\n }\r\n }\r\n\r\n return this.fromObject(object);\r\n },\r\n\r\n toObject: function(message, options) {\r\n\r\n // decode value if requested and unmapped\r\n if (options && options.json && message.type_url && message.value) {\r\n // Only use fully qualified type name after the last '/'\r\n var name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\r\n var type = this.lookup(name);\r\n /* istanbul ignore else */\r\n if (type)\r\n message = type.decode(message.value);\r\n }\r\n\r\n // wrap value if unmapped\r\n if (!(message instanceof this.ctor) && message instanceof Message) {\r\n var object = message.$type.toObject(message, options);\r\n object[\"@type\"] = message.$type.fullName;\r\n return object;\r\n }\r\n\r\n return this.toObject(message, options);\r\n }\r\n};\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nvar util = require(35);\r\n\r\nvar BufferWriter; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n base64 = util.base64,\r\n utf8 = util.utf8;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @constructor\r\n * @param {function(*, Uint8Array, number)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {*} val Value to write\r\n * @ignore\r\n */\r\nfunction Op(fn, len, val) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {Writer.Op|undefined}\r\n */\r\n this.next = undefined;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val; // type varies\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @ignore\r\n */\r\nfunction State(writer) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {State|null}\r\n */\r\n this.next = writer.states;\r\n}\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {Object|null}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @function\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = util.Buffer\r\n ? function create_buffer_setup() {\r\n return (Writer.create = function create_buffer() {\r\n return new BufferWriter();\r\n })();\r\n }\r\n /* istanbul ignore next */\r\n : function create_array() {\r\n return new Writer();\r\n };\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new util.Array(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\n/* istanbul ignore else */\r\nif (util.Array !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n * @private\r\n */\r\nWriter.prototype._push = function push(fn, len, val) {\r\n this.tail = this.tail.next = new Op(fn, len, val);\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(val, buf, pos) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\nfunction writeVarint32(val, buf, pos) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Constructs a new varint writer operation instance.\r\n * @classdesc Scheduled varint writer operation.\r\n * @extends Op\r\n * @constructor\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @ignore\r\n */\r\nfunction VarintOp(len, val) {\r\n this.len = len;\r\n this.next = undefined;\r\n this.val = val;\r\n}\r\n\r\nVarintOp.prototype = Object.create(Op.prototype);\r\nVarintOp.prototype.fn = writeVarint32;\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.uint32 = function write_uint32(value) {\r\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\r\n // uint32 is by far the most frequently used operation and benefits significantly from this.\r\n this.len += (this.tail = this.tail.next = new VarintOp(\r\n (value = value >>> 0)\r\n < 128 ? 1\r\n : value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5,\r\n value)).len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sint32 = function write_sint32(value) {\r\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\r\n};\r\n\r\nfunction writeVarint64(val, buf, pos) {\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.int64 = Writer.prototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bool = function write_bool(value) {\r\n return this._push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fixed32 = function write_fixed32(value) {\r\n return this._push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as fixed 32 bits.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as fixed 64 bits.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.float = function write_float(value) {\r\n return this._push(util.float.writeFloatLE, 4, value);\r\n};\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.double = function write_double(value) {\r\n return this._push(util.float.writeDoubleLE, 8, value);\r\n};\r\n\r\nvar writeBytes = util.Array.prototype.set\r\n ? function writeBytes_set(val, buf, pos) {\r\n buf.set(val, pos); // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytes_for(val, buf, pos) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (!len)\r\n return this._push(writeByte, 1, 0);\r\n if (util.isString(value)) {\r\n var buf = Writer.alloc(len = base64.length(value));\r\n base64.decode(value, buf, 0);\r\n value = buf;\r\n }\r\n return this.uint32(len)._push(writeBytes, len, value);\r\n};\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.string = function write_string(value) {\r\n var len = utf8.length(value);\r\n return len\r\n ? this.uint32(len)._push(utf8.write, len, value)\r\n : this._push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fork = function fork() {\r\n this.states = new State(this);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.ldelim = function ldelim() {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset().uint32(len);\r\n if (len) {\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriter.prototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len),\r\n pos = 0;\r\n while (head) {\r\n head.fn(head.val, buf, pos);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n // this.head = this.tail = null;\r\n return buf;\r\n};\r\n\r\nWriter._configure = function(BufferWriter_) {\r\n BufferWriter = BufferWriter_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferWriter;\r\n\r\n// extends Writer\r\nvar Writer = require(38);\r\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\r\n\r\nvar util = require(35);\r\n\r\nvar Buffer = util.Buffer;\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Buffer} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\r\n};\r\n\r\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\r\n ? function writeBytesBuffer_set(val, buf, pos) {\r\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\r\n // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytesBuffer_copy(val, buf, pos) {\r\n if (val.copy) // Buffer values\r\n val.copy(buf, pos, 0, val.length);\r\n else for (var i = 0; i < val.length;) // plain array values\r\n buf[pos++] = val[i++];\r\n };\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\r\n if (util.isString(value))\r\n value = util._Buffer_from(value, \"base64\");\r\n var len = value.length >>> 0;\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeBytesBuffer, len, value);\r\n return this;\r\n};\r\n\r\nfunction writeStringBuffer(val, buf, pos) {\r\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\r\n util.utf8.write(val, buf, pos);\r\n else\r\n buf.utf8Write(val, pos);\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.string = function write_string_buffer(value) {\r\n var len = Buffer.byteLength(value);\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeStringBuffer, len, value);\r\n return this;\r\n};\r\n\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @name BufferWriter#finish\r\n * @function\r\n * @returns {Buffer} Finished buffer\r\n */\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/node_modules/protobufjs/dist/light/protobuf.min.js b/node_modules/protobufjs/dist/light/protobuf.min.js new file mode 100644 index 0000000..3a09f75 --- /dev/null +++ b/node_modules/protobufjs/dist/light/protobuf.min.js @@ -0,0 +1,8 @@ +/*! + * protobuf.js v6.8.8 (c) 2016, daniel wirtz + * compiled thu, 19 jul 2018 00:33:26 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +!function(g){"use strict";var r,e,t,i;r={1:[function(t,i){i.exports=function(t,i){var n=Array(arguments.length-1),s=0,r=2,u=!0;for(;r>2],r=(3&f)<<4,o=1;break;case 1:s[u++]=h[r|f>>4],r=(15&f)<<2,o=2;break;case 2:s[u++]=h[r|f>>6],s[u++]=h[63&f],o=0}8191>4,r=o,s=2;break;case 2:i[n++]=(15&r)<<4|(60&o)>>2,r=o,s=3;break;case 3:i[n++]=(3&r)<<6|o,s=0}}if(1===s)throw Error(c);return n-e},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,i){function a(i,n){"string"==typeof i&&(n=i,i=g);var f=[];function h(t){if("string"!=typeof t){var i=c();if(a.verbose&&console.log("codegen: "+i),i="return "+i,t){for(var n=Object.keys(t),r=Array(n.length+1),e=Array(n.length),s=0;s>>0,n,r);else if(i<11754943508222875e-54)t((e<<31|Math.round(i/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(i)/Math.LN2);t((e<<31|s+127<<23|8388607&Math.round(i*Math.pow(2,-s)*8388608))>>>0,n,r)}}function i(t,i,n){var r=t(i,n),e=2*(r>>31)+1,s=r>>>23&255,u=8388607&r;return 255===s?u?NaN:e*(1/0):0===s?1401298464324817e-60*e*u:e*Math.pow(2,s-150)*(u+8388608)}o.writeFloatLE=t.bind(null,r),o.writeFloatBE=t.bind(null,e),o.readFloatLE=i.bind(null,s),o.readFloatBE=i.bind(null,u)}(),"undefined"!=typeof Float64Array?function(){var r=new Float64Array([-0]),e=new Uint8Array(r.buffer),t=128===e[7];function i(t,i,n){r[0]=t,i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2],i[n+3]=e[3],i[n+4]=e[4],i[n+5]=e[5],i[n+6]=e[6],i[n+7]=e[7]}function n(t,i,n){r[0]=t,i[n]=e[7],i[n+1]=e[6],i[n+2]=e[5],i[n+3]=e[4],i[n+4]=e[3],i[n+5]=e[2],i[n+6]=e[1],i[n+7]=e[0]}function s(t,i){return e[0]=t[i],e[1]=t[i+1],e[2]=t[i+2],e[3]=t[i+3],e[4]=t[i+4],e[5]=t[i+5],e[6]=t[i+6],e[7]=t[i+7],r[0]}function u(t,i){return e[7]=t[i],e[6]=t[i+1],e[5]=t[i+2],e[4]=t[i+3],e[3]=t[i+4],e[2]=t[i+5],e[1]=t[i+6],e[0]=t[i+7],r[0]}o.writeDoubleLE=t?i:n,o.writeDoubleBE=t?n:i,o.readDoubleLE=t?s:u,o.readDoubleBE=t?u:s}():function(){function t(t,i,n,r,e,s){var u=r<0?1:0;if(u&&(r=-r),0===r)t(0,e,s+i),t(0<1/r?0:2147483648,e,s+n);else if(isNaN(r))t(0,e,s+i),t(2146959360,e,s+n);else if(17976931348623157e292>>0,e,s+n);else{var o;if(r<22250738585072014e-324)t((o=r/5e-324)>>>0,e,s+i),t((u<<31|o/4294967296)>>>0,e,s+n);else{var f=Math.floor(Math.log(r)/Math.LN2);1024===f&&(f=1023),t(4503599627370496*(o=r*Math.pow(2,-f))>>>0,e,s+i),t((u<<31|f+1023<<20|1048576*o&1048575)>>>0,e,s+n)}}}function i(t,i,n,r,e){var s=t(r,e+i),u=t(r,e+n),o=2*(u>>31)+1,f=u>>>20&2047,h=4294967296*(1048575&u)+s;return 2047===f?h?NaN:o*(1/0):0===f?5e-324*o*h:o*Math.pow(2,f-1075)*(h+4503599627370496)}o.writeDoubleLE=t.bind(null,r,0,4),o.writeDoubleBE=t.bind(null,e,4,0),o.readDoubleLE=i.bind(null,s,0,4),o.readDoubleBE=i.bind(null,u,4,0)}(),o}function r(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}function e(t,i,n){i[n]=t>>>24,i[n+1]=t>>>16&255,i[n+2]=t>>>8&255,i[n+3]=255&t}function s(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}function u(t,i){return(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0}i.exports=n(n)},{}],7:[function(t,i,n){function r(t){try{var i=eval("require")(t);if(i&&(i.length||Object.keys(i).length))return i}catch(t){}return null}i.exports=r},{}],8:[function(t,i,n){var r=n,s=r.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},e=r.normalize=function(t){var i=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=s(t),r="";n&&(r=i.shift()+"/");for(var e=0;e>>1,u=null,o=e;return function(t){if(t<1||s>10),s[u++]=56320+(1023&r)):s[u++]=(15&r)<<12|(63&t[i++])<<6|63&t[i++],8191>6|192:(55296==(64512&r)&&56320==(64512&(e=t.charCodeAt(u+1)))?(r=65536+((1023&r)<<10)+(1023&e),++u,i[n++]=r>>18|240,i[n++]=r>>12&63|128):i[n++]=r>>12|224,i[n++]=r>>6&63|128),i[n++]=63&r|128);return n-s}},{}],11:[function(t,i,n){var r=n,l=t(14),v=t(33);function u(t,i,n,r){if(i.resolvedType)if(i.resolvedType instanceof l){t("switch(d%s){",r);for(var e=i.resolvedType.values,s=Object.keys(e),u=0;u>>0",r,r);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",r,r);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,o)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,o?"true":"");break;case"bytes":t('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length)",r)("m%s=d%s",r,r);break;case"string":t("m%s=String(d%s)",r,r);break;case"bool":t("m%s=Boolean(d%s)",r,r)}}return t}function d(t,i,n,r){if(i.resolvedType)i.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",r,n,r,r):t("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var e=!1;switch(i.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":e=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,e?"true":"",r);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:t("d%s=m%s",r,r)}}return t}r.fromObject=function(t){var i=t.fieldsArray,n=v.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!i.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r>>3){");for(var n=0;n>>0,8|c.mapKey[s.keyType],s.keyType),f===g?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,i):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,o,i),n("}")("}")):s.repeated?(n("if(%s!=null&&%s.length){",i,i),s.packed&&c.packed[o]!==g?n("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",o,i)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",i),f===g?l(n,s,u,i+"[i]"):n("w.uint32(%i).%s(%s[i])",(s.id<<3|f)>>>0,o,i)),n("}")):(s.optional&&n("if(%s!=null&&m.hasOwnProperty(%j))",i,s.name),f===g?l(n,s,u,i):n("w.uint32(%i).%s(%s)",(s.id<<3|f)>>>0,o,i))}return n("return w")};var h=t(14),c=t(32),a=t(33);function l(t,i,n,r){return i.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(i.id<<3|2)>>>0)}},{14:14,32:32,33:33}],14:[function(t,i){i.exports=e;var o=t(22);((e.prototype=Object.create(o.prototype)).constructor=e).className="Enum";var n=t(21),r=t(33);function e(t,i,n,r,e){if(o.call(this,t,n),i&&"object"!=typeof i)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=e||{},this.reserved=g,i)for(var s=Object.keys(i),u=0;u=i)return!0;return!1},h.isReservedName=function(t,i){if(t)for(var n=0;n "+t.len)}function o(t){this.buf=t,this.pos=0,this.len=t.length}var f,h="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new o(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new o(t);throw Error("illegal buffer")};function c(){var t=new e(0,0),i=0;if(!(4=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,4>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function a(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function l(){if(this.pos+8>this.len)throw u(this,8);return new e(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}o.create=r.Buffer?function(t){return(o.create=function(t){return r.Buffer.isBuffer(t)?new n(t):h(t)})(t)}:h,o.prototype.f=r.Array.prototype.subarray||r.Array.prototype.slice,o.prototype.uint32=(f=4294967295,function(){if(f=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return f;if((this.pos+=5)>this.len)throw this.pos=this.len,u(this,10);return f}),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return a(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|a(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},o.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},o.prototype.bytes=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,n):i===n?new this.buf.constructor(0):this.f.call(this.buf,i,n)},o.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},o.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw u(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},o.r=function(t){n=t;var i=r.Long?"toLong":"toNumber";r.merge(o.prototype,{int64:function(){return c.call(this)[i](!1)},uint64:function(){return c.call(this)[i](!0)},sint64:function(){return c.call(this).zzDecode()[i](!1)},fixed64:function(){return l.call(this)[i](!0)},sfixed64:function(){return l.call(this)[i](!1)}})}},{35:35}],25:[function(t,i){i.exports=e;var n=t(24);(e.prototype=Object.create(n.prototype)).constructor=e;var r=t(35);function e(t){n.call(this,t)}r.Buffer&&(e.prototype.f=r.Buffer.prototype.slice),e.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len))}},{24:24,35:35}],26:[function(t,i){i.exports=n;var r=t(21);((n.prototype=Object.create(r.prototype)).constructor=n).className="Root";var e,v,d,s=t(15),u=t(14),o=t(23),b=t(33);function n(t){r.call(this,"",t),this.deferred=[],this.files=[]}function y(){}n.fromJSON=function(t,i){return i||(i=new n),t.options&&i.setOptions(t.options),i.addJSON(t.nested)},n.prototype.resolvePath=b.path.resolve,n.prototype.load=function t(i,s,u){"function"==typeof s&&(u=s,s=g);var o=this;if(!u)return b.asPromise(t,o,i,s);var f=u===y;function h(t,i){if(u){var n=u;if(u=null,f)throw t;n(t,i)}}function c(t,i){try{if(b.isString(i)&&"{"===i.charAt(0)&&(i=JSON.parse(i)),b.isString(i)){v.filename=t;var n,r=v(i,o,s),e=0;if(r.imports)for(;e>>0,this.hi=i>>>0}var s=e.zero=new e(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var r=e.zeroHash="\0\0\0\0\0\0\0\0";e.fromNumber=function(t){if(0===t)return s;var i=t<0;i&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return i&&(r=~r>>>0,n=~n>>>0,4294967295<++n&&(n=0,4294967295<++r&&(r=0))),new e(n,r)},e.from=function(t){if("number"==typeof t)return e.fromNumber(t);if(n.isString(t)){if(!n.Long)return e.fromNumber(parseInt(t,10));t=n.Long.fromString(t)}return t.low||t.high?new e(t.low>>>0,t.high>>>0):s},e.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var i=1+~this.lo>>>0,n=~this.hi>>>0;return i||(n=n+1>>>0),-(i+4294967296*n)}return this.lo+4294967296*this.hi},e.prototype.toLong=function(t){return n.Long?new n.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var u=String.prototype.charCodeAt;e.fromHash=function(t){return t===r?s:new e((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},e.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},e.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},e.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},e.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:n<128?9:10}},{35:35}],35:[function(t,i,n){var r=n;function e(t,i,n){for(var r=Object.keys(i),e=0;e>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;i[n++]=t.lo}function d(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}c.create=r.Buffer?function(){return(c.create=function(){return new n})()}:function(){return new c},c.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(c.alloc=r.pool(c.alloc,r.Array.prototype.subarray)),c.prototype.y=function(t,i,n){return this.tail=this.tail.next=new o(t,i,n),this.len+=i,this},(l.prototype=Object.create(o.prototype)).fn=function(t,i,n){for(;127>>=7;i[n]=t},c.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new l((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},c.prototype.int32=function(t){return t<0?this.y(v,10,e.fromNumber(t)):this.uint32(t)},c.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},c.prototype.int64=c.prototype.uint64=function(t){var i=e.from(t);return this.y(v,i.length(),i)},c.prototype.sint64=function(t){var i=e.from(t).zzEncode();return this.y(v,i.length(),i)},c.prototype.bool=function(t){return this.y(a,1,t?1:0)},c.prototype.sfixed32=c.prototype.fixed32=function(t){return this.y(d,4,t>>>0)},c.prototype.sfixed64=c.prototype.fixed64=function(t){var i=e.from(t);return this.y(d,4,i.lo).y(d,4,i.hi)},c.prototype.float=function(t){return this.y(r.float.writeFloatLE,4,t)},c.prototype.double=function(t){return this.y(r.float.writeDoubleLE,8,t)};var b=r.Array.prototype.set?function(t,i,n){i.set(t,n)}:function(t,i,n){for(var r=0;r>>0;if(!i)return this.y(a,1,0);if(r.isString(t)){var n=c.alloc(i=s.length(t));s.decode(t,n,0),t=n}return this.uint32(i).y(b,i,t)},c.prototype.string=function(t){var i=u.length(t);return i?this.uint32(i).y(u.write,i,t):this.y(a,1,0)},c.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new o(f,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(f,0,0),this.len=0),this},c.prototype.ldelim=function(){var t=this.head,i=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=i,this.len+=n),this},c.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,i,n),n+=t.len,t=t.next;return i},c.r=function(t){n=t}},{35:35}],39:[function(t,i){i.exports=s;var n=t(38);(s.prototype=Object.create(n.prototype)).constructor=s;var r=t(35),e=r.Buffer;function s(){n.call(this)}s.alloc=function(t){return(s.alloc=r.b)(t)};var u=e&&e.prototype instanceof Uint8Array&&"set"===e.prototype.set.name?function(t,i,n){i.set(t,n)}:function(t,i,n){if(t.copy)t.copy(i,n,0,t.length);else for(var r=0;r>>0;return this.uint32(i),i&&this.y(u,i,t),this},s.prototype.string=function(t){var i=e.byteLength(t);return this.uint32(i),i&&this.y(o,i,t),this}},{35:35,38:38}]},e={},t=[16],i=function t(i){var n=e[i];return n||r[i][0].call(n=e[i]={exports:{}},t,n,n.exports),n.exports}(t[0]),i.util.global.protobuf=i,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(i.util.Long=t,i.configure()),i}),"object"==typeof module&&module&&module.exports&&(module.exports=i)}(); +//# sourceMappingURL=protobuf.min.js.map diff --git a/node_modules/protobufjs/dist/light/protobuf.min.js.map b/node_modules/protobufjs/dist/light/protobuf.min.js.map new file mode 100644 index 0000000..b99218f --- /dev/null +++ b/node_modules/protobufjs/dist/light/protobuf.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light","../src/index-minimal.js","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":["undefined","modules","cache","entries","protobuf","1","require","module","exports","fn","ctx","params","Array","arguments","length","offset","index","pending","Promise","resolve","reject","err","apply","base64","string","p","n","charAt","Math","ceil","b64","s64","i","encode","buffer","start","end","t","parts","chunk","j","b","push","String","fromCharCode","slice","join","invalidEncoding","decode","c","charCodeAt","Error","test","codegen","functionParams","functionName","body","Codegen","formatStringOrScope","source","toString","verbose","console","log","scopeKeys","Object","keys","scopeParams","scopeValues","scopeOffset","Function","formatParams","formatOffset","replace","$0","$1","value","floor","JSON","stringify","functionNameOverride","EventEmitter","this","_listeners","prototype","on","evt","off","listeners","splice","emit","args","fetch","asPromise","fs","inquire","filename","options","callback","xhr","readFile","contents","XMLHttpRequest","binary","onreadystatechange","readyState","status","response","responseText","Uint8Array","overrideMimeType","responseType","open","send","factory","Float32Array","f32","f8b","le","writeFloat_f32_cpy","val","buf","pos","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","writeFloat_ieee754","writeUint","sign","isNaN","round","exponent","LN2","pow","readFloat_ieee754","readUint","uint","mantissa","NaN","Infinity","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","f64","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","writeDouble_ieee754","off0","off1","readDouble_ieee754","lo","hi","moduleName","mod","eval","e","path","isAbsolute","normalize","split","absolute","prefix","shift","originPath","includePath","alreadyNormalized","alloc","size","SIZE","MAX","slab","call","utf8","len","read","write","c1","c2","converter","Enum","util","genValuePartial_fromObject","gen","field","fieldIndex","prop","resolvedType","values","repeated","typeDefault","fullName","isUnsigned","type","genValuePartial_toObject","fromObject","mtype","fields","fieldsArray","name","safeProp","map","toObject","sort","compareFieldsById","repeatedFields","mapFields","normalFields","partOf","valuesById","long","low","high","unsigned","toNumber","bytes","arrayDefault","hasKs2","_fieldsArray","indexOf","filter","group","ref","id","keyType","types","basic","packed","rfield","required","wireType","mapKey","genTypePartial","optional","ReflectionObject","create","constructor","className","Namespace","comment","comments","TypeError","reserved","fromJSON","json","enm","toJSON","toJSONOptions","keepComments","add","isString","isInteger","isReservedId","isReservedName","allow_alias","remove","Field","Type","ruleRe","rule","extend","isObject","toLowerCase","message","defaultValue","Long","extensionField","declaringField","_packed","defineProperty","get","getOption","setOption","ifNotSet","resolved","defaults","parent","lookupTypeOrEnum","fromNumber","freeze","newBuffer","emptyObject","emptyArray","ctor","d","fieldId","fieldType","fieldRule","decorateType","decorateEnum","fieldName","default","_configure","Type_","build","load","root","Root","loadSync","encoder","decoder","verifier","OneOf","MapField","Service","Method","Message","wrappers","configure","Reader","BufferReader","Writer","BufferWriter","rpc","roots","resolvedKeyType","fieldKeyType","fieldValueType","properties","$type","writer","encodeDelimited","reader","decodeDelimited","verify","object","requestType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","lookupType","arrayToJSON","array","obj","nested","_nestedArray","clearCache","namespace","addJSON","toArray","nestedArray","nestedJson","names","methods","getEnum","prev","setOptions","onAdd","onRemove","define","isArray","ptr","part","resolveAll","lookup","filterTypes","parentAlreadyChecked","found","lookupEnum","lookupService","Service_","Enum_","defineProperties","unshift","_handleAdd","_handleRemove","Root_","fieldNames","oneof","addFieldsToParent","oneofName","oneOfGetter","set","oneOfSetter","LongBits","indexOutOfRange","writeLength","RangeError","create_array","readLongVarint","bits","readFixed32_end","readFixed64","Buffer","isBuffer","_slice","subarray","uint32","int32","sint32","bool","fixed32","sfixed32","float","double","skip","skipType","BufferReader_","merge","int64","uint64","sint64","zzDecode","fixed64","sfixed64","utf8Slice","min","parse","common","deferred","files","SYNC","resolvePath","self","sync","finish","cb","process","parsed","imports","weakImports","queued","weak","idx","lastIndexOf","altname","substring","setTimeout","readFileSync","isNode","exposeRe","tryHandleExtension","extendedType","sisterField","parse_","common_","rpcImpl","requestDelimited","responseDelimited","rpcCall","method","requestCtor","responseCtor","request","endedByRPC","_methodsArray","service","inherited","methodsArray","rpcService","methodName","lcFirst","isReserved","m","q","s","oneofs","extensions","_fieldsById","_oneofsArray","_ctor","fieldsById","oneofsArray","generateConstructor","ctorProperties","setup","wrapper","originalThis","fork","ldelim","typeName","target","bake","o","key","safePropBackslashRe","safePropQuoteRe","ucFirst","str","toUpperCase","camelCaseRe","camelCase","a","decorateRoot","enumerable","decorateEnumIndex","zero","zzEncode","zeroHash","from","parseInt","fromString","toLong","fromHash","hash","toHash","mask","part0","part1","part2","dst","src","newError","CustomError","captureStackTrace","stack","pool","global","window","versions","node","Number","isFinite","isset","isSet","hasOwnProperty","utf8Write","_Buffer_from","_Buffer_allocUnsafe","sizeOrArray","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","ProtocolError","fieldMap","longs","enums","encoding","allocUnsafe","seenFirstField","invalid","genVerifyKey","genVerifyValue","oneofProp","expected","type_url","substr","Op","next","noop","State","head","tail","states","writeByte","VarintOp","writeVarint64","writeFixed32","_push","writeBytes","reset","BufferWriter_","writeBytesBuffer","copy","writeStringBuffer","byteLength","$require","$module","amd","isLong"],"mappings":";;;;;;CAAA,SAAAA,GAAA,aAAA,IAAAC,EAAAC,EAAAC,EAcAC,EAdAH,EAiCA,CAAAI,EAAA,CAAA,SAAAC,EAAAC,GChCAA,EAAAC,QAmBA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACA,KAAAD,EAAAH,UAAAC,QACAH,EAAAI,KAAAF,UAAAG,KACA,OAAA,IAAAE,QAAA,SAAAC,EAAAC,GACAT,EAAAI,GAAA,SAAAM,GACA,GAAAJ,EAEA,GADAA,GAAA,EACAI,EACAD,EAAAC,OACA,CAGA,IAFA,IAAAV,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAA,EAAAJ,EAAAG,QACAH,EAAAI,KAAAF,UAAAE,GACAI,EAAAG,MAAA,KAAAX,KAIA,IACAF,EAAAa,MAAAZ,GAAA,KAAAC,GACA,MAAAU,GACAJ,IACAA,GAAA,EACAG,EAAAC,gCC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AAA,SAAArF,GAKA,OAJAA,GAAAA,EAAA2S,SACA5jB,EAAA6L,KAAAoF,KAAAA,EACAjR,EAAA4T,aAEA5T,IAIA,iBAAAG,QAAAA,QAAAA,OAAAC,UACAD,OAAAC,QAAAJ,GA/BA","file":"protobuf.min.js","sourcesContent":["(function prelude(modules, cache, entries) {\r\n\r\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\r\n // sources through a conflict-free require shim and is again wrapped within an iife that\r\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\r\n // so that minification can remove the directives of each module.\r\n\r\n function $require(name) {\r\n var $module = cache[name];\r\n if (!$module)\r\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\r\n return $module.exports;\r\n }\r\n\r\n var protobuf = $require(entries[0]);\r\n\r\n // Expose globally\r\n protobuf.util.global.protobuf = protobuf;\r\n\r\n // Be nice to AMD\r\n if (typeof define === \"function\" && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long && Long.isLong) {\r\n protobuf.util.Long = Long;\r\n protobuf.configure();\r\n }\r\n return protobuf;\r\n });\r\n\r\n // Be nice to CommonJS\r\n if (typeof module === \"object\" && module && module.exports)\r\n module.exports = protobuf;\r\n\r\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\n/**\r\n * Runtime message from/to plain object converters.\r\n * @namespace\r\n */\r\nvar converter = exports;\r\n\r\nvar Enum = require(14),\r\n util = require(33);\r\n\r\n/**\r\n * Generates a partial value fromObject conveter.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {number} fieldIndex Field index\r\n * @param {string} prop Property reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n if (field.resolvedType) {\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(d%s){\", prop);\r\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\r\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\r\n (\"default:\");\r\n gen\r\n (\"case%j:\", keys[i])\r\n (\"case %i:\", values[keys[i]])\r\n (\"m%s=%j\", prop, values[keys[i]])\r\n (\"break\");\r\n } gen\r\n (\"}\");\r\n } else gen\r\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\r\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\r\n (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\r\n } else {\r\n var isUnsigned = false;\r\n switch (field.type) {\r\n case \"double\":\r\n case \"float\": gen\r\n (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\r\n break;\r\n case \"uint32\":\r\n case \"fixed32\": gen\r\n (\"m%s=d%s>>>0\", prop, prop);\r\n break;\r\n case \"int32\":\r\n case \"sint32\":\r\n case \"sfixed32\": gen\r\n (\"m%s=d%s|0\", prop, prop);\r\n break;\r\n case \"uint64\":\r\n isUnsigned = true;\r\n // eslint-disable-line no-fallthrough\r\n case \"int64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(util.Long)\")\r\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\r\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\r\n (\"m%s=parseInt(d%s,10)\", prop, prop)\r\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\r\n (\"m%s=d%s\", prop, prop)\r\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\r\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\r\n break;\r\n case \"bytes\": gen\r\n (\"if(typeof d%s===\\\"string\\\")\", prop)\r\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\r\n (\"else if(d%s.length)\", prop)\r\n (\"m%s=d%s\", prop, prop);\r\n break;\r\n case \"string\": gen\r\n (\"m%s=String(d%s)\", prop, prop);\r\n break;\r\n case \"bool\": gen\r\n (\"m%s=Boolean(d%s)\", prop, prop);\r\n break;\r\n /* default: gen\r\n (\"m%s=d%s\", prop, prop);\r\n break; */\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a plain object to runtime message converter specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nconverter.fromObject = function fromObject(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var fields = mtype.fieldsArray;\r\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\r\n (\"if(d instanceof this.ctor)\")\r\n (\"return d\");\r\n if (!fields.length) return gen\r\n (\"return new this.ctor\");\r\n gen\r\n (\"var m=new this.ctor\");\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n prop = util.safeProp(field.name);\r\n\r\n // Map fields\r\n if (field.map) { gen\r\n (\"if(d%s){\", prop)\r\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\r\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\r\n (\"m%s={}\", prop)\r\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\r\n break;\r\n case \"bytes\": gen\r\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\r\n break;\r\n default: gen\r\n (\"d%s=m%s\", prop, prop);\r\n break;\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a runtime message to plain object converter specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nconverter.toObject = function toObject(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\r\n if (!fields.length)\r\n return util.codegen()(\"return {}\");\r\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\r\n (\"if(!o)\")\r\n (\"o={}\")\r\n (\"var d={}\");\r\n\r\n var repeatedFields = [],\r\n mapFields = [],\r\n normalFields = [],\r\n i = 0;\r\n for (; i < fields.length; ++i)\r\n if (!fields[i].partOf)\r\n ( fields[i].resolve().repeated ? repeatedFields\r\n : fields[i].map ? mapFields\r\n : normalFields).push(fields[i]);\r\n\r\n if (repeatedFields.length) { gen\r\n (\"if(o.arrays||o.defaults){\");\r\n for (i = 0; i < repeatedFields.length; ++i) gen\r\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\r\n gen\r\n (\"}\");\r\n }\r\n\r\n if (mapFields.length) { gen\r\n (\"if(o.objects||o.defaults){\");\r\n for (i = 0; i < mapFields.length; ++i) gen\r\n (\"d%s={}\", util.safeProp(mapFields[i].name));\r\n gen\r\n (\"}\");\r\n }\r\n\r\n if (normalFields.length) { gen\r\n (\"if(o.defaults){\");\r\n for (i = 0; i < normalFields.length; ++i) {\r\n var field = normalFields[i],\r\n prop = util.safeProp(field.name);\r\n if (field.resolvedType instanceof Enum) gen\r\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\r\n else if (field.long) gen\r\n (\"if(util.Long){\")\r\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\r\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\r\n (\"}else\")\r\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\r\n else if (field.bytes) {\r\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\r\n gen\r\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\r\n (\"else{\")\r\n (\"d%s=%s\", prop, arrayDefault)\r\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\r\n (\"}\");\r\n } else gen\r\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\r\n } gen\r\n (\"}\");\r\n }\r\n var hasKs2 = false;\r\n for (i = 0; i < fields.length; ++i) {\r\n var field = fields[i],\r\n index = mtype._fieldsArray.indexOf(field),\r\n prop = util.safeProp(field.name);\r\n if (field.map) {\r\n if (!hasKs2) { hasKs2 = true; gen\r\n (\"var ks2\");\r\n } gen\r\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\r\n (\"d%s={}\", prop)\r\n (\"for(var j=0;j>>3){\");\r\n\r\n var i = 0;\r\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\r\n var field = mtype._fieldsArray[i].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\r\n ref = \"m\" + util.safeProp(field.name); gen\r\n (\"case %i:\", field.id);\r\n\r\n // Map fields\r\n if (field.map) { gen\r\n (\"r.skip().pos++\") // assumes id 1 + key wireType\r\n (\"if(%s===util.emptyObject)\", ref)\r\n (\"%s={}\", ref)\r\n (\"k=r.%s()\", field.keyType)\r\n (\"r.pos++\"); // assumes id 2 + value wireType\r\n if (types.long[field.keyType] !== undefined) {\r\n if (types.basic[type] === undefined) gen\r\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\r\n else gen\r\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=r.%s()\", ref, type);\r\n } else {\r\n if (types.basic[type] === undefined) gen\r\n (\"%s[k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\r\n else gen\r\n (\"%s[k]=r.%s()\", ref, type);\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) { gen\r\n\r\n (\"if(!(%s&&%s.length))\", ref, ref)\r\n (\"%s=[]\", ref);\r\n\r\n // Packable (always check for forward and backward compatiblity)\r\n if (types.packed[type] !== undefined) gen\r\n (\"if((t&7)===2){\")\r\n (\"var c2=r.uint32()+r.pos\")\r\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0)\r\n : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\r\n}\r\n\r\n/**\r\n * Generates an encoder specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nfunction encoder(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\r\n (\"if(!w)\")\r\n (\"w=Writer.create()\");\r\n\r\n var i, ref;\r\n\r\n // \"when a message is serialized its known fields should be written sequentially by field number\"\r\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\r\n\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n index = mtype._fieldsArray.indexOf(field),\r\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\r\n wireType = types.basic[type];\r\n ref = \"m\" + util.safeProp(field.name);\r\n\r\n // Map fields\r\n if (field.map) {\r\n gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name) // !== undefined && !== null\r\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\r\n if (wireType === undefined) gen\r\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\r\n else gen\r\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\r\n gen\r\n (\"}\")\r\n (\"}\");\r\n\r\n // Repeated fields\r\n } else if (field.repeated) { gen\r\n (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\r\n\r\n // Packed repeated\r\n if (field.packed && types.packed[type] !== undefined) { gen\r\n\r\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\r\n (\"for(var i=0;i<%s.length;++i)\", ref)\r\n (\"w.%s(%s[i])\", type, ref)\r\n (\"w.ldelim()\");\r\n\r\n // Non-packed\r\n } else { gen\r\n\r\n (\"for(var i=0;i<%s.length;++i)\", ref);\r\n if (wireType === undefined)\r\n genTypePartial(gen, field, index, ref + \"[i]\");\r\n else gen\r\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\r\n\r\n } gen\r\n (\"}\");\r\n\r\n // Non-repeated\r\n } else {\r\n if (field.optional) gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j))\", ref, field.name); // !== undefined && !== null\r\n\r\n if (wireType === undefined)\r\n genTypePartial(gen, field, index, ref);\r\n else gen\r\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\r\n\r\n }\r\n }\r\n\r\n return gen\r\n (\"return w\");\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}","\"use strict\";\r\nmodule.exports = Enum;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\r\n\r\nvar Namespace = require(21),\r\n util = require(33);\r\n\r\n/**\r\n * Constructs a new enum instance.\r\n * @classdesc Reflected enum.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {Object.} [values] Enum values as an object, by name\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] The comment for this enum\r\n * @param {Object.} [comments] The value comments for this enum\r\n */\r\nfunction Enum(name, values, options, comment, comments) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n if (values && typeof values !== \"object\")\r\n throw TypeError(\"values must be an object\");\r\n\r\n /**\r\n * Enum values by id.\r\n * @type {Object.}\r\n */\r\n this.valuesById = {};\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = Object.create(this.valuesById); // toJSON, marker\r\n\r\n /**\r\n * Enum comment text.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n\r\n /**\r\n * Value comment texts, if any.\r\n * @type {Object.}\r\n */\r\n this.comments = comments || {};\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {Array.}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\r\n // compatible enum. This is used by pbts to write actual enum definitions that work for\r\n // static and reflection code alike instead of emitting generic object definitions.\r\n\r\n if (values)\r\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\r\n if (typeof values[keys[i]] === \"number\") // use forward entries only\r\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\r\n}\r\n\r\n/**\r\n * Enum descriptor.\r\n * @interface IEnum\r\n * @property {Object.} values Enum values\r\n * @property {Object.} [options] Enum options\r\n */\r\n\r\n/**\r\n * Constructs an enum from an enum descriptor.\r\n * @param {string} name Enum name\r\n * @param {IEnum} json Enum descriptor\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\r\n enm.reserved = json.reserved;\r\n return enm;\r\n};\r\n\r\n/**\r\n * Converts this enum to an enum descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IEnum} Enum descriptor\r\n */\r\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"values\" , this.values,\r\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\r\n \"comment\" , keepComments ? this.comment : undefined,\r\n \"comments\" , keepComments ? this.comments : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @param {string} [comment] Comment, if any\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnum.prototype.add = function add(name, id, comment) {\r\n // utilized by the parser but not by .fromJSON\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n if (!util.isInteger(id))\r\n throw TypeError(\"id must be an integer\");\r\n\r\n if (this.values[name] !== undefined)\r\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\r\n\r\n if (this.isReservedId(id))\r\n throw Error(\"id \" + id + \" is reserved in \" + this);\r\n\r\n if (this.isReservedName(name))\r\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\r\n\r\n if (this.valuesById[id] !== undefined) {\r\n if (!(this.options && this.options.allow_alias))\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n } else\r\n this.valuesById[this.values[name] = id] = name;\r\n\r\n this.comments[name] = comment || null;\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnum.prototype.remove = function remove(name) {\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n var val = this.values[name];\r\n if (val == null)\r\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\r\n\r\n delete this.valuesById[val];\r\n delete this.values[name];\r\n delete this.comments[name];\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nEnum.prototype.isReservedId = function isReservedId(id) {\r\n return Namespace.isReservedId(this.reserved, id);\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nEnum.prototype.isReservedName = function isReservedName(name) {\r\n return Namespace.isReservedName(this.reserved, name);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\r\n\r\nvar Enum = require(14),\r\n types = require(32),\r\n util = require(33);\r\n\r\nvar Type; // cyclic\r\n\r\nvar ruleRe = /^required|optional|repeated$/;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @name Field\r\n * @classdesc Reflected message field.\r\n * @extends FieldBase\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object.} [rule=\"optional\"] Field rule\r\n * @param {string|Object.} [extend] Extended type if different from parent\r\n * @param {Object.} [options] Declared options\r\n */\r\n\r\n/**\r\n * Constructs a field from a field descriptor.\r\n * @param {string} name Field name\r\n * @param {IField} json Field descriptor\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Not an actual constructor. Use {@link Field} instead.\r\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\r\n * @exports FieldBase\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object.} [rule=\"optional\"] Field rule\r\n * @param {string|Object.} [extend] Extended type if different from parent\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction Field(name, id, type, rule, extend, options, comment) {\r\n\r\n if (util.isObject(rule)) {\r\n comment = extend;\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n comment = options;\r\n options = extend;\r\n extend = undefined;\r\n }\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n if (!util.isInteger(id) || id < 0)\r\n throw TypeError(\"id must be a non-negative integer\");\r\n\r\n if (!util.isString(type))\r\n throw TypeError(\"type must be a string\");\r\n\r\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\r\n throw TypeError(\"rule must be a string rule\");\r\n\r\n if (extend !== undefined && !util.isString(extend))\r\n throw TypeError(\"extend must be a string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {Type|null}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {OneOf|null}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field type's default value.\r\n * @type {*}\r\n */\r\n this.typeDefault = null;\r\n\r\n /**\r\n * The field's default value on prototypes.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\r\n\r\n /**\r\n * Whether this field's value is a buffer.\r\n * @type {boolean}\r\n */\r\n this.bytes = type === \"bytes\";\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {Type|Enum|null}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {Field|null}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {Field|null}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {boolean|null}\r\n * @private\r\n */\r\n this._packed = null;\r\n\r\n /**\r\n * Comment for this field.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\nObject.defineProperty(Field.prototype, \"packed\", {\r\n get: function() {\r\n // defaults to packed=true if not explicity set to false\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\") // clear cached before setting\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Field descriptor.\r\n * @interface IField\r\n * @property {string} [rule=\"optional\"] Field rule\r\n * @property {string} type Field type\r\n * @property {number} id Field id\r\n * @property {Object.} [options] Field options\r\n */\r\n\r\n/**\r\n * Extension field descriptor.\r\n * @interface IExtensionField\r\n * @extends IField\r\n * @property {string} extend Extended type\r\n */\r\n\r\n/**\r\n * Converts this field to a field descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IField} Field descriptor\r\n */\r\nField.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\r\n \"type\" , this.type,\r\n \"id\" , this.id,\r\n \"extend\" , this.extend,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nField.prototype.resolve = function resolve() {\r\n\r\n if (this.resolved)\r\n return this;\r\n\r\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\r\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\r\n if (this.resolvedType instanceof Type)\r\n this.typeDefault = null;\r\n else // instanceof Enum\r\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\r\n }\r\n\r\n // use explicitly set default value if present\r\n if (this.options && this.options[\"default\"] != null) {\r\n this.typeDefault = this.options[\"default\"];\r\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\r\n this.typeDefault = this.resolvedType.values[this.typeDefault];\r\n }\r\n\r\n // remove unnecessary options\r\n if (this.options) {\r\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\r\n delete this.options.packed;\r\n if (!Object.keys(this.options).length)\r\n this.options = undefined;\r\n }\r\n\r\n // convert to internal data type if necesssary\r\n if (this.long) {\r\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\r\n\r\n /* istanbul ignore else */\r\n if (Object.freeze)\r\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\r\n\r\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\r\n var buf;\r\n if (util.base64.test(this.typeDefault))\r\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\r\n else\r\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\r\n this.typeDefault = buf;\r\n }\r\n\r\n // take special care of maps and repeated fields\r\n if (this.map)\r\n this.defaultValue = util.emptyObject;\r\n else if (this.repeated)\r\n this.defaultValue = util.emptyArray;\r\n else\r\n this.defaultValue = this.typeDefault;\r\n\r\n // ensure proper value on prototype\r\n if (this.parent instanceof Type)\r\n this.parent.ctor.prototype[this.name] = this.defaultValue;\r\n\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\r\n * @typedef FieldDecorator\r\n * @type {function}\r\n * @param {Object} prototype Target prototype\r\n * @param {string} fieldName Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Field decorator (TypeScript).\r\n * @name Field.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\r\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\r\n * @param {T} [defaultValue] Default value\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\r\n */\r\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\r\n\r\n // submessage: decorate the submessage and use its name as the type\r\n if (typeof fieldType === \"function\")\r\n fieldType = util.decorateType(fieldType).name;\r\n\r\n // enum reference: create a reflected copy of the enum and keep reuseing it\r\n else if (fieldType && typeof fieldType === \"object\")\r\n fieldType = util.decorateEnum(fieldType).name;\r\n\r\n return function fieldDecorator(prototype, fieldName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\r\n };\r\n};\r\n\r\n/**\r\n * Field decorator (TypeScript).\r\n * @name Field.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {Constructor|string} fieldType Field type\r\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends Message\r\n * @variation 2\r\n */\r\n// like Field.d but without a default value\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nField._configure = function configure(Type_) {\r\n Type = Type_;\r\n};\r\n","\"use strict\";\r\nvar protobuf = module.exports = require(17);\r\n\r\nprotobuf.build = \"light\";\r\n\r\n/**\r\n * A node-style callback as used by {@link load} and {@link Root#load}.\r\n * @typedef LoadCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Root} [root] Root, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @see {@link Root#load}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === \"function\") {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @see {@link Root#load}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @see {@link Root#load}\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n * @see {@link Root#loadSync}\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Serialization\r\nprotobuf.encoder = require(13);\r\nprotobuf.decoder = require(12);\r\nprotobuf.verifier = require(36);\r\nprotobuf.converter = require(11);\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(22);\r\nprotobuf.Namespace = require(21);\r\nprotobuf.Root = require(26);\r\nprotobuf.Enum = require(14);\r\nprotobuf.Type = require(31);\r\nprotobuf.Field = require(15);\r\nprotobuf.OneOf = require(23);\r\nprotobuf.MapField = require(18);\r\nprotobuf.Service = require(30);\r\nprotobuf.Method = require(20);\r\n\r\n// Runtime\r\nprotobuf.Message = require(19);\r\nprotobuf.wrappers = require(37);\r\n\r\n// Utility\r\nprotobuf.types = require(32);\r\nprotobuf.util = require(33);\r\n\r\n// Set up possibly cyclic reflection dependencies\r\nprotobuf.ReflectionObject._configure(protobuf.Root);\r\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\r\nprotobuf.Root._configure(protobuf.Type);\r\nprotobuf.Field._configure(protobuf.Type);\r\n","\"use strict\";\r\nvar protobuf = exports;\r\n\r\n/**\r\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\r\n * @name build\r\n * @type {string}\r\n * @const\r\n */\r\nprotobuf.build = \"minimal\";\r\n\r\n// Serialization\r\nprotobuf.Writer = require(38);\r\nprotobuf.BufferWriter = require(39);\r\nprotobuf.Reader = require(24);\r\nprotobuf.BufferReader = require(25);\r\n\r\n// Utility\r\nprotobuf.util = require(35);\r\nprotobuf.rpc = require(28);\r\nprotobuf.roots = require(27);\r\nprotobuf.configure = configure;\r\n\r\n/* istanbul ignore next */\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n protobuf.Reader._configure(protobuf.BufferReader);\r\n protobuf.util._configure();\r\n}\r\n\r\n// Set up buffer utility according to the environment\r\nprotobuf.Writer._configure(protobuf.BufferWriter);\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\n// extends Field\r\nvar Field = require(15);\r\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\r\n\r\nvar types = require(32),\r\n util = require(33);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends FieldBase\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction MapField(name, id, keyType, type, options, comment) {\r\n Field.call(this, name, id, type, undefined, undefined, options, comment);\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(keyType))\r\n throw TypeError(\"keyType must be a string\");\r\n\r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {ReflectionObject|null}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Map field descriptor.\r\n * @interface IMapField\r\n * @extends {IField}\r\n * @property {string} keyType Key type\r\n */\r\n\r\n/**\r\n * Extension map field descriptor.\r\n * @interface IExtensionMapField\r\n * @extends IMapField\r\n * @property {string} extend Extended type\r\n */\r\n\r\n/**\r\n * Constructs a map field from a map field descriptor.\r\n * @param {string} name Field name\r\n * @param {IMapField} json Map field descriptor\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this map field to a map field descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IMapField} Map field descriptor\r\n */\r\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"keyType\" , this.keyType,\r\n \"type\" , this.type,\r\n \"id\" , this.id,\r\n \"extend\" , this.extend,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapField.prototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\r\n if (types.mapKey[this.keyType] === undefined)\r\n throw Error(\"invalid key type: \" + this.keyType);\r\n\r\n return Field.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Map field decorator (TypeScript).\r\n * @name MapField.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\r\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\r\n */\r\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\r\n\r\n // submessage value: decorate the submessage and use its name as the type\r\n if (typeof fieldValueType === \"function\")\r\n fieldValueType = util.decorateType(fieldValueType).name;\r\n\r\n // enum reference value: create a reflected copy of the enum and keep reuseing it\r\n else if (fieldValueType && typeof fieldValueType === \"object\")\r\n fieldValueType = util.decorateEnum(fieldValueType).name;\r\n\r\n return function mapFieldDecorator(prototype, fieldName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\nvar util = require(35);\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * @classdesc Abstract runtime message.\r\n * @constructor\r\n * @param {Properties} [properties] Properties to set\r\n * @template T extends object = object\r\n */\r\nfunction Message(properties) {\r\n // not used internally\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n}\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/*eslint-disable valid-jsdoc*/\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object.} [properties] Properties to set\r\n * @returns {Message} Message instance\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.create = function create(properties) {\r\n return this.$type.create(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {T|Object.} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {T|Object.} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\r\n * @returns {T} Decoded message\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.decode = function decode(reader) {\r\n return this.$type.decode(reader);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\r\n * @returns {T} Decoded message\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(reader) {\r\n return this.$type.decodeDelimited(reader);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Object.} message Plain object to verify\r\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\r\n * @param {Object.} object Plain object\r\n * @returns {T} Message instance\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.fromObject = function fromObject(object) {\r\n return this.$type.fromObject(object);\r\n};\r\n\r\n/**\r\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\r\n * @param {T} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.toObject = function toObject(message, options) {\r\n return this.$type.toObject(message, options);\r\n};\r\n\r\n/**\r\n * Converts this message to JSON.\r\n * @returns {Object.} JSON object\r\n */\r\nMessage.prototype.toJSON = function toJSON() {\r\n return this.$type.toObject(this, util.toJSONOptions);\r\n};\r\n\r\n/*eslint-enable valid-jsdoc*/","\"use strict\";\r\nmodule.exports = Method;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\r\n\r\nvar util = require(33);\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] The comment for this method\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\r\n\r\n /* istanbul ignore next */\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n\r\n /* istanbul ignore if */\r\n if (!(type === undefined || util.isString(type)))\r\n throw TypeError(\"type must be a string\");\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(requestType))\r\n throw TypeError(\"requestType must be a string\");\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(responseType))\r\n throw TypeError(\"responseType must be a string\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {Type|null}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {Type|null}\r\n */\r\n this.resolvedResponseType = null;\r\n\r\n /**\r\n * Comment for this method\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Method descriptor.\r\n * @interface IMethod\r\n * @property {string} [type=\"rpc\"] Method type\r\n * @property {string} requestType Request type\r\n * @property {string} responseType Response type\r\n * @property {boolean} [requestStream=false] Whether requests are streamed\r\n * @property {boolean} [responseStream=false] Whether responses are streamed\r\n * @property {Object.} [options] Method options\r\n */\r\n\r\n/**\r\n * Constructs a method from a method descriptor.\r\n * @param {string} name Method name\r\n * @param {IMethod} json Method descriptor\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this method to a method descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IMethod} Method descriptor\r\n */\r\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\r\n \"requestType\" , this.requestType,\r\n \"requestStream\" , this.requestStream,\r\n \"responseType\" , this.responseType,\r\n \"responseStream\" , this.responseStream,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethod.prototype.resolve = function resolve() {\r\n\r\n /* istanbul ignore if */\r\n if (this.resolved)\r\n return this;\r\n\r\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\r\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\r\n\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\r\n\r\nvar Field = require(15),\r\n util = require(33);\r\n\r\nvar Type, // cyclic\r\n Service,\r\n Enum;\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @name Namespace\r\n * @classdesc Reflected namespace.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object.} [options] Declared options\r\n */\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @memberof Namespace\r\n * @function\r\n * @param {string} name Namespace name\r\n * @param {Object.} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array, toJSONOptions) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {Array.|undefined} reserved Array of reserved ranges and names\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nNamespace.isReservedId = function isReservedId(reserved, id) {\r\n if (reserved)\r\n for (var i = 0; i < reserved.length; ++i)\r\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] >= id)\r\n return true;\r\n return false;\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {Array.|undefined} reserved Array of reserved ranges and names\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nNamespace.isReservedName = function isReservedName(reserved, name) {\r\n if (reserved)\r\n for (var i = 0; i < reserved.length; ++i)\r\n if (reserved[i] === name)\r\n return true;\r\n return false;\r\n};\r\n\r\n/**\r\n * Not an actual constructor. Use {@link Namespace} instead.\r\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\r\n * @exports NamespaceBase\r\n * @extends ReflectionObject\r\n * @abstract\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object.} [options] Declared options\r\n * @see {@link Namespace}\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {ReflectionObject[]|null}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\n/**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name NamespaceBase#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\r\n get: function() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n});\r\n\r\n/**\r\n * Namespace descriptor.\r\n * @interface INamespace\r\n * @property {Object.} [options] Namespace options\r\n * @property {Object.} [nested] Nested object descriptors\r\n */\r\n\r\n/**\r\n * Any extension field descriptor.\r\n * @typedef AnyExtensionField\r\n * @type {IExtensionField|IExtensionMapField}\r\n */\r\n\r\n/**\r\n * Any nested object descriptor.\r\n * @typedef AnyNestedObject\r\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\r\n */\r\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\r\n\r\n/**\r\n * Converts this namespace to a namespace descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {INamespace} Namespace descriptor\r\n */\r\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds nested objects to this namespace from nested object descriptors.\r\n * @param {Object.} nestedJson Any nested object descriptors\r\n * @returns {Namespace} `this`\r\n */\r\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n /* istanbul ignore else */\r\n if (nestedJson) {\r\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\r\n nested = nestedJson[names[i]];\r\n ns.add( // most to least likely\r\n ( nested.fields !== undefined\r\n ? Type.fromJSON\r\n : nested.values !== undefined\r\n ? Enum.fromJSON\r\n : nested.methods !== undefined\r\n ? Service.fromJSON\r\n : nested.id !== undefined\r\n ? Field.fromJSON\r\n : Namespace.fromJSON )(names[i], nested)\r\n );\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespace.prototype.get = function get(name) {\r\n return this.nested && this.nested[name]\r\n || null;\r\n};\r\n\r\n/**\r\n * Gets the values of the nested {@link Enum|enum} of the specified name.\r\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\r\n * @param {string} name Nested enum name\r\n * @returns {Object.} Enum values\r\n * @throws {Error} If there is no such enum\r\n */\r\nNamespace.prototype.getEnum = function getEnum(name) {\r\n if (this.nested && this.nested[name] instanceof Enum)\r\n return this.nested[name].values;\r\n throw Error(\"no such enum: \" + name);\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespace.prototype.add = function add(object) {\r\n\r\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\r\n throw TypeError(\"object must be a valid nested object\");\r\n\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.nestedArray;\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespace.prototype.remove = function remove(object) {\r\n\r\n if (!(object instanceof ReflectionObject))\r\n throw TypeError(\"object must be a ReflectionObject\");\r\n if (object.parent !== this)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespace.prototype.define = function define(path, json) {\r\n\r\n if (util.isString(path))\r\n path = path.split(\".\");\r\n else if (!Array.isArray(path))\r\n throw TypeError(\"illegal path\");\r\n if (path && path.length && path[0] === \"\")\r\n throw Error(\"path must be relative\");\r\n\r\n var ptr = this;\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespace.prototype.resolveAll = function resolveAll() {\r\n var nested = this.nestedArray, i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return this.resolve();\r\n};\r\n\r\n/**\r\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\r\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\r\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\r\n */\r\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\r\n\r\n /* istanbul ignore next */\r\n if (typeof filterTypes === \"boolean\") {\r\n parentAlreadyChecked = filterTypes;\r\n filterTypes = undefined;\r\n } else if (filterTypes && !Array.isArray(filterTypes))\r\n filterTypes = [ filterTypes ];\r\n\r\n if (util.isString(path) && path.length) {\r\n if (path === \".\")\r\n return this.root;\r\n path = path.split(\".\");\r\n } else if (!path.length)\r\n return this;\r\n\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.root.lookup(path.slice(1), filterTypes);\r\n\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found) {\r\n if (path.length === 1) {\r\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\r\n return found;\r\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\r\n return found;\r\n\r\n // Otherwise try each nested namespace\r\n } else\r\n for (var i = 0; i < this.nestedArray.length; ++i)\r\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\r\n return found;\r\n\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path, filterTypes);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @name NamespaceBase#lookup\r\n * @function\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\r\n * @variation 2\r\n */\r\n// lookup(path: string, [parentAlreadyChecked: boolean])\r\n\r\n/**\r\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Type} Looked up type\r\n * @throws {Error} If `path` does not point to a type\r\n */\r\nNamespace.prototype.lookupType = function lookupType(path) {\r\n var found = this.lookup(path, [ Type ]);\r\n if (!found)\r\n throw Error(\"no such type: \" + path);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Enum} Looked up enum\r\n * @throws {Error} If `path` does not point to an enum\r\n */\r\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\r\n var found = this.lookup(path, [ Enum ]);\r\n if (!found)\r\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Type} Looked up type or enum\r\n * @throws {Error} If `path` does not point to a type or enum\r\n */\r\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\r\n var found = this.lookup(path, [ Type, Enum ]);\r\n if (!found)\r\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Service} Looked up service\r\n * @throws {Error} If `path` does not point to a service\r\n */\r\nNamespace.prototype.lookupService = function lookupService(path) {\r\n var found = this.lookup(path, [ Service ]);\r\n if (!found)\r\n throw Error(\"no such Service '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nNamespace._configure = function(Type_, Service_, Enum_) {\r\n Type = Type_;\r\n Service = Service_;\r\n Enum = Enum_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.className = \"ReflectionObject\";\r\n\r\nvar util = require(33);\r\n\r\nvar Root; // cyclic\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object.} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n if (options && !util.isObject(options))\r\n throw TypeError(\"options must be an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {Namespace|null}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n\r\n /**\r\n * Comment text, if any.\r\n * @type {string|null}\r\n */\r\n this.comment = null;\r\n\r\n /**\r\n * Defining file name.\r\n * @type {string|null}\r\n */\r\n this.filename = null;\r\n}\r\n\r\nObject.defineProperties(ReflectionObject.prototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: function() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join(\".\");\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Converts this reflection object to its descriptor representation.\r\n * @returns {Object.} Descriptor\r\n * @abstract\r\n */\r\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObject.prototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.root;\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObject.prototype.onRemove = function onRemove(parent) {\r\n var root = parent.root;\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n if (this.root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObject.prototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\r\n this.setOption(keys[i], options[keys[i]], ifNotSet);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Class name[, space, full name]\r\n */\r\nReflectionObject.prototype.toString = function toString() {\r\n var className = this.constructor.className,\r\n fullName = this.fullName;\r\n if (fullName.length)\r\n return className + \" \" + fullName;\r\n return className;\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nReflectionObject._configure = function(Root_) {\r\n Root = Root_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(22);\r\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\r\n\r\nvar Field = require(15),\r\n util = require(33);\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object.} [fieldNames] Field names\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction OneOf(name, fieldNames, options, comment) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n\r\n /* istanbul ignore if */\r\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\r\n throw TypeError(\"fieldNames must be an Array\");\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof as an array for iteration.\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\r\n\r\n /**\r\n * Comment for this field.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Oneof descriptor.\r\n * @interface IOneOf\r\n * @property {Array.} oneof Oneof field names\r\n * @property {Object.} [options] Oneof options\r\n */\r\n\r\n/**\r\n * Constructs a oneof from a oneof descriptor.\r\n * @param {string} name Oneof name\r\n * @param {IOneOf} json Oneof descriptor\r\n * @returns {OneOf} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this oneof to a oneof descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IOneOf} Oneof descriptor\r\n */\r\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"oneof\" , this.oneof,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\r\n if (!oneof.fieldsArray[i].parent)\r\n oneof.parent.add(oneof.fieldsArray[i]);\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof and removes it from its current parent, if any.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOf.prototype.add = function add(field) {\r\n\r\n /* istanbul ignore if */\r\n if (!(field instanceof Field))\r\n throw TypeError(\"field must be a Field\");\r\n\r\n if (field.parent && field.parent !== this.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this.fieldsArray.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof and puts it back to the oneof's parent.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOf.prototype.remove = function remove(field) {\r\n\r\n /* istanbul ignore if */\r\n if (!(field instanceof Field))\r\n throw TypeError(\"field must be a Field\");\r\n\r\n var index = this.fieldsArray.indexOf(field);\r\n\r\n /* istanbul ignore if */\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n\r\n this.fieldsArray.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n\r\n /* istanbul ignore else */\r\n if (index > -1) // theoretical\r\n this.oneof.splice(index, 1);\r\n\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOf.prototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n var self = this;\r\n // Collect present fields\r\n for (var i = 0; i < this.oneof.length; ++i) {\r\n var field = parent.get(this.oneof[i]);\r\n if (field && !field.partOf) {\r\n field.partOf = self;\r\n self.fieldsArray.push(field);\r\n }\r\n }\r\n // Add not yet present fields\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOf.prototype.onRemove = function onRemove(parent) {\r\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\r\n if ((field = this.fieldsArray[i]).parent)\r\n field.parent.remove(field);\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\r\n * @typedef OneOfDecorator\r\n * @type {function}\r\n * @param {Object} prototype Target prototype\r\n * @param {string} oneofName OneOf name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * OneOf decorator (TypeScript).\r\n * @function\r\n * @param {...string} fieldNames Field names\r\n * @returns {OneOfDecorator} Decorator function\r\n * @template T extends string\r\n */\r\nOneOf.d = function decorateOneOf() {\r\n var fieldNames = new Array(arguments.length),\r\n index = 0;\r\n while (index < arguments.length)\r\n fieldNames[index] = arguments[index++];\r\n return function oneOfDecorator(prototype, oneofName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new OneOf(oneofName, fieldNames));\r\n Object.defineProperty(prototype, oneofName, {\r\n get: util.oneOfGetter(fieldNames),\r\n set: util.oneOfSetter(fieldNames)\r\n });\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nvar util = require(35);\r\n\r\nvar BufferReader; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n utf8 = util.utf8;\r\n\r\n/* istanbul ignore next */\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n\r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\nvar create_array = typeof Uint8Array !== \"undefined\"\r\n ? function create_typed_array(buffer) {\r\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n }\r\n /* istanbul ignore next */\r\n : function create_array(buffer) {\r\n if (Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n };\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @function\r\n * @param {Uint8Array|Buffer} buffer Buffer to read from\r\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n * @throws {Error} If `buffer` is not a valid buffer\r\n */\r\nReader.create = util.Buffer\r\n ? function create_buffer_setup(buffer) {\r\n return (Reader.create = function create_buffer(buffer) {\r\n return util.Buffer.isBuffer(buffer)\r\n ? new BufferReader(buffer)\r\n /* istanbul ignore next */\r\n : create_array(buffer);\r\n })(buffer);\r\n }\r\n /* istanbul ignore next */\r\n : create_array;\r\n\r\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.uint32 = (function read_uint32_setup() {\r\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\r\n return function read_uint32() {\r\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n\r\n /* istanbul ignore if */\r\n if ((this.pos += 5) > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this, 10);\r\n }\r\n return value;\r\n };\r\n})();\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.int32 = function read_int32() {\r\n return this.uint32() | 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sint32 = function read_sint32() {\r\n var value = this.uint32();\r\n return value >>> 1 ^ -(value & 1) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n // tends to deopt with local vars for octet etc.\r\n var bits = new LongBits(0, 0);\r\n var i = 0;\r\n if (this.len - this.pos > 4) { // fast route (lo)\r\n for (; i < 4; ++i) {\r\n // 1st..4th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 5th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n i = 0;\r\n } else {\r\n for (; i < 3; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 1st..3th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 4th\r\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\r\n return bits;\r\n }\r\n if (this.len - this.pos > 4) { // fast route (hi)\r\n for (; i < 5; ++i) {\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n } else {\r\n for (; i < 5; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n }\r\n /* istanbul ignore next */\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReader.prototype.bool = function read_bool() {\r\n return this.uint32() !== 0;\r\n};\r\n\r\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\r\n return (buf[end - 4]\r\n | buf[end - 3] << 8\r\n | buf[end - 2] << 16\r\n | buf[end - 1] << 24) >>> 0;\r\n}\r\n\r\n/**\r\n * Reads fixed 32 bits as an unsigned 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.fixed32 = function read_fixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4);\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a signed 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sfixed32 = function read_sfixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readFixed64(/* this: Reader */) {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n\r\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.float = function read_float() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readFloatLE(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.double = function read_double() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readDoubleLE(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReader.prototype.bytes = function read_bytes() {\r\n var length = this.uint32(),\r\n start = this.pos,\r\n end = this.pos + length;\r\n\r\n /* istanbul ignore if */\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n\r\n this.pos += length;\r\n if (Array.isArray(this.buf)) // plain array\r\n return this.buf.slice(start, end);\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReader.prototype.string = function read_string() {\r\n var bytes = this.bytes();\r\n return utf8.read(bytes, 0, bytes.length);\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skip = function skip(length) {\r\n if (typeof length === \"number\") {\r\n /* istanbul ignore if */\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n } else {\r\n do {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n while ((wireType = this.uint32() & 7) !== 4) {\r\n this.skipType(wireType);\r\n }\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n\r\n /* istanbul ignore next */\r\n default:\r\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\r\n }\r\n return this;\r\n};\r\n\r\nReader._configure = function(BufferReader_) {\r\n BufferReader = BufferReader_;\r\n\r\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\r\n util.merge(Reader.prototype, {\r\n\r\n int64: function read_int64() {\r\n return readLongVarint.call(this)[fn](false);\r\n },\r\n\r\n uint64: function read_uint64() {\r\n return readLongVarint.call(this)[fn](true);\r\n },\r\n\r\n sint64: function read_sint64() {\r\n return readLongVarint.call(this).zzDecode()[fn](false);\r\n },\r\n\r\n fixed64: function read_fixed64() {\r\n return readFixed64.call(this)[fn](true);\r\n },\r\n\r\n sfixed64: function read_sfixed64() {\r\n return readFixed64.call(this)[fn](false);\r\n }\r\n\r\n });\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferReader;\r\n\r\n// extends Reader\r\nvar Reader = require(24);\r\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\r\n\r\nvar util = require(35);\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n Reader.call(this, buffer);\r\n\r\n /**\r\n * Read buffer.\r\n * @name BufferReader#buf\r\n * @type {Buffer}\r\n */\r\n}\r\n\r\n/* istanbul ignore else */\r\nif (util.Buffer)\r\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReader.prototype.string = function read_string_buffer() {\r\n var len = this.uint32(); // modifies pos\r\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @name BufferReader#bytes\r\n * @function\r\n * @returns {Buffer} Value read\r\n */\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\n// extends Namespace\r\nvar Namespace = require(21);\r\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\r\n\r\nvar Field = require(15),\r\n Enum = require(14),\r\n OneOf = require(23),\r\n util = require(33);\r\n\r\nvar Type, // cyclic\r\n parse, // might be excluded\r\n common; // \"\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {Object.} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files.\r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a namespace descriptor into a root namespace.\r\n * @param {INamespace} json Nameespace descriptor\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n if (json.options)\r\n root.setOptions(json.options);\r\n return root.addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\r\n */\r\nRoot.prototype.resolvePath = util.path.resolve;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\n/* istanbul ignore next */\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} options Parse options\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nRoot.prototype.load = function load(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = undefined;\r\n }\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename, options);\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n /* istanbul ignore if */\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n if (sync)\r\n throw err;\r\n cb(err, root);\r\n }\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n parse.filename = filename;\r\n var parsed = parse(source, self, options),\r\n resolved,\r\n i = 0;\r\n if (parsed.imports)\r\n for (; i < parsed.imports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\r\n fetch(resolved);\r\n if (parsed.weakImports)\r\n for (i = 0; i < parsed.weakImports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\r\n fetch(resolved, true);\r\n }\r\n } catch (err) {\r\n finish(err);\r\n }\r\n if (!sync && !queued)\r\n finish(null, self); // only once anyway\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.lastIndexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded / attempted\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n /* istanbul ignore if */\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n /* istanbul ignore else */\r\n if (!weak)\r\n finish(err);\r\n else if (!queued) // can't be covered reliably\r\n finish(null, self);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n for (var i = 0, resolved; i < filename.length; ++i)\r\n if (resolved = self.resolvePath(\"\", filename[i]))\r\n fetch(resolved);\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @function Root#load\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @function Root#load\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [options:IParseOptions]):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\r\n * @function Root#loadSync\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRoot.prototype.loadSync = function loadSync(filename, options) {\r\n if (!util.isNode)\r\n throw Error(\"not supported\");\r\n return this.load(filename, options, SYNC);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRoot.prototype.resolveAll = function resolveAll() {\r\n if (this.deferred.length)\r\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\r\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\r\n }).join(\", \"));\r\n return Namespace.prototype.resolveAll.call(this);\r\n};\r\n\r\n// only uppercased (and thus conflict-free) children are exposed, see below\r\nvar exposeRe = /^[A-Z]/;\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Root} root Root instance\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction tryHandleExtension(root, field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRoot.prototype._handleAdd = function _handleAdd(object) {\r\n if (object instanceof Field) {\r\n\r\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\r\n if (!tryHandleExtension(this, object))\r\n this.deferred.push(object);\r\n\r\n } else if (object instanceof Enum) {\r\n\r\n if (exposeRe.test(object.name))\r\n object.parent[object.name] = object.values; // expose enum values as property of its parent\r\n\r\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\r\n\r\n if (object instanceof Type) // Try to handle any deferred extensions\r\n for (var i = 0; i < this.deferred.length;)\r\n if (tryHandleExtension(this, this.deferred[i]))\r\n this.deferred.splice(i, 1);\r\n else\r\n ++i;\r\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\r\n this._handleAdd(object._nestedArray[j]);\r\n if (exposeRe.test(object.name))\r\n object.parent[object.name] = object; // expose namespace as property of its parent\r\n }\r\n\r\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\r\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\r\n // a static module with reflection-based solutions where the condition is met.\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRoot.prototype._handleRemove = function _handleRemove(object) {\r\n if (object instanceof Field) {\r\n\r\n if (/* an extension field */ object.extend !== undefined) {\r\n if (/* already handled */ object.extensionField) { // remove its sister field\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n } else { // cancel the extension\r\n var index = this.deferred.indexOf(object);\r\n /* istanbul ignore else */\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n }\r\n\r\n } else if (object instanceof Enum) {\r\n\r\n if (exposeRe.test(object.name))\r\n delete object.parent[object.name]; // unexpose enum values\r\n\r\n } else if (object instanceof Namespace) {\r\n\r\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\r\n this._handleRemove(object._nestedArray[i]);\r\n\r\n if (exposeRe.test(object.name))\r\n delete object.parent[object.name]; // unexpose namespaces\r\n\r\n }\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nRoot._configure = function(Type_, parse_, common_) {\r\n Type = Type_;\r\n parse = parse_;\r\n common = common_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = {};\r\n\r\n/**\r\n * Named roots.\r\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\r\n * Can also be used manually to make roots available accross modules.\r\n * @name roots\r\n * @type {Object.}\r\n * @example\r\n * // pbjs -r myroot -o compiled.js ...\r\n *\r\n * // in another module:\r\n * require(\"./compiled.js\");\r\n *\r\n * // in any subsequent module:\r\n * var root = protobuf.roots[\"myroot\"];\r\n */\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCImplCallback} callback Callback function\r\n * @returns {undefined}\r\n * @example\r\n * function rpcImpl(method, requestData, callback) {\r\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\r\n * throw Error(\"no such method\");\r\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\r\n * callback(err, responseData);\r\n * });\r\n * }\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCImplCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\nrpc.Service = require(29);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar util = require(35);\r\n\r\n// Extends EventEmitter\r\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\r\n\r\n/**\r\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\r\n *\r\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\r\n * @typedef rpc.ServiceMethodCallback\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {TRes} [response] Response message\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\r\n * @typedef rpc.ServiceMethod\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\r\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\r\n */\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @exports rpc.Service\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n */\r\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\r\n\r\n if (typeof rpcImpl !== \"function\")\r\n throw TypeError(\"rpcImpl must be a function\");\r\n\r\n util.EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` once the service is ended.\r\n * @type {RPCImpl|null}\r\n */\r\n this.rpcImpl = rpcImpl;\r\n\r\n /**\r\n * Whether requests are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.requestDelimited = Boolean(requestDelimited);\r\n\r\n /**\r\n * Whether responses are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.responseDelimited = Boolean(responseDelimited);\r\n}\r\n\r\n/**\r\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\r\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\r\n * @param {Constructor} requestCtor Request constructor\r\n * @param {Constructor} responseCtor Response constructor\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} callback Service callback\r\n * @returns {undefined}\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n */\r\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\r\n\r\n if (!request)\r\n throw TypeError(\"request must be specified\");\r\n\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\r\n\r\n if (!self.rpcImpl) {\r\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\r\n return undefined;\r\n }\r\n\r\n try {\r\n return self.rpcImpl(\r\n method,\r\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\r\n function rpcCallback(err, response) {\r\n\r\n if (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n\r\n if (response === null) {\r\n self.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n\r\n if (!(response instanceof responseCtor)) {\r\n try {\r\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n }\r\n\r\n self.emit(\"data\", response, method);\r\n return callback(null, response);\r\n }\r\n );\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n setTimeout(function() { callback(err); }, 0);\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nService.prototype.end = function end(endedByRPC) {\r\n if (this.rpcImpl) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.rpcImpl(null, null, null);\r\n this.rpcImpl = null;\r\n this.emit(\"end\").off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\n// extends Namespace\r\nvar Namespace = require(21);\r\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\r\n\r\nvar Method = require(20),\r\n util = require(33),\r\n rpc = require(28);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {Method[]|null}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\n/**\r\n * Service descriptor.\r\n * @interface IService\r\n * @extends INamespace\r\n * @property {Object.} methods Method descriptors\r\n */\r\n\r\n/**\r\n * Constructs a service from a service descriptor.\r\n * @param {string} name Service name\r\n * @param {IService} json Service descriptor\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n /* istanbul ignore else */\r\n if (json.methods)\r\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\r\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\r\n if (json.nested)\r\n service.addJSON(json.nested);\r\n service.comment = json.comment;\r\n return service;\r\n};\r\n\r\n/**\r\n * Converts this service to a service descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IService} Service descriptor\r\n */\r\nService.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , inherited && inherited.options || undefined,\r\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\r\n \"nested\" , inherited && inherited.nested || undefined,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\nObject.defineProperty(Service.prototype, \"methodsArray\", {\r\n get: function() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.get = function get(name) {\r\n return this.methods[name]\r\n || Namespace.prototype.get.call(this, name);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.resolveAll = function resolveAll() {\r\n var methods = this.methodsArray;\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return Namespace.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.add = function add(object) {\r\n\r\n /* istanbul ignore if */\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n\r\n /* istanbul ignore if */\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\r\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\r\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\r\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\r\n m: method,\r\n q: method.resolvedRequestType.ctor,\r\n s: method.resolvedResponseType.ctor\r\n });\r\n }\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Type;\r\n\r\n// extends Namespace\r\nvar Namespace = require(21);\r\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\r\n\r\nvar Enum = require(14),\r\n OneOf = require(23),\r\n Field = require(15),\r\n MapField = require(18),\r\n Service = require(30),\r\n Message = require(19),\r\n Reader = require(24),\r\n Writer = require(38),\r\n util = require(33),\r\n encoder = require(13),\r\n decoder = require(12),\r\n verifier = require(36),\r\n converter = require(11),\r\n wrappers = require(37);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object.} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {Array.}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /*?\r\n * Whether this type is a legacy group.\r\n * @type {boolean|undefined}\r\n */\r\n this.group = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {Object.|null}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {Field[]|null}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {OneOf[]|null}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {Constructor<{}>}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nObject.defineProperties(Type.prototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function() {\r\n\r\n /* istanbul ignore if */\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n\r\n this._fieldsById = {};\r\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n\r\n /* istanbul ignore if */\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\r\n * @name Type#ctor\r\n * @type {Constructor<{}>}\r\n */\r\n ctor: {\r\n get: function() {\r\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\r\n },\r\n set: function(ctor) {\r\n\r\n // Ensure proper prototype\r\n var prototype = ctor.prototype;\r\n if (!(prototype instanceof Message)) {\r\n (ctor.prototype = new Message()).constructor = ctor;\r\n util.merge(ctor.prototype, prototype);\r\n }\r\n\r\n // Classes and messages reference their reflected type\r\n ctor.$type = ctor.prototype.$type = this;\r\n\r\n // Mix in static methods\r\n util.merge(ctor, Message, true);\r\n\r\n this._ctor = ctor;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n var i = 0;\r\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\r\n this._fieldsArray[i].resolve(); // ensures a proper value\r\n\r\n // Messages have non-enumerable getters and setters for each virtual oneof field\r\n var ctorProperties = {};\r\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\r\n ctorProperties[this._oneofsArray[i].resolve().name] = {\r\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\r\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\r\n };\r\n if (i)\r\n Object.defineProperties(ctor.prototype, ctorProperties);\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Generates a constructor function for the specified type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nType.generateConstructor = function generateConstructor(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var gen = util.codegen([\"p\"], mtype.name);\r\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\r\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\r\n if ((field = mtype._fieldsArray[i]).map) gen\r\n (\"this%s={}\", util.safeProp(field.name));\r\n else if (field.repeated) gen\r\n (\"this%s=[]\", util.safeProp(field.name));\r\n return gen\r\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\r\n * @property {Object.} fields Field descriptors\r\n * @property {number[][]} [extensions] Extension ranges\r\n * @property {number[][]} [reserved] Reserved ranges\r\n * @property {boolean} [group=false] Whether a legacy group or not\r\n */\r\n\r\n/**\r\n * Creates a message type from a message type descriptor.\r\n * @param {string} name Message name\r\n * @param {IType} json Message type descriptor\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n var names = Object.keys(json.fields),\r\n i = 0;\r\n for (; i < names.length; ++i)\r\n type.add(\r\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\r\n ? MapField.fromJSON\r\n : Field.fromJSON )(names[i], json.fields[names[i]])\r\n );\r\n if (json.oneofs)\r\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\r\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\r\n if (json.nested)\r\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\r\n var nested = json.nested[names[i]];\r\n type.add( // most to least likely\r\n ( nested.id !== undefined\r\n ? Field.fromJSON\r\n : nested.fields !== undefined\r\n ? Type.fromJSON\r\n : nested.values !== undefined\r\n ? Enum.fromJSON\r\n : nested.methods !== undefined\r\n ? Service.fromJSON\r\n : Namespace.fromJSON )(names[i], nested)\r\n );\r\n }\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n if (json.group)\r\n type.group = true;\r\n if (json.comment)\r\n type.comment = json.comment;\r\n return type;\r\n};\r\n\r\n/**\r\n * Converts this message type to a message type descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IType} Message type descriptor\r\n */\r\nType.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , inherited && inherited.options || undefined,\r\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\r\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\r\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\r\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\r\n \"group\" , this.group || undefined,\r\n \"nested\" , inherited && inherited.nested || undefined,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nType.prototype.resolveAll = function resolveAll() {\r\n var fields = this.fieldsArray, i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.oneofsArray; i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return Namespace.prototype.resolveAll.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nType.prototype.get = function get(name) {\r\n return this.fields[name]\r\n || this.oneofs && this.oneofs[name]\r\n || this.nested && this.nested[name]\r\n || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nType.prototype.add = function add(object) {\r\n\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n\r\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\r\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (this.isReservedId(object.id))\r\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\r\n if (this.isReservedName(object.name))\r\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\r\n\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nType.prototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n\r\n /* istanbul ignore if */\r\n if (!this.fields || this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.fields[object.name];\r\n object.parent = null;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n\r\n /* istanbul ignore if */\r\n if (!this.oneofs || this.oneofs[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.oneofs[object.name];\r\n object.parent = null;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nType.prototype.isReservedId = function isReservedId(id) {\r\n return Namespace.isReservedId(this.reserved, id);\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nType.prototype.isReservedName = function isReservedName(name) {\r\n return Namespace.isReservedName(this.reserved, name);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object.} [properties] Properties to set\r\n * @returns {Message<{}>} Message instance\r\n */\r\nType.prototype.create = function create(properties) {\r\n return new this.ctor(properties);\r\n};\r\n\r\n/**\r\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\r\n * @returns {Type} `this`\r\n */\r\nType.prototype.setup = function setup() {\r\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\r\n // multiple times (V8, soft-deopt prototype-check).\r\n\r\n var fullName = this.fullName,\r\n types = [];\r\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\r\n types.push(this._fieldsArray[i].resolve().resolvedType);\r\n\r\n // Replace setup methods with type-specific generated functions\r\n this.encode = encoder(this)({\r\n Writer : Writer,\r\n types : types,\r\n util : util\r\n });\r\n this.decode = decoder(this)({\r\n Reader : Reader,\r\n types : types,\r\n util : util\r\n });\r\n this.verify = verifier(this)({\r\n types : types,\r\n util : util\r\n });\r\n this.fromObject = converter.fromObject(this)({\r\n types : types,\r\n util : util\r\n });\r\n this.toObject = converter.toObject(this)({\r\n types : types,\r\n util : util\r\n });\r\n\r\n // Inject custom wrappers for common types\r\n var wrapper = wrappers[fullName];\r\n if (wrapper) {\r\n var originalThis = Object.create(this);\r\n // if (wrapper.fromObject) {\r\n originalThis.fromObject = this.fromObject;\r\n this.fromObject = wrapper.fromObject.bind(originalThis);\r\n // }\r\n // if (wrapper.toObject) {\r\n originalThis.toObject = this.toObject;\r\n this.toObject = wrapper.toObject.bind(originalThis);\r\n // }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\r\n * @param {Message<{}>|Object.} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nType.prototype.encode = function encode_setup(message, writer) {\r\n return this.setup().encode(message, writer); // overrides this method\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\r\n * @param {Message<{}>|Object.} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message<{}>} Decoded message\r\n * @throws {Error} If the payload is not a reader or valid buffer\r\n * @throws {util.ProtocolError<{}>} If required fields are missing\r\n */\r\nType.prototype.decode = function decode_setup(reader, length) {\r\n return this.setup().decode(reader, length); // overrides this method\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\r\n * @returns {Message<{}>} Decoded message\r\n * @throws {Error} If the payload is not a reader or valid buffer\r\n * @throws {util.ProtocolError} If required fields are missing\r\n */\r\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\r\n if (!(reader instanceof Reader))\r\n reader = Reader.create(reader);\r\n return this.decode(reader, reader.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that field values are valid and that required fields are present.\r\n * @param {Object.} message Plain object to verify\r\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\r\n */\r\nType.prototype.verify = function verify_setup(message) {\r\n return this.setup().verify(message); // overrides this method\r\n};\r\n\r\n/**\r\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\r\n * @param {Object.} object Plain object to convert\r\n * @returns {Message<{}>} Message instance\r\n */\r\nType.prototype.fromObject = function fromObject(object) {\r\n return this.setup().fromObject(object);\r\n};\r\n\r\n/**\r\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\r\n * @interface IConversionOptions\r\n * @property {Function} [longs] Long conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\r\n * @property {Function} [enums] Enum value conversion type.\r\n * Only valid value is `String` (the global type).\r\n * Defaults to copy the present value, which is the numeric id.\r\n * @property {Function} [bytes] Bytes value conversion type.\r\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\r\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\r\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\r\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\r\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\r\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\r\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\r\n */\r\n\r\n/**\r\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\r\n * @param {Message<{}>} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n */\r\nType.prototype.toObject = function toObject(message, options) {\r\n return this.setup().toObject(message, options);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link Type.d} (TypeScript).\r\n * @typedef TypeDecorator\r\n * @type {function}\r\n * @param {Constructor} target Target constructor\r\n * @returns {undefined}\r\n * @template T extends Message\r\n */\r\n\r\n/**\r\n * Type decorator (TypeScript).\r\n * @param {string} [typeName] Type name, defaults to the constructor's name\r\n * @returns {TypeDecorator} Decorator function\r\n * @template T extends Message\r\n */\r\nType.d = function decorateType(typeName) {\r\n return function typeDecorator(target) {\r\n util.decorateType(target, typeName);\r\n };\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(33);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=1 Fixed64 wire type\r\n * @property {number} float=5 Fixed32 wire type\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n * @property {number} string=2 Ldelim wire type\r\n * @property {number} bytes=2 Ldelim wire type\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=0 Double default\r\n * @property {number} float=0 Float default\r\n * @property {number} int32=0 Int32 default\r\n * @property {number} uint32=0 Uint32 default\r\n * @property {number} sint32=0 Sint32 default\r\n * @property {number} fixed32=0 Fixed32 default\r\n * @property {number} sfixed32=0 Sfixed32 default\r\n * @property {number} int64=0 Int64 default\r\n * @property {number} uint64=0 Uint64 default\r\n * @property {number} sint64=0 Sint32 default\r\n * @property {number} fixed64=0 Fixed64 default\r\n * @property {number} sfixed64=0 Sfixed64 default\r\n * @property {boolean} bool=false Bool default\r\n * @property {string} string=\"\" String default\r\n * @property {Array.} bytes=Array(0) Bytes default\r\n * @property {null} message=null Message default\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray,\r\n /* message */ null\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n * @property {number} string=2 Ldelim wire type\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=1 Fixed64 wire type\r\n * @property {number} float=5 Fixed32 wire type\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = module.exports = require(35);\r\n\r\nvar roots = require(27);\r\n\r\nvar Type, // cyclic\r\n Enum;\r\n\r\nutil.codegen = require(3);\r\nutil.fetch = require(5);\r\nutil.path = require(8);\r\n\r\n/**\r\n * Node's fs module if available.\r\n * @type {Object.}\r\n */\r\nutil.fs = util.inquire(\"fs\");\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (object) {\r\n var keys = Object.keys(object),\r\n array = new Array(keys.length),\r\n index = 0;\r\n while (index < keys.length)\r\n array[index] = object[keys[index++]];\r\n return array;\r\n }\r\n return [];\r\n};\r\n\r\n/**\r\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\r\n * @param {Array.<*>} array Array to convert\r\n * @returns {Object.} Converted object\r\n */\r\nutil.toObject = function toObject(array) {\r\n var object = {},\r\n index = 0;\r\n while (index < array.length) {\r\n var key = array[index++],\r\n val = array[index++];\r\n if (val !== undefined)\r\n object[key] = val;\r\n }\r\n return object;\r\n};\r\n\r\nvar safePropBackslashRe = /\\\\/g,\r\n safePropQuoteRe = /\"/g;\r\n\r\n/**\r\n * Tests whether the specified name is a reserved word in JS.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nutil.isReserved = function isReserved(name) {\r\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified property name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\r\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\r\n return \".\" + prop;\r\n};\r\n\r\n/**\r\n * Converts the first character of a string to upper case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.ucFirst = function ucFirst(str) {\r\n return str.charAt(0).toUpperCase() + str.substring(1);\r\n};\r\n\r\nvar camelCaseRe = /_([a-z])/g;\r\n\r\n/**\r\n * Converts a string to camel case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0, 1)\r\n + str.substring(1)\r\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Compares reflected fields by id.\r\n * @param {Field} a First field\r\n * @param {Field} b Second field\r\n * @returns {number} Comparison value\r\n */\r\nutil.compareFieldsById = function compareFieldsById(a, b) {\r\n return a.id - b.id;\r\n};\r\n\r\n/**\r\n * Decorator helper for types (TypeScript).\r\n * @param {Constructor} ctor Constructor function\r\n * @param {string} [typeName] Type name, defaults to the constructor's name\r\n * @returns {Type} Reflected type\r\n * @template T extends Message\r\n * @property {Root} root Decorators root\r\n */\r\nutil.decorateType = function decorateType(ctor, typeName) {\r\n\r\n /* istanbul ignore if */\r\n if (ctor.$type) {\r\n if (typeName && ctor.$type.name !== typeName) {\r\n util.decorateRoot.remove(ctor.$type);\r\n ctor.$type.name = typeName;\r\n util.decorateRoot.add(ctor.$type);\r\n }\r\n return ctor.$type;\r\n }\r\n\r\n /* istanbul ignore next */\r\n if (!Type)\r\n Type = require(31);\r\n\r\n var type = new Type(typeName || ctor.name);\r\n util.decorateRoot.add(type);\r\n type.ctor = ctor; // sets up .encode, .decode etc.\r\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\r\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\r\n return type;\r\n};\r\n\r\nvar decorateEnumIndex = 0;\r\n\r\n/**\r\n * Decorator helper for enums (TypeScript).\r\n * @param {Object} object Enum object\r\n * @returns {Enum} Reflected enum\r\n */\r\nutil.decorateEnum = function decorateEnum(object) {\r\n\r\n /* istanbul ignore if */\r\n if (object.$type)\r\n return object.$type;\r\n\r\n /* istanbul ignore next */\r\n if (!Enum)\r\n Enum = require(14);\r\n\r\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\r\n util.decorateRoot.add(enm);\r\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\r\n return enm;\r\n};\r\n\r\n/**\r\n * Decorator root (TypeScript).\r\n * @name util.decorateRoot\r\n * @type {Root}\r\n * @readonly\r\n */\r\nObject.defineProperty(util, \"decorateRoot\", {\r\n get: function() {\r\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(26))());\r\n }\r\n});\r\n","\"use strict\";\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(35);\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low 32 bits, unsigned\r\n * @param {number} hi High 32 bits, unsigned\r\n */\r\nfunction LongBits(lo, hi) {\r\n\r\n // note that the casts below are theoretically unnecessary as of today, but older statically\r\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo >>> 0;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi >>> 0;\r\n}\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Zero hash.\r\n * @memberof util.LongBits\r\n * @type {string}\r\n */\r\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n if (sign)\r\n value = -value;\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n if (typeof value === \"number\")\r\n return LongBits.fromNumber(value);\r\n if (util.isString(value)) {\r\n /* istanbul ignore else */\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBits.prototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n var lo = ~this.lo + 1 >>> 0,\r\n hi = ~this.hi >>> 0;\r\n if (!lo)\r\n hi = hi + 1 >>> 0;\r\n return -(lo + hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBits.prototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\r\n /* istanbul ignore next */\r\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n if (hash === zeroHash)\r\n return zero;\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBits.prototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 ,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBits.prototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n return part2 === 0\r\n ? part1 === 0\r\n ? part0 < 16384\r\n ? part0 < 128 ? 1 : 2\r\n : part0 < 2097152 ? 3 : 4\r\n : part1 < 16384\r\n ? part1 < 128 ? 5 : 6\r\n : part1 < 2097152 ? 7 : 8\r\n : part2 < 128 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nvar util = exports;\r\n\r\n// used to return a Promise where callback is omitted\r\nutil.asPromise = require(1);\r\n\r\n// converts to / from base64 encoded strings\r\nutil.base64 = require(2);\r\n\r\n// base class of rpc.Service\r\nutil.EventEmitter = require(4);\r\n\r\n// float handling accross browsers\r\nutil.float = require(6);\r\n\r\n// requires modules optionally and hides the call from bundlers\r\nutil.inquire = require(7);\r\n\r\n// converts to / from utf8 encoded strings\r\nutil.utf8 = require(10);\r\n\r\n// provides a node-like buffer pool in the browser\r\nutil.pool = require(9);\r\n\r\n// utility to work with the low and high bits of a 64 bit value\r\nutil.LongBits = require(34);\r\n\r\n// global object reference\r\nutil.global = typeof window !== \"undefined\" && window\r\n || typeof global !== \"undefined\" && global\r\n || typeof self !== \"undefined\" && self\r\n || this; // eslint-disable-line no-invalid-this\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n * @const\r\n */\r\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n * @const\r\n */\r\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n * @const\r\n */\r\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\r\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === \"string\" || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return value && typeof value === \"object\";\r\n};\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * This is an alias of {@link util.isSet}.\r\n * @function\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isset =\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isSet = function isSet(obj, prop) {\r\n var value = obj[prop];\r\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\r\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\r\n return false;\r\n};\r\n\r\n/**\r\n * Any compatible Buffer instance.\r\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\r\n * @interface Buffer\r\n * @extends Uint8Array\r\n */\r\n\r\n/**\r\n * Node's Buffer class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Buffer = (function() {\r\n try {\r\n var Buffer = util.inquire(\"buffer\").Buffer;\r\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\r\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n return null;\r\n }\r\n})();\r\n\r\n// Internal alias of or polyfull for Buffer.from.\r\nutil._Buffer_from = null;\r\n\r\n// Internal alias of or polyfill for Buffer.allocUnsafe.\r\nutil._Buffer_allocUnsafe = null;\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\r\n * @returns {Uint8Array|Buffer} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(sizeOrArray) {\r\n /* istanbul ignore next */\r\n return typeof sizeOrArray === \"number\"\r\n ? util.Buffer\r\n ? util._Buffer_allocUnsafe(sizeOrArray)\r\n : new util.Array(sizeOrArray)\r\n : util.Buffer\r\n ? util._Buffer_from(sizeOrArray)\r\n : typeof Uint8Array === \"undefined\"\r\n ? sizeOrArray\r\n : new Uint8Array(sizeOrArray);\r\n};\r\n\r\n/**\r\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\r\n * @type {Constructor}\r\n */\r\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\r\n * @interface Long\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Long.js's Long class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\r\n || /* istanbul ignore next */ util.global.Long\r\n || util.inquire(\"long\");\r\n\r\n/**\r\n * Regular expression used to verify 2 bit (`bool`) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key2Re = /^true|false|0|1$/;\r\n\r\n/**\r\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\r\n\r\n/**\r\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? util.LongBits.from(value).toHash()\r\n : util.LongBits.zeroHash;\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = util.LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @memberof util\r\n * @param {Object.} dst Destination object\r\n * @param {Object.} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object.} Destination object\r\n */\r\nfunction merge(dst, src, ifNotSet) { // used by converters\r\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n return dst;\r\n}\r\n\r\nutil.merge = merge;\r\n\r\n/**\r\n * Converts the first character of a string to lower case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.lcFirst = function lcFirst(str) {\r\n return str.charAt(0).toLowerCase() + str.substring(1);\r\n};\r\n\r\n/**\r\n * Creates a custom error constructor.\r\n * @memberof util\r\n * @param {string} name Error name\r\n * @returns {Constructor} Custom error constructor\r\n */\r\nfunction newError(name) {\r\n\r\n function CustomError(message, properties) {\r\n\r\n if (!(this instanceof CustomError))\r\n return new CustomError(message, properties);\r\n\r\n // Error.call(this, message);\r\n // ^ just returns a new error instance because the ctor can be called as a function\r\n\r\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\r\n\r\n /* istanbul ignore next */\r\n if (Error.captureStackTrace) // node\r\n Error.captureStackTrace(this, CustomError);\r\n else\r\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\r\n\r\n if (properties)\r\n merge(this, properties);\r\n }\r\n\r\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\r\n\r\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\r\n\r\n CustomError.prototype.toString = function toString() {\r\n return this.name + \": \" + this.message;\r\n };\r\n\r\n return CustomError;\r\n}\r\n\r\nutil.newError = newError;\r\n\r\n/**\r\n * Constructs a new protocol error.\r\n * @classdesc Error subclass indicating a protocol specifc error.\r\n * @memberof util\r\n * @extends Error\r\n * @template T extends Message\r\n * @constructor\r\n * @param {string} message Error message\r\n * @param {Object.} [properties] Additional properties\r\n * @example\r\n * try {\r\n * MyMessage.decode(someBuffer); // throws if required fields are missing\r\n * } catch (e) {\r\n * if (e instanceof ProtocolError && e.instance)\r\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\r\n * }\r\n */\r\nutil.ProtocolError = newError(\"ProtocolError\");\r\n\r\n/**\r\n * So far decoded message instance.\r\n * @name util.ProtocolError#instance\r\n * @type {Message}\r\n */\r\n\r\n/**\r\n * A OneOf getter as returned by {@link util.oneOfGetter}.\r\n * @typedef OneOfGetter\r\n * @type {function}\r\n * @returns {string|undefined} Set field name, if any\r\n */\r\n\r\n/**\r\n * Builds a getter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfGetter} Unbound getter\r\n */\r\nutil.oneOfGetter = function getOneOf(fieldNames) {\r\n var fieldMap = {};\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n fieldMap[fieldNames[i]] = 1;\r\n\r\n /**\r\n * @returns {string|undefined} Set field name, if any\r\n * @this Object\r\n * @ignore\r\n */\r\n return function() { // eslint-disable-line consistent-return\r\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\r\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\r\n return keys[i];\r\n };\r\n};\r\n\r\n/**\r\n * A OneOf setter as returned by {@link util.oneOfSetter}.\r\n * @typedef OneOfSetter\r\n * @type {function}\r\n * @param {string|undefined} value Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Builds a setter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfSetter} Unbound setter\r\n */\r\nutil.oneOfSetter = function setOneOf(fieldNames) {\r\n\r\n /**\r\n * @param {string} name Field name\r\n * @returns {undefined}\r\n * @this Object\r\n * @ignore\r\n */\r\n return function(name) {\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n if (fieldNames[i] !== name)\r\n delete this[fieldNames[i]];\r\n };\r\n};\r\n\r\n/**\r\n * Default conversion options used for {@link Message#toJSON} implementations.\r\n *\r\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\r\n *\r\n * - Longs become strings\r\n * - Enums become string keys\r\n * - Bytes become base64 encoded strings\r\n * - (Sub-)Messages become plain objects\r\n * - Maps become plain objects with all string keys\r\n * - Repeated fields become arrays\r\n * - NaN and Infinity for float and double fields become strings\r\n *\r\n * @type {IConversionOptions}\r\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\r\n */\r\nutil.toJSONOptions = {\r\n longs: String,\r\n enums: String,\r\n bytes: String,\r\n json: true\r\n};\r\n\r\n// Sets up buffer utility according to the environment (called in index-minimal)\r\nutil._configure = function() {\r\n var Buffer = util.Buffer;\r\n /* istanbul ignore if */\r\n if (!Buffer) {\r\n util._Buffer_from = util._Buffer_allocUnsafe = null;\r\n return;\r\n }\r\n // because node 4.x buffers are incompatible & immutable\r\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\r\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\r\n /* istanbul ignore next */\r\n function Buffer_from(value, encoding) {\r\n return new Buffer(value, encoding);\r\n };\r\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\r\n /* istanbul ignore next */\r\n function Buffer_allocUnsafe(size) {\r\n return new Buffer(size);\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = verifier;\r\n\r\nvar Enum = require(14),\r\n util = require(33);\r\n\r\nfunction invalid(field, expected) {\r\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\r\n}\r\n\r\n/**\r\n * Generates a partial value verifier.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {number} fieldIndex Field index\r\n * @param {string} ref Variable reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n if (field.resolvedType) {\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(%s){\", ref)\r\n (\"default:\")\r\n (\"return%j\", invalid(field, \"enum value\"));\r\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\r\n (\"case %i:\", field.resolvedType.values[keys[j]]);\r\n gen\r\n (\"break\")\r\n (\"}\");\r\n } else {\r\n gen\r\n (\"{\")\r\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\r\n (\"if(e)\")\r\n (\"return%j+e\", field.name + \".\")\r\n (\"}\");\r\n }\r\n } else {\r\n switch (field.type) {\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.isInteger(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\r\n (\"return%j\", invalid(field, \"integer|Long\"));\r\n break;\r\n case \"float\":\r\n case \"double\": gen\r\n (\"if(typeof %s!==\\\"number\\\")\", ref)\r\n (\"return%j\", invalid(field, \"number\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\r\n (\"return%j\", invalid(field, \"boolean\"));\r\n break;\r\n case \"string\": gen\r\n (\"if(!util.isString(%s))\", ref)\r\n (\"return%j\", invalid(field, \"string\"));\r\n break;\r\n case \"bytes\": gen\r\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\r\n (\"return%j\", invalid(field, \"buffer\"));\r\n break;\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a partial key verifier.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {string} ref Variable reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genVerifyKey(gen, field, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n switch (field.keyType) {\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.key32Re.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer key\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\r\n (\"return%j\", invalid(field, \"integer|Long key\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(!util.key2Re.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"boolean key\"));\r\n break;\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a verifier specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nfunction verifier(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n\r\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\r\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\r\n (\"return%j\", \"object expected\");\r\n var oneofs = mtype.oneofsArray,\r\n seenFirstField = {};\r\n if (oneofs.length) gen\r\n (\"var p={}\");\r\n\r\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\r\n var field = mtype._fieldsArray[i].resolve(),\r\n ref = \"m\" + util.safeProp(field.name);\r\n\r\n if (field.optional) gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\r\n\r\n // map fields\r\n if (field.map) { gen\r\n (\"if(!util.isObject(%s))\", ref)\r\n (\"return%j\", invalid(field, \"object\"))\r\n (\"var k=Object.keys(%s)\", ref)\r\n (\"for(var i=0;i}\r\n * @const\r\n */\r\nvar wrappers = exports;\r\n\r\nvar Message = require(19);\r\n\r\n/**\r\n * From object converter part of an {@link IWrapper}.\r\n * @typedef WrapperFromObjectConverter\r\n * @type {function}\r\n * @param {Object.} object Plain object\r\n * @returns {Message<{}>} Message instance\r\n * @this Type\r\n */\r\n\r\n/**\r\n * To object converter part of an {@link IWrapper}.\r\n * @typedef WrapperToObjectConverter\r\n * @type {function}\r\n * @param {Message<{}>} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n * @this Type\r\n */\r\n\r\n/**\r\n * Common type wrapper part of {@link wrappers}.\r\n * @interface IWrapper\r\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\r\n * @property {WrapperToObjectConverter} [toObject] To object converter\r\n */\r\n\r\n// Custom wrapper for Any\r\nwrappers[\".google.protobuf.Any\"] = {\r\n\r\n fromObject: function(object) {\r\n\r\n // unwrap value type if mapped\r\n if (object && object[\"@type\"]) {\r\n var type = this.lookup(object[\"@type\"]);\r\n /* istanbul ignore else */\r\n if (type) {\r\n // type_url does not accept leading \".\"\r\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\r\n object[\"@type\"].substr(1) : object[\"@type\"];\r\n // type_url prefix is optional, but path seperator is required\r\n return this.create({\r\n type_url: \"/\" + type_url,\r\n value: type.encode(type.fromObject(object)).finish()\r\n });\r\n }\r\n }\r\n\r\n return this.fromObject(object);\r\n },\r\n\r\n toObject: function(message, options) {\r\n\r\n // decode value if requested and unmapped\r\n if (options && options.json && message.type_url && message.value) {\r\n // Only use fully qualified type name after the last '/'\r\n var name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\r\n var type = this.lookup(name);\r\n /* istanbul ignore else */\r\n if (type)\r\n message = type.decode(message.value);\r\n }\r\n\r\n // wrap value if unmapped\r\n if (!(message instanceof this.ctor) && message instanceof Message) {\r\n var object = message.$type.toObject(message, options);\r\n object[\"@type\"] = message.$type.fullName;\r\n return object;\r\n }\r\n\r\n return this.toObject(message, options);\r\n }\r\n};\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nvar util = require(35);\r\n\r\nvar BufferWriter; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n base64 = util.base64,\r\n utf8 = util.utf8;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @constructor\r\n * @param {function(*, Uint8Array, number)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {*} val Value to write\r\n * @ignore\r\n */\r\nfunction Op(fn, len, val) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {Writer.Op|undefined}\r\n */\r\n this.next = undefined;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val; // type varies\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @ignore\r\n */\r\nfunction State(writer) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {State|null}\r\n */\r\n this.next = writer.states;\r\n}\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {Object|null}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @function\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = util.Buffer\r\n ? function create_buffer_setup() {\r\n return (Writer.create = function create_buffer() {\r\n return new BufferWriter();\r\n })();\r\n }\r\n /* istanbul ignore next */\r\n : function create_array() {\r\n return new Writer();\r\n };\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new util.Array(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\n/* istanbul ignore else */\r\nif (util.Array !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n * @private\r\n */\r\nWriter.prototype._push = function push(fn, len, val) {\r\n this.tail = this.tail.next = new Op(fn, len, val);\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(val, buf, pos) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\nfunction writeVarint32(val, buf, pos) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Constructs a new varint writer operation instance.\r\n * @classdesc Scheduled varint writer operation.\r\n * @extends Op\r\n * @constructor\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @ignore\r\n */\r\nfunction VarintOp(len, val) {\r\n this.len = len;\r\n this.next = undefined;\r\n this.val = val;\r\n}\r\n\r\nVarintOp.prototype = Object.create(Op.prototype);\r\nVarintOp.prototype.fn = writeVarint32;\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.uint32 = function write_uint32(value) {\r\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\r\n // uint32 is by far the most frequently used operation and benefits significantly from this.\r\n this.len += (this.tail = this.tail.next = new VarintOp(\r\n (value = value >>> 0)\r\n < 128 ? 1\r\n : value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5,\r\n value)).len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sint32 = function write_sint32(value) {\r\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\r\n};\r\n\r\nfunction writeVarint64(val, buf, pos) {\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.int64 = Writer.prototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bool = function write_bool(value) {\r\n return this._push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fixed32 = function write_fixed32(value) {\r\n return this._push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as fixed 32 bits.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as fixed 64 bits.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.float = function write_float(value) {\r\n return this._push(util.float.writeFloatLE, 4, value);\r\n};\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.double = function write_double(value) {\r\n return this._push(util.float.writeDoubleLE, 8, value);\r\n};\r\n\r\nvar writeBytes = util.Array.prototype.set\r\n ? function writeBytes_set(val, buf, pos) {\r\n buf.set(val, pos); // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytes_for(val, buf, pos) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (!len)\r\n return this._push(writeByte, 1, 0);\r\n if (util.isString(value)) {\r\n var buf = Writer.alloc(len = base64.length(value));\r\n base64.decode(value, buf, 0);\r\n value = buf;\r\n }\r\n return this.uint32(len)._push(writeBytes, len, value);\r\n};\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.string = function write_string(value) {\r\n var len = utf8.length(value);\r\n return len\r\n ? this.uint32(len)._push(utf8.write, len, value)\r\n : this._push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fork = function fork() {\r\n this.states = new State(this);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.ldelim = function ldelim() {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset().uint32(len);\r\n if (len) {\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriter.prototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len),\r\n pos = 0;\r\n while (head) {\r\n head.fn(head.val, buf, pos);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n // this.head = this.tail = null;\r\n return buf;\r\n};\r\n\r\nWriter._configure = function(BufferWriter_) {\r\n BufferWriter = BufferWriter_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferWriter;\r\n\r\n// extends Writer\r\nvar Writer = require(38);\r\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\r\n\r\nvar util = require(35);\r\n\r\nvar Buffer = util.Buffer;\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Buffer} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\r\n};\r\n\r\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\r\n ? function writeBytesBuffer_set(val, buf, pos) {\r\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\r\n // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytesBuffer_copy(val, buf, pos) {\r\n if (val.copy) // Buffer values\r\n val.copy(buf, pos, 0, val.length);\r\n else for (var i = 0; i < val.length;) // plain array values\r\n buf[pos++] = val[i++];\r\n };\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\r\n if (util.isString(value))\r\n value = util._Buffer_from(value, \"base64\");\r\n var len = value.length >>> 0;\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeBytesBuffer, len, value);\r\n return this;\r\n};\r\n\r\nfunction writeStringBuffer(val, buf, pos) {\r\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\r\n util.utf8.write(val, buf, pos);\r\n else\r\n buf.utf8Write(val, pos);\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.string = function write_string_buffer(value) {\r\n var len = Buffer.byteLength(value);\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeStringBuffer, len, value);\r\n return this;\r\n};\r\n\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @name BufferWriter#finish\r\n * @function\r\n * @returns {Buffer} Finished buffer\r\n */\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/node_modules/protobufjs/dist/minimal/README.md b/node_modules/protobufjs/dist/minimal/README.md new file mode 100644 index 0000000..5eeb571 --- /dev/null +++ b/node_modules/protobufjs/dist/minimal/README.md @@ -0,0 +1,31 @@ +This folder contains prebuilt browser versions of the minimal library suitable for use with statically generated code only. When sending pull requests, it is not required to update these. + +Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: + +CDN usage +--------- + +Development: +``` + +``` + +Production: +``` + +``` + +**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +Frontend usage +-------------- + +Development: +``` + +``` + +Production: +``` + +``` diff --git a/node_modules/protobufjs/dist/minimal/protobuf.js b/node_modules/protobufjs/dist/minimal/protobuf.js new file mode 100644 index 0000000..8cda8ce --- /dev/null +++ b/node_modules/protobufjs/dist/minimal/protobuf.js @@ -0,0 +1,2684 @@ +/*! + * protobuf.js v6.8.8 (c) 2016, daniel wirtz + * compiled thu, 19 jul 2018 00:33:25 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +(function(undefined){"use strict";(function prelude(modules, cache, entries) { + + // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS + // sources through a conflict-free require shim and is again wrapped within an iife that + // provides a minification-friendly `undefined` var plus a global "use strict" directive + // so that minification can remove the directives of each module. + + function $require(name) { + var $module = cache[name]; + if (!$module) + modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); + return $module.exports; + } + + var protobuf = $require(entries[0]); + + // Expose globally + protobuf.util.global.protobuf = protobuf; + + // Be nice to AMD + if (typeof define === "function" && define.amd) + define(["long"], function(Long) { + if (Long && Long.isLong) { + protobuf.util.Long = Long; + protobuf.configure(); + } + return protobuf; + }); + + // Be nice to CommonJS + if (typeof module === "object" && module && module.exports) + module.exports = protobuf; + +})/* end of prelude */({1:[function(require,module,exports){ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + +},{}],2:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + +},{}],3:[function(require,module,exports){ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + +},{}],4:[function(require,module,exports){ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + +},{}],5:[function(require,module,exports){ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + +},{}],6:[function(require,module,exports){ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +},{}],7:[function(require,module,exports){ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + +},{}],8:[function(require,module,exports){ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require(16); +protobuf.BufferWriter = require(17); +protobuf.Reader = require(9); +protobuf.BufferReader = require(10); + +// Utility +protobuf.util = require(15); +protobuf.rpc = require(12); +protobuf.roots = require(11); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.Reader._configure(protobuf.BufferReader); + protobuf.util._configure(); +} + +// Set up buffer utility according to the environment +protobuf.Writer._configure(protobuf.BufferWriter); +configure(); + +},{"10":10,"11":11,"12":12,"15":15,"16":16,"17":17,"9":9}],9:[function(require,module,exports){ +"use strict"; +module.exports = Reader; + +var util = require(15); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; + +},{"15":15}],10:[function(require,module,exports){ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require(9); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require(15); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +/* istanbul ignore else */ +if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + +},{"15":15,"9":9}],11:[function(require,module,exports){ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ + +},{}],12:[function(require,module,exports){ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require(13); + +},{"13":13}],13:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +var util = require(15); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; + +},{"15":15}],14:[function(require,module,exports){ +"use strict"; +module.exports = LongBits; + +var util = require(15); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; + +},{"15":15}],15:[function(require,module,exports){ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require(1); + +// converts to / from base64 encoded strings +util.base64 = require(2); + +// base class of rpc.Service +util.EventEmitter = require(3); + +// float handling accross browsers +util.float = require(4); + +// requires modules optionally and hides the call from bundlers +util.inquire = require(5); + +// converts to / from utf8 encoded strings +util.utf8 = require(7); + +// provides a node-like buffer pool in the browser +util.pool = require(6); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require(14); + +// global object reference +util.global = typeof window !== "undefined" && window + || typeof global !== "undefined" && global + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + * @const + */ +util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ + +/** + * Long.js's Long class if available. + * @type {Constructor} + */ +util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long"); + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; + +},{"1":1,"14":14,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7}],16:[function(require,module,exports){ +"use strict"; +module.exports = Writer; + +var util = require(15); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; +}; + +},{"15":15}],17:[function(require,module,exports){ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require(16); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require(15); + +var Buffer = util.Buffer; + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ +BufferWriter.alloc = function alloc_buffer(size) { + return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size); +}; + +var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else + buf.utf8Write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + +},{"15":15,"16":16}]},{},[8]) + +})(); +//# sourceMappingURL=protobuf.js.map diff --git a/node_modules/protobufjs/dist/minimal/protobuf.js.map b/node_modules/protobufjs/dist/minimal/protobuf.js.map new file mode 100644 index 0000000..c44c45b --- /dev/null +++ b/node_modules/protobufjs/dist/minimal/protobuf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/index-minimal","../src/reader.js","../src/reader_buffer.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/util/longbits.js","../src/util/minimal.js","../src/writer.js","../src/writer_buffer.js"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3cA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function prelude(modules, cache, entries) {\r\n\r\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\r\n // sources through a conflict-free require shim and is again wrapped within an iife that\r\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\r\n // so that minification can remove the directives of each module.\r\n\r\n function $require(name) {\r\n var $module = cache[name];\r\n if (!$module)\r\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\r\n return $module.exports;\r\n }\r\n\r\n var protobuf = $require(entries[0]);\r\n\r\n // Expose globally\r\n protobuf.util.global.protobuf = protobuf;\r\n\r\n // Be nice to AMD\r\n if (typeof define === \"function\" && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long && Long.isLong) {\r\n protobuf.util.Long = Long;\r\n protobuf.configure();\r\n }\r\n return protobuf;\r\n });\r\n\r\n // Be nice to CommonJS\r\n if (typeof module === \"object\" && module && module.exports)\r\n module.exports = protobuf;\r\n\r\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nvar protobuf = exports;\r\n\r\n/**\r\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\r\n * @name build\r\n * @type {string}\r\n * @const\r\n */\r\nprotobuf.build = \"minimal\";\r\n\r\n// Serialization\r\nprotobuf.Writer = require(16);\r\nprotobuf.BufferWriter = require(17);\r\nprotobuf.Reader = require(9);\r\nprotobuf.BufferReader = require(10);\r\n\r\n// Utility\r\nprotobuf.util = require(15);\r\nprotobuf.rpc = require(12);\r\nprotobuf.roots = require(11);\r\nprotobuf.configure = configure;\r\n\r\n/* istanbul ignore next */\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n protobuf.Reader._configure(protobuf.BufferReader);\r\n protobuf.util._configure();\r\n}\r\n\r\n// Set up buffer utility according to the environment\r\nprotobuf.Writer._configure(protobuf.BufferWriter);\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nvar util = require(15);\r\n\r\nvar BufferReader; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n utf8 = util.utf8;\r\n\r\n/* istanbul ignore next */\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n\r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\nvar create_array = typeof Uint8Array !== \"undefined\"\r\n ? function create_typed_array(buffer) {\r\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n }\r\n /* istanbul ignore next */\r\n : function create_array(buffer) {\r\n if (Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n };\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @function\r\n * @param {Uint8Array|Buffer} buffer Buffer to read from\r\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n * @throws {Error} If `buffer` is not a valid buffer\r\n */\r\nReader.create = util.Buffer\r\n ? function create_buffer_setup(buffer) {\r\n return (Reader.create = function create_buffer(buffer) {\r\n return util.Buffer.isBuffer(buffer)\r\n ? new BufferReader(buffer)\r\n /* istanbul ignore next */\r\n : create_array(buffer);\r\n })(buffer);\r\n }\r\n /* istanbul ignore next */\r\n : create_array;\r\n\r\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.uint32 = (function read_uint32_setup() {\r\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\r\n return function read_uint32() {\r\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n\r\n /* istanbul ignore if */\r\n if ((this.pos += 5) > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this, 10);\r\n }\r\n return value;\r\n };\r\n})();\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.int32 = function read_int32() {\r\n return this.uint32() | 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sint32 = function read_sint32() {\r\n var value = this.uint32();\r\n return value >>> 1 ^ -(value & 1) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n // tends to deopt with local vars for octet etc.\r\n var bits = new LongBits(0, 0);\r\n var i = 0;\r\n if (this.len - this.pos > 4) { // fast route (lo)\r\n for (; i < 4; ++i) {\r\n // 1st..4th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 5th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n i = 0;\r\n } else {\r\n for (; i < 3; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 1st..3th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 4th\r\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\r\n return bits;\r\n }\r\n if (this.len - this.pos > 4) { // fast route (hi)\r\n for (; i < 5; ++i) {\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n } else {\r\n for (; i < 5; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n }\r\n /* istanbul ignore next */\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReader.prototype.bool = function read_bool() {\r\n return this.uint32() !== 0;\r\n};\r\n\r\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\r\n return (buf[end - 4]\r\n | buf[end - 3] << 8\r\n | buf[end - 2] << 16\r\n | buf[end - 1] << 24) >>> 0;\r\n}\r\n\r\n/**\r\n * Reads fixed 32 bits as an unsigned 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.fixed32 = function read_fixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4);\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a signed 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sfixed32 = function read_sfixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readFixed64(/* this: Reader */) {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n\r\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.float = function read_float() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readFloatLE(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.double = function read_double() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readDoubleLE(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReader.prototype.bytes = function read_bytes() {\r\n var length = this.uint32(),\r\n start = this.pos,\r\n end = this.pos + length;\r\n\r\n /* istanbul ignore if */\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n\r\n this.pos += length;\r\n if (Array.isArray(this.buf)) // plain array\r\n return this.buf.slice(start, end);\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReader.prototype.string = function read_string() {\r\n var bytes = this.bytes();\r\n return utf8.read(bytes, 0, bytes.length);\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skip = function skip(length) {\r\n if (typeof length === \"number\") {\r\n /* istanbul ignore if */\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n } else {\r\n do {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n while ((wireType = this.uint32() & 7) !== 4) {\r\n this.skipType(wireType);\r\n }\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n\r\n /* istanbul ignore next */\r\n default:\r\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\r\n }\r\n return this;\r\n};\r\n\r\nReader._configure = function(BufferReader_) {\r\n BufferReader = BufferReader_;\r\n\r\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\r\n util.merge(Reader.prototype, {\r\n\r\n int64: function read_int64() {\r\n return readLongVarint.call(this)[fn](false);\r\n },\r\n\r\n uint64: function read_uint64() {\r\n return readLongVarint.call(this)[fn](true);\r\n },\r\n\r\n sint64: function read_sint64() {\r\n return readLongVarint.call(this).zzDecode()[fn](false);\r\n },\r\n\r\n fixed64: function read_fixed64() {\r\n return readFixed64.call(this)[fn](true);\r\n },\r\n\r\n sfixed64: function read_sfixed64() {\r\n return readFixed64.call(this)[fn](false);\r\n }\r\n\r\n });\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferReader;\r\n\r\n// extends Reader\r\nvar Reader = require(9);\r\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\r\n\r\nvar util = require(15);\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n Reader.call(this, buffer);\r\n\r\n /**\r\n * Read buffer.\r\n * @name BufferReader#buf\r\n * @type {Buffer}\r\n */\r\n}\r\n\r\n/* istanbul ignore else */\r\nif (util.Buffer)\r\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReader.prototype.string = function read_string_buffer() {\r\n var len = this.uint32(); // modifies pos\r\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @name BufferReader#bytes\r\n * @function\r\n * @returns {Buffer} Value read\r\n */\r\n","\"use strict\";\r\nmodule.exports = {};\r\n\r\n/**\r\n * Named roots.\r\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\r\n * Can also be used manually to make roots available accross modules.\r\n * @name roots\r\n * @type {Object.}\r\n * @example\r\n * // pbjs -r myroot -o compiled.js ...\r\n *\r\n * // in another module:\r\n * require(\"./compiled.js\");\r\n *\r\n * // in any subsequent module:\r\n * var root = protobuf.roots[\"myroot\"];\r\n */\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCImplCallback} callback Callback function\r\n * @returns {undefined}\r\n * @example\r\n * function rpcImpl(method, requestData, callback) {\r\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\r\n * throw Error(\"no such method\");\r\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\r\n * callback(err, responseData);\r\n * });\r\n * }\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCImplCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\nrpc.Service = require(13);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar util = require(15);\r\n\r\n// Extends EventEmitter\r\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\r\n\r\n/**\r\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\r\n *\r\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\r\n * @typedef rpc.ServiceMethodCallback\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {TRes} [response] Response message\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\r\n * @typedef rpc.ServiceMethod\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\r\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\r\n */\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @exports rpc.Service\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n */\r\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\r\n\r\n if (typeof rpcImpl !== \"function\")\r\n throw TypeError(\"rpcImpl must be a function\");\r\n\r\n util.EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` once the service is ended.\r\n * @type {RPCImpl|null}\r\n */\r\n this.rpcImpl = rpcImpl;\r\n\r\n /**\r\n * Whether requests are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.requestDelimited = Boolean(requestDelimited);\r\n\r\n /**\r\n * Whether responses are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.responseDelimited = Boolean(responseDelimited);\r\n}\r\n\r\n/**\r\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\r\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\r\n * @param {Constructor} requestCtor Request constructor\r\n * @param {Constructor} responseCtor Response constructor\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} callback Service callback\r\n * @returns {undefined}\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n */\r\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\r\n\r\n if (!request)\r\n throw TypeError(\"request must be specified\");\r\n\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\r\n\r\n if (!self.rpcImpl) {\r\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\r\n return undefined;\r\n }\r\n\r\n try {\r\n return self.rpcImpl(\r\n method,\r\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\r\n function rpcCallback(err, response) {\r\n\r\n if (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n\r\n if (response === null) {\r\n self.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n\r\n if (!(response instanceof responseCtor)) {\r\n try {\r\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n }\r\n\r\n self.emit(\"data\", response, method);\r\n return callback(null, response);\r\n }\r\n );\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n setTimeout(function() { callback(err); }, 0);\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nService.prototype.end = function end(endedByRPC) {\r\n if (this.rpcImpl) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.rpcImpl(null, null, null);\r\n this.rpcImpl = null;\r\n this.emit(\"end\").off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(15);\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low 32 bits, unsigned\r\n * @param {number} hi High 32 bits, unsigned\r\n */\r\nfunction LongBits(lo, hi) {\r\n\r\n // note that the casts below are theoretically unnecessary as of today, but older statically\r\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo >>> 0;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi >>> 0;\r\n}\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Zero hash.\r\n * @memberof util.LongBits\r\n * @type {string}\r\n */\r\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n if (sign)\r\n value = -value;\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n if (typeof value === \"number\")\r\n return LongBits.fromNumber(value);\r\n if (util.isString(value)) {\r\n /* istanbul ignore else */\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBits.prototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n var lo = ~this.lo + 1 >>> 0,\r\n hi = ~this.hi >>> 0;\r\n if (!lo)\r\n hi = hi + 1 >>> 0;\r\n return -(lo + hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBits.prototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\r\n /* istanbul ignore next */\r\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n if (hash === zeroHash)\r\n return zero;\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBits.prototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 ,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBits.prototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n return part2 === 0\r\n ? part1 === 0\r\n ? part0 < 16384\r\n ? part0 < 128 ? 1 : 2\r\n : part0 < 2097152 ? 3 : 4\r\n : part1 < 16384\r\n ? part1 < 128 ? 5 : 6\r\n : part1 < 2097152 ? 7 : 8\r\n : part2 < 128 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nvar util = exports;\r\n\r\n// used to return a Promise where callback is omitted\r\nutil.asPromise = require(1);\r\n\r\n// converts to / from base64 encoded strings\r\nutil.base64 = require(2);\r\n\r\n// base class of rpc.Service\r\nutil.EventEmitter = require(3);\r\n\r\n// float handling accross browsers\r\nutil.float = require(4);\r\n\r\n// requires modules optionally and hides the call from bundlers\r\nutil.inquire = require(5);\r\n\r\n// converts to / from utf8 encoded strings\r\nutil.utf8 = require(7);\r\n\r\n// provides a node-like buffer pool in the browser\r\nutil.pool = require(6);\r\n\r\n// utility to work with the low and high bits of a 64 bit value\r\nutil.LongBits = require(14);\r\n\r\n// global object reference\r\nutil.global = typeof window !== \"undefined\" && window\r\n || typeof global !== \"undefined\" && global\r\n || typeof self !== \"undefined\" && self\r\n || this; // eslint-disable-line no-invalid-this\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n * @const\r\n */\r\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n * @const\r\n */\r\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n * @const\r\n */\r\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\r\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === \"string\" || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return value && typeof value === \"object\";\r\n};\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * This is an alias of {@link util.isSet}.\r\n * @function\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isset =\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isSet = function isSet(obj, prop) {\r\n var value = obj[prop];\r\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\r\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\r\n return false;\r\n};\r\n\r\n/**\r\n * Any compatible Buffer instance.\r\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\r\n * @interface Buffer\r\n * @extends Uint8Array\r\n */\r\n\r\n/**\r\n * Node's Buffer class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Buffer = (function() {\r\n try {\r\n var Buffer = util.inquire(\"buffer\").Buffer;\r\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\r\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n return null;\r\n }\r\n})();\r\n\r\n// Internal alias of or polyfull for Buffer.from.\r\nutil._Buffer_from = null;\r\n\r\n// Internal alias of or polyfill for Buffer.allocUnsafe.\r\nutil._Buffer_allocUnsafe = null;\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\r\n * @returns {Uint8Array|Buffer} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(sizeOrArray) {\r\n /* istanbul ignore next */\r\n return typeof sizeOrArray === \"number\"\r\n ? util.Buffer\r\n ? util._Buffer_allocUnsafe(sizeOrArray)\r\n : new util.Array(sizeOrArray)\r\n : util.Buffer\r\n ? util._Buffer_from(sizeOrArray)\r\n : typeof Uint8Array === \"undefined\"\r\n ? sizeOrArray\r\n : new Uint8Array(sizeOrArray);\r\n};\r\n\r\n/**\r\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\r\n * @type {Constructor}\r\n */\r\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\r\n * @interface Long\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Long.js's Long class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\r\n || /* istanbul ignore next */ util.global.Long\r\n || util.inquire(\"long\");\r\n\r\n/**\r\n * Regular expression used to verify 2 bit (`bool`) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key2Re = /^true|false|0|1$/;\r\n\r\n/**\r\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\r\n\r\n/**\r\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? util.LongBits.from(value).toHash()\r\n : util.LongBits.zeroHash;\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = util.LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @memberof util\r\n * @param {Object.} dst Destination object\r\n * @param {Object.} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object.} Destination object\r\n */\r\nfunction merge(dst, src, ifNotSet) { // used by converters\r\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n return dst;\r\n}\r\n\r\nutil.merge = merge;\r\n\r\n/**\r\n * Converts the first character of a string to lower case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.lcFirst = function lcFirst(str) {\r\n return str.charAt(0).toLowerCase() + str.substring(1);\r\n};\r\n\r\n/**\r\n * Creates a custom error constructor.\r\n * @memberof util\r\n * @param {string} name Error name\r\n * @returns {Constructor} Custom error constructor\r\n */\r\nfunction newError(name) {\r\n\r\n function CustomError(message, properties) {\r\n\r\n if (!(this instanceof CustomError))\r\n return new CustomError(message, properties);\r\n\r\n // Error.call(this, message);\r\n // ^ just returns a new error instance because the ctor can be called as a function\r\n\r\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\r\n\r\n /* istanbul ignore next */\r\n if (Error.captureStackTrace) // node\r\n Error.captureStackTrace(this, CustomError);\r\n else\r\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\r\n\r\n if (properties)\r\n merge(this, properties);\r\n }\r\n\r\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\r\n\r\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\r\n\r\n CustomError.prototype.toString = function toString() {\r\n return this.name + \": \" + this.message;\r\n };\r\n\r\n return CustomError;\r\n}\r\n\r\nutil.newError = newError;\r\n\r\n/**\r\n * Constructs a new protocol error.\r\n * @classdesc Error subclass indicating a protocol specifc error.\r\n * @memberof util\r\n * @extends Error\r\n * @template T extends Message\r\n * @constructor\r\n * @param {string} message Error message\r\n * @param {Object.} [properties] Additional properties\r\n * @example\r\n * try {\r\n * MyMessage.decode(someBuffer); // throws if required fields are missing\r\n * } catch (e) {\r\n * if (e instanceof ProtocolError && e.instance)\r\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\r\n * }\r\n */\r\nutil.ProtocolError = newError(\"ProtocolError\");\r\n\r\n/**\r\n * So far decoded message instance.\r\n * @name util.ProtocolError#instance\r\n * @type {Message}\r\n */\r\n\r\n/**\r\n * A OneOf getter as returned by {@link util.oneOfGetter}.\r\n * @typedef OneOfGetter\r\n * @type {function}\r\n * @returns {string|undefined} Set field name, if any\r\n */\r\n\r\n/**\r\n * Builds a getter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfGetter} Unbound getter\r\n */\r\nutil.oneOfGetter = function getOneOf(fieldNames) {\r\n var fieldMap = {};\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n fieldMap[fieldNames[i]] = 1;\r\n\r\n /**\r\n * @returns {string|undefined} Set field name, if any\r\n * @this Object\r\n * @ignore\r\n */\r\n return function() { // eslint-disable-line consistent-return\r\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\r\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\r\n return keys[i];\r\n };\r\n};\r\n\r\n/**\r\n * A OneOf setter as returned by {@link util.oneOfSetter}.\r\n * @typedef OneOfSetter\r\n * @type {function}\r\n * @param {string|undefined} value Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Builds a setter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfSetter} Unbound setter\r\n */\r\nutil.oneOfSetter = function setOneOf(fieldNames) {\r\n\r\n /**\r\n * @param {string} name Field name\r\n * @returns {undefined}\r\n * @this Object\r\n * @ignore\r\n */\r\n return function(name) {\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n if (fieldNames[i] !== name)\r\n delete this[fieldNames[i]];\r\n };\r\n};\r\n\r\n/**\r\n * Default conversion options used for {@link Message#toJSON} implementations.\r\n *\r\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\r\n *\r\n * - Longs become strings\r\n * - Enums become string keys\r\n * - Bytes become base64 encoded strings\r\n * - (Sub-)Messages become plain objects\r\n * - Maps become plain objects with all string keys\r\n * - Repeated fields become arrays\r\n * - NaN and Infinity for float and double fields become strings\r\n *\r\n * @type {IConversionOptions}\r\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\r\n */\r\nutil.toJSONOptions = {\r\n longs: String,\r\n enums: String,\r\n bytes: String,\r\n json: true\r\n};\r\n\r\n// Sets up buffer utility according to the environment (called in index-minimal)\r\nutil._configure = function() {\r\n var Buffer = util.Buffer;\r\n /* istanbul ignore if */\r\n if (!Buffer) {\r\n util._Buffer_from = util._Buffer_allocUnsafe = null;\r\n return;\r\n }\r\n // because node 4.x buffers are incompatible & immutable\r\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\r\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\r\n /* istanbul ignore next */\r\n function Buffer_from(value, encoding) {\r\n return new Buffer(value, encoding);\r\n };\r\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\r\n /* istanbul ignore next */\r\n function Buffer_allocUnsafe(size) {\r\n return new Buffer(size);\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nvar util = require(15);\r\n\r\nvar BufferWriter; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n base64 = util.base64,\r\n utf8 = util.utf8;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @constructor\r\n * @param {function(*, Uint8Array, number)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {*} val Value to write\r\n * @ignore\r\n */\r\nfunction Op(fn, len, val) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {Writer.Op|undefined}\r\n */\r\n this.next = undefined;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val; // type varies\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @ignore\r\n */\r\nfunction State(writer) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {State|null}\r\n */\r\n this.next = writer.states;\r\n}\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {Object|null}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @function\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = util.Buffer\r\n ? function create_buffer_setup() {\r\n return (Writer.create = function create_buffer() {\r\n return new BufferWriter();\r\n })();\r\n }\r\n /* istanbul ignore next */\r\n : function create_array() {\r\n return new Writer();\r\n };\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new util.Array(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\n/* istanbul ignore else */\r\nif (util.Array !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n * @private\r\n */\r\nWriter.prototype._push = function push(fn, len, val) {\r\n this.tail = this.tail.next = new Op(fn, len, val);\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(val, buf, pos) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\nfunction writeVarint32(val, buf, pos) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Constructs a new varint writer operation instance.\r\n * @classdesc Scheduled varint writer operation.\r\n * @extends Op\r\n * @constructor\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @ignore\r\n */\r\nfunction VarintOp(len, val) {\r\n this.len = len;\r\n this.next = undefined;\r\n this.val = val;\r\n}\r\n\r\nVarintOp.prototype = Object.create(Op.prototype);\r\nVarintOp.prototype.fn = writeVarint32;\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.uint32 = function write_uint32(value) {\r\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\r\n // uint32 is by far the most frequently used operation and benefits significantly from this.\r\n this.len += (this.tail = this.tail.next = new VarintOp(\r\n (value = value >>> 0)\r\n < 128 ? 1\r\n : value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5,\r\n value)).len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sint32 = function write_sint32(value) {\r\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\r\n};\r\n\r\nfunction writeVarint64(val, buf, pos) {\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.int64 = Writer.prototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bool = function write_bool(value) {\r\n return this._push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fixed32 = function write_fixed32(value) {\r\n return this._push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as fixed 32 bits.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as fixed 64 bits.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.float = function write_float(value) {\r\n return this._push(util.float.writeFloatLE, 4, value);\r\n};\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.double = function write_double(value) {\r\n return this._push(util.float.writeDoubleLE, 8, value);\r\n};\r\n\r\nvar writeBytes = util.Array.prototype.set\r\n ? function writeBytes_set(val, buf, pos) {\r\n buf.set(val, pos); // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytes_for(val, buf, pos) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (!len)\r\n return this._push(writeByte, 1, 0);\r\n if (util.isString(value)) {\r\n var buf = Writer.alloc(len = base64.length(value));\r\n base64.decode(value, buf, 0);\r\n value = buf;\r\n }\r\n return this.uint32(len)._push(writeBytes, len, value);\r\n};\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.string = function write_string(value) {\r\n var len = utf8.length(value);\r\n return len\r\n ? this.uint32(len)._push(utf8.write, len, value)\r\n : this._push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fork = function fork() {\r\n this.states = new State(this);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.ldelim = function ldelim() {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset().uint32(len);\r\n if (len) {\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriter.prototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len),\r\n pos = 0;\r\n while (head) {\r\n head.fn(head.val, buf, pos);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n // this.head = this.tail = null;\r\n return buf;\r\n};\r\n\r\nWriter._configure = function(BufferWriter_) {\r\n BufferWriter = BufferWriter_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferWriter;\r\n\r\n// extends Writer\r\nvar Writer = require(16);\r\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\r\n\r\nvar util = require(15);\r\n\r\nvar Buffer = util.Buffer;\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Buffer} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\r\n};\r\n\r\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\r\n ? function writeBytesBuffer_set(val, buf, pos) {\r\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\r\n // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytesBuffer_copy(val, buf, pos) {\r\n if (val.copy) // Buffer values\r\n val.copy(buf, pos, 0, val.length);\r\n else for (var i = 0; i < val.length;) // plain array values\r\n buf[pos++] = val[i++];\r\n };\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\r\n if (util.isString(value))\r\n value = util._Buffer_from(value, \"base64\");\r\n var len = value.length >>> 0;\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeBytesBuffer, len, value);\r\n return this;\r\n};\r\n\r\nfunction writeStringBuffer(val, buf, pos) {\r\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\r\n util.utf8.write(val, buf, pos);\r\n else\r\n buf.utf8Write(val, pos);\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.string = function write_string_buffer(value) {\r\n var len = Buffer.byteLength(value);\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeStringBuffer, len, value);\r\n return this;\r\n};\r\n\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @name BufferWriter#finish\r\n * @function\r\n * @returns {Buffer} Finished buffer\r\n */\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/node_modules/protobufjs/dist/minimal/protobuf.min.js b/node_modules/protobufjs/dist/minimal/protobuf.min.js new file mode 100644 index 0000000..517e320 --- /dev/null +++ b/node_modules/protobufjs/dist/minimal/protobuf.min.js @@ -0,0 +1,8 @@ +/*! + * protobuf.js v6.8.8 (c) 2016, daniel wirtz + * compiled thu, 19 jul 2018 00:33:26 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +!function(b){"use strict";var r,u,t,n;r={1:[function(t,n){n.exports=function(t,n){var i=Array(arguments.length-1),e=0,r=2,s=!0;for(;r>2],r=(3&f)<<4,h=1;break;case 1:e[s++]=o[r|f>>4],r=(15&f)<<2,h=2;break;case 2:e[s++]=o[r|f>>6],e[s++]=o[63&f],h=0}8191>4,r=h,e=2;break;case 2:n[i++]=(15&r)<<4|(60&h)>>2,r=h,e=3;break;case 3:n[i++]=(3&r)<<6|h,e=0}}if(1===e)throw Error(c);return i-u},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,n){function i(){this.t={}}(n.exports=i).prototype.on=function(t,n,i){return(this.t[t]||(this.t[t]=[])).push({fn:n,ctx:i||this}),this},i.prototype.off=function(t,n){if(t===b)this.t={};else if(n===b)this.t[t]=[];else for(var i=this.t[t],r=0;r>>0,i,r);else if(n<11754943508222875e-54)t((u<<31|Math.round(n/1401298464324817e-60))>>>0,i,r);else{var e=Math.floor(Math.log(n)/Math.LN2);t((u<<31|e+127<<23|8388607&Math.round(n*Math.pow(2,-e)*8388608))>>>0,i,r)}}function n(t,n,i){var r=t(n,i),u=2*(r>>31)+1,e=r>>>23&255,s=8388607&r;return 255===e?s?NaN:u*(1/0):0===e?1401298464324817e-60*u*s:u*Math.pow(2,e-150)*(s+8388608)}h.writeFloatLE=t.bind(null,r),h.writeFloatBE=t.bind(null,u),h.readFloatLE=n.bind(null,e),h.readFloatBE=n.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var r=new Float64Array([-0]),u=new Uint8Array(r.buffer),t=128===u[7];function n(t,n,i){r[0]=t,n[i]=u[0],n[i+1]=u[1],n[i+2]=u[2],n[i+3]=u[3],n[i+4]=u[4],n[i+5]=u[5],n[i+6]=u[6],n[i+7]=u[7]}function i(t,n,i){r[0]=t,n[i]=u[7],n[i+1]=u[6],n[i+2]=u[5],n[i+3]=u[4],n[i+4]=u[3],n[i+5]=u[2],n[i+6]=u[1],n[i+7]=u[0]}function e(t,n){return u[0]=t[n],u[1]=t[n+1],u[2]=t[n+2],u[3]=t[n+3],u[4]=t[n+4],u[5]=t[n+5],u[6]=t[n+6],u[7]=t[n+7],r[0]}function s(t,n){return u[7]=t[n],u[6]=t[n+1],u[5]=t[n+2],u[4]=t[n+3],u[3]=t[n+4],u[2]=t[n+5],u[1]=t[n+6],u[0]=t[n+7],r[0]}h.writeDoubleLE=t?n:i,h.writeDoubleBE=t?i:n,h.readDoubleLE=t?e:s,h.readDoubleBE=t?s:e}():function(){function t(t,n,i,r,u,e){var s=r<0?1:0;if(s&&(r=-r),0===r)t(0,u,e+n),t(0<1/r?0:2147483648,u,e+i);else if(isNaN(r))t(0,u,e+n),t(2146959360,u,e+i);else if(17976931348623157e292>>0,u,e+i);else{var h;if(r<22250738585072014e-324)t((h=r/5e-324)>>>0,u,e+n),t((s<<31|h/4294967296)>>>0,u,e+i);else{var f=Math.floor(Math.log(r)/Math.LN2);1024===f&&(f=1023),t(4503599627370496*(h=r*Math.pow(2,-f))>>>0,u,e+n),t((s<<31|f+1023<<20|1048576*h&1048575)>>>0,u,e+i)}}}function n(t,n,i,r,u){var e=t(r,u+n),s=t(r,u+i),h=2*(s>>31)+1,f=s>>>20&2047,o=4294967296*(1048575&s)+e;return 2047===f?o?NaN:h*(1/0):0===f?5e-324*h*o:h*Math.pow(2,f-1075)*(o+4503599627370496)}h.writeDoubleLE=t.bind(null,r,0,4),h.writeDoubleBE=t.bind(null,u,4,0),h.readDoubleLE=n.bind(null,e,0,4),h.readDoubleBE=n.bind(null,s,4,0)}(),h}function r(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}function u(t,n,i){n[i]=t>>>24,n[i+1]=t>>>16&255,n[i+2]=t>>>8&255,n[i+3]=255&t}function e(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}function s(t,n){return(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}n.exports=i(i)},{}],5:[function(t,n,i){function r(t){try{var n=eval("require")(t);if(n&&(n.length||Object.keys(n).length))return n}catch(t){}return null}n.exports=r},{}],6:[function(t,n){n.exports=function(i,r,t){var u=t||8192,e=u>>>1,s=null,h=u;return function(t){if(t<1||e>10),e[s++]=56320+(1023&r)):e[s++]=(15&r)<<12|(63&t[n++])<<6|63&t[n++],8191>6|192:(55296==(64512&r)&&56320==(64512&(u=t.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&u),++s,n[i++]=r>>18|240,n[i++]=r>>12&63|128):n[i++]=r>>12|224,n[i++]=r>>6&63|128),n[i++]=63&r|128);return i-e}},{}],8:[function(t,n,i){var r=i;function u(){r.Reader.n(r.BufferReader),r.util.n()}r.build="minimal",r.Writer=t(16),r.BufferWriter=t(17),r.Reader=t(9),r.BufferReader=t(10),r.util=t(15),r.rpc=t(12),r.roots=t(11),r.configure=u,r.Writer.n(r.BufferWriter),u()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(t,n){n.exports=h;var i,r=t(15),u=r.LongBits,e=r.utf8;function s(t,n){return RangeError("index out of range: "+t.pos+" + "+(n||1)+" > "+t.len)}function h(t){this.buf=t,this.pos=0,this.len=t.length}var f,o="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new h(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new h(t);throw Error("illegal buffer")};function c(){var t=new u(0,0),n=0;if(!(4=this.len)throw s(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*n)>>>0,t}for(;n<4;++n)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(n=0,4>>0,this.buf[this.pos++]<128)return t}else for(;n<5;++n){if(this.pos>=this.len)throw s(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function a(t,n){return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0}function l(){if(this.pos+8>this.len)throw s(this,8);return new u(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}h.create=r.Buffer?function(t){return(h.create=function(t){return r.Buffer.isBuffer(t)?new i(t):o(t)})(t)}:o,h.prototype.i=r.Array.prototype.subarray||r.Array.prototype.slice,h.prototype.uint32=(f=4294967295,function(){if(f=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return f;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return f}),h.prototype.int32=function(){return 0|this.uint32()},h.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},h.prototype.bool=function(){return 0!==this.uint32()},h.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return a(this.buf,this.pos+=4)},h.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|a(this.buf,this.pos+=4)},h.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},h.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},h.prototype.bytes=function(){var t=this.uint32(),n=this.pos,i=this.pos+t;if(i>this.len)throw s(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,i):n===i?new this.buf.constructor(0):this.i.call(this.buf,n,i)},h.prototype.string=function(){var t=this.bytes();return e.read(t,0,t.length)},h.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw s(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},h.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},h.n=function(t){i=t;var n=r.Long?"toLong":"toNumber";r.merge(h.prototype,{int64:function(){return c.call(this)[n](!1)},uint64:function(){return c.call(this)[n](!0)},sint64:function(){return c.call(this).zzDecode()[n](!1)},fixed64:function(){return l.call(this)[n](!0)},sfixed64:function(){return l.call(this)[n](!1)}})}},{15:15}],10:[function(t,n){n.exports=u;var i=t(9);(u.prototype=Object.create(i.prototype)).constructor=u;var r=t(15);function u(t){i.call(this,t)}r.Buffer&&(u.prototype.i=r.Buffer.prototype.slice),u.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len))}},{15:15,9:9}],11:[function(t,n){n.exports={}},{}],12:[function(t,n,i){i.Service=t(13)},{13:13}],13:[function(t,n){n.exports=i;var h=t(15);function i(t,n,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");h.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!n,this.responseDelimited=!!i}((i.prototype=Object.create(h.EventEmitter.prototype)).constructor=i).prototype.rpcCall=function t(i,n,r,u,e){if(!u)throw TypeError("request must be specified");var s=this;if(!e)return h.asPromise(t,s,i,n,r,u);if(!s.rpcImpl)return setTimeout(function(){e(Error("already ended"))},0),b;try{return s.rpcImpl(i,n[s.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(t,n){if(t)return s.emit("error",t,i),e(t);if(null===n)return s.end(!0),b;if(!(n instanceof r))try{n=r[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,i),e(t)}return s.emit("data",n,i),e(null,n)})}catch(t){return s.emit("error",t,i),setTimeout(function(){e(t)},0),b}},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(t,n){n.exports=u;var i=t(15);function u(t,n){this.lo=t>>>0,this.hi=n>>>0}var e=u.zero=new u(0,0);e.toNumber=function(){return 0},e.zzEncode=e.zzDecode=function(){return this},e.length=function(){return 1};var r=u.zeroHash="\0\0\0\0\0\0\0\0";u.fromNumber=function(t){if(0===t)return e;var n=t<0;n&&(t=-t);var i=t>>>0,r=(t-i)/4294967296>>>0;return n&&(r=~r>>>0,i=~i>>>0,4294967295<++i&&(i=0,4294967295<++r&&(r=0))),new u(i,r)},u.from=function(t){if("number"==typeof t)return u.fromNumber(t);if(i.isString(t)){if(!i.Long)return u.fromNumber(parseInt(t,10));t=i.Long.fromString(t)}return t.low||t.high?new u(t.low>>>0,t.high>>>0):e},u.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var n=1+~this.lo>>>0,i=~this.hi>>>0;return n||(i=i+1>>>0),-(n+4294967296*i)}return this.lo+4294967296*this.hi},u.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var s=String.prototype.charCodeAt;u.fromHash=function(t){return t===r?e:new u((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},u.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},u.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},u.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},u.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===n?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:i<128?9:10}},{15:15}],15:[function(t,n,i){var r=i;function u(t,n,i){for(var r=Object.keys(n),u=0;u>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;n[i++]=t.lo}function w(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}c.create=r.Buffer?function(){return(c.create=function(){return new i})()}:function(){return new c},c.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(c.alloc=r.pool(c.alloc,r.Array.prototype.subarray)),c.prototype.e=function(t,n,i){return this.tail=this.tail.next=new h(t,n,i),this.len+=n,this},(l.prototype=Object.create(h.prototype)).fn=function(t,n,i){for(;127>>=7;n[i]=t},c.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new l((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},c.prototype.int32=function(t){return t<0?this.e(v,10,u.fromNumber(t)):this.uint32(t)},c.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},c.prototype.int64=c.prototype.uint64=function(t){var n=u.from(t);return this.e(v,n.length(),n)},c.prototype.sint64=function(t){var n=u.from(t).zzEncode();return this.e(v,n.length(),n)},c.prototype.bool=function(t){return this.e(a,1,t?1:0)},c.prototype.sfixed32=c.prototype.fixed32=function(t){return this.e(w,4,t>>>0)},c.prototype.sfixed64=c.prototype.fixed64=function(t){var n=u.from(t);return this.e(w,4,n.lo).e(w,4,n.hi)},c.prototype.float=function(t){return this.e(r.float.writeFloatLE,4,t)},c.prototype.double=function(t){return this.e(r.float.writeDoubleLE,8,t)};var y=r.Array.prototype.set?function(t,n,i){n.set(t,i)}:function(t,n,i){for(var r=0;r>>0;if(!n)return this.e(a,1,0);if(r.isString(t)){var i=c.alloc(n=e.length(t));e.decode(t,i,0),t=i}return this.uint32(n).e(y,n,t)},c.prototype.string=function(t){var n=s.length(t);return n?this.uint32(n).e(s.write,n,t):this.e(a,1,0)},c.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new h(f,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new h(f,0,0),this.len=0),this},c.prototype.ldelim=function(){var t=this.head,n=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=n,this.len+=i),this},c.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,n,i),i+=t.len,t=t.next;return n},c.n=function(t){i=t}},{15:15}],17:[function(t,n){n.exports=e;var i=t(16);(e.prototype=Object.create(i.prototype)).constructor=e;var r=t(15),u=r.Buffer;function e(){i.call(this)}e.alloc=function(t){return(e.alloc=r.u)(t)};var s=u&&u.prototype instanceof Uint8Array&&"set"===u.prototype.set.name?function(t,n,i){n.set(t,i)}:function(t,n,i){if(t.copy)t.copy(n,i,0,t.length);else for(var r=0;r>>0;return this.uint32(n),n&&this.e(s,n,t),this},e.prototype.string=function(t){var n=u.byteLength(t);return this.uint32(n),n&&this.e(h,n,t),this}},{15:15,16:16}]},u={},t=[8],n=function t(n){var i=u[n];return i||r[n][0].call(i=u[n]={exports:{}},t,i,i.exports),i.exports}(t[0]),n.util.global.protobuf=n,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(n.util.Long=t,n.configure()),n}),"object"==typeof module&&module&&module.exports&&(module.exports=n)}(); +//# sourceMappingURL=protobuf.min.js.map diff --git a/node_modules/protobufjs/dist/minimal/protobuf.min.js.map b/node_modules/protobufjs/dist/minimal/protobuf.min.js.map new file mode 100644 index 0000000..b13f243 --- /dev/null +++ b/node_modules/protobufjs/dist/minimal/protobuf.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/index-minimal","../src/reader.js","../src/reader_buffer.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/util/longbits.js","../src/util/minimal.js","../src/writer.js","../src/writer_buffer.js"],"names":["undefined","modules","cache","entries","protobuf","1","require","module","exports","fn","ctx","params","Array","arguments","length","offset","index","pending","Promise","resolve","reject","err","apply","base64","string","p","n","charAt","Math","ceil","b64","s64","i","encode","buffer","start","end","t","parts","chunk","j","b","push","String","fromCharCode","slice","join","invalidEncoding","decode","c","charCodeAt","Error","test","EventEmitter","this","_listeners","prototype","on","evt","off","listeners","splice","emit","args","factory","Float32Array","f32","f8b","Uint8Array","le","writeFloat_f32_cpy","val","buf","pos","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","writeFloat_ieee754","writeUint","sign","isNaN","round","exponent","floor","log","LN2","pow","readFloat_ieee754","readUint","uint","mantissa","NaN","Infinity","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","f64","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","writeDouble_ieee754","off0","off1","readDouble_ieee754","lo","hi","inquire","moduleName","mod","eval","Object","keys","e","alloc","size","SIZE","MAX","slab","call","utf8","len","read","write","c1","c2","configure","Reader","_configure","BufferReader","util","build","Writer","BufferWriter","rpc","roots","LongBits","indexOutOfRange","reader","writeLength","RangeError","value","create_array","isArray","readLongVarint","bits","readFixed32_end","readFixed64","create","Buffer","isBuffer","_slice","subarray","uint32","int32","sint32","bool","fixed32","sfixed32","float","double","bytes","constructor","skip","skipType","wireType","BufferReader_","Long","merge","int64","uint64","sint64","zzDecode","fixed64","sfixed64","utf8Slice","min","Service","rpcImpl","requestDelimited","responseDelimited","TypeError","rpcCall","method","requestCtor","responseCtor","request","callback","self","asPromise","setTimeout","finish","response","endedByRPC","zero","toNumber","zzEncode","zeroHash","fromNumber","from","isString","parseInt","fromString","low","high","unsigned","toLong","fromHash","hash","toHash","mask","part0","part1","part2","dst","src","ifNotSet","newError","name","CustomError","message","properties","defineProperty","get","captureStackTrace","stack","toString","pool","global","window","emptyArray","freeze","emptyObject","isNode","process","versions","node","isInteger","Number","isFinite","isObject","isset","isSet","obj","prop","hasOwnProperty","utf8Write","_Buffer_from","_Buffer_allocUnsafe","newBuffer","sizeOrArray","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","lcFirst","str","toLowerCase","substring","ProtocolError","oneOfGetter","fieldNames","fieldMap","oneOfSetter","toJSONOptions","longs","enums","json","encoding","allocUnsafe","Op","next","noop","State","writer","head","tail","states","writeByte","VarintOp","writeVarint64","writeFixed32","_push","writeBytes","set","fork","reset","ldelim","BufferWriter_","writeBytesBuffer","copy","writeStringBuffer","byteLength","$require","$module","define","amd","isLong"],"mappings":";;;;;;CAAA,SAAAA,GAAA,aAAA,IAAAC,EAAAC,EAAAC,EAcAC,EAdAH,EAiCA,CAAAI,EAAA,CAAA,SAAAC,EAAAC,GChCAA,EAAAC,QAmBA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACA,KAAAD,EAAAH,UAAAC,QACAH,EAAAI,KAAAF,UAAAG,KACA,OAAA,IAAAE,QAAA,SAAAC,EAAAC,GACAT,EAAAI,GAAA,SAAAM,GACA,GAAAJ,EAEA,GADAA,GAAA,EACAI,EACAD,EAAAC,OACA,CAGA,IAFA,IAAAV,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAA,EAAAJ,EAAAG,QACAH,EAAAI,KAAAF,UAAAE,GACAI,EAAAG,MAAA,KAAAX,KAIA,IACAF,EAAAa,MAAAZ,GAAA,KAAAC,GACA,MAAAU,GACAJ,IACAA,GAAA,EACAG,EAAAC,gCCxCA,IAAAE,EAAAf,EAOAe,EAAAT,OAAA,SAAAU,GACA,IAAAC,EAAAD,EAAAV,OACA,IAAAW,EACA,OAAA,EAEA,IADA,IA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ACAzO,EAAAyO,KAAAxO,EAAAC,EAAA,EAAAF,EAAAzD,aACA,IAAA,IAAAkB,EAAA,EAAAA,EAAAuC,EAAAzD,QACA0D,EAAAC,KAAAF,EAAAvC,MAgBA,SAAAiR,EAAA1O,EAAAC,EAAAC,GACAF,EAAAzD,OAAA,GACA+H,EAAAV,KAAAG,MAAA/D,EAAAC,EAAAC,GAEAD,EAAAyL,UAAA1L,EAAAE,GAdAuE,EAAAxF,UAAAoH,MAAA,SAAApB,GACAX,EAAAsE,SAAA3D,KACAA,EAAAX,EAAAqH,EAAA1G,EAAA,WACA,IAAApB,EAAAoB,EAAA1I,SAAA,EAIA,OAHAwC,KAAA8G,OAAAhC,GACAA,GACA9E,KAAAkP,EAAAO,EAAA3K,EAAAoB,GACAlG,MAaA0F,EAAAxF,UAAAhC,OAAA,SAAAgI,GACA,IAAApB,EAAA4B,EAAAkJ,WAAA1J,GAIA,OAHAlG,KAAA8G,OAAAhC,GACAA,GACA9E,KAAAkP,EAAAS,EAAA7K,EAAAoB,GACAlG,uBjBvEApD,KAAAC,MAcAC,EAPA,SAAA+S,EAAA9E,GACA,IAAA+E,EAAAlT,EAAAmO,GAGA,OAFA+E,GACAnT,EAAAoO,GAAA,GAAAnG,KAAAkL,EAAAlT,EAAAmO,GAAA,CAAA7N,QAAA,IAAA2S,EAAAC,EAAAA,EAAA5S,SACA4S,EAAA5S,QAGA2S,CAAAhT,EAAA,IAGAC,EAAAyI,KAAAkG,OAAA3O,SAAAA,EAGA,mBAAAiT,QAAAA,OAAAC,KACAD,OAAA,CAAA,QAAA,SAAAnI,GAKA,OAJAA,GAAAA,EAAAqI,SACAnT,EAAAyI,KAAAqC,KAAAA,EACA9K,EAAAqI,aAEArI,IAIA,iBAAAG,QAAAA,QAAAA,OAAAC,UACAD,OAAAC,QAAAJ,GA/BA","file":"protobuf.min.js","sourcesContent":["(function prelude(modules, cache, entries) {\r\n\r\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\r\n // sources through a conflict-free require shim and is again wrapped within an iife that\r\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\r\n // so that minification can remove the directives of each module.\r\n\r\n function $require(name) {\r\n var $module = cache[name];\r\n if (!$module)\r\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\r\n return $module.exports;\r\n }\r\n\r\n var protobuf = $require(entries[0]);\r\n\r\n // Expose globally\r\n protobuf.util.global.protobuf = protobuf;\r\n\r\n // Be nice to AMD\r\n if (typeof define === \"function\" && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long && Long.isLong) {\r\n protobuf.util.Long = Long;\r\n protobuf.configure();\r\n }\r\n return protobuf;\r\n });\r\n\r\n // Be nice to CommonJS\r\n if (typeof module === \"object\" && module && module.exports)\r\n module.exports = protobuf;\r\n\r\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nvar protobuf = exports;\r\n\r\n/**\r\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\r\n * @name build\r\n * @type {string}\r\n * @const\r\n */\r\nprotobuf.build = \"minimal\";\r\n\r\n// Serialization\r\nprotobuf.Writer = require(16);\r\nprotobuf.BufferWriter = require(17);\r\nprotobuf.Reader = require(9);\r\nprotobuf.BufferReader = require(10);\r\n\r\n// Utility\r\nprotobuf.util = require(15);\r\nprotobuf.rpc = require(12);\r\nprotobuf.roots = require(11);\r\nprotobuf.configure = configure;\r\n\r\n/* istanbul ignore next */\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n protobuf.Reader._configure(protobuf.BufferReader);\r\n protobuf.util._configure();\r\n}\r\n\r\n// Set up buffer utility according to the environment\r\nprotobuf.Writer._configure(protobuf.BufferWriter);\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nvar util = require(15);\r\n\r\nvar BufferReader; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n utf8 = util.utf8;\r\n\r\n/* istanbul ignore next */\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n\r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\nvar create_array = typeof Uint8Array !== \"undefined\"\r\n ? function create_typed_array(buffer) {\r\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n }\r\n /* istanbul ignore next */\r\n : function create_array(buffer) {\r\n if (Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n };\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @function\r\n * @param {Uint8Array|Buffer} buffer Buffer to read from\r\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n * @throws {Error} If `buffer` is not a valid buffer\r\n */\r\nReader.create = util.Buffer\r\n ? function create_buffer_setup(buffer) {\r\n return (Reader.create = function create_buffer(buffer) {\r\n return util.Buffer.isBuffer(buffer)\r\n ? new BufferReader(buffer)\r\n /* istanbul ignore next */\r\n : create_array(buffer);\r\n })(buffer);\r\n }\r\n /* istanbul ignore next */\r\n : create_array;\r\n\r\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.uint32 = (function read_uint32_setup() {\r\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\r\n return function read_uint32() {\r\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n\r\n /* istanbul ignore if */\r\n if ((this.pos += 5) > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this, 10);\r\n }\r\n return value;\r\n };\r\n})();\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.int32 = function read_int32() {\r\n return this.uint32() | 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sint32 = function read_sint32() {\r\n var value = this.uint32();\r\n return value >>> 1 ^ -(value & 1) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n // tends to deopt with local vars for octet etc.\r\n var bits = new LongBits(0, 0);\r\n var i = 0;\r\n if (this.len - this.pos > 4) { // fast route (lo)\r\n for (; i < 4; ++i) {\r\n // 1st..4th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 5th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n i = 0;\r\n } else {\r\n for (; i < 3; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 1st..3th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 4th\r\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\r\n return bits;\r\n }\r\n if (this.len - this.pos > 4) { // fast route (hi)\r\n for (; i < 5; ++i) {\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n } else {\r\n for (; i < 5; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n }\r\n /* istanbul ignore next */\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReader.prototype.bool = function read_bool() {\r\n return this.uint32() !== 0;\r\n};\r\n\r\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\r\n return (buf[end - 4]\r\n | buf[end - 3] << 8\r\n | buf[end - 2] << 16\r\n | buf[end - 1] << 24) >>> 0;\r\n}\r\n\r\n/**\r\n * Reads fixed 32 bits as an unsigned 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.fixed32 = function read_fixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4);\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a signed 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sfixed32 = function read_sfixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readFixed64(/* this: Reader */) {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n\r\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.float = function read_float() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readFloatLE(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.double = function read_double() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readDoubleLE(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReader.prototype.bytes = function read_bytes() {\r\n var length = this.uint32(),\r\n start = this.pos,\r\n end = this.pos + length;\r\n\r\n /* istanbul ignore if */\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n\r\n this.pos += length;\r\n if (Array.isArray(this.buf)) // plain array\r\n return this.buf.slice(start, end);\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReader.prototype.string = function read_string() {\r\n var bytes = this.bytes();\r\n return utf8.read(bytes, 0, bytes.length);\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skip = function skip(length) {\r\n if (typeof length === \"number\") {\r\n /* istanbul ignore if */\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n } else {\r\n do {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n while ((wireType = this.uint32() & 7) !== 4) {\r\n this.skipType(wireType);\r\n }\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n\r\n /* istanbul ignore next */\r\n default:\r\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\r\n }\r\n return this;\r\n};\r\n\r\nReader._configure = function(BufferReader_) {\r\n BufferReader = BufferReader_;\r\n\r\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\r\n util.merge(Reader.prototype, {\r\n\r\n int64: function read_int64() {\r\n return readLongVarint.call(this)[fn](false);\r\n },\r\n\r\n uint64: function read_uint64() {\r\n return readLongVarint.call(this)[fn](true);\r\n },\r\n\r\n sint64: function read_sint64() {\r\n return readLongVarint.call(this).zzDecode()[fn](false);\r\n },\r\n\r\n fixed64: function read_fixed64() {\r\n return readFixed64.call(this)[fn](true);\r\n },\r\n\r\n sfixed64: function read_sfixed64() {\r\n return readFixed64.call(this)[fn](false);\r\n }\r\n\r\n });\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferReader;\r\n\r\n// extends Reader\r\nvar Reader = require(9);\r\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\r\n\r\nvar util = require(15);\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n Reader.call(this, buffer);\r\n\r\n /**\r\n * Read buffer.\r\n * @name BufferReader#buf\r\n * @type {Buffer}\r\n */\r\n}\r\n\r\n/* istanbul ignore else */\r\nif (util.Buffer)\r\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReader.prototype.string = function read_string_buffer() {\r\n var len = this.uint32(); // modifies pos\r\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @name BufferReader#bytes\r\n * @function\r\n * @returns {Buffer} Value read\r\n */\r\n","\"use strict\";\r\nmodule.exports = {};\r\n\r\n/**\r\n * Named roots.\r\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\r\n * Can also be used manually to make roots available accross modules.\r\n * @name roots\r\n * @type {Object.}\r\n * @example\r\n * // pbjs -r myroot -o compiled.js ...\r\n *\r\n * // in another module:\r\n * require(\"./compiled.js\");\r\n *\r\n * // in any subsequent module:\r\n * var root = protobuf.roots[\"myroot\"];\r\n */\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCImplCallback} callback Callback function\r\n * @returns {undefined}\r\n * @example\r\n * function rpcImpl(method, requestData, callback) {\r\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\r\n * throw Error(\"no such method\");\r\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\r\n * callback(err, responseData);\r\n * });\r\n * }\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCImplCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\nrpc.Service = require(13);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar util = require(15);\r\n\r\n// Extends EventEmitter\r\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\r\n\r\n/**\r\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\r\n *\r\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\r\n * @typedef rpc.ServiceMethodCallback\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {TRes} [response] Response message\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\r\n * @typedef rpc.ServiceMethod\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\r\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\r\n */\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @exports rpc.Service\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n */\r\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\r\n\r\n if (typeof rpcImpl !== \"function\")\r\n throw TypeError(\"rpcImpl must be a function\");\r\n\r\n util.EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` once the service is ended.\r\n * @type {RPCImpl|null}\r\n */\r\n this.rpcImpl = rpcImpl;\r\n\r\n /**\r\n * Whether requests are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.requestDelimited = Boolean(requestDelimited);\r\n\r\n /**\r\n * Whether responses are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.responseDelimited = Boolean(responseDelimited);\r\n}\r\n\r\n/**\r\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\r\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\r\n * @param {Constructor} requestCtor Request constructor\r\n * @param {Constructor} responseCtor Response constructor\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} callback Service callback\r\n * @returns {undefined}\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n */\r\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\r\n\r\n if (!request)\r\n throw TypeError(\"request must be specified\");\r\n\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\r\n\r\n if (!self.rpcImpl) {\r\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\r\n return undefined;\r\n }\r\n\r\n try {\r\n return self.rpcImpl(\r\n method,\r\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\r\n function rpcCallback(err, response) {\r\n\r\n if (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n\r\n if (response === null) {\r\n self.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n\r\n if (!(response instanceof responseCtor)) {\r\n try {\r\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n }\r\n\r\n self.emit(\"data\", response, method);\r\n return callback(null, response);\r\n }\r\n );\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n setTimeout(function() { callback(err); }, 0);\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nService.prototype.end = function end(endedByRPC) {\r\n if (this.rpcImpl) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.rpcImpl(null, null, null);\r\n this.rpcImpl = null;\r\n this.emit(\"end\").off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(15);\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low 32 bits, unsigned\r\n * @param {number} hi High 32 bits, unsigned\r\n */\r\nfunction LongBits(lo, hi) {\r\n\r\n // note that the casts below are theoretically unnecessary as of today, but older statically\r\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo >>> 0;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi >>> 0;\r\n}\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Zero hash.\r\n * @memberof util.LongBits\r\n * @type {string}\r\n */\r\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n if (sign)\r\n value = -value;\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n if (typeof value === \"number\")\r\n return LongBits.fromNumber(value);\r\n if (util.isString(value)) {\r\n /* istanbul ignore else */\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBits.prototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n var lo = ~this.lo + 1 >>> 0,\r\n hi = ~this.hi >>> 0;\r\n if (!lo)\r\n hi = hi + 1 >>> 0;\r\n return -(lo + hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBits.prototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\r\n /* istanbul ignore next */\r\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n if (hash === zeroHash)\r\n return zero;\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBits.prototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 ,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBits.prototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n return part2 === 0\r\n ? part1 === 0\r\n ? part0 < 16384\r\n ? part0 < 128 ? 1 : 2\r\n : part0 < 2097152 ? 3 : 4\r\n : part1 < 16384\r\n ? part1 < 128 ? 5 : 6\r\n : part1 < 2097152 ? 7 : 8\r\n : part2 < 128 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nvar util = exports;\r\n\r\n// used to return a Promise where callback is omitted\r\nutil.asPromise = require(1);\r\n\r\n// converts to / from base64 encoded strings\r\nutil.base64 = require(2);\r\n\r\n// base class of rpc.Service\r\nutil.EventEmitter = require(3);\r\n\r\n// float handling accross browsers\r\nutil.float = require(4);\r\n\r\n// requires modules optionally and hides the call from bundlers\r\nutil.inquire = require(5);\r\n\r\n// converts to / from utf8 encoded strings\r\nutil.utf8 = require(7);\r\n\r\n// provides a node-like buffer pool in the browser\r\nutil.pool = require(6);\r\n\r\n// utility to work with the low and high bits of a 64 bit value\r\nutil.LongBits = require(14);\r\n\r\n// global object reference\r\nutil.global = typeof window !== \"undefined\" && window\r\n || typeof global !== \"undefined\" && global\r\n || typeof self !== \"undefined\" && self\r\n || this; // eslint-disable-line no-invalid-this\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n * @const\r\n */\r\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n * @const\r\n */\r\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n * @const\r\n */\r\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\r\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === \"string\" || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return value && typeof value === \"object\";\r\n};\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * This is an alias of {@link util.isSet}.\r\n * @function\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isset =\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isSet = function isSet(obj, prop) {\r\n var value = obj[prop];\r\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\r\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\r\n return false;\r\n};\r\n\r\n/**\r\n * Any compatible Buffer instance.\r\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\r\n * @interface Buffer\r\n * @extends Uint8Array\r\n */\r\n\r\n/**\r\n * Node's Buffer class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Buffer = (function() {\r\n try {\r\n var Buffer = util.inquire(\"buffer\").Buffer;\r\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\r\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n return null;\r\n }\r\n})();\r\n\r\n// Internal alias of or polyfull for Buffer.from.\r\nutil._Buffer_from = null;\r\n\r\n// Internal alias of or polyfill for Buffer.allocUnsafe.\r\nutil._Buffer_allocUnsafe = null;\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\r\n * @returns {Uint8Array|Buffer} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(sizeOrArray) {\r\n /* istanbul ignore next */\r\n return typeof sizeOrArray === \"number\"\r\n ? util.Buffer\r\n ? util._Buffer_allocUnsafe(sizeOrArray)\r\n : new util.Array(sizeOrArray)\r\n : util.Buffer\r\n ? util._Buffer_from(sizeOrArray)\r\n : typeof Uint8Array === \"undefined\"\r\n ? sizeOrArray\r\n : new Uint8Array(sizeOrArray);\r\n};\r\n\r\n/**\r\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\r\n * @type {Constructor}\r\n */\r\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\r\n * @interface Long\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Long.js's Long class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\r\n || /* istanbul ignore next */ util.global.Long\r\n || util.inquire(\"long\");\r\n\r\n/**\r\n * Regular expression used to verify 2 bit (`bool`) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key2Re = /^true|false|0|1$/;\r\n\r\n/**\r\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\r\n\r\n/**\r\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? util.LongBits.from(value).toHash()\r\n : util.LongBits.zeroHash;\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = util.LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @memberof util\r\n * @param {Object.} dst Destination object\r\n * @param {Object.} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object.} Destination object\r\n */\r\nfunction merge(dst, src, ifNotSet) { // used by converters\r\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n return dst;\r\n}\r\n\r\nutil.merge = merge;\r\n\r\n/**\r\n * Converts the first character of a string to lower case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.lcFirst = function lcFirst(str) {\r\n return str.charAt(0).toLowerCase() + str.substring(1);\r\n};\r\n\r\n/**\r\n * Creates a custom error constructor.\r\n * @memberof util\r\n * @param {string} name Error name\r\n * @returns {Constructor} Custom error constructor\r\n */\r\nfunction newError(name) {\r\n\r\n function CustomError(message, properties) {\r\n\r\n if (!(this instanceof CustomError))\r\n return new CustomError(message, properties);\r\n\r\n // Error.call(this, message);\r\n // ^ just returns a new error instance because the ctor can be called as a function\r\n\r\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\r\n\r\n /* istanbul ignore next */\r\n if (Error.captureStackTrace) // node\r\n Error.captureStackTrace(this, CustomError);\r\n else\r\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\r\n\r\n if (properties)\r\n merge(this, properties);\r\n }\r\n\r\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\r\n\r\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\r\n\r\n CustomError.prototype.toString = function toString() {\r\n return this.name + \": \" + this.message;\r\n };\r\n\r\n return CustomError;\r\n}\r\n\r\nutil.newError = newError;\r\n\r\n/**\r\n * Constructs a new protocol error.\r\n * @classdesc Error subclass indicating a protocol specifc error.\r\n * @memberof util\r\n * @extends Error\r\n * @template T extends Message\r\n * @constructor\r\n * @param {string} message Error message\r\n * @param {Object.} [properties] Additional properties\r\n * @example\r\n * try {\r\n * MyMessage.decode(someBuffer); // throws if required fields are missing\r\n * } catch (e) {\r\n * if (e instanceof ProtocolError && e.instance)\r\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\r\n * }\r\n */\r\nutil.ProtocolError = newError(\"ProtocolError\");\r\n\r\n/**\r\n * So far decoded message instance.\r\n * @name util.ProtocolError#instance\r\n * @type {Message}\r\n */\r\n\r\n/**\r\n * A OneOf getter as returned by {@link util.oneOfGetter}.\r\n * @typedef OneOfGetter\r\n * @type {function}\r\n * @returns {string|undefined} Set field name, if any\r\n */\r\n\r\n/**\r\n * Builds a getter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfGetter} Unbound getter\r\n */\r\nutil.oneOfGetter = function getOneOf(fieldNames) {\r\n var fieldMap = {};\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n fieldMap[fieldNames[i]] = 1;\r\n\r\n /**\r\n * @returns {string|undefined} Set field name, if any\r\n * @this Object\r\n * @ignore\r\n */\r\n return function() { // eslint-disable-line consistent-return\r\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\r\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\r\n return keys[i];\r\n };\r\n};\r\n\r\n/**\r\n * A OneOf setter as returned by {@link util.oneOfSetter}.\r\n * @typedef OneOfSetter\r\n * @type {function}\r\n * @param {string|undefined} value Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Builds a setter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfSetter} Unbound setter\r\n */\r\nutil.oneOfSetter = function setOneOf(fieldNames) {\r\n\r\n /**\r\n * @param {string} name Field name\r\n * @returns {undefined}\r\n * @this Object\r\n * @ignore\r\n */\r\n return function(name) {\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n if (fieldNames[i] !== name)\r\n delete this[fieldNames[i]];\r\n };\r\n};\r\n\r\n/**\r\n * Default conversion options used for {@link Message#toJSON} implementations.\r\n *\r\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\r\n *\r\n * - Longs become strings\r\n * - Enums become string keys\r\n * - Bytes become base64 encoded strings\r\n * - (Sub-)Messages become plain objects\r\n * - Maps become plain objects with all string keys\r\n * - Repeated fields become arrays\r\n * - NaN and Infinity for float and double fields become strings\r\n *\r\n * @type {IConversionOptions}\r\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\r\n */\r\nutil.toJSONOptions = {\r\n longs: String,\r\n enums: String,\r\n bytes: String,\r\n json: true\r\n};\r\n\r\n// Sets up buffer utility according to the environment (called in index-minimal)\r\nutil._configure = function() {\r\n var Buffer = util.Buffer;\r\n /* istanbul ignore if */\r\n if (!Buffer) {\r\n util._Buffer_from = util._Buffer_allocUnsafe = null;\r\n return;\r\n }\r\n // because node 4.x buffers are incompatible & immutable\r\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\r\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\r\n /* istanbul ignore next */\r\n function Buffer_from(value, encoding) {\r\n return new Buffer(value, encoding);\r\n };\r\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\r\n /* istanbul ignore next */\r\n function Buffer_allocUnsafe(size) {\r\n return new Buffer(size);\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nvar util = require(15);\r\n\r\nvar BufferWriter; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n base64 = util.base64,\r\n utf8 = util.utf8;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @constructor\r\n * @param {function(*, Uint8Array, number)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {*} val Value to write\r\n * @ignore\r\n */\r\nfunction Op(fn, len, val) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {Writer.Op|undefined}\r\n */\r\n this.next = undefined;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val; // type varies\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @ignore\r\n */\r\nfunction State(writer) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {State|null}\r\n */\r\n this.next = writer.states;\r\n}\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {Object|null}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @function\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = util.Buffer\r\n ? function create_buffer_setup() {\r\n return (Writer.create = function create_buffer() {\r\n return new BufferWriter();\r\n })();\r\n }\r\n /* istanbul ignore next */\r\n : function create_array() {\r\n return new Writer();\r\n };\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new util.Array(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\n/* istanbul ignore else */\r\nif (util.Array !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n * @private\r\n */\r\nWriter.prototype._push = function push(fn, len, val) {\r\n this.tail = this.tail.next = new Op(fn, len, val);\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(val, buf, pos) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\nfunction writeVarint32(val, buf, pos) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Constructs a new varint writer operation instance.\r\n * @classdesc Scheduled varint writer operation.\r\n * @extends Op\r\n * @constructor\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @ignore\r\n */\r\nfunction VarintOp(len, val) {\r\n this.len = len;\r\n this.next = undefined;\r\n this.val = val;\r\n}\r\n\r\nVarintOp.prototype = Object.create(Op.prototype);\r\nVarintOp.prototype.fn = writeVarint32;\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.uint32 = function write_uint32(value) {\r\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\r\n // uint32 is by far the most frequently used operation and benefits significantly from this.\r\n this.len += (this.tail = this.tail.next = new VarintOp(\r\n (value = value >>> 0)\r\n < 128 ? 1\r\n : value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5,\r\n value)).len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sint32 = function write_sint32(value) {\r\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\r\n};\r\n\r\nfunction writeVarint64(val, buf, pos) {\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.int64 = Writer.prototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bool = function write_bool(value) {\r\n return this._push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fixed32 = function write_fixed32(value) {\r\n return this._push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as fixed 32 bits.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as fixed 64 bits.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.float = function write_float(value) {\r\n return this._push(util.float.writeFloatLE, 4, value);\r\n};\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.double = function write_double(value) {\r\n return this._push(util.float.writeDoubleLE, 8, value);\r\n};\r\n\r\nvar writeBytes = util.Array.prototype.set\r\n ? function writeBytes_set(val, buf, pos) {\r\n buf.set(val, pos); // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytes_for(val, buf, pos) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (!len)\r\n return this._push(writeByte, 1, 0);\r\n if (util.isString(value)) {\r\n var buf = Writer.alloc(len = base64.length(value));\r\n base64.decode(value, buf, 0);\r\n value = buf;\r\n }\r\n return this.uint32(len)._push(writeBytes, len, value);\r\n};\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.string = function write_string(value) {\r\n var len = utf8.length(value);\r\n return len\r\n ? this.uint32(len)._push(utf8.write, len, value)\r\n : this._push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fork = function fork() {\r\n this.states = new State(this);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.ldelim = function ldelim() {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset().uint32(len);\r\n if (len) {\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriter.prototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len),\r\n pos = 0;\r\n while (head) {\r\n head.fn(head.val, buf, pos);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n // this.head = this.tail = null;\r\n return buf;\r\n};\r\n\r\nWriter._configure = function(BufferWriter_) {\r\n BufferWriter = BufferWriter_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferWriter;\r\n\r\n// extends Writer\r\nvar Writer = require(16);\r\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\r\n\r\nvar util = require(15);\r\n\r\nvar Buffer = util.Buffer;\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Buffer} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\r\n};\r\n\r\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\r\n ? function writeBytesBuffer_set(val, buf, pos) {\r\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\r\n // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytesBuffer_copy(val, buf, pos) {\r\n if (val.copy) // Buffer values\r\n val.copy(buf, pos, 0, val.length);\r\n else for (var i = 0; i < val.length;) // plain array values\r\n buf[pos++] = val[i++];\r\n };\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\r\n if (util.isString(value))\r\n value = util._Buffer_from(value, \"base64\");\r\n var len = value.length >>> 0;\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeBytesBuffer, len, value);\r\n return this;\r\n};\r\n\r\nfunction writeStringBuffer(val, buf, pos) {\r\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\r\n util.utf8.write(val, buf, pos);\r\n else\r\n buf.utf8Write(val, pos);\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.string = function write_string_buffer(value) {\r\n var len = Buffer.byteLength(value);\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeStringBuffer, len, value);\r\n return this;\r\n};\r\n\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @name BufferWriter#finish\r\n * @function\r\n * @returns {Buffer} Finished buffer\r\n */\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/node_modules/protobufjs/dist/protobuf.js b/node_modules/protobufjs/dist/protobuf.js new file mode 100644 index 0000000..c3e1c02 --- /dev/null +++ b/node_modules/protobufjs/dist/protobuf.js @@ -0,0 +1,8726 @@ +/*! + * protobuf.js v6.8.8 (c) 2016, daniel wirtz + * compiled thu, 19 jul 2018 00:33:25 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +(function(undefined){"use strict";(function prelude(modules, cache, entries) { + + // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS + // sources through a conflict-free require shim and is again wrapped within an iife that + // provides a minification-friendly `undefined` var plus a global "use strict" directive + // so that minification can remove the directives of each module. + + function $require(name) { + var $module = cache[name]; + if (!$module) + modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); + return $module.exports; + } + + var protobuf = $require(entries[0]); + + // Expose globally + protobuf.util.global.protobuf = protobuf; + + // Be nice to AMD + if (typeof define === "function" && define.amd) + define(["long"], function(Long) { + if (Long && Long.isLong) { + protobuf.util.Long = Long; + protobuf.configure(); + } + return protobuf; + }); + + // Be nice to CommonJS + if (typeof module === "object" && module && module.exports) + module.exports = protobuf; + +})/* end of prelude */({1:[function(require,module,exports){ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + +},{}],2:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + +},{}],3:[function(require,module,exports){ +"use strict"; +module.exports = codegen; + +/** + * Begins generating a function. + * @memberof util + * @param {string[]} functionParams Function parameter names + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + */ +function codegen(functionParams, functionName) { + + /* istanbul ignore if */ + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = undefined; + } + + var body = []; + + /** + * Appends code to the function's body or finishes generation. + * @typedef Codegen + * @type {function} + * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param {...*} [formatParams] Format parameters + * @returns {Codegen|Function} Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ + + function Codegen(formatStringOrScope) { + // note that explicit array handling below makes this ~50% faster + + // finish the function + if (typeof formatStringOrScope !== "string") { + var source = toString(); + if (codegen.verbose) + console.log("codegen: " + source); // eslint-disable-line no-console + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), + scopeParams = new Array(scopeKeys.length + 1), + scopeValues = new Array(scopeKeys.length), + scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func + } + return Function(source)(); // eslint-disable-line no-new-func + } + + // otherwise append to body + var formatParams = new Array(arguments.length - 1), + formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { + var value = formatParams[formatOffset++]; + switch ($1) { + case "d": case "f": return String(Number(value)); + case "i": return String(Math.floor(value)); + case "j": return JSON.stringify(value); + case "s": return String(value); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + + function toString(functionNameOverride) { + return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + + Codegen.toString = toString; + return Codegen; +} + +/** + * Begins generating a function. + * @memberof util + * @function codegen + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + * @variation 2 + */ + +/** + * When set to `true`, codegen will log generated code to console. Useful for debugging. + * @name util.codegen.verbose + * @type {boolean} + */ +codegen.verbose = false; + +},{}],4:[function(require,module,exports){ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + +},{}],5:[function(require,module,exports){ +"use strict"; +module.exports = fetch; + +var asPromise = require(1), + inquire = require(7); + +var fs = inquire("fs"); + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Options as used by {@link util.fetch}. + * @typedef FetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {FetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +function fetch(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + if (!callback) + return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this + + // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" + ? fetch.xhr(filename, options, callback) + : err + ? callback(err) + : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + + // use the XHR version otherwise. + return fetch.xhr(filename, options, callback); +} + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ + +/**/ +fetch.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { + + if (xhr.readyState !== 4) + return undefined; + + // local cors security errors return status 0 / empty string, too. afaik this cannot be + // reliably distinguished from an actually empty file for security reasons. feel free + // to send a pull request if you are aware of a solution. + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + + // if binary data is expected, make sure that some sort of array is returned, even if + // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. + if (options.binary) { + var buffer = xhr.response; + if (!buffer) { + buffer = []; + for (var i = 0; i < xhr.responseText.length; ++i) + buffer.push(xhr.responseText.charCodeAt(i) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); + } + return callback(null, xhr.responseText); + }; + + if (options.binary) { + // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + + xhr.open("GET", filename); + xhr.send(); +}; + +},{"1":1,"7":7}],6:[function(require,module,exports){ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + +},{}],7:[function(require,module,exports){ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + +},{}],8:[function(require,module,exports){ +"use strict"; + +/** + * A minimal path module to resolve Unix, Windows and URL paths alike. + * @memberof util + * @namespace + */ +var path = exports; + +var isAbsolute = +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +path.isAbsolute = function isAbsolute(path) { + return /^(?:\/|\w+:)/.test(path); +}; + +var normalize = +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +path.normalize = function normalize(path) { + path = path.replace(/\\/g, "/") + .replace(/\/{2,}/g, "/"); + var parts = path.split("/"), + absolute = isAbsolute(path), + prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i = 0; i < parts.length;) { + if (parts[i] === "..") { + if (i > 0 && parts[i - 1] !== "..") + parts.splice(--i, 2); + else if (absolute) + parts.splice(i, 1); + else + ++i; + } else if (parts[i] === ".") + parts.splice(i, 1); + else + ++i; + } + return prefix + parts.join("/"); +}; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +path.resolve = function resolve(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize(includePath); + if (isAbsolute(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; +}; + +},{}],9:[function(require,module,exports){ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +},{}],10:[function(require,module,exports){ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + +},{}],11:[function(require,module,exports){ +"use strict"; +module.exports = common; + +var commonRe = /\/|\./; + +/** + * Provides common type definitions. + * Can also be used to provide additional google types or your own custom types. + * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name + * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition + * @returns {undefined} + * @property {INamespace} google/protobuf/any.proto Any + * @property {INamespace} google/protobuf/duration.proto Duration + * @property {INamespace} google/protobuf/empty.proto Empty + * @property {INamespace} google/protobuf/field_mask.proto FieldMask + * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue + * @property {INamespace} google/protobuf/timestamp.proto Timestamp + * @property {INamespace} google/protobuf/wrappers.proto Wrappers + * @example + * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension) + * protobuf.common("descriptor", descriptorJson); + * + * // manually provides a custom definition (uses my.foo namespace) + * protobuf.common("my/foo/bar.proto", myFooBarJson); + */ +function common(name, json) { + if (!commonRe.test(name)) { + name = "google/protobuf/" + name + ".proto"; + json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; + } + common[name] = json; +} + +// Not provided because of limited use (feel free to discuss or to provide yourself): +// +// google/protobuf/descriptor.proto +// google/protobuf/source_context.proto +// google/protobuf/type.proto +// +// Stripped and pre-parsed versions of these non-bundled files are instead available as part of +// the repository or package within the google/protobuf directory. + +common("any", { + + /** + * Properties of a google.protobuf.Any message. + * @interface IAny + * @type {Object} + * @property {string} [typeUrl] + * @property {Uint8Array} [bytes] + * @memberof common + */ + Any: { + fields: { + type_url: { + type: "string", + id: 1 + }, + value: { + type: "bytes", + id: 2 + } + } + } +}); + +var timeType; + +common("duration", { + + /** + * Properties of a google.protobuf.Duration message. + * @interface IDuration + * @type {Object} + * @property {number|Long} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Duration: timeType = { + fields: { + seconds: { + type: "int64", + id: 1 + }, + nanos: { + type: "int32", + id: 2 + } + } + } +}); + +common("timestamp", { + + /** + * Properties of a google.protobuf.Timestamp message. + * @interface ITimestamp + * @type {Object} + * @property {number|Long} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Timestamp: timeType +}); + +common("empty", { + + /** + * Properties of a google.protobuf.Empty message. + * @interface IEmpty + * @memberof common + */ + Empty: { + fields: {} + } +}); + +common("struct", { + + /** + * Properties of a google.protobuf.Struct message. + * @interface IStruct + * @type {Object} + * @property {Object.} [fields] + * @memberof common + */ + Struct: { + fields: { + fields: { + keyType: "string", + type: "Value", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Value message. + * @interface IValue + * @type {Object} + * @property {string} [kind] + * @property {0} [nullValue] + * @property {number} [numberValue] + * @property {string} [stringValue] + * @property {boolean} [boolValue] + * @property {IStruct} [structValue] + * @property {IListValue} [listValue] + * @memberof common + */ + Value: { + oneofs: { + kind: { + oneof: [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + fields: { + nullValue: { + type: "NullValue", + id: 1 + }, + numberValue: { + type: "double", + id: 2 + }, + stringValue: { + type: "string", + id: 3 + }, + boolValue: { + type: "bool", + id: 4 + }, + structValue: { + type: "Struct", + id: 5 + }, + listValue: { + type: "ListValue", + id: 6 + } + } + }, + + NullValue: { + values: { + NULL_VALUE: 0 + } + }, + + /** + * Properties of a google.protobuf.ListValue message. + * @interface IListValue + * @type {Object} + * @property {Array.} [values] + * @memberof common + */ + ListValue: { + fields: { + values: { + rule: "repeated", + type: "Value", + id: 1 + } + } + } +}); + +common("wrappers", { + + /** + * Properties of a google.protobuf.DoubleValue message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + DoubleValue: { + fields: { + value: { + type: "double", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.FloatValue message. + * @interface IFloatValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FloatValue: { + fields: { + value: { + type: "float", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int64Value message. + * @interface IInt64Value + * @type {Object} + * @property {number|Long} [value] + * @memberof common + */ + Int64Value: { + fields: { + value: { + type: "int64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt64Value message. + * @interface IUInt64Value + * @type {Object} + * @property {number|Long} [value] + * @memberof common + */ + UInt64Value: { + fields: { + value: { + type: "uint64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int32Value message. + * @interface IInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + Int32Value: { + fields: { + value: { + type: "int32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt32Value message. + * @interface IUInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + UInt32Value: { + fields: { + value: { + type: "uint32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BoolValue message. + * @interface IBoolValue + * @type {Object} + * @property {boolean} [value] + * @memberof common + */ + BoolValue: { + fields: { + value: { + type: "bool", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.StringValue message. + * @interface IStringValue + * @type {Object} + * @property {string} [value] + * @memberof common + */ + StringValue: { + fields: { + value: { + type: "string", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BytesValue message. + * @interface IBytesValue + * @type {Object} + * @property {Uint8Array} [value] + * @memberof common + */ + BytesValue: { + fields: { + value: { + type: "bytes", + id: 1 + } + } + } +}); + +common("field_mask", { + + /** + * Properties of a google.protobuf.FieldMask message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FieldMask: { + fields: { + paths: { + rule: "repeated", + type: "string", + id: 1 + } + } + } +}); + +/** + * Gets the root definition of the specified common proto file. + * + * Bundled definitions are: + * - google/protobuf/any.proto + * - google/protobuf/duration.proto + * - google/protobuf/empty.proto + * - google/protobuf/field_mask.proto + * - google/protobuf/struct.proto + * - google/protobuf/timestamp.proto + * - google/protobuf/wrappers.proto + * + * @param {string} file Proto file name + * @returns {INamespace|null} Root definition or `null` if not defined + */ +common.get = function get(file) { + return common[file] || null; +}; + +},{}],12:[function(require,module,exports){ +"use strict"; +/** + * Runtime message from/to plain object converters. + * @namespace + */ +var converter = exports; + +var Enum = require(15), + util = require(37); + +/** + * Generates a partial value fromObject conveter. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} prop Property reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genValuePartial_fromObject(gen, field, fieldIndex, prop) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(d%s){", prop); + for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { + if (field.repeated && values[keys[i]] === field.typeDefault) gen + ("default:"); + gen + ("case%j:", keys[i]) + ("case %i:", values[keys[i]]) + ("m%s=%j", prop, values[keys[i]]) + ("break"); + } gen + ("}"); + } else gen + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); + } else { + var isUnsigned = false; + switch (field.type) { + case "double": + case "float": gen + ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" + break; + case "uint32": + case "fixed32": gen + ("m%s=d%s>>>0", prop, prop); + break; + case "int32": + case "sint32": + case "sfixed32": gen + ("m%s=d%s|0", prop, prop); + break; + case "uint64": + isUnsigned = true; + // eslint-disable-line no-fallthrough + case "int64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(util.Long)") + ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) + ("else if(typeof d%s===\"string\")", prop) + ("m%s=parseInt(d%s,10)", prop, prop) + ("else if(typeof d%s===\"number\")", prop) + ("m%s=d%s", prop, prop) + ("else if(typeof d%s===\"object\")", prop) + ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); + break; + case "bytes": gen + ("if(typeof d%s===\"string\")", prop) + ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) + ("else if(d%s.length)", prop) + ("m%s=d%s", prop, prop); + break; + case "string": gen + ("m%s=String(d%s)", prop, prop); + break; + case "bool": gen + ("m%s=Boolean(d%s)", prop, prop); + break; + /* default: gen + ("m%s=d%s", prop, prop); + break; */ + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.fromObject = function fromObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray; + var gen = util.codegen(["d"], mtype.name + "$fromObject") + ("if(d instanceof this.ctor)") + ("return d"); + if (!fields.length) return gen + ("return new this.ctor"); + gen + ("var m=new this.ctor"); + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + prop = util.safeProp(field.name); + + // Map fields + if (field.map) { gen + ("if(d%s){", prop) + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s={}", prop) + ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); + break; + case "bytes": gen + ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); + break; + default: gen + ("d%s=m%s", prop, prop); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.toObject = function toObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); + if (!fields.length) + return util.codegen()("return {}"); + var gen = util.codegen(["m", "o"], mtype.name + "$toObject") + ("if(!o)") + ("o={}") + ("var d={}"); + + var repeatedFields = [], + mapFields = [], + normalFields = [], + i = 0; + for (; i < fields.length; ++i) + if (!fields[i].partOf) + ( fields[i].resolve().repeated ? repeatedFields + : fields[i].map ? mapFields + : normalFields).push(fields[i]); + + if (repeatedFields.length) { gen + ("if(o.arrays||o.defaults){"); + for (i = 0; i < repeatedFields.length; ++i) gen + ("d%s=[]", util.safeProp(repeatedFields[i].name)); + gen + ("}"); + } + + if (mapFields.length) { gen + ("if(o.objects||o.defaults){"); + for (i = 0; i < mapFields.length; ++i) gen + ("d%s={}", util.safeProp(mapFields[i].name)); + gen + ("}"); + } + + if (normalFields.length) { gen + ("if(o.defaults){"); + for (i = 0; i < normalFields.length; ++i) { + var field = normalFields[i], + prop = util.safeProp(field.name); + if (field.resolvedType instanceof Enum) gen + ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); + else if (field.long) gen + ("if(util.Long){") + ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) + ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) + ("}else") + ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); + else if (field.bytes) { + var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; + gen + ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) + ("else{") + ("d%s=%s", prop, arrayDefault) + ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) + ("}"); + } else gen + ("d%s=%j", prop, field.typeDefault); // also messages (=null) + } gen + ("}"); + } + var hasKs2 = false; + for (i = 0; i < fields.length; ++i) { + var field = fields[i], + index = mtype._fieldsArray.indexOf(field), + prop = util.safeProp(field.name); + if (field.map) { + if (!hasKs2) { hasKs2 = true; gen + ("var ks2"); + } gen + ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) + ("d%s={}", prop) + ("for(var j=0;j>>3){"); + + var i = 0; + for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + ref = "m" + util.safeProp(field.name); gen + ("case %i:", field.id); + + // Map fields + if (field.map) { gen + ("r.skip().pos++") // assumes id 1 + key wireType + ("if(%s===util.emptyObject)", ref) + ("%s={}", ref) + ("k=r.%s()", field.keyType) + ("r.pos++"); // assumes id 2 + value wireType + if (types.long[field.keyType] !== undefined) { + if (types.basic[type] === undefined) gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=r.%s()", ref, type); + } else { + if (types.basic[type] === undefined) gen + ("%s[k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[k]=r.%s()", ref, type); + } + + // Repeated fields + } else if (field.repeated) { gen + + ("if(!(%s&&%s.length))", ref, ref) + ("%s=[]", ref); + + // Packable (always check for forward and backward compatiblity) + if (types.packed[type] !== undefined) gen + ("if((t&7)===2){") + ("var c2=r.uint32()+r.pos") + ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0) + : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); +} + +/** + * Generates an encoder specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function encoder(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var gen = util.codegen(["m", "w"], mtype.name + "$encode") + ("if(!w)") + ("w=Writer.create()"); + + var i, ref; + + // "when a message is serialized its known fields should be written sequentially by field number" + var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); + + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + index = mtype._fieldsArray.indexOf(field), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + wireType = types.basic[type]; + ref = "m" + util.safeProp(field.name); + + // Map fields + if (field.map) { + gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name) // !== undefined && !== null + ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); + if (wireType === undefined) gen + ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups + else gen + (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); + gen + ("}") + ("}"); + + // Repeated fields + } else if (field.repeated) { gen + ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null + + // Packed repeated + if (field.packed && types.packed[type] !== undefined) { gen + + ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) + ("for(var i=0;i<%s.length;++i)", ref) + ("w.%s(%s[i])", type, ref) + ("w.ldelim()"); + + // Non-packed + } else { gen + + ("for(var i=0;i<%s.length;++i)", ref); + if (wireType === undefined) + genTypePartial(gen, field, index, ref + "[i]"); + else gen + ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); + + } gen + ("}"); + + // Non-repeated + } else { + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j))", ref, field.name); // !== undefined && !== null + + if (wireType === undefined) + genTypePartial(gen, field, index, ref); + else gen + ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); + + } + } + + return gen + ("return w"); + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} +},{"15":15,"36":36,"37":37}],15:[function(require,module,exports){ +"use strict"; +module.exports = Enum; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; + +var Namespace = require(23), + util = require(37); + +/** + * Constructs a new enum instance. + * @classdesc Reflected enum. + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {Object.} [values] Enum values as an object, by name + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this enum + * @param {Object.} [comments] The value comments for this enum + */ +function Enum(name, values, options, comment, comments) { + ReflectionObject.call(this, name, options); + + if (values && typeof values !== "object") + throw TypeError("values must be an object"); + + /** + * Enum values by id. + * @type {Object.} + */ + this.valuesById = {}; + + /** + * Enum values by name. + * @type {Object.} + */ + this.values = Object.create(this.valuesById); // toJSON, marker + + /** + * Enum comment text. + * @type {string|null} + */ + this.comment = comment; + + /** + * Value comment texts, if any. + * @type {Object.} + */ + this.comments = comments || {}; + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + // Note that values inherit valuesById on their prototype which makes them a TypeScript- + // compatible enum. This is used by pbts to write actual enum definitions that work for + // static and reflection code alike instead of emitting generic object definitions. + + if (values) + for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) + if (typeof values[keys[i]] === "number") // use forward entries only + this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; +} + +/** + * Enum descriptor. + * @interface IEnum + * @property {Object.} values Enum values + * @property {Object.} [options] Enum options + */ + +/** + * Constructs an enum from an enum descriptor. + * @param {string} name Enum name + * @param {IEnum} json Enum descriptor + * @returns {Enum} Created enum + * @throws {TypeError} If arguments are invalid + */ +Enum.fromJSON = function fromJSON(name, json) { + var enm = new Enum(name, json.values, json.options, json.comment, json.comments); + enm.reserved = json.reserved; + return enm; +}; + +/** + * Converts this enum to an enum descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IEnum} Enum descriptor + */ +Enum.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "values" , this.values, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "comment" , keepComments ? this.comment : undefined, + "comments" , keepComments ? this.comments : undefined + ]); +}; + +/** + * Adds a value to this enum. + * @param {string} name Value name + * @param {number} id Value id + * @param {string} [comment] Comment, if any + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ +Enum.prototype.add = function add(name, id, comment) { + // utilized by the parser but not by .fromJSON + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (!util.isInteger(id)) + throw TypeError("id must be an integer"); + + if (this.values[name] !== undefined) + throw Error("duplicate name '" + name + "' in " + this); + + if (this.isReservedId(id)) + throw Error("id " + id + " is reserved in " + this); + + if (this.isReservedName(name)) + throw Error("name '" + name + "' is reserved in " + this); + + if (this.valuesById[id] !== undefined) { + if (!(this.options && this.options.allow_alias)) + throw Error("duplicate id " + id + " in " + this); + this.values[name] = id; + } else + this.valuesById[this.values[name] = id] = name; + + this.comments[name] = comment || null; + return this; +}; + +/** + * Removes a value from this enum + * @param {string} name Value name + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ +Enum.prototype.remove = function remove(name) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + var val = this.values[name]; + if (val == null) + throw Error("name '" + name + "' does not exist in " + this); + + delete this.valuesById[val]; + delete this.values[name]; + delete this.comments[name]; + + return this; +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +},{"23":23,"24":24,"37":37}],16:[function(require,module,exports){ +"use strict"; +module.exports = Field; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; + +var Enum = require(15), + types = require(36), + util = require(37); + +var Type; // cyclic + +var ruleRe = /^required|optional|repeated$/; + +/** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @name Field + * @classdesc Reflected message field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a field from a field descriptor. + * @param {string} name Field name + * @param {IField} json Field descriptor + * @returns {Field} Created field + * @throws {TypeError} If arguments are invalid + */ +Field.fromJSON = function fromJSON(name, json) { + return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); +}; + +/** + * Not an actual constructor. Use {@link Field} instead. + * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. + * @exports FieldBase + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function Field(name, id, type, rule, extend, options, comment) { + + if (util.isObject(rule)) { + comment = extend; + options = rule; + rule = extend = undefined; + } else if (util.isObject(extend)) { + comment = options; + options = extend; + extend = undefined; + } + + ReflectionObject.call(this, name, options); + + if (!util.isInteger(id) || id < 0) + throw TypeError("id must be a non-negative integer"); + + if (!util.isString(type)) + throw TypeError("type must be a string"); + + if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) + throw TypeError("rule must be a string rule"); + + if (extend !== undefined && !util.isString(extend)) + throw TypeError("extend must be a string"); + + /** + * Field rule, if any. + * @type {string|undefined} + */ + this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON + + /** + * Field type. + * @type {string} + */ + this.type = type; // toJSON + + /** + * Unique field id. + * @type {number} + */ + this.id = id; // toJSON, marker + + /** + * Extended type if different from parent. + * @type {string|undefined} + */ + this.extend = extend || undefined; // toJSON + + /** + * Whether this field is required. + * @type {boolean} + */ + this.required = rule === "required"; + + /** + * Whether this field is optional. + * @type {boolean} + */ + this.optional = !this.required; + + /** + * Whether this field is repeated. + * @type {boolean} + */ + this.repeated = rule === "repeated"; + + /** + * Whether this field is a map or not. + * @type {boolean} + */ + this.map = false; + + /** + * Message this field belongs to. + * @type {Type|null} + */ + this.message = null; + + /** + * OneOf this field belongs to, if any, + * @type {OneOf|null} + */ + this.partOf = null; + + /** + * The field type's default value. + * @type {*} + */ + this.typeDefault = null; + + /** + * The field's default value on prototypes. + * @type {*} + */ + this.defaultValue = null; + + /** + * Whether this field's value should be treated as a long. + * @type {boolean} + */ + this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; + + /** + * Whether this field's value is a buffer. + * @type {boolean} + */ + this.bytes = type === "bytes"; + + /** + * Resolved type if not a basic type. + * @type {Type|Enum|null} + */ + this.resolvedType = null; + + /** + * Sister-field within the extended type if a declaring extension field. + * @type {Field|null} + */ + this.extensionField = null; + + /** + * Sister-field within the declaring namespace if an extended field. + * @type {Field|null} + */ + this.declaringField = null; + + /** + * Internally remembers whether this field is packed. + * @type {boolean|null} + * @private + */ + this._packed = null; + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Determines whether this field is packed. Only relevant when repeated and working with proto2. + * @name Field#packed + * @type {boolean} + * @readonly + */ +Object.defineProperty(Field.prototype, "packed", { + get: function() { + // defaults to packed=true if not explicity set to false + if (this._packed === null) + this._packed = this.getOption("packed") !== false; + return this._packed; + } +}); + +/** + * @override + */ +Field.prototype.setOption = function setOption(name, value, ifNotSet) { + if (name === "packed") // clear cached before setting + this._packed = null; + return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); +}; + +/** + * Field descriptor. + * @interface IField + * @property {string} [rule="optional"] Field rule + * @property {string} type Field type + * @property {number} id Field id + * @property {Object.} [options] Field options + */ + +/** + * Extension field descriptor. + * @interface IExtensionField + * @extends IField + * @property {string} extend Extended type + */ + +/** + * Converts this field to a field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IField} Field descriptor + */ +Field.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "rule" , this.rule !== "optional" && this.rule || undefined, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Resolves this field's type references. + * @returns {Field} `this` + * @throws {Error} If any reference cannot be resolved + */ +Field.prototype.resolve = function resolve() { + + if (this.resolved) + return this; + + if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it + this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); + if (this.resolvedType instanceof Type) + this.typeDefault = null; + else // instanceof Enum + this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined + } + + // use explicitly set default value if present + if (this.options && this.options["default"] != null) { + this.typeDefault = this.options["default"]; + if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") + this.typeDefault = this.resolvedType.values[this.typeDefault]; + } + + // remove unnecessary options + if (this.options) { + if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) + delete this.options.packed; + if (!Object.keys(this.options).length) + this.options = undefined; + } + + // convert to internal data type if necesssary + if (this.long) { + this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); + + /* istanbul ignore else */ + if (Object.freeze) + Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) + + } else if (this.bytes && typeof this.typeDefault === "string") { + var buf; + if (util.base64.test(this.typeDefault)) + util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); + else + util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); + this.typeDefault = buf; + } + + // take special care of maps and repeated fields + if (this.map) + this.defaultValue = util.emptyObject; + else if (this.repeated) + this.defaultValue = util.emptyArray; + else + this.defaultValue = this.typeDefault; + + // ensure proper value on prototype + if (this.parent instanceof Type) + this.parent.ctor.prototype[this.name] = this.defaultValue; + + return ReflectionObject.prototype.resolve.call(this); +}; + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @typedef FieldDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} fieldName Field name + * @returns {undefined} + */ + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @param {T} [defaultValue] Default value + * @returns {FieldDecorator} Decorator function + * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] + */ +Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { + + // submessage: decorate the submessage and use its name as the type + if (typeof fieldType === "function") + fieldType = util.decorateType(fieldType).name; + + // enum reference: create a reflected copy of the enum and keep reuseing it + else if (fieldType && typeof fieldType === "object") + fieldType = util.decorateEnum(fieldType).name; + + return function fieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); + }; +}; + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {Constructor|string} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @returns {FieldDecorator} Decorator function + * @template T extends Message + * @variation 2 + */ +// like Field.d but without a default value + +// Sets up cyclic dependencies (called in index-light) +Field._configure = function configure(Type_) { + Type = Type_; +}; + +},{"15":15,"24":24,"36":36,"37":37}],17:[function(require,module,exports){ +"use strict"; +var protobuf = module.exports = require(18); + +protobuf.build = "light"; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @typedef LoadCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Root} [root] Root, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param {string|string[]} filename One or multiple files to load + * @param {Root} root Root namespace, defaults to create a new one if omitted. + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + */ +function load(filename, root, callback) { + if (typeof root === "function") { + callback = root; + root = new protobuf.Root(); + } else if (!root) + root = new protobuf.Root(); + return root.load(filename, callback); +} + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Promise} Promise + * @see {@link Root#load} + * @variation 3 + */ +// function load(filename:string, [root:Root]):Promise + +protobuf.load = load; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +function loadSync(filename, root) { + if (!root) + root = new protobuf.Root(); + return root.loadSync(filename); +} + +protobuf.loadSync = loadSync; + +// Serialization +protobuf.encoder = require(14); +protobuf.decoder = require(13); +protobuf.verifier = require(40); +protobuf.converter = require(12); + +// Reflection +protobuf.ReflectionObject = require(24); +protobuf.Namespace = require(23); +protobuf.Root = require(29); +protobuf.Enum = require(15); +protobuf.Type = require(35); +protobuf.Field = require(16); +protobuf.OneOf = require(25); +protobuf.MapField = require(20); +protobuf.Service = require(33); +protobuf.Method = require(22); + +// Runtime +protobuf.Message = require(21); +protobuf.wrappers = require(41); + +// Utility +protobuf.types = require(36); +protobuf.util = require(37); + +// Set up possibly cyclic reflection dependencies +protobuf.ReflectionObject._configure(protobuf.Root); +protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); +protobuf.Root._configure(protobuf.Type); +protobuf.Field._configure(protobuf.Type); + +},{"12":12,"13":13,"14":14,"15":15,"16":16,"18":18,"20":20,"21":21,"22":22,"23":23,"24":24,"25":25,"29":29,"33":33,"35":35,"36":36,"37":37,"40":40,"41":41}],18:[function(require,module,exports){ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require(42); +protobuf.BufferWriter = require(43); +protobuf.Reader = require(27); +protobuf.BufferReader = require(28); + +// Utility +protobuf.util = require(39); +protobuf.rpc = require(31); +protobuf.roots = require(30); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.Reader._configure(protobuf.BufferReader); + protobuf.util._configure(); +} + +// Set up buffer utility according to the environment +protobuf.Writer._configure(protobuf.BufferWriter); +configure(); + +},{"27":27,"28":28,"30":30,"31":31,"39":39,"42":42,"43":43}],19:[function(require,module,exports){ +"use strict"; +var protobuf = module.exports = require(17); + +protobuf.build = "full"; + +// Parser +protobuf.tokenize = require(34); +protobuf.parse = require(26); +protobuf.common = require(11); + +// Configure parser +protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common); + +},{"11":11,"17":17,"26":26,"34":34}],20:[function(require,module,exports){ +"use strict"; +module.exports = MapField; + +// extends Field +var Field = require(16); +((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; + +var types = require(36), + util = require(37); + +/** + * Constructs a new map field instance. + * @classdesc Reflected map field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} keyType Key type + * @param {string} type Value type + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function MapField(name, id, keyType, type, options, comment) { + Field.call(this, name, id, type, undefined, undefined, options, comment); + + /* istanbul ignore if */ + if (!util.isString(keyType)) + throw TypeError("keyType must be a string"); + + /** + * Key type. + * @type {string} + */ + this.keyType = keyType; // toJSON, marker + + /** + * Resolved key type if not a basic type. + * @type {ReflectionObject|null} + */ + this.resolvedKeyType = null; + + // Overrides Field#map + this.map = true; +} + +/** + * Map field descriptor. + * @interface IMapField + * @extends {IField} + * @property {string} keyType Key type + */ + +/** + * Extension map field descriptor. + * @interface IExtensionMapField + * @extends IMapField + * @property {string} extend Extended type + */ + +/** + * Constructs a map field from a map field descriptor. + * @param {string} name Field name + * @param {IMapField} json Map field descriptor + * @returns {MapField} Created map field + * @throws {TypeError} If arguments are invalid + */ +MapField.fromJSON = function fromJSON(name, json) { + return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); +}; + +/** + * Converts this map field to a map field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMapField} Map field descriptor + */ +MapField.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "keyType" , this.keyType, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +MapField.prototype.resolve = function resolve() { + if (this.resolved) + return this; + + // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" + if (types.mapKey[this.keyType] === undefined) + throw Error("invalid key type: " + this.keyType); + + return Field.prototype.resolve.call(this); +}; + +/** + * Map field decorator (TypeScript). + * @name MapField.d + * @function + * @param {number} fieldId Field id + * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type + * @returns {FieldDecorator} Decorator function + * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } + */ +MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { + + // submessage value: decorate the submessage and use its name as the type + if (typeof fieldValueType === "function") + fieldValueType = util.decorateType(fieldValueType).name; + + // enum reference value: create a reflected copy of the enum and keep reuseing it + else if (fieldValueType && typeof fieldValueType === "object") + fieldValueType = util.decorateEnum(fieldValueType).name; + + return function mapFieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); + }; +}; + +},{"16":16,"36":36,"37":37}],21:[function(require,module,exports){ +"use strict"; +module.exports = Message; + +var util = require(39); + +/** + * Constructs a new message instance. + * @classdesc Abstract runtime message. + * @constructor + * @param {Properties} [properties] Properties to set + * @template T extends object = object + */ +function Message(properties) { + // not used internally + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; +} + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/*eslint-disable valid-jsdoc*/ + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message} Message instance + * @template T extends Message + * @this Constructor + */ +Message.create = function create(properties) { + return this.$type.create(properties); +}; + +/** + * Encodes a message of this type. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decode = function decode(reader) { + return this.$type.decode(reader); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decodeDelimited = function decodeDelimited(reader) { + return this.$type.decodeDelimited(reader); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object + * @returns {T} Message instance + * @template T extends Message + * @this Constructor + */ +Message.fromObject = function fromObject(object) { + return this.$type.fromObject(object); +}; + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {T} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @template T extends Message + * @this Constructor + */ +Message.toObject = function toObject(message, options) { + return this.$type.toObject(message, options); +}; + +/** + * Converts this message to JSON. + * @returns {Object.} JSON object + */ +Message.prototype.toJSON = function toJSON() { + return this.$type.toObject(this, util.toJSONOptions); +}; + +/*eslint-enable valid-jsdoc*/ +},{"39":39}],22:[function(require,module,exports){ +"use strict"; +module.exports = Method; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; + +var util = require(37); + +/** + * Constructs a new service method instance. + * @classdesc Reflected service method. + * @extends ReflectionObject + * @constructor + * @param {string} name Method name + * @param {string|undefined} type Method type, usually `"rpc"` + * @param {string} requestType Request message type + * @param {string} responseType Response message type + * @param {boolean|Object.} [requestStream] Whether the request is streamed + * @param {boolean|Object.} [responseStream] Whether the response is streamed + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this method + */ +function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) { + + /* istanbul ignore next */ + if (util.isObject(requestStream)) { + options = requestStream; + requestStream = responseStream = undefined; + } else if (util.isObject(responseStream)) { + options = responseStream; + responseStream = undefined; + } + + /* istanbul ignore if */ + if (!(type === undefined || util.isString(type))) + throw TypeError("type must be a string"); + + /* istanbul ignore if */ + if (!util.isString(requestType)) + throw TypeError("requestType must be a string"); + + /* istanbul ignore if */ + if (!util.isString(responseType)) + throw TypeError("responseType must be a string"); + + ReflectionObject.call(this, name, options); + + /** + * Method type. + * @type {string} + */ + this.type = type || "rpc"; // toJSON + + /** + * Request type. + * @type {string} + */ + this.requestType = requestType; // toJSON, marker + + /** + * Whether requests are streamed or not. + * @type {boolean|undefined} + */ + this.requestStream = requestStream ? true : undefined; // toJSON + + /** + * Response type. + * @type {string} + */ + this.responseType = responseType; // toJSON + + /** + * Whether responses are streamed or not. + * @type {boolean|undefined} + */ + this.responseStream = responseStream ? true : undefined; // toJSON + + /** + * Resolved request type. + * @type {Type|null} + */ + this.resolvedRequestType = null; + + /** + * Resolved response type. + * @type {Type|null} + */ + this.resolvedResponseType = null; + + /** + * Comment for this method + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Method descriptor. + * @interface IMethod + * @property {string} [type="rpc"] Method type + * @property {string} requestType Request type + * @property {string} responseType Response type + * @property {boolean} [requestStream=false] Whether requests are streamed + * @property {boolean} [responseStream=false] Whether responses are streamed + * @property {Object.} [options] Method options + */ + +/** + * Constructs a method from a method descriptor. + * @param {string} name Method name + * @param {IMethod} json Method descriptor + * @returns {Method} Created method + * @throws {TypeError} If arguments are invalid + */ +Method.fromJSON = function fromJSON(name, json) { + return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment); +}; + +/** + * Converts this method to a method descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMethod} Method descriptor + */ +Method.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, + "requestType" , this.requestType, + "requestStream" , this.requestStream, + "responseType" , this.responseType, + "responseStream" , this.responseStream, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Method.prototype.resolve = function resolve() { + + /* istanbul ignore if */ + if (this.resolved) + return this; + + this.resolvedRequestType = this.parent.lookupType(this.requestType); + this.resolvedResponseType = this.parent.lookupType(this.responseType); + + return ReflectionObject.prototype.resolve.call(this); +}; + +},{"24":24,"37":37}],23:[function(require,module,exports){ +"use strict"; +module.exports = Namespace; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; + +var Field = require(16), + util = require(37); + +var Type, // cyclic + Service, + Enum; + +/** + * Constructs a new namespace instance. + * @name Namespace + * @classdesc Reflected namespace. + * @extends NamespaceBase + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a namespace from JSON. + * @memberof Namespace + * @function + * @param {string} name Namespace name + * @param {Object.} json JSON object + * @returns {Namespace} Created namespace + * @throws {TypeError} If arguments are invalid + */ +Namespace.fromJSON = function fromJSON(name, json) { + return new Namespace(name, json.options).addJSON(json.nested); +}; + +/** + * Converts an array of reflection objects to JSON. + * @memberof Namespace + * @param {ReflectionObject[]} array Object array + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {Object.|undefined} JSON object or `undefined` when array is empty + */ +function arrayToJSON(array, toJSONOptions) { + if (!(array && array.length)) + return undefined; + var obj = {}; + for (var i = 0; i < array.length; ++i) + obj[array[i].name] = array[i].toJSON(toJSONOptions); + return obj; +} + +Namespace.arrayToJSON = arrayToJSON; + +/** + * Tests if the specified id is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedId = function isReservedId(reserved, id) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] >= id) + return true; + return false; +}; + +/** + * Tests if the specified name is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedName = function isReservedName(reserved, name) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (reserved[i] === name) + return true; + return false; +}; + +/** + * Not an actual constructor. Use {@link Namespace} instead. + * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. + * @exports NamespaceBase + * @extends ReflectionObject + * @abstract + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + * @see {@link Namespace} + */ +function Namespace(name, options) { + ReflectionObject.call(this, name, options); + + /** + * Nested objects by name. + * @type {Object.|undefined} + */ + this.nested = undefined; // toJSON + + /** + * Cached nested objects as an array. + * @type {ReflectionObject[]|null} + * @private + */ + this._nestedArray = null; +} + +function clearCache(namespace) { + namespace._nestedArray = null; + return namespace; +} + +/** + * Nested objects of this namespace as an array for iteration. + * @name NamespaceBase#nestedArray + * @type {ReflectionObject[]} + * @readonly + */ +Object.defineProperty(Namespace.prototype, "nestedArray", { + get: function() { + return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); + } +}); + +/** + * Namespace descriptor. + * @interface INamespace + * @property {Object.} [options] Namespace options + * @property {Object.} [nested] Nested object descriptors + */ + +/** + * Any extension field descriptor. + * @typedef AnyExtensionField + * @type {IExtensionField|IExtensionMapField} + */ + +/** + * Any nested object descriptor. + * @typedef AnyNestedObject + * @type {IEnum|IType|IService|AnyExtensionField|INamespace} + */ +// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place) + +/** + * Converts this namespace to a namespace descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {INamespace} Namespace descriptor + */ +Namespace.prototype.toJSON = function toJSON(toJSONOptions) { + return util.toObject([ + "options" , this.options, + "nested" , arrayToJSON(this.nestedArray, toJSONOptions) + ]); +}; + +/** + * Adds nested objects to this namespace from nested object descriptors. + * @param {Object.} nestedJson Any nested object descriptors + * @returns {Namespace} `this` + */ +Namespace.prototype.addJSON = function addJSON(nestedJson) { + var ns = this; + /* istanbul ignore else */ + if (nestedJson) { + for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { + nested = nestedJson[names[i]]; + ns.add( // most to least likely + ( nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : nested.id !== undefined + ? Field.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + } + return this; +}; + +/** + * Gets the nested object of the specified name. + * @param {string} name Nested object name + * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist + */ +Namespace.prototype.get = function get(name) { + return this.nested && this.nested[name] + || null; +}; + +/** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param {string} name Nested enum name + * @returns {Object.} Enum values + * @throws {Error} If there is no such enum + */ +Namespace.prototype.getEnum = function getEnum(name) { + if (this.nested && this.nested[name] instanceof Enum) + return this.nested[name].values; + throw Error("no such enum: " + name); +}; + +/** + * Adds a nested object to this namespace. + * @param {ReflectionObject} object Nested object to add + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ +Namespace.prototype.add = function add(object) { + + if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace)) + throw TypeError("object must be a valid nested object"); + + if (!this.nested) + this.nested = {}; + else { + var prev = this.get(object.name); + if (prev) { + if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { + // replace plain namespace but keep existing nested elements and options + var nested = prev.nestedArray; + for (var i = 0; i < nested.length; ++i) + object.add(nested[i]); + this.remove(prev); + if (!this.nested) + this.nested = {}; + object.setOptions(prev.options, true); + + } else + throw Error("duplicate name '" + object.name + "' in " + this); + } + } + this.nested[object.name] = object; + object.onAdd(this); + return clearCache(this); +}; + +/** + * Removes a nested object from this namespace. + * @param {ReflectionObject} object Nested object to remove + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ +Namespace.prototype.remove = function remove(object) { + + if (!(object instanceof ReflectionObject)) + throw TypeError("object must be a ReflectionObject"); + if (object.parent !== this) + throw Error(object + " is not a member of " + this); + + delete this.nested[object.name]; + if (!Object.keys(this.nested).length) + this.nested = undefined; + + object.onRemove(this); + return clearCache(this); +}; + +/** + * Defines additial namespaces within this one if not yet existing. + * @param {string|string[]} path Path to create + * @param {*} [json] Nested types to create from JSON + * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty + */ +Namespace.prototype.define = function define(path, json) { + + if (util.isString(path)) + path = path.split("."); + else if (!Array.isArray(path)) + throw TypeError("illegal path"); + if (path && path.length && path[0] === "") + throw Error("path must be relative"); + + var ptr = this; + while (path.length > 0) { + var part = path.shift(); + if (ptr.nested && ptr.nested[part]) { + ptr = ptr.nested[part]; + if (!(ptr instanceof Namespace)) + throw Error("path conflicts with non-namespace objects"); + } else + ptr.add(ptr = new Namespace(part)); + } + if (json) + ptr.addJSON(json); + return ptr; +}; + +/** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns {Namespace} `this` + */ +Namespace.prototype.resolveAll = function resolveAll() { + var nested = this.nestedArray, i = 0; + while (i < nested.length) + if (nested[i] instanceof Namespace) + nested[i++].resolveAll(); + else + nested[i++].resolve(); + return this.resolve(); +}; + +/** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param {string|string[]} path Path to look up + * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + */ +Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { + + /* istanbul ignore next */ + if (typeof filterTypes === "boolean") { + parentAlreadyChecked = filterTypes; + filterTypes = undefined; + } else if (filterTypes && !Array.isArray(filterTypes)) + filterTypes = [ filterTypes ]; + + if (util.isString(path) && path.length) { + if (path === ".") + return this.root; + path = path.split("."); + } else if (!path.length) + return this; + + // Start at root if path is absolute + if (path[0] === "") + return this.root.lookup(path.slice(1), filterTypes); + + // Test if the first part matches any nested object, and if so, traverse if path contains more + var found = this.get(path[0]); + if (found) { + if (path.length === 1) { + if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) + return found; + } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) + return found; + + // Otherwise try each nested namespace + } else + for (var i = 0; i < this.nestedArray.length; ++i) + if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) + return found; + + // If there hasn't been a match, try again at the parent + if (this.parent === null || parentAlreadyChecked) + return null; + return this.parent.lookup(path, filterTypes); +}; + +/** + * Looks up the reflection object at the specified path, relative to this namespace. + * @name NamespaceBase#lookup + * @function + * @param {string|string[]} path Path to look up + * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + * @variation 2 + */ +// lookup(path: string, [parentAlreadyChecked: boolean]) + +/** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type + * @throws {Error} If `path` does not point to a type + */ +Namespace.prototype.lookupType = function lookupType(path) { + var found = this.lookup(path, [ Type ]); + if (!found) + throw Error("no such type: " + path); + return found; +}; + +/** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Enum} Looked up enum + * @throws {Error} If `path` does not point to an enum + */ +Namespace.prototype.lookupEnum = function lookupEnum(path) { + var found = this.lookup(path, [ Enum ]); + if (!found) + throw Error("no such Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ +Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { + var found = this.lookup(path, [ Type, Enum ]); + if (!found) + throw Error("no such Type or Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Service} Looked up service + * @throws {Error} If `path` does not point to a service + */ +Namespace.prototype.lookupService = function lookupService(path) { + var found = this.lookup(path, [ Service ]); + if (!found) + throw Error("no such Service '" + path + "' in " + this); + return found; +}; + +// Sets up cyclic dependencies (called in index-light) +Namespace._configure = function(Type_, Service_, Enum_) { + Type = Type_; + Service = Service_; + Enum = Enum_; +}; + +},{"16":16,"24":24,"37":37}],24:[function(require,module,exports){ +"use strict"; +module.exports = ReflectionObject; + +ReflectionObject.className = "ReflectionObject"; + +var util = require(37); + +var Root; // cyclic + +/** + * Constructs a new reflection object instance. + * @classdesc Base class of all reflection objects. + * @constructor + * @param {string} name Object name + * @param {Object.} [options] Declared options + * @abstract + */ +function ReflectionObject(name, options) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (options && !util.isObject(options)) + throw TypeError("options must be an object"); + + /** + * Options. + * @type {Object.|undefined} + */ + this.options = options; // toJSON + + /** + * Unique name within its namespace. + * @type {string} + */ + this.name = name; + + /** + * Parent namespace. + * @type {Namespace|null} + */ + this.parent = null; + + /** + * Whether already resolved or not. + * @type {boolean} + */ + this.resolved = false; + + /** + * Comment text, if any. + * @type {string|null} + */ + this.comment = null; + + /** + * Defining file name. + * @type {string|null} + */ + this.filename = null; +} + +Object.defineProperties(ReflectionObject.prototype, { + + /** + * Reference to the root namespace. + * @name ReflectionObject#root + * @type {Root} + * @readonly + */ + root: { + get: function() { + var ptr = this; + while (ptr.parent !== null) + ptr = ptr.parent; + return ptr; + } + }, + + /** + * Full name including leading dot. + * @name ReflectionObject#fullName + * @type {string} + * @readonly + */ + fullName: { + get: function() { + var path = [ this.name ], + ptr = this.parent; + while (ptr) { + path.unshift(ptr.name); + ptr = ptr.parent; + } + return path.join("."); + } + } +}); + +/** + * Converts this reflection object to its descriptor representation. + * @returns {Object.} Descriptor + * @abstract + */ +ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { + throw Error(); // not implemented, shouldn't happen +}; + +/** + * Called when this object is added to a parent. + * @param {ReflectionObject} parent Parent added to + * @returns {undefined} + */ +ReflectionObject.prototype.onAdd = function onAdd(parent) { + if (this.parent && this.parent !== parent) + this.parent.remove(this); + this.parent = parent; + this.resolved = false; + var root = parent.root; + if (root instanceof Root) + root._handleAdd(this); +}; + +/** + * Called when this object is removed from a parent. + * @param {ReflectionObject} parent Parent removed from + * @returns {undefined} + */ +ReflectionObject.prototype.onRemove = function onRemove(parent) { + var root = parent.root; + if (root instanceof Root) + root._handleRemove(this); + this.parent = null; + this.resolved = false; +}; + +/** + * Resolves this objects type references. + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.resolve = function resolve() { + if (this.resolved) + return this; + if (this.root instanceof Root) + this.resolved = true; // only if part of a root + return this; +}; + +/** + * Gets an option value. + * @param {string} name Option name + * @returns {*} Option value or `undefined` if not set + */ +ReflectionObject.prototype.getOption = function getOption(name) { + if (this.options) + return this.options[name]; + return undefined; +}; + +/** + * Sets an option. + * @param {string} name Option name + * @param {*} value Option value + * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { + if (!ifNotSet || !this.options || this.options[name] === undefined) + (this.options || (this.options = {}))[name] = value; + return this; +}; + +/** + * Sets multiple options. + * @param {Object.} options Options to set + * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { + if (options) + for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) + this.setOption(keys[i], options[keys[i]], ifNotSet); + return this; +}; + +/** + * Converts this instance to its string representation. + * @returns {string} Class name[, space, full name] + */ +ReflectionObject.prototype.toString = function toString() { + var className = this.constructor.className, + fullName = this.fullName; + if (fullName.length) + return className + " " + fullName; + return className; +}; + +// Sets up cyclic dependencies (called in index-light) +ReflectionObject._configure = function(Root_) { + Root = Root_; +}; + +},{"37":37}],25:[function(require,module,exports){ +"use strict"; +module.exports = OneOf; + +// extends ReflectionObject +var ReflectionObject = require(24); +((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; + +var Field = require(16), + util = require(37); + +/** + * Constructs a new oneof instance. + * @classdesc Reflected oneof. + * @extends ReflectionObject + * @constructor + * @param {string} name Oneof name + * @param {string[]|Object.} [fieldNames] Field names + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function OneOf(name, fieldNames, options, comment) { + if (!Array.isArray(fieldNames)) { + options = fieldNames; + fieldNames = undefined; + } + ReflectionObject.call(this, name, options); + + /* istanbul ignore if */ + if (!(fieldNames === undefined || Array.isArray(fieldNames))) + throw TypeError("fieldNames must be an Array"); + + /** + * Field names that belong to this oneof. + * @type {string[]} + */ + this.oneof = fieldNames || []; // toJSON, marker + + /** + * Fields that belong to this oneof as an array for iteration. + * @type {Field[]} + * @readonly + */ + this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Oneof descriptor. + * @interface IOneOf + * @property {Array.} oneof Oneof field names + * @property {Object.} [options] Oneof options + */ + +/** + * Constructs a oneof from a oneof descriptor. + * @param {string} name Oneof name + * @param {IOneOf} json Oneof descriptor + * @returns {OneOf} Created oneof + * @throws {TypeError} If arguments are invalid + */ +OneOf.fromJSON = function fromJSON(name, json) { + return new OneOf(name, json.oneof, json.options, json.comment); +}; + +/** + * Converts this oneof to a oneof descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IOneOf} Oneof descriptor + */ +OneOf.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "oneof" , this.oneof, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Adds the fields of the specified oneof to the parent if not already done so. + * @param {OneOf} oneof The oneof + * @returns {undefined} + * @inner + * @ignore + */ +function addFieldsToParent(oneof) { + if (oneof.parent) + for (var i = 0; i < oneof.fieldsArray.length; ++i) + if (!oneof.fieldsArray[i].parent) + oneof.parent.add(oneof.fieldsArray[i]); +} + +/** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param {Field} field Field to add + * @returns {OneOf} `this` + */ +OneOf.prototype.add = function add(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + if (field.parent && field.parent !== this.parent) + field.parent.remove(field); + this.oneof.push(field.name); + this.fieldsArray.push(field); + field.partOf = this; // field.parent remains null + addFieldsToParent(this); + return this; +}; + +/** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param {Field} field Field to remove + * @returns {OneOf} `this` + */ +OneOf.prototype.remove = function remove(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + var index = this.fieldsArray.indexOf(field); + + /* istanbul ignore if */ + if (index < 0) + throw Error(field + " is not a member of " + this); + + this.fieldsArray.splice(index, 1); + index = this.oneof.indexOf(field.name); + + /* istanbul ignore else */ + if (index > -1) // theoretical + this.oneof.splice(index, 1); + + field.partOf = null; + return this; +}; + +/** + * @override + */ +OneOf.prototype.onAdd = function onAdd(parent) { + ReflectionObject.prototype.onAdd.call(this, parent); + var self = this; + // Collect present fields + for (var i = 0; i < this.oneof.length; ++i) { + var field = parent.get(this.oneof[i]); + if (field && !field.partOf) { + field.partOf = self; + self.fieldsArray.push(field); + } + } + // Add not yet present fields + addFieldsToParent(this); +}; + +/** + * @override + */ +OneOf.prototype.onRemove = function onRemove(parent) { + for (var i = 0, field; i < this.fieldsArray.length; ++i) + if ((field = this.fieldsArray[i]).parent) + field.parent.remove(field); + ReflectionObject.prototype.onRemove.call(this, parent); +}; + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @typedef OneOfDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} oneofName OneOf name + * @returns {undefined} + */ + +/** + * OneOf decorator (TypeScript). + * @function + * @param {...string} fieldNames Field names + * @returns {OneOfDecorator} Decorator function + * @template T extends string + */ +OneOf.d = function decorateOneOf() { + var fieldNames = new Array(arguments.length), + index = 0; + while (index < arguments.length) + fieldNames[index] = arguments[index++]; + return function oneOfDecorator(prototype, oneofName) { + util.decorateType(prototype.constructor) + .add(new OneOf(oneofName, fieldNames)); + Object.defineProperty(prototype, oneofName, { + get: util.oneOfGetter(fieldNames), + set: util.oneOfSetter(fieldNames) + }); + }; +}; + +},{"16":16,"24":24,"37":37}],26:[function(require,module,exports){ +"use strict"; +module.exports = parse; + +parse.filename = null; +parse.defaults = { keepCase: false }; + +var tokenize = require(34), + Root = require(29), + Type = require(35), + Field = require(16), + MapField = require(20), + OneOf = require(25), + Enum = require(15), + Service = require(33), + Method = require(22), + types = require(36), + util = require(37); + +var base10Re = /^[1-9][0-9]*$/, + base10NegRe = /^-?[1-9][0-9]*$/, + base16Re = /^0[x][0-9a-fA-F]+$/, + base16NegRe = /^-?0[x][0-9a-fA-F]+$/, + base8Re = /^0[0-7]+$/, + base8NegRe = /^-?0[0-7]+$/, + numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, + nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, + typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, + fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/; + +/** + * Result object returned from {@link parse}. + * @interface IParserResult + * @property {string|undefined} package Package name, if declared + * @property {string[]|undefined} imports Imports, if any + * @property {string[]|undefined} weakImports Weak imports, if any + * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`) + * @property {Root} root Populated root instance + */ + +/** + * Options modifying the behavior of {@link parse}. + * @interface IParseOptions + * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case + * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments. + */ + +/** + * Options modifying the behavior of JSON serialization. + * @interface IToJSONOptions + * @property {boolean} [keepComments=false] Serializes comments. + */ + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @param {string} source Source contents + * @param {Root} root Root to populate + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + */ +function parse(source, root, options) { + /* eslint-disable callback-return */ + if (!(root instanceof Root)) { + options = root; + root = new Root(); + } + if (!options) + options = parse.defaults; + + var tn = tokenize(source, options.alternateCommentMode || false), + next = tn.next, + push = tn.push, + peek = tn.peek, + skip = tn.skip, + cmnt = tn.cmnt; + + var head = true, + pkg, + imports, + weakImports, + syntax, + isProto3 = false; + + var ptr = root; + + var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase; + + /* istanbul ignore next */ + function illegal(token, name, insideTryCatch) { + var filename = parse.filename; + if (!insideTryCatch) + parse.filename = null; + return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); + } + + function readString() { + var values = [], + token; + do { + /* istanbul ignore if */ + if ((token = next()) !== "\"" && token !== "'") + throw illegal(token); + + values.push(next()); + skip(token); + token = peek(); + } while (token === "\"" || token === "'"); + return values.join(""); + } + + function readValue(acceptTypeRef) { + var token = next(); + switch (token) { + case "'": + case "\"": + push(token); + return readString(); + case "true": case "TRUE": + return true; + case "false": case "FALSE": + return false; + } + try { + return parseNumber(token, /* insideTryCatch */ true); + } catch (e) { + + /* istanbul ignore else */ + if (acceptTypeRef && typeRefRe.test(token)) + return token; + + /* istanbul ignore next */ + throw illegal(token, "value"); + } + } + + function readRanges(target, acceptStrings) { + var token, start; + do { + if (acceptStrings && ((token = peek()) === "\"" || token === "'")) + target.push(readString()); + else + target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]); + } while (skip(",", true)); + skip(";"); + } + + function parseNumber(token, insideTryCatch) { + var sign = 1; + if (token.charAt(0) === "-") { + sign = -1; + token = token.substring(1); + } + switch (token) { + case "inf": case "INF": case "Inf": + return sign * Infinity; + case "nan": case "NAN": case "Nan": case "NaN": + return NaN; + case "0": + return 0; + } + if (base10Re.test(token)) + return sign * parseInt(token, 10); + if (base16Re.test(token)) + return sign * parseInt(token, 16); + if (base8Re.test(token)) + return sign * parseInt(token, 8); + + /* istanbul ignore else */ + if (numberRe.test(token)) + return sign * parseFloat(token); + + /* istanbul ignore next */ + throw illegal(token, "number", insideTryCatch); + } + + function parseId(token, acceptNegative) { + switch (token) { + case "max": case "MAX": case "Max": + return 536870911; + case "0": + return 0; + } + + /* istanbul ignore if */ + if (!acceptNegative && token.charAt(0) === "-") + throw illegal(token, "id"); + + if (base10NegRe.test(token)) + return parseInt(token, 10); + if (base16NegRe.test(token)) + return parseInt(token, 16); + + /* istanbul ignore else */ + if (base8NegRe.test(token)) + return parseInt(token, 8); + + /* istanbul ignore next */ + throw illegal(token, "id"); + } + + function parsePackage() { + + /* istanbul ignore if */ + if (pkg !== undefined) + throw illegal("package"); + + pkg = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(pkg)) + throw illegal(pkg, "name"); + + ptr = ptr.define(pkg); + skip(";"); + } + + function parseImport() { + var token = peek(); + var whichImports; + switch (token) { + case "weak": + whichImports = weakImports || (weakImports = []); + next(); + break; + case "public": + next(); + // eslint-disable-line no-fallthrough + default: + whichImports = imports || (imports = []); + break; + } + token = readString(); + skip(";"); + whichImports.push(token); + } + + function parseSyntax() { + skip("="); + syntax = readString(); + isProto3 = syntax === "proto3"; + + /* istanbul ignore if */ + if (!isProto3 && syntax !== "proto2") + throw illegal(syntax, "syntax"); + + skip(";"); + } + + function parseCommon(parent, token) { + switch (token) { + + case "option": + parseOption(parent, token); + skip(";"); + return true; + + case "message": + parseType(parent, token); + return true; + + case "enum": + parseEnum(parent, token); + return true; + + case "service": + parseService(parent, token); + return true; + + case "extend": + parseExtension(parent, token); + return true; + } + return false; + } + + function ifBlock(obj, fnIf, fnElse) { + var trailingLine = tn.line; + if (obj) { + obj.comment = cmnt(); // try block-type comment + obj.filename = parse.filename; + } + if (skip("{", true)) { + var token; + while ((token = next()) !== "}") + fnIf(token); + skip(";", true); + } else { + if (fnElse) + fnElse(); + skip(";"); + if (obj && typeof obj.comment !== "string") + obj.comment = cmnt(trailingLine); // try line-type comment if no block + } + } + + function parseType(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "type name"); + + var type = new Type(token); + ifBlock(type, function parseType_block(token) { + if (parseCommon(type, token)) + return; + + switch (token) { + + case "map": + parseMapField(type, token); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + case "oneof": + parseOneOf(type, token); + break; + + case "extensions": + readRanges(type.extensions || (type.extensions = [])); + break; + + case "reserved": + readRanges(type.reserved || (type.reserved = []), true); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + + push(token); + parseField(type, "optional"); + break; + } + }); + parent.add(type); + } + + function parseField(parent, rule, extend) { + var type = next(); + if (type === "group") { + parseGroup(parent, rule); + return; + } + + /* istanbul ignore if */ + if (!typeRefRe.test(type)) + throw illegal(type, "type"); + + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + name = applyCase(name); + skip("="); + + var field = new Field(name, parseId(next()), type, rule, extend); + ifBlock(field, function parseField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseField_line() { + parseInlineOptions(field); + }); + parent.add(field); + + // JSON defaults to packed=true if not set so we have to set packed=false explicity when + // parsing proto2 descriptors without the option, where applicable. This must be done for + // all known packable types and anything that could be an enum (= is not a basic type). + if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined)) + field.setOption("packed", false, /* ifNotSet */ true); + } + + function parseGroup(parent, rule) { + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + var fieldName = util.lcFirst(name); + if (name === fieldName) + name = util.ucFirst(name); + skip("="); + var id = parseId(next()); + var type = new Type(name); + type.group = true; + var field = new Field(fieldName, id, name, rule); + field.filename = parse.filename; + ifBlock(type, function parseGroup_block(token) { + switch (token) { + + case "option": + parseOption(type, token); + skip(";"); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + /* istanbul ignore next */ + default: + throw illegal(token); // there are no groups with proto3 semantics + } + }); + parent.add(type) + .add(field); + } + + function parseMapField(parent) { + skip("<"); + var keyType = next(); + + /* istanbul ignore if */ + if (types.mapKey[keyType] === undefined) + throw illegal(keyType, "type"); + + skip(","); + var valueType = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(valueType)) + throw illegal(valueType, "type"); + + skip(">"); + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + skip("="); + var field = new MapField(applyCase(name), parseId(next()), keyType, valueType); + ifBlock(field, function parseMapField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseMapField_line() { + parseInlineOptions(field); + }); + parent.add(field); + } + + function parseOneOf(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var oneof = new OneOf(applyCase(token)); + ifBlock(oneof, function parseOneOf_block(token) { + if (token === "option") { + parseOption(oneof, token); + skip(";"); + } else { + push(token); + parseField(oneof, "optional"); + } + }); + parent.add(oneof); + } + + function parseEnum(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var enm = new Enum(token); + ifBlock(enm, function parseEnum_block(token) { + switch(token) { + case "option": + parseOption(enm, token); + skip(";"); + break; + + case "reserved": + readRanges(enm.reserved || (enm.reserved = []), true); + break; + + default: + parseEnumValue(enm, token); + } + }); + parent.add(enm); + } + + function parseEnumValue(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token)) + throw illegal(token, "name"); + + skip("="); + var value = parseId(next(), true), + dummy = {}; + ifBlock(dummy, function parseEnumValue_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(dummy, token); // skip + skip(";"); + } else + throw illegal(token); + + }, function parseEnumValue_line() { + parseInlineOptions(dummy); // skip + }); + parent.add(token, value, dummy.comment); + } + + function parseOption(parent, token) { + var isCustom = skip("(", true); + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "name"); + + var name = token; + if (isCustom) { + skip(")"); + name = "(" + name + ")"; + token = peek(); + if (fqTypeRefRe.test(token)) { + name += token; + next(); + } + } + skip("="); + parseOptionValue(parent, name); + } + + function parseOptionValue(parent, name) { + if (skip("{", true)) { // { a: "foo" b { c: "bar" } } + do { + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + if (peek() === "{") + parseOptionValue(parent, name + "." + token); + else { + skip(":"); + if (peek() === "{") + parseOptionValue(parent, name + "." + token); + else + setOption(parent, name + "." + token, readValue(true)); + } + skip(",", true); + } while (!skip("}", true)); + } else + setOption(parent, name, readValue(true)); + // Does not enforce a delimiter to be universal + } + + function setOption(parent, name, value) { + if (parent.setOption) + parent.setOption(name, value); + } + + function parseInlineOptions(parent) { + if (skip("[", true)) { + do { + parseOption(parent, "option"); + } while (skip(",", true)); + skip("]"); + } + return parent; + } + + function parseService(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "service name"); + + var service = new Service(token); + ifBlock(service, function parseService_block(token) { + if (parseCommon(service, token)) + return; + + /* istanbul ignore else */ + if (token === "rpc") + parseMethod(service, token); + else + throw illegal(token); + }); + parent.add(service); + } + + function parseMethod(parent, token) { + var type = token; + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var name = token, + requestType, requestStream, + responseType, responseStream; + + skip("("); + if (skip("stream", true)) + requestStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + requestType = token; + skip(")"); skip("returns"); skip("("); + if (skip("stream", true)) + responseStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + responseType = token; + skip(")"); + + var method = new Method(name, type, requestType, responseType, requestStream, responseStream); + ifBlock(method, function parseMethod_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(method, token); + skip(";"); + } else + throw illegal(token); + + }); + parent.add(method); + } + + function parseExtension(parent, token) { + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "reference"); + + var reference = token; + ifBlock(null, function parseExtension_block(token) { + switch (token) { + + case "required": + case "repeated": + case "optional": + parseField(parent, token, reference); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + push(token); + parseField(parent, "optional", reference); + break; + } + }); + } + + var token; + while ((token = next()) !== null) { + switch (token) { + + case "package": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parsePackage(); + break; + + case "import": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseImport(); + break; + + case "syntax": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseSyntax(); + break; + + case "option": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseOption(ptr, token); + skip(";"); + break; + + default: + + /* istanbul ignore else */ + if (parseCommon(ptr, token)) { + head = false; + continue; + } + + /* istanbul ignore next */ + throw illegal(token); + } + } + + parse.filename = null; + return { + "package" : pkg, + "imports" : imports, + weakImports : weakImports, + syntax : syntax, + root : root + }; +} + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @name parse + * @function + * @param {string} source Source contents + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + * @variation 2 + */ + +},{"15":15,"16":16,"20":20,"22":22,"25":25,"29":29,"33":33,"34":34,"35":35,"36":36,"37":37}],27:[function(require,module,exports){ +"use strict"; +module.exports = Reader; + +var util = require(39); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; + +},{"39":39}],28:[function(require,module,exports){ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require(27); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require(39); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +/* istanbul ignore else */ +if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + +},{"27":27,"39":39}],29:[function(require,module,exports){ +"use strict"; +module.exports = Root; + +// extends Namespace +var Namespace = require(23); +((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; + +var Field = require(16), + Enum = require(15), + OneOf = require(25), + util = require(37); + +var Type, // cyclic + parse, // might be excluded + common; // " + +/** + * Constructs a new root namespace instance. + * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. + * @extends NamespaceBase + * @constructor + * @param {Object.} [options] Top level options + */ +function Root(options) { + Namespace.call(this, "", options); + + /** + * Deferred extension fields. + * @type {Field[]} + */ + this.deferred = []; + + /** + * Resolved file names of loaded files. + * @type {string[]} + */ + this.files = []; +} + +/** + * Loads a namespace descriptor into a root namespace. + * @param {INamespace} json Nameespace descriptor + * @param {Root} [root] Root namespace, defaults to create a new one if omitted + * @returns {Root} Root namespace + */ +Root.fromJSON = function fromJSON(json, root) { + if (!root) + root = new Root(); + if (json.options) + root.setOptions(json.options); + return root.addJSON(json.nested); +}; + +/** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @function + * @param {string} origin The file name of the importing file + * @param {string} target The file name being imported + * @returns {string|null} Resolved path to `target` or `null` to skip the file + */ +Root.prototype.resolvePath = util.path.resolve; + +// A symbol-like function to safely signal synchronous loading +/* istanbul ignore next */ +function SYNC() {} // eslint-disable-line no-empty-function + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} options Parse options + * @param {LoadCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.load = function load(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + var self = this; + if (!callback) + return util.asPromise(load, self, filename, options); + + var sync = callback === SYNC; // undocumented + + // Finishes loading by calling the callback (exactly once) + function finish(err, root) { + /* istanbul ignore if */ + if (!callback) + return; + var cb = callback; + callback = null; + if (sync) + throw err; + cb(err, root); + } + + // Processes a single file + function process(filename, source) { + try { + if (util.isString(source) && source.charAt(0) === "{") + source = JSON.parse(source); + if (!util.isString(source)) + self.setOptions(source.options).addJSON(source.nested); + else { + parse.filename = filename; + var parsed = parse(source, self, options), + resolved, + i = 0; + if (parsed.imports) + for (; i < parsed.imports.length; ++i) + if (resolved = self.resolvePath(filename, parsed.imports[i])) + fetch(resolved); + if (parsed.weakImports) + for (i = 0; i < parsed.weakImports.length; ++i) + if (resolved = self.resolvePath(filename, parsed.weakImports[i])) + fetch(resolved, true); + } + } catch (err) { + finish(err); + } + if (!sync && !queued) + finish(null, self); // only once anyway + } + + // Fetches a single file + function fetch(filename, weak) { + + // Strip path if this file references a bundled definition + var idx = filename.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = filename.substring(idx); + if (altname in common) + filename = altname; + } + + // Skip if already loaded / attempted + if (self.files.indexOf(filename) > -1) + return; + self.files.push(filename); + + // Shortcut bundled definitions + if (filename in common) { + if (sync) + process(filename, common[filename]); + else { + ++queued; + setTimeout(function() { + --queued; + process(filename, common[filename]); + }); + } + return; + } + + // Otherwise fetch from disk or network + if (sync) { + var source; + try { + source = util.fs.readFileSync(filename).toString("utf8"); + } catch (err) { + if (!weak) + finish(err); + return; + } + process(filename, source); + } else { + ++queued; + util.fetch(filename, function(err, source) { + --queued; + /* istanbul ignore if */ + if (!callback) + return; // terminated meanwhile + if (err) { + /* istanbul ignore else */ + if (!weak) + finish(err); + else if (!queued) // can't be covered reliably + finish(null, self); + return; + } + process(filename, source); + }); + } + } + var queued = 0; + + // Assembling the root namespace doesn't require working type + // references anymore, so we can load everything in parallel + if (util.isString(filename)) + filename = [ filename ]; + for (var i = 0, resolved; i < filename.length; ++i) + if (resolved = self.resolvePath("", filename[i])) + fetch(resolved); + + if (sync) + return self; + if (!queued) + finish(null, self); + return undefined; +}; +// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Promise} Promise + * @variation 3 + */ +// function load(filename:string, [options:IParseOptions]):Promise + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @function Root#loadSync + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ +Root.prototype.loadSync = function loadSync(filename, options) { + if (!util.isNode) + throw Error("not supported"); + return this.load(filename, options, SYNC); +}; + +/** + * @override + */ +Root.prototype.resolveAll = function resolveAll() { + if (this.deferred.length) + throw Error("unresolvable extensions: " + this.deferred.map(function(field) { + return "'extend " + field.extend + "' in " + field.parent.fullName; + }).join(", ")); + return Namespace.prototype.resolveAll.call(this); +}; + +// only uppercased (and thus conflict-free) children are exposed, see below +var exposeRe = /^[A-Z]/; + +/** + * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. + * @param {Root} root Root instance + * @param {Field} field Declaring extension field witin the declaring type + * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise + * @inner + * @ignore + */ +function tryHandleExtension(root, field) { + var extendedType = field.parent.lookup(field.extend); + if (extendedType) { + var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); + sisterField.declaringField = field; + field.extensionField = sisterField; + extendedType.add(sisterField); + return true; + } + return false; +} + +/** + * Called when any object is added to this root or its sub-namespaces. + * @param {ReflectionObject} object Object added + * @returns {undefined} + * @private + */ +Root.prototype._handleAdd = function _handleAdd(object) { + if (object instanceof Field) { + + if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) + if (!tryHandleExtension(this, object)) + this.deferred.push(object); + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + object.parent[object.name] = object.values; // expose enum values as property of its parent + + } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { + + if (object instanceof Type) // Try to handle any deferred extensions + for (var i = 0; i < this.deferred.length;) + if (tryHandleExtension(this, this.deferred[i])) + this.deferred.splice(i, 1); + else + ++i; + for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace + this._handleAdd(object._nestedArray[j]); + if (exposeRe.test(object.name)) + object.parent[object.name] = object; // expose namespace as property of its parent + } + + // The above also adds uppercased (and thus conflict-free) nested types, services and enums as + // properties of namespaces just like static code does. This allows using a .d.ts generated for + // a static module with reflection-based solutions where the condition is met. +}; + +/** + * Called when any object is removed from this root or its sub-namespaces. + * @param {ReflectionObject} object Object removed + * @returns {undefined} + * @private + */ +Root.prototype._handleRemove = function _handleRemove(object) { + if (object instanceof Field) { + + if (/* an extension field */ object.extend !== undefined) { + if (/* already handled */ object.extensionField) { // remove its sister field + object.extensionField.parent.remove(object.extensionField); + object.extensionField = null; + } else { // cancel the extension + var index = this.deferred.indexOf(object); + /* istanbul ignore else */ + if (index > -1) + this.deferred.splice(index, 1); + } + } + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose enum values + + } else if (object instanceof Namespace) { + + for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace + this._handleRemove(object._nestedArray[i]); + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose namespaces + + } +}; + +// Sets up cyclic dependencies (called in index-light) +Root._configure = function(Type_, parse_, common_) { + Type = Type_; + parse = parse_; + common = common_; +}; + +},{"15":15,"16":16,"23":23,"25":25,"37":37}],30:[function(require,module,exports){ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ + +},{}],31:[function(require,module,exports){ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require(32); + +},{"32":32}],32:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +var util = require(39); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; + +},{"39":39}],33:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +// extends Namespace +var Namespace = require(23); +((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; + +var Method = require(22), + util = require(37), + rpc = require(31); + +/** + * Constructs a new service instance. + * @classdesc Reflected service. + * @extends NamespaceBase + * @constructor + * @param {string} name Service name + * @param {Object.} [options] Service options + * @throws {TypeError} If arguments are invalid + */ +function Service(name, options) { + Namespace.call(this, name, options); + + /** + * Service methods. + * @type {Object.} + */ + this.methods = {}; // toJSON, marker + + /** + * Cached methods as an array. + * @type {Method[]|null} + * @private + */ + this._methodsArray = null; +} + +/** + * Service descriptor. + * @interface IService + * @extends INamespace + * @property {Object.} methods Method descriptors + */ + +/** + * Constructs a service from a service descriptor. + * @param {string} name Service name + * @param {IService} json Service descriptor + * @returns {Service} Created service + * @throws {TypeError} If arguments are invalid + */ +Service.fromJSON = function fromJSON(name, json) { + var service = new Service(name, json.options); + /* istanbul ignore else */ + if (json.methods) + for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) + service.add(Method.fromJSON(names[i], json.methods[names[i]])); + if (json.nested) + service.addJSON(json.nested); + service.comment = json.comment; + return service; +}; + +/** + * Converts this service to a service descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IService} Service descriptor + */ +Service.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Methods of this service as an array for iteration. + * @name Service#methodsArray + * @type {Method[]} + * @readonly + */ +Object.defineProperty(Service.prototype, "methodsArray", { + get: function() { + return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); + } +}); + +function clearCache(service) { + service._methodsArray = null; + return service; +} + +/** + * @override + */ +Service.prototype.get = function get(name) { + return this.methods[name] + || Namespace.prototype.get.call(this, name); +}; + +/** + * @override + */ +Service.prototype.resolveAll = function resolveAll() { + var methods = this.methodsArray; + for (var i = 0; i < methods.length; ++i) + methods[i].resolve(); + return Namespace.prototype.resolve.call(this); +}; + +/** + * @override + */ +Service.prototype.add = function add(object) { + + /* istanbul ignore if */ + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Method) { + this.methods[object.name] = object; + object.parent = this; + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * @override + */ +Service.prototype.remove = function remove(object) { + if (object instanceof Method) { + + /* istanbul ignore if */ + if (this.methods[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.methods[object.name]; + object.parent = null; + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Creates a runtime service using the specified rpc implementation. + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. + */ +Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); + for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { + var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); + rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ + m: method, + q: method.resolvedRequestType.ctor, + s: method.resolvedResponseType.ctor + }); + } + return rpcService; +}; + +},{"22":22,"23":23,"31":31,"37":37}],34:[function(require,module,exports){ +"use strict"; +module.exports = tokenize; + +var delimRe = /[\s{}=;:[\],'"()<>]/g, + stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; + +var setCommentRe = /^ *[*/]+ */, + setCommentAltRe = /^\s*\*?\/*/, + setCommentSplitRe = /\n/g, + whitespaceRe = /\s/, + unescapeRe = /\\(.?)/g; + +var unescapeMap = { + "0": "\0", + "r": "\r", + "n": "\n", + "t": "\t" +}; + +/** + * Unescapes a string. + * @param {string} str String to unescape + * @returns {string} Unescaped string + * @property {Object.} map Special characters map + * @memberof tokenize + */ +function unescape(str) { + return str.replace(unescapeRe, function($0, $1) { + switch ($1) { + case "\\": + case "": + return $1; + default: + return unescapeMap[$1] || ""; + } + }); +} + +tokenize.unescape = unescape; + +/** + * Gets the next token and advances. + * @typedef TokenizerHandleNext + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Peeks for the next token. + * @typedef TokenizerHandlePeek + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Pushes a token back to the stack. + * @typedef TokenizerHandlePush + * @type {function} + * @param {string} token Token + * @returns {undefined} + */ + +/** + * Skips the next token. + * @typedef TokenizerHandleSkip + * @type {function} + * @param {string} expected Expected token + * @param {boolean} [optional=false] If optional + * @returns {boolean} Whether the token matched + * @throws {Error} If the token didn't match and is not optional + */ + +/** + * Gets the comment on the previous line or, alternatively, the line comment on the specified line. + * @typedef TokenizerHandleCmnt + * @type {function} + * @param {number} [line] Line number + * @returns {string|null} Comment text or `null` if none + */ + +/** + * Handle object returned from {@link tokenize}. + * @interface ITokenizerHandle + * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof) + * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof) + * @property {TokenizerHandlePush} push Pushes a token back to the stack + * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws + * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any + * @property {number} line Current line number + */ + +/** + * Tokenizes the given .proto source and returns an object with useful utility functions. + * @param {string} source Source contents + * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode. + * @returns {ITokenizerHandle} Tokenizer handle + */ +function tokenize(source, alternateCommentMode) { + /* eslint-disable callback-return */ + source = source.toString(); + + var offset = 0, + length = source.length, + line = 1, + commentType = null, + commentText = null, + commentLine = 0, + commentLineEmpty = false; + + var stack = []; + + var stringDelim = null; + + /* istanbul ignore next */ + /** + * Creates an error for illegal syntax. + * @param {string} subject Subject + * @returns {Error} Error created + * @inner + */ + function illegal(subject) { + return Error("illegal " + subject + " (line " + line + ")"); + } + + /** + * Reads a string till its end. + * @returns {string} String read + * @inner + */ + function readString() { + var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe; + re.lastIndex = offset - 1; + var match = re.exec(source); + if (!match) + throw illegal("string"); + offset = re.lastIndex; + push(stringDelim); + stringDelim = null; + return unescape(match[1]); + } + + /** + * Gets the character at `pos` within the source. + * @param {number} pos Position + * @returns {string} Character + * @inner + */ + function charAt(pos) { + return source.charAt(pos); + } + + /** + * Sets the current comment text. + * @param {number} start Start offset + * @param {number} end End offset + * @returns {undefined} + * @inner + */ + function setComment(start, end) { + commentType = source.charAt(start++); + commentLine = line; + commentLineEmpty = false; + var lookback; + if (alternateCommentMode) { + lookback = 2; // alternate comment parsing: "//" or "/*" + } else { + lookback = 3; // "///" or "/**" + } + var commentOffset = start - lookback, + c; + do { + if (--commentOffset < 0 || + (c = source.charAt(commentOffset)) === "\n") { + commentLineEmpty = true; + break; + } + } while (c === " " || c === "\t"); + var lines = source + .substring(start, end) + .split(setCommentSplitRe); + for (var i = 0; i < lines.length; ++i) + lines[i] = lines[i] + .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "") + .trim(); + commentText = lines + .join("\n") + .trim(); + } + + function isDoubleSlashCommentLine(startOffset) { + var endOffset = findEndOfLine(startOffset); + + // see if remaining line matches comment pattern + var lineText = source.substring(startOffset, endOffset); + // look for 1 or 2 slashes since startOffset would already point past + // the first slash that started the comment. + var isComment = /^\s*\/{1,2}/.test(lineText); + return isComment; + } + + function findEndOfLine(cursor) { + // find end of cursor's line + var endOffset = cursor; + while (endOffset < length && charAt(endOffset) !== "\n") { + endOffset++; + } + return endOffset; + } + + /** + * Obtains the next token. + * @returns {string|null} Next token or `null` on eof + * @inner + */ + function next() { + if (stack.length > 0) + return stack.shift(); + if (stringDelim) + return readString(); + var repeat, + prev, + curr, + start, + isDoc; + do { + if (offset === length) + return null; + repeat = false; + while (whitespaceRe.test(curr = charAt(offset))) { + if (curr === "\n") + ++line; + if (++offset === length) + return null; + } + + if (charAt(offset) === "/") { + if (++offset === length) { + throw illegal("comment"); + } + if (charAt(offset) === "/") { // Line + if (!alternateCommentMode) { + // check for triple-slash comment + isDoc = charAt(start = offset + 1) === "/"; + + while (charAt(++offset) !== "\n") { + if (offset === length) { + return null; + } + } + ++offset; + if (isDoc) { + setComment(start, offset - 1); + } + ++line; + repeat = true; + } else { + // check for double-slash comments, consolidating consecutive lines + start = offset; + isDoc = false; + if (isDoubleSlashCommentLine(offset)) { + isDoc = true; + do { + offset = findEndOfLine(offset); + if (offset === length) { + break; + } + offset++; + } while (isDoubleSlashCommentLine(offset)); + } else { + offset = Math.min(length, findEndOfLine(offset) + 1); + } + if (isDoc) { + setComment(start, offset); + } + line++; + repeat = true; + } + } else if ((curr = charAt(offset)) === "*") { /* Block */ + // check for /** (regular comment mode) or /* (alternate comment mode) + start = offset + 1; + isDoc = alternateCommentMode || charAt(start) === "*"; + do { + if (curr === "\n") { + ++line; + } + if (++offset === length) { + throw illegal("comment"); + } + prev = curr; + curr = charAt(offset); + } while (prev !== "*" || curr !== "/"); + ++offset; + if (isDoc) { + setComment(start, offset - 2); + } + repeat = true; + } else { + return "/"; + } + } + } while (repeat); + + // offset !== length if we got here + + var end = offset; + delimRe.lastIndex = 0; + var delim = delimRe.test(charAt(end++)); + if (!delim) + while (end < length && !delimRe.test(charAt(end))) + ++end; + var token = source.substring(offset, offset = end); + if (token === "\"" || token === "'") + stringDelim = token; + return token; + } + + /** + * Pushes a token back to the stack. + * @param {string} token Token + * @returns {undefined} + * @inner + */ + function push(token) { + stack.push(token); + } + + /** + * Peeks for the next token. + * @returns {string|null} Token or `null` on eof + * @inner + */ + function peek() { + if (!stack.length) { + var token = next(); + if (token === null) + return null; + push(token); + } + return stack[0]; + } + + /** + * Skips a token. + * @param {string} expected Expected token + * @param {boolean} [optional=false] Whether the token is optional + * @returns {boolean} `true` when skipped, `false` if not + * @throws {Error} When a required token is not present + * @inner + */ + function skip(expected, optional) { + var actual = peek(), + equals = actual === expected; + if (equals) { + next(); + return true; + } + if (!optional) + throw illegal("token '" + actual + "', '" + expected + "' expected"); + return false; + } + + /** + * Gets a comment. + * @param {number} [trailingLine] Line number if looking for a trailing comment + * @returns {string|null} Comment text + * @inner + */ + function cmnt(trailingLine) { + var ret = null; + if (trailingLine === undefined) { + if (commentLine === line - 1 && (alternateCommentMode || commentType === "*" || commentLineEmpty)) { + ret = commentText; + } + } else { + /* istanbul ignore else */ + if (commentLine < trailingLine) { + peek(); + } + if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === "/")) { + ret = commentText; + } + } + return ret; + } + + return Object.defineProperty({ + next: next, + peek: peek, + push: push, + skip: skip, + cmnt: cmnt + }, "line", { + get: function() { return line; } + }); + /* eslint-enable callback-return */ +} + +},{}],35:[function(require,module,exports){ +"use strict"; +module.exports = Type; + +// extends Namespace +var Namespace = require(23); +((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; + +var Enum = require(15), + OneOf = require(25), + Field = require(16), + MapField = require(20), + Service = require(33), + Message = require(21), + Reader = require(27), + Writer = require(42), + util = require(37), + encoder = require(14), + decoder = require(13), + verifier = require(40), + converter = require(12), + wrappers = require(41); + +/** + * Constructs a new reflected message type instance. + * @classdesc Reflected message type. + * @extends NamespaceBase + * @constructor + * @param {string} name Message name + * @param {Object.} [options] Declared options + */ +function Type(name, options) { + Namespace.call(this, name, options); + + /** + * Message fields. + * @type {Object.} + */ + this.fields = {}; // toJSON, marker + + /** + * Oneofs declared within this namespace, if any. + * @type {Object.} + */ + this.oneofs = undefined; // toJSON + + /** + * Extension ranges, if any. + * @type {number[][]} + */ + this.extensions = undefined; // toJSON + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + /*? + * Whether this type is a legacy group. + * @type {boolean|undefined} + */ + this.group = undefined; // toJSON + + /** + * Cached fields by id. + * @type {Object.|null} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields as an array. + * @type {Field[]|null} + * @private + */ + this._fieldsArray = null; + + /** + * Cached oneofs as an array. + * @type {OneOf[]|null} + * @private + */ + this._oneofsArray = null; + + /** + * Cached constructor. + * @type {Constructor<{}>} + * @private + */ + this._ctor = null; +} + +Object.defineProperties(Type.prototype, { + + /** + * Message fields by id. + * @name Type#fieldsById + * @type {Object.} + * @readonly + */ + fieldsById: { + get: function() { + + /* istanbul ignore if */ + if (this._fieldsById) + return this._fieldsById; + + this._fieldsById = {}; + for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { + var field = this.fields[names[i]], + id = field.id; + + /* istanbul ignore if */ + if (this._fieldsById[id]) + throw Error("duplicate id " + id + " in " + this); + + this._fieldsById[id] = field; + } + return this._fieldsById; + } + }, + + /** + * Fields of this message as an array for iteration. + * @name Type#fieldsArray + * @type {Field[]} + * @readonly + */ + fieldsArray: { + get: function() { + return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); + } + }, + + /** + * Oneofs of this message as an array for iteration. + * @name Type#oneofsArray + * @type {OneOf[]} + * @readonly + */ + oneofsArray: { + get: function() { + return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); + } + }, + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + * @name Type#ctor + * @type {Constructor<{}>} + */ + ctor: { + get: function() { + return this._ctor || (this.ctor = Type.generateConstructor(this)()); + }, + set: function(ctor) { + + // Ensure proper prototype + var prototype = ctor.prototype; + if (!(prototype instanceof Message)) { + (ctor.prototype = new Message()).constructor = ctor; + util.merge(ctor.prototype, prototype); + } + + // Classes and messages reference their reflected type + ctor.$type = ctor.prototype.$type = this; + + // Mix in static methods + util.merge(ctor, Message, true); + + this._ctor = ctor; + + // Messages have non-enumerable default values on their prototype + var i = 0; + for (; i < /* initializes */ this.fieldsArray.length; ++i) + this._fieldsArray[i].resolve(); // ensures a proper value + + // Messages have non-enumerable getters and setters for each virtual oneof field + var ctorProperties = {}; + for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) + ctorProperties[this._oneofsArray[i].resolve().name] = { + get: util.oneOfGetter(this._oneofsArray[i].oneof), + set: util.oneOfSetter(this._oneofsArray[i].oneof) + }; + if (i) + Object.defineProperties(ctor.prototype, ctorProperties); + } + } +}); + +/** + * Generates a constructor function for the specified type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +Type.generateConstructor = function generateConstructor(mtype) { + /* eslint-disable no-unexpected-multiline */ + var gen = util.codegen(["p"], mtype.name); + // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype + for (var i = 0, field; i < mtype.fieldsArray.length; ++i) + if ((field = mtype._fieldsArray[i]).map) gen + ("this%s={}", util.safeProp(field.name)); + else if (field.repeated) gen + ("this%s=[]", util.safeProp(field.name)); + return gen + ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors + * @property {Object.} fields Field descriptors + * @property {number[][]} [extensions] Extension ranges + * @property {number[][]} [reserved] Reserved ranges + * @property {boolean} [group=false] Whether a legacy group or not + */ + +/** + * Creates a message type from a message type descriptor. + * @param {string} name Message name + * @param {IType} json Message type descriptor + * @returns {Type} Created message type + */ +Type.fromJSON = function fromJSON(name, json) { + var type = new Type(name, json.options); + type.extensions = json.extensions; + type.reserved = json.reserved; + var names = Object.keys(json.fields), + i = 0; + for (; i < names.length; ++i) + type.add( + ( typeof json.fields[names[i]].keyType !== "undefined" + ? MapField.fromJSON + : Field.fromJSON )(names[i], json.fields[names[i]]) + ); + if (json.oneofs) + for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) + type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); + if (json.nested) + for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { + var nested = json.nested[names[i]]; + type.add( // most to least likely + ( nested.id !== undefined + ? Field.fromJSON + : nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + if (json.extensions && json.extensions.length) + type.extensions = json.extensions; + if (json.reserved && json.reserved.length) + type.reserved = json.reserved; + if (json.group) + type.group = true; + if (json.comment) + type.comment = json.comment; + return type; +}; + +/** + * Converts this message type to a message type descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IType} Message type descriptor + */ +Type.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), + "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, + "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "group" , this.group || undefined, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Type.prototype.resolveAll = function resolveAll() { + var fields = this.fieldsArray, i = 0; + while (i < fields.length) + fields[i++].resolve(); + var oneofs = this.oneofsArray; i = 0; + while (i < oneofs.length) + oneofs[i++].resolve(); + return Namespace.prototype.resolveAll.call(this); +}; + +/** + * @override + */ +Type.prototype.get = function get(name) { + return this.fields[name] + || this.oneofs && this.oneofs[name] + || this.nested && this.nested[name] + || null; +}; + +/** + * Adds a nested object to this type. + * @param {ReflectionObject} object Nested object to add + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ +Type.prototype.add = function add(object) { + + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Field && object.extend === undefined) { + // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. + // The root object takes care of adding distinct sister-fields to the respective extended + // type instead. + + // avoids calling the getter if not absolutely necessary because it's called quite frequently + if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) + throw Error("duplicate id " + object.id + " in " + this); + if (this.isReservedId(object.id)) + throw Error("id " + object.id + " is reserved in " + this); + if (this.isReservedName(object.name)) + throw Error("name '" + object.name + "' is reserved in " + this); + + if (object.parent) + object.parent.remove(object); + this.fields[object.name] = object; + object.message = this; + object.onAdd(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs) + this.oneofs = {}; + this.oneofs[object.name] = object; + object.onAdd(this); + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * Removes a nested object from this type. + * @param {ReflectionObject} object Nested object to remove + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ +Type.prototype.remove = function remove(object) { + if (object instanceof Field && object.extend === undefined) { + // See Type#add for the reason why extension fields are excluded here. + + /* istanbul ignore if */ + if (!this.fields || this.fields[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.fields[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + if (object instanceof OneOf) { + + /* istanbul ignore if */ + if (!this.oneofs || this.oneofs[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.oneofs[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message<{}>} Message instance + */ +Type.prototype.create = function create(properties) { + return new this.ctor(properties); +}; + +/** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns {Type} `this` + */ +Type.prototype.setup = function setup() { + // Sets up everything at once so that the prototype chain does not have to be re-evaluated + // multiple times (V8, soft-deopt prototype-check). + + var fullName = this.fullName, + types = []; + for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) + types.push(this._fieldsArray[i].resolve().resolvedType); + + // Replace setup methods with type-specific generated functions + this.encode = encoder(this)({ + Writer : Writer, + types : types, + util : util + }); + this.decode = decoder(this)({ + Reader : Reader, + types : types, + util : util + }); + this.verify = verifier(this)({ + types : types, + util : util + }); + this.fromObject = converter.fromObject(this)({ + types : types, + util : util + }); + this.toObject = converter.toObject(this)({ + types : types, + util : util + }); + + // Inject custom wrappers for common types + var wrapper = wrappers[fullName]; + if (wrapper) { + var originalThis = Object.create(this); + // if (wrapper.fromObject) { + originalThis.fromObject = this.fromObject; + this.fromObject = wrapper.fromObject.bind(originalThis); + // } + // if (wrapper.toObject) { + originalThis.toObject = this.toObject; + this.toObject = wrapper.toObject.bind(originalThis); + // } + } + + return this; +}; + +/** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encode = function encode_setup(message, writer) { + return this.setup().encode(message, writer); // overrides this method +}; + +/** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); +}; + +/** + * Decodes a message of this type. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Length of the message, if known beforehand + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ +Type.prototype.decode = function decode_setup(reader, length) { + return this.setup().decode(reader, length); // overrides this method +}; + +/** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ +Type.prototype.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof Reader)) + reader = Reader.create(reader); + return this.decode(reader, reader.uint32()); +}; + +/** + * Verifies that field values are valid and that required fields are present. + * @param {Object.} message Plain object to verify + * @returns {null|string} `null` if valid, otherwise the reason why it is not + */ +Type.prototype.verify = function verify_setup(message) { + return this.setup().verify(message); // overrides this method +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object to convert + * @returns {Message<{}>} Message instance + */ +Type.prototype.fromObject = function fromObject(object) { + return this.setup().fromObject(object); +}; + +/** + * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. + * @interface IConversionOptions + * @property {Function} [longs] Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + * @property {Function} [enums] Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + * @property {Function} [bytes] Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + * @property {boolean} [defaults=false] Also sets default values on the resulting object + * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` + * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` + * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any + * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings + */ + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ +Type.prototype.toObject = function toObject(message, options) { + return this.setup().toObject(message, options); +}; + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @typedef TypeDecorator + * @type {function} + * @param {Constructor} target Target constructor + * @returns {undefined} + * @template T extends Message + */ + +/** + * Type decorator (TypeScript). + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {TypeDecorator} Decorator function + * @template T extends Message + */ +Type.d = function decorateType(typeName) { + return function typeDecorator(target) { + util.decorateType(target, typeName); + }; +}; + +},{"12":12,"13":13,"14":14,"15":15,"16":16,"20":20,"21":21,"23":23,"25":25,"27":27,"33":33,"37":37,"40":40,"41":41,"42":42}],36:[function(require,module,exports){ +"use strict"; + +/** + * Common type constants. + * @namespace + */ +var types = exports; + +var util = require(37); + +var s = [ + "double", // 0 + "float", // 1 + "int32", // 2 + "uint32", // 3 + "sint32", // 4 + "fixed32", // 5 + "sfixed32", // 6 + "int64", // 7 + "uint64", // 8 + "sint64", // 9 + "fixed64", // 10 + "sfixed64", // 11 + "bool", // 12 + "string", // 13 + "bytes" // 14 +]; + +function bake(values, offset) { + var i = 0, o = {}; + offset |= 0; + while (i < values.length) o[s[i + offset]] = values[i++]; + return o; +} + +/** + * Basic type wire types. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + * @property {number} bytes=2 Ldelim wire type + */ +types.basic = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2, + /* bytes */ 2 +]); + +/** + * Basic type defaults. + * @type {Object.} + * @const + * @property {number} double=0 Double default + * @property {number} float=0 Float default + * @property {number} int32=0 Int32 default + * @property {number} uint32=0 Uint32 default + * @property {number} sint32=0 Sint32 default + * @property {number} fixed32=0 Fixed32 default + * @property {number} sfixed32=0 Sfixed32 default + * @property {number} int64=0 Int64 default + * @property {number} uint64=0 Uint64 default + * @property {number} sint64=0 Sint32 default + * @property {number} fixed64=0 Fixed64 default + * @property {number} sfixed64=0 Sfixed64 default + * @property {boolean} bool=false Bool default + * @property {string} string="" String default + * @property {Array.} bytes=Array(0) Bytes default + * @property {null} message=null Message default + */ +types.defaults = bake([ + /* double */ 0, + /* float */ 0, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 0, + /* sfixed32 */ 0, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 0, + /* sfixed64 */ 0, + /* bool */ false, + /* string */ "", + /* bytes */ util.emptyArray, + /* message */ null +]); + +/** + * Basic long type wire types. + * @type {Object.} + * @const + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + */ +types.long = bake([ + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1 +], 7); + +/** + * Allowed types for map keys with their associated wire type. + * @type {Object.} + * @const + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + */ +types.mapKey = bake([ + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2 +], 2); + +/** + * Allowed types for packed repeated fields with their associated wire type. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + */ +types.packed = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0 +]); + +},{"37":37}],37:[function(require,module,exports){ +"use strict"; + +/** + * Various utility functions. + * @namespace + */ +var util = module.exports = require(39); + +var roots = require(30); + +var Type, // cyclic + Enum; + +util.codegen = require(3); +util.fetch = require(5); +util.path = require(8); + +/** + * Node's fs module if available. + * @type {Object.} + */ +util.fs = util.inquire("fs"); + +/** + * Converts an object's values to an array. + * @param {Object.} object Object to convert + * @returns {Array.<*>} Converted array + */ +util.toArray = function toArray(object) { + if (object) { + var keys = Object.keys(object), + array = new Array(keys.length), + index = 0; + while (index < keys.length) + array[index] = object[keys[index++]]; + return array; + } + return []; +}; + +/** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param {Array.<*>} array Array to convert + * @returns {Object.} Converted object + */ +util.toObject = function toObject(array) { + var object = {}, + index = 0; + while (index < array.length) { + var key = array[index++], + val = array[index++]; + if (val !== undefined) + object[key] = val; + } + return object; +}; + +var safePropBackslashRe = /\\/g, + safePropQuoteRe = /"/g; + +/** + * Tests whether the specified name is a reserved word in JS. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +util.isReserved = function isReserved(name) { + return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); +}; + +/** + * Returns a safe property accessor for the specified property name. + * @param {string} prop Property name + * @returns {string} Safe accessor + */ +util.safeProp = function safeProp(prop) { + if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) + return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; + return "." + prop; +}; + +/** + * Converts the first character of a string to upper case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.ucFirst = function ucFirst(str) { + return str.charAt(0).toUpperCase() + str.substring(1); +}; + +var camelCaseRe = /_([a-z])/g; + +/** + * Converts a string to camel case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.camelCase = function camelCase(str) { + return str.substring(0, 1) + + str.substring(1) + .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); +}; + +/** + * Compares reflected fields by id. + * @param {Field} a First field + * @param {Field} b Second field + * @returns {number} Comparison value + */ +util.compareFieldsById = function compareFieldsById(a, b) { + return a.id - b.id; +}; + +/** + * Decorator helper for types (TypeScript). + * @param {Constructor} ctor Constructor function + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {Type} Reflected type + * @template T extends Message + * @property {Root} root Decorators root + */ +util.decorateType = function decorateType(ctor, typeName) { + + /* istanbul ignore if */ + if (ctor.$type) { + if (typeName && ctor.$type.name !== typeName) { + util.decorateRoot.remove(ctor.$type); + ctor.$type.name = typeName; + util.decorateRoot.add(ctor.$type); + } + return ctor.$type; + } + + /* istanbul ignore next */ + if (!Type) + Type = require(35); + + var type = new Type(typeName || ctor.name); + util.decorateRoot.add(type); + type.ctor = ctor; // sets up .encode, .decode etc. + Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); + Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); + return type; +}; + +var decorateEnumIndex = 0; + +/** + * Decorator helper for enums (TypeScript). + * @param {Object} object Enum object + * @returns {Enum} Reflected enum + */ +util.decorateEnum = function decorateEnum(object) { + + /* istanbul ignore if */ + if (object.$type) + return object.$type; + + /* istanbul ignore next */ + if (!Enum) + Enum = require(15); + + var enm = new Enum("Enum" + decorateEnumIndex++, object); + util.decorateRoot.add(enm); + Object.defineProperty(object, "$type", { value: enm, enumerable: false }); + return enm; +}; + +/** + * Decorator root (TypeScript). + * @name util.decorateRoot + * @type {Root} + * @readonly + */ +Object.defineProperty(util, "decorateRoot", { + get: function() { + return roots["decorated"] || (roots["decorated"] = new (require(29))()); + } +}); + +},{"15":15,"29":29,"3":3,"30":30,"35":35,"39":39,"5":5,"8":8}],38:[function(require,module,exports){ +"use strict"; +module.exports = LongBits; + +var util = require(39); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; + +},{"39":39}],39:[function(require,module,exports){ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require(1); + +// converts to / from base64 encoded strings +util.base64 = require(2); + +// base class of rpc.Service +util.EventEmitter = require(4); + +// float handling accross browsers +util.float = require(6); + +// requires modules optionally and hides the call from bundlers +util.inquire = require(7); + +// converts to / from utf8 encoded strings +util.utf8 = require(10); + +// provides a node-like buffer pool in the browser +util.pool = require(9); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require(38); + +// global object reference +util.global = typeof window !== "undefined" && window + || typeof global !== "undefined" && global + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + * @const + */ +util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ + +/** + * Long.js's Long class if available. + * @type {Constructor} + */ +util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long"); + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; + +},{"1":1,"10":10,"2":2,"38":38,"4":4,"6":6,"7":7,"9":9}],40:[function(require,module,exports){ +"use strict"; +module.exports = verifier; + +var Enum = require(15), + util = require(37); + +function invalid(field, expected) { + return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; +} + +/** + * Generates a partial value verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyValue(gen, field, fieldIndex, ref) { + /* eslint-disable no-unexpected-multiline */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref) + ("default:") + ("return%j", invalid(field, "enum value")); + for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen + ("case %i:", field.resolvedType.values[keys[j]]); + gen + ("break") + ("}"); + } else { + gen + ("{") + ("var e=types[%i].verify(%s);", fieldIndex, ref) + ("if(e)") + ("return%j+e", field.name + ".") + ("}"); + } + } else { + switch (field.type) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.isInteger(%s))", ref) + ("return%j", invalid(field, "integer")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) + ("return%j", invalid(field, "integer|Long")); + break; + case "float": + case "double": gen + ("if(typeof %s!==\"number\")", ref) + ("return%j", invalid(field, "number")); + break; + case "bool": gen + ("if(typeof %s!==\"boolean\")", ref) + ("return%j", invalid(field, "boolean")); + break; + case "string": gen + ("if(!util.isString(%s))", ref) + ("return%j", invalid(field, "string")); + break; + case "bytes": gen + ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) + ("return%j", invalid(field, "buffer")); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a partial key verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyKey(gen, field, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.keyType) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.key32Re.test(%s))", ref) + ("return%j", invalid(field, "integer key")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not + ("return%j", invalid(field, "integer|Long key")); + break; + case "bool": gen + ("if(!util.key2Re.test(%s))", ref) + ("return%j", invalid(field, "boolean key")); + break; + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a verifier specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function verifier(mtype) { + /* eslint-disable no-unexpected-multiline */ + + var gen = util.codegen(["m"], mtype.name + "$verify") + ("if(typeof m!==\"object\"||m===null)") + ("return%j", "object expected"); + var oneofs = mtype.oneofsArray, + seenFirstField = {}; + if (oneofs.length) gen + ("var p={}"); + + for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + ref = "m" + util.safeProp(field.name); + + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null + + // map fields + if (field.map) { gen + ("if(!util.isObject(%s))", ref) + ("return%j", invalid(field, "object")) + ("var k=Object.keys(%s)", ref) + ("for(var i=0;i} + * @const + */ +var wrappers = exports; + +var Message = require(21); + +/** + * From object converter part of an {@link IWrapper}. + * @typedef WrapperFromObjectConverter + * @type {function} + * @param {Object.} object Plain object + * @returns {Message<{}>} Message instance + * @this Type + */ + +/** + * To object converter part of an {@link IWrapper}. + * @typedef WrapperToObjectConverter + * @type {function} + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @this Type + */ + +/** + * Common type wrapper part of {@link wrappers}. + * @interface IWrapper + * @property {WrapperFromObjectConverter} [fromObject] From object converter + * @property {WrapperToObjectConverter} [toObject] To object converter + */ + +// Custom wrapper for Any +wrappers[".google.protobuf.Any"] = { + + fromObject: function(object) { + + // unwrap value type if mapped + if (object && object["@type"]) { + var type = this.lookup(object["@type"]); + /* istanbul ignore else */ + if (type) { + // type_url does not accept leading "." + var type_url = object["@type"].charAt(0) === "." ? + object["@type"].substr(1) : object["@type"]; + // type_url prefix is optional, but path seperator is required + return this.create({ + type_url: "/" + type_url, + value: type.encode(type.fromObject(object)).finish() + }); + } + } + + return this.fromObject(object); + }, + + toObject: function(message, options) { + + // decode value if requested and unmapped + if (options && options.json && message.type_url && message.value) { + // Only use fully qualified type name after the last '/' + var name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) + message = type.decode(message.value); + } + + // wrap value if unmapped + if (!(message instanceof this.ctor) && message instanceof Message) { + var object = message.$type.toObject(message, options); + object["@type"] = message.$type.fullName; + return object; + } + + return this.toObject(message, options); + } +}; + +},{"21":21}],42:[function(require,module,exports){ +"use strict"; +module.exports = Writer; + +var util = require(39); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; +}; + +},{"39":39}],43:[function(require,module,exports){ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require(42); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require(39); + +var Buffer = util.Buffer; + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ +BufferWriter.alloc = function alloc_buffer(size) { + return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size); +}; + +var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else + buf.utf8Write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + +},{"39":39,"42":42}]},{},[19]) + +})(); +//# sourceMappingURL=protobuf.js.map diff --git a/node_modules/protobufjs/dist/protobuf.js.map b/node_modules/protobufjs/dist/protobuf.js.map new file mode 100644 index 0000000..d00d017 --- /dev/null +++ b/node_modules/protobufjs/dist/protobuf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/common.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light.js","../src/index-minimal.js","../src/index","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/parse.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/tokenize.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3cA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function prelude(modules, cache, entries) {\r\n\r\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\r\n // sources through a conflict-free require shim and is again wrapped within an iife that\r\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\r\n // so that minification can remove the directives of each module.\r\n\r\n function $require(name) {\r\n var $module = cache[name];\r\n if (!$module)\r\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\r\n return $module.exports;\r\n }\r\n\r\n var protobuf = $require(entries[0]);\r\n\r\n // Expose globally\r\n protobuf.util.global.protobuf = protobuf;\r\n\r\n // Be nice to AMD\r\n if (typeof define === \"function\" && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long && Long.isLong) {\r\n protobuf.util.Long = Long;\r\n protobuf.configure();\r\n }\r\n return protobuf;\r\n });\r\n\r\n // Be nice to CommonJS\r\n if (typeof module === \"object\" && module && module.exports)\r\n module.exports = protobuf;\r\n\r\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nmodule.exports = common;\r\n\r\nvar commonRe = /\\/|\\./;\r\n\r\n/**\r\n * Provides common type definitions.\r\n * Can also be used to provide additional google types or your own custom types.\r\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\r\n * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\r\n * @returns {undefined}\r\n * @property {INamespace} google/protobuf/any.proto Any\r\n * @property {INamespace} google/protobuf/duration.proto Duration\r\n * @property {INamespace} google/protobuf/empty.proto Empty\r\n * @property {INamespace} google/protobuf/field_mask.proto FieldMask\r\n * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\r\n * @property {INamespace} google/protobuf/timestamp.proto Timestamp\r\n * @property {INamespace} google/protobuf/wrappers.proto Wrappers\r\n * @example\r\n * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)\r\n * protobuf.common(\"descriptor\", descriptorJson);\r\n *\r\n * // manually provides a custom definition (uses my.foo namespace)\r\n * protobuf.common(\"my/foo/bar.proto\", myFooBarJson);\r\n */\r\nfunction common(name, json) {\r\n if (!commonRe.test(name)) {\r\n name = \"google/protobuf/\" + name + \".proto\";\r\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\r\n }\r\n common[name] = json;\r\n}\r\n\r\n// Not provided because of limited use (feel free to discuss or to provide yourself):\r\n//\r\n// google/protobuf/descriptor.proto\r\n// google/protobuf/source_context.proto\r\n// google/protobuf/type.proto\r\n//\r\n// Stripped and pre-parsed versions of these non-bundled files are instead available as part of\r\n// the repository or package within the google/protobuf directory.\r\n\r\ncommon(\"any\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Any message.\r\n * @interface IAny\r\n * @type {Object}\r\n * @property {string} [typeUrl]\r\n * @property {Uint8Array} [bytes]\r\n * @memberof common\r\n */\r\n Any: {\r\n fields: {\r\n type_url: {\r\n type: \"string\",\r\n id: 1\r\n },\r\n value: {\r\n type: \"bytes\",\r\n id: 2\r\n }\r\n }\r\n }\r\n});\r\n\r\nvar timeType;\r\n\r\ncommon(\"duration\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Duration message.\r\n * @interface IDuration\r\n * @type {Object}\r\n * @property {number|Long} [seconds]\r\n * @property {number} [nanos]\r\n * @memberof common\r\n */\r\n Duration: timeType = {\r\n fields: {\r\n seconds: {\r\n type: \"int64\",\r\n id: 1\r\n },\r\n nanos: {\r\n type: \"int32\",\r\n id: 2\r\n }\r\n }\r\n }\r\n});\r\n\r\ncommon(\"timestamp\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Timestamp message.\r\n * @interface ITimestamp\r\n * @type {Object}\r\n * @property {number|Long} [seconds]\r\n * @property {number} [nanos]\r\n * @memberof common\r\n */\r\n Timestamp: timeType\r\n});\r\n\r\ncommon(\"empty\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Empty message.\r\n * @interface IEmpty\r\n * @memberof common\r\n */\r\n Empty: {\r\n fields: {}\r\n }\r\n});\r\n\r\ncommon(\"struct\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Struct message.\r\n * @interface IStruct\r\n * @type {Object}\r\n * @property {Object.} [fields]\r\n * @memberof common\r\n */\r\n Struct: {\r\n fields: {\r\n fields: {\r\n keyType: \"string\",\r\n type: \"Value\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.Value message.\r\n * @interface IValue\r\n * @type {Object}\r\n * @property {string} [kind]\r\n * @property {0} [nullValue]\r\n * @property {number} [numberValue]\r\n * @property {string} [stringValue]\r\n * @property {boolean} [boolValue]\r\n * @property {IStruct} [structValue]\r\n * @property {IListValue} [listValue]\r\n * @memberof common\r\n */\r\n Value: {\r\n oneofs: {\r\n kind: {\r\n oneof: [\r\n \"nullValue\",\r\n \"numberValue\",\r\n \"stringValue\",\r\n \"boolValue\",\r\n \"structValue\",\r\n \"listValue\"\r\n ]\r\n }\r\n },\r\n fields: {\r\n nullValue: {\r\n type: \"NullValue\",\r\n id: 1\r\n },\r\n numberValue: {\r\n type: \"double\",\r\n id: 2\r\n },\r\n stringValue: {\r\n type: \"string\",\r\n id: 3\r\n },\r\n boolValue: {\r\n type: \"bool\",\r\n id: 4\r\n },\r\n structValue: {\r\n type: \"Struct\",\r\n id: 5\r\n },\r\n listValue: {\r\n type: \"ListValue\",\r\n id: 6\r\n }\r\n }\r\n },\r\n\r\n NullValue: {\r\n values: {\r\n NULL_VALUE: 0\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.ListValue message.\r\n * @interface IListValue\r\n * @type {Object}\r\n * @property {Array.} [values]\r\n * @memberof common\r\n */\r\n ListValue: {\r\n fields: {\r\n values: {\r\n rule: \"repeated\",\r\n type: \"Value\",\r\n id: 1\r\n }\r\n }\r\n }\r\n});\r\n\r\ncommon(\"wrappers\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.DoubleValue message.\r\n * @interface IDoubleValue\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n DoubleValue: {\r\n fields: {\r\n value: {\r\n type: \"double\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.FloatValue message.\r\n * @interface IFloatValue\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n FloatValue: {\r\n fields: {\r\n value: {\r\n type: \"float\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.Int64Value message.\r\n * @interface IInt64Value\r\n * @type {Object}\r\n * @property {number|Long} [value]\r\n * @memberof common\r\n */\r\n Int64Value: {\r\n fields: {\r\n value: {\r\n type: \"int64\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.UInt64Value message.\r\n * @interface IUInt64Value\r\n * @type {Object}\r\n * @property {number|Long} [value]\r\n * @memberof common\r\n */\r\n UInt64Value: {\r\n fields: {\r\n value: {\r\n type: \"uint64\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.Int32Value message.\r\n * @interface IInt32Value\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n Int32Value: {\r\n fields: {\r\n value: {\r\n type: \"int32\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.UInt32Value message.\r\n * @interface IUInt32Value\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n UInt32Value: {\r\n fields: {\r\n value: {\r\n type: \"uint32\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.BoolValue message.\r\n * @interface IBoolValue\r\n * @type {Object}\r\n * @property {boolean} [value]\r\n * @memberof common\r\n */\r\n BoolValue: {\r\n fields: {\r\n value: {\r\n type: \"bool\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.StringValue message.\r\n * @interface IStringValue\r\n * @type {Object}\r\n * @property {string} [value]\r\n * @memberof common\r\n */\r\n StringValue: {\r\n fields: {\r\n value: {\r\n type: \"string\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.BytesValue message.\r\n * @interface IBytesValue\r\n * @type {Object}\r\n * @property {Uint8Array} [value]\r\n * @memberof common\r\n */\r\n BytesValue: {\r\n fields: {\r\n value: {\r\n type: \"bytes\",\r\n id: 1\r\n }\r\n }\r\n }\r\n});\r\n\r\ncommon(\"field_mask\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.FieldMask message.\r\n * @interface IDoubleValue\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n FieldMask: {\r\n fields: {\r\n paths: {\r\n rule: \"repeated\",\r\n type: \"string\",\r\n id: 1\r\n }\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Gets the root definition of the specified common proto file.\r\n *\r\n * Bundled definitions are:\r\n * - google/protobuf/any.proto\r\n * - google/protobuf/duration.proto\r\n * - google/protobuf/empty.proto\r\n * - google/protobuf/field_mask.proto\r\n * - google/protobuf/struct.proto\r\n * - google/protobuf/timestamp.proto\r\n * - google/protobuf/wrappers.proto\r\n *\r\n * @param {string} file Proto file name\r\n * @returns {INamespace|null} Root definition or `null` if not defined\r\n */\r\ncommon.get = function get(file) {\r\n return common[file] || null;\r\n};\r\n","\"use strict\";\r\n/**\r\n * Runtime message from/to plain object converters.\r\n * @namespace\r\n */\r\nvar converter = exports;\r\n\r\nvar Enum = require(15),\r\n util = require(37);\r\n\r\n/**\r\n * Generates a partial value fromObject conveter.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {number} fieldIndex Field index\r\n * @param {string} prop Property reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n if (field.resolvedType) {\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(d%s){\", prop);\r\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\r\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\r\n (\"default:\");\r\n gen\r\n (\"case%j:\", keys[i])\r\n (\"case %i:\", values[keys[i]])\r\n (\"m%s=%j\", prop, values[keys[i]])\r\n (\"break\");\r\n } gen\r\n (\"}\");\r\n } else gen\r\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\r\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\r\n (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\r\n } else {\r\n var isUnsigned = false;\r\n switch (field.type) {\r\n case \"double\":\r\n case \"float\": gen\r\n (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\r\n break;\r\n case \"uint32\":\r\n case \"fixed32\": gen\r\n (\"m%s=d%s>>>0\", prop, prop);\r\n break;\r\n case \"int32\":\r\n case \"sint32\":\r\n case \"sfixed32\": gen\r\n (\"m%s=d%s|0\", prop, prop);\r\n break;\r\n case \"uint64\":\r\n isUnsigned = true;\r\n // eslint-disable-line no-fallthrough\r\n case \"int64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(util.Long)\")\r\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\r\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\r\n (\"m%s=parseInt(d%s,10)\", prop, prop)\r\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\r\n (\"m%s=d%s\", prop, prop)\r\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\r\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\r\n break;\r\n case \"bytes\": gen\r\n (\"if(typeof d%s===\\\"string\\\")\", prop)\r\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\r\n (\"else if(d%s.length)\", prop)\r\n (\"m%s=d%s\", prop, prop);\r\n break;\r\n case \"string\": gen\r\n (\"m%s=String(d%s)\", prop, prop);\r\n break;\r\n case \"bool\": gen\r\n (\"m%s=Boolean(d%s)\", prop, prop);\r\n break;\r\n /* default: gen\r\n (\"m%s=d%s\", prop, prop);\r\n break; */\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a plain object to runtime message converter specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nconverter.fromObject = function fromObject(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var fields = mtype.fieldsArray;\r\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\r\n (\"if(d instanceof this.ctor)\")\r\n (\"return d\");\r\n if (!fields.length) return gen\r\n (\"return new this.ctor\");\r\n gen\r\n (\"var m=new this.ctor\");\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n prop = util.safeProp(field.name);\r\n\r\n // Map fields\r\n if (field.map) { gen\r\n (\"if(d%s){\", prop)\r\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\r\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\r\n (\"m%s={}\", prop)\r\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\r\n break;\r\n case \"bytes\": gen\r\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\r\n break;\r\n default: gen\r\n (\"d%s=m%s\", prop, prop);\r\n break;\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a runtime message to plain object converter specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nconverter.toObject = function toObject(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\r\n if (!fields.length)\r\n return util.codegen()(\"return {}\");\r\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\r\n (\"if(!o)\")\r\n (\"o={}\")\r\n (\"var d={}\");\r\n\r\n var repeatedFields = [],\r\n mapFields = [],\r\n normalFields = [],\r\n i = 0;\r\n for (; i < fields.length; ++i)\r\n if (!fields[i].partOf)\r\n ( fields[i].resolve().repeated ? repeatedFields\r\n : fields[i].map ? mapFields\r\n : normalFields).push(fields[i]);\r\n\r\n if (repeatedFields.length) { gen\r\n (\"if(o.arrays||o.defaults){\");\r\n for (i = 0; i < repeatedFields.length; ++i) gen\r\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\r\n gen\r\n (\"}\");\r\n }\r\n\r\n if (mapFields.length) { gen\r\n (\"if(o.objects||o.defaults){\");\r\n for (i = 0; i < mapFields.length; ++i) gen\r\n (\"d%s={}\", util.safeProp(mapFields[i].name));\r\n gen\r\n (\"}\");\r\n }\r\n\r\n if (normalFields.length) { gen\r\n (\"if(o.defaults){\");\r\n for (i = 0; i < normalFields.length; ++i) {\r\n var field = normalFields[i],\r\n prop = util.safeProp(field.name);\r\n if (field.resolvedType instanceof Enum) gen\r\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\r\n else if (field.long) gen\r\n (\"if(util.Long){\")\r\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\r\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\r\n (\"}else\")\r\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\r\n else if (field.bytes) {\r\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\r\n gen\r\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\r\n (\"else{\")\r\n (\"d%s=%s\", prop, arrayDefault)\r\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\r\n (\"}\");\r\n } else gen\r\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\r\n } gen\r\n (\"}\");\r\n }\r\n var hasKs2 = false;\r\n for (i = 0; i < fields.length; ++i) {\r\n var field = fields[i],\r\n index = mtype._fieldsArray.indexOf(field),\r\n prop = util.safeProp(field.name);\r\n if (field.map) {\r\n if (!hasKs2) { hasKs2 = true; gen\r\n (\"var ks2\");\r\n } gen\r\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\r\n (\"d%s={}\", prop)\r\n (\"for(var j=0;j>>3){\");\r\n\r\n var i = 0;\r\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\r\n var field = mtype._fieldsArray[i].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\r\n ref = \"m\" + util.safeProp(field.name); gen\r\n (\"case %i:\", field.id);\r\n\r\n // Map fields\r\n if (field.map) { gen\r\n (\"r.skip().pos++\") // assumes id 1 + key wireType\r\n (\"if(%s===util.emptyObject)\", ref)\r\n (\"%s={}\", ref)\r\n (\"k=r.%s()\", field.keyType)\r\n (\"r.pos++\"); // assumes id 2 + value wireType\r\n if (types.long[field.keyType] !== undefined) {\r\n if (types.basic[type] === undefined) gen\r\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\r\n else gen\r\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=r.%s()\", ref, type);\r\n } else {\r\n if (types.basic[type] === undefined) gen\r\n (\"%s[k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\r\n else gen\r\n (\"%s[k]=r.%s()\", ref, type);\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) { gen\r\n\r\n (\"if(!(%s&&%s.length))\", ref, ref)\r\n (\"%s=[]\", ref);\r\n\r\n // Packable (always check for forward and backward compatiblity)\r\n if (types.packed[type] !== undefined) gen\r\n (\"if((t&7)===2){\")\r\n (\"var c2=r.uint32()+r.pos\")\r\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0)\r\n : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\r\n}\r\n\r\n/**\r\n * Generates an encoder specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nfunction encoder(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\r\n (\"if(!w)\")\r\n (\"w=Writer.create()\");\r\n\r\n var i, ref;\r\n\r\n // \"when a message is serialized its known fields should be written sequentially by field number\"\r\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\r\n\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n index = mtype._fieldsArray.indexOf(field),\r\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\r\n wireType = types.basic[type];\r\n ref = \"m\" + util.safeProp(field.name);\r\n\r\n // Map fields\r\n if (field.map) {\r\n gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name) // !== undefined && !== null\r\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\r\n if (wireType === undefined) gen\r\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\r\n else gen\r\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\r\n gen\r\n (\"}\")\r\n (\"}\");\r\n\r\n // Repeated fields\r\n } else if (field.repeated) { gen\r\n (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\r\n\r\n // Packed repeated\r\n if (field.packed && types.packed[type] !== undefined) { gen\r\n\r\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\r\n (\"for(var i=0;i<%s.length;++i)\", ref)\r\n (\"w.%s(%s[i])\", type, ref)\r\n (\"w.ldelim()\");\r\n\r\n // Non-packed\r\n } else { gen\r\n\r\n (\"for(var i=0;i<%s.length;++i)\", ref);\r\n if (wireType === undefined)\r\n genTypePartial(gen, field, index, ref + \"[i]\");\r\n else gen\r\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\r\n\r\n } gen\r\n (\"}\");\r\n\r\n // Non-repeated\r\n } else {\r\n if (field.optional) gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j))\", ref, field.name); // !== undefined && !== null\r\n\r\n if (wireType === undefined)\r\n genTypePartial(gen, field, index, ref);\r\n else gen\r\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\r\n\r\n }\r\n }\r\n\r\n return gen\r\n (\"return w\");\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}","\"use strict\";\r\nmodule.exports = Enum;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\r\n\r\nvar Namespace = require(23),\r\n util = require(37);\r\n\r\n/**\r\n * Constructs a new enum instance.\r\n * @classdesc Reflected enum.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {Object.} [values] Enum values as an object, by name\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] The comment for this enum\r\n * @param {Object.} [comments] The value comments for this enum\r\n */\r\nfunction Enum(name, values, options, comment, comments) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n if (values && typeof values !== \"object\")\r\n throw TypeError(\"values must be an object\");\r\n\r\n /**\r\n * Enum values by id.\r\n * @type {Object.}\r\n */\r\n this.valuesById = {};\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = Object.create(this.valuesById); // toJSON, marker\r\n\r\n /**\r\n * Enum comment text.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n\r\n /**\r\n * Value comment texts, if any.\r\n * @type {Object.}\r\n */\r\n this.comments = comments || {};\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {Array.}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\r\n // compatible enum. This is used by pbts to write actual enum definitions that work for\r\n // static and reflection code alike instead of emitting generic object definitions.\r\n\r\n if (values)\r\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\r\n if (typeof values[keys[i]] === \"number\") // use forward entries only\r\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\r\n}\r\n\r\n/**\r\n * Enum descriptor.\r\n * @interface IEnum\r\n * @property {Object.} values Enum values\r\n * @property {Object.} [options] Enum options\r\n */\r\n\r\n/**\r\n * Constructs an enum from an enum descriptor.\r\n * @param {string} name Enum name\r\n * @param {IEnum} json Enum descriptor\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\r\n enm.reserved = json.reserved;\r\n return enm;\r\n};\r\n\r\n/**\r\n * Converts this enum to an enum descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IEnum} Enum descriptor\r\n */\r\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"values\" , this.values,\r\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\r\n \"comment\" , keepComments ? this.comment : undefined,\r\n \"comments\" , keepComments ? this.comments : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @param {string} [comment] Comment, if any\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnum.prototype.add = function add(name, id, comment) {\r\n // utilized by the parser but not by .fromJSON\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n if (!util.isInteger(id))\r\n throw TypeError(\"id must be an integer\");\r\n\r\n if (this.values[name] !== undefined)\r\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\r\n\r\n if (this.isReservedId(id))\r\n throw Error(\"id \" + id + \" is reserved in \" + this);\r\n\r\n if (this.isReservedName(name))\r\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\r\n\r\n if (this.valuesById[id] !== undefined) {\r\n if (!(this.options && this.options.allow_alias))\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n } else\r\n this.valuesById[this.values[name] = id] = name;\r\n\r\n this.comments[name] = comment || null;\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnum.prototype.remove = function remove(name) {\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n var val = this.values[name];\r\n if (val == null)\r\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\r\n\r\n delete this.valuesById[val];\r\n delete this.values[name];\r\n delete this.comments[name];\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nEnum.prototype.isReservedId = function isReservedId(id) {\r\n return Namespace.isReservedId(this.reserved, id);\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nEnum.prototype.isReservedName = function isReservedName(name) {\r\n return Namespace.isReservedName(this.reserved, name);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\r\n\r\nvar Enum = require(15),\r\n types = require(36),\r\n util = require(37);\r\n\r\nvar Type; // cyclic\r\n\r\nvar ruleRe = /^required|optional|repeated$/;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @name Field\r\n * @classdesc Reflected message field.\r\n * @extends FieldBase\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object.} [rule=\"optional\"] Field rule\r\n * @param {string|Object.} [extend] Extended type if different from parent\r\n * @param {Object.} [options] Declared options\r\n */\r\n\r\n/**\r\n * Constructs a field from a field descriptor.\r\n * @param {string} name Field name\r\n * @param {IField} json Field descriptor\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Not an actual constructor. Use {@link Field} instead.\r\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\r\n * @exports FieldBase\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object.} [rule=\"optional\"] Field rule\r\n * @param {string|Object.} [extend] Extended type if different from parent\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction Field(name, id, type, rule, extend, options, comment) {\r\n\r\n if (util.isObject(rule)) {\r\n comment = extend;\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n comment = options;\r\n options = extend;\r\n extend = undefined;\r\n }\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n if (!util.isInteger(id) || id < 0)\r\n throw TypeError(\"id must be a non-negative integer\");\r\n\r\n if (!util.isString(type))\r\n throw TypeError(\"type must be a string\");\r\n\r\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\r\n throw TypeError(\"rule must be a string rule\");\r\n\r\n if (extend !== undefined && !util.isString(extend))\r\n throw TypeError(\"extend must be a string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {Type|null}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {OneOf|null}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field type's default value.\r\n * @type {*}\r\n */\r\n this.typeDefault = null;\r\n\r\n /**\r\n * The field's default value on prototypes.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\r\n\r\n /**\r\n * Whether this field's value is a buffer.\r\n * @type {boolean}\r\n */\r\n this.bytes = type === \"bytes\";\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {Type|Enum|null}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {Field|null}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {Field|null}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {boolean|null}\r\n * @private\r\n */\r\n this._packed = null;\r\n\r\n /**\r\n * Comment for this field.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\nObject.defineProperty(Field.prototype, \"packed\", {\r\n get: function() {\r\n // defaults to packed=true if not explicity set to false\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\") // clear cached before setting\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Field descriptor.\r\n * @interface IField\r\n * @property {string} [rule=\"optional\"] Field rule\r\n * @property {string} type Field type\r\n * @property {number} id Field id\r\n * @property {Object.} [options] Field options\r\n */\r\n\r\n/**\r\n * Extension field descriptor.\r\n * @interface IExtensionField\r\n * @extends IField\r\n * @property {string} extend Extended type\r\n */\r\n\r\n/**\r\n * Converts this field to a field descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IField} Field descriptor\r\n */\r\nField.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\r\n \"type\" , this.type,\r\n \"id\" , this.id,\r\n \"extend\" , this.extend,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nField.prototype.resolve = function resolve() {\r\n\r\n if (this.resolved)\r\n return this;\r\n\r\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\r\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\r\n if (this.resolvedType instanceof Type)\r\n this.typeDefault = null;\r\n else // instanceof Enum\r\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\r\n }\r\n\r\n // use explicitly set default value if present\r\n if (this.options && this.options[\"default\"] != null) {\r\n this.typeDefault = this.options[\"default\"];\r\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\r\n this.typeDefault = this.resolvedType.values[this.typeDefault];\r\n }\r\n\r\n // remove unnecessary options\r\n if (this.options) {\r\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\r\n delete this.options.packed;\r\n if (!Object.keys(this.options).length)\r\n this.options = undefined;\r\n }\r\n\r\n // convert to internal data type if necesssary\r\n if (this.long) {\r\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\r\n\r\n /* istanbul ignore else */\r\n if (Object.freeze)\r\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\r\n\r\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\r\n var buf;\r\n if (util.base64.test(this.typeDefault))\r\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\r\n else\r\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\r\n this.typeDefault = buf;\r\n }\r\n\r\n // take special care of maps and repeated fields\r\n if (this.map)\r\n this.defaultValue = util.emptyObject;\r\n else if (this.repeated)\r\n this.defaultValue = util.emptyArray;\r\n else\r\n this.defaultValue = this.typeDefault;\r\n\r\n // ensure proper value on prototype\r\n if (this.parent instanceof Type)\r\n this.parent.ctor.prototype[this.name] = this.defaultValue;\r\n\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\r\n * @typedef FieldDecorator\r\n * @type {function}\r\n * @param {Object} prototype Target prototype\r\n * @param {string} fieldName Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Field decorator (TypeScript).\r\n * @name Field.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\r\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\r\n * @param {T} [defaultValue] Default value\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\r\n */\r\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\r\n\r\n // submessage: decorate the submessage and use its name as the type\r\n if (typeof fieldType === \"function\")\r\n fieldType = util.decorateType(fieldType).name;\r\n\r\n // enum reference: create a reflected copy of the enum and keep reuseing it\r\n else if (fieldType && typeof fieldType === \"object\")\r\n fieldType = util.decorateEnum(fieldType).name;\r\n\r\n return function fieldDecorator(prototype, fieldName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\r\n };\r\n};\r\n\r\n/**\r\n * Field decorator (TypeScript).\r\n * @name Field.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {Constructor|string} fieldType Field type\r\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends Message\r\n * @variation 2\r\n */\r\n// like Field.d but without a default value\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nField._configure = function configure(Type_) {\r\n Type = Type_;\r\n};\r\n","\"use strict\";\r\nvar protobuf = module.exports = require(18);\r\n\r\nprotobuf.build = \"light\";\r\n\r\n/**\r\n * A node-style callback as used by {@link load} and {@link Root#load}.\r\n * @typedef LoadCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Root} [root] Root, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @see {@link Root#load}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === \"function\") {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @see {@link Root#load}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @see {@link Root#load}\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n * @see {@link Root#loadSync}\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Serialization\r\nprotobuf.encoder = require(14);\r\nprotobuf.decoder = require(13);\r\nprotobuf.verifier = require(40);\r\nprotobuf.converter = require(12);\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(24);\r\nprotobuf.Namespace = require(23);\r\nprotobuf.Root = require(29);\r\nprotobuf.Enum = require(15);\r\nprotobuf.Type = require(35);\r\nprotobuf.Field = require(16);\r\nprotobuf.OneOf = require(25);\r\nprotobuf.MapField = require(20);\r\nprotobuf.Service = require(33);\r\nprotobuf.Method = require(22);\r\n\r\n// Runtime\r\nprotobuf.Message = require(21);\r\nprotobuf.wrappers = require(41);\r\n\r\n// Utility\r\nprotobuf.types = require(36);\r\nprotobuf.util = require(37);\r\n\r\n// Set up possibly cyclic reflection dependencies\r\nprotobuf.ReflectionObject._configure(protobuf.Root);\r\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\r\nprotobuf.Root._configure(protobuf.Type);\r\nprotobuf.Field._configure(protobuf.Type);\r\n","\"use strict\";\r\nvar protobuf = exports;\r\n\r\n/**\r\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\r\n * @name build\r\n * @type {string}\r\n * @const\r\n */\r\nprotobuf.build = \"minimal\";\r\n\r\n// Serialization\r\nprotobuf.Writer = require(42);\r\nprotobuf.BufferWriter = require(43);\r\nprotobuf.Reader = require(27);\r\nprotobuf.BufferReader = require(28);\r\n\r\n// Utility\r\nprotobuf.util = require(39);\r\nprotobuf.rpc = require(31);\r\nprotobuf.roots = require(30);\r\nprotobuf.configure = configure;\r\n\r\n/* istanbul ignore next */\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n protobuf.Reader._configure(protobuf.BufferReader);\r\n protobuf.util._configure();\r\n}\r\n\r\n// Set up buffer utility according to the environment\r\nprotobuf.Writer._configure(protobuf.BufferWriter);\r\nconfigure();\r\n","\"use strict\";\r\nvar protobuf = module.exports = require(17);\r\n\r\nprotobuf.build = \"full\";\r\n\r\n// Parser\r\nprotobuf.tokenize = require(34);\r\nprotobuf.parse = require(26);\r\nprotobuf.common = require(11);\r\n\r\n// Configure parser\r\nprotobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\n// extends Field\r\nvar Field = require(16);\r\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\r\n\r\nvar types = require(36),\r\n util = require(37);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends FieldBase\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction MapField(name, id, keyType, type, options, comment) {\r\n Field.call(this, name, id, type, undefined, undefined, options, comment);\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(keyType))\r\n throw TypeError(\"keyType must be a string\");\r\n\r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {ReflectionObject|null}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Map field descriptor.\r\n * @interface IMapField\r\n * @extends {IField}\r\n * @property {string} keyType Key type\r\n */\r\n\r\n/**\r\n * Extension map field descriptor.\r\n * @interface IExtensionMapField\r\n * @extends IMapField\r\n * @property {string} extend Extended type\r\n */\r\n\r\n/**\r\n * Constructs a map field from a map field descriptor.\r\n * @param {string} name Field name\r\n * @param {IMapField} json Map field descriptor\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this map field to a map field descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IMapField} Map field descriptor\r\n */\r\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"keyType\" , this.keyType,\r\n \"type\" , this.type,\r\n \"id\" , this.id,\r\n \"extend\" , this.extend,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapField.prototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\r\n if (types.mapKey[this.keyType] === undefined)\r\n throw Error(\"invalid key type: \" + this.keyType);\r\n\r\n return Field.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Map field decorator (TypeScript).\r\n * @name MapField.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\r\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\r\n */\r\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\r\n\r\n // submessage value: decorate the submessage and use its name as the type\r\n if (typeof fieldValueType === \"function\")\r\n fieldValueType = util.decorateType(fieldValueType).name;\r\n\r\n // enum reference value: create a reflected copy of the enum and keep reuseing it\r\n else if (fieldValueType && typeof fieldValueType === \"object\")\r\n fieldValueType = util.decorateEnum(fieldValueType).name;\r\n\r\n return function mapFieldDecorator(prototype, fieldName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\nvar util = require(39);\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * @classdesc Abstract runtime message.\r\n * @constructor\r\n * @param {Properties} [properties] Properties to set\r\n * @template T extends object = object\r\n */\r\nfunction Message(properties) {\r\n // not used internally\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n}\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/*eslint-disable valid-jsdoc*/\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object.} [properties] Properties to set\r\n * @returns {Message} Message instance\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.create = function create(properties) {\r\n return this.$type.create(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {T|Object.} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {T|Object.} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\r\n * @returns {T} Decoded message\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.decode = function decode(reader) {\r\n return this.$type.decode(reader);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\r\n * @returns {T} Decoded message\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(reader) {\r\n return this.$type.decodeDelimited(reader);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Object.} message Plain object to verify\r\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\r\n * @param {Object.} object Plain object\r\n * @returns {T} Message instance\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.fromObject = function fromObject(object) {\r\n return this.$type.fromObject(object);\r\n};\r\n\r\n/**\r\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\r\n * @param {T} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.toObject = function toObject(message, options) {\r\n return this.$type.toObject(message, options);\r\n};\r\n\r\n/**\r\n * Converts this message to JSON.\r\n * @returns {Object.} JSON object\r\n */\r\nMessage.prototype.toJSON = function toJSON() {\r\n return this.$type.toObject(this, util.toJSONOptions);\r\n};\r\n\r\n/*eslint-enable valid-jsdoc*/","\"use strict\";\r\nmodule.exports = Method;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\r\n\r\nvar util = require(37);\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] The comment for this method\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\r\n\r\n /* istanbul ignore next */\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n\r\n /* istanbul ignore if */\r\n if (!(type === undefined || util.isString(type)))\r\n throw TypeError(\"type must be a string\");\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(requestType))\r\n throw TypeError(\"requestType must be a string\");\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(responseType))\r\n throw TypeError(\"responseType must be a string\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {Type|null}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {Type|null}\r\n */\r\n this.resolvedResponseType = null;\r\n\r\n /**\r\n * Comment for this method\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Method descriptor.\r\n * @interface IMethod\r\n * @property {string} [type=\"rpc\"] Method type\r\n * @property {string} requestType Request type\r\n * @property {string} responseType Response type\r\n * @property {boolean} [requestStream=false] Whether requests are streamed\r\n * @property {boolean} [responseStream=false] Whether responses are streamed\r\n * @property {Object.} [options] Method options\r\n */\r\n\r\n/**\r\n * Constructs a method from a method descriptor.\r\n * @param {string} name Method name\r\n * @param {IMethod} json Method descriptor\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this method to a method descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IMethod} Method descriptor\r\n */\r\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\r\n \"requestType\" , this.requestType,\r\n \"requestStream\" , this.requestStream,\r\n \"responseType\" , this.responseType,\r\n \"responseStream\" , this.responseStream,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethod.prototype.resolve = function resolve() {\r\n\r\n /* istanbul ignore if */\r\n if (this.resolved)\r\n return this;\r\n\r\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\r\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\r\n\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\r\n\r\nvar Field = require(16),\r\n util = require(37);\r\n\r\nvar Type, // cyclic\r\n Service,\r\n Enum;\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @name Namespace\r\n * @classdesc Reflected namespace.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object.} [options] Declared options\r\n */\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @memberof Namespace\r\n * @function\r\n * @param {string} name Namespace name\r\n * @param {Object.} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array, toJSONOptions) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {Array.|undefined} reserved Array of reserved ranges and names\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nNamespace.isReservedId = function isReservedId(reserved, id) {\r\n if (reserved)\r\n for (var i = 0; i < reserved.length; ++i)\r\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] >= id)\r\n return true;\r\n return false;\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {Array.|undefined} reserved Array of reserved ranges and names\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nNamespace.isReservedName = function isReservedName(reserved, name) {\r\n if (reserved)\r\n for (var i = 0; i < reserved.length; ++i)\r\n if (reserved[i] === name)\r\n return true;\r\n return false;\r\n};\r\n\r\n/**\r\n * Not an actual constructor. Use {@link Namespace} instead.\r\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\r\n * @exports NamespaceBase\r\n * @extends ReflectionObject\r\n * @abstract\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object.} [options] Declared options\r\n * @see {@link Namespace}\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {ReflectionObject[]|null}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\n/**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name NamespaceBase#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\r\n get: function() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n});\r\n\r\n/**\r\n * Namespace descriptor.\r\n * @interface INamespace\r\n * @property {Object.} [options] Namespace options\r\n * @property {Object.} [nested] Nested object descriptors\r\n */\r\n\r\n/**\r\n * Any extension field descriptor.\r\n * @typedef AnyExtensionField\r\n * @type {IExtensionField|IExtensionMapField}\r\n */\r\n\r\n/**\r\n * Any nested object descriptor.\r\n * @typedef AnyNestedObject\r\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\r\n */\r\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\r\n\r\n/**\r\n * Converts this namespace to a namespace descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {INamespace} Namespace descriptor\r\n */\r\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds nested objects to this namespace from nested object descriptors.\r\n * @param {Object.} nestedJson Any nested object descriptors\r\n * @returns {Namespace} `this`\r\n */\r\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n /* istanbul ignore else */\r\n if (nestedJson) {\r\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\r\n nested = nestedJson[names[i]];\r\n ns.add( // most to least likely\r\n ( nested.fields !== undefined\r\n ? Type.fromJSON\r\n : nested.values !== undefined\r\n ? Enum.fromJSON\r\n : nested.methods !== undefined\r\n ? Service.fromJSON\r\n : nested.id !== undefined\r\n ? Field.fromJSON\r\n : Namespace.fromJSON )(names[i], nested)\r\n );\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespace.prototype.get = function get(name) {\r\n return this.nested && this.nested[name]\r\n || null;\r\n};\r\n\r\n/**\r\n * Gets the values of the nested {@link Enum|enum} of the specified name.\r\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\r\n * @param {string} name Nested enum name\r\n * @returns {Object.} Enum values\r\n * @throws {Error} If there is no such enum\r\n */\r\nNamespace.prototype.getEnum = function getEnum(name) {\r\n if (this.nested && this.nested[name] instanceof Enum)\r\n return this.nested[name].values;\r\n throw Error(\"no such enum: \" + name);\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespace.prototype.add = function add(object) {\r\n\r\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\r\n throw TypeError(\"object must be a valid nested object\");\r\n\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.nestedArray;\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespace.prototype.remove = function remove(object) {\r\n\r\n if (!(object instanceof ReflectionObject))\r\n throw TypeError(\"object must be a ReflectionObject\");\r\n if (object.parent !== this)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespace.prototype.define = function define(path, json) {\r\n\r\n if (util.isString(path))\r\n path = path.split(\".\");\r\n else if (!Array.isArray(path))\r\n throw TypeError(\"illegal path\");\r\n if (path && path.length && path[0] === \"\")\r\n throw Error(\"path must be relative\");\r\n\r\n var ptr = this;\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespace.prototype.resolveAll = function resolveAll() {\r\n var nested = this.nestedArray, i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return this.resolve();\r\n};\r\n\r\n/**\r\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\r\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\r\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\r\n */\r\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\r\n\r\n /* istanbul ignore next */\r\n if (typeof filterTypes === \"boolean\") {\r\n parentAlreadyChecked = filterTypes;\r\n filterTypes = undefined;\r\n } else if (filterTypes && !Array.isArray(filterTypes))\r\n filterTypes = [ filterTypes ];\r\n\r\n if (util.isString(path) && path.length) {\r\n if (path === \".\")\r\n return this.root;\r\n path = path.split(\".\");\r\n } else if (!path.length)\r\n return this;\r\n\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.root.lookup(path.slice(1), filterTypes);\r\n\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found) {\r\n if (path.length === 1) {\r\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\r\n return found;\r\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\r\n return found;\r\n\r\n // Otherwise try each nested namespace\r\n } else\r\n for (var i = 0; i < this.nestedArray.length; ++i)\r\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\r\n return found;\r\n\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path, filterTypes);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @name NamespaceBase#lookup\r\n * @function\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\r\n * @variation 2\r\n */\r\n// lookup(path: string, [parentAlreadyChecked: boolean])\r\n\r\n/**\r\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Type} Looked up type\r\n * @throws {Error} If `path` does not point to a type\r\n */\r\nNamespace.prototype.lookupType = function lookupType(path) {\r\n var found = this.lookup(path, [ Type ]);\r\n if (!found)\r\n throw Error(\"no such type: \" + path);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Enum} Looked up enum\r\n * @throws {Error} If `path` does not point to an enum\r\n */\r\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\r\n var found = this.lookup(path, [ Enum ]);\r\n if (!found)\r\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Type} Looked up type or enum\r\n * @throws {Error} If `path` does not point to a type or enum\r\n */\r\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\r\n var found = this.lookup(path, [ Type, Enum ]);\r\n if (!found)\r\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Service} Looked up service\r\n * @throws {Error} If `path` does not point to a service\r\n */\r\nNamespace.prototype.lookupService = function lookupService(path) {\r\n var found = this.lookup(path, [ Service ]);\r\n if (!found)\r\n throw Error(\"no such Service '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nNamespace._configure = function(Type_, Service_, Enum_) {\r\n Type = Type_;\r\n Service = Service_;\r\n Enum = Enum_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.className = \"ReflectionObject\";\r\n\r\nvar util = require(37);\r\n\r\nvar Root; // cyclic\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object.} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n if (options && !util.isObject(options))\r\n throw TypeError(\"options must be an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {Namespace|null}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n\r\n /**\r\n * Comment text, if any.\r\n * @type {string|null}\r\n */\r\n this.comment = null;\r\n\r\n /**\r\n * Defining file name.\r\n * @type {string|null}\r\n */\r\n this.filename = null;\r\n}\r\n\r\nObject.defineProperties(ReflectionObject.prototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: function() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join(\".\");\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Converts this reflection object to its descriptor representation.\r\n * @returns {Object.} Descriptor\r\n * @abstract\r\n */\r\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObject.prototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.root;\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObject.prototype.onRemove = function onRemove(parent) {\r\n var root = parent.root;\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n if (this.root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObject.prototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\r\n this.setOption(keys[i], options[keys[i]], ifNotSet);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Class name[, space, full name]\r\n */\r\nReflectionObject.prototype.toString = function toString() {\r\n var className = this.constructor.className,\r\n fullName = this.fullName;\r\n if (fullName.length)\r\n return className + \" \" + fullName;\r\n return className;\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nReflectionObject._configure = function(Root_) {\r\n Root = Root_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\r\n\r\nvar Field = require(16),\r\n util = require(37);\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object.} [fieldNames] Field names\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction OneOf(name, fieldNames, options, comment) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n\r\n /* istanbul ignore if */\r\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\r\n throw TypeError(\"fieldNames must be an Array\");\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof as an array for iteration.\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\r\n\r\n /**\r\n * Comment for this field.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Oneof descriptor.\r\n * @interface IOneOf\r\n * @property {Array.} oneof Oneof field names\r\n * @property {Object.} [options] Oneof options\r\n */\r\n\r\n/**\r\n * Constructs a oneof from a oneof descriptor.\r\n * @param {string} name Oneof name\r\n * @param {IOneOf} json Oneof descriptor\r\n * @returns {OneOf} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this oneof to a oneof descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IOneOf} Oneof descriptor\r\n */\r\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"oneof\" , this.oneof,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\r\n if (!oneof.fieldsArray[i].parent)\r\n oneof.parent.add(oneof.fieldsArray[i]);\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof and removes it from its current parent, if any.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOf.prototype.add = function add(field) {\r\n\r\n /* istanbul ignore if */\r\n if (!(field instanceof Field))\r\n throw TypeError(\"field must be a Field\");\r\n\r\n if (field.parent && field.parent !== this.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this.fieldsArray.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof and puts it back to the oneof's parent.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOf.prototype.remove = function remove(field) {\r\n\r\n /* istanbul ignore if */\r\n if (!(field instanceof Field))\r\n throw TypeError(\"field must be a Field\");\r\n\r\n var index = this.fieldsArray.indexOf(field);\r\n\r\n /* istanbul ignore if */\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n\r\n this.fieldsArray.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n\r\n /* istanbul ignore else */\r\n if (index > -1) // theoretical\r\n this.oneof.splice(index, 1);\r\n\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOf.prototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n var self = this;\r\n // Collect present fields\r\n for (var i = 0; i < this.oneof.length; ++i) {\r\n var field = parent.get(this.oneof[i]);\r\n if (field && !field.partOf) {\r\n field.partOf = self;\r\n self.fieldsArray.push(field);\r\n }\r\n }\r\n // Add not yet present fields\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOf.prototype.onRemove = function onRemove(parent) {\r\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\r\n if ((field = this.fieldsArray[i]).parent)\r\n field.parent.remove(field);\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\r\n * @typedef OneOfDecorator\r\n * @type {function}\r\n * @param {Object} prototype Target prototype\r\n * @param {string} oneofName OneOf name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * OneOf decorator (TypeScript).\r\n * @function\r\n * @param {...string} fieldNames Field names\r\n * @returns {OneOfDecorator} Decorator function\r\n * @template T extends string\r\n */\r\nOneOf.d = function decorateOneOf() {\r\n var fieldNames = new Array(arguments.length),\r\n index = 0;\r\n while (index < arguments.length)\r\n fieldNames[index] = arguments[index++];\r\n return function oneOfDecorator(prototype, oneofName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new OneOf(oneofName, fieldNames));\r\n Object.defineProperty(prototype, oneofName, {\r\n get: util.oneOfGetter(fieldNames),\r\n set: util.oneOfSetter(fieldNames)\r\n });\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nparse.filename = null;\r\nparse.defaults = { keepCase: false };\r\n\r\nvar tokenize = require(34),\r\n Root = require(29),\r\n Type = require(35),\r\n Field = require(16),\r\n MapField = require(20),\r\n OneOf = require(25),\r\n Enum = require(15),\r\n Service = require(33),\r\n Method = require(22),\r\n types = require(36),\r\n util = require(37);\r\n\r\nvar base10Re = /^[1-9][0-9]*$/,\r\n base10NegRe = /^-?[1-9][0-9]*$/,\r\n base16Re = /^0[x][0-9a-fA-F]+$/,\r\n base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\r\n base8Re = /^0[0-7]+$/,\r\n base8NegRe = /^-?0[0-7]+$/,\r\n numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\r\n nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @interface IParserResult\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Options modifying the behavior of {@link parse}.\r\n * @interface IParseOptions\r\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\r\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\r\n */\r\n\r\n/**\r\n * Options modifying the behavior of JSON serialization.\r\n * @interface IToJSONOptions\r\n * @property {boolean} [keepComments=false] Serializes comments.\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} root Root to populate\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {IParserResult} Parser result\r\n * @property {string} filename=null Currently processing file name for error reporting, if known\r\n * @property {IParseOptions} defaults Default {@link IParseOptions}\r\n */\r\nfunction parse(source, root, options) {\r\n /* eslint-disable callback-return */\r\n if (!(root instanceof Root)) {\r\n options = root;\r\n root = new Root();\r\n }\r\n if (!options)\r\n options = parse.defaults;\r\n\r\n var tn = tokenize(source, options.alternateCommentMode || false),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip,\r\n cmnt = tn.cmnt;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n var ptr = root;\r\n\r\n var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\r\n\r\n /* istanbul ignore next */\r\n function illegal(token, name, insideTryCatch) {\r\n var filename = parse.filename;\r\n if (!insideTryCatch)\r\n parse.filename = null;\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n /* istanbul ignore if */\r\n if ((token = next()) !== \"\\\"\" && token !== \"'\")\r\n throw illegal(token);\r\n\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === \"\\\"\" || token === \"'\");\r\n return values.join(\"\");\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (token) {\r\n case \"'\":\r\n case \"\\\"\":\r\n push(token);\r\n return readString();\r\n case \"true\": case \"TRUE\":\r\n return true;\r\n case \"false\": case \"FALSE\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token, /* insideTryCatch */ true);\r\n } catch (e) {\r\n\r\n /* istanbul ignore else */\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n\r\n /* istanbul ignore next */\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRanges(target, acceptStrings) {\r\n var token, start;\r\n do {\r\n if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\"))\r\n target.push(readString());\r\n else\r\n target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\r\n } while (skip(\",\", true));\r\n skip(\";\");\r\n }\r\n\r\n function parseNumber(token, insideTryCatch) {\r\n var sign = 1;\r\n if (token.charAt(0) === \"-\") {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n switch (token) {\r\n case \"inf\": case \"INF\": case \"Inf\":\r\n return sign * Infinity;\r\n case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\r\n return NaN;\r\n case \"0\":\r\n return 0;\r\n }\r\n if (base10Re.test(token))\r\n return sign * parseInt(token, 10);\r\n if (base16Re.test(token))\r\n return sign * parseInt(token, 16);\r\n if (base8Re.test(token))\r\n return sign * parseInt(token, 8);\r\n\r\n /* istanbul ignore else */\r\n if (numberRe.test(token))\r\n return sign * parseFloat(token);\r\n\r\n /* istanbul ignore next */\r\n throw illegal(token, \"number\", insideTryCatch);\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n switch (token) {\r\n case \"max\": case \"MAX\": case \"Max\":\r\n return 536870911;\r\n case \"0\":\r\n return 0;\r\n }\r\n\r\n /* istanbul ignore if */\r\n if (!acceptNegative && token.charAt(0) === \"-\")\r\n throw illegal(token, \"id\");\r\n\r\n if (base10NegRe.test(token))\r\n return parseInt(token, 10);\r\n if (base16NegRe.test(token))\r\n return parseInt(token, 16);\r\n\r\n /* istanbul ignore else */\r\n if (base8NegRe.test(token))\r\n return parseInt(token, 8);\r\n\r\n /* istanbul ignore next */\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n\r\n /* istanbul ignore if */\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n\r\n pkg = next();\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, \"name\");\r\n\r\n ptr = ptr.define(pkg);\r\n skip(\";\");\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(\";\");\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = readString();\r\n isProto3 = syntax === \"proto3\";\r\n\r\n /* istanbul ignore if */\r\n if (!isProto3 && syntax !== \"proto2\")\r\n throw illegal(syntax, \"syntax\");\r\n\r\n skip(\";\");\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case \"option\":\r\n parseOption(parent, token);\r\n skip(\";\");\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function ifBlock(obj, fnIf, fnElse) {\r\n var trailingLine = tn.line;\r\n if (obj) {\r\n obj.comment = cmnt(); // try block-type comment\r\n obj.filename = parse.filename;\r\n }\r\n if (skip(\"{\", true)) {\r\n var token;\r\n while ((token = next()) !== \"}\")\r\n fnIf(token);\r\n skip(\";\", true);\r\n } else {\r\n if (fnElse)\r\n fnElse();\r\n skip(\";\");\r\n if (obj && typeof obj.comment !== \"string\")\r\n obj.comment = cmnt(trailingLine); // try line-type comment if no block\r\n }\r\n }\r\n\r\n function parseType(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"type name\");\r\n\r\n var type = new Type(token);\r\n ifBlock(type, function parseType_block(token) {\r\n if (parseCommon(type, token))\r\n return;\r\n\r\n switch (token) {\r\n\r\n case \"map\":\r\n parseMapField(type, token);\r\n break;\r\n\r\n case \"required\":\r\n case \"optional\":\r\n case \"repeated\":\r\n parseField(type, token);\r\n break;\r\n\r\n case \"oneof\":\r\n parseOneOf(type, token);\r\n break;\r\n\r\n case \"extensions\":\r\n readRanges(type.extensions || (type.extensions = []));\r\n break;\r\n\r\n case \"reserved\":\r\n readRanges(type.reserved || (type.reserved = []), true);\r\n break;\r\n\r\n default:\r\n /* istanbul ignore if */\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n\r\n push(token);\r\n parseField(type, \"optional\");\r\n break;\r\n }\r\n });\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (type === \"group\") {\r\n parseGroup(parent, rule);\r\n return;\r\n }\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, \"type\");\r\n\r\n var name = next();\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"name\");\r\n\r\n name = applyCase(name);\r\n skip(\"=\");\r\n\r\n var field = new Field(name, parseId(next()), type, rule, extend);\r\n ifBlock(field, function parseField_block(token) {\r\n\r\n /* istanbul ignore else */\r\n if (token === \"option\") {\r\n parseOption(field, token);\r\n skip(\";\");\r\n } else\r\n throw illegal(token);\r\n\r\n }, function parseField_line() {\r\n parseInlineOptions(field);\r\n });\r\n parent.add(field);\r\n\r\n // JSON defaults to packed=true if not set so we have to set packed=false explicity when\r\n // parsing proto2 descriptors without the option, where applicable. This must be done for\r\n // all known packable types and anything that could be an enum (= is not a basic type).\r\n if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))\r\n field.setOption(\"packed\", false, /* ifNotSet */ true);\r\n }\r\n\r\n function parseGroup(parent, rule) {\r\n var name = next();\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"name\");\r\n\r\n var fieldName = util.lcFirst(name);\r\n if (name === fieldName)\r\n name = util.ucFirst(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var type = new Type(name);\r\n type.group = true;\r\n var field = new Field(fieldName, id, name, rule);\r\n field.filename = parse.filename;\r\n ifBlock(type, function parseGroup_block(token) {\r\n switch (token) {\r\n\r\n case \"option\":\r\n parseOption(type, token);\r\n skip(\";\");\r\n break;\r\n\r\n case \"required\":\r\n case \"optional\":\r\n case \"repeated\":\r\n parseField(type, token);\r\n break;\r\n\r\n /* istanbul ignore next */\r\n default:\r\n throw illegal(token); // there are no groups with proto3 semantics\r\n }\r\n });\r\n parent.add(type)\r\n .add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n\r\n /* istanbul ignore if */\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, \"type\");\r\n\r\n skip(\",\");\r\n var valueType = next();\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, \"type\");\r\n\r\n skip(\">\");\r\n var name = next();\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"name\");\r\n\r\n skip(\"=\");\r\n var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\r\n ifBlock(field, function parseMapField_block(token) {\r\n\r\n /* istanbul ignore else */\r\n if (token === \"option\") {\r\n parseOption(field, token);\r\n skip(\";\");\r\n } else\r\n throw illegal(token);\r\n\r\n }, function parseMapField_line() {\r\n parseInlineOptions(field);\r\n });\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n var oneof = new OneOf(applyCase(token));\r\n ifBlock(oneof, function parseOneOf_block(token) {\r\n if (token === \"option\") {\r\n parseOption(oneof, token);\r\n skip(\";\");\r\n } else {\r\n push(token);\r\n parseField(oneof, \"optional\");\r\n }\r\n });\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n var enm = new Enum(token);\r\n ifBlock(enm, function parseEnum_block(token) {\r\n switch(token) {\r\n case \"option\":\r\n parseOption(enm, token);\r\n skip(\";\");\r\n break;\r\n\r\n case \"reserved\":\r\n readRanges(enm.reserved || (enm.reserved = []), true);\r\n break;\r\n\r\n default:\r\n parseEnumValue(enm, token);\r\n }\r\n });\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumValue(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"name\");\r\n\r\n skip(\"=\");\r\n var value = parseId(next(), true),\r\n dummy = {};\r\n ifBlock(dummy, function parseEnumValue_block(token) {\r\n\r\n /* istanbul ignore else */\r\n if (token === \"option\") {\r\n parseOption(dummy, token); // skip\r\n skip(\";\");\r\n } else\r\n throw illegal(token);\r\n\r\n }, function parseEnumValue_line() {\r\n parseInlineOptions(dummy); // skip\r\n });\r\n parent.add(token, value, dummy.comment);\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var isCustom = skip(\"(\", true);\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n var name = token;\r\n if (isCustom) {\r\n skip(\")\");\r\n name = \"(\" + name + \")\";\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(\"{\", true)) { // { a: \"foo\" b { c: \"bar\" } }\r\n do {\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n if (peek() === \"{\")\r\n parseOptionValue(parent, name + \".\" + token);\r\n else {\r\n skip(\":\");\r\n if (peek() === \"{\")\r\n parseOptionValue(parent, name + \".\" + token);\r\n else\r\n setOption(parent, name + \".\" + token, readValue(true));\r\n }\r\n skip(\",\", true);\r\n } while (!skip(\"}\", true));\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, \"option\");\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"service name\");\r\n\r\n var service = new Service(token);\r\n ifBlock(service, function parseService_block(token) {\r\n if (parseCommon(service, token))\r\n return;\r\n\r\n /* istanbul ignore else */\r\n if (token === \"rpc\")\r\n parseMethod(service, token);\r\n else\r\n throw illegal(token);\r\n });\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n var name = token,\r\n requestType, requestStream,\r\n responseType, responseStream;\r\n\r\n skip(\"(\");\r\n if (skip(\"stream\", true))\r\n requestStream = true;\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n\r\n requestType = token;\r\n skip(\")\"); skip(\"returns\"); skip(\"(\");\r\n if (skip(\"stream\", true))\r\n responseStream = true;\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n\r\n responseType = token;\r\n skip(\")\");\r\n\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n ifBlock(method, function parseMethod_block(token) {\r\n\r\n /* istanbul ignore else */\r\n if (token === \"option\") {\r\n parseOption(method, token);\r\n skip(\";\");\r\n } else\r\n throw illegal(token);\r\n\r\n });\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token, \"reference\");\r\n\r\n var reference = token;\r\n ifBlock(null, function parseExtension_block(token) {\r\n switch (token) {\r\n\r\n case \"required\":\r\n case \"repeated\":\r\n case \"optional\":\r\n parseField(parent, token, reference);\r\n break;\r\n\r\n default:\r\n /* istanbul ignore if */\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, \"optional\", reference);\r\n break;\r\n }\r\n });\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n switch (token) {\r\n\r\n case \"package\":\r\n\r\n /* istanbul ignore if */\r\n if (!head)\r\n throw illegal(token);\r\n\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n\r\n /* istanbul ignore if */\r\n if (!head)\r\n throw illegal(token);\r\n\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n\r\n /* istanbul ignore if */\r\n if (!head)\r\n throw illegal(token);\r\n\r\n parseSyntax();\r\n break;\r\n\r\n case \"option\":\r\n\r\n /* istanbul ignore if */\r\n if (!head)\r\n throw illegal(token);\r\n\r\n parseOption(ptr, token);\r\n skip(\";\");\r\n break;\r\n\r\n default:\r\n\r\n /* istanbul ignore else */\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n\r\n /* istanbul ignore next */\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n parse.filename = null;\r\n return {\r\n \"package\" : pkg,\r\n \"imports\" : imports,\r\n weakImports : weakImports,\r\n syntax : syntax,\r\n root : root\r\n };\r\n}\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @name parse\r\n * @function\r\n * @param {string} source Source contents\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {IParserResult} Parser result\r\n * @property {string} filename=null Currently processing file name for error reporting, if known\r\n * @property {IParseOptions} defaults Default {@link IParseOptions}\r\n * @variation 2\r\n */\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nvar util = require(39);\r\n\r\nvar BufferReader; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n utf8 = util.utf8;\r\n\r\n/* istanbul ignore next */\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n\r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\nvar create_array = typeof Uint8Array !== \"undefined\"\r\n ? function create_typed_array(buffer) {\r\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n }\r\n /* istanbul ignore next */\r\n : function create_array(buffer) {\r\n if (Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n };\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @function\r\n * @param {Uint8Array|Buffer} buffer Buffer to read from\r\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n * @throws {Error} If `buffer` is not a valid buffer\r\n */\r\nReader.create = util.Buffer\r\n ? function create_buffer_setup(buffer) {\r\n return (Reader.create = function create_buffer(buffer) {\r\n return util.Buffer.isBuffer(buffer)\r\n ? new BufferReader(buffer)\r\n /* istanbul ignore next */\r\n : create_array(buffer);\r\n })(buffer);\r\n }\r\n /* istanbul ignore next */\r\n : create_array;\r\n\r\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.uint32 = (function read_uint32_setup() {\r\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\r\n return function read_uint32() {\r\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n\r\n /* istanbul ignore if */\r\n if ((this.pos += 5) > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this, 10);\r\n }\r\n return value;\r\n };\r\n})();\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.int32 = function read_int32() {\r\n return this.uint32() | 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sint32 = function read_sint32() {\r\n var value = this.uint32();\r\n return value >>> 1 ^ -(value & 1) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n // tends to deopt with local vars for octet etc.\r\n var bits = new LongBits(0, 0);\r\n var i = 0;\r\n if (this.len - this.pos > 4) { // fast route (lo)\r\n for (; i < 4; ++i) {\r\n // 1st..4th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 5th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n i = 0;\r\n } else {\r\n for (; i < 3; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 1st..3th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 4th\r\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\r\n return bits;\r\n }\r\n if (this.len - this.pos > 4) { // fast route (hi)\r\n for (; i < 5; ++i) {\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n } else {\r\n for (; i < 5; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n }\r\n /* istanbul ignore next */\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReader.prototype.bool = function read_bool() {\r\n return this.uint32() !== 0;\r\n};\r\n\r\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\r\n return (buf[end - 4]\r\n | buf[end - 3] << 8\r\n | buf[end - 2] << 16\r\n | buf[end - 1] << 24) >>> 0;\r\n}\r\n\r\n/**\r\n * Reads fixed 32 bits as an unsigned 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.fixed32 = function read_fixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4);\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a signed 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sfixed32 = function read_sfixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readFixed64(/* this: Reader */) {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n\r\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.float = function read_float() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readFloatLE(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.double = function read_double() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readDoubleLE(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReader.prototype.bytes = function read_bytes() {\r\n var length = this.uint32(),\r\n start = this.pos,\r\n end = this.pos + length;\r\n\r\n /* istanbul ignore if */\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n\r\n this.pos += length;\r\n if (Array.isArray(this.buf)) // plain array\r\n return this.buf.slice(start, end);\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReader.prototype.string = function read_string() {\r\n var bytes = this.bytes();\r\n return utf8.read(bytes, 0, bytes.length);\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skip = function skip(length) {\r\n if (typeof length === \"number\") {\r\n /* istanbul ignore if */\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n } else {\r\n do {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n while ((wireType = this.uint32() & 7) !== 4) {\r\n this.skipType(wireType);\r\n }\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n\r\n /* istanbul ignore next */\r\n default:\r\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\r\n }\r\n return this;\r\n};\r\n\r\nReader._configure = function(BufferReader_) {\r\n BufferReader = BufferReader_;\r\n\r\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\r\n util.merge(Reader.prototype, {\r\n\r\n int64: function read_int64() {\r\n return readLongVarint.call(this)[fn](false);\r\n },\r\n\r\n uint64: function read_uint64() {\r\n return readLongVarint.call(this)[fn](true);\r\n },\r\n\r\n sint64: function read_sint64() {\r\n return readLongVarint.call(this).zzDecode()[fn](false);\r\n },\r\n\r\n fixed64: function read_fixed64() {\r\n return readFixed64.call(this)[fn](true);\r\n },\r\n\r\n sfixed64: function read_sfixed64() {\r\n return readFixed64.call(this)[fn](false);\r\n }\r\n\r\n });\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferReader;\r\n\r\n// extends Reader\r\nvar Reader = require(27);\r\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\r\n\r\nvar util = require(39);\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n Reader.call(this, buffer);\r\n\r\n /**\r\n * Read buffer.\r\n * @name BufferReader#buf\r\n * @type {Buffer}\r\n */\r\n}\r\n\r\n/* istanbul ignore else */\r\nif (util.Buffer)\r\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReader.prototype.string = function read_string_buffer() {\r\n var len = this.uint32(); // modifies pos\r\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @name BufferReader#bytes\r\n * @function\r\n * @returns {Buffer} Value read\r\n */\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\n// extends Namespace\r\nvar Namespace = require(23);\r\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\r\n\r\nvar Field = require(16),\r\n Enum = require(15),\r\n OneOf = require(25),\r\n util = require(37);\r\n\r\nvar Type, // cyclic\r\n parse, // might be excluded\r\n common; // \"\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {Object.} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files.\r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a namespace descriptor into a root namespace.\r\n * @param {INamespace} json Nameespace descriptor\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n if (json.options)\r\n root.setOptions(json.options);\r\n return root.addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\r\n */\r\nRoot.prototype.resolvePath = util.path.resolve;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\n/* istanbul ignore next */\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} options Parse options\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nRoot.prototype.load = function load(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = undefined;\r\n }\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename, options);\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n /* istanbul ignore if */\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n if (sync)\r\n throw err;\r\n cb(err, root);\r\n }\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n parse.filename = filename;\r\n var parsed = parse(source, self, options),\r\n resolved,\r\n i = 0;\r\n if (parsed.imports)\r\n for (; i < parsed.imports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\r\n fetch(resolved);\r\n if (parsed.weakImports)\r\n for (i = 0; i < parsed.weakImports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\r\n fetch(resolved, true);\r\n }\r\n } catch (err) {\r\n finish(err);\r\n }\r\n if (!sync && !queued)\r\n finish(null, self); // only once anyway\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.lastIndexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded / attempted\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n /* istanbul ignore if */\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n /* istanbul ignore else */\r\n if (!weak)\r\n finish(err);\r\n else if (!queued) // can't be covered reliably\r\n finish(null, self);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n for (var i = 0, resolved; i < filename.length; ++i)\r\n if (resolved = self.resolvePath(\"\", filename[i]))\r\n fetch(resolved);\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @function Root#load\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @function Root#load\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [options:IParseOptions]):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\r\n * @function Root#loadSync\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRoot.prototype.loadSync = function loadSync(filename, options) {\r\n if (!util.isNode)\r\n throw Error(\"not supported\");\r\n return this.load(filename, options, SYNC);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRoot.prototype.resolveAll = function resolveAll() {\r\n if (this.deferred.length)\r\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\r\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\r\n }).join(\", \"));\r\n return Namespace.prototype.resolveAll.call(this);\r\n};\r\n\r\n// only uppercased (and thus conflict-free) children are exposed, see below\r\nvar exposeRe = /^[A-Z]/;\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Root} root Root instance\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction tryHandleExtension(root, field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRoot.prototype._handleAdd = function _handleAdd(object) {\r\n if (object instanceof Field) {\r\n\r\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\r\n if (!tryHandleExtension(this, object))\r\n this.deferred.push(object);\r\n\r\n } else if (object instanceof Enum) {\r\n\r\n if (exposeRe.test(object.name))\r\n object.parent[object.name] = object.values; // expose enum values as property of its parent\r\n\r\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\r\n\r\n if (object instanceof Type) // Try to handle any deferred extensions\r\n for (var i = 0; i < this.deferred.length;)\r\n if (tryHandleExtension(this, this.deferred[i]))\r\n this.deferred.splice(i, 1);\r\n else\r\n ++i;\r\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\r\n this._handleAdd(object._nestedArray[j]);\r\n if (exposeRe.test(object.name))\r\n object.parent[object.name] = object; // expose namespace as property of its parent\r\n }\r\n\r\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\r\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\r\n // a static module with reflection-based solutions where the condition is met.\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRoot.prototype._handleRemove = function _handleRemove(object) {\r\n if (object instanceof Field) {\r\n\r\n if (/* an extension field */ object.extend !== undefined) {\r\n if (/* already handled */ object.extensionField) { // remove its sister field\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n } else { // cancel the extension\r\n var index = this.deferred.indexOf(object);\r\n /* istanbul ignore else */\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n }\r\n\r\n } else if (object instanceof Enum) {\r\n\r\n if (exposeRe.test(object.name))\r\n delete object.parent[object.name]; // unexpose enum values\r\n\r\n } else if (object instanceof Namespace) {\r\n\r\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\r\n this._handleRemove(object._nestedArray[i]);\r\n\r\n if (exposeRe.test(object.name))\r\n delete object.parent[object.name]; // unexpose namespaces\r\n\r\n }\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nRoot._configure = function(Type_, parse_, common_) {\r\n Type = Type_;\r\n parse = parse_;\r\n common = common_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = {};\r\n\r\n/**\r\n * Named roots.\r\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\r\n * Can also be used manually to make roots available accross modules.\r\n * @name roots\r\n * @type {Object.}\r\n * @example\r\n * // pbjs -r myroot -o compiled.js ...\r\n *\r\n * // in another module:\r\n * require(\"./compiled.js\");\r\n *\r\n * // in any subsequent module:\r\n * var root = protobuf.roots[\"myroot\"];\r\n */\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCImplCallback} callback Callback function\r\n * @returns {undefined}\r\n * @example\r\n * function rpcImpl(method, requestData, callback) {\r\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\r\n * throw Error(\"no such method\");\r\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\r\n * callback(err, responseData);\r\n * });\r\n * }\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCImplCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\nrpc.Service = require(32);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar util = require(39);\r\n\r\n// Extends EventEmitter\r\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\r\n\r\n/**\r\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\r\n *\r\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\r\n * @typedef rpc.ServiceMethodCallback\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {TRes} [response] Response message\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\r\n * @typedef rpc.ServiceMethod\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\r\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\r\n */\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @exports rpc.Service\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n */\r\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\r\n\r\n if (typeof rpcImpl !== \"function\")\r\n throw TypeError(\"rpcImpl must be a function\");\r\n\r\n util.EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` once the service is ended.\r\n * @type {RPCImpl|null}\r\n */\r\n this.rpcImpl = rpcImpl;\r\n\r\n /**\r\n * Whether requests are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.requestDelimited = Boolean(requestDelimited);\r\n\r\n /**\r\n * Whether responses are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.responseDelimited = Boolean(responseDelimited);\r\n}\r\n\r\n/**\r\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\r\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\r\n * @param {Constructor} requestCtor Request constructor\r\n * @param {Constructor} responseCtor Response constructor\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} callback Service callback\r\n * @returns {undefined}\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n */\r\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\r\n\r\n if (!request)\r\n throw TypeError(\"request must be specified\");\r\n\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\r\n\r\n if (!self.rpcImpl) {\r\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\r\n return undefined;\r\n }\r\n\r\n try {\r\n return self.rpcImpl(\r\n method,\r\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\r\n function rpcCallback(err, response) {\r\n\r\n if (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n\r\n if (response === null) {\r\n self.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n\r\n if (!(response instanceof responseCtor)) {\r\n try {\r\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n }\r\n\r\n self.emit(\"data\", response, method);\r\n return callback(null, response);\r\n }\r\n );\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n setTimeout(function() { callback(err); }, 0);\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nService.prototype.end = function end(endedByRPC) {\r\n if (this.rpcImpl) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.rpcImpl(null, null, null);\r\n this.rpcImpl = null;\r\n this.emit(\"end\").off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\n// extends Namespace\r\nvar Namespace = require(23);\r\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\r\n\r\nvar Method = require(22),\r\n util = require(37),\r\n rpc = require(31);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {Method[]|null}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\n/**\r\n * Service descriptor.\r\n * @interface IService\r\n * @extends INamespace\r\n * @property {Object.} methods Method descriptors\r\n */\r\n\r\n/**\r\n * Constructs a service from a service descriptor.\r\n * @param {string} name Service name\r\n * @param {IService} json Service descriptor\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n /* istanbul ignore else */\r\n if (json.methods)\r\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\r\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\r\n if (json.nested)\r\n service.addJSON(json.nested);\r\n service.comment = json.comment;\r\n return service;\r\n};\r\n\r\n/**\r\n * Converts this service to a service descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IService} Service descriptor\r\n */\r\nService.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , inherited && inherited.options || undefined,\r\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\r\n \"nested\" , inherited && inherited.nested || undefined,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\nObject.defineProperty(Service.prototype, \"methodsArray\", {\r\n get: function() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.get = function get(name) {\r\n return this.methods[name]\r\n || Namespace.prototype.get.call(this, name);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.resolveAll = function resolveAll() {\r\n var methods = this.methodsArray;\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return Namespace.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.add = function add(object) {\r\n\r\n /* istanbul ignore if */\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n\r\n /* istanbul ignore if */\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\r\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\r\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\r\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\r\n m: method,\r\n q: method.resolvedRequestType.ctor,\r\n s: method.resolvedResponseType.ctor\r\n });\r\n }\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\nvar setCommentRe = /^ *[*/]+ */,\r\n setCommentAltRe = /^\\s*\\*?\\/*/,\r\n setCommentSplitRe = /\\n/g,\r\n whitespaceRe = /\\s/,\r\n unescapeRe = /\\\\(.?)/g;\r\n\r\nvar unescapeMap = {\r\n \"0\": \"\\0\",\r\n \"r\": \"\\r\",\r\n \"n\": \"\\n\",\r\n \"t\": \"\\t\"\r\n};\r\n\r\n/**\r\n * Unescapes a string.\r\n * @param {string} str String to unescape\r\n * @returns {string} Unescaped string\r\n * @property {Object.} map Special characters map\r\n * @memberof tokenize\r\n */\r\nfunction unescape(str) {\r\n return str.replace(unescapeRe, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n default:\r\n return unescapeMap[$1] || \"\";\r\n }\r\n });\r\n}\r\n\r\ntokenize.unescape = unescape;\r\n\r\n/**\r\n * Gets the next token and advances.\r\n * @typedef TokenizerHandleNext\r\n * @type {function}\r\n * @returns {string|null} Next token or `null` on eof\r\n */\r\n\r\n/**\r\n * Peeks for the next token.\r\n * @typedef TokenizerHandlePeek\r\n * @type {function}\r\n * @returns {string|null} Next token or `null` on eof\r\n */\r\n\r\n/**\r\n * Pushes a token back to the stack.\r\n * @typedef TokenizerHandlePush\r\n * @type {function}\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Skips the next token.\r\n * @typedef TokenizerHandleSkip\r\n * @type {function}\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] If optional\r\n * @returns {boolean} Whether the token matched\r\n * @throws {Error} If the token didn't match and is not optional\r\n */\r\n\r\n/**\r\n * Gets the comment on the previous line or, alternatively, the line comment on the specified line.\r\n * @typedef TokenizerHandleCmnt\r\n * @type {function}\r\n * @param {number} [line] Line number\r\n * @returns {string|null} Comment text or `null` if none\r\n */\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @interface ITokenizerHandle\r\n * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof)\r\n * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof)\r\n * @property {TokenizerHandlePush} push Pushes a token back to the stack\r\n * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any\r\n * @property {number} line Current line number\r\n */\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode.\r\n * @returns {ITokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source, alternateCommentMode) {\r\n /* eslint-disable callback-return */\r\n source = source.toString();\r\n\r\n var offset = 0,\r\n length = source.length,\r\n line = 1,\r\n commentType = null,\r\n commentText = null,\r\n commentLine = 0,\r\n commentLineEmpty = false;\r\n\r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /* istanbul ignore next */\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === \"'\" ? stringSingleRe : stringDoubleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Sets the current comment text.\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function setComment(start, end) {\r\n commentType = source.charAt(start++);\r\n commentLine = line;\r\n commentLineEmpty = false;\r\n var lookback;\r\n if (alternateCommentMode) {\r\n lookback = 2; // alternate comment parsing: \"//\" or \"/*\"\r\n } else {\r\n lookback = 3; // \"///\" or \"/**\"\r\n }\r\n var commentOffset = start - lookback,\r\n c;\r\n do {\r\n if (--commentOffset < 0 ||\r\n (c = source.charAt(commentOffset)) === \"\\n\") {\r\n commentLineEmpty = true;\r\n break;\r\n }\r\n } while (c === \" \" || c === \"\\t\");\r\n var lines = source\r\n .substring(start, end)\r\n .split(setCommentSplitRe);\r\n for (var i = 0; i < lines.length; ++i)\r\n lines[i] = lines[i]\r\n .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, \"\")\r\n .trim();\r\n commentText = lines\r\n .join(\"\\n\")\r\n .trim();\r\n }\r\n\r\n function isDoubleSlashCommentLine(startOffset) {\r\n var endOffset = findEndOfLine(startOffset);\r\n\r\n // see if remaining line matches comment pattern\r\n var lineText = source.substring(startOffset, endOffset);\r\n // look for 1 or 2 slashes since startOffset would already point past\r\n // the first slash that started the comment.\r\n var isComment = /^\\s*\\/{1,2}/.test(lineText);\r\n return isComment;\r\n }\r\n\r\n function findEndOfLine(cursor) {\r\n // find end of cursor's line\r\n var endOffset = cursor;\r\n while (endOffset < length && charAt(endOffset) !== \"\\n\") {\r\n endOffset++;\r\n }\r\n return endOffset;\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {string|null} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr,\r\n start,\r\n isDoc;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (whitespaceRe.test(curr = charAt(offset))) {\r\n if (curr === \"\\n\")\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n\r\n if (charAt(offset) === \"/\") {\r\n if (++offset === length) {\r\n throw illegal(\"comment\");\r\n }\r\n if (charAt(offset) === \"/\") { // Line\r\n if (!alternateCommentMode) {\r\n // check for triple-slash comment\r\n isDoc = charAt(start = offset + 1) === \"/\";\r\n\r\n while (charAt(++offset) !== \"\\n\") {\r\n if (offset === length) {\r\n return null;\r\n }\r\n }\r\n ++offset;\r\n if (isDoc) {\r\n setComment(start, offset - 1);\r\n }\r\n ++line;\r\n repeat = true;\r\n } else {\r\n // check for double-slash comments, consolidating consecutive lines\r\n start = offset;\r\n isDoc = false;\r\n if (isDoubleSlashCommentLine(offset)) {\r\n isDoc = true;\r\n do {\r\n offset = findEndOfLine(offset);\r\n if (offset === length) {\r\n break;\r\n }\r\n offset++;\r\n } while (isDoubleSlashCommentLine(offset));\r\n } else {\r\n offset = Math.min(length, findEndOfLine(offset) + 1);\r\n }\r\n if (isDoc) {\r\n setComment(start, offset);\r\n }\r\n line++;\r\n repeat = true;\r\n }\r\n } else if ((curr = charAt(offset)) === \"*\") { /* Block */\r\n // check for /** (regular comment mode) or /* (alternate comment mode)\r\n start = offset + 1;\r\n isDoc = alternateCommentMode || charAt(start) === \"*\";\r\n do {\r\n if (curr === \"\\n\") {\r\n ++line;\r\n }\r\n if (++offset === length) {\r\n throw illegal(\"comment\");\r\n }\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== \"*\" || curr !== \"/\");\r\n ++offset;\r\n if (isDoc) {\r\n setComment(start, offset - 2);\r\n }\r\n repeat = true;\r\n } else {\r\n return \"/\";\r\n }\r\n }\r\n } while (repeat);\r\n\r\n // offset !== length if we got here\r\n\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === \"\\\"\" || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {string|null} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets a comment.\r\n * @param {number} [trailingLine] Line number if looking for a trailing comment\r\n * @returns {string|null} Comment text\r\n * @inner\r\n */\r\n function cmnt(trailingLine) {\r\n var ret = null;\r\n if (trailingLine === undefined) {\r\n if (commentLine === line - 1 && (alternateCommentMode || commentType === \"*\" || commentLineEmpty)) {\r\n ret = commentText;\r\n }\r\n } else {\r\n /* istanbul ignore else */\r\n if (commentLine < trailingLine) {\r\n peek();\r\n }\r\n if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === \"/\")) {\r\n ret = commentText;\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n return Object.defineProperty({\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip,\r\n cmnt: cmnt\r\n }, \"line\", {\r\n get: function() { return line; }\r\n });\r\n /* eslint-enable callback-return */\r\n}\r\n","\"use strict\";\r\nmodule.exports = Type;\r\n\r\n// extends Namespace\r\nvar Namespace = require(23);\r\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\r\n\r\nvar Enum = require(15),\r\n OneOf = require(25),\r\n Field = require(16),\r\n MapField = require(20),\r\n Service = require(33),\r\n Message = require(21),\r\n Reader = require(27),\r\n Writer = require(42),\r\n util = require(37),\r\n encoder = require(14),\r\n decoder = require(13),\r\n verifier = require(40),\r\n converter = require(12),\r\n wrappers = require(41);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object.} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {Array.}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /*?\r\n * Whether this type is a legacy group.\r\n * @type {boolean|undefined}\r\n */\r\n this.group = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {Object.|null}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {Field[]|null}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {OneOf[]|null}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {Constructor<{}>}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nObject.defineProperties(Type.prototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function() {\r\n\r\n /* istanbul ignore if */\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n\r\n this._fieldsById = {};\r\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n\r\n /* istanbul ignore if */\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\r\n * @name Type#ctor\r\n * @type {Constructor<{}>}\r\n */\r\n ctor: {\r\n get: function() {\r\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\r\n },\r\n set: function(ctor) {\r\n\r\n // Ensure proper prototype\r\n var prototype = ctor.prototype;\r\n if (!(prototype instanceof Message)) {\r\n (ctor.prototype = new Message()).constructor = ctor;\r\n util.merge(ctor.prototype, prototype);\r\n }\r\n\r\n // Classes and messages reference their reflected type\r\n ctor.$type = ctor.prototype.$type = this;\r\n\r\n // Mix in static methods\r\n util.merge(ctor, Message, true);\r\n\r\n this._ctor = ctor;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n var i = 0;\r\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\r\n this._fieldsArray[i].resolve(); // ensures a proper value\r\n\r\n // Messages have non-enumerable getters and setters for each virtual oneof field\r\n var ctorProperties = {};\r\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\r\n ctorProperties[this._oneofsArray[i].resolve().name] = {\r\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\r\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\r\n };\r\n if (i)\r\n Object.defineProperties(ctor.prototype, ctorProperties);\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Generates a constructor function for the specified type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nType.generateConstructor = function generateConstructor(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var gen = util.codegen([\"p\"], mtype.name);\r\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\r\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\r\n if ((field = mtype._fieldsArray[i]).map) gen\r\n (\"this%s={}\", util.safeProp(field.name));\r\n else if (field.repeated) gen\r\n (\"this%s=[]\", util.safeProp(field.name));\r\n return gen\r\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\r\n * @property {Object.} fields Field descriptors\r\n * @property {number[][]} [extensions] Extension ranges\r\n * @property {number[][]} [reserved] Reserved ranges\r\n * @property {boolean} [group=false] Whether a legacy group or not\r\n */\r\n\r\n/**\r\n * Creates a message type from a message type descriptor.\r\n * @param {string} name Message name\r\n * @param {IType} json Message type descriptor\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n var names = Object.keys(json.fields),\r\n i = 0;\r\n for (; i < names.length; ++i)\r\n type.add(\r\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\r\n ? MapField.fromJSON\r\n : Field.fromJSON )(names[i], json.fields[names[i]])\r\n );\r\n if (json.oneofs)\r\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\r\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\r\n if (json.nested)\r\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\r\n var nested = json.nested[names[i]];\r\n type.add( // most to least likely\r\n ( nested.id !== undefined\r\n ? Field.fromJSON\r\n : nested.fields !== undefined\r\n ? Type.fromJSON\r\n : nested.values !== undefined\r\n ? Enum.fromJSON\r\n : nested.methods !== undefined\r\n ? Service.fromJSON\r\n : Namespace.fromJSON )(names[i], nested)\r\n );\r\n }\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n if (json.group)\r\n type.group = true;\r\n if (json.comment)\r\n type.comment = json.comment;\r\n return type;\r\n};\r\n\r\n/**\r\n * Converts this message type to a message type descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IType} Message type descriptor\r\n */\r\nType.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , inherited && inherited.options || undefined,\r\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\r\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\r\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\r\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\r\n \"group\" , this.group || undefined,\r\n \"nested\" , inherited && inherited.nested || undefined,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nType.prototype.resolveAll = function resolveAll() {\r\n var fields = this.fieldsArray, i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.oneofsArray; i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return Namespace.prototype.resolveAll.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nType.prototype.get = function get(name) {\r\n return this.fields[name]\r\n || this.oneofs && this.oneofs[name]\r\n || this.nested && this.nested[name]\r\n || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nType.prototype.add = function add(object) {\r\n\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n\r\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\r\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (this.isReservedId(object.id))\r\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\r\n if (this.isReservedName(object.name))\r\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\r\n\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nType.prototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n\r\n /* istanbul ignore if */\r\n if (!this.fields || this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.fields[object.name];\r\n object.parent = null;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n\r\n /* istanbul ignore if */\r\n if (!this.oneofs || this.oneofs[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.oneofs[object.name];\r\n object.parent = null;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nType.prototype.isReservedId = function isReservedId(id) {\r\n return Namespace.isReservedId(this.reserved, id);\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nType.prototype.isReservedName = function isReservedName(name) {\r\n return Namespace.isReservedName(this.reserved, name);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object.} [properties] Properties to set\r\n * @returns {Message<{}>} Message instance\r\n */\r\nType.prototype.create = function create(properties) {\r\n return new this.ctor(properties);\r\n};\r\n\r\n/**\r\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\r\n * @returns {Type} `this`\r\n */\r\nType.prototype.setup = function setup() {\r\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\r\n // multiple times (V8, soft-deopt prototype-check).\r\n\r\n var fullName = this.fullName,\r\n types = [];\r\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\r\n types.push(this._fieldsArray[i].resolve().resolvedType);\r\n\r\n // Replace setup methods with type-specific generated functions\r\n this.encode = encoder(this)({\r\n Writer : Writer,\r\n types : types,\r\n util : util\r\n });\r\n this.decode = decoder(this)({\r\n Reader : Reader,\r\n types : types,\r\n util : util\r\n });\r\n this.verify = verifier(this)({\r\n types : types,\r\n util : util\r\n });\r\n this.fromObject = converter.fromObject(this)({\r\n types : types,\r\n util : util\r\n });\r\n this.toObject = converter.toObject(this)({\r\n types : types,\r\n util : util\r\n });\r\n\r\n // Inject custom wrappers for common types\r\n var wrapper = wrappers[fullName];\r\n if (wrapper) {\r\n var originalThis = Object.create(this);\r\n // if (wrapper.fromObject) {\r\n originalThis.fromObject = this.fromObject;\r\n this.fromObject = wrapper.fromObject.bind(originalThis);\r\n // }\r\n // if (wrapper.toObject) {\r\n originalThis.toObject = this.toObject;\r\n this.toObject = wrapper.toObject.bind(originalThis);\r\n // }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\r\n * @param {Message<{}>|Object.} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nType.prototype.encode = function encode_setup(message, writer) {\r\n return this.setup().encode(message, writer); // overrides this method\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\r\n * @param {Message<{}>|Object.} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message<{}>} Decoded message\r\n * @throws {Error} If the payload is not a reader or valid buffer\r\n * @throws {util.ProtocolError<{}>} If required fields are missing\r\n */\r\nType.prototype.decode = function decode_setup(reader, length) {\r\n return this.setup().decode(reader, length); // overrides this method\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\r\n * @returns {Message<{}>} Decoded message\r\n * @throws {Error} If the payload is not a reader or valid buffer\r\n * @throws {util.ProtocolError} If required fields are missing\r\n */\r\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\r\n if (!(reader instanceof Reader))\r\n reader = Reader.create(reader);\r\n return this.decode(reader, reader.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that field values are valid and that required fields are present.\r\n * @param {Object.} message Plain object to verify\r\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\r\n */\r\nType.prototype.verify = function verify_setup(message) {\r\n return this.setup().verify(message); // overrides this method\r\n};\r\n\r\n/**\r\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\r\n * @param {Object.} object Plain object to convert\r\n * @returns {Message<{}>} Message instance\r\n */\r\nType.prototype.fromObject = function fromObject(object) {\r\n return this.setup().fromObject(object);\r\n};\r\n\r\n/**\r\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\r\n * @interface IConversionOptions\r\n * @property {Function} [longs] Long conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\r\n * @property {Function} [enums] Enum value conversion type.\r\n * Only valid value is `String` (the global type).\r\n * Defaults to copy the present value, which is the numeric id.\r\n * @property {Function} [bytes] Bytes value conversion type.\r\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\r\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\r\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\r\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\r\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\r\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\r\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\r\n */\r\n\r\n/**\r\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\r\n * @param {Message<{}>} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n */\r\nType.prototype.toObject = function toObject(message, options) {\r\n return this.setup().toObject(message, options);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link Type.d} (TypeScript).\r\n * @typedef TypeDecorator\r\n * @type {function}\r\n * @param {Constructor} target Target constructor\r\n * @returns {undefined}\r\n * @template T extends Message\r\n */\r\n\r\n/**\r\n * Type decorator (TypeScript).\r\n * @param {string} [typeName] Type name, defaults to the constructor's name\r\n * @returns {TypeDecorator} Decorator function\r\n * @template T extends Message\r\n */\r\nType.d = function decorateType(typeName) {\r\n return function typeDecorator(target) {\r\n util.decorateType(target, typeName);\r\n };\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(37);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=1 Fixed64 wire type\r\n * @property {number} float=5 Fixed32 wire type\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n * @property {number} string=2 Ldelim wire type\r\n * @property {number} bytes=2 Ldelim wire type\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=0 Double default\r\n * @property {number} float=0 Float default\r\n * @property {number} int32=0 Int32 default\r\n * @property {number} uint32=0 Uint32 default\r\n * @property {number} sint32=0 Sint32 default\r\n * @property {number} fixed32=0 Fixed32 default\r\n * @property {number} sfixed32=0 Sfixed32 default\r\n * @property {number} int64=0 Int64 default\r\n * @property {number} uint64=0 Uint64 default\r\n * @property {number} sint64=0 Sint32 default\r\n * @property {number} fixed64=0 Fixed64 default\r\n * @property {number} sfixed64=0 Sfixed64 default\r\n * @property {boolean} bool=false Bool default\r\n * @property {string} string=\"\" String default\r\n * @property {Array.} bytes=Array(0) Bytes default\r\n * @property {null} message=null Message default\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray,\r\n /* message */ null\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n * @property {number} string=2 Ldelim wire type\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=1 Fixed64 wire type\r\n * @property {number} float=5 Fixed32 wire type\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = module.exports = require(39);\r\n\r\nvar roots = require(30);\r\n\r\nvar Type, // cyclic\r\n Enum;\r\n\r\nutil.codegen = require(3);\r\nutil.fetch = require(5);\r\nutil.path = require(8);\r\n\r\n/**\r\n * Node's fs module if available.\r\n * @type {Object.}\r\n */\r\nutil.fs = util.inquire(\"fs\");\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (object) {\r\n var keys = Object.keys(object),\r\n array = new Array(keys.length),\r\n index = 0;\r\n while (index < keys.length)\r\n array[index] = object[keys[index++]];\r\n return array;\r\n }\r\n return [];\r\n};\r\n\r\n/**\r\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\r\n * @param {Array.<*>} array Array to convert\r\n * @returns {Object.} Converted object\r\n */\r\nutil.toObject = function toObject(array) {\r\n var object = {},\r\n index = 0;\r\n while (index < array.length) {\r\n var key = array[index++],\r\n val = array[index++];\r\n if (val !== undefined)\r\n object[key] = val;\r\n }\r\n return object;\r\n};\r\n\r\nvar safePropBackslashRe = /\\\\/g,\r\n safePropQuoteRe = /\"/g;\r\n\r\n/**\r\n * Tests whether the specified name is a reserved word in JS.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nutil.isReserved = function isReserved(name) {\r\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified property name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\r\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\r\n return \".\" + prop;\r\n};\r\n\r\n/**\r\n * Converts the first character of a string to upper case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.ucFirst = function ucFirst(str) {\r\n return str.charAt(0).toUpperCase() + str.substring(1);\r\n};\r\n\r\nvar camelCaseRe = /_([a-z])/g;\r\n\r\n/**\r\n * Converts a string to camel case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0, 1)\r\n + str.substring(1)\r\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Compares reflected fields by id.\r\n * @param {Field} a First field\r\n * @param {Field} b Second field\r\n * @returns {number} Comparison value\r\n */\r\nutil.compareFieldsById = function compareFieldsById(a, b) {\r\n return a.id - b.id;\r\n};\r\n\r\n/**\r\n * Decorator helper for types (TypeScript).\r\n * @param {Constructor} ctor Constructor function\r\n * @param {string} [typeName] Type name, defaults to the constructor's name\r\n * @returns {Type} Reflected type\r\n * @template T extends Message\r\n * @property {Root} root Decorators root\r\n */\r\nutil.decorateType = function decorateType(ctor, typeName) {\r\n\r\n /* istanbul ignore if */\r\n if (ctor.$type) {\r\n if (typeName && ctor.$type.name !== typeName) {\r\n util.decorateRoot.remove(ctor.$type);\r\n ctor.$type.name = typeName;\r\n util.decorateRoot.add(ctor.$type);\r\n }\r\n return ctor.$type;\r\n }\r\n\r\n /* istanbul ignore next */\r\n if (!Type)\r\n Type = require(35);\r\n\r\n var type = new Type(typeName || ctor.name);\r\n util.decorateRoot.add(type);\r\n type.ctor = ctor; // sets up .encode, .decode etc.\r\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\r\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\r\n return type;\r\n};\r\n\r\nvar decorateEnumIndex = 0;\r\n\r\n/**\r\n * Decorator helper for enums (TypeScript).\r\n * @param {Object} object Enum object\r\n * @returns {Enum} Reflected enum\r\n */\r\nutil.decorateEnum = function decorateEnum(object) {\r\n\r\n /* istanbul ignore if */\r\n if (object.$type)\r\n return object.$type;\r\n\r\n /* istanbul ignore next */\r\n if (!Enum)\r\n Enum = require(15);\r\n\r\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\r\n util.decorateRoot.add(enm);\r\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\r\n return enm;\r\n};\r\n\r\n/**\r\n * Decorator root (TypeScript).\r\n * @name util.decorateRoot\r\n * @type {Root}\r\n * @readonly\r\n */\r\nObject.defineProperty(util, \"decorateRoot\", {\r\n get: function() {\r\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(29))());\r\n }\r\n});\r\n","\"use strict\";\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(39);\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low 32 bits, unsigned\r\n * @param {number} hi High 32 bits, unsigned\r\n */\r\nfunction LongBits(lo, hi) {\r\n\r\n // note that the casts below are theoretically unnecessary as of today, but older statically\r\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo >>> 0;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi >>> 0;\r\n}\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Zero hash.\r\n * @memberof util.LongBits\r\n * @type {string}\r\n */\r\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n if (sign)\r\n value = -value;\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n if (typeof value === \"number\")\r\n return LongBits.fromNumber(value);\r\n if (util.isString(value)) {\r\n /* istanbul ignore else */\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBits.prototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n var lo = ~this.lo + 1 >>> 0,\r\n hi = ~this.hi >>> 0;\r\n if (!lo)\r\n hi = hi + 1 >>> 0;\r\n return -(lo + hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBits.prototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\r\n /* istanbul ignore next */\r\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n if (hash === zeroHash)\r\n return zero;\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBits.prototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 ,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBits.prototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n return part2 === 0\r\n ? part1 === 0\r\n ? part0 < 16384\r\n ? part0 < 128 ? 1 : 2\r\n : part0 < 2097152 ? 3 : 4\r\n : part1 < 16384\r\n ? part1 < 128 ? 5 : 6\r\n : part1 < 2097152 ? 7 : 8\r\n : part2 < 128 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nvar util = exports;\r\n\r\n// used to return a Promise where callback is omitted\r\nutil.asPromise = require(1);\r\n\r\n// converts to / from base64 encoded strings\r\nutil.base64 = require(2);\r\n\r\n// base class of rpc.Service\r\nutil.EventEmitter = require(4);\r\n\r\n// float handling accross browsers\r\nutil.float = require(6);\r\n\r\n// requires modules optionally and hides the call from bundlers\r\nutil.inquire = require(7);\r\n\r\n// converts to / from utf8 encoded strings\r\nutil.utf8 = require(10);\r\n\r\n// provides a node-like buffer pool in the browser\r\nutil.pool = require(9);\r\n\r\n// utility to work with the low and high bits of a 64 bit value\r\nutil.LongBits = require(38);\r\n\r\n// global object reference\r\nutil.global = typeof window !== \"undefined\" && window\r\n || typeof global !== \"undefined\" && global\r\n || typeof self !== \"undefined\" && self\r\n || this; // eslint-disable-line no-invalid-this\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n * @const\r\n */\r\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n * @const\r\n */\r\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n * @const\r\n */\r\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\r\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === \"string\" || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return value && typeof value === \"object\";\r\n};\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * This is an alias of {@link util.isSet}.\r\n * @function\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isset =\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isSet = function isSet(obj, prop) {\r\n var value = obj[prop];\r\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\r\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\r\n return false;\r\n};\r\n\r\n/**\r\n * Any compatible Buffer instance.\r\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\r\n * @interface Buffer\r\n * @extends Uint8Array\r\n */\r\n\r\n/**\r\n * Node's Buffer class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Buffer = (function() {\r\n try {\r\n var Buffer = util.inquire(\"buffer\").Buffer;\r\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\r\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n return null;\r\n }\r\n})();\r\n\r\n// Internal alias of or polyfull for Buffer.from.\r\nutil._Buffer_from = null;\r\n\r\n// Internal alias of or polyfill for Buffer.allocUnsafe.\r\nutil._Buffer_allocUnsafe = null;\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\r\n * @returns {Uint8Array|Buffer} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(sizeOrArray) {\r\n /* istanbul ignore next */\r\n return typeof sizeOrArray === \"number\"\r\n ? util.Buffer\r\n ? util._Buffer_allocUnsafe(sizeOrArray)\r\n : new util.Array(sizeOrArray)\r\n : util.Buffer\r\n ? util._Buffer_from(sizeOrArray)\r\n : typeof Uint8Array === \"undefined\"\r\n ? sizeOrArray\r\n : new Uint8Array(sizeOrArray);\r\n};\r\n\r\n/**\r\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\r\n * @type {Constructor}\r\n */\r\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\r\n * @interface Long\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Long.js's Long class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\r\n || /* istanbul ignore next */ util.global.Long\r\n || util.inquire(\"long\");\r\n\r\n/**\r\n * Regular expression used to verify 2 bit (`bool`) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key2Re = /^true|false|0|1$/;\r\n\r\n/**\r\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\r\n\r\n/**\r\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? util.LongBits.from(value).toHash()\r\n : util.LongBits.zeroHash;\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = util.LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @memberof util\r\n * @param {Object.} dst Destination object\r\n * @param {Object.} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object.} Destination object\r\n */\r\nfunction merge(dst, src, ifNotSet) { // used by converters\r\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n return dst;\r\n}\r\n\r\nutil.merge = merge;\r\n\r\n/**\r\n * Converts the first character of a string to lower case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.lcFirst = function lcFirst(str) {\r\n return str.charAt(0).toLowerCase() + str.substring(1);\r\n};\r\n\r\n/**\r\n * Creates a custom error constructor.\r\n * @memberof util\r\n * @param {string} name Error name\r\n * @returns {Constructor} Custom error constructor\r\n */\r\nfunction newError(name) {\r\n\r\n function CustomError(message, properties) {\r\n\r\n if (!(this instanceof CustomError))\r\n return new CustomError(message, properties);\r\n\r\n // Error.call(this, message);\r\n // ^ just returns a new error instance because the ctor can be called as a function\r\n\r\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\r\n\r\n /* istanbul ignore next */\r\n if (Error.captureStackTrace) // node\r\n Error.captureStackTrace(this, CustomError);\r\n else\r\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\r\n\r\n if (properties)\r\n merge(this, properties);\r\n }\r\n\r\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\r\n\r\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\r\n\r\n CustomError.prototype.toString = function toString() {\r\n return this.name + \": \" + this.message;\r\n };\r\n\r\n return CustomError;\r\n}\r\n\r\nutil.newError = newError;\r\n\r\n/**\r\n * Constructs a new protocol error.\r\n * @classdesc Error subclass indicating a protocol specifc error.\r\n * @memberof util\r\n * @extends Error\r\n * @template T extends Message\r\n * @constructor\r\n * @param {string} message Error message\r\n * @param {Object.} [properties] Additional properties\r\n * @example\r\n * try {\r\n * MyMessage.decode(someBuffer); // throws if required fields are missing\r\n * } catch (e) {\r\n * if (e instanceof ProtocolError && e.instance)\r\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\r\n * }\r\n */\r\nutil.ProtocolError = newError(\"ProtocolError\");\r\n\r\n/**\r\n * So far decoded message instance.\r\n * @name util.ProtocolError#instance\r\n * @type {Message}\r\n */\r\n\r\n/**\r\n * A OneOf getter as returned by {@link util.oneOfGetter}.\r\n * @typedef OneOfGetter\r\n * @type {function}\r\n * @returns {string|undefined} Set field name, if any\r\n */\r\n\r\n/**\r\n * Builds a getter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfGetter} Unbound getter\r\n */\r\nutil.oneOfGetter = function getOneOf(fieldNames) {\r\n var fieldMap = {};\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n fieldMap[fieldNames[i]] = 1;\r\n\r\n /**\r\n * @returns {string|undefined} Set field name, if any\r\n * @this Object\r\n * @ignore\r\n */\r\n return function() { // eslint-disable-line consistent-return\r\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\r\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\r\n return keys[i];\r\n };\r\n};\r\n\r\n/**\r\n * A OneOf setter as returned by {@link util.oneOfSetter}.\r\n * @typedef OneOfSetter\r\n * @type {function}\r\n * @param {string|undefined} value Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Builds a setter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfSetter} Unbound setter\r\n */\r\nutil.oneOfSetter = function setOneOf(fieldNames) {\r\n\r\n /**\r\n * @param {string} name Field name\r\n * @returns {undefined}\r\n * @this Object\r\n * @ignore\r\n */\r\n return function(name) {\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n if (fieldNames[i] !== name)\r\n delete this[fieldNames[i]];\r\n };\r\n};\r\n\r\n/**\r\n * Default conversion options used for {@link Message#toJSON} implementations.\r\n *\r\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\r\n *\r\n * - Longs become strings\r\n * - Enums become string keys\r\n * - Bytes become base64 encoded strings\r\n * - (Sub-)Messages become plain objects\r\n * - Maps become plain objects with all string keys\r\n * - Repeated fields become arrays\r\n * - NaN and Infinity for float and double fields become strings\r\n *\r\n * @type {IConversionOptions}\r\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\r\n */\r\nutil.toJSONOptions = {\r\n longs: String,\r\n enums: String,\r\n bytes: String,\r\n json: true\r\n};\r\n\r\n// Sets up buffer utility according to the environment (called in index-minimal)\r\nutil._configure = function() {\r\n var Buffer = util.Buffer;\r\n /* istanbul ignore if */\r\n if (!Buffer) {\r\n util._Buffer_from = util._Buffer_allocUnsafe = null;\r\n return;\r\n }\r\n // because node 4.x buffers are incompatible & immutable\r\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\r\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\r\n /* istanbul ignore next */\r\n function Buffer_from(value, encoding) {\r\n return new Buffer(value, encoding);\r\n };\r\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\r\n /* istanbul ignore next */\r\n function Buffer_allocUnsafe(size) {\r\n return new Buffer(size);\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = verifier;\r\n\r\nvar Enum = require(15),\r\n util = require(37);\r\n\r\nfunction invalid(field, expected) {\r\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\r\n}\r\n\r\n/**\r\n * Generates a partial value verifier.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {number} fieldIndex Field index\r\n * @param {string} ref Variable reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n if (field.resolvedType) {\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(%s){\", ref)\r\n (\"default:\")\r\n (\"return%j\", invalid(field, \"enum value\"));\r\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\r\n (\"case %i:\", field.resolvedType.values[keys[j]]);\r\n gen\r\n (\"break\")\r\n (\"}\");\r\n } else {\r\n gen\r\n (\"{\")\r\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\r\n (\"if(e)\")\r\n (\"return%j+e\", field.name + \".\")\r\n (\"}\");\r\n }\r\n } else {\r\n switch (field.type) {\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.isInteger(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\r\n (\"return%j\", invalid(field, \"integer|Long\"));\r\n break;\r\n case \"float\":\r\n case \"double\": gen\r\n (\"if(typeof %s!==\\\"number\\\")\", ref)\r\n (\"return%j\", invalid(field, \"number\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\r\n (\"return%j\", invalid(field, \"boolean\"));\r\n break;\r\n case \"string\": gen\r\n (\"if(!util.isString(%s))\", ref)\r\n (\"return%j\", invalid(field, \"string\"));\r\n break;\r\n case \"bytes\": gen\r\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\r\n (\"return%j\", invalid(field, \"buffer\"));\r\n break;\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a partial key verifier.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {string} ref Variable reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genVerifyKey(gen, field, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n switch (field.keyType) {\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.key32Re.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer key\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\r\n (\"return%j\", invalid(field, \"integer|Long key\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(!util.key2Re.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"boolean key\"));\r\n break;\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a verifier specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nfunction verifier(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n\r\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\r\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\r\n (\"return%j\", \"object expected\");\r\n var oneofs = mtype.oneofsArray,\r\n seenFirstField = {};\r\n if (oneofs.length) gen\r\n (\"var p={}\");\r\n\r\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\r\n var field = mtype._fieldsArray[i].resolve(),\r\n ref = \"m\" + util.safeProp(field.name);\r\n\r\n if (field.optional) gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\r\n\r\n // map fields\r\n if (field.map) { gen\r\n (\"if(!util.isObject(%s))\", ref)\r\n (\"return%j\", invalid(field, \"object\"))\r\n (\"var k=Object.keys(%s)\", ref)\r\n (\"for(var i=0;i}\r\n * @const\r\n */\r\nvar wrappers = exports;\r\n\r\nvar Message = require(21);\r\n\r\n/**\r\n * From object converter part of an {@link IWrapper}.\r\n * @typedef WrapperFromObjectConverter\r\n * @type {function}\r\n * @param {Object.} object Plain object\r\n * @returns {Message<{}>} Message instance\r\n * @this Type\r\n */\r\n\r\n/**\r\n * To object converter part of an {@link IWrapper}.\r\n * @typedef WrapperToObjectConverter\r\n * @type {function}\r\n * @param {Message<{}>} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n * @this Type\r\n */\r\n\r\n/**\r\n * Common type wrapper part of {@link wrappers}.\r\n * @interface IWrapper\r\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\r\n * @property {WrapperToObjectConverter} [toObject] To object converter\r\n */\r\n\r\n// Custom wrapper for Any\r\nwrappers[\".google.protobuf.Any\"] = {\r\n\r\n fromObject: function(object) {\r\n\r\n // unwrap value type if mapped\r\n if (object && object[\"@type\"]) {\r\n var type = this.lookup(object[\"@type\"]);\r\n /* istanbul ignore else */\r\n if (type) {\r\n // type_url does not accept leading \".\"\r\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\r\n object[\"@type\"].substr(1) : object[\"@type\"];\r\n // type_url prefix is optional, but path seperator is required\r\n return this.create({\r\n type_url: \"/\" + type_url,\r\n value: type.encode(type.fromObject(object)).finish()\r\n });\r\n }\r\n }\r\n\r\n return this.fromObject(object);\r\n },\r\n\r\n toObject: function(message, options) {\r\n\r\n // decode value if requested and unmapped\r\n if (options && options.json && message.type_url && message.value) {\r\n // Only use fully qualified type name after the last '/'\r\n var name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\r\n var type = this.lookup(name);\r\n /* istanbul ignore else */\r\n if (type)\r\n message = type.decode(message.value);\r\n }\r\n\r\n // wrap value if unmapped\r\n if (!(message instanceof this.ctor) && message instanceof Message) {\r\n var object = message.$type.toObject(message, options);\r\n object[\"@type\"] = message.$type.fullName;\r\n return object;\r\n }\r\n\r\n return this.toObject(message, options);\r\n }\r\n};\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nvar util = require(39);\r\n\r\nvar BufferWriter; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n base64 = util.base64,\r\n utf8 = util.utf8;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @constructor\r\n * @param {function(*, Uint8Array, number)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {*} val Value to write\r\n * @ignore\r\n */\r\nfunction Op(fn, len, val) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {Writer.Op|undefined}\r\n */\r\n this.next = undefined;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val; // type varies\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @ignore\r\n */\r\nfunction State(writer) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {State|null}\r\n */\r\n this.next = writer.states;\r\n}\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {Object|null}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @function\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = util.Buffer\r\n ? function create_buffer_setup() {\r\n return (Writer.create = function create_buffer() {\r\n return new BufferWriter();\r\n })();\r\n }\r\n /* istanbul ignore next */\r\n : function create_array() {\r\n return new Writer();\r\n };\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new util.Array(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\n/* istanbul ignore else */\r\nif (util.Array !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n * @private\r\n */\r\nWriter.prototype._push = function push(fn, len, val) {\r\n this.tail = this.tail.next = new Op(fn, len, val);\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(val, buf, pos) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\nfunction writeVarint32(val, buf, pos) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Constructs a new varint writer operation instance.\r\n * @classdesc Scheduled varint writer operation.\r\n * @extends Op\r\n * @constructor\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @ignore\r\n */\r\nfunction VarintOp(len, val) {\r\n this.len = len;\r\n this.next = undefined;\r\n this.val = val;\r\n}\r\n\r\nVarintOp.prototype = Object.create(Op.prototype);\r\nVarintOp.prototype.fn = writeVarint32;\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.uint32 = function write_uint32(value) {\r\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\r\n // uint32 is by far the most frequently used operation and benefits significantly from this.\r\n this.len += (this.tail = this.tail.next = new VarintOp(\r\n (value = value >>> 0)\r\n < 128 ? 1\r\n : value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5,\r\n value)).len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sint32 = function write_sint32(value) {\r\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\r\n};\r\n\r\nfunction writeVarint64(val, buf, pos) {\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.int64 = Writer.prototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bool = function write_bool(value) {\r\n return this._push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fixed32 = function write_fixed32(value) {\r\n return this._push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as fixed 32 bits.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as fixed 64 bits.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.float = function write_float(value) {\r\n return this._push(util.float.writeFloatLE, 4, value);\r\n};\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.double = function write_double(value) {\r\n return this._push(util.float.writeDoubleLE, 8, value);\r\n};\r\n\r\nvar writeBytes = util.Array.prototype.set\r\n ? function writeBytes_set(val, buf, pos) {\r\n buf.set(val, pos); // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytes_for(val, buf, pos) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (!len)\r\n return this._push(writeByte, 1, 0);\r\n if (util.isString(value)) {\r\n var buf = Writer.alloc(len = base64.length(value));\r\n base64.decode(value, buf, 0);\r\n value = buf;\r\n }\r\n return this.uint32(len)._push(writeBytes, len, value);\r\n};\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.string = function write_string(value) {\r\n var len = utf8.length(value);\r\n return len\r\n ? this.uint32(len)._push(utf8.write, len, value)\r\n : this._push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fork = function fork() {\r\n this.states = new State(this);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.ldelim = function ldelim() {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset().uint32(len);\r\n if (len) {\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriter.prototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len),\r\n pos = 0;\r\n while (head) {\r\n head.fn(head.val, buf, pos);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n // this.head = this.tail = null;\r\n return buf;\r\n};\r\n\r\nWriter._configure = function(BufferWriter_) {\r\n BufferWriter = BufferWriter_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferWriter;\r\n\r\n// extends Writer\r\nvar Writer = require(42);\r\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\r\n\r\nvar util = require(39);\r\n\r\nvar Buffer = util.Buffer;\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Buffer} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\r\n};\r\n\r\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\r\n ? function writeBytesBuffer_set(val, buf, pos) {\r\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\r\n // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytesBuffer_copy(val, buf, pos) {\r\n if (val.copy) // Buffer values\r\n val.copy(buf, pos, 0, val.length);\r\n else for (var i = 0; i < val.length;) // plain array values\r\n buf[pos++] = val[i++];\r\n };\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\r\n if (util.isString(value))\r\n value = util._Buffer_from(value, \"base64\");\r\n var len = value.length >>> 0;\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeBytesBuffer, len, value);\r\n return this;\r\n};\r\n\r\nfunction writeStringBuffer(val, buf, pos) {\r\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\r\n util.utf8.write(val, buf, pos);\r\n else\r\n buf.utf8Write(val, pos);\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.string = function write_string_buffer(value) {\r\n var len = Buffer.byteLength(value);\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeStringBuffer, len, value);\r\n return this;\r\n};\r\n\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @name BufferWriter#finish\r\n * @function\r\n * @returns {Buffer} Finished buffer\r\n */\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/node_modules/protobufjs/dist/protobuf.min.js b/node_modules/protobufjs/dist/protobuf.min.js new file mode 100644 index 0000000..9be32b6 --- /dev/null +++ b/node_modules/protobufjs/dist/protobuf.min.js @@ -0,0 +1,8 @@ +/*! + * protobuf.js v6.8.8 (c) 2016, daniel wirtz + * compiled thu, 19 jul 2018 00:33:26 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +!function(tt){"use strict";var r,e,t,i;r={1:[function(t,i){i.exports=function(t,i){var n=Array(arguments.length-1),s=0,r=2,u=!0;for(;r>2],r=(3&f)<<4,o=1;break;case 1:s[u++]=h[r|f>>4],r=(15&f)<<2,o=2;break;case 2:s[u++]=h[r|f>>6],s[u++]=h[63&f],o=0}8191>4,r=o,s=2;break;case 2:i[n++]=(15&r)<<4|(60&o)>>2,r=o,s=3;break;case 3:i[n++]=(3&r)<<6|o,s=0}}if(1===s)throw Error(a);return n-e},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,i){function c(i,n){"string"==typeof i&&(n=i,i=tt);var f=[];function h(t){if("string"!=typeof t){var i=a();if(c.verbose&&console.log("codegen: "+i),i="return "+i,t){for(var n=Object.keys(t),r=Array(n.length+1),e=Array(n.length),s=0;s>>0,n,r);else if(i<11754943508222875e-54)t((e<<31|Math.round(i/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(i)/Math.LN2);t((e<<31|s+127<<23|8388607&Math.round(i*Math.pow(2,-s)*8388608))>>>0,n,r)}}function i(t,i,n){var r=t(i,n),e=2*(r>>31)+1,s=r>>>23&255,u=8388607&r;return 255===s?u?NaN:e*(1/0):0===s?1401298464324817e-60*e*u:e*Math.pow(2,s-150)*(u+8388608)}o.writeFloatLE=t.bind(null,r),o.writeFloatBE=t.bind(null,e),o.readFloatLE=i.bind(null,s),o.readFloatBE=i.bind(null,u)}(),"undefined"!=typeof Float64Array?function(){var r=new Float64Array([-0]),e=new Uint8Array(r.buffer),t=128===e[7];function i(t,i,n){r[0]=t,i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2],i[n+3]=e[3],i[n+4]=e[4],i[n+5]=e[5],i[n+6]=e[6],i[n+7]=e[7]}function n(t,i,n){r[0]=t,i[n]=e[7],i[n+1]=e[6],i[n+2]=e[5],i[n+3]=e[4],i[n+4]=e[3],i[n+5]=e[2],i[n+6]=e[1],i[n+7]=e[0]}function s(t,i){return e[0]=t[i],e[1]=t[i+1],e[2]=t[i+2],e[3]=t[i+3],e[4]=t[i+4],e[5]=t[i+5],e[6]=t[i+6],e[7]=t[i+7],r[0]}function u(t,i){return e[7]=t[i],e[6]=t[i+1],e[5]=t[i+2],e[4]=t[i+3],e[3]=t[i+4],e[2]=t[i+5],e[1]=t[i+6],e[0]=t[i+7],r[0]}o.writeDoubleLE=t?i:n,o.writeDoubleBE=t?n:i,o.readDoubleLE=t?s:u,o.readDoubleBE=t?u:s}():function(){function t(t,i,n,r,e,s){var u=r<0?1:0;if(u&&(r=-r),0===r)t(0,e,s+i),t(0<1/r?0:2147483648,e,s+n);else if(isNaN(r))t(0,e,s+i),t(2146959360,e,s+n);else if(17976931348623157e292>>0,e,s+n);else{var o;if(r<22250738585072014e-324)t((o=r/5e-324)>>>0,e,s+i),t((u<<31|o/4294967296)>>>0,e,s+n);else{var f=Math.floor(Math.log(r)/Math.LN2);1024===f&&(f=1023),t(4503599627370496*(o=r*Math.pow(2,-f))>>>0,e,s+i),t((u<<31|f+1023<<20|1048576*o&1048575)>>>0,e,s+n)}}}function i(t,i,n,r,e){var s=t(r,e+i),u=t(r,e+n),o=2*(u>>31)+1,f=u>>>20&2047,h=4294967296*(1048575&u)+s;return 2047===f?h?NaN:o*(1/0):0===f?5e-324*o*h:o*Math.pow(2,f-1075)*(h+4503599627370496)}o.writeDoubleLE=t.bind(null,r,0,4),o.writeDoubleBE=t.bind(null,e,4,0),o.readDoubleLE=i.bind(null,s,0,4),o.readDoubleBE=i.bind(null,u,4,0)}(),o}function r(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}function e(t,i,n){i[n]=t>>>24,i[n+1]=t>>>16&255,i[n+2]=t>>>8&255,i[n+3]=255&t}function s(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}function u(t,i){return(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0}i.exports=n(n)},{}],7:[function(t,i,n){function r(t){try{var i=eval("require")(t);if(i&&(i.length||Object.keys(i).length))return i}catch(t){}return null}i.exports=r},{}],8:[function(t,i,n){var r=n,s=r.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},e=r.normalize=function(t){var i=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=s(t),r="";n&&(r=i.shift()+"/");for(var e=0;e>>1,u=null,o=e;return function(t){if(t<1||s>10),s[u++]=56320+(1023&r)):s[u++]=(15&r)<<12|(63&t[i++])<<6|63&t[i++],8191>6|192:(55296==(64512&r)&&56320==(64512&(e=t.charCodeAt(u+1)))?(r=65536+((1023&r)<<10)+(1023&e),++u,i[n++]=r>>18|240,i[n++]=r>>12&63|128):i[n++]=r>>12|224,i[n++]=r>>6&63|128),i[n++]=63&r|128);return n-s}},{}],11:[function(t,i){i.exports=e;var n,r=/\/|\./;function e(t,i){r.test(t)||(t="google/protobuf/"+t+".proto",i={nested:{google:{nested:{protobuf:{nested:i}}}}}),e[t]=i}e("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),e("duration",{Duration:n={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),e("timestamp",{Timestamp:n}),e("empty",{Empty:{fields:{}}}),e("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),e("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),e("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),e.get=function(t){return e[t]||null}},{}],12:[function(t,i,n){var r=n,l=t(15),v=t(37);function u(t,i,n,r){if(i.resolvedType)if(i.resolvedType instanceof l){t("switch(d%s){",r);for(var e=i.resolvedType.values,s=Object.keys(e),u=0;u>>0",r,r);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",r,r);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,o)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,o?"true":"");break;case"bytes":t('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length)",r)("m%s=d%s",r,r);break;case"string":t("m%s=String(d%s)",r,r);break;case"bool":t("m%s=Boolean(d%s)",r,r)}}return t}function d(t,i,n,r){if(i.resolvedType)i.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",r,n,r,r):t("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var e=!1;switch(i.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":e=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,e?"true":"",r);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:t("d%s=m%s",r,r)}}return t}r.fromObject=function(t){var i=t.fieldsArray,n=v.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!i.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r>>3){");for(var n=0;n>>0,8|a.mapKey[s.keyType],s.keyType),f===tt?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,i):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,o,i),n("}")("}")):s.repeated?(n("if(%s!=null&&%s.length){",i,i),s.packed&&a.packed[o]!==tt?n("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",o,i)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",i),f===tt?l(n,s,u,i+"[i]"):n("w.uint32(%i).%s(%s[i])",(s.id<<3|f)>>>0,o,i)),n("}")):(s.optional&&n("if(%s!=null&&m.hasOwnProperty(%j))",i,s.name),f===tt?l(n,s,u,i):n("w.uint32(%i).%s(%s)",(s.id<<3|f)>>>0,o,i))}return n("return w")};var h=t(15),a=t(36),c=t(37);function l(t,i,n,r){return i.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(i.id<<3|2)>>>0)}},{15:15,36:36,37:37}],15:[function(t,i){i.exports=e;var o=t(24);((e.prototype=Object.create(o.prototype)).constructor=e).className="Enum";var n=t(23),r=t(37);function e(t,i,n,r,e){if(o.call(this,t,n),i&&"object"!=typeof i)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=e||{},this.reserved=tt,i)for(var s=Object.keys(i),u=0;u=i)return!0;return!1},h.isReservedName=function(t,i){if(t)for(var n=0;n");var r=h();if(!G.test(r))throw b(r,"name");l("=");var e=new U(y(r),k(h()),i,n);S(e,function(t){if("option"!==t)throw b(t);N(e,t),l(";")},function(){$(e)}),t.add(e)}(n);break;case"required":case"optional":case"repeated":T(n,t);break;case"oneof":!function(t,i){if(!G.test(i=h()))throw b(i,"name");var n=new _(y(i));S(n,function(t){"option"===t?(N(n,t),l(";")):(a(t),T(n,"optional"))}),t.add(n)}(n,t);break;case"extensions":j(n.extensions||(n.extensions=[]));break;case"reserved":j(n.reserved||(n.reserved=[]),!0);break;default:if(!p||!K.test(t))throw b(t);a(t),T(n,"optional")}}),t.add(n)}(t,i),!0;case"enum":return function(t,i){if(!G.test(i=h()))throw b(i,"name");var n=new q(i);S(n,function(t){switch(t){case"option":N(n,t),l(";");break;case"reserved":j(n.reserved||(n.reserved=[]),!0);break;default:!function(t,i){if(!G.test(i))throw b(i,"name");l("=");var n=k(h(),!0),r={};S(r,function(t){if("option"!==t)throw b(t);N(r,t),l(";")},function(){$(r)}),t.add(i,n,r.comment)}(n,t)}}),t.add(n)}(t,i),!0;case"service":return function(t,i){if(!G.test(i=h()))throw b(i,"service name");var n=new R(i);S(n,function(t){if(!x(n,t)){if("rpc"!==t)throw b(t);!function(t,i){var n=i;if(!G.test(i=h()))throw b(i,"name");var r,e,s,u,o=i;l("("),l("stream",!0)&&(e=!0);if(!K.test(i=h()))throw b(i);r=i,l(")"),l("returns"),l("("),l("stream",!0)&&(u=!0);if(!K.test(i=h()))throw b(i);s=i,l(")");var f=new z(o,n,r,s,e,u);S(f,function(t){if("option"!==t)throw b(t);N(f,t),l(";")}),t.add(f)}(n,t)}}),t.add(n)}(t,i),!0;case"extend":return function(i,t){if(!K.test(t=h()))throw b(t,"reference");var n=t;S(null,function(t){switch(t){case"required":case"repeated":case"optional":T(i,t,n);break;default:if(!p||!K.test(t))throw b(t);a(t),T(i,"optional",n)}})}(t,i),!0}return!1}function S(t,i,n){var r=f.line;if(t&&(t.comment=v(),t.filename=Y.filename),l("{",!0)){for(var e;"}"!==(e=h());)i(e);l(";",!0)}else n&&n(),l(";"),t&&"string"!=typeof t.comment&&(t.comment=v(r))}function T(t,i,n){var r=h();if("group"!==r){if(!K.test(r))throw b(r,"type");var e=h();if(!G.test(e))throw b(e,"name");e=y(e),l("=");var s=new L(e,k(h()),r,i,n);S(s,function(t){if("option"!==t)throw b(t);N(s,t),l(";")},function(){$(s)}),t.add(s),p||!s.repeated||Z.packed[r]===tt&&Z.basic[r]!==tt||s.setOption("packed",!1,!0)}else!function(t,i){var n=h();if(!G.test(n))throw b(n,"name");var r=B.lcFirst(n);n===r&&(n=B.ucFirst(n));l("=");var e=k(h()),s=new F(n);s.group=!0;var u=new L(r,e,n,i);u.filename=Y.filename,S(s,function(t){switch(t){case"option":N(s,t),l(";");break;case"required":case"optional":case"repeated":T(s,t);break;default:throw b(t)}}),t.add(s).add(u)}(t,i)}function N(t,i){var n=l("(",!0);if(!K.test(i=h()))throw b(i,"name");var r=i;n&&(l(")"),r="("+r+")",i=c(),Q.test(i)&&(r+=i,h())),l("="),function t(i,n){if(l("{",!0))do{if(!G.test(o=h()))throw b(o,"name");"{"===c()?t(i,n+"."+o):(l(":"),"{"===c()?t(i,n+"."+o):V(i,n+"."+o,g(!0))),l(",",!0)}while(!l("}",!0));else V(i,n,g(!0))}(t,r)}function V(t,i,n){t.setOption&&t.setOption(i,n)}function $(t){if(l("[",!0)){for(;N(t,"option"),l(",",!0););l("]")}return t}for(;null!==(o=h());)switch(o){case"package":if(!d)throw b(o);E();break;case"import":if(!d)throw b(o);O();break;case"syntax":if(!d)throw b(o);A();break;case"option":if(!d)throw b(o);N(w,o),l(";");break;default:if(x(w,o)){d=!1;continue}throw b(o)}return Y.filename=null,{package:r,imports:e,weakImports:s,syntax:u,root:i}}},{15:15,16:16,20:20,22:22,25:25,29:29,33:33,34:34,35:35,36:36,37:37}],27:[function(t,i){i.exports=o;var n,r=t(39),e=r.LongBits,s=r.utf8;function u(t,i){return RangeError("index out of range: "+t.pos+" + "+(i||1)+" > "+t.len)}function o(t){this.buf=t,this.pos=0,this.len=t.length}var f,h="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new o(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new o(t);throw Error("illegal buffer")};function a(){var t=new e(0,0),i=0;if(!(4=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,4>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function c(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function l(){if(this.pos+8>this.len)throw u(this,8);return new e(c(this.buf,this.pos+=4),c(this.buf,this.pos+=4))}o.create=r.Buffer?function(t){return(o.create=function(t){return r.Buffer.isBuffer(t)?new n(t):h(t)})(t)}:h,o.prototype.c=r.Array.prototype.subarray||r.Array.prototype.slice,o.prototype.uint32=(f=4294967295,function(){if(f=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return f;if((this.pos+=5)>this.len)throw this.pos=this.len,u(this,10);return f}),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return c(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|c(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},o.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},o.prototype.bytes=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,n):i===n?new this.buf.constructor(0):this.c.call(this.buf,i,n)},o.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},o.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw u(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},o.o=function(t){n=t;var i=r.Long?"toLong":"toNumber";r.merge(o.prototype,{int64:function(){return a.call(this)[i](!1)},uint64:function(){return a.call(this)[i](!0)},sint64:function(){return a.call(this).zzDecode()[i](!1)},fixed64:function(){return l.call(this)[i](!0)},sfixed64:function(){return l.call(this)[i](!1)}})}},{39:39}],28:[function(t,i){i.exports=e;var n=t(27);(e.prototype=Object.create(n.prototype)).constructor=e;var r=t(39);function e(t){n.call(this,t)}r.Buffer&&(e.prototype.c=r.Buffer.prototype.slice),e.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len))}},{27:27,39:39}],29:[function(t,i){i.exports=n;var r=t(23);((n.prototype=Object.create(r.prototype)).constructor=n).className="Root";var e,v,d,s=t(16),u=t(15),o=t(25),p=t(37);function n(t){r.call(this,"",t),this.deferred=[],this.files=[]}function w(){}n.fromJSON=function(t,i){return i||(i=new n),t.options&&i.setOptions(t.options),i.addJSON(t.nested)},n.prototype.resolvePath=p.path.resolve,n.prototype.load=function t(i,s,u){"function"==typeof s&&(u=s,s=tt);var o=this;if(!u)return p.asPromise(t,o,i,s);var f=u===w;function h(t,i){if(u){var n=u;if(u=null,f)throw t;n(t,i)}}function a(t,i){try{if(p.isString(i)&&"{"===i.charAt(0)&&(i=JSON.parse(i)),p.isString(i)){v.filename=t;var n,r=v(i,o,s),e=0;if(r.imports)for(;e]/g,O=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,A=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,x=/^ *[*/]+ */,S=/^\s*\*?\/*/,T=/\n/g,N=/\s/,n=/\\(.?)/g,r={0:"\0",r:"\r",n:"\n",t:"\t"};function V(t){return t.replace(n,function(t,i){switch(i){case"\\":case"":return i;default:return r[i]||""}})}function e(o,f){o=o.toString();var h=0,a=o.length,c=1,u=null,l=null,v=0,d=!1,p=[],w=null;function y(t){return Error("illegal "+t+" (line "+c+")")}function b(t){return o.charAt(t)}function m(t,i){u=o.charAt(t++),v=c,d=!1;var n,r=t-(f?2:3);do{if(--r<0||"\n"===(n=o.charAt(r))){d=!0;break}}while(" "===n||"\t"===n);for(var e=o.substring(t,i).split(T),s=0;s>>0,this.hi=i>>>0}var s=e.zero=new e(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var r=e.zeroHash="\0\0\0\0\0\0\0\0";e.fromNumber=function(t){if(0===t)return s;var i=t<0;i&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return i&&(r=~r>>>0,n=~n>>>0,4294967295<++n&&(n=0,4294967295<++r&&(r=0))),new e(n,r)},e.from=function(t){if("number"==typeof t)return e.fromNumber(t);if(n.isString(t)){if(!n.Long)return e.fromNumber(parseInt(t,10));t=n.Long.fromString(t)}return t.low||t.high?new e(t.low>>>0,t.high>>>0):s},e.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var i=1+~this.lo>>>0,n=~this.hi>>>0;return i||(n=n+1>>>0),-(i+4294967296*n)}return this.lo+4294967296*this.hi},e.prototype.toLong=function(t){return n.Long?new n.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var u=String.prototype.charCodeAt;e.fromHash=function(t){return t===r?s:new e((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},e.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},e.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},e.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},e.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:n<128?9:10}},{39:39}],39:[function(t,i,n){var r=n;function e(t,i,n){for(var r=Object.keys(i),e=0;e>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;i[n++]=t.lo}function d(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}a.create=r.Buffer?function(){return(a.create=function(){return new n})()}:function(){return new a},a.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(a.alloc=r.pool(a.alloc,r.Array.prototype.subarray)),a.prototype.g=function(t,i,n){return this.tail=this.tail.next=new o(t,i,n),this.len+=i,this},(l.prototype=Object.create(o.prototype)).fn=function(t,i,n){for(;127>>=7;i[n]=t},a.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new l((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},a.prototype.int32=function(t){return t<0?this.g(v,10,e.fromNumber(t)):this.uint32(t)},a.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},a.prototype.int64=a.prototype.uint64=function(t){var i=e.from(t);return this.g(v,i.length(),i)},a.prototype.sint64=function(t){var i=e.from(t).zzEncode();return this.g(v,i.length(),i)},a.prototype.bool=function(t){return this.g(c,1,t?1:0)},a.prototype.sfixed32=a.prototype.fixed32=function(t){return this.g(d,4,t>>>0)},a.prototype.sfixed64=a.prototype.fixed64=function(t){var i=e.from(t);return this.g(d,4,i.lo).g(d,4,i.hi)},a.prototype.float=function(t){return this.g(r.float.writeFloatLE,4,t)},a.prototype.double=function(t){return this.g(r.float.writeDoubleLE,8,t)};var p=r.Array.prototype.set?function(t,i,n){i.set(t,n)}:function(t,i,n){for(var r=0;r>>0;if(!i)return this.g(c,1,0);if(r.isString(t)){var n=a.alloc(i=s.length(t));s.decode(t,n,0),t=n}return this.uint32(i).g(p,i,t)},a.prototype.string=function(t){var i=u.length(t);return i?this.uint32(i).g(u.write,i,t):this.g(c,1,0)},a.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new o(f,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(f,0,0),this.len=0),this},a.prototype.ldelim=function(){var t=this.head,i=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=i,this.len+=n),this},a.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,i,n),n+=t.len,t=t.next;return i},a.o=function(t){n=t}},{39:39}],43:[function(t,i){i.exports=s;var n=t(42);(s.prototype=Object.create(n.prototype)).constructor=s;var r=t(39),e=r.Buffer;function s(){n.call(this)}s.alloc=function(t){return(s.alloc=r.b)(t)};var u=e&&e.prototype instanceof Uint8Array&&"set"===e.prototype.set.name?function(t,i,n){i.set(t,n)}:function(t,i,n){if(t.copy)t.copy(i,n,0,t.length);else for(var r=0;r>>0;return this.uint32(i),i&&this.g(u,i,t),this},s.prototype.string=function(t){var i=e.byteLength(t);return this.uint32(i),i&&this.g(o,i,t),this}},{39:39,42:42}]},e={},t=[19],i=function t(i){var n=e[i];return n||r[i][0].call(n=e[i]={exports:{}},t,n,n.exports),n.exports}(t[0]),i.util.global.protobuf=i,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(i.util.Long=t,i.configure()),i}),"object"==typeof module&&module&&module.exports&&(module.exports=i)}(); +//# sourceMappingURL=protobuf.min.js.map diff --git a/node_modules/protobufjs/dist/protobuf.min.js.map b/node_modules/protobufjs/dist/protobuf.min.js.map new file mode 100644 index 0000000..9bfc346 --- /dev/null +++ b/node_modules/protobufjs/dist/protobuf.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/common.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light.js","../src/index-minimal.js","../src/index","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/parse.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/tokenize.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":["undefined","modules","cache","entries","protobuf","1","require","module","exports","fn","ctx","params","Array","arguments","length","offset","index","pending","Promise","resolve","reject","err","apply","base64","string","p","n","charAt","Math","ceil","b64","s64","i","encode","buffer","start","end","t","parts","chunk","j","b","push","String","fromCharCode","slice","join","invalidEncoding","decode","c","charCodeAt","Error","test","codegen","functionParams","functionName","body","Codegen","formatStringOrScope","source","toString","verbose","console","log","scopeKeys","Object","keys","scopeParams","scopeValues","scopeOffset","Function","formatParams","formatOffset","replace","$0","$1","value","floor","JSON","stringify","functionNameOverride","EventEmitter","this","_listeners","prototype","on","evt","off","listeners","splice","emit","args","fetch","asPromise","fs","inquire","filename","options","callback","xhr","readFile","contents","XMLHttpRequest","binary","onreadystatechange","readyState","status","response","responseText","Uint8Array","overrideMimeType","responseType","open","send","factory","Float32Array","f32","f8b","le","writeFloat_f32_cpy","val","buf","pos","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","writeFloat_ieee754","writeUint","sign","isNaN","round","exponent","LN2","pow","readFloat_ieee754","readUint","uint","mantissa","NaN","Infinity","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","f64","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","writeDouble_ieee754","off0","off1","readDouble_ieee754","lo","hi","moduleName","mod","eval","e","path","isAbsolute","normalize","split","absolute","prefix","shift","originPath","includePath","alreadyNormalized","alloc","size","SIZE","MAX","slab","call","utf8","len","read","write","c1","c2","common","timeType","commonRe","name","json","nested","google","Any","fields","type_url","type","id","Duration","seconds","nanos","Timestamp","Empty","Struct","keyType","Value","oneofs","kind","oneof","nullValue","numberValue","stringValue","boolValue","structValue","listValue","NullValue","values","NULL_VALUE","ListValue","rule","DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue","FieldMask","paths","get","file","converter","Enum","util","genValuePartial_fromObject","gen","field","fieldIndex","prop","resolvedType","repeated","typeDefault","fullName","isUnsigned","genValuePartial_toObject","fromObject","mtype","fieldsArray","safeProp","map","toObject","sort","compareFieldsById","repeatedFields","mapFields","normalFields","partOf","valuesById","long","low","high","unsigned","toNumber","bytes","arrayDefault","hasKs2","_fieldsArray","indexOf","filter","group","ref","types","basic","packed","rfield","required","wireType","mapKey","genTypePartial","optional","ReflectionObject","create","constructor","className","Namespace","comment","comments","TypeError","reserved","fromJSON","enm","toJSON","toJSONOptions","keepComments","add","isString","isInteger","isReservedId","isReservedName","allow_alias","remove","Field","Type","ruleRe","extend","isObject","toLowerCase","message","defaultValue","Long","extensionField","declaringField","_packed","defineProperty","getOption","setOption","ifNotSet","resolved","defaults","parent","lookupTypeOrEnum","fromNumber","freeze","newBuffer","emptyObject","emptyArray","ctor","d","fieldId","fieldType","fieldRule","decorateType","decorateEnum","fieldName","default","_configure","Type_","build","load","root","Root","loadSync","encoder","decoder","verifier","OneOf","MapField","Service","Method","Message","wrappers","configure","Reader","BufferReader","Writer","BufferWriter","rpc","roots","tokenize","parse","resolvedKeyType","fieldKeyType","fieldValueType","properties","$type","writer","encodeDelimited","reader","decodeDelimited","verify","object","requestType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","lookupType","arrayToJSON","array","obj","_nestedArray","clearCache","namespace","addJSON","toArray","nestedArray","nestedJson","names","methods","getEnum","prev","setOptions","onAdd","onRemove","define","isArray","ptr","part","resolveAll","lookup","filterTypes","parentAlreadyChecked","found","lookupEnum","lookupService","Service_","Enum_","defineProperties","unshift","_handleAdd","_handleRemove","Root_","fieldNames","addFieldsToParent","oneofName","oneOfGetter","set","oneOfSetter","keepCase","base10Re","base10NegRe","base16Re","base16NegRe","base8Re","base8NegRe","numberRe","nameRe","typeRefRe","fqTypeRefRe","pkg","imports","weakImports","syntax","token","tn","alternateCommentMode","next","peek","skip","cmnt","head","isProto3","applyCase","camelCase","illegal","insideTryCatch","line","readString","readValue","acceptTypeRef","substring","parseInt","parseFloat","parseNumber","readRanges","target","acceptStrings","parseId","acceptNegative","parsePackage","parseImport","whichImports","parseSyntax","parseCommon","parseOption","ifBlock","valueType","parseInlineOptions","parseMapField","parseField","parseOneOf","extensions","parseType","dummy","parseEnumValue","parseEnum","service","method","parseMethod","parseService","reference","parseExtension","fnIf","fnElse","trailingLine","lcFirst","ucFirst","parseGroup","isCustom","parseOptionValue","package","LongBits","indexOutOfRange","writeLength","RangeError","create_array","readLongVarint","bits","readFixed32_end","readFixed64","Buffer","isBuffer","_slice","subarray","uint32","int32","sint32","bool","fixed32","sfixed32","float","double","skipType","BufferReader_","merge","int64","uint64","sint64","zzDecode","fixed64","sfixed64","utf8Slice","min","deferred","files","SYNC","resolvePath","self","sync","finish","cb","process","parsed","queued","weak","idx","lastIndexOf","altname","setTimeout","readFileSync","isNode","exposeRe","tryHandleExtension","extendedType","sisterField","parse_","common_","rpcImpl","requestDelimited","responseDelimited","rpcCall","requestCtor","responseCtor","request","endedByRPC","_methodsArray","inherited","methodsArray","rpcService","methodName","isReserved","m","q","s","delimRe","stringDoubleRe","stringSingleRe","setCommentRe","setCommentAltRe","setCommentSplitRe","whitespaceRe","unescapeRe","unescapeMap","0","r","unescape","str","commentType","commentText","commentLine","commentLineEmpty","stack","stringDelim","subject","setComment","commentOffset","lines","trim","isDoubleSlashCommentLine","startOffset","endOffset","findEndOfLine","lineText","cursor","re","lastIndex","match","exec","repeat","curr","isDoc","expected","actual","ret","_fieldsById","_oneofsArray","_ctor","fieldsById","oneofsArray","generateConstructor","ctorProperties","setup","wrapper","originalThis","fork","ldelim","typeName","bake","o","key","safePropBackslashRe","safePropQuoteRe","toUpperCase","camelCaseRe","a","decorateRoot","enumerable","decorateEnumIndex","zero","zzEncode","zeroHash","from","fromString","toLong","fromHash","hash","toHash","mask","part0","part1","part2","dst","src","newError","CustomError","captureStackTrace","pool","global","window","versions","node","Number","isFinite","isset","isSet","hasOwnProperty","utf8Write","_Buffer_from","_Buffer_allocUnsafe","sizeOrArray","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","ProtocolError","fieldMap","longs","enums","encoding","allocUnsafe","seenFirstField","invalid","genVerifyKey","genVerifyValue","oneofProp","substr","Op","noop","State","tail","states","writeByte","VarintOp","writeVarint64","writeFixed32","_push","writeBytes","reset","BufferWriter_","writeBytesBuffer","copy","writeStringBuffer","byteLength","$require","$module","amd","isLong"],"mappings":";;;;;;CAAA,SAAAA,IAAA,aAAA,IAAAC,EAAAC,EAAAC,EAcAC,EAdAH,EAiCA,CAAAI,EAAA,CAAA,SAAAC,EAAAC,GChCAA,EAAAC,QAmBA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACA,KAAAD,EAAAH,UAAAC,QACAH,EAAAI,KAAAF,UAAAG,KACA,OAAA,IAAAE,QAAA,SAAAC,EAAAC,GACAT,EAAAI,GAAA,SAAAM,GACA,GAAAJ,EAEA,GADAA,GAAA,EACAI,EACAD,EAAAC,OACA,CAGA,IAFA,IAAAV,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAA,EAAAJ,EAAAG,QACAH,EAAAI,KAAAF,UAAAE,GACAI,EAAAG,MAAA,KAAAX,KAIA,IACAF,EAAAa,MAAAZ,GAAA,KAAAC,GACA,MAAAU,GACAJ,IACAA,GAAA,EACAG,EAAAC,gCCxCA,IAAAE,EAAAf,EAOAe,EAAAT,OAAA,SAAAU,GACA,IAAAC,EAAAD,EAAAV,OACA,IAAAW,EACA,OAAA,EAEA,IADA,IAAAC,EAAA,EACA,IAAAD,EAAA,GAAA,MAAAD,EAAAG,OAAAF,MACAC,EACA,OAAAE,KAAAC,KAAA,EAAAL,EAAAV,QAAA,EAAAY,GAUA,IANA,IAAAI,EAAAlB,MAAA,IAGAmB,EAAAnB,MAAA,KAGAoB,EAAA,EAAAA,EAAA,IACAD,EAAAD,EAAAE,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,EAAAA,EAAA,GAAA,IAAAA,IASAT,EAAAU,OAAA,SAAAC,EAAAC,EAA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GAdAgP,EAAAtR,UAAA0L,MAAA,SAAAlM,GACAoK,EAAA8D,SAAAlO,KACAA,EAAAoK,EAAAwa,EAAA5kB,EAAA,WACA,IAAA8G,EAAA9G,EAAA9D,SAAA,EAIA,OAHAoE,KAAA6a,OAAArU,GACAA,GACAxG,KAAAqmB,EAAAI,EAAAjgB,EAAA9G,GACAM,MAaAwR,EAAAtR,UAAA5D,OAAA,SAAAoD,GACA,IAAA8G,EAAAiU,EAAAmM,WAAAlnB,GAIA,OAHAM,KAAA6a,OAAArU,GACAA,GACAxG,KAAAqmB,EAAAM,EAAAngB,EAAA9G,GACAM,uB3CvEAhF,KAAAC,OAcAC,EAPA,SAAA2rB,EAAA7f,GACA,IAAA8f,EAAA9rB,EAAAgM,GAGA,OAFA8f,GACA/rB,EAAAiM,GAAA,GAAAV,KAAAwgB,EAAA9rB,EAAAgM,GAAA,CAAA1L,QAAA,IAAAurB,EAAAC,EAAAA,EAAAxrB,SACAwrB,EAAAxrB,QAGAurB,CAAA5rB,EAAA,IAGAC,EAAA4O,KAAA8Z,OAAA1oB,SAAAA,EAGA,mBAAA6Y,QAAAA,OAAAgT,KACAhT,OAAA,CAAA,QAAA,SAAArF,GAKA,OAJAA,GAAAA,EAAAsY,SACA9rB,EAAA4O,KAAA4E,KAAAA,EACAxT,EAAAkW,aAEAlW,IAIA,iBAAAG,QAAAA,QAAAA,OAAAC,UACAD,OAAAC,QAAAJ,GA/BA","file":"protobuf.min.js","sourcesContent":["(function prelude(modules, cache, entries) {\r\n\r\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\r\n // sources through a conflict-free require shim and is again wrapped within an iife that\r\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\r\n // so that minification can remove the directives of each module.\r\n\r\n function $require(name) {\r\n var $module = cache[name];\r\n if (!$module)\r\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\r\n return $module.exports;\r\n }\r\n\r\n var protobuf = $require(entries[0]);\r\n\r\n // Expose globally\r\n protobuf.util.global.protobuf = protobuf;\r\n\r\n // Be nice to AMD\r\n if (typeof define === \"function\" && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long && Long.isLong) {\r\n protobuf.util.Long = Long;\r\n protobuf.configure();\r\n }\r\n return protobuf;\r\n });\r\n\r\n // Be nice to CommonJS\r\n if (typeof module === \"object\" && module && module.exports)\r\n module.exports = protobuf;\r\n\r\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nmodule.exports = common;\r\n\r\nvar commonRe = /\\/|\\./;\r\n\r\n/**\r\n * Provides common type definitions.\r\n * Can also be used to provide additional google types or your own custom types.\r\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\r\n * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\r\n * @returns {undefined}\r\n * @property {INamespace} google/protobuf/any.proto Any\r\n * @property {INamespace} google/protobuf/duration.proto Duration\r\n * @property {INamespace} google/protobuf/empty.proto Empty\r\n * @property {INamespace} google/protobuf/field_mask.proto FieldMask\r\n * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\r\n * @property {INamespace} google/protobuf/timestamp.proto Timestamp\r\n * @property {INamespace} google/protobuf/wrappers.proto Wrappers\r\n * @example\r\n * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)\r\n * protobuf.common(\"descriptor\", descriptorJson);\r\n *\r\n * // manually provides a custom definition (uses my.foo namespace)\r\n * protobuf.common(\"my/foo/bar.proto\", myFooBarJson);\r\n */\r\nfunction common(name, json) {\r\n if (!commonRe.test(name)) {\r\n name = \"google/protobuf/\" + name + \".proto\";\r\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\r\n }\r\n common[name] = json;\r\n}\r\n\r\n// Not provided because of limited use (feel free to discuss or to provide yourself):\r\n//\r\n// google/protobuf/descriptor.proto\r\n// google/protobuf/source_context.proto\r\n// google/protobuf/type.proto\r\n//\r\n// Stripped and pre-parsed versions of these non-bundled files are instead available as part of\r\n// the repository or package within the google/protobuf directory.\r\n\r\ncommon(\"any\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Any message.\r\n * @interface IAny\r\n * @type {Object}\r\n * @property {string} [typeUrl]\r\n * @property {Uint8Array} [bytes]\r\n * @memberof common\r\n */\r\n Any: {\r\n fields: {\r\n type_url: {\r\n type: \"string\",\r\n id: 1\r\n },\r\n value: {\r\n type: \"bytes\",\r\n id: 2\r\n }\r\n }\r\n }\r\n});\r\n\r\nvar timeType;\r\n\r\ncommon(\"duration\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Duration message.\r\n * @interface IDuration\r\n * @type {Object}\r\n * @property {number|Long} [seconds]\r\n * @property {number} [nanos]\r\n * @memberof common\r\n */\r\n Duration: timeType = {\r\n fields: {\r\n seconds: {\r\n type: \"int64\",\r\n id: 1\r\n },\r\n nanos: {\r\n type: \"int32\",\r\n id: 2\r\n }\r\n }\r\n }\r\n});\r\n\r\ncommon(\"timestamp\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Timestamp message.\r\n * @interface ITimestamp\r\n * @type {Object}\r\n * @property {number|Long} [seconds]\r\n * @property {number} [nanos]\r\n * @memberof common\r\n */\r\n Timestamp: timeType\r\n});\r\n\r\ncommon(\"empty\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Empty message.\r\n * @interface IEmpty\r\n * @memberof common\r\n */\r\n Empty: {\r\n fields: {}\r\n }\r\n});\r\n\r\ncommon(\"struct\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.Struct message.\r\n * @interface IStruct\r\n * @type {Object}\r\n * @property {Object.} [fields]\r\n * @memberof common\r\n */\r\n Struct: {\r\n fields: {\r\n fields: {\r\n keyType: \"string\",\r\n type: \"Value\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.Value message.\r\n * @interface IValue\r\n * @type {Object}\r\n * @property {string} [kind]\r\n * @property {0} [nullValue]\r\n * @property {number} [numberValue]\r\n * @property {string} [stringValue]\r\n * @property {boolean} [boolValue]\r\n * @property {IStruct} [structValue]\r\n * @property {IListValue} [listValue]\r\n * @memberof common\r\n */\r\n Value: {\r\n oneofs: {\r\n kind: {\r\n oneof: [\r\n \"nullValue\",\r\n \"numberValue\",\r\n \"stringValue\",\r\n \"boolValue\",\r\n \"structValue\",\r\n \"listValue\"\r\n ]\r\n }\r\n },\r\n fields: {\r\n nullValue: {\r\n type: \"NullValue\",\r\n id: 1\r\n },\r\n numberValue: {\r\n type: \"double\",\r\n id: 2\r\n },\r\n stringValue: {\r\n type: \"string\",\r\n id: 3\r\n },\r\n boolValue: {\r\n type: \"bool\",\r\n id: 4\r\n },\r\n structValue: {\r\n type: \"Struct\",\r\n id: 5\r\n },\r\n listValue: {\r\n type: \"ListValue\",\r\n id: 6\r\n }\r\n }\r\n },\r\n\r\n NullValue: {\r\n values: {\r\n NULL_VALUE: 0\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.ListValue message.\r\n * @interface IListValue\r\n * @type {Object}\r\n * @property {Array.} [values]\r\n * @memberof common\r\n */\r\n ListValue: {\r\n fields: {\r\n values: {\r\n rule: \"repeated\",\r\n type: \"Value\",\r\n id: 1\r\n }\r\n }\r\n }\r\n});\r\n\r\ncommon(\"wrappers\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.DoubleValue message.\r\n * @interface IDoubleValue\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n DoubleValue: {\r\n fields: {\r\n value: {\r\n type: \"double\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.FloatValue message.\r\n * @interface IFloatValue\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n FloatValue: {\r\n fields: {\r\n value: {\r\n type: \"float\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.Int64Value message.\r\n * @interface IInt64Value\r\n * @type {Object}\r\n * @property {number|Long} [value]\r\n * @memberof common\r\n */\r\n Int64Value: {\r\n fields: {\r\n value: {\r\n type: \"int64\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.UInt64Value message.\r\n * @interface IUInt64Value\r\n * @type {Object}\r\n * @property {number|Long} [value]\r\n * @memberof common\r\n */\r\n UInt64Value: {\r\n fields: {\r\n value: {\r\n type: \"uint64\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.Int32Value message.\r\n * @interface IInt32Value\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n Int32Value: {\r\n fields: {\r\n value: {\r\n type: \"int32\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.UInt32Value message.\r\n * @interface IUInt32Value\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n UInt32Value: {\r\n fields: {\r\n value: {\r\n type: \"uint32\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.BoolValue message.\r\n * @interface IBoolValue\r\n * @type {Object}\r\n * @property {boolean} [value]\r\n * @memberof common\r\n */\r\n BoolValue: {\r\n fields: {\r\n value: {\r\n type: \"bool\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.StringValue message.\r\n * @interface IStringValue\r\n * @type {Object}\r\n * @property {string} [value]\r\n * @memberof common\r\n */\r\n StringValue: {\r\n fields: {\r\n value: {\r\n type: \"string\",\r\n id: 1\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Properties of a google.protobuf.BytesValue message.\r\n * @interface IBytesValue\r\n * @type {Object}\r\n * @property {Uint8Array} [value]\r\n * @memberof common\r\n */\r\n BytesValue: {\r\n fields: {\r\n value: {\r\n type: \"bytes\",\r\n id: 1\r\n }\r\n }\r\n }\r\n});\r\n\r\ncommon(\"field_mask\", {\r\n\r\n /**\r\n * Properties of a google.protobuf.FieldMask message.\r\n * @interface IDoubleValue\r\n * @type {Object}\r\n * @property {number} [value]\r\n * @memberof common\r\n */\r\n FieldMask: {\r\n fields: {\r\n paths: {\r\n rule: \"repeated\",\r\n type: \"string\",\r\n id: 1\r\n }\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Gets the root definition of the specified common proto file.\r\n *\r\n * Bundled definitions are:\r\n * - google/protobuf/any.proto\r\n * - google/protobuf/duration.proto\r\n * - google/protobuf/empty.proto\r\n * - google/protobuf/field_mask.proto\r\n * - google/protobuf/struct.proto\r\n * - google/protobuf/timestamp.proto\r\n * - google/protobuf/wrappers.proto\r\n *\r\n * @param {string} file Proto file name\r\n * @returns {INamespace|null} Root definition or `null` if not defined\r\n */\r\ncommon.get = function get(file) {\r\n return common[file] || null;\r\n};\r\n","\"use strict\";\r\n/**\r\n * Runtime message from/to plain object converters.\r\n * @namespace\r\n */\r\nvar converter = exports;\r\n\r\nvar Enum = require(15),\r\n util = require(37);\r\n\r\n/**\r\n * Generates a partial value fromObject conveter.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {number} fieldIndex Field index\r\n * @param {string} prop Property reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n if (field.resolvedType) {\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(d%s){\", prop);\r\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\r\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\r\n (\"default:\");\r\n gen\r\n (\"case%j:\", keys[i])\r\n (\"case %i:\", values[keys[i]])\r\n (\"m%s=%j\", prop, values[keys[i]])\r\n (\"break\");\r\n } gen\r\n (\"}\");\r\n } else gen\r\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\r\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\r\n (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\r\n } else {\r\n var isUnsigned = false;\r\n switch (field.type) {\r\n case \"double\":\r\n case \"float\": gen\r\n (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\r\n break;\r\n case \"uint32\":\r\n case \"fixed32\": gen\r\n (\"m%s=d%s>>>0\", prop, prop);\r\n break;\r\n case \"int32\":\r\n case \"sint32\":\r\n case \"sfixed32\": gen\r\n (\"m%s=d%s|0\", prop, prop);\r\n break;\r\n case \"uint64\":\r\n isUnsigned = true;\r\n // eslint-disable-line no-fallthrough\r\n case \"int64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(util.Long)\")\r\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\r\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\r\n (\"m%s=parseInt(d%s,10)\", prop, prop)\r\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\r\n (\"m%s=d%s\", prop, prop)\r\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\r\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\r\n break;\r\n case \"bytes\": gen\r\n (\"if(typeof d%s===\\\"string\\\")\", prop)\r\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\r\n (\"else if(d%s.length)\", prop)\r\n (\"m%s=d%s\", prop, prop);\r\n break;\r\n case \"string\": gen\r\n (\"m%s=String(d%s)\", prop, prop);\r\n break;\r\n case \"bool\": gen\r\n (\"m%s=Boolean(d%s)\", prop, prop);\r\n break;\r\n /* default: gen\r\n (\"m%s=d%s\", prop, prop);\r\n break; */\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a plain object to runtime message converter specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nconverter.fromObject = function fromObject(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var fields = mtype.fieldsArray;\r\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\r\n (\"if(d instanceof this.ctor)\")\r\n (\"return d\");\r\n if (!fields.length) return gen\r\n (\"return new this.ctor\");\r\n gen\r\n (\"var m=new this.ctor\");\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n prop = util.safeProp(field.name);\r\n\r\n // Map fields\r\n if (field.map) { gen\r\n (\"if(d%s){\", prop)\r\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\r\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\r\n (\"m%s={}\", prop)\r\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\r\n break;\r\n case \"bytes\": gen\r\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\r\n break;\r\n default: gen\r\n (\"d%s=m%s\", prop, prop);\r\n break;\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a runtime message to plain object converter specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nconverter.toObject = function toObject(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\r\n if (!fields.length)\r\n return util.codegen()(\"return {}\");\r\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\r\n (\"if(!o)\")\r\n (\"o={}\")\r\n (\"var d={}\");\r\n\r\n var repeatedFields = [],\r\n mapFields = [],\r\n normalFields = [],\r\n i = 0;\r\n for (; i < fields.length; ++i)\r\n if (!fields[i].partOf)\r\n ( fields[i].resolve().repeated ? repeatedFields\r\n : fields[i].map ? mapFields\r\n : normalFields).push(fields[i]);\r\n\r\n if (repeatedFields.length) { gen\r\n (\"if(o.arrays||o.defaults){\");\r\n for (i = 0; i < repeatedFields.length; ++i) gen\r\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\r\n gen\r\n (\"}\");\r\n }\r\n\r\n if (mapFields.length) { gen\r\n (\"if(o.objects||o.defaults){\");\r\n for (i = 0; i < mapFields.length; ++i) gen\r\n (\"d%s={}\", util.safeProp(mapFields[i].name));\r\n gen\r\n (\"}\");\r\n }\r\n\r\n if (normalFields.length) { gen\r\n (\"if(o.defaults){\");\r\n for (i = 0; i < normalFields.length; ++i) {\r\n var field = normalFields[i],\r\n prop = util.safeProp(field.name);\r\n if (field.resolvedType instanceof Enum) gen\r\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\r\n else if (field.long) gen\r\n (\"if(util.Long){\")\r\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\r\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\r\n (\"}else\")\r\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\r\n else if (field.bytes) {\r\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\r\n gen\r\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\r\n (\"else{\")\r\n (\"d%s=%s\", prop, arrayDefault)\r\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\r\n (\"}\");\r\n } else gen\r\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\r\n } gen\r\n (\"}\");\r\n }\r\n var hasKs2 = false;\r\n for (i = 0; i < fields.length; ++i) {\r\n var field = fields[i],\r\n index = mtype._fieldsArray.indexOf(field),\r\n prop = util.safeProp(field.name);\r\n if (field.map) {\r\n if (!hasKs2) { hasKs2 = true; gen\r\n (\"var ks2\");\r\n } gen\r\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\r\n (\"d%s={}\", prop)\r\n (\"for(var j=0;j>>3){\");\r\n\r\n var i = 0;\r\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\r\n var field = mtype._fieldsArray[i].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\r\n ref = \"m\" + util.safeProp(field.name); gen\r\n (\"case %i:\", field.id);\r\n\r\n // Map fields\r\n if (field.map) { gen\r\n (\"r.skip().pos++\") // assumes id 1 + key wireType\r\n (\"if(%s===util.emptyObject)\", ref)\r\n (\"%s={}\", ref)\r\n (\"k=r.%s()\", field.keyType)\r\n (\"r.pos++\"); // assumes id 2 + value wireType\r\n if (types.long[field.keyType] !== undefined) {\r\n if (types.basic[type] === undefined) gen\r\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\r\n else gen\r\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=r.%s()\", ref, type);\r\n } else {\r\n if (types.basic[type] === undefined) gen\r\n (\"%s[k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\r\n else gen\r\n (\"%s[k]=r.%s()\", ref, type);\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) { gen\r\n\r\n (\"if(!(%s&&%s.length))\", ref, ref)\r\n (\"%s=[]\", ref);\r\n\r\n // Packable (always check for forward and backward compatiblity)\r\n if (types.packed[type] !== undefined) gen\r\n (\"if((t&7)===2){\")\r\n (\"var c2=r.uint32()+r.pos\")\r\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0)\r\n : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\r\n}\r\n\r\n/**\r\n * Generates an encoder specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nfunction encoder(mtype) {\r\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\r\n (\"if(!w)\")\r\n (\"w=Writer.create()\");\r\n\r\n var i, ref;\r\n\r\n // \"when a message is serialized its known fields should be written sequentially by field number\"\r\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\r\n\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n index = mtype._fieldsArray.indexOf(field),\r\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\r\n wireType = types.basic[type];\r\n ref = \"m\" + util.safeProp(field.name);\r\n\r\n // Map fields\r\n if (field.map) {\r\n gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name) // !== undefined && !== null\r\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\r\n if (wireType === undefined) gen\r\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\r\n else gen\r\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\r\n gen\r\n (\"}\")\r\n (\"}\");\r\n\r\n // Repeated fields\r\n } else if (field.repeated) { gen\r\n (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\r\n\r\n // Packed repeated\r\n if (field.packed && types.packed[type] !== undefined) { gen\r\n\r\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\r\n (\"for(var i=0;i<%s.length;++i)\", ref)\r\n (\"w.%s(%s[i])\", type, ref)\r\n (\"w.ldelim()\");\r\n\r\n // Non-packed\r\n } else { gen\r\n\r\n (\"for(var i=0;i<%s.length;++i)\", ref);\r\n if (wireType === undefined)\r\n genTypePartial(gen, field, index, ref + \"[i]\");\r\n else gen\r\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\r\n\r\n } gen\r\n (\"}\");\r\n\r\n // Non-repeated\r\n } else {\r\n if (field.optional) gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j))\", ref, field.name); // !== undefined && !== null\r\n\r\n if (wireType === undefined)\r\n genTypePartial(gen, field, index, ref);\r\n else gen\r\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\r\n\r\n }\r\n }\r\n\r\n return gen\r\n (\"return w\");\r\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\r\n}","\"use strict\";\r\nmodule.exports = Enum;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\r\n\r\nvar Namespace = require(23),\r\n util = require(37);\r\n\r\n/**\r\n * Constructs a new enum instance.\r\n * @classdesc Reflected enum.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {Object.} [values] Enum values as an object, by name\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] The comment for this enum\r\n * @param {Object.} [comments] The value comments for this enum\r\n */\r\nfunction Enum(name, values, options, comment, comments) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n if (values && typeof values !== \"object\")\r\n throw TypeError(\"values must be an object\");\r\n\r\n /**\r\n * Enum values by id.\r\n * @type {Object.}\r\n */\r\n this.valuesById = {};\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = Object.create(this.valuesById); // toJSON, marker\r\n\r\n /**\r\n * Enum comment text.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n\r\n /**\r\n * Value comment texts, if any.\r\n * @type {Object.}\r\n */\r\n this.comments = comments || {};\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {Array.}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\r\n // compatible enum. This is used by pbts to write actual enum definitions that work for\r\n // static and reflection code alike instead of emitting generic object definitions.\r\n\r\n if (values)\r\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\r\n if (typeof values[keys[i]] === \"number\") // use forward entries only\r\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\r\n}\r\n\r\n/**\r\n * Enum descriptor.\r\n * @interface IEnum\r\n * @property {Object.} values Enum values\r\n * @property {Object.} [options] Enum options\r\n */\r\n\r\n/**\r\n * Constructs an enum from an enum descriptor.\r\n * @param {string} name Enum name\r\n * @param {IEnum} json Enum descriptor\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\r\n enm.reserved = json.reserved;\r\n return enm;\r\n};\r\n\r\n/**\r\n * Converts this enum to an enum descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IEnum} Enum descriptor\r\n */\r\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"values\" , this.values,\r\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\r\n \"comment\" , keepComments ? this.comment : undefined,\r\n \"comments\" , keepComments ? this.comments : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @param {string} [comment] Comment, if any\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnum.prototype.add = function add(name, id, comment) {\r\n // utilized by the parser but not by .fromJSON\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n if (!util.isInteger(id))\r\n throw TypeError(\"id must be an integer\");\r\n\r\n if (this.values[name] !== undefined)\r\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\r\n\r\n if (this.isReservedId(id))\r\n throw Error(\"id \" + id + \" is reserved in \" + this);\r\n\r\n if (this.isReservedName(name))\r\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\r\n\r\n if (this.valuesById[id] !== undefined) {\r\n if (!(this.options && this.options.allow_alias))\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n } else\r\n this.valuesById[this.values[name] = id] = name;\r\n\r\n this.comments[name] = comment || null;\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnum.prototype.remove = function remove(name) {\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n var val = this.values[name];\r\n if (val == null)\r\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\r\n\r\n delete this.valuesById[val];\r\n delete this.values[name];\r\n delete this.comments[name];\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nEnum.prototype.isReservedId = function isReservedId(id) {\r\n return Namespace.isReservedId(this.reserved, id);\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nEnum.prototype.isReservedName = function isReservedName(name) {\r\n return Namespace.isReservedName(this.reserved, name);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\r\n\r\nvar Enum = require(15),\r\n types = require(36),\r\n util = require(37);\r\n\r\nvar Type; // cyclic\r\n\r\nvar ruleRe = /^required|optional|repeated$/;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @name Field\r\n * @classdesc Reflected message field.\r\n * @extends FieldBase\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object.} [rule=\"optional\"] Field rule\r\n * @param {string|Object.} [extend] Extended type if different from parent\r\n * @param {Object.} [options] Declared options\r\n */\r\n\r\n/**\r\n * Constructs a field from a field descriptor.\r\n * @param {string} name Field name\r\n * @param {IField} json Field descriptor\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Not an actual constructor. Use {@link Field} instead.\r\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\r\n * @exports FieldBase\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object.} [rule=\"optional\"] Field rule\r\n * @param {string|Object.} [extend] Extended type if different from parent\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction Field(name, id, type, rule, extend, options, comment) {\r\n\r\n if (util.isObject(rule)) {\r\n comment = extend;\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n comment = options;\r\n options = extend;\r\n extend = undefined;\r\n }\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n if (!util.isInteger(id) || id < 0)\r\n throw TypeError(\"id must be a non-negative integer\");\r\n\r\n if (!util.isString(type))\r\n throw TypeError(\"type must be a string\");\r\n\r\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\r\n throw TypeError(\"rule must be a string rule\");\r\n\r\n if (extend !== undefined && !util.isString(extend))\r\n throw TypeError(\"extend must be a string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {Type|null}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {OneOf|null}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field type's default value.\r\n * @type {*}\r\n */\r\n this.typeDefault = null;\r\n\r\n /**\r\n * The field's default value on prototypes.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\r\n\r\n /**\r\n * Whether this field's value is a buffer.\r\n * @type {boolean}\r\n */\r\n this.bytes = type === \"bytes\";\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {Type|Enum|null}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {Field|null}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {Field|null}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {boolean|null}\r\n * @private\r\n */\r\n this._packed = null;\r\n\r\n /**\r\n * Comment for this field.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\nObject.defineProperty(Field.prototype, \"packed\", {\r\n get: function() {\r\n // defaults to packed=true if not explicity set to false\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\") // clear cached before setting\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Field descriptor.\r\n * @interface IField\r\n * @property {string} [rule=\"optional\"] Field rule\r\n * @property {string} type Field type\r\n * @property {number} id Field id\r\n * @property {Object.} [options] Field options\r\n */\r\n\r\n/**\r\n * Extension field descriptor.\r\n * @interface IExtensionField\r\n * @extends IField\r\n * @property {string} extend Extended type\r\n */\r\n\r\n/**\r\n * Converts this field to a field descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IField} Field descriptor\r\n */\r\nField.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\r\n \"type\" , this.type,\r\n \"id\" , this.id,\r\n \"extend\" , this.extend,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nField.prototype.resolve = function resolve() {\r\n\r\n if (this.resolved)\r\n return this;\r\n\r\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\r\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\r\n if (this.resolvedType instanceof Type)\r\n this.typeDefault = null;\r\n else // instanceof Enum\r\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\r\n }\r\n\r\n // use explicitly set default value if present\r\n if (this.options && this.options[\"default\"] != null) {\r\n this.typeDefault = this.options[\"default\"];\r\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\r\n this.typeDefault = this.resolvedType.values[this.typeDefault];\r\n }\r\n\r\n // remove unnecessary options\r\n if (this.options) {\r\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\r\n delete this.options.packed;\r\n if (!Object.keys(this.options).length)\r\n this.options = undefined;\r\n }\r\n\r\n // convert to internal data type if necesssary\r\n if (this.long) {\r\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\r\n\r\n /* istanbul ignore else */\r\n if (Object.freeze)\r\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\r\n\r\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\r\n var buf;\r\n if (util.base64.test(this.typeDefault))\r\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\r\n else\r\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\r\n this.typeDefault = buf;\r\n }\r\n\r\n // take special care of maps and repeated fields\r\n if (this.map)\r\n this.defaultValue = util.emptyObject;\r\n else if (this.repeated)\r\n this.defaultValue = util.emptyArray;\r\n else\r\n this.defaultValue = this.typeDefault;\r\n\r\n // ensure proper value on prototype\r\n if (this.parent instanceof Type)\r\n this.parent.ctor.prototype[this.name] = this.defaultValue;\r\n\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\r\n * @typedef FieldDecorator\r\n * @type {function}\r\n * @param {Object} prototype Target prototype\r\n * @param {string} fieldName Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Field decorator (TypeScript).\r\n * @name Field.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\r\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\r\n * @param {T} [defaultValue] Default value\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\r\n */\r\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\r\n\r\n // submessage: decorate the submessage and use its name as the type\r\n if (typeof fieldType === \"function\")\r\n fieldType = util.decorateType(fieldType).name;\r\n\r\n // enum reference: create a reflected copy of the enum and keep reuseing it\r\n else if (fieldType && typeof fieldType === \"object\")\r\n fieldType = util.decorateEnum(fieldType).name;\r\n\r\n return function fieldDecorator(prototype, fieldName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\r\n };\r\n};\r\n\r\n/**\r\n * Field decorator (TypeScript).\r\n * @name Field.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {Constructor|string} fieldType Field type\r\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends Message\r\n * @variation 2\r\n */\r\n// like Field.d but without a default value\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nField._configure = function configure(Type_) {\r\n Type = Type_;\r\n};\r\n","\"use strict\";\r\nvar protobuf = module.exports = require(18);\r\n\r\nprotobuf.build = \"light\";\r\n\r\n/**\r\n * A node-style callback as used by {@link load} and {@link Root#load}.\r\n * @typedef LoadCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Root} [root] Root, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @see {@link Root#load}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === \"function\") {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @see {@link Root#load}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @see {@link Root#load}\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n * @see {@link Root#loadSync}\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Serialization\r\nprotobuf.encoder = require(14);\r\nprotobuf.decoder = require(13);\r\nprotobuf.verifier = require(40);\r\nprotobuf.converter = require(12);\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(24);\r\nprotobuf.Namespace = require(23);\r\nprotobuf.Root = require(29);\r\nprotobuf.Enum = require(15);\r\nprotobuf.Type = require(35);\r\nprotobuf.Field = require(16);\r\nprotobuf.OneOf = require(25);\r\nprotobuf.MapField = require(20);\r\nprotobuf.Service = require(33);\r\nprotobuf.Method = require(22);\r\n\r\n// Runtime\r\nprotobuf.Message = require(21);\r\nprotobuf.wrappers = require(41);\r\n\r\n// Utility\r\nprotobuf.types = require(36);\r\nprotobuf.util = require(37);\r\n\r\n// Set up possibly cyclic reflection dependencies\r\nprotobuf.ReflectionObject._configure(protobuf.Root);\r\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\r\nprotobuf.Root._configure(protobuf.Type);\r\nprotobuf.Field._configure(protobuf.Type);\r\n","\"use strict\";\r\nvar protobuf = exports;\r\n\r\n/**\r\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\r\n * @name build\r\n * @type {string}\r\n * @const\r\n */\r\nprotobuf.build = \"minimal\";\r\n\r\n// Serialization\r\nprotobuf.Writer = require(42);\r\nprotobuf.BufferWriter = require(43);\r\nprotobuf.Reader = require(27);\r\nprotobuf.BufferReader = require(28);\r\n\r\n// Utility\r\nprotobuf.util = require(39);\r\nprotobuf.rpc = require(31);\r\nprotobuf.roots = require(30);\r\nprotobuf.configure = configure;\r\n\r\n/* istanbul ignore next */\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n protobuf.Reader._configure(protobuf.BufferReader);\r\n protobuf.util._configure();\r\n}\r\n\r\n// Set up buffer utility according to the environment\r\nprotobuf.Writer._configure(protobuf.BufferWriter);\r\nconfigure();\r\n","\"use strict\";\r\nvar protobuf = module.exports = require(17);\r\n\r\nprotobuf.build = \"full\";\r\n\r\n// Parser\r\nprotobuf.tokenize = require(34);\r\nprotobuf.parse = require(26);\r\nprotobuf.common = require(11);\r\n\r\n// Configure parser\r\nprotobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\n// extends Field\r\nvar Field = require(16);\r\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\r\n\r\nvar types = require(36),\r\n util = require(37);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends FieldBase\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction MapField(name, id, keyType, type, options, comment) {\r\n Field.call(this, name, id, type, undefined, undefined, options, comment);\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(keyType))\r\n throw TypeError(\"keyType must be a string\");\r\n\r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {ReflectionObject|null}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Map field descriptor.\r\n * @interface IMapField\r\n * @extends {IField}\r\n * @property {string} keyType Key type\r\n */\r\n\r\n/**\r\n * Extension map field descriptor.\r\n * @interface IExtensionMapField\r\n * @extends IMapField\r\n * @property {string} extend Extended type\r\n */\r\n\r\n/**\r\n * Constructs a map field from a map field descriptor.\r\n * @param {string} name Field name\r\n * @param {IMapField} json Map field descriptor\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this map field to a map field descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IMapField} Map field descriptor\r\n */\r\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"keyType\" , this.keyType,\r\n \"type\" , this.type,\r\n \"id\" , this.id,\r\n \"extend\" , this.extend,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapField.prototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\r\n if (types.mapKey[this.keyType] === undefined)\r\n throw Error(\"invalid key type: \" + this.keyType);\r\n\r\n return Field.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Map field decorator (TypeScript).\r\n * @name MapField.d\r\n * @function\r\n * @param {number} fieldId Field id\r\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\r\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\r\n * @returns {FieldDecorator} Decorator function\r\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\r\n */\r\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\r\n\r\n // submessage value: decorate the submessage and use its name as the type\r\n if (typeof fieldValueType === \"function\")\r\n fieldValueType = util.decorateType(fieldValueType).name;\r\n\r\n // enum reference value: create a reflected copy of the enum and keep reuseing it\r\n else if (fieldValueType && typeof fieldValueType === \"object\")\r\n fieldValueType = util.decorateEnum(fieldValueType).name;\r\n\r\n return function mapFieldDecorator(prototype, fieldName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\nvar util = require(39);\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * @classdesc Abstract runtime message.\r\n * @constructor\r\n * @param {Properties} [properties] Properties to set\r\n * @template T extends object = object\r\n */\r\nfunction Message(properties) {\r\n // not used internally\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n}\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/*eslint-disable valid-jsdoc*/\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object.} [properties] Properties to set\r\n * @returns {Message} Message instance\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.create = function create(properties) {\r\n return this.$type.create(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {T|Object.} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {T|Object.} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\r\n * @returns {T} Decoded message\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.decode = function decode(reader) {\r\n return this.$type.decode(reader);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\r\n * @returns {T} Decoded message\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(reader) {\r\n return this.$type.decodeDelimited(reader);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Object.} message Plain object to verify\r\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\r\n * @param {Object.} object Plain object\r\n * @returns {T} Message instance\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.fromObject = function fromObject(object) {\r\n return this.$type.fromObject(object);\r\n};\r\n\r\n/**\r\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\r\n * @param {T} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n * @template T extends Message\r\n * @this Constructor\r\n */\r\nMessage.toObject = function toObject(message, options) {\r\n return this.$type.toObject(message, options);\r\n};\r\n\r\n/**\r\n * Converts this message to JSON.\r\n * @returns {Object.} JSON object\r\n */\r\nMessage.prototype.toJSON = function toJSON() {\r\n return this.$type.toObject(this, util.toJSONOptions);\r\n};\r\n\r\n/*eslint-enable valid-jsdoc*/","\"use strict\";\r\nmodule.exports = Method;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\r\n\r\nvar util = require(37);\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] The comment for this method\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\r\n\r\n /* istanbul ignore next */\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n\r\n /* istanbul ignore if */\r\n if (!(type === undefined || util.isString(type)))\r\n throw TypeError(\"type must be a string\");\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(requestType))\r\n throw TypeError(\"requestType must be a string\");\r\n\r\n /* istanbul ignore if */\r\n if (!util.isString(responseType))\r\n throw TypeError(\"responseType must be a string\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {Type|null}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {Type|null}\r\n */\r\n this.resolvedResponseType = null;\r\n\r\n /**\r\n * Comment for this method\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Method descriptor.\r\n * @interface IMethod\r\n * @property {string} [type=\"rpc\"] Method type\r\n * @property {string} requestType Request type\r\n * @property {string} responseType Response type\r\n * @property {boolean} [requestStream=false] Whether requests are streamed\r\n * @property {boolean} [responseStream=false] Whether responses are streamed\r\n * @property {Object.} [options] Method options\r\n */\r\n\r\n/**\r\n * Constructs a method from a method descriptor.\r\n * @param {string} name Method name\r\n * @param {IMethod} json Method descriptor\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this method to a method descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IMethod} Method descriptor\r\n */\r\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\r\n \"requestType\" , this.requestType,\r\n \"requestStream\" , this.requestStream,\r\n \"responseType\" , this.responseType,\r\n \"responseStream\" , this.responseStream,\r\n \"options\" , this.options,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethod.prototype.resolve = function resolve() {\r\n\r\n /* istanbul ignore if */\r\n if (this.resolved)\r\n return this;\r\n\r\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\r\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\r\n\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\r\n\r\nvar Field = require(16),\r\n util = require(37);\r\n\r\nvar Type, // cyclic\r\n Service,\r\n Enum;\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @name Namespace\r\n * @classdesc Reflected namespace.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object.} [options] Declared options\r\n */\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @memberof Namespace\r\n * @function\r\n * @param {string} name Namespace name\r\n * @param {Object.} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array, toJSONOptions) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {Array.|undefined} reserved Array of reserved ranges and names\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nNamespace.isReservedId = function isReservedId(reserved, id) {\r\n if (reserved)\r\n for (var i = 0; i < reserved.length; ++i)\r\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] >= id)\r\n return true;\r\n return false;\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {Array.|undefined} reserved Array of reserved ranges and names\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nNamespace.isReservedName = function isReservedName(reserved, name) {\r\n if (reserved)\r\n for (var i = 0; i < reserved.length; ++i)\r\n if (reserved[i] === name)\r\n return true;\r\n return false;\r\n};\r\n\r\n/**\r\n * Not an actual constructor. Use {@link Namespace} instead.\r\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\r\n * @exports NamespaceBase\r\n * @extends ReflectionObject\r\n * @abstract\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object.} [options] Declared options\r\n * @see {@link Namespace}\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {ReflectionObject[]|null}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\n/**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name NamespaceBase#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\r\n get: function() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n});\r\n\r\n/**\r\n * Namespace descriptor.\r\n * @interface INamespace\r\n * @property {Object.} [options] Namespace options\r\n * @property {Object.} [nested] Nested object descriptors\r\n */\r\n\r\n/**\r\n * Any extension field descriptor.\r\n * @typedef AnyExtensionField\r\n * @type {IExtensionField|IExtensionMapField}\r\n */\r\n\r\n/**\r\n * Any nested object descriptor.\r\n * @typedef AnyNestedObject\r\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\r\n */\r\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\r\n\r\n/**\r\n * Converts this namespace to a namespace descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {INamespace} Namespace descriptor\r\n */\r\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds nested objects to this namespace from nested object descriptors.\r\n * @param {Object.} nestedJson Any nested object descriptors\r\n * @returns {Namespace} `this`\r\n */\r\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n /* istanbul ignore else */\r\n if (nestedJson) {\r\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\r\n nested = nestedJson[names[i]];\r\n ns.add( // most to least likely\r\n ( nested.fields !== undefined\r\n ? Type.fromJSON\r\n : nested.values !== undefined\r\n ? Enum.fromJSON\r\n : nested.methods !== undefined\r\n ? Service.fromJSON\r\n : nested.id !== undefined\r\n ? Field.fromJSON\r\n : Namespace.fromJSON )(names[i], nested)\r\n );\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespace.prototype.get = function get(name) {\r\n return this.nested && this.nested[name]\r\n || null;\r\n};\r\n\r\n/**\r\n * Gets the values of the nested {@link Enum|enum} of the specified name.\r\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\r\n * @param {string} name Nested enum name\r\n * @returns {Object.} Enum values\r\n * @throws {Error} If there is no such enum\r\n */\r\nNamespace.prototype.getEnum = function getEnum(name) {\r\n if (this.nested && this.nested[name] instanceof Enum)\r\n return this.nested[name].values;\r\n throw Error(\"no such enum: \" + name);\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespace.prototype.add = function add(object) {\r\n\r\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\r\n throw TypeError(\"object must be a valid nested object\");\r\n\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.nestedArray;\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespace.prototype.remove = function remove(object) {\r\n\r\n if (!(object instanceof ReflectionObject))\r\n throw TypeError(\"object must be a ReflectionObject\");\r\n if (object.parent !== this)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespace.prototype.define = function define(path, json) {\r\n\r\n if (util.isString(path))\r\n path = path.split(\".\");\r\n else if (!Array.isArray(path))\r\n throw TypeError(\"illegal path\");\r\n if (path && path.length && path[0] === \"\")\r\n throw Error(\"path must be relative\");\r\n\r\n var ptr = this;\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespace.prototype.resolveAll = function resolveAll() {\r\n var nested = this.nestedArray, i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return this.resolve();\r\n};\r\n\r\n/**\r\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\r\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\r\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\r\n */\r\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\r\n\r\n /* istanbul ignore next */\r\n if (typeof filterTypes === \"boolean\") {\r\n parentAlreadyChecked = filterTypes;\r\n filterTypes = undefined;\r\n } else if (filterTypes && !Array.isArray(filterTypes))\r\n filterTypes = [ filterTypes ];\r\n\r\n if (util.isString(path) && path.length) {\r\n if (path === \".\")\r\n return this.root;\r\n path = path.split(\".\");\r\n } else if (!path.length)\r\n return this;\r\n\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.root.lookup(path.slice(1), filterTypes);\r\n\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found) {\r\n if (path.length === 1) {\r\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\r\n return found;\r\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\r\n return found;\r\n\r\n // Otherwise try each nested namespace\r\n } else\r\n for (var i = 0; i < this.nestedArray.length; ++i)\r\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\r\n return found;\r\n\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path, filterTypes);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @name NamespaceBase#lookup\r\n * @function\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\r\n * @variation 2\r\n */\r\n// lookup(path: string, [parentAlreadyChecked: boolean])\r\n\r\n/**\r\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Type} Looked up type\r\n * @throws {Error} If `path` does not point to a type\r\n */\r\nNamespace.prototype.lookupType = function lookupType(path) {\r\n var found = this.lookup(path, [ Type ]);\r\n if (!found)\r\n throw Error(\"no such type: \" + path);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Enum} Looked up enum\r\n * @throws {Error} If `path` does not point to an enum\r\n */\r\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\r\n var found = this.lookup(path, [ Enum ]);\r\n if (!found)\r\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Type} Looked up type or enum\r\n * @throws {Error} If `path` does not point to a type or enum\r\n */\r\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\r\n var found = this.lookup(path, [ Type, Enum ]);\r\n if (!found)\r\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n/**\r\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\r\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\r\n * @param {string|string[]} path Path to look up\r\n * @returns {Service} Looked up service\r\n * @throws {Error} If `path` does not point to a service\r\n */\r\nNamespace.prototype.lookupService = function lookupService(path) {\r\n var found = this.lookup(path, [ Service ]);\r\n if (!found)\r\n throw Error(\"no such Service '\" + path + \"' in \" + this);\r\n return found;\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nNamespace._configure = function(Type_, Service_, Enum_) {\r\n Type = Type_;\r\n Service = Service_;\r\n Enum = Enum_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.className = \"ReflectionObject\";\r\n\r\nvar util = require(37);\r\n\r\nvar Root; // cyclic\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object.} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n\r\n if (!util.isString(name))\r\n throw TypeError(\"name must be a string\");\r\n\r\n if (options && !util.isObject(options))\r\n throw TypeError(\"options must be an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {Namespace|null}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n\r\n /**\r\n * Comment text, if any.\r\n * @type {string|null}\r\n */\r\n this.comment = null;\r\n\r\n /**\r\n * Defining file name.\r\n * @type {string|null}\r\n */\r\n this.filename = null;\r\n}\r\n\r\nObject.defineProperties(ReflectionObject.prototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: function() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join(\".\");\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Converts this reflection object to its descriptor representation.\r\n * @returns {Object.} Descriptor\r\n * @abstract\r\n */\r\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObject.prototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.root;\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObject.prototype.onRemove = function onRemove(parent) {\r\n var root = parent.root;\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n if (this.root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObject.prototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\r\n this.setOption(keys[i], options[keys[i]], ifNotSet);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Class name[, space, full name]\r\n */\r\nReflectionObject.prototype.toString = function toString() {\r\n var className = this.constructor.className,\r\n fullName = this.fullName;\r\n if (fullName.length)\r\n return className + \" \" + fullName;\r\n return className;\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nReflectionObject._configure = function(Root_) {\r\n Root = Root_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\n// extends ReflectionObject\r\nvar ReflectionObject = require(24);\r\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\r\n\r\nvar Field = require(16),\r\n util = require(37);\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object.} [fieldNames] Field names\r\n * @param {Object.} [options] Declared options\r\n * @param {string} [comment] Comment associated with this field\r\n */\r\nfunction OneOf(name, fieldNames, options, comment) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n\r\n /* istanbul ignore if */\r\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\r\n throw TypeError(\"fieldNames must be an Array\");\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof as an array for iteration.\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\r\n\r\n /**\r\n * Comment for this field.\r\n * @type {string|null}\r\n */\r\n this.comment = comment;\r\n}\r\n\r\n/**\r\n * Oneof descriptor.\r\n * @interface IOneOf\r\n * @property {Array.} oneof Oneof field names\r\n * @property {Object.} [options] Oneof options\r\n */\r\n\r\n/**\r\n * Constructs a oneof from a oneof descriptor.\r\n * @param {string} name Oneof name\r\n * @param {IOneOf} json Oneof descriptor\r\n * @returns {OneOf} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options, json.comment);\r\n};\r\n\r\n/**\r\n * Converts this oneof to a oneof descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IOneOf} Oneof descriptor\r\n */\r\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , this.options,\r\n \"oneof\" , this.oneof,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\r\n if (!oneof.fieldsArray[i].parent)\r\n oneof.parent.add(oneof.fieldsArray[i]);\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof and removes it from its current parent, if any.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOf.prototype.add = function add(field) {\r\n\r\n /* istanbul ignore if */\r\n if (!(field instanceof Field))\r\n throw TypeError(\"field must be a Field\");\r\n\r\n if (field.parent && field.parent !== this.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this.fieldsArray.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof and puts it back to the oneof's parent.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOf.prototype.remove = function remove(field) {\r\n\r\n /* istanbul ignore if */\r\n if (!(field instanceof Field))\r\n throw TypeError(\"field must be a Field\");\r\n\r\n var index = this.fieldsArray.indexOf(field);\r\n\r\n /* istanbul ignore if */\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n\r\n this.fieldsArray.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n\r\n /* istanbul ignore else */\r\n if (index > -1) // theoretical\r\n this.oneof.splice(index, 1);\r\n\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOf.prototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n var self = this;\r\n // Collect present fields\r\n for (var i = 0; i < this.oneof.length; ++i) {\r\n var field = parent.get(this.oneof[i]);\r\n if (field && !field.partOf) {\r\n field.partOf = self;\r\n self.fieldsArray.push(field);\r\n }\r\n }\r\n // Add not yet present fields\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOf.prototype.onRemove = function onRemove(parent) {\r\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\r\n if ((field = this.fieldsArray[i]).parent)\r\n field.parent.remove(field);\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\r\n * @typedef OneOfDecorator\r\n * @type {function}\r\n * @param {Object} prototype Target prototype\r\n * @param {string} oneofName OneOf name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * OneOf decorator (TypeScript).\r\n * @function\r\n * @param {...string} fieldNames Field names\r\n * @returns {OneOfDecorator} Decorator function\r\n * @template T extends string\r\n */\r\nOneOf.d = function decorateOneOf() {\r\n var fieldNames = new Array(arguments.length),\r\n index = 0;\r\n while (index < arguments.length)\r\n fieldNames[index] = arguments[index++];\r\n return function oneOfDecorator(prototype, oneofName) {\r\n util.decorateType(prototype.constructor)\r\n .add(new OneOf(oneofName, fieldNames));\r\n Object.defineProperty(prototype, oneofName, {\r\n get: util.oneOfGetter(fieldNames),\r\n set: util.oneOfSetter(fieldNames)\r\n });\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nparse.filename = null;\r\nparse.defaults = { keepCase: false };\r\n\r\nvar tokenize = require(34),\r\n Root = require(29),\r\n Type = require(35),\r\n Field = require(16),\r\n MapField = require(20),\r\n OneOf = require(25),\r\n Enum = require(15),\r\n Service = require(33),\r\n Method = require(22),\r\n types = require(36),\r\n util = require(37);\r\n\r\nvar base10Re = /^[1-9][0-9]*$/,\r\n base10NegRe = /^-?[1-9][0-9]*$/,\r\n base16Re = /^0[x][0-9a-fA-F]+$/,\r\n base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\r\n base8Re = /^0[0-7]+$/,\r\n base8NegRe = /^-?0[0-7]+$/,\r\n numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\r\n nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @interface IParserResult\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Options modifying the behavior of {@link parse}.\r\n * @interface IParseOptions\r\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\r\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\r\n */\r\n\r\n/**\r\n * Options modifying the behavior of JSON serialization.\r\n * @interface IToJSONOptions\r\n * @property {boolean} [keepComments=false] Serializes comments.\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} root Root to populate\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {IParserResult} Parser result\r\n * @property {string} filename=null Currently processing file name for error reporting, if known\r\n * @property {IParseOptions} defaults Default {@link IParseOptions}\r\n */\r\nfunction parse(source, root, options) {\r\n /* eslint-disable callback-return */\r\n if (!(root instanceof Root)) {\r\n options = root;\r\n root = new Root();\r\n }\r\n if (!options)\r\n options = parse.defaults;\r\n\r\n var tn = tokenize(source, options.alternateCommentMode || false),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip,\r\n cmnt = tn.cmnt;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n var ptr = root;\r\n\r\n var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\r\n\r\n /* istanbul ignore next */\r\n function illegal(token, name, insideTryCatch) {\r\n var filename = parse.filename;\r\n if (!insideTryCatch)\r\n parse.filename = null;\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n /* istanbul ignore if */\r\n if ((token = next()) !== \"\\\"\" && token !== \"'\")\r\n throw illegal(token);\r\n\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === \"\\\"\" || token === \"'\");\r\n return values.join(\"\");\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (token) {\r\n case \"'\":\r\n case \"\\\"\":\r\n push(token);\r\n return readString();\r\n case \"true\": case \"TRUE\":\r\n return true;\r\n case \"false\": case \"FALSE\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token, /* insideTryCatch */ true);\r\n } catch (e) {\r\n\r\n /* istanbul ignore else */\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n\r\n /* istanbul ignore next */\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRanges(target, acceptStrings) {\r\n var token, start;\r\n do {\r\n if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\"))\r\n target.push(readString());\r\n else\r\n target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\r\n } while (skip(\",\", true));\r\n skip(\";\");\r\n }\r\n\r\n function parseNumber(token, insideTryCatch) {\r\n var sign = 1;\r\n if (token.charAt(0) === \"-\") {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n switch (token) {\r\n case \"inf\": case \"INF\": case \"Inf\":\r\n return sign * Infinity;\r\n case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\r\n return NaN;\r\n case \"0\":\r\n return 0;\r\n }\r\n if (base10Re.test(token))\r\n return sign * parseInt(token, 10);\r\n if (base16Re.test(token))\r\n return sign * parseInt(token, 16);\r\n if (base8Re.test(token))\r\n return sign * parseInt(token, 8);\r\n\r\n /* istanbul ignore else */\r\n if (numberRe.test(token))\r\n return sign * parseFloat(token);\r\n\r\n /* istanbul ignore next */\r\n throw illegal(token, \"number\", insideTryCatch);\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n switch (token) {\r\n case \"max\": case \"MAX\": case \"Max\":\r\n return 536870911;\r\n case \"0\":\r\n return 0;\r\n }\r\n\r\n /* istanbul ignore if */\r\n if (!acceptNegative && token.charAt(0) === \"-\")\r\n throw illegal(token, \"id\");\r\n\r\n if (base10NegRe.test(token))\r\n return parseInt(token, 10);\r\n if (base16NegRe.test(token))\r\n return parseInt(token, 16);\r\n\r\n /* istanbul ignore else */\r\n if (base8NegRe.test(token))\r\n return parseInt(token, 8);\r\n\r\n /* istanbul ignore next */\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n\r\n /* istanbul ignore if */\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n\r\n pkg = next();\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, \"name\");\r\n\r\n ptr = ptr.define(pkg);\r\n skip(\";\");\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(\";\");\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = readString();\r\n isProto3 = syntax === \"proto3\";\r\n\r\n /* istanbul ignore if */\r\n if (!isProto3 && syntax !== \"proto2\")\r\n throw illegal(syntax, \"syntax\");\r\n\r\n skip(\";\");\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case \"option\":\r\n parseOption(parent, token);\r\n skip(\";\");\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function ifBlock(obj, fnIf, fnElse) {\r\n var trailingLine = tn.line;\r\n if (obj) {\r\n obj.comment = cmnt(); // try block-type comment\r\n obj.filename = parse.filename;\r\n }\r\n if (skip(\"{\", true)) {\r\n var token;\r\n while ((token = next()) !== \"}\")\r\n fnIf(token);\r\n skip(\";\", true);\r\n } else {\r\n if (fnElse)\r\n fnElse();\r\n skip(\";\");\r\n if (obj && typeof obj.comment !== \"string\")\r\n obj.comment = cmnt(trailingLine); // try line-type comment if no block\r\n }\r\n }\r\n\r\n function parseType(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"type name\");\r\n\r\n var type = new Type(token);\r\n ifBlock(type, function parseType_block(token) {\r\n if (parseCommon(type, token))\r\n return;\r\n\r\n switch (token) {\r\n\r\n case \"map\":\r\n parseMapField(type, token);\r\n break;\r\n\r\n case \"required\":\r\n case \"optional\":\r\n case \"repeated\":\r\n parseField(type, token);\r\n break;\r\n\r\n case \"oneof\":\r\n parseOneOf(type, token);\r\n break;\r\n\r\n case \"extensions\":\r\n readRanges(type.extensions || (type.extensions = []));\r\n break;\r\n\r\n case \"reserved\":\r\n readRanges(type.reserved || (type.reserved = []), true);\r\n break;\r\n\r\n default:\r\n /* istanbul ignore if */\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n\r\n push(token);\r\n parseField(type, \"optional\");\r\n break;\r\n }\r\n });\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (type === \"group\") {\r\n parseGroup(parent, rule);\r\n return;\r\n }\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, \"type\");\r\n\r\n var name = next();\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"name\");\r\n\r\n name = applyCase(name);\r\n skip(\"=\");\r\n\r\n var field = new Field(name, parseId(next()), type, rule, extend);\r\n ifBlock(field, function parseField_block(token) {\r\n\r\n /* istanbul ignore else */\r\n if (token === \"option\") {\r\n parseOption(field, token);\r\n skip(\";\");\r\n } else\r\n throw illegal(token);\r\n\r\n }, function parseField_line() {\r\n parseInlineOptions(field);\r\n });\r\n parent.add(field);\r\n\r\n // JSON defaults to packed=true if not set so we have to set packed=false explicity when\r\n // parsing proto2 descriptors without the option, where applicable. This must be done for\r\n // all known packable types and anything that could be an enum (= is not a basic type).\r\n if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))\r\n field.setOption(\"packed\", false, /* ifNotSet */ true);\r\n }\r\n\r\n function parseGroup(parent, rule) {\r\n var name = next();\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"name\");\r\n\r\n var fieldName = util.lcFirst(name);\r\n if (name === fieldName)\r\n name = util.ucFirst(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var type = new Type(name);\r\n type.group = true;\r\n var field = new Field(fieldName, id, name, rule);\r\n field.filename = parse.filename;\r\n ifBlock(type, function parseGroup_block(token) {\r\n switch (token) {\r\n\r\n case \"option\":\r\n parseOption(type, token);\r\n skip(\";\");\r\n break;\r\n\r\n case \"required\":\r\n case \"optional\":\r\n case \"repeated\":\r\n parseField(type, token);\r\n break;\r\n\r\n /* istanbul ignore next */\r\n default:\r\n throw illegal(token); // there are no groups with proto3 semantics\r\n }\r\n });\r\n parent.add(type)\r\n .add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n\r\n /* istanbul ignore if */\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, \"type\");\r\n\r\n skip(\",\");\r\n var valueType = next();\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, \"type\");\r\n\r\n skip(\">\");\r\n var name = next();\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"name\");\r\n\r\n skip(\"=\");\r\n var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\r\n ifBlock(field, function parseMapField_block(token) {\r\n\r\n /* istanbul ignore else */\r\n if (token === \"option\") {\r\n parseOption(field, token);\r\n skip(\";\");\r\n } else\r\n throw illegal(token);\r\n\r\n }, function parseMapField_line() {\r\n parseInlineOptions(field);\r\n });\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n var oneof = new OneOf(applyCase(token));\r\n ifBlock(oneof, function parseOneOf_block(token) {\r\n if (token === \"option\") {\r\n parseOption(oneof, token);\r\n skip(\";\");\r\n } else {\r\n push(token);\r\n parseField(oneof, \"optional\");\r\n }\r\n });\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n var enm = new Enum(token);\r\n ifBlock(enm, function parseEnum_block(token) {\r\n switch(token) {\r\n case \"option\":\r\n parseOption(enm, token);\r\n skip(\";\");\r\n break;\r\n\r\n case \"reserved\":\r\n readRanges(enm.reserved || (enm.reserved = []), true);\r\n break;\r\n\r\n default:\r\n parseEnumValue(enm, token);\r\n }\r\n });\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumValue(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"name\");\r\n\r\n skip(\"=\");\r\n var value = parseId(next(), true),\r\n dummy = {};\r\n ifBlock(dummy, function parseEnumValue_block(token) {\r\n\r\n /* istanbul ignore else */\r\n if (token === \"option\") {\r\n parseOption(dummy, token); // skip\r\n skip(\";\");\r\n } else\r\n throw illegal(token);\r\n\r\n }, function parseEnumValue_line() {\r\n parseInlineOptions(dummy); // skip\r\n });\r\n parent.add(token, value, dummy.comment);\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var isCustom = skip(\"(\", true);\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n var name = token;\r\n if (isCustom) {\r\n skip(\")\");\r\n name = \"(\" + name + \")\";\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(\"{\", true)) { // { a: \"foo\" b { c: \"bar\" } }\r\n do {\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n if (peek() === \"{\")\r\n parseOptionValue(parent, name + \".\" + token);\r\n else {\r\n skip(\":\");\r\n if (peek() === \"{\")\r\n parseOptionValue(parent, name + \".\" + token);\r\n else\r\n setOption(parent, name + \".\" + token, readValue(true));\r\n }\r\n skip(\",\", true);\r\n } while (!skip(\"}\", true));\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, \"option\");\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"service name\");\r\n\r\n var service = new Service(token);\r\n ifBlock(service, function parseService_block(token) {\r\n if (parseCommon(service, token))\r\n return;\r\n\r\n /* istanbul ignore else */\r\n if (token === \"rpc\")\r\n parseMethod(service, token);\r\n else\r\n throw illegal(token);\r\n });\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n\r\n /* istanbul ignore if */\r\n if (!nameRe.test(token = next()))\r\n throw illegal(token, \"name\");\r\n\r\n var name = token,\r\n requestType, requestStream,\r\n responseType, responseStream;\r\n\r\n skip(\"(\");\r\n if (skip(\"stream\", true))\r\n requestStream = true;\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n\r\n requestType = token;\r\n skip(\")\"); skip(\"returns\"); skip(\"(\");\r\n if (skip(\"stream\", true))\r\n responseStream = true;\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n\r\n responseType = token;\r\n skip(\")\");\r\n\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n ifBlock(method, function parseMethod_block(token) {\r\n\r\n /* istanbul ignore else */\r\n if (token === \"option\") {\r\n parseOption(method, token);\r\n skip(\";\");\r\n } else\r\n throw illegal(token);\r\n\r\n });\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n\r\n /* istanbul ignore if */\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token, \"reference\");\r\n\r\n var reference = token;\r\n ifBlock(null, function parseExtension_block(token) {\r\n switch (token) {\r\n\r\n case \"required\":\r\n case \"repeated\":\r\n case \"optional\":\r\n parseField(parent, token, reference);\r\n break;\r\n\r\n default:\r\n /* istanbul ignore if */\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, \"optional\", reference);\r\n break;\r\n }\r\n });\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n switch (token) {\r\n\r\n case \"package\":\r\n\r\n /* istanbul ignore if */\r\n if (!head)\r\n throw illegal(token);\r\n\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n\r\n /* istanbul ignore if */\r\n if (!head)\r\n throw illegal(token);\r\n\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n\r\n /* istanbul ignore if */\r\n if (!head)\r\n throw illegal(token);\r\n\r\n parseSyntax();\r\n break;\r\n\r\n case \"option\":\r\n\r\n /* istanbul ignore if */\r\n if (!head)\r\n throw illegal(token);\r\n\r\n parseOption(ptr, token);\r\n skip(\";\");\r\n break;\r\n\r\n default:\r\n\r\n /* istanbul ignore else */\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n\r\n /* istanbul ignore next */\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n parse.filename = null;\r\n return {\r\n \"package\" : pkg,\r\n \"imports\" : imports,\r\n weakImports : weakImports,\r\n syntax : syntax,\r\n root : root\r\n };\r\n}\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @name parse\r\n * @function\r\n * @param {string} source Source contents\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {IParserResult} Parser result\r\n * @property {string} filename=null Currently processing file name for error reporting, if known\r\n * @property {IParseOptions} defaults Default {@link IParseOptions}\r\n * @variation 2\r\n */\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nvar util = require(39);\r\n\r\nvar BufferReader; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n utf8 = util.utf8;\r\n\r\n/* istanbul ignore next */\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n\r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\nvar create_array = typeof Uint8Array !== \"undefined\"\r\n ? function create_typed_array(buffer) {\r\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n }\r\n /* istanbul ignore next */\r\n : function create_array(buffer) {\r\n if (Array.isArray(buffer))\r\n return new Reader(buffer);\r\n throw Error(\"illegal buffer\");\r\n };\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @function\r\n * @param {Uint8Array|Buffer} buffer Buffer to read from\r\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n * @throws {Error} If `buffer` is not a valid buffer\r\n */\r\nReader.create = util.Buffer\r\n ? function create_buffer_setup(buffer) {\r\n return (Reader.create = function create_buffer(buffer) {\r\n return util.Buffer.isBuffer(buffer)\r\n ? new BufferReader(buffer)\r\n /* istanbul ignore next */\r\n : create_array(buffer);\r\n })(buffer);\r\n }\r\n /* istanbul ignore next */\r\n : create_array;\r\n\r\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.uint32 = (function read_uint32_setup() {\r\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\r\n return function read_uint32() {\r\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\r\n\r\n /* istanbul ignore if */\r\n if ((this.pos += 5) > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this, 10);\r\n }\r\n return value;\r\n };\r\n})();\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.int32 = function read_int32() {\r\n return this.uint32() | 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sint32 = function read_sint32() {\r\n var value = this.uint32();\r\n return value >>> 1 ^ -(value & 1) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n // tends to deopt with local vars for octet etc.\r\n var bits = new LongBits(0, 0);\r\n var i = 0;\r\n if (this.len - this.pos > 4) { // fast route (lo)\r\n for (; i < 4; ++i) {\r\n // 1st..4th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 5th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n i = 0;\r\n } else {\r\n for (; i < 3; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 1st..3th\r\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n // 4th\r\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\r\n return bits;\r\n }\r\n if (this.len - this.pos > 4) { // fast route (hi)\r\n for (; i < 5; ++i) {\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n } else {\r\n for (; i < 5; ++i) {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n // 6th..10th\r\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\r\n if (this.buf[this.pos++] < 128)\r\n return bits;\r\n }\r\n }\r\n /* istanbul ignore next */\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReader.prototype.bool = function read_bool() {\r\n return this.uint32() !== 0;\r\n};\r\n\r\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\r\n return (buf[end - 4]\r\n | buf[end - 3] << 8\r\n | buf[end - 2] << 16\r\n | buf[end - 1] << 24) >>> 0;\r\n}\r\n\r\n/**\r\n * Reads fixed 32 bits as an unsigned 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.fixed32 = function read_fixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4);\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a signed 32 bit integer.\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.sfixed32 = function read_sfixed32() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n return readFixed32_end(this.buf, this.pos += 4) | 0;\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readFixed64(/* this: Reader */) {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n\r\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long} Value read\r\n */\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.float = function read_float() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readFloatLE(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReader.prototype.double = function read_double() {\r\n\r\n /* istanbul ignore if */\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n\r\n var value = util.float.readDoubleLE(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReader.prototype.bytes = function read_bytes() {\r\n var length = this.uint32(),\r\n start = this.pos,\r\n end = this.pos + length;\r\n\r\n /* istanbul ignore if */\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n\r\n this.pos += length;\r\n if (Array.isArray(this.buf)) // plain array\r\n return this.buf.slice(start, end);\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReader.prototype.string = function read_string() {\r\n var bytes = this.bytes();\r\n return utf8.read(bytes, 0, bytes.length);\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skip = function skip(length) {\r\n if (typeof length === \"number\") {\r\n /* istanbul ignore if */\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n } else {\r\n do {\r\n /* istanbul ignore if */\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReader.prototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n while ((wireType = this.uint32() & 7) !== 4) {\r\n this.skipType(wireType);\r\n }\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n\r\n /* istanbul ignore next */\r\n default:\r\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\r\n }\r\n return this;\r\n};\r\n\r\nReader._configure = function(BufferReader_) {\r\n BufferReader = BufferReader_;\r\n\r\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\r\n util.merge(Reader.prototype, {\r\n\r\n int64: function read_int64() {\r\n return readLongVarint.call(this)[fn](false);\r\n },\r\n\r\n uint64: function read_uint64() {\r\n return readLongVarint.call(this)[fn](true);\r\n },\r\n\r\n sint64: function read_sint64() {\r\n return readLongVarint.call(this).zzDecode()[fn](false);\r\n },\r\n\r\n fixed64: function read_fixed64() {\r\n return readFixed64.call(this)[fn](true);\r\n },\r\n\r\n sfixed64: function read_sfixed64() {\r\n return readFixed64.call(this)[fn](false);\r\n }\r\n\r\n });\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferReader;\r\n\r\n// extends Reader\r\nvar Reader = require(27);\r\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\r\n\r\nvar util = require(39);\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n Reader.call(this, buffer);\r\n\r\n /**\r\n * Read buffer.\r\n * @name BufferReader#buf\r\n * @type {Buffer}\r\n */\r\n}\r\n\r\n/* istanbul ignore else */\r\nif (util.Buffer)\r\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReader.prototype.string = function read_string_buffer() {\r\n var len = this.uint32(); // modifies pos\r\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @name BufferReader#bytes\r\n * @function\r\n * @returns {Buffer} Value read\r\n */\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\n// extends Namespace\r\nvar Namespace = require(23);\r\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\r\n\r\nvar Field = require(16),\r\n Enum = require(15),\r\n OneOf = require(25),\r\n util = require(37);\r\n\r\nvar Type, // cyclic\r\n parse, // might be excluded\r\n common; // \"\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {Object.} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files.\r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a namespace descriptor into a root namespace.\r\n * @param {INamespace} json Nameespace descriptor\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n if (json.options)\r\n root.setOptions(json.options);\r\n return root.addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\r\n */\r\nRoot.prototype.resolvePath = util.path.resolve;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\n/* istanbul ignore next */\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} options Parse options\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nRoot.prototype.load = function load(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = undefined;\r\n }\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename, options);\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n /* istanbul ignore if */\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n if (sync)\r\n throw err;\r\n cb(err, root);\r\n }\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n parse.filename = filename;\r\n var parsed = parse(source, self, options),\r\n resolved,\r\n i = 0;\r\n if (parsed.imports)\r\n for (; i < parsed.imports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\r\n fetch(resolved);\r\n if (parsed.weakImports)\r\n for (i = 0; i < parsed.weakImports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\r\n fetch(resolved, true);\r\n }\r\n } catch (err) {\r\n finish(err);\r\n }\r\n if (!sync && !queued)\r\n finish(null, self); // only once anyway\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.lastIndexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded / attempted\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n /* istanbul ignore if */\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n /* istanbul ignore else */\r\n if (!weak)\r\n finish(err);\r\n else if (!queued) // can't be covered reliably\r\n finish(null, self);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n for (var i = 0, resolved; i < filename.length; ++i)\r\n if (resolved = self.resolvePath(\"\", filename[i]))\r\n fetch(resolved);\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @function Root#load\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @function Root#load\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [options:IParseOptions]):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\r\n * @function Root#loadSync\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRoot.prototype.loadSync = function loadSync(filename, options) {\r\n if (!util.isNode)\r\n throw Error(\"not supported\");\r\n return this.load(filename, options, SYNC);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRoot.prototype.resolveAll = function resolveAll() {\r\n if (this.deferred.length)\r\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\r\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\r\n }).join(\", \"));\r\n return Namespace.prototype.resolveAll.call(this);\r\n};\r\n\r\n// only uppercased (and thus conflict-free) children are exposed, see below\r\nvar exposeRe = /^[A-Z]/;\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Root} root Root instance\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction tryHandleExtension(root, field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRoot.prototype._handleAdd = function _handleAdd(object) {\r\n if (object instanceof Field) {\r\n\r\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\r\n if (!tryHandleExtension(this, object))\r\n this.deferred.push(object);\r\n\r\n } else if (object instanceof Enum) {\r\n\r\n if (exposeRe.test(object.name))\r\n object.parent[object.name] = object.values; // expose enum values as property of its parent\r\n\r\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\r\n\r\n if (object instanceof Type) // Try to handle any deferred extensions\r\n for (var i = 0; i < this.deferred.length;)\r\n if (tryHandleExtension(this, this.deferred[i]))\r\n this.deferred.splice(i, 1);\r\n else\r\n ++i;\r\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\r\n this._handleAdd(object._nestedArray[j]);\r\n if (exposeRe.test(object.name))\r\n object.parent[object.name] = object; // expose namespace as property of its parent\r\n }\r\n\r\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\r\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\r\n // a static module with reflection-based solutions where the condition is met.\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRoot.prototype._handleRemove = function _handleRemove(object) {\r\n if (object instanceof Field) {\r\n\r\n if (/* an extension field */ object.extend !== undefined) {\r\n if (/* already handled */ object.extensionField) { // remove its sister field\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n } else { // cancel the extension\r\n var index = this.deferred.indexOf(object);\r\n /* istanbul ignore else */\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n }\r\n\r\n } else if (object instanceof Enum) {\r\n\r\n if (exposeRe.test(object.name))\r\n delete object.parent[object.name]; // unexpose enum values\r\n\r\n } else if (object instanceof Namespace) {\r\n\r\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\r\n this._handleRemove(object._nestedArray[i]);\r\n\r\n if (exposeRe.test(object.name))\r\n delete object.parent[object.name]; // unexpose namespaces\r\n\r\n }\r\n};\r\n\r\n// Sets up cyclic dependencies (called in index-light)\r\nRoot._configure = function(Type_, parse_, common_) {\r\n Type = Type_;\r\n parse = parse_;\r\n common = common_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = {};\r\n\r\n/**\r\n * Named roots.\r\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\r\n * Can also be used manually to make roots available accross modules.\r\n * @name roots\r\n * @type {Object.}\r\n * @example\r\n * // pbjs -r myroot -o compiled.js ...\r\n *\r\n * // in another module:\r\n * require(\"./compiled.js\");\r\n *\r\n * // in any subsequent module:\r\n * var root = protobuf.roots[\"myroot\"];\r\n */\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCImplCallback} callback Callback function\r\n * @returns {undefined}\r\n * @example\r\n * function rpcImpl(method, requestData, callback) {\r\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\r\n * throw Error(\"no such method\");\r\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\r\n * callback(err, responseData);\r\n * });\r\n * }\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCImplCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any, otherwise `null`\r\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\nrpc.Service = require(32);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar util = require(39);\r\n\r\n// Extends EventEmitter\r\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\r\n\r\n/**\r\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\r\n *\r\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\r\n * @typedef rpc.ServiceMethodCallback\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {TRes} [response] Response message\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\r\n * @typedef rpc.ServiceMethod\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n * @type {function}\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\r\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\r\n */\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @exports rpc.Service\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n */\r\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\r\n\r\n if (typeof rpcImpl !== \"function\")\r\n throw TypeError(\"rpcImpl must be a function\");\r\n\r\n util.EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` once the service is ended.\r\n * @type {RPCImpl|null}\r\n */\r\n this.rpcImpl = rpcImpl;\r\n\r\n /**\r\n * Whether requests are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.requestDelimited = Boolean(requestDelimited);\r\n\r\n /**\r\n * Whether responses are length-delimited.\r\n * @type {boolean}\r\n */\r\n this.responseDelimited = Boolean(responseDelimited);\r\n}\r\n\r\n/**\r\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\r\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\r\n * @param {Constructor} requestCtor Request constructor\r\n * @param {Constructor} responseCtor Response constructor\r\n * @param {TReq|Properties} request Request message or plain object\r\n * @param {rpc.ServiceMethodCallback} callback Service callback\r\n * @returns {undefined}\r\n * @template TReq extends Message\r\n * @template TRes extends Message\r\n */\r\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\r\n\r\n if (!request)\r\n throw TypeError(\"request must be specified\");\r\n\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\r\n\r\n if (!self.rpcImpl) {\r\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\r\n return undefined;\r\n }\r\n\r\n try {\r\n return self.rpcImpl(\r\n method,\r\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\r\n function rpcCallback(err, response) {\r\n\r\n if (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n\r\n if (response === null) {\r\n self.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n\r\n if (!(response instanceof responseCtor)) {\r\n try {\r\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n return callback(err);\r\n }\r\n }\r\n\r\n self.emit(\"data\", response, method);\r\n return callback(null, response);\r\n }\r\n );\r\n } catch (err) {\r\n self.emit(\"error\", err, method);\r\n setTimeout(function() { callback(err); }, 0);\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nService.prototype.end = function end(endedByRPC) {\r\n if (this.rpcImpl) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.rpcImpl(null, null, null);\r\n this.rpcImpl = null;\r\n this.emit(\"end\").off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\n// extends Namespace\r\nvar Namespace = require(23);\r\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\r\n\r\nvar Method = require(22),\r\n util = require(37),\r\n rpc = require(31);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {Method[]|null}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\n/**\r\n * Service descriptor.\r\n * @interface IService\r\n * @extends INamespace\r\n * @property {Object.} methods Method descriptors\r\n */\r\n\r\n/**\r\n * Constructs a service from a service descriptor.\r\n * @param {string} name Service name\r\n * @param {IService} json Service descriptor\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n /* istanbul ignore else */\r\n if (json.methods)\r\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\r\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\r\n if (json.nested)\r\n service.addJSON(json.nested);\r\n service.comment = json.comment;\r\n return service;\r\n};\r\n\r\n/**\r\n * Converts this service to a service descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IService} Service descriptor\r\n */\r\nService.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , inherited && inherited.options || undefined,\r\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\r\n \"nested\" , inherited && inherited.nested || undefined,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\nObject.defineProperty(Service.prototype, \"methodsArray\", {\r\n get: function() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.get = function get(name) {\r\n return this.methods[name]\r\n || Namespace.prototype.get.call(this, name);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.resolveAll = function resolveAll() {\r\n var methods = this.methodsArray;\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return Namespace.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.add = function add(object) {\r\n\r\n /* istanbul ignore if */\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nService.prototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n\r\n /* istanbul ignore if */\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\r\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\r\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\r\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\r\n m: method,\r\n q: method.resolvedRequestType.ctor,\r\n s: method.resolvedResponseType.ctor\r\n });\r\n }\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\nvar setCommentRe = /^ *[*/]+ */,\r\n setCommentAltRe = /^\\s*\\*?\\/*/,\r\n setCommentSplitRe = /\\n/g,\r\n whitespaceRe = /\\s/,\r\n unescapeRe = /\\\\(.?)/g;\r\n\r\nvar unescapeMap = {\r\n \"0\": \"\\0\",\r\n \"r\": \"\\r\",\r\n \"n\": \"\\n\",\r\n \"t\": \"\\t\"\r\n};\r\n\r\n/**\r\n * Unescapes a string.\r\n * @param {string} str String to unescape\r\n * @returns {string} Unescaped string\r\n * @property {Object.} map Special characters map\r\n * @memberof tokenize\r\n */\r\nfunction unescape(str) {\r\n return str.replace(unescapeRe, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n default:\r\n return unescapeMap[$1] || \"\";\r\n }\r\n });\r\n}\r\n\r\ntokenize.unescape = unescape;\r\n\r\n/**\r\n * Gets the next token and advances.\r\n * @typedef TokenizerHandleNext\r\n * @type {function}\r\n * @returns {string|null} Next token or `null` on eof\r\n */\r\n\r\n/**\r\n * Peeks for the next token.\r\n * @typedef TokenizerHandlePeek\r\n * @type {function}\r\n * @returns {string|null} Next token or `null` on eof\r\n */\r\n\r\n/**\r\n * Pushes a token back to the stack.\r\n * @typedef TokenizerHandlePush\r\n * @type {function}\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Skips the next token.\r\n * @typedef TokenizerHandleSkip\r\n * @type {function}\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] If optional\r\n * @returns {boolean} Whether the token matched\r\n * @throws {Error} If the token didn't match and is not optional\r\n */\r\n\r\n/**\r\n * Gets the comment on the previous line or, alternatively, the line comment on the specified line.\r\n * @typedef TokenizerHandleCmnt\r\n * @type {function}\r\n * @param {number} [line] Line number\r\n * @returns {string|null} Comment text or `null` if none\r\n */\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @interface ITokenizerHandle\r\n * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof)\r\n * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof)\r\n * @property {TokenizerHandlePush} push Pushes a token back to the stack\r\n * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any\r\n * @property {number} line Current line number\r\n */\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode.\r\n * @returns {ITokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source, alternateCommentMode) {\r\n /* eslint-disable callback-return */\r\n source = source.toString();\r\n\r\n var offset = 0,\r\n length = source.length,\r\n line = 1,\r\n commentType = null,\r\n commentText = null,\r\n commentLine = 0,\r\n commentLineEmpty = false;\r\n\r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /* istanbul ignore next */\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === \"'\" ? stringSingleRe : stringDoubleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Sets the current comment text.\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function setComment(start, end) {\r\n commentType = source.charAt(start++);\r\n commentLine = line;\r\n commentLineEmpty = false;\r\n var lookback;\r\n if (alternateCommentMode) {\r\n lookback = 2; // alternate comment parsing: \"//\" or \"/*\"\r\n } else {\r\n lookback = 3; // \"///\" or \"/**\"\r\n }\r\n var commentOffset = start - lookback,\r\n c;\r\n do {\r\n if (--commentOffset < 0 ||\r\n (c = source.charAt(commentOffset)) === \"\\n\") {\r\n commentLineEmpty = true;\r\n break;\r\n }\r\n } while (c === \" \" || c === \"\\t\");\r\n var lines = source\r\n .substring(start, end)\r\n .split(setCommentSplitRe);\r\n for (var i = 0; i < lines.length; ++i)\r\n lines[i] = lines[i]\r\n .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, \"\")\r\n .trim();\r\n commentText = lines\r\n .join(\"\\n\")\r\n .trim();\r\n }\r\n\r\n function isDoubleSlashCommentLine(startOffset) {\r\n var endOffset = findEndOfLine(startOffset);\r\n\r\n // see if remaining line matches comment pattern\r\n var lineText = source.substring(startOffset, endOffset);\r\n // look for 1 or 2 slashes since startOffset would already point past\r\n // the first slash that started the comment.\r\n var isComment = /^\\s*\\/{1,2}/.test(lineText);\r\n return isComment;\r\n }\r\n\r\n function findEndOfLine(cursor) {\r\n // find end of cursor's line\r\n var endOffset = cursor;\r\n while (endOffset < length && charAt(endOffset) !== \"\\n\") {\r\n endOffset++;\r\n }\r\n return endOffset;\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {string|null} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr,\r\n start,\r\n isDoc;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (whitespaceRe.test(curr = charAt(offset))) {\r\n if (curr === \"\\n\")\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n\r\n if (charAt(offset) === \"/\") {\r\n if (++offset === length) {\r\n throw illegal(\"comment\");\r\n }\r\n if (charAt(offset) === \"/\") { // Line\r\n if (!alternateCommentMode) {\r\n // check for triple-slash comment\r\n isDoc = charAt(start = offset + 1) === \"/\";\r\n\r\n while (charAt(++offset) !== \"\\n\") {\r\n if (offset === length) {\r\n return null;\r\n }\r\n }\r\n ++offset;\r\n if (isDoc) {\r\n setComment(start, offset - 1);\r\n }\r\n ++line;\r\n repeat = true;\r\n } else {\r\n // check for double-slash comments, consolidating consecutive lines\r\n start = offset;\r\n isDoc = false;\r\n if (isDoubleSlashCommentLine(offset)) {\r\n isDoc = true;\r\n do {\r\n offset = findEndOfLine(offset);\r\n if (offset === length) {\r\n break;\r\n }\r\n offset++;\r\n } while (isDoubleSlashCommentLine(offset));\r\n } else {\r\n offset = Math.min(length, findEndOfLine(offset) + 1);\r\n }\r\n if (isDoc) {\r\n setComment(start, offset);\r\n }\r\n line++;\r\n repeat = true;\r\n }\r\n } else if ((curr = charAt(offset)) === \"*\") { /* Block */\r\n // check for /** (regular comment mode) or /* (alternate comment mode)\r\n start = offset + 1;\r\n isDoc = alternateCommentMode || charAt(start) === \"*\";\r\n do {\r\n if (curr === \"\\n\") {\r\n ++line;\r\n }\r\n if (++offset === length) {\r\n throw illegal(\"comment\");\r\n }\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== \"*\" || curr !== \"/\");\r\n ++offset;\r\n if (isDoc) {\r\n setComment(start, offset - 2);\r\n }\r\n repeat = true;\r\n } else {\r\n return \"/\";\r\n }\r\n }\r\n } while (repeat);\r\n\r\n // offset !== length if we got here\r\n\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === \"\\\"\" || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {string|null} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets a comment.\r\n * @param {number} [trailingLine] Line number if looking for a trailing comment\r\n * @returns {string|null} Comment text\r\n * @inner\r\n */\r\n function cmnt(trailingLine) {\r\n var ret = null;\r\n if (trailingLine === undefined) {\r\n if (commentLine === line - 1 && (alternateCommentMode || commentType === \"*\" || commentLineEmpty)) {\r\n ret = commentText;\r\n }\r\n } else {\r\n /* istanbul ignore else */\r\n if (commentLine < trailingLine) {\r\n peek();\r\n }\r\n if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === \"/\")) {\r\n ret = commentText;\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n return Object.defineProperty({\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip,\r\n cmnt: cmnt\r\n }, \"line\", {\r\n get: function() { return line; }\r\n });\r\n /* eslint-enable callback-return */\r\n}\r\n","\"use strict\";\r\nmodule.exports = Type;\r\n\r\n// extends Namespace\r\nvar Namespace = require(23);\r\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\r\n\r\nvar Enum = require(15),\r\n OneOf = require(25),\r\n Field = require(16),\r\n MapField = require(20),\r\n Service = require(33),\r\n Message = require(21),\r\n Reader = require(27),\r\n Writer = require(42),\r\n util = require(37),\r\n encoder = require(14),\r\n decoder = require(13),\r\n verifier = require(40),\r\n converter = require(12),\r\n wrappers = require(41);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends NamespaceBase\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object.} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {Array.}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /*?\r\n * Whether this type is a legacy group.\r\n * @type {boolean|undefined}\r\n */\r\n this.group = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {Object.|null}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {Field[]|null}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {OneOf[]|null}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {Constructor<{}>}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nObject.defineProperties(Type.prototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function() {\r\n\r\n /* istanbul ignore if */\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n\r\n this._fieldsById = {};\r\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n\r\n /* istanbul ignore if */\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\r\n * @name Type#ctor\r\n * @type {Constructor<{}>}\r\n */\r\n ctor: {\r\n get: function() {\r\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\r\n },\r\n set: function(ctor) {\r\n\r\n // Ensure proper prototype\r\n var prototype = ctor.prototype;\r\n if (!(prototype instanceof Message)) {\r\n (ctor.prototype = new Message()).constructor = ctor;\r\n util.merge(ctor.prototype, prototype);\r\n }\r\n\r\n // Classes and messages reference their reflected type\r\n ctor.$type = ctor.prototype.$type = this;\r\n\r\n // Mix in static methods\r\n util.merge(ctor, Message, true);\r\n\r\n this._ctor = ctor;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n var i = 0;\r\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\r\n this._fieldsArray[i].resolve(); // ensures a proper value\r\n\r\n // Messages have non-enumerable getters and setters for each virtual oneof field\r\n var ctorProperties = {};\r\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\r\n ctorProperties[this._oneofsArray[i].resolve().name] = {\r\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\r\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\r\n };\r\n if (i)\r\n Object.defineProperties(ctor.prototype, ctorProperties);\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Generates a constructor function for the specified type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nType.generateConstructor = function generateConstructor(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var gen = util.codegen([\"p\"], mtype.name);\r\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\r\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\r\n if ((field = mtype._fieldsArray[i]).map) gen\r\n (\"this%s={}\", util.safeProp(field.name));\r\n else if (field.repeated) gen\r\n (\"this%s=[]\", util.safeProp(field.name));\r\n return gen\r\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\r\n * @property {Object.} fields Field descriptors\r\n * @property {number[][]} [extensions] Extension ranges\r\n * @property {number[][]} [reserved] Reserved ranges\r\n * @property {boolean} [group=false] Whether a legacy group or not\r\n */\r\n\r\n/**\r\n * Creates a message type from a message type descriptor.\r\n * @param {string} name Message name\r\n * @param {IType} json Message type descriptor\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n var names = Object.keys(json.fields),\r\n i = 0;\r\n for (; i < names.length; ++i)\r\n type.add(\r\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\r\n ? MapField.fromJSON\r\n : Field.fromJSON )(names[i], json.fields[names[i]])\r\n );\r\n if (json.oneofs)\r\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\r\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\r\n if (json.nested)\r\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\r\n var nested = json.nested[names[i]];\r\n type.add( // most to least likely\r\n ( nested.id !== undefined\r\n ? Field.fromJSON\r\n : nested.fields !== undefined\r\n ? Type.fromJSON\r\n : nested.values !== undefined\r\n ? Enum.fromJSON\r\n : nested.methods !== undefined\r\n ? Service.fromJSON\r\n : Namespace.fromJSON )(names[i], nested)\r\n );\r\n }\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n if (json.group)\r\n type.group = true;\r\n if (json.comment)\r\n type.comment = json.comment;\r\n return type;\r\n};\r\n\r\n/**\r\n * Converts this message type to a message type descriptor.\r\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\r\n * @returns {IType} Message type descriptor\r\n */\r\nType.prototype.toJSON = function toJSON(toJSONOptions) {\r\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\r\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\r\n return util.toObject([\r\n \"options\" , inherited && inherited.options || undefined,\r\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\r\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\r\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\r\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\r\n \"group\" , this.group || undefined,\r\n \"nested\" , inherited && inherited.nested || undefined,\r\n \"comment\" , keepComments ? this.comment : undefined\r\n ]);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nType.prototype.resolveAll = function resolveAll() {\r\n var fields = this.fieldsArray, i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.oneofsArray; i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return Namespace.prototype.resolveAll.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nType.prototype.get = function get(name) {\r\n return this.fields[name]\r\n || this.oneofs && this.oneofs[name]\r\n || this.nested && this.nested[name]\r\n || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nType.prototype.add = function add(object) {\r\n\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n\r\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\r\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (this.isReservedId(object.id))\r\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\r\n if (this.isReservedName(object.name))\r\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\r\n\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nType.prototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n\r\n /* istanbul ignore if */\r\n if (!this.fields || this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.fields[object.name];\r\n object.parent = null;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n\r\n /* istanbul ignore if */\r\n if (!this.oneofs || this.oneofs[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n\r\n delete this.oneofs[object.name];\r\n object.parent = null;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n }\r\n return Namespace.prototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Tests if the specified id is reserved.\r\n * @param {number} id Id to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nType.prototype.isReservedId = function isReservedId(id) {\r\n return Namespace.isReservedId(this.reserved, id);\r\n};\r\n\r\n/**\r\n * Tests if the specified name is reserved.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nType.prototype.isReservedName = function isReservedName(name) {\r\n return Namespace.isReservedName(this.reserved, name);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object.} [properties] Properties to set\r\n * @returns {Message<{}>} Message instance\r\n */\r\nType.prototype.create = function create(properties) {\r\n return new this.ctor(properties);\r\n};\r\n\r\n/**\r\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\r\n * @returns {Type} `this`\r\n */\r\nType.prototype.setup = function setup() {\r\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\r\n // multiple times (V8, soft-deopt prototype-check).\r\n\r\n var fullName = this.fullName,\r\n types = [];\r\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\r\n types.push(this._fieldsArray[i].resolve().resolvedType);\r\n\r\n // Replace setup methods with type-specific generated functions\r\n this.encode = encoder(this)({\r\n Writer : Writer,\r\n types : types,\r\n util : util\r\n });\r\n this.decode = decoder(this)({\r\n Reader : Reader,\r\n types : types,\r\n util : util\r\n });\r\n this.verify = verifier(this)({\r\n types : types,\r\n util : util\r\n });\r\n this.fromObject = converter.fromObject(this)({\r\n types : types,\r\n util : util\r\n });\r\n this.toObject = converter.toObject(this)({\r\n types : types,\r\n util : util\r\n });\r\n\r\n // Inject custom wrappers for common types\r\n var wrapper = wrappers[fullName];\r\n if (wrapper) {\r\n var originalThis = Object.create(this);\r\n // if (wrapper.fromObject) {\r\n originalThis.fromObject = this.fromObject;\r\n this.fromObject = wrapper.fromObject.bind(originalThis);\r\n // }\r\n // if (wrapper.toObject) {\r\n originalThis.toObject = this.toObject;\r\n this.toObject = wrapper.toObject.bind(originalThis);\r\n // }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\r\n * @param {Message<{}>|Object.} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nType.prototype.encode = function encode_setup(message, writer) {\r\n return this.setup().encode(message, writer); // overrides this method\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\r\n * @param {Message<{}>|Object.} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message<{}>} Decoded message\r\n * @throws {Error} If the payload is not a reader or valid buffer\r\n * @throws {util.ProtocolError<{}>} If required fields are missing\r\n */\r\nType.prototype.decode = function decode_setup(reader, length) {\r\n return this.setup().decode(reader, length); // overrides this method\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\r\n * @returns {Message<{}>} Decoded message\r\n * @throws {Error} If the payload is not a reader or valid buffer\r\n * @throws {util.ProtocolError} If required fields are missing\r\n */\r\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\r\n if (!(reader instanceof Reader))\r\n reader = Reader.create(reader);\r\n return this.decode(reader, reader.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that field values are valid and that required fields are present.\r\n * @param {Object.} message Plain object to verify\r\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\r\n */\r\nType.prototype.verify = function verify_setup(message) {\r\n return this.setup().verify(message); // overrides this method\r\n};\r\n\r\n/**\r\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\r\n * @param {Object.} object Plain object to convert\r\n * @returns {Message<{}>} Message instance\r\n */\r\nType.prototype.fromObject = function fromObject(object) {\r\n return this.setup().fromObject(object);\r\n};\r\n\r\n/**\r\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\r\n * @interface IConversionOptions\r\n * @property {Function} [longs] Long conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\r\n * @property {Function} [enums] Enum value conversion type.\r\n * Only valid value is `String` (the global type).\r\n * Defaults to copy the present value, which is the numeric id.\r\n * @property {Function} [bytes] Bytes value conversion type.\r\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\r\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\r\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\r\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\r\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\r\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\r\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\r\n */\r\n\r\n/**\r\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\r\n * @param {Message<{}>} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n */\r\nType.prototype.toObject = function toObject(message, options) {\r\n return this.setup().toObject(message, options);\r\n};\r\n\r\n/**\r\n * Decorator function as returned by {@link Type.d} (TypeScript).\r\n * @typedef TypeDecorator\r\n * @type {function}\r\n * @param {Constructor} target Target constructor\r\n * @returns {undefined}\r\n * @template T extends Message\r\n */\r\n\r\n/**\r\n * Type decorator (TypeScript).\r\n * @param {string} [typeName] Type name, defaults to the constructor's name\r\n * @returns {TypeDecorator} Decorator function\r\n * @template T extends Message\r\n */\r\nType.d = function decorateType(typeName) {\r\n return function typeDecorator(target) {\r\n util.decorateType(target, typeName);\r\n };\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(37);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=1 Fixed64 wire type\r\n * @property {number} float=5 Fixed32 wire type\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n * @property {number} string=2 Ldelim wire type\r\n * @property {number} bytes=2 Ldelim wire type\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=0 Double default\r\n * @property {number} float=0 Float default\r\n * @property {number} int32=0 Int32 default\r\n * @property {number} uint32=0 Uint32 default\r\n * @property {number} sint32=0 Sint32 default\r\n * @property {number} fixed32=0 Fixed32 default\r\n * @property {number} sfixed32=0 Sfixed32 default\r\n * @property {number} int64=0 Int64 default\r\n * @property {number} uint64=0 Uint64 default\r\n * @property {number} sint64=0 Sint32 default\r\n * @property {number} fixed64=0 Fixed64 default\r\n * @property {number} sfixed64=0 Sfixed64 default\r\n * @property {boolean} bool=false Bool default\r\n * @property {string} string=\"\" String default\r\n * @property {Array.} bytes=Array(0) Bytes default\r\n * @property {null} message=null Message default\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray,\r\n /* message */ null\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n * @property {number} string=2 Ldelim wire type\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n * @const\r\n * @property {number} double=1 Fixed64 wire type\r\n * @property {number} float=5 Fixed32 wire type\r\n * @property {number} int32=0 Varint wire type\r\n * @property {number} uint32=0 Varint wire type\r\n * @property {number} sint32=0 Varint wire type\r\n * @property {number} fixed32=5 Fixed32 wire type\r\n * @property {number} sfixed32=5 Fixed32 wire type\r\n * @property {number} int64=0 Varint wire type\r\n * @property {number} uint64=0 Varint wire type\r\n * @property {number} sint64=0 Varint wire type\r\n * @property {number} fixed64=1 Fixed64 wire type\r\n * @property {number} sfixed64=1 Fixed64 wire type\r\n * @property {number} bool=0 Varint wire type\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = module.exports = require(39);\r\n\r\nvar roots = require(30);\r\n\r\nvar Type, // cyclic\r\n Enum;\r\n\r\nutil.codegen = require(3);\r\nutil.fetch = require(5);\r\nutil.path = require(8);\r\n\r\n/**\r\n * Node's fs module if available.\r\n * @type {Object.}\r\n */\r\nutil.fs = util.inquire(\"fs\");\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (object) {\r\n var keys = Object.keys(object),\r\n array = new Array(keys.length),\r\n index = 0;\r\n while (index < keys.length)\r\n array[index] = object[keys[index++]];\r\n return array;\r\n }\r\n return [];\r\n};\r\n\r\n/**\r\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\r\n * @param {Array.<*>} array Array to convert\r\n * @returns {Object.} Converted object\r\n */\r\nutil.toObject = function toObject(array) {\r\n var object = {},\r\n index = 0;\r\n while (index < array.length) {\r\n var key = array[index++],\r\n val = array[index++];\r\n if (val !== undefined)\r\n object[key] = val;\r\n }\r\n return object;\r\n};\r\n\r\nvar safePropBackslashRe = /\\\\/g,\r\n safePropQuoteRe = /\"/g;\r\n\r\n/**\r\n * Tests whether the specified name is a reserved word in JS.\r\n * @param {string} name Name to test\r\n * @returns {boolean} `true` if reserved, otherwise `false`\r\n */\r\nutil.isReserved = function isReserved(name) {\r\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified property name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\r\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\r\n return \".\" + prop;\r\n};\r\n\r\n/**\r\n * Converts the first character of a string to upper case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.ucFirst = function ucFirst(str) {\r\n return str.charAt(0).toUpperCase() + str.substring(1);\r\n};\r\n\r\nvar camelCaseRe = /_([a-z])/g;\r\n\r\n/**\r\n * Converts a string to camel case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0, 1)\r\n + str.substring(1)\r\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Compares reflected fields by id.\r\n * @param {Field} a First field\r\n * @param {Field} b Second field\r\n * @returns {number} Comparison value\r\n */\r\nutil.compareFieldsById = function compareFieldsById(a, b) {\r\n return a.id - b.id;\r\n};\r\n\r\n/**\r\n * Decorator helper for types (TypeScript).\r\n * @param {Constructor} ctor Constructor function\r\n * @param {string} [typeName] Type name, defaults to the constructor's name\r\n * @returns {Type} Reflected type\r\n * @template T extends Message\r\n * @property {Root} root Decorators root\r\n */\r\nutil.decorateType = function decorateType(ctor, typeName) {\r\n\r\n /* istanbul ignore if */\r\n if (ctor.$type) {\r\n if (typeName && ctor.$type.name !== typeName) {\r\n util.decorateRoot.remove(ctor.$type);\r\n ctor.$type.name = typeName;\r\n util.decorateRoot.add(ctor.$type);\r\n }\r\n return ctor.$type;\r\n }\r\n\r\n /* istanbul ignore next */\r\n if (!Type)\r\n Type = require(35);\r\n\r\n var type = new Type(typeName || ctor.name);\r\n util.decorateRoot.add(type);\r\n type.ctor = ctor; // sets up .encode, .decode etc.\r\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\r\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\r\n return type;\r\n};\r\n\r\nvar decorateEnumIndex = 0;\r\n\r\n/**\r\n * Decorator helper for enums (TypeScript).\r\n * @param {Object} object Enum object\r\n * @returns {Enum} Reflected enum\r\n */\r\nutil.decorateEnum = function decorateEnum(object) {\r\n\r\n /* istanbul ignore if */\r\n if (object.$type)\r\n return object.$type;\r\n\r\n /* istanbul ignore next */\r\n if (!Enum)\r\n Enum = require(15);\r\n\r\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\r\n util.decorateRoot.add(enm);\r\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\r\n return enm;\r\n};\r\n\r\n/**\r\n * Decorator root (TypeScript).\r\n * @name util.decorateRoot\r\n * @type {Root}\r\n * @readonly\r\n */\r\nObject.defineProperty(util, \"decorateRoot\", {\r\n get: function() {\r\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(29))());\r\n }\r\n});\r\n","\"use strict\";\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(39);\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low 32 bits, unsigned\r\n * @param {number} hi High 32 bits, unsigned\r\n */\r\nfunction LongBits(lo, hi) {\r\n\r\n // note that the casts below are theoretically unnecessary as of today, but older statically\r\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo >>> 0;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi >>> 0;\r\n}\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Zero hash.\r\n * @memberof util.LongBits\r\n * @type {string}\r\n */\r\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n if (sign)\r\n value = -value;\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n if (typeof value === \"number\")\r\n return LongBits.fromNumber(value);\r\n if (util.isString(value)) {\r\n /* istanbul ignore else */\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBits.prototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n var lo = ~this.lo + 1 >>> 0,\r\n hi = ~this.hi >>> 0;\r\n if (!lo)\r\n hi = hi + 1 >>> 0;\r\n return -(lo + hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBits.prototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\r\n /* istanbul ignore next */\r\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n if (hash === zeroHash)\r\n return zero;\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBits.prototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 ,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBits.prototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBits.prototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n return part2 === 0\r\n ? part1 === 0\r\n ? part0 < 16384\r\n ? part0 < 128 ? 1 : 2\r\n : part0 < 2097152 ? 3 : 4\r\n : part1 < 16384\r\n ? part1 < 128 ? 5 : 6\r\n : part1 < 2097152 ? 7 : 8\r\n : part2 < 128 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nvar util = exports;\r\n\r\n// used to return a Promise where callback is omitted\r\nutil.asPromise = require(1);\r\n\r\n// converts to / from base64 encoded strings\r\nutil.base64 = require(2);\r\n\r\n// base class of rpc.Service\r\nutil.EventEmitter = require(4);\r\n\r\n// float handling accross browsers\r\nutil.float = require(6);\r\n\r\n// requires modules optionally and hides the call from bundlers\r\nutil.inquire = require(7);\r\n\r\n// converts to / from utf8 encoded strings\r\nutil.utf8 = require(10);\r\n\r\n// provides a node-like buffer pool in the browser\r\nutil.pool = require(9);\r\n\r\n// utility to work with the low and high bits of a 64 bit value\r\nutil.LongBits = require(38);\r\n\r\n// global object reference\r\nutil.global = typeof window !== \"undefined\" && window\r\n || typeof global !== \"undefined\" && global\r\n || typeof self !== \"undefined\" && self\r\n || this; // eslint-disable-line no-invalid-this\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n * @const\r\n */\r\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n * @const\r\n */\r\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n * @const\r\n */\r\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\r\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === \"string\" || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return value && typeof value === \"object\";\r\n};\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * This is an alias of {@link util.isSet}.\r\n * @function\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isset =\r\n\r\n/**\r\n * Checks if a property on a message is considered to be present.\r\n * @param {Object} obj Plain object or message instance\r\n * @param {string} prop Property name\r\n * @returns {boolean} `true` if considered to be present, otherwise `false`\r\n */\r\nutil.isSet = function isSet(obj, prop) {\r\n var value = obj[prop];\r\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\r\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\r\n return false;\r\n};\r\n\r\n/**\r\n * Any compatible Buffer instance.\r\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\r\n * @interface Buffer\r\n * @extends Uint8Array\r\n */\r\n\r\n/**\r\n * Node's Buffer class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Buffer = (function() {\r\n try {\r\n var Buffer = util.inquire(\"buffer\").Buffer;\r\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\r\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n return null;\r\n }\r\n})();\r\n\r\n// Internal alias of or polyfull for Buffer.from.\r\nutil._Buffer_from = null;\r\n\r\n// Internal alias of or polyfill for Buffer.allocUnsafe.\r\nutil._Buffer_allocUnsafe = null;\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\r\n * @returns {Uint8Array|Buffer} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(sizeOrArray) {\r\n /* istanbul ignore next */\r\n return typeof sizeOrArray === \"number\"\r\n ? util.Buffer\r\n ? util._Buffer_allocUnsafe(sizeOrArray)\r\n : new util.Array(sizeOrArray)\r\n : util.Buffer\r\n ? util._Buffer_from(sizeOrArray)\r\n : typeof Uint8Array === \"undefined\"\r\n ? sizeOrArray\r\n : new Uint8Array(sizeOrArray);\r\n};\r\n\r\n/**\r\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\r\n * @type {Constructor}\r\n */\r\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\r\n * @interface Long\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Long.js's Long class if available.\r\n * @type {Constructor}\r\n */\r\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\r\n || /* istanbul ignore next */ util.global.Long\r\n || util.inquire(\"long\");\r\n\r\n/**\r\n * Regular expression used to verify 2 bit (`bool`) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key2Re = /^true|false|0|1$/;\r\n\r\n/**\r\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\r\n\r\n/**\r\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\r\n * @type {RegExp}\r\n * @const\r\n */\r\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? util.LongBits.from(value).toHash()\r\n : util.LongBits.zeroHash;\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = util.LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @memberof util\r\n * @param {Object.} dst Destination object\r\n * @param {Object.} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object.} Destination object\r\n */\r\nfunction merge(dst, src, ifNotSet) { // used by converters\r\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n return dst;\r\n}\r\n\r\nutil.merge = merge;\r\n\r\n/**\r\n * Converts the first character of a string to lower case.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.lcFirst = function lcFirst(str) {\r\n return str.charAt(0).toLowerCase() + str.substring(1);\r\n};\r\n\r\n/**\r\n * Creates a custom error constructor.\r\n * @memberof util\r\n * @param {string} name Error name\r\n * @returns {Constructor} Custom error constructor\r\n */\r\nfunction newError(name) {\r\n\r\n function CustomError(message, properties) {\r\n\r\n if (!(this instanceof CustomError))\r\n return new CustomError(message, properties);\r\n\r\n // Error.call(this, message);\r\n // ^ just returns a new error instance because the ctor can be called as a function\r\n\r\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\r\n\r\n /* istanbul ignore next */\r\n if (Error.captureStackTrace) // node\r\n Error.captureStackTrace(this, CustomError);\r\n else\r\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\r\n\r\n if (properties)\r\n merge(this, properties);\r\n }\r\n\r\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\r\n\r\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\r\n\r\n CustomError.prototype.toString = function toString() {\r\n return this.name + \": \" + this.message;\r\n };\r\n\r\n return CustomError;\r\n}\r\n\r\nutil.newError = newError;\r\n\r\n/**\r\n * Constructs a new protocol error.\r\n * @classdesc Error subclass indicating a protocol specifc error.\r\n * @memberof util\r\n * @extends Error\r\n * @template T extends Message\r\n * @constructor\r\n * @param {string} message Error message\r\n * @param {Object.} [properties] Additional properties\r\n * @example\r\n * try {\r\n * MyMessage.decode(someBuffer); // throws if required fields are missing\r\n * } catch (e) {\r\n * if (e instanceof ProtocolError && e.instance)\r\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\r\n * }\r\n */\r\nutil.ProtocolError = newError(\"ProtocolError\");\r\n\r\n/**\r\n * So far decoded message instance.\r\n * @name util.ProtocolError#instance\r\n * @type {Message}\r\n */\r\n\r\n/**\r\n * A OneOf getter as returned by {@link util.oneOfGetter}.\r\n * @typedef OneOfGetter\r\n * @type {function}\r\n * @returns {string|undefined} Set field name, if any\r\n */\r\n\r\n/**\r\n * Builds a getter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfGetter} Unbound getter\r\n */\r\nutil.oneOfGetter = function getOneOf(fieldNames) {\r\n var fieldMap = {};\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n fieldMap[fieldNames[i]] = 1;\r\n\r\n /**\r\n * @returns {string|undefined} Set field name, if any\r\n * @this Object\r\n * @ignore\r\n */\r\n return function() { // eslint-disable-line consistent-return\r\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\r\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\r\n return keys[i];\r\n };\r\n};\r\n\r\n/**\r\n * A OneOf setter as returned by {@link util.oneOfSetter}.\r\n * @typedef OneOfSetter\r\n * @type {function}\r\n * @param {string|undefined} value Field name\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Builds a setter for a oneof's present field name.\r\n * @param {string[]} fieldNames Field names\r\n * @returns {OneOfSetter} Unbound setter\r\n */\r\nutil.oneOfSetter = function setOneOf(fieldNames) {\r\n\r\n /**\r\n * @param {string} name Field name\r\n * @returns {undefined}\r\n * @this Object\r\n * @ignore\r\n */\r\n return function(name) {\r\n for (var i = 0; i < fieldNames.length; ++i)\r\n if (fieldNames[i] !== name)\r\n delete this[fieldNames[i]];\r\n };\r\n};\r\n\r\n/**\r\n * Default conversion options used for {@link Message#toJSON} implementations.\r\n *\r\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\r\n *\r\n * - Longs become strings\r\n * - Enums become string keys\r\n * - Bytes become base64 encoded strings\r\n * - (Sub-)Messages become plain objects\r\n * - Maps become plain objects with all string keys\r\n * - Repeated fields become arrays\r\n * - NaN and Infinity for float and double fields become strings\r\n *\r\n * @type {IConversionOptions}\r\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\r\n */\r\nutil.toJSONOptions = {\r\n longs: String,\r\n enums: String,\r\n bytes: String,\r\n json: true\r\n};\r\n\r\n// Sets up buffer utility according to the environment (called in index-minimal)\r\nutil._configure = function() {\r\n var Buffer = util.Buffer;\r\n /* istanbul ignore if */\r\n if (!Buffer) {\r\n util._Buffer_from = util._Buffer_allocUnsafe = null;\r\n return;\r\n }\r\n // because node 4.x buffers are incompatible & immutable\r\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\r\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\r\n /* istanbul ignore next */\r\n function Buffer_from(value, encoding) {\r\n return new Buffer(value, encoding);\r\n };\r\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\r\n /* istanbul ignore next */\r\n function Buffer_allocUnsafe(size) {\r\n return new Buffer(size);\r\n };\r\n};\r\n","\"use strict\";\r\nmodule.exports = verifier;\r\n\r\nvar Enum = require(15),\r\n util = require(37);\r\n\r\nfunction invalid(field, expected) {\r\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\r\n}\r\n\r\n/**\r\n * Generates a partial value verifier.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {number} fieldIndex Field index\r\n * @param {string} ref Variable reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n if (field.resolvedType) {\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(%s){\", ref)\r\n (\"default:\")\r\n (\"return%j\", invalid(field, \"enum value\"));\r\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\r\n (\"case %i:\", field.resolvedType.values[keys[j]]);\r\n gen\r\n (\"break\")\r\n (\"}\");\r\n } else {\r\n gen\r\n (\"{\")\r\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\r\n (\"if(e)\")\r\n (\"return%j+e\", field.name + \".\")\r\n (\"}\");\r\n }\r\n } else {\r\n switch (field.type) {\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.isInteger(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\r\n (\"return%j\", invalid(field, \"integer|Long\"));\r\n break;\r\n case \"float\":\r\n case \"double\": gen\r\n (\"if(typeof %s!==\\\"number\\\")\", ref)\r\n (\"return%j\", invalid(field, \"number\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\r\n (\"return%j\", invalid(field, \"boolean\"));\r\n break;\r\n case \"string\": gen\r\n (\"if(!util.isString(%s))\", ref)\r\n (\"return%j\", invalid(field, \"string\"));\r\n break;\r\n case \"bytes\": gen\r\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\r\n (\"return%j\", invalid(field, \"buffer\"));\r\n break;\r\n }\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a partial key verifier.\r\n * @param {Codegen} gen Codegen instance\r\n * @param {Field} field Reflected field\r\n * @param {string} ref Variable reference\r\n * @returns {Codegen} Codegen instance\r\n * @ignore\r\n */\r\nfunction genVerifyKey(gen, field, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n switch (field.keyType) {\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.key32Re.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer key\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\r\n (\"return%j\", invalid(field, \"integer|Long key\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(!util.key2Re.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"boolean key\"));\r\n break;\r\n }\r\n return gen;\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a verifier specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\nfunction verifier(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n\r\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\r\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\r\n (\"return%j\", \"object expected\");\r\n var oneofs = mtype.oneofsArray,\r\n seenFirstField = {};\r\n if (oneofs.length) gen\r\n (\"var p={}\");\r\n\r\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\r\n var field = mtype._fieldsArray[i].resolve(),\r\n ref = \"m\" + util.safeProp(field.name);\r\n\r\n if (field.optional) gen\r\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\r\n\r\n // map fields\r\n if (field.map) { gen\r\n (\"if(!util.isObject(%s))\", ref)\r\n (\"return%j\", invalid(field, \"object\"))\r\n (\"var k=Object.keys(%s)\", ref)\r\n (\"for(var i=0;i}\r\n * @const\r\n */\r\nvar wrappers = exports;\r\n\r\nvar Message = require(21);\r\n\r\n/**\r\n * From object converter part of an {@link IWrapper}.\r\n * @typedef WrapperFromObjectConverter\r\n * @type {function}\r\n * @param {Object.} object Plain object\r\n * @returns {Message<{}>} Message instance\r\n * @this Type\r\n */\r\n\r\n/**\r\n * To object converter part of an {@link IWrapper}.\r\n * @typedef WrapperToObjectConverter\r\n * @type {function}\r\n * @param {Message<{}>} message Message instance\r\n * @param {IConversionOptions} [options] Conversion options\r\n * @returns {Object.} Plain object\r\n * @this Type\r\n */\r\n\r\n/**\r\n * Common type wrapper part of {@link wrappers}.\r\n * @interface IWrapper\r\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\r\n * @property {WrapperToObjectConverter} [toObject] To object converter\r\n */\r\n\r\n// Custom wrapper for Any\r\nwrappers[\".google.protobuf.Any\"] = {\r\n\r\n fromObject: function(object) {\r\n\r\n // unwrap value type if mapped\r\n if (object && object[\"@type\"]) {\r\n var type = this.lookup(object[\"@type\"]);\r\n /* istanbul ignore else */\r\n if (type) {\r\n // type_url does not accept leading \".\"\r\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\r\n object[\"@type\"].substr(1) : object[\"@type\"];\r\n // type_url prefix is optional, but path seperator is required\r\n return this.create({\r\n type_url: \"/\" + type_url,\r\n value: type.encode(type.fromObject(object)).finish()\r\n });\r\n }\r\n }\r\n\r\n return this.fromObject(object);\r\n },\r\n\r\n toObject: function(message, options) {\r\n\r\n // decode value if requested and unmapped\r\n if (options && options.json && message.type_url && message.value) {\r\n // Only use fully qualified type name after the last '/'\r\n var name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\r\n var type = this.lookup(name);\r\n /* istanbul ignore else */\r\n if (type)\r\n message = type.decode(message.value);\r\n }\r\n\r\n // wrap value if unmapped\r\n if (!(message instanceof this.ctor) && message instanceof Message) {\r\n var object = message.$type.toObject(message, options);\r\n object[\"@type\"] = message.$type.fullName;\r\n return object;\r\n }\r\n\r\n return this.toObject(message, options);\r\n }\r\n};\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nvar util = require(39);\r\n\r\nvar BufferWriter; // cyclic\r\n\r\nvar LongBits = util.LongBits,\r\n base64 = util.base64,\r\n utf8 = util.utf8;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @constructor\r\n * @param {function(*, Uint8Array, number)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {*} val Value to write\r\n * @ignore\r\n */\r\nfunction Op(fn, len, val) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {Writer.Op|undefined}\r\n */\r\n this.next = undefined;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val; // type varies\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @ignore\r\n */\r\nfunction State(writer) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {State|null}\r\n */\r\n this.next = writer.states;\r\n}\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {Object|null}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @function\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = util.Buffer\r\n ? function create_buffer_setup() {\r\n return (Writer.create = function create_buffer() {\r\n return new BufferWriter();\r\n })();\r\n }\r\n /* istanbul ignore next */\r\n : function create_array() {\r\n return new Writer();\r\n };\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new util.Array(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\n/* istanbul ignore else */\r\nif (util.Array !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n * @private\r\n */\r\nWriter.prototype._push = function push(fn, len, val) {\r\n this.tail = this.tail.next = new Op(fn, len, val);\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(val, buf, pos) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\nfunction writeVarint32(val, buf, pos) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Constructs a new varint writer operation instance.\r\n * @classdesc Scheduled varint writer operation.\r\n * @extends Op\r\n * @constructor\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @ignore\r\n */\r\nfunction VarintOp(len, val) {\r\n this.len = len;\r\n this.next = undefined;\r\n this.val = val;\r\n}\r\n\r\nVarintOp.prototype = Object.create(Op.prototype);\r\nVarintOp.prototype.fn = writeVarint32;\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.uint32 = function write_uint32(value) {\r\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\r\n // uint32 is by far the most frequently used operation and benefits significantly from this.\r\n this.len += (this.tail = this.tail.next = new VarintOp(\r\n (value = value >>> 0)\r\n < 128 ? 1\r\n : value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5,\r\n value)).len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sint32 = function write_sint32(value) {\r\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\r\n};\r\n\r\nfunction writeVarint64(val, buf, pos) {\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.int64 = Writer.prototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this._push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bool = function write_bool(value) {\r\n return this._push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fixed32 = function write_fixed32(value) {\r\n return this._push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as fixed 32 bits.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as fixed 64 bits.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.float = function write_float(value) {\r\n return this._push(util.float.writeFloatLE, 4, value);\r\n};\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.double = function write_double(value) {\r\n return this._push(util.float.writeDoubleLE, 8, value);\r\n};\r\n\r\nvar writeBytes = util.Array.prototype.set\r\n ? function writeBytes_set(val, buf, pos) {\r\n buf.set(val, pos); // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytes_for(val, buf, pos) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (!len)\r\n return this._push(writeByte, 1, 0);\r\n if (util.isString(value)) {\r\n var buf = Writer.alloc(len = base64.length(value));\r\n base64.decode(value, buf, 0);\r\n value = buf;\r\n }\r\n return this.uint32(len)._push(writeBytes, len, value);\r\n};\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.string = function write_string(value) {\r\n var len = utf8.length(value);\r\n return len\r\n ? this.uint32(len)._push(utf8.write, len, value)\r\n : this._push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.fork = function fork() {\r\n this.states = new State(this);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @returns {Writer} `this`\r\n */\r\nWriter.prototype.ldelim = function ldelim() {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset().uint32(len);\r\n if (len) {\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriter.prototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len),\r\n pos = 0;\r\n while (head) {\r\n head.fn(head.val, buf, pos);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n // this.head = this.tail = null;\r\n return buf;\r\n};\r\n\r\nWriter._configure = function(BufferWriter_) {\r\n BufferWriter = BufferWriter_;\r\n};\r\n","\"use strict\";\r\nmodule.exports = BufferWriter;\r\n\r\n// extends Writer\r\nvar Writer = require(42);\r\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\r\n\r\nvar util = require(39);\r\n\r\nvar Buffer = util.Buffer;\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Buffer} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\r\n};\r\n\r\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\r\n ? function writeBytesBuffer_set(val, buf, pos) {\r\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\r\n // also works for plain array values\r\n }\r\n /* istanbul ignore next */\r\n : function writeBytesBuffer_copy(val, buf, pos) {\r\n if (val.copy) // Buffer values\r\n val.copy(buf, pos, 0, val.length);\r\n else for (var i = 0; i < val.length;) // plain array values\r\n buf[pos++] = val[i++];\r\n };\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\r\n if (util.isString(value))\r\n value = util._Buffer_from(value, \"base64\");\r\n var len = value.length >>> 0;\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeBytesBuffer, len, value);\r\n return this;\r\n};\r\n\r\nfunction writeStringBuffer(val, buf, pos) {\r\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\r\n util.utf8.write(val, buf, pos);\r\n else\r\n buf.utf8Write(val, pos);\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriter.prototype.string = function write_string_buffer(value) {\r\n var len = Buffer.byteLength(value);\r\n this.uint32(len);\r\n if (len)\r\n this._push(writeStringBuffer, len, value);\r\n return this;\r\n};\r\n\r\n\r\n/**\r\n * Finishes the write operation.\r\n * @name BufferWriter#finish\r\n * @function\r\n * @returns {Buffer} Finished buffer\r\n */\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/node_modules/protobufjs/ext/debug/README.md b/node_modules/protobufjs/ext/debug/README.md new file mode 100644 index 0000000..a48517e --- /dev/null +++ b/node_modules/protobufjs/ext/debug/README.md @@ -0,0 +1,4 @@ +protobufjs/ext/debug +========================= + +Experimental debugging extension. diff --git a/node_modules/protobufjs/ext/debug/index.js b/node_modules/protobufjs/ext/debug/index.js new file mode 100644 index 0000000..2b79766 --- /dev/null +++ b/node_modules/protobufjs/ext/debug/index.js @@ -0,0 +1,71 @@ +"use strict"; +var protobuf = require("../.."); + +/** + * Debugging utility functions. Only present in debug builds. + * @namespace + */ +var debug = protobuf.debug = module.exports = {}; + +var codegen = protobuf.util.codegen; + +var debugFnRe = /function ([^(]+)\(([^)]*)\) {/g; + +// Counts number of calls to any generated function +function codegen_debug() { + codegen_debug.supported = codegen.supported; + codegen_debug.verbose = codegen.verbose; + var gen = codegen.apply(null, Array.prototype.slice.call(arguments)); + gen.str = (function(str) { return function str_debug() { + return str.apply(null, Array.prototype.slice.call(arguments)).replace(debugFnRe, "function $1($2) {\n\t$1.calls=($1.calls|0)+1"); + };})(gen.str); + return gen; +} + +/** + * Returns a list of unused types within the specified root. + * @param {NamespaceBase} ns Namespace to search + * @returns {Type[]} Unused types + */ +debug.unusedTypes = function unusedTypes(ns) { + + /* istanbul ignore if */ + if (!(ns instanceof protobuf.Namespace)) + throw TypeError("ns must be a Namespace"); + + /* istanbul ignore if */ + if (!ns.nested) + return []; + + var unused = []; + for (var names = Object.keys(ns.nested), i = 0; i < names.length; ++i) { + var nested = ns.nested[names[i]]; + if (nested instanceof protobuf.Type) { + var calls = (nested.encode.calls|0) + + (nested.decode.calls|0) + + (nested.verify.calls|0) + + (nested.toObject.calls|0) + + (nested.fromObject.calls|0); + if (!calls) + unused.push(nested); + } else if (nested instanceof protobuf.Namespace) + Array.prototype.push.apply(unused, unusedTypes(nested)); + } + return unused; +}; + +/** + * Enables debugging extensions. + * @returns {undefined} + */ +debug.enable = function enable() { + protobuf.util.codegen = codegen_debug; +}; + +/** + * Disables debugging extensions. + * @returns {undefined} + */ +debug.disable = function disable() { + protobuf.util.codegen = codegen; +}; diff --git a/node_modules/protobufjs/ext/descriptor/README.md b/node_modules/protobufjs/ext/descriptor/README.md new file mode 100644 index 0000000..d78ef79 --- /dev/null +++ b/node_modules/protobufjs/ext/descriptor/README.md @@ -0,0 +1,72 @@ +protobufjs/ext/descriptor +========================= + +Experimental extension for interoperability with [descriptor.proto](https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto) types. + +Usage +----- + +```js +var protobuf = require("protobufjs"), // requires the full library + descriptor = require("protobufjs/ext/descriptor"); + +var root = ...; + +// convert any existing root instance to the corresponding descriptor type +var descriptor = root.toDescriptor("proto2"); +// ^ returns a FileDescriptorSet message, see table below + +// encode to a descriptor buffer +var buffer = descriptor.FileDescriptorSet.encode(descriptor).finish(); + +// decode from a descriptor buffer +var decodedDescriptor = descriptor.FileDescriptorSet.decode(buffer); + +// convert any existing descriptor to a root instance +root = protobuf.Root.fromDescriptor(decodedDescriptor); +// ^ expects a FileDescriptorSet message or buffer, see table below + +// and start all over again +``` + +API +--- + +The extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([syntax])` methods to reflection objects and exports the `.google.protobuf` namespace of the internally used `Root` instance containing the following types present in descriptor.proto: + +| Descriptor type | protobuf.js type | Remarks +|-------------------------------|------------------|--------- +| **FileDescriptorSet** | Root | +| FileDescriptorProto | | dependencies are not supported +| FileOptions | | +| FileOptionsOptimizeMode | | +| SourceCodeInfo | | not supported +| SourceCodeInfoLocation | | +| GeneratedCodeInfo | | not supported +| GeneratedCodeInfoAnnotation | | +| **DescriptorProto** | Type | +| MessageOptions | | +| DescriptorProtoExtensionRange | | +| DescriptorProtoReservedRange | | +| **FieldDescriptorProto** | Field | +| FieldDescriptorProtoLabel | | +| FieldDescriptorProtoType | | +| FieldOptions | | +| FieldOptionsCType | | +| FieldOptionsJSType | | +| **OneofDescriptorProto** | OneOf | +| OneofOptions | | +| **EnumDescriptorProto** | Enum | +| EnumOptions | | +| EnumValueDescriptorProto | | +| EnumValueOptions | | not supported +| **ServiceDescriptorProto** | Service | +| ServiceOptions | | +| **MethodDescriptorProto** | Method | +| MethodOptions | | +| UninterpretedOption | | not supported +| UninterpretedOptionNamePart | | + +Note that not all features of descriptor.proto translate perfectly to a protobuf.js root instance. A root instance has only limited knowlege of packages or individual files for example, which is then compensated by guessing and generating fictional file names. + +When using TypeScript, the respective interface types can be used to reference specific message instances (i.e. `protobuf.Message`). diff --git a/node_modules/protobufjs/ext/descriptor/index.d.ts b/node_modules/protobufjs/ext/descriptor/index.d.ts new file mode 100644 index 0000000..1df2efc --- /dev/null +++ b/node_modules/protobufjs/ext/descriptor/index.d.ts @@ -0,0 +1,191 @@ +import * as $protobuf from "../.."; +export const FileDescriptorSet: $protobuf.Type; + +export const FileDescriptorProto: $protobuf.Type; + +export const DescriptorProto: $protobuf.Type & { + ExtensionRange: $protobuf.Type, + ReservedRange: $protobuf.Type +}; + +export const FieldDescriptorProto: $protobuf.Type & { + Label: $protobuf.Enum, + Type: $protobuf.Enum +}; + +export const OneofDescriptorProto: $protobuf.Type; + +export const EnumDescriptorProto: $protobuf.Type; + +export const ServiceDescriptorProto: $protobuf.Type; + +export const EnumValueDescriptorProto: $protobuf.Type; + +export const MethodDescriptorProto: $protobuf.Type; + +export const FileOptions: $protobuf.Type & { + OptimizeMode: $protobuf.Enum +}; + +export const MessageOptions: $protobuf.Type; + +export const FieldOptions: $protobuf.Type & { + CType: $protobuf.Enum, + JSType: $protobuf.Enum +}; + +export const OneofOptions: $protobuf.Type; + +export const EnumOptions: $protobuf.Type; + +export const EnumValueOptions: $protobuf.Type; + +export const ServiceOptions: $protobuf.Type; + +export const MethodOptions: $protobuf.Type; + +export const UninterpretedOption: $protobuf.Type & { + NamePart: $protobuf.Type +}; + +export const SourceCodeInfo: $protobuf.Type & { + Location: $protobuf.Type +}; + +export const GeneratedCodeInfo: $protobuf.Type & { + Annotation: $protobuf.Type +}; + +export interface IFileDescriptorSet { + file: IFileDescriptorProto[]; +} + +export interface IFileDescriptorProto { + name?: string; + package?: string; + dependency?: any; + publicDependency?: any; + weakDependency?: any; + messageType?: IDescriptorProto[]; + enumType?: IEnumDescriptorProto[]; + service?: IServiceDescriptorProto[]; + extension?: IFieldDescriptorProto[]; + options?: IFileOptions; + sourceCodeInfo?: any; + syntax?: string; +} + +export interface IFileOptions { + javaPackage?: string; + javaOuterClassname?: string; + javaMultipleFiles?: boolean; + javaGenerateEqualsAndHash?: boolean; + javaStringCheckUtf8?: boolean; + optimizeFor?: IFileOptionsOptimizeMode; + goPackage?: string; + ccGenericServices?: boolean; + javaGenericServices?: boolean; + pyGenericServices?: boolean; + deprecated?: boolean; + ccEnableArenas?: boolean; + objcClassPrefix?: string; + csharpNamespace?: string; +} + +type IFileOptionsOptimizeMode = number; + +export interface IDescriptorProto { + name?: string; + field?: IFieldDescriptorProto[]; + extension?: IFieldDescriptorProto[]; + nestedType?: IDescriptorProto[]; + enumType?: IEnumDescriptorProto[]; + extensionRange?: IDescriptorProtoExtensionRange[]; + oneofDecl?: IOneofDescriptorProto[]; + options?: IMessageOptions; + reservedRange?: IDescriptorProtoReservedRange[]; + reservedName?: string[]; +} + +export interface IMessageOptions { + mapEntry?: boolean; +} + +export interface IDescriptorProtoExtensionRange { + start?: number; + end?: number; +} + +export interface IDescriptorProtoReservedRange { + start?: number; + end?: number; +} + +export interface IFieldDescriptorProto { + name?: string; + number?: number; + label?: IFieldDescriptorProtoLabel; + type?: IFieldDescriptorProtoType; + typeName?: string; + extendee?: string; + defaultValue?: string; + oneofIndex?: number; + jsonName?: any; + options?: IFieldOptions; +} + +type IFieldDescriptorProtoLabel = number; + +type IFieldDescriptorProtoType = number; + +export interface IFieldOptions { + packed?: boolean; + jstype?: IFieldOptionsJSType; +} + +type IFieldOptionsJSType = number; + +export interface IEnumDescriptorProto { + name?: string; + value?: IEnumValueDescriptorProto[]; + options?: IEnumOptions; +} + +export interface IEnumValueDescriptorProto { + name?: string; + number?: number; + options?: any; +} + +export interface IEnumOptions { + allowAlias?: boolean; + deprecated?: boolean; +} + +export interface IOneofDescriptorProto { + name?: string; + options?: any; +} + +export interface IServiceDescriptorProto { + name?: string; + method?: IMethodDescriptorProto[]; + options?: IServiceOptions; +} + +export interface IServiceOptions { + deprecated?: boolean; +} + +export interface IMethodDescriptorProto { + name?: string; + inputType?: string; + outputType?: string; + options?: IMethodOptions; + clientStreaming?: boolean; + serverStreaming?: boolean; +} + +export interface IMethodOptions { + deprecated?: boolean; +} diff --git a/node_modules/protobufjs/ext/descriptor/index.js b/node_modules/protobufjs/ext/descriptor/index.js new file mode 100644 index 0000000..0b32d02 --- /dev/null +++ b/node_modules/protobufjs/ext/descriptor/index.js @@ -0,0 +1,1052 @@ +"use strict"; +var $protobuf = require("../.."); +module.exports = exports = $protobuf.descriptor = $protobuf.Root.fromJSON(require("../../google/protobuf/descriptor.json")).lookup(".google.protobuf"); + +var Namespace = $protobuf.Namespace, + Root = $protobuf.Root, + Enum = $protobuf.Enum, + Type = $protobuf.Type, + Field = $protobuf.Field, + MapField = $protobuf.MapField, + OneOf = $protobuf.OneOf, + Service = $protobuf.Service, + Method = $protobuf.Method; + +// --- Root --- + +/** + * Properties of a FileDescriptorSet message. + * @interface IFileDescriptorSet + * @property {IFileDescriptorProto[]} file Files + */ + +/** + * Properties of a FileDescriptorProto message. + * @interface IFileDescriptorProto + * @property {string} [name] File name + * @property {string} [package] Package + * @property {*} [dependency] Not supported + * @property {*} [publicDependency] Not supported + * @property {*} [weakDependency] Not supported + * @property {IDescriptorProto[]} [messageType] Nested message types + * @property {IEnumDescriptorProto[]} [enumType] Nested enums + * @property {IServiceDescriptorProto[]} [service] Nested services + * @property {IFieldDescriptorProto[]} [extension] Nested extension fields + * @property {IFileOptions} [options] Options + * @property {*} [sourceCodeInfo] Not supported + * @property {string} [syntax="proto2"] Syntax + */ + +/** + * Properties of a FileOptions message. + * @interface IFileOptions + * @property {string} [javaPackage] + * @property {string} [javaOuterClassname] + * @property {boolean} [javaMultipleFiles] + * @property {boolean} [javaGenerateEqualsAndHash] + * @property {boolean} [javaStringCheckUtf8] + * @property {IFileOptionsOptimizeMode} [optimizeFor=1] + * @property {string} [goPackage] + * @property {boolean} [ccGenericServices] + * @property {boolean} [javaGenericServices] + * @property {boolean} [pyGenericServices] + * @property {boolean} [deprecated] + * @property {boolean} [ccEnableArenas] + * @property {string} [objcClassPrefix] + * @property {string} [csharpNamespace] + */ + +/** + * Values of he FileOptions.OptimizeMode enum. + * @typedef IFileOptionsOptimizeMode + * @type {number} + * @property {number} SPEED=1 + * @property {number} CODE_SIZE=2 + * @property {number} LITE_RUNTIME=3 + */ + +/** + * Creates a root from a descriptor set. + * @param {IFileDescriptorSet|Reader|Uint8Array} descriptor Descriptor + * @returns {Root} Root instance + */ +Root.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.FileDescriptorSet.decode(descriptor); + + var root = new Root(); + + if (descriptor.file) { + var fileDescriptor, + filePackage; + for (var j = 0, i; j < descriptor.file.length; ++j) { + filePackage = root; + if ((fileDescriptor = descriptor.file[j])["package"] && fileDescriptor["package"].length) + filePackage = root.define(fileDescriptor["package"]); + if (fileDescriptor.name && fileDescriptor.name.length) + root.files.push(filePackage.filename = fileDescriptor.name); + if (fileDescriptor.messageType) + for (i = 0; i < fileDescriptor.messageType.length; ++i) + filePackage.add(Type.fromDescriptor(fileDescriptor.messageType[i], fileDescriptor.syntax)); + if (fileDescriptor.enumType) + for (i = 0; i < fileDescriptor.enumType.length; ++i) + filePackage.add(Enum.fromDescriptor(fileDescriptor.enumType[i])); + if (fileDescriptor.extension) + for (i = 0; i < fileDescriptor.extension.length; ++i) + filePackage.add(Field.fromDescriptor(fileDescriptor.extension[i])); + if (fileDescriptor.service) + for (i = 0; i < fileDescriptor.service.length; ++i) + filePackage.add(Service.fromDescriptor(fileDescriptor.service[i])); + var opts = fromDescriptorOptions(fileDescriptor.options, exports.FileOptions); + if (opts) { + var ks = Object.keys(opts); + for (i = 0; i < ks.length; ++i) + filePackage.setOption(ks[i], opts[ks[i]]); + } + } + } + + return root; +}; + +/** + * Converts a root to a descriptor set. + * @returns {Message} Descriptor + * @param {string} [syntax="proto2"] Syntax + */ +Root.prototype.toDescriptor = function toDescriptor(syntax) { + var set = exports.FileDescriptorSet.create(); + Root_toDescriptorRecursive(this, set.file, syntax); + return set; +}; + +// Traverses a namespace and assembles the descriptor set +function Root_toDescriptorRecursive(ns, files, syntax) { + + // Create a new file + var file = exports.FileDescriptorProto.create({ name: ns.filename || (ns.fullName.substring(1).replace(/\./g, "_") || "root") + ".proto" }); + if (syntax) + file.syntax = syntax; + if (!(ns instanceof Root)) + file["package"] = ns.fullName.substring(1); + + // Add nested types + for (var i = 0, nested; i < ns.nestedArray.length; ++i) + if ((nested = ns._nestedArray[i]) instanceof Type) + file.messageType.push(nested.toDescriptor(syntax)); + else if (nested instanceof Enum) + file.enumType.push(nested.toDescriptor()); + else if (nested instanceof Field) + file.extension.push(nested.toDescriptor(syntax)); + else if (nested instanceof Service) + file.service.push(nested.toDescriptor()); + else if (nested instanceof /* plain */ Namespace) + Root_toDescriptorRecursive(nested, files, syntax); // requires new file + + // Keep package-level options + file.options = toDescriptorOptions(ns.options, exports.FileOptions); + + // And keep the file only if there is at least one nested object + if (file.messageType.length + file.enumType.length + file.extension.length + file.service.length) + files.push(file); +} + +// --- Type --- + +/** + * Properties of a DescriptorProto message. + * @interface IDescriptorProto + * @property {string} [name] Message type name + * @property {IFieldDescriptorProto[]} [field] Fields + * @property {IFieldDescriptorProto[]} [extension] Extension fields + * @property {IDescriptorProto[]} [nestedType] Nested message types + * @property {IEnumDescriptorProto[]} [enumType] Nested enums + * @property {IDescriptorProtoExtensionRange[]} [extensionRange] Extension ranges + * @property {IOneofDescriptorProto[]} [oneofDecl] Oneofs + * @property {IMessageOptions} [options] Not supported + * @property {IDescriptorProtoReservedRange[]} [reservedRange] Reserved ranges + * @property {string[]} [reservedName] Reserved names + */ + +/** + * Properties of a MessageOptions message. + * @interface IMessageOptions + * @property {boolean} [mapEntry=false] Whether this message is a map entry + */ + +/** + * Properties of an ExtensionRange message. + * @interface IDescriptorProtoExtensionRange + * @property {number} [start] Start field id + * @property {number} [end] End field id + */ + +/** + * Properties of a ReservedRange message. + * @interface IDescriptorProtoReservedRange + * @property {number} [start] Start field id + * @property {number} [end] End field id + */ + +var unnamedMessageIndex = 0; + +/** + * Creates a type from a descriptor. + * @param {IDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @param {string} [syntax="proto2"] Syntax + * @returns {Type} Type instance + */ +Type.fromDescriptor = function fromDescriptor(descriptor, syntax) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.DescriptorProto.decode(descriptor); + + // Create the message type + var type = new Type(descriptor.name.length ? descriptor.name : "Type" + unnamedMessageIndex++, fromDescriptorOptions(descriptor.options, exports.MessageOptions)), + i; + + /* Oneofs */ if (descriptor.oneofDecl) + for (i = 0; i < descriptor.oneofDecl.length; ++i) + type.add(OneOf.fromDescriptor(descriptor.oneofDecl[i])); + /* Fields */ if (descriptor.field) + for (i = 0; i < descriptor.field.length; ++i) { + var field = Field.fromDescriptor(descriptor.field[i], syntax); + type.add(field); + if (descriptor.field[i].hasOwnProperty("oneofIndex")) // eslint-disable-line no-prototype-builtins + type.oneofsArray[descriptor.field[i].oneofIndex].add(field); + } + /* Extension fields */ if (descriptor.extension) + for (i = 0; i < descriptor.extension.length; ++i) + type.add(Field.fromDescriptor(descriptor.extension[i], syntax)); + /* Nested types */ if (descriptor.nestedType) + for (i = 0; i < descriptor.nestedType.length; ++i) { + type.add(Type.fromDescriptor(descriptor.nestedType[i], syntax)); + if (descriptor.nestedType[i].options && descriptor.nestedType[i].options.mapEntry) + type.setOption("map_entry", true); + } + /* Nested enums */ if (descriptor.enumType) + for (i = 0; i < descriptor.enumType.length; ++i) + type.add(Enum.fromDescriptor(descriptor.enumType[i])); + /* Extension ranges */ if (descriptor.extensionRange && descriptor.extensionRange.length) { + type.extensions = []; + for (i = 0; i < descriptor.extensionRange.length; ++i) + type.extensions.push([ descriptor.extensionRange[i].start, descriptor.extensionRange[i].end ]); + } + /* Reserved... */ if (descriptor.reservedRange && descriptor.reservedRange.length || descriptor.reservedName && descriptor.reservedName.length) { + type.reserved = []; + /* Ranges */ if (descriptor.reservedRange) + for (i = 0; i < descriptor.reservedRange.length; ++i) + type.reserved.push([ descriptor.reservedRange[i].start, descriptor.reservedRange[i].end ]); + /* Names */ if (descriptor.reservedName) + for (i = 0; i < descriptor.reservedName.length; ++i) + type.reserved.push(descriptor.reservedName[i]); + } + + return type; +}; + +/** + * Converts a type to a descriptor. + * @returns {Message} Descriptor + * @param {string} [syntax="proto2"] Syntax + */ +Type.prototype.toDescriptor = function toDescriptor(syntax) { + var descriptor = exports.DescriptorProto.create({ name: this.name }), + i; + + /* Fields */ for (i = 0; i < this.fieldsArray.length; ++i) { + var fieldDescriptor; + descriptor.field.push(fieldDescriptor = this._fieldsArray[i].toDescriptor(syntax)); + if (this._fieldsArray[i] instanceof MapField) { // map fields are repeated FieldNameEntry + var keyType = toDescriptorType(this._fieldsArray[i].keyType, this._fieldsArray[i].resolvedKeyType), + valueType = toDescriptorType(this._fieldsArray[i].type, this._fieldsArray[i].resolvedType), + valueTypeName = valueType === /* type */ 11 || valueType === /* enum */ 14 + ? this._fieldsArray[i].resolvedType && shortname(this.parent, this._fieldsArray[i].resolvedType) || this._fieldsArray[i].type + : undefined; + descriptor.nestedType.push(exports.DescriptorProto.create({ + name: fieldDescriptor.typeName, + field: [ + exports.FieldDescriptorProto.create({ name: "key", number: 1, label: 1, type: keyType }), // can't reference a type or enum + exports.FieldDescriptorProto.create({ name: "value", number: 2, label: 1, type: valueType, typeName: valueTypeName }) + ], + options: exports.MessageOptions.create({ mapEntry: true }) + })); + } + } + /* Oneofs */ for (i = 0; i < this.oneofsArray.length; ++i) + descriptor.oneofDecl.push(this._oneofsArray[i].toDescriptor()); + /* Nested... */ for (i = 0; i < this.nestedArray.length; ++i) { + /* Extension fields */ if (this._nestedArray[i] instanceof Field) + descriptor.field.push(this._nestedArray[i].toDescriptor(syntax)); + /* Types */ else if (this._nestedArray[i] instanceof Type) + descriptor.nestedType.push(this._nestedArray[i].toDescriptor(syntax)); + /* Enums */ else if (this._nestedArray[i] instanceof Enum) + descriptor.enumType.push(this._nestedArray[i].toDescriptor()); + // plain nested namespaces become packages instead in Root#toDescriptor + } + /* Extension ranges */ if (this.extensions) + for (i = 0; i < this.extensions.length; ++i) + descriptor.extensionRange.push(exports.DescriptorProto.ExtensionRange.create({ start: this.extensions[i][0], end: this.extensions[i][1] })); + /* Reserved... */ if (this.reserved) + for (i = 0; i < this.reserved.length; ++i) + /* Names */ if (typeof this.reserved[i] === "string") + descriptor.reservedName.push(this.reserved[i]); + /* Ranges */ else + descriptor.reservedRange.push(exports.DescriptorProto.ReservedRange.create({ start: this.reserved[i][0], end: this.reserved[i][1] })); + + descriptor.options = toDescriptorOptions(this.options, exports.MessageOptions); + + return descriptor; +}; + +// --- Field --- + +/** + * Properties of a FieldDescriptorProto message. + * @interface IFieldDescriptorProto + * @property {string} [name] Field name + * @property {number} [number] Field id + * @property {IFieldDescriptorProtoLabel} [label] Field rule + * @property {IFieldDescriptorProtoType} [type] Field basic type + * @property {string} [typeName] Field type name + * @property {string} [extendee] Extended type name + * @property {string} [defaultValue] Literal default value + * @property {number} [oneofIndex] Oneof index if part of a oneof + * @property {*} [jsonName] Not supported + * @property {IFieldOptions} [options] Field options + */ + +/** + * Values of the FieldDescriptorProto.Label enum. + * @typedef IFieldDescriptorProtoLabel + * @type {number} + * @property {number} LABEL_OPTIONAL=1 + * @property {number} LABEL_REQUIRED=2 + * @property {number} LABEL_REPEATED=3 + */ + +/** + * Values of the FieldDescriptorProto.Type enum. + * @typedef IFieldDescriptorProtoType + * @type {number} + * @property {number} TYPE_DOUBLE=1 + * @property {number} TYPE_FLOAT=2 + * @property {number} TYPE_INT64=3 + * @property {number} TYPE_UINT64=4 + * @property {number} TYPE_INT32=5 + * @property {number} TYPE_FIXED64=6 + * @property {number} TYPE_FIXED32=7 + * @property {number} TYPE_BOOL=8 + * @property {number} TYPE_STRING=9 + * @property {number} TYPE_GROUP=10 + * @property {number} TYPE_MESSAGE=11 + * @property {number} TYPE_BYTES=12 + * @property {number} TYPE_UINT32=13 + * @property {number} TYPE_ENUM=14 + * @property {number} TYPE_SFIXED32=15 + * @property {number} TYPE_SFIXED64=16 + * @property {number} TYPE_SINT32=17 + * @property {number} TYPE_SINT64=18 + */ + +/** + * Properties of a FieldOptions message. + * @interface IFieldOptions + * @property {boolean} [packed] Whether packed or not (defaults to `false` for proto2 and `true` for proto3) + * @property {IFieldOptionsJSType} [jstype] JavaScript value type (not used by protobuf.js) + */ + +/** + * Values of the FieldOptions.JSType enum. + * @typedef IFieldOptionsJSType + * @type {number} + * @property {number} JS_NORMAL=0 + * @property {number} JS_STRING=1 + * @property {number} JS_NUMBER=2 + */ + +// copied here from parse.js +var numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/; + +/** + * Creates a field from a descriptor. + * @param {IFieldDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @param {string} [syntax="proto2"] Syntax + * @returns {Field} Field instance + */ +Field.fromDescriptor = function fromDescriptor(descriptor, syntax) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.DescriptorProto.decode(descriptor); + + if (typeof descriptor.number !== "number") + throw Error("missing field id"); + + // Rewire field type + var fieldType; + if (descriptor.typeName && descriptor.typeName.length) + fieldType = descriptor.typeName; + else + fieldType = fromDescriptorType(descriptor.type); + + // Rewire field rule + var fieldRule; + switch (descriptor.label) { + // 0 is reserved for errors + case 1: fieldRule = undefined; break; + case 2: fieldRule = "required"; break; + case 3: fieldRule = "repeated"; break; + default: throw Error("illegal label: " + descriptor.label); + } + + var extendee = descriptor.extendee; + if (descriptor.extendee !== undefined) { + extendee = extendee.length ? extendee : undefined; + } + var field = new Field( + descriptor.name.length ? descriptor.name : "field" + descriptor.number, + descriptor.number, + fieldType, + fieldRule, + extendee + ); + + field.options = fromDescriptorOptions(descriptor.options, exports.FieldOptions); + + if (descriptor.defaultValue && descriptor.defaultValue.length) { + var defaultValue = descriptor.defaultValue; + switch (defaultValue) { + case "true": case "TRUE": + defaultValue = true; + break; + case "false": case "FALSE": + defaultValue = false; + break; + default: + var match = numberRe.exec(defaultValue); + if (match) + defaultValue = parseInt(defaultValue); // eslint-disable-line radix + break; + } + field.setOption("default", defaultValue); + } + + if (packableDescriptorType(descriptor.type)) { + if (syntax === "proto3") { // defaults to packed=true (internal preset is packed=true) + if (descriptor.options && !descriptor.options.packed) + field.setOption("packed", false); + } else if (!(descriptor.options && descriptor.options.packed)) // defaults to packed=false + field.setOption("packed", false); + } + + return field; +}; + +/** + * Converts a field to a descriptor. + * @returns {Message} Descriptor + * @param {string} [syntax="proto2"] Syntax + */ +Field.prototype.toDescriptor = function toDescriptor(syntax) { + var descriptor = exports.FieldDescriptorProto.create({ name: this.name, number: this.id }); + + if (this.map) { + + descriptor.type = 11; // message + descriptor.typeName = $protobuf.util.ucFirst(this.name); // fieldName -> FieldNameEntry (built in Type#toDescriptor) + descriptor.label = 3; // repeated + + } else { + + // Rewire field type + switch (descriptor.type = toDescriptorType(this.type, this.resolve().resolvedType)) { + case 10: // group + case 11: // type + case 14: // enum + descriptor.typeName = this.resolvedType ? shortname(this.parent, this.resolvedType) : this.type; + break; + } + + // Rewire field rule + switch (this.rule) { + case "repeated": descriptor.label = 3; break; + case "required": descriptor.label = 2; break; + default: descriptor.label = 1; break; + } + + } + + // Handle extension field + descriptor.extendee = this.extensionField ? this.extensionField.parent.fullName : this.extend; + + // Handle part of oneof + if (this.partOf) + if ((descriptor.oneofIndex = this.parent.oneofsArray.indexOf(this.partOf)) < 0) + throw Error("missing oneof"); + + if (this.options) { + descriptor.options = toDescriptorOptions(this.options, exports.FieldOptions); + if (this.options["default"] != null) + descriptor.defaultValue = String(this.options["default"]); + } + + if (syntax === "proto3") { // defaults to packed=true + if (!this.packed) + (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = false; + } else if (this.packed) // defaults to packed=false + (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = true; + + return descriptor; +}; + +// --- Enum --- + +/** + * Properties of an EnumDescriptorProto message. + * @interface IEnumDescriptorProto + * @property {string} [name] Enum name + * @property {IEnumValueDescriptorProto[]} [value] Enum values + * @property {IEnumOptions} [options] Enum options + */ + +/** + * Properties of an EnumValueDescriptorProto message. + * @interface IEnumValueDescriptorProto + * @property {string} [name] Name + * @property {number} [number] Value + * @property {*} [options] Not supported + */ + +/** + * Properties of an EnumOptions message. + * @interface IEnumOptions + * @property {boolean} [allowAlias] Whether aliases are allowed + * @property {boolean} [deprecated] + */ + +var unnamedEnumIndex = 0; + +/** + * Creates an enum from a descriptor. + * @param {IEnumDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @returns {Enum} Enum instance + */ +Enum.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.EnumDescriptorProto.decode(descriptor); + + // Construct values object + var values = {}; + if (descriptor.value) + for (var i = 0; i < descriptor.value.length; ++i) { + var name = descriptor.value[i].name, + value = descriptor.value[i].number || 0; + values[name && name.length ? name : "NAME" + value] = value; + } + + return new Enum( + descriptor.name && descriptor.name.length ? descriptor.name : "Enum" + unnamedEnumIndex++, + values, + fromDescriptorOptions(descriptor.options, exports.EnumOptions) + ); +}; + +/** + * Converts an enum to a descriptor. + * @returns {Message} Descriptor + */ +Enum.prototype.toDescriptor = function toDescriptor() { + + // Values + var values = []; + for (var i = 0, ks = Object.keys(this.values); i < ks.length; ++i) + values.push(exports.EnumValueDescriptorProto.create({ name: ks[i], number: this.values[ks[i]] })); + + return exports.EnumDescriptorProto.create({ + name: this.name, + value: values, + options: toDescriptorOptions(this.options, exports.EnumOptions) + }); +}; + +// --- OneOf --- + +/** + * Properties of a OneofDescriptorProto message. + * @interface IOneofDescriptorProto + * @property {string} [name] Oneof name + * @property {*} [options] Not supported + */ + +var unnamedOneofIndex = 0; + +/** + * Creates a oneof from a descriptor. + * @param {IOneofDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @returns {OneOf} OneOf instance + */ +OneOf.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.OneofDescriptorProto.decode(descriptor); + + return new OneOf( + // unnamedOneOfIndex is global, not per type, because we have no ref to a type here + descriptor.name && descriptor.name.length ? descriptor.name : "oneof" + unnamedOneofIndex++ + // fromDescriptorOptions(descriptor.options, exports.OneofOptions) - only uninterpreted_option + ); +}; + +/** + * Converts a oneof to a descriptor. + * @returns {Message} Descriptor + */ +OneOf.prototype.toDescriptor = function toDescriptor() { + return exports.OneofDescriptorProto.create({ + name: this.name + // options: toDescriptorOptions(this.options, exports.OneofOptions) - only uninterpreted_option + }); +}; + +// --- Service --- + +/** + * Properties of a ServiceDescriptorProto message. + * @interface IServiceDescriptorProto + * @property {string} [name] Service name + * @property {IMethodDescriptorProto[]} [method] Methods + * @property {IServiceOptions} [options] Options + */ + +/** + * Properties of a ServiceOptions message. + * @interface IServiceOptions + * @property {boolean} [deprecated] + */ + +var unnamedServiceIndex = 0; + +/** + * Creates a service from a descriptor. + * @param {IServiceDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @returns {Service} Service instance + */ +Service.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.ServiceDescriptorProto.decode(descriptor); + + var service = new Service(descriptor.name && descriptor.name.length ? descriptor.name : "Service" + unnamedServiceIndex++, fromDescriptorOptions(descriptor.options, exports.ServiceOptions)); + if (descriptor.method) + for (var i = 0; i < descriptor.method.length; ++i) + service.add(Method.fromDescriptor(descriptor.method[i])); + + return service; +}; + +/** + * Converts a service to a descriptor. + * @returns {Message} Descriptor + */ +Service.prototype.toDescriptor = function toDescriptor() { + + // Methods + var methods = []; + for (var i = 0; i < this.methodsArray; ++i) + methods.push(this._methodsArray[i].toDescriptor()); + + return exports.ServiceDescriptorProto.create({ + name: this.name, + methods: methods, + options: toDescriptorOptions(this.options, exports.ServiceOptions) + }); +}; + +// --- Method --- + +/** + * Properties of a MethodDescriptorProto message. + * @interface IMethodDescriptorProto + * @property {string} [name] Method name + * @property {string} [inputType] Request type name + * @property {string} [outputType] Response type name + * @property {IMethodOptions} [options] Not supported + * @property {boolean} [clientStreaming=false] Whether requests are streamed + * @property {boolean} [serverStreaming=false] Whether responses are streamed + */ + +/** + * Properties of a MethodOptions message. + * @interface IMethodOptions + * @property {boolean} [deprecated] + */ + +var unnamedMethodIndex = 0; + +/** + * Creates a method from a descriptor. + * @param {IMethodDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @returns {Method} Reflected method instance + */ +Method.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.MethodDescriptorProto.decode(descriptor); + + return new Method( + // unnamedMethodIndex is global, not per service, because we have no ref to a service here + descriptor.name && descriptor.name.length ? descriptor.name : "Method" + unnamedMethodIndex++, + "rpc", + descriptor.inputType, + descriptor.outputType, + Boolean(descriptor.clientStreaming), + Boolean(descriptor.serverStreaming), + fromDescriptorOptions(descriptor.options, exports.MethodOptions) + ); +}; + +/** + * Converts a method to a descriptor. + * @returns {Message} Descriptor + */ +Method.prototype.toDescriptor = function toDescriptor() { + return exports.MethodDescriptorProto.create({ + name: this.name, + inputType: this.resolvedRequestType ? this.resolvedRequestType.fullName : this.requestType, + outputType: this.resolvedResponseType ? this.resolvedResponseType.fullName : this.responseType, + clientStreaming: this.requestStream, + serverStreaming: this.responseStream, + options: toDescriptorOptions(this.options, exports.MethodOptions) + }); +}; + +// --- utility --- + +// Converts a descriptor type to a protobuf.js basic type +function fromDescriptorType(type) { + switch (type) { + // 0 is reserved for errors + case 1: return "double"; + case 2: return "float"; + case 3: return "int64"; + case 4: return "uint64"; + case 5: return "int32"; + case 6: return "fixed64"; + case 7: return "fixed32"; + case 8: return "bool"; + case 9: return "string"; + case 12: return "bytes"; + case 13: return "uint32"; + case 15: return "sfixed32"; + case 16: return "sfixed64"; + case 17: return "sint32"; + case 18: return "sint64"; + } + throw Error("illegal type: " + type); +} + +// Tests if a descriptor type is packable +function packableDescriptorType(type) { + switch (type) { + case 1: // double + case 2: // float + case 3: // int64 + case 4: // uint64 + case 5: // int32 + case 6: // fixed64 + case 7: // fixed32 + case 8: // bool + case 13: // uint32 + case 14: // enum (!) + case 15: // sfixed32 + case 16: // sfixed64 + case 17: // sint32 + case 18: // sint64 + return true; + } + return false; +} + +// Converts a protobuf.js basic type to a descriptor type +function toDescriptorType(type, resolvedType) { + switch (type) { + // 0 is reserved for errors + case "double": return 1; + case "float": return 2; + case "int64": return 3; + case "uint64": return 4; + case "int32": return 5; + case "fixed64": return 6; + case "fixed32": return 7; + case "bool": return 8; + case "string": return 9; + case "bytes": return 12; + case "uint32": return 13; + case "sfixed32": return 15; + case "sfixed64": return 16; + case "sint32": return 17; + case "sint64": return 18; + } + if (resolvedType instanceof Enum) + return 14; + if (resolvedType instanceof Type) + return resolvedType.group ? 10 : 11; + throw Error("illegal type: " + type); +} + +// Converts descriptor options to an options object +function fromDescriptorOptions(options, type) { + if (!options) + return undefined; + var out = []; + for (var i = 0, field, key, val; i < type.fieldsArray.length; ++i) + if ((key = (field = type._fieldsArray[i]).name) !== "uninterpretedOption") + if (options.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins + val = options[key]; + if (field.resolvedType instanceof Enum && typeof val === "number" && field.resolvedType.valuesById[val] !== undefined) + val = field.resolvedType.valuesById[val]; + out.push(underScore(key), val); + } + return out.length ? $protobuf.util.toObject(out) : undefined; +} + +// Converts an options object to descriptor options +function toDescriptorOptions(options, type) { + if (!options) + return undefined; + var out = []; + for (var i = 0, ks = Object.keys(options), key, val; i < ks.length; ++i) { + val = options[key = ks[i]]; + if (key === "default") + continue; + var field = type.fields[key]; + if (!field && !(field = type.fields[key = $protobuf.util.camelCase(key)])) + continue; + out.push(key, val); + } + return out.length ? type.fromObject($protobuf.util.toObject(out)) : undefined; +} + +// Calculates the shortest relative path from `from` to `to`. +function shortname(from, to) { + var fromPath = from.fullName.split("."), + toPath = to.fullName.split("."), + i = 0, + j = 0, + k = toPath.length - 1; + if (!(from instanceof Root) && to instanceof Namespace) + while (i < fromPath.length && j < k && fromPath[i] === toPath[j]) { + var other = to.lookup(fromPath[i++], true); + if (other !== null && other !== to) + break; + ++j; + } + else + for (; i < fromPath.length && j < k && fromPath[i] === toPath[j]; ++i, ++j); + return toPath.slice(j).join("."); +} + +// copied here from cli/targets/proto.js +function underScore(str) { + return str.substring(0,1) + + str.substring(1) + .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); +} + +// --- exports --- + +/** + * Reflected file descriptor set. + * @name FileDescriptorSet + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected file descriptor proto. + * @name FileDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected descriptor proto. + * @name DescriptorProto + * @type {Type} + * @property {Type} ExtensionRange + * @property {Type} ReservedRange + * @const + * @tstype $protobuf.Type & { + * ExtensionRange: $protobuf.Type, + * ReservedRange: $protobuf.Type + * } + */ + +/** + * Reflected field descriptor proto. + * @name FieldDescriptorProto + * @type {Type} + * @property {Enum} Label + * @property {Enum} Type + * @const + * @tstype $protobuf.Type & { + * Label: $protobuf.Enum, + * Type: $protobuf.Enum + * } + */ + +/** + * Reflected oneof descriptor proto. + * @name OneofDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected enum descriptor proto. + * @name EnumDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected service descriptor proto. + * @name ServiceDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected enum value descriptor proto. + * @name EnumValueDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected method descriptor proto. + * @name MethodDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected file options. + * @name FileOptions + * @type {Type} + * @property {Enum} OptimizeMode + * @const + * @tstype $protobuf.Type & { + * OptimizeMode: $protobuf.Enum + * } + */ + +/** + * Reflected message options. + * @name MessageOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected field options. + * @name FieldOptions + * @type {Type} + * @property {Enum} CType + * @property {Enum} JSType + * @const + * @tstype $protobuf.Type & { + * CType: $protobuf.Enum, + * JSType: $protobuf.Enum + * } + */ + +/** + * Reflected oneof options. + * @name OneofOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected enum options. + * @name EnumOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected enum value options. + * @name EnumValueOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected service options. + * @name ServiceOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected method options. + * @name MethodOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected uninterpretet option. + * @name UninterpretedOption + * @type {Type} + * @property {Type} NamePart + * @const + * @tstype $protobuf.Type & { + * NamePart: $protobuf.Type + * } + */ + +/** + * Reflected source code info. + * @name SourceCodeInfo + * @type {Type} + * @property {Type} Location + * @const + * @tstype $protobuf.Type & { + * Location: $protobuf.Type + * } + */ + +/** + * Reflected generated code info. + * @name GeneratedCodeInfo + * @type {Type} + * @property {Type} Annotation + * @const + * @tstype $protobuf.Type & { + * Annotation: $protobuf.Type + * } + */ diff --git a/node_modules/protobufjs/ext/descriptor/test.js b/node_modules/protobufjs/ext/descriptor/test.js new file mode 100644 index 0000000..ceb80f8 --- /dev/null +++ b/node_modules/protobufjs/ext/descriptor/test.js @@ -0,0 +1,54 @@ +/*eslint-disable no-console*/ +"use strict"; +var protobuf = require("../../"), + descriptor = require("."); + +/* var proto = { + nested: { + Message: { + fields: { + foo: { + type: "string", + id: 1 + } + }, + nested: { + SubMessage: { + fields: {} + } + } + }, + Enum: { + values: { + ONE: 1, + TWO: 2 + } + } + } +}; */ + +// var root = protobuf.Root.fromJSON(proto).resolveAll(); +var root = protobuf.loadSync("tests/data/google/protobuf/descriptor.proto").resolveAll(); + +// console.log("Original proto", JSON.stringify(root, null, 2)); + +var msg = root.toDescriptor(); + +// console.log("\nDescriptor", JSON.stringify(msg.toObject(), null, 2)); + +var buf = descriptor.FileDescriptorSet.encode(msg).finish(); +var root2 = protobuf.Root.fromDescriptor(buf, "proto2").resolveAll(); + +// console.log("\nDecoded proto", JSON.stringify(root2, null, 2)); + +var diff = require("deep-diff").diff(root.toJSON(), root2.toJSON()); +if (diff) { + diff.forEach(function(diff) { + console.log(diff.kind + " @ " + diff.path.join(".")); + console.log("lhs:", typeof diff.lhs, diff.lhs); + console.log("rhs:", typeof diff.rhs, diff.rhs); + console.log(); + }); + process.exitCode = 1; +} else + console.log("no differences"); diff --git a/node_modules/protobufjs/google/LICENSE b/node_modules/protobufjs/google/LICENSE new file mode 100644 index 0000000..868bd40 --- /dev/null +++ b/node_modules/protobufjs/google/LICENSE @@ -0,0 +1,27 @@ +Copyright 2014, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/protobufjs/google/README.md b/node_modules/protobufjs/google/README.md new file mode 100644 index 0000000..09e3f23 --- /dev/null +++ b/node_modules/protobufjs/google/README.md @@ -0,0 +1 @@ +This folder contains stripped and pre-parsed definitions of common Google types. These files are not used by protobuf.js directly but are here so you can use or include them where required. diff --git a/node_modules/protobufjs/google/api/annotations.json b/node_modules/protobufjs/google/api/annotations.json new file mode 100644 index 0000000..3f13a73 --- /dev/null +++ b/node_modules/protobufjs/google/api/annotations.json @@ -0,0 +1,83 @@ +{ + "nested": { + "google": { + "nested": { + "api": { + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "selector": { + "type": "string", + "id": 1 + }, + "body": { + "type": "string", + "id": 7 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + } + } + }, + "protobuf": { + "nested": { + "MethodOptions": { + "fields": {}, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/node_modules/protobufjs/google/api/annotations.proto b/node_modules/protobufjs/google/api/annotations.proto new file mode 100644 index 0000000..63a8eef --- /dev/null +++ b/node_modules/protobufjs/google/api/annotations.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MethodOptions { + + HttpRule http = 72295728; +} \ No newline at end of file diff --git a/node_modules/protobufjs/google/api/http.json b/node_modules/protobufjs/google/api/http.json new file mode 100644 index 0000000..e3a0f4f --- /dev/null +++ b/node_modules/protobufjs/google/api/http.json @@ -0,0 +1,86 @@ +{ + "nested": { + "google": { + "nested": { + "api": { + "nested": { + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "selector": { + "type": "string", + "id": 1 + }, + "body": { + "type": "string", + "id": 7 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/node_modules/protobufjs/google/api/http.proto b/node_modules/protobufjs/google/api/http.proto new file mode 100644 index 0000000..e9a7e9d --- /dev/null +++ b/node_modules/protobufjs/google/api/http.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package google.api; + +message Http { + + repeated HttpRule rules = 1; +} + +message HttpRule { + + oneof pattern { + + string get = 2; + string put = 3; + string post = 4; + string delete = 5; + string patch = 6; + CustomHttpPattern custom = 8; + } + + string selector = 1; + string body = 7; + repeated HttpRule additional_bindings = 11; +} + +message CustomHttpPattern { + + string kind = 1; + string path = 2; +} \ No newline at end of file diff --git a/node_modules/protobufjs/google/protobuf/api.json b/node_modules/protobufjs/google/protobuf/api.json new file mode 100644 index 0000000..5460612 --- /dev/null +++ b/node_modules/protobufjs/google/protobuf/api.json @@ -0,0 +1,118 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "nested": { + "Api": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "methods": { + "rule": "repeated", + "type": "Method", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + }, + "version": { + "type": "string", + "id": 4 + }, + "sourceContext": { + "type": "SourceContext", + "id": 5 + }, + "mixins": { + "rule": "repeated", + "type": "Mixin", + "id": 6 + }, + "syntax": { + "type": "Syntax", + "id": 7 + } + } + }, + "Method": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "requestTypeUrl": { + "type": "string", + "id": 2 + }, + "requestStreaming": { + "type": "bool", + "id": 3 + }, + "responseTypeUrl": { + "type": "string", + "id": 4 + }, + "responseStreaming": { + "type": "bool", + "id": 5 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 6 + }, + "syntax": { + "type": "Syntax", + "id": 7 + } + } + }, + "Mixin": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "root": { + "type": "string", + "id": 2 + } + } + }, + "SourceContext": { + "fields": { + "fileName": { + "type": "string", + "id": 1 + } + } + }, + "Option": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "Any", + "id": 2 + } + } + }, + "Syntax": { + "values": { + "SYNTAX_PROTO2": 0, + "SYNTAX_PROTO3": 1 + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/node_modules/protobufjs/google/protobuf/api.proto b/node_modules/protobufjs/google/protobuf/api.proto new file mode 100644 index 0000000..cf6ae3f --- /dev/null +++ b/node_modules/protobufjs/google/protobuf/api.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +message Api { + + string name = 1; + repeated Method methods = 2; + repeated Option options = 3; + string version = 4; + SourceContext source_context = 5; + repeated Mixin mixins = 6; + Syntax syntax = 7; +} + +message Method { + + string name = 1; + string request_type_url = 2; + bool request_streaming = 3; + string response_type_url = 4; + bool response_streaming = 5; + repeated Option options = 6; + Syntax syntax = 7; +} + +message Mixin { + + string name = 1; + string root = 2; +} \ No newline at end of file diff --git a/node_modules/protobufjs/google/protobuf/descriptor.json b/node_modules/protobufjs/google/protobuf/descriptor.json new file mode 100644 index 0000000..f6c5c11 --- /dev/null +++ b/node_modules/protobufjs/google/protobuf/descriptor.json @@ -0,0 +1,739 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5 + }, + "serverStreaming": { + "type": "bool", + "id": 6 + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10 + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27 + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16 + }, + "javaGenericServices": { + "type": "bool", + "id": 17 + }, + "pyGenericServices": { + "type": "bool", + "id": 18 + }, + "deprecated": { + "type": "bool", + "id": 23 + }, + "ccEnableArenas": { + "type": "bool", + "id": 31 + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1 + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "weak": { + "type": "bool", + "id": 10 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/node_modules/protobufjs/google/protobuf/descriptor.proto b/node_modules/protobufjs/google/protobuf/descriptor.proto new file mode 100644 index 0000000..3279492 --- /dev/null +++ b/node_modules/protobufjs/google/protobuf/descriptor.proto @@ -0,0 +1,286 @@ +syntax = "proto2"; + +package google.protobuf; + +message FileDescriptorSet { + + repeated FileDescriptorProto file = 1; +} + +message FileDescriptorProto { + + optional string name = 1; + optional string package = 2; + repeated string dependency = 3; + repeated int32 public_dependency = 10; + repeated int32 weak_dependency = 11; + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + optional FileOptions options = 8; + optional SourceCodeInfo source_code_info = 9; + optional string syntax = 12; +} + +message DescriptorProto { + + optional string name = 1; + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + repeated ExtensionRange extension_range = 5; + repeated OneofDescriptorProto oneof_decl = 8; + optional MessageOptions options = 7; + repeated ReservedRange reserved_range = 9; + repeated string reserved_name = 10; + + message ExtensionRange { + + optional int32 start = 1; + optional int32 end = 2; + } + + message ReservedRange { + + optional int32 start = 1; + optional int32 end = 2; + } +} + +message FieldDescriptorProto { + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + optional Type type = 5; + optional string type_name = 6; + optional string extendee = 2; + optional string default_value = 7; + optional int32 oneof_index = 9; + optional string json_name = 10; + optional FieldOptions options = 8; + + enum Type { + + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; + TYPE_SINT64 = 18; + } + + enum Label { + + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } +} + +message OneofDescriptorProto { + + optional string name = 1; + optional OneofOptions options = 2; +} + +message EnumDescriptorProto { + + optional string name = 1; + repeated EnumValueDescriptorProto value = 2; + optional EnumOptions options = 3; +} + +message EnumValueDescriptorProto { + + optional string name = 1; + optional int32 number = 2; + optional EnumValueOptions options = 3; +} + +message ServiceDescriptorProto { + + optional string name = 1; + repeated MethodDescriptorProto method = 2; + optional ServiceOptions options = 3; +} + +message MethodDescriptorProto { + + optional string name = 1; + optional string input_type = 2; + optional string output_type = 3; + optional MethodOptions options = 4; + optional bool client_streaming = 5; + optional bool server_streaming = 6; +} + +message FileOptions { + + optional string java_package = 1; + optional string java_outer_classname = 8; + optional bool java_multiple_files = 10; + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + optional bool java_string_check_utf8 = 27; + optional OptimizeMode optimize_for = 9 [default=SPEED]; + optional string go_package = 11; + optional bool cc_generic_services = 16; + optional bool java_generic_services = 17; + optional bool py_generic_services = 18; + optional bool deprecated = 23; + optional bool cc_enable_arenas = 31; + optional string objc_class_prefix = 36; + optional string csharp_namespace = 37; + repeated UninterpretedOption uninterpreted_option = 999; + + enum OptimizeMode { + + SPEED = 1; + CODE_SIZE = 2; + LITE_RUNTIME = 3; + } + + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + + optional bool message_set_wire_format = 1; + optional bool no_standard_descriptor_accessor = 2; + optional bool deprecated = 3; + optional bool map_entry = 7; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; + + reserved 8; +} + +message FieldOptions { + + optional CType ctype = 1 [default=STRING]; + optional bool packed = 2; + optional JSType jstype = 6 [default=JS_NORMAL]; + optional bool lazy = 5; + optional bool deprecated = 3; + optional bool weak = 10; + repeated UninterpretedOption uninterpreted_option = 999; + + enum CType { + + STRING = 0; + CORD = 1; + STRING_PIECE = 2; + } + + enum JSType { + + JS_NORMAL = 0; + JS_STRING = 1; + JS_NUMBER = 2; + } + + extensions 1000 to max; + + reserved 4; +} + +message OneofOptions { + + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message EnumOptions { + + optional bool allow_alias = 2; + optional bool deprecated = 3; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message EnumValueOptions { + + optional bool deprecated = 1; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message ServiceOptions { + + optional bool deprecated = 33; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message MethodOptions { + + optional bool deprecated = 33; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message UninterpretedOption { + + repeated NamePart name = 2; + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; + + message NamePart { + + required string name_part = 1; + required bool is_extension = 2; + } +} + +message SourceCodeInfo { + + repeated Location location = 1; + + message Location { + + repeated int32 path = 1 [packed=true]; + repeated int32 span = 2 [packed=true]; + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +message GeneratedCodeInfo { + + repeated Annotation annotation = 1; + + message Annotation { + + repeated int32 path = 1 [packed=true]; + optional string source_file = 2; + optional int32 begin = 3; + optional int32 end = 4; + } +} diff --git a/node_modules/protobufjs/google/protobuf/source_context.json b/node_modules/protobufjs/google/protobuf/source_context.json new file mode 100644 index 0000000..51adb63 --- /dev/null +++ b/node_modules/protobufjs/google/protobuf/source_context.json @@ -0,0 +1,20 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "nested": { + "SourceContext": { + "fields": { + "fileName": { + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/node_modules/protobufjs/google/protobuf/source_context.proto b/node_modules/protobufjs/google/protobuf/source_context.proto new file mode 100644 index 0000000..584d36c --- /dev/null +++ b/node_modules/protobufjs/google/protobuf/source_context.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +package google.protobuf; + +message SourceContext { + string file_name = 1; +} diff --git a/node_modules/protobufjs/google/protobuf/type.json b/node_modules/protobufjs/google/protobuf/type.json new file mode 100644 index 0000000..fffa70d --- /dev/null +++ b/node_modules/protobufjs/google/protobuf/type.json @@ -0,0 +1,202 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "nested": { + "Type": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "fields": { + "rule": "repeated", + "type": "Field", + "id": 2 + }, + "oneofs": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 4 + }, + "sourceContext": { + "type": "SourceContext", + "id": 5 + }, + "syntax": { + "type": "Syntax", + "id": 6 + } + } + }, + "Field": { + "fields": { + "kind": { + "type": "Kind", + "id": 1 + }, + "cardinality": { + "type": "Cardinality", + "id": 2 + }, + "number": { + "type": "int32", + "id": 3 + }, + "name": { + "type": "string", + "id": 4 + }, + "typeUrl": { + "type": "string", + "id": 6 + }, + "oneofIndex": { + "type": "int32", + "id": 7 + }, + "packed": { + "type": "bool", + "id": 8 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "defaultValue": { + "type": "string", + "id": 11 + } + }, + "nested": { + "Kind": { + "values": { + "TYPE_UNKNOWN": 0, + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Cardinality": { + "values": { + "CARDINALITY_UNKNOWN": 0, + "CARDINALITY_OPTIONAL": 1, + "CARDINALITY_REQUIRED": 2, + "CARDINALITY_REPEATED": 3 + } + } + } + }, + "Enum": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enumvalue": { + "rule": "repeated", + "type": "EnumValue", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + }, + "sourceContext": { + "type": "SourceContext", + "id": 4 + }, + "syntax": { + "type": "Syntax", + "id": 5 + } + } + }, + "EnumValue": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + } + } + }, + "Option": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "Any", + "id": 2 + } + } + }, + "Syntax": { + "values": { + "SYNTAX_PROTO2": 0, + "SYNTAX_PROTO3": 1 + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "SourceContext": { + "fields": { + "fileName": { + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/node_modules/protobufjs/google/protobuf/type.proto b/node_modules/protobufjs/google/protobuf/type.proto new file mode 100644 index 0000000..8ee445b --- /dev/null +++ b/node_modules/protobufjs/google/protobuf/type.proto @@ -0,0 +1,89 @@ +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +message Type { + + string name = 1; + repeated Field fields = 2; + repeated string oneofs = 3; + repeated Option options = 4; + SourceContext source_context = 5; + Syntax syntax = 6; +} + +message Field { + + Kind kind = 1; + Cardinality cardinality = 2; + int32 number = 3; + string name = 4; + string type_url = 6; + int32 oneof_index = 7; + bool packed = 8; + repeated Option options = 9; + string json_name = 10; + string default_value = 11; + + enum Kind { + + TYPE_UNKNOWN = 0; + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; + TYPE_SINT64 = 18; + } + + enum Cardinality { + + CARDINALITY_UNKNOWN = 0; + CARDINALITY_OPTIONAL = 1; + CARDINALITY_REQUIRED = 2; + CARDINALITY_REPEATED = 3; + } +} + +message Enum { + + string name = 1; + repeated EnumValue enumvalue = 2; + repeated Option options = 3; + SourceContext source_context = 4; + Syntax syntax = 5; +} + +message EnumValue { + + string name = 1; + int32 number = 2; + repeated Option options = 3; +} + +message Option { + + string name = 1; + Any value = 2; +} + +enum Syntax { + + SYNTAX_PROTO2 = 0; + SYNTAX_PROTO3 = 1; +} diff --git a/node_modules/protobufjs/index.d.ts b/node_modules/protobufjs/index.d.ts new file mode 100644 index 0000000..e65d5ff --- /dev/null +++ b/node_modules/protobufjs/index.d.ts @@ -0,0 +1,2694 @@ +// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run types'. + +export as namespace protobuf; + +/** + * Provides common type definitions. + * Can also be used to provide additional google types or your own custom types. + * @param name Short name as in `google/protobuf/[name].proto` or full file name + * @param json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition + */ +export function common(name: string, json: { [k: string]: any }): void; + +export namespace common { + + /** Properties of a google.protobuf.Any message. */ + interface IAny { + typeUrl?: string; + bytes?: Uint8Array; + } + + /** Properties of a google.protobuf.Duration message. */ + interface IDuration { + seconds?: (number|Long); + nanos?: number; + } + + /** Properties of a google.protobuf.Timestamp message. */ + interface ITimestamp { + seconds?: (number|Long); + nanos?: number; + } + + /** Properties of a google.protobuf.Empty message. */ + interface IEmpty { + } + + /** Properties of a google.protobuf.Struct message. */ + interface IStruct { + fields?: { [k: string]: IValue }; + } + + /** Properties of a google.protobuf.Value message. */ + interface IValue { + kind?: string; + nullValue?: 0; + numberValue?: number; + stringValue?: string; + boolValue?: boolean; + structValue?: IStruct; + listValue?: IListValue; + } + + /** Properties of a google.protobuf.ListValue message. */ + interface IListValue { + values?: IValue[]; + } + + /** Properties of a google.protobuf.DoubleValue message. */ + interface IDoubleValue { + value?: number; + } + + /** Properties of a google.protobuf.FloatValue message. */ + interface IFloatValue { + value?: number; + } + + /** Properties of a google.protobuf.Int64Value message. */ + interface IInt64Value { + value?: (number|Long); + } + + /** Properties of a google.protobuf.UInt64Value message. */ + interface IUInt64Value { + value?: (number|Long); + } + + /** Properties of a google.protobuf.Int32Value message. */ + interface IInt32Value { + value?: number; + } + + /** Properties of a google.protobuf.UInt32Value message. */ + interface IUInt32Value { + value?: number; + } + + /** Properties of a google.protobuf.BoolValue message. */ + interface IBoolValue { + value?: boolean; + } + + /** Properties of a google.protobuf.StringValue message. */ + interface IStringValue { + value?: string; + } + + /** Properties of a google.protobuf.BytesValue message. */ + interface IBytesValue { + value?: Uint8Array; + } + + /** + * Gets the root definition of the specified common proto file. + * + * Bundled definitions are: + * - google/protobuf/any.proto + * - google/protobuf/duration.proto + * - google/protobuf/empty.proto + * - google/protobuf/field_mask.proto + * - google/protobuf/struct.proto + * - google/protobuf/timestamp.proto + * - google/protobuf/wrappers.proto + * + * @param file Proto file name + * @returns Root definition or `null` if not defined + */ + function get(file: string): (INamespace|null); +} + +/** Runtime message from/to plain object converters. */ +export namespace converter { + + /** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ + function fromObject(mtype: Type): Codegen; + + /** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ + function toObject(mtype: Type): Codegen; +} + +/** + * Generates a decoder specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ +export function decoder(mtype: Type): Codegen; + +/** + * Generates an encoder specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ +export function encoder(mtype: Type): Codegen; + +/** Reflected enum. */ +export class Enum extends ReflectionObject { + + /** + * Constructs a new enum instance. + * @param name Unique name within its namespace + * @param [values] Enum values as an object, by name + * @param [options] Declared options + * @param [comment] The comment for this enum + * @param [comments] The value comments for this enum + */ + constructor(name: string, values?: { [k: string]: number }, options?: { [k: string]: any }, comment?: string, comments?: { [k: string]: string }); + + /** Enum values by id. */ + public valuesById: { [k: number]: string }; + + /** Enum values by name. */ + public values: { [k: string]: number }; + + /** Enum comment text. */ + public comment: (string|null); + + /** Value comment texts, if any. */ + public comments: { [k: string]: string }; + + /** Reserved ranges, if any. */ + public reserved: (number[]|string)[]; + + /** + * Constructs an enum from an enum descriptor. + * @param name Enum name + * @param json Enum descriptor + * @returns Created enum + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IEnum): Enum; + + /** + * Converts this enum to an enum descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Enum descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IEnum; + + /** + * Adds a value to this enum. + * @param name Value name + * @param id Value id + * @param [comment] Comment, if any + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ + public add(name: string, id: number, comment?: string): Enum; + + /** + * Removes a value from this enum + * @param name Value name + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ + public remove(name: string): Enum; + + /** + * Tests if the specified id is reserved. + * @param id Id to test + * @returns `true` if reserved, otherwise `false` + */ + public isReservedId(id: number): boolean; + + /** + * Tests if the specified name is reserved. + * @param name Name to test + * @returns `true` if reserved, otherwise `false` + */ + public isReservedName(name: string): boolean; +} + +/** Enum descriptor. */ +export interface IEnum { + + /** Enum values */ + values: { [k: string]: number }; + + /** Enum options */ + options?: { [k: string]: any }; +} + +/** Reflected message field. */ +export class Field extends FieldBase { + + /** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @param name Unique name within its namespace + * @param id Unique id within its namespace + * @param type Value type + * @param [rule="optional"] Field rule + * @param [extend] Extended type if different from parent + * @param [options] Declared options + */ + constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any }); + + /** + * Constructs a field from a field descriptor. + * @param name Field name + * @param json Field descriptor + * @returns Created field + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IField): Field; + + /** Determines whether this field is packed. Only relevant when repeated and working with proto2. */ + public readonly packed: boolean; + + /** + * Field decorator (TypeScript). + * @param fieldId Field id + * @param fieldType Field type + * @param [fieldRule="optional"] Field rule + * @param [defaultValue] Default value + * @returns Decorator function + */ + public static d(fieldId: number, fieldType: ("double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|object), fieldRule?: ("optional"|"required"|"repeated"), defaultValue?: T): FieldDecorator; + + /** + * Field decorator (TypeScript). + * @param fieldId Field id + * @param fieldType Field type + * @param [fieldRule="optional"] Field rule + * @returns Decorator function + */ + public static d>(fieldId: number, fieldType: (Constructor|string), fieldRule?: ("optional"|"required"|"repeated")): FieldDecorator; +} + +/** Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. */ +export class FieldBase extends ReflectionObject { + + /** + * Not an actual constructor. Use {@link Field} instead. + * @param name Unique name within its namespace + * @param id Unique id within its namespace + * @param type Value type + * @param [rule="optional"] Field rule + * @param [extend] Extended type if different from parent + * @param [options] Declared options + * @param [comment] Comment associated with this field + */ + constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); + + /** Field rule, if any. */ + public rule?: string; + + /** Field type. */ + public type: string; + + /** Unique field id. */ + public id: number; + + /** Extended type if different from parent. */ + public extend?: string; + + /** Whether this field is required. */ + public required: boolean; + + /** Whether this field is optional. */ + public optional: boolean; + + /** Whether this field is repeated. */ + public repeated: boolean; + + /** Whether this field is a map or not. */ + public map: boolean; + + /** Message this field belongs to. */ + public message: (Type|null); + + /** OneOf this field belongs to, if any, */ + public partOf: (OneOf|null); + + /** The field type's default value. */ + public typeDefault: any; + + /** The field's default value on prototypes. */ + public defaultValue: any; + + /** Whether this field's value should be treated as a long. */ + public long: boolean; + + /** Whether this field's value is a buffer. */ + public bytes: boolean; + + /** Resolved type if not a basic type. */ + public resolvedType: (Type|Enum|null); + + /** Sister-field within the extended type if a declaring extension field. */ + public extensionField: (Field|null); + + /** Sister-field within the declaring namespace if an extended field. */ + public declaringField: (Field|null); + + /** Comment for this field. */ + public comment: (string|null); + + /** + * Converts this field to a field descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Field descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IField; + + /** + * Resolves this field's type references. + * @returns `this` + * @throws {Error} If any reference cannot be resolved + */ + public resolve(): Field; +} + +/** Field descriptor. */ +export interface IField { + + /** Field rule */ + rule?: string; + + /** Field type */ + type: string; + + /** Field id */ + id: number; + + /** Field options */ + options?: { [k: string]: any }; +} + +/** Extension field descriptor. */ +export interface IExtensionField extends IField { + + /** Extended type */ + extend: string; +} + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @param prototype Target prototype + * @param fieldName Field name + */ +type FieldDecorator = (prototype: object, fieldName: string) => void; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @param error Error, if any, otherwise `null` + * @param [root] Root, if there hasn't been an error + */ +type LoadCallback = (error: (Error|null), root?: Root) => void; + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param filename One or multiple files to load + * @param root Root namespace, defaults to create a new one if omitted. + * @param callback Callback function + * @see {@link Root#load} + */ +export function load(filename: (string|string[]), root: Root, callback: LoadCallback): void; + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param filename One or multiple files to load + * @param callback Callback function + * @see {@link Root#load} + */ +export function load(filename: (string|string[]), callback: LoadCallback): void; + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @param filename One or multiple files to load + * @param [root] Root namespace, defaults to create a new one if omitted. + * @returns Promise + * @see {@link Root#load} + */ +export function load(filename: (string|string[]), root?: Root): Promise; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param filename One or multiple files to load + * @param [root] Root namespace, defaults to create a new one if omitted. + * @returns Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +export function loadSync(filename: (string|string[]), root?: Root): Root; + +/** Build type, one of `"full"`, `"light"` or `"minimal"`. */ +export const build: string; + +/** Reconfigures the library according to the environment. */ +export function configure(): void; + +/** Reflected map field. */ +export class MapField extends FieldBase { + + /** + * Constructs a new map field instance. + * @param name Unique name within its namespace + * @param id Unique id within its namespace + * @param keyType Key type + * @param type Value type + * @param [options] Declared options + * @param [comment] Comment associated with this field + */ + constructor(name: string, id: number, keyType: string, type: string, options?: { [k: string]: any }, comment?: string); + + /** Key type. */ + public keyType: string; + + /** Resolved key type if not a basic type. */ + public resolvedKeyType: (ReflectionObject|null); + + /** + * Constructs a map field from a map field descriptor. + * @param name Field name + * @param json Map field descriptor + * @returns Created map field + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IMapField): MapField; + + /** + * Converts this map field to a map field descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Map field descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IMapField; + + /** + * Map field decorator (TypeScript). + * @param fieldId Field id + * @param fieldKeyType Field key type + * @param fieldValueType Field value type + * @returns Decorator function + */ + public static d }>(fieldId: number, fieldKeyType: ("int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"), fieldValueType: ("double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|object|Constructor<{}>)): FieldDecorator; +} + +/** Map field descriptor. */ +export interface IMapField extends IField { + + /** Key type */ + keyType: string; +} + +/** Extension map field descriptor. */ +export interface IExtensionMapField extends IMapField { + + /** Extended type */ + extend: string; +} + +/** Abstract runtime message. */ +export class Message { + + /** + * Constructs a new message instance. + * @param [properties] Properties to set + */ + constructor(properties?: Properties); + + /** Reference to the reflected type. */ + public static readonly $type: Type; + + /** Reference to the reflected type. */ + public readonly $type: Type; + + /** + * Creates a new message of this type using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create>(this: Constructor, properties?: { [k: string]: any }): Message; + + /** + * Encodes a message of this type. + * @param message Message to encode + * @param [writer] Writer to use + * @returns Writer + */ + public static encode>(this: Constructor, message: (T|{ [k: string]: any }), writer?: Writer): Writer; + + /** + * Encodes a message of this type preceeded by its length as a varint. + * @param message Message to encode + * @param [writer] Writer to use + * @returns Writer + */ + public static encodeDelimited>(this: Constructor, message: (T|{ [k: string]: any }), writer?: Writer): Writer; + + /** + * Decodes a message of this type. + * @param reader Reader or buffer to decode + * @returns Decoded message + */ + public static decode>(this: Constructor, reader: (Reader|Uint8Array)): T; + + /** + * Decodes a message of this type preceeded by its length as a varint. + * @param reader Reader or buffer to decode + * @returns Decoded message + */ + public static decodeDelimited>(this: Constructor, reader: (Reader|Uint8Array)): T; + + /** + * Verifies a message of this type. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message instance + */ + public static fromObject>(this: Constructor, object: { [k: string]: any }): T; + + /** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param message Message instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject>(this: Constructor, message: T, options?: IConversionOptions): { [k: string]: any }; + + /** + * Converts this message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Reflected service method. */ +export class Method extends ReflectionObject { + + /** + * Constructs a new service method instance. + * @param name Method name + * @param type Method type, usually `"rpc"` + * @param requestType Request message type + * @param responseType Response message type + * @param [requestStream] Whether the request is streamed + * @param [responseStream] Whether the response is streamed + * @param [options] Declared options + * @param [comment] The comment for this method + */ + constructor(name: string, type: (string|undefined), requestType: string, responseType: string, requestStream?: (boolean|{ [k: string]: any }), responseStream?: (boolean|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); + + /** Method type. */ + public type: string; + + /** Request type. */ + public requestType: string; + + /** Whether requests are streamed or not. */ + public requestStream?: boolean; + + /** Response type. */ + public responseType: string; + + /** Whether responses are streamed or not. */ + public responseStream?: boolean; + + /** Resolved request type. */ + public resolvedRequestType: (Type|null); + + /** Resolved response type. */ + public resolvedResponseType: (Type|null); + + /** Comment for this method */ + public comment: (string|null); + + /** + * Constructs a method from a method descriptor. + * @param name Method name + * @param json Method descriptor + * @returns Created method + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IMethod): Method; + + /** + * Converts this method to a method descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Method descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IMethod; +} + +/** Method descriptor. */ +export interface IMethod { + + /** Method type */ + type?: string; + + /** Request type */ + requestType: string; + + /** Response type */ + responseType: string; + + /** Whether requests are streamed */ + requestStream?: boolean; + + /** Whether responses are streamed */ + responseStream?: boolean; + + /** Method options */ + options?: { [k: string]: any }; +} + +/** Reflected namespace. */ +export class Namespace extends NamespaceBase { + + /** + * Constructs a new namespace instance. + * @param name Namespace name + * @param [options] Declared options + */ + constructor(name: string, options?: { [k: string]: any }); + + /** + * Constructs a namespace from JSON. + * @param name Namespace name + * @param json JSON object + * @returns Created namespace + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: { [k: string]: any }): Namespace; + + /** + * Converts an array of reflection objects to JSON. + * @param array Object array + * @param [toJSONOptions] JSON conversion options + * @returns JSON object or `undefined` when array is empty + */ + public static arrayToJSON(array: ReflectionObject[], toJSONOptions?: IToJSONOptions): ({ [k: string]: any }|undefined); + + /** + * Tests if the specified id is reserved. + * @param reserved Array of reserved ranges and names + * @param id Id to test + * @returns `true` if reserved, otherwise `false` + */ + public static isReservedId(reserved: ((number[]|string)[]|undefined), id: number): boolean; + + /** + * Tests if the specified name is reserved. + * @param reserved Array of reserved ranges and names + * @param name Name to test + * @returns `true` if reserved, otherwise `false` + */ + public static isReservedName(reserved: ((number[]|string)[]|undefined), name: string): boolean; +} + +/** Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. */ +export abstract class NamespaceBase extends ReflectionObject { + + /** Nested objects by name. */ + public nested?: { [k: string]: ReflectionObject }; + + /** Nested objects of this namespace as an array for iteration. */ + public readonly nestedArray: ReflectionObject[]; + + /** + * Converts this namespace to a namespace descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Namespace descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): INamespace; + + /** + * Adds nested objects to this namespace from nested object descriptors. + * @param nestedJson Any nested object descriptors + * @returns `this` + */ + public addJSON(nestedJson: { [k: string]: AnyNestedObject }): Namespace; + + /** + * Gets the nested object of the specified name. + * @param name Nested object name + * @returns The reflection object or `null` if it doesn't exist + */ + public get(name: string): (ReflectionObject|null); + + /** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param name Nested enum name + * @returns Enum values + * @throws {Error} If there is no such enum + */ + public getEnum(name: string): { [k: string]: number }; + + /** + * Adds a nested object to this namespace. + * @param object Nested object to add + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ + public add(object: ReflectionObject): Namespace; + + /** + * Removes a nested object from this namespace. + * @param object Nested object to remove + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ + public remove(object: ReflectionObject): Namespace; + + /** + * Defines additial namespaces within this one if not yet existing. + * @param path Path to create + * @param [json] Nested types to create from JSON + * @returns Pointer to the last namespace created or `this` if path is empty + */ + public define(path: (string|string[]), json?: any): Namespace; + + /** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns `this` + */ + public resolveAll(): Namespace; + + /** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param path Path to look up + * @param filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns Looked up object or `null` if none could be found + */ + public lookup(path: (string|string[]), filterTypes: (any|any[]), parentAlreadyChecked?: boolean): (ReflectionObject|null); + + /** + * Looks up the reflection object at the specified path, relative to this namespace. + * @param path Path to look up + * @param [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns Looked up object or `null` if none could be found + */ + public lookup(path: (string|string[]), parentAlreadyChecked?: boolean): (ReflectionObject|null); + + /** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param path Path to look up + * @returns Looked up type + * @throws {Error} If `path` does not point to a type + */ + public lookupType(path: (string|string[])): Type; + + /** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param path Path to look up + * @returns Looked up enum + * @throws {Error} If `path` does not point to an enum + */ + public lookupEnum(path: (string|string[])): Enum; + + /** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param path Path to look up + * @returns Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ + public lookupTypeOrEnum(path: (string|string[])): Type; + + /** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param path Path to look up + * @returns Looked up service + * @throws {Error} If `path` does not point to a service + */ + public lookupService(path: (string|string[])): Service; +} + +/** Namespace descriptor. */ +export interface INamespace { + + /** Namespace options */ + options?: { [k: string]: any }; + + /** Nested object descriptors */ + nested?: { [k: string]: AnyNestedObject }; +} + +/** Any extension field descriptor. */ +type AnyExtensionField = (IExtensionField|IExtensionMapField); + +/** Any nested object descriptor. */ +type AnyNestedObject = (IEnum|IType|IService|AnyExtensionField|INamespace); + +/** Base class of all reflection objects. */ +export abstract class ReflectionObject { + + /** Options. */ + public options?: { [k: string]: any }; + + /** Unique name within its namespace. */ + public name: string; + + /** Parent namespace. */ + public parent: (Namespace|null); + + /** Whether already resolved or not. */ + public resolved: boolean; + + /** Comment text, if any. */ + public comment: (string|null); + + /** Defining file name. */ + public filename: (string|null); + + /** Reference to the root namespace. */ + public readonly root: Root; + + /** Full name including leading dot. */ + public readonly fullName: string; + + /** + * Converts this reflection object to its descriptor representation. + * @returns Descriptor + */ + public toJSON(): { [k: string]: any }; + + /** + * Called when this object is added to a parent. + * @param parent Parent added to + */ + public onAdd(parent: ReflectionObject): void; + + /** + * Called when this object is removed from a parent. + * @param parent Parent removed from + */ + public onRemove(parent: ReflectionObject): void; + + /** + * Resolves this objects type references. + * @returns `this` + */ + public resolve(): ReflectionObject; + + /** + * Gets an option value. + * @param name Option name + * @returns Option value or `undefined` if not set + */ + public getOption(name: string): any; + + /** + * Sets an option. + * @param name Option name + * @param value Option value + * @param [ifNotSet] Sets the option only if it isn't currently set + * @returns `this` + */ + public setOption(name: string, value: any, ifNotSet?: boolean): ReflectionObject; + + /** + * Sets multiple options. + * @param options Options to set + * @param [ifNotSet] Sets an option only if it isn't currently set + * @returns `this` + */ + public setOptions(options: { [k: string]: any }, ifNotSet?: boolean): ReflectionObject; + + /** + * Converts this instance to its string representation. + * @returns Class name[, space, full name] + */ + public toString(): string; +} + +/** Reflected oneof. */ +export class OneOf extends ReflectionObject { + + /** + * Constructs a new oneof instance. + * @param name Oneof name + * @param [fieldNames] Field names + * @param [options] Declared options + * @param [comment] Comment associated with this field + */ + constructor(name: string, fieldNames?: (string[]|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); + + /** Field names that belong to this oneof. */ + public oneof: string[]; + + /** Fields that belong to this oneof as an array for iteration. */ + public readonly fieldsArray: Field[]; + + /** Comment for this field. */ + public comment: (string|null); + + /** + * Constructs a oneof from a oneof descriptor. + * @param name Oneof name + * @param json Oneof descriptor + * @returns Created oneof + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IOneOf): OneOf; + + /** + * Converts this oneof to a oneof descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Oneof descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IOneOf; + + /** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param field Field to add + * @returns `this` + */ + public add(field: Field): OneOf; + + /** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param field Field to remove + * @returns `this` + */ + public remove(field: Field): OneOf; + + /** + * OneOf decorator (TypeScript). + * @param fieldNames Field names + * @returns Decorator function + */ + public static d(...fieldNames: string[]): OneOfDecorator; +} + +/** Oneof descriptor. */ +export interface IOneOf { + + /** Oneof field names */ + oneof: string[]; + + /** Oneof options */ + options?: { [k: string]: any }; +} + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @param prototype Target prototype + * @param oneofName OneOf name + */ +type OneOfDecorator = (prototype: object, oneofName: string) => void; + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @param source Source contents + * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns Parser result + */ +export function parse(source: string, options?: IParseOptions): IParserResult; + +/** Result object returned from {@link parse}. */ +export interface IParserResult { + + /** Package name, if declared */ + package: (string|undefined); + + /** Imports, if any */ + imports: (string[]|undefined); + + /** Weak imports, if any */ + weakImports: (string[]|undefined); + + /** Syntax, if specified (either `"proto2"` or `"proto3"`) */ + syntax: (string|undefined); + + /** Populated root instance */ + root: Root; +} + +/** Options modifying the behavior of {@link parse}. */ +export interface IParseOptions { + + /** Keeps field casing instead of converting to camel case */ + keepCase?: boolean; + + /** Recognize double-slash comments in addition to doc-block comments. */ + alternateCommentMode?: boolean; +} + +/** Options modifying the behavior of JSON serialization. */ +export interface IToJSONOptions { + + /** Serializes comments. */ + keepComments?: boolean; +} + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @param source Source contents + * @param root Root to populate + * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns Parser result + */ +export function parse(source: string, root: Root, options?: IParseOptions): IParserResult; + +/** Wire format reader using `Uint8Array` if available, otherwise `Array`. */ +export class Reader { + + /** + * Constructs a new reader instance using the specified buffer. + * @param buffer Buffer to read from + */ + constructor(buffer: Uint8Array); + + /** Read buffer. */ + public buf: Uint8Array; + + /** Read buffer position. */ + public pos: number; + + /** Read buffer length. */ + public len: number; + + /** + * Creates a new reader using the specified buffer. + * @param buffer Buffer to read from + * @returns A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ + public static create(buffer: (Uint8Array|Buffer)): (Reader|BufferReader); + + /** + * Reads a varint as an unsigned 32 bit value. + * @returns Value read + */ + public uint32(): number; + + /** + * Reads a varint as a signed 32 bit value. + * @returns Value read + */ + public int32(): number; + + /** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns Value read + */ + public sint32(): number; + + /** + * Reads a varint as a signed 64 bit value. + * @returns Value read + */ + public int64(): Long; + + /** + * Reads a varint as an unsigned 64 bit value. + * @returns Value read + */ + public uint64(): Long; + + /** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @returns Value read + */ + public sint64(): Long; + + /** + * Reads a varint as a boolean. + * @returns Value read + */ + public bool(): boolean; + + /** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns Value read + */ + public fixed32(): number; + + /** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns Value read + */ + public sfixed32(): number; + + /** + * Reads fixed 64 bits. + * @returns Value read + */ + public fixed64(): Long; + + /** + * Reads zig-zag encoded fixed 64 bits. + * @returns Value read + */ + public sfixed64(): Long; + + /** + * Reads a float (32 bit) as a number. + * @returns Value read + */ + public float(): number; + + /** + * Reads a double (64 bit float) as a number. + * @returns Value read + */ + public double(): number; + + /** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns Value read + */ + public bytes(): Uint8Array; + + /** + * Reads a string preceeded by its byte length as a varint. + * @returns Value read + */ + public string(): string; + + /** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param [length] Length if known, otherwise a varint is assumed + * @returns `this` + */ + public skip(length?: number): Reader; + + /** + * Skips the next element of the specified wire type. + * @param wireType Wire type received + * @returns `this` + */ + public skipType(wireType: number): Reader; +} + +/** Wire format reader using node buffers. */ +export class BufferReader extends Reader { + + /** + * Constructs a new buffer reader instance. + * @param buffer Buffer to read from + */ + constructor(buffer: Buffer); + + /** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns Value read + */ + public bytes(): Buffer; +} + +/** Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. */ +export class Root extends NamespaceBase { + + /** + * Constructs a new root namespace instance. + * @param [options] Top level options + */ + constructor(options?: { [k: string]: any }); + + /** Deferred extension fields. */ + public deferred: Field[]; + + /** Resolved file names of loaded files. */ + public files: string[]; + + /** + * Loads a namespace descriptor into a root namespace. + * @param json Nameespace descriptor + * @param [root] Root namespace, defaults to create a new one if omitted + * @returns Root namespace + */ + public static fromJSON(json: INamespace, root?: Root): Root; + + /** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @param origin The file name of the importing file + * @param target The file name being imported + * @returns Resolved path to `target` or `null` to skip the file + */ + public resolvePath(origin: string, target: string): (string|null); + + /** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param filename Names of one or multiple files to load + * @param options Parse options + * @param callback Callback function + */ + public load(filename: (string|string[]), options: IParseOptions, callback: LoadCallback): void; + + /** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param filename Names of one or multiple files to load + * @param callback Callback function + */ + public load(filename: (string|string[]), callback: LoadCallback): void; + + /** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @param filename Names of one or multiple files to load + * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns Promise + */ + public load(filename: (string|string[]), options?: IParseOptions): Promise; + + /** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @param filename Names of one or multiple files to load + * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ + public loadSync(filename: (string|string[]), options?: IParseOptions): Root; +} + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + */ +export let roots: { [k: string]: Root }; + +/** Streaming RPC helpers. */ +export namespace rpc { + + /** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @param error Error, if any + * @param [response] Response message + */ + type ServiceMethodCallback> = (error: (Error|null), response?: TRes) => void; + + /** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @param request Request message or plain object + * @param [callback] Node-style callback called with the error, if any, and the response message + * @returns Promise if `callback` has been omitted, otherwise `undefined` + */ + type ServiceMethod, TRes extends Message> = (request: (TReq|Properties), callback?: rpc.ServiceMethodCallback) => Promise>; + + /** An RPC service as returned by {@link Service#create}. */ + class Service extends util.EventEmitter { + + /** + * Constructs a new RPC service instance. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** RPC implementation. Becomes `null` once the service is ended. */ + public rpcImpl: (RPCImpl|null); + + /** Whether requests are length-delimited. */ + public requestDelimited: boolean; + + /** Whether responses are length-delimited. */ + public responseDelimited: boolean; + + /** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param method Reflected or static method + * @param requestCtor Request constructor + * @param responseCtor Response constructor + * @param request Request message or plain object + * @param callback Service callback + */ + public rpcCall, TRes extends Message>(method: (Method|rpc.ServiceMethod), requestCtor: Constructor, responseCtor: Constructor, request: (TReq|Properties), callback: rpc.ServiceMethodCallback): void; + + /** + * Ends this service and emits the `end` event. + * @param [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns `this` + */ + public end(endedByRPC?: boolean): rpc.Service; + } +} + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @param method Reflected or static method being called + * @param requestData Request data + * @param callback Callback function + */ +type RPCImpl = (method: (Method|rpc.ServiceMethod, Message<{}>>), requestData: Uint8Array, callback: RPCImplCallback) => void; + +/** + * Node-style callback as used by {@link RPCImpl}. + * @param error Error, if any, otherwise `null` + * @param [response] Response data or `null` to signal end of stream, if there hasn't been an error + */ +type RPCImplCallback = (error: (Error|null), response?: (Uint8Array|null)) => void; + +/** Reflected service. */ +export class Service extends NamespaceBase { + + /** + * Constructs a new service instance. + * @param name Service name + * @param [options] Service options + * @throws {TypeError} If arguments are invalid + */ + constructor(name: string, options?: { [k: string]: any }); + + /** Service methods. */ + public methods: { [k: string]: Method }; + + /** + * Constructs a service from a service descriptor. + * @param name Service name + * @param json Service descriptor + * @returns Created service + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IService): Service; + + /** + * Converts this service to a service descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Service descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IService; + + /** Methods of this service as an array for iteration. */ + public readonly methodsArray: Method[]; + + /** + * Creates a runtime service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public create(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): rpc.Service; +} + +/** Service descriptor. */ +export interface IService extends INamespace { + + /** Method descriptors */ + methods: { [k: string]: IMethod }; +} + +/** + * Gets the next token and advances. + * @returns Next token or `null` on eof + */ +type TokenizerHandleNext = () => (string|null); + +/** + * Peeks for the next token. + * @returns Next token or `null` on eof + */ +type TokenizerHandlePeek = () => (string|null); + +/** + * Pushes a token back to the stack. + * @param token Token + */ +type TokenizerHandlePush = (token: string) => void; + +/** + * Skips the next token. + * @param expected Expected token + * @param [optional=false] If optional + * @returns Whether the token matched + * @throws {Error} If the token didn't match and is not optional + */ +type TokenizerHandleSkip = (expected: string, optional?: boolean) => boolean; + +/** + * Gets the comment on the previous line or, alternatively, the line comment on the specified line. + * @param [line] Line number + * @returns Comment text or `null` if none + */ +type TokenizerHandleCmnt = (line?: number) => (string|null); + +/** Handle object returned from {@link tokenize}. */ +export interface ITokenizerHandle { + + /** Gets the next token and advances (`null` on eof) */ + next: TokenizerHandleNext; + + /** Peeks for the next token (`null` on eof) */ + peek: TokenizerHandlePeek; + + /** Pushes a token back to the stack */ + push: TokenizerHandlePush; + + /** Skips a token, returns its presence and advances or, if non-optional and not present, throws */ + skip: TokenizerHandleSkip; + + /** Gets the comment on the previous line or the line comment on the specified line, if any */ + cmnt: TokenizerHandleCmnt; + + /** Current line number */ + line: number; +} + +/** + * Tokenizes the given .proto source and returns an object with useful utility functions. + * @param source Source contents + * @param alternateCommentMode Whether we should activate alternate comment parsing mode. + * @returns Tokenizer handle + */ +export function tokenize(source: string, alternateCommentMode: boolean): ITokenizerHandle; + +export namespace tokenize { + + /** + * Unescapes a string. + * @param str String to unescape + * @returns Unescaped string + */ + function unescape(str: string): string; +} + +/** Reflected message type. */ +export class Type extends NamespaceBase { + + /** + * Constructs a new reflected message type instance. + * @param name Message name + * @param [options] Declared options + */ + constructor(name: string, options?: { [k: string]: any }); + + /** Message fields. */ + public fields: { [k: string]: Field }; + + /** Oneofs declared within this namespace, if any. */ + public oneofs: { [k: string]: OneOf }; + + /** Extension ranges, if any. */ + public extensions: number[][]; + + /** Reserved ranges, if any. */ + public reserved: (number[]|string)[]; + + /** Message fields by id. */ + public readonly fieldsById: { [k: number]: Field }; + + /** Fields of this message as an array for iteration. */ + public readonly fieldsArray: Field[]; + + /** Oneofs of this message as an array for iteration. */ + public readonly oneofsArray: OneOf[]; + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + */ + public ctor: Constructor<{}>; + + /** + * Generates a constructor function for the specified type. + * @param mtype Message type + * @returns Codegen instance + */ + public static generateConstructor(mtype: Type): Codegen; + + /** + * Creates a message type from a message type descriptor. + * @param name Message name + * @param json Message type descriptor + * @returns Created message type + */ + public static fromJSON(name: string, json: IType): Type; + + /** + * Converts this message type to a message type descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Message type descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IType; + + /** + * Adds a nested object to this type. + * @param object Nested object to add + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ + public add(object: ReflectionObject): Type; + + /** + * Removes a nested object from this type. + * @param object Nested object to remove + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ + public remove(object: ReflectionObject): Type; + + /** + * Tests if the specified id is reserved. + * @param id Id to test + * @returns `true` if reserved, otherwise `false` + */ + public isReservedId(id: number): boolean; + + /** + * Tests if the specified name is reserved. + * @param name Name to test + * @returns `true` if reserved, otherwise `false` + */ + public isReservedName(name: string): boolean; + + /** + * Creates a new message of this type using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public create(properties?: { [k: string]: any }): Message<{}>; + + /** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns `this` + */ + public setup(): Type; + + /** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param message Message instance or plain object + * @param [writer] Writer to encode to + * @returns writer + */ + public encode(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer; + + /** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param message Message instance or plain object + * @param [writer] Writer to encode to + * @returns writer + */ + public encodeDelimited(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer; + + /** + * Decodes a message of this type. + * @param reader Reader or buffer to decode from + * @param [length] Length of the message, if known beforehand + * @returns Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ + public decode(reader: (Reader|Uint8Array), length?: number): Message<{}>; + + /** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param reader Reader or buffer to decode from + * @returns Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ + public decodeDelimited(reader: (Reader|Uint8Array)): Message<{}>; + + /** + * Verifies that field values are valid and that required fields are present. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public verify(message: { [k: string]: any }): (null|string); + + /** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param object Plain object to convert + * @returns Message instance + */ + public fromObject(object: { [k: string]: any }): Message<{}>; + + /** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param message Message instance + * @param [options] Conversion options + * @returns Plain object + */ + public toObject(message: Message<{}>, options?: IConversionOptions): { [k: string]: any }; + + /** + * Type decorator (TypeScript). + * @param [typeName] Type name, defaults to the constructor's name + * @returns Decorator function + */ + public static d>(typeName?: string): TypeDecorator; +} + +/** Message type descriptor. */ +export interface IType extends INamespace { + + /** Oneof descriptors */ + oneofs?: { [k: string]: IOneOf }; + + /** Field descriptors */ + fields: { [k: string]: IField }; + + /** Extension ranges */ + extensions?: number[][]; + + /** Reserved ranges */ + reserved?: number[][]; + + /** Whether a legacy group or not */ + group?: boolean; +} + +/** Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. */ +export interface IConversionOptions { + + /** + * Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + */ + longs?: Function; + + /** + * Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + */ + enums?: Function; + + /** + * Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + */ + bytes?: Function; + + /** Also sets default values on the resulting object */ + defaults?: boolean; + + /** Sets empty arrays for missing repeated fields even if `defaults=false` */ + arrays?: boolean; + + /** Sets empty objects for missing map fields even if `defaults=false` */ + objects?: boolean; + + /** Includes virtual oneof properties set to the present field's name, if any */ + oneofs?: boolean; + + /** Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings */ + json?: boolean; +} + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @param target Target constructor + */ +type TypeDecorator> = (target: Constructor) => void; + +/** Common type constants. */ +export namespace types { + + /** Basic type wire types. */ + const basic: { + "double": number, + "float": number, + "int32": number, + "uint32": number, + "sint32": number, + "fixed32": number, + "sfixed32": number, + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number, + "bool": number, + "string": number, + "bytes": number + }; + + /** Basic type defaults. */ + const defaults: { + "double": number, + "float": number, + "int32": number, + "uint32": number, + "sint32": number, + "fixed32": number, + "sfixed32": number, + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number, + "bool": boolean, + "string": string, + "bytes": number[], + "message": null + }; + + /** Basic long type wire types. */ + const long: { + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number + }; + + /** Allowed types for map keys with their associated wire type. */ + const mapKey: { + "int32": number, + "uint32": number, + "sint32": number, + "fixed32": number, + "sfixed32": number, + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number, + "bool": number, + "string": number + }; + + /** Allowed types for packed repeated fields with their associated wire type. */ + const packed: { + "double": number, + "float": number, + "int32": number, + "uint32": number, + "sint32": number, + "fixed32": number, + "sfixed32": number, + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number, + "bool": number + }; +} + +/** Constructor type. */ +export interface Constructor extends Function { + new(...params: any[]): T; prototype: T; +} + +/** Properties type. */ +type Properties = { [P in keyof T]?: T[P] }; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + */ +export interface Buffer extends Uint8Array { +} + +/** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + */ +export interface Long { + + /** Low bits */ + low: number; + + /** High bits */ + high: number; + + /** Whether unsigned or not */ + unsigned: boolean; +} + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @returns Set field name, if any + */ +type OneOfGetter = () => (string|undefined); + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @param value Field name + */ +type OneOfSetter = (value: (string|undefined)) => void; + +/** Various utility functions. */ +export namespace util { + + /** Helper class for working with the low and high bits of a 64 bit value. */ + class LongBits { + + /** + * Constructs new long bits. + * @param lo Low 32 bits, unsigned + * @param hi High 32 bits, unsigned + */ + constructor(lo: number, hi: number); + + /** Low bits. */ + public lo: number; + + /** High bits. */ + public hi: number; + + /** Zero bits. */ + public static zero: util.LongBits; + + /** Zero hash. */ + public static zeroHash: string; + + /** + * Constructs new long bits from the specified number. + * @param value Value + * @returns Instance + */ + public static fromNumber(value: number): util.LongBits; + + /** + * Constructs new long bits from a number, long or string. + * @param value Value + * @returns Instance + */ + public static from(value: (Long|number|string)): util.LongBits; + + /** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param [unsigned=false] Whether unsigned or not + * @returns Possibly unsafe number + */ + public toNumber(unsigned?: boolean): number; + + /** + * Converts this long bits to a long. + * @param [unsigned=false] Whether unsigned or not + * @returns Long + */ + public toLong(unsigned?: boolean): Long; + + /** + * Constructs new long bits from the specified 8 characters long hash. + * @param hash Hash + * @returns Bits + */ + public static fromHash(hash: string): util.LongBits; + + /** + * Converts this long bits to a 8 characters long hash. + * @returns Hash + */ + public toHash(): string; + + /** + * Zig-zag encodes this long bits. + * @returns `this` + */ + public zzEncode(): util.LongBits; + + /** + * Zig-zag decodes this long bits. + * @returns `this` + */ + public zzDecode(): util.LongBits; + + /** + * Calculates the length of this longbits when encoded as a varint. + * @returns Length + */ + public length(): number; + } + + /** An immuable empty array. */ + const emptyArray: any[]; + + /** An immutable empty object. */ + const emptyObject: object; + + /** Whether running within node or not. */ + const isNode: boolean; + + /** + * Tests if the specified value is an integer. + * @param value Value to test + * @returns `true` if the value is an integer + */ + function isInteger(value: any): boolean; + + /** + * Tests if the specified value is a string. + * @param value Value to test + * @returns `true` if the value is a string + */ + function isString(value: any): boolean; + + /** + * Tests if the specified value is a non-null object. + * @param value Value to test + * @returns `true` if the value is a non-null object + */ + function isObject(value: any): boolean; + + /** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @param obj Plain object or message instance + * @param prop Property name + * @returns `true` if considered to be present, otherwise `false` + */ + function isset(obj: object, prop: string): boolean; + + /** + * Checks if a property on a message is considered to be present. + * @param obj Plain object or message instance + * @param prop Property name + * @returns `true` if considered to be present, otherwise `false` + */ + function isSet(obj: object, prop: string): boolean; + + /** Node's Buffer class if available. */ + let Buffer: Constructor; + + /** + * Creates a new buffer of whatever type supported by the environment. + * @param [sizeOrArray=0] Buffer size or number array + * @returns Buffer + */ + function newBuffer(sizeOrArray?: (number|number[])): (Uint8Array|Buffer); + + /** Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. */ + let Array: Constructor; + + /** Long.js's Long class if available. */ + let Long: Constructor; + + /** Regular expression used to verify 2 bit (`bool`) map keys. */ + const key2Re: RegExp; + + /** Regular expression used to verify 32 bit (`int32` etc.) map keys. */ + const key32Re: RegExp; + + /** Regular expression used to verify 64 bit (`int64` etc.) map keys. */ + const key64Re: RegExp; + + /** + * Converts a number or long to an 8 characters long hash string. + * @param value Value to convert + * @returns Hash + */ + function longToHash(value: (Long|number)): string; + + /** + * Converts an 8 characters long hash string to a long or number. + * @param hash Hash + * @param [unsigned=false] Whether unsigned or not + * @returns Original value + */ + function longFromHash(hash: string, unsigned?: boolean): (Long|number); + + /** + * Merges the properties of the source object into the destination object. + * @param dst Destination object + * @param src Source object + * @param [ifNotSet=false] Merges only if the key is not already set + * @returns Destination object + */ + function merge(dst: { [k: string]: any }, src: { [k: string]: any }, ifNotSet?: boolean): { [k: string]: any }; + + /** + * Converts the first character of a string to lower case. + * @param str String to convert + * @returns Converted string + */ + function lcFirst(str: string): string; + + /** + * Creates a custom error constructor. + * @param name Error name + * @returns Custom error constructor + */ + function newError(name: string): Constructor; + + /** Error subclass indicating a protocol specifc error. */ + class ProtocolError> extends Error { + + /** + * Constructs a new protocol error. + * @param message Error message + * @param [properties] Additional properties + */ + constructor(message: string, properties?: { [k: string]: any }); + + /** So far decoded message instance. */ + public instance: Message; + } + + /** + * Builds a getter for a oneof's present field name. + * @param fieldNames Field names + * @returns Unbound getter + */ + function oneOfGetter(fieldNames: string[]): OneOfGetter; + + /** + * Builds a setter for a oneof's present field name. + * @param fieldNames Field names + * @returns Unbound setter + */ + function oneOfSetter(fieldNames: string[]): OneOfSetter; + + /** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ + let toJSONOptions: IConversionOptions; + + /** Node's fs module if available. */ + let fs: { [k: string]: any }; + + /** + * Converts an object's values to an array. + * @param object Object to convert + * @returns Converted array + */ + function toArray(object: { [k: string]: any }): any[]; + + /** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param array Array to convert + * @returns Converted object + */ + function toObject(array: any[]): { [k: string]: any }; + + /** + * Tests whether the specified name is a reserved word in JS. + * @param name Name to test + * @returns `true` if reserved, otherwise `false` + */ + function isReserved(name: string): boolean; + + /** + * Returns a safe property accessor for the specified property name. + * @param prop Property name + * @returns Safe accessor + */ + function safeProp(prop: string): string; + + /** + * Converts the first character of a string to upper case. + * @param str String to convert + * @returns Converted string + */ + function ucFirst(str: string): string; + + /** + * Converts a string to camel case. + * @param str String to convert + * @returns Converted string + */ + function camelCase(str: string): string; + + /** + * Compares reflected fields by id. + * @param a First field + * @param b Second field + * @returns Comparison value + */ + function compareFieldsById(a: Field, b: Field): number; + + /** + * Decorator helper for types (TypeScript). + * @param ctor Constructor function + * @param [typeName] Type name, defaults to the constructor's name + * @returns Reflected type + */ + function decorateType>(ctor: Constructor, typeName?: string): Type; + + /** + * Decorator helper for enums (TypeScript). + * @param object Enum object + * @returns Reflected enum + */ + function decorateEnum(object: object): Enum; + + /** Decorator root (TypeScript). */ + let decorateRoot: Root; + + /** + * Returns a promise from a node-style callback function. + * @param fn Function to call + * @param ctx Function context + * @param params Function arguments + * @returns Promisified function + */ + function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise; + + /** A minimal base64 implementation for number arrays. */ + namespace base64 { + + /** + * Calculates the byte length of a base64 encoded string. + * @param string Base64 encoded string + * @returns Byte length + */ + function length(string: string): number; + + /** + * Encodes a buffer to a base64 encoded string. + * @param buffer Source buffer + * @param start Source start + * @param end Source end + * @returns Base64 encoded string + */ + function encode(buffer: Uint8Array, start: number, end: number): string; + + /** + * Decodes a base64 encoded string to a buffer. + * @param string Source string + * @param buffer Destination buffer + * @param offset Destination offset + * @returns Number of bytes written + * @throws {Error} If encoding is invalid + */ + function decode(string: string, buffer: Uint8Array, offset: number): number; + + /** + * Tests if the specified string appears to be base64 encoded. + * @param string String to test + * @returns `true` if probably base64 encoded, otherwise false + */ + function test(string: string): boolean; + } + + /** + * Begins generating a function. + * @param functionParams Function parameter names + * @param [functionName] Function name if not anonymous + * @returns Appender that appends code to the function's body + */ + function codegen(functionParams: string[], functionName?: string): Codegen; + + namespace codegen { + + /** When set to `true`, codegen will log generated code to console. Useful for debugging. */ + let verbose: boolean; + } + + /** + * Begins generating a function. + * @param [functionName] Function name if not anonymous + * @returns Appender that appends code to the function's body + */ + function codegen(functionName?: string): Codegen; + + /** A minimal event emitter. */ + class EventEmitter { + + /** Constructs a new event emitter instance. */ + constructor(); + + /** + * Registers an event listener. + * @param evt Event name + * @param fn Listener + * @param [ctx] Listener context + * @returns `this` + */ + public on(evt: string, fn: EventEmitterListener, ctx?: any): this; + + /** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param [evt] Event name. Removes all listeners if omitted. + * @param [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns `this` + */ + public off(evt?: string, fn?: EventEmitterListener): this; + + /** + * Emits an event by calling its listeners with the specified arguments. + * @param evt Event name + * @param args Arguments + * @returns `this` + */ + public emit(evt: string, ...args: any[]): this; + } + + /** Reads / writes floats / doubles from / to buffers. */ + namespace float { + + /** + * Writes a 32 bit float to a buffer using little endian byte order. + * @param val Value to write + * @param buf Target buffer + * @param pos Target buffer offset + */ + function writeFloatLE(val: number, buf: Uint8Array, pos: number): void; + + /** + * Writes a 32 bit float to a buffer using big endian byte order. + * @param val Value to write + * @param buf Target buffer + * @param pos Target buffer offset + */ + function writeFloatBE(val: number, buf: Uint8Array, pos: number): void; + + /** + * Reads a 32 bit float from a buffer using little endian byte order. + * @param buf Source buffer + * @param pos Source buffer offset + * @returns Value read + */ + function readFloatLE(buf: Uint8Array, pos: number): number; + + /** + * Reads a 32 bit float from a buffer using big endian byte order. + * @param buf Source buffer + * @param pos Source buffer offset + * @returns Value read + */ + function readFloatBE(buf: Uint8Array, pos: number): number; + + /** + * Writes a 64 bit double to a buffer using little endian byte order. + * @param val Value to write + * @param buf Target buffer + * @param pos Target buffer offset + */ + function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void; + + /** + * Writes a 64 bit double to a buffer using big endian byte order. + * @param val Value to write + * @param buf Target buffer + * @param pos Target buffer offset + */ + function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void; + + /** + * Reads a 64 bit double from a buffer using little endian byte order. + * @param buf Source buffer + * @param pos Source buffer offset + * @returns Value read + */ + function readDoubleLE(buf: Uint8Array, pos: number): number; + + /** + * Reads a 64 bit double from a buffer using big endian byte order. + * @param buf Source buffer + * @param pos Source buffer offset + * @returns Value read + */ + function readDoubleBE(buf: Uint8Array, pos: number): number; + } + + /** + * Fetches the contents of a file. + * @param filename File path or url + * @param options Fetch options + * @param callback Callback function + */ + function fetch(filename: string, options: IFetchOptions, callback: FetchCallback): void; + + /** + * Fetches the contents of a file. + * @param path File path or url + * @param callback Callback function + */ + function fetch(path: string, callback: FetchCallback): void; + + /** + * Fetches the contents of a file. + * @param path File path or url + * @param [options] Fetch options + * @returns Promise + */ + function fetch(path: string, options?: IFetchOptions): Promise<(string|Uint8Array)>; + + /** + * Requires a module only if available. + * @param moduleName Module to require + * @returns Required module if available and not empty, otherwise `null` + */ + function inquire(moduleName: string): object; + + /** A minimal path module to resolve Unix, Windows and URL paths alike. */ + namespace path { + + /** + * Tests if the specified path is absolute. + * @param path Path to test + * @returns `true` if path is absolute + */ + function isAbsolute(path: string): boolean; + + /** + * Normalizes the specified path. + * @param path Path to normalize + * @returns Normalized path + */ + function normalize(path: string): string; + + /** + * Resolves the specified include path against the specified origin path. + * @param originPath Path to the origin file + * @param includePath Include path relative to origin path + * @param [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns Path to the include file + */ + function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string; + } + + /** + * A general purpose buffer pool. + * @param alloc Allocator + * @param slice Slicer + * @param [size=8192] Slab size + * @returns Pooled allocator + */ + function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator; + + /** A minimal UTF8 implementation for number arrays. */ + namespace utf8 { + + /** + * Calculates the UTF8 byte length of a string. + * @param string String + * @returns Byte length + */ + function length(string: string): number; + + /** + * Reads UTF8 bytes as a string. + * @param buffer Source buffer + * @param start Source start + * @param end Source end + * @returns String read + */ + function read(buffer: Uint8Array, start: number, end: number): string; + + /** + * Writes a string as UTF8 bytes. + * @param string Source string + * @param buffer Destination buffer + * @param offset Destination offset + * @returns Bytes written + */ + function write(string: string, buffer: Uint8Array, offset: number): number; + } +} + +/** + * Generates a verifier specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ +export function verifier(mtype: Type): Codegen; + +/** Wrappers for common types. */ +export const wrappers: { [k: string]: IWrapper }; + +/** + * From object converter part of an {@link IWrapper}. + * @param object Plain object + * @returns Message instance + */ +type WrapperFromObjectConverter = (this: Type, object: { [k: string]: any }) => Message<{}>; + +/** + * To object converter part of an {@link IWrapper}. + * @param message Message instance + * @param [options] Conversion options + * @returns Plain object + */ +type WrapperToObjectConverter = (this: Type, message: Message<{}>, options?: IConversionOptions) => { [k: string]: any }; + +/** Common type wrapper part of {@link wrappers}. */ +export interface IWrapper { + + /** From object converter */ + fromObject?: WrapperFromObjectConverter; + + /** To object converter */ + toObject?: WrapperToObjectConverter; +} + +/** Wire format writer using `Uint8Array` if available, otherwise `Array`. */ +export class Writer { + + /** Constructs a new writer instance. */ + constructor(); + + /** Current length. */ + public len: number; + + /** Operations head. */ + public head: object; + + /** Operations tail */ + public tail: object; + + /** Linked forked states. */ + public states: (object|null); + + /** + * Creates a new writer. + * @returns A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ + public static create(): (BufferWriter|Writer); + + /** + * Allocates a buffer of the specified size. + * @param size Buffer size + * @returns Buffer + */ + public static alloc(size: number): Uint8Array; + + /** + * Writes an unsigned 32 bit value as a varint. + * @param value Value to write + * @returns `this` + */ + public uint32(value: number): Writer; + + /** + * Writes a signed 32 bit value as a varint. + * @param value Value to write + * @returns `this` + */ + public int32(value: number): Writer; + + /** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param value Value to write + * @returns `this` + */ + public sint32(value: number): Writer; + + /** + * Writes an unsigned 64 bit value as a varint. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public uint64(value: (Long|number|string)): Writer; + + /** + * Writes a signed 64 bit value as a varint. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public int64(value: (Long|number|string)): Writer; + + /** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public sint64(value: (Long|number|string)): Writer; + + /** + * Writes a boolish value as a varint. + * @param value Value to write + * @returns `this` + */ + public bool(value: boolean): Writer; + + /** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param value Value to write + * @returns `this` + */ + public fixed32(value: number): Writer; + + /** + * Writes a signed 32 bit value as fixed 32 bits. + * @param value Value to write + * @returns `this` + */ + public sfixed32(value: number): Writer; + + /** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public fixed64(value: (Long|number|string)): Writer; + + /** + * Writes a signed 64 bit value as fixed 64 bits. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public sfixed64(value: (Long|number|string)): Writer; + + /** + * Writes a float (32 bit). + * @param value Value to write + * @returns `this` + */ + public float(value: number): Writer; + + /** + * Writes a double (64 bit float). + * @param value Value to write + * @returns `this` + */ + public double(value: number): Writer; + + /** + * Writes a sequence of bytes. + * @param value Buffer or base64 encoded string to write + * @returns `this` + */ + public bytes(value: (Uint8Array|string)): Writer; + + /** + * Writes a string. + * @param value Value to write + * @returns `this` + */ + public string(value: string): Writer; + + /** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns `this` + */ + public fork(): Writer; + + /** + * Resets this instance to the last state. + * @returns `this` + */ + public reset(): Writer; + + /** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns `this` + */ + public ldelim(): Writer; + + /** + * Finishes the write operation. + * @returns Finished buffer + */ + public finish(): Uint8Array; +} + +/** Wire format writer using node buffers. */ +export class BufferWriter extends Writer { + + /** Constructs a new buffer writer instance. */ + constructor(); + + /** + * Finishes the write operation. + * @returns Finished buffer + */ + public finish(): Buffer; + + /** + * Allocates a buffer of the specified size. + * @param size Buffer size + * @returns Buffer + */ + public static alloc(size: number): Buffer; +} + +/** + * Callback as used by {@link util.asPromise}. + * @param error Error, if any + * @param params Additional arguments + */ +type asPromiseCallback = (error: (Error|null), ...params: any[]) => void; + +/** + * Appends code to the function's body or finishes generation. + * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param [formatParams] Format parameters + * @returns Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ +type Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function); + +/** + * Event listener as used by {@link util.EventEmitter}. + * @param args Arguments + */ +type EventEmitterListener = (...args: any[]) => void; + +/** + * Node-style callback as used by {@link util.fetch}. + * @param error Error, if any, otherwise `null` + * @param [contents] File contents, if there hasn't been an error + */ +type FetchCallback = (error: Error, contents?: string) => void; + +/** Options as used by {@link util.fetch}. */ +export interface IFetchOptions { + + /** Whether expecting a binary response */ + binary?: boolean; + + /** If `true`, forces the use of XMLHttpRequest */ + xhr?: boolean; +} + +/** + * An allocator as used by {@link util.pool}. + * @param size Buffer size + * @returns Buffer + */ +type PoolAllocator = (size: number) => Uint8Array; + +/** + * A slicer as used by {@link util.pool}. + * @param start Start offset + * @param end End offset + * @returns Buffer slice + */ +type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array; diff --git a/node_modules/protobufjs/index.js b/node_modules/protobufjs/index.js new file mode 100644 index 0000000..042042a --- /dev/null +++ b/node_modules/protobufjs/index.js @@ -0,0 +1,4 @@ +// full library entry point. + +"use strict"; +module.exports = require("./src/index"); diff --git a/node_modules/protobufjs/light.d.ts b/node_modules/protobufjs/light.d.ts new file mode 100644 index 0000000..d83e7f9 --- /dev/null +++ b/node_modules/protobufjs/light.d.ts @@ -0,0 +1,2 @@ +export as namespace protobuf; +export * from "./index"; diff --git a/node_modules/protobufjs/light.js b/node_modules/protobufjs/light.js new file mode 100644 index 0000000..1209e64 --- /dev/null +++ b/node_modules/protobufjs/light.js @@ -0,0 +1,4 @@ +// light library entry point. + +"use strict"; +module.exports = require("./src/index-light"); \ No newline at end of file diff --git a/node_modules/protobufjs/minimal.d.ts b/node_modules/protobufjs/minimal.d.ts new file mode 100644 index 0000000..d83e7f9 --- /dev/null +++ b/node_modules/protobufjs/minimal.d.ts @@ -0,0 +1,2 @@ +export as namespace protobuf; +export * from "./index"; diff --git a/node_modules/protobufjs/minimal.js b/node_modules/protobufjs/minimal.js new file mode 100644 index 0000000..1f35ec9 --- /dev/null +++ b/node_modules/protobufjs/minimal.js @@ -0,0 +1,4 @@ +// minimal library entry point. + +"use strict"; +module.exports = require("./src/index-minimal"); diff --git a/node_modules/protobufjs/node_modules/@types/long/LICENSE b/node_modules/protobufjs/node_modules/@types/long/LICENSE new file mode 100644 index 0000000..2107107 --- /dev/null +++ b/node_modules/protobufjs/node_modules/@types/long/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/protobufjs/node_modules/@types/long/README.md b/node_modules/protobufjs/node_modules/@types/long/README.md new file mode 100644 index 0000000..382951d --- /dev/null +++ b/node_modules/protobufjs/node_modules/@types/long/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/long` + +# Summary +This package contains type definitions for long.js (https://github.com/dcodeIO/long.js). + +# Details +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/long + +Additional Details + * Last updated: Wed, 25 Apr 2018 00:38:11 GMT + * Dependencies: none + * Global values: Long + +# Credits +These definitions were written by Peter Kooijmans . diff --git a/node_modules/protobufjs/node_modules/@types/long/index.d.ts b/node_modules/protobufjs/node_modules/@types/long/index.d.ts new file mode 100644 index 0000000..7d373ae --- /dev/null +++ b/node_modules/protobufjs/node_modules/@types/long/index.d.ts @@ -0,0 +1,385 @@ +// Type definitions for long.js 4.0.0 +// Project: https://github.com/dcodeIO/long.js +// Definitions by: Peter Kooijmans +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Definitions by: Denis Cappellin + +export = Long; +export as namespace Long; + +declare namespace Long {} +declare class Long +{ + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. + */ + constructor( low: number, high?: number, unsigned?: boolean ); + + /** + * Maximum unsigned value. + */ + static MAX_UNSIGNED_VALUE: Long; + + /** + * Maximum signed value. + */ + static MAX_VALUE: Long; + + /** + * Minimum signed value. + */ + static MIN_VALUE: Long; + + /** + * Signed negative one. + */ + static NEG_ONE: Long; + + /** + * Signed one. + */ + static ONE: Long; + + /** + * Unsigned one. + */ + static UONE: Long; + + /** + * Unsigned zero. + */ + static UZERO: Long; + + /** + * Signed zero + */ + static ZERO: Long; + + /** + * The high 32 bits as a signed value. + */ + high: number; + + /** + * The low 32 bits as a signed value. + */ + low: number; + + /** + * Whether unsigned or not. + */ + unsigned: boolean; + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + */ + static fromBits( lowBits:number, highBits:number, unsigned?:boolean ): Long; + + /** + * Returns a Long representing the given 32 bit integer value. + */ + static fromInt( value: number, unsigned?: boolean ): Long; + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + */ + static fromNumber( value: number, unsigned?: boolean ): Long; + + /** + * Returns a Long representation of the given string, written using the specified radix. + */ + static fromString( str: string, unsigned?: boolean | number, radix?: number ): Long; + + /** + * Creates a Long from its byte representation. + */ + static fromBytes( bytes: number[], unsigned?: boolean, le?: boolean ): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + static fromBytesLE( bytes: number[], unsigned?: boolean ): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + static fromBytesBE( bytes: number[], unsigned?: boolean ): Long; + + /** + * Tests if the specified object is a Long. + */ + static isLong( obj: any ): boolean; + + /** + * Converts the specified value to a Long. + */ + static fromValue( val: Long | number | string | {low: number, high: number, unsigned: boolean} ): Long; + + /** + * Returns the sum of this and the specified Long. + */ + add( addend: number | Long | string ): Long; + + /** + * Returns the bitwise AND of this Long and the specified. + */ + and( other: Long | number | string ): Long; + + /** + * Compares this Long's value with the specified's. + */ + compare( other: Long | number | string ): number; + + /** + * Compares this Long's value with the specified's. + */ + comp( other: Long | number | string ): number; + + /** + * Returns this Long divided by the specified. + */ + divide( divisor: Long | number | string ): Long; + + /** + * Returns this Long divided by the specified. + */ + div( divisor: Long | number | string ): Long; + + /** + * Tests if this Long's value equals the specified's. + */ + equals( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value equals the specified's. + */ + eq( other: Long | number | string ): boolean; + + /** + * Gets the high 32 bits as a signed integer. + */ + getHighBits(): number; + + /** + * Gets the high 32 bits as an unsigned integer. + */ + getHighBitsUnsigned(): number; + + /** + * Gets the low 32 bits as a signed integer. + */ + getLowBits(): number; + + /** + * Gets the low 32 bits as an unsigned integer. + */ + getLowBitsUnsigned(): number; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + */ + getNumBitsAbs(): number; + + /** + * Tests if this Long's value is greater than the specified's. + */ + greaterThan( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than the specified's. + */ + gt( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + greaterThanOrEqual( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + gte( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is even. + */ + isEven(): boolean; + + /** + * Tests if this Long's value is negative. + */ + isNegative(): boolean; + + /** + * Tests if this Long's value is odd. + */ + isOdd(): boolean; + + /** + * Tests if this Long's value is positive. + */ + isPositive(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + isZero(): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lessThan( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lt( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lessThanOrEqual( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lte( other: Long | number | string ): boolean; + + /** + * Returns this Long modulo the specified. + */ + modulo( other: Long | number | string ): Long; + + /** + * Returns this Long modulo the specified. + */ + mod( other: Long | number | string ): Long; + + /** + * Returns the product of this and the specified Long. + */ + multiply( multiplier: Long | number | string ): Long; + + /** + * Returns the product of this and the specified Long. + */ + mul( multiplier: Long | number | string ): Long; + + /** + * Negates this Long's value. + */ + negate(): Long; + + /** + * Negates this Long's value. + */ + neg(): Long; + + /** + * Returns the bitwise NOT of this Long. + */ + not(): Long; + + /** + * Tests if this Long's value differs from the specified's. + */ + notEquals( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + neq( other: Long | number | string ): boolean; + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or( other: Long | number | string ): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shiftLeft( numBits: number | Long ): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shl( numBits: number | Long ): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shiftRight( numBits: number | Long ): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shr( numBits: number | Long ): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shiftRightUnsigned( numBits: number | Long ): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shru( numBits: number | Long ): Long; + + /** + * Returns the difference of this and the specified Long. + */ + subtract( subtrahend: number | Long | string ): Long; + + /** + * Returns the difference of this and the specified Long. + */ + sub( subtrahend: number | Long |string ): Long; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + */ + toInt(): number; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + */ + toNumber(): number; + + /** + * Converts this Long to its byte representation. + */ + + toBytes( le?: boolean ): number[]; + + /** + * Converts this Long to its little endian byte representation. + */ + + toBytesLE(): number[]; + + /** + * Converts this Long to its big endian byte representation. + */ + + toBytesBE(): number[]; + + /** + * Converts this Long to signed. + */ + toSigned(): Long; + + /** + * Converts the Long to a string written in the specified radix. + */ + toString( radix?: number ): string; + + /** + * Converts this Long to unsigned. + */ + toUnsigned(): Long; + + /** + * Returns the bitwise XOR of this Long and the given one. + */ + xor( other: Long | number | string ): Long; +} diff --git a/node_modules/protobufjs/node_modules/@types/long/package.json b/node_modules/protobufjs/node_modules/@types/long/package.json new file mode 100644 index 0000000..5b46d7d --- /dev/null +++ b/node_modules/protobufjs/node_modules/@types/long/package.json @@ -0,0 +1,47 @@ +{ + "_from": "@types/long@^4.0.0", + "_id": "@types/long@4.0.0", + "_inBundle": false, + "_integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==", + "_location": "/protobufjs/@types/long", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@types/long@^4.0.0", + "name": "@types/long", + "escapedName": "@types%2flong", + "scope": "@types", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "_shasum": "719551d2352d301ac8b81db732acb6bdc28dbdef", + "_spec": "@types/long@^4.0.0", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "bundleDependencies": false, + "contributors": [ + { + "name": "Peter Kooijmans", + "url": "https://github.com/peterkooijmans" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "TypeScript definitions for long.js", + "license": "MIT", + "main": "", + "name": "@types/long", + "repository": { + "type": "git", + "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "typeScriptVersion": "2.0", + "typesPublisherContentHash": "cc3246302180c8c161d2e2c0c3f0a419226efa475d2cd5afbe51986d60cd8287", + "version": "4.0.0" +} diff --git a/node_modules/protobufjs/node_modules/@types/node/LICENSE b/node_modules/protobufjs/node_modules/@types/node/LICENSE new file mode 100644 index 0000000..2107107 --- /dev/null +++ b/node_modules/protobufjs/node_modules/@types/node/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/protobufjs/node_modules/@types/node/README.md b/node_modules/protobufjs/node_modules/@types/node/README.md new file mode 100644 index 0000000..e5df9c7 --- /dev/null +++ b/node_modules/protobufjs/node_modules/@types/node/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for Node.js (http://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node + +Additional Details + * Last updated: Mon, 06 Aug 2018 21:55:25 GMT + * Dependencies: none + * Global values: Buffer, NodeJS, SlowBuffer, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, require, setImmediate, setInterval, setTimeout + +# Credits +These definitions were written by Microsoft TypeScript , DefinitelyTyped , Parambir Singh , Christian Vaagland Tellnes , Wilco Bakker , Nicolas Voigt , Chigozirim C. , Flarna , Mariusz Wiktorczyk , wwwy3y3 , Deividas Bakanas , Kelvin Jin , Alvis HT Tang , Sebastian Silbermann , Hannes Magnusson , Alberto Schiabel , Klaus Meinhardt , Huw , Nicolas Even , Bruno Scheufler , Mohsen Azimi , Hoàng Văn Khải , Alexander T. , Lishude , Andrew Makarov , Zane Hannan AU , Eugene Y. Q. Shen . diff --git a/node_modules/protobufjs/node_modules/@types/node/index.d.ts b/node_modules/protobufjs/node_modules/@types/node/index.d.ts new file mode 100644 index 0000000..ed04749 --- /dev/null +++ b/node_modules/protobufjs/node_modules/@types/node/index.d.ts @@ -0,0 +1,8026 @@ +// Type definitions for Node.js 10.5.x +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript +// DefinitelyTyped +// Parambir Singh +// Christian Vaagland Tellnes +// Wilco Bakker +// Nicolas Voigt +// Chigozirim C. +// Flarna +// Mariusz Wiktorczyk +// wwwy3y3 +// Deividas Bakanas +// Kelvin Jin +// Alvis HT Tang +// Sebastian Silbermann +// Hannes Magnusson +// Alberto Schiabel +// Klaus Meinhardt +// Huw +// Nicolas Even +// Bruno Scheufler +// Mohsen Azimi +// Hoàng Văn Khải +// Alexander T. +// Lishude +// Andrew Makarov +// Zane Hannan AU +// Eugene Y. Q. Shen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** inspector module types */ +/// + +// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build +interface Console { + Console: NodeJS.ConsoleConstructor; + /** + * A simple assertion test that verifies whether `value` is truthy. + * If it is not, an `AssertionError` is thrown. + * If provided, the error `message` is formatted using `util.format()` and used as the error message. + */ + assert(value: any, message?: string, ...optionalParams: any[]): void; + /** + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY. + * When `stdout` is not a TTY, this method does nothing. + */ + clear(): void; + /** + * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`. + */ + count(label?: string): void; + /** + * Resets the internal counter specific to `label`. + */ + countReset(label?: string): void; + /** + * The `console.debug()` function is an alias for {@link console.log()}. + */ + debug(message?: any, ...optionalParams: any[]): void; + /** + * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`. + * This function bypasses any custom `inspect()` function defined on `obj`. + */ + dir(obj: any, options?: NodeJS.InspectOptions): void; + /** + * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting + */ + dirxml(...data: any[]): void; + /** + * Prints to `stderr` with newline. + */ + error(message?: any, ...optionalParams: any[]): void; + /** + * Increases indentation of subsequent lines by two spaces. + * If one or more `label`s are provided, those are printed first without the additional indentation. + */ + group(...label: any[]): void; + /** + * The `console.groupCollapsed()` function is an alias for {@link console.group()}. + */ + groupCollapsed(): void; + /** + * Decreases indentation of subsequent lines by two spaces. + */ + groupEnd(): void; + /** + * The {@link console.info()} function is an alias for {@link console.log()}. + */ + info(message?: any, ...optionalParams: any[]): void; + /** + * Prints to `stdout` with newline. + */ + log(message?: any, ...optionalParams: any[]): void; + /** + * This method does not display anything unless used in the inspector. + * Prints to `stdout` the array `array` formatted as a table. + */ + table(tabularData: any, properties?: string[]): void; + /** + * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`. + */ + time(label?: string): void; + /** + * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`. + */ + timeEnd(label?: string): void; + /** + * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code. + */ + trace(message?: any, ...optionalParams: any[]): void; + /** + * The {@link console.warn()} function is an alias for {@link console.error()}. + */ + warn(message?: any, ...optionalParams: any[]): void; + + // --- Inspector mode only --- + /** + * This method does not display anything unless used in the inspector. + * Starts a JavaScript CPU profile with an optional label. + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + */ + profileEnd(): void; + /** + * This method does not display anything unless used in the inspector. + * Adds an event with the label `label` to the Timeline panel of the inspector. + */ + timeStamp(label?: string): void; +} + +interface Error { + stack?: string; +} + +// Declare "static" methods in Error +interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: Object, constructorOpt?: Function): void; + + /** + * Optional override for formatting stack traces + * + * @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces + */ + prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any; + + stackTraceLimit: number; +} + +// compat for TypeScript 1.8 +// if you use with --target es3 or --target es5 and use below definitions, +// use the lib.es6.d.ts that is bundled with TypeScript 1.8. +interface MapConstructor { } +interface WeakMapConstructor { } +interface SetConstructor { } +interface WeakSetConstructor { } + +// Forward-declare needed types from lib.es2015.d.ts (in case users are using `--lib es5`) +interface Iterable { } +interface Iterator { + next(value?: any): IteratorResult; +} +interface IteratorResult { } +interface AsyncIterableIterator {} +interface SymbolConstructor { + readonly observable: symbol; + readonly iterator: symbol; + readonly asyncIterator: symbol; +} +declare var Symbol: SymbolConstructor; + +// Node.js ESNEXT support +interface String { + /** Removes whitespace from the left end of a string. */ + trimLeft(): string; + /** Removes whitespace from the right end of a string. */ + trimRight(): string; +} + +/************************************************ +* * +* GLOBAL * +* * +************************************************/ +declare var process: NodeJS.Process; +declare var global: NodeJS.Global; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare namespace setTimeout { + export function __promisify__(ms: number): Promise; + export function __promisify__(ms: number, value: T): Promise; +} +declare function clearTimeout(timeoutId: NodeJS.Timer): void; +declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearInterval(intervalId: NodeJS.Timer): void; +declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; +declare namespace setImmediate { + export function __promisify__(): Promise; + export function __promisify__(value: T): Promise; +} +declare function clearImmediate(immediateId: any): void; + +// TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version. +interface NodeRequireFunction { + /* tslint:disable-next-line:callable-types */ + (id: string): any; +} + +interface NodeRequire extends NodeRequireFunction { + resolve: RequireResolve; + cache: any; + extensions: NodeExtensions; + main: NodeModule | undefined; +} + +interface RequireResolve { + (id: string, options?: { paths?: string[]; }): string; + paths(request: string): string[] | null; +} + +interface NodeExtensions { + '.js': (m: NodeModule, filename: string) => any; + '.json': (m: NodeModule, filename: string) => any; + '.node': (m: NodeModule, filename: string) => any; + [ext: string]: (m: NodeModule, filename: string) => any; +} + +declare var require: NodeRequire; + +interface NodeModule { + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: NodeModule | null; + children: NodeModule[]; + paths: string[]; +} + +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; +declare var SlowBuffer: { + new(str: string, encoding?: string): Buffer; + new(size: number): Buffer; + new(size: Uint8Array): Buffer; + new(array: any[]): Buffer; + prototype: Buffer; + isBuffer(obj: any): boolean; + byteLength(string: string, encoding?: string): number; + concat(list: Buffer[], totalLength?: number): Buffer; +}; + +// Buffer class +type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex"; +interface Buffer extends Uint8Array { + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Uint8Array): boolean; + compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: string): number; + entries(): IterableIterator<[number, number]>; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + keys(): IterableIterator; + values(): IterableIterator; +} + +/** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + */ +declare var Buffer: { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + */ + new(str: string, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + */ + new(size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new(array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + */ + new(arrayBuffer: ArrayBuffer): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new(array: any[]): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. + */ + new(buffer: Buffer): Buffer; + prototype: Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer() + */ + from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + // from(arrayBuffer: SharedArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer + */ + from(data: any[]): Buffer; + from(data: Uint8Array): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + */ + from(str: string, encoding?: string): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param values to create a new Buffer + */ + of(...items: number[]): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + isEncoding(encoding: string): boolean | undefined; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + byteLength(string: string | NodeJS.TypedArray | DataView | ArrayBuffer /*| SharedArrayBuffer */, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + concat(list: Uint8Array[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + compare(buf1: Uint8Array, buf2: Uint8Array): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + allocUnsafeSlow(size: number): Buffer; + /** + * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified. + */ + poolSize: number; +}; + +/************************************************ +* * +* GLOBAL INTERFACES * +* * +************************************************/ +declare namespace NodeJS { + export interface InspectOptions { + showHidden?: boolean; + depth?: number | null; + colors?: boolean; + customInspect?: boolean; + showProxy?: boolean; + maxArrayLength?: number | null; + breakLength?: number; + compact?: boolean; + } + + export interface ConsoleConstructor { + prototype: Console; + new(stdout: WritableStream, stderr?: WritableStream): Console; + } + + export interface CallSite { + /** + * Value of "this" + */ + getThis(): any; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | null; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + export interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; + stack?: string; + } + + export class EventEmitter { + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + off(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + listenerCount(type: string | symbol): number; + // Added in Node 6... + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + eventNames(): Array; + } + + export interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: string): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): this; + unshift(chunk: string): void; + unshift(chunk: Buffer): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + export interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Buffer | string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(cb?: Function): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + } + + export interface ReadWriteStream extends ReadableStream, WritableStream { } + + export interface Events extends EventEmitter { } + + export interface Domain extends Events { + run(fn: Function): void; + add(emitter: Events): void; + remove(emitter: Events): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + + addListener(event: string, listener: (...args: any[]) => void): this; + on(event: string, listener: (...args: any[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + removeListener(event: string, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string): this; + } + + export interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + external: number; + } + + export interface CpuUsage { + user: number; + system: number; + } + + export interface ProcessVersions { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + + type Platform = 'aix' + | 'android' + | 'darwin' + | 'freebsd' + | 'linux' + | 'openbsd' + | 'sunos' + | 'win32' + | 'cygwin'; + + type Signals = + "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | + "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | + "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | + "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO"; + + type BeforeExitListener = (code: number) => void; + type DisconnectListener = () => void; + type ExitListener = (code: number) => void; + type RejectionHandledListener = (promise: Promise) => void; + type UncaughtExceptionListener = (error: Error) => void; + type UnhandledRejectionListener = (reason: any, promise: Promise) => void; + type WarningListener = (warning: Error) => void; + type MessageListener = (message: any, sendHandle: any) => void; + type SignalsListener = (signal: Signals) => void; + type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + + export interface Socket extends ReadWriteStream { + isTTY?: true; + } + + export interface ProcessEnv { + [key: string]: string | undefined; + } + + export interface WriteStream extends Socket { + readonly writableHighWaterMark: number; + readonly writableLength: number; + columns?: number; + rows?: number; + _write(chunk: any, encoding: string, callback: Function): void; + _destroy(err: Error | null, callback: Function): void; + _final(callback: Function): void; + setDefaultEncoding(encoding: string): this; + cork(): void; + uncork(): void; + destroy(error?: Error): void; + } + export interface ReadStream extends Socket { + readonly readableHighWaterMark: number; + readonly readableLength: number; + isRaw?: boolean; + setRawMode?(mode: boolean): void; + _read(size: number): void; + _destroy(err: Error | null, callback: Function): void; + push(chunk: any, encoding?: string): boolean; + destroy(error?: Error): void; + } + + export interface Process extends EventEmitter { + stdout: WriteStream; + stderr: WriteStream; + stdin: ReadStream; + openStdin(): Socket; + argv: string[]; + argv0: string; + execArgv: string[]; + execPath: string; + abort(): void; + chdir(directory: string): void; + cwd(): string; + debugPort: number; + emitWarning(warning: string | Error, name?: string, ctor?: Function): void; + env: ProcessEnv; + exit(code?: number): never; + exitCode: number; + getgid(): number; + setgid(id: number | string): void; + getuid(): number; + setuid(id: number | string): void; + geteuid(): number; + seteuid(id: number | string): void; + getegid(): number; + setegid(id: number | string): void; + getgroups(): number[]; + setgroups(groups: Array): void; + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + hasUncaughtExceptionCaptureCallback(): boolean; + version: string; + versions: ProcessVersions; + config: { + target_defaults: { + cflags: any[]; + default_configuration: string; + defines: string[]; + include_dirs: string[]; + libraries: string[]; + }; + variables: { + clang: number; + host_arch: string; + node_install_npm: boolean; + node_install_waf: boolean; + node_prefix: string; + node_shared_openssl: boolean; + node_shared_v8: boolean; + node_shared_zlib: boolean; + node_use_dtrace: boolean; + node_use_etw: boolean; + node_use_openssl: boolean; + target_arch: string; + v8_no_strict_aliasing: number; + v8_use_snapshot: boolean; + visibility: string; + }; + }; + kill(pid: number, signal?: string | number): void; + pid: number; + ppid: number; + title: string; + arch: string; + platform: Platform; + mainModule?: NodeModule; + memoryUsage(): MemoryUsage; + cpuUsage(previousValue?: CpuUsage): CpuUsage; + nextTick(callback: Function, ...args: any[]): void; + umask(mask?: number): number; + uptime(): number; + hrtime(time?: [number, number]): [number, number]; + domain: Domain; + + // Worker + send?(message: any, sendHandle?: any): void; + disconnect(): void; + connected: boolean; + + /** + * EventEmitter + * 1. beforeExit + * 2. disconnect + * 3. exit + * 4. message + * 5. rejectionHandled + * 6. uncaughtException + * 7. unhandledRejection + * 8. warning + * 9. message + * 10. + * 11. newListener/removeListener inherited from EventEmitter + */ + addListener(event: "beforeExit", listener: BeforeExitListener): this; + addListener(event: "disconnect", listener: DisconnectListener): this; + addListener(event: "exit", listener: ExitListener): this; + addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + addListener(event: "warning", listener: WarningListener): this; + addListener(event: "message", listener: MessageListener): this; + addListener(event: Signals, listener: SignalsListener): this; + addListener(event: "newListener", listener: NewListenerListener): this; + addListener(event: "removeListener", listener: RemoveListenerListener): this; + + emit(event: "beforeExit", code: number): boolean; + emit(event: "disconnect"): boolean; + emit(event: "exit", code: number): boolean; + emit(event: "rejectionHandled", promise: Promise): boolean; + emit(event: "uncaughtException", error: Error): boolean; + emit(event: "unhandledRejection", reason: any, promise: Promise): boolean; + emit(event: "warning", warning: Error): boolean; + emit(event: "message", message: any, sendHandle: any): this; + emit(event: Signals): boolean; + emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this; + + on(event: "beforeExit", listener: BeforeExitListener): this; + on(event: "disconnect", listener: DisconnectListener): this; + on(event: "exit", listener: ExitListener): this; + on(event: "rejectionHandled", listener: RejectionHandledListener): this; + on(event: "uncaughtException", listener: UncaughtExceptionListener): this; + on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + on(event: "warning", listener: WarningListener): this; + on(event: "message", listener: MessageListener): this; + on(event: Signals, listener: SignalsListener): this; + on(event: "newListener", listener: NewListenerListener): this; + on(event: "removeListener", listener: RemoveListenerListener): this; + + once(event: "beforeExit", listener: BeforeExitListener): this; + once(event: "disconnect", listener: DisconnectListener): this; + once(event: "exit", listener: ExitListener): this; + once(event: "rejectionHandled", listener: RejectionHandledListener): this; + once(event: "uncaughtException", listener: UncaughtExceptionListener): this; + once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + once(event: "warning", listener: WarningListener): this; + once(event: "message", listener: MessageListener): this; + once(event: Signals, listener: SignalsListener): this; + once(event: "newListener", listener: NewListenerListener): this; + once(event: "removeListener", listener: RemoveListenerListener): this; + + prependListener(event: "beforeExit", listener: BeforeExitListener): this; + prependListener(event: "disconnect", listener: DisconnectListener): this; + prependListener(event: "exit", listener: ExitListener): this; + prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependListener(event: "warning", listener: WarningListener): this; + prependListener(event: "message", listener: MessageListener): this; + prependListener(event: Signals, listener: SignalsListener): this; + prependListener(event: "newListener", listener: NewListenerListener): this; + prependListener(event: "removeListener", listener: RemoveListenerListener): this; + + prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; + prependOnceListener(event: "disconnect", listener: DisconnectListener): this; + prependOnceListener(event: "exit", listener: ExitListener): this; + prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependOnceListener(event: "warning", listener: WarningListener): this; + prependOnceListener(event: "message", listener: MessageListener): this; + prependOnceListener(event: Signals, listener: SignalsListener): this; + prependOnceListener(event: "newListener", listener: NewListenerListener): this; + prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this; + + listeners(event: "beforeExit"): BeforeExitListener[]; + listeners(event: "disconnect"): DisconnectListener[]; + listeners(event: "exit"): ExitListener[]; + listeners(event: "rejectionHandled"): RejectionHandledListener[]; + listeners(event: "uncaughtException"): UncaughtExceptionListener[]; + listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; + listeners(event: "warning"): WarningListener[]; + listeners(event: "message"): MessageListener[]; + listeners(event: Signals): SignalsListener[]; + listeners(event: "newListener"): NewListenerListener[]; + listeners(event: "removeListener"): RemoveListenerListener[]; + } + + export interface Global { + Array: typeof Array; + ArrayBuffer: typeof ArrayBuffer; + Boolean: typeof Boolean; + Buffer: typeof Buffer; + DataView: typeof DataView; + Date: typeof Date; + Error: typeof Error; + EvalError: typeof EvalError; + Float32Array: typeof Float32Array; + Float64Array: typeof Float64Array; + Function: typeof Function; + GLOBAL: Global; + Infinity: typeof Infinity; + Int16Array: typeof Int16Array; + Int32Array: typeof Int32Array; + Int8Array: typeof Int8Array; + Intl: typeof Intl; + JSON: typeof JSON; + Map: MapConstructor; + Math: typeof Math; + NaN: typeof NaN; + Number: typeof Number; + Object: typeof Object; + Promise: Function; + RangeError: typeof RangeError; + ReferenceError: typeof ReferenceError; + RegExp: typeof RegExp; + Set: SetConstructor; + String: typeof String; + Symbol: Function; + SyntaxError: typeof SyntaxError; + TypeError: typeof TypeError; + URIError: typeof URIError; + Uint16Array: typeof Uint16Array; + Uint32Array: typeof Uint32Array; + Uint8Array: typeof Uint8Array; + Uint8ClampedArray: Function; + WeakMap: WeakMapConstructor; + WeakSet: WeakSetConstructor; + clearImmediate: (immediateId: any) => void; + clearInterval: (intervalId: NodeJS.Timer) => void; + clearTimeout: (timeoutId: NodeJS.Timer) => void; + console: typeof console; + decodeURI: typeof decodeURI; + decodeURIComponent: typeof decodeURIComponent; + encodeURI: typeof encodeURI; + encodeURIComponent: typeof encodeURIComponent; + escape: (str: string) => string; + eval: typeof eval; + global: Global; + isFinite: typeof isFinite; + isNaN: typeof isNaN; + parseFloat: typeof parseFloat; + parseInt: typeof parseInt; + process: Process; + root: Global; + setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; + setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + undefined: typeof undefined; + unescape: (str: string) => string; + gc: () => void; + v8debug?: any; + } + + export interface Timer { + ref(): void; + unref(): void; + } + + class Module { + static runMain(): void; + static wrap(code: string): string; + static builtinModules: string[]; + + static Module: typeof Module; + + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: Module | null; + children: Module[]; + paths: string[]; + + constructor(id: string, parent?: Module); + } + + type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array; +} + +interface IterableIterator { } + +/************************************************ +* * +* MODULES * +* * +************************************************/ +declare module "buffer" { + export var INSPECT_MAX_BYTES: number; + var BuffType: typeof Buffer; + var SlowBuffType: typeof SlowBuffer; + export { BuffType as Buffer, SlowBuffType as SlowBuffer }; +} + +declare module "querystring" { + export interface StringifyOptions { + encodeURIComponent?: Function; + } + + export interface ParseOptions { + maxKeys?: number; + decodeURIComponent?: Function; + } + + interface ParsedUrlQuery { [key: string]: string | string[] | undefined; } + + export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): T; + export function escape(str: string): string; + export function unescape(str: string): string; +} + +declare module "events" { + class internal extends NodeJS.EventEmitter { } + + namespace internal { + export class EventEmitter extends internal { + /** @deprecated since v4.0.0 */ + static listenerCount(emitter: EventEmitter, event: string | symbol): number; + static defaultMaxListeners: number; + + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + off(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): Array; + listenerCount(type: string | symbol): number; + } + } + + export = internal; +} + +declare module "http" { + import * as events from "events"; + import * as net from "net"; + import * as stream from "stream"; + import { URL } from "url"; + + // incoming headers will never contain number + export interface IncomingHttpHeaders { + 'accept'?: string; + 'access-control-allow-origin'?: string; + 'access-control-allow-credentials'?: string; + 'access-control-expose-headers'?: string; + 'access-control-max-age'?: string; + 'access-control-allow-methods'?: string; + 'access-control-allow-headers'?: string; + 'accept-patch'?: string; + 'accept-ranges'?: string; + 'authorization'?: string; + 'age'?: string; + 'allow'?: string; + 'alt-svc'?: string; + 'cache-control'?: string; + 'connection'?: string; + 'content-disposition'?: string; + 'content-encoding'?: string; + 'content-language'?: string; + 'content-length'?: string; + 'content-location'?: string; + 'content-range'?: string; + 'content-type'?: string; + 'date'?: string; + 'expires'?: string; + 'host'?: string; + 'last-modified'?: string; + 'location'?: string; + 'pragma'?: string; + 'proxy-authenticate'?: string; + 'public-key-pins'?: string; + 'retry-after'?: string; + 'set-cookie'?: string[]; + 'strict-transport-security'?: string; + 'trailer'?: string; + 'transfer-encoding'?: string; + 'tk'?: string; + 'upgrade'?: string; + 'vary'?: string; + 'via'?: string; + 'warning'?: string; + 'www-authenticate'?: string; + [header: string]: string | string[] | undefined; + } + + // outgoing headers allows numbers (as they are converted internally to strings) + export interface OutgoingHttpHeaders { + [header: string]: number | string | string[] | undefined; + } + + export interface ClientRequestArgs { + protocol?: string; + host?: string; + hostname?: string; + family?: number; + port?: number | string; + defaultPort?: number | string; + localAddress?: string; + socketPath?: string; + method?: string; + path?: string; + headers?: OutgoingHttpHeaders; + auth?: string; + agent?: Agent | boolean; + _defaultAgent?: Agent; + timeout?: number; + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 + createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: net.Socket) => void) => net.Socket; + } + + export class Server extends net.Server { + constructor(requestListener?: (req: IncomingMessage, res: ServerResponse) => void); + + setTimeout(msecs?: number, callback?: () => void): this; + setTimeout(callback: () => void): this; + maxHeadersCount: number; + timeout: number; + keepAliveTimeout: number; + } + /** + * @deprecated Use IncomingMessage + */ + export class ServerRequest extends IncomingMessage { + connection: net.Socket; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js + export class OutgoingMessage extends stream.Writable { + upgrading: boolean; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + finished: boolean; + headersSent: boolean; + connection: net.Socket; + + constructor(); + + setTimeout(msecs: number, callback?: () => void): this; + setHeader(name: string, value: number | string | string[]): void; + getHeader(name: string): number | string | string[] | undefined; + getHeaders(): OutgoingHttpHeaders; + getHeaderNames(): string[]; + hasHeader(name: string): boolean; + removeHeader(name: string): void; + addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void; + flushHeaders(): void; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256 + export class ServerResponse extends OutgoingMessage { + statusCode: number; + statusMessage: string; + + constructor(req: IncomingMessage); + + assignSocket(socket: net.Socket): void; + detachSocket(socket: net.Socket): void; + // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53 + // no args in writeContinue callback + writeContinue(callback?: () => void): void; + writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): void; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77 + export class ClientRequest extends OutgoingMessage { + connection: net.Socket; + socket: net.Socket; + aborted: number; + + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + + abort(): void; + onSocket(socket: net.Socket): void; + setTimeout(timeout: number, callback?: () => void): this; + setNoDelay(noDelay?: boolean): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + } + + export class IncomingMessage extends stream.Readable { + constructor(socket: net.Socket); + + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + connection: net.Socket; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + trailers: { [key: string]: string | undefined }; + rawTrailers: string[]; + setTimeout(msecs: number, callback: () => void): this; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; + socket: net.Socket; + destroy(error?: Error): void; + } + + /** + * @deprecated Use IncomingMessage + */ + export class ClientResponse extends IncomingMessage { } + + export interface AgentOptions { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number; + } + + export class Agent { + maxFreeSockets: number; + maxSockets: number; + sockets: any; + requests: any; + + constructor(opts?: AgentOptions); + + /** + * Destroy any sockets that are currently in use by the agent. + * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, + * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, + * sockets may hang open for quite a long time before the server terminates them. + */ + destroy(): void; + } + + export var METHODS: string[]; + + export var STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server; + export function createClient(port?: number, host?: string): any; + + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + export interface RequestOptions extends ClientRequestArgs { } + export function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export var globalAgent: Agent; +} + +declare module "cluster" { + import * as child from "child_process"; + import * as events from "events"; + import * as net from "net"; + + // interfaces + export interface ClusterSettings { + execArgv?: string[]; // default: process.execArgv + exec?: string; + args?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + inspectPort?: number | (() => number); + } + + export interface Address { + address: string; + port: number; + addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" + } + + export class Worker extends events.EventEmitter { + id: number; + process: child.ChildProcess; + suicide: boolean; + send(message: any, sendHandle?: any, callback?: (error: Error) => void): boolean; + kill(signal?: string): void; + destroy(signal?: string): void; + disconnect(): void; + isConnected(): boolean; + isDead(): boolean; + exitedAfterDisconnect: boolean; + + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "listening", listener: (address: Address) => void): this; + addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "exit", code: number, signal: string): boolean; + emit(event: "listening", address: Address): boolean; + emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "listening", listener: (address: Address) => void): this; + on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "listening", listener: (address: Address) => void): this; + once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "listening", listener: (address: Address) => void): this; + prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "listening", listener: (address: Address) => void): this; + prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: () => void): this; + } + + export interface Cluster extends events.EventEmitter { + Worker: Worker; + disconnect(callback?: Function): void; + fork(env?: any): Worker; + isMaster: boolean; + isWorker: boolean; + // TODO: cluster.schedulingPolicy + settings: ClusterSettings; + setupMaster(settings?: ClusterSettings): void; + worker?: Worker; + workers?: { + [index: string]: Worker | undefined + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: (worker: Worker) => void): this; + addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: "fork", listener: (worker: Worker) => void): this; + addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: (worker: Worker) => void): this; + addListener(event: "setup", listener: (settings: any) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect", worker: Worker): boolean; + emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + emit(event: "fork", worker: Worker): boolean; + emit(event: "listening", worker: Worker, address: Address): boolean; + emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online", worker: Worker): boolean; + emit(event: "setup", settings: any): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: (worker: Worker) => void): this; + on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: "fork", listener: (worker: Worker) => void): this; + on(event: "listening", listener: (worker: Worker, address: Address) => void): this; + on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: (worker: Worker) => void): this; + on(event: "setup", listener: (settings: any) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: (worker: Worker) => void): this; + once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: "fork", listener: (worker: Worker) => void): this; + once(event: "listening", listener: (worker: Worker, address: Address) => void): this; + once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: (worker: Worker) => void): this; + once(event: "setup", listener: (settings: any) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: "fork", listener: (worker: Worker) => void): this; + prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: (worker: Worker) => void): this; + prependListener(event: "setup", listener: (settings: any) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; + prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: (worker: Worker) => void): this; + prependOnceListener(event: "setup", listener: (settings: any) => void): this; + } + + export function disconnect(callback?: Function): void; + export function fork(env?: any): Worker; + export var isMaster: boolean; + export var isWorker: boolean; + // TODO: cluster.schedulingPolicy + export var settings: ClusterSettings; + export function setupMaster(settings?: ClusterSettings): void; + export var worker: Worker; + export var workers: { + [index: string]: Worker | undefined + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + export function addListener(event: string, listener: (...args: any[]) => void): Cluster; + export function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function addListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function addListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function emit(event: string | symbol, ...args: any[]): boolean; + export function emit(event: "disconnect", worker: Worker): boolean; + export function emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + export function emit(event: "fork", worker: Worker): boolean; + export function emit(event: "listening", worker: Worker, address: Address): boolean; + export function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + export function emit(event: "online", worker: Worker): boolean; + export function emit(event: "setup", settings: any): boolean; + + export function on(event: string, listener: (...args: any[]) => void): Cluster; + export function on(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function on(event: "fork", listener: (worker: Worker) => void): Cluster; + export function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function on(event: "online", listener: (worker: Worker) => void): Cluster; + export function on(event: "setup", listener: (settings: any) => void): Cluster; + + export function once(event: string, listener: (...args: any[]) => void): Cluster; + export function once(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function once(event: "fork", listener: (worker: Worker) => void): Cluster; + export function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function once(event: "online", listener: (worker: Worker) => void): Cluster; + export function once(event: "setup", listener: (settings: any) => void): Cluster; + + export function removeListener(event: string, listener: (...args: any[]) => void): Cluster; + export function removeAllListeners(event?: string): Cluster; + export function setMaxListeners(n: number): Cluster; + export function getMaxListeners(): number; + export function listeners(event: string): Function[]; + export function listenerCount(type: string): number; + + export function prependListener(event: string, listener: (...args: any[]) => void): Cluster; + export function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function prependListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster; + export function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function eventNames(): string[]; +} + +declare module "zlib" { + import * as stream from "stream"; + + export interface ZlibOptions { + flush?: number; // default: zlib.constants.Z_NO_FLUSH + finishFlush?: number; // default: zlib.constants.Z_FINISH + chunkSize?: number; // default: 16*1024 + windowBits?: number; + level?: number; // compression only + memLevel?: number; // compression only + strategy?: number; // compression only + dictionary?: Buffer | NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default + } + + export interface Zlib { + readonly bytesRead: number; + close(callback?: () => void): void; + flush(kind?: number | (() => void), callback?: () => void): void; + } + + export interface ZlibParams { + params(level: number, strategy: number, callback: () => void): void; + } + + export interface ZlibReset { + reset(): void; + } + + export interface Gzip extends stream.Transform, Zlib { } + export interface Gunzip extends stream.Transform, Zlib { } + export interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + export interface Inflate extends stream.Transform, Zlib, ZlibReset { } + export interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + export interface InflateRaw extends stream.Transform, Zlib, ZlibReset { } + export interface Unzip extends stream.Transform, Zlib { } + + export function createGzip(options?: ZlibOptions): Gzip; + export function createGunzip(options?: ZlibOptions): Gunzip; + export function createDeflate(options?: ZlibOptions): Deflate; + export function createInflate(options?: ZlibOptions): Inflate; + export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; + export function createInflateRaw(options?: ZlibOptions): InflateRaw; + export function createUnzip(options?: ZlibOptions): Unzip; + + type InputType = string | Buffer | DataView | ArrayBuffer | NodeJS.TypedArray; + export function deflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function deflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gunzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function unzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function unzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; + + export namespace constants { + // Allowed flush values. + + export const Z_NO_FLUSH: number; + export const Z_PARTIAL_FLUSH: number; + export const Z_SYNC_FLUSH: number; + export const Z_FULL_FLUSH: number; + export const Z_FINISH: number; + export const Z_BLOCK: number; + export const Z_TREES: number; + + // Return codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events. + + export const Z_OK: number; + export const Z_STREAM_END: number; + export const Z_NEED_DICT: number; + export const Z_ERRNO: number; + export const Z_STREAM_ERROR: number; + export const Z_DATA_ERROR: number; + export const Z_MEM_ERROR: number; + export const Z_BUF_ERROR: number; + export const Z_VERSION_ERROR: number; + + // Compression levels. + + export const Z_NO_COMPRESSION: number; + export const Z_BEST_SPEED: number; + export const Z_BEST_COMPRESSION: number; + export const Z_DEFAULT_COMPRESSION: number; + + // Compression strategy. + + export const Z_FILTERED: number; + export const Z_HUFFMAN_ONLY: number; + export const Z_RLE: number; + export const Z_FIXED: number; + export const Z_DEFAULT_STRATEGY: number; + } + + // Constants + export var Z_NO_FLUSH: number; + export var Z_PARTIAL_FLUSH: number; + export var Z_SYNC_FLUSH: number; + export var Z_FULL_FLUSH: number; + export var Z_FINISH: number; + export var Z_BLOCK: number; + export var Z_TREES: number; + export var Z_OK: number; + export var Z_STREAM_END: number; + export var Z_NEED_DICT: number; + export var Z_ERRNO: number; + export var Z_STREAM_ERROR: number; + export var Z_DATA_ERROR: number; + export var Z_MEM_ERROR: number; + export var Z_BUF_ERROR: number; + export var Z_VERSION_ERROR: number; + export var Z_NO_COMPRESSION: number; + export var Z_BEST_SPEED: number; + export var Z_BEST_COMPRESSION: number; + export var Z_DEFAULT_COMPRESSION: number; + export var Z_FILTERED: number; + export var Z_HUFFMAN_ONLY: number; + export var Z_RLE: number; + export var Z_FIXED: number; + export var Z_DEFAULT_STRATEGY: number; + export var Z_BINARY: number; + export var Z_TEXT: number; + export var Z_ASCII: number; + export var Z_UNKNOWN: number; + export var Z_DEFLATED: number; +} + +declare module "os" { + export interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + + export interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + } + + export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: "IPv4"; + } + + export interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: "IPv6"; + scopeid: number; + } + + export type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + + export function hostname(): string; + export function loadavg(): number[]; + export function uptime(): number; + export function freemem(): number; + export function totalmem(): number; + export function cpus(): CpuInfo[]; + export function type(): string; + export function release(): string; + export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] }; + export function homedir(): string; + export function userInfo(options?: { encoding: string }): { username: string, uid: number, gid: number, shell: any, homedir: string }; + export var constants: { + UV_UDP_REUSEADDR: number, + signals: { + SIGHUP: number; + SIGINT: number; + SIGQUIT: number; + SIGILL: number; + SIGTRAP: number; + SIGABRT: number; + SIGIOT: number; + SIGBUS: number; + SIGFPE: number; + SIGKILL: number; + SIGUSR1: number; + SIGSEGV: number; + SIGUSR2: number; + SIGPIPE: number; + SIGALRM: number; + SIGTERM: number; + SIGCHLD: number; + SIGSTKFLT: number; + SIGCONT: number; + SIGSTOP: number; + SIGTSTP: number; + SIGTTIN: number; + SIGTTOU: number; + SIGURG: number; + SIGXCPU: number; + SIGXFSZ: number; + SIGVTALRM: number; + SIGPROF: number; + SIGWINCH: number; + SIGIO: number; + SIGPOLL: number; + SIGPWR: number; + SIGSYS: number; + SIGUNUSED: number; + }, + errno: { + E2BIG: number; + EACCES: number; + EADDRINUSE: number; + EADDRNOTAVAIL: number; + EAFNOSUPPORT: number; + EAGAIN: number; + EALREADY: number; + EBADF: number; + EBADMSG: number; + EBUSY: number; + ECANCELED: number; + ECHILD: number; + ECONNABORTED: number; + ECONNREFUSED: number; + ECONNRESET: number; + EDEADLK: number; + EDESTADDRREQ: number; + EDOM: number; + EDQUOT: number; + EEXIST: number; + EFAULT: number; + EFBIG: number; + EHOSTUNREACH: number; + EIDRM: number; + EILSEQ: number; + EINPROGRESS: number; + EINTR: number; + EINVAL: number; + EIO: number; + EISCONN: number; + EISDIR: number; + ELOOP: number; + EMFILE: number; + EMLINK: number; + EMSGSIZE: number; + EMULTIHOP: number; + ENAMETOOLONG: number; + ENETDOWN: number; + ENETRESET: number; + ENETUNREACH: number; + ENFILE: number; + ENOBUFS: number; + ENODATA: number; + ENODEV: number; + ENOENT: number; + ENOEXEC: number; + ENOLCK: number; + ENOLINK: number; + ENOMEM: number; + ENOMSG: number; + ENOPROTOOPT: number; + ENOSPC: number; + ENOSR: number; + ENOSTR: number; + ENOSYS: number; + ENOTCONN: number; + ENOTDIR: number; + ENOTEMPTY: number; + ENOTSOCK: number; + ENOTSUP: number; + ENOTTY: number; + ENXIO: number; + EOPNOTSUPP: number; + EOVERFLOW: number; + EPERM: number; + EPIPE: number; + EPROTO: number; + EPROTONOSUPPORT: number; + EPROTOTYPE: number; + ERANGE: number; + EROFS: number; + ESPIPE: number; + ESRCH: number; + ESTALE: number; + ETIME: number; + ETIMEDOUT: number; + ETXTBSY: number; + EWOULDBLOCK: number; + EXDEV: number; + }, + }; + export function arch(): string; + export function platform(): NodeJS.Platform; + export function tmpdir(): string; + export const EOL: string; + export function endianness(): "BE" | "LE"; +} + +declare module "https" { + import * as tls from "tls"; + import * as events from "events"; + import * as http from "http"; + import { URL } from "url"; + + export type ServerOptions = tls.SecureContextOptions & tls.TlsOptions; + + export type RequestOptions = http.RequestOptions & tls.SecureContextOptions & { + rejectUnauthorized?: boolean; // Defaults to true + servername?: string; // SNI TLS Extension + }; + + export interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + rejectUnauthorized?: boolean; + maxCachedSessions?: number; + } + + export class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + } + + export class Server extends tls.Server { + setTimeout(callback: () => void): this; + setTimeout(msecs?: number, callback?: () => void): this; + timeout: number; + keepAliveTimeout: number; + } + + export function createServer(options: ServerOptions, requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): Server; + export function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export var globalAgent: Agent; +} + +declare module "punycode" { + export function decode(string: string): string; + export function encode(string: string): string; + export function toUnicode(domain: string): string; + export function toASCII(domain: string): string; + export var ucs2: ucs2; + interface ucs2 { + decode(string: string): number[]; + encode(codePoints: number[]): string; + } + export var version: any; +} + +declare module "repl" { + import * as stream from "stream"; + import * as readline from "readline"; + + export interface ReplOptions { + prompt?: string; + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + terminal?: boolean; + eval?: Function; + useColors?: boolean; + useGlobal?: boolean; + ignoreUndefined?: boolean; + writer?: Function; + completer?: Function; + replMode?: any; + breakEvalOnSigint?: any; + } + + export interface REPLServer extends readline.ReadLine { + context: any; + inputStream: NodeJS.ReadableStream; + outputStream: NodeJS.WritableStream; + + defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void; + displayPrompt(preserveCursor?: boolean): void; + + /** + * events.EventEmitter + * 1. exit + * 2. reset + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "exit", listener: () => void): this; + addListener(event: "reset", listener: (...args: any[]) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "exit"): boolean; + emit(event: "reset", context: any): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "exit", listener: () => void): this; + on(event: "reset", listener: (...args: any[]) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "exit", listener: () => void): this; + once(event: "reset", listener: (...args: any[]) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "exit", listener: () => void): this; + prependListener(event: "reset", listener: (...args: any[]) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "exit", listener: () => void): this; + prependOnceListener(event: "reset", listener: (...args: any[]) => void): this; + } + + export function start(options?: string | ReplOptions): REPLServer; + + export class Recoverable extends SyntaxError { + err: Error; + + constructor(err: Error); + } +} + +declare module "readline" { + import * as events from "events"; + import * as stream from "stream"; + + export interface Key { + sequence?: string; + name?: string; + ctrl?: boolean; + meta?: boolean; + shift?: boolean; + } + + export interface ReadLine extends events.EventEmitter { + setPrompt(prompt: string): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: (answer: string) => void): void; + pause(): ReadLine; + resume(): ReadLine; + close(): void; + write(data: string | Buffer, key?: Key): void; + + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "line", listener: (input: any) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: "SIGCONT", listener: () => void): this; + addListener(event: "SIGINT", listener: () => void): this; + addListener(event: "SIGTSTP", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "line", input: any): boolean; + emit(event: "pause"): boolean; + emit(event: "resume"): boolean; + emit(event: "SIGCONT"): boolean; + emit(event: "SIGINT"): boolean; + emit(event: "SIGTSTP"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "line", listener: (input: any) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: "SIGCONT", listener: () => void): this; + on(event: "SIGINT", listener: () => void): this; + on(event: "SIGTSTP", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "line", listener: (input: any) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: "SIGCONT", listener: () => void): this; + once(event: "SIGINT", listener: () => void): this; + once(event: "SIGTSTP", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "line", listener: (input: any) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: "SIGCONT", listener: () => void): this; + prependListener(event: "SIGINT", listener: () => void): this; + prependListener(event: "SIGTSTP", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "line", listener: (input: any) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: "SIGCONT", listener: () => void): this; + prependOnceListener(event: "SIGINT", listener: () => void): this; + prependOnceListener(event: "SIGTSTP", listener: () => void): this; + } + + type Completer = (line: string) => CompleterResult; + type AsyncCompleter = (line: string, callback: (err: any, result: CompleterResult) => void) => any; + + export type CompleterResult = [string[], string]; + + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + completer?: Completer | AsyncCompleter; + terminal?: boolean; + historySize?: number; + prompt?: string; + crlfDelay?: number; + removeHistoryDuplicates?: boolean; + } + + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): ReadLine; + export function createInterface(options: ReadLineOptions): ReadLine; + + export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void; + export function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: ReadLine): void; + export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void; + export function clearLine(stream: NodeJS.WritableStream, dir: number): void; + export function clearScreenDown(stream: NodeJS.WritableStream): void; +} + +declare module "vm" { + export interface Context { } + export interface ScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + cachedData?: Buffer; + produceCachedData?: boolean; + } + export interface RunningScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + } + export class Script { + constructor(code: string, options?: ScriptOptions); + runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any; + runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any; + runInThisContext(options?: RunningScriptOptions): any; + } + export function createContext(sandbox?: Context): Context; + export function isContext(sandbox: Context): boolean; + export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; + /** @deprecated */ + export function runInDebugContext(code: string): any; + export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; + export function runInThisContext(code: string, options?: RunningScriptOptions | string): any; +} + +declare module "child_process" { + import * as events from "events"; + import * as stream from "stream"; + import * as net from "net"; + + export interface ChildProcess extends events.EventEmitter { + stdin: stream.Writable; + stdout: stream.Readable; + stderr: stream.Readable; + stdio: [stream.Writable, stream.Readable, stream.Readable]; + killed: boolean; + pid: number; + kill(signal?: string): void; + send(message: any, callback?: (error: Error) => void): boolean; + send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error) => void): boolean; + send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error) => void): boolean; + connected: boolean; + disconnect(): void; + unref(): void; + ref(): void; + + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (code: number, signal: string) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", code: number, signal: string): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "exit", code: number, signal: string): boolean; + emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (code: number, signal: string) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (code: number, signal: string) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (code: number, signal: string) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + } + + export interface MessageOptions { + keepOpen?: boolean; + } + + export interface SpawnOptions { + argv0?: string; + cwd?: string; + env?: any; + stdio?: any; + detached?: boolean; + uid?: number; + gid?: number; + shell?: boolean | string; + windowsVerbatimArguments?: boolean; + windowsHide?: boolean; + } + + export function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptions): ChildProcess; + + export interface ExecOptions { + cwd?: string; + env?: any; + shell?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + windowsHide?: boolean; + } + + export interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + + export interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: string | null; // specify `null`. + } + + export interface ExecException extends Error { + cmd?: string; + killed?: boolean; + code?: number; + signal?: string; + } + + // no `options` definitely means stdout/stderr are `string`. + export function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + export function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + export function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + export function exec(command: string, options: { encoding: string } & ExecOptions, callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + export function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + export function exec(command: string, options: ({ encoding?: string | null } & ExecOptions) | undefined | null, callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace exec { + export function __promisify__(command: string): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): Promise<{ stdout: Buffer, stderr: Buffer }>; + export function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(command: string, options: ExecOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(command: string, options?: ({ encoding?: string | null } & ExecOptions) | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + export interface ExecFileOptions { + cwd?: string; + env?: any; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + windowsHide?: boolean; + windowsVerbatimArguments?: boolean; + } + export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: 'buffer' | null; + } + export interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { + encoding: string; + } + + export function execFile(file: string): ChildProcess; + export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess; + export function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; + export function execFile(file: string, args: ReadonlyArray | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess; + + // no `options` definitely means stdout/stderr are `string`. + export function execFile(file: string, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + export function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + export function execFile(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + export function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + export function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + export function execFile(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + export function execFile(file: string, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess; + export function execFile(file: string, args: ReadonlyArray | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace execFile { + export function __promisify__(file: string): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, args: string[] | undefined | null): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>; + export function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + export function __promisify__(file: string, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + export interface ForkOptions { + cwd?: string; + env?: any; + execPath?: string; + execArgv?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + windowsVerbatimArguments?: boolean; + } + export function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; + + export interface SpawnSyncOptions { + argv0?: string; + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + shell?: boolean | string; + windowsHide?: boolean; + windowsVerbatimArguments?: boolean; + } + export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding: string; // specify `null`. + } + export interface SpawnSyncReturns { + pid: number; + output: string[]; + stdout: T; + stderr: T; + status: number; + signal: string; + error: Error; + } + export function spawnSync(command: string): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + export function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; + + export interface ExecSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + shell?: string; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + windowsHide?: boolean; + } + export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding: string; // specify `null`. + } + export function execSync(command: string): Buffer; + export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; + export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; + export function execSync(command: string, options?: ExecSyncOptions): Buffer; + + export interface ExecFileSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + windowsHide?: boolean; + } + export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding: string; // specify `null`. + } + export function execFileSync(command: string): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer; + export function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): Buffer; +} + +declare module "url" { + import { ParsedUrlQuery } from 'querystring'; + + export interface UrlObjectCommon { + auth?: string; + hash?: string; + host?: string; + hostname?: string; + href?: string; + path?: string; + pathname?: string; + protocol?: string; + search?: string; + slashes?: boolean; + } + + // Input to `url.format` + export interface UrlObject extends UrlObjectCommon { + port?: string | number; + query?: string | null | { [key: string]: any }; + } + + // Output of `url.parse` + export interface Url extends UrlObjectCommon { + port?: string; + query?: string | null | ParsedUrlQuery; + } + + export interface UrlWithParsedQuery extends Url { + query: ParsedUrlQuery; + } + + export interface UrlWithStringQuery extends Url { + query: string | null; + } + + export function parse(urlStr: string): UrlWithStringQuery; + export function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; + export function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; + export function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; + + export function format(URL: URL, options?: URLFormatOptions): string; + export function format(urlObject: UrlObject | string): string; + export function resolve(from: string, to: string): string; + + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + + export interface URLFormatOptions { + auth?: boolean; + fragment?: boolean; + search?: boolean; + unicode?: boolean; + } + + export class URL { + constructor(input: string, base?: string | URL); + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toString(): string; + toJSON(): string; + } + + export class URLSearchParams implements Iterable<[string, string]> { + constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>); + append(name: string, value: string): void; + delete(name: string): void; + entries(): IterableIterator<[string, string]>; + forEach(callback: (value: string, name: string, searchParams: this) => void): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): IterableIterator; + set(name: string, value: string): void; + sort(): void; + toString(): string; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[string, string]>; + } +} + +declare module "dns" { + // Supported getaddrinfo flags. + export const ADDRCONFIG: number; + export const V4MAPPED: number; + + export interface LookupOptions { + family?: number; + hints?: number; + all?: boolean; + } + + export interface LookupOneOptions extends LookupOptions { + all?: false; + } + + export interface LookupAllOptions extends LookupOptions { + all: true; + } + + export interface LookupAddress { + address: string; + family: number; + } + + export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException, addresses: LookupAddress[]) => void): void; + export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void; + export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lookup { + export function __promisify__(hostname: string, options: LookupAllOptions): Promise<{ address: LookupAddress[] }>; + export function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<{ address: string, family: number }>; + export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>; + } + + export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void; + + export namespace lookupService { + export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>; + } + + export interface ResolveOptions { + ttl: boolean; + } + + export interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + + export interface RecordWithTtl { + address: string; + ttl: number; + } + + export interface AnyRecordWithTtl extends RecordWithTtl { + type: "A" | "AAAA"; + } + + export interface MxRecord { + priority: number; + exchange: string; + } + + export interface AnyMxRecord extends MxRecord { + type: "MX"; + } + + export interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + + export interface AnyNaptrRecord extends NaptrRecord { + type: "NAPTR"; + } + + export interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + + export interface AnySoaRecord extends SoaRecord { + type: "SOA"; + } + + export interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + + export interface AnySrvRecord extends SrvRecord { + type: "SRV"; + } + + export interface AnyTxtRecord { + type: "TXT"; + entries: string[]; + } + + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; + export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void; + export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve { + export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + export function __promisify__(hostname: string, rrtype: "ANY"): Promise>; + export function __promisify__(hostname: string, rrtype: "MX"): Promise; + export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; + export function __promisify__(hostname: string, rrtype: "SOA"): Promise; + export function __promisify__(hostname: string, rrtype: "SRV"): Promise; + export function __promisify__(hostname: string, rrtype: "TXT"): Promise; + export function __promisify__(hostname: string, rrtype?: string): Promise; + } + + export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void; + export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve4 { + export function __promisify__(hostname: string): Promise; + export function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + export function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void; + export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve6 { + export function __promisify__(hostname: string): Promise; + export function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + export function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; + export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void; + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + + export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; + export function setServers(servers: string[]): void; + + // Error codes + export var NODATA: string; + export var FORMERR: string; + export var SERVFAIL: string; + export var NOTFOUND: string; + export var NOTIMP: string; + export var REFUSED: string; + export var BADQUERY: string; + export var BADNAME: string; + export var BADFAMILY: string; + export var BADRESP: string; + export var CONNREFUSED: string; + export var TIMEOUT: string; + export var EOF: string; + export var FILE: string; + export var NOMEM: string; + export var DESTRUCTION: string; + export var BADSTR: string; + export var BADFLAGS: string; + export var NONAME: string; + export var BADHINTS: string; + export var NOTINITIALIZED: string; + export var LOADIPHLPAPI: string; + export var ADDRGETNETWORKPARAMS: string; + export var CANCELLED: string; +} + +declare module "net" { + import * as stream from "stream"; + import * as events from "events"; + import * as dns from "dns"; + + type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; + + export interface AddressInfo { + address: string; + family: string; + port: number; + } + + export interface SocketConstructorOpts { + fd?: number; + allowHalfOpen?: boolean; + readable?: boolean; + writable?: boolean; + } + + export interface TcpSocketConnectOpts { + port: number; + host?: string; + localAddress?: string; + localPort?: number; + hints?: number; + family?: number; + lookup?: LookupFunction; + } + + export interface IpcSocketConnectOpts { + path: string; + } + + export type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + + export class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + write(data: any, encoding?: string, callback?: Function): void; + + connect(options: SocketConnectOpts, connectionListener?: Function): this; + connect(port: number, host: string, connectionListener?: Function): this; + connect(port: number, connectionListener?: Function): this; + connect(path: string, connectionListener?: Function): this; + + bufferSize: number; + setEncoding(encoding?: string): this; + pause(): this; + resume(): this; + setTimeout(timeout: number, callback?: Function): this; + setNoDelay(noDelay?: boolean): this; + setKeepAlive(enable?: boolean, initialDelay?: number): this; + address(): AddressInfo | string; + unref(): void; + ref(): void; + + remoteAddress?: string; + remoteFamily?: string; + remotePort?: number; + localAddress: string; + localPort: number; + bytesRead: number; + bytesWritten: number; + connecting: boolean; + destroyed: boolean; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. timeout + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (had_error: boolean) => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "data", listener: (data: Buffer) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", had_error: boolean): boolean; + emit(event: "connect"): boolean; + emit(event: "data", data: Buffer): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (had_error: boolean) => void): this; + on(event: "connect", listener: () => void): this; + on(event: "data", listener: (data: Buffer) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (had_error: boolean) => void): this; + once(event: "connect", listener: () => void): this; + once(event: "data", listener: (data: Buffer) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (had_error: boolean) => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "data", listener: (data: Buffer) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (had_error: boolean) => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "data", listener: (data: Buffer) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export interface ListenOptions { + port?: number; + host?: string; + backlog?: number; + path?: string; + exclusive?: boolean; + readableAll?: boolean; + writableAll?: boolean; + } + + // https://github.com/nodejs/node/blob/master/lib/net.js + export class Server extends events.EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void); + + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: Function): this; + listen(port?: number, hostname?: string, listeningListener?: Function): this; + listen(port?: number, backlog?: number, listeningListener?: Function): this; + listen(port?: number, listeningListener?: Function): this; + listen(path: string, backlog?: number, listeningListener?: Function): this; + listen(path: string, listeningListener?: Function): this; + listen(options: ListenOptions, listeningListener?: Function): this; + listen(handle: any, backlog?: number, listeningListener?: Function): this; + listen(handle: any, listeningListener?: Function): this; + close(callback?: Function): this; + address(): AddressInfo | string; + getConnections(cb: (error: Error | null, count: number) => void): void; + ref(): this; + unref(): this; + maxConnections: number; + connections: number; + listening: boolean; + + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "connection", listener: (socket: Socket) => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "connection", socket: Socket): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "connection", listener: (socket: Socket) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "connection", listener: (socket: Socket) => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "connection", listener: (socket: Socket) => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + } + + export interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + export interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + export type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + + export function createServer(connectionListener?: (socket: Socket) => void): Server; + export function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server; + export function connect(options: NetConnectOpts, connectionListener?: Function): Socket; + export function connect(port: number, host?: string, connectionListener?: Function): Socket; + export function connect(path: string, connectionListener?: Function): Socket; + export function createConnection(options: NetConnectOpts, connectionListener?: Function): Socket; + export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; + export function createConnection(path: string, connectionListener?: Function): Socket; + export function isIP(input: string): number; + export function isIPv4(input: string): boolean; + export function isIPv6(input: string): boolean; +} + +declare module "dgram" { + import { AddressInfo } from "net"; + import * as dns from "dns"; + import * as events from "events"; + + export interface RemoteInfo { + address: string; + family: string; + port: number; + } + + export interface BindOptions { + port: number; + address?: string; + exclusive?: boolean; + } + + type SocketType = "udp4" | "udp6"; + + export interface SocketOptions { + type: SocketType; + reuseAddr?: boolean; + recvBufferSize?: number; + sendBufferSize?: number; + lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void; + } + + export function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + + export class Socket extends events.EventEmitter { + send(msg: Buffer | string | Uint8Array | any[], port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: Buffer | string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + bind(port?: number, address?: string, callback?: () => void): void; + bind(port?: number, callback?: () => void): void; + bind(callback?: () => void): void; + bind(options: BindOptions, callback?: Function): void; + close(callback?: () => void): void; + address(): AddressInfo | string; + setBroadcast(flag: boolean): void; + setTTL(ttl: number): void; + setMulticastTTL(ttl: number): void; + setMulticastInterface(multicastInterface: string): void; + setMulticastLoopback(flag: boolean): void; + addMembership(multicastAddress: string, multicastInterface?: string): void; + dropMembership(multicastAddress: string, multicastInterface?: string): void; + ref(): this; + unref(): this; + setRecvBufferSize(size: number): void; + setSendBufferSize(size: number): void; + getRecvBufferSize(): number; + getSendBufferSize(): number; + + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + addListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + emit(event: "message", msg: Buffer, rinfo: AddressInfo): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + on(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + once(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + prependListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + } +} + +declare module "fs" { + import * as stream from "stream"; + import * as events from "events"; + import { URL } from "url"; + + /** + * Valid types for path values in "fs". + */ + export type PathLike = string | Buffer | URL; + + export class Stats { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atimeMs: number; + mtimeMs: number; + ctimeMs: number; + birthtimeMs: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + + export interface FSWatcher extends events.EventEmitter { + close(): void; + + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: "error", listener: (error: Error) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: "error", listener: (error: Error) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + } + + export class ReadStream extends stream.Readable { + close(): void; + bytesRead: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + export class WriteStream extends stream.Writable { + close(): void; + bytesWritten: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function renameSync(oldPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function truncate(path: PathLike, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function __promisify__(path: PathLike, len?: number | null): Promise; + } + + /** + * Synchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function truncateSync(path: PathLike, len?: number | null): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function ftruncate(fd: number, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + export function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function __promisify__(fd: number, len?: number | null): Promise; + } + + /** + * Synchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function ftruncateSync(fd: number, len?: number | null): void; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function chownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number, uid: number, gid: number): Promise; + } + + /** + * Synchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function fchownSync(fd: number, uid: number, gid: number): void; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lchownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function chmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function __promisify__(path: PathLike, mode: string | number): Promise; + } + + /** + * Synchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function chmodSync(path: PathLike, mode: string | number): void; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function __promisify__(fd: number, mode: string | number): Promise; + } + + /** + * Synchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function fchmodSync(fd: number, mode: string | number): void; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function lchmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function __promisify__(path: PathLike, mode: string | number): Promise; + } + + /** + * Synchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function lchmodSync(path: PathLike, mode: string | number): void; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function statSync(path: PathLike): Stats; + + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function fstatSync(fd: number): Stats; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lstatSync(path: PathLike): Stats; + + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function link(existingPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function linkSync(existingPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + export function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + + export type Type = "dir" | "file" | "junction"; + } + + /** + * Synchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, linkString: Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string | Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + export function native(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + export function native(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void; + export function native(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void; + export function native(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + } + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + + export namespace realpathSync { + export function native(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + export function native(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + export function native(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + } + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function unlinkSync(path: PathLike): void; + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function rmdirSync(path: PathLike): void; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, mode: number | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function __promisify__(path: PathLike, mode?: number | string | null): Promise; + } + + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, mode?: number | string | null): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException, folder: Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string | Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(prefix: string, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: { encoding?: string | null } | string | null): string | Buffer; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, files: Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[] | Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer" }): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): string[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): string[] | Buffer[]; + + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function closeSync(fd: number): void; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function open(path: PathLike, flags: string | number, mode: string | number | undefined | null, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; + + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function open(path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function __promisify__(path: PathLike, flags: string | number, mode?: string | number | null): Promise; + } + + /** + * Synchronous open(2) - open and possibly create a file, returning a file descriptor.. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function openSync(path: PathLike, flags: string | number, mode?: string | number | null): number; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function utimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function __promisify__(fd: number, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function futimesSync(fd: number, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function fsync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function fsyncSync(fd: number): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + export function write(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + export function write(fd: number, buffer: TBuffer, offset: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function write(fd: number, string: any, position: number | undefined | null, encoding: string | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, string: any, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + */ + export function write(fd: number, string: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function __promisify__(fd: number, buffer?: TBuffer, offset?: number, length?: number, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function __promisify__(fd: number, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + } + + /** + * Synchronously writes `buffer` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function writeSync(fd: number, buffer: Buffer | Uint8Array, offset?: number | null, length?: number | null, position?: number | null): number; + + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function writeSync(fd: number, string: any, position?: number | null, encoding?: string | null): number; + + /** + * Asynchronously reads data from the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function read(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function __promisify__(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + } + + /** + * Synchronously reads data from the file referenced by the supplied file descriptor, returning the number of bytes read. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function readSync(fd: number, buffer: Buffer | Uint8Array, offset: number, length: number, position: number | null): number; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile(path: PathLike | number, options: { encoding?: null; flag?: string; } | undefined | null, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile(path: PathLike | number, options: { encoding: string; flag?: string; } | string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile(path: PathLike | number, options: { encoding?: string | null; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException, data: string | Buffer) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + export function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function __promisify__(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function __promisify__(path: PathLike | number, options: { encoding: string; flag?: string; } | string): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function __promisify__(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): Promise; + } + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Buffer; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options: { encoding: string; flag?: string; } | string): string; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): string | Buffer; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function writeFile(path: PathLike | number, data: any, options: { encoding?: string | null; mode?: number | string; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function writeFile(path: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function __promisify__(path: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): Promise; + } + + /** + * Synchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function writeFileSync(path: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function appendFile(file: PathLike | number, data: any, options: { encoding?: string | null, mode?: string | number, flag?: string } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function __promisify__(file: PathLike | number, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string } | string | null): Promise; + } + + /** + * Synchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function appendFileSync(file: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + */ + export function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number; } | undefined, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Stop watching for changes on `filename`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null, listener?: (event: string, filename: string) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: { encoding: "buffer", persistent?: boolean, recursive?: boolean } | "buffer", listener?: (event: string, filename: Buffer) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: { encoding?: string | null, persistent?: boolean, recursive?: boolean } | string | null, listener?: (event: string, filename: string | Buffer) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function watch(filename: PathLike, listener?: (event: string, filename: string) => any): FSWatcher; + + /** + * Asynchronously tests whether or not the given path exists by checking with the file system. + * @deprecated + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function exists(path: PathLike, callback: (exists: boolean) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronously tests whether or not the given path exists by checking with the file system. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function existsSync(path: PathLike): boolean; + + export namespace constants { + // File Access Constants + + /** Constant for fs.access(). File is visible to the calling process. */ + export const F_OK: number; + + /** Constant for fs.access(). File can be read by the calling process. */ + export const R_OK: number; + + /** Constant for fs.access(). File can be written by the calling process. */ + export const W_OK: number; + + /** Constant for fs.access(). File can be executed by the calling process. */ + export const X_OK: number; + + // File Copy Constants + + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + export const COPYFILE_EXCL: number; + + /** Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. */ + export const COPYFILE_FICLONE: number; + + /** Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. If the underlying platform does not support copy-on-write, then the operation will fail with an error. */ + export const COPYFILE_FICLONE_FORCE: number; + + // File Open Constants + + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + export const O_RDONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + export const O_WRONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + export const O_RDWR: number; + + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + export const O_CREAT: number; + + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + export const O_EXCL: number; + + /** Constant for fs.open(). Flag indicating that if path identifies a terminal device, opening the path shall not cause that terminal to become the controlling terminal for the process (if the process does not already have one). */ + export const O_NOCTTY: number; + + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + export const O_TRUNC: number; + + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + export const O_APPEND: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + export const O_DIRECTORY: number; + + /** Constant for fs.open(). Flag indicating reading accesses to the file system will no longer result in an update to the atime information associated with the file. This flag is available on Linux operating systems only. */ + export const O_NOATIME: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + export const O_NOFOLLOW: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + export const O_SYNC: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + export const O_DSYNC: number; + + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + export const O_SYMLINK: number; + + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + export const O_DIRECT: number; + + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + export const O_NONBLOCK: number; + + // File Type Constants + + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + export const S_IFMT: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + export const S_IFREG: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + export const S_IFDIR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + export const S_IFCHR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + export const S_IFBLK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + export const S_IFIFO: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + export const S_IFLNK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + export const S_IFSOCK: number; + + // File Mode Constants + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + export const S_IRWXU: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + export const S_IRUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + export const S_IWUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + export const S_IXUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + export const S_IRWXG: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + export const S_IRGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + export const S_IWGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + export const S_IXGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + export const S_IRWXO: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + export const S_IROTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + export const S_IWOTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + export const S_IXOTH: number; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function access(path: PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function access(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function __promisify__(path: PathLike, mode?: number): Promise; + } + + /** + * Synchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function accessSync(path: PathLike, mode?: number): void; + + /** + * Returns a new `ReadStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function createReadStream(path: PathLike, options?: string | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + end?: number; + highWaterMark?: number; + }): ReadStream; + + /** + * Returns a new `WriteStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function createWriteStream(path: PathLike, options?: string | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + }): WriteStream; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function fdatasync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function fdatasyncSync(fd: number): void; + + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + */ + export function copyFile(src: PathLike, dest: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function copyFile(src: PathLike, dest: PathLike, flags: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace copyFile { + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function __promisify__(src: PathLike, dst: PathLike, flags?: number): Promise; + } + + /** + * Synchronously copies src to dest. By default, dest is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void; + + export namespace promises { + interface FileHandle { + /** + * Gets the file descriptor for this file handle. + */ + readonly fd: number; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for appending. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + appendFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + */ + chown(uid: number, gid: number): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + chmod(mode: string | number): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + */ + datasync(): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + */ + sync(): Promise; + + /** + * Asynchronously reads data from the file. + * The `FileHandle` must have been opened for reading. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + read(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: { encoding?: null, flag?: string | number } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: { encoding?: string | null, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous fstat(2) - Get file status. + */ + stat(): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param len If not specified, defaults to `0`. + */ + truncate(len?: number): Promise; + + /** + * Asynchronously change file timestamps of the file. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + utimes(atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously writes `buffer` to the file. + * The `FileHandle` must have been opened for writing. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + write(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + write(data: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + writeFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous close(2) - close a `FileHandle`. + */ + close(): Promise; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function access(path: PathLike, mode?: number): Promise; + + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only + * supported flag is `fs.constants.COPYFILE_EXCL`, which causes the copy operation to fail if + * `dest` already exists. + */ + function copyFile(src: PathLike, dest: PathLike, flags?: number): Promise; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not + * supplied, defaults to `0o666`. + */ + function open(path: PathLike, flags: string | number, mode?: string | number): Promise; + + /** + * Asynchronously reads data from the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If + * `null`, data will be read from the current position. + */ + function read(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function write(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function write(handle: FileHandle, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function truncate(path: PathLike, len?: number): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param handle A `FileHandle`. + * @param len If not specified, defaults to `0`. + */ + function ftruncate(handle: FileHandle, len?: number): Promise; + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function rmdir(path: PathLike): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param handle A `FileHandle`. + */ + function fdatasync(handle: FileHandle): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param handle A `FileHandle`. + */ + function fsync(handle: FileHandle): Promise; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, mode?: string | number): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + + /** + * Asynchronous fstat(2) - Get file status. + * @param handle A `FileHandle`. + */ + function fstat(handle: FileHandle): Promise; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lstat(path: PathLike): Promise; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function stat(path: PathLike): Promise; + + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function unlink(path: PathLike): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param handle A `FileHandle`. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function fchmod(handle: FileHandle, mode: string | number): Promise; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function chmod(path: PathLike, mode: string | number): Promise; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function lchmod(path: PathLike, mode: string | number): Promise; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param handle A `FileHandle`. + */ + function fchown(handle: FileHandle, uid: number, gid: number): Promise; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function futimes(handle: FileHandle, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * It is unsafe to call `fsPromises.writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function writeFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function appendFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: { encoding?: null, flag?: string | number } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: { encoding?: string | null, flag?: string | number } | string | null): Promise; + } +} + +declare module "path" { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + export interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + export interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string; + /** + * The file extension (if any) such as '.html' + */ + ext?: string; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string; + } + + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param p string path to normalize. + */ + export function normalize(p: string): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths paths to join. + */ + export function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} paramter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param pathSegments string paths to join. Non-string arguments are ignored. + */ + export function resolve(...pathSegments: string[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * @param path path to test. + */ + export function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to}. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + */ + export function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param p the path to evaluate. + */ + export function dirname(p: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param p the path to evaluate. + * @param ext optionally, an extension to remove from the result. + */ + export function basename(p: string, ext?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string + * + * @param p the path to evaluate. + */ + export function extname(p: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + export var sep: '\\' | '/'; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + export var delimiter: ';' | ':'; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param pathString path to evaluate. + */ + export function parse(pathString: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathString path to evaluate. + */ + export function format(pathObject: FormatInputPathObject): string; + + export module posix { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: FormatInputPathObject): string; + } + + export module win32 { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: FormatInputPathObject): string; + } +} + +declare module "string_decoder" { + export interface NodeStringDecoder { + write(buffer: Buffer): string; + end(buffer?: Buffer): string; + } + export var StringDecoder: { + new(encoding?: string): NodeStringDecoder; + }; +} + +declare module "tls" { + import * as crypto from "crypto"; + import * as dns from "dns"; + import * as net from "net"; + import * as stream from "stream"; + + var CLIENT_RENEG_LIMIT: number; + var CLIENT_RENEG_WINDOW: number; + + export interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + + export interface PeerCertificate { + subject: Certificate; + issuer: Certificate; + subjectaltname: string; + infoAccess: { [index: string]: string[] | undefined }; + modulus: string; + exponent: string; + valid_from: string; + valid_to: string; + fingerprint: string; + ext_key_usage: string[]; + serialNumber: string; + raw: Buffer; + } + + export interface DetailedPeerCertificate extends PeerCertificate { + issuerCertificate: DetailedPeerCertificate; + } + + export interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + } + + export class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket, options?: { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext, + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean, + /** + * An optional net.Server instance. + */ + server?: net.Server, + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean, + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. Defaults to false. + */ + rejectUnauthorized?: boolean, + /** + * An array of strings or a Buffer naming possible NPN protocols. + * (Protocols should be ordered by their priority.) + */ + NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array, + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) When the server + * receives both NPN and ALPN extensions from the client, ALPN takes + * precedence over NPN and the server does not send an NPN extension + * to the client. + */ + ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array, + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void, + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer, + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean + }); + + /** + * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false. + */ + authorized: boolean; + /** + * The reason why the peer's certificate has not been verified. + * This property becomes available only when tlsSocket.authorized === false. + */ + authorizationError: Error; + /** + * Static boolean value, always true. + * May be used to distinguish TLS sockets from regular ones. + */ + encrypted: boolean; + /** + * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection. + * @returns Returns an object representing the cipher name + * and the SSL/TLS protocol version of the current connection. + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the peer's certificate. + * The returned object has some properties corresponding to the field of the certificate. + * If detailed argument is true the full chain with issuer property will be returned, + * if false only the top certificate without issuer property. + * If the peer does not provide a certificate, it returns null or an empty object. + * @param detailed - If true; the full chain with issuer property will be returned. + * @returns An object representing the peer's certificate. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the current connection. + * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process. + * The value `null` will be returned for server sockets or disconnected client sockets. + * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information. + * @returns negotiated SSL/TLS protocol version of the current connection + */ + getProtocol(): string | null; + /** + * Could be used to speed up handshake establishment when reconnecting to the server. + * @returns ASN.1 encoded TLS session or undefined if none was negotiated. + */ + getSession(): any; + /** + * NOTE: Works only with client TLS sockets. + * Useful only for debugging, for session reuse provide session option to tls.connect(). + * @returns TLS session ticket or undefined if none was negotiated. + */ + getTLSTicket(): any; + /** + * Initiate TLS renegotiation process. + * + * NOTE: Can be used to request peer's certificate after the secure connection has been established. + * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout. + * @param options - The options may contain the following fields: rejectUnauthorized, + * requestCert (See tls.createServer() for details). + * @param callback - callback(err) will be executed with null as err, once the renegotiation + * is successfully completed. + */ + renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): any; + /** + * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by + * the TLS layer until the entire fragment is received and its integrity is verified; + * large fragments can span multiple roundtrips, and their processing can be delayed due to packet + * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, + * which may decrease overall server throughput. + * @param size - TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * @returns Returns true on success, false otherwise. + */ + setMaxSendFragment(size: number): boolean; + + /** + * events.EventEmitter + * 1. OCSPResponse + * 2. secureConnect + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + addListener(event: "secureConnect", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "OCSPResponse", response: Buffer): boolean; + emit(event: "secureConnect"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "OCSPResponse", listener: (response: Buffer) => void): this; + on(event: "secureConnect", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "OCSPResponse", listener: (response: Buffer) => void): this; + once(event: "secureConnect", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependListener(event: "secureConnect", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependOnceListener(event: "secureConnect", listener: () => void): this; + } + + export interface TlsOptions extends SecureContextOptions { + handshakeTimeout?: number; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void; + sessionTimeout?: number; + ticketKeys?: Buffer; + } + + export interface ConnectionOptions extends SecureContextOptions { + host?: string; + port?: number; + path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket + rejectUnauthorized?: boolean; // Defaults to true + NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + checkServerIdentity?: typeof checkServerIdentity; + servername?: string; // SNI TLS Extension + session?: Buffer; + minDHSize?: number; + secureContext?: SecureContext; // If not provided, the entire ConnectionOptions object will be passed to tls.createSecureContext() + lookup?: net.LookupFunction; + } + + export class Server extends net.Server { + addContext(hostName: string, credentials: { + key: string; + cert: string; + ca: string; + }): void; + + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + addListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; + emit(event: "newSession", sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void): boolean; + emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: Function): boolean; + emit(event: "resumeSession", sessionId: any, callback: (err: Error, sessionData: any) => void): boolean; + emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + on(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + once(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + prependListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + prependOnceListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + } + + export interface SecurePair { + encrypted: any; + cleartext: any; + } + + export interface SecureContextOptions { + pfx?: string | Buffer | Array; + key?: string | Buffer | Array; + passphrase?: string; + cert?: string | Buffer | Array; + ca?: string | Buffer | Array; + ciphers?: string; + honorCipherOrder?: boolean; + ecdhCurve?: string; + clientCertEngine?: string; + crl?: string | Buffer | Array; + dhparam?: string | Buffer; + secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options + secureProtocol?: string; // SSL Method, e.g. SSLv23_method + sessionIdContext?: string; + } + + export interface SecureContext { + context: any; + } + + /* + * Verifies the certificate `cert` is issued to host `host`. + * @host The hostname to verify the certificate against + * @cert PeerCertificate representing the peer's certificate + * + * Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined. + */ + export function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined; + export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + export function createSecureContext(details: SecureContextOptions): SecureContext; + export function getCiphers(): string[]; + + export var DEFAULT_ECDH_CURVE: string; +} + +declare module "crypto" { + import * as stream from "stream"; + + export interface Certificate { + exportChallenge(spkac: string | Buffer | NodeJS.TypedArray | DataView): Buffer; + exportPublicKey(spkac: string | Buffer | NodeJS.TypedArray | DataView): Buffer; + verifySpkac(spkac: Buffer | NodeJS.TypedArray | DataView): boolean; + } + export var Certificate: { + new(): Certificate; + (): Certificate; + }; + + /** @deprecated since v10.0.0 */ + export var fips: boolean; + + export interface CredentialDetails { + pfx: string; + key: string; + passphrase: string; + cert: string; + ca: string | string[]; + crl: string | string[]; + ciphers: string; + } + export interface Credentials { context?: any; } + export function createCredentials(details: CredentialDetails): Credentials; + export function createHash(algorithm: string, options?: stream.TransformOptions): Hash; + export function createHmac(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Hmac; + + type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1"; + type HexBase64Latin1Encoding = "latin1" | "hex" | "base64"; + type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary"; + type HexBase64BinaryEncoding = "binary" | "base64" | "hex"; + type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; + + export interface Hash extends NodeJS.ReadWriteStream { + update(data: string | Buffer | NodeJS.TypedArray | DataView): Hash; + update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + export interface Hmac extends NodeJS.ReadWriteStream { + update(data: string | Buffer | NodeJS.TypedArray | DataView): Hmac; + update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + export type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm'; + export type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; + export interface CipherCCMOptions extends stream.TransformOptions { + authTagLength: number; + } + export interface CipherGCMOptions extends stream.TransformOptions { + authTagLength?: number; + } + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createCipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher; + export function createCipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM; + export function createCipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM; + + export function createCipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher; + export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM; + export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM; + + export interface Cipher extends NodeJS.ReadWriteStream { + update(data: string | Buffer | NodeJS.TypedArray | DataView): Buffer; + update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer; + update(data: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64BinaryEncoding): string; + update(data: Buffer | NodeJS.TypedArray | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string; + // second arg ignored + update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): this; + // getAuthTag(): Buffer; + // setAAD(buffer: Buffer): this; // docs only say buffer + } + export interface CipherCCM extends Cipher { + setAAD(buffer: Buffer, options: { plainTextLength: number }): this; + getAuthTag(): Buffer; + } + export interface CipherGCM extends Cipher { + setAAD(buffer: Buffer, options?: { plainTextLength: number }): this; + getAuthTag(): Buffer; + } + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createDecipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; + export function createDecipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM; + export function createDecipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM; + + export function createDecipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; + export function createDecipheriv(algorithm: CipherCCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM; + export function createDecipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM; + + export interface Decipher extends NodeJS.ReadWriteStream { + update(data: Buffer | NodeJS.TypedArray | DataView): Buffer; + update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer; + update(data: Buffer | NodeJS.TypedArray | DataView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string; + // second arg is ignored + update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): this; + // setAuthTag(tag: Buffer | NodeJS.TypedArray | DataView): this; + // setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this; + } + export interface DecipherCCM extends Decipher { + setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options: { plainTextLength: number }): this; + setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this; + } + export interface DecipherGCM extends Decipher { + setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options?: { plainTextLength: number }): this; + setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this; + } + + export function createSign(algorithm: string, options?: stream.WritableOptions): Signer; + export interface Signer extends NodeJS.WritableStream { + update(data: string | Buffer | NodeJS.TypedArray | DataView): Signer; + update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer; + sign(private_key: string | { key: string; passphrase: string, padding?: number, saltLength?: number }): Buffer; + sign(private_key: string | { key: string; passphrase: string, padding?: number, saltLength?: number }, output_format: HexBase64Latin1Encoding): string; + } + export function createVerify(algorith: string, options?: stream.WritableOptions): Verify; + export interface Verify extends NodeJS.WritableStream { + update(data: string | Buffer | NodeJS.TypedArray | DataView): Verify; + update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify; + verify(object: string | Object, signature: Buffer | NodeJS.TypedArray | DataView): boolean; + verify(object: string | Object, signature: string, signature_format: HexBase64Latin1Encoding): boolean; + // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format + // The signature field accepts a TypedArray type, but it is only available starting ES2017 + } + export function createDiffieHellman(prime_length: number, generator?: number | Buffer | NodeJS.TypedArray | DataView): DiffieHellman; + export function createDiffieHellman(prime: Buffer | NodeJS.TypedArray | DataView): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer | NodeJS.TypedArray | DataView): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman; + export interface DiffieHellman { + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding): string; + computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64Latin1Encoding): string; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrime(): Buffer; + getPrime(encoding: HexBase64Latin1Encoding): string; + getGenerator(): Buffer; + getGenerator(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + setPublicKey(public_key: Buffer | NodeJS.TypedArray | DataView): void; + setPublicKey(public_key: string, encoding: string): void; + setPrivateKey(private_key: Buffer | NodeJS.TypedArray | DataView): void; + setPrivateKey(private_key: string, encoding: string): void; + verifyError: number; + } + export function getDiffieHellman(group_name: string): DiffieHellman; + export function pbkdf2(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => any): void; + export function pbkdf2Sync(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, iterations: number, keylen: number, digest: string): Buffer; + + export function randomBytes(size: number): Buffer; + export function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + export function pseudoRandomBytes(size: number): Buffer; + export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + + export function randomFillSync(buffer: T, offset?: number, size?: number): T; + export function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; + export function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; + export function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; + + export interface ScryptOptions { + N?: number; + r?: number; + p?: number; + maxmem?: number; + } + export function scrypt(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void; + export function scrypt(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void; + export function scryptSync(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, options?: ScryptOptions): Buffer; + + export interface RsaPublicKey { + key: string; + padding?: number; + } + export interface RsaPrivateKey { + key: string; + passphrase?: string; + padding?: number; + } + export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer; + export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer; + export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer; + export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer; + export function getCiphers(): string[]; + export function getCurves(): string[]; + export function getHashes(): string[]; + export class ECDH { + static convertKey(key: string | Buffer | NodeJS.TypedArray | DataView, curve: string, inputEncoding?: HexBase64Latin1Encoding, outputEncoding?: "latin1" | "hex" | "base64", format?: "uncompressed" | "compressed" | "hybrid"): Buffer | string; + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string; + computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64Latin1Encoding): string; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string; + setPrivateKey(private_key: Buffer | NodeJS.TypedArray | DataView): void; + setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void; + } + export function createECDH(curve_name: string): ECDH; + export function timingSafeEqual(a: Buffer | NodeJS.TypedArray | DataView, b: Buffer | NodeJS.TypedArray | DataView): boolean; + /** @deprecated since v10.0.0 */ + export var DEFAULT_ENCODING: string; +} + +declare module "stream" { + import * as events from "events"; + + class internal extends events.EventEmitter { + pipe(destination: T, options?: { end?: boolean; }): T; + } + + namespace internal { + export class Stream extends internal { } + + export interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + read?(this: Readable, size: number): void; + destroy?(this: Readable, error: Error | null, callback: (error: Error | null) => void): void; + } + + export class Readable extends Stream implements NodeJS.ReadableStream { + readable: boolean; + readonly readableHighWaterMark: number; + readonly readableLength: number; + constructor(opts?: ReadableOptions); + _read(size: number): void; + read(size?: number): any; + setEncoding(encoding: string): this; + pause(): this; + resume(): this; + isPaused(): boolean; + unpipe(destination?: T): this; + unshift(chunk: any): void; + wrap(oldStream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: string): boolean; + _destroy(error: Error | null, callback: (error: Error | null) => void): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. readable + * 5. error + */ + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: any) => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "readable", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "data", chunk: any): boolean; + emit(event: "end"): boolean; + emit(event: "readable"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: any) => void): this; + on(event: "end", listener: () => void): this; + on(event: "readable", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: any) => void): this; + once(event: "end", listener: () => void): this; + once(event: "readable", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: any) => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "readable", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: any) => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "readable", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "close", listener: () => void): this; + removeListener(event: "data", listener: (chunk: any) => void): this; + removeListener(event: "end", listener: () => void): this; + removeListener(event: "readable", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + export interface WritableOptions { + highWaterMark?: number; + decodeStrings?: boolean; + objectMode?: boolean; + write?(this: Writable, chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + writev?(this: Writable, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void; + final?(this: Writable, callback: (error?: Error | null) => void): void; + } + + export class Writable extends Stream implements NodeJS.WritableStream { + writable: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: string): this; + end(cb?: () => void): void; + end(chunk: any, cb?: () => void): void; + end(chunk: any, encoding?: string, cb?: () => void): void; + cork(): void; + uncork(): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + */ + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "pipe", listener: (src: Readable) => void): this; + addListener(event: "unpipe", listener: (src: Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "drain"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "pipe", src: Readable): boolean; + emit(event: "unpipe", src: Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "pipe", listener: (src: Readable) => void): this; + on(event: "unpipe", listener: (src: Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "pipe", listener: (src: Readable) => void): this; + once(event: "unpipe", listener: (src: Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "pipe", listener: (src: Readable) => void): this; + prependListener(event: "unpipe", listener: (src: Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "close", listener: () => void): this; + removeListener(event: "drain", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "finish", listener: () => void): this; + removeListener(event: "pipe", listener: (src: Readable) => void): this; + removeListener(event: "unpipe", listener: (src: Readable) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean; + readableObjectMode?: boolean; + writableObjectMode?: boolean; + read?(this: Duplex, size: number): void; + write?(this: Duplex, chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + final?(this: Duplex, callback: (error?: Error | null) => void): void; + destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; + } + + // Note: Duplex extends both Readable and Writable. + export class Duplex extends Readable implements Writable { + writable: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + constructor(opts?: DuplexOptions); + _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: string): this; + end(cb?: () => void): void; + end(chunk: any, cb?: () => void): void; + end(chunk: any, encoding?: string, cb?: () => void): void; + cork(): void; + uncork(): void; + } + + type TransformCallback = (error?: Error, data?: any) => void; + + export interface TransformOptions extends DuplexOptions { + read?(this: Transform, size: number): void; + write?(this: Transform, chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + writev?(this: Transform, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + final?(this: Transform, callback: (error?: Error | null) => void): void; + destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; + transform?(this: Transform, chunk: any, encoding: string, callback: TransformCallback): void; + flush?(this: Transform, callback: TransformCallback): void; + } + + export class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: string, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; + } + + export class PassThrough extends Transform { } + + export function pipeline(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.ReadWriteStream, stream5: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(streams: Array, callback?: (err: NodeJS.ErrnoException) => void): NodeJS.WritableStream; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, ...streams: Array void)>): NodeJS.WritableStream; + export namespace pipeline { + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: T): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: T): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.ReadWriteStream, stream5: T): Promise; + export function __promisify__(streams: Array): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, ...streams: Array): Promise; + } + } + + export = internal; +} + +declare module "util" { + export interface InspectOptions extends NodeJS.InspectOptions { } + export function format(format: any, ...param: any[]): string; + /** @deprecated since v0.11.3 - use `console.error()` instead. */ + export function debug(string: string): void; + /** @deprecated since v0.11.3 - use `console.error()` instead. */ + export function error(...param: any[]): void; + /** @deprecated since v0.11.3 - use `console.log()` instead. */ + export function puts(...param: any[]): void; + /** @deprecated since v0.11.3 - use `console.log()` instead. */ + export function print(...param: any[]): void; + /** @deprecated since v0.11.3 - use a third party module instead. */ + export function log(string: string): void; + export var inspect: { + (object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; + (object: any, options: InspectOptions): string; + colors: { + [color: string]: [number, number] | undefined + } + styles: { + [style: string]: string | undefined + } + defaultOptions: InspectOptions; + custom: symbol; + }; + /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */ + export function isArray(object: any): object is any[]; + /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */ + export function isRegExp(object: any): object is RegExp; + /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */ + export function isDate(object: any): object is Date; + /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */ + export function isError(object: any): object is Error; + export function inherits(constructor: any, superConstructor: any): void; + export function debuglog(key: string): (msg: string, ...param: any[]) => void; + /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */ + export function isBoolean(object: any): object is boolean; + /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */ + export function isBuffer(object: any): object is Buffer; + /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */ + export function isFunction(object: any): boolean; + /** @deprecated since v4.0.0 - use `value === null` instead. */ + export function isNull(object: any): object is null; + /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */ + export function isNullOrUndefined(object: any): object is null | undefined; + /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */ + export function isNumber(object: any): object is number; + /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */ + export function isObject(object: any): boolean; + /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */ + export function isPrimitive(object: any): boolean; + /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */ + export function isString(object: any): object is string; + /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */ + export function isSymbol(object: any): object is symbol; + /** @deprecated since v4.0.0 - use `value === undefined` instead. */ + export function isUndefined(object: any): object is undefined; + export function deprecate(fn: T, message: string): T; + export function isDeepStrictEqual(val1: any, val2: any): boolean; + + export interface CustomPromisify extends Function { + __promisify__: TCustom; + } + + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + + export function promisify(fn: CustomPromisify): TCustom; + export function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; + export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise; + export function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: Function): Function; + export namespace promisify { + const custom: symbol; + } + + export namespace types { + export function isAnyArrayBuffer(object: any): boolean; + export function isArgumentsObject(object: any): object is IArguments; + export function isArrayBuffer(object: any): object is ArrayBuffer; + export function isAsyncFunction(object: any): boolean; + export function isBooleanObject(object: any): object is Boolean; + export function isDataView(object: any): object is DataView; + export function isDate(object: any): object is Date; + export function isExternal(object: any): boolean; + export function isFloat32Array(object: any): object is Float32Array; + export function isFloat64Array(object: any): object is Float64Array; + export function isGeneratorFunction(object: any): boolean; + export function isGeneratorObject(object: any): boolean; + export function isInt8Array(object: any): object is Int8Array; + export function isInt16Array(object: any): object is Int16Array; + export function isInt32Array(object: any): object is Int32Array; + export function isMap(object: any): boolean; + export function isMapIterator(object: any): boolean; + export function isNativeError(object: any): object is Error; + export function isNumberObject(object: any): object is Number; + export function isPromise(object: any): boolean; + export function isProxy(object: any): boolean; + export function isRegExp(object: any): object is RegExp; + export function isSet(object: any): boolean; + export function isSetIterator(object: any): boolean; + export function isSharedArrayBuffer(object: any): boolean; + export function isStringObject(object: any): boolean; + export function isSymbolObject(object: any): boolean; + export function isTypedArray(object: any): object is NodeJS.TypedArray; + export function isUint8Array(object: any): object is Uint8Array; + export function isUint8ClampedArray(object: any): object is Uint8ClampedArray; + export function isUint16Array(object: any): object is Uint16Array; + export function isUint32Array(object: any): object is Uint32Array; + export function isWeakMap(object: any): boolean; + export function isWeakSet(object: any): boolean; + export function isWebAssemblyCompiledModule(object: any): boolean; + } + + export class TextDecoder { + readonly encoding: string; + readonly fatal: boolean; + readonly ignoreBOM: boolean; + constructor( + encoding?: string, + options?: { fatal?: boolean; ignoreBOM?: boolean } + ); + decode( + input?: NodeJS.TypedArray | DataView | ArrayBuffer | null, + options?: { stream?: boolean } + ): string; + } + + export class TextEncoder { + readonly encoding: string; + constructor(); + encode(input?: string): Uint8Array; + } +} + +declare module "assert" { + function internal(value: any, message?: string | Error): void; + namespace internal { + export class AssertionError implements Error { + name: string; + message: string; + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + code: 'ERR_ASSERTION'; + + constructor(options?: { + message?: string; actual?: any; expected?: any; + operator?: string; stackStartFn?: Function + }); + } + + export function fail(message?: string | Error): never; + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ + export function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never; + export function ok(value: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use strictEqual() instead. */ + export function equal(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use notStrictEqual() instead. */ + export function notEqual(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */ + export function deepEqual(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */ + export function notDeepEqual(actual: any, expected: any, message?: string | Error): void; + export function strictEqual(actual: any, expected: any, message?: string | Error): void; + export function notStrictEqual(actual: any, expected: any, message?: string | Error): void; + export function deepStrictEqual(actual: any, expected: any, message?: string | Error): void; + export function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void; + + export function throws(block: Function, message?: string | Error): void; + export function throws(block: Function, error: RegExp | Function | Object | Error, message?: string | Error): void; + export function doesNotThrow(block: Function, message?: string | Error): void; + export function doesNotThrow(block: Function, error: RegExp | Function, message?: string | Error): void; + + export function ifError(value: any): void; + + export function rejects(block: Function | Promise, message?: string | Error): Promise; + export function rejects(block: Function | Promise, error: RegExp | Function | Object | Error, message?: string | Error): Promise; + export function doesNotReject(block: Function | Promise, message?: string | Error): Promise; + export function doesNotReject(block: Function | Promise, error: RegExp | Function, message?: string | Error): Promise; + + export var strict: typeof internal; + } + + export = internal; +} + +declare module "tty" { + import * as net from "net"; + + export function isatty(fd: number): boolean; + export class ReadStream extends net.Socket { + isRaw: boolean; + setRawMode(mode: boolean): void; + isTTY: boolean; + } + export class WriteStream extends net.Socket { + columns: number; + rows: number; + isTTY: boolean; + } +} + +declare module "domain" { + import * as events from "events"; + + export class Domain extends events.EventEmitter implements NodeJS.Domain { + run(fn: Function): void; + add(emitter: events.EventEmitter): void; + remove(emitter: events.EventEmitter): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + members: any[]; + enter(): void; + exit(): void; + } + + export function create(): Domain; +} + +declare module "constants" { + export var E2BIG: number; + export var EACCES: number; + export var EADDRINUSE: number; + export var EADDRNOTAVAIL: number; + export var EAFNOSUPPORT: number; + export var EAGAIN: number; + export var EALREADY: number; + export var EBADF: number; + export var EBADMSG: number; + export var EBUSY: number; + export var ECANCELED: number; + export var ECHILD: number; + export var ECONNABORTED: number; + export var ECONNREFUSED: number; + export var ECONNRESET: number; + export var EDEADLK: number; + export var EDESTADDRREQ: number; + export var EDOM: number; + export var EEXIST: number; + export var EFAULT: number; + export var EFBIG: number; + export var EHOSTUNREACH: number; + export var EIDRM: number; + export var EILSEQ: number; + export var EINPROGRESS: number; + export var EINTR: number; + export var EINVAL: number; + export var EIO: number; + export var EISCONN: number; + export var EISDIR: number; + export var ELOOP: number; + export var EMFILE: number; + export var EMLINK: number; + export var EMSGSIZE: number; + export var ENAMETOOLONG: number; + export var ENETDOWN: number; + export var ENETRESET: number; + export var ENETUNREACH: number; + export var ENFILE: number; + export var ENOBUFS: number; + export var ENODATA: number; + export var ENODEV: number; + export var ENOENT: number; + export var ENOEXEC: number; + export var ENOLCK: number; + export var ENOLINK: number; + export var ENOMEM: number; + export var ENOMSG: number; + export var ENOPROTOOPT: number; + export var ENOSPC: number; + export var ENOSR: number; + export var ENOSTR: number; + export var ENOSYS: number; + export var ENOTCONN: number; + export var ENOTDIR: number; + export var ENOTEMPTY: number; + export var ENOTSOCK: number; + export var ENOTSUP: number; + export var ENOTTY: number; + export var ENXIO: number; + export var EOPNOTSUPP: number; + export var EOVERFLOW: number; + export var EPERM: number; + export var EPIPE: number; + export var EPROTO: number; + export var EPROTONOSUPPORT: number; + export var EPROTOTYPE: number; + export var ERANGE: number; + export var EROFS: number; + export var ESPIPE: number; + export var ESRCH: number; + export var ETIME: number; + export var ETIMEDOUT: number; + export var ETXTBSY: number; + export var EWOULDBLOCK: number; + export var EXDEV: number; + export var WSAEINTR: number; + export var WSAEBADF: number; + export var WSAEACCES: number; + export var WSAEFAULT: number; + export var WSAEINVAL: number; + export var WSAEMFILE: number; + export var WSAEWOULDBLOCK: number; + export var WSAEINPROGRESS: number; + export var WSAEALREADY: number; + export var WSAENOTSOCK: number; + export var WSAEDESTADDRREQ: number; + export var WSAEMSGSIZE: number; + export var WSAEPROTOTYPE: number; + export var WSAENOPROTOOPT: number; + export var WSAEPROTONOSUPPORT: number; + export var WSAESOCKTNOSUPPORT: number; + export var WSAEOPNOTSUPP: number; + export var WSAEPFNOSUPPORT: number; + export var WSAEAFNOSUPPORT: number; + export var WSAEADDRINUSE: number; + export var WSAEADDRNOTAVAIL: number; + export var WSAENETDOWN: number; + export var WSAENETUNREACH: number; + export var WSAENETRESET: number; + export var WSAECONNABORTED: number; + export var WSAECONNRESET: number; + export var WSAENOBUFS: number; + export var WSAEISCONN: number; + export var WSAENOTCONN: number; + export var WSAESHUTDOWN: number; + export var WSAETOOMANYREFS: number; + export var WSAETIMEDOUT: number; + export var WSAECONNREFUSED: number; + export var WSAELOOP: number; + export var WSAENAMETOOLONG: number; + export var WSAEHOSTDOWN: number; + export var WSAEHOSTUNREACH: number; + export var WSAENOTEMPTY: number; + export var WSAEPROCLIM: number; + export var WSAEUSERS: number; + export var WSAEDQUOT: number; + export var WSAESTALE: number; + export var WSAEREMOTE: number; + export var WSASYSNOTREADY: number; + export var WSAVERNOTSUPPORTED: number; + export var WSANOTINITIALISED: number; + export var WSAEDISCON: number; + export var WSAENOMORE: number; + export var WSAECANCELLED: number; + export var WSAEINVALIDPROCTABLE: number; + export var WSAEINVALIDPROVIDER: number; + export var WSAEPROVIDERFAILEDINIT: number; + export var WSASYSCALLFAILURE: number; + export var WSASERVICE_NOT_FOUND: number; + export var WSATYPE_NOT_FOUND: number; + export var WSA_E_NO_MORE: number; + export var WSA_E_CANCELLED: number; + export var WSAEREFUSED: number; + export var SIGHUP: number; + export var SIGINT: number; + export var SIGILL: number; + export var SIGABRT: number; + export var SIGFPE: number; + export var SIGKILL: number; + export var SIGSEGV: number; + export var SIGTERM: number; + export var SIGBREAK: number; + export var SIGWINCH: number; + export var SSL_OP_ALL: number; + export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + export var SSL_OP_CIPHER_SERVER_PREFERENCE: number; + export var SSL_OP_CISCO_ANYCONNECT: number; + export var SSL_OP_COOKIE_EXCHANGE: number; + export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + export var SSL_OP_EPHEMERAL_RSA: number; + export var SSL_OP_LEGACY_SERVER_CONNECT: number; + export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + export var SSL_OP_MICROSOFT_SESS_ID_BUG: number; + export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + export var SSL_OP_NETSCAPE_CA_DN_BUG: number; + export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NO_COMPRESSION: number; + export var SSL_OP_NO_QUERY_MTU: number; + export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + export var SSL_OP_NO_SSLv2: number; + export var SSL_OP_NO_SSLv3: number; + export var SSL_OP_NO_TICKET: number; + export var SSL_OP_NO_TLSv1: number; + export var SSL_OP_NO_TLSv1_1: number; + export var SSL_OP_NO_TLSv1_2: number; + export var SSL_OP_PKCS1_CHECK_1: number; + export var SSL_OP_PKCS1_CHECK_2: number; + export var SSL_OP_SINGLE_DH_USE: number; + export var SSL_OP_SINGLE_ECDH_USE: number; + export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + export var SSL_OP_TLS_BLOCK_PADDING_BUG: number; + export var SSL_OP_TLS_D5_BUG: number; + export var SSL_OP_TLS_ROLLBACK_BUG: number; + export var ENGINE_METHOD_DSA: number; + export var ENGINE_METHOD_DH: number; + export var ENGINE_METHOD_RAND: number; + export var ENGINE_METHOD_ECDH: number; + export var ENGINE_METHOD_ECDSA: number; + export var ENGINE_METHOD_CIPHERS: number; + export var ENGINE_METHOD_DIGESTS: number; + export var ENGINE_METHOD_STORE: number; + export var ENGINE_METHOD_PKEY_METHS: number; + export var ENGINE_METHOD_PKEY_ASN1_METHS: number; + export var ENGINE_METHOD_ALL: number; + export var ENGINE_METHOD_NONE: number; + export var DH_CHECK_P_NOT_SAFE_PRIME: number; + export var DH_CHECK_P_NOT_PRIME: number; + export var DH_UNABLE_TO_CHECK_GENERATOR: number; + export var DH_NOT_SUITABLE_GENERATOR: number; + export var NPN_ENABLED: number; + export var RSA_PKCS1_PADDING: number; + export var RSA_SSLV23_PADDING: number; + export var RSA_NO_PADDING: number; + export var RSA_PKCS1_OAEP_PADDING: number; + export var RSA_X931_PADDING: number; + export var RSA_PKCS1_PSS_PADDING: number; + export var POINT_CONVERSION_COMPRESSED: number; + export var POINT_CONVERSION_UNCOMPRESSED: number; + export var POINT_CONVERSION_HYBRID: number; + export var O_RDONLY: number; + export var O_WRONLY: number; + export var O_RDWR: number; + export var S_IFMT: number; + export var S_IFREG: number; + export var S_IFDIR: number; + export var S_IFCHR: number; + export var S_IFBLK: number; + export var S_IFIFO: number; + export var S_IFSOCK: number; + export var S_IRWXU: number; + export var S_IRUSR: number; + export var S_IWUSR: number; + export var S_IXUSR: number; + export var S_IRWXG: number; + export var S_IRGRP: number; + export var S_IWGRP: number; + export var S_IXGRP: number; + export var S_IRWXO: number; + export var S_IROTH: number; + export var S_IWOTH: number; + export var S_IXOTH: number; + export var S_IFLNK: number; + export var O_CREAT: number; + export var O_EXCL: number; + export var O_NOCTTY: number; + export var O_DIRECTORY: number; + export var O_NOATIME: number; + export var O_NOFOLLOW: number; + export var O_SYNC: number; + export var O_DSYNC: number; + export var O_SYMLINK: number; + export var O_DIRECT: number; + export var O_NONBLOCK: number; + export var O_TRUNC: number; + export var O_APPEND: number; + export var F_OK: number; + export var R_OK: number; + export var W_OK: number; + export var X_OK: number; + export var COPYFILE_EXCL: number; + export var COPYFILE_FICLONE: number; + export var COPYFILE_FICLONE_FORCE: number; + export var UV_UDP_REUSEADDR: number; + export var SIGQUIT: number; + export var SIGTRAP: number; + export var SIGIOT: number; + export var SIGBUS: number; + export var SIGUSR1: number; + export var SIGUSR2: number; + export var SIGPIPE: number; + export var SIGALRM: number; + export var SIGCHLD: number; + export var SIGSTKFLT: number; + export var SIGCONT: number; + export var SIGSTOP: number; + export var SIGTSTP: number; + export var SIGTTIN: number; + export var SIGTTOU: number; + export var SIGURG: number; + export var SIGXCPU: number; + export var SIGXFSZ: number; + export var SIGVTALRM: number; + export var SIGPROF: number; + export var SIGIO: number; + export var SIGPOLL: number; + export var SIGPWR: number; + export var SIGSYS: number; + export var SIGUNUSED: number; + export var defaultCoreCipherList: string; + export var defaultCipherList: string; + export var ENGINE_METHOD_RSA: number; + export var ALPN_ENABLED: number; +} + +declare module "module" { + export = NodeJS.Module; +} + +declare module "process" { + export = process; +} + +declare module "v8" { + interface HeapSpaceInfo { + space_name: string; + space_size: number; + space_used_size: number; + space_available_size: number; + physical_space_size: number; + } + + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ + type DoesZapCodeSpaceFlag = 0 | 1; + + interface HeapInfo { + total_heap_size: number; + total_heap_size_executable: number; + total_physical_size: number; + total_available_size: number; + used_heap_size: number; + heap_size_limit: number; + malloced_memory: number; + peak_malloced_memory: number; + does_zap_garbage: DoesZapCodeSpaceFlag; + } + + export function getHeapStatistics(): HeapInfo; + export function getHeapSpaceStatistics(): HeapSpaceInfo[]; + export function setFlagsFromString(flags: string): void; +} + +declare module "timers" { + export function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export namespace setTimeout { + export function __promisify__(ms: number): Promise; + export function __promisify__(ms: number, value: T): Promise; + } + export function clearTimeout(timeoutId: NodeJS.Timer): void; + export function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export function clearInterval(intervalId: NodeJS.Timer): void; + export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; + export namespace setImmediate { + export function __promisify__(): Promise; + export function __promisify__(value: T): Promise; + } + export function clearImmediate(immediateId: any): void; +} + +declare module "console" { + export = console; +} + +/** + * Async Hooks module: https://nodejs.org/api/async_hooks.html + */ +declare module "async_hooks" { + /** + * Returns the asyncId of the current execution context. + */ + export function executionAsyncId(): number; + + /** + * Returns the ID of the resource responsible for calling the callback that is currently being executed. + */ + export function triggerAsyncId(): number; + + export interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId a unique ID for the async resource + * @param type the type of the async resource + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created + * @param resource reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: Object): void; + + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + + /** + * Called immediately after the callback specified in before is completed. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + + export interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + + /** + * Registers functions to be called for different lifetime events of each async operation. + * @param options the callbacks to register + * @return an AsyncHooks instance used for disabling and enabling hooks + */ + export function createHook(options: HookCallbacks): AsyncHook; + + export interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * Default: `executionAsyncId()` + */ + triggerAsyncId?: number; + + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * Default: `false` + */ + requireManualDestroy?: boolean; + } + + /** + * The class AsyncResource was designed to be extended by the embedder's async resources. + * Using this users can easily trigger the lifetime events of their own resources. + */ + export class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since 9.3) + */ + constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions); + + /** + * Call AsyncHooks before callbacks. + * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead. + */ + emitBefore(): void; + + /** + * Call AsyncHooks after callbacks. + * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead. + */ + emitAfter(): void; + + /** + * Call the provided function with the provided arguments in the + * execution context of the async resource. This will establish the + * context, trigger the AsyncHooks before callbacks, call the function, + * trigger the AsyncHooks after callbacks, and then restore the original + * execution context. + * @param fn The function to call in the execution context of this + * async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; + + /** + * Call AsyncHooks destroy callbacks. + */ + emitDestroy(): void; + + /** + * @return the unique ID assigned to this AsyncResource instance. + */ + asyncId(): number; + + /** + * @return the trigger ID for this AsyncResource instance. + */ + triggerAsyncId(): number; + } +} + +declare module "http2" { + import * as events from "events"; + import * as fs from "fs"; + import * as net from "net"; + import * as stream from "stream"; + import * as tls from "tls"; + import * as url from "url"; + + import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders } from "http"; + export { OutgoingHttpHeaders } from "http"; + + export interface IncomingHttpStatusHeader { + ":status"?: number; + } + + export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { + ":path"?: string; + ":method"?: string; + ":authority"?: string; + ":scheme"?: string; + } + + // Http2Stream + + export interface StreamPriorityOptions { + exclusive?: boolean; + parent?: number; + weight?: number; + silent?: boolean; + } + + export interface StreamState { + localWindowSize?: number; + state?: number; + streamLocalClose?: number; + streamRemoteClose?: number; + sumDependencyWeight?: number; + weight?: number; + } + + export interface ServerStreamResponseOptions { + endStream?: boolean; + getTrailers?: (trailers: OutgoingHttpHeaders) => void; + } + + export interface StatOptions { + offset: number; + length: number; + } + + export interface ServerStreamFileResponseOptions { + statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void | boolean; + getTrailers?: (trailers: OutgoingHttpHeaders) => void; + offset?: number; + length?: number; + } + + export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?: (err: NodeJS.ErrnoException) => void; + } + + export interface Http2Stream extends stream.Duplex { + readonly aborted: boolean; + close(code?: number, callback?: () => void): void; + readonly closed: boolean; + readonly destroyed: boolean; + readonly pending: boolean; + priority(options: StreamPriorityOptions): void; + readonly rstCode: number; + readonly session: Http2Session; + setTimeout(msecs: number, callback?: () => void): void; + readonly state: StreamState; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "aborted", listener: () => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + addListener(event: "pipe", listener: (src: stream.Readable) => void): this; + addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + addListener(event: "streamClosed", listener: (code: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "aborted"): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "frameError", frameType: number, errorCode: number): boolean; + emit(event: "pipe", src: stream.Readable): boolean; + emit(event: "unpipe", src: stream.Readable): boolean; + emit(event: "streamClosed", code: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "aborted", listener: () => void): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + on(event: "pipe", listener: (src: stream.Readable) => void): this; + on(event: "unpipe", listener: (src: stream.Readable) => void): this; + on(event: "streamClosed", listener: (code: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "aborted", listener: () => void): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + once(event: "pipe", listener: (src: stream.Readable) => void): this; + once(event: "unpipe", listener: (src: stream.Readable) => void): this; + once(event: "streamClosed", listener: (code: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "aborted", listener: () => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "streamClosed", listener: (code: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "aborted", listener: () => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + } + + export interface ClientHttp2Stream extends Http2Stream { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + } + + export interface ServerHttp2Stream extends Http2Stream { + additionalHeaders(headers: OutgoingHttpHeaders): void; + readonly headersSent: boolean; + readonly pushAllowed: boolean; + pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; + respondWithFD(fd: number, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; + respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; + } + + // Http2Session + + export interface Settings { + headerTableSize?: number; + enablePush?: boolean; + initialWindowSize?: number; + maxFrameSize?: number; + maxConcurrentStreams?: number; + maxHeaderListSize?: number; + } + + export interface ClientSessionRequestOptions { + endStream?: boolean; + exclusive?: boolean; + parent?: number; + weight?: number; + getTrailers?: (trailers: OutgoingHttpHeaders, flags: number) => void; + } + + export interface SessionState { + effectiveLocalWindowSize?: number; + effectiveRecvDataLength?: number; + nextStreamID?: number; + localWindowSize?: number; + lastProcStreamID?: number; + remoteWindowSize?: number; + outboundQueueSize?: number; + deflateDynamicTableSize?: number; + inflateDynamicTableSize?: number; + } + + export interface Http2Session extends events.EventEmitter { + readonly alpnProtocol?: string; + close(callback?: () => void): void; + readonly closed: boolean; + readonly connecting: boolean; + destroy(error?: Error, code?: number): void; + readonly destroyed: boolean; + readonly encrypted?: boolean; + goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView | NodeJS.TypedArray): void; + readonly localSettings: Settings; + readonly originSet?: string[]; + readonly pendingSettingsAck: boolean; + ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ping(payload: Buffer | DataView | NodeJS.TypedArray , callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ref(): void; + readonly remoteSettings: Settings; + rstStream(stream: Http2Stream, code?: number): void; + setTimeout(msecs: number, callback?: () => void): void; + readonly socket: net.Socket | tls.TLSSocket; + readonly state: SessionState; + priority(stream: Http2Stream, options: StreamPriorityOptions): void; + settings(settings: Settings): void; + readonly type: number; + unref(): void; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + addListener(event: "localSettings", listener: (settings: Settings) => void): this; + addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; + emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; + emit(event: "localSettings", settings: Settings): boolean; + emit(event: "remoteSettings", settings: Settings): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + on(event: "localSettings", listener: (settings: Settings) => void): this; + on(event: "remoteSettings", listener: (settings: Settings) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + once(event: "localSettings", listener: (settings: Settings) => void): this; + once(event: "remoteSettings", listener: (settings: Settings) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export interface ClientHttp2Session extends Http2Session { + request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; + emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + } + + export interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + + export interface ServerHttp2Session extends Http2Session { + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + readonly server: Http2Server | Http2SecureServer; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + } + + // Http2Server + + export interface SessionOptions { + maxDeflateDynamicTableSize?: number; + maxReservedRemoteStreams?: number; + maxSendHeaderBlockLength?: number; + paddingStrategy?: number; + peerMaxConcurrentStreams?: number; + selectPadding?: (frameLen: number, maxFrameLen: number) => number; + settings?: Settings; + } + + export type ClientSessionOptions = SessionOptions; + export type ServerSessionOptions = SessionOptions; + + export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } + export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } + + export interface ServerOptions extends ServerSessionOptions { + allowHTTP1?: boolean; + } + + export interface SecureServerOptions extends SecureServerSessionOptions { + allowHTTP1?: boolean; + } + + export interface Http2Server extends net.Server { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export interface Http2SecureServer extends tls.Server { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + } + + export interface Http2ServerRequest extends stream.Readable { + headers: IncomingHttpHeaders; + httpVersion: string; + method: string; + rawHeaders: string[]; + rawTrailers: string[]; + setTimeout(msecs: number, callback?: () => void): void; + socket: net.Socket | tls.TLSSocket; + stream: ServerHttp2Stream; + trailers: IncomingHttpHeaders; + url: string; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "aborted", hadError: boolean, code: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + } + + export interface Http2ServerResponse extends events.EventEmitter { + addTrailers(trailers: OutgoingHttpHeaders): void; + connection: net.Socket | tls.TLSSocket; + end(callback?: () => void): void; + end(data?: string | Buffer, callback?: () => void): void; + end(data?: string | Buffer, encoding?: string, callback?: () => void): void; + readonly finished: boolean; + getHeader(name: string): string; + getHeaderNames(): string[]; + getHeaders(): OutgoingHttpHeaders; + hasHeader(name: string): boolean; + readonly headersSent: boolean; + removeHeader(name: string): void; + sendDate: boolean; + setHeader(name: string, value: number | string | string[]): void; + setTimeout(msecs: number, callback?: () => void): void; + socket: net.Socket | tls.TLSSocket; + statusCode: number; + statusMessage: ''; + stream: ServerHttp2Stream; + write(chunk: string | Buffer, callback?: (err: Error) => void): boolean; + write(chunk: string | Buffer, encoding?: string, callback?: (err: Error) => void): boolean; + writeContinue(): void; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void; + writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders): void; + createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "aborted", hadError: boolean, code: number): boolean; + emit(event: "close"): boolean; + emit(event: "drain"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "finish"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "finish", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "finish", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + } + + // Public API + + export namespace constants { + export const NGHTTP2_SESSION_SERVER: number; + export const NGHTTP2_SESSION_CLIENT: number; + export const NGHTTP2_STREAM_STATE_IDLE: number; + export const NGHTTP2_STREAM_STATE_OPEN: number; + export const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + export const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + export const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + export const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + export const NGHTTP2_STREAM_STATE_CLOSED: number; + export const NGHTTP2_NO_ERROR: number; + export const NGHTTP2_PROTOCOL_ERROR: number; + export const NGHTTP2_INTERNAL_ERROR: number; + export const NGHTTP2_FLOW_CONTROL_ERROR: number; + export const NGHTTP2_SETTINGS_TIMEOUT: number; + export const NGHTTP2_STREAM_CLOSED: number; + export const NGHTTP2_FRAME_SIZE_ERROR: number; + export const NGHTTP2_REFUSED_STREAM: number; + export const NGHTTP2_CANCEL: number; + export const NGHTTP2_COMPRESSION_ERROR: number; + export const NGHTTP2_CONNECT_ERROR: number; + export const NGHTTP2_ENHANCE_YOUR_CALM: number; + export const NGHTTP2_INADEQUATE_SECURITY: number; + export const NGHTTP2_HTTP_1_1_REQUIRED: number; + export const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + export const NGHTTP2_FLAG_NONE: number; + export const NGHTTP2_FLAG_END_STREAM: number; + export const NGHTTP2_FLAG_END_HEADERS: number; + export const NGHTTP2_FLAG_ACK: number; + export const NGHTTP2_FLAG_PADDED: number; + export const NGHTTP2_FLAG_PRIORITY: number; + export const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + export const DEFAULT_SETTINGS_ENABLE_PUSH: number; + export const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + export const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + export const MAX_MAX_FRAME_SIZE: number; + export const MIN_MAX_FRAME_SIZE: number; + export const MAX_INITIAL_WINDOW_SIZE: number; + export const NGHTTP2_DEFAULT_WEIGHT: number; + export const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + export const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + export const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + export const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + export const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + export const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + export const PADDING_STRATEGY_NONE: number; + export const PADDING_STRATEGY_MAX: number; + export const PADDING_STRATEGY_CALLBACK: number; + export const HTTP2_HEADER_STATUS: string; + export const HTTP2_HEADER_METHOD: string; + export const HTTP2_HEADER_AUTHORITY: string; + export const HTTP2_HEADER_SCHEME: string; + export const HTTP2_HEADER_PATH: string; + export const HTTP2_HEADER_ACCEPT_CHARSET: string; + export const HTTP2_HEADER_ACCEPT_ENCODING: string; + export const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + export const HTTP2_HEADER_ACCEPT_RANGES: string; + export const HTTP2_HEADER_ACCEPT: string; + export const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + export const HTTP2_HEADER_AGE: string; + export const HTTP2_HEADER_ALLOW: string; + export const HTTP2_HEADER_AUTHORIZATION: string; + export const HTTP2_HEADER_CACHE_CONTROL: string; + export const HTTP2_HEADER_CONNECTION: string; + export const HTTP2_HEADER_CONTENT_DISPOSITION: string; + export const HTTP2_HEADER_CONTENT_ENCODING: string; + export const HTTP2_HEADER_CONTENT_LANGUAGE: string; + export const HTTP2_HEADER_CONTENT_LENGTH: string; + export const HTTP2_HEADER_CONTENT_LOCATION: string; + export const HTTP2_HEADER_CONTENT_MD5: string; + export const HTTP2_HEADER_CONTENT_RANGE: string; + export const HTTP2_HEADER_CONTENT_TYPE: string; + export const HTTP2_HEADER_COOKIE: string; + export const HTTP2_HEADER_DATE: string; + export const HTTP2_HEADER_ETAG: string; + export const HTTP2_HEADER_EXPECT: string; + export const HTTP2_HEADER_EXPIRES: string; + export const HTTP2_HEADER_FROM: string; + export const HTTP2_HEADER_HOST: string; + export const HTTP2_HEADER_IF_MATCH: string; + export const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + export const HTTP2_HEADER_IF_NONE_MATCH: string; + export const HTTP2_HEADER_IF_RANGE: string; + export const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + export const HTTP2_HEADER_LAST_MODIFIED: string; + export const HTTP2_HEADER_LINK: string; + export const HTTP2_HEADER_LOCATION: string; + export const HTTP2_HEADER_MAX_FORWARDS: string; + export const HTTP2_HEADER_PREFER: string; + export const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + export const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + export const HTTP2_HEADER_RANGE: string; + export const HTTP2_HEADER_REFERER: string; + export const HTTP2_HEADER_REFRESH: string; + export const HTTP2_HEADER_RETRY_AFTER: string; + export const HTTP2_HEADER_SERVER: string; + export const HTTP2_HEADER_SET_COOKIE: string; + export const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + export const HTTP2_HEADER_TRANSFER_ENCODING: string; + export const HTTP2_HEADER_TE: string; + export const HTTP2_HEADER_UPGRADE: string; + export const HTTP2_HEADER_USER_AGENT: string; + export const HTTP2_HEADER_VARY: string; + export const HTTP2_HEADER_VIA: string; + export const HTTP2_HEADER_WWW_AUTHENTICATE: string; + export const HTTP2_HEADER_HTTP2_SETTINGS: string; + export const HTTP2_HEADER_KEEP_ALIVE: string; + export const HTTP2_HEADER_PROXY_CONNECTION: string; + export const HTTP2_METHOD_ACL: string; + export const HTTP2_METHOD_BASELINE_CONTROL: string; + export const HTTP2_METHOD_BIND: string; + export const HTTP2_METHOD_CHECKIN: string; + export const HTTP2_METHOD_CHECKOUT: string; + export const HTTP2_METHOD_CONNECT: string; + export const HTTP2_METHOD_COPY: string; + export const HTTP2_METHOD_DELETE: string; + export const HTTP2_METHOD_GET: string; + export const HTTP2_METHOD_HEAD: string; + export const HTTP2_METHOD_LABEL: string; + export const HTTP2_METHOD_LINK: string; + export const HTTP2_METHOD_LOCK: string; + export const HTTP2_METHOD_MERGE: string; + export const HTTP2_METHOD_MKACTIVITY: string; + export const HTTP2_METHOD_MKCALENDAR: string; + export const HTTP2_METHOD_MKCOL: string; + export const HTTP2_METHOD_MKREDIRECTREF: string; + export const HTTP2_METHOD_MKWORKSPACE: string; + export const HTTP2_METHOD_MOVE: string; + export const HTTP2_METHOD_OPTIONS: string; + export const HTTP2_METHOD_ORDERPATCH: string; + export const HTTP2_METHOD_PATCH: string; + export const HTTP2_METHOD_POST: string; + export const HTTP2_METHOD_PRI: string; + export const HTTP2_METHOD_PROPFIND: string; + export const HTTP2_METHOD_PROPPATCH: string; + export const HTTP2_METHOD_PUT: string; + export const HTTP2_METHOD_REBIND: string; + export const HTTP2_METHOD_REPORT: string; + export const HTTP2_METHOD_SEARCH: string; + export const HTTP2_METHOD_TRACE: string; + export const HTTP2_METHOD_UNBIND: string; + export const HTTP2_METHOD_UNCHECKOUT: string; + export const HTTP2_METHOD_UNLINK: string; + export const HTTP2_METHOD_UNLOCK: string; + export const HTTP2_METHOD_UPDATE: string; + export const HTTP2_METHOD_UPDATEREDIRECTREF: string; + export const HTTP2_METHOD_VERSION_CONTROL: string; + export const HTTP_STATUS_CONTINUE: number; + export const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + export const HTTP_STATUS_PROCESSING: number; + export const HTTP_STATUS_OK: number; + export const HTTP_STATUS_CREATED: number; + export const HTTP_STATUS_ACCEPTED: number; + export const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + export const HTTP_STATUS_NO_CONTENT: number; + export const HTTP_STATUS_RESET_CONTENT: number; + export const HTTP_STATUS_PARTIAL_CONTENT: number; + export const HTTP_STATUS_MULTI_STATUS: number; + export const HTTP_STATUS_ALREADY_REPORTED: number; + export const HTTP_STATUS_IM_USED: number; + export const HTTP_STATUS_MULTIPLE_CHOICES: number; + export const HTTP_STATUS_MOVED_PERMANENTLY: number; + export const HTTP_STATUS_FOUND: number; + export const HTTP_STATUS_SEE_OTHER: number; + export const HTTP_STATUS_NOT_MODIFIED: number; + export const HTTP_STATUS_USE_PROXY: number; + export const HTTP_STATUS_TEMPORARY_REDIRECT: number; + export const HTTP_STATUS_PERMANENT_REDIRECT: number; + export const HTTP_STATUS_BAD_REQUEST: number; + export const HTTP_STATUS_UNAUTHORIZED: number; + export const HTTP_STATUS_PAYMENT_REQUIRED: number; + export const HTTP_STATUS_FORBIDDEN: number; + export const HTTP_STATUS_NOT_FOUND: number; + export const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + export const HTTP_STATUS_NOT_ACCEPTABLE: number; + export const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + export const HTTP_STATUS_REQUEST_TIMEOUT: number; + export const HTTP_STATUS_CONFLICT: number; + export const HTTP_STATUS_GONE: number; + export const HTTP_STATUS_LENGTH_REQUIRED: number; + export const HTTP_STATUS_PRECONDITION_FAILED: number; + export const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + export const HTTP_STATUS_URI_TOO_LONG: number; + export const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + export const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + export const HTTP_STATUS_EXPECTATION_FAILED: number; + export const HTTP_STATUS_TEAPOT: number; + export const HTTP_STATUS_MISDIRECTED_REQUEST: number; + export const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + export const HTTP_STATUS_LOCKED: number; + export const HTTP_STATUS_FAILED_DEPENDENCY: number; + export const HTTP_STATUS_UNORDERED_COLLECTION: number; + export const HTTP_STATUS_UPGRADE_REQUIRED: number; + export const HTTP_STATUS_PRECONDITION_REQUIRED: number; + export const HTTP_STATUS_TOO_MANY_REQUESTS: number; + export const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + export const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + export const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + export const HTTP_STATUS_NOT_IMPLEMENTED: number; + export const HTTP_STATUS_BAD_GATEWAY: number; + export const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + export const HTTP_STATUS_GATEWAY_TIMEOUT: number; + export const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + export const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + export const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + export const HTTP_STATUS_LOOP_DETECTED: number; + export const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + export const HTTP_STATUS_NOT_EXTENDED: number; + export const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + + export function getDefaultSettings(): Settings; + export function getPackedSettings(settings: Settings): Settings; + export function getUnpackedSettings(buf: Buffer | Uint8Array): Settings; + + export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + + export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + + export function connect(authority: string | url.URL, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; + export function connect(authority: string | url.URL, options?: ClientSessionOptions | SecureClientSessionOptions, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; +} + +declare module "perf_hooks" { + import { AsyncResource } from "async_hooks"; + + export interface PerformanceEntry { + /** + * The total number of milliseconds elapsed for this entry. + * This value will not be meaningful for all Performance Entry types. + */ + readonly duration: number; + + /** + * The name of the performance entry. + */ + readonly name: string; + + /** + * The high resolution millisecond timestamp marking the starting time of the Performance Entry. + */ + readonly startTime: number; + + /** + * The type of the performance entry. + * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'. + */ + readonly entryType: string; + + /** + * When performanceEntry.entryType is equal to 'gc', the performance.kind property identifies + * the type of garbage collection operation that occurred. + * The value may be one of perf_hooks.constants. + */ + readonly kind?: number; + } + + export interface PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process completed bootstrap. + */ + readonly bootstrapComplete: number; + + /** + * The high resolution millisecond timestamp at which cluster processing ended. + */ + readonly clusterSetupEnd: number; + + /** + * The high resolution millisecond timestamp at which cluster processing started. + */ + readonly clusterSetupStart: number; + + /** + * The high resolution millisecond timestamp at which the Node.js event loop exited. + */ + readonly loopExit: number; + + /** + * The high resolution millisecond timestamp at which the Node.js event loop started. + */ + readonly loopStart: number; + + /** + * The high resolution millisecond timestamp at which main module load ended. + */ + readonly moduleLoadEnd: number; + + /** + * The high resolution millisecond timestamp at which main module load started. + */ + readonly moduleLoadStart: number; + + /** + * The high resolution millisecond timestamp at which the Node.js process was initialized. + */ + readonly nodeStart: number; + + /** + * The high resolution millisecond timestamp at which preload module load ended. + */ + readonly preloadModuleLoadEnd: number; + + /** + * The high resolution millisecond timestamp at which preload module load started. + */ + readonly preloadModuleLoadStart: number; + + /** + * The high resolution millisecond timestamp at which third_party_main processing ended. + */ + readonly thirdPartyMainEnd: number; + + /** + * The high resolution millisecond timestamp at which third_party_main processing started. + */ + readonly thirdPartyMainStart: number; + + /** + * The high resolution millisecond timestamp at which the V8 platform was initialized. + */ + readonly v8Start: number; + } + + export interface Performance { + /** + * If name is not provided, removes all PerformanceFunction objects from the Performance Timeline. + * If name is provided, removes entries with name. + * @param name + */ + clearFunctions(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. + * If name is provided, removes only objects whose performanceEntry.name matches name. + */ + clearMeasures(name?: string): void; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + * @return list of all PerformanceEntry objects + */ + getEntries(): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + * @param name + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByName(name: string, type?: string): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByType(type: string): PerformanceEntry[]; + + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + */ + mark(name?: string): void; + + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + */ + measure(name: string, startMark: string, endMark: string): void; + + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T): T; + } + + export interface PerformanceObserverEntryList { + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + */ + getEntries(): PerformanceEntry[]; + + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + */ + getEntriesByName(name: string, type?: string): PerformanceEntry[]; + + /** + * @return Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + */ + getEntriesByType(type: string): PerformanceEntry[]; + } + + export type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; + + export class PerformanceObserver extends AsyncResource { + constructor(callback: PerformanceObserverCallback); + + /** + * Disconnects the PerformanceObserver instance from all notifications. + */ + disconnect(): void; + + /** + * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes. + * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance. + * Property buffered defaults to false. + * @param options + */ + observe(options: { entryTypes: string[], buffered?: boolean }): void; + } + + export namespace constants { + export const NODE_PERFORMANCE_GC_MAJOR: number; + export const NODE_PERFORMANCE_GC_MINOR: number; + export const NODE_PERFORMANCE_GC_INCREMENTAL: number; + export const NODE_PERFORMANCE_GC_WEAKCB: number; + } + + const performance: Performance; +} diff --git a/node_modules/protobufjs/node_modules/@types/node/inspector.d.ts b/node_modules/protobufjs/node_modules/@types/node/inspector.d.ts new file mode 100644 index 0000000..955239b --- /dev/null +++ b/node_modules/protobufjs/node_modules/@types/node/inspector.d.ts @@ -0,0 +1,2488 @@ +// Type definitions for inspector + +// These definitions are auto-generated. +// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 +// for more information. + +/** + * The inspector module provides an API for interacting with the V8 inspector. + */ +declare module "inspector" { + import { EventEmitter } from 'events'; + + export interface InspectorNotification { + method: string; + params: T; + } + + export namespace Schema { + /** + * Description of the protocol domain. + */ + export interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + + export interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Schema.Domain[]; + } + } + + export namespace Runtime { + /** + * Unique script identifier. + */ + export type ScriptId = string; + + /** + * Unique object identifier. + */ + export type RemoteObjectId = string; + + /** + * Primitive value which cannot be JSON-stringified. + */ + export type UnserializableValue = string; + + /** + * Mirror object referencing original JavaScript object. + */ + export interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + /** + * Object class (constructor) name. Specified for object type values only. + */ + className?: string; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: Runtime.UnserializableValue; + /** + * String representation of the object. + */ + description?: string; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: Runtime.RemoteObjectId; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: Runtime.ObjectPreview; + /** + * @experimental + */ + customPreview?: Runtime.CustomPreview; + } + + /** + * @experimental + */ + export interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: Runtime.RemoteObjectId; + bindRemoteObjectFunctionId: Runtime.RemoteObjectId; + configObjectId?: Runtime.RemoteObjectId; + } + + /** + * Object containing abbreviated remote object value. + * @experimental + */ + export interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + /** + * String representation of the object. + */ + description?: string; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: Runtime.PropertyPreview[]; + /** + * List of the entries. Specified for map and set subtype values only. + */ + entries?: Runtime.EntryPreview[]; + } + + /** + * @experimental + */ + export interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string; + /** + * Nested value preview. + */ + valuePreview?: Runtime.ObjectPreview; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + } + + /** + * @experimental + */ + export interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: Runtime.ObjectPreview; + /** + * Preview of the value. + */ + value: Runtime.ObjectPreview; + } + + /** + * Object property descriptor. + */ + export interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: Runtime.RemoteObject; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean; + /** + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + */ + get?: Runtime.RemoteObject; + /** + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + */ + set?: Runtime.RemoteObject; + /** + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean; + /** + * Property symbol object, if the property is of the symbol type. + */ + symbol?: Runtime.RemoteObject; + } + + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + export interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: Runtime.RemoteObject; + } + + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + export interface CallArgument { + /** + * Primitive value. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: Runtime.UnserializableValue; + /** + * Remote object handle. + */ + objectId?: Runtime.RemoteObjectId; + } + + /** + * Id of an execution context. + */ + export type ExecutionContextId = number; + + /** + * Description of an isolated world. + */ + export interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + */ + id: Runtime.ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {}; + } + + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + export interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: Runtime.ScriptId; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string; + /** + * JavaScript stack trace if available. + */ + stackTrace?: Runtime.StackTrace; + /** + * Exception object if available. + */ + exception?: Runtime.RemoteObject; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: Runtime.ExecutionContextId; + } + + /** + * Number of milliseconds since epoch. + */ + export type Timestamp = number; + + /** + * Stack entry for runtime errors and assertions. + */ + export interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + + /** + * Call frames for assertions or error messages. + */ + export interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + */ + description?: string; + /** + * JavaScript function name. + */ + callFrames: Runtime.CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: Runtime.StackTrace; + /** + * Creation frame of the Promise which produced the next synchronous trace when resolved, if available. + * @experimental + */ + promiseCreationFrame?: Runtime.CallFrame; + } + + export interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + contextId?: Runtime.ExecutionContextId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + * @experimental + */ + userGesture?: boolean; + /** + * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + */ + awaitPromise?: boolean; + } + + export interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: Runtime.RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + } + + export interface CallFunctionOnParameterType { + /** + * Identifier of the object to call function on. + */ + objectId: Runtime.RemoteObjectId; + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + */ + arguments?: Runtime.CallArgument[]; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + * @experimental + */ + userGesture?: boolean; + /** + * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + */ + awaitPromise?: boolean; + } + + export interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: Runtime.RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype chain. + */ + ownProperties?: boolean; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean; + } + + export interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + + export interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + + export interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: Runtime.ExecutionContextId; + } + + export interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: Runtime.ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: Runtime.ExecutionContextId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + /** + * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + */ + awaitPromise?: boolean; + } + + export interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: Runtime.RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: Runtime.PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: Runtime.InternalPropertyDescriptor[]; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: Runtime.ScriptId; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface RunScriptReturnType { + /** + * Run result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: Runtime.ExecutionContextDescription; + } + + export interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: Runtime.ExecutionContextId; + } + + export interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Runtime.Timestamp; + exceptionDetails: Runtime.ExceptionDetails; + } + + export interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in exceptionUnhandled. + */ + exceptionId: number; + } + + export interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: Runtime.RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Runtime.Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: Runtime.StackTrace; + /** + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * @experimental + */ + context?: string; + } + + export interface InspectRequestedEventDataType { + object: Runtime.RemoteObject; + hints: {}; + } + } + + export namespace Debugger { + /** + * Breakpoint identifier. + */ + export type BreakpointId = string; + + /** + * Call frame identifier. + */ + export type CallFrameId = string; + + /** + * Location in the source code. + */ + export interface Location { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + } + + /** + * Location in the source code. + * @experimental + */ + export interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + export interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: Debugger.CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + * @experimental + */ + functionLocation?: Debugger.Location; + /** + * Location in the source code. + */ + location: Debugger.Location; + /** + * Scope chain for this call frame. + */ + scopeChain: Debugger.Scope[]; + /** + * this object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject; + } + + /** + * Scope description. + */ + export interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string; + /** + * Location in the source code where scope starts + */ + startLocation?: Debugger.Location; + /** + * Location in the source code where scope ends + */ + endLocation?: Debugger.Location; + } + + /** + * Search match for resource. + * @experimental + */ + export interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + + /** + * @experimental + */ + export interface BreakLocation { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + type?: string; + } + + export interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + + export interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + + export interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + */ + urlRegex?: string; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Debugger.Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface RemoveBreakpointParameterType { + breakpointId: Debugger.BreakpointId; + } + + export interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Debugger.Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + */ + end?: Debugger.Location; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean; + } + + export interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Debugger.Location; + /** + * @experimental + */ + targetCallFrames?: string; + } + + export interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean; + } + + export interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. + */ + dryRun?: boolean; + } + + export interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + + export interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + + export interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). + */ + objectGroup?: string; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults to false. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + * @experimental + */ + throwOnSideEffect?: boolean; + } + + export interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). + */ + maxDepth: number; + } + + export interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + + export interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: Debugger.ScriptPosition[]; + } + + export interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Debugger.Location[]; + } + + export interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Debugger.Location; + } + + export interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: Debugger.BreakLocation[]; + } + + export interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: Debugger.SearchMatch[]; + } + + export interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: Debugger.CallFrame[]; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: Debugger.CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + } + + export interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + + export interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + * @experimental + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + * @experimental + */ + isModule?: boolean; + /** + * This script length. + * @experimental + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + export interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + * @experimental + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + * @experimental + */ + isModule?: boolean; + /** + * This script length. + * @experimental + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + export interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: Debugger.BreakpointId; + /** + * Actual breakpoint location. + */ + location: Debugger.Location; + } + + export interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: Debugger.CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {}; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + } + } + + export namespace Console { + /** + * Console message. + */ + export interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number; + } + + export interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: Console.ConsoleMessage; + } + } + + export namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + export interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + * @experimental + */ + hitCount?: number; + /** + * Child node ids. + */ + children?: number[]; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. + */ + deoptReason?: string; + /** + * An array of source position ticks. + * @experimental + */ + positionTicks?: Profiler.PositionTickInfo[]; + } + + /** + * Profile. + */ + export interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: Profiler.ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[]; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. + */ + timeDeltas?: number[]; + } + + /** + * Specifies a number of samples attributed to a certain source position. + * @experimental + */ + export interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + + /** + * Coverage data for a source range. + * @experimental + */ + export interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + + /** + * Coverage data for a JavaScript function. + * @experimental + */ + export interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: Profiler.CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + + /** + * Coverage data for a JavaScript script. + * @experimental + */ + export interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: Profiler.FunctionCoverage[]; + } + + export interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + + export interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean; + } + + export interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profiler.Profile; + } + + export interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + + export interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profiler.Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + } + + export namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + export type HeapSnapshotObjectId = string; + + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + export interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: HeapProfiler.SamplingHeapProfileNode[]; + } + + /** + * Profile. + */ + export interface SamplingHeapProfile { + head: HeapProfiler.SamplingHeapProfileNode; + } + + export interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean; + } + + export interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. + */ + reportProgress?: boolean; + } + + export interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean; + } + + export interface GetObjectByHeapObjectIdParameterType { + objectId: HeapProfiler.HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + } + + export interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. + */ + samplingInterval?: number; + } + + export interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + + export interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: HeapProfiler.SamplingHeapProfile; + } + + export interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + + export interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean; + } + + export interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + + export interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + } + + /** + * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications. + */ + export class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. + */ + constructor(); + + /** + * Connects a session to the inspector back-end. An exception will be thrown if there is already a connected session established either through the API or by a front-end connected to the Inspector WebSocket port. + */ + connect(): void; + + /** + * Immediately close the session. All pending message callbacks will be called with an error. session.connect() will need to be called to be able to send messages again. Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + + /** + * Posts a message to the inspector back-end. callback will be notified when a response is received. callback is a function that accepts two optional arguments - error and message-specific result. + */ + post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; + post(method: string, callback?: (err: Error | null, params?: {}) => void): void; + + /** + * Returns supported domains. + */ + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + /** + * Evaluates expression on global object. + */ + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + + /** + * Add handler to promise with given promise object id. + */ + post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + + /** + * Releases remote object with given id. + */ + post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; + + /** + * Releases all remote objects that belong to a given group. + */ + post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void; + + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; + + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables reporting of execution contexts creation. + */ + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; + + /** + * Discards collected exceptions and console API calls. + */ + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; + + /** + * Compiles expression. + */ + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + + /** + * Runs script with given id in a given context. + */ + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: "Debugger.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables debugger for given page. + */ + post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; + + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; + + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; + + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + + /** + * Removes JavaScript breakpoint. + */ + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; + + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + * @experimental + */ + post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType, callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + + /** + * Continues execution until specific location is reached. + */ + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; + + /** + * Steps over the statement. + */ + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; + + /** + * Steps into the function call. + */ + post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; + + /** + * Steps out of the function call. + */ + post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; + + /** + * Stops on the next JavaScript statement. + */ + post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; + + /** + * Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; + + /** + * Resumes JavaScript execution. + */ + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; + + /** + * Searches for given string in script content. + * @experimental + */ + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + + /** + * Edits JavaScript source live. + */ + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + + /** + * Restarts particular call frame from the beginning. + */ + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + + /** + * Returns source for the script with given id. + */ + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; + + /** + * Evaluates expression on a given call frame. + */ + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; + + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; + + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: "Console.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: "Console.disable", callback?: (err: Error | null) => void): void; + + /** + * Does nothing. + */ + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; + + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + * @experimental + */ + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + * @experimental + */ + post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + * @experimental + */ + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + * @experimental + */ + post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + + // Events + + addListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; + emit(event: "Debugger.paused", message: InspectorNotification): boolean; + emit(event: "Debugger.resumed"): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.resetProfiles"): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + on(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + once(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + } + + // Top Level API + + /** + * Activate inspector on host and port. Equivalent to node --inspect=[[host:]port], but can be done programatically after node has started. + * If wait is true, will block until a client has connected to the inspect port and flow control has been passed to the debugger client. + * @param port Port to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param host Host to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param wait Block until a client has connected. Optional, defaults to false. + */ + export function open(port?: number, host?: string, wait?: boolean): void; + + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + export function close(): void; + + /** + * Return the URL of the active inspector, or undefined if there is none. + */ + export function url(): string; +} diff --git a/node_modules/protobufjs/node_modules/@types/node/package.json b/node_modules/protobufjs/node_modules/@types/node/package.json new file mode 100644 index 0000000..5a55dcd --- /dev/null +++ b/node_modules/protobufjs/node_modules/@types/node/package.json @@ -0,0 +1,155 @@ +{ + "_from": "@types/node@^10.1.0", + "_id": "@types/node@10.5.7", + "_inBundle": false, + "_integrity": "sha512-VkKcfuitP+Nc/TaTFH0B8qNmn+6NbI6crLkQonbedViVz7O2w8QV/GERPlkJ4bg42VGHiEWa31CoTOPs1q6z1w==", + "_location": "/protobufjs/@types/node", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@types/node@^10.1.0", + "name": "@types/node", + "escapedName": "@types%2fnode", + "scope": "@types", + "rawSpec": "^10.1.0", + "saveSpec": null, + "fetchSpec": "^10.1.0" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.7.tgz", + "_shasum": "960d9feb3ade2233bcc9843c918d740b4f78a7cf", + "_spec": "@types/node@^10.1.0", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\protobufjs", + "bugs": { + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Microsoft TypeScript", + "url": "http://typescriptlang.org" + }, + { + "name": "DefinitelyTyped", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped" + }, + { + "name": "Parambir Singh", + "url": "https://github.com/parambirs" + }, + { + "name": "Christian Vaagland Tellnes", + "url": "https://github.com/tellnes" + }, + { + "name": "Wilco Bakker", + "url": "https://github.com/WilcoBakker" + }, + { + "name": "Nicolas Voigt", + "url": "https://github.com/octo-sniffle" + }, + { + "name": "Chigozirim C.", + "url": "https://github.com/smac89" + }, + { + "name": "Flarna", + "url": "https://github.com/Flarna" + }, + { + "name": "Mariusz Wiktorczyk", + "url": "https://github.com/mwiktorczyk" + }, + { + "name": "wwwy3y3", + "url": "https://github.com/wwwy3y3" + }, + { + "name": "Deividas Bakanas", + "url": "https://github.com/DeividasBakanas" + }, + { + "name": "Kelvin Jin", + "url": "https://github.com/kjin" + }, + { + "name": "Alvis HT Tang", + "url": "https://github.com/alvis" + }, + { + "name": "Sebastian Silbermann", + "url": "https://github.com/eps1lon" + }, + { + "name": "Hannes Magnusson", + "url": "https://github.com/Hannes-Magnusson-CK" + }, + { + "name": "Alberto Schiabel", + "url": "https://github.com/jkomyno" + }, + { + "name": "Klaus Meinhardt", + "url": "https://github.com/ajafff" + }, + { + "name": "Huw", + "url": "https://github.com/hoo29" + }, + { + "name": "Nicolas Even", + "url": "https://github.com/n-e" + }, + { + "name": "Bruno Scheufler", + "url": "https://github.com/brunoscheufler" + }, + { + "name": "Mohsen Azimi", + "url": "https://github.com/mohsen1" + }, + { + "name": "Hoàng Văn Khải", + "url": "https://github.com/KSXGitHub" + }, + { + "name": "Alexander T.", + "url": "https://github.com/a-tarasyuk" + }, + { + "name": "Lishude", + "url": "https://github.com/islishude" + }, + { + "name": "Andrew Makarov", + "url": "https://github.com/r3nya" + }, + { + "name": "Zane Hannan AU", + "url": "https://github.com/ZaneHannanAU" + }, + { + "name": "Eugene Y. Q. Shen", + "url": "https://github.com/eyqs" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "TypeScript definitions for Node.js", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", + "license": "MIT", + "main": "", + "name": "@types/node", + "repository": { + "type": "git", + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "typeScriptVersion": "2.0", + "typesPublisherContentHash": "ff6a9da38f7afe6c2a421ae121c99dabed96f1aca57674b6f7bf87b20f8dc62b", + "version": "10.5.7" +} diff --git a/node_modules/protobufjs/package-lock.json b/node_modules/protobufjs/package-lock.json new file mode 100644 index 0000000..c685e3e --- /dev/null +++ b/node_modules/protobufjs/package-lock.json @@ -0,0 +1,7307 @@ +{ + "name": "protobufjs", + "version": "6.8.7", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@gulp-sourcemaps/identity-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-1.0.1.tgz", + "integrity": "sha1-z6I7xYQPkQTOMqZedNt+epdLvuE=", + "dev": true, + "requires": { + "acorn": "^5.0.3", + "css": "^2.2.1", + "normalize-path": "^2.1.1", + "source-map": "^0.5.6", + "through2": "^2.0.3" + }, + "dependencies": { + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "dev": true + } + } + }, + "@gulp-sourcemaps/map-sources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", + "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", + "dev": true, + "requires": { + "normalize-path": "^2.0.1", + "through2": "^2.0.3" + } + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + }, + "@types/node": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.1.0.tgz", + "integrity": "sha512-sELcX/cJHwRp8kn4hYSvBxKGJ+ubl3MvS8VJQe5gz/sp7CifYxsiCxIJ35wMIYyGVMgfO2AzRa8UcVReAcJRlw==" + }, + "JSONStream": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", + "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "^3.0.4" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "acorn-node": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.3.0.tgz", + "integrity": "sha512-efP54n3d1aLfjL2UMdaXa6DsswwzJeI5rqhbFvXMrKiJ6eJFpf+7R0zN7t8IC+XKn2YOAFAv6xbBNgHUkoHWLw==", + "dev": true, + "requires": { + "acorn": "^5.4.1", + "xtend": "^4.0.1" + }, + "dependencies": { + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "dev": true, + "requires": { + "ansi-wrap": "^0.1.0" + } + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "dev": true, + "requires": { + "buffer-equal": "^1.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-filter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", + "dev": true, + "requires": { + "make-iterator": "^1.0.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", + "dev": true, + "requires": { + "make-iterator": "^1.0.0" + } + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-initial": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", + "dev": true, + "requires": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "array-last": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "dev": true, + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true + }, + "array-sort": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", + "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", + "dev": true, + "requires": { + "default-compare": "^1.0.0", + "get-value": "^2.0.6", + "kind-of": "^5.0.2" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + } + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "astw": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", + "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", + "dev": true, + "requires": { + "acorn": "^4.0.3" + } + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "async-done": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.1.tgz", + "integrity": "sha512-R1BaUeJ4PMoLNJuk+0tLJgjmEqVsdN118+Z8O+alhnQDQgy0kmD5Mqi0DNEmMx2LM0Ed5yekKu+ZXYvIHceicg==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^1.0.7", + "stream-exhaust": "^1.0.1" + }, + "dependencies": { + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + } + } + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "async-settle": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", + "dev": true, + "requires": { + "async-done": "^1.2.2" + } + }, + "atob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babylon": { + "version": "7.0.0-beta.19", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", + "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", + "dev": true + }, + "bach": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", + "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", + "dev": true, + "requires": { + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "base64url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", + "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=", + "dev": true + }, + "benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "requires": { + "lodash": "^4.17.4", + "platform": "^1.3.3" + } + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "bl": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "dev": true, + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", + "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" + } + }, + "browser-resolve": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "browser-unpack": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browser-unpack/-/browser-unpack-1.2.0.tgz", + "integrity": "sha1-NXruMfxGeDFoTQY+Q1XgcKeClw0=", + "dev": true, + "requires": { + "acorn": "^4.0.3", + "browser-pack": "^5.0.1", + "concat-stream": "^1.5.0", + "minimist": "^1.1.1" + }, + "dependencies": { + "browser-pack": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-5.0.1.tgz", + "integrity": "sha1-QZdxmyDG4KqglFHFER5T77b7wY0=", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "combine-source-map": "~0.6.1", + "defined": "^1.0.0", + "through2": "^1.0.0", + "umd": "^3.0.0" + } + }, + "combine-source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.6.1.tgz", + "integrity": "sha1-m0oJwxYDPXaODxHgKfonMOB5rZY=", + "dev": true, + "requires": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.5.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.4.2" + } + }, + "inline-source-map": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.5.0.tgz", + "integrity": "sha1-Skxd2OT7Xps82mDIIt+tyu5m4K8=", + "dev": true, + "requires": { + "source-map": "~0.4.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "through2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-1.1.1.tgz", + "integrity": "sha1-CEfLxESfNAVXTb3M2buEG4OsNUU=", + "dev": true, + "requires": { + "readable-stream": ">=1.1.13-1 <1.2.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + } + } + } + }, + "browserify": { + "version": "16.2.2", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.2.tgz", + "integrity": "sha512-fMES05wq1Oukts6ksGUU2TMVHHp06LyQt0SIwbXIHm7waSrQmNBZePsU0iM/4f94zbvb/wHma+D1YrdzWYnF/A==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^2.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "0.0.1", + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" + }, + "dependencies": { + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + } + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.1.tgz", + "integrity": "sha512-zy0Cobe3hhgpiOM32Tj7KQ3Vl91m0njwsjzZQK1L+JDf11dzP9qIvjreVinsvXrgfjhStXwUWAEpB9D7Gwmayw==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-wrap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-wrap/-/browserify-wrap-1.0.2.tgz", + "integrity": "sha1-DvJ3xnxplAkVnt8hraPchQF/lqo=", + "dev": true + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.1.0.tgz", + "integrity": "sha512-YkIRgwsZwJWTnyQrsBTWefizHh+8GYj3kbL1BTiAQ/9pwpino0G7B2gp5tx/FUBqUlvtxV85KNR3mwfAtv15Yw==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "dev": true + }, + "buffer-from": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", + "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "bundle-collapser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bundle-collapser/-/bundle-collapser-1.3.0.tgz", + "integrity": "sha1-9LT/WLLyLudwGyD6djBuI/U6P7Y=", + "dev": true, + "requires": { + "browser-pack": "^5.0.1", + "browser-unpack": "^1.1.0", + "concat-stream": "^1.5.0", + "falafel": "^2.1.0", + "minimist": "^1.1.1", + "through2": "^2.0.0" + }, + "dependencies": { + "browser-pack": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-5.0.1.tgz", + "integrity": "sha1-QZdxmyDG4KqglFHFER5T77b7wY0=", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "combine-source-map": "~0.6.1", + "defined": "^1.0.0", + "through2": "^1.0.0", + "umd": "^3.0.0" + }, + "dependencies": { + "through2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-1.1.1.tgz", + "integrity": "sha1-CEfLxESfNAVXTb3M2buEG4OsNUU=", + "dev": true, + "requires": { + "readable-stream": ">=1.1.13-1 <1.2.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + } + } + } + }, + "combine-source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.6.1.tgz", + "integrity": "sha1-m0oJwxYDPXaODxHgKfonMOB5rZY=", + "dev": true, + "requires": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.5.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.4.2" + } + }, + "inline-source-map": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.5.0.tgz", + "integrity": "sha1-Skxd2OT7Xps82mDIIt+tyu5m4K8=", + "dev": true, + "requires": { + "source-map": "~0.4.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "cached-path-relative": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "catharsis": { + "version": "0.8.9", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", + "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", + "dev": true, + "requires": { + "underscore-contrib": "~0.3.0" + } + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "chokidar": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz", + "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.0", + "braces": "^2.3.0", + "fsevents": "^1.1.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^2.1.1", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0", + "upath": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + } + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + } + } + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", + "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", + "dev": true, + "requires": { + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "^1.1.1" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, + "combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "dev": true, + "requires": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" + } + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" + }, + "dependencies": { + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "concat-with-sourcemaps": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", + "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "copy-props": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", + "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", + "dev": true, + "requires": { + "each-props": "^1.3.0", + "is-plain-object": "^2.0.1" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "css": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.3.tgz", + "integrity": "sha512-0W171WccAjQGGTKLhw4m2nnl0zPHUlTO/I8td4XzJgIB8Hg3ZZx71qT4G4eX8OVsSiaAKiUMy73E3nsbPlg2DQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "source-map": "^0.1.38", + "source-map-resolve": "^0.5.1", + "urix": "^0.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "^0.10.9" + } + }, + "dargs": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", + "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-fabulous": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz", + "integrity": "sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg==", + "dev": true, + "requires": { + "debug": "3.X", + "memoizee": "0.4.X", + "object-assign": "4.X" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "default-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", + "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", + "dev": true, + "requires": { + "kind-of": "^5.0.2" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "default-resolution": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "^2.0.5", + "object-keys": "^1.0.8" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + } + }, + "deps-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "shasum": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, + "detective": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.1.0.tgz", + "integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==", + "dev": true, + "requires": { + "acorn-node": "^1.3.0", + "defined": "^1.0.0", + "minimist": "^1.1.1" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "duplexify": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", + "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + }, + "dependencies": { + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + } + } + }, + "each-props": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", + "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.1", + "object.defaults": "^1.1.0" + } + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz", + "integrity": "sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" + } + }, + "es5-ext": { + "version": "0.10.42", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.42.tgz", + "integrity": "sha512-AJxO1rmPe1bDEfSR6TJ/FgMFYuTBhR5R57KW58iCkYACMyFbrkqVyzXSurYoScDGvgyMpk7uRF/lPUPPTmsRSA==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "1" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.14", + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", + "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "eslint": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "dev": true, + "requires": { + "ajv": "^5.3.0", + "babel-code-frame": "^6.22.0", + "chalk": "^2.1.0", + "concat-stream": "^1.6.0", + "cross-spawn": "^5.1.0", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^3.7.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^3.5.4", + "esquery": "^1.0.0", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.0.1", + "ignore": "^3.3.3", + "imurmurhash": "^0.1.4", + "inquirer": "^3.0.6", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.9.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.4", + "minimatch": "^3.0.2", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^1.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.3.0", + "strip-ansi": "^4.0.0", + "strip-json-comments": "~2.0.1", + "table": "4.0.2", + "text-table": "~0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "dev": true + } + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "events": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-2.0.0.tgz", + "integrity": "sha512-r/M5YkNg9zwI8QbSf7tsDWWJvO3PGwZXyG7GpFAxtMASnHL2eblFd7iHiGPtyGKKFPZ59S63NeX10Ws6WqGDcg==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "falafel": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz", + "integrity": "sha1-lrsXdh2rqU9G0AFzizzt86Z/4Gw=", + "dev": true, + "requires": { + "acorn": "^5.0.0", + "foreach": "^2.0.5", + "isarray": "0.0.1", + "object-keys": "^1.0.6" + }, + "dependencies": { + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "fancy-log": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz", + "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", + "dev": true, + "requires": { + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "time-stamp": "^1.0.0" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + }, + "fined": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", + "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + } + }, + "flagged-respawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.0.tgz", + "integrity": "sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c=", + "dev": true + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" + } + }, + "flush-write-stream": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", + "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.4" + } + }, + "for-each": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", + "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", + "dev": true, + "requires": { + "is-function": "~1.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "fork-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/fork-stream/-/fork-stream-0.0.4.tgz", + "integrity": "sha1-24Sfznf2cIpfjzhq5TOgkHtUrnA=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "gh-pages": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-1.1.0.tgz", + "integrity": "sha512-ZpDkeOVmIrN5mz+sBWDz5zmTqcbNJzI/updCwEv/7rrSdpTNlj1B5GhBqG7f4Q8p5sJOdnBV0SIqxJrxtZQ9FA==", + "dev": true, + "requires": { + "async": "2.6.0", + "base64url": "^2.0.0", + "commander": "2.11.0", + "fs-extra": "^4.0.2", + "globby": "^6.1.0", + "graceful-fs": "4.1.11", + "rimraf": "^2.6.2" + }, + "dependencies": { + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "dev": true, + "requires": { + "lodash": "^4.14.0" + } + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + } + } + }, + "git-raw-commits": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.6.tgz", + "integrity": "sha512-svsK26tQ8vEKnMshTDatSIQSMDdz8CxIIqKsvPqbtV23Etmw6VNaFAitu8zwZ0VrOne7FztwPyRLxK7/DIUTQg==", + "dev": true, + "requires": { + "dargs": "^4.0.1", + "lodash.template": "^4.0.2", + "meow": "^4.0.0", + "split2": "^2.0.0", + "through2": "^2.0.0" + } + }, + "git-semver-tags": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-1.3.6.tgz", + "integrity": "sha512-2jHlJnln4D/ECk9FxGEBh3k44wgYdWjWDtMmJPaecjoRmxKo3Y1Lh8GMYuOPu04CHw86NTAODchYjC5pnpMQig==", + "dev": true, + "requires": { + "meow": "^4.0.0", + "semver": "^5.5.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "dependencies": { + "to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + } + } + } + }, + "glob-watcher": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.1.tgz", + "integrity": "sha512-fK92r2COMC199WCyGUblrZKhjra3cyVMDiypDdqg1vsSDmexnbYivK1kNR4QItiNXLKmGlqan469ks67RtNa2g==", + "dev": true, + "requires": { + "async-done": "^1.2.0", + "chokidar": "^2.0.0", + "just-debounce": "^1.0.0", + "object.defaults": "^1.1.0" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "globals": { + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "glogg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz", + "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", + "dev": true, + "requires": { + "sparkles": "^1.0.0" + } + }, + "google-protobuf": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.5.0.tgz", + "integrity": "sha1-uMxjx02DRXvYqakEUDyO+ya8ozk=", + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "gulp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.0.tgz", + "integrity": "sha1-lXZsYB2t5Kd+0+eyttwDiBtZY2Y=", + "dev": true, + "requires": { + "glob-watcher": "^5.0.0", + "gulp-cli": "^2.0.0", + "undertaker": "^1.0.0", + "vinyl-fs": "^3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "gulp-cli": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.0.1.tgz", + "integrity": "sha512-RxujJJdN8/O6IW2nPugl7YazhmrIEjmiVfPKrWt68r71UCaLKS71Hp0gpKT+F6qOUFtr7KqtifDKaAJPRVvMYQ==", + "dev": true, + "requires": { + "ansi-colors": "^1.0.1", + "archy": "^1.0.0", + "array-sort": "^1.0.0", + "color-support": "^1.1.3", + "concat-stream": "^1.6.0", + "copy-props": "^2.0.1", + "fancy-log": "^1.3.2", + "gulplog": "^1.0.0", + "interpret": "^1.1.0", + "isobject": "^3.0.1", + "liftoff": "^2.5.0", + "matchdep": "^2.0.0", + "mute-stdout": "^1.0.0", + "pretty-hrtime": "^1.0.0", + "replace-homedir": "^1.0.0", + "semver-greatest-satisfied-range": "^1.1.0", + "v8flags": "^3.0.1", + "yargs": "^7.1.0" + } + }, + "is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "requires": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + } + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + } + } + }, + "gulp-header": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-2.0.5.tgz", + "integrity": "sha512-7bOIiHvM1GUHIG3LRH+UIanOxyjSys0FbzzgUBlV2cZIIZihEW+KKKKm0ejUBNGvRdhISEFFr6HlptXoa28gtQ==", + "dev": true, + "requires": { + "concat-with-sourcemaps": "*", + "lodash.template": "^4.4.0", + "through2": "^2.0.0" + } + }, + "gulp-if": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/gulp-if/-/gulp-if-2.0.2.tgz", + "integrity": "sha1-pJe351cwBQQcqivIt92jyARE1ik=", + "dev": true, + "requires": { + "gulp-match": "^1.0.3", + "ternary-stream": "^2.0.1", + "through2": "^2.0.1" + } + }, + "gulp-match": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/gulp-match/-/gulp-match-1.0.3.tgz", + "integrity": "sha1-kcfA1/Kb7NZgbVfYCn+Hdqh6uo4=", + "dev": true, + "requires": { + "minimatch": "^3.0.3" + } + }, + "gulp-sourcemaps": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-2.6.4.tgz", + "integrity": "sha1-y7IAhFCxvM5s0jv5gze+dRv24wo=", + "dev": true, + "requires": { + "@gulp-sourcemaps/identity-map": "1.X", + "@gulp-sourcemaps/map-sources": "1.X", + "acorn": "5.X", + "convert-source-map": "1.X", + "css": "2.X", + "debug-fabulous": "1.X", + "detect-newline": "2.X", + "graceful-fs": "4.X", + "source-map": "~0.6.0", + "strip-bom-string": "1.X", + "through2": "2.X" + }, + "dependencies": { + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "gulp-uglify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-3.0.0.tgz", + "integrity": "sha1-DfAzHXKg0wLj434QlIXd3zPG0co=", + "dev": true, + "requires": { + "gulplog": "^1.0.0", + "has-gulplog": "^0.1.0", + "lodash": "^4.13.1", + "make-error-cause": "^1.1.1", + "through2": "^2.0.0", + "uglify-js": "^3.0.5", + "vinyl-sourcemaps-apply": "^0.2.0" + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true, + "requires": { + "glogg": "^1.0.0" + } + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "optional": true + } + } + } + } + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "^1.0.2" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "dev": true, + "requires": { + "sparkles": "^1.0.0" + } + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "dev": true + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.11.tgz", + "integrity": "sha512-VhDzCKN7K8ufStx/CLj5/PDTMgph+qwN5Pkd5i0sGnVwk56zJ0lkT8Qzi1xqWLS0Wp29DgDtNeS7v8/wMoZeHg==", + "dev": true + }, + "ignore": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", + "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "~0.5.3" + } + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "insert-module-globals": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.1.0.tgz", + "integrity": "sha512-LbYZdybvKjbbcKLp03lB323Cgc8f0iL0Rjh8U6JZ7K1gZSf7MxQH191iCNUcLX4qIQ6/yWe4Q4ZsQ+opcReNFg==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "lexical-scope": "^1.2.0", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + }, + "dependencies": { + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + } + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-function": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", + "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", + "dev": true + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "dev": true, + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "dev": true, + "requires": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "jaguarjs-jsdoc": { + "version": "github:dcodeIO/jaguarjs-jsdoc#ade85ac841f5ca8be40c60d506102039a036a8fa", + "from": "github:dcodeIO/jaguarjs-jsdoc", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + } + } + }, + "js2xmlparser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", + "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", + "dev": true, + "requires": { + "xmlcreate": "^1.0.1" + } + }, + "jsdoc": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", + "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", + "dev": true, + "requires": { + "babylon": "7.0.0-beta.19", + "bluebird": "~3.5.0", + "catharsis": "~0.8.9", + "escape-string-regexp": "~1.0.5", + "js2xmlparser": "~3.0.0", + "klaw": "~2.0.0", + "marked": "~0.3.6", + "mkdirp": "~0.5.1", + "requizzle": "~0.2.1", + "strip-json-comments": "~2.0.1", + "taffydb": "2.6.2", + "underscore": "~1.8.3" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "just-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", + "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "klaw": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", + "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "labeled-stream-splicer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", + "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "isarray": "^2.0.4", + "stream-splicer": "^2.0.0" + }, + "dependencies": { + "isarray": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", + "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", + "dev": true + } + } + }, + "last-run": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", + "dev": true, + "requires": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, + "requires": { + "readable-stream": "^2.0.5" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "dev": true, + "requires": { + "flush-write-stream": "^1.0.2" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "lexical-scope": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", + "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", + "dev": true, + "requires": { + "astw": "^2.0.0" + } + }, + "liftoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", + "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "findup-sync": "^2.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "lodash.template": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", + "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", + "dev": true, + "requires": { + "lodash._reinterpolate": "~3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "dev": true, + "requires": { + "lodash._reinterpolate": "~3.0.0" + } + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "dev": true, + "requires": { + "es5-ext": "~0.10.2" + } + }, + "make-error": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz", + "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==", + "dev": true + }, + "make-error-cause": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz", + "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=", + "dev": true, + "requires": { + "make-error": "^1.2.0" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "marked": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", + "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "dev": true + }, + "matchdep": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", + "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", + "dev": true, + "requires": { + "findup-sync": "^2.0.0", + "micromatch": "^3.0.4", + "resolve": "^1.4.0", + "stack-trace": "0.0.10" + } + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "memoizee": { + "version": "0.4.12", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.12.tgz", + "integrity": "sha512-sprBu6nwxBWBvBOh5v2jcsGqiGLlL2xr2dLub3vR8dnE8YB17omwtm/0NSHl8jjNbcsJd5GMWJAnTSVe/O0Wfg==", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.30", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.2" + } + }, + "meow": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" + } + }, + "merge-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "module-deps": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.0.2.tgz", + "integrity": "sha512-KWBI3009iRnHjRlxRhe8nJ6kdeBTg4sMi5N6AZgg5f1/v5S7EBCRBOY854I4P5Anl4kx6AJH+4bBBC2Gi3nkvg==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.0.2", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + }, + "dependencies": { + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stdout": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.0.tgz", + "integrity": "sha1-WzLqB+tDyd7WEwQ0z5JvRrKn/U0=", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "now-and-later": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.0.tgz", + "integrity": "sha1-vGHLtFbXnLMiB85HygUTb/Ln1u4=", + "dev": true, + "requires": { + "once": "^1.3.2" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-inspect": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.5.0.tgz", + "integrity": "sha512-UmOFbHbwvv+XHj7BerrhVq+knjceBdkvU5AriwLMvhv2qi+e7DJzxfBeFpILEjVzCp+xA+W/pIf06RGPWlZNfw==", + "dev": true + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "object.reduce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "~0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" + } + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "pbkdf2": { + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.16.tgz", + "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "platform": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.5.tgz", + "integrity": "sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==", + "dev": true + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz", + "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.0.tgz", + "integrity": "sha512-UWi0klDoq8xtVzlMRgENV9F7iCTZExaJQSQL187UXsxpk9NnrKGqTqqUNYAKGOzucSOxs2+jUnRNI+rLviPhJg==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "reflect-metadata": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.12.tgz", + "integrity": "sha512-n+IyV+nGz3+0q3/Yf1ra12KpCyi001bi4XFxSjbiWWjfqb52iTTtpGXmCCAOWWIAn9KEuFZKGqBERHmrtScZ3A==", + "dev": true + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "dev": true + }, + "remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + } + }, + "remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", + "dev": true, + "requires": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "replace-homedir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", + "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1", + "is-absolute": "^1.0.0", + "remove-trailing-separator": "^1.1.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + } + }, + "requizzle": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", + "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", + "dev": true, + "requires": { + "underscore": "~1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "resolve": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "dev": true, + "requires": { + "value-or-function": "^3.0.0" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "resumer": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "dev": true, + "requires": { + "through": "~2.3.4" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "*" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "semver-greatest-satisfied-range": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", + "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", + "dev": true, + "requires": { + "sver-compat": "^1.5.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shasum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "dev": true, + "requires": { + "json-stable-stringify": "~0.0.0", + "sha.js": "~2.4.4" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "sparkles": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", + "dev": true + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "split2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "dev": true, + "requires": { + "through2": "^2.0.2" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" + } + }, + "stream-exhaust": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", + "dev": true + }, + "stream-http": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.2.tgz", + "integrity": "sha512-QllfrBhqF1DPcz46WxKTs6Mz1Bpc+8Qm6vbqOpVav5odAXwbyzwnEczoWqtxrsmlO+cJqtPrp/8gWKWjaKLLlA==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string.prototype.trim": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", + "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.0", + "function-bind": "^1.0.2" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "^1.1.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + } + } + }, + "sver-compat": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", + "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", + "dev": true, + "requires": { + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, + "syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "dev": true, + "requires": { + "acorn-node": "^1.2.0" + } + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "^5.2.3", + "ajv-keywords": "^2.1.0", + "chalk": "^2.1.0", + "lodash": "^4.17.4", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, + "tape": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.0.tgz", + "integrity": "sha512-j0jO9BiScfqtPBb9QmPLL0qvxXMz98xjkMb7x8lKipFlJZwNJkqkWPou+NU4V6T9RnVh1kuSthLE8gLrN8bBfw==", + "dev": true, + "requires": { + "deep-equal": "~1.0.1", + "defined": "~1.0.0", + "for-each": "~0.3.2", + "function-bind": "~1.1.1", + "glob": "~7.1.2", + "has": "~1.0.1", + "inherits": "~2.0.3", + "minimist": "~1.2.0", + "object-inspect": "~1.5.0", + "resolve": "~1.5.0", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.1.2", + "through": "~2.3.8" + }, + "dependencies": { + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + } + } + }, + "ternary-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ternary-stream/-/ternary-stream-2.0.1.tgz", + "integrity": "sha1-Bk5Im0tb9gumpre8fy9cJ07Pgmk=", + "dev": true, + "requires": { + "duplexify": "^3.5.0", + "fork-stream": "^0.0.4", + "merge-stream": "^1.0.0", + "through2": "^2.0.1" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "through2-filter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-2.0.0.tgz", + "integrity": "sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw=", + "dev": true, + "requires": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "~0.11.0" + } + }, + "timers-ext": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.5.tgz", + "integrity": "sha512-tsEStd7kmACHENhsUPaxb8Jf8/+GZZxyNFQbZD07HQOyooOa6At1rQqjffgvg7n+dxscQa9cjjMdWhJtsP2sxg==", + "dev": true, + "requires": { + "es5-ext": "~0.10.14", + "next-tick": "1" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "dev": true, + "requires": { + "through2": "^2.0.3" + } + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "tslib": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.1.tgz", + "integrity": "sha512-avfPS28HmGLLc2o4elcc2EIq2FcH++Yo5YxpBZi9Yw93BCTGFthI4HPE4Rpep6vSYQaK8e69PelM44tPj+RaQg==", + "dev": true + }, + "tslint": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz", + "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.12.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "tsutils": { + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.0.tgz", + "integrity": "sha512-JcyX25oM9pFcb3zh60OqG1St8p/uSqC5Bgipdo3ieacB/Ao4dPhm7hAtKT9NrEu23CyYrrgJPV3CqYfo+/+T4w==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.3.tgz", + "integrity": "sha512-K7g15Bb6Ra4lKf7Iq2l/I5/En+hLIHmxWZGq3D4DIRNFxMNV6j2SHSvDOqs2tGd4UvD/fJvrwopzQXjLrT7Itw==", + "dev": true + }, + "uglify-js": { + "version": "3.3.25", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.25.tgz", + "integrity": "sha512-hobogryjDV36VrLK3Y69ou4REyrTApzUblVFmdQOYRe8cYaSmFJXMb4dR9McdvYDSbeNdzUgYr2YVukJaErJcA==", + "dev": true, + "requires": { + "commander": "~2.15.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "umd": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", + "dev": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", + "dev": true + }, + "underscore-contrib": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", + "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", + "dev": true, + "requires": { + "underscore": "1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "undertaker": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.0.tgz", + "integrity": "sha1-M52kZGJS0ILcN45wgGcpl1DhG0k=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" + } + }, + "undertaker-registry": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", + "dev": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unique-stream": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz", + "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", + "dev": true, + "requires": { + "json-stable-stringify": "^1.0.0", + "through2-filter": "^2.0.0" + }, + "dependencies": { + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } + } + } + }, + "universalify": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", + "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", + "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "v8flags": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.0.tgz", + "integrity": "sha512-0m69VIK2dudEf2Ub0xwLQhZkDZu85OmiOpTw+UGDt56ibviYICHziM/3aE+oVg7IjGPp0c83w3eSVqa+lYZ9UQ==", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "dev": true + }, + "vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "dependencies": { + "clone": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", + "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + } + } + }, + "vinyl-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vinyl-buffer/-/vinyl-buffer-1.0.1.tgz", + "integrity": "sha1-lsGjR5uMU5JULGEgKQE7Wyf4i78=", + "dev": true, + "requires": { + "bl": "^1.2.1", + "through2": "^2.0.3" + } + }, + "vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "requires": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + } + }, + "vinyl-source-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-2.0.0.tgz", + "integrity": "sha1-84pa+53R6Ttl1VBGmsYYKsT1S44=", + "dev": true, + "requires": { + "through2": "^2.0.3", + "vinyl": "^2.1.0" + } + }, + "vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "dev": true, + "requires": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + }, + "dependencies": { + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + } + } + }, + "vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "dev": true, + "requires": { + "source-map": "^0.5.1" + } + }, + "vm-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.0.1.tgz", + "integrity": "sha512-EqzLchIMYLBjRPoqVsEkZOa/4Vr2RfOWbd58F+I/Gj79AYTrsseMunxbbSkbYfrqZaXSuPBBXNSOhtJgg0PpmA==", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "xmlcreate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", + "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + } + } + }, + "yargs-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + } + } + } + } +} diff --git a/node_modules/protobufjs/package.json b/node_modules/protobufjs/package.json new file mode 100644 index 0000000..2ab99c7 --- /dev/null +++ b/node_modules/protobufjs/package.json @@ -0,0 +1,152 @@ +{ + "_from": "protobufjs@~6.8.6", + "_id": "protobufjs@6.8.8", + "_inBundle": false, + "_integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "_location": "/protobufjs", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "protobufjs@~6.8.6", + "name": "protobufjs", + "escapedName": "protobufjs", + "rawSpec": "~6.8.6", + "saveSpec": null, + "fetchSpec": "~6.8.6" + }, + "_requiredBy": [ + "/@tensorflow/tfjs-converter" + ], + "_resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", + "_shasum": "c8b4f1282fd7a90e6f5b109ed11c84af82908e7c", + "_spec": "protobufjs@~6.8.6", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs-converter", + "author": { + "name": "Daniel Wirtz", + "email": "dcode+protobufjs@dcode.io" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + }, + "bugs": { + "url": "https://github.com/dcodeIO/protobuf.js/issues" + }, + "bundleDependencies": false, + "cliDependencies": [ + "semver", + "chalk", + "glob", + "jsdoc", + "minimist", + "tmp", + "uglify-js", + "espree", + "escodegen", + "estraverse" + ], + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + }, + "deprecated": false, + "description": "Protocol Buffers for JavaScript (& TypeScript).", + "devDependencies": { + "benchmark": "^2.1.4", + "browserify": "^16.2.2", + "browserify-wrap": "^1.0.2", + "bundle-collapser": "^1.3.0", + "chalk": "^2.4.1", + "escodegen": "^1.9.1", + "eslint": "^4.19.1", + "espree": "^3.5.4", + "estraverse": "^4.2.0", + "gh-pages": "^1.1.0", + "git-raw-commits": "^1.3.6", + "git-semver-tags": "^1.3.6", + "glob": "^7.1.2", + "google-protobuf": "^3.5.0", + "gulp": "^4.0.0", + "gulp-header": "^2.0.5", + "gulp-if": "^2.0.1", + "gulp-sourcemaps": "^2.6.4", + "gulp-uglify": "^3.0.0", + "istanbul": "^0.4.5", + "jaguarjs-jsdoc": "github:dcodeIO/jaguarjs-jsdoc", + "jsdoc": "^3.5.5", + "minimist": "^1.2.0", + "reflect-metadata": "^0.1.12", + "semver": "^5.5.0", + "tape": "^4.9.0", + "tmp": "0.0.33", + "tslint": "^5.10.0", + "typescript": "^2.8.3", + "uglify-js": "^3.3.25", + "vinyl-buffer": "^1.0.1", + "vinyl-fs": "^3.0.3", + "vinyl-source-stream": "^2.0.0" + }, + "files": [ + "index.js", + "index.d.ts", + "light.d.ts", + "light.js", + "minimal.d.ts", + "minimal.js", + "package-lock.json", + "tsconfig.json", + "scripts/postinstall.js", + "bin/**", + "cli/**", + "dist/**", + "ext/**", + "google/**", + "src/**" + ], + "homepage": "http://dcode.io/protobuf.js", + "keywords": [ + "protobuf", + "protocol-buffers", + "serialization", + "typescript" + ], + "license": "BSD-3-Clause", + "main": "index.js", + "name": "protobufjs", + "repository": { + "type": "git", + "url": "git+https://github.com/dcodeIO/protobuf.js.git" + }, + "scripts": { + "bench": "node bench", + "build": "gulp --gulpfile scripts/gulpfile.js", + "changelog": "node scripts/changelog -w", + "coverage": "istanbul --config=config/istanbul.json cover node_modules/tape/bin/tape tests/*.js tests/node/*.js", + "docs": "jsdoc -c config/jsdoc.json -R README.md --verbose --pedantic", + "lint": "eslint **/*.js -c config/eslint.json && tslint **/*.d.ts -e **/node_modules/** -t stylish -c config/tslint.json", + "make": "npm run test && npm run types && npm run build && npm run lint", + "pages": "node scripts/pages", + "postinstall": "node scripts/postinstall", + "prepublish": "node scripts/prepublish", + "prof": "node bench/prof", + "release": "npm run make && npm run changelog", + "test": "tape -r ./lib/tape-adapter tests/*.js tests/node/*.js", + "test-types": "tsc tests/comp_typescript.ts --lib es2015 --strictNullChecks --experimentalDecorators --emitDecoratorMetadata && tsc tests/data/test.js.ts --lib es2015 --noEmit --strictNullChecks && tsc tests/data/rpc.ts --lib es2015 --noEmit --strictNullChecks", + "types": "node bin/pbts --main --global protobuf --out index.d.ts src/ lib/aspromise/index.js lib/base64/index.js lib/codegen/index.js lib/eventemitter/index.js lib/float/index.js lib/fetch/index.js lib/inquire/index.js lib/path/index.js lib/pool/index.js lib/utf8/index.js && npm run test-types" + }, + "types": "index.d.ts", + "version": "6.8.8", + "versionScheme": "~" +} diff --git a/node_modules/protobufjs/scripts/changelog.js b/node_modules/protobufjs/scripts/changelog.js new file mode 100644 index 0000000..d806b6b --- /dev/null +++ b/node_modules/protobufjs/scripts/changelog.js @@ -0,0 +1,150 @@ +"use strict"; + +var path = require("path"), + fs = require("fs"); + +var gitSemverTags = require("git-semver-tags"), + gitRawCommits = require("git-raw-commits"), + minimist = require("minimist"); + +var basedir = path.join(__dirname, ".."); +var pkg = require(basedir + "/package.json"); + +var argv = minimist(process.argv, { + alias: { + tag : "t", + write : "w" + }, + string: [ "tag" ], + boolean: [ "write" ], + default: { + tag: null, + write: false + } +}); + +// categories to be used in the future and regexes for lazy / older subjects +var validCategories = { + "Breaking": null, + "Fixed": /fix|properly|prevent|correctly/i, + "New": /added|initial/i, + "CLI": /pbjs|pbts|CLI/, + "Docs": /README/i, + "Other": null +}; +var breakingFallback = /removed|stripped|dropped/i; + +var repo = "https://github.com/dcodeIO/protobuf.js"; + +gitSemverTags(function(err, tags) { + if (err) + throw err; + + var categories = {}; + Object.keys(validCategories).forEach(function(category) { + categories[category] = []; + }); + var output = []; + + var from = tags[0]; + var to = "HEAD"; + var tag; + if (argv.tag) { + var idx = tags.indexOf(argv.tag); + if (idx < 0) + throw Error("no such tag: " + argv.tag); + from = tags[idx + 1]; + tag = to = tags[idx]; + } else + tag = pkg.version; + + var commits = gitRawCommits({ + from: from, + to: to, + merges: false, + format: "%B%n#%H" + }); + + commits.on("error", function(err) { + throw err; + }); + + commits.on("data", function(chunk) { + var message = chunk.toString("utf8").trim(); + var match = /#([0-9a-f]{40})$/.exec(message); + var hash; + if (match) { + message = message.substring(0, message.length - match[1].length).trim(); + hash = match[1]; + } + message.split(";").forEach(function(message) { + if (/^(Merge pull request |Post-merge)/.test(message)) + return; + var match = /^(\w+):/i.exec(message = message.trim()); + var category; + if (match && match[1] in validCategories) { + category = match[1]; + message = message.substring(match[1].length + 1).trim(); + } else { + var keys = Object.keys(validCategories); + for (var i = 0; i < keys.length; ++i) { + var re = validCategories[keys[i]]; + if (re && re.test(message)) { + category = keys[i]; + break; + } + } + message = message.replace(/^(\w+):/i, "").trim(); + } + if (!category) { + if (breakingFallback.test(message)) + category = "Breaking"; + else + category = "Other"; + } + var nl = message.indexOf("\n"); + if (nl > -1) + message = message.substring(0, nl).trim(); + if (!hash || message.length < 12) + return; + message = message.replace(/\[ci skip\]/, "").trim(); + categories[category].push({ + text: message, + hash: hash + }); + }); + }); + + commits.on("end", function() { + output.push("# [" + tag + "](" + repo + "/releases/tag/" + tag + ")\n"); + Object.keys(categories).forEach(function(category) { + var messages = categories[category]; + if (!messages.length) + return; + output.push("\n## " + category + "\n"); + messages.forEach(function(message) { + var text = message.text.replace(/#(\d+)/g, "[#$1](" + repo + "/issues/$1)"); + output.push("[:hash:](" + repo + "/commit/" + message.hash + ") " + text + "
\n"); + }); + }); + var current; + try { + current = fs.readFileSync(basedir + "/CHANGELOG.md").toString("utf8"); + } catch (e) { + current = ""; + } + var re = new RegExp("^# \\[" + tag + "\\]"); + if (re.test(current)) { // regenerated, replace + var pos = current.indexOf("# [", 1); + if (pos > -1) + current = current.substring(pos).trim(); + else + current = ""; + } + var contents = output.join("") + "\n" + current; + if (argv.write) + fs.writeFileSync(basedir + "/CHANGELOG.md", contents, "utf8"); + else + process.stdout.write(contents); + }); +}); diff --git a/node_modules/protobufjs/scripts/postinstall.js b/node_modules/protobufjs/scripts/postinstall.js new file mode 100644 index 0000000..37898b6 --- /dev/null +++ b/node_modules/protobufjs/scripts/postinstall.js @@ -0,0 +1,35 @@ +"use strict"; + +var path = require("path"), + fs = require("fs"), + pkg = require(path.join(__dirname, "..", "package.json")); + +// ensure that there is a node_modules folder for cli dependencies +try { fs.mkdirSync(path.join(__dirname, "..", "cli", "node_modules")); } catch (e) {/**/} + +// check version scheme used by dependents +if (!pkg.versionScheme) + return; + +var warn = process.stderr.isTTY + ? "\x1b[30m\x1b[43mWARN\x1b[0m \x1b[35m" + path.basename(process.argv[1], ".js") + "\x1b[0m" + : "WARN " + path.basename(process.argv[1], ".js"); + +var basePkg; +try { + basePkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "..", "package.json"))); +} catch (e) { + return; +} + +[ + "dependencies", + "devDependencies", + "optionalDependencies", + "peerDependencies" +] +.forEach(function(check) { + var version = basePkg && basePkg[check] && basePkg[check][pkg.name]; + if (typeof version === "string" && version.charAt(0) !== pkg.versionScheme) + process.stderr.write(pkg.name + " " + warn + " " + pkg.name + "@" + version + " is configured as a dependency of " + basePkg.name + ". use " + pkg.name + "@" + pkg.versionScheme + version.substring(1) + " instead for API compatibility.\n"); +}); diff --git a/node_modules/protobufjs/src/common.js b/node_modules/protobufjs/src/common.js new file mode 100644 index 0000000..489ee1c --- /dev/null +++ b/node_modules/protobufjs/src/common.js @@ -0,0 +1,399 @@ +"use strict"; +module.exports = common; + +var commonRe = /\/|\./; + +/** + * Provides common type definitions. + * Can also be used to provide additional google types or your own custom types. + * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name + * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition + * @returns {undefined} + * @property {INamespace} google/protobuf/any.proto Any + * @property {INamespace} google/protobuf/duration.proto Duration + * @property {INamespace} google/protobuf/empty.proto Empty + * @property {INamespace} google/protobuf/field_mask.proto FieldMask + * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue + * @property {INamespace} google/protobuf/timestamp.proto Timestamp + * @property {INamespace} google/protobuf/wrappers.proto Wrappers + * @example + * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension) + * protobuf.common("descriptor", descriptorJson); + * + * // manually provides a custom definition (uses my.foo namespace) + * protobuf.common("my/foo/bar.proto", myFooBarJson); + */ +function common(name, json) { + if (!commonRe.test(name)) { + name = "google/protobuf/" + name + ".proto"; + json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; + } + common[name] = json; +} + +// Not provided because of limited use (feel free to discuss or to provide yourself): +// +// google/protobuf/descriptor.proto +// google/protobuf/source_context.proto +// google/protobuf/type.proto +// +// Stripped and pre-parsed versions of these non-bundled files are instead available as part of +// the repository or package within the google/protobuf directory. + +common("any", { + + /** + * Properties of a google.protobuf.Any message. + * @interface IAny + * @type {Object} + * @property {string} [typeUrl] + * @property {Uint8Array} [bytes] + * @memberof common + */ + Any: { + fields: { + type_url: { + type: "string", + id: 1 + }, + value: { + type: "bytes", + id: 2 + } + } + } +}); + +var timeType; + +common("duration", { + + /** + * Properties of a google.protobuf.Duration message. + * @interface IDuration + * @type {Object} + * @property {number|Long} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Duration: timeType = { + fields: { + seconds: { + type: "int64", + id: 1 + }, + nanos: { + type: "int32", + id: 2 + } + } + } +}); + +common("timestamp", { + + /** + * Properties of a google.protobuf.Timestamp message. + * @interface ITimestamp + * @type {Object} + * @property {number|Long} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Timestamp: timeType +}); + +common("empty", { + + /** + * Properties of a google.protobuf.Empty message. + * @interface IEmpty + * @memberof common + */ + Empty: { + fields: {} + } +}); + +common("struct", { + + /** + * Properties of a google.protobuf.Struct message. + * @interface IStruct + * @type {Object} + * @property {Object.} [fields] + * @memberof common + */ + Struct: { + fields: { + fields: { + keyType: "string", + type: "Value", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Value message. + * @interface IValue + * @type {Object} + * @property {string} [kind] + * @property {0} [nullValue] + * @property {number} [numberValue] + * @property {string} [stringValue] + * @property {boolean} [boolValue] + * @property {IStruct} [structValue] + * @property {IListValue} [listValue] + * @memberof common + */ + Value: { + oneofs: { + kind: { + oneof: [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + fields: { + nullValue: { + type: "NullValue", + id: 1 + }, + numberValue: { + type: "double", + id: 2 + }, + stringValue: { + type: "string", + id: 3 + }, + boolValue: { + type: "bool", + id: 4 + }, + structValue: { + type: "Struct", + id: 5 + }, + listValue: { + type: "ListValue", + id: 6 + } + } + }, + + NullValue: { + values: { + NULL_VALUE: 0 + } + }, + + /** + * Properties of a google.protobuf.ListValue message. + * @interface IListValue + * @type {Object} + * @property {Array.} [values] + * @memberof common + */ + ListValue: { + fields: { + values: { + rule: "repeated", + type: "Value", + id: 1 + } + } + } +}); + +common("wrappers", { + + /** + * Properties of a google.protobuf.DoubleValue message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + DoubleValue: { + fields: { + value: { + type: "double", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.FloatValue message. + * @interface IFloatValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FloatValue: { + fields: { + value: { + type: "float", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int64Value message. + * @interface IInt64Value + * @type {Object} + * @property {number|Long} [value] + * @memberof common + */ + Int64Value: { + fields: { + value: { + type: "int64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt64Value message. + * @interface IUInt64Value + * @type {Object} + * @property {number|Long} [value] + * @memberof common + */ + UInt64Value: { + fields: { + value: { + type: "uint64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int32Value message. + * @interface IInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + Int32Value: { + fields: { + value: { + type: "int32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt32Value message. + * @interface IUInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + UInt32Value: { + fields: { + value: { + type: "uint32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BoolValue message. + * @interface IBoolValue + * @type {Object} + * @property {boolean} [value] + * @memberof common + */ + BoolValue: { + fields: { + value: { + type: "bool", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.StringValue message. + * @interface IStringValue + * @type {Object} + * @property {string} [value] + * @memberof common + */ + StringValue: { + fields: { + value: { + type: "string", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BytesValue message. + * @interface IBytesValue + * @type {Object} + * @property {Uint8Array} [value] + * @memberof common + */ + BytesValue: { + fields: { + value: { + type: "bytes", + id: 1 + } + } + } +}); + +common("field_mask", { + + /** + * Properties of a google.protobuf.FieldMask message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FieldMask: { + fields: { + paths: { + rule: "repeated", + type: "string", + id: 1 + } + } + } +}); + +/** + * Gets the root definition of the specified common proto file. + * + * Bundled definitions are: + * - google/protobuf/any.proto + * - google/protobuf/duration.proto + * - google/protobuf/empty.proto + * - google/protobuf/field_mask.proto + * - google/protobuf/struct.proto + * - google/protobuf/timestamp.proto + * - google/protobuf/wrappers.proto + * + * @param {string} file Proto file name + * @returns {INamespace|null} Root definition or `null` if not defined + */ +common.get = function get(file) { + return common[file] || null; +}; diff --git a/node_modules/protobufjs/src/converter.js b/node_modules/protobufjs/src/converter.js new file mode 100644 index 0000000..44d952e --- /dev/null +++ b/node_modules/protobufjs/src/converter.js @@ -0,0 +1,293 @@ +"use strict"; +/** + * Runtime message from/to plain object converters. + * @namespace + */ +var converter = exports; + +var Enum = require("./enum"), + util = require("./util"); + +/** + * Generates a partial value fromObject conveter. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} prop Property reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genValuePartial_fromObject(gen, field, fieldIndex, prop) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(d%s){", prop); + for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { + if (field.repeated && values[keys[i]] === field.typeDefault) gen + ("default:"); + gen + ("case%j:", keys[i]) + ("case %i:", values[keys[i]]) + ("m%s=%j", prop, values[keys[i]]) + ("break"); + } gen + ("}"); + } else gen + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); + } else { + var isUnsigned = false; + switch (field.type) { + case "double": + case "float": gen + ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" + break; + case "uint32": + case "fixed32": gen + ("m%s=d%s>>>0", prop, prop); + break; + case "int32": + case "sint32": + case "sfixed32": gen + ("m%s=d%s|0", prop, prop); + break; + case "uint64": + isUnsigned = true; + // eslint-disable-line no-fallthrough + case "int64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(util.Long)") + ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) + ("else if(typeof d%s===\"string\")", prop) + ("m%s=parseInt(d%s,10)", prop, prop) + ("else if(typeof d%s===\"number\")", prop) + ("m%s=d%s", prop, prop) + ("else if(typeof d%s===\"object\")", prop) + ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); + break; + case "bytes": gen + ("if(typeof d%s===\"string\")", prop) + ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) + ("else if(d%s.length)", prop) + ("m%s=d%s", prop, prop); + break; + case "string": gen + ("m%s=String(d%s)", prop, prop); + break; + case "bool": gen + ("m%s=Boolean(d%s)", prop, prop); + break; + /* default: gen + ("m%s=d%s", prop, prop); + break; */ + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.fromObject = function fromObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray; + var gen = util.codegen(["d"], mtype.name + "$fromObject") + ("if(d instanceof this.ctor)") + ("return d"); + if (!fields.length) return gen + ("return new this.ctor"); + gen + ("var m=new this.ctor"); + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + prop = util.safeProp(field.name); + + // Map fields + if (field.map) { gen + ("if(d%s){", prop) + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s={}", prop) + ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); + break; + case "bytes": gen + ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); + break; + default: gen + ("d%s=m%s", prop, prop); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.toObject = function toObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); + if (!fields.length) + return util.codegen()("return {}"); + var gen = util.codegen(["m", "o"], mtype.name + "$toObject") + ("if(!o)") + ("o={}") + ("var d={}"); + + var repeatedFields = [], + mapFields = [], + normalFields = [], + i = 0; + for (; i < fields.length; ++i) + if (!fields[i].partOf) + ( fields[i].resolve().repeated ? repeatedFields + : fields[i].map ? mapFields + : normalFields).push(fields[i]); + + if (repeatedFields.length) { gen + ("if(o.arrays||o.defaults){"); + for (i = 0; i < repeatedFields.length; ++i) gen + ("d%s=[]", util.safeProp(repeatedFields[i].name)); + gen + ("}"); + } + + if (mapFields.length) { gen + ("if(o.objects||o.defaults){"); + for (i = 0; i < mapFields.length; ++i) gen + ("d%s={}", util.safeProp(mapFields[i].name)); + gen + ("}"); + } + + if (normalFields.length) { gen + ("if(o.defaults){"); + for (i = 0; i < normalFields.length; ++i) { + var field = normalFields[i], + prop = util.safeProp(field.name); + if (field.resolvedType instanceof Enum) gen + ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); + else if (field.long) gen + ("if(util.Long){") + ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) + ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) + ("}else") + ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); + else if (field.bytes) { + var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; + gen + ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) + ("else{") + ("d%s=%s", prop, arrayDefault) + ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) + ("}"); + } else gen + ("d%s=%j", prop, field.typeDefault); // also messages (=null) + } gen + ("}"); + } + var hasKs2 = false; + for (i = 0; i < fields.length; ++i) { + var field = fields[i], + index = mtype._fieldsArray.indexOf(field), + prop = util.safeProp(field.name); + if (field.map) { + if (!hasKs2) { hasKs2 = true; gen + ("var ks2"); + } gen + ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) + ("d%s={}", prop) + ("for(var j=0;j>>3){"); + + var i = 0; + for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + ref = "m" + util.safeProp(field.name); gen + ("case %i:", field.id); + + // Map fields + if (field.map) { gen + ("r.skip().pos++") // assumes id 1 + key wireType + ("if(%s===util.emptyObject)", ref) + ("%s={}", ref) + ("k=r.%s()", field.keyType) + ("r.pos++"); // assumes id 2 + value wireType + if (types.long[field.keyType] !== undefined) { + if (types.basic[type] === undefined) gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=r.%s()", ref, type); + } else { + if (types.basic[type] === undefined) gen + ("%s[k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[k]=r.%s()", ref, type); + } + + // Repeated fields + } else if (field.repeated) { gen + + ("if(!(%s&&%s.length))", ref, ref) + ("%s=[]", ref); + + // Packable (always check for forward and backward compatiblity) + if (types.packed[type] !== undefined) gen + ("if((t&7)===2){") + ("var c2=r.uint32()+r.pos") + ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0) + : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); +} + +/** + * Generates an encoder specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function encoder(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var gen = util.codegen(["m", "w"], mtype.name + "$encode") + ("if(!w)") + ("w=Writer.create()"); + + var i, ref; + + // "when a message is serialized its known fields should be written sequentially by field number" + var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); + + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + index = mtype._fieldsArray.indexOf(field), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + wireType = types.basic[type]; + ref = "m" + util.safeProp(field.name); + + // Map fields + if (field.map) { + gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name) // !== undefined && !== null + ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); + if (wireType === undefined) gen + ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups + else gen + (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); + gen + ("}") + ("}"); + + // Repeated fields + } else if (field.repeated) { gen + ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null + + // Packed repeated + if (field.packed && types.packed[type] !== undefined) { gen + + ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) + ("for(var i=0;i<%s.length;++i)", ref) + ("w.%s(%s[i])", type, ref) + ("w.ldelim()"); + + // Non-packed + } else { gen + + ("for(var i=0;i<%s.length;++i)", ref); + if (wireType === undefined) + genTypePartial(gen, field, index, ref + "[i]"); + else gen + ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); + + } gen + ("}"); + + // Non-repeated + } else { + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j))", ref, field.name); // !== undefined && !== null + + if (wireType === undefined) + genTypePartial(gen, field, index, ref); + else gen + ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); + + } + } + + return gen + ("return w"); + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} \ No newline at end of file diff --git a/node_modules/protobufjs/src/enum.js b/node_modules/protobufjs/src/enum.js new file mode 100644 index 0000000..b11014b --- /dev/null +++ b/node_modules/protobufjs/src/enum.js @@ -0,0 +1,181 @@ +"use strict"; +module.exports = Enum; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; + +var Namespace = require("./namespace"), + util = require("./util"); + +/** + * Constructs a new enum instance. + * @classdesc Reflected enum. + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {Object.} [values] Enum values as an object, by name + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this enum + * @param {Object.} [comments] The value comments for this enum + */ +function Enum(name, values, options, comment, comments) { + ReflectionObject.call(this, name, options); + + if (values && typeof values !== "object") + throw TypeError("values must be an object"); + + /** + * Enum values by id. + * @type {Object.} + */ + this.valuesById = {}; + + /** + * Enum values by name. + * @type {Object.} + */ + this.values = Object.create(this.valuesById); // toJSON, marker + + /** + * Enum comment text. + * @type {string|null} + */ + this.comment = comment; + + /** + * Value comment texts, if any. + * @type {Object.} + */ + this.comments = comments || {}; + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + // Note that values inherit valuesById on their prototype which makes them a TypeScript- + // compatible enum. This is used by pbts to write actual enum definitions that work for + // static and reflection code alike instead of emitting generic object definitions. + + if (values) + for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) + if (typeof values[keys[i]] === "number") // use forward entries only + this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; +} + +/** + * Enum descriptor. + * @interface IEnum + * @property {Object.} values Enum values + * @property {Object.} [options] Enum options + */ + +/** + * Constructs an enum from an enum descriptor. + * @param {string} name Enum name + * @param {IEnum} json Enum descriptor + * @returns {Enum} Created enum + * @throws {TypeError} If arguments are invalid + */ +Enum.fromJSON = function fromJSON(name, json) { + var enm = new Enum(name, json.values, json.options, json.comment, json.comments); + enm.reserved = json.reserved; + return enm; +}; + +/** + * Converts this enum to an enum descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IEnum} Enum descriptor + */ +Enum.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "values" , this.values, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "comment" , keepComments ? this.comment : undefined, + "comments" , keepComments ? this.comments : undefined + ]); +}; + +/** + * Adds a value to this enum. + * @param {string} name Value name + * @param {number} id Value id + * @param {string} [comment] Comment, if any + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ +Enum.prototype.add = function add(name, id, comment) { + // utilized by the parser but not by .fromJSON + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (!util.isInteger(id)) + throw TypeError("id must be an integer"); + + if (this.values[name] !== undefined) + throw Error("duplicate name '" + name + "' in " + this); + + if (this.isReservedId(id)) + throw Error("id " + id + " is reserved in " + this); + + if (this.isReservedName(name)) + throw Error("name '" + name + "' is reserved in " + this); + + if (this.valuesById[id] !== undefined) { + if (!(this.options && this.options.allow_alias)) + throw Error("duplicate id " + id + " in " + this); + this.values[name] = id; + } else + this.valuesById[this.values[name] = id] = name; + + this.comments[name] = comment || null; + return this; +}; + +/** + * Removes a value from this enum + * @param {string} name Value name + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ +Enum.prototype.remove = function remove(name) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + var val = this.values[name]; + if (val == null) + throw Error("name '" + name + "' does not exist in " + this); + + delete this.valuesById[val]; + delete this.values[name]; + delete this.comments[name]; + + return this; +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; diff --git a/node_modules/protobufjs/src/field.js b/node_modules/protobufjs/src/field.js new file mode 100644 index 0000000..788c773 --- /dev/null +++ b/node_modules/protobufjs/src/field.js @@ -0,0 +1,371 @@ +"use strict"; +module.exports = Field; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; + +var Enum = require("./enum"), + types = require("./types"), + util = require("./util"); + +var Type; // cyclic + +var ruleRe = /^required|optional|repeated$/; + +/** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @name Field + * @classdesc Reflected message field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a field from a field descriptor. + * @param {string} name Field name + * @param {IField} json Field descriptor + * @returns {Field} Created field + * @throws {TypeError} If arguments are invalid + */ +Field.fromJSON = function fromJSON(name, json) { + return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); +}; + +/** + * Not an actual constructor. Use {@link Field} instead. + * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. + * @exports FieldBase + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function Field(name, id, type, rule, extend, options, comment) { + + if (util.isObject(rule)) { + comment = extend; + options = rule; + rule = extend = undefined; + } else if (util.isObject(extend)) { + comment = options; + options = extend; + extend = undefined; + } + + ReflectionObject.call(this, name, options); + + if (!util.isInteger(id) || id < 0) + throw TypeError("id must be a non-negative integer"); + + if (!util.isString(type)) + throw TypeError("type must be a string"); + + if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) + throw TypeError("rule must be a string rule"); + + if (extend !== undefined && !util.isString(extend)) + throw TypeError("extend must be a string"); + + /** + * Field rule, if any. + * @type {string|undefined} + */ + this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON + + /** + * Field type. + * @type {string} + */ + this.type = type; // toJSON + + /** + * Unique field id. + * @type {number} + */ + this.id = id; // toJSON, marker + + /** + * Extended type if different from parent. + * @type {string|undefined} + */ + this.extend = extend || undefined; // toJSON + + /** + * Whether this field is required. + * @type {boolean} + */ + this.required = rule === "required"; + + /** + * Whether this field is optional. + * @type {boolean} + */ + this.optional = !this.required; + + /** + * Whether this field is repeated. + * @type {boolean} + */ + this.repeated = rule === "repeated"; + + /** + * Whether this field is a map or not. + * @type {boolean} + */ + this.map = false; + + /** + * Message this field belongs to. + * @type {Type|null} + */ + this.message = null; + + /** + * OneOf this field belongs to, if any, + * @type {OneOf|null} + */ + this.partOf = null; + + /** + * The field type's default value. + * @type {*} + */ + this.typeDefault = null; + + /** + * The field's default value on prototypes. + * @type {*} + */ + this.defaultValue = null; + + /** + * Whether this field's value should be treated as a long. + * @type {boolean} + */ + this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; + + /** + * Whether this field's value is a buffer. + * @type {boolean} + */ + this.bytes = type === "bytes"; + + /** + * Resolved type if not a basic type. + * @type {Type|Enum|null} + */ + this.resolvedType = null; + + /** + * Sister-field within the extended type if a declaring extension field. + * @type {Field|null} + */ + this.extensionField = null; + + /** + * Sister-field within the declaring namespace if an extended field. + * @type {Field|null} + */ + this.declaringField = null; + + /** + * Internally remembers whether this field is packed. + * @type {boolean|null} + * @private + */ + this._packed = null; + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Determines whether this field is packed. Only relevant when repeated and working with proto2. + * @name Field#packed + * @type {boolean} + * @readonly + */ +Object.defineProperty(Field.prototype, "packed", { + get: function() { + // defaults to packed=true if not explicity set to false + if (this._packed === null) + this._packed = this.getOption("packed") !== false; + return this._packed; + } +}); + +/** + * @override + */ +Field.prototype.setOption = function setOption(name, value, ifNotSet) { + if (name === "packed") // clear cached before setting + this._packed = null; + return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); +}; + +/** + * Field descriptor. + * @interface IField + * @property {string} [rule="optional"] Field rule + * @property {string} type Field type + * @property {number} id Field id + * @property {Object.} [options] Field options + */ + +/** + * Extension field descriptor. + * @interface IExtensionField + * @extends IField + * @property {string} extend Extended type + */ + +/** + * Converts this field to a field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IField} Field descriptor + */ +Field.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "rule" , this.rule !== "optional" && this.rule || undefined, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Resolves this field's type references. + * @returns {Field} `this` + * @throws {Error} If any reference cannot be resolved + */ +Field.prototype.resolve = function resolve() { + + if (this.resolved) + return this; + + if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it + this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); + if (this.resolvedType instanceof Type) + this.typeDefault = null; + else // instanceof Enum + this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined + } + + // use explicitly set default value if present + if (this.options && this.options["default"] != null) { + this.typeDefault = this.options["default"]; + if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") + this.typeDefault = this.resolvedType.values[this.typeDefault]; + } + + // remove unnecessary options + if (this.options) { + if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) + delete this.options.packed; + if (!Object.keys(this.options).length) + this.options = undefined; + } + + // convert to internal data type if necesssary + if (this.long) { + this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); + + /* istanbul ignore else */ + if (Object.freeze) + Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) + + } else if (this.bytes && typeof this.typeDefault === "string") { + var buf; + if (util.base64.test(this.typeDefault)) + util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); + else + util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); + this.typeDefault = buf; + } + + // take special care of maps and repeated fields + if (this.map) + this.defaultValue = util.emptyObject; + else if (this.repeated) + this.defaultValue = util.emptyArray; + else + this.defaultValue = this.typeDefault; + + // ensure proper value on prototype + if (this.parent instanceof Type) + this.parent.ctor.prototype[this.name] = this.defaultValue; + + return ReflectionObject.prototype.resolve.call(this); +}; + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @typedef FieldDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} fieldName Field name + * @returns {undefined} + */ + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @param {T} [defaultValue] Default value + * @returns {FieldDecorator} Decorator function + * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] + */ +Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { + + // submessage: decorate the submessage and use its name as the type + if (typeof fieldType === "function") + fieldType = util.decorateType(fieldType).name; + + // enum reference: create a reflected copy of the enum and keep reuseing it + else if (fieldType && typeof fieldType === "object") + fieldType = util.decorateEnum(fieldType).name; + + return function fieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); + }; +}; + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {Constructor|string} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @returns {FieldDecorator} Decorator function + * @template T extends Message + * @variation 2 + */ +// like Field.d but without a default value + +// Sets up cyclic dependencies (called in index-light) +Field._configure = function configure(Type_) { + Type = Type_; +}; diff --git a/node_modules/protobufjs/src/index-light.js b/node_modules/protobufjs/src/index-light.js new file mode 100644 index 0000000..32c6a05 --- /dev/null +++ b/node_modules/protobufjs/src/index-light.js @@ -0,0 +1,104 @@ +"use strict"; +var protobuf = module.exports = require("./index-minimal"); + +protobuf.build = "light"; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @typedef LoadCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Root} [root] Root, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param {string|string[]} filename One or multiple files to load + * @param {Root} root Root namespace, defaults to create a new one if omitted. + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + */ +function load(filename, root, callback) { + if (typeof root === "function") { + callback = root; + root = new protobuf.Root(); + } else if (!root) + root = new protobuf.Root(); + return root.load(filename, callback); +} + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Promise} Promise + * @see {@link Root#load} + * @variation 3 + */ +// function load(filename:string, [root:Root]):Promise + +protobuf.load = load; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +function loadSync(filename, root) { + if (!root) + root = new protobuf.Root(); + return root.loadSync(filename); +} + +protobuf.loadSync = loadSync; + +// Serialization +protobuf.encoder = require("./encoder"); +protobuf.decoder = require("./decoder"); +protobuf.verifier = require("./verifier"); +protobuf.converter = require("./converter"); + +// Reflection +protobuf.ReflectionObject = require("./object"); +protobuf.Namespace = require("./namespace"); +protobuf.Root = require("./root"); +protobuf.Enum = require("./enum"); +protobuf.Type = require("./type"); +protobuf.Field = require("./field"); +protobuf.OneOf = require("./oneof"); +protobuf.MapField = require("./mapfield"); +protobuf.Service = require("./service"); +protobuf.Method = require("./method"); + +// Runtime +protobuf.Message = require("./message"); +protobuf.wrappers = require("./wrappers"); + +// Utility +protobuf.types = require("./types"); +protobuf.util = require("./util"); + +// Set up possibly cyclic reflection dependencies +protobuf.ReflectionObject._configure(protobuf.Root); +protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); +protobuf.Root._configure(protobuf.Type); +protobuf.Field._configure(protobuf.Type); diff --git a/node_modules/protobufjs/src/index-minimal.js b/node_modules/protobufjs/src/index-minimal.js new file mode 100644 index 0000000..9bc051b --- /dev/null +++ b/node_modules/protobufjs/src/index-minimal.js @@ -0,0 +1,36 @@ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require("./writer"); +protobuf.BufferWriter = require("./writer_buffer"); +protobuf.Reader = require("./reader"); +protobuf.BufferReader = require("./reader_buffer"); + +// Utility +protobuf.util = require("./util/minimal"); +protobuf.rpc = require("./rpc"); +protobuf.roots = require("./roots"); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.Reader._configure(protobuf.BufferReader); + protobuf.util._configure(); +} + +// Set up buffer utility according to the environment +protobuf.Writer._configure(protobuf.BufferWriter); +configure(); diff --git a/node_modules/protobufjs/src/index.js b/node_modules/protobufjs/src/index.js new file mode 100644 index 0000000..56bd3d5 --- /dev/null +++ b/node_modules/protobufjs/src/index.js @@ -0,0 +1,12 @@ +"use strict"; +var protobuf = module.exports = require("./index-light"); + +protobuf.build = "full"; + +// Parser +protobuf.tokenize = require("./tokenize"); +protobuf.parse = require("./parse"); +protobuf.common = require("./common"); + +// Configure parser +protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common); diff --git a/node_modules/protobufjs/src/mapfield.js b/node_modules/protobufjs/src/mapfield.js new file mode 100644 index 0000000..67c7097 --- /dev/null +++ b/node_modules/protobufjs/src/mapfield.js @@ -0,0 +1,126 @@ +"use strict"; +module.exports = MapField; + +// extends Field +var Field = require("./field"); +((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; + +var types = require("./types"), + util = require("./util"); + +/** + * Constructs a new map field instance. + * @classdesc Reflected map field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} keyType Key type + * @param {string} type Value type + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function MapField(name, id, keyType, type, options, comment) { + Field.call(this, name, id, type, undefined, undefined, options, comment); + + /* istanbul ignore if */ + if (!util.isString(keyType)) + throw TypeError("keyType must be a string"); + + /** + * Key type. + * @type {string} + */ + this.keyType = keyType; // toJSON, marker + + /** + * Resolved key type if not a basic type. + * @type {ReflectionObject|null} + */ + this.resolvedKeyType = null; + + // Overrides Field#map + this.map = true; +} + +/** + * Map field descriptor. + * @interface IMapField + * @extends {IField} + * @property {string} keyType Key type + */ + +/** + * Extension map field descriptor. + * @interface IExtensionMapField + * @extends IMapField + * @property {string} extend Extended type + */ + +/** + * Constructs a map field from a map field descriptor. + * @param {string} name Field name + * @param {IMapField} json Map field descriptor + * @returns {MapField} Created map field + * @throws {TypeError} If arguments are invalid + */ +MapField.fromJSON = function fromJSON(name, json) { + return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); +}; + +/** + * Converts this map field to a map field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMapField} Map field descriptor + */ +MapField.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "keyType" , this.keyType, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +MapField.prototype.resolve = function resolve() { + if (this.resolved) + return this; + + // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" + if (types.mapKey[this.keyType] === undefined) + throw Error("invalid key type: " + this.keyType); + + return Field.prototype.resolve.call(this); +}; + +/** + * Map field decorator (TypeScript). + * @name MapField.d + * @function + * @param {number} fieldId Field id + * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type + * @returns {FieldDecorator} Decorator function + * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } + */ +MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { + + // submessage value: decorate the submessage and use its name as the type + if (typeof fieldValueType === "function") + fieldValueType = util.decorateType(fieldValueType).name; + + // enum reference value: create a reflected copy of the enum and keep reuseing it + else if (fieldValueType && typeof fieldValueType === "object") + fieldValueType = util.decorateEnum(fieldValueType).name; + + return function mapFieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); + }; +}; diff --git a/node_modules/protobufjs/src/message.js b/node_modules/protobufjs/src/message.js new file mode 100644 index 0000000..3f94bf6 --- /dev/null +++ b/node_modules/protobufjs/src/message.js @@ -0,0 +1,139 @@ +"use strict"; +module.exports = Message; + +var util = require("./util/minimal"); + +/** + * Constructs a new message instance. + * @classdesc Abstract runtime message. + * @constructor + * @param {Properties} [properties] Properties to set + * @template T extends object = object + */ +function Message(properties) { + // not used internally + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; +} + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/*eslint-disable valid-jsdoc*/ + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message} Message instance + * @template T extends Message + * @this Constructor + */ +Message.create = function create(properties) { + return this.$type.create(properties); +}; + +/** + * Encodes a message of this type. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decode = function decode(reader) { + return this.$type.decode(reader); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decodeDelimited = function decodeDelimited(reader) { + return this.$type.decodeDelimited(reader); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object + * @returns {T} Message instance + * @template T extends Message + * @this Constructor + */ +Message.fromObject = function fromObject(object) { + return this.$type.fromObject(object); +}; + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {T} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @template T extends Message + * @this Constructor + */ +Message.toObject = function toObject(message, options) { + return this.$type.toObject(message, options); +}; + +/** + * Converts this message to JSON. + * @returns {Object.} JSON object + */ +Message.prototype.toJSON = function toJSON() { + return this.$type.toObject(this, util.toJSONOptions); +}; + +/*eslint-enable valid-jsdoc*/ \ No newline at end of file diff --git a/node_modules/protobufjs/src/method.js b/node_modules/protobufjs/src/method.js new file mode 100644 index 0000000..f515922 --- /dev/null +++ b/node_modules/protobufjs/src/method.js @@ -0,0 +1,151 @@ +"use strict"; +module.exports = Method; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; + +var util = require("./util"); + +/** + * Constructs a new service method instance. + * @classdesc Reflected service method. + * @extends ReflectionObject + * @constructor + * @param {string} name Method name + * @param {string|undefined} type Method type, usually `"rpc"` + * @param {string} requestType Request message type + * @param {string} responseType Response message type + * @param {boolean|Object.} [requestStream] Whether the request is streamed + * @param {boolean|Object.} [responseStream] Whether the response is streamed + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this method + */ +function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) { + + /* istanbul ignore next */ + if (util.isObject(requestStream)) { + options = requestStream; + requestStream = responseStream = undefined; + } else if (util.isObject(responseStream)) { + options = responseStream; + responseStream = undefined; + } + + /* istanbul ignore if */ + if (!(type === undefined || util.isString(type))) + throw TypeError("type must be a string"); + + /* istanbul ignore if */ + if (!util.isString(requestType)) + throw TypeError("requestType must be a string"); + + /* istanbul ignore if */ + if (!util.isString(responseType)) + throw TypeError("responseType must be a string"); + + ReflectionObject.call(this, name, options); + + /** + * Method type. + * @type {string} + */ + this.type = type || "rpc"; // toJSON + + /** + * Request type. + * @type {string} + */ + this.requestType = requestType; // toJSON, marker + + /** + * Whether requests are streamed or not. + * @type {boolean|undefined} + */ + this.requestStream = requestStream ? true : undefined; // toJSON + + /** + * Response type. + * @type {string} + */ + this.responseType = responseType; // toJSON + + /** + * Whether responses are streamed or not. + * @type {boolean|undefined} + */ + this.responseStream = responseStream ? true : undefined; // toJSON + + /** + * Resolved request type. + * @type {Type|null} + */ + this.resolvedRequestType = null; + + /** + * Resolved response type. + * @type {Type|null} + */ + this.resolvedResponseType = null; + + /** + * Comment for this method + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Method descriptor. + * @interface IMethod + * @property {string} [type="rpc"] Method type + * @property {string} requestType Request type + * @property {string} responseType Response type + * @property {boolean} [requestStream=false] Whether requests are streamed + * @property {boolean} [responseStream=false] Whether responses are streamed + * @property {Object.} [options] Method options + */ + +/** + * Constructs a method from a method descriptor. + * @param {string} name Method name + * @param {IMethod} json Method descriptor + * @returns {Method} Created method + * @throws {TypeError} If arguments are invalid + */ +Method.fromJSON = function fromJSON(name, json) { + return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment); +}; + +/** + * Converts this method to a method descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMethod} Method descriptor + */ +Method.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, + "requestType" , this.requestType, + "requestStream" , this.requestStream, + "responseType" , this.responseType, + "responseStream" , this.responseStream, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Method.prototype.resolve = function resolve() { + + /* istanbul ignore if */ + if (this.resolved) + return this; + + this.resolvedRequestType = this.parent.lookupType(this.requestType); + this.resolvedResponseType = this.parent.lookupType(this.responseType); + + return ReflectionObject.prototype.resolve.call(this); +}; diff --git a/node_modules/protobufjs/src/namespace.js b/node_modules/protobufjs/src/namespace.js new file mode 100644 index 0000000..cb5f355 --- /dev/null +++ b/node_modules/protobufjs/src/namespace.js @@ -0,0 +1,433 @@ +"use strict"; +module.exports = Namespace; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; + +var Field = require("./field"), + util = require("./util"); + +var Type, // cyclic + Service, + Enum; + +/** + * Constructs a new namespace instance. + * @name Namespace + * @classdesc Reflected namespace. + * @extends NamespaceBase + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a namespace from JSON. + * @memberof Namespace + * @function + * @param {string} name Namespace name + * @param {Object.} json JSON object + * @returns {Namespace} Created namespace + * @throws {TypeError} If arguments are invalid + */ +Namespace.fromJSON = function fromJSON(name, json) { + return new Namespace(name, json.options).addJSON(json.nested); +}; + +/** + * Converts an array of reflection objects to JSON. + * @memberof Namespace + * @param {ReflectionObject[]} array Object array + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {Object.|undefined} JSON object or `undefined` when array is empty + */ +function arrayToJSON(array, toJSONOptions) { + if (!(array && array.length)) + return undefined; + var obj = {}; + for (var i = 0; i < array.length; ++i) + obj[array[i].name] = array[i].toJSON(toJSONOptions); + return obj; +} + +Namespace.arrayToJSON = arrayToJSON; + +/** + * Tests if the specified id is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedId = function isReservedId(reserved, id) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] >= id) + return true; + return false; +}; + +/** + * Tests if the specified name is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedName = function isReservedName(reserved, name) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (reserved[i] === name) + return true; + return false; +}; + +/** + * Not an actual constructor. Use {@link Namespace} instead. + * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. + * @exports NamespaceBase + * @extends ReflectionObject + * @abstract + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + * @see {@link Namespace} + */ +function Namespace(name, options) { + ReflectionObject.call(this, name, options); + + /** + * Nested objects by name. + * @type {Object.|undefined} + */ + this.nested = undefined; // toJSON + + /** + * Cached nested objects as an array. + * @type {ReflectionObject[]|null} + * @private + */ + this._nestedArray = null; +} + +function clearCache(namespace) { + namespace._nestedArray = null; + return namespace; +} + +/** + * Nested objects of this namespace as an array for iteration. + * @name NamespaceBase#nestedArray + * @type {ReflectionObject[]} + * @readonly + */ +Object.defineProperty(Namespace.prototype, "nestedArray", { + get: function() { + return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); + } +}); + +/** + * Namespace descriptor. + * @interface INamespace + * @property {Object.} [options] Namespace options + * @property {Object.} [nested] Nested object descriptors + */ + +/** + * Any extension field descriptor. + * @typedef AnyExtensionField + * @type {IExtensionField|IExtensionMapField} + */ + +/** + * Any nested object descriptor. + * @typedef AnyNestedObject + * @type {IEnum|IType|IService|AnyExtensionField|INamespace} + */ +// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place) + +/** + * Converts this namespace to a namespace descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {INamespace} Namespace descriptor + */ +Namespace.prototype.toJSON = function toJSON(toJSONOptions) { + return util.toObject([ + "options" , this.options, + "nested" , arrayToJSON(this.nestedArray, toJSONOptions) + ]); +}; + +/** + * Adds nested objects to this namespace from nested object descriptors. + * @param {Object.} nestedJson Any nested object descriptors + * @returns {Namespace} `this` + */ +Namespace.prototype.addJSON = function addJSON(nestedJson) { + var ns = this; + /* istanbul ignore else */ + if (nestedJson) { + for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { + nested = nestedJson[names[i]]; + ns.add( // most to least likely + ( nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : nested.id !== undefined + ? Field.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + } + return this; +}; + +/** + * Gets the nested object of the specified name. + * @param {string} name Nested object name + * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist + */ +Namespace.prototype.get = function get(name) { + return this.nested && this.nested[name] + || null; +}; + +/** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param {string} name Nested enum name + * @returns {Object.} Enum values + * @throws {Error} If there is no such enum + */ +Namespace.prototype.getEnum = function getEnum(name) { + if (this.nested && this.nested[name] instanceof Enum) + return this.nested[name].values; + throw Error("no such enum: " + name); +}; + +/** + * Adds a nested object to this namespace. + * @param {ReflectionObject} object Nested object to add + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ +Namespace.prototype.add = function add(object) { + + if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace)) + throw TypeError("object must be a valid nested object"); + + if (!this.nested) + this.nested = {}; + else { + var prev = this.get(object.name); + if (prev) { + if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { + // replace plain namespace but keep existing nested elements and options + var nested = prev.nestedArray; + for (var i = 0; i < nested.length; ++i) + object.add(nested[i]); + this.remove(prev); + if (!this.nested) + this.nested = {}; + object.setOptions(prev.options, true); + + } else + throw Error("duplicate name '" + object.name + "' in " + this); + } + } + this.nested[object.name] = object; + object.onAdd(this); + return clearCache(this); +}; + +/** + * Removes a nested object from this namespace. + * @param {ReflectionObject} object Nested object to remove + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ +Namespace.prototype.remove = function remove(object) { + + if (!(object instanceof ReflectionObject)) + throw TypeError("object must be a ReflectionObject"); + if (object.parent !== this) + throw Error(object + " is not a member of " + this); + + delete this.nested[object.name]; + if (!Object.keys(this.nested).length) + this.nested = undefined; + + object.onRemove(this); + return clearCache(this); +}; + +/** + * Defines additial namespaces within this one if not yet existing. + * @param {string|string[]} path Path to create + * @param {*} [json] Nested types to create from JSON + * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty + */ +Namespace.prototype.define = function define(path, json) { + + if (util.isString(path)) + path = path.split("."); + else if (!Array.isArray(path)) + throw TypeError("illegal path"); + if (path && path.length && path[0] === "") + throw Error("path must be relative"); + + var ptr = this; + while (path.length > 0) { + var part = path.shift(); + if (ptr.nested && ptr.nested[part]) { + ptr = ptr.nested[part]; + if (!(ptr instanceof Namespace)) + throw Error("path conflicts with non-namespace objects"); + } else + ptr.add(ptr = new Namespace(part)); + } + if (json) + ptr.addJSON(json); + return ptr; +}; + +/** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns {Namespace} `this` + */ +Namespace.prototype.resolveAll = function resolveAll() { + var nested = this.nestedArray, i = 0; + while (i < nested.length) + if (nested[i] instanceof Namespace) + nested[i++].resolveAll(); + else + nested[i++].resolve(); + return this.resolve(); +}; + +/** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param {string|string[]} path Path to look up + * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + */ +Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { + + /* istanbul ignore next */ + if (typeof filterTypes === "boolean") { + parentAlreadyChecked = filterTypes; + filterTypes = undefined; + } else if (filterTypes && !Array.isArray(filterTypes)) + filterTypes = [ filterTypes ]; + + if (util.isString(path) && path.length) { + if (path === ".") + return this.root; + path = path.split("."); + } else if (!path.length) + return this; + + // Start at root if path is absolute + if (path[0] === "") + return this.root.lookup(path.slice(1), filterTypes); + + // Test if the first part matches any nested object, and if so, traverse if path contains more + var found = this.get(path[0]); + if (found) { + if (path.length === 1) { + if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) + return found; + } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) + return found; + + // Otherwise try each nested namespace + } else + for (var i = 0; i < this.nestedArray.length; ++i) + if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) + return found; + + // If there hasn't been a match, try again at the parent + if (this.parent === null || parentAlreadyChecked) + return null; + return this.parent.lookup(path, filterTypes); +}; + +/** + * Looks up the reflection object at the specified path, relative to this namespace. + * @name NamespaceBase#lookup + * @function + * @param {string|string[]} path Path to look up + * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + * @variation 2 + */ +// lookup(path: string, [parentAlreadyChecked: boolean]) + +/** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type + * @throws {Error} If `path` does not point to a type + */ +Namespace.prototype.lookupType = function lookupType(path) { + var found = this.lookup(path, [ Type ]); + if (!found) + throw Error("no such type: " + path); + return found; +}; + +/** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Enum} Looked up enum + * @throws {Error} If `path` does not point to an enum + */ +Namespace.prototype.lookupEnum = function lookupEnum(path) { + var found = this.lookup(path, [ Enum ]); + if (!found) + throw Error("no such Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ +Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { + var found = this.lookup(path, [ Type, Enum ]); + if (!found) + throw Error("no such Type or Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Service} Looked up service + * @throws {Error} If `path` does not point to a service + */ +Namespace.prototype.lookupService = function lookupService(path) { + var found = this.lookup(path, [ Service ]); + if (!found) + throw Error("no such Service '" + path + "' in " + this); + return found; +}; + +// Sets up cyclic dependencies (called in index-light) +Namespace._configure = function(Type_, Service_, Enum_) { + Type = Type_; + Service = Service_; + Enum = Enum_; +}; diff --git a/node_modules/protobufjs/src/object.js b/node_modules/protobufjs/src/object.js new file mode 100644 index 0000000..b6a5e56 --- /dev/null +++ b/node_modules/protobufjs/src/object.js @@ -0,0 +1,200 @@ +"use strict"; +module.exports = ReflectionObject; + +ReflectionObject.className = "ReflectionObject"; + +var util = require("./util"); + +var Root; // cyclic + +/** + * Constructs a new reflection object instance. + * @classdesc Base class of all reflection objects. + * @constructor + * @param {string} name Object name + * @param {Object.} [options] Declared options + * @abstract + */ +function ReflectionObject(name, options) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (options && !util.isObject(options)) + throw TypeError("options must be an object"); + + /** + * Options. + * @type {Object.|undefined} + */ + this.options = options; // toJSON + + /** + * Unique name within its namespace. + * @type {string} + */ + this.name = name; + + /** + * Parent namespace. + * @type {Namespace|null} + */ + this.parent = null; + + /** + * Whether already resolved or not. + * @type {boolean} + */ + this.resolved = false; + + /** + * Comment text, if any. + * @type {string|null} + */ + this.comment = null; + + /** + * Defining file name. + * @type {string|null} + */ + this.filename = null; +} + +Object.defineProperties(ReflectionObject.prototype, { + + /** + * Reference to the root namespace. + * @name ReflectionObject#root + * @type {Root} + * @readonly + */ + root: { + get: function() { + var ptr = this; + while (ptr.parent !== null) + ptr = ptr.parent; + return ptr; + } + }, + + /** + * Full name including leading dot. + * @name ReflectionObject#fullName + * @type {string} + * @readonly + */ + fullName: { + get: function() { + var path = [ this.name ], + ptr = this.parent; + while (ptr) { + path.unshift(ptr.name); + ptr = ptr.parent; + } + return path.join("."); + } + } +}); + +/** + * Converts this reflection object to its descriptor representation. + * @returns {Object.} Descriptor + * @abstract + */ +ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { + throw Error(); // not implemented, shouldn't happen +}; + +/** + * Called when this object is added to a parent. + * @param {ReflectionObject} parent Parent added to + * @returns {undefined} + */ +ReflectionObject.prototype.onAdd = function onAdd(parent) { + if (this.parent && this.parent !== parent) + this.parent.remove(this); + this.parent = parent; + this.resolved = false; + var root = parent.root; + if (root instanceof Root) + root._handleAdd(this); +}; + +/** + * Called when this object is removed from a parent. + * @param {ReflectionObject} parent Parent removed from + * @returns {undefined} + */ +ReflectionObject.prototype.onRemove = function onRemove(parent) { + var root = parent.root; + if (root instanceof Root) + root._handleRemove(this); + this.parent = null; + this.resolved = false; +}; + +/** + * Resolves this objects type references. + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.resolve = function resolve() { + if (this.resolved) + return this; + if (this.root instanceof Root) + this.resolved = true; // only if part of a root + return this; +}; + +/** + * Gets an option value. + * @param {string} name Option name + * @returns {*} Option value or `undefined` if not set + */ +ReflectionObject.prototype.getOption = function getOption(name) { + if (this.options) + return this.options[name]; + return undefined; +}; + +/** + * Sets an option. + * @param {string} name Option name + * @param {*} value Option value + * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { + if (!ifNotSet || !this.options || this.options[name] === undefined) + (this.options || (this.options = {}))[name] = value; + return this; +}; + +/** + * Sets multiple options. + * @param {Object.} options Options to set + * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { + if (options) + for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) + this.setOption(keys[i], options[keys[i]], ifNotSet); + return this; +}; + +/** + * Converts this instance to its string representation. + * @returns {string} Class name[, space, full name] + */ +ReflectionObject.prototype.toString = function toString() { + var className = this.constructor.className, + fullName = this.fullName; + if (fullName.length) + return className + " " + fullName; + return className; +}; + +// Sets up cyclic dependencies (called in index-light) +ReflectionObject._configure = function(Root_) { + Root = Root_; +}; diff --git a/node_modules/protobufjs/src/oneof.js b/node_modules/protobufjs/src/oneof.js new file mode 100644 index 0000000..ba0e902 --- /dev/null +++ b/node_modules/protobufjs/src/oneof.js @@ -0,0 +1,203 @@ +"use strict"; +module.exports = OneOf; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; + +var Field = require("./field"), + util = require("./util"); + +/** + * Constructs a new oneof instance. + * @classdesc Reflected oneof. + * @extends ReflectionObject + * @constructor + * @param {string} name Oneof name + * @param {string[]|Object.} [fieldNames] Field names + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function OneOf(name, fieldNames, options, comment) { + if (!Array.isArray(fieldNames)) { + options = fieldNames; + fieldNames = undefined; + } + ReflectionObject.call(this, name, options); + + /* istanbul ignore if */ + if (!(fieldNames === undefined || Array.isArray(fieldNames))) + throw TypeError("fieldNames must be an Array"); + + /** + * Field names that belong to this oneof. + * @type {string[]} + */ + this.oneof = fieldNames || []; // toJSON, marker + + /** + * Fields that belong to this oneof as an array for iteration. + * @type {Field[]} + * @readonly + */ + this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Oneof descriptor. + * @interface IOneOf + * @property {Array.} oneof Oneof field names + * @property {Object.} [options] Oneof options + */ + +/** + * Constructs a oneof from a oneof descriptor. + * @param {string} name Oneof name + * @param {IOneOf} json Oneof descriptor + * @returns {OneOf} Created oneof + * @throws {TypeError} If arguments are invalid + */ +OneOf.fromJSON = function fromJSON(name, json) { + return new OneOf(name, json.oneof, json.options, json.comment); +}; + +/** + * Converts this oneof to a oneof descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IOneOf} Oneof descriptor + */ +OneOf.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "oneof" , this.oneof, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Adds the fields of the specified oneof to the parent if not already done so. + * @param {OneOf} oneof The oneof + * @returns {undefined} + * @inner + * @ignore + */ +function addFieldsToParent(oneof) { + if (oneof.parent) + for (var i = 0; i < oneof.fieldsArray.length; ++i) + if (!oneof.fieldsArray[i].parent) + oneof.parent.add(oneof.fieldsArray[i]); +} + +/** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param {Field} field Field to add + * @returns {OneOf} `this` + */ +OneOf.prototype.add = function add(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + if (field.parent && field.parent !== this.parent) + field.parent.remove(field); + this.oneof.push(field.name); + this.fieldsArray.push(field); + field.partOf = this; // field.parent remains null + addFieldsToParent(this); + return this; +}; + +/** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param {Field} field Field to remove + * @returns {OneOf} `this` + */ +OneOf.prototype.remove = function remove(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + var index = this.fieldsArray.indexOf(field); + + /* istanbul ignore if */ + if (index < 0) + throw Error(field + " is not a member of " + this); + + this.fieldsArray.splice(index, 1); + index = this.oneof.indexOf(field.name); + + /* istanbul ignore else */ + if (index > -1) // theoretical + this.oneof.splice(index, 1); + + field.partOf = null; + return this; +}; + +/** + * @override + */ +OneOf.prototype.onAdd = function onAdd(parent) { + ReflectionObject.prototype.onAdd.call(this, parent); + var self = this; + // Collect present fields + for (var i = 0; i < this.oneof.length; ++i) { + var field = parent.get(this.oneof[i]); + if (field && !field.partOf) { + field.partOf = self; + self.fieldsArray.push(field); + } + } + // Add not yet present fields + addFieldsToParent(this); +}; + +/** + * @override + */ +OneOf.prototype.onRemove = function onRemove(parent) { + for (var i = 0, field; i < this.fieldsArray.length; ++i) + if ((field = this.fieldsArray[i]).parent) + field.parent.remove(field); + ReflectionObject.prototype.onRemove.call(this, parent); +}; + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @typedef OneOfDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} oneofName OneOf name + * @returns {undefined} + */ + +/** + * OneOf decorator (TypeScript). + * @function + * @param {...string} fieldNames Field names + * @returns {OneOfDecorator} Decorator function + * @template T extends string + */ +OneOf.d = function decorateOneOf() { + var fieldNames = new Array(arguments.length), + index = 0; + while (index < arguments.length) + fieldNames[index] = arguments[index++]; + return function oneOfDecorator(prototype, oneofName) { + util.decorateType(prototype.constructor) + .add(new OneOf(oneofName, fieldNames)); + Object.defineProperty(prototype, oneofName, { + get: util.oneOfGetter(fieldNames), + set: util.oneOfSetter(fieldNames) + }); + }; +}; diff --git a/node_modules/protobufjs/src/parse.js b/node_modules/protobufjs/src/parse.js new file mode 100644 index 0000000..c0059ef --- /dev/null +++ b/node_modules/protobufjs/src/parse.js @@ -0,0 +1,758 @@ +"use strict"; +module.exports = parse; + +parse.filename = null; +parse.defaults = { keepCase: false }; + +var tokenize = require("./tokenize"), + Root = require("./root"), + Type = require("./type"), + Field = require("./field"), + MapField = require("./mapfield"), + OneOf = require("./oneof"), + Enum = require("./enum"), + Service = require("./service"), + Method = require("./method"), + types = require("./types"), + util = require("./util"); + +var base10Re = /^[1-9][0-9]*$/, + base10NegRe = /^-?[1-9][0-9]*$/, + base16Re = /^0[x][0-9a-fA-F]+$/, + base16NegRe = /^-?0[x][0-9a-fA-F]+$/, + base8Re = /^0[0-7]+$/, + base8NegRe = /^-?0[0-7]+$/, + numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, + nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, + typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, + fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/; + +/** + * Result object returned from {@link parse}. + * @interface IParserResult + * @property {string|undefined} package Package name, if declared + * @property {string[]|undefined} imports Imports, if any + * @property {string[]|undefined} weakImports Weak imports, if any + * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`) + * @property {Root} root Populated root instance + */ + +/** + * Options modifying the behavior of {@link parse}. + * @interface IParseOptions + * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case + * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments. + */ + +/** + * Options modifying the behavior of JSON serialization. + * @interface IToJSONOptions + * @property {boolean} [keepComments=false] Serializes comments. + */ + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @param {string} source Source contents + * @param {Root} root Root to populate + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + */ +function parse(source, root, options) { + /* eslint-disable callback-return */ + if (!(root instanceof Root)) { + options = root; + root = new Root(); + } + if (!options) + options = parse.defaults; + + var tn = tokenize(source, options.alternateCommentMode || false), + next = tn.next, + push = tn.push, + peek = tn.peek, + skip = tn.skip, + cmnt = tn.cmnt; + + var head = true, + pkg, + imports, + weakImports, + syntax, + isProto3 = false; + + var ptr = root; + + var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase; + + /* istanbul ignore next */ + function illegal(token, name, insideTryCatch) { + var filename = parse.filename; + if (!insideTryCatch) + parse.filename = null; + return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); + } + + function readString() { + var values = [], + token; + do { + /* istanbul ignore if */ + if ((token = next()) !== "\"" && token !== "'") + throw illegal(token); + + values.push(next()); + skip(token); + token = peek(); + } while (token === "\"" || token === "'"); + return values.join(""); + } + + function readValue(acceptTypeRef) { + var token = next(); + switch (token) { + case "'": + case "\"": + push(token); + return readString(); + case "true": case "TRUE": + return true; + case "false": case "FALSE": + return false; + } + try { + return parseNumber(token, /* insideTryCatch */ true); + } catch (e) { + + /* istanbul ignore else */ + if (acceptTypeRef && typeRefRe.test(token)) + return token; + + /* istanbul ignore next */ + throw illegal(token, "value"); + } + } + + function readRanges(target, acceptStrings) { + var token, start; + do { + if (acceptStrings && ((token = peek()) === "\"" || token === "'")) + target.push(readString()); + else + target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]); + } while (skip(",", true)); + skip(";"); + } + + function parseNumber(token, insideTryCatch) { + var sign = 1; + if (token.charAt(0) === "-") { + sign = -1; + token = token.substring(1); + } + switch (token) { + case "inf": case "INF": case "Inf": + return sign * Infinity; + case "nan": case "NAN": case "Nan": case "NaN": + return NaN; + case "0": + return 0; + } + if (base10Re.test(token)) + return sign * parseInt(token, 10); + if (base16Re.test(token)) + return sign * parseInt(token, 16); + if (base8Re.test(token)) + return sign * parseInt(token, 8); + + /* istanbul ignore else */ + if (numberRe.test(token)) + return sign * parseFloat(token); + + /* istanbul ignore next */ + throw illegal(token, "number", insideTryCatch); + } + + function parseId(token, acceptNegative) { + switch (token) { + case "max": case "MAX": case "Max": + return 536870911; + case "0": + return 0; + } + + /* istanbul ignore if */ + if (!acceptNegative && token.charAt(0) === "-") + throw illegal(token, "id"); + + if (base10NegRe.test(token)) + return parseInt(token, 10); + if (base16NegRe.test(token)) + return parseInt(token, 16); + + /* istanbul ignore else */ + if (base8NegRe.test(token)) + return parseInt(token, 8); + + /* istanbul ignore next */ + throw illegal(token, "id"); + } + + function parsePackage() { + + /* istanbul ignore if */ + if (pkg !== undefined) + throw illegal("package"); + + pkg = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(pkg)) + throw illegal(pkg, "name"); + + ptr = ptr.define(pkg); + skip(";"); + } + + function parseImport() { + var token = peek(); + var whichImports; + switch (token) { + case "weak": + whichImports = weakImports || (weakImports = []); + next(); + break; + case "public": + next(); + // eslint-disable-line no-fallthrough + default: + whichImports = imports || (imports = []); + break; + } + token = readString(); + skip(";"); + whichImports.push(token); + } + + function parseSyntax() { + skip("="); + syntax = readString(); + isProto3 = syntax === "proto3"; + + /* istanbul ignore if */ + if (!isProto3 && syntax !== "proto2") + throw illegal(syntax, "syntax"); + + skip(";"); + } + + function parseCommon(parent, token) { + switch (token) { + + case "option": + parseOption(parent, token); + skip(";"); + return true; + + case "message": + parseType(parent, token); + return true; + + case "enum": + parseEnum(parent, token); + return true; + + case "service": + parseService(parent, token); + return true; + + case "extend": + parseExtension(parent, token); + return true; + } + return false; + } + + function ifBlock(obj, fnIf, fnElse) { + var trailingLine = tn.line; + if (obj) { + obj.comment = cmnt(); // try block-type comment + obj.filename = parse.filename; + } + if (skip("{", true)) { + var token; + while ((token = next()) !== "}") + fnIf(token); + skip(";", true); + } else { + if (fnElse) + fnElse(); + skip(";"); + if (obj && typeof obj.comment !== "string") + obj.comment = cmnt(trailingLine); // try line-type comment if no block + } + } + + function parseType(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "type name"); + + var type = new Type(token); + ifBlock(type, function parseType_block(token) { + if (parseCommon(type, token)) + return; + + switch (token) { + + case "map": + parseMapField(type, token); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + case "oneof": + parseOneOf(type, token); + break; + + case "extensions": + readRanges(type.extensions || (type.extensions = [])); + break; + + case "reserved": + readRanges(type.reserved || (type.reserved = []), true); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + + push(token); + parseField(type, "optional"); + break; + } + }); + parent.add(type); + } + + function parseField(parent, rule, extend) { + var type = next(); + if (type === "group") { + parseGroup(parent, rule); + return; + } + + /* istanbul ignore if */ + if (!typeRefRe.test(type)) + throw illegal(type, "type"); + + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + name = applyCase(name); + skip("="); + + var field = new Field(name, parseId(next()), type, rule, extend); + ifBlock(field, function parseField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseField_line() { + parseInlineOptions(field); + }); + parent.add(field); + + // JSON defaults to packed=true if not set so we have to set packed=false explicity when + // parsing proto2 descriptors without the option, where applicable. This must be done for + // all known packable types and anything that could be an enum (= is not a basic type). + if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined)) + field.setOption("packed", false, /* ifNotSet */ true); + } + + function parseGroup(parent, rule) { + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + var fieldName = util.lcFirst(name); + if (name === fieldName) + name = util.ucFirst(name); + skip("="); + var id = parseId(next()); + var type = new Type(name); + type.group = true; + var field = new Field(fieldName, id, name, rule); + field.filename = parse.filename; + ifBlock(type, function parseGroup_block(token) { + switch (token) { + + case "option": + parseOption(type, token); + skip(";"); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + /* istanbul ignore next */ + default: + throw illegal(token); // there are no groups with proto3 semantics + } + }); + parent.add(type) + .add(field); + } + + function parseMapField(parent) { + skip("<"); + var keyType = next(); + + /* istanbul ignore if */ + if (types.mapKey[keyType] === undefined) + throw illegal(keyType, "type"); + + skip(","); + var valueType = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(valueType)) + throw illegal(valueType, "type"); + + skip(">"); + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + skip("="); + var field = new MapField(applyCase(name), parseId(next()), keyType, valueType); + ifBlock(field, function parseMapField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseMapField_line() { + parseInlineOptions(field); + }); + parent.add(field); + } + + function parseOneOf(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var oneof = new OneOf(applyCase(token)); + ifBlock(oneof, function parseOneOf_block(token) { + if (token === "option") { + parseOption(oneof, token); + skip(";"); + } else { + push(token); + parseField(oneof, "optional"); + } + }); + parent.add(oneof); + } + + function parseEnum(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var enm = new Enum(token); + ifBlock(enm, function parseEnum_block(token) { + switch(token) { + case "option": + parseOption(enm, token); + skip(";"); + break; + + case "reserved": + readRanges(enm.reserved || (enm.reserved = []), true); + break; + + default: + parseEnumValue(enm, token); + } + }); + parent.add(enm); + } + + function parseEnumValue(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token)) + throw illegal(token, "name"); + + skip("="); + var value = parseId(next(), true), + dummy = {}; + ifBlock(dummy, function parseEnumValue_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(dummy, token); // skip + skip(";"); + } else + throw illegal(token); + + }, function parseEnumValue_line() { + parseInlineOptions(dummy); // skip + }); + parent.add(token, value, dummy.comment); + } + + function parseOption(parent, token) { + var isCustom = skip("(", true); + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "name"); + + var name = token; + if (isCustom) { + skip(")"); + name = "(" + name + ")"; + token = peek(); + if (fqTypeRefRe.test(token)) { + name += token; + next(); + } + } + skip("="); + parseOptionValue(parent, name); + } + + function parseOptionValue(parent, name) { + if (skip("{", true)) { // { a: "foo" b { c: "bar" } } + do { + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + if (peek() === "{") + parseOptionValue(parent, name + "." + token); + else { + skip(":"); + if (peek() === "{") + parseOptionValue(parent, name + "." + token); + else + setOption(parent, name + "." + token, readValue(true)); + } + skip(",", true); + } while (!skip("}", true)); + } else + setOption(parent, name, readValue(true)); + // Does not enforce a delimiter to be universal + } + + function setOption(parent, name, value) { + if (parent.setOption) + parent.setOption(name, value); + } + + function parseInlineOptions(parent) { + if (skip("[", true)) { + do { + parseOption(parent, "option"); + } while (skip(",", true)); + skip("]"); + } + return parent; + } + + function parseService(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "service name"); + + var service = new Service(token); + ifBlock(service, function parseService_block(token) { + if (parseCommon(service, token)) + return; + + /* istanbul ignore else */ + if (token === "rpc") + parseMethod(service, token); + else + throw illegal(token); + }); + parent.add(service); + } + + function parseMethod(parent, token) { + var type = token; + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var name = token, + requestType, requestStream, + responseType, responseStream; + + skip("("); + if (skip("stream", true)) + requestStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + requestType = token; + skip(")"); skip("returns"); skip("("); + if (skip("stream", true)) + responseStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + responseType = token; + skip(")"); + + var method = new Method(name, type, requestType, responseType, requestStream, responseStream); + ifBlock(method, function parseMethod_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(method, token); + skip(";"); + } else + throw illegal(token); + + }); + parent.add(method); + } + + function parseExtension(parent, token) { + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "reference"); + + var reference = token; + ifBlock(null, function parseExtension_block(token) { + switch (token) { + + case "required": + case "repeated": + case "optional": + parseField(parent, token, reference); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + push(token); + parseField(parent, "optional", reference); + break; + } + }); + } + + var token; + while ((token = next()) !== null) { + switch (token) { + + case "package": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parsePackage(); + break; + + case "import": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseImport(); + break; + + case "syntax": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseSyntax(); + break; + + case "option": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseOption(ptr, token); + skip(";"); + break; + + default: + + /* istanbul ignore else */ + if (parseCommon(ptr, token)) { + head = false; + continue; + } + + /* istanbul ignore next */ + throw illegal(token); + } + } + + parse.filename = null; + return { + "package" : pkg, + "imports" : imports, + weakImports : weakImports, + syntax : syntax, + root : root + }; +} + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @name parse + * @function + * @param {string} source Source contents + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + * @variation 2 + */ diff --git a/node_modules/protobufjs/src/reader.js b/node_modules/protobufjs/src/reader.js new file mode 100644 index 0000000..110cd71 --- /dev/null +++ b/node_modules/protobufjs/src/reader.js @@ -0,0 +1,405 @@ +"use strict"; +module.exports = Reader; + +var util = require("./util/minimal"); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; diff --git a/node_modules/protobufjs/src/reader_buffer.js b/node_modules/protobufjs/src/reader_buffer.js new file mode 100644 index 0000000..9518901 --- /dev/null +++ b/node_modules/protobufjs/src/reader_buffer.js @@ -0,0 +1,44 @@ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require("./reader"); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require("./util/minimal"); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +/* istanbul ignore else */ +if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ diff --git a/node_modules/protobufjs/src/root.js b/node_modules/protobufjs/src/root.js new file mode 100644 index 0000000..13be39d --- /dev/null +++ b/node_modules/protobufjs/src/root.js @@ -0,0 +1,351 @@ +"use strict"; +module.exports = Root; + +// extends Namespace +var Namespace = require("./namespace"); +((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; + +var Field = require("./field"), + Enum = require("./enum"), + OneOf = require("./oneof"), + util = require("./util"); + +var Type, // cyclic + parse, // might be excluded + common; // " + +/** + * Constructs a new root namespace instance. + * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. + * @extends NamespaceBase + * @constructor + * @param {Object.} [options] Top level options + */ +function Root(options) { + Namespace.call(this, "", options); + + /** + * Deferred extension fields. + * @type {Field[]} + */ + this.deferred = []; + + /** + * Resolved file names of loaded files. + * @type {string[]} + */ + this.files = []; +} + +/** + * Loads a namespace descriptor into a root namespace. + * @param {INamespace} json Nameespace descriptor + * @param {Root} [root] Root namespace, defaults to create a new one if omitted + * @returns {Root} Root namespace + */ +Root.fromJSON = function fromJSON(json, root) { + if (!root) + root = new Root(); + if (json.options) + root.setOptions(json.options); + return root.addJSON(json.nested); +}; + +/** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @function + * @param {string} origin The file name of the importing file + * @param {string} target The file name being imported + * @returns {string|null} Resolved path to `target` or `null` to skip the file + */ +Root.prototype.resolvePath = util.path.resolve; + +// A symbol-like function to safely signal synchronous loading +/* istanbul ignore next */ +function SYNC() {} // eslint-disable-line no-empty-function + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} options Parse options + * @param {LoadCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.load = function load(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + var self = this; + if (!callback) + return util.asPromise(load, self, filename, options); + + var sync = callback === SYNC; // undocumented + + // Finishes loading by calling the callback (exactly once) + function finish(err, root) { + /* istanbul ignore if */ + if (!callback) + return; + var cb = callback; + callback = null; + if (sync) + throw err; + cb(err, root); + } + + // Processes a single file + function process(filename, source) { + try { + if (util.isString(source) && source.charAt(0) === "{") + source = JSON.parse(source); + if (!util.isString(source)) + self.setOptions(source.options).addJSON(source.nested); + else { + parse.filename = filename; + var parsed = parse(source, self, options), + resolved, + i = 0; + if (parsed.imports) + for (; i < parsed.imports.length; ++i) + if (resolved = self.resolvePath(filename, parsed.imports[i])) + fetch(resolved); + if (parsed.weakImports) + for (i = 0; i < parsed.weakImports.length; ++i) + if (resolved = self.resolvePath(filename, parsed.weakImports[i])) + fetch(resolved, true); + } + } catch (err) { + finish(err); + } + if (!sync && !queued) + finish(null, self); // only once anyway + } + + // Fetches a single file + function fetch(filename, weak) { + + // Strip path if this file references a bundled definition + var idx = filename.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = filename.substring(idx); + if (altname in common) + filename = altname; + } + + // Skip if already loaded / attempted + if (self.files.indexOf(filename) > -1) + return; + self.files.push(filename); + + // Shortcut bundled definitions + if (filename in common) { + if (sync) + process(filename, common[filename]); + else { + ++queued; + setTimeout(function() { + --queued; + process(filename, common[filename]); + }); + } + return; + } + + // Otherwise fetch from disk or network + if (sync) { + var source; + try { + source = util.fs.readFileSync(filename).toString("utf8"); + } catch (err) { + if (!weak) + finish(err); + return; + } + process(filename, source); + } else { + ++queued; + util.fetch(filename, function(err, source) { + --queued; + /* istanbul ignore if */ + if (!callback) + return; // terminated meanwhile + if (err) { + /* istanbul ignore else */ + if (!weak) + finish(err); + else if (!queued) // can't be covered reliably + finish(null, self); + return; + } + process(filename, source); + }); + } + } + var queued = 0; + + // Assembling the root namespace doesn't require working type + // references anymore, so we can load everything in parallel + if (util.isString(filename)) + filename = [ filename ]; + for (var i = 0, resolved; i < filename.length; ++i) + if (resolved = self.resolvePath("", filename[i])) + fetch(resolved); + + if (sync) + return self; + if (!queued) + finish(null, self); + return undefined; +}; +// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Promise} Promise + * @variation 3 + */ +// function load(filename:string, [options:IParseOptions]):Promise + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @function Root#loadSync + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ +Root.prototype.loadSync = function loadSync(filename, options) { + if (!util.isNode) + throw Error("not supported"); + return this.load(filename, options, SYNC); +}; + +/** + * @override + */ +Root.prototype.resolveAll = function resolveAll() { + if (this.deferred.length) + throw Error("unresolvable extensions: " + this.deferred.map(function(field) { + return "'extend " + field.extend + "' in " + field.parent.fullName; + }).join(", ")); + return Namespace.prototype.resolveAll.call(this); +}; + +// only uppercased (and thus conflict-free) children are exposed, see below +var exposeRe = /^[A-Z]/; + +/** + * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. + * @param {Root} root Root instance + * @param {Field} field Declaring extension field witin the declaring type + * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise + * @inner + * @ignore + */ +function tryHandleExtension(root, field) { + var extendedType = field.parent.lookup(field.extend); + if (extendedType) { + var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); + sisterField.declaringField = field; + field.extensionField = sisterField; + extendedType.add(sisterField); + return true; + } + return false; +} + +/** + * Called when any object is added to this root or its sub-namespaces. + * @param {ReflectionObject} object Object added + * @returns {undefined} + * @private + */ +Root.prototype._handleAdd = function _handleAdd(object) { + if (object instanceof Field) { + + if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) + if (!tryHandleExtension(this, object)) + this.deferred.push(object); + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + object.parent[object.name] = object.values; // expose enum values as property of its parent + + } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { + + if (object instanceof Type) // Try to handle any deferred extensions + for (var i = 0; i < this.deferred.length;) + if (tryHandleExtension(this, this.deferred[i])) + this.deferred.splice(i, 1); + else + ++i; + for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace + this._handleAdd(object._nestedArray[j]); + if (exposeRe.test(object.name)) + object.parent[object.name] = object; // expose namespace as property of its parent + } + + // The above also adds uppercased (and thus conflict-free) nested types, services and enums as + // properties of namespaces just like static code does. This allows using a .d.ts generated for + // a static module with reflection-based solutions where the condition is met. +}; + +/** + * Called when any object is removed from this root or its sub-namespaces. + * @param {ReflectionObject} object Object removed + * @returns {undefined} + * @private + */ +Root.prototype._handleRemove = function _handleRemove(object) { + if (object instanceof Field) { + + if (/* an extension field */ object.extend !== undefined) { + if (/* already handled */ object.extensionField) { // remove its sister field + object.extensionField.parent.remove(object.extensionField); + object.extensionField = null; + } else { // cancel the extension + var index = this.deferred.indexOf(object); + /* istanbul ignore else */ + if (index > -1) + this.deferred.splice(index, 1); + } + } + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose enum values + + } else if (object instanceof Namespace) { + + for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace + this._handleRemove(object._nestedArray[i]); + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose namespaces + + } +}; + +// Sets up cyclic dependencies (called in index-light) +Root._configure = function(Type_, parse_, common_) { + Type = Type_; + parse = parse_; + common = common_; +}; diff --git a/node_modules/protobufjs/src/roots.js b/node_modules/protobufjs/src/roots.js new file mode 100644 index 0000000..1921211 --- /dev/null +++ b/node_modules/protobufjs/src/roots.js @@ -0,0 +1,18 @@ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ diff --git a/node_modules/protobufjs/src/rpc.js b/node_modules/protobufjs/src/rpc.js new file mode 100644 index 0000000..894e5c7 --- /dev/null +++ b/node_modules/protobufjs/src/rpc.js @@ -0,0 +1,36 @@ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require("./rpc/service"); diff --git a/node_modules/protobufjs/src/rpc/service.js b/node_modules/protobufjs/src/rpc/service.js new file mode 100644 index 0000000..757f382 --- /dev/null +++ b/node_modules/protobufjs/src/rpc/service.js @@ -0,0 +1,142 @@ +"use strict"; +module.exports = Service; + +var util = require("../util/minimal"); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; diff --git a/node_modules/protobufjs/src/service.js b/node_modules/protobufjs/src/service.js new file mode 100644 index 0000000..bc2c308 --- /dev/null +++ b/node_modules/protobufjs/src/service.js @@ -0,0 +1,167 @@ +"use strict"; +module.exports = Service; + +// extends Namespace +var Namespace = require("./namespace"); +((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; + +var Method = require("./method"), + util = require("./util"), + rpc = require("./rpc"); + +/** + * Constructs a new service instance. + * @classdesc Reflected service. + * @extends NamespaceBase + * @constructor + * @param {string} name Service name + * @param {Object.} [options] Service options + * @throws {TypeError} If arguments are invalid + */ +function Service(name, options) { + Namespace.call(this, name, options); + + /** + * Service methods. + * @type {Object.} + */ + this.methods = {}; // toJSON, marker + + /** + * Cached methods as an array. + * @type {Method[]|null} + * @private + */ + this._methodsArray = null; +} + +/** + * Service descriptor. + * @interface IService + * @extends INamespace + * @property {Object.} methods Method descriptors + */ + +/** + * Constructs a service from a service descriptor. + * @param {string} name Service name + * @param {IService} json Service descriptor + * @returns {Service} Created service + * @throws {TypeError} If arguments are invalid + */ +Service.fromJSON = function fromJSON(name, json) { + var service = new Service(name, json.options); + /* istanbul ignore else */ + if (json.methods) + for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) + service.add(Method.fromJSON(names[i], json.methods[names[i]])); + if (json.nested) + service.addJSON(json.nested); + service.comment = json.comment; + return service; +}; + +/** + * Converts this service to a service descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IService} Service descriptor + */ +Service.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Methods of this service as an array for iteration. + * @name Service#methodsArray + * @type {Method[]} + * @readonly + */ +Object.defineProperty(Service.prototype, "methodsArray", { + get: function() { + return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); + } +}); + +function clearCache(service) { + service._methodsArray = null; + return service; +} + +/** + * @override + */ +Service.prototype.get = function get(name) { + return this.methods[name] + || Namespace.prototype.get.call(this, name); +}; + +/** + * @override + */ +Service.prototype.resolveAll = function resolveAll() { + var methods = this.methodsArray; + for (var i = 0; i < methods.length; ++i) + methods[i].resolve(); + return Namespace.prototype.resolve.call(this); +}; + +/** + * @override + */ +Service.prototype.add = function add(object) { + + /* istanbul ignore if */ + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Method) { + this.methods[object.name] = object; + object.parent = this; + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * @override + */ +Service.prototype.remove = function remove(object) { + if (object instanceof Method) { + + /* istanbul ignore if */ + if (this.methods[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.methods[object.name]; + object.parent = null; + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Creates a runtime service using the specified rpc implementation. + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. + */ +Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); + for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { + var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); + rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ + m: method, + q: method.resolvedRequestType.ctor, + s: method.resolvedResponseType.ctor + }); + } + return rpcService; +}; diff --git a/node_modules/protobufjs/src/tokenize.js b/node_modules/protobufjs/src/tokenize.js new file mode 100644 index 0000000..b939ef2 --- /dev/null +++ b/node_modules/protobufjs/src/tokenize.js @@ -0,0 +1,397 @@ +"use strict"; +module.exports = tokenize; + +var delimRe = /[\s{}=;:[\],'"()<>]/g, + stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; + +var setCommentRe = /^ *[*/]+ */, + setCommentAltRe = /^\s*\*?\/*/, + setCommentSplitRe = /\n/g, + whitespaceRe = /\s/, + unescapeRe = /\\(.?)/g; + +var unescapeMap = { + "0": "\0", + "r": "\r", + "n": "\n", + "t": "\t" +}; + +/** + * Unescapes a string. + * @param {string} str String to unescape + * @returns {string} Unescaped string + * @property {Object.} map Special characters map + * @memberof tokenize + */ +function unescape(str) { + return str.replace(unescapeRe, function($0, $1) { + switch ($1) { + case "\\": + case "": + return $1; + default: + return unescapeMap[$1] || ""; + } + }); +} + +tokenize.unescape = unescape; + +/** + * Gets the next token and advances. + * @typedef TokenizerHandleNext + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Peeks for the next token. + * @typedef TokenizerHandlePeek + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Pushes a token back to the stack. + * @typedef TokenizerHandlePush + * @type {function} + * @param {string} token Token + * @returns {undefined} + */ + +/** + * Skips the next token. + * @typedef TokenizerHandleSkip + * @type {function} + * @param {string} expected Expected token + * @param {boolean} [optional=false] If optional + * @returns {boolean} Whether the token matched + * @throws {Error} If the token didn't match and is not optional + */ + +/** + * Gets the comment on the previous line or, alternatively, the line comment on the specified line. + * @typedef TokenizerHandleCmnt + * @type {function} + * @param {number} [line] Line number + * @returns {string|null} Comment text or `null` if none + */ + +/** + * Handle object returned from {@link tokenize}. + * @interface ITokenizerHandle + * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof) + * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof) + * @property {TokenizerHandlePush} push Pushes a token back to the stack + * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws + * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any + * @property {number} line Current line number + */ + +/** + * Tokenizes the given .proto source and returns an object with useful utility functions. + * @param {string} source Source contents + * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode. + * @returns {ITokenizerHandle} Tokenizer handle + */ +function tokenize(source, alternateCommentMode) { + /* eslint-disable callback-return */ + source = source.toString(); + + var offset = 0, + length = source.length, + line = 1, + commentType = null, + commentText = null, + commentLine = 0, + commentLineEmpty = false; + + var stack = []; + + var stringDelim = null; + + /* istanbul ignore next */ + /** + * Creates an error for illegal syntax. + * @param {string} subject Subject + * @returns {Error} Error created + * @inner + */ + function illegal(subject) { + return Error("illegal " + subject + " (line " + line + ")"); + } + + /** + * Reads a string till its end. + * @returns {string} String read + * @inner + */ + function readString() { + var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe; + re.lastIndex = offset - 1; + var match = re.exec(source); + if (!match) + throw illegal("string"); + offset = re.lastIndex; + push(stringDelim); + stringDelim = null; + return unescape(match[1]); + } + + /** + * Gets the character at `pos` within the source. + * @param {number} pos Position + * @returns {string} Character + * @inner + */ + function charAt(pos) { + return source.charAt(pos); + } + + /** + * Sets the current comment text. + * @param {number} start Start offset + * @param {number} end End offset + * @returns {undefined} + * @inner + */ + function setComment(start, end) { + commentType = source.charAt(start++); + commentLine = line; + commentLineEmpty = false; + var lookback; + if (alternateCommentMode) { + lookback = 2; // alternate comment parsing: "//" or "/*" + } else { + lookback = 3; // "///" or "/**" + } + var commentOffset = start - lookback, + c; + do { + if (--commentOffset < 0 || + (c = source.charAt(commentOffset)) === "\n") { + commentLineEmpty = true; + break; + } + } while (c === " " || c === "\t"); + var lines = source + .substring(start, end) + .split(setCommentSplitRe); + for (var i = 0; i < lines.length; ++i) + lines[i] = lines[i] + .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "") + .trim(); + commentText = lines + .join("\n") + .trim(); + } + + function isDoubleSlashCommentLine(startOffset) { + var endOffset = findEndOfLine(startOffset); + + // see if remaining line matches comment pattern + var lineText = source.substring(startOffset, endOffset); + // look for 1 or 2 slashes since startOffset would already point past + // the first slash that started the comment. + var isComment = /^\s*\/{1,2}/.test(lineText); + return isComment; + } + + function findEndOfLine(cursor) { + // find end of cursor's line + var endOffset = cursor; + while (endOffset < length && charAt(endOffset) !== "\n") { + endOffset++; + } + return endOffset; + } + + /** + * Obtains the next token. + * @returns {string|null} Next token or `null` on eof + * @inner + */ + function next() { + if (stack.length > 0) + return stack.shift(); + if (stringDelim) + return readString(); + var repeat, + prev, + curr, + start, + isDoc; + do { + if (offset === length) + return null; + repeat = false; + while (whitespaceRe.test(curr = charAt(offset))) { + if (curr === "\n") + ++line; + if (++offset === length) + return null; + } + + if (charAt(offset) === "/") { + if (++offset === length) { + throw illegal("comment"); + } + if (charAt(offset) === "/") { // Line + if (!alternateCommentMode) { + // check for triple-slash comment + isDoc = charAt(start = offset + 1) === "/"; + + while (charAt(++offset) !== "\n") { + if (offset === length) { + return null; + } + } + ++offset; + if (isDoc) { + setComment(start, offset - 1); + } + ++line; + repeat = true; + } else { + // check for double-slash comments, consolidating consecutive lines + start = offset; + isDoc = false; + if (isDoubleSlashCommentLine(offset)) { + isDoc = true; + do { + offset = findEndOfLine(offset); + if (offset === length) { + break; + } + offset++; + } while (isDoubleSlashCommentLine(offset)); + } else { + offset = Math.min(length, findEndOfLine(offset) + 1); + } + if (isDoc) { + setComment(start, offset); + } + line++; + repeat = true; + } + } else if ((curr = charAt(offset)) === "*") { /* Block */ + // check for /** (regular comment mode) or /* (alternate comment mode) + start = offset + 1; + isDoc = alternateCommentMode || charAt(start) === "*"; + do { + if (curr === "\n") { + ++line; + } + if (++offset === length) { + throw illegal("comment"); + } + prev = curr; + curr = charAt(offset); + } while (prev !== "*" || curr !== "/"); + ++offset; + if (isDoc) { + setComment(start, offset - 2); + } + repeat = true; + } else { + return "/"; + } + } + } while (repeat); + + // offset !== length if we got here + + var end = offset; + delimRe.lastIndex = 0; + var delim = delimRe.test(charAt(end++)); + if (!delim) + while (end < length && !delimRe.test(charAt(end))) + ++end; + var token = source.substring(offset, offset = end); + if (token === "\"" || token === "'") + stringDelim = token; + return token; + } + + /** + * Pushes a token back to the stack. + * @param {string} token Token + * @returns {undefined} + * @inner + */ + function push(token) { + stack.push(token); + } + + /** + * Peeks for the next token. + * @returns {string|null} Token or `null` on eof + * @inner + */ + function peek() { + if (!stack.length) { + var token = next(); + if (token === null) + return null; + push(token); + } + return stack[0]; + } + + /** + * Skips a token. + * @param {string} expected Expected token + * @param {boolean} [optional=false] Whether the token is optional + * @returns {boolean} `true` when skipped, `false` if not + * @throws {Error} When a required token is not present + * @inner + */ + function skip(expected, optional) { + var actual = peek(), + equals = actual === expected; + if (equals) { + next(); + return true; + } + if (!optional) + throw illegal("token '" + actual + "', '" + expected + "' expected"); + return false; + } + + /** + * Gets a comment. + * @param {number} [trailingLine] Line number if looking for a trailing comment + * @returns {string|null} Comment text + * @inner + */ + function cmnt(trailingLine) { + var ret = null; + if (trailingLine === undefined) { + if (commentLine === line - 1 && (alternateCommentMode || commentType === "*" || commentLineEmpty)) { + ret = commentText; + } + } else { + /* istanbul ignore else */ + if (commentLine < trailingLine) { + peek(); + } + if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === "/")) { + ret = commentText; + } + } + return ret; + } + + return Object.defineProperty({ + next: next, + peek: peek, + push: push, + skip: skip, + cmnt: cmnt + }, "line", { + get: function() { return line; } + }); + /* eslint-enable callback-return */ +} diff --git a/node_modules/protobufjs/src/type.js b/node_modules/protobufjs/src/type.js new file mode 100644 index 0000000..2e7bda4 --- /dev/null +++ b/node_modules/protobufjs/src/type.js @@ -0,0 +1,589 @@ +"use strict"; +module.exports = Type; + +// extends Namespace +var Namespace = require("./namespace"); +((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; + +var Enum = require("./enum"), + OneOf = require("./oneof"), + Field = require("./field"), + MapField = require("./mapfield"), + Service = require("./service"), + Message = require("./message"), + Reader = require("./reader"), + Writer = require("./writer"), + util = require("./util"), + encoder = require("./encoder"), + decoder = require("./decoder"), + verifier = require("./verifier"), + converter = require("./converter"), + wrappers = require("./wrappers"); + +/** + * Constructs a new reflected message type instance. + * @classdesc Reflected message type. + * @extends NamespaceBase + * @constructor + * @param {string} name Message name + * @param {Object.} [options] Declared options + */ +function Type(name, options) { + Namespace.call(this, name, options); + + /** + * Message fields. + * @type {Object.} + */ + this.fields = {}; // toJSON, marker + + /** + * Oneofs declared within this namespace, if any. + * @type {Object.} + */ + this.oneofs = undefined; // toJSON + + /** + * Extension ranges, if any. + * @type {number[][]} + */ + this.extensions = undefined; // toJSON + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + /*? + * Whether this type is a legacy group. + * @type {boolean|undefined} + */ + this.group = undefined; // toJSON + + /** + * Cached fields by id. + * @type {Object.|null} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields as an array. + * @type {Field[]|null} + * @private + */ + this._fieldsArray = null; + + /** + * Cached oneofs as an array. + * @type {OneOf[]|null} + * @private + */ + this._oneofsArray = null; + + /** + * Cached constructor. + * @type {Constructor<{}>} + * @private + */ + this._ctor = null; +} + +Object.defineProperties(Type.prototype, { + + /** + * Message fields by id. + * @name Type#fieldsById + * @type {Object.} + * @readonly + */ + fieldsById: { + get: function() { + + /* istanbul ignore if */ + if (this._fieldsById) + return this._fieldsById; + + this._fieldsById = {}; + for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { + var field = this.fields[names[i]], + id = field.id; + + /* istanbul ignore if */ + if (this._fieldsById[id]) + throw Error("duplicate id " + id + " in " + this); + + this._fieldsById[id] = field; + } + return this._fieldsById; + } + }, + + /** + * Fields of this message as an array for iteration. + * @name Type#fieldsArray + * @type {Field[]} + * @readonly + */ + fieldsArray: { + get: function() { + return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); + } + }, + + /** + * Oneofs of this message as an array for iteration. + * @name Type#oneofsArray + * @type {OneOf[]} + * @readonly + */ + oneofsArray: { + get: function() { + return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); + } + }, + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + * @name Type#ctor + * @type {Constructor<{}>} + */ + ctor: { + get: function() { + return this._ctor || (this.ctor = Type.generateConstructor(this)()); + }, + set: function(ctor) { + + // Ensure proper prototype + var prototype = ctor.prototype; + if (!(prototype instanceof Message)) { + (ctor.prototype = new Message()).constructor = ctor; + util.merge(ctor.prototype, prototype); + } + + // Classes and messages reference their reflected type + ctor.$type = ctor.prototype.$type = this; + + // Mix in static methods + util.merge(ctor, Message, true); + + this._ctor = ctor; + + // Messages have non-enumerable default values on their prototype + var i = 0; + for (; i < /* initializes */ this.fieldsArray.length; ++i) + this._fieldsArray[i].resolve(); // ensures a proper value + + // Messages have non-enumerable getters and setters for each virtual oneof field + var ctorProperties = {}; + for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) + ctorProperties[this._oneofsArray[i].resolve().name] = { + get: util.oneOfGetter(this._oneofsArray[i].oneof), + set: util.oneOfSetter(this._oneofsArray[i].oneof) + }; + if (i) + Object.defineProperties(ctor.prototype, ctorProperties); + } + } +}); + +/** + * Generates a constructor function for the specified type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +Type.generateConstructor = function generateConstructor(mtype) { + /* eslint-disable no-unexpected-multiline */ + var gen = util.codegen(["p"], mtype.name); + // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype + for (var i = 0, field; i < mtype.fieldsArray.length; ++i) + if ((field = mtype._fieldsArray[i]).map) gen + ("this%s={}", util.safeProp(field.name)); + else if (field.repeated) gen + ("this%s=[]", util.safeProp(field.name)); + return gen + ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors + * @property {Object.} fields Field descriptors + * @property {number[][]} [extensions] Extension ranges + * @property {number[][]} [reserved] Reserved ranges + * @property {boolean} [group=false] Whether a legacy group or not + */ + +/** + * Creates a message type from a message type descriptor. + * @param {string} name Message name + * @param {IType} json Message type descriptor + * @returns {Type} Created message type + */ +Type.fromJSON = function fromJSON(name, json) { + var type = new Type(name, json.options); + type.extensions = json.extensions; + type.reserved = json.reserved; + var names = Object.keys(json.fields), + i = 0; + for (; i < names.length; ++i) + type.add( + ( typeof json.fields[names[i]].keyType !== "undefined" + ? MapField.fromJSON + : Field.fromJSON )(names[i], json.fields[names[i]]) + ); + if (json.oneofs) + for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) + type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); + if (json.nested) + for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { + var nested = json.nested[names[i]]; + type.add( // most to least likely + ( nested.id !== undefined + ? Field.fromJSON + : nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + if (json.extensions && json.extensions.length) + type.extensions = json.extensions; + if (json.reserved && json.reserved.length) + type.reserved = json.reserved; + if (json.group) + type.group = true; + if (json.comment) + type.comment = json.comment; + return type; +}; + +/** + * Converts this message type to a message type descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IType} Message type descriptor + */ +Type.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), + "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, + "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "group" , this.group || undefined, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Type.prototype.resolveAll = function resolveAll() { + var fields = this.fieldsArray, i = 0; + while (i < fields.length) + fields[i++].resolve(); + var oneofs = this.oneofsArray; i = 0; + while (i < oneofs.length) + oneofs[i++].resolve(); + return Namespace.prototype.resolveAll.call(this); +}; + +/** + * @override + */ +Type.prototype.get = function get(name) { + return this.fields[name] + || this.oneofs && this.oneofs[name] + || this.nested && this.nested[name] + || null; +}; + +/** + * Adds a nested object to this type. + * @param {ReflectionObject} object Nested object to add + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ +Type.prototype.add = function add(object) { + + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Field && object.extend === undefined) { + // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. + // The root object takes care of adding distinct sister-fields to the respective extended + // type instead. + + // avoids calling the getter if not absolutely necessary because it's called quite frequently + if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) + throw Error("duplicate id " + object.id + " in " + this); + if (this.isReservedId(object.id)) + throw Error("id " + object.id + " is reserved in " + this); + if (this.isReservedName(object.name)) + throw Error("name '" + object.name + "' is reserved in " + this); + + if (object.parent) + object.parent.remove(object); + this.fields[object.name] = object; + object.message = this; + object.onAdd(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs) + this.oneofs = {}; + this.oneofs[object.name] = object; + object.onAdd(this); + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * Removes a nested object from this type. + * @param {ReflectionObject} object Nested object to remove + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ +Type.prototype.remove = function remove(object) { + if (object instanceof Field && object.extend === undefined) { + // See Type#add for the reason why extension fields are excluded here. + + /* istanbul ignore if */ + if (!this.fields || this.fields[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.fields[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + if (object instanceof OneOf) { + + /* istanbul ignore if */ + if (!this.oneofs || this.oneofs[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.oneofs[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message<{}>} Message instance + */ +Type.prototype.create = function create(properties) { + return new this.ctor(properties); +}; + +/** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns {Type} `this` + */ +Type.prototype.setup = function setup() { + // Sets up everything at once so that the prototype chain does not have to be re-evaluated + // multiple times (V8, soft-deopt prototype-check). + + var fullName = this.fullName, + types = []; + for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) + types.push(this._fieldsArray[i].resolve().resolvedType); + + // Replace setup methods with type-specific generated functions + this.encode = encoder(this)({ + Writer : Writer, + types : types, + util : util + }); + this.decode = decoder(this)({ + Reader : Reader, + types : types, + util : util + }); + this.verify = verifier(this)({ + types : types, + util : util + }); + this.fromObject = converter.fromObject(this)({ + types : types, + util : util + }); + this.toObject = converter.toObject(this)({ + types : types, + util : util + }); + + // Inject custom wrappers for common types + var wrapper = wrappers[fullName]; + if (wrapper) { + var originalThis = Object.create(this); + // if (wrapper.fromObject) { + originalThis.fromObject = this.fromObject; + this.fromObject = wrapper.fromObject.bind(originalThis); + // } + // if (wrapper.toObject) { + originalThis.toObject = this.toObject; + this.toObject = wrapper.toObject.bind(originalThis); + // } + } + + return this; +}; + +/** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encode = function encode_setup(message, writer) { + return this.setup().encode(message, writer); // overrides this method +}; + +/** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); +}; + +/** + * Decodes a message of this type. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Length of the message, if known beforehand + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ +Type.prototype.decode = function decode_setup(reader, length) { + return this.setup().decode(reader, length); // overrides this method +}; + +/** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ +Type.prototype.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof Reader)) + reader = Reader.create(reader); + return this.decode(reader, reader.uint32()); +}; + +/** + * Verifies that field values are valid and that required fields are present. + * @param {Object.} message Plain object to verify + * @returns {null|string} `null` if valid, otherwise the reason why it is not + */ +Type.prototype.verify = function verify_setup(message) { + return this.setup().verify(message); // overrides this method +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object to convert + * @returns {Message<{}>} Message instance + */ +Type.prototype.fromObject = function fromObject(object) { + return this.setup().fromObject(object); +}; + +/** + * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. + * @interface IConversionOptions + * @property {Function} [longs] Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + * @property {Function} [enums] Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + * @property {Function} [bytes] Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + * @property {boolean} [defaults=false] Also sets default values on the resulting object + * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` + * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` + * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any + * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings + */ + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ +Type.prototype.toObject = function toObject(message, options) { + return this.setup().toObject(message, options); +}; + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @typedef TypeDecorator + * @type {function} + * @param {Constructor} target Target constructor + * @returns {undefined} + * @template T extends Message + */ + +/** + * Type decorator (TypeScript). + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {TypeDecorator} Decorator function + * @template T extends Message + */ +Type.d = function decorateType(typeName) { + return function typeDecorator(target) { + util.decorateType(target, typeName); + }; +}; diff --git a/node_modules/protobufjs/src/types.js b/node_modules/protobufjs/src/types.js new file mode 100644 index 0000000..5fda19a --- /dev/null +++ b/node_modules/protobufjs/src/types.js @@ -0,0 +1,196 @@ +"use strict"; + +/** + * Common type constants. + * @namespace + */ +var types = exports; + +var util = require("./util"); + +var s = [ + "double", // 0 + "float", // 1 + "int32", // 2 + "uint32", // 3 + "sint32", // 4 + "fixed32", // 5 + "sfixed32", // 6 + "int64", // 7 + "uint64", // 8 + "sint64", // 9 + "fixed64", // 10 + "sfixed64", // 11 + "bool", // 12 + "string", // 13 + "bytes" // 14 +]; + +function bake(values, offset) { + var i = 0, o = {}; + offset |= 0; + while (i < values.length) o[s[i + offset]] = values[i++]; + return o; +} + +/** + * Basic type wire types. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + * @property {number} bytes=2 Ldelim wire type + */ +types.basic = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2, + /* bytes */ 2 +]); + +/** + * Basic type defaults. + * @type {Object.} + * @const + * @property {number} double=0 Double default + * @property {number} float=0 Float default + * @property {number} int32=0 Int32 default + * @property {number} uint32=0 Uint32 default + * @property {number} sint32=0 Sint32 default + * @property {number} fixed32=0 Fixed32 default + * @property {number} sfixed32=0 Sfixed32 default + * @property {number} int64=0 Int64 default + * @property {number} uint64=0 Uint64 default + * @property {number} sint64=0 Sint32 default + * @property {number} fixed64=0 Fixed64 default + * @property {number} sfixed64=0 Sfixed64 default + * @property {boolean} bool=false Bool default + * @property {string} string="" String default + * @property {Array.} bytes=Array(0) Bytes default + * @property {null} message=null Message default + */ +types.defaults = bake([ + /* double */ 0, + /* float */ 0, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 0, + /* sfixed32 */ 0, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 0, + /* sfixed64 */ 0, + /* bool */ false, + /* string */ "", + /* bytes */ util.emptyArray, + /* message */ null +]); + +/** + * Basic long type wire types. + * @type {Object.} + * @const + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + */ +types.long = bake([ + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1 +], 7); + +/** + * Allowed types for map keys with their associated wire type. + * @type {Object.} + * @const + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + */ +types.mapKey = bake([ + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2 +], 2); + +/** + * Allowed types for packed repeated fields with their associated wire type. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + */ +types.packed = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0 +]); diff --git a/node_modules/protobufjs/src/typescript.jsdoc b/node_modules/protobufjs/src/typescript.jsdoc new file mode 100644 index 0000000..9a67101 --- /dev/null +++ b/node_modules/protobufjs/src/typescript.jsdoc @@ -0,0 +1,15 @@ +/** + * Constructor type. + * @interface Constructor + * @extends Function + * @template T + * @tstype new(...params: any[]): T; prototype: T; + */ + +/** + * Properties type. + * @typedef Properties + * @template T + * @type {Object.} + * @tstype { [P in keyof T]?: T[P] } + */ diff --git a/node_modules/protobufjs/src/util.js b/node_modules/protobufjs/src/util.js new file mode 100644 index 0000000..a5a9a83 --- /dev/null +++ b/node_modules/protobufjs/src/util.js @@ -0,0 +1,178 @@ +"use strict"; + +/** + * Various utility functions. + * @namespace + */ +var util = module.exports = require("./util/minimal"); + +var roots = require("./roots"); + +var Type, // cyclic + Enum; + +util.codegen = require("@protobufjs/codegen"); +util.fetch = require("@protobufjs/fetch"); +util.path = require("@protobufjs/path"); + +/** + * Node's fs module if available. + * @type {Object.} + */ +util.fs = util.inquire("fs"); + +/** + * Converts an object's values to an array. + * @param {Object.} object Object to convert + * @returns {Array.<*>} Converted array + */ +util.toArray = function toArray(object) { + if (object) { + var keys = Object.keys(object), + array = new Array(keys.length), + index = 0; + while (index < keys.length) + array[index] = object[keys[index++]]; + return array; + } + return []; +}; + +/** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param {Array.<*>} array Array to convert + * @returns {Object.} Converted object + */ +util.toObject = function toObject(array) { + var object = {}, + index = 0; + while (index < array.length) { + var key = array[index++], + val = array[index++]; + if (val !== undefined) + object[key] = val; + } + return object; +}; + +var safePropBackslashRe = /\\/g, + safePropQuoteRe = /"/g; + +/** + * Tests whether the specified name is a reserved word in JS. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +util.isReserved = function isReserved(name) { + return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); +}; + +/** + * Returns a safe property accessor for the specified property name. + * @param {string} prop Property name + * @returns {string} Safe accessor + */ +util.safeProp = function safeProp(prop) { + if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) + return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; + return "." + prop; +}; + +/** + * Converts the first character of a string to upper case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.ucFirst = function ucFirst(str) { + return str.charAt(0).toUpperCase() + str.substring(1); +}; + +var camelCaseRe = /_([a-z])/g; + +/** + * Converts a string to camel case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.camelCase = function camelCase(str) { + return str.substring(0, 1) + + str.substring(1) + .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); +}; + +/** + * Compares reflected fields by id. + * @param {Field} a First field + * @param {Field} b Second field + * @returns {number} Comparison value + */ +util.compareFieldsById = function compareFieldsById(a, b) { + return a.id - b.id; +}; + +/** + * Decorator helper for types (TypeScript). + * @param {Constructor} ctor Constructor function + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {Type} Reflected type + * @template T extends Message + * @property {Root} root Decorators root + */ +util.decorateType = function decorateType(ctor, typeName) { + + /* istanbul ignore if */ + if (ctor.$type) { + if (typeName && ctor.$type.name !== typeName) { + util.decorateRoot.remove(ctor.$type); + ctor.$type.name = typeName; + util.decorateRoot.add(ctor.$type); + } + return ctor.$type; + } + + /* istanbul ignore next */ + if (!Type) + Type = require("./type"); + + var type = new Type(typeName || ctor.name); + util.decorateRoot.add(type); + type.ctor = ctor; // sets up .encode, .decode etc. + Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); + Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); + return type; +}; + +var decorateEnumIndex = 0; + +/** + * Decorator helper for enums (TypeScript). + * @param {Object} object Enum object + * @returns {Enum} Reflected enum + */ +util.decorateEnum = function decorateEnum(object) { + + /* istanbul ignore if */ + if (object.$type) + return object.$type; + + /* istanbul ignore next */ + if (!Enum) + Enum = require("./enum"); + + var enm = new Enum("Enum" + decorateEnumIndex++, object); + util.decorateRoot.add(enm); + Object.defineProperty(object, "$type", { value: enm, enumerable: false }); + return enm; +}; + +/** + * Decorator root (TypeScript). + * @name util.decorateRoot + * @type {Root} + * @readonly + */ +Object.defineProperty(util, "decorateRoot", { + get: function() { + return roots["decorated"] || (roots["decorated"] = new (require("./root"))()); + } +}); diff --git a/node_modules/protobufjs/src/util/longbits.js b/node_modules/protobufjs/src/util/longbits.js new file mode 100644 index 0000000..11bfb1c --- /dev/null +++ b/node_modules/protobufjs/src/util/longbits.js @@ -0,0 +1,200 @@ +"use strict"; +module.exports = LongBits; + +var util = require("../util/minimal"); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; diff --git a/node_modules/protobufjs/src/util/minimal.js b/node_modules/protobufjs/src/util/minimal.js new file mode 100644 index 0000000..48b62bf --- /dev/null +++ b/node_modules/protobufjs/src/util/minimal.js @@ -0,0 +1,414 @@ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require("@protobufjs/aspromise"); + +// converts to / from base64 encoded strings +util.base64 = require("@protobufjs/base64"); + +// base class of rpc.Service +util.EventEmitter = require("@protobufjs/eventemitter"); + +// float handling accross browsers +util.float = require("@protobufjs/float"); + +// requires modules optionally and hides the call from bundlers +util.inquire = require("@protobufjs/inquire"); + +// converts to / from utf8 encoded strings +util.utf8 = require("@protobufjs/utf8"); + +// provides a node-like buffer pool in the browser +util.pool = require("@protobufjs/pool"); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require("./longbits"); + +// global object reference +util.global = typeof window !== "undefined" && window + || typeof global !== "undefined" && global + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + * @const + */ +util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ + +/** + * Long.js's Long class if available. + * @type {Constructor} + */ +util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long"); + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; diff --git a/node_modules/protobufjs/src/verifier.js b/node_modules/protobufjs/src/verifier.js new file mode 100644 index 0000000..d58e27a --- /dev/null +++ b/node_modules/protobufjs/src/verifier.js @@ -0,0 +1,177 @@ +"use strict"; +module.exports = verifier; + +var Enum = require("./enum"), + util = require("./util"); + +function invalid(field, expected) { + return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; +} + +/** + * Generates a partial value verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyValue(gen, field, fieldIndex, ref) { + /* eslint-disable no-unexpected-multiline */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref) + ("default:") + ("return%j", invalid(field, "enum value")); + for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen + ("case %i:", field.resolvedType.values[keys[j]]); + gen + ("break") + ("}"); + } else { + gen + ("{") + ("var e=types[%i].verify(%s);", fieldIndex, ref) + ("if(e)") + ("return%j+e", field.name + ".") + ("}"); + } + } else { + switch (field.type) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.isInteger(%s))", ref) + ("return%j", invalid(field, "integer")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) + ("return%j", invalid(field, "integer|Long")); + break; + case "float": + case "double": gen + ("if(typeof %s!==\"number\")", ref) + ("return%j", invalid(field, "number")); + break; + case "bool": gen + ("if(typeof %s!==\"boolean\")", ref) + ("return%j", invalid(field, "boolean")); + break; + case "string": gen + ("if(!util.isString(%s))", ref) + ("return%j", invalid(field, "string")); + break; + case "bytes": gen + ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) + ("return%j", invalid(field, "buffer")); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a partial key verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyKey(gen, field, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.keyType) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.key32Re.test(%s))", ref) + ("return%j", invalid(field, "integer key")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not + ("return%j", invalid(field, "integer|Long key")); + break; + case "bool": gen + ("if(!util.key2Re.test(%s))", ref) + ("return%j", invalid(field, "boolean key")); + break; + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a verifier specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function verifier(mtype) { + /* eslint-disable no-unexpected-multiline */ + + var gen = util.codegen(["m"], mtype.name + "$verify") + ("if(typeof m!==\"object\"||m===null)") + ("return%j", "object expected"); + var oneofs = mtype.oneofsArray, + seenFirstField = {}; + if (oneofs.length) gen + ("var p={}"); + + for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + ref = "m" + util.safeProp(field.name); + + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null + + // map fields + if (field.map) { gen + ("if(!util.isObject(%s))", ref) + ("return%j", invalid(field, "object")) + ("var k=Object.keys(%s)", ref) + ("for(var i=0;i} + * @const + */ +var wrappers = exports; + +var Message = require("./message"); + +/** + * From object converter part of an {@link IWrapper}. + * @typedef WrapperFromObjectConverter + * @type {function} + * @param {Object.} object Plain object + * @returns {Message<{}>} Message instance + * @this Type + */ + +/** + * To object converter part of an {@link IWrapper}. + * @typedef WrapperToObjectConverter + * @type {function} + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @this Type + */ + +/** + * Common type wrapper part of {@link wrappers}. + * @interface IWrapper + * @property {WrapperFromObjectConverter} [fromObject] From object converter + * @property {WrapperToObjectConverter} [toObject] To object converter + */ + +// Custom wrapper for Any +wrappers[".google.protobuf.Any"] = { + + fromObject: function(object) { + + // unwrap value type if mapped + if (object && object["@type"]) { + var type = this.lookup(object["@type"]); + /* istanbul ignore else */ + if (type) { + // type_url does not accept leading "." + var type_url = object["@type"].charAt(0) === "." ? + object["@type"].substr(1) : object["@type"]; + // type_url prefix is optional, but path seperator is required + return this.create({ + type_url: "/" + type_url, + value: type.encode(type.fromObject(object)).finish() + }); + } + } + + return this.fromObject(object); + }, + + toObject: function(message, options) { + + // decode value if requested and unmapped + if (options && options.json && message.type_url && message.value) { + // Only use fully qualified type name after the last '/' + var name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) + message = type.decode(message.value); + } + + // wrap value if unmapped + if (!(message instanceof this.ctor) && message instanceof Message) { + var object = message.$type.toObject(message, options); + object["@type"] = message.$type.fullName; + return object; + } + + return this.toObject(message, options); + } +}; diff --git a/node_modules/protobufjs/src/writer.js b/node_modules/protobufjs/src/writer.js new file mode 100644 index 0000000..f77d83c --- /dev/null +++ b/node_modules/protobufjs/src/writer.js @@ -0,0 +1,459 @@ +"use strict"; +module.exports = Writer; + +var util = require("./util/minimal"); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; +}; diff --git a/node_modules/protobufjs/src/writer_buffer.js b/node_modules/protobufjs/src/writer_buffer.js new file mode 100644 index 0000000..55c479c --- /dev/null +++ b/node_modules/protobufjs/src/writer_buffer.js @@ -0,0 +1,81 @@ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require("./writer"); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require("./util/minimal"); + +var Buffer = util.Buffer; + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ +BufferWriter.alloc = function alloc_buffer(size) { + return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size); +}; + +var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else + buf.utf8Write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ diff --git a/node_modules/protobufjs/tsconfig.json b/node_modules/protobufjs/tsconfig.json new file mode 100644 index 0000000..22852fa --- /dev/null +++ b/node_modules/protobufjs/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "target": "ES5", + "experimentalDecorators": true, + "emitDecoratorMetadata": true + } +} \ No newline at end of file diff --git a/node_modules/querystring/.History.md.un~ b/node_modules/querystring/.History.md.un~ new file mode 100644 index 0000000..c96a7dd Binary files /dev/null and b/node_modules/querystring/.History.md.un~ differ diff --git a/node_modules/querystring/.Readme.md.un~ b/node_modules/querystring/.Readme.md.un~ new file mode 100644 index 0000000..71613b5 Binary files /dev/null and b/node_modules/querystring/.Readme.md.un~ differ diff --git a/node_modules/querystring/.package.json.un~ b/node_modules/querystring/.package.json.un~ new file mode 100644 index 0000000..d86fe31 Binary files /dev/null and b/node_modules/querystring/.package.json.un~ differ diff --git a/node_modules/querystring/.travis.yml b/node_modules/querystring/.travis.yml new file mode 100644 index 0000000..895dbd3 --- /dev/null +++ b/node_modules/querystring/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/node_modules/querystring/History.md b/node_modules/querystring/History.md new file mode 100644 index 0000000..4fddbaf --- /dev/null +++ b/node_modules/querystring/History.md @@ -0,0 +1,20 @@ +# 0.2.0 / 2013-02-21 + + - Refactor into function per-module idiomatic style. + - Improved test coverage. + +# 0.1.0 / 2011-12-13 + + - Minor project reorganization + +# 0.0.3 / 2011-04-16 + - Support for AMD module loaders + +# 0.0.2 / 2011-04-16 + + - Ported unit tests + - Removed functionality that depended on Buffers + +# 0.0.1 / 2011-04-15 + + - Initial release diff --git a/node_modules/querystring/License.md b/node_modules/querystring/License.md new file mode 100644 index 0000000..fc80e85 --- /dev/null +++ b/node_modules/querystring/License.md @@ -0,0 +1,19 @@ + +Copyright 2012 Irakli Gozalishvili. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/querystring/Readme.md b/node_modules/querystring/Readme.md new file mode 100644 index 0000000..a4fe252 --- /dev/null +++ b/node_modules/querystring/Readme.md @@ -0,0 +1,15 @@ +# querystring + +[![Build Status](https://secure.travis-ci.org/Gozala/querystring.png)](http://travis-ci.org/Gozala/querystring) + + +[![Browser support](http://ci.testling.com/Gozala/querystring.png)](http://ci.testling.com/Gozala/querystring) + + + +Node's querystring module for all engines. + +## Install ## + + npm install querystring + diff --git a/node_modules/querystring/decode.js b/node_modules/querystring/decode.js new file mode 100644 index 0000000..a6518b8 --- /dev/null +++ b/node_modules/querystring/decode.js @@ -0,0 +1,80 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (Array.isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; diff --git a/node_modules/querystring/encode.js b/node_modules/querystring/encode.js new file mode 100644 index 0000000..4f2b561 --- /dev/null +++ b/node_modules/querystring/encode.js @@ -0,0 +1,64 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return Object.keys(obj).map(function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (Array.isArray(obj[k])) { + return obj[k].map(function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +}; diff --git a/node_modules/querystring/index.js b/node_modules/querystring/index.js new file mode 100644 index 0000000..99826ea --- /dev/null +++ b/node_modules/querystring/index.js @@ -0,0 +1,4 @@ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); diff --git a/node_modules/querystring/package.json b/node_modules/querystring/package.json new file mode 100644 index 0000000..0775083 --- /dev/null +++ b/node_modules/querystring/package.json @@ -0,0 +1,100 @@ +{ + "_from": "querystring@0.2.0", + "_id": "querystring@0.2.0", + "_inBundle": false, + "_integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "_location": "/querystring", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "querystring@0.2.0", + "name": "querystring", + "escapedName": "querystring", + "rawSpec": "0.2.0", + "saveSpec": null, + "fetchSpec": "0.2.0" + }, + "_requiredBy": [ + "/url" + ], + "_resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "_shasum": "b209849203bb25df820da756e747005878521620", + "_spec": "querystring@0.2.0", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\url", + "author": { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com" + }, + "bugs": { + "url": "http://github.com/Gozala/querystring/issues/" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node's querystring module for all engines.", + "devDependencies": { + "phantomify": "~0.x.0", + "retape": "~0.x.0", + "tape": "~0.1.5", + "test": "~0.x.0" + }, + "engines": { + "node": ">=0.4.x" + }, + "homepage": "https://github.com/Gozala/querystring#readme", + "id": "querystring", + "keywords": [ + "commonjs", + "query", + "querystring" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/Gozala/enchain/License.md" + } + ], + "name": "querystring", + "repository": { + "type": "git", + "url": "git://github.com/Gozala/querystring.git", + "web": "https://github.com/Gozala/querystring" + }, + "scripts": { + "test": "npm run test-node && npm run test-browser && npm run test-tap", + "test-browser": "node ./node_modules/phantomify/bin/cmd.js ./test/common-index.js", + "test-node": "node ./test/common-index.js", + "test-tap": "node ./test/tap-index.js" + }, + "testling": { + "files": "test/tap-index.js", + "browsers": { + "iexplore": [ + 9, + 10 + ], + "chrome": [ + 16, + 20, + 25, + "canary" + ], + "firefox": [ + 10, + 15, + 16, + 17, + 18, + "nightly" + ], + "safari": [ + 5, + 6 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.2.0" +} diff --git a/node_modules/querystring/test/.index.js.un~ b/node_modules/querystring/test/.index.js.un~ new file mode 100644 index 0000000..898eced Binary files /dev/null and b/node_modules/querystring/test/.index.js.un~ differ diff --git a/node_modules/querystring/test/common-index.js b/node_modules/querystring/test/common-index.js new file mode 100644 index 0000000..f356f98 --- /dev/null +++ b/node_modules/querystring/test/common-index.js @@ -0,0 +1,3 @@ +"use strict"; + +require("test").run(require("./index")) \ No newline at end of file diff --git a/node_modules/querystring/test/index.js b/node_modules/querystring/test/index.js new file mode 100644 index 0000000..62eb2ac --- /dev/null +++ b/node_modules/querystring/test/index.js @@ -0,0 +1,210 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +"use strict"; + +// test using assert +var qs = require('../'); + +// folding block, commented to pass gjslint +// {{{ +// [ wonkyQS, canonicalQS, obj ] +var qsTestCases = [ + ['foo=918854443121279438895193', + 'foo=918854443121279438895193', + {'foo': '918854443121279438895193'}], + ['foo=bar', 'foo=bar', {'foo': 'bar'}], + ['foo=bar&foo=quux', 'foo=bar&foo=quux', {'foo': ['bar', 'quux']}], + ['foo=1&bar=2', 'foo=1&bar=2', {'foo': '1', 'bar': '2'}], + ['my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F', + 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', + {'my weird field': 'q1!2"\'w$5&7/z8)?' }], + ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', {'foo=baz': 'bar'}], + ['foo=baz=bar', 'foo=baz%3Dbar', {'foo': 'baz=bar'}], + ['str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + 'str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + { 'str': 'foo', + 'arr': ['1', '2', '3'], + 'somenull': '', + 'undef': ''}], + [' foo = bar ', '%20foo%20=%20bar%20', {' foo ': ' bar '}], + // disable test that fails ['foo=%zx', 'foo=%25zx', {'foo': '%zx'}], + ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }], + // See: https://github.com/joyent/node/issues/1707 + ['hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', + 'hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', + { hasOwnProperty: 'x', + toString: 'foo', + valueOf: 'bar', + __defineGetter__: 'baz' }], + // See: https://github.com/joyent/node/issues/3058 + ['foo&bar=baz', 'foo=&bar=baz', { foo: '', bar: 'baz' }] +]; + +// [ wonkyQS, canonicalQS, obj ] +var qsColonTestCases = [ + ['foo:bar', 'foo:bar', {'foo': 'bar'}], + ['foo:bar;foo:quux', 'foo:bar;foo:quux', {'foo': ['bar', 'quux']}], + ['foo:1&bar:2;baz:quux', + 'foo:1%26bar%3A2;baz:quux', + {'foo': '1&bar:2', 'baz': 'quux'}], + ['foo%3Abaz:bar', 'foo%3Abaz:bar', {'foo:baz': 'bar'}], + ['foo:baz:bar', 'foo:baz%3Abar', {'foo': 'baz:bar'}] +]; + +// [wonkyObj, qs, canonicalObj] +var extendedFunction = function() {}; +extendedFunction.prototype = {a: 'b'}; +var qsWeirdObjects = [ + [{regexp: /./g}, 'regexp=', {'regexp': ''}], + [{regexp: new RegExp('.', 'g')}, 'regexp=', {'regexp': ''}], + [{fn: function() {}}, 'fn=', {'fn': ''}], + [{fn: new Function('')}, 'fn=', {'fn': ''}], + [{math: Math}, 'math=', {'math': ''}], + [{e: extendedFunction}, 'e=', {'e': ''}], + [{d: new Date()}, 'd=', {'d': ''}], + [{d: Date}, 'd=', {'d': ''}], + [{f: new Boolean(false), t: new Boolean(true)}, 'f=&t=', {'f': '', 't': ''}], + [{f: false, t: true}, 'f=false&t=true', {'f': 'false', 't': 'true'}], + [{n: null}, 'n=', {'n': ''}], + [{nan: NaN}, 'nan=', {'nan': ''}], + [{inf: Infinity}, 'inf=', {'inf': ''}] +]; +// }}} + +var qsNoMungeTestCases = [ + ['', {}], + ['foo=bar&foo=baz', {'foo': ['bar', 'baz']}], + ['blah=burp', {'blah': 'burp'}], + ['gragh=1&gragh=3&goo=2', {'gragh': ['1', '3'], 'goo': '2'}], + ['frappucino=muffin&goat%5B%5D=scone&pond=moose', + {'frappucino': 'muffin', 'goat[]': 'scone', 'pond': 'moose'}], + ['trololol=yes&lololo=no', {'trololol': 'yes', 'lololo': 'no'}] +]; + +exports['test basic'] = function(assert) { + assert.strictEqual('918854443121279438895193', + qs.parse('id=918854443121279438895193').id, + 'prase id=918854443121279438895193'); +}; + +exports['test that the canonical qs is parsed properly'] = function(assert) { + qsTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0]), + 'parse ' + testCase[0]); + }); +}; + + +exports['test that the colon test cases can do the same'] = function(assert) { + qsColonTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0], ';', ':'), + 'parse ' + testCase[0] + ' -> ; :'); + }); +}; + +exports['test the weird objects, that they get parsed properly'] = function(assert) { + qsWeirdObjects.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[1]), + 'parse ' + testCase[1]); + }); +}; + +exports['test non munge test cases'] = function(assert) { + qsNoMungeTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false), + 'stringify ' + JSON.stringify(testCase[1]) + ' -> & ='); + }); +}; + +exports['test the nested qs-in-qs case'] = function(assert) { + var f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); + f.q = qs.parse(f.q); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a=b&q=x%3Dy%26y%3Dz'); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); + f.q = qs.parse(f.q, ';', ':'); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a:b;q:x%3Ay%3By%3Az -> ; :'); +}; + +exports['test stringifying'] = function(assert) { + qsTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2]), + 'stringify ' + JSON.stringify(testCase[2])); + }); + + qsColonTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':'), + 'stringify ' + JSON.stringify(testCase[2]) + ' -> ; :'); + }); + + qsWeirdObjects.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[0]), + 'stringify ' + JSON.stringify(testCase[0])); + }); +}; + +exports['test stringifying nested'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }) + }); + assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz', + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + })); + + var threw = false; + try { qs.parse(undefined); } catch(error) { threw = true; } + assert.ok(!threw, "does not throws on undefined"); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }, ';', ':') + }, ';', ':'); + assert.equal(f, 'a:b;q:x%3Ay%3By%3Az', + 'stringify ' + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + }) + ' -> ; : '); + + + assert.deepEqual({}, qs.parse(), 'parse undefined'); +}; diff --git a/node_modules/querystring/test/tap-index.js b/node_modules/querystring/test/tap-index.js new file mode 100644 index 0000000..70679b3 --- /dev/null +++ b/node_modules/querystring/test/tap-index.js @@ -0,0 +1,3 @@ +"use strict"; + +require("retape")(require("./index")) \ No newline at end of file diff --git a/node_modules/seedrandom/.coveralls.yml b/node_modules/seedrandom/.coveralls.yml new file mode 100644 index 0000000..9160059 --- /dev/null +++ b/node_modules/seedrandom/.coveralls.yml @@ -0,0 +1 @@ +service_name: travis-ci diff --git a/node_modules/seedrandom/.npmignore b/node_modules/seedrandom/.npmignore new file mode 100644 index 0000000..a088b6f --- /dev/null +++ b/node_modules/seedrandom/.npmignore @@ -0,0 +1,2 @@ +node_modules +bower_components diff --git a/node_modules/seedrandom/.nvmrc b/node_modules/seedrandom/.nvmrc new file mode 100644 index 0000000..1e8b314 --- /dev/null +++ b/node_modules/seedrandom/.nvmrc @@ -0,0 +1 @@ +6 diff --git a/node_modules/seedrandom/.travis.yml b/node_modules/seedrandom/.travis.yml new file mode 100644 index 0000000..205850f --- /dev/null +++ b/node_modules/seedrandom/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +sudo: false +node_js: +- '0.10' +- '0.12' +- '4' +- '5' +- '6' +- '7' diff --git a/node_modules/seedrandom/Gruntfile.js b/node_modules/seedrandom/Gruntfile.js new file mode 100644 index 0000000..c24df6e --- /dev/null +++ b/node_modules/seedrandom/Gruntfile.js @@ -0,0 +1,108 @@ +module.exports = function(grunt) { + "use strict"; + + grunt.initConfig({ + pkg: grunt.file.readJSON("package.json"), + bowercopy: { + options: { + clean: true + }, + test: { + options: { + destPrefix: "test/lib" + }, + files: { + "qunit.js" : "qunit/qunit/qunit.js", + "qunit.css" : "qunit/qunit/qunit.css", + "require.js" : "requirejs/require.js" + } + } + }, + uglify: { + all: { + files: { + "<%= pkg.name %>.min.js": [ "<%= pkg.name %>.js" ], + "lib/alea.min.js": [ "lib/alea.js" ], + "lib/tychei.min.js": [ "lib/tychei.js" ], + "lib/xor4096.min.js": [ "lib/xor4096.js" ], + "lib/xorshift7.min.js": [ "lib/xorshift7.js" ], + "lib/xorwow.min.js": [ "lib/xorwow.js" ], + "lib/xor128.min.js": [ "lib/xor128.js" ] + }, + options: { + preserveComments: false, + report: "min", + beautify: { + ascii_only: true + } + } + } + }, + qunit: { + options: { + noGlobals: true, + httpBase: 'http://localhost:8192' + }, + all: ["test/*.html"] + }, + connect: { + server: { + options: { + port: 8192, + base: '.' + } + } + }, + browserify: { + test: { + files: { + 'test/browserified.js': ['test/nodetest.js'], + }, + options: { + ignore: ['requirejs', 'process'], + alias: { + 'assert': './test/qunitassert.js' + } + } + } + }, + mochacov: { + options: { + files: [ + 'test/cryptotest.js', + 'test/nodetest.js', + 'test/prngtest.js' + ] + }, + coverage: { + options: { + coveralls: true + } + }, + test: { + options: { + reporter: 'dot' + } + } + }, + release: { + options: { + bump: false + } + } + }); + + grunt.loadNpmTasks('grunt-bowercopy'); + grunt.loadNpmTasks('grunt-contrib-connect'); + grunt.loadNpmTasks('grunt-contrib-qunit'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-mocha-cov'); + grunt.loadNpmTasks('grunt-release'); + grunt.loadNpmTasks('grunt-browserify'); + + grunt.registerTask("test", + ["browserify", "connect", "qunit", "mochacov:test"]); + grunt.registerTask("default", ["uglify", "test"]); + grunt.registerTask("travis", ["default", "mochacov:coverage"]); +}; + diff --git a/node_modules/seedrandom/README.md b/node_modules/seedrandom/README.md new file mode 100644 index 0000000..3645bcc --- /dev/null +++ b/node_modules/seedrandom/README.md @@ -0,0 +1,298 @@ +seedrandom.js +============= +[![Build Status](https://travis-ci.org/davidbau/seedrandom.svg?branch=master)](https://travis-ci.org/davidbau/seedrandom) +[![NPM version](https://badge.fury.io/js/seedrandom.svg)](http://badge.fury.io/js/seedrandom) +[![Bower version](https://badge.fury.io/bo/seedrandom.svg)](http://badge.fury.io/bo/seedrandom) + +Seeded random number generator for JavaScript. + +Version 2.4.3 + +Author: David Bau + +Date: 2015-07-04 + +Can be used as a plain script, a Node.js module or an AMD module. + + +Script tag usage +---------------- + +```html + +``` + +```js +// Sets Math.random to a PRNG initialized using the given explicit seed. +Math.seedrandom('hello.'); +console.log(Math.random()); // Always 0.9282578795792454 +console.log(Math.random()); // Always 0.3752569768646784 + +// Sets Math.random to an ARC4-based PRNG that is autoseeded using the +// current time, dom state, and other accumulated local entropy. +// The generated seed string is returned. +Math.seedrandom(); +console.log(Math.random()); // Reasonably unpredictable. + +// Seeds using the given explicit seed mixed with accumulated entropy. +Math.seedrandom('added entropy.', { entropy: true }); +console.log(Math.random()); // As unpredictable as added entropy. + +// Use "new" to create a local prng without altering Math.random. +var myrng = new Math.seedrandom('hello.'); +console.log(myrng()); // Always 0.9282578795792454 + +// Use "quick" to get only 32 bits of randomness in a float. +console.log(myrng.quick()); // Always 0.3752569768112153 + +// Use "int32" to get a 32 bit (signed) integer +console.log(myrng.int32()); // Always 986220731 + +``` + +Other Fast PRNG Algorithms +-------------------------- + +The package includes some other fast PRNGs. To use Johannes Baagøe's +extremely fast Alea PRNG: + + +```html + +``` + +```js +// Use xor4096 for Richard Brent's xorgens-4096 algorithm. +var xorgen = new xor4096('hello.'); + +// By default provides 32 bits of randomness in a float. +console.log(xorgen()); // Always 0.9798525865189731 + +// Use "double" to get 56 bits of randomness. +console.log(xorgen.double()); // Always 0.03583478477375346 + +// Use "int32" to get a 32 bit (signed) integer. +console.log(xorgen.int32()); // Always 1341429986 +```` + +Besides xor4096, there are several other faster PRNGs available. + +|PRNG name | Time vs native | Period | Author | +|-----------|----------------|-------------|----------------------| +|`alea` | 1.95 ns, 0.9x | ~2^116 | Baagøe | +|`xor128` | 2.04 ns, 0.9x | 2^128-1 | Marsaglia | +|`tychei` | 2.32 ns, 1.1x | ~2^127 | Neves/Araujo (ChaCha)| +|`xorwow` | 2.40 ns, 1.1x | 2^192-2^32 | Marsaglia | +|`xor4096` | 2.40 ns, 1.1x | 2^4096-2^32 | Brent (xorgens) | +|`xorshift7`| 2.64 ns, 1.3x | 2^256-1 | Panneton/L'ecuyer | +|`quick` | 3.80 ns, 1.8x | ~2^1600 | Bau (ARC4) | + +(Timings were done on node v0.12.2 on a single-core Google Compute Engine +instance. `quick` is just the 32-bit version of the RC4-based PRNG +originally packaged with seedrandom.) + + +Node.js usage +------------- + +``` +npm install seedrandom +``` + +```js +// Local PRNG: does not affect Math.random. +var seedrandom = require('seedrandom'); +var rng = seedrandom('hello.'); +console.log(rng()); // Always 0.9282578795792454 + +// Global PRNG: set Math.random. +seedrandom('hello.', { global: true }); +console.log(Math.random()); // Always 0.9282578795792454 + +// Autoseeded ARC4-based PRNG. +rng = seedrandom(); +console.log(rng()); // Reasonably unpredictable. + +// Mixing accumulated entropy. +rng = seedrandom('added entropy.', { entropy: true }); +console.log(rng()); // As unpredictable as added entropy. + +// Using alternate algorithms, as listed above. +var rng2 = seedrandom.xor4096('hello.') +console.log(rng2()); +``` + + +Require.js usage +---------------- + +Similar to Node.js usage: + +``` +bower install seedrandom +``` + +``` +require(['seedrandom'], function(seedrandom) { + var rng = seedrandom('hello.'); + console.log(rng()); // Always 0.9282578795792454 +}); +``` + + +Network seeding +--------------- + +```html + + + + + + +``` + +Reseeding using user input +-------------------------- + +```js +var seed = Math.seedrandom(); // Use prng with an automatic seed. +document.write(Math.random()); // Pretty much unpredictable x. + +var rng = new Math.seedrandom(seed); // A new prng with the same seed. +document.write(rng()); // Repeat the 'unpredictable' x. + +function reseed(event, count) { // Define a custom entropy collector. + var t = []; + function w(e) { + t.push([e.pageX, e.pageY, +new Date]); + if (t.length < count) { return; } + document.removeEventListener(event, w); + Math.seedrandom(t, { entropy: true }); + } + document.addEventListener(event, w); +} +reseed('mousemove', 100); // Reseed after 100 mouse moves. +``` + +The "pass" option can be used to get both the prng and the seed. +The following returns both an autoseeded prng and the seed as an object, +without mutating Math.random: + +```js +var obj = Math.seedrandom(null, { pass: function(prng, seed) { + return { random: prng, seed: seed }; +}}); +``` + + +Saving and Restoring PRNG state +------------------------------- + +```js +var seedrandom = Math.seedrandom; +var saveable = seedrandom("secret-seed", {state: true}); +for (var j = 0; j < 1e5; ++j) saveable(); +var saved = saveable.state(); +var replica = seedrandom("", {state: saved}); +assert(replica() == saveable()); +``` + +In normal use the prng is opaque and its internal state cannot be accessed. +However, if the "state" option is specified, the prng gets a state() method +that returns a plain object the can be used to reconstruct a prng later in +the same state (by passing that saved object back as the state option). + + +Version notes +------------- + +The random number sequence is the same as version 1.0 for string seeds. + +* Version 2.0 changed the sequence for non-string seeds. +* Version 2.1 speeds seeding and uses window.crypto to autoseed if present. +* Version 2.2 alters non-crypto autoseeding to sweep up entropy from plugins. +* Version 2.3 adds support for "new", module loading, and a null seed arg. +* Version 2.3.1 adds a build environment, module packaging, and tests. +* Version 2.3.4 fixes bugs on IE8, and switches to MIT license. +* Version 2.3.6 adds a readable options object argument. +* Version 2.3.10 adds support for node.js crypto (contributed by ctd1500). +* Version 2.3.11 adds an option to load and save internal state. +* Version 2.4.0 adds implementations of several other fast PRNGs. +* Version 2.4.2 adds an implementation of Baagoe's very fast Alea PRNG. +* Version 2.4.3 ignores nodejs crypto when under browserify. + +The standard ARC4 key scheduler cycles short keys, which means that +seedrandom('ab') is equivalent to seedrandom('abab') and 'ababab'. +Therefore it is a good idea to add a terminator to avoid trivial +equivalences on short string seeds, e.g., Math.seedrandom(str + '\0'). +Starting with version 2.0, a terminator is added automatically for +non-string seeds, so seeding with the number 111 is the same as seeding +with '111\0'. + +When seedrandom() is called with zero args or a null seed, it uses a +seed drawn from the browser crypto object if present. If there is no +crypto support, seedrandom() uses the current time, the native rng, +and a walk of several DOM objects to collect a few bits of entropy. + +Each time the one- or two-argument forms of seedrandom are called, +entropy from the passed seed is accumulated in a pool to help generate +future seeds for the zero- and two-argument forms of seedrandom. + +On speed - This javascript implementation of Math.random() is several +times slower than the built-in Math.random() because it is not native +code, but that is typically fast enough. Some details (timings on +Chrome 25 on a 2010 vintage macbook): + +* seeded Math.random() - avg less than 0.0002 milliseconds per call +* seedrandom('explicit.') - avg less than 0.2 milliseconds per call +* seedrandom('explicit.', true) - avg less than 0.2 milliseconds per call +* seedrandom() with crypto - avg less than 0.2 milliseconds per call + +Autoseeding without crypto is somewhat slow, about 20-30 milliseconds on +a 2012 windows 7 1.5ghz i5 laptop, as seen on Firefox 19, IE 10, and Opera. +Seeded rng calls themselves are fast across these browsers, with slowest +numbers on Opera at about 0.0005 ms per seeded Math.random(). + + +LICENSE (MIT) +------------- + +Copyright 2015 David Bau. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/seedrandom/bower.json b/node_modules/seedrandom/bower.json new file mode 100644 index 0000000..8e62b3a --- /dev/null +++ b/node_modules/seedrandom/bower.json @@ -0,0 +1,16 @@ +{ + "name": "seedrandom", + "description": "Seeded random number generator for Javascript.", + "main": "seedrandom.js", + "license": "MIT", + "keywords": [ + "random", + "seed", + "crypto" + ], + "ignore": [], + "devDependencies": { + "qunit": "latest", + "requirejs": "latest" + } +} diff --git a/node_modules/seedrandom/component.json b/node_modules/seedrandom/component.json new file mode 100644 index 0000000..fe1aa60 --- /dev/null +++ b/node_modules/seedrandom/component.json @@ -0,0 +1,10 @@ +{ + "name": "seedrandom", + "version": "2.4.0", + "description": "Seeded random number generator for Javascript", + "repository": "davidbau/seedrandom", + "main": "seedrandom.js", + "scripts": [ "seedrandom.js" ], + "keywords": [ "random", "seed", "crypto" ], + "license": "MIT" +} diff --git a/node_modules/seedrandom/index.js b/node_modules/seedrandom/index.js new file mode 100644 index 0000000..513669a --- /dev/null +++ b/node_modules/seedrandom/index.js @@ -0,0 +1,60 @@ +// A library of seedable RNGs implemented in Javascript. +// +// Usage: +// +// var seedrandom = require('seedrandom'); +// var random = seedrandom(1); // or any seed. +// var x = random(); // 0 <= x < 1. Every bit is random. +// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. + +// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. +// Period: ~2^116 +// Reported to pass all BigCrush tests. +var alea = require('./lib/alea'); + +// xor128, a pure xor-shift generator by George Marsaglia. +// Period: 2^128-1. +// Reported to fail: MatrixRank and LinearComp. +var xor128 = require('./lib/xor128'); + +// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. +// Period: 2^192-2^32 +// Reported to fail: CollisionOver, SimpPoker, and LinearComp. +var xorwow = require('./lib/xorwow'); + +// xorshift7, by François Panneton and Pierre L'ecuyer, takes +// a different approach: it adds robustness by allowing more shifts +// than Marsaglia's original three. It is a 7-shift generator +// with 256 bits, that passes BigCrush with no systmatic failures. +// Period 2^256-1. +// No systematic BigCrush failures reported. +var xorshift7 = require('./lib/xorshift7'); + +// xor4096, by Richard Brent, is a 4096-bit xor-shift with a +// very long period that also adds a Weyl generator. It also passes +// BigCrush with no systematic failures. Its long period may +// be useful if you have many generators and need to avoid +// collisions. +// Period: 2^4128-2^32. +// No systematic BigCrush failures reported. +var xor4096 = require('./lib/xor4096'); + +// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random +// number generator derived from ChaCha, a modern stream cipher. +// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf +// Period: ~2^127 +// No systematic BigCrush failures reported. +var tychei = require('./lib/tychei'); + +// The original ARC4-based prng included in this library. +// Period: ~2^1600 +var sr = require('./seedrandom'); + +sr.alea = alea; +sr.xor128 = xor128; +sr.xorwow = xorwow; +sr.xorshift7 = xorshift7; +sr.xor4096 = xor4096; +sr.tychei = tychei; + +module.exports = sr; diff --git a/node_modules/seedrandom/lib/alea.js b/node_modules/seedrandom/lib/alea.js new file mode 100644 index 0000000..f912ffd --- /dev/null +++ b/node_modules/seedrandom/lib/alea.js @@ -0,0 +1,114 @@ +// A port of an algorithm by Johannes Baagøe , 2010 +// http://baagoe.com/en/RandomMusings/javascript/ +// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror +// Original work is under MIT license - + +// Copyright (C) 2010 by Johannes Baagøe +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + + +(function(global, module, define) { + +function Alea(seed) { + var me = this, mash = Mash(); + + me.next = function() { + var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 + me.s0 = me.s1; + me.s1 = me.s2; + return me.s2 = t - (me.c = t | 0); + }; + + // Apply the seeding algorithm from Baagoe. + me.c = 1; + me.s0 = mash(' '); + me.s1 = mash(' '); + me.s2 = mash(' '); + me.s0 -= mash(seed); + if (me.s0 < 0) { me.s0 += 1; } + me.s1 -= mash(seed); + if (me.s1 < 0) { me.s1 += 1; } + me.s2 -= mash(seed); + if (me.s2 < 0) { me.s2 += 1; } + mash = null; +} + +function copy(f, t) { + t.c = f.c; + t.s0 = f.s0; + t.s1 = f.s1; + t.s2 = f.s2; + return t; +} + +function impl(seed, opts) { + var xg = new Alea(seed), + state = opts && opts.state, + prng = xg.next; + prng.int32 = function() { return (xg.next() * 0x100000000) | 0; } + prng.double = function() { + return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 + }; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +function Mash() { + var n = 0xefc8249d; + + var mash = function(data) { + data = data.toString(); + for (var i = 0; i < data.length; i++) { + n += data.charCodeAt(i); + var h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000; // 2^32 + } + return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 + }; + + return mash; +} + + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.alea = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + diff --git a/node_modules/seedrandom/lib/alea.min.js b/node_modules/seedrandom/lib/alea.min.js new file mode 100644 index 0000000..51b0219 --- /dev/null +++ b/node_modules/seedrandom/lib/alea.min.js @@ -0,0 +1 @@ +!function(a,b,c){function d(a){var b=this,c=g();b.next=function(){var a=2091639*b.s0+2.3283064365386963e-10*b.c;return b.s0=b.s1,b.s1=b.s2,b.s2=a-(b.c=0|a)},b.c=1,b.s0=c(" "),b.s1=c(" "),b.s2=c(" "),b.s0-=c(a),b.s0<0&&(b.s0+=1),b.s1-=c(a),b.s1<0&&(b.s1+=1),b.s2-=c(a),b.s2<0&&(b.s2+=1),c=null}function e(a,b){return b.c=a.c,b.s0=a.s0,b.s1=a.s1,b.s2=a.s2,b}function f(a,b){var c=new d(a),f=b&&b.state,g=c.next;return g.int32=function(){return 4294967296*c.next()|0},g.double=function(){return g()+1.1102230246251565e-16*(2097152*g()|0)},g.quick=g,f&&("object"==typeof f&&e(f,c),g.state=function(){return e(c,{})}),g}function g(){var a=4022871197,b=function(b){b=b.toString();for(var c=0;c>>0,d-=a,d*=a,a=d>>>0,d-=a,a+=4294967296*d}return 2.3283064365386963e-10*(a>>>0)};return b}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.alea=f}(this,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/node_modules/seedrandom/lib/crypto.js b/node_modules/seedrandom/lib/crypto.js new file mode 100644 index 0000000..18ee91f --- /dev/null +++ b/node_modules/seedrandom/lib/crypto.js @@ -0,0 +1,11 @@ +// mimic a subset of node's crypto API for the browser + +function randomBytes(width) { + var out = new Uint8Array(width); + (global.crypto || global.msCrypto).getRandomValues(out); + return out; +} + +module.exports = { + randomBytes: randomBytes +} diff --git a/node_modules/seedrandom/lib/tychei.js b/node_modules/seedrandom/lib/tychei.js new file mode 100644 index 0000000..3d0ddd4 --- /dev/null +++ b/node_modules/seedrandom/lib/tychei.js @@ -0,0 +1,103 @@ +// A Javascript implementaion of the "Tyche-i" prng algorithm by +// Samuel Neves and Filipe Araujo. +// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var b = me.b, c = me.c, d = me.d, a = me.a; + b = (b << 25) ^ (b >>> 7) ^ c; + c = (c - d) | 0; + d = (d << 24) ^ (d >>> 8) ^ a; + a = (a - b) | 0; + me.b = b = (b << 20) ^ (b >>> 12) ^ c; + me.c = c = (c - d) | 0; + me.d = (d << 16) ^ (c >>> 16) ^ a; + return me.a = (a - b) | 0; + }; + + /* The following is non-inverted tyche, which has better internal + * bit diffusion, but which is about 25% slower than tyche-i in JS. + me.next = function() { + var a = me.a, b = me.b, c = me.c, d = me.d; + a = (me.a + me.b | 0) >>> 0; + d = me.d ^ a; d = d << 16 ^ d >>> 16; + c = me.c + d | 0; + b = me.b ^ c; b = b << 12 ^ d >>> 20; + me.a = a = a + b | 0; + d = d ^ a; me.d = d = d << 8 ^ d >>> 24; + me.c = c = c + d | 0; + b = b ^ c; + return me.b = (b << 7 ^ b >>> 25); + } + */ + + me.a = 0; + me.b = 0; + me.c = 2654435769 | 0; + me.d = 1367130551; + + if (seed === Math.floor(seed)) { + // Integer seed. + me.a = (seed / 0x100000000) | 0; + me.b = seed | 0; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 20; k++) { + me.b ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.a = f.a; + t.b = f.b; + t.c = f.c; + t.d = f.d; + return t; +}; + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.tychei = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + diff --git a/node_modules/seedrandom/lib/tychei.min.js b/node_modules/seedrandom/lib/tychei.min.js new file mode 100644 index 0000000..12849dc --- /dev/null +++ b/node_modules/seedrandom/lib/tychei.min.js @@ -0,0 +1 @@ +!function(a,b,c){function d(a){var b=this,c="";b.next=function(){var a=b.b,c=b.c,d=b.d,e=b.a;return a=a<<25^a>>>7^c,c=c-d|0,d=d<<24^d>>>8^e,e=e-a|0,b.b=a=a<<20^a>>>12^c,b.c=c=c-d|0,b.d=d<<16^c>>>16^e,b.a=e-a|0},b.a=0,b.b=0,b.c=-1640531527,b.d=1367130551,a===Math.floor(a)?(b.a=a/4294967296|0,b.b=0|a):c+=a;for(var d=0;d>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&("object"==typeof f&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.tychei=f}(this,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/node_modules/seedrandom/lib/xor128.js b/node_modules/seedrandom/lib/xor128.js new file mode 100644 index 0000000..c461934 --- /dev/null +++ b/node_modules/seedrandom/lib/xor128.js @@ -0,0 +1,81 @@ +// A Javascript implementaion of the "xor128" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + + // Set up generator function. + me.next = function() { + var t = me.x ^ (me.x << 11); + me.x = me.y; + me.y = me.z; + me.z = me.w; + return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); + }; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xor128 = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + diff --git a/node_modules/seedrandom/lib/xor128.min.js b/node_modules/seedrandom/lib/xor128.min.js new file mode 100644 index 0000000..dbd1cba --- /dev/null +++ b/node_modules/seedrandom/lib/xor128.min.js @@ -0,0 +1 @@ +!function(a,b,c){function d(a){var b=this,c="";b.x=0,b.y=0,b.z=0,b.w=0,b.next=function(){var a=b.x^b.x<<11;return b.x=b.y,b.y=b.z,b.z=b.w,b.w^=b.w>>>19^a^a>>>8},a===(0|a)?b.x=a:c+=a;for(var d=0;d>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&("object"==typeof f&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.xor128=f}(this,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/node_modules/seedrandom/lib/xor4096.js b/node_modules/seedrandom/lib/xor4096.js new file mode 100644 index 0000000..6adf19f --- /dev/null +++ b/node_modules/seedrandom/lib/xor4096.js @@ -0,0 +1,146 @@ +// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. +// +// This fast non-cryptographic random number generator is designed for +// use in Monte-Carlo algorithms. It combines a long-period xorshift +// generator with a Weyl generator, and it passes all common batteries +// of stasticial tests for randomness while consuming only a few nanoseconds +// for each prng generated. For background on the generator, see Brent's +// paper: "Some long-period random number generators using shifts and xors." +// http://arxiv.org/pdf/1004.3115v1.pdf +// +// Usage: +// +// var xor4096 = require('xor4096'); +// random = xor4096(1); // Seed with int32 or string. +// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. +// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. +// +// For nonzero numeric keys, this impelementation provides a sequence +// identical to that by Brent's xorgens 3 implementaion in C. This +// implementation also provides for initalizing the generator with +// string seeds, or for saving and restoring the state of the generator. +// +// On Chrome, this prng benchmarks about 2.1 times slower than +// Javascript's built-in Math.random(). + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + var w = me.w, + X = me.X, i = me.i, t, v; + // Update Weyl generator. + me.w = w = (w + 0x61c88647) | 0; + // Update xor generator. + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + // Update Xor generator array state. + v = X[i] = v ^ t; + me.i = i; + // Result is the combination. + return (v + (w ^ (w >>> 16))) | 0; + }; + + function init(me, seed) { + var t, v, i, j, w, X = [], limit = 128; + if (seed === (seed | 0)) { + // Numeric seeds initialize v, which is used to generates X. + v = seed; + seed = null; + } else { + // String seeds are mixed into v and X one character at a time. + seed = seed + '\0'; + v = 0; + limit = Math.max(limit, seed.length); + } + // Initialize circular array and weyl value. + for (i = 0, j = -32; j < limit; ++j) { + // Put the unicode characters into the array, and shuffle them. + if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); + // After 32 shuffles, take v as the starting w value. + if (j === 0) w = v; + v ^= v << 10; + v ^= v >>> 15; + v ^= v << 4; + v ^= v >>> 13; + if (j >= 0) { + w = (w + 0x61c88647) | 0; // Weyl. + t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. + i = (0 == t) ? i + 1 : 0; // Count zeroes. + } + } + // We have detected all zeroes; make the key nonzero. + if (i >= 128) { + X[(seed && seed.length || 0) & 127] = -1; + } + // Run the generator 512 times to further mix the state before using it. + // Factoring this as a function slows the main generator, so it is just + // unrolled here. The weyl generator is not advanced while warming up. + i = 127; + for (j = 4 * 128; j > 0; --j) { + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + X[i] = v ^ t; + } + // Storing state as object members is faster than using closure variables. + me.w = w; + me.X = X; + me.i = i; + } + + init(me, seed); +} + +function copy(f, t) { + t.i = f.i; + t.w = f.w; + t.X = f.X.slice(); + return t; +}; + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.X) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xor4096 = impl; +} + +})( + this, // window object or global + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); diff --git a/node_modules/seedrandom/lib/xor4096.min.js b/node_modules/seedrandom/lib/xor4096.min.js new file mode 100644 index 0000000..a7d37c5 --- /dev/null +++ b/node_modules/seedrandom/lib/xor4096.min.js @@ -0,0 +1 @@ +!function(a,b,c){function d(a){function b(a,b){var c,d,e,f,g,h=[],i=128;for(b===(0|b)?(d=b,b=null):(b+="\0",d=0,i=Math.max(i,b.length)),e=0,f=-32;f>>15,d^=d<<4,d^=d>>>13,f>=0&&(g=g+1640531527|0,c=h[127&f]^=d+g,e=0==c?e+1:0);for(e>=128&&(h[127&(b&&b.length||0)]=-1),e=127,f=512;f>0;--f)d=h[e+34&127],c=h[e=e+1&127],d^=d<<13,c^=c<<17,d^=d>>>15,c^=c>>>12,h[e]=d^c;a.w=g,a.X=h,a.i=e}var c=this;c.next=function(){var a,b,d=c.w,e=c.X,f=c.i;return c.w=d=d+1640531527|0,b=e[f+34&127],a=e[f=f+1&127],b^=b<<13,a^=a<<17,b^=b>>>15,a^=a>>>12,b=e[f]=b^a,c.i=f,b+(d^d>>>16)|0},b(c,a)}function e(a,b){return b.i=a.i,b.w=a.w,b.X=a.X.slice(),b}function f(a,b){null==a&&(a=+new Date);var c=new d(a),f=b&&b.state,g=function(){return(c.next()>>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&(f.X&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.xor4096=f}(this,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/node_modules/seedrandom/lib/xorshift7.js b/node_modules/seedrandom/lib/xorshift7.js new file mode 100644 index 0000000..b7e5151 --- /dev/null +++ b/node_modules/seedrandom/lib/xorshift7.js @@ -0,0 +1,97 @@ +// A Javascript implementaion of the "xorshift7" algorithm by +// François Panneton and Pierre L'ecuyer: +// "On the Xorgshift Random Number Generators" +// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + // Update xor generator. + var X = me.x, i = me.i, t, v, w; + t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); + t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); + t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); + t = X[(i + 4) & 7]; v ^= t ^ (t << 7); + t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); + X[i] = v; + me.i = (i + 1) & 7; + return v; + }; + + function init(me, seed) { + var j, w, X = []; + + if (seed === (seed | 0)) { + // Seed state array using a 32-bit integer. + w = X[0] = seed; + } else { + // Seed state using a string. + seed = '' + seed; + for (j = 0; j < seed.length; ++j) { + X[j & 7] = (X[j & 7] << 15) ^ + (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); + } + } + // Enforce an array length of 8, not all zeroes. + while (X.length < 8) X.push(0); + for (j = 0; j < 8 && X[j] === 0; ++j); + if (j == 8) w = X[7] = -1; else w = X[j]; + + me.x = X; + me.i = 0; + + // Discard an initial 256 values. + for (j = 256; j > 0; --j) { + me.next(); + } + } + + init(me, seed); +} + +function copy(f, t) { + t.x = f.x.slice(); + t.i = f.i; + return t; +} + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.x) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xorshift7 = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + diff --git a/node_modules/seedrandom/lib/xorshift7.min.js b/node_modules/seedrandom/lib/xorshift7.min.js new file mode 100644 index 0000000..cf534d4 --- /dev/null +++ b/node_modules/seedrandom/lib/xorshift7.min.js @@ -0,0 +1 @@ +!function(a,b,c){function d(a){function b(a,b){var c,d,e=[];if(b===(0|b))d=e[0]=b;else for(b=""+b,c=0;c0;--c)a.next()}var c=this;c.next=function(){var a,b,d=c.x,e=c.i;return a=d[e],a^=a>>>7,b=a^a<<24,a=d[e+1&7],b^=a^a>>>10,a=d[e+3&7],b^=a^a>>>3,a=d[e+4&7],b^=a^a<<7,a=d[e+7&7],a^=a<<13,b^=a^a<<9,d[e]=b,c.i=e+1&7,b},b(c,a)}function e(a,b){return b.x=a.x.slice(),b.i=a.i,b}function f(a,b){null==a&&(a=+new Date);var c=new d(a),f=b&&b.state,g=function(){return(c.next()>>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&(f.x&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.xorshift7=f}(this,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/node_modules/seedrandom/lib/xorwow.js b/node_modules/seedrandom/lib/xorwow.js new file mode 100644 index 0000000..79d5e44 --- /dev/null +++ b/node_modules/seedrandom/lib/xorwow.js @@ -0,0 +1,86 @@ +// A Javascript implementaion of the "xorwow" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var t = (me.x ^ (me.x >>> 2)); + me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; + return (me.d = (me.d + 362437 | 0)) + + (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; + }; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.v = 0; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + if (k == strseed.length) { + me.d = me.x << 10 ^ me.x >>> 4; + } + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + t.v = f.v; + t.d = f.d; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xorwow = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + diff --git a/node_modules/seedrandom/lib/xorwow.min.js b/node_modules/seedrandom/lib/xorwow.min.js new file mode 100644 index 0000000..877a481 --- /dev/null +++ b/node_modules/seedrandom/lib/xorwow.min.js @@ -0,0 +1 @@ +!function(a,b,c){function d(a){var b=this,c="";b.next=function(){var a=b.x^b.x>>>2;return b.x=b.y,b.y=b.z,b.z=b.w,b.w=b.v,(b.d=b.d+362437|0)+(b.v=b.v^b.v<<4^(a^a<<1))|0},b.x=0,b.y=0,b.z=0,b.w=0,b.v=0,a===(0|a)?b.x=a:c+=a;for(var d=0;d>>4),b.next()}function e(a,b){return b.x=a.x,b.y=a.y,b.z=a.z,b.w=a.w,b.v=a.v,b.d=a.d,b}function f(a,b){var c=new d(a),f=b&&b.state,g=function(){return(c.next()>>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&("object"==typeof f&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.xorwow=f}(this,"object"==typeof module&&module,"function"==typeof define&&define); \ No newline at end of file diff --git a/node_modules/seedrandom/package.json b/node_modules/seedrandom/package.json new file mode 100644 index 0000000..75dae3e --- /dev/null +++ b/node_modules/seedrandom/package.json @@ -0,0 +1,82 @@ +{ + "_from": "seedrandom@~2.4.3", + "_id": "seedrandom@2.4.3", + "_inBundle": false, + "_integrity": "sha1-JDhQTa0zkXMUv/GKxNeU8W1qrsw=", + "_location": "/seedrandom", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "seedrandom@~2.4.3", + "name": "seedrandom", + "escapedName": "seedrandom", + "rawSpec": "~2.4.3", + "saveSpec": null, + "fetchSpec": "~2.4.3" + }, + "_requiredBy": [ + "/@tensorflow/tfjs-core" + ], + "_resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-2.4.3.tgz", + "_shasum": "2438504dad33917314bff18ac4d794f16d6aaecc", + "_spec": "seedrandom@~2.4.3", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs-core", + "author": { + "name": "David Bau" + }, + "browser": { + "crypto": false + }, + "bugs": { + "url": "https://github.com/davidbau/seedrandom/issues" + }, + "bundleDependencies": false, + "config": { + "blanket": { + "pattern": [ + "seedrandom.js", + "lib/alea.js", + "lib/xor128.js", + "lib/xorwow.js", + "lib/xorshift7.js", + "lib/tychei.js", + "lib/xor4096.js" + ] + } + }, + "deprecated": false, + "description": "Seeded random number generator for Javascript.", + "devDependencies": { + "blanket": "latest", + "grunt": "latest", + "grunt-bowercopy": "latest", + "grunt-browserify": "latest", + "grunt-cli": "latest", + "grunt-contrib-connect": "latest", + "grunt-contrib-qunit": "latest", + "grunt-contrib-uglify": "latest", + "grunt-mocha-cov": "latest", + "grunt-release": "latest", + "phantomjs-prebuilt": "latest", + "proxyquire": "latest", + "requirejs": "latest" + }, + "homepage": "http://davidbau.com/archives/2010/01/30/random_seeds_coded_hints_and_quintillions.html", + "keywords": [ + "seed", + "random", + "crypto" + ], + "license": "MIT", + "main": "index.js", + "name": "seedrandom", + "repository": { + "type": "git", + "url": "git://github.com/davidbau/seedrandom.git" + }, + "scripts": { + "test": "grunt travis" + }, + "version": "2.4.3" +} diff --git a/node_modules/seedrandom/seedrandom.js b/node_modules/seedrandom/seedrandom.js new file mode 100644 index 0000000..83ea6e8 --- /dev/null +++ b/node_modules/seedrandom/seedrandom.js @@ -0,0 +1,247 @@ +/* +Copyright 2014 David Bau. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +(function (pool, math) { +// +// The following constants are related to IEEE 754 limits. +// +var global = this, + width = 256, // each RC4 output is 0 <= x < 256 + chunks = 6, // at least six RC4 outputs for each double + digits = 52, // there are 52 significant digits in a double + rngname = 'random', // rngname: name for Math.random and Math.seedrandom + startdenom = math.pow(width, chunks), + significance = math.pow(2, digits), + overflow = significance * 2, + mask = width - 1, + nodecrypto; // node.js crypto module, initialized at the bottom. + +// +// seedrandom() +// This is the seedrandom function described above. +// +function seedrandom(seed, options, callback) { + var key = []; + options = (options == true) ? { entropy: true } : (options || {}); + + // Flatten the seed string or build one from local entropy if needed. + var shortseed = mixkey(flatten( + options.entropy ? [seed, tostring(pool)] : + (seed == null) ? autoseed() : seed, 3), key); + + // Use the seed to initialize an ARC4 generator. + var arc4 = new ARC4(key); + + // This function returns a random double in [0, 1) that contains + // randomness in every bit of the mantissa of the IEEE 754 value. + var prng = function() { + var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 + d = startdenom, // and denominator d = 2 ^ 48. + x = 0; // and no 'extra last byte'. + while (n < significance) { // Fill up all significant digits by + n = (n + x) * width; // shifting numerator and + d *= width; // denominator and generating a + x = arc4.g(1); // new least-significant-byte. + } + while (n >= overflow) { // To avoid rounding up, before adding + n /= 2; // last byte, shift everything + d /= 2; // right using integer math until + x >>>= 1; // we have exactly the desired bits. + } + return (n + x) / d; // Form the number within [0, 1). + }; + + prng.int32 = function() { return arc4.g(4) | 0; } + prng.quick = function() { return arc4.g(4) / 0x100000000; } + prng.double = prng; + + // Mix the randomness into accumulated entropy. + mixkey(tostring(arc4.S), pool); + + // Calling convention: what to return as a function of prng, seed, is_math. + return (options.pass || callback || + function(prng, seed, is_math_call, state) { + if (state) { + // Load the arc4 state from the given state if it has an S array. + if (state.S) { copy(state, arc4); } + // Only provide the .state method if requested via options.state. + prng.state = function() { return copy(arc4, {}); } + } + + // If called as a method of Math (Math.seedrandom()), mutate + // Math.random because that is how seedrandom.js has worked since v1.0. + if (is_math_call) { math[rngname] = prng; return seed; } + + // Otherwise, it is a newer calling convention, so return the + // prng directly. + else return prng; + })( + prng, + shortseed, + 'global' in options ? options.global : (this == math), + options.state); +} +math['seed' + rngname] = seedrandom; + +// +// ARC4 +// +// An ARC4 implementation. The constructor takes a key in the form of +// an array of at most (width) integers that should be 0 <= x < (width). +// +// The g(count) method returns a pseudorandom integer that concatenates +// the next (count) outputs from ARC4. Its return value is a number x +// that is in the range 0 <= x < (width ^ count). +// +function ARC4(key) { + var t, keylen = key.length, + me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; + + // The empty key [] is treated as [0]. + if (!keylen) { key = [keylen++]; } + + // Set up S using the standard key scheduling algorithm. + while (i < width) { + s[i] = i++; + } + for (i = 0; i < width; i++) { + s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; + s[j] = t; + } + + // The "g" method returns the next (count) outputs as one number. + (me.g = function(count) { + // Using instance members instead of closure state nearly doubles speed. + var t, r = 0, + i = me.i, j = me.j, s = me.S; + while (count--) { + t = s[i = mask & (i + 1)]; + r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; + } + me.i = i; me.j = j; + return r; + // For robust unpredictability, the function call below automatically + // discards an initial batch of values. This is called RC4-drop[256]. + // See http://google.com/search?q=rsa+fluhrer+response&btnI + })(width); +} + +// +// copy() +// Copies internal state of ARC4 to or from a plain object. +// +function copy(f, t) { + t.i = f.i; + t.j = f.j; + t.S = f.S.slice(); + return t; +}; + +// +// flatten() +// Converts an object tree to nested arrays of strings. +// +function flatten(obj, depth) { + var result = [], typ = (typeof obj), prop; + if (depth && typ == 'object') { + for (prop in obj) { + try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} + } + } + return (result.length ? result : typ == 'string' ? obj : obj + '\0'); +} + +// +// mixkey() +// Mixes a string seed into a key that is an array of integers, and +// returns a shortened string seed that is equivalent to the result key. +// +function mixkey(seed, key) { + var stringseed = seed + '', smear, j = 0; + while (j < stringseed.length) { + key[mask & j] = + mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); + } + return tostring(key); +} + +// +// autoseed() +// Returns an object for autoseeding, using window.crypto and Node crypto +// module if available. +// +function autoseed() { + try { + var out; + if (nodecrypto && (out = nodecrypto.randomBytes)) { + // The use of 'out' to remember randomBytes makes tight minified code. + out = out(width); + } else { + out = new Uint8Array(width); + (global.crypto || global.msCrypto).getRandomValues(out); + } + return tostring(out); + } catch (e) { + var browser = global.navigator, + plugins = browser && browser.plugins; + return [+new Date, global, plugins, global.screen, tostring(pool)]; + } +} + +// +// tostring() +// Converts an array of charcodes to a string +// +function tostring(a) { + return String.fromCharCode.apply(0, a); +} + +// +// When seedrandom.js is loaded, we immediately mix a few bits +// from the built-in RNG into the entropy pool. Because we do +// not want to interfere with deterministic PRNG state later, +// seedrandom will not call math.random on its own again after +// initialization. +// +mixkey(math.random(), pool); + +// +// Nodejs and AMD support: export the implementation as a module using +// either convention. +// +if ((typeof module) == 'object' && module.exports) { + module.exports = seedrandom; + // When in node.js, try using crypto package for autoseeding. + try { + nodecrypto = require('crypto'); + } catch (ex) {} +} else if ((typeof define) == 'function' && define.amd) { + define(function() { return seedrandom; }); +} + +// End anonymous scope, and pass initial values. +})( + [], // pool: entropy pool starts empty + Math // math: package containing random, pow, and seedrandom +); diff --git a/node_modules/seedrandom/seedrandom.min.js b/node_modules/seedrandom/seedrandom.min.js new file mode 100644 index 0000000..401b4bf --- /dev/null +++ b/node_modules/seedrandom/seedrandom.min.js @@ -0,0 +1 @@ +!function(a,b){function c(c,j,k){var n=[];j=1==j?{entropy:!0}:j||{};var s=g(f(j.entropy?[c,i(a)]:null==c?h():c,3),n),t=new d(n),u=function(){for(var a=t.g(m),b=p,c=0;a=r;)a/=2,b/=2,c>>>=1;return(a+c)/b};return u.int32=function(){return 0|t.g(4)},u.quick=function(){return t.g(4)/4294967296},u.double=u,g(i(t.S),a),(j.pass||k||function(a,c,d,f){return f&&(f.S&&e(f,t),a.state=function(){return e(t,{})}),d?(b[o]=a,c):a})(u,s,"global"in j?j.global:this==b,j.state)}function d(a){var b,c=a.length,d=this,e=0,f=d.i=d.j=0,g=d.S=[];for(c||(a=[c++]);e + + + + +
+
+ + + + + + diff --git a/node_modules/seedrandom/test/autoseed.html b/node_modules/seedrandom/test/autoseed.html new file mode 100644 index 0000000..2738f24 --- /dev/null +++ b/node_modules/seedrandom/test/autoseed.html @@ -0,0 +1,46 @@ + + + + + +
+
+ + + + + diff --git a/node_modules/seedrandom/test/bitgen.js b/node_modules/seedrandom/test/bitgen.js new file mode 100644 index 0000000..c3563d5 --- /dev/null +++ b/node_modules/seedrandom/test/bitgen.js @@ -0,0 +1,45 @@ +#!/usr/bin/env node +var seedrandom = require('../seedrandom'); + +// process.on('SIGPIPE', process.exit); +function epipeBomb(stream, callback) { + if (stream == null) stream = process.stdout; + if (callback == null) callback = process.exit; + + function epipeFilter(err) { + if (err.code === 'EPIPE') return callback(); + + // If there's more than one error handler (ie, us), + // then the error won't be bubbled up anyway + if (stream.listeners('error').length <= 1) { + stream.removeAllListeners(); // Pretend we were never here + stream.emit('error', err); // Then emit as if we were never here + stream.on('error', epipeFilter);// Reattach, ready for the next error! + } + } + + stream.on('error', epipeFilter); +} + +epipeBomb(); + +var bufsize = 1024 * 256, + buf = new Buffer(bufsize * 4), + prng = seedrandom(0), + count = parseInt(process.argv[2]) || Infinity; +function dowrite() { + while (count > 0) { + for (var j = 0; j < bufsize; ++j) { + buf.writeUInt32BE(Math.floor( + prng() * 256 * 256 * 256 * 256 + ), j * 4); + } + count -= bufsize * 32; + if (!process.stdout.write(buf)) { + process.stdout.once('drain', function() { setTimeout(dowrite, 0) }); + return; + } + } +} + +dowrite(); diff --git a/node_modules/seedrandom/test/browserified.html b/node_modules/seedrandom/test/browserified.html new file mode 100644 index 0000000..724654e --- /dev/null +++ b/node_modules/seedrandom/test/browserified.html @@ -0,0 +1,23 @@ + + + + + +
+
+ + + + + diff --git a/node_modules/seedrandom/test/browserified.js b/node_modules/seedrandom/test/browserified.js new file mode 100644 index 0000000..518be87 --- /dev/null +++ b/node_modules/seedrandom/test/browserified.js @@ -0,0 +1,489 @@ +require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= overflow) { // To avoid rounding up, before adding + n /= 2; // last byte, shift everything + d /= 2; // right using integer math until + x >>>= 1; // we have exactly the desired bits. + } + return (n + x) / d; // Form the number within [0, 1). + }; + + prng.int32 = function() { return arc4.g(4) | 0; } + prng.quick = function() { return arc4.g(4) / 0x100000000; } + prng.double = prng; + + // Mix the randomness into accumulated entropy. + mixkey(tostring(arc4.S), pool); + + // Calling convention: what to return as a function of prng, seed, is_math. + return (options.pass || callback || + function(prng, seed, is_math_call, state) { + if (state) { + // Load the arc4 state from the given state if it has an S array. + if (state.S) { copy(state, arc4); } + // Only provide the .state method if requested via options.state. + prng.state = function() { return copy(arc4, {}); } + } + + // If called as a method of Math (Math.seedrandom()), mutate + // Math.random because that is how seedrandom.js has worked since v1.0. + if (is_math_call) { math[rngname] = prng; return seed; } + + // Otherwise, it is a newer calling convention, so return the + // prng directly. + else return prng; + })( + prng, + shortseed, + 'global' in options ? options.global : (this == math), + options.state); +} +math['seed' + rngname] = seedrandom; + +// +// ARC4 +// +// An ARC4 implementation. The constructor takes a key in the form of +// an array of at most (width) integers that should be 0 <= x < (width). +// +// The g(count) method returns a pseudorandom integer that concatenates +// the next (count) outputs from ARC4. Its return value is a number x +// that is in the range 0 <= x < (width ^ count). +// +function ARC4(key) { + var t, keylen = key.length, + me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; + + // The empty key [] is treated as [0]. + if (!keylen) { key = [keylen++]; } + + // Set up S using the standard key scheduling algorithm. + while (i < width) { + s[i] = i++; + } + for (i = 0; i < width; i++) { + s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; + s[j] = t; + } + + // The "g" method returns the next (count) outputs as one number. + (me.g = function(count) { + // Using instance members instead of closure state nearly doubles speed. + var t, r = 0, + i = me.i, j = me.j, s = me.S; + while (count--) { + t = s[i = mask & (i + 1)]; + r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; + } + me.i = i; me.j = j; + return r; + // For robust unpredictability, the function call below automatically + // discards an initial batch of values. This is called RC4-drop[256]. + // See http://google.com/search?q=rsa+fluhrer+response&btnI + })(width); +} + +// +// copy() +// Copies internal state of ARC4 to or from a plain object. +// +function copy(f, t) { + t.i = f.i; + t.j = f.j; + t.S = f.S.slice(); + return t; +}; + +// +// flatten() +// Converts an object tree to nested arrays of strings. +// +function flatten(obj, depth) { + var result = [], typ = (typeof obj), prop; + if (depth && typ == 'object') { + for (prop in obj) { + try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} + } + } + return (result.length ? result : typ == 'string' ? obj : obj + '\0'); +} + +// +// mixkey() +// Mixes a string seed into a key that is an array of integers, and +// returns a shortened string seed that is equivalent to the result key. +// +function mixkey(seed, key) { + var stringseed = seed + '', smear, j = 0; + while (j < stringseed.length) { + key[mask & j] = + mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); + } + return tostring(key); +} + +// +// autoseed() +// Returns an object for autoseeding, using window.crypto and Node crypto +// module if available. +// +function autoseed() { + try { + var out; + if (nodecrypto && (out = nodecrypto.randomBytes)) { + // The use of 'out' to remember randomBytes makes tight minified code. + out = out(width); + } else { + out = new Uint8Array(width); + (global.crypto || global.msCrypto).getRandomValues(out); + } + return tostring(out); + } catch (e) { + var browser = global.navigator, + plugins = browser && browser.plugins; + return [+new Date, global, plugins, global.screen, tostring(pool)]; + } +} + +// +// tostring() +// Converts an array of charcodes to a string +// +function tostring(a) { + return String.fromCharCode.apply(0, a); +} + +// +// When seedrandom.js is loaded, we immediately mix a few bits +// from the built-in RNG into the entropy pool. Because we do +// not want to interfere with deterministic PRNG state later, +// seedrandom will not call math.random on its own again after +// initialization. +// +mixkey(math.random(), pool); + +// +// Nodejs and AMD support: export the implementation as a module using +// either convention. +// +if ((typeof module) == 'object' && module.exports) { + module.exports = seedrandom; + // When in node.js, try using crypto package for autoseeding. + try { + nodecrypto = require('crypto'); + } catch (ex) {} +} else if ((typeof define) == 'function' && define.amd) { + define(function() { return seedrandom; }); +} + +// End anonymous scope, and pass initial values. +})( + [], // pool: entropy pool starts empty + Math // math: package containing random, pow, and seedrandom +); + +},{"crypto":1}],4:[function(require,module,exports){ +(function (__dirname){ +var assert = require("assert"); +var seedrandom = require("../seedrandom"); +var requirejs = require("requirejs"); + +// Stub out requirejs if in the browser via browserify. +if (!requirejs.config) { + requirejs = require; +} else { + requirejs.config({ + baseUrl: __dirname + }); +} + +describe("Nodejs API Test", function() { + +it('should pass basic tests.', function() { + var original = Math.random, + result, r, xprng, obj, as2, as3, autoseed1, myrng, + firstprng, secondprng, thirdprng, rng; + + result = Math.seedrandom('hello.'); + firstprng = Math.random; + assert.ok(original !== firstprng, "Should change Math.random."); + assert.equal(result, "hello.", "Should return short seed."); + r = Math.random(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + r = Math.random(); + assert.equal(r, 0.3752569768646784, "Should be 'hello.'#2"); + + // should be able to autoseed + result = Math.seedrandom(); + secondprng = Math.random; + assert.ok(original !== secondprng, "Should change Math.random."); + assert.ok(firstprng !== secondprng, "Should change Math.random."); + assert.equal(result.length, 256, "Should return short seed."); + r = Math.random(); + assert.ok(r > 0, "Should be posititive."); + assert.ok(r < 1, "Should be less than 1."); + assert.ok(r != 0.9282578795792454, "Should not be 'hello.'#1"); + assert.ok(r != 0.3752569768646784, "Should not be 'hello.'#2"); + assert.ok(r != 0.7316977468919549, "Should not be 'hello.'#3"); + autoseed1 = r; + + // should be able to add entropy. + result = Math.seedrandom('added entropy.', { entropy:true }); + assert.equal(result.length, 256, "Should return short seed."); + thirdprng = Math.random; + assert.ok(thirdprng !== secondprng, "Should change Math.random."); + r = Math.random(); + assert.ok(r != 0.597067214994467, "Should not be 'added entropy.'#1"); + + // Reset to original Math.random. + Math.random = original; + // should be able to use new Math.seedrandom('hello.') + myrng = new Math.seedrandom('hello.'); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== myrng, "PRNG should not be Math.random."); + r = myrng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + + // should be able to use seedrandom('hello.')" + rng = seedrandom('hello.'); + assert.equal(typeof(rng), 'function', "Should return a function."); + r = rng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== rng, "PRNG should not be Math.random."); + + // Global PRNG: set Math.random. + // should be able to use seedrandom('hello.', { global: true }) + result = seedrandom('hello.', { global: true }); + assert.equal(result, 'hello.', "Should return short seed."); + assert.ok(original != Math.random, "Should change Math.random."); + r = Math.random(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + + // Autoseeded non-global + Math.random = original; + // should be able to use seedrandom() + result = seedrandom(); + assert.equal(typeof(result), 'function', "Should return function."); + assert.ok(original === Math.random, "Should not change Math.random."); + r = result(); + // got " + r); + assert.ok(r != autoseed1, "Should not repeat previous autoseed."); + assert.ok(r != 0.9282578795792454, "Should not be 'hello.'#1"); + assert.ok(r != 0.7316977468919549, "Should not be 'hello.'#3"); + + // Mixing accumulated entropy. + // should be able to use seedrandom('added entropy.', { entropy: true }) + rng = seedrandom('added entropy.', { entropy: true }); + r = result(); + // got " + r); + assert.ok(r != autoseed1, "Should not repeat previous autoseed."); + assert.ok(r != 0.597067214994467, "Should not be 'added entropy.'#1"); + + // Legacy calling convention for mixing accumulated entropy. + // should be able to use seedrandom('added entropy.', true) + rng = seedrandom('added entropy.', true); + r = result(); + // got " + r); + assert.ok(r != autoseed1, "Should not repeat previous autoseed."); + assert.ok(r != 0.597067214994467, "Should not be 'added entropy.'#1"); + + // The pass option + // should be able to use Math.seedrandom(null, { pass: ... + obj = Math.seedrandom(null, { pass: function(prng, seed) { + return { random: prng, seed: seed }; + }}); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== obj.random, "Should be different from Math.random."); + assert.equal(typeof(obj.random), 'function', "Should return a PRNG function."); + assert.equal(typeof(obj.seed), 'string', "Should return a seed."); + as2 = obj.random(); + assert.ok(as2 != 0.9282578795792454, "Should not be 'hello.'#1"); + rng = seedrandom(obj.seed); + as3 = rng(); + assert.equal(as2, as3, "Should be reproducible when using the seed."); + + // Exercise pass again, with explicit seed and global + // should be able to use Math.seedrandom('hello.', { pass: ... + result = Math.seedrandom('hello.', { + global: 'abc', + pass: function(prng, seed, global) { + assert.equal(typeof(prng), 'function', "Callback arg #1 assert"); + assert.equal(seed, 'hello.', "Callback arg #2 assert"); + assert.equal(global, 'abc', "Callback arg #3 passed through."); + assert.equal(prng(), 0.9282578795792454, "Should be 'hello.'#1"); + return 'def'; + }}); + assert.equal(result, 'def', "Should return value from callback."); + assert.ok(original === Math.random, "Should not change Math.random."); + + // Legacy third argument callback argument: + // should be able to use Math.seedrandom('hello.', { global: 50 }, callback) + result = Math.seedrandom('hello.', { global: 50 }, + function(prng, seed, global) { + assert.equal(typeof(prng), 'function', "Callback arg #1 assert"); + assert.equal(seed, 'hello.', "Callback arg #2 assert"); + assert.equal(global, 50, "Callback arg #3 assert"); + assert.equal(prng(), 0.9282578795792454, "Should be 'hello.'#1"); + return 'zzz'; + }); + assert.equal(result, 'zzz', "Should return value from callback."); + assert.ok(original === Math.random, "Should not change Math.random."); + + // Global: false. + // should be able to use new Math.seedrandom('hello.', {global: false}) + myrng = new Math.seedrandom('hello.', {global:false}); + assert.equal(typeof(myrng), 'function', "Should return a PRNG funciton."); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== myrng, "PRNG should not be Math.random."); + r = myrng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + + // options = {} when a method of Math. + // should be able to use Math.seedrandom('hello.', {}) + result = Math.seedrandom('hello.'); + xprng = Math.random; + assert.ok(original !== xprng, "Should change Math.random."); + assert.equal(result, "hello.", "Should return short seed."); + r = Math.random(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + r = Math.random(); + assert.equal(r, 0.3752569768646784, "Should be 'hello.'#2"); + Math.random = original; + + // options = {} when not a method of Math + // should be able to use seedrandom('hello.', {}) + rng = seedrandom('hello.', {}); + assert.equal(typeof(rng), 'function', "Should return a function."); + r = rng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== rng, "PRNG should not be Math.random."); +}); + +it('should support state api.', function() { + // Verify that there is no state method + var dummy = seedrandom('hello'); + var unexpected = -1; + var expected = -1; + try { + unexpected = dummy.state(); + } catch(e) { + expected = 1; + } + assert.equal(unexpected, -1); + assert.equal(expected, 1); + var count = 0; + for (var x in dummy) { + if (x == 'state') count += 1; + } + assert.equal(count, 0); + + // Verify that a state method can be added + var saveable = seedrandom("secret-seed", {state: true}); + var ordinary = seedrandom("secret-seed"); + for (var j = 0; j < 1e2; ++j) { + assert.equal(ordinary(), saveable()); + } + var virgin = seedrandom("secret-seed"); + var saved = saveable.state(); + var replica = seedrandom("", {state: saved}); + for (var j = 0; j < 1e2; ++j) { + var r = replica(); + assert.equal(r, saveable()); + assert.equal(r, ordinary()); + assert.ok(r != virgin()); + } +}); + +it('should support requirejs in node.', function() { + var original = Math.random; + var rsr = requirejs('../seedrandom'); + var rng = rsr('hello.'); + assert.equal(typeof(rng), 'function', "Should return a function."); + var r = rng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== rng, "PRNG should not be Math.random."); +}); + +// End of test. + +}); + +}).call(this,"/test") +},{"../seedrandom":3,"assert":"assert","requirejs":2}],"assert":[function(require,module,exports){ +// Use QUnit.assert to mimic node.assert. + +module.exports = QUnit.assert; + +},{}]},{},[4]); diff --git a/node_modules/seedrandom/test/cryptotest.js b/node_modules/seedrandom/test/cryptotest.js new file mode 100644 index 0000000..1686e59 --- /dev/null +++ b/node_modules/seedrandom/test/cryptotest.js @@ -0,0 +1,57 @@ +var proxyquire = require('proxyquire'); +var assert = require("assert"); +var Module = require("module"); + +describe("Crypto API Test", function() { + +var crypto_stub = {}; +var original = Math.random; +var rng, r; + +// Load seedrandom in absence of any crypto package. +it("should be able to seed without crypto", function() { + var noncrypto_sr = proxyquire('../seedrandom', { crypto: null }); + rng = noncrypto_sr('hello.'); + assert.equal(typeof(rng), 'function', "Should return a function."); + r = rng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + assert(original === Math.random, "Should not change Math.random."); + assert(original !== rng, "PRNG should not be Math.random."); + var noncrypto_sr = proxyquire('../seedrandom', { crypto: null }); + result = noncrypto_sr(); + assert.equal(typeof(result), 'function', "Should return function."); + assert(original === Math.random, "Should not change Math.random."); + r = result(); + assert(r != 0.9282578795792454, "Should not be 'hello.'#1"); + assert(r != 0.7316977468919549, "Should not be 'hello.'#3"); + assert(r != 0.23144008215179881, "Should not be '\\0'#1"); + assert(r != 0.7220382488550928, "Should not be '\\1'#1"); + // Recache original seedrandom. + proxyquire('../seedrandom', {}); +}); + +// Load seedrandom with zeroed-out crypto package. +it("should be able to seed ('hello.') with zero crypto", function() { + var zerocrypto_sr = proxyquire('../seedrandom', { + crypto: { randomBytes: function(n) { + result = []; while (n-- > 0) { result.push(1); } return result; } } + }); + rng = zerocrypto_sr('hello.'); + assert.equal(typeof(rng), 'function', "Should return a function."); + r = rng(); + assert.equal(r, 0.9282578795792454 , "Should be 'hello.'#1"); + assert(original === Math.random, "Should not change Math.random."); + assert(original !== rng, "PRNG should not be Math.random."); + rng = zerocrypto_sr(); + assert.equal(typeof(rng), 'function', "Should return function."); + assert(original === Math.random, "Should not change Math.random."); + r = rng(); + assert.equal(r, 0.7220382488550928, "Should be '\\1'#1"); + r = rng(); + assert.equal(r, 0.0259971860493045, "Should be '\\1'#2"); + // Recache original seedrandom. + proxyquire('../seedrandom', {}); +}); + + +}); diff --git a/node_modules/seedrandom/test/lib/qunit.css b/node_modules/seedrandom/test/lib/qunit.css new file mode 100644 index 0000000..593a65f --- /dev/null +++ b/node_modules/seedrandom/test/lib/qunit.css @@ -0,0 +1,415 @@ +/*! + * QUnit 2.1.0 + * https://qunitjs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2016-12-06T04:45Z + */ + +/** Font Family and Sizes */ + +#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult { + font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; +} + +#qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } +#qunit-tests { font-size: smaller; } + + +/** Resets */ + +#qunit-tests, #qunit-header, #qunit-banner, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { + margin: 0; + padding: 0; +} + + +/** Header (excluding toolbar) */ + +#qunit-header { + padding: 0.5em 0 0.5em 1em; + + color: #8699A4; + background-color: #0D3349; + + font-size: 1.5em; + line-height: 1em; + font-weight: 400; + + border-radius: 5px 5px 0 0; +} + +#qunit-header a { + text-decoration: none; + color: #C2CCD1; +} + +#qunit-header a:hover, +#qunit-header a:focus { + color: #FFF; +} + +#qunit-banner { + height: 5px; +} + +#qunit-filteredTest { + padding: 0.5em 1em 0.5em 1em; + color: #366097; + background-color: #F4FF77; +} + +#qunit-userAgent { + padding: 0.5em 1em 0.5em 1em; + color: #FFF; + background-color: #2B81AF; + text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; +} + + +/** Toolbar */ + +#qunit-testrunner-toolbar { + padding: 0.5em 1em 0.5em 1em; + color: #5E740B; + background-color: #EEE; +} + +#qunit-testrunner-toolbar .clearfix { + height: 0; + clear: both; +} + +#qunit-testrunner-toolbar label { + display: inline-block; +} + +#qunit-testrunner-toolbar input[type=checkbox], +#qunit-testrunner-toolbar input[type=radio] { + margin: 3px; + vertical-align: -2px; +} + +#qunit-testrunner-toolbar input[type=text] { + box-sizing: border-box; + height: 1.6em; +} + +.qunit-url-config, +.qunit-filter, +#qunit-modulefilter { + display: inline-block; + line-height: 2.1em; +} + +.qunit-filter, +#qunit-modulefilter { + float: right; + position: relative; + margin-left: 1em; +} + +.qunit-url-config label { + margin-right: 0.5em; +} + +#qunit-modulefilter-search { + box-sizing: border-box; + width: 400px; +} + +#qunit-modulefilter-search-container:after { + position: absolute; + right: 0.3em; + content: "\25bc"; + color: black; +} + +#qunit-modulefilter-dropdown { + /* align with #qunit-modulefilter-search */ + box-sizing: border-box; + width: 400px; + position: absolute; + right: 0; + top: 50%; + margin-top: 0.8em; + + border: 1px solid #D3D3D3; + border-top: none; + border-radius: 0 0 .25em .25em; + color: #000; + background-color: #F5F5F5; + z-index: 99; +} + +#qunit-modulefilter-dropdown a { + color: inherit; + text-decoration: none; +} + +#qunit-modulefilter-dropdown .clickable.checked { + font-weight: bold; + color: #000; + background-color: #D2E0E6; +} + +#qunit-modulefilter-dropdown .clickable:hover { + color: #FFF; + background-color: #0D3349; +} + +#qunit-modulefilter-actions { + display: block; + overflow: auto; + + /* align with #qunit-modulefilter-dropdown-list */ + font: smaller/1.5em sans-serif; +} + +#qunit-modulefilter-dropdown #qunit-modulefilter-actions > * { + box-sizing: border-box; + max-height: 2.8em; + display: block; + padding: 0.4em; +} + +#qunit-modulefilter-dropdown #qunit-modulefilter-actions > button { + float: right; + font: inherit; +} + +#qunit-modulefilter-dropdown #qunit-modulefilter-actions > :last-child { + /* insert padding to align with checkbox margins */ + padding-left: 3px; +} + +#qunit-modulefilter-dropdown-list { + max-height: 200px; + overflow-y: auto; + margin: 0; + border-top: 2px groove threedhighlight; + padding: 0.4em 0 0; + font: smaller/1.5em sans-serif; +} + +#qunit-modulefilter-dropdown-list li { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +#qunit-modulefilter-dropdown-list .clickable { + display: block; + padding-left: 0.15em; +} + + +/** Tests: Pass/Fail */ + +#qunit-tests { + list-style-position: inside; +} + +#qunit-tests li { + padding: 0.4em 1em 0.4em 1em; + border-bottom: 1px solid #FFF; + list-style-position: inside; +} + +#qunit-tests > li { + display: none; +} + +#qunit-tests li.running, +#qunit-tests li.pass, +#qunit-tests li.fail, +#qunit-tests li.skipped { + display: list-item; +} + +#qunit-tests.hidepass { + position: relative; +} + +#qunit-tests.hidepass li.running, +#qunit-tests.hidepass li.pass { + visibility: hidden; + position: absolute; + width: 0; + height: 0; + padding: 0; + border: 0; + margin: 0; +} + +#qunit-tests li strong { + cursor: pointer; +} + +#qunit-tests li.skipped strong { + cursor: default; +} + +#qunit-tests li a { + padding: 0.5em; + color: #C2CCD1; + text-decoration: none; +} + +#qunit-tests li p a { + padding: 0.25em; + color: #6B6464; +} +#qunit-tests li a:hover, +#qunit-tests li a:focus { + color: #000; +} + +#qunit-tests li .runtime { + float: right; + font-size: smaller; +} + +.qunit-assert-list { + margin-top: 0.5em; + padding: 0.5em; + + background-color: #FFF; + + border-radius: 5px; +} + +.qunit-source { + margin: 0.6em 0 0.3em; +} + +.qunit-collapsed { + display: none; +} + +#qunit-tests table { + border-collapse: collapse; + margin-top: 0.2em; +} + +#qunit-tests th { + text-align: right; + vertical-align: top; + padding: 0 0.5em 0 0; +} + +#qunit-tests td { + vertical-align: top; +} + +#qunit-tests pre { + margin: 0; + white-space: pre-wrap; + word-wrap: break-word; +} + +#qunit-tests del { + color: #374E0C; + background-color: #E0F2BE; + text-decoration: none; +} + +#qunit-tests ins { + color: #500; + background-color: #FFCACA; + text-decoration: none; +} + +/*** Test Counts */ + +#qunit-tests b.counts { color: #000; } +#qunit-tests b.passed { color: #5E740B; } +#qunit-tests b.failed { color: #710909; } + +#qunit-tests li li { + padding: 5px; + background-color: #FFF; + border-bottom: none; + list-style-position: inside; +} + +/*** Passing Styles */ + +#qunit-tests li li.pass { + color: #3C510C; + background-color: #FFF; + border-left: 10px solid #C6E746; +} + +#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } +#qunit-tests .pass .test-name { color: #366097; } + +#qunit-tests .pass .test-actual, +#qunit-tests .pass .test-expected { color: #999; } + +#qunit-banner.qunit-pass { background-color: #C6E746; } + +/*** Failing Styles */ + +#qunit-tests li li.fail { + color: #710909; + background-color: #FFF; + border-left: 10px solid #EE5757; + white-space: pre; +} + +#qunit-tests > li:last-child { + border-radius: 0 0 5px 5px; +} + +#qunit-tests .fail { color: #000; background-color: #EE5757; } +#qunit-tests .fail .test-name, +#qunit-tests .fail .module-name { color: #000; } + +#qunit-tests .fail .test-actual { color: #EE5757; } +#qunit-tests .fail .test-expected { color: #008000; } + +#qunit-banner.qunit-fail { background-color: #EE5757; } + +/*** Skipped tests */ + +#qunit-tests .skipped { + background-color: #EBECE9; +} + +#qunit-tests .qunit-skipped-label { + background-color: #F4FF77; + display: inline-block; + font-style: normal; + color: #366097; + line-height: 1.8em; + padding: 0 0.5em; + margin: -0.4em 0.4em -0.4em 0; +} + +/** Result */ + +#qunit-testresult { + padding: 0.5em 1em 0.5em 1em; + + color: #2B81AF; + background-color: #D2E0E6; + + border-bottom: 1px solid #FFF; +} +#qunit-testresult .module-name { + font-weight: 700; +} + +/** Fixture */ + +#qunit-fixture { + position: absolute; + top: -10000px; + left: -10000px; + width: 1000px; + height: 1000px; +} diff --git a/node_modules/seedrandom/test/lib/qunit.js b/node_modules/seedrandom/test/lib/qunit.js new file mode 100644 index 0000000..8b5e69e --- /dev/null +++ b/node_modules/seedrandom/test/lib/qunit.js @@ -0,0 +1,4349 @@ +/*! + * QUnit 2.1.0 + * https://qunitjs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2016-12-06T04:45Z + */ +(function (global$1) { + 'use strict'; + + global$1 = 'default' in global$1 ? global$1['default'] : global$1; + + var window = global$1.window; + var console = global$1.console; + var setTimeout = global$1.setTimeout; + var clearTimeout = global$1.clearTimeout; + + var document = window && window.document; + var navigator = window && window.navigator; + var sessionStorage = window && window.sessionStorage; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + + + + + + + + + + + + + + + + + + + + + var get$1 = function get$1(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get$1(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } + }; + + + + + + + + + + + + + + + + + + var set$1 = function set$1(object, property, value, receiver) { + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent !== null) { + set$1(parent, property, value, receiver); + } + } else if ("value" in desc && desc.writable) { + desc.value = value; + } else { + var setter = desc.set; + + if (setter !== undefined) { + setter.call(receiver, value); + } + } + + return value; + }; + + + + + + + + + + + + + + + + var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } + }; + + var toString = Object.prototype.toString; + var hasOwn = Object.prototype.hasOwnProperty; + var now = Date.now || function () { + return new Date().getTime(); + }; + + var defined = { + document: window && window.document !== undefined, + setTimeout: setTimeout !== undefined + }; + + // Returns a new Array with the elements that are in a but not in b + function diff(a, b) { + var i, + j, + result = a.slice(); + + for (i = 0; i < result.length; i++) { + for (j = 0; j < b.length; j++) { + if (result[i] === b[j]) { + result.splice(i, 1); + i--; + break; + } + } + } + return result; + } + + // From jquery.js + function inArray(elem, array) { + if (array.indexOf) { + return array.indexOf(elem); + } + + for (var i = 0, length = array.length; i < length; i++) { + if (array[i] === elem) { + return i; + } + } + + return -1; + } + + /** + * Makes a clone of an object using only Array or Object as base, + * and copies over the own enumerable properties. + * + * @param {Object} obj + * @return {Object} New object with only the own properties (recursively). + */ + function objectValues(obj) { + var key, + val, + vals = is("array", obj) ? [] : {}; + for (key in obj) { + if (hasOwn.call(obj, key)) { + val = obj[key]; + vals[key] = val === Object(val) ? objectValues(val) : val; + } + } + return vals; + } + + function extend(a, b, undefOnly) { + for (var prop in b) { + if (hasOwn.call(b, prop)) { + if (b[prop] === undefined) { + delete a[prop]; + } else if (!(undefOnly && typeof a[prop] !== "undefined")) { + a[prop] = b[prop]; + } + } + } + + return a; + } + + function objectType(obj) { + if (typeof obj === "undefined") { + return "undefined"; + } + + // Consider: typeof null === object + if (obj === null) { + return "null"; + } + + var match = toString.call(obj).match(/^\[object\s(.*)\]$/), + type = match && match[1]; + + switch (type) { + case "Number": + if (isNaN(obj)) { + return "nan"; + } + return "number"; + case "String": + case "Boolean": + case "Array": + case "Set": + case "Map": + case "Date": + case "RegExp": + case "Function": + case "Symbol": + return type.toLowerCase(); + } + + if ((typeof obj === "undefined" ? "undefined" : _typeof(obj)) === "object") { + return "object"; + } + } + + // Safe object type checking + function is(type, obj) { + return objectType(obj) === type; + } + + // Test for equality any JavaScript type. + // Author: Philippe Rathé + var equiv = (function () { + + // Stack to decide between skip/abort functions + var callers = []; + + // Stack to avoiding loops from circular referencing + var parents = []; + var parentsB = []; + + var getProto = Object.getPrototypeOf || function (obj) { + return obj.__proto__; + }; + + function useStrictEquality(b, a) { + + // To catch short annotation VS 'new' annotation of a declaration. e.g.: + // `var i = 1;` + // `var j = new Number(1);` + if ((typeof a === "undefined" ? "undefined" : _typeof(a)) === "object") { + a = a.valueOf(); + } + if ((typeof b === "undefined" ? "undefined" : _typeof(b)) === "object") { + b = b.valueOf(); + } + + return a === b; + } + + function compareConstructors(a, b) { + var protoA = getProto(a); + var protoB = getProto(b); + + // Comparing constructors is more strict than using `instanceof` + if (a.constructor === b.constructor) { + return true; + } + + // Ref #851 + // If the obj prototype descends from a null constructor, treat it + // as a null prototype. + if (protoA && protoA.constructor === null) { + protoA = null; + } + if (protoB && protoB.constructor === null) { + protoB = null; + } + + // Allow objects with no prototype to be equivalent to + // objects with Object as their constructor. + if (protoA === null && protoB === Object.prototype || protoB === null && protoA === Object.prototype) { + return true; + } + + return false; + } + + function getRegExpFlags(regexp) { + return "flags" in regexp ? regexp.flags : regexp.toString().match(/[gimuy]*$/)[0]; + } + + var callbacks = { + "string": useStrictEquality, + "boolean": useStrictEquality, + "number": useStrictEquality, + "null": useStrictEquality, + "undefined": useStrictEquality, + "symbol": useStrictEquality, + "date": useStrictEquality, + + "nan": function nan() { + return true; + }, + + "regexp": function regexp(b, a) { + return a.source === b.source && + + // Include flags in the comparison + getRegExpFlags(a) === getRegExpFlags(b); + }, + + // - skip when the property is a method of an instance (OOP) + // - abort otherwise, + // initial === would have catch identical references anyway + "function": function _function(b, a) { + + var caller = callers[callers.length - 1]; + return caller !== Object && typeof caller !== "undefined" && a.toString() === b.toString(); + }, + + "array": function array(b, a) { + var i, j, len, loop, aCircular, bCircular; + + len = a.length; + if (len !== b.length) { + + // Safe and faster + return false; + } + + // Track reference to avoid circular references + parents.push(a); + parentsB.push(b); + for (i = 0; i < len; i++) { + loop = false; + for (j = 0; j < parents.length; j++) { + aCircular = parents[j] === a[i]; + bCircular = parentsB[j] === b[i]; + if (aCircular || bCircular) { + if (a[i] === b[i] || aCircular && bCircular) { + loop = true; + } else { + parents.pop(); + parentsB.pop(); + return false; + } + } + } + if (!loop && !innerEquiv(a[i], b[i])) { + parents.pop(); + parentsB.pop(); + return false; + } + } + parents.pop(); + parentsB.pop(); + return true; + }, + + "set": function set(b, a) { + var innerEq, + outerEq = true; + + if (a.size !== b.size) { + return false; + } + + a.forEach(function (aVal) { + innerEq = false; + + b.forEach(function (bVal) { + if (innerEquiv(bVal, aVal)) { + innerEq = true; + } + }); + + if (!innerEq) { + outerEq = false; + } + }); + + return outerEq; + }, + + "map": function map(b, a) { + var innerEq, + outerEq = true; + + if (a.size !== b.size) { + return false; + } + + a.forEach(function (aVal, aKey) { + innerEq = false; + + b.forEach(function (bVal, bKey) { + if (innerEquiv([bVal, bKey], [aVal, aKey])) { + innerEq = true; + } + }); + + if (!innerEq) { + outerEq = false; + } + }); + + return outerEq; + }, + + "object": function object(b, a) { + var i, j, loop, aCircular, bCircular; + + // Default to true + var eq = true; + var aProperties = []; + var bProperties = []; + + if (compareConstructors(a, b) === false) { + return false; + } + + // Stack constructor before traversing properties + callers.push(a.constructor); + + // Track reference to avoid circular references + parents.push(a); + parentsB.push(b); + + // Be strict: don't ensure hasOwnProperty and go deep + for (i in a) { + loop = false; + for (j = 0; j < parents.length; j++) { + aCircular = parents[j] === a[i]; + bCircular = parentsB[j] === b[i]; + if (aCircular || bCircular) { + if (a[i] === b[i] || aCircular && bCircular) { + loop = true; + } else { + eq = false; + break; + } + } + } + aProperties.push(i); + if (!loop && !innerEquiv(a[i], b[i])) { + eq = false; + break; + } + } + + parents.pop(); + parentsB.pop(); + + // Unstack, we are done + callers.pop(); + + for (i in b) { + + // Collect b's properties + bProperties.push(i); + } + + // Ensures identical properties name + return eq && innerEquiv(aProperties.sort(), bProperties.sort()); + } + }; + + function typeEquiv(a, b) { + var type = objectType(a); + return objectType(b) === type && callbacks[type](b, a); + } + + // The real equiv function + function innerEquiv(a, b) { + + // We're done when there's nothing more to compare + if (arguments.length < 2) { + return true; + } + + // Require type-specific equality + return (a === b || typeEquiv(a, b)) && ( + + // ...across all consecutive argument pairs + arguments.length === 2 || innerEquiv.apply(this, [].slice.call(arguments, 1))); + } + + return innerEquiv; + })(); + + /** + * Config object: Maintain internal state + * Later exposed as QUnit.config + * `config` initialized at top of scope + */ + var config = { + + // The queue of tests to run + queue: [], + + // Block until document ready + blocking: true, + + // By default, run previously failed tests first + // very useful in combination with "Hide passed tests" checked + reorder: true, + + // By default, modify document.title when suite is done + altertitle: true, + + // HTML Reporter: collapse every test except the first failing test + // If false, all failing tests will be expanded + collapse: true, + + // By default, scroll to top of the page when suite is done + scrolltop: true, + + // Depth up-to which object will be dumped + maxDepth: 5, + + // When enabled, all tests must call expect() + requireExpects: false, + + // Placeholder for user-configurable form-exposed URL parameters + urlConfig: [], + + // Set of all modules. + modules: [], + + // Stack of nested modules + moduleStack: [], + + // The first unnamed module + currentModule: { + name: "", + tests: [], + childModules: [], + testsRun: 0 + }, + + callbacks: {}, + + // The storage module to use for reordering tests + storage: sessionStorage + }; + + // take a predefined QUnit.config and extend the defaults + var globalConfig = window && window.QUnit && window.QUnit.config; + + // only extend the global config if there is no QUnit overload + if (window && window.QUnit && !window.QUnit.version) { + extend(config, globalConfig); + } + + // Push a loose unnamed module to the modules collection + config.modules.push(config.currentModule); + + // Based on jsDump by Ariel Flesler + // http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html + var dump = (function () { + function quote(str) { + return "\"" + str.toString().replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\""; + } + function literal(o) { + return o + ""; + } + function join(pre, arr, post) { + var s = dump.separator(), + base = dump.indent(), + inner = dump.indent(1); + if (arr.join) { + arr = arr.join("," + s + inner); + } + if (!arr) { + return pre + post; + } + return [pre, inner + arr, base + post].join(s); + } + function array(arr, stack) { + var i = arr.length, + ret = new Array(i); + + if (dump.maxDepth && dump.depth > dump.maxDepth) { + return "[object Array]"; + } + + this.up(); + while (i--) { + ret[i] = this.parse(arr[i], undefined, stack); + } + this.down(); + return join("[", ret, "]"); + } + + function isArray(obj) { + return ( + + //Native Arrays + toString.call(obj) === "[object Array]" || + + // NodeList objects + typeof obj.length === "number" && obj.item !== undefined && (obj.length ? obj.item(0) === obj[0] : obj.item(0) === null && obj[0] === undefined) + ); + } + + var reName = /^function (\w+)/, + dump = { + + // The objType is used mostly internally, you can fix a (custom) type in advance + parse: function parse(obj, objType, stack) { + stack = stack || []; + var res, + parser, + parserType, + inStack = inArray(obj, stack); + + if (inStack !== -1) { + return "recursion(" + (inStack - stack.length) + ")"; + } + + objType = objType || this.typeOf(obj); + parser = this.parsers[objType]; + parserType = typeof parser === "undefined" ? "undefined" : _typeof(parser); + + if (parserType === "function") { + stack.push(obj); + res = parser.call(this, obj, stack); + stack.pop(); + return res; + } + return parserType === "string" ? parser : this.parsers.error; + }, + typeOf: function typeOf(obj) { + var type; + + if (obj === null) { + type = "null"; + } else if (typeof obj === "undefined") { + type = "undefined"; + } else if (is("regexp", obj)) { + type = "regexp"; + } else if (is("date", obj)) { + type = "date"; + } else if (is("function", obj)) { + type = "function"; + } else if (obj.setInterval !== undefined && obj.document !== undefined && obj.nodeType === undefined) { + type = "window"; + } else if (obj.nodeType === 9) { + type = "document"; + } else if (obj.nodeType) { + type = "node"; + } else if (isArray(obj)) { + type = "array"; + } else if (obj.constructor === Error.prototype.constructor) { + type = "error"; + } else { + type = typeof obj === "undefined" ? "undefined" : _typeof(obj); + } + return type; + }, + + separator: function separator() { + if (this.multiline) { + return this.HTML ? "
" : "\n"; + } else { + return this.HTML ? " " : " "; + } + }, + + // Extra can be a number, shortcut for increasing-calling-decreasing + indent: function indent(extra) { + if (!this.multiline) { + return ""; + } + var chr = this.indentChar; + if (this.HTML) { + chr = chr.replace(/\t/g, " ").replace(/ /g, " "); + } + return new Array(this.depth + (extra || 0)).join(chr); + }, + up: function up(a) { + this.depth += a || 1; + }, + down: function down(a) { + this.depth -= a || 1; + }, + setParser: function setParser(name, parser) { + this.parsers[name] = parser; + }, + + // The next 3 are exposed so you can use them + quote: quote, + literal: literal, + join: join, + depth: 1, + maxDepth: config.maxDepth, + + // This is the list of parsers, to modify them, use dump.setParser + parsers: { + window: "[Window]", + document: "[Document]", + error: function error(_error) { + return "Error(\"" + _error.message + "\")"; + }, + unknown: "[Unknown]", + "null": "null", + "undefined": "undefined", + "function": function _function(fn) { + var ret = "function", + + + // Functions never have name in IE + name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1]; + + if (name) { + ret += " " + name; + } + ret += "("; + + ret = [ret, dump.parse(fn, "functionArgs"), "){"].join(""); + return join(ret, dump.parse(fn, "functionCode"), "}"); + }, + array: array, + nodelist: array, + "arguments": array, + object: function object(map, stack) { + var keys, + key, + val, + i, + nonEnumerableProperties, + ret = []; + + if (dump.maxDepth && dump.depth > dump.maxDepth) { + return "[object Object]"; + } + + dump.up(); + keys = []; + for (key in map) { + keys.push(key); + } + + // Some properties are not always enumerable on Error objects. + nonEnumerableProperties = ["message", "name"]; + for (i in nonEnumerableProperties) { + key = nonEnumerableProperties[i]; + if (key in map && inArray(key, keys) < 0) { + keys.push(key); + } + } + keys.sort(); + for (i = 0; i < keys.length; i++) { + key = keys[i]; + val = map[key]; + ret.push(dump.parse(key, "key") + ": " + dump.parse(val, undefined, stack)); + } + dump.down(); + return join("{", ret, "}"); + }, + node: function node(_node) { + var len, + i, + val, + open = dump.HTML ? "<" : "<", + close = dump.HTML ? ">" : ">", + tag = _node.nodeName.toLowerCase(), + ret = open + tag, + attrs = _node.attributes; + + if (attrs) { + for (i = 0, len = attrs.length; i < len; i++) { + val = attrs[i].nodeValue; + + // IE6 includes all attributes in .attributes, even ones not explicitly + // set. Those have values like undefined, null, 0, false, "" or + // "inherit". + if (val && val !== "inherit") { + ret += " " + attrs[i].nodeName + "=" + dump.parse(val, "attribute"); + } + } + } + ret += close; + + // Show content of TextNode or CDATASection + if (_node.nodeType === 3 || _node.nodeType === 4) { + ret += _node.nodeValue; + } + + return ret + open + "/" + tag + close; + }, + + // Function calls it internally, it's the arguments part of the function + functionArgs: function functionArgs(fn) { + var args, + l = fn.length; + + if (!l) { + return ""; + } + + args = new Array(l); + while (l--) { + + // 97 is 'a' + args[l] = String.fromCharCode(97 + l); + } + return " " + args.join(", ") + " "; + }, + + // Object calls it internally, the key part of an item in a map + key: quote, + + // Function calls it internally, it's the content of the function + functionCode: "[code]", + + // Node calls it internally, it's a html attribute value + attribute: quote, + string: quote, + date: quote, + regexp: literal, + number: literal, + "boolean": literal, + symbol: function symbol(sym) { + return sym.toString(); + } + }, + + // If true, entities are escaped ( <, >, \t, space and \n ) + HTML: false, + + // Indentation unit + indentChar: " ", + + // If true, items in a collection, are separated by a \n, else just a space. + multiline: true + }; + + return dump; + })(); + + // Register logging callbacks + function registerLoggingCallbacks(obj) { + var i, + l, + key, + callbackNames = ["begin", "done", "log", "testStart", "testDone", "moduleStart", "moduleDone"]; + + function registerLoggingCallback(key) { + var loggingCallback = function loggingCallback(callback) { + if (objectType(callback) !== "function") { + throw new Error("QUnit logging methods require a callback function as their first parameters."); + } + + config.callbacks[key].push(callback); + }; + + return loggingCallback; + } + + for (i = 0, l = callbackNames.length; i < l; i++) { + key = callbackNames[i]; + + // Initialize key collection of logging callback + if (objectType(config.callbacks[key]) === "undefined") { + config.callbacks[key] = []; + } + + obj[key] = registerLoggingCallback(key); + } + } + + function runLoggingCallbacks(key, args) { + var i, l, callbacks; + + callbacks = config.callbacks[key]; + for (i = 0, l = callbacks.length; i < l; i++) { + callbacks[i](args); + } + } + + // Doesn't support IE9, it will return undefined on these browsers + // See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack + var fileName = (sourceFromStacktrace(0) || "").replace(/(:\d+)+\)?/, "").replace(/.+\//, ""); + + function extractStacktrace(e, offset) { + offset = offset === undefined ? 4 : offset; + + var stack, include, i; + + if (e && e.stack) { + stack = e.stack.split("\n"); + if (/^error$/i.test(stack[0])) { + stack.shift(); + } + if (fileName) { + include = []; + for (i = offset; i < stack.length; i++) { + if (stack[i].indexOf(fileName) !== -1) { + break; + } + include.push(stack[i]); + } + if (include.length) { + return include.join("\n"); + } + } + return stack[offset]; + } + } + + function sourceFromStacktrace(offset) { + var error = new Error(); + + // Support: Safari <=7 only, IE <=10 - 11 only + // Not all browsers generate the `stack` property for `new Error()`, see also #636 + if (!error.stack) { + try { + throw error; + } catch (err) { + error = err; + } + } + + return extractStacktrace(error, offset); + } + + var unitSampler; + var focused = false; + var priorityCount = 0; + + function Test(settings) { + var i, l; + + ++Test.count; + + this.expected = null; + extend(this, settings); + this.assertions = []; + this.semaphore = 0; + this.usedAsync = false; + this.module = config.currentModule; + this.stack = sourceFromStacktrace(3); + + // Register unique strings + for (i = 0, l = this.module.tests; i < l.length; i++) { + if (this.module.tests[i].name === this.testName) { + this.testName += " "; + } + } + + this.testId = generateHash(this.module.name, this.testName); + + this.module.tests.push({ + name: this.testName, + testId: this.testId + }); + + if (settings.skip) { + + // Skipped tests will fully ignore any sent callback + this.callback = function () {}; + this.async = false; + this.expected = 0; + } else { + this.assert = new Assert(this); + } + } + + Test.count = 0; + + function getNotStartedModules(startModule) { + var module = startModule, + modules = []; + + while (module && module.testsRun === 0) { + modules.push(module); + module = module.parentModule; + } + + return modules; + } + + Test.prototype = { + before: function before() { + var i, + startModule, + module = this.module, + notStartedModules = getNotStartedModules(module); + + for (i = notStartedModules.length - 1; i >= 0; i--) { + startModule = notStartedModules[i]; + startModule.stats = { all: 0, bad: 0, started: now() }; + runLoggingCallbacks("moduleStart", { + name: startModule.name, + tests: startModule.tests + }); + } + + config.current = this; + + if (module.testEnvironment) { + delete module.testEnvironment.before; + delete module.testEnvironment.beforeEach; + delete module.testEnvironment.afterEach; + delete module.testEnvironment.after; + } + this.testEnvironment = extend({}, module.testEnvironment); + + this.started = now(); + runLoggingCallbacks("testStart", { + name: this.testName, + module: module.name, + testId: this.testId, + previousFailure: this.previousFailure + }); + + if (!config.pollution) { + saveGlobal(); + } + }, + + run: function run() { + var promise; + + config.current = this; + + this.callbackStarted = now(); + + if (config.notrycatch) { + runTest(this); + return; + } + + try { + runTest(this); + } catch (e) { + this.pushFailure("Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + (e.message || e), extractStacktrace(e, 0)); + + // Else next test will carry the responsibility + saveGlobal(); + + // Restart the tests if they're blocking + if (config.blocking) { + internalRecover(this); + } + } + + function runTest(test) { + promise = test.callback.call(test.testEnvironment, test.assert); + test.resolvePromise(promise); + } + }, + + after: function after() { + checkPollution(); + }, + + queueHook: function queueHook(hook, hookName, hookOwner) { + var promise, + test = this; + return function runHook() { + if (hookName === "before") { + if (hookOwner.testsRun !== 0) { + return; + } + + test.preserveEnvironment = true; + } + + if (hookName === "after" && hookOwner.testsRun !== numberOfTests(hookOwner) - 1) { + return; + } + + config.current = test; + if (config.notrycatch) { + callHook(); + return; + } + try { + callHook(); + } catch (error) { + test.pushFailure(hookName + " failed on " + test.testName + ": " + (error.message || error), extractStacktrace(error, 0)); + } + + function callHook() { + promise = hook.call(test.testEnvironment, test.assert); + test.resolvePromise(promise, hookName); + } + }; + }, + + // Currently only used for module level hooks, can be used to add global level ones + hooks: function hooks(handler) { + var hooks = []; + + function processHooks(test, module) { + if (module.parentModule) { + processHooks(test, module.parentModule); + } + if (module.testEnvironment && objectType(module.testEnvironment[handler]) === "function") { + hooks.push(test.queueHook(module.testEnvironment[handler], handler, module)); + } + } + + // Hooks are ignored on skipped tests + if (!this.skip) { + processHooks(this, this.module); + } + return hooks; + }, + + finish: function finish() { + config.current = this; + if (config.requireExpects && this.expected === null) { + this.pushFailure("Expected number of assertions to be defined, but expect() was " + "not called.", this.stack); + } else if (this.expected !== null && this.expected !== this.assertions.length) { + this.pushFailure("Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack); + } else if (this.expected === null && !this.assertions.length) { + this.pushFailure("Expected at least one assertion, but none were run - call " + "expect(0) to accept zero assertions.", this.stack); + } + + var i, + module = this.module, + moduleName = module.name, + testName = this.testName, + skipped = !!this.skip, + bad = 0, + storage = config.storage; + + this.runtime = now() - this.started; + + config.stats.all += this.assertions.length; + module.stats.all += this.assertions.length; + + for (i = 0; i < this.assertions.length; i++) { + if (!this.assertions[i].result) { + bad++; + config.stats.bad++; + module.stats.bad++; + } + } + + notifyTestsRan(module); + + // Store result when possible + if (storage) { + if (bad) { + storage.setItem("qunit-test-" + moduleName + "-" + testName, bad); + } else { + storage.removeItem("qunit-test-" + moduleName + "-" + testName); + } + } + + runLoggingCallbacks("testDone", { + name: testName, + module: moduleName, + skipped: skipped, + failed: bad, + passed: this.assertions.length - bad, + total: this.assertions.length, + runtime: skipped ? 0 : this.runtime, + + // HTML Reporter use + assertions: this.assertions, + testId: this.testId, + + // Source of Test + source: this.stack + }); + + if (module.testsRun === numberOfTests(module)) { + runLoggingCallbacks("moduleDone", { + name: module.name, + tests: module.tests, + failed: module.stats.bad, + passed: module.stats.all - module.stats.bad, + total: module.stats.all, + runtime: now() - module.stats.started + }); + } + + config.current = undefined; + }, + + preserveTestEnvironment: function preserveTestEnvironment() { + if (this.preserveEnvironment) { + this.module.testEnvironment = this.testEnvironment; + this.testEnvironment = extend({}, this.module.testEnvironment); + } + }, + + queue: function queue() { + var priority, + previousFailCount, + test = this; + + if (!this.valid()) { + return; + } + + function run() { + + // Each of these can by async + synchronize([function () { + test.before(); + }, test.hooks("before"), function () { + test.preserveTestEnvironment(); + }, test.hooks("beforeEach"), function () { + test.run(); + }, test.hooks("afterEach").reverse(), test.hooks("after").reverse(), function () { + test.after(); + }, function () { + test.finish(); + }]); + } + + previousFailCount = config.storage && +config.storage.getItem("qunit-test-" + this.module.name + "-" + this.testName); + + // Prioritize previously failed tests, detected from storage + priority = config.reorder && previousFailCount; + + this.previousFailure = !!previousFailCount; + + return synchronize(run, priority, config.seed); + }, + + pushResult: function pushResult(resultInfo) { + + // Destructure of resultInfo = { result, actual, expected, message, negative } + var source, + details = { + module: this.module.name, + name: this.testName, + result: resultInfo.result, + message: resultInfo.message, + actual: resultInfo.actual, + expected: resultInfo.expected, + testId: this.testId, + negative: resultInfo.negative || false, + runtime: now() - this.started + }; + + if (!resultInfo.result) { + source = sourceFromStacktrace(); + + if (source) { + details.source = source; + } + } + + runLoggingCallbacks("log", details); + + this.assertions.push({ + result: !!resultInfo.result, + message: resultInfo.message + }); + }, + + pushFailure: function pushFailure(message, source, actual) { + if (!(this instanceof Test)) { + throw new Error("pushFailure() assertion outside test context, was " + sourceFromStacktrace(2)); + } + + var details = { + module: this.module.name, + name: this.testName, + result: false, + message: message || "error", + actual: actual || null, + testId: this.testId, + runtime: now() - this.started + }; + + if (source) { + details.source = source; + } + + runLoggingCallbacks("log", details); + + this.assertions.push({ + result: false, + message: message + }); + }, + + resolvePromise: function resolvePromise(promise, phase) { + var then, + resume, + message, + test = this; + if (promise != null) { + then = promise.then; + if (objectType(then) === "function") { + resume = internalStop(test); + then.call(promise, function () { + resume(); + }, function (error) { + message = "Promise rejected " + (!phase ? "during" : phase.replace(/Each$/, "")) + " \"" + test.testName + "\": " + (error && error.message || error); + test.pushFailure(message, extractStacktrace(error, 0)); + + // Else next test will carry the responsibility + saveGlobal(); + + // Unblock + resume(); + }); + } + } + }, + + valid: function valid() { + var filter = config.filter, + regexFilter = /^(!?)\/([\w\W]*)\/(i?$)/.exec(filter), + module = config.module && config.module.toLowerCase(), + fullName = this.module.name + ": " + this.testName; + + function moduleChainNameMatch(testModule) { + var testModuleName = testModule.name ? testModule.name.toLowerCase() : null; + if (testModuleName === module) { + return true; + } else if (testModule.parentModule) { + return moduleChainNameMatch(testModule.parentModule); + } else { + return false; + } + } + + function moduleChainIdMatch(testModule) { + return inArray(testModule.moduleId, config.moduleId) > -1 || testModule.parentModule && moduleChainIdMatch(testModule.parentModule); + } + + // Internally-generated tests are always valid + if (this.callback && this.callback.validTest) { + return true; + } + + if (config.moduleId && config.moduleId.length > 0 && !moduleChainIdMatch(this.module)) { + + return false; + } + + if (config.testId && config.testId.length > 0 && inArray(this.testId, config.testId) < 0) { + + return false; + } + + if (module && !moduleChainNameMatch(this.module)) { + return false; + } + + if (!filter) { + return true; + } + + return regexFilter ? this.regexFilter(!!regexFilter[1], regexFilter[2], regexFilter[3], fullName) : this.stringFilter(filter, fullName); + }, + + regexFilter: function regexFilter(exclude, pattern, flags, fullName) { + var regex = new RegExp(pattern, flags); + var match = regex.test(fullName); + + return match !== exclude; + }, + + stringFilter: function stringFilter(filter, fullName) { + filter = filter.toLowerCase(); + fullName = fullName.toLowerCase(); + + var include = filter.charAt(0) !== "!"; + if (!include) { + filter = filter.slice(1); + } + + // If the filter matches, we need to honour include + if (fullName.indexOf(filter) !== -1) { + return include; + } + + // Otherwise, do the opposite + return !include; + } + }; + + function pushFailure() { + if (!config.current) { + throw new Error("pushFailure() assertion outside test context, in " + sourceFromStacktrace(2)); + } + + // Gets current test obj + var currentTest = config.current; + + return currentTest.pushFailure.apply(currentTest, arguments); + } + + // Based on Java's String.hashCode, a simple but not + // rigorously collision resistant hashing function + function generateHash(module, testName) { + var hex, + i = 0, + hash = 0, + str = module + "\x1C" + testName, + len = str.length; + + for (; i < len; i++) { + hash = (hash << 5) - hash + str.charCodeAt(i); + hash |= 0; + } + + // Convert the possibly negative integer hash code into an 8 character hex string, which isn't + // strictly necessary but increases user understanding that the id is a SHA-like hash + hex = (0x100000000 + hash).toString(16); + if (hex.length < 8) { + hex = "0000000" + hex; + } + + return hex.slice(-8); + } + + function synchronize(callback, priority, seed) { + var last = !priority, + index; + + if (objectType(callback) === "array") { + while (callback.length) { + synchronize(callback.shift()); + } + return; + } + + if (priority) { + config.queue.splice(priorityCount++, 0, callback); + } else if (seed) { + if (!unitSampler) { + unitSampler = unitSamplerGenerator(seed); + } + + // Insert into a random position after all priority items + index = Math.floor(unitSampler() * (config.queue.length - priorityCount + 1)); + config.queue.splice(priorityCount + index, 0, callback); + } else { + config.queue.push(callback); + } + + if (internalState.autorun && !config.blocking) { + process(last); + } + } + + function unitSamplerGenerator(seed) { + + // 32-bit xorshift, requires only a nonzero seed + // http://excamera.com/sphinx/article-xorshift.html + var sample = parseInt(generateHash(seed), 16) || -1; + return function () { + sample ^= sample << 13; + sample ^= sample >>> 17; + sample ^= sample << 5; + + // ECMAScript has no unsigned number type + if (sample < 0) { + sample += 0x100000000; + } + + return sample / 0x100000000; + }; + } + + function saveGlobal() { + config.pollution = []; + + if (config.noglobals) { + for (var key in global$1) { + if (hasOwn.call(global$1, key)) { + + // In Opera sometimes DOM element ids show up here, ignore them + if (/^qunit-test-output/.test(key)) { + continue; + } + config.pollution.push(key); + } + } + } + } + + function checkPollution() { + var newGlobals, + deletedGlobals, + old = config.pollution; + + saveGlobal(); + + newGlobals = diff(config.pollution, old); + if (newGlobals.length > 0) { + pushFailure("Introduced global variable(s): " + newGlobals.join(", ")); + } + + deletedGlobals = diff(old, config.pollution); + if (deletedGlobals.length > 0) { + pushFailure("Deleted global variable(s): " + deletedGlobals.join(", ")); + } + } + + // Will be exposed as QUnit.test + function test(testName, callback) { + if (focused) { + return; + } + + var newTest; + + newTest = new Test({ + testName: testName, + callback: callback + }); + + newTest.queue(); + } + + // Will be exposed as QUnit.skip + function skip(testName) { + if (focused) { + return; + } + + var test = new Test({ + testName: testName, + skip: true + }); + + test.queue(); + } + + // Will be exposed as QUnit.only + function only(testName, callback) { + var newTest; + + if (focused) { + return; + } + + config.queue.length = 0; + focused = true; + + newTest = new Test({ + testName: testName, + callback: callback + }); + + newTest.queue(); + } + + // Put a hold on processing and return a function that will release it. + function internalStop(test) { + var released = false; + + test.semaphore += 1; + config.blocking = true; + + // Set a recovery timeout, if so configured. + if (config.testTimeout && defined.setTimeout) { + clearTimeout(config.timeout); + config.timeout = setTimeout(function () { + pushFailure("Test timed out", sourceFromStacktrace(2)); + internalRecover(test); + }, config.testTimeout); + } + + return function resume() { + if (released) { + return; + } + + released = true; + test.semaphore -= 1; + internalStart(test); + }; + } + + // Forcefully release all processing holds. + function internalRecover(test) { + test.semaphore = 0; + internalStart(test); + } + + // Release a processing hold, scheduling a resumption attempt if no holds remain. + function internalStart(test) { + + // If semaphore is non-numeric, throw error + if (isNaN(test.semaphore)) { + test.semaphore = 0; + + pushFailure("Invalid value on test.semaphore", sourceFromStacktrace(2)); + return; + } + + // Don't start until equal number of stop-calls + if (test.semaphore > 0) { + return; + } + + // Throw an Error if start is called more often than stop + if (test.semaphore < 0) { + test.semaphore = 0; + + pushFailure("Tried to restart test while already started (test's semaphore was 0 already)", sourceFromStacktrace(2)); + return; + } + + // Add a slight delay to allow more assertions etc. + if (defined.setTimeout) { + if (config.timeout) { + clearTimeout(config.timeout); + } + config.timeout = setTimeout(function () { + if (test.semaphore > 0) { + return; + } + + if (config.timeout) { + clearTimeout(config.timeout); + } + + begin(); + }, 13); + } else { + begin(); + } + } + + function numberOfTests(module) { + var count = module.tests.length, + modules = [].concat(toConsumableArray(module.childModules)); + + // Do a breadth-first traversal of the child modules + while (modules.length) { + var nextModule = modules.shift(); + count += nextModule.tests.length; + modules.push.apply(modules, toConsumableArray(nextModule.childModules)); + } + + return count; + } + + function notifyTestsRan(module) { + module.testsRun++; + while (module = module.parentModule) { + module.testsRun++; + } + } + + function Assert(testContext) { + this.test = testContext; + } + + // Assert helpers + Assert.prototype = { + + // Specify the number of expected assertions to guarantee that failed test + // (no assertions are run at all) don't slip through. + expect: function expect(asserts) { + if (arguments.length === 1) { + this.test.expected = asserts; + } else { + return this.test.expected; + } + }, + + // Put a hold on processing and return a function that will release it a maximum of once. + async: function async(count) { + var resume, + test$$1 = this.test, + popped = false, + acceptCallCount = count; + + if (typeof acceptCallCount === "undefined") { + acceptCallCount = 1; + } + + test$$1.usedAsync = true; + resume = internalStop(test$$1); + + return function done() { + + if (popped) { + test$$1.pushFailure("Too many calls to the `assert.async` callback", sourceFromStacktrace(2)); + return; + } + acceptCallCount -= 1; + if (acceptCallCount > 0) { + return; + } + + popped = true; + resume(); + }; + }, + + // Exports test.push() to the user API + // Alias of pushResult. + push: function push(result, actual, expected, message, negative) { + var currentAssert = this instanceof Assert ? this : config.current.assert; + return currentAssert.pushResult({ + result: result, + actual: actual, + expected: expected, + message: message, + negative: negative + }); + }, + + pushResult: function pushResult(resultInfo) { + + // Destructure of resultInfo = { result, actual, expected, message, negative } + var assert = this, + currentTest = assert instanceof Assert && assert.test || config.current; + + // Backwards compatibility fix. + // Allows the direct use of global exported assertions and QUnit.assert.* + // Although, it's use is not recommended as it can leak assertions + // to other tests from async tests, because we only get a reference to the current test, + // not exactly the test where assertion were intended to be called. + if (!currentTest) { + throw new Error("assertion outside test context, in " + sourceFromStacktrace(2)); + } + + if (currentTest.usedAsync === true && currentTest.semaphore === 0) { + currentTest.pushFailure("Assertion after the final `assert.async` was resolved", sourceFromStacktrace(2)); + + // Allow this assertion to continue running anyway... + } + + if (!(assert instanceof Assert)) { + assert = currentTest.assert; + } + + return assert.test.pushResult(resultInfo); + }, + + ok: function ok(result, message) { + message = message || (result ? "okay" : "failed, expected argument to be truthy, was: " + dump.parse(result)); + this.pushResult({ + result: !!result, + actual: result, + expected: true, + message: message + }); + }, + + notOk: function notOk(result, message) { + message = message || (!result ? "okay" : "failed, expected argument to be falsy, was: " + dump.parse(result)); + this.pushResult({ + result: !result, + actual: result, + expected: false, + message: message + }); + }, + + equal: function equal(actual, expected, message) { + + // eslint-disable-next-line eqeqeq + var result = expected == actual; + + this.pushResult({ + result: result, + actual: actual, + expected: expected, + message: message + }); + }, + + notEqual: function notEqual(actual, expected, message) { + + // eslint-disable-next-line eqeqeq + var result = expected != actual; + + this.pushResult({ + result: result, + actual: actual, + expected: expected, + message: message, + negative: true + }); + }, + + propEqual: function propEqual(actual, expected, message) { + actual = objectValues(actual); + expected = objectValues(expected); + this.pushResult({ + result: equiv(actual, expected), + actual: actual, + expected: expected, + message: message + }); + }, + + notPropEqual: function notPropEqual(actual, expected, message) { + actual = objectValues(actual); + expected = objectValues(expected); + this.pushResult({ + result: !equiv(actual, expected), + actual: actual, + expected: expected, + message: message, + negative: true + }); + }, + + deepEqual: function deepEqual(actual, expected, message) { + this.pushResult({ + result: equiv(actual, expected), + actual: actual, + expected: expected, + message: message + }); + }, + + notDeepEqual: function notDeepEqual(actual, expected, message) { + this.pushResult({ + result: !equiv(actual, expected), + actual: actual, + expected: expected, + message: message, + negative: true + }); + }, + + strictEqual: function strictEqual(actual, expected, message) { + this.pushResult({ + result: expected === actual, + actual: actual, + expected: expected, + message: message + }); + }, + + notStrictEqual: function notStrictEqual(actual, expected, message) { + this.pushResult({ + result: expected !== actual, + actual: actual, + expected: expected, + message: message, + negative: true + }); + }, + + "throws": function throws(block, expected, message) { + var actual, + expectedType, + expectedOutput = expected, + ok = false, + currentTest = this instanceof Assert && this.test || config.current; + + // 'expected' is optional unless doing string comparison + if (objectType(expected) === "string") { + if (message == null) { + message = expected; + expected = null; + } else { + throw new Error("throws/raises does not accept a string value for the expected argument.\n" + "Use a non-string object value (e.g. regExp) instead if it's necessary." + "Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"); + } + } + + currentTest.ignoreGlobalErrors = true; + try { + block.call(currentTest.testEnvironment); + } catch (e) { + actual = e; + } + currentTest.ignoreGlobalErrors = false; + + if (actual) { + expectedType = objectType(expected); + + // We don't want to validate thrown error + if (!expected) { + ok = true; + expectedOutput = null; + + // Expected is a regexp + } else if (expectedType === "regexp") { + ok = expected.test(errorString(actual)); + + // Expected is a constructor, maybe an Error constructor + } else if (expectedType === "function" && actual instanceof expected) { + ok = true; + + // Expected is an Error object + } else if (expectedType === "object") { + ok = actual instanceof expected.constructor && actual.name === expected.name && actual.message === expected.message; + + // Expected is a validation function which returns true if validation passed + } else if (expectedType === "function" && expected.call({}, actual) === true) { + expectedOutput = null; + ok = true; + } + } + + currentTest.assert.pushResult({ + result: ok, + actual: actual, + expected: expectedOutput, + message: message + }); + } + }; + + // Provide an alternative to assert.throws(), for environments that consider throws a reserved word + // Known to us are: Closure Compiler, Narwhal + (function () { + + // eslint-disable-next-line dot-notation + Assert.prototype.raises = Assert.prototype["throws"]; + })(); + + function errorString(error) { + var name, + message, + resultErrorString = error.toString(); + if (resultErrorString.substring(0, 7) === "[object") { + name = error.name ? error.name.toString() : "Error"; + message = error.message ? error.message.toString() : ""; + if (name && message) { + return name + ": " + message; + } else if (name) { + return name; + } else if (message) { + return message; + } else { + return "Error"; + } + } else { + return resultErrorString; + } + } + + /* global module, exports, define */ + function applyDeprecated(name) { + return function () { + throw new Error(name + " is removed in QUnit 2.0.\n" + "Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"); + }; + } + + function exportQUnit(QUnit) { + + Object.keys(Assert.prototype).forEach(function (key) { + QUnit[key] = applyDeprecated("`QUnit." + key + "`"); + }); + + QUnit.asyncTest = function () { + throw new Error("asyncTest is removed in QUnit 2.0, use QUnit.test() with assert.async() instead.\n" + "Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"); + }; + + QUnit.stop = function () { + throw new Error("QUnit.stop is removed in QUnit 2.0, use QUnit.test() with assert.async() instead.\n" + "Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"); + }; + + function resetThrower() { + throw new Error("QUnit.reset is removed in QUnit 2.0 without replacement.\n" + "Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"); + } + + Object.defineProperty(QUnit, "reset", { + get: function get() { + return resetThrower; + }, + set: resetThrower + }); + + if (defined.document) { + + // QUnit may be defined when it is preconfigured but then only QUnit and QUnit.config may be defined. + if (window.QUnit && window.QUnit.version) { + throw new Error("QUnit has already been defined."); + } + + ["test", "module", "expect", "start", "ok", "notOk", "equal", "notEqual", "propEqual", "notPropEqual", "deepEqual", "notDeepEqual", "strictEqual", "notStrictEqual", "throws", "raises"].forEach(function (key) { + window[key] = applyDeprecated("The global `" + key + "`"); + }); + + window.QUnit = QUnit; + } + + // For nodejs + if (typeof module !== "undefined" && module && module.exports) { + module.exports = QUnit; + + // For consistency with CommonJS environments' exports + module.exports.QUnit = QUnit; + } + + // For CommonJS with exports, but without module.exports, like Rhino + if (typeof exports !== "undefined" && exports) { + exports.QUnit = QUnit; + } + + if (typeof define === "function" && define.amd) { + define(function () { + return QUnit; + }); + QUnit.config.autostart = false; + } + } + + (function () { + if (!defined.document) { + return; + } + + // `onErrorFnPrev` initialized at top of scope + // Preserve other handlers + var onErrorFnPrev = window.onerror; + + // Cover uncaught exceptions + // Returning true will suppress the default browser handler, + // returning false will let it run. + window.onerror = function (error, filePath, linerNr) { + var ret = false; + if (onErrorFnPrev) { + ret = onErrorFnPrev(error, filePath, linerNr); + } + + // Treat return value as window.onerror itself does, + // Only do our handling if not suppressed. + if (ret !== true) { + if (config.current) { + if (config.current.ignoreGlobalErrors) { + return true; + } + pushFailure(error, filePath + ":" + linerNr); + } else { + test("global failure", extend(function () { + pushFailure(error, filePath + ":" + linerNr); + }, { validTest: true })); + } + return false; + } + + return ret; + }; + })(); + + var QUnit = {}; + + var globalStartCalled = false; + var runStarted = false; + + var internalState = { + autorun: false + }; + + // Figure out if we're running the tests from a server or not + QUnit.isLocal = !(defined.document && window.location.protocol !== "file:"); + + // Expose the current QUnit version + QUnit.version = "2.1.0"; + + extend(QUnit, { + + // Call on start of module test to prepend name to all tests + module: function module(name, testEnvironment, executeNow) { + var module, moduleFns; + var currentModule = config.currentModule; + + if (arguments.length === 2) { + if (objectType(testEnvironment) === "function") { + executeNow = testEnvironment; + testEnvironment = undefined; + } + } + + module = createModule(); + + if (testEnvironment && (testEnvironment.setup || testEnvironment.teardown)) { + console.warn("Module's `setup` and `teardown` are not hooks anymore on QUnit 2.0, use " + "`beforeEach` and `afterEach` instead\n" + "Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"); + } + + moduleFns = { + before: setHook(module, "before"), + beforeEach: setHook(module, "beforeEach"), + afterEach: setHook(module, "afterEach"), + after: setHook(module, "after") + }; + + if (objectType(executeNow) === "function") { + config.moduleStack.push(module); + setCurrentModule(module); + executeNow.call(module.testEnvironment, moduleFns); + config.moduleStack.pop(); + module = module.parentModule || currentModule; + } + + setCurrentModule(module); + + function createModule() { + var parentModule = config.moduleStack.length ? config.moduleStack.slice(-1)[0] : null; + var moduleName = parentModule !== null ? [parentModule.name, name].join(" > ") : name; + var module = { + name: moduleName, + parentModule: parentModule, + tests: [], + moduleId: generateHash(moduleName), + testsRun: 0, + childModules: [] + }; + + var env = {}; + if (parentModule) { + parentModule.childModules.push(module); + extend(env, parentModule.testEnvironment); + delete env.beforeEach; + delete env.afterEach; + } + extend(env, testEnvironment); + module.testEnvironment = env; + + config.modules.push(module); + return module; + } + + function setCurrentModule(module) { + config.currentModule = module; + } + }, + + test: test, + + skip: skip, + + only: only, + + start: function start(count) { + var globalStartAlreadyCalled = globalStartCalled; + + if (!config.current) { + globalStartCalled = true; + + if (runStarted) { + throw new Error("Called start() while test already started running"); + } else if (globalStartAlreadyCalled || count > 1) { + throw new Error("Called start() outside of a test context too many times"); + } else if (config.autostart) { + throw new Error("Called start() outside of a test context when " + "QUnit.config.autostart was true"); + } else if (!config.pageLoaded) { + + // The page isn't completely loaded yet, so bail out and let `QUnit.load` handle it + config.autostart = true; + return; + } + } else { + throw new Error("QUnit.start cannot be called inside a test context. This feature is removed in " + "QUnit 2.0. For async tests, use QUnit.test() with assert.async() instead.\n" + "Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"); + } + + scheduleBegin(); + }, + + config: config, + + is: is, + + objectType: objectType, + + extend: extend, + + load: function load() { + config.pageLoaded = true; + + // Initialize the configuration options + extend(config, { + stats: { all: 0, bad: 0 }, + started: 0, + updateRate: 1000, + autostart: true, + filter: "" + }, true); + + if (!runStarted) { + config.blocking = false; + + if (config.autostart) { + scheduleBegin(); + } + } + }, + + stack: function stack(offset) { + offset = (offset || 0) + 2; + return sourceFromStacktrace(offset); + } + }); + + QUnit.pushFailure = pushFailure; + QUnit.assert = Assert.prototype; + QUnit.equiv = equiv; + QUnit.dump = dump; + + // 3.0 TODO: Remove + function jsDumpThrower() { + throw new Error("QUnit.jsDump is removed in QUnit 2.0, use QUnit.dump instead.\n" + "Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"); + } + + Object.defineProperty(QUnit, "jsDump", { + get: jsDumpThrower, + set: jsDumpThrower + }); + + registerLoggingCallbacks(QUnit); + + function scheduleBegin() { + + runStarted = true; + + // Add a slight delay to allow definition of more modules and tests. + if (defined.setTimeout) { + setTimeout(function () { + begin(); + }, 13); + } else { + begin(); + } + } + + function begin() { + var i, + l, + modulesLog = []; + + // If the test run hasn't officially begun yet + if (!config.started) { + + // Record the time of the test run's beginning + config.started = now(); + + // Delete the loose unnamed module if unused. + if (config.modules[0].name === "" && config.modules[0].tests.length === 0) { + config.modules.shift(); + } + + // Avoid unnecessary information by not logging modules' test environments + for (i = 0, l = config.modules.length; i < l; i++) { + modulesLog.push({ + name: config.modules[i].name, + tests: config.modules[i].tests + }); + } + + // The test run is officially beginning now + runLoggingCallbacks("begin", { + totalTests: Test.count, + modules: modulesLog + }); + } + + config.blocking = false; + process(true); + } + + function process(last) { + function next() { + process(last); + } + var start = now(); + config.depth = (config.depth || 0) + 1; + + while (config.queue.length && !config.blocking) { + if (!defined.setTimeout || config.updateRate <= 0 || now() - start < config.updateRate) { + if (config.current) { + + // Reset async tracking for each phase of the Test lifecycle + config.current.usedAsync = false; + } + config.queue.shift()(); + } else { + setTimeout(next, 13); + break; + } + } + config.depth--; + if (last && !config.blocking && !config.queue.length && config.depth === 0) { + done$1(); + } + } + + function done$1() { + var runtime, + passed, + i, + key, + storage = config.storage; + + internalState.autorun = true; + + runtime = now() - config.started; + passed = config.stats.all - config.stats.bad; + + runLoggingCallbacks("done", { + failed: config.stats.bad, + passed: passed, + total: config.stats.all, + runtime: runtime + }); + + // Clear own storage items if all tests passed + if (storage && config.stats.bad === 0) { + for (i = storage.length - 1; i >= 0; i--) { + key = storage.key(i); + if (key.indexOf("qunit-test-") === 0) { + storage.removeItem(key); + } + } + } + } + + function setHook(module, hookName) { + if (module.testEnvironment === undefined) { + module.testEnvironment = {}; + } + + return function (callback) { + module.testEnvironment[hookName] = callback; + }; + } + + exportQUnit(QUnit); + + (function () { + + if (typeof window === "undefined" || typeof document === "undefined") { + return; + } + + var config = QUnit.config, + hasOwn = Object.prototype.hasOwnProperty; + + // Stores fixture HTML for resetting later + function storeFixture() { + + // Avoid overwriting user-defined values + if (hasOwn.call(config, "fixture")) { + return; + } + + var fixture = document.getElementById("qunit-fixture"); + if (fixture) { + config.fixture = fixture.innerHTML; + } + } + + QUnit.begin(storeFixture); + + // Resets the fixture DOM element if available. + function resetFixture() { + if (config.fixture == null) { + return; + } + + var fixture = document.getElementById("qunit-fixture"); + if (fixture) { + fixture.innerHTML = config.fixture; + } + } + + QUnit.testStart(resetFixture); + })(); + + // Escape text for attribute or text content. + function escapeText(s) { + if (!s) { + return ""; + } + s = s + ""; + + // Both single quotes and double quotes (for attributes) + return s.replace(/['"<>&]/g, function (s) { + switch (s) { + case "'": + return "'"; + case "\"": + return """; + case "<": + return "<"; + case ">": + return ">"; + case "&": + return "&"; + } + }); + } + + (function () { + + // Don't load the HTML Reporter on non-browser environments + if (typeof window === "undefined" || !window.document) { + return; + } + + QUnit.init = function () { + throw new Error("QUnit.init is removed in QUnit 2.0, use QUnit.test() with assert.async() instead.\n" + "Details in our upgrade guide at https://qunitjs.com/upgrade-guide-2.x/"); + }; + + var config = QUnit.config, + document$$1 = window.document, + collapseNext = false, + hasOwn = Object.prototype.hasOwnProperty, + unfilteredUrl = setUrl({ filter: undefined, module: undefined, + moduleId: undefined, testId: undefined }), + modulesList = []; + + function addEvent(elem, type, fn) { + elem.addEventListener(type, fn, false); + } + + function removeEvent(elem, type, fn) { + elem.removeEventListener(type, fn, false); + } + + function addEvents(elems, type, fn) { + var i = elems.length; + while (i--) { + addEvent(elems[i], type, fn); + } + } + + function hasClass(elem, name) { + return (" " + elem.className + " ").indexOf(" " + name + " ") >= 0; + } + + function addClass(elem, name) { + if (!hasClass(elem, name)) { + elem.className += (elem.className ? " " : "") + name; + } + } + + function toggleClass(elem, name, force) { + if (force || typeof force === "undefined" && !hasClass(elem, name)) { + addClass(elem, name); + } else { + removeClass(elem, name); + } + } + + function removeClass(elem, name) { + var set = " " + elem.className + " "; + + // Class name may appear multiple times + while (set.indexOf(" " + name + " ") >= 0) { + set = set.replace(" " + name + " ", " "); + } + + // Trim for prettiness + elem.className = typeof set.trim === "function" ? set.trim() : set.replace(/^\s+|\s+$/g, ""); + } + + function id(name) { + return document$$1.getElementById && document$$1.getElementById(name); + } + + function interceptNavigation(ev) { + applyUrlParams(); + + if (ev && ev.preventDefault) { + ev.preventDefault(); + } + + return false; + } + + function getUrlConfigHtml() { + var i, + j, + val, + escaped, + escapedTooltip, + selection = false, + urlConfig = config.urlConfig, + urlConfigHtml = ""; + + for (i = 0; i < urlConfig.length; i++) { + + // Options can be either strings or objects with nonempty "id" properties + val = config.urlConfig[i]; + if (typeof val === "string") { + val = { + id: val, + label: val + }; + } + + escaped = escapeText(val.id); + escapedTooltip = escapeText(val.tooltip); + + if (!val.value || typeof val.value === "string") { + urlConfigHtml += ""; + } else { + urlConfigHtml += ""; + } + } + + return urlConfigHtml; + } + + // Handle "click" events on toolbar checkboxes and "change" for select menus. + // Updates the URL with the new state of `config.urlConfig` values. + function toolbarChanged() { + var updatedUrl, + value, + tests, + field = this, + params = {}; + + // Detect if field is a select menu or a checkbox + if ("selectedIndex" in field) { + value = field.options[field.selectedIndex].value || undefined; + } else { + value = field.checked ? field.defaultValue || true : undefined; + } + + params[field.name] = value; + updatedUrl = setUrl(params); + + // Check if we can apply the change without a page refresh + if ("hidepassed" === field.name && "replaceState" in window.history) { + QUnit.urlParams[field.name] = value; + config[field.name] = value || false; + tests = id("qunit-tests"); + if (tests) { + toggleClass(tests, "hidepass", value || false); + } + window.history.replaceState(null, "", updatedUrl); + } else { + window.location = updatedUrl; + } + } + + function setUrl(params) { + var key, + arrValue, + i, + querystring = "?", + location = window.location; + + params = QUnit.extend(QUnit.extend({}, QUnit.urlParams), params); + + for (key in params) { + + // Skip inherited or undefined properties + if (hasOwn.call(params, key) && params[key] !== undefined) { + + // Output a parameter for each value of this key (but usually just one) + arrValue = [].concat(params[key]); + for (i = 0; i < arrValue.length; i++) { + querystring += encodeURIComponent(key); + if (arrValue[i] !== true) { + querystring += "=" + encodeURIComponent(arrValue[i]); + } + querystring += "&"; + } + } + } + return location.protocol + "//" + location.host + location.pathname + querystring.slice(0, -1); + } + + function applyUrlParams() { + var i, + selectedModules = [], + modulesList = id("qunit-modulefilter-dropdown-list").getElementsByTagName("input"), + filter = id("qunit-filter-input").value; + + for (i = 0; i < modulesList.length; i++) { + if (modulesList[i].checked) { + selectedModules.push(modulesList[i].value); + } + } + + window.location = setUrl({ + filter: filter === "" ? undefined : filter, + moduleId: selectedModules.length === 0 ? undefined : selectedModules, + + // Remove module and testId filter + module: undefined, + testId: undefined + }); + } + + function toolbarUrlConfigContainer() { + var urlConfigContainer = document$$1.createElement("span"); + + urlConfigContainer.innerHTML = getUrlConfigHtml(); + addClass(urlConfigContainer, "qunit-url-config"); + + addEvents(urlConfigContainer.getElementsByTagName("input"), "change", toolbarChanged); + addEvents(urlConfigContainer.getElementsByTagName("select"), "change", toolbarChanged); + + return urlConfigContainer; + } + + function toolbarLooseFilter() { + var filter = document$$1.createElement("form"), + label = document$$1.createElement("label"), + input = document$$1.createElement("input"), + button = document$$1.createElement("button"); + + addClass(filter, "qunit-filter"); + + label.innerHTML = "Filter: "; + + input.type = "text"; + input.value = config.filter || ""; + input.name = "filter"; + input.id = "qunit-filter-input"; + + button.innerHTML = "Go"; + + label.appendChild(input); + + filter.appendChild(label); + filter.appendChild(document$$1.createTextNode(" ")); + filter.appendChild(button); + addEvent(filter, "submit", interceptNavigation); + + return filter; + } + + function moduleListHtml() { + var i, + checked, + html = ""; + + for (i = 0; i < config.modules.length; i++) { + if (config.modules[i].name !== "") { + checked = config.moduleId.indexOf(config.modules[i].moduleId) > -1; + html += "
  • "; + } + } + + return html; + } + + function toolbarModuleFilter() { + var allCheckbox, + commit, + reset, + moduleFilter = document$$1.createElement("form"), + label = document$$1.createElement("label"), + moduleSearch = document$$1.createElement("input"), + dropDown = document$$1.createElement("div"), + actions = document$$1.createElement("span"), + dropDownList = document$$1.createElement("ul"), + dirty = false; + + moduleSearch.id = "qunit-modulefilter-search"; + addEvent(moduleSearch, "input", searchInput); + addEvent(moduleSearch, "input", searchFocus); + addEvent(moduleSearch, "focus", searchFocus); + addEvent(moduleSearch, "click", searchFocus); + + label.id = "qunit-modulefilter-search-container"; + label.innerHTML = "Module: "; + label.appendChild(moduleSearch); + + actions.id = "qunit-modulefilter-actions"; + actions.innerHTML = "" + "" + ""; + allCheckbox = actions.lastChild.firstChild; + commit = actions.firstChild; + reset = commit.nextSibling; + addEvent(commit, "click", applyUrlParams); + + dropDownList.id = "qunit-modulefilter-dropdown-list"; + dropDownList.innerHTML = moduleListHtml(); + + dropDown.id = "qunit-modulefilter-dropdown"; + dropDown.style.display = "none"; + dropDown.appendChild(actions); + dropDown.appendChild(dropDownList); + addEvent(dropDown, "change", selectionChange); + selectionChange(); + + moduleFilter.id = "qunit-modulefilter"; + moduleFilter.appendChild(label); + moduleFilter.appendChild(dropDown); + addEvent(moduleFilter, "submit", interceptNavigation); + addEvent(moduleFilter, "reset", function () { + + // Let the reset happen, then update styles + window.setTimeout(selectionChange); + }); + + // Enables show/hide for the dropdown + function searchFocus() { + if (dropDown.style.display !== "none") { + return; + } + + dropDown.style.display = "block"; + addEvent(document$$1, "click", hideHandler); + addEvent(document$$1, "keydown", hideHandler); + + // Hide on Escape keydown or outside-container click + function hideHandler(e) { + var inContainer = moduleFilter.contains(e.target); + + if (e.keyCode === 27 || !inContainer) { + if (e.keyCode === 27 && inContainer) { + moduleSearch.focus(); + } + dropDown.style.display = "none"; + removeEvent(document$$1, "click", hideHandler); + removeEvent(document$$1, "keydown", hideHandler); + moduleSearch.value = ""; + searchInput(); + } + } + } + + // Processes module search box input + function searchInput() { + var i, + item, + searchText = moduleSearch.value.toLowerCase(), + listItems = dropDownList.children; + + for (i = 0; i < listItems.length; i++) { + item = listItems[i]; + if (!searchText || item.textContent.toLowerCase().indexOf(searchText) > -1) { + item.style.display = ""; + } else { + item.style.display = "none"; + } + } + } + + // Processes selection changes + function selectionChange(evt) { + var i, + item, + checkbox = evt && evt.target || allCheckbox, + modulesList = dropDownList.getElementsByTagName("input"), + selectedNames = []; + + toggleClass(checkbox.parentNode, "checked", checkbox.checked); + + dirty = false; + if (checkbox.checked && checkbox !== allCheckbox) { + allCheckbox.checked = false; + removeClass(allCheckbox.parentNode, "checked"); + } + for (i = 0; i < modulesList.length; i++) { + item = modulesList[i]; + if (!evt) { + toggleClass(item.parentNode, "checked", item.checked); + } else if (checkbox === allCheckbox && checkbox.checked) { + item.checked = false; + removeClass(item.parentNode, "checked"); + } + dirty = dirty || item.checked !== item.defaultChecked; + if (item.checked) { + selectedNames.push(item.parentNode.textContent); + } + } + + commit.style.display = reset.style.display = dirty ? "" : "none"; + moduleSearch.placeholder = selectedNames.join(", ") || allCheckbox.parentNode.textContent; + moduleSearch.title = "Type to filter list. Current selection:\n" + (selectedNames.join("\n") || allCheckbox.parentNode.textContent); + } + + return moduleFilter; + } + + function appendToolbar() { + var toolbar = id("qunit-testrunner-toolbar"); + + if (toolbar) { + toolbar.appendChild(toolbarUrlConfigContainer()); + toolbar.appendChild(toolbarModuleFilter()); + toolbar.appendChild(toolbarLooseFilter()); + toolbar.appendChild(document$$1.createElement("div")).className = "clearfix"; + } + } + + function appendHeader() { + var header = id("qunit-header"); + + if (header) { + header.innerHTML = "" + header.innerHTML + " "; + } + } + + function appendBanner() { + var banner = id("qunit-banner"); + + if (banner) { + banner.className = ""; + } + } + + function appendTestResults() { + var tests = id("qunit-tests"), + result = id("qunit-testresult"); + + if (result) { + result.parentNode.removeChild(result); + } + + if (tests) { + tests.innerHTML = ""; + result = document$$1.createElement("p"); + result.id = "qunit-testresult"; + result.className = "result"; + tests.parentNode.insertBefore(result, tests); + result.innerHTML = "Running...
     "; + } + } + + function appendFilteredTest() { + var testId = QUnit.config.testId; + if (!testId || testId.length <= 0) { + return ""; + } + return "
    Rerunning selected tests: " + escapeText(testId.join(", ")) + " Run all tests
    "; + } + + function appendUserAgent() { + var userAgent = id("qunit-userAgent"); + + if (userAgent) { + userAgent.innerHTML = ""; + userAgent.appendChild(document$$1.createTextNode("QUnit " + QUnit.version + "; " + navigator.userAgent)); + } + } + + function appendInterface() { + var qunit = id("qunit"); + + if (qunit) { + qunit.innerHTML = "

    " + escapeText(document$$1.title) + "

    " + "

    " + "
    " + appendFilteredTest() + "

    " + "
      "; + } + + appendHeader(); + appendBanner(); + appendTestResults(); + appendUserAgent(); + appendToolbar(); + } + + function appendTestsList(modules) { + var i, l, x, z, test, moduleObj; + + for (i = 0, l = modules.length; i < l; i++) { + moduleObj = modules[i]; + + for (x = 0, z = moduleObj.tests.length; x < z; x++) { + test = moduleObj.tests[x]; + + appendTest(test.name, test.testId, moduleObj.name); + } + } + } + + function appendTest(name, testId, moduleName) { + var title, + rerunTrigger, + testBlock, + assertList, + tests = id("qunit-tests"); + + if (!tests) { + return; + } + + title = document$$1.createElement("strong"); + title.innerHTML = getNameHtml(name, moduleName); + + rerunTrigger = document$$1.createElement("a"); + rerunTrigger.innerHTML = "Rerun"; + rerunTrigger.href = setUrl({ testId: testId }); + + testBlock = document$$1.createElement("li"); + testBlock.appendChild(title); + testBlock.appendChild(rerunTrigger); + testBlock.id = "qunit-test-output-" + testId; + + assertList = document$$1.createElement("ol"); + assertList.className = "qunit-assert-list"; + + testBlock.appendChild(assertList); + + tests.appendChild(testBlock); + } + + // HTML Reporter initialization and load + QUnit.begin(function (details) { + var i, moduleObj, tests; + + // Sort modules by name for the picker + for (i = 0; i < details.modules.length; i++) { + moduleObj = details.modules[i]; + if (moduleObj.name) { + modulesList.push(moduleObj.name); + } + } + modulesList.sort(function (a, b) { + return a.localeCompare(b); + }); + + // Initialize QUnit elements + appendInterface(); + appendTestsList(details.modules); + tests = id("qunit-tests"); + if (tests && config.hidepassed) { + addClass(tests, "hidepass"); + } + }); + + QUnit.done(function (details) { + var banner = id("qunit-banner"), + tests = id("qunit-tests"), + html = ["Tests completed in ", details.runtime, " milliseconds.
      ", "", details.passed, " assertions of ", details.total, " passed, ", details.failed, " failed."].join(""); + + if (banner) { + banner.className = details.failed ? "qunit-fail" : "qunit-pass"; + } + + if (tests) { + id("qunit-testresult").innerHTML = html; + } + + if (config.altertitle && document$$1.title) { + + // Show ✖ for good, ✔ for bad suite result in title + // use escape sequences in case file gets loaded with non-utf-8-charset + document$$1.title = [details.failed ? "\u2716" : "\u2714", document$$1.title.replace(/^[\u2714\u2716] /i, "")].join(" "); + } + + // Scroll back to top to show results + if (config.scrolltop && window.scrollTo) { + window.scrollTo(0, 0); + } + }); + + function getNameHtml(name, module) { + var nameHtml = ""; + + if (module) { + nameHtml = "" + escapeText(module) + ": "; + } + + nameHtml += "" + escapeText(name) + ""; + + return nameHtml; + } + + QUnit.testStart(function (details) { + var running, testBlock, bad; + + testBlock = id("qunit-test-output-" + details.testId); + if (testBlock) { + testBlock.className = "running"; + } else { + + // Report later registered tests + appendTest(details.name, details.testId, details.module); + } + + running = id("qunit-testresult"); + if (running) { + bad = QUnit.config.reorder && details.previousFailure; + + running.innerHTML = (bad ? "Rerunning previously failed test:
      " : "Running:
      ") + getNameHtml(details.name, details.module); + } + }); + + function stripHtml(string) { + + // Strip tags, html entity and whitespaces + return string.replace(/<\/?[^>]+(>|$)/g, "").replace(/\"/g, "").replace(/\s+/g, ""); + } + + QUnit.log(function (details) { + var assertList, + assertLi, + message, + expected, + actual, + diff, + showDiff = false, + testItem = id("qunit-test-output-" + details.testId); + + if (!testItem) { + return; + } + + message = escapeText(details.message) || (details.result ? "okay" : "failed"); + message = "" + message + ""; + message += "@ " + details.runtime + " ms"; + + // The pushFailure doesn't provide details.expected + // when it calls, it's implicit to also not show expected and diff stuff + // Also, we need to check details.expected existence, as it can exist and be undefined + if (!details.result && hasOwn.call(details, "expected")) { + if (details.negative) { + expected = "NOT " + QUnit.dump.parse(details.expected); + } else { + expected = QUnit.dump.parse(details.expected); + } + + actual = QUnit.dump.parse(details.actual); + message += ""; + + if (actual !== expected) { + + message += ""; + + // Don't show diff if actual or expected are booleans + if (!/^(true|false)$/.test(actual) && !/^(true|false)$/.test(expected)) { + diff = QUnit.diff(expected, actual); + showDiff = stripHtml(diff).length !== stripHtml(expected).length + stripHtml(actual).length; + } + + // Don't show diff if expected and actual are totally different + if (showDiff) { + message += ""; + } + } else if (expected.indexOf("[object Array]") !== -1 || expected.indexOf("[object Object]") !== -1) { + message += ""; + } else { + message += ""; + } + + if (details.source) { + message += ""; + } + + message += "
      Expected:
      " + escapeText(expected) + "
      Result:
      " + escapeText(actual) + "
      Diff:
      " + diff + "
      Message: " + "Diff suppressed as the depth of object is more than current max depth (" + QUnit.config.maxDepth + ").

      Hint: Use QUnit.dump.maxDepth to " + " run with a higher max depth or " + "Rerun without max depth.

      Message: " + "Diff suppressed as the expected and actual results have an equivalent" + " serialization
      Source:
      " + escapeText(details.source) + "
      "; + + // This occurs when pushFailure is set and we have an extracted stack trace + } else if (!details.result && details.source) { + message += "" + "" + "
      Source:
      " + escapeText(details.source) + "
      "; + } + + assertList = testItem.getElementsByTagName("ol")[0]; + + assertLi = document$$1.createElement("li"); + assertLi.className = details.result ? "pass" : "fail"; + assertLi.innerHTML = message; + assertList.appendChild(assertLi); + }); + + QUnit.testDone(function (details) { + var testTitle, + time, + testItem, + assertList, + good, + bad, + testCounts, + skipped, + sourceName, + tests = id("qunit-tests"); + + if (!tests) { + return; + } + + testItem = id("qunit-test-output-" + details.testId); + + assertList = testItem.getElementsByTagName("ol")[0]; + + good = details.passed; + bad = details.failed; + + if (bad === 0) { + + // Collapse the passing tests + addClass(assertList, "qunit-collapsed"); + } else if (config.collapse) { + if (!collapseNext) { + + // Skip collapsing the first failing test + collapseNext = true; + } else { + + // Collapse remaining tests + addClass(assertList, "qunit-collapsed"); + } + } + + // The testItem.firstChild is the test name + testTitle = testItem.firstChild; + + testCounts = bad ? "" + bad + ", " + "" + good + ", " : ""; + + testTitle.innerHTML += " (" + testCounts + details.assertions.length + ")"; + + if (details.skipped) { + testItem.className = "skipped"; + skipped = document$$1.createElement("em"); + skipped.className = "qunit-skipped-label"; + skipped.innerHTML = "skipped"; + testItem.insertBefore(skipped, testTitle); + } else { + addEvent(testTitle, "click", function () { + toggleClass(assertList, "qunit-collapsed"); + }); + + testItem.className = bad ? "fail" : "pass"; + + time = document$$1.createElement("span"); + time.className = "runtime"; + time.innerHTML = details.runtime + " ms"; + testItem.insertBefore(time, assertList); + } + + // Show the source of the test when showing assertions + if (details.source) { + sourceName = document$$1.createElement("p"); + sourceName.innerHTML = "Source: " + details.source; + addClass(sourceName, "qunit-source"); + if (bad === 0) { + addClass(sourceName, "qunit-collapsed"); + } + addEvent(testTitle, "click", function () { + toggleClass(sourceName, "qunit-collapsed"); + }); + testItem.appendChild(sourceName); + } + }); + + // Avoid readyState issue with phantomjs + // Ref: #818 + var notPhantom = function (p) { + return !(p && p.version && p.version.major > 0); + }(window.phantom); + + if (notPhantom && document$$1.readyState === "complete") { + QUnit.load(); + } else { + addEvent(window, "load", QUnit.load); + } + })(); + + /* + * This file is a modified version of google-diff-match-patch's JavaScript implementation + * (https://code.google.com/p/google-diff-match-patch/source/browse/trunk/javascript/diff_match_patch_uncompressed.js), + * modifications are licensed as more fully set forth in LICENSE.txt. + * + * The original source of google-diff-match-patch is attributable and licensed as follows: + * + * Copyright 2006 Google Inc. + * https://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * More Info: + * https://code.google.com/p/google-diff-match-patch/ + * + * Usage: QUnit.diff(expected, actual) + * + */ + QUnit.diff = function () { + function DiffMatchPatch() {} + + // DIFF FUNCTIONS + + /** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ + var DIFF_DELETE = -1, + DIFF_INSERT = 1, + DIFF_EQUAL = 0; + + /** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {boolean=} optChecklines Optional speedup flag. If present and false, + * then don't run a line-level diff first to identify the changed areas. + * Defaults to true, which does a faster, slightly less optimal diff. + * @return {!Array.} Array of diff tuples. + */ + DiffMatchPatch.prototype.DiffMain = function (text1, text2, optChecklines) { + var deadline, checklines, commonlength, commonprefix, commonsuffix, diffs; + + // The diff must be complete in up to 1 second. + deadline = new Date().getTime() + 1000; + + // Check for null inputs. + if (text1 === null || text2 === null) { + throw new Error("Null input. (DiffMain)"); + } + + // Check for equality (speedup). + if (text1 === text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + if (typeof optChecklines === "undefined") { + optChecklines = true; + } + + checklines = optChecklines; + + // Trim off common prefix (speedup). + commonlength = this.diffCommonPrefix(text1, text2); + commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + commonlength = this.diffCommonSuffix(text1, text2); + commonsuffix = text1.substring(text1.length - commonlength); + text1 = text1.substring(0, text1.length - commonlength); + text2 = text2.substring(0, text2.length - commonlength); + + // Compute the diff on the middle block. + diffs = this.diffCompute(text1, text2, checklines, deadline); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + this.diffCleanupMerge(diffs); + return diffs; + }; + + /** + * Reduce the number of edits by eliminating operationally trivial equalities. + * @param {!Array.} diffs Array of diff tuples. + */ + DiffMatchPatch.prototype.diffCleanupEfficiency = function (diffs) { + var changes, equalities, equalitiesLength, lastequality, pointer, preIns, preDel, postIns, postDel; + changes = false; + equalities = []; // Stack of indices where equalities are found. + equalitiesLength = 0; // Keeping our own length var is faster in JS. + /** @type {?string} */ + lastequality = null; + + // Always equal to diffs[equalities[equalitiesLength - 1]][1] + pointer = 0; // Index of current position. + + // Is there an insertion operation before the last equality. + preIns = false; + + // Is there a deletion operation before the last equality. + preDel = false; + + // Is there an insertion operation after the last equality. + postIns = false; + + // Is there a deletion operation after the last equality. + postDel = false; + while (pointer < diffs.length) { + + // Equality found. + if (diffs[pointer][0] === DIFF_EQUAL) { + if (diffs[pointer][1].length < 4 && (postIns || postDel)) { + + // Candidate found. + equalities[equalitiesLength++] = pointer; + preIns = postIns; + preDel = postDel; + lastequality = diffs[pointer][1]; + } else { + + // Not a candidate, and can never become one. + equalitiesLength = 0; + lastequality = null; + } + postIns = postDel = false; + + // An insertion or deletion. + } else { + + if (diffs[pointer][0] === DIFF_DELETE) { + postDel = true; + } else { + postIns = true; + } + + /* + * Five types to be split: + * ABXYCD + * AXCD + * ABXC + * AXCD + * ABXC + */ + if (lastequality && (preIns && preDel && postIns && postDel || lastequality.length < 2 && preIns + preDel + postIns + postDel === 3)) { + + // Duplicate record. + diffs.splice(equalities[equalitiesLength - 1], 0, [DIFF_DELETE, lastequality]); + + // Change second copy to insert. + diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; + equalitiesLength--; // Throw away the equality we just deleted; + lastequality = null; + if (preIns && preDel) { + + // No changes made which could affect previous entry, keep going. + postIns = postDel = true; + equalitiesLength = 0; + } else { + equalitiesLength--; // Throw away the previous equality. + pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1; + postIns = postDel = false; + } + changes = true; + } + } + pointer++; + } + + if (changes) { + this.diffCleanupMerge(diffs); + } + }; + + /** + * Convert a diff array into a pretty HTML report. + * @param {!Array.} diffs Array of diff tuples. + * @param {integer} string to be beautified. + * @return {string} HTML representation. + */ + DiffMatchPatch.prototype.diffPrettyHtml = function (diffs) { + var op, + data, + x, + html = []; + for (x = 0; x < diffs.length; x++) { + op = diffs[x][0]; // Operation (insert, delete, equal) + data = diffs[x][1]; // Text of change. + switch (op) { + case DIFF_INSERT: + html[x] = "" + escapeText(data) + ""; + break; + case DIFF_DELETE: + html[x] = "" + escapeText(data) + ""; + break; + case DIFF_EQUAL: + html[x] = "" + escapeText(data) + ""; + break; + } + } + return html.join(""); + }; + + /** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ + DiffMatchPatch.prototype.diffCommonPrefix = function (text1, text2) { + var pointermid, pointermax, pointermin, pointerstart; + + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) { + return 0; + } + + // Binary search. + // Performance analysis: https://neil.fraser.name/news/2007/10/09/ + pointermin = 0; + pointermax = Math.min(text1.length, text2.length); + pointermid = pointermax; + pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) === text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; + }; + + /** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ + DiffMatchPatch.prototype.diffCommonSuffix = function (text1, text2) { + var pointermid, pointermax, pointermin, pointerend; + + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(text1.length - 1) !== text2.charAt(text2.length - 1)) { + return 0; + } + + // Binary search. + // Performance analysis: https://neil.fraser.name/news/2007/10/09/ + pointermin = 0; + pointermax = Math.min(text1.length, text2.length); + pointermid = pointermax; + pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) === text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; + }; + + /** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {boolean} checklines Speedup flag. If false, then don't run a + * line-level diff first to identify the changed areas. + * If true, then run a faster, slightly less optimal diff. + * @param {number} deadline Time when the diff should be complete by. + * @return {!Array.} Array of diff tuples. + * @private + */ + DiffMatchPatch.prototype.diffCompute = function (text1, text2, checklines, deadline) { + var diffs, longtext, shorttext, i, hm, text1A, text2A, text1B, text2B, midCommon, diffsA, diffsB; + + if (!text1) { + + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + longtext = text1.length > text2.length ? text1 : text2; + shorttext = text1.length > text2.length ? text2 : text1; + i = longtext.indexOf(shorttext); + if (i !== -1) { + + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], [DIFF_EQUAL, shorttext], [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length === 1) { + + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + hm = this.diffHalfMatch(text1, text2); + if (hm) { + + // A half-match was found, sort out the return data. + text1A = hm[0]; + text1B = hm[1]; + text2A = hm[2]; + text2B = hm[3]; + midCommon = hm[4]; + + // Send both pairs off for separate processing. + diffsA = this.DiffMain(text1A, text2A, checklines, deadline); + diffsB = this.DiffMain(text1B, text2B, checklines, deadline); + + // Merge the results. + return diffsA.concat([[DIFF_EQUAL, midCommon]], diffsB); + } + + if (checklines && text1.length > 100 && text2.length > 100) { + return this.diffLineMode(text1, text2, deadline); + } + + return this.diffBisect(text1, text2, deadline); + }; + + /** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + * @private + */ + DiffMatchPatch.prototype.diffHalfMatch = function (text1, text2) { + var longtext, shorttext, dmp, text1A, text2B, text2A, text1B, midCommon, hm1, hm2, hm; + + longtext = text1.length > text2.length ? text1 : text2; + shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + dmp = this; // 'this' becomes 'window' in a closure. + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diffHalfMatchI(longtext, shorttext, i) { + var seed, j, bestCommon, prefixLength, suffixLength, bestLongtextA, bestLongtextB, bestShorttextA, bestShorttextB; + + // Start with a 1/4 length substring at position i as a seed. + seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + j = -1; + bestCommon = ""; + while ((j = shorttext.indexOf(seed, j + 1)) !== -1) { + prefixLength = dmp.diffCommonPrefix(longtext.substring(i), shorttext.substring(j)); + suffixLength = dmp.diffCommonSuffix(longtext.substring(0, i), shorttext.substring(0, j)); + if (bestCommon.length < suffixLength + prefixLength) { + bestCommon = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength); + bestLongtextA = longtext.substring(0, i - suffixLength); + bestLongtextB = longtext.substring(i + prefixLength); + bestShorttextA = shorttext.substring(0, j - suffixLength); + bestShorttextB = shorttext.substring(j + prefixLength); + } + } + if (bestCommon.length * 2 >= longtext.length) { + return [bestLongtextA, bestLongtextB, bestShorttextA, bestShorttextB, bestCommon]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + hm1 = diffHalfMatchI(longtext, shorttext, Math.ceil(longtext.length / 4)); + + // Check again based on the third quarter. + hm2 = diffHalfMatchI(longtext, shorttext, Math.ceil(longtext.length / 2)); + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + if (text1.length > text2.length) { + text1A = hm[0]; + text1B = hm[1]; + text2A = hm[2]; + text2B = hm[3]; + } else { + text2A = hm[0]; + text2B = hm[1]; + text1A = hm[2]; + text1B = hm[3]; + } + midCommon = hm[4]; + return [text1A, text1B, text2A, text2B, midCommon]; + }; + + /** + * Do a quick line-level diff on both strings, then rediff the parts for + * greater accuracy. + * This speedup can produce non-minimal diffs. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} deadline Time when the diff should be complete by. + * @return {!Array.} Array of diff tuples. + * @private + */ + DiffMatchPatch.prototype.diffLineMode = function (text1, text2, deadline) { + var a, diffs, linearray, pointer, countInsert, countDelete, textInsert, textDelete, j; + + // Scan the text on a line-by-line basis first. + a = this.diffLinesToChars(text1, text2); + text1 = a.chars1; + text2 = a.chars2; + linearray = a.lineArray; + + diffs = this.DiffMain(text1, text2, false, deadline); + + // Convert the diff back to original text. + this.diffCharsToLines(diffs, linearray); + + // Eliminate freak matches (e.g. blank lines) + this.diffCleanupSemantic(diffs); + + // Rediff any replacement blocks, this time character-by-character. + // Add a dummy entry at the end. + diffs.push([DIFF_EQUAL, ""]); + pointer = 0; + countDelete = 0; + countInsert = 0; + textDelete = ""; + textInsert = ""; + while (pointer < diffs.length) { + switch (diffs[pointer][0]) { + case DIFF_INSERT: + countInsert++; + textInsert += diffs[pointer][1]; + break; + case DIFF_DELETE: + countDelete++; + textDelete += diffs[pointer][1]; + break; + case DIFF_EQUAL: + + // Upon reaching an equality, check for prior redundancies. + if (countDelete >= 1 && countInsert >= 1) { + + // Delete the offending records and add the merged ones. + diffs.splice(pointer - countDelete - countInsert, countDelete + countInsert); + pointer = pointer - countDelete - countInsert; + a = this.DiffMain(textDelete, textInsert, false, deadline); + for (j = a.length - 1; j >= 0; j--) { + diffs.splice(pointer, 0, a[j]); + } + pointer = pointer + a.length; + } + countInsert = 0; + countDelete = 0; + textDelete = ""; + textInsert = ""; + break; + } + pointer++; + } + diffs.pop(); // Remove the dummy entry at the end. + + return diffs; + }; + + /** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} deadline Time at which to bail if not yet complete. + * @return {!Array.} Array of diff tuples. + * @private + */ + DiffMatchPatch.prototype.diffBisect = function (text1, text2, deadline) { + var text1Length, text2Length, maxD, vOffset, vLength, v1, v2, x, delta, front, k1start, k1end, k2start, k2end, k2Offset, k1Offset, x1, x2, y1, y2, d, k1, k2; + + // Cache the text lengths to prevent multiple calls. + text1Length = text1.length; + text2Length = text2.length; + maxD = Math.ceil((text1Length + text2Length) / 2); + vOffset = maxD; + vLength = 2 * maxD; + v1 = new Array(vLength); + v2 = new Array(vLength); + + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (x = 0; x < vLength; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[vOffset + 1] = 0; + v2[vOffset + 1] = 0; + delta = text1Length - text2Length; + + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + front = delta % 2 !== 0; + + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + k1start = 0; + k1end = 0; + k2start = 0; + k2end = 0; + for (d = 0; d < maxD; d++) { + + // Bail out if deadline is reached. + if (new Date().getTime() > deadline) { + break; + } + + // Walk the front path one step. + for (k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + k1Offset = vOffset + k1; + if (k1 === -d || k1 !== d && v1[k1Offset - 1] < v1[k1Offset + 1]) { + x1 = v1[k1Offset + 1]; + } else { + x1 = v1[k1Offset - 1] + 1; + } + y1 = x1 - k1; + while (x1 < text1Length && y1 < text2Length && text1.charAt(x1) === text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1Offset] = x1; + if (x1 > text1Length) { + + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2Length) { + + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + k2Offset = vOffset + delta - k1; + if (k2Offset >= 0 && k2Offset < vLength && v2[k2Offset] !== -1) { + + // Mirror x2 onto top-left coordinate system. + x2 = text1Length - v2[k2Offset]; + if (x1 >= x2) { + + // Overlap detected. + return this.diffBisectSplit(text1, text2, x1, y1, deadline); + } + } + } + } + + // Walk the reverse path one step. + for (k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + k2Offset = vOffset + k2; + if (k2 === -d || k2 !== d && v2[k2Offset - 1] < v2[k2Offset + 1]) { + x2 = v2[k2Offset + 1]; + } else { + x2 = v2[k2Offset - 1] + 1; + } + y2 = x2 - k2; + while (x2 < text1Length && y2 < text2Length && text1.charAt(text1Length - x2 - 1) === text2.charAt(text2Length - y2 - 1)) { + x2++; + y2++; + } + v2[k2Offset] = x2; + if (x2 > text1Length) { + + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2Length) { + + // Ran off the top of the graph. + k2start += 2; + } else if (!front) { + k1Offset = vOffset + delta - k2; + if (k1Offset >= 0 && k1Offset < vLength && v1[k1Offset] !== -1) { + x1 = v1[k1Offset]; + y1 = vOffset + x1 - k1Offset; + + // Mirror x2 onto top-left coordinate system. + x2 = text1Length - x2; + if (x1 >= x2) { + + // Overlap detected. + return this.diffBisectSplit(text1, text2, x1, y1, deadline); + } + } + } + } + } + + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + }; + + /** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @param {number} deadline Time at which to bail if not yet complete. + * @return {!Array.} Array of diff tuples. + * @private + */ + DiffMatchPatch.prototype.diffBisectSplit = function (text1, text2, x, y, deadline) { + var text1a, text1b, text2a, text2b, diffs, diffsb; + text1a = text1.substring(0, x); + text2a = text2.substring(0, y); + text1b = text1.substring(x); + text2b = text2.substring(y); + + // Compute both diffs serially. + diffs = this.DiffMain(text1a, text2a, false, deadline); + diffsb = this.DiffMain(text1b, text2b, false, deadline); + + return diffs.concat(diffsb); + }; + + /** + * Reduce the number of edits by eliminating semantically trivial equalities. + * @param {!Array.} diffs Array of diff tuples. + */ + DiffMatchPatch.prototype.diffCleanupSemantic = function (diffs) { + var changes, equalities, equalitiesLength, lastequality, pointer, lengthInsertions2, lengthDeletions2, lengthInsertions1, lengthDeletions1, deletion, insertion, overlapLength1, overlapLength2; + changes = false; + equalities = []; // Stack of indices where equalities are found. + equalitiesLength = 0; // Keeping our own length var is faster in JS. + /** @type {?string} */ + lastequality = null; + + // Always equal to diffs[equalities[equalitiesLength - 1]][1] + pointer = 0; // Index of current position. + + // Number of characters that changed prior to the equality. + lengthInsertions1 = 0; + lengthDeletions1 = 0; + + // Number of characters that changed after the equality. + lengthInsertions2 = 0; + lengthDeletions2 = 0; + while (pointer < diffs.length) { + if (diffs[pointer][0] === DIFF_EQUAL) { + // Equality found. + equalities[equalitiesLength++] = pointer; + lengthInsertions1 = lengthInsertions2; + lengthDeletions1 = lengthDeletions2; + lengthInsertions2 = 0; + lengthDeletions2 = 0; + lastequality = diffs[pointer][1]; + } else { + // An insertion or deletion. + if (diffs[pointer][0] === DIFF_INSERT) { + lengthInsertions2 += diffs[pointer][1].length; + } else { + lengthDeletions2 += diffs[pointer][1].length; + } + + // Eliminate an equality that is smaller or equal to the edits on both + // sides of it. + if (lastequality && lastequality.length <= Math.max(lengthInsertions1, lengthDeletions1) && lastequality.length <= Math.max(lengthInsertions2, lengthDeletions2)) { + + // Duplicate record. + diffs.splice(equalities[equalitiesLength - 1], 0, [DIFF_DELETE, lastequality]); + + // Change second copy to insert. + diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; + + // Throw away the equality we just deleted. + equalitiesLength--; + + // Throw away the previous equality (it needs to be reevaluated). + equalitiesLength--; + pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1; + + // Reset the counters. + lengthInsertions1 = 0; + lengthDeletions1 = 0; + lengthInsertions2 = 0; + lengthDeletions2 = 0; + lastequality = null; + changes = true; + } + } + pointer++; + } + + // Normalize the diff. + if (changes) { + this.diffCleanupMerge(diffs); + } + + // Find any overlaps between deletions and insertions. + // e.g: abcxxxxxxdef + // -> abcxxxdef + // e.g: xxxabcdefxxx + // -> defxxxabc + // Only extract an overlap if it is as big as the edit ahead or behind it. + pointer = 1; + while (pointer < diffs.length) { + if (diffs[pointer - 1][0] === DIFF_DELETE && diffs[pointer][0] === DIFF_INSERT) { + deletion = diffs[pointer - 1][1]; + insertion = diffs[pointer][1]; + overlapLength1 = this.diffCommonOverlap(deletion, insertion); + overlapLength2 = this.diffCommonOverlap(insertion, deletion); + if (overlapLength1 >= overlapLength2) { + if (overlapLength1 >= deletion.length / 2 || overlapLength1 >= insertion.length / 2) { + + // Overlap found. Insert an equality and trim the surrounding edits. + diffs.splice(pointer, 0, [DIFF_EQUAL, insertion.substring(0, overlapLength1)]); + diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlapLength1); + diffs[pointer + 1][1] = insertion.substring(overlapLength1); + pointer++; + } + } else { + if (overlapLength2 >= deletion.length / 2 || overlapLength2 >= insertion.length / 2) { + + // Reverse overlap found. + // Insert an equality and swap and trim the surrounding edits. + diffs.splice(pointer, 0, [DIFF_EQUAL, deletion.substring(0, overlapLength2)]); + + diffs[pointer - 1][0] = DIFF_INSERT; + diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlapLength2); + diffs[pointer + 1][0] = DIFF_DELETE; + diffs[pointer + 1][1] = deletion.substring(overlapLength2); + pointer++; + } + } + pointer++; + } + pointer++; + } + }; + + /** + * Determine if the suffix of one string is the prefix of another. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of the first + * string and the start of the second string. + * @private + */ + DiffMatchPatch.prototype.diffCommonOverlap = function (text1, text2) { + var text1Length, text2Length, textLength, best, length, pattern, found; + + // Cache the text lengths to prevent multiple calls. + text1Length = text1.length; + text2Length = text2.length; + + // Eliminate the null case. + if (text1Length === 0 || text2Length === 0) { + return 0; + } + + // Truncate the longer string. + if (text1Length > text2Length) { + text1 = text1.substring(text1Length - text2Length); + } else if (text1Length < text2Length) { + text2 = text2.substring(0, text1Length); + } + textLength = Math.min(text1Length, text2Length); + + // Quick check for the worst case. + if (text1 === text2) { + return textLength; + } + + // Start by looking for a single character match + // and increase length until no match is found. + // Performance analysis: https://neil.fraser.name/news/2010/11/04/ + best = 0; + length = 1; + while (true) { + pattern = text1.substring(textLength - length); + found = text2.indexOf(pattern); + if (found === -1) { + return best; + } + length += found; + if (found === 0 || text1.substring(textLength - length) === text2.substring(0, length)) { + best = length; + length++; + } + } + }; + + /** + * Split two texts into an array of strings. Reduce the texts to a string of + * hashes where each Unicode character represents one line. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {{chars1: string, chars2: string, lineArray: !Array.}} + * An object containing the encoded text1, the encoded text2 and + * the array of unique strings. + * The zeroth element of the array of unique strings is intentionally blank. + * @private + */ + DiffMatchPatch.prototype.diffLinesToChars = function (text1, text2) { + var lineArray, lineHash, chars1, chars2; + lineArray = []; // E.g. lineArray[4] === 'Hello\n' + lineHash = {}; // E.g. lineHash['Hello\n'] === 4 + + // '\x00' is a valid character, but various debuggers don't like it. + // So we'll insert a junk entry to avoid generating a null character. + lineArray[0] = ""; + + /** + * Split a text into an array of strings. Reduce the texts to a string of + * hashes where each Unicode character represents one line. + * Modifies linearray and linehash through being a closure. + * @param {string} text String to encode. + * @return {string} Encoded string. + * @private + */ + function diffLinesToCharsMunge(text) { + var chars, lineStart, lineEnd, lineArrayLength, line; + chars = ""; + + // Walk the text, pulling out a substring for each line. + // text.split('\n') would would temporarily double our memory footprint. + // Modifying text would create many large strings to garbage collect. + lineStart = 0; + lineEnd = -1; + + // Keeping our own length variable is faster than looking it up. + lineArrayLength = lineArray.length; + while (lineEnd < text.length - 1) { + lineEnd = text.indexOf("\n", lineStart); + if (lineEnd === -1) { + lineEnd = text.length - 1; + } + line = text.substring(lineStart, lineEnd + 1); + lineStart = lineEnd + 1; + + if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : lineHash[line] !== undefined) { + chars += String.fromCharCode(lineHash[line]); + } else { + chars += String.fromCharCode(lineArrayLength); + lineHash[line] = lineArrayLength; + lineArray[lineArrayLength++] = line; + } + } + return chars; + } + + chars1 = diffLinesToCharsMunge(text1); + chars2 = diffLinesToCharsMunge(text2); + return { + chars1: chars1, + chars2: chars2, + lineArray: lineArray + }; + }; + + /** + * Rehydrate the text in a diff from a string of line hashes to real lines of + * text. + * @param {!Array.} diffs Array of diff tuples. + * @param {!Array.} lineArray Array of unique strings. + * @private + */ + DiffMatchPatch.prototype.diffCharsToLines = function (diffs, lineArray) { + var x, chars, text, y; + for (x = 0; x < diffs.length; x++) { + chars = diffs[x][1]; + text = []; + for (y = 0; y < chars.length; y++) { + text[y] = lineArray[chars.charCodeAt(y)]; + } + diffs[x][1] = text.join(""); + } + }; + + /** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {!Array.} diffs Array of diff tuples. + */ + DiffMatchPatch.prototype.diffCleanupMerge = function (diffs) { + var pointer, countDelete, countInsert, textInsert, textDelete, commonlength, changes, diffPointer, position; + diffs.push([DIFF_EQUAL, ""]); // Add a dummy entry at the end. + pointer = 0; + countDelete = 0; + countInsert = 0; + textDelete = ""; + textInsert = ""; + + while (pointer < diffs.length) { + switch (diffs[pointer][0]) { + case DIFF_INSERT: + countInsert++; + textInsert += diffs[pointer][1]; + pointer++; + break; + case DIFF_DELETE: + countDelete++; + textDelete += diffs[pointer][1]; + pointer++; + break; + case DIFF_EQUAL: + + // Upon reaching an equality, check for prior redundancies. + if (countDelete + countInsert > 1) { + if (countDelete !== 0 && countInsert !== 0) { + + // Factor out any common prefixes. + commonlength = this.diffCommonPrefix(textInsert, textDelete); + if (commonlength !== 0) { + if (pointer - countDelete - countInsert > 0 && diffs[pointer - countDelete - countInsert - 1][0] === DIFF_EQUAL) { + diffs[pointer - countDelete - countInsert - 1][1] += textInsert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, textInsert.substring(0, commonlength)]); + pointer++; + } + textInsert = textInsert.substring(commonlength); + textDelete = textDelete.substring(commonlength); + } + + // Factor out any common suffixies. + commonlength = this.diffCommonSuffix(textInsert, textDelete); + if (commonlength !== 0) { + diffs[pointer][1] = textInsert.substring(textInsert.length - commonlength) + diffs[pointer][1]; + textInsert = textInsert.substring(0, textInsert.length - commonlength); + textDelete = textDelete.substring(0, textDelete.length - commonlength); + } + } + + // Delete the offending records and add the merged ones. + if (countDelete === 0) { + diffs.splice(pointer - countInsert, countDelete + countInsert, [DIFF_INSERT, textInsert]); + } else if (countInsert === 0) { + diffs.splice(pointer - countDelete, countDelete + countInsert, [DIFF_DELETE, textDelete]); + } else { + diffs.splice(pointer - countDelete - countInsert, countDelete + countInsert, [DIFF_DELETE, textDelete], [DIFF_INSERT, textInsert]); + } + pointer = pointer - countDelete - countInsert + (countDelete ? 1 : 0) + (countInsert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) { + + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + countInsert = 0; + countDelete = 0; + textDelete = ""; + textInsert = ""; + break; + } + } + if (diffs[diffs.length - 1][1] === "") { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + changes = false; + pointer = 1; + + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) { + + diffPointer = diffs[pointer][1]; + position = diffPointer.substring(diffPointer.length - diffs[pointer - 1][1].length); + + // This is a single edit surrounded by equalities. + if (position === diffs[pointer - 1][1]) { + + // Shift the edit over the previous equality. + diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length); + diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; + diffs.splice(pointer - 1, 1); + changes = true; + } else if (diffPointer.substring(0, diffs[pointer + 1][1].length) === diffs[pointer + 1][1]) { + + // Shift the edit over the next equality. + diffs[pointer - 1][1] += diffs[pointer + 1][1]; + diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1]; + diffs.splice(pointer + 1, 1); + changes = true; + } + } + pointer++; + } + + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + this.diffCleanupMerge(diffs); + } + }; + + return function (o, n) { + var diff, output, text; + diff = new DiffMatchPatch(); + output = diff.DiffMain(o, n); + diff.diffCleanupEfficiency(output); + text = diff.diffPrettyHtml(output); + + return text; + }; + }(); + + (function () { + + // Only interact with URLs via window.location + var location = typeof window !== "undefined" && window.location; + if (!location) { + return; + } + + var urlParams = getUrlParams(); + + QUnit.urlParams = urlParams; + + // Match module/test by inclusion in an array + QUnit.config.moduleId = [].concat(urlParams.moduleId || []); + QUnit.config.testId = [].concat(urlParams.testId || []); + + // Exact case-insensitive match of the module name + QUnit.config.module = urlParams.module; + + // Regular expression or case-insenstive substring match against "moduleName: testName" + QUnit.config.filter = urlParams.filter; + + // Test order randomization + if (urlParams.seed === true) { + + // Generate a random seed if the option is specified without a value + QUnit.config.seed = Math.random().toString(36).slice(2); + } else if (urlParams.seed) { + QUnit.config.seed = urlParams.seed; + } + + // Add URL-parameter-mapped config values with UI form rendering data + QUnit.config.urlConfig.push({ + id: "hidepassed", + label: "Hide passed tests", + tooltip: "Only show tests and assertions that fail. Stored as query-strings." + }, { + id: "noglobals", + label: "Check for Globals", + tooltip: "Enabling this will test if any test introduces new properties on the " + "global object (`window` in Browsers). Stored as query-strings." + }, { + id: "notrycatch", + label: "No try-catch", + tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging " + "exceptions in IE reasonable. Stored as query-strings." + }); + + QUnit.begin(function () { + var i, + option, + urlConfig = QUnit.config.urlConfig; + + for (i = 0; i < urlConfig.length; i++) { + + // Options can be either strings or objects with nonempty "id" properties + option = QUnit.config.urlConfig[i]; + if (typeof option !== "string") { + option = option.id; + } + + if (QUnit.config[option] === undefined) { + QUnit.config[option] = urlParams[option]; + } + } + }); + + function getUrlParams() { + var i, param, name, value; + var urlParams = Object.create(null); + var params = location.search.slice(1).split("&"); + var length = params.length; + + for (i = 0; i < length; i++) { + if (params[i]) { + param = params[i].split("="); + name = decodeQueryParam(param[0]); + + // Allow just a key to turn on a flag, e.g., test.html?noglobals + value = param.length === 1 || decodeQueryParam(param.slice(1).join("=")); + if (name in urlParams) { + urlParams[name] = [].concat(urlParams[name], value); + } else { + urlParams[name] = value; + } + } + } + + return urlParams; + } + + function decodeQueryParam(param) { + return decodeURIComponent(param.replace(/\+/g, "%20")); + } + })(); + +}((function() { return this; }()))); diff --git a/node_modules/seedrandom/test/lib/require.js b/node_modules/seedrandom/test/lib/require.js new file mode 100644 index 0000000..4db1424 --- /dev/null +++ b/node_modules/seedrandom/test/lib/require.js @@ -0,0 +1,2142 @@ +/** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 2.3.2 Copyright jQuery Foundation and other contributors. + * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE + */ +//Not using strict: uneven strict support in browsers, #392, and causes +//problems with requirejs.exec()/transpiler plugins that may not be strict. +/*jslint regexp: true, nomen: true, sloppy: true */ +/*global window, navigator, document, importScripts, setTimeout, opera */ + +var requirejs, require, define; +(function (global, setTimeout) { + var req, s, head, baseElement, dataMain, src, + interactiveScript, currentlyAddingScript, mainScript, subPath, + version = '2.3.2', + commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg, + cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, + jsSuffixRegExp = /\.js$/, + currDirRegExp = /^\.\//, + op = Object.prototype, + ostring = op.toString, + hasOwn = op.hasOwnProperty, + isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document), + isWebWorker = !isBrowser && typeof importScripts !== 'undefined', + //PS3 indicates loaded and complete, but need to wait for complete + //specifically. Sequence is 'loading', 'loaded', execution, + // then 'complete'. The UA check is unfortunate, but not sure how + //to feature test w/o causing perf issues. + readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? + /^complete$/ : /^(complete|loaded)$/, + defContextName = '_', + //Oh the tragedy, detecting opera. See the usage of isOpera for reason. + isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', + contexts = {}, + cfg = {}, + globalDefQueue = [], + useInteractive = false; + + //Could match something like ')//comment', do not lose the prefix to comment. + function commentReplace(match, singlePrefix) { + return singlePrefix || ''; + } + + function isFunction(it) { + return ostring.call(it) === '[object Function]'; + } + + function isArray(it) { + return ostring.call(it) === '[object Array]'; + } + + /** + * Helper function for iterating over an array. If the func returns + * a true value, it will break out of the loop. + */ + function each(ary, func) { + if (ary) { + var i; + for (i = 0; i < ary.length; i += 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + /** + * Helper function for iterating over an array backwards. If the func + * returns a true value, it will break out of the loop. + */ + function eachReverse(ary, func) { + if (ary) { + var i; + for (i = ary.length - 1; i > -1; i -= 1) { + if (ary[i] && func(ary[i], i, ary)) { + break; + } + } + } + } + + function hasProp(obj, prop) { + return hasOwn.call(obj, prop); + } + + function getOwn(obj, prop) { + return hasProp(obj, prop) && obj[prop]; + } + + /** + * Cycles over properties in an object and calls a function for each + * property value. If the function returns a truthy value, then the + * iteration is stopped. + */ + function eachProp(obj, func) { + var prop; + for (prop in obj) { + if (hasProp(obj, prop)) { + if (func(obj[prop], prop)) { + break; + } + } + } + } + + /** + * Simple function to mix in properties from source into target, + * but only if target does not already have a property of the same name. + */ + function mixin(target, source, force, deepStringMixin) { + if (source) { + eachProp(source, function (value, prop) { + if (force || !hasProp(target, prop)) { + if (deepStringMixin && typeof value === 'object' && value && + !isArray(value) && !isFunction(value) && + !(value instanceof RegExp)) { + + if (!target[prop]) { + target[prop] = {}; + } + mixin(target[prop], value, force, deepStringMixin); + } else { + target[prop] = value; + } + } + }); + } + return target; + } + + //Similar to Function.prototype.bind, but the 'this' object is specified + //first, since it is easier to read/figure out what 'this' will be. + function bind(obj, fn) { + return function () { + return fn.apply(obj, arguments); + }; + } + + function scripts() { + return document.getElementsByTagName('script'); + } + + function defaultOnError(err) { + throw err; + } + + //Allow getting a global that is expressed in + //dot notation, like 'a.b.c'. + function getGlobal(value) { + if (!value) { + return value; + } + var g = global; + each(value.split('.'), function (part) { + g = g[part]; + }); + return g; + } + + /** + * Constructs an error with a pointer to an URL with more information. + * @param {String} id the error ID that maps to an ID on a web page. + * @param {String} message human readable error. + * @param {Error} [err] the original error, if there is one. + * + * @returns {Error} + */ + function makeError(id, msg, err, requireModules) { + var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); + e.requireType = id; + e.requireModules = requireModules; + if (err) { + e.originalError = err; + } + return e; + } + + if (typeof define !== 'undefined') { + //If a define is already in play via another AMD loader, + //do not overwrite. + return; + } + + if (typeof requirejs !== 'undefined') { + if (isFunction(requirejs)) { + //Do not overwrite an existing requirejs instance. + return; + } + cfg = requirejs; + requirejs = undefined; + } + + //Allow for a require config object + if (typeof require !== 'undefined' && !isFunction(require)) { + //assume it is a config object. + cfg = require; + require = undefined; + } + + function newContext(contextName) { + var inCheckLoaded, Module, context, handlers, + checkLoadedTimeoutId, + config = { + //Defaults. Do not set a default for map + //config to speed up normalize(), which + //will run faster if there is no default. + waitSeconds: 7, + baseUrl: './', + paths: {}, + bundles: {}, + pkgs: {}, + shim: {}, + config: {} + }, + registry = {}, + //registry of just enabled modules, to speed + //cycle breaking code when lots of modules + //are registered, but not activated. + enabledRegistry = {}, + undefEvents = {}, + defQueue = [], + defined = {}, + urlFetched = {}, + bundlesMap = {}, + requireCounter = 1, + unnormalizedCounter = 1; + + /** + * Trims the . and .. from an array of path segments. + * It will keep a leading path segment if a .. will become + * the first path segment, to help with module name lookups, + * which act like paths, but can be remapped. But the end result, + * all paths that use this function should look normalized. + * NOTE: this method MODIFIES the input array. + * @param {Array} ary the array of path segments. + */ + function trimDots(ary) { + var i, part; + for (i = 0; i < ary.length; i++) { + part = ary[i]; + if (part === '.') { + ary.splice(i, 1); + i -= 1; + } else if (part === '..') { + // If at the start, or previous value is still .., + // keep them so that when converted to a path it may + // still work when converted to a path, even though + // as an ID it is less than ideal. In larger point + // releases, may be better to just kick out an error. + if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') { + continue; + } else if (i > 0) { + ary.splice(i - 1, 2); + i -= 2; + } + } + } + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @param {Boolean} applyMap apply the map config to the value. Should + * only be done if this normalization is for a dependency ID. + * @returns {String} normalized name + */ + function normalize(name, baseName, applyMap) { + var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, + foundMap, foundI, foundStarMap, starI, normalizedBaseParts, + baseParts = (baseName && baseName.split('/')), + map = config.map, + starMap = map && map['*']; + + //Adjust any relative paths. + if (name) { + name = name.split('/'); + lastIndex = name.length - 1; + + // If wanting node ID compatibility, strip .js from end + // of IDs. Have to do this here, and not in nameToUrl + // because node allows either .js or non .js to map + // to same file. + if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { + name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); + } + + // Starts with a '.' so need the baseName + if (name[0].charAt(0) === '.' && baseParts) { + //Convert baseName to array, and lop off the last part, + //so that . matches that 'directory' and not name of the baseName's + //module. For instance, baseName of 'one/two/three', maps to + //'one/two/three.js', but we want the directory, 'one/two' for + //this normalization. + normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); + name = normalizedBaseParts.concat(name); + } + + trimDots(name); + name = name.join('/'); + } + + //Apply map config if available. + if (applyMap && map && (baseParts || starMap)) { + nameParts = name.split('/'); + + outerLoop: for (i = nameParts.length; i > 0; i -= 1) { + nameSegment = nameParts.slice(0, i).join('/'); + + if (baseParts) { + //Find the longest baseName segment match in the config. + //So, do joins on the biggest to smallest lengths of baseParts. + for (j = baseParts.length; j > 0; j -= 1) { + mapValue = getOwn(map, baseParts.slice(0, j).join('/')); + + //baseName segment has config, find if it has one for + //this name. + if (mapValue) { + mapValue = getOwn(mapValue, nameSegment); + if (mapValue) { + //Match, update name to the new value. + foundMap = mapValue; + foundI = i; + break outerLoop; + } + } + } + } + + //Check for a star map match, but just hold on to it, + //if there is a shorter segment match later in a matching + //config, then favor over this star map. + if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { + foundStarMap = getOwn(starMap, nameSegment); + starI = i; + } + } + + if (!foundMap && foundStarMap) { + foundMap = foundStarMap; + foundI = starI; + } + + if (foundMap) { + nameParts.splice(0, foundI, foundMap); + name = nameParts.join('/'); + } + } + + // If the name points to a package's name, use + // the package main instead. + pkgMain = getOwn(config.pkgs, name); + + return pkgMain ? pkgMain : name; + } + + function removeScript(name) { + if (isBrowser) { + each(scripts(), function (scriptNode) { + if (scriptNode.getAttribute('data-requiremodule') === name && + scriptNode.getAttribute('data-requirecontext') === context.contextName) { + scriptNode.parentNode.removeChild(scriptNode); + return true; + } + }); + } + } + + function hasPathFallback(id) { + var pathConfig = getOwn(config.paths, id); + if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { + //Pop off the first array value, since it failed, and + //retry + pathConfig.shift(); + context.require.undef(id); + + //Custom require that does not do map translation, since + //ID is "absolute", already mapped/resolved. + context.makeRequire(null, { + skipMap: true + })([id]); + + return true; + } + } + + //Turns a plugin!resource to [plugin, resource] + //with the plugin being undefined if the name + //did not have a plugin prefix. + function splitPrefix(name) { + var prefix, + index = name ? name.indexOf('!') : -1; + if (index > -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + return [prefix, name]; + } + + /** + * Creates a module mapping that includes plugin prefix, module + * name, and path. If parentModuleMap is provided it will + * also normalize the name via require.normalize() + * + * @param {String} name the module name + * @param {String} [parentModuleMap] parent module map + * for the module name, used to resolve relative names. + * @param {Boolean} isNormalized: is the ID already normalized. + * This is true if this call is done for a define() module ID. + * @param {Boolean} applyMap: apply the map config to the ID. + * Should only be true if this map is for a dependency. + * + * @returns {Object} + */ + function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { + var url, pluginModule, suffix, nameParts, + prefix = null, + parentName = parentModuleMap ? parentModuleMap.name : null, + originalName = name, + isDefine = true, + normalizedName = ''; + + //If no name, then it means it is a require call, generate an + //internal name. + if (!name) { + isDefine = false; + name = '_@r' + (requireCounter += 1); + } + + nameParts = splitPrefix(name); + prefix = nameParts[0]; + name = nameParts[1]; + + if (prefix) { + prefix = normalize(prefix, parentName, applyMap); + pluginModule = getOwn(defined, prefix); + } + + //Account for relative paths if there is a base name. + if (name) { + if (prefix) { + if (pluginModule && pluginModule.normalize) { + //Plugin is loaded, use its normalize method. + normalizedName = pluginModule.normalize(name, function (name) { + return normalize(name, parentName, applyMap); + }); + } else { + // If nested plugin references, then do not try to + // normalize, as it will not normalize correctly. This + // places a restriction on resourceIds, and the longer + // term solution is not to normalize until plugins are + // loaded and all normalizations to allow for async + // loading of a loader plugin. But for now, fixes the + // common uses. Details in #1131 + normalizedName = name.indexOf('!') === -1 ? + normalize(name, parentName, applyMap) : + name; + } + } else { + //A regular module. + normalizedName = normalize(name, parentName, applyMap); + + //Normalized name may be a plugin ID due to map config + //application in normalize. The map config values must + //already be normalized, so do not need to redo that part. + nameParts = splitPrefix(normalizedName); + prefix = nameParts[0]; + normalizedName = nameParts[1]; + isNormalized = true; + + url = context.nameToUrl(normalizedName); + } + } + + //If the id is a plugin id that cannot be determined if it needs + //normalization, stamp it with a unique ID so two matching relative + //ids that may conflict can be separate. + suffix = prefix && !pluginModule && !isNormalized ? + '_unnormalized' + (unnormalizedCounter += 1) : + ''; + + return { + prefix: prefix, + name: normalizedName, + parentMap: parentModuleMap, + unnormalized: !!suffix, + url: url, + originalName: originalName, + isDefine: isDefine, + id: (prefix ? + prefix + '!' + normalizedName : + normalizedName) + suffix + }; + } + + function getModule(depMap) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (!mod) { + mod = registry[id] = new context.Module(depMap); + } + + return mod; + } + + function on(depMap, name, fn) { + var id = depMap.id, + mod = getOwn(registry, id); + + if (hasProp(defined, id) && + (!mod || mod.defineEmitComplete)) { + if (name === 'defined') { + fn(defined[id]); + } + } else { + mod = getModule(depMap); + if (mod.error && name === 'error') { + fn(mod.error); + } else { + mod.on(name, fn); + } + } + } + + function onError(err, errback) { + var ids = err.requireModules, + notified = false; + + if (errback) { + errback(err); + } else { + each(ids, function (id) { + var mod = getOwn(registry, id); + if (mod) { + //Set error on module, so it skips timeout checks. + mod.error = err; + if (mod.events.error) { + notified = true; + mod.emit('error', err); + } + } + }); + + if (!notified) { + req.onError(err); + } + } + } + + /** + * Internal method to transfer globalQueue items to this context's + * defQueue. + */ + function takeGlobalQueue() { + //Push all the globalDefQueue items into the context's defQueue + if (globalDefQueue.length) { + each(globalDefQueue, function(queueItem) { + var id = queueItem[0]; + if (typeof id === 'string') { + context.defQueueMap[id] = true; + } + defQueue.push(queueItem); + }); + globalDefQueue = []; + } + } + + handlers = { + 'require': function (mod) { + if (mod.require) { + return mod.require; + } else { + return (mod.require = context.makeRequire(mod.map)); + } + }, + 'exports': function (mod) { + mod.usingExports = true; + if (mod.map.isDefine) { + if (mod.exports) { + return (defined[mod.map.id] = mod.exports); + } else { + return (mod.exports = defined[mod.map.id] = {}); + } + } + }, + 'module': function (mod) { + if (mod.module) { + return mod.module; + } else { + return (mod.module = { + id: mod.map.id, + uri: mod.map.url, + config: function () { + return getOwn(config.config, mod.map.id) || {}; + }, + exports: mod.exports || (mod.exports = {}) + }); + } + } + }; + + function cleanRegistry(id) { + //Clean up machinery used for waiting modules. + delete registry[id]; + delete enabledRegistry[id]; + } + + function breakCycle(mod, traced, processed) { + var id = mod.map.id; + + if (mod.error) { + mod.emit('error', mod.error); + } else { + traced[id] = true; + each(mod.depMaps, function (depMap, i) { + var depId = depMap.id, + dep = getOwn(registry, depId); + + //Only force things that have not completed + //being defined, so still in the registry, + //and only if it has not been matched up + //in the module already. + if (dep && !mod.depMatched[i] && !processed[depId]) { + if (getOwn(traced, depId)) { + mod.defineDep(i, defined[depId]); + mod.check(); //pass false? + } else { + breakCycle(dep, traced, processed); + } + } + }); + processed[id] = true; + } + } + + function checkLoaded() { + var err, usingPathFallback, + waitInterval = config.waitSeconds * 1000, + //It is possible to disable the wait interval by using waitSeconds of 0. + expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), + noLoads = [], + reqCalls = [], + stillLoading = false, + needCycleCheck = true; + + //Do not bother if this call was a result of a cycle break. + if (inCheckLoaded) { + return; + } + + inCheckLoaded = true; + + //Figure out the state of all the modules. + eachProp(enabledRegistry, function (mod) { + var map = mod.map, + modId = map.id; + + //Skip things that are not enabled or in error state. + if (!mod.enabled) { + return; + } + + if (!map.isDefine) { + reqCalls.push(mod); + } + + if (!mod.error) { + //If the module should be executed, and it has not + //been inited and time is up, remember it. + if (!mod.inited && expired) { + if (hasPathFallback(modId)) { + usingPathFallback = true; + stillLoading = true; + } else { + noLoads.push(modId); + removeScript(modId); + } + } else if (!mod.inited && mod.fetched && map.isDefine) { + stillLoading = true; + if (!map.prefix) { + //No reason to keep looking for unfinished + //loading. If the only stillLoading is a + //plugin resource though, keep going, + //because it may be that a plugin resource + //is waiting on a non-plugin cycle. + return (needCycleCheck = false); + } + } + } + }); + + if (expired && noLoads.length) { + //If wait time expired, throw error of unloaded modules. + err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); + err.contextName = context.contextName; + return onError(err); + } + + //Not expired, check for a cycle. + if (needCycleCheck) { + each(reqCalls, function (mod) { + breakCycle(mod, {}, {}); + }); + } + + //If still waiting on loads, and the waiting load is something + //other than a plugin resource, or there are still outstanding + //scripts, then just try back later. + if ((!expired || usingPathFallback) && stillLoading) { + //Something is still waiting to load. Wait for it, but only + //if a timeout is not already in effect. + if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { + checkLoadedTimeoutId = setTimeout(function () { + checkLoadedTimeoutId = 0; + checkLoaded(); + }, 50); + } + } + + inCheckLoaded = false; + } + + Module = function (map) { + this.events = getOwn(undefEvents, map.id) || {}; + this.map = map; + this.shim = getOwn(config.shim, map.id); + this.depExports = []; + this.depMaps = []; + this.depMatched = []; + this.pluginMaps = {}; + this.depCount = 0; + + /* this.exports this.factory + this.depMaps = [], + this.enabled, this.fetched + */ + }; + + Module.prototype = { + init: function (depMaps, factory, errback, options) { + options = options || {}; + + //Do not do more inits if already done. Can happen if there + //are multiple define calls for the same module. That is not + //a normal, common case, but it is also not unexpected. + if (this.inited) { + return; + } + + this.factory = factory; + + if (errback) { + //Register for errors on this module. + this.on('error', errback); + } else if (this.events.error) { + //If no errback already, but there are error listeners + //on this module, set up an errback to pass to the deps. + errback = bind(this, function (err) { + this.emit('error', err); + }); + } + + //Do a copy of the dependency array, so that + //source inputs are not modified. For example + //"shim" deps are passed in here directly, and + //doing a direct modification of the depMaps array + //would affect that config. + this.depMaps = depMaps && depMaps.slice(0); + + this.errback = errback; + + //Indicate this module has be initialized + this.inited = true; + + this.ignore = options.ignore; + + //Could have option to init this module in enabled mode, + //or could have been previously marked as enabled. However, + //the dependencies are not known until init is called. So + //if enabled previously, now trigger dependencies as enabled. + if (options.enabled || this.enabled) { + //Enable this module and dependencies. + //Will call this.check() + this.enable(); + } else { + this.check(); + } + }, + + defineDep: function (i, depExports) { + //Because of cycles, defined callback for a given + //export can be called more than once. + if (!this.depMatched[i]) { + this.depMatched[i] = true; + this.depCount -= 1; + this.depExports[i] = depExports; + } + }, + + fetch: function () { + if (this.fetched) { + return; + } + this.fetched = true; + + context.startTime = (new Date()).getTime(); + + var map = this.map; + + //If the manager is for a plugin managed resource, + //ask the plugin to load it now. + if (this.shim) { + context.makeRequire(this.map, { + enableBuildCallback: true + })(this.shim.deps || [], bind(this, function () { + return map.prefix ? this.callPlugin() : this.load(); + })); + } else { + //Regular dependency. + return map.prefix ? this.callPlugin() : this.load(); + } + }, + + load: function () { + var url = this.map.url; + + //Regular dependency. + if (!urlFetched[url]) { + urlFetched[url] = true; + context.load(this.map.id, url); + } + }, + + /** + * Checks if the module is ready to define itself, and if so, + * define it. + */ + check: function () { + if (!this.enabled || this.enabling) { + return; + } + + var err, cjsModule, + id = this.map.id, + depExports = this.depExports, + exports = this.exports, + factory = this.factory; + + if (!this.inited) { + // Only fetch if not already in the defQueue. + if (!hasProp(context.defQueueMap, id)) { + this.fetch(); + } + } else if (this.error) { + this.emit('error', this.error); + } else if (!this.defining) { + //The factory could trigger another require call + //that would result in checking this module to + //define itself again. If already in the process + //of doing that, skip this work. + this.defining = true; + + if (this.depCount < 1 && !this.defined) { + if (isFunction(factory)) { + //If there is an error listener, favor passing + //to that instead of throwing an error. However, + //only do it for define()'d modules. require + //errbacks should not be called for failures in + //their callbacks (#699). However if a global + //onError is set, use that. + if ((this.events.error && this.map.isDefine) || + req.onError !== defaultOnError) { + try { + exports = context.execCb(id, factory, depExports, exports); + } catch (e) { + err = e; + } + } else { + exports = context.execCb(id, factory, depExports, exports); + } + + // Favor return value over exports. If node/cjs in play, + // then will not have a return value anyway. Favor + // module.exports assignment over exports object. + if (this.map.isDefine && exports === undefined) { + cjsModule = this.module; + if (cjsModule) { + exports = cjsModule.exports; + } else if (this.usingExports) { + //exports already set the defined value. + exports = this.exports; + } + } + + if (err) { + err.requireMap = this.map; + err.requireModules = this.map.isDefine ? [this.map.id] : null; + err.requireType = this.map.isDefine ? 'define' : 'require'; + return onError((this.error = err)); + } + + } else { + //Just a literal value + exports = factory; + } + + this.exports = exports; + + if (this.map.isDefine && !this.ignore) { + defined[id] = exports; + + if (req.onResourceLoad) { + var resLoadMaps = []; + each(this.depMaps, function (depMap) { + resLoadMaps.push(depMap.normalizedMap || depMap); + }); + req.onResourceLoad(context, this.map, resLoadMaps); + } + } + + //Clean up + cleanRegistry(id); + + this.defined = true; + } + + //Finished the define stage. Allow calling check again + //to allow define notifications below in the case of a + //cycle. + this.defining = false; + + if (this.defined && !this.defineEmitted) { + this.defineEmitted = true; + this.emit('defined', this.exports); + this.defineEmitComplete = true; + } + + } + }, + + callPlugin: function () { + var map = this.map, + id = map.id, + //Map already normalized the prefix. + pluginMap = makeModuleMap(map.prefix); + + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(pluginMap); + + on(pluginMap, 'defined', bind(this, function (plugin) { + var load, normalizedMap, normalizedMod, + bundleId = getOwn(bundlesMap, this.map.id), + name = this.map.name, + parentName = this.map.parentMap ? this.map.parentMap.name : null, + localRequire = context.makeRequire(map.parentMap, { + enableBuildCallback: true + }); + + //If current map is not normalized, wait for that + //normalized name to load instead of continuing. + if (this.map.unnormalized) { + //Normalize the ID if the plugin allows it. + if (plugin.normalize) { + name = plugin.normalize(name, function (name) { + return normalize(name, parentName, true); + }) || ''; + } + + //prefix and name should already be normalized, no need + //for applying map config again either. + normalizedMap = makeModuleMap(map.prefix + '!' + name, + this.map.parentMap); + on(normalizedMap, + 'defined', bind(this, function (value) { + this.map.normalizedMap = normalizedMap; + this.init([], function () { return value; }, null, { + enabled: true, + ignore: true + }); + })); + + normalizedMod = getOwn(registry, normalizedMap.id); + if (normalizedMod) { + //Mark this as a dependency for this plugin, so it + //can be traced for cycles. + this.depMaps.push(normalizedMap); + + if (this.events.error) { + normalizedMod.on('error', bind(this, function (err) { + this.emit('error', err); + })); + } + normalizedMod.enable(); + } + + return; + } + + //If a paths config, then just load that file instead to + //resolve the plugin, as it is built into that paths layer. + if (bundleId) { + this.map.url = context.nameToUrl(bundleId); + this.load(); + return; + } + + load = bind(this, function (value) { + this.init([], function () { return value; }, null, { + enabled: true + }); + }); + + load.error = bind(this, function (err) { + this.inited = true; + this.error = err; + err.requireModules = [id]; + + //Remove temp unnormalized modules for this module, + //since they will never be resolved otherwise now. + eachProp(registry, function (mod) { + if (mod.map.id.indexOf(id + '_unnormalized') === 0) { + cleanRegistry(mod.map.id); + } + }); + + onError(err); + }); + + //Allow plugins to load other code without having to know the + //context or how to 'complete' the load. + load.fromText = bind(this, function (text, textAlt) { + /*jslint evil: true */ + var moduleName = map.name, + moduleMap = makeModuleMap(moduleName), + hasInteractive = useInteractive; + + //As of 2.1.0, support just passing the text, to reinforce + //fromText only being called once per resource. Still + //support old style of passing moduleName but discard + //that moduleName in favor of the internal ref. + if (textAlt) { + text = textAlt; + } + + //Turn off interactive script matching for IE for any define + //calls in the text, then turn it back on at the end. + if (hasInteractive) { + useInteractive = false; + } + + //Prime the system by creating a module instance for + //it. + getModule(moduleMap); + + //Transfer any config to this other module. + if (hasProp(config.config, id)) { + config.config[moduleName] = config.config[id]; + } + + try { + req.exec(text); + } catch (e) { + return onError(makeError('fromtexteval', + 'fromText eval for ' + id + + ' failed: ' + e, + e, + [id])); + } + + if (hasInteractive) { + useInteractive = true; + } + + //Mark this as a dependency for the plugin + //resource + this.depMaps.push(moduleMap); + + //Support anonymous modules. + context.completeLoad(moduleName); + + //Bind the value of that module to the value for this + //resource ID. + localRequire([moduleName], load); + }); + + //Use parentName here since the plugin's name is not reliable, + //could be some weird string with no path that actually wants to + //reference the parentName's path. + plugin.load(map.name, localRequire, load, config); + })); + + context.enable(pluginMap, this); + this.pluginMaps[pluginMap.id] = pluginMap; + }, + + enable: function () { + enabledRegistry[this.map.id] = this; + this.enabled = true; + + //Set flag mentioning that the module is enabling, + //so that immediate calls to the defined callbacks + //for dependencies do not trigger inadvertent load + //with the depCount still being zero. + this.enabling = true; + + //Enable each dependency + each(this.depMaps, bind(this, function (depMap, i) { + var id, mod, handler; + + if (typeof depMap === 'string') { + //Dependency needs to be converted to a depMap + //and wired up to this module. + depMap = makeModuleMap(depMap, + (this.map.isDefine ? this.map : this.map.parentMap), + false, + !this.skipMap); + this.depMaps[i] = depMap; + + handler = getOwn(handlers, depMap.id); + + if (handler) { + this.depExports[i] = handler(this); + return; + } + + this.depCount += 1; + + on(depMap, 'defined', bind(this, function (depExports) { + if (this.undefed) { + return; + } + this.defineDep(i, depExports); + this.check(); + })); + + if (this.errback) { + on(depMap, 'error', bind(this, this.errback)); + } else if (this.events.error) { + // No direct errback on this module, but something + // else is listening for errors, so be sure to + // propagate the error correctly. + on(depMap, 'error', bind(this, function(err) { + this.emit('error', err); + })); + } + } + + id = depMap.id; + mod = registry[id]; + + //Skip special modules like 'require', 'exports', 'module' + //Also, don't call enable if it is already enabled, + //important in circular dependency cases. + if (!hasProp(handlers, id) && mod && !mod.enabled) { + context.enable(depMap, this); + } + })); + + //Enable each plugin that is used in + //a dependency + eachProp(this.pluginMaps, bind(this, function (pluginMap) { + var mod = getOwn(registry, pluginMap.id); + if (mod && !mod.enabled) { + context.enable(pluginMap, this); + } + })); + + this.enabling = false; + + this.check(); + }, + + on: function (name, cb) { + var cbs = this.events[name]; + if (!cbs) { + cbs = this.events[name] = []; + } + cbs.push(cb); + }, + + emit: function (name, evt) { + each(this.events[name], function (cb) { + cb(evt); + }); + if (name === 'error') { + //Now that the error handler was triggered, remove + //the listeners, since this broken Module instance + //can stay around for a while in the registry. + delete this.events[name]; + } + } + }; + + function callGetModule(args) { + //Skip modules already defined. + if (!hasProp(defined, args[0])) { + getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); + } + } + + function removeListener(node, func, name, ieName) { + //Favor detachEvent because of IE9 + //issue, see attachEvent/addEventListener comment elsewhere + //in this file. + if (node.detachEvent && !isOpera) { + //Probably IE. If not it will throw an error, which will be + //useful to know. + if (ieName) { + node.detachEvent(ieName, func); + } + } else { + node.removeEventListener(name, func, false); + } + } + + /** + * Given an event from a script node, get the requirejs info from it, + * and then removes the event listeners on the node. + * @param {Event} evt + * @returns {Object} + */ + function getScriptData(evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + var node = evt.currentTarget || evt.srcElement; + + //Remove the listeners once here. + removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); + removeListener(node, context.onScriptError, 'error'); + + return { + node: node, + id: node && node.getAttribute('data-requiremodule') + }; + } + + function intakeDefines() { + var args; + + //Any defined modules in the global queue, intake them now. + takeGlobalQueue(); + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + + args[args.length - 1])); + } else { + //args are id, deps, factory. Should be normalized by the + //define() function. + callGetModule(args); + } + } + context.defQueueMap = {}; + } + + context = { + config: config, + contextName: contextName, + registry: registry, + defined: defined, + urlFetched: urlFetched, + defQueue: defQueue, + defQueueMap: {}, + Module: Module, + makeModuleMap: makeModuleMap, + nextTick: req.nextTick, + onError: onError, + + /** + * Set a configuration for the context. + * @param {Object} cfg config object to integrate. + */ + configure: function (cfg) { + //Make sure the baseUrl ends in a slash. + if (cfg.baseUrl) { + if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { + cfg.baseUrl += '/'; + } + } + + // Convert old style urlArgs string to a function. + if (typeof cfg.urlArgs === 'string') { + var urlArgs = cfg.urlArgs; + cfg.urlArgs = function(id, url) { + return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs; + }; + } + + //Save off the paths since they require special processing, + //they are additive. + var shim = config.shim, + objs = { + paths: true, + bundles: true, + config: true, + map: true + }; + + eachProp(cfg, function (value, prop) { + if (objs[prop]) { + if (!config[prop]) { + config[prop] = {}; + } + mixin(config[prop], value, true, true); + } else { + config[prop] = value; + } + }); + + //Reverse map the bundles + if (cfg.bundles) { + eachProp(cfg.bundles, function (value, prop) { + each(value, function (v) { + if (v !== prop) { + bundlesMap[v] = prop; + } + }); + }); + } + + //Merge shim + if (cfg.shim) { + eachProp(cfg.shim, function (value, id) { + //Normalize the structure + if (isArray(value)) { + value = { + deps: value + }; + } + if ((value.exports || value.init) && !value.exportsFn) { + value.exportsFn = context.makeShimExports(value); + } + shim[id] = value; + }); + config.shim = shim; + } + + //Adjust packages if necessary. + if (cfg.packages) { + each(cfg.packages, function (pkgObj) { + var location, name; + + pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj; + + name = pkgObj.name; + location = pkgObj.location; + if (location) { + config.paths[name] = pkgObj.location; + } + + //Save pointer to main module ID for pkg name. + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main') + .replace(currDirRegExp, '') + .replace(jsSuffixRegExp, ''); + }); + } + + //If there are any "waiting to execute" modules in the registry, + //update the maps for them, since their info, like URLs to load, + //may have changed. + eachProp(registry, function (mod, id) { + //If module already has init called, since it is too + //late to modify them, and ignore unnormalized ones + //since they are transient. + if (!mod.inited && !mod.map.unnormalized) { + mod.map = makeModuleMap(id, null, true); + } + }); + + //If a deps array or a config callback is specified, then call + //require with those args. This is useful when require is defined as a + //config object before require.js is loaded. + if (cfg.deps || cfg.callback) { + context.require(cfg.deps || [], cfg.callback); + } + }, + + makeShimExports: function (value) { + function fn() { + var ret; + if (value.init) { + ret = value.init.apply(global, arguments); + } + return ret || (value.exports && getGlobal(value.exports)); + } + return fn; + }, + + makeRequire: function (relMap, options) { + options = options || {}; + + function localRequire(deps, callback, errback) { + var id, map, requireMod; + + if (options.enableBuildCallback && callback && isFunction(callback)) { + callback.__requireJsBuild = true; + } + + if (typeof deps === 'string') { + if (isFunction(callback)) { + //Invalid call + return onError(makeError('requireargs', 'Invalid require call'), errback); + } + + //If require|exports|module are requested, get the + //value for them from the special handlers. Caveat: + //this only works while module is being defined. + if (relMap && hasProp(handlers, deps)) { + return handlers[deps](registry[relMap.id]); + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + if (req.get) { + return req.get(context, deps, relMap, localRequire); + } + + //Normalize module name, if it contains . or .. + map = makeModuleMap(deps, relMap, false, true); + id = map.id; + + if (!hasProp(defined, id)) { + return onError(makeError('notloaded', 'Module name "' + + id + + '" has not been loaded yet for context: ' + + contextName + + (relMap ? '' : '. Use require([])'))); + } + return defined[id]; + } + + //Grab defines waiting in the global queue. + intakeDefines(); + + //Mark all the dependencies as needing to be loaded. + context.nextTick(function () { + //Some defines could have been added since the + //require call, collect them. + intakeDefines(); + + requireMod = getModule(makeModuleMap(null, relMap)); + + //Store if map config should be applied to this require + //call for dependencies. + requireMod.skipMap = options.skipMap; + + requireMod.init(deps, callback, errback, { + enabled: true + }); + + checkLoaded(); + }); + + return localRequire; + } + + mixin(localRequire, { + isBrowser: isBrowser, + + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt) { + var ext, + index = moduleNamePlusExt.lastIndexOf('.'), + segment = moduleNamePlusExt.split('/')[0], + isRelative = segment === '.' || segment === '..'; + + //Have a file extension alias, and it is not the + //dots from a relative path. + if (index !== -1 && (!isRelative || index > 1)) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); + moduleNamePlusExt = moduleNamePlusExt.substring(0, index); + } + + return context.nameToUrl(normalize(moduleNamePlusExt, + relMap && relMap.id, true), ext, true); + }, + + defined: function (id) { + return hasProp(defined, makeModuleMap(id, relMap, false, true).id); + }, + + specified: function (id) { + id = makeModuleMap(id, relMap, false, true).id; + return hasProp(defined, id) || hasProp(registry, id); + } + }); + + //Only allow undef on top level require calls + if (!relMap) { + localRequire.undef = function (id) { + //Bind any waiting define() calls to this context, + //fix for #408 + takeGlobalQueue(); + + var map = makeModuleMap(id, relMap, true), + mod = getOwn(registry, id); + + mod.undefed = true; + removeScript(id); + + delete defined[id]; + delete urlFetched[map.url]; + delete undefEvents[id]; + + //Clean queued defines too. Go backwards + //in array so that the splices do not + //mess up the iteration. + eachReverse(defQueue, function(args, i) { + if (args[0] === id) { + defQueue.splice(i, 1); + } + }); + delete context.defQueueMap[id]; + + if (mod) { + //Hold on to listeners in case the + //module will be attempted to be reloaded + //using a different config. + if (mod.events.defined) { + undefEvents[id] = mod.events; + } + + cleanRegistry(id); + } + }; + } + + return localRequire; + }, + + /** + * Called to enable a module if it is still in the registry + * awaiting enablement. A second arg, parent, the parent module, + * is passed in for context, when this method is overridden by + * the optimizer. Not shown here to keep code compact. + */ + enable: function (depMap) { + var mod = getOwn(registry, depMap.id); + if (mod) { + getModule(depMap).enable(); + } + }, + + /** + * Internal method used by environment adapters to complete a load event. + * A load event could be a script load or just a load pass from a synchronous + * load call. + * @param {String} moduleName the name of the module to potentially complete. + */ + completeLoad: function (moduleName) { + var found, args, mod, + shim = getOwn(config.shim, moduleName) || {}, + shExports = shim.exports; + + takeGlobalQueue(); + + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + args[0] = moduleName; + //If already found an anonymous module and bound it + //to this name, then this is some other anon module + //waiting for its completeLoad to fire. + if (found) { + break; + } + found = true; + } else if (args[0] === moduleName) { + //Found matching define call for this script! + found = true; + } + + callGetModule(args); + } + context.defQueueMap = {}; + + //Do this after the cycle of callGetModule in case the result + //of those calls/init calls changes the registry. + mod = getOwn(registry, moduleName); + + if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { + if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { + if (hasPathFallback(moduleName)) { + return; + } else { + return onError(makeError('nodefine', + 'No define call for ' + moduleName, + null, + [moduleName])); + } + } else { + //A script that does not call define(), so just simulate + //the call for it. + callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); + } + } + + checkLoaded(); + }, + + /** + * Converts a module name to a file path. Supports cases where + * moduleName may actually be just an URL. + * Note that it **does not** call normalize on the moduleName, + * it is assumed to have already been normalized. This is an + * internal API, not a public one. Use toUrl for the public API. + */ + nameToUrl: function (moduleName, ext, skipExt) { + var paths, syms, i, parentModule, url, + parentPath, bundleId, + pkgMain = getOwn(config.pkgs, moduleName); + + if (pkgMain) { + moduleName = pkgMain; + } + + bundleId = getOwn(bundlesMap, moduleName); + + if (bundleId) { + return context.nameToUrl(bundleId, ext, skipExt); + } + + //If a colon is in the URL, it indicates a protocol is used and it is just + //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) + //or ends with .js, then assume the user meant to use an url and not a module id. + //The slash is important for protocol-less URLs as well as full paths. + if (req.jsExtRegExp.test(moduleName)) { + //Just a plain path, not module name lookup, so just return it. + //Add extension if it is included. This is a bit wonky, only non-.js things pass + //an extension, this method probably needs to be reworked. + url = moduleName + (ext || ''); + } else { + //A module that needs to be converted to a path. + paths = config.paths; + + syms = moduleName.split('/'); + //For each module name segment, see if there is a path + //registered for it. Start with most specific name + //and work up from it. + for (i = syms.length; i > 0; i -= 1) { + parentModule = syms.slice(0, i).join('/'); + + parentPath = getOwn(paths, parentModule); + if (parentPath) { + //If an array, it means there are a few choices, + //Choose the one that is desired + if (isArray(parentPath)) { + parentPath = parentPath[0]; + } + syms.splice(0, i, parentPath); + break; + } + } + + //Join the path parts together, then figure out if baseUrl is needed. + url = syms.join('/'); + url += (ext || (/^data\:|^blob\:|\?/.test(url) || skipExt ? '' : '.js')); + url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; + } + + return config.urlArgs && !/^blob\:/.test(url) ? + url + config.urlArgs(moduleName, url) : url; + }, + + //Delegates to req.load. Broken out as a separate function to + //allow overriding in the optimizer. + load: function (id, url) { + req.load(context, id, url); + }, + + /** + * Executes a module callback function. Broken out as a separate function + * solely to allow the build system to sequence the files in the built + * layer in the right sequence. + * + * @private + */ + execCb: function (name, callback, args, exports) { + return callback.apply(exports, args); + }, + + /** + * callback for script loads, used to check status of loading. + * + * @param {Event} evt the event from the browser for the script + * that was loaded. + */ + onScriptLoad: function (evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + if (evt.type === 'load' || + (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { + //Reset interactive script so a script node is not held onto for + //to long. + interactiveScript = null; + + //Pull out the name of the module and the context. + var data = getScriptData(evt); + context.completeLoad(data.id); + } + }, + + /** + * Callback for script errors. + */ + onScriptError: function (evt) { + var data = getScriptData(evt); + if (!hasPathFallback(data.id)) { + var parents = []; + eachProp(registry, function(value, key) { + if (key.indexOf('_@r') !== 0) { + each(value.depMaps, function(depMap) { + if (depMap.id === data.id) { + parents.push(key); + return true; + } + }); + } + }); + return onError(makeError('scripterror', 'Script error for "' + data.id + + (parents.length ? + '", needed by: ' + parents.join(', ') : + '"'), evt, [data.id])); + } + } + }; + + context.require = context.makeRequire(); + return context; + } + + /** + * Main entry point. + * + * If the only argument to require is a string, then the module that + * is represented by that string is fetched for the appropriate context. + * + * If the first argument is an array, then it will be treated as an array + * of dependency string names to fetch. An optional function callback can + * be specified to execute when all of those dependencies are available. + * + * Make a local req variable to help Caja compliance (it assumes things + * on a require that are not standardized), and to give a short + * name for minification/local scope use. + */ + req = requirejs = function (deps, callback, errback, optional) { + + //Find the right context, use default + var context, config, + contextName = defContextName; + + // Determine if have config object in the call. + if (!isArray(deps) && typeof deps !== 'string') { + // deps is a config object + config = deps; + if (isArray(callback)) { + // Adjust args if there are dependencies + deps = callback; + callback = errback; + errback = optional; + } else { + deps = []; + } + } + + if (config && config.context) { + contextName = config.context; + } + + context = getOwn(contexts, contextName); + if (!context) { + context = contexts[contextName] = req.s.newContext(contextName); + } + + if (config) { + context.configure(config); + } + + return context.require(deps, callback, errback); + }; + + /** + * Support require.config() to make it easier to cooperate with other + * AMD loaders on globally agreed names. + */ + req.config = function (config) { + return req(config); + }; + + /** + * Execute something after the current tick + * of the event loop. Override for other envs + * that have a better solution than setTimeout. + * @param {Function} fn function to execute later. + */ + req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { + setTimeout(fn, 4); + } : function (fn) { fn(); }; + + /** + * Export require as a global, but only if it does not already exist. + */ + if (!require) { + require = req; + } + + req.version = version; + + //Used to filter out dependencies that are already paths. + req.jsExtRegExp = /^\/|:|\?|\.js$/; + req.isBrowser = isBrowser; + s = req.s = { + contexts: contexts, + newContext: newContext + }; + + //Create default context. + req({}); + + //Exports some context-sensitive methods on global require. + each([ + 'toUrl', + 'undef', + 'defined', + 'specified' + ], function (prop) { + //Reference from contexts instead of early binding to default context, + //so that during builds, the latest instance of the default context + //with its config gets used. + req[prop] = function () { + var ctx = contexts[defContextName]; + return ctx.require[prop].apply(ctx, arguments); + }; + }); + + if (isBrowser) { + head = s.head = document.getElementsByTagName('head')[0]; + //If BASE tag is in play, using appendChild is a problem for IE6. + //When that browser dies, this can be removed. Details in this jQuery bug: + //http://dev.jquery.com/ticket/2709 + baseElement = document.getElementsByTagName('base')[0]; + if (baseElement) { + head = s.head = baseElement.parentNode; + } + } + + /** + * Any errors that require explicitly generates will be passed to this + * function. Intercept/override it if you want custom error handling. + * @param {Error} err the error object. + */ + req.onError = defaultOnError; + + /** + * Creates the node for the load command. Only used in browser envs. + */ + req.createNode = function (config, moduleName, url) { + var node = config.xhtml ? + document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : + document.createElement('script'); + node.type = config.scriptType || 'text/javascript'; + node.charset = 'utf-8'; + node.async = true; + return node; + }; + + /** + * Does the request to load a module for the browser case. + * Make this a separate function to allow other environments + * to override it. + * + * @param {Object} context the require context to find state. + * @param {String} moduleName the name of the module. + * @param {Object} url the URL to the module. + */ + req.load = function (context, moduleName, url) { + var config = (context && context.config) || {}, + node; + if (isBrowser) { + //In the browser so use a script tag + node = req.createNode(config, moduleName, url); + + node.setAttribute('data-requirecontext', context.contextName); + node.setAttribute('data-requiremodule', moduleName); + + //Set up load listener. Test attachEvent first because IE9 has + //a subtle issue in its addEventListener and script onload firings + //that do not match the behavior of all other browsers with + //addEventListener support, which fire the onload event for a + //script right after the script execution. See: + //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution + //UNFORTUNATELY Opera implements attachEvent but does not follow the script + //script execution mode. + if (node.attachEvent && + //Check if node.attachEvent is artificially added by custom script or + //natively supported by browser + //read https://github.com/requirejs/requirejs/issues/187 + //if we can NOT find [native code] then it must NOT natively supported. + //in IE8, node.attachEvent does not have toString() + //Note the test for "[native code" with no closing brace, see: + //https://github.com/requirejs/requirejs/issues/273 + !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && + !isOpera) { + //Probably IE. IE (at least 6-8) do not fire + //script onload right after executing the script, so + //we cannot tie the anonymous define call to a name. + //However, IE reports the script as being in 'interactive' + //readyState at the time of the define call. + useInteractive = true; + + node.attachEvent('onreadystatechange', context.onScriptLoad); + //It would be great to add an error handler here to catch + //404s in IE9+. However, onreadystatechange will fire before + //the error handler, so that does not help. If addEventListener + //is used, then IE will fire error before load, but we cannot + //use that pathway given the connect.microsoft.com issue + //mentioned above about not doing the 'script execute, + //then fire the script load event listener before execute + //next script' that other browsers do. + //Best hope: IE10 fixes the issues, + //and then destroys all installs of IE 6-9. + //node.attachEvent('onerror', context.onScriptError); + } else { + node.addEventListener('load', context.onScriptLoad, false); + node.addEventListener('error', context.onScriptError, false); + } + node.src = url; + + //Calling onNodeCreated after all properties on the node have been + //set, but before it is placed in the DOM. + if (config.onNodeCreated) { + config.onNodeCreated(node, config, moduleName, url); + } + + //For some cache cases in IE 6-8, the script executes before the end + //of the appendChild execution, so to tie an anonymous define + //call to the module name (which is stored on the node), hold on + //to a reference to this node, but clear after the DOM insertion. + currentlyAddingScript = node; + if (baseElement) { + head.insertBefore(node, baseElement); + } else { + head.appendChild(node); + } + currentlyAddingScript = null; + + return node; + } else if (isWebWorker) { + try { + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation is that a build has been done so + //that only one script needs to be loaded anyway. This may need + //to be reevaluated if other use cases become common. + + // Post a task to the event loop to work around a bug in WebKit + // where the worker gets garbage-collected after calling + // importScripts(): https://webkit.org/b/153317 + setTimeout(function() {}, 0); + importScripts(url); + + //Account for anonymous modules + context.completeLoad(moduleName); + } catch (e) { + context.onError(makeError('importscripts', + 'importScripts failed for ' + + moduleName + ' at ' + url, + e, + [moduleName])); + } + } + }; + + function getInteractiveScript() { + if (interactiveScript && interactiveScript.readyState === 'interactive') { + return interactiveScript; + } + + eachReverse(scripts(), function (script) { + if (script.readyState === 'interactive') { + return (interactiveScript = script); + } + }); + return interactiveScript; + } + + //Look for a data-main script attribute, which could also adjust the baseUrl. + if (isBrowser && !cfg.skipDataMain) { + //Figure out baseUrl. Get it from the script tag with require.js in it. + eachReverse(scripts(), function (script) { + //Set the 'head' where we can append children by + //using the script's parent. + if (!head) { + head = script.parentNode; + } + + //Look for a data-main attribute to set main script for the page + //to load. If it is there, the path to data main becomes the + //baseUrl, if it is not already set. + dataMain = script.getAttribute('data-main'); + if (dataMain) { + //Preserve dataMain in case it is a path (i.e. contains '?') + mainScript = dataMain; + + //Set final baseUrl if there is not already an explicit one, + //but only do so if the data-main value is not a loader plugin + //module ID. + if (!cfg.baseUrl && mainScript.indexOf('!') === -1) { + //Pull off the directory of data-main for use as the + //baseUrl. + src = mainScript.split('/'); + mainScript = src.pop(); + subPath = src.length ? src.join('/') + '/' : './'; + + cfg.baseUrl = subPath; + } + + //Strip off any trailing .js since mainScript is now + //like a module name. + mainScript = mainScript.replace(jsSuffixRegExp, ''); + + //If mainScript is still a path, fall back to dataMain + if (req.jsExtRegExp.test(mainScript)) { + mainScript = dataMain; + } + + //Put the data-main script in the files to load. + cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript]; + + return true; + } + }); + } + + /** + * The function that handles definitions of modules. Differs from + * require() in that a string for the module should be the first argument, + * and the function to execute after dependencies are loaded should + * return a value to define the module corresponding to the first argument's + * name. + */ + define = function (name, deps, callback) { + var node, context; + + //Allow for anonymous modules + if (typeof name !== 'string') { + //Adjust args appropriately + callback = deps; + deps = name; + name = null; + } + + //This module may not have dependencies + if (!isArray(deps)) { + callback = deps; + deps = null; + } + + //If no name, and callback is a function, then figure out if it a + //CommonJS thing with dependencies. + if (!deps && isFunction(callback)) { + deps = []; + //Remove comments from the callback string, + //look for require calls, and pull them into the dependencies, + //but only if there are function args. + if (callback.length) { + callback + .toString() + .replace(commentRegExp, commentReplace) + .replace(cjsRequireRegExp, function (match, dep) { + deps.push(dep); + }); + + //May be a CommonJS thing even without require calls, but still + //could use exports, and module. Avoid doing exports and module + //work though if it just needs require. + //REQUIRES the function to expect the CommonJS variables in the + //order listed below. + deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); + } + } + + //If in IE 6-8 and hit an anonymous define() call, do the interactive + //work. + if (useInteractive) { + node = currentlyAddingScript || getInteractiveScript(); + if (node) { + if (!name) { + name = node.getAttribute('data-requiremodule'); + } + context = contexts[node.getAttribute('data-requirecontext')]; + } + } + + //Always save off evaluating the def call until the script onload handler. + //This allows multiple modules to be in a file without prematurely + //tracing dependencies, and allows for anonymous module support, + //where the module name is not known until the script onload event + //occurs. If no context, use the global queue, and get it processed + //in the onscript load callback. + if (context) { + context.defQueue.push([name, deps, callback]); + context.defQueueMap[name] = true; + } else { + globalDefQueue.push([name, deps, callback]); + } + }; + + define.amd = { + jQuery: true + }; + + /** + * Executes the text. Normally just uses eval, but can be modified + * to use a better, environment-specific call. Only used for transpiling + * loader plugins, not for plain JS modules. + * @param {String} text the text to execute/evaluate. + */ + req.exec = function (text) { + /*jslint evil: true */ + return eval(text); + }; + + //Set up with config info. + req(cfg); +}(this, (typeof setTimeout === 'undefined' ? undefined : setTimeout))); diff --git a/node_modules/seedrandom/test/newapi.html b/node_modules/seedrandom/test/newapi.html new file mode 100644 index 0000000..0767be1 --- /dev/null +++ b/node_modules/seedrandom/test/newapi.html @@ -0,0 +1,44 @@ + + + + + +
      +
      + + + + + diff --git a/node_modules/seedrandom/test/nodetest.js b/node_modules/seedrandom/test/nodetest.js new file mode 100644 index 0000000..ab90184 --- /dev/null +++ b/node_modules/seedrandom/test/nodetest.js @@ -0,0 +1,226 @@ +var assert = require("assert"); +var seedrandom = require("../seedrandom"); +var requirejs = require("requirejs"); + +// Stub out requirejs if in the browser via browserify. +if (!requirejs.config) { + requirejs = require; +} else { + requirejs.config({ + baseUrl: __dirname + }); +} + +describe("Nodejs API Test", function() { + +it('should pass basic tests.', function() { + var original = Math.random, + result, r, xprng, obj, as2, as3, autoseed1, myrng, + firstprng, secondprng, thirdprng, rng; + + result = Math.seedrandom('hello.'); + firstprng = Math.random; + assert.ok(original !== firstprng, "Should change Math.random."); + assert.equal(result, "hello.", "Should return short seed."); + r = Math.random(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + r = Math.random(); + assert.equal(r, 0.3752569768646784, "Should be 'hello.'#2"); + + // should be able to autoseed + result = Math.seedrandom(); + secondprng = Math.random; + assert.ok(original !== secondprng, "Should change Math.random."); + assert.ok(firstprng !== secondprng, "Should change Math.random."); + assert.equal(result.length, 256, "Should return short seed."); + r = Math.random(); + assert.ok(r > 0, "Should be posititive."); + assert.ok(r < 1, "Should be less than 1."); + assert.ok(r != 0.9282578795792454, "Should not be 'hello.'#1"); + assert.ok(r != 0.3752569768646784, "Should not be 'hello.'#2"); + assert.ok(r != 0.7316977468919549, "Should not be 'hello.'#3"); + autoseed1 = r; + + // should be able to add entropy. + result = Math.seedrandom('added entropy.', { entropy:true }); + assert.equal(result.length, 256, "Should return short seed."); + thirdprng = Math.random; + assert.ok(thirdprng !== secondprng, "Should change Math.random."); + r = Math.random(); + assert.ok(r != 0.597067214994467, "Should not be 'added entropy.'#1"); + + // Reset to original Math.random. + Math.random = original; + // should be able to use new Math.seedrandom('hello.') + myrng = new Math.seedrandom('hello.'); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== myrng, "PRNG should not be Math.random."); + r = myrng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + + // should be able to use seedrandom('hello.')" + rng = seedrandom('hello.'); + assert.equal(typeof(rng), 'function', "Should return a function."); + r = rng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== rng, "PRNG should not be Math.random."); + + // Global PRNG: set Math.random. + // should be able to use seedrandom('hello.', { global: true }) + result = seedrandom('hello.', { global: true }); + assert.equal(result, 'hello.', "Should return short seed."); + assert.ok(original != Math.random, "Should change Math.random."); + r = Math.random(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + + // Autoseeded non-global + Math.random = original; + // should be able to use seedrandom() + result = seedrandom(); + assert.equal(typeof(result), 'function', "Should return function."); + assert.ok(original === Math.random, "Should not change Math.random."); + r = result(); + // got " + r); + assert.ok(r != autoseed1, "Should not repeat previous autoseed."); + assert.ok(r != 0.9282578795792454, "Should not be 'hello.'#1"); + assert.ok(r != 0.7316977468919549, "Should not be 'hello.'#3"); + + // Mixing accumulated entropy. + // should be able to use seedrandom('added entropy.', { entropy: true }) + rng = seedrandom('added entropy.', { entropy: true }); + r = result(); + // got " + r); + assert.ok(r != autoseed1, "Should not repeat previous autoseed."); + assert.ok(r != 0.597067214994467, "Should not be 'added entropy.'#1"); + + // Legacy calling convention for mixing accumulated entropy. + // should be able to use seedrandom('added entropy.', true) + rng = seedrandom('added entropy.', true); + r = result(); + // got " + r); + assert.ok(r != autoseed1, "Should not repeat previous autoseed."); + assert.ok(r != 0.597067214994467, "Should not be 'added entropy.'#1"); + + // The pass option + // should be able to use Math.seedrandom(null, { pass: ... + obj = Math.seedrandom(null, { pass: function(prng, seed) { + return { random: prng, seed: seed }; + }}); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== obj.random, "Should be different from Math.random."); + assert.equal(typeof(obj.random), 'function', "Should return a PRNG function."); + assert.equal(typeof(obj.seed), 'string', "Should return a seed."); + as2 = obj.random(); + assert.ok(as2 != 0.9282578795792454, "Should not be 'hello.'#1"); + rng = seedrandom(obj.seed); + as3 = rng(); + assert.equal(as2, as3, "Should be reproducible when using the seed."); + + // Exercise pass again, with explicit seed and global + // should be able to use Math.seedrandom('hello.', { pass: ... + result = Math.seedrandom('hello.', { + global: 'abc', + pass: function(prng, seed, global) { + assert.equal(typeof(prng), 'function', "Callback arg #1 assert"); + assert.equal(seed, 'hello.', "Callback arg #2 assert"); + assert.equal(global, 'abc', "Callback arg #3 passed through."); + assert.equal(prng(), 0.9282578795792454, "Should be 'hello.'#1"); + return 'def'; + }}); + assert.equal(result, 'def', "Should return value from callback."); + assert.ok(original === Math.random, "Should not change Math.random."); + + // Legacy third argument callback argument: + // should be able to use Math.seedrandom('hello.', { global: 50 }, callback) + result = Math.seedrandom('hello.', { global: 50 }, + function(prng, seed, global) { + assert.equal(typeof(prng), 'function', "Callback arg #1 assert"); + assert.equal(seed, 'hello.', "Callback arg #2 assert"); + assert.equal(global, 50, "Callback arg #3 assert"); + assert.equal(prng(), 0.9282578795792454, "Should be 'hello.'#1"); + return 'zzz'; + }); + assert.equal(result, 'zzz', "Should return value from callback."); + assert.ok(original === Math.random, "Should not change Math.random."); + + // Global: false. + // should be able to use new Math.seedrandom('hello.', {global: false}) + myrng = new Math.seedrandom('hello.', {global:false}); + assert.equal(typeof(myrng), 'function', "Should return a PRNG funciton."); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== myrng, "PRNG should not be Math.random."); + r = myrng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + + // options = {} when a method of Math. + // should be able to use Math.seedrandom('hello.', {}) + result = Math.seedrandom('hello.'); + xprng = Math.random; + assert.ok(original !== xprng, "Should change Math.random."); + assert.equal(result, "hello.", "Should return short seed."); + r = Math.random(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + r = Math.random(); + assert.equal(r, 0.3752569768646784, "Should be 'hello.'#2"); + Math.random = original; + + // options = {} when not a method of Math + // should be able to use seedrandom('hello.', {}) + rng = seedrandom('hello.', {}); + assert.equal(typeof(rng), 'function', "Should return a function."); + r = rng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== rng, "PRNG should not be Math.random."); +}); + +it('should support state api.', function() { + // Verify that there is no state method + var dummy = seedrandom('hello'); + var unexpected = -1; + var expected = -1; + try { + unexpected = dummy.state(); + } catch(e) { + expected = 1; + } + assert.equal(unexpected, -1); + assert.equal(expected, 1); + var count = 0; + for (var x in dummy) { + if (x == 'state') count += 1; + } + assert.equal(count, 0); + + // Verify that a state method can be added + var saveable = seedrandom("secret-seed", {state: true}); + var ordinary = seedrandom("secret-seed"); + for (var j = 0; j < 1e2; ++j) { + assert.equal(ordinary(), saveable()); + } + var virgin = seedrandom("secret-seed"); + var saved = saveable.state(); + var replica = seedrandom("", {state: saved}); + for (var j = 0; j < 1e2; ++j) { + var r = replica(); + assert.equal(r, saveable()); + assert.equal(r, ordinary()); + assert.ok(r != virgin()); + } +}); + +it('should support requirejs in node.', function() { + var original = Math.random; + var rsr = requirejs('../seedrandom'); + var rng = rsr('hello.'); + assert.equal(typeof(rng), 'function', "Should return a function."); + var r = rng(); + assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1"); + assert.ok(original === Math.random, "Should not change Math.random."); + assert.ok(original !== rng, "PRNG should not be Math.random."); +}); + +// End of test. + +}); diff --git a/node_modules/seedrandom/test/options.html b/node_modules/seedrandom/test/options.html new file mode 100644 index 0000000..d8ca26b --- /dev/null +++ b/node_modules/seedrandom/test/options.html @@ -0,0 +1,195 @@ + + + + + +
      +
      + + + + + diff --git a/node_modules/seedrandom/test/out/dieharder-report.txt b/node_modules/seedrandom/test/out/dieharder-report.txt new file mode 100644 index 0000000..9e94668 --- /dev/null +++ b/node_modules/seedrandom/test/out/dieharder-report.txt @@ -0,0 +1,125 @@ +#=============================================================================# +# dieharder version 3.31.1 Copyright 2003 Robert G. Brown # +#=============================================================================# + rng_name |rands/second| Seed | +stdin_input_raw| 8.07e+05 | 254212981| +#=============================================================================# + test_name |ntup| tsamples |psamples| p-value |Assessment +#=============================================================================# + diehard_birthdays| 0| 100| 100|0.55960061| PASSED + diehard_operm5| 0| 1000000| 100|0.10062010| PASSED + diehard_rank_32x32| 0| 40000| 100|0.70957907| PASSED + diehard_rank_6x8| 0| 100000| 100|0.55953143| PASSED + diehard_bitstream| 0| 2097152| 100|0.22843857| PASSED + diehard_opso| 0| 2097152| 100|0.72251086| PASSED + diehard_oqso| 0| 2097152| 100|0.30642074| PASSED + diehard_dna| 0| 2097152| 100|0.30448899| PASSED +diehard_count_1s_str| 0| 256000| 100|0.23557064| PASSED +diehard_count_1s_byt| 0| 256000| 100|0.71300874| PASSED + diehard_parking_lot| 0| 12000| 100|0.88217430| PASSED + diehard_2dsphere| 2| 8000| 100|0.32366362| PASSED + diehard_3dsphere| 3| 4000| 100|0.30804215| PASSED + diehard_squeeze| 0| 100000| 100|0.97856588| PASSED + diehard_sums| 0| 100| 100|0.01512286| PASSED + diehard_runs| 0| 100000| 100|0.39065054| PASSED + diehard_runs| 0| 100000| 100|0.10369088| PASSED + diehard_craps| 0| 200000| 100|0.57875078| PASSED + diehard_craps| 0| 200000| 100|0.96945165| PASSED + marsaglia_tsang_gcd| 0| 10000000| 100|0.58793715| PASSED + marsaglia_tsang_gcd| 0| 10000000| 100|0.59724594| PASSED + sts_monobit| 1| 100000| 100|0.49155110| PASSED + sts_runs| 2| 100000| 100|0.01880740| PASSED + sts_serial| 1| 100000| 100|0.79060354| PASSED + sts_serial| 2| 100000| 100|0.91055644| PASSED + sts_serial| 3| 100000| 100|0.15984346| PASSED + sts_serial| 3| 100000| 100|0.04426690| PASSED + sts_serial| 4| 100000| 100|0.31589675| PASSED + sts_serial| 4| 100000| 100|0.65789943| PASSED + sts_serial| 5| 100000| 100|0.84228003| PASSED + sts_serial| 5| 100000| 100|0.28748169| PASSED + sts_serial| 6| 100000| 100|0.00092985| WEAK + sts_serial| 6| 100000| 100|0.06074248| PASSED + sts_serial| 7| 100000| 100|0.54740122| PASSED + sts_serial| 7| 100000| 100|0.30286638| PASSED + sts_serial| 8| 100000| 100|0.56593073| PASSED + sts_serial| 8| 100000| 100|0.48256390| PASSED + sts_serial| 9| 100000| 100|0.70850963| PASSED + sts_serial| 9| 100000| 100|0.63732762| PASSED + sts_serial| 10| 100000| 100|0.70209276| PASSED + sts_serial| 10| 100000| 100|0.99576606| WEAK + sts_serial| 11| 100000| 100|0.96272563| PASSED + sts_serial| 11| 100000| 100|0.76682898| PASSED + sts_serial| 12| 100000| 100|0.51522677| PASSED + sts_serial| 12| 100000| 100|0.49381681| PASSED + sts_serial| 13| 100000| 100|0.24260261| PASSED + sts_serial| 13| 100000| 100|0.41953338| PASSED + sts_serial| 14| 100000| 100|0.34770045| PASSED + sts_serial| 14| 100000| 100|0.16117277| PASSED + sts_serial| 15| 100000| 100|0.27319992| PASSED + sts_serial| 15| 100000| 100|0.61170864| PASSED + sts_serial| 16| 100000| 100|0.90638742| PASSED + sts_serial| 16| 100000| 100|0.60186602| PASSED + rgb_bitdist| 1| 100000| 100|0.72630216| PASSED + rgb_bitdist| 2| 100000| 100|0.61396597| PASSED + rgb_bitdist| 3| 100000| 100|0.40711729| PASSED + rgb_bitdist| 4| 100000| 100|0.94730365| PASSED + rgb_bitdist| 5| 100000| 100|0.95781972| PASSED + rgb_bitdist| 6| 100000| 100|0.15054771| PASSED + rgb_bitdist| 7| 100000| 100|0.25022202| PASSED + rgb_bitdist| 8| 100000| 100|0.66027754| PASSED + rgb_bitdist| 9| 100000| 100|0.86566842| PASSED + rgb_bitdist| 10| 100000| 100|0.55219204| PASSED + rgb_bitdist| 11| 100000| 100|0.73446935| PASSED + rgb_bitdist| 12| 100000| 100|0.99761332| WEAK +rgb_minimum_distance| 2| 10000| 1000|0.42222311| PASSED +rgb_minimum_distance| 3| 10000| 1000|0.81566417| PASSED +rgb_minimum_distance| 4| 10000| 1000|0.84024874| PASSED +rgb_minimum_distance| 5| 10000| 1000|0.37732026| PASSED + rgb_permutations| 2| 100000| 100|0.10996142| PASSED + rgb_permutations| 3| 100000| 100|0.64682554| PASSED + rgb_permutations| 4| 100000| 100|0.75843859| PASSED + rgb_permutations| 5| 100000| 100|0.95248930| PASSED + rgb_lagged_sum| 0| 1000000| 100|0.57812648| PASSED + rgb_lagged_sum| 1| 1000000| 100|0.67863162| PASSED + rgb_lagged_sum| 2| 1000000| 100|0.70003210| PASSED + rgb_lagged_sum| 3| 1000000| 100|0.50312943| PASSED + rgb_lagged_sum| 4| 1000000| 100|0.80009739| PASSED + rgb_lagged_sum| 5| 1000000| 100|0.66383600| PASSED + rgb_lagged_sum| 6| 1000000| 100|0.65640392| PASSED + rgb_lagged_sum| 7| 1000000| 100|0.10710511| PASSED + rgb_lagged_sum| 8| 1000000| 100|0.70414014| PASSED + rgb_lagged_sum| 9| 1000000| 100|0.63857571| PASSED + rgb_lagged_sum| 10| 1000000| 100|0.25221229| PASSED + rgb_lagged_sum| 11| 1000000| 100|0.04199433| PASSED + rgb_lagged_sum| 12| 1000000| 100|0.82738115| PASSED + rgb_lagged_sum| 13| 1000000| 100|0.28316509| PASSED + rgb_lagged_sum| 14| 1000000| 100|0.21184422| PASSED + rgb_lagged_sum| 15| 1000000| 100|0.35537687| PASSED + rgb_lagged_sum| 16| 1000000| 100|0.40157319| PASSED + rgb_lagged_sum| 17| 1000000| 100|0.98108259| PASSED + rgb_lagged_sum| 18| 1000000| 100|0.65892868| PASSED + rgb_lagged_sum| 19| 1000000| 100|0.61659671| PASSED + rgb_lagged_sum| 20| 1000000| 100|0.21462018| PASSED + rgb_lagged_sum| 21| 1000000| 100|0.94489214| PASSED + rgb_lagged_sum| 22| 1000000| 100|0.76019491| PASSED + rgb_lagged_sum| 23| 1000000| 100|0.21024028| PASSED + rgb_lagged_sum| 24| 1000000| 100|0.25249456| PASSED + rgb_lagged_sum| 25| 1000000| 100|0.87385459| PASSED + rgb_lagged_sum| 26| 1000000| 100|0.81553540| PASSED + rgb_lagged_sum| 27| 1000000| 100|0.94450657| PASSED + rgb_lagged_sum| 28| 1000000| 100|0.82470366| PASSED + rgb_lagged_sum| 29| 1000000| 100|0.93993722| PASSED + rgb_lagged_sum| 30| 1000000| 100|0.52675692| PASSED + rgb_lagged_sum| 31| 1000000| 100|0.59975558| PASSED + rgb_lagged_sum| 32| 1000000| 100|0.27951088| PASSED + rgb_kstest_test| 0| 10000| 1000|0.49707175| PASSED + dab_bytedistrib| 0| 51200000| 1|0.73019918| PASSED + dab_dct| 256| 50000| 1|0.33856081| PASSED +Preparing to run test 207. ntuple = 0 + dab_filltree| 32| 15000000| 1|0.92953640| PASSED + dab_filltree| 32| 15000000| 1|0.10970674| PASSED +Preparing to run test 208. ntuple = 0 + dab_filltree2| 0| 5000000| 1|0.88411850| PASSED + dab_filltree2| 1| 5000000| 1|0.56835378| PASSED +Preparing to run test 209. ntuple = 0 + dab_monobit2| 12| 65000000| 1|0.07987839| PASSED diff --git a/node_modules/seedrandom/test/prngtest.js b/node_modules/seedrandom/test/prngtest.js new file mode 100644 index 0000000..c5ae03a --- /dev/null +++ b/node_modules/seedrandom/test/prngtest.js @@ -0,0 +1,122 @@ +// A simple smoke test and benchmark for the generators. + +var assert = require('assert'); +var xor128 = require('../lib/xor128'); +var xorwow = require('../lib/xorwow'); +var xs7 = require('../lib/xorshift7'); +var xor4096 = require('../lib/xor4096'); +var tychei = require('../lib/tychei'); +var alea = require('../lib/alea'); +var sr = require('../seedrandom'); + +describe("XOR-Shift generator test", function() { + +var benchmarks = { native: { rand: Math.random, times: [] } }; + +function test(label, alg, double1, float3, int4, hc, qc, ec, e2c) { + var fn = alg(1); + var fn2 = alg('hello.', { state: true }); + benchmarks[label] = {rand: fn.quick, times: []}; + it("should use " + label + " correctly", function() { + if (double1 != null) assert.equal(fn.double(), double1); + if (float3 != null) assert.equal(fn.quick(), float3); + if (int4 != null) assert.equal(fn.int32(), int4); + assert(fn() > 0); + assert(fn() < 1); + assert(fn2() > 0); + // Internal state is visible only if requested. + assert(!('state' in fn)); + assert('state' in fn2); + var ss = fn2.state(); + var rs = fn2(); + assert(rs < 1); + var j, h = 0, q = 0, e = 0, r, p, e2 = 0; + for (j = 0; j < 1024; ++j) { + r = fn(); + if (r < 0.5) h += 1; + if (r < 0.25) q += 1; + if (r < 0.125) e += 1; + r2 = fn2(); + if (r2 < 0.125) e2 += 1; + } + if (hc != null) { + assert.equal(h, hc); + assert.equal(q, qc); + assert.equal(e, ec); + assert.equal(e2, e2c); + h = q = e = p = 0; + for (j = 0; j < 1024; ++j) { + r = fn.double(); + if (r < 0.5) h += 1; + if (r < 0.25) q += 1; + if (r < 0.125) e += 1; + if (fn.int32() >= 0) p += 1; + } + // Sanity-check double() and int32. + assert(h >= 480 && h <= 543, h); + assert(q >= 226 && q <= 286, q); + assert(e >= 100 && e <= 156, e); + assert(e2 >= 100 && e2 <= 156, e2); + assert(p >= 482 && p <= 543, p); + } + var fn3 = alg(0, { state: ss }); + assert.equal(fn3(), rs); + }); +} + +test("xor128", xor128, + 0.7963797148975774, 0.22171171731315553, 317177041, 498, 236, 110, 115); +test("xorwow", xorwow, + 0.8178000247146859, 0.8407576507888734, 533150816, 519, 228, 121, 123); +test("xorshift7", xs7, + 0.21241471533241418, 0.9957620368804783, -1678071207, 510, 261, 143, 124); +test("tychei", tychei, + 0.42331440041340196, 0.9365617581643164, -884984569, 521, 242, 116, 126); +test("seedrandom", sr, + 0.1776348083296759, 0.2160690303426236, 1397712774, 526, 282, 131, 137); +test("xor4096", xor4096, + 0.1520436450538547, 0.4206166828516871, 1312695376, 496, 241, 113, 142); +test("alea", alea, + 0.5260470956849501, 0.47771977609954774, -1625913352, 494, 246, 125, 122); + +it("runs benchmarks", function() { + var n = 4; + var trials = 10; + var top = 4; + this.timeout(200 * n * trials); + this.slow(30 * n * trials); + var fn, k, start, end, j, t; + for (k in benchmarks) { + fn = benchmarks[k].rand; + // warmup. + for (j = 0; j < 1e5; ++j) fn(); + } + for (t = 0; t < trials; ++t) { + for (k in benchmarks) { + fn = benchmarks[k].rand; + start = +new Date; + // benchmark. + for (j = 0; j < n * 1e5; ++j) fn(); + end = +new Date; + benchmarks[k].times.push(end - start); + } + } + for (k in benchmarks) { + benchmarks[k].times.sort(); + } + function fastest(array) { + var sum = 0; + for (var j = 0; j < top; ++j) { + sum += array[j]; + } + return sum / top; + } + var nativetime = fastest(benchmarks.native.times); + for (k in benchmarks) { + var time = fastest(benchmarks[k].times); + console.log(k+ ': ' + time / n + ' nanoseconds per call, ' + + (time / nativetime).toFixed(1) + 'x native random.'); + } +}); + +}); diff --git a/node_modules/seedrandom/test/qunitassert.js b/node_modules/seedrandom/test/qunitassert.js new file mode 100644 index 0000000..9b72d6e --- /dev/null +++ b/node_modules/seedrandom/test/qunitassert.js @@ -0,0 +1,3 @@ +// Use QUnit.assert to mimic node.assert. + +module.exports = QUnit.assert; diff --git a/node_modules/seedrandom/test/require.html b/node_modules/seedrandom/test/require.html new file mode 100644 index 0000000..b8aac32 --- /dev/null +++ b/node_modules/seedrandom/test/require.html @@ -0,0 +1,57 @@ + + + + + + +
      +
      + + + + + diff --git a/node_modules/seedrandom/test/run_dieharder.sh b/node_modules/seedrandom/test/run_dieharder.sh new file mode 100644 index 0000000..89fb5e1 --- /dev/null +++ b/node_modules/seedrandom/test/run_dieharder.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# http://www.phy.duke.edu/~rgb/General/dieharder.php +# How to run dieharder against seedrandom: + +node bitgen.js | dieharder -g 200 -a | tee out/dieharder-report.txt diff --git a/node_modules/seedrandom/test/state.html b/node_modules/seedrandom/test/state.html new file mode 100644 index 0000000..609b4f0 --- /dev/null +++ b/node_modules/seedrandom/test/state.html @@ -0,0 +1,56 @@ + + + + + +
      +
      + + + + + diff --git a/node_modules/url/.npmignore b/node_modules/url/.npmignore new file mode 100644 index 0000000..ba11471 --- /dev/null +++ b/node_modules/url/.npmignore @@ -0,0 +1 @@ +test-url.js diff --git a/node_modules/url/.travis.yml b/node_modules/url/.travis.yml new file mode 100644 index 0000000..16ed301 --- /dev/null +++ b/node_modules/url/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "0.10" +env: + global: + - secure: OgPRLCzHFh5WbjHEKlghHFW1oOreSF2JVUr3CMaFDi03ngTS2WONSw8mRn8SA6FTldiGGBx1n8orDzUw6cdkB7+tkU3G5B0M0V3vl823NaUFKgxsCM3UGDYfJb3yfAG5cj72rVZoX/ABd1fVuG4vBIlDLxsSlKQFMzUCFoyttr8= + - secure: AiZP8GHbyx83ZBhOvOxxtpNcgNHoP+vo5G1a1OYU78EHCgHg8NRyHKyCdrBnPvw6mV2BI/8frZaXAEicsHMtHMofBYn7nibNlaajBPI8AkHtYfNSc+zO+71Kwv7VOTOKKnkMEIkqhHlc6njFoH3QaBNHsgNlzzplPxaIt8vdUVk= diff --git a/node_modules/url/.zuul.yml b/node_modules/url/.zuul.yml new file mode 100644 index 0000000..feea8b6 --- /dev/null +++ b/node_modules/url/.zuul.yml @@ -0,0 +1,16 @@ +ui: mocha-tdd +browsers: + - name: chrome + version: latest + - name: firefox + version: 24..latest + - name: safari + version: latest + - name: ie + version: 9..latest + - name: iphone + version: oldest..latest + - name: ipad + version: oldest..latest + - name: android + version: oldest..latest diff --git a/node_modules/url/LICENSE b/node_modules/url/LICENSE new file mode 100644 index 0000000..f45bc11 --- /dev/null +++ b/node_modules/url/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/url/README.md b/node_modules/url/README.md new file mode 100644 index 0000000..8b35460 --- /dev/null +++ b/node_modules/url/README.md @@ -0,0 +1,108 @@ +# node-url + +[![Build Status](https://travis-ci.org/defunctzombie/node-url.svg?branch=master)](https://travis-ci.org/defunctzombie/node-url) + +This module has utilities for URL resolution and parsing meant to have feature parity with node.js core [url](http://nodejs.org/api/url.html) module. + +```js +var url = require('url'); +``` + +## api + +Parsed URL objects have some or all of the following fields, depending on +whether or not they exist in the URL string. Any parts that are not in the URL +string will not be in the parsed object. Examples are shown for the URL + +`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` + +* `href`: The full URL that was originally parsed. Both the protocol and host are lowercased. + + Example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` + +* `protocol`: The request protocol, lowercased. + + Example: `'http:'` + +* `host`: The full lowercased host portion of the URL, including port + information. + + Example: `'host.com:8080'` + +* `auth`: The authentication information portion of a URL. + + Example: `'user:pass'` + +* `hostname`: Just the lowercased hostname portion of the host. + + Example: `'host.com'` + +* `port`: The port number portion of the host. + + Example: `'8080'` + +* `pathname`: The path section of the URL, that comes after the host and + before the query, including the initial slash if present. + + Example: `'/p/a/t/h'` + +* `search`: The 'query string' portion of the URL, including the leading + question mark. + + Example: `'?query=string'` + +* `path`: Concatenation of `pathname` and `search`. + + Example: `'/p/a/t/h?query=string'` + +* `query`: Either the 'params' portion of the query string, or a + querystring-parsed object. + + Example: `'query=string'` or `{'query':'string'}` + +* `hash`: The 'fragment' portion of the URL including the pound-sign. + + Example: `'#hash'` + +The following methods are provided by the URL module: + +### url.parse(urlStr, [parseQueryString], [slashesDenoteHost]) + +Take a URL string, and return an object. + +Pass `true` as the second argument to also parse +the query string using the `querystring` module. +Defaults to `false`. + +Pass `true` as the third argument to treat `//foo/bar` as +`{ host: 'foo', pathname: '/bar' }` rather than +`{ pathname: '//foo/bar' }`. Defaults to `false`. + +### url.format(urlObj) + +Take a parsed URL object, and return a formatted URL string. + +* `href` will be ignored. +* `protocol` is treated the same with or without the trailing `:` (colon). + * The protocols `http`, `https`, `ftp`, `gopher`, `file` will be + postfixed with `://` (colon-slash-slash). + * All other protocols `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc will + be postfixed with `:` (colon) +* `auth` will be used if present. +* `hostname` will only be used if `host` is absent. +* `port` will only be used if `host` is absent. +* `host` will be used in place of `hostname` and `port` +* `pathname` is treated the same with or without the leading `/` (slash) +* `search` will be used in place of `query` +* `query` (object; see `querystring`) will only be used if `search` is absent. +* `search` is treated the same with or without the leading `?` (question mark) +* `hash` is treated the same with or without the leading `#` (pound sign, anchor) + +### url.resolve(from, to) + +Take a base URL, and a href URL, and resolve them as a browser would for +an anchor tag. Examples: + + url.resolve('/one/two/three', 'four') // '/one/two/four' + url.resolve('http://example.com/', '/one') // 'http://example.com/one' + url.resolve('http://example.com/one', '/two') // 'http://example.com/two' diff --git a/node_modules/url/node_modules/punycode/LICENSE-MIT.txt b/node_modules/url/node_modules/punycode/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/url/node_modules/punycode/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/url/node_modules/punycode/README.md b/node_modules/url/node_modules/punycode/README.md new file mode 100644 index 0000000..831e637 --- /dev/null +++ b/node_modules/url/node_modules/punycode/README.md @@ -0,0 +1,176 @@ +# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) + +A robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. + +This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: + +* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C) +* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) +* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) +* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) +* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) + +This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc). + +## Installation + +Via [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2): + +```bash +npm install punycode +``` + +Via [Bower](http://bower.io/): + +```bash +bower install punycode +``` + +Via [Component](https://github.com/component/component): + +```bash +component install bestiejs/punycode.js +``` + +In a browser: + +```html + +``` + +In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/): + +```js +var punycode = require('punycode'); +``` + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('punycode.js'); +``` + +Using an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require( + { + 'paths': { + 'punycode': 'path/to/punycode' + } + }, + ['punycode'], + function(punycode) { + console.log(punycode); + } +); +``` + +## API + +### `punycode.decode(string)` + +Converts a Punycode string of ASCII symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +### `punycode.encode(string)` + +Converts a string of Unicode symbols to a Punycode string of ASCII symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +### `punycode.toUnicode(input)` + +Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); +// → 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); +// → '☃-⌘.com' + +// decode email addresses +punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); +// → 'джумла@джpумлатест.bрфa' +``` + +### `punycode.toASCII(input)` + +Converts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); +// → 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); +// → 'xn----dqo34k.com' + +// encode email addresses +punycode.toASCII('джумла@джpумлатест.bрфa'); +// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' +``` + +### `punycode.ucs2` + +#### `punycode.ucs2.decode(string)` + +Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. + +```js +punycode.ucs2.decode('abc'); +// → [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: +punycode.ucs2.decode('\uD834\uDF06'); +// → [0x1D306] +``` + +#### `punycode.ucs2.encode(codePoints)` + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); +// → 'abc' +punycode.ucs2.encode([0x1D306]); +// → '\uD834\uDF06' +``` + +### `punycode.version` + +A string representing the current Punycode.js version number. + +## Unit tests & code coverage + +After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. + +Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. + +To generate the code coverage report, use `grunt cover`. + +Feel free to fork if you see possible improvements! + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## Contributors + +| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## License + +Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/url/node_modules/punycode/package.json b/node_modules/url/node_modules/punycode/package.json new file mode 100644 index 0000000..c9272d9 --- /dev/null +++ b/node_modules/url/node_modules/punycode/package.json @@ -0,0 +1,80 @@ +{ + "_from": "punycode@1.3.2", + "_id": "punycode@1.3.2", + "_inBundle": false, + "_integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "_location": "/url/punycode", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "punycode@1.3.2", + "name": "punycode", + "escapedName": "punycode", + "rawSpec": "1.3.2", + "saveSpec": null, + "fetchSpec": "1.3.2" + }, + "_requiredBy": [ + "/url" + ], + "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "_shasum": "9653a036fb7c1ee42342f2325cceefea3926c48d", + "_spec": "punycode@1.3.2", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\url", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bugs": { + "url": "https://github.com/bestiejs/punycode.js/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + { + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + } + ], + "deprecated": false, + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "devDependencies": { + "coveralls": "^2.10.1", + "grunt": "^0.4.5", + "grunt-contrib-uglify": "^0.5.0", + "grunt-shell": "^0.7.0", + "istanbul": "^0.2.13", + "qunit-extras": "^1.2.0", + "qunitjs": "~1.11.0", + "requirejs": "^2.1.14" + }, + "files": [ + "LICENSE-MIT.txt", + "punycode.js" + ], + "homepage": "https://mths.be/punycode", + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "main": "punycode.js", + "name": "punycode", + "repository": { + "type": "git", + "url": "git+https://github.com/bestiejs/punycode.js.git" + }, + "scripts": { + "test": "node tests/tests.js" + }, + "version": "1.3.2" +} diff --git a/node_modules/url/node_modules/punycode/punycode.js b/node_modules/url/node_modules/punycode/punycode.js new file mode 100644 index 0000000..ac68597 --- /dev/null +++ b/node_modules/url/node_modules/punycode/punycode.js @@ -0,0 +1,530 @@ +/*! https://mths.be/punycode v1.3.2 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * http://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.3.2', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); diff --git a/node_modules/url/package.json b/node_modules/url/package.json new file mode 100644 index 0000000..acd6687 --- /dev/null +++ b/node_modules/url/package.json @@ -0,0 +1,53 @@ +{ + "_from": "url@~0.11.0", + "_id": "url@0.11.0", + "_inBundle": false, + "_integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "_location": "/url", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "url@~0.11.0", + "name": "url", + "escapedName": "url", + "rawSpec": "~0.11.0", + "saveSpec": null, + "fetchSpec": "~0.11.0" + }, + "_requiredBy": [ + "/@tensorflow/tfjs-converter" + ], + "_resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "_shasum": "3838e97cfc60521eb73c525a8e55bfdd9e2e28f1", + "_spec": "url@~0.11.0", + "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs-converter", + "bugs": { + "url": "https://github.com/defunctzombie/node-url/issues" + }, + "bundleDependencies": false, + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "deprecated": false, + "description": "The core `url` packaged standalone for use with Browserify.", + "devDependencies": { + "assert": "1.1.1", + "mocha": "1.18.2", + "zuul": "3.3.0" + }, + "homepage": "https://github.com/defunctzombie/node-url#readme", + "license": "MIT", + "main": "./url.js", + "name": "url", + "repository": { + "type": "git", + "url": "git+https://github.com/defunctzombie/node-url.git" + }, + "scripts": { + "test": "mocha --ui qunit test.js && zuul -- test.js", + "test-local": "zuul --local -- test.js" + }, + "version": "0.11.0" +} diff --git a/node_modules/url/test.js b/node_modules/url/test.js new file mode 100644 index 0000000..3b7d335 --- /dev/null +++ b/node_modules/url/test.js @@ -0,0 +1,1599 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var assert = require('assert'); + +var url = require('./url'); + +// URLs to parse, and expected data +// { url : parsed } +var parseTests = { + '//some_path' : { + 'href': '//some_path', + 'pathname': '//some_path', + 'path': '//some_path' + }, + + 'http:\\\\evil-phisher\\foo.html#h\\a\\s\\h': { + protocol: 'http:', + slashes: true, + host: 'evil-phisher', + hostname: 'evil-phisher', + pathname: '/foo.html', + path: '/foo.html', + hash: '#h%5Ca%5Cs%5Ch', + href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch' + }, + + 'http:\\\\evil-phisher\\foo.html?json="\\"foo\\""#h\\a\\s\\h': { + protocol: 'http:', + slashes: true, + host: 'evil-phisher', + hostname: 'evil-phisher', + pathname: '/foo.html', + search: '?json=%22%5C%22foo%5C%22%22', + query: 'json=%22%5C%22foo%5C%22%22', + path: '/foo.html?json=%22%5C%22foo%5C%22%22', + hash: '#h%5Ca%5Cs%5Ch', + href: 'http://evil-phisher/foo.html?json=%22%5C%22foo%5C%22%22#h%5Ca%5Cs%5Ch' + }, + + 'http:\\\\evil-phisher\\foo.html#h\\a\\s\\h?blarg': { + protocol: 'http:', + slashes: true, + host: 'evil-phisher', + hostname: 'evil-phisher', + pathname: '/foo.html', + path: '/foo.html', + hash: '#h%5Ca%5Cs%5Ch?blarg', + href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch?blarg' + }, + + + 'http:\\\\evil-phisher\\foo.html': { + protocol: 'http:', + slashes: true, + host: 'evil-phisher', + hostname: 'evil-phisher', + pathname: '/foo.html', + path: '/foo.html', + href: 'http://evil-phisher/foo.html' + }, + + 'HTTP://www.example.com/' : { + 'href': 'http://www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'HTTP://www.example.com' : { + 'href': 'http://www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://www.ExAmPlE.com/' : { + 'href': 'http://www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://user:pw@www.ExAmPlE.com/' : { + 'href': 'http://user:pw@www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pw', + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://USER:PW@www.ExAmPlE.com/' : { + 'href': 'http://USER:PW@www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'auth': 'USER:PW', + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://user@www.example.com/' : { + 'href': 'http://user@www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user', + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://user%3Apw@www.example.com/' : { + 'href': 'http://user:pw@www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pw', + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://x.com/path?that\'s#all, folks' : { + 'href': 'http://x.com/path?that%27s#all,%20folks', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.com', + 'hostname': 'x.com', + 'search': '?that%27s', + 'query': 'that%27s', + 'pathname': '/path', + 'hash': '#all,%20folks', + 'path': '/path?that%27s' + }, + + 'HTTP://X.COM/Y' : { + 'href': 'http://x.com/Y', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.com', + 'hostname': 'x.com', + 'pathname': '/Y', + 'path': '/Y' + }, + + // + not an invalid host character + // per https://url.spec.whatwg.org/#host-parsing + 'http://x.y.com+a/b/c' : { + 'href': 'http://x.y.com+a/b/c', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.y.com+a', + 'hostname': 'x.y.com+a', + 'pathname': '/b/c', + 'path': '/b/c' + }, + + // an unexpected invalid char in the hostname. + 'HtTp://x.y.cOm;a/b/c?d=e#f gi' : { + 'href': 'http://x.y.com/;a/b/c?d=e#f%20g%3Ch%3Ei', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.y.com', + 'hostname': 'x.y.com', + 'pathname': ';a/b/c', + 'search': '?d=e', + 'query': 'd=e', + 'hash': '#f%20g%3Ch%3Ei', + 'path': ';a/b/c?d=e' + }, + + // make sure that we don't accidentally lcast the path parts. + 'HtTp://x.y.cOm;A/b/c?d=e#f gi' : { + 'href': 'http://x.y.com/;A/b/c?d=e#f%20g%3Ch%3Ei', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.y.com', + 'hostname': 'x.y.com', + 'pathname': ';A/b/c', + 'search': '?d=e', + 'query': 'd=e', + 'hash': '#f%20g%3Ch%3Ei', + 'path': ';A/b/c?d=e' + }, + + 'http://x...y...#p': { + 'href': 'http://x...y.../#p', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x...y...', + 'hostname': 'x...y...', + 'hash': '#p', + 'pathname': '/', + 'path': '/' + }, + + 'http://x/p/"quoted"': { + 'href': 'http://x/p/%22quoted%22', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x', + 'hostname': 'x', + 'pathname': '/p/%22quoted%22', + 'path': '/p/%22quoted%22' + }, + + ' Is a URL!': { + 'href': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', + 'pathname': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', + 'path': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!' + }, + + 'http://www.narwhaljs.org/blog/categories?id=news' : { + 'href': 'http://www.narwhaljs.org/blog/categories?id=news', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.narwhaljs.org', + 'hostname': 'www.narwhaljs.org', + 'search': '?id=news', + 'query': 'id=news', + 'pathname': '/blog/categories', + 'path': '/blog/categories?id=news' + }, + + 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'slashes': true, + 'host': 'mt0.google.com', + 'hostname': 'mt0.google.com', + 'pathname': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', + 'path': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' + }, + + 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api' + + '&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'slashes': true, + 'host': 'mt0.google.com', + 'hostname': 'mt0.google.com', + 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', + 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', + 'pathname': '/vt/lyrs=m@114', + 'path': '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' + }, + + 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': + { + 'href': 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' + + '&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'slashes': true, + 'host': 'mt0.google.com', + 'auth': 'user:pass', + 'hostname': 'mt0.google.com', + 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', + 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', + 'pathname': '/vt/lyrs=m@114', + 'path': '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' + }, + + 'file:///etc/passwd' : { + 'href': 'file:///etc/passwd', + 'slashes': true, + 'protocol': 'file:', + 'pathname': '/etc/passwd', + 'hostname': '', + 'host': '', + 'path': '/etc/passwd' + }, + + 'file://localhost/etc/passwd' : { + 'href': 'file://localhost/etc/passwd', + 'protocol': 'file:', + 'slashes': true, + 'pathname': '/etc/passwd', + 'hostname': 'localhost', + 'host': 'localhost', + 'path': '/etc/passwd' + }, + + 'file://foo/etc/passwd' : { + 'href': 'file://foo/etc/passwd', + 'protocol': 'file:', + 'slashes': true, + 'pathname': '/etc/passwd', + 'hostname': 'foo', + 'host': 'foo', + 'path': '/etc/passwd' + }, + + 'file:///etc/node/' : { + 'href': 'file:///etc/node/', + 'slashes': true, + 'protocol': 'file:', + 'pathname': '/etc/node/', + 'hostname': '', + 'host': '', + 'path': '/etc/node/' + }, + + 'file://localhost/etc/node/' : { + 'href': 'file://localhost/etc/node/', + 'protocol': 'file:', + 'slashes': true, + 'pathname': '/etc/node/', + 'hostname': 'localhost', + 'host': 'localhost', + 'path': '/etc/node/' + }, + + 'file://foo/etc/node/' : { + 'href': 'file://foo/etc/node/', + 'protocol': 'file:', + 'slashes': true, + 'pathname': '/etc/node/', + 'hostname': 'foo', + 'host': 'foo', + 'path': '/etc/node/' + }, + + 'http:/baz/../foo/bar' : { + 'href': 'http:/baz/../foo/bar', + 'protocol': 'http:', + 'pathname': '/baz/../foo/bar', + 'path': '/baz/../foo/bar' + }, + + 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag' : { + 'href': 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com:8000', + 'auth': 'user:pass', + 'port': '8000', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + + '//user:pass@example.com:8000/foo/bar?baz=quux#frag' : { + 'href': '//user:pass@example.com:8000/foo/bar?baz=quux#frag', + 'slashes': true, + 'host': 'example.com:8000', + 'auth': 'user:pass', + 'port': '8000', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + + '/foo/bar?baz=quux#frag' : { + 'href': '/foo/bar?baz=quux#frag', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + + 'http:/foo/bar?baz=quux#frag' : { + 'href': 'http:/foo/bar?baz=quux#frag', + 'protocol': 'http:', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + + 'mailto:foo@bar.com?subject=hello' : { + 'href': 'mailto:foo@bar.com?subject=hello', + 'protocol': 'mailto:', + 'host': 'bar.com', + 'auth' : 'foo', + 'hostname' : 'bar.com', + 'search': '?subject=hello', + 'query': 'subject=hello', + 'path': '?subject=hello' + }, + + 'javascript:alert(\'hello\');' : { + 'href': 'javascript:alert(\'hello\');', + 'protocol': 'javascript:', + 'pathname': 'alert(\'hello\');', + 'path': 'alert(\'hello\');' + }, + + 'xmpp:isaacschlueter@jabber.org' : { + 'href': 'xmpp:isaacschlueter@jabber.org', + 'protocol': 'xmpp:', + 'host': 'jabber.org', + 'auth': 'isaacschlueter', + 'hostname': 'jabber.org' + }, + + 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar' : { + 'href' : 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar', + 'protocol' : 'http:', + 'slashes': true, + 'host' : '127.0.0.1:8080', + 'auth' : 'atpass:foo@bar', + 'hostname' : '127.0.0.1', + 'port' : '8080', + 'pathname': '/path', + 'search' : '?search=foo', + 'query' : 'search=foo', + 'hash' : '#bar', + 'path': '/path?search=foo' + }, + + 'svn+ssh://foo/bar': { + 'href': 'svn+ssh://foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'svn+ssh:', + 'pathname': '/bar', + 'path': '/bar', + 'slashes': true + }, + + 'dash-test://foo/bar': { + 'href': 'dash-test://foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'dash-test:', + 'pathname': '/bar', + 'path': '/bar', + 'slashes': true + }, + + 'dash-test:foo/bar': { + 'href': 'dash-test:foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'dash-test:', + 'pathname': '/bar', + 'path': '/bar' + }, + + 'dot.test://foo/bar': { + 'href': 'dot.test://foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'dot.test:', + 'pathname': '/bar', + 'path': '/bar', + 'slashes': true + }, + + 'dot.test:foo/bar': { + 'href': 'dot.test:foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'dot.test:', + 'pathname': '/bar', + 'path': '/bar' + }, + + // IDNA tests + 'http://www.日本語.com/' : { + 'href': 'http://www.xn--wgv71a119e.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.xn--wgv71a119e.com', + 'hostname': 'www.xn--wgv71a119e.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://example.Bücher.com/' : { + 'href': 'http://example.xn--bcher-kva.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.xn--bcher-kva.com', + 'hostname': 'example.xn--bcher-kva.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://www.Äffchen.com/' : { + 'href': 'http://www.xn--ffchen-9ta.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.xn--ffchen-9ta.com', + 'hostname': 'www.xn--ffchen-9ta.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://www.Äffchen.cOm;A/b/c?d=e#f gi' : { + 'href': 'http://www.xn--ffchen-9ta.com/;A/b/c?d=e#f%20g%3Ch%3Ei', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.xn--ffchen-9ta.com', + 'hostname': 'www.xn--ffchen-9ta.com', + 'pathname': ';A/b/c', + 'search': '?d=e', + 'query': 'd=e', + 'hash': '#f%20g%3Ch%3Ei', + 'path': ';A/b/c?d=e' + }, + + 'http://SÉLIER.COM/' : { + 'href': 'http://xn--slier-bsa.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'xn--slier-bsa.com', + 'hostname': 'xn--slier-bsa.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://ليهمابتكلموشعربي؟.ي؟/' : { + 'href': 'http://xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', + 'hostname': 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', + 'pathname': '/', + 'path': '/' + }, + + 'http://➡.ws/➡' : { + 'href': 'http://xn--hgi.ws/➡', + 'protocol': 'http:', + 'slashes': true, + 'host': 'xn--hgi.ws', + 'hostname': 'xn--hgi.ws', + 'pathname': '/➡', + 'path': '/➡' + }, + + 'http://bucket_name.s3.amazonaws.com/image.jpg': { + protocol: 'http:', + 'slashes': true, + slashes: true, + host: 'bucket_name.s3.amazonaws.com', + hostname: 'bucket_name.s3.amazonaws.com', + pathname: '/image.jpg', + href: 'http://bucket_name.s3.amazonaws.com/image.jpg', + 'path': '/image.jpg' + }, + + 'git+http://github.com/joyent/node.git': { + protocol: 'git+http:', + slashes: true, + host: 'github.com', + hostname: 'github.com', + pathname: '/joyent/node.git', + path: '/joyent/node.git', + href: 'git+http://github.com/joyent/node.git' + }, + + //if local1@domain1 is uses as a relative URL it may + //be parse into auth@hostname, but here there is no + //way to make it work in url.parse, I add the test to be explicit + 'local1@domain1': { + 'pathname': 'local1@domain1', + 'path': 'local1@domain1', + 'href': 'local1@domain1' + }, + + //While this may seem counter-intuitive, a browser will parse + // as a path. + 'www.example.com' : { + 'href': 'www.example.com', + 'pathname': 'www.example.com', + 'path': 'www.example.com' + }, + + // ipv6 support + '[fe80::1]': { + 'href': '[fe80::1]', + 'pathname': '[fe80::1]', + 'path': '[fe80::1]' + }, + + 'coap://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]': { + 'protocol': 'coap:', + 'slashes': true, + 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]', + 'hostname': 'fedc:ba98:7654:3210:fedc:ba98:7654:3210', + 'href': 'coap://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/', + 'pathname': '/', + 'path': '/' + }, + + 'coap://[1080:0:0:0:8:800:200C:417A]:61616/': { + 'protocol': 'coap:', + 'slashes': true, + 'host': '[1080:0:0:0:8:800:200c:417a]:61616', + 'port': '61616', + 'hostname': '1080:0:0:0:8:800:200c:417a', + 'href': 'coap://[1080:0:0:0:8:800:200c:417a]:61616/', + 'pathname': '/', + 'path': '/' + }, + + 'http://user:password@[3ffe:2a00:100:7031::1]:8080': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:password', + 'host': '[3ffe:2a00:100:7031::1]:8080', + 'port': '8080', + 'hostname': '3ffe:2a00:100:7031::1', + 'href': 'http://user:password@[3ffe:2a00:100:7031::1]:8080/', + 'pathname': '/', + 'path': '/' + }, + + 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature': { + 'protocol': 'coap:', + 'slashes': true, + 'auth': 'u:p', + 'host': '[::192.9.5.5]:61616', + 'port': '61616', + 'hostname': '::192.9.5.5', + 'href': 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature', + 'search': '?n=Temperature', + 'query': 'n=Temperature', + 'pathname': '/.well-known/r', + 'path': '/.well-known/r?n=Temperature' + }, + + // empty port + 'http://example.com:': { + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'href': 'http://example.com/', + 'pathname': '/', + 'path': '/' + }, + + 'http://example.com:/a/b.html': { + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'href': 'http://example.com/a/b.html', + 'pathname': '/a/b.html', + 'path': '/a/b.html' + }, + + 'http://example.com:?a=b': { + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'href': 'http://example.com/?a=b', + 'search': '?a=b', + 'query': 'a=b', + 'pathname': '/', + 'path': '/?a=b' + }, + + 'http://example.com:#abc': { + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'href': 'http://example.com/#abc', + 'hash': '#abc', + 'pathname': '/', + 'path': '/' + }, + + 'http://[fe80::1]:/a/b?a=b#abc': { + 'protocol': 'http:', + 'slashes': true, + 'host': '[fe80::1]', + 'hostname': 'fe80::1', + 'href': 'http://[fe80::1]/a/b?a=b#abc', + 'search': '?a=b', + 'query': 'a=b', + 'hash': '#abc', + 'pathname': '/a/b', + 'path': '/a/b?a=b' + }, + + 'http://-lovemonsterz.tumblr.com/rss': { + 'protocol': 'http:', + 'slashes': true, + 'host': '-lovemonsterz.tumblr.com', + 'hostname': '-lovemonsterz.tumblr.com', + 'href': 'http://-lovemonsterz.tumblr.com/rss', + 'pathname': '/rss', + 'path': '/rss', + }, + + 'http://-lovemonsterz.tumblr.com:80/rss': { + 'protocol': 'http:', + 'slashes': true, + 'port': '80', + 'host': '-lovemonsterz.tumblr.com:80', + 'hostname': '-lovemonsterz.tumblr.com', + 'href': 'http://-lovemonsterz.tumblr.com:80/rss', + 'pathname': '/rss', + 'path': '/rss', + }, + + 'http://user:pass@-lovemonsterz.tumblr.com/rss': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pass', + 'host': '-lovemonsterz.tumblr.com', + 'hostname': '-lovemonsterz.tumblr.com', + 'href': 'http://user:pass@-lovemonsterz.tumblr.com/rss', + 'pathname': '/rss', + 'path': '/rss', + }, + + 'http://user:pass@-lovemonsterz.tumblr.com:80/rss': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pass', + 'port': '80', + 'host': '-lovemonsterz.tumblr.com:80', + 'hostname': '-lovemonsterz.tumblr.com', + 'href': 'http://user:pass@-lovemonsterz.tumblr.com:80/rss', + 'pathname': '/rss', + 'path': '/rss', + }, + + 'http://_jabber._tcp.google.com/test': { + 'protocol': 'http:', + 'slashes': true, + 'host': '_jabber._tcp.google.com', + 'hostname': '_jabber._tcp.google.com', + 'href': 'http://_jabber._tcp.google.com/test', + 'pathname': '/test', + 'path': '/test', + }, + + 'http://user:pass@_jabber._tcp.google.com/test': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pass', + 'host': '_jabber._tcp.google.com', + 'hostname': '_jabber._tcp.google.com', + 'href': 'http://user:pass@_jabber._tcp.google.com/test', + 'pathname': '/test', + 'path': '/test', + }, + + 'http://_jabber._tcp.google.com:80/test': { + 'protocol': 'http:', + 'slashes': true, + 'port': '80', + 'host': '_jabber._tcp.google.com:80', + 'hostname': '_jabber._tcp.google.com', + 'href': 'http://_jabber._tcp.google.com:80/test', + 'pathname': '/test', + 'path': '/test', + }, + + 'http://user:pass@_jabber._tcp.google.com:80/test': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pass', + 'port': '80', + 'host': '_jabber._tcp.google.com:80', + 'hostname': '_jabber._tcp.google.com', + 'href': 'http://user:pass@_jabber._tcp.google.com:80/test', + 'pathname': '/test', + 'path': '/test', + }, + + 'http://x:1/\' <>"`/{}|\\^~`/': { + protocol: 'http:', + slashes: true, + host: 'x:1', + port: '1', + hostname: 'x', + pathname: '/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/', + path: '/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/', + href: 'http://x:1/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/' + }, + + 'http://a@b@c/': { + protocol: 'http:', + slashes: true, + auth: 'a@b', + host: 'c', + hostname: 'c', + href: 'http://a%40b@c/', + path: '/', + pathname: '/' + }, + + 'http://a@b?@c': { + protocol: 'http:', + slashes: true, + auth: 'a', + host: 'b', + hostname: 'b', + href: 'http://a@b/?@c', + path: '/?@c', + pathname: '/', + search: '?@c', + query: '@c' + }, + + 'http://a\r" \t\n<\'b:b@c\r\nd/e?f':{ + protocol: 'http:', + slashes: true, + auth: 'a\r" \t\n<\'b:b', + host: 'c', + port: null, + hostname: 'c', + hash: null, + search: '?f', + query: 'f', + pathname: '%0D%0Ad/e', + path: '%0D%0Ad/e?f', + href: 'http://a%0D%22%20%09%0A%3C\'b:b@c/%0D%0Ad/e?f' + }, + + // git urls used by npm + 'git+ssh://git@github.com:npm/npm': { + protocol: 'git+ssh:', + slashes: true, + auth: 'git', + host: 'github.com', + port: null, + hostname: 'github.com', + hash: null, + search: null, + query: null, + pathname: '/:npm/npm', + path: '/:npm/npm', + href: 'git+ssh://git@github.com/:npm/npm' + } + +}; + +Object.keys(parseTests).forEach(function(u) { + test('parse(' + u + ')', function() { + var actual = url.parse(u), + spaced = url.parse(' \t ' + u + '\n\t'); + expected = parseTests[u]; + + Object.keys(actual).forEach(function (i) { + if (expected[i] === undefined && actual[i] === null) { + expected[i] = null; + } + }); + + assert.deepEqual(actual, expected); + assert.deepEqual(spaced, expected); + + var expected = parseTests[u].href, + actual = url.format(parseTests[u]); + + assert.equal(actual, expected, + 'format(' + u + ') == ' + u + '\nactual:' + actual); + }); +}); + +var parseTestsWithQueryString = { + '/foo/bar?baz=quux#frag' : { + 'href': '/foo/bar?baz=quux#frag', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': { + 'baz': 'quux' + }, + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + 'http://example.com' : { + 'href': 'http://example.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'query': {}, + 'search': '', + 'pathname': '/', + 'path': '/' + }, + '/example': { + protocol: null, + slashes: null, + auth: null, + host: null, + port: null, + hostname: null, + hash: null, + search: '', + query: {}, + pathname: '/example', + path: '/example', + href: '/example' + }, + '/example?query=value':{ + protocol: null, + slashes: null, + auth: null, + host: null, + port: null, + hostname: null, + hash: null, + search: '?query=value', + query: { query: 'value' }, + pathname: '/example', + path: '/example?query=value', + href: '/example?query=value' + } +}; + +Object.keys(parseTestsWithQueryString).forEach(function(u) { + test('parse(' + u + ')', function() { + var actual = url.parse(u, true); + var expected = parseTestsWithQueryString[u]; + for (var i in actual) { + if (actual[i] === null && expected[i] === undefined) { + expected[i] = null; + } + } + + assert.deepEqual(actual, expected); + }); +}); + +// some extra formatting tests, just to verify +// that it'll format slightly wonky content to a valid url. +var formatTests = { + 'http://example.com?' : { + 'href': 'http://example.com/?', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'search': '?', + 'query': {}, + 'pathname': '/' + }, + 'http://example.com?foo=bar#frag' : { + 'href': 'http://example.com/?foo=bar#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=bar', + 'query': 'foo=bar', + 'pathname': '/' + }, + 'http://example.com?foo=@bar#frag' : { + 'href': 'http://example.com/?foo=@bar#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=@bar', + 'query': 'foo=@bar', + 'pathname': '/' + }, + 'http://example.com?foo=/bar/#frag' : { + 'href': 'http://example.com/?foo=/bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=/bar/', + 'query': 'foo=/bar/', + 'pathname': '/' + }, + 'http://example.com?foo=?bar/#frag' : { + 'href': 'http://example.com/?foo=?bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=?bar/', + 'query': 'foo=?bar/', + 'pathname': '/' + }, + 'http://example.com#frag=?bar/#frag' : { + 'href': 'http://example.com/#frag=?bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag=?bar/#frag', + 'pathname': '/' + }, + 'http://google.com" onload="alert(42)/' : { + 'href': 'http://google.com/%22%20onload=%22alert(42)/', + 'protocol': 'http:', + 'host': 'google.com', + 'pathname': '/%22%20onload=%22alert(42)/' + }, + 'http://a.com/a/b/c?s#h' : { + 'href': 'http://a.com/a/b/c?s#h', + 'protocol': 'http', + 'host': 'a.com', + 'pathname': 'a/b/c', + 'hash': 'h', + 'search': 's' + }, + 'xmpp:isaacschlueter@jabber.org' : { + 'href': 'xmpp:isaacschlueter@jabber.org', + 'protocol': 'xmpp:', + 'host': 'jabber.org', + 'auth': 'isaacschlueter', + 'hostname': 'jabber.org' + }, + 'http://atpass:foo%40bar@127.0.0.1/' : { + 'href': 'http://atpass:foo%40bar@127.0.0.1/', + 'auth': 'atpass:foo@bar', + 'hostname': '127.0.0.1', + 'protocol': 'http:', + 'pathname': '/' + }, + 'http://atslash%2F%40:%2F%40@foo/' : { + 'href': 'http://atslash%2F%40:%2F%40@foo/', + 'auth': 'atslash/@:/@', + 'hostname': 'foo', + 'protocol': 'http:', + 'pathname': '/' + }, + 'svn+ssh://foo/bar': { + 'href': 'svn+ssh://foo/bar', + 'hostname': 'foo', + 'protocol': 'svn+ssh:', + 'pathname': '/bar', + 'slashes': true + }, + 'dash-test://foo/bar': { + 'href': 'dash-test://foo/bar', + 'hostname': 'foo', + 'protocol': 'dash-test:', + 'pathname': '/bar', + 'slashes': true + }, + 'dash-test:foo/bar': { + 'href': 'dash-test:foo/bar', + 'hostname': 'foo', + 'protocol': 'dash-test:', + 'pathname': '/bar' + }, + 'dot.test://foo/bar': { + 'href': 'dot.test://foo/bar', + 'hostname': 'foo', + 'protocol': 'dot.test:', + 'pathname': '/bar', + 'slashes': true + }, + 'dot.test:foo/bar': { + 'href': 'dot.test:foo/bar', + 'hostname': 'foo', + 'protocol': 'dot.test:', + 'pathname': '/bar' + }, + // ipv6 support + 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature': { + 'href': 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature', + 'protocol': 'coap:', + 'auth': 'u:p', + 'hostname': '::1', + 'port': '61616', + 'pathname': '/.well-known/r', + 'search': 'n=Temperature' + }, + 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton': { + 'href': 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton', + 'protocol': 'coap', + 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616', + 'pathname': '/s/stopButton' + }, + + // encode context-specific delimiters in path and query, but do not touch + // other non-delimiter chars like `%`. + // + + // `#`,`?` in path + '/path/to/%%23%3F+=&.txt?foo=theA1#bar' : { + href : '/path/to/%%23%3F+=&.txt?foo=theA1#bar', + pathname: '/path/to/%#?+=&.txt', + query: { + foo: 'theA1' + }, + hash: "#bar" + }, + + // `#`,`?` in path + `#` in query + '/path/to/%%23%3F+=&.txt?foo=the%231#bar' : { + href : '/path/to/%%23%3F+=&.txt?foo=the%231#bar', + pathname: '/path/to/%#?+=&.txt', + query: { + foo: 'the#1' + }, + hash: "#bar" + }, + + // `?` and `#` in path and search + 'http://ex.com/foo%3F100%m%23r?abc=the%231?&foo=bar#frag': { + href: 'http://ex.com/foo%3F100%m%23r?abc=the%231?&foo=bar#frag', + protocol: 'http:', + hostname: 'ex.com', + hash: '#frag', + search: '?abc=the#1?&foo=bar', + pathname: '/foo?100%m#r', + }, + + // `?` and `#` in search only + 'http://ex.com/fooA100%mBr?abc=the%231?&foo=bar#frag': { + href: 'http://ex.com/fooA100%mBr?abc=the%231?&foo=bar#frag', + protocol: 'http:', + hostname: 'ex.com', + hash: '#frag', + search: '?abc=the#1?&foo=bar', + pathname: '/fooA100%mBr', + } +}; + +Object.keys(formatTests).forEach(function(u) { + test('format(' + u + ')', function() { + var expect = formatTests[u].href; + delete formatTests[u].href; + var actual = url.format(u); + var actualObj = url.format(formatTests[u]); + assert.equal(actual, expect, + 'wonky format(' + u + ') == ' + expect + + '\nactual:' + actual); + assert.equal(actualObj, expect, + 'wonky format(' + JSON.stringify(formatTests[u]) + + ') == ' + expect + + '\nactual: ' + actualObj); + }); +}); + +/* + [from, path, expected] +*/ +var relativeTests = [ + ['/foo/bar/baz', 'quux', '/foo/bar/quux'], + ['/foo/bar/baz', 'quux/asdf', '/foo/bar/quux/asdf'], + ['/foo/bar/baz', 'quux/baz', '/foo/bar/quux/baz'], + ['/foo/bar/baz', '../quux/baz', '/foo/quux/baz'], + ['/foo/bar/baz', '/bar', '/bar'], + ['/foo/bar/baz/', 'quux', '/foo/bar/baz/quux'], + ['/foo/bar/baz/', 'quux/baz', '/foo/bar/baz/quux/baz'], + ['/foo/bar/baz', '../../../../../../../../quux/baz', '/quux/baz'], + ['/foo/bar/baz', '../../../../../../../quux/baz', '/quux/baz'], + ['/foo', '.', '/'], + ['/foo', '..', '/'], + ['/foo/', '.', '/foo/'], + ['/foo/', '..', '/'], + ['/foo/bar', '.', '/foo/'], + ['/foo/bar', '..', '/'], + ['/foo/bar/', '.', '/foo/bar/'], + ['/foo/bar/', '..', '/foo/'], + ['foo/bar', '../../../baz', '../../baz'], + ['foo/bar/', '../../../baz', '../baz'], + ['http://example.com/b//c//d;p?q#blarg', 'https:#hash2', 'https:///#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https:/p/a/t/h?s#hash2', + 'https://p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https://u:p@h.com/p/a/t/h?s#hash2', + 'https://u:p@h.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https:/a/b/c/d', + 'https://a/b/c/d'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:#hash2', + 'http://example.com/b//c//d;p?q#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:/p/a/t/h?s#hash2', + 'http://example.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http://u:p@h.com/p/a/t/h?s#hash2', + 'http://u:p@h.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:/a/b/c/d', + 'http://example.com/a/b/c/d'], + ['/foo/bar/baz', '/../etc/passwd', '/etc/passwd'] +]; + +relativeTests.forEach(function(relativeTest) { + test('resolve(' + [relativeTest[0], relativeTest[1]] + ')', function() { + var a = url.resolve(relativeTest[0], relativeTest[1]), + e = relativeTest[2]; + assert.equal(a, e, + 'resolve(' + [relativeTest[0], relativeTest[1]] + ') == ' + e + + '\n actual=' + a); + }); +}); + + +// https://github.com/joyent/node/issues/568 +[ + undefined, + null, + true, + false, + 0.0, + 0, + [], + {} +].forEach(function(val) { + test('parse(' + val + ')', function() { + assert.throws(function() { url.parse(val); }, TypeError); + }); +}); + + +// +// Tests below taken from Chiron +// http://code.google.com/p/chironjs/source/browse/trunk/src/test/http/url.js +// +// Copyright (c) 2002-2008 Kris Kowal +// used with permission under MIT License +// +// Changes marked with @isaacs + +var bases = [ + 'http://a/b/c/d;p?q', + 'http://a/b/c/d;p?q=1/2', + 'http://a/b/c/d;p=1/2?q', + 'fred:///s//a/b/c', + 'http:///s//a/b/c' +]; + +//[to, from, result] +var relativeTests2 = [ + // http://lists.w3.org/Archives/Public/uri/2004Feb/0114.html + ['../c', 'foo:a/b', 'foo:c'], + ['foo:.', 'foo:a', 'foo:'], + ['/foo/../../../bar', 'zz:abc', 'zz:/bar'], + ['/foo/../bar', 'zz:abc', 'zz:/bar'], + // @isaacs Disagree. Not how web browsers resolve this. + ['foo/../../../bar', 'zz:abc', 'zz:bar'], + // ['foo/../../../bar', 'zz:abc', 'zz:../../bar'], // @isaacs Added + ['foo/../bar', 'zz:abc', 'zz:bar'], + ['zz:.', 'zz:abc', 'zz:'], + ['/.', bases[0], 'http://a/'], + ['/.foo', bases[0], 'http://a/.foo'], + ['.foo', bases[0], 'http://a/b/c/.foo'], + + // http://gbiv.com/protocols/uri/test/rel_examples1.html + // examples from RFC 2396 + ['g:h', bases[0], 'g:h'], + ['g', bases[0], 'http://a/b/c/g'], + ['./g', bases[0], 'http://a/b/c/g'], + ['g/', bases[0], 'http://a/b/c/g/'], + ['/g', bases[0], 'http://a/g'], + ['//g', bases[0], 'http://g/'], + // changed with RFC 2396bis + //('?y', bases[0], 'http://a/b/c/d;p?y'], + ['?y', bases[0], 'http://a/b/c/d;p?y'], + ['g?y', bases[0], 'http://a/b/c/g?y'], + // changed with RFC 2396bis + //('#s', bases[0], CURRENT_DOC_URI + '#s'], + ['#s', bases[0], 'http://a/b/c/d;p?q#s'], + ['g#s', bases[0], 'http://a/b/c/g#s'], + ['g?y#s', bases[0], 'http://a/b/c/g?y#s'], + [';x', bases[0], 'http://a/b/c/;x'], + ['g;x', bases[0], 'http://a/b/c/g;x'], + ['g;x?y#s' , bases[0], 'http://a/b/c/g;x?y#s'], + // changed with RFC 2396bis + //('', bases[0], CURRENT_DOC_URI], + ['', bases[0], 'http://a/b/c/d;p?q'], + ['.', bases[0], 'http://a/b/c/'], + ['./', bases[0], 'http://a/b/c/'], + ['..', bases[0], 'http://a/b/'], + ['../', bases[0], 'http://a/b/'], + ['../g', bases[0], 'http://a/b/g'], + ['../..', bases[0], 'http://a/'], + ['../../', bases[0], 'http://a/'], + ['../../g' , bases[0], 'http://a/g'], + ['../../../g', bases[0], ('http://a/../g', 'http://a/g')], + ['../../../../g', bases[0], ('http://a/../../g', 'http://a/g')], + // changed with RFC 2396bis + //('/./g', bases[0], 'http://a/./g'], + ['/./g', bases[0], 'http://a/g'], + // changed with RFC 2396bis + //('/../g', bases[0], 'http://a/../g'], + ['/../g', bases[0], 'http://a/g'], + ['g.', bases[0], 'http://a/b/c/g.'], + ['.g', bases[0], 'http://a/b/c/.g'], + ['g..', bases[0], 'http://a/b/c/g..'], + ['..g', bases[0], 'http://a/b/c/..g'], + ['./../g', bases[0], 'http://a/b/g'], + ['./g/.', bases[0], 'http://a/b/c/g/'], + ['g/./h', bases[0], 'http://a/b/c/g/h'], + ['g/../h', bases[0], 'http://a/b/c/h'], + ['g;x=1/./y', bases[0], 'http://a/b/c/g;x=1/y'], + ['g;x=1/../y', bases[0], 'http://a/b/c/y'], + ['g?y/./x', bases[0], 'http://a/b/c/g?y/./x'], + ['g?y/../x', bases[0], 'http://a/b/c/g?y/../x'], + ['g#s/./x', bases[0], 'http://a/b/c/g#s/./x'], + ['g#s/../x', bases[0], 'http://a/b/c/g#s/../x'], + ['http:g', bases[0], ('http:g', 'http://a/b/c/g')], + ['http:', bases[0], ('http:', bases[0])], + // not sure where this one originated + ['/a/b/c/./../../g', bases[0], 'http://a/a/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples2.html + // slashes in base URI's query args + ['g', bases[1], 'http://a/b/c/g'], + ['./g', bases[1], 'http://a/b/c/g'], + ['g/', bases[1], 'http://a/b/c/g/'], + ['/g', bases[1], 'http://a/g'], + ['//g', bases[1], 'http://g/'], + // changed in RFC 2396bis + //('?y', bases[1], 'http://a/b/c/?y'], + ['?y', bases[1], 'http://a/b/c/d;p?y'], + ['g?y', bases[1], 'http://a/b/c/g?y'], + ['g?y/./x' , bases[1], 'http://a/b/c/g?y/./x'], + ['g?y/../x', bases[1], 'http://a/b/c/g?y/../x'], + ['g#s', bases[1], 'http://a/b/c/g#s'], + ['g#s/./x' , bases[1], 'http://a/b/c/g#s/./x'], + ['g#s/../x', bases[1], 'http://a/b/c/g#s/../x'], + ['./', bases[1], 'http://a/b/c/'], + ['../', bases[1], 'http://a/b/'], + ['../g', bases[1], 'http://a/b/g'], + ['../../', bases[1], 'http://a/'], + ['../../g' , bases[1], 'http://a/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples3.html + // slashes in path params + // all of these changed in RFC 2396bis + ['g', bases[2], 'http://a/b/c/d;p=1/g'], + ['./g', bases[2], 'http://a/b/c/d;p=1/g'], + ['g/', bases[2], 'http://a/b/c/d;p=1/g/'], + ['g?y', bases[2], 'http://a/b/c/d;p=1/g?y'], + [';x', bases[2], 'http://a/b/c/d;p=1/;x'], + ['g;x', bases[2], 'http://a/b/c/d;p=1/g;x'], + ['g;x=1/./y', bases[2], 'http://a/b/c/d;p=1/g;x=1/y'], + ['g;x=1/../y', bases[2], 'http://a/b/c/d;p=1/y'], + ['./', bases[2], 'http://a/b/c/d;p=1/'], + ['../', bases[2], 'http://a/b/c/'], + ['../g', bases[2], 'http://a/b/c/g'], + ['../../', bases[2], 'http://a/b/'], + ['../../g' , bases[2], 'http://a/b/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples4.html + // double and triple slash, unknown scheme + ['g:h', bases[3], 'g:h'], + ['g', bases[3], 'fred:///s//a/b/g'], + ['./g', bases[3], 'fred:///s//a/b/g'], + ['g/', bases[3], 'fred:///s//a/b/g/'], + ['/g', bases[3], 'fred:///g'], // may change to fred:///s//a/g + ['//g', bases[3], 'fred://g'], // may change to fred:///s//g + ['//g/x', bases[3], 'fred://g/x'], // may change to fred:///s//g/x + ['///g', bases[3], 'fred:///g'], + ['./', bases[3], 'fred:///s//a/b/'], + ['../', bases[3], 'fred:///s//a/'], + ['../g', bases[3], 'fred:///s//a/g'], + + ['../../', bases[3], 'fred:///s//'], + ['../../g' , bases[3], 'fred:///s//g'], + ['../../../g', bases[3], 'fred:///s/g'], + // may change to fred:///s//a/../../../g + ['../../../../g', bases[3], 'fred:///g'], + + // http://gbiv.com/protocols/uri/test/rel_examples5.html + // double and triple slash, well-known scheme + ['g:h', bases[4], 'g:h'], + ['g', bases[4], 'http:///s//a/b/g'], + ['./g', bases[4], 'http:///s//a/b/g'], + ['g/', bases[4], 'http:///s//a/b/g/'], + ['/g', bases[4], 'http:///g'], // may change to http:///s//a/g + ['//g', bases[4], 'http://g/'], // may change to http:///s//g + ['//g/x', bases[4], 'http://g/x'], // may change to http:///s//g/x + ['///g', bases[4], 'http:///g'], + ['./', bases[4], 'http:///s//a/b/'], + ['../', bases[4], 'http:///s//a/'], + ['../g', bases[4], 'http:///s//a/g'], + ['../../', bases[4], 'http:///s//'], + ['../../g' , bases[4], 'http:///s//g'], + // may change to http:///s//a/../../g + ['../../../g', bases[4], 'http:///s/g'], + // may change to http:///s//a/../../../g + ['../../../../g', bases[4], 'http:///g'], + + // from Dan Connelly's tests in http://www.w3.org/2000/10/swap/uripath.py + ['bar:abc', 'foo:xyz', 'bar:abc'], + ['../abc', 'http://example/x/y/z', 'http://example/x/abc'], + ['http://example/x/abc', 'http://example2/x/y/z', 'http://example/x/abc'], + ['../r', 'http://ex/x/y/z', 'http://ex/x/r'], + ['q/r', 'http://ex/x/y', 'http://ex/x/q/r'], + ['q/r#s', 'http://ex/x/y', 'http://ex/x/q/r#s'], + ['q/r#s/t', 'http://ex/x/y', 'http://ex/x/q/r#s/t'], + ['ftp://ex/x/q/r', 'http://ex/x/y', 'ftp://ex/x/q/r'], + ['', 'http://ex/x/y', 'http://ex/x/y'], + ['', 'http://ex/x/y/', 'http://ex/x/y/'], + ['', 'http://ex/x/y/pdq', 'http://ex/x/y/pdq'], + ['z/', 'http://ex/x/y/', 'http://ex/x/y/z/'], + ['#Animal', + 'file:/swap/test/animal.rdf', + 'file:/swap/test/animal.rdf#Animal'], + ['../abc', 'file:/e/x/y/z', 'file:/e/x/abc'], + ['/example/x/abc', 'file:/example2/x/y/z', 'file:/example/x/abc'], + ['../r', 'file:/ex/x/y/z', 'file:/ex/x/r'], + ['/r', 'file:/ex/x/y/z', 'file:/r'], + ['q/r', 'file:/ex/x/y', 'file:/ex/x/q/r'], + ['q/r#s', 'file:/ex/x/y', 'file:/ex/x/q/r#s'], + ['q/r#', 'file:/ex/x/y', 'file:/ex/x/q/r#'], + ['q/r#s/t', 'file:/ex/x/y', 'file:/ex/x/q/r#s/t'], + ['ftp://ex/x/q/r', 'file:/ex/x/y', 'ftp://ex/x/q/r'], + ['', 'file:/ex/x/y', 'file:/ex/x/y'], + ['', 'file:/ex/x/y/', 'file:/ex/x/y/'], + ['', 'file:/ex/x/y/pdq', 'file:/ex/x/y/pdq'], + ['z/', 'file:/ex/x/y/', 'file:/ex/x/y/z/'], + ['file://meetings.example.com/cal#m1', + 'file:/devel/WWW/2000/10/swap/test/reluri-1.n3', + 'file://meetings.example.com/cal#m1'], + ['file://meetings.example.com/cal#m1', + 'file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', + 'file://meetings.example.com/cal#m1'], + ['./#blort', 'file:/some/dir/foo', 'file:/some/dir/#blort'], + ['./#', 'file:/some/dir/foo', 'file:/some/dir/#'], + // Ryan Lee + ['./', 'http://example/x/abc.efg', 'http://example/x/'], + + + // Graham Klyne's tests + // http://www.ninebynine.org/Software/HaskellUtils/Network/UriTest.xls + // 01-31 are from Connelly's cases + + // 32-49 + ['./q:r', 'http://ex/x/y', 'http://ex/x/q:r'], + ['./p=q:r', 'http://ex/x/y', 'http://ex/x/p=q:r'], + ['?pp/rr', 'http://ex/x/y?pp/qq', 'http://ex/x/y?pp/rr'], + ['y/z', 'http://ex/x/y?pp/qq', 'http://ex/x/y/z'], + ['local/qual@domain.org#frag', + 'mailto:local', + 'mailto:local/qual@domain.org#frag'], + ['more/qual2@domain2.org#frag', + 'mailto:local/qual1@domain1.org', + 'mailto:local/more/qual2@domain2.org#frag'], + ['y?q', 'http://ex/x/y?q', 'http://ex/x/y?q'], + ['/x/y?q', 'http://ex?p', 'http://ex/x/y?q'], + ['c/d', 'foo:a/b', 'foo:a/c/d'], + ['/c/d', 'foo:a/b', 'foo:/c/d'], + ['', 'foo:a/b?c#d', 'foo:a/b?c'], + ['b/c', 'foo:a', 'foo:b/c'], + ['../b/c', 'foo:/a/y/z', 'foo:/a/b/c'], + ['./b/c', 'foo:a', 'foo:b/c'], + ['/./b/c', 'foo:a', 'foo:/b/c'], + ['../../d', 'foo://a//b/c', 'foo://a/d'], + ['.', 'foo:a', 'foo:'], + ['..', 'foo:a', 'foo:'], + + // 50-57[cf. TimBL comments -- + // http://lists.w3.org/Archives/Public/uri/2003Feb/0028.html, + // http://lists.w3.org/Archives/Public/uri/2003Jan/0008.html) + ['abc', 'http://example/x/y%2Fz', 'http://example/x/abc'], + ['../../x%2Fabc', 'http://example/a/x/y/z', 'http://example/a/x%2Fabc'], + ['../x%2Fabc', 'http://example/a/x/y%2Fz', 'http://example/a/x%2Fabc'], + ['abc', 'http://example/x%2Fy/z', 'http://example/x%2Fy/abc'], + ['q%3Ar', 'http://ex/x/y', 'http://ex/x/q%3Ar'], + ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], + ['/x%2Fabc', 'http://example/x/y/z', 'http://example/x%2Fabc'], + ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], + + // 70-77 + ['local2@domain2', 'mailto:local1@domain1?query1', 'mailto:local2@domain2'], + ['local2@domain2?query2', + 'mailto:local1@domain1', + 'mailto:local2@domain2?query2'], + ['local2@domain2?query2', + 'mailto:local1@domain1?query1', + 'mailto:local2@domain2?query2'], + ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], + ['local@domain?query2', 'mailto:?query1', 'mailto:local@domain?query2'], + ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], + ['http://example/a/b?c/../d', 'foo:bar', 'http://example/a/b?c/../d'], + ['http://example/a/b#c/../d', 'foo:bar', 'http://example/a/b#c/../d'], + + // 82-88 + // @isaacs Disagree. Not how browsers do it. + // ['http:this', 'http://example.org/base/uri', 'http:this'], + // @isaacs Added + ['http:this', 'http://example.org/base/uri', 'http://example.org/base/this'], + ['http:this', 'http:base', 'http:this'], + ['.//g', 'f:/a', 'f://g'], + ['b/c//d/e', 'f://example.org/base/a', 'f://example.org/base/b/c//d/e'], + ['m2@example.ord/c2@example.org', + 'mid:m@example.ord/c@example.org', + 'mid:m@example.ord/m2@example.ord/c2@example.org'], + ['mini1.xml', + 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/', + 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/mini1.xml'], + ['../b/c', 'foo:a/y/z', 'foo:a/b/c'], + + //changeing auth + ['http://diff:auth@www.example.com', + 'http://asdf:qwer@www.example.com', + 'http://diff:auth@www.example.com/'] +]; + +relativeTests2.forEach(function(relativeTest) { + test('resolve(' + [relativeTest[1], relativeTest[0]] + ')', function() { + var a = url.resolve(relativeTest[1], relativeTest[0]), + e = relativeTest[2]; + assert.equal(a, e, + 'resolve(' + [relativeTest[1], relativeTest[0]] + ') == ' + e + + '\n actual=' + a); + }); +}); + +//if format and parse are inverse operations then +//resolveObject(parse(x), y) == parse(resolve(x, y)) + +//host and hostname are special, in this case a '' value is important +var emptyIsImportant = {'host': true, 'hostname': ''}; + +//format: [from, path, expected] +relativeTests.forEach(function(relativeTest) { +test('resolveObject(' + [relativeTest[0], relativeTest[1]] + ')', function() { + var actual = url.resolveObject(url.parse(relativeTest[0]), relativeTest[1]), + expected = url.parse(relativeTest[2]); + + + assert.deepEqual(actual, expected); + + expected = relativeTest[2]; + actual = url.format(actual); + + assert.equal(actual, expected, + 'format(' + actual + ') == ' + expected + '\nactual:' + actual); + }); +}); + +//format: [to, from, result] +// the test: ['.//g', 'f:/a', 'f://g'] is a fundamental problem +// url.parse('f:/a') does not have a host +// url.resolve('f:/a', './/g') does not have a host because you have moved +// down to the g directory. i.e. f: //g, however when this url is parsed +// f:// will indicate that the host is g which is not the case. +// it is unclear to me how to keep this information from being lost +// it may be that a pathname of ////g should collapse to /g but this seems +// to be a lot of work for an edge case. Right now I remove the test +if (relativeTests2[181][0] === './/g' && + relativeTests2[181][1] === 'f:/a' && + relativeTests2[181][2] === 'f://g') { + relativeTests2.splice(181, 1); +} + +relativeTests2.forEach(function(relativeTest) { + test('resolveObject(' + [relativeTest[1], relativeTest[0]] + ')', function() { + var actual = url.resolveObject(url.parse(relativeTest[1]), relativeTest[0]), + expected = url.parse(relativeTest[2]); + + assert.deepEqual(actual, expected); + + var expected = relativeTest[2], + actual = url.format(actual); + + assert.equal(actual, expected, + 'format(' + relativeTest[1] + ') == ' + expected + + '\nactual:' + actual); + }); +}); diff --git a/node_modules/url/url.js b/node_modules/url/url.js new file mode 100644 index 0000000..23ac6f5 --- /dev/null +++ b/node_modules/url/url.js @@ -0,0 +1,732 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var punycode = require('punycode'); +var util = require('./util'); + +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +exports.Url = Url; + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && util.isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; +} + +Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!util.isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.path = rest; + this.href = rest; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ''; + this.query = {}; + } + return this; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + this.hostname = punycode.toASCII(this.hostname); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; +}; + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (util.isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); +} + +Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + util.isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; +}; + +function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); +} + +Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); +}; + +function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); +} + +Url.prototype.resolveObject = function(relative) { + if (util.isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; + result[k] = relative[k]; + } + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!util.isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last === '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; +}; + +Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; +}; diff --git a/node_modules/url/util.js b/node_modules/url/util.js new file mode 100644 index 0000000..97dcf31 --- /dev/null +++ b/node_modules/url/util.js @@ -0,0 +1,16 @@ +'use strict'; + +module.exports = { + isString: function(arg) { + return typeof(arg) === 'string'; + }, + isObject: function(arg) { + return typeof(arg) === 'object' && arg !== null; + }, + isNull: function(arg) { + return arg === null; + }, + isNullOrUndefined: function(arg) { + return arg == null; + } +}; diff --git a/package-lock.json b/package-lock.json index 9b5d4cd..388b44c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,125 @@ { "name": "ratzbot", - "version": "3.0.0", + "version": "3.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@tensorflow/tfjs": { + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs/-/tfjs-0.12.4.tgz", + "integrity": "sha512-K/UZ0QyRqs36HWJcrddYz0AGpFtTJgWoIwUjG5041CixoEb3uyKS4ejEjECRdPy6TPFpjnIyYuO4hZMc3ny/Vg==", + "requires": { + "@tensorflow/tfjs-converter": "0.5.5", + "@tensorflow/tfjs-core": "0.12.8", + "@tensorflow/tfjs-layers": "0.7.2" + } + }, + "@tensorflow/tfjs-converter": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-0.5.5.tgz", + "integrity": "sha512-tLIv4u0+BtE61oarjQWJUsL0Ro54YmiDx8XVCbN9QY34V6zZrNFr/VJYZEIZnKcepCQ0MxZ09mggnfBD3EvMrQ==", + "requires": { + "@types/long": "~3.0.32", + "protobufjs": "~6.8.6", + "url": "~0.11.0" + } + }, + "@tensorflow/tfjs-core": { + "version": "0.12.8", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-0.12.8.tgz", + "integrity": "sha512-Rm3HgjZ0hMbWz8Vj/s9wLtP4ddp+1mi7SyrAbcQ9dU/jnjGupiXBWnAUjiSsID5FtBpVYvvlIxSegmWQxcXorg==", + "requires": { + "@types/seedrandom": "~2.4.27", + "@types/webgl-ext": "~0.0.29", + "@types/webgl2": "~0.0.4", + "seedrandom": "~2.4.3" + } + }, + "@tensorflow/tfjs-layers": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-layers/-/tfjs-layers-0.7.2.tgz", + "integrity": "sha512-NwGmyYCrzV8cYycqA9fVfBWaz1zS1hqHP5MsRwU1m92TX/5lEhRClRmVCHJ4K8/GR+tYMl1PR/qCkeRjttwk7A==" + }, + "@types/long": { + "version": "3.0.32", + "resolved": "https://registry.npmjs.org/@types/long/-/long-3.0.32.tgz", + "integrity": "sha512-ZXyOOm83p7X8p3s0IYM3VeueNmHpkk/yMlP8CLeOnEcu6hIwPH7YjZBvhQkR0ZFS2DqZAxKtJ/M5fcuv3OU5BA==" + }, "@types/node": { "version": "8.10.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.20.tgz", "integrity": "sha512-M7x8+5D1k/CuA6jhiwuSCmE8sbUWJF0wYsjcig9WrXvwUI5ArEoUBdOXpV4JcEMrLp02/QbDjw+kI+vQeKyQgg==", "dev": true }, + "@types/seedrandom": { + "version": "2.4.27", + "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.27.tgz", + "integrity": "sha1-nbVjk33YaRX2kJK8QyWdL0hXjkE=" + }, + "@types/webgl-ext": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/webgl-ext/-/webgl-ext-0.0.29.tgz", + "integrity": "sha512-ZlVjDQU5Vlc9hF4LGdDldujZUf0amwlwGv1RI2bfvdrEHIl6X/7MZVpemJUjS7NxD9XaKfE8SlFrxsfXpUkt/A==" + }, + "@types/webgl2": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@types/webgl2/-/webgl2-0.0.4.tgz", + "integrity": "sha512-PACt1xdErJbMUOUweSrbVM7gSIYm1vTncW2hF6Os/EeWi6TXYAYMPp+8v6rzHmypE5gHrxaxZNXgMkJVIdZpHw==" + }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -216,6 +326,12 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "coffeescript": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.3.1.tgz", + "integrity": "sha512-DNJmSPMyiz+OjWYyuDXNBcFutDjP2TS2owsZ8YvT65hA8c5IdHWIBqdA3Yf/XHoK23d/f1HqLjQbEJJZJoeV1w==", + "dev": true + }, "combined-stream": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", @@ -1906,6 +2022,38 @@ "through2": "~0.2.3" } }, + "protobufjs": { + "version": "6.8.8", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", + "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + }, + "dependencies": { + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + }, + "@types/node": { + "version": "10.5.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.7.tgz", + "integrity": "sha512-VkKcfuitP+Nc/TaTFH0B8qNmn+6NbI6crLkQonbedViVz7O2w8QV/GERPlkJ4bg42VGHiEWa31CoTOPs1q6z1w==" + } + } + }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -1916,6 +2064,11 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -2031,6 +2184,11 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, + "seedrandom": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-2.4.3.tgz", + "integrity": "sha1-JDhQTa0zkXMUv/GKxNeU8W1qrsw=" + }, "seek-bzip": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", @@ -2304,6 +2462,22 @@ "through": "^2.3.6" } }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + } + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index b228de2..896c9c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ratzbot", - "version": "3.0.0", + "version": "3.1.0", "description": "Discord bot for Twitch streamer ratzDoll", "main": "main.js", "scripts": { @@ -10,6 +10,7 @@ "author": "Gavin Isgar", "license": "GPL-3.0-or-later", "dependencies": { + "@tensorflow/tfjs": "^0.12.4", "discord-rpc": "^3.0.0-beta.11", "discord.js": "^11.3.2", "ffmpeg-binaries": "^4.0.0", @@ -18,6 +19,7 @@ "ytdl-core": "^0.20.4" }, "devDependencies": { + "coffeescript": "^2.3.1", "electron": "^2.0.2" } }